* 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. C++程序开发的基本过程

    前两天说去一家小公司实习,被他们的一个技术员工的一个问题问到了,问的我当时都没有反应过来,回来后突然发现这个问题我会啊 ,只是当时没想到这么浅显.现在总结下: C++程序开发的基本过程: 1)编辑 开 ...

  2. 干货 | TensorFlow的55个经典案例

    转自1024深度学习 导语:本文是TensorFlow实现流行机器学习算法的教程汇集,目标是让读者可以轻松通过清晰简明的案例深入了解 TensorFlow.这些案例适合那些想要实现一些 TensorF ...

  3. Python 之 风格规范(Google )

    开头先mark一下网址:goole官网 任何语言的程序员,编写出符合规范的代码,是开始程序生涯的第一步. 一.分号 不要在行尾加分号, 也不要用分号将两条命令放在同一行. 二.行长度 每行不超过80个 ...

  4. 三维点集拟合:平面拟合、RANSAC、ICP算法

    ACM算法分类:http://www.kuqin.com/algorithm/20080229/4071.html 一: 拟合一个平面:使用SVD分解,代码里面去找吧 空间平面方程的一般表达式为: A ...

  5. C++的Matlab接口

    与 原文 过程有些不同,根据具体环境自行配置即可! 转自于:http://blog.csdn.net/left_la/article/details/8206645 我的计算机环境是win7 64位系 ...

  6. 基于Linux/C++简单线程池的实现

    我们知道Java语言对于多线程的支持十分丰富,JDK本身提供了很多性能优良的库,包括ThreadPoolExecutor和ScheduleThreadPoolExecutor等.C++11中的STL也 ...

  7. SpringMVC(五)@RequestHeader和@CookieValue

    通过使用@RequestHeader获取请求头 通过使用@CookieValue获取cookie值 代码: 1: @Controller 2: public class TestHeader_Cook ...

  8. paramiko模块学习笔记

    SSHClient 基于用户名密码连接 import paramiko # 创建SSH对象 ssh = paramiko.SSHClient() # 允许连接不在know_hosts文件中的主机 ss ...

  9. <转>统计源代码行数的一些实现方法

    这个问题的思考其实对于某一种语言而言,基本都能实现,只是简单和复杂而已.而此次我讨论就是只是在linux下面使用了shell和c对源代码进行行 数的讨论.本打算是实现一个python版本的,由于pyt ...

  10. Linux 密码的暴力破解

    Linux 的密码的介绍 两个文件 1 . /etc/passwd 2 . /etc/shadow ## 关于/etc/shadow 文件的介绍 1 . 第一个字段是用户名 2 . 第二字字段是加密的 ...