public pdf

140
Real Quantifier Elimination in Geometry 1 Thomas Sturm 2 FMI, Universit¨at Passau, D-94030 Passau, Germany December 3, 1999 1 ImDezember 1999 an derFakult¨at f¨ ur Mathematik undInformatik der Universit¨at Passau eingereichte Dissertation 2 http://www.fmi.uni-passau.de/~sturm/, [email protected]

Upload: vongoc

Post on 28-Jan-2017

224 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: public pdf

Real Quantifier Elimination in Geometry1

Thomas Sturm2

FMI, Universitat Passau, D-94030 Passau, Germany

December 3, 1999

1Im Dezember 1999 an der Fakultat fur Mathematik und Informatik der Universitat

Passau eingereichte Dissertation2http://www.fmi.uni-passau.de/~sturm/, [email protected]

Page 2: public pdf

2

Page 3: public pdf

Contents

1 Introduction 71.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.2 Main Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2 Real Quantifier Elimination 112.1 The Notion of Quantifier Elimination . . . . . . . . . . . . . . . . 112.2 The History of Real Quantifier Elimination . . . . . . . . . . . . 122.3 Real Quantifier Elimination Procedures . . . . . . . . . . . . . . 14

2.3.1 The Tarski Procedure . . . . . . . . . . . . . . . . . . . . 142.3.2 Cylindrical Algebraic Decomposition . . . . . . . . . . . . 172.3.3 Virtual Substitution of Test Points . . . . . . . . . . . . . 202.3.4 Parametric Real Root Counting . . . . . . . . . . . . . . . 22

2.4 Variants of Quantifier Elimination . . . . . . . . . . . . . . . . . 242.4.1 Extended Quantifier Elimination . . . . . . . . . . . . . . 252.4.2 Generic Quantifier Elimination . . . . . . . . . . . . . . . 26

2.5 Simplification Strategies . . . . . . . . . . . . . . . . . . . . . . . 272.6 The redlog Computer Logic System . . . . . . . . . . . . . . . 28

2.6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 292.6.2 From Computer Algebra to Computer Logic . . . . . . . . 292.6.3 A User’s View on the System . . . . . . . . . . . . . . . . 302.6.4 An Implementor’s View on the System . . . . . . . . . . . 322.6.5 Scheduler Internals . . . . . . . . . . . . . . . . . . . . . . 372.6.6 Documentation . . . . . . . . . . . . . . . . . . . . . . . . 38

2.7 Application Areas . . . . . . . . . . . . . . . . . . . . . . . . . . 392.7.1 Constraint Solving . . . . . . . . . . . . . . . . . . . . . . 392.7.2 Optimization . . . . . . . . . . . . . . . . . . . . . . . . . 392.7.3 Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . 402.7.4 Simulation, Sizing, and Diagnosis . . . . . . . . . . . . . . 412.7.5 Control Theory and Stability . . . . . . . . . . . . . . . . 422.7.6 Real Implicitization . . . . . . . . . . . . . . . . . . . . . 422.7.7 Automatic Theorem Proving . . . . . . . . . . . . . . . . 42

2.8 Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432.9 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

3 Geometric Theorem Proving 453.1 Conventional Algebraic Methods . . . . . . . . . . . . . . . . . . 453.2 Subsidiary Conditions . . . . . . . . . . . . . . . . . . . . . . . . 463.3 Translating Geometry to Algebra . . . . . . . . . . . . . . . . . . 47

3

Page 4: public pdf

4 CONTENTS

3.4 Limitations of the Algebraic Methods . . . . . . . . . . . . . . . 483.5 Proving by Real Quantifier Elimination . . . . . . . . . . . . . . 503.6 From Theorem Proving to Theorem Finding . . . . . . . . . . . . 513.7 Generic Virtual Substitution Sample Proofs . . . . . . . . . . . . 523.8 A Collection of Automatic Proofs . . . . . . . . . . . . . . . . . . 54

3.8.1 Examples Discussed by Chou . . . . . . . . . . . . . . . . 553.8.2 Further Examples Requiring a Real Prover . . . . . . . . 64

3.9 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

4 Computational Geometry 754.1 Geometric Objects as Semialgebraic Sets . . . . . . . . . . . . . . 764.2 Parallel Projection . . . . . . . . . . . . . . . . . . . . . . . . . . 764.3 Central Projection . . . . . . . . . . . . . . . . . . . . . . . . . . 824.4 Offsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854.5 Voronoi Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . 914.6 Collision Problems . . . . . . . . . . . . . . . . . . . . . . . . . . 954.7 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

5 Solid Modeling 1015.1 Boolean and Topological Operations . . . . . . . . . . . . . . . . 1025.2 Solids as Regular Closed Semialgebraic Sets . . . . . . . . . . . . 1025.3 Offsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1035.4 Blendings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

5.4.1 Roundings from Inside . . . . . . . . . . . . . . . . . . . . 1085.4.2 Roundings from Outside . . . . . . . . . . . . . . . . . . . 1115.4.3 Comparison to Other Work . . . . . . . . . . . . . . . . . 113

5.5 Obtaining b-rep Information . . . . . . . . . . . . . . . . . . . . 1155.5.1 Computation of Candidate Patches . . . . . . . . . . . . . 1165.5.2 Isolation of Proper Surface Patches . . . . . . . . . . . . . 1175.5.3 Grobner Simplification of the Surface . . . . . . . . . . . 1185.5.4 Quantifier Elimination Recognized Implication . . . . . . 1185.5.5 Computation Examples . . . . . . . . . . . . . . . . . . . 1185.5.6 An Approximative Variant . . . . . . . . . . . . . . . . . 1205.5.7 Adjacency Information . . . . . . . . . . . . . . . . . . . . 122

5.6 Geometric Feasibility . . . . . . . . . . . . . . . . . . . . . . . . . 1225.7 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

6 Concluding Remarks 127

Page 5: public pdf

List of Figures

2.1 The module structure of redlog . . . . . . . . . . . . . . . . . . 332.2 A simple example network consisting of resistors . . . . . . . . . 41

3.1 Parallelogram diagonal cut . . . . . . . . . . . . . . . . . . . . . 473.2 Complex line circle intersection . . . . . . . . . . . . . . . . . . . 493.3 Intersection between a strip and a disk . . . . . . . . . . . . . . . 533.4 Simson’s theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . 563.5 Two types of configurations for Example 3.11 . . . . . . . . . . . 583.6 Feuerbach’s theorem . . . . . . . . . . . . . . . . . . . . . . . . . 583.7 The two types of valid configurations for Example 3.13 . . . . . . 603.8 An invalid configuration for Example 3.13 . . . . . . . . . . . . . 613.9 M. Paterson’s problem . . . . . . . . . . . . . . . . . . . . . . . . 623.10 Gergonne’s theorem . . . . . . . . . . . . . . . . . . . . . . . . . 633.11 Angle at circumference vs. angle at center . . . . . . . . . . . . . 643.12 The median bisector theorem . . . . . . . . . . . . . . . . . . . . 663.13 Modeling Pedoe’s inequality . . . . . . . . . . . . . . . . . . . . . 683.14 Pompeiu’s theorem . . . . . . . . . . . . . . . . . . . . . . . . . . 713.15 A variant of the Steiner–Lehmus theorem . . . . . . . . . . . . . 72

4.1 A sample aspect of a rectangular solid in generic position . . . . 814.2 Reconstructed rectangular solid . . . . . . . . . . . . . . . . . . . 814.3 A photo of the wire frame a cuboid . . . . . . . . . . . . . . . . . 854.4 4-Offset of the X-axis and the Y -axis . . . . . . . . . . . . . . . . 874.5 The unit circle and its 3

4 -∇-offset . . . . . . . . . . . . . . . . . . 884.6 Voronoi diagram of three points . . . . . . . . . . . . . . . . . . . 914.7 Voronoi diagram of a circle and two lines . . . . . . . . . . . . . 934.8 A plane and its equi-distance surface with the unit ball . . . . . 944.9 The equi-distance surface of the X-axis and two lines . . . . . . . 94

5.1 Rounding Rossignac’s limit case . . . . . . . . . . . . . . . . . . . 1145.2 Two boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1185.3 Two boxes with hole inside . . . . . . . . . . . . . . . . . . . . . 1205.4 Two possible layouts for a house front . . . . . . . . . . . . . . . 1235.5 Packing disks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

5

Page 6: public pdf

6 LIST OF FIGURES

Page 7: public pdf

Chapter 1

Introduction

In 1948, the rand Corporation published a technical report titled A DecisionMethod for Elementary Algebra and Geometry [Tar48]. The author of this wasthe famous polish-born mathematician Alfred Tarski, and it had been “preparedfor publication” by J.C.C. McKinsey, who was then a professor at StanfordUniversity cooperating with the rand. There are a lot of fascinating stories totell around this extremely important paper, the knowledge of which will helpthe reader to understand the position of this maybe a little less important thesisin its scientific area.

First of all, the results published were, as stated by Tarski himself in thepreface of a second edition [Tar51, Tar98], nearly 20 years old:

“The main results were found in 1930 and first mentioned in a printone year later. It took nine years, however, before the material inits full development was prepared for publication.”

This scientific accurateness cost Tarski another 10 years, because, due to theWorld War II, the monograph Actualites scientifiques et industrielles he hadsubmitted it to never appeared.

In the title, “elementary algebra” refers to the theory of real numbers withordering, and the term “elementary geometry” reflects Tarski’s insight that thereis a certain correspondence between polynomial constraint systems and geomet-ric configurations. This thesis focuses on this correspondence. Tarski’s paperactually contains much more than a decision procedure, it in fact describes aquantifier elimination procedure: One can not only decide first-order sentences,but in a certain sense parametrically decide formulas containing also free vari-ables. As demonstrated throughout this thesis, proper quantifier eliminationproblems play a much more prominent role for geometry than pure decisionproblems. Amazingly, quantifier elimination seemed to be of minor importancefor Tarski, and even more amazingly, also McKinsey did not adapt the title.

McKinsey is the link between the pure mathematician Tarski and the appli-cation oriented rand corporation. Apart from the fact that the rand providedwith their technical report serious a generous support for the scientific com-munity at these days, it is very likely, and explicitly claimed by Tarski in thepreface cited above, that the rand was really interested in the work:

“Within a few months the monograph was published. As was tobe expected, it reflected the specific interests which the rand Cor-

7

Page 8: public pdf

8 CHAPTER 1. INTRODUCTION

poration found in the results. The decision method for elementaryalgebra and geometry—which is one of the main results of the work—was presented in a systematic and detailed way, thus bringing to thefore the possibility of constructing an actual decision machine.”

Tarski’s original manuscript is still available, and comparing it to McKinsey’sversion, one actually gets the impression that any mathematical elegance hasbeen sacrificed for the purpose of creating implementation instructions. Therand does not hold any records on an actual implementation attempt1, and itwould obviously have been completely hopeless these days. Anyway, we havelearned that two ideas came immediately into existence with the publication ofthe first real quantifier elimination procedure: “implement it,” and “this is goodfor geometry.” Both ideas also form the basis of our thesis.

1.1 Overview

Chapter 2 starts by introducing the notion of real quantifier elimination, andgives a detailed overview of the historical development of real quantifier elimi-nation and related implementations. Various known quantifier elimination pro-cedures are described in order to give an idea of the algorithms behind thecomputation techniques discussed throughout this thesis. Among the describedmethods, the virtual substitution method is of particular importance for theapplications discussed here. This method has been modified by the author toa generic quantifier elimination procedure for solving problems of geometricnature. This thesis is going to demonstrate that generic quantifier eliminationis an outstanding tool, which solves problems that are not accessible to otherelimination methods.

In view of the fact that real quantifier elimination procedures amount to deci-sion methods for variable-free formulas, it is a straightforward idea for Chapter 3to apply them for automated theorem proving. Theorems of elementary geom-etry have traditionally been considered an important test case for the scopeof methods in automatic theorem proving. In geometric theorem proving, notonly first-order sentences have to be decided, but there have, in addition, cer-tain non-degeneracy conditions to be derived. It will turn out that this taskis in an excellent manner performed by our newly discovered generic quantifierelimination. Since (generic) quantifier elimination methods are not restricted toclosed sentences, it turns out that they can even be used for geometric theoremfinding instead of simply proving given theorems.

Chapter 4 turns to computational aspects of geometry being concerned witha number of computational problems in real 3-space or the real plane thatarise from applications mainly in the area of cad, computer vision, and mo-tion planning. This includes parallel and central projections, offset compu-tations, Voronoi diagrams, and collision problems. We will again use almostexclusively our generic variant of extended quantifier elimination, although thetopics treated here are, in contrast to most geometric theorems, not inherentlysubject to non-degeneracy assumptions. The reason for this is that the genericquantifier elimination turns out much more efficient than the regular one. Manyof our examples from computational geometry involve a significant number of

1Anthony C. Hearn, private communication

Page 9: public pdf

1.2. MAIN RESULTS 9

parameters besides the variables to be eliminated. Examples of this kind havebeen inaccessible to other implemented real elimination methods so far.

In Chapter 4 we have modeled the geometric objects as sets of satisfyingpoints of quantifier-free formulas over the reals. Chapter 5 proposes to use thismodeling, with certain restrictions on valid objects, also for solid modeling sys-tems. Recent modeling systems usually operate with a hybrid representation ofobjects mixing a high-level csg description on one hand and a low-level b-rep

description on the other hand. The former is used for sophisticated operationson the objects, while the latter is mainly used for rendering the objects on theoutput device. In theory, our formula representation can be viewed to extendcsg. We show that we can perform on our formula representation all the usualoperations encountered in solid modeling. In addition, our framework is well-suited for rounding and blending of solids, which has been an important researchtopic in the solid modeling community during the past years, and has not yetbeen satisfactorily solved. We also illustrate, how b-rep representations of oursolids can be computed from our description by quantifier-free formulas. Finally,we demonstrate how to treat geometric feasibility problems in our framework.The background for this is that the latest generation of cad systems is being de-signed to accept as input declarative descriptions of scenes instead of proceduraldrawing commands.

It is an important feature of our approach to computational geometry andsolid modeling that we can solve all problems parametrically. We can, e.g., com-pute the blend of a solid with respect to a parametric radius r. The resultingdescription will contain case distinctions that make it correct for any substi-tution of a positive real number for r. Similarly, the solids themselves can bedescribed parametrically, and the quantifier elimination work can be done oncefor an entire class of solids.

1.2 Main Results

We introduce the notion of generic quantifier elimination. This variant of realquantifier elimination is, in general, faster and produces smaller results thanregular quantifier elimination. This is achieved by avoiding certain case distinc-tions on the parameter variables contained in the formula ϕ under considera-tion. Technically, instead of the case distinctions one generates in addition to aquantifier-free formula ϕ′, a conjunction ϑ′ of non-zero assumptions on polyno-mials in the parameters. This ϑ′ is sufficient for ϕ′ to be a correct eliminationresult. Formally, we have

ϑ′ −→ (ϕ←→ ϕ′).

Applying our concept of generic quantifier elimination to automated geo-metric theorem proving, it turns out that we can compete with the well-knownestablished algebraic approaches to this. Moreover, it turns out that the as-sumptions ϑ′ generated by our procedure provide, as a rule, important non-degeneracy conditions on the geometric input configurations. That is, genericquantifier elimination is not only more efficient than the regular one, but evena superior concept for this task. Since generic quantifier elimination is a real,in contrast to complex, method, its application range exceeds that of the tradi-tional algebraic approaches in various ways: it can handle ordering inequalitiesin both input and output, it can prove theorems the algebraic formulation of

Page 10: public pdf

10 CHAPTER 1. INTRODUCTION

which holds over the reals but not over the complex numbers, and it can disprovetheorems. Whenever a theorem is not generically true, our elimination result ϕ′

provides necessary and sufficient conditions in the parameters for the theoremto hold. This extends our approach from theorem proving to theorem finding,which cannot be accomplished by any of the traditional algebraic methods.

We next treat traditional problems from computational geometry by ourmethod. This includes parallel and central projections and corresponding recon-struction problems, offset computations, Voronoi diagrams, and collision prob-lems. Here it again turns out that generic quantifier elimination dramaticallyextends the range of problems that can be handled reasonably. This time, how-ever, the assumptions made do not provide any valuable extra information. Onthe other hand generic quantifier elimination does not impose any restrictionsthat cannot be overcome. It turns out to be a crucial feature of our approachthat we can handle the considered problems parametrically, i.e., we simultane-ously solve problems for an entire class of objects and configurations, which isgiven by all real interpretations for the parameters.

Inspired by the success of our approach in two different scientific areas withgeometry as their common basis, we examine the question how solid modelingsystems could benefit from real (generic) quantifier elimination. We suggesta theoretical framework extending the well-known constructive solid geometry.Our solids are certain semialgebraic sets described by quantifier-free formulas.Based on this notion of a solid, we clarify that the usual operations of solid mod-eling can be performed by means of quantifier elimination techniques. We thenfocus in particular on blendings from inside and from outside of solids, whichhas been extensively discussed in the solid modeling community, and which isnot yet satisfactorily solved. Our framework avoids some common problemswith blendings. Moreover, it can be used for analyzing these problems, and forsystemizing the existing approaches. Our solids can be rendered on the usualoutput devices by turning them into the commonly accepted b-rep represen-tation. We discuss algorithms involving quantifier elimination for this. Finally,we show that (generic) quantifier elimination is straightforwardly applicable togeometric constraint solving, which is of increasing importance in the scientificliterature on the design of graphics systems. There it is considered to be thebasic tool for the next generation of modeling systems.

Our generic quantifier elimination has been implemented within the com-puter logic system redlog by the author et al. that, as a part of the computeralgebra system reduce, is widely accepted and used inside the scientific com-munity. In fact, reduce provides with redlog the currently only professionallymaintained and marketed implementation of real quantifier elimination.

Finally, it should be mentioned that our methods are restricted to problemswhere the quantified variables occur with a small total degree only. For themajority of problems discussed throughout this thesis the restriction was notrelevant. There are, however, few examples where our method simply fails. Weconsider the selection of examples discussed here representative in this concern.

Page 11: public pdf

Chapter 2

Real Quantifier Elimination

Starting with some simple considerations about the zeroes of parametric polyno-mial functions, we naturally introduce in Section 2.1 the necessary framework forreal quantifier elimination. Section 2.2 gives a detailed overview of the historicaldevelopment of real quantifier elimination and related implementations. In Sec-tion 2.3, we first describe Tarski’s quantifier elimination method, which—as thefirst such method—contains many ideas of general interest for the topic. Thenwe describe three further methods, which are exactly the implemented ones.Among these methods, the virtual substitution method is of particular impor-tance for this thesis. It has been implemented by the author et al., and modifiedby the author to a generic quantifier elimination procedure for solving the typesof geometric problems discussed throughout this thesis. This generic quantifierelimination is, besides another quantifier elimination variant, described in Sec-tion 2.4. Section 2.5 briefly sketches simplification strategies for formulas tothe extent necessary for understanding the solution strategies provided withinthis thesis. Section 2.6 describes the design of the computer logic system red-

log, which is a joint work by the author together with A. Dolzmann [DS97b].For illustrating that the application area for real quantifier elimination is by nomeans restricted to the geometric types of problems discussed here, Section 2.7provides a summary of other areas, where real quantifier elimination has beensuccessfully applied, both by the author and others. Section 2.8 finally discussesthe position of real quantifier elimination methods in relation to general theoremproving approaches and to logic programming.

2.1 The Notion of Quantifier Elimination

Consider a parametric affine linear function fa,b(x) = ax+ b over the reals. Fora 6= 0 it will have a zero fa,b(−b/a) = 0. For a = 0 we find that f0,b(x) = b hasa zero if and only if b = 0. Formally, we have found the equivalence

∃x(ax + b = 0)←→ a 6= 0 ∨ (a = 0 ∧ b = 0)

by eliminating both the quantifier “∃x” and the corresponding bound variablex. For given parameters a, b ∈ R the question if f has a zero can now beefficiently decided by evaluating the elimination result a 6= 0 ∨ (a = 0 ∧ b = 0)to either “true” or “false.”

11

Page 12: public pdf

12 CHAPTER 2. REAL QUANTIFIER ELIMINATION

Let us turn to another parametric real function gc(x) = x2+c. This functiongc has a real zero if and only if c 6 0:

∃x(x2 + c = 0)←→ c 6 0.

For given c ∈ R, the condition c 6 0 again provides an efficient test for whethergc has a real zero. Note that the elimination result involves not equations andnegated equations but an ordering constraint, which we refer to as an inequality.It is not hard to see that the resulting inequality c 6 0 cannot be restated bymeans of combining finitely many possibly negated equations.

Multiple quantifiers can be successively eliminated starting with the inner-most one: Consider, e.g., an elimination problem of the following form:

ϕ(u1, . . . , um) ≡ ∃x∃yψ(u1, . . . , um, x, y).

Elimination of “∃y” yields ∃yϕ(u1, . . . , um, x, y) ←→ ι(u1, . . . , um). It followsthat ϕ ←→ ∃xι. Thus eliminating “∃x” from ∃xι yields a quantifier-free elim-ination result for ϕ. Our example function gc has shown that ι will in generalcontain ordering inequalities. Our example function fa,b has shown that ι canmoreover contain boolean combinations of constraints. A quantifier eliminationprocedure thus has to permit as input arbitrary boolean combinations of con-straints. The elimination of a universal quantifier “∀x” can be reduced to thatof an existential quantifier by means of the equivalence ∀xψ ←→ ¬∃x¬ψ.

2.2 The History of Real Quantifier Elimination

The first mathematical results with a certain spirit of real quantifier eliminationdate back to the 17th century. They are concerned with counting real zeroes ofpolynomials. In 1637, R. Descartes established his rule of signs [Des73]:

Theorem 2.1 (Descartes, 1637) Let f be a squarefree univariate real poly-nomial. Denote by s the number of sign changes in the coefficients of f ignoringzeroes, and by n the number of different positive real roots of f . Then n 6 s,s− n is even, and if all roots of f are real, then n = s.

Note that Descartes’ theorem provides rather precise information in certaincases: For odd s, we know that there must be at least one real root, and fors = 1 it follows that n = 1, i.e. there is exactly one real root. Information on thenegative roots can, of course, be obtained by considering f(−x) instead of f(x),and f(0) can be explicitly tested. This theorem unfortunately provides only anupper bound on the real roots. For the purpose of eliminating an existentialquantifier one is interested in the fact whether 1 is a lower bound. That is 1 6 nin terms of the theorem.

Budan (1807) and Fourier (1831) showed that Descartes’ rule of signs isactually a special case of a more general theorem [BdB07, Fou31]:

Theorem 2.2 (Budan, 1807, Fourier, 1831) Let f be a squarefree univari-ate real polynomial, and let a < b be real numbers such that f(a) 6= 0 andf(b) 6= 0. Let D be the finite sequence of higher non-zero derivatives of f . De-note by s the difference between the number of sign changes in the sequence D(a)

Page 13: public pdf

2.2. THE HISTORY OF REAL QUANTIFIER ELIMINATION 13

and the number of sign changes in the sequence D(b), and let n be the numberof different real roots of f on [a, b]. Then n 6 s, s− n is even, and if all rootsof f are real, then n = s.

Descartes rule of signs is obtained from this by choosing a = 0 and b sufficientlylarge. Concerning quantifier elimination, the Budan–Fourier theorem is notmore helpful than Descartes’ rule of signs. It was, however, an important steptoward the first result on the exact number of real roots of a given polynomialby Sturm.

In 1835, Sturm derived the following procedure from the Budan–Fouriertheorem by replacing the sequence D of the higher derivatives by the Sturmsequence [Stu35]. This yields the exact number of roots. Note that f need notbe squarefree here.

Theorem 2.3 (Sturm, 1835) Let f be a univariate real polynomial, and leta < b be real numbers such that f(a) 6= 0 and f(b) 6= 0. Let S be the finitesequence of polynomials obtained from f and its derivative f ′ by successive di-vision with negative remainder. Denote by s the difference between the numberof sign changes in the sequence S(a) and the number of sign changes in thesequence S(b). Then n = s.

So far, the theorems addressed a purely algebraic, i.e., equational problem. In1853, Sylvester observed that Sturm’s theorem can easily be extended to coveran additional inequality as a side condition [Syl53]. Problems involving alsoinequalities are called semi-algebraic.

Theorem 2.4 (Sylvester, 1853) Let f be a squarefree univariate real poly-nomial, and let a < b be real numbers such that f(a) 6= 0 and f(b) 6= 0. Let gbe another univariate real polynomial that is relatively prime to f . Denote byT the finite sequence of polynomials obtained from f and f ′g by successive divi-sion with negative remainder. Denote by s the difference of the number of signchanges in the sequence T (a) and the number of sign changes in the sequenceT (b). Let n+ and n− be the number of different real roots of f in [a, b] at whichg is positive or negative, respectively. Then n+ − n− = s.

Note that in contrast to Sturm’s original theorem, f must be squarefree here.This is no problem, since one can simply replace an arbitrary polynomial f byits squarefree part f/ gcd(f, f ′). The sequence T is usually referred to as Sturm–Sylvester sequence. From the total number of real roots of f in [a, b] obtainedby Sturm’s theorem and the difference of numbers obtained by Sturm–Sylvesterone can easily obtain the number of real roots of f in the interval [a, b], where g ispositive or negative, respectively. By a little combinatorial trick, this procedurecan be extended to count the number of real roots of f , where finitely manyother real univariate polynomials have fixed signs. See [BKR86] for an efficientvariant of this trick.

Such a combinatorial extension of the Sturm–Sylvester theorem is the coreof the first real quantifier elimination procedure found by Tarski in the 1930’s,which remained unpublished until 1948 [Tar48]. Tarski’s procedure is very in-efficient, more precisely it is not even elementary recursive. It is described inSection 2.3.1.

Page 14: public pdf

14 CHAPTER 2. REAL QUANTIFIER ELIMINATION

In 1975, Collins introduced a new method called cylindrical algebraic decom-position (cad) [Col75], which is worst-case double exponential in the numberof variables. This was the first real quantifier elimination procedure ever im-plemented. A full implementation of cad within the computer algebra systemsac-2 [Col85] has been finished by Arnon in 1981 [Arn81]. In the past 20 yearsof research, cad has gone through numerous improvements [McC88, Hon90b,Hon90a, Hon92], resulting in partial cad [CH91] implemented in Hong’s qep-

cad program based on saclib [Hon90b, BCE+93], a C version of sac-2. Cad

is discussed in detail in Section 2.3.2.In 1988, it has been shown independently by Davenport and Heintz [DH88]

and Weispfenning [Wei88] that real quantifier elimination is inherently hard forsome problem classes. It is double exponential in the number of quantifier blocksand thus in the word length. Thus the attention turned to special proceduresfor restricted problem classes, where the elimination procedures can be tuned tothe structure of the problem. The focus was on considering formulas in whichthe occurrence of quantified variables is restricted to low degrees [Wei88, LW93,Hon93a, Hon93b, GV93, Wei94, Wei97b]. This was initiated by Weispfenning in1988 [Wei88]. In his virtual substitution method the number of parameters playsa minor role for the complexity. The worst-case complexity of the method is, incontrast to cad, double exponential only in the number of the quantifier blocksof the input formula. This makes the method attractive for problems containingmany parameters. It is implemented in the reduce package redlog [DS97b,DS99] by the author together with A. Dolzmann. The virtual substitutionmethod is discussed in Section 2.3.3. The redlog package is described inSection 2.6.

In 1993, Weispfenning introduced another complete elimination procedure[Wei93, Wei98] based on comprehensive Grobner bases [Wei92] in combinationwith multivariate real root counting [Wei92, BW94, PRS93]. The focus of themethod is on problems containing many equations. This procedure has beenimplemented in the package qerrc by Dolzmann within the computer algebrasystem mas [Dol94]. It is discussed in Section 2.3.4.

In 1992, Renegar published an impressing series of papers on the complexityof real quantifier elimination [Ren92]. He gave explicit asymptotically fast algo-rithms. In 1994, Basu et al. improved Renegar’s complexity bounds by giving aneven faster algorithm [BPR94]. There is currently no implementation of theseasymptotically fast algorithms. The question to what extent these methods areof practical relevance thus cannot be answered yet.

2.3 Real Quantifier Elimination Procedures

Our aim is to find necessary and sufficient conditions in terms of the parametersu1, . . . , um for the validity of the following prenex quantified first-order formula:

ϕ(u1, . . . , um) ≡ Q1x1 . . .Qnxnψ(u1, . . . , um, x1, . . . , xn), Qi ∈ {∃, ∀}.

2.3.1 The Tarski Procedure

This first known real quantifier elimination procedure has been discovered byTarski in 1930. Nine years later Tarski submitted an article under the title

Page 15: public pdf

2.3. REAL QUANTIFIER ELIMINATION PROCEDURES 15

The completeness of elementary algebra and geometry to a collection calledActualites scientifiques et industrielles. Due to the world war, this collectionnever appeared. In 1948, the rand Corporation became interested in Tarski’sresult and offered publication. For this purpose, the manuscript was overworkedby McKinsey, a friend of Tarski cooperating with the rand. This overworkedversion [Tar48] was much more algorithmic than the original article. In theintroduction of the second edition [Tar51, Tar98] Tarski commented this issueas follows:

“Within a few months the monograph was published. As was tobe expected, it reflected the specific interests which the rand Cor-poration found in the results. The decision method for elementaryalgebra and geometry—which is one of the main results of the work—was presented in a systematic and detailed way, thus bringing to thefore the possibility of constructing an actual decision machine.”

So the dream of implementing real quantifier elimination came into existence assoon as people realized the theoretical possibility. Needless to say that there wasno chance for a successful implementation at this time. In fact there a no recordson such a project at the rand (Anthony C. Hearn, private communication). Thecomplexity of Tarski’s procedure is not even elementary recursive.

We apply suitable cnf/dnf computations, use if necessary the equivalence∃xψ ←→ ¬∀x¬ψ, and rewrite all orderings by means of “=”and “>” to cometo a formula of the following form:

Q1x1 . . .Qk−1xk−1∃xk . . . ∃xn

(

f∈F

f(u,x) = 0 ∧∧

g∈G

g(u,x) > 0)

.

From this, we successively eliminate the quantifiers starting with the innermostexistential one. For the purpose of a comprehensible notation for the descrip-tion of the procedure, we rename xn to x, and we rename the outer quantifiedvariables x1, . . . , xn−1, which play the role of parameters for the procedure, toum+1, . . .um+n−1. Proceeding this way, we arrive at a subproblem ϕ∗ of thefollowing form:

ϕ(u)∗ ≡ ∃x(

f∈F

f(u, x) = 0 ∧∧

g∈G

g(u, x) > 0)

.

Note that both F and G are possibly empty.In case that F is empty, we construct redundant equations from the g > 0:

Fix the parameters u1, . . . , um+n−1 to real values a1, . . . , am+n−1, and supposethere is b ∈ R such that g(a, b) > 0 for all g ∈ G. Then one of the followingcases must hold:

(i) g(a, x) > 0 for all b 6 x ∈ R and all g ∈ G.

(ii) g(a, x) > 0 for all b > x ∈ R and all g ∈ G.

(iii) There are x1, x2 ∈ R and g1, g2 ∈ G such that x1 < x < x2 and g1(a, x1) =g2(a, x2) = 0. It follows that

g∈G

g(a, x1) =∏

g∈G

g(a, x2) = 0,

and by Rolle’s theorem there is x0 ∈ ]x1, x2[ such that ∂Q

G

∂x(a, x0) = 0.

Page 16: public pdf

16 CHAPTER 2. REAL QUANTIFIER ELIMINATION

The first two cases are recognized by inspection of the leading coefficients ofthe g ∈ G, and can be described by corresponding quantifier-free formulas. Inthe third case Rolle’s theorem provides a redundant equation. After writingthe case distinction down as a first-order formula, and then reapplying dnf

computation, we may wlog. assume that F is not empty.Next, it is easy to see that

f∈F f = 0 is equivalent to∑

f∈F f2 = 0, so we

can restrict our attention to a formula of the following form:

ϕ(u)∗∗ ≡ ∃x(

f(u, x) = 0 ∧∧

g∈G

g(u, x) > 0)

.

The case that G is empty can now be handled by a parametric version ofSturm’s theorem. For handling the general case by a corresponding parametricextension of Sturm–Sylvester, we have to reduce the conjunction

g∈G g > 0 ofordering inequalities to one such inequality. For doing so, we adopt the followingcrucial definition from Tarski.

Definition 2.5 (Precise Quantifier) Let k ∈ N. Then ∃kxϕ means thatthere are exactly k distinct real values of x that satisfy ϕ.

Since obviously ∃xϕ←→ ¬∃0xϕ, we can turn our attention from ϕ∗∗ to

ϕ(u)∗∗∗ ≡ ∃0x(

f(u, x) = 0 ∧∧

g∈G

g(u, x) > 0)

.

Our aim is to reduce this ϕ∗∗∗ to a form ∃kx(

f(u, x) = 0 ∧ g(u, x) > 0)

forsome k ∈ N. This is achieved by iteratively applying the following observationby Tarski, where two left hand sides g0 and g1 are isolated from G:

Theorem 2.6 The formula ψ ≡ ∃kx(χ ∧ g0 > 0 ∧ g1 > 0) is equivalent to thefollowing formula containing one less inequality in each of the three subformulas:

k=r1+r2−r3

2

(

∃r1x(χ ∧ g2

0g1 > 0) ∧ ∃r2x(χ ∧ g0g2

1 > 0) ∧ ∃r3x(χ ∧ g0g1 > 0)

)

.

Proof For fixed real parameter values consider the following numbers of satis-fying points of ψ and formulas derived from ψ:

n++ = |{x ∈ R | χ ∧ g0 > 0 ∧ g1 > 0}|n+− = |{x ∈ R | χ ∧ g0 > 0 ∧ g1 < 0}|n−+ = |{x ∈ R | χ ∧ g0 < 0 ∧ g1 > 0}|r1 = |{x ∈ R | χ ∧ g0g2

1 > 0}|r2 = |{x ∈ R | χ ∧ g2

0g1 > 0}|r3 = |{x ∈ R | χ ∧ g0g1 > 0}|.

Then it is easy to see that

r1 = n++ + n+−, r2 = n++ + n−+, r3 = n+− + n−+.

Solving for n++ we obtain

n++ =r1 + r2 − r3

2,

which straightforwardly implies the equivalence stated by the theorem.

Page 17: public pdf

2.3. REAL QUANTIFIER ELIMINATION PROCEDURES 17

We have finally arrived at a point, where we have to write down a quantifier-free equivalent for a formula with precise quantifier of the following form:

ϕ(u)∗∗∗∗ ≡ ∃kx(

f(u, x) = 0 ∧ g(u, x) > 0)

.

This can be done by parameterizing the Sturm–Sylvester theorem, where ap-propriate case distinctions on the signs and on the vanishing of the parametriccoefficients have to be introduced. These case distinctions finally yield thequantifier-free result.

2.3.2 Cylindrical Algebraic Decomposition

Cylindrical algebraic decomposition (cad) [Col75, ACM84] is the oldest andmost elaborate implemented real quantifier elimination method. It was devel-oped by Collins and his students starting in February 1973 [Col74]. Among hisnumerous Ph.D. students particularly Arnon [Arn81], McCallum [McC84], andHong [Hon90a, Hon90b, Hon92] made very significant contributions. In 1991Collins and Hong revised the method resulting in partial cad [CH91]. Hong hasimplemented partial cad in his program qepcad based on the computer alge-bra C-library saclib [Hon90b, BCE+93]. Compared to earlier implementationsof cad, qepcad shows a dramatically improved performance. Unfortunately,the program has until now remained unpublished. In this section, we sketch thepure, i.e. pre-partial, cad.

In cad, “decomposition” means partitioning real k-space into disjoint cellswith certain good properties.

Definition 2.7 (Sign invariant cell) Consider real k-space Rk. A cell is atriplet (C, δC , tC) with the following properties:

(i) C ⊆ Rk is connected.

(ii) δC(v1, . . . , vk) is a quantifier-free formula describing C, i.e, c ∈ C if andonly if δC(c) holds.

(iii) tC ∈ C is a test point for C given in such a way that for any polynomialf ∈ R[V1, . . . , Vk] the sign of f(tC) can be determined.

A cell (C, δC , tC) in Rk is called sign invariant for some finite set of polynomialsFk ⊆ R[V1, . . . , Vk], if each polynomial f ∈ Fk has constant sign for all c ∈ C.

Of course, not every subset of real k-space can be described by a formula. Dueto the existence of the formulas δC the cells are called semi-algebraic. Note thatthe computational claim on tC is by no means trivial.

Definition 2.8 (Sign invariant cell decomposition) A cell decompositionof real k-space Rk is a finite partition Dk into cells:

Dk = {(Ci, δCi, tCi

) | i ∈ Ik}, Ci ∩ Cj = ∅ for i 6= j,⋃

i∈Ik

Ci = Rk.

The decomposition Dk is sign invariant for some finite set Fk ⊆ R[V1, . . . , Vk]of polynomials, if each cell in Dk is sign invariant for Fk.

Page 18: public pdf

18 CHAPTER 2. REAL QUANTIFIER ELIMINATION

Example 2.9 Consider on the real line R the set F = {x2 − 4}. Then

D ={(

]−∞,−2[ , x < −2, −3)

,(

{−2}, x = −2, −2)

,(

]−2, 2[ , −2 < x ∧ x < 2, 0)

,(

{2}, x = 2, 2)

,(

]2,∞[ , 2 < x, 3)}

is a sign invariant cell decomposition for F .

Recall that we wish to construct necessary and sufficient conditions in u forthe validity of ϕ(u) ≡ Q1x1 . . .Qnxnψ(u,x). Let Dm+n be a cell decompositionof Rm+n that is sign invariant for the set of all polynomials occurring in ψ.Then ψ and thus ϕ will have constant truth value over each cell. Suppose thatDm is a cell decomposition of the parameter space Rm obtained from Dm+n

by successively abstracting from the quantified variables x1, . . . , xn. Then onecan use the knowledge of “true” cells for ψ and of the quantifier structure toderive from the quantifier-free descriptions δC of the cells in Dm a quantifier-freeequivalent of ϕ. The following definition states the connection between our Dm

and Dm+n more precisely.

Definition 2.10 (CAD) Consider the following first-order formula in n vari-ables and m parameters over the reals:

ϕ(u1, . . . , um) ≡ Q1x1 . . .Qnxnψ(u1, . . . , um, x1, . . . , xn), Qi ∈ {∃, ∀}.

Denote by F the set of polynomials occurring in ϕ. A cad for ϕ is a sequence(

D1, . . . ,Dm, (Dm+1,Q1), . . . , (Dm+n,Qn))

with the following properties:

(i) D1, . . . , Dm+n are cell decompositions of R, . . . , Rm+n, respectively.

(ii) Dm+n is sign invariant for F .

(iii) For k ∈ {1, . . . ,m+n− 1} the partition Dk consists exactly of the projec-tions of the cells in the partition Dk+1 along the coordinate of the k+1-stvariable. For each (C, δC , tC) ∈ Dk we can algorithmically determine thepreimage S(C, δC , tC) ⊆ Dk+1 under this projection.

The proof of the following theorem shows how to exploit a cad for the purposeof quantifier elimination. Note that of the given cad only the trailing part Dm,(Dm+1,Q1), . . . , (Dm+n,Qn) is actually used.

Theorem 2.11 (Quantifier elimination by CAD) Let ϕ be a first-orderformula over the reals. Given a cad for ϕ, we can eliminate the quantifiersfrom ϕ. That is, we can compute some quantifier-free formula ϕ′ such thatϕ′ ←→ ϕ.

Proof Let ϕ ≡ Q1x1 . . .Qnxnψ(u1, . . . , um, x1, . . . , xn), and let a cad for ϕ begiven as

(

D1, . . . ,Dm, (Dm+1,Q1), . . . , (Dm+n,Qn))

.Then Dm+n is sign invariant for the polynomials in ψ, and thus truth in-

variant for ψ. Moreover, for each cell (C, δC , tC) ∈ Dm+n the truth value of ψover C can be determined by evaluating the variable-free formula ψ(tC). A cell(C, δC , tC) ∈ Dm+n is called valid if ψ(tC) is “true.”

On this basis, we recursively define the validity of cells in Dm. The va-lidity of a cell (C, δC , tC) ∈ Dk is determined by considering its preimage

Page 19: public pdf

2.3. REAL QUANTIFIER ELIMINATION PROCEDURES 19

S(C, δC , tC) ⊆ Dk+1 under the corresponding projection. For m 6 k < m+ n,the decomposition Dk+1 occurs in the cad as (Dk+1,Qk+1) with Qk+1 ∈ {∃, ∀}.If Qk+1 = ∃, then (C, δC , tC) is valid if at least one cell in S(C) is valid. If, incontrast, Qk+1 = ∀, then (C, δC , tC) is valid if all cells in S(C) are valid.

It is now easy to see that a quantifier-free equivalent ϕ′ for ϕ is obtained asthe disjunction of all δC for which (C, δC , tC) ∈ Dm is valid.

We finally sketch how the sequence D1, . . . , Dm+n of cell decompositions isobtained from the set F of polynomials occurring in ϕ. This task splits into twophases:

Projection Phase Starting with Fm+n := F ⊆ R[u1, . . . , um, x1, . . . , xn] onesuccessively constructs sets of polynomials

Fm+n−1 ⊆ R[u1, . . . , um, x1, . . . , xn−2, xn−1],

Fm+n−2 ⊆ R[u1, . . . , um, x1, . . . , xn−2],

...

F1 ⊆ R[u1].

The projection phase is uniform for parameters and main variables. For conve-nience, we denote (u1, . . . , um, x1, . . . , xn) also by (V1, . . . , Vm+n). Technically,each Fk will contain certain coefficients, discriminants, resultants, and subre-sultant coefficients obtained from the polynomials in Fk+1 and their higherderivatives, regarded as univariate polynomials in their last variable Vk+1.

The resulting Fk satisfies the following condition: Consider a, b ∈ Rk suchthat for all f ′ ∈ Fk the signs of both f ′(a), f ′(b) ∈ R are equal. Then forall f ∈ Fk+1 the corresponding univariate polynomials f(a, Vk+1), f(b, Vk+1) ∈R[Vk+1] both have the same number of different real and complex roots.

This has the following important consequence: Let (C, δC , tC) be a signinvariant cell for Fk. For each f ∈ Fk+1 consider the functions i : C → R

assigning to a ∈ C the i-th real root of f(a, Vk+1) ∈ R[Vk+1]. Then all thesei are continuous. Moreover, the graphs of the various i do not intersect. Inother words, the order of the real roots does not change as they continuouslychange their position on the real line. In the cad framework they are calleddelineated. The step from Fk+1 to Fk is called a projection.

Construction Phase While the projection phase stepped from Rm+n downto R, the construction phase proceeds back from R to Rm+n. It starts with theconstruction of a cell decomposition D1 of the real line R that is sign invariantfor F1. For 1 6 k < m + n the cell decompositions Dk+1 of Rk+1, which aresign invariant for Fk+1 are successively constructed from Dk as follows.

Above each connected cell (C, δC , tC) in Dk the roots of all polynomialsin Fk+1 regarded as univariate polynomials in their last variable Vk+1 are de-lineated. They thus cut the cylinder above C into finitely many connectedsemi-algebraic segments. We take Dk+1 to consist of all such segments arisingfrom cylinders above the cells of Dk. The required test points in the new cellsare obtained by lifting the test points tC of the corresponding base cells in Dk

into the various cylinder segments. A quantifier-free description of each cell in

Page 20: public pdf

20 CHAPTER 2. REAL QUANTIFIER ELIMINATION

Dk+1 is constructed from the corresponding δC together with the polynomialsin Fk.

Note that this construction allows us to save the information which cellsin Dk+1 origin from which cell in Dk thus satisfying the requirement on thecomputability of the preimages in Definition 2.10 (iii).

2.3.3 Virtual Substitution of Test Points

The virtual substitution method dates back to a theoretical paper by Weispfen-ning in 1988 [Wei88]. Subsequently a lot of theoretical work has been done toimprove on one hand the method itself and on the other hand the simplifica-tion strategies for quantifier-free intermediate and final results [LW93, Wei94,DS97c, Wei97b]. After promising experimental implementations by Burhennein 1990 [Bur90] and by the author in 1992, the method has been much moreefficiently reimplemented within the reduce package redlog by the author to-gether with A. Dolzmann [DS97b, DS99]. This package is part of reduce 3.7.An alternative implementation in the C language based on the computer algebrasystem Risa/Asir [NT92] has been realized by the author in cooperation withthe Fujitsu Laboratories Japan [Stu96]. Finally, there are saclib-based par-allel implementations by the author together with A. Dolzmann and O. Gloor[DGS98].

The applicability of the method in the form described here and used through-out this thesis is restricted to formulas in which the quantified variables occur atmost quadratically. Moreover, as the method successively eliminates all quan-tifiers, the elimination of one quantifier can increase the degree of the otherquantified variables. So it is not generally clear by inspection of the quantifiedformula whether the implementation will succeed. All linear variables can how-ever definitely be eliminated. From a theoretical point of view the method canbe extended to arbitrary degrees [Wei94, Wei97b].

There have been various heuristic methods developed for decreasing the de-grees of the contained variables during elimination. One obvious example forsuch methods is polynomial factorization.

For eliminating the quantifiers from an input formula

ϕ(u1, . . . , um) ≡ Q1x1 . . .Qnxnψ(u1, . . . , um, x1, . . . , xn), Qi ∈ {∃, ∀}

the elimination starts with the innermost quantifier regarding the other quanti-fied variables within ψ as extra parameters. Universal quantifiers are handled bymeans of the equivalence ∀xψ ←→ ¬∃x¬ψ. We may thus restrict our attentionto a formula of the form

ϕ∗(u1, . . . , uk) ≡ ∃xψ∗(u1, . . . , uk, x),

where the um+1, . . . , uk are actually xi quantified from further outside.We fix real values a1, . . . , ak for the parameters u1, . . . , uk. Then all

polynomials occurring in ψ∗ become linear or quadratic univariate polynomialsin x with real coefficients. So the set

M = { b ∈ R | ψ∗(a1, . . . , ak, b) }

of all real values b of x satisfying ψ∗ is a finite union of closed, open, and half-open intervals on the real line. The endpoints of these intervals are among ±∞

Page 21: public pdf

2.3. REAL QUANTIFIER ELIMINATION PROCEDURES 21

together with the real zeroes of the linear and quadratic polynomials occurringin ψ∗. Candidate terms α1, . . . , αr for the zeroes can be computed uniformlyin u1, . . . , uk by the solution formulas for linear and quadratic equations.

If all inequalities in ψ∗ are weak, then all the intervals constituting M will,into each direction, be either unbounded or closed. In the latter case, such aninterval will contain its real endpoint. Thus M is non-empty if and only if thesubstitution of ±∞ or of one of the candidate solutions αj for x satisfies ψ∗.The substitution of ±∞ into a polynomial equation or inequality is evaluatedin the obvious sense. The substitution of expressions in u1, . . . , uk of the form(a + b

√c)/d among the αj can be rewritten in such a way that all denomi-

nators involving the ui and all square-root expressions are removed from theresult [Wei97b]. By disjunctively substituting all candidates into ψ∗ we obtaina quantifier-free formula equivalent to ∃xψ∗.

If ψ∗ contains also strict inequalities, we need to add to our candidates forpoints in M expressions of the form α ± ε, where α is candidate solution forsome left-hand side polynomial occurring in a strict inequality. The symbolε stands for a positive infinitesimal number. Again, the substitution of theseexpressions into a polynomial equation or inequality can be rewritten in sucha form that there occur neither denominators involving any of the ui, nor anysquare root expressions, nor the symbol ε in the result [Wei97b]. Again, thisyields a quantifier-free formula equivalent to ∃xψ∗. For practical applicationsthis method, of course, has to be refined by a careful selection of a smallernumber of candidate solutions and by a combination with powerful simplificationtechniques for quantifier-free formulas, see [DS97c] for details. The set of allpoints that finally have to be substituted is called an elimination set.

Recall that the well-known solution formula for quadratic equations

ax2 + bx+ c = 0

requires a 6= 0. In our situation a is a term in u1, . . . , uk, so a 6= 0 can ingeneral not be decided uniformly but depends on the interpretation of the ui.Thus a quadratic polynomial ax2 + bx+ c does not only deliver two square-rootexpressions α1 and α2 as candidate solutions but also α3 = −c/b, which in turnrequires b 6= 0. Let t1, t2, and t3 be the candidate points for M obtained fromα1, α2, and α3, respectively, by possibly adding or subtracting ε. With thesubstitution of all the ti into ψ∗, it is necessary to add the conditions on thenon-vanishing of a and b. Formally, we obtain

(

a 6= 0 ∧ ∆ > 0 ∧ (ψ∗[x/t1] ∨ ψ∗[x/t2]))

∨(

a = 0 ∧ b 6= 0 ∧ ψ∗[x/t3])

, (2.1)

where ∆ denotes the discriminant of the equation ax2 + bx+ c = 0. If, however,a is a rational constant, then the case distinction is superfluous. In particular,if a is non-zero, the second case can be dropped.

Suppose we have eliminated an existential quantifier. Then we have in gen-eral obtained a disjunction ψ′

1 ∨ · · · ∨ ψ′r. If the next quantifier to be eliminated

is also an existential one, then we make use of the equivalence

∃xn−1(ψ′1 ∨ · · · ∨ ψ′

r)←→ ∃xn−1(ψ′1) ∨ · · · ∨ ∃xn−1(ψ

′r)

eliminating all ∃xn−1(ψ′j) independently. As a consequence, no candidate solu-

tions obtained from, say, ψ′1 are substituted into the other ψj . This decreases

Page 22: public pdf

22 CHAPTER 2. REAL QUANTIFIER ELIMINATION

the complexity class of our procedure for single quantifier blocks from doubleexponential to single exponential in the number of quantifiers [Wei88].

Dramatic improvements of the general procedure sketched up to now can beobtained by reducing the number of test candidates for M depending on thestructure of the formula ψ∗ [LW93, Wei97b]. One simple instance for such animprovement is the following natural extension of Gauss elimination: Supposeψ∗ is of the form

bx+ c = 0 ∧ ψ∗∗,

where at least one of the coefficient terms b, c is a rational non-zero constant.Then we know that under any interpretation of the ui the equation is non-trivial,i.e. different from 0 = 0. Hence the only test candidate required is −c/b substi-tuted, of course, with the condition b 6= 0. No additional test candidates arisingfrom equations or inequalities in the remainder ψ∗∗ of ψ∗ need be considered.This idea can easily be extended to a quadratic equation instead of a linear one,taking into account again the discriminant. Ideas very similar to our extendedGauss elimination have independently been considered by Hong within the cad

framework [Hon93b].The notion of virtual substitution refers to both adding conditions and re-

solving non-standard subterms such as surds or infinitesimals. The complexityof this method depends on the number of quantified variables and, even more,on the number of quantifier changes. In theory, parameters play a minor rolefor the complexity. They turn in fact out to be very cheap in practice, too.

2.3.4 Parametric Real Root Counting

The method of parametric real root counting has been described by Weispfen-ning in 1993 [Wei93, Wei98]. Its basis is a theorem on root counting verymuch in the spirit of those discussed in Section 2.2 above. This beautiful andfar-reaching extension of a univariate theorem by Hermite (1853) [Her05] wasfound independently by Becker and Wormann [Bec91, BW94] on one hand andPedersen, Roy, and Szpirglas [Ped91, PRS93] on the other hand.

Theorem 2.12 (Becker and Wormann 1991, Pedersen et al. 1991)Let I ⊆ R[x1, . . . , xn] be a zero-dimensional ideal. For g ∈ R[x1, . . . , xn] con-sider the symmetric quadratic form Qg =

(

trace(mgbibj))

16i,j6don the lin-

ear R-space S = R[x1, . . . , xn]/I, where {b1, . . . , bd} ⊆ S is a basis, and themh : S → S are linear maps defined by mh(f + I) = (hf) + I. Let s be thesignature of Qg, and denote by n+ and n− the number of real roots of I at whichg is positive or negative, respectively. Then n+ − n− = s.

The use of a Grobner basis of the ideal I allows to obtain a basis of S, and toperform arithmetic there [Buc65], thus obtaining the matrix Qg.

Similar to the Sturm–Sylvester theorem, this approach can be extended toobtain the exact number of roots under a side condition, and can be moreoverextended to several side conditions:

Theorem 2.13 Let F , {g1, . . . , gk} ⊆ R[x1, . . . , xn] be finite, and assume thatI = Id(F ) is zero-dimensional. Denote by N the number of real roots a ∈ Rn ofF for which gi > 0 for 1 6 i 6 k. Define

Γ({g1, . . . , gk}) = { ge1

1 · · · gek

k | (e1, . . . , ek) ∈ {1, 2}k }.

Page 23: public pdf

2.3. REAL QUANTIFIER ELIMINATION PROCEDURES 23

Then defining Qg as above we have 2kN =∑

γ∈Γ({g1,...,gk}) sig(Qγ).

For real quantifier elimination, this root counting has to be further extendedto multivariate polynomials with parametric coefficients in such a way thatit will remain correct for every real specialization of the parameters includingspecializations to zero. This task has been carried out by Weispfenning usingcomprehensive Grobner bases, [Wei92, Wei93, Wei98]. It has been improvedand implemented within the package qerrc of the computer algebra systemmas by Dolzmann [Dol94].

For eliminating the quantifiers from our arbitrary input formula

ϕ(u1, . . . , um) ≡ Q1x1 . . .Qnxnψ(u1, . . . , um, x1, . . . , xn), Qi ∈ {∃, ∀}.

we proceed as with the Tarski method (see Section 2.3.1) to arrive at a anequivalent formula of the following form, where F is wlog. non-empty:

ϕ(u)∗ ≡ Q1x1 . . .Qk−1xk−1∃xk . . .∃xn

(

f∈F

f(u,x) = 0 ∧∧

g∈G

g(u,x) > 0)

.

While the Tarski method focussed on the innermost quantifier, we focus here onthe entire innermost existential quantifier block. The relevant subproblem tobe discussed is thus the following one, where we have for convenience renamedthe quantified variables x1, . . . , xk−1 of the outer blocks to um+1, . . . , um+k−1:

ϕ(u)∗∗ ≡ ∃xk . . .∃xn

(

f∈F

f(u,x) = 0 ∧∧

g∈G

g(u,x) > 0)

.

As the first new step compared to Tarski’s procedure, we compute a Grobnersystem [Wei92] of F . Such a system is of the form

{(

ψ1(u), F1(u,x))

, . . . ,(

ψr(u), Fr(u,x))}

such that whenever ψi(a) holds for a ∈ Rm, then Fi(a,x) is a Grobner basis of{f1(a,x), . . . , fk(a,x)} ⊆ R[x]. In addition, there holds F1, . . . , Fr ⊆ Id(F ).On the formula level this corresponds to passing from ϕ∗∗ to the equivalentformula

ϕ∗∗∗(u) ≡r

i=1

(

ψi(u) ∧ ∃xk . . . ∃xn

(

f∈Fi

f(u,x) = 0 ∧∧

g∈G

g(u,x) > 0))

.

At this point, we restrict our attention to quantifier elimination for a singlebranch

ϕ∗∗∗i (u) ≡ ψi(u) ∧ ∃xk . . . ∃xn

(

f∈Fi

f(u,x) = 0 ∧∧

g∈G

g(u,x) > 0)

of the disjunction ϕ∗∗∗. Note that the condition ψi ensures that Fi is a Grobnerbasis of Id(F ) if ϕ∗∗∗

i holds, and that in this case we know the head terms ofthe polynomials in Fi, which are uniformly determined. We thus can uniformlydetermine the dimension of Id(Fi).

Let us for the moment assume that this dimension is zero. Then we candetermine for γ ∈ Γ(G) the matrices Qγ of Theorem 2.13. In contrast to the

Page 24: public pdf

24 CHAPTER 2. REAL QUANTIFIER ELIMINATION

situation of the theorem, however, the matrix elements are not real numbersbut polynomials in u1, . . . , um+k−1.

For a univariate polynomial p denote by τ(p) the number of positive realroots of p minus the number of negative real roots of p counting multiplicities.For quadratic forms Q it is well-known that sig(Q) = τ(χQ). Moreover, we havethat

γ∈Γ(Gi)

τ(χQγ) = τ

(

γ∈Γ(Gi)

χQγ

)

reducing the computation of the sum of signatures to that of τ(∏

χQγ) for

a single univariate polynomial∏

χQγwhich has only real roots. We have to

construct a quantifier-free formula stating that τ(∏

χQγ) 6= 0. This can be

done by applying Descartes’ rule of signs discussed in Section 2.2 to all possiblecombinations of signs of the coefficients of

χQγ.

It remains to be clarified how to proceed in the case that Id(Gi) has adimension greater than zero: We then compute, uniformly in u1, . . . , um, amaximally independent set Y ⊆ {xk, . . . , xn}. Since the elimination ideal ofId(Gi) wrt. {xk, . . . , xn}\Y is zero-dimensional, we can eliminate all quantifiers∃xi for xi /∈ Y considering all xj ∈ Y as additional parameters.

In the procedure above, it can happen that already Y = {xk, . . . , xn}. Thatis, there is no non-trivial equation under the condition ψi. It is, however, alwayspossible to replace ϕ∗∗∗

i by an equivalent formula

ϕ∗∗∗∗i (u) ≡

j

(

ψi(u) ∧ ∃xk . . . ∃xn

(

aj(u,x) = 0 ∧∧

g∈G

g(u,x) > 0))

such that restarting the whole elimination procedure on ϕ∗∗∗∗i , we can eliminate

at least one quantifier in the next step.Introducing several sophisticated modifications, Dolzmann has improved the

practical complexity of this method considerably. First, it is not necessaryto consider all permutations of signs of coefficients of

χQγ. Furthermore,

inequalities g 6= 0 can be treated much more efficiently than by coding them asg > 0 ∨ −g > 0 or g2 > 0. See [Dol94] for details.

Like cad, this approach is a general real quantifier elimination procedure.In practice a successful application requires that the system of equations in theinput is globally zero-dimensional, i.e. zero-dimensional for all real parametervalues. Moreover there should be at most one order side condition. This classof inputs is nevertheless mathematically quite interesting and comprises e.g.most implicitization problems for parametric real varieties. Similar to the virtualsubstitution method, the number of parameters plays a minor role for complexitycompared to that of the quantified variables.

2.4 Variants of Quantifier Elimination

This section describes two variants of quantifier elimination in the frameworkof the virtual substitution method. Extended quantifier elimination differs fromregular quantifier elimination by providing some extra information. Genericquantifier elimination, in contrast, weakens the notion of quantifier elimina-tion by providing a result that is only valid under certain assumptions. Theseassumptions are, however, also explicitly provided by the generic quantifier elim-ination procedure.

Page 25: public pdf

2.4. VARIANTS OF QUANTIFIER ELIMINATION 25

2.4.1 Extended Quantifier Elimination

Roughly speaking, extended quantifier elimination differs from regular quantifierelimination by the fact that the procedure provides—besides a quantifier-freeequivalent to the input formula—sample parametric answers for values of thevariables in the outermost quantifier block. In the most frequent case of a purelyexistential input formula extended quantifier elimination can be construed asparametric constraint solving.

Recall from the description of the virtual substitution method in Section2.3.3 that the result of the elimination for a block of existential quantifiers isobtained by disjunctively substituting certain test terms. It can be declarativelydescribed as

∃x1 · · · ∃xkψ(u)←→∨

(t1,...tk)∈T (u)

ψ[x1/t1, . . . , xk/tk](u),

where the set T is a set of terms only in the parameters possibly involving surds,±∞, and ±ε. This set T can be obtained by keeping track of the successivesubstitutions for the various variables xk, . . . , x1 and then performing back-substitution.

Since the elimination of universal quantifiers is reduced to that of existentialones via double negation, the elimination result for this case looks analogouslyas follows:

∀x1 · · · ∀xkψ(u)←→∧

(t1,...tk)∈T (u)

ψ[x1/t1, . . . , xk/tk](u).

Extended quantifier elimination will first eliminate all inner variable blocksin the regular manner. For the outermost block, it will, in contrast, constructthe set T and output—instead of the quantifier-free equivalent—a scheme ofthe following form:

ψ[

x1/t(1)1 , . . . , xk/t

(1)k

] {

x1 = t(1)1 , . . . , xk = t

(1)k

}

......

ψ[

x1/t(|T |)1 , . . . , xk/t

(|T |)k

] {

x1 = t(|T |)1 , . . . , xk = t

(|T |)k

}

.

The semantics of this scheme depends on the nature of the outermost quanti-fier block. For an ∃-block, the disjunction over the left column is obviously aquantifier-free equivalent for the input formula. Moreover, we can assert thefollowing for fixed real values of the parameters u1, . . . , um: All the formulasin the left column are either “true” or “false.” If any of them is “true,” thenthe original quantified formula is “true” for our choice of parameters, and thecorresponding right hand side entry in the scheme is one satisfying point.

The case of an ∀-block is dual to this: Here, the conjunction over the leftcolumn is a quantifier-free equivalent for the input formula. Whenever for fixedparameters one of the left hand side entries is “false,” then the original quantifiedformula is “false,” and the corresponding right hand side entry provides onecounterexample against its satisfiability for the chosen parameter values.

We have already mentioned that the sample points ti can—besides surds—include the symbols ∞ and ε. The former has to be read as “a real number x0

such all x > x0 satisfy ψ.” In an analogous way, ε stands for a “small enough”

Page 26: public pdf

26 CHAPTER 2. REAL QUANTIFIER ELIMINATION

positive real. Unfortunately, nothing can be said about the order between sev-eral non-standard symbols in the output. For identifying equal non-standardsymbols after resubstitution, all such symbols are indexed ε1, ε2, . . . and ∞1,∞2, . . . , respectively.

2.4.2 Generic Quantifier Elimination

Generic quantifier elimination is a variant of the virtual substitution method de-veloped by the author for geometric theorem proving. It has been first publishedin 1996 [DSW98a]. Meanwhile, it has turned out that this variant is extremelysuitable also for engineering applications [Stu99]. Generic quantifier elimina-tion generates, besides a quantifier-free formula, additional assumptions in theform of negated equations stating that certain expressions in the parameters arenon-zero.

We have seen in Section 2.3.3 that such assumptions can avoid case dis-tinctions on the vanishing of parametric head coefficients. Consider quadraticpolynomial ax2 + bx+ c, where the term a does involve some of the parametersu1, . . . , um but not any of the other quantified variables x1, . . . , xn. Let α1

and α2 by solutions of the corresponding quadratic equations according to thesolution formula, and let t1 and t2 be corresponding candidate points obtainedfrom α1 and α2 by possibly adding or subtracting an infinitesimal ε. Then in-stead of the case distinction in Formula (2.1) on page 21, we simply producethe much simpler formula

∆ > 0 ∧ (ψ∗[x/t1] ∨ ψ∗[x/t2]),

which ignores the case that a might be zero for certain interpretations of theparameters, plus an external assumption a 6= 0.

Intermediate simplification might now equivalently replace a discriminantcondition ∆(u1, . . . , um) > 0 in the parameters by an equation ∆′(u1, . . . , um) =0. For instance, −f(u1, . . . , um)2 > 0 is equivalent to f(u1, . . . , um) = 0. Thisequation is then treated in the same way as the coefficient conditions above.That is, the entire case is dropped in favor of an additional external assumption∆(u1, . . . , um) 6= 0 in the parameters.

Non-zeroness assumptions on the parameters can also enable the Gauss elim-inations discussed in Section 2.3.3. When there is ∃x to be eliminated from aformula bx+ c = 0 ∧ ψ∗∗ but none of the coefficients b, c is a non-zero rationalconstant, then there is checked whether any of these coefficients is a polynomialonly in the parameters u1, . . . , um. If so, say b does not contain any quantifiedvariable, we add b 6= 0 to our assumptions, and then perform Gauss elimination.For quadratic equations we proceed analogously.

There are situations where we have to decide between a linear Gauss elimi-nation with a non-zero assumption on a coefficient and a quadratic one withoutsuch an assumption. Consider for instance the formula

∃x2∃x1

(

ux1 + x2 = 0 ∧ x21 + x2x1 + u = 0 ∧ ψ∗∗(x1, x2, u)

)

.

In spite of the necessary assumption u 6= 0 we then prefer the linear Gaussapplication for the elimination of x1 because the quadratic equation would pro-duce square root expressions the substitution of which into ψ1 may increase thedegree of x2.

Page 27: public pdf

2.5. SIMPLIFICATION STRATEGIES 27

Consider a possible Gauss application with assumption for a variable x,where there are several coefficients that can be assumed to be non-zero. Wethen select the coefficient belonging to the highest power of x. It is not hard tosee that this option saves conditions or cases in the corresponding substitution.

Note that all assumptions ever made have the form of negated equations.That is, our set of automatic assumptions cannot become inconsistent. More-over we only neglect a set of parameter values of measure zero. In practice, itturns out that in most cases the assumptions made are reasonable and inter-pretable. For a detailed discussion of the nature of such subsidiary conditions,see Chapter 3. As an option, we can restrict the set of allowed assumptionsto those being of the form

i uei

i 6= 0, which is equivalent to∧

i ui 6= 0. Thisis typically used to avoid subsidiary conditions that cannot be interpreted. Agood example for this feature is given in the following chapter by Example 3.20on page 69.

Before making an assumption, there is checked whether the desired non-zeroness can be derived from the assumptions already made before. Theoreti-cally this can be done by decision via quantifier elimination. In practice, there isinstead a heuristic test applied, which is based on the simplifier, see [DS97c] fordetails. With this setting, it is straightforward to specify that generic quantifierelimination allows a collection of assumptions, which are atomic formulas butnot necessarily restricted to negated equations, already as input theory. Thisinput theory is then extended by the procedure. This feature should, however,be used with caution: Although we have argued that the set of automatic as-sumptions cannot become inconsistent, it can, of course, contradict the set ofconstraints in the input theory. If this happens, the elimination result becomesmeaningless.

Definition 2.14 (Theory) A theory ϑ(u) is a conjunction of atomic formulasconsidered to hold. Given two theories ϑ(u) and ϑ′(u), we say that ϑ′ extendsϑ if ∀u1 . . . ∀um

(

ϑ′(u1, . . . , um) −→ ϑ(u1, . . . , um))

.

Definition 2.15 (Generic quantifier elimination) Generic quantifier elim-ination expects a quantified input formula ϕ(u) ≡ Q1x1 . . .Qnxnψ(u,x) andoptionally an input theory ϑ(u), where ϑ ≡ true by default. The output con-sists of a quantifier-free formula ϕ′(u) and an extended theory ϑ′(u). This ϑ′

is obtained from ϑ by conjunctively adding negated equations. It implies thecorrectness of the elimination result ϕ′ over the reals:

∀u1 . . . ∀um

(

ϑ′(u1, . . . , um) −→ (ϕ(u1, . . . , um)←→ ϕ′(u1, . . . , um)))

.

Note that we cannot and do not make any assumptions on the quantifiedvariables x1, . . . , xn. For illustrating examples on generic quantifier eliminationby virtual substitution see Section 3.7.

2.5 Simplification Strategies

From the discussion of the virtual substitution method in Section 2.3.3, it isobvious that powerful simplification methods are crucial for the successful ap-plication of this method. Simplification of formulas over the reals have beendiscussed in detail in [DS97c].

Page 28: public pdf

28 CHAPTER 2. REAL QUANTIFIER ELIMINATION

One generally has to distinguish between two types of such simplifiers:

1. A fast simplifier doing the rough work. This should be efficient enoughto be frequently applied to intermediate results during the eliminationprocess. The redlog system described in the following section includessuch a simplifier, which has been discussed in detail in [DS97c]. It isusually referred to as the standard simplifier.

2. Various dedicated special-purpose simplifiers that are used to increasedthe quality of the final result. Here, efficiency is only a secondary issue.

One prominent example for a sophisticated simplifier of the second kind isthe Grobner simplifier introduced in [DS97c]. Since it plays an important rolefor the examples discussed throughout this thesis, we are going to sketch theprinciple ideas behind it by means of a simple example.

Example 2.16 (Grobner simplification) Consider the disjunction xy−1 6=0 ∨ yz − 1 6= 0 ∨ x− z = 0. This can be rewritten as an implication:

xy − 1 = 0 ∧ yz − 1 = 0 −→ x− z = 0.

Reducing x − z modulo a Grobner basis {yz − 1, x − z} of the left hand sidepolynomials {xy − 1, yz − 1}, the right hand side equation and thus the entireformula can be simplified to “true.”

Grobner bases have been introduced by Buchberger [Buc65], for details onGrobner basis theory see e.g. [BWK93]. The exact Grobner simplification al-gorithm has been described in [DS97c]. Note that it can be applied to generalquantifier-free formulas over the reals by computing a cnf and then treatingthe contained disjunctions independently. There is also a dual variant applica-ble to conjunctions and thus to dnf’s. The Grobner simplifier implementationin redlog includes strategies for automatic decision between cnf and dnf

computation.

2.6 The REDLOG Computer Logic System

Based on experimental implementations beginning 1992, the author started therealization of redlog in early 1994. In April 1995, the system has been re-designed by the author together with A. Dolzmann [DS97b], who from then onparticipated to same parts in the realization of redlog. redlog 1.0 [DS96]has been published on the Web in October 1996. This first redlog distributionwas a great success. In October 1996 both the author and A. Dolzmann joinedthe reduce development group such that redlog is now developed not as aseparate contributed package but as part the reduce system itself. The currentversion redlog 2.0 [DS99] is part of the distribution of reduce 3.7 issued inApril 1999.

redlog is widely accepted inside the scientific community. For applicationsof redlog inside mathematics and computer science see e.g. [ADY+96, DYA97,HLS97, KW, LPY99], for applications in mechanics see [Ioa99].

The following description of the redlog system supposes that the PortableStandard Lisp (psl) version of reduce is used. For the Cambridge StandardLisp (csl) version, some details are slightly different.

Page 29: public pdf

2.6. THE REDLOG COMPUTER LOGIC SYSTEM 29

2.6.1 Overview

redlog stands for “reduce logic” system. It provides an extension of thecomputer algebra system reduce to a computer logic system implementingsymbolic algorithms on first-order formulas wrt. temporarily fixed first-orderlanguages and theories. Underlying theories currently available are

1. algebraically closed fields (“complex numbers”)

2. real closed fields (“real numbers with order”)

3. discretely valued fields (“p-adic numbers”).

redlog origins from the implementation of real quantifier elimination byvirtual substitution. Successfully applying such methods to both academic andreal-world problems, the authors have developed a large collection of formula-manipulating tools, many of which are meanwhile interesting in their own right:

• Numerous tools for comfortably inputing, decomposing, and analyzingformulas.

• Several techniques for the logical and algebraic simplification of formulas.

• Various normal form computations.

• Quantifier elimination by virtual substitution.

• Generic quantifier elimination by virtual substitution.

• Extended (generic) quantifier elimination by virtual substitution.

• An interface to Hong’s qepcad implementing partial cylindrical algebraicdecomposition.

• An interface to Dolzmann’s qerrc implementing quantifier eliminationby parametric real root counting.

• Linear optimization techniques based on quantifier elimination.

2.6.2 From Computer Algebra to Computer Logic

The aim of redlog is to make quantifier elimination procedures available forsolving practical problems in various application areas, in particular in mathe-matics, physics, and engineering. The decision for taking an existing computeralgebra system like reduce as basis has the following advantages compared toa completely new implementation:

• A computer logic system user interface requires no concepts that go be-yond that of computer algebra system interfaces. Hence there is no reasonfor spending time designing and implementing yet another interface. Inaddition, the large community of reduce users has quickly become famil-iar with redlog.

• The underlying system provides a reliable well-tested implementation ofpolynomials, which can serve as first-order terms in many languages. Inaddition, there is a large library of up-to-date algebraic algorithms avail-able.

Page 30: public pdf

30 CHAPTER 2. REAL QUANTIFIER ELIMINATION

• There is no need for portability considerations. The system will simplyrun on the large variety of architectures and operation systems to whichreduce is ported.

On the other hand, the underlying computer algebra system itself can benefitfrom the implementation of first-order formulas and corresponding algorithms.On example for this is the implementation of guarded expressions [DS97a]. An-other possible application is with the widespread solve operator for solvingsystems of equations and, possibly, inequalities. These solutions to such sys-tems can be conjunctions as for x2 < 25, disjunctions as for x2 > 25, or morecomplicated formulas. The solutions are typically given as nested lists encodingdnf’s. Here, the use of formulas would be much more natural. At this point,one should mention that mathematica actually offers the option for printingthe result as formula. Except for distributive expansion, there are, however, noalgorithms operating on these formulas available [Wol96].

2.6.3 A User’s View on the System

reduce know two modes : the algebraic mode, which provides the user frontend,and the symbolic mode, which provides the application programming interface.The symbolic mode is essentially a Lisp system within which the major part ofthe reduce functions is implemented. We first focus on the algebraic mode useof redlog.

2.6.3.1 Contexts

As a first step when working with redlog, a context has to be selected. Thiscontext determines a language and a theory in the sense of first-order logic. Allcomputations are performed wrt. the selected context until a different decisionis made.

When the context is changed, formulas produced in the old context canbecome invalid, but they need not. Certain formulas of the old context may stillbe meaningful in the new context. Consider for instance a formula producedin an ordered field context: If it happens to contain no ordering relation at all,then it can be reused within the algebraically closed fields context. Necessaryconversions of its internal representation are applied implicitly and invisible forthe user.

After fixing the context, the reduce functionality is extended in two ways:

1. In addition to the built-in data types such as rational functions or matri-ces, one can input first-order formulas over the language specified by theselected context.

2. There are new procedures available that apply to these first-order formu-las.

In the sequel, we assume that the ordered field context “ofsf” has been selected.It knows the binary predicates “=,” “ 6=,” “6,” “>,” “<,” and “>.”

2.6.3.2 Expressions

redlog extends the look-and-feel of reduce to first-order formulas. Invalidexpressions are detected, and appropriate error messages are given.

Page 31: public pdf

2.6. THE REDLOG COMPUTER LOGIC SYSTEM 31

The format for the truth values, quantifiers, and propositional connectivesis specified uniformly for all contexts. Besides the reserved identifiers true andfalse, there are the following operators: a unary not, binary infix impl, repl,equiv, and n-ary infix and, or. Binary prefix operators ex and all serve asquantifiers. Their first argument is a variable, and their second argument is aformula.

In general, all atomic formulas are constructed with operators that are con-sidered as predicates. Here again infix operators are possible. It is left to thecontext to determine which predicates are known and what the terms are. Fur-thermore, a context can impose some extra restrictions on the form of the atomicformulas. Consider for instance ofsf: The known predicates given at the endof the last subsection can all be written infix. Terms are polynomials over theintegers. As an additional restriction, all right hand sides of the predicates mustbe zero.

The handling of the input is much more liberal than the specification of validexpressions. For the easy input of large systematic conjunctions and disjunctionsthere are special for-loops available. With the quantifiers ex and all, the firstargument may be a list of variables. In ofsf the input may contain rationalcoefficients and non-zero right hand sides. Furthermore, ofsf allows the input ofchains such as a<>b<c>d=f, which is turned into a-b<>0 and b-c<0 and c-d>0

and d-f=0. Here, only adjacent terms are considered to be related. With allthese input facilities, the input is implicitly converted to expressions matchingthe specification of the current context.

2.6.3.3 Simplification vs. Evaluation

Polynomials and rational functions entered into reduce are automatically con-verted into some canonical form. Canonical means that expressions that aremathematically equal are converted into syntactically equal forms. We refer tothis conversion as evaluation.

The natural extension of evaluation to first-order formulas would be con-verting equivalent formulas into syntactically equal forms. This is impossible,in general, since in non-recursive structures there is no algorithm convertingsentences that hold into true. Even in most recursive structures it is by nomeans obvious, how to obtain suitable canonical forms for formulas containingfree variables. Moreover, one would require for such normal forms that they areuser-friendly and fast to compute.

Instead of evaluation, we use the weaker concept of simplification as dis-cussed in Section 2.5. That is, we optionally replace formulas by equivalentsthat are more user-friendly though not canonical.

Similar to most other computer algebra systems, reduce interpreter vari-ables are identified with the transcendental elements occurring in rational func-tions. With first-order formulas such an identification leads to problems, sincefor many contexts the terms included in the first-order formulas will be imple-mented as rational functions or some suitable subset. One would certainly liketo as usual identify the indeterminates occurring inside these terms with theinterface variables. If, however, such an indeterminate is quantified within afirst-order formula, then any assignment of a non-indeterminate rational func-tion to it violates the well-formedness of this formula. The problem of expres-sions becoming ill-formed due to subsequent assignments is not really new: This

Page 32: public pdf

32 CHAPTER 2. REAL QUANTIFIER ELIMINATION

also happens with the rational function 1/x when assigning x := 0. To avoidconfusion, we invalidate a formula in case of any assignment to a quantifiedvariable even if the assigned expression is another variable.

A similar problem arises from the fact that interpreter variables interpretedas indeterminates are valid rational functions, but they are, in contrast, notvalid formulas. Hence the user is not allowed to enter things like

f := ex(x,g); g := x>0;

such that afterwards f be evaluated to ex(x,x>0). It is, however, possible toinput the above statements in reverse order. Note: The expansion of inter-preter variables should not be confused with substitution, which is, of course,implemented for arbitrary quantified formulas meeting the usual mathematicalspecifications.

2.6.3.4 Procedures

In order to avoid name conflicts, all redlog procedures and switches availablein the algebraic mode are prefixed by rl. The procedure names are to beunderstood declaratively, e.g., rlqe stands for “apply the default procedure forquantifier elimination.” The algorithm actually applied depends on the selectedcontext. This pattern makes redlog easy to learn. Moreover, it allows tocombine procedure calls to new algebraic mode procedures that do not dependon the context.

As usual in reduce we have a fairly liberal syntax including optional argu-ments with default values, procedures expecting either an expression of a certaintype or a list of such expressions. Most of the redlog algorithms offer numer-ous options. Options are selected by setting corresponding switches, which areglobal boolean values selected by the commands on and off. The return valuesof the redlog procedures are designed to cooperate with the standard re-

duce. Extended quantifier elimination, for instance, returns the coordinates ofeach sample points as a list of equations because there are numerous built-inalgorithms that operate on such lists.

Some procedures provide the option to protocol the progress of the compu-tation onto the screen. We refer to this as verbosity output. In future versionsthere might be different levels of such output. It is specified, however, that thereis one switch, namely rlverbose, by which all verbosity output can be turnedoff.

2.6.4 An Implementor’s View on the System

redlog is implemented in the symbolic mode of reduce. The language thereis the Lisp dialect rlisp, which is compiled to native machine code. The modulestructure of redlog is pictured in Figure 2.1.

2.6.4.1 The Algebraic Mode Interface

The algebraic mode interface implements the user frontend described in theprevious Section 2.6.3. It performs all necessary conversion into the internal,i.e. symbolic mode, representation, and includes error checking. It furthermorehandles optional parameters including the substitution of default values where

Page 33: public pdf

2.6. THE REDLOG COMPUTER LOGIC SYSTEM 33

general access

Symbols: calls

ofsf cl dvfsf

Constructors/Access Functions (non-atomic)

Reduce Kernel and Other Packages

Tools

Black Box Scheduler

Algebraic Mode Interface (Algebraic Mode Entry Point)

Service Scheduler (Symbolic Mode Entry Point)

Figure 2.1: The module structure of redlog with the context ofsf active.Dotted arrows indicate alternative calls with dvfsf active.

Page 34: public pdf

34 CHAPTER 2. REAL QUANTIFIER ELIMINATION

necessary. Algebraic mode procedure calls are translated to calling the corre-sponding symbolic mode entry points with correct input parameters.

At every formula there is a context tag which is the context identifier of thecontext the formula has been created in. Comparing the context tag with thecurrent context identifier enables the automatic conversion mentioned in theparagraph on contexts above. Besides the conversion of the user input, whichappears as Lisp prefix, and the conversion of formulas from foreign contexts,there are equations to be converted to logicals, i.e. formulas, and vice versa.Due a very special role that equations play in reduce, the algebraic modeinterface accepts and returns equations wherever possible. The symbolic modeentry points, in contrast, insist on logicals.

2.6.4.2 Formula Representation

In Lisp-based systems there is a straightforward way to represent terms in thesense of universal algebra: The prefix term representation ω(n)(t1, . . . , tn) ofa term with operator symbol ω of arity n and argument terms t1, . . . , tn ismapped to a list by the Lisp prefix representation Λ, which is recursively definedas follows:

Λ(ω(0)) = ω

Λ(

ω(n)(t1, . . . , tn))

=(

ω,Λ(t1), . . . ,Λ(tn))

for n > 0.

This representation corresponds in a beautiful manner to the internal repre-sentation of the Lisp language itself. It is thus extremely natural and easy toprocess. On the other hand, Lisp prefix has turned out to be both time andspace consuming for representing terms describing arithmetic such as polynomi-als or rational functions. For such data, more efficient Lisp representations haveevolved. In reduce this is namely standard forms for polynomials and standardquotients for rational functions. A multivariate polynomial f ∈ Z[X1, . . . , Xn]is represented as a standard form Φ(f) as follows:

Φ(0) = nil

Φ(z) = z for z ∈ Z \ {0}

Φ( k

i=0

fiXin

)

=(

(

(Xn . k) . Φ(fk))

. Φ(k−1

i=0

fiXin

))

,

where f0, . . . , fk ∈ Z[X1, . . . , Xn−1] and wlog. fk 6= 0. The dot “.” denotes theusual cons operation on Lisp cells. The standard form representation requiresan internal ordering on the variables. For a fixed such ordering it is unique. Thestandard quotient representation of a rational function p/q ∈ Z(X1, . . . , Xn) isdefined as

(

Φ(p) . Φ(q))

.The non-atomic part of the redlog formulas is kept as Lisp prefix. The same

holds for the toplevel structure of the atomic formulas. The term representation,in contrast, depends on the context. The quantified variables occurring as firstargument to the quantifiers are always represented as identifiers. In the orderedfield context ofsf the terms are kept as standard forms, which explains its nameordered field standard form. Note that the representation of a term consistingof a single variable is here different from the representation of that variable asargument to a quantifier: for the variable x we have, e.g.,

(

(x . 1) . nil)

vs. x.

Page 35: public pdf

2.6. THE REDLOG COMPUTER LOGIC SYSTEM 35

The Lisp prefix specification of the non-atomic part is hidden via construc-tors and access functions. Any direct access to formulas via Lisp operations isprohibited. The same applies to the atomic formulas in the various contexts.

2.6.4.3 The Common Logic Module

The common logic module cl contains code that operates on first order formulaswithout making any assumption about the current context. It contains threetypes of procedures. First, there are procedures that need not know the contextas for instance cl atnum, which given a first-order formula counts the numberof atomic formulas contained in it. This works because every formula that doesnot have a quantifier or a known propositional connective as top-level operatoris classified as an atomic formula.

Second there are procedures that split into a general and context depen-dent subtasks. For instance, when simplifying formulas there are general rulessuch as deleting false from disjunctions or replacing disjunctions that containtrue by the latter. On the other hand, one would design a simplifier also toreplace certain atomic formulas by simpler equivalents according to rules thatdepend on the context. In this situation, the general techniques are desirablefor many contexts. There are several reasons for implementing them only once,and parameterizing them in some way with context dependent subalgorithms:

• New contexts can be implemented faster and safer, thus saving time forredeveloping and debugging the first-order parts of the algorithms.

• All contexts will immediately profit from future algorithmic extensionsand tuning of the general parts.

We say that cl uses black boxes for the context dependent tasks, and, accord-ingly, we denote the code addressed by a black box as black box implementation.Note that there can be several generic implementations for the same task cor-responding to several sets of contexts.

Local operations on atomic formulas are not the only reason for introducingblack boxes. Consider, for instance, the following simplification for orderedfields: x > 0 ∧ x > 1 becomes x > 1. Though obviously context dependent,this applies to a non-atomic formula.

Some black box implementations of this latter kind are simply smarter vari-ants of context independent counterparts, such as recognizing syntactically equalatomic formulas in our particular example. All contexts for which there is nosmarter version use the context independent variant implemented within cl.This leads to the existence of context independent black box implementationsas a third group of cl procedures. Whenever a black box implementation isrequired, cl calls the black box scheduler.

2.6.4.4 The Black Box Scheduler

The black box scheduler knows the current context. It performs the mappingbetween black boxes and black box implementations. The latter are eitherimplemented within the active context module or within cl itself as describedabove. The black box scheduler is accessed only by cl and hence can be viewedas a part of it. In practice, the black box scheduler is a collection of procedureswhich branch into the code valid for the current context.

Page 36: public pdf

36 CHAPTER 2. REAL QUANTIFIER ELIMINATION

2.6.4.5 The Context Modules

In the Figure 2.1 on page 33, there are two modules, ofsf and dvfsf, which serveas examples for context modules. We have defined a context as the specificationof a language, a theory, and a term representation.

There is no separation between these aspects, which has some restrictingconsequences: First, there is in particular no parameterization wrt. the termrepresentation. This is reasonable, because the standard form representationis quite canonical in reduce if one decides to keep the terms as polynomials.Keeping the terms multiplicatively, i.e., as lists of irreducible factors leads tocompletely different algorithmic ideas, which cannot be covered by simply re-defining constructors and access functions for terms. Second, there is also nohierarchy of context modules, i.e., there is no ordered field context based on afield context.

For a given context, the corresponding context module contains all contextdependent code, which splits into the following three parts:

1. Context dependent algebraic mode interface code

2. Black box implementations for cl procedures.

3. Complete algorithm implementations, i.e., context specific implementa-tions that cannot be split into a general part and context dependent partin a reasonable economic way.

Of course, the completely implemented algorithms are not necessarily dis-joint from the algorithms for which there is a cl implementation. Which imple-mentations are actually used is hidden from the user who calls the rl-proceduresfrom a declarative point of view (cf. Section 2.6.3.4). Mapping calls to rl-prefixed procedures from both the algebraic mode and the symbolic mode toactual cl or context module implementations is the job of the service scheduler.

2.6.4.6 The Service Scheduler

The service scheduler implements the map between declarative computation re-quests on one hand and the corresponding implementations valid in the currentcontext on the other hand. Like the black box scheduler, it consists of a col-lection of procedures. These procedures establish the symbolic mode interfaceto redlog. They are also accessed by the algebraic mode interface which isimplemented as a front-end to the symbolic mode interface.

Within redlog, the service scheduler is called from inside the cl modulefor accessing services, which may be implemented either in a context module,or in turn within cl itself. Consider, for instance, intermediate result simpli-fication within a cl implementation of quantifier elimination. Though there isa simplifier implemented within cl, there is no guarantee that this simplifier isvalid for all contexts in which the cl elimination code is used.

On the other hand, there are cases where cl should call cl procedures im-mediately. An obvious example is a recursive procedure. A more general oneis a hierarchy of subprocedures built for the implementation of one or severalservices. In the second case, it is already possible that there is a better contextdependent alternative for one of the subprocedures. It is left to the implementorto decide how to proceed in particular cases. When calling cl code immediately,

Page 37: public pdf

2.6. THE REDLOG COMPUTER LOGIC SYSTEM 37

one must, however, ensure not to address code for which there are black boximplementations missing, since not all the cl procedures are applicable in allcontexts.

The context module procedures call all services immediately. There is noreason for them to call the service scheduler because they know the currentcontext. For clarity, we have thus specified that they are not allowed to do so.

2.6.4.7 Tools

The tool modules contain functions required for the implementation which donot apply to logicals, but are of a more common nature. They are also used forimplementing low-level code shared by different context modules. Recall thatvarious context modules certainly cannot call one another.

2.6.5 Scheduler Internals

We have already discussed that, at any time, there is one context fixed. All inputprocessing and all computations are performed for this context. This allows theautomatic formula conversion between contexts mentioned in Subsection 2.6.3.1.The schedulers are designed on the assumption that there is always some globalinformation on the current context available.

2.6.5.1 Black Box Scheduling

We first focus on black box scheduling within the cl module. There are essen-tially three different ways to perform this task:

1. A data-driven model using tagged forms.

2. A static approach using a global environment.

3. A functional model using parameter functions.

A tag is a certain identifier encoding a data type. Data type specific opera-tions are stored in the property list of the tag. In Lisp based implementationsit is a usual technique to have such a tag combined with every data object.A typical tag position is the first entry in the list representation of each dataobject. In our case, this would amount to keeping the context tag at the begin-ning of every formula. Informally spoken, the formula “knows” which black boximplementations are appropriate for it. The scheduler looks at the tag, calls theimplementation found there, and then returns the result.

Keeping the context information at every formula is not necessary for ourpurposes because all computations are performed wrt. the current context. Inparticular, there are never formulas combined that belong to different contexts.Such redundancy of type information would in fact even cause problems: Manyof the implemented algorithms are inherently recursive. When entering a for-mula recursively, one would have to copy tags to subformulas for recursion, andin turn drop tags when recombining the recursion results. One way to overcomethis is saving the tag globally at the beginning, do the recursion with tag-freeformulas, and retag the final result at the end.

This naturally leads us to the second approach, which is actually used inredlog. All information stored in the property list of the tag in the first

Page 38: public pdf

38 CHAPTER 2. REAL QUANTIFIER ELIMINATION

approach is instead stored in the property list of the context identifier. At theformulas there is no context information at all. Accordingly, the black boxscheduler accesses the context identifier instead of the tag.

Since searching the property list of the context identifier has turned out timeconsuming, we use a cache technique: The information, which is basically anassociative list mapping black boxes to implementations, is copied into a setof global variables, i.e., one variable for each black box. The functions thatmake up the scheduler apply the values of their corresponding variables to theirparameters. The cache is updated at every context selection.

A third technique, which has been used in very early versions of redlog,uses parameter functions: The names of the required black box implementationsare passed to the cl procedures as extra parameters. The cl procedures addressthe black box implementations by applying the parameters. Then there is noblack box scheduler module at all. This approach had several disadvantages:First, due to the extra parameters the code is less readable. Second, the extraparameters have to be passed down during recursion. Third, when new blackbox algorithms and hence procedure parameters are added, all correspondingprocedure calls in the code have to be adapted.

2.6.5.2 Service Scheduling

The service scheduler works in the same way as the parameter scheduler does.Here, the cache technique is also adequate: Recall from Subsection 2.6.4.6 thatthe service scheduler does not only provide a user interface, but may also becalled by cl procedures, possibly within loops.

In the previous paragraph we have pointed out that with parameter functionsthere is no black box scheduler. Using parameter functions actually meansleaving the black box scheduling to the service scheduler. The latter wouldselect the appropriate service function name (service scheduling), and call it withappropriate functional parameters if it is a cl function (black box scheduling).

2.6.6 Documentation

The redlog user manual [DS99] is written in the gnu Texinfo format fromwhich both a printed TEX document and an html online documentation arecreated.

The program documentation is another Texinfo file generated automaticallyfrom the source code: Every procedure starts with a comment block. This isan English text consisting of complete sentences. The first few sentences arespecified to have specific contents. In particular, the first sentence explainsthe name of the procedure, e.g., in cl qe, a cl implementation of quantifierelimination it would be: “Common logic quantifier elimination.” An alphabeticindex containing the words occurring in the first sentences has shown out to bevery useful with the computer algebra systems sac and mas. Further sentencesare reserved for format descriptions of parameters, return values, and access toglobal variables. The comment ends with a declarative description of what theprocedure does.

Page 39: public pdf

2.7. APPLICATION AREAS 39

2.7 Application Areas

The application areas of quantifier elimination in general and of redlog inparticular are by no means restricted to the geometric applications, on whichthis thesis focuses. For the sake of a more complete picture of applied quantifierelimination, we are going to summarize some of the non-geometric applica-tions so far. For a more detailed overview on applied quantifier elimination see[DSW98b].

2.7.1 Constraint Solving

Constraint solving classically involves a system

f1(x1, . . . , xn) > 0, . . . , fk(x1, . . . , xn) > 0

of parameter-free non-strict polynomial inequalities. One wishes to test whethersuch a system is feasible, i.e., whether it has a solution. Moreover one of-ten wishes to determine at least one solution if there exists one. Most classi-cal methods, such as e.g. the simplex method [Dan51] or the Fourier–Motzkinmethod [Mot36], require the variables x1, . . . , xn to occur only linearly.

In this setting, quantifier elimination applied to the formula

∃x1 . . . ∃xn

(

f1(x1, . . . , xn) > 0 ∧ · · · ∧ fk(x1, . . . , xn) > 0)

will yield “true” if and only if the system is feasible. Extended quantifier elim-ination will in addition yield a sample solution.

Moreover quantifier elimination can be straightforwardly applied to solve thefollowing generalizations of the problem:

• The constraint system is an arbitrary boolean combination of constraintsinstead of simply a conjunction.

• The coefficients of the xi are polynomials in parameters u1, . . . , um.

• The constraints include strict inequalities such as “>” and “ 6=.”

• The xi occur with arbitrary degree. There are also arbitrary products ofdifferent xi and xj . Here, one possibly has to obey restrictions imposedby the quantifier elimination method used.

Recall that with strict inequalities the sample solutions provided by extendedquantifier elimination by virtual substitution can involve non-standard termscontaining “ε.” This can in principle be overcome for the price of higher com-plexity [LW93]. With higher degrees, solutions can in general not be determinedas closed terms but in some algebraic form.

2.7.2 Optimization

Optimization differs from constraint solving in the extra issue that a sample so-lution point is required for which an objective function F (x1, . . . , xn) is minimal.The simplex algorithm [Dan51] is designed for this task with a parameter-freelinear function. With the Fourier–Motzkin [Mot36] method linear objective

Page 40: public pdf

40 CHAPTER 2. REAL QUANTIFIER ELIMINATION

functions are introduced via an additional constraint z > F (x1, . . . , xn), wherez is a new variable.

This coding of objective functions by constraints can be used also with quan-tifier elimination methods. For instance, one can do hyperbolic optimization, i.e.,optimization wrt. an objective function F (u,x) = f(u,x)/g(u,x) for polyno-mials f and g and a system of polynomial constraints ψ(u,x) by eliminating

∃x1 . . . ∃xn

(

ψ ∧(

(g > 0 ∧ f 6 zg) ∨ (g < 0 ∧ f > zg)))

.

2.7.3 Scheduling

The classical scheduling problem is as follows: Tasks 1, . . . , n have to be per-formed on machines 1, . . . , m. Each task i is assigned to a machine mi andrequires a processing time pi. Moreover, there is a partial ordering “≺” definedon the tasks. The problem is to determine starting times ti for each task i suchthat none of the ordering constraints on the tasks is violated, no machine isoccupied by more than one task at the same time, and the last task is finishedat the earliest time possible.

This classical setting can be restated as a quantifier elimination problem asfollows:

∃t1 . . .∃tn(

n∧

i=1

ti > 0 ∧

i≺j

ti + pi 6 tj ∧∧

16i<j6n

mi=mj

(ti + pi 6 tj ∨ tj + pj 6 ti) ∧n∧

i=1

z > ti + pi

)

.

The last conjunction of constraints involving z corresponds to the treatment ofobjective functions discussed with optimization.

Quantifier elimination allows to tackle the following more general types ofscheduling problems:

• For each job there is given an interval of time within which it has to beperformed.

• Certain machines are allowed to process several tasks in parallel.

• Certain jobs require more than one machine in parallel.

• The cost function to be minimized is an arbitrary piecewise rational func-tion of starting times of the tasks.

• The extreme freedom in the form of constraints allows to do hierarchicalscheduling: In two elimination steps, a second objective function is opti-mized under the assumption of an optimal solution wrt. a first objectivefunction.

This includes e.g. job shop problems on several machines, problems requiringseveral units of different resources arising, e.g., in the construction of build-ings, and transportation problems involving penalties for earliness or tardinessof certain tasks. Here the constraint formula will usually involve disjunctionsresulting from resource restrictions.

Page 41: public pdf

2.7. APPLICATION AREAS 41

tt

t@@R

@@R

..........................

��..................

........��

��

��

��

��

��

���

?

t

-i3

?........

-r01

r23

r13r02

u1

u2

u3

u0

i02

i01

i13

i23

i12

r12

i0

Figure 2.2: A simple example network consisting of resistors

2.7.4 Simulation, Sizing, and Diagnosis

We consider simulation, design, and error diagnosis of electrical, mechanical, orhydraulic networks.

Figure 2.2 shows a very simple electrical sample network [Wei97c]. It con-sists of resistances rjk subject to wattage restrictions pjk. For fixed resistancesrjk and input voltage u3−u0, all amperages ijk and voltages uk are uniquely de-termined by physical laws. A description of this circuit as a formula is obtainedas follows: By Ohm’s law we have

ω ≡∧

(j,k)∈N

(uk − uj) = rjkijk, N = {(0, 1), (0, 2), (1, 2), (1, 3), (2, 3)}.

Next, Kirchhoff’s laws state that

κ ≡ −i0 + i01 + i02 = 0 ∧ −i01 + i12 + i13 = 0 ∧

−i02 − i12 + i23 = 0 ∧ −i13 − i23 + i3 = 0.

Furthermore, we write down the wattage restrictions for the resistors:

ρ ≡∧

(j,k)∈N

(

(uk − uj)ijk

)26 p2

jk.

This yields an algebraic translation ν = ω ∧ κ ∧ ρ. Finally, we may normalizeu0 = 0, and we may certainly assume that i3 = i0. Since our network is intendedto be a 12V circuit, we also set u3 = 12 yielding ν0.

The easiest thing to do now is simulation of the circuit, i.e., we plug in valuesfor the rjk, and then eliminate all the amperages and voltages. This will yieldeither “true” or “false.” In the latter case some wattage restriction is violated.Extended quantifier elimination would yield in addition to “true” sample valuesfor the amperages and voltages, which are in fact the uniquely determined valuesassumed. More sophisticated applications of quantifier elimination in this areainclude the following [Stu99]:

Page 42: public pdf

42 CHAPTER 2. REAL QUANTIFIER ELIMINATION

Sizing In the example network, determine resistances such that certain con-straints on the amperages and voltages are satisfied.

Error diagnosis Imagine a concrete network in which all resistances, amper-ages, and voltages are known. Suppose r12 is actually an ammeter formonitoring the network. If the amperage i12 changes, one determinesfrom its new value which part of the circuit is damaged in which way.

2.7.5 Control Theory and Stability

Hong, Liska, and Steinberg have shown that certain stability problems for ode’sand pde’s can be rephrased as real quantifier elimination problems. While manyof these problems are still out of the range of present day elimination methods,some non-trivial and interesting instances of such problems have been solved byqepcad and redlog; see [HLS97] for details.

Abdallah, Dorato, and Yang have also worked in this area. They have solvedan open problem in control theory using qepcad in combination with redlog

[ADY+96, DYA97].Jirstrand has examined stationary, stability, and following of a polynomially

parameterized curve for dynamical systems using qepcad [Jir97].

2.7.6 Real Implicitization

For n < m let f : Rn → R

m be a rational map with component functions pi/q,where pi, q ∈ R[x1, . . . , xn] for 1 6 i 6 m. The image f(Rn) of f is a definableand hence semi-algebraic subset of Rm described by the formula

∃x1 . . . ∃xn

(

q(x1, . . . , xn) 6= 0 ∧m∧

i=1

pi(x1, . . . , xn) = uiq(x1, . . . , xn))

.

The aim is then to obtain a quantifier-free description of f(Rn) in the vari-ables u1, . . . , um, preferably a single equation, which would provide an implicitdefinition of f .

2.7.7 Automatic Theorem Proving

Quantifier elimination can obviously be used as a decision procedure for first-order sentences. Application of generic quantifier elimination to geometric the-orem proving is discussed in detail in the following chapter. The automaticproof of the following “theorem” is a nice non-geometric application, which hasbeen introduced by Brown [Bro83] and proved using prolog iii by Colmerauer[Col90].

Example 2.17 (Period 9) Consider the infinite sequence (xi)i∈N of real num-bers defined by xi+2 := |xi+1|−xi, where x1 and x2 are arbitrary. This sequenceis always periodic, and the period length is less than or equal to 9.

A straightforward translation of this theorem to a first-order formula over thereals reads as follows:

∀x1∀x2∀x3∀x4∀x5∀x6∀x7∀x8∀x9∀x10∀x11

(

9∧

i=1

(

(xi+1 > 0 ∧ xi+2 = xi+1 − xi) ∨

Page 43: public pdf

2.8. RELATED WORK 43

(xi+1 < 0 ∧ xi+2 = −xi+1 − xi))

−→ x1 = x10 ∧ x2 = x11

)

.

2.8 Related Work

There are two major research areas that are related to the field of real quantifierelimination in the sense that they address apparently similar problems. The firstone is general approaches to automated theorem proving, and the second one islogic programming. We want to sketch the conceptual differences between theseand our own work.

Automated theorem proving splits into two major approaches: resolutionmethods and tableau methods. In either case, the methods do not immedi-ately make use of the semantics of the predicates contained in the sentencesto be proved. More precisely, all the algebraic knowledge on, say, real closedfields, is coded by logic formulas and can then within the proof process not bedistinguished from formulas that stem from the target problem. Apart fromsimplification issues, quantifier elimination methods operate, in contrast, nearlycompletely on the algebraic side. The theorem provers simply implement a log-ical engine, and all algebraic knowledge required for solving the input problemhas to derived by this engine using the implemented calculus. Quantifier elimi-nation procedures, in contrast implement all the necessary algebraic knowledgewithin the engine. This implemented knowledge has been proved in advance byhumans or machines using various calculi.

Logic programming techniques as implemented in the programming languageprolog were originally restricted variants of the resolution proof method men-tioned above. More recent versions such as prolog iii include constraint solvingcapabilities, which gives then indeed a certain spirit of quantifier elimination.The periodicity theorem discussed above as Example 2.17 has actually beenalso solved using prolog iii. The major difference to our method is here, thatsolving it with prolog iii has the flavor of a “programming job:” In order to besuccessful, one has to think about how prolog works. Quantifier elimination,in contrast, just requires a formally correct description of the problem. Inter-estingly, the initial motivation for logic programming languages was declarativeproblem specification as opposed to procedural programming. So in a certainsense, quantifier elimination is closer to the original goals of logic programmingthan the corresponding programming languages. Note, however, that the appli-cations discussed throughout in this thesis suggest that there is still a certainexpertise in the proper formulation of problems necessary to efficiently makeuse of quantifier elimination techniques.

2.9 Conclusions

We have given a detailed overview over the historical development of real quan-tifier elimination, which dates back to the 17th century. Wherever possible, wehave figured out and cited the original sources of the algebraic methods. Wehave given detailed descriptions of all available implemented quantifier elimi-nation algorithms. Due to its historical importance, we have also sketched thefirst published real quantifier elimination algorithm by Tarski.

Our focus is naturally on quantifier elimination by virtual substitution, which

Page 44: public pdf

44 CHAPTER 2. REAL QUANTIFIER ELIMINATION

has been implemented by the author et al. within the computer logic systemredlog that, as a part of the computer algebra system reduce, is widely ac-cepted and used inside the scientific community. In fact, reduce provides withredlog the currently only professionally maintained and marketed implemen-tation of real quantifier elimination.

We have introduced two extensions of quantifier elimination by virtual sub-stitution, namely extended quantifier elimination and generic quantifier elim-ination. Generic quantifier elimination has been developed by the author forthe purpose of geometric theorem proving. This thesis is going to demonstratethat the introduction of generic quantifier elimination is actually an importantprogress in geometric theorem proving and in other geometric application areas.

With the description of generic quantifier elimination, we have also dis-cussed the importance of sophisticated variable selection strategies for elimina-tion. This is crucial for avoiding failures due to the degree restrictions to themost possible extent. Although the degree restriction can be overcome in the-ory, it will for efficiency reasons always be advantageous to keep low all degreesof quantified variables as long as possible. The discussed strategies are thus nota temporary technique to overcome limitations of the current implementation.Instead they are of general theoretical interest. The generic quantifier elimina-tion is closely related to the concept of a theory in the parameters, which can bepassed as an optional argument to both regular and extended generic quantifierelimination by virtual substitution.

We have described the design of the redlog system, which will be our majorcomputation tool throughout this thesis. A summary of a variety of applicationareas has given an idea of the scope of the methods used here. They providean extremely general tool that is by no means restricted to geometric problems,which we focus on here.

Finally, we have clarified the difference between real quantifier eliminationand apparently closely related areas such as automatic theorem proving andconstraint logic programming.

Page 45: public pdf

Chapter 3

Geometric Theorem

Proving

In view of the fact that real quantifier elimination procedures amount to de-cision methods for variable-free formulas, it is a straightforward idea to applythem for automated theorem proving. Theorems of elementary geometry havetraditionally been considered an important test case for the scope of methodsin automatic theorem proving.

In Section 3.1, we summarize the conventional algebraic methods for auto-matic geometry proving discussed in the literature so far. In Section 3.2, weintroduce the important notion of geometric non-degeneracy conditions, whichhave to be detected by automatic provers. With our approach, the assumptionsmade by generic quantifier elimination will yield these conditions. Section 3.3illustrates the common method of algebraically modeling geometric configura-tions and conjectures, the basic ideas of which are common to all the provingmethods we discuss including our own one. Section 3.4 points on the limitationspresent with the conventional algebraic methods. These limitations are on onehand due to their being complex in contrast to real. On the other hand, theyare restricted to algebraic translations that are universal Horn clauses. In Sec-tions 3.5, we suggest to overcome all these limitations by using (generic) realquantifier elimination as a geometric theorem prover. Section 3.6 exhibits theimportant advantage of our generic quantifier elimination to be not only a theo-rem prover but even a theorem finder in case that the input hypothesis is not atheorem even under certain non-degeneracy assumptions. Section 3.7 illustratesour method in detail by two examples computed by hand. Section 3.8 finallyprovides a collection of automatic proofs accomplished by our implementationof the generic virtual substitution method within the redlog system, whichhas been described in Section 2.6 of the previous chapter.

3.1 Conventional Algebraic Methods

Geometric problems have stimulated a variety of algebraic techniques for theirsolution. Around 1977, Wu discovered the Wu–Ritt method adapting a methodby Ritt [Rit32, Rit50] for differential algebra [Wu84, Wu86a]. Chou made impor-tant contributions to the development and application of the Wu–Ritt method.

45

Page 46: public pdf

46 CHAPTER 3. GEOMETRIC THEOREM PROVING

Most of Chou’s work has been summarized in an impressing monograph includ-ing more than 500 geometric theorems automatically proved by this method[Cho88].

Kapur [Kap86] developed a prover based on a radical membership test viaGrobner Basis [Buc65] computation.

Kutzler and Stifter [KS86] developed another prover also based on Grobnertechniques. They modified the notion of reduction to a pseudo reduction, whichis slightly similar to the notion of reduction used in the Wu–Ritt method.

Wang [Wan93b, Wan95a] developed complex elimination methods based onideas by Seidenberg [Sei56a, Sei56b, Sei69] but also inspired by Wu–Ritt.

All these methods have proved to be quite successful. Their common basiscan be characterized as follows: The first step is a translation of the geomet-ric assertion G via a suitably positioned coordinate system into an algebraicstatement ϕ involving multivariate polynomial equations.

Subsequently, the corresponding algebraic method itself is applied in an at-tempt to prove ϕ as a statement about complex numbers. Since ϕ is generallya universally quantified assertion, the validity of ϕ over the complex numbersentails the validity of ϕ over the reals and thus an automatic proof of the origi-nal geometric assertion. If, in contrast, ϕ turns out to be false over the complexnumbers, no decision on the validity of G can be made.

3.2 Subsidiary Conditions

In general, geometric theorems are only generically true, or in other words, trueonly under some non-degeneracy conditions. Such conditions mostly state thatthe involved geometric configurations are proper. That is, triangles are notdegenerated to lines or points, or several points do not coincide, etc. Beyondthis, non-degeneracy conditions might exclude certain well-behaved configura-tions like parallel lines or rectangular triangles. Since such cases are not reallydegenerate, non-degeneracy conditions have also been called subsidiary condi-tions.

It is in general by no means easy to find and add all the non-degeneracy con-ditions for the validity of a theorem. Illustrating examples for hidden conditionshave been given by Chou (cf. [Cho88], pp. 43–44).

The answers produced by the conventional proving methods also happen tobe correct only under certain assumptions in the shape of negated equations,which are, of course, explicitly provided to the user. It is a most amazing factthat these side conditions produced by the proof methods mostly coincide withthe subsidiary conditions necessary for the validity of the target theorem. Thatis, an apparent weakness of the algebraic procedures turns out as an adequatetool for actively discovering additional “trivial” hypothesises.

The presence of this phenomenon with various different automatic proofstrategies suggests that the approach to translate geometry to algebra is ex-tremely natural.

Page 47: public pdf

3.3. TRANSLATING GEOMETRY TO ALGEBRA 47

A B

D C

E

Figure 3.1: Parallelogram diagonal cut (Example 3.1 and Example 3.8)

3.3 Translating Geometry to Algebra

The style of algebraic modeling with parameters and dependent variables com-monly used and introduced in this section can be found already in Hilbert’sGrundlagen der Geometrie1 [Hil87], originally published in 1899; see in partic-ular the proof of Theorem 62 there.

We illustrate the approach by means of an example modeling the followingsimple theorem taken from [Cho88], which we will also prove automatically asExample 3.8 on page 55.

Example 3.1 (Chou) Let ABCD be a parallelogram, and let E be the in-tersection point of its diagonals. Then E is the midpoint of both diagonals(Figure 3.1).

In the translation, we distinguish between two types of variables: On onehand we have parameters describing coordinates that can be chosen more orless arbitrarily. On the other hand there are dependent variables describingcoordinates that are uniquely determined by the parameters.

We denote parameters by u1, . . . , um, and we denote dependent variablesby x1, . . . , xn. In the example, we introduce wlog. the following parameters:

A = (0, 0), B = (u1, 0), C = (u2, u3).

For any choice of u1, u2, u3, the coordinates of D and E are now uniquelydetermined. We use dependent variables for their coordinates:

D = (x1, x2), E = (x3, x4).

Using these coordinates, we can now write down the hypothesis: For ABCDto be a parallelogram, we require that x1 = u2 − u1 and x2 = u3. The pointE is the intersection of the diagonals AC and BD if and only if it lies on boththese diagonals. This is in turn the case if and only if the lines AE and AC areidentical, and the lines BE and BD are identical. The identity of lines with acommon point can be expressed in terms of their gradients:

x4

x3=u3

u2,

x4

x3 − u1=

x2

x1 − u1.

1Foundations of Geometry

Page 48: public pdf

48 CHAPTER 3. GEOMETRIC THEOREM PROVING

Clearing denominators this amounts to the polynomial equations x4u2 = u3x3

and x4(x1 − u1) = x2(x3 − u1), respectively.The conclusion of the theorem is that E is the midpoint of both AC and

BD. That is,

x23 + x2

4 =

u22 + u2

3

2and

(x3 − u1)2 + x24 =

(x1 − u1)2 + x22

2,

respectively. This yields restated with polynomials 4x23 + 4x2

4 = u22 + u2

3 and4(x3 − u1)

2 + 4x24 = (x1 − u1)

2 + x22, respectively.

In all the polynomial equations obtained so far, we subtract the right handsides to the corresponding left hand sides obtaining the following left hand sidepolynomials for the hypothesises and the conclusions:

h1(u,x) = x1 + u1 − u2

h2(u,x) = x2 − u3

h3(u,x) = u2x4 − u3x3

h4(u,x) = x4(x1 − u1)− x2(x3 − u1)

c1(u,x) = 4x23 + 4x2

4 − u22 − u2

3

c2(u,x) = 4(x3 − u1)2 + 4x2

4 − (x1 − u1)2 − x2

2.

Automatic provers will now try to prove the generic validity of the followingassertion over either R or C:

∀u∀x(

(

4∧

i=1

hi(u,x) = 0)

−→(

c1(u,x) = 0 ∧ c2(u,x) = 0)

)

.

Generic validity means validity under certain subsidiary conditions to be dis-covered by the automatic prover as discussed in Section 3.2. It should be clearfrom our modeling that well-expressed non-degeneracy conditions will involvethe parameters u1, . . . , u3 but not the dependent variables x1, . . . , x4.

Among the conventional algebraic methods, only the approach of Kapur doesnot distinguish between parameters and dependent variables.

Note that one enters a certain amount of geometric knowledge at the mod-eling stage: For instance, our formulation of the Euclidean line lengths requireknowledge of Pythagoras’ theorem. Trying to prove Pythagoras’ theorem witha such a modeling would certainly result in a trivial algebraic formulation. Gen-erally, one has to be very careful about performing relevant parts of the proofalready at the translation stage. Kutzler has addressed this problem in hisdoctoral dissertation [Kut88]. Following Hilbert, he introduces the basic typespoint and line, and then defines a restricted set of predicates such as parallelor midpoint on these types. First-order formulas over the obtained two-sortedrelational language are then mechanically translated to corresponding formulasover the language of rings.

3.4 Limitations of the Algebraic Methods

It is an amazing fact, which does not appear to have a sufficient theoreticalexplanation up to now, that for the overwhelming majority of theorems in the

Page 49: public pdf

3.4. LIMITATIONS OF THE ALGEBRAIC METHODS 49

MA B

L

Figure 3.2: The line L would intersect the circle in the complex plane (Exam-ple 3.2 and Example 3.10)

plane geometry of points, lines, circles, and cones the algebraic translation ϕdoes hold in the field of complex numbers. Anyway, there are certain limitationson the applicability of algebraic methods to geometry proving.

First of all, as already indicated in the previous section, it is impossible todisprove theorems. Note that this can in particular not be done by provingthe negation of the target theorem since this negation is not a universal but anexistential sentence.

We now turn to illustrating the various problems that can arise when tryingto reduce the proof of some theorem over the reals to a proof over the complexnumbers. For this we give four examples for the types of problems that canarise.

The procedures fail in quite a trivial way if the theorem asserts propertiesof points that do not exist in the real plane but exist in the complex plane.This is the case for the point C in the following example taken from [Cho88],pp. 56–57:

Example 3.2 (Chou) Let A and B be two distinct points, let M be the mid-point of A and B. Let C be one of the intersections of the circle

(

A, (AM))

with the line L passing through B and perpendicular to AB, then AC ≡ AB(Figure 3.2).

For an automatic proof of this conjecture by real quantifier elimination seeSection 3.8.1, page 57, Example 3.10.

Among the few non-trivial examples for the failure of algebraic methods inreal geometry, the following is a famous one. It is originally due to MacLane,1936, [Mac36]:

Example 3.3 (MacLane) Consider eight points A, . . . , H such that the fol-lowing eight triples are collinear (A,B,D), (B,C,E), (C,D, F ), (D,E,G),(E,F,H), (F,G,A), (G,H,B), (H,A,C). Then all eight points lie on a line.

MacLane’s example has been discussed by Kutzler, who also provides additionalexamples for real theorems that fail over the complex numbers [Kut88]. Conti

Page 50: public pdf

50 CHAPTER 3. GEOMETRIC THEOREM PROVING

and Traverso have also discussed the example in detail [CT95]. We will auto-matically prove the conjecture in Section 3.8.2, page 69, Example 3.20.

There are numerous reasonable geometric theorems that involve orderinginequalities in their formulation. One prominent example is Pedoe’s inequality:

Example 3.4 (Pedoe) Given two arbitrary triangles ABC and A′B′C′ withsides a, b, c and a′, b′, c′, respectively, the areas ∆ and ∆′ of these trianglessatisfy the following inequality:

a′2(b2 + c2 − a2) + b′2(c2 + a2 − b2) + c′2(a2 + b2 − c2) > 16∆′∆.

Such a theorem can, of course, not straightforwardly be formulated in a purelyalgebraic setting. It should be mentioned, however, that both the Wu–Rittmethod and Wang’s method have “automatically” proved Pedoe’s inequality byconsidering local minima [Wan95a]. We return to Pedoe’s inequality in Sec-tion 3.8.2, page 67, Example 3.18.

The following theorem cannot be tackled by such tricks, but requires a gen-uinely real method:

Example 3.5 (Median bisector theorem) Consider a non-isosceles triangleABC. The median over the side AB is always greater than the interior bisectoron the same side. See Figure 3.12 on page 66.

Such problems, which inherently require ordering inequalities, are subject tocurrent research. The median bisector theorem has been addressed by Wuusing an incomplete extension of Wu–Ritt reduction that can cope with orderinginequalities [Wu92]. We will automatically prove the median bisector theoremin Section 3.8.2, page 66, Example 3.17.

3.5 Proving by Real Quantifier Elimination

Our idea is now to use real quantifier elimination methods for automatic geom-etry proving. This overcomes all the limitations discussed in Section 3.4.

Compared to the conventional algebraic methods, real quantifier eliminationis generally believed to be not able to compete: In 1988, Kutzler comparedseveral provers. The sac-2 implementation of Collins’ cad then failed for thelargest part of his benchmarks [Kut88]. The author of this thesis is not awareof any publication on geometry proving by pure quantifier elimination.

From these well-known efficiency problems, and from the discussion on sub-sidiary conditions in Section 3.2 it follows that for most cases it is not appro-priate to simply use real quantifier elimination as a decision procedure for theuniversal geometric sentences to be proved. Due to missing non-degeneracy hy-pothesises it would in general find that the input sentence is not a theorem.Instead, we could universally quantify only the dependent variables x1, . . . , xn,but leave the parameters u1, . . . , um unquantified. The elimination result withregular quantifier elimination would then be a quantifier-free formula in the pa-rameters providing necessary and sufficient conditions for the theorem to hold.

In order to obtain instead subsidiary conditions of the usual kind, we use themuch more efficient generic quantifier elimination introduced in Section 2.4.2,

Page 51: public pdf

3.6. FROM THEOREM PROVING TO THEOREM FINDING 51

which has actually been developed for geometric theorem proving [DSW98a].Recall that this procedure returns on input of a quantified formula

ϕ(u1, . . . , um) ≡ Q1x1 . . .Qnxnψ(u1, . . . , um, x1, . . . , xn), Qi ∈ {∃, ∀}

a quantifier-free formula ϕ′(u1, . . . , um) together with a conjunction of assump-tions ϑ′(u1, . . . , um) such that

∀u1 . . . ∀um

(

ϑ′(u1, . . . , um) −→ (ϕ(u1, . . . , um)←→ ϕ′(u1, . . . , um)))

.

We have already indicated in Section 2.4.2 that as with the conventional alge-braic methods, the assumptions ϑ′ correspond mostly to geometric subsidiaryconditions.

If ϕ′ equals “true,” then we have proved ϕ and thus the geometric assertion G

modeled by ϕ under the non-degeneracy conditions contained in ϑ′. Otherwise,it is still possible that ϕ′ holds wrt. ϑ′; in other words

∀u1 . . . ∀um

(

ϑ′(u1, . . . , um) −→ ϕ′(u1, . . . , um))

.

This can be checked automatically using some unmodified quantifier eliminationprocedure such as the virtual substitution method, if the degrees allow to doso, or partial cad. If we succeed in eliminating all the quantifiers, we definitelyknow whether the input conjecture ϕ is a theorem wrt. ϑ′ or not.

In the latter case there are two possibilities. Either our method has notfound all necessary non-degeneracy conditions, i.e., ϑ′ is not sufficient for ϕ tobe an appropriate algebraic translation of the geometric conjecture G, or G itselfdoes not hold in the claimed generality.

If we suspect that there are simply non-degeneracy conditions missing, wecan apply a theory generator. This is a procedure that enlarges ϑ′ by furthernegated equations until it, hopefully, implies ϕ′. The technique is based onadding negated equations that occur literally in ϕ′. This procedure can certainlyfail, which happens in particular when there are only few negated equations inϕ′ or none at all.

Note, however, that in either case ϕ′ specifies additional constraints on theparameters u1, . . . , um that are necessary and sufficient for the validity of G

under ϑ′. Both ϕ′ and ϑ′ can thus be used in order to turn a not generallyvalid geometric conjecture G into a true geometric theorem, provided that onesucceeds in a geometric back-translation of the algebraic assertions ϑ′ and ϕ′.This leads us from theorem proving to theorem finding.

3.6 From Theorem Proving to Theorem Finding

The non-degeneracy conditions obtained by the conventional algebraic methodsare sufficient but, in general, not necessary for the conjecture under consid-eration to hold. The same holds for the non-degeneracy conditions obtainedby generic quantifier elimination. The conditions on the parameters obtainedby regular real quantifier elimination are, in contrast, both necessary and suffi-cient. In other words, regular quantifier elimination results are of better quality,since they do under no circumstances suggest superfluous assumptions on theparameters.

Page 52: public pdf

52 CHAPTER 3. GEOMETRIC THEOREM PROVING

Furthermore, quantifier elimination results are arbitrary boolean combina-tions of equations, negated equations, and ordering inequalities, while con-ventional subsidiary conditions are restricted to a collection or conjunction ofnegated equations. Such conjunctions can only except a set of measure zero.So on one hand, quantifier elimination can find much more precise conditions,e.g. that a theorem holds for isosceles triangles only; on the other hand, elim-ination results are certainly harder to translate back to geometry. Moreover,regular quantifier elimination causes efficiency problems as discussed in the pre-vious section.

Most interestingly, generic quantifier elimination combines both a finder forsufficient simple non-degeneracy conditions, and a finder for more sophisticatedhypothesises that the user missed to add: If the proof of the input conjectureϕ fails in spite of all appropriate non-degeneracy conditions, then the obtainedresult yields necessary and sufficient conditions for the conjecture to hold. Thesecan be added as additional premises. In other words, we do not only provetheorems but even find theorems. For examples see Example 3.14, 3.15, or3.19. Note the most amazing fact that the “usual” non-degeneracy conditions,as a rule, actually happen to get into the theory but not into the quantifierelimination result, although this is well possible in theory.

3.7 Generic Virtual Substitution Sample Proofs

We are going to illustrate by two simple examples how the generic variant ofquantifier elimination by virtual substitution works. Our first example showshow non-degeneracy conditions are introduced, and how we reduce universalquantifiers to existential quantifiers. It is, however, rather trivial concerningthe elimination set construction: the elimination of both quantifiers can bereduced to our extended notion of Gauss elimination (see Section 2.3.3).

Example 3.6 Two lines intersect in one and only one point.

The first line is modeled by the X-axis, the second one by an affine linearfunction mx+ b:

∃x(

mx+ b = 0 ∧ ∀y(y 6= x −→ my + b 6= 0))

.

We start with turning the formula into a prenex positive formula, i.e. the matrixof the formula becomes an ∧-∨-combination of atomic formulas.

∃x∀y(

mx+ b = 0 ∧ (y = x ∨ my + b 6= 0))

.

The elimination of ∀y is reduced to that of

¬∃y(

mx+ b 6= 0 ∨ (y 6= x ∧ my = −b))

.

Since mx + b 6= 0 is independent of y, we may restrict our attention to thenested conjunction. We add m 6= 0 to our theory. Under this assumption theequation my = −b is non-trivial, and it suffices to substitute −b

mas a test term.

The result is the following:

¬(

0 6= 0 ∨ (−b 6= mx ∧ −b = −b))

.

Page 53: public pdf

3.7. GENERIC VIRTUAL SUBSTITUTION SAMPLE PROOFS 53

A B

M=(1,0)

r

Figure 3.3: Intersection between a strip and a disk (Example 3.7)

After encoding the negation “¬” into the atomic formulas, simplifying, andrenormalizing wrt. the next quantifier “∃x” we have:

mx = −b.

We have already made the assumption m 6= 0, hence the remaining equationis nontrivial. We substitute −b

mfor x obtaining “true” as the final elimination

result. The non-degeneracy condition m 6= 0 states that our two lines be notparallel. The non-generic virtual substitution method would, instead of makingthe assumption, have introduced case distinctions on the vanishing of m withinthe resulting formula.

Our second example illustrates how the virtual substitution method dealswith inequalities and with quadratic variables.

Example 3.7 Consider in 2-space a disk with center M and radius r, and twoparallel lines A, B. Find necessary and sufficient conditions for the strip betweenA and B to have a nonempty intersection with the disk (see Figure 3.3).

In our algebraic translation, we denote by (x, y) a point which is both insidethe strip and inside the disk. We locate the center M of the disk at (−1, 0),and the lines A and B are defined as { (a, y) | y ∈ R } and { (b, y) | y ∈ R },respectively. This yields the following input formula:

∃x∃y(

(x+ 1)2 + y26 r2 ∧ a 6 x ∧ x 6 b

)

.

We start with the elimination of ∃y. The purely quadratic occurrence of y allowsa shift h = y2:

∃h(

h 6 r2 − (x+ 1)2 ∧ h > 0 ∧ a 6 x ∧ x 6 b)

.

There is both a lower bound 0 and an upper bound r2 − (x+ 1)2 for h. In thissituation, we know that it suffices to substitute either all upper bounds togetherwith the formal symbol −∞ or all lower bounds together with ∞. We decidefor the elimination set {∞, r2 − (x+ 1)2} yielding

(false ∧ true ∧ a 6 x ∧ x 6 b) ∨(

r2 − (x+ 1)2 6 r2 − (x + 1)2 ∧ r2 − (x+ 1)2 > 0 ∧ a 6 x ∧ x 6 b)

.

Page 54: public pdf

54 CHAPTER 3. GEOMETRIC THEOREM PROVING

Note that we know the direction of the bounds because h does not occur with aparametric coefficient in the corresponding atomic formulas. In connection withstrict inequalities there would also occur terms including infinitesimal formalsymbols±ε. The substitution of terms with formal symbols into atomic formulasis described in [Wei97b].

After simplification and renormalization wrt. the next quantifier ∃x, we have

(x+ 1)2 6 r2 ∧ x > a ∧ x 6 b

including linear bounds a, b, and quadratic bounds r − 1 and −r− 1 for x. Wedo not have to substitute the quadratic bounds because we are in an importantspecial case: There is only one quadratic inequality. This can be treated bysubstituting the zero −1 of the derivative

∂(

(x+ 1)2 − r2)

∂x= 2x− 2.

This will not increase the degree in the parameters, which are possibly quan-tified from outside. Proceeding this way, however, we cannot decide betweenlinear lower or upper bounds. Disjunctive substitution of the elimination set{a, b,−1,−∞,∞} yields

(

(a+ 1)2 6 r2 ∧ a > a ∧ a 6 b)

∨(

(b+ 1)2 6 r2 ∧ b > a ∧ b 6 b)

∨(0 6 r2 ∧ −1 > a ∧ −1 6 b) ∨ (false ∧ false ∧ true) ∨(false ∧ true ∧ false).

In general, one has to substitute all the roots of the quadratic constraints pos-sibly with ±ε. Note that these roots can contain surds. In [Wei97b] there isdescribed how to substitute the roots in such a way that the substitution resultdoes not contain any surds.

Our sample elimination result is automatically simplified to the followingquantifier-free formula:

(

(a+ 1)2 6 r2 ∧ a 6 b)

∨(

(b+ 1)2 6 r2 ∧ b > a)

∨ (a 6 −1 6 b).

There have not been made any assumptions with this elimination.

3.8 A Collection of Automatic Proofs

As mentioned in the previous section redlog provides an interface to HoonHong’s qepcad: it can spawn a qepcad process, communicate formulas toit, receive the results, and convert them back to its own internal formula for-mat. We have actually tried to compute all examples discussed in this sectionwith qepcad, which failed in most cases probably due to the large number ofvariables. On the other hand, qepcad does a good job in checking whetherϑ′ −→ ϕ′ after application of our method since both ϑ′ and ϕ′ contain only fewvariables, namely at most the parameters ui of the input problem ϕ. Such appli-cations of qepcad can be found in Example 3.17 on page 66 and Example 3.22on page 72.

We start with summarizing the timings and solutions of several examplestaken from Chou [Cho88]. Most of the latter can also be proved by complex

Page 55: public pdf

3.8. A COLLECTION OF AUTOMATIC PROOFS 55

methods. Then we discuss the automatic proofs of some examples of real ge-ometry taken from Wu [Wu92], Wang [Wan95b], Kutzler [Kut88], and McPhee,Chou, and Gao [MCG94].

Throughout this section, generic quantifier elimination refers to the redlog

implementation of generic quantifier elimination by virtual substitution as de-scribed in Section 3.7. By regular quantifier elimination, we denote the redlog

implementation of quantifier elimination by virtual substitution as described inSection 2.3.3.

All computations have been performed on a sun Ultra 1 Model 140 work-station using 32 MB of memory.

3.8.1 Examples Discussed by Chou

The following examples are taken from the famous monograph of Chou [Cho88]on geometry proving using the Wu–Ritt method. The theorems, with the ex-ception of Example 3.10 and our modification of Example 3.13, hold also overthe complex numbers. Except where explicitly mentioned, we use the algebraictranslations by Chou.

The theorems are taken from an example section illustrating the various fea-tures of the Wu–Ritt method and of Chou’s prover. This choice provides us arepresentative sample set. Since Chou’s attention is mainly on the methodol-ogy, he does, unfortunately, not give his non-degeneracy conditions for all theexamples. For the cases, where the conditions are given, we compare them withthe conditions obtained by our generic quantifier elimination.

Example 3.8 (Parallelogram diagonals) Let ABCD be a parallelogram,and let E be the intersection point of its diagonals. Then E is the midpoint ofboth of the diagonals. See Figure 3.1 on page 47.

Chou uses the following algebraic translation of this conjecture: The pointstake coordinates

A = (0, 0), B = (u1, 0), C = (u2, u3), D = (x2, x1), E = (x4, x3),

and the hypothesises h1, . . . , h4 and the conclusion g read as follows:

h1 ≡ u1x1 − u1u3 = 0 AB ‖ DCh2 ≡ u3x2 − (u2 − u1)x1 = 0 DA ‖ CBh3 ≡ x1x4 − (x2 − u1)x3 − u1x1 = 0 E ∈ BDh4 ≡ u3x4 − u2x3 = 0 E ∈ ACg ≡ 2u2x4 + 2u3x3 − u2

3 − u22 = 0 AE ≡ CE.

On input of ϕ ≡ ∀x1∀x2∀x3∀x4(h1 ∧ h2 ∧ h3 ∧ h4 −→ g), we obtain by genericquantifier elimination after 40 ms the elimination result ϕ′ ≡ true plus the non-degeneracy conditions ϑ′ ≡ u1 6= 0 ∧ u3 6= 0, which state that ABCD is aproper parallelogram.

Chou obtains in addition a superfluous condition u3x2 − u2x1 − u1u3 6= 0.This states that the diagonals have different gradients, which trivially holds inany parallelogram; more precisely, one always has ∇AC = −∇BD.

Precise information on the non-degeneracy conditions that are actually nec-essary is obtained for the price of a significantly higher computation time by

Page 56: public pdf

56 CHAPTER 3. GEOMETRIC THEOREM PROVING

B

D

F

GA

CE

O

Figure 3.4: Simson’s theorem (Example 3.9)

applying regular quantifier elimination by virtual substitution to ϕ. redlog

obtains after 200 ms for quantifier elimination and subsequent Grobner simpli-fication the following equivalent quantifier-free formula:

ϕ′ ≡ (u2 = 0 ∨ u3 6= 0) ∧ (u1 6= 0 ∨ u3 = 0).

Using the algebraic translation derived for the conjecture in Section 3.3, oneyields essentially the same though slightly more complicated results.

Example 3.9 (Simson’s theorem) Consider a triangle ABC, and select apoint D on its circumcircle. From D draw perpendiculars to each of the sidesBC, CA, and AB of the triangle. Then the feet E, F , and G of these perpen-diculars are collinear. See Figure 3.4.

In Chou’s algebraic translation, the corner points of the triangle and thepoint D on its circumcircle take the following coordinates:

A = (0, 0), B = (u1, 0), C = (u2, u3), D = (x3, u4).

Note that due to that fact that D may be freely chosen on the circumcircle,one of its coordinates is modeled by a parameter u4. Since the choice of Dis restricted to lying on the circle, its other coordinate is uniquely determinedand thus modeled by a dependent variable x3. Either are the center O of thecircumcircle and the footpoints of the perpendiculars:

O = (x2, x1), E = (x5, x4), F = (x7, x6), G = (x3, 0).

Using these coordinates, Chou derives hypothesises h1, . . . , h7 and the conclu-sion g as follows:

h1 ≡ 2u2x2 + 2u3x1 − u23 − u2

2 = 0 OA ≡ OCh2 ≡ 2u1x2 − u2

1 = 0 OA ≡ OBh3 ≡ −x2

3 + 2x2x3 + 2u4x1 − u24 = 0 OA ≡ OD

h4 ≡ u3x5 + (−u2 + u1)x4 − u1u3 = 0 collinear(E,B,C)h5 ≡ (u2 − u1)x5 + u3x4 + (−u2 + u1)x3 − u3u4 = 0 DE ⊥ BCh6 ≡ u3x7 − u2x6 = 0 collinear(F,A,C)h7 ≡ u2x7 + u3x6 − u2x3 − u3u4 = 0 DF ⊥ ACg ≡ x4x7 + (−x5 + x3)x6 − x3x4 = 0 collinear(E,F,G).

Page 57: public pdf

3.8. A COLLECTION OF AUTOMATIC PROOFS 57

For the input ϕ ≡ ∀x1 . . . ∀x7(h1 ∧ · · · ∧ h7 −→ g), the generic quantifierelimination of redlog obtains after 180 ms elimination result ϕ′ ≡ true validunder the subsidiary conditions

ϑ′ ≡ u21 − 2u1u2 + u2

2 + u23 6= 0 ∧ u1 6= 0 ∧ u2 6= 0 ∧ u3 6= 0.

The condition u1 6= 0 ∧ u3 6= 0 states that ABC is a proper triangle. The firstcondition (u1 − u2)

2 + u23 6= 0 is implied by u3 6= 0 and can thus be dropped.

Finally, the condition u2 6= 0 states that ∠BAC is not a right angle.

Regular quantifier elimination by virtual substitution fails on ϕ due to lackof memory.

Chou obtains up to numerical factors our subsidiary conditions ϑ′, and ad-ditionally 4u1u3 6= 0 and −u2

3 − u22 6= 0. The first one is obviously redundant.

The second one states that ∠BAC 6= 45◦.

Example 3.10 (Bounded circle) Let A and B be two distinct points, let Mbe the midpoint of A and B. Let C be one of the intersections of the circle(A, |AM |) with the line L passing through B and perpendicular to AB, thenAC ≡ AB. See Figure 3.2 on page 49.

This conjecture does not hold in the complex plane, since there the circlex2

1 + x22 = r2 with center 0 and radius r is unbounded.

Chou does not give an algebraic translation but only mentions the unappli-cability of his method. We choose the following coordinates for the points:

A = (0, 0), B = (u1, 0), M = (x1, 0), C = (x2, x3).

The hypothesises h1, h2, h3 and the conclusion g then are as follows:

h1 ≡ 2x1 = u1 AM ≡ AB/2h2 ≡ x2

2 + x23 = x2

1 C ∈ (A, |AM |)h3 ≡ (x2 − u1)x1 = 0 BC ⊥ AMg ≡ x3 = u1 AC ≡ AB.

We apply redlog to the input ϕ ≡ ∀x1∀x2∀x3(h1 ∧ h2 ∧ h3 −→ g).Generic quantifier elimination yields after 10 ms the quantifier-free formula ϕ′ ≡true plus the subsidiary condition ϑ′ ≡ u1 6= 0 stating that A and B are actuallydistinct points. Regular quantifier elimination yields after 20 ms ϕ′ ≡ true. Soϑ′ is superfluous but still reasonable.

This quantifier elimination can also be performed using qepcad. After lessthan 10 ms one obtains ϕ′ ≡ true.

Example 3.11 (Distances in square figure) Let ABCD be a square, letCG be a parallel to the diagonal BD, and let E be a point on CG with BE ≡BD. Denote the intersection of BE and DC by F . Then DF ≡ DE. SeeFigure 3.5.

The coordinates for the corner points of the square are given as A = (0, 0),B = (u1, 0), C = (u1, u1), and D = (0, u1). The constructed points E and Ftake coordinates E = (x1, x2) and F = (x3, u1). The hypothesises h1, h2, h3

Page 58: public pdf

58 CHAPTER 3. GEOMETRIC THEOREM PROVING

F

A B

CD

E

F

A B

CD

E

Figure 3.5: Two types of configurations for Example 3.11

A B

NI

DA3

C

A1A2

Figure 3.6: Feuerbach’s theorem (Example 3.12)

and the conclusion g read as follows:

h1 ≡ x22 + x2

1 − 2u1x1 − u21 = 0 BE ≡ BD

h2 ≡ −u1x2 − u1x1 + 2u21 = 0 CE ‖ BD

h3 ≡ −x2x3 + u1x2 + u1x1 − u21 = 0 F ∈ BE

g ≡ x23 − x2

2 + 2u1x2 − x21 − u2

1 = 0 DF ≡ DE.

Generic quantifier elimination yields after 60 ms the non-degeneracy condi-tion ϑ′ ≡ u1 6= 0 stating that ABCD is a proper square, and the eliminationresult ϕ′ ≡ true.

Regular quantifier elimination by virtual substitution cannot be applied sincethis example violates the degree restrictions of the redlog implementation.qepcad computes u1 6= 0 as quantifier-free equivalent, which takes 1 s with 106

cells. This shows that the non-degeneracy condition is actually necessary forthe conjecture to hold.

Note that the algebraic translation does not distinguish between the twopossible types of configurations sketched in Figure 3.5. We have thus provedthe conjecture for both of them.

Example 3.12 (Feuerbach’s theorem) The nine point circle of a triangle istangent to the incircle and to each of the excircles of the triangle. See Fig-ure 3.6.

The incircle of a triangle is the circle that is tangent to the three sides; its centeris the intersection of the bisectors. An excircle, or escribed circle, of a triangle

Page 59: public pdf

3.8. A COLLECTION OF AUTOMATIC PROOFS 59

is a circle tangent to one side of the triangle and to the extensions of the othersides. The nine point circle of a triangle is the circle that passes through themidpoints of the sides. It also contains the feet of the three altitudes.

Chou gives two alternatives for the algebraic translation of this conjecture.From the first one, we can by generic quantifier elimination eliminate 8 out of9 quantifiers. Then the procedure fails due to the degree blowup with x1 beingof degree 4.

Generic quantifier elimination succeeds, however, with the second translationvariant, in which the triangle ABI is freely chosen:

D = (0, 0), A = (u1, 0), I = (0, u2), B = (u3, 0).

The remaining points are constructed from this triangle:

C = (x1, x2), A1 = (x3, x4), A2 = (x5, x6), A3 = (x7, 0), N = (x8, x9).

With these coordinates, the hypothesises are as follows:

h1 ≡ (u22 − u2

1)u3 − u1u22 + u3

1)x2

+ (−2u1u2u3 + 2u21u2)x1

+ 2u21u2u3 − 2u3

1u2 = 0 tan(∠CBI) = tan(∠IBA)h2 ≡ (u3

3 − u1u23 − u2

2u3 + u1u22)x2

+ (2u2u23 − 2u1u2u3)x1

− 2u2u33 + 2u1u2u

23 = 0 tan(∠CAI) = tan(∠IAB)

h3 ≡ 2x3 − x1 − u3 = 0h4 ≡ 2x4 − x2 = 0 A1 = midpoint(B,C)h5 ≡ 2x5 − x1 − u1 = 0h6 ≡ 2x6 − x2 = 0 A2 = midpoint(A,C)h7 ≡ 2x7 − u3 − u1 = 0 A3 = midpoint(A,B)h8 ≡ 2x6x9 + (−2x7 + 2x5)x8

+x27 − x2

6 − x25 = 0 NA3 ≡ NA2

h9 ≡ 2x4x9 + (−2x7 + 2x3)x8

+x27 − x2

4 − x23 = 0 NA3 ≡ NA1.

For this choice of coordinates, Chou leaves out the conclusion. We use thefollowing conclusion g expressing the fact that the distance between the centerof the 9-point circle and the center of the incircle or an excircle equals thedifference or the sum of the respective radii:

(2x28+2x2

9+x27−2x7x8−2x9u2)

2 = 4(x28−2x7x8+x2

7+x29)(x

28+x2

9−2x9u2+u22).

On input of ∀x1 . . . ∀x9(h1 ∧ · · · ∧ h9 −→ g) we obtain the following non-degeneracy conditions:

ϑ′ ≡ u1u3 + u22 6= 0 ∧ u1 + u2 6= 0 ∧

u1 − u2 6= 0 ∧ u1 − u3 6= 0 ∧ u1 6= 0 ∧ u2 6= 0 ∧ u3 6= 0.

The condition u1u3 +u22 6= 0 states that ∠ACB 6= 0, the conditions u1 +u2 6= 0

and u1 − u2 6= 0 say that ∠BAC and ∠CAB are not right angles, respectively.Finally u1 6= 0 ∧ u2 6= 0 ∧ u3 6= 0 states that ABC is a proper triangle. Theelimination result is ϕ′ ≡ true. This computation takes 1.4 s.

Page 60: public pdf

60 CHAPTER 3. GEOMETRIC THEOREM PROVING

A M B

E

D

C

G

F

A B

C

M

D

EF

G

Figure 3.7: The two types of valid configurations for Example 3.13

Example 3.13 (Squares on a triangle) On the two sides AC and BC of atriangle ABC, there are two squares ACDE and BCFG drawn. Denote by Mthe midpoint of AB. Then DF ≡ 2CM . See Figure 3.7.

After choosing coordinates A = (u1, 0), B = (u2, u3), C = (0, 0), D =(0, u1), F = (x1, x2), and M = (x3, x4), Chou’s hypothesises h1, . . . , h4 andconclusion g read as follows:

h1 ≡ x22 + x2

1 − u23 − u2

2 = 0 CF ≡ BCh2 ≡ u3x2 + u2x1 = 0 CF ⊥ BCh3 ≡ 2x3 − u2 − u1 = 0h4 ≡ 2x4 − u3 = 0 M = midpoint(A,B)g ≡ 4x2

4 + 4x23 − x2

2 + 2u1x2 − x21 − u2

1 = 0 DF ≡ 2CM.

On input of ϕ ≡ ∀x1 . . .∀x4(h1 ∧ · · · ∧ h4 −→ g), generic quantifier eliminationyields after 30 ms the surprising results ϑ′ ≡ u3 6= 0 and

ϕ′ ≡ u1 = 0 ∨ u2 = 0.

The condition ϕ′ obviously claims a degenerate triangle ABC. Regular quan-tifier elimination plus final Grobner simplification shows after 30 ms that ϕ′ isequivalent to ϕ already without the side condition ϑ′.

Chou has observed that the conjecture of Example 3.13 in fact does nothold in the generality assumed by the algebraic translation ϕ. For the con-jecture to hold, it is crucial that either both squares are outside the triangle,or both squares intersect the triangle. These two types of valid configurationsare pictured in Figure 3.7. Figure 3.8 shows, in contrast, an invalid geometricconfiguration satisfying ϕ. According to Chou, the valid configurations in theabove sense are exactly those satisfying the condition

δ :=−u2

1u23

u21u2x2 − u2

1u3x1> 0.

Quantifier elimination could not derive this condition because it involves thedependent variables x1 and x2. While Chou’s algebraic prover cannot prove the

Page 61: public pdf

3.8. A COLLECTION OF AUTOMATIC PROOFS 61

A B

C

M

E

E

D

F

Figure 3.8: An invalid configuration for Example 3.13

conjecture for these configurations fully automatically, our real generic quanti-fier elimination allows to add δ > 0 to the hypothesises as follows: Since thenumerator of δ cannot become positive, we may simply add

u1 6= 0 ∧ u3 6= 0 ∧ u2x2 − u3x1 < 0.

We allow ourselves to drop the first two constituents of the conjunction sincethese are non-degeneracy conditions, which we may expect our prover to detectautomatically. On input of

ϕ ≡ ∀x1 . . .∀x4(h1 ∧ · · · ∧ h4 ∧ u2x2 − u3x1 < 0 −→ g),

generic quantifier elimination yields after 30 ms the result ϕ′ ≡ true subjectto the non-degeneracy condition ϑ′ ≡ u3 6= 0. Regular quantifier eliminationyields ϕ′ ≡ true after 310 ms. This shows that the subsidiary condition ϑ′,which states that ABC does not degenerate to a line, is not really necessary forthe conjecture to hold.

Example 3.14 (M. Paterson’s problem) Consider a triangle ABC. Erectthree similar isosceles triangles A1BC, AB1C, and ABC1 on the sides BC, CA,and AB, respectively. Show that AA1, BB1, and CC1 are concurrent. Howdoes the point of concurrency move as the areas of the three similar trianglesare varied between 0 and ∞? See Figure 3.9.

For proving the concurrency, let A = (0, 0), B = (u1, 0), C = (u2, u3),C1 = (x2, x1), A1 = (x4, x3), B1 = (x6, x5), and O = (x8, x7), where O denotesthe point of concurrency. With these coordinates, Chou models hypothesises

Page 62: public pdf

62 CHAPTER 3. GEOMETRIC THEOREM PROVING

B

C

A

B1

A1

C1

Figure 3.9: M. Paterson’s problem (Example 3.14)

h1, . . . , h7 and conclusion g as follows:

h1 ≡ 2u1x1 − u21 = 0 C1A ≡ C1B

h2 ≡ (u1u3x1 + (u1u2 − u21)u4)x3 +

((−u1u2 + u21)x1 + u1u3u4)x2 −

u21u3x1 + (−u2

1u2 + u31)u4 = 0 tan(∠BAC1) = tan(∠CBA1)

h3 ≡ (2u2 − 2u1)x3 +2u3x2 − u2

3 − u22 + u2

1 = 0 A1B ≡ A1Ch4 ≡ (u1u3x1 + u1u2u4)x5 +

(−u1u2x1 + u1u3u4)x4 +(−u1u

23 − u1u

22)u4 = 0 tan(∠BAC1) = tan(∠ACB1)

h5 ≡ 2u2x5 + 2u3x4 − u23 − u2

2 = 0 B1A ≡ B1Ch6 ≡ x4x7 + (−x5 + u1)x6 − u1x4 = 0 O ∈ BB1

h7 ≡ x2x7 − x3x6 = 0 O ∈ AA1

g ≡ (u4 − u3)x7 + (−x1 + u2)x6 +u3x1 − u2u4 = 0 collinear(O,C,C1).

After 610 ms, generic quantifier elimination yields ϕ′ ≡ true and the follow-ing non-degeneracy conditions:

ϑ′ ≡ u21 − 2u1u2 + u2

2 + u23 6= 0 ∧ u1u3 − 2u1u4 + 2u2u4 6= 0 ∧

u1u3 + 2u2u4 6= 0 ∧ u1u3 − 2u2u4 6= 0 ∧ u1 6= 0 ∧ u2 6= 0.

The first condition (u1 − u2)2 + u2

3 6= 0 is equivalent to u1 6= u2 ∧ u3 6= 0. Thistogether with u1 6= 0 ∧ u2 6= 0 states that ABC be a proper triangle. Theremaining negated equations are non-collinearity conditions.

The next question is on the locus of the point O of concurrency as the areaof the three similar triangles is varied. This is actually rather theorem findingthan just theorem proving. We choose new coordinates as follows: A = (0, 0),B = (u1, 0), C = (u2, u3), O = (x, y), C1 = (x2, x1), B1 = (x4, x3). Thecoordinates x and y of O are extra parameters. The hypothesises h1, . . . , h4

Page 63: public pdf

3.8. A COLLECTION OF AUTOMATIC PROOFS 63

C

E

F

D

A G B

Figure 3.10: Gergonne’s theorem (Example 3.15)

and the conclusion g are as follows:

h1 ≡ (y − u3)x2 + (−x+ u2)x1 −u2y + u3x = 0 C1 ∈ OC

h2 ≡ 2u1x2 − u21 = 0 C1A ≡ C1B

h3 ≡ yx4 + (−x+ u1)x3 − u1y = 0 B1 ∈ OBh4 ≡ 2u2x4 + 2u3x3 − u2

3 − u22 = 0 B1A ≡ B1C

g ≡ (u1u3x2 + u1u2x1)x4 +(−u1u2x2 + u1u3x1)x3 +(−u1u

23 − u1u

22)x1 = 0 tan(∠BAC1) = tan(∠ACB1).

On input of ∀x1 . . .∀x4(h1 ∧ · · · ∧ h4 −→ g) we obtain by generic quantifierelimination the elimination result

ϕ′ ≡ u21u2y + u2

1u3x− 2u21xy + u1u

22y − 2u1u2u3x+ 2u1u2xy − u1u

23y −

u1u3x2 + u1u3y

2 − 2u22xy + 2u2u3x

2 − 2u2u3y2 + 2u2

3xy = 0 ∨u1 = 0 ∨ (u2 = 0 ∧ u3 = 0)

under the subsidiary conditions

ϑ′ ≡ u1u2 − u2x− u3y 6= 0 ∧ u2 − x 6= 0 ∧ y 6= 0.

Chou gives the following solution, which seems not compatible with ours:

R0 = u21(u

23+u2

2)(

ay2+2bxy+cu3x2+(u1u

23−u1u

22−u2

1u2)y+(2u1u2−u21

)

u3x).

We suspect that there is a typo in R0, such that it should actually read asfollows:

R0 = u21(u

23 +u2

2)(

ay2 +2bxy+ cx2 +(u1u23−u1u

22−u2

1u2)y+(2u1u2−u21

)

u3x).

If this is the case, then our ϕ′ provides a factorization of Chou’s R0, where theconditions −u2

1 = 0 and u23 + u2

2 = 0 are equivalently replaced by u1 = 0 andu2 = 0 ∧ u3 = 0, respectively. This example takes 110 ms.

Example 3.15 (Gergonne’s theorem) Consider a triangle ABC and a mov-ing point D. From D draw three perpendicular lines with feet E, F , and G tothe three sides of the triangle ABC. What is the locus of the point D for thearea of the triangle EFG to remain constant? See Figure 3.10.

Page 64: public pdf

64 CHAPTER 3. GEOMETRIC THEOREM PROVING

C

A BFG

O

Figure 3.11: Angle at circumference vs. angle at center (Example 3.16)

Similar to the previous one, this final example taken from Chou is also con-cerned with finding theorems rather than proving theorems. It is a generaliza-tion of Simson’s theorem discussed as Example 3.9. We let the area of EFG bea/2, and choose coordinates A = (0, 0), B = (u1, 0), C = (u2, u3), D = (x, y),E = (x2, x1), F = (x4, x3), and G = (x, 0). The hypothesises h1, . . . , h4 andthe conclusion g read as follows:

h1 ≡ u3x2 + (−u2 + u1)x1 − u1u3 = 0 E ∈ BCh2 ≡ (u2 − u1)x2 + u3x1 − u3y + (−u2 + u1)x = 0 ED ⊥ BCh3 ≡ u3x4 − u2x3 = 0 F ∈ ACh4 ≡ u2x4 + u3x3 − u3y − u2x = 0 FD ⊥ ACg ≡ x1x4 + (−x2 + x)x3 − xx1 + a = 0 A(EFG) = a/2.

After 160 ms of computation time, we get by generic quantifier eliminationthe following elimination result:

ϕ′ ≡ au21u

22 + au2

1u23 − 2au1u

32 − 2au1u2u

23 + au4

2 + 2au22u

23 + au4

3 +

u21u2u

23y − u2

1u33x− u1u

22u

23y − u1u

43y + u1u

33x

2 + u1u33y

2 = 0.

Chou obtains exactly the same equation for the locus of point D.

We furthermore obtain the non-degeneracy conditions

ϑ′ ≡ u21 − 2u1u2 + u2

2 + u23 6= 0 ∧ u2 6= 0 ∧ u3 6= 0.

The first condition (u1 + u2)2 + u2

3 6= 0 is obviously implied by u3 6= 0 and canthus be dropped. The condition u2 6= 0 states that ∠BAC is not a right angle,and the condition u3 6= 0 states that ABC is a proper triangle.

3.8.2 Further Examples Requiring a Real Prover

Example 3.16 (Angle at circumference) Let O be the center of the cir-cumcircle of a triangle ABC . If O does not lie outside of ABC , then ∠ACB =∠AOB/2. See Figure 3.11.

At the end of the discussion of this example, we will generalize the conjecturedropping the restriction that O must be inside ABC .

Page 65: public pdf

3.8. A COLLECTION OF AUTOMATIC PROOFS 65

We choose coordinates A = (−u1, 0), B = (u1, 0), and C = (u2, u3) for thetriangle. The center O = (0, x1) of the circumcircle is then determined via itsradius r2 = u2

1 + x21 = u2

2 + (u3 − x1)2.

Denoting by F = (0, u3) the foot of the perpendicular from C onto AB, wesplit the angle at circumference: ∠ACB = ∠ACF +∠FCB . Its two componentsare encoded into tangents with

tan(∠ACF ) =u1 + u2

u3and tan(∠FCB) =

u1 − u2

u3.

By an addition theorem for tangents we know that

tan(∠ACB) = tan(∠ACF + ∠FCB) =tan(∠ACF ) + tan(∠FCB)

1− tan(∠ACF ) tan(∠FCB).

Denote by G = (0, x1) the foot of the perpendicular from O onto AB. Then∠AOG is obviously half the angle ∠AOB at center. By encoding into tangentswe obtain

tan(

∠AOB

2

)

= tan(∠AOG) =u1

x1.

The conclusion of our conjecture states that ∠ACB = ∠AOB/2, which wedescribe by tan(∠ACB) = tan(∠AOB/2).

We finally arrive at the following algebraic translation in which the varioustangents occur as real variables t1, t2, t, and t′:

ϕ ≡ ∀r∀x1∀t1∀t2∀t∀t′(

r2 = u21 + x2

1 ∧ r2 = u22 + (u3 − x1)

2 ∧u3t1 = u1 + u2 ∧ u3t2 = u1 − u2 ∧ (1− t1t2)t = t1 + t2 ∧x1t

′ = u1 −→ t = t′)

.

After 70 ms of computation time, we obtain by generic quantifier eliminationϕ′ ≡ true and the non-degeneracy conditions ϑ′ ≡ u1 6= 0 ∧ u3 6= 0 stating thatABC is a non-degenerate triangle.

Note that there is no condition prohibiting that AOB degenerates to aline. Our proof thus covers the important special case that ∠AOB = 180◦

and ∠ACB = 90◦: Thales’ theorem.Regular quantifier elimination and successive Grobner simplification yields

after 150 ms an exact quantifier-free equivalent of our algebraic translation:ϕ′ ≡ u1 6= 0 ∨ u2 6= 0 ∨ u3 6= 0.

Note that we have not added to our hypothesises the constraint that thecenter O of the circumcircle must lie inside the triangle ABC . Suppose nowthat O lies outside of ABC . That is, in Figure 3.11 we choose a point C belowthe line AB . Then the angle at circumcircle is obviously larger than with Cchosen above AB . In fact, any geometry textbook will state that then theangle at circumference is ∠BCA = 180◦−∠AOB for the smaller segment of thecircumcircle. Let us, however, not switch to ∠BCA, but continuously consider

∠ACB = 360◦ − (180◦ − ∠AOB) = 180◦ + ∠AOB.

Since certainly tan(α) = tan(180◦ + α) for any angle α, our translation turnsout to be completely uniform. In other words, we have already proved thegeneralized theorem.

Page 66: public pdf

66 CHAPTER 3. GEOMETRIC THEOREM PROVING

C

A BX

V

O

M

Figure 3.12: The median bisector theorem (Example 3.5 and Example 3.17)

Example 3.17 (Median bisector theorem) Consider a non-isosceles trian-gle ABC . The median over the side AB is always greater than the interiorbisector on the same side. See Figure 3.12.

This example and some ideas for its algebraic translation are taken from[Wu92], pp. 7–8. To prove the theorem, we take coordinates such that

A = (−1, 0), B = (1, 0), C = (u1, u2).

We may wlog. assume that u2 > 0. Since the origin O = (0, 0) is the mid pointof AB , we have that CO is the median on AB .

We construct the bisector using the geometric theorem of the previous Ex-ample 3.16. The center M = (0, x1) of the circumcircle of the triangle ABC isdetermined by its radius r > 0:

r2 = 1 + x21 = u2

1 + (u2 − x1)2.

We know that ∠ACB = ∠AMB/2. Let now V = (0, x1−r) be the lower extrem-ity of the circumcircle. Since our circumcircle is certainly also the circumcircle ofthe triangle AVC and ∠AMV = ∠AMB/2, it follows that ∠ACV = ∠ACB/2.If we thus let X = (x2, 0) be the intersection between CV and AB ,

u2

u1 − x2x2 + (x1 − r) = 0,

then CX is the interior bisector on the side AB .We come to the following algebraic translation:

ϕ ≡ ∀x1∀r∀x2

(

u2 > 0 ∧ r > 0 ∧ r2 = 1 + x21 ∧ r2 = u2

1 + (u2 − x1)2 ∧

u2x2 + (x1 − r)(u1 − x2) = 0 −→ u21 + u2

2 > (u1 − x2)2 + u2

2

)

.

After 380 ms elimination time, we obtain the non-degeneracy conditionsϑ′ ≡ u1 6= 0 ∧ u2 6= 0, stating that ABC is non-degenerate, plus a quantifier-free equivalent ϕ′ containing 13 atomic formulas:

ϕ′ ≡ u41 + 2u2

1u22 − 2u2

1 + u42 + 2u2

2 + 1 < 0 ∨(

(u41u2 − 2u2

1u2 + u52 + 2u3

2 + u2 > 0 ∨ u21 + 2u1 + u2

2 + 1 = 0 ∨

Page 67: public pdf

3.8. A COLLECTION OF AUTOMATIC PROOFS 67

u21 − 2u1 + u2

2 + 1 = 0 ∨ u2 6 0 ∨ u41 + 2u2

1 − u42 − 2u2

2 − 1 > 0 ∧2u2

1 − 2u22 − 1 > 0) ∧ (u4

1u2 − 2u21u2 + u5

2 + 2u32 + u2 6 0 ∨

u41 + 2u2

1 − u42 − 2u2

2 − 1 > 0 ∨ 2u21 − 2u2

2 − 1 < 0 ∨u2

1 + 2u1 + u22 + 1 = 0 ∨ u2

1 − 2u1 + u22 + 1 = 0 ∨ u2 6 0)

)

.

This result ϕ′ can hardly be interpreted geometrically. Luckily, it turns out tobe equivalent to “true” under the assumptions ϑ′. qepcad yields within 1 sthat

∀u1∀u2

(

ϑ′(u1, u2) −→ ϕ′(u1, u2))

,

which finally proves the conjecture ϕ wrt. ϑ′. Due to the degree restrictions,this final step cannot be performed via regular quantifier elimination by virtualsubstitution.

The result ϕ′ of the generic quantifier elimination obviously suffered frominsufficient simplification. This weakness could be overcome by another quan-tifier elimination step, which shows that quantifier elimination is an extremelyuniversal, flexible, and powerful tool.

In case that the final proving step ϑ′ −→ ϕ′ does not succeed, one has tocarefully analyze the situation. Assume, for instance, that we model Exam-ple 3.17 slightly more general by not normalizing the side AB to 2 but to 2u3

by taking coordinates A = (−u3, 0), B = (u3, 0), and the rest as above. Thealgebraic translation ϕ then becomes

ϕ ≡ ∀x1∀r∀x2

(

u2 > 0 ∧ r > 0 ∧ r2 = u23 + x2

1 ∧ r2 = u21 + (u2 − x1)

2 ∧u2x2 + (x1 − r)(u1 − x2) = 0 −→ u2

1 + u22 > (u1 − x2)

2 + u22

)

.

Generic quantifier elimination on this new ϕ yields after 530 ms ϑ′ ≡ ϑ′, and

a quantifier-free formula ϕ′ with 21 atomic formulas similar to ϕ′ above. Thistime, however, qepcad obtains after 3 s the result “false” on input of

∀u1∀u2∀u3

(

ϑ′(u1, u2, u3) −→ ϕ′(u1, u2, u3)

)

.

This means that there are non-degeneracy conditions missing, which certainlycannot be detected during this elimination step, since all the remaining param-eters have become quantified variables. We happen to know that the remainingnon-degeneracy condition will most probably involve u3, and we thus applyqepcad to

∀u1∀u2

(

ϑ′(u1, u2, u3) −→ ϕ′(u1, u2, u3)

)

leaving u3 as a parameter. After 3 s we obtain the expected condition u3 6= 0,which states that that triangle must not degenerate on the line AB . Gener-ally, one can use such eliminations on the final result to remove at least some“uncritical” variables, and hope to come to an interpretable result.

Example 3.18 (Pedoe’s inequality) Consider two arbitrary triangles ABCand A′B ′C ′ with sides a, b, c and a′, b′, c′ respectively. The areas ∆ and ∆′ ofthis triangles satisfy the following inequality:

a′2(b2 + c2 − a2) + b′2(c2 + a2 − b2) + c′2(a2 + b2 − c2) > 16∆′∆.

Page 68: public pdf

68 CHAPTER 3. GEOMETRIC THEOREM PROVING

B

C’C

B’A=A’

Figure 3.13: Modeling Pedoe’s inequality (Example 3.18)

This example is taken from Wang [Wan95b], pp. 158–160. We choose coor-dinates A = A′ = (0, 0), B = (u1, 0), B′ = (u2, 0), C = (u3, u4), C

′ = (u5, u6).Then the triangle side lengths a, b, and c are determined by

a2 = (u1 − u3)2 + u2

4, b2 = u23 + u2

4, c2 = u21.

The sides a′, b′, and c′ are obtained analogously. The areas are determinedby ∆ = cu4/2 and ∆′ = c′u6/2, respectively. With these naming conventionsthe conclusion can be stated exactly as in the conjecture in Example 3.4. Ouralgebraic translation reads as follows:

ϕ ≡ ∀a∀b∀c∀a′∀b′∀c′∀∆∀∆′(a2 = (u1 − u3)2 + u2

4 ∧ b2 = u23 + u2

4 ∧c2 = u2

1 ∧ a′2 = (u2 − u5)2 + u2

6 ∧ b′2 = u25 + u2

6 ∧ c′2 = u22 ∧

∆ = cu4/2 ∧ ∆′ = c′u6/2 −→a′2(b2 + c2 − a2) + b′2(c2 + a2 − b2) + c′2(a2 + b2 − c2) > 16∆′∆

)

.

Applying generic quantifier elimination to ϕ yields after 150 ms no non-degeneracy conditions at all, formally ϑ′ ≡ true, and the following quantifier-freeformula:

ϕ′ ≡ (u21u

25 + u2

1u26 − 2u1u2u3u5 + 2u1u2u4u6 + u2

2u23 + u2

2u24 > 0 ∨

u21 − 2u1u3 + u2

3 + u24 < 0 ∨ u2

2 − 2u2u5 + u25 + u2

6 < 0) ∧(u2

1u25 + u2

1u26 − 2u1u2u3u5 − 2u1u2u4u6 + u2

2u23 + u2

2u24 > 0 ∨

u21 − 2u1u3 + u2

3 + u24 < 0 ∨ u2

2 − 2u2u5 + u25 + u2

6 < 0).

Regular quantifier elimination checks within 1.3 s that

∀u1 . . . ∀u6ϕ′(u1, . . . , u6)←→ true.

The entire procedure can certainly be performed also in one step by applyingregular quantifier elimination to

∀u1 . . . ∀u6∀a∀b∀c∀a′∀b′∀c′∀∆∀∆′ϕ(u1, . . . , u6, a, b, c, a′, b′, c′,∆,∆′).

Proceeding this way, however, we would loose the chance to detect subsidiaryconditions during the first generic step.

Page 69: public pdf

3.8. A COLLECTION OF AUTOMATIC PROOFS 69

Wang [Wan95b] has proved Pedoe’s inequality putting more human intelli-gence into the algebraic translation. His translation is, up to different namesfor the coordinates, the inequality

u25 + u2

1u26 − 2u1u2u3u5 − 2u1u2u4u6 + u2

2u23 + u2

2u24 > 0

contained in our ϕ′. Wu [Wu87] has automatically proved Pedoe’s inequalityin a purely algebraic setting by determining the extremal values of the areas ∆and ∆′.

Example 3.19 (Qin–Heron’s formula) Determine the area ∆ of a triangleABC in terms of its three sides.

Here we do once more not only prove but actually find a theorem. TheQin–Heron formula has been mechanically derived also by Wang [Wan95b] andby Wu [Wu86b].

We locate A = (−u1, 0), B = (u1, 0), and C = (u2, u3). Then the sidelengths are determined as follows:

a2 = (u1 − u2)2 + u2

3, b2 = (−u1 − u2)2 + u2

3, and c = 2u1.

On the other hand we know ∆ = cu3/2 = u1u3. This yields our translation ϕwith parameters a, b, and c:

ϕ ≡ ∃u1∃u2∃u3

(

∆ = u1u3 ∧a2 = (u1 − u2)

2 + u23 ∧ b2 = (−u1 − u2)

2 + u23 ∧ c = 2u1

)

.

After 136 ms, generic quantifier elimination obtains ϑ′ ≡ c 6= 0, i.e., thepoints A and B are distinct. The quantifier-free result looks after Grobnersimplification (60 ms) as follows:

ϕ′ ≡ a4 − 2a2b2 − 2a2c2 + b4 − 2b2c2 + c4 + 16∆2 = 0 ∧ a2c2 − 4∆2> 0.

The inequality follows from the equation as regular quantifier elimination on

∀a∀b∀c∀∆(a4− 2a2b2− 2a2c2 + b4− 2b2c2 + c4 + 16∆2 = 0 −→ a2c2− 4∆2> 0)

proves within less than 10 ms. Setting s = (a + b + c)/2, the equation can berewritten as Heron’s formula ∆2 = s(s− a)(s− b)(s− c).

Example 3.20 (MacLane) Consider eight points A, . . . , H such that thefollowing eight triples are collinear ABD , BCE , CDF , DEG , EFH , FGA, GHB ,HAC . Then all eight points lie on a line.

This example is originally due to MacLane [Mac36]. It holds in the realplane but amazingly fails in the complex plane.

We adopt a quite sophisticated translation proposed by Kutzler [Kut88]. Thecoordinates for the points are A = (0, 0), B = (xb, 0), C = (xc, yc), D = (xd, 0),E = (xe, ye), . . . , H = (xh, yh). Note that three points (x1, y1), (x2, y2), and(x3, y3) are collinear if and only if

(y2 − y1)x3 + (x1 − x2)y3 + (x2y1 − x1y2) = 0.

Page 70: public pdf

70 CHAPTER 3. GEOMETRIC THEOREM PROVING

The entire algebraic translation reads as follows:

ϕ ≡ ∀yh∀xe∀ye∀xf∀yf∀xg∀yg(xhyc − xcyh = 0 ∧ xgyf − xfyg = 0 ∧xbye − xcye + xeyc − xbyc = 0 ∧ xbyh − xgyh + xhyg − xbyg = 0 ∧xcyf − xdyf − xfyc + xdyc = 0 ∧ xdyg − xeyg + xgye − xdye = 0 ∧xeyh − xfyh + xhyf − xeyf − xhye + xfye = 0 −→ xbyc = 0).

Generic quantifier elimination yields after 4.3 s the elimination result ϕ′ ≡true. The subsidiary conditions are the following:

ϑ′ ≡ x2bx

2h − xbxcxdxh − xbxdx

2h + x2

cx2d − xcx

2dxh + x2

dx2h 6= 0 ∧

x2bxh − xbxcxd − xbxcxh + xcxdxh 6= 0 ∧x2

bxh − xbxcxd − xbxdxh + x2dxh 6= 0 ∧

xb − xc 6= 0 ∧ xb − xd 6= 0 ∧ xb − xh 6= 0 ∧ xc − xd 6= 0 ∧xc − xh 6= 0 ∧ xc 6= 0 ∧ xd 6= 0 ∧ xh 6= 0.

Except for the first three inequalities, all these conditions are obvious geometricnon-degeneracy conditions. The first inequality follows from the geometric onesas regular quantifier elimination shows in 330 ms, and is thus redundant.

We rerun our method with the option permitting only monomial assump-tions: After 7.8 s we obtain a quantifier-free formula ϕ′ with 204 atomic formulasand the following non-degeneracy conditions ϑ′:

xc 6= 0 ∧ xh 6= 0 ∧ yc 6= 0.

Within 15.6 s, our theory generator obtains ϑ′′ by adding to ϑ′ assumptions,which make it sufficient for ϕ′ and thus for ϕ:

ϑ′′ ≡ x2bx

2h − xbxcxdxh − xbxdx

2h + x2

cx2d − xcx

2dxh + x2

dx2h 6= 0 ∧

xb − xd 6= 0 ∧ xc − xh 6= 0 ∧ xc 6= 0 ∧ xd 6= 0 ∧ xh 6= 0 ∧ yc 6= 0.

Again, our general method proves that the first negated equation follows fromthe remaining non-degeneracy conditions (140 ms).

We have finally proved that MacLane’s conjecture holds under the followingnon-degeneracy conditions, which all prohibit coincidence of certain points:

xb − xd 6= 0 ∧ xc − xh 6= 0 ∧ xc 6= 0 ∧ xd 6= 0 ∧ xh 6= 0 ∧ yc 6= 0.

Example 3.21 (Pompeiu’s theorem) Let ABC be a equilateral triangle,and let P be some point not on the circumcircle of ABC , then the segmentsAP , BP , CP can be used to form a triangle. That is, the sum of the lengths ofany two of them exceeds the length of the third one. See Figure 3.14.

This example is taken from McPhee, Chou, and Gao [MCG94]. We firstliterally adopt the algebraic formulation given there.

ϕ ≡ ∀x0∀x1∀x2∀x3∀x4∀u0∀u1(4x20 − 3 = 0 ∧ 2x1 + 1 = 0 ∧

x24 − 2x4 + x2

3 − u20 + 1 = 0 ∧ u0 > 0 ∧

x24 − 2x1x4 + x2

3 + 2x0x3 + x21 + x2

0 − u21 = 0 ∧ u1 > 0 ∧

x24 − 2x1x4 + x2

3 − 2x0x3 − x22 + x2

1 + x20 = 0 ∧ x2 > 0 ∧

x24 + x2

3 − 1 6= 0 −→ x2 − u0 − u1 < 0).

Page 71: public pdf

3.8. A COLLECTION OF AUTOMATIC PROOFS 71

A

C

P

B

Figure 3.14: Pompeiu’s theorem (Example 3.21)

Note that there are no parameters; all the variables are quantified. The non-degeneracy condition γ ≡ x2

4 + x23 − 1 6= 0 is explicitly added as a hypothesis.

Eliminating all the quantifiers by regular quantifier elimination yields ϕ ≡ trueafter 180 ms.

Next, we delete γ from the hypotheses, and eliminate only the dependentvariables u0, u1, and x2:

ϕ ≡ ∀x1∀x2∀u0(4x20 − 3 = 0 ∧ 2x1 + 1 = 0 ∧ x2

4 − 2x4 + x23 − u2

0 + 1 = 0 ∧u0 > 0 ∧ x2

4 − 2x1x4 + x23 + 2x0x3 + x2

1 + x20 − u2

1 = 0 ∧ u1 > 0 ∧x2

4 − 2x1x4 + x23 − 2x0x3 − x2

2 + x21 + x2

0 = 0 ∧ x2 > 0 −→x2 − u0 − u1 < 0).

Generic quantifier elimination yields after 80 ms a formula ϕ′ containing 7atomic formulas:

ϕ′ ≡ 12x20x

23 − 4x2

0x24 + 8x2

0x4 − 4x20 − 4x2

1x23 − 4x2

1x24 + 8x2

1x4 − 4x21 +

8x1x23x4 + 8x1x

34 − 16x1x

24 + 8x1x4 − 3x4

3 − 6x23x

24 + 4x2

3x4 − 2x23 −

3x44 + 4x3

4 + 2x24 − 4x4 + 1 < 0 ∨

4x20 − 3 6= 0 ∨ x2

0 + 2x0x3 + x21 − 2x1x4 + x2

3 + x24 6 0 ∨

x20 − 2x0x3 + x2

1 − 2x1x4 + x23 + x2

4 6 0 ∨4x0x3 + x2

3 + x24 − 2x4 + 1 > 0 ∨ 2x1 + 1 6= 0 ∨ x2

3 + x24 − 2x4 + 1 6 0.

Unfortunately, there are no assumptions made: ϑ′ ≡ true.

We proceed by eliminating also x0 and x1 in order to find a necessary andsufficient condition in terms of the point (x3, x4) for the theorem to hold. Thiselimination yields 12 atomic formulas after 100 ms, again without any assump-tions. The Grobner simplifier reduces the result within 90 ms to the followingnecessary and sufficient condition ϕ′′(x3, x4) for ϕ to hold.

ϕ′′ ≡ x23 +x2

4−1 6= 0 ∨ 2x24−x4−1 > 0 ∨ 2x4 +1 = 0 ∨ x4 +2 6 0 ∨ x4−1 > 0.

An improved standard simplifier, which is not part of redlog 2.0, simplifiesϕ′′ in less than 10 ms by factorizing the second condition 2x2

4 − x4 − 1 > 0 ofϕ′′ into (x4 − 1 > 0 ∧ 2x4 + 1 > 0) ∨ (x4 − 1 < 0 ∧ 2x4 + 1 < 0), and thenapplying the ordinary standard simplification. This yields our final result:

ϕ′′′ ≡ x23 + x2

4 − 1 6= 0 ∨ 2x4 + 1 6 0 ∨ x4 − 1 > 0.

Page 72: public pdf

72 CHAPTER 3. GEOMETRIC THEOREM PROVING

A

C

M

X

Y

V

BW

Figure 3.15: A variant of the Steiner–Lehmus theorem (Example 3.22)

In ϕ′′′, the inequality x23 + x2

4 − 1 6= 0 states that (x3, x4) be not on thecircumcircle. Surprisingly, the condition 2x4 + 1 6 0 allows (x3, x4) to be onthe circumcircle provided that it lies below or on the basis BC . Similarly thecondition x4 − 1 > 0 allows (x3, x4) to coincide with the vertex A. The reasonfor this is that the formulation x2−u0−u1 < 0 of the conclusion is asymmetricleaving out the cases u0−x2−u1 < 0 and u1−u0−x2 < 0. That is, the verticesA, B, and C are excluded already by the hypothesis.

Example 3.22 (Steiner–Lehmus theorem, variant) Assume that ABC isa triangle such that AB > AC . Then the angle bisector from B to AC is longerthan the angle bisector from C to AB . That is, the longer bisector goes to theshorter side. See Figure 3.15.

This example is taken from McPhee, Chou, and Gao [MCG94]. In its orig-inal form, the Steiner–Lehmus theorem states that any triangle with two equalinternal bisectors is isosceles. Its contrapositive follows immediately from thevariant discussed here.

In our algebraic translation, we take coordinates A = (−1, 0), B = (1, 0),and C = (u1, u2) for the triangle. We assume wlog. that both C and the centerM = (0, x1) of the circumcircle of ABC are above AB :

h1 ≡ u2 > 0 ∧ x1 > 0.

The center M = (0, x1) of the circumcircle is determined by its radius:

h2 ≡ r2 = 1 + x21 = u2

1 + (u2 − x1)2.

We can now construct the bisector of ∠ACB as discussed with the medianbisector theorem in Example 3.17: The point V = (0, x2) is the lower extremityof the circumcircle:

h3 ≡ x2 6 0 ∧ r2 = (x2 − x1)2,

and X = (x3, 0) is the intersection between CV and AB . That is, the pointsCXV are collinear:

h4 ≡ u1x2 + u2x3 − x2x3 = 0.

See Example 3.20 for details on formulating collinearity. The line segment CXis the bisector on the side AB .

Page 73: public pdf

3.9. CONCLUSIONS 73

For constructing the bisector on AC using the above technique, we wouldhave to guarantee that both M and C lie on the same side of AC within thecircumcircle, which would cause tedious case distinctions. We thus constructthe bisector on AC more straightforwardly: Let W = (x4, 0) be the point onthe line AB that lies left of B with distance BC :

h5 ≡ x4 6 1 ∧ (x4 − 1)2 = (u1 − 1)2 + u22.

Then the foot Y = (x5, x6) of the bisector on AC is the unique point with equaldistance to both W and C and with AYC collinear:

h6 ≡ (x4 − x5)2 + x2

6 = (u1 − x5)2 + (u2 − x6)

2 ∧ u1x6 − u2x5 − u2 + x6 = 0.

Finally we add to our hypothesises the fact that AC is shorter than AB :

h7 ≡ (−1− u1)2 + u2

2 < 22,

and state the conclusion that CX is shorter than BY :

g ≡ (u1 − x3)2 + u2

2 < (x5 − 1)2 + x26.

On input of ϕ ≡ ∀x6 . . .∀x1∀r(h1 ∧ · · · ∧ h7 −→ g), generic quantifierelimination yields after 106 s a quantifier-free formula ϕ′ containing 231 atomicformulas plus the subsidiary conditions

ϑ′ ≡ u21 − 2u1 + u2

2 − 3 6= 0 ∧ u1 6= 0 ∧ u2 6= 0.

The first condition can be rewritten as (u1 − 1)2 + u22 6= 4, i.e., the distance

between B and C is different from 2. In other words, the triangle ABC is notisosceles.

qepcad proves within 111 s that ∀u1∀u2(ϑ′ −→ ϕ′), while regular quantifier

elimination by virtual substitution fails in doing so due to the degree restrictions.

3.9 Conclusions

We have applied our generic quantifier elimination by virtual substitution in-troduced in the previous chapter to automated theorem proving in geometry.

By automatically proving some well-known benchmark examples with ourredlog implementation, we have demonstrated that our method can competewith the algebraic methods discussed in the literature so far. Since our methodis a genuinely real—not complex—proof method, its application range exceedsthat of the traditional methods:

• Generic quantifier elimination can handle not only polynomial equationsbut also ordering inequalities. The Steiner–Lehmus theorem 3.22 is onesuch example.

• Among the theorems that do not require any inequalities in their for-mulation, generic quantifier elimination can also prove those which aretheorems in real geometry but which do not hold in the complex plane. Inparticular, there are theorems such as Example 3.20 by MacLane, whichdo not obviously fail over the complex numbers.

Page 74: public pdf

74 CHAPTER 3. GEOMETRIC THEOREM PROVING

• With the conventional methods, one infers the universal validity over thereals from that over the complex numbers. If, however, some universalsentence does not hold over the complex numbers, one does not knowanything about the situation over the reals. Our real method can, in con-trast, not only prove but also disprove theorems. Compare the discussionof Example 3.13.

After specification of the independent parameters in the given problem,the assumptions made by the generic quantifier elimination for reducing thecomplexity of the elimination algorithm turn out to specify mostly the non-degeneracy conditions that are actually necessary for the input conjecture tohold. The apparent restriction of generic quantifier elimination in contrast toregular quantifier elimination has thus turned out as a valuable tool. In fact,generic quantifier elimination is, at least in the application area considered here,superior to regular quantifier elimination, which cannot straightforwardly ap-plied in such a way that non-degeneracy conditions are detected. With examplesof the type usually discussed for the traditional methods, the quantifier elimi-nation result we obtain will be “true.”

There are geometric assertions that do not generally hold without an ad-ditional assumption that in turn cannot be characterized as non-degeneracycondition. Such an assumption might require, e.g., that a triangle be isosce-les, which is rather a “degeneracy condition” than a non-degeneracy condition.Note that this condition cannot be described by a negated equation. More gen-erally, such an assumption can describe the locus of a certain points to fulfillthe geometrical requirements of a theorem (Example 3.14 and Example 3.15).Moreover one can even derive information on the ordering between certain val-ues. The Qin–Heron formula derived as Example 3.19 is a typical examplefor this. For all these examples, our method supplies by means of the actualelimination result, which is an arbitrary boolean combination of equations andinequalities, exactly the necessary and sufficient conditions for the theorem tohold wrt. the classical non-degeneracy conditions obtained independently. Thisextends the application range of our method from pure theorem proving to themuch more sophisticated idea of theorem finding.

The present limitation of the elimination method to quadratic variables wasnot a problem at all for the large number of examples discussed here. Recallanyway that this limitation can be pushed up to higher degrees.

Page 75: public pdf

Chapter 4

Computational Geometry

After successfully using generic quantifier elimination for verifying geometricfacts in the previous chapter, we now turn to computational aspects of geometry.This chapter is concerned with a number of computational problems in real 3-space or the real plane that arise from applications mainly in the area of cad,computer vision, and motion planning. The problems are of the following types:

Parallel projection Given an object A and a parametric light ray r, computethe parallel projection of A in direction r onto a plane perpendicular to r.Compute the shaded and lighted parts of A. Compute the shadow cast byA onto some other object B. Reconstruct object A, or determine featuresof A from its image under parallel projection.

Central projection We treat the same problems as with parallel projection,but wrt. central projection arising from a punctual light source.

Offsets Given a closed object A and a positive real r. Compute the r-offsetof A: This is the set of points having distance exactly r from A. Heredistance may be Euclidean distance or distance in some other norm.

Voronoi diagrams Given finitely many pairwise disjoint closed objects A1,. . . , An, compute their Voronoi diagram: This is the set of all points thathave equal minimal distance to at least two different objects Ai and Aj .Again distances may be measured according to various norms.

Collision problems Given two moving objects A and B, a starting positionand velocity vector for A, and a parametric starting position and velocityvector for B. Determine the conditions on the parameters under whichthe objects A and B will eventually collide, and under these conditionsthe time and place, where the collision will happen.

Among these problems, projections have obvious applications in the area ofcad and computer vision. Offsets are important special cases of Minkowski sumsrequired for robot motion planning [BKOS97]. There has also been considerableresearch on using offset computations for rounding and blending of solids incsg-based cad systems [Ros85, RR86, SW97]. The next chapter will focus onthis issue. Voronoi diagrams have numerous applications in various fields suchas social geography, physics, astronomy, and again robotics [BKOS97]. Therelevance of collision problems, e.g. for robot motion planning, is again obvious.

75

Page 76: public pdf

76 CHAPTER 4. COMPUTATIONAL GEOMETRY

We will show that all these problem types can be modeled as regular orextended quantifier elimination problems in real algebra. Roughly speaking,extended quantifier elimination differs from ordinary quantifier elimination bythe fact that the procedure provides—besides a quantifier-free equivalent to theinput formula—sample parametric answers for values of the variables in the out-ermost existential quantifier block. See Section 2.4.1 for a detailed discussionon extended quantifier elimination by virtual substitution as it is implementedin redlog. We will again use almost exclusively our generic variants of reg-ular and extended quantifier elimination. Since the topics treated here are, incontrast to most geometric theorems, not inherently subject to non-degeneracyassumptions, it will be interesting to observe and analyze the role of the assump-tions made by the generic quantifier elimination for these problems. From nowon, we will simply call these assumptions nd-conditions, which is derived fromthe phrase non-degeneracy condition but should not be understood literally.

Many of the examples computed below involve a significant number of pa-rameters besides the variables to be eliminated. Examples of this kind havebeen inaccessible to other implemented real elimination methods so far.

In the following section, we discuss the restrictions imposed by modelinggeometric objects as semialgebraic sets. The remaining sections of this chapterare then devoted to the various types of geometric problems mentioned above.For each problem class we describe its modeling by first-order formulas, anddiscuss specific instances in this problem class, and their automatic solutionusing the redlog package. All computations have been performed on a sun

Ultra 1 Model 140 workstation using 32 MB of memory.

4.1 Geometric Objects as Semialgebraic Sets

Throughout this chapter, we will assume that all inputs to our computations areobjects in the real plane or in real 3-space given by a “low-degree” semi-algebraicdescription, i.e. a boolean combination of polynomial equations and inequalitiesin two or three variables, respectively. These equations and inequalities will bequadratic in most cases. Frequently we will allow unspecified real parametersin such a description; then we obtain a solution for a whole parametric familyof problems. Our methods do not impose any restrictions on the degree ofparameters. Similarly, the computed output objects will also be given in sucha description, where, however, the polynomial degrees may and will exceed 2 asa rule.

We consider semi-algebraic objects A, B, . . . in real 3-space S = R3 givenby corresponding defining quantifier-free formulas α(u1, u2, u3), β(u1, u2, u3),. . . We will allow ourselves to identify formulas with the corresponding semial-gebraic sets of points when discussing the various operations.

4.2 Parallel Projection

Let r = (r1, r2, r3) be a non-zero vector in S. Interpreting r as the direction oflight coming in parallel rays from an infinitely far light source, we can modelvarious concepts of image and shadow: A point (u1, u2, u3) ∈ S is the image of

Page 77: public pdf

4.2. PARALLEL PROJECTION 77

a point (x1, x2, x3) ∈ S under parallel projection along r if and only if

∃t(

t > 0 ∧3

i=1

ui = xi + tri

)

.

Hence the region SR(α, r) in space S that is shaded by object α(u1, u2, u3) canbe described by the following formula:

SR(α, r)(u) ≡ ∃x1∃x2∃x3∃t(

α[u/x] ∧ t > 0 ∧3

i=1

ui = xi + tri

)

.

By determining a quantifier-free equivalent SR(α, r)′(u) to the formula SR(α, r)above, we get a semi-algebraic description of the corresponding region.

The boundary of α(u) can be described by a quantifier-free formula ∂(α)′

equivalent to

∂(α)(u) ≡ α ∧ ∀ε(

ε > 0 −→ ∃x1∃x2∃x3

(

¬α[u/x] ∧3

i=1

(−ε < xi − ui < ε)))

.

This description of the boundary together with that of the shaded region abovecan be used to describe the shaded part Sh(α, r) and the lighted part Li(α, r)of the boundary of an object α:

Sh(α, r)(u) ≡ ∂(α) ∧ SR(α, r), Li(α, r)(u) ≡ ∂(α) ∧ ¬SR(α, r).

For strictly convex objects γ(u), we can describe the boundary SL(γ, r)between Sh(γ, r) and Li(γ, r) as follows:

SL(γ, r)(u) ≡ ∂(γ) ∧ ¬∃x1∃x2∃x3∃t(

γ[u/x] ∧ t 6= 0 ∧3

i=1

ui = xi + tri

)

.

This definition works even for convex but not strictly convex objects providedthat the direction r of light is not degenerate.

Consider now two objects α(u) and β(u). Then the shadow CS(α, β, r) castby object α onto the boundary of β can be described by the following formula:

CS(α, β, r)(u) ≡ ∂(β) ∧ ∃x1∃x2∃x3∃t(

α[u/x] ∧ t > 0 ∧3

i=1

ui = xi + tri

)

.

This applies in particular to the case when β is a plane perpendicular to thelight ray r. In this case the shadow cast onto β by α is identical to the image ofα viewed in direction r. This image is called the aspect of α. For simplicity, wemay take β as a plane through the origin and drop the condition t > 0. Thenwe get the following formula for the aspect of α in direction r:

Asp(α, r)(u) ≡3

i=1

riui = 0 ∧ ∃x1∃x2∃x3∃t(

α[u/x] ∧3

i=1

ui = xi + tri

)

.

All the formulations discussed so far can obviously also be applied to para-metric objects α(u1, u2, u3, a1, . . . , an). The parameters a1, . . . , an will then ingeneral also occur in the quantifier-free descriptions resulting from the opera-tions. The same holds for parametric directions of light.

Page 78: public pdf

78 CHAPTER 4. COMPUTATIONAL GEOMETRY

Example 4.1 (Parametric quadric) For our first set of examples, we con-sider a parametric quadric in space of the form

η(u,a) ≡ a1u21 + a2u

22 + a3u

23 6 1

and a parametric light ray r = (r1, r2, r3). Depending on the signs of theparameters a1, a2, a3, the quadric η is an ellipsoid, a cylinder, or a hyperboloid.

SR(η, r)(u,a, r) ≡ ∃x1∃x2∃x3∃t(t > 0 ∧ a1x21 + a2x

22 + a3x

23 6 1 ∧

u1 = x1 + tr1 ∧ u2 = x2 + tr2 ∧ u3 = x3 + tr3).

We obtain after 442 ms a quantifier-free equivalent SR(η, r)′ containing 6 atomicformulas, and the nd-condition ar21 + br22 + cr23 6= 0.

Sh(η, r)(u,a, r) ≡ a1u21 + a2u

22 + a3u

23 = 1 ∧

∃x1∃x2∃x3∃t(t > 0 ∧ a1x21 + a2x

22 + a3x

23 6 1 ∧

u1 = x1 + tr1 ∧ u2 = x2 + tr2 ∧ u3 = x3 + tr3).

We obtain after 629 ms a quantifier-free description Sh(η, r)′ containing 9 atomicformulas, valid under the nd-condition ar21 + br22 + cr23 6= 0.

Li(η, r)(u,a, r) ≡ a1u21 + a2u

22 + a3u

23 = 1 ∧

¬∃x1∃x2∃x3∃t(t > 0 ∧ a1x21 + a2x

22 + a3x

23 6 1 ∧

u1 = x1 + tr1 ∧ u2 = x2 + tr2 ∧ u3 = x3 + tr3).

We obtain after 561 ms a quantifier-free description Li(η, r)′ in 5 atomic formulasvalid under the nd-condition ar21 + br22 + cr23 6= 0.

SL(η, r)(u,a, r) ≡ a1u21 + a2u

22 + a3u

23 = 1 ∧

¬∃x1∃x2∃x3∃t(t 6= 0 ∧ a1x21 + a2x

22 + a3x

23 6 1 ∧

u1 = x1 + tr1 ∧ u2 = x2 + tr2 ∧ u3 = x3 + tr3).

We obtain within 476 ms the quantifier-free equivalent

SL(η, r)′ ≡3

i=1

air2i > 0 ∧

3∑

i=1

airiui = 0 ∧3

i=1

(aiu2i )− 1 = 0

valid under the simultaneously obtained nd-condition a1r21 + a2r

22 + a3r

23 6= 0.

Asp(η, r)(u,a, r) ≡ ∃x1∃x2∃x3∃t(a1x21 + a2x

22 + a3x

23 6 1 ∧

u1 = x1 + tr1 ∧ u2 = x2 + tr2 ∧ u3 = x3 + tr3 ∧r1u1 + r2u2 + r3u3 = 0).

We obtain after 442 ms a quantifier-free equivalent with 6 atomic formulas validunder the nd-condition a1r

21 + a2r

22 + a3r

23 6= 0.

Page 79: public pdf

4.2. PARALLEL PROJECTION 79

Example 4.2 (Aspect of intersection) Consider two parametric tubes thatcross perpendicularly but not necessarily centrally:

τ1(u,a, d1) ≡ (u1 − a1)2 + (u2 − a2)

2 = d21

τ2(u, d2) ≡ u21 + u2

3 = d22.

We compute the aspect of their intersection line ι = τ1 ∧ τ2 from a fully para-metric direction r = (r1, r2, r3):

Asp(ι, r)(u,a, d1, d2, r) ≡ ∃x1∃x2∃x3∃t(

ι[u/x] ∧ r1u1 + r2u2 + r3u3 = 0 ∧u1 = x1 + tr1 ∧ u2 = x2 + tr2 ∧ u3 = x3 + tr3).

The result obtained after 357 ms is the following quantifier-free description validunder the nd-condition r3 6= 0 ∧ u3 6= 0:

a21r

23u

23 + 2a1r

21r3u1u3 + 2a1r1r2r3u2u3 + 2a1r1r3u

33 −

2a1r23u1u

23 + a2

2r23u

23 + 2a2r1r2r3u1u3 + 2a2r

22r3u2u3 + 2a2r2r3u

33 −

2a2r23u2u

23 − d2

1r23u

23 + r41u

21 + 2r31r2u1u2 + 2r31u1u

23 + r21r

22u

21 +

r21r22u

22 + 2r21r2u2u

23 − 2r21r3u

21u3 + r21u

43 + 2r1r

32u1u2 + 2r1r

22u1u

23 −

4r1r2r3u1u2u3 − 2r1r3u1u33 + r42u

22 + 2r32u2u

23 −

2r22r3u22u3 + r22u

43 − 2r2r3u2u

33 + r23u

21u

23 + r23u

22u

23 = 0

∧ d22r

23u

23 − r41u2

1 − 2r31r2u1u2 − 2r31u1u23 − r21r22u2

2 − 2r21r2u2u23 −

r21r23u

21 + 2r21r3u

21u3 − r21u4

3 − 2r1r2r23u1u2 +

2r1r2r3u1u2u3 + 2r1r3u1u33 − r22r23u2

2 − r23u21u

23 = 0.

Note that such conjunctions f1 = 0 ∧ f2 = 0 can be restated algebraically asf21 + f2

2 = 0.

We now turn to the inverse problem to computing the aspect of an object:We wish to reconstruct features of an object α and its orientation relative to theprojection plane from its aspect. To this end we assume that our object belongsto a parametric class of objects, e.g. cuboids, balls, or ellipsoids, described by aquantifier-free formula α(u1, u2, u3, a1, . . . , an). The real parameters a1, . . . , an

describe the dimensions and the orientation of the object.In general, we can put our coordinate system into such a position that the

light ray projects the object along the Z-axis onto the X-Y -plane. Since theimage of the object is invariant under translation of the object along the lightray, we may assume in addition that some reference point of the object is placedin the origin of the coordinate system. Suppose now that we have a quantifier-free formula α0(u1, u2) which we assume to describe Asp

(

α, (0, 0, 1))

. Thenapplication of extended quantifier elimination to the formula

Rec(α, α0) ≡ ∃u3∃a1 . . . ∃an∀u1∀u2

(

α(u1, u2, u3, a1, . . . , an)←→ α0(u1, u2))

will yield the result “false” if α0 does not describe the aspect of an object inthe given class; otherwise it will yield “true” together with a list of possible realvalues for u3, a1, . . . , an, where the values for u3 are of no interest.

Among the problems described in this section, feature reconstruction is by farthe hardest one. In order to obtain suitable results within a tolerable amount of

Page 80: public pdf

80 CHAPTER 4. COMPUTATIONAL GEOMETRY

time, one has to put more intelligence into the coding of the problem than withthe general formulation Rec(α, α0) above. To give an impression of possibleformulations, we describe how one would try to recover the dimensions of arectangular solid κ and its orientation in space from its aspect. This approachis applied to a concrete aspect in Example 4.3 below.

Consider the target cuboid κ to be generated by pairwise perpendicularvectors

e1 = (e11, e12, e13), e2 = (e21, e22, e23), e3 = (e31, e32, e33)

with one corner located at the origin. Its corners x = (x1, x2, x3) are describedby the formula

e1e2 = e1e3 = e2e3 = 0 ∧ ∃λ1∃λ2∃λ3

(

γ(λ1, λ2, λ3,x, e1, e2, e3))

, where

γ(λ1, λ2, λ3,x, e1, e2, e3) ≡ λ1, λ2, λ3 ∈ {0, 1} ∧ x = λ1e1 + λ2e2 + λ3e3.

The direction of the light is along the Z-axis. The projection plane P is theX-Y -plane.

Provided that κ is in generic position, i.e., not parallel to any of the axes, itsaspect is the convex hull of 6 points with two possible choices for points whichcannot be observed:

1. All ei3 coordinates have the same sign. Then the images of the origin andof its opposite are in the interior of the aspect.

2. Up to a permutation of the ei, the sign of e13 differs from that of e23 ande33. Then the image of e1 and that of its opposite e2 + e3 are in theinterior of the aspect.

The concrete coordinate system is chosen by the observer of the aspect, whowill exclude the first of the two cases above by placing one aspect corner intothe origin.

We generate by quantifier elimination (255 ms) a quantifier-free generic as-pect description ι′ from the following formula:

ι(e1, e2, e3, i1, i2) ≡ e1e2 = e1e3 = e2e3 = 0 ∧∃x1∃x2∃x3∃λ1∃λ2∃λ3

(

γ(λ1, λ2, λ3,x, e1, e2, e3) ∧¬(λ1 6= λ2 = λ3) ∧ i1 = x1 ∧ i2 = x2

)

.

For a given semi-algebraic description κ0(i1, i2) of aspect corners, we can nowreconstruct the original cuboid by applying extended quantifier elimination tothe following reconstruction formula:

(κ0) ≡ ∃e11∃e12∃e13∃e21∃e22∃e23∃e31∃e32∃e33∀i1∀i2(ι′ ←→ κ0).

For correct generic aspect descriptions κ0 this elimination will yield “true” to-gether with suitable vectors e1, e2, e3 as answer. If κ0 does not describe theaspect of a cuboid in generic position, then the elimination will yield “false.”

Page 81: public pdf

4.2. PARALLEL PROJECTION 81

-20 0 20 40 60 80 100 120x1

0

20

40

60

80

100

120

140

x2

Figure 4.1: A sample aspect of a rectangular solid in generic position

-200

2040

6080

100120

x1

020

4060

80100

120140

x2

-80

-60

-40

-20

0

20

40

60

x3

Figure 4.2: Rectangular solid reconstructed from the top aspect given in Fig-ure 4.1

Example 4.3 (Solid reconstruction) Consider the aspect that is given inFigure 4.1. Its corners have the following semi-algebraic description:

κ0 ≡ (13i1 − 1124 = 0 ∧ 13i2 − 1960 = 0) ∨(13i1 + 176 = 0 ∧ 13i2 − 1050 = 0) ∨(13i1 + 436 = 0 ∧ 13i2 − 530 = 0) ∨ (i1 − 120 = 0 ∧ i2 − 110 = 0) ∨(i1 − 100 = 0 ∧ i2 − 70 = 0) ∨ (i1 = 0 ∧ i2 = 0).

Extended quantifier elimination applied to (κ0) yields after 15.7 s “true” to-gether with the correct reconstruction pictured in Figure 4.2:

e1 = (20, 40,−96), e2 =(

−436

13,530

13, 10

)

, e3 = (100, 70, 50).

Page 82: public pdf

82 CHAPTER 4. COMPUTATIONAL GEOMETRY

4.3 Central Projection

In this section we consider the same problems as in the previous one butfor central projection: We again consider, semialgebraic objects described byquantifier-free formulas α(u); their boundaries are described by ∂(α)(u) as de-fined in the previous section.

Let c = (c1, c2, c3) ∈ S denote the position of a punctual light source in space.Then a point u = (u1, u2, u3) ∈ S is the image of a point x = (x1, x2, x3) ∈ Sunder central projection from the point c if and only if

∃t(

t > 0 ∧3

i=1

ui = t(xi − ci))

.

Hence the region in space that is shaded by object α(u) under central pro-jection from c can be described by the following formula:

SRc(α, c)(u) ≡ ∃x1∃x2∃x3∃t(

α[u/x] ∧ t > 0 ∧3

i=1

ui = t(xi − ci))

.

In a similar way our descriptions given in the previous section of the shadedpart, the lighted part, and of the boundary between these parts can be adaptedto central projection. For the latter we again have to exclude degenerate situ-ations, where the surface of the object contains more than one point on somelight ray:

Shc(α, c)(u) ≡ ∂(α) ∧ SRc(α, c), Lic(α, c)(u) ≡ ∂(α) ∧ ¬SRc(α, c),

SLc(α, c)(u) ≡ ∂(α) ∧ ¬∃x1∃x2∃x3∃t(

α[u/x] ∧ t 6= 0 ∧3

i=1

ui = t(xi − ci))

.

Let β(u) be another object in S. Then the shadow cast by object α(u) ontothe boundary of β is described by

CSc(α, β, c)(u) ≡ ∂(β) ∧ ∃x1∃x2∃x3∃t(

α[u/x] ∧ t > 0 ∧3

i=1

ui = t(xi − ci))

.

This applies in particular to the case when the second object is a plane π(u) ≡p1u1 + p2u2 + p3u3 + q = 0. In this case the shadow cast onto π by α is calledthe image of α on π under central projection from c:

Im(α, π, c)(u) ≡ π ∧ ∃x1∃x2∃x3∃t(

α[u/x] ∧ t > 0 ∧3

i=1

ui = t(xi − ci))

.

Recall from the previous section that it is the great advantage of our ap-proach that all the formulations may involve parametric objects. The parame-ters will occur in the quantifier-free final results just as they do in the input.

Example 4.4 (Parametric line) This example is inspired by an example thathas been discussed by Kapur and Mundy [KM88]. We consider the central pro-jection of the parametric line

λ(u,a,b, d1, d2) ≡ a1u1 + a2u2 + a3u3 = d1 ∧ b1u1 + b2u2 + b3u3 = d2

Page 83: public pdf

4.3. CENTRAL PROJECTION 83

from a punctual light source located at c = (0, 0, f) onto the projection planeπ(u) ≡ u3 = 0:

Im(λ, π, c)(u,a,b, d1 , d2, f) ≡ ∃x1∃x2∃x3

(

a1x1 + a2x2 + a3x3 = d1 ∧b1x1 + b2x2 + b3x3 = d2 ∧u1(f − x3) = fx1 ∧ u2(f − x3) = fx2

)

.

Generic quantifier elimination with the input theory ϑ ≡ f > 0 yields after221 ms the quantifier-free equivalent

Im(λ, π, c)′ ≡ a1b3fu1 − a1d2u1 − b1a3fu1 + b1d1u1 + a2b3fu2 −a2d2u2 − b2a3fu2 + b2d1u2 + a3d2f − b3d1f = 0

subject to the extended theory ϑ′ ≡ ϑ ∧ a1u1 + a2u2 − a3f 6= 0, i.e., there isthe additional nd-condition a1u1 +a2u2−a3f 6= 0 automatically derived duringthe elimination.

Consider another parametric line λ′ in space:

λ′(u,a′,b′, d′1, d′2) ≡ a′1u1 + a′2u2 + a′3u3 = d′1 ∧ b′1u1 + b′2u2 + b′3u3 = d′2.

We can read off from the elimination result above the necessary and sufficientcondition for the images of the two lines to be parallel under the correspondingnd-conditions, viz.:

(a1b3f − a1d2 − b1a3f + b1d1)(a′2b

′3f − a′2d′2 − b′2a′3f + b′2d

′1) =

(a′1b′3f − a′1d′2 − b′1a′3f + b′1d

′1)(a2b3f − a2d2 − b2a3f + b2d1)

provided that all bracketed items are non-zero.

Example 4.5 (Unit ball) We compute the central projection of a unit spherelocated at an arbitrary position a = (a1, a2, a3):

β(u,a) ≡3

i=1

(ui − ai)2 = 1.

Again, the light source is located at c = (0, 0, f), and the projection plane isgiven by u3 = 0.

Im(β, c)(u,a, f) ≡ ∃x1∃x2∃x3

(

(u1 − a1)2 + (u2 − a2)

2 + (u3 − a3)2 = 1 ∧

u1(f − x3) = fx1 ∧ u2(f − x3) = fx2

)

.

Generic quantifier elimination with the input theory ϑ ≡ f > 0 yields after187 ms:

a21f

2 + a21u

22 − 2a1a2u1u2 + 2a1a3fu1 − 2a1f

2u1 + a22f

2 + a22u

21 +

2a2a3fu2 − 2a2f2u2 + a2

3u21 + a2

3u22 − 2a3fu

21 − 2a3fu

22 + f2u2

1 +

f2u22 − f2 − u2

1 − u22 6 0

without any additional nd-condition.

Page 84: public pdf

84 CHAPTER 4. COMPUTATIONAL GEOMETRY

In the previous section on parallel projections, we have recovered a rectan-gular solid from its aspect. We now turn to a more difficult problem, where wewish to recover such a cuboid from a central projection. To make the problemeasier, we consider a wire frame instead of a solid avoiding visibility consid-erations. Still the cuboid will not be uniquely determined by one wire frameimage.

We modify our aspect case model as follows: The cuboid is generated bythe vectors e1, e2, e3 and shifted from the origin by some translation vectorv = (v1, v2, v3). The projection plane is the x1-x2 plane. The focal point is,say, (0, 0, 5). Our idea is that the focal point lies between the image and theprojection plane modeling photography: We take photos along the Z-axis. The3-space origin is the center of our photo.

A generic image description ι′ is derived by applying quantifier elimination(765 ms) to the following formula:

ι ≡ e1e2 = e1e3 = e2e3 = 0 ∧∃x1∃x2∃x3∃λ1∃λ2∃λ3∃t

(

λ1, λ2, λ3 ∈ {0, 1} ∧x = λ1e1 + λ2e2 + λ3e3 + v ∧ i1 = tx1 ∧ i2 = tx2 ∧ 0 = 5 + t(5− x3)

)

.

For a given semi-algebraic image description ω0, we can recover informationabout the original wire frame by applying extended quantifier elimination tothe following reconstruction formula:

c(ω0) ≡ ∃e11∃e12∃e13∃e21∃e22∃e23∃e31∃e32∃e33∃v1∃v2∃v3∀i1∀i2(ι′ ←→ ω0).

In practice, the elimination can be supported by fixing the image of theshifted origin v. Compare Example 4.6 below for details.

With two images taken simultaneously from different locations, a cuboidcan be reconstructed uniquely provided that the choices for the v, e1, e2, e3

are consistent. Unfortunately, in a corresponding reconstruction formula for astereo camera one cannot play the trick of fixing the images of v as indicatedabove, because one cannot automatically determine which of the points in twodifferent projection images correspond to each other.

Example 4.6 (Wire frame reconstruction) Figure 4.3 shows an image cor-responding to a photo taken of the wire frame of the cuboid in Figure 4.2 shiftedfrom the origin by v = (100, 200, 300). The semi-algebraic image description isas follows:

ω0(i1, i2) ≡ (3367i1 − 12120 = 0 ∧ 3367i2 − 22800 = 0) ∨(923i1 − 2164 = 0 ∧ 923i2 − 4040 = 0) ∨(2717i1 − 5620 = 0 ∧ 2717i2 − 18250 = 0) ∨(793i1 − 864 = 0 ∧ 793i2 − 3130 = 0) ∨(249i1 − 1100 = 0 ∧ 249i2 − 1550 = 0) ∨(69i1 − 200 = 0 ∧ 23i2 − 90 = 0) ∨(199i1 − 600 = 0 ∧ 199i2 − 1200 = 0) ∨(59i1 − 100 = 0 ∧ 59i2 − 200 = 0).

Page 85: public pdf

4.4. OFFSETS 85

-6

-4

-2

0

2

4

6

x2

-6 -4 -2 0 2 4 6x1

Figure 4.3: A photo of the wire frame of the cuboid in Figure 4.2

In the reconstruction formula we support the elimination procedure by fixingthe image point

(

10059 ,

20059 , 0

)

to be the image the shifted origin:

c ≡ ∃e11∃e12∃e13∃e21∃e22∃e23∃e31∃e32∃e33∃v1∃v2∃v3∀i1∀i2(

(ι′ ←→ ω0) ∧

∃t(100

59= tv1 ∧

200

59= tv2 ∧ 0 = 5 + t(5− v3)

))

.

We obtain after 33 min the quantifier-free equivalent “true” together with thefollowing answer:

v =(5∞1

2, 5∞1,

59∞1 + 40

8

)

, e1 =(5∞1

2,7∞1

4,5∞1

4

)

,

e2 =(∞1

2,∞1,

−12∞1

5

)

, e3 =(−109∞1

130,53∞1

52,∞1

4

)

.

For ∞1 = 40 this is our original cuboid.Without fixing the image of v, i.e., using c(ω0) as reconstruction formula,

the elimination takes 12 h yielding a correct reconstruction with different choicesfor the vectors.

4.4 Offsets

Let A be an object that constitutes a non-empty closed set. Fix a metricd : S2 → R that induces the usual topology on S. Then the distance between apoint x ∈ S and A is defined as

d(x, A) = min{ d(x,u) | u ∈ A }.

The existence of the minimum is guaranteed by the assumption that α is closedin S and that d is continuous. Let now r be a non-negative real number. Thenthe r-offset of A is defined as follows:

offr(A) = {u ∈ S | d(

u, A) = r }.

Page 86: public pdf

86 CHAPTER 4. COMPUTATIONAL GEOMETRY

We generalize this notion of an r-offset: The 6-r-offset A and the >-r-offset ofA are defined as

off6r(A) = {u ∈ S | d(

u, A) 6 r } and off>r(A) = {u ∈ S | d(

u, A) > r },

respectively. We then obviously have offr(A) = off6r(A) ∩ off>r(A).For a fixed metric d, suppose we have formulas δ6(u,x, r) and δ>(u,x, r)

describing the facts that d(u,x) 6 r and d(u,x) > r, respectively. Then thefollowing formulas describe various offsets of a semialgebraic object α(u):

off6r(α)(u) ≡ ∃x1∃x2∃x3

(

α[u/x] ∧ δ6(x,u, r))

,

off>r(α)(u) ≡ ∀x1∀x2∀x3

(

α[u/x] −→ δ>(x,u, r))

,

offr(α)(u) ≡ off6r(α)(u) ∧ off>r(α)(u).

We give the relevant formulas δ> for some common metrics on S. The formulasδ6 are formed similarly:

• for the Euclidean (L2) metric:

δ>(x,u, r) ≡3

i=1

(xi − ui)2 > r2;

• for the “Manhattan” (L1) metric:

δ>(x,u, r) ≡ ∃d1∃d2∃d3

(

3∑

i=1

di > r ∧

3∧

i=1

(

di > 0 ∧ (di = xi − ui ∨ di = ui − xi))

)

;

• for the maximum (L∞) metric:

δ>(x,u, r) ≡3

i=1

(

(xi − ui) > r ∨ (ui − xi) > r)

.

Note that the formulas offr(α) for the r-offset involve 3 existential and 3 universalquantifiers and hence pose a non-trivial problem for quantifier elimination.

Example 4.7 We compute the parametric r-offsets of the cross γ(u) ≡ (u1 =0 ∨ u2 = 0) ∧ u3 = 0 consisting of the X-axis and the Y -axis in S. We startwith the Euclidean metric:

offL2

r (γ)(u, r) ≡ ∃x1∃x2∃x3

(

(x1 = 0 ∨ x2 = 0) ∧ x3 = 0 ∧(u1 − x1)

2 + (u2 − x2)2 + (u3 − x3)

2 6 r2)

∧∀x1∀x2∀x3

(

(x1 = 0 ∨ x2 = 0) ∧ x3 = 0 −→(u1 − x1)

2 + (u2 − x2)2 + (u3 − x3)

2 > r2)

,

Page 87: public pdf

4.4. OFFSETS 87

-10-5

05

10

-10

-5

0

5

10

-10

-5

0

5

10

Figure 4.4: 4-Offset of the X-axis and the Y -axis together with the planesX = Y and X = −Y separating the relevant segments of the tubes

Quantifier elimination with subsequent Grobner basis simplification applied tooffL2

r (γ) yields after 1.2 s the following quantifier-free description:

offL2

r (γ)′(u) ≡ (r2−u22−u2

3 = 0 ∧ u21−u2

2 > 0) ∨ (r2−u21−u2

3 = 0 ∧ u21−u2

2 6 0).

The offset thus consists of segments of the tubes r2− u22− u2

3 = 0 and r2− u21−

u23 = 0 separated by the planes u1 = u2 and u1 = −u2 at which they exactly fit

together. Figure 4.4 pictures this for r = 4.For the Manhattan metric, the quantifier elimination input looks as follows:

offL1

r (γ)(u, r) ≡ ∃x1∃x2∃x3

(

(x1 = 0 ∨ x2 = 0) ∧ x3 = 0 ∧∃d1∃d2∃d3(d1 > 0 ∧ (d1 = u1 − x1 ∨ d1 = x1 − u1) ∧d2 > 0 ∧ (d2 = u2 − x2 ∨ d2 = x2 − u2) ∧ d3 > 0 ∧(d3 = u3 − x3 ∨ d3 = x3 − u3) ∧ d1 + d2 + d3 6 r)

)

∧∀x1∀x2∀x3

(

(x1 = 0 ∨ x2 = 0) ∧ x3 = 0 −→∃d1∃d2∃d3(d1 > 0 ∧ (d1 = u1 − x1 ∨ d1 = x1 − u2) ∧d2 > 0 ∧ (d2 = u2 − x2 ∨ d2 = x2 − u2) ∧ d3 > 0 ∧(d3 = u3 − x3 ∨ d3 = x3 − u3) ∧ d1 + d2 + d3 > r)

)

.

Here we obtain after 11.6 s a quantifier-free formula with 4242 atomic subfor-mulas, which cannot be further simplified automatically.

For certain smooth algebraic surfaces V : f(u) = 0 without singularities inS we would like to compute offr(V ) using the following idea: The point u ∈ Vof minimal distance to a given point x ∈ S is determined by the fact that thevector x − u is perpendicular to the tangent plane of V at u. In other words,this vector is a real multiple of the gradient vector ∇f . Accordingly, we defineoffr

∇(ν) for the semialgebraic description ν(u) ≡ f(u) = 0 of V as follows:

off∇r (ν)(u) ≡ ∃x1∃x2∃x3∃t

(

f [u/x] = 0 ∧ δ(x,u, r) ∧3

i=1

t∂f [u/x]

∂xi

= ui − xi

)

.

Page 88: public pdf

88 CHAPTER 4. COMPUTATIONAL GEOMETRY

-1.5

-1

-0.5

0

0.5

1

1.5

u2

-1.5 -1 -0.5 0.5 1 1.5u1

Figure 4.5: The unit circle and its 34 -∇-offset

Here δ(x,u, r) describes the fact that d(x,u) = r.Unfortunately, offr

∇ does not necessarily equal the offset. Instead, we doonly know that

offr(V ) ⊆ offr∇(V ).

The reason is that points that lie very far away from the starting point ofthe gradient vector on the surface can be closer than r to the endpoint of thegradient vector. Figure 4.5 illustrates the problem by means of the unit circle

u21 + u2

2 = 1 in 2-space: Its 34 -∇-offset consists of the circles u2

1 + u22 =

(

34

)2and

u21 + u2

2 =(

74

)2, but the latter circle alone forms the proper 3

4 -offset.It is, however, easy to see that for arbitrary smooth algebraic surfaces V

without singularities we always have

offr(V ) = offr∇(V ) ∩ off>r(V ).

The idea of using the gradient vectors can be extended to smooth algebraiccurves C : f(u) = 0 ∧ g(u) = 0 without singularities in S. We then havethe following description of the corresponding superset of the r-offset of γ(u) ≡f(u) = 0 ∧ g(u) = 0:

off∇r (γ)(u) ≡ ∃x1∃x2∃x3∃s∃t

(

f [u/x] = 0 ∧ g[u/x] = 0 ∧ δ(x,u, r) ∧3

i=1

s∂f [u/x]

∂xi

+ t∂g[u/x]

∂xi

= ui − xi

)

.

Example 4.8 We compute, wrt. the Euclidean metric, the parametric r-offsetof the parabola π(u) ≡ u2 = u2

1 ∧ u3 = 0 in S.

off∇r (π)(u) ≡ ∃x1∃x2∃x3∃s∃t

(

x2 = x21 ∧ x3 = 0 ∧

(x1 − u1)2 + (x2 − u2)

2 + (x3 − u3)2 = r ∧

−2sx1 = u1 − x1 ∧ s = u2 − x2 ∧ t = u3 − x3

)

.

Generic quantifier elimination cannot eliminate x1 due to the degree restric-tions imposed by the virtual substitution method. Its result after 10 ms is the

Page 89: public pdf

4.4. OFFSETS 89

following:

∃x1(r−u21 +2u1x1−u2

2 +2u2x21−u2

3−x41−x2

1 = 0 ∧ u1 +2u2x1−2x31−x1 = 0).

Denote the left hand side polynomials of the first and of the second equation byf1 and f2, respectively. We conjunctively add another equation h(u, r, x1) = 0,where h is the remainder of the univariate pseudo-division

f1(u, r)(x1)/f2(u, r)(x1).

This remainder h is quadratic in x1. The generic elimination of x1 can thenbe completed automatically, yielding a quantifier-free formula offc

r(π)′(u) with 7atomic subformulas under the nd-condition 2u2−1 6= 0. The second eliminationstep takes 4.7 s. The solution is obviously correct for r < 1

2 , which is theminimum radius of the curvature of π adopted at the origin.

For certain special objects in 3-space there are even simpler descriptionsavailable: Consider, e.g., the r2-offset of a circle u2

1 +u22 = r21 wrt. the Euclidean

metric, which is a torus T . This torus can be defined by the following formulaτ with only one quantifier:

τ(u) ≡ ∃x(

x2 + u23 = r22 ∧ (r1 + x)2 = u2

1 + u22

)

.

The idea behind this description is to regard T as a union of circles in planesparallel to the X-Y -plane.

Example 4.9 We compute a quantifier-free description of the torus with para-metric radii given by

τ(u, r1, r2) ≡ ∃x(

x2 + u23 = r22 ∧ (r1 + x)2 = u2

1 + u22

)

.

Quantifier elimination and subsequent Grobner basis simplification yields within1.2 s the following quantifier-free description:

τ ′(u, r1, r2) ≡ r41 − 2r21r22 − 2r21u

21 − 2r21u

22 + 2r21u

23 + r42 − 2r22u

21 − 2r22u

22 −

2r22u23 + u4

1 + 2u21u

22 + 2u2

1u23 + u4

2 + 2u22u

23 + u4

3 = 0 ∧r22 − u2

3 > 0.

The concept of r-offsets in the plane is defined analogously to that in 3-space.It should be obvious how to modify all the formulas discussed throughout thissection for the planar case. The following example suggests to use iterated offsetcomputations for the problem of rounding corners and edges [Hof96]. We willdiscuss this in detail in the following chapter; see also [SW97].

Example 4.10 Consider in 2-space the following rectangle of side lengths 1and 2:

(u, r) ≡ 0 6 u1 6 1 ∧ 0 6 u2 6 2.

We want to round the corners of by circular segments of parametric radius0 < r < 1

2 . For this purpose consider the closure of the complement of described by

(u, r) ≡ ¬(0 < u1 < 1 ∧ 0 < u2 < 2).

Page 90: public pdf

90 CHAPTER 4. COMPUTATIONAL GEOMETRY

The >-r-offset of is described by the following formula

off>r()(u, r) ≡ ∀x1∀x2

(

[u/x] −→ (x1 − u1)2 + (x2 − u2)

2 > r2)

.

Quantifier elimination using the input theory ϑ ≡ 0 < r ∧ r < 12 and with

subsequent Grobner simplification yields after 153 ms the following quantifier-free description:

off>r()′(u, r) ≡ r2 − u2

1 + 2u1 − 1 6 0 ∧ r2 − u21 − u2

2 + 4u2 − 4 6 0 ∧r2 − u2

1 − u22 6 0 ∧ r2 − u2

1 6 0 ∧ r2 − u22 + 4u2 − 4 6 0 ∧

r2 − u22 6 0 ∧ u1 − 1 < 0 ∧ u1 > 0 ∧ u2 − 2 < 0 ∧ u2 > 0.

Under our theory ϑ we can transform this by some easy hand computationsincluding completion of squares into the following simpler form:

off>r()′′(u, r) ≡ u1 > r ∧ 1− r > u1 ∧ u2 > r ∧ 2− r > u2.

The correctness of our simplification can be proved automatically in less than17 ms by applying quantifier elimination to

∀u1∀u2∀r(

0 < r <1

2−→

(

off>r()′(u, r)←→ off>r()

′′(u, r))

)

.

The final result of rounding is obtained as

off6r

(

off>r()′′)(u, r).

The corresponding quantifier elimination, again with the theory ϑ, delivers after323 ms the following quantifier-free description of the rounded rectangle:

off6r

(

off>r()′′)′(u, r) ≡

(r2 + 2ru1 + 2ru2 − 6r + u21 − 2u1 + u2

2 − 4u2 + 5 6 0) ∨(r2 + 2ru1 − 2ru2 − 2r + u2

1 − 2u1 + u22 + 1 6 0) ∨

(r2 − 2ru1 + 2ru2 − 4r + u21 + u2

2 − 4u2 + 4 6 0) ∨(r2 − 2ru1 − 2ru2 + u2

1 + u22 6 0) ∨

(r + u1 − 1 6 0 ∧ r − u1 6 0 ∧ r + u2 − 2 6 0 ∧ r − u2 6 0) ∨(2ru1 − 2r + u2

1 − 2u1 + 1 6 0 ∧ r + u2 − 2 6 0 ∧ r − u2 6 0) ∨(2ru1 − u2

1 > 0 ∧ r + u2 − 2 6 0 ∧ r − u2 6 0) ∨(2ru2 − 4r + u2

2 − 4u2 + 4 6 0 ∧ r + u1 − 1 6 0 ∧ r − u1 6 0) ∨(2ru2 − u2

2 > 0 ∧ r + u1 − 1 6 0 ∧ r − u1 6 0).

It contains 20 atomic formulas. The shortest description we are able to produceby hand contains 12 atomic formulas. For fixed values of r the equivalence be-tween the automatic result and our hand formulation can be shown by quantifierelimination in less than one minute.

Compare [PP97] and [Wan93a] for a discussion of offsets and examples, usingother methods.

Page 91: public pdf

4.5. VORONOI DIAGRAMS 91

Figure 4.6: Voronoi diagram of three points (Example 4.11)

4.5 Voronoi Diagrams

Let F = {A1, . . . , An} be a finite family of objects that constitute non-emptyclosed sets in space. Fix a metric d : S2 → R that induces the usual topologyon S. Then the Voronoi diagram wrt. d of F is defined as follows:

Vor(F ) ={

u ∈ S∣

∣d(u, Ai) = d(u, Aj) = min

16k6nd(u, Ak) with 1 6 i < j 6 n

}

.

That is the set of all points of minimal equal distance to at least two of the A1,. . . , An. The special case of Voronoi diagrams in the plane has been studied in[PS85].

The notion of a Voronoi diagram can be restated in terms of offsets: Supposethat the objects A1, . . . , An are as usual given by quantifier-free formulas α1(u),. . . , αn(u). Then

Vor(α1, . . . , αn)(u) ≡n∨

i=1

n∨

j=1

j 6=i

∃r(

offr(αi) ∧ offr(αj) ∧n∧

k=1

k 6=i,j

off>r(αk))

.

Example 4.11 (3 points) In the real plane, the Voronoi diagram of the threepoints (−1, 0), (1, 0), (1, 1) is described by the following formula:

ϕ(u) ≡ ∃r(

r2 = (u1 − 1)2 + u22 = (u1 + 1)2 + u2

2 6 (u1 − 1)2 + (u2 − 1)2)

∨∃r

(

r2 = (u1 − 1)2 + u22 = (u1 − 1)2 + (u2 − 1)2 6 (u1 + 1)2 + u2

2

)

∨∃r

(

r2 = (u1 + 1)2 + u22 = (u1 − 1)2 + (u2 − 1)2 6 (u1 − 1)2 + u2

2

)

.

Quantifier elimination with subsequent Grobner simplification yields the follow-ing quantifier-free description (170 ms):

ϕ′(u) ≡ (4u1 + 2u2 − 1 = 0 ∧ 4u22 − 4u2 + 5 > 0 ∧ 2u2 − 1 > 0) ∨

(4u21 − 8u1 + 5 > 0 ∧ u1 > 0 ∧ 2u2 − 1 = 0) ∨

(u1 = 0 ∧ 2u2 − 1 6 0).

The two quadratic inequalities in ϕ′ have obviously positive definite polynomialson their left hand sides and are thus redundant:

4u22 − 4u2 + 5 = 4

(

x− 1

2

)2

+ 4, 4u22 − 8u2 + 5 = 4(x− 1)2 + 4.

Page 92: public pdf

92 CHAPTER 4. COMPUTATIONAL GEOMETRY

The remainder of ϕ′ yields a nice description of the Voronoi diagram picturedin Figure 4.6.

Example 4.12 (2 lines, circle) The Voronoi diagram of the unit circle andthe lines X = −2 and X = 2 in the plane is described by the formula

ψ(u) ≡ ∃r∃x1∃x2

(

x21 + x2

2 = 1 ∧ x2u1 = x1u2 ∧ x1u1 > 0 ∧ x2u2 > 0 ∧(

r2 = (u1 + 2)2 = (u1 − 2)2 6 (u1 − x1)2 + (u2 − x2)

2 ∨r2 = (u1 + 2)2 = (u1 − x1)

2 + (u2 − x2)2 6 (u1 − 2)2 ∨

r2 = (u1 − 2)2 = (u1 − x1)2 + (u2 − x2)

26 (u1 + 2)2

))

.

Generic quantifier elimination yields after 600 ms a formula with 20 atomicsubformulas plus the nd-condition u1 6= 0. Subsequent Grobner simplificationproduces the following result (200 ms):

ψ′(u) ≡ (u21 + 3u1 6 0 ∧ 6u1 − u2

2 + 9 = 0 ∧ u1 + 3 6= 0 ∧ u1 < 0) ∨(u2

1 + u1 > 0 ∧ 2u1 − u22 + 1 = 0 ∧ u1 + 1 6= 0 ∧ u1 < 0) ∨

(u21 − 3u1 6 0 ∧ 6u1 + u2

2 − 9 = 0 ∧ u1 − 3 6= 0 ∧ u1 > 0) ∨(u2

1 − u1 > 0 ∧ 2u1 + u22 − 1 = 0 ∧ u1 − 1 6= 0 ∧ u1 > 0).

We easily discover by quantifier elimination on the existential closures of thefour constituents of the disjunction ψ′ that the second one and the last one arecontradictory (50 ms). We thus obtain

ψ′′(u) ≡ (u21 + 3u1 6 0 ∧ 6u1 − u2

2 + 9 = 0 ∧ u1 + 3 6= 0 ∧ u1 < 0) ∨(u2

1 − 3u1 6 0 ∧ 6u1 + u22 − 9 = 0 ∧ u1 − 3 6= 0 ∧ u1 > 0).

The entire geometric configuration is pictured in Figure 4.7.Our ψ′′ is obviously equivalent to

ψ′′′(u) ≡ (6u1 − u22 + 9 = 0 ∧ u1 + 3 > 0 ∧ u1 < 0) ∨

(6u1 + u22 − 9 = 0 ∧ u1 − 3 < 0 ∧ u1 > 0).

The current development version of redlog contains a an improved simpli-fier by A. Dolzmann that discovers multiplicative relationships between atomicformulas. This version automatically obtains ψ′′′ as the result of the Grobnersimplification after generic quantifier elimination.

The nd-condition u1 6= 0 excludes the u2 axis, which is obviously the Voronoidiagram for u2 > 3 and for u2 6 −3. This information is automatically obtainedby substituting 0 for u1 in ψ yielding ψ0 = ψ[u1/0]. Regular quantifier elimina-tion plus subsequent Grobner simplification on ψ0 yields after 100 ms this partof the Voronoi diagram for u1 = 0:

ψ′0 ≡ (u2 + 3 = 0 ∨ u2 − 3 = 0) ∨ (u2

2 + 2u2 − 3 > 0 ∧ u2 6 0) ∨(u2

2 − 2u2 − 3 > 0 ∧ u2 > 0).

This ψ′0 is obviously equivalent to the formula u2 > 3 ∨ u2 6 −3, which can

be automatically shown within 50 ms by applying quantifier elimination to theuniversal closure of the equivalence.

Page 93: public pdf

4.5. VORONOI DIAGRAMS 93

-3

-2

-1

0

1

2

3

u2

-2 -1 1 2u1

Figure 4.7: Voronoi diagram of a circle and two lines (Example 4.12)

In the special case of only two objects F = {A1, A2} in 3-space, the Voronoidiagram is the equi-distance surface of the objects A1 and A2. The followingtwo examples are concerned with the computation of such equi-distance surfaces[Hof96].

Example 4.13 We wish to find a description of the surface defined by equaldistance to the unit ball and a parametric plane X = a:

σ1(u, a) ≡ ∃x1∃x2∃x3

(

(u1 − a)2 = (u1 − x1)2 + (u2 − x2)

2 + (u3 − x3)2 ∧

x21 + x2

2 + x23 = 1 ∧ x1u2 = x2u1 ∧ x1u3 = x3u1 ∧

x2u3 = x3u2 ∧(

u1x1 > 0 ∨ (u1 = 0 ∧ x1 = 0))

∧(

u2x2 > 0 ∨ (u2 = 0 ∧ x2 = 0))

∧(

u3x3 > 0 ∨ (u3 = 0 ∧ x3 = 0)))

.

Generic quantifier elimination produces after 1 s a formula σ′1 with 8 atomic

subformulas under the nd-condition u1 6= 0. Fixing a = 5 and then applyingthe Grobner simplifier, we obtain

σ′′1 (u) ≡ (u2

1 − 6u1 > 0 ∧ 12u1 + u22 + u2

3 − 36 = 0 ∧ u1 < 0) ∨(u2

1 − 4u1 6 0 ∧ 8u1 + u22 + u2

3 − 16 = 0 ∧ u1 < 0) ∨(u2

1 − 6u1 6 0 ∧ 12u1 + u22 + u2

3 − 36 = 0 ∧ u1 − 6 6= 0 ∧ u1 > 0) ∨(u2

1 − 4u1 > 0 ∧ 8u1 + u22 + u2

3 − 16 = 0 ∧ u1 − 4 6= 0 ∧ u1 > 0).

We suspect that one of the two contained equations describes the Voronoi dia-gram: Applying quantifier elimination to

∀u1∀u2∀u3

(

u1 6= 0 −→ (σ′′1 ←→ 12u1 + u2

2 + u23 − 36 = 0)

)

Page 94: public pdf

94 CHAPTER 4. COMPUTATIONAL GEOMETRY

-80

-60

-40

-20

0

-40

-20

0

20

40

-40

-20

0

20

40

Figure 4.8: The plane X = 5 and its equi-distance surface with the unit ball

-4-2

02

4

-4-2

02

4

-4

-2

0

2

4

Figure 4.9: The equi-distance surface of the X-axis and the line X = Y , Z = 1

we in fact obtain “true” after 170 ms. That is, the desired solution for ourspecial case a = 5 is the rotation paraboloid

u1 = −u22

12− u2

3

12+ 3.

Figure 4.8 pictures this.

Example 4.14 We compute the equi-distance surface for the X-axis and theline X = Y , Z = 1:

σ2(u) ≡ ∃x(

u22 + u2

3 = (u1 − x)2 + (u2 − x)2 + (u3 − 1)2 ∧ u1 − x = −(u2− x))

.

Elimination yields u21 − 2u1u2 − u2

2 − 4u3 + 2 = 0 after 17 ms. This hyperbolicparaboloid is pictured in Figure 4.9.

Page 95: public pdf

4.6. COLLISION PROBLEMS 95

4.6 Collision Problems

Let A, B be objects moving in space from their initial position with time. Thequestion is, whether A and B will collide, and—if yes—when and where is acollision going to happen?

In the easiest case, A and B move along straight lines with constant veloci-ties. Suppose α(u) and β(u) describe the objects A and B at time t = 0, andvα, vβ are the velocity vectors for the motion of A and B, respectively. Thenthe position of the objects A and B at time t is given by α[u/u − tvα] andβ[u/u− tvβ ], respectively. A collision situation of A and B is characterized byboth objects having at least one point in common at a certain time:

col(α,vα, β,vβ , t)(t) ≡ ∃u1∃u2∃u3(α[u/u− tvα] ∧ β[u/u− tvβ ]))

.

The following formula states that there is a collision time:

Col(α,vα, β,vβ) ≡ ∃t(

t > 0 ∧ col(α,vα, β,vβ , t))

.

If we eliminate from Col(α,vα, β,vβ) the four quantifiers by extended quantifierelimination, we get either “false,” i.e., A and B will never collide, or we get“true” together with a common point and the corresponding time.

Example 4.15 (Disc and square) Consider the unit disk δ ≡ u2 6 1 movingwith velocity 1 along the X-axis, and a square

σ ≡ −1 6 u1 6 1 ∧ −9 6 u2 6 −7

of side length 2 with center at (0,−8) moving with parametric velocity vectora from its starting position. A collision situation is described by

col(δ, (1, 0), σ, a, t) ≡ ∃u1∃u2

(

(u1 − t)2 + u21 6 1 ∧

−1 6 u1 − a1t 6 1 ∧ −9 6 u2 − a2t 6 −7)

.

For obtaining necessary and sufficient conditions on the parametric velocityvector a for a collision to take place, we apply generic quantifier elimination tothe corresponding formula

Col(δ, (1, 0), σ, a)(a) ≡ ∃t(

t > 0 ∧ col(δ, (1, 0), σ, a, t))

.

This yields after 1.3 s a quantifier-free formula Col(δ, (1, 0), σ, a)′(a) with 69atomic subformulas under the nd-condition a2

1−2a1+a22+1 6= 0, which obviously

excludes only the velocity vector a = (1, 0).This example is generalized from a decision problem in [CH91], where the

parameters a1, a2 were both fixed to 1716 . We plug into Col(δ, (1, 0), σ, a)(a) these

original values for a, and apply extended quantifier elimination. The result after85 ms is “true” together with the answer t = 144

17 and u =(

14417 , 0

)

.

The elimination answer for Col(α,vα, β,vβ) will, in general, not describethe first collision of A and B. In order to obtain time and location of the firstcontact of the two objects, we have to apply quantifier elimination with answerto the formula

Col1(α,vα, β,vβ) ≡ ∃t(

t > 0 ∧ col(α,vα, β,vβ , t) ∧∀t′(0 < t′ < t −→ ¬col(α,vα, β,vβ , t′))

)

.

Page 96: public pdf

96 CHAPTER 4. COMPUTATIONAL GEOMETRY

Example 4.16 (Disc and square revisited) We return to our previous ex-ample. We now check whether the collision found for the concrete velocity vectora =

(

1716 ,

1716

)

describes the first collision. For this we eliminate the quantifiersfrom the formula

Col1(

δ, (1, 0), σ,(

1716 ,

1716

))

≡ ∃t(

t > 0 ∧ col(

δ, (1, 0), σ,(

1716 ,

1716

)

, t)

∧∀t′

(

0 < t′ < t −→ ¬col(

δ, (1, 0), σ,(

1716 ,

1716

)

, t′)))

.

The result obtained after 629 ms is “true” together with the answer t = 9617 and

u =(

9617 ,−1

)

showing the true first collision.

The next example is a very strong 3-dimensional generalization of the disc-square collision considered above.

Example 4.17 (Quadric and cube) Starting with its center located at theorigin, a solid parametric quadric η(u,a) ≡ a1u

21 + a2u

22 + a3u

23 6 1 with main

axes parallel to the coordinate axes moves with velocity 1 along the X-axis. Acube κ(u,b) ≡ ∧3

i=1 bi − 1 6 ui 6 bi + 1 with side length 2 moves starting withits center at b with constant parametric velocity v = (v1, v2, v3) through space.We have

col(η, e1, κ,v, t)(a,b,v, t) ≡ ∃u1∃u2∃u3

(

a1(u1 − t) + a2u2 + a3u3 6 1 ∧3

i=1

bi − 1 6 ui − vit 6 bi + 1)

.

Our input formula for generic quantifier elimination is the corresponding formula

Col(η, e1, κ,v)(a,b,v) ≡ ∃t(

t > 0 ∧ col(η, e1, κ,v, t)(a,b,v, t))

,

which contains 9 parameters. Generic quantifier elimination yields a quantifier-free formula with 2792 atomic subformulas under 7 nd-conditions in 43.4 s.

We now leave only the velocity vector v of the cube parametric, but fix the di-mensions of the quadric to a0 = (3, 2, 1) and the starting position for the cube tob0 = (1,−10, 15) yielding η0(u) and κ0(u), respectively. This reduces the tim-ing for generic quantifier elimination on the corresponding Col(η0, e1, κ0,v)(v)to 9.4 s yielding only 336 atomic formulas under 5 nd-conditions. For this spe-cialized situation, we ask for a velocity vector such that a collision takes placenot later than at the time t = 10:

∃v1∃v2∃v3∃t(

0 < t 6 10 ∧ col(η0, e1, κ0,v, t)(t,v))

.

Applying extended quantifier elimination, we obtain after 272 ms “true” to-gether with the answer v =

(

1, 1110 ,− 7

5

)

, t = 10, and u = (10, 0, 0).

The remainder of this section is devoted to a case study that illustratessome more sophisticated techniques for modeling with first order formulas overthe reals. This includes in particular coping with periodicities and handling oftranscendental items.

Example 4.18 (Circling descending objects) We consider two objects cir-cling in descending spirals in a cylinder above a circle with radius r. Each object

Page 97: public pdf

4.6. COLLISION PROBLEMS 97

Table 4.1: Data in both models for object collision; k, l, and n are not first-ordervariables but concrete integers

t timer radius of the circle

(p1, p2) starting position of object 1(q1, q2) starting position of object 2(v1, v2) velocity of object 1

(w1, w2) velocity of object 2k number of complete laps of object 1l number of complete laps of object 2n a bound on the number of complete laps of both objects

has a given position and constant horizontal and vertical velocities. The ques-tion is, whether the two objects are going to crash within a given number oflaps.

All distances are given in meters, velocities are given in meters per second.For velocities and positions we take coordinates (C1, C2), where C1 is the po-sition on the circumference, i.e. the distance on the circumference of the circlefrom a fixed reference point, and C2 is the height. We consider two differentways of modeling the situation:

Model 1 In the simpler model objects are modeled as points, and a collisionoccurs if the two points coincide. Table 4.1 summarizes the data involvedin this model (and also in the other one). A collision is then described bythe following formula:

ϕ1 ≡ p2 + tv2 = q2 + tw2 ∧n∨

k=0

n∨

l=0

(

2πrk 6 tv1 < 2πr(k + 1) ∧

2πrl 6 tw1 < 2πr(l + 1) ∧ p1 + tv1 − 2πrk = q1 + tw1 − 2πrl)

.

Model 2 In the second, more realistic, model we prescribe, in addition, hori-zontal and vertical safety distances, see Table 4.2. A “collision” occurs,if the points representing the objects violate both safety distances. Thedescription of a collision then reads as follows:

ϕ2 ≡ −h 6 p2 + tv2 − (q2 + tw2) 6 h ∧n∨

k=0

n∨

l=0

(

2πrk 6 tv1 < 2πr(k + 1) ∧ 2πrl 6 tw1 < 2πr(l + 1) ∧

−w 6 p1 + tv1 − 2πrk − (q1 + tw1 − 2πrl) 6 w)

.

One may be tempted to replace the disjunctions by an unbounded existentialquantification ∃k∃l. This is, however, not possible in out context, because thesequantifiers would range over integers. In principle mixed real/integer eliminationis possible [Wei90, Wei97a, Wei99].

For obtaining a well-formed input formula we have to fix n to a naturalnumber. Setting n = 3 our ϕ1 has 81 atomic subformulas in 10 parameters plus

Page 98: public pdf

98 CHAPTER 4. COMPUTATIONAL GEOMETRY

Table 4.2: Additional data for Model 2

w horizontal safety distanceh vertical safety distance

the symbol π. Our algorithms do not know anything about π. It plays the roleof just another parameter.

Eliminating the time t by applying generic quantifier elimination to ψ1 ≡∃tϕ1, we obtain after 1.9 s necessary and sufficient conditions

ψ′1(r, p1, p2, q1, q2, v1, v2, w1, w2, π)

in the other parameters for a collision to take place. This ψ′1 is valid under

the simultaneously obtained nd-condition v2 − w2 6= 0. It contains 80 atomicformulas.

We proceed analogously for the second model, and obtain after 48.8 s aquantifier-free formula

ψ′2(r, p1, p2, q1, q2, v1, v2, w1, w2, h, w, π)

without any nd-condition. This ψ′2 contains 4597 atomic formulas.

Let us now turn to a less parametric situation. We fix in ϕ1 and ϕ2 thefollowing values for the radius of the circle, the starting positions, both velocitiesof object 1, the horizontal velocity of object 2, and the horizontal and verticalsafety distances yielding ϕ∗

1(t, w2, π) and ϕ∗2(t, w2, π), respectively:

r = 10000

(p1, p2) = (0, 9000)

(q1, q2) = (2000, 10000)

(v1, v2) = (100,−3)

w1 = 50

h = 50

w = 500.

Applying extended quantifier elimination to ∃tϕ∗1 we ask for vertical velocities w2

of object 2 that will lead to a collision within at most 3 laps of each object. Weobtain after 391 ms two possible conditions on w2 together with correspondinganswers for the collision times:

[

10πw2 + 30π + w2 + 28 = 0 ∧ 5π − 1 > 0 t = 400π + 405π − 1 > 0 ∧ w2 + 28 = 0 t = 40

]

.

This means in rounded numerical values that a collision occurs within the first3 laps if either w2 ≈ −3.77 or w2 = −28. In the first case the collision time ist ≈ 1296.64, in the second case it is t = 40.

The corresponding call applied to ∃tϕ∗2 takes 1.7 s yielding 6 conditions

involving w2 and π together with suitable answers for t. At least two of thesecases have conditions γ which cannot hold for the true π. This is automatically

Page 99: public pdf

4.7. CONCLUSIONS 99

found out by deciding ∃w2∃π(3.1 < π < 3.2 ∧ γ) via quantifier elimination,which takes 8.7 s for all 6 cases together.

Finally, we check the danger of a collision for concrete vertical speed rangesin the second model: Deciding the formula

∃w2∃π∃t(3.1 < π < 3.2 ∧ w2 > −3.8 ∧ ϕ∗2)

by quantifier elimination yields “true” after 799 ms, while for

∃w2∃π∃t(3.1 < π < 3.2 ∧ w2 > −3.7 ∧ ϕ∗2)

we obtain “false” after 835 ms. Taking these results together, some verticalspeed −3.8 6 w2 < −3.7 will—modulo the approximate π—lead to a collisionduring the first 3 laps. The prescription w2 > −3.7, in contrast, is collision-safefor this period.

4.7 Conclusions

We have discussed in this chapter the formulation of various standard prob-lems of computational geometry as quantifier elimination problems or extendedquantifier elimination problems. Applying both regular and extended genericquantifier elimination to such formulations, it has turned out that we can handlea large range of these problems even parametrically. Such a parametric solutionactually provides the solutions for an entire class of problems given by all pos-sible interpretations for the parameters. The single or even double exponentialworst-case complexity of our method has to be viewed and judged on the basisof this fact.

Again, generic quantifier elimination has turned out crucial for our success.In contrast to the application to geometry proving in the previous chapter, thisis, however, mainly for efficiency reasons. The effect of obtaining importantextra information by the assumptions made by the generic elimination proce-dure has not shown here. On the other hand, the use of generic quantifierelimination does not impose any restrictions that cannot be overcome; withExample 4.12 we have demonstrated how to deal with nd-conditions that evenexcluded highly relevant parts of the solution. The major part of the examplesdiscussed here cannot be satisfactorily treated by any available implementationof regular, i.e. non-extended and non-generic, quantifier elimination.

Recall that we have defined generic quantifier elimination in Section 2.4.2in such a way that it does not only generate a theory of subsidiary conditionsin the parameters but also already accepts conditions in the parameters as aninput theory, which is then extended. In Example 4.4 we have seen how to makeuse of this concept for efficiently and cleanly coding positiveness conditions.

By means of a rather sophisticated analysis of possible collisions of twoobjects we have finally illustrated how to operate with two concepts that do notstraightforwardly fit into our general setting: periodicities and computing withgiven transcendental numbers such as π.

Page 100: public pdf

100 CHAPTER 4. COMPUTATIONAL GEOMETRY

Page 101: public pdf

Chapter 5

Solid Modeling

Solid modeling knows two major representation schemes for solid objects: bound-ary representation (b-rep) and constructive solid geometry (csg). b-rep is veryclose to the image rendered on the screen. csg, in contrast, resembles the inher-ent structure of the described solid by combining primitive solids via regularizedboolean operations. Today’s modelers are usually dual representation modelers,which combine both schemata to make use of the particular advantages of eachof them [Hof89].

We propose to supplement modelers with a third component representingsolids as quantifier-free formulas. Among all semialgebraic sets, we define reg-ular closed sets to be valid solids. The treatment of various problems fromcomputational geometry within our framework has already been discussed inthe previous chapter, cf. also [SW98]. This includes parallel and central pro-jections, corresponding reconstruction problems, offsets of algebraic surfaces,Voronoi diagrams, and collision problems. From a theoretical point of view, itis clear that our descriptions are more general than csg and can thus replaceit. It will have to be examined whether this is feasible in practice.

Our notion of a solid obviously extends that of csg. In particular, it includescommon types of offsetted, rounded and blended solids. In fact, all operationscommonly encountered in today’s solid modelers do not lead outside the realmof semialgebraic sets. To show this, we have to redefine all desired operationsto map formulas to formulas, and we have to give algorithms computing thesemaps. For operations involving parallel or central projection we have in factalready done so in the previous chapter. It turns out that all other operationscan also be straightforwardly encoded with quantifiers.

Section 5.1 does so for the usual boolean and topological operations. Sec-tion 5.2 then formally introduces solids as regular closed semialgebraic sets.Section 5.3 examines in detail offsets of solids in our sense. The relevance ofoffsets for rounding and blending has already been indicated in Example 4.10in the previous chapter. Rounding and blending of solids by iterated offsetcomputations is discussed in detail in Section 5.4. Our approach to this al-lows to naturally handle arbitrary semialgebraic sets as intermediate results ofour operations. It shall turn out that this freedom, together with a new con-cept of defining blendings in terms of offsets, allows us to understand and toovercome some well-known problems with the definition of blendings via offsets[Ros85, RR86]. Section 5.5 returns to the issue of integrating our ideas into

101

Page 102: public pdf

102 CHAPTER 5. SOLID MODELING

the framework currently available. We illustrate, how the b-rep representationof our solids can be computed from our description by quantifier-free formu-las. Section 5.6 finally shows how to treat geometric feasibility problems inour framework. The background for this is that the latest generation of cad

systems is being designed to accept as input declarative descriptions of scenesinstead of procedural drawing commands.

As in the previous chapter, we will be able to solve all problems parametri-cally. We can, e.g., compute the blend of a solid with respect to a parametricradius r. The resulting description will contain case distinctions that make itcorrect for any substitution of a positive real number for r. Similarly, the solidsthemselves can be described parametrically, and the quantifier elimination workcan be done once for an entire class of solids. The obtained information can bestored in a database, and then be used by simply substituting concrete dimen-sions.

In the literature there have been already purely algebraic approaches dis-cussed [Hof89, Hof90]. Such approaches can in contrast to our semialgebraicquantifier elimination techniques, of course, not handle polynomial inequalities.

Throughout this chapter, let—except where mentioned otherwise—d denotethe Euclidean metric in Rn, and recall the definition of the corresponding for-mulas δ, δ>, and δ6 from Section 4.4. These definitions extend naturally to δ>and δ<.

We have again performed all our computations on a sun Ultra 1 Model 140workstation using 32 MB of memory.

5.1 Boolean and Topological Operations

Taking unions, intersections, complements, interiors, and closures leads us fromsemialgebraic sets to semialgebraic sets. Denote by

S(

ϕ(u))

={

x ∈ Rn

∣ ϕ(x)}

the semialgebraic set described by the quantifier-free formula ϕ. We can thencarry out boolean and closure operations on the formula representations asfollows:

S(ϕ) ∪ S(ψ) = S(ϕ ∨ ψ)

S(ϕ) ∩ S(ψ) = S(ϕ ∧ ψ)

∼S(ϕ) = S(¬ϕ)

S(ϕ(u))◦ = S(

∃r(r > 0 ∧ ∀x1∀x2∀x3(δ<(x,u, r) −→ ϕ[u/x])))

S(ϕ(u)) = S(

∀r(r > 0 −→ ∃x1∃x2∃x3(δ<(x,u, r) ∧ ϕ[u/x])))

.

Note that this explains also how to perform any composition of these opera-tions on the formula level, including particularly the regular closure, regularizedboolean operations, and taking the boundary ∂S(ϕ) = S(ϕ) ∩ ∼S(ϕ).

5.2 Solids as Regular Closed Semialgebraic Sets

Our intuition of a solid in R3 is that it is a closed semialgebraic set that is“everywhere 3-dimensional.” It is thus reasonable and compatible with the more

Page 103: public pdf

5.3. OFFSETS 103

specialized definitions commonly used [Hof90] to define a solid as a non-emptyregular closed semialgebraic subset of R3.

Definition 5.1 (Regular closure) For A ⊆ Rn the regular closure A∗ is de-fined as the closure of the interior A◦ of A, and A is called regular closed ifA∗ = A.

The dual concept of regular open sets has been studied intensively in the theoryof boolean algebras, where it is the crucial tool for the completion of booleanalgebras [Hal63]. The results on regular open sets can easily be transfered toregular closed sets via duality.

For open sets A we have A∗ ⊇ A, and for closed sets A we have A∗ ⊆ A. IfA is neither open nor closed, there need not hold any inclusion, e.g.:

(

]0, 1[ ∪ {2})∗

= [0, 1].

Since both interior and closure are monotone, so is the regular closure, i.e.,X ⊆ A implies X∗ ⊆ A∗. It follows that if X ⊆ A is already regular closed,thenX ⊆ A∗. Finally, it is not hard to see that the regular closure is idempotent,i.e. A∗∗ = A∗.

For closed sets A the formation of A∗ will—roughly speaking—kill lowerdimensional parts of A. This is exactly what is intended in the well-known for-mation of the normalized boolean operations such as the normalized intersection

A ∩∗ B := (A ∩B)∗.

In the literature this regularization is usually carried out with all boolean oper-ations. From a computational point of view, it might be noteworthy that thisis a certain overkill. For regular closed input solids A and B we have:

(A ∪B)∗ = A ∪B, (∼A)∗ = ∼A, (A \B)∗ = A \B,

i.e., the union requires no regularization at all, and for regularizing complementand difference one need not take the interior. Regularized intersection, in con-trast, really requires the time consuming operations of computing interior andclosure. Note that, at least in our framework, it cannot be efficiently recognizedwhether a set is already open. So this external knowledge will save superfluouscomputations. For the normalized intersection however, we actually have tocompute the closure of the interior.

5.3 Offsets

An important geometric construction for our purposes is the formation of offsetsas already introduced in Section 4.4. Given arbitrary A ⊆ Rn and 0 < r ∈ R

we define:

off6r(A) = {x ∈ Rn | ∃(a ∈ A) : d(x,a) 6 r }.

As we already know, the offset of a semialgebraic set is again semialgebraic:

off6r

(

S(

ϕ(u)))

= S(

∃x1∃x2∃x3(ϕ[u/x] ∧ δ6(x,u, r))

.

Page 104: public pdf

104 CHAPTER 5. SOLID MODELING

This notion of an offset, also called expanding, is quite standard [RR86].Also, it has already been applied to non-regular sets [Ros85]. For regular closedA, we have that off6r(A) is again regular closed.

There is an “opposite” operation of shrinking a set. The result of this is notnecessarily regular closed even when applied to regular closed input sets. Thusshrinking has usually been used in combination with regularization similar tothe regularized boolean operations discussed above. Compositions of expandingand shrinking have been used to perform blending operations on solids [RR86].

Combining expanding and shrinking for blending solids, one is unfortunatelyfaced with unintuitive results, which we are going to analyze in detail in Sec-tion 5.4.3. We will exhibit that these problems are actually caused by theregularization of shrinkings. To overcome the problems, we choose an alternateapproach to defining blendings in terms of offsets. Therefore, we generalize ournotion of an offset by defining also the following:

off>r(A) = {x ∈ Rn | ∀(a ∈ A) : d(x,a) > r },

off<r(A) = {x ∈ Rn | ∃(a ∈ A) : d(x,a) < r },

off>r(A) = {x ∈ Rn | ∀(a ∈ A) : d(x,a) > r }.

Just like off6r, all these operations lead from semialgebraic sets to semialgebraicsets, e.g.,

off>r

(

S(

ϕ(u)))

= S(

∀x1∀x2∀x3(ϕ[u/x] −→ δ6(x,u, r)))

.

The remainder of this section is devoted to a careful study of the properties ofour various offsets and their interaction with boolean and topological operations.

Note that our definitions are not necessarily conform with the notion ofdistance between points and sets. For instance,

1 /∈ off61 ]−∞, 0[ = ]−∞, 1[ , but d(

1, ]−∞, 0[)

= infx<0

d(1, x) = 1.

In other words, there is a point of distance 1 from the given set not containedin its off61. For closed A ⊆ Rn, we can, however, assert that

off6r(A) = {x ∈ Rn | d(x, A) 6 r } and off>r(A) = {x ∈ R

n | d(x, A) > r }.

It follows immediately from the definitions that off6r(A) = ∼ off>r(A) andoff<r(A) = ∼ off>r(A). The following lemma is concerned with offsets of unions.

Lemma 5.2 For A ⊆ Rn and 0 < r ∈ R the following assertions hold:

1. off6r(A ∪ B) = off6r(A) ∪ off6r(B)

2. off>r(A ∪ B) = off>r(A) ∩ off>r(B).

Analogous results hold when replacing “6” by “<” and “>” by “>,” respec-tively.

Proof 1. x ∈ off6r(A ∪ B) iff there exists y ∈ A ∪ B such that d(x,y) 6 riff there exists y ∈ A such that d(x,y) 6 r or there exists y ∈ B such thatd(x,y) 6 r iff x ∈ off6r(A) or x ∈ off6r(B) iff x ∈ off6r(A) ∪ off6r(B).The same argument holds for “<” instead of “6.”

Page 105: public pdf

5.3. OFFSETS 105

2. x ∈ off>r(A ∪ B) iff for all c ∈ A ∪ B we have d(x, c) > r iff for all a ∈ Awe have d(x,a) > r and for all b ∈ B we have d(x,b) > r iff x ∈ off>r(A)and x ∈ off>r(B) iff x ∈ off>r(A) ∩ off>r(B). The same argument holdsfor “>” instead of “>.”

Next, the closure properties of our offsets are quite surprising. For someoffsets they depend on the set considered, while for other offsets they do not.

Lemma 5.3 For A ⊆ Rn and 0 < r ∈ R the following assertions hold:

1. off<r(A) is open and off>r(A) is closed.

2. If A is open, then off6r(A) is open and off>r(A) is closed.

3. If A is closed, then off6r(A) is closed and off>r(A) is open.

Proof 1. Let x ∈ off<r(A), pick a ∈ A, 0 < ε ∈ R such that d(x,a) = r−ε <r. For y ∈ B(x, ε) we have d(y,a) 6 d(y,x)+ d(x,a) < ε+ r− ε = r, i.e.,B(x, ε) ⊆ off<r(A).

2. For open A let x ∈ off6r(A), say a ∈ A such that d(x,a) 6 r. Choose 0 <ε ∈ R such that B(a, ε) ⊆ A. For y ∈ B(x, ε

2 ) pick z on the line segmentax with d(a, z) = ε

2 . Then d(y, z) 6 d(y,x) + d(x, z) < ε2 + r − ε

2 = r,i.e., B(x, ε

2 ) ⊆ off6r(A).

3. For closed A, we show that off6r(A) ⊆ off6r(A): Let x ∈ off6r(A), andassume for a contradiction that x ∈ off>r(A) = ∼ off6r(A). Since A isclosed, there is a ∈ A and 0 < ε ∈ R such that d(x,a) = d(x, A) = r+ε >r. Pick y ∈ B(x, ε) ∩ off6r(A) 6= ∅, then d(x,a) 6 d(x,y)+d(y,a) < ε+r,a contradiction.

Finally, we turn to the interplay between offsets and topological operationsand regularizations.

Lemma 5.4 1. Let A ⊆ Rn, and let 0 < r ∈ R. Then

off>r(A)◦ =◦

off>r(A) = off>r(A)◦ =◦

off>r(A) = off>r(A)

⊆ off>r(A)

⊆ off>r(A)

⊆ off>r(A) = off>r(A) = off>r(A),

off>r(A)∗ = off>r(A)∗.

2. If A is open, then

off>r(A)◦ =◦

off>r(A) = off>r(A)◦ =◦

off>r(A) = off>r(A)

⊆ off>r(A)∗ = off>r(A)∗

⊆ off>r(A) = off>r(A) = off>r(A) = off>r(A) = off>r(A).

Page 106: public pdf

106 CHAPTER 5. SOLID MODELING

3. If A is closed, then

off>r(A)◦ =◦

off>r(A) = off>r(A)◦ =◦

off>r(A) = off>r(A) = off>r(A)

⊆ off>r(A)∗ = off>r(A) = off>r(A)∗

⊆ off>r(A) = off>r(A) = off>r(A).

Proof 1. The inclusion off>r(A)◦ ⊆◦

off>r(A) follows from the obvious inclu-sion off>r(A) ⊆ off>r(A) by the monotony of the interior operator.

In the same way◦

off>r(A) ⊆ off>r(A)◦ follows from off>r(A) ⊆ off>r(A)shown below.

Since off>r(A) is closed by Lemma 5.3, we have off>r(A)◦ =◦

off>r(A).

We show off>r(A)◦ ⊆ off>r(A): Let x ∈ off>r(A)◦, and let y ∈ A. Assumefor a contradiction that d(x,y) 6 r. Choose 0 < ε ∈ R such that B(x, ε) ⊆off>r(A). Pick z on the line segment xy such that d(x, z) = ε

2 , and picka ∈ B(y, ε

2 ) ∩ A. Then d(z,a) 6 d(z,y) + d(y,a) < r − ε2 + ε

2 = r, butz ∈ off>r(A), a contradiction.

off>r(A) ⊆ off>r(A) ⊆ off>r(A) is obvious.

We show the contrapositive of off>r(A) ⊆ off>r(A). This implies that

off>r(A) ⊆ off>r(A) since off>r(A) is closed: Let x /∈ off>r(A), say y ∈ Aand 0 < ε ∈ R such that d(x,y) = r − ε < r. Choose a ∈ B(y, ε) ∩ A.Then d(x,a) 6 d(x,y) + d(y,a) < r − ε+ ε = r, i.e., x /∈ off>r(A).

off>r(A) ⊆ off>r(A) ⊆ off>r(A) is again obvious.

We know by Lemma 5.3 that off>r(A) = off>r(A)◦. From off>r(A) ⊆off>r(A) proved above, it follows by the monotony of the interior operatorthat off>r(A)◦ ⊆ off>r(A)◦; together off>r(A) ⊆ off>r(A)◦.

We show the contrapositive of off>r(A) ⊆ off>r(A): Let x /∈ off>r(A), sayy ∈ A, 0 < ε ∈ R such that d(x,y) = r− ε < r. Then for a ∈ B(y, ε) ∩ Awe have d(x,a) 6 d(x,y) + d(y,a) < r − ε+ ε = r, i.e., x /∈ off>r(A).

We know that off>r(A) = off>r(A) by Lemma 5.3.

From off>r(A)◦ = off>r(A)◦ it follows that off>r(A)∗ = off>r(A)∗.

2. off>r(A)◦ ⊆ off>r(A)∗ is obvious.

Since off>r(A) is closed by Lemma 5.3, we may conclude that off>r(A)∗ ⊆off>r(A).

We show that off>r(A) ⊆ off>r(A): Let x ∈ off>r(A), and let a ∈ A. Thend(x,a) > r. Assume for a contradiction that d(x,a) = r. Pick 0 < ε ∈ R

such that B(a, ε) ⊆ A. Let z be a point on the line segment xa withd(z,a) = ε

2 . Then z ∈ A but d(x, z) = r − ε2 < r, a contradiction.

3. If A is already closed, then obviously off>r(A) = off>r(A).

We know by Lemma 5.3 that off>r(A) is open and thus off>r(A)∗ =off>r(A).

Page 107: public pdf

5.3. OFFSETS 107

Table 5.1: All inclusions in Lemma 5.4 are proper in general

A off>1(A) off>1(A)∗ off>1(A) off>1(A) off>1(A)]−∞, 0[ ]1,∞[ [1,∞[∼ [−1, 1] ∅ {0}]−∞, 0] ]1,∞[ [1,∞[∼ ]−1, 1[ ∅ {0}

A similar result for <-offsets and 6-offsets is derived in the following way:We take the complement of each offset in Lemma 5.4, which inverts all inclusionrelations. Then the complements are encoded into offsets using rules alreadydiscussed above together with the topological rules

∼X = (∼X)◦ and ∼ (X◦) = ∼X.

Corollary 5.5 1. Let A ⊆ Rn, and let 0 < r ∈ R. Then

off<r(A)◦ = off<r(A) = off<r(A)

⊆ off6r(A)◦

⊆ off6r(A)

⊆ off6r(A) = off<r(A)∗ = off<r(A) = off6r(A)∗ = off6r(A),◦

off<r(A) =◦

off6r(A).

2. If A is open, then

off<r(A)◦ = off<r(A) = off<r(A) = off6r(A)◦ = off6r(A)

⊆◦

off<r(A) =◦

off6r(A)

⊆ off6r(A) = off<r(A)∗ = off<r(A) = off6r(A)∗ = off6r(A).

3. If A is closed, then

off<r(A)◦ = off<r(A) = off<r(A)

⊆◦

off<r(A) = off6r(A)◦ =◦

off6r(A)

⊆ off6r(A) = off6r(A) = off<r(A)∗ = off<r(A) = off6r(A)∗

= off6r(A).

Table 5.1 illustrates by example that already in R all inclusions in Lemma 5.4are proper in general. The examples can be transformed into correspondingexamples for </6-offsets by taking complements. Replacing the intervals bycorresponding balls, they can be lifted to any dimension.

Since all the inclusions are proper, it follows that off>r(A)∗ cannot be po-sitioned into the given chain of inclusions for the general case. The followingexample illustrates this fact once more: We set

A = ]−∞, 0] ∪ [3, 4[ ∪ ]6,∞[ ,

Page 108: public pdf

108 CHAPTER 5. SOLID MODELING

which is neither open nor closed. Then off>1(A)∗ = [1, 2] is neither a subsetnor a superset of off>1(A) = ]1, 2[ ∪ {5}. The same observation applies tooff>r(A)∗ = off>r(A)∗.

5.4 Blendings

Among the numerous types of blendings of solids that have been discussed in theliterature [HH86, VMV94] we consider global fixed-radius rolling ball roundingsin the classification of Vida et al. [VMV94]. We will define this notion preciselybelow.

Our blending operations are by definition global on the involved objects. Inpractice, however, one often wishes to perform local blendings, i.e., blendingsrestricted to certain edges or corners. This can be achieved by equivalentlymodifying the boolean structure of the quantifier-free representation of a givensolid in such a way that the target parts are isolated. Then the operations areapplied only to the subformulas describing these parts. Afterwards, the booleanstructure can once more be rearranged to a more canonical form.

5.4.1 Roundings from Inside

Definition 5.6 Let A be a closed set in Rn, and let 0 6 r ∈ R. Then ther-rounding from inside of A is the union of all closed balls completely containedin A:

roundr(A) =⋃

B[a,r]⊆A

B[a, r] ={

x ∈ Rn

∣ ∃(a ∈ A) : x ∈ B[a, r] ⊆ A}

.

Accordingly, A is called r-rounded from inside if A = roundr(A).

From the definition it follows that roundr(A) ⊆ A, and for A ⊆ B wemay conclude that roundr(A) ⊆ roundr(B). The r-rounding from inside of asemialgebraic set is again semialgebraic:

roundr

(

S(

ϕ(u)))

= S(

∃x1∃x2∃x3(δ6(x,u, r) ∧∀y1∀y2∀y3(δ6(x,y, r) −→ ϕ[u/y]))

)

.

The following theorem characterizes roundings from inside in terms of offsets.From this characterization, it follows that r-roundings from inside are, thoughinfinite unions of closed balls, again closed. In fact they are even regular closed.

Theorem 5.7 Let A ⊆ Rn be closed, and let 0 6 r ∈ R. Then

roundr(A) = off6roff>r(∼A) = off6roff>r(∼A).

In particular, roundr(A) is regular closed.

Proof Let x ∈ roundr(A), and pick y ∈ A with x ∈ B[y, r] ⊆ A. Theny ∈ off>r(∼A) and d(x,y) 6 r, and so x ∈ off6roff>r(∼A).

Conversely, let x ∈ off6roff>r(∼A) and pick y ∈ off>r(∼A) with d(x,y) 6 r.Then x ∈ B[y, r] ⊆ A, i.e. x ∈ roundr(A). The rest follows by Lemma 5.4 andCorollary 5.5.

Page 109: public pdf

5.4. BLENDINGS 109

Let A ⊆ Rn be closed. We obviously have round0(A) = A. For 0 < r ∈ R it

follows immediately from Theorem 5.7 that roundr(A) ⊆ A∗, and further

0<r∈R

roundr(A) ⊆ A∗.

This inclusion relation is in general a proper one: Consider the first quadrantA = { (x1, x2) ∈ R2 | x1 > 0 and x2 > 0 } of real 2-space. It is easily seen to beregular closed, but for all 0 < r ∈ R the origin (0, 0) is not in roundr(A).

We eventually have to clarify whether r-roundings are actually r-rounded.They are, and moreover they are as close to the original set as possible:

Lemma 5.8 Let A ⊆ Rn be closed, and let 0 6 r ∈ R. Then roundr(A) is thelargest subset of A that is r-rounded.

Proof We are allowed to form roundr(roundr(A)), because roundr(A) is closedby Theorem 5.7. Since roundr(A) itself is already defined as a union of closedr-balls, it follows that

roundr

(

roundr(A))

=⋃

{

B[b, r]∣

∣ B[b, r] ⊆ roundr(A)}

= roundr(A),

i.e., roundr(A) is r-rounded from inside. Let B ⊆ A be r-rounded from inside.Then B = roundr(B) ⊆ roundr(A).

Finally, we examine the interplay between roundings from inside and booleanoperations.

Lemma 5.9 Let A, B ⊆ Rn be closed, and let 0 < r ∈ R. Then the followingassertions hold:

1. roundr(A) ∪ roundr(B) ⊆ roundr(A ∪ B)

2. roundr(A) ∩ roundr(B) ⊇ roundr(A ∩ B)

3. If both A and B are r-rounded from inside, then so is A ∪ B.

Proof 1. Let x ∈ roundr(A) ∪ roundr(B), say x ∈ roundr(A). Then thereexists y ∈ A such that x ∈ B[y, r] ⊆ A ⊆ A ∪ B.

2. Let x ∈ roundr(A ∩ B). Then there exists y ∈ A ∩ B with x ∈ B[y, r] ⊆A ∩ B ⊆ A,B.

3. Let x ∈ A ∪ B, say x ∈ A. Then there exists y ∈ A with x ∈ B[y, r] ⊆A ⊆ A ∪ B.

The inclusions in Lemma 5.9 above are proper in general: Consider real 2-spaceand fix r = 1. For the first inclusion consider two adjacent squares of sidelengths 2. For the second inclusion consider two overlapping closed unit diskscentered at (0, 0) and (1, 0). This latter example shows also that the intersectionof r-rounded sets is not necessarily r-rounded.

Page 110: public pdf

110 CHAPTER 5. SOLID MODELING

Example 5.10 (First octant) We compute the r-rounding from inside of thefirst octant O1 = S(u1 > 0 ∧ u2 > 0 ∧ u3 > 0). For this, we compute the6-offset of the obvious quantifier-free description u1 − r > 0 ∧ u2 − r > 0 ∧u3 − r > 0 of the >-offset of the complement of O1.

∃x1∃x2∃x3

(

3∧

i=1

xi − r > 0 ∧3

i=1

(ui − xi)2

6 r2)

.

We automatically obtain the following equivalent quantifier-free description ofthe parametric r-rounding from inside. It contains 19 atomic formulas:

roundr(O1) ≡ S(

2r2 − 2ru1 − 2ru2 − 2ru3 + u21 + u2

2 + u23 6 0 ∨

(r − u1 6 0 ∧ r − u2 6 0 ∧ r − u3 6 0) ∨(2ru1 − u2

1 > 0 ∧ r − u2 6 0 ∧ r − u3 6 0) ∨(2ru2 − u2

2 > 0 ∧ r − u1 6 0 ∧ r − u3 6 0) ∨(r2 − 2ru1 − 2ru2 + u2

1 + u22 6 0 ∧ r − u3 6 0) ∨

(2ru3 − u23 > 0 ∧ r − u1 6 0 ∧ r − u2 6 0) ∨

(r2 − 2ru1 − 2ru3 + u21 + u2

3 6 0 ∧ r − u2 6 0) ∨(r2 − 2ru2 − 2ru3 + u2

2 + u23 6 0 ∧ r − u1 6 0)

)

.

This computation takes 60 ms. The first inequality in the above result formulais the ball

3∑

i=1

(ui − r)2 6 r2.

at (r, r, r) with radius r including the rounded corner.The conjunction following this inequality is the first octant shifted from the

origin to the center (r, r, r) of our ball. The next conjunction can be rewrittenas (u1 − r)2 6 r2 ∧ r 6 u2 ∧ r 6 u3, which for positive r amounts to

0 6 u1 6 2r ∧ r 6 u2 ∧ r 6 u3,

i.e. a slice of width 2r parallel to the Y -Z-plane. The two other conjunctionsthat look similar describe corresponding slices in the other coordinate directions.

The conjunction r2 − 2ru1 − 2ru2 + u21 + u2

2 6 0 ∧ r − u3 6 0 describes thesemiinfinite cylinder

2∑

i=1

(ui − r)2 6 r2 ∧ u3 > r

continuing our ball to infinity in direction u3. Again, the two similar conjunc-tions describe the corresponding cylinders in direction u1 and u2, respectively.

Example 5.11 (Full box) Rounding the full box

B = S(0 6 u1 6 2 ∧ 0 6 u2 6 3 ∧ 0 6 u3 6 4)

yields within 3 s a quantifier-free description of roundr(B) containing 106 atomicformulas. Substituting into this description r = 2 and simplifying yields “false”describing the empty set. Substituting r = 1 yields a description of the 1-rounded box, which contains only 50 atomic formulas. The time for substitu-tion and simplification can be neglected here (10 ms and 40 ms of cpu time,respectively).

Page 111: public pdf

5.4. BLENDINGS 111

5.4.2 Roundings from Outside

Recall that we have defined roundings from inside of a solid as the union ofall closed balls contained in it. This removes certain parts of the solid such asconvex edges and corners. Roundings from outside, in contrast, will add certainparts to the solid thus smoothing concave edges and corners. Roughly speaking,the rounding from outside of a solid is obtained by rounding its complement frominside. In other words, the solid rounded from outside is the complement of allballs not intersecting it. Note, however, that both the input solid and the resultof the rounding operation should be closed, i.e. the corresponding complementsare open. We hence operate with open balls here, and, as a consequence, thenotion of rounding from outside is not exactly dual to that of rounding frominside.

Definition 5.12 Let A be a closed set in Rn, and let 0 6 r ∈ R. Then ther-rounding from outside of A is defined as the following set:

Roundr(A) =⋂

{

∼B(x, r)∣

∣ B(x, r) ∩ A = ∅}

={

x ∈ Rn

∣ ∀(y ∈ Rn) : B(y, r) ∩ A = ∅ =⇒ x /∈ B(y, r)

}

.

A is called r-rounded from outside if A = Roundr(A).

From the definition it follows that A ⊆ Roundr(A), and for A ⊆ B, wecan conclude that Roundr(A) ⊆ Roundr(B). As an intersection of closed setsRoundr(A) is closed. Roundings from outside of semialgebraic sets are semial-gebraic:

Roundr

(

S(

ϕ(u)))

= S(

∀x1∀x2∀x3(¬∃y1∃y2∃y3(δ<(x,y, r) ∧ ϕ(y))

−→ δ>(x,u, r)))

.

Similar to roundings from inside, roundings from outside can be character-ized as iterated offset computations:

Theorem 5.13 Let A ⊆ Rn be closed, and let 0 6 r ∈ R. Then

Roundr(A) = off>roff>r(A).

Proof Let x ∈ Roundr(A), and let y ∈ off>r(A). Then B(y, r) ∩ A = ∅, thusx /∈ B(y, r), and so d(x,y) > r. This shows that Roundr(A) ⊆ off>roff>r(A).

Conversely, let x ∈ off>roff>r(A), and let y ∈ Rn be such that B(y, r) ∩

A = ∅. Then y ∈ off>r(A), thus d(x,y) > r, and so x /∈ B(y, r). This showsthe converse inclusion.

Also, rounding from outside yields rounded sets as one would expect:

Lemma 5.14 Let A ⊆ Rn be closed, and let 0 6 r ∈ R. Then Roundr(A) isthe smallest superset of A that is r-rounded from outside.

Proof We already know that Roundr(A) ⊆ Roundr

(

Roundr(A))

. Let, con-

versely, x ∈ Roundr

(

Roundr(A))

, and let furthermore y ∈ Rn be such thatB(y, r) ∩ A = ∅. Then for all z ∈ Roundr(A) we have z /∈ B(y, r), i.e.,

Page 112: public pdf

112 CHAPTER 5. SOLID MODELING

B(y, r) ∩ Roundr(A) = ∅. Hence x /∈ B(y, r), and we have shown thatRoundr

(

Roundr(A))

⊆ Roundr(A). Let B ⊇ A be r-rounded from outside.Then Roundr(A) ⊆ Roundr(B) = B.

Compared to roundings from inside, unions and intersections of roundings fromoutside obey the opposite inclusions. Accordingly, roundings from outside areclosed under intersection instead of union.

Lemma 5.15 Let A, B ⊆ Rn be closed, and let 0 < r ∈ R. Then the followingassertions hold:

1. Roundr(A) ∪ Roundr(B) ⊆ Roundr(A ∪ B)

2. Roundr(A) ∩ Roundr(B) ⊇ Roundr(A ∩ B)

3. If both A and B are r-rounded from outside, then so is A ∩ B.

Proof 1. Let x ∈ Roundr(A) ∪ Roundr(B), and let z ∈ Rn with B(z, r) ⊆

∼(A ∪ B) = ∼A ∩ ∼B. Then x /∈ B(z, r).

2. Let x ∈ Roundr(A ∩ B), and let z ∈ Rn such that B(z, r) ∩ A = ∅,

respectively B(z, r) ∩ B = ∅. Then B(z, r) ∩ (A ∩ B) = ∅, and thusx /∈ B(z, r).

3. Let x ∈ Roundr(A ∩ B), and assume x /∈ A ∩ B, say x /∈ A. Thenx /∈ Roundr(A), and so there exists z ∈ Rn with x ∈ B(z, r) ⊆ ∼A ⊆∼A ∪ ∼B = ∼(A ∩ B), a contradiction.

Again, the inclusions are proper in general already in real 2-space: For the firstinclusion, consider the two half spaces given by x1 6 0 and by x2 6 0. Forthe second inclusion, consider the complements of the first and of the secondquadrant. The first example shows also that roundings from outside are notclosed under union.

There appear to be no relations between r-roundings from outside and reg-ular closed or open sets. In fact, there is a regular closed, simply connected setA ⊆ R3 such that Roundr(A) is disconnected and not regular closed.

The relation between r-roundings from inside and r-roundings from outsideworks via the operation of taking closures of complements.

Theorem 5.16 Let A ⊆ Rn be closed, and let 0 < r ∈ R. Then the followingassertions hold:

1. roundr(A) = ∼Roundr(∼A)

2. Roundr(A∗)∗ = ∼ roundr(∼A).

Proof 1. roundr(A) = off6roff>r(∼A) = off<roff>r(∼A) =

∼ off>roff>r(∼A) = ∼Roundr(∼A)

2. We rewrite ∼ roundr(∼A) according to part (1), and transform it in thefollowing way:

∼∼Roundr(∼∼A) = ∼∼Roundr(∼∼(A◦)) = ∼∼Roundr(A∗).

By the same transformation we eventually obtain Roundr(A∗)∗.

Page 113: public pdf

5.4. BLENDINGS 113

Example 5.17 (Closed complement of first octant) For the parametricr-rounding from outside of the closed complement of the first octant S(u1 6

0 ∨ u2 6 0 ∨ u3 6 0) we obtain, similar to rounding the octant itself frominside in Example 5.10, 19 atomic formulas in less than one second.

5.4.3 Comparison to Other Work

Rossignac and Requicha [RR86] define solids as regular closed sets A ⊆ Rn.Rounding is defined in terms of the offsetting operations of expanding A ↑∗ rand (regularized) shrinking A ↓∗ r. The notion of expanding is exactly our6-r-offset. Shrinking is defined in terms of expanding:

A ↑∗ r = off6r(A), A ↓∗ r = ∼ (∼A ↑∗ r).Recall from Corollary 5.5 that off6r(A) is regular closed for closed A. In thedefinition of shrinking, both applications of the closure operator are to opensets. The closures obtained are thus in fact regular closures, i.e., the result ofshrinking applied to closed sets is regular closed. We translate the definition ofshrinking to our framework:

A↓∗r = ∼ (∼A ↑∗ r) = ∼ off6r(∼A) = off>r(∼A) = off>r(∼A)∗ = off>r(∼A)∗.

Rounding from inside and rounding from outside are defined by Rossignac andRequicha as

round′r(A) = (A ↓∗ r) ↑∗ r and Round′

r(A) = (A ↑∗ r) ↓∗ r,respectively. As we have seen above both expanding and shrinking yield regularclosed sets, and so do hence rounding from inside and from outside.

This means that at least Round′r must differ in some way from our notion

Roundr: Consider, e.g., ∼ ]−r, r[ ⊆ R, which is regular closed. In our sense, itis r-rounded from outside:

Roundr(∼ ]−r, r[) = off>roff>r(∼ ]−r, r[) = off>r({0}) = ∼ ]−r, r[ .In the framework of [RR86] we obtain in contrast:

Round′r(∼ ]−r, r[) = off>r

(

∼ off6r(∼ ]−r, r[))∗

= off>r(∅)∗ = R.

Similar effects occur with roundings from inside. In our framework, closedballs of radius r are r-rounded from inside:

roundr([−r, r]) = off6roff>r(∼[−r, r]) = off6r({0}) = [−r, r].Using round′

r we obtain in contrast the empty set as inner rounding:

round′r([−r, r]) = off6r

(

off>r(∼[−r, r])∗)

= off6r(∅∗) = off6r(∅) = ∅.The examples can be lifted to any dimension using corresponding balls insteadof intervals. Moreover, for a dimension greater than or equal to two, ∼B(0, r)used in the example for roundings from outside becomes connected. Note alsothat the 1-rounding of the full box in our Example 5.11 would be the empty setwith the notion of regularized rounding.

The counterintuitive behavior of regularized roundings has already been ob-served and illustrated by Rossignac [Ros85] by means of examples similar tothose given in Figure 5.1.

Page 114: public pdf

114 CHAPTER 5. SOLID MODELING

Figure 5.1: Given the solid top left, our notions of rounding from inside (center)and outside (right) lead to the results in the top row. Regularized blending yieldsthe results in the bottom row for these limit cases.

Example 5.18 (Rossignac’s limit case) We compute the rounding from in-side of Rossignac’s solid pictured in Figure 5.1. it is described by

(0 6 x1 6 8 ∧ 0 6 x2 6 3) ∨(0 6 x1 6 2 ∧ 3 6 x2 6 7) ∨ (6 6 x1 6 8 ∧ 3 6 x2 6 7).

After 182 s we obtain a quantifier-free description containing 2063 atomic for-mulas. Substituting r = 1 and simplifying requires 16 s. The description thenobtained for the 1-rounding contains 1298 atomic formulas. If we restrict tothe 1-rounding from the beginning, we obtain a description with 1265 atomicformulas in 69 s.

Due to his observation, Rossignac has defined “non-regularized” variants ofrounding from inside and from outside in terms of non-regularized shrinking andexpanding:

A ↑ r = off6r(A)

A ↓ r = ∼(∼A ↑ r) = ∼ off6r(∼A) = off>r(∼A)

round′′r (A) = (A ↓ r) ↑ r = off6roff>r(∼A) = roundr(A)

Round′′r (A) = (A ↑ r) ↓ r = off>r

(

∼ off6r(A))

= off>roff>r(A).

This rounding round′′r from inside amounts to exactly our notion. Non-

regularized rounding from outside, in contrast, leads to similar problems asRound′ above. Rossignac thus defines a “modified” rounding from outside:

Round′′′r (A) = ∼ round′′

r ((∼A)∗)∗

= off>roff>r(∼(∼A)∗)∗ = off>roff>r

( ◦A

)∗= off>roff>r

( ◦A

)∗.

For regular closed input A∗, we have◦A∗ = A∗◦. It follows that Round′′′ is then

the regular closure of our rounding from outside:

Round′′′r (A∗) = off>roff>r(A

∗◦)∗ = off>roff>r(A∗◦)∗ = Roundr(A∗)∗.

Both of the references discussed finally consider their initial versions round′

and Round′ the best solution, in order to avoid open sets even as intermediateresults.

Page 115: public pdf

5.5. OBTAINING B-REP INFORMATION 115

5.5 Obtaining B-REP Information

So far we have considered quantifier-free first-order formulas as an alternativeto csg. As already mentioned in the introduction to this chapter, there is a sec-ond commonly used representation in solid modeling, which is called boundaryrepresentation or b-rep for short. It represents solids as a finite collection ofpatches of their surfaces plus information on adjacency among these patches.

The solid modelers currently available are hybrid systems using both csg

and b-rep. The use of b-rep is mainly for the purpose of displaying objects,which currently cannot be satisfactorily solved on the basis of csg. For thisreason, we have to discuss how to obtain corresponding information from ourquantifier-free descriptions.

In Section 4.2 on page 77, we have introduced the operator ∂ for obtaining theboundary of a geometric object. The computation of a dnf of the quantifier-freedescription obtained by the application of this operator will yield a disjunctionof possibly overlapping patches, which is a major step towards the complete b-

rep information. We apply this strategy to two toy examples. The first examplelooks very promising, while the second one unfolds the weakness of this naiveapproach for slightly more complicated input.

Example 5.19 (Box) We consider the solid rectangular box

β1(u) ≡ 0 6 u1 6 10 ∧ 0 6 u2 6 5 ∧ 0 6 u3 6 5.

A quantifier-free equivalent of ∂(β1) can be computed in 160 ms:

∂(β1)′(u) ≡ u1 − 10 6 0 ∧ u1 > 0 ∧ u2 − 5 6 0 ∧ u2 > 0 ∧

u3 − 5 6 0 ∧ u3 > 0 ∧(u1 − 10 = 0 ∨ u1 = 0 ∨ u2 − 5 = 0 ∨ u2 = 0 ∨u3 − 5 = 0 ∨ u3 = 0).

From this we obtain in 40 ms a Grobner-simplified dnf describing exactly thesix sides of the box:

(u1 − 10 6 0 ∧ u1 > 0 ∧ u2 − 5 6 0 ∧ u2 > 0 ∧ u3 = 0) ∨(u1 − 10 6 0 ∧ u1 > 0 ∧ u2 − 5 6 0 ∧ u2 > 0 ∧ u3 − 5 = 0) ∨(u1 − 10 6 0 ∧ u1 > 0 ∧ u2 = 0 ∧ u3 − 5 6 0 ∧ u3 > 0) ∨(u1 − 10 6 0 ∧ u1 > 0 ∧ u2 − 5 = 0 ∧ u3 − 5 6 0 ∧ u3 > 0) ∨(u1 = 0 ∧ u2 − 5 6 0 ∧ u2 > 0 ∧ u3 − 5 6 0 ∧ u3 > 0) ∨(u1 − 10 = 0 ∧ u2 − 5 6 0 ∧ u2 > 0 ∧ u3 − 5 6 0 ∧ u3 > 0).

Example 5.20 (Infinite cylinder) We next consider the infinite cylinder ζ ≡u2

1 + u22 6 1. After 13 s we obtain a quantifier-free description ∂(ζ)′ of its

boundary. This description contains 949 atomic formulas. Due to combinatorialexplosion it is not possible to compute a dnf of ∂(ζ)′.

It thus turns out that except for extremely simple structures we do notobtain a boundary description that is suitable for further processing. We havetherefore developed a strategy, of course involving quantifier elimination, whichhas turned out to perform nicely on various examples of quite different style. Itincludes the following steps, which we are going to explain in detail:

Page 116: public pdf

116 CHAPTER 5. SOLID MODELING

• Computation of candidate patches.

• Isolation of proper surface patches.

• Grobner simplification of the surface.

• Quantifier elimination recognized implication.

5.5.1 Computation of Candidate Patches

Consider the rectangular box described by the following quantifier-free formula:

β1(u) ≡ 0 6 u1 6 10 ∧ 0 6 u2 6 5 ∧ 0 6 u3 6 5.

Each of the patches of its surface Σ(β1) can be obtained by turning exactly oneof the inequalities in β1 into an equation:

Σ(β1)(u) ≡ {u1 = 0 ∧ 0 6 u2 6 5 ∧ 0 6 u3 6 5,

u1 = 10 ∧ 0 6 u2 6 5 ∧ 0 6 u3 6 5,

0 6 u1 6 10 ∧ u2 = 0 ∧ 0 6 u3 6 5,

0 6 u1 6 10 ∧ u2 = 5 ∧ 0 6 u3 6 5,

0 6 u1 6 10 ∧ 0 6 u2 6 5 ∧ u3 = 0,

0 6 u1 6 10 ∧ 0 6 u2 6 5 ∧ u3 = 5}.

Unfortunately, the success of this technique depends on the nice description β1.The same solid could be described as the union of two smaller boxes:

β′1(u) ≡ (0 6 u1 6 10 ∧ 0 6 u2 6 3 ∧ 0 6 u3 6 5) ∨

(0 6 u1 6 10 ∧ 3 6 u2 6 5 ∧ 0 6 u3 6 5).

Then, our naive approach would yield the following:

1. Proper surface patches such as

0 6 u1 6 10 ∧ u2 = 0 ∧ 0 6 u3 6 5.

2. Separate surface patches, which should be combined into one, such as

u1 = 0 ∧ 0 6 u2 6 3 ∧ 0 6 u3 6 5, u1 = 0 ∧ 3 6 u2 6 5 ∧ 0 6 u3 6 5.

3. The plane segment separating the two subboxes. This is not part of thesurface of β1:

0 6 u1 6 10 ∧ u2 = 3 ∧ 0 6 u3 6 5.

Note, however, that this result still contains the entire surface. This will gener-ally happen when turning inequalities into equations.

More precisely, we proceed as follows: Let σ be the description of our solid.Assume that all right hand sides of the constraints are zero, and denote by Lσ

the set of left hand side terms of the constraints in σ. Then we compute thelimiting of sigma as follows

λ(σ) ≡∨

t∈Lσ

t = 0 ∧ σ.

Page 117: public pdf

5.5. OBTAINING B-REP INFORMATION 117

Lemma 5.21 Let S(σ) be closed, then ∂S(σ) ⊆ S(

λ(σ))

⊆ S(σ).

Proof To begin with, S(

λ(σ))

⊆ S(σ) follows immediately from the fact that

S(

λ(σ))

is a union of subsets of S(σ).

For proving ∂S(σ) ⊆ S(

λ(σ))

, we may wlog. assume that σ is of the form

i∈I

j∈Ji

tij(u) ij 0, ij ∈ {>,>}.

Let now x ∈ ∂S(σ). Since S(σ) is closed, it follows that even x ∈ S(σ). Thusσ(x) holds; more precisely, we can find some i0 ∈ I such that

j∈Ji0

ti0j(x) i0j 0

holds. Assume for a contradiction that in fact even∧

j∈Ji0ti0j(x) > 0 holds.

All the ti0j(u) > 0 describe preimages of the open interval ]0,∞[ under the con-tinuous polynomial functions given by the ti0j(u), i.e., open sets. Consequently,the finite intersection of all these sets is open. Since the interior of a set containsall open subsets, we have found

x ∈ S(

j∈Ji0

ti0j(u) > 0)

=⋂

j∈Ji0

S(

ti0j(u) > 0)

⊆ S(σ)◦,

which contradicts x ∈ ∂S(σ) = S(σ) \ S(σ)◦. It follows that there must be atleast one j0 ∈ Ji0 such that i0j0 equals “>” and such that actually ti0j0(x) = 0holds. This finally implies that

x ∈ S(

ti0j0(u) = 0 ∧∧

j∈Ji0

ti0j(u) i0j 0)

⊆ S(

λ(σ))

.

Our algorithm turns λ(σ) into dnf and applies Grobner simplification, whichin turn yields a simpler but equivalent dnf. The conjunctions contained in thisdnf form our list Σ0 of candidate patches. These candidates are reduced to thepure surface in the following step.

5.5.2 Isolation of Proper Surface Patches

For isolating the surface patches, we intersect the candidates with ∼S(σ). Adescription η′ of this is obtained by applying quantifier elimination to

η(u) ≡ ∀ε(

ε > 0 −→ ∃x1∃x2∃x3(δ6(u,x, ε) ∧ ¬σ[u/x]))

.

The subformula δ6(u,x, ε) describing the metric relation d(u,x, ε) 6 ε has beendefined in Section 4.4. For the success of our method, it is crucial that we usehere the L∞ metric, which can, in contrast to the Euclidean one, be codedlinearly. Both metrics induce the same topology.

Next, all the candidate patches are conjunctively combined with η′. Theresults are put into cnf, and Grobner simplification is applied, resulting in asimplified cnf. All the cnf’s obtained this way form a list Σ1 of proper surfacepatches. Some of them might be, however, empty or of dimension 1 or 0. Thecnf computations performed here have empirically turned out crucial for thesuccess of the dnf computation in the following step.

Page 118: public pdf

118 CHAPTER 5. SOLID MODELING

0

2

4

6

8

10

u1

0

2

4

6

8

10

u2

0

2

4

6

u3

Figure 5.2: The two boxes of Example 5.22

5.5.3 Grobner Simplification of the Surface

We now recombine the patches in Σ1 to a formula∨

Σ1, compute a dnf of thisformula, and again apply Grobner simplification, which keeps the formula indnf. The result is split again to a list Σ2 of patches, each of which is either apure conjunction or a single atomic formula.

5.5.4 Quantifier Elimination Recognized Implication

We finally want to detect patches π, π′ ∈ Σ2 such that S(π) ⊆ S(π′). In thiscase, π can certainly be dropped. The inclusions are recognized by applyingquantifier elimination to

∀u1∀u2∀u3

(

π(u) −→ π′(u))

.

This simplification method is called quantifier elimination recognized implicationresembling the notion of simplifier recognized implication introduced in [DS97c].We denote the remainder of Σ2 obtained this way by Σ(σ). Note that the numberof quantifier eliminations to be performed here is unfortunately quadratic in thenumber of patches of Σ2.

5.5.5 Computation Examples

Example 5.22 (Two boxes) Consider the solid β ≡ β1 ∨ β2 obtained as theunion of the following two rectangular boxes:

β1 ≡ 0 6 u1 6 10 ∧ 0 6 u2 6 5 ∧ 0 6 u3 6 5

β2 ≡ 5 6 u1 6 10 ∧ 0 6 u2 6 10 ∧ 1 6 u3 6 6.

This solid β is pictured in Figure 5.2. Our algorithm proceeds as follows:

1. Candidate computation yields 16 candidate patches in 210 ms.

2. The computation of ∼S(σ) by quantifier elimination takes 140 ms. In-tersections, cnf computations, and Grobner simplifications take 710 msaltogether resulting in 16 patches.

Page 119: public pdf

5.5. OBTAINING B-REP INFORMATION 119

3. dnf computation and Grobner simplification expand this within 560 msto 41 patches all of which are pure conjunctions.

4. Quantifier elimination recognized implication reduces this to 14 patcheswithin 3.5 s.

The final result gives in a very nice way exactly the surface of β:

Σ(β) ≡ {u1 − 10 = 0 ∧ u2 − 5 6 0 ∧ u2 > 0 ∧ u3 − 5 6 0 ∧ u3 > 0,

u1 − 10 = 0 ∧ u2 − 10 6 0 ∧ u2 > 0 ∧ u3 − 1 > 0 ∧ u3 − 6 6 0,

u1 − 5 = 0 ∧ u2 − 5 > 0 ∧ u2 − 10 6 0 ∧ u3 − 1 > 0 ∧ u3 − 6 6 0,

u1 − 5 = 0 ∧ u2 − 10 6 0 ∧ u2 > 0 ∧ u3 − 5 > 0 ∧ u3 − 6 6 0,

u1 = 0 ∧ u2 − 5 6 0 ∧ u2 > 0 ∧ u3 − 5 6 0 ∧ u3 > 0,

u1 − 5 6 0 ∧ u1 > 0 ∧ u2 − 5 = 0 ∧ u3 − 5 6 0 ∧ u3 > 0,

u1 − 10 6 0 ∧ u1 > 0 ∧ u2 − 5 = 0 ∧ u3 − 1 6 0 ∧ u3 > 0,

u1 − 5 > 0 ∧ u1 − 10 6 0 ∧ u2 − 10 = 0 ∧ u3 − 1 > 0 ∧ u3 − 6 6 0,

u1 − 10 6 0 ∧ u1 > 0 ∧ u2 = 0 ∧ u3 − 5 6 0 ∧ u3 > 0,

u1 − 5 > 0 ∧ u1 − 10 6 0 ∧ u2 = 0 ∧ u3 − 1 > 0 ∧ u3 − 6 6 0,

u1 − 5 6 0 ∧ u1 > 0 ∧ u2 − 5 6 0 ∧ u2 > 0 ∧ u3 − 5 = 0,

u1 − 5 > 0 ∧ u1 − 10 6 0 ∧ u2 − 10 6 0 ∧ u2 > 0 ∧ u3 − 6 = 0,

u1 − 5 > 0 ∧ u1 − 10 6 0 ∧ u2 − 5 > 0 ∧ u2 − 10 6 0 ∧ u3 − 1 = 0,

u1 − 10 6 0 ∧ u1 > 0 ∧ u2 − 5 6 0 ∧ u2 > 0 ∧ u3 = 0}.

Example 5.23 (Infinite cylinder) We apply our algorithm to the infinitecylinder ζ ≡ u2

1 + u22 6 1 of Example 5.20. Of course, the correct boundary

u21 +u2

2 = 1 is the only candidate patch and also forms the final solution. The inthis case superfluous quantifier elimination for computing ∼S(ζ) requires 1.6 s.All other steps need no measurable time.

Example 5.24 (Bounded cylinder) For the cylinder ζ′ ≡ u21 +u2

2 6 1 ∧ 0 6

u3 6 3 the situation is similar at the beginning: The three correct candidatesare obtained after 30 ms, ∼S(ζ′) requires 1.9 s. Now, the cnf computation andGrobner simplification for the intersected candidates take 59 s. Finally, dnf

computation plus Grobner simplification and quantifier elimination recognizedimplication take 30 ms and 59 ms, respectively.

Example 5.25 (Two boxes with hole) We revisit the two boxes of Exam-ple 5.22, and include a hole into one of the boxes:

β′ ≡ β ∧ ¬β3, where β3 ≡ (2 < u1 < 3 ∧ 2 < u2 < 3 ∧ 2 < u3 < 3).

A wire frame model of the obtained solid is pictured in Figure 5.3. Here, 26candidate patches are computed in 370 ms, and the quantifier elimination forcomputing ∼S(β′) takes 750 ms. Then the cnf computation for the intersectionwith the candidates fails due to combinatorial explosion, and consequently ourentire algorithm fails.

Page 120: public pdf

120 CHAPTER 5. SOLID MODELING

0

2

4

6

8

10

u1

0

2

4

6

8

10

u2

0

2

4

6

u3

Figure 5.3: The two boxes with hole of the Examples 5.25 and 5.27

5.5.6 An Approximative Variant

Our examples have faced us with two possible problems: On one hand, thequantifier elimination for the surface computation step can be time consum-ing. On the other hand, the boolean normal form computations following thisstep can fail. In the latter case, the reason is the complexity of the quantifierelimination result. So replacing the quantifier elimination by something simplerwould probably help with both problems.

Our idea is to copy the style of the candidate patch computation to thecomputation of the exterior of the complement. We replace in our algorithm∼S(σ) by the solid S(ω(¬σ)) described by the weakening of ¬σ, which we definesyntactically. The weakening ω(¬σ) is obtained from ¬σ as follows:

1. The logical negation “¬”is moved inside σ, and finally eliminated by cod-ing it into the relations of the atomic formulas.

2. Each inequality t 6= 0 is replaced by “true.” Atomic formulas t > 0 andt < 0 are replaced by t > 0 and t 6 0, respectively.

Lemma 5.26 ∼S(σ) ⊆ S(

ω(¬σ))

.

Proof We know that ∼S(σ) = S(¬σ). The first step of weakening, whichmoves inside and encodes “¬” is an equivalence transformation leading to, say,σ′. It now suffices to show that S(σ′) ⊆ S

(

ω′(σ′))

, where ω′ is the second stepin our definition of weakening. It is not hard to see that ω′ is compatible withthe following transformations on σ′:

• normalizing all right hand sides of atomic formulas to 0,

• replacing equations t = 0 by t > 0 ∧ t 6 0,

• replacing inequalities t 6= 0 by t > 0 ∨ t < 0,

• turning all formulas t < 0 and t 6 0 into −t > 0 and −t > 0, respectively,

• computing a dnf by applying only rules of propositional logic.

Page 121: public pdf

5.5. OBTAINING B-REP INFORMATION 121

We may thus assume wlog. that σ′ is of the form

σ′(u) ≡∨

i∈I

j∈Ji

tij(u) ij 0, ij ∈ {>,>}.

Accordingly, ω′(σ′)(u) ≡ ∨

i∈I

j∈Jitij(u) > 0, and it is easy to see that

S(σ′) ⊆ S(

ω′(σ′))

. We have to show that even S(σ′) ⊆ S(

ω′(σ′))

.

Let x ∈ S(σ′), and assume for a contradiction that x /∈ S(

ω′(σ′))

, i.e.,

x ∈ ∼S(

ω′(σ′))

= S(

¬ω′(σ′))

. Obviously,

¬ω′(σ′)(u)←→∧

i∈I

j∈Ji

tij(u) < 0,

and from this description, we see that ∼S(

ω′(σ′))

is open, because each of theS(tij < 0) is the preimage of the open interval ]−∞, 0[ under the continuouspolynomial function given by tij(u), and thus open, and S

(

¬ω′(σ′))

is an in-tersection of finite unions of these open sets. This means, we can choose ε > 0such that y ∈ ∼S

(

ω′(σ′))

for all y with d(y,x) < ε. On the other hand, we

know from x ∈ S(σ′) that for our ε there must be some y with d(y,x) < ε andy ∈ S(σ′) ⊆ S

(

ω′(σ′))

, a contradiction.

Note that the inclusion relation in the lemma is in general a proper one.Thus the introduction of weakening leads to an approximative method that, ingeneral, can lead to wrong results. Assume, for instance, that ¬σ contains aftermoving the negation inside a contradictory strong inequality:

¬σ ←→ ϕ ∨ u21 + u2

2 < 0.

weakening will then compute ω(¬σ) ≡ ω(ϕ) ∨ u21+u2

2 6 0. That is, there comesinto existence a cylinder ζ ≡ u2

1+u22 = 0 that possibly reaches outside the closure

∼S(σ). This cylinder ζ can in turn intersect with candidate patches of theoriginal solid σ that are not part of its surface. During our practical experimentswe have, however, never observed such cases. In particular, contradictions asobvious as u2

1 + u22 < 0 are immediately detected and removed by our standard

simplifier.We are going to discuss in detail Example 5.25 with weakening.

Example 5.27 (Two boxes with hole revisited) We again compute the 26candidate patches in 330 ms. The weakening of β′ does not take any measurabletime. This time, the cnf computations for the intersection with the candidatessucceed within 1.6 s yielding again 26 patches. dnf computation and Grobnersimplification take 8.7 s yielding 200 patches. These 200 patches are reduced byquantifier elimination recognized implication to 20 patches Σ(β′) within 33.6 s.These 20 patches yield in fact a beautiful description of the surface of our solid:

Σ(β′) ≡ {u1 − 3 = 0 ∧ u2 − 2 > 0 ∧ u2 − 3 6 0 ∧ u3 − 2 > 0 ∧ u3 − 3 6 0,

u1 − 10 = 0 ∧ u2 − 5 6 0 ∧ u2 > 0 ∧ u3 − 5 6 0 ∧ u3 > 0,

u1 − 10 = 0 ∧ u2 − 10 6 0 ∧ u2 > 0 ∧ u3 − 1 > 0 ∧ u3 − 6 6 0,

u1 − 5 = 0 ∧ u2 − 5 > 0 ∧ u2 − 10 6 0 ∧ u3 − 1 > 0 ∧ u3 − 6 6 0,

u1 − 5 = 0 ∧ u2 − 10 6 0 ∧ u2 > 0 ∧ u3 − 5 > 0 ∧ u3 − 6 6 0,

Page 122: public pdf

122 CHAPTER 5. SOLID MODELING

u1 − 2 = 0 ∧ u2 − 2 > 0 ∧ u2 − 3 6 0 ∧ u3 − 2 > 0 ∧ u3 − 3 6 0,

u1 = 0 ∧ u2 − 5 6 0 ∧ u2 > 0 ∧ u3 − 5 6 0 ∧ u3 > 0,

u1 − 2 > 0 ∧ u1 − 3 6 0 ∧ u2 − 3 = 0 ∧ u3 − 2 > 0 ∧ u3 − 3 6 0,

u1 − 5 6 0 ∧ u1 > 0 ∧ u2 − 5 = 0 ∧ u3 − 5 6 0 ∧ u3 > 0,

u1 − 10 6 0 ∧ u1 > 0 ∧ u2 − 5 = 0 ∧ u3 − 1 6 0 ∧ u3 > 0,

u1 − 5 > 0 ∧ u1 − 10 6 0 ∧ u2 − 10 = 0 ∧ u3 − 1 > 0 ∧ u3 − 6 6 0,

u1 − 2 > 0 ∧ u1 − 3 6 0 ∧ u2 − 2 = 0 ∧ u3 − 2 > 0 ∧ u3 − 3 6 0,

u1 − 10 6 0 ∧ u1 > 0 ∧ u2 = 0 ∧ u3 − 5 6 0 ∧ u3 > 0,

u1 − 5 > 0 ∧ u1 − 10 6 0 ∧ u2 = 0 ∧ u3 − 1 > 0 ∧ u3 − 6 6 0,

u1 − 2 > 0 ∧ u1 − 3 6 0 ∧ u2 − 2 > 0 ∧ u2 − 3 6 0 ∧ u3 − 3 = 0,

u1 − 5 6 0 ∧ u1 > 0 ∧ u2 − 5 6 0 ∧ u2 > 0 ∧ u3 − 5 = 0,

u1 − 5 > 0 ∧ u1 − 10 6 0 ∧ u2 − 10 6 0 ∧ u2 > 0 ∧ u3 − 6 = 0,

u1 − 2 > 0 ∧ u1 − 3 6 0 ∧ u2 − 2 > 0 ∧ u2 − 3 6 0 ∧ u3 − 2 = 0,

u1 − 5 > 0 ∧ u1 − 10 6 0 ∧ u2 − 5 > 0 ∧ u2 − 10 6 0 ∧ u3 − 1 = 0,

u1 − 10 6 0 ∧ u1 > 0 ∧ u2 − 5 6 0 ∧ u2 > 0 ∧ u3 = 0}.

5.5.7 Adjacency Information

A b-rep description of a solid S(σ) will contain besides the surface patchesΣ(σ) obtained by our algorithm also adjacency information on these patches.For a pair π, π′ ∈ Σ(σ) of patches, it can easily be checked whether π and π′

are disjoint or not by applying quantifier elimination to

∃u1∃u2∃u3

(

π(u) ∧ π′(u))

.

If the result is “true,” this means there is a common point, which implies ad-jacency. Note, that in this case, it is still possible that π and π′ are actuallyoverlapping fragments of one facet, and should thus be joined. All examplesdiscussed above do, however, not show this misbehavior, and the computationtime for the quadratically many eliminations also does not cause any problem.

5.6 Geometric Feasibility

Solving geometric constraints is an important topic for the development of in-telligent cad systems [GC98a, GC98b, Hof95]. The idea is that the user inputsdeclarative descriptions of diagrams or engineering drawings instead of specify-ing how to draw these figures.

There are three approaches geometric constraint solving: a constructionapproach, a numerical approach, and a symbolic approach. The constructionapproach transforms the geometric constraints into a form that is easy to draw.One such target form is called rc-configuration. This is a list of points whichcan successively be constructed by ruler and compass from their respective pre-decessors. The numerical approach turns the constraint system into algebraicequations similar in style to the translations we used for geometry proving inChapter 3. The obtained systems of equations are then solved numerically.The symbolic approach, in contrast, solves the obtained systems by algebraicmethods such as Grobner basis techniques or Wu–Ritt reduction.

Page 123: public pdf

5.6. GEOMETRIC FEASIBILITY 123

a

b

c

c

b

a

1

11

2

12

Figure 5.4: Two possible layouts for a house front (Example 5.28)

Note that both the numeric and the symbolic approach can, in contrast toreal quantifier elimination, not handle ordering inequalities. We are going todiscuss two examples that make intense use of such inequalities.

Example 5.28 (House front) We wish to place 3 objects within a wall: awindow, a door, and a heater. Our layout has to obey the following designconstraints (compare Figure 5.4): The room is 2.5 m high, we leave the lengthof our wall parametric, say c m. The window is of parametric size a × b m. Ithas to placed at least 0.5 m from the end of the wall, from the ceiling, and fromthe door. The door is 1 m wide, its height does not matter. It also has to beplaced at least 0.5 m from the wall to the right of the window. The heater is2 m wide and 1 m high. It has to be placed on the floor either to the right of thedoor or centered below the window. In the latter case, the window also mustbe at least 2 m wide. Denoting the lower left corner of the window by (wx, wy),and the right borders of door and heater by dx and hx, respectively, we obtainthe following subsystems of constraints:

π ≡ a > 0 ∧ b > 0 ∧ c > 0

window ≡ 0.5 6 wx ∧ wx + a 6 dx − 0.5 ∧ wy > 0 ∧ wy + b 6 2.5− 0.5

door ≡ dx + 1 6 c− 0.5

w-heater ≡ hx + 1 = wx +a− 2

2∧ wy > 1 ∧ a > 2 ∧ F = 1

d-heater ≡ hx = c− 2 ∧ dx 6 hx − 1 ∧ F = 0.

Using these constraints, our layout problem can be described by the followingformula with parameters a, b, c, and F :

∆(a, b, c, F ) ≡ ∃dx∃hx∃wx∃wy

(

π ∧ window ∧ door ∧ (w-heater ∨ d-heater))

.

Page 124: public pdf

124 CHAPTER 5. SOLID MODELING

Table 5.2: Minimal wall lengths for given window areas (Example 5.28)

A (in m2) cmin (in m) for ωA cmin (in m) for δA0.5 4.5 4.251 4.5 4.51.5 4.5 4.752 4.5 52.5 5 5.253 5.5 5.53.5 6 5.754 6.5 64.5 7 6.255 7.5 6.5

The parameter F is a flag that will indicate the chosen design variant in theresult. This technique has been firstly used by A. Dolzmann for solving sophis-ticated scheduling problems by quantifier elimination.

Quantifier elimination on ∆ plus subsequent Grobner simplification yieldsafter only 10 ms the following quantifier-free equivalent ∆′(a, b, c, F ) for ∆:

(2a− 2c+ 5 6 0 ∧ a− 2 > 0 ∧ b− 1 6 0 ∧ b > 0 ∧ c > 0 ∧ F − 1 = 0) ∨(a− c+ 4 6 0 ∧ a > 0 ∧ b− 2 6 0 ∧ b > 0 ∧ c > 0 ∧ F = 0).

This ∆′ precisely describes the relations that must hold between the parametersa, b, and c for our two possible designs. If we substitute concrete windowdimensions, say a = 2 and b = 1, into ∆′ and apply the standard simplifier, weimmediately obtain

(2c− 9 > 0 ∧ F − 1 = 0) ∨ (c− 6 > 0 ∧ F = 0).

So for the chosen window dimensions, with the heater under the window thewall must be at least 4.5 m long, and with the heater on the right hand side ofthe door the wall must be even 6 m long.

Next, we want to decide which layout to use with windows of a given minimalarea. For areas A ∈ {0.5, 1, 1.5, . . . , 5} we compute quantifier-free equivalentsfor the formulas

ωA(c) ≡ ∃dx∃hx∃wx∃wy∃a∃b∃F (π ∧ window ∧ door ∧ w-heater ∧ ab > A)

δA(c) ≡ ∃dx∃hx∃wx∃wy∃a∃b∃F (π ∧ window ∧ door ∧ d-heater ∧ ab > A).

These yield, separately for each layout variant, straightforward descriptions ofthe minimal wall lengths for the chosen window sizes. For instance,

ω′0.5(c) ≡ 2c− 9 > 0 and δ′0.5(c) ≡ 4c− 17 > 0.

The eliminations for all the A yield Table 5.2, the computation of which takes730 ms altogether.

Our house front example above is in a certain way very well-behaved: Weare dealing exclusively with rectangles that are positioned in parallel to the

Page 125: public pdf

5.6. GEOMETRIC FEASIBILITY 125

Figure 5.5: Packing disks (Example 5.29)

axes of our coordinate system. Consequently, we do not need quadratic termsfor encoding Euclidean distances. This changes in the following example, whichexclusively deals with circles.

Example 5.29 (Packing disks) For n ∈ N, we want to arrange n unit disks inthe plane such that the maximal distance between any two if them is minimized.This is described by the following formula, where we use the Euclidean metricfor δ> and δ6:

βn(z) ≡ ∃x(1)1 ∃x

(1)2 . . .∃x(n)

1 ∃x(n)2

(

n∧

i=1

i−1∧

j=1

(

δ>(x(i),x(j), 1) ∧ δ6(x(i),x(j), z))

)

.

If we apply extended quantifier elimination to some βn, the quantifier-free equiv-alent will describe the minimal maximal distance in terms of z, and the answerwill yield one possible list of centers of the unit disks such that this distance isrealized. See Figure 5.5 for solutions for n 6 6, which are quite easy to guess.The problem starts to get interesting for n = 7. For our practical computations,we normalize

x(1) = (0, 0) and x(2) = (1, 0),

and drop the corresponding quantifiers. Then β1 and β2 are quantifier-free. Forβ3 we obtain within 60 ms the quantifier-free equivalent β′

3 ≡ z2 − 1 > 0, andthe answer

x(3) =(1

2,

√4z2 − 1

2

)

,

i.e, the distance z is 1 and the center of the third unit disk can be located at

x(3) =(

12 ,

√3

2

)

. The elimination for β4 yields after approximately 10 minutes a

formula with 4911 atomic formulas, where the quantifiers “∃x(3)1 ” and “∃x(3)

2 ”are still present. They cannot be eliminated due to the degree restrictions ofthe virtual substitution method. The βn for n > 4 will certainly also fail.

Note that the packing problem is actually solved even for balls in 3-space.This solution plays an important role for understanding the structure of metallattices in chemistry [HW85].

Page 126: public pdf

126 CHAPTER 5. SOLID MODELING

5.7 Conclusions

We have proposed to use quantifier-free formulas for representing solids in cad

systems. The standard operations commonly encountered in solid modelers and,in addition, offsetting and blending can then be performed by quantifier elim-ination. In particular blending has been extensively discussed in the literatureduring the last years.

Our approach to blending uses in a natural way open sets as intermediateresults. This allows us to define very adequate and convenient notions of blend-ing from inside and from outside in terms of some newly developed offsettingoperations. We have carefully analyzed the mathematical properties of our var-ious offsets. This has finally enabled us to straightforwardly prove the relevantproperties of our notions of blending from inside and from outside. Moreover,we could use our offsets as a tool for analyzing, comparing, and systemizing alsothe notions of blending discussed elsewhere.

We have demonstrated that one can obtain the information provided bycommon b-rep descriptions from our formula descriptions. This informationallows to render the modeled geometric configurations on a screen or printer.For this purpose, we have changed for the first and only time in this thesis ourstrategy from the pure, though often quite sophisticated, modeling of problemsby first-order formulas to the development of new algorithms, which certainlyinvolve quantifier elimination for several subtasks. By suggesting an approxi-mate method for computing surface patches of a given formula-described solid,we have demonstrated that the quantifier elimination approach can be feasibleand reasonable even in situations where we are faced with the problem thatpure quantifier elimination approaches fail due to the poor inherent worst-casecomplexity of this method.

Finally, we have shown that our methods are also straightforwardly appli-cable to geometric constraint solving, which is of increasing importance in thescientific literature on the design of graphics systems, where it is considered to bethe basic tool for the next generation of modeling systems. Here we have, similarto the situation with geometric theorem proving, again to compete with estab-lished algebraic approaches. Again, our real quantifier elimination approach hasthe great advantage of allowing ordering constraints in the descriptions of themodeled sceneries.

Page 127: public pdf

Chapter 6

Concluding Remarks

We are finally going to summarize and evaluate our work.After an introduction chapter containing some historical notes, giving an

overview over the content of this thesis, and explicitly stating the main results,the work starts in Chapter 2 by introducing the reader to the scientific frame-work of real quantifier elimination. For this, we haven given a historical overviewover the development of this field of science. Then we have summarized a largepart of the known results and methods, where we focussed on material that isin some way relevant for applications.

The new contributions provided by this thesis start with the introductionof generic quantifier elimination and the related concepts in Section 2.4. Thisis followed by a brief summary of simplification strategies, which have in thepast turned out crucial for the success of applied quantifier elimination. At thispoint, the major part of the algorithmic tools used throughout the thesis hasbeen introduced.

Our focus is naturally on quantifier elimination by virtual substitution, whichhas been implemented within the computer logic system redlog by the authoret al. that, as a part of the computer algebra system reduce, is widely acceptedand used inside the scientific community. In fact, reduce provides with redlog

the currently only professionally maintained and marketed implementation ofreal quantifier elimination. We have devoted an entire section to the design ofredlog, which has been our major computation tool throughout this thesis. Allour implementations of quantifier elimination variants by virtual substitutionare restricted to formulas, where the quantified variables occur with low degreeonly. In theory, the method can be extended to arbitrary degrees. It is, however,not clear if a corresponding implementation would be applicable to problems ofreasonable sizes. In some cases discussed throughout this thesis, the degreerestriction was actually relevant in that problems could be formulated but notstraightforwardly solved.

A summary of a variety of application areas has given an idea of the scopeof the methods used here. They provide an extremely general tool that is by nomeans restricted to geometric problems, which we have focussed on. Finally, wehave clarified the difference between real quantifier elimination and apparentlyclosely related areas such as automatic theorem proving and constraint logicprogramming.

In Chapter 3, we turned to the first major geometric application area: geo-

127

Page 128: public pdf

128 CHAPTER 6. CONCLUDING REMARKS

metric theorem proving. By automatically proving some well-known benchmarkexamples with our redlog implementation, we have demonstrated that ourmethod can compete with the algebraic methods discussed in the literature sofar. Since our method is a genuinely real, in contrast to complex, proof method,its application range exceeds that of the traditional methods in various ways:First, it can handle ordering inequalities; second, it can prove theorems, whichdo not hold over the complex numbers but only over the reals; third, it can notonly prove but also disprove theorems.

After specification of the independent parameters in the given problem,the assumptions made by the generic quantifier elimination for reducing thecomplexity of the elimination algorithm turn out to specify mostly the non-degeneracy conditions that are actually necessary for the input conjecture tohold. The apparent restriction of generic quantifier elimination in contrast toregular quantifier elimination has thus turned out as a valuable tool. In fact,generic quantifier elimination is, at least in the application area considered here,superior to regular quantifier elimination, which cannot straightforwardly be ap-plied in such a way that non-degeneracy conditions are detected.

There are geometric assertions that do not generally hold without an ad-ditional assumption that in turn cannot be characterized as non-degeneracycondition. Such an assumption may, e.g., describe the locus of certain points tofulfill the geometrical requirements of a theorem, or it can contain informationon the ordering between certain values. For such examples, our method sup-plies by means of the actual elimination result, which is an arbitrary booleancombination of equations and inequalities, exactly the necessary and sufficientconditions for the theorem to hold wrt. the classical non-degeneracy conditionsobtained independently. This extends the application range of our method frompure theorem proving to the much more sophisticated concept of theorem find-ing.

In Chapter 4 we have discussed the formulation of various standard prob-lems of computational geometry as quantifier elimination problems or extendedquantifier elimination problems. Instead of competing with existent approaches,we have focussed on the fact that we can handle these problems parametrically.Such a parametric solution actually provides the solutions for an entire class ofproblems given by all possible interpretations for the parameters. The single oreven double exponential worst-case complexity of our method has to be viewedand judged on the basis of this fact. Anyway, we have encountered examples,where the elimination time exceeded several hours. In such cases the applicationof quantifier elimination techniques is obviously not reasonable.

As with geometric proving, generic quantifier elimination has turned outcrucial for our success. In contrast to the application to geometry proving this is,however, mainly for efficiency reasons. The effect of obtaining important extrainformation via the assumptions made by the generic elimination procedure hasnot shown here. On the other hand, the use of generic quantifier eliminationdid not impose any restrictions that cannot be overcome; we have demonstratedhow to deal with nd-conditions that even excluded highly relevant parts of thesolution. The major part of the discussed examples in the area of computationalgeometry cannot be satisfactorily treated by any available implementation ofregular, i.e. non-extended and non-generic, quantifier elimination.

In Chapter 5, we have finally proposed to use quantifier-free formulas forrepresenting solids in cad systems. The standard operations commonly en-

Page 129: public pdf

129

countered in solid modelers and, in addition, offsetting and blending can thenbe performed by quantifier elimination. In particular blending has been exten-sively discussed in the literature during the last years.

Our approach to blending uses in a natural way open sets as intermediateresults. This allows us to define very adequate and convenient notions of blend-ing from inside and from outside in terms of some newly developed offsettingoperations. We have carefully analyzed the mathematical properties of our var-ious offsets. This has finally enabled us to straightforwardly prove the relevantproperties of our notions of blending from inside and from outside. Moreover,we could use our offsets as a tool for analyzing, comparing, and systemizing alsothe notions of blending discussed elsewhere.

We have demonstrated that one can obtain the information provided bycommon b-rep descriptions from our formula descriptions. This informationallows to render the modeled geometric configurations on a screen or printer.For this purpose, we have changed for the first and only time in this thesis ourstrategy from the pure, though often quite sophisticated, modeling of problemsby first-order formulas to the development of new algorithms, which certainlyinvolve quantifier elimination for several subtasks. By suggesting an approxi-mate method for computing surface patches of a given formula-described solid,we have demonstrated that the quantifier elimination approach can be feasibleand reasonable even in situations where we are faced with the problem that somestraightforward quantifier elimination technique fails due to the poor inherentworst-case complexity of the method. Such a failure can be caused either byexcessive elimination times or by large incomprehensible results that cannot besimplified automatically. It is a well-known particular drawback of the virtualsubstitution method to produce such redundant results.

Finally, we have shown that our methods are also straightforwardly appli-cable to geometric constraint solving, which is of increasing importance in thescientific literature on the design of graphics systems, where it is considered to bethe basic tool for the next generation of modeling systems. Here we have, similarto the situation with geometric theorem proving, again to compete with estab-lished algebraic approaches. Again, our real quantifier elimination approach hasthe great advantage of allowing ordering constraints in the descriptions of themodeled sceneries.

Page 130: public pdf

130 CHAPTER 6. CONCLUDING REMARKS

Page 131: public pdf

Bibliography

[ACM84] Dennis S. Arnon, George E. Collins, and Scott McCallum. Cylindri-cal algebraic decomposition I: The basic algorithm. SIAM Journalon Computing, 13(4):865–877, November 1984.

[ADY+96] Chaouki T. Abdallah, Peter Dorato, Wei Yang, Richard Liska, andStanly Steinberg. Applications of quantifier elimination theory tocontrol system design. In Proceedings of the 4th IEEE MediterraneanSymposium on Control and Automation, pages 340–345. IEEE, 1996.

[Arn81] Dennis S. Arnon. Algorithms for the geometry of semi-algebraic sets.Ph.D. dissertation, Computer Sciences Department, University ofWisconsin, Madison, 1981. Technical Report No. 436.

[BCE+93] Bruno Buchberger, George E. Collins, Mark J. Encarnacion, HoonHong, Jeremy R. Johnson, Werner Krandick, Rudiger Loos, Ana M.Mandache, Andreas Neubacher, and Herbert Vielhaber. Saclib 1.1user’s guide. RISC-Linz Series Technical Report 93-19, ResearchInstitute for Symbolic Computation, Johannes Kepler University,A-4040 Linz, Austria, 1993.

[BdB07] Ferdinand Francois Desire Budan de Boislaurent. Nouvelle methodepour la resolution des equations numeriques d’un degre quelconque,1807. 2nd edition, Paris 1822.

[Bec91] Eberhard Becker. Sums of squares and quadratic forms in real al-gebraic geometry. In Cahiers du Seminaire d’Historie de Mathe-matiques, volume 1, pages 41–57. Universite Pierre et Marie Curie,Laboratoire de Mathematiques Fondamentales, Paris, 1991.

[BKOS97] Mark de Berg, Marc van Kreveld, Mark Overmars, and OtfriedSchwarzkopf. Computational Geometry, Algorithms and Applica-tions. Springer, Berlin, Heidelberg, New York, 1997.

[BKR86] Michael Ben-Or, Dexter Kozen, and John Reif. The complexity ofelementary algebra and geometry. Journal of Computer and SystemSciences, 32:251–264, 1986.

[BPR94] Saugata Basu, Richard Pollack, and Marie-Francoise Roy. On thecombinatorial and algebraic complexity of quantifier elimination. InShafi Goldwasser, editor, Proceedings of the 35th Annual Symposiumon Foundations of Computer Science, pages 632–641, Santa Fe, NM,November 1994. IEEE Computer Society Press, Los Alamitos, CA.

131

Page 132: public pdf

132 BIBLIOGRAPHY

[Bro83] Morton Brown. Problem proposal in the Problems and Solutionssection. American Mathematical Monthly, 90(8):569, October 1983.

[Buc65] Bruno Buchberger. Ein Algorithmus zum Auffinden der Basisele-mente des Restklassenringes nach einem nulldimensionalen Polyno-mideal. Doctoral dissertation, Mathematical Institute, University ofInnsbruck, Innsbruck, Austria, 1965.

[Bur90] Klaus-Dieter Burhenne. Implementierung eines Algorithmus zurQuantorenelimination fur lineare reelle Probleme. Diploma thesis,Universitat Passau, D-94030 Passau, Germany, December 1990.

[BW94] Eberhard Becker and Thorsten Wormann. On the trace formulafor quadratic forms. In William B. Jacob, Tsit-Yuen Lam, andRobert O. Robson, editors, Recent Advances in Real Algebraic Ge-ometry and Quadratic Forms, volume 155 of Contemporary Mathe-matics, pages 271–291. American Mathematical Society, AmericanMathematical Society, Providence, Rhode Island, 1994. Proceedingsof the RAGSQUAD Year, Berkeley, 1990–1991.

[BWK93] Thomas Becker, Volker Weispfenning, and Heinz Kredel. GrobnerBases, a Computational Approach to Commutative Algebra, volume141 of Graduate Texts in Mathematics. Springer, New York, 1993.

[CH91] George E. Collins and Hoon Hong. Partial cylindrical algebraic de-composition for quantifier elimination. Journal of Symbolic Compu-tation, 12(3):299–328, September 1991.

[Cho88] Shang-Ching Chou. Mechanical Geometry Theorem Proving. Math-ematics and its applications. D. Reidel Publishing Company, Dor-drecht, Boston, Lancaster, Tokyo, 1988.

[Col74] George E. Collins. Quantifier elimination for real closed fieldsby cylindrical algebraic decomposition—preliminary report. ACMSIGSAM Bullitin, 8(3):80–90, August 1974. Proceedings of the EU-ROSAM ’74.

[Col75] George E. Collins. Quantifier elimination for the elementary the-ory of real closed fields by cylindrical algebraic decomposition. InH. Brakhage, editor, Automata Theory and Formal Languages. 2ndGI Conference, volume 33 of Lecture Notes in Computer Science,pages 134–183. Gesellschaft fur Informatik, Springer-Verlag, Berlin,Heidelberg, New York, 1975.

[Col85] George E. Collins. The SAC-2 computer algebra system. In Bob F.Caviness, editor, EUROCAL ’85; Proceedings of the European Con-ference on Computer Algebra, volume 104 of Lecture Notes in Com-puter Science, pages 34–35. Springer, Berlin, Heidelberg, New York,Tokyo, April 1985.

[Col90] Alain Colmerauer. Prolog III. Communications of the ACM,33(7):70–90, July 1990.

Page 133: public pdf

BIBLIOGRAPHY 133

[CT95] Pasqualina Conti and Carlo Traverso. A case of automatic theoremproving in Euclidean geometry: the MacLane 83 theorem. In GerardCohen, Marc Giusti, and Teo Mora, editors, AAECC-11, volume948 of Lecture Notes in Computer Science, pages 183–193. Springer,Berlin, Heidelberg, 1995.

[Dan51] George B. Dantzig. Maximization of a linear function of variablessubject to linear inequalities. In T. C. Koopmans, editor, ActivityAnalysis of Production and Allocation, pages 339–347. John Wiley& Sons, New York, 1951.

[Des73] Rene Descartes. La geometrie—livre III. In Charles Adam andPaul Tannery, editors, Discours de la Methode & Essais, volume 6of Œuvres des Descartes, pages 442–485. Librairie PhilosophiqueJ. Vrin, Paris, new edition, 1973.

[DGS98] Andreas Dolzmann, Oliver Gloor, and Thomas Sturm. Approachesto parallel quantifier elimination. In Oliver Gloor, editor, Proceed-ings of the 1998 International Symposium on Symbolic and AlgebraicComputation (ISSAC 98), pages 88–95, Rostock, Germany, August1998. ACM, ACM Press, New York, 1998.

[DH88] James H. Davenport and Joos Heintz. Real quantifier elimination isdoubly exponential. Journal of Symbolic Computation, 5(1–2):29–35,February–April 1988.

[Dol94] Andreas Dolzmann. Reelle Quantorenelimination durch parametri-sches Zahlen von Nullstellen. Diploma thesis, Universitat Passau,D-94030 Passau, Germany, November 1994.

[DS96] Andreas Dolzmann and Thomas Sturm. Redlog user manual. Tech-nical Report MIP-9616, FMI, Universitat Passau, D-94030 Passau,Germany, October 1996. Edition 1.0 for Version 1.0.

[DS97a] Andreas Dolzmann and Thomas Sturm. Guarded expressions inpractice. In Wolfgang W. Kuchlin, editor, Proceedings of the 1997International Symposium on Symbolic and Algebraic Computation(ISSAC 97), pages 376–383, Maui, HI, July 1997. ACM, ACM Press,New York, 1997.

[DS97b] Andreas Dolzmann and Thomas Sturm. Redlog: Computer algebrameets computer logic. ACM SIGSAM Bulletin, 31(2):2–9, June 1997.

[DS97c] Andreas Dolzmann and Thomas Sturm. Simplification of quantifier-free formulae over ordered fields. Journal of Symbolic Computation,24(2):209–231, August 1997.

[DS99] Andreas Dolzmann and Thomas Sturm. Redlog user manual. Tech-nical Report MIP-9905, FMI, Universitat Passau, D-94030 Passau,Germany, April 1999. Edition 2.0 for Version 2.0.

[DSW98a] Andreas Dolzmann, Thomas Sturm, and Volker Weispfenning. Anew approach for automatic theorem proving in real geometry. Jour-nal of Automated Reasoning, 21(3):357–380, 1998.

Page 134: public pdf

134 BIBLIOGRAPHY

[DSW98b] Andreas Dolzmann, Thomas Sturm, and Volker Weispfenning. Realquantifier elimination in practice. In B. H. Matzat, G.-M. Greuel,and G. Hiss, editors, Algorithmic Algebra and Number Theory, pages221–247. Springer, Berlin, 1998.

[DYA97] Peter Dorato, Wei Yang, and Chaouki Abdallah. Robust multi-objective feedback design by quantifier elimination. Journal of Sym-bolic Computation, 24(2):153–159, August 1997. Special issue onapplications of quantifier elimination.

[Fou31] Jean Baptiste Joseph Fourier. Analyse des equations determinees.F. Didot, Paris, 1831.

[GC98a] Xiao-Shan Gao and Shang-Ching Chou. Solving geometric constraintsystems. I. A global propagation approach. Computer-Aided Design,30(1):47–54, January 1998.

[GC98b] Xiao-Shan Gao and Shang-Ching Chou. Solving geometric constraintsystems. II. A symbolic approach and decision of Rc-constructibility.Computer-Aided Design, 30(2):115–122, February 1998.

[GV93] Laureano Gonzalez-Vega. A combinatorial algorithm solving somequantifier elimination problems. Technical Report 11-1993, Univer-sity of Cantabria, Departemento de Mathematicas, Estadistica yComputacion, Facultad de Ciencias, Avenida de Los Castros, 39071Santander, Spain, November 1993.

[Hal63] Paul R. Halmos. Lectures on Boolean Algebras, volume 1 of VanNostrand Mathematical Studies. D. van Nostrand Company, Inc.,Princeton, New Jersey, 1963.

[Her05] Charles Hermite. Remarques sur le theoreme de M. Sturm. In EmilePicard, editor, Œuvres des Charles Hermite, volume 1, pages 284–287. Gauthier-Villars, Paris, 1905.

[HH86] Chistoph Hoffmann and John Hopcroft. Quadratic blending surfaces.Computer-Aided design, 18(6):301–306, July and August 1986.

[Hil87] David Hilbert. Grundlagen der Geometrie. Teubner StudienbucherMathematik. Teubner, Stuttgart, Germany, 13th edition, 1987.

[HLS97] Hoon Hong, Richard Liska, and Stanly Steinberg. Testing stabil-ity by quantifier elimination. Journal of Symbolic Computation,24(2):161–187, August 1997. Special issue on applications of quan-tifier elimination.

[Hof89] Christoph M. Hoffmann. Geometric and Solid Modeling. ComputerGraphics and Geometric Modeling. Morgan Kaufmann, San Mateo,California, 1989.

[Hof90] Christoph M. Hoffmann. Algebraic and numerical techniques foroffsets and blends. In Wolfgang Dahmen, Mariano Gasca, andCharles A. Micchelli, editors, Computation of Curves and Surfaces,pages 499–528. Kluwer Academic Publishers, Dordrecht, Boston,London, 1990.

Page 135: public pdf

BIBLIOGRAPHY 135

[Hof95] Christoph Hoffmann. Geometric constraint solving in r2 and r3. InD.Z. Du and F. Huang, editors, Computing in Euclidean Geometry,pages 266–298. World Scientfic, 1995.

[Hof96] Christoph M. Hoffmann. How solid is solid modeling. In Ming C.Lin and Dinesh Manocha, editors, Applied Computational Geome-try, volume 1148 of Lecture Notes in Computer Science, pages 1–8.Springer, Berlin, Heidelberg, 1996.

[Hon90a] Hoon Hong. An improvement of the projection operator in cylindri-cal algebraic decomposition. In Shunro Watanabe and Morio Nagata,editors, Proceedings of the International Symposium on Symbolic andAlgebraic Computation (ISSAC 90), pages 261–264, Tokyo, Japan,August 1990. ACM, ACM Press, New York, 1990.

[Hon90b] Hoon Hong. Improvements in CAD-based Quantifier Elimination.Ph.D. thesis, The Ohio State University, 1990.

[Hon92] Hoon Hong. Simple solution formula construction in cylindrical alge-braic decomposition based quantifier elimination. In Paul S. Wang,editor, Proceedings of the International Symposium on Symbolic andAlgebraic Computation (ISSAC 92), pages 177–188, Berkeley, CA,July 1992. ACM, ACM Press, New York, 1992.

[Hon93a] Hoon Hong. Quantifier elimination for formulas constrained byquadratic equations. In Manuel Bronstein, editor, Proceedings ofthe International Symposium on Symbolic and Algebraic Computa-tion (ISSAC 93), pages 264–274, Kiev, Ukraine, July 1993. ACM,ACM Press, New York, 1993.

[Hon93b] Hoon Hong. Quantifier elimination for formulas constrained byquadratic equations via slope resultants. THE Computer Journal,36(5):440–449, 1993. Special issue on computational quantifier elim-ination.

[HW85] Arnold F. Holleman and Nils Wiberg. Lehrbuch der anorganischenChemie. De Gruyter, Berlin, New York, 91st–100th edition, 1985.

[Ioa99] Nikolaos I. Ioakimidis. REDLOG-aided derivation of feasibilityconditions in applied mechanics and engineering problems undersimple inequality constraints. Journal of Mechanical Engineering(Strojnıcky Casopis), 50(1):58–69, 1999.

[Jir97] Mats Jirstrand. Nonlinear control system design by quantifier elim-ination. Journal of Symbolic Computation, 24(2):137–152, August1997. Special issue on applications of quantifier elimination.

[Kap86] Deepak Kapur. Using Grobner bases to reason about geometry prob-lems. Journal of Symbolic Computation, 2(4):399–408, December1986.

[KM88] Deepak Kapur and Joseph L. Mundy. Wu’s method and its appli-cation to perspective viewing. Artificial Intelligence, 37(1-3):15–36,December 1988. Special volume on geometric reasoning.

Page 136: public pdf

136 BIBLIOGRAPHY

[KS86] Bernhard A. Kutzler and Sabine Stifter. On the application of Buch-berger’s algorithm to automated geometry theorem proving. Journalof Symbolic Computation, 2(4):389–397, December 1986.

[Kut88] Bernhard A. Kutzler. Algebraic Approaches to Automated TheoremProving. PhD thesis, Johannes Kepler Universitat Linz, 1988. RISC-Linz series no. 88-74.0.

[KW] M’hammed el Kahoui and Andreas Weber. Deciding hopf bifurca-tions by quantifier elimination in a software component architecture.To appear in the Journal of Symbolic Computation.

[LPY99] Gerardo Lafferriere, George J. Pappas, and Sergio Yovine. A newclass of decidable hybrid systems. In Frits W. Vaandrager and Jan H.van Schuppen, editors, Hybrid Systems and Control. Proceedings ofthe Second International Workshop, HSCC’99, Berg en Dal, TheNetherlands, March 1999, volume 1569 of Lecture Notes in ComputerScience, pages 137–151. Springer, Berlin, Germany, 1999.

[LW93] Rudiger Loos and Volker Weispfenning. Applying linear quantifierelimination. The Computer Journal, 36(5):450–462, 1993. Specialissue on computational quantifier elimination.

[Mac36] Saunders MacLane. Some interpretations of abstract linear depen-dence in terms of projective geometry. American Journal of Mathe-matics, 58:236–240, 1936.

[McC84] Scott McCallum. An Improved Projection Operation for Cylindri-cal Algebraic Decomposition. Ph.D. dissertation, Computer SciencesDepartment, University of Wisconsin, Madison, 1984.

[McC88] Scott McCallum. An improved projection operation for cylindri-cal algebraic decomposition of three-dimensional space. Journal ofSymbolic Computation, 5(1–2):141–161, February–April 1988.

[MCG94] Nicholas Freitag McPhee, Shang-Ching Chou, and Xiao-Shan Gao.Mechanically proving geometry theorems using a combination ofWu’s method and Collins’ method. In Alan Bundy, editor, Auto-mated Deduction—CADE-12, volume 814 of Lecture Notes in Arti-ficial Intelligence, pages 401–415. Springer, Berlin, Heidelberg, NewYork, 1994.

[Mot36] Theodore S. Motzkin. Beitrage zur Theorie der linearen Ungleichun-gen. Doctoral dissertation, Universitat Zurich, 1936.

[NT92] Masayuki Noro and Taku Takeshima. Risa/Asir—a computer alge-bra system. In Paul S. Wang, editor, Proceedings of the ISSAC ’92,pages 387–396, Berkeley, CA, July 1992. ACM, ACM Press, NewYork, 1992.

[Ped91] Paul Pedersen. Counting Real Zeros. Ph.D. dissertation, CourantInstitute of Mathematical Sciences, New York, 1991.

Page 137: public pdf

BIBLIOGRAPHY 137

[PP97] Martin Peternell and Helmut Pottmann. Computing rationalparametrizations of canal surfaces. Journal of Symbolic Computa-tion, 23(2–3):255–266, February–March 1997.

[PRS93] Paul Pedersen, Marie-Francoise Roy, and Aviva Szpirglas. Countingreal zeroes in the multivariate case. In F. Eysette and A. Galigo,editors, Computational Algebraic Geometry, volume 109 of Progressin Mathematics, pages 203–224. Birkhauser, Boston, Basel; Berlin,1993. Proceedings of the MEGA 92.

[PS85] Franco P. Preparata and Michael I. Shamos. ComputationalGeometry—An Introduction. Texts and monographs in computerscience. Springer, New York, 1985.

[Ren92] James Renegar. On the computational complexity and geometry ofthe first-order theory of the reals. Journal of Symbolic Computation,13(3):255–352, March 1992. Part I–III.

[Rit32] Joseph F. Ritt. Differential Equations from the Algebraic Standpoint,volume 14 of AMS Colloquium Publications. American MathematicalSociety, New York, NY, 1932.

[Rit50] Joseph F. Ritt. Differential Algebra, volume 33 of AMS ColloquiumPublications. American Mathematical Society, New York, NY, 1950.

[Ros85] Jaroslaw R. Rossignac. Blending and Offsetting Solid Models.Ph.D. thesis, Department of Electrical Engineering, College of En-gineering and Applied Science, University of Rochester, Rochester,New York 14627, July 1985.

[RR86] Jaroslaw R. Rossignac and Aristides A. G. Requicha. Offsettingoperations in solid modelling. Computer Aided Geometric Design,3(2):129–148, August 1986.

[Sei56a] Abraham Seidenberg. An elimination theory for differential algebra.Univ. California Publ. Math (N.S.), 3:31–66, 1956.

[Sei56b] Abraham Seidenberg. Some remarks on Hilbert’s Nullstellensatz.Arch. Math., 7:235–240, 1956.

[Sei69] Abraham Seidenberg. On k-constructable sets, k-elementary formu-lae, and elimination theory. Journal fur die reine und angewandteMathematik, 239/240:256–267, 1969.

[Stu35] Jacques Charles Francois Sturm. Memoire sur la resolution desequations numeriques. In Memoires presentes par divers Savantsetrangers a l’Academie royale des sciences, section Sc. math. phys.,volume 6, pages 273–318, 1835.

[Stu96] Thomas Sturm. Real quadratic quantifier elimination in Risa/Asir.Research Memorandum ISIS-RM-5E, ISIS, Fujitsu LaboratoriesLimited, 1-9-3, Nakase, Mihama-ku, Chiba-shi, Chiba 261, Japan,September 1996.

Page 138: public pdf

138 BIBLIOGRAPHY

[Stu99] Thomas Sturm. Reasoning over networks by symbolic methods.Applicable Algebra in Engineering, Communication and Computing,10(1):79–96, September 1999.

[SW97] Thomas Sturm and Volker Weispfenning. Rounding and blending ofsolids by a real elimination method. In Achim Sydow, editor, Pro-ceedings of the 15th IMACS World Congress on Scientific Compu-tation, Modelling, and Applied Mathematics (IMACS 97), volume 2,pages 727–732, Berlin, August 1997. IMACS, Wissenschaft & Tech-nik Verlag, Berlin, 1997.

[SW98] Thomas Sturm and Volker Weispfenning. Computational geometryproblems in Redlog. In Dongming Wang, editor, Automated Deduc-tion in Geometry, volume 1360 of Lecture Notes in Artificial Intel-ligence (Subseries of LNCS), pages 58–86. Springer-Verlag, BerlinHeidelberg, 1998.

[Syl53] James Joseph Sylvester. On a theory of the syzegetic relations of tworational integral functions, comprising an application to the theoryof Sturm’s functions, and that of the greatest algebraical commonmeasure. Philosophical Transactions of the Royal Society London,143:407–548, 1853.

[Tar48] Alfred Tarski. A decision method for elementary algebra and geom-etry. Technical report, RAND, Santa Monica, CA, 1948.

[Tar51] Alfred Tarski. A Decision Method for Elementary Algebra and Ge-ometry. University of California Press, Berkely, CA, 1951. (2ndedition, revised).

[Tar98] Alfred Tarski. A decision method for elementary algebra and geom-etry. In Bob F. Caviness and Jeremy R. Johnson, editors, Quan-tifier Elimination and Cylindrical Algebraic Decomposition, Textsand Monographs in Symbolic Computation, pages 24–84. Springer-Verlag, Wien, Austria and New York, NY, 1998. Reprint.

[VMV94] Janos Vida, Ralph R. Martin, and Tamas Varady. A survey of blend-ing methods that use parametric surfaces. Computer-Aided Design,26(5):341–365, May 1994. Survey.

[Wan93a] Dongming Wang. An elimination method based on Seidenberg’stheory and its applications. In F. Eyssette and A. Galligo, edi-tors, Computational Algebraic Geometry (MEGA ’92), pages 301–328. Birkhauser Verlag, 1993.

[Wan93b] Dongming Wang. An elimination method for polynomial systems.Journal of Symbolic Computation, 16(2):83–114, August 1993.

[Wan95a] Dongming Wang. Reasoning about geometric problems using anelimination method. In J. Pfalzgraf and D. Wang, editors, AutomatedPractical Reasoning, Texts and Monographs in Symbolic Computa-tion, pages 147–185. Springer-Verlag, Wien, New York, 1995.

Page 139: public pdf

BIBLIOGRAPHY 139

[Wan95b] Dongming Wang. Reasoning about geometric problems using anelimination method. In J. Pfalzgraf, editor, Automatic PracticalReasoning, pages 147–185. Springer-Verlag, Wien, 1995.

[Wei88] Volker Weispfenning. The complexity of linear problems in fields.Journal of Symbolic Computation, 5(1–2):3–27, February–April1988.

[Wei90] Volker Weispfenning. The complexity of almost linear diophantineproblems. Journal of Symbolic Computation, 10(5):395–403, Novem-ber 1990.

[Wei92] Volker Weispfenning. Comprehensive Grobner bases. Journal ofSymbolic Computation, 14:1–29, July 1992.

[Wei93] Volker Weispfenning. A new approach to quantifier elimination forreal algebra. Technical Report MIP-9305, FMI, Universitat Passau,D-94030 Passau, Germany, July 1993.

[Wei94] Volker Weispfenning. Quantifier elimination for real algebra—thecubic case. In Proceedings of the International Symposium on Sym-bolic and Algebraic Computation (ISSAC 94), pages 258–263, Ox-ford, England, July 1994. ACM Press, New York, 1994.

[Wei97a] Volker Weispfenning. Complexity and uniformity of elimination inpresburger arithmetic. In Wolfgang W. Kuchlin, editor, Proceed-ings of the 1997 International Symposium on Symbolic and AlgebraicComputation (ISSAC 97), pages 48–53, Maui, HI, July 1997. ACM,ACM Press, New York, 1997.

[Wei97b] Volker Weispfenning. Quantifier elimination for real algebra—thequadratic case and beyond. Applicable Algebra in Engineering Com-munication and Computing, 8(2):85–101, February 1997.

[Wei97c] Volker Weispfenning. Simulation and optimization by quantifierelimination. Journal of Symbolic Computation, 24(2):189–208, Au-gust 1997. Special issue on applications of quantifier elimination.

[Wei98] Volker Weispfenning. A new approach to quantifier elimination forreal algebra. In B.F. Caviness and J.R. Johnson, editors, Quan-tifier Elimination and Cylindrical Algebraic Decomposition, Textsand Monographs in Symbolic Computation, pages 376–392. Springer,Wien, New York, 1998.

[Wei99] Volker Weispfenning. Mixed real-integer linear quantifier elimina-tion. In Sam Dooley, editor, Proceedings of the 1999 InternationalSymposium on Symbolic and Algebraic Computation (ISSAC 99),pages 129–136, Vancouver, BC, July 1999. ACM, ACM Press, NewYork, 1999.

[Wol96] Steven Wolfram. The Mathematica Book. Wolfram Media and Cam-bridge University Press, 3rd edition, 1996.

Page 140: public pdf

140 BIBLIOGRAPHY

[Wu84] Wen-Tsun Wu. Basic principles of mechanical theorem proving inelementary geometries. Journal of Systems Sciences and Mathemat-ical Sciences, 4:207–235, 1984.

[Wu86a] Wen-Tsun Wu. Basic principles of mechanical theorem proving inelementary geometry. Journal of Automated Reasoning, 2:219–252,1986.

[Wu86b] Wen-Tsun Wu. A mechanization method of geometry and its appli-cations. Part 1: Distances, areas and volumes. Journal of SystemScience and Mathematical Science, 6:204–216, 1986.

[Wu87] Wen-Tsun Wu. A mechanization method of geometry and itsapplications. Part 3: Mechanical proving of polynomial inequali-ties and equations-solving. Mathematics-Mechanization ResearchPreprints 2, Institute of Systems Science, Academia Sinicia, Beijing,China, November 1987.

[Wu92] Wen-Tsun Wu. On problems involving inequalities. Mathematics-Mechanization Research Preprints 7, Institute of Systems Science,Academia Sinicia, Beijing, China, March 1992.