Semantics of temporal constrained objects
Introduction
Constrained objects are well-known for formal modeling of complex systems that are composed of an assembly of interconnected components whose rules or laws of behavior can be stated declaratively as constraints [1], [2], [3], [4], [5]. This paradigm has been shown to be especially useful in modeling a variety of systems, especially complex engineering structures. A constrained object is essentially an object whose state, i.e., the attributes of the object, is determined by a set of declarative constraints rather than by imperative procedures. Constrained objects make use of object-oriented concepts, such as classes, inheritance and aggregation, for modeling the structure of a complex system and they make use of declarative constraints for modeling the behavior of the systems. The computation is a form of discrete time-step simulation, where time-step involves logical inference and constraint satisfaction over the attributes of the objects.
Temporal constrained objects were recently proposed as an extension of constrained objects with two important features, series variables and metric temporal operators, which help to model the time-dependent behavior of complex dynamic systems. Essentially, the series variable records the sequence of changes to some entity of interest in a system, and the metric temporal operators – which are metric variants of the classic operators in propositional temporal logic [6] — help place temporal constraints over consecutive values of series variables. The language TCOB [7] exemplifies the paradigm of temporal constrained object and its execution model involves a time-based simulation along with constraint solving at each time-step. A wide variety of problems have been successfully modeled using this paradigm, including neuronal dynamics, vehicular networks, and firewalls [8], [9], [10].
Formal semantics provide a mathematical framework for defining the meaning of programs and facilitate formal reasoning and verification of program properties. In developing our approach, we first note that a class implements an abstract data type, which can be thought of basically as a set of values. Also, a constraint can be thought of as the set of instances of its constituent variables that make the constraint relation true. We therefore adopt a set-theoretic approach to the semantics of constrained objects. Essentially, the meaning of a constrained object class is the set of instances of the attributes that satisfy the constraints of the class. Such a set-theoretic semantics was first outlined by Tambay [11] who mapped a constrained object (COB) program to a constraint logic program (CLP) and defined the semantics of the former as the least model of the latter [12]. In short, every COB class is translated into a CLP predicate clause: the attributes together with constructor arguments in the COB class become arguments of the CLP predicate, and the constraints in the COB class body become the body of the CLP predicate clause. Constructor calls in the COB class body become predicate calls in the corresponding CLP predicate body. This approach reduces the problem of defining the semantics of recursively-defined classes to that of recursively-defined predicates, a well-established topic [13].
In going from constrained objects to temporal constrained objects, we need to provide a satisfactory semantics for series variables and metric temporal operators. One approach would be to represent a TCOB series as a CLP list and to represent all operators on a series variable as appropriate selection operations on the CLP list. While this may be an acceptable way to provide an implementation for a TCOB program, at a semantic level doing so is undesirable because it eliminates the concept of time from the semantics. It is much better to preserve the concept of time in the semantics, as is traditional in modal and temporal logics. Therefore, in this paper, we present a temporal constraint logic programming, called TCLP, which extends the CLP language with three temporal predicates (first, next, and prev), and we show how to map TCOB class definitions into TCLP predicate rules. We also provide declarative (least model) and operational (resolution-style) semantics and correctness results for TCLP by drawing on similar results for CLP [12].
A natural question that arises at the outset is whether a new logical paradigm (TCLP) is needed, especially as several declarative languages have been discussed in the literature incorporating concepts from logic programming, constraints, and temporal reasoning, with applications in concurrent, real-time, hybrid and reactive systems. We briefly address this question here and provide a more detailed discussion in section 5. Early works on the foundations of temporal logic programming [14], [15], [16], [17] did not support constraints, a key feature for the semantics for temporal constrained objects. The family of concurrent constraint languages [18], [19], [20] is also related; however, their foundation on process algebra is not suited for the semantics of temporal constrained objects which are more data-oriented than process-oriented. Logics for real-time systems and those incorporating a quantitative notion of time [21], [22], [23], [24] are more suited as a specification language rather than as a target programming language. Perhaps the bounded universal (modality) Horn clauses of metric temporal logic (MTL) [25] come closest to serving as a target language for translating temporal constrained objects. Although MTL is a more powerful language than TCLP, our preference for the TCLP paradigm owes to its relative simplicity and the ease with which we can map TCOB programs to this paradigm.
Thus the two main contributions from this paper are: (i) the formulation of temporal constraint logic paradigm as a foundation for the declarative and operational semantics of temporal constrained objects; (ii) the direct translation of recursively defined classes with constraints and temporal features into this paradigm. The remainder of this paper is organized as follows. Section 2 introduces the concept of temporal constrained objects with examples; section 3 presents the language of temporal constraint logic programs along with the mapping of TCOB to TCLP constructs; section 4 gives the declarative and operational semantics of TCLP; section 5 discusses related declarative languages that incorporate constraints and temporal concepts; and, finally, section 6 presents conclusions and areas of further work.
Section snippets
Temporal constrained objects
A program in the language COB (constrained objects without temporal features) consists of a collection of classes, each of which may have a set of attributes, constraints, predicates, and constructors [11]. Every constrained object is an instance of some class. An abstract class is a class without constructors and cannot be instantiated. The outline of a class definition is as follows.
Towards semantics of temporal constrained objects
We introduce the paradigm of temporal constraint logic programs (TCLP) in order to define the semantics of temporal constrained objects. This paradigm builds upon concepts from both constraint logic programming (CLP) and temporal logic programming (TLP), as shown in Fig. 1.
For this paper, our constraint domain is the set of real numbers, , and we use the term constraint to refer to the application of a binary relational operator, such as , and =, to a pair of arguments which may be
Semantics of TCLP and TCOB
Similar to CLP, TCLP is parameterized by a constraint domain , defined as follows [12]:
- •
Σ is the constraint domain signature which defines a set of function and predicate symbols and associates an arity with each symbol.
- •
The domain of computation is a Σ-structure which determines the interpretation of the signature Σ, i.e, it gives meaning to the symbols of the signature.
- •
The constraint theory describes the logical semantics of constraints as a set of closed first-order logical
Related work
The development of the TCLP language in this paper grew out of a need to provide a semantics for the paradigm of temporal constrained objects. As noted earlier, temporal constraint logic programming combines aspects of temporal logic programming (TLP) and constraint logic programming (CLP). TLP was first proposed in order to provide a high-level reasoning about temporal behavior in a logic programming setting [14]. CLP is well-known for its numerous applications over three decades, and it has
Summary and conclusions
This paper discusses the declarative and operational semantics of temporal constrained objects through a mapping to the framework of a new logical language called temporal constraint logic programming. The translation rules effectively map every class in a TCOB program to an equivalent predicate in the TCLP program. TCLP combines temporal logic programming, which supports reasoning about time, with constraint logic programming, which supports reasoning with constraints. The least model defines
Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Acknowledgement
We thank the anonymous reviewers for their extensive comments which have greatly help improve the paper. We also thank Jan Chomicki for his comments and suggestions on an earlier version of this manuscript.
References (36)
- et al.
Object logic integration: a multiparadigm design methodology
Comput. Lang.
(1997) - et al.
Temporal constrained objects: application and implementation
Comput. Lang. Syst. Struct.
(2017) - et al.
The semantics of constraint logic programs
J. Log. Program.
(1998) - et al.
Temporal logic programming
J. Symb. Comput.
(1989) - et al.
A timed concurrent constraint language
Inf. Comput.
(2000) - et al.
Timed default concurrent constraint programming
J. Symb. Comput.
(1996) - et al.
A theory of timed automata
Theor. Comput. Sci.
(1994) Programming in metric temporal logic
Theor. Comput. Sci.
(1998)Constrained Objects
(1993)- et al.
Modeling engineering structures with constrained objects