Academia.edu no longer supports Internet Explorer.
To browse Academia.edu and the wider internet faster and more securely, please take a few seconds to upgrade your browser.
2007, Electronic Notes in Theoretical Computer Science
…
15 pages
1 file
This paper explains precisely how a declarative method language, based upon the formal notations of Z and B, can be used as a basis for automatic code generation. The language is used to describe the intended effect of operations, or methods, upon the components of an object model; each method is defined by a pair of predicates-pre-and post-conditions. Following the automatic incorporation of model invariants, including those arising from class associations, these predicates are extended-again, automatically-to address issues of consistency, definition, and dependency, before being transformed into imperative programs. The result is a formal method for transforming object models into complete, working systems.
Concurrency and Computation: Practice and Experience, 2003
In this paper we propose a set-oriented rule-based method de nition language for objectoriented databases. Most existing object-oriented database systems exploit a general purpose imperative object-oriented programming language as method de nition language. Because methods are written in a general-purpose imperative language, it is di cult to analyze their properties and to optimize them. Optimization is important when dealing with large amount of objects as in databases. We therefore believe that the use of an ad-hoc, set-oriented language can o er some advantages, at least at a speci cation level. In particular, such a language can o er an appropriate framework to reason about method properties.
1997
Abstract In this paper we propose a set-oriented rule-based method de nition language for objectoriented databases. Most existing object-oriented database systems exploit a general purpose imperative object-oriented programming language as method de nition language. Because methods are written in a general-purpose imperative language, it is di cult to analyze their properties and to optimize them. Optimization is important when dealing with large amount of objects as in databases.
Electronic Notes in Theoretical Computer Science, 2001
Science of Computer Programming, 2004
We present algebraic laws for a language similar to a subset of sequential Java that includes inheritance, recursive classes, dynamic binding, access control, type tests and casts, assignment, but no sharing. These laws are proved sound with respect to a weakest precondition semantics. We also show that they are complete in the sense that they are sufficient to reduce an arbitrary program to a normal form substantially close to an imperative program; the remaining object-oriented constructs could be further eliminated if our language had recursive records. This suggests that our laws are expressive enough to formally derive behaviour preserving program transformations; we illustrate that through the derivation of provablycorrect refactorings.
Computer Languages, 1995
1999
We present a formalism for reasoning about declarative object-oriented programs. Classes are represented as first-order theories that contain logic programs as methods. Inheritance, genericity and related concepts are represented by operations on such theories which preserve the consistency of these theories as well as the correctness of the programs specified by their axioms. Our approach provides a logical basis for the construction of correct and reusable programming systems. Issues: Our main motivation is formal program development, i.e. developing programs that are formally correct wrt their formal specifications. Our goal in this paper is to provide the necessary logical foundations for formal program development in an object-oriented paradigm which has a suitable (declarative) semantics for this purpose. Object-oriented programming is widely used for software development in industry because it is seen to meet the key requirements of modularity, reusability, and reliability. However, conventional object-oriented programming (e.g. [12]) is based on the imperative programming paradigm, and does not have a declarative semantics. This means that formal reasoning about programs is not at all straightforward, since modularity and reusability are characterised at code level. Instead, invariants, pre and postconditions have to be inserted into the code and checked if some level of reliability is to be guaranteed. Declarative object-oriented programming languages have been proposed, by both the functional and logic programming communities. Examples include TOOPL [3], L&O [11], and Prolog++ [15]. These languages, though declarative in their methods, usually lack a suitable semantics for reasoning about formal object-oriented program development. That is, in these languages, classes are theories (with initial semantics) which are assumed to be correct, i.e. they are used as executable specifications. Thus in these languages it is not meaningful to talk about correctness wrt general (non-executable) specifications. Main Results: Our main contribution is to define classes and methods declaratively, such that classes are full first-order theories (with isoinitial semantics), methods are logic programs that are synthesised from their specifications (in classes), and under our chosen (isoinitial) semantics, we can reason about the correctness, and correct reuse of both classes and their programs. Both our classes and programs may be open, i.e. they may have parameters.
Lecture Notes in Computer Science, 2003
In this article we introduce a comprehensive set of algebraic laws for rool, a language similar to sequential Java but with a copy semantics. We present a few laws of commands, but focus on the objectoriented features of the language. We show that this set of laws is complete in the sense that it is sufficient to reduce an arbitrary rool program to a normal form expressed in a restricted subset of the rool operators. We also propose a law for data refinement that generalises the technique from traditional modules to class hierarchies. Together, these laws are expressive enough to derive more elaborate rules that can be useful, for example, to formalize object-oriented design practices; this is illustrated through the systematic derivation of a refactoring from the proposed laws.
1996
This paper addresses the issue of giving a formal semantics to an object-oriented programming and specification language. Object-oriented constructs considered are objects with attributes and methods, encapsulation of attributes, subtyping, bounded type parameters, classes, and inheritance. Classes are distinguished from object types. Besides usual imperative statements, specification statements are included. Specification statements allow changes of variables to be described by a predicate. They are abstract in the sense that they are non-executable. Specification statements may appear in method bodies of classes, leading to abstract classes. The motivation for this approach is that abstract classes can be used for problem-oriented specification in early stages and later refined to efficient implementations. Various refinement calculi provide laws for procedural and data refinement, which can be used here for class refinement. This paper, however, focuses on the semantics of object-oriented programs and specifications and gives some examples of abstract and concrete classes. The semantics is given by a translation of the constructs into the type system F≤, an extension of the simple typed λ-calculus by subtyping and parametric polymorphism: The state of a program is represented by a record. A state predicate is a Boolean valued function from states. Statements, both abstract and concrete, are represented by predicate transformers, i. e. higher order functions mapping state predicates (postconditions) to state predicates (preconditions). Objects are represented by records of statements (the methods) operating on a record of attributes, where the attributes are hidden by existential quantification. Classes are understood as templates for the creation of objects. Classes are represented by records. Inheritance amounts to record overwriting. Subtyping and parametric polymorphism, e. g. for the parameterization of classes by types, are already present in F≤. The advantage of this semantic by translation is that it builds on the features already provided by F≤ (which are all used). Hence no direct reference to the model underlying F≤ needs to be made; a summary of the syntax and rules of F≤ is given.
Loading Preview
Sorry, preview is currently unavailable. You can download the paper by clicking the button above.
Patterns, Programming and Everything, 2012
Theoretical Computer Science, 2006
Journal of Intelligent Information Systems, 1998
Formal Aspects of Computing, 2003
Sigplan Notices, 2004
Computer Languages, 2001
Annals of Mathematics and Artificial Intelligence, 1991
Lecture Notes in Computer Science, 1998
SAVCBS 2004, Specification and Verification of Component-Based Systems, 2004
Lisp and Symbolic Computation, 1989
Lecture Notes in Computer Science, 1993
Acta Informatica, 2009
Electronic Notes in Theoretical Computer Science, 2008
Lecture Notes in Computer Science, 1998