redlog.texi 100 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272
  1. \input texinfo
  2. @c ----------------------------------------------------------------------
  3. @c $Id: redlog.texi,v 1.12 1999/04/13 22:17:30 sturm Exp $
  4. @c ----------------------------------------------------------------------
  5. @c Copyright (c) 1995-1999 Andreas Dolzmann and Thomas Sturm
  6. @c ----------------------------------------------------------------------
  7. @c $Log: redlog.texi,v $
  8. @c Revision 1.12 1999/04/13 22:17:30 sturm
  9. @c Added remark on updates on the WWW page.
  10. @c
  11. @c Revision 1.11 1999/04/13 12:27:14 sturm
  12. @c Removed a blank line within @itemize.
  13. @c
  14. @c Revision 1.10 1999/04/11 12:50:32 sturm
  15. @c Removed reference to program documentation for now.
  16. @c
  17. @c Revision 1.9 1999/04/11 12:23:58 sturm
  18. @c Overworked once more.
  19. @c Better index.
  20. @c Ispelled again.
  21. @c
  22. @c Revision 1.8 1999/04/07 17:05:39 sturm
  23. @c Overworked chapter "Quantifier Elimination and Variants".
  24. @c Ispelled.
  25. @c
  26. @c Revision 1.7 1999/04/05 12:49:12 sturm
  27. @c Finished overworking chapter "Simplification".
  28. @c Overworked chapter "Normal Forms".
  29. @c Completely dropped chapter "Miscellaneous".
  30. @c
  31. @c Revision 1.6 1999/04/01 11:31:06 sturm
  32. @c Overworked chapter "Simplification" and changed indeces.
  33. @c
  34. @c Revision 1.5 1999/03/22 16:48:07 sturm
  35. @c Overworked chapter "Format and Handling of Formulas". There is only "Other
  36. @c Stuff" left in chapter "Miscellaneous" now.
  37. @c
  38. @c Revision 1.4 1999/03/22 14:33:20 sturm
  39. @c Updated references.
  40. @c Overworked Introduction. New section "Loading and Context Selection".
  41. @c
  42. @c Revision 1.3 1998/04/09 11:14:38 sturm
  43. @c Added documentation for switch rlqeqsc.
  44. @c
  45. @c Revision 1.2 1997/10/02 09:36:57 sturm
  46. @c Updated reference to simplification paper.
  47. @c
  48. @c Revision 1.1 1997/08/18 17:22:50 sturm
  49. @c Renamed "rl.texi" to this file "redlog.texi."
  50. @c Changes due to renaming "rl.red" to "redlog.red."
  51. @c
  52. @c ----------------------------------------------------------------------
  53. @c Revision 1.20 1997/08/14 10:10:54 sturm
  54. @c Renamed rldecdeg to rldecdeg1.
  55. @c Added service rldecdeg.
  56. @c
  57. @c Revision 1.19 1996/10/23 12:03:05 sturm
  58. @c Added "exceptionlist" paramter to rlgqe and rlgqea. Several quantifier
  59. @c blocks are treated correctly now.
  60. @c
  61. @c Revision 1.18 1996/10/22 11:17:05 dolzmann
  62. @c Adapted the documentation of the procedures rlstruct, rlifstruct to
  63. @c the new interface.
  64. @c
  65. @c Revision 1.17 1996/10/20 15:57:46 sturm
  66. @c Added documentation for the switches rlnzden, rlposden, and rladdcond.
  67. @c Added documentation for the functions rlvarl, rlfvarl, and rlbvarl.
  68. @c
  69. @c Revision 1.16 1996/10/09 14:46:29 sturm
  70. @c Corrected @settitle.
  71. @c
  72. @c Revision 1.15 1996/10/09 11:41:04 sturm
  73. @c Some more minor changes.
  74. @c
  75. @c Revision 1.14 1996/10/08 17:41:58 sturm
  76. @c Overworked the whole thing more than once.
  77. @c
  78. @c Revision 1.13 1996/10/07 21:58:39 dolzmann
  79. @c Added data structure substitution_list.
  80. @c Added documentation for rlterml, rltermml, rlifacml, rltnf, rltnft,
  81. @c rlstruct, and rlifstruct.
  82. @c
  83. @c Revision 1.12 1996/10/07 18:39:08 reiske
  84. @c Revised and corrected documentation.
  85. @c Added documentation for rlqeipo, rlqews, and rlgentheo.
  86. @c Updated documentation for tableau and Groebner simplifier.
  87. @c Added documentation for data structure "cdl" and "elimination_answer".
  88. @c
  89. @c Revision 1.11 1996/09/26 13:05:17 dolzmann
  90. @c Minor changes in description of rltab.
  91. @c
  92. @c Revision 1.10 1996/09/26 12:14:27 sturm
  93. @c Corrected wrong citation label.
  94. @c
  95. @c Revision 1.9 1996/08/01 12:05:18 reiske
  96. @c Added documentation for rlifacl and rlapnf.
  97. @c
  98. @c Revision 1.8 1996/07/14 10:04:54 dolzmann
  99. @c Updated documentation of the Groebner simplifier.
  100. @c
  101. @c Revision 1.7 1996/06/13 10:03:45 sturm
  102. @c Added documentation for data structure "theory" and for procedures
  103. @c "sub" and "rlgqe".
  104. @c Moved "rlopt" into the Chapter on QE.
  105. @c
  106. @c Revision 1.6 1996/03/12 12:55:55 sturm
  107. @c Changed title to "Redlog User Manual."
  108. @c Many changes in introductory sections: Added functionality overview,
  109. @c "Getting Started", modified the "Bug Report" section, introduced the
  110. @c notion of a "context."
  111. @c Corrected example in the description of rlpnf.
  112. @c Many changes in QE documentation chapter.
  113. @c Added documentation for data structure "multiplicity list", switch
  114. @c rlqeheu, and functions rlmatrix, rlatl, and rlatml.
  115. @c Added a "Data Structure Index."
  116. @c Added new (bibliographic) reference.
  117. @c
  118. @c Revision 1.5 1996/03/04 14:50:26 dolzmann
  119. @c Added description of switches rlgserf, rlbnfsac.
  120. @c Removed description of switch rlbnfsb.
  121. @c
  122. @c Revision 1.4 1996/02/18 15:56:46 sturm
  123. @c Adapted the documentation of rlsiexpla to new default setting T.
  124. @c
  125. @c Revision 1.3 1996/02/18 15:16:48 sturm
  126. @c Added references.
  127. @c Added introductions to chapters on QE and optimization.
  128. @c Added concept index.
  129. @c Added description of input facilities.
  130. @c Modified description of switch rlqedfs.
  131. @c Added description of switches rlbnfsb, rlbnfsm, rlsifac, rlsimpl,
  132. @c rlsipw, rlsipo.
  133. @c
  134. @c Revision 1.2 1995/08/30 07:29:18 sturm
  135. @c Many changes. Version passed to R.O.S.E. with the rl demo.
  136. @c
  137. @c Revision 1.1 1995/07/17 14:33:33 sturm
  138. @c Initial check-in.
  139. @c
  140. @c ----------------------------------------------------------------------
  141. @setfilename redlog.info
  142. @settitle @sc{redlog} User Manual
  143. @c @setchapternewpage off
  144. @smallbook
  145. @defcodeindex rf
  146. @defcodeindex rv
  147. @defcodeindex rt
  148. @ifinfo
  149. This is the documentation of @sc{redlog}, a @sc{reduce} logic package.
  150. Copyright @copyright{} 1995-1999 by Andreas Dolzmann and Thomas Sturm.
  151. @end ifinfo
  152. @titlepage
  153. @title{Redlog User Manual}
  154. @subtitle A @sc{reduce} Logic Package
  155. @subtitle Edition 2.0, for @sc{redlog} Version 2.0 (@sc{reduce} 3.7)
  156. @subtitle 15 April 1999
  157. @author by Andreas Dolzmann and Thomas Sturm
  158. @page
  159. @vskip 0pt plus 1filll
  160. Copyright @copyright{} 1995-1999 by Andreas Dolzmann and Thomas Sturm.
  161. @end titlepage
  162. @ifinfo
  163. @node Top
  164. @top REDLOG
  165. @sc{redlog} is a @sc{reduce} package containing algorithms on
  166. first-order formulas. The current version is 2.0.
  167. @end ifinfo
  168. @heading Acknowledgments
  169. We acknowledge with pleasure the superb support by Herbert Melenk and
  170. Winfried Neun of the Konrad-Zuse-Zentrum fuer Informationstechnik
  171. Berlin, Germany, during this project. Furthermore, we wish to mention
  172. numerous valuable mathematical ideas contributed by Volker Weispfenning,
  173. University of Passau, Germany.
  174. @heading Redlog Home Page
  175. @cindex @sc{www}
  176. @cindex home page
  177. There is a @sc{redlog} home page maintained at
  178. @center @t{http://www.fmi.uni-passau.de/~redlog/}.
  179. It contains information on @sc{redlog}, online versions of publications,
  180. and a collection of examples that can be computed with @sc{redlog}. This
  181. site will also be used for providing update
  182. @cindex update
  183. versions of @sc{redlog}.
  184. @heading Support
  185. @cindex support
  186. For mathematical and technical support, contact
  187. @center @t{redlog@@fmi.uni-passau.de}.
  188. @heading Bug Reports and Comments
  189. @cindex bug report
  190. Send bug reports and comments to
  191. @center @t{redlog@@fmi.uni-passau.de}.
  192. Any hint or suggestion is welcome. In particular, we are interested in
  193. practical problems to the solution of which @sc{redlog} has contributed.
  194. @menu
  195. * Introduction:: What is @sc{redlog}?
  196. * Loading and Context Selection::
  197. * Format and Handling of Formulas:: How to work with formulas.
  198. * Simplification:: Standard, tableau, and Groebner.
  199. * Normal Forms:: CNF, DNF, NNF, and PNF.
  200. * Quantifier Elimination and Variants:: Elimination set methods.
  201. * References:: Further information on @sc{redlog}.
  202. * Functions::
  203. * Switches and Variables::
  204. * Data Structures::
  205. * Index::
  206. @end menu
  207. @node Introduction
  208. @chapter Introduction
  209. @sc{redlog} stands for @emph{@sc{reduce} logic system}. It provides an
  210. extension of the computer algebra system @sc{reduce} to a @emph{computer
  211. logic system} implementing symbolic algorithms on first-order formulas
  212. wrt.@: temporarily fixed first-order languages and theories.
  213. This document serves as a user guide describing the usage of @sc{redlog}
  214. from the algebraic mode of @sc{reduce}. For a detailed
  215. description of the system design see
  216. @ifinfo
  217. @ref{References,[DS97a]}.
  218. @end ifinfo
  219. @iftex
  220. [DS97a].
  221. @end iftex
  222. @c There is an additional program documentation included in the @sc{reduce}
  223. @c distribution.
  224. An overview on some of the application areas of @sc{redlog} is given in
  225. @ifinfo
  226. @ref{References,[DSW98]}.
  227. @end ifinfo
  228. @iftex
  229. [DSW98].
  230. @end iftex
  231. See also @ref{References} for articles on @sc{redlog}
  232. applications.
  233. @menu
  234. * Contexts::
  235. * Overview::
  236. * Conventions::
  237. @end menu
  238. @node Contexts
  239. @section Contexts
  240. @cindex real numbers
  241. @cindex complex numbers
  242. @cindex p-adic number
  243. @cindex real closed field
  244. @cindex ordered field
  245. @cindex real closed field
  246. @cindex discretely valued field
  247. @cindex algebraically closed field
  248. @cindex contexts available
  249. @cindex available contexts
  250. @cindex @sc{ofsf}
  251. @cindex @sc{acfsf}
  252. @cindex @sc{dvfsf}
  253. @sc{redlog} is designed for working with several @dfn{languages} and
  254. @dfn{theories} in the sense of first-order logic. Both a language and a
  255. theory make up a context. In addition, a context determines the internal
  256. representation of terms. There are the following contexts available:
  257. @table @sc
  258. @item ofsf
  259. @sc{of} stands for @emph{ordered fields}, which is a little imprecise.
  260. The quantifier elimination actually requires the more restricted class
  261. of @emph{real closed fields}, while most of the tool-like algorithms are
  262. generally correct for ordered fields. One usually has in mind real
  263. numbers with ordering when using @sc{ofsf}.
  264. @item dvfsf
  265. @emph{Discretely valued fields}. This is for computing with formulas
  266. over classes of p-adic valued extension fields of the rationals, usually
  267. the fields of p-adic numbers for some prime p.
  268. @item acfsf
  269. @emph{Algebraically closed fields} such as the complex numbers.
  270. @end table
  271. The trailing "@sc{-sf}" stands for @emph{standard form}, which is the
  272. representation chosen for the terms within the implementation.
  273. @xref{Context Selection} for details on selecting @sc{redlog} contexts.
  274. @node Overview
  275. @section Overview
  276. @sc{redlog} origins from the implementation of quantifier elimination
  277. procedures. Successfully applying such methods to both academic and
  278. real-world problems, the authors have developed over the time a large
  279. set of formula-manipulating tools, many of which are meanwhile
  280. interesting in their own right:
  281. @itemize @bullet
  282. @item Numerous tools for comfortably inputing, decomposing, and
  283. analyzing formulas. This includes, for instance, the construction of
  284. systematic formulas via @code{for}-loops, and the extension of built-in
  285. commands such as @code{sub}
  286. @rfindex sub
  287. or @code{part}.
  288. @rfindex part
  289. @xref{Format and Handling of Formulas}.
  290. @item Several techniques for the @emph{simplification} of
  291. formulas. The simplifiers do not only operate on the boolean structure
  292. of the formulas but also discover algebraic relationships. For this
  293. purpose, we make use of advanced algebraic concepts such as Groebner
  294. basis computations. For the notion of simplification and a detailed
  295. description of the implemented techniques for the contexts @sc{ofsf}
  296. @cindex @sc{ofsf}
  297. and @sc{acfsf}
  298. @cindex @sc{acfsf}
  299. see
  300. @ifinfo
  301. @ref{References,[DS97]}.
  302. @end ifinfo
  303. @iftex
  304. [DS97].
  305. @end iftex
  306. For the @sc{dvfsf}
  307. @cindex @sc{dvfsf}
  308. context see
  309. @ifinfo
  310. @ref{References,[DS99]}.
  311. @end ifinfo
  312. @iftex
  313. [DS99].
  314. @end iftex
  315. @xref{Simplification}.
  316. @item Various @emph{normal form computations}. The
  317. @emph{@sc{cnf}/@sc{dnf}} computation includes both boolean and
  318. algebraic simplification strategies
  319. @ifinfo
  320. @ref{References,[DS97]}.
  321. @end ifinfo
  322. @iftex
  323. [DS97].
  324. @end iftex
  325. The @emph{prenex normal form} computation minimizes the number of
  326. quantifier changes. @xref{Normal Forms}.
  327. @item
  328. @cindex comprehensive Groebner Basis
  329. @cindex @sc{cgb}
  330. @emph{Quantifier elimination} computes quantifier-free
  331. equivalents for given first-order formulas.
  332. For @sc{ofsf} and
  333. @cindex @sc{ofsf}
  334. @sc{dvfsf}
  335. @cindex @sc{dvfsf}
  336. we use a technique based on elimination set ideas
  337. @ifinfo
  338. @ref{References,[Wei88]}.
  339. @end ifinfo
  340. @iftex
  341. [Wei88].
  342. @end iftex
  343. The @sc{ofsf}
  344. @cindex @sc{ofsf}
  345. implementation is restricted to at most quadratic occurrences of the
  346. quantified variables, but includes numerous heuristic strategies for
  347. coping with higher degrees. See
  348. @ifinfo
  349. @ref{References,[LW93]}, @ref{References,[Wei97]},
  350. @end ifinfo
  351. @iftex
  352. [LW93], [Wei97]
  353. @end iftex
  354. for details on the method.
  355. The @sc{dvfsf}
  356. @cindex @sc{dvfsf}
  357. implementation is restricted to formulas that are linear in the
  358. quantified variables. The method is described in detail in
  359. @ifinfo
  360. @ref{References,[Stu98]}.
  361. @end ifinfo
  362. @iftex
  363. [Stu98].
  364. @end iftex
  365. The @sc{acfsf}
  366. @cindex @sc{acfsf}
  367. quantifier elimination is based on @emph{comprehensive Groebner basis}
  368. computation. There are no degree restrictions for this context
  369. @ifinfo
  370. @ref{References,[Wei92]}.
  371. @end ifinfo
  372. @iftex
  373. [Wei92].
  374. @end iftex
  375. @xref{Quantifier Elimination}.
  376. @item
  377. @cindex geometric problem
  378. @cindex network analysis
  379. The contexts @sc{ofsf}
  380. @cindex @sc{ofsf}
  381. and @sc{acfsf}
  382. @cindex @sc{acfsf}
  383. allow a variant of quantifier
  384. elimination called @dfn{generic quantifier elimination}
  385. @ifinfo
  386. @ref{References,[DSW98]}.
  387. @end ifinfo
  388. @iftex
  389. [DSW98].
  390. @end iftex
  391. There are certain non-degeneracy assumptions made on the parameters,
  392. which considerably speeds up the elimination.
  393. For geometric theorem proving it has turned out that these assumptions
  394. correspond to reasonable geometric non-degeneracy conditions
  395. @ifinfo
  396. @ref{References,[DSW98]}.
  397. @end ifinfo
  398. @iftex
  399. [DSW98].
  400. @end iftex
  401. Generic quantifier elimination has turned out useful also for physical
  402. applications such as network analysis
  403. @ifinfo
  404. @ref{References,[Stu97]}.
  405. @end ifinfo
  406. @iftex
  407. [Stu97].
  408. @end iftex
  409. There is no generic quantifier elimination available for @sc{dvfsf}.
  410. @cindex @sc{dvfsf}
  411. @xref{Generic Quantifier Elimination}.
  412. @item The contexts @sc{ofsf}
  413. @cindex @sc{ofsf}
  414. and @sc{dvfsf}
  415. @cindex @sc{dvfsf}
  416. provide variants of (generic) quantifier elimination that additionally
  417. compute @dfn{answers}
  418. @cindex answer
  419. such as satisfying sample points for existentially
  420. quantified formulas. This has been referred to as the "extended
  421. quantifier elimination problem"
  422. @ifinfo
  423. @ref{References,[Wei97a]}.
  424. @end ifinfo
  425. @iftex
  426. [Wei97a].
  427. @end iftex
  428. @xref{Quantifier Elimination}.
  429. @item @sc{ofsf}
  430. @cindex @sc{ofsf}
  431. includes linear @emph{optimization} techniques based
  432. on quantifier elimination
  433. @ifinfo
  434. @ref{References,[Wei94a]}.
  435. @end ifinfo
  436. @iftex
  437. [Wei94a].
  438. @end iftex
  439. @xref{Linear Optimization}.
  440. @end itemize
  441. @node Conventions
  442. @section Conventions
  443. To avoid ambiguities with other packages, all @sc{redlog} functions and
  444. switches are prefixed by "@code{rl}". The remaining part of the name is
  445. explained by the first sentence of the documentation of the single
  446. functions and switches.
  447. Some of the numerous switches of @sc{redlog} have been introduced only
  448. for finding the right fine tuning of the functions, or for internal
  449. experiments. They should not be changed anymore, except for in very
  450. special situations. For an easier orientation the switches are divided
  451. into three categories for documentation:
  452. @table @dfn
  453. @item Switch
  454. @cindex switch
  455. This is an ordinary switch, which usually selects strategies appropriate
  456. for a particular input, or determines the required trade-off between
  457. computation-speed and quality of the result.
  458. @item Advanced Switch
  459. @cindex advanced Switch
  460. They are used like ordinary switches. You need, however, a good
  461. knowledge about the underlying algorithms for making use of it.
  462. @item Fix Switch
  463. @cindex fix Switch
  464. You do not want to change it.
  465. @end table
  466. @node Loading and Context Selection
  467. @chapter Loading and Context Selection
  468. @cindex starting @sc{redlog}
  469. @menu
  470. * Loading Redlog::
  471. * Context Selection::
  472. @end menu
  473. @node Loading Redlog
  474. @section Loading Redlog
  475. @cindex loading @sc{redlog}
  476. At the beginning of each session @sc{redlog} has to be loaded
  477. explicitly. This is done by inputing the command @code{load_package
  478. redlog;}
  479. @rfindex load_package
  480. from within a @sc{reduce} session.
  481. @node Context Selection
  482. @section Context Selection
  483. @cindex theory
  484. @cindex language
  485. @cindex relations
  486. @cindex predicates
  487. @cindex functions
  488. Fixing a context reflects the mathematical fact that first-order
  489. formulas are defined over fixed @dfn{languages} specifying, e.g., valid
  490. @dfn{function symbols} and @dfn{relation symbols} (@dfn{predicates}).
  491. After selecting a language, fixing a @dfn{theory} such as "the theory of
  492. ordered fields", allows to assign a semantics to the formulas. Both
  493. language and theory make up a @sc{redlog} context. In addition, a
  494. context determines the internal representation of terms.
  495. As first-order formulas are not defined unless the language is known,
  496. and meaningless unless the theory is known, it is impossible to enter a
  497. first-order formula into @sc{redlog} without specifying a context:
  498. @smallexample
  499. REDUCE 3.6, 15-Jul-95, patched to 30 Aug 98 ...
  500. 1: load_package redlog;
  501. 2: f := a=0 and b=0;
  502. ***** select a context
  503. @end smallexample
  504. @xref{Contexts} for a summary of the available contexts @sc{ofsf},
  505. @cindex @sc{ofsf}
  506. @sc{dvfsf},
  507. @cindex @sc{dvfsf}
  508. and @sc{acfsf}.
  509. @cindex @sc{acfsf}
  510. A context can be selected by the @code{rlset} command:
  511. @deffn {Function} rlset [@var{context} [@var{arguments}...]]
  512. @deffnx {Function} rlset argument-list
  513. @cindex language selection
  514. @cindex context selection
  515. @rtindex dvf_class_specification
  516. Set current context. Valid choices for @var{context} are @sc{ofsf}
  517. @cindex @sc{ofsf}
  518. (ordered fields standard form), @sc{dvfsf}
  519. @cindex @sc{dvfsf}
  520. (discretely valued fields standard form), and @sc{acfsf}
  521. @cindex @sc{acfsf}
  522. (algebraically closed fields standard form). With @sc{ofsf} and
  523. @sc{acfsf}, there are no further arguments. With @sc{dvfsf} an optional
  524. @var{dvf_class_specification} can be passed, which defaults to @code{0}.
  525. @code{rlset} returns the old setting as a list that can be saved to be
  526. passed to @code{rlset} later. When called with no arguments (or the
  527. empty list), @code{rlset} returns the current setting.
  528. @end deffn
  529. @deftp {Data Structure} {dvf_class_specification}
  530. @cindex p-adic number
  531. @cindex p-adic valuation
  532. @cindex valuation (p-adic)
  533. @cindex valued field
  534. @cindex discretely valued field
  535. Zero, or a possibly negative prime
  536. @tex
  537. $q$.
  538. @end tex
  539. @ifinfo
  540. q.
  541. @end ifinfo
  542. For
  543. @tex
  544. $q=0$
  545. @end tex
  546. @ifinfo
  547. q=0
  548. @end ifinfo
  549. all computations are uniformly correct for
  550. all
  551. @tex
  552. $p$-adic
  553. @end tex
  554. @ifinfo
  555. p-adic
  556. @end ifinfo
  557. valuations. Both input and output then possibly involve a symbolic
  558. constant
  559. @tex
  560. "$p$",
  561. @end tex
  562. @ifinfo
  563. "p",
  564. @end ifinfo
  565. which is being reserved.
  566. For positive
  567. @tex
  568. $q$,
  569. @end tex
  570. @ifinfo
  571. q,
  572. @end ifinfo
  573. all computations take place wrt.@: the corresponding
  574. @tex
  575. $q$-adic
  576. @end tex
  577. @ifinfo
  578. q-adic
  579. @end ifinfo
  580. valuation.
  581. For negative
  582. @tex
  583. $q$,
  584. @end tex
  585. @ifinfo
  586. q,
  587. @end ifinfo
  588. the
  589. @tex
  590. "$-$"
  591. @end tex
  592. @ifinfo
  593. "-"
  594. @end ifinfo
  595. can be read as ``up
  596. to'', i.e., all computations are performed in such a way that they are
  597. correct for all
  598. @tex
  599. $p$-adic
  600. @end tex
  601. @ifinfo
  602. p-adic
  603. @end ifinfo
  604. valuations with
  605. @tex
  606. $p \leq |q|$.
  607. @end tex
  608. @ifinfo
  609. p <= q.
  610. @end ifinfo
  611. In this case, the knowledge of an upper bound for
  612. @tex
  613. $p$
  614. @end tex
  615. @ifinfo
  616. p
  617. @end ifinfo
  618. supports the
  619. quantifier elimination @code{rlqe}/@code{rlqea}
  620. @rfindex rlqe
  621. @rfindex rlqea
  622. @ifinfo
  623. @ref{References,[Stu98]}.
  624. @end ifinfo
  625. @iftex
  626. [Stu98].
  627. @end iftex
  628. @xref{Quantifier Elimination}.
  629. @end deftp
  630. The user will probably have a "favorite" context reflecting their
  631. particular field of interest.
  632. To save the explicit declaration of the
  633. context with each session, @sc{redlog} provides a global variable
  634. @code{rldeflang}, which contains a default context. This variable can be
  635. set already @emph{before} loading @file{redlog}. This is typically done
  636. within the @file{.reducerc} profile:
  637. @cindex @file{.reducerc} profile
  638. @example
  639. lisp (rldeflang!* := '(ofsf));
  640. @end example
  641. Notice that the Lisp list representation has to be used here.
  642. @defvr Fluid rldeflang!*
  643. @cindex language default
  644. @cindex default language
  645. @cindex context default
  646. @cindex default context
  647. Default language. This can be bound to a default context before loading
  648. @file{redlog}. More precisely, @code{rldeflang!*} contains the arguments
  649. of @code{rlset} as a Lisp list. If @code{rldeflang!*} is non-nil,
  650. @code{rlset}
  651. @rfindex rlset
  652. is automatically executed on @code{rldeflang!*} when
  653. loading @file{redlog}.
  654. @end defvr
  655. In addition, @sc{redlog} evaluates an environment variable
  656. @code{RLDEFLANG}. This allows to fix a default context within the shell
  657. already before starting @sc{reduce}. The syntax for setting environment
  658. variables depends on the shell. For instance, in the @sc{gnu} Bash or in
  659. the csh shell one would say @code{export RLDEFLANG=ofsf} or
  660. @code{setenv RLDEFLANG ofsf}, respectively.
  661. @defvr {Environment Variable} RLDEFLANG
  662. @cindex language default
  663. @cindex default language
  664. @cindex context default
  665. @cindex default context
  666. Default language. This may be bound to a context in the sense of the
  667. first argument of @code{rlset}.
  668. @rfindex rlset
  669. With @code{RLDEFLANG} set, any
  670. @code{rldeflang!*}
  671. @rvindex rldeflang!*
  672. binding is overloaded.
  673. @end defvr
  674. @node Format and Handling of Formulas
  675. @chapter Format and Handling of Formulas
  676. After loading @sc{redlog} and selecting a context (@pxref{Loading and
  677. Context Selection}), there are @emph{first-order formulas} available as
  678. an additional type of symbolic expressions. That is, formulas are now
  679. subject to symbolic manipulation in the same way as, say, polynomials or
  680. matrices in conventional systems. There is nothing changed in the
  681. behavior of the builtin facilities and of other packages.
  682. @menu
  683. * First-order Operators::
  684. * Closures::
  685. * OFSF Operators::
  686. * DVFSF Operators::
  687. * ACFSF Operators::
  688. * Extended Built-in Commands::
  689. * Global Switches::
  690. * Basic Functions on Formulas::
  691. @end menu
  692. @node First-order Operators
  693. @section First-order Operators
  694. Though the operators @code{and}, @code{or}, and @code{not} are already
  695. sufficient for representing boolean formulas, @sc{redlog} provides a
  696. variety of other boolean operators for the convenient mnemonic input of
  697. boolean formulas.
  698. @deffn {Unary Operator} not
  699. @deffnx {n-ary Infix Operator} and
  700. @deffnx {n-ary Infix Operator} or
  701. @deffnx {Binary Infix Operator} impl
  702. @deffnx {Binary Infix Operator} repl
  703. @deffnx {Binary Infix Operator} equiv
  704. @cindex negation
  705. @cindex conjunction
  706. @cindex disjunction
  707. @cindex implication
  708. @cindex replication
  709. @cindex equivalence
  710. @cindex expression input
  711. @cindex input facilities
  712. @cindex boolean operator
  713. The infix operator precedence is from
  714. strongest to weakest: @code{and}, @code{or}, @code{impl}, @code{repl},
  715. @code{equiv}.
  716. @end deffn
  717. @xref{Extended Built-in Commands} for the description of extended
  718. @code{for}-loop
  719. @rfindex for
  720. actions that allow to comfortably input large systematic
  721. conjunctions and disjunctions.
  722. @sc{reduce} expects the user to know about the precedence of @code{and}
  723. over @code{or}. In analogy to @code{+} and @code{*}, there are thus no
  724. parentheses output around conjunctions within disjunctions. The
  725. following switch causes such subformulas to be bracketed anyway.
  726. @xref{Conventions} for the notion of a "fix switch".
  727. @defvr {Fix Switch} rlbrop
  728. @cindex bracket
  729. @cindex expression output
  730. Bracket all operators. By default this switch is on, which causes some
  731. private printing routines to be called for formulas: All subformulas are
  732. bracketed completely making the output more readable.
  733. @end defvr
  734. Besides the boolean operators introduced above, first-order logic
  735. includes the well-known @dfn{existential quantifiers} and @dfn{universal
  736. quantifiers}
  737. @tex
  738. "$\exists$" and "$\forall$".
  739. @end tex
  740. @ifinfo
  741. "@emph{exists}" and "@emph{forall}".
  742. @end ifinfo
  743. @deffn {Binary Operator} ex
  744. @deffnx {Binary Operator} all
  745. @cindex quantifier
  746. @cindex expression input
  747. @cindex input facilities
  748. These are the @dfn{quantifiers}. The first argument is the quantified
  749. variable, the second one is the matrix formula. Optionally, one can
  750. input a list of variables as first argument. This list is expanded into
  751. several nested quantifiers.
  752. @end deffn
  753. @xref{Closures} for automatically quantifying all variables except for
  754. an exclusion list.
  755. For convenience, we also have boolean constants
  756. @cindex boolean constant
  757. for the truth values.
  758. @cindex truth value
  759. @defvar true
  760. @defvarx false
  761. @cindex truth value
  762. @cindex expression input
  763. @cindex input facilities
  764. These algebraic mode variables are reserved. They serve as @dfn{truth
  765. values}.
  766. @end defvar
  767. @node Closures
  768. @section Closures
  769. @cindex closure
  770. @defun rlall formula [@var{exceptionlist}]
  771. @cindex universal closure
  772. @cindex closure
  773. @cindex quantifier
  774. @cindex expression input
  775. @cindex input facilities
  776. Universal closure. @var{exceptionlist} is a list of variables empty by
  777. default. Returns @var{formula} with all free variables universally
  778. quantified, except for those in @var{exceptionlist}.
  779. @end defun
  780. @defun rlex formula [@var{exceptionlist}]
  781. @cindex existential closure
  782. @cindex closure
  783. @cindex quantifier
  784. @cindex expression input
  785. @cindex input facilities
  786. Existential closure. @var{exceptionlist} is a list of variables empty by
  787. default. Returns @var{formula} with all free variables existentially
  788. quantified, except for those in @var{exceptionlist}.
  789. @end defun
  790. @node OFSF Operators
  791. @section OFSF Operators
  792. @cindex ordered field
  793. The @sc{ofsf}
  794. @cindex @sc{ofsf}
  795. context implements @emph{ordered fields} over the language of
  796. @emph{ordered rings}. Proceeding this way is very common in model theory
  797. since one wishes to avoid functions which are only partially defined,
  798. such as division in the language of ordered fields. Note that the
  799. @sc{ofsf} quantifier elimination procedures
  800. @cindex quantifier elimination
  801. (@pxref{Quantifier Elimination and Variants}) for non-linear formulas
  802. actually operate over
  803. @cindex real closed field
  804. @emph{real closed fields}. See @ref{Contexts} and @ref{Context
  805. Selection} for details on contexts.
  806. @deffn {Binary Infix operator} equal
  807. @deffnx {Binary Infix operator} neq
  808. @deffnx {Binary Infix operator} leq
  809. @deffnx {Binary Infix operator} geq
  810. @deffnx {Binary Infix operator} lessp
  811. @deffnx {Binary Infix operator} greaterp
  812. @cindex equation
  813. @cindex inequality
  814. @cindex ordering
  815. @cindex expression input
  816. @cindex input facilities
  817. The above operators may also be written as @code{=}, @code{<>},
  818. @code{<=}, @code{>=}, @code{<}, and @code{>}, respectively. For @sc{ofsf}
  819. @cindex @sc{ofsf}
  820. there is specified that all right hand sides must be zero. Non-zero
  821. right hand sides in the input are hence subtracted immediately to the
  822. corresponding left hand sides. There is a facility to input
  823. @emph{chains}
  824. @cindex chains of binary relations
  825. of the above relations, which are also expanded immediately:
  826. @smallexample
  827. a<>b<c>d=f
  828. @result{} a-b <> 0 and b-c < 0 and c-d > 0 and d-f = 0
  829. @end smallexample
  830. Here, only adjacent terms are related to each other.
  831. @end deffn
  832. Though we use the language of ordered rings, the input of integer
  833. reciprocals is allowed and treated correctly interpreting them as
  834. constants for rational numbers.
  835. @cindex rational numbers
  836. There are two switches that allow to
  837. input arbitrary reciprocals, which are then resolved into proper
  838. formulas in various reasonable ways. The user is welcome to experiment
  839. with switches like the following, which are not marked as @emph{fix
  840. switches}. @xref{Conventions} for the classification of @sc{redlog}
  841. switches.
  842. @defvr Switch rlnzden
  843. @defvrx Switch rlposden
  844. @cindex inverse
  845. @cindex reciprocal
  846. @cindex division
  847. @cindex denominator
  848. @cindex parametric denominator
  849. Non-zero/positive denominators. Both switches are off by default. If
  850. both @code{rlnzden} and @code{rlposden} are on, the latter is active.
  851. Activating one of them, allows the input of reciprocal terms. With
  852. @code{rlnzden} on, these terms are assumed to be non-zero, and resolved
  853. by multiplication. When occurring with ordering relations the
  854. reciprocals are resolved by multiplication with their square preserving
  855. the sign.
  856. @smallexample
  857. (a/b)+c=0 and (a/d)+c>0;
  858. 2
  859. @result{} a + b*c = 0 and a*d + c*d > 0
  860. @end smallexample
  861. Turning @code{rlposden} on, guarantees the reciprocals to be strictly
  862. positive which allows simple, i.e.@: non-square, multiplication also
  863. with ordering relations.
  864. @smallexample
  865. (a/b)+c=0 and (a/d)+c>0;
  866. @result{} a + b*c = 0 and a + c*d > 0
  867. @end smallexample
  868. @end defvr
  869. The non-zeroness or positivity assumptions made by using the above
  870. switches can be stored in a variable, and then later be passed as a
  871. @var{theory}
  872. @rtindex theory
  873. (@pxref{Standard Simplifier,theory}) to certain @sc{redlog} procedures.
  874. Optionally, the system can be forced to add them to the formula at the
  875. input stage:
  876. @defvr Switch rladdcond
  877. @cindex inverse
  878. @cindex reciprocal
  879. @cindex division
  880. Add condition. This is off by default. With @code{rladdcond} on,
  881. non-zeroness and positivity assumptions made due to the switches
  882. @code{rlnzden} and @code{rlposden}
  883. @rvindex rlnzden
  884. @rvindex rlposden
  885. are added to the formula at the input
  886. stage. With @code{rladdcond} and @code{rlposden} on we get for instance:
  887. @smallexample
  888. (a/b)+c=0 and (a/d)+c>0;
  889. @result{} (b <> 0 and a + b*c = 0) and (d > 0 and a + c*d > 0)
  890. @end smallexample
  891. @end defvr
  892. @node DVFSF Operators
  893. @section DVFSF Operators
  894. @cindex discretely valued field
  895. Discretely valued fields are implemented as a one-sorted language using
  896. the operators @code{|}, @code{||}, @code{~}, and @code{/~}, which encode
  897. @tex
  898. $\leq$, $<$, $=$, and $\neq$
  899. @end tex
  900. @ifinfo
  901. @code{<=}, @code{<}, @code{=}, and @code{<>}
  902. @end ifinfo
  903. in the value group, respectively. For details see
  904. @ifinfo
  905. @ref{References,[Wei88]}, @ref{References,[Stu98]}, or @ref{References,[DS99]}.
  906. @end ifinfo
  907. @iftex
  908. [Wei88], [Stu98], or [DS99].
  909. @end iftex
  910. @deffn {Binary Infix operator} equal
  911. @deffnx {Binary Infix operator} neq
  912. @deffnx {Binary Infix operator} div
  913. @deffnx {Binary Infix operator} sdiv
  914. @deffnx {Binary Infix operator} assoc
  915. @deffnx {Binary Infix operator} nassoc
  916. @cindex equation
  917. @cindex inequality
  918. @cindex divisibility
  919. @cindex strict divisibility
  920. @cindex weak divisibility
  921. @cindex expression input
  922. @cindex input facilities
  923. The above operators may also be written as @code{=}, @code{<>},
  924. @code{|}, @code{||}, @code{~}, and @code{/~}, respectively. Integer
  925. reciprocals in the input are resolved correctly. @sc{dvfsf}
  926. @cindex @sc{dvfsf}
  927. allows the input of @emph{chains}
  928. @cindex chains of binary relations
  929. in analogy to @sc{ofsf}.
  930. @cindex @sc{ofsf}
  931. @xref{OFSF Operators} for details.
  932. @end deffn
  933. With the @sc{dvfsf}
  934. @cindex @sc{dvfsf}
  935. operators there is no treatment of parametric denominators available.
  936. @cindex denominator
  937. @cindex parametric denominator
  938. @node ACFSF Operators
  939. @section ACFSF Operators
  940. @deffn {Binary Infix operator} equal
  941. @deffnx {Binary Infix operator} neq
  942. @cindex equation
  943. @cindex inequality
  944. @cindex expression input
  945. @cindex input facilities
  946. @cindex @sc{acfsf}
  947. The above operators may also be written as @code{=}, @code{<>}. As for
  948. @sc{ofsf},
  949. @cindex @sc{ofsf}
  950. it is specified that all right hand sides must be zero. In
  951. analogy to @sc{ofsf}, @sc{acfsf} allows also the input of @emph{chains}
  952. @cindex chains of binary relations
  953. and an appropriate treatment of parametric denominators
  954. @cindex denominator
  955. @cindex parametric denominator
  956. in the input.
  957. @xref{OFSF Operators} for details.
  958. @end deffn
  959. Note that the switch @code{rlposden}
  960. @rvindex rlposden
  961. (@pxref{OFSF Operators}) makes no
  962. sense for algebraically closed fields.
  963. @node Extended Built-in Commands
  964. @section Extended Built-in Commands
  965. Systematic conjunctions and disjunctions can be constructed in the
  966. algebraic mode in analogy to, e.g., @code{for ... sum ...}:
  967. @deffn {for loop action} mkand
  968. @deffnx {for loop action} mkor
  969. @findex for
  970. @cindex conjunction
  971. @cindex disjunction
  972. @cindex for loop action
  973. @cindex expression input
  974. @cindex input facilities
  975. Make and/or. Actions for the construction of large systematic
  976. conjunctions/disjunctions via for loops.
  977. @smallexample
  978. for i:=1:3 mkand
  979. for j:=1:3 mkor
  980. if j<>i then mkid(x,i)+mkid(x,j)=0;
  981. @result{} true and (false or false or x1 + x2 = 0
  982. or x1 + x3 = 0)
  983. and (false or x1 + x2 = 0 or false
  984. or x2 + x3 = 0)
  985. and (false or x1 + x3 = 0 or x2 + x3 = 0
  986. or false)
  987. @end smallexample
  988. @end deffn
  989. Here the truth values
  990. @cindex truth value
  991. come into existence due to the internal
  992. implementation of @code{for}-loops. They are always neutral in their
  993. context, and can be easily removed via simplification (@pxref{Standard
  994. Simplifier,function rlsimpl}, @pxref{Global Switches,switch rlsimpl}).
  995. The @sc{reduce} substitution command @code{sub}
  996. @rfindex sub
  997. can be applied to formulas using the usual syntax.
  998. @deftp {Data Structure} {substitution_list}
  999. @var{substitution_list} is a list of equations each with a kernel left
  1000. hand side.
  1001. @end deftp
  1002. @defun sub substitution_list formula
  1003. @cindex substitution
  1004. @rtindex substitution_list
  1005. Substitute. Returns the formula obtained from @var{formula}
  1006. by applying the substitutions given by @var{substitution_list}.
  1007. @smallexample
  1008. sub(a=x,ex(x,x-a<0 and all(x,x-b>0 or ex(a,a-b<0))));
  1009. @result{} ex x0 ( - x + x0 < 0 and all x0 (
  1010. - b + x0 > 0 or ex a (a - b < 0)))
  1011. @end smallexample
  1012. @code{sub} works in such a way that equivalent formulas remain
  1013. equivalent after substitution. In particular, quantifiers are treated
  1014. correctly.
  1015. @end defun
  1016. @defun part formula n1 [n2 [n3...]]
  1017. Extract a part. The @code{part} of @var{formula} is implemented
  1018. analogously to that for built-in types: in particular the 0th part is
  1019. the operator.
  1020. @end defun
  1021. @iftex
  1022. Compare @code{rlmatrix} (@pxref{Basic Functions on Formulas})
  1023. @end iftex
  1024. @ifinfo
  1025. @xref{Basic Functions on Formulas,rlmatrix},
  1026. @end ifinfo
  1027. @rfindex rlmatrix
  1028. for extracting the @emph{matrix part} of a formula, i.e., removing
  1029. @emph{all} initial quantifiers.
  1030. @defun length formula
  1031. @cindex length
  1032. Length of @var{formula}. This is the number of arguments to the
  1033. top-level operator. The length is of particular interest with the n-ary
  1034. operators @code{and}
  1035. @rfindex and
  1036. and @code{or}.
  1037. @rfindex or
  1038. Notice that @code{part(@var{formula},length(@var{formula}))}
  1039. @rfindex part
  1040. is the part of largest index.
  1041. @end defun
  1042. @node Global Switches
  1043. @section Global Switches
  1044. There are three global switches that do not belong to certain
  1045. procedures, but control the general behavior of @sc{redlog}.
  1046. @defvr Switch rlsimpl
  1047. @cindex automatic simplification
  1048. @cindex simplification
  1049. Simplify. By default this switch is off. With this switch on, the
  1050. function @code{rlsimpl}
  1051. @rfindex rlsimpl
  1052. is applied at the expression evaluation stage. @xref{Standard
  1053. Simplifier, rlsimpl}.
  1054. @end defvr
  1055. Automatically performing formula simplification at the evaluation stage
  1056. is very similar to the treatment of polynomials or rational functions,
  1057. which are converted to some normal form.
  1058. @cindex normal form
  1059. For formulas, however, the
  1060. simplified equivalent is by no means canonical.
  1061. @defvr {Switch} rlrealtime
  1062. @cindex real time
  1063. @cindex time
  1064. @cindex wall clock time
  1065. Real time. By default this switch is off. If on it protocols the wall
  1066. clock time needed for @sc{redlog} commands in seconds. In contrast to
  1067. the built-in @code{time}
  1068. @rvindex time
  1069. switch, the time is printed @emph{above} the
  1070. result.
  1071. @end defvr
  1072. @defvr {Advanced Switch} rlverbose
  1073. @cindex verbosity output
  1074. @cindex protocol
  1075. Verbose. By default this switch is off. It toggles verbosity output with
  1076. some @sc{redlog} procedures. The verbosity output itself is not
  1077. documented.
  1078. @end defvr
  1079. @node Basic Functions on Formulas
  1080. @section Basic Functions on Formulas
  1081. @defun rlatnum formula
  1082. @cindex count atomic formulas
  1083. @cindex number of atomic formulas
  1084. @cindex atomic formulas
  1085. Number of atomic formulas. Returns the number of atomic formulas
  1086. contained in @var{formula}. Mind that truth values
  1087. @cindex truth value
  1088. are not considered
  1089. atomic formulas.
  1090. @end defun
  1091. @deftp {Data Structure} {multiplicity_list}
  1092. A list of 2-element-lists containing an object and the number of its
  1093. occurrences. Names of functions returning @var{multiplicity_lists}
  1094. typically end on "ml".
  1095. @end deftp
  1096. @defun rlatl formula
  1097. @cindex atomic formula list
  1098. @cindex list of atomic formulas
  1099. @cindex set of atomic formulas
  1100. @cindex atomic formulas
  1101. List of atomic formulas. Returns the set of atomic formulas contained in
  1102. @var{formula} as a list.
  1103. @end defun
  1104. @defun rlatml formula
  1105. @cindex atomic formula multiplicity list
  1106. @cindex multiplicity list of atomic formulas
  1107. @cindex atomic formulas
  1108. @rtindex multiplicity_list
  1109. Multiplicity list of atomic formulas. Returns the atomic formulas
  1110. contained in @var{formula} in a @var{multiplicity_list}.
  1111. @end defun
  1112. @defun rlifacl formula
  1113. @cindex factors (irreducible)
  1114. @cindex irreducible factors
  1115. @cindex irreducible factors list
  1116. @cindex list of irreducible factors
  1117. @cindex set of irreducible factors
  1118. @cindex factorization
  1119. List of irreducible factors. Returns the set of all irreducible factors
  1120. of the nonzero terms occurring in @var{formula}.
  1121. @smallexample
  1122. rlifacl(x**2-1=0);
  1123. @result{} @{x + 1,x - 1@}
  1124. @end smallexample
  1125. @end defun
  1126. @defun rlifacml formula
  1127. @cindex factors (irreducible)
  1128. @cindex irreducible factors
  1129. @cindex irreducible factors multiplicity list
  1130. @cindex multiplicity list of irreducible factors
  1131. @cindex factorization
  1132. @rtindex multiplicity_list
  1133. Multiplicity list of irreducible factors. Returns the set of all
  1134. irreducible factors of the nonzero terms occurring in @var{formula} in a
  1135. @var{multiplicity_list}.
  1136. @end defun
  1137. @defun rlterml formula
  1138. @cindex term list
  1139. @cindex list of terms
  1140. List of terms. Returns the set of all nonzero terms occurring in
  1141. @var{formula}.
  1142. @end defun
  1143. @defun rltermml formula
  1144. @cindex term multiplicity list
  1145. @cindex multiplicity list of terms
  1146. @rtindex multiplicity_list
  1147. Multiplicity list of terms. Returns the set of all nonzero terms
  1148. occurring in @var{formula} in a @var{multiplicity_list}.
  1149. @end defun
  1150. @defun rlvarl formula
  1151. @cindex list(s) of variables
  1152. @cindex variable list(s)
  1153. @cindex set of variables
  1154. Variable lists. Returns both the list of variables occurring freely
  1155. @cindex free variables
  1156. and that of the variables occurring boundly
  1157. @cindex bound variables
  1158. in @var{formula} in a two-element list. Notice that the two member lists
  1159. are not necessarily disjoint.
  1160. @end defun
  1161. @defun rlfvarl formula
  1162. @cindex list(s) of variables
  1163. @cindex variable list(s)
  1164. @cindex free variables
  1165. Free variable list. Returns the variables occurring freely in
  1166. @var{formula} as a list.
  1167. @end defun
  1168. @defun rlbvarl formula
  1169. @cindex list(s) of variables
  1170. @cindex variable list(s)
  1171. @cindex bound variables
  1172. Bound variable list. Returns the variables occurring boundly in
  1173. @var{formula} as a list.
  1174. @end defun
  1175. @defun rlstruct formula [@var{kernel}]
  1176. @cindex formula structure
  1177. @cindex structure of formula
  1178. Structure of a formula. @var{kernel} is @code{v} by default. Returns a
  1179. list @code{@{f,sl@}}. @code{f} is constructed from @var{formula} by
  1180. replacing each occurrence of a term with a kernel constructed by
  1181. concatenating a number to @var{kernel}. The @var{substitution_list}
  1182. @rtindex substitution_list
  1183. @code{sl} contains all substitutions
  1184. @cindex substitution
  1185. to obtain @var{formula} from @code{f}.
  1186. @smallexample
  1187. rlstruct(x*y=0 and (x=0 or y>0),v);
  1188. @result{} @{v1 = 0 and (v2 = 0 or v3 > 0),
  1189. @{v1 = x*y,v2 = x,v3 = y@}@}
  1190. @end smallexample
  1191. @end defun
  1192. @defun rlifstruct formula [@var{kernel}]
  1193. @cindex factors (irreducible)
  1194. @cindex irreducible factors
  1195. @cindex formula structure
  1196. @cindex factorization
  1197. Irreducible factor structure of a formula. @var{kernel} is @code{v} by
  1198. default. Returns a list @code{@{f,sl@}}. @code{f} is constructed from
  1199. @var{formula} by replacing each occurrence of an irreducible factor with
  1200. a kernel constructed by adding a number to @var{kernel}. The returned
  1201. @var{substitution_list}
  1202. @rtindex substitution_list
  1203. @code{sl} contains all substitutions
  1204. @cindex substitution
  1205. to obtain @var{formula} from @code{f}.
  1206. @smallexample
  1207. rlstruct(x*y=0 and (x=0 or y>0),v);
  1208. @result{} @{v1*v2 = 0 and (v1 = 0 or v2 > 0),
  1209. @{v1 = x,v2 = y@}@}
  1210. @end smallexample
  1211. @end defun
  1212. @defun rlmatrix formula
  1213. @cindex matrix of a formula
  1214. @cindex remove quantifiers
  1215. Matrix computation. Drops all @emph{leading} quantifiers
  1216. @cindex quantifier
  1217. from @var{formula}.
  1218. @end defun
  1219. @node Simplification
  1220. @chapter Simplification
  1221. @cindex simplification
  1222. The goal of simplifying a first-order formula is to obtain an equivalent
  1223. formula over the same language that is somehow simpler. @sc{redlog}
  1224. knows three kinds of simplifiers that focus mainly on reducing the size
  1225. of the given formula: The standard simplifier, tableau simplifiers, and
  1226. Groebner simplifiers. The @sc{ofsf}
  1227. @cindex @sc{ofsf}
  1228. versions of these are described in
  1229. @iftex
  1230. [DS97].
  1231. @end iftex
  1232. @ifinfo
  1233. @ref{References,[DS97]}.
  1234. @end ifinfo
  1235. The @sc{acfsf}
  1236. @cindex @sc{acfsf}
  1237. versions are the same as the @sc{ofsf}
  1238. @cindex @sc{ofsf}
  1239. versions except for techniques that are particular to ordered fields
  1240. such as treatment of square sums in connection with ordering relations.
  1241. For @sc{dvfsf}
  1242. @cindex @sc{dvfsf}
  1243. there is no Groebner simplifier available. The parts of the standard
  1244. simplifier that are particular to valued fields are described in
  1245. @iftex
  1246. [DS99].
  1247. @end iftex
  1248. @ifinfo
  1249. @ref{References,[DS99]}.
  1250. @end ifinfo
  1251. The tableau simplification is straightforwardly derived from the
  1252. @emph{smart simplifications} described there.
  1253. @menu
  1254. * Standard Simplifier:: Fast and idempotent
  1255. * Tableau Simplifier:: Coping with often occurring terms
  1256. * Groebner Simplifier:: Detecting algebraic dependencies
  1257. @end menu
  1258. Besides reducing the size of formulas, it is a reasonable simplification
  1259. goal, to reduce the degree of the quantified variables. Our method of
  1260. decreasing the degree of quantified variables is described for @sc{ofsf}
  1261. @cindex @sc{ofsf}
  1262. in
  1263. @ifinfo
  1264. @ref{References,[DSW98]}.
  1265. @end ifinfo
  1266. @iftex
  1267. [DSW98].
  1268. @end iftex
  1269. A suitable variant is available also in @sc{acfsf}
  1270. @cindex @sc{acfsf}
  1271. but not in @sc{dvfsf}.
  1272. @cindex @sc{dvfsf}
  1273. @menu
  1274. * Degree Decreaser::
  1275. @end menu
  1276. @node Standard Simplifier
  1277. @section Standard Simplifier
  1278. The @dfn{Standard Simplifier} is a fast simplification algorithm that is
  1279. frequently called internally by other @sc{redlog} algorithms. It can be
  1280. applied automatically at the expression evaluation stage by turning on
  1281. the switch @code{rlsimpl}
  1282. @rvindex rlsimpl
  1283. (@pxref{Global Switches,switch rlsimpl}).
  1284. @deftp {Data Structure} theory
  1285. A list of atomic formulas assumed to hold.
  1286. @end deftp
  1287. @defun rlsimpl formula [@var{theory}]
  1288. @cindex simplification
  1289. @cindex standard simplifier
  1290. @rtindex theory
  1291. Simplify. @var{formula} is simplified recursively such that the result
  1292. is equivalent under the assumption that @var{theory} holds. Default for
  1293. @var{theory} is the empty theory @code{@{@}}. Theory inconsistency may
  1294. but need not be detected by @code{rlsimpl}. If @var{theory} is detected
  1295. to be inconsistent, a corresponding error is raised. Note that under an
  1296. inconsistent theory, @emph{any} formula is equivalent to the input,
  1297. i.e., the result is meaningless. @var{theory} should thus be chosen
  1298. carefully.
  1299. @end defun
  1300. @menu
  1301. * General Features of the Standard Simplifier::
  1302. * General Standard Simplifier Switches::
  1303. * OFSF-specific Simplifications::
  1304. * OFSF-specific Standard Simplifier Switches::
  1305. * ACFSF-specific Simplifications::
  1306. * ACFSF-specific Standard Simplifier Switches::
  1307. * DVFSF-specific Simplifications::
  1308. * DVFSF-specific Standard Simplifier Switches::
  1309. @end menu
  1310. @node General Features of the Standard Simplifier
  1311. @subsection General Features of the Standard Simplifier
  1312. The standard simplifier @code{rlsimpl} includes the following features
  1313. common to all contexts:
  1314. @itemize @bullet
  1315. @item
  1316. Replacement of atomic subformulas by simpler equivalents. These
  1317. equivalents are not necessarily atomic (switches @code{rlsiexpl},
  1318. @code{rlsiexpla},
  1319. @rvindex rlsiexpla
  1320. @rvindex rlsiexpl
  1321. @pxref{General Standard Simplifier Switches}). For
  1322. details on the simplification on the atomic formula level, see
  1323. @ref{OFSF-specific Simplifications}, @ref{ACFSF-specific
  1324. Simplifications}, and @ref{DVFSF-specific Simplifications}.
  1325. @item
  1326. Proper treatment of truth values.
  1327. @cindex truth value
  1328. @item
  1329. Flattening
  1330. @cindex flatten nested operators
  1331. @cindex involutive @code{not}
  1332. nested n-ary operator levels and resolving involutive
  1333. applications of @code{not}.
  1334. @rfindex not
  1335. @item
  1336. Dropping @code{not}
  1337. @rfindex not
  1338. operator with atomic formula arguments by changing
  1339. the relation of the atomic formula appropriately. The languages of all
  1340. contexts allow to do so.
  1341. @item
  1342. Changing @code{repl}
  1343. @rfindex repl
  1344. to @code{impl}.
  1345. @rfindex impl
  1346. @item
  1347. Producing a canonical ordering
  1348. @cindex canonical ordering
  1349. among the atomic formulas on a given
  1350. level (switch @code{rlsisort},
  1351. @rvindex rlsisort
  1352. @pxref{General Standard Simplifier
  1353. Switches}).
  1354. @item
  1355. Recognizing equal subformulas
  1356. @cindex equal subformulas
  1357. on a given level (switch @code{rlsichk},
  1358. @rvindex rlsichk
  1359. @pxref{General Standard Simplifier Switches}).
  1360. @item
  1361. Passing down information that is collected during recursion (switches
  1362. @code{rlsism},
  1363. @rvindex rlsism
  1364. @code{rlsiidem},
  1365. @rvindex rlsiidem
  1366. @pxref{General Standard Simplifier
  1367. Switches}). The technique of @dfn{implicit theories}
  1368. @cindex implicit theory
  1369. @cindex theory (implicit)
  1370. used for this is described in detail in
  1371. @iftex
  1372. [DS97]
  1373. @end iftex
  1374. @ifinfo
  1375. @ref{References,[DS97]},
  1376. @end ifinfo
  1377. for @sc{ofsf}/@sc{acfsf},
  1378. @cindex @sc{ofsf}
  1379. @cindex @sc{acfsf}
  1380. and in
  1381. @iftex
  1382. [DS99]
  1383. @end iftex
  1384. @ifinfo
  1385. @ref{References,[DS99]},
  1386. @end ifinfo
  1387. for @sc{dvfsf}.
  1388. @cindex @sc{dvfsf}
  1389. @item
  1390. Considering interaction of atomic formulas on the same level and
  1391. interaction with information inherited from higher levels (switch
  1392. @code{rlsism},
  1393. @rvindex rlsism
  1394. @pxref{General Standard Simplifier Switches}). The
  1395. @dfn{smart simplification}
  1396. @cindex smart simplification
  1397. techniques used for this are beyond the scope of this manual. They are
  1398. described in detail in
  1399. @iftex
  1400. [DS97]
  1401. @end iftex
  1402. @ifinfo
  1403. @ref{References,[DS97]},
  1404. @end ifinfo
  1405. for @sc{ofsf}/@sc{acfsf},
  1406. @cindex @sc{ofsf}
  1407. @cindex @sc{acfsf}
  1408. and in
  1409. @iftex
  1410. [DS99]
  1411. @end iftex
  1412. @ifinfo
  1413. @ref{References,[DS99]},
  1414. @end ifinfo
  1415. for @sc{dvfsf}.
  1416. @cindex @sc{dvfsf}
  1417. @end itemize
  1418. @node General Standard Simplifier Switches
  1419. @subsection General Standard Simplifier Switches
  1420. @defvr Switch rlsiexpla
  1421. @cindex explode terms
  1422. @cindex simplification
  1423. @cindex split atomic formula
  1424. @cindex additively split atomic formula
  1425. @cindex multiplicatively split atomic formula
  1426. Simplify explode always. By default this switch is on. It is relevant
  1427. with simplifications that allow to split one atomic formula into several
  1428. simpler ones. Consider, e.g., the following simplification toggled by
  1429. the switch @code{rlsipd}
  1430. @rvindex rlsipd
  1431. (@pxref{OFSF-specific Standard Simplifier Switches}). With
  1432. @code{rlsiexpla}
  1433. @rvindex rlsiexpla
  1434. on, we obtain:
  1435. @smallexample
  1436. f := (a - 1)**3 * (a + 1)**4 >=0;
  1437. 7 6 5 4 3 2
  1438. @result{} a + a - 3*a - 3*a + 3*a + 3*a - a - 1 >= 0
  1439. rlsimpl f;
  1440. @rfindex rlsimpl
  1441. @result{} a - 1 >= 0 or a + 1 = 0
  1442. @end smallexample
  1443. With @code{rlsiexpla} off, @code{f} will simplify as in the description
  1444. of the switch @code{rlsipd}. @code{rlsiexpla} is not used in the
  1445. @sc{dvfsf}
  1446. @cindex @sc{dvfsf}
  1447. context. The @sc{dvfsf} simplifier behaves like @code{rlsiexpla} on.
  1448. @end defvr
  1449. @defvr Switch rlsiexpl
  1450. @cindex simplification
  1451. @cindex explode terms
  1452. @cindex split atomic formula
  1453. @cindex additively split atomic formula
  1454. @cindex multiplicatively split atomic formula
  1455. Simplify explode. By default this switch is on. Its role is very similar
  1456. to that of @code{rlsiexpla},
  1457. @rvindex rlsiexpla
  1458. but it considers the operator the scope of
  1459. which the atomic formula occurs in: With @code{rlsiexpl} on
  1460. @smallexample
  1461. 7 6 5 4 3 2
  1462. a + a - 3*a - 3*a + 3*a + 3*a - a - 1 >= 0
  1463. @end smallexample
  1464. simplifies as in the description of the switch @code{rlsiexpla} whenever
  1465. it occurs in a disjunction, and it simplifies as in the description of
  1466. the switch @code{rlsipd}
  1467. @rvindex rlsipd
  1468. (@pxref{OFSF-specific Standard Simplifier Switches}) else.
  1469. @code{rlsiexpl} is not used in the @sc{dvfsf}
  1470. @cindex @sc{dvfsf}
  1471. context. The @sc{dvfsf} simplifier behaves like @code{rlsiexpla} on.
  1472. @end defvr
  1473. The user is not supposed to alter the settings of the following
  1474. @emph{fix switches} (@pxref{Conventions}):
  1475. @defvr {Fix Switch} rlsism
  1476. @cindex simplification
  1477. @cindex smart simplification
  1478. Simplify smart. By default this switch is on. See the description of the
  1479. function @code{rlsimpl}
  1480. @rfindex rlsimpl
  1481. (@pxref{Standard Simplifier}) for its effects.
  1482. @smallexample
  1483. rlsimpl(x>0 and x+1<0);
  1484. @result{} false
  1485. @end smallexample
  1486. @end defvr
  1487. @defvr {Fix Switch} rlsichk
  1488. @cindex simplification
  1489. @cindex multiple occurrences
  1490. @cindex equal subformulas
  1491. Simplify check. By default this switch is on enabling checking for equal
  1492. sibling subformulas:
  1493. @smallexample
  1494. rlsimpl((x>0 and x-1<0) or (x>0 and x-1<0));
  1495. @result{} (x>0 and x-1<0)
  1496. @rfindex rlsimpl
  1497. @end smallexample
  1498. @end defvr
  1499. @defvr {Fix Switch} rlsiidem
  1500. @cindex simplification
  1501. @cindex idempotent simplification
  1502. Simplify idempotent. By default this switch is on. It is relevant only
  1503. with switch @code{rlsism}
  1504. @rvindex rlsism
  1505. on. Its effect is that @code{rlsimpl}
  1506. @rfindex rlsimpl
  1507. (@pxref{Standard Simplifier}) is idempotent in the very most cases,
  1508. i.e., an application of @code{rlsimpl} to an already simplified formula
  1509. yields the formula itself.
  1510. @end defvr
  1511. @defvr {Fix Switch} rlsiso
  1512. @cindex simplification
  1513. @cindex sort atomic formulas
  1514. Simplify sort. By default this switch is on. It toggles the sorting of
  1515. the atomic formulas on the single levels.
  1516. @smallexample
  1517. rlsimpl((a=0 and b=0) or (b=0 and a=0));
  1518. @rfindex rlsimpl
  1519. @result{} a = 0 and b = 0
  1520. @end smallexample
  1521. @end defvr
  1522. @node OFSF-specific Simplifications
  1523. @subsection OFSF-specific Simplifications
  1524. @cindex simplification of atomic formulas
  1525. @cindex atomic formula simplification
  1526. In the @sc{ofsf}
  1527. @cindex @sc{ofsf}
  1528. context, the atomic formula simplification includes the
  1529. following:
  1530. @itemize @bullet
  1531. @item
  1532. Evaluation of variable-free atomic formulas to truth values.
  1533. @cindex evaluate atomic formulas
  1534. @cindex variable-free atomic formula
  1535. @cindex truth value
  1536. @item
  1537. Make the left hand sides primitive over the integers
  1538. @cindex primitive over the integers
  1539. with positive head coefficient.
  1540. @cindex positive head coefficient
  1541. @item
  1542. Evaluation of trivial square sums
  1543. @cindex trivial square sum
  1544. to truth values (switch
  1545. @code{rlsisqf},
  1546. @rvindex rlsisqf
  1547. @pxref{OFSF-specific Standard Simplifier Switches}).
  1548. Additive splitting of trivial square sums (switch @code{rlsitsqspl},
  1549. @rvindex rlsitsqspl
  1550. @pxref{OFSF-specific Standard Simplifier Switches}).
  1551. @item
  1552. In ordering inequalities,
  1553. @cindex ordering inequality
  1554. @cindex ordering constraint
  1555. perform parity decomposition
  1556. @cindex parity decomposition
  1557. (similar to squarefree decomposition) of terms (switch @code{rlsipd},
  1558. @rvindex rlsipd
  1559. @pxref{OFSF-specific Standard Simplifier Switches}) with the option to
  1560. split an atomic formula
  1561. @cindex split atomic formula
  1562. @cindex multiplicatively split atomic formula
  1563. multiplicatively into two simpler ones (switches
  1564. @code{rlsiexpl} and @code{rlsiexpla},
  1565. @rvindex rlsiexpl
  1566. @rvindex rlsiexpla
  1567. @pxref{General Standard Simplifier Switches}).
  1568. @item
  1569. In equations and non-ordering inequalities,
  1570. @cindex non-ordering inequalities
  1571. replace left hand sides by their squarefree parts
  1572. @cindex squarefree part
  1573. (switch @code{rlsiatdv},
  1574. @rvindex rlsiatdv
  1575. @pxref{OFSF-specific
  1576. Standard Simplifier Switches}). Optionally, perform factorization
  1577. @cindex factorization
  1578. of equations and inequalities (switch @code{rlsifac},
  1579. @rvindex rlsifac
  1580. @pxref{OFSF-specific
  1581. Standard Simplifier Switches}, switches @code{rlsiexpl} and
  1582. @code{rlsiexpla}, @pxref{General Standard Simplifier Switches}).
  1583. @end itemize
  1584. For further details on the simplification in ordered fields see the
  1585. article
  1586. @iftex
  1587. [DS97].
  1588. @end iftex
  1589. @ifinfo
  1590. @ref{References,[DS97]}.
  1591. @end ifinfo
  1592. @node OFSF-specific Standard Simplifier Switches
  1593. @subsection OFSF-specific Standard Simplifier Switches
  1594. @defvr Switch rlsipw
  1595. @cindex simplification
  1596. @cindex prefer weak orderings
  1597. @cindex weak orderings
  1598. Simplification prefer weak orderings. Prefers weak orderings in contrast
  1599. to strict orderings
  1600. @cindex strict orderings
  1601. with implicit theory
  1602. @cindex implicit theory
  1603. simplification. @code{rlsipw} is off by default, which leads to the
  1604. following behavior:
  1605. @smallexample
  1606. rlsimpl(a<>0 and (a>=0 or b=0));
  1607. @result{} a <> 0 and (a > 0 or b = 0)
  1608. @end smallexample
  1609. This meets the simplification goal of small satisfaction sets for the
  1610. atomic formulas. Turning on @code{rlsipw} will instead yield the
  1611. following:
  1612. @smallexample
  1613. rlsimpl(a<>0 and (a>0 or b=0));
  1614. @result{} a <> 0 and (a >= 0 or b = 0)
  1615. @end smallexample
  1616. @end defvr
  1617. Here we meet the simplification goal of convenient relations
  1618. @cindex convenient relations
  1619. when strict orderings are considered inconvenient.
  1620. @defvr Switch rlsipo
  1621. @cindex simplification
  1622. @cindex prefer orderings
  1623. Simplification prefer orderings. Prefers orderings in contrast to
  1624. inequalities with implicit theory
  1625. @cindex implicit theory
  1626. simplification. @code{rlsipo} is on by default, which leads to the
  1627. following behavior:
  1628. @smallexample
  1629. rlsimpl(a>=0 and (a<>0 or b=0));
  1630. @rfindex rlsimpl
  1631. @result{} a >= 0 and (a > 0 or b = 0)
  1632. @end smallexample
  1633. This meets the simplification goal of small satisfaction sets
  1634. @cindex small satisfaction sets
  1635. for the atomic formulas. Turning it on leads, e.g., to the following
  1636. behavior:
  1637. @smallexample
  1638. rlsimpl(a>=0 and (a>0 or b=0));
  1639. @rfindex rlsimpl
  1640. @result{} a >= 0 and (a <> 0 or b = 0)
  1641. @end smallexample
  1642. Here, we meet the simplification goal of convenient relations
  1643. @cindex convenient relations
  1644. when orderings are considered inconvenient.
  1645. @end defvr
  1646. @defvr Switch rlsiatadv
  1647. @cindex simplification of atomic formulas
  1648. @cindex atomic formula simplification
  1649. @cindex advanced atomic formula simplification
  1650. Simplify atomic formulas advanced. By default this switch is on. Enables
  1651. sophisticated atomic formula simplifications based on squarefree part
  1652. @cindex squarefree part
  1653. computations and recognition of trivial square sums.
  1654. @cindex trivial square sum
  1655. @smallexample
  1656. rlsimpl(a**2 + 2*a*b + b**2 <> 0);
  1657. @rfindex rlsimpl
  1658. @result{} a+b <> 0
  1659. rlsimpl(a**2 + b**2 + 1 > 0);
  1660. @result{} true
  1661. @end smallexample
  1662. Furthermore, splitting of trivial square sums
  1663. @cindex split trivial square sum
  1664. (switch @code{rlsitsqspl}),
  1665. @rvindex rlsitsqspl
  1666. parity decompositions
  1667. @cindex parity decomposition
  1668. (switch @code{rlsipd}),
  1669. @rvindex rlsipd
  1670. and factorization
  1671. @cindex factorization
  1672. of equations and inequalities (switch @code{rlsifac})
  1673. @rvindex rlsifac
  1674. are enabled.
  1675. @end defvr
  1676. @defvr Switch rlsitsqspl
  1677. @cindex trivial square sum
  1678. @cindex split trivial square sum
  1679. @cindex split atomic formula
  1680. @cindex additively split atomic formula
  1681. Simplify split trivial square sum. This is on by default. It is ignored
  1682. with @code{rlsiadv}
  1683. @rvindex rlsiadv
  1684. off. Trivial square sums are split additively
  1685. depending on @code{rlsiexpl} and @code{rlsiexpla}
  1686. @rvindex rlsiexpl
  1687. @rvindex rlsiexpla
  1688. (@pxref{General Standard Simplifier Switches}):
  1689. @smallexample
  1690. rlsimpl(a**2+b**2>0);
  1691. @rfindex rlsimpl
  1692. @result{} a <> 0 or b <> 0
  1693. @end smallexample
  1694. @end defvr
  1695. @defvr Switch rlsipd
  1696. @cindex simplification
  1697. @cindex parity decomposition
  1698. Simplify parity decomposition. By default this switch is on. It is
  1699. ignored with @code{rlsiatadv}
  1700. @rvindex rlsiatadv
  1701. off. @code{rlsipd} toggles the parity decomposition of terms occurring
  1702. with ordering relations.
  1703. @cindex ordering relations
  1704. @smallexample
  1705. f := (a - 1)**3 * (a + 1)**4 >= 0;
  1706. 7 6 5 4 3 2
  1707. @result{} a + a - 3*a - 3*a + 3*a + 3*a - a - 1 >= 0
  1708. rlsimpl f;
  1709. @rfindex rlsimpl
  1710. @group
  1711. 3 2
  1712. @result{} a + a - a - 1 >= 0
  1713. @end group
  1714. @end smallexample
  1715. The atomic formula is possibly split into two parts according to the
  1716. setting of the switches @code{rlsiexpl} and @code{rlsiexpla}
  1717. @rvindex rlsiexpl
  1718. @rvindex rlsiexpla
  1719. (@pxref{General Standard Simplifier Switches}).
  1720. @end defvr
  1721. @defvr Switch rlsifac
  1722. @cindex simplification
  1723. @cindex factorization
  1724. Simplify factorization. By default this switch is on. It is ignored with
  1725. @code{rlsiatadv}
  1726. @rvindex rlsiatadv
  1727. off. Splits
  1728. @cindex split atomic formula
  1729. @cindex multiplicatively split atomic formula
  1730. equations and inequalities via factorization of their left hand side
  1731. terms into a disjunction or a conjunction, respectively. This is done in
  1732. dependence on @code{rlsiexpl} and @code{rlsiexpla}
  1733. @rvindex rlsiexpl
  1734. @rvindex rlsiexpla
  1735. (@pxref{General Standard Simplifier Switches}).
  1736. @end defvr
  1737. @node ACFSF-specific Simplifications
  1738. @subsection ACFSF-specific Simplifications
  1739. @cindex simplification of atomic formulas
  1740. @cindex atomic formula simplification
  1741. In the @sc{acfsf}
  1742. @cindex @sc{acfsf}
  1743. case the atomic formula simplification includes the following:
  1744. @itemize @bullet
  1745. @item
  1746. Evaluation of variable-free atomic formulas to truth values.
  1747. @cindex evaluate atomic formulas
  1748. @cindex variable-free atomic formula
  1749. @cindex truth value
  1750. @item
  1751. Make the left hand sides primitive over the integers
  1752. @cindex primitive over the integers
  1753. with positive head coefficient.
  1754. @cindex positive head coefficient
  1755. @item
  1756. Replace left hand sides of atomic formulas by their squarefree parts
  1757. @cindex squarefree part
  1758. (switch @code{rlsiatdv},
  1759. @rvindex rlsiatdv
  1760. @pxref{OFSF-specific Standard Simplifier Switches}). Optionally, perform
  1761. factorization
  1762. @cindex factorization
  1763. of equations and inequalities (switch @code{rlsifac},
  1764. @rvindex rlsifac
  1765. @pxref{OFSF-specific
  1766. Standard Simplifier Switches}, switches @code{rlsiexpl}
  1767. @rvindex rlsiexpl
  1768. and @code{rlsiexpla},
  1769. @rvindex rlsiexpla
  1770. @pxref{General Standard Simplifier Switches}).
  1771. @end itemize
  1772. For details see the description of the simplification for ordered fields
  1773. in
  1774. @iftex
  1775. [DS97].
  1776. @end iftex
  1777. @ifinfo
  1778. @ref{References,[DS97]}.
  1779. @end ifinfo
  1780. This can be easily adapted to algebraically closed fields.
  1781. @node ACFSF-specific Standard Simplifier Switches
  1782. @subsection ACFSF-specific Standard Simplifier Switches
  1783. The switches @code{rlsiatadv}
  1784. @rvindex rlsiatadv
  1785. and @code{rlsifac}
  1786. @rvindex rlsifac
  1787. have the same effects as in the @sc{ofsf}
  1788. @cindex @sc{ofsf}
  1789. context (@pxref{OFSF-specific
  1790. Standard Simplifier Switches}).
  1791. @node DVFSF-specific Simplifications
  1792. @subsection DVFSF-specific Simplifications
  1793. @cindex simplification of atomic formulas
  1794. @cindex atomic formula simplification
  1795. In the @sc{dvfsf}
  1796. @cindex @sc{dvfsf}
  1797. case the atomic formula simplification includes the following:
  1798. @itemize @bullet
  1799. @item
  1800. Evaluation of variable-free atomic formulas to truth values
  1801. provided that p is known.
  1802. @cindex evaluate atomic formulas
  1803. @cindex variable-free atomic formula
  1804. @cindex truth value
  1805. @item
  1806. Equations and inequalities can be treated as in @sc{acfsf}
  1807. @cindex @sc{acfsf}
  1808. (@pxref{ACFSF-specific Simplifications}). Moreover powers of p
  1809. @cindex power of p
  1810. @cindex cancel powers of p
  1811. can be cancelled.
  1812. @item
  1813. With valuation relations,
  1814. @cindex valuation relation
  1815. the @sc{gcd}
  1816. @cindex @sc{gcd}
  1817. @cindex greatest common divisor
  1818. @cindex cancel @sc{gcd}
  1819. of both sides is cancelled and
  1820. added appropriately as an equation or inequality.
  1821. @item
  1822. Valuation relations
  1823. @cindex valuation relation
  1824. involving zero sides can be evaluated or at least
  1825. turned into equations or inequalities.
  1826. @item
  1827. For concrete p, integer coefficients with valuation relations can be
  1828. replaced by a power of p
  1829. @cindex power of p
  1830. on one side of the relation.
  1831. @item
  1832. For unspecified p, polynomials in p can often be replaced by one
  1833. monomial.
  1834. @item
  1835. For unspecified p, valuation relations containing a monomial in p on one
  1836. side, and an integer on the other side can be transformed into @code{z ~
  1837. 1} or @code{z /~ 1}, where @code{z} is an integer.
  1838. @end itemize
  1839. For details on simplification in p-adic fields see the article
  1840. @iftex
  1841. [DS99].
  1842. @end iftex
  1843. @ifinfo
  1844. @ref{References,[DS99]}.
  1845. @end ifinfo
  1846. Atomic formulas of the form @code{z ~ 1} or @code{z /~ 1}, where
  1847. @code{z} is an integer, can be split
  1848. @cindex split atomic formula
  1849. @cindex multiplicatively split atomic formula
  1850. into several ones via integer factorization.
  1851. @cindex integer factorization
  1852. @cindex factorization
  1853. This simplification is
  1854. often reasonable on final results. It explicitly discovers those primes
  1855. p for which the formula holds. There is a special function for this
  1856. simplification:
  1857. @defun rlexplats formula
  1858. @cindex explode atomic formulas
  1859. @cindex split atomic formula
  1860. @cindex multiplicatively split atomic formula
  1861. Explode atomic formulas. Factorize
  1862. @cindex integer factorization
  1863. @cindex factorization
  1864. atomic formulas of the form @code{z ~ 1} or @code{z /~ 1}, where
  1865. @code{z} is an integer. @code{rlexplats} obeys the switches
  1866. @code{rlsiexpla}
  1867. @rvindex rlsiexpla
  1868. and @code{rlsiexpl}
  1869. @rvindex rlsiexpl
  1870. (@pxref{General Standard Simplifier Switches}), but not @code{rlsifac}
  1871. @rvindex rlsifac
  1872. (@pxref{DVFSF-specific Standard Simplifier Switches}).
  1873. @end defun
  1874. @node DVFSF-specific Standard Simplifier Switches
  1875. @subsection DVFSF-specific Standard Simplifier Switches
  1876. The context @sc{dvfsf}
  1877. @cindex @sc{dvfsf}
  1878. knows no special simplifier switches, and ignores the general switches
  1879. @code{rlsiexpla}
  1880. @rvindex rlsiexpla
  1881. and @code{rlsiexpl}
  1882. @rvindex rlsiexpl
  1883. (@pxref{General Standard Simplifier Switches}). It behaves like
  1884. @code{rlsiexpla} on. The simplifier contains numerous sophisticated
  1885. simplifications for atomic formulas in the style of @code{rlsiatadv}
  1886. @rvindex rlsiatadv
  1887. on (@pxref{OFSF-specific Standard Simplifier Switches}).
  1888. @defvr Switch rlsifac
  1889. @cindex simplification
  1890. @cindex factorization
  1891. @cindex integer factorization
  1892. Simplify factorization. By default this switch is on. Toggles certain
  1893. simplifications that require @emph{integer} factorization.
  1894. @xref{DVFSF-specific Simplifications} for details.
  1895. @end defvr
  1896. @node Tableau Simplifier
  1897. @section Tableau Simplifier
  1898. Although our standard simplifier (@pxref{Standard Simplifier}) already
  1899. combines information located on different boolean levels, it preserves
  1900. the basic boolean structure of the formula. The tableau methods, in
  1901. contrast, provide a technique for changing the boolean structure
  1902. @cindex change boolean structure
  1903. of a formula by constructing case distinctions.
  1904. @cindex case distinction
  1905. Compared to the standard simplifier they are much slower.
  1906. For details on tableau simplification see
  1907. @ifinfo
  1908. @ref{References,[DS97]}.
  1909. @end ifinfo
  1910. @iftex
  1911. [DS97].
  1912. @end iftex
  1913. @deftp {Data Structure} {cdl}
  1914. Case distinction list.
  1915. @cindex case distinction
  1916. This is a list of atomic formulas considered as a disjunction.
  1917. @end deftp
  1918. @defun rltab formula cdl
  1919. @cindex simplification
  1920. @cindex tableau
  1921. @rtindex cdl
  1922. Tableau method. The result is a tableau wrt.@: @var{cdl}, i.e., a
  1923. simplified equivalent of the disjunction over the specializations wrt.@:
  1924. all atomic formulas in @var{cdl}.
  1925. @smallexample
  1926. rltab((a = 0 and (b = 0 or (d = 0 and e = 0))) or
  1927. (a = 0 and c = 0),@{a=0,a<>0@});
  1928. @result{} (a = 0 and (b = 0 or c = 0 or (d = 0 and e = 0)))
  1929. @end smallexample
  1930. @end defun
  1931. @defun rlatab formula
  1932. @cindex simplification
  1933. @cindex tableau
  1934. @cindex automatic tableau
  1935. Automatic tableau method. Tableau steps wrt.@: a case distinction over
  1936. the signs of all terms occurring in @var{formula} are computed and the
  1937. best result, i.e., the result with the minimal number of atomic formulas
  1938. is returned.
  1939. @end defun
  1940. @defun rlitab formula
  1941. @cindex simplification
  1942. @cindex tableau
  1943. @cindex iterative tableau
  1944. Iterative automatic tableau method. @var{formula} is simplified by
  1945. iterative applications of @code{rlatab}.
  1946. @rfindex rlatab
  1947. The exact procedure depends on
  1948. the switch @code{rltabib}.
  1949. @rvindex rltabib
  1950. @end defun
  1951. @defvr Switch rltabib
  1952. @cindex simplification
  1953. @cindex tableau
  1954. @cindex branch-wise tableau iteration
  1955. Tableau iterate branch-wise. By default this switch is on. It controls
  1956. the procedure @code{rlitab}.
  1957. @rfindex rlitab
  1958. If @code{rltabib} is off, @code{rlatab}
  1959. @rfindex rlatab
  1960. is iteratively applied to the argument formula as long as shorter
  1961. results can be obtained. In case @code{rltabib} is on, the corresponding
  1962. next tableau step is not applied to the last tableau result but
  1963. independently to each single branch. The iteration stops when the
  1964. obtained formula is not smaller than the corresponding input.
  1965. @end defvr
  1966. @node Groebner Simplifier
  1967. @section Groebner Simplifier
  1968. @cindex Groebner simplifier
  1969. The Groebner simplifier is not available in the @sc{dvfsf}
  1970. @cindex @sc{dvfsf}
  1971. context. It considers order theoretical and algebraic simplification
  1972. @cindex algebraic simplification
  1973. rules between the atomic formulas of the input formula. Currently the
  1974. Groebner simplifier is not idempotent. The name is derived from the main
  1975. mathematical tool used for simplification: Computing Groebner bases
  1976. @cindex Groebner basis
  1977. of certain subsets of terms occurring in the atomic formulas.
  1978. For calling the Groebner simplifier there are the following functions:
  1979. @defun rlgsc formula [@var{theory}]
  1980. @defunx rlgsd formula [@var{theory}]
  1981. @defunx rlgsn formula [@var{theory}]
  1982. @rtindex theory
  1983. @cindex normal form
  1984. @cindex boolean normal form
  1985. @cindex simplification
  1986. @cindex Groebner simplifier
  1987. @cindex polynomial reduction
  1988. @cindex reduce polynomials
  1989. Groebner simplifier. @var{formula} is a quantifier-free formula. Default
  1990. for @var{theory} is the empty theory @code{@{@}}. The functions differ
  1991. in the boolean normal form that is computed at the beginning.
  1992. @code{rlgsc} computes a conjunctive normal form,
  1993. @cindex conjunctive normal form
  1994. @cindex @sc{cnf}
  1995. @code{rlgsd} computes a disjunctive normal form,
  1996. @cindex disjunctive normal form
  1997. @cindex @sc{dnf}
  1998. and @code{rlgsn} heuristically decides for either a conjunctive or a
  1999. disjunctive normal form depending on the structure of @var{formula}.
  2000. After computing the corresponding normal form, the formula is simplified
  2001. using Groebner simplification techniques. The returned formula is
  2002. equivalent to the input formula wrt.@: @var{theory}.
  2003. @smallexample
  2004. rlgsd(x=0 and ((y = 0 and x**2+2*y > 0) or
  2005. (z=0 and x**3+z >= 0)));
  2006. @result{} x = 0 and z = 0
  2007. @end smallexample
  2008. @smallexample
  2009. rlgsc(x neq 0 or ((y neq 0 or x**2+2*x*y <= 0) and
  2010. (z neq 0 or x**3+z < 0)));
  2011. @result{} x <> 0 or z <> 0
  2012. @end smallexample
  2013. @end defun
  2014. The heuristic used by @code{rlgsn}
  2015. @rfindex rlgsn
  2016. is intended to find the smaller boolean normal form
  2017. @cindex boolean normal form
  2018. among @sc{cnf} an @sc{dnf}. Note that, anyway, the simplification of the
  2019. smaller normal form can lead to a larger final result than that of the
  2020. larger one.
  2021. The Groebner simplifiers use the Groebner package of @sc{reduce} to
  2022. compute the various Groebner bases. By default, the @code{revgradlex}
  2023. term order is used, and no optimizations of the order between the
  2024. variables are applied. The other switches and variables of the Groebner
  2025. package are not controlled by the Groebner simplifier. They can be
  2026. adjusted by the user.
  2027. In contrast to the standard simplifier @code{rlsimpl}
  2028. @rfindex rlsimpl
  2029. (@pxref{Standard Simplifier}), the Groebner simplifiers can in general
  2030. produce formulas containing more atomic formulas than the input. This
  2031. cannot happen if the switches @code{rlgsprod},
  2032. @rvindex rlgsprod
  2033. @code{rlgsred},
  2034. @rvindex rlgsred
  2035. and @code{rlgssub}
  2036. @rvindex rlgssub
  2037. are off and the input formula is a simplified boolean normal form.
  2038. The functionality of the Groebner simplifiers @code{rlgsc},
  2039. @rfindex rlgsc
  2040. @code{rlgsd},
  2041. @rfindex rlgsd
  2042. and @code{rlgsn}
  2043. @rfindex rlgsn
  2044. is controlled by numerous switches. In
  2045. most cases the default settings lead to a good simplification.
  2046. @defvr Switch rlgsrad
  2047. @cindex radical membership test
  2048. @cindex ideal membership test
  2049. Groebner simplifier radical membership test. By default this switch is
  2050. on. If the switch is on the Groebner simplifier does not only use ideal
  2051. membership tests for simplification but also radical membership tests.
  2052. This leads to better simplifications but takes considerably more time.
  2053. @end defvr
  2054. @defvr Switch rlgssub
  2055. @cindex substitution
  2056. Groebner simplifier substitute. By default this switch is on. Certain
  2057. subsets of atomic formulas are substituted by equivalent ones. Both the
  2058. number of atomic formulas and the complexity of the terms
  2059. @cindex complexity of terms
  2060. may increase or decrease independently.
  2061. @end defvr
  2062. @defvr Switch rlgsbnf
  2063. @cindex boolean normal form
  2064. @cindex normal form
  2065. Groebner simplifier boolean normal form. By default this switch is on.
  2066. Then the simplification starts with a boolean normal form computation.
  2067. If the switch is off, the simplifiers expect a boolean normal form as
  2068. the argument @var{formula}.
  2069. @end defvr
  2070. @defvr Switch rlgsred
  2071. @cindex polynomial reduction
  2072. @cindex reduce polynomials
  2073. @cindex complexity of terms
  2074. Groebner simplifier reduce polynomials. By default this switch is on. It
  2075. controls the reduction of the terms wrt.@: the computed Groebner bases.
  2076. The number of atomic formulas is never increased. Mind that by reduction
  2077. the terms can become more complicated.
  2078. @end defvr
  2079. @defvr {Advanced Switch} rlgsvb
  2080. @cindex verbosity output
  2081. @cindex protocol
  2082. Groebner simplifier verbose. By default this switch is on. It toggles
  2083. verbosity output of the Groebner simplifier. Verbosity output is given
  2084. if and only if both @code{rlverbose}
  2085. @rvindex rlverbose
  2086. (@pxref{Global Switches}) and @code{rlgsvb} are on.
  2087. @end defvr
  2088. @defvr {Advanced Switch} rlgsprod
  2089. Groebner simplifier product. By default this switch is off. If this
  2090. switch is on then conjunctions of inequalities and disjunctions of
  2091. equations are contracted
  2092. @cindex unsplit atomic formulas
  2093. @cindex contract atomic formulas
  2094. multiplicatively to one atomic formula. This reduces the number of
  2095. atomic formulas but in most cases it raises the complexity of the terms.
  2096. Most simplifications recognized by considering products are detected
  2097. also with @code{rlgsprod} off.
  2098. @end defvr
  2099. @defvr {Advanced Switch} rlgserf
  2100. Groebner simplifier evaluate reduced form.
  2101. @cindex evaluate reduced form
  2102. By default this switch is on. It controls the evaluation of the atomic
  2103. formulas
  2104. @cindex evaluate atomic formulas
  2105. to truth values.
  2106. @cindex truth value
  2107. If this switch is on, the standard simplifier (@pxref{Standard
  2108. Simplifier})
  2109. @cindex standard simplifier
  2110. is used to evaluate atomic formulas. Otherwise atomic formulas are
  2111. evaluated only if their left hand side is a domain element.
  2112. @end defvr
  2113. @defvr {Advanced Switch} rlgsutord
  2114. @cindex term order
  2115. Groebner simplifier user defined term order. By default this switch is
  2116. off. Then all Groebner basis computations and reductions
  2117. @cindex polynomial reduction
  2118. @cindex reduce polynomials
  2119. are performed with respect to the @code{revgradlex}
  2120. @cindex @code{revgradlex}
  2121. term order. If this switch is on, the Groebner simplifier minds the term
  2122. order selected with the @code{torder}
  2123. @rfindex torder
  2124. statement. For passing a variable list to @code{torder}, note that
  2125. @code{rlgsradmemv!*}
  2126. @vrindex rlgsradmemv!*
  2127. is used as the tag variable for radical membership tests.
  2128. @cindex radical membership test
  2129. @end defvr
  2130. @defvr {Fluid} rlgsradmemv!*
  2131. @cindex radical membership test
  2132. Radical membership test variable. This fluid contains the tag variable
  2133. @cindex tag variable
  2134. used for the radical membership test with switch @code{rlgsrad}
  2135. @rvindex rlgsrad
  2136. on. It can be used to pass the variable explicitly to @code{torder}
  2137. @rfindex torder
  2138. with switch @code{rlgsutord}
  2139. @rvindex rlgsutord
  2140. on.
  2141. @end defvr
  2142. @node Degree Decreaser
  2143. @section Degree Decreaser
  2144. @cindex degree
  2145. @cindex degree restriction
  2146. The quantifier elimination procedures of @sc{redlog} (@pxref{Quantifier
  2147. Elimination}) obey certain degree restrictions on the bound variables.
  2148. For this reason, there are degree-decreasing simplifiers available,
  2149. which are automatically applied by the corresponding quantifier
  2150. elimination procedures. There is no degree decreaser for the @sc{dvfsf}
  2151. @cindex @sc{dvfsf}
  2152. context available.
  2153. @defun rldecdeg formula
  2154. Decrease degrees.
  2155. @cindex decrease degree
  2156. Returns a formula equivalent to @var{formula},
  2157. hopefully decreasing the degrees of the bound variables. In the
  2158. @sc{ofsf}
  2159. @cindex @sc{ofsf}
  2160. context there are in general some sign conditions
  2161. @cindex sign conditions
  2162. on the variables added, which slightly increases the number of contained
  2163. atomic formulas.
  2164. @smallexample
  2165. rldecdeg ex(@{b,x@},m*x**4711+b**8>0);
  2166. @result{} ex b (b >= 0 and ex x (b + m*x > 0))
  2167. @end smallexample
  2168. @end defun
  2169. @defun rldecdeg1 formula [@var{varlist}]
  2170. @cindex decrease degree
  2171. Decrease degrees subroutine. This provides a low-level entry point to
  2172. the degree decreaser. The variables to be decreased are not determined
  2173. by regarding quantifiers but are explicitly given by @var{varlist},
  2174. where the empty @var{varlist} selects @emph{all} free variables of
  2175. @code{f}. The return value is a list @code{@{f,l@}}. @code{f} is a
  2176. formula, and @code{l} is a list @code{@{...,@{v,d@},...@}}, where
  2177. @code{v} is from @var{varlist} and @code{d} is an integer. @code{f} has
  2178. been obtained from @var{formula} by substituting
  2179. @cindex substitution
  2180. @code{v} for @code{v**d}. The sign conditions necessary with the
  2181. @sc{ofsf}
  2182. @cindex @sc{ofsf}
  2183. context are not generated automatically, but have to be
  2184. constructed by hand for the variables @code{v} with even degree @code{d}
  2185. in @code{l}.
  2186. @smallexample
  2187. rldecdeg1(m*x**4711+b**8>0,@{b,x@});
  2188. @result{} @{b + m*x > 0,@{@{x,4711@},@{b,8@}@}@}
  2189. @end smallexample
  2190. @end defun
  2191. @node Normal Forms
  2192. @chapter Normal Forms
  2193. @menu
  2194. * Boolean Normal Forms:: CNF and DNF
  2195. * Miscellaneous Normal Forms:: Negation, prenex, anti-prenex
  2196. @end menu
  2197. @node Boolean Normal Forms
  2198. @section Boolean Normal Forms
  2199. For computing small boolean normal forms,
  2200. @cindex boolean normal form
  2201. see also the documentation of
  2202. the procedures @code{rlgsc}
  2203. @rfindex rlgsc
  2204. and @code{rlgsd}
  2205. @rfindex rlgsd
  2206. (@ref{Groebner Simplifier}).
  2207. @defun rlcnf formula
  2208. @cindex normal form
  2209. @cindex conjunctive normal form
  2210. @cindex @sc{cnf}
  2211. Conjunctive normal form. @var{formula} is a quantifier-free formula.
  2212. Returns a conjunctive normal form of @var{formula}.
  2213. @smallexample
  2214. rlcnf(a = 0 and b = 0 or b = 0 and c = 0);
  2215. @result{} (a = 0 or c = 0) and b = 0
  2216. @end smallexample
  2217. @end defun
  2218. @defun rldnf formula
  2219. @cindex normal form
  2220. @cindex disjunctive normal form
  2221. @cindex @sc{dnf}
  2222. Disjunctive normal form. @var{formula} is a quantifier-free formula.
  2223. Returns a disjunctive normal form of @var{formula}.
  2224. @smallexample
  2225. rldnf((a = 0 or b = 0) and (b = 0 or c = 0));
  2226. @result{} (a = 0 and c = 0) or b = 0
  2227. @end smallexample
  2228. @end defun
  2229. @defvr Switch rlbnfsm
  2230. @cindex boolean normal form
  2231. @cindex smart @sc{bnf} computation
  2232. @cindex simplifier recognized implication
  2233. Boolean normal form smart. By default this switch is off. If on,
  2234. @emph{simplifier recognized implication}
  2235. @cindex simplifier recognized implication
  2236. @ifinfo
  2237. (@pxref{References,[DS97]})
  2238. @end ifinfo
  2239. @iftex
  2240. [DS97]
  2241. @end iftex
  2242. is applied by @code{rlcnf}
  2243. @rfindex rlcnf
  2244. and @code{rldnf}.
  2245. @rfindex rldnf
  2246. This leads to smaller normal forms but is considerably time consuming.
  2247. @end defvr
  2248. @defvr {Fix Switch} rlbnfsac
  2249. @cindex boolean normal form
  2250. @cindex subsumption
  2251. @cindex cut
  2252. Boolean normal forms subsumption and cut. By default this switch is on.
  2253. With boolean normal form computation, subsumption and cut strategies are
  2254. applied by @code{rlcnf}
  2255. @rfindex rlcnf
  2256. and @code{rldnf}
  2257. @rfindex rldnf
  2258. to decrease the number of clauses.
  2259. @cindex decrease number of clauses
  2260. We give an example:
  2261. @smallexample
  2262. rldnf(x=0 and y<0 or x=0 and y>0 or x=0 and y<>0 and z=0);
  2263. @result{} (x = 0 and y <> 0)
  2264. @end smallexample
  2265. @end defvr
  2266. @node Miscellaneous Normal Forms
  2267. @section Miscellaneous Normal Forms
  2268. @defun rlnnf formula
  2269. @cindex normal form
  2270. @cindex negation normal form
  2271. @cindex @sc{nnf}
  2272. Negation normal form. Returns a @dfn{negation normal form} of
  2273. @var{formula}. This is an @code{and}-@code{or}-combination of atomic
  2274. formulas. Note that in all contexts, we use languages
  2275. @cindex language
  2276. such that all
  2277. negations can be encoded by relations (@pxref{Format and Handling of
  2278. Formulas}). We give an example:
  2279. @smallexample
  2280. rlnnf(a = 0 equiv b > 0);
  2281. @result{} (a = 0 and b > 0) or (a <> 0 and b <= 0)
  2282. @end smallexample
  2283. @code{rlnnf} accepts formulas containing quantifiers, but it does not
  2284. eliminate quantifiers.
  2285. @cindex quantifier
  2286. @end defun
  2287. @defun rlpnf formula
  2288. @cindex normal form
  2289. @cindex prenex normal form
  2290. @cindex @sc{pnf}
  2291. Prenex normal form. Returns a prenex normal form of @var{formula}. The
  2292. number of quantifier changes
  2293. @cindex quantifier changes
  2294. in the result is minimal among all prenex
  2295. normal forms that can be obtained from @var{formula} by only moving
  2296. quantifiers to the outside.
  2297. When @var{formula} contains two quantifiers with the same variable such
  2298. as in
  2299. @ifinfo
  2300. @example
  2301. ex x (x = 0) and ex x (x <> 0)
  2302. @end example
  2303. @end ifinfo
  2304. @tex
  2305. $$\exists x(x = 0) \land \exists x (x \neq 0)$$
  2306. @end tex
  2307. there occurs a name conflict. It is resolved according to the following
  2308. rules:
  2309. @cindex rename variables
  2310. @cindex variable renaming
  2311. @itemize @bullet
  2312. @item Every bound variable that stands in conflict with any other
  2313. variable is renamed.
  2314. @item Free variables are never renamed.
  2315. @end itemize
  2316. Hence @code{rlpnf} applied to the above example formula yields
  2317. @smallexample
  2318. rlpnf(ex(x,x=0) and ex(x,x<>0));
  2319. @result{} ex x0 ex x1 (x0 = 0 and x1 <> 0)
  2320. @end smallexample
  2321. @end defun
  2322. @defun rlapnf formula
  2323. @cindex anti-prenex normal form
  2324. @cindex move quantifiers inside
  2325. @cindex prenex normal form
  2326. Anti-prenex normal form. Returns a formula equivalent to @var{formula}
  2327. where all quantifiers are moved to the inside as far as possible.
  2328. @cindex quantifier
  2329. @cindex move quantifiers inside
  2330. @smallexample
  2331. rlapnf ex(x,all(y,x=0 or (y=0 and x=z)));
  2332. @result{} ex x (x = 0) or (all y (y = 0) and ex x (x - z = 0))
  2333. @end smallexample
  2334. @end defun
  2335. @defun rltnf formula terml
  2336. @cindex normal form
  2337. @cindex term normal form
  2338. Term normal form. @var{terml} is a list of terms. This combines @sc{dnf}
  2339. @cindex @sc{dnf}
  2340. @cindex disjunctive normal form
  2341. computation with tableau
  2342. @cindex tableau
  2343. ideas (@pxref{Tableau Simplifier}). A typical
  2344. choice for @var{terml} is @code{rlterml} @var{formula}.
  2345. @rfindex rlterml
  2346. If the switch @code{rltnft}
  2347. @rvindex rltnft
  2348. is off, then @code{rltnf(@var{formula},rlterml @var{formula})} returns a
  2349. @sc{dnf}.
  2350. @end defun
  2351. @defvr Switch rltnft
  2352. @cindex term normal form
  2353. Term normal form tree variant. By default this switch is on causing
  2354. @code{rltnf} to return a deeply nested formula.
  2355. @cindex deeply nested formula
  2356. @end defvr
  2357. @node Quantifier Elimination and Variants
  2358. @chapter Quantifier Elimination and Variants
  2359. @cindex comprehensive Groebner Basis
  2360. @cindex @sc{cgb}
  2361. @emph{Quantifier elimination} computes quantifier-free equivalents
  2362. @cindex quantifier-free equivalent
  2363. for given first-order formulas. For @sc{ofsf}
  2364. @cindex @sc{ofsf}
  2365. and @sc{dvfsf}
  2366. @cindex @sc{dvfsf}
  2367. we use a technique based on elimination set
  2368. @cindex elimination set
  2369. ideas
  2370. @ifinfo
  2371. @ref{References,[Wei88]}.
  2372. @end ifinfo
  2373. @iftex
  2374. [Wei88].
  2375. @end iftex
  2376. The @sc{ofsf}
  2377. @cindex @sc{ofsf}
  2378. implementation is restricted to at most quadratic occurrences of the
  2379. quantified variables, but includes numerous heuristic strategies for
  2380. coping with higher degrees. See
  2381. @ifinfo
  2382. @ref{References,[LW93]}, @ref{References,[Wei97]},
  2383. @end ifinfo
  2384. @iftex
  2385. [LW93], [Wei97]
  2386. @end iftex
  2387. for details on the method.
  2388. The @sc{dvfsf}
  2389. @cindex @sc{dvfsf}
  2390. implementation is restricted to formulas that are linear in the
  2391. quantified variables; the method is described in detail in
  2392. @ifinfo
  2393. @ref{References,[Stu98]}.
  2394. @end ifinfo
  2395. @iftex
  2396. [Stu98].
  2397. @end iftex
  2398. The @sc{acfsf}
  2399. @cindex @sc{acfsf}
  2400. quantifier elimination is based on @emph{comprehensive
  2401. Groebner basis}
  2402. @cindex comprehensive Groebner basis
  2403. computation; there are no degree restrictions
  2404. @cindex degree restriction
  2405. for this context
  2406. @ifinfo
  2407. @ref{References,[Wei92]}.
  2408. @end ifinfo
  2409. @iftex
  2410. [Wei92].
  2411. @end iftex
  2412. @menu
  2413. * Quantifier Elimination::
  2414. * Generic Quantifier Elimination::
  2415. * Linear Optimization::
  2416. @end menu
  2417. @node Quantifier Elimination
  2418. @section Quantifier Elimination
  2419. @defun rlqe formula [@var{theory}]
  2420. @rtindex theory
  2421. @cindex quantifier elimination
  2422. Quantifier elimination. Returns a quantifier-free equivalent
  2423. @cindex quantifier-free equivalent
  2424. of @var{formula} (wrt.@: @var{theory}). In the contexts @sc{ofsf}
  2425. @cindex @sc{ofsf}
  2426. and @sc{dvfsf},
  2427. @cindex @sc{dvfsf}
  2428. @var{formula} has to obey certain degree restrictions.
  2429. @cindex degree restriction
  2430. There are various techniques for decreasing the degree
  2431. @cindex decrease degree
  2432. of the input and of intermediate results built in. In case that not all
  2433. variables can be eliminated, the resulting formula is not
  2434. quantifier-free but still equivalent.
  2435. @end defun
  2436. For degree decreasing
  2437. @cindex decrease degree
  2438. heuristics see, e.g., @ref{Degree Decreaser}, or the switches
  2439. @code{rlqeqsc}/@code{rlqesqsc}.
  2440. @rvindex rlqeqsc
  2441. @rvindex rlqesqsc
  2442. @deftp {Data Structure} {elimination_answer}
  2443. A list of @dfn{condition--solution pairs},
  2444. @cindex condition--solution pairs
  2445. i.e., a list of pairs consisting of a quantifier-free formula and a set
  2446. of equations.
  2447. @end deftp
  2448. @defun rlqea formula [@var{theory}]
  2449. @rtindex theory
  2450. @cindex quantifier elimination
  2451. @cindex solution points
  2452. @cindex extended quantifier elimination
  2453. @cindex answer
  2454. @cindex sample solution
  2455. @rtindex elimination_answer
  2456. Quantifier elimination with answer. Returns an
  2457. @ifinfo
  2458. @var{elimination_answer}
  2459. @end ifinfo
  2460. @iftex
  2461. @var{elim@-i@-na@-tion_an@-swer}
  2462. @end iftex
  2463. obtained the following way: @var{formula} is wlog.@: prenex. All
  2464. quantifier blocks but the outermost one are eliminated. For this
  2465. outermost block, the constructive information obtained by the
  2466. elimination is saved:
  2467. @itemize @bullet
  2468. @item In case the considered block is existential, for each evaluation
  2469. of the free variables we know the following: Whenever a @dfn{condition}
  2470. holds, then @var{formula} is @code{true}
  2471. @rvindex true
  2472. under the given evaluation, and the
  2473. @dfn{solution}
  2474. @cindex solution
  2475. is @emph{one} possible evaluation for the outer block variables
  2476. satisfying the matrix.
  2477. @item The universally quantified case is dual: Whenever a @dfn{condition}
  2478. is false, then @var{formula} is @code{false},
  2479. @rvindex false
  2480. and the @dfn{solution} is @emph{one} possible counterexample.
  2481. @cindex counterexample
  2482. @end itemize
  2483. As an example we show how to find conditions and solutions for a system
  2484. of two linear constraints:
  2485. @smallexample
  2486. rlqea ex(x,x+b1>=0 and a2*x+b2<=0);
  2487. 2 - b2
  2488. @result{} @{@{a2 *b1 - a2*b2 >= 0 and a2 <> 0,@{x = -------@}@},
  2489. a2
  2490. @{a2 < 0 or (a2 = 0 and b2 <= 0),@{x = infinity1@}@}@}
  2491. @end smallexample
  2492. The answer can contain constants named @code{infinity}
  2493. @cindex @code{infinity}
  2494. or @code{epsilon},
  2495. @cindex @code{epsilon}
  2496. both indexed by a number: All @code{infinity}'s are positive and
  2497. infinite, and all @code{epsilon}'s are positive and infinitesimal wrt.@:
  2498. the considered field. Nothing is known about the ordering among the
  2499. @code{infinity}'s and @code{epsilon}'s though this can be relevant for
  2500. the points to be solutions. With the switch @code{rounded}
  2501. @rvindex rounded
  2502. on, the @code{epsilon}'s are evaluated to zero. @code{rlqea} is not
  2503. available in the context @sc{acfsf}.
  2504. @cindex @sc{acfsf}
  2505. @end defun
  2506. @defvr {Switch} rlqeqsc
  2507. @defvrx Switch rlqesqsc
  2508. @cindex quantifier elimination
  2509. @cindex quadratic special case
  2510. @cindex super quadratic special case
  2511. Quantifier elimination (super) quadratic special case. By default these
  2512. switches are off. They are relevant only in @sc{ofsf}.
  2513. @cindex @sc{ofsf}
  2514. If turned on, alternative elimination sets are used for certain special
  2515. cases by @code{rlqe}/@code{rlqea}
  2516. @rfindex rlqe
  2517. @rfindex rlqea
  2518. and @code{rlgqe}/@code{rlgqea}.
  2519. @rfindex rlgqe
  2520. @rfindex rlgqea
  2521. (@pxref{Generic Quantifier Elimination}). They will possibly avoid
  2522. violations of the degree restrictions,
  2523. @cindex degree restriction
  2524. but lead to larger results in general. Former versions of @sc{redlog}
  2525. without these switches behaved as if @code{rlqeqsc} was on and
  2526. @code{rlqesqsc} was off.
  2527. @end defvr
  2528. @defvr {Advanced Switch} rlqedfs
  2529. @cindex quantifier elimination
  2530. @cindex depth first search
  2531. @cindex breadth first search
  2532. Quantifier elimination depth first search. By default this switch is
  2533. off. It is also ignored in the @sc{acfsf}
  2534. @cindex @sc{acfsf}
  2535. context. It is ignored with the switch @code{rlqeheu}
  2536. @rvindex rlqeheu
  2537. on, which is the default for @sc{ofsf}.
  2538. @cindex @sc{ofsf}
  2539. Turning @code{rlqedfs} on makes @code{rlqe}/@code{rlqea}
  2540. @rfindex rlqe
  2541. @rfindex rlqea
  2542. and
  2543. @code{rlgqe}/@code{rlgqea}
  2544. @rfindex rlgqe
  2545. @rfindex rlgqea
  2546. (@pxref{Generic Quantifier Elimination}) work in a depth first search
  2547. manner instead of breadth first search. This saves space,
  2548. @cindex save space
  2549. and with decision problems,
  2550. @cindex decision problem
  2551. where variable-free atomic formulas can be evaluated
  2552. @cindex evaluate atomic formulas
  2553. to truth values,
  2554. @cindex truth value
  2555. it might save time.
  2556. @cindex save time
  2557. In general, it leads to larger results.
  2558. @end defvr
  2559. @defvr {Advanced Switch} rlqeheu
  2560. @cindex heuristic
  2561. @cindex search heuristic
  2562. @cindex quantifier elimination
  2563. @cindex depth first search
  2564. @cindex breadth first search
  2565. Quantifier elimination search heuristic. By default this switch is on in
  2566. @sc{ofsf}
  2567. @cindex @sc{ofsf}
  2568. and off in @sc{dvfsf}.
  2569. @cindex @sc{dvfsf}
  2570. It is ignored in @sc{acfsf}.
  2571. @cindex @sc{acfsf}
  2572. Turning @code{rlqeheu} on causes the switch @code{rlqedfs}
  2573. @rvindex rlqedfs
  2574. to be ignored. @code{rlqe}/@code{rlqea}
  2575. @rfindex rlqe
  2576. @rfindex rlqea
  2577. and @code{rlgqe}/@code{rlgqea}
  2578. @rfindex rlgqe
  2579. @rfindex rlgqea
  2580. (@pxref{Generic Quantifier Elimination}) will then decide between
  2581. breadth first search and depth first search for each quantifier block,
  2582. @cindex quantifier block
  2583. where @sc{dfs} is chosen when the problem is a decision problem.
  2584. @cindex decision problem
  2585. @end defvr
  2586. @defvr {Advanced Switch} rlqepnf
  2587. @cindex quantifier elimination
  2588. @cindex prenex normal form
  2589. Quantifier elimination compute prenex normal form. By default this
  2590. switch is on, which causes that @code{rlpnf}
  2591. @rfindex rlpnf
  2592. (@pxref{Miscellaneous Normal Forms}) is applied to @var{formula} before
  2593. starting the elimination process. If the argument formula to
  2594. @code{rlqe}/@code{rlqea}
  2595. @rfindex rlqe
  2596. @rfindex rlqea
  2597. or @code{rlgqe}/@code{rlgqea}
  2598. @rfindex rlgqe
  2599. @rfindex rlgqea
  2600. (@pxref{Generic Quantifier Elimination}) is already prenex, this switch
  2601. can be turned off. This may be useful with formulas containing
  2602. @code{equiv}
  2603. @rfindex equiv
  2604. since @code{rlpnf} applies @code{rlnnf},
  2605. @rfindex rlnnf
  2606. (@pxref{Miscellaneous Normal Forms}), and resolving equivalences can
  2607. double the size of a formula. @code{rlqepnf} is ignored in @sc{acfsf},
  2608. @cindex @sc{acfsf}
  2609. since @sc{nnf} is necessary for elimination there.
  2610. @end defvr
  2611. @defvr {Fix Switch} rlqesr
  2612. @cindex separate roots
  2613. Quantifier elimination separate roots. This is off by default. It is
  2614. relevant only in @sc{ofsf}
  2615. @cindex @sc{ofsf}
  2616. for @code{rlqe}/@code{rlgqe}
  2617. @rfindex rlqe
  2618. @rfindex rlqea
  2619. and for all but
  2620. the outermost quantifier block in @code{rlqea}/@code{rlgqea}.
  2621. @rfindex rlgqe
  2622. @rfindex rlgqea
  2623. For @code{rlqea} and @code{rlgqea} see @ref{Generic Quantifier
  2624. Elimination}. It affects the technique for substituting
  2625. @cindex substitution
  2626. the two solutions of a quadratic constraint
  2627. @cindex quadratic constraint
  2628. during elimination.
  2629. @end defvr
  2630. The following two functions @code{rlqeipo}
  2631. @rfindex rlqeipo
  2632. and @code{rlqews}
  2633. @rfindex rlqews
  2634. are experimental implementations. The idea there is to overcome the
  2635. obvious disadvantages of prenex normal forms with elimination set
  2636. methods. In most cases, however, the classical method @code{rlqe}
  2637. @rfindex rlqe
  2638. has turned out superior.
  2639. @defun rlqeipo formula [@var{theory}]
  2640. @rtindex theory
  2641. @cindex quantifier elimination
  2642. @cindex prenex normal form
  2643. @cindex anti-prenex normal form
  2644. Quantifier elimination in position. Returns a quantifier-free equivalent
  2645. @cindex quantifier-free equivalent
  2646. to @var{formula} by iteratively making @var{formula} anti-prenex
  2647. (@pxref{Miscellaneous Normal Forms}) and eliminating one quantifier.
  2648. @end defun
  2649. @defun rlqews formula [@var{theory}]
  2650. @rtindex theory
  2651. @cindex quantifier elimination
  2652. @cindex prenex normal form
  2653. @cindex anti-prenex normal form
  2654. Quantifier elimination with selection. @var{formula} has to be prenex,
  2655. if the switch @code{rlqepnf}
  2656. @rvindex rlqepnf
  2657. is off. Returns a quantifier-free
  2658. equivalent
  2659. @cindex quantifier-free equivalent
  2660. to @var{formula} by iteratively selecting a quantifier from the
  2661. innermost block, moving it inside as far as possible, and then
  2662. eliminating it. @code{rlqews} is not available in @sc{acfsf}.
  2663. @cindex @sc{acfsf}
  2664. @end defun
  2665. @node Generic Quantifier Elimination
  2666. @section Generic Quantifier Elimination
  2667. The following variant of @code{rlqe}
  2668. @rfindex rlqe
  2669. (@pxref{Quantifier Elimination}) enlarges the theory by inequalities,
  2670. i.e., @code{<>}-atomic formulas, wherever this supports the quantifier
  2671. elimination process. For geometric problems,
  2672. @cindex geometric problem
  2673. it has turned out that in most cases the additional assumptions made are
  2674. actually geometric @emph{non-degeneracy conditions}.
  2675. @cindex non-degeneracy conditions
  2676. The method has been described in detail in
  2677. @ifinfo
  2678. @ref{References,[DSW98]}.
  2679. @end ifinfo
  2680. @iftex
  2681. [DSW98].
  2682. @end iftex
  2683. It has also turned out useful for physical problems
  2684. @cindex physical problems
  2685. such as network
  2686. @ifinfo
  2687. analysis, see @ref{References,[Stu97]}.
  2688. @end ifinfo
  2689. @iftex
  2690. analysis [Stu97].
  2691. @cindex network analysis
  2692. @end iftex
  2693. @defun rlgqe formula [@var{theory} [@var{exceptionlist}]]
  2694. @rtindex theory
  2695. @cindex geometric problem
  2696. @cindex generic quantifier elimination
  2697. Generic quantifier elimination. @code{rlgqe} is not available in
  2698. @sc{acfsf}
  2699. @cindex @sc{acfsf}
  2700. and @sc{dvfsf}.
  2701. @cindex @sc{dvfsf}
  2702. @var{exceptionlist} is a list of variables empty by default. Returns a
  2703. list @code{@{th,f@}} such that @code{th} is a superset of @var{theory}
  2704. adding only inequalities, and @code{f} is a quantifier-free formula
  2705. equivalent to @var{formula} assuming @code{th}. The added inequalities
  2706. contain neither bound variables nor variables from @var{exceptionlist}.
  2707. For restrictions and options, compare @code{rlqe} (@pxref{Quantifier
  2708. Elimination}).
  2709. @end defun
  2710. @defun rlgqea formula [@var{theory} [@var{exceptionlist}]]
  2711. @rtindex theory
  2712. @cindex geometric problem
  2713. @cindex generic quantifier elimination
  2714. @cindex answer
  2715. Generic quantifier elimination with answer. @code{rlgqea} is not
  2716. available in @sc{acfsf}
  2717. @cindex @sc{acfsf}
  2718. and @sc{dvfsf}.
  2719. @cindex @sc{dvfsf}
  2720. @var{exceptionlist} is a list of variables empty by default. Returns a
  2721. list consisting of an extended theory
  2722. @cindex theory
  2723. @cindex extend theory
  2724. and an @var{elimination_answer}.
  2725. @rtindex elimination_answer
  2726. Compare @code{rlqea}/@code{rlgqe}
  2727. (@pxref{Quantifier Elimination}).
  2728. @end defun
  2729. After applying generic quantifier elimination the user might feel that
  2730. the result is still too large while the theory is still quite weak. The
  2731. following function @code{rlgentheo}
  2732. @rfindex rlgentheo
  2733. simplifies a formula by making further assumptions.
  2734. @defun rlgentheo theory formula [@var{exceptionlist}]
  2735. @rtindex theory
  2736. @cindex simplification
  2737. @cindex generic quantifier elimination
  2738. @cindex generate theory
  2739. Generate theory. @code{rlgentheo} is not available in @sc{dvfsf}.
  2740. @cindex @sc{dvfsf}
  2741. @var{formula} is a quantifier-free formula; @var{exceptionlist} is a
  2742. list of variables empty by default. @code{rlgentheo} extends
  2743. @var{theory}
  2744. @cindex extend theory
  2745. with inequalities not containing any variables from @var{exceptionlist}
  2746. as long as the simplification result is better wrt.@: this extended
  2747. theory. Returns a list @code{@{}extended @var{theory}, simplified
  2748. @var{formula}@code{@}}.
  2749. @end defun
  2750. @defvr Switch rlqegenct
  2751. @cindex generate theory
  2752. @cindex complexity of terms
  2753. Quantifier elimination generate complex theory.
  2754. @cindex complex theory
  2755. This is on by default, which allows @code{rlgentheo}
  2756. @rfindex rlgentheo
  2757. to assume inequalities over non-monomial terms with the
  2758. generic quantifier elimination.
  2759. @end defvr
  2760. @node Linear Optimization
  2761. @section Linear Optimization
  2762. In the context @sc{ofsf},
  2763. @cindex @sc{ofsf}
  2764. there is a linear optimization method implemented, which uses quantifier
  2765. elimination
  2766. @cindex quantifier elimination
  2767. (@pxref{Quantifier Elimination}) encoding the target function by an
  2768. additional constraint
  2769. @cindex constraint
  2770. including a dummy variable. This optimization
  2771. technique has been described in
  2772. @ifinfo
  2773. @ref{References,[Wei94a]}.
  2774. @end ifinfo
  2775. @iftex
  2776. [Wei94a].
  2777. @end iftex
  2778. @defun rlopt constraints target
  2779. @cindex optimization
  2780. @cindex linear optimization
  2781. Linear optimization. @code{rlopt} is available only in @sc{ofsf}.
  2782. @cindex @sc{ofsf}
  2783. @var{constraints} is a list of parameter-free atomic formulas built with
  2784. @code{=}, @code{<=}, or @code{>=}; @var{target} is a polynomial over the
  2785. rationals. @var{target} is minimized subject to @var{constraints}.
  2786. @cindex constraint
  2787. The result is either "@code{infeasible}"
  2788. @cindex @code{infeasible}
  2789. or a two-element list, the first entry of which is the optimal value,
  2790. and the second entry is a list of points---each one given as a
  2791. @var{substitution_list}---where @var{target}
  2792. @rtindex substitution_list
  2793. takes this value. The point
  2794. list does, however, not contain all such points. For unbound problems
  2795. the result is @w{@code{@{-infinity,@{@}@}}.}
  2796. @end defun
  2797. @defvr Switch rlopt1s
  2798. @cindex optimization
  2799. @cindex linear optimization
  2800. @cindex solution
  2801. Optimization one solution. This is off by default. @code{rlopt1s} is
  2802. relevant only for @sc{ofsf}.
  2803. @cindex @sc{ofsf}
  2804. If on, @code{rlopt}
  2805. @rfindex rlopt
  2806. returns at most one solution point.
  2807. @end defvr
  2808. @node References
  2809. @chapter References
  2810. Most of the references listed here are available on
  2811. @center @t{http://www.fmi.uni-passau.de/~redlog/}.
  2812. @table @asis
  2813. @item [Dol99]
  2814. Andreas Dolzmann. Solving Geometric Problems with Real Quantifier
  2815. Elimination. Technical Report MIP-9903, FMI, Universitaet Passau,
  2816. D-94030 Passau, Germany, January 1999.
  2817. @item [DGS98]
  2818. Andreas Dolzmann, Oliver Gloor, and Thomas Sturm. Approaches to parallel
  2819. quantifier elimination. In Oliver Gloor, editor, @cite{Proceedings of
  2820. the 1998 International Symposium on Symbolic and Algebraic Computation
  2821. (ISSAC 98)}, pages 88-95, Rostock, Germany, August 1998. ACM, ACM Press,
  2822. New York.
  2823. @item [DS97]
  2824. Andreas Dolzmann and Thomas Sturm. Simplification of quantifier-free
  2825. formulae over ordered fields. @cite{Journal of Symbolic Computation},
  2826. 24(2):209-231, August 1997.
  2827. @item [DS97a]
  2828. Andreas Dolzmann and Thomas Sturm. Redlog: Computer algebra meets computer
  2829. logic. @cite{ACM SIGSAM Bulletin}, 31(2):2--9, June 1997.
  2830. @item [DS97b]
  2831. Andreas Dolzmann and Thomas Sturm. Guarded expressions in practice. In
  2832. Wolfgang W. Kuechlin, editor, @cite{Proceedings of the 1997
  2833. International Symposium on Symbolic and Algebraic Computation (ISSAC
  2834. 97)}, pages 376--383, New York, July 1997. ACM, ACM Press.
  2835. @item [DS99]
  2836. Andreas Dolzmann and Thomas Sturm. P-adic constraint solving.
  2837. Technical Report MIP-9901, FMI, Universitaet Passau, D-94030
  2838. Passau, Germany, January 1999. To appear in the proceedings of the ISSAC
  2839. 99.
  2840. @item [DSW98]
  2841. Andreas Dolzmann, Thomas Sturm, and Volker Weispfenning. A new approach
  2842. for automatic theorem proving in real geometry. @cite{Journal of
  2843. Automated Reasoning}, 21(3):357-380, December 1998.
  2844. @item [DSW98a]
  2845. Andreas Dolzmann, Thomas Sturm, and Volker Weispfenning. Real quantifier
  2846. elimination in practice. In B. H. Matzat, G.-M. Greuel, and G. Hiss,
  2847. editors, @cite{Algorithmic Algebra and Number Theory}, pages 221-248.
  2848. Springer, Berlin, 1998.
  2849. @item [LW93]
  2850. Ruediger Loos and Volker Weispfenning. Applying linear quantifier
  2851. elimination. @cite{The Computer Journal}, 36(5):450--462, 1993. Special
  2852. issue on computational quantifier elimination.
  2853. @item [Stu97]
  2854. Thomas Sturm. Reasoning over networks by symbolic methods. Technical
  2855. Report MIP-9719, FMI, Universitaet Passau, D-94030 Passau, Germany,
  2856. December 1997. To appear in AAECC.
  2857. @item [Stu98]
  2858. Thomas Sturm. Linear problems in valued fields. Technical Report
  2859. MIP-9815, FMI, Universitaet Passau, D-94030 Passau, Germany,
  2860. November 1998.
  2861. @item [SW97a]
  2862. Thomas Sturm and Volker Weispfenning. Rounding and blending of solids by
  2863. a real elimination method. In Achim Sydow, editor, @cite{Proceedings of
  2864. the 15th IMACS World Congress on Scientific Computation, Modelling, and
  2865. Applied Mathematics (IMACS 97)}, pages 727-732, Berlin, August 1997.
  2866. IMACS, Wissenschaft & Technik Verlag.
  2867. @item [SW98]
  2868. Thomas Sturm and Volker Weispfenning. Computational geometry problems in
  2869. Redlog. In Dongming Wang, editor, @cite{Automated Deduction in
  2870. Geometry}, volume 1360 of Lecture Notes in Artificial Intelligence
  2871. (Subseries of LNCS), pages 58-86, Springer-Verlag Berlin Heidelberg,
  2872. 1998.
  2873. @item [SW98a]
  2874. Thomas Sturm and Volker Weispfenning. An algebraic approach to
  2875. offsetting and blending of solids. Technical Report MIP-9804, FMI,
  2876. Universitaet Passau, D-94030 Passau, Germany, May 1998.
  2877. @item [Wei88]
  2878. Volker Weispfenning. The complexity of linear problems in fields.
  2879. @cite{Journal of Symbolic Computation}, 5(1):3--27, February, 1988.
  2880. @item [Wei92]
  2881. Volker Weispfenning. Comprehensive Groebner Bases.
  2882. @cite{Journal of Symbolic Computation}, 14:1--29, July, 1992.
  2883. @item [Wei94a]
  2884. Volker Weispfenning. Parametric linear and quadratic optimization by
  2885. elimination. Technical Report MIP-9404, FMI, Universitaet Passau,
  2886. D-94030 Passau, Germany, April 1994.
  2887. @item [Wei94b]
  2888. Volker Weispfenning. Quantifier elimination for real algebra---the cubic
  2889. case. In @cite{Proceedings of the International Symposium on Symbolic
  2890. and Algebraic Computation in Oxford}, pages 258--263, New York, July
  2891. 1994. ACM Press.
  2892. @item [Wei95]
  2893. Volker Weispfenning. Solving parametric polynomial equations and
  2894. inequalities by symbolic algorithms. In J. Fleischer et al., editors,
  2895. @cite{Computer Algebra in Science and Engineering}, pages 163-179, World
  2896. Scientific, Singapore, 1995.
  2897. @item [Wei97]
  2898. Volker Weispfenning. Quantifier elimination for real algebra---the
  2899. quadratic case and beyond. @cite{Applicable Algebra in Engineering
  2900. Communication and Computing}, 8(2):85-101, February 1997.
  2901. @item [Wei97a]
  2902. Volker Weispfenning. Simulation and optimization by quantifier
  2903. elimination. @cite{Journal of Symbolic Computation}, 24(2):189-208, August
  2904. 1997.
  2905. @end table
  2906. @node Functions
  2907. @unnumbered Functions
  2908. @menu
  2909. * Documentation of Functions::
  2910. * References to Functions::
  2911. @end menu
  2912. @node Documentation of Functions
  2913. @unnumberedsec Documentation of Functions
  2914. @printindex fn
  2915. @node References to Functions
  2916. @unnumberedsec References to Functions
  2917. @printindex rf
  2918. @node Switches and Variables
  2919. @unnumbered Switches and Variables
  2920. @menu
  2921. * Documentation of Switches and Variables::
  2922. * References to Switches and Variables::
  2923. @end menu
  2924. @node Documentation of Switches and Variables
  2925. @unnumberedsec Documentation of Switches and Variables
  2926. @printindex vr
  2927. @page
  2928. @node References to Switches and Variables
  2929. @unnumberedsec References to Switches and Variables
  2930. @printindex rv
  2931. @node Data Structures
  2932. @unnumbered Data Structures
  2933. @menu
  2934. * Documentation of Data Structures::
  2935. * References to Data Structures::
  2936. @end menu
  2937. @node Documentation of Data Structures
  2938. @unnumberedsec Documentation of Data Structures
  2939. @printindex tp
  2940. @node References to Data Structures
  2941. @unnumberedsec References to Data Structures
  2942. @printindex rt
  2943. @node Index
  2944. @unnumbered Index
  2945. @printindex cp
  2946. @shortcontents
  2947. @contents
  2948. @bye