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 ...
随机推荐
- python ansible api
#!/usr/bin/env python # -*- coding: utf-8 -*- # @File : test2.py # @Author: Anthony.waa # @Date : 20 ...
- for循环和数组的应用
<html> <head> <meta charset="utf-8"> <title>无标题文档</title> &l ...
- 经典C/S服务器模型之守护进程
linux编程-守护进程编写 守护进程(Daemon)是运行在后台的一种特殊进程.它独立于控制终端并且周期性地执行某种任务或等待处理某些发生的事件.守护进程是一种很有用的进程. Linux的大多数服务 ...
- boost的单例模式
template <typename T> struct singleton_default { private: struct object_creator { ...
- (转) RabbitMQ学习之spring整合发送异步消息
http://blog.csdn.net/zhu_tianwei/article/details/40919031 实现使用Exchange类型为DirectExchange. routingkey的 ...
- Mysql重复数据查询置为空
前两天产品有个需求,相同的商品因为价格不同而分开展示,但是明细还是算一条明细,具体区分展示出商品的价格和数量信息,其他重复的商品信息要置空. 需求并不难,用程序代码循环处理就可以了.但是后面涉及到打印 ...
- python简单的输入与输出
1 首先利用python完成简单的输出,运行如下: python和c语言类似,但又有所不同,python开发快,语言简洁,我是这样对比学的 输出:print+空格+'要输出的内容',一定要是英文状态下 ...
- Shader渲染动画
一.概述 先看一下Shader类的介绍: /** * Shader is the based class for objects that return horizontal spans of col ...
- 序列模型(3)---LSTM(长短时记忆)
摘自https://www.cnblogs.com/pinard/p/6519110.html 一.RNN回顾 略去上面三层,即o,L,y,则RNN的模型可以简化成如下图的形式: 二.LSTM模型结构 ...
- Virtual servers on a Raspberry Pi with the light weight OS virtualization system Docker!
转自:http://www.hyggeit.dk/2014/02/virtual-servers-on-raspberry-pi-with.html Virtual servers on a Rasp ...