Integration of Linear Constraints with a Temporal
Logic Programming Language
Qian Ma
1
and Zhenhua Duan
1,⋆
and Mengfei Yang
2
1
Institute of Computing Theory and Technology P.O. Box 177, Xidian University, Xi’an 710071, P.R.China
2
Chinese Academy of Space Technology, Beijing 100094, P.R.China
Email: qma@mail.xidian.edu.cn, zhhduan@mail.xidian.edu.cn, yangmf@bice.org.cn
Abstract—This paper investigates the integration of linear
constraints with MSVL. To this end, we first define linear con-
straint statements and discuss related issues of the incorporation.
Further, for calling SMT solvers to solve the newly introduced
constraints, we give a translation algorithm from state programs
in MSVL with linear constraints to SMT-LIB2.0 script language
and then supply a solving procedure.
I. INTRODUCTION
MSVL [1] is a Modeling, Simulation and Verification lan-
guage based on Projection Temporal Logic [2]. Due to diverse
temporal operators, MSVL can express various constructs,
like sequence, branching, while loop, concurrency, and non-
determinacy etc. Although as a logic programming language,
MSVL also has certain features in the imperative programming
style, such as assignment statement, control constructs etc. As
a result, MSVL has been successfully applied in specifying
and verifying a number of real-life applications, e.g circuits,
communicating protocols, many-core parallel computing etc
[3].
However, for some applications, like combinatorial opti-
mization, scheduling, hardware/software partitioning problems
in embedded systems, MSVL may not deal with them in
a suitable way. The reason is that, in such realistic areas,
linear constraints are ubiquitous and required, but MSVL lacks
constructs to describe these constraints. To enable MSVL to
manage such applications, we are motivated to integrate linear
constraints into MSVL. The augments of linear constraints
into MSVL not only substantially expand the applied range
of MSVL, but also make users express their applications in
a flexible manner, where some aspects can be specified by
constraints while others can be described by imperative con-
structs. Besides, the incorporation also brings in the extensions
of temporal relations with linear constraints. For instance,
(x + y = 3)|| (x − y = 1) can be allowed.
The contributions of the paper are as follows: 1. We define
linear constraint statements le
1
△ le
2
(△ ::=< | > | = | =
| ≤ | ≥), where le
i
(i = 1, 2) is a linear expression and can
involve temporal operators and -, and investigate some
issues of the integration (Section III). Particularly, to keep
compatible with MSVL available, we regard the underlying
store as a value-store and address the approach to constraints
solving via external SMT solvers [4]. 2. For solving constraints
with great generality, we do not designate which SMT solver
This research is supported by the NSFC Grant Nos. 61133001, 60910004,
61272118, 61272117, 91218301, National Program on Key Basic Research
Project (973 Program) Grant No. 2010CB328102. ⋆ Corresponding author.
should be used, but only utilize the common input format SMT-
LIB2.0 language that can be flexibly applied in any usable
SMT solvers. To do so, we first give a translation algorithm
from state programs in MSVL with linear constraints to SMT-
LIB2.0 script language, and then supply a solving procedure,
which can handle linear optimization problems by SMT solvers
(Section IV).
Note that the work presented in [5] introduces linear
constraints =, ≤, ≥ over rational numbers into MSVL and
formalizes the solving procedure by means of the operational
semantics. However, some specific issues are not covered in
it. For instance, the value of a variable x can be determined
by three means: solving constraints, assignment or the framing
technique. When x appears in a constraint, which way is used
to obtain its value is not discussed. This paper concerns linear
constraints <, >, =, =, ≤, ≥ over integers and addresses the
issues of mixing constraints with MSVL in details. Further, we
solve constraints by external SMT solvers with a translation
algorithm to SMT-LIB2.0 language [6].
The rest of the paper is organized as follows. In Section II,
we briefly introduce Projection Temporal Logic and MSVL.
Section III defines linear constraint statements and discusses
some issues of the incorporation. Further, Section IV provides
a translation algorithm to SMT-LIB2.0 script language for
invoking SMT solvers to solve constraints. Finally, Section V
reviews the related work and Section VI concludes our work.
II. PRELIMINARIES
A. Projection Temporal Logic
Our underlying logic is Projection Temporal Logic (PTL)
[2] with infinite models and a new projection construct [7].
1) Syntax: Let P rop be a countable set of atomic
propositions and V a countable set of variables.
B = {true, false} represents the boolean domain while D
denotes all data domain needed by us including integers,
rational numbers, lists, sets, etc. The terms e and formulas P
of PTL are presented by the following grammar:
e ::= c | v | e | -e | f(e
1
, . . . , e
m
)
P ::= p | e
1
= e
2
| F (e
1
, . . . , e
n
) | ¬P | P
1
∧ P
2
|
∃v : P | P | (P
1
, . . . , P
m
) prj P | P
+
where c ∈ D is a constant, v ∈ V , p ∈ P rop, f stands
for a function, F indicates a predicate and P, P
1
, . . . , P
m
are
well-formed PTL formulas. A formula (term) is called a state
formula (term) if it does not contain any temporal operators,
2013 International Symposium on Theoretical Aspects of Software Engineering
978-0-7695-5053-4/13 $26.00 © 2013 IEEE
DOI 10.1109/TASE.2013.30
157