Truth Table Invariant Cylindrical Algebraic Decomposition

Truth Table Invariant
Cylindrical Algebraic Decomposition

Russell Bradford James H. Davenport Matthew England Scott McCallum David Wilson Department of Computer Science, University of Bath, Bath, BA2 7AY, UK School of Computing, Electronics and Maths, Faculty of Engineering, Environment and Computing, Coventry University, Coventry, CV1 5FB, UK Department of Computing, Macquarie University, NSW 2109, Australia

When using cylindrical algebraic decomposition (CAD) to solve a problem with respect to a set of polynomials, it is likely not the signs of those polynomials that are of paramount importance but rather the truth values of certain quantifier free formulae involving them. This observation motivates our article and definition of a Truth Table Invariant CAD (TTICAD).

In ISSAC 2013 the current authors presented an algorithm that can efficiently and directly construct a TTICAD for a list of formulae in which each has an equational constraint. This was achieved by generalising McCallum’s theory of reduced projection operators. In this paper we present an extended version of our theory which can be applied to an arbitrary list of formulae, achieving savings if at least one has an equational constraint. We also explain how the theory of reduced projection operators can allow for further improvements to the lifting phase of CAD algorithms, even in the context of a single equational constraint.

The algorithm is implemented fully in Maple and we present both promising results from experimentation and a complexity analysis showing the benefits of our contributions.

cylindrical algebraic decomposition, equational constraint
[2010] 68W30, 03C10
journal: Journal of Symbolic Computationthanks: This work was supported by EPSRC grant EP/J003247/1.

, , , and

1 Introduction

A cylindrical algebraic decomposition (CAD) is a decomposition of into cells arranged cylindrically (meaning the projections of any pair of cells are either equal or disjoint) each of which is (semi-)algebraic (describable using polynomial relations). CAD is a key tool in real algebraic geometry, offering a method for quantifier elimination in real closed fields. Applications include the derivation of optimal numerical schemes (Erascu and Hong, 2014), parametric optimisation (Fotiou et al., 2005), robot motion planning (Schwartz and Sharir, 1983), epidemic modelling (Brown et al., 2006), theorem proving (Paulson, 2012) and programming with complex functions (Davenport et al., 2012).

Traditionally CADs are produced sign-invariant to a given set of polynomials, (the signs of the polynomials do not vary within each cell). However, this gives far more information than required for most applications. Usually a more appropriate object is a truth-invariant CAD (the truth of a logical formula does not vary within cells).

In this paper we generalise to define truth table invariant CADs (the truth values of a list of quantifier-free formulae do not vary within cells) and give an algorithm to compute these directly. This can be a tool to efficiently produce a truth-invariant CAD for a parent formula (built from the input list), or indeed the required object for solving a problem involving the input list. Examples of both such uses are provided following the formal definition in Section 1.2. We continue the introduction with some background on CAD, before defining our object of study and introducing some examples to demonstrate our ideas which we will return to throughout the paper. We then conclude the introduction by clarifying the contributions and plan of this paper.

1.1 Background on CAD

A Tarski formula is a Boolean combination () of statements about the signs, (, but therefore as well), of certain polynomials with integer coefficients. Such statements may involve the universal or existential quantifiers (). We denote by QFF a quantifier-free Tarski formula.

Given a quantified Tarski formula


(where and is a QFF) the quantifier elimination problem is to produce , an equivalent QFF to (1).

Collins developed CAD as a tool for quantifier elimination over the reals. He proposed to decompose cylindrically such that each cell was sign-invariant for all polynomials used to define . Then would be the disjunction of the defining formulae of those cells in such that (1) was true over the whole of , which due to sign-invariance is the same as saying that (1) is true at any one sample point of .

A complete description of Collins’ original algorithm is given by Arnon et al. (1984a). The first phase, projection, applies a projection operator repeatedly to a set of polynomials, each time producing another set in one fewer variables. Together these sets contain the projection polynomials. These are used in the second phase, lifting, to build the CAD incrementally. First is decomposed into cells which are points and intervals corresponding to the real roots of the univariate polynomials. Then is decomposed by repeating the process over each cell in using the bivariate polynomials at a sample point. Over each cell there are sections (where a polynomial vanishes) and sectors (the regions between) which together form a stack. Taking the union of these stacks gives the CAD of . This is repeated until a CAD of is produced. At each stage the cells are represented by (at least) a sample point and an index: a list of integers corresponding to the ordered roots of the projection polynomials which locates the cell in the CAD.

To conclude that a CAD produced in this way is sign-invariant we need delineability. A polynomial is delineable in a cell if the portion of its zero set in the cell consists of disjoint sections. A set of polynomials are delineable in a cell if each is delineable and the sections of different polynomials in the cell are either identical or disjoint. The projection operator used must be defined so that over each cell of a sign-invariant CAD for projection polynomials in variables (the word over meaning we are now talking about an -dim space) the polynomials in variables are delineable.

The output of this and subsequent CAD algorithms (including the one presented in this paper) depends heavily on the variable ordering. We usually work with polynomials in with the variables, , in ascending order (so we first project with respect to and continue to reach univariate polynomials in ). The main variable of a polynomial () is the greatest variable present with respect to the ordering.

CAD has doubly exponential complexity in the number of variables (Brown and Davenport, 2007; Davenport and Heintz, 1988). There now exist algorithms with better complexity for some CAD applications (see for example Basu et al. (1996)) but CAD implementations often remain the best general purpose approach. There have been many developments to the theory since Collin’s treatment, including the following:

  • Improvements to the projection operator (Hong, 1990; McCallum, 1988, 1998; Brown, 2001; Han et al., 2014), reducing the number of projection polynomials computed.

  • Algorithms to identify the adjacency of cells in a CAD (Arnon et al., 1984b, 1988) and following from this the idea of clustering (Arnon, 1988) to minimise the lifting.

  • Partial CAD, introduced by Collins and Hong (1991), where the structure of is used to lift less of the decomposition of to , if it is sufficient to deduce .

  • The theory of equational constraints, (McCallum, 1999, 2001; Brown and McCallum, 2005), also aiming to deduce itself, this time using more efficient projections.

  • The use of certified numerics in the lifting phase to minimise the amount of symbolic computation required (Strzeboński, 2006; Iwane et al., 2009).

  • New approaches which break with the normal projection and lifting model: local projection (Strzeboński, 2014), the building of single CAD cells (Brown, 2013; Jovanovic and de Moura, 2012) and CAD via Triangular Decomposition (Chen et al., 2009b). The latter is now used for the CAD command built into Maple, and works by first creating a cylindrical decomposition of complex space.

1.2 Tticad

Brown (1998) defined a truth-invariant CAD as one for which a formula had invariant truth value on each cell. Given a QFF, a sign-invariant CAD for the defining polynomials is trivially truth-invariant. Brown considered the refinement of sign-invariant CADs whilst maintaining truth-invariance, while some of the developments listed above can be viewed as methods to produce truth-invariant CADs directly. We define a new but related type of CAD, the topic of this paper.

Definition 1.

Let refer to a list of QFFs. We say a cylindrical algebraic decomposition is a Truth Table Invariant CAD for the QFFs (TTICAD) if the Boolean value of each is constant (either true or false) on each cell of .

A sign-invariant CAD for all polynomials occurring in a list of formulae would clearly be a TTICAD for the list. However, we aim to produce smaller TTICADs for many such lists. We will achieve this by utilising the presence of equational constraints, a technique first suggested by Collins (1998) with key theory developed by McCallum (1999).

Definition 2.

Suppose some quantified formula is given:

where the are quantifiers and is quantifier free. An equation is an equational constraint (EC) of if is logically implied by (the quantifier-free part of ). Such a constraint may be either explicit (an atom of the formula) or otherwise implicit.

In Sections 3 and 4 we will describe how TTICADs can be produced efficiently when there are ECs present in the list of formulae. There are two reasons to use this theory.

  1. As a tool to build a truth-invariant CAD efficiently: If a parent formula is built from the formulae then any TTICAD for is also truth-invariant for .

    We note that for such a formula a TTICAD may need to contain more cells than a truth-invariant CAD. For example, consider a cell in a truth-invariant CAD for within which is always true. If changed truth value in such a cell then it would need to be split in order to achieve a TTICAD, but this is unnecessary for a truth-invariant CAD of .

    Nevertheless, we find that our TTICAD theory is often able to produce smaller truth-invariant CADs than any other available approach. We demonstrate the savings offered via worked examples introduced in the next subsection.

  2. When given a problem for which truth table invariance is required: That is, a problem for which the list of formulae are not derived from a larger parent formula and thus a truth-invariant CAD for their disjunction may not suffice.

    For example, decomposing complex space according to a set of branch cuts for the purpose of algebraic simplification (Bradford and Davenport, 2002; Phisanbut et al., 2010). Here the idea is to represent each branch cut as a semi-algebraic set to give input admissible to CAD, (recent progress on this has been described by England et al. (2013)). Then a TTICAD for the list of formulae these sets define provides the necessary decomposition. Example 33 is from this class.

1.3 Worked examples

To demonstrate our ideas we will provide details for two worked examples. Assume we have the variable ordering (meaning 1-dimensional CADs are with respect to ) and consider the following polynomials, graphed in Figure 1.

Suppose we wish to find the regions of where the following formula is true:


Both Qepcad (Brown, 2003) and Maple 16 (Chen et al., 2009b) produce a sign-invariant CAD for the polynomials with 317 cells. Then by testing the sample point from each region we can systematically identify where the formula is true.

Figure 1: The polynomials from the worked examples of Section 1.3. The solid curves are and while the dashed curves are and .

At first glance it seems that the theory of ECs is not applicable to as neither nor is logically implied by . However, while there is no explicit EC we can observe that is an implicit constraint of . Using Qepcad with this declared (an implementation of (McCallum, 1999)) gives a CAD with 249 cells. Later, in Section 3.3 we demonstrate how a TTICAD with 105 cells can be produced.

We also consider the related problem of identifying where


is true. As above, we could use a sign-invariant CAD with 317 cells, but this time there is no implicit EC. In Section 3.3 we produce a TTICAD with 183 cells.

1.4 Contributions and plan of the paper

We review the projection operators of McCallum (1998, 1999) in Section 2. The former produces sign-invariant CADs111Actually order-invariant CADs (see Definition 3).and the latter CADs truth-invariant for a formula with an EC. The review is necessary since we use some of this theory to verify our new algorithm. It also allows us to compare our new contribution to these existing approaches. For this purpose we provide new complexity analyses of these existing theories in Section 2.3.

Sections 3 and 4 present our new TTICAD projection operator and verified algorithm. They follow Sections 2 and 3 of our ISSAC 2013 paper (Bradford et al., 2013a), but instead of requiring all QFFs to have an EC the theory here is applicable to all QFFs (producing savings so long as one has an EC). The strengthening of the theory means that a TTICAD can now be produced for in Section 1.3 as well as . This extension is important since it means TTICAD theory now applied to cases where there can be no overall implicit EC for a parent formula. In these cases the existing theory of ECs is not applicable and so the comparative benefits offered by TTICAD are even higher.

In Section 5 we discuss how the theory of reduced projection operators also allows for improvements in the lifting phase. This is true for the existing theory also but the discovery was only made during the development of TTICAD. In Section 6 we present a complexity analysis of our new contributions from Sections 3 5, demonstrating their benefit over the existing theory from Section 2. We have implemented the new ideas in a Maple package, discussed in Section 7. In particular, Section 7.3 summarises (Bradford et al., 2013b) on the choices required when using TTICAD and heuristics to help. Experimental results for our implementation (extending those in our ISSAC 2013 paper) are given in Section 8, before we finish in Section 9 with conclusions and future work.

Data access statement: Data directly supporing this paper (code, Maple and Qepcad input) is openly available from

2 Existing CAD projection operators

2.1 Review: Sign-invariant CAD

Throughout the paper we let and denote the content, primitive part, discriminant, coefficients and leading coefficient of polynomials respectively (in each case taken with respect to a given main variable). Similarly, we let denote the resultant of a pair of polynomials. When applied to a set of polynomials we interpret these as producing sets of polynomials, so for example

The first improvements to Collins original projection operator were given by McCallum (1988) and Hong (1990). They were both subsets of Collins operator, meaning fewer projection polynomials, fewer cells in the CADs produced and quicker computation time. McCallum’s is actually a strict subset of Hong’s, however, it cannot be guaranteed correct (incorrectness is detected in the lifting process) for a certain class of (statistically rare) input polynomials, where Hong’s can.

Additional improvements have been suggested by Brown (2001) and Lazard (1994). The former required changes to the lifting phase while the latter had a flawed proof of validity (with current unpublished work suggesting it can still be safely used in many cases). In this paper we will focus on McCallum’s operators, noting that the alternatives could likely be extended to TTICAD theories too if desired. McCallum’s theory is based around the following condition, which implies sign-invariance.

Definition 3.

A CAD is order-invariant with respect to a set of polynomials if each polynomial has constant order of vanishing within each cell.

Recall that a set is an irreducible basis if the elements of are of positive degree in the main variable, irreducible and pairwise relatively prime. Let be a set of polynomials and an irreducible basis of the primitive part of . Then


defines the operator of McCallum (1988). We can assume some trivial simplifications such as the removal of constants and exclusion of entries identical to a previous one (up to constant multiple). The main theorem underlying the use of follows.

Theorem 4 (McCallum (1998)).

Let be an irreducible basis in and let be a connected submanifold of . Suppose each element of is order-invariant in .

Then each element of either vanishes identically on or is analytic delineable on , (a slight variant on traditional delineability, see (McCallum, 1998)). Further, the sections of not identically vanishing are pairwise disjoint, and each element of not identically vanishing is order-invariant in such sections.

Theorem 4 means that we can use in place of Collins’ projection operator to produce sign-invariant CADs so long as none of the projection polynomials with main variable vanishes on a cell of the CAD of ; a condition that can be checked when lifting. Input with this property is known as well-oriented. Note that although McCallum’s operator produces order-invariant CADs, a stronger property than sign-invariance, it is actually more efficient that the pre-existing sign-invariant operators. We examine the complexity of CAD using this operator in Section 2.3.

2.2 Review: CAD invariant with respect to an equational constraint

The main result underlying CAD simplification in the presence of an EC follows.

Theorem 5 (McCallum (1999)).

Let be integral polynomials with positive degree in , let be their resultant, and suppose . Let be a connected subset of such that is delineable on and is order-invariant in .

Then is sign-invariant in every section of over .

Figure 2: Graphical representation of Theorem 5.

Figure 2 gives a graphical representation of the question answered by Theorem 5. Here we consider polynomials and of positive degree in whose resultant is non-zero, and a connected subset in which is order-invariant. We further suppose that is delineable on (noting that Theorem 4 with and provides sufficient conditions for this). We ask whether is sign-invariant in the sections of over . Theorem 5 answers this question affirmatively: the real variety of either aligns with a given section of exactly (as for the bottom section of in Figure 2), or has no intersection with such a section (as for the top). The situation at the middle section of cannot happen.

Theorem 5 thus suggests a reduction of the projection operator relative to an EC : take only together with the resultants of with the non-ECs. Let be a set of polynomials, contain only the polynomial defining the EC, be a square free basis of , and be the subset of which is a square-free basis for . The operator


was presented by McCallum (1999) along with an algorithm to produce a CAD truth-invariant for the EC and sign-invariant for the other polynomials when the EC was satisfied. It worked by applying first and then building an order-invariant CAD of using . We call such CADs invariant with respect to an equational constraint. Note that as with McCallum (1999) the algorithm only works for input satisfying a well-orientedness condition. Full details of the verification are given by McCallum (1999) and a complexity analysis is given in the next subsection.

2.3 New complexity analyses

We provide complexity analyses of the algorithms from McCallum (1998, 1999) for comparison with our new contributions later. An analysis for the latter has not been published before, while the analysis for the former differs substantially from the one in (McCallum, 1985): instead of focusing on computation time, we examine the number of cells in the CAD of produced: the cell count. We compare the dominant terms in a cell count bound for each algorithm studied. This focus avoids calculations with less relevant parameters, identical for all the algorithms. We note that all CAD experimentation shows a strong correlation between the number of cells produced and the computation time.

Our key parameters are the number of variables , the number of polynomials and their maximum degree (in any one variable). Note that these are all restricted to positive integer values. We make much use of the following concepts.

Definition 6.

Consider a set of polynomials . The combined degree of the set is the maximum degree (taken with respect to each variable) of the product of all the polynomials in the set:

So for example, the set has combined degree (since the product has degree in and degree in ).

Definition 7 (McCallum (1985)).

A set of polynomials has the -property if it can be partitioned into sets, such that each set has maximum combined degree .

So for example, the set of polynomials has combined degree and thus the -property. However, by partitioning it into three sets of one polynomial each, it also has the -property. Partitioning into 2 sets will show it to have the , and -properties also.

The following result follows simply from the definitions.

Proposition 8.

If has the -property then so does any squarefree basis of .

This contrasts with the facts that taking a square-free basis may not reduce the combined degree, but may cause exponential blow-up in the number of polynomials.

Proposition 9.

Suppose a set has the -property. Then, by taking the union of groups of sets from the partition, it also has the -property.

Note that in the case we have .

Example 10.

Let be a set of polynomials. Then has the and -properties. A squarefree basis of is given by which has the and -properties.

Proposition 9 states that must also have the -property, which can be checked by partitioning so that is in a set of its own. However, from Proposition 8 we also know that must have the -property, which is obtained from either of the other partitions into two sets.

demonstrates the strength of the -property. The trivial partition into sets of one polynomial is equivalent to the simple approach of just tracking the number of polynomials and maximum degree. In this example such an approach would lead us to 3 polynomials of degree 4, contributing a possible 12 real roots. However, by using more sophisticated partitions we replace this by 2 sets, for each of which the product of polynomial entries has degree 4, and so at most 8 real roots contributed.

Though not used in this paper, we note an advantage of the -property over the -property is a better bound on root separation: any two roots require subdivisions to isolate, rather than the implied by considering the product of all polynomials.

We also recall the following classic identities for polynomials :


where is the degree of , its derivative and its leading coefficient (all taken with respect to the given main variable).

Lemma 11.

Suppose is a set of polynomials in variables with the property. Then has the property with


Partition as according to its -property. Let be a square-free basis for , the set of elements of which divide some element of , and be those elements of which divide some element of but which have not already occurred in some .

  1. We first claim that each set


    for has the property. Let be the product of the elements of , for some and . Then divides the product of the elements of and so has degree at most . Thus must have degree at most because it is the determinant of a matrix in which each element has degree at most . Then by (8) and repeated application of (6) and (7) we see is a (non-trivial) power of multiplied by

    Since this includes all the elements of (10) the claim is proved.

  2. We are still missing from the where and . For fixed consider , which by (6) is the product of the missing resultants. This is the resultant of two polynomials of degree at most and hence will have degree at most . Thus for fixed the set of missing resultants has the -property, and so the union of all such sets the -property.

  3. We are now missing from only the non-leading coefficients of . The polynomials in the set have degree at most when multiplied together, and so, separately or together, have at most non-leading coefficients, each of which has degree at most . Hence this set of non-leading coefficients has the property. This is the case for from to and thus together the non-leading coefficients of have the -property. We can then pair up these sets to get a partition with the -property (Proposition 9).

Hence can be partitioned into

sets (where the final equality follows from always being even) each with combined degree .    

This concerns a single projection, and we must apply it recursively to consider the full set of projection polynomials. Weakening the bound as in the following allows for a closed form solution.

Corollary 12.

If is a set of polynomials with the property where , then has the -property.

Remark 13.
  1. Note that if has the -property then has the property and hence the need for to apply Corollary 12. As our paper continues we present new theory that applies to the first projection only. Hence for a fair and accurate complexity comparison we will use Lemma 11 for the first projection and then Corollary 12 for subsequent ones, (applicable since even if we start with polynomial for the first projection, we can assume thereafter).

  2. The analysis so far resembles Section 6.1 of McCallum (1985). However, that thesis leads us to the -property in place of Corollary 12. The extra dependency on was avoided by an improved analysis in the proof of Lemma 11 part (3).

We consider the growth in projection polynomials and their degree when using the operator in Table 1. Here the column headings refer not to the number of polynomials and their degree, but to the number of sets and their combined degree when applying Definition 7. We start with polynomials of degree and after one projection have a set with the property, using from Lemma 11. We then use Corollary 12 to model the growth in subsequent projections, and a simple induction to fill in the table.

Variables Number Degree Product
Table 1: Expression growth for CAD projection where: after the first projection we have polynomials with the ()-property and thereafter we measure growth using Corollary 12. The value of could be (9), (13), (18) , (24) or (29) depending on which projection scheme we are analysing.

The size of the CAD produced depends on the number of real roots of the projection polynomials. We can hence bound the number of real roots in a set of polynomials with the -property with (in practice many of them will be strictly complex). We can therefore bound the number of real roots of the univariate projection polynomials by the product of the two entries in the row of Table 1 for 1 variable. The number of cells in the CAD of is bounded by twice this plus 1. Similarly, the total number of cells in the CAD of is bounded by the product of where varies through the Product column of Table 1, i.e. by

Omitting the will leave us with the dominant term of the bound, which can be calculated explicitly as


where the inequality was introduced by omitting the floor function in (9). This may be compared with the bound in Theorem 6.1.5 of McCallum (1985), with the main differences explained by Remark 13(2).

We now turn our focus to CAD invariant with respect to an EC. Recall that we use operator for the first projection only and thereafter. Hence we use Corollary 12 for the bulk of the analysis, and the next lemma when considering the first projection.

Lemma 14.

Suppose is a set of polynomials in variables each with maximum degree d, and that contains a single polynomial. Then the reduced projection has the -property with


Since contains a single polynomial its squarefree basis has the -property.

  1. The contents, leading coefficients and discriminants from form a set with combined degree (see proof of Lemma 11 step 1) and the other coefficients a set with combined degree (see proof of Lemma 11 step 3).

  2. The set of remaining contents has the -property and thus trivially, the -property. Then has the -property and thus also the -property (Proposition 9).

  3. It remains to consider the final set of resultants in (5). Following the approach from the proof of Lemma 11 step 2, we conclude that for each of polynomials in there contributes a set with the -property. So together they form a set with the -property.

Hence is contained in which may be partitioned into

sets of combined degree .    

We can use Table 1 to model the growth in projection polynomials for the algorithm in (McCallum, 1999) as well, since the only difference will be the number of polynomials produced by the first projection, and thus the value of . Hence the dominant term in the bound on the total number of cells is given again by (11), which in this case becomes (upon omitting the floor)


Since is a subset of a CAD invariant with respect to an EC should certainly be simpler than a sign-invariant CAD for the polynomials involved. Indeed, comparing the different values of we see that

Comparing the dominant terms in the cell count bounds, (14) and (12), we see the main effect is a decrease in one of the double exponents by .

3 A projection operator for TTICAD

3.1 New projection operator

In (McCallum, 1999) the central concept is the reduced projection of a set of polynomials relative to a subset (defining the EC). The full projection operator is applied to and then supplemented by the resultants of polynomials in with those in , since the latter group only effect the truth of the formula when they share a root with the former. We extend this idea to define a projection for a list of sets of polynomials (derived from a list of formulae), some of which may have subsets (derived from ECs).

For simplicity in (McCallum, 1999) the concept is first defined for the case when is an irreducible basis. We emulate this approach, generalising for other cases by considering contents and irreducible factors of positive degree when verifying the algorithm in Section 4. So let be a list of irreducible bases and let be a list of subsets . Put and . Note that we use the convention of uppercase Roman letters for sets of polynomials and calligraphic letters for lists of these.

Definition 15.

With the notation above the reduced projection of with respect to is


where is the cross resultant set



Theorem 16.

Let be a connected submanifold of . Suppose each element of is order invariant in . Then each either vanishes identically on or is analytically delineable on ; the sections over of the which do not vanish identically are pairwise disjoint; and each element which does not vanish identically is order-invariant in such sections.

Moreover, for each , in every is sign-invariant in each section over of every which does not vanish identically.


The crucial observation for the first part is that . To see this, recall equation (15) and note that we can write

We can therefore apply Theorem 4 to the set and obtain the first three conclusions immediately, leaving only the final conclusion to prove.

Let be in the range , let and let . Suppose that does not vanish identically on . Now , and so is order-invariant in by hypothesis. Further, we already concluded that is delineable. Therefore by Theorem 5, is sign-invariant in each section of over .    

Theorem 16 is the key tool for the verification of our TTICAD algorithm in Section 4. It allows us to conclude the output is correct so long as no vanishes identically on the lower dimensional manifold, . A polynomial in variables that vanishes identically at a point is said to be nullified at .

The theory of this subsection appears identical to the work in (Bradford et al., 2013a). The difference is in the application of the theory in Section 4. We suppose that the input is a list of QFFs, , with each defined from the polynomials in each . In (Bradford et al., 2013a) there was an assumption (no longer made) that each of these formulae had a designated EC from which the subsets are defined. Instead, we define to be a basis for if there is such a designated EC and define otherwise. That is, we need to treat all the polynomials in QFFs with no EC with the importance usually reserved for ECs.

3.2 Comparison with using a single implicit equational constraint

It is clear that in general the reduced projection will lead to fewer projection polynomials than using the full projection . However, a comparison with the existing theory of equational constraints requires a little more care.

First, we note that the TTICAD theory is applicable to a sequence of formulae while the theory of McCallum (1999) is applicable only to a single formula. Hence if the truth value of each QFF is needed then TTICAD is the only option; a truth-invariant CAD for a parent formula will not necessarily suffice. Second we note that even if the sequence do form a parent formula then this must have an overall EC to use (McCallum, 1999) while the TTICAD theory is applicable even if this is not the case.

Let us consider the situation where both theories are applicable, i.e. we have a sequence of formulae (forming a parent formula) for which each has an EC and thus the parent formula an implicit EC (their product). In the context of Section 1.2 this corresponds to using as the EC. The implicit EC approach would correspond to using the reduced projection of (McCallum, 1999), with and . We make the simplifying assumption that is an irreducible basis. In general will still contain fewer polynomials than since contains all resultants res where (and ), while contains only those with (and ). Thus even in situations where the previous theory applies there is an advantage in using the new TTICAD theory. These savings are highlighted by the worked examples in the next subsection and the complexity analysis later.

3.3 Worked examples

In Section 4 we define an algorithm for producing TTICADs. First we illustrate the savings with our worked examples from Section 1.3, which satisfy the simplifying assumptions from Section 3.1.

We start by considering from equation (2). In the notation above we have:

We construct the reduced projection sets for each ,

and the cross-resultant set

is then the union of these three sets. In Figure 3 we plot the polynomials (solid curves) and identify the 12 real solutions of (solid vertical lines). We can see the solutions align with the asymptotes of the ’s and the important intersections (those of with and with ).

Figure 3: The polynomials from in equation (2) along with the roots of (solid lines), (dashed lines) and (dotted lines).
Figure 4: Magnified region of Figure 3.
Figure 5: The polynomials from in equation (3) along with the roots of .
Figure 6: Magnified region of Figure 5.

If we were to instead use a projection operator based on an implicit EC then in the notation above we would construct from and . This set provides an extra 4 solutions (the dashed vertical lines) which align with the intersections of with and with . Finally, if we were to consider then we gain a further 4 solutions (the dotted vertical lines) which align with the intersections of and and the asymptotes of the ’s. In Figure 4 we magnify a region to show explicitly that the point of intersection between and is identified by , while the intersections of with both and are ignored.

The 1-dimensional CAD produced using has 25 cells compared to 33 when using and 41 when using . However, it is important to note that this reduction is amplified after lifting (using Theorem 16 and and Algorithm 1). The 2-dimensional TTICAD has 105 cells and the sign-invariant CAD has 317. Using Qepcad to build a CAD invariant with respect to the implicit EC gives us 249 cells.

Next we consider determining the truth of from equation (3). This time

and so is as above but contains an extra polynomial (the coefficient of in ). The cross-resultant set also contains an extra polynomial,

These two extra polynomials provide three extra real roots and hence the 1-dimensional CAD produced using this time has 31 cells.

In Figure 5 we again graph the four curves this time with solid vertical lines highlighting the real solutions of . By comparing with Figure 3 we see that more points in the CAD of have been identified for the TTICAD of than the TTICAD of (15 instead of 12) but that there is still a saving over the sign-invariant CAD (which had 20, the five extra solutions indicated by dotted lines). The lack of an EC in the second clause has meant that the asymptote of and its intersections with have been identified. However, note that the intersections of with and and have not been. Figure 6 magnifies a region of Figure 5. Compare with Figure 4 to see the dashed line has become solid, while the dotted line remains unidentified by the TTICAD.

Note that we are unable to use (McCallum, 1999) to study as there is no polynomial equation logically implied (either explicitly or implicitly) by this formula. Hence there are no dashed lines and the choice is between the sign-invariant CAD with 317 cells or the TTICAD, which for this example has 183 cells.

4 Algorithm

4.1 Description and Proof

We describe carefully Algorithm 1. This will create a TTICAD of for a list of QFFs in variables , where each has at most one designated EC of positive degree (there may be other non-designated ECs).

It uses a subalgorithm CADW, which was validated by McCallum (1998). The input of CADW is: , a positive integer and , a set of -variate integral polynomials. The output is a boolean which if true is accompanied by an order-invariant CAD for (represented as a list of indices and sample points ).

Let be the set of all polynomials occurring in . If has a designated EC then put and if not put . Let and be the lists of the and respectively. Our algorithm effectively defines the reduced projection of with respect to in terms of the special case of this definition from the previous section. The definition amounts to


Here is the set of contents of all the elements of all ; the list such that is the finest222A decomposition into irreducibles. This avoids various technical problems. squarefree basis for the set of primitive parts of elements of which have positive degree; and is the list , such that is the finest squarefree basis for . (The reader may notice that this notation and the definition of here is analogous to the work in Section 5 of (McCallum, 1999).)

Input : A list of quantifier-free formulae in variables . Each has at most one designated EC .
Output : Either A CAD of (described by lists and of cell indices and sample points) which is truth table invariant for the list of input formulae; or   FAIL: If is not well-oriented with respect to (Def 18).
1 for  do
2       If there is no designated EC then set and otherwise set ;
3       Compute the finest squarefree basis for ;
5Set ;
6 if  then
7       Isolate the real roots of the polynomials in and thus form cell indices and sample points for a CAD of ;
8       return and for ;
11       for  do
12             Extract the set of polynomials in ;
13             Compute the set of contents of the elements of ;
14             Compute the set , the finest squarefree basis for ;
16      Set , and ;
17       Construct the projection set ;
18       Attempt to construct a lower-dimensional CAD: ;
19       if  then
20             return FAIL (since is not well oriented) ;
22      ; ;
23       for each cell  do
24             ;
25             for  do
26                   if any is nullified on  then
27                         if  then
28                               return FAIL (since is not well oriented) ;
30                        else
31                               ;
34                  else
35                         ;
38            Generate a stack over using : construct cell indices and sample points for the stack over of the polynomials in , adding them to and ;
40      return and for ;
Algorithm 1 TTICAD Algorithm

We shall prove that, provided the input satisfies the condition of well-orientedness given in Definition 18, the output of Algorithm 1 is indeed a TTICAD for . We first recall the more general notion of well-orientedness from (McCallum, 1998). The boolean output of CADW is false if the input set was not well-oriented in this sense.

Definition 17.

A set of -variate polynomials is said to be well oriented if whenever , every is nullified by at most a finite number of points in , and (recursively) is well-oriented.

This condition is required for CADW since the validity of this algorithm relies on Theorem 4 which holds only when polynomials do not vanish identically. The conditions allows for a finite number of these nullifications since this indicates a problem on a zero cell, that is a single point. In such cases it is possible to replace the nullified polynomial by a so called delineating polynomial which is not nullified and can be used in place to ensure the delineability of the other. The use of these is part of the verified algorithm CADW (McCallum, 1998) and they are studied in detail by Brown (2005).

We now define our new notion of well-orientedness for the lists of sets and .

Definition 18.

We say that is well oriented with respect to if, whenever , every polynomial is nullified by at most a finite number of points in , and is well-oriented in the sense of Definition 17.

It is clear than Algorithm 1 terminates. We now prove that it is correct using the theory developed in Section 3.

Theorem 19.

The output of Algorithm 1 is as specified.


We must show that when the input is well-oriented the output is a TTICAD, (each has constant truth value in each cell of ), and FAIL otherwise.

If the input was univariate then it is trivially well-oriented. The algorithm will construct a CAD of using the roots of the irreducible factors of the polynomials in (steps 1 to 1). At each 0-cell all the polynomials in each trivially have constant signs, and hence every has constant truth value. In each 1-cell no EC can change sign and so every has constant truth value , unless there are no ECs in any clause. In this case the algorithm would have constructed a CAD using all the polynomials and hence on each 1-cell no polynomial changes sign and so each clause has constant truth value.

From now on suppose . If is not well-oriented in the sense of Definition 17 then CADW returns as false. In this case the input is not well oriented in the sense of Definition 18 and Algorithm 1 correctly returns FAIL in step 1. Otherwise, we have with and specifying a CAD, , which is order-invariant with respect to (by the correctness of CADW, as proved in (McCallum, 1998)). Let , a submanifold of , be a cell of and let be its sample point.

We suppose first that the dimension of is positive. If any polynomial vanishes identically on then the input is not well oriented in the sense of Definition 18 and the algorithm correctly returns FAIL at step 1. Otherwise, we know that the input list was certainly well-oriented. Since no polynomial vanishes then no element of the basis vanishes identically on either. Hence, by Theorem 16, applied with and , each element of is delineable on , and the sections over of the elements of are pairwise disjoint. Thus the sections and sectors over of the elements of comprise a stack over . Furthermore, the last conclusion of Theorem 16 assures us that, for each , every element of is sign-invariant in each section over of every element of . Let . We shall show that each has constant truth value in both the sections and sectors of .

If has a designated EC then let denote the constraint polynomial; otherwise let denote an arbitrary element of .

Consider first a section of . Now is a product of its content and some elements of the basis . But , an element of , is sign-invariant (indeed order-invariant) in the whole cylinder and hence, in particular, in . Moreover all of the elements of are sign-invariant in , as was noted previously. Therefore is sign-invariant in . If has no constraint (and so denotes an arbitrary element of ) then this implies that has constant truth value in . So consider from now on the case in which is the designated constraint polynomial of .

If is positive or negative in then has constant truth value in . So suppose that throughout . It follows that must be a section of some element of the basis . Let be a non-constraint polynomial in . Now, by the definition of , we see can be written as

where . But , in , is sign-invariant (indeed order-invariant) in the whole cylinder , and hence in particular in . Moreover each is sign-invariant in , as was noted previously. Hence is sign-invariant in . (Note that in the case where does not have main variable then and the conclusion still holds). Since was an arbitrary element of , it follows that all polynomials in are sign-invariant in , hence that has constant truth value in .

Next consider a sector of the stack , and notice that at least one such sector exists. As observed above, is sign-invariant in , and does not vanish identically on . Hence is non-zero throughout . Moreover each element of the basis is delineable on . Hence is nullified by no point of . It follows from this that the algorithm does not return FAIL during the lifting phase. It follows also that throughout . Hence has constant truth value in .

It remains to consider the case in which the dimension of is 0. In this case the roots of the polynomials in the lifting set constructed by the algorithm determine a stack over . Each trivially has constant truth value in each section (0-cell) of this stack, and the same can routinely be shown for each sector (1-cell) of this stack.    

4.2 TTICAD via the ResCAD Set

When no is nullified there is an alternative implementation of TTICAD which would be simple to introduce into existing CAD implementations. Define

to be the ResCAD Set of .

Theorem 20.

Let be a list of irreducible bases and let be a list of non-empty subsets . Then we have

The proof is straightforward and so omitted here.

Corollary 21.

If no is nullified by a point in then inputting into any algorithm which produces a sign-invariant CAD using McCallum’s projection operator will result in the TTICAD for produced by Algorithm 1.

Corollary 21 gives a simple way to compute TTICADs using existing CAD implementations based on McCallum’s approach, such as Qepcad.

5 Utilising projection theory for improvements to lifting

Consider the case when the input to Algorithm 1 is a single QFF with a declared EC. In this case the reduced projection operator produces the same polynomials as the operator and so one may expect the TTICAD produced to be the same as the CAD produced by an implementation of (McCallum, 1999) such as Qepcad. In practice this is not the case because Algorithm 1 makes use of the reduced projection theory in the lifting phase as well as the projection phase.

McCallum (1999) discussed how the theory of a reduced projection operator would improve the projection phase of CAD, by creating fewer projection polynomials. The only modification to the lifting phase of Collins’ CAD algorithm described was the need to check the well-orientedness condition of Definition 17.

In this section we note two subtleties in the lifting phase of Algorithm 1 which result in efficiencies that could be replicated for use with the original theory. In fact, the ProjectionCAD package (England et al., 2014d) discussed in Section 7.1 has commands for building CADs invariant with respect to a single EC which does this.

5.1 A finer check for well-orientedness

Theorem 2.3 of (McCallum, 1999) verified the use of . The proof uses Theorem 4 to conclude sign-invariance for the polynomial defining the EC, and Theorem 5 to conclude sign-invariance for the other polynomials only when the EC was satisfied.

To apply Theorem 4 here we need the EC polynomial and the projection polynomials obtained by repeatedly applying to have a finite number of nullification points. Meanwhile, the application of Theorem 5 requires that the resultants of the EC polynomial with the others polynomials have no nullification points. Both these requirements are guaranteed by the input satisfying Definition 17, the condition used in (McCallum, 1999). However, this also requires that other projection polynomials, including the non-ECs in the input, to have no nullification points.

In Algorithm 1, step 1 only checks for nullification of the polynomials in (in this context meaning only the EC). Hence this algorithm is checking the necessary conditions but not whether the non-ECs (in the main variable) are nullified.

Example 22.

Assume the variable ordering and consider the polynomials

forming the formula . We could analyse this using a sign-invariant CAD with 557 cells but it is more efficient to make use of the EC. Our implementation of Algorithm 1 produces a CAD with 165 cells, while declaring the EC in QEPCAD results in 221 cells (the higher number is explained in subsection 5.2). Qepcad also prints:

      Error! Delineating polynomial should be added over cell(2,2)!

indicating the output may not be valid. The error message was triggered by the nullification of when which does not actually invalidate the theory. Qepcad is checking for nullification of all projection polynomials leading to unnecessary errors.

In fact, we can take this idea further in the case where for some : in such a case we do not need to check any elements of (that particular) for nullification (since we are using the theory of McCallum (1998) and it is the final lift meaning only sign- (rather than order-) invariance is required.

5.2 Smaller lifting sets

Traditionally in CAD algorithms the projection phase identifies a set of projection polynomials, which are then used in the lifting phase to create the stacks. However when making use of ECs we can actually be more efficient by discarding some of the projection polynomials before lifting. The non-ECs (in the main variable) are part of the set of projection polynomials, required in order to produce subsequent projection polynomials (when we take their resultant with