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 ...
随机推荐
- TensorFlow-mnist
训练代码: from __future__ import absolute_import from __future__ import division from __future__ import ...
- classname在JavaScript中的应用
<html> <head> <meta charset="utf-8"> <title>无标题文档</title> &l ...
- Android Studio插件:Android Drawable Importer
Android Drawable Importer 为了在不同分辨率的设备上更好的展示图片的效果,我们往往需要在 res/drawable 中添加不同分辨率的图片.有时我们可能手里只有一份分辨率的图片 ...
- todo reading
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Function/bind https ...
- MyProject
[PROJECT_20190101]20371230[PROJECT_20190101]
- vsftp进阶-锁定目录
把用户锁定到特定的目录下面: 一.配置文件: #grep -Ev "^#|^$" /etc/vsftpd/vsftpd.conf anonymous_enable=NOlocal_ ...
- 01--vim常用快捷键
Linux中vim编辑器的功能非常强大,许多常用快捷键用起来非常方便,这里将我学vim入门时学的一些常用的快捷键分享给大家一下,希望可以帮助你们. 这个是我将鸟哥书上的进行了一下整理的,希望不要涉 ...
- C# model代码生成器
using System.Collections.Generic; using System.Text; public class Class1 { //传递 1.表名 2.列名 3.类型 publi ...
- Project Euler 46 Goldbach's other conjecture( 线性筛法 )
题意: 克里斯蒂安·哥德巴赫曾经猜想,每个奇合数可以写成一个素数和一个平方的两倍之和 9 = 7 + 2×1215 = 7 + 2×2221 = 3 + 2×3225 = 7 + 2×3227 = 1 ...
- hibernate在maven中自动生成
1.构建数据库连接 2.新建maven项目,利用工具生成hibernate相应的类和xml文件 新建pojo包 右击项目 点击Configure Facets 选择hibernate 选择包 选择驱动 ...