redlog.rlg 26 KB

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