Alias analysis has been an interesting research topic in verification and optimization of programs. The undecidability of determining whether two expressions in a program may reference to the same object is the main source of the challenges raised in alias analysis. In this paper we propose an extension of a previously introduced alias calculus based on program expressions, to the setting of unbounded program executions s.a. infinite loops and recursive calls. Moreover, we devise a corresponding executable specification in the K-framework. An important property of our extension is that, in a non-concurrent setting, the corresponding alias expressions can be over-approximated in terms of a notion of regular expressions. This further enables us to show that the associated K-machinery implements an algorithm that always stops and provides a sound over-approximation of the "may aliasing" information, where soundness stands for the lack of false negatives. As a case study, we analyze the integration and further applications of the alias calculus in SCOOP. The latter is an object-oriented programming model for concurrency, recently formalized in Maude; K-definitions can be compiled into Maude for execution.
Why Aren't Regular Expressions a Lingua Franca? An Empirical Study on the Re-use and Portability of Regular Expressions
本文探讨了正则表达式(regex)跨程序设计语言的可移植性。许多语言都提供类似的正则表达式语法,因此很自然地认为正则表达式可以跨语言边界移植。但是,正则表达式是否可以跨语言边界复制/粘贴,同时保留其语义和性能特征?在我们对158名专业软件开发人员的调查中,大多数人表示他们跨语言边界重用regex,大约一半的人报告说他们认为regex是一种通用语言。我们使用一个新的正则表达式语料库对这种做法的风险进行了实验性评估--来自193,524个项目的537,806个正则表达式,这些项目使用JavaScript、Java、PHP、Python、Ruby、Go、Perl和Rust编写。使用我们的polyglot正则表达式语料库,我们探讨了迄今尚未研究的正则表达式可移植性问题:由于语义差异的逻辑错误,由于性能差异的安全漏洞。我们报告说,开发人员对regex lingua franca的信念是可以理解的,但没有根据。虽然大多数正则表达式跨语言边界编译,但15%的正则表达式表现出跨语言的语义差异,10%的正则表达式表现出跨语言的性能差异。我们使用regex文档解释了这些差异,并通过调查regex引擎实现进一步阐明了我们的发现。在此过程中,我们发现了JavaScript-V8、Python、Ruby和Rust的正则表达式引擎中的错误,以及数千个模块中潜在的语义和性能正则表达式错误。
Ownership Confinement Ensures Representation Independence for Object-Oriented Programs
献给Edsger W. Dijkstra的记忆。表示独立性或关系参数化形式上表征了数据抽象语言结构提供的封装,并证明了模拟推理的合理性。表示独立性已经在各种语言和构造中得到了证明,但在对可变状态的共享引用中却没有;事实上,它在这些语言中通常是失败的。本文阐述了表示类的独立性,在一个命令式的,面向对象的语言与指针,子类化和动态调度,面向类的可见性控制,递归类型和方法,以及一个简单的模块形式。类的实例被认为是使用私有字段和所谓的表示对象来实现抽象。表示对象的封装通过对别名的限制(称为限制)来表示。证明了满足约束条件的程序的表示独立性。一个静态分析,接受常见的设计,如观察者和工厂模式的限制。形式化不仅考虑了客户端和提供抽象的类之间的通常接口,还考虑了类和它的子类之间的接口(通常称为“受保护的”)。