Rep Invariant and Abstraction Function
* 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的更多相关文章
- SC || Chapter 3
┉┉∞ ∞┉┉┉┉∞ ∞┉┉┉∞ ∞┉┉ 基本数据类型 && 对象数据类型 基本数据类型(int char long) 在栈中分配内存,不可变 对象数据类型(String BigInt ...
- 【软件构造】第三章第三节 抽象数据型(ADT)
第三章第三节 抽象数据型(ADT) 3-1节研究了“数据类型”及其特性 ; 3-2节研究了方法和操作的“规约”及其特性:在本节中,我们将数据和操作复合起来,构成ADT,学习ADT的核心特征,以及如何设 ...
- HIT Software Construction Lab 2
2019年春季学期 计算机学院<软件构造>课程 Lab 2实验报告 姓名 刘帅 学号 班号 1703008 电子邮件 1609192321@qq.com 手机号码 目录 1 实验目标概 ...
- 哈工大软件构造Lab2(2022)
(防扒小助手) 本人CSDN博客: https://blog.csdn.net/m0_61753302https://blog.csdn.net/m0_61753302本人博客园博客(同步CSDN): ...
- 软件构造Lab2实验总结
本次实验训练抽象数据类型(ADT)的设计.规约.测试,并使用面向对象编程(OOP)技术实现ADT.具体来说内容如下: 针对给定的应用问题,从问题描述中识别所需的ADT: 设计ADT规约(pre-con ...
- JS中的进制转换以及作用
js的进制转换, 分为2进制,8进制,10进制,16进制之间的相互转换, 我们直接利用 对象.toString()即可实现: //10进制转为16进制 ().toString() // =>&q ...
- mobx源码解读1
mobx是redux的代替品,其本身就是一个很好的MVVM框架.因此花点力气研究一下它. 网上下最新的2.75 function Todo() { this.id = Math.random() mo ...
- JS简单加密
//简单的jS加密解密//code为对应的字符串,h为(2,8,10,16)就是要转成的几进制function en(code, h) { var monyer = new Array();var i ...
- 文件上传之伪Ajax方式上传
From: <由 Windows Internet Explorer 8 保存> Subject: =?gb2312?B?zsS8/snPtKvWrs6xQWpheLe9yr3Jz7SrI ...
随机推荐
- 文档控件NTKO OFFICE 详细使用说明之预览PDF文件(禁止打印、下载、另存为、防抓包下载)
1.在线预览PDF文件(禁止打印.下载.复制.另存为) (1) 运行环境 ① 浏览器:支持IE7-IE11(平台版本还支持Chrome和Firefox) ② IE工具栏-Internet 选项:将ww ...
- vue 脚手架 使用步骤
当我知道搭建脚手架得使用命令行的时候.我就崩溃了.所以写一篇记录以后留着自己用也方便大家. 首先要安装一个node 环境, 1.打开cmd 进到你要建项目的目录: E: ...
- 修复lsp,360浏览器可以上网其它软件不行
netsh winsock reset netsh int ip reset 重启电脑
- VS2012编译PCL1.70的过程
以防博主删除文档,重新copy一遍... 关于个人的几个注意事项: 对于boost,可以使用vc100的库,来编译VC110的代码: 对于确实的包含,一个一个添加,要耐心等待!!! 原文链接:http ...
- 模拟一个简单的基于tcp的远程关机程序(转)
最近在学习unix网络编程,现在正在学习tcp的通信.其实,只要建立起了tcp通信,操作远端的计算机就不是什么问题了.正向telnet一样,也是基于tcp/IP协议的.所以这个实验,也算是对telne ...
- Django使用中常见的错误
Django Mysql SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED Django 执行makemigrations 的时候报错 ...
- JS 20180416考试
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- 路飞学城Python-Day75
1.什么是Django? Django是一个web框架,也是python中最火的一个框架,应用最多,内容最全 2.什么是web框架? python的一个脚本就是一个应用程序,web框架就是和前端有关系 ...
- 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
这是在复制代码的时候,没有修改路径,但是IDEA没有报错,还会爆出 WARN ework.web.servlet.PageNotFound - No mapping found for HTTP re ...
- java中Map遍历的四种方式
在java中所有的map都实现了Map接口,因此所有的Map(如HashMap, TreeMap, LinkedHashMap, Hashtable等)都可以用以下的方式去遍历. 方法一:在for循环 ...