1\input texinfo
2@c ----------------------------------------------------------------------
3@c $Id: redlog.texi,v 1.25 2006/11/25 11:39:18 sturm Exp $
4@c ----------------------------------------------------------------------
5@c Copyright (c) 1995-2004 Andreas Dolzmann and Thomas Sturm
6@c ----------------------------------------------------------------------
7@c $Log: redlog.texi,v $
8@c Revision 1.25  2006/11/25 11:39:18  sturm
9@c makeinfo can produce html meanwhile. It produces better results than
10@c texi2html. There are some odd constructions with @ifhtml/@ifnothtml at
11@c the beginning of redlog.texi. For now this allows to automatically obtain
12@c something nice for the Web page.
13@c
14@c Revision 1.24  2006/11/25 10:59:59  sturm
15@c Bumped Edition 3.0->3.1, Version 3.0->3.6, Copyright 1995-2004->1995->2006.
16@c Fixed a typo (g was missing in "Seidenberg").
17@c
18@c Revision 1.23  2004/11/20 16:00:09  seidl
19@c Documented procedures rlcadporder, rlcadguessauto and switches
20@c rlcadte, rlcadpbfvs.
21@c
22@c Revision 1.22  2004/08/30 10:39:33  lasaruk
23@c Minor changes
24@c
25@c Revision 1.21  2004/08/29 22:36:44  lasaruk
26@c Some switches documented
27@c
28@c Revision 1.20  2004/08/29 22:25:07  lasaruk
29@c More PASF documentation done.
30@c
31@c Revision 1.19  2004/05/07 09:26:52  seidl
32@c Added Quickstart. Added Bounded Quantifiers.  Corrected and added stuff
33@c for PASF. TODO: look at examples in PASD-specific Simplification.
34@c
35@c Revision 1.18  2004/05/04 17:12:51  sturm
36@c Quick switch to 3.0 as good as possible.
37@c
38@c Revision 1.17  2003/10/12 12:35:31  sturm
39@c Some corrections in the doc of pasf.
40@c Some doc on ibalp.
41@c
42@c Revision 1.16  2003/03/19 13:33:47  lasaruk
43@c First version of PASF-documentation added.
44@c
45@c Revision 1.15  2003/03/10 18:50:27  seidl
46@c Cared for PASF context and added TODO Lasaruk at several places.
47@c Removed READ THIS FIRST hack. Now the following simple commands should
48@c generate the desired info, dvi and html output:
49@c   makeinfo redlog.texi
50@c   tex redlog.texi
51@c   texi2html -split_chapter -menu -expandinfo redlog.texi
52@c For the online manual, index.html can link now to redlog.html instead
53@c of redlog_toc.html. Other desired output forms have still to be looked
54@c after.
55@c
56@c Revision 1.14  2002/08/29 08:12:04  dolzmann
57@c Added description of local quantifier elimination.
58@c
59@c Revision 1.13  2002/01/18 12:39:26  sturm
60@c Addded documentation for CAD.
61@c
62@c Revision 1.12  1999/04/13 22:17:30  sturm
63@c Added remark on updates on the WWW page.
64@c
65@c Revision 1.11  1999/04/13 12:27:14  sturm
66@c Removed a blank line within @itemize.
67@c
68@c Revision 1.10  1999/04/11 12:50:32  sturm
69@c Removed reference to program documentation for now.
70@c
71@c Revision 1.9  1999/04/11 12:23:58  sturm
72@c Overworked once more.
73@c Better index.
74@c Ispelled again.
75@c
76@c Revision 1.8  1999/04/07 17:05:39  sturm
77@c Overworked chapter "Quantifier Elimination and Variants".
78@c Ispelled.
79@c
80@c Revision 1.7  1999/04/05 12:49:12  sturm
81@c Finished overworking chapter "Simplification".
82@c Overworked chapter "Normal Forms".
83@c Completely dropped chapter "Miscellaneous".
84@c
85@c Revision 1.6  1999/04/01 11:31:06  sturm
86@c Overworked chapter "Simplification" and changed indeces.
87@c
88@c Revision 1.5  1999/03/22 16:48:07  sturm
89@c Overworked chapter "Format and Handling of Formulas". There is only "Other
90@c Stuff" left in chapter "Miscellaneous" now.
91@c
92@c Revision 1.4  1999/03/22 14:33:20  sturm
93@c Updated references.
94@c Overworked Introduction. New section "Loading and Context Selection".
95@c
96@c Revision 1.3  1998/04/09 11:14:38  sturm
97@c Added documentation for switch rlqeqsc.
98@c
99@c Revision 1.2  1997/10/02 09:36:57  sturm
100@c Updated reference to simplification paper.
101@c
102@c Revision 1.1  1997/08/18 17:22:50  sturm
103@c Renamed "rl.texi" to this file "redlog.texi."
104@c Changes due to renaming "rl.red" to "redlog.red."
105@c
106@c ----------------------------------------------------------------------
107@c Revision 1.20  1997/08/14 10:10:54  sturm
108@c Renamed rldecdeg to rldecdeg1.
109@c Added service rldecdeg.
110@c
111@c Revision 1.19  1996/10/23 12:03:05  sturm
112@c Added "exceptionlist" paramter to rlgqe and rlgqea. Several quantifier
113@c blocks are treated correctly now.
114@c
115@c Revision 1.18  1996/10/22 11:17:05  dolzmann
116@c Adapted the documentation of the procedures rlstruct, rlifstruct to
117@c the new interface.
118@c
119@c Revision 1.17  1996/10/20 15:57:46  sturm
120@c Added documentation for the switches rlnzden, rlposden, and rladdcond.
121@c Added documentation for the functions rlvarl, rlfvarl, and rlbvarl.
122@c
123@c Revision 1.16  1996/10/09 14:46:29  sturm
124@c Corrected @settitle.
125@c
126@c Revision 1.15  1996/10/09 11:41:04  sturm
127@c Some more minor changes.
128@c
129@c Revision 1.14  1996/10/08 17:41:58  sturm
130@c Overworked the whole thing more than once.
131@c
132@c Revision 1.13  1996/10/07 21:58:39  dolzmann
133@c Added data structure substitution_list.
134@c Added documentation for rlterml, rltermml, rlifacml, rltnf, rltnft,
135@c rlstruct, and rlifstruct.
136@c
137@c Revision 1.12  1996/10/07 18:39:08  reiske
138@c Revised and corrected documentation.
139@c Added documentation for rlqeipo, rlqews, and rlgentheo.
140@c Updated documentation for tableau and Groebner simplifier.
141@c Added documentation for data structure "cdl" and "elimination_answer".
142@c
143@c Revision 1.11  1996/09/26 13:05:17  dolzmann
144@c Minor changes in description of rltab.
145@c
146@c Revision 1.10  1996/09/26 12:14:27  sturm
147@c Corrected wrong citation label.
148@c
149@c Revision 1.9  1996/08/01 12:05:18  reiske
150@c Added documentation for rlifacl and rlapnf.
151@c
152@c Revision 1.8  1996/07/14 10:04:54  dolzmann
153@c Updated documentation of the Groebner simplifier.
154@c
155@c Revision 1.7  1996/06/13 10:03:45  sturm
156@c Added documentation for data structure "theory" and for procedures
157@c "sub" and "rlgqe".
158@c Moved "rlopt" into the Chapter on QE.
159@c
160@c Revision 1.6  1996/03/12 12:55:55  sturm
161@c Changed title to "Redlog User Manual."
162@c Many changes in introductory sections: Added functionality overview,
163@c "Getting Started", modified the "Bug Report" section, introduced the
164@c notion of a "context."
165@c Corrected example in the description of rlpnf.
166@c Many changes in QE documentation chapter.
167@c Added documentation for data structure "multiplicity list", switch
168@c rlqeheu, and functions rlmatrix, rlatl, and rlatml.
169@c Added a "Data Structure Index."
170@c Added new (bibliographic) reference.
171@c
172@c Revision 1.5  1996/03/04 14:50:26  dolzmann
173@c Added description of switches rlgserf, rlbnfsac.
174@c Removed description of switch rlbnfsb.
175@c
176@c Revision 1.4  1996/02/18 15:56:46  sturm
177@c Adapted the documentation of rlsiexpla to new default setting T.
178@c
179@c Revision 1.3  1996/02/18 15:16:48  sturm
180@c Added references.
181@c Added introductions to chapters on QE and optimization.
182@c Added concept index.
183@c Added description of input facilities.
184@c Modified description of switch rlqedfs.
185@c Added description of switches rlbnfsb, rlbnfsm, rlsifac, rlsimpl,
186@c rlsipw, rlsipo.
187@c
188@c Revision 1.2  1995/08/30  07:29:18  sturm
189@c Many changes. Version passed to R.O.S.E. with the rl demo.
190@c
191@c Revision 1.1  1995/07/17  14:33:33  sturm
192@c Initial check-in.
193@c
194@c ----------------------------------------------------------------------
195@setfilename redlog.info
196
197@ifnothtml
198@settitle @sc{redlog} User Manual
199@end ifnothtml
200@c @setchapternewpage off
201@smallbook
202@defcodeindex rf
203@defcodeindex rv
204@defcodeindex rt
205
206@ifnothtml
207@ifinfo
208This is the documentation of @sc{redlog}, a @sc{reduce} logic package.
209Copyright @copyright{} 1995-2006 by A. Dolzmann, A. Seidl, and T. Sturm.
210@end ifinfo
211@end ifnothtml
212
213@titlepage
214@title{Redlog User Manual}
215@subtitle A @sc{reduce} Logic Package
216@subtitle Edition 3.1, for @sc{redlog} Version 3.06 (@sc{reduce} 3.8)
217@subtitle 24 November 2006
218@author by A. Dolzmann, A. Seidl, and T. Sturm
219@page
220@vskip 0pt plus 1filll
221Copyright @copyright{} 1995-2006 by A. Dolzmann, A. Seidl, and
222T. Sturm.
223@end titlepage
224
225@ifnothtml
226@ifnottex
227@node Top
228@top REDLOG
229@heading REDLOG
230@sc{redlog} is a @sc{reduce} package containing algorithms on
231first-order formulas. The current version is 3.06.
232@end ifnottex
233@end ifnothtml
234
235@heading Quick Start
236In case you hate long manuals and want to see something within a
237minute type @t{reduce} in the command line. @sc{reduce} should start up.
238Type the four commands @t{load redlog; rlset ofsf; phi :=
239ex(x,a*x^2+b*x+1=0); rlqe phi;} and hit return. You will get a
240condition on the parameters @t{a} and @t{b} such that the quadratic
241polynomial @t{a*x^2+b*x+1} has a real root.
242
243@ifnothtml
244
245@heading Acknowledgments
246We acknowledge with pleasure the superb support by Herbert Melenk and
247Winfried Neun of the Konrad-Zuse-Zentrum fuer Informationstechnik
248Berlin, Germany, during this project. Furthermore, we wish to mention
249numerous valuable mathematical ideas contributed by Volker Weispfenning,
250University of Passau, Germany.
251
252@heading Redlog Home Page
253@cindex @sc{www}
254@cindex home page
255There is a @sc{redlog} home page maintained at
256
257@center @t{http://www.fmi.uni-passau.de/~redlog/}.
258
259It contains information on @sc{redlog}, online versions of publications,
260and a collection of examples that can be computed with @sc{redlog}. This
261site will also be used for providing update
262@cindex update
263versions of @sc{redlog}.
264
265@heading Support
266@cindex support
267For mathematical and technical support, contact
268
269@center @t{redlog@@fmi.uni-passau.de}.
270
271@heading Bug Reports and Comments
272@cindex bug report
273Send bug reports and comments to
274
275@center @t{redlog@@fmi.uni-passau.de}.
276
277Any hint or suggestion is welcome. In particular, we are interested in
278practical problems to the solution of which @sc{redlog} has contributed.
279@end ifnothtml
280
281@ifhtml
282@node Top
283@top Contents
284@end ifhtml
285@menu
286* Introduction::                         What is @sc{redlog}?
287* Loading and Context Selection::
288* Format and Handling of Formulas::      How to work with formulas.
289* Simplification::                       Standard, tableau, and Groebner.
290* Normal Forms::                         CNF, DNF, NNF, and PNF.
291* Quantifier Elimination and Variants::  Elimination set methods.
292* References::                           Further information on @sc{redlog}.
293* Functions::
294* Switches and Variables::
295* Data Structures::
296* Index::
297@end menu
298
299@node Introduction
300@chapter Introduction
301@sc{redlog} stands for @emph{@sc{reduce} logic system}. It provides an
302extension of the computer algebra system @sc{reduce} to a @emph{computer
303logic system} implementing symbolic algorithms on first-order formulas
304wrt.@: temporarily fixed first-order languages and theories.
305
306This document serves as a user guide describing the usage of @sc{redlog}
307from the algebraic mode of @sc{reduce}. For a detailed
308description of the system design see
309@ifinfo
310@ref{References,[DS97a]}.
311@end ifinfo
312@iftex
313[DS97a].
314@end iftex
315@c There is an additional program documentation included in the @sc{reduce}
316@c distribution.
317
318An overview on some of the application areas of @sc{redlog} is given in
319@ifinfo
320@ref{References,[DSW98]}.
321@end ifinfo
322@iftex
323[DSW98].
324@end iftex
325See also @ref{References} for articles on @sc{redlog}
326applications.
327
328@menu
329* Contexts::
330* Overview::
331* Conventions::
332@end menu
333
334@node Contexts
335@section Contexts
336@cindex real numbers
337@cindex complex numbers
338@cindex p-adic number
339@cindex real closed field
340@cindex ordered field
341@cindex real closed field
342@cindex discretely valued field
343@cindex algebraically closed field
344@cindex contexts available
345@cindex available contexts
346@cindex @sc{ofsf}
347@cindex @sc{acfsf}
348@cindex @sc{dvfsf}
349@sc{redlog} is designed for working with several @dfn{languages} and
350@dfn{theories} in the sense of first-order logic. Both a language and a
351theory make up a context. In addition, a context determines the internal
352representation of terms. There are the following contexts available:
353
354@table @sc
355@item ofsf
356@sc{of} stands for @emph{ordered fields}, which is a little imprecise.
357The quantifier elimination actually requires the more restricted class
358of @emph{real closed fields}, while most of the tool-like algorithms are
359generally correct for ordered fields. One usually has in mind real
360numbers with ordering when using @sc{ofsf}.
361
362@item dvfsf
363@emph{Discretely valued fields}. This is for computing with formulas
364over classes of p-adic valued extension fields of the rationals, usually
365the fields of p-adic numbers for some prime p.
366
367@item acfsf
368@emph{Algebraically closed fields} such as the complex numbers.
369
370@item pasf
371@emph{Presburger Arithmetic}, i.e., the linear theory of integers
372with congruences modulo
373@tex
374$m$
375@end tex
376@ifinfo
377m
378@end ifinfo
379for
380@tex
381$m\geq1$
382@end tex
383@ifinfo
384m>=2
385@end ifinfo
386.
387
388@item ibalp
389@emph{Initial Boolean algebras}, basically quantified propositional logic.
390
391@item dcfsf
392@emph{Differentially closed fields} according to Robinson. There is no
393natural example. The quantifier elimination is an optimized version of
394the procedure by Seidenberg (1956).
395@end table
396
397The trailing "@sc{-sf}" stands for @emph{standard form}, which is the
398representation chosen for the terms within the implementation.
399Accordingly, "@sc{-lp}" stands for @emph{Lisp prefix}.
400@xref{Context Selection}, for details on selecting @sc{redlog}
401contexts.
402
403@node Overview
404@section Overview
405@sc{redlog} origins from the implementation of quantifier elimination
406procedures. Successfully applying such methods to both academic and
407real-world problems, the authors have developed over the time a large
408set of formula-manipulating tools, many of which are meanwhile
409interesting in their own right:
410
411@itemize @bullet
412@item Numerous tools for comfortably inputing, decomposing, and
413analyzing formulas. This includes, for instance, the construction of
414systematic formulas via @code{for}-loops, and the extension of built-in
415commands such as @code{sub}
416@rfindex sub
417or @code{part}.
418@rfindex part
419@xref{Format and Handling of Formulas}.
420
421@item Several techniques for the @emph{simplification} of
422formulas. The simplifiers do not only operate on the boolean structure
423of the formulas but also discover algebraic relationships. For this
424purpose, we make use of advanced algebraic concepts such as Groebner
425basis computations. For the notion of simplification and a detailed
426description of the implemented techniques for the contexts @sc{ofsf}
427@cindex @sc{ofsf}
428and @sc{acfsf}
429@cindex @sc{acfsf}
430see
431@ifinfo
432@ref{References,[DS97]}.
433@end ifinfo
434@iftex
435[DS97].
436@end iftex
437For the @sc{dvfsf}
438@cindex @sc{dvfsf}
439context see
440@ifinfo
441@ref{References,[DS99]}.
442@end ifinfo
443@iftex
444[DS99].
445@end iftex
446@xref{Simplification}.
447
448@item Various @emph{normal form computations}. The
449@emph{@sc{cnf}/@sc{dnf}} computation includes both boolean and
450algebraic simplification strategies
451@ifinfo
452@ref{References,[DS97]}.
453@end ifinfo
454@iftex
455[DS97].
456@end iftex
457The @emph{prenex normal form} computation minimizes the number of
458quantifier changes. @xref{Normal Forms}.
459
460@item
461@cindex comprehensive Groebner Basis
462@cindex @sc{cgb}
463@emph{Quantifier elimination} computes quantifier-free
464equivalents for given first-order formulas.
465
466For @sc{ofsf} and
467@cindex @sc{ofsf}
468@sc{dvfsf}
469@cindex @sc{dvfsf}
470we use a technique based on elimination set ideas
471@ifinfo
472@ref{References,[Wei88]}.
473@end ifinfo
474@iftex
475[Wei88].
476@end iftex
477The @sc{ofsf}
478@cindex @sc{ofsf}
479implementation is restricted to at most quadratic occurrences of the
480quantified variables, but includes numerous heuristic strategies for
481coping with higher degrees. See
482@ifinfo
483@ref{References,[LW93]}, @ref{References,[Wei97]},
484@end ifinfo
485@iftex
486[LW93], [Wei97]
487@end iftex
488for details on the method.
489The @sc{dvfsf}
490@cindex @sc{dvfsf}
491implementation is restricted to formulas that are linear in the
492quantified variables. The method is described in detail in
493@ifinfo
494@ref{References,[Stu00]}.
495@end ifinfo
496@iftex
497[Stu00].
498@end iftex
499
500The @sc{acfsf}
501@cindex @sc{acfsf}
502quantifier elimination is based on @emph{comprehensive Groebner basis}
503computation. There are no degree restrictions for this context
504@ifinfo
505@ref{References,[Wei92]}.
506@end ifinfo
507@iftex
508[Wei92].
509@end iftex
510@xref{Quantifier Elimination}.
511
512@item
513@cindex geometric problem
514@cindex network analysis
515The contexts @sc{ofsf}
516@cindex @sc{ofsf}
517and @sc{acfsf}
518@cindex @sc{acfsf}
519allow a variant of quantifier
520elimination called @dfn{generic quantifier elimination}
521@ifinfo
522@ref{References,[DSW98]}.
523@end ifinfo
524@iftex
525[DSW98].
526@end iftex
527There are certain non-degeneracy assumptions made on the parameters,
528which considerably speeds up the elimination.
529
530For geometric theorem proving it has turned out that these assumptions
531correspond to reasonable geometric non-degeneracy conditions
532@ifinfo
533@ref{References,[DSW98]}.
534@end ifinfo
535@iftex
536[DSW98].
537@end iftex
538Generic quantifier elimination has turned out useful also for physical
539applications such as network analysis
540@ifinfo
541@ref{References,[Stu97]}.
542@end ifinfo
543@iftex
544[Stu97].
545@end iftex
546There is no generic quantifier elimination available for @sc{dvfsf}.
547@cindex @sc{dvfsf}
548@xref{Generic Quantifier Elimination}.
549
550@item The contexts @sc{ofsf}
551@cindex @sc{ofsf}
552and @sc{dvfsf}
553@cindex @sc{dvfsf}
554provide variants of (generic) quantifier elimination that additionally
555compute @dfn{answers}
556@cindex answer
557such as satisfying sample points for existentially
558quantified formulas. This has been referred to as the "extended
559quantifier elimination problem"
560@ifinfo
561@ref{References,[Wei97a]}.
562@end ifinfo
563@iftex
564[Wei97a].
565@end iftex
566@xref{Quantifier Elimination}.
567
568@item @sc{ofsf}
569@cindex @sc{ofsf}
570includes linear @emph{optimization} techniques based
571on quantifier elimination
572@ifinfo
573@ref{References,[Wei94a]}.
574@end ifinfo
575@iftex
576[Wei94a].
577@end iftex
578@xref{Linear Optimization}.
579@end itemize
580
581@node Conventions
582@section Conventions
583To avoid ambiguities with other packages, all @sc{redlog} functions and
584switches are prefixed by "@code{rl}". The remaining part of the name is
585explained by the first sentence of the documentation of the single
586functions and switches.
587
588Some of the numerous switches of @sc{redlog} have been introduced only
589for finding the right fine tuning of the functions, or for internal
590experiments. They should not be changed anymore, except for in very
591special situations. For an easier orientation the switches are divided
592into three categories for documentation:
593
594@table @dfn
595@item Switch
596@cindex switch
597This is an ordinary switch, which usually selects strategies appropriate
598for a particular input, or determines the required trade-off between
599computation-speed and quality of the result.
600@item Advanced Switch
601@cindex advanced Switch
602They are used like ordinary switches. You need, however, a good
603knowledge about the underlying algorithms for making use of it.
604@item Fix Switch
605@cindex fix Switch
606You do not want to change it.
607@end table
608
609@node Loading and Context Selection
610@chapter Loading and Context Selection
611@cindex starting @sc{redlog}
612
613@menu
614* Loading Redlog::
615* Context Selection::
616@end menu
617
618@node Loading Redlog
619@section Loading Redlog
620@cindex loading @sc{redlog}
621At the beginning of each session @sc{redlog} has to be loaded
622explicitly. This is done by inputing the command @code{load_package
623redlog;}
624@rfindex load_package
625from within a @sc{reduce} session.
626
627@node Context Selection
628@section Context Selection
629@cindex theory
630@cindex language
631@cindex relations
632@cindex predicates
633@cindex functions
634Fixing a context reflects the mathematical fact that first-order
635formulas are defined over fixed @dfn{languages} specifying, e.g., valid
636@dfn{function symbols} and @dfn{relation symbols} (@dfn{predicates}).
637After selecting a language, fixing a @dfn{theory} such as "the theory of
638ordered fields", allows to assign a semantics to the formulas. Both
639language and theory make up a @sc{redlog} context. In addition, a
640context determines the internal representation of terms.
641
642As first-order formulas are not defined unless the language is known,
643and meaningless unless the theory is known, it is impossible to enter a
644first-order formula into @sc{redlog} without specifying a context:
645
646@smallexample
647REDUCE 3.6, 15-Jul-95, patched to 30 Aug 98 ...
648
6491: load_package redlog;
650
6512: f := a=0 and b=0;
652
653***** select a context
654@end smallexample
655
656@xref{Contexts}, for a summary of the available contexts @sc{ofsf},
657@cindex @sc{ofsf}
658@sc{dvfsf},
659@cindex @sc{dvfsf}
660@sc{acfsf},
661@cindex @sc{acfsf}
662@sc{pasf},
663@cindex @sc{pasf}
664@sc{ibalp}
665@cindex @sc{ibalp}
666and @sc{dcfsf}.
667@cindex @sc{dcfsf}
668A context can be selected by the @code{rlset} command:
669
670@deffn {Function} rlset [@var{context} [@var{arguments}...]]
671@deffnx {Function} rlset argument-list
672@cindex language selection
673@cindex context selection
674@rtindex dvf_class_specification
675Set current context. Valid choices for @var{context} are @sc{ofsf}
676@cindex @sc{ofsf}
677(ordered fields standard form), @sc{dvfsf}
678@cindex @sc{dvfsf}
679(discretely valued fields standard form), @sc{acfsf}
680@cindex @sc{acfsf}
681(algebraically closed fields standard form), @sc{pasf}
682@cindex @sc{pasf}
683(Presburger arithmetic standard form), @sc{ibalp}
684@cindex @sc{ibalp}
685(initial Boolean algebra Lisp prefix), and @sc{dcfsf}.
686@cindex @sc{dcfsf}
687With @sc{ofsf}, @sc{acfsf},
688@sc{pasf}, @sc{ibalp}, and  @sc{dcfsf} there are no further arguments. With
689@sc{dvfsf} an optional @var{dvf_class_specification} can be passed,
690which defaults to @code{0}. @code{rlset} returns the old setting as a
691list that can be saved to be passed to @code{rlset} later. When called
692with no arguments (or the empty list), @code{rlset} returns the current
693setting.
694@end deffn
695
696@deftp {Data Structure} {dvf_class_specification}
697@cindex p-adic number
698@cindex p-adic valuation
699@cindex valuation (p-adic)
700@cindex valued field
701@cindex discretely valued field
702Zero, or a possibly negative prime
703@tex
704$q$.
705@end tex
706@ifinfo
707q.
708@end ifinfo
709
710For
711@tex
712$q=0$
713@end tex
714@ifinfo
715q=0
716@end ifinfo
717all computations are uniformly correct for
718all
719@tex
720$p$-adic
721@end tex
722@ifinfo
723p-adic
724@end ifinfo
725valuations. Both input and output then possibly involve a symbolic
726constant
727@tex
728"$p$",
729@end tex
730@ifinfo
731"p",
732@end ifinfo
733which is being reserved.
734
735For positive
736@tex
737$q$,
738@end tex
739@ifinfo
740q,
741@end ifinfo
742all computations take place wrt.@: the corresponding
743@tex
744$q$-adic
745@end tex
746@ifinfo
747q-adic
748@end ifinfo
749valuation.
750
751For negative
752@tex
753$q$,
754@end tex
755@ifinfo
756q,
757@end ifinfo
758the
759@tex
760"$-$"
761@end tex
762@ifinfo
763"-"
764@end ifinfo
765can be read as ``up
766to'', i.e., all computations are performed in such a way that they are
767correct for all
768@tex
769$p$-adic
770@end tex
771@ifinfo
772p-adic
773@end ifinfo
774valuations with
775@tex
776$p \leq |q|$.
777@end tex
778@ifinfo
779p <= q.
780@end ifinfo
781In this case, the knowledge of an upper bound for
782@tex
783$p$
784@end tex
785@ifinfo
786p
787@end ifinfo
788supports the
789quantifier elimination @code{rlqe}/@code{rlqea}
790@rfindex rlqe
791@rfindex rlqea
792@ifinfo
793@ref{References,[Stu00]}.
794@end ifinfo
795@iftex
796[Stu00].
797@end iftex
798@xref{Quantifier Elimination}.
799@end deftp
800
801The user will probably have a "favorite" context reflecting their
802particular field of interest.
803To save the explicit declaration of the
804context with each session, @sc{redlog} provides a global variable
805@code{rldeflang}, which contains a default context. This variable can be
806set already @emph{before} loading @file{redlog}. This is typically done
807within the @file{.reducerc} profile:
808@cindex @file{.reducerc} profile
809
810@example
811lisp (rldeflang!* := '(ofsf));
812@end example
813
814Notice that the Lisp list representation has to be used here.
815
816@defvr Fluid rldeflang!*
817@cindex language default
818@cindex default language
819@cindex context default
820@cindex default context
821Default language. This can be bound to a default context before loading
822@file{redlog}. More precisely, @code{rldeflang!*} contains the arguments
823of @code{rlset} as a Lisp list. If @code{rldeflang!*} is non-nil,
824@code{rlset}
825@rfindex rlset
826is automatically executed on @code{rldeflang!*} when
827loading @file{redlog}.
828@end defvr
829
830In addition, @sc{redlog} evaluates an environment variable
831@code{RLDEFLANG}. This allows to fix a default context within the shell
832already before starting @sc{reduce}. The syntax for setting environment
833variables depends on the shell. For instance, in the @sc{gnu} Bash or in
834the csh shell one would say @code{export RLDEFLANG=ofsf} or
835@code{setenv RLDEFLANG ofsf}, respectively.
836
837@defvr {Environment Variable} RLDEFLANG
838@cindex language default
839@cindex default language
840@cindex context default
841@cindex default context
842Default language. This may be bound to a context in the sense of the
843first argument of @code{rlset}.
844@rfindex rlset
845With @code{RLDEFLANG} set, any
846@code{rldeflang!*}
847@rvindex rldeflang!*
848binding is overloaded.
849@end defvr
850
851@node Format and Handling of Formulas
852@chapter Format and Handling of Formulas
853After loading @sc{redlog} and selecting a context (@pxref{Loading and
854Context Selection}), there are @emph{first-order formulas} available as
855an additional type of symbolic expressions. That is, formulas are now
856subject to symbolic manipulation in the same way as, say, polynomials or
857matrices in conventional systems. There is nothing changed in the
858behavior of the builtin facilities and of other packages.
859
860@menu
861* First-order Operators::
862* Closures::
863* OFSF Operators::
864* DVFSF Operators::
865* ACFSF Operators::
866* PASF Operators::
867* IBALP Operators::
868* DCFSF Operators::
869* Extended Built-in Commands::
870* Global Switches::
871* Basic Functions on Formulas::
872@end menu
873
874@node First-order Operators
875@section First-order Operators
876
877Though the operators @code{and}, @code{or}, and @code{not} are already
878sufficient for representing boolean formulas, @sc{redlog} provides a
879variety of other boolean operators for the convenient mnemonic input of
880boolean formulas.
881
882@deffn {Unary Operator} not
883@deffnx {n-ary Infix Operator} and
884@deffnx {n-ary Infix Operator} or
885@deffnx {Binary Infix Operator} impl
886@deffnx {Binary Infix Operator} repl
887@deffnx {Binary Infix Operator} equiv
888@cindex negation
889@cindex conjunction
890@cindex disjunction
891@cindex implication
892@cindex replication
893@cindex equivalence
894@cindex expression input
895@cindex input facilities
896@cindex boolean operator
897The infix operator precedence is from
898strongest to weakest: @code{and}, @code{or}, @code{impl}, @code{repl},
899@code{equiv}.
900@end deffn
901
902@xref{Extended Built-in Commands}, for the description of extended
903@code{for}-loop
904@rfindex for
905actions that allow to comfortably input large systematic
906conjunctions and disjunctions.
907
908@sc{reduce} expects the user to know about the precedence of @code{and}
909over @code{or}. In analogy to @code{+} and @code{*}, there are thus no
910parentheses output around conjunctions within disjunctions. The
911following switch causes such subformulas to be bracketed anyway.
912@xref{Conventions}, for the notion of a "fix switch".
913
914@defvr {Fix Switch} rlbrop
915@cindex bracket
916@cindex expression output
917Bracket all operators. By default this switch is on, which causes some
918private printing routines to be called for formulas: All subformulas are
919bracketed completely making the output more readable.
920@end defvr
921
922Besides the boolean operators introduced above, first-order logic
923includes the well-known @dfn{existential quantifiers} and @dfn{universal
924quantifiers}
925@tex
926"$\exists$" and "$\forall$".
927@end tex
928@ifinfo
929"@emph{exists}" and "@emph{forall}".
930@end ifinfo
931
932@deffn {Binary Operator} ex
933@deffnx {Binary Operator} all
934@cindex quantifier
935@cindex expression input
936@cindex input facilities
937These are the @dfn{quantifiers}. The first argument is the quantified
938variable, the second one is the matrix formula. Optionally, one can
939input a list of variables as first argument. This list is expanded into
940several nested quantifiers.
941@end deffn
942
943@xref{Closures}, for automatically quantifying all variables except for
944an exclusion list.
945
946@deffn {Binary Operator} bex
947@deffnx {Binary Operator} ball
948@cindex bounded quantifier
949These are the @dfn{bounded quantifiers}. The first argument is the
950quantified variable, the second one is the bound and the third one is
951the matrix formula. A bound is a quantifier-free formula, which
952contains only one variable and defines a finite set. Formulas with
953bounded quantifiers are only available in @sc{pasf}.
954@end deffn
955
956For convenience, we also have boolean constants
957@cindex boolean constant
958for the truth values.
959@cindex truth value
960
961@defvar true
962@defvarx false
963@cindex truth value
964@cindex expression input
965@cindex input facilities
966These algebraic mode variables are reserved. They serve as @dfn{truth
967values}.
968@end defvar
969
970@node Closures
971@section Closures
972@cindex closure
973
974@defun rlall formula [@var{exceptionlist}]
975@cindex universal closure
976@cindex closure
977@cindex quantifier
978@cindex expression input
979@cindex input facilities
980Universal closure. @var{exceptionlist} is a list of variables empty by
981default. Returns @var{formula} with all free variables universally
982quantified, except for those in @var{exceptionlist}.
983@end defun
984
985@defun rlex formula [@var{exceptionlist}]
986@cindex existential closure
987@cindex closure
988@cindex quantifier
989@cindex expression input
990@cindex input facilities
991Existential closure. @var{exceptionlist} is a list of variables empty by
992default. Returns @var{formula} with all free variables existentially
993quantified, except for those in @var{exceptionlist}.
994@end defun
995
996@node OFSF Operators
997@section OFSF Operators
998@cindex ordered field
999The @sc{ofsf}
1000@cindex @sc{ofsf}
1001context implements @emph{ordered fields} over the language of
1002@emph{ordered rings}. Proceeding this way is very common in model theory
1003since one wishes to avoid functions which are only partially defined,
1004such as division in the language of ordered fields. Note that the
1005@sc{ofsf} quantifier elimination procedures
1006@cindex quantifier elimination
1007(@pxref{Quantifier Elimination and Variants}) for non-linear formulas
1008actually operate over
1009@cindex real closed field
1010@emph{real closed fields}. See @ref{Contexts} and @ref{Context
1011Selection} for details on contexts.
1012
1013@deffn {Binary Infix operator} equal
1014@deffnx {Binary Infix operator} neq
1015@deffnx {Binary Infix operator} leq
1016@deffnx {Binary Infix operator} geq
1017@deffnx {Binary Infix operator} lessp
1018@deffnx {Binary Infix operator} greaterp
1019@cindex equation
1020@cindex inequality
1021@cindex ordering
1022@cindex expression input
1023@cindex input facilities
1024The above operators may also be written as @code{=}, @code{<>},
1025@code{<=}, @code{>=}, @code{<}, and @code{>}, respectively. For @sc{ofsf}
1026@cindex @sc{ofsf}
1027there is specified that all right hand sides must be zero. Non-zero
1028right hand sides in the input are hence subtracted immediately to the
1029corresponding left hand sides. There is a facility to input
1030@emph{chains}
1031@cindex chains of binary relations
1032of the above relations, which are also expanded immediately:
1033
1034@smallexample
1035a<>b<c>d=f
1036     @result{} a-b <> 0 and b-c < 0 and c-d > 0 and d-f = 0
1037@end smallexample
1038
1039Here, only adjacent terms are related to each other.
1040@end deffn
1041
1042Though we use the language of ordered rings, the input of integer
1043reciprocals is allowed and treated correctly interpreting them as
1044constants for rational numbers.
1045@cindex rational numbers
1046There are two switches that allow to
1047input arbitrary reciprocals, which are then resolved into proper
1048formulas in various reasonable ways. The user is welcome to experiment
1049with switches like the following, which are not marked as @emph{fix
1050switches}. @xref{Conventions}, for the classification of @sc{redlog}
1051switches.
1052
1053@defvr Switch rlnzden
1054@defvrx Switch rlposden
1055@cindex inverse
1056@cindex reciprocal
1057@cindex division
1058@cindex denominator
1059@cindex parametric denominator
1060Non-zero/positive denominators. Both switches are off by default. If
1061both @code{rlnzden} and @code{rlposden} are on, the latter is active.
1062Activating one of them, allows the input of reciprocal terms. With
1063@code{rlnzden} on, these terms are assumed to be non-zero, and resolved
1064by multiplication. When occurring with ordering relations the
1065reciprocals are resolved by multiplication with their square preserving
1066the sign.
1067
1068@smallexample
1069(a/b)+c=0 and (a/d)+c>0;
1070                                 2
1071     @result{} a + b*c = 0 and a*d + c*d  > 0
1072@end smallexample
1073
1074Turning @code{rlposden} on, guarantees the reciprocals to be strictly
1075positive which allows simple, i.e.@: non-square, multiplication also
1076with ordering relations.
1077
1078@smallexample
1079(a/b)+c=0 and (a/d)+c>0;
1080     @result{} a + b*c = 0 and a + c*d > 0
1081@end smallexample
1082@end defvr
1083
1084The non-zeroness or positivity assumptions made by using the above
1085switches can be stored in a variable, and then later be passed as a
1086@var{theory}
1087@rtindex theory
1088(@pxref{Standard Simplifier,theory}) to certain @sc{redlog} procedures.
1089Optionally, the system can be forced to add them to the formula at the
1090input stage:
1091
1092@defvr Switch rladdcond
1093@cindex inverse
1094@cindex reciprocal
1095@cindex division
1096Add condition. This is off by default. With @code{rladdcond} on,
1097non-zeroness and positivity assumptions made due to the switches
1098@code{rlnzden} and @code{rlposden}
1099@rvindex rlnzden
1100@rvindex rlposden
1101are added to the formula at the input
1102stage. With @code{rladdcond} and @code{rlposden} on we get for instance:
1103
1104@smallexample
1105(a/b)+c=0 and (a/d)+c>0;
1106     @result{} (b <> 0 and a + b*c = 0) and (d > 0 and a + c*d > 0)
1107@end smallexample
1108@end defvr
1109
1110@node DVFSF Operators
1111@section DVFSF Operators
1112@cindex discretely valued field
1113Discretely valued fields are implemented as a one-sorted language using
1114the operators @code{|}, @code{||}, @code{~}, and @code{/~}, which encode
1115@tex
1116$\leq$, $<$, $=$, and $\neq$
1117@end tex
1118@ifinfo
1119@code{<=}, @code{<}, @code{=}, and @code{<>}
1120@end ifinfo
1121in the value group, respectively. For details see
1122@ifinfo
1123@ref{References,[Wei88]}, @ref{References,[Stu00]}, or @ref{References,[DS99]}.
1124@end ifinfo
1125@iftex
1126[Wei88], [Stu00], or [DS99].
1127@end iftex
1128
1129
1130@deffn {Binary Infix operator} equal
1131@deffnx {Binary Infix operator} neq
1132@deffnx {Binary Infix operator} div
1133@deffnx {Binary Infix operator} sdiv
1134@deffnx {Binary Infix operator} assoc
1135@deffnx {Binary Infix operator} nassoc
1136@cindex equation
1137@cindex inequality
1138@cindex divisibility
1139@cindex strict divisibility
1140@cindex weak divisibility
1141@cindex expression input
1142@cindex input facilities
1143The above operators may also be written as @code{=}, @code{<>},
1144@code{|}, @code{||}, @code{~}, and @code{/~}, respectively. Integer
1145reciprocals in the input are resolved correctly. @sc{dvfsf}
1146@cindex @sc{dvfsf}
1147allows the input of @emph{chains}
1148@cindex chains of binary relations
1149in analogy to @sc{ofsf}.
1150@cindex @sc{ofsf}
1151@xref{OFSF Operators}, for details.
1152@end deffn
1153
1154With the @sc{dvfsf}
1155@cindex @sc{dvfsf}
1156operators there is no treatment of parametric denominators available.
1157@cindex denominator
1158@cindex parametric denominator
1159
1160@node ACFSF Operators
1161@section ACFSF Operators
1162@deffn {Binary Infix operator} equal
1163@deffnx {Binary Infix operator} neq
1164@cindex equation
1165@cindex inequality
1166@cindex expression input
1167@cindex input facilities
1168@cindex @sc{acfsf}
1169The above operators may also be written as @code{=}, @code{<>}. As for
1170@sc{ofsf},
1171@cindex @sc{ofsf}
1172it is specified that all right hand sides must be zero. In
1173analogy to @sc{ofsf}, @sc{acfsf} allows also the input of @emph{chains}
1174@cindex chains of binary relations
1175and an appropriate treatment of parametric denominators
1176@cindex denominator
1177@cindex parametric denominator
1178in the input.
1179@xref{OFSF Operators}, for details.
1180@end deffn
1181
1182Note that the switch @code{rlposden}
1183@rvindex rlposden
1184(@pxref{OFSF Operators}) makes no
1185sense for algebraically closed fields.
1186
1187@node PASF Operators
1188@section PASF Operators
1189
1190@deffn {Binary Infix operator} equal
1191@deffnx {Binary Infix operator} neq
1192@deffnx {Binary Infix operator} leq
1193@deffnx {Binary Infix operator} geq
1194@deffnx {Binary Infix operator} lessp
1195@deffnx {Binary Infix operator} greaterp
1196@cindex equation
1197@cindex inequality
1198@cindex ordering
1199@cindex congruence
1200@cindex expression input
1201@cindex input facilities
1202The above operators may also be written as @code{=}, @code{<>},
1203@code{<=}, @code{>=}, @code{<}, and @code{>}, respectively.
1204@end deffn
1205
1206@deffn {Ternary Prefix operator} cong
1207@deffnx {Ternary Prefix operator} ncong
1208The operators cong and ncong represent congruences with nonparametric
1209modulus given by the third argument. The example below
1210defines the set of even integers.
1211@smallexample
1212f := cong(x,0,2);
1213@group
1214  @result{} x ~2~ 0
1215@end group
1216@end smallexample
1217@end deffn
1218
1219As for
1220@sc{ofsf},
1221@cindex @sc{ofsf}
1222it is specified that all right hand sides are transformed
1223to be zero. In analogy to @sc{ofsf}, @sc{pasf} allows
1224also the input of @emph{chains}
1225@cindex chains of binary relations in the input.
1226@xref{OFSF Operators}, for details.
1227@end deffn
1228
1229@node IBALP Operators
1230@section IBALP Operators
1231@deffn {Unary operator} bnot
1232@deffnx {n-ary Infix operator} band
1233@deffnx {n-ary Infix operator} bor
1234@deffnx {Binary Infix operator} bimpl
1235@deffnx {Binary Infix operator} brepl
1236@deffnx {Binary Infix operator} bequiv
1237@cindex Boolean not
1238@cindex Boolean and
1239@cindex Boolean or
1240@cindex Boolean implication
1241@cindex Boolean replication
1242@cindex Boolean equivalence
1243The operator @code{bnot} may also be written as @code{~}. The operators
1244@code{band} and @code{bor} may also be written as @code{&} and @code{|},
1245resp. The operators @code{bimpl}, @code{brepl}, and @code{bequiv} may be
1246written as @code{->}, @code{<-}, and @code{<->}, resp.
1247@end deffn
1248
1249
1250@deffn {Binary Infix operator} equal
1251@cindex equation
1252The operator @code{equal} may also be written as @code{=}.
1253@end deffn
1254
1255@node DCFSF Operators
1256@section DCFSF Operators
1257@deffn {Binary Infix operator} d
1258@cindex derivation
1259The operator @code{d} denotes (higher) derivatives in the sense of
1260differential algebra. For instance, the differential equation
1261@ifinfo
1262
1263@example
1264x'^2 + x = 0
1265@end example
1266
1267@end ifinfo
1268@tex
1269$$x'^2+x=0$$
1270@end tex
1271is input as @code{x d 1 ** 2 + x = 0}. @code{d} binds stronger than all
1272other operators.
1273@end deffn
1274
1275@deffn {Binary Infix operator} equal
1276@deffnx {Binary Infix operator} neq
1277@cindex equation
1278@cindex inequality
1279The operator @code{equal} may also be written as @code{=}. The operator
1280@code{neq} may also be written as @code{<>}.
1281@end deffn
1282
1283@node Extended Built-in Commands
1284@section Extended Built-in Commands
1285
1286Systematic conjunctions and disjunctions can be constructed in the
1287algebraic mode in analogy to, e.g., @code{for ... sum ...}:
1288
1289@deffn {for loop action} mkand
1290@deffnx {for loop action} mkor
1291@findex for
1292@cindex conjunction
1293@cindex disjunction
1294@cindex for loop action
1295@cindex expression input
1296@cindex input facilities
1297Make and/or. Actions for the construction of large systematic
1298conjunctions/disjunctions via for loops.
1299
1300@smallexample
1301for i:=1:3 mkand
1302   for j:=1:3 mkor
1303      if j<>i then mkid(x,i)+mkid(x,j)=0;
1304           @result{} true and (false or false or x1 + x2 = 0
1305                        or x1 + x3 = 0)
1306               and (false or x1 + x2 = 0 or false
1307                    or x2 + x3 = 0)
1308               and (false or x1 + x3 = 0 or x2 + x3 = 0
1309                    or false)
1310@end smallexample
1311@end deffn
1312
1313Here the truth values
1314@cindex truth value
1315come into existence due to the internal
1316implementation of @code{for}-loops. They are always neutral in their
1317context, and can be easily removed via simplification (@pxref{Standard
1318Simplifier,function rlsimpl}, @pxref{Global Switches,switch rlsimpl}).
1319
1320The @sc{reduce} substitution command @code{sub}
1321@rfindex sub
1322can be applied to formulas using the usual syntax.
1323
1324@deftp {Data Structure} {substitution_list}
1325@var{substitution_list} is a list of equations each with a kernel left
1326hand side.
1327@end deftp
1328
1329@defun sub substitution_list formula
1330@cindex substitution
1331@rtindex substitution_list
1332Substitute. Returns the formula obtained from @var{formula}
1333by applying the substitutions given by @var{substitution_list}.
1334
1335@smallexample
1336sub(a=x,ex(x,x-a<0 and all(x,x-b>0 or ex(a,a-b<0))));
1337     @result{} ex x0 ( - x + x0 < 0 and all x0 (
1338             - b + x0 > 0 or ex a (a - b < 0)))
1339@end smallexample
1340
1341@code{sub} works in such a way that equivalent formulas remain
1342equivalent after substitution. In particular, quantifiers are treated
1343correctly.
1344@end defun
1345
1346@defun part formula n1 [n2 [n3...]]
1347Extract a part. The @code{part} of @var{formula} is implemented
1348analogously to that for built-in types: in particular the 0th part is
1349the operator.
1350@end defun
1351
1352@iftex
1353Compare @code{rlmatrix} (@pxref{Basic Functions on Formulas})
1354@end iftex
1355@ifinfo
1356@xref{Basic Functions on Formulas,rlmatrix},
1357@end ifinfo
1358@rfindex rlmatrix
1359for extracting the @emph{matrix part} of a formula, i.e., removing
1360@emph{all} initial quantifiers.
1361
1362@defun length formula
1363@cindex length
1364Length of @var{formula}. This is the number of arguments to the
1365top-level operator. The length is of particular interest with the n-ary
1366operators @code{and}
1367@rfindex and
1368and @code{or}.
1369@rfindex or
1370Notice that @code{part(@var{formula},length(@var{formula}))}
1371@rfindex part
1372is the part of largest index.
1373@end defun
1374
1375@node Global Switches
1376@section Global Switches
1377
1378There are three global switches that do not belong to certain
1379procedures, but control the general behavior of @sc{redlog}.
1380
1381@defvr Switch rlsimpl
1382@cindex automatic simplification
1383@cindex simplification
1384Simplify. By default this switch is off. With this switch on, the
1385function @code{rlsimpl}
1386@rfindex rlsimpl
1387is applied at the expression evaluation stage. @xref{Standard
1388Simplifier, rlsimpl}.
1389@end defvr
1390
1391Automatically performing formula simplification at the evaluation stage
1392is very similar to the treatment of polynomials or rational functions,
1393which are converted to some normal form.
1394@cindex normal form
1395For formulas, however, the
1396simplified equivalent is by no means canonical.
1397
1398@defvr {Switch} rlrealtime
1399@cindex real time
1400@cindex time
1401@cindex wall clock time
1402Real time. By default this switch is off. If on it protocols the wall
1403clock time needed for @sc{redlog} commands in seconds. In contrast to
1404the built-in @code{time}
1405@rvindex time
1406switch, the time is printed @emph{above} the
1407result.
1408@end defvr
1409
1410@defvr {Advanced Switch} rlverbose
1411@cindex verbosity output
1412@cindex protocol
1413Verbose. By default this switch is off. It toggles verbosity output with
1414some @sc{redlog} procedures. The verbosity output itself is not
1415documented.
1416@end defvr
1417
1418@node Basic Functions on Formulas
1419@section Basic Functions on Formulas
1420
1421@defun rlatnum formula
1422@cindex count atomic formulas
1423@cindex number of atomic formulas
1424@cindex atomic formulas
1425Number of atomic formulas. Returns the number of atomic formulas
1426contained in @var{formula}. Mind that truth values
1427@cindex truth value
1428are not considered
1429atomic formulas. In @sc{pasf} the amount of atomic
1430formulas in a bounded formula is computed
1431syntactically without expanding the bounds.
1432@end defun
1433
1434@deftp {Data Structure} {multiplicity_list}
1435A list of 2-element-lists containing an object and the number of its
1436occurrences. Names of functions returning @var{multiplicity_lists}
1437typically end on "ml".
1438@end deftp
1439
1440@defun rlatl formula
1441@cindex atomic formula list
1442@cindex list of atomic formulas
1443@cindex set of atomic formulas
1444@cindex atomic formulas
1445List of atomic formulas. Returns the set of atomic formulas contained in
1446@var{formula} as a list.
1447@end defun
1448
1449@defun rlatml formula
1450@cindex atomic formula multiplicity list
1451@cindex multiplicity list of atomic formulas
1452@cindex atomic formulas
1453@rtindex multiplicity_list
1454Multiplicity list of atomic formulas. Returns the atomic formulas
1455contained in @var{formula} in a @var{multiplicity_list}.
1456@end defun
1457
1458@defun rlifacl formula
1459@cindex factors (irreducible)
1460@cindex irreducible factors
1461@cindex irreducible factors list
1462@cindex list of irreducible factors
1463@cindex set of irreducible factors
1464@cindex factorization
1465List of irreducible factors. Returns the set of all irreducible factors
1466of the nonzero terms occurring in @var{formula}.
1467
1468@smallexample
1469rlifacl(x**2-1=0);
1470    @result{} @{x + 1,x - 1@}
1471@end smallexample
1472@end defun
1473
1474@defun rlifacml formula
1475@cindex factors (irreducible)
1476@cindex irreducible factors
1477@cindex irreducible factors multiplicity list
1478@cindex multiplicity list of irreducible factors
1479@cindex factorization
1480@rtindex multiplicity_list
1481Multiplicity list of irreducible factors. Returns the set of all
1482irreducible factors of the nonzero terms occurring in @var{formula} in a
1483@var{multiplicity_list}.
1484@end defun
1485
1486@defun rlterml formula
1487@cindex term list
1488@cindex list of terms
1489List of terms. Returns the set of all nonzero terms occurring in
1490@var{formula}.
1491@end defun
1492
1493@defun rltermml formula
1494@cindex term multiplicity list
1495@cindex multiplicity list of terms
1496@rtindex multiplicity_list
1497Multiplicity list of terms. Returns the set of all nonzero terms
1498occurring in @var{formula} in a @var{multiplicity_list}.
1499@end defun
1500
1501@defun rlvarl formula
1502@cindex list(s) of variables
1503@cindex variable list(s)
1504@cindex set of variables
1505Variable lists. Returns both the list of variables occurring freely
1506@cindex free variables
1507and that of the variables occurring boundly
1508@cindex bound variables
1509in @var{formula} in a two-element list. Notice that the two member lists
1510are not necessarily disjoint.
1511@end defun
1512
1513@defun rlfvarl formula
1514@cindex list(s) of variables
1515@cindex variable list(s)
1516@cindex free variables
1517Free variable list. Returns the variables occurring freely in
1518@var{formula} as a list.
1519@end defun
1520
1521@defun rlbvarl formula
1522@cindex list(s) of variables
1523@cindex variable list(s)
1524@cindex bound variables
1525Bound variable list. Returns the variables occurring boundly in
1526@var{formula} as a list.
1527@end defun
1528
1529@defun rlstruct formula [@var{kernel}]
1530@cindex formula structure
1531@cindex structure of formula
1532Structure of a formula. @var{kernel} is @code{v} by default. Returns a
1533list @code{@{f,sl@}}. @code{f} is constructed from @var{formula} by
1534replacing each occurrence of a term with a kernel constructed by
1535concatenating a number to @var{kernel}. The @var{substitution_list}
1536@rtindex substitution_list
1537@code{sl} contains all substitutions
1538@cindex substitution
1539to obtain @var{formula} from @code{f}.
1540
1541@smallexample
1542rlstruct(x*y=0 and (x=0 or y>0),v);
1543     @result{} @{v1 = 0 and (v2 = 0 or v3 > 0),
1544        @{v1 = x*y,v2 = x,v3 = y@}@}
1545@end smallexample
1546@end defun
1547
1548@defun rlifstruct formula [@var{kernel}]
1549@cindex factors (irreducible)
1550@cindex irreducible factors
1551@cindex formula structure
1552@cindex factorization
1553Irreducible factor structure of a formula. @var{kernel} is @code{v} by
1554default. Returns a list @code{@{f,sl@}}. @code{f} is constructed from
1555@var{formula} by replacing each occurrence of an irreducible factor with
1556a kernel constructed by adding a number to @var{kernel}. The returned
1557@var{substitution_list}
1558@rtindex substitution_list
1559@code{sl} contains all substitutions
1560@cindex substitution
1561to obtain @var{formula} from @code{f}.
1562
1563@smallexample
1564rlstruct(x*y=0 and (x=0 or y>0),v);
1565     @result{} @{v1*v2 = 0 and (v1 = 0 or v2 > 0),
1566        @{v1 = x,v2 = y@}@}
1567@end smallexample
1568@end defun
1569
1570@defun rlmatrix formula
1571@cindex matrix of a formula
1572@cindex remove quantifiers
1573Matrix computation. Drops all @emph{leading} quantifiers
1574@cindex quantifier
1575from @var{formula}.
1576@end defun
1577
1578@node Simplification
1579@chapter Simplification
1580@cindex simplification
1581The goal of simplifying a first-order formula is to obtain an equivalent
1582formula over the same language that is somehow simpler. @sc{redlog}
1583knows three kinds of simplifiers that focus mainly on reducing the size
1584of the given formula: The standard simplifier, tableau simplifiers, and
1585Groebner simplifiers. The @sc{ofsf}
1586@cindex @sc{ofsf}
1587versions of these are described in
1588@iftex
1589[DS97].
1590@end iftex
1591@ifinfo
1592@ref{References,[DS97]}.
1593@end ifinfo
1594
1595The @sc{acfsf}
1596@cindex @sc{acfsf}
1597versions are the same as the @sc{ofsf}
1598@cindex @sc{ofsf}
1599versions except for techniques that are particular to ordered fields
1600such as treatment of square sums in connection with ordering relations.
1601
1602For @sc{dvfsf}
1603@cindex @sc{dvfsf}
1604there is no Groebner simplifier available. The parts of the standard
1605simplifier that are particular to valued fields are described in
1606@iftex
1607[DS99].
1608@end iftex
1609@ifinfo
1610@ref{References,[DS99]}.
1611@end ifinfo
1612The tableau simplification is straightforwardly derived from the
1613@emph{smart simplifications} described there.
1614
1615@menu
1616* Standard Simplifier::  Fast and idempotent
1617* Tableau Simplifier::   Coping with often occurring terms
1618* Groebner Simplifier::  Detecting algebraic dependencies
1619@end menu
1620
1621In @sc{pasf} only the standard simplifier is available.
1622
1623Besides reducing the size of formulas, it is a reasonable simplification
1624goal, to reduce the degree of the quantified variables. Our method of
1625decreasing the degree of quantified variables is described for @sc{ofsf}
1626@cindex @sc{ofsf}
1627in
1628@ifinfo
1629@ref{References,[DSW98]}.
1630@end ifinfo
1631@iftex
1632[DSW98].
1633@end iftex
1634A suitable variant is available also in @sc{acfsf}
1635@cindex @sc{acfsf}
1636but not in @sc{dvfsf}.
1637@cindex @sc{dvfsf}
1638
1639@menu
1640* Degree Decreaser::
1641@end menu
1642
1643@node Standard Simplifier
1644@section Standard Simplifier
1645
1646The @dfn{Standard Simplifier} is a fast simplification algorithm that is
1647frequently called internally by other @sc{redlog} algorithms. It can be
1648applied automatically at the expression evaluation stage by turning on
1649the switch @code{rlsimpl}
1650@rvindex rlsimpl
1651(@pxref{Global Switches,switch rlsimpl}).
1652
1653@deftp {Data Structure} theory
1654A list of atomic formulas assumed to hold.
1655@end deftp
1656
1657@defun rlsimpl formula [@var{theory}]
1658@cindex simplification
1659@cindex standard simplifier
1660@rtindex theory
1661Simplify. @var{formula} is simplified recursively such that the result
1662is equivalent under the assumption that @var{theory} holds. Default for
1663@var{theory} is the empty theory @code{@{@}}. Theory inconsistency may
1664but need not be detected by @code{rlsimpl}. If @var{theory} is detected
1665to be inconsistent, a corresponding error is raised. Note that under an
1666inconsistent theory, @emph{any} formula is equivalent to the input,
1667i.e., the result is meaningless. @var{theory} should thus be chosen
1668carefully.
1669@end defun
1670
1671@menu
1672* General Features of the Standard Simplifier::
1673* General Standard Simplifier Switches::
1674* OFSF-specific Simplifications::
1675* OFSF-specific Standard Simplifier Switches::
1676* ACFSF-specific Simplifications::
1677* ACFSF-specific Standard Simplifier Switches::
1678* DVFSF-specific Simplifications::
1679* DVFSF-specific Standard Simplifier Switches::
1680* PASF-specific Simplifications::
1681* PASF-specific Standard Simplifier Switches::
1682@end menu
1683
1684@node General Features of the Standard Simplifier
1685@subsection General Features of the Standard Simplifier
1686The standard simplifier @code{rlsimpl} includes the following features
1687common to all contexts:
1688
1689@itemize @bullet
1690@item
1691Replacement of atomic subformulas by simpler equivalents. These
1692equivalents are not necessarily atomic (switches @code{rlsiexpl},
1693@code{rlsiexpla},
1694@rvindex rlsiexpla
1695@rvindex rlsiexpl
1696@pxref{General Standard Simplifier Switches}). For
1697details on the simplification on the atomic formula level, see
1698@ref{OFSF-specific Simplifications}, @ref{ACFSF-specific
1699Simplifications}, and @ref{DVFSF-specific Simplifications}.
1700@item
1701Proper treatment of truth values.
1702@cindex truth value
1703@item
1704Flattening
1705@cindex flatten nested operators
1706@cindex involutive @code{not}
1707nested n-ary operator levels and resolving involutive
1708applications of @code{not}.
1709@rfindex not
1710@item
1711Dropping @code{not}
1712@rfindex not
1713operator with atomic formula arguments by changing
1714the relation of the atomic formula appropriately. The languages of all
1715contexts allow to do so.
1716@item
1717Changing @code{repl}
1718@rfindex repl
1719to @code{impl}.
1720@rfindex impl
1721@item
1722Producing a canonical ordering
1723@cindex canonical ordering
1724among the atomic formulas on a given
1725level (switch @code{rlsisort},
1726@rvindex rlsisort
1727@pxref{General Standard Simplifier
1728Switches}).
1729@item
1730Recognizing equal subformulas
1731@cindex equal subformulas
1732on a given level (switch @code{rlsichk},
1733@rvindex rlsichk
1734@pxref{General Standard Simplifier Switches}).
1735@item
1736Passing down information that is collected during recursion (switches
1737@code{rlsism},
1738@rvindex rlsism
1739@code{rlsiidem},
1740@rvindex rlsiidem
1741@pxref{General Standard Simplifier
1742Switches}). The technique of @dfn{implicit theories}
1743@cindex implicit theory
1744@cindex theory (implicit)
1745used for this is described in detail in
1746@iftex
1747[DS97]
1748@end iftex
1749@ifinfo
1750@ref{References,[DS97]},
1751@end ifinfo
1752for @sc{ofsf}/@sc{acfsf},
1753@cindex @sc{ofsf}
1754@cindex @sc{acfsf}
1755and in
1756@iftex
1757[DS99]
1758@end iftex
1759@ifinfo
1760@ref{References,[DS99]},
1761@end ifinfo
1762for @sc{dvfsf}.
1763@cindex @sc{dvfsf}
1764@item
1765Considering interaction of atomic formulas on the same level and
1766interaction with information inherited from higher levels (switch
1767@code{rlsism},
1768@rvindex rlsism
1769@pxref{General Standard Simplifier Switches}). The
1770@dfn{smart simplification}
1771@cindex smart simplification
1772techniques used for this are beyond the scope of this manual. They are
1773described in detail in
1774@iftex
1775[DS97]
1776@end iftex
1777@ifinfo
1778@ref{References,[DS97]},
1779@end ifinfo
1780for @sc{ofsf}/@sc{acfsf},
1781@cindex @sc{ofsf}
1782@cindex @sc{acfsf}
1783and in
1784@iftex
1785[DS99]
1786@end iftex
1787@ifinfo
1788@ref{References,[DS99]},
1789@end ifinfo
1790for @sc{dvfsf}.
1791@cindex @sc{dvfsf}
1792@end itemize
1793
1794@node General Standard Simplifier Switches
1795@subsection General Standard Simplifier Switches
1796
1797@defvr Switch rlsiexpla
1798@cindex explode terms
1799@cindex simplification
1800@cindex split atomic formula
1801@cindex additively split atomic formula
1802@cindex multiplicatively split atomic formula
1803Simplify explode always. By default this switch is on. It is relevant
1804with simplifications that allow to split one atomic formula into several
1805simpler ones. Consider, e.g., the following simplification toggled by
1806the switch @code{rlsipd}
1807@rvindex rlsipd
1808(@pxref{OFSF-specific Standard Simplifier Switches}). With
1809@code{rlsiexpla}
1810@rvindex rlsiexpla
1811on, we obtain:
1812
1813@smallexample
1814f := (a - 1)**3 * (a + 1)**4 >=0;
1815         7    6      5      4      3      2
1816     @result{} a  + a  - 3*a  - 3*a  + 3*a  + 3*a  - a - 1 >= 0
1817
1818rlsimpl f;
1819@rfindex rlsimpl
1820     @result{} a - 1 >= 0 or a + 1 = 0
1821@end smallexample
1822
1823With @code{rlsiexpla} off, @code{f} will simplify as in the description
1824of the switch @code{rlsipd}. @code{rlsiexpla} is not used in the
1825@sc{dvfsf}
1826@cindex @sc{dvfsf}
1827context. The @sc{dvfsf} simplifier behaves like @code{rlsiexpla} on.
1828@end defvr
1829
1830@defvr Switch rlsiexpl
1831@cindex simplification
1832@cindex explode terms
1833@cindex split atomic formula
1834@cindex additively split atomic formula
1835@cindex multiplicatively split atomic formula
1836Simplify explode. By default this switch is on. Its role is very similar
1837to that of @code{rlsiexpla},
1838@rvindex rlsiexpla
1839but it considers the operator the scope of
1840which the atomic formula occurs in: With @code{rlsiexpl} on
1841
1842@smallexample
1843  7    6      5      4      3      2
1844a  + a  - 3*a  - 3*a  + 3*a  + 3*a  - a - 1 >= 0
1845@end smallexample
1846
1847simplifies as in the description of the switch @code{rlsiexpla} whenever
1848it occurs in a disjunction, and it simplifies as in the description of
1849the switch @code{rlsipd}
1850@rvindex rlsipd
1851(@pxref{OFSF-specific Standard Simplifier Switches}) else.
1852@code{rlsiexpl} is not used in the @sc{dvfsf}
1853@cindex @sc{dvfsf}
1854context. The @sc{dvfsf} simplifier behaves like @code{rlsiexpla} on.
1855@end defvr
1856
1857The user is not supposed to alter the settings of the following
1858@emph{fix switches} (@pxref{Conventions}):
1859
1860@defvr {Fix Switch} rlsism
1861@cindex simplification
1862@cindex smart simplification
1863Simplify smart. By default this switch is on. See the description of the
1864function @code{rlsimpl}
1865@rfindex rlsimpl
1866(@pxref{Standard Simplifier}) for its effects.
1867
1868@smallexample
1869rlsimpl(x>0 and x+1<0);
1870     @result{} false
1871@end smallexample
1872@end defvr
1873
1874@defvr {Fix Switch} rlsichk
1875@cindex simplification
1876@cindex multiple occurrences
1877@cindex equal subformulas
1878Simplify check. By default this switch is on enabling checking for equal
1879sibling subformulas:
1880
1881@smallexample
1882rlsimpl((x>0 and x-1<0) or (x>0 and x-1<0));
1883     @result{} (x>0 and x-1<0)
1884@rfindex rlsimpl
1885@end smallexample
1886@end defvr
1887
1888@defvr {Fix Switch} rlsiidem
1889@cindex simplification
1890@cindex idempotent simplification
1891Simplify idempotent. By default this switch is on. It is relevant only
1892with switch @code{rlsism}
1893@rvindex rlsism
1894on. Its effect is that @code{rlsimpl}
1895@rfindex rlsimpl
1896(@pxref{Standard Simplifier}) is idempotent in the very most cases,
1897i.e., an application of @code{rlsimpl} to an already simplified formula
1898yields the formula itself.
1899@end defvr
1900
1901@defvr {Fix Switch} rlsiso
1902@cindex simplification
1903@cindex sort atomic formulas
1904Simplify sort. By default this switch is on. It toggles the sorting of
1905the atomic formulas on the single levels.
1906
1907@smallexample
1908rlsimpl((a=0 and b=0) or (b=0 and a=0));
1909@rfindex rlsimpl
1910     @result{} a = 0 and b = 0
1911@end smallexample
1912@end defvr
1913
1914@node OFSF-specific Simplifications
1915@subsection OFSF-specific Simplifications
1916@cindex simplification of atomic formulas
1917@cindex atomic formula simplification
1918In the @sc{ofsf}
1919@cindex @sc{ofsf}
1920context, the atomic formula simplification includes the
1921following:
1922
1923@itemize @bullet
1924@item
1925Evaluation of variable-free atomic formulas to truth values.
1926@cindex evaluate atomic formulas
1927@cindex variable-free atomic formula
1928@cindex truth value
1929@item
1930Make the left hand sides primitive over the integers
1931@cindex primitive over the integers
1932with positive head coefficient.
1933@cindex positive head coefficient
1934@item
1935Evaluation of trivial square sums
1936@cindex trivial square sum
1937to truth values (switch
1938@code{rlsisqf},
1939@rvindex rlsisqf
1940@pxref{OFSF-specific Standard Simplifier Switches}).
1941Additive splitting of trivial square sums (switch @code{rlsitsqspl},
1942@rvindex rlsitsqspl
1943@pxref{OFSF-specific Standard Simplifier Switches}).
1944@item
1945In ordering inequalities,
1946@cindex ordering inequality
1947@cindex ordering constraint
1948perform parity decomposition
1949@cindex parity decomposition
1950(similar to squarefree decomposition) of terms (switch @code{rlsipd},
1951@rvindex rlsipd
1952@pxref{OFSF-specific Standard Simplifier Switches}) with the option to
1953split an atomic formula
1954@cindex split atomic formula
1955@cindex multiplicatively split atomic formula
1956multiplicatively into two simpler ones (switches
1957@code{rlsiexpl} and @code{rlsiexpla},
1958@rvindex rlsiexpl
1959@rvindex rlsiexpla
1960@pxref{General Standard Simplifier Switches}).
1961@item
1962In equations and non-ordering inequalities,
1963@cindex non-ordering inequalities
1964replace left hand sides by their squarefree parts
1965@cindex squarefree part
1966(switch @code{rlsiatdv},
1967@rvindex rlsiatdv
1968@pxref{OFSF-specific
1969Standard Simplifier Switches}). Optionally, perform factorization
1970@cindex factorization
1971of equations and inequalities (switch @code{rlsifac},
1972@rvindex rlsifac
1973@pxref{OFSF-specific
1974Standard Simplifier Switches}, switches @code{rlsiexpl} and
1975@code{rlsiexpla}, @pxref{General Standard Simplifier Switches}).
1976@end itemize
1977
1978For further details on the simplification in ordered fields see the
1979article
1980@iftex
1981[DS97].
1982@end iftex
1983@ifinfo
1984@ref{References,[DS97]}.
1985@end ifinfo
1986
1987@node OFSF-specific Standard Simplifier Switches
1988@subsection OFSF-specific Standard Simplifier Switches
1989
1990@defvr Switch rlsipw
1991@cindex simplification
1992@cindex prefer weak orderings
1993@cindex weak orderings
1994Simplification prefer weak orderings. Prefers weak orderings in contrast
1995to strict orderings
1996@cindex strict orderings
1997with implicit theory
1998@cindex implicit theory
1999simplification. @code{rlsipw} is off by default, which leads to the
2000following behavior:
2001
2002@smallexample
2003rlsimpl(a<>0 and (a>=0 or b=0));
2004     @result{} a <> 0 and (a > 0 or b = 0)
2005@end smallexample
2006
2007This meets the simplification goal of small satisfaction sets for the
2008atomic formulas. Turning on @code{rlsipw} will instead yield the
2009following:
2010
2011@smallexample
2012rlsimpl(a<>0 and (a>0 or b=0));
2013     @result{} a <> 0 and (a >= 0 or b = 0)
2014@end smallexample
2015@end defvr
2016
2017Here we meet the simplification goal of convenient relations
2018@cindex convenient relations
2019when strict orderings are considered inconvenient.
2020
2021@defvr Switch rlsipo
2022@cindex simplification
2023@cindex prefer orderings
2024Simplification prefer orderings. Prefers orderings in contrast to
2025inequalities with implicit theory
2026@cindex implicit theory
2027simplification. @code{rlsipo} is on by default, which leads to the
2028following behavior:
2029
2030@smallexample
2031rlsimpl(a>=0 and (a<>0 or b=0));
2032@rfindex rlsimpl
2033     @result{} a >= 0 and (a > 0 or b = 0)
2034@end smallexample
2035
2036This meets the simplification goal of small satisfaction sets
2037@cindex small satisfaction sets
2038for the atomic formulas. Turning it on leads, e.g., to the following
2039behavior:
2040
2041@smallexample
2042rlsimpl(a>=0 and (a>0 or b=0));
2043@rfindex rlsimpl
2044     @result{} a >= 0 and (a <> 0 or b = 0)
2045@end smallexample
2046
2047Here, we meet the simplification goal of convenient relations
2048@cindex convenient relations
2049when orderings are considered inconvenient.
2050@end defvr
2051
2052@defvr Switch rlsiatadv
2053@cindex simplification of atomic formulas
2054@cindex atomic formula simplification
2055@cindex advanced atomic formula simplification
2056Simplify atomic formulas advanced. By default this switch is on. Enables
2057sophisticated atomic formula simplifications based on squarefree part
2058@cindex squarefree part
2059computations and recognition of trivial square sums.
2060@cindex trivial square sum
2061
2062@smallexample
2063rlsimpl(a**2 + 2*a*b + b**2 <> 0);
2064@rfindex rlsimpl
2065     @result{} a+b <> 0
2066
2067rlsimpl(a**2 + b**2 + 1 > 0);
2068     @result{} true
2069@end smallexample
2070
2071Furthermore, splitting of trivial square sums
2072@cindex split  trivial square sum
2073(switch @code{rlsitsqspl}),
2074@rvindex rlsitsqspl
2075parity decompositions
2076@cindex parity decomposition
2077(switch @code{rlsipd}),
2078@rvindex rlsipd
2079and factorization
2080@cindex factorization
2081of equations and inequalities (switch @code{rlsifac})
2082@rvindex rlsifac
2083are enabled.
2084@end defvr
2085
2086@defvr Switch rlsitsqspl
2087@cindex trivial square sum
2088@cindex split trivial square sum
2089@cindex split atomic formula
2090@cindex additively split atomic formula
2091Simplify split trivial square sum. This is on by default. It is ignored
2092with @code{rlsiadv}
2093@rvindex rlsiadv
2094off. Trivial square sums are split additively
2095depending on @code{rlsiexpl} and @code{rlsiexpla}
2096@rvindex rlsiexpl
2097@rvindex rlsiexpla
2098(@pxref{General Standard Simplifier Switches}):
2099
2100@smallexample
2101rlsimpl(a**2+b**2>0);
2102@rfindex rlsimpl
2103     @result{} a <> 0 or b <> 0
2104@end smallexample
2105@end defvr
2106
2107@defvr Switch rlsipd
2108@cindex simplification
2109@cindex parity decomposition
2110Simplify parity decomposition. By default this switch is on. It is
2111ignored with @code{rlsiatadv}
2112@rvindex rlsiatadv
2113off. @code{rlsipd} toggles the parity decomposition of terms occurring
2114with ordering relations.
2115@cindex ordering relations
2116
2117@smallexample
2118f := (a - 1)**3 * (a + 1)**4 >= 0;
2119         7    6      5      4      3      2
2120     @result{} a  + a  - 3*a  - 3*a  + 3*a  + 3*a  - a - 1 >= 0
2121
2122rlsimpl f;
2123@rfindex rlsimpl
2124@group
2125         3    2
2126     @result{} a  + a  - a - 1 >= 0
2127@end group
2128@end smallexample
2129
2130The atomic formula is possibly split into two parts according to the
2131setting of the switches @code{rlsiexpl} and @code{rlsiexpla}
2132@rvindex rlsiexpl
2133@rvindex rlsiexpla
2134(@pxref{General Standard Simplifier Switches}).
2135@end defvr
2136
2137@defvr Switch rlsifac
2138@cindex simplification
2139@cindex factorization
2140Simplify factorization. By default this switch is on. It is ignored with
2141@code{rlsiatadv}
2142@rvindex rlsiatadv
2143off. Splits
2144@cindex split atomic formula
2145@cindex multiplicatively split atomic formula
2146equations and inequalities via factorization of their left hand side
2147terms into a disjunction or a conjunction, respectively. This is done in
2148dependence on @code{rlsiexpl} and @code{rlsiexpla}
2149@rvindex rlsiexpl
2150@rvindex rlsiexpla
2151(@pxref{General Standard Simplifier Switches}).
2152@end defvr
2153
2154@node ACFSF-specific Simplifications
2155@subsection ACFSF-specific Simplifications
2156@cindex simplification of atomic formulas
2157@cindex atomic formula simplification
2158In the @sc{acfsf}
2159@cindex @sc{acfsf}
2160case the atomic formula simplification includes the following:
2161
2162@itemize @bullet
2163@item
2164Evaluation of variable-free atomic formulas to truth values.
2165@cindex evaluate atomic formulas
2166@cindex variable-free atomic formula
2167@cindex truth value
2168@item
2169Make the left hand sides primitive over the integers
2170@cindex primitive over the integers
2171with positive head coefficient.
2172@cindex positive head coefficient
2173@item
2174Replace left hand sides of atomic formulas by their squarefree parts
2175@cindex squarefree part
2176(switch @code{rlsiatdv},
2177@rvindex rlsiatdv
2178@pxref{OFSF-specific Standard Simplifier Switches}). Optionally, perform
2179factorization
2180@cindex factorization
2181of equations and inequalities (switch @code{rlsifac},
2182@rvindex rlsifac
2183@pxref{OFSF-specific
2184Standard Simplifier Switches}, switches @code{rlsiexpl}
2185@rvindex rlsiexpl
2186and @code{rlsiexpla},
2187@rvindex rlsiexpla
2188@pxref{General Standard Simplifier Switches}).
2189@end itemize
2190
2191For details see the description of the simplification for ordered fields
2192in
2193@iftex
2194[DS97].
2195@end iftex
2196@ifinfo
2197@ref{References,[DS97]}.
2198@end ifinfo
2199This can be easily adapted to algebraically closed fields.
2200
2201@node ACFSF-specific Standard Simplifier Switches
2202@subsection ACFSF-specific Standard Simplifier Switches
2203
2204The switches @code{rlsiatadv}
2205@rvindex rlsiatadv
2206and @code{rlsifac}
2207@rvindex rlsifac
2208have the same effects as in the @sc{ofsf}
2209@cindex @sc{ofsf}
2210context (@pxref{OFSF-specific
2211Standard Simplifier Switches}).
2212
2213@node DVFSF-specific Simplifications
2214@subsection DVFSF-specific Simplifications
2215@cindex simplification of atomic formulas
2216@cindex atomic formula simplification
2217In the @sc{dvfsf}
2218@cindex @sc{dvfsf}
2219case the atomic formula simplification includes the following:
2220
2221@itemize @bullet
2222@item
2223Evaluation of variable-free atomic formulas to truth values
2224provided that p is known.
2225@cindex evaluate atomic formulas
2226@cindex variable-free atomic formula
2227@cindex truth value
2228@item
2229Equations and inequalities can be treated as in @sc{acfsf}
2230@cindex @sc{acfsf}
2231(@pxref{ACFSF-specific Simplifications}). Moreover powers of p
2232@cindex power of p
2233@cindex cancel powers of p
2234can be cancelled.
2235@item
2236With valuation relations,
2237@cindex valuation relation
2238the @sc{gcd}
2239@cindex @sc{gcd}
2240@cindex greatest common divisor
2241@cindex cancel @sc{gcd}
2242of both sides is cancelled and
2243added appropriately as an equation or inequality.
2244@item
2245Valuation relations
2246@cindex valuation relation
2247involving zero sides can be evaluated or at least
2248turned into equations or inequalities.
2249@item
2250For concrete p, integer coefficients with valuation relations can be
2251replaced by a power of p
2252@cindex power of p
2253on one side of the relation.
2254@item
2255For unspecified p, polynomials in p can often be replaced by one
2256monomial.
2257@item
2258For unspecified p, valuation relations containing a monomial in p on one
2259side, and an integer on the other side can be transformed into @code{z ~
22601} or @code{z /~ 1}, where @code{z} is an integer.
2261@end itemize
2262
2263For details on simplification in p-adic fields see the article
2264@iftex
2265[DS99].
2266@end iftex
2267@ifinfo
2268@ref{References,[DS99]}.
2269@end ifinfo
2270
2271Atomic formulas of the form @code{z ~ 1} or @code{z /~ 1}, where
2272@code{z} is an integer, can be split
2273@cindex split atomic formula
2274@cindex multiplicatively split atomic formula
2275into several ones via integer factorization.
2276@cindex integer factorization
2277@cindex factorization
2278This simplification is
2279often reasonable on final results. It explicitly discovers those primes
2280p for which the formula holds. There is a special function for this
2281simplification:
2282
2283@defun rlexplats formula
2284@cindex explode atomic formulas
2285@cindex split atomic formula
2286@cindex multiplicatively split atomic formula
2287Explode atomic formulas. Factorize
2288@cindex integer factorization
2289@cindex factorization
2290atomic formulas of the form @code{z ~ 1} or @code{z /~ 1}, where
2291@code{z} is an integer. @code{rlexplats} obeys the switches
2292@code{rlsiexpla}
2293@rvindex rlsiexpla
2294and @code{rlsiexpl}
2295@rvindex rlsiexpl
2296(@pxref{General Standard Simplifier Switches}), but not @code{rlsifac}
2297@rvindex rlsifac
2298(@pxref{DVFSF-specific Standard Simplifier Switches}).
2299@end defun
2300
2301@node DVFSF-specific Standard Simplifier Switches
2302@subsection DVFSF-specific Standard Simplifier Switches
2303
2304The context @sc{dvfsf}
2305@cindex @sc{dvfsf}
2306knows no special simplifier switches, and ignores the general switches
2307@code{rlsiexpla}
2308@rvindex rlsiexpla
2309and @code{rlsiexpl}
2310@rvindex rlsiexpl
2311(@pxref{General Standard Simplifier Switches}). It behaves like
2312@code{rlsiexpla} on. The simplifier contains numerous sophisticated
2313simplifications for atomic formulas in the style of @code{rlsiatadv}
2314@rvindex rlsiatadv
2315on (@pxref{OFSF-specific Standard Simplifier Switches}).
2316
2317@defvr Switch rlsifac
2318@cindex simplification
2319@cindex factorization
2320@cindex integer factorization
2321Simplify factorization. By default this switch is on. Toggles certain
2322simplifications that require @emph{integer} factorization.
2323@xref{DVFSF-specific Simplifications}, for details.
2324@end defvr
2325
2326@node PASF-specific Simplifications
2327@subsection PASF-specific Simplifications
2328@cindex simplification of atomic formulas
2329@cindex atomic formula simplification
2330Due to a simple term structure a lot simplification
2331can be performed on @sc{pasf} atomic formulas
2332with the total goal of reducing the absolute
2333summ of the coefficients.
2334In the @sc{pasf}
2335@cindex @sc{pasf}
2336context the atomic formula
2337simplification includes the following:
2338
2339@itemize @bullet
2340@item
2341Evaluation of trivial domain valued atomic
2342formulas to truth values (e.g. variable free atomic formulas).
2343A special case of this simplification feature is the evaluation
2344of congruences with modulus equal to 1.
2345
2346@smallexample
2347f := cong(y+x+z,0,1);
2348rlsimpl f;
2349@rfindex rlsimpl
2350@group
2351     @result{} true
2352@end group
2353@end smallexample
2354
2355@item
2356Modulo reduction. The coefficients of a @sc{pasf}
2357(in-)congurence modulo
2358@tex
2359$m$
2360@end tex
2361@ifinfo
2362m
2363@end ifinfo
2364can be reduced to be not greater than
2365@tex
2366$m-1$.
2367@end tex
2368@ifinfo
2369m-1
2370@end ifinfo
2371After the application of this simplification rule
2372all coefficients could vanish to zero.
2373@smallexample
2374f := cong(7*x+5*y,11,3);
2375rlsimpl f;
2376@rfindex rlsimpl
2377@group
2378     @result{} x + 2*y - 2 ~3~ 0
2379@end group
2380f := cong(8*x + 4*y, 16, 4);
2381rlsimpl f;
2382@rfindex rlsimpl
2383@group
2384     @result{} true
2385@end group
2386@end smallexample
2387@item
2388Content elimination in atomic formulas. Every atomic
2389(un-)equation can be done content free by dividing all
2390the coefficients by their greatest common divisor. Similar
2391simplification rule can be applied for the congruences.
2392In case of inequalities even more simplification can be done.
2393@smallexample
2394f := 3 * x + 6 * y  - 9 = 0
2395rlsimpl f;
2396@rfindex rlsimpl
2397@group
2398     @result{} x + 2 * y - 3 = 0
2399@end group
2400
2401f := 3 * x + 6 * y  - 7 < 0
2402rlsimpl f;
2403@rfindex rlsimpl
2404@group
2405     @result{} x + 2 * y - 2 <= 0
2406@end group
2407
2408f := cong(3 * x + 6 * y - 3, 0, 9);
2409rlsimpl f;
2410@rfindex rlsimpl
2411@group
2412     @result{} x + 2 * y - 1 =~ 0 (3)
2413@end group
2414@end smallexample
2415@item
2416In certain cases, we can simplify (un-)equations
2417and (in-)congruences to truth values. These simplification
2418rules due to their non-triviality are referred to as
2419the advanced simplification rules.
2420
2421@smallexample
2422f := 3*k-1 = 0;
2423rlsimpl f;
2424@rfindex rlsimpl
2425@group
2426     @result{} false
2427@end group
2428@end smallexample
2429
2430@end itemize
2431Beyond atomic formulas simplification was extended to care for bounded
2432quantifiers.
2433@cindex bounded quantifers
2434
2435@itemize @bullet
2436
2437@item
2438@sc{pasf} provides a simplification procedure for bounds
2439using their special properties.
2440
2441@item
2442Bounds that can't be satisfied, bounds with single satisfaction
2443value and bounds with trivial matrix are transformed
2444into equivalent unbounded formulas reducing the total
2445formula length.
2446
2447@item
2448Suitable atomic formulas in the matrix of a bounded
2449quantifier that contain the bounded variable
2450are moved inside the bound.
2451
2452@item
2453Information from the bound is used to expand the implicit
2454theory for the matrix simplification.
2455@end itemize
2456
2457@node PASF-specific Standard Simplifier Switches
2458@subsection PASF-specific Standard Simplifier Switches
2459
2460@defvr Switch rlpasfsimplify
2461Simplifies the output formula after the elimination of each quantifier. By
2462default this switch is on.
2463@end defvr
2464
2465@defvr Switch rlpasfexpand
2466Expands the output formula (with bounded quantifiers) after the
2467elimination of each quantifier. This switch is off by default due to
2468immense overhead of the expansion.
2469@end defvr
2470
2471@defvr Switch rlsiatadv
2472Turns the advanced PASF-speciefic simplification of atomic formulas
2473on. For details see @xref{PASF-specific Simplifications}.
2474@end defvr
2475
2476Beside the standard simplification @sc{pasf} provides a powerfull
2477standard simplifier extension based on the package @sc{susi}.
2478This feature uses special properties of @sc{pasf} formulas
2479to reduce the formula size using the concept of implicit
2480theory.
2481
2482@defvr Switch rlsusi
2483Turns the advanced @sc{susi} simplification on. Per default
2484this switch is on.
2485@end defvr
2486
2487@node Tableau Simplifier
2488@section Tableau Simplifier
2489
2490Although our standard simplifier (@pxref{Standard Simplifier}) already
2491combines information located on different boolean levels, it preserves
2492the basic boolean structure of the formula. The tableau methods, in
2493contrast, provide a technique for changing the boolean structure
2494@cindex change boolean structure
2495of a formula by constructing case distinctions.
2496@cindex case distinction
2497Compared to the standard simplifier they are much slower.
2498For details on tableau simplification see
2499@ifinfo
2500@ref{References,[DS97]}.
2501@end ifinfo
2502@iftex
2503[DS97].
2504@end iftex
2505
2506@deftp {Data Structure} {cdl}
2507Case distinction list.
2508@cindex case distinction
2509This is a list of atomic formulas considered as a disjunction.
2510@end deftp
2511
2512@defun rltab formula cdl
2513@cindex simplification
2514@cindex tableau
2515@rtindex cdl
2516Tableau method. The result is a tableau wrt.@: @var{cdl}, i.e., a
2517simplified equivalent of the disjunction over the specializations wrt.@:
2518all atomic formulas in @var{cdl}.
2519
2520@smallexample
2521rltab((a = 0 and (b = 0 or (d = 0 and e = 0))) or
2522   (a = 0 and c = 0),@{a=0,a<>0@});
2523     @result{} (a = 0 and (b = 0 or c = 0 or (d = 0 and e = 0)))
2524@end smallexample
2525@end defun
2526
2527@defun rlatab formula
2528@cindex simplification
2529@cindex tableau
2530@cindex automatic tableau
2531Automatic tableau method. Tableau steps wrt.@: a case distinction over
2532the signs of all terms occurring in @var{formula} are computed and the
2533best result, i.e., the result with the minimal number of atomic formulas
2534is returned.
2535@end defun
2536
2537@defun rlitab formula
2538@cindex simplification
2539@cindex tableau
2540@cindex iterative tableau
2541Iterative automatic tableau method. @var{formula} is simplified by
2542iterative applications of @code{rlatab}.
2543@rfindex rlatab
2544The exact procedure depends on
2545the switch @code{rltabib}.
2546@rvindex rltabib
2547@end defun
2548
2549@defvr Switch rltabib
2550@cindex simplification
2551@cindex tableau
2552@cindex branch-wise tableau iteration
2553Tableau iterate branch-wise. By default this switch is on. It controls
2554the procedure @code{rlitab}.
2555@rfindex rlitab
2556If @code{rltabib} is off, @code{rlatab}
2557@rfindex rlatab
2558is iteratively applied to the argument formula as long as shorter
2559results can be obtained. In case @code{rltabib} is on, the corresponding
2560next tableau step is not applied to the last tableau result but
2561independently to each single branch. The iteration stops when the
2562obtained formula is not smaller than the corresponding input.
2563@end defvr
2564
2565@node Groebner Simplifier
2566@section Groebner Simplifier
2567@cindex Groebner simplifier
2568The Groebner simplifier is not available in the @sc{dvfsf}
2569@cindex @sc{dvfsf}
2570context. It considers order theoretical and algebraic simplification
2571@cindex algebraic simplification
2572rules between the atomic formulas of the input formula. Currently the
2573Groebner simplifier is not idempotent. The name is derived from the main
2574mathematical tool used for simplification: Computing Groebner bases
2575@cindex Groebner basis
2576of certain subsets of terms occurring in the atomic formulas.
2577
2578For calling the Groebner simplifier there are the following functions:
2579
2580@defun rlgsc formula [@var{theory}]
2581@defunx rlgsd formula [@var{theory}]
2582@defunx rlgsn formula [@var{theory}]
2583@rtindex theory
2584@cindex normal form
2585@cindex boolean normal form
2586@cindex simplification
2587@cindex Groebner simplifier
2588@cindex polynomial reduction
2589@cindex reduce polynomials
2590Groebner simplifier. @var{formula} is a quantifier-free formula. Default
2591for @var{theory} is the empty theory @code{@{@}}. The functions differ
2592in the boolean normal form that is computed at the beginning.
2593@code{rlgsc} computes a conjunctive normal form,
2594@cindex conjunctive normal form
2595@cindex @sc{cnf}
2596@code{rlgsd} computes a disjunctive normal form,
2597@cindex disjunctive normal form
2598@cindex @sc{dnf}
2599and @code{rlgsn} heuristically decides for either a conjunctive or a
2600disjunctive normal form depending on the structure of @var{formula}.
2601After computing the corresponding normal form, the formula is simplified
2602using Groebner simplification techniques. The returned formula is
2603equivalent to the input formula wrt.@: @var{theory}.
2604
2605@smallexample
2606rlgsd(x=0 and ((y = 0 and x**2+2*y > 0) or
2607        (z=0 and x**3+z >= 0)));
2608    @result{} x = 0 and z = 0
2609@end smallexample
2610
2611@smallexample
2612rlgsc(x neq 0 or ((y neq 0 or x**2+2*x*y <= 0) and
2613        (z neq 0 or x**3+z < 0)));
2614     @result{} x <> 0 or z <> 0
2615@end smallexample
2616@end defun
2617
2618The heuristic used by @code{rlgsn}
2619@rfindex rlgsn
2620is intended to find the smaller boolean normal form
2621@cindex boolean normal form
2622among @sc{cnf} an @sc{dnf}. Note that, anyway, the simplification of the
2623smaller normal form can lead to a larger final result than that of the
2624larger one.
2625
2626The Groebner simplifiers use the Groebner package of @sc{reduce} to
2627compute the various Groebner bases. By default, the @code{revgradlex}
2628term order is used, and no optimizations of the order between the
2629variables are applied. The other switches and variables of the Groebner
2630package are not controlled by the Groebner simplifier. They can be
2631adjusted by the user.
2632
2633In contrast to the standard simplifier @code{rlsimpl}
2634@rfindex rlsimpl
2635(@pxref{Standard Simplifier}), the Groebner simplifiers can in general
2636produce formulas containing more atomic formulas than the input. This
2637cannot happen if the switches @code{rlgsprod},
2638@rvindex rlgsprod
2639@code{rlgsred},
2640@rvindex rlgsred
2641and @code{rlgssub}
2642@rvindex rlgssub
2643are off and the input formula is a simplified boolean normal form.
2644
2645The functionality of the Groebner simplifiers @code{rlgsc},
2646@rfindex rlgsc
2647@code{rlgsd},
2648@rfindex rlgsd
2649and @code{rlgsn}
2650@rfindex rlgsn
2651is controlled by numerous switches. In
2652most cases the default settings lead to a good simplification.
2653
2654@defvr Switch rlgsrad
2655@cindex radical membership test
2656@cindex ideal membership test
2657Groebner simplifier radical membership test. By default this switch is
2658on. If the switch is on the Groebner simplifier does not only use ideal
2659membership tests for simplification but also radical membership tests.
2660This leads to better simplifications but takes considerably more time.
2661@end defvr
2662
2663@defvr Switch rlgssub
2664@cindex substitution
2665Groebner simplifier substitute. By default this switch is on. Certain
2666subsets of atomic formulas are substituted by equivalent ones. Both the
2667number of atomic formulas and the complexity of the terms
2668@cindex complexity of terms
2669may increase or decrease independently.
2670@end defvr
2671
2672@defvr Switch rlgsbnf
2673@cindex boolean normal form
2674@cindex normal form
2675Groebner simplifier boolean normal form. By default this switch is on.
2676Then the simplification starts with a boolean normal form computation.
2677If the switch is off, the simplifiers expect a boolean normal form as
2678the argument @var{formula}.
2679@end defvr
2680
2681@defvr Switch rlgsred
2682@cindex polynomial reduction
2683@cindex reduce polynomials
2684@cindex complexity of terms
2685Groebner simplifier reduce polynomials. By default this switch is on. It
2686controls the reduction of the terms wrt.@: the computed Groebner bases.
2687The number of atomic formulas is never increased. Mind that by reduction
2688the terms can become more complicated.
2689@end defvr
2690
2691@defvr {Advanced Switch} rlgsvb
2692@cindex verbosity output
2693@cindex protocol
2694Groebner simplifier verbose. By default this switch is on. It toggles
2695verbosity output of the Groebner simplifier. Verbosity output is given
2696if and only if both @code{rlverbose}
2697@rvindex rlverbose
2698(@pxref{Global Switches}) and @code{rlgsvb} are on.
2699@end defvr
2700
2701@defvr {Advanced Switch} rlgsprod
2702Groebner simplifier product. By default this switch is off. If this
2703switch is on then conjunctions of inequalities and disjunctions of
2704equations are contracted
2705@cindex unsplit atomic formulas
2706@cindex contract atomic formulas
2707multiplicatively to one atomic formula. This reduces the number of
2708atomic formulas but in most cases it raises the complexity of the terms.
2709Most simplifications recognized by considering products are detected
2710also with @code{rlgsprod} off.
2711@end defvr
2712
2713@defvr {Advanced Switch} rlgserf
2714Groebner simplifier evaluate reduced form.
2715@cindex evaluate reduced form
2716By default this switch is on. It controls the evaluation of the atomic
2717formulas
2718@cindex evaluate atomic formulas
2719to truth values.
2720@cindex truth value
2721If this switch is on, the standard simplifier (@pxref{Standard
2722Simplifier})
2723@cindex standard simplifier
2724is used to evaluate atomic formulas. Otherwise atomic formulas are
2725evaluated only if their left hand side is a domain element.
2726@end defvr
2727
2728@defvr {Advanced Switch} rlgsutord
2729@cindex term order
2730Groebner simplifier user defined term order. By default this switch is
2731off. Then all Groebner basis computations and reductions
2732@cindex polynomial reduction
2733@cindex reduce polynomials
2734are performed with respect to the @code{revgradlex}
2735@cindex @code{revgradlex}
2736term order. If this switch is on, the Groebner simplifier minds the term
2737order selected with the @code{torder}
2738@rfindex torder
2739statement. For passing a variable list to @code{torder}, note that
2740@code{rlgsradmemv!*}
2741@vrindex rlgsradmemv!*
2742is used as the tag variable for radical membership tests.
2743@cindex radical membership test
2744@end defvr
2745
2746@defvr {Fluid} rlgsradmemv!*
2747@cindex radical membership test
2748Radical membership test variable. This fluid contains the tag variable
2749@cindex tag variable
2750used for the radical membership test with switch @code{rlgsrad}
2751@rvindex rlgsrad
2752on. It can be used to pass the variable explicitly to @code{torder}
2753@rfindex torder
2754with switch @code{rlgsutord}
2755@rvindex rlgsutord
2756on.
2757@end defvr
2758
2759@node Degree Decreaser
2760@section Degree Decreaser
2761@cindex degree
2762@cindex degree restriction
2763The quantifier elimination procedures of @sc{redlog} (@pxref{Quantifier
2764Elimination}) obey certain degree restrictions on the bound variables.
2765For this reason, there are degree-decreasing simplifiers available,
2766which are automatically applied by the corresponding quantifier
2767elimination procedures. There is no degree decreaser for the @sc{dvfsf}
2768@cindex @sc{dvfsf}
2769context available.
2770
2771@defun rldecdeg formula
2772Decrease degrees.
2773@cindex decrease degree
2774Returns a formula equivalent to @var{formula},
2775hopefully decreasing the degrees of the bound variables. In the
2776@sc{ofsf}
2777@cindex @sc{ofsf}
2778context there are in general some sign conditions
2779@cindex sign conditions
2780on the variables added, which slightly increases the number of contained
2781atomic formulas.
2782
2783@smallexample
2784rldecdeg ex(@{b,x@},m*x**4711+b**8>0);
2785    @result{} ex b (b >= 0 and ex x (b + m*x > 0))
2786@end smallexample
2787@end defun
2788
2789@defun rldecdeg1 formula [@var{varlist}]
2790@cindex decrease degree
2791Decrease degrees subroutine. This provides a low-level entry point to
2792the degree decreaser. The variables to be decreased are not determined
2793by regarding quantifiers but are explicitly given by @var{varlist},
2794where the empty @var{varlist} selects @emph{all} free variables of
2795@code{f}. The return value is a list @code{@{f,l@}}. @code{f} is a
2796formula, and @code{l} is a list @code{@{...,@{v,d@},...@}}, where
2797@code{v} is from @var{varlist} and @code{d} is an integer. @code{f} has
2798been obtained from @var{formula} by substituting
2799@cindex substitution
2800@code{v} for @code{v**d}. The sign conditions necessary with the
2801@sc{ofsf}
2802@cindex @sc{ofsf}
2803context are not generated automatically, but have to be
2804constructed by hand for the variables @code{v} with even degree @code{d}
2805in @code{l}.
2806
2807@smallexample
2808rldecdeg1(m*x**4711+b**8>0,@{b,x@});
2809    @result{} @{b + m*x > 0,@{@{x,4711@},@{b,8@}@}@}
2810@end smallexample
2811@end defun
2812
2813@node Normal Forms
2814@chapter Normal Forms
2815
2816@menu
2817* Boolean Normal Forms::  CNF and DNF
2818* Miscellaneous Normal Forms::    Negation, prenex, anti-prenex
2819@end menu
2820
2821@node Boolean Normal Forms
2822@section Boolean Normal Forms
2823
2824For computing small boolean normal forms,
2825@cindex boolean normal form
2826see also the documentation of
2827the procedures @code{rlgsc}
2828@rfindex rlgsc
2829and @code{rlgsd}
2830@rfindex rlgsd
2831(@ref{Groebner Simplifier}).
2832
2833@defun rlcnf formula
2834@cindex normal form
2835@cindex conjunctive normal form
2836@cindex @sc{cnf}
2837Conjunctive normal form. @var{formula} is a quantifier-free formula.
2838Returns a conjunctive normal form of @var{formula}.
2839
2840@smallexample
2841rlcnf(a = 0 and b = 0 or b = 0 and c = 0);
2842    @result{} (a = 0 or c = 0) and b = 0
2843@end smallexample
2844@end defun
2845
2846@defun rldnf formula
2847@cindex normal form
2848@cindex disjunctive normal form
2849@cindex @sc{dnf}
2850Disjunctive normal form. @var{formula} is a quantifier-free formula.
2851Returns a disjunctive normal form of @var{formula}.
2852
2853@smallexample
2854rldnf((a = 0 or b = 0) and (b = 0 or c = 0));
2855    @result{} (a = 0 and c = 0) or b = 0
2856@end smallexample
2857@end defun
2858
2859@defvr Switch rlbnfsm
2860@cindex boolean normal form
2861@cindex smart @sc{bnf} computation
2862@cindex simplifier recognized implication
2863Boolean normal form smart. By default this switch is off. If on,
2864@emph{simplifier recognized implication}
2865@cindex simplifier recognized implication
2866@ifinfo
2867(@pxref{References,[DS97]})
2868@end ifinfo
2869@iftex
2870[DS97]
2871@end iftex
2872is applied by @code{rlcnf}
2873@rfindex rlcnf
2874and @code{rldnf}.
2875@rfindex rldnf
2876This leads to smaller normal forms but is considerably time consuming.
2877@end defvr
2878
2879@defvr {Fix Switch} rlbnfsac
2880@cindex boolean normal form
2881@cindex subsumption
2882@cindex cut
2883Boolean normal forms subsumption and cut. By default this switch is on.
2884With boolean normal form computation, subsumption and cut strategies are
2885applied by @code{rlcnf}
2886@rfindex rlcnf
2887and @code{rldnf}
2888@rfindex rldnf
2889to decrease the number of clauses.
2890@cindex decrease number of clauses
2891We give an example:
2892
2893@smallexample
2894rldnf(x=0 and y<0 or x=0 and y>0 or x=0 and y<>0 and z=0);
2895    @result{} (x = 0 and y <> 0)
2896@end smallexample
2897@end defvr
2898
2899@node Miscellaneous Normal Forms
2900@section Miscellaneous Normal Forms
2901
2902@defun rlnnf formula
2903@cindex normal form
2904@cindex negation normal form
2905@cindex @sc{nnf}
2906Negation normal form. Returns a @dfn{negation normal form} of
2907@var{formula}. This is an @code{and}-@code{or}-combination of atomic
2908formulas. Note that in all contexts, we use languages
2909@cindex language
2910such that all
2911negations can be encoded by relations (@pxref{Format and Handling of
2912Formulas}). We give an example:
2913
2914@smallexample
2915rlnnf(a = 0 equiv b > 0);
2916    @result{} (a = 0 and b > 0) or (a <> 0 and b <= 0)
2917@end smallexample
2918
2919@code{rlnnf} accepts formulas containing quantifiers, but it does not
2920eliminate quantifiers.
2921@cindex quantifier
2922@end defun
2923
2924@defun rlpnf formula
2925@cindex normal form
2926@cindex prenex normal form
2927@cindex @sc{pnf}
2928Prenex normal form. Returns a prenex normal form of @var{formula}. The
2929number of quantifier changes
2930@cindex quantifier changes
2931in the result is minimal among all prenex
2932normal forms that can be obtained from @var{formula} by only moving
2933quantifiers to the outside.
2934
2935When @var{formula} contains two quantifiers with the same variable such
2936as in
2937@ifinfo
2938
2939@example
2940ex x (x = 0) and ex x (x <> 0)
2941@end example
2942
2943@end ifinfo
2944@tex
2945$$\exists x(x = 0) \land \exists x (x \neq 0)$$
2946@end tex
2947there occurs a name conflict. It is resolved according to the following
2948rules:
2949@cindex rename variables
2950@cindex variable renaming
2951
2952@itemize @bullet
2953@item Every bound variable that stands in conflict with any other
2954variable is renamed.
2955@item Free variables are never renamed.
2956@end itemize
2957
2958Hence @code{rlpnf} applied to the above example formula yields
2959
2960@smallexample
2961rlpnf(ex(x,x=0) and ex(x,x<>0));
2962    @result{} ex x0 ex x1 (x0 = 0 and x1 <> 0)
2963@end smallexample
2964@end defun
2965
2966@defun rlapnf formula
2967@cindex anti-prenex normal form
2968@cindex move quantifiers inside
2969@cindex prenex normal form
2970Anti-prenex normal form. Returns a formula equivalent to @var{formula}
2971where all quantifiers are moved to the inside as far as possible.
2972@cindex quantifier
2973@cindex move quantifiers inside
2974
2975@smallexample
2976rlapnf ex(x,all(y,x=0 or (y=0 and x=z)));
2977    @result{} ex x (x = 0) or (all y (y = 0) and ex x (x - z = 0))
2978@end smallexample
2979@end defun
2980
2981@defun rltnf formula terml
2982@cindex normal form
2983@cindex term normal form
2984Term normal form. @var{terml} is a list of terms. This combines @sc{dnf}
2985@cindex @sc{dnf}
2986@cindex disjunctive normal form
2987computation with tableau
2988@cindex tableau
2989ideas (@pxref{Tableau Simplifier}). A typical
2990choice for @var{terml} is @code{rlterml} @var{formula}.
2991@rfindex rlterml
2992If the switch @code{rltnft}
2993@rvindex rltnft
2994is off, then @code{rltnf(@var{formula},rlterml @var{formula})} returns a
2995@sc{dnf}.
2996@end defun
2997
2998@defvr Switch rltnft
2999@cindex term normal form
3000Term normal form tree variant. By default this switch is on causing
3001@code{rltnf} to return a deeply nested formula.
3002@cindex deeply nested formula
3003@end defvr
3004
3005@node Quantifier Elimination and Variants
3006@chapter Quantifier Elimination and Variants
3007@cindex comprehensive Groebner Basis
3008@cindex @sc{cgb}
3009@emph{Quantifier elimination} computes quantifier-free equivalents
3010@cindex quantifier-free equivalent
3011for given first-order formulas.
3012
3013For @sc{ofsf}
3014@cindex @sc{ofsf}
3015there are two methods available:
3016@enumerate
3017@item
3018Virtual substitution
3019@cindex virtual substitution
3020based on elimination set
3021@cindex elimination set
3022ideas
3023@ifinfo
3024@ref{References,[Wei88]}.
3025@end ifinfo
3026@iftex
3027[Wei88].
3028@end iftex
3029This implementation is restricted to at most quadratic occurrences of the
3030quantified variables, but includes numerous heuristic strategies for
3031coping with higher degrees. See
3032@ifinfo
3033@ref{References,[LW93]}, @ref{References,[Wei97]},
3034@end ifinfo
3035@iftex
3036[LW93], [Wei97]
3037@end iftex
3038for details of the method.
3039@item
3040Partial cylindrical algebraic decomposition
3041@cindex cylindrical algebraic decomposition
3042@cindex partial cylindrical algebraic decomposition
3043(CAD)
3044@cindex CAD
3045introduced by Collins and Hong
3046@ifinfo
3047@ref{References,[CH91]}.
3048@end ifinfo
3049@iftex
3050[CH91].
3051@end iftex
3052There are no degree restrictions with CAD.
3053@end enumerate
3054
3055For @sc{dvfsf}
3056@cindex @sc{dvfsf}
3057we use the virtual substitution method
3058@cindex virtual substitution
3059that is also available for
3060@sc{ofsf}.
3061@cindex @sc{ofsf}
3062Here, the implementation is restricted to linear occurrences of the
3063quantified variables. There are also heuristic strategies for coping
3064with higher degrees included. The method is described in detail in
3065@ifinfo
3066@ref{References,[Stu00]}.
3067@end ifinfo
3068@iftex
3069[Stu00].
3070@end iftex
3071
3072The @sc{acfsf}
3073@cindex @sc{acfsf}
3074quantifier elimination is based on @emph{comprehensive
3075Groebner basis}
3076@cindex comprehensive Groebner basis
3077computation; there are no degree restrictions
3078@cindex degree restriction
3079for this context
3080@ifinfo
3081@ref{References,[Wei92]}.
3082@end ifinfo
3083@iftex
3084[Wei92].
3085@end iftex
3086
3087In @sc{pasf} context the quantifier elimination is based
3088on the fast method similar to elimination by
3089virtual substitution introduced by Weispfenning. For
3090more details see
3091@ifinfo
3092@ref{References,[Wei90]}
3093@end ifinfo
3094@iftex
3095[Wei90].
3096@end iftex
3097
3098@menu
3099* Quantifier Elimination::
3100* Generic Quantifier Elimination::
3101* Local Quantifier Elimination::
3102* Linear Optimization::
3103@end menu
3104
3105@node Quantifier Elimination
3106@section Quantifier Elimination
3107
3108@subsection Virtual Substitution
3109
3110@defun rlqe formula [@var{theory}]
3111@rtindex theory
3112@cindex quantifier elimination
3113Quantifier elimination by virtual substitution. Returns a
3114quantifier-free equivalent
3115@cindex quantifier-free equivalent
3116of @var{formula} (wrt.@: @var{theory}). In the contexts @sc{ofsf}
3117@cindex @sc{ofsf}
3118and @sc{dvfsf},
3119@cindex @sc{dvfsf}
3120@var{formula} has to obey certain degree restrictions.
3121@cindex degree restriction
3122There are various techniques for decreasing the degree
3123@cindex decrease degree
3124of the input and of intermediate results built in. In case that not all
3125variables can be eliminated, the resulting formula is not
3126quantifier-free but still equivalent.
3127@end defun
3128
3129For degree decreasing
3130@cindex decrease degree
3131heuristics see, e.g., @ref{Degree Decreaser}, or the switches
3132@code{rlqeqsc}/@code{rlqesqsc}.
3133@rvindex rlqeqsc
3134@rvindex rlqesqsc
3135
3136@deftp {Data Structure} {elimination_answer}
3137A list of @dfn{condition--solution pairs},
3138@cindex condition--solution pairs
3139i.e., a list of pairs consisting of a quantifier-free formula and a set
3140of equations.
3141@end deftp
3142
3143@defun rlqea formula [@var{theory}]
3144@rtindex theory
3145@cindex quantifier elimination
3146@cindex solution points
3147@cindex extended quantifier elimination
3148@cindex answer
3149@cindex sample solution
3150@rtindex elimination_answer
3151Quantifier elimination with answer. Returns an
3152@ifinfo
3153@var{elimination_answer}
3154@end ifinfo
3155@iftex
3156@var{elim@-i@-na@-tion_an@-swer}
3157@end iftex
3158obtained the following way: @var{formula} is wlog.@: prenex. All
3159quantifier blocks but the outermost one are eliminated. For this
3160outermost block, the constructive information obtained by the
3161elimination is saved:
3162
3163@itemize @bullet
3164@item In case the considered block is existential, for each evaluation
3165of the free variables we know the following: Whenever a @dfn{condition}
3166holds, then @var{formula} is @code{true}
3167@rvindex true
3168under the given evaluation, and the
3169@dfn{solution}
3170@cindex solution
3171is @emph{one} possible evaluation for the outer block variables
3172satisfying the matrix.
3173@item The universally quantified case is dual: Whenever a @dfn{condition}
3174is false, then @var{formula} is @code{false},
3175@rvindex false
3176and the @dfn{solution} is @emph{one} possible counterexample.
3177@cindex counterexample
3178@end itemize
3179
3180As an example we show how to find conditions and solutions for a system
3181of two linear constraints:
3182
3183@smallexample
3184rlqea ex(x,x+b1>=0 and a2*x+b2<=0);
3185           2                                    - b2
3186    @result{} @{@{a2 *b1 - a2*b2 >= 0 and a2 <> 0,@{x = -------@}@},
3187                                                a2
3188        @{a2 < 0 or (a2 = 0 and b2 <= 0),@{x = infinity1@}@}@}
3189@end smallexample
3190
3191The answer can contain constants named @code{infinity}
3192@cindex @code{infinity}
3193or @code{epsilon},
3194@cindex @code{epsilon}
3195both indexed by a number: All @code{infinity}'s are positive and
3196infinite, and all @code{epsilon}'s are positive and infinitesimal wrt.@:
3197the considered field. Nothing is known about the ordering among the
3198@code{infinity}'s and @code{epsilon}'s though this can be relevant for
3199the points to be solutions. With the switch @code{rounded}
3200@rvindex rounded
3201on, the @code{epsilon}'s are evaluated to zero. @code{rlqea} is not
3202available in the context @sc{acfsf}.
3203@cindex @sc{acfsf}
3204@end defun
3205
3206@defvr {Switch} rlqeqsc
3207@defvrx Switch rlqesqsc
3208@cindex quantifier elimination
3209@cindex quadratic special case
3210@cindex super quadratic special case
3211Quantifier elimination (super) quadratic special case. By default these
3212switches are off. They are relevant only in @sc{ofsf}.
3213@cindex @sc{ofsf}
3214If turned on, alternative elimination sets are used for certain special
3215cases by @code{rlqe}/@code{rlqea}
3216@rfindex rlqe
3217@rfindex rlqea
3218and @code{rlgqe}/@code{rlgqea}.
3219@rfindex rlgqe
3220@rfindex rlgqea
3221(@pxref{Generic Quantifier Elimination}). They will possibly avoid
3222violations of the degree restrictions,
3223@cindex degree restriction
3224but lead to larger results in general. Former versions of @sc{redlog}
3225without these switches behaved as if @code{rlqeqsc} was on and
3226@code{rlqesqsc} was off.
3227@end defvr
3228
3229@defvr {Advanced Switch} rlqedfs
3230@cindex quantifier elimination
3231@cindex depth first search
3232@cindex breadth first search
3233Quantifier elimination depth first search. By default this switch is
3234off. It is also ignored in the @sc{acfsf}
3235@cindex @sc{acfsf}
3236context. It is ignored with the switch @code{rlqeheu}
3237@rvindex rlqeheu
3238on, which is the default for @sc{ofsf}.
3239@cindex @sc{ofsf}
3240Turning @code{rlqedfs} on makes @code{rlqe}/@code{rlqea}
3241@rfindex rlqe
3242@rfindex rlqea
3243and
3244@code{rlgqe}/@code{rlgqea}
3245@rfindex rlgqe
3246@rfindex rlgqea
3247(@pxref{Generic Quantifier Elimination}) work in a depth first search
3248manner instead of breadth first search. This saves space,
3249@cindex save space
3250and with decision problems,
3251@cindex decision problem
3252where variable-free atomic formulas can be evaluated
3253@cindex evaluate atomic formulas
3254to truth values,
3255@cindex truth value
3256it might save time.
3257@cindex save time
3258In general, it leads to larger results.
3259@end defvr
3260
3261@defvr {Advanced Switch} rlqeheu
3262@cindex heuristic
3263@cindex search heuristic
3264@cindex quantifier elimination
3265@cindex depth first search
3266@cindex breadth first search
3267Quantifier elimination search heuristic. By default this switch is on in
3268@sc{ofsf}
3269@cindex @sc{ofsf}
3270and off in @sc{dvfsf}.
3271@cindex @sc{dvfsf}
3272It is ignored in @sc{acfsf}.
3273@cindex @sc{acfsf}
3274Turning @code{rlqeheu} on causes the switch @code{rlqedfs}
3275@rvindex rlqedfs
3276to be ignored. @code{rlqe}/@code{rlqea}
3277@rfindex rlqe
3278@rfindex rlqea
3279and @code{rlgqe}/@code{rlgqea}
3280@rfindex rlgqe
3281@rfindex rlgqea
3282(@pxref{Generic Quantifier Elimination}) will then decide between
3283breadth first search and depth first search for each quantifier block,
3284@cindex quantifier block
3285where @sc{dfs} is chosen when the problem is a decision problem.
3286@cindex decision problem
3287@end defvr
3288
3289@defvr {Advanced Switch} rlqepnf
3290@cindex quantifier elimination
3291@cindex prenex normal form
3292Quantifier elimination compute prenex normal form. By default this
3293switch is on, which causes that @code{rlpnf}
3294@rfindex rlpnf
3295(@pxref{Miscellaneous Normal Forms}) is applied to @var{formula} before
3296starting the elimination process. If the argument formula to
3297@code{rlqe}/@code{rlqea}
3298@rfindex rlqe
3299@rfindex rlqea
3300or @code{rlgqe}/@code{rlgqea}
3301@rfindex rlgqe
3302@rfindex rlgqea
3303(@pxref{Generic Quantifier Elimination}) is already prenex, this switch
3304can be turned off. This may be useful with formulas containing
3305@code{equiv}
3306@rfindex equiv
3307since @code{rlpnf} applies @code{rlnnf},
3308@rfindex rlnnf
3309(@pxref{Miscellaneous Normal Forms}), and resolving equivalences can
3310double the size of a formula. @code{rlqepnf} is ignored in @sc{acfsf},
3311@cindex @sc{acfsf}
3312since @sc{nnf} is necessary for elimination there.
3313@end defvr
3314
3315@defvr {Fix Switch} rlqesr
3316@cindex separate roots
3317Quantifier elimination separate roots. This is off by default. It is
3318relevant only in @sc{ofsf}
3319@cindex @sc{ofsf}
3320for @code{rlqe}/@code{rlgqe}
3321@rfindex rlqe
3322@rfindex rlqea
3323and for all but
3324the outermost quantifier block in @code{rlqea}/@code{rlgqea}.
3325@rfindex rlgqe
3326@rfindex rlgqea
3327For @code{rlqea} and @code{rlgqea} see @ref{Generic Quantifier
3328Elimination}. It affects the technique for substituting
3329@cindex substitution
3330the two solutions of a quadratic constraint
3331@cindex quadratic constraint
3332during elimination.
3333@end defvr
3334
3335The following two functions @code{rlqeipo}
3336@rfindex rlqeipo
3337and @code{rlqews}
3338@rfindex rlqews
3339are experimental implementations. The idea there is to overcome the
3340obvious disadvantages of prenex normal forms with elimination set
3341methods. In most cases, however, the classical method @code{rlqe}
3342@rfindex rlqe
3343has turned out superior.
3344
3345@defun rlqeipo formula [@var{theory}]
3346@rtindex theory
3347@cindex quantifier elimination
3348@cindex prenex normal form
3349@cindex anti-prenex normal form
3350Quantifier elimination by virtual substitution in position. Returns a
3351quantifier-free equivalent
3352@cindex quantifier-free equivalent
3353to @var{formula} by iteratively making @var{formula} anti-prenex
3354(@pxref{Miscellaneous Normal Forms}) and eliminating one quantifier.
3355@end defun
3356
3357@defun rlqews formula [@var{theory}]
3358@rtindex theory
3359@cindex quantifier elimination
3360@cindex prenex normal form
3361@cindex anti-prenex normal form
3362Quantifier elimination by virtual substitution with selection.
3363@var{formula} has to be prenex, if the switch @code{rlqepnf}
3364@rvindex rlqepnf
3365is off. Returns a quantifier-free
3366equivalent
3367@cindex quantifier-free equivalent
3368to @var{formula} by iteratively selecting a quantifier from the
3369innermost block, moving it inside as far as possible, and then
3370eliminating it. @code{rlqews} is not available in @sc{acfsf}.
3371@cindex @sc{acfsf}
3372@end defun
3373
3374@subsection Cylindrical Algebraic Decomposition
3375@cindex cylindrical algebraic decomposition
3376
3377@defun rlcad formula
3378@cindex quantifier elimination
3379@cindex cylindrical algebraic decomposition
3380Cylindrical algebraic decomposition. Returns a quantifier-free
3381equivalent of @var{formula}. Works only in context OFSF. There are no
3382degree restrictions on @var{formula}.
3383@rvindex rlcad
3384@end defun
3385
3386@defun rlcadporder formula
3387@cindex projection order
3388Efficient projection order. Returns a list of variables. The first
3389variable is eliminated first.
3390@rvindex rlcadporder
3391@end defun
3392
3393@defun rlcadguessauto formula
3394@cindex guess full CAD size
3395Guess the size of a full CAD wrt.@: the projection order the system
3396would actually choose. The resulting value gives quickly an idea on
3397how big the order of magnitude of the size of a full CAD is.
3398@rvindex rlcadguessauto
3399@end defun
3400
3401@defvr {Advanced Switch} rlcadfac
3402Factorisation.
3403This is on by default.
3404@rvindex rlcadfac
3405@end defvr
3406
3407@defvr Switch rlcadbaseonly
3408Base phase only.
3409Turned off by default.
3410@rvindex rlcadbaseonly
3411@end defvr
3412
3413@defvr Switch rlcadprojonly
3414Projection phase only.
3415Turned off by default.
3416@rvindex rlcadprojonly
3417@end defvr
3418
3419@defvr Switch rlcadextonly
3420Extension phase only.
3421Turned off by default.
3422@rvindex rlcadextonly
3423@end defvr
3424
3425@defvr Switch rlcadpartial
3426Partial CAD.
3427This is turned on by default.
3428@rvindex rlcadpartial
3429@end defvr
3430
3431@defvr Switch rlcadte
3432Trial evaluation, the first improvement to partial CAD.
3433This is turned on by default.
3434@rvindex rlcadte
3435@end defvr
3436
3437@defvr Switch rlcadpbfvs
3438Propagation below free variable space, the second improvement to partial CAD.
3439This is turned on by default.
3440@rvindex rlcadte
3441@end defvr
3442
3443@defvr {Advanced Switch} rlcadfulldimonly
3444Full dimensional cells only. This is turned off by default. Only stacks
3445over full dimensional cells are built. Such cells have rational sample
3446points. To do this ist sound only in special cases as consistency
3447problems (existenially quantified, strict inequalities).
3448@rvindex rlcadfulldimonly
3449@end defvr
3450
3451@defvr Switch rlcadtrimtree
3452Trim tree. This is turned on by default. Frees unused part of the
3453constructed partial CAD-tree, and hence saves space. However, afterwards
3454it is not possible anymore to find out how many cells were calculated
3455beyond free variable space.
3456@rvindex rlcadtrimtree
3457@end defvr
3458
3459@defvr {Advanced Switch} rlcadrawformula
3460Raw formula. Turned off by default. If turned on, a variable-free DNF is
3461returned (if simple solution formula construction succeeds). Otherwise,
3462the raw result is simplified with @code{rldnf}.
3463@rvindex rlcadrawformula
3464@end defvr
3465
3466@defvr {Advanced Switch} rlcadisoallroots
3467Isolate all roots. This is off by default. Turning this switch on allows
3468to find out, how much time is consumed more without incremental root
3469isolation.
3470@rvindex rlcadisoallroots
3471@end defvr
3472
3473@defvr {Advanced Switch} rlcadrawformula
3474Raw formula. Turned off by default. If turned on, a variable-free DNF is
3475returned (if simple solution formula construction succeeds). Otherwise,
3476the raw result is simplified with @code{rldnf}.
3477@rvindex rlcadrawformula
3478@end defvr
3479
3480@defvr {Advanced Switch} rlcadisoallroots
3481Isolate all roots. This is off by default. Turning this switch on allows
3482to find out, how much time is consumed more without incremental root
3483isolation.
3484@rvindex rlcadisoallroots
3485@end defvr
3486
3487@defvr {Advanced Switch} rlcadaproj
3488@defvrx {Advanced Switch} rlcadaprojalways
3489Augmented projection (always). By default, @code{rlcadaproj} is turned
3490on and @code{rlcadaprojalways} is turned off. If @code{rlcadaproj} is
3491turned off, no augmented projection is performed. Otherwerwise, if
3492turned on, augmented projection is performed always (if
3493@code{rlcadaprojalways} is turned on) or just for the free variable
3494space (@code{rlcadaprojalways} turned off).
3495@rvindex rlcadaproj
3496@rvindex rlcadaprojalways
3497@end defvr
3498
3499@defvr Switch rlcadhongproj
3500Hong projection.
3501This is on by default.
3502If turned on, Hong's improvement for the projection operator is used.
3503@rvindex rlcadhongproj
3504@end defvr
3505
3506@defvr Switch rlcadverbose
3507Verbose.
3508This is off by default.
3509With @code{rladverbose} on, additional verbose information is displayed.
3510@rvindex rlcadverbose
3511@end defvr
3512
3513@defvr Switch rlcaddebug
3514Debug.
3515This is turned off by default.
3516Performes a self-test at several places, if turned on.
3517@rvindex rlcaddebug
3518@end defvr
3519
3520@defvr {Advanced Switch} rlanuexverbose
3521Verbose.
3522This is off by default.
3523With @code{ranuexverbose} on, additional verbose information is displayed.
3524Not of much importance any more.
3525@rvindex rlanuexverbose
3526@end defvr
3527
3528@defvr {Advanced Switch} rlanuexdifferentroots
3529Different roots. Unused for the moment and maybe redundant soon.
3530@rvindex rlanuexdifferentroots
3531@end defvr
3532
3533@defvr Switch rlanuexdebug
3534Debug. This is off by default.
3535Performes a self-test at several places, if turned on.
3536@rvindex rlanuexdebug
3537@end defvr
3538
3539@defvr Switch rlanuexpsremseq
3540Pseudo remainder sequences.
3541This is turned off by default.
3542This switch decides, whether division or pseudo division is used for sturm chains.
3543@rvindex rlanuexpsremseq
3544@end defvr
3545
3546@defvr {Advanced Switch} rlanuexgcdnormalize
3547GCD normalize. This is turned on by default. If turned on, the GCD is
3548normalized to 1, if it is a constant polynomial.
3549@rvindex rlanuexgcdnormalize
3550@end defvr
3551
3552@defvr {Advanced Switch} rlanuexsgnopt
3553Sign optimization.
3554This is turned off by default.
3555If turned on, it is tried to determine the sign of a constant polynomial by calculating a containment.
3556@rvindex rlanuexsgnopt
3557@end defvr
3558
3559@subsection Hermitian Quantifier Elimination
3560@cindex Hermitian quantifier elimination
3561
3562@defun rlhqe formula
3563@cindex quantifier elimination
3564@cindex Hermitian quantifier elimination
3565Hermitian quantifier elimination. Returns a quantifier-free
3566equivalent of @var{formula}. Works only in context @sc{ofsf}. There are
3567no degree restrictions on @var{formula}.
3568@rvindex rlhqe
3569@end defun
3570
3571@node Generic Quantifier Elimination
3572@section Generic Quantifier Elimination
3573
3574The following variant of @code{rlqe}
3575@rfindex rlqe
3576(@pxref{Quantifier Elimination}) enlarges the theory by inequalities,
3577i.e., @code{<>}-atomic formulas, wherever this supports the quantifier
3578elimination process. For geometric problems,
3579@cindex geometric problem
3580it has turned out that in most cases the additional assumptions made are
3581actually geometric @emph{non-degeneracy conditions}.
3582@cindex non-degeneracy conditions
3583The method has been described in detail in
3584@ifinfo
3585@ref{References,[DSW98]}.
3586@end ifinfo
3587@iftex
3588[DSW98].
3589@end iftex
3590It has also turned out useful for physical problems
3591@cindex physical problems
3592such as network
3593@ifinfo
3594analysis, see @ref{References,[Stu97]}.
3595@end ifinfo
3596@iftex
3597analysis [Stu97].
3598@cindex network analysis
3599@end iftex
3600
3601@defun rlgqe formula [@var{theory} [@var{exceptionlist}]]
3602@rtindex theory
3603@cindex geometric problem
3604@cindex generic quantifier elimination
3605Generic quantifier elimination. @code{rlgqe} is not available in
3606@sc{acfsf}
3607@cindex @sc{acfsf}
3608and @sc{dvfsf}.
3609@cindex @sc{dvfsf}
3610@var{exceptionlist} is a list of variables empty by default. Returns a
3611list @code{@{th,f@}} such that @code{th} is a superset of @var{theory}
3612adding only inequalities, and @code{f} is a quantifier-free formula
3613equivalent to @var{formula} assuming @code{th}. The added inequalities
3614contain neither bound variables nor variables from @var{exceptionlist}.
3615For restrictions and options, compare @code{rlqe} (@pxref{Quantifier
3616Elimination}).
3617@end defun
3618
3619@defun rlgqea formula [@var{theory} [@var{exceptionlist}]]
3620@rtindex theory
3621@cindex geometric problem
3622@cindex generic quantifier elimination
3623@cindex answer
3624Generic quantifier elimination with answer. @code{rlgqea} is not
3625available in @sc{acfsf}
3626@cindex @sc{acfsf}
3627and @sc{dvfsf}.
3628@cindex @sc{dvfsf}
3629@var{exceptionlist} is a list of variables empty by default. Returns a
3630list consisting of an extended theory
3631@cindex theory
3632@cindex extend theory
3633and an @var{elimination_answer}.
3634@rtindex elimination_answer
3635Compare @code{rlqea}/@code{rlgqe}
3636(@pxref{Quantifier Elimination}).
3637@end defun
3638
3639After applying generic quantifier elimination the user might feel that
3640the result is still too large while the theory is still quite weak. The
3641following function @code{rlgentheo}
3642@rfindex rlgentheo
3643simplifies a formula by making further assumptions.
3644
3645@defun rlgentheo theory formula [@var{exceptionlist}]
3646@rtindex theory
3647@cindex simplification
3648@cindex generic quantifier elimination
3649@cindex generate theory
3650Generate theory. @code{rlgentheo} is not available in @sc{dvfsf}.
3651@cindex @sc{dvfsf}
3652@var{formula} is a quantifier-free formula; @var{exceptionlist} is a
3653list of variables empty by default. @code{rlgentheo} extends
3654@var{theory}
3655@cindex extend theory
3656with inequalities not containing any variables from @var{exceptionlist}
3657as long as the simplification result is better wrt.@: this extended
3658theory. Returns a list @code{@{}extended @var{theory}, simplified
3659@var{formula}@code{@}}.
3660@end defun
3661
3662@defvr Switch rlqegenct
3663@cindex generate theory
3664@cindex complexity of terms
3665Quantifier elimination generate complex theory.
3666@cindex complex theory
3667This is on by default, which allows @code{rlgentheo}
3668@rfindex rlgentheo
3669to assume inequalities over non-monomial terms with the
3670generic quantifier elimination.
3671@end defvr
3672
3673@defun rlgcad formula
3674@rtindex theory
3675@cindex generic cylindrical algebraic decomposition
3676Generic cylindrical algebraic decomposition. @code{rlgcad} is
3677available only for @sc{ofsf}.
3678Compare @code{rlcad} (@pxref{Quantifier
3679Elimination}) and @code{rlgqe} (@pxref{Generic Quantifier
3680Elimination}).
3681@end defun
3682
3683@defun rlghqe formula
3684@rtindex theory
3685@cindex generic Hermitian quantifier elimination
3686Generic Hermitian quantifier elimination. @code{rlghqe} is
3687available only for @sc{ofsf}.
3688Compare @code{rlhqe} (@pxref{Quantifier
3689Elimination}) and  @code{rlgqe} (@pxref{Generic Quantifier
3690Elimination}).
3691@end defun
3692
3693
3694@node Local Quantifier Elimination
3695@section Local Quantifier Elimination
3696
3697In contrast to the generic quantifier elimination
3698@rfindex rlgqe
3699(@pxref{Generic Quantifier Elimination})
3700the following variant of @code{rlqe}
3701@rfindex rlqe
3702(@pxref{Quantifier Elimination}) enlarges the theory by arbitrary atomic formulas, wherever this supports the quantifier
3703elimination process. This is done in such a way that the theory holds
3704for the suggested point specified by the user.
3705The method has been described in detail in
3706@ifinfo
3707@ref{References,[DW00]}.
3708@end ifinfo
3709@iftex
3710[DW00].
3711@end iftex
3712
3713@defun rllqe formula @var{theory} @var{suggestedpoint}
3714@rtindex theory
3715@cindex local quantifier elimination
3716Local quantifier elimination. @code{rllqe} is not available in
3717@sc{acfsf}
3718@cindex @sc{acfsf}
3719and @sc{dvfsf}.
3720@cindex @sc{dvfsf}
3721@var{suggestedpoint} is a list of equations @code{var=value} where
3722@code{var} is a free variable and @code{value} is a rational number.
3723Returns a list @code{@{th,f@}} such that @code{th} is a superset of
3724@var{theory}, and @code{f} is a quantifier-free formula equivalent to
3725@var{formula} assuming @code{th}. The added inequalities contains
3726exclusively variables occuring on the left hand sides of equiations in
3727@var{suggestedpoint}. For restrictions and options, compare @code{rlqe}
3728(@pxref{Quantifier Elimination}).
3729@end defun
3730
3731@node Linear Optimization
3732@section Linear Optimization
3733
3734In the context @sc{ofsf},
3735@cindex @sc{ofsf}
3736there is a linear optimization method implemented, which uses quantifier
3737elimination
3738@cindex quantifier elimination
3739(@pxref{Quantifier Elimination}) encoding the target function by an
3740additional constraint
3741@cindex constraint
3742including a dummy variable. This optimization
3743technique has been described in
3744@ifinfo
3745@ref{References,[Wei94a]}.
3746@end ifinfo
3747@iftex
3748[Wei94a].
3749@end iftex
3750
3751@defun rlopt constraints target
3752@cindex optimization
3753@cindex linear optimization
3754Linear optimization. @code{rlopt} is available only in @sc{ofsf}.
3755@cindex @sc{ofsf}
3756@var{constraints} is a list of parameter-free atomic formulas built with
3757@code{=}, @code{<=}, or @code{>=}; @var{target} is a polynomial over the
3758rationals. @var{target} is minimized subject to @var{constraints}.
3759@cindex constraint
3760The result is either "@code{infeasible}"
3761@cindex @code{infeasible}
3762or a two-element list, the first entry of which is the optimal value,
3763and the second entry is a list of points---each one given as a
3764@var{substitution_list}---where @var{target}
3765@rtindex substitution_list
3766takes this value. The point
3767list does, however, not contain all such points. For unbound problems
3768the result is @w{@code{@{-infinity,@{@}@}}.}
3769@end defun
3770
3771@defvr Switch rlopt1s
3772@cindex optimization
3773@cindex linear optimization
3774@cindex solution
3775Optimization one solution. This is off by default. @code{rlopt1s} is
3776relevant only for @sc{ofsf}.
3777@cindex @sc{ofsf}
3778If on, @code{rlopt}
3779@rfindex rlopt
3780returns at most one solution point.
3781@end defvr
3782
3783@node References
3784@chapter References
3785Most of the references listed here are available on
3786
3787@center @t{http://www.fmi.uni-passau.de/~redlog/}.
3788
3789@table @asis
3790
3791@item [CH91]
3792George E. Collins and Hoon Hong. Partial cylindrical algebraic decomposition
3793for quantifier elimination. @cite{Journal of Symbolic
3794Computation}, 12(3):299-328, September 1991.
3795
3796@item [Dol99]
3797Andreas Dolzmann. Solving Geometric Problems with Real Quantifier
3798Elimination. Technical Report MIP-9903, FMI, Universitaet Passau,
3799D-94030 Passau, Germany, January 1999.
3800
3801@item [DGS98]
3802Andreas Dolzmann, Oliver Gloor, and Thomas Sturm. Approaches to parallel
3803quantifier elimination. In Oliver Gloor, editor, @cite{Proceedings of
3804the 1998 International Symposium on Symbolic and Algebraic Computation
3805(ISSAC 98)}, pages 88-95, Rostock, Germany, August 1998. ACM, ACM Press,
3806New York.
3807
3808@item [DS97]
3809Andreas Dolzmann and Thomas Sturm. Simplification of quantifier-free
3810formulae over ordered fields. @cite{Journal of Symbolic Computation},
381124(2):209-231, August 1997.
3812
3813@item [DS97a]
3814Andreas Dolzmann and Thomas Sturm. Redlog: Computer algebra meets computer
3815logic. @cite{ACM SIGSAM Bulletin}, 31(2):2--9, June 1997.
3816
3817@item [DS97b]
3818Andreas Dolzmann and Thomas Sturm. Guarded expressions in practice. In
3819Wolfgang W. Kuechlin, editor, @cite{Proceedings of the 1997
3820International Symposium on Symbolic and Algebraic Computation (ISSAC
382197)}, pages 376--383, New York, July 1997. ACM, ACM Press.
3822
3823@item [DS99]
3824Andreas Dolzmann and Thomas Sturm. P-adic constraint solving.
3825Technical Report MIP-9901, FMI, Universitaet Passau, D-94030
3826Passau, Germany, January 1999. To appear in the proceedings of the ISSAC
382799.
3828
3829@item [DSW98]
3830Andreas Dolzmann, Thomas Sturm, and Volker Weispfenning. A new approach
3831for automatic theorem proving in real geometry. @cite{Journal of
3832Automated Reasoning}, 21(3):357-380, December 1998.
3833
3834@item [DSW98a]
3835Andreas Dolzmann, Thomas Sturm, and Volker Weispfenning. Real quantifier
3836elimination in practice. In B. H. Matzat, G.-M. Greuel, and G. Hiss,
3837editors, @cite{Algorithmic Algebra and Number Theory}, pages 221-248.
3838Springer, Berlin, 1998.
3839
3840@item [DW00]
3841Andreas Dolzmann and Volker Weispfenning. Local Quantifier Elimination.
3842In Carlo Traverso, editor, @cite{Proceedings of the 2000 International
3843Symposium on Symbolic and Algebraic Computation (ISSAC 00)}, pages
384486-94, St Andrews, Scotland, August 2000. ACM, ACM Press, New York.
3845
3846@item [LW93]
3847Ruediger Loos and Volker Weispfenning. Applying linear quantifier
3848elimination. @cite{The Computer Journal}, 36(5):450--462, 1993. Special
3849issue on computational quantifier elimination.
3850
3851@item [Stu97]
3852Thomas Sturm. Reasoning over networks by symbolic methods. Technical
3853Report MIP-9719, FMI, Universitaet Passau, D-94030 Passau, Germany,
3854December 1997. To appear in AAECC.
3855
3856@item [Stu00]
3857Thomas Sturm. Linear problems in valued fields. @cite{Journal of Symbolic
3858Computation}, 30(2):207-219, August 2000.
3859
3860@item [SW97a]
3861Thomas Sturm and Volker Weispfenning. Rounding and blending of solids by
3862a real elimination method. In Achim Sydow, editor, @cite{Proceedings of
3863the 15th IMACS World Congress on Scientific Computation, Modelling, and
3864Applied Mathematics (IMACS 97)}, pages 727-732, Berlin, August 1997.
3865IMACS, Wissenschaft & Technik Verlag.
3866
3867@item [SW98]
3868Thomas Sturm and Volker Weispfenning. Computational geometry problems in
3869Redlog. In Dongming Wang, editor, @cite{Automated Deduction in
3870Geometry}, volume 1360 of Lecture Notes in Artificial Intelligence
3871(Subseries of LNCS), pages 58-86, Springer-Verlag Berlin Heidelberg,
38721998.
3873
3874@item [SW98a]
3875Thomas Sturm and Volker Weispfenning. An algebraic approach to
3876offsetting and blending of solids. Technical Report MIP-9804, FMI,
3877Universitaet Passau, D-94030 Passau, Germany, May 1998.
3878
3879@item [Wei88]
3880Volker Weispfenning. The complexity of linear problems in fields.
3881@cite{Journal of Symbolic Computation}, 5(1):3--27, February, 1988.
3882
3883@item [Wei92]
3884Volker Weispfenning. Comprehensive Groebner Bases.
3885@cite{Journal of Symbolic Computation}, 14:1--29, July, 1992.
3886
3887@item [Wei94a]
3888Volker Weispfenning. Parametric linear and quadratic optimization by
3889elimination. Technical Report MIP-9404, FMI, Universitaet Passau,
3890D-94030 Passau, Germany, April 1994.
3891
3892@item [Wei94b]
3893Volker Weispfenning. Quantifier elimination for real algebra---the cubic
3894case. In @cite{Proceedings of the International Symposium on Symbolic
3895and Algebraic Computation in Oxford}, pages 258--263, New York, July
38961994. ACM Press.
3897
3898@item [Wei95]
3899Volker Weispfenning. Solving parametric polynomial equations and
3900inequalities by symbolic algorithms. In J. Fleischer et al., editors,
3901@cite{Computer Algebra in Science and Engineering}, pages 163-179, World
3902Scientific, Singapore, 1995.
3903
3904@item [Wei97]
3905Volker Weispfenning. Quantifier elimination for real algebra---the
3906quadratic case and beyond. @cite{Applicable Algebra in Engineering
3907Communication and Computing}, 8(2):85-101, February 1997.
3908
3909@item [Wei97a]
3910Volker Weispfenning. Simulation and optimization by quantifier
3911elimination. @cite{Journal of Symbolic Computation}, 24(2):189-208, August
39121997.
3913
3914@item [Wei90]
3915Volker Weispfenning. The complexity of almost linear diophantine problems.
3916@cite{Journal of Symbolic Computation}, 10(5):395-403, November 1990.
3917
3918@end table
3919
3920@node Functions
3921@unnumbered Functions
3922
3923@menu
3924* Documentation of Functions::
3925* References to Functions::
3926@end menu
3927
3928@node Documentation of Functions
3929@unnumberedsec Documentation of Functions
3930@printindex fn
3931
3932@node References to Functions
3933@unnumberedsec References to Functions
3934@printindex rf
3935
3936@node Switches and Variables
3937@unnumbered Switches and Variables
3938
3939@menu
3940* Documentation of Switches and Variables::
3941* References to Switches and Variables::
3942@end menu
3943
3944@node Documentation of Switches and Variables
3945@unnumberedsec Documentation of Switches and Variables
3946@printindex vr
3947@page
3948
3949@node References to Switches and Variables
3950@unnumberedsec References to Switches and Variables
3951@printindex rv
3952
3953@node Data Structures
3954@unnumbered Data Structures
3955
3956@menu
3957* Documentation of Data Structures::
3958* References to Data Structures::
3959@end menu
3960
3961@node Documentation of Data Structures
3962@unnumberedsec Documentation of Data Structures
3963@printindex tp
3964
3965@node References to Data Structures
3966@unnumberedsec References to Data Structures
3967@printindex rt
3968
3969@node Index
3970@unnumbered Index
3971@printindex cp
3972
3973@shortcontents
3974@contents
3975@bye
3976