arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1802.06224cs.SE
收藏

从Object-Z规范生成Python代码

Generating Python Code From Object-Z Specifications

A. F. Al Azzawi, M. Bettaz, H. M. Al-Refai

摘要:

Object-Z是一种面向对象的规约语言,它用类、对象、继承和多态性扩展了Z语言,可用于将复杂系统的规约表示为对象的集合。有许多现有的作品将Object-Z映射到C++和Java程序设计语言。由于Python和Object-Z有许多相似之处,都是面向对象的范型,支持集合论和谓词演算,而且Python是一种函数式程序设计语言,自然更接近于形式化规范,因此我们提出了一种从Object-Z规范到Python代码的映射,该映射涵盖了Object-Z的一些结构,并将其规范用Python表示,以验证这些规范。验证用于映射覆盖的前置条件,后置条件和使用lambda函数和Python的装饰器构建的不变量。这项工作发现Python是一种优秀的语言,用于开发库以将Object-Z规范映射到Python。

英文摘要:

Object-Z is an object-oriented specification language which extends the Z language with classes, objects, inheritance and polymorphism that can be used to represent the specification of a complex system as collections of objects. There are a number of existing works that mapped Object-Z to C++ and Java programming languages. Since Python and Object-Z share many similarities, both are object-oriented paradigm, support set theory and predicate calculus moreover, Python is a functional programming language which is naturally closer to formal specifications, we propose a mapping from Object-Z specifications to Python code that covers some Object-Z constructs and express its specifications in Python to validate these specifications. The validations are used in the mapping covered preconditions, post-conditions, and invariants that are built using lambda function and Python's decorator. This work has found Python is an excellent language for developing libraries to map Object-Z specifications to Python.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑