* 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. RAR 5.50 控制台使用记录

    copy from  WinRAR用户手册,备忘 用户手册 ~~~~~~~~ RAR 5.50 控制台版本 ~~~~~~~~~~~~~~~~~~~ =-=-=-=-=-=-=-=-=-=-=-=-=- ...

  2. Android网络编程随想录(2)

    上篇文章介绍了传输层TCP协议的理论知识,本文主要介绍了TCP协议基础之上HTTP协议和HTTPS协议的理论知识. HTTP协议基于TCP协议定义了客户端向服务器请求数据的方式,它是面向事务的应用层协 ...

  3. unity3d 让物体移动到点击位置

    using UnityEngine; using System.Collections; public class test : MonoBehaviour { //在场景中鼠标点击地面后,角色可以移 ...

  4. 【转】linux 增加用户 useradd 用法小结及配置文件说明

    原文地址:https://blog.csdn.net/warden2010/article/details/5132290 在Linux 系统中,所有的用户和组像一个国家.如果国家要繁荣昌盛的话,需要 ...

  5. DB2解决死锁

    方法一.查看db2diag.log文件 找到DeadLock or Lock timeout搜索 死锁或锁超时信息db2 force application(句柄ID)直接结束进程即可. 方法二.DB ...

  6. 【udacity】机器学习-波士顿房价预测

    import numpy as np import pandas as pd from Udacity.model_check.boston_house_price import visuals as ...

  7. 我的第一个 Windows 窗口程序(1)

    一般来说,构建一个 Windows 程序可以分为如下几个步骤: 定义窗口类(WNDCLASS) 注册窗口类(RegisterClass) 创建窗口(CreateWindow) 更新显示窗口(Updat ...

  8. POJ 2395 Out of Hay( 最小生成树 )

    链接:传送门 题意:求最小生成树中的权值最大边 /************************************************************************* & ...

  9. 使用Ansible安装部署nginx+php+mysql之安装php(2)

    二.使用Ansible安装php 1.php.yaml文件内容 - hosts: clong remote_user: root gather_facts: no tasks: # 安装libseli ...

  10. 浅谈urllib和requests

    urllib和requests的学习 urllib requests 参考资料 urllib urllib是python的基本库之一,内置四大模块,即request,error,parse,robot ...