* According to the Reading 13 of MIT 6.005 course

In order to finish Lab 2, in which the ps 2 gives instructions about rep invariant and abstract function, I read the reading material released by MIT 6.005.

1. Some Terminology

The space of representation value: actual implementation

The space of abstract value: values that the type is designed to support, mainly about imagination stuffs

2. Example

As the figure given above, the map between R and A maps the elements in R to A

Apparently, we can easily find out that:

1). Every abstract value is mapped by some rep value

2). Some abstract value are mapped to by more than one rep value

3). Not all rep values are mapped

So it is a surjection but maybe not an injection

Rep Invariant: maps the rep values to booleans

RI: R->boolean

Abstraction Function: maps rep values to the abstract values they represent

AF:R->A

3. Explanation

1). The abstraction function and the rep invariants are not determined by the choice of rep and abstract value spaces

2). The abstract value space alone doesn't determine AF/RI

For the same abstract type, there can be several representations

3). The choice of both spaces doesn't determine AF and RI

Same rep space but different rep invariant. We can set different rules to restrict the values of the rep space such as no duplication and nondecreasing.

Rep Invariant and Abstraction Function的更多相关文章

  1. SC || Chapter 3

    ┉┉∞ ∞┉┉┉┉∞ ∞┉┉┉∞ ∞┉┉ 基本数据类型 && 对象数据类型 基本数据类型(int char long) 在栈中分配内存,不可变 对象数据类型(String BigInt ...

  2. 【软件构造】第三章第三节 抽象数据型(ADT)

    第三章第三节 抽象数据型(ADT) 3-1节研究了“数据类型”及其特性 ; 3-2节研究了方法和操作的“规约”及其特性:在本节中,我们将数据和操作复合起来,构成ADT,学习ADT的核心特征,以及如何设 ...

  3. HIT Software Construction Lab 2

    2019年春季学期 计算机学院<软件构造>课程 Lab 2实验报告 姓名 刘帅 学号 班号 1703008 电子邮件 1609192321@qq.com 手机号码 目录   1 实验目标概 ...

  4. 哈工大软件构造Lab2(2022)

    (防扒小助手) 本人CSDN博客: https://blog.csdn.net/m0_61753302https://blog.csdn.net/m0_61753302本人博客园博客(同步CSDN): ...

  5. 软件构造Lab2实验总结

    本次实验训练抽象数据类型(ADT)的设计.规约.测试,并使用面向对象编程(OOP)技术实现ADT.具体来说内容如下: 针对给定的应用问题,从问题描述中识别所需的ADT: 设计ADT规约(pre-con ...

  6. JS中的进制转换以及作用

    js的进制转换, 分为2进制,8进制,10进制,16进制之间的相互转换, 我们直接利用 对象.toString()即可实现: //10进制转为16进制 ().toString() // =>&q ...

  7. mobx源码解读1

    mobx是redux的代替品,其本身就是一个很好的MVVM框架.因此花点力气研究一下它. 网上下最新的2.75 function Todo() { this.id = Math.random() mo ...

  8. JS简单加密

    //简单的jS加密解密//code为对应的字符串,h为(2,8,10,16)就是要转成的几进制function en(code, h) { var monyer = new Array();var i ...

  9. 文件上传之伪Ajax方式上传

    From: <由 Windows Internet Explorer 8 保存> Subject: =?gb2312?B?zsS8/snPtKvWrs6xQWpheLe9yr3Jz7SrI ...

随机推荐

  1. 在AndroidManifest(清单文件)中注册activity(活动)及配置主活动、更改App图标、App名称、修改隐藏标题栏

    打开app/src/main/AndroidManifest. <?xml version="1.0" encoding="utf-8"?> < ...

  2. List 常用方法解析

    1.Count属性 (获得List中元素数目) 2.Add( ) 在List中添加一个对象的公有方法 3.AddRange( ) 公有方法,在List尾部添加实现了ICollection接口的多个元素 ...

  3. 我的wordpress在Nginx的配置

    lnmp生成过程 You select the exist rewrite rule:/usr/local/nginx/conf/wordpress.conf Gracefully shutting ...

  4. LINUX 环境安装 jdk-tomcat安装

    linux版本两种安装方式 卸载自带jdk $rpm -qa | grep java $ rpm -e --nodeps java-**-openjdk-*$ rpm -e --nodeps java ...

  5. jQuery访问json文件

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  6. Asp.net Core 源码-PagedList<T>

    using System.Collections.Generic; using System.Linq; using System; using System.Linq.Expressions; us ...

  7. virtualenv 虚拟环境依赖安装

    虚拟环境依赖安装 开发要学会用 virtualenv 来管理多个开发环境 Ubuntu/Centos/MacOS 下 virtualenvwrapper 使得virtualenv变得更好用,所以我们一 ...

  8. Kaggle竞赛顶尖选手经验汇总

    What is your first plan of action when working on a new competition? 理解竞赛,数据,评价标准. 建立交叉验证集. 制定.更新计划. ...

  9. mybatis传入参数类型parameterType详解

    前言 Mybatis的Mapper文件中的select.insert.update.delete元素中都有一个parameterType属性,用于对应的mapper接口方法接受的参数类型. ( res ...

  10. CentOS 7 yum 安装redis(更简单)

    一.安装redis 1.检查是否有redis yum 源 1 yum install redis 2.下载fedora的epel仓库 1 yum install epel-release 3.安装re ...