Generating Python Code From Object-Z Specifications
نویسندگان
چکیده
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.
منابع مشابه
Refinement of Object-Z Specifications Using Morgan-s Refinement Calculus
Morgan’s refinement calculus (MRC) is one of the well-known methods allowing the formality presented in the program specification to be continued all the way to code. On the other hand, Object-Z (OZ) is an extension of Z adding support for classes and objects. There are a number of methods for obtaining code from OZ specifications that can be categorized into refinement and animation methods. A...
متن کاملRefinement of Object-Z Specifications Using Morgan-s Refinement Calculus
Morgan’s refinement calculus (MRC) is one of the well-known methods allowing the formality presented in the program specification to be continued all the way to code. On the other hand, Object-Z (OZ) is an extension of Z adding support for classes and objects. There are a number of methods for obtaining code from OZ specifications that can be categorized into refinement and animation methods. A...
متن کاملpylibjit: A JIT Compiler Library for Python
We present pylibjit, a Python library for generating machine code at load time or run time. The library can be used for dynamic code generation, although it is mainly aimed at optimizing compilation of existing Python function definitions. Python functions can be compiled by simply annotating them with a decorator specifying data types. The pylibjit compiler takes advantage of this type informa...
متن کاملConverting Specifications in a Subset of Object-Z to Skeletal Spec# Code for both Static and Dynamic Analysis
Construction of correctness is an essential issue for the implementation of a reliable software system. Formal methods based verification techniques provide programmers various ways to reason their program correctness through mathematically supported static analysis and dynamic analysis. In this paper, we introduce a tool that converts formal specifications in a subset of Object-Z to skeletal S...
متن کاملRefactoring Object-Z specifications
This paper describes an approach to transferring techniques of refactorings to formal methods. We use syntactical rewriting rules to express refactorings on Object-Z specifications. In contrast to programming languages here refactorings can be formally proven to preserve the behaviour of the specification. We give an outline of such a proof of behaviour preservation.
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- CoRR
دوره abs/1802.06224 شماره
صفحات -
تاریخ انتشار 2017