Next Article in Journal
Conditional Variational Autoencoder for Learned Image Reconstruction
Previous Article in Journal
Nonlinear Dynamics and Performance Analysis of a Buck Converter with Hysteresis Control
Previous Article in Special Issue
Metabolic Pathway Analysis in the Presence of Biological Constraints
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Exact Boolean Abstraction of Linear Equation Systems

by
Emilie Allart
1,2,†,
Joachim Niehren
1,3,† and
Cristian Versari
1,2,*,†
1
CRIStAL—Centre de Recherche en Informatique, Signal et Automatique de Lille—UMR 9189, Université de Lille—Campus Scientifique, 59655 Villeneuve-d’Ascq, France
2
Faculte des Sciences et Technologies, University of Lille, 59650 Villeneuve-d’Ascq, France
3
Inria, Université de Lille, 59000 Lille, France
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Submission received: 31 July 2021 / Revised: 11 October 2021 / Accepted: 12 October 2021 / Published: 21 October 2021
(This article belongs to the Special Issue Formal Method for Biological Systems Modelling)

Abstract

:
We study the problem of how to compute the boolean abstraction of the solution set of a linear equation system over the positive reals. We call a linear equation system ϕ exact for the boolean abstraction if the abstract interpretation of ϕ over the structure of booleans is equal to the boolean abstraction of the solution set of ϕ over the positive reals. Abstract interpretation over the booleans is thus complete for the boolean abstraction when restricted to exact linear equation systems, while it is not complete more generally. We present a new rewriting algorithm that makes linear equation systems exact for the boolean abstraction while preserving the solutions over the positive reals. The rewriting algorithm is based on the elementary modes of the linear equation system. The computation of the elementary modes may require exponential time in the worst case, but is often feasible in practice with freely available tools. For exact linear equation systems, we can compute the boolean abstraction by finite domain constraint programming. This yields a solution of the initial problem that is often feasible in practice. Our exact rewriting algorithm has two further applications. Firstly, it can be used to compute the sign abstraction of linear equation systems over the reals, as needed for analyzing function programs with linear arithmetics. Secondly, it can be applied to compute the difference abstraction of a linear equation system as used in change prediction algorithms for flux networks in systems biology.

1. Introduction

We develop approaches to remedy the incompleteness of abstract interpretation [1] of linear equation systems over the reals, in the algebra of booleans B = { 0 , 1 } and the structure of signs S = { 1 , 0 , 1 } . These abstractions have various applications: in systems biology, the boolean abstraction underlies abstractions of chemical reactions networks into Boolean networks [2,3]. In program analysis, the sign abstraction can be applied to functional programs with arithmetics for analyzing the signs of the possible values of floating-point variables [4,5].
The soundness of abstract interpretations of first-order logic formulas without negation was shown by John [6,7,8,9]. It applies to the interpretation in any concrete structure S, as long as it is connected by a homomorphism h : S Δ to the abstract structure Δ . The concrete interpretation of a first-order formula ϕ is the set of concrete solutions s o l S ( ϕ ) , and its abstract interpretation is the set of its abstract solutions s o l Δ ( ϕ ) . John’s soundness theorem (see Theorem 1 below) states that the set of abstract solutions of overapproximates the abstraction by h of the set of concrete solutions:
h s o l S ( ϕ ) s o l Δ ( ϕ )
When choosing the operators in Σ b o o l = { + , , 0 , 1 } , the class of negation-free first-order formulas with operators in Σ b o o l extends on the classes of linear and polynomial equation systems. In this article, we consider the boolean abstraction which is the unique homomorphism h B : R + B , and the sign abstraction which is the unique homomorphism h S : R S with respect to the operators in Σ b o o l . The boolean abstraction maps any strictly positive real to 1 and 0 to 0. The sign abstraction extends on the boolean abstraction while mapping all strictly negative reals to 1 . We note that the structure of signs S is not an algebra since the sum of a positive and a negative number may have any sign.

1.1. Problematics

A natural question is whether abstract interpretation is complete [10] for the abstraction of formulas induced by a homomorphisms h : S Δ , i.e, whether for all negation-free first-order formulas ϕ with the same operators:
h s o l S ( ϕ ) = s o l Δ ( ϕ )
We call a formula ϕ h-exact if it satisfies this property. A counter example against the completeness of abstraction interpretation for the boolean and the sign abstraction is the linear equation ϕ 0 equal to x + y = x + z . Here, we write = for the equality symbol inside the logic, to point out its difference from equality in the language of mathematics. Formula ϕ 0 is neither h B -exact nor h S -exact. This can be seen as follows. Over the reals ϕ 0 is equivalent to y = z , so that all assignments τ that are abstractions of concrete solutions of ϕ 0 must satisfy τ ( y ) = τ ( z ) . When interpreted abstractly over B or S , however, ϕ 0 admits the abstract solution τ = [ x / 1 , y / 1 , z / 0 ] which is not the abstraction of any concrete solution since τ ( y ) τ ( z ) .
To deal with the incompleteness of abstract interpretation, we propose to study the following two questions for homomorphism h : S Δ where h is either the boolean abstraction h B or the sign abstraction h S .
Exact Rewriting Can we rewrite linear equation systems to h-exact formulas?
Computing Abstractions Can we can compute the abstraction h s o l S ( ϕ ) exactly for a given system of homogeneous linear equations ϕ ?
Geometrically speaking, the concrete solution sets s o l R + ( ϕ ) and s o l R ( ϕ ) of homogeneous linear equation systems ϕ are polytopes—i.e., finite intersections of half-spaces in R fv ( ϕ ) . The problem of computing boolean abstractions or sign abstraction is thus to compute the h Δ abstraction of a polytope given by a linear equation system.
For any h-exact formula ϕ , the computation of abstractions h s o l S ( ϕ ) is equivalent to the computation of s o l Δ ( ϕ ) . Since the abstract structure Δ is finite for the boolean and sign abstraction, we can compute the set of abstract solutions in at most exponential time by a naive generate and test algorithm. Finite domain constraint programming [11] can by used to avoid the naive generation of all variable assignments to Δ in many practical cases. Therefore, any algorithm for exact rewriting induces an algorithm for computing abstractions that may be feasible in practice.

1.2. Contributions

Our main result is the first algorithm for exact rewriting that applies to linear equation systems for the Boolean abstraction. Based on this algorithm, we present a novel algorithm for computing the sign abstraction of linear equation systems.
Exact Rewriting for the Boolean Abstraction. In the first step, we study exact rewriting of (homogeneous) linear equation systems for boolean abstraction. The counter example ϕ 0 , for instance, can be rewritten to h B -exact formula y = z . The idea is to take the system of all linear consequences over R + of the linear equation system. There may be infinitely many such consequences, but all of them are linear combinations of the extreme rays of the cone s o l R + ( ϕ 0 ) . Up to normalization, there are only finitely many extreme rays, which are known as the elementary modes of the linear equation system [12,13,14,15]. These can be computed by libraries from computational geometry [16] in at most exponential time. Nevertheless, the computation is often well-behaved in practice.
Based on the elementary modes (Folklore Theorem 2), we can rewrite any (homogeneous) linear equation system into quasi-positive and strongly-triangular linear equation system that is equivalent over R + (Corollary 1), that can be computed in at most exponential time. As we prove, such systems are always h B -exact (Theorem 3). Hence, any system of linear equations can be converted in at most exponential time to some R + -equivalent h B -exact formula.
Note that h B -exact formulas may still not be S -exact. A counter example is the strongly-triangular quasi-positive linear system u + v = x u + v = y . It is not h S -exact, since it entails x = y over R but still has the abstract solution [ u / 1 , v / 1 , x / 1 , y / 1 ] over S which maps x and y to distinct signs. Indeed, we don’t have any idea of how to do exact rewriting for the sign abstraction. The problem is that positivity is essential for our approach, and since the addition of positive and negative numbers may have any sign, S fails to be an algebra, making the analogous argument as in the proof of B -exactness fail.
Extension to h B -Mixed Systems. In the second step, we introduce h B -mixed systems, which by Theorem 4 generalize on systems of 1. linear equations, 2. positive polynomial equations p = 0 , and 3. positive polynomial inequations p 0 , where p is a positive polynomial without constant term. We then show our main result:
Theorem 5 (Main). Any h B -mixed systems can be converted to a h B -exact formula by converting its linear subsystem to an h B -exact formula.
The correctness of the algorithm for h B -mixed systems relies on the notion of h B -invariant formulas that we introduce. The class of h B -invariant formulas subsume systems of positive polynomial equations p = 0 and inequations p 0 , where p is a positive polynomials without constant terms.
Computing Sign Abstractions. In the third step, we present an algorithm for computing the sign abstraction of (homogeneous) systems of linear equations based on exact rewriting for the boolean abstraction (Theorem 6). For this, we decompose the sign abstraction into the boolean abstraction based on a function that is definable in first-order logic. This function decomposes real numbers into their positive part x and negative part y. At least one of these two parts must be zero, which can be expressed by the polynomial equation x y = 0 . The positivity of x can be expressed by z . x = z z and the positivity of y in analogy. In this way, we can reduce the problem of computing h S s o l R ( ϕ ) to the problem of computing h B s o l R + ( ϕ ) for some existentially quantified h B -mixed system ϕ that we can make h B -exact based on our main Theorem 5.
Application to Program Analysis. We show how to apply the computation of the sign abstraction of linear equation systems to improve the analysis of functional programs with arithmetics. For finding program errors there it can be useful to know about the possible signs of the values of program variables. We elaborate an example in the final Section 10.
Implementation. We implemented the h B -exact rewriting algorithm for h B -mixed systems from the main Theorem 5 in Python. For this we used a library from computational geometry [16] for computing elementary modes. We also used finite domain constraint programming with Minizinc [17] for computing the set of boolean solutions over logical formulas. Some successful experiments are mentioned in the related work subsection below. We did not yet implemented the algorithm for computing sign abstractions, nor its application to program analysis though.

1.3. Related Work

We start with related work by the authors, and then move to related work by others.
Change Prediction of Reaction Networks. Our main Theorem 5 was recently applied to the change prediction of reaction networks in systems biology [6]. Indeed, the development of the present article was originally motivated by this application. The problem there is to compute the difference abstraction of linear equation systems, expressing the steady state semantics of chemical reaction networks. Two difference abstractions were considered, h Δ 3 : R + 2 { , , } and a refinement thereof h Δ 6 : R + 2 { , , ~ , , , } . In analogy to the approach adopted for computing sign abstractions (step three above), the algorithmic approach presented there is to decompose the difference abstractions h Δ 3 and h Δ 6 into the boolean abstraction h B and functions that are definable in first-order logic. The elaboration of this approach, however, is quite different for reflecting the nature of the difference abstractions.
Experimentation. We tested our implementation of the exact rewriting algorithm for the boolean abstraction successfully for computing difference abstractions in the application of change prediction in systems biology. The experimental results are presented in [6] are generally encouraging. They show that h B -exact rewriting based on elementary modes in combination with finite domain constraint programming may indeed avoid naive generate and test in many practical examples. In some of these examples, however, the overall computation time still took some hours.
Abstracting Reaction Networks to Boolean Networks. Independently, the authors proposed an abstraction of chemical reaction networks to boolean networks in [18], whose precision can be improved by using the h B -exact rewriting of h B -mixed equation systems.
Alternative Algorithm for Computing Sign Abstractions. An alternative algorithm for computing the sign abstraction of linear equation systems (and thus also the boolean abstraction) can be obtained by John’s overapproximation Theorem 1. It shows that it is sufficient to generate the finitely many abstract solutions in τ s o l S ( ϕ ) , and then to check for each of them whether there exists a concrete solution σ such that τ = h S σ . To perform this latter test, note that h Δ ( x ) = 1 is equivalent to the strict inequation x > 0 and h S ( x ) = 0 by the equation x = 0 . Similarly, h S ( x ) = 1 can be defined by the strict inequation x < 0 . Whether there exists a concrete solution σ s o l R ( ϕ ) such τ = h σ is thus equivalent to the satisfiability of ϕ x fv ( ϕ ) h S ( x ) = τ ( x ) over R , where fv ( ϕ ) is the set of free variables of ϕ . The satisfiability of systems of strict linear inequations and homogeneous linear equations without constant terms over R are known to be decidable since at least 1926 [19]. But still, one has to generate the set of all abstract solutions s o l S ( ϕ ) . The new algorithm presented above avoids generating this set.
Abstract Program Interpretation over Numerical Domains. In abstract interpretation [20], nonrelational domains permit to approximate the set of values of program variables while ignoring the relationship to the values of others. Well-known nonrelational numerical domains include the interval domain [21] describing invariants of the form i = 1 m x i [ r i , r i ] with reals r i r i and the constant propagation domain for invariants of the form i = 1 m x i = r i [22].
Abstract interpretation of relational domains may yield better approximations that with nonrelational domains, since relationships between the values of different variables can be taken into account. Well-known relational numerical domains include the polyhedral domain [4]. A polyhedron is the solution set of systems of inhomogeneous linear inequations of the form n 1 x 1 + + n m x m r . Alternatively, the linear equality domain [23] was considered. These are defined by system of inhomogeneous linear equations n 1 x 1 + + n m x n = r .
In the present paper, we study the problem of computing the sign abstraction of polytopes represented by homogeneous linear equation systems. The polytopes can be obtained by existing methods for the abstract program interpretation over the polyhedral domain. One weakness of our approach is that we study the homogeneous case only, so that we can only abstract polytope and not more general polyhedrons.

1.4. Outline

In Section 2, we recall preliminaries on homomorphisms between Σ -structures. In Section 3, the first-order logic is recalled. John’s theorem and its relation to the soundness and completeness of abstract interpretation in the classical framework are discussed in Section 4. We discuss how to make linear equation system quasipositive and strongly triangular based on elementary modes in Section 5. These properties can be used to prove h B -exactness as we show in Section 6, and thus to obtain an h B -exact rewriting of linear equation systems. We introduce the notion of h B -invariance in Section 7 and apply it in Section 8 to lift the h B -exact rewriting algorithm from linear to h B -mixed systems. This allows us to define the sign abstraction of linear equation systems on Section 9. We finally apply this result in Section 10 to the sign analysis of functional programs with arithmetic.

2. Homomorphisms on Σ -Structures

We need some basic notation from set theory and standard notion of universal algebra such as Σ -algebras, Σ -structures, and homomorphism.
For any set A and n N , the set of n-tuples of elements in A is denoted by A n . For finite sets A the number of elements of A is denoted by | A | . Furthermore, for any function f : A B we define the function f 2 : A 2 B 2 such that f 2 ( a , a ) = ( f ( a ) , f ( a ) for all a , a A .

2.1. Σ -Algebras

We next recall the notion of Σ -algebras. Let Σ = n 0 F ( n ) C be a ranked signature. We call the elements of f F ( n ) are called n-ary function symbols, even though we may also use them as n + 1 -ary relation symbols later on when moving to Σ -structures. The elements in c C are called the constants of Σ .
Definition 1.
A Σ -algebra S = ( dom ( S ) , . S ) consists of a set dom ( S ) and an interpretation . S such that c S dom ( S ) for all c C , and f S : dom ( S ) n dom ( S ) for all f F ( n ) .
Let B = { 0 , 1 } be the set of booleans, N the set of natural numbers including 0, Z the set of integers, R the set of real numbers, and R + the set of positive real numbers including 0. Note that B N R + R and N Z R . Let the addition on the reals be the binary function + R : R 2 R and the multiplication the binary function R : R 2 R . Let the addition on the positive real numbers + R + : R + 2 R + be equal to the restriction + R | R + × R + and the multiplication R + : R + 2 R + be the restriction R | R + × R + .
Let Σ b o o l = { + , } { 0 , 1 } be the set of boolean operators where + and * are binary function symbols and 0 and 1 constants. Note that constant 0 is freely overloaded with the boolean 0 and the constant 1 with the boolean 1.
Example 1.
The set of positive reals R + can be turned into a Σ b o o l -algebra, in which the functions symbols are interpreted as binary functions + R + and R + . The constants are interpreted by themselves 0 R + = 0 and 1 R + = 1 .
Example 2.
The set of Booleans B = { 0 , 1 } R + equally defines a Σ b o o l -algebra. There, the function symbols are interpreted as a disjunction + B = B and conjunction B = B on Booleans. The constants are interpreted by themselves 0 B = 0 and 1 B = 1 .

2.2. Σ -Structures

We next recall the usual generalization of Σ -algebras to Σ -structures. The objective is to generalize from functions to relations. For this, we consider n-ary function symbols as n + 1 -ary relation symbols.
Definition 2.
A Σ -structure Δ = ( dom ( Δ ) , . Δ ) consists of a set dom ( Δ ) and an interpretation . Δ such that c Δ dom ( Δ ) for all c C and f Δ dom ( Δ ) n + 1 for all f F ( n ) .
Clearly, any Σ -algebra is also a Σ -structure. Note also that symbols in F ( 0 ) are interpreted as monadic relations, i.e., as subsets of the domain, in contrast to constants in C that are interpreted as elements of the domain.
We denote the subtraction on the reals by the binary function R : R 2 R and the division on the reals by the ternary relation / R R 2 × R . Note that division by zero is undefined. Note also that subtraction on R + would yield only a partial function.
Let Σ a r i t h = { + , , , / } { 0 , 1 } be the arithmetic signature, where 0 and 1 are constants, and all other operators are binary function symbols. Again, we freely overlead to constant 0 with real number 0 and the constant 1 with the real number 1.
Example 3.
The set of reals R can be turned into a Σ a r i t h -structure, with the interpretation of the binary functions symbols as the ternary relations + R , R , R , / R . The constants are interpreted by themselves 0 R = 0 and 1 R = 1 . Note that / R is a partial but not a total function, since division by 0 is not defined. So we must see / R as a ternary relation, so that R is not a Σ a r i t h -algebra. It still is a Σ b o o l -algebra though.
Example 4.
The set of signs { 1 , 0 , 1 } R can be turned into a Σ a r i t h -structure S = ( { 1 , 0 , 1 } , . S ) with the interpretation + S , S , S and, / S given in Figure 1. The constants are interpreted by themselves 0 S = 0 and 1 S = 1 . Note that all + S contains ( 1 , 1 , 1 ) , ( 1 , 1 , 1 ) and ( 1 , 1 , 0 ) meaning that the sum of a strictly negative and a strictly positive real has a sign in 1 + S 1 , so it may either be strictly positive, strictly negative, or zero. So S is a Σ a r i t h -structure and even when restricting the signature to Σ b o o l it remains a Σ b o o l -structure that is not a Σ b o o l -algebra.

2.3. Homomorphisms

We recall the standard notion of homomorphism for Σ -structures which can also be applied to Σ -algebras.
Definition 3.
A homomorphism between two Σ-structures S and Δ is a function h : dom ( S ) dom ( Δ ) such that for c C , n N , f F ( n ) , and s 1 , , s n + 1 dom ( S ) :
1
h ( c S ) = c Δ , and
2
if ( s 1 , , s n + 1 ) f S then ( h ( s 1 ) , , h ( s n + 1 ) ) f Δ .
We can convert any n + 1 -ary relation to a n-ary set valued functions. In this way, any n-function is converted to a n-ary set valued n-functions. In other words, functions of type D n D are converted to functions of type D n 2 D where D = dom ( Δ ) . In set-valued notation, the second condition on homomorphism can then be rewritten equivalently as h ( f S ( s 1 , , s n ) ) f Δ ( h ( s 1 ) , , h ( s n ) ) . A homomorphism for Σ -algebras thus satisfies h ( c S ) = c Δ and for all function symbols f F ( n ) and s 1 , , s n dom ( S ) it satisfies h ( f S ( s 1 , , s n ) ) = f Δ ( h ( s 1 ) , , h ( s n ) ) .
The boolean abstraction is the function h B : R + B with h B ( 0 ) = 0 and h B ( r ) = 1 if r > 0 .
Lemma 1.
The boolean abstraction h B is a homomorphism between Σ b o o l -algebras.
Proof. 
For all r , r R + we have:
h B ( r + R + r ) = 1 r + R + r 0 r 0 r 0 h B ( r ) = 1 h B ( r ) = 1 h B ( r R + r ) = 1 r R + r 0 r 0 r 0 h B ( r ) = 1 h B ( r ) = 1
Hence, h B ( r + R + r ) = h B ( r ) + B h B ( r ) and h B ( r R + r ) = h B ( r ) B h B ( r ) . Finally, for both constants c C we have that h B ( c R + ) = h B ( c ) = c = c B . □
The sign abstraction is the function h S : R S with h S ( 0 ) = 0 , h S ( r ) = 1 for all strictly negative reals r < 0 and h S ( r ) = 1 for all strictly positive reals r > 0 .
Lemma 2.
The sign abstraction h𝕊 is a homomorphism between Σ a r i t h -structures.
Proof. 
Let r , r R . For the multiplication we have h S ( r R r ) = h S ( r ) R h S ( r ) and thus h S ( r R r ) { h S ( r ) R h S ( r ) } = h S ( r ) S h S ( r ) . For the addition, we have to distinguish cases. If r and r have the same sign, so r + R r has the same sign, so that we have h S ( r + R r ) h S ( r ) + S h S ( r ) . If r > 0 and r < 0 or vice versa then we have h S ( r ) + S h S ( r ) = S so that h S ( r + R r ) S = h S ( r ) + S h S ( r ) . The treatment of S and / S is similar. For the constants, we have h S ( 0 R ) = 0 S and h S ( 1 R ) = 1 S . □

3. First-Order Logic

We recall the syntax and semantics of first-order logic with equality. For this, we fix a countably infinite set of variables V that will be ranged over by x , y , z .

3.1. Expressions

Given a ranked signature with constants and function symbols Σ = C n 0 F ( n ) , the set of Σ -expressions contains all terms that can be constructed from constants and variables by using function symbols:
e 1 , , e n E Σ  ::= x c f ( e 1 , , e n )  where c C , n 0 , f F ( n ) , x V
Let fv ( e ) be the set of all variables that occur in e. Given a subset V V let E Σ ( V ) be the subset of expression e E Σ with fv ( e ) V .
The semantics of Σ -expressions is defined in Figure 2. For any Σ -structure S and variable assignment σ : V dom ( S ) , any expression e E Σ ( V ) denotes a set of values e σ , S dom ( S ) . This set is defined recursively by set-valued interpretation of the operators of the expressions in the structure S. If S is a Σ -algebra, then the result will always be a singleton.

3.2. Logic Formulas

The set of first-order formulas is the set of terms constructed with the usual first-order connectives from equations with symbols in Σ and variables in V :
ϕ F Σ  ::= e = e x . ϕ ϕ ϕ ¬ ϕ  where e , e E Σ and x V
A Σ -formula ϕ F Σ is a term, which either is a Σ -equation e = e with variables in V , an existentially quantified formula x . ϕ , a conjunction ϕ ϕ , or a negation ¬ ϕ . A system of Σ -equations is a conjunction of equations e 1 = e 1 e n = e n where e 1 , e 1 , , e n , e n E Σ .
The set of free variables fv ( ϕ ) contains all those variables of ϕ that occur outside the scope of any existential quantifier in ϕ . Given a subset V V we write F Σ ( V ) for the subset of formulas ϕ F Σ such that fv ( ϕ ) V .
First-order formulas can be defined for providing the missing logical operators. Firstly, we can define disjunctions ϕ ϕ = def ¬ ( ¬ ϕ ¬ ϕ ) and implications ϕ ϕ = def ¬ ϕ ϕ , and secondly, universally quantified formulas x . ϕ = def ¬ x . ¬ ϕ . Note that these formulas are not negation-free (and thus John’s theorem cannot be applied to them). Third, we define the valid formula true = def x . x = x . Fourth, we write i = 1 n ϕ i instead of ϕ 1 ϕ n . In the case n = 0 the conjunction is true . Fifth, for any vector of variables y = ( y 1 , , y n ) V n we will write y . ϕ instead of y 1 y n . ϕ .
For any V V , the semantics of first-order formulas ϕ F Σ ( V ) for a Σ -structure S and a variable assignment σ : V dom ( S ) is the truth value ϕ σ , S B defined in Figure 3.
Note that the equality symbol = is interpreted as nondisjointness, i.e., an equation e = e is true if and only if e σ , S e σ , S . In the case of Σ -algebras, the equality symbol = is indeed interpreted as equality of singletons. In the case of more general Σ -structures, though, it is not interpreted as set equality.
The set of solutions with domain V of a formula ϕ F Σ ( V ) over a Σ -algebra S is:
s o l V S ( ϕ ) = { σ : V dom ( S ) ϕ σ , S = 1 }
If V = fv ( ϕ ) we omit the index V, i.e., s o l S ( ϕ ) = s o l V S ( ϕ ) .
Two formulas ϕ , ϕ F Σ are called S-equivalent if they have the same solution sets over S on V = fv ( ϕ ) fv ( ϕ ) , that is s o l V S ( ϕ ) = s o l V S ( ϕ ) . Note that y = y is equivalent to z = z and also to true , i.e., to x . x = x .

3.3. Examples

Since B R + we can define the boolean abstraction by a formula y = h B ( x ) in F Σ b o o l over R + with two variables x , y V :
( x = 0 y = 0 ) ( ¬ x = 0 y = 1 )
Since S R we can define the sign abstraction by a formula y = h S ( x ) in F Σ b o o l over R with two variables x , y V :
( x = 0 y = 0 ) ( x > 0 y = 1 ) ( x < 0 y + 1 = 0 )
where:
x 0 = def z . x = z z x > 0 = def x 0 ¬ ( x = 0 ) x < 0 = def ¬ x 0
These definitions illustrate that both abstraction are closely related to strict inequations x > 0 and x < 0 . The boolean abstraction is concerned with strict positivity x > 0 , while the sign abstraction is also concerned with strict negativity x < 0 .

3.4. Semantic Properties of Free and Bound Variables

We need the following two standard lemmas on the role of free and bound variables for the solution sets of logic formulas. For any subset of variable assignments R of type V dom ( S ) and any disjoint sets of variables V V = we define ext V S ( R ) = { σ σ σ : V dom ( S ) , σ R } .
Lemma 3
(Cylindrification). If V fv ( ϕ ) = then s o l V fv ( ϕ ) S ( ϕ ) = ext V S ( s o l S ( ϕ ) ) .
Proof. 
We can show that e σ , S = e σ | fv ( e ) , S for all expressions e E Σ with fv ( e ) disjoint to V and any variable assignment σ : fv ( e ) V dom ( S ) by induction on the structure of expressions. From this, we can prove for all formulas ϕ F Σ such that fv ( ϕ ) is disjoint from V and σ : fv ( ϕ ) V dom ( S ) that ϕ σ , S = ϕ σ | fv ( ϕ ) , S by induction on the structure of Σ -formulas. This implies the lemma. □
The projection π a ( f ) of a function f : A B is its restriction f | A \ { a } . The projection of a set F of functions f : A B is π a ( F ) = { π a ( f ) f F } .
Lemma 4
(Quantification is projection). s o l S ( x . ϕ ) = π x ( s o l S ( ϕ ) ) .
Proof. 
This is follows from the semantics of existential quantified formulas as follows:
s o l S ( x . ϕ ) = { σ | fv ( ϕ ) \ { x } σ s o l S ( ϕ ) } = π x ( s o l S ( ϕ ) )

4. Abstract Interpretation

We recall the notion of Σ -abstractions and use them for abstracting sets of concrete solutions of logic formulas within the usual framework of abstract interpretation. Due to John’s theorem, this abstraction can be soundly approximated by the abstract interpretation of logic formulas in the target structure of the Σ -abstraction. We will argue that John’s overapproximation shows the soundness of abstract interpretation in the classical framework of Cousot & Cousot [1]. We will then introduce the notion of exactness of a logic formula with respect to a Σ -abstraction and relate it to the completeness of abstract interpretation.

4.1. John’s Overapproximation for Σ -Abstractions

The notion of Σ -abstraction from [6] generalizes at the same time over the boolean abstraction and the sign abstraction.
Definition 4.
A Σ-abstraction is a homomorphism h : S Δ between Σ-structures such that dom ( Δ ) dom ( S ) .
The boolean abstraction h B is a Σ b o o l -abstraction by Lemma 1. The sign abstraction h S is a Σ b o o l -abstraction by Lemma 2.
Let h : S Δ be a Σ -abstraction and V V . For any subset of assignments R of type V dom ( S ) , we define the abstraction:
h R = { h σ : V dom ( Δ ) σ R }
Theorem 1
(John’s Overapproximation [6,8,9]). For any Σ-abstraction h : S Δ between Σ-structures and any negation-free Σ-formula ϕ F Σ :
h s o l S ( ϕ ) s o l Δ ( ϕ )
John’s theorem states that the abstraction with respect to h of the concrete solution set of a first-order formula can be overapproximated by abstract interpretation of the formula in the target structure of h.
We only give a brief sketch of the full proof, which can be found in [6]. Let V = fv ( ϕ ) and σ : V dom ( S ) . For any expression e E Σ ( V ) , we can show h ( e σ , S ) = e h σ , Δ by induction on the structure of e. It then follows for any negation-free formula ϕ F Σ ( V ) that ϕ σ , S ϕ h σ , Δ . This is equivalent to that { h σ σ s o l V S ( ϕ ) } s o l V Δ ( ϕ ) and thus h s o l V S ( ϕ ) s o l V Δ ( ϕ ) . Since V = fv ( ϕ ) , it follows that h s o l S ( ϕ ) s o l Δ ( ϕ ) as required.

4.2. Exactness of Σ -Formulas for Σ -Abstractions

As a new contribution, we introduce the notion of exactness of first-order formulas with respect to a Σ -abstraction.
Definition 5
(h-Exactness). Let h : S Δ be a Σ-abstraction and ϕ F Σ ( V ) a formula. We call ϕ h-exact with respect to V if h s o l V S ( ϕ ) = s o l V Δ ( ϕ ) . We call ϕ h-exact if ϕ is h-exact with respect to fv ( ϕ ) .
For instance, the linear equation system ϕ equal to x + y = x + z is neither h B -exact nor h S -exact. However it is equivalent to y = z which is both h B -exact and h S -exact. To see this note that τ = [ x / 1 , y / 1 , z / 0 ] belongs to s o l B ( ϕ ) but not to h B s o l R + ( ϕ ) since τ ( y ) τ ( z ) . The same assignment also belongs to s o l S ( ϕ ) but not to h S s o l R ( ϕ ) since τ ( y ) τ ( z ) .

4.3. Soundness and Completeness of Abstract Interpretation

John’s theorem is related to the soundness of abstract interpretation and the notion of exactness to its completeness. To state the precise relationship, we need to embed our setting into the classical framework of abstract interpretation [1,10].
When considering formulas as programs, the usual framework of abstract interpretation of programs applies to the interpretation of the formulas (programs) in the target structure of the Σ -abstraction. More formally, we fix a finite subset of variables V V and consider the subset of formulas as programs:
P = { ϕ F Σ ( V ) ϕ is negation - free }
The semantics of a program ϕ P over a given Σ -structure S is the set of its solutions over S:
ϕ = s o l S ( ϕ )
The range of the semantics mapping is the space of concrete values C = 2 { σ σ : V dom ( S ) } . Note that ( C , , , ) is a complete lattice. An abstract interpretation of a program ϕ P maps ϕ to the set of its solutions over Δ :
ϕ = s o l Δ ( ϕ )
The range of the abstract interpretation is the abstract domain A = 2 { τ τ : V dom ( Δ ) } . Clearly, ( A , , , ) is also a complete lattice. We define the abstraction function α h : C A of our Galois connection such that for subsets of concrete assignments R C :
α h ( R ) = h R
Definition 6
(Cousot & Cousot [1], Giacobazzi, Ranzato & Scozzari [10]). An abstract interpretation . : P A is sound for an abstraction α : C A with respect to the program semantics . : P C if for all programs ϕ P it holds that α ( ϕ ) ϕ . It is complete if all programs ϕ P satisfy α ( ϕ ) = ϕ .
John’s theorem states that the abstract interpretation α h of negation free-formulas ϕ P over Δ is sound for the abstraction of s o l S ( ϕ ) with respect to the Σ -abstraction h : S Δ . Furthermore, if all formulas of P are h-exact then abstract interpretation over Δ is complete for abstraction α h . As illustrated above, abstract interpretation over B fails to be complete for the abstraction α h B , and similarly, abstract interpretation over S fails to be complete for the abstraction α h S . Note that the completeness of abstract interpretations was largely studied in the context of program analysis (see e.g., Section 8 of [10] for an overview).
In the present article, we study the problem of exact rewriting for h B . The question is how to rewrite a Σ b o o l -formula into a h B -exact formula that is R + -equivalent. Note that exact rewriting of linear equation system for h B is a different problem than to decide whether abstract interpretation is complete for α h B on linear equation systems. Still, both notions are closely related: exact rewriting can help to improve the precision of abstract interpretation just in the case where it is not already complete, i.e., maximally precise. Otherwise, exact rewriting is trivial.
In the case of the sign abstraction, we do not have any algorithmic idea of how to do exact rewriting for linear equation systems. Therefore, we study the easier problem of exact rewriting for the boolean abstraction of linear equation systems in the first place. Given an h B -exact formula ϕ , we can compute the abstraction h B s o l R + ( ϕ ) = s o l B ( ϕ ) by finite domain constraints programming. We then use exact rewriting for the boolean abstraction to compute sign abstractions of linear equation systems h S s o l R ( ϕ ) , rather than relying on exact rewriting for the sign abstraction itself. For this, we use first-order definitions beside of finite domain constraint programming.

4.4. Galois Connection

We finally introduce the concretization operation that corresponds to the abstraction of the solution set of a logic formula with respect to a Σ -abstraction, and show that the pair of abstraction and concretization forms a Galois connection.
Given a Σ -abstraction h : S Δ , and a set R of variable assignments to dom ( Δ ) , we define the left-decomposition of R with respect to h as the following set of variable assignments to dom ( S ) :
h R = def { σ h σ R }
So let α h : C A be the abstraction induced by Σ -abstraction h. We define the corresponding concretization function γ h : A C such that for all abstract assignments R A :
γ h ( R ) = h R = def { σ C h σ R }
Lemma 5.
( A , C , α h , γ h ) is a Galois connection, i.e., for all R C and T A :
α h ( R ) T if and only if R γ h ( T )
Proof. 
If h R T then h h R T and since R h h R we have R h T . If conversely R h T then h R h h T and since h h T = T it follows that h R T . □

5. Equation Systems, Positivity, and Triangularity

We study systems of Σ b o o l -equations for positivity and triangularity. These notions will be essential for showing B -exactness. We are not only interested in homogeneous linear equations but also in more general polynomial equations without constant term.

5.1. Classes of Equation Systems

Let e 1 , , e n E Σ b o o l be a sequence of expressions and n N . If n 0 we define i = 1 n e i = def e 1 + + e n and i = 1 n e i = def e 1 e n . For n = 0 , we define i = 1 n e i = 0 and i = 1 n e i = 1 . Furthermore, for any expression e E Σ b o o l we define:
n e = def i = 1 n e and e n = def i = 1 n e
A polynomial (with natural coefficients) is a Σ b o o l -expression of the following form:
j = 1 l n j k = 1 i j x j , k m j , k
where l and i j are natural numbers, x 1 , 1 , , x l , i l variables, all n j 0 are natural numbers called the coefficients, and all m j , k 0 are natural numbers called the exponents. The products k = 1 i j x j , k m j , k are called the monomials of the polynomial.
Definition 7.
A polynomial j = 1 l n j k = 1 i j x j , k m j , k with natural coefficients n j 0 has no constant term if none of its monomials are equal to 1, i.e., i j 0 for all 1 j l . It is linear if all its monomials are variables, i.e., i j = 1 and m j , 1 = = m j , i j = 1 for all 1 j l .
A polynomial equation is a Σ b o o l -equation p = p between polynomials. A polynomial equation system is a system of polynomial equations.
Linear polynomials have the form j = 1 l n j x j , 1 where l and all n j 0 are naturals and all x j , 1 are variables. In particular, linear polynomials do not have a constant term. Note that the constant 0 is equal to the linear polynomial with l = 0 . A (homogeneous) linear equation is a polynomial equation with linear polynomials, so without constant terms. A (homogeneous) linear equation system is a system of linear equations.
A (homogeneous) integer matrix equation has the form A y = 0 where A is a n × m matrix of integers for some naturals m , n such that y V m and 0 { 0 } n . Any integer matrix equation can be turned into a linear equation system with natural coefficients, by bringing the negative coefficients positively on the right-hand side. For instance, the linear integer matrix equation:
3 0 2 5 x y = 0 0
corresponds to the following system of linear Σ b o o l -equations:
3 x = 0 2 x = 5 y
Therefore, we will sometimes confuse an integer matrix equations with the corresponding system of linear Σ b o o l -equations. Conversely, any system of linear Σ b o o l -equations can be converted into a integer matrix equation by moving the positive right-hand sides negatively to the left and factorizing the expressions for the different occurrences of the same variable.

5.2. Positivity and Triangularity

such that σ ( y ) , σ ( y ) We next define positivity and triangularity properties for equation systems. These are key properties to show B -exactness of linear equation systems.
Definition 8.
A Σ b o o l -equation is called positive if it has the form e = 0 and quasi-positive if it has the form e = n y , where n N , y V , and e E Σ b o o l . We call a system of Σ b o o l -equations positive respectively quasi-positive if all its equations are.
This definition makes sense, since all constants in Σ b o o l -expressions are positive and all operators of Σ b o o l -expressions preserve positivity. Note also that any positive equation is quasipositive since the constant 0 is equal to the polynomial 0 y .
This above system of linear equations is quasipositive, but not positive since 5 y appears on a right-hand side. More generally, the linear equation system for a integer matrix equation A y = 0 is positive if and only if all integers in A are positive, and quasipositive if each line of A contains at most one negative integer.
Definition 9.
We call a quasipositive system of Σ b o o l -equations triangular if it has the form l = 1 n e l = n l y l such that the variables y l are l-fresh for all 1 l n , i.e., y l fv ( i = 1 l 1 e i = e i ) and if n l 0 then y l fv ( e l ) . We call the quasi-positive polynomial system strongly-triangular if it is triangular and satisfies n l 0 for all 1 l n .
The above linear equation system is triangular, but not strongly triangular since the right-hand side of the first equation is 0. Consider an integer matrix equation A y = 0 . If A is positive and triangular, then the corresponding linear equation system is positive and triangular too. For being quasipositive and strongly-triangular, the integers below the diagonal of A must be negative, those on the diagonal must be strictly negative, and those on the right of the diagonal must be positive.

5.3. Linear Equation Systems and Elementary Modes

We next show that elementary modes [12,13,14,15] can be used to transform systems of linear equations into R + -equivalent systems that are quasi-positive and strongly-triangular.
We first recall the necessary definitions and folklore results on elementary modes and the double description method. We limit the presentation to equations with integer coefficients solved in R + , since more general definitions and results for elementary modes in R are not needed for this paper.
Definition 10.
The support of a function σ : V R is supp ( σ ) = { y V σ ( y ) 0 } .
Definition 11
(Elementary Modes). An elementary mode of an integer matrix A Z n , m is a vector n N n such that for any sequence of pairwise distinct variables y V n the function σ = [ y / n ] is a solution in s o l R + ( A y = 0 ) such that:
  • supp ( σ ) is minimal, i.e., there exist no σ s o l S ( ϕ ) such that supp ( σ ) supp ( σ ) ,
  • σ is normalized, i.e., there exist variables y , y in y such that σ ( y ) and σ ( y ) are coprimes (their greatest common divisor is 1).
The elementary modes of a matrix A are the extreme directions of the polyhedral cone s o l R + ( A y = 0 ) . This implies that any solution of the linear system can be expressed as a weighted sum of its elementary modes, where all the weights are non negative. Due to normalization, the number of elementary modes is finite for all integer matrices.
Theorem 2
(Folklore). For any integer matrix A Z m , n one can compute a matrix of natural numbers E N n , o in at most exponential time, such that the Σ b o o l -formulas for A y = 0 and x . E x = y are R + -equivalent for all vectors y V n and x V o of pairwise distince variables. Furthermore, the o columns of E are the elementary modes of A.
We note that Theorem 2 can be lifted to matrices of rational numbers Q , since any rational matrix equation A y = 0 can be rewritten to a integer matrix equation with the same R + -solution set, by multiplying with the natural numbers in the denominators of the rational numbers. The freely available cddlib tool in the rational mode [24] inputs a matrix A Q n , m , and outputs the list of (integer) elementary modes of A. From this list, we can construct the matrix E for A by aligning the elementary modes of A as the columns of E.
Note that the interface of the cddlib tool is more general, in that it applies to rational matrix inequations interpreted over the reals, rather than to rational matrix equations interpreted over the positive reals: it permits to compute the normalized extreme directions of the polyedral cone s o l R ( B y 0 ) for any rational matrix inequation B over the reals. If one wants to compute the elementary modes of a rational matrix A – that is the normalized extreme directions of polyhedral cones of over the positive reals s o l R + ( A y = 0 ) – then one can chose B = A A I d where I d is the identity matrix with as many columns as A.
Corollary 1
(Elementary Mode Rewriting). Given a system of linear equations ϕ F Σ b o o l , one can compute in at most exponential time an R + -equivalent formula emr ( ϕ ) that has the form x . ϕ where ϕ is quasi-positive and strongly-triangular system of equations.
Proof. 
Any system of linear equations ϕ can be converted into some integer matrix equation A y = 0 where y is a vector that contains all variables in fv ( ϕ ) exactly once. Let E be a matrix of elementary modes of A from Theorem 2. This theorem states that A y = 0 and thus ϕ is R + -equivalent to x . E x = y for some vector of fresh variables x . So let emr ( ϕ ) be x . ϕ and ϕ be E x = y . Since all entries of E are positive, the variables in y are pairwise distinct, and the variables in x are chosen freshly, it follows that ϕ is both quasi-positive and strongly-triangular. □
We have implemented the elementary mode rewriting in Python based on the cddlib tool, and plan to make our tool publically available soon. An example input is the system of linear Σ b o o l -equations ϕ 0 given in Figure 4. The corresponding integer matrix equation system is given there too. The elementary modes of the matrix of this system are the vectors ( 1 , 0 , 1 , 1 ) and ( 1 , 1 , 0 , 0 ) . When putting these vectors in the columns of a new matrix, our tool returns the elementary mode rewriting emr ( ϕ 0 ) in Figure 5.

6. h B -Exact Rewriting of Linear Equation Systems

Our next objective is to study the preservation of h-exactness by logical operators. The main difficulty of this paper is the fact that h-exactness is not preserved by conjunction. Nevertheless, as we will show next, it is preserved by disjunction and existential quantification.
To do so we first show that h-exactness is preserved when adding variables. For this, we have to assume that the Σ -abstraction h is sujective, which will be the case of all Σ -abstractions of interest.
Lemma 6
(Variable extension preserves exactness). Let h : S Δ be a Σ-abstraction that is surjective and ϕ F Σ ( V ) a formula. Then the h-exactness of ϕ implies the h-exactness of ϕ with respect to V.
Proof. 
This follows from that abstractions of solutions of ϕ can be extended arbitrarily to variables that do not appear freely in ϕ as stated by the following claim.
Claim 1.
For all σ : V Δ : σ h s o l S ( ϕ ) iff σ | fv ( ϕ ) h s o l S ( ϕ ) .
For the one direction let σ h s o l V S ( ϕ ) . Then, there exists σ s o l V S ( ϕ ) such that σ = h σ . Since V fv ( ϕ ) it follows that σ | fv ( ϕ ) s o l S ( ϕ ) . Furthermore σ | fv ( ϕ ) = h σ | fv ( ϕ ) and thus σ | fv ( ϕ ) h s o l S ( ϕ ) .
For the other direction let σ | fv ( ϕ ) ) h s o l S ( ϕ ) . Then, there exists σ s o l S ( ϕ ) such that σ | fv ( ϕ ) = h σ . For any y V \ fv ( ϕ ) let s y dom ( S ) be such that h ( s y ) = σ ( y ) . Such values exists since h is surjective. Now define σ = σ [ y / s y y V \ fv ( ϕ ) ] . Since V fv ( ϕ ) it follows that σ s o l V S ( ϕ ) . Furthermore, σ = h σ , so σ h s o l V S ( ϕ ) . □
For the case of disjunction, we need a basic property of unions (joins) which fails for intersections (meets).
Lemma 7
(Abstraction α h preserves joins). Let V be a set of variables, R 1 and R 2 be subsets of assignments of type V dom ( S ) and h : S Δ be a Σ-abstraction. Then:
h ( R 1 R 2 ) = h R 1 h R 2
Proof. 
This lemma follows from the following equivalences:
τ h ( R 1 R 2 ) σ . σ R 1 R 2 τ = h σ σ . ( σ R 1 σ R 2 ) τ = h σ σ . ( σ R 1 τ = h σ ) ( σ R 2 τ = h σ ) τ h R 1 τ h R 2 τ h R 1 h R 2
Proposition 1.
The disjunction of h-exact formulas is h-exact.
Proof. 
Let ϕ 1 and ϕ 2 be negation free formulas that are h-exact. Let V = fv ( ϕ 1 ) fv ( ϕ 2 ) . Lemma 6 shows that ϕ 1 and ϕ 2 are also h-exact with respect to the extended variable set V, i.e., for both i { 1 , 2 } :
h s o l V S ( ϕ i ) = s o l V Δ ( ϕ i )
The h-exactness of the disjunction ϕ 1 ϕ 2 can now be shown as follows:
h s o l S ( ϕ 1 ϕ 2 ) = h ( s o l V S ( ϕ 1 ) s o l V S ( ϕ 2 ) ) = h s o l V S ( ϕ 1 ) h s o l V S ( ϕ 2 ) by Lemma   7 = s o l V Δ ( ϕ 1 ) s o l V Δ ( ϕ 2 ) by h - exactness of ϕ 1 and ϕ 2 wrt . V = s o l Δ ( ϕ 1 ϕ 2 )
Lemma 8
(Projection commutes with abstraction). For any Σ-abstraction h : S Δ , subset R of assignments of type V S , and variable x V : π x ( R ) = π x ( h R ) .
Proof. 
For all σ : V dom ( S ) we have h π x ( σ ) = h σ | V \ { x } = ( h σ ) | V \ { x } = π x ( h σ ) . □
Proposition 2
(Quantification preserves exactness). For any surjective Σ-abstraction h : S Δ and formula x . ϕ F Σ , if ϕ is h-exact then x . ϕ is h-exact.
Proof. 
Let ϕ be h-exact. By definition ϕ is h-exact with respect to V = fv ( ϕ ) . Since h is assumed to be surjective, Lemma 6 implies that ϕ is h-exact with respect to V { x } (independently of whether x occurs freely in ϕ or not). Hence:
h ( s o l S ( x . ϕ ) ) = ( π x ( s o l S ( ϕ ) ) ) by Lemma   4 = π x h ( ( s o l S ( ϕ ) ) ) by Lemma   8 = π x ( s o l Δ ( ϕ ) ) sin ce ϕ is h - exact = s o l Δ ( x . ϕ ) by Lemma   4
We next study the h-exactness for strongly-triangular systems of Σ b o o l -equations, under the condition that h is an abstraction between Σ b o o l -algebras with unique division (see Definition 12).
Lemma 9
(Singleton property). If S is a Σ-algebra, e E Σ ( V ) , and σ : V S a variable assignment, then the set e σ , S is a singleton.
Proof. 
By induction on the structure of expressions e E Σ ( V ) :
Case of constants c C . The set c σ , S = { c S } is a singleton.
Case of variables x V . The set x σ , S = { σ ( x ) } is a singleton.
Case f ( e 1 , , e n ) where e i E Σ ( V ) and f F ( n ) .
f ( e 1 , , e n ) σ , S = { f S ( s 1 , , s n ) s i e i σ , S }
This set is a singleton since e i σ , S are singletons by induction hypothesis, meaning that f S ( e 1 σ , S , , e n σ , S ) is also a singleton since S is a Σ -algebra. □
A Σ -algebra is a Σ -structure with the singleton property. Let ele be the function that maps any singleton to the element that it contains.
Definition 12.
We say that a Σ b o o l -structure S has unique division if it satisfies the first-order formula x . = 1 y . n y = x for all nonzero natural numbers n N .
Clearly, the Σ b o o l -structures R + , B , and S have unique division. Note, however, that S is not a Σ b o o l -algebra, so that the following two Propositions 3 and 4 cannot be applied to S instead of B .
For any element s of the domain of a Σ b o o l -structure S with unique division and any nonzero natural number n N , we denote by s n the unique element of { σ ( y ) σ s o l S ( n y = z ) , σ ( z ) = s } .
Lemma 10.
Let ϕ F Σ b o o l be a formula and S a Σ b o o l -algebra with unique division. For nonzero natural number n, variable y fv ( ϕ ) , and expression e E Σ ( fv ( ϕ ) ) :
s o l S ( ϕ n y = e ) = { σ [ y / ele ( e σ , S ) n ] σ s o l S ( ϕ ) }
Proof. 
We fix some σ : fv ( ϕ ) dom ( S ) arbitrarily. Since S is a Σ b o o l -algebra, e σ , S is a singleton and fv ( e ) V ( ϕ ) , ele ( e σ , S ) is defined uniquely. Furthermore S has unique division, so that ele ( e σ , S ) n is a well-defined element of dom ( S ) . Therefore and since y fv ( ϕ ) , σ [ y / ele ( e σ , S ) n ] is the unique solution of the equation n y = e that extends on σ .
Firstly, we prove the inclusion “⊇”. Let σ s o l S ( ϕ ) , y fv ( ϕ ) , and σ [ y / ele ( e σ , S ) n ] is a solution of n y = e , it follows that σ [ y / ele ( e σ , S ) n ] is a solution of ϕ n y = e .
Secondly, we prove the inverse inclusion “⊆”. Let σ s o l S ( ϕ n y = e ) . Since σ [ y / ele ( e σ , S ) n ] is the unique solution of the equation n y = e that extends on σ = σ | fv ( ϕ ) it follows that σ ( y ) = ele ( e σ , S ) n so that σ = σ [ y / ele ( e σ , S ) n ] while σ s o l S ( ϕ ) . □
Proposition 3.
Let ϕ F Σ b o o l ( V ) a formula, n 0 a natural number, e E Σ b o o l ( V ) an expression, y V , and h : S Δ a Σ b o o l -abstraction between Σ b o o l -algebras with unique division. Under these conditions, if ϕ is h-exact then ϕ e = n y is h-exact.
Proof. 
Let e E Σ b o o l ( V ) an expression. □
Claim 2.
For any σ : V R + : h ( ele ( e σ , S ) ) = ele ( e h σ , Δ ) .
This can be seen as follows. For any σ : V S Theorem 1 on homomorphism yields h ( e σ , S ) e h σ , Δ . Since S and Δ are both Σ -algebras, the sets e σ , S and e h σ , Δ are both singletons by Lemma 9, so that h ( ele ( e σ , S ) ) = ele ( e h σ , Δ ) .
Claim 3.
For any s dom ( S ) and n 0 a natural number: h ( s n ) = h ( s ) n .
Since S is assumed to have unique division s = s n is well-defined as the unique element of dom ( S ) such that s + S + S s n = s . Hence, h ( s + S + S s n ) = h ( s ) and since h is a homomorphism, it follows that h ( s ) + Δ + Δ h ( s ) n = h ( s ) . Since Δ is assumed to have unique division, this implies that h ( s ) = h ( s ) n .
The Proposition can now be shown based on these two claims. Let ϕ be h-exact, y V , and fv ( e ) V . We have to show that ϕ n y = e is h-exact too:
h s o l S ( ϕ e = n y ) = h { σ [ y / ele ( e σ , S ) n ] σ s o l S ( ϕ ) } by Lemma   10 = { ( h σ ) [ y / h ( ele ( e σ , S ) n ) ] σ s o l S ( ϕ ) } elementary = { σ [ y / h ( ele ( e σ , S ) n ) ] σ s o l Δ ( ϕ ) } h - exactness of ϕ = { σ [ y / h ( ele ( e σ , S ) ) n ] σ s o l Δ ( ϕ ) } by Claim   3 = { σ [ y / ele ( e h σ , Δ ) n ] σ s o l Δ ( ϕ ) } by Claim   2 = s o l Δ ( ϕ e = n y ) by Lemma   10
Proposition 4.
Let h : S Δ be a Σ b o o l -abstraction between algebras with unique division. Then any strongly-triangular system of Σ b o o l -equations is h-exact.
Proof. 
Any strongly-triangular system of equations has the form i = 1 n e i = n i y i where n and n i 0 are naturals and y i is i-fresh for all 1 i n . The proof is by induction on n. In the case n = 0 , the conjunction is equal to true which is h-exact since h ( s o l S ( t r u e ) ) = s o l Δ ( t r u e ) . In the case n > 0 , we have by induction hypothesis that j = 1 i 1 e j = n j y j is h-exact. Since n i 0 it follows from Proposition 3 that that e i = n i y i j = 1 i 1 e j = n j y j is h-exact. □
We notice that Proposition 4 remains true for triangular systems that are not strongly-triangular. This follows from results that we can only present in the next section (Theorem 4 and Proposition 5), since they require an additional argument.
Theorem 3
( h B -Exactness). Quasi-positive strongly-triangular polynomial systems are h B -exact.
Proof. 
The Σ b o o l -algebras R + and B have unique division, so we can apply Proposition 4 for proving the theorem. □
We note that the analogous statement for S instead of B fails, even though S has unique division. The problem is that S is not a Σ b o o l -algebra. As a counter-example, reconsider the strongly-triangular system of quasi-positive system equations:
u + v = x u + v = y
This system implies x = y over R but accept the abstract solution [ u / 1 , v / 1 , x / 1 , y / 1 ] mapping x and y to distinct signs, so it is not h S -exact. Nevertheless, it is h B -exact by Theorem 3.
Corollary 2
( h B -exact rewriting of linear equation systems). For any linear Σ b o o l -equations ϕ the elementary mode rewriting emr ( ϕ ) F Σ b o o l is R + -equivalent, h B -exact, and can be computed in at most exponential time from ϕ.
Proof. 
The elementary modes rewriting Corollary 1 shows that any linear Σ b o o l -equation system ϕ is R + -equivalent a formula emr ( ϕ ) of the form z . ϕ such that ϕ is a quasi-positive strongly-triangular linear equation system. Theorem 3 shows that any quasi-positive strongly-triangular linear equation system is h B -exact, so is ϕ . Existential quantification preserves h B -exactness by Proposition 2, so emr ( ϕ ) is h B -exact too. □
This h B -exact rewriting permits us to compute the boolean abstraction of any system of linear Σ b o o l -equations by computing the B -solutions of the R + -equivalent h B -exact formula. The latter can be done by finite domain constraint programming.
Our objective to find an algorithm for computing the sign abstraction of a system of linear Σ b o o l -equations remains open. We finally approach it in Section 9. While the idea is to use the h B -exact rewriting algorithm, we first need to generalize it from linear systems to mixed systems. This is done in Section 8. The generalization relies on the notion of h B -invariance, which we discuss next in Section 7.

7. Invariance

A problem that we need to overcome is that conjunctions of two h-exact formulas may not be h-exact. The situation changes when assuming the following notion of h-invariance for at least one of the two formulas.
Definition 13
(Invariance). Let h : S Δ be a Σ-abstraction and V V a subset of variables. We call a subset R of variable assignments of type V dom ( S ) h-invariant iff:
σ , σ : V dom ( S ) . ( σ R h σ = h σ σ R ) .
We call a Σ-formula ϕ h-invariant if its solution set s o l S ( ϕ ) is.
The relevance of the notion of invariance for exactness of conjunctions—that we will formalize in Proposition 5—is due to the the following lemma:
Lemma 11.
If either R 1 or R 2 are h-invariant then: h ( R 1 R 2 ) = h R 1 h R 2 .
Proof. 
The one inclusion is straightforward without invariance:
h ( R 1 R 2 ) = { h σ σ R 1 , σ R 2 } { h σ σ R 1 } { h σ σ R 2 } = h R 1 h R 2
For the other inclusion, we can assume without loss of generality that R 1 is h-invariant. So let τ h R 1 h R 2 . Then, there exist σ 1 R 1 and σ 2 R 2 such that τ = h σ 1 = h σ 2 . By h-invariance of R 1 it follows that σ 1 R 2 . So σ 1 R 1 R 2 , and hence, τ h ( R 1 R 2 ) . □
We can now present the algebraic characterization of h-invariance based on the concretization function γ h of the Galois connection of h. Recall that R h ( h R ) for all subsets of concrete variable assignments R. The inverse inclusion characterizes the h-invariance of R.
Lemma 12
(Algebraic characterization). Let h : S Δ be a Σ-abstraction. A subset R of concrete variable assignment V dom ( S ) is h-invariant for h iff h ( h R ) R .
Proof. 
“⇒”. Let R be h-invariant and σ h ( h R ) . Then, there exists σ R such that h σ = h σ . The h-invariance of R thus implies that σ R .
“⇐”. Suppose that h ( h R ) R . Let σ , σ : V dom ( S ) such that h σ = h σ and σ R . We have to show that σ R . From h σ = h σ and σ R it follows that σ h ( h R ) and thus σ R as required. □
Lemma 13
(Variable extension preserves invariance). Let h be a surjective abstraction and R a subset of functions of type V dom ( S ) and V a subset of variables disjoint from V . If R is h-invariant then ext V S ( R ) is h-invariant too.
Proof. 
This follows straightforwardly from the characterization of h-invariance in Lemma 12 and the following two claims:
Claim 4.
If h is surjective then h ext V S ( R ) = ext V Δ ( h R ) .
This follows from h ext V S ( R ) = { h σ σ ext V S ( R ) } = ext V Δ ( { h σ σ R } ) where we use the surjectivity of h in the last step.
Claim 5.
h ext V Δ ( R ) = ext V S ( h R ) for any subset R of functions of type V dom ( Δ ) .
h ext V Δ ( R ) = { σ : V V dom ( S ) h σ ext V Δ ( R ) } = { σ : V V dom ( S ) h σ | V R } = ext V S ( { σ : V dom ( S ) h σ R } = ext V S ( h R )
Lemma 14.
Let h : S Δ be a surjective Σ-abstraction, ϕ be a Σ-formula, and V fv ( ϕ ) . Then, the h-invariance of ϕ implies the h-invariance of s o l V S ( ϕ ) .
Proof. 
This follows from the cylindrification Lemma 3 and that extension preserves h-invariance as shown in Lemma 13. □
Proposition 5
(Exactness is preserved by conjunction when assuming invariance). Let h be a surjective Σ-abstraction. If ϕ 1 and ϕ 2 are h-exact Σ-formulas and ϕ 1 or ϕ 2 are h-invariant then the conjunction ϕ 1 ϕ 2 is h-exact.
Proof. 
Let ϕ 1 and ϕ 2 be h-exact Σ -formulas. We assume without loss of generality that ϕ 1 is h-invariant. Let V = fv ( ϕ 1 ϕ 2 ) . Since fv ( ϕ 2 ) V the set s o l V S ( ϕ 2 ) is h-invariant too by Lemma 14. We can now show that ϕ 1 ϕ 2 is h-exact as follows:
h s o l S ( ϕ 1 ϕ 2 ) = h ( s o l V S ( ϕ 1 ) s o l V S ( ϕ 2 ) ) = h s o l V S ( ϕ 1 ) h s o l V S ( ϕ 2 ) by Lemma   11 = s o l V Δ ( ϕ 1 ) s o l V Δ ( ϕ 2 ) by h - exactness of ϕ 1 and ϕ 2 wrt V = s o l Δ ( ϕ 1 ϕ 2 )
Our next objective is to show that h-invariant formulas are closed under conjunction, disjunction, and existential quantification. The two former closure properties rely on the following two algebraic properties of abstraction decomposition.
Lemma 15
(Concretization γ h preserves join and meet). For any Σ-abstraction h : S Δ , any subsets of assignments of type V dom ( S ) R 1 and R 2 and V a subset of variables:
  • h ( R 1 R 2 ) = h R 1 h R 2 .
  • h ( R 1 R 2 ) = h R 1 h R 2 .
For general Galois connections, concretization is well-known to preserve joins but may not preserve meets. Still, meets are preserved for any Galois connections where the the concrete and abstract domains C and A are powersets as in our setting, so that joins are unions and meets intersections.
Proof. 
The case of unions follows straightforwardly from the definitions:
h ( R 1 R 2 ) = { σ h σ R 1 R 2 } = { σ h σ R 1 h σ R 2 } = { σ h σ R 1 } { σ h σ R 2 } = h R 1 h R 2
The case of intersection is symmetric:
h ( R 1 R 2 ) = { σ h σ R 1 R 2 } = { σ h σ R 1 h σ R 2 } = { σ h σ R 1 } { σ h σ R 2 } = h R 1 h R 2
Lemma 16
(Intersection and union preserve invariance). Let h : S Δ be a Σ-abstraction. Then, the intersection and union of any two h-invariant subsets R 1 and R 2 of variables assignments of type V dom ( S ) is h-invariant.
Proof. 
This follows from the algebraic characterization Lemma 12 for invariance, in combination with the algebraic properties of composition and decomposition given in Lemmas 7, 11, and 15. □
Lemma 17
(Concretization γ h commutes with projection). h π x ( R ) = π x ( h R ) .
Proof. 
For all σ : V dom ( Δ ) we have h π x ( σ ) = h σ | V \ { x } = ( h σ ) | V \ { x } = π x ( h σ ) . □
Proposition 6
(Invariance is preserved by conjunction, disjunction, and quantification). If h is a surjective abstraction, then the class of h-invariant FO-formulas is closed under conjunction, disjunction, and existential quantification.
Proof. 
Let h : S Δ be a Σ -abstraction.
Case of conjunction: Let ϕ 1 and ϕ 2 be h-invariant and V = fv ( ϕ 1 ϕ 2 ) . By Lemma 14 the sets s o l V S ( ϕ 1 ) and s o l V S ( ϕ 2 ) are both h-invariant, and so by Lemma 16 is their intersection. Hence:
h ( h s o l S ( ϕ 1 ϕ 2 ) ) = h ( h ( s o l V S ( ϕ 1 ) s o l V S ( ϕ 2 ) ) ) s o l V S ( ϕ 1 ) s o l V S ( ϕ 2 ) by h - invariance and Lemma   12 = s o l S ( ϕ 1 ϕ 2 )
By Lemma 12 in the other direction, this implies that ϕ 1 ϕ 2 is h-invariant.
Case of disjunction: Analogous to the case of conjunction.
Case of existential quantification:
h ( h s o l S ( x . ϕ 1 ) ) = h ( h π x ( s o l S ( ϕ 1 ) ) ) by Lemma   4 = h ( π x ( h s o l S ( ϕ 1 ) ) ) by Lemma   8 = π x ( h ( h s o l S ( ϕ 1 ) ) ) by Lemma   17 π x ( s o l S ( ϕ 1 ) ) by h - invariance of ϕ 1 and Lemma   12 = s o l S ( x . ϕ 1 ) by Lemma   4
By Lemma 12, this implies that x . ϕ 1 is h-invariant. □
We do not know whether negation preserves h-invariance in general, but for finite Δ it can be shown that if ϕ is h-exact and h-invariant, then ¬ ϕ is h-exact and h-invariant too.
Proposition 7.
Let h be a surjective Σ-abstraction. Then, the class of h-exact and h-invariant Σ-formulas is closed under conjunction, disjunction, and existential quantification.
Proof. 
Closure under conjunction follows from Propositions 5 and 6, closure under disjunction from Propositions 1 and 6, and closure under existential quantification by Propositions 2 and 6. □
Theorem 4
( h B -invariance and h B -exactness of polynomial equations). Any positive polynomial equation p = 0 such that p has no constant term is h B -exact and h B -invariant.
Proof. 
Consider a positive polynomial equation p = 0 such that p has no constant term and only positive coefficients. Thus, p has the form j = 1 l n j k = 1 i j x j , k m j , k = 0 where l 0 , and n j , i j , m j , k > 0 .
Claim 6.
For both algebras S { B , R + } : s o l S ( p = 0 ) = s o l S ( j = 1 l k = 1 i j x j , k = 0 ) .
The polynomial has a value of zero if and only if all its monomials do, that is: k = 1 i j x j , k m j k = 0 for all 1 j l . Since constant terms are ruled out, we have i j 0 . Furthermore, we assumed for all polynomials that m j , k 0 . So for all 1 j l there must exist 1 k i j such that x j , k = 0 .
Claim 7.
The equation x = 0 is h B -exact and h B -invariant.
This proof of this claim is straightforward from the definitions.
With these two claims, we are now in the position to prove the Theorem 4. Since the class of h B -exact and h B -invariant formulas is closed under conjunction and disjunction by Proposition 7, it follows from by Claim 7 that j = 1 l k = 1 i j x j , k = 0 is both h B -exact and h B -invariant. Since this formula is equivalent over R + to the polynomial equation by Claim 6, the h B -invariance carries over to p = 0 . The h B -exactness also carries over based on the equivalence for both structures R + and B :
h B s o l R + ( p = 0 ) = h B s o l V R + ( j = 1 l k = 1 i j x j , k = 0 ) by Claim   6 for R + = s o l B ( j = 1 l k = 1 i j x j , k = 0 ) by h B exactness = s o l B ( p = 0 ) by Claim   6 for B .

8. h B -Exact Rewriting of h B -Mixed Systems

In this section, we lift our main result to h B -mixed system, presenting a rewrite algorithm that makes any h B -mixed system h B -exact.
Definition 14.
A h B -mixed system is a formula in F Σ b o o l of the form z . ϕ ϕ where ϕ is a system of linear Σ b o o l -equations and ϕ a h B -invariant and h B -exact first-order formula.
Note that linear equation systems A y = 0 , with A an integer matrix and y a sequence of pairwise distinct variables, need not to be h B -exact, if A is not positive. However, as shown by the elementary mode rewriting Corollary 1 any linear equation systems is R + -equivalent to some quasipositive strongly-triangular linear system, that is h B -exact by Theorem 3.
Our next objective is to rewrite formulas to reduce the overapproximation coming with the abstract interpretation over the Booleans by John’s theorem. The idea is to make a linear equation system h B -exact that are used as subformulas as for instance of h B -mixed systems.
We recall from Corollary 1 that the elementary mode rewriting emr ( ϕ ) of a linear equation system is an h B -exact formula that is R + -equivalent to ϕ . We now introduce the boolean rewriting by lifting the elementary mode rewriting to a richer class of formulas. Given a vector z V , a linear equation system ϕ F Σ b o o l , and a formula ϕ F Σ b o o l , the boolean rewriting is defined by:
br ( z . ( ϕ ϕ ) ) = def z . ( emr ( ϕ ) ϕ )
The boolean rewriting may indeed reduce the overapproximation coming with abstract interpretation of formulas over the booleans, as show by the following proposition.
Proposition 8.
h B s o l R + ( ψ ) s o l B ( br ( ψ ) ) s o l B ( ψ ) .
Proof. 
Let ϕ be a linear equation system, z V , ϕ F Σ b o o l and ψ = def z . ϕ ϕ . Since ϕ is R + -equivalent to emr ( ϕ ) , it follows that br ( ψ ) is R + -equivalent to ψ . Hence, s o l R + ( ψ ) = s o l R + ( br ( ψ ) ) so that:
h B s o l R + ( ψ ) = h B s o l R + ( br ( ψ ) )
By John’s theorem, we have:
h B s o l R + ( br ( ψ ) ) s o l B ( br ( ψ ) )
Furthermore, by h B -exactness, R + -equivalence, and again John’s theorem, we have:
s o l B ( emr ( ϕ ) ) = h B s o l R + ( emr ( ϕ ) ) = h B s o l R + ( ϕ ) s o l B ( ϕ )
Therefore, it follows that:
s o l B ( br ( ψ ) ) s o l B ( ψ )
In combination this yields the inclusions of the proposition. □
Theorem 5
(Main). For any h B -mixed system ψ F Σ the boolean rewriting br ( ψ ) is h B -exact, R + -equivalent to ψ, and can be computed in at most exponential time.
Proof. 
Let ψ be a h B -mixed system x . ( ϕ ϕ ) . where ϕ is a linear equation system and ϕ a first-order formula that is h B -exact and h B -invariant. Based on the elementary modes rewriting Corollary 1, the linear equation system ϕ can be transformed in at most exponential time to the form emr ( ψ ) = z . ϕ where ϕ is a quasipositive strongly-triangular system of linear equations. Such polynomial equation systems are h B -exact by Theorem 3, and so is ϕ . The Invariance Proposition 5 shows that the conjunction ϕ ϕ is h B -exact too, since ϕ was assumed to be h B -exact and h B -invariant. The h B -exactness is preserved by existential quantification by Proposition 2, so the formula br ( ψ ) = x . emr ( ϕ ) ϕ is h B -exact too. □
Corollary 3.
The h B -abstraction of the R + -solution set of a h B -mixed system ϕ, that is h B s o l R + ( ϕ ) , can be computed in at most exponential time in the size of the system ϕ.
Proof. 
Given a h B -mixed system ϕ , we can apply Theorem 5 to compute in at most exponential time a R + -equivalent formula ϕ that is h B -exact. It is then sufficient to compute s o l B ( ϕ ) in exponential time in the size of ϕ . This can be done in the naive manner, that is by evaluating the formula ϕ —which may be of exponential size—over all possible boolean variable assignments, of which there may be exponentially many. For each assignment, the evaluation can be done in PSpace, and thus in exponential time. The overall time required is thus a product of two exponentials, which remains exponential. □
The algorithm from the proof Corollary 3 can be improved so that it becomes sufficiently efficient for practical use. For this the two steps with exponential worst case complexity must be made polynomial for the particular instances. Firstly, note that the computation of the elementary modes (Corollary 1) is known to be computationally feasible. Various algorithms for this purpose were implemented [16,24,25,26] and applied successfully to problems in systems biology [14]. The second exponential step concerns the enumeration of all boolean variable assignments. This enumeration may be avoided by using constraint programming techniques for computing the solution set s o l B ( ϕ ) . For those h B -mixed systems for which both steps can be done in polynomial time, we can compute the boolean abstraction of the R + -solution set in polynomial time too. The practical feasibility of this approach was demonstrated recently at an application to knockout prediction in systems biology [6], where previously only over-approximations could be computed.

9. Computing Sign Abstractions

We next show how to compute the sign abstraction h S s o l R ( ϕ ) for systems ϕ of linear Σ b o o l -equations. To apply h B -exact rewriting, we decompose the sign abstraction into the boolean abstraction and functions definable in first-order logic.

9.1. Decomposition

We can decompose any real number r R into a pair of two positive numbers d e c ( r ) R + 2 —negative and the positive part—as follows:
d e c ( r ) = def ( 0 , r ) if r 0 ( r , 0 ) if r 0
The image of this surjective function is { 0 } × R + ) ( R + × { 0 } , so it has an inverse dec 1 : ( { 0 } × R + ) ( R + × { 0 } ) R , which satisfies for all pairs ( r 1 , r 2 ) in the domain:
dec 1 ( r 1 , r 2 ) = r 2 R r 1
Furthermore, recall that h B 2 : R + 2 B 2 satisfies h B 2 ( r 1 , r 2 ) = ( h B ( r 1 ) , h B ( r 2 ) ) .
Lemma 18
(Decomposition). h S = d e c 1 h B 2 d e c
Proof. 
If r is negative then dec 1 ( h B 2 ( dec ( r ) ) ) = dec 1 ( h B 2 ( ( r , 0 ) ) ) = dec 1 ( ( h B ( r ) , 0 ) ) = h B ( r ) = h S ( r ) . Otherwise if r is positive then dec 1 ( h B 2 ( dec ( r ) ) ) = dec 1 ( h B 2 ( ( 0 , r ) ) ) = dec 1 ( ( 0 , h B ( r ) ) = h B ( r ) = h S ( r ) . □

9.2. Positivity

We show in a first step that first-order formulas over the reals can be rewritten, such that interpretation over the positive reals is enough.
We call a formula ϕ F Σ b o o l flat if all equations contained in ϕ have the form x = x 1 + x 2 , x = x 1 x 2 , x = 0 , or x = 1 for some variables x , x 1 , x 2 . Note that any formula ϕ F Σ b o o l can be converted to an equivalent flat formula in linear time by introducing fresh existentially quantified variables, so that we can assume flatness without loss of generality.
We fix two generators of fresh variable ν , ν : V V . For any x V , the intention is that ν ( x ) stands for the positive part of x and ν ( x ) for its negative part. We will preserve the invariants x = ν ( x ) ν ( x ) and ν ( x ) ν ( x ) = 0 . Furthermore, we define ν : V V 2 such that for all x V :
ν ( x ) = def ( ν ( x ) , ν ( x ) )
For any flat formula ϕ F Σ ( V ) we define a formula dec ν ( ϕ ) F Σ ( ν ( V ) ν ( V ) ) with the variables ν ( x ) and ν ( x ) instead of x for all x V . Otherwise the formula dec ˜ ν ( ϕ ) has the same meaning as over the reals than ϕ .
dec ˜ ν ( ϕ ) = dec ν ( ϕ ) x V ν ( x ) ν ( x ) = 0
where
dec ν ( x = x 1 + x 2 ) = dec ν ( x = x 1 x 2 ) = ν ( x ) + ν ( x 1 ) + ν ( x 2 ) = ν ( x ) + ν ( x 1 ) ν ( x 2 ) + ν ( x 1 ) ν ( x 2 ) = ν ( x ) + ν ( x 1 ) + ν ( x 2 ) ν ( x ) + ν ( x 1 ) ν ( x 2 ) + ν ( x 1 ) ν ( x 2 ) dec ν ( x = 0 ) = ν ( x ) = ν ( x ) dec ν ( x = 1 ) = ν ( x ) = ν ( x ) + 1 dec ν ( x . ϕ ) = ν ( x ) . ν ( x ) . dec ν ( ϕ ϕ ) = dec ν ( ϕ ) dec ν ( ϕ ) ν ( x ) ν ( x ) = 0 dec ν ( ϕ ) dec ν ( ¬ ϕ ) = ¬ dec ν ( ϕ )
Note that the definition in the case of addition, the definition relies on that subtraction R in the structure of reals is the inverse of addition + R . The expressions that are to be subtracted on one side of the equation are added to the other side instead. This is also used in the case of multiplication, in combination with the distributivity law for addition + R and multiplication R . Furthermore, dec ˜ ν ( ϕ ) belongs to F Σ b o o l ( ν ( V ) ν ( V ) ) and can be computed in linear time from ϕ .
Proposition 9
(Positivity). For any flat formula ϕ F Σ b o o l ( V ) :
d e c s o l V R ( ϕ ) = { σ 2 ν | V σ s o l R + ( d e c ˜ ν ( ϕ ) ) }
Proof. 
By induction on the structure of ϕ . In the first case of reals, can use that R is the inverse of + R and that the distributivity laws holds for + R and R . □
Lemma 19.
For any flat linear equation system ϕ, the formula d e c ˜ ν ( ϕ ) is a h B -mixed system.
Proof. 
If ϕ is a flat linear system, then dec ν ( ϕ ) is a linear system, so that dec ˜ ν ( ϕ ) is a h B -mixed system. □

9.3. Computing Sign Abstractions

We now have developed all the prerequisite for computing the sign abstraction of linear equation systems by using h B -exact boolean rewriting of h B -mixed systems.
Theorem 6.
For any linear equation system ϕ F Σ b o o l ( V ) , the formula br ( d e c ˜ ν ( ϕ ) ) can be computed in at most exponential time and satisfies:
h S s o l V R ( ϕ ) = { [ y / τ ( ν ( y ) ) R τ ( ν ( y ) ) y V ] τ s o l B ( br ( d e c ˜ ν ( ϕ ) ) ) }
Proof. 
Let ϕ F Σ b o o l ( V ) be a system of linear equations. Without loss of generality, we can assume that ϕ is flat. Let: ϕ ˜ = def d e c ˜ ν ( ϕ ) . The formula ϕ ˜ is a h B -mixed system by Lemma 19 with fv ( ϕ ˜ ) = ν ( V ) ν ( V ) so that we can apply the Main Theorem 5 to it. It shows that boolean rewriting br ( ϕ ˜ ) is an R + -equivalent formula in F Σ ( ν ( V ) ν ( V ) ) that is h B -exact and can be computed in at most exponential time. We can now conclude as follows:
h S s o l V R ( ϕ ) = dec 1 h B 2 dec s o l V R ( ϕ ) Decomposition Lemma   18 = dec 1 h B 2 { σ 2 ν | V σ s o l R + ( ϕ ˜ ) } Positivity Proposition   9 = dec 1 h B 2 { σ 2 ν | V σ s o l R + ( br ( ϕ ˜ ) } R + - equivalence of ϕ ˜ and br ( ϕ ˜ ) = { dec 1 τ 2 ν | V τ s o l B ( br ( ϕ ˜ ) ) } h B - exactness of br ( ϕ ˜ ) = { [ y / τ ( ν ( y ) ) R τ ( ν ( y ) ) y V ] definition of dec 1 τ s o l B ( br ( ϕ ˜ ) ) }
The sign abstraction of a system ϕ of Σ b o o l -equations with free variables in V = fv ( ϕ ) can thus be computed by first computing the h B -exact formula br ( ϕ ˜ ) F Σ ( ν ( V ) ν ( V ) ) from Theorem 6 by applying the Positivity Proposition 9 and the Main Theorem 5, then computing s o l B ( br ( ϕ ˜ ) ) by finite domain constraint programming, and finally inferring h S s o l R ( ϕ ) thereof based on the equation of Theorem 6.
Corollary 4.
The sign abstraction h S s o l V R ( ϕ ) can be computed in at most single exponential time in the size of ϕ.
Proof. 
The formula br ( ϕ ˜ ) is of exponential size but contains only twice as many variables than ϕ . Let n = | fv ( ϕ ) | . We can then compute h S s o l V R ( ϕ ) by testing 6 2 n variable assignments for membership to s o l R ( br ( ϕ ˜ ) ) . Each such test is linear in the size of br ( ϕ ˜ ) , and thus in O ( 2 m ) where m is the size of ϕ . So the overall time is in O ( 6 2 n 2 m ) and since n m in O ( 6 3 m ) . □
We finally show that the same algorithm as for computing the sign abstraction for linear equation systems can be lifted to a richer class of formulas to obtain another and possibly more precise overapproximation of the sign abstraction than John’s.
Proposition 10.
Let ψ = z . ϕ ϕ in F Σ b o o l ( V ) for some linear equation system ϕ and formula ϕ F Σ b o o l . The formula br ( d e c ˜ ν ( ψ ) ) then yields an overapproximation of the sign abstraction of ϕ:
h S s o l V R ( ψ ) { [ y / τ ( ν ( y ) ) R τ ( ν ( y ) ) y V ] τ s o l B ( br ( d e c ˜ ν ( ψ ) ) ) }
Proof. 
Along the lines of the proof of Theorem except that br ( d e c ˜ ν ( ψ ) ) is not h B -exact. Therefore, the equality where the h B -exactness was used must be weakened to an inclusion. □

10. Application to Program Analysis

We illustrate our results by applying the sign abstraction for program analysis based on abstract interpretation. We consider the Python implementation in Figure 6 of the function I : R 2 R . A call I ( a , s ) supposedly computes the approximation of the integral 0 a f ( x ) d x with step width s for some total function f : R R . Abstract interpretation allows us to find out the conditions that must hold on the input parameters for I ( ( a : f l o a t , s : f l o a t ) to work properly, and in particular to avoid exception throwing.
We can first interpret numeric programs abstractly as a formula of first-order logic with signature Σ a r i t h . We illustrate this in an ad hoc manner on the integral example I :
ϕ I = def ret f ret I result . ( a < 0 raise _ exception = 1 ) ( ( s > a do _ recursion = 0 result = 0 ) ( ¬ ( s > a ) do _ recursion = 1 a rec = a s s rec = s result = s · ret f + ret I ) )
The variables a and s are the formal parameters in the definition of I ( a : f l o a t , s : f l o a t ) . The others are fresh variables introduced to handle exceptions or function calls: the boolean flag raise _ exception represents exception throwing, the boolean flag do _ recursion has a true value only when a recursive call is made to I with actual parameters represented by the variables a r e c , s r e c and return value represented by ret I , while ret f is the variable for the return value of the call to the function f . The final return value of I is represented by the variable result . In what follows, we are not interested in the signs of the last three variables, so we quantify them existentially.
The sign behavior of function I is given by the formula’s sign abstraction h S s o l R ( ϕ I ) . Given that ϕ I is not h B -mixed system, we cannot apply the algorithm from Theorem 6 directly to compute this sign abstraction. Nevertheless, it will be beneficial as we will illustrate below.
By John’s theorem, the sign abstraction h S s o l R ( ϕ I ) can be overapproximated by the abstract interpretation s o l S ( ϕ I ) . Since S is a finite structure, this abstract interpretation can be computed by finite domain constraint programming. For this, we implemented a solver for first-order formulas over the structure S with Minizinc [17]. When applied to ϕ I it returns the set of abstract solutions s o l S ( ϕ I ) given in Table 1. This set contains the 6 unjustified abstract solutions 2 , 4 , 10 , 13 , 15 , 18 outside h S s o l R ( ϕ I ) . In the table they are distinguished by gray background color. We also note that the last three solutions 17 , 18 , 19 could be ruled out when using a more precise abstract program interpretation, taking into account that no recursive call is possible when an exception is thrown.
The sets of abstract solutions provide information on possible sign of values of the parameters in a call I ( a : f l o a t , s : f l o a t ) . For example, solution 1 in Table 1 states that when called with values of signs [ a / 0 , s / 1 ] the function I will not raise an exceptions nor make a recursive call. Solution 8 states that when called with values of signs [ a / 1 , s / 1 ] function I may go into recursion with signs [ a r e c / 0 , s r e c / 1 ] without raising an exception.
Any set of abstract solutions defines an abstract call graph. The abstract call graphs of s o l S ( ϕ I ) and h S s o l R ( ϕ I ) from Table 1 are given in Figure 7. Solution 1 in Table 1 implies a solid edge from the node I S ( 1 , 1 ) to the node I S ( 0 , 1 ) . The edge is solid since solution 1 is justified. Edges induced by unjustified solutions are dashed. The unjustified solution 10 for instance induces the dashed edge from I S ( 1 , 1 ) to I S ( 1 , 1 ) . Solutions with do _ recursion = 0 and raise _ exception = 0 do not induce any edge. Instead, they show that the computation may stop, producing final nodes that are surrounded by a double circle. The final nodes are I S ( 1 , 1 ) and I S ( 0 , 1 ) . Note that for all nonfinal nodes, either an exception is raised or the computation loops endlessly. Solutions with raise _ exception = 1 induce an edge to the except node.
Given that only 2 unjustified solutions with do _ recursion = 0 and raise _ exception = 0 (10 and 18), there are only 2 dashed edges in the graph. Furthermore, the edges induced by the last three solutions 17, 18, 19 are drawn in blue, since these could be removed with a more precise abstract program interpretation than ϕ I .
The sign analysis without the unjustified dashed edges yields the following result: the program in state I S ( 1 , 1 ) , where a > 0 and s > 0 may either terminate, loop indefinitely, or go to state I S ( 0 , 1 ) and terminate there immediately. With the unjustified dashed edges, however, it wrongly seems possible that the program may also raise an exception by passing through I S ( 1 , 1 ) . This overapproximation would be particularly unfortunate since state I S ( 1 , 1 ) is the only useful state to call I .
We next show how to remove the unjustified solutions by applying the overapproxmation algorithm for the sign abstraction from Proposition 10, that lifts the algorithm for exact sign abstraction from Theorem 6 to a richer class of formulas. The idea is to split the formula ϕ I into its linear part and the rest. Before doing so, we preprocess the inequation s > a : We introduce a fresh variable signvar , add the equation s a = signvar , and rewrite s > a to signvar > 0 . The linear part of ϕ I then becomes:
s a = signvar a rec = a s s rec = s
We can then rewrite the linear part into the signature Σ b o o l by moving the negative parts positively onto the other side. This yields the following linear equation system:
s = signvar + a a rec + s = a s rec = s
The remainder of ϕ I can be rewritten as follows:
( ( a < 0 raise _ exception > 0 ) ( a 0 raise _ exception = 0 ) ) ( ( signvar > 0 do _ recursion = 0 result = 0 ) ( signvar 0 do _ recursion > 0 result = s ret f + ret I ) )
It is not clear whether the conjunction of both parts is a h B -mixed system, since it is not clear how to show the h B -invariance of the equation result = s ret f + ret I . Still, we can apply the overapproximation algorithm of the sign abstraction from Proposition 10. It indeed improves on John’s approximation, ruling out both unjustified solutions. The details are worked out in Appendix A.
In the general case, linear equation systems are not enough, in which case our algorithm from Theorem 6 for computing sign abstractions cannot be applied. But then we can still apply the overapproximation algorithm from Proposition 10 which rewrites a linear part of the formula exactly. As illustrated by the present example, this overapproximation is often way more precise than John’s.

11. Example for the Overapproximation of the Sign Abstraction

We reconsider conjunction of the linear part obtained and the rest of ϕ I , that is ϕ I l i n ϕ I r e s t where:
ϕ I l i n = def s = signvar + a a rec + s = a s rec = s
ϕ I r e s t = def ( ( a < 0 raise _ exception > 0 ) ( a 0 raise _ exception = 0 ) ) ( ( signvar > 0 do _ recursion = 0 result = 0 ) ( signvar 0 do _ recursion > 0 result = s ret f + ret I ) )
The decomposition of the linear subsystem d e c ν ( ϕ I l i n ) for interpretation over B as defined in Section 9 is obtained by splitting each variable x into two fresh variables ν ( x ) and ν ( x ) representing its positive and negative part:
d e c ν ( ϕ I l i n ) = ν ( s ) + ν ( a ) + ν ( signvar ) = ν ( s ) + ν ( a ) + ν ( signvar ) ν ( a rec ) + ν ( a ) + ν ( s ) = ν ( a rec ) + ν ( a ) + ν ( s ) ν ( s rec ) + ν ( s ) = ν ( s rec ) + ν ( s )
The additional constraints on the decomposition variables are:
ν ( s ) ν ( s ) = 0 ν ( a ) ν ( a ) = 0 ν ( signvar ) ν ( signvar ) = 0 ν ( a rec ) ν ( a rec ) = 0 ν ( s rec ) ν ( s rec ) = 0 ν ( result ) ν ( result ) = 0 ν ( ret I ) ν ( ret I ) = 0 ν ( ret f ) ν ( ret f ) = 0
The elementary mode rewriting emr ( d e c ν ( ϕ I l i n ) ) is the following R + -equivalent h B -exact Σ b o o l -formula obtained via Corollary 1:
x 0 x 10 . ν ( a ) = x 10 + x 8 + x 9 ν ( a ) = x 10 + x 6 + x 7 ν ( a rec ) = x 4 + x 5 + x 9 ν ( a rec ) = x 3 + x 5 + x 7 ν ( signvar ) = x 2 + x 3 + x 7 ν ( signvar ) = x 2 + x 4 + x 9 ν ( s ) = x 1 + x 3 + x 8 ν ( s ) = x 1 + x 4 + x 6 ν ( s rec ) = x 0 + x 3 + x 8 ν ( s rec ) = x 0 + x 4 + x 6
The nonlinear remainder also needs to be rewritten with the decomposition variables for interpretation over B . The formula below is d e c ν ( ϕ I l i n ) except that we simplified the rewriting of inequations a bit.
( ( ¬ ν ( a ) = 0 ¬ ν ( raise _ exception ) = 0 ) ( ν ( a ) = 0 ν ( raise _ exception ) = 0 ν ( raise _ exception ) = 0 ) ) ( ( ¬ ν ( signvar ) = 0 ν ( do _ recursion ) = 0 ν ( do _ recursion ) = 0 ν ( result ) = 0 ν ( result ) = 0 ) ( ν ( signvar ) = 0 ¬ ν ( do _ recursion ) = 0 ν ( result ) + ν ( s ) ν ( ret f ) + ν ( s ) ν ( ret f ) + ν ( ret I ) ) = ν ( result ) + ν ( s ) ν ( ret f ) + ν ( s ) ν ( ret f ) + ν ( ret I ) ) )
For any solution τ of the conjunction of the above three blocks of formulas over the algebra of booleans B , we then obtain an assignment σ h S s o l R ( ϕ I ) according to Theorem 6:
σ ( s ) = τ ( ν ( s ) ) R τ ( ν ( s ) ) σ ( a ) = τ ( ν ( a ) ) R τ ( ν ( a ) ) σ ( signvar ) = τ ( ν ( signvar ) ) R τ ( ν ( signvar ) ) σ ( a rec ) = τ ( ν ( a rec ) ) R τ ( ν ( a rec ) ) σ ( s rec ) = τ ( ν ( s rec ) ) R τ ( ν ( s rec ) ) σ ( result ) = τ ( ν ( result ) ) R τ ( ν ( result ) ) σ ( ret f ) = τ ( ν ( ret f ) ) R τ ( ν ( ret f ) ) σ ( ret I ) = τ ( ν ( ret I ) ) R τ ( ν ( ret I ) )

12. Conclusions and Future Work

We showed that any h B -mixed system can be rewritten into an h B -exact formula by computing the elementary modes of the linear subsystem. In previous work, h B -exact rewriting h B -mixed systems was applied to compute difference abstractions exactly. In the present paper, we showed that h B -exact rewriting can also be used to compute sign-abstractions exactly.
We have illustrated the usefulness of the computation of sign abstraction for linear formulas for the sign analysis of function programs. Using John’s overapproximation is often not good enough for such applications, since the relationships between the signs of different variables are quickly lost. We saw that elementary mode rewriting yields better a better approximation of the sign abstraction even for nonlinear equation systems, which may preserve these relationships.
The time for computing abstractions exactly strongly depends on the time needed to compute the elementary modes. Some experiments were reported in [6] in the case of the difference abstraction. There, one has to compute the elementary modes for a linear equation system that contains two copies of the linear equation system given with the input. The copying doubles the size and may increase the time for the computation of the elementary modes seriously. In the application of difference abstraction to change prediction of reaction networks, we observed cases where John’s overapproximation of the difference abstraction could be computed in circa 10 min, while the exact computation required circa 10 h.
In the future, it would we of interest to find heuristics for approximating abstractions of linear equation systems that reduce the computation time of the exact algorithm while improving John’s overapproximation in precision. In the case of difference abstractions, the minimal support heuristics was proposed for this purpose [6]. In the example mentioned above, this heuristics could be computed in circa 10 min, like John’s overapproximation, while yielding the exact result. In general, however, the minimal support heuristics is not exact.
Another interesting question for future work is how to compute more quantitative abstractions exactly, as for instance with intervals. In this case however the structure of abstract values is infinite, therefore finite domain constraint programming is no longer sufficient to compute the set of abstract solutions.

Author Contributions

These authors contributed equally to this work. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

Data sharing not applicable.

Acknowledgments

We would like to acknowledge the reviewers for the constructive feedback.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

The system of linear Σ b o o l -equations dec ν ( ϕ I l i n ) corresponds to the following linear integer matrix equation:
1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 1 1 1 ν ( a ) ν ( a ) ν ( a rec ) ν ( a rec ) ν ( signvar ) ν ( signvar ) ν ( s ) ν ( s ) ν ( s rec ) ν ( s rec ) = 0 0 0 0 0 0 0 0 0 0
The elementary mode rewriting emr ( d e c ν ( ϕ I l i n ) ) corresponds to the linear integer matrix equation:
0 0 1 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 1 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0 1 0 0 1 0 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 0 x 0 x 1 x 10 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 = ν ( a ) ν ( a ) ν ( a rec ) ν ( a rec ) ν ( signvar ) ν ( signvar ) ν ( s ) ν ( s ) ν ( s rec ) ν ( s rec )

References

  1. Cousot, P.; Cousot, R. Systematic Design of Program Analysis Frameworks. In Proceedings of the Sixth Annual ACM Symposium on Principles of Programming Languages, San Antonio, TX, USA, 29–31 January 1979; pp. 269–282. [Google Scholar] [CrossRef]
  2. Paulevé, L.; Sené, S. Non-Deterministic Updates of Boolean Networks. In Proceedings of the 27th IFIP WG 1.5 International Workshop on Cellular Automata and Discrete Complex Systems (AUTOMATA 2021), Marseille, France, 12–14 July 2021; pp. 10:1–10:16. [Google Scholar] [CrossRef]
  3. Paulevé, L. Most Permissive Reaction Networks. Available online: https://loicpauleve.name/md/ak8WJ5d2TqKpmJBtP_8BaQ# (accessed on 2 September 2021).
  4. Cousot, P.; Halbwachs, N. Automatic Discovery of Linear Restraints Among Variables of a Program. In Proceedings of the Fifth Annual ACM Symposium on Principles of Programming Languages, Tucson, AZ, USA, 23–25 January 1978; pp. 84–96. [Google Scholar] [CrossRef] [Green Version]
  5. Granger, P. Static Analysis of Linear Congruence Equalities among Variables of a Program. In Colloquium on Trees in Algebra and Programming, Proceedings of the International Joint Conference on Theory and Practice of Software Development (TAPSOFT’91), Brighton, UK, 8–12 April 1991; Abramsky, S., Maibaum, T.S.E., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 1991; Volume 493, pp. 169–192. [Google Scholar] [CrossRef] [Green Version]
  6. Allart, E.; Niehren, J.; Versari, C. Computing Difference Abstractions of Linear Equation Systems. Theor. Comput. Sci. 2021. [Google Scholar] [CrossRef]
  7. Allart, E.; Versari, C.; Niehren, J. Computing Difference Abstractions of Metabolic Networks Under Kinetic Constraints. In Computational Methods in Systems Biology, Proceedings of the 17th International Conference on Computational Methods in Systems Biology (CMSB 2019), Trieste, Italy, 18–20 September 2019; Bortolussi, L., Sanguinetti, G., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2019; Volume 11773, pp. 266–285. [Google Scholar] [CrossRef] [Green Version]
  8. Niehren, J.; Versari, C.; John, M.; Coutte, F.; Jacques, P. Predicting changes of reaction networks with partial kinetic information. Biosyst. 2016, 149, 113–124. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  9. John, M.; Nebut, M.; Niehren, J. Knockout Prediction for Reaction Networks with Partial Kinetic Information. In Verification, Model Checking, and Abstract Interpretation, Proceedings of the 14th International Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI 2013), Rome, Italy, 20–22 January 2013; Giacobazzi, R., Berdine, J., Mastroeni, I., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2013; Volume 7737, pp. 355–374. [Google Scholar] [CrossRef] [Green Version]
  10. Giacobazzi, R.; Ranzato, F.; Scozzari, F. Making abstract interpretations complete. J. ACM 2000, 47, 361–416. [Google Scholar] [CrossRef]
  11. Nethercote, N.; Stuckey, P.J.; Becket, R.; Brand, S.; Duck, G.J.; Tack, G. MiniZinc: Towards a Standard CP Modelling Language. In Principles and Practice of Constraint Programming—CP 2007, Proceedings of the 13th International Conference on Principles and Practice of Constraint Programming (CP 2007), Providence, RI, USA, 23–27 September 2007; Bessiere, C., Ed.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2007; Volume 4741, pp. 529–543. [Google Scholar] [CrossRef]
  12. Motzkin, T.; Raiffa, H.; Thompson, G.; Thrall, R. The double description method. In Contributions to the Theory of Games; Kuhn, H.W., Tucker, A.W., Eds.; Princeton University Press: Princeton, NJ, USA, 1953; Volume 2, pp. 51–74. [Google Scholar]
  13. Fukuda, K.; Prodon, A. Double Description Method Revisited. In Combinatorics and Computer Science, Proceedings of the 8th Franco-Japanese and 4th Franco-Chinese Conference, Brest, France, 3–5 July 1995; Deza, M., Euler, R., Manoussakis, Y., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 1995; Volume 1120, pp. 91–111. [Google Scholar] [CrossRef]
  14. Gagneur, J.; Klamt, S. Computation of elementary modes: A unifying framework and the new binary approach. BMC Bioinform. 2004, 5, 175. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  15. Zanghellini, D.; Ruckerbauer, D.E.; Hanscho, M.; Jungreuthmayer, C. Elementary flux modes in a nutshell: Properties, calculation and applications. Biotechn. J. 2013, 8, 1009–1016. [Google Scholar] [CrossRef] [PubMed]
  16. Bagnara, R.; Hill, P.M.; Zaffanella, E. The Parma Polyhedra Library: Toward a complete set of numerical abstractions for the analysis and verification of hardware and software systems. Sci. Comput. Program. 2008, 72, 3–21. [Google Scholar] [CrossRef] [Green Version]
  17. Rendl, A.; Guns, T.; Stuckey, P.J.; Tack, G. MiniSearch: A Solver-Independent Meta-Search Language for MiniZinc. In Principles and Practice of Constraint Programming, Proceedings of the 21st International Conference on Principles and Practice of Constraint Programming (CP 2015), Cork, Ireland, 31 August–4 September 2015; Pesant, G., Ed.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2015; Volume 9255, pp. 376–392. [Google Scholar] [CrossRef]
  18. Allart, E.; Niehren, J.; Versari, C. Reaction Networks to Boolean Networks. Available online: https://hal.archives-ouvertes.fr/hal-02279942 (accessed on 2 September 2021).
  19. Dines, L.L. On Positive Solutions of a System of Linear Equations. Ann. Math. 1926, 28, 386–392. [Google Scholar] [CrossRef]
  20. Miné, A. A Few Graph-Based Relational Numerical Abstract Domains. In Static Analysis, Proceedings of the 9th International Static Analysis Symposium (SAS 2002), Madrid, Spain, 17–20 September 2002; Hermenegildo, M.V., Puebla, G., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2002; Volume 2477, pp. 117–132. [Google Scholar] [CrossRef] [Green Version]
  21. Cousot, P.; Cousot, R. Static determination of dynamic properties of programs. In Proceedings of the Second International Symposium on Programming, Paris, France, 13–15 April 1976; pp. 106–130. [Google Scholar]
  22. Granger, P. Static analysis of arithmetical congruences. Int. J. Comput. Math. 1989, 30, 165–190. [Google Scholar] [CrossRef]
  23. Karr, M. Affine relationships among variables of a program. Acta Inf. 1976, 6, 133–151. [Google Scholar] [CrossRef]
  24. Fukuda, K. cddlib—An efficient implementation of the Double Description Method. 2018. Available online: https://github.com/cddlib/cddlib (accessed on 2 September 2021).
  25. Klamt, S.; Stelling, J.; Ginkel, M.; Gilles, E.D. FluxAnalyzer: Exploring structure, pathways, and flux distributions in metabolic networks on interactive flux maps. Bioinformatics 2003, 19, 261–269. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  26. Avis, D.; Jordan, C. mplrs: A scalable parallel vertex/facet enumeration code. Math. Program. Comput. 2018, 10, 267–302. [Google Scholar] [CrossRef] [Green Version]
Figure 1. Evaluation in the Σ a r i t h -structure of signs S .
Figure 1. Evaluation in the Σ a r i t h -structure of signs S .
Computation 09 00113 g001
Figure 2. Set-valued interpretation of expressions e σ , S dom ( S ) .
Figure 2. Set-valued interpretation of expressions e σ , S dom ( S ) .
Computation 09 00113 g002
Figure 3. Interpretation of formulas ϕ F Σ ( V ) as truth values ϕ σ , S B over a Σ -structure S given a variable assignment σ : V dom ( S ) .
Figure 3. Interpretation of formulas ϕ F Σ ( V ) as truth values ϕ σ , S B over a Σ -structure S given a variable assignment σ : V dom ( S ) .
Computation 09 00113 g003
Figure 4. A linear equation system and the corresponding integer matrix equation.
Figure 4. A linear equation system and the corresponding integer matrix equation.
Computation 09 00113 g004
Figure 5. The elementary mode rewriting and the corresponding matrix equation.
Figure 5. The elementary mode rewriting and the corresponding matrix equation.
Computation 09 00113 g005
Figure 6. Python function approximating the integral 0 a f ( x ) d x for a given function f : R R .
Figure 6. Python function approximating the integral 0 a f ( x ) d x for a given function f : R R .
Computation 09 00113 g006
Figure 7. Sign call graph of function I in Figure 6 created from the sets of abstract solutions in Table 1. Solid lines correspond to abstract solutions in h S s o l R ( ϕ I ) , while dashed lines correspond to unjustified abstract solutions in s o l S ( ϕ I ) . For example, I S ( 1 , 1 ) represents assignment [ a / 1 , s / 1 ] , that is signs of a and s in calls I ( a : f l o a t , s : f l o a t ) where a > 0 and s < 0 . Light blue edges may be removed by improving ϕ I so that solutions 17, 18, 19 become impossible. Computation may terminate without raising an exception in nodes surrounded by a double circle.
Figure 7. Sign call graph of function I in Figure 6 created from the sets of abstract solutions in Table 1. Solid lines correspond to abstract solutions in h S s o l R ( ϕ I ) , while dashed lines correspond to unjustified abstract solutions in s o l S ( ϕ I ) . For example, I S ( 1 , 1 ) represents assignment [ a / 1 , s / 1 ] , that is signs of a and s in calls I ( a : f l o a t , s : f l o a t ) where a > 0 and s < 0 . Light blue edges may be removed by improving ϕ I so that solutions 17, 18, 19 become impossible. Computation may terminate without raising an exception in nodes surrounded by a double circle.
Computation 09 00113 g007
Table 1. Set of abstract solutions in s o l S ( ϕ I ) . Six solutions with gray background color are unjustified since outside h S s o l R ( ϕ I ) .
Table 1. Set of abstract solutions in s o l S ( ϕ I ) . Six solutions with gray background color are unjustified since outside h S s o l R ( ϕ I ) .
# raise _ exception do _ recursion a s a rec s rec
1.0001−11
2.001101
3.0011−11
4.001111
5.010000
6.011010
7.010−11−1
8.011101
9.011−11−1
10.0111−11
11.011111
12.10−10−10
13.10−1−10−1
14.10−1−1−1−1
15.10−1−11−1
16.10−11−11
17.11−1−10−1
18.11−1−1−1−1
19.11−1−11−1
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Allart, E.; Niehren, J.; Versari, C. Exact Boolean Abstraction of Linear Equation Systems. Computation 2021, 9, 113. https://0-doi-org.brum.beds.ac.uk/10.3390/computation9110113

AMA Style

Allart E, Niehren J, Versari C. Exact Boolean Abstraction of Linear Equation Systems. Computation. 2021; 9(11):113. https://0-doi-org.brum.beds.ac.uk/10.3390/computation9110113

Chicago/Turabian Style

Allart, Emilie, Joachim Niehren, and Cristian Versari. 2021. "Exact Boolean Abstraction of Linear Equation Systems" Computation 9, no. 11: 113. https://0-doi-org.brum.beds.ac.uk/10.3390/computation9110113

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop