Semantics of temporal constrained objects

https://doi.org/10.1016/j.jlamp.2020.100632Get rights and content

Abstract

This paper presents the declarative and operational semantics for the paradigm of temporal constrained objects (TCOB). This modeling paradigm is an extension of basic constrained objects where objects specify the structure of a system and constraints specify its behavior. Temporal constrained objects have been shown to provide a clear and high-level declarative specification of the time-dependent behavior of complex dynamic systems. Two key features of this paradigm are series variables and metric temporal operators. The main contribution of this paper lies in showing how we can define the semantics of temporal constrained objects in terms of a new paradigm called temporal constraint logic programs (TCLP), which extend temporal logic programs with constraint-solving. Compared with the several other logical languages incorporating constraints and temporal logic, the TCLP paradigm offers a clear and direct way of translating temporal constrained object programs using three simple temporal predicates: first p, next p, and prev p. The key approach is to map each class in a TCOB program to a predicate in the TCLP paradigm. Thus, the semantics of recursively defined classes is expressed in terms of the semantics of recursively defined predicates, a well-understood topic. Given the close connections between TCLP and CLP, we take advantage of the semantics of CLP for providing the declarative and operational semantics of TCLP and thereby also 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.class_definition::=[abstract]classclass_id[extendsclass_id]{body}body::=[attributesattributes][constraints

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, R, 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 CΣ,D,L,T,solv, 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 D is a Σ-structure which determines the interpretation of the signature Σ, i.e, it gives meaning to the symbols of the signature.

  • The constraint theory T 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)

  • W. Leler

    The Specification and Generation of Constraint Satisfaction Systems

    (1987)
  • C. Moss

    Prolog++: The Power of Object-Oriented and Logic Programming

    (1994)
  • E.M. Clarke et al.

    Model Checking

    (1999)
  • M. Nair et al.

    Temporal constrained objects for modeling neuronal dynamics

    PeerJ. Comp. Sci.

    (2018)
  • J.M. Kannimoola et al.

    Dynamic constrained objects for vehicular network modeling

  • J.M. Kannimoola et al.

    Run-time analysis of temporal constrained objects

  • P.Y. Tambay

    Constrained Objects for Modeling Complex Systems

    (2003)
  • J.W. Lloyd

    Foundations of Logic Programming

    (1987)
  • Cited by (0)

    View full text