redlog.rlg 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269
  1. Sun Aug 18 18:57:13 2002 run on Windows
  2. % ----------------------------------------------------------------------
  3. % $Id: redlog.tst,v 1.5 1999/04/13 21:53:26 sturm Exp $
  4. % ----------------------------------------------------------------------
  5. % Copyright (c) 1995-1997
  6. % Andreas Dolzmann and Thomas Sturm, Universitaet Passau
  7. % ----------------------------------------------------------------------
  8. % $Log: redlog.tst,v $
  9. % Revision 1.5 1999/04/13 21:53:26 sturm
  10. % Removed "on echo".
  11. %
  12. % Revision 1.4 1999/04/05 12:25:29 dolzmann
  13. % Fixed a bug.
  14. %
  15. % Revision 1.3 1999/04/05 12:15:43 dolzmann
  16. % Added code for testing the contexts acfsf and dvfsf.
  17. %
  18. % Revision 1.2 1997/08/20 16:22:07 sturm
  19. % Do not use "on time".
  20. %
  21. % Revision 1.1 1997/08/18 15:59:01 sturm
  22. % Renamed "rl.red" to "redlog.red", and thus "rl.tst" to this file
  23. % "redlog.tst."
  24. %
  25. % ----------------------------------------------------------------------
  26. % Revision 1.3 1996/10/14 16:18:39 sturm
  27. % Added sc50b for testing the optimizer.
  28. %
  29. % Revision 1.2 1996/10/03 16:09:39 sturm
  30. % Added new QE example for testing rlatl, ..., rlifacml, rlstruct,
  31. % rlifstruct.
  32. %
  33. % Revision 1.1 1996/09/30 17:07:52 sturm
  34. % Initial check-in.
  35. %
  36. % ----------------------------------------------------------------------
  37. on rlverbose;
  38. % Ordered fields standard form:
  39. rlset ofsf;
  40. {}
  41. rlset();
  42. {ofsf}
  43. % Chains
  44. -3/5<x>y>z<=a<>b>c<5/3;
  45. - 5*x - 3 < 0 and x - y > 0 and y - z > 0 and - a + z <= 0 and a - b <> 0
  46. and b - c > 0 and 3*c - 5 < 0
  47. % For loop actions.
  48. g := for i:=1:6 mkor
  49. for j := 1:6 mkand
  50. mkid(a,i) <= mkid(a,j);
  51. g := false or (true and 0 <= 0 and a1 - a2 <= 0 and a1 - a3 <= 0
  52. and a1 - a4 <= 0 and a1 - a5 <= 0 and a1 - a6 <= 0) or (true
  53. and - a1 + a2 <= 0 and 0 <= 0 and a2 - a3 <= 0 and a2 - a4 <= 0
  54. and a2 - a5 <= 0 and a2 - a6 <= 0) or (true and - a1 + a3 <= 0
  55. and - a2 + a3 <= 0 and 0 <= 0 and a3 - a4 <= 0 and a3 - a5 <= 0
  56. and a3 - a6 <= 0) or (true and - a1 + a4 <= 0 and - a2 + a4 <= 0
  57. and - a3 + a4 <= 0 and 0 <= 0 and a4 - a5 <= 0 and a4 - a6 <= 0) or (true
  58. and - a1 + a5 <= 0 and - a2 + a5 <= 0 and - a3 + a5 <= 0 and - a4 + a5 <= 0
  59. and 0 <= 0 and a5 - a6 <= 0) or (true and - a1 + a6 <= 0 and - a2 + a6 <= 0
  60. and - a3 + a6 <= 0 and - a4 + a6 <= 0 and - a5 + a6 <= 0 and 0 <= 0)
  61. % Quantifier elimination and variants
  62. h := rlsimpl rlall g;
  63. h := all a1 all a2 all a3 all a4 all a5 all a6 ((a1 - a2 <= 0 and a1 - a3 <= 0
  64. and a1 - a4 <= 0 and a1 - a5 <= 0 and a1 - a6 <= 0) or (a1 - a2 >= 0
  65. and a2 - a3 <= 0 and a2 - a4 <= 0 and a2 - a5 <= 0 and a2 - a6 <= 0) or (
  66. a1 - a3 >= 0 and a2 - a3 >= 0 and a3 - a4 <= 0 and a3 - a5 <= 0 and a3 - a6 <= 0
  67. ) or (a1 - a4 >= 0 and a2 - a4 >= 0 and a3 - a4 >= 0 and a4 - a5 <= 0
  68. and a4 - a6 <= 0) or (a1 - a5 >= 0 and a2 - a5 >= 0 and a3 - a5 >= 0
  69. and a4 - a5 >= 0 and a5 - a6 <= 0) or (a1 - a6 >= 0 and a2 - a6 >= 0
  70. and a3 - a6 >= 0 and a4 - a6 >= 0 and a5 - a6 >= 0))
  71. rlmatrix h;
  72. (a1 - a2 <= 0 and a1 - a3 <= 0 and a1 - a4 <= 0 and a1 - a5 <= 0
  73. and a1 - a6 <= 0) or (a1 - a2 >= 0 and a2 - a3 <= 0 and a2 - a4 <= 0
  74. and a2 - a5 <= 0 and a2 - a6 <= 0) or (a1 - a3 >= 0 and a2 - a3 >= 0
  75. and a3 - a4 <= 0 and a3 - a5 <= 0 and a3 - a6 <= 0) or (a1 - a4 >= 0
  76. and a2 - a4 >= 0 and a3 - a4 >= 0 and a4 - a5 <= 0 and a4 - a6 <= 0) or (
  77. a1 - a5 >= 0 and a2 - a5 >= 0 and a3 - a5 >= 0 and a4 - a5 >= 0 and a5 - a6 <= 0
  78. ) or (a1 - a6 >= 0 and a2 - a6 >= 0 and a3 - a6 >= 0 and a4 - a6 >= 0
  79. and a5 - a6 >= 0)
  80. on rlrealtime;
  81. rlqe h;
  82. ---- (all a1 a2 a3 a4 a5 a6) [DFS: depth 6, watching 5]
  83. [0e] [1e] [2e] [3e] [3e] [3e] [3e] [2e] [3e] [3e] [3e] [2e] [3e] [3e] [3e] [2e]
  84. [3e] [3e] [3e] [2e] [3e] [3e] [3e] [3e] [1e] [2e] [3e] [3e] [3e] [2e] [3e] [3e]
  85. [3e] [2e] [3e] [3e] [3e] [2e] [3e] [3e] [3e] [3e] [1e] [2e] [3e] [3e] [3e] [2e]
  86. [3e] [3e] [3e] [2e] [3e] [3e] [3e] [2e] [3e] [3e] [3e] [1e] [2e] [3e] [3e] [3e]
  87. [2e] [3e] [3e] [3e] [2e] [3e] [3e] [3e] [2e] [3e] [3e] [3e] [1e] [2e] [3e] [3e]
  88. [3e] [2e] [3e] [3e] [3e] [2e] [3e] [3e] [3e] [2e] [3e] [3e] [3e] [1e] [2e] [3e]
  89. [3e] [3e] [3e] [2e] [3e] [3e] [3e] [2e] [3e] [3e] [3e] [2e] [3e] [3e] [3e] [2e]
  90. [3e] [3e] [3e] [3e] [DEL:25/116]
  91. Realtime: 20 s
  92. true
  93. off rlrealtime;
  94. h := rlsimpl rlall(g,{a2});
  95. h := all a1 all a3 all a4 all a5 all a6 ((a1 - a2 <= 0 and a1 - a3 <= 0
  96. and a1 - a4 <= 0 and a1 - a5 <= 0 and a1 - a6 <= 0) or (a1 - a2 >= 0
  97. and a2 - a3 <= 0 and a2 - a4 <= 0 and a2 - a5 <= 0 and a2 - a6 <= 0) or (
  98. a1 - a3 >= 0 and a2 - a3 >= 0 and a3 - a4 <= 0 and a3 - a5 <= 0 and a3 - a6 <= 0
  99. ) or (a1 - a4 >= 0 and a2 - a4 >= 0 and a3 - a4 >= 0 and a4 - a5 <= 0
  100. and a4 - a6 <= 0) or (a1 - a5 >= 0 and a2 - a5 >= 0 and a3 - a5 >= 0
  101. and a4 - a5 >= 0 and a5 - a6 <= 0) or (a1 - a6 >= 0 and a2 - a6 >= 0
  102. and a3 - a6 >= 0 and a4 - a6 >= 0 and a5 - a6 >= 0))
  103. rlqe h;
  104. ---- (all a1 a3 a4 a5 a6) [BFS: depth 5]
  105. -- left: 5
  106. [1e]
  107. -- left: 4
  108. [6e] [5e] [4e] [3e] [2e] [1e]
  109. -- left: 3
  110. [17e] [16e] [15e] [14e] [13e] [12e] [11e] [10e] [9e] [8e] [7e] [6e] [5e] [4e] [3
  111. e] [2e] [1e]
  112. -- left: 2
  113. [16e] [15e] [14e] [13e] [12e] [11e] [10e] [9e] [8e] [7e] [6e] [5e] [4e] [3e] [2e
  114. ] [1e] [DEL:65/40]
  115. true
  116. off rlqeheu,rlqedfs;
  117. rlqe ex(x,a*x**2+b*x+c>0);
  118. ---- (ex x) [BFS: depth 1]
  119. -- left: 1
  120. [1e] [DEL:0/1]
  121. 3
  122. a > 0 or (2*a*b*c - b > 0 and a = 0 and b <> 0)
  123. 2
  124. or (a = 0 and (b > 0 or (b = 0 and c > 0))) or (4*a*c - b < 0 and a < 0)
  125. on rlqedfs;
  126. rlqe ex(x,a*x**2+b*x+c>0);
  127. ---- (ex x) [DFS: depth 1, watching 1]
  128. [0e] [DEL:0/1]
  129. 3
  130. a > 0 or (2*a*b*c - b > 0 and a = 0 and b <> 0)
  131. 2
  132. or (a = 0 and (b > 0 or (b = 0 and c > 0))) or (4*a*c - b < 0 and a < 0)
  133. on rlqeheu;
  134. rlqe(ex(x,a*x**2+b*x+c>0),{a<0});
  135. ---- (ex x) [BFS: depth 1]
  136. -- left: 1
  137. [1e] [DEL:0/1]
  138. 2
  139. 4*a*c - b < 0
  140. rlgqe ex(x,a*x**2+b*x+c>0);
  141. ---- (ex x) [BFS: depth 1]
  142. -- left: 1
  143. [1e!] [DEL:0/1]
  144. {{a <> 0},
  145. 2
  146. 4*a*c - b < 0 or a >= 0}
  147. rlthsimpl ({a*b*c=0,b<>0});
  148. {a*c = 0,b <> 0}
  149. rlqe ex({x,y},(for i:=1:5 product mkid(a,i)*x**10-mkid(b,i)*y**2)<=0);
  150. ---- (ex x y) [BFS: depth 2]
  151. -- left: 2
  152. [1(y^2)(x^10)(SVF).e]
  153. -- left: 1
  154. [6e] [5e] [4e] [3e] [2e] [1e] [DEL:0/7]
  155. true
  156. sol := rlqe ex(x,a*x**2+b*x+c>0);
  157. ---- (ex x) [BFS: depth 1]
  158. -- left: 1
  159. [1e] [DEL:0/1]
  160. 3
  161. sol := a > 0 or (2*a*b*c - b > 0 and a = 0 and b <> 0)
  162. 2
  163. or (a = 0 and (b > 0 or (b = 0 and c > 0))) or (4*a*c - b < 0 and a < 0)
  164. rlatnum sol;
  165. 10
  166. rlatl sol;
  167. 3
  168. {2*a*b*c - b > 0,
  169. 2
  170. 4*a*c - b < 0,
  171. a = 0,
  172. a < 0,
  173. a > 0,
  174. b = 0,
  175. b <> 0,
  176. b > 0,
  177. c > 0}
  178. rlatml sol;
  179. 3
  180. {{2*a*b*c - b > 0,1},
  181. 2
  182. {4*a*c - b < 0,1},
  183. {a = 0,2},
  184. {a < 0,1},
  185. {a > 0,1},
  186. {b = 0,1},
  187. {b <> 0,1},
  188. {b > 0,1},
  189. {c > 0,1}}
  190. rlterml sol;
  191. 2
  192. {b*(2*a*c - b ),
  193. 2
  194. 4*a*c - b ,
  195. a,
  196. b,
  197. c}
  198. rltermml sol;
  199. 2
  200. {{b*(2*a*c - b ),1},
  201. 2
  202. {4*a*c - b ,1},
  203. {a,4},
  204. {b,3},
  205. {c,1}}
  206. rlifacl sol;
  207. 2
  208. {4*a*c - b ,
  209. 2
  210. 2*a*c - b ,
  211. a,
  212. b,
  213. c}
  214. rlifacml sol;
  215. 2
  216. {{4*a*c - b ,1},
  217. 2
  218. {2*a*c - b ,1},
  219. {a,4},
  220. {b,4},
  221. {c,1}}
  222. rlstruct(sol,v);
  223. {v3 > 0 or (v1 > 0 and v3 = 0 and v4 <> 0)
  224. or (v3 = 0 and (v4 > 0 or (v4 = 0 and v5 > 0))) or (v2 < 0 and v3 < 0),
  225. 3
  226. {v1 = 2*a*b*c - b ,
  227. 2
  228. v2 = 4*a*c - b ,
  229. v3 = a,
  230. v4 = b,
  231. v5 = c}}
  232. rlifstruct(sol,v);
  233. {v3 > 0 or (v2*v4 > 0 and v3 = 0 and v4 <> 0)
  234. or (v3 = 0 and (v4 > 0 or (v4 = 0 and v5 > 0))) or (v1 < 0 and v3 < 0),
  235. 2
  236. {v1 = 4*a*c - b ,
  237. 2
  238. v2 = 2*a*c - b ,
  239. v3 = a,
  240. v4 = b,
  241. v5 = c}}
  242. rlitab sol;
  243. 10 = 100%
  244. [9: 18] [8: 15] [7: 15] [6: 15] [5: 9] [4: 9] [3: 9] [2: 16] [1: 20]
  245. Success: 10 -> 9
  246. 0 = 100%
  247. No success, returning the original formula
  248. 5 = 100%
  249. [5: 7] [4: 5] [3: 5] [2: 5] [1: 9]
  250. No success, returning the original formula
  251. 1 = 100%
  252. [1: 1]
  253. No success, returning the original formula
  254. a > 0
  255. 3
  256. or (a = 0 and (b > 0 or (b = 0 and c > 0) or (2*a*b*c - b > 0 and b < 0)))
  257. 2
  258. or (4*a*c - b < 0 and a < 0)
  259. rlatnum ws;
  260. 9
  261. rlgsn sol;
  262. [DNF]
  263. global: 1; impl: 1; no neq: 3; glob-prod-al: 0.
  264. [GP] [1]
  265. [3] [2] [1]
  266. 3
  267. a > 0 or (a = 0 and b = 0 and c > 0) or (2*a*b*c - b > 0 and a = 0 and b <> 0)
  268. 2
  269. or (a = 0 and b > 0) or (4*a*c - b < 0 and a < 0)
  270. rlatnum ws;
  271. 11
  272. off rlverbose;
  273. rlqea ex(x,m*x+b=0);
  274. {{b = 0 and m = 0,{x = infinity1}},
  275. - b
  276. {m <> 0,{x = ------}}}
  277. m
  278. % from Marc van Dongen. Finding the first feasible solution for the
  279. % solution of systems of linear diophantine inequalities.
  280. dong := {
  281. 3*X259+4*X261+3*X262+2*X263+X269+2*X270+3*X271+4*X272+5*X273+X229=2,
  282. 7*X259+11*X261+8*X262+5*X263+3*X269+6*X270+9*X271+12*X272+15*X273+X229=4,
  283. 2*X259+5*X261+4*X262+3*X263+3*X268+4*X269+5*X270+6*X271+7*X272+8*X273=1,
  284. X262+2*X263+5*X268+4*X269+3*X270+2*X271+X272+2*X229=1,
  285. X259+X262+2*X263+4*X268+3*X269+2*X270+X271-X273+3*X229=2,
  286. X259+2*X261+2*X262+2*X263+3*X268+3*X269+3*X270+3*X271+3*X272+3*X273+X229=1,
  287. X259+X261+X262+X263+X268+X269+X270+X271+X272+X273+X229=1};
  288. dong := {x229 + 3*x259 + 4*x261 + 3*x262 + 2*x263 + x269 + 2*x270 + 3*x271
  289. + 4*x272 + 5*x273 = 2,
  290. x229 + 7*x259 + 11*x261 + 8*x262 + 5*x263 + 3*x269 + 6*x270 + 9*x271
  291. + 12*x272 + 15*x273 = 4,
  292. 2*x259 + 5*x261 + 4*x262 + 3*x263 + 3*x268 + 4*x269 + 5*x270 + 6*x271
  293. + 7*x272 + 8*x273 = 1,
  294. 2*x229 + x262 + 2*x263 + 5*x268 + 4*x269 + 3*x270 + 2*x271 + x272 = 1,
  295. 3*x229 + x259 + x262 + 2*x263 + 4*x268 + 3*x269 + 2*x270 + x271 - x273
  296. = 2,
  297. x229 + x259 + 2*x261 + 2*x262 + 2*x263 + 3*x268 + 3*x269 + 3*x270
  298. + 3*x271 + 3*x272 + 3*x273 = 1,
  299. x229 + x259 + x261 + x262 + x263 + x268 + x269 + x270 + x271 + x272
  300. + x273 = 1}
  301. sol := rlopt(dong,0);
  302. sol := {0,
  303. {{x229
  304. - x262 - 2*x263 - 5*x268 - 4*x269 - 3*x270 - 2*x271 - x272 + 1
  305. = -----------------------------------------------------------------,
  306. 2
  307. x259 = (x262 + 2*x263 + 7*x268 + 6*x269 + 5*x270 + 4*x271 + 3*x272
  308. + 2*x273 + 1)/2,
  309. x261 = - x262 - x263 - 2*x268 - 2*x269 - 2*x270 - 2*x271 - 2*x272
  310. - 2*x273}}}
  311. % Substitution
  312. sub(first second sol,for each atf in dong mkand atf);
  313. true and 0 = 0 and 0 = 0 and 0 = 0 and 0 = 0 and 0 = 0 and 0 = 0 and 0 = 0
  314. rlsimpl ws;
  315. true
  316. sub(x=a,x=0 and a=0 and ex(x,x=y) and ex(a,x>a));
  317. a = 0 and a = 0 and ex x (x - y = 0) and ex a0 (a - a0 > 0)
  318. f1 := x=0 and b>=0;
  319. f1 := x = 0 and b >= 0
  320. f2 := a=0;
  321. f2 := a = 0
  322. f := f1 or f2;
  323. f := (x = 0 and b >= 0) or a = 0
  324. % Boolean normal forms.
  325. rlcnf f;
  326. (a = 0 or b >= 0) and (a = 0 or x = 0)
  327. rldnf ws;
  328. a = 0 or (b >= 0 and x = 0)
  329. rlcnf f;
  330. (a = 0 or b >= 0) and (a = 0 or x = 0)
  331. % Negation normal form and prenex normal form
  332. hugo := a=0 and b=0 and y<0 equiv ex(y,y>=a) or a>0;
  333. hugo := (a = 0 and b = 0 and y < 0) equiv (ex y ( - a + y >= 0) or a > 0)
  334. rlnnf hugo;
  335. ((a = 0 and b = 0 and y < 0) and (ex y ( - a + y >= 0) or a > 0))
  336. or ((a <> 0 or b <> 0 or y >= 0) and (all y ( - a + y < 0) and a <= 0))
  337. rlpnf hugo;
  338. all y1 ex y0 (((a = 0 and b = 0 and y < 0) and ( - a + y0 >= 0 or a > 0))
  339. or ((a <> 0 or b <> 0 or y >= 0) and ( - a + y1 < 0 and a <= 0)))
  340. % Length and Part
  341. part(hugo,0);
  342. equiv
  343. part(hugo,2,1,2);
  344. - a + y >= 0
  345. length ws;
  346. 2
  347. length hugo;
  348. 2
  349. length part(hugo,1);
  350. 3
  351. % Tableau
  352. mats := all(t,ex({l,u},(
  353. (t>=0 and t<=1) impl
  354. (l>0 and u<=1 and
  355. -t*x1+t*x2+2*t*x1*u+u=l*x1 and
  356. -2*t*x2+t*x2*u=l*x2))));
  357. mats := all t ex l ex u ((t >= 0 and t - 1 <= 0) impl (l > 0 and u - 1 <= 0
  358. and - l*x1 + 2*t*u*x1 - t*x1 + t*x2 + u = 0 and - l*x2 + t*u*x2 - 2*t*x2 = 0)
  359. )
  360. sol := rlgsn rlqe mats;
  361. sol := 3*x1 + 2 <> 0 and 2*x1 + 1 <> 0 and x1 + 1 <> 0 and x2 = 0
  362. 2 2
  363. and (2*x1 + x1 < 0 or x1 >= 0) and (3*x1 + 5*x1 + 2 < 0
  364. 2 2 2
  365. or 2*x1 + 3*x1 + 1 >= 0 or 2*x1 + x1 < 0 or x1 + x1 > 0)
  366. 2 2 2
  367. and (3*x1 + 5*x1 + 2 < 0 or 2*x1 + x1 < 0 or x1 + x1 > 0 or x1 = 0)
  368. 2 2 2
  369. and (2*x1 + 3*x1 + 1 >= 0 or 2*x1 + x1 < 0 or x1 + x1 > 0)
  370. 2 2 2
  371. and (2*x1 + 3*x1 + 1 >= 0 or 2*x1 + x1 < 0 or x1 + x1 > 0 or x1 = 0)
  372. 2 2
  373. and (x1 + x1 < 0 or x1 >= 0) and (3*x1 + 2*x1 < 0 or x1 >= 0)
  374. rltab(sol,{x1>0,x1<0,x1=0});
  375. 2 2
  376. (x1 = 0 and (x2 = 0 and (3*x1 + 5*x1 + 2 < 0 or 2*x1 + 3*x1 + 1 >= 0
  377. 2 2
  378. or 2*x1 + x1 < 0 or x1 + x1 > 0)
  379. 2 2 2
  380. and (2*x1 + 3*x1 + 1 >= 0 or 2*x1 + x1 < 0 or x1 + x1 > 0))) or (x1 < 0 and
  381. 2 2 2
  382. (3*x1 + 2*x1 < 0 and 2*x1 + x1 < 0 and x1 + x1 < 0 and 3*x1 + 2 <> 0
  383. and 2*x1 + 1 <> 0 and x1 + 1 <> 0 and x2 = 0)) or (x1 > 0 and (x2 = 0 and (
  384. 2 2 2 2
  385. 3*x1 + 5*x1 + 2 < 0 or 2*x1 + 3*x1 + 1 >= 0 or 2*x1 + x1 < 0 or x1 + x1 > 0)
  386. 2 2 2
  387. and (3*x1 + 5*x1 + 2 < 0 or 2*x1 + x1 < 0 or x1 + x1 > 0)
  388. 2 2 2
  389. and (2*x1 + 3*x1 + 1 >= 0 or 2*x1 + x1 < 0 or x1 + x1 > 0)))
  390. % Part on psopfn / cleanupfn
  391. part(rlqe ex(x,m*x+b=0),1);
  392. b = 0
  393. walter := (x>0 and y>0);
  394. walter := x > 0 and y > 0
  395. rlsimpl(true,rlatl walter);
  396. true
  397. part(rlatl walter,1,1);
  398. x
  399. % Optimizer
  400. sc50b!-t := -1*vCOL00004$
  401. sc50b!-c := {
  402. vCOL00001 >= 0,vCOL00002 >= 0,vCOL00003 >= 0,vCOL00004 >= 0,vCOL00005 >= 0,
  403. vCOL00006 >= 0,vCOL00007 >= 0,vCOL00008 >= 0,vCOL00009 >= 0,vCOL00010 >= 0,
  404. vCOL00011 >= 0,vCOL00012 >= 0,vCOL00013 >= 0,vCOL00014 >= 0,vCOL00015 >= 0,
  405. vCOL00016 >= 0,vCOL00017 >= 0,vCOL00018 >= 0,vCOL00019 >= 0,vCOL00020 >= 0,
  406. vCOL00021 >= 0,vCOL00022 >= 0,vCOL00023 >= 0,vCOL00024 >= 0,vCOL00025 >= 0,
  407. vCOL00026 >= 0,vCOL00027 >= 0,vCOL00028 >= 0,vCOL00029 >= 0,vCOL00030 >= 0,
  408. vCOL00031 >= 0,vCOL00032 >= 0,vCOL00033 >= 0,vCOL00034 >= 0,vCOL00035 >= 0,
  409. vCOL00036 >= 0,vCOL00037 >= 0,vCOL00038 >= 0,vCOL00039 >= 0,vCOL00040 >= 0,
  410. vCOL00041 >= 0,vCOL00042 >= 0,vCOL00043 >= 0,vCOL00044 >= 0,vCOL00045 >= 0,
  411. vCOL00046 >= 0,vCOL00047 >= 0,vCOL00048 >= 0,
  412. 3*vCOL00001+(3*vCOL00002)+(3*vCOL00003) <= 300,
  413. 1*vCOL00004+(-1*vCOL00005) = 0,
  414. -1*vCOL00001+(1*vCOL00006) = 0,
  415. -1*vCOL00002+(1*vCOL00007) = 0,
  416. -1*vCOL00003+(1*vCOL00008) = 0,
  417. -1*vCOL00006+(1*vCOL00009) <= 0,
  418. -1*vCOL00007+(1*vCOL00010) <= 0,
  419. -1*vCOL00008+(1*vCOL00011) <= 0,
  420. -1*vCOL00009+(3*vCOL00012)+(3*vCOL00013)+(3*vCOL00014) <= 300,
  421. 0.400000*vCOL00005+(-1*vCOL00010) <= 0,
  422. 0.600000*vCOL00005+(-1*vCOL00011) <= 0,
  423. 1.100000*vCOL00004+(-1*vCOL00015) = 0,
  424. 1*vCOL00005+(1*vCOL00015)+(-1*vCOL00016) = 0,
  425. -1*vCOL00006+(-1*vCOL00012)+(1*vCOL00017) = 0,
  426. -1*vCOL00007+(-1*vCOL00013)+(1*vCOL00018) = 0,
  427. -1*vCOL00008+(-1*vCOL00014)+(1*vCOL00019) = 0,
  428. -1*vCOL00017+(1*vCOL00020) <= 0,
  429. -1*vCOL00018+(1*vCOL00021) <= 0,
  430. -1*vCOL00019+(1*vCOL00022) <= 0,
  431. -1*vCOL00020+(3*vCOL00023)+(3*vCOL00024)+(3*vCOL00025) <= 300,
  432. 0.400000*vCOL00016+(-1*vCOL00021) <= 0,
  433. 0.600000*vCOL00016+(-1*vCOL00022) <= 0,
  434. 1.100000*vCOL00015+(-1*vCOL00026) = 0,
  435. 1*vCOL00016+(1*vCOL00026)+(-1*vCOL00027) = 0,
  436. -1*vCOL00017+(-1*vCOL00023)+(1*vCOL00028) = 0,
  437. -1*vCOL00018+(-1*vCOL00024)+(1*vCOL00029) = 0,
  438. -1*vCOL00019+(-1*vCOL00025)+(1*vCOL00030) = 0,
  439. -1*vCOL00028+(1*vCOL00031) <= 0,
  440. -1*vCOL00029+(1*vCOL00032) <= 0,
  441. -1*vCOL00030+(1*vCOL00033) <= 0,
  442. -1*vCOL00031+(3*vCOL00034)+(3*vCOL00035)+(3*vCOL00036) <= 300,
  443. 0.400000*vCOL00027+(-1*vCOL00032) <= 0,
  444. 0.600000*vCOL00027+(-1*vCOL00033) <= 0,
  445. 1.100000*vCOL00026+(-1*vCOL00037) = 0,
  446. 1*vCOL00027+(1*vCOL00037)+(-1*vCOL00038) = 0,
  447. -1*vCOL00028+(-1*vCOL00034)+(1*vCOL00039) = 0,
  448. -1*vCOL00029+(-1*vCOL00035)+(1*vCOL00040) = 0,
  449. -1*vCOL00030+(-1*vCOL00036)+(1*vCOL00041) = 0,
  450. -1*vCOL00039+(1*vCOL00042) <= 0,
  451. -1*vCOL00040+(1*vCOL00043) <= 0,
  452. -1*vCOL00041+(1*vCOL00044) <= 0,
  453. -1*vCOL00042+(3*vCOL00045)+(3*vCOL00046)+(3*vCOL00047) <= 300,
  454. 0.400000*vCOL00038+(-1*vCOL00043) <= 0,
  455. 0.600000*vCOL00038+(-1*vCOL00044) <= 0,
  456. 1.100000*vCOL00037+(-1*vCOL00048) = 0,
  457. -0.700000*vCOL00045+(0.300000*vCOL00046)+(0.300000*vCOL00047) <= 0,
  458. -1*vCOL00046+(0.400000*vCOL00048) <= 0,
  459. -1*vCOL00047+(0.600000*vCOL00048) <= 0}$
  460. rlopt(sc50b!-c,sc50b!-t);
  461. {-70,
  462. {{vcol00001 = 30,
  463. vcol00002 = 28,
  464. vcol00003 = 42,
  465. vcol00004 = 70,
  466. vcol00005 = 70,
  467. vcol00006 = 30,
  468. vcol00007 = 28,
  469. vcol00008 = 42,
  470. vcol00009 = 30,
  471. vcol00010 = 28,
  472. vcol00011 = 42,
  473. vcol00012 = 33,
  474. 154
  475. vcol00013 = -----,
  476. 5
  477. 231
  478. vcol00014 = -----,
  479. 5
  480. vcol00015 = 77,
  481. vcol00016 = 147,
  482. vcol00017 = 63,
  483. 294
  484. vcol00018 = -----,
  485. 5
  486. 441
  487. vcol00019 = -----,
  488. 5
  489. vcol00020 = 63,
  490. 294
  491. vcol00021 = -----,
  492. 5
  493. 441
  494. vcol00022 = -----,
  495. 5
  496. 363
  497. vcol00023 = -----,
  498. 10
  499. 847
  500. vcol00024 = -----,
  501. 25
  502. 2541
  503. vcol00025 = ------,
  504. 50
  505. 847
  506. vcol00026 = -----,
  507. 10
  508. 2317
  509. vcol00027 = ------,
  510. 10
  511. 993
  512. vcol00028 = -----,
  513. 10
  514. 2317
  515. vcol00029 = ------,
  516. 25
  517. 6951
  518. vcol00030 = ------,
  519. 50
  520. 993
  521. vcol00031 = -----,
  522. 10
  523. 2317
  524. vcol00032 = ------,
  525. 25
  526. 6951
  527. vcol00033 = ------,
  528. 50
  529. 3993
  530. vcol00034 = ------,
  531. 100
  532. 9317
  533. vcol00035 = ------,
  534. 250
  535. 27951
  536. vcol00036 = -------,
  537. 500
  538. 9317
  539. vcol00037 = ------,
  540. 100
  541. 32487
  542. vcol00038 = -------,
  543. 100
  544. 13923
  545. vcol00039 = -------,
  546. 100
  547. 32487
  548. vcol00040 = -------,
  549. 250
  550. 97461
  551. vcol00041 = -------,
  552. 500
  553. 13923
  554. vcol00042 = -------,
  555. 100
  556. 32487
  557. vcol00043 = -------,
  558. 250
  559. 97461
  560. vcol00044 = -------,
  561. 500
  562. 43923
  563. vcol00045 = -------,
  564. 1000
  565. 102487
  566. vcol00046 = --------,
  567. 2500
  568. 307461
  569. vcol00047 = --------,
  570. 5000
  571. 102487
  572. vcol00048 = --------}}}
  573. 1000
  574. % Algebraically closed fields standard form:
  575. sub(x=a,x=0 and a=0 and ex(x,x=y) and ex(a,x<>a));
  576. a = 0 and a = 0 and ex x (x - y = 0) and ex a0 (a - a0 <> 0)
  577. rlset acfsf;
  578. {ofsf}
  579. rlsimpl(x^2+y^2+1<>0);
  580. 2 2
  581. x + y + 1 <> 0
  582. rlqe ex(x,x^2=y);
  583. true
  584. clear f;
  585. h := rlqe ex(x,x^3+a*x^2+b*x+c=0 and x^3+d*x^2+e*x+f=0);
  586. 2 2 2 2 3 2
  587. h := (a*b*c - 2*a*b*c*f + a*b*f - a*c *e + 2*a*c*e*f - a*e*f + b *f - b *c*e
  588. 2 2 2 3 2 3 2 3
  589. - 2*b *e*f + 2*b*c*e + b*e *f - c + 3*c *f - c*e - 3*c*f + f = 0 or (
  590. 3 2 2 2 2
  591. a*b*c - a*b*f - a*c*e + a*e*f - b + 2*b *e - b*e - c + 2*c*f - f <> 0
  592. and a - d <> 0) or (a*b - a*e - c + f <> 0 and a - d <> 0 and b - e <> 0)
  593. or (a - d <> 0 and b - e <> 0)) and (a - d <> 0 or b - e <> 0 or c - f = 0) and
  594. 2 2 2 2
  595. (a *e - a*b*d - a*c - a*d*e + a*f + b + b*d - 2*b*e + c*d - d*f + e <> 0
  596. 2 2 3 2
  597. or a *f - a*c*d - a*d*f + b*c - b*f + c*d - c*e + e*f = 0) and (a *f
  598. 2 2 2 2 2 2 2
  599. - a *b*e*f - 2*a *c*d*f + a *c*e - a *d*f + a*b *d*f - a*b*c*d*e + 3*a*b*c*f
  600. 2 2 2 2 2 2
  601. + a*b*d*e*f - 3*a*b*f + a*c *d - 2*a*c *e + 2*a*c*d *f - a*c*d*e + a*c*e*f
  602. 2 3 2 2 2 2 2 2
  603. + a*e*f - b *f + b *c*e - b *d *f + 2*b *e*f - b*c *d + b*c*d *e - b*c*d*f
  604. 2 2 2 3 2 3 2 2
  605. - 2*b*c*e + 2*b*d*f - b*e *f + c - c *d + 3*c *d*e - 3*c *f - 3*c*d*e*f
  606. 3 2 3
  607. + c*e + 3*c*f - f = 0 or a - d = 0)
  608. rlstruct h;
  609. {(v4 = 0 or (v5 <> 0 and v7 <> 0) or (v6 <> 0 and v7 <> 0 and v8 <> 0)
  610. or (v7 <> 0 and v8 <> 0)) and (v7 <> 0 or v8 <> 0 or v9 = 0)
  611. and (v2 <> 0 or v3 = 0) and (v1 = 0 or v7 = 0),
  612. 3 2 2 2 2 2 2 2 2
  613. {v1 = a *f - a *b*e*f - 2*a *c*d*f + a *c*e - a *d*f + a*b *d*f - a*b*c*d*e
  614. 2 2 2 2 2
  615. + 3*a*b*c*f + a*b*d*e*f - 3*a*b*f + a*c *d - 2*a*c *e + 2*a*c*d *f
  616. 2 2 3 2 2 2 2 2
  617. - a*c*d*e + a*c*e*f + a*e*f - b *f + b *c*e - b *d *f + 2*b *e*f - b*c *d
  618. 2 2 2 2 3 2 3 2
  619. + b*c*d *e - b*c*d*f - 2*b*c*e + 2*b*d*f - b*e *f + c - c *d + 3*c *d*e
  620. 2 3 2 3
  621. - 3*c *f - 3*c*d*e*f + c*e + 3*c*f - f ,
  622. 2 2 2 2
  623. v2 = a *e - a*b*d - a*c - a*d*e + a*f + b + b*d - 2*b*e + c*d - d*f + e ,
  624. 2 2
  625. v3 = a *f - a*c*d - a*d*f + b*c - b*f + c*d - c*e + e*f,
  626. 2 2 2 2 3 2
  627. v4 = a*b*c - 2*a*b*c*f + a*b*f - a*c *e + 2*a*c*e*f - a*e*f + b *f - b *c*e
  628. 2 2 2 3 2 3 2 3
  629. - 2*b *e*f + 2*b*c*e + b*e *f - c + 3*c *f - c*e - 3*c*f + f ,
  630. 3 2 2 2 2
  631. v5 = a*b*c - a*b*f - a*c*e + a*e*f - b + 2*b *e - b*e - c + 2*c*f - f ,
  632. v6 = a*b - a*e - c + f,
  633. v7 = a - d,
  634. v8 = b - e,
  635. v9 = c - f}}
  636. rlqe rlall (h equiv resultant(x^3+a*x^2+b*x+c,x^3+d*x^2+e*x+f,x)=0);
  637. true
  638. clear h;
  639. % Discretely valued fields standard form:
  640. rlset dvfsf;
  641. *** p is being cleared
  642. *** turned off switch rlqeheu
  643. *** turned off switch rlqedfs
  644. *** turned on switch rlsusi
  645. {acfsf}
  646. sub(x=a,x=0 and a=0 and ex(x,x=y) and ex(a,x~a));
  647. a = 0 and a = 0 and ex x (x - y = 0) and ex a0 (a ~ a0)
  648. % P-adic Balls, taken from Andreas Dolzmann, Thomas Sturm. P-adic
  649. % Constraint Solving, Proceedings of the ISSAC '99.
  650. rlset dvfsf;
  651. *** turned on switch rlqeheu
  652. *** turned on switch rlqedfs
  653. *** turned off switch rlsusi
  654. *** p is being cleared
  655. *** turned off switch rlqeheu
  656. *** turned off switch rlqedfs
  657. *** turned on switch rlsusi
  658. {dvfsf}
  659. rlqe all(r_1,all(r_2,all(a,all(b,
  660. ex(x,r_1||x-a and r_2||x-b and r_1|r_2) impl
  661. all(y,r_2||y-b impl r_1||y-a)))));
  662. 2 2
  663. (p - 4*p + 3 | 2 or 2 ~ 1) and (p + p - 2 | 3 or 3 ~ 1)
  664. and (p + 2 | 2*p or p - 2 || p + 2)
  665. rlmkcanonic ws;
  666. true
  667. rlset(dvfsf,100003);
  668. *** turned on switch rlqeheu
  669. *** turned on switch rlqedfs
  670. *** turned off switch rlsusi
  671. *** p is set to 100003
  672. *** turned off switch rlqeheu
  673. *** turned off switch rlqedfs
  674. *** turned on switch rlsusi
  675. {dvfsf}
  676. rlqe all(r_1,all(r_2,all(a,all(b,
  677. ex(x,r_1||x-a and r_2||x-b and r_1|r_2) impl
  678. all(y,r_2||y-b impl r_1||y-a)))));
  679. true
  680. % Size of the Residue Field, taken from Andreas Dolzmann, Thomas
  681. % Sturm. P-adic Constraint Solving. Proceedings of the ISSAC '99.
  682. rlset(dvfsf);
  683. *** turned on switch rlqeheu
  684. *** turned on switch rlqedfs
  685. *** turned off switch rlsusi
  686. *** p is being cleared
  687. *** turned off switch rlqeheu
  688. *** turned off switch rlqedfs
  689. *** turned on switch rlsusi
  690. {dvfsf,100003}
  691. rlqe ex(x,x~1 and x-1~1 and x-2~1 and x-3~1 and 2~1 and 3~1);
  692. (3 ~ 1 and 2 ~ 1) or (7 ~ 1 and 6 ~ 1 and 5 ~ 1 and 3 ~ 1 and 2 ~ 1)
  693. or (5 ~ 1 and 3 ~ 1 and 2 ~ 1)
  694. or (11 ~ 1 and 10 ~ 1 and 6 ~ 1 and 3 ~ 1 and 2 ~ 1)
  695. or (7 ~ 1 and 6 ~ 1 and 3 ~ 1 and 2 ~ 1)
  696. or (6 ~ 1 and 5 ~ 1 and 3 ~ 1 and 2 ~ 1)
  697. rlexplats ws;
  698. (3 ~ 1 and 2 ~ 1) or (7 ~ 1 and 5 ~ 1 and 3 ~ 1 and 2 ~ 1)
  699. or (11 ~ 1 and 5 ~ 1 and 3 ~ 1 and 2 ~ 1) or (7 ~ 1 and 3 ~ 1 and 2 ~ 1)
  700. or (5 ~ 1 and 3 ~ 1 and 2 ~ 1)
  701. rldnf ws;
  702. 3 ~ 1 and 2 ~ 1
  703. % Selecting contexts:
  704. rlset ofsf;
  705. *** turned on switch rlqeheu
  706. *** turned on switch rlqedfs
  707. *** turned off switch rlsusi
  708. {dvfsf}
  709. f:= ex(x,m*x+b=0);
  710. f := ex x (b + m*x = 0)
  711. rlqe f;
  712. b = 0 or m <> 0
  713. rlset dvfsf;
  714. *** p is being cleared
  715. *** turned off switch rlqeheu
  716. *** turned off switch rlqedfs
  717. *** turned on switch rlsusi
  718. {ofsf}
  719. rlqe f;
  720. b + m = 0 or m <> 0
  721. rlset acfsf;
  722. *** turned on switch rlqeheu
  723. *** turned on switch rlqedfs
  724. *** turned off switch rlsusi
  725. {dvfsf}
  726. rlqe f;
  727. b = 0 or m <> 0
  728. end;
  729. Time for test: 135709 ms, plus GC time: 5137 ms