Adding versatile interactions to imperative programming -- C, Java and Android -- is an essential task. Unfortunately, existing languages provide only limited constructs for user interaction. These constructs are usually in the form of $unbounded$ quantification. For example, existing languages can take the keyboard input from the user only via the $read(x)/scan(x)$ construct. Note that the value of $x$ is unbounded in the sense that $x$ can have any value. This construct is thus not useful for applications with bounded inputs. To support bounded choices, we propose new bounded-choice statements for user interation. Each input device (the keyboard, the mouse, the touch, $...$) naturally requires a new bounded-choice statement. To make things simple, however, we focus on a bounded-choice statement for keyboard -- kchoose -- to allow for more controlled and more guided participation from the user. It is straightforward to adjust our idea to other input devices. We illustrate our idea via Java(BI), an extension of the core Java with a new bounded-choice statement for the keyboard.
Test Case Generation for Object-Oriented Imperative Languages in CLP
测试是软件开发过程的重要组成部分。测试用例生成(Test Case Generation,TCG)是自动生成应用于被测系统的测试用例集的过程。白盒TCG通常通过符号执行来执行,即,代替对正常值执行程序(例如,numbers),则程序在表示任意值的符号值上执行。在处理面向对象(OO)命令式语言时,符号执行变得具有挑战性,因为它必须能够回溯,复杂的堆分配数据结构应该在TCG过程中创建,并且必须考虑继承,虚拟调用和异常等特性。由于其固有的符号执行机制,我们追求在本文中,约束逻辑程序设计(CLP)有一个很好的未开发的应用领域在TCG。我们将支持我们的主张,开发一个完全基于CLP的框架,以TCG的面向对象的命令式语言,并通过评估它对一组具有挑战性的Java程序的相应实现。我们的方法的一个独特的特点是,它只使用CLP来处理所有的语言特征,而不需要开发特定的约束运算符(例如,对堆进行建模)。
Ownership Confinement Ensures Representation Independence for Object-Oriented Programs
献给Edsger W. Dijkstra的记忆。表示独立性或关系参数化形式上表征了数据抽象语言结构提供的封装,并证明了模拟推理的合理性。表示独立性已经在各种语言和构造中得到了证明,但在对可变状态的共享引用中却没有;事实上,它在这些语言中通常是失败的。本文阐述了表示类的独立性,在一个命令式的,面向对象的语言与指针,子类化和动态调度,面向类的可见性控制,递归类型和方法,以及一个简单的模块形式。类的实例被认为是使用私有字段和所谓的表示对象来实现抽象。表示对象的封装通过对别名的限制(称为限制)来表示。证明了满足约束条件的程序的表示独立性。一个静态分析,接受常见的设计,如观察者和工厂模式的限制。形式化不仅考虑了客户端和提供抽象的类之间的通常接口,还考虑了类和它的子类之间的接口(通常称为“受保护的”)。
Univ. Lille, CNRS, Centrale Lille, UMR 9189 CRIStAL(里尔大学,法国国家科学研究中心,中央里尔学院,CRIStAL联合研究实验室);Univ. Lille, Inria, CNRS, Centrale Lille, UMR 9189 CRIStAL(里尔大学,法国国家信息与自动化研究所,法国国家科学研究中心,中央里尔学院,CRIStAL联合研究实验室)