tla-ts 0.0.4-dev.a297123 → 0.0.4-dev.c4929d7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (313) hide show
  1. package/README.md +27 -141
  2. package/dist/deciders.cjs +366 -0
  3. package/dist/deciders.js +366 -0
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.d.cts +35 -1
  6. package/dist/index.d.ts +35 -1
  7. package/dist/index.js +1 -1
  8. package/dist/parallel-worker.cjs +1 -4
  9. package/dist/parallel-worker.js +1 -4
  10. package/dist/prove-worker.cjs +9 -0
  11. package/dist/prove-worker.d.cts +9 -0
  12. package/dist/prove-worker.d.ts +9 -0
  13. package/dist/prove-worker.js +9 -0
  14. package/dist/prove.cjs +996 -0
  15. package/dist/prove.js +996 -0
  16. package/dist/run-cli.cjs +37 -47
  17. package/dist/run-cli.js +37 -47
  18. package/dist/tlapm.cjs +10 -0
  19. package/dist/tlapm.js +10 -0
  20. package/dist/transfer.cjs +38 -44
  21. package/dist/transfer.js +38 -44
  22. package/dist/worker.cjs +21 -0
  23. package/dist/worker.js +21 -0
  24. package/package.json +21 -12
  25. package/src/check.ts +1 -0
  26. package/src/codegen.ts +5 -3
  27. package/src/errors.ts +86 -0
  28. package/src/evaluate.ts +54 -19
  29. package/src/index.ts +10 -0
  30. package/src/{obligation-action.ts → obligations/action.ts} +265 -55
  31. package/src/{obligation-anon.ts → obligations/anon.ts} +47 -37
  32. package/src/obligations/ctx.ts +64 -0
  33. package/src/{obligation-deref.ts → obligations/deref.ts} +38 -61
  34. package/src/{obligation-expression.ts → obligations/expression.ts} +78 -45
  35. package/src/{obligation-format.ts → obligations/format.ts} +7 -8
  36. package/src/{obligation-generate.ts → obligations/generate.ts} +147 -74
  37. package/src/{obligations.ts → obligations/index.ts} +29 -13
  38. package/src/{obligation-levels.ts → obligations/levels.ts} +14 -5
  39. package/src/{obligation-module.ts → obligations/module.ts} +56 -33
  40. package/src/obligations/pickle.ts +98 -0
  41. package/src/obligations/pragma.ts +189 -0
  42. package/src/{obligation-printer.ts → obligations/printer.ts} +22 -80
  43. package/src/{obligation-proof.ts → obligations/proof.ts} +7 -1
  44. package/src/{obligation-source.ts → obligations/source.ts} +159 -97
  45. package/src/obligations/temporal.ts +319 -0
  46. package/src/{obligation-tuples.ts → obligations/tuples.ts} +1 -1
  47. package/src/ocaml-marshal.ts +166 -0
  48. package/src/parallel-worker.ts +2 -18
  49. package/src/parallel.ts +10 -43
  50. package/src/prove/decide-pool.ts +100 -0
  51. package/src/prove/deciders.ts +33 -0
  52. package/src/prove/isabelle/LICENSE +36 -0
  53. package/src/prove/isabelle/LICENSE-tlapm +26 -0
  54. package/src/prove/isabelle/decide.ts +47 -0
  55. package/src/prove/isabelle/encode.ts +503 -0
  56. package/src/prove/isabelle/isar/inner-syntax.ts +579 -0
  57. package/src/prove/isabelle/isar/method.ts +367 -0
  58. package/src/prove/isabelle/isar/proof.ts +28 -0
  59. package/src/prove/isabelle/isar/statement.ts +57 -0
  60. package/src/prove/isabelle/isar/theory.ts +192 -0
  61. package/src/prove/isabelle/isar/type-check.ts +278 -0
  62. package/src/prove/isabelle/provers/blast/blast.ts +258 -0
  63. package/src/prove/isabelle/provers/blast/branch.ts +322 -0
  64. package/src/prove/isabelle/provers/blast/prove.ts +347 -0
  65. package/src/prove/isabelle/provers/blast/rules.ts +330 -0
  66. package/src/prove/isabelle/provers/blast/state.ts +180 -0
  67. package/src/prove/isabelle/provers/blast/term.ts +547 -0
  68. package/src/prove/isabelle/provers/clasimp.ts +150 -0
  69. package/src/prove/isabelle/provers/classical.ts +389 -0
  70. package/src/prove/isabelle/provers/hypsubst.ts +441 -0
  71. package/src/prove/isabelle/pure/bicompose.ts +174 -0
  72. package/src/prove/isabelle/pure/consts.ts +32 -0
  73. package/src/prove/isabelle/pure/conv.ts +79 -0
  74. package/src/prove/isabelle/pure/drule.ts +264 -0
  75. package/src/prove/isabelle/pure/envir.ts +363 -0
  76. package/src/prove/isabelle/pure/goal.ts +53 -0
  77. package/src/prove/isabelle/pure/interrupt.ts +16 -0
  78. package/src/prove/isabelle/pure/list.ts +12 -0
  79. package/src/prove/isabelle/pure/logic.ts +402 -0
  80. package/src/prove/isabelle/pure/name.ts +110 -0
  81. package/src/prove/isabelle/pure/net.ts +262 -0
  82. package/src/prove/isabelle/pure/object-logic.ts +41 -0
  83. package/src/prove/isabelle/pure/pattern.ts +650 -0
  84. package/src/prove/isabelle/pure/raw-simplifier.ts +353 -0
  85. package/src/prove/isabelle/pure/rewriter.ts +602 -0
  86. package/src/prove/isabelle/pure/search.ts +68 -0
  87. package/src/prove/isabelle/pure/seq.ts +156 -0
  88. package/src/prove/isabelle/pure/simplifier.ts +112 -0
  89. package/src/prove/isabelle/pure/table.ts +208 -0
  90. package/src/prove/isabelle/pure/tactic.ts +276 -0
  91. package/src/prove/isabelle/pure/tactical.ts +347 -0
  92. package/src/prove/isabelle/pure/term-ord.ts +159 -0
  93. package/src/prove/isabelle/pure/term.ts +808 -0
  94. package/src/prove/isabelle/pure/thm.ts +806 -0
  95. package/src/prove/isabelle/pure/type.ts +133 -0
  96. package/src/prove/isabelle/pure/unify.ts +753 -0
  97. package/src/prove/isabelle/pure/variable.ts +25 -0
  98. package/src/prove/isabelle/tla/classical-setup.ts +101 -0
  99. package/src/prove/isabelle/tla/context.ts +74 -0
  100. package/src/prove/isabelle/tla/logic-data.ts +5 -0
  101. package/src/prove/isabelle/tla/logic.ts +215 -0
  102. package/src/prove/isabelle/tla/simpdata.ts +241 -0
  103. package/src/prove/isabelle/tools/intuitionistic.ts +132 -0
  104. package/src/prove/ocaml.ts +22 -0
  105. package/src/prove/prep/action.ts +521 -0
  106. package/src/prove/prep/defs.ts +33 -0
  107. package/src/prove/prep/elab.ts +156 -0
  108. package/src/prove/prep/enabled-axioms.ts +189 -0
  109. package/src/prove/prep/enabled.ts +43 -0
  110. package/src/prove/prep/fingerprint.ts +388 -0
  111. package/src/prove/prep/flatten.ts +70 -0
  112. package/src/prove/prep/level-comparison.ts +557 -0
  113. package/src/prove/prep/md5.ts +67 -0
  114. package/src/prove/prep/pragma.ts +221 -0
  115. package/src/prove/prep/trivial.ts +22 -0
  116. package/src/prove/prove-worker.ts +25 -0
  117. package/src/prove/prove.ts +505 -0
  118. package/src/prove/ptl/decide.ts +68 -0
  119. package/src/prove/ptl/encode.ts +256 -0
  120. package/src/prove/ptl/sat.ts +151 -0
  121. package/src/prove/ptl/tableau.ts +276 -0
  122. package/src/prove/smt/axiomatize.ts +69 -0
  123. package/src/prove/smt/axioms.ts +222 -0
  124. package/src/prove/smt/context.ts +108 -0
  125. package/src/prove/smt/data.ts +636 -0
  126. package/src/prove/smt/encode.ts +166 -0
  127. package/src/prove/smt/extensionality.ts +65 -0
  128. package/src/prove/smt/flatten.ts +112 -0
  129. package/src/prove/smt/format.ts +154 -0
  130. package/src/prove/smt/instances.ts +182 -0
  131. package/src/prove/smt/rewrite.ts +773 -0
  132. package/src/prove/smt/simplify.ts +57 -0
  133. package/src/prove/smt/solver/act-cache.ts +265 -0
  134. package/src/prove/smt/solver/arith-rewriter.ts +962 -0
  135. package/src/prove/smt/solver/array.ts +22 -0
  136. package/src/prove/smt/solver/asserted-formulas.ts +469 -0
  137. package/src/prove/smt/solver/ast-lt.ts +157 -0
  138. package/src/prove/smt/solver/ast-util.ts +147 -0
  139. package/src/prove/smt/solver/ast.ts +1315 -0
  140. package/src/prove/smt/solver/auf-solver.ts +572 -0
  141. package/src/prove/smt/solver/case-split-queue.ts +178 -0
  142. package/src/prove/smt/solver/cg-table.ts +175 -0
  143. package/src/prove/smt/solver/clause.ts +276 -0
  144. package/src/prove/smt/solver/conflict-resolution.ts +343 -0
  145. package/src/prove/smt/solver/context.ts +1292 -0
  146. package/src/prove/smt/solver/ctx-simplify.ts +334 -0
  147. package/src/prove/smt/solver/der.ts +224 -0
  148. package/src/prove/smt/solver/dyn-ack.ts +141 -0
  149. package/src/prove/smt/solver/e-matching.ts +659 -0
  150. package/src/prove/smt/solver/enode.ts +259 -0
  151. package/src/prove/smt/solver/expr-ref.ts +21 -0
  152. package/src/prove/smt/solver/expr-safe-replace.ts +172 -0
  153. package/src/prove/smt/solver/fingerprints.ts +92 -0
  154. package/src/prove/smt/solver/flat-literals.ts +51 -0
  155. package/src/prove/smt/solver/goal.ts +138 -0
  156. package/src/prove/smt/solver/hash.ts +173 -0
  157. package/src/prove/smt/solver/hashtable.ts +166 -0
  158. package/src/prove/smt/solver/internalizer.ts +1381 -0
  159. package/src/prove/smt/solver/lbool.ts +5 -0
  160. package/src/prove/smt/solver/literal.ts +24 -0
  161. package/src/prove/smt/solver/lp/bound-propagator.ts +391 -0
  162. package/src/prove/smt/solver/lp/constraints.ts +78 -0
  163. package/src/prove/smt/solver/lp/containers.ts +296 -0
  164. package/src/prove/smt/solver/lp/core-solver.ts +504 -0
  165. package/src/prove/smt/solver/lp/cross-nested.ts +224 -0
  166. package/src/prove/smt/solver/lp/dep-intervals.ts +656 -0
  167. package/src/prove/smt/solver/lp/dependency.ts +51 -0
  168. package/src/prove/smt/solver/lp/dioph-eq.ts +1181 -0
  169. package/src/prove/smt/solver/lp/explanation.ts +46 -0
  170. package/src/prove/smt/solver/lp/gomory.ts +255 -0
  171. package/src/prove/smt/solver/lp/hnf-cutter.ts +125 -0
  172. package/src/prove/smt/solver/lp/hnf.ts +281 -0
  173. package/src/prove/smt/solver/lp/int-cube.ts +295 -0
  174. package/src/prove/smt/solver/lp/int-solver.ts +514 -0
  175. package/src/prove/smt/solver/lp/lar-solver.ts +816 -0
  176. package/src/prove/smt/solver/lp/lar-term.ts +62 -0
  177. package/src/prove/smt/solver/lp/lp-settings.ts +91 -0
  178. package/src/prove/smt/solver/lp/maximize-term.ts +347 -0
  179. package/src/prove/smt/solver/lp/nex-creator.ts +381 -0
  180. package/src/prove/smt/solver/lp/nex.ts +120 -0
  181. package/src/prove/smt/solver/lp/nla-backoff.ts +43 -0
  182. package/src/prove/smt/solver/lp/nla-basics.ts +398 -0
  183. package/src/prove/smt/solver/lp/nla-core.ts +968 -0
  184. package/src/prove/smt/solver/lp/nla-divisions.ts +332 -0
  185. package/src/prove/smt/solver/lp/nla-emonics.ts +373 -0
  186. package/src/prove/smt/solver/lp/nla-factorization.ts +30 -0
  187. package/src/prove/smt/solver/lp/nla-grobner.ts +904 -0
  188. package/src/prove/smt/solver/lp/nla-horner.ts +126 -0
  189. package/src/prove/smt/solver/lp/nla-intervals.ts +265 -0
  190. package/src/prove/smt/solver/lp/nla-monomial-bounds.ts +715 -0
  191. package/src/prove/smt/solver/lp/nla-monotone.ts +59 -0
  192. package/src/prove/smt/solver/lp/nla-order.ts +307 -0
  193. package/src/prove/smt/solver/lp/nla-patcher.ts +112 -0
  194. package/src/prove/smt/solver/lp/nla-tangents.ts +251 -0
  195. package/src/prove/smt/solver/lp/nla-throttle.ts +85 -0
  196. package/src/prove/smt/solver/lp/nla-types.ts +124 -0
  197. package/src/prove/smt/solver/lp/nla-var-eqs.ts +141 -0
  198. package/src/prove/smt/solver/lp/nra-solver.ts +440 -0
  199. package/src/prove/smt/solver/lp/numeric-pair.ts +65 -0
  200. package/src/prove/smt/solver/lp/pdd-interval.ts +31 -0
  201. package/src/prove/smt/solver/lp/pdd-simplifier.ts +184 -0
  202. package/src/prove/smt/solver/lp/pdd-solver.ts +408 -0
  203. package/src/prove/smt/solver/lp/pdd.ts +971 -0
  204. package/src/prove/smt/solver/lp/random-updater.ts +138 -0
  205. package/src/prove/smt/solver/lp/static-matrix.ts +246 -0
  206. package/src/prove/smt/solver/lp/union-find.ts +96 -0
  207. package/src/prove/smt/solver/mam-compiler.ts +847 -0
  208. package/src/prove/smt/solver/mam-interpreter.ts +400 -0
  209. package/src/prove/smt/solver/maximize-ac-sharing.ts +118 -0
  210. package/src/prove/smt/solver/model-checker.ts +347 -0
  211. package/src/prove/smt/solver/model-evaluator.ts +262 -0
  212. package/src/prove/smt/solver/model-finder.ts +155 -0
  213. package/src/prove/smt/solver/model-generator.ts +97 -0
  214. package/src/prove/smt/solver/model-macro-solver.ts +728 -0
  215. package/src/prove/smt/solver/nlsat/algebraic.ts +1161 -0
  216. package/src/prove/smt/solver/nlsat/atoms.ts +238 -0
  217. package/src/prove/smt/solver/nlsat/evaluator.ts +303 -0
  218. package/src/prove/smt/solver/nlsat/explain.ts +607 -0
  219. package/src/prove/smt/solver/nlsat/interval-set.ts +351 -0
  220. package/src/prove/smt/solver/nlsat/levelwise.ts +740 -0
  221. package/src/prove/smt/solver/nlsat/mpbq.ts +161 -0
  222. package/src/prove/smt/solver/nlsat/polynomial.ts +1722 -0
  223. package/src/prove/smt/solver/nlsat/solver.ts +911 -0
  224. package/src/prove/smt/solver/nlsat/types.ts +43 -0
  225. package/src/prove/smt/solver/nlsat/upolynomial-factorization.ts +648 -0
  226. package/src/prove/smt/solver/nlsat/upolynomial.ts +996 -0
  227. package/src/prove/smt/solver/nnf.ts +469 -0
  228. package/src/prove/smt/solver/pattern-inference.ts +351 -0
  229. package/src/prove/smt/solver/poly-rewriter.ts +477 -0
  230. package/src/prove/smt/solver/propagate-values.ts +83 -0
  231. package/src/prove/smt/solver/proto-model.ts +551 -0
  232. package/src/prove/smt/solver/pull-quant.ts +139 -0
  233. package/src/prove/smt/solver/qe-lite-der.ts +526 -0
  234. package/src/prove/smt/solver/qe-lite-fm.ts +576 -0
  235. package/src/prove/smt/solver/qe-lite.ts +381 -0
  236. package/src/prove/smt/solver/qi-queue.ts +362 -0
  237. package/src/prove/smt/solver/quant-tactics.ts +117 -0
  238. package/src/prove/smt/solver/quantifier-analyzer.ts +562 -0
  239. package/src/prove/smt/solver/quantifier-manager.ts +186 -0
  240. package/src/prove/smt/solver/random-gen.ts +10 -0
  241. package/src/prove/smt/solver/rational.ts +165 -0
  242. package/src/prove/smt/solver/ref-vector.ts +62 -0
  243. package/src/prove/smt/solver/relevancy.ts +247 -0
  244. package/src/prove/smt/solver/rewriter-tpl.ts +1159 -0
  245. package/src/prove/smt/solver/rewriter.ts +843 -0
  246. package/src/prove/smt/solver/rlimit.ts +79 -0
  247. package/src/prove/smt/solver/smtlib-parser.ts +526 -0
  248. package/src/prove/smt/solver/solver.ts +71 -0
  249. package/src/prove/smt/solver/sort.ts +35 -0
  250. package/src/prove/smt/solver/sticky-generations.ts +69 -0
  251. package/src/prove/smt/solver/theory-lra-axioms.ts +340 -0
  252. package/src/prove/smt/solver/theory-lra-bounds.ts +226 -0
  253. package/src/prove/smt/solver/theory-lra-final-check.ts +252 -0
  254. package/src/prove/smt/solver/theory-lra-internalize.ts +476 -0
  255. package/src/prove/smt/solver/theory-lra-model.ts +243 -0
  256. package/src/prove/smt/solver/theory-lra-propagate.ts +405 -0
  257. package/src/prove/smt/solver/theory-lra-state.ts +43 -0
  258. package/src/prove/smt/solver/theory-lra.ts +56 -0
  259. package/src/prove/smt/solver/var-subst.ts +258 -0
  260. package/src/prove/smt/solver/z3-license.txt +10 -0
  261. package/src/prove/smt/table.ts +170 -0
  262. package/src/prove/tlapm/tlapm.ts +96 -0
  263. package/src/prove/tlaps-module.ts +510 -0
  264. package/src/prove/verdict.ts +18 -0
  265. package/src/prove/zenon/LICENSE +32 -0
  266. package/src/prove/zenon/check/check.ts +105 -0
  267. package/src/prove/zenon/check/definitions.ts +144 -0
  268. package/src/prove/zenon/check/equality.ts +182 -0
  269. package/src/prove/zenon/check/functions.ts +62 -0
  270. package/src/prove/zenon/check/keys.ts +125 -0
  271. package/src/prove/zenon/check/propositional.ts +104 -0
  272. package/src/prove/zenon/check/records.ts +188 -0
  273. package/src/prove/zenon/check/relations.ts +121 -0
  274. package/src/prove/zenon/check/rewrites.ts +224 -0
  275. package/src/prove/zenon/check/sets.ts +302 -0
  276. package/src/prove/zenon/check/terms.ts +127 -0
  277. package/src/prove/zenon/check/tla.ts +126 -0
  278. package/src/prove/zenon/decide.ts +113 -0
  279. package/src/prove/zenon/encode.ts +437 -0
  280. package/src/prove/zenon/eqrel.ts +300 -0
  281. package/src/prove/zenon/equality-rules.ts +435 -0
  282. package/src/prove/zenon/expr.ts +551 -0
  283. package/src/prove/zenon/index-table.ts +350 -0
  284. package/src/prove/zenon/isar-case.ts +513 -0
  285. package/src/prove/zenon/isar.ts +1249 -0
  286. package/src/prove/zenon/limits.ts +15 -0
  287. package/src/prove/zenon/llproof.ts +173 -0
  288. package/src/prove/zenon/mltoll.ts +1566 -0
  289. package/src/prove/zenon/node.ts +297 -0
  290. package/src/prove/zenon/ocaml.ts +169 -0
  291. package/src/prove/zenon/parse.ts +247 -0
  292. package/src/prove/zenon/phrase.ts +191 -0
  293. package/src/prove/zenon/proof.ts +198 -0
  294. package/src/prove/zenon/propositional-rules.ts +387 -0
  295. package/src/prove/zenon/rules.ts +94 -0
  296. package/src/prove/zenon/search.ts +288 -0
  297. package/src/prove/zenon/tla/functions.ts +151 -0
  298. package/src/prove/zenon/tla/llproof.ts +480 -0
  299. package/src/prove/zenon/tla/records.ts +225 -0
  300. package/src/prove/zenon/tla/rewrites.ts +447 -0
  301. package/src/prove/zenon/tla/sets.ts +304 -0
  302. package/src/prove/zenon/tla/terms.ts +181 -0
  303. package/src/prove/zenon/tla/tla.ts +506 -0
  304. package/src/run-cli.ts +334 -75
  305. package/src/standard-modules.ts +5 -2
  306. package/src/successors.ts +24 -5
  307. package/src/tlapm-cache.ts +236 -0
  308. package/src/tlc-random.ts +55 -32
  309. package/src/tlc-version.ts +8 -7
  310. package/src/values.ts +80 -35
  311. package/src/worker.ts +65 -0
  312. package/dist/parallel.cjs +0 -12
  313. package/dist/parallel.js +0 -12
@@ -0,0 +1,366 @@
1
+ /**
2
+ * @license tla-ts
3
+ *
4
+ * Copyright (c) Aiden Bai
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import{A as e,D as t,c as n,d as r,f as i,i as a,p as o,u as s,w as c,y as l}from"./worker.js";const u=e=>e.match(/\\<\^?[A-Za-z0-9_']*>|[^]/gu)??[],d=e=>e.startsWith(`\\<`)&&!e.startsWith(`\\<^`),f=e=>e===`_`||e===`'`,p=e=>e.length===0?!1:e.length>1&&e[1]===`\\<^sub>`?!0:e[0]===`'`?p(e.slice(1)):d(e[0]),m=e=>p(u(e).reverse())?`${e}'`:`${e}a`,h=e=>{let t=u(e),n=t.length;for(;n>0&&f(t[n-1]);)--n;let r=t.slice(0,n).reverse(),i=e=>{if(e.length===0)return[`a`];if(e[0]===`z`)return[`a`,...i(e.slice(1))];let t=e[0].length===1?e[0].charCodeAt(0):-1;return t>=97&&t<122?[String.fromCharCode(t+1),...e.slice(1)]:[`a`,...e]};return[...(p(r)?[`'`,...r]:i(r)).reverse(),...t.slice(n)].join(``)},g=e=>{let t=e,n=0;for(;t.endsWith(`_`);)t=t.slice(0,-1),n+=1;return[t,n]},_=e=>g(e)[0],v=(e,t)=>{let n=_(e);return t.has(n)?t:new Map(t).set(n,void 0)},y=/* @__PURE__ */ new Map([[``,void 0],[`'`,void 0]]),b=e=>e.reduce((e,t)=>v(t,e),y),x=(e,t)=>{let[n,r]=g(e);if(!t.has(n))return[n+`_`.repeat(r),v(n,t)];let i=m(n),a=i;for(;t.has(a);)a=h(t.get(a)??a);let o=_(i)===_(a)?t:new Map(t).set(_(i),_(a));return[a+`_`.repeat(r),v(a,o)]},ee=(e,t)=>{let n=t;return e.map(e=>{let[t,r]=x(e,n);return n=r,t})},S=(e,t)=>ee(t,b(e)),te=e=>e.startsWith(`:`),C=e=>`:${String(e).padStart(3,`0`)}`,w=e=>e?e.height:0,T=(e,t,n,r)=>({key:e,value:t,left:n,right:r,height:Math.max(w(n),w(r))+1}),ne=(e,t,n,r)=>{let i=w(n)-w(r);if(i>1&&n){if(w(n.left)>=w(n.right))return T(n.key,n.value,n.left,T(e,t,n.right,r));let i=n.right;return i?T(i.key,i.value,T(n.key,n.value,n.left,i.left),T(e,t,i.right,r)):T(e,t,n,r)}if(i<-1&&r){if(w(r.right)>=w(r.left))return T(r.key,r.value,T(e,t,n,r.left),r.right);let i=r.left;return i?T(i.key,i.value,T(e,t,n,i.left),T(r.key,r.value,i.right,r.right)):T(e,t,n,r)}return T(e,t,n,r)},re=e=>({compare:e,root:void 0}),ie=e=>e.root===void 0,ae=(e,t)=>{let n=e.root;for(;n;){let r=e.compare(t,n.key);if(r===0)return n.value;n=r<0?n.left:n.right}},oe=(e,t)=>{let n=e.root;for(;n;){let r=e.compare(t,n.key);if(r===0)return!0;n=r<0?n.left:n.right}return!1},se=(e,t,n,r)=>{if(!r)return T(t,n,void 0,void 0);let i=e(t,r.key);return i===0?T(t,n,r.left,r.right):i<0?ne(r.key,r.value,se(e,t,n,r.left),r.right):ne(r.key,r.value,r.left,se(e,t,n,r.right))},ce=(e,t,n)=>({compare:e.compare,root:se(e.compare,t,n,e.root)}),le=e=>{let t=e.root;if(t){for(;t.left;)t=t.left;return[t.key,t.value]}},ue=(e,t,n)=>t?ue(e,t.right,e(t.key,t.value,ue(e,t.left,n))):n,de=(e,t,n)=>ue(e,t.root,n),fe=e=>de((e,t,n)=>(n.push([e,t]),n),e,[]),pe=(e,t)=>e===t?0:e.length===t.length?e<t?-1:1:e.length-t.length,me=(e,t)=>e===t?0:e<t?-1:1,he=(e,t)=>e.index===t.index?pe(e.name,t.name):e.index-t.index,ge=(e,t)=>e.index===t.index?me(e.name,t.name):e.index-t.index,_e=(e,t=-1)=>Math.max(t,e.kind===`TFree`?-1:e.kind===`TVar`?e.index:e.maxidx),ve=(e,t=-1)=>{switch(e.kind){case`Var`:return Math.max(t,e.index,_e(e.type));case`Const`:case`Free`:return _e(e.type,t);case`Bound`:return t;default:return Math.max(t,e.maxidx)}},E=e=>e.kind===`Bound`?e.index+1:e.kind===`App`||e.kind===`Abs`?e.loose:0,ye=e=>8<<(e.length*31+(e.charCodeAt(0)|0)*7+(e.charCodeAt(e.length-1)|0))%28,be=e=>e.kind===`Var`?1:e.kind===`Free`?ye(e.name):e.kind===`App`||e.kind===`Abs`?e.flags:0,xe=(e,t)=>(be(e)&~be(t))===0,Se=(e,t=[])=>({kind:`Type`,name:e,args:t,maxidx:t.reduce((e,t)=>_e(t,e),-1)}),Ce=(e,t=[])=>({kind:`TFree`,name:e,sort:t}),we=(e,t,n=[])=>({kind:`TVar`,name:e,index:t,sort:n}),Te=(e,t)=>({kind:`Const`,name:e,type:t,index:void 0,body:void 0,fun:void 0,arg:void 0,loose:void 0,maxidx:void 0,flags:void 0}),Ee=(e,t)=>({kind:`Free`,name:e,type:t,index:void 0,body:void 0,fun:void 0,arg:void 0,loose:void 0,maxidx:void 0,flags:void 0}),D=(e,t,n)=>({kind:`Var`,name:e,type:n,index:t,body:void 0,fun:void 0,arg:void 0,loose:void 0,maxidx:void 0,flags:void 0}),O=e=>({kind:`Bound`,name:void 0,type:void 0,index:e,body:void 0,fun:void 0,arg:void 0,loose:void 0,maxidx:void 0,flags:void 0}),k=(e,t,n)=>({kind:`Abs`,name:e,type:t,index:void 0,body:n,fun:void 0,arg:void 0,loose:Math.max(E(n)-1,0),maxidx:ve(n,_e(t)),flags:be(n)|(n.kind===`App`&&n.arg.kind===`Bound`&&n.arg.index===0?4:0)}),A=(e,t)=>({kind:`App`,name:void 0,type:void 0,index:void 0,body:void 0,fun:e,arg:t,loose:Math.max(E(e),E(t)),maxidx:ve(t,ve(e)),flags:be(e)|be(t)|(e.kind===`Abs`?2:0)}),De=Se(`dummy`),Oe=Se(`prop`),ke=(e,t)=>Se(`fun`,[e,t]),Ae=(e,t)=>e.reduceRight((e,t)=>ke(t,e),t),je=e=>{let t=[],n=e;for(;n.kind===`Type`&&n.name===`fun`;)t.push(n.args[0]),n=n.args[1];return t},Me=e=>e.kind===`Type`&&e.name===`fun`?Me(e.args[1]):e,Ne=(e,t)=>e===t||e.length===t.length&&e.every((e,n)=>e===t[n]),Pe=(e,t)=>e===t?!0:e.kind===`Type`?t.kind===`Type`&&e.name===t.name&&e.args.length===t.args.length&&e.args.every((e,n)=>Pe(e,t.args[n])):e.kind===`TFree`?t.kind===`TFree`&&e.name===t.name&&Ne(e.sort,t.sort):t.kind===`TVar`&&e.name===t.name&&e.index===t.index&&Ne(e.sort,t.sort),Fe=(e,t)=>{switch(t.kind){case`Const`:case`Free`:case`Var`:return t.type;case`Bound`:{let n=e[t.index];if(n===void 0)throw new l(`TYPE`,`fastype_of: Bound`);return n}case`Abs`:return ke(t.type,Fe([t.type,...e],t.body));case`App`:{let n=Fe(e,t.fun);if(n.kind!==`Type`||n.name!==`fun`)throw new l(`TYPE`,`fastype_of: expected function type`);return n.args[1]}}},Ie=e=>Fe([],e),Le=(e,t)=>t.reduce((e,t)=>A(e,t),e),Re=e=>{let t=[],n=e;for(;n.kind===`App`;)t.push(n.arg),n=n.fun;return[n,t.reverse()]},ze=e=>{let t=e;for(;t.kind===`App`;)t=t.fun;return t},Be=e=>e.kind===`Abs`?Be(e.body):e,Ve=e=>{switch(e.kind){case`Abs`:return 1+Ve(e.body);case`App`:return Ve(e.fun)+Ve(e.arg);default:return 1}},He=e=>e.kind===`Const`&&e.name===`Pure.all`,Ue=e=>e.kind===`App`&&He(e.fun)&&e.arg.kind===`Abs`?Ue(e.arg.body):e,We=e=>e.kind===`App`&&He(e.fun)&&e.arg.kind===`Abs`?[{name:e.arg.name,type:e.arg.type},...We(e.arg.body)]:[],Ge=(e,t,n)=>t===e.fun&&n===e.arg?e:A(t,n),Ke=(e,t,n=e.type)=>t===e.body&&n===e.type?e:k(e.name,n,t),qe=(e,t,n)=>{if(E(n)<=t)return n;switch(n.kind){case`Bound`:return O(n.index+e);case`Abs`:return Ke(n,qe(e,t+1,n.body));case`App`:return Ge(n,qe(e,t,n.fun),qe(e,t,n.arg));default:return n}},Je=(e,t,n)=>e===0?n:qe(e,t,n),Ye=(e,t)=>Je(e,0,t),Xe=(e,t)=>E(e)>t,Ze=(e,t)=>{if(E(e)<=t)return!1;switch(e.kind){case`Bound`:return e.index===t;case`App`:return Ze(e.fun,t)||Ze(e.arg,t);case`Abs`:return Ze(e.body,t+1);default:return!1}},Qe=e=>Xe(e,0),$e=e=>Ze(e,0),et=e=>{let t=[],n=(e,r)=>{switch(e.kind){case`Bound`:e.index>=r&&!t.includes(e.index-r)&&t.unshift(e.index-r);return;case`Abs`:n(e.body,r+1);return;case`App`:n(e.arg,r),n(e.fun,r);return;default:return}};return n(e,0),t},tt=(e,t,n)=>{if(E(n)<=t)return n;switch(n.kind){case`Bound`:return n.index-t<e.length?Ye(t,e[n.index-t]):O(n.index-e.length);case`Abs`:return Ke(n,tt(e,t+1,n.body));case`App`:return Ge(n,tt(e,t,n.fun),tt(e,t,n.arg));default:return n}},nt=(e,t)=>e.length===0?t:tt(e,0,t),rt=(e,t)=>nt([e],t),it=(e,t)=>e.kind===`Abs`?rt(t,e.body):A(e,t),at=(e,t)=>t.reduce((e,t)=>it(e,t),e),j=(e,t)=>{if(e===t)return!0;switch(e.kind){case`App`:return t.kind===`App`&&j(e.fun,t.fun)&&j(e.arg,t.arg);case`Abs`:return t.kind===`Abs`&&j(e.body,t.body)&&Pe(e.type,t.type);case`Const`:case`Free`:return t.kind===e.kind&&e.name===t.name&&Pe(e.type,t.type);case`Var`:return t.kind===`Var`&&e.name===t.name&&e.index===t.index&&Pe(e.type,t.type);case`Bound`:return t.kind===`Bound`&&e.index===t.index}},ot=(e,t)=>{if(e===t)return!0;switch(e.kind){case`App`:return t.kind===`App`&&ot(e.fun,t.fun)&&ot(e.arg,t.arg);case`Abs`:return t.kind===`Abs`&&e.name===t.name&&Pe(e.type,t.type)&&ot(e.body,t.body);default:return j(e,t)}},st=(e,t)=>{let n=e,r=t;for(;n.kind===`App`&&r.kind===`App`;){if(!ct(n.arg,r.arg))return!1;n=n.fun,r=r.fun}return!0},ct=(e,t)=>{let n=ze(e),r=ze(t);return r.kind===`Var`||n.kind===`Var`||n.kind===`Abs`||r.kind===`Abs`?!0:n.kind===`Const`&&r.kind===`Const`||n.kind===`Free`&&r.kind===`Free`?n.name===r.name&&st(e,t):n.kind===`Bound`&&r.kind===`Bound`&&n.index===r.index&&st(e,t)},lt=(e,t,n)=>{if(!xe(e,n))return n;if(j(e,n))return O(t);switch(n.kind){case`Abs`:return Ke(n,lt(e,t+1,n.body));case`App`:return Ge(n,lt(e,t,n.fun),lt(e,t,n.arg));default:return n}},ut=(e,t)=>lt(e,0,t),dt=(e,t)=>{let n=t=>{switch(t.kind){case`Const`:case`Free`:{let n=e(t.type);return n===t.type?t:{...t,type:n}}case`Var`:{let n=e(t.type);return n===t.type?t:{...t,type:n}}case`Bound`:return t;case`Abs`:return Ke(t,n(t.body),e(t.type));case`App`:return Ge(t,n(t.fun),n(t.arg))}};return n(t)},ft=(e,t)=>{if(t.kind!==`Type`)return e(t);let n=t.args.map(t=>ft(e,t));return n.every((e,n)=>e===t.args[n])?t:Se(t.name,n)},pt=(e,t,n)=>{switch(t.kind){case`App`:return pt(e,t.arg,pt(e,t.fun,n));case`Abs`:return pt(e,t.body,n);default:return e(t,n)}},mt=(e,t,n)=>{if(!(be(t)&1))return n;switch(t.kind){case`App`:return mt(e,t.arg,mt(e,t.fun,n));case`Abs`:return mt(e,t.body,n);case`Var`:return e(t,n);default:return n}},ht=(e,t,n)=>t.kind===`Type`?t.args.reduce((t,n)=>ht(e,n,t),n):e(t,n),gt=(e,t,n)=>{switch(t.kind){case`Const`:case`Free`:case`Var`:return e(t.type,n);case`Bound`:return n;case`Abs`:return gt(e,t.body,e(t.type,n));case`App`:return gt(e,t.arg,gt(e,t.fun,n))}},_t=(e,t)=>e(t)?!0:t.kind===`App`?_t(e,t.fun)||_t(e,t.arg):t.kind===`Abs`&&_t(e,t.body),vt=(e,t)=>{switch(t.kind){case`Const`:case`Free`:case`Var`:return e(t.type);case`Bound`:return!1;case`Abs`:return e(t.type)||vt(e,t.body);case`App`:return vt(e,t.fun)||vt(e,t.arg)}},yt=(e,t)=>e.name===t.name&&e.index===t.index&&Pe(e.type,t.type),bt=(e,t)=>mt((e,t)=>t.some(t=>yt(t,e))?t:[e,...t],e,t),xt=(e,t)=>pt((e,t)=>e.kind===`Free`&&!t.includes(e.name)?[e.name,...t]:t,e,t),St=(e,t,n)=>{if(e.kind===`Abs`&&t.kind===`Abs`){let r=e.name!==``&&t.name!==``?[[e.name,t.name],...n]:n;return St(e.body,t.body,r)}return e.kind===`App`&&t.kind===`App`?St(e.fun,t.fun,St(e.arg,t.arg,n)):n},Ct=(e,t,n)=>St(Be(e),Be(t),n),wt=(e,t)=>{switch(t.kind){case`Abs`:{let n=e(t.name),r=wt(e,t.body);return n===t.name?Ke(t,r):k(n,t.type,r)}case`App`:return Ge(t,wt(e,t.fun),wt(e,t.arg));default:return t}},Tt=(e,t,n)=>{let r=/* @__PURE__ */ new Map;if(St(e,t,[]).forEach(([e,t])=>{r.has(e)||r.set(e,t)}),[...r].every(([e,t])=>e===t))return;let i=wt(e=>r.get(e)??e,n);return i===n?void 0:i},Et=(e,t)=>xe(e,t)&&(j(e,t)||(t.kind===`App`?Et(e,t.fun)||Et(e,t.arg):t.kind===`Abs`&&Et(e,t.body))),Dt=e=>Te(`Pure.all`,ke(ke(e,Oe),Oe)),Ot=(e,t)=>e.reduceRight((e,t)=>A(Dt(t.type),k(t.name,t.type,e)),t),kt=(e,t)=>{let n=Ie(e);return A(A(Te(`Pure.eq`,Ae([n,n],Oe)),e),t)},At=(e,t)=>e.kind===`App`&&e.fun.kind===`App`&&e.fun.fun.kind===`Const`&&e.fun.fun.name===t,jt=e=>At(e,`Pure.eq`),Mt=e=>{if(!At(e,`Pure.eq`))throw new l(`TERM`,`dest_equals`);return[e.fun.arg,e.arg]},Nt=Te(`Pure.imp`,Ae([Oe,Oe],Oe)),Pt=(e,t)=>A(A(Nt,e),t),Ft=e=>At(e,`Pure.imp`),It=e=>{if(!At(e,`Pure.imp`))throw new l(`TERM`,`dest_implies`);return[e.fun.arg,e.arg]},Lt=(e,t)=>e.reduceRight((e,t)=>Pt(t,e),t),Rt=e=>{let t=[],n=e;for(;At(n,`Pure.imp`);)t.push(n.fun.arg),n=n.arg;return t},zt=e=>{let t=e;for(;At(t,`Pure.imp`);)t=t.arg;return t},Bt=(e,t,n)=>{if(e===0)return[[...t],n];if(!At(n,`Pure.imp`))throw new l(`TERM`,`strip_prems`);return Bt(e-1,[n.fun.arg,...t],n.arg)},Vt=e=>Rt(e).length,Ht=Te(`Pure.prop`,ke(Oe,Oe)),Ut=e=>A(Ht,e),Wt=e=>e.kind===`App`&&e.fun.kind===`Const`&&e.fun.name===`Pure.prop`,Gt=e=>A(Te(`Pure.term`,ke(Ie(e),Oe)),e),Kt=(e,t,n)=>n>0?A(Kt(e,t+1,n-1),O(t)):e,qt=(e,t)=>e.reduce((e,t)=>k(t.name,t.type,e),t),Jt=(e,t)=>e===0?t:ft(t=>t.kind===`TVar`?we(t.name,t.index+e,t.sort):t,t),Yt=(e,t,n,r,i)=>{if(e.length===0&&t.length===0&&n===0)return i;let a=t.length,o=(r,i)=>{switch(i.kind){case`Var`:return Kt(D(i.name,i.index+n,Ae(t,Jt(n,i.type))),r,a);case`Free`:return e.includes(i.name)?Kt(Ee(i.name,Ae(t,Jt(n,i.type))),r,a):Ee(i.name,Jt(n,i.type));case`Abs`:return k(i.name,Jt(n,i.type),o(r+1,i.body));case`App`:return A(o(r,i.fun),o(r,i.arg));case`Const`:return Te(i.name,Jt(n,i.type));case`Bound`:return i}};return o(r,i)},Xt=(e,t,n)=>Yt([],e,t,0,n),Zt=e=>e.kind===`App`&&e.fun.kind===`Const`&&e.fun.name===`Pure.all`&&e.arg.kind===`Abs`,Qt=(e,t,n)=>{let r=(t,i)=>At(i,`Pure.imp`)?r(t,i.arg):Zt(i)?k(i.arg.name,i.arg.type,r([i.arg.type,...t],i.arg.body)):Xt([...t].reverse(),e,n);return r([],t)},$t=(e,t,n)=>{let r=(t,i)=>At(i,`Pure.imp`)?A(A(i.fun.fun,i.fun.arg),r(t,i.arg)):Zt(i)?A(i.fun,k(i.arg.name,i.arg.type,r([i.arg.type,...t],i.arg.body))):Xt([...t].reverse(),e,n);return r([],t)},en=e=>{let t=[],n=e;for(;;)if(At(n,`Pure.imp`))t=[n.fun.arg,...t],n=n.arg;else if(Zt(n))t=t.map(e=>Ye(1,e)),n=n.arg.body;else return t.reverse()},tn=e=>{let t=e;for(;;)if(At(t,`Pure.imp`))t=t.arg;else if(Zt(t))t=t.arg.body;else return t},nn=e=>{let t=[],n=e;for(;;)if(At(n,`Pure.imp`))n=n.arg;else if(Zt(n))t.push({name:n.arg.name,type:n.arg.type}),n=n.arg.body;else return t},rn=e=>At(e,`Pure.eq`)||At(e,`Pure.imp`)||e.kind===`App`&&e.fun.kind===`Const`&&e.fun.name===`Pure.all`,an=e=>At(e,`Pure.imp`)?rn(e.fun.arg)||an(e.arg):Zt(e)?an(e.arg.body):!1,on=(e,t,n)=>{if(e===0&&t<=0)return n;if(At(n,`Pure.imp`))return t===1?on(e,t-1,n.arg):Pt(Ye(e,n.fun.arg),on(e,t-1,n.arg));if(Zt(n))return on(e-1,t,n.arg.body);if(t>0)throw new l(`TERM`,`remove_params`);return n},sn=(e,t)=>{let n=nn(t),r=S([],n.map(e=>e.name)),i=n.map((e,t)=>({name:r[t],type:e.type}));return Ot(i,on(i.length,e,t))},cn=(e,t,n)=>e===0?[t,n]:At(n,`Pure.imp`)?cn(e-1,[n.fun.arg,...t],n.arg):[t,n],ln=(e,t)=>Zt(t)?ln([{name:t.arg.name,type:t.arg.type},...e],t.arg.body):[e,t],un=(e,t)=>{let[n,r]=ln([],t),[i,a]=cn(e,[],r);return{abstract:e=>qt(n,e),hyps:[...i].reverse(),conclusion:a}},dn=e=>({pull:e});var fn=class{step;constructor(e){this.step=e}pull(){let e=this.step();for(;e!==void 0&&`pull`in e;)e=e.step===void 0?e.pull():e.step();return e}};const pn=e=>new fn(e),mn=dn(()=>void 0),hn=(e,t)=>dn(()=>[e,t]),gn=e=>hn(e,mn),_n=e=>dn(()=>e),vn=e=>e.reduceRight((e,t)=>hn(t,e),mn),yn=e=>e.pull()?.[0],bn=(e,t)=>{let n=[],r=t;for(;n.length<e;){let e=r.pull();if(e===void 0)return[n,r];n.push(e[0]),r=e[1]}return[n,r]},xn=e=>{let t=[],n=e.pull();for(;n!==void 0;)t.push(n[0]),n=n[1].pull();return t},Sn=(e,t)=>pn(()=>{let n=e.pull();return n===void 0?t:[n[0],Sn(n[1],t)]}),Cn=(e,t,n)=>{let r=t=>pn(()=>{let i=t.pull();return i===void 0?n:[e(i[0]),r(i[1])]});return r(t)},wn=(e,t)=>{let n=t=>dn(()=>{let r=t.pull();for(;r!==void 0&&!e(r[0]);)r=r[1].pull();return r===void 0?void 0:[r[0],n(r[1])]});return n(t)},Tn=e=>Dn(e=>e,e),En=(e,t)=>dn(()=>{let n=t.pull();return n===void 0?void 0:[e(n[0]),En(e,n[1])]}),Dn=(e,t)=>pn(()=>{let n=t.pull();return n===void 0?void 0:Sn(e(n[0]),Dn(e,n[1]))}),On=(e,t,n)=>{let r=t=>pn(()=>{let i=t.pull();return i===void 0?n:e(i[0],r(i[1]))});return r(t)},kn=re(he),An=(e,t)=>ae(e,t),jn=(e,t)=>{let n=t;for(;n.kind===`TVar`;){let t=ae(e,n);if(t===void 0)return n;n=t}return n},Mn=(e,t,n)=>{if(n.kind===`Type`)return n.args.some(n=>Mn(e,t,n));if(n.kind===`TFree`)return!1;if(n.index===e.index&&n.name===e.name)return!0;let r=ae(t,n);return r!==void 0&&Mn(e,t,r)},Nn=(e,t,n)=>{if(oe(e,t))throw new l(`TYPE`,`Type.unify: duplicate assignment`);return ce(e,{name:t.name,index:t.index},n)},Pn=(e,t,n)=>{let r=jn(n,e),i=jn(n,t);return r.kind===`TVar`&&i.kind===`TVar`?r.index===i.index&&r.name===i.name?n:Nn(n,i,r):r.kind===`TVar`?Mn(r,n,i)?void 0:Nn(n,r,i):i.kind===`TVar`?Mn(i,n,r)?void 0:Nn(n,i,r):r.kind===`Type`&&i.kind===`Type`?r.name===i.name?r.args.reduce((e,t,n)=>e===void 0?void 0:Pn(t,i.args[n],e),n):void 0:Pe(r,i)?n:void 0},Fn=(e,t,n)=>{if(e.kind===`TVar`){let r=ae(n,e);return r===void 0?Nn(n,e,t):Pe(r,t)?n:void 0}return e.kind===`Type`?t.kind!==`Type`||e.name!==t.name||e.args.length!==t.args.length?void 0:e.args.reduce((e,n,r)=>e===void 0?void 0:Fn(n,t.args[r],e),n):t.kind===`TFree`&&t.name===e.name?n:void 0},In=(e,t)=>{if(t.kind===`TFree`)return t;if(t.kind===`TVar`){let n=ae(e,t);return n===void 0?t:In(e,n)}let n=t.args.map(t=>In(e,t));return n.every((e,n)=>e===t.args[n])?t:Se(t.name,n)},Ln=(e,t)=>{if(t.kind===`TFree`)return t;if(t.kind===`TVar`)return ae(e,t)??t;let n=t.args.map(t=>Ln(e,t));return n.every((e,n)=>e===t.args[n])?t:Se(t.name,n)},Rn=(e,t,n)=>{if(ie(e))return Pe(t,n);let r=jn(e,t),i=jn(e,n);return r.kind===`Type`&&i.kind===`Type`?r.name===i.name&&r.args.length===i.args.length:Pe(r,i)},zn=re(he),Bn=e=>({maxidx:e,tenv:zn,tyenv:kn}),Vn=Bn(-1),Hn=e=>ie(e.tenv)&&ie(e.tyenv),Un=e=>{let t=[],n=e;do t.unshift(n%26),n=Math.floor(n/26);while(n>0);return t.map(e=>String.fromCharCode(97+e)).join(``)},Wn=(e,t,n)=>{let r=t.maxidx+1,i=n.map((t,i)=>D(n.length===1?e:e+Un(i),r,t));return[{...t,maxidx:r},i]},Gn=(e,t,n)=>{let[r,i]=Wn(e,t,[n]);return[r,i[0]]},Kn=(e,t)=>{let n=ae(e,t);if(n!==void 0){if(!qn(t.type,n.type))throw new l(`TYPE`,`Variable has two distinct types`);return n.term}},qn=(e,t)=>Rn(kn,e,t),Jn=(e,t)=>{let n=ae(e.tenv,t);if(n!==void 0){if(!Rn(e.tyenv,t.type,n.type))throw new l(`TYPE`,`Variable has two distinct types`);return n.term}},Yn=(e,t,n)=>{if(oe(n.tenv,e))throw new l(`TERM`,`Envir.update: duplicate assignment`);return{...n,tenv:ce(n.tenv,{name:e.name,index:e.index},{type:e.type,term:t})}},Xn=(e,t)=>{let n=le(e.tenv),r=le(e.tyenv);return(n===void 0||n[0].index>t)&&(r===void 0||r[0].index>t)},Zn=(e,t,n)=>{if(t.kind!==`Var`)return Yn(e,t,n);if(e.name===t.name&&e.index===t.index)return n;if(ge(e,t)<0){let r=Jn(n,t);return r===void 0?Yn(t,D(e.name,e.index,t.type),n):Zn(e,r,n)}return Yn(e,t,n)},Qn=e=>!!(be(e)&2),$n=(e,t)=>{if(!(be(t)&3))return t;switch(t.kind){case`Var`:{let n=Kn(e,t);return n===void 0?t:$n(e,n)}case`Abs`:return Ke(t,$n(e,t.body));case`App`:{if(t.fun.kind===`Abs`)return $n(e,rt(t.arg,t.fun.body));let n=$n(e,t.fun);return n.kind===`Abs`?$n(e,rt(t.arg,n.body)):Ge(t,n,$n(e,t.arg))}default:return t}},er=(e,t)=>{if(ve(t)<0&&!(be(t)&2))return t;switch(t.kind){case`Const`:case`Free`:{let n=In(e.tyenv,t.type);return n===t.type?t:{...t,type:n}}case`Var`:{let n=Jn(e,t);if(n!==void 0)return er(e,n);let r=In(e.tyenv,t.type);return r===t.type?t:{...t,type:r}}case`Abs`:return Ke(t,er(e,t.body),In(e.tyenv,t.type));case`App`:{if(t.fun.kind===`Abs`)return er(e,rt(t.arg,t.fun.body));let n=er(e,t.fun);return n.kind===`Abs`?er(e,rt(t.arg,n.body)):Ge(t,n,er(e,t.arg))}default:return t}},tr=(e,t)=>Hn(e)&&!Qn(t)?t:ie(e.tyenv)?$n(e.tenv,t):er(e,t),nr=e=>tr(Vn,e),rr=(e,t)=>{if(!(be(t)&3))return t;switch(t.kind){case`Var`:{let n=Jn(e,t);return n===void 0?t:rr(e,n)}case`Abs`:return Ke(t,rr(e,t.body));case`App`:{if(t.fun.kind===`Abs`)return rr(e,rt(t.arg,t.fun.body));let n=rr(e,t.fun);return n.kind===`Abs`?rr(e,rt(t.arg,n.body)):n===t.fun?t:A(n,t.arg)}default:return t}},ir=(e,t)=>{switch(e.kind){case`Bound`:return e.index>=t?O(e.index-1):e;case`Abs`:return Ke(e,ir(e.body,t+1));case`App`:return Ge(e,ir(e.fun,t),ir(e.arg,t));default:return e}},ar=e=>!!(be(e)&4),or=e=>{if(!ar(e))return e;if(e.kind===`Abs`){let t=or(e.body);return t.kind===`App`&&t.arg.kind===`Bound`&&t.arg.index===0?$e(t.fun)?t===e.body?e:k(e.name,e.type,t):ir(t.fun,0):t===e.body?e:k(e.name,e.type,t)}return e.kind===`App`?Ge(e,or(e.fun),or(e.arg)):e},sr=e=>ar(e)?or(e):e,cr=(e,t)=>j(e,t)||j(sr(e),sr(t)),lr=(e,t)=>{if(t.kind===`Type`&&t.name===`fun`)return lr(e,t.args[1]);if(t.kind===`TVar`){let n=ae(e.tyenv,t);return n===void 0?t:lr(e,n)}return t},ur=(e,t)=>{if(t.kind===`Type`&&t.name===`fun`)return[t.args[0],...ur(e,t.args[1])];if(t.kind===`TVar`){let n=ae(e.tyenv,t);return n===void 0?[]:ur(e,n)}return[]},dr=(e,t,n)=>{switch(n.kind){case`App`:{let r=jn(e.tyenv,dr(e,t,n.fun));if(r.kind===`Type`&&r.name===`fun`)return r.args[1];throw new l(`TYPE`,`fastype: expected function type`)}case`Bound`:{let e=t[n.index];if(e===void 0)throw new l(`TYPE`,`fastype: Bound`);return e}case`Abs`:return ke(n.type,dr(e,[n.type,...t],n.body));default:return n.type}},fr=(e,t)=>({head:e,tail:t}),pr=e=>{if(Date.now()>e.deadline||e.signal?.aborted===!0)throw new l(`Interrupt`,`Interrupt`)};var mr=class{},hr=class{},gr=class{};const _r=(e,t,n)=>{let r=t=>{if(!(be(t)&1))return!1;switch(t.kind){case`Var`:{let i=Jn(n,t);return i===void 0?t.name===e.name&&t.index===e.index:r(i)}case`App`:return r(t.fun)||r(t.arg);case`Abs`:return r(t.body);default:return!1}};return r(t)},vr=(e,t)=>{let n=(t,r)=>{switch(t.kind){case`Bound`:return t.index<r?t:O(e(t.index-r)+r);case`Abs`:return k(t.name,t.type,n(t.body,r+1));case`App`:return A(n(t.fun,r),n(t.arg,r));default:return t}};return n(t,0)},yr=(e,t)=>{let n=e.indexOf(t);if(n===-1)throw new mr;return e.length-1-n},br=(e,t,n)=>t.reduceRight((t,n)=>{let r=e[n];return k(r.name,r.type,t)},n),xr=e=>vr(e=>e+1,e),Sr=e=>{let t=[];for(let n=e.length-1;n>=0;--n){let r=e[n];if(r.kind!==`Bound`||t.includes(r.index))throw new hr;t.unshift(r.index)}return t},Cr=(e,t)=>Sr(t.map(t=>rr(e,t))),wr=(e,t)=>t.reduce((e,t)=>A(e,O(t)),e),Tr=(e,t,n)=>e.kind===`Abs`&&t.length>0?Tr(e.body,t.slice(1),[t[0],...n]):t.length===0&&n.length===0?e:wr(vr(e=>n[e],e),t),Er=(e,t)=>{let n=[],r=e;for(let e=t;e>0;--e){if(r.kind!==`Type`||r.name!==`fun`)throw new l(`TERM`,`split_type`);n.unshift(r.args[0]),r=r.args[1]}return[n,r]},Dr=(e,t,n,r)=>{let[i,a]=Er(In(e.tyenv,t),n);return Ae(r.map(e=>i[e]),a)},Or=(e,t,n,r)=>br(e,t,wr(n,r)),kr=(e,t,n,r,i)=>{let[a,o]=Gn(r.name,e,Dr(e,r.type,n.length,i));return Yn(r,Or(t,n,o,i),a)},Ar=(e,t)=>e.length===t+1&&e.every((e,n)=>e===t-n),jr=e=>e.flatMap((t,n)=>t===void 0?[]:[e.length-1-n]),Mr=(e,t,n,r)=>{let i=(e,t)=>t<e?t:yr(r,t-e)+e,a=(e,t)=>{if(t<e)return t;let n=r.indexOf(t-e);return n===-1?void 0:r.length-1-n+e},o=(e,t,n,r)=>{let i=[],a=t;for(let t of e){let[e,o]=s(t,a,n,r);i.push(e),a=o}return[i,a]},s=(e,t,n,r)=>{let c=rr(t,e);if(c.kind===`Abs`){let[e,i]=s(c.body,t,n+1,[{name:c.name,type:c.type},...r]);return[k(c.name,c.type,e),i]}let[l,u]=Re(c);if(l.kind===`Const`||l.kind===`Free`){let[e,i]=o(u,t,n,r);return[Le(l,e),i]}if(l.kind===`Bound`){let e=i(n,l.index),[a,s]=o(u,t,n,r);return[Le(O(e),a),s]}if(l.kind===`Var`){let e=Cr(t,u),i=e.map(e=>a(n,e)),o=jr(i),s=i.flatMap(e=>e===void 0?[]:[e]),[c,d]=Gn(l.name,t,Dr(t,l.type,e.length,o)),f=Yn(l,Or(r,e,d,o),c);return[wr(d,s),f]}throw new hr};return Ar(r,n.length-1)?[e,t]:s(e,t,0,n)},Nr=(e,t)=>{if(e.length!==t.length)throw new l(`TERM`,`mk_ff_list`);return e.flatMap((n,r)=>n===t[r]?[e.length-1-r]:[])},Pr=(e,t,n,r,i)=>r.length===i.length&&r.every((e,t)=>e===i[t])?e:kr(e,t,r,n,Nr(r,i)),Fr=(e,t,n,r,i,a)=>{let o=(n,r,i,a)=>{if(a.every(e=>r.includes(e))){let o=br(t,r,wr(i,a.map(e=>yr(r,e))));return Yn(n,o,e)}let o=r.filter(e=>a.includes(e)),[s,c]=Gn(i.name,e,Dr(e,n.type,r.length,o.map(e=>yr(r,e)))),l=e=>br(t,e,wr(c,o.map(t=>yr(e,t))));return Yn(i,l(a),Yn(n,l(r),s))};return ge(i,n)<0?o(n,r,i,a):o(i,a,n,r)},Ir=(e,t,n)=>{if(Pe(e,t))return n;let r=Pn(t,e,n.tyenv);return r===void 0?void 0:{...n,tyenv:r}},Lr=(e,t,n)=>{let r=Ir(e,t,n);if(r===void 0)throw new mr;return r},Rr=(e,t,n,r)=>{let i=rr(r,t),a=rr(r,n);if(i.kind===`Abs`&&a.kind===`Abs`){let t=i.name===``?a.name:i.name;return Rr([{name:t,type:i.type},...e],i.body,a.body,Lr(i.type,a.type,r))}return i.kind===`Abs`?Rr([{name:i.name,type:i.type},...e],i.body,A(xr(a),O(0)),r):a.kind===`Abs`?Rr([{name:a.name,type:a.type},...e],A(xr(i),O(0)),a.body,r):Br(e,r,i,a)},zr=(e,t,n,r)=>{if(t.length!==n.length)throw new mr;return t.reduce((t,r,i)=>Rr(e,r,n[i],t),r)},Br=(e,t,n,r)=>{let[i,a]=Re(n),[o,s]=Re(r);if(i.kind===`Var`&&o.kind===`Var`)return i.name===o.name&&i.index===o.index?Pr(t,e,i,Cr(t,a),Cr(t,s)):Fr(t,e,i,Cr(t,a),o,Cr(t,s));if(i.kind===`Var`)return Vr(t,e,i,Cr(t,a),r);if(o.kind===`Var`)return Vr(t,e,o,Cr(t,s),n);if(i.kind===`Const`&&o.kind===`Const`||i.kind===`Free`&&o.kind===`Free`){if(i.name!==o.name)throw new mr;return zr(e,a,s,Lr(i.type,o.type,t))}if(i.kind===`Bound`&&o.kind===`Bound`){if(i.index!==o.index)throw new mr;return zr(e,a,s,t)}throw i.kind===`Abs`||o.kind===`Abs`?new hr:new mr},Vr=(e,t,n,r,i)=>{if(_r(n,i,e))throw new mr;let[a,o]=Mr(i,e,t,r);return Yn(n,br(t,r,a),o)},Hr=(e,t,n)=>{try{return{kind:`unified`,envir:Rr([],e,t,n)}}catch(e){if(e instanceof mr)return{kind:`clash`};if(e instanceof hr)return{kind:`not a pattern`};throw e}},Ur=(e,t,n)=>{let r=Fn(e,t,n);if(r===void 0)throw new gr;return r},Wr=(e,t,n)=>{if(oe(e,t))throw new l(`TERM`,`Vartab.update_new: duplicate`);return ce(e,{name:t.name,index:t.index},{type:t.type,term:n})},Gr=(e,t,n,r)=>{if(n.kind===`Var`){if(e&&Qe(r))throw new gr;let i=Kn(t.tenv,n);if(i===void 0)return{tyenv:Ur(n.type,Ie(r),t.tyenv),tenv:Wr(t.tenv,n,r)};if(cr(r,i))return t;throw new gr}if(n.kind===`Free`&&r.kind===`Free`||n.kind===`Const`&&r.kind===`Const`){if(n.name!==r.name)throw new gr;return{tyenv:Ur(n.type,r.type,t.tyenv),tenv:t.tenv}}if(n.kind===`Bound`&&r.kind===`Bound`){if(n.index!==r.index)throw new gr;return t}if(n.kind===`Abs`&&r.kind===`Abs`)return Gr(!0,{tyenv:Ur(n.type,r.type,t.tyenv),tenv:t.tenv},n.body,r.body);if(n.kind===`App`&&r.kind===`App`)return Gr(e,Gr(e,t,n.fun,r.fun),n.arg,r.arg);if(r.kind===`Abs`)return Gr(!0,t,A(xr(n),O(0)),r.body);throw new gr},Kr=(e,t,n)=>Gr(!1,n,e,t),qr=(e,t,n,r,i)=>{let a=et(i);if(r.length===0){if(a.length===0)return Wr(e,n,i);throw new gr}if(!a.every(e=>r.includes(e)))throw new gr;let o=Ar(r,t.length-1)?i:vr(e=>yr(r,e),i);return Wr(e,n,br(t,r,o))},Jr=(e,t,n)=>{let r=(e,t,n,a)=>{if(t.kind===`Abs`){if(n.kind===`Abs`)return r([{name:n.name,type:n.type},...e],t.body,n.body,a);let i=Ln(a.tyenv,t.type);return r([{name:t.name,type:i},...e],t.body,A(xr(n),O(0)),a)}return n.kind===`Abs`?r([{name:n.name,type:n.type},...e],A(xr(t),O(0)),n.body,a):i(e,a,t,n)},i=(e,t,n,i)=>{let[a,o]=Re(n),s=(n,i)=>{if(o.length!==i.length)throw new gr;return o.reduce((t,n,a)=>r(e,n,i[a],t),{tyenv:n,tenv:t.tenv})};if(a.kind===`Var`){let n=Sr(o),r=Kn(t.tenv,a);if(r===void 0)return{tyenv:t.tyenv,tenv:qr(t.tenv,e,a,n,i)};if(cr(i,Tr(r,n,[])))return t;throw new gr}let[c,l]=Re(i);if(a.kind===`Const`&&c.kind===`Const`||a.kind===`Free`&&c.kind===`Free`){if(a.name!==c.name)throw new gr;return s(Ur(a.type,c.type,t.tyenv),l)}if(a.kind===`Bound`&&c.kind===`Bound`){if(a.index!==c.index)throw new gr;return s(t.tyenv,l)}throw a.kind===`Abs`||c.kind===`Abs`?new hr:new gr},a={tyenv:Ur(Ie(e),Ie(t),n.tyenv),tenv:n.tenv};try{return r([],e,t,a)}catch(n){if(n instanceof hr)return Kr(e,t,a);throw n}},Yr=e=>{try{return e()}catch(e){if(e instanceof gr)return;throw e}},Xr=(e,t,n)=>Yr(()=>Jr(e,t,n)),Zr=(e,t,n)=>Yr(()=>Kr(e,t,n)),Qr=(e,t,n,r)=>Xr(e,t,{tyenv:n,tenv:r})!==void 0,$r=e=>{if(e.kind===`Abs`)return $r(e.body);let[t,n]=Re(e);return t.kind===`Var`?n.every(e=>e.kind===`Bound`)&&!n.some((e,t)=>n.findIndex(t=>j(t,e))!==t):n.every($r)},ei=e=>e.kind===`Abs`?ei(e.body):e.kind!==`App`||e.fun.kind!==`Var`&&ei(e.fun)&&ei(e.arg);var ti=class{},ni=class{};const ri=e=>e.map(e=>e.type),ii=(e,t,n)=>dr(e,ri(t),n),ai=(e,t,n)=>{let r=(t,n)=>{if(t.kind===`Type`&&t.name===`fun`)return k(``,t.args[0],r(t.args[1],A(Ye(1,n),O(0))));if(t.kind===`TVar`){let i=An(e.tyenv,t);return i===void 0?n:r(i,n)}return n},i=(t,n)=>n.kind===`Abs`?k(n.name,n.type,i([{name:n.name,type:n.type},...t],n.body)):r(ii(e,t,n),n);return i(t,n)},oi=(e,t)=>e.name===t.name&&e.index===t.index,si=(e,t,n,r)=>{let i=r=>{if(!(be(r)&1))return!1;switch(r.kind){case`Const`:case`Bound`:case`Free`:return!1;case`Var`:{if(e.some(e=>oi(e,r)))return!1;if(oi(n,r))return!0;e.push(r);let a=Jn(t,r);return a!==void 0&&i(a)}case`Abs`:return i(r.body);case`App`:return i(r.arg)||i(r.fun)}};return r.some(i)},ci=(e,t)=>{if(t.kind===`App`)return ci(e,t.fun);if(t.kind===`Var`){let n=Jn(e,t);return n===void 0?t:ci(e,n)}return t},li=(e,t,n,r)=>{let i=r=>si(e,t,n,[r])?`nonrigid`:`none`,a=e=>{if(e.kind!==`App`)return o(e);let t=o(e.arg);if(t===`rigid`)return`rigid`;let n=a(e.fun);return n===`none`?t:n},o=r=>{switch(r.kind){case`Const`:case`Bound`:case`Free`:return`none`;case`Var`:{if(e.some(e=>oi(e,r)))return`none`;if(oi(n,r))return`rigid`;e.push(r);let i=Jn(t,r);return i===void 0?`none`:o(i)}case`Abs`:return o(r.body);case`App`:{let e=ci(t,r.fun);return e.kind===`Var`?oi(n,e)?`rigid`:i(r):e.kind===`Abs`?i(r):a(r)}}};return o(r)},ui=(e,t,n)=>{let r=Ir(e,t,n);if(r===void 0)throw new ti;return r},di=(e,t,n)=>{if(e.length===0)return n.kind===`Var`?n:void 0;if(n.kind===`App`&&n.arg.kind===`Bound`&&n.arg.index===t)return di(e.slice(1),t+1,n.fun)},fi=(e,t,n,r)=>{let i=di(e,0,t);if(i===void 0)return;let a=li([],r,i,n);if(a===`nonrigid`)return;if(a===`rigid`)throw new ti;let o=ui(lr(r,i.type),ii(r,e,n),r);return Yn(i,qt(e,n),o)},pi=(e,t,n,r)=>{if(t.kind===`Abs`&&n.kind===`Abs`){let i=ui(t.type,n.type,r),a=t.name===``?n.name:t.name;return pi([{name:a,type:t.type},...e],t.body,n.body,i)}if(t.kind===`Abs`||n.kind===`Abs`)throw new l(`TERM`,`new_dpair`);return[{binders:e,left:t,right:n},r]},mi=(e,t)=>pi(t.binders,ai(e,t.binders,rr(e,t.left)),ai(e,t.binders,rr(e,t.right)),e),hi=(e,t)=>{let[n,r]=mi(t.envir,e),i=(e,t,r)=>{if(e.kind===`App`&&t.kind===`App`)return hi({binders:n.binders,left:e.arg,right:t.arg},i(e.fun,t.fun,r));if(e.kind===`App`||t.kind===`App`)throw new l(`TERM`,`SIMPL: operands mismatch`);return r},a=ze(n.left),o=ze(n.right),s={flexflex:t.flexflex,flexrigid:t.flexrigid};if(a.kind===`Var`&&o.kind===`Var`)return{envir:ui(lr(r,a.type),lr(r,o.type),r),flexflex:[n,...t.flexflex],flexrigid:t.flexrigid};if(a.kind===`Var`){let e=fi(n.binders,n.left,n.right,r);return e===void 0?{envir:r,flexflex:t.flexflex,flexrigid:[n,...t.flexrigid]}:{envir:e,...s}}if(o.kind===`Var`){let e=fi(n.binders,n.right,n.left,r);return e===void 0?{envir:r,flexflex:t.flexflex,flexrigid:[{binders:n.binders,left:n.right,right:n.left},...t.flexrigid]}:{envir:e,...s}}if(a.kind===`Const`&&o.kind===`Const`||a.kind===`Free`&&o.kind===`Free`){if(a.name!==o.name)throw new ti;return i(n.left,n.right,{envir:ui(a.type,o.type,r),...s})}if(a.kind===`Bound`&&o.kind===`Bound`){if(a.index!==o.index)throw new ti;return i(n.left,n.right,{envir:r,...s})}throw new ti},gi=(e,t)=>t.kind===`App`?gi(e,t.fun):t.kind===`Var`&&Jn(e,t)!==void 0,_i=(e,t)=>{let n=t.reduceRight((e,t)=>hi(t,e),{envir:e,flexflex:[],flexrigid:[]}),r=[...n.flexrigid,...n.flexflex];return r.some(e=>gi(n.envir,e.left)||gi(n.envir,e.right))?_i(n.envir,r):n},vi=(e,t,n,r)=>{if(r.length===0)return[n,[]];let[i,a]=Wn(e,n,r.map(e=>Ae(t,e)));return[i,a.map(e=>Kt(e,0,t.length))]},yi=(e,t)=>e.reduceRight((e,t)=>k(``,t,e),t),bi=(e,t)=>[ur(e,t),lr(e,t)],xi=e=>{let t=(n,r,i,a,o)=>{let s=(e,i)=>En(e=>({args:[e.term,...i.args],envir:e.envir,dpairs:e.dpairs}),t(n,r,ai(i.envir,n,rr(i.envir,e)),i.envir,i.dpairs)),c=e=>e.length===0?hn({args:[],envir:a,dpairs:o},mn):Dn(t=>s(e[0],t),c(e.slice(1))),[l,u]=Re(i),d=lr(a,ii(a,n,l)),f=r.map(e=>ii(a,n,e)),p=(t,s,c,l,u)=>{let p=Ir(d,c,a);return p===void 0?u:pn(()=>{try{let[a,c]=vi(e,f,p,s),d={binders:n,left:Le(l,c.map(e=>Le(ze(e),r))),right:i},m=_i(a,[d,...o]);return[{term:Le(t,c),envir:m.envir,dpairs:[...m.flexrigid,...m.flexflex]},u]}catch(e){if(e instanceof ti)return u;throw e}})},m=e=>({term:Le(l,e.args),envir:e.envir,dpairs:e.dpairs}),h=e=>{if(e.length>0){let[t,n,r]=e[0],[i,o]=bi(a,n);return p(t,i,o,r,h(e.slice(1)))}return l.kind===`Const`||l.kind===`Free`?En(m,c(u)):mn};if(l.kind===`Abs`)return En(e=>({...e,term:k(l.name,l.type,e.term)}),t([{name:l.name,type:l.type},...n],[...r.map(e=>Ye(1,e)),O(0)],l.body,a,o));if(l.kind===`Var`){let[e,t]=Gn(l.name,a,Ae(f,d));return gn({term:Kt(t,0,f.length),envir:e,dpairs:[{binders:n,left:Le(t,r),right:i},...o]})}return h(f.map((e,t)=>[O(f.length-1-t),e,r[t]]).reverse())};return t},Si=(e,t,n)=>{let[r,i]=Re(t.left);if(r.kind!==`Var`)throw new l(`TERM`,`MATCH`);let a=ur(e,r.type);return En(e=>{let t=Jn(e.envir,r);return t===void 0?[Yn(r,yi(a,e.term),e.envir),e.dpairs]:[e.envir,[{binders:[],left:t,right:yi(a,e.term)},...e.dpairs]]},xi(r.name)(t.binders,i,t.right,e,n))},Ci=(e,t,n,r)=>{let i=di(t,0,n);if(i===void 0||si([],e,i,[r]))return;let a=ui(lr(e,i.type),ii(e,t,r),e);return Zn(i,qt(t,r),a)},wi=(e,t,n)=>{let[r,i]=Re(n);return r.kind===`Bound`?t.includes(r.index-e)||i.some(n=>wi(e,t,n)):r.kind===`Var`?!1:r.kind===`Abs`&&wi(e+1,t,r.body)||i.some(n=>wi(e,t,n))},Ti=(e,t)=>{let n=(t,r)=>{if(r.kind===`Bound`){if(r.index<t)return r;if(e.includes(r.index-t))throw new ni;return O(r.index-e.filter(e=>e<r.index-t).length)}return r.kind===`Abs`?k(r.name,r.type,n(t+1,r.body)):r.kind===`App`?A(n(t,r.fun),n(t,r.arg)):r};return n(0,t)},Ei=e=>{let t=(e,t)=>e.term.kind===`Bound`&&t.term.kind===`Bound`&&t.term.index<e.term.index,n=(e,r)=>r.length===0?[e]:t(r[0],e)?[r[0],...n(e,r.slice(1))]:[e,...r];return e.length===0?[]:n(e[0],Ei(e.slice(1)))},Di=(e,t)=>t.length===0?e===0:t[0].index===e-1&&Di(e-1,t.slice(1)),Oi=(e,t,n)=>{let[r,i]=Re(n);if(r.kind!==`Var`)throw new l(`TERM`,`clean_term`);let[a,o]=bi(t,r.type);if(i.length!==a.length)throw new ni;let s=i.map((e,t)=>({index:i.length-1-t,term:e,type:a[t]})).reduceRight((t,n)=>wi(0,e,n.term)?t:[{...n,term:Ti(e,n.term)},...t],[]),c=Ei(s);if(Di(a.length,c))return[t,Le(r,c.map(e=>e.term))];let[u,d]=Gn(r.name,t,Ae(c.map(e=>e.type),o)),f=Le(d,c.map(e=>O(e.index))),p=Zn(r,yi(a,f),u);return[p,tr(p,Le(d,c.map(e=>e.term)))]},ki=(e,t,n,r)=>{if(j(t,n))return[...r];let i=qt(e,t),a=qt(e,n);return r.some(e=>j(i,e[0])&&j(a,e[1]))?[...r]:[[i,a],...r]},Ai=(e,t,n)=>{try{let r=et(e.left),i=et(e.right),a=[],o=[];for(let t=e.binders.length-1;t>=0;--t)r.includes(t)&&i.includes(t)?o.unshift(e.binders[t]):a.unshift(t);let[s,c]=Oi(a,t,e.left),[l,u]=Oi(a,s,e.right),d=Ci(l,o,c,u)??Ci(l,o,u,c);return d===void 0?[l,ki(o,c,u,n)]:[d,[...n]]}catch(r){if(r instanceof ni)return[t,ki(e.binders,e.left,e.right,n)];throw r}},ji=(e,t,n)=>{let r=tr(t,e.left),i=tr(t,e.right),a=ze(r),o=ze(i);if(a.kind!==`Var`||o.kind!==`Var`)throw new l(`TERM`,`add_ffpair: Vars expected`);if(oi(a,o)){if(!Pe(a.type,o.type))throw new l(`TERM`,`add_ffpair: Var name confusion`);return[t,ki(e.binders,r,i,n)]}return ge(a,o)<0?Ai({binders:e.binders,left:i,right:r},t,n):Ai({binders:e.binders,left:r,right:i},t,n)},Mi=(e,t,n,r)=>{let i=(t,n,r,a)=>pn(()=>{e!==void 0&&pr(e);try{let e=_i(n,r);if(e.flexrigid.length===0){let t=e.flexflex.reduceRight((e,t)=>ji(t,e[0],e[1]),[e.envir,[]]);return[{envir:t[0],tpairs:t[1]},a]}if(t>60)return a;let[o,...s]=e.flexrigid;return On((e,n)=>i(t+1,e[0],e[1],n),Si(e.envir,o,[...s,...e.flexflex]),a)}catch(e){if(e instanceof ti)return a;throw e}});return i(1,n,r.map(e=>({binders:t,left:e[0],right:e[1]})),mn)},Ni=(e,t,n)=>{let r=t;for(let i of n){let a=Hr(i[0],i[1],r);if(a.kind===`clash`)return mn;if(a.kind===`not a pattern`)return Mi(e,[],t,n);r=a.envir}return gn({envir:r,tpairs:[]})},Pi=(e,t)=>{let n=ze(Be(tr(e,t)));if(n.kind!==`Var`)throw new l(`ERROR`,`CANTUNIFY`);return n},Fi=(e,t,n)=>yi(ur(e,t),n),Ii=(e,t)=>{let n=Pi(t,e[0]),r=Pi(t,e[1]),[i,a]=Gn(n.name,t,lr(t,n.type)),o=Zn(r,Fi(i,r.type,a),i);return oi(n,r)&&Pe(n.type,r.type)?o:Zn(n,Fi(i,n.type,a),o)},Li=(e,t,n)=>En(e=>e.tpairs.reduceRight((e,t)=>Ii(t,e),e.envir),Ni(e,n,t)),Ri=e=>e.kind===`App`&&e.fun.kind===`App`&&e.fun.fun.kind===`Const`&&e.fun.fun.name===`Pure.imp`,zi=e=>e.kind===`App`&&e.fun.kind===`Const`&&e.fun.name===`Pure.all`&&e.arg.kind===`Abs`,Bi=(e,t,n)=>Ri(t)&&Ri(n)?A(A(t.fun.fun,n.fun.arg),Bi(e,t.arg,n.arg)):zi(t)&&zi(n)?A(t.fun,k(n.arg.name,n.arg.type,Bi(e,t.arg.body,n.arg.body))):e(n),Vi=(e,t)=>Ri(e)&&Ri(t)?Vi(e.arg,t.arg):zi(e)&&zi(t)?Vi(e.arg.body,t.arg.body):t,Hi=(e,t)=>mt((e,t)=>t.add(e.name),e,t),Ui=e=>{let t=/* @__PURE__ */ new Map;for(let n of e)t.has(n[0])||t.set(n[0],n[1]);return t},Wi=(e,t,n,r)=>{let i=e.reduceRight((e,t)=>Ct(t[0],t[1],e),[]);if(i.length===0)return;let a=/* @__PURE__ */ new Set;for(let t of e)Hi(t[0],a);for(let e of t)Hi(e[0],a),Hi(e[1],a);let o=/* @__PURE__ */ new Set;for(let e of r)Hi(Vi(n,e),o);let s=i.filter(e=>o.has(e[0])&&!a.has(e[0])&&!a.has(e[1])),c=s.filter((e,t)=>s.findIndex(t=>t[0]===e[0])===t),l=new Set([...o].filter(e=>!c.some(t=>t[0]===e))),u=(e,t,n,r,i)=>{if(r.length===0)return e?u(!1,t,new Set(t),i,[]):i;let[a,...o]=r;return n.has(a[1])?u(!0,new Set(t).add(a[0]),new Set(n).add(a[0]),o,i):u(e,t,new Set(n).add(a[1]),o,[a,...i])},d=Ui(u(!1,l,new Set(l),c,[])),f=Ui(i);if([...d].every(e=>e[0]===e[1])&&[...f].every(e=>e[0]===e[1]))return;let p=e=>{switch(e.kind){case`Var`:{let t=d.get(e.name)??e.name;return t===e.name?e:D(t,e.index,e.type)}case`Abs`:return k(f.get(e.name)??e.name,e.type,p(e.body));case`App`:return A(p(e.fun),p(e.arg));default:return e}};return p},Gi=(e,t)=>{if(Ri(e)&&Ri(t))return Gi(e.arg,t.arg);if(zi(e)&&zi(t)){let[n,r]=Gi(e.arg.body,t.arg.body);return[k(e.arg.name,e.arg.type,n),k(e.arg.name,e.arg.type,r)]}return[e,t]},Ki=(e,t,n)=>{if(t===0)return tr(e,n);if(zi(n)){let r=In(e.tyenv,n.arg.type);return A(Dt(r),k(n.arg.name,r,Ki(e,t,n.arg.body)))}if(Ri(n))return Pt(n.fun.arg,Ki(e,t-1,n.arg));throw new l(`ERROR`,`norm_term_skip: too few assumptions??`)},qi=(e,t,n)=>{let r=/* @__PURE__ */ new Map,i=e=>mt((e,t)=>{let n=`${e.index}:${e.name}`,r=t.get(n)??[];return r.some(t=>Pe(t,e.type))||t.set(n,[e.type,...r]),t},e,r);for(let n of[e,t]){for(let e of n.tpairs)i(e[0]),i(e[1]);i(n.prop)}let a=n;for(let e of r.values())for(let t of e.slice(1))a&&=Ir(e[0],t,a);return a},Ji=(e,t,n,r)=>({maxidx:e,hyps:t,tpairs:n,prop:r}),Yi=(e,t)=>t.length===0?e:e.length===0?t:[...e,...t.filter(t=>!e.some(e=>j(t,e)))],Xi=(e,t)=>t.length===0?e:[...e,...t.filter(t=>!e.some(e=>j(t[0],e[0])&&j(t[1],e[1])))],Zi=(e,t)=>e.reduce((e,t)=>ve(t[1],ve(t[0],e)),t),Qi=e=>Ji(ve(e),[],[],e),$i=e=>Vt(e.prop),ea=e=>Rt(e.prop),ta=e=>zt(e.prop),na=e=>{let t=ea(e)[0];if(t===void 0)throw new l(`THM`,`major_prem_of: rule with no premises`);return tn(t)},ra=(e,t)=>{let n=ea(e)[t-1];if(n===void 0)throw new l(`THM`,`No subgoal ${t}`);return n},ia=e=>{if(!Pe(Ie(e),Oe))throw new l(`THM`,`assume: prop`);if(ve(e)!==-1)throw new l(`THM`,`assume: variables`);return Ji(-1,[e],[],e)},aa=(e,t)=>{if(!Pe(Ie(e),Oe))throw new l(`THM`,`implies_intr: assumptions must have type prop`);return Ji(Math.max(ve(e),t.maxidx),t.hyps.filter(t=>!j(t,e)),t.tpairs,Pt(e,t.prop))},oa=(e,t)=>{let n=e.prop;if(n.kind!==`App`||n.fun.kind!==`App`||n.fun.fun.kind!==`Const`||n.fun.fun.name!==`Pure.imp`||!j(n.fun.arg,t.prop))throw new l(`THM`,`implies_elim: major premise`);return Ji(Math.max(e.maxidx,t.maxidx),Yi(t.hyps,e.hyps),Xi(t.tpairs,e.tpairs),n.arg)},sa=(e,t,n)=>{let r=t=>Et(e,t);return t.some(r)||n.some(e=>r(e[0])||r(e[1]))},ca=(e,t)=>{if(e.kind!==`Free`&&e.kind!==`Var`)throw new l(`THM`,`forall_intr: not a variable`);if(sa(e,e.kind===`Free`?t.hyps:[],t.tpairs))throw new l(`THM`,`forall_intr: variable "${e.name}" free in assumptions`);return Ji(Math.max(ve(e),t.maxidx),t.hyps,t.tpairs,A(Dt(e.type),k(e.name,e.type,ut(e,t.prop))))},la=(e,t)=>{let n=t.prop;if(n.kind!==`App`||n.fun.kind!==`Const`||n.fun.name!==`Pure.all`||n.fun.type.kind!==`Type`||n.fun.type.args[0].kind!==`Type`)throw new l(`THM`,`forall_elim: not quantified`);if(!Pe(Ie(e),n.fun.type.args[0].args[0]))throw new l(`THM`,`forall_elim: type mismatch`);return Ji(Math.max(ve(e),t.maxidx),t.hyps,t.tpairs,it(n.arg,e))},ua=e=>Ji(ve(e),[],[],kt(e,e)),da=e=>{let t=e.prop;return t.kind===`App`&&t.fun.kind===`App`&&t.fun.fun.kind===`Const`&&t.fun.fun.name===`Pure.eq`?[t.fun.fun,t.fun.arg,t.arg]:void 0},fa=e=>{let t=da(e);if(t===void 0)throw new l(`THM`,`symmetric`);return Ji(e.maxidx,e.hyps,e.tpairs,A(A(t[0],t[2]),t[1]))},pa=(e,t)=>{let n=da(e),r=da(t);if(n===void 0||r===void 0)throw new l(`THM`,`transitive: premises`);if(!j(n[2],r[1]))throw new l(`THM`,`transitive: middle term`);return Ji(Math.max(e.maxidx,t.maxidx),Yi(e.hyps,t.hyps),Xi(e.tpairs,t.tpairs),A(A(n[0],n[1]),r[2]))},ma=(e,t)=>{if(!e&&(t.kind!==`App`||t.fun.kind!==`Abs`))throw new l(`THM`,`beta_conversion: not a redex`);let n=e||t.kind!==`App`||t.fun.kind!==`Abs`?nr(t):rt(t.arg,t.fun.body);return Ji(ve(t),[],[],kt(t,n))},ha=e=>Ji(ve(e),[],[],kt(e,sr(e))),ga=(e,t,n)=>{let r=da(n);if(r===void 0)throw new l(`THM`,`abstract_rule: premise not an equality`);if(t.kind!==`Free`&&t.kind!==`Var`)throw new l(`THM`,`abstract_rule: not a variable`);if(sa(t,t.kind===`Free`?n.hyps:[],n.tpairs))throw new l(`THM`,`abstract_rule: variable "${t.name}" free in assumptions`);return Ji(n.maxidx,n.hyps,n.tpairs,kt(k(e,t.type,ut(t,r[1])),k(e,t.type,ut(t,r[2]))))},_a=(e,t)=>{let n=da(e),r=da(t);if(n===void 0||r===void 0)throw new l(`THM`,`combination: premises`);let i=Ie(n[1]);if(i.kind!==`Type`||i.name!==`fun`)throw new l(`THM`,`combination: not function type`);if(!Pe(i.args[0],Ie(r[1])))throw new l(`THM`,`combination: types`);return Ji(Math.max(e.maxidx,t.maxidx),Yi(e.hyps,t.hyps),Xi(e.tpairs,t.tpairs),kt(A(n[1],r[1]),A(n[2],r[2])))},va=(e,t)=>{let n=da(e);if(n===void 0)throw new l(`THM`,`equal_elim: major premise`);if(!j(t.prop,n[1]))throw new l(`THM`,`equal_elim: not equal`);return Ji(Math.max(e.maxidx,t.maxidx),Yi(e.hyps,t.hyps),Xi(e.tpairs,t.tpairs),n[2])},ya=(e,t)=>En(e=>{if(Hn(e))return t;let n=t.tpairs.map(t=>[tr(e,t[0]),tr(e,t[1])]).filter(e=>!j(e[0],e[1])),r=tr(e,t.prop);return Ji(Zi(n,ve(r)),t.hyps,n,r)},Li(e,t.tpairs,Bn(t.maxidx))),ba=(e,t,n)=>{if(e.length===0)return n;if(t<=n.maxidx)throw new l(`THM`,`generalize: bad index`);if(n.hyps.some(t=>_t(t=>t.kind===`Free`&&e.includes(t.name),t)))throw new l(`THM`,`generalize: variable free in assumptions`);let r=n=>{switch(n.kind){case`Free`:return e.includes(n.name)?D(n.name,t,n.type):n;case`Abs`:return k(n.name,n.type,r(n.body));case`App`:return A(r(n.fun),r(n.arg));default:return n}},i=r(n.prop),a=n.tpairs.map(e=>[r(e[0]),r(e[1])]);return Ji(Zi(a,ve(i)),n.hyps,a,i)},xa=(e,t)=>{let n=t=>e.find(e=>e.variable.name===t.name&&e.variable.index===t.index&&Pe(e.variable.type,t.type))?.term,r=e=>{switch(e.kind){case`Var`:return n(e)??e;case`Abs`:{let t=r(e.body);return t===e.body?e:k(e.name,e.type,t)}case`App`:{let t=r(e.fun),n=r(e.arg);return t===e.fun&&n===e.arg?e:A(t,n)}default:return e}};return r(t)},Sa=(e,t)=>{if(e.length===0)return t;for(let t of e)if(!Pe(t.variable.type,Ie(t.term)))throw new l(`THM`,`instantiate: type conflict`);let n=xa(e,t.prop),r=t.tpairs.map(t=>[xa(e,t[0]),xa(e,t[1])]);return Ji(Zi(r,ve(n)),t.hyps,r,n)},Ca=(e,t)=>{if(ve(t)<0)return t;switch(t.kind){case`Const`:return Te(t.name,Ln(e,t.type));case`Free`:return Ee(t.name,Ln(e,t.type));case`Var`:return D(t.name,t.index,Ln(e,t.type));case`Bound`:return t;case`Abs`:return k(t.name,Ln(e,t.type),Ca(e,t.body));case`App`:return A(Ca(e,t.fun),Ca(e,t.arg))}},wa=(e,t)=>{let n=Ca(e,t.prop),r=t.tpairs.map(t=>[Ca(e,t[0]),Ca(e,t[1])]);return Ji(Zi(r,ve(n)),t.hyps,r,n)},Ta=(e,t)=>{if(!j(e,t.prop))throw new l(`TERM`,`renamed_prop: props disagree`);return Ji(t.maxidx,t.hyps,t.tpairs,e)},Ea=e=>{if(!Pe(Ie(e),Oe))throw new l(`THM`,`trivial: the term must have type prop`);return Ji(ve(e),[],[],Pt(e,e))},Da=(e,t)=>{let n=Rt(e.prop);if(t<1||t>n.length)throw new l(`THM`,`dest_state ${t}`);return{tpairs:e.tpairs,before:n.slice(0,t-1),goal:n[t-1],conclusion:Lt(n.slice(t),zt(e.prop))}},Oa=(e,t,n)=>{let r=t+1,i=Rt(n.prop).map(t=>$t(r,e,t));return Ji(n.maxidx+r,n.hyps,n.tpairs.map(t=>[Qt(r,e,t[0]),Qt(r,e,t[1])]),Lt(i,$t(r,e,zt(n.prop))))},ka=(e,t)=>{if(e<0)throw new l(`THM`,`negative increment`);return e===0?t:Ji(t.maxidx+e,t.hyps,t.tpairs.map(t=>[Xt([],e,t[0]),Xt([],e,t[1])]),Xt([],e,t.prop))},Aa=(e,t,n)=>{let r=Da(n,t),i=e=>{let t=e.envir,i=Hn(t),a=Lt(r.before,r.conclusion);return Ji(t.maxidx,n.hyps,i?e.tpairs:e.tpairs.map(e=>[tr(t,e[0]),tr(t,e[1])]),i?a:tr(t,a))},a=un(-1,r.goal),o=a.abstract(a.conclusion),s=t=>t>=a.hyps.length?mn:dn(()=>{let c=a.hyps[t];return Cn(i,ct(c,a.conclusion)?Ni(e,Bn(n.maxidx),[[a.abstract(c),o],...r.tpairs]):mn,s(t+1)).pull()});return s(0)},ja=(e,t)=>{let n=Da(t,e),r=un(-1,n.goal),i=sr(r.conclusion);if(!r.hyps.some(e=>j(e,r.conclusion)||j(sr(e),i)))throw new l(`THM`,`eq_assumption`);return Ji(t.maxidx,t.hyps,t.tpairs,Lt(n.before,n.conclusion))},Ma=(e,t,n)=>{let r=Da(n,t),i=We(r.goal),a=Ue(r.goal),o=Rt(a),s=zt(a),c=o.length,u=e<0?c+e:e;if(u<0||u>c)throw new l(`THM`,`rotate_rule ${e}`);let d=u===0||u===c?r.goal:Ot(i,Lt([...o.slice(u),...o.slice(0,u)],s)),f=Rt(n.prop);return Ji(n.maxidx,n.hyps,n.tpairs,Lt([...r.before,d,...f.slice(t)],zt(n.prop)))},Na=(e,t,n)=>{let r=Rt(n.prop),i=zt(n.prop);if(e>r.length)throw new l(`THM`,`permute_prems: j ${e}`);let a=r.slice(e),o=t<0?a.length+t:t;if(o===0||o===a.length)return n;if(o<0||o>a.length)throw new l(`THM`,`permute_prems: k ${t}`);return Ji(n.maxidx,n.hyps,n.tpairs,Lt([...r.slice(0,e),...a.slice(o),...a.slice(0,o)],i))};var Pa=class{};const Fa=(e,t,n,r,i,a)=>{let o=a.rule,s=Vt(Ue(r.goal))+(a.isElim?-1:0),c=(e,a,c)=>{try{let l=a.envir,u=e=>tr(l,e),[d,f,p]=(()=>{if(Hn(l))return[a.tpairs,[...r.before,...e.premises],r.conclusion];let o=a.tpairs.map(e=>[u(e[0]),u(e[1])]);if(Xn(l,n.maxidx))return i?[o,[...r.before,...e.premises.map(e=>Ki(l,s,e))],r.conclusion]:[o,[...r.before,...e.premises.map(u)],r.conclusion];if(t.match)throw new Pa;return[o,[...r.before,...e.premises].map(u),u(r.conclusion)]})();return hn(Ji(l.maxidx,Yi(o.hyps,n.hyps),d,Lt(f,p)),c)}catch(e){if(e instanceof Pa)return c;throw e}},u=(()=>{try{return Bt(a.subgoals,[],o.prop)}catch(e){throw e instanceof l&&e.exception===`TERM`?new l(`THM`,`bicompose: rule`):e}})(),d=u[0],f=u[1],p=(e,n,r,a)=>{let o=i?Wi(r,a,f,e):void 0,s=o===void 0?[...e]:e.map(e=>Bi(o,f,e));try{return{premises:t.flatten?s.map(e=>sn(n,e)):s}}catch(e){throw e instanceof l&&e.exception===`TERM`?new l(`THM`,`bicompose: 1st premise`):e}},m=i?Gi(f,r.goal):[f,r.goal],h=[m,...o.tpairs,...r.tpairs],g=(t,n)=>{if(n.length===0)throw new l(`THM`,`bicompose: no premises`);let r=n[0],i=n.slice(1),a=un(s+1,r),o=a.abstract(a.conclusion),u=n=>{for(let r=n;r<a.hyps.length;r+=1){let n=a.hyps[r];if(!ct(n,a.conclusion))continue;let s=a.abstract(n),l=Ni(e,t,[[s,o],...h]).pull();if(l===void 0)continue;let d=p(i,r+1,[m,[o,s]],l[0].tpairs);return On((e,t)=>c(d,e,t),dn(()=>l),pn(()=>u(r+1)))}return mn};return u(0)},_=t=>{let n=Ni(e,t,h).pull();if(n===void 0)return mn;let r=p([...d].reverse(),0,[m],n[0].tpairs);return On((e,t)=>c(r,e,t),dn(()=>n),mn)},v=Bn(Math.max(o.maxidx,n.maxidx)),y=t.incremented?v:qi(n,o,v);return y===void 0?mn:a.isElim?g(y,[...d].reverse()):_(y)},Ia=(e,t,n,r,i)=>Fa(e,t,i,Da(i,r),!1,n),La=(e,t,n,r)=>{if(!ct(ta(r),t))return!1;if(!n)return!0;let i=ea(r)[0];return i!==void 0&&e.some(e=>ct(i,e))},Ra=(e,t,n,r,i)=>{let a=Da(i,r),o=tn(a.goal),s=en(a.goal),c=r=>{for(let l=r;l<n.length;l+=1){let r=n[l];if(La(s,o,r.isElim,r.rule))return dn(()=>[Fa(e,{flatten:!0,match:t,incremented:!0},i,a,!0,{isElim:r.isElim,rule:Oa(a.goal,i.maxidx,r.rule),subgoals:$i(r.rule)}),c(l+1)])}return mn};return Tn(c(0))},za=(e,t,n)=>{let[r]=bn(2,Ra(void 0,!1,[{isElim:!1,rule:e}],t,n));if(r.length===0)throw new l(`THM`,`RSN: no unifiers ${t}`);if(r.length>1)throw new l(`THM`,`RSN: multiple unifiers ${t}`);return r[0]},Ba=(e,t)=>za(e,1,t),Va=e=>gn(e),Ha=()=>mn,Ua=(e,t)=>n=>Dn(t,e(n)),Wa=(e,t)=>n=>{let r=e(n).pull();return r===void 0?t(n):_n(r)},Ga=(e,t)=>n=>Sn(e(n),pn(()=>t(n))),Ka=(e,t,n)=>r=>{let i=e(r).pull();return i===void 0?n(r):Dn(t,_n(i))},qa=(e,t)=>n=>Ua(e(n),t(n)),Ja=(e,t)=>n=>Wa(e(n),t(n)),Ya=(e,t)=>n=>Ga(e(n),t(n)),Xa=e=>t=>dn(()=>{let n=e(t).pull();return n===void 0?void 0:[n[0],mn]}),Za=e=>Wa(e,Va),Qa=(e,t)=>e===t||j(e.prop,t.prop)&&e.hyps.length===t.hyps.length&&e.hyps.every(e=>t.hyps.some(t=>j(e,t)))&&e.tpairs.length===t.tpairs.length&&e.tpairs.every((e,n)=>j(e[0],t.tpairs[n][0])&&j(e[1],t.tpairs[n][1])),$a=(e,t)=>j(e.prop,t.prop),eo=e=>{let t=(e,r,i)=>{if(r.length===0)return dn(()=>[i,dn(()=>n(e).pull())]);let a=r[0](i).pull();return a===void 0?n(e):t([{state:a[0],rest:a[1],tactics:r.slice(1)},...e],r.slice(1),a[0])},n=e=>{let n=e;for(;n.length>0;){let e=n[0],r=e.rest.pull();if(r===void 0)n=n.slice(1);else if(Qa(e.state,r[0]))n=[{...e,rest:r[1]},...n.slice(1)];else return t([{state:r[0],rest:r[1],tactics:e.tactics},...n.slice(1)],e.tactics,r[0])}return mn};return n=>t([],e,n)},to=e=>e.reduceRight((e,t)=>Wa(t,e),Ha),no=e=>t=>to(e.map(e=>e(t))),ro=(e,t)=>n=>dn(()=>{let r=n,i=e;for(;i!==0;){let e=t(r).pull();if(e===void 0)break;r=e[0],--i}return[r,mn]}),io=e=>ro(-1,e),ao=e=>Ua(Xa(e),io(e)),oo=e=>t=>wn(e=>!Qa(t,e),e(t)),so=e=>t=>wn(e=>!$a(t,e),e(t)),co=e=>t=>{let n=t=>t===0?Va:Ua(e(t),n(t-1));return n($i(t))(t)},lo=e=>t=>{let n=$i(t),r=t=>t>n?Ha:Wa(e(t),r(t+1));return r(1)(t)},uo=e=>e instanceof l&&e.exception===`THM`,fo=e=>t=>n=>t<1||t>$i(n)?mn:e(ra(n,t),t)(n),po=(e,t,n)=>n<t?Va:Ua(e(n),po(e,t,n-1)),mo=(e,t)=>n=>r=>Ua(e(n),e=>po(t,n,n+$i(e)-$i(r))(e))(r),ho=e=>mo(e,t=>Za(ho(e)(t))),go=e=>t=>{try{return e(t)}catch(e){if(uo(e))return mn;throw e}},_o=e=>go(t=>gn(e(t))),vo=(e,t,n)=>r=>e(r)?t(r):n(r),yo=(e,t)=>{let n=(e,t)=>{for(let n=e;n!==void 0;n=n.tail)if(Qa(n.head,t))return!0;return!1},r=(i,a)=>{let o=a;for(;o!==void 0;){let a=o.head.pull();if(a===void 0){o=o.tail;continue}let s=a[0],c=fr(a[1],o.tail);if(e(s)&&!n(i,s))return[s,dn(()=>r(fr(s,i),c))];o=fr(t(s),c)}};return e=>dn(()=>r(void 0,fr(gn(e),void 0)))},bo=e=>t=>$i(t)<e,xo=e=>yo(bo(1),e),M=e=>D(e,0,Oe);Qi(Pt(Pt(M(`psi`),M(`theta`)),Pt(M(`psi`),M(`theta`))));const So=Qi(Pt(M(`V`),Pt(Pt(M(`V`),M(`W`)),M(`W`)))),Co=Qi(Pt(M(`V`),Pt(M(`W`),M(`W`)))),wo=Qi(Pt(M(`psi`),M(`psi`))),To=Qi(Pt(M(`phi`),Pt(M(`phi`),Pt(M(`psi`),M(`psi`))))),Eo=Qi(Pt(M(`A`),Ut(M(`A`)))),Do=Qi(Pt(Ut(M(`A`)),M(`A`))),Oo=Qi(kt(D(`x`,0,we(`'a`,0)),D(`x`,0,we(`'a`,0)))),ko=we(`'a`,0),Ao=Qi(Gt(D(`x`,0,ko))),jo=Qi(Pt(Pt(M(`A`),kt(M(`B`),M(`C`))),kt(Pt(M(`A`),M(`B`)),Pt(M(`A`),M(`C`))))),Mo=Qi(kt(Pt(M(`A`),Pt(M(`B`),M(`C`))),Pt(M(`B`),Pt(M(`A`),M(`C`))))),No=Qi(Pt(kt(D(`x`,0,ko),D(`y`,0,ko)),kt(D(`y`,0,ko),D(`x`,0,ko)))),Po=Qi(kt(A(Dt(ko),k(`x`,ko,M(`V`))),M(`V`))),Fo=Qi(kt(Pt(M(`phi`),A(Dt(ko),k(`x`,ko,A(D(`psi`,0,ke(ko,Oe)),O(0))))),A(Dt(ko),k(`x`,ko,Pt(M(`phi`),A(D(`psi`,0,ke(ko,Oe)),O(0))))))),Io=(e,t)=>t.kind===`Const`?t.name!==`Pure.sort_constraint`:t.kind===`Abs`?Io(e,t.body):t.kind===`App`?t.fun.kind===`Abs`||t.fun.kind===`App`&&t.fun.fun.kind===`Const`&&t.fun.fun.name===`Pure.imp`&&t.arg.kind===`App`&&t.arg.fun.kind===`Const`&&t.arg.fun.name===`Pure.all`?!1:Wt(t)?e||Io(e,t.arg):Io(e,t.fun)&&Io(e,t.arg):!0,Lo=e=>{let t=We(e),n=S([],t.map(e=>_(e.name)));return t.map((e,t)=>({name:n[t],type:e.type}))},Ro=e=>{let t=Math.max(e.maxidx,-1)+1;return Lo(e.prop).reduce((e,n)=>la(D(n.name,t,n.type),e),e)},zo=e=>Vo(e).reduce((e,t)=>mt((e,t)=>t.some(t=>t.name===e.name&&t.index===e.index)?t:[...t,e],t,e),[]).reduceRight((e,t)=>ca(t,e),e),Bo=(e,t)=>x(e.startsWith(`:`)?`u`:e,t),Vo=e=>[...e.tpairs.flatMap(e=>[e[0],e[1]]),e.prop],Ho=e=>{let t=Vo(e),n=t.reduce((e,t)=>gt((e,t)=>ht((e,t)=>e.kind===`TVar`?ce(t,e,e):t,e,t),t,e),re(he)),r=y,i=re(he);for(let[e,t]of fe(n)){let[n,a]=Bo(e.name,r);r=a,(n!==e.name||e.index!==0)&&(i=ce(i,e,we(n,0,t.kind===`TVar`?t.sort:[])))}let a=t.reduce((e,t)=>mt((e,t)=>ae(t,e)===void 0?ce(t,e,D(e.name,e.index,In(i,e.type))):t,t,e),re(he));r=y;let o=[];for(let[e,t]of fe(a)){let[n,i]=Bo(e.name,r);r=i,(n!==e.name||e.index!==0)&&o.push({variable:t,term:D(n,0,t.type)})}return Sa(o,wa(i,e))},Uo=e=>Ho(Ba(e,So)),Wo=(e,t,n)=>{let r=xn(Ia(void 0,{flatten:!0,match:!1,incremented:!0},{isElim:!1,rule:e,subgoals:0},t,n)).filter((e,t,n)=>n.findIndex(t=>Qa(t,e))===t);if(r.length!==1)throw new l(`THM`,`compose: unique result expected ${t}`);return r[0]},Go=(e,t)=>Wo(e,1,ka(e.maxidx+1,t)),Ko=(e,t,n,r)=>{let i=xn(Ia(void 0,{flatten:!1,match:!1,incremented:!0},{isElim:!1,rule:e,subgoals:t},n,ka(e.maxidx+1,r))).filter((e,t,n)=>n.findIndex(t=>Qa(t,e))===t);if(i.length!==1)throw new l(`THM`,`comp_no_flatten ${n}`);return i[0]},qo={kind:`Comb`},Jo={kind:`Var`},Yo={kind:`Leaf`,items:[]},Xo=()=>({kind:`Net`,comb:Yo,var:Yo,atoms:re(pe)}),Zo=e=>{let t=[],n=e=>{let r=ze(e);if(r.kind===`Var`||r.kind===`Abs`){t.push(Jo);return}let i=e=>{e.kind===`App`?(t.push(qo),i(e.fun),n(e.arg)):e.kind===`Const`||e.kind===`Free`?t.push({kind:`Atom`,name:e.name}):e.kind===`Bound`&&t.push({kind:`Atom`,name:C(e.index)})};i(e)};return n(e),t},Qo=(e,t,n,r)=>{let i=[],a=t.reduce((e,t)=>{let n=e.kind===`Net`?e:Xo();return i.push(n),t.kind===`Comb`?n.comb:t.kind===`Var`?n.var:ae(n.atoms,t.name)??Yo},r),o=a.kind===`Leaf`?a.items:[];if(!o.some(t=>e(t,n)))return i.reduceRight((e,n,r)=>{let i=t[r];return i.kind===`Comb`?{...n,comb:e}:i.kind===`Var`?{...n,var:e}:{...n,atoms:ce(n.atoms,i.name,e)}},{kind:`Leaf`,items:[n,...o]})},$o=(e,t,n)=>Qo(()=>!1,Zo(e),t,n)??n,es=e=>{let t=[];for(let n=e;n!==void 0;n=n.tail)t.push(n.head);return t},ts=(e,t)=>{if(e.kind===`Leaf`)return t;let n=es(ts(e.comb,void 0)),r=de((e,t,n)=>({head:t,tail:n}),e.atoms,{head:e.var,tail:t});for(let e=n.length-1;e>=0;--e)r=ts(n[e],r);return r},ns=(e,t,n)=>{let r=ae(e,t);return r===void 0?n:{head:r,tail:n}},rs=(e,t,n,r)=>{if(n.kind===`Leaf`)return r;if(t.kind===`App`){let i=es(rs(e,t.fun,n.comb,void 0)),a=r;for(let n=i.length-1;n>=0;--n)a=is(e,t.arg,i[n],a);return a}return t.kind===`Const`||t.kind===`Free`?ns(n.atoms,t.name,r):t.kind===`Bound`?ns(n.atoms,C(t.index),r):r},is=(e,t,n,r)=>{if(n.kind===`Leaf`)return r;let i=ze(t);return i.kind===`Var`||i.kind===`Abs`?e?ts(n,r):{head:n.var,tail:r}:rs(e,t,n,{head:n.var,tail:r})},as=e=>{let t=[];for(let n=e;n!==void 0;n=n.tail)if(n.head.kind===`Leaf`)for(let e of n.head.items)t.push(e);return t},os=(e,t)=>as(is(!1,t,e,void 0)),ss=(e,t)=>as(is(!0,t,e,void 0)),cs=e=>`${e.isConst?`1`:`0`}${e.name}`,ls=e=>e.kind===`Const`?{isConst:!0,name:e.name}:e.kind===`Free`?{isConst:!1,name:e.name}:void 0,us=e=>mt((e,t)=>[...t,e],e,[]),ds=(e,t)=>e.some(e=>e.name===t.name&&e.index===t.index&&Pe(e.type,t.type)),fs=(e,t)=>{if(e.kind===`TVar`&&t.add(`${e.index}:${e.name}`),e.kind===`Type`)for(let n of e.args)fs(n,t);return t},ps=(e,t)=>e.kind===`TVar`?!t.has(`${e.index}:${e.name}`):e.kind===`Type`&&e.args.some(e=>ps(e,t)),ms=(e,t,n)=>{let r=[t,...e],i=r.flatMap(us),a=/* @__PURE__ */ new Set;for(let e of r)vt(e=>(fs(e,a),!1),e);return n.some(e=>vt(e=>ps(e,a),e)||_t(e=>e.kind===`Var`&&!ds(i,e),e))},hs=(e,t,n,r)=>({thm:e,lhs:t,elhs:n,extra:ms([],n,[...e.tpairs.flatMap(e=>[e[0],e[1]]),e.prop]),fo:ei(n)||!$r(n),perm:r}),gs=(e,t)=>e.kind===`Var`&&t.kind===`Var`?!0:e.kind===`Abs`&&t.kind===`Abs`?gs(e.body,t.body):e.kind===`App`&&t.kind===`App`?gs(e.fun,t.fun)&&gs(e.arg,t.arg):_s(e,t),_s=(e,t)=>{if(e.kind!==t.kind)return!1;switch(e.kind){case`Const`:case`Free`:return t.kind===e.kind&&e.name===t.name&&Pe(e.type,t.type);case`Var`:return t.kind===`Var`&&e.name===t.name&&e.index===t.index&&Pe(e.type,t.type);case`Bound`:return t.kind===`Bound`&&e.index===t.index;case`Abs`:return t.kind===`Abs`&&e.name===t.name&&Pe(e.type,t.type)&&_s(e.body,t.body);case`App`:return t.kind===`App`&&_s(e.fun,t.fun)&&_s(e.arg,t.arg)}},vs=(e,t)=>{if(!gs(e,t))return!1;let n=us(e),r=us(t);return n.every(e=>ds(r,e))&&r.every(e=>ds(n,e))},ys=e=>{let t=Rt(e.prop),n=zt(e.prop);if(!jt(n))throw new l(`ERROR`,`Rewrite rule not a meta-equality`);let[r,i]=Mt(n),a=sr(r),o=sr(i);return{prems:t,lhs:r,elhs:a,rhs:i,perm:vs(a,o)&&!j(a,o)&&a.kind!==`Var`}},bs=(e,t)=>{let n=e.simpset.mkRews.mkEqTrue(t);if(n===void 0)return[];let r=ys(n);return[{thm:n,lhs:r.lhs,elhs:r.elhs,perm:!1}]},xs=(e,t,n,r,i,a)=>{let o={thm:t,lhs:n,elhs:r,perm:!1};return ms([],n,[i])?[...bs(e,a),o]:[o]},Ss=(e,t)=>{let n=ys(t);return n.perm?[{thm:t,lhs:n.lhs,elhs:n.elhs,perm:!0}]:ms(n.prems,n.lhs,[n.rhs])||n.elhs.kind===`Var`?bs(e,t):xs(e,t,n.lhs,n.elhs,n.rhs,t)},Cs=(e,t,n)=>ms(e,t,[n])||ze(t).kind===`Var`||[n,...e].some(e=>Et(t,e))||e.length===0&&Qr(t,n,kn,zn)||t.kind===`Const`&&n.kind!==`Const`,ws=(e,t)=>{let n=ys(t);if(n.perm)return[{thm:t,lhs:n.lhs,elhs:n.elhs,perm:!0}];if(!Cs(n.prems,n.lhs,n.rhs))return xs(e,t,n.lhs,n.elhs,n.rhs,t);if(Cs(n.prems,n.rhs,n.lhs))return bs(e,t);let r=(()=>{try{return Ba(t,No)}catch(e){if(e instanceof l&&e.exception===`THM`)return;throw e}})();if(r===void 0)return[];let i=ys(r);return xs(e,r,i.lhs,i.elhs,i.rhs,t)},Ts=(e,t)=>e.simpset.mkRews.mk(t,e).flatMap(t=>ws(e,t)),Es=(e,t)=>$a(e.thm,t.thm),Ds=(e,t)=>{let n=hs(e.thm,e.lhs,e.elhs,e.perm),r=Qo(Es,Zo(n.elhs),n,t.rules);return r===void 0?t:{...t,rules:r}},Os=(e,t)=>t.flatMap(t=>e.simpset.mkRews.mk(t,e)).flatMap(t=>Ss(e,t)).reduce((e,t)=>Ds(t,e),e.simpset),ks=e=>{let t=ys(e);return ms(t.prems,t.lhs,[t.rhs])?[]:[hs(e,t.lhs,t.elhs,!1)]},As=(e,t)=>({...t,prems:[...e,...t.prems]}),js=e=>e.reduceRight((e,t)=>{let n=ys(t),r=hs(t,n.lhs,n.elhs,n.perm);return Qo(()=>!1,Zo(r.elhs),r,e)??e},Yo),Ms=re((e,t)=>e===t?0:e<t?-1:1),Ns={rules:Yo,prems:[],depth:0,congs:Ms,weakCongs:[],simprocs:Yo,mkRews:{mk:e=>jt(zt(e.prop))?[e]:[],mkEqTrue:()=>void 0},subgoalTac:()=>()=>Ha,loopTacs:[],unsafeSolvers:[],safeSolvers:[]},Ps=e=>{let[t,n]=Mt(e.prop);return j(t,n)},Fs=(e,t)=>_a(_a(ua(Nt),e),t),Is=e=>t=>Ft(t)?Fs(e(It(t)[0]),Is(e)(It(t)[1])):ua(t),Ls=e=>{let t=n=>r=>{if(r.kind!==`App`||r.fun.kind!==`Const`||r.fun.name!==`Pure.all`||r.arg.kind!==`Abs`)return e(r);let i=r.arg,[a,o]=x(i.name,n),s=Ee(a,i.type),c=t(v(a,o))(rt(s,i.body));return Ps(c)?ua(r):_a(ua(r.fun),ga(i.name,s,c))};return e=>t(b(xt(e,[])))(e)},Rs=(e,t,n)=>{if(t<1||t>$i(n))throw new l(`THM`,`gconv_rule ${t}`);let r=e(ra(n,t));if(Ps(r))return n;let i=Na(0,t-1,n),a=i.prop;if(!Ft(a))throw new l(`THM`,`gconv_rule`);let o=va(Fs(r,ua(It(a)[1])),i);return Na(0,1-t,o)},zs=(e,t)=>{let n=e(t.prop);return Ps(n)?t:va(n,t)},Bs=(e,t)=>e<t?-1:+(e>t),Vs=(e,t,n)=>{for(let r=0;;r+=1){if(r===t.length)return r===n.length?0:-1;if(r===n.length)return 1;let i=e(t[r],n[r]);if(i!==0)return i}},Hs=(e,t)=>Vs(pe,e,t),Us=e=>e.kind===`TVar`?0:e.kind===`TFree`?1:2,Ws=(e,t)=>{if(e===t)return 0;if(e.kind===`Type`&&t.kind===`Type`){let n=pe(e.name,t.name);return n===0?Vs(Ws,e.args,t.args):n}if(e.kind===`TFree`&&t.kind===`TFree`){let n=pe(e.name,t.name);return n===0?Hs(e.sort,t.sort):n}if(e.kind===`TVar`&&t.kind===`TVar`){let n=he(e,t);return n===0?Hs(e.sort,t.sort):n}return Bs(Us(e),Us(t))},Gs=e=>{let t=e,n=0;for(;t.kind===`App`;)t=t.fun,n+=1;return[t,n]},Ks=Se(`dummy`),qs=e=>{switch(e.kind){case`Const`:return[{name:e.name,index:0},e.type,0];case`Free`:return[{name:e.name,index:0},e.type,1];case`Var`:return[{name:e.name,index:e.index},e.type,2];case`Bound`:return[{name:``,index:e.index},Ks,3];case`Abs`:return[{name:``,index:0},e.type,4];case`App`:return[{name:``,index:0},Ks,5]}},Js=(e,t)=>{let[n,r,i]=qs(e),[a,o,s]=qs(t),c=ge(n,a);if(c!==0)return c;let l=Ws(r,o);return l===0?Bs(i,s):l},Ys=(e,t)=>{if(e.kind===`App`&&t.kind===`App`){let n=Ys(e.fun,t.fun);return n===0?Xs(e.arg,t.arg):n}return 0},Xs=(e,t)=>{if(e===t)return 0;if(e.kind===`Abs`&&t.kind===`Abs`){let n=Xs(e.body,t.body);return n===0?Ws(e.type,t.type):n}let n=Bs(Ve(e),Ve(t));if(n!==0)return n;let[r,i]=Gs(e),[a,o]=Gs(t),s=Js(r,a);if(s!==0)return s;let c=Bs(i,o);return c===0?Ys(e,t):c},Zs=e=>t=>go(n=>(pr(e),Aa(e,t,n))),Qs=e=>_o(t=>ja(e,t)),$s=(e,t,n,r)=>i=>go(a=>Ia(e,{flatten:!0,match:!1,incremented:!1},{isElim:t,rule:n,subgoals:r},i,a)),ec=(e,t)=>n=>go(r=>(pr(e),Ra(e,!1,t,n,r))),tc=(e,t)=>ec(e,t.map(e=>({isElim:!1,rule:e}))),nc=(e,t)=>ec(e,t.map(e=>({isElim:!0,rule:e}))),rc=(e,t)=>nc(e,t.map(Uo)),ic=(e,t)=>n=>go(r=>(pr(e),Ra(e,!0,t,n,r))),ac=(e,t)=>ic(e,t.map(e=>({isElim:!1,rule:e}))),oc=(e,t)=>ic(e,t.map(e=>({isElim:!0,rule:e}))),sc=e=>go(t=>ya(e,t)),cc=(e,t)=>e.isElim?{intro:t.intro,elim:$o(na(e.rule),e,t.elim)}:{intro:$o(ta(e.rule),e,t.intro),elim:t.elim},lc=e=>{let t=[...e];for(let e=1;e<t.length;e+=1){let n=t[e],r=e;for(;r>0&&t[r-1].tag>n.tag;--r)t[r]=t[r-1];t[r]=n}let n=[];for(let e=0;e<t.length;e+=1)(e+1===t.length||t[e+1].tag!==t[e].tag)&&n.push(t[e].item);return n},uc=(e,t,n,r)=>fo((i,a)=>{let o=en(i),s=tn(i),c=[...ss(r.intro,s),...o.flatMap(e=>ss(r.elim,e))];return go(r=>(pr(e),Ra(e,n,t(c),a,r)))}),dc=e=>lc(e.map(e=>({tag:e.tag,item:{isElim:e.isElim,rule:e.rule}}))),fc=(e,t)=>uc(e,dc,!1,t),pc=(e,t)=>uc(e,dc,!0,t),mc=e=>e.isElim?$i(e.rule)-1:$i(e.rule),hc=e=>t=>e===0?Va:_o(n=>Ma(e,t,n)),gc=(e,t)=>yn(co(tc(e.limits,e.simpset.prems))(t)),_c=e=>e instanceof l&&e.exception===`THM`,vc=e=>Mt(e.prop)[0],yc=e=>Mt(e.prop)[1],bc=e=>{let t=ma(!0,e);return pa(t,ha(yc(t)))},xc=(e,t)=>{let n=wa(e.tyenv,t),r=fe(e.tenv).map(([t,n])=>({variable:D(t.name,t.index,Ln(e.tyenv,n.type)),term:n.term}));return Sa(r,n)},Sc=(e,t,n)=>{let r=Tt(e,t,n.prop);return r===void 0?n:Ta(r,n)},Cc=(e,t)=>{try{return pa(e,t)}catch(e){if(!_c(e))throw e}try{let n=pa(fa(bc(vc(t))),t);try{return pa(e,n)}catch(t){if(!_c(t))throw t;return pa(pa(e,bc(yc(e))),n)}}catch(e){if(_c(e))return;throw e}},wc=O(0),Tc=e=>e.kind===`App`?e.fun:wc,Ec=e=>e.kind===`App`?e.arg:wc,Dc=e=>e.kind===`Abs`?e.body:wc,Oc=(e,t)=>{let n=e.simpset.weakCongs;return n.length!==0&&_t(e=>e.kind===`Const`&&n.some(t=>t.isConst&&t.name===e.name)||e.kind===`Free`&&n.some(t=>!t.isConst&&t.name===e.name),t)},kc=(e,t,n)=>Oc(e,t)?wc:n,Ac=e=>mt((e,t)=>[...t,e],e,[]),jc=(e,t,n)=>{let r=Ac(t);return Ac(n).every(e=>r.some(t=>t.name===e.name&&t.index===e.index&&Pe(t.type,e.type)))?kc(e,t,n):wc},Mc=e=>{let t=[],n=[];for(let r of e){let e=r.thm.prop;e.kind===`App`&&e.fun.kind===`App`&&e.fun.fun.kind===`Const`&&e.fun.fun.name===`Pure.eq`?t.unshift(r):n.unshift(r)}return[...t,...n]},Nc=(e,t,n,r,i)=>{let a=yc(r),[o,s]=t===-1||!i.extra?[i.thm,i.elhs]:[ka(t+1,i.thm),Ic(t+1,i.elhs)],c=i.fo?Zr(s,a,{tyenv:kn,tenv:zn}):Xr(s,a,{tyenv:kn,tenv:zn});if(c===void 0)return;let u=xc(c,Sc(i.lhs,a,o)),d=u.prop,f=!Ft(d),[p,m]=Mt(zt(d));if(i.perm&&Xs(m,p)>=0)return;if(f){let e=Cc(r,u);if(e===void 0)throw new l(`ERROR`,`check_conv`);let[t,a]=Mt(i.thm.prop);return{thm:e,skel:kc(n,t,a)}}if(n.simpset.depth>40)return;let h=e(n,u);if(h===void 0)return;let g=Cc(r,h);if(g===void 0)return;let[_,v]=Mt(zt(i.thm.prop));return{thm:g,skel:jc(n,_,v)}},Pc=(e,t,n,r,i)=>{for(let a of i){let i=Nc(e,t,n,r,a);if(i!==void 0)return i}},Fc=(e,t,n,r)=>{pr(n.limits);let i=ha(r),a=yc(i);if(a.kind===`App`&&a.fun.kind===`Abs`)return{thm:pa(i,ma(!1,a)),skel:wc};let o=Pc(e,t,n,i,Mc(os(n.simpset.rules,a)));if(o!==void 0)return o;for(let o of os(n.simpset.simprocs,a)){if(!Qr(o.lhs,r,kn,zn))continue;let s=o.proc(n,a);if(s===void 0)continue;let c=Pc(e,t,n,i,ks(s));if(c!==void 0)return c}},Ic=(e,t)=>Xt([],e,t),Lc=(e,t,n,r)=>{let i=ka(t+1,n),a=Mt(zt(i.prop))[0],o=Xr(a,r,{tyenv:kn,tenv:zn});if(o===void 0)throw new Rc;let s=e(xc(o,Sc(a,r,i)));if(s===void 0)return;let c=Cc(bc(r),s);if(c===void 0)return;let[l,u]=Mt(c.prop);return j(l,u)?void 0:c};var Rc=class{};const zc=(e,t)=>e===void 0?t:t===void 0?e:pa(e,t),Bc=(e,t,n,r)=>Sa([{variable:D(`A`,0,Oe),term:t},{variable:D(`B`,0,Oe),term:n},{variable:D(`C`,0,Oe),term:r}],e),Vc=(e,t,n)=>{let r=(e,r,i)=>{let a,s=e,c=i;for(;;){if(s.kind===`Var`)return a;let e=o(s,r,c),i=Fc(t,n,r,e===void 0?c:yc(e));if(i===void 0)return zc(a,e);a=zc(zc(a,e),i.thm),s=i.skel,c=yc(i.thm)}},i=(e,t)=>r(wc,e,t)??ua(t),a=(e,t,n)=>{let i=r(Tc(e),t,n.fun),a=r(Ec(e),t,n.arg);return i===void 0?a===void 0?void 0:_a(ua(n.fun),a):_a(i,a??ua(n.arg))},o=(e,i,c)=>{if(c.kind===`Abs`){let t=Ee(C(i.bounds),c.type),n=rt(t,c.body),a=r(Dc(e),{...i,bounds:i.bounds+1},n);return a===void 0?void 0:ga(c.name,t,a)}if(c.kind!==`App`)return;let l=c.fun;if(l.kind===`App`&&l.fun.kind===`Const`&&l.fun.name===`Pure.imp`)return s(c,i);if(l.kind===`Abs`){let e=ma(!1,c),t=o(wc,i,yc(e));return t===void 0?e:pa(e,t)}let[u,d]=Re(l),f=ls(u),p=f===void 0?void 0:ae(i.simpset.congs,cs(f));if(p===void 0)return a(e,i,c);try{let e=Lc(e=>t(i,e),n,p,c),a=e===void 0?c:yc(e),[o,s]=a.kind===`App`?[a.fun,a.arg]:[c.fun,c.arg],l=Le(u,d.map(()=>D(``,0,De))),f=r(l,i,o);return f===void 0?e:zc(e,_a(f,ua(s)))}catch(t){if(t instanceof Rc)return a(e,i,c);throw t}},s=(t,n)=>e.mutsimp?p([],t,[],n):h(t,n),c=(e,t)=>{if(ve(e)!==-1)return[{rules:[],asm:void 0},t];let n=ia(e);return[{rules:Ts(t,n),asm:n},t]},u=(e,t)=>{let n=e.reduce((e,t)=>t.rules.reduce((e,t)=>Ds(t,e),e),t.simpset);return{...t,simpset:As(e.flatMap(e=>e.asm===void 0?[]:[e.asm]),n)}},d=(e,t,n)=>{let[r,i]=Mt(n.prop),a=oa(Bc(jo,t,r,i),aa(t,n));if(!e)return a;let[o,s]=It(r),[c]=It(i);return pa(pa(Bc(Mo,o,t,s),a),Bc(Mo,t,c,s))},f=(e,r,i,a,o)=>{if(e.length===0)return o;let[s,...c]=e,m=u(i.slice(1).reverse(),a),h=Pt(s,o===void 0?r:yc(o)),g=o===void 0?void 0:d(!1,s,o),_=Fc(t,n,m,h);if(_===void 0)return f(c,h,i.slice(1),a,g);let v=zc(g,_.thm);if(v===void 0)throw new l(`ERROR`,`rebuild`);return zc(c.reduce((e,t)=>d(!1,t,e),v),p([...c].reverse(),yc(_.thm),i.slice(1).reverse(),a))},p=(e,t,n,r)=>{let i=Rt(t),a=r,o=[];for(let e of i){let[t,n]=c(e,a);o.push(t),a=n}return m([...e,...i],zt(t),[...n,...o],[],[],[],a,-1,-1)},m=(e,t,n,i,a,o,s,l,p)=>{if(e.length===0){let e=o.reduce((e,t,n)=>zc(t,e===void 0?void 0:d(!1,i[n],e)),void 0),n=l>0?m([...i].reverse(),t,[...a].reverse(),[],[],[],s,-1,l):f(i,t,a,s,r(wc,u([...a].reverse(),s),t));return zc(e,n)}let[h,...g]=e,[_,...v]=n,y=p===0?void 0:r(wc,u([...[...a].reverse(),...v],s),h);if(y===void 0)return m(g,t,v,[h,...i],[_,...a],[void 0,...o],s,l,p===0?0:p-1);let b=yc(y),x=1+y.hyps.reduce((e,t)=>Math.max(e,g.findIndex(e=>j(e,t))),-1),[ee,S]=c(b,s),te=g.slice(0,x).reduceRight((e,t)=>d(!0,t,e),Fs(y,ua(Lt(g.slice(x),t))));return m(g,t,v,[b,...i],[ee,...a],[te,...o],S,i.length,-1)},h=(t,n)=>{let[i,a]=It(t),o=e.simprem?r(wc,n,i):void 0,s=o===void 0?i:yc(o),l=e.useprem?u([c(s,n)[0]],n):n,f=r(wc,l,a);if(f===void 0)return o===void 0?void 0:Fs(o,ua(a));let p=d(!1,s,f);return o===void 0?p:pa(Fs(o,ua(a)),p)};return i},Hc=(e,t)=>{if(t.tpairs.length===0)return t;let n=xn(ya(e,t)),r=n.filter((e,t)=>n.findIndex(t=>Qa(t,e))===t);if(r.length===1)return r[0];throw new l(`THM`,r.length===0?`flexflex_unique: impossible constraints`:`flexflex_unique: multiple unifiers`)},Uc=(e,t,n,r)=>{let i={...n,simpset:{...n.simpset,depth:n.simpset.depth+1}};return Vc(e,(e,r)=>{let i=t(e,r);return i===void 0?void 0:Hc(n.limits,i)},ve(r))(i,r)},Wc=(e,t,n,r)=>i=>r>0&&r<=$i(i)?gn(Rs(r=>Uc(e,t,n,r),r,i)):mn,Gc=(e,t)=>{let n={limits:e,simpset:Ns,bounds:0},r={...n,simpset:Os(n,t)},i=Ls(Is(e=>Uc({simprem:!0,useprem:!1,mutsimp:!1},gc,r,e)));return e=>t=>{try{return gn(Rs(e=>an(e)?i(e):ua(e),e,t))}catch(e){if(e instanceof l&&(e.exception===`THM`||e.exception===`TERM`||e.exception===`TYPE`))return mn;throw e}}},Kc=(e,t)=>Ko(t,e,1,Eo),qc=e=>Ko(e,$i(e),1,Do),Jc=(e,t,n)=>{if(e<1||t<1||e+t-1>$i(n))throw new l(`THM`,`Goal.restrict`);return Kc(t,Na(0,e-1,n))},Yc=(e,t)=>Na(0,1-e,qc(t)),Xc=e=>t=>n=>$i(n)===1&&t===1?e(n):Ua(Ua(_o(e=>Jc(t,1,e)),e),_o(e=>Yc(t,e)))(n),Zc=e=>t=>n=>t<1||t>$i(n)?mn:Ua(Ua(_o(e=>Na(0,t-1,e)),e),_o(e=>Na(0,1-t,e)))(n),Qc=(e,t)=>({...e,simpset:{...e.simpset,unsafeSolvers:t,safeSolvers:t}}),$c=(e,t)=>{let n=Qc(t,e),r=mo(n.simpset.subgoalTac(n),()=>Ha);return xo(r(1))},el=e=>no([...e.simpset.loopTacs].reverse().map(t=>t.tactic(e))),tl=e=>(t,n)=>$c(e,t)(n).pull()?.[0],nl=(e,t)=>n=>r=>{let i=el(n),a=e?n.simpset.safeSolvers:n.simpset.unsafeSolvers,o=no([...a].reverse().map(e=>e.tactic(n))),s=e=>Ua(Wc(t,tl(n.simpset.unsafeSolvers),n,e),Wa(o(e),Za(mo(i,s)(e))));return Zc(s(1))(r)},rl=nl(!1,{simprem:!1,useprem:!0,mutsimp:!1}),il=nl(!1,{simprem:!0,useprem:!0,mutsimp:!1}),al=nl(!1,{simprem:!0,useprem:!0,mutsimp:!0}),ol=nl(!0,{simprem:!0,useprem:!0,mutsimp:!0}),sl=(e,t,n)=>{let r=tl([...t.simpset.unsafeSolvers].reverse());return zs(n=>Uc(e,r,t,n),n)},cl=(e,t)=>sl({simprem:!1,useprem:!1,mutsimp:!1},e,t),ll=(e,t)=>{if(Io(!1,t.prop))return Ro(t);let n={limits:e,simpset:Ns,bounds:0},r={...n,simpset:Os(n,[Fo])};return Ro(zs(e=>Uc({simprem:!0,useprem:!1,mutsimp:!1},gc,r,e),t))},ul=(e,t)=>{let n=bt(t.prop,[]),r=S(t.hyps.reduce((e,t)=>xt(t,e),xt(t.prop,[])),n.map(e=>e.name)),i=e(Sa(n.map((e,t)=>({variable:e,term:Ee(r[t],e.type)})),t)),a=i.reduce((e,t)=>Math.max(e,t.maxidx),t.maxidx)+1;return i.map(e=>ba(r,a,e))},dl=(e,t,n,r)=>i=>a=>bo(i)(a)||r>t?Ha(a):Wa(n(r)(i),dl(e,t,n,r+e)(i))(a),fl=(e,t)=>e.size-t.size||Xs(e.thm.prop,t.thm.prop),pl=(e,t,n)=>r=>{let i=(e,n)=>{let r={size:t(n),thm:n},i=e.findIndex(e=>fl(r,e)<0);return i===-1?[...e,r]:[...e.slice(0,i),r,...e.slice(i)]},a=()=>{let t=[r],a=[];for(;;){let r=t.filter(e);if(r.length>0)return r;let o=[...t].reverse().reduce(i,a);if(o.length===0)return;let s=o[0].thm,c=o.slice(1),l=c.findIndex(e=>!Qa(s,e.thm));t=xn(n(s)),a=l===-1?[]:c.slice(l)}};return dn(()=>{let e=a();return e===void 0?void 0:vn(e).pull()})},ml=(e,t)=>({...e,claset:t}),hl=(e,t,n)=>{let r=ea(t).length===0?t.prop:tn(t.prop);if(!((r.kind===`App`&&r.fun.kind===`Const`&&r.fun.name===e.judgment?r.arg:r).kind===`Var`&&ea(t).some(e=>j(r,tn(e)))))return t;let i=Ba(t,e.classical),a=tn(i.prop),o=e=>{if(j(a,tn(e)))return!0;let t=en(e);return t.length>0&&t.slice(1).some(e=>j(e,t[0]))},s=yn(co(fo((e,t)=>t===1||o(e)?nc(n,[Co])(t):Va))(i));if(s===void 0)throw new l(`THM`,`classical_rule`);let c=Ho(s);return j(c.prop,t.prop)?t:c},gl=(e,t)=>t.flatMap(t=>xn(Ra(void 0,!1,[{isElim:!1,rule:t}],2,e.swap))),_l=(e,t)=>Ho(Ba(t,e.classical)),vl=(e,t)=>Ho(ul(t=>{let n=yn(e(t));if(n===void 0)throw new l(`THM`,`rule_by_tactic`);return[n]},t)[0]),yl=(e,t)=>{let n=yn(Aa(void 0,2,za(t,2,So)));if(n===void 0)throw new l(`THM`,`dup_elim`);return vl(co(t=>Wa(nc(e,[So])(t),Va)),n)},bl=(e,t)=>t.map((t,n)=>({tag:1e6*mc(t)+e+n,...t})),xl=(e,t,n,r)=>bl(-(2*e[0]+e[1]),[...n.map(e=>({isElim:!0,rule:e})),...t.map(e=>({isElim:!1,rule:e}))]).reduceRight((e,t)=>cc(t,e),r),Sl=(e,t)=>e.some(e=>j(e.rule.prop,t.rule.prop)),Cl=(e,t)=>{let n=e.claset;if(ea(t).some(e=>e.kind===`App`&&e.fun.kind===`Const`&&e.fun.name.startsWith(`Pure.`)))throw new l(`ERROR`,`Rules with meta-level premises are not supported`);let r=_l(e.data,t),i={rule:t,internal:t,swapped:gl(e.data,[t]),dup:r,dupSwapped:gl(e.data,[r])};if(Sl(n.unsafeIs,i))return n;let a=[n.unsafeIs.length+1,n.unsafeEs.length];return{...n,unsafeIs:[i,...n.unsafeIs],unsafe:xl(a,[i.internal],i.swapped,n.unsafe),dup:xl(a,[i.dup],i.dupSwapped,n.dup)}},wl=(e,t)=>{let n=e.claset;if($i(t)<1)throw new l(`ERROR`,`Ill-formed elimination rule`);let r=hl(e.data,t,e.limits),i={rule:t,internal:r,swapped:[],dup:yl(e.limits,r),dupSwapped:[]};if(Sl(n.unsafeEs,i))return n;let a=[n.unsafeIs.length,n.unsafeEs.length+1];return{...n,unsafeEs:[i,...n.unsafeEs],unsafe:xl(a,[],[i.internal],n.unsafe),dup:xl(a,[],[i.dup],n.dup)}},Tl=(e,t)=>{if($i(t)<1)throw new l(`ERROR`,`Ill-formed destruction rule`);return wl(e,Uo(t))},El=(e,t)=>e.some(e=>e.name===t.name)?e.map(e=>e.name===t.name?t:e):[t,...e],Dl=(e,t,n)=>({...e,swrappers:El(e.swrappers,{name:t,wrap:e=>Ja(e,n)})}),Ol=(e,t,n)=>({...e,uwrappers:El(e.uwrappers,{name:t,wrap:e=>Ya(n,e)})}),kl=(e,t)=>e.claset.swrappers.reduce((e,t)=>t.wrap(e),t),Al=(e,t)=>e.claset.uwrappers.reduce((e,t)=>t.wrap(e),t),jl=e=>qa(nc(e.limits,[e.data.notElim]),Ja(Qs,Zs(e.limits))),Ml=e=>t=>Ua(oc(e.limits,[e.data.notElim,e.data.impElim])(t),Qs(t)),Nl=e=>kl(e,no([Qs,Ml(e),pc(e.limits,e.claset.safe0),no(e.data.hypSubstTacs.map(t=>t(e.limits))),pc(e.limits,e.claset.safep)])),Pl=e=>t=>ao(vo(bo(t),Ha,n=>Nl(e)(t)(n))),Fl=e=>ao(lo(Pl(e))),Il=(e,t,n)=>uc(e.limits,e=>dc(e.filter(e=>mc(e)===t)),!0,n),Ll=e=>t=>Ua(oc(e.limits,[e.data.notElim])(t),Qs(t)),Rl=e=>Ja(Qs,Ll(e)),zl=(e,t)=>n=>Ua(Il(e,2,t)(n),Wa(Rl(e)(n),Rl(e)(n+1))),Bl=e=>kl(e,no([Rl(e),pc(e.limits,e.claset.safe0),no(e.data.hypSubstTacs.map(t=>t(e.limits))),Il(e,1,e.claset.safep),zl(e,e.claset.safep)])),Vl=e=>Xc(io(Bl(e)(1))),Hl=e=>Ya(Zs(e.limits),Ya(jl(e),fc(e.limits,e.claset.safe0))),Ul=e=>fc(e.limits,e.claset.safep),Wl=e=>Ya(Hl(e),Ul(e)),Gl=e=>fc(e.limits,e.claset.unsafe),Kl=e=>t=>Wa(Fl(e),Al(e,Ja(Wl(e),Gl(e)))(t)),ql=e=>e.tpairs.reduce((e,t)=>e+2+Ve(t[0])+Ve(t[1]),Ve(e.prop)),Jl=(e,t)=>qa(Gc(e.limits,t),Xc(pl(bo(1),ql,lo(Kl(e))))),Yl=e=>ml(e.classical,Ol(e.classical.claset,`asm_full_simp_tac`,t=>oo(al(e.simp)(t)))),Xl=e=>ml(e.classical,Dl(e.classical.claset,`safe_asm_full_simp_tac`,t=>oo(ol(e.simp)(t)))),Zl=e=>mo(ol(e.simp),Vl(Xl(e))),Ql=(e,t)=>n=>r=>Xc(Ka(Pl(e)(1),xo(Ql(e,t)(1)),Ga(Hl(e)(1),t===0?Ha:Ua(Al(e,t=>Ga(Ul(e)(t),Gl(e)(t)))(1),xo(Ql(e,t-1)(1))))))(n)(r),$l=e=>{let t={...e,simpset:Ns},n={...t,simpset:Os(t,[Po])};return _o(e=>Array.from({length:$i(e)},(e,t)=>t+1).reduce((e,t)=>Rs(e=>Uc({simprem:!0,useprem:!0,mutsimp:!0},gc,n,e),t,e),e))},eu=(e,t,n)=>{let r=Ja(e.blastDepthTac(e.classical,t),t=>oo(Ql(Yl(e),n)(t)));return eo([Xa(co(al(e.simp))),Za(Fl(e.classical)),io(lo(r)),Za(Fl(Xl(e))),$l(e.simp)])},tu=e=>eu(e,4,2),nu=(e,t)=>{let n=Yl(e);return Xc(eo([Vl(n)(1),t=>$i(t)===0?Va(t):al(e.simp)(1)(t),co(Jl(n,t))]))},ru=e=>{let t=[...e].sort((e,t)=>e.weight-t.weight||e.tag-t.tag);return t.filter((e,n)=>n+1>=t.length||t[n+1].weight!==e.weight||t[n+1].tag!==e.tag).map(e=>({isElim:e.isElim,rule:e.rule}))},iu=e=>e.reduce((e,t)=>e.some(e=>j(e,t))?e:[...e,t],[]).length,au=(e,t)=>e.every(e=>t.some(t=>j(e,t))),ou=e=>fo((t,n)=>{let r=en(t);return ro(r.length-iu(r),Ua(oc(e,[To])(n),Qs(n)))}),su=e=>{let t=e.limits,n=(e,n)=>uc(t,ru,e,n),r=mo(Ja(Qs,n(!0,e.safeRules)),ou(t)),i=mo(Ya(Zs(t),Ya(n(!1,e.safeRules),n(!1,e.rules))),ou(t));return e=>Wa(ao(r(e)),i(e))},cu=(e,t,n,r)=>fo((i,a)=>{if(n>r)return Ha;let o=en(i),s=tn(i);return t.some(e=>j(e.concl,s)&&e.hyps.length===o.length&&au(e.hyps,o)&&au(o,e.hyps))?Ha:mo(su(e),cu(e,[{hyps:o,concl:s},...t],n+1,r))(a)}),lu=e=>Xc(dl(2,20,t=>cu(e,[],0,t),4)(1)),uu=e=>Sa([{variable:D(`A`,0,Oe),term:e.conclusion}],Eo),du=(e,t)=>t.assumptions.map(t=>ll(e,ia(t))),fu=(e,t,n)=>eo(t.map(t=>tc(e,[Go(zo(t),So)])(n))),pu=e=>new l(`ERROR`,`Outer syntax error at: ${e===void 0?`end of input`:e.text}`),mu=e=>{let t=0,n=()=>e[t],r=(n,r=0)=>e[t+r]?.kind===`symbol`&&e[t+r].text===n,i=e=>{if(!r(e))throw pu(n());t+=1},a=()=>n()?.kind===`word`,o=()=>{let e=n();if(e?.kind!==`word`)throw pu(e);return t+=1,e.text},s=()=>a()&&r(`:`,1),c=()=>{let e=[];for(;a()&&!s();)e.push(o());return e},u=()=>{let e=[];for(;s();){let n=o();if(t+=1,n!==`intro`&&n!==`dest`)throw new l(`ERROR`,`Unsupported method modifier: ${n}`);e.push({kind:n,facts:c()})}return e},d=(e,t)=>{switch(e){case`auto`:case`blast`:case`force`:case`clarsimp`:return{kind:e,modifiers:t?u():[]};case`iprover`:return{kind:`iprover`};case`intro`:return{kind:`intro`,facts:t?c():[]};default:throw new l(`ERROR`,`Undefined method: ${e}`)}},f=e=>r(`?`)?(t+=1,f({kind:`try`,method:e})):e,p=()=>{i(`(`);let e=[f(r(`(`)?p():d(o(),!0))];for(;r(`,`);)t+=1,e.push(f(r(`(`)?p():d(o(),!0)));return i(`)`),e.length===1?e[0]:{kind:`then`,methods:e}},m=()=>f(r(`(`)?p():d(o(),!1)),h=m(),g=t<e.length?m():void 0;if(t!==e.length)throw pu(n());return{initial:h,terminal:g}},hu=(e,t)=>t.flatMap(t=>e.getFact(t)),gu=(e,t)=>t.reduce((t,n)=>hu(e,n.facts).reduce((e,t)=>ml(e,n.kind===`intro`?Cl(e,t):Tl(e,t)),t),e.classical),_u=(e,t)=>({classical:t,simp:{limits:e.limits,simpset:e.simpset,bounds:0},blastDepthTac:e.blastDepthTac}),vu=(e,t)=>co(n=>fu(e.limits,t,n)),yu=(e,t,n)=>qa(n=>fu(e.limits,t,n),n)(1),bu=(e,t)=>{switch(t.kind){case`auto`:return n=>Ua(vu(e,n),so(tu(_u(e,gu(e,t.modifiers)))));case`clarsimp`:return n=>yu(e,n,n=>so(Zl(_u(e,gu(e,t.modifiers)))(n)));case`force`:return n=>yu(e,n,nu(_u(e,gu(e,t.modifiers)),e.atomizeRules));case`blast`:return n=>yu(e,n,e.blastTac(gu(e,t.modifiers)));case`iprover`:return t=>yu(e,t,qa(Gc(e.limits,e.atomizeRules),lu(e.intuitionistic)));case`intro`:return n=>{let r=hu(e,t.facts);return yu(e,n,t=>so(ho(ac(e.limits,r))(t)))};case`then`:{let n=t.methods.map(t=>bu(e,t));return e=>t=>n.reduce((t,n)=>Dn(n(e),t),gn(t))}case`try`:{let n=bu(e,t.method);return e=>Wa(n(e),e=>gn(e))}}},xu=e=>{let t={limits:e,simpset:Ns,bounds:0},n={...t,simpset:Os(t,[Fo])};return qa(tc(e,[wo]),fo((e,t)=>Io(!1,e)?e=>gn(e):Wc({simprem:!0,useprem:!1,mutsimp:!1},()=>void 0,n,t)))},Su=e=>qa(xu(e),fo((t,n)=>{let r=We(t),i=S(xt(t,[]),r.map(e=>e.name)),a=ve(t)+1,o=nt(r.map((e,t)=>D(i[t],a,e.type)).reverse(),Ue(t));return Rt(o).filter(e=>e.kind===`App`&&(e.fun.kind===`App`&&e.fun.fun.kind===`Const`&&e.fun.fun.name===`Pure.imp`||e.fun.kind===`Const`&&e.fun.name===`Pure.all`)).reduceRight((t,n)=>Ya(mo(nc(e,[ll(e,Ea(n))]),Zs(e)),t),()=>Ha)(n)})),Cu=e=>{let t=(t,n)=>fo((r,i)=>t(tn(r))?tc(e,[n])(i):Ha);return Ya(Zs(e),Ya(Su(e),Ya(t(jt,Oo),t(e=>e.kind===`App`&&e.fun.kind===`Const`&&e.fun.name===`Pure.term`,Ao))))},wu=e=>t=>n=>t>$i(n)?gn(n):Wa(Ua(Cu(e)(t),wu(e)(t)),wu(e)(t+1))(n),Tu=(e,t,n,r)=>{let i=bu(e,t.initial),a=t.terminal===void 0?void 0:bu(e,t.terminal),o=t=>Dn(sc(e.limits),wu(e.limits)(1)(t));return wn(e=>$i(e)===0,Dn(e=>Dn(o,a===void 0?gn(e):a([])(e)),i(n)(r)))},Eu=e=>{let t=/* @__PURE__ */ new Map,n=(e,r)=>{e.kind===`Type`?e.args.forEach((e,t)=>n(e,[...r,t])):e.kind===`TVar`&&!t.has(`${e.name}.${e.index}`)&&t.set(`${e.name}.${e.index}`,r)};return n(e,[]),[...t.values()]},Du=(e,t)=>e.map(e=>e.reduce((e,t)=>{if(e.kind!==`Type`||t>=e.args.length)throw new l(`TYPE`,`Consts.typargs: subscript`);return e.args[t]},t)),Ou=Se(`PredicateLogic.c`),ku=[`::`,`:>`,`<<`,`>>`,`@@`,`=>`,`\\`,`(`,`)`,`[`,`]`,`{`,`}`,`,`,`:`,`.`,`%`,`=`,`&`,`|`,`~`,`!`,`0`],Au=/* @__PURE__ */ new Set([`EXCEPT`,`DOMAIN`,`SUBSET`,`UNION`,`PROP`]),ju=e=>/[A-Za-z]/.test(e),Mu=e=>/[A-Za-z0-9_']/.test(e),Nu=e=>{let t=[],n=0;for(;n<e.length;){let r=e[n];if(/\s/.test(r)){n+=1;continue}if(e.startsWith(`''`,n)){let r=e.indexOf(`''`,n+2);if(r<0)throw new l(`ERROR`,`Inner lexical error: unterminated string`);t.push({kind:`string`,text:e.slice(n+2,r)}),n=r+2;continue}if(e.startsWith(`\\<`,n)&&ju(e[n+2]??``)){let r=e.indexOf(`>`,n);t.push({kind:`delimiter`,text:e.slice(n,r+1)}),n=r+1;continue}if(ju(r)){let r=n+1;for(;r<e.length&&(Mu(e[r])||e[r]===`.`&&ju(e[r+1]??``));)r+=1;let i=e.slice(n,r);t.push(Au.has(i)?{kind:`delimiter`,text:i}:{kind:`id`,text:i}),n=r;continue}let i=ku.find(t=>e.startsWith(t,n));if(i===void 0)throw new l(`ERROR`,`Inner lexical error at: ${e.slice(n,n+20)}`);t.push({kind:`delimiter`,text:i}),n+=i.length}return t.push({kind:`end`}),t},Pu=e=>({kind:`const`,name:e}),Fu=(e,...t)=>t.reduce((e,t)=>({kind:`app`,fun:e,arg:t}),e),Iu=e=>e===0?Pu(`Integers.zero`):Fu(Pu(`Functions.fapply`),Pu(`Integers.succ`),Iu(e-1)),Lu=e=>[...e].reduce((e,t)=>{let n=t.charCodeAt(0);if(n>=128)throw new l(`ERROR`,`Non-ASCII symbol: ${t}`);return Fu(Pu(`Tuples.Append`),e,Fu(Pu(`Strings.char`),Iu(n>>4),Iu(n&15)))},Pu(`Tuples.emptySeq`)),Ru=e=>e.reduce((e,t)=>Fu(Pu(`Tuples.Append`),e,t),Pu(`Tuples.emptySeq`)),zu=(e,t)=>({constant:e,left:t,right:t+1,priority:t}),Bu=(e,t)=>({constant:e,left:t+1,right:t,priority:t}),Vu=/* @__PURE__ */ new Map([[`\\<Rightarrow>`,Bu(`PredicateLogic.imp`,25)],[`=>`,Bu(`PredicateLogic.imp`,25)],[`\\<Leftrightarrow>`,Bu(`PredicateLogic.iff`,25)],[`\\<or>`,Bu(`PredicateLogic.disj`,30)],[`|`,Bu(`PredicateLogic.disj`,30)],[`\\<and>`,Bu(`PredicateLogic.conj`,35)],[`&`,Bu(`PredicateLogic.conj`,35)],[`=`,zu(`PredicateLogic.eq`,50)],[`\\<noteq>`,zu(`PredicateLogic.not_equal`,50)],[`\\<in>`,zu(`SetTheory.in`,50)],[`\\<notin>`,zu(`SetTheory.notin`,50)],[`\\<subseteq>`,zu(`SetTheory.subset`,50)],[`\\<union>`,zu(`SetTheory.union`,65)],[`\\`,zu(`SetTheory.setminus`,65)],[`\\<inter>`,zu(`SetTheory.inter`,70)],[`@@`,zu(`Functions.extend`,70)],[`:>`,zu(`Functions.oneArg`,75)],[`\\<times>`,Bu(`Tuples.prod`,100)]]),Hu=/* @__PURE__ */ new Map([[`~`,{constant:`PredicateLogic.not`,argument:40,priority:40}],[`\\<not>`,{constant:`PredicateLogic.not`,argument:40,priority:40}],[`SUBSET`,{constant:`SetTheory.SUBSET`,argument:100,priority:90}],[`UNION`,{constant:`SetTheory.UNION`,argument:100,priority:90}],[`DOMAIN`,{constant:`Functions.DOMAIN`,argument:100,priority:90}]]),Uu=1e3;var Wu=class{tokens;position=0;constructor(e){this.tokens=e}peek(e=0){return this.tokens[Math.min(this.position+e,this.tokens.length-1)]}isDelimiter(e,t=0){let n=this.peek(t);return n.kind===`delimiter`&&n.text===e}next(){let e=this.peek();return this.position+=1,e}expect(e){if(!this.isDelimiter(e))throw this.syntaxError();this.position+=1}syntaxError(){let e=this.peek();return new l(`ERROR`,`Inner syntax error at: ${e.kind===`end`?`end of input`:e.kind===`string`?`''${e.text}''`:e.text}`)}identifier(){let e=this.next();if(e.kind!==`id`)throw this.syntaxError();return e.text}atEnd(){return this.peek().kind===`end`}type(){let e=this.isDelimiter(`[`)?this.typeList():void 0,t=e===void 0?this.typeAtom():void 0;if(this.isDelimiter(`=>`)||this.isDelimiter(`\\<Rightarrow>`)){this.position+=1;let n=this.type();return(e??[t??Ou]).reduceRight((e,t)=>ke(t,e),n)}if(t===void 0)throw this.syntaxError();return t}typeList(){this.expect(`[`);let e=[this.type()];for(;this.isDelimiter(`,`);)this.position+=1,e.push(this.type());return this.expect(`]`),e}typeAtom(){if(this.isDelimiter(`(`)){this.position+=1;let e=this.type();return this.expect(`)`),e}let e=this.identifier();if(e===`c`)return Ou;if(e===`prop`)return Oe;throw new l(`ERROR`,`Undefined type name: ${e}`)}binders(e){let t=[];for(;this.peek().kind===`id`;){let n=this.identifier();e&&this.isDelimiter(`::`)?(this.position+=1,t.push({name:n,type:this.type()})):t.push({name:n,type:void 0})}if(t.length===0)throw this.syntaxError();return t}commaList(e){if(this.isDelimiter(e))return this.position+=1,[];let t=[this.logic(0)];for(;this.isDelimiter(`,`);)this.position+=1,t.push(this.logic(0));return this.expect(e),t}logic(e){let t=this.expression(e);if(t.isProp)throw new l(`ERROR`,`Inner syntax error: proposition in term position`);return t.ast}prop(e){let t=this.expression(e);return t.isProp?t.ast:Fu(Pu(`PredicateLogic.Trueprop`),t.ast)}expression(e){let t=this.prefix(e);for(;;){let n=this.peek();if(n.kind!==`delimiter`)return t;if(n.text===`\\<Longrightarrow>`){if(e>1||t.isProp&&t.priority<2)return t;this.position+=1;let n=t.isProp?t.ast:Fu(Pu(`PredicateLogic.Trueprop`),t.ast);t={ast:Fu(Pu(`Pure.imp`),n,this.prop(1)),priority:1,isProp:!0};continue}if(t.isProp)return t;if(n.text===`::`){if(e>3||t.priority<4)return t;this.position+=1,t={ast:{kind:`constrain`,term:t.ast,type:this.type()},priority:3,isProp:!1};continue}if(n.text===`(`){if(t.priority<Uu)return t;this.position+=1;let e=this.commaList(`)`);if(e.length===0)throw this.syntaxError();t={ast:Fu(t.ast,...e),priority:Uu,isProp:!1};continue}if(n.text===`[`){if(e>90||t.priority<89)return t;this.position+=1;let n=this.logic(0);this.expect(`]`),t={ast:Fu(Pu(`Functions.fapply`),t.ast,n),priority:90,isProp:!1};continue}let r=Vu.get(n.text);if(r===void 0||r.priority<e||t.priority<r.left)return t;this.position+=1,t={ast:Fu(Pu(r.constant),t.ast,this.logic(r.right)),priority:r.priority,isProp:!1}}}prefix(e){let t=this.next(),n=(e,t=Uu)=>({ast:e,priority:t,isProp:!1});if(t.kind===`end`)throw--this.position,this.syntaxError();if(t.kind===`id`)return n({kind:`name`,name:t.text});if(t.kind===`string`)return n(Lu(t.text));switch(t.text){case`(`:{let e=this.expression(0);return this.expect(`)`),{...e,priority:Uu}}case`0`:return n(Pu(`Integers.zero`));case`{`:return this.isDelimiter(`}`)?(this.position+=1,n(Pu(`SetTheory.emptyset`),100)):n(this.commaList(`}`).reduceRight((e,t)=>Fu(Pu(`SetTheory.addElt`),t,e),Pu(`SetTheory.emptyset`)));case`<<`:return n(this.isDelimiter(`>>`)?(this.next(),Pu(`Tuples.emptySeq`)):Ru(this.commaList(`>>`)));case`\\<langle>`:return n(Ru(this.commaList(`\\<rangle>`)));case`[`:return this.bracket();case`\\<forall>`:case`\\<exists>`:return n(this.quantifier(t.text===`\\<forall>`),10);case`%`:case`\\<lambda>`:{if(e>3)throw this.syntaxError();let t=this.binders(!0);this.expect(`.`);let r=this.logic(3);return n(t.reduceRight((e,t)=>({kind:`abs`,name:t.name,type:t.type,body:e}),r),3)}case`\\<And>`:{if(e>0)throw this.syntaxError();let t=this.binders(!0);this.expect(`.`);let n=this.prop(0);return{ast:t.reduceRight((e,t)=>Fu(Pu(`Pure.all`),{kind:`abs`,name:t.name,type:t.type,body:e}),n),priority:0,isProp:!0}}}let r=Hu.get(t.text);if(r===void 0||r.priority<e)throw--this.position,this.syntaxError();return n(Fu(Pu(r.constant),this.logic(r.argument)),r.priority)}quantifier(e){let t=[this.identifier()];for(;this.isDelimiter(`,`);)this.position+=1,t.push(this.identifier());if(this.isDelimiter(`:`)){this.position+=1;let n=this.logic(10),r=Pu(e?`PredicateLogic.All`:`PredicateLogic.Ex`);return t.reduceRight((e,t)=>Fu(r,{kind:`abs`,name:t,type:void 0,body:e}),n)}this.expect(`\\<in>`);let n=this.logic(0);this.expect(`:`);let r=this.logic(0),i=Pu(e?`SetTheory.bAll`:`SetTheory.bEx`);return t.reduceRight((e,t)=>Fu(i,n,{kind:`abs`,name:t,type:void 0,body:e}),r)}bracket(){if(this.peek().kind===`id`&&this.isDelimiter(`\\<in>`,1)){let e=this.identifier();this.position+=1;let t=this.logic(0);this.expect(`\\<mapsto>`);let n=this.logic(0);return this.expect(`]`),{ast:Fu(Pu(`Functions.Fcn`),t,{kind:`abs`,name:e,type:void 0,body:n}),priority:900,isProp:!1}}let e=this.logic(0);if(this.isDelimiter(`\\<rightarrow>`)){this.position+=1;let t=this.logic(0);return this.expect(`]`),{ast:Fu(Pu(`Functions.FuncSet`),e,t),priority:900,isProp:!1}}if(this.isDelimiter(`EXCEPT`)){this.position+=1;let t=e;for(;;){this.expect(`!`),this.expect(`[`);let e=this.logic(0);if(this.expect(`]`),this.expect(`=`),t=Fu(Pu(`Functions.except`),t,e,this.logic(0)),!this.isDelimiter(`,`))break;this.position+=1}return this.expect(`]`),{ast:t,priority:900,isProp:!1}}this.expect(`:`);let t=[e],n=[this.logic(0)];for(;this.isDelimiter(`,`);)this.position+=1,t.push(this.logic(0)),this.expect(`:`),n.push(this.logic(0));return this.expect(`]`),{ast:Fu(Pu(`Tuples.EnumFuncSet`),Ru(t),Ru(n)),priority:Uu,isProp:!1}}};const Gu=(e,t)=>{let n=new Wu(Nu(e)),r=t(n);if(!n.atEnd())throw new l(`ERROR`,`Inner syntax error: trailing input in ${e.slice(0,40)}`);return r},Ku=e=>Gu(e,e=>e.prop(0)),qu=e=>Gu(e,e=>e.type()),Ju=e=>{let t=we(`?'a`,e.nextParam);return e.nextParam+=1,t},Yu=e=>e.kind===`TVar`&&e.name===`?'a`,Xu=(e,t)=>{if(t.kind===`TVar`&&Yu(t)){let n=e.substitution.get(t.index);return n===void 0?t:Xu(e,n)}return t},Zu=(e,t)=>{let n=Xu(e,t);return n.kind===`Type`?Se(n.name,n.args.map(t=>Zu(e,t))):n},Qu=(e,t,n)=>{let r=Xu(e,n);return r.kind===`TVar`&&Yu(r)?r.index===t:r.kind===`Type`&&r.args.some(n=>Qu(e,t,n))},$u=(e,t,n)=>{let r=Xu(e,t),i=Xu(e,n);if(r.kind===`TVar`&&Yu(r)){if(i.kind===`TVar`&&Yu(i)&&i.index===r.index)return;if(Qu(e,r.index,i))throw new l(`ERROR`,`Type unification failed: occurs check`);e.substitution.set(r.index,i)}else if(i.kind===`TVar`&&Yu(i))$u(e,i,r);else if(r.kind===`Type`&&i.kind===`Type`&&r.name===i.name)r.args.forEach((t,n)=>$u(e,t,i.args[n]));else if(r.kind!==`TFree`||i.kind!==`TFree`||r.name!==i.name)throw new l(`ERROR`,`Type unification failed`)},ed=(e,t)=>{let n=/* @__PURE__ */ new Map,r=t=>{if(t.kind===`Type`)return Se(t.name,t.args.map(r));let i=t.kind===`TFree`?t.name:`${t.name}.${t.index}`,a=n.get(i);if(a!==void 0)return a;let o=Ju(e);return n.set(i,o),o};return r(t)},td=(e,t)=>{let n=e.consts.get(t);if(n===void 0)throw new l(`ERROR`,`Undeclared constant: ${t}`);return n.type},nd=(e,t,n,r,i)=>{switch(i.kind){case`name`:{let a=r.findIndex(e=>e.name===i.name);if(a>=0)return[O(a),r[a].type];let o=n.has(i.name)?void 0:e.constNames.get(i.name);if(o!==void 0){let n=ed(t,td(e,o));return[Te(o,n),n]}let s=t.freeTypes.get(i.name),c=s??Ju(t);return s===void 0&&t.freeTypes.set(i.name,c),[Ee(i.name,c),c]}case`const`:{let n=ed(t,td(e,i.name));return[Te(i.name,n),n]}case`app`:{let[a,o]=nd(e,t,n,r,i.fun),[s,c]=nd(e,t,n,r,i.arg),l=Ju(t);return $u(t,o,ke(c,l)),[A(a,s),l]}case`abs`:{let a=i.type??Ju(t),[o,s]=nd(e,t,n,[{name:i.name,type:a},...r],i.body);return[k(i.name,a,o),ke(a,s)]}case`constrain`:{let[a,o]=nd(e,t,n,r,i.term);return $u(t,o,i.type),[a,o]}}},rd=(e,t,n)=>{e.kind===`Type`?t.kind===`Type`&&e.args.forEach((e,r)=>rd(e,t.args[r],n)):n.set(e.kind===`TFree`?e.name:`${e.name}.${e.index}`,t)},id=(e,t)=>e.kind===`Type`?Se(e.name,e.args.map(e=>id(e,t))):t.get(e.kind===`TFree`?e.name:`${e.name}.${e.index}`)??e,ad=(e,t)=>{let[n,r]=Re(t),i=r.map(t=>ad(e,t));if(n.kind===`Abs`)return at(k(n.name,n.type,ad(e,n.body)),i);let a=n.kind===`Const`?e.consts.get(n.name):void 0;if(n.kind!==`Const`||a?.abbreviation===void 0)return at(n,i);let o=/* @__PURE__ */ new Map;return rd(a.type,n.type,o),at(dt(e=>id(e,o),a.abbreviation),i)},od=(e,t)=>{let n={substitution:/* @__PURE__ */ new Map,freeTypes:/* @__PURE__ */ new Map,nextParam:0},r=t.map(t=>{let[r,i]=nd(e,n,t.fixed,[],t.ast);return $u(n,i,Se(`prop`)),r}).map(t=>ad(e,dt(e=>Zu(n,e),t))),i=r.reduce((e,t)=>gt((e,t)=>ht((e,t)=>e.kind===`TVar`&&Yu(e)&&!t.includes(e.index)?[...t,e.index]:t,e,t),t,e),[]),a=/* @__PURE__ */ new Map;i.reduce((e,t)=>(a.set(t,e),h(e)),`'a`);let o=e=>e.kind===`Type`?Se(e.name,e.args.map(o)):e.kind===`TVar`&&Yu(e)?Ce(a.get(e.index)??`'a`):e;return r.map(e=>dt(o,e))},sd=(e,t)=>{let n=t.consts.map(e=>({base:e.name,name:`${t.name}.${e.name}`,type:qu(e.type)})),r={consts:new Map([...e.consts,...n.map(e=>[e.name,{type:e.type,typargs:Eu(e.type),abbreviation:void 0}])]),constNames:new Map([...e.constNames,...n.map(e=>[e.base,e.name])])},i=t.elements.reduce((e,t)=>t.kind===`fixes`?{fixed:/* @__PURE__ */ new Set([...e.fixed,...t.names]),props:e.props}:{fixed:e.fixed,props:[...e.props,{ast:Ku(t.prop),fixed:e.fixed}]},{fixed:/* @__PURE__ */ new Set,props:[]}),a=od(r,[...i.props,{ast:Ku(t.shows),fixed:i.fixed}]);return{assumptions:a.slice(0,-1),conclusion:a[a.length-1]}},cd=e=>/[A-Za-z0-9_'.]/.test(e),ld=(e,t)=>{let n=``,r=t+1;for(;r<e.length&&e[r]!==`"`;)e[r]===`\\`&&(e[r+1]===`"`||e[r+1]===`\\`)?(n+=e[r+1],r+=2):(n+=e[r],r+=1);if(r>=e.length)throw new l(`ERROR`,`Outer lexical error: unterminated string`);return[n,r+1]},ud=(e,t)=>{let n=0,r=t;do if(e.startsWith(`(*`,r))n+=1,r+=2;else if(e.startsWith(`*)`,r))--n,r+=2;else if(r>=e.length)throw new l(`ERROR`,`Outer lexical error: unterminated comment`);else r+=1;while(n>0);return r},dd=e=>{let t=[],n=0;for(;n<e.length;)if(/\s/.test(e[n]))n+=1;else if(e.startsWith(`(*`,n))n=ud(e,n);else if(e[n]===`"`){let[r,i]=ld(e,n);t.push({kind:`string`,text:r}),n=i}else if(cd(e[n])){let r=n;for(;r<e.length&&cd(e[r]);)r+=1;t.push({kind:`word`,text:e.slice(n,r)}),n=r}else t.push({kind:`symbol`,text:e[n]}),n+=1;return t},fd=/* @__PURE__ */ new Set([`fixes`,`assumes`,`shows`,`lemma`,`proof`,`show`,`using`,`by`,`qed`,`end`,`consts`]),pd=e=>{let t=dd(e),n=0,r=()=>t[n],i=e=>r()?.kind===`word`&&r().text===e,a=()=>new l(`ERROR`,`Outer syntax error at: ${r()===void 0?`end of input`:r().text}`),o=e=>{if(!i(e))throw a();n+=1},s=e=>{if(r()?.kind!==`symbol`||r().text!==e)throw a();n+=1},c=()=>{let e=r();if(e?.kind!==`word`||fd.has(e.text))throw a();return n+=1,e.text},u=()=>{let e=r();if(e?.kind!==`string`)throw a();return n+=1,e.text},d=()=>r()?.kind===`string`?u():c();o(`theory`);let f=c();for(o(`imports`);!i(`begin`);)c();o(`begin`);let p=[];if(i(`consts`))for(n+=1;r()?.kind===`string`;){let e=u();s(`:`),s(`:`),p.push({name:e,type:d()})}o(`lemma`),c(),s(`:`);let m=[];for(;i(`fixes`)||i(`assumes`);)if(i(`fixes`)){n+=1;let e=[c()];for(;r()?.kind===`word`&&!fd.has(r().text);)e.push(c());m.push({kind:`fixes`,names:e})}else{n+=1;let e=c();s(`:`),m.push({kind:`assumes`,name:e,prop:u()})}o(`shows`);let h=u();s(`(`),o(`is`),u(),s(`)`),o(`proof`),s(`-`),o(`show`),u();let g=i(`using`);g&&(n+=1,o(`assms`)),o(`by`);let _=n;for(;n<t.length&&!i(`qed`);)n+=1;let v=t.slice(_,n);if(o(`qed`),o(`end`),n!==t.length)throw a();return{name:f,consts:p,elements:m,shows:h,isUsingAssms:g,method:v}},md=`*Goal*`,hd=`*False*`,gd=[],_d=(e,t=gd)=>({kind:`Const`,name:e,typargs:t,args:void 0,ref:void 0,index:void 0,body:void 0,fun:void 0,arg:void 0}),vd=(e,t)=>({kind:`Skolem`,name:e,typargs:void 0,args:t,ref:void 0,index:void 0,body:void 0,fun:void 0,arg:void 0}),yd=e=>({kind:`Free`,name:e,typargs:void 0,args:void 0,ref:void 0,index:void 0,body:void 0,fun:void 0,arg:void 0}),bd=e=>({kind:`Var`,name:void 0,typargs:void 0,args:void 0,ref:e,index:void 0,body:void 0,fun:void 0,arg:void 0}),xd=e=>({kind:`Bound`,name:void 0,typargs:void 0,args:void 0,ref:void 0,index:e,body:void 0,fun:void 0,arg:void 0}),Sd=(e,t)=>({kind:`Abs`,name:e,typargs:void 0,args:void 0,ref:void 0,index:void 0,body:t,fun:void 0,arg:void 0}),Cd=(e,t)=>({kind:`App`,name:void 0,typargs:void 0,args:void 0,ref:void 0,index:void 0,body:void 0,fun:e,arg:t}),wd=(e,t)=>t.reduce((e,t)=>Cd(e,t),e),Td=(e,t)=>e.kind===`App`&&e.fun.kind===`Const`&&e.fun.name===t?e.arg:void 0,Ed=e=>Cd(_d(md),e),Dd=e=>Td(e,md)!==void 0,Od=(e,t)=>e===t?!0:e.kind===`Const`&&t.kind===`Const`?e.name===t.name&&kd(e.typargs,t.typargs):e.kind===`Skolem`&&t.kind===`Skolem`||e.kind===`Free`&&t.kind===`Free`?e.name===t.name:e.kind===`Var`&&e.ref.value!==void 0?Od(e.ref.value,t):t.kind===`Var`&&t.ref.value!==void 0?Od(e,t.ref.value):e.kind===`Var`&&t.kind===`Var`?e.ref===t.ref:e.kind===`Bound`&&t.kind===`Bound`?e.index===t.index:e.kind===`Abs`&&t.kind===`Abs`?Od(e.body,t.body):e.kind===`App`&&t.kind===`App`&&Od(e.fun,t.fun)&&Od(e.arg,t.arg),kd=(e,t)=>e.length===t.length&&e.every((e,n)=>Od(e,t[n])),Ad=(e,t)=>t.some(t=>Od(e,t)),jd=(e,t)=>Ad(e,t)?t:[e,...t],Md=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),Nd=(e,t)=>t.includes(e),Pd=(e,t)=>Nd(e,t)?t:[e,...t],Fd=(e,t)=>{switch(e.kind){case`Skolem`:return Ld(e.args,t);case`Var`:return e.ref.value===void 0?Pd(e.ref,t):Fd(e.ref.value,t);case`Const`:return Id(e.typargs,t);case`Abs`:return Fd(e.body,t);case`App`:return Fd(e.fun,Fd(e.arg,t));default:return t}},Id=(e,t)=>e.reduce((e,t)=>Fd(t,e),t),Ld=(e,t)=>e.reduce((e,t)=>t.value===void 0?Pd(t,e):Fd(t.value,e),t),Rd=e=>Ld(e,[]),zd=(e,t,n)=>{switch(n.kind){case`Bound`:return n.index>=t?xd(n.index+e):n;case`Abs`:return Sd(n.name,zd(e,t+1,n.body));case`App`:return Cd(zd(e,t,n.fun),zd(e,t,n.arg));default:return n}},Bd=(e,t)=>e===0?t:zd(e,0,t),Vd=(e,t=0)=>{switch(e.kind){case`Bound`:return e.index===t;case`Abs`:return Vd(e.body,t+1);case`App`:return Vd(e.fun,t)||Vd(e.arg,t);default:return!1}},Hd=(e,t,n)=>{switch(n.kind){case`Bound`:return n.index<t?n:n.index===t?Bd(t,e):xd(n.index-1);case`Abs`:return Sd(n.name,Hd(e,t+1,n.body));case`App`:return Cd(Hd(e,t,n.fun),Hd(e,t,n.arg));default:return n}},Ud=(e,t)=>Hd(e,0,t),Wd=e=>{switch(e.kind){case`Skolem`:{let t=Rd(e.args);return Md(t,e.args)?e:vd(e.name,t)}case`Const`:{if(e.typargs.length===0)return e;let t=e.typargs.map(Wd);return t.every((t,n)=>t===e.typargs[n])?e:_d(e.name,t)}case`Var`:return e.ref.value===void 0?e:Wd(e.ref.value);case`App`:{let t=Wd(e.fun);if(t.kind===`Abs`)return Wd(Ud(e.arg,t.body));let n=Wd(e.arg);return t===e.fun&&n===e.arg?e:Cd(t,n)}default:return e}},Gd=e=>{let t=e;for(;t.kind===`App`;)t=t.fun;return t},Kd=e=>{switch(e.kind){case`Var`:return e.ref.value===void 0?e:qd(e.ref.value);case`App`:{let t=Kd(e.fun);return t.kind===`Abs`?qd(Ud(e.arg,t.body)):Cd(t,e.arg)}case`Abs`:{let t=Kd(e.body);if(t.kind!==`App`)return Sd(e.name,t);let n=qd(t.arg);return Vd(t.fun)||n.kind!==`Bound`||n.index!==0?Sd(e.name,t):qd(Bd(-1,t.fun))}default:return e}},qd=e=>{let t=Gd(e);return t.kind===`Const`||t.kind===`Skolem`||t.kind===`Free`?e:Kd(e)},Jd=(e,t,n)=>{switch(n.kind){case`Var`:return e===n.ref||n.ref.value!==void 0&&Jd(e,t,n.ref.value);case`Skolem`:return n.args.some(n=>e===n||n.value!==void 0&&Jd(e,t,n.value));case`Bound`:return t<=n.index;case`Abs`:return Jd(e,t+1,n.body);case`App`:return Jd(e,t,n.arg)||Jd(e,t,n.fun);default:return!1}},Yd=(e,t)=>Jd(e,0,t),Xd=(e,t,n)=>{let r=e.find(e=>e.index===n&&e.name===t);if(r!==void 0)return r.term;let i=bd({value:void 0});return e.push({name:t,index:n,term:i}),i},Zd=(e,t)=>t.kind===`Type`?wd(_d(t.name),t.args.map(t=>Zd(e,t))):t.kind===`TFree`?yd(t.name):Xd(e,t.name,t.index),Qd=(e,t,n,r)=>{let i=e.get(n);return i===void 0||i.typargs.length===0?_d(n):_d(n,Du(i.typargs,r).map(e=>Zd(t,e)))},$d=(e,t,n,r)=>{switch(r.kind){case`Const`:return Qd(e,n,r.name,r.type);case`Free`:return yd(r.name);case`Bound`:return xd(r.index);case`Var`:return Xd(t,r.name,r.index);case`Abs`:{let i=$d(e,t,n,r.body);return i.kind===`App`&&i.arg.kind===`Bound`&&i.arg.index===0&&!Vd(i.fun)?Bd(-1,i.fun):Sd(r.name,i)}case`App`:return Cd($d(e,t,n,r.fun),$d(e,t,n,r.arg))}},ef=(e,t)=>$d(e,[],[],t),tf=e=>e.kind===`ground`,nf=(e,t,n)=>{switch(n.kind){case`Var`:{let t=e.indexOf(n.ref);return t>=0?{kind:`var`,index:t}:(e.push(n.ref),{kind:`var`,index:e.length-1})}case`Skolem`:{let e=t.indexOf(n);return e>=0?{kind:`skolem`,slot:e}:{kind:`ground`,term:n}}case`Const`:{let r=n.typargs.map(n=>nf(e,t,n));return r.every(tf)?{kind:`ground`,term:n}:{kind:`const`,name:n.name,typargs:r}}case`Abs`:{let r=nf(e,t,n.body);return tf(r)?{kind:`ground`,term:n}:{kind:`abs`,name:n.name,body:r}}case`App`:{let r=nf(e,t,n.fun),i=nf(e,t,n.arg);return tf(r)&&tf(i)?{kind:`ground`,term:n}:{kind:`app`,fun:r,arg:i}}default:return{kind:`ground`,term:n}}},rf=(e,t,n)=>{switch(n.kind){case`ground`:return n.term;case`var`:return e[n.index];case`skolem`:return t[n.slot];case`const`:return _d(n.name,n.typargs.map(n=>rf(e,t,n)));case`abs`:return Sd(n.name,rf(e,t,n.body));case`app`:return Cd(rf(e,t,n.fun),rf(e,t,n.arg))}},af=D(`etc`,0,De),of=(e,t)=>{if(e===0)return af;switch(t.kind){case`Const`:case`Skolem`:return Te(t.name,De);case`Free`:return Ee(t.name,De);case`Bound`:return O(t.index);case`App`:return A(of(e,t.fun),of(e-1,t.arg));default:return af}},sf=(e,t)=>Td(t,e)??t,cf=(e,t)=>t.kind===`App`&&t.fun.kind===`App`&&t.fun.fun.kind===`Const`&&t.fun.fun.name===`Pure.imp`?[sf(e,t.fun.arg),...cf(e,t.arg)]:[],lf=(e,t)=>t.kind===`App`&&t.fun.kind===`App`&&t.fun.fun.kind===`Const`&&t.fun.fun.name===`Pure.imp`?lf(e,t.arg):sf(e,t);var uf=class{token;constructor(e){this.token=e}};const df=(e,t)=>e instanceof uf&&e.token===t,ff=e=>{throw new uf(e?.head.token)},pf=(e,t)=>{let n=e.names;if(!n.has(t))return n.set(t,void 0),t;let r=m(t),i=r;for(;n.has(i);)i=h(n.get(i)??i);return i!==r&&n.set(r,i),n.set(i,void 0),i},mf=(e,t)=>{for(;e.trail.length>t;){let t=e.trail.pop();t!==void 0&&(t.value=void 0)}},hf=(e,t,n,r)=>Od(n,r)?!0:!Yd(n.ref,r)&&(t.includes(n.ref)?n.ref.value=r:r.kind===`Var`&&t.includes(r.ref)?r.ref.value=n:(n.ref.value=r,e.trail.push(n.ref)),!0),gf=(e,t,n,r)=>{let i=qd(n),a=qd(r);return i.kind===`Var`?hf(e,t,i,a):a.kind===`Var`?hf(e,t,a,i):i.kind===`Const`&&a.kind===`Const`?i.name===a.name&&i.typargs.length===a.typargs.length&&i.typargs.every((n,r)=>gf(e,t,n,a.typargs[r])):i.kind===`Abs`&&a.kind===`Abs`?gf(e,t,i.body,a.body):i.kind===`App`&&a.kind===`App`?gf(e,t,i.fun,a.fun)&&gf(e,t,i.arg,a.arg):Od(i,a)},_f=(e,t,n,r)=>{let i=e.trail.length;return gf(e,t,n,r)?!0:(mf(e,i),!1)},vf=(e,t)=>Cd(_d(e.context.data.notName),t),yf=(e,t)=>{let n=Td(t,md);return n===void 0?t:vf(e,n)},bf=(e,t)=>({term:yf(e,t.term),md:t.md}),xf=(e,t)=>t.map(t=>({safe:t.safe.map(t=>bf(e,t)),unsafe:t.unsafe})),Sf=(e,t,n)=>{if(n.kind===`Var`&&n.ref.value!==void 0)return Sf(e,t,n.ref.value);if(n.kind===`Abs`){let r=Sf(e,t,n.body);return r===n.body?n:Sd(n.name,r)}if(n.kind===`App`){let r=Sf(e,t,n.fun),i=Sf(e,t,n.arg);return r===n.fun&&i===n.arg?n:Cd(r,i)}return Od(n,e)?t:n},Cf=e=>{if(e.kind!==`Abs`)return e;let t=wf(e.body);return t.kind===`App`&&t.arg.kind===`Bound`&&t.arg.index===0?Vd(t.fun)?e:Cf(Bd(-1,t.fun)):e},wf=e=>e.kind===`App`?Cd(e.fun,Cf(e.arg)):Cf(e),Tf=(e,t)=>{let n=e.kind===`Skolem`?e.args:[],r=t=>Od(e,t)||i(t),i=e=>{switch(e.kind){case`Var`:return e.ref.value===void 0?!n.includes(e.ref):r(e.ref.value);case`Abs`:return r(e.body);case`App`:return r(e.arg)||r(e.fun);default:return!1}};return r(t)},Ef=(e,t)=>{if(t.kind!==`App`||t.fun.kind!==`App`||t.fun.fun.kind!==`Const`||t.fun.fun.name!==e.context.data.equalityName)return;let n=Cf(t.fun.arg),r=Cf(t.arg),i=(e,t)=>Tf(e,t)?void 0:[e,t];if(n.kind===`Skolem`)return i(n,r);if(r.kind===`Skolem`)return i(r,n);if(n.kind===`Free`)return i(n,r);if(r.kind===`Free`)return i(r,n)},Df=(e,t,n)=>{let r=Ef(e,t);if(r===void 0)return;let i=e=>Sf(r[0],r[1],e),a=(e,t)=>e.reduceRight((e,t)=>{let n=i(t.term);return Od(n,t.term)?{changed:e.changed,kept:[t,...e.kept]}:{changed:[{term:n,md:t.md},...e.changed],kept:e.kept}},{changed:t,kept:[]}),o=n.lits.reduceRight((e,t)=>{let n=i(t);return Od(n,t)?{changed:e.changed,lits:[n,...e.lits]}:{changed:[{term:n,md:!0},...e.changed],lits:e.lits}},{changed:[],lits:[]}),s=n.pairs.reduceRight((e,t)=>{let n=a(t.safe,e.changed),r=a(t.unsafe,n.changed);return{changed:r.changed,frames:[{safe:n.kept,unsafe:r.kept},...e.frames]}},{changed:o.changed,frames:[]});return{pairs:[{safe:s.changed,unsafe:[]},...s.frames],lits:o.lits,vars:n.vars,lim:n.lim}},Of=e=>Ja(Qs,Zs(e.context.limits)),kf=e=>qa(oc(e.context.limits,[e.context.data.notE]),Of(e)),Af=(e,t,n,r)=>_f(e,[],t,n)?r(e):void 0,jf=(e,t,n)=>{let r=e.context.data.notName,i=Td(t,md);if(i!==void 0)return Af(e,i,n,Of);let a=Td(n,md);if(a!==void 0)return Af(e,t,a,Of);let o=Td(t,r);if(o!==void 0)return Af(e,o,n,kf);let s=Td(n,r);if(s!==void 0)return Af(e,t,s,kf)},Mf=e=>{switch(e.kind){case`Skolem`:return!0;case`Abs`:return Mf(e.body);case`App`:return Mf(e.fun)||Mf(e.arg);default:return!1}},Nf=(e,t)=>t.map(t=>({term:t,md:Mf(t)||e})),Pf=(e,t,n,r)=>{if(t.length===0)return!1;for(let i=n,a=r-1;i!==0&&a>=0;--i){let n=e.trail[a];if(t.some(e=>Yd(n,e)))return!0;--a}return!1},Ff=(e,t,n,r)=>{if(t===1)return r;let i=r,a=e.trail.length;for(let o=r;o!==void 0;o=o.tail){let r=o.head;if(r.nbrs<t)return i;if(!(r.nbrs>t)){if(Pf(e,n,a-r.ntrl,a))return i;i=o.tail,a=r.ntrl}}return i},If=e=>e.length===0?[]:e[0].vars.map(e=>bd(e)),Lf=(e,t,n)=>{let r=Td(t,md);if(r===void 0)return jd(t,n);let i=e.context.data.notName;return[Cd(_d(md),r),...n.some(e=>{if(Dd(e))return!0;let t=Td(e,i);return t!==void 0&&Od(r,t)})?n.flatMap(t=>{let n=Td(t,`*Goal*`)??Td(t,i);return n===void 0?[t]:Od(r,n)?[]:[vf(e,n)]}):n]},Rf=e=>e<4?0:1+Rf(Math.floor(e/4)),zf=(e,t,n)=>{if(t.kind===`Var`)return!0;if(t.kind===`Const`&&n.kind===`Const`){let r=e.context.data.notName;return t.name===`*Goal*`&&n.name===r||t.name===r&&n.name===`*Goal*`||t.name===n.name&&t.typargs.length===n.typargs.length&&t.typargs.every((t,r)=>zf(e,t,n.typargs[r]))}return t.kind===`Free`&&n.kind===`Free`?t.name===n.name:t.kind===`Bound`&&n.kind===`Bound`?t.index===n.index:t.kind===`Abs`&&n.kind===`Abs`?zf(e,t.body,n.body):t.kind===`App`&&n.kind===`App`&&zf(e,t.fun,n.fun)&&zf(e,t.arg,n.arg)},Bf=(e,t)=>{let n=t.findIndex(t=>{if(t.kind!==`App`||t.fun.kind!==`Const`)return!1;let n=t.arg;return n.kind===`Var`&&n.ref.value?.kind===`Const`&&n.ref.value.name===`*False*`&&(t.fun.name===`*Goal*`||t.fun.name===e.context.data.notName)});return n===-1?void 0:[...t.slice(0,n),...t.slice(n+1)]},Vf=(e,t)=>{let n=Td(t,`Pure.all`);if(n?.kind!==`Abs`)return t;let r=vd(``,[]);return e.push(r),Vf(e,Ud(r,n.body))},Hf=e=>({count:0,concl:void 0,skolems:e,major:void 0,prems:[]}),Uf=(e,t)=>{let n=e.context.data.trueprop,r=ef(e.context.consts,t.prop),i=[];nf(i,[],r);let a=cf(n,r),o=lf(n,r);if(a.length===0||o.kind!==`Var`)return Hf(0);o.ref.value=_d(hd);let s=[],c=[];for(let t of a.slice(1)){let r=Vf(s,t),i=Bf(e,[Ed(lf(n,r)),...cf(n,r)]);if(i===void 0)return Hf(s.length);c.push(i)}return{count:i.length,concl:i.indexOf(o.ref),skolems:s.length,major:nf(i,s,a[0]),prems:c.map(e=>e.map(e=>nf(i,s,e)))}},Wf=(e,t)=>{let n=e.context.data.trueprop,r=ef(e.context.consts,t.prop),i=[];nf(i,[],r);let a=[],o=cf(n,r).map(e=>{let t=Vf(a,e);return[Ed(lf(n,t)),...cf(n,t)]});return{count:i.length,concl:void 0,skolems:a.length,major:nf(i,a,Ed(lf(n,r))),prems:o.map(e=>e.map(e=>nf(i,a,e)))}},Gf=e=>{let t=yn(Aa(void 0,2,za(e,2,So)));if(t===void 0)throw new l(`ERROR`,`rev_dup_elim: Seq.hd`);return t},Kf=e=>e.filter(e=>Td(e,md)===void 0).length,qf=(e,t)=>n=>r=>gn((e?t.map(Kf):[]).reduce((e,t,r)=>t===0?e:Ma(-t,n+r,e),r)),Jf=(e,t,n)=>t?nc(e.context.limits,[n]):oc(e.context.limits,[n]),Yf=(e,t,n)=>t?tc(e.context.limits,[n]):ac(e.context.limits,[n]),Xf=(e,t,n)=>(r,i,a)=>o=>Ua(Jf(e,r,i?Gf(t):t)(o),qf(a,n)(o)),Zf=(e,t,n)=>(r,i,a)=>o=>Ua(Yf(e,r,i?Ho(Ba(t,e.context.data.classical)):t)(o),qf(a,n)(o));var Qf=class{state;rule;isIntro;template;majorTemplate;skolems;vars;instantiatedMajor;instantiatedPrems;constructor(e,t,n,r,i,a){this.state=e,this.rule=t,this.isIntro=n,this.template=r,this.majorTemplate=i,this.skolems=a}getVars(){if(this.vars!==void 0)return this.vars;let e=[];for(let t=0;t<this.template.count;t+=1)e.push(bd({value:t===this.template.concl?_d(hd):void 0}));return this.vars=e,e}get major(){return this.instantiatedMajor??=rf(this.getVars(),this.skolems,this.majorTemplate),this.instantiatedMajor}get prems(){return this.instantiatedPrems??=this.template.prems.map(e=>e.map(e=>rf(this.getVars(),this.skolems,e))),this.instantiatedPrems}tactic(e,t,n){return(this.isIntro?Zf:Xf)(this.state,this.rule,this.prems)(e,t,n)}};const $f=(e,t,n,r)=>{let i=r?e.context.introTemplates:e.context.elimTemplates,a=i.get(n),o=a??(r?Wf(e,n):Uf(e,n));a===void 0&&i.set(n,o);let s=[];for(let n=0;n<o.skolems;n+=1)s.push(vd(pf(e,`S`),t));return o.major===void 0?void 0:new Qf(e,n,r,o,o.major,s)},ep=(e,t)=>t.kind===`Var`||Td(t,e.context.data.notName)?.kind===`Var`,tp=e=>lc(e.map(e=>({tag:e.tag,item:e.rule}))),np=(e,t,n,r)=>{let i=Td(t,md);if(i===void 0&&ep(e,t))return[];let a=Te(e.context.data.trueprop,De),o=i===void 0?A(a,of(3,t)):A(a,of(2,i)),s=[];for(let e of r)for(let t of ss(i===void 0?e.elim:e.intro,o))s.push(t);let c=[];for(let t of tp(s)){let r=$f(e,n,t,i!==void 0);r!==void 0&&c.push(r)}return c},rp=e=>qa(tc(e.context.limits,[e.context.data.ccontr]),hc(-1)),ip=e=>({kind:`done`,result:e}),ap=(e,t)=>e.reduceRight((e,t)=>Id(t,e),t),op=(e,t,n)=>{let r=e.context,i=[r.claset.safe0,r.claset.safep],a=[r.claset.unsafe],o=(t,n,o)=>{let s={},l=o[0],u=o.slice(1),d=l.pairs[0],f=d.safe[0].md,p={safe:d.safe.slice(1),unsafe:d.unsafe},m=[p,...l.pairs.slice(1)],h=e.trail.length,g=o.length,_=If(u),v=Wd(d.safe[0].term),y=np(e,v,l.vars,i),b=(t,n,r)=>[...r.map(r=>{let i={safe:Nf(f,r),unsafe:[]};return r.some(Dd)?{pairs:[i,...xf(e,m)],lits:l.lits.map(t=>yf(e,t)),vars:t,lim:n}:{pairs:[i,...m],lits:l.lits,vars:t,lim:n}}),...u],x=()=>{for(let r=0;r<y.length;r+=1){let i=y[r];if(!_f(e,Fd(i.major,[]),i.major,v))continue;let a=h<e.trail.length,o=a?l.lim-(1+Rf(y.length)):l.lim,d=ap(i.prems,Rd(l.vars)),f=fr({ntrl:h,nbrs:g,token:s},n),p=fr(i.tactic(a,!1,!0),t);try{if(i.prems.length===0)return c(p,Ff(e,g,_,f),u);if(o<0){mf(e,h);return}return c(p,f,b(d,o,i.prems))}catch(t){if(!df(t,s))throw t;if(!a)return ff(n);mf(e,h)}}},ee=r=>{for(let i of r){let r=jf(e,v,i);if(r===void 0)continue;let a=Ff(e,g,_,fr({ntrl:h,nbrs:g,token:s},n));try{return c(fr(r,t),a,u)}catch(t){if(!df(t,s))throw t;mf(e,h)}}},S=e=>{for(let t of e){let e=ee(t.safe.map(e=>e.term))??ee(t.unsafe.map(e=>e.term));if(e!==void 0)return e}};if(l.lim<0)return ff(n);let te=Df(e,v,{...l,pairs:m});if(te!==void 0)return{kind:`next`,tactics:fr(r.data.hypSubstTac(r.limits),t),choices:n,brs:[te,...u]};let C=ee(l.lits)??S(m)??x();if(C!==void 0)return ip(C);if(np(e,v,l.vars,a).length===0)return{kind:`next`,tactics:t,choices:n,brs:[{pairs:m,lits:Lf(e,v,l.lits),vars:l.vars,lim:l.lim},...u]};let w={term:yf(e,v),md:f};return{kind:`next`,tactics:Dd(v)?fr(rp(e),t):t,choices:n,brs:[{pairs:[{safe:p.safe,unsafe:[...p.unsafe,w]},...m.slice(1)],lits:l.lits,vars:l.vars,lim:l.lim},...u]}},s=(t,n,r)=>{let i={},o=r[0],s=r.slice(1),l=o.pairs[0].unsafe,u=l[0].md,d=l.slice(1),f=Wd(l[0].term),p=e.trail.length,m=np(e,f,o.vars,a),h=(t,n,r,i,a)=>{let s=a.map(e=>({term:e,md:!1})),c=r?[...d,{term:yf(e,f),md:u}]:d;return{pairs:a.some(t=>zf(e,n,t))?[{safe:s,unsafe:c}]:[{safe:s,unsafe:[]},{safe:[],unsafe:c}],lits:a.some(Dd)?o.lits.map(t=>yf(e,t)):o.lits,vars:t,lim:i}},g=()=>{for(let a=0;a<m.length;a+=1){let l=m[a];if(!_f(e,Fd(l.major,[]),l.major,f))continue;let d=p<e.trail.length,g=Rd(o.vars),_=ap(l.prems,g),v=u,y=d?o.lim-(1+Rf(m.length)):o.lim-1,b=a+1<m.length||d||Md(g,_),x=l.tactic(d,v,!0);if(y<0&&l.prems.length>0){mf(e,p);return}try{return c(fr(x,t),fr({ntrl:p,nbrs:r.length,token:i},n),[...l.prems.map(e=>h(_,l.major,v,y,e)),...s])}catch(t){if(!df(t,i))throw t;if(!b)return ff(n);mf(e,p)}}};if(o.lim<1)return ff(n);let _=g();return _===void 0?{kind:`next`,tactics:t,choices:n,brs:[{pairs:[{safe:[],unsafe:d}],lits:[f,...o.lits],vars:o.vars,lim:o.lim},...s]}:ip(_)},c=(e,t,i)=>{let a=e,c=t,l=i;for(;;){if(pr(r.limits),l.length===0)return n(a,c);let e=l[0],t=e.pairs[0];if(t===void 0)return ff(c);let i=t.safe.length>0?o(a,c,l):e.pairs.length===1&&t.unsafe.length>0?s(a,c,l):void 0;if(i?.kind===`done`)return i.result;if(i!==void 0)a=i.tactics,c=i.choices,l=i.brs;else if(e.pairs.length>1){let n=e.pairs[1];l=[{pairs:[{safe:n.safe,unsafe:[...t.unsafe,...n.unsafe]},...e.pairs.slice(2)],lits:e.lits,vars:e.vars,lim:e.lim},...l.slice(1)]}else return ff(c)}};return c(void 0,fr({ntrl:e.trail.length,nbrs:t.length,token:void 0},void 0),t)};var sp=class extends Error{};const cp=e=>e instanceof l&&e.exception===`TERM`,lp=(e,t)=>{for(let t of[md,hd])if(e.consts.has(t))throw new l(`ERROR`,`blast: theory contains reserved constant "${t}"`);return{context:e,names:new Map(b(xt(t.prop,[]))),trail:[]}},up=e=>e.kind===`App`&&e.fun.kind===`Const`&&e.fun.name===`Pure.all`&&e.arg.kind===`Abs`?up(e.arg.body):e,dp=(e,t)=>{let n=[],r=[],i=(t,a)=>{let[o,s]=Re(a),c=e=>wd(e,s.map(e=>i(t,e))),l=()=>s.map(e=>{if(e.kind!==`Bound`)throw new sp(`Function unknown's argument not a bound variable`);if(e.index<t)throw new sp(`Function unknown's argument not a parameter`);return e.index-t});switch(o.kind){case`Const`:return c(Qd(e.context.consts,r,o.name,o.type));case`Free`:return c(yd(o.name));case`Bound`:return c(xd(o.index));case`Var`:{let e=`${o.name}.${o.index}`,t=n.find(t=>t.key===e);if(t===void 0){let t={key:e,ref:{value:void 0},bounds:l()};return n.unshift(t),bd(t.ref)}let r=l();if(t.bounds.length===r.length&&t.bounds.every((e,t)=>e===r[t]))return bd(t.ref);throw new sp(`Discrepancy among occurrences of ?${o.name}`)}case`Abs`:if(s.length>0)throw new sp(`argument not in normal form`);return Sd(o.name,i(t+1,o.body));case`App`:throw new sp(`strip_comb`)}},a=nn(t).length,o=i(0,up(t));for(let t=0;t<a;t+=1){let r=n.filter(e=>!e.bounds.includes(t)).map(e=>e.ref);o=Ud(vd(pf(e,`T`),r),o)}return o},fp=e=>t=>{let n=(t,r,i)=>{let a=t,o=r,s=i;for(;;)if(s===void 0){if(a===void 0)return;let e=a.rest.pull();e===void 0?a=a.next:Qa(a.state,e[0])?a={...a,rest:e[1]}:(a={state:e[0],rest:e[1],position:a.position,next:a.next},o=a.position,s=e[0])}else if(o===e.length){let e=a;return[s,dn(()=>n(e,0,void 0))]}else{let t=e[o](s).pull();t===void 0?s=void 0:(a={state:t[0],rest:t[1],position:o+1,next:a},o+=1,s=t[0])}};return dn(()=>n(void 0,0,t))},pp=(e,t)=>({pairs:[{safe:e.map(e=>({term:e,md:!0})),unsafe:[]}],lits:[],vars:Id(e,[]),lim:t}),mp=(e,t)=>n=>{let r=lp(e,n),i=(e,t)=>{let r=(()=>{try{let t=[];for(let n=e;n!==void 0;n=n.tail)t.push(n.head(1));return fp(t.reverse())(n).pull()}catch(e){if(cp(e))return ff(t);throw e}})();return r===void 0?ff(t):_n(r)};try{let a=dp(r,It(n.prop)[0]),o=e.data.trueprop;return op(r,[pp([Ed(lf(o,a)),...cf(o,a)],t)],i)}catch(e){if(df(e,void 0)||e instanceof sp)return mn;throw e}},hp=(e,t)=>n=>Xc(Ua(Gc(e.limits,e.data.atomize)(1),mp(e,t)))(n),gp=(e,t,n)=>r=>$i(r)<1||n>t?mn:Wa(mp(e,n),gp(e,t,n+1))(r),_p=e=>t=>Xc(Ua(Gc(e.limits,e.data.atomize)(1),gp(e,20,0)))(t);var vp=class{},yp=class{};const bp=e=>e instanceof l&&e.exception===`TERM`,xp=e=>e instanceof l&&e.exception===`THM`,Sp=e=>{let t=sr(e);return t.kind===`Free`&&te(t.name)?O(0):t},Cp=e=>!!(be(e)&1),wp=e=>vt(e=>_e(e)>=0,e),Tp=(e,t,n,r)=>{if(t&&(wp(n)||wp(r)))throw new vp;let i=Sp(n),a=Sp(r);if(i.kind===`Bound`){if(Ze(r,i.index)||t&&Cp(r))throw new vp;return[!0,i]}if(a.kind===`Bound`){if(Ze(n,a.index)||t&&Cp(n))throw new vp;return[!1,a]}if(i.kind===`Free`){if(e||Et(i,r)||t&&Cp(r))throw new vp;return[!0,i]}if(a.kind===`Free`){if(e||Et(a,n)||t&&Cp(n))throw new vp;return[!1,a]}throw new vp},Ep=(e,t,n,r,i)=>{let a=(e,t,n)=>{if(n.kind!==`Free`)return[t,!1];if(!r||!t||e.some(e=>Et(n,e)))return[t,!0];throw new vp},o=(r,i,s)=>{if(i.kind===`App`&&i.fun.kind===`Const`&&i.fun.name===`Pure.all`&&i.arg.kind===`Abs`)return o(r,i.arg.body,s);if(i.kind===`App`&&i.fun.kind===`App`&&i.fun.fun.kind===`Const`&&i.fun.fun.name===`Pure.imp`){let c=i.fun.arg,l=i.arg;try{let[i,o]=e.destEq(e.destTrueprop(c)),[u,d]=Tp(t,n,i,o);return[r,a([l,...s],u,d)]}catch(e){if(!bp(e)&&!(e instanceof vp))throw e;return o(r+1,l,[c,...s])}}throw new yp};return o(0,i,[])},Dp=e=>fo((t,n)=>{try{return e(t,n)}catch(e){if(e instanceof yp||xp(e))return Ha;throw e}}),Op=(e,t,n)=>{try{let[r,i]=e.destEq(e.destTrueprop(n.prop));return Tp(t,!1,r,i)[0]?[Ba(n,e.eqReflection)]:[fa(Ba(n,e.eqReflection))]}catch(e){if(bp(e)||e instanceof vp)return[];throw e}},kp=(e,t)=>Dp((n,r)=>{let[i,[a,o]]=Ep(e.data,t,!0,!0,n),s={limits:e.limits,simpset:{...Ns,mkRews:{mk:n=>Op(e.data,t,n),mkEqTrue:()=>void 0}},bounds:0};return eo([hc(i)(r),il(s)(r),o?a?nc(e.limits,[e.data.revMp])(r):nc(e.limits,[Ba(e.data.sym,e.data.revMp)])(r):nc(e.limits,[Co])(r),hc(-i)(r),o?tc(e.limits,[e.data.impIntr])(r):Va])}),Ap=e=>Ho(Ba(e.sym,e.subst)),jp=(e,t,n)=>fo((r,i)=>a=>{let o=e.data,s=(()=>{try{let e=en(r)[0];if(e===void 0)return;let[t,n]=o.destEq(o.destTrueprop(e));return[sr(t),sr(n)]}catch(e){if(bp(e))return;throw e}})();if(s===void 0)return Ha(a);let[c,u]=s,d=nn(r),f=Fe([...d].reverse().map(e=>e.type),c),p=o.destTrueprop(tn(r)),m=Oa(r,a.maxidx,n),h=ze(o.destTrueprop(tn(m.prop))),[g,_]=o.destEq(o.destTrueprop(tn(ea(m)[0])));if(h.kind!==`Var`)throw new l(`TERM`,`dest_Var`);let v=je(h.type),y=v.slice(0,-1),b=v[v.length-1],x=e=>d.reduceRight((e,t)=>k(t.name,t.type,e),e),ee=t?c:u,S=ee.kind===`Bound`?nt([...Array.from({length:ee.index},(e,t)=>O(t+1)),O(0),...Array.from({length:d.length-ee.index-1},(e,t)=>O(ee.index+2+t))],p):ut(ee,Ye(1,p)),te=x(k(`x`,f,S)),C=Fn(b,f,kn);if(C===void 0)throw new l(`TYPE`,`Thm.match`);let w=ze(g),T=ze(_);if(w.kind!==`Var`||T.kind!==`Var`)throw new l(`TERM`,`dest_Var`);let ne=Sa([{variable:D(h.name,h.index,Ae([...y.map(e=>Ln(C,e)),f],Ln(C,Me(h.type)))),term:te},{variable:D(w.name,w.index,Ae(y.map(e=>Ln(C,e)),f)),term:x(c)},{variable:D(T.name,T.index,Ae(y.map(e=>Ln(C,e)),f)),term:x(u)}],wa(C,m));return $s(e.limits,!0,Go(ne,wo),ea(n).length)(i)(a)}),Mp=(e,t)=>Dp((n,r)=>{let i=en(n).length-1,[a,[o,s]]=Ep(e.data,t,!1,!0,n),c=Ap(e.data),l=s?Np(c):c,u=o?l:Ba(e.data.sym,l);return Xa(eo([ro(a,nc(e.limits,[e.data.revMp])(r)),hc(1)(r),ro(i-a,nc(e.limits,[e.data.revMp])(r)),jp(e,o,u)(r),ro(i,Ua(tc(e.limits,[e.data.impIntr])(r),hc(-1)(r)))]))}),Np=e=>{let t=xn(Aa(void 0,2,za(e,2,So)))[0];if(t===void 0)throw new l(`THM`,`rev_dup_elim`);return t},Pp=e=>t=>ao(no([oc(e.limits,[e.data.thinRefl]),kp(e,!1),Mp(e,!1)])(t)),Fp=(e,t,n)=>t===0?Va:t===1?hc(-1)(n):Ua(ro(t,Ua(hc(-1)(n),nc(e.limits,[e.data.revMp])(n))),ro(t,Ua(tc(e.limits,[e.data.impIntr])(n),hc(-1)(n)))),Ip=(e,t,n)=>{let r=(t,i)=>a=>{if(i.length===0)return Fp(e,t,n)(a);let[o]=e.data.destImp(e.data.destTrueprop(tn(ra(a,n)))),s=cr(i[0],o),c=(s?Ua(tc(e.limits,[e.data.impIntr])(n),hc(-1)(n)):tc(e.limits,[e.data.impIntr])(n))(a).pull();return c===void 0?Va(a):r(s?t:t+1,i.slice(1))(c[0])};return r(0,[...t].reverse())},Lp=e=>Dp((t,n)=>{let[r,[i]]=Ep(e.data,!1,!1,!1,t),a=en(t).map(e.data.destTrueprop),o=[...a.slice(0,r),...a.slice(r+1)];return Xa(eo([ro(r,nc(e.limits,[e.data.revMp])(n)),hc(1)(n),ro(o.length-r,nc(e.limits,[e.data.revMp])(n)),jp(e,i,i?Ap(e.data):e.data.subst)(n),Ip(e,o,n)]))}),Rp=(e,t)=>{let n=e.facts.get(t);if(n===void 0||n.length!==1)throw new l(`ERROR`,`Undefined fact: ${t}`);return n[0]},zp=(e,t)=>{if(t.kind===`App`&&t.fun.kind===`App`&&t.fun.fun.kind===`Const`&&t.fun.fun.name===e)return[t.fun.arg,t.arg];throw new l(`TERM`,`dest ${e}`)},Bp=e=>{if(e.kind===`App`&&e.fun.kind===`Const`&&e.fun.name===`PredicateLogic.Trueprop`)return e.arg;throw new l(`TERM`,`dest_Trueprop`)},Vp=e=>({destTrueprop:Bp,destEq:e=>zp(`PredicateLogic.eq`,e),destImp:e=>zp(`PredicateLogic.imp`,e),eqReflection:Rp(e,`PredicateLogic.eq_reflection`),revEqReflection:Rp(e,`PredicateLogic.meta_to_obj_eq`),impIntr:Rp(e,`PredicateLogic.impI`),revMp:Rp(e,`PredicateLogic.rev_mp`),subst:Rp(e,`PredicateLogic.subst`),sym:Rp(e,`PredicateLogic.sym`),thinRefl:Rp(e,`PredicateLogic.thin_refl`)}),Hp=e=>{let t=Vp(e);return{impElim:Rp(e,`PredicateLogic.impCE'`),notElim:Rp(e,`PredicateLogic.notE`),swap:Rp(e,`PredicateLogic.swap`),classical:Rp(e,`PredicateLogic.classical`),judgment:`PredicateLogic.Trueprop`,hypSubstTacs:[e=>Pp({limits:e,data:t})]}},Up=e=>{let t=(e,t)=>e.reduceRight((e,t)=>cc(t,e),t);return t(e.elim,t(e.intro,{intro:Yo,elim:Yo}))},Wp=(e,t)=>{let n={safeIs:e.claset.safeIs,safeEs:e.claset.safeEs,unsafeIs:e.claset.unsafeIs,unsafeEs:e.claset.unsafeEs,swrappers:[],uwrappers:[],safe0:Up(e.claset.safe0),safep:Up(e.claset.safep),unsafe:Up(e.claset.unsafe),dup:Up(e.claset.dup)},r=qa(rc(t,[Rp(e,`SetTheory.bspec`)]),Zs(t));return Ol(n,`bspec`,r)},Gp=(e,t,n)=>t===0?n.kind===`Const`&&n.name===e:n.kind===`App`&&Gp(e,t-1,n.fun),Kp=e=>{try{return e()}catch(e){if(e instanceof l&&e.exception===`THM`)return;throw e}},qp=e=>{let t=t=>Rp(e,`PredicateLogic.${t}`),n=t(`eq_reflection`),r=t(`eqTrueI`),i=Ba(t(`neq_conv_eq_False`),n),a=e=>{let t=ta(e),a=t.kind===`App`?t:void 0;return Gp(`Pure.eq`,2,t)?e:a!==void 0&&Gp(`PredicateLogic.eq`,2,a.arg)?Ba(e,n):a!==void 0&&a.arg.kind===`App`&&Gp(`PredicateLogic.not`,0,a.arg.fun)&&Gp(`PredicateLogic.eq`,2,a.arg.arg)?Ba(e,i):Ba(Ba(e,r),n)},o=/* @__PURE__ */ new Map([[`PredicateLogic.not`,{rules:[t(`boolifyFalseI`)],isSimplified:!0}],[`PredicateLogic.iff`,{rules:[t(`iffThenBoolifyEqual`)],isSimplified:!0}],[`PredicateLogic.imp`,{rules:[t(`mp`)],isSimplified:!1}],[`PredicateLogic.conj`,{rules:[t(`conjD1`),t(`conjD2`)],isSimplified:!1}],[`PredicateLogic.All`,{rules:[t(`spec`)],isSimplified:!1}],[`PredicateLogic.TRUE`,{rules:[],isSimplified:!1}],[`PredicateLogic.FALSE`,{rules:[],isSimplified:!1}],[`PredicateLogic.cond`,{rules:[Ba(t(`if_bool_equiv_conj`),t(`iffD1`))],isSimplified:!1}]]),s=(e,t)=>{let n=ta(t);if(!(n.kind===`App`&&Gp(`PredicateLogic.Trueprop`,1,n)))return[t];let r=ze(n.arg),i=r.kind===`Const`?o.get(r.name):void 0;if(i===void 0)return[t];let a=e=>i.rules.map(t=>Ba(e,t)),c=Kp(()=>(t.maxidx===-1?a(t):ul(a,t)).flatMap(t=>s(e,t)));return c===void 0?[t]:i.isSimplified?c.map(t=>cl(e,t)):c};return{mk:(e,t)=>s(t,Ro(e)).flatMap(e=>{let t=Kp(()=>a(e));return t===void 0?[]:[t]}),mkEqTrue:e=>Kp(()=>Ba(Ba(e,r),n))}},Jp=e=>{let t=t=>Rp(e,`PredicateLogic.${t}`),n=[Oo,t(`trueI`),t(`refl`),t(`iff_refl`),t(`notFalseI`)],r=[t(`falseE`),t(`not_refl_False`)],i=t(`conjI`),a=t(`simp_impliesI`),o=e=>t=>io(ac(e.limits,[a])(t));return{unsafe:{name:`PredicateLogic unsafe`,tactic:e=>{let t=e.limits,a=o=>Wa(to([tc(t,[...n,...e.simpset.prems])(o),Zs(t)(o),nc(t,r)(o)]),mo(ac(t,[i]),a)(o));return qa(o(e),a)}},safe:{name:`PredicateLogic safe`,tactic:e=>qa(o(e),no([ac(e.limits,[...n,...e.simpset.prems]),Qs,oc(e.limits,r)]))}}},Yp=e=>{let t=t=>Rp(e,`PredicateLogic.${t}`),n=t(`eq_reflection`),r=Ba(Ba(t(`not_sym`),t(`neq_conv_eq_False`)),n),i=Ba(t(`symEqLeft`),n),a=(e,t,n,r)=>{let i=r.prop;if(i.kind!==`App`||i.arg.kind!==`App`)return!1;let a=i.arg;if(a.arg.kind===`App`&&a.arg.fun.kind===`App`){let r=a.arg;return Gp(`PredicateLogic.not`,0,a.fun)&&r.fun.kind===`App`&&ot(r.fun.fun,e)&&j(r.arg,t)&&j(r.fun.arg,n)}if(a.fun.kind!==`App`)return!1;let o=a.fun.arg;return Gp(`PredicateLogic.eq`,0,a.fun.fun)&&o.kind===`App`&&o.fun.kind===`App`&&Gp(`PredicateLogic.eq`,0,o.fun.fun)&&Gp(`PredicateLogic.FALSE`,0,a.arg)&&j(o.arg,t)&&j(o.fun.arg,n)};return(e,t)=>{if(t.kind!==`App`||t.fun.kind!==`App`)return;let n=t.fun.fun,o=t.fun.arg,s=t.arg,c=e.simpset.prems.find(e=>a(n,o,s,e));if(c!==void 0)return Kp(()=>Ba(c,i))??Ba(c,r)}},Xp=e=>{let t=Yp(e),n=Jp(e),r=/* @__PURE__ */ new Map([[`PredicateLogic.neq`,t]]);return{rules:js(e.simps),prems:[],depth:0,congs:e.congs.reduce((e,t)=>ce(e,cs(t),t.rule),Ms),weakCongs:e.weakCongs,simprocs:e.simprocs.reduce((e,t)=>{let n=r.get(t.name);if(n===void 0)throw new l(`ERROR`,`Undefined simproc: ${t.name}`);return t.lhss.reduce((e,r)=>$o(r,{name:t.name,lhs:r,proc:n},e),e)},Yo),mkRews:qp(e),subgoalTac:rl,loopTacs:[],unsafeSolvers:[n.unsafe],safeSolvers:[n.safe]}},Zp=[`Zenon.atomize_object_bAll`,`Zenon.atomize_meta_bAll`,`PredicateLogic.atomize_conj`,`PredicateLogic.atomize_eq`,`PredicateLogic.atomize_not`,`PredicateLogic.atomize_imp`,`PredicateLogic.atomize_all`],Qp=e=>{let t=(e,t)=>e.reduceRight((e,t)=>cc(t,e),t);return t(e.elim,t(e.intro,{intro:Yo,elim:Yo}))},$p=(e,t)=>{let n=Zp.map(t=>Rp(e,t)),r={limits:t,claset:Wp(e,t),data:Hp(e)},i=Vp(e),a=t=>({limits:t.limits,claset:t.claset,consts:e.consts,elimTemplates:/* @__PURE__ */ new WeakMap,introTemplates:/* @__PURE__ */ new WeakMap,data:{trueprop:`PredicateLogic.Trueprop`,equalityName:`PredicateLogic.eq`,notName:`PredicateLogic.not`,notE:Rp(e,`PredicateLogic.notE`),ccontr:Rp(e,`PredicateLogic.contradiction`),hypSubstTac:e=>Lp({limits:e,data:i}),classical:Rp(e,`PredicateLogic.classical`),atomize:n}});return{limits:t,simpset:Xp(e),classical:r,intuitionistic:{limits:t,safeRules:Qp(e.contextRules.bang),rules:Qp(e.contextRules.plain)},atomizeRules:n,blastDepthTac:(e,t)=>hp(a(e),t),blastTac:e=>_p(a(e)),getFact:t=>{let n=e.facts.get(e.factNames.get(t)??t);if(n===void 0)throw new l(`ERROR`,`Undefined fact: ${t}`);return n}}},em=()=>{let e=JSON.parse(`{"strings":["PredicateLogic.c","fun","prop","'a","itself","'b","Pure.proof","'c","'d","'e","'f","Pure.eq","CaseExpressions.CaseArm","p","e","PredicateLogic.cond","SetTheory.addElt","SetTheory.emptyset","CaseExpressions.CaseOther","ps","es","oth","PredicateLogic.Choice","x","SetTheory.in","SetTheory.union","SetTheory.UNION","SetTheory.setOfAll","Functions.DOMAIN","i","Functions.fapply","SetTheory.bAll","PredicateLogic.not","CaseExpressions.Case","FixedPoints.Monotonic","D","f","PredicateLogic.conj","SetTheory.subset","SetTheory.SUBSET","S","T","PredicateLogic.imp","Pure.imp","PredicateLogic.Trueprop","PredicateLogic.eq","FixedPoints.gfp","Pure.all","A","g","SetTheory.subsetOf","FixedPoints.lfp","SetTheory.INTER","SetTheory.inter","Functions.Bijections","Functions.Injections","Functions.Surjections","Functions.Fcn","PredicateLogic.iff","Functions.FuncSet","Functions.isAFcn","Functions.Image","Functions.InjectiveOn","y","Functions.Inverse","SetTheory.bChoose","Functions.Surjective","w","Functions.except","v","P","PredicateLogic.boolify","PredicateLogic.disj","U","Functions.extend","h","SetTheory.setminus","V","PredicateLogic.Ex","B","SetTheory.bEx","a","C","PredicateLogic.isBool","Functions.oneArg","d","Q","IntegerArithmetic.leq","m","k","Integers.Int","n","Integers.succ","IntegerArithmetic.intvl","j","IntegerArithmetic.addint","Integers.zero","b","c","Integers.uminus","Integers.Nat","IntegerArithmetic.less","Integers.pred","IntegerArithmetic.multint","IntegerArithmetic.pr_addint","PredicateLogic.FALSE","l","R","IntegerArithmetic.pr_multint","Integers.int_primrec","IntegerDivision.div","IntegerDivision.mod","IntegerDivision.dvd","q","r","thesis","q'","r'","Integers.ExtendedPeano","I","N","Z","sc","cp","Integers.intCplt","Integers.Succ","Integers.upto","base","pstep","nstep","step","Integers.eight","Integers.seven","Integers.eleven","Integers.ten","Integers.fifteen","Integers.fourteen","Integers.five","Integers.four","Integers.three","Integers.thirteen","Integers.nat_primrec","Integers.nine","Integers.primrec_int_upto","Integers.primrec_nat_upto","Integers.six","Integers.twelve","Integers.two","z","PredicateLogic.All","PredicateLogic.TRUE","PredicateLogic.Let","PredicateLogic.arbitrary","Pure.conjunction","t","u","PredicateLogic.cases_implies","PredicateLogic.cases_conj","PredicateLogic.cases_forall","PredicateLogic.cases_equal","PredicateLogic.cases_false","PredicateLogic.cases_true","t'","e'","P'","Q'","PredicateLogic.default","PredicateLogic.simp_implies","W","psi","theta","Phi","Psi","phi","Pure.prop","Pure.sort_constraint","Pure.type","Pure.term","X","SetTheory.upair","SetTheory.psubset","SetTheory.infinity","Strings.Char","Tuples.setOfPairs","Tuples.prod","Strings.Nibble","Strings.char","Strings.String","Tuples.Seq","Tuples.Append","Tuples.emptySeq","s","Tuples.Len","Tuples.isASeq","Tuples.EnumFuncSet","doms","rngs","Tuples.Id","Tuples.rel_comp","Tuples.Product","Tuples.antisymmetric","Tuples.converse","Tuples.equivalence","Tuples.irreflexive","Tuples.reflexive","Tuples.symmetric","Tuples.transitive","xz","Tuples.rel_domain","yx","Tuples.rel_range","s'","Tuples.rel_image","x'","y'","A'","B'","Zenon.zenon_appseq","xs","Zenon.zenon_seqify","c1x","e1x","c2x","e2x","c3x","e3x","c4x","e4x","c5x","e5x","cs","dcs","e0","l1x","s1x","l2x","s2x","l3x","s3x","l4x","s4x","l5x","s5x","l6x","s6x","l7x","s7x","e1","e2","Zenon.zenon_sa","s1","f2","t1","s2","t2","Zenon.zenon_ss","Y","Aa","Pa"],"types":[[0,0],[0,1,0,0],[0,1,0,1],[0,2],[0,1,3,3],[0,1,3,4],[2,3,0],[0,1,6,0],[0,1,7,0],[0,1,2,2],[0,1,0,9],[0,1,0,2],[0,1,11,2],[0,1,11,12],[0,1,0,13],[0,1,0,3],[0,1,0,11],[0,1,0,16],[0,1,7,6],[0,1,1,0],[0,1,0,19],[0,4,6],[0,1,21,3],[0,1,2,0],[0,1,0,23],[0,1,0,24],[0,1,11,0],[0,1,11,26],[0,1,0,27],[0,1,0,28],[2,5,0],[0,1,30,6],[0,1,31,6],[0,1,30,32],[0,6],[0,1,22,34],[0,1,3,34],[0,1,6,3],[0,1,6,34],[0,1,34,38],[0,1,34,34],[0,1,34,40],[0,1,38,34],[0,1,40,34],[0,1,3,43],[0,1,37,3],[0,1,6,37],[0,1,0,15],[0,1,15,3],[0,1,2,3],[0,1,2,49],[0,1,30,0],[0,1,51,0],[2,7,0],[0,1,53,0],[0,1,54,0],[2,8,0],[0,1,56,0],[0,1,57,0],[2,9,0],[0,1,59,0],[0,1,60,0],[2,10,0],[0,1,62,0],[0,1,63,0],[0,1,5,3],[0,1,5,65],[0,1,6,51],[0,1,6,30],[0,1,68,0],[0,1,69,0],[0,1,4,3],[0,1,30,3],[0,1,72,3],[0,1,6,72],[2,3,1],[0,1,75,0],[0,1,76,0],[2,3,2],[0,1,78,0],[0,1,79,0],[2,5,1],[0,1,81,0],[0,1,82,0],[2,10,1],[0,1,84,0],[0,1,85,0],[2,9,1],[0,1,87,0],[0,1,88,0],[2,8,1],[0,1,90,0],[0,1,91,0],[2,7,1],[0,1,93,0],[0,1,94,0],[0,1,75,3],[0,1,96,3]],"terms":[[0,11,47],[0,12,2],[2,13,0,0],[5,1,2],[2,14,0,0],[5,3,4],[5,0,5],[0,15,11],[5,7,2],[0,16,2],[5,9,4],[0,17,0],[5,10,11],[5,8,12],[5,13,11],[5,6,14],[0,18,11],[2,19,0,0],[5,16,17],[2,20,0,0],[5,18,19],[2,21,0,0],[5,20,21],[5,0,22],[0,22,19],[0,24,2],[3,0],[5,25,26],[0,25,2],[0,26,1],[0,27,20],[0,28,1],[5,31,17],[5,30,32],[0,30,2],[5,34,17],[5,35,26],[5,1,36],[5,34,19],[5,38,26],[5,37,39],[4,29,0,40],[5,33,41],[5,29,42],[5,28,43],[0,31,20],[5,45,32],[0,32,1],[5,47,36],[4,29,0,48],[5,46,49],[5,1,50],[5,51,21],[5,44,52],[5,27,53],[4,23,0,54],[5,24,55],[5,23,56],[0,33,2],[5,58,17],[5,59,19],[5,0,60],[5,27,43],[4,23,0,62],[5,24,63],[5,61,64],[0,34,20],[2,35,0,0],[5,66,67],[2,36,0,1],[5,68,69],[5,0,70],[0,37,2],[0,38,2],[5,69,67],[5,73,74],[5,75,67],[5,72,76],[0,39,1],[5,78,67],[5,45,79],[0,42,2],[3,1],[5,73,82],[5,83,26],[5,81,84],[5,69,82],[5,73,86],[5,69,26],[5,87,88],[5,85,89],[4,41,0,90],[5,80,91],[4,40,0,92],[5,80,93],[5,77,94],[5,71,95],[0,43,5],[0,44,15],[5,98,70],[5,97,99],[0,45,2],[0,46,20],[5,102,67],[5,103,69],[5,69,104],[5,101,105],[5,106,104],[5,98,107],[5,100,108],[2,40,0,0],[5,73,110],[5,111,67],[5,98,112],[5,97,113],[5,69,110],[5,101,115],[5,116,110],[5,98,117],[5,97,118],[5,111,104],[5,98,120],[5,119,121],[5,114,122],[5,100,123],[5,98,76],[5,97,125],[0,47,48],[5,73,26],[5,128,88],[5,98,129],[5,97,130],[5,128,67],[5,98,132],[5,97,133],[2,48,0,0],[5,128,135],[5,98,136],[5,134,137],[5,131,138],[4,40,0,139],[5,127,140],[5,97,141],[5,73,104],[5,143,135],[5,98,144],[5,142,145],[5,126,146],[2,49,0,1],[5,148,67],[5,73,149],[5,150,67],[5,98,151],[5,97,152],[5,73,88],[5,148,26],[5,154,155],[5,98,156],[5,134,157],[4,40,0,158],[5,127,159],[5,97,160],[5,103,148],[5,143,162],[5,98,163],[5,161,164],[5,153,165],[5,143,105],[5,98,167],[5,100,168],[5,73,105],[5,170,104],[5,98,171],[5,100,172],[5,143,67],[5,98,174],[5,111,115],[5,98,176],[5,97,177],[5,114,121],[5,178,179],[5,0,104],[0,50,20],[5,182,79],[4,40,0,129],[5,183,184],[5,29,185],[5,181,186],[0,51,20],[5,188,67],[5,189,69],[5,69,190],[5,101,191],[5,192,190],[5,98,193],[5,100,194],[5,154,26],[5,98,196],[5,97,197],[5,73,135],[5,199,26],[5,98,200],[5,134,201],[5,198,202],[4,40,0,203],[5,127,204],[5,97,205],[5,199,190],[5,98,207],[5,206,208],[5,126,209],[5,73,115],[5,211,110],[5,98,212],[5,97,213],[5,73,190],[5,215,110],[5,98,216],[5,114,217],[5,214,218],[5,119,217],[5,114,220],[5,100,221],[5,189,148],[5,215,223],[5,98,224],[5,161,225],[5,153,226],[5,215,191],[5,98,228],[5,100,229],[5,73,191],[5,231,190],[5,98,232],[5,100,233],[5,215,67],[5,98,235],[5,0,190],[0,52,1],[4,40,0,196],[5,183,239],[5,238,240],[5,237,241],[5,100,125],[2,41,0,0],[5,73,244],[5,245,67],[5,98,246],[5,97,247],[0,53,2],[5,249,110],[5,250,244],[5,69,251],[5,73,252],[5,249,115],[5,69,244],[5,254,255],[5,253,256],[5,98,257],[5,248,258],[5,114,259],[5,100,260],[5,111,244],[5,98,262],[5,97,263],[5,211,255],[5,98,265],[5,248,266],[5,264,267],[5,100,268],[5,211,67],[5,98,270],[5,114,271],[5,100,272],[5,28,115],[5,274,255],[5,73,275],[5,28,110],[5,277,244],[5,69,278],[5,276,279],[5,98,280],[5,248,281],[5,114,282],[5,100,283],[0,54,2],[5,285,110],[5,286,244],[5,0,287],[0,55,2],[5,289,110],[5,290,244],[5,249,291],[0,56,2],[5,293,110],[5,294,244],[5,292,295],[5,288,296],[0,57,20],[5,298,110],[2,14,0,1],[5,299,300],[5,31,301],[5,101,302],[5,303,110],[5,98,304],[0,58,2],[2,36,0,0],[5,25,307],[0,59,2],[5,309,110],[5,310,244],[5,308,311],[5,306,312],[0,60,1],[5,314,307],[5,72,315],[5,31,307],[5,101,317],[5,318,110],[5,72,319],[5,45,110],[5,34,307],[5,322,26],[5,25,323],[5,324,244],[4,23,0,325],[5,321,326],[5,320,327],[5,316,328],[5,313,329],[5,98,330],[0,61,2],[5,332,307],[5,333,135],[5,0,334],[5,249,135],[5,336,317],[5,30,337],[4,23,0,323],[5,338,339],[5,335,340],[5,0,291],[5,182,311],[0,62,2],[5,344,26],[5,31,26],[5,345,346],[4,36,0,347],[5,343,348],[5,342,349],[5,344,307],[5,351,135],[5,0,352],[5,45,337],[5,322,82],[5,101,355],[5,356,323],[5,81,357],[5,101,82],[5,359,26],[5,358,360],[4,63,0,361],[5,354,362],[4,23,0,363],[5,354,364],[5,353,365],[2,63,0,0],[5,25,367],[5,333,317],[5,368,369],[5,98,370],[5,97,371],[0,64,1],[5,373,307],[5,34,374],[5,375,367],[5,322,376],[5,101,377],[5,378,367],[5,98,379],[5,372,380],[5,0,374],[5,298,369],[0,65,20],[5,384,317],[5,101,323],[5,386,82],[4,23,0,387],[5,385,388],[4,63,0,389],[5,383,390],[5,382,391],[5,0,295],[0,66,2],[5,394,26],[5,395,244],[4,36,0,396],[5,343,397],[5,393,398],[5,394,307],[5,400,135],[5,0,401],[5,199,369],[5,402,403],[2,67,0,0],[5,25,405],[5,406,317],[5,98,407],[5,97,408],[0,68,11],[5,410,307],[2,69,0,0],[5,411,412],[5,413,4],[5,34,414],[5,415,405],[5,101,416],[5,101,405],[5,418,412],[5,7,419],[5,420,4],[5,322,405],[5,421,422],[5,417,423],[5,98,424],[5,409,425],[5,308,287],[5,98,427],[5,97,428],[5,98,312],[5,97,430],[5,351,317],[5,98,432],[5,97,433],[5,400,244],[5,98,435],[5,97,436],[2,70,0,0],[5,98,438],[5,437,439],[5,434,440],[5,431,441],[5,97,442],[5,443,439],[5,429,444],[5,437,428],[5,434,446],[5,431,447],[5,308,291],[5,98,449],[5,429,450],[5,308,295],[5,98,452],[5,429,453],[0,71,1],[5,455,352],[5,101,456],[5,457,352],[5,98,458],[5,455,315],[5,101,460],[5,461,315],[5,98,462],[5,455,401],[5,101,464],[5,465,401],[5,98,466],[5,31,414],[5,101,468],[5,469,317],[5,98,470],[5,98,315],[5,97,472],[5,101,414],[5,474,307],[5,101,475],[0,72,2],[5,25,412],[5,478,317],[5,47,479],[5,477,480],[5,322,412],[5,101,482],[5,483,4],[5,481,484],[5,476,485],[5,98,486],[5,473,487],[5,101,412],[5,489,405],[5,98,490],[5,97,491],[2,70,0,1],[5,493,4],[5,98,494],[5,492,495],[5,97,496],[5,47,490],[5,98,498],[5,97,499],[5,493,422],[5,98,501],[5,500,502],[5,97,503],[5,493,416],[5,98,505],[5,504,506],[5,497,507],[5,409,508],[2,73,0,0],[5,310,510],[5,308,511],[5,98,512],[5,97,513],[5,73,510],[5,515,244],[5,98,516],[5,97,517],[5,478,110],[5,98,519],[5,97,520],[5,98,319],[5,97,522],[5,324,510],[4,23,0,524],[5,321,525],[5,98,526],[5,97,527],[5,25,4],[5,529,244],[5,98,530],[5,528,531],[5,523,532],[5,473,533],[5,521,534],[5,97,535],[5,25,414],[5,537,311],[5,98,538],[5,536,539],[5,518,540],[5,514,541],[5,98,327],[5,97,543],[5,544,531],[5,523,545],[5,473,546],[5,521,547],[5,97,548],[5,549,539],[5,431,550],[5,98,480],[5,97,552],[5,98,475],[5,473,554],[5,553,555],[5,0,414],[5,298,317],[5,101,26],[5,559,412],[5,7,560],[5,561,4],[5,562,323],[4,23,0,563],[5,558,564],[5,557,565],[0,74,2],[5,567,307],[2,49,0,0],[5,568,569],[5,31,570],[5,101,571],[5,28,317],[5,31,569],[5,573,574],[5,572,575],[5,98,576],[5,101,307],[5,567,569],[2,75,0,0],[5,579,580],[5,578,581],[5,101,582],[5,28,574],[5,31,580],[5,584,585],[5,318,586],[5,72,587],[5,45,574],[5,34,569],[5,590,26],[5,386,591],[4,23,0,592],[5,589,593],[5,72,594],[0,76,2],[5,596,585],[5,597,574],[5,45,598],[5,34,580],[5,600,26],[5,386,601],[4,23,0,602],[5,599,603],[5,595,604],[5,588,605],[5,583,606],[5,98,607],[5,473,608],[5,101,581],[5,610,307],[5,101,611],[5,101,591],[5,613,323],[4,23,0,614],[5,589,615],[5,72,616],[5,101,601],[5,618,323],[4,23,0,619],[5,599,620],[5,617,621],[5,588,622],[5,612,623],[5,98,624],[5,473,625],[5,25,569],[5,309,244],[2,77,0,0],[5,628,629],[5,627,630],[5,98,631],[5,97,632],[5,25,570],[5,309,278],[5,28,510],[5,636,629],[5,635,637],[5,634,638],[5,98,639],[5,633,640],[5,514,641],[5,314,570],[5,98,643],[2,23,0,0],[5,25,645],[5,646,575],[5,98,647],[5,97,648],[5,34,570],[5,650,645],[5,101,651],[5,646,317],[5,7,653],[5,322,645],[5,654,655],[5,590,645],[5,656,657],[5,652,658],[5,98,659],[5,649,660],[5,0,570],[5,298,575],[5,27,317],[5,7,664],[5,665,323],[5,666,591],[4,23,0,667],[5,663,668],[5,662,669],[5,34,301],[5,671,412],[5,101,672],[5,300,412],[5,673,674],[5,98,675],[5,521,676],[5,101,110],[5,678,244],[5,98,679],[5,97,680],[5,27,244],[5,98,682],[5,97,683],[5,300,26],[5,101,685],[5,686,88],[5,98,687],[5,684,688],[4,23,0,689],[5,127,690],[5,97,691],[4,23,0,685],[5,299,693],[5,101,694],[5,298,244],[4,23,0,88],[5,696,697],[5,695,698],[5,98,699],[5,692,700],[5,681,701],[0,78,19],[2,70,0,2],[5,704,82],[5,705,26],[4,63,0,706],[5,703,707],[4,23,0,708],[5,321,709],[5,98,710],[5,97,711],[5,314,26],[5,72,713],[5,101,346],[5,715,110],[5,72,716],[5,704,26],[5,34,82],[5,719,26],[5,718,720],[4,23,0,721],[5,321,722],[5,717,723],[5,714,724],[4,36,0,725],[5,703,726],[5,98,727],[5,712,728],[5,314,569],[5,98,730],[5,97,731],[5,318,574],[5,98,733],[5,97,734],[5,98,594],[5,97,736],[5,578,569],[5,98,738],[5,737,739],[5,735,740],[5,732,741],[5,473,742],[5,473,741],[5,732,744],[5,101,738],[5,72,733],[5,747,594],[5,746,748],[5,98,749],[5,732,750],[5,473,751],[5,314,301],[5,98,753],[5,431,522],[5,646,110],[5,98,756],[5,97,757],[5,25,655],[5,759,244],[5,98,760],[5,97,761],[5,762,439],[5,523,763],[5,473,764],[5,97,765],[5,766,439],[5,758,767],[5,431,768],[5,544,439],[5,523,770],[5,473,771],[5,97,772],[5,773,439],[5,431,774],[5,101,311],[5,776,11],[5,101,777],[5,678,11],[5,47,779],[5,72,780],[5,101,244],[5,782,11],[5,781,783],[5,778,784],[5,98,785],[5,101,11],[5,787,311],[5,101,788],[5,789,784],[5,98,790],[5,101,574],[5,792,110],[5,98,793],[5,97,794],[5,321,593],[5,98,796],[5,97,797],[5,798,739],[5,795,799],[5,732,800],[5,431,801],[5,431,472],[5,245,510],[5,98,804],[5,97,805],[5,806,513],[5,431,807],[5,758,761],[5,431,809],[5,25,685],[5,811,244],[4,23,0,812],[5,321,813],[5,98,814],[5,97,815],[5,25,694],[5,817,311],[5,98,818],[5,816,819],[5,368,334],[5,98,821],[5,97,822],[5,27,135],[5,98,824],[5,97,825],[5,98,664],[5,97,827],[5,101,367],[5,829,323],[5,98,830],[5,97,831],[5,832,439],[5,828,833],[5,826,834],[4,23,0,835],[5,127,836],[5,97,837],[5,838,439],[5,823,839],[5,101,334],[5,841,11],[5,101,842],[5,101,337],[5,844,11],[5,843,845],[5,98,846],[5,787,334],[5,101,848],[5,849,845],[5,98,850],[2,79,0,0],[5,27,852],[5,306,853],[0,80,20],[5,855,337],[5,359,323],[4,23,0,857],[5,856,858],[5,854,859],[5,98,860],[4,63,0,861],[5,127,862],[5,97,863],[5,841,852],[5,98,865],[5,864,866],[5,646,135],[5,98,868],[5,97,869],[5,98,653],[5,97,871],[5,759,334],[5,98,873],[5,872,874],[5,870,875],[5,829,655],[5,98,877],[5,97,878],[5,879,822],[5,872,880],[5,870,881],[4,23,0,830],[5,856,883],[5,98,884],[5,97,885],[5,886,822],[5,544,430],[5,523,888],[5,473,889],[5,101,312],[5,891,329],[5,98,892],[5,101,821],[5,894,884],[5,98,895],[5,97,450],[5,25,82],[5,898,110],[5,98,899],[5,97,900],[5,27,110],[5,98,902],[5,97,903],[5,98,357],[5,97,905],[5,98,360],[5,906,907],[5,904,908],[5,901,909],[4,63,0,910],[5,127,911],[4,23,0,912],[5,127,913],[5,97,914],[5,915,439],[5,431,916],[5,97,917],[5,918,439],[5,897,919],[5,915,450],[5,431,921],[5,344,569],[5,596,574],[5,924,317],[5,923,925],[5,98,926],[5,97,927],[5,249,369],[5,332,569],[5,930,925],[5,929,931],[5,101,932],[5,933,11],[5,98,934],[5,97,935],[5,344,570],[5,937,571],[5,98,938],[5,936,939],[5,928,940],[5,434,941],[5,101,432],[5,45,317],[5,719,323],[5,101,945],[5,946,26],[4,23,0,947],[5,944,948],[4,49,0,949],[5,703,950],[5,943,951],[5,98,952],[5,333,852],[5,841,954],[5,101,955],[5,249,852],[5,957,317],[5,844,958],[5,956,959],[5,98,960],[5,434,961],[2,81,0,0],[5,25,963],[5,964,317],[5,98,965],[5,97,966],[5,322,963],[5,25,968],[5,969,334],[5,101,970],[5,964,135],[5,971,972],[5,98,973],[5,967,974],[5,434,975],[5,73,334],[5,977,954],[5,101,978],[5,73,337],[5,980,958],[5,979,981],[5,98,982],[5,434,983],[5,375,655],[5,101,985],[5,986,645],[5,98,987],[5,872,988],[5,434,989],[5,101,655],[5,322,367],[5,991,992],[5,98,993],[5,97,994],[5,98,352],[5,97,996],[5,368,135],[5,98,998],[5,97,999],[5,368,317],[5,98,1001],[5,97,1002],[5,101,645],[5,1004,367],[5,98,1005],[5,1003,1006],[5,1000,1007],[5,872,1008],[5,870,1009],[5,997,1010],[5,995,1011],[5,898,135],[5,98,1013],[5,97,1014],[5,898,317],[5,98,1016],[5,97,1017],[5,828,908],[5,826,1019],[5,1018,1020],[5,1015,1021],[4,63,0,1022],[5,127,1023],[4,23,0,1024],[5,127,1025],[5,97,1026],[5,1027,439],[5,97,1028],[5,1029,439],[5,997,1030],[5,351,11],[5,98,1032],[5,596,135],[5,9,412],[5,1035,11],[5,1034,1036],[5,351,1037],[5,98,1038],[5,97,1039],[5,81,479],[5,249,317],[5,1042,135],[5,596,1043],[5,1044,1036],[5,45,1045],[5,386,4],[5,47,1047],[4,23,0,1048],[5,1046,1049],[5,1041,1050],[5,98,1051],[5,97,1052],[5,344,414],[5,1054,135],[5,98,1055],[5,1053,1056],[5,473,1057],[5,1040,1058],[5,1034,317],[5,923,1060],[5,98,1061],[5,97,1062],[5,249,334],[5,930,1060],[5,1064,1065],[5,101,1066],[5,1067,11],[5,98,1068],[5,97,1069],[5,937,135],[5,98,1071],[5,1070,1072],[5,1063,1073],[5,997,1074],[5,1027,996],[5,646,337],[5,98,1077],[5,97,1078],[5,368,337],[5,98,1080],[5,97,1081],[5,101,993],[5,1083,1005],[5,98,1084],[5,1082,1085],[5,1079,1086],[5,997,1087],[5,73,852],[5,1089,135],[5,98,1090],[5,97,1091],[2,82,0,0],[5,73,1093],[5,1094,135],[5,98,1095],[5,97,1096],[5,957,1093],[5,333,1098],[5,101,1099],[5,249,954],[5,333,1093],[5,1101,1102],[5,1100,1103],[5,98,1104],[5,1097,1105],[5,1092,1106],[5,997,1107],[5,596,852],[5,1109,1093],[5,333,1110],[5,101,1111],[5,596,954],[5,1113,1102],[5,1112,1114],[5,98,1115],[5,1097,1116],[5,1092,1117],[5,997,1118],[0,83,1],[5,1120,352],[5,98,1121],[5,1034,852],[5,351,1123],[5,98,1124],[5,997,1125],[5,9,645],[5,1127,11],[5,351,1128],[5,98,1129],[5,351,852],[5,98,1131],[5,1092,1132],[5,997,1133],[5,25,374],[5,285,244],[5,1136,110],[5,1135,1137],[5,98,1138],[5,429,1139],[5,31,374],[5,101,1141],[5,1142,369],[5,98,1143],[5,309,369],[5,1145,317],[5,1135,1146],[5,98,1147],[5,25,376],[5,1149,317],[5,98,1150],[5,372,1151],[5,344,374],[5,1153,1141],[5,98,1154],[5,314,374],[5,98,1156],[5,394,374],[5,1158,317],[5,98,1159],[5,434,1160],[5,590,323],[5,101,1162],[5,1163,26],[5,98,1164],[5,828,1165],[5,826,1166],[4,23,0,1167],[5,127,1168],[5,97,1169],[5,1170,996],[5,309,82],[5,1172,26],[5,308,1173],[4,41,0,1174],[5,703,1175],[4,40,0,1176],[5,703,1177],[5,98,1178],[5,473,1179],[5,0,315],[5,558,339],[5,578,1182],[5,1181,1183],[5,1120,315],[5,98,1185],[0,84,2],[2,85,0,0],[5,1187,1188],[5,1189,4],[5,31,1190],[5,101,1191],[5,9,1188],[5,1193,11],[5,1192,1194],[5,98,1195],[5,318,1194],[5,98,1197],[5,97,1198],[5,322,1188],[5,101,1200],[5,1201,4],[5,98,1202],[5,97,1203],[5,101,1190],[5,1205,307],[5,98,1206],[5,1204,1207],[5,1199,1208],[5,473,1209],[5,578,1190],[5,98,1211],[5,1204,1212],[5,1199,1213],[5,473,1214],[5,101,1211],[5,72,1197],[5,1217,1202],[5,1216,1218],[5,98,1219],[5,473,1220],[5,101,1206],[5,1222,1218],[5,98,1223],[5,473,1224],[5,25,1190],[5,309,1194],[5,1227,12],[5,1226,1228],[5,98,1229],[5,314,1190],[5,98,1231],[5,34,1190],[5,1233,1188],[5,101,1234],[5,1235,4],[5,98,1236],[5,0,1190],[5,298,1194],[4,23,0,4],[5,1239,1240],[5,1238,1241],[5,855,317],[5,1243,883],[5,98,1244],[5,97,1245],[5,1246,371],[5,97,453],[5,45,244],[5,855,110],[5,1250,858],[4,63,0,1251],[5,1249,1252],[5,98,1253],[5,97,1254],[5,1255,439],[5,431,1256],[5,97,1257],[5,1258,439],[5,1248,1259],[5,1248,430],[5,98,1251],[5,684,1262],[4,63,0,1263],[5,127,1264],[5,97,1265],[5,1266,453],[5,431,1267],[5,101,369],[5,1269,244],[5,98,1270],[5,1248,1271],[5,368,244],[5,98,1273],[5,97,1274],[5,1250,883],[5,98,1276],[5,1275,1277],[5,1248,1278],[5,98,401],[5,97,1280],[5,1000,1245],[5,1281,1282],[2,86,0,0],[5,98,1284],[5,832,1285],[5,828,1286],[4,23,0,1287],[5,127,1288],[5,97,1289],[5,1290,1285],[5,1000,1291],[5,1281,1292],[5,1243,858],[5,98,1294],[5,826,1295],[4,63,0,1296],[5,127,1297],[5,97,1298],[5,1299,1280],[5,1120,401],[5,98,1301],[5,400,369],[5,98,1303],[5,400,852],[5,98,1305],[5,1092,1306],[5,1281,1307],[0,87,2],[2,88,0,0],[5,1309,1310],[2,89,0,0],[5,1311,1312],[5,98,1313],[5,97,1314],[5,25,1312],[0,90,0],[5,1316,1317],[5,98,1318],[5,97,1319],[5,25,1310],[5,1321,1317],[5,98,1322],[5,97,1323],[2,91,0,0],[5,25,1325],[5,1326,1317],[5,98,1327],[5,97,1328],[0,92,0],[5,34,1330],[5,1331,1312],[5,25,1332],[0,93,2],[5,1334,1310],[5,1331,1325],[5,1335,1336],[5,1333,1337],[5,101,1338],[5,1335,1325],[5,1316,1340],[5,1339,1341],[5,98,1342],[5,1329,1343],[5,1324,1344],[5,1320,1345],[5,1315,1346],[2,29,0,0],[5,25,1348],[5,1349,1317],[5,98,1350],[5,97,1351],[2,94,0,0],[5,25,1353],[5,1354,1317],[5,98,1355],[5,97,1356],[5,1331,1348],[5,25,1358],[5,1331,1353],[5,1334,1360],[5,1361,1332],[5,1359,1362],[5,101,1363],[5,1334,1353],[5,1365,1312],[5,1349,1366],[5,1364,1367],[5,98,1368],[5,1320,1369],[5,1357,1370],[5,1352,1371],[5,964,1317],[5,98,1373],[5,97,1374],[0,95,2],[5,1376,963],[0,96,0],[5,1377,1378],[5,101,1379],[5,1380,963],[5,98,1381],[5,1375,1382],[2,97,0,0],[5,25,1384],[5,1385,1317],[5,98,1386],[5,97,1387],[2,98,0,0],[5,25,1389],[5,1390,1317],[5,98,1391],[5,97,1392],[5,1376,1384],[5,1394,1389],[5,1377,1395],[5,101,1396],[5,1377,1384],[5,1376,1398],[5,1399,1389],[5,1397,1400],[5,98,1401],[5,1393,1402],[5,1388,1403],[5,1375,1404],[5,101,1398],[5,1394,963],[5,1406,1407],[5,98,1408],[5,1388,1409],[5,1375,1410],[5,1377,1389],[5,1394,1412],[5,1397,1413],[5,98,1414],[5,1393,1415],[5,1388,1416],[5,1375,1417],[0,99,1],[5,1419,1412],[5,1399,1420],[5,101,1421],[5,1419,1389],[5,1394,1423],[5,1422,1424],[5,98,1425],[5,1393,1426],[5,1388,1427],[5,1375,1428],[5,1376,1389],[5,1430,1384],[5,1419,1431],[5,1399,1432],[5,101,1433],[5,1377,1423],[5,1434,1435],[5,98,1436],[5,1393,1437],[5,1388,1438],[5,1375,1439],[5,1419,963],[5,1399,1441],[5,101,1442],[5,1443,1384],[5,98,1444],[5,1388,1445],[5,1375,1446],[5,1419,1384],[5,1399,1448],[5,101,1449],[5,1450,963],[5,98,1451],[5,1388,1452],[5,1375,1453],[5,1406,963],[5,101,1455],[5,101,1384],[5,1457,1378],[5,1456,1458],[5,98,1459],[5,1388,1460],[5,1375,1461],[5,101,963],[5,1463,1398],[5,101,1464],[5,1465,1458],[5,98,1466],[5,1388,1467],[5,1375,1468],[5,101,1407],[5,1470,963],[5,101,1471],[5,1472,1458],[5,98,1473],[5,1388,1474],[5,1375,1475],[5,1463,1407],[5,101,1477],[5,1478,1458],[5,98,1479],[5,1388,1480],[5,1375,1481],[5,1309,1378],[5,1483,1310],[5,98,1484],[5,97,1485],[5,1483,1325],[5,98,1487],[5,97,1488],[5,1331,1378],[5,1309,1490],[5,1376,1310],[5,1492,1325],[5,1491,1493],[5,101,1494],[5,1491,1310],[5,477,1496],[5,1491,1325],[5,1497,1498],[5,1495,1499],[5,98,1500],[5,1489,1501],[5,1329,1502],[5,1486,1503],[5,1324,1504],[0,100,0],[5,1321,1506],[5,98,1507],[5,97,1508],[5,1326,1506],[5,98,1510],[5,97,1511],[5,101,1493],[5,1513,1378],[5,101,1514],[5,101,1310],[5,1516,1378],[5,72,1517],[5,101,1325],[5,1519,1378],[5,1518,1520],[5,1515,1521],[5,98,1522],[5,1512,1523],[5,1509,1524],[5,1513,1490],[5,101,1526],[5,1516,1490],[5,72,1528],[5,1529,1520],[5,477,1530],[5,1519,1490],[5,1518,1532],[5,1531,1533],[5,1527,1534],[5,98,1535],[5,1512,1536],[5,1509,1537],[5,1406,1412],[5,101,1539],[5,1457,1389],[5,1540,1541],[5,98,1542],[5,1393,1543],[5,1388,1544],[5,1375,1545],[5,1406,1389],[5,101,1547],[5,1430,1448],[5,1463,1549],[5,1548,1550],[5,98,1551],[5,1393,1552],[5,1388,1553],[5,1375,1554],[5,1309,1398],[5,1556,1389],[5,101,1557],[5,1309,963],[5,1559,1549],[5,1558,1560],[5,98,1561],[5,1393,1562],[5,1388,1563],[5,1375,1564],[5,1309,1384],[5,1430,1441],[5,1566,1567],[5,1558,1568],[5,98,1569],[5,1393,1570],[5,1388,1571],[5,1375,1572],[5,1559,1384],[5,98,1574],[5,97,1575],[5,1430,963],[5,1309,1577],[5,1578,1431],[5,98,1579],[5,1576,1580],[5,1393,1581],[5,1388,1582],[5,1375,1583],[5,25,1188],[5,1585,1317],[5,98,1586],[5,97,1587],[0,101,2],[5,1589,1389],[5,1590,1188],[5,98,1591],[5,97,1592],[5,1589,1412],[5,1394,1188],[5,1594,1595],[5,98,1596],[5,1593,1597],[5,1576,1598],[5,1588,1599],[5,1393,1600],[5,1388,1601],[5,1375,1602],[5,1309,1389],[5,1604,1188],[5,98,1605],[5,97,1606],[5,1309,1412],[5,1608,1595],[5,98,1609],[5,1607,1610],[5,1576,1611],[5,1588,1612],[5,1393,1613],[5,1388,1614],[5,1375,1615],[5,1608,1395],[5,98,1617],[5,1576,1618],[5,1393,1619],[5,1388,1620],[5,1375,1621],[5,1376,1312],[5,1623,1348],[5,1589,1624],[5,1625,1353],[5,98,1626],[5,97,1627],[5,1483,1312],[5,98,1629],[5,97,1630],[5,1589,1348],[5,1632,1353],[5,98,1633],[5,1631,1634],[5,1320,1635],[5,1357,1636],[5,1352,1637],[5,1628,1638],[5,1589,963],[5,1640,1384],[5,98,1641],[5,97,1642],[5,1589,1577],[5,1644,1431],[5,98,1645],[5,1643,1646],[5,1393,1647],[5,1388,1648],[5,1375,1649],[5,1607,1597],[5,1643,1651],[5,1588,1652],[5,1393,1653],[5,1388,1654],[5,1375,1655],[5,1643,1598],[5,1588,1657],[5,1393,1658],[5,1388,1659],[5,1375,1660],[5,1594,1395],[5,98,1662],[5,1643,1663],[5,1393,1664],[5,1388,1665],[5,1375,1666],[5,1377,1312],[5,1309,1668],[5,1669,1384],[5,98,1670],[5,97,1671],[5,1631,1575],[5,1320,1673],[5,1388,1674],[5,1375,1675],[5,1672,1676],[5,1623,963],[5,1309,1678],[5,1679,1384],[5,98,1680],[5,97,1681],[5,1682,1676],[5,1376,1348],[5,1684,1312],[5,1589,1685],[5,1686,1353],[5,98,1687],[5,97,1688],[5,1689,1638],[0,102,0],[5,34,1691],[5,1692,1668],[5,1309,1693],[5,1694,1384],[5,98,1695],[5,97,1696],[5,1692,963],[5,1309,1698],[5,1699,1384],[5,98,1700],[5,1631,1701],[5,1320,1702],[5,1388,1703],[5,1375,1704],[5,1697,1705],[5,1692,1678],[5,1309,1707],[5,1708,1384],[5,98,1709],[5,97,1710],[5,1711,1705],[5,1376,1698],[5,1713,1384],[5,101,1714],[5,1692,1398],[5,1715,1716],[5,98,1717],[5,1388,1718],[5,1375,1719],[5,1470,1577],[5,101,1721],[5,1722,1541],[5,98,1723],[5,1393,1724],[5,1388,1725],[5,1375,1726],[5,101,1400],[5,1376,1412],[5,1729,1384],[5,1728,1730],[5,98,1731],[5,1393,1732],[5,1388,1733],[5,1375,1734],[5,1463,1395],[5,101,1736],[5,101,1389],[5,1377,1448],[5,1738,1739],[5,1737,1740],[5,98,1741],[5,1393,1742],[5,1388,1743],[5,1375,1744],[5,1331,963],[5,1376,1746],[5,1747,1384],[5,101,1748],[5,1331,1398],[5,1749,1750],[5,98,1751],[5,1388,1752],[5,1375,1753],[0,103,2],[5,1755,963],[5,1756,1395],[5,101,1757],[5,1756,1384],[5,1376,1759],[5,1756,1389],[5,1760,1761],[5,1758,1762],[5,98,1763],[5,1393,1764],[5,1388,1765],[5,1375,1766],[5,1755,1395],[5,1768,963],[5,101,1769],[5,1755,1384],[5,1771,963],[5,1376,1772],[5,1755,1389],[5,1774,963],[5,1773,1775],[5,1770,1776],[5,98,1777],[5,1393,1778],[5,1388,1779],[5,1375,1780],[5,1419,1698],[5,1376,1782],[5,1783,1384],[5,101,1784],[5,1376,1441],[5,1786,1384],[5,1331,1787],[5,1785,1788],[5,98,1789],[5,1388,1790],[5,1375,1791],[5,1419,1746],[5,1376,1793],[5,1794,1384],[5,101,1795],[5,1692,1787],[5,1796,1797],[5,98,1798],[5,1388,1799],[5,1375,1800],[5,25,1493],[5,1802,1506],[5,98,1803],[5,1512,1804],[5,1509,1805],[5,25,1398],[5,1807,1317],[5,98,1808],[5,1388,1809],[5,1375,1810],[5,1376,1378],[5,1812,963],[5,101,1813],[5,1814,963],[5,98,1815],[5,1375,1816],[5,0,1398],[0,104,1],[5,1819,963],[5,34,1820],[5,1821,1384],[5,1818,1822],[5,1388,1823],[5,1375,1824],[5,1692,1384],[5,1377,1826],[5,101,1827],[5,1828,1716],[5,98,1829],[5,1388,1830],[5,1375,1831],[5,1331,1384],[5,1377,1833],[5,101,1834],[5,1835,1750],[5,98,1836],[5,1388,1837],[5,1375,1838],[5,1786,963],[5,101,1840],[5,1841,1378],[5,98,1842],[5,1375,1843],[5,455,1574],[5,101,1845],[5,1846,1574],[5,98,1847],[5,1388,1848],[5,1375,1849],[5,455,1641],[5,101,1851],[5,1852,1641],[5,98,1853],[5,101,1739],[5,1855,1378],[5,101,1856],[5,1463,1384],[5,1857,1858],[5,98,1859],[5,1388,1860],[5,1375,1861],[5,101,1787],[5,1863,1378],[5,101,1864],[5,1865,1858],[5,98,1866],[5,1388,1867],[5,1375,1868],[5,101,1378],[5,1870,1739],[5,101,1871],[5,1872,1858],[5,98,1873],[5,1388,1874],[5,1375,1875],[5,1870,1787],[5,101,1877],[5,1878,1858],[5,98,1879],[5,1388,1880],[5,1375,1881],[5,1376,1739],[5,1883,1384],[5,101,1884],[5,1885,963],[5,98,1886],[5,1388,1887],[5,1375,1888],[5,1376,1787],[5,1890,963],[5,101,1891],[5,1892,1384],[5,98,1893],[5,1388,1894],[5,1375,1895],[5,1883,1423],[5,101,1897],[5,1419,1395],[5,1377,1899],[5,1898,1900],[5,98,1901],[5,1393,1902],[5,1388,1903],[5,1375,1904],[5,1419,1325],[5,1684,1906],[5,1309,1907],[5,1908,1348],[5,98,1909],[5,1489,1910],[5,1329,1911],[5,1352,1912],[5,1376,1906],[5,1914,1348],[5,1309,1915],[5,1916,1348],[5,98,1917],[5,1489,1918],[5,1329,1919],[5,1352,1920],[5,98,1858],[5,97,1922],[5,1566,963],[5,98,1924],[5,97,1925],[5,1926,439],[5,1576,1927],[5,97,1928],[5,1929,439],[5,1923,1930],[5,1388,1931],[5,1375,1932],[5,1516,1325],[5,98,1934],[5,97,1935],[5,1309,1325],[5,1937,2],[5,98,1938],[5,97,1939],[5,1311,2],[5,98,1941],[5,1940,1942],[5,1936,1943],[5,1589,1325],[5,1945,2],[5,98,1946],[5,97,1947],[5,1589,1310],[5,1949,2],[5,98,1950],[5,1948,1951],[5,1936,1952],[5,1589,1353],[5,1954,1348],[5,98,1955],[5,97,1956],[5,1334,1348],[5,1958,1353],[5,1316,1959],[5,98,1960],[5,97,1961],[5,1357,439],[5,1352,1963],[5,1962,1964],[5,1957,1965],[5,1684,1353],[5,1309,1967],[5,1968,1685],[5,101,1969],[5,1309,1353],[5,1971,1312],[5,1970,1972],[5,98,1973],[5,1320,1974],[5,1357,1975],[5,1352,1976],[5,1589,1967],[5,1978,1685],[5,101,1979],[5,1954,1312],[5,1980,1981],[5,98,1982],[5,1320,1983],[5,1357,1984],[5,1352,1985],[5,1692,1967],[5,1309,1987],[5,1988,1685],[5,101,1989],[5,1692,1353],[5,1309,1991],[5,1992,1312],[5,1990,1993],[5,98,1994],[5,1320,1995],[5,1357,1996],[5,1352,1997],[5,1331,1967],[5,1309,1999],[5,2000,1685],[5,101,2001],[5,1309,1360],[5,2003,1312],[5,2002,2004],[5,98,2005],[5,1320,2006],[5,1357,2007],[5,1352,2008],[5,1376,1353],[5,2010,1348],[5,1309,2011],[5,2012,1624],[5,101,2013],[5,2014,1972],[5,98,2015],[5,1320,2016],[5,1357,2017],[5,1352,2018],[5,1589,2011],[5,2020,1624],[5,101,2021],[5,2022,1981],[5,98,2023],[5,1320,2024],[5,1357,2025],[5,1352,2026],[5,1692,2011],[5,1309,2028],[5,2029,1624],[5,101,2030],[5,2031,1993],[5,98,2032],[5,1320,2033],[5,1357,2034],[5,1352,2035],[5,1331,2011],[5,1309,2037],[5,2038,1624],[5,101,2039],[5,2040,2004],[5,98,2041],[5,1320,2042],[5,1357,2043],[5,1352,2044],[5,47,1641],[5,98,2046],[5,97,2047],[5,101,1574],[5,2049,1858],[5,98,2050],[5,1388,2051],[5,1375,2052],[5,2048,2053],[5,101,2046],[5,1457,963],[5,2055,2056],[5,98,2057],[5,1388,2058],[5,1375,2059],[5,1576,2060],[5,1589,1384],[5,2062,963],[5,47,2063],[5,101,2064],[5,2065,1858],[5,98,2066],[5,1388,2067],[5,1375,2068],[5,2048,2069],[5,1394,1441],[5,1483,2071],[5,98,2072],[5,97,2073],[5,2074,439],[5,97,2075],[5,2076,439],[5,1388,2077],[5,1375,2078],[5,1576,2079],[5,2074,1575],[5,1388,2081],[5,1375,2082],[5,1388,1922],[5,1375,2084],[5,1926,2085],[5,1576,2086],[5,1576,439],[5,97,2088],[5,47,2056],[5,98,2090],[5,97,2091],[5,2092,439],[5,1926,2093],[5,97,2094],[5,2095,439],[5,2089,2096],[5,1388,2097],[5,1375,2098],[5,0,1574],[5,25,2071],[5,2101,1506],[5,2100,2102],[5,1388,2103],[5,1375,2104],[5,1309,1348],[5,2106,1353],[5,101,2107],[5,855,1506],[5,101,1353],[5,1684,26],[5,2110,2111],[4,89,0,2112],[5,2109,2113],[5,2108,2114],[5,98,2115],[5,1357,2116],[5,1352,2117],[5,2049,2072],[5,98,2119],[5,1388,2120],[5,1375,2121],[5,98,2107],[5,97,2123],[5,98,2114],[5,2124,2125],[5,1357,2126],[5,1352,2127],[5,493,1378],[5,98,2129],[5,97,2130],[5,45,1506],[5,45,1317],[5,1419,82],[5,1309,2134],[5,2135,26],[5,72,2136],[5,1309,26],[5,2138,82],[5,2137,2139],[5,81,2140],[5,493,26],[5,2141,2142],[4,29,0,2143],[5,2133,2144],[5,81,2145],[5,1331,26],[5,493,2147],[5,72,2148],[5,1419,2147],[5,493,2150],[5,2149,2151],[5,2146,2152],[4,91,0,2153],[5,2132,2154],[5,98,2155],[5,97,2156],[4,81,0,2142],[5,2133,2158],[5,98,2159],[5,2157,2160],[5,2131,2161],[5,27,1506],[5,98,2163],[5,97,2164],[5,98,2145],[5,97,2166],[5,98,2148],[5,2167,2168],[5,2165,2169],[4,91,0,2170],[5,127,2171],[5,97,2172],[5,98,2151],[5,2167,2174],[5,2165,2175],[4,91,0,2176],[5,127,2177],[5,97,2178],[5,493,963],[5,98,2180],[5,2179,2181],[5,2173,2182],[5,2131,2183],[5,1375,2184],[5,1640,1833],[5,2049,2186],[5,98,2187],[5,1388,2188],[5,1375,2189],[5,1589,1698],[5,2191,1384],[5,2049,2192],[5,98,2193],[5,1388,2194],[5,1375,2195],[5,477,1641],[5,2197,1858],[5,2049,2198],[5,98,2199],[5,1388,2200],[5,1375,2201],[5,1643,439],[5,97,2203],[5,1923,439],[5,97,2205],[5,2206,439],[5,2204,2207],[5,1388,2208],[5,1375,2209],[5,1576,2210],[5,477,1574],[5,2212,2063],[5,98,2213],[5,1388,2214],[5,1375,2215],[5,2062,1389],[5,98,2217],[5,97,2218],[5,1640,1389],[5,98,2220],[5,1393,2221],[5,1388,2222],[5,1375,2223],[5,2219,2224],[5,1576,2225],[5,1309,1746],[5,2227,1384],[5,47,2228],[5,98,2229],[5,97,2230],[5,2231,2085],[5,1576,2232],[5,1559,1826],[5,47,2234],[5,98,2235],[5,97,2236],[5,2237,2085],[5,1576,2238],[5,2212,1924],[5,98,2240],[5,1388,2241],[5,1375,2242],[5,101,2063],[0,105,0],[5,2244,2245],[5,98,2246],[5,1388,2247],[5,1375,2248],[5,1576,2249],[5,98,2234],[5,97,2251],[5,2204,439],[5,1388,2253],[5,1375,2254],[5,2252,2255],[5,1643,2251],[5,1388,2257],[5,1375,2258],[5,101,2234],[5,2260,1641],[5,98,2261],[5,1388,2262],[5,1375,2263],[5,2260,2228],[5,98,2265],[5,1388,2266],[5,1375,2267],[5,1559,963],[5,98,2269],[5,1375,2270],[5,1559,1746],[5,98,2272],[5,1375,2273],[5,1559,1833],[5,98,2275],[5,97,2276],[5,1463,1833],[5,98,2278],[5,97,2279],[5,2280,439],[5,97,2281],[5,2282,439],[5,2089,2283],[5,1388,2284],[5,1375,2285],[5,2277,2286],[5,1388,2276],[5,1375,2288],[5,1576,2289],[5,101,2275],[5,2212,2278],[5,2291,2292],[5,98,2293],[5,1388,2294],[5,1375,2295],[5,1566,1389],[5,98,2297],[5,97,2298],[5,1559,1389],[5,98,2300],[5,1393,2301],[5,1388,2302],[5,1375,2303],[5,2299,2304],[5,1576,2305],[5,1309,1441],[5,2307,1448],[5,101,2308],[5,2309,1924],[5,98,2310],[5,1388,2311],[5,1375,2312],[5,1419,1833],[5,1559,2314],[5,101,2315],[5,1640,1448],[5,2316,2317],[5,98,2318],[5,1388,2319],[5,1375,2320],[5,1589,1378],[5,2322,2071],[5,98,2323],[5,97,2324],[5,2325,439],[5,97,2326],[5,2327,439],[5,1388,2328],[5,1375,2329],[5,1643,2330],[5,2325,1642],[5,1388,2332],[5,1375,2333],[5,98,2064],[5,97,2335],[5,2062,1746],[5,98,2337],[5,97,2338],[5,2339,1922],[5,2336,2340],[5,1388,2341],[5,1375,2342],[5,1643,2249],[5,47,438],[5,98,2345],[5,97,2346],[5,98,2063],[5,2347,2348],[5,97,2349],[5,2350,439],[5,1388,2351],[5,1375,2352],[5,1643,2353],[5,97,2348],[5,2355,439],[5,97,2356],[5,2357,439],[5,2206,2358],[5,2204,2359],[5,1388,2360],[5,1375,2361],[5,101,1633],[5,1331,2111],[5,2110,2364],[4,89,0,2365],[5,2109,2366],[5,2363,2367],[5,98,2368],[5,1357,2369],[5,1352,2370],[5,101,1641],[5,2372,2323],[5,98,2373],[5,1388,2374],[5,1375,2375],[5,97,1634],[5,98,2367],[5,1357,2378],[5,1352,2379],[5,2377,2380],[5,72,1574],[5,47,1924],[5,2382,2383],[5,2372,2384],[5,98,2385],[5,1388,2386],[5,1375,2387],[5,2299,2224],[5,1643,2389],[5,477,1858],[5,2391,2063],[5,2197,2392],[5,98,2393],[5,1388,2394],[5,1375,2395],[5,25,88],[5,2397,1317],[4,81,0,2398],[5,2133,2399],[5,98,2400],[5,97,2401],[5,898,1317],[5,98,2403],[5,97,2404],[5,27,1317],[5,98,2406],[5,97,2407],[5,1589,82],[5,2409,26],[5,98,2410],[5,97,2411],[5,1589,86],[5,2413,88],[5,98,2414],[5,2412,2415],[5,2408,2416],[5,2405,2417],[4,94,0,2418],[5,127,2419],[4,29,0,2420],[5,127,2421],[5,97,2422],[5,69,1348],[5,1309,2424],[5,69,1353],[5,2425,2426],[5,98,2427],[5,2423,2428],[5,2402,2429],[5,1357,2430],[5,1352,2431],[5,2124,2432],[5,101,1924],[5,2434,2245],[5,98,2435],[5,1388,2436],[5,1375,2437],[5,1643,2438],[5,1640,1826],[5,101,2440],[5,1589,1746],[5,2442,1384],[5,2441,2443],[5,98,2444],[5,1388,2445],[5,1375,2446],[5,101,2186],[5,2448,1574],[5,98,2449],[5,1388,2450],[5,1375,2451],[5,98,2186],[5,97,2453],[5,2454,2210],[5,1640,1746],[5,98,2456],[5,1375,2457],[5,1643,2225],[5,1589,1441],[5,2460,1448],[5,101,2461],[5,2462,2063],[5,98,2463],[5,1388,2464],[5,1375,2465],[5,101,1858],[5,2467,2245],[5,101,2468],[5,2197,2063],[5,2469,2470],[5,98,2471],[5,1388,2472],[5,1375,2473],[5,47,1858],[5,98,2475],[5,97,2476],[5,2204,2358],[5,1388,2478],[5,1375,2479],[5,2477,2480],[5,1559,1698],[5,101,2482],[5,2483,2245],[5,98,2484],[5,1375,2485],[5,2227,963],[5,101,2487],[5,2488,2245],[5,98,2489],[5,1375,2490],[5,1699,963],[5,98,2492],[5,1375,2493],[5,97,1701],[5,2495,2286],[5,1388,1701],[5,1375,2497],[5,1576,2498],[5,101,1700],[5,2500,2292],[5,98,2501],[5,1388,2502],[5,1375,2503],[5,2500,2275],[5,98,2505],[5,1388,2506],[5,1375,2507],[5,1699,1826],[5,101,2509],[5,2510,1574],[5,98,2511],[5,1388,2512],[5,1375,2513],[5,98,2509],[5,1576,2515],[5,1388,2516],[5,1375,2517],[5,101,2192],[5,2519,1574],[5,98,2520],[5,1388,2521],[5,1375,2522],[5,2519,2186],[5,98,2524],[5,1388,2525],[5,1375,2526],[5,2191,1826],[5,101,2528],[5,2529,1641],[5,98,2530],[5,1388,2531],[5,1375,2532],[5,98,2528],[5,97,2534],[5,2535,2255],[5,1643,2534],[5,1388,2537],[5,1375,2538],[5,2191,963],[5,98,2540],[5,1375,2541],[5,98,2228],[5,97,2543],[5,2544,2255],[5,1643,2543],[5,1388,2546],[5,1375,2547],[5,101,2228],[5,2549,1641],[5,98,2550],[5,1388,2551],[5,1375,2552],[5,97,2515],[5,2089,439],[5,1388,2555],[5,1375,2556],[5,2554,2557],[5,2227,1833],[5,101,2559],[5,2560,1574],[5,98,2561],[5,1388,2562],[5,1375,2563],[5,98,2559],[5,97,2565],[5,2566,2557],[5,1576,2565],[5,1388,2568],[5,1375,2569],[5,101,1746],[5,2571,1384],[5,47,2572],[5,98,2573],[5,97,2574],[5,98,2443],[5,2575,2576],[5,1643,2577],[5,1388,2578],[5,1375,2579],[5,2442,1833],[5,101,2581],[5,2582,1641],[5,98,2583],[5,1388,2584],[5,1375,2585],[5,98,2581],[5,97,2587],[5,2588,2255],[5,1643,2587],[5,1388,2590],[5,1375,2591],[5,1309,1782],[5,2593,1384],[5,101,2594],[5,2460,1384],[5,2595,2596],[5,98,2597],[5,1388,2598],[5,1375,2599],[5,2460,1378],[5,101,2601],[5,2322,963],[5,2602,2603],[5,98,2604],[5,1375,2605],[5,2322,1441],[5,101,2607],[5,1640,1378],[5,2608,2609],[5,98,2610],[5,1375,2611],[5,2106,1312],[5,98,2613],[5,97,2614],[5,1309,1312],[5,2616,1353],[5,98,2617],[5,97,2618],[5,2619,439],[5,2615,2620],[5,1320,2621],[5,97,2622],[5,2623,439],[5,1962,2624],[5,101,1959],[5,2626,11],[5,101,2627],[5,2628,1955],[5,98,2629],[5,1357,2630],[5,1352,2631],[2,106,0,0],[5,25,2633],[5,2634,1317],[5,98,2635],[5,97,2636],[5,1334,1312],[5,2638,2633],[5,2626,2639],[5,101,2640],[5,72,1955],[5,1589,2633],[5,2643,1312],[5,2642,2644],[5,477,2645],[5,101,1348],[5,2647,1312],[5,72,2648],[5,2110,2633],[5,2649,2650],[5,2646,2651],[5,2641,2652],[5,98,2653],[5,2637,2654],[5,1320,2655],[5,1357,2656],[5,1352,2657],[5,2619,1961],[5,2615,2659],[5,1320,2660],[5,101,1960],[5,72,1318],[5,72,2613],[5,2664,2617],[5,2663,2665],[5,2662,2666],[5,98,2667],[5,98,2627],[5,1957,2669],[5,1357,2670],[5,1352,2671],[5,1958,1348],[5,101,2673],[5,9,1348],[5,2675,11],[5,2674,2676],[5,98,2677],[5,1352,2678],[5,2106,1360],[5,98,2680],[5,97,2681],[5,1958,1360],[5,101,2683],[5,28,1959],[5,9,1360],[5,2686,11],[5,2685,2687],[5,2684,2688],[5,98,2689],[5,2682,2690],[5,1357,2691],[5,1352,2692],[5,0,1959],[5,182,1317],[5,2106,26],[5,72,2696],[5,2138,1353],[5,2697,2698],[4,89,0,2699],[5,2695,2700],[5,2694,2701],[5,1483,963],[5,98,2703],[5,97,2704],[5,1566,1407],[5,98,2706],[5,1388,2707],[5,2705,2708],[5,1375,2709],[5,1566,1398],[5,98,2711],[5,1388,2712],[5,2705,2713],[5,1375,2714],[5,1968,1348],[5,101,2716],[5,1971,1378],[5,2717,2718],[5,98,2719],[5,1357,2720],[5,1352,2721],[5,2012,1348],[5,101,2723],[5,2724,2718],[5,98,2725],[5,1357,2726],[5,1352,2727],[5,1311,1325],[5,98,2729],[5,97,2730],[5,1519,2],[5,98,2732],[5,97,2733],[5,2734,1942],[5,2731,2735],[5,1120,1574],[5,98,2737],[5,1388,2738],[5,1375,2739],[5,101,2475],[5,2741,1641],[5,98,2742],[5,1576,2743],[5,101,2090],[5,2745,1641],[5,98,2746],[5,1576,2747],[5,2477,1642],[5,1576,2749],[5,2092,1642],[5,1576,2751],[5,1492,1348],[5,1331,2753],[5,1632,2754],[5,98,2755],[5,1486,2756],[5,1324,2757],[5,1352,2758],[5,0,1641],[5,2382,2475],[5,2760,2761],[5,1949,1325],[5,98,2763],[5,97,2764],[5,2734,1951],[5,2765,2766],[5,2322,26],[5,72,2768],[5,101,2111],[5,2770,1353],[5,2769,2771],[4,89,0,2772],[5,2109,2773],[5,98,2774],[5,1357,2775],[5,1352,2776],[5,2377,2777],[5,1643,1575],[5,1640,963],[5,101,2780],[5,2781,2245],[5,98,2782],[5,98,2780],[5,97,2784],[2,107,0,0],[5,98,2786],[5,2785,2787],[5,1120,1641],[5,98,2789],[5,1643,2476],[5,1684,1310],[5,1331,2792],[5,1632,2793],[5,98,2794],[5,1486,2795],[5,1324,2796],[5,1352,2797],[5,101,1759],[5,2799,963],[5,101,2800],[5,1457,1490],[5,477,2802],[5,1463,1378],[5,2803,2804],[5,2801,2805],[5,98,2806],[5,1388,2807],[5,1375,2808],[5,101,1772],[5,2810,963],[5,101,2811],[5,2812,2805],[5,98,2813],[5,1388,2814],[5,1375,2815],[5,25,1759],[5,2817,1317],[5,98,2818],[5,1388,2819],[5,1375,2820],[5,0,1759],[0,108,1],[5,2823,963],[5,34,2824],[5,2825,1384],[5,2822,2826],[5,1388,2827],[5,1375,2828],[5,2322,1493],[5,101,2830],[5,2322,1310],[5,477,2832],[5,2322,1325],[5,2833,2834],[5,2831,2835],[5,98,2836],[5,1489,2837],[5,1329,2838],[5,1486,2839],[5,1324,2840],[5,101,2834],[5,47,1520],[5,2842,2843],[5,98,2844],[5,1489,2845],[5,1329,2846],[5,101,1506],[5,1483,26],[4,23,0,2849],[5,2695,2850],[5,2848,2851],[5,98,2852],[5,81,2139],[5,2854,2142],[4,88,0,2855],[5,2132,2856],[5,81,2857],[5,2858,2148],[4,91,0,2859],[5,2132,2860],[5,98,2861],[5,97,2862],[4,91,0,2142],[5,2132,2864],[5,98,2865],[5,2863,2866],[5,2131,2867],[5,98,2857],[5,97,2869],[5,2870,2168],[5,2165,2871],[4,91,0,2872],[5,127,2873],[5,97,2874],[5,493,1325],[5,98,2876],[5,2875,2877],[5,2131,2878],[5,1512,2879],[5,964,1506],[5,98,2881],[5,97,2882],[5,1491,1384],[5,98,2884],[5,97,2885],[5,1559,1759],[5,98,2887],[5,2886,2888],[5,1388,2889],[5,2883,2890],[5,1559,1772],[5,98,2892],[5,2886,2893],[5,1388,2894],[5,2883,2895],[5,1937,1378],[5,101,2897],[5,2898,1520],[5,98,2899],[5,1489,2900],[5,1329,2901],[5,1349,1506],[5,98,2903],[5,97,2904],[5,1354,1506],[5,98,2906],[5,97,2907],[5,2132,2399],[5,98,2909],[5,97,2910],[5,898,1506],[5,98,2912],[5,97,2913],[5,2165,2416],[5,2914,2915],[4,94,0,2916],[5,127,2917],[4,29,0,2918],[5,127,2919],[5,97,2920],[5,2921,2428],[5,2911,2922],[5,2908,2923],[5,2905,2924],[5,2124,2925],[5,1945,1490],[5,101,2927],[5,2928,1520],[5,98,2929],[5,1489,2930],[5,1329,2931],[5,98,2603],[5,97,2933],[5,1589,1490],[5,2935,1384],[5,98,2936],[5,97,2937],[5,1640,1759],[5,98,2939],[5,2938,2940],[5,1388,2941],[5,2934,2942],[5,1375,2943],[5,1640,1772],[5,98,2945],[5,2938,2946],[5,1388,2947],[5,2934,2948],[5,1375,2949],[5,2442,1389],[5,98,2951],[5,1393,2952],[5,1388,2953],[5,1375,2954],[5,2219,2955],[5,1643,2956],[5,101,1520],[5,2958,2245],[5,101,2959],[5,2960,2834],[5,98,2961],[5,1489,2962],[5,1329,2963],[5,1512,1488],[5,2322,1336],[5,98,2966],[5,1489,2967],[5,1329,2968],[5,1576,1642],[5,2477,2970],[5,2092,2970],[5,2049,2245],[5,101,2973],[5,2974,2063],[5,98,2975],[5,1388,2976],[5,1375,2977],[5,2372,2245],[5,101,2979],[5,2980,1924],[5,98,2981],[5,1388,2982],[5,1375,2983],[5,101,1490],[5,2985,1493],[5,101,2986],[5,2987,1534],[5,98,2988],[5,1512,2989],[5,1509,2990],[5,2985,1759],[5,101,2992],[5,1463,1490],[5,72,2994],[5,2995,2802],[5,477,2996],[5,1419,1490],[5,1463,2998],[5,72,2999],[5,1457,2998],[5,3000,3001],[5,2997,3002],[5,2993,3003],[5,98,3004],[5,1388,3005],[5,1375,3006],[5,2634,1506],[5,98,3008],[5,97,3009],[5,101,2633],[5,3011,1378],[5,47,3012],[5,477,3013],[5,1491,2633],[5,3014,3015],[5,98,3016],[5,97,3017],[5,1334,1490],[5,3019,2633],[5,101,3020],[5,3021,1340],[5,101,3022],[5,3011,1325],[5,1529,3024],[5,3023,3025],[5,98,3026],[5,3018,3027],[5,1329,3028],[5,1324,3029],[5,3010,3030],[5,477,2843],[5,3032,1498],[5,98,3033],[5,97,3034],[5,101,2639],[5,3019,1325],[5,3036,3037],[5,101,3038],[5,101,1312],[5,3040,1490],[5,72,3041],[5,3042,3024],[5,3039,3043],[5,98,3044],[5,3035,3045],[5,1512,3046],[5,2637,3047],[5,1320,3048],[5,25,1820],[5,309,1317],[5,3051,1317],[5,3050,3052],[5,98,3053],[5,1375,3054],[5,1821,1378],[5,101,3056],[5,3057,963],[5,98,3058],[5,1375,3059],[5,1821,1336],[5,101,3061],[5,1821,1325],[5,1331,3063],[5,3062,3064],[5,98,3065],[5,1512,3066],[5,1375,3067],[5,0,1820],[0,109,29],[5,3070,1317],[5,3071,963],[5,1331,82],[4,63,0,3073],[4,23,0,3074],[4,91,0,3075],[5,3072,3076],[5,1692,26],[4,63,0,3078],[4,23,0,3079],[4,91,0,3080],[5,3077,3081],[5,3069,3082],[5,1419,1336],[5,1821,3084],[5,101,3085],[5,1821,1906],[5,1692,3087],[5,3086,3088],[5,98,3089],[5,1512,3090],[5,1375,3091],[5,25,2824],[5,3093,3052],[5,98,3094],[5,1375,3095],[5,2825,1378],[5,101,3097],[5,3098,1378],[5,98,3099],[5,1375,3100],[5,2825,1336],[5,101,3102],[5,2825,1325],[5,1376,3104],[5,3105,963],[5,3103,3106],[5,98,3107],[5,1512,3108],[5,1375,3109],[5,0,2824],[5,3071,1378],[5,1376,82],[5,3113,963],[4,63,0,3114],[4,23,0,3115],[4,91,0,3116],[5,3112,3117],[5,1376,26],[5,3119,1441],[4,63,0,3120],[4,23,0,3121],[4,91,0,3122],[5,3118,3123],[5,3111,3124],[5,2825,3084],[5,101,3126],[5,2825,1906],[5,1376,3128],[5,3129,1441],[5,3127,3130],[5,98,3131],[5,1512,3132],[5,1375,3133],[5,101,1716],[5,3135,963],[5,101,3136],[5,3137,2802],[5,98,3138],[5,1388,3139],[5,1375,3140],[5,1692,1407],[5,101,3142],[5,3143,963],[5,101,3144],[5,3145,2802],[5,98,3146],[5,1388,3147],[5,1375,3148],[5,1463,1716],[5,101,3150],[5,3151,2802],[5,98,3152],[5,1388,3153],[5,1375,3154],[5,1463,3142],[5,101,3156],[5,3157,2802],[5,98,3158],[5,1388,3159],[5,1375,3160],[5,1483,1698],[5,101,3162],[5,72,2703],[5,47,2804],[5,3164,3165],[5,3163,3166],[5,98,3167],[5,1375,3168],[5,1699,1378],[5,101,3170],[5,1559,1378],[5,477,3172],[5,3173,2994],[5,3171,3174],[5,98,3175],[5,1375,3176],[5,1692,1748],[5,101,3178],[5,3179,1398],[5,98,3180],[5,1388,3181],[5,1375,3182],[5,1419,1826],[5,1377,3184],[5,101,3185],[5,1331,1739],[5,3186,3187],[5,98,3188],[5,1388,3189],[5,1375,3190],[5,1377,1441],[5,101,3192],[5,3193,1378],[5,98,3194],[5,1375,3195],[5,1377,2314],[5,101,3197],[5,1692,1739],[5,3198,3199],[5,98,3200],[5,1388,3201],[5,1375,3202],[5,1334,1358],[5,3204,1353],[5,101,3205],[5,596,1959],[5,3207,2676],[5,3206,3208],[5,98,3209],[5,1357,3210],[5,1352,3211],[5,101,1750],[5,3213,963],[5,101,3214],[5,3215,3001],[5,98,3216],[5,1388,3217],[5,1375,3218],[5,1331,1407],[5,101,3220],[5,3221,963],[5,101,3222],[5,3223,3001],[5,98,3224],[5,1388,3225],[5,1375,3226],[5,1463,1750],[5,101,3228],[5,3229,3001],[5,98,3230],[5,1388,3231],[5,1375,3232],[5,1463,3220],[5,101,3234],[5,3235,3001],[5,98,3236],[5,1388,3237],[5,1375,3238],[5,1483,1746],[5,101,3240],[5,477,2703],[5,3242,2999],[5,3241,3243],[5,98,3244],[5,1375,3245],[5,2227,1378],[5,101,3247],[5,72,3172],[5,3249,3165],[5,3248,3250],[5,98,3251],[5,1375,3252],[5,1589,1336],[5,3254,1378],[5,101,3255],[5,3256,2245],[5,98,3257],[5,1489,3258],[5,1329,3259],[5,1331,1714],[5,101,3261],[5,3262,1398],[5,98,3263],[5,1388,3264],[5,1375,3265],[5,1756,1378],[5,101,3267],[5,3268,1378],[5,98,3269],[5,1375,3270],[5,1755,1378],[5,3272,963],[5,101,3273],[5,3274,1378],[5,98,3275],[5,1375,3276],[5,1771,1389],[5,1756,3278],[5,101,3279],[5,1755,1759],[5,3281,1389],[5,3280,3282],[5,98,3283],[5,1393,3284],[5,1388,3285],[5,1375,3286],[5,2799,1772],[5,98,3288],[5,1388,3289],[5,1375,3290],[5,1771,1761],[5,3280,3292],[5,98,3293],[5,1393,3294],[5,1388,3295],[5,1375,3296],[5,2799,1761],[5,101,3298],[5,477,1541],[5,3300,2804],[5,3299,3301],[5,98,3302],[5,1393,3303],[5,1388,3304],[5,1375,3305],[5,101,1761],[5,3307,3278],[5,101,3308],[5,1738,1378],[5,2391,3310],[5,3309,3311],[5,98,3312],[5,1393,3313],[5,1388,3314],[5,1375,3315],[5,2799,1378],[5,101,3317],[5,477,2804],[5,3319,1458],[5,3318,3320],[5,98,3321],[5,1388,3322],[5,1375,3323],[5,2799,1490],[5,101,3325],[5,3326,3003],[5,98,3327],[5,1388,3328],[5,1375,3329],[5,1590,1378],[5,98,3331],[5,97,3332],[5,1309,1775],[5,1774,1384],[5,3334,3335],[5,101,3336],[5,3337,1924],[5,98,3338],[5,3333,3339],[5,1393,3340],[5,1388,3341],[5,1375,3342],[5,1390,1506],[5,98,3344],[5,97,3345],[5,1755,1423],[5,3347,1384],[5,1309,3348],[5,3347,963],[5,3349,3350],[5,98,3351],[5,3346,3352],[5,1388,3353],[5,1375,3354],[5,1576,3355],[5,2322,1389],[5,98,3357],[5,97,3358],[5,3337,1574],[5,98,3360],[5,3359,3361],[5,1393,3362],[5,1388,3363],[5,1375,3364],[5,98,3336],[5,3346,3366],[5,1388,3367],[5,1375,3368],[5,1576,3369],[5,1309,1761],[5,3371,3278],[5,101,3372],[5,3373,1924],[5,98,3374],[5,3333,3375],[5,1393,3376],[5,1388,3377],[5,1375,3378],[5,1771,1423],[5,1309,3380],[5,1756,1423],[5,3381,3382],[5,98,3383],[5,3346,3384],[5,1388,3385],[5,1375,3386],[5,1576,3387],[5,3373,1574],[5,98,3389],[5,3359,3390],[5,1393,3391],[5,1388,3392],[5,1375,3393],[5,98,3372],[5,3346,3395],[5,1388,3396],[5,1375,3397],[5,1576,3398],[5,1589,1775],[5,3400,3335],[5,101,3401],[5,3402,2063],[5,98,3403],[5,3333,3404],[5,1393,3405],[5,1388,3406],[5,1375,3407],[5,1589,3335],[5,3409,1775],[5,98,3410],[5,3333,3411],[5,1393,3412],[5,1388,3413],[5,1375,3414],[5,1643,3415],[5,3402,1641],[5,98,3417],[5,3359,3418],[5,1393,3419],[5,1388,3420],[5,1375,3421],[5,98,3401],[5,3359,3423],[5,1393,3424],[5,1388,3425],[5,1375,3426],[5,1643,3427],[5,1589,1761],[5,3429,3278],[5,101,3430],[5,3431,2063],[5,98,3432],[5,3333,3433],[5,1393,3434],[5,1388,3435],[5,1375,3436],[5,1589,3278],[5,3438,1761],[5,98,3439],[5,3333,3440],[5,1393,3441],[5,1388,3442],[5,1375,3443],[5,1643,3444],[5,3431,1641],[5,98,3446],[5,3359,3447],[5,1393,3448],[5,1388,3449],[5,1375,3450],[5,98,3430],[5,3359,3452],[5,1393,3453],[5,1388,3454],[5,1375,3455],[5,1643,3456],[5,1755,1310],[5,3458,1325],[5,25,3459],[5,3460,1506],[5,98,3461],[5,1512,3462],[5,1509,3463],[5,1589,1759],[5,3465,1378],[5,101,3466],[5,72,2603],[5,2062,1378],[5,3468,3469],[5,477,3470],[5,72,2609],[5,2322,1384],[5,3472,3473],[5,3471,3474],[5,3467,3475],[5,98,3476],[5,1388,3477],[5,1375,3478],[5,2322,1759],[5,101,3480],[5,3468,3473],[5,477,3482],[5,3472,3469],[5,3483,3484],[5,3481,3485],[5,98,3486],[5,1388,3487],[5,1375,3488],[5,1756,1826],[5,101,3490],[5,1760,1441],[5,3491,3492],[5,98,3493],[5,1388,3494],[5,1375,3495],[5,1755,1698],[5,3497,1384],[5,101,3498],[5,1760,1448],[5,3499,3500],[5,98,3501],[5,1388,3502],[5,1375,3503],[5,101,3282],[5,1755,1761],[5,3506,1384],[5,3505,3507],[5,98,3508],[5,1393,3509],[5,1388,3510],[5,1375,3511],[5,1756,1833],[5,101,3513],[5,1760,963],[5,3514,3515],[5,98,3516],[5,1388,3517],[5,1375,3518],[5,1755,1746],[5,3520,1384],[5,101,3521],[5,1760,1384],[5,3522,3523],[5,98,3524],[5,1388,3525],[5,1375,3526],[5,1755,1441],[5,3528,1384],[5,101,3529],[5,1419,1759],[5,3530,3531],[5,98,3532],[5,1388,3533],[5,1375,3534],[5,1756,1448],[5,101,3536],[5,3537,3531],[5,98,3538],[5,1388,3539],[5,1375,3540],[5,1394,1310],[5,1559,3542],[5,98,3543],[5,1486,3544],[5,1324,3545],[5,1388,3546],[5,1375,3547],[5,1576,3548],[5,1492,1384],[5,1559,3550],[5,98,3551],[5,1486,3552],[5,1324,3553],[5,1388,3554],[5,1375,3555],[5,1576,3556],[5,1419,1310],[5,1684,3558],[5,1309,3559],[5,3560,1353],[5,98,3561],[5,1486,3562],[5,1324,3563],[5,1357,3564],[5,1352,3565],[5,2124,3566],[5,1376,3558],[5,3568,1348],[5,1309,3569],[5,3570,1353],[5,98,3571],[5,1486,3572],[5,1324,3573],[5,1357,3574],[5,1352,3575],[5,2124,3576],[5,98,2832],[5,97,3578],[5,2010,1310],[5,1632,3580],[5,98,3581],[5,3579,3582],[5,1324,3583],[5,1357,3584],[5,1352,3585],[5,2124,3586],[5,1492,1353],[5,1632,3588],[5,98,3589],[5,3579,3590],[5,1324,3591],[5,1357,3592],[5,1352,3593],[5,2124,3594],[5,1486,3582],[5,1324,3596],[5,1357,3597],[5,1352,3598],[5,2377,3599],[5,1486,3590],[5,1324,3601],[5,1357,3602],[5,1352,3603],[5,2377,3604],[5,1589,3559],[5,3606,1353],[5,98,3607],[5,1486,3608],[5,1324,3609],[5,1357,3610],[5,1352,3611],[5,2377,3612],[5,1419,1398],[5,101,3614],[5,1786,1448],[5,3615,3616],[5,98,3617],[5,1388,3618],[5,1375,3619],[5,1309,3558],[5,3621,1325],[5,98,3622],[5,1489,3623],[5,1329,3624],[5,1486,3625],[5,1324,3626],[5,2307,1378],[5,101,3628],[5,3629,2703],[5,98,3630],[5,1375,3631],[5,1483,1441],[5,101,3633],[5,3634,3172],[5,98,3635],[5,1375,3636],[5,1870,1493],[5,101,3638],[5,3639,1521],[5,98,3640],[5,1512,3641],[5,1509,3642],[5,1870,1759],[5,101,3644],[5,3645,3320],[5,98,3646],[5,1388,3647],[5,1375,3648],[5,1483,1384],[5,98,3650],[5,97,3651],[5,101,3469],[5,3653,2245],[5,98,3654],[5,1388,3655],[5,3652,3656],[5,98,3473],[5,97,3658],[5,1566,1378],[5,101,3660],[5,3661,2245],[5,98,3662],[5,1388,3663],[5,3659,3664],[5,1331,1310],[5,1334,3666],[5,3667,1378],[5,101,3668],[5,3669,11],[5,98,3670],[5,1509,3671],[5,1334,1378],[5,3673,2633],[5,101,3674],[5,3675,1340],[5,101,3676],[5,1518,3024],[5,3677,3678],[5,98,3679],[5,1329,3680],[5,1324,3681],[5,3010,3682],[5,3673,1325],[5,3036,3684],[5,101,3685],[5,3040,1378],[5,72,3687],[5,3688,3024],[5,3686,3689],[5,98,3690],[5,1512,3691],[5,2637,3692],[5,1320,3693],[0,110,2],[5,3695,1398],[5,3696,1389],[5,101,3697],[5,3695,963],[5,3699,1389],[5,1376,3700],[5,3695,1384],[5,3702,1389],[5,3701,3703],[5,1376,3704],[0,111,2],[5,3706,963],[5,3707,1389],[5,1376,3708],[5,3706,1384],[5,3710,1389],[5,3709,3711],[5,3695,3712],[5,3713,1389],[5,3705,3714],[5,3698,3715],[5,98,3716],[5,3359,3717],[5,1393,3718],[5,1388,3719],[5,1375,3720],[5,3706,1398],[5,3722,1389],[5,101,3723],[5,3706,3712],[5,3725,1389],[5,3724,3726],[5,98,3727],[5,3359,3728],[5,1393,3729],[5,1388,3730],[5,1375,3731],[0,112,2],[5,3733,1384],[5,3734,963],[5,455,3735],[5,101,3736],[5,3737,3735],[5,98,3738],[5,1388,3739],[5,1375,3740],[2,113,0,0],[5,1771,3742],[5,1376,3743],[2,114,0,0],[5,3744,3745],[5,1463,3746],[5,98,3747],[5,97,3748],[5,25,3742],[5,3750,1317],[5,98,3751],[5,97,3752],[5,25,3745],[5,1394,2998],[5,3673,3755],[5,3754,3756],[5,98,3757],[5,97,3758],[5,3699,1384],[5,101,3760],[5,3761,3742],[5,98,3762],[5,3759,3763],[5,3753,3764],[5,3659,3765],[5,1388,3766],[5,1375,3767],[5,3749,3768],[5,855,1317],[5,855,3756],[5,1771,82],[5,1376,3772],[5,3773,26],[5,1463,3774],[4,114,0,3775],[5,3771,3776],[4,113,0,3777],[5,3770,3778],[5,98,3779],[5,3659,3780],[5,1388,3781],[5,1375,3782],[5,3761,2998],[5,101,3784],[5,1334,1448],[5,3786,2998],[5,964,3787],[5,3785,3788],[5,98,3789],[5,3659,3790],[5,1388,3791],[5,1375,3792],[5,3761,1378],[5,101,3794],[5,964,3756],[5,3795,3796],[5,98,3797],[5,3659,3798],[5,1388,3799],[5,1375,3800],[5,3699,1490],[5,101,3802],[5,3803,963],[5,98,3804],[5,1375,3805],[5,3707,1490],[5,101,3807],[5,3808,1378],[5,98,3809],[5,1375,3810],[5,3699,963],[5,101,3812],[5,3813,1490],[5,98,3814],[5,2934,3815],[5,1375,3816],[5,3707,963],[5,101,3818],[5,3819,1378],[5,98,3820],[5,2934,3821],[5,1375,3822],[5,27,3756],[5,98,3824],[5,97,3825],[5,359,3760],[5,98,3827],[5,97,3828],[5,3707,1384],[5,559,3830],[5,98,3831],[5,97,3832],[5,98,3775],[5,97,3834],[2,115,0,0],[5,98,3836],[5,3835,3837],[5,3833,3838],[5,3829,3839],[5,3826,3840],[5,2405,3841],[4,114,0,3842],[5,127,3843],[4,113,0,3844],[5,127,3845],[5,97,3846],[5,3847,3837],[5,3659,3848],[5,1388,3849],[5,1375,3850],[5,3695,1739],[5,3852,1384],[5,101,3853],[5,1692,3760],[5,3854,3855],[5,98,3856],[5,3659,3857],[5,1388,3858],[5,1375,3859],[5,3706,1739],[5,3861,1384],[5,101,3862],[5,3863,3830],[5,98,3864],[5,3659,3865],[5,1388,3866],[5,1375,3867],[5,1376,1448],[5,3869,963],[5,3695,3870],[5,3871,1384],[5,101,3872],[5,3873,3855],[5,98,3874],[5,3659,3875],[5,1388,3876],[5,1375,3877],[5,3706,3870],[5,3879,1384],[5,101,3880],[5,3881,3830],[5,98,3882],[5,3659,3883],[5,1388,3884],[5,1375,3885],[5,98,3788],[5,97,3887],[5,98,3784],[5,3659,3889],[5,1388,3890],[5,3888,3891],[5,101,3830],[5,3893,1407],[5,98,3894],[5,3659,3895],[5,1388,3896],[5,3888,3897],[5,98,3796],[5,97,3899],[5,98,3794],[5,3659,3901],[5,1388,3902],[5,3900,3903],[5,3893,963],[5,98,3905],[5,3659,3906],[5,1388,3907],[5,3900,3908],[5,3696,1384],[5,101,3910],[5,1331,3760],[5,3911,3912],[5,98,3913],[5,3659,3914],[5,1388,3915],[5,1375,3916],[5,3722,1384],[5,101,3918],[5,3919,3830],[5,98,3920],[5,3659,3921],[5,1388,3922],[5,1375,3923],[5,3695,1407],[5,3925,1384],[5,101,3926],[5,3927,3912],[5,98,3928],[5,3659,3929],[5,1388,3930],[5,1375,3931],[5,3706,1407],[5,3933,1384],[5,101,3934],[5,3935,3830],[5,98,3936],[5,3659,3937],[5,1388,3938],[5,1375,3939],[2,116,0,0],[5,1771,3941],[5,1376,3942],[2,117,0,0],[5,3943,3944],[5,1463,3945],[5,98,3946],[5,97,3947],[5,25,3941],[5,3949,1317],[5,98,3950],[5,97,3951],[5,25,3944],[5,3953,3756],[5,98,3954],[5,97,3955],[5,101,3941],[5,3957,3742],[5,98,3958],[5,3659,3959],[5,1388,3960],[5,1375,3961],[5,3956,3962],[5,3952,3963],[5,3948,3964],[5,3759,3965],[5,3753,3966],[5,3749,3967],[5,101,3944],[5,3969,3745],[5,98,3970],[5,3659,3971],[5,1388,3972],[5,1375,3973],[5,3956,3974],[5,3952,3975],[5,3948,3976],[5,3759,3977],[5,3753,3978],[5,3749,3979],[5,1377,3335],[5,3695,3981],[5,3982,1384],[5,101,3983],[5,1430,3760],[5,3984,3985],[5,98,3986],[5,1393,3987],[5,3659,3988],[5,1388,3989],[5,1375,3990],[5,1377,3278],[5,3695,3992],[5,3993,1384],[5,101,3994],[5,3995,3985],[5,98,3996],[5,1393,3997],[5,3659,3998],[5,1388,3999],[5,1375,4000],[5,1376,3278],[5,4002,963],[5,3695,4003],[5,4004,1384],[5,101,4005],[5,4006,3985],[5,98,4007],[5,1393,4008],[5,3659,4009],[5,1388,4010],[5,1375,4011],[5,1376,3335],[5,4013,963],[5,3695,4014],[5,4015,1384],[5,101,4016],[5,4017,3985],[5,98,4018],[5,1393,4019],[5,3659,4020],[5,1388,4021],[5,1375,4022],[5,25,3760],[5,4024,1317],[5,98,4025],[5,3659,4026],[5,1388,4027],[5,1375,4028],[5,98,3735],[5,97,4030],[5,1771,26],[5,1463,4032],[5,98,4033],[5,97,4034],[5,4035,439],[5,2408,4036],[4,89,0,4037],[5,127,4038],[5,97,4039],[5,4040,439],[5,1388,4041],[5,1375,4042],[5,4031,4043],[5,1771,1312],[5,1463,4045],[5,98,4046],[5,97,4047],[5,4048,4030],[5,1320,4049],[5,1388,4050],[5,1375,4051],[5,1120,3735],[5,98,4053],[5,1388,4054],[5,1375,4055],[5,3733,1378],[5,4057,963],[5,98,4058],[5,97,4059],[5,98,2804],[5,4060,4061],[5,1375,4062],[5,101,4058],[5,4064,2804],[5,98,4065],[5,1375,4066],[5,3733,963],[5,4068,1378],[5,98,4069],[5,1375,4070],[5,4068,1384],[5,98,4072],[5,97,4073],[5,4068,1389],[5,98,4075],[5,97,4076],[5,4068,1395],[5,98,4078],[5,4077,4079],[5,4074,4080],[5,1393,4081],[5,1388,4082],[5,1375,4083],[5,0,3735],[4,89,0,4033],[5,3770,4086],[5,4085,4087],[5,1388,4088],[5,1375,4089],[5,101,3735],[5,3893,1378],[5,4091,4092],[5,98,4093],[5,3659,4094],[5,1388,4095],[5,1375,4096],[5,3706,1389],[5,4098,1384],[5,4068,4099],[5,98,4100],[5,97,4101],[5,1393,4076],[5,3659,4103],[5,1388,4104],[5,1375,4105],[5,4074,4106],[5,4102,4107],[5,4068,3278],[5,98,4109],[5,1393,4110],[5,1388,4111],[5,1375,4112],[5,4077,4113],[5,4074,4113],[5,3733,1759],[5,4116,1389],[5,98,4117],[5,97,4118],[5,4119,4076],[5,1393,4120],[5,1388,4121],[5,1375,4122],[5,3734,1389],[5,98,4124],[5,4119,4125],[5,1393,4126],[5,1388,4127],[5,1375,4128],[5,4068,963],[5,98,4130],[5,1375,4131],[5,1774,3760],[5,101,4133],[5,3695,1775],[5,4135,1384],[5,4134,4136],[5,98,4137],[5,1393,4138],[5,3659,4139],[5,1388,4140],[5,1375,4141],[5,4031,4142],[5,1771,3760],[5,101,4144],[5,4145,963],[5,98,4146],[5,3659,4147],[5,1388,4148],[5,1375,4149],[5,4031,4150],[5,97,4125],[5,4152,4076],[5,4074,4153],[5,1393,4154],[5,1388,4155],[5,1375,4156],[5,4068,1759],[5,98,4158],[5,1388,4159],[5,1375,4160],[5,4068,1772],[5,98,4162],[5,1388,4163],[5,1375,4164],[5,0,3760],[5,384,1317],[5,4167,3778],[5,4166,4168],[5,1388,4169],[5,1375,4170],[5,0,3830],[5,1419,4144],[5,1377,4173],[5,4172,4174],[5,1376,3830],[5,4176,4144],[5,101,4177],[5,4178,963],[5,98,4179],[5,3659,4180],[5,1388,4181],[5,1375,4182],[5,1376,4144],[5,4184,3830],[5,101,4185],[5,4186,963],[5,98,4187],[5,3659,4188],[5,1388,4189],[5,1375,4190],[5,1755,3760],[5,4192,1384],[5,1376,4193],[5,4194,3830],[5,101,4195],[5,4196,963],[5,98,4197],[5,3659,4198],[5,1388,4199],[5,1375,4200],[5,4176,4193],[5,101,4202],[5,4203,963],[5,98,4204],[5,3659,4205],[5,1388,4206],[5,1375,4207],[5,3695,3830],[5,4209,1384],[5,101,4210],[5,4211,1378],[5,98,4212],[5,3659,4213],[5,1388,4214],[5,1375,4215],[5,3893,3745],[5,98,4217],[5,3759,4218],[5,3753,4219],[5,3659,4220],[5,1388,4221],[5,1375,4222],[5,3749,4223],[5,101,3905],[5,4225,3796],[5,98,4226],[5,3659,4227],[5,1388,4228],[5,1375,4229],[5,3706,3830],[5,4231,1384],[5,101,4232],[5,4233,3830],[5,98,4234],[5,3659,4235],[5,1388,4236],[5,1375,4237],[5,25,3830],[5,4239,3756],[5,98,4240],[5,3659,4241],[5,1388,4242],[5,1375,4243],[5,3706,3981],[5,4245,1384],[5,101,4246],[5,4247,3830],[5,98,4248],[5,1393,4249],[5,3659,4250],[5,1388,4251],[5,1375,4252],[5,3706,3992],[5,4254,1384],[5,101,4255],[5,4256,3830],[5,98,4257],[5,1393,4258],[5,3659,4259],[5,1388,4260],[5,1375,4261],[5,3706,4003],[5,4263,1384],[5,101,4264],[5,4265,3830],[5,98,4266],[5,1393,4267],[5,3659,4268],[5,1388,4269],[5,1375,4270],[5,3706,4014],[5,4272,1384],[5,101,4273],[5,4274,3830],[5,98,4275],[5,1393,4276],[5,3659,4277],[5,1388,4278],[5,1375,4279],[5,4239,1317],[5,98,4281],[5,3659,4282],[5,1388,4283],[5,1375,4284],[5,3733,1389],[5,4286,1188],[5,98,4287],[5,97,4288],[5,3733,1761],[5,1771,1188],[5,4290,4291],[5,98,4292],[5,4289,4293],[5,4074,4294],[5,1588,4295],[5,1393,4296],[5,1388,4297],[5,1375,4298],[5,3733,1490],[5,4300,963],[5,98,4301],[5,1375,4302],[5,3695,1759],[5,4304,1389],[5,101,4305],[5,1756,3703],[5,1376,4307],[5,1755,3700],[5,4309,3711],[5,4308,4310],[5,1376,4311],[5,1755,3708],[5,4313,3711],[5,3695,4314],[5,4315,1389],[5,4312,4316],[5,4306,4317],[5,98,4318],[5,3359,4319],[5,1393,4320],[5,1388,4321],[5,1375,4322],[5,4304,1384],[5,101,4324],[5,4325,963],[5,98,4326],[5,3659,4327],[5,1388,4328],[5,1375,4329],[5,3695,1772],[5,4331,1384],[5,101,4332],[5,4333,963],[5,98,4334],[5,3659,4335],[5,1388,4336],[5,1375,4337],[5,3706,1759],[5,4339,1389],[5,101,4340],[5,3706,4314],[5,4342,1389],[5,4341,4343],[5,98,4344],[5,3359,4345],[5,1393,4346],[5,1388,4347],[5,1375,4348],[5,4339,1384],[5,101,4350],[5,4351,1378],[5,98,4352],[5,3659,4353],[5,1388,4354],[5,1375,4355],[5,3706,1772],[5,4357,1384],[5,101,4358],[5,4359,1378],[5,98,4360],[5,3659,4361],[5,1388,4362],[5,1375,4363],[5,3695,1441],[5,4365,1384],[5,101,4366],[5,1419,3760],[5,1376,4368],[5,1419,3830],[5,3695,4370],[5,4371,1384],[5,4369,4372],[5,4367,4373],[5,98,4374],[5,3659,4375],[5,1388,4376],[5,1375,4377],[5,7,4092],[5,4379,1378],[5,4380,2998],[5,4369,4381],[5,4367,4382],[5,98,4383],[5,3659,4384],[5,1388,4385],[5,1375,4386],[5,3706,1441],[5,4388,1384],[5,101,4389],[5,3706,4370],[5,4391,1384],[5,4390,4392],[5,98,4393],[5,3659,4394],[5,1388,4395],[5,1375,4396],[5,1394,4370],[5,4380,4398],[5,4390,4399],[5,98,4400],[5,3659,4401],[5,1388,4402],[5,1375,4403],[0,118,17],[2,119,0,0],[5,4405,4406],[2,120,0,0],[5,4407,4408],[2,121,0,0],[5,4409,4410],[2,122,0,0],[5,4411,4412],[2,123,0,0],[5,4413,4414],[5,0,4415],[5,25,4410],[5,4417,4408],[5,72,4418],[5,25,4412],[5,309,4408],[5,4421,4408],[5,4420,4422],[5,72,4423],[5,45,4408],[5,34,4412],[5,4426,26],[5,101,4427],[5,4428,4410],[5,47,4429],[4,91,0,4430],[5,4425,4431],[5,72,4432],[5,4426,82],[5,101,4434],[5,4435,4427],[5,81,4436],[5,4437,360],[4,91,0,4438],[5,4425,4439],[4,88,0,4440],[5,4425,4441],[5,72,4442],[5,78,4408],[5,45,4444],[5,4417,26],[5,72,4446],[5,45,26],[5,25,4427],[5,4449,82],[4,91,0,4450],[5,4448,4451],[5,4447,4452],[5,81,4453],[5,73,4408],[5,4455,26],[5,4454,4456],[4,40,0,4457],[5,4445,4458],[5,72,4459],[5,25,4414],[5,309,4406],[5,4462,4406],[5,4461,4463],[5,72,4464],[5,101,4406],[5,28,4408],[5,30,4408],[5,34,4414],[5,4469,26],[4,91,0,4470],[5,4468,4471],[5,4467,4472],[5,4466,4473],[5,72,4474],[5,4469,4410],[5,101,4476],[5,4477,4410],[5,72,4478],[5,25,4470],[5,4480,4408],[5,81,4481],[5,559,4410],[5,4482,4483],[4,89,0,4484],[5,4425,4485],[5,72,4486],[5,45,4406],[5,4469,82],[5,101,4489],[5,4490,4470],[5,81,4491],[5,4492,360],[4,106,0,4493],[5,4488,4494],[4,89,0,4495],[5,4488,4496],[5,72,4497],[5,4469,4470],[5,101,4499],[5,4500,26],[4,89,0,4501],[5,4488,4502],[5,4498,4503],[5,4487,4504],[5,4479,4505],[5,4475,4506],[5,4465,4507],[5,4460,4508],[5,4443,4509],[5,4433,4510],[5,4424,4511],[5,4419,4512],[5,4416,4513],[5,0,1317],[0,124,0],[5,31,4516],[5,4515,4517],[5,0,1506],[0,125,0],[5,31,4520],[5,4519,4521],[5,25,4520],[5,309,1506],[5,4524,1506],[5,4523,4525],[5,98,4526],[5,34,4520],[5,4528,1310],[5,101,4529],[5,4528,1325],[5,4530,4531],[5,98,4532],[5,97,4533],[5,1512,1935],[5,1509,4535],[5,4534,4536],[5,101,4532],[5,4538,1934],[5,98,4539],[5,1512,4540],[5,1509,4541],[5,314,4520],[5,98,4543],[5,646,1506],[5,98,4545],[5,97,4546],[5,4528,645],[5,25,4548],[5,4549,1506],[5,98,4550],[5,4547,4551],[5,25,1336],[0,126,1],[5,4554,1378],[5,4553,4555],[5,98,4556],[5,97,4557],[5,4558,439],[5,1512,4559],[5,101,4531],[5,4561,1378],[5,98,4562],[5,97,4563],[5,1512,439],[5,4564,4565],[5,1870,4531],[5,98,4567],[5,97,4568],[5,4569,4565],[5,0,4520],[3,2],[5,4405,4572],[5,4573,82],[5,4574,26],[3,4],[5,4575,4576],[3,3],[5,4577,4578],[4,121,0,4579],[5,703,4580],[4,120,0,4581],[5,703,4582],[4,119,0,4583],[5,703,4584],[4,123,0,4585],[5,703,4586],[4,122,0,4587],[5,24,4588],[5,4571,4589],[2,127,0,0],[5,25,4591],[5,4592,110],[5,98,4593],[5,97,4594],[2,128,0,11],[5,4596,4572],[5,4597,82],[5,4598,26],[5,25,4599],[5,4600,110],[4,63,0,4601],[5,321,4602],[4,23,0,4603],[5,321,4604],[4,91,0,4605],[5,2132,4606],[5,98,4607],[5,97,4608],[2,129,0,11],[5,4610,4572],[5,4611,82],[5,4612,26],[5,25,4613],[5,4614,110],[4,63,0,4615],[5,321,4616],[4,23,0,4617],[5,321,4618],[4,91,0,4619],[5,2132,4620],[5,98,4621],[5,97,4622],[5,3051,110],[5,855,4624],[5,34,26],[5,4626,1378],[5,101,4627],[5,4628,4591],[5,72,4629],[5,719,2147],[5,101,4631],[5,4596,26],[5,4633,720],[5,1419,26],[5,719,4635],[5,4634,4636],[5,4632,4637],[4,91,0,4638],[5,2132,4639],[5,72,4640],[5,719,2150],[5,101,4642],[5,4610,26],[5,4644,720],[5,4645,4636],[5,4643,4646],[4,91,0,4647],[5,2132,4648],[5,4641,4649],[5,4630,4650],[4,36,0,4651],[5,4625,4652],[5,98,4653],[5,4623,4654],[5,4609,4655],[5,4595,4656],[2,130,0,2],[5,4658,82],[5,4659,26],[5,25,4660],[5,4661,110],[4,23,0,4662],[5,321,4663],[4,91,0,4664],[5,2132,4665],[5,98,4666],[5,97,4667],[5,4524,110],[5,855,4669],[5,4658,26],[5,4671,720],[5,4632,4672],[4,91,0,4673],[5,2132,4674],[5,4630,4675],[4,36,0,4676],[5,4670,4677],[5,98,4678],[5,4668,4679],[5,4595,4680],[5,718,1378],[5,98,4682],[5,2165,4683],[4,88,0,4684],[5,127,4685],[5,97,4686],[5,704,1378],[5,4688,2147],[5,98,4689],[5,2165,4690],[4,91,0,4691],[5,127,4692],[5,97,4693],[5,98,706],[5,97,4695],[5,704,3073],[5,4697,2147],[5,98,4698],[5,4696,4699],[5,2165,4700],[5,2914,4701],[4,91,0,4702],[5,127,4703],[4,88,0,4704],[5,127,4705],[5,97,4706],[5,704,1310],[5,4708,1325],[5,98,4709],[5,4707,4710],[5,4694,4711],[5,4687,4712],[5,1509,4713],[5,1512,4714],[4,88,0,4682],[5,2132,4716],[5,98,4717],[5,97,4718],[4,91,0,4689],[5,2132,4720],[5,98,4721],[5,97,4722],[5,81,706],[5,4724,4698],[4,91,0,4725],[5,2132,4726],[4,88,0,4727],[5,2132,4728],[5,98,4729],[5,97,4730],[4,91,0,706],[5,2132,4732],[4,88,0,4733],[5,2132,4734],[5,98,4735],[5,4731,4736],[5,4723,4737],[5,4719,4738],[5,101,4521],[5,4740,1506],[5,98,4741],[0,131,0],[5,0,4743],[0,132,0],[5,1331,4745],[5,4744,4746],[0,133,0],[5,0,4748],[0,134,0],[5,1331,4750],[5,4749,4751],[5,4405,4576],[5,4753,4578],[5,4754,4572],[5,4755,82],[5,4756,26],[4,123,0,4757],[5,703,4758],[4,122,0,4759],[5,703,4760],[4,121,0,4761],[5,703,4762],[4,120,0,4763],[5,703,4764],[4,119,0,4765],[5,703,4766],[5,98,4767],[0,135,0],[5,0,4769],[0,136,0],[5,1331,4771],[5,4770,4772],[0,137,0],[5,0,4774],[0,138,0],[5,1331,4776],[5,4775,4777],[5,0,4776],[0,139,0],[5,1331,4780],[5,4779,4781],[5,0,4771],[0,140,0],[5,1331,4784],[5,4783,4785],[5,97,4061],[5,4787,439],[5,97,4788],[5,1463,2147],[5,98,4790],[5,97,4791],[5,4792,439],[5,2165,4793],[4,91,0,4794],[5,127,4795],[5,97,4796],[5,1463,2150],[5,98,4798],[5,97,4799],[5,4800,439],[5,2165,4801],[4,91,0,4802],[5,127,4803],[5,97,4804],[5,4805,439],[5,4797,4806],[5,4789,4807],[5,1375,4808],[5,0,4516],[5,4405,26],[5,4811,1506],[5,4812,1378],[5,4813,4520],[5,4814,82],[4,119,0,4815],[5,703,4816],[4,123,0,4817],[5,24,4818],[5,4810,4819],[5,97,4565],[5,1519,4635],[5,98,4822],[5,97,4823],[5,4824,439],[5,2165,4825],[4,88,0,4826],[5,127,4827],[5,97,4828],[5,4829,439],[5,4821,4830],[5,1329,4831],[5,4405,1317],[5,4833,1506],[5,4834,1378],[5,4835,4520],[5,4836,4516],[5,98,4837],[5,98,2142],[5,97,4839],[5,493,4635],[5,98,4841],[5,97,4842],[5,4843,2168],[5,4840,4844],[5,2165,4845],[4,91,0,4846],[5,127,4847],[5,97,4848],[5,4843,2174],[5,4840,4850],[5,2165,4851],[4,91,0,4852],[5,127,4853],[5,97,4854],[5,4855,2160],[5,4849,4856],[5,2131,4857],[5,4855,2181],[5,4849,4859],[5,2131,4860],[5,1375,4861],[4,97,0,4790],[5,3770,4863],[5,98,4864],[5,1375,4865],[4,91,0,4790],[5,2109,4867],[5,477,4868],[4,91,0,4798],[5,2109,4870],[5,4869,4871],[5,3319,4872],[5,98,4873],[5,1375,4874],[5,3070,110],[5,4876,4591],[5,4877,4596],[5,4878,4610],[5,578,4879],[5,98,4880],[5,97,4881],[5,308,4624],[5,98,4883],[5,97,4884],[5,322,1378],[5,101,4886],[5,4887,4591],[5,98,4888],[5,97,4889],[5,322,2147],[5,101,4891],[5,4633,323],[5,322,4635],[5,4893,4894],[5,4892,4895],[4,91,0,4896],[5,2132,4897],[5,98,4898],[5,97,4899],[5,322,2150],[5,101,4901],[5,4644,323],[5,4903,4894],[5,4902,4904],[4,91,0,4905],[5,2132,4906],[5,98,4907],[5,97,4908],[5,4909,439],[5,4900,4910],[5,4890,4911],[5,4885,4912],[5,97,4913],[5,4914,439],[5,4623,4915],[5,4609,4916],[5,4595,4917],[5,4882,4918],[5,25,4879],[5,4920,4624],[5,98,4921],[5,4623,4922],[5,4609,4923],[5,4595,4924],[5,0,4879],[5,384,4624],[5,4927,4652],[5,4926,4928],[5,98,1520],[5,97,4930],[5,4931,439],[5,97,4932],[5,1519,2147],[5,98,4934],[5,97,4935],[5,4936,439],[5,2165,4937],[4,88,0,4938],[5,127,4939],[5,97,4940],[5,4941,439],[5,4933,4942],[5,1512,4943],[5,4840,2168],[5,2165,4945],[4,91,0,4946],[5,127,4947],[5,97,4948],[5,4949,2866],[5,2131,4950],[5,4949,2877],[5,2131,4952],[5,1512,4953],[5,1512,1328],[0,141,25],[5,4956,110],[5,4957,4591],[5,4958,4658],[5,578,4959],[5,98,4960],[5,97,4961],[5,308,4669],[5,98,4963],[5,97,4964],[5,4671,323],[5,4892,4966],[4,91,0,4967],[5,2132,4968],[5,98,4969],[5,97,4970],[5,4971,439],[5,4890,4972],[5,4965,4973],[5,97,4974],[5,4975,439],[5,4668,4976],[5,4595,4977],[5,4962,4978],[5,25,4959],[5,4980,4669],[5,98,4981],[5,4668,4982],[5,4595,4983],[5,0,4959],[5,384,4669],[5,4986,4677],[5,4985,4987],[0,142,0],[5,0,4989],[5,1331,4743],[5,4990,4991],[5,98,2843],[5,97,4993],[4,88,0,4934],[5,2109,4995],[5,98,4996],[5,4994,4997],[5,1512,4998],[5,4528,26],[5,1463,5000],[5,98,5001],[5,97,5002],[5,5003,439],[5,2165,5004],[4,91,0,5005],[5,127,5006],[5,97,5007],[5,1419,5000],[5,1463,5009],[5,98,5010],[5,97,5011],[5,5012,439],[5,2165,5013],[4,91,0,5014],[5,127,5015],[5,97,5016],[5,5017,439],[5,5008,5018],[5,4789,5019],[5,1375,5020],[5,1519,5000],[5,98,5022],[5,97,5023],[5,5024,439],[5,2165,5025],[4,88,0,5026],[5,127,5027],[5,97,5028],[5,5029,439],[5,4933,5030],[5,1512,5031],[5,493,5000],[5,98,5033],[5,4840,5034],[5,2165,5035],[4,91,0,5036],[5,127,5037],[5,97,5038],[5,5039,2866],[5,2131,5040],[5,1692,1378],[5,101,5042],[5,5043,2998],[5,98,5044],[5,25,1698],[5,5046,1506],[5,101,5047],[5,596,1506],[5,9,1378],[5,5050,11],[5,5049,5051],[5,964,5052],[5,5048,5053],[5,98,5054],[5,1375,5055],[5,101,1698],[5,5057,1826],[5,98,5058],[5,97,5059],[5,5060,2085],[5,101,5058],[5,5062,1858],[5,98,5063],[5,1388,5064],[5,1375,5065],[5,5057,963],[5,47,5067],[5,98,5068],[5,1375,5069],[5,98,5067],[5,97,5071],[5,1375,439],[5,5072,5073],[5,1463,1698],[5,98,5075],[5,97,5076],[5,5077,5073],[5,101,5067],[5,5079,2245],[5,98,5080],[5,1375,5081],[5,101,5075],[5,5083,2245],[5,98,5084],[5,1375,5085],[5,314,1691],[5,98,5087],[5,1692,1746],[5,101,5089],[5,5090,963],[5,98,5091],[5,1375,5092],[5,25,1691],[5,5094,3052],[5,98,5095],[5,1457,1698],[5,98,5097],[5,2280,5098],[5,1388,5099],[5,101,1691],[5,298,1317],[5,359,2147],[4,97,0,5103],[5,4167,5104],[4,81,0,5105],[5,5102,5106],[5,5101,5107],[5,98,5108],[5,715,1317],[5,72,5110],[5,5111,4651],[5,714,5112],[4,36,0,5113],[5,703,5114],[5,98,5115],[0,143,14],[5,5117,4591],[5,5118,4596],[5,5119,4610],[5,5120,307],[5,5121,1325],[5,0,5122],[5,318,1317],[5,72,5124],[5,72,4888],[5,25,2147],[5,4554,1325],[5,5127,5128],[5,81,5129],[5,72,4896],[5,5131,4905],[5,5130,5132],[4,88,0,5133],[5,2132,5134],[5,5126,5135],[5,5125,5136],[5,316,5137],[5,5123,5138],[5,1321,5128],[5,98,5140],[5,97,5141],[5,98,5122],[5,97,5143],[5,5120,569],[5,5145,1310],[5,98,5146],[5,97,5147],[5,4554,1310],[5,1316,5149],[5,98,5150],[5,97,5151],[5,322,1312],[5,101,5153],[5,590,1312],[5,5154,5155],[5,98,5156],[5,5152,5157],[5,5148,5158],[5,5144,5159],[5,5142,5160],[5,1512,5161],[5,1419,1312],[5,322,5163],[5,101,5164],[5,590,5163],[5,5165,5166],[5,98,5167],[5,5152,5168],[5,5148,5169],[5,5144,5170],[5,5142,5171],[5,1512,5172],[5,5120,26],[5,5174,82],[4,36,0,5175],[5,703,5176],[4,91,0,5177],[5,2132,5178],[5,98,5179],[5,715,1506],[5,72,5181],[5,5182,4676],[5,714,5183],[4,36,0,5184],[5,703,5185],[5,98,5186],[0,144,10],[5,5188,4591],[5,5189,4658],[5,5190,307],[5,5191,1325],[5,0,5192],[5,318,1506],[5,72,5194],[5,5130,4967],[4,88,0,5196],[5,2132,5197],[5,5126,5198],[5,5195,5199],[5,316,5200],[5,5193,5201],[5,98,5192],[5,97,5203],[5,5190,569],[5,5205,1310],[5,98,5206],[5,97,5207],[5,5208,5158],[5,5204,5209],[5,5142,5210],[5,1512,5211],[5,5190,26],[5,5213,82],[4,36,0,5214],[5,703,5215],[4,91,0,5216],[5,2132,5217],[5,98,5218],[5,0,4745],[0,145,0],[5,1331,5221],[5,5220,5222],[5,0,5221],[5,1331,4774],[5,5224,5225],[5,25,1746],[5,5227,1506],[5,101,5228],[5,28,1506],[5,9,2998],[5,5231,11],[5,5230,5232],[5,964,5233],[5,5229,5234],[5,98,5235],[5,1375,5236],[5,2571,1833],[5,98,5238],[5,97,5239],[5,5240,2085],[5,101,5238],[5,5242,1858],[5,98,5243],[5,1388,5244],[5,1375,5245],[5,2571,963],[5,47,5247],[5,98,5248],[5,1375,5249],[5,98,5247],[5,97,5251],[5,5252,5073],[5,1463,1746],[5,98,5254],[5,97,5255],[5,5256,5073],[5,101,5247],[5,5258,2245],[5,98,5259],[5,1375,5260],[5,101,5254],[5,5262,2245],[5,98,5263],[5,1375,5264],[5,2571,1378],[5,101,5266],[5,5267,2999],[5,98,5268],[5,1375,5269],[5,314,1330],[5,98,5271],[5,101,1336],[5,5273,4531],[5,98,5274],[5,1512,5275],[5,2571,1448],[5,101,5277],[5,1463,2314],[5,5278,5279],[5,98,5280],[5,1388,5281],[5,1375,5282],[5,101,3666],[5,5284,1906],[5,101,5285],[5,5286,2245],[5,98,5287],[5,1512,5288],[5,1509,5289],[5,1419,3666],[5,1519,5291],[5,101,5292],[5,5293,2245],[5,98,5294],[5,1512,5295],[5,1509,5296],[5,101,1906],[5,5298,3666],[5,101,5299],[5,5300,2245],[5,98,5301],[5,1512,5302],[5,1509,5303],[5,101,5291],[5,5305,1325],[5,101,5306],[5,5307,2245],[5,98,5308],[5,1512,5309],[5,1509,5310],[5,5273,1378],[5,98,5312],[5,97,5313],[5,5314,4565],[5,1870,1336],[5,98,5316],[5,97,5317],[5,5318,4565],[5,101,5312],[5,5320,2245],[5,98,5321],[5,1512,5322],[5,101,5316],[5,5324,2245],[5,98,5325],[5,1512,5326],[5,4553,5128],[5,47,5328],[5,98,5329],[5,1512,5330],[5,1331,1698],[5,101,5332],[5,5333,963],[5,98,5334],[5,1375,5335],[5,25,1330],[5,5337,3052],[5,98,5338],[5,1331,1793],[5,101,5340],[5,5341,1441],[5,98,5342],[5,1375,5343],[5,1331,3084],[5,101,5345],[5,5346,1906],[5,98,5347],[5,1512,5348],[5,0,1330],[5,7,2163],[5,5351,5000],[5,384,1506],[5,359,5009],[4,88,0,5354],[5,5353,5355],[5,1419,5356],[5,5352,5357],[4,81,0,5358],[5,5102,5359],[5,5350,5360],[5,0,4750],[5,1331,4989],[5,5362,5363],[5,0,4784],[0,146,0],[5,1331,5366],[5,5365,5367],[5,0,4780],[0,147,0],[5,1331,5370],[5,5369,5371],[5,0,5366],[5,1331,4748],[5,5373,5374],[5,0,5370],[5,1331,1490],[5,5376,5377],[5,101,1441],[5,5379,1448],[5,98,5380],[5,97,5381],[5,5382,2085],[5,101,5380],[5,5384,1858],[5,98,5385],[5,1388,5386],[5,1375,5387],[5,25,1906],[5,5389,1317],[5,98,5390],[5,1329,5391],[5,5379,1833],[5,101,5393],[5,1457,1793],[5,5394,5395],[5,98,5396],[5,1388,5397],[5,1375,5398],[5,5389,1506],[5,101,5400],[5,5401,1520],[5,98,5402],[5,1512,5403],[5,101,1782],[5,1331,1441],[5,5405,5406],[5,98,5407],[5,1375,5408],[5,5379,963],[5,98,5410],[5,97,5411],[5,5412,4061],[5,1375,5413],[5,101,1793],[5,1692,1441],[5,5415,5416],[5,98,5417],[5,1375,5418],[5,5379,1384],[5,101,5420],[5,1463,1448],[5,5421,5422],[5,98,5423],[5,1388,5424],[5,1375,5425],[5,1419,1441],[5,101,5427],[5,5428,963],[5,98,5429],[5,1375,5430],[5,5379,1378],[5,101,5432],[5,5433,2804],[5,98,5434],[5,1375,5435],[5,1870,1441],[5,101,5437],[5,5438,2804],[5,98,5439],[5,1375,5440],[2,148,0,0],[5,1419,5442],[5,0,5443],[5,34,4516],[5,5445,5442],[5,5444,5446],[5,1326,5149],[5,98,5448],[5,97,5449],[5,5450,1935],[5,5142,5451],[5,27,5128],[5,81,5453],[5,5454,2142],[5,98,5455],[5,97,5456],[5,98,5129],[5,97,5458],[5,5459,2168],[5,5457,5460],[5,2165,5461],[4,88,0,5462],[5,127,5463],[5,97,5464],[5,45,5128],[4,88,0,2142],[5,5466,5467],[5,98,5468],[5,5465,5469],[5,2131,5470],[5,1512,5471],[5,101,5128],[5,5473,5149],[5,101,5474],[5,1519,1310],[5,5475,5476],[5,98,5477],[5,1509,5478],[5,1512,5479],[5,25,3666],[5,5481,5128],[5,47,5482],[5,98,5483],[5,97,5484],[5,5485,4535],[5,5142,5486],[5,477,5140],[5,5488,5448],[5,98,5489],[5,1512,5490],[5,1509,5491],[5,73,5128],[5,5493,1506],[5,98,5494],[5,98,5482],[5,97,5496],[5,1512,5141],[5,1509,5498],[5,5497,5499],[5,1326,5128],[5,98,5501],[5,1512,5502],[5,4554,1336],[5,101,5504],[5,28,5128],[5,9,1336],[5,5507,11],[5,5506,5508],[5,5505,5509],[5,98,5510],[5,1512,5511],[5,1316,5128],[5,98,5513],[5,1512,5514],[5,5142,5515],[5,5152,5516],[5,101,4555],[5,5518,5051],[5,98,5519],[5,0,5128],[5,188,1506],[5,9,1325],[5,5523,11],[5,28,5524],[5,182,1506],[5,5127,82],[4,89,0,5527],[5,5526,5528],[5,5525,5529],[4,40,0,5530],[5,5522,5531],[5,5521,5532],[5,25,1378],[5,5534,5128],[5,98,5535],[5,1512,5536],[5,5534,1317],[5,98,5538],[5,5534,1506],[5,98,5540],[5,1870,1746],[5,101,5542],[5,5543,2999],[5,98,5544],[5,1375,5545],[5,0,1378],[5,4812,4572],[5,5548,4520],[5,5549,82],[4,119,0,5550],[5,703,5551],[4,123,0,5552],[5,703,5553],[4,121,0,5554],[5,24,5555],[5,5547,5556],[5,98,135],[5,97,5558],[5,47,135],[5,101,5560],[5,5561,2245],[5,98,5562],[5,5559,5563],[0,149,8],[2,70,0,7],[5,5565,5566],[5,0,5567],[0,78,8],[5,5566,26],[5,47,5570],[4,23,6,5571],[5,5569,5572],[5,47,5573],[5,5568,5574],[5,5569,5566],[5,0,5576],[0,22,18],[5,101,5570],[0,150,0],[5,5579,5580],[4,23,6,5581],[5,5578,5582],[5,5566,5583],[5,101,5584],[5,5585,5580],[5,5577,5586],[0,11,46],[0,151,33],[2,97,0,30],[5,5589,5590],[2,14,0,31],[5,5591,5592],[5,5588,5593],[5,5592,5590],[5,5594,5595],[0,11,5],[5,98,5580],[5,97,5598],[2,70,0,3],[5,5599,5600],[5,5597,5601],[5,5602,5600],[5,455,135],[5,98,5604],[5,5597,5605],[5,5606,5558],[4,23,6,5570],[5,5565,5608],[5,98,5609],[5,97,5610],[2,23,0,6],[5,5566,5612],[5,98,5613],[5,97,5614],[5,5615,1285],[5,97,5616],[5,5617,1285],[5,5611,5618],[0,47,45],[5,98,5570],[4,23,6,5621],[5,5620,5622],[5,97,5623],[5,5624,5610],[5,1120,5567],[5,98,5626],[5,5611,1285],[5,5615,5628],[5,97,5629],[5,5630,1285],[5,5611,5631],[5,72,135],[5,5633,852],[5,1120,5634],[5,98,5635],[0,152,0],[5,0,5637],[4,23,0,5580],[5,24,5639],[5,5638,5640],[5,5597,5623],[5,5642,5610],[0,153,5],[5,5644,5558],[5,98,852],[5,5645,5646],[5,5597,5647],[5,98,5634],[5,5648,5649],[5,97,5646],[5,98,1093],[5,5651,5652],[5,5559,5653],[5,5597,5654],[5,97,5649],[5,5656,5652],[5,5655,5657],[5,5559,5652],[5,97,5659],[5,97,5653],[5,5661,5652],[5,5660,5662],[5,5597,5663],[5,477,135],[5,5665,852],[5,98,5666],[5,97,5667],[5,5668,5652],[5,97,5669],[5,5670,5652],[5,5664,5671],[5,98,26],[5,5559,5673],[5,97,5674],[5,5675,5673],[4,79,0,5676],[5,127,5677],[5,5597,5678],[5,5679,5558],[5,0,645],[5,5681,367],[5,5597,5682],[5,5683,1006],[5,97,5621],[5,5685,1285],[4,23,6,5686],[5,5620,5687],[5,5597,5688],[5,5569,5608],[5,98,5690],[5,97,5691],[5,5692,1285],[5,5689,5693],[5,5559,5646],[5,5597,5695],[5,81,135],[5,5697,852],[5,98,5698],[5,5696,5699],[5,98,2245],[5,5559,5701],[5,5597,5702],[5,98,5560],[5,5703,5704],[5,101,5580],[5,5706,438],[5,101,5707],[5,101,438],[5,5709,5580],[5,5708,5710],[5,98,5711],[5,101,2245],[5,5713,438],[5,101,5714],[5,5709,2245],[5,5715,5716],[5,98,5717],[5,306,438],[5,5719,1284],[5,98,5720],[5,97,5721],[5,1120,438],[5,98,5723],[5,97,5724],[5,1120,1284],[5,98,5726],[5,97,5727],[5,5709,1284],[5,98,5729],[5,5728,5730],[5,5725,5731],[5,5722,5732],[5,101,5729],[5,5734,5720],[5,98,5735],[5,5728,5736],[5,5725,5737],[5,455,5567],[5,101,5739],[5,5740,5567],[5,98,5741],[5,455,5634],[5,101,5743],[5,5744,5634],[5,98,5745],[5,455,645],[5,455,5747],[5,101,5748],[5,5749,5747],[5,98,5750],[5,7,135],[2,154,0,0],[5,5752,5753],[2,155,0,0],[5,5754,5755],[5,455,5756],[5,101,5757],[5,455,5753],[5,5752,5759],[5,455,5755],[5,5760,5761],[5,5758,5762],[5,98,5763],[5,455,438],[5,98,5765],[5,97,5766],[5,97,439],[5,5768,1285],[5,97,5769],[5,5770,1285],[5,5767,5771],[5,101,5753],[5,5773,5755],[5,455,5774],[5,101,5775],[5,5776,5774],[5,98,5777],[5,306,5747],[5,5779,645],[5,98,5780],[5,455,5576],[5,101,5782],[5,5783,5576],[5,98,5784],[5,455,2245],[5,101,5786],[5,5787,2245],[5,98,5788],[5,97,5704],[5,101,5604],[5,5791,2245],[5,98,5792],[5,5790,5793],[5,5768,5766],[5,306,135],[5,5796,852],[5,455,5797],[5,101,5798],[5,5799,5797],[5,98,5800],[5,455,5698],[5,101,5802],[5,5803,5698],[5,98,5804],[5,1120,5747],[5,98,5806],[5,455,5560],[5,101,5808],[5,5809,5560],[5,98,5810],[5,455,5666],[5,101,5812],[5,5813,5666],[5,98,5814],[5,455,5580],[5,101,5816],[5,5817,5580],[5,98,5818],[5,101,5747],[5,5820,5580],[5,477,5821],[5,5820,2245],[5,5822,5823],[5,98,5824],[5,5791,5580],[5,98,5826],[5,5559,5827],[5,493,5580],[5,98,5829],[5,97,5830],[5,493,2245],[5,98,5832],[5,97,5833],[5,493,5747],[5,98,5835],[5,5834,5836],[5,5831,5837],[5,0,5747],[5,7,645],[5,5840,5580],[5,5841,2245],[5,5839,5842],[5,2347,1285],[5,97,5844],[5,5845,1285],[5,5770,5846],[0,156,2],[5,5848,135],[5,5849,852],[5,98,5850],[5,5696,5851],[0,157,2],[5,5853,135],[5,5854,852],[5,98,5855],[5,5648,5856],[0,158,8],[5,5858,5608],[5,98,5859],[5,5642,5860],[0,159,2],[5,5862,645],[5,5863,367],[5,98,5864],[5,5683,5865],[2,48,0,7],[5,5867,26],[5,5853,5868],[2,79,0,7],[5,5870,26],[5,5869,5871],[4,23,6,5872],[5,5858,5873],[5,306,5874],[5,5858,5867],[5,5853,5876],[5,5858,5870],[5,5877,5878],[5,5875,5879],[5,98,5880],[5,5848,1093],[5,5882,5855],[5,306,5883],[5,5882,135],[5,5853,5885],[5,5882,852],[5,5886,5887],[5,5884,5888],[5,98,5889],[5,97,5856],[2,82,0,3],[5,5891,5892],[5,5597,5893],[5,5651,5892],[5,5559,5895],[5,5894,5896],[0,11,50],[5,5898,5853],[5,5899,72],[5,5898,5862],[5,5901,101],[0,160,0],[5,0,5903],[5,5904,2245],[5,5858,5566],[5,0,5906],[5,5907,5609],[5,5898,5848],[5,5909,81],[5,5597,5851],[5,5911,5695],[5,5597,5856],[5,5913,5647],[5,5597,5860],[5,5915,5623],[5,5597,5865],[5,5917,5682],[0,161,0],[5,0,5919],[5,5920,5580],[5,81,438],[5,5922,1284],[5,72,5923],[5,81,2345],[5,5925,1284],[5,5924,5926],[5,101,5927],[5,455,1284],[5,5928,5929],[5,98,5930],[5,98,5919],[2,154,0,6],[5,5566,5933],[5,98,5934],[5,97,5935],[5,5578,5608],[5,5566,5937],[5,98,5938],[5,5936,5939],[2,81,0,6],[5,5566,5941],[5,98,5942],[5,97,5943],[2,86,0,7],[5,5945,26],[5,98,5946],[5,5685,5947],[4,23,6,5948],[5,5620,5949],[5,97,5950],[5,5945,5937],[5,98,5952],[5,5951,5953],[5,5944,5954],[5,5692,5954],[5,5692,5939],[5,306,2142],[2,86,0,1],[5,5959,26],[5,5958,5960],[5,98,5961],[4,23,0,5962],[5,127,5963],[5,97,5964],[4,23,0,2142],[5,24,5966],[5,101,5967],[4,23,0,5960],[5,24,5969],[5,5968,5970],[5,98,5971],[5,5965,5972],[5,493,5753],[5,98,5974],[5,97,5975],[5,559,963],[5,98,5977],[5,4840,5978],[4,23,0,5979],[5,127,5980],[5,97,5981],[5,5968,963],[5,98,5983],[5,5982,5984],[5,5976,5985],[5,559,1384],[5,98,5987],[5,4840,5988],[4,23,0,5989],[5,127,5990],[5,97,5991],[5,1457,5967],[5,98,5993],[5,5992,5994],[5,5976,5995],[5,559,5753],[4,23,0,5997],[5,24,5998],[5,101,5999],[5,6000,5753],[5,98,6001],[5,5790,5558],[5,97,6003],[5,6004,5558],[5,97,5730],[5,7,438],[5,6007,5753],[5,6008,4],[5,101,6009],[5,7,1284],[5,6011,5753],[5,6012,4],[5,6010,6013],[5,98,6014],[5,6006,6015],[5,5752,438],[5,6017,1284],[5,98,6018],[5,97,6019],[5,5559,439],[5,6020,6021],[5,5790,1285],[5,6020,6023],[5,5754,4],[5,493,6025],[5,98,6026],[5,97,6027],[5,5976,5646],[5,5559,6029],[5,97,6030],[5,97,495],[5,6032,5646],[5,5790,6033],[5,97,6034],[5,6035,5646],[5,6031,6036],[5,6028,6037],[5,101,6025],[5,6039,4],[5,98,6040],[5,5790,6041],[5,7,2245],[5,6043,5753],[5,6044,4],[5,101,6045],[5,6046,4],[5,98,6047],[5,97,1285],[2,162,0,0],[5,5773,6050],[5,98,6051],[5,6049,6052],[5,97,6053],[5,47,1284],[5,98,6055],[5,97,6056],[5,101,4],[2,163,0,0],[5,6058,6059],[5,98,6060],[5,6057,6061],[5,97,6062],[5,6011,6050],[5,6064,6059],[5,6010,6065],[5,98,6066],[5,6063,6067],[5,6054,6068],[5,6006,6069],[5,5559,5975],[5,97,6071],[5,97,5702],[5,6073,495],[5,97,6074],[5,6075,6027],[5,6072,6076],[5,7,5580],[5,6078,5753],[5,6079,4],[5,101,6080],[5,6081,5753],[5,98,6082],[5,6039,5753],[5,98,6084],[5,5559,6085],[5,98,6025],[5,97,6087],[5,98,5753],[5,97,6089],[5,6090,5646],[5,5559,6091],[5,97,6092],[5,98,4],[5,97,6094],[5,6095,5646],[5,5790,6096],[5,97,6097],[5,6098,5646],[5,6093,6099],[5,6088,6100],[5,97,6021],[5,97,6023],[5,6103,6019],[5,6102,6104],[5,7,1005],[5,6106,367],[5,6107,645],[5,101,6108],[5,6109,645],[5,98,6110],[5,6039,5755],[5,98,6112],[5,97,6113],[5,98,5774],[5,97,6115],[5,6116,5646],[5,5559,6117],[5,97,6118],[5,6058,5755],[5,98,6120],[5,97,6121],[5,6122,5646],[5,5790,6123],[5,97,6124],[5,6125,5646],[5,6119,6126],[5,6114,6127],[5,5773,412],[5,98,6129],[5,5559,6130],[5,97,6131],[5,101,5755],[5,6133,412],[5,98,6134],[5,5790,6135],[5,97,6136],[5,101,5756],[5,6138,412],[5,98,6139],[5,6137,6140],[5,6132,6141],[5,6133,6025],[5,98,6143],[5,97,6144],[5,6133,5753],[5,98,6146],[5,97,6147],[5,6148,5646],[5,5559,6149],[5,97,6150],[5,6133,4],[5,98,6152],[5,97,6153],[5,6154,5646],[5,5790,6155],[5,97,6156],[5,6157,5646],[5,6151,6158],[5,6145,6159],[5,489,5753],[5,98,6161],[5,5559,6162],[5,97,6163],[5,489,5755],[5,98,6165],[5,5790,6166],[5,97,6167],[5,489,5756],[5,98,6169],[5,6168,6170],[5,6164,6171],[5,5754,5753],[5,101,6173],[5,6174,5753],[5,98,6175],[5,5752,852],[5,6177,1093],[5,7,6178],[5,6179,5753],[5,6180,4],[5,101,6181],[5,477,5634],[5,72,5560],[5,6184,1093],[5,6183,6185],[5,7,6186],[5,6187,5753],[5,6188,4],[5,6182,6189],[5,98,6190],[5,7,852],[5,6192,5753],[5,6193,5755],[5,5752,6194],[5,6195,412],[5,101,6196],[5,7,5634],[5,6198,5753],[5,47,852],[5,5633,6200],[5,7,6201],[5,6202,5755],[5,6203,412],[5,6199,6204],[5,6197,6205],[5,98,6206],[5,5656,5558],[5,5656,5646],[5,97,5654],[5,6210,5652],[5,5656,6211],[5,5651,5649],[5,5559,6213],[5,72,438],[5,6215,1284],[5,101,6216],[5,72,1284],[5,6218,438],[5,6217,6219],[5,98,6220],[5,6218,2786],[5,6215,6222],[5,101,6223],[5,6215,2786],[5,6218,6225],[5,6224,6226],[5,98,6227],[2,164,0,0],[5,5709,6229],[5,98,6230],[5,97,6231],[5,98,6229],[5,97,6233],[5,101,1284],[2,165,0,0],[5,6235,6236],[5,98,6237],[5,6234,6238],[5,97,6239],[5,72,6229],[5,6241,6236],[5,6217,6242],[5,98,6243],[5,6240,6244],[5,6232,6245],[5,0,5634],[5,6192,5580],[5,6248,2245],[5,5752,6249],[5,6250,2245],[5,6247,6251],[5,6215,5580],[5,101,6253],[5,6254,5765],[5,98,6255],[5,72,5580],[5,6257,438],[5,101,6258],[5,6259,5765],[5,98,6260],[5,6215,2245],[5,101,6262],[5,6263,2245],[5,98,6264],[5,72,2245],[5,6266,438],[5,101,6267],[5,6268,2245],[5,98,6269],[5,6215,438],[5,101,6271],[5,6272,5765],[5,98,6273],[5,6215,6216],[5,101,6275],[5,6276,6216],[5,98,6277],[5,72,6216],[5,6279,2786],[5,101,6280],[5,6281,6223],[5,98,6282],[5,5790,5701],[5,97,6284],[5,6285,5558],[5,98,6200],[5,97,6287],[5,97,5695],[5,6289,5704],[5,6288,6290],[5,5790,6287],[5,97,6292],[5,6293,5558],[5,5651,6294],[0,166,0],[5,0,6296],[4,23,0,2245],[5,24,6298],[5,6297,6299],[5,5668,5663],[5,5790,5646],[5,97,6302],[5,6303,5667],[5,5559,5667],[5,5651,5667],[5,477,438],[5,6307,1284],[5,101,6308],[5,477,1284],[5,6310,438],[5,6309,6311],[5,98,6312],[5,6310,2786],[5,6307,6314],[5,101,6315],[5,6307,2786],[5,6310,6317],[5,6316,6318],[5,98,6319],[5,47,6229],[5,98,6321],[5,97,6322],[5,6323,6238],[5,97,6324],[5,477,6229],[5,6326,6236],[5,6309,6327],[5,98,6328],[5,6325,6329],[5,6232,6330],[5,0,5666],[5,5752,5580],[5,6333,6249],[5,6332,6334],[5,6307,5580],[5,101,6336],[5,6337,5580],[5,98,6338],[5,477,5580],[5,6340,438],[5,101,6341],[5,6342,5580],[5,98,6343],[5,6307,2245],[5,101,6345],[5,6346,5765],[5,98,6347],[5,477,2245],[5,6349,438],[5,101,6350],[5,6351,5765],[5,98,6352],[5,6307,438],[5,101,6354],[5,6355,5765],[5,98,6356],[5,6307,6308],[5,101,6358],[5,6359,6308],[5,98,6360],[5,477,6308],[5,6362,2786],[5,101,6363],[5,6364,6315],[5,98,6365],[5,97,1006],[5,6367,5701],[5,97,6368],[5,101,1005],[5,6370,2245],[5,98,6371],[5,6369,6372],[5,101,5716],[5,6374,2245],[5,101,6375],[5,6376,438],[5,98,6377],[5,5725,6378],[5,1120,5774],[5,98,6380],[5,101,135],[5,6382,852],[5,98,6383],[5,97,6384],[5,98,5797],[5,6385,6386],[5,6382,5580],[5,98,6388],[5,97,6389],[5,6390,5558],[5,5559,6389],[5,2467,2056],[5,98,6393],[5,6382,2245],[5,98,6395],[5,97,6396],[5,6397,5704],[5,0,5753],[5,6399,5755],[5,6116,6400],[0,149,19],[5,6402,5966],[5,98,6403],[5,97,6404],[5,5968,5637],[5,98,6406],[5,6405,6407],[5,81,2142],[5,559,6296],[5,6409,6410],[4,23,0,6411],[5,6402,6412],[5,98,6413],[5,97,6414],[5,5968,6296],[5,98,6416],[5,6415,6417],[5,97,5688],[5,6419,1285],[5,5692,6420],[5,5936,5691],[5,1120,5576],[5,98,6423],[5,5665,5560],[5,98,6425],[5,97,5701],[5,6427,5558],[5,1120,2245],[5,98,6429],[5,5713,5580],[5,98,6431],[5,97,6432],[5,6433,5646],[5,6427,439],[5,5597,6435],[5,6436,5598],[5,47,6431],[5,98,6438],[5,306,6178],[5,72,5698],[5,81,5560],[5,6442,1093],[5,6441,6443],[5,6440,6444],[5,98,6445],[5,97,6386],[5,6288,5652],[5,5790,6448],[5,97,6449],[5,6450,5652],[5,6210,6451],[5,6447,6452],[5,6447,5695],[5,5651,5558],[5,6447,6455],[5,97,5699],[5,81,852],[5,6458,135],[5,98,6459],[5,97,6460],[5,6461,5652],[5,6457,6462],[5,97,6463],[5,6464,5652],[5,6447,6465],[5,97,6455],[5,6467,6386],[5,6289,6468],[5,1120,5797],[5,98,6470],[5,101,5797],[5,455,852],[5,5791,6473],[5,6472,6474],[5,98,6475],[5,98,6474],[5,6447,6477],[5,97,6238],[5,101,5720],[5,306,6229],[5,6481,6236],[5,6480,6482],[5,98,6483],[5,6479,6484],[5,6232,6485],[5,0,5797],[5,6441,6459],[5,6487,6488],[5,5796,135],[5,98,6490],[5,306,5580],[5,6492,438],[5,101,6493],[5,6494,5765],[5,98,6495],[5,5719,5580],[5,101,6497],[5,6498,5765],[5,98,6499],[5,5719,438],[5,101,6501],[5,6502,5580],[5,98,6503],[5,306,2245],[5,6505,438],[5,101,6506],[5,6507,2345],[5,98,6508],[5,5719,2245],[5,101,6510],[5,6511,2345],[5,98,6512],[5,306,852],[5,6514,1093],[5,98,6515],[5,97,6516],[5,5796,1093],[5,98,6518],[5,6517,6519],[5,6447,6520],[5,5651,439],[5,97,6522],[5,5790,439],[5,97,6524],[5,6525,439],[5,6523,6526],[5,6457,6527],[5,2347,5558],[5,97,6529],[5,6523,439],[5,6530,6531],[5,6457,6532],[5,5559,5662],[5,6457,6534],[5,6289,5699],[5,1120,5698],[5,98,6537],[5,101,5923],[5,81,6229],[5,6540,6236],[5,6539,6541],[5,98,6542],[5,6240,6543],[5,6232,6544],[5,0,5698],[5,6250,5580],[5,6546,6547],[5,5922,2245],[5,101,6549],[5,6550,2345],[5,98,6551],[5,5922,5580],[5,101,6553],[5,6554,5580],[5,98,6555],[5,81,2245],[5,6557,438],[5,101,6558],[5,6559,5580],[5,98,6560],[5,81,5580],[5,6562,438],[5,101,6563],[5,6564,5765],[5,98,6565],[5,5922,438],[5,101,6567],[5,6568,5580],[5,98,6569],[5,5922,2345],[5,101,6571],[5,6572,2345],[5,98,6573],[5,97,5600],[5,6575,5598],[5,5597,6576],[5,6577,5598],[5,1120,5753],[5,98,6579],[5,97,6580],[5,1120,4],[5,98,6582],[5,97,6583],[5,1120,6025],[5,98,6585],[5,6584,6586],[5,6581,6587],[5,1120,645],[5,98,6589],[5,97,6590],[5,1004,5580],[5,98,6592],[5,97,6593],[5,6594,5652],[5,97,6595],[5,1004,2245],[5,98,6597],[5,97,6598],[5,6599,5652],[5,97,6600],[5,6601,5652],[5,6596,6602],[5,6591,6603],[5,477,6592],[5,6605,6597],[5,98,6606],[5,6591,6607],[5,0,6589],[5,5820,645],[5,6609,6610],[5,0,135],[5,6612,852],[5,97,6613],[5,6614,6386],[5,97,6400],[5,6616,6115],[5,72,5570],[5,6618,1284],[4,23,6,6619],[5,5565,6620],[5,101,6621],[5,72,5609],[5,6623,1284],[5,6622,6624],[5,98,6625],[0,149,52],[2,86,0,51],[5,6628,26],[5,6215,6629],[4,23,30,6630],[5,6627,6631],[5,101,6632],[4,23,30,6629],[5,6627,6634],[5,6215,6635],[5,6633,6636],[5,98,6637],[0,149,55],[2,70,0,54],[5,6640,26],[5,477,6641],[5,6642,1284],[4,23,53,6643],[5,6639,6644],[5,101,6645],[4,23,53,6641],[5,6639,6647],[5,477,6648],[5,6649,1284],[5,6646,6650],[5,98,6651],[0,149,58],[2,86,0,57],[5,6654,26],[5,6307,6655],[4,23,56,6656],[5,6653,6657],[5,101,6658],[4,23,56,6655],[5,6653,6660],[5,6307,6661],[5,6659,6662],[5,98,6663],[0,149,61],[2,70,0,60],[5,6666,26],[5,81,6667],[5,6668,1284],[4,23,59,6669],[5,6665,6670],[5,101,6671],[0,78,61],[4,23,59,6667],[5,6673,6674],[5,81,6675],[5,6676,1284],[5,6672,6677],[5,98,6678],[0,149,64],[2,86,0,63],[5,6681,26],[5,5922,6682],[4,23,62,6683],[5,6680,6684],[5,101,6685],[4,23,62,6682],[5,6680,6687],[5,5922,6688],[5,6686,6689],[5,98,6690],[5,5569,6620],[5,101,6692],[5,72,5690],[5,6694,1284],[5,6693,6695],[5,98,6696],[0,78,52],[5,6698,6631],[5,101,6699],[5,6698,6634],[5,6215,6701],[5,6700,6702],[5,98,6703],[0,78,55],[5,6705,6644],[5,101,6706],[5,6705,6647],[5,477,6708],[5,6709,1284],[5,6707,6710],[5,98,6711],[0,78,58],[5,6713,6657],[5,101,6714],[5,6713,6660],[5,6307,6716],[5,6715,6717],[5,98,6718],[5,6673,6670],[5,101,6720],[5,6665,6674],[5,81,6722],[5,6723,1284],[5,6721,6724],[5,98,6725],[0,78,64],[5,6727,6684],[5,101,6728],[5,6727,6687],[5,5922,6730],[5,6729,6731],[5,98,6732],[5,6457,5695],[5,47,1005],[5,98,6735],[5,97,6736],[5,6737,6372],[5,1120,135],[5,98,6739],[5,97,6740],[5,5561,6395],[5,98,6742],[5,6741,6743],[5,5561,5792],[5,98,6745],[5,5790,5695],[5,6004,5646],[5,5790,6748],[5,47,2245],[5,101,6750],[5,6751,5580],[5,98,6752],[5,98,6750],[5,6073,5704],[5,1120,5560],[5,98,6756],[5,47,5580],[5,101,6758],[5,6759,2245],[5,98,6760],[5,98,6758],[5,97,6762],[5,6763,5558],[5,0,5560],[5,5752,2245],[5,6766,5580],[5,6765,6767],[5,1004,645],[5,47,6769],[5,98,6770],[5,97,6771],[5,6772,5558],[5,47,6308],[5,101,6774],[5,72,2345],[5,6776,6055],[5,6775,6777],[5,98,6778],[5,47,6216],[5,101,6780],[5,477,2345],[5,6782,6055],[5,6781,6783],[5,98,6784],[5,47,5923],[5,101,6786],[5,6215,6055],[5,6787,6788],[5,98,6789],[5,47,5720],[5,101,6791],[5,5719,6055],[5,6792,6793],[5,98,6794],[5,306,2345],[5,6796,6055],[5,101,6797],[5,6798,5720],[5,98,6799],[5,47,2345],[5,101,6801],[5,6802,5765],[5,98,6803],[5,101,6770],[5,6805,2245],[5,98,6806],[5,47,5609],[5,101,6808],[5,6809,5573],[5,98,6810],[2,70,0,51],[5,6812,26],[4,23,30,6813],[5,6698,6814],[5,47,6815],[5,101,6816],[5,47,6813],[4,23,30,6818],[5,6627,6819],[5,6817,6820],[5,98,6821],[5,2477,2091],[5,47,5560],[5,98,6824],[5,97,6825],[5,6826,5558],[5,5559,6825],[5,1120,5666],[5,98,6829],[5,6215,6314],[5,101,6831],[5,477,6216],[5,6833,6225],[5,6832,6834],[5,98,6835],[5,72,6314],[5,6837,438],[5,101,6838],[5,477,6219],[5,72,2786],[5,6841,438],[5,6840,6842],[5,6839,6843],[5,98,6844],[5,6307,6222],[5,101,6846],[5,72,6308],[5,6848,6317],[5,6847,6849],[5,98,6850],[5,477,6222],[5,6852,438],[5,101,6853],[5,72,6311],[5,477,2786],[5,6856,438],[5,6855,6857],[5,6854,6858],[5,98,6859],[5,5922,6222],[5,101,6861],[5,5922,2786],[5,5924,6863],[5,6862,6864],[5,98,6865],[5,81,6216],[5,6867,2786],[5,101,6868],[5,81,1284],[5,6870,2786],[5,5922,6871],[5,6869,6872],[5,98,6873],[5,81,6308],[5,6875,2786],[5,101,6876],[5,72,6863],[5,6878,6871],[5,6877,6879],[5,98,6880],[5,477,5570],[5,6882,5946],[4,23,6,6883],[5,5569,6884],[5,101,6885],[5,477,5690],[4,23,6,5946],[5,5569,6888],[5,6887,6889],[5,6886,6890],[5,98,6891],[5,72,6813],[5,6893,6629],[4,23,30,6894],[5,6627,6895],[5,101,6896],[5,6627,6814],[5,72,6898],[5,6899,6635],[5,6897,6900],[5,98,6901],[4,23,6,438],[5,5569,6903],[5,101,6904],[5,6905,5765],[5,98,6906],[4,23,30,438],[5,6627,6908],[5,101,6909],[5,6910,5765],[5,98,6911],[5,703,5998],[5,98,6913],[5,5773,26],[4,23,0,6915],[5,703,6916],[5,98,6917],[5,72,5997],[5,6919,2142],[4,23,0,6920],[5,703,6921],[5,101,6922],[5,455,5974],[5,6923,6924],[5,98,6925],[5,72,6915],[5,6927,2142],[4,23,0,6928],[5,703,6929],[5,101,6930],[5,6931,6924],[5,98,6932],[5,81,5997],[5,6934,2142],[4,23,0,6935],[5,6402,6936],[5,101,6937],[5,6938,6924],[5,98,6939],[5,81,6915],[5,6941,2142],[4,23,0,6942],[5,6402,6943],[5,101,6944],[5,6945,6924],[5,98,6946],[5,1463,963],[5,98,6948],[5,6457,5646],[5,5559,6950],[0,167,5],[5,6952,5600],[2,86,0,3],[5,6953,6954],[5,97,6955],[5,97,6954],[2,107,0,3],[5,6957,6958],[5,97,6959],[5,6960,6958],[5,6575,6961],[5,6956,6962],[5,6575,6954],[5,97,6964],[5,6965,6955],[5,5597,5600],[2,164,0,3],[5,6967,6968],[5,97,6969],[5,97,6968],[5,5597,6954],[2,165,0,3],[5,6972,6973],[5,6971,6974],[5,97,6975],[5,5597,6955],[5,6952,6968],[5,6978,6973],[5,6977,6979],[5,6976,6980],[5,6970,6981],[0,11,66],[5,6983,6952],[5,6984,97],[2,70,0,67],[5,6986,82],[5,6987,26],[4,63,30,6988],[5,6698,6989],[4,23,6,6990],[5,5565,6991],[5,306,6992],[0,78,70],[5,6986,26],[5,82,26],[5,6995,6996],[4,23,6,6997],[5,5565,6998],[4,36,68,6999],[5,6994,7000],[5,6993,7001],[5,98,7002],[5,98,6992],[5,97,7004],[5,98,7001],[5,7005,7006],[5,5611,5614],[5,1120,5960],[5,98,7009],[4,23,0,7010],[5,127,7011],[5,97,7012],[5,5959,6009],[5,101,7014],[5,5959,5753],[5,5922,7016],[5,72,7017],[5,5959,4],[5,5925,7019],[5,7018,7020],[5,7015,7021],[5,98,7022],[5,7013,7023],[5,47,7016],[5,6215,7025],[5,477,7026],[5,47,7019],[5,6776,7028],[5,7027,7029],[5,47,7030],[5,7015,7031],[5,98,7032],[5,7013,7033],[5,98,2056],[5,97,7035],[5,97,2181],[5,493,1384],[5,98,7038],[5,7037,7039],[5,7036,7040],[5,1923,7040],[5,5651,6130],[5,5559,7043],[5,97,7044],[5,6058,307],[5,98,7046],[5,6288,7047],[5,5790,7048],[5,97,7049],[5,6192,412],[5,7051,307],[5,6039,7052],[5,98,7053],[5,7050,7054],[5,7045,7055],[5,6447,7056],[5,6288,5558],[5,97,7058],[5,7059,5646],[5,5790,7060],[5,1923,7035],[5,6370,1384],[5,98,7063],[5,97,7064],[5,829,645],[5,101,7066],[5,7067,1384],[5,98,7068],[5,7065,7069],[5,98,6769],[5,97,7071],[2,168,0,3],[5,97,7073],[5,7074,7073],[5,7072,7075],[5,98,1541],[5,97,7077],[5,1463,1389],[5,98,7079],[5,7078,7080],[5,1923,7081],[5,1120,5580],[5,98,7083],[5,5706,2245],[5,98,7085],[5,97,7086],[5,7087,5646],[5,5597,6389],[5,7089,5558],[5,5706,135],[5,98,7091],[5,5597,7092],[5,7093,5558],[2,48,0,37],[5,7095,26],[5,5644,7096],[2,79,0,37],[5,7098,26],[5,7097,7099],[4,23,6,7100],[5,5620,7101],[5,5597,7102],[4,23,6,7096],[5,5620,7104],[5,5644,7105],[4,23,6,7099],[5,5620,7107],[5,7106,7108],[5,7103,7109],[2,169,0,3],[5,97,7111],[5,7112,7111],[2,48,0,3],[5,5644,7114],[2,79,0,3],[5,7115,7116],[5,97,7117],[5,7118,7114],[5,7118,7116],[5,97,7114],[5,97,7116],[5,7122,7117],[5,7121,7123],[5,5597,7117],[0,47,71],[5,7122,26],[5,7121,7127],[5,97,7128],[5,7129,26],[4,82,3,7130],[5,7126,7131],[5,7125,7132],[5,7118,5892],[5,5597,7134],[5,7122,5892],[5,7121,7136],[5,7135,7137],[2,170,0,3],[5,7112,7139],[5,97,7140],[5,7141,7140],[2,171,0,3],[5,97,7143],[2,172,0,3],[5,7144,7145],[5,7144,7146],[5,97,7147],[5,7148,7146],[2,70,0,37],[5,7150,26],[5,5597,7151],[2,86,0,37],[5,7153,26],[5,7152,7154],[4,23,6,7155],[5,5620,7156],[5,97,7157],[4,23,6,7151],[5,5620,7159],[5,5597,7160],[4,23,6,7154],[5,5620,7162],[5,7161,7163],[5,7158,7164],[2,173,0,3],[5,5597,7166],[5,7167,7111],[5,97,7168],[5,97,7166],[5,7170,7111],[5,7169,7171],[5,5597,7111],[5,7173,7166],[5,97,7174],[5,7175,7171],[5,97,7171],[5,7112,7166],[5,97,7178],[5,7179,7168],[5,7177,7180],[5,5588,5612],[2,63,0,6],[5,7182,7183],[5,5597,7184],[5,7185,7184],[5,5597,7116],[5,7187,5892],[5,7121,7188],[5,97,7189],[5,7121,7116],[5,5597,7191],[5,7121,5892],[5,7192,7193],[5,7190,7194],[5,5644,7116],[5,7196,5892],[5,7121,7197],[5,5597,7198],[5,5644,7191],[5,7200,7193],[5,7199,7201],[5,97,7160],[5,7150,5612],[5,97,7204],[5,7205,7073],[5,97,7206],[5,7207,7073],[5,7203,7208],[2,77,0,3],[5,6575,7210],[5,97,7211],[5,97,7210],[5,7213,7073],[5,97,7214],[5,7215,7073],[5,6575,7216],[5,7212,7217],[5,6965,6964],[5,7203,7204],[2,169,0,37],[5,7221,26],[4,23,6,7222],[5,5620,7223],[5,7170,7224],[5,5597,7225],[5,7170,7222],[4,23,6,7227],[5,5620,7228],[5,7226,7229],[0,174,4],[5,7231,7114],[5,5597,7232],[5,7233,7114],[5,97,7232],[5,7235,7114],[5,7121,7232],[5,7233,7232],[5,7182,5612],[5,7170,7113],[5,7170,7240],[5,7213,7216],[0,175,22],[0,176,21],[5,7243,7244],[5,5597,7245],[0,177,22],[5,7247,7244],[5,7246,7248],[5,97,7245],[5,7250,7114],[5,5597,7251],[5,7252,7114],[0,47,73],[2,70,0,74],[5,7255,82],[5,7256,26],[4,63,30,7257],[5,7254,7258],[4,23,6,7259],[5,5620,7260],[5,5597,7261],[5,7255,26],[5,7263,82],[4,23,6,7264],[5,5620,7265],[4,63,30,7266],[5,7254,7267],[5,7262,7268],[5,5597,7137],[5,7122,7193],[5,7270,7271],[5,97,7184],[5,5588,7183],[5,7274,5612],[5,7273,7275],[0,177,37],[5,7277,5612],[5,5597,7278],[5,97,26],[5,7280,26],[4,48,3,7281],[5,7126,7282],[5,7279,7283],[5,7213,7075],[2,148,0,6],[5,7274,7286],[5,97,7287],[5,7182,7286],[5,7288,7289],[5,7273,7290],[4,23,6,7210],[5,5620,7292],[5,5597,7293],[5,7294,7210],[5,238,1093],[5,964,7296],[5,98,7297],[5,97,7298],[5,29,1093],[5,964,7300],[5,98,7301],[5,97,7302],[5,27,1093],[5,98,7304],[5,97,7305],[5,964,26],[5,98,7307],[5,7306,7308],[4,79,0,7309],[5,127,7310],[5,97,7311],[5,7312,439],[5,7303,7313],[5,97,7314],[5,7315,439],[5,7299,7316],[4,79,0,7304],[5,703,7318],[5,98,7319],[5,97,7320],[5,7321,7298],[5,7312,7322],[5,238,11],[5,101,7324],[5,7325,11],[5,98,7326],[5,9,135],[5,7328,11],[5,238,7329],[5,101,7330],[5,7331,135],[5,98,7332],[5,6382,11],[5,47,7334],[5,98,7335],[5,97,7336],[5,9,963],[5,7338,135],[5,238,7339],[5,101,7340],[5,249,963],[5,238,135],[5,7342,7343],[5,7341,7344],[5,98,7345],[5,7337,7346],[5,1094,26],[5,98,7348],[5,826,7349],[4,79,0,7350],[5,127,7351],[5,97,7352],[5,1094,7343],[5,98,7354],[5,7353,7355],[5,7337,7356],[5,25,852],[5,7358,135],[5,98,7359],[5,97,7360],[5,73,7343],[5,7362,852],[5,98,7363],[5,7361,7364],[5,199,852],[5,98,7366],[5,97,7367],[5,238,852],[5,73,7369],[5,7370,7343],[5,98,7371],[5,7368,7372],[5,7337,7373],[5,0,7343],[5,29,135],[5,182,7376],[5,45,135],[5,898,26],[4,79,0,7379],[5,7378,7380],[4,23,0,7381],[5,7377,7382],[5,7375,7383],[5,101,7297],[5,72,7301],[5,45,1093],[4,79,0,7307],[5,7387,7388],[5,7386,7389],[5,7385,7390],[5,98,7391],[5,101,852],[5,7393,11],[5,47,7394],[5,98,7395],[5,97,7396],[5,28,135],[5,7398,852],[5,238,7399],[5,101,7400],[5,249,7343],[5,7402,7369],[5,7401,7403],[5,98,7404],[5,7397,7405],[5,7337,7406],[5,25,135],[5,78,110],[5,7408,7409],[5,306,7410],[4,23,0,902],[5,7378,7412],[5,7411,7413],[5,98,7414],[5,78,852],[5,7408,7416],[5,98,7417],[5,97,7418],[5,7419,7367],[5,78,11],[5,101,7421],[5,9,11],[5,7423,11],[5,7422,7424],[5,98,7425],[5,7368,7418],[5,78,7376],[5,199,7428],[5,98,7429],[5,101,7417],[5,7431,7366],[5,98,7432],[5,78,7339],[5,101,7434],[5,78,135],[5,28,7436],[5,30,7436],[5,7338,26],[4,178,0,7439],[5,7438,7440],[5,7437,7441],[5,7435,7442],[5,98,7443],[5,336,852],[5,78,7445],[5,101,7446],[5,249,7436],[5,7448,7416],[5,7447,7449],[5,98,7450],[5,29,110],[5,7408,7452],[5,306,7453],[5,7408,26],[4,79,0,7455],[5,1250,7456],[5,7454,7457],[5,98,7458],[5,249,7376],[5,7460,1093],[5,101,7461],[5,7462,11],[5,101,7463],[5,249,26],[5,7465,1093],[5,101,7466],[5,7467,11],[4,79,0,7468],[5,7378,7469],[5,7464,7470],[5,98,7471],[5,97,7308],[5,7306,439],[5,7473,7474],[4,79,0,7475],[5,127,7476],[5,97,7477],[5,7478,439],[5,7303,7479],[5,7358,1093],[5,98,7481],[5,97,7482],[5,964,852],[5,98,7484],[5,97,7485],[5,7486,7302],[5,7483,7487],[5,73,7376],[5,7489,1093],[5,101,7490],[5,128,1093],[4,23,0,7492],[5,7378,7493],[5,7491,7494],[5,98,7495],[5,29,11],[5,101,7497],[5,7498,11],[5,98,7499],[5,29,7339],[5,101,7501],[5,28,963],[5,7503,7376],[5,7502,7504],[5,98,7505],[5,101,7452],[5,7507,11],[5,101,7508],[5,559,11],[4,48,0,7510],[5,321,7511],[5,7509,7512],[5,98,7513],[5,98,7492],[5,826,7515],[4,79,0,7516],[5,127,7517],[5,97,7518],[5,98,7490],[5,7519,7520],[5,29,7436],[5,101,7522],[5,7523,135],[5,98,7524],[5,1089,7376],[5,98,7526],[5,7361,7527],[5,101,7301],[5,855,1093],[5,7530,7388],[5,7529,7531],[5,98,7532],[5,25,7376],[5,7534,7416],[5,101,7535],[5,78,7416],[5,7408,7537],[5,7536,7538],[5,98,7539],[5,29,852],[5,7489,7541],[5,98,7542],[5,7368,7543],[5,29,7445],[5,73,7545],[5,7460,7541],[5,7546,7547],[5,98,7548],[5,29,7399],[5,101,7550],[5,28,7376],[5,7552,7541],[5,7551,7553],[5,98,7554],[5,98,972],[5,97,7556],[5,101,7339],[5,7558,135],[5,98,7559],[5,7557,7560],[5,9,1384],[5,7562,1093],[5,7338,7563],[5,101,7564],[5,7338,1093],[5,7562,7566],[5,7565,7567],[5,98,7568],[5,646,7339],[5,98,7570],[5,97,7571],[5,1004,963],[5,98,7573],[5,97,7574],[5,7575,439],[5,97,7576],[5,870,439],[5,97,7578],[5,7579,439],[5,7577,7580],[5,7572,7581],[5,7562,852],[5,7558,7583],[5,101,7584],[5,964,7583],[5,72,7586],[5,199,7583],[5,72,7588],[5,1385,7339],[5,72,7590],[5,1089,7339],[5,7591,7592],[5,7589,7593],[5,7587,7594],[5,7585,7595],[5,98,7596],[5,7558,110],[5,101,7598],[5,964,110],[5,72,7600],[5,199,110],[5,72,7602],[5,111,7339],[5,7603,7604],[5,7601,7605],[5,7599,7606],[5,98,7607],[5,47,7573],[5,98,7609],[5,97,7610],[5,7611,869],[5,97,7612],[5,7613,7571],[5,7338,1098],[5,101,7615],[5,7338,852],[5,249,7617],[5,7618,7566],[5,7616,7619],[5,98,7620],[5,73,7339],[5,7622,852],[5,98,7623],[5,97,7624],[5,7368,439],[5,7486,7626],[5,97,7627],[5,7628,439],[5,7625,7629],[5,7368,7624],[5,7486,7631],[5,101,7623],[5,72,7484],[5,7634,7366],[5,7633,7635],[5,98,7636],[5,7338,7339],[5,101,7638],[5,7639,7339],[5,98,7640],[5,28,852],[5,7642,1093],[5,7338,7643],[5,101,7644],[5,28,7617],[5,7646,7566],[5,7645,7647],[5,98,7648],[5,0,7339],[0,179,2],[5,7651,963],[5,7652,963],[5,28,7653],[5,7654,135],[5,7650,7655],[5,101,7570],[5,477,7573],[5,7658,868],[5,7657,7659],[5,98,7660],[5,98,853],[5,97,7662],[5,7663,5962],[4,23,0,7664],[5,127,7665],[5,97,7666],[5,7378,5966],[5,101,7668],[5,45,852],[5,7670,5969],[5,7669,7671],[5,98,7672],[5,7667,7673],[5,6385,7674],[5,98,7668],[5,97,7676],[5,47,868],[5,98,7678],[5,97,7679],[5,7680,1285],[5,97,7681],[5,493,645],[5,98,7683],[5,97,7684],[5,7685,1285],[5,97,7686],[5,7687,1285],[5,7682,7688],[5,7677,7689],[5,826,4839],[4,23,0,7691],[5,127,7692],[5,97,7693],[5,7694,7676],[5,45,7445],[5,7696,5966],[5,101,7697],[5,81,853],[5,7699,2142],[4,23,0,7700],[5,7378,7701],[5,7698,7702],[5,98,7703],[5,1120,7668],[5,98,7705],[5,1385,852],[5,98,7707],[5,97,7708],[5,7709,7039],[5,1092,7710],[5,7677,7711],[4,23,0,438],[5,7378,7713],[5,101,7714],[4,23,0,824],[5,703,7716],[5,81,7717],[5,7718,438],[5,7715,7719],[5,98,7720],[5,45,7399],[5,7722,5966],[5,101,7723],[5,72,7668],[5,7670,5966],[5,7725,7726],[5,7724,7727],[5,98,7728],[5,7378,493],[5,0,7730],[5,81,824],[5,7732,2142],[4,23,0,7733],[5,6402,7734],[5,7731,7735],[5,81,682],[5,7737,2142],[4,14,0,7738],[5,6402,7739],[5,98,7740],[5,97,7741],[4,14,0,2142],[5,1249,7743],[5,98,7744],[5,7742,7745],[5,384,135],[5,7747,5966],[5,101,7748],[5,384,852],[5,7750,5969],[5,7749,7751],[5,98,7752],[5,7667,7753],[5,6385,7754],[5,25,5753],[5,7756,135],[5,98,7757],[5,97,7758],[5,493,7748],[5,98,7760],[5,5976,7761],[5,7759,7762],[5,855,135],[5,7764,5966],[5,98,7765],[5,97,7766],[5,98,5960],[5,4840,7768],[5,826,7769],[4,23,0,7770],[5,127,7771],[5,97,7772],[5,5959,7748],[5,98,7774],[5,7773,7775],[5,7767,7776],[5,7767,7761],[5,25,7748],[5,7779,135],[5,98,7780],[5,5976,7781],[5,7759,7782],[5,7767,7781],[5,7747,493],[5,0,7785],[5,72,824],[5,7787,2142],[4,23,0,7788],[5,24,7789],[5,7786,7790],[5,47,2142],[4,23,0,7792],[5,7378,7793],[5,98,7794],[5,97,7795],[5,7796,2181],[5,97,7797],[5,7557,7766],[5,7798,7799],[5,101,7765],[5,855,852],[5,7802,5969],[5,7801,7803],[5,98,7804],[5,7667,7805],[5,6385,7806],[5,4840,1285],[5,826,7808],[4,23,0,7809],[5,127,7810],[5,97,7811],[5,7812,1285],[5,7767,7813],[5,7685,7766],[5,870,7815],[5,1120,7765],[5,98,7817],[5,7764,7713],[5,101,7819],[5,72,7717],[5,7821,438],[5,7820,7822],[5,98,7823],[5,7764,493],[5,0,7825],[5,703,7789],[5,7826,7827],[5,855,7445],[5,7829,5966],[5,101,7830],[5,72,853],[5,7832,2142],[4,23,0,7833],[5,7764,7834],[5,7831,7835],[5,98,7836],[5,855,7399],[5,7838,5966],[5,101,7839],[5,477,7765],[5,7802,5966],[5,7841,7842],[5,7840,7843],[5,98,7844],[4,23,0,5977],[5,7764,7846],[5,101,7847],[5,7848,972],[5,98,7849],[5,1463,26],[4,23,0,7851],[5,7764,7852],[5,101,7853],[5,7854,972],[5,98,7855],[5,72,5977],[5,7857,2142],[4,23,0,7858],[5,7764,7859],[5,101,7860],[5,72,972],[5,7862,2180],[5,7861,7863],[5,98,7864],[5,72,7851],[5,7866,2142],[4,23,0,7867],[5,7764,7868],[5,101,7869],[5,7870,7863],[5,98,7871],[5,81,5977],[5,7873,2142],[4,23,0,7874],[5,7378,7875],[5,101,7876],[5,81,972],[5,7878,2180],[5,7877,7879],[5,98,7880],[5,81,7851],[5,7882,2142],[4,23,0,7883],[5,7378,7884],[5,101,7885],[5,7886,7879],[5,98,7887],[5,72,2142],[5,7889,5960],[4,23,0,7890],[5,7378,7891],[5,101,7892],[5,7378,5969],[5,7725,7894],[5,7893,7895],[5,98,7896],[5,477,2142],[5,7898,5960],[4,23,0,7899],[5,7764,7900],[5,101,7901],[5,7764,5969],[5,7841,7903],[5,7902,7904],[5,98,7905],[5,455,7668],[5,101,7907],[5,7908,7668],[5,98,7909],[5,455,7765],[5,101,7911],[5,7912,7765],[5,98,7913],[5,455,868],[5,101,7915],[5,7916,868],[5,98,7917],[5,455,7366],[5,101,7919],[5,7920,7366],[5,98,7921],[0,180,2],[5,7923,135],[5,7924,852],[5,455,7925],[5,101,7926],[5,7927,7925],[5,98,7928],[5,870,7684],[5,7677,7930],[5,30,7399],[5,7932,693],[5,101,7933],[5,30,135],[5,7935,693],[5,28,7936],[5,30,852],[5,7938,693],[5,7937,7939],[5,7934,7940],[5,98,7941],[5,182,7399],[5,7943,5966],[5,101,7944],[5,182,135],[5,7946,5966],[5,28,7947],[5,182,852],[5,7949,5966],[5,7948,7950],[5,7945,7951],[5,98,7952],[5,182,7445],[5,7954,5966],[5,101,7955],[5,249,7947],[5,7957,7950],[5,7956,7958],[5,98,7959],[5,182,1123],[5,7961,5966],[5,101,7962],[5,596,7947],[5,7964,7950],[5,7963,7965],[5,98,7966],[5,30,11],[5,7968,300],[5,101,7969],[5,7970,11],[5,98,7971],[5,182,11],[5,7973,493],[5,101,7974],[5,7975,11],[5,98,7976],[5,7946,7713],[5,101,7978],[5,6007,135],[5,7980,11],[5,7979,7981],[5,98,7982],[5,30,7339],[5,7984,693],[5,101,7985],[5,300,963],[5,9,7987],[5,7988,7936],[5,7986,7989],[5,98,7990],[5,182,7339],[5,7992,5966],[5,101,7993],[5,7,2180],[5,7338,7947],[5,7995,7996],[5,7997,7947],[5,7994,7998],[5,98,7999],[4,63,0,88],[5,7935,8001],[5,30,8002],[5,8003,693],[5,101,8004],[5,300,88],[4,63,0,8006],[5,7935,8007],[5,8005,8008],[5,98,8009],[4,63,0,2142],[5,7946,8011],[5,182,8012],[5,8013,5969],[5,101,8014],[5,7946,7891],[5,8015,8016],[5,98,8017],[4,63,0,5960],[5,7949,8019],[5,27,8020],[4,23,0,8021],[5,7946,8022],[5,101,8023],[5,7954,5969],[5,8024,8025],[5,98,8026],[4,63,0,685],[5,7938,8028],[5,27,8029],[4,23,0,8030],[5,7946,8031],[5,101,8032],[5,249,8029],[5,8034,135],[5,8033,8035],[5,98,8036],[5,7935,1240],[5,101,8038],[5,7,7334],[5,8040,11],[5,8041,12],[5,8039,8042],[5,98,8043],[5,6007,963],[5,8045,1384],[5,25,8046],[5,8047,110],[5,101,8048],[5,6215,7600],[5,477,8050],[5,1385,110],[5,6776,8052],[5,8051,8053],[5,8049,8054],[5,98,8055],[5,98,8048],[5,97,8057],[5,98,7600],[5,97,8059],[5,8060,1285],[5,5768,8061],[5,97,8062],[5,98,8052],[5,97,8064],[5,8065,1285],[5,2347,8066],[5,97,8067],[5,8068,1285],[5,8063,8069],[5,8058,8070],[5,5768,8059],[5,97,8072],[5,2347,8064],[5,97,8074],[5,8075,8057],[5,8073,8076],[5,7980,852],[5,73,8078],[5,8079,110],[5,101,8080],[5,6215,7602],[5,477,8082],[5,1089,110],[5,6776,8084],[5,8083,8085],[5,8081,8086],[5,98,8087],[5,964,11],[5,98,8089],[5,97,8090],[5,8091,5646],[5,25,11],[5,8093,7416],[5,98,8094],[5,596,11],[5,8096,135],[5,101,8097],[5,8098,11],[5,98,8099],[5,73,11],[5,8101,135],[5,98,8102],[5,98,7334],[5,97,8104],[5,8105,7679],[5,47,8089],[5,98,8107],[5,47,824],[4,23,0,8109],[5,6402,8110],[5,98,8111],[5,97,8112],[5,8113,8104],[5,27,963],[5,47,8115],[4,23,0,8116],[5,6402,8117],[5,98,8118],[5,97,8119],[5,787,963],[5,98,8121],[5,8120,8122],[5,101,7334],[5,8124,8111],[5,98,8125],[5,787,135],[5,101,8127],[5,8128,8111],[5,98,8129],[5,7618,1093],[5,101,8131],[5,964,1093],[5,7,8133],[5,8134,7615],[5,8135,1098],[5,8132,8136],[5,98,8137],[5,249,1093],[5,8139,7617],[5,101,8140],[5,8139,852],[5,7338,8142],[5,8134,8143],[5,8144,8142],[5,8141,8145],[5,98,8146],[5,7646,1093],[5,101,8148],[5,8149,7644],[5,98,8150],[5,28,1093],[5,8152,7617],[5,101,8153],[5,8152,852],[5,7338,8155],[5,8154,8156],[5,98,8157],[5,596,7617],[5,8159,1093],[5,101,8160],[5,8134,1110],[5,7338,1110],[5,8162,8163],[5,8161,8164],[5,98,8165],[5,678,7339],[5,101,8167],[5,8168,7606],[5,98,8169],[5,7408,852],[5,47,8171],[5,98,8172],[5,6385,8173],[5,306,6383],[5,306,824],[5,8176,853],[4,23,0,8177],[5,6402,8178],[5,8175,8179],[5,98,8180],[5,477,7334],[4,63,0,8109],[5,4448,8183],[4,23,0,8184],[5,7764,8185],[5,8182,8186],[5,98,8187],[5,964,1384],[5,98,8189],[5,97,8190],[5,1385,963],[5,98,8192],[5,2347,8193],[5,97,8194],[5,8195,439],[5,8191,8196],[5,6007,110],[5,8198,244],[5,964,8199],[5,101,8200],[5,964,244],[5,6776,8202],[5,8051,8203],[5,8201,8204],[5,98,8205],[5,1390,8078],[5,98,8207],[5,97,8208],[5,1390,135],[5,98,8210],[5,97,8211],[5,8212,1285],[5,5768,8213],[5,97,8214],[5,1390,852],[5,98,8216],[5,97,8217],[5,8218,1285],[5,2347,8219],[5,97,8220],[5,8221,1285],[5,8215,8222],[5,8209,8223],[5,5768,8211],[5,97,8225],[5,2347,8217],[5,97,8227],[5,8228,8208],[5,8226,8229],[5,964,963],[5,98,8231],[5,97,8232],[5,8233,439],[5,1120,868],[5,98,8235],[5,1463,135],[5,47,8237],[5,98,8238],[5,7557,8239],[0,181,0],[5,8093,8241],[5,72,8242],[5,45,8241],[5,9,26],[5,8245,11],[5,28,8246],[5,8247,26],[5,25,8248],[5,8249,8241],[4,23,0,8250],[5,8244,8251],[5,8243,8252],[5,98,8253],[5,249,7445],[5,8255,1093],[5,101,8256],[5,336,1098],[5,8257,8258],[5,98,8259],[5,101,7445],[5,957,135],[5,8261,8262],[5,98,8263],[5,101,8258],[5,336,1093],[5,957,8266],[5,8265,8267],[5,98,8268],[5,336,7445],[5,101,8270],[5,8271,7445],[5,98,8272],[5,336,135],[5,101,8274],[5,8275,135],[5,98,8276],[5,1390,7445],[5,98,8278],[5,97,8279],[5,8280,8211],[5,8280,8217],[5,8218,439],[5,8212,8283],[5,97,8284],[5,8285,439],[5,8280,8286],[5,336,11],[5,101,8288],[5,8289,11],[5,98,8290],[5,249,11],[5,8292,135],[5,101,8293],[5,8294,11],[5,98,8295],[5,1094,852],[5,98,8297],[5,97,8298],[5,1094,7445],[5,98,8300],[5,8299,8301],[5,1097,8302],[5,8218,8279],[5,8212,8304],[5,7402,852],[5,73,8306],[5,7465,852],[4,82,0,8308],[5,7935,8309],[5,238,8310],[5,8307,8311],[5,98,8312],[5,73,7445],[5,8314,135],[5,98,8315],[5,8314,852],[5,98,8317],[5,249,1123],[5,8319,1093],[5,101,8320],[5,596,8266],[5,8322,852],[5,8321,8323],[5,98,8324],[5,8139,1123],[5,101,8326],[5,8139,135],[5,596,8328],[5,8329,852],[5,8327,8330],[5,98,8331],[5,101,8300],[5,72,1095],[5,8334,8297],[5,8333,8335],[5,98,8336],[5,957,7947],[5,101,8338],[5,182,8262],[5,8340,5966],[5,8339,8341],[5,98,8342],[5,7460,852],[5,101,8344],[5,29,8310],[5,8345,8346],[5,98,8347],[5,336,7643],[5,101,8349],[5,28,7445],[5,8351,8266],[5,8350,8352],[5,98,8353],[5,0,7445],[4,23,0,853],[5,7946,8356],[5,8355,8357],[5,101,8278],[5,72,8210],[5,8360,8216],[5,8359,8361],[5,98,8362],[5,101,278],[5,8364,11],[5,101,8365],[5,72,779],[5,8367,783],[5,8366,8368],[5,98,8369],[5,787,278],[5,101,8371],[5,8372,8368],[5,98,8373],[5,101,251],[5,8375,11],[5,101,8376],[5,47,682],[4,23,0,8378],[5,321,8379],[5,8377,8380],[5,98,8381],[5,787,251],[5,101,8383],[5,8384,8380],[5,98,8385],[5,101,1123],[5,8387,11],[5,101,8388],[5,8389,7366],[5,98,8390],[5,787,1123],[5,101,8392],[5,8393,7366],[5,98,8394],[5,182,110],[5,8396,493],[5,101,8397],[5,8398,11],[5,101,8399],[5,321,7793],[5,8400,8401],[5,98,8402],[5,787,8397],[5,101,8404],[5,8405,8401],[5,98,8406],[5,30,110],[5,8408,300],[5,101,8409],[5,8410,11],[5,101,8411],[5,8412,779],[5,98,8413],[5,787,8409],[5,101,8415],[5,8416,779],[5,98,8417],[5,7338,110],[5,101,8419],[5,8420,11],[5,101,8421],[5,8422,2245],[5,98,8423],[5,787,8419],[5,101,8425],[5,8426,2245],[5,98,8427],[5,101,7409],[5,8429,11],[5,101,8430],[5,8431,2245],[5,98,8432],[5,787,7409],[5,101,8434],[5,8435,2245],[5,98,8436],[5,7889,1284],[4,23,0,8438],[5,7378,8439],[5,101,8440],[5,8182,1284],[5,7725,8442],[5,8441,8443],[5,98,8444],[5,6215,5960],[4,23,0,8446],[5,7378,8447],[5,101,8448],[5,8182,438],[5,72,8450],[5,8451,7894],[5,8449,8452],[5,98,8453],[5,7898,1284],[4,23,0,8455],[5,7378,8456],[5,101,8457],[5,477,7668],[5,8459,1284],[5,8458,8460],[5,98,8461],[5,6307,5960],[4,23,0,8463],[5,7378,8464],[5,101,8465],[5,6307,7894],[5,8466,8467],[5,98,8468],[5,6409,1284],[4,23,0,8470],[5,7378,8471],[5,101,8472],[5,81,7765],[5,8474,1284],[5,8473,8475],[5,98,8476],[5,5922,5960],[4,23,0,8478],[5,7378,8479],[5,101,8480],[5,5922,7894],[5,8481,8482],[5,98,8483],[5,47,7668],[5,101,8485],[5,7764,7793],[5,8486,8487],[5,98,8488],[5,45,7339],[5,8490,5966],[5,101,8491],[5,72,2180],[5,8493,7668],[5,8492,8494],[5,98,8495],[5,45,7376],[5,8497,5966],[5,101,8498],[5,4448,5966],[4,79,0,8500],[5,7378,8501],[5,8499,8502],[5,98,8503],[5,7935,8028],[5,45,8505],[5,8506,5966],[5,101,8507],[5,493,685],[4,63,0,8509],[5,7378,8510],[5,8508,8511],[5,98,8512],[5,45,8012],[5,8514,5969],[5,101,8515],[5,6409,5960],[4,63,0,8517],[5,7378,8518],[5,8516,8519],[5,98,8520],[5,7764,8439],[5,101,8522],[5,72,7765],[5,8524,1284],[5,8523,8525],[5,98,8526],[5,7764,8447],[5,101,8528],[5,6215,7903],[5,8529,8530],[5,98,8531],[5,7764,8456],[5,101,8533],[5,72,7335],[5,8535,1284],[5,7841,8536],[5,8534,8537],[5,98,8538],[5,7764,8464],[5,101,8540],[5,8535,438],[5,477,8542],[5,8543,7903],[5,8541,8544],[5,98,8545],[5,7764,8471],[5,101,8547],[5,81,7668],[5,8549,8536],[5,8548,8550],[5,98,8551],[5,7764,8479],[5,101,8553],[5,81,8450],[5,8555,7903],[5,8554,8556],[5,98,8557],[5,855,7339],[5,8559,5966],[5,101,8560],[5,477,2180],[5,8562,7765],[5,8561,8563],[5,98,8564],[5,47,7765],[5,101,8566],[5,8567,7794],[5,98,8568],[5,855,7376],[5,8570,5966],[5,101,8571],[5,855,26],[5,8573,5966],[4,79,0,8574],[5,7764,8575],[5,8572,8576],[5,98,8577],[5,8408,8028],[5,855,8579],[5,8580,5966],[5,101,8581],[5,1250,8510],[5,8582,8583],[5,98,8584],[5,8396,8011],[5,855,8586],[5,8587,5969],[5,101,8588],[4,63,0,7890],[5,1250,8590],[5,8589,8591],[5,98,8592],[5,101,7335],[5,8594,7717],[5,98,8595],[5,47,8127],[5,101,8597],[5,8598,7717],[5,98,8599],[5,8124,2245],[5,101,8601],[5,8602,7717],[5,98,8603],[5,8128,2245],[5,101,8605],[5,8606,7717],[5,98,8607],[5,826,439],[4,23,0,8609],[5,127,8610],[5,97,8611],[5,8612,439],[5,7337,8613],[5,7557,7336],[5,47,972],[5,98,8616],[5,97,8617],[5,101,972],[5,8619,2245],[5,98,8620],[5,8618,8621],[5,47,7366],[5,101,8623],[5,47,853],[4,23,0,8625],[5,7764,8626],[5,8624,8627],[5,98,8628],[5,98,8623],[5,97,8630],[5,98,8625],[5,97,8632],[5,8633,439],[5,826,8634],[4,23,0,8635],[5,127,8636],[5,97,8637],[5,8638,439],[5,8631,8639],[5,47,7484],[5,98,8641],[5,97,8642],[5,8643,8630],[5,7557,8644],[5,7669,2245],[5,101,8646],[5,8647,8487],[5,98,8648],[5,7801,2245],[5,101,8650],[5,8651,7794],[5,98,8652],[5,1120,7925],[5,98,8654],[5,7923,110],[5,8656,244],[5,0,8657],[5,72,262],[5,47,679],[5,8659,8660],[5,8658,8661],[5,98,8657],[5,97,8663],[5,98,8660],[5,97,8665],[5,8666,5652],[5,264,8667],[5,97,8668],[5,8669,5652],[5,8664,8670],[5,8666,8663],[5,264,8672],[5,7368,8217],[5,8212,8674],[5,47,8216],[5,98,8676],[5,97,8677],[5,47,8210],[5,98,8679],[5,7368,8680],[5,8678,8681],[5,7408,7436],[5,98,8683],[5,1092,6384],[5,7368,8685],[5,6385,7367],[5,6385,1091],[5,97,8680],[5,8678,439],[5,8689,8690],[5,97,8691],[5,8692,439],[5,8285,8693],[5,6385,8694],[5,826,7662],[4,23,0,8696],[5,127,8697],[5,97,8698],[5,7663,825],[4,23,0,8700],[5,127,8701],[5,97,8702],[5,8703,6384],[5,8699,8704],[5,101,6383],[5,8706,8179],[5,98,8707],[5,368,8409],[5,306,8709],[5,72,902],[5,829,685],[5,8711,8712],[4,23,0,8713],[5,703,8714],[5,8710,8715],[5,98,8716],[5,8408,693],[5,964,8718],[5,98,8719],[5,97,8720],[5,686,963],[5,98,8722],[5,97,8723],[5,8724,439],[5,904,8725],[4,23,0,8726],[5,127,8727],[5,97,8728],[5,8729,439],[5,8721,8730],[5,855,244],[5,300,82],[5,101,8733],[5,8734,88],[4,63,0,8735],[5,8732,8736],[5,98,8737],[5,904,8738],[4,23,0,8739],[5,127,8740],[5,97,8741],[5,101,86],[5,8743,685],[4,23,0,8744],[5,1250,8745],[5,98,8746],[5,684,8747],[4,63,0,8748],[5,127,8749],[5,97,8750],[5,101,8718],[5,30,244],[5,8753,8001],[5,8752,8754],[5,98,8755],[5,8751,8756],[5,8742,8757],[5,1463,685],[4,23,0,8759],[5,1250,8760],[5,98,8761],[5,97,8762],[5,8763,8720],[5,692,8756],[5,681,8765],[5,300,645],[5,1463,8767],[5,98,8768],[5,97,8769],[5,758,8720],[5,8770,8771],[5,101,8719],[5,8773,8761],[5,98,8774],[4,23,0,26],[5,8408,8776],[5,101,8777],[5,8778,110],[5,98,8779],[5,1034,7617],[5,101,8781],[5,596,1123],[5,7338,11],[5,8783,8784],[5,8782,8785],[5,98,8786],[5,1390,1123],[5,98,8788],[5,97,8789],[5,8790,8211],[5,8790,8677],[5,8261,11],[5,98,8793],[5,97,8794],[5,8387,135],[5,98,8796],[5,8795,8797],[5,8212,8690],[5,97,8799],[5,8800,439],[5,8790,8801],[5,8678,8789],[5,8212,8803],[5,596,7343],[5,8805,852],[5,101,8806],[5,596,26],[5,8808,852],[4,82,0,8809],[5,7935,8810],[5,238,8811],[5,8807,8812],[5,98,8813],[5,1109,7343],[5,101,8815],[5,1109,26],[4,82,0,8817],[5,7935,8818],[5,29,8819],[5,8816,8820],[5,98,8821],[5,7337,8822],[5,596,7445],[5,8824,1093],[5,101,8825],[5,336,1110],[5,8826,8827],[5,98,8828],[5,1034,1098],[5,101,8830],[5,28,1123],[5,1034,1093],[5,8832,8833],[5,8831,8834],[5,98,8835],[5,1034,135],[5,101,8837],[5,8838,11],[5,98,8839],[5,73,1123],[5,8841,135],[5,98,8842],[5,596,7376],[5,8844,852],[5,101,8845],[5,29,8811],[5,8846,8847],[5,98,8848],[5,596,7399],[5,8850,1093],[5,101,8851],[5,28,8833],[5,8853,1110],[5,8852,8854],[5,98,8855],[5,1034,7643],[5,101,8857],[5,8319,8833],[5,8858,8859],[5,98,8860],[5,0,1123],[5,7946,8626],[5,8862,8863],[5,101,8788],[5,8360,8676],[5,8865,8866],[5,98,8867],[5,964,8784],[5,98,8869],[5,7562,11],[5,964,8871],[5,101,8872],[5,8873,1858],[5,98,8874],[5,98,7592],[5,97,8876],[5,1092,439],[5,97,8878],[5,97,137],[5,7393,7439],[5,98,8881],[5,97,8882],[5,8883,439],[5,8880,8884],[4,82,0,8885],[5,127,8886],[5,97,8887],[5,8888,439],[5,8879,8889],[5,8877,8890],[5,101,7592],[5,477,1090],[5,855,7436],[4,82,0,8881],[5,8894,8895],[5,8893,8896],[5,8892,8897],[5,98,8898],[5,8689,439],[5,97,8900],[5,97,8283],[5,8902,439],[5,8901,8903],[5,7368,8904],[5,199,8199],[5,101,8906],[5,199,244],[5,6776,8908],[5,8083,8909],[5,8907,8910],[5,98,8911],[5,8212,8217],[5,7368,8913],[5,97,8696],[5,8915,439],[4,23,0,8916],[5,127,8917],[5,97,8918],[5,8919,439],[5,7368,8920],[5,199,11],[5,101,8922],[5,8923,7334],[5,98,8924],[5,8699,7367],[5,101,7354],[4,79,0,7348],[5,7378,8928],[5,8927,8929],[5,98,8930],[5,7337,8931],[5,1120,7366],[5,98,8933],[5,8678,8680],[5,7368,8935],[5,368,8397],[5,306,8937],[5,368,110],[5,72,8939],[5,493,367],[5,8940,8941],[5,8938,8942],[5,98,8943],[5,101,8016],[5,7946,5969],[5,7957,8946],[5,8945,8947],[5,98,8948],[5,8396,5966],[5,964,8950],[5,98,8951],[5,97,8952],[5,8953,8059],[5,8953,2181],[5,7946,7900],[5,101,8956],[5,7948,8946],[5,8957,8958],[5,98,8959],[5,7037,1285],[5,8060,8961],[5,97,8962],[5,8963,1285],[5,8953,8964],[5,4840,683],[5,904,8966],[4,23,0,8967],[5,127,8968],[5,97,8969],[5,904,7769],[4,23,0,8971],[5,127,8972],[5,97,8973],[5,97,7768],[5,8975,903],[5,684,8976],[4,63,0,8977],[5,127,8978],[5,97,8979],[5,8975,4839],[5,684,8981],[4,63,0,8982],[5,127,8983],[5,97,8984],[5,101,8950],[5,182,244],[5,8987,8019],[5,8986,8988],[5,98,8989],[5,8985,8990],[5,8980,8991],[5,8974,8992],[5,8970,8993],[5,7037,8952],[5,8060,8995],[5,7957,852],[5,101,8997],[5,8998,7955],[5,98,8999],[5,684,5962],[4,23,0,9001],[5,127,9002],[5,97,9003],[5,9004,8990],[5,681,9005],[5,101,8951],[5,7601,2180],[5,9007,9008],[5,98,9009],[5,199,135],[5,98,9011],[5,101,8142],[5,9013,11],[5,98,9014],[5,97,9015],[5,1094,1123],[5,98,9017],[5,9016,9018],[5,1097,9019],[5,1089,1093],[5,98,9021],[5,97,9022],[5,199,1093],[5,98,9024],[5,9023,9025],[5,7368,9026],[5,73,7399],[5,9028,1093],[5,101,9029],[5,72,9024],[5,9031,9021],[5,9030,9032],[5,98,9033],[5,0,7366],[5,7378,8356],[5,9035,9036],[5,1385,135],[5,98,9038],[5,97,9039],[5,1923,7556],[5,9040,9041],[5,9040,7556],[5,1923,9043],[5,6385,7556],[5,7486,9045],[5,7486,7556],[5,6385,9047],[5,28,7399],[5,9049,1093],[5,101,9050],[5,7398,7643],[5,9051,9052],[5,98,9053],[5,101,7399],[5,7642,135],[5,9055,9056],[5,98,9057],[5,101,9052],[5,7398,1093],[5,7642,9060],[5,9059,9061],[5,98,9062],[5,7398,7399],[5,101,9064],[5,9065,7399],[5,98,9066],[5,7398,135],[5,101,9068],[5,9069,135],[5,98,9070],[5,8678,8211],[5,97,9072],[5,1390,7399],[5,98,9074],[5,9073,9075],[5,646,7399],[5,98,9077],[5,97,9078],[5,646,852],[5,98,9080],[5,97,9081],[5,9082,439],[5,97,9083],[5,9084,439],[5,7579,9085],[5,9079,9086],[5,7398,11],[5,101,9088],[5,9089,135],[5,98,9090],[5,28,11],[5,9092,135],[5,101,9093],[5,9094,135],[5,98,9095],[5,964,7399],[5,98,9097],[5,7557,9098],[5,7486,9098],[5,28,7343],[5,9101,852],[5,101,9102],[5,28,26],[5,9104,852],[4,82,0,9105],[5,7935,9106],[5,238,9107],[5,9103,9108],[5,98,9109],[5,7337,9110],[5,7398,1098],[5,101,9112],[5,249,7399],[5,9114,9060],[5,9113,9115],[5,98,9116],[5,97,9025],[5,98,9029],[5,9023,9119],[5,9118,9120],[5,7437,7416],[5,73,9122],[5,78,7399],[5,9123,9124],[5,98,9125],[5,8832,1093],[5,101,9127],[5,596,9060],[5,9129,8827],[5,9128,9130],[5,98,9131],[5,8152,1123],[5,101,9133],[5,8152,135],[5,596,9135],[5,9136,8827],[5,9134,9137],[5,98,9138],[5,1109,135],[5,7398,9140],[5,101,9141],[5,9142,7399],[5,98,9143],[5,199,7399],[5,98,9145],[5,1089,7399],[5,98,9147],[5,0,7399],[5,7651,135],[5,9150,852],[5,29,9151],[5,9149,9152],[5,101,9074],[5,477,8210],[5,9155,8216],[5,9154,9156],[5,98,9157],[5,7652,1384],[5,646,9159],[5,98,9160],[5,97,9161],[5,1004,1384],[5,98,9163],[5,97,9164],[5,9165,439],[5,97,9166],[5,9167,439],[5,7577,9168],[5,9162,9169],[5,964,9159],[5,98,9171],[5,1385,9159],[5,98,9173],[5,0,9159],[5,78,7421],[5,30,9176],[5,7,7510],[5,9178,963],[5,9179,1384],[4,23,0,9180],[5,9177,9181],[5,9175,9182],[5,1390,9159],[5,101,9184],[5,1738,963],[5,477,9186],[5,1738,1384],[5,9187,9188],[5,9185,9189],[5,98,9190],[0,182,0],[5,0,9192],[0,183,24],[0,184,2],[0,185,0],[5,9195,9196],[5,9197,9196],[5,9194,9198],[0,186,2],[5,9200,82],[5,9201,26],[4,97,0,9202],[4,81,0,9203],[5,9199,9204],[5,9193,9205],[5,0,9196],[5,9,1490],[5,9,5377],[5,1331,5377],[5,9,9210],[5,1331,9210],[5,9,9212],[5,1331,9212],[5,9,9214],[5,1331,9214],[5,9,9216],[5,1331,9216],[5,9,9218],[5,1331,9218],[5,9,9220],[5,1331,9220],[5,9,9222],[5,1331,9222],[5,9,9224],[5,1331,9224],[5,9,9226],[5,1331,9226],[5,9,9228],[5,1331,9228],[5,9,9230],[5,1331,9230],[5,9,9232],[5,1331,9232],[5,9,9234],[5,9235,11],[5,9233,9236],[5,9231,9237],[5,9229,9238],[5,9227,9239],[5,9225,9240],[5,9223,9241],[5,9221,9242],[5,9219,9243],[5,9217,9244],[5,9215,9245],[5,9213,9246],[5,9211,9247],[5,9209,9248],[5,9208,9249],[5,5050,9250],[5,9207,9251],[0,187,0],[5,0,9253],[0,188,1],[5,9255,9192],[5,9254,9256],[5,9200,963],[5,9258,1384],[5,101,9259],[5,9200,1389],[5,9261,1188],[5,9260,9262],[5,101,9263],[5,72,7079],[5,1457,1188],[5,9265,9266],[5,9264,9267],[5,98,9268],[5,0,9259],[0,189,2],[0,190,0],[5,9271,9272],[5,9273,963],[5,9271,9274],[5,9275,1384],[5,9270,9276],[5,1390,9192],[5,101,9278],[5,855,9196],[5,1738,9202],[4,97,0,9281],[5,9280,9282],[4,81,0,9283],[5,9280,9284],[5,9279,9285],[5,98,9286],[2,191,0,0],[5,9271,9288],[5,9289,4],[5,0,9290],[0,192,1],[5,9292,9288],[5,1331,9293],[5,3019,9294],[5,298,9295],[5,559,9294],[5,7,9297],[5,9298,4],[5,34,9288],[5,9300,26],[5,9299,9301],[4,89,0,9302],[5,9296,9303],[5,9291,9304],[0,193,1],[5,9306,9288],[5,98,9307],[5,97,9308],[5,31,9288],[5,101,9310],[5,3019,9293],[5,9311,9312],[5,98,9313],[5,9309,9314],[5,25,9288],[5,9255,110],[5,9316,9317],[5,98,9318],[5,97,9319],[5,9320,9314],[0,194,2],[2,195,0,0],[5,9322,9323],[2,196,0,0],[5,9324,9325],[5,308,9326],[5,98,9327],[5,97,9328],[5,332,9323],[5,31,9323],[5,9330,9331],[5,309,9332],[5,332,9325],[5,31,9325],[5,9334,9335],[5,29,9336],[5,9333,9337],[5,308,9338],[5,98,9339],[5,97,9340],[5,45,9331],[5,34,9323],[5,9343,26],[5,322,9344],[5,25,9345],[5,34,9325],[5,9347,26],[5,9346,9348],[4,29,0,9349],[5,9342,9350],[5,98,9351],[5,97,9352],[5,9353,439],[5,9341,9354],[5,97,9355],[5,9356,439],[5,9329,9357],[5,318,9332],[5,98,9359],[5,97,9360],[5,101,9335],[5,9362,9331],[5,98,9363],[5,97,9364],[5,9353,9328],[5,9365,9366],[5,9361,9367],[5,473,9368],[5,0,9326],[5,182,9338],[5,719,9344],[5,25,9372],[5,9373,9348],[4,29,0,9374],[5,9342,9375],[4,36,0,9376],[5,9371,9377],[5,9370,9378],[5,25,2],[0,197,1],[5,9381,110],[5,9380,9382],[5,98,9383],[5,97,9384],[5,101,2],[5,9273,26],[5,9271,9387],[5,9388,26],[5,9386,9389],[5,8711,9390],[5,98,9391],[5,97,9392],[5,9393,439],[4,23,0,9394],[5,127,9395],[5,97,9396],[5,9397,439],[5,9385,9398],[5,9273,645],[5,9271,9400],[5,9401,645],[5,25,9402],[5,9403,9382],[5,98,9404],[5,758,9405],[5,9386,9402],[5,98,9407],[5,97,9408],[5,9409,9384],[5,758,9410],[5,73,2786],[5,9195,135],[5,9413,852],[5,9412,9414],[5,98,9415],[5,97,9416],[0,198,2],[5,9381,852],[5,9418,9419],[5,9420,2786],[5,101,9421],[5,9422,2786],[5,98,9423],[5,9417,9424],[5,9381,135],[5,0,9426],[4,23,0,9389],[5,7935,9428],[5,9427,9429],[5,9381,11],[5,101,9431],[5,9432,11],[5,98,9433],[5,25,9276],[5,9435,9426],[5,98,9436],[5,7557,9437],[5,1923,9438],[5,9435,9382],[5,101,9440],[5,72,1858],[5,9442,7600],[5,9441,9443],[5,98,9444],[5,73,9382],[5,9195,110],[5,9447,110],[5,9446,9448],[5,98,9449],[5,9311,3037],[5,98,9451],[5,97,9452],[5,101,9293],[5,9454,1325],[5,98,9455],[5,1512,9456],[5,9453,9457],[5,25,9293],[5,9459,1317],[5,98,9460],[5,9309,9461],[5,1483,9293],[5,98,9463],[5,9309,9464],[5,9320,9461],[5,9320,9464],[5,0,9293],[5,3019,26],[5,9311,9469],[4,91,0,9470],[5,5353,9471],[5,9468,9472],[0,199,1],[5,9474,9288],[5,0,9475],[5,309,9312],[5,30,9312],[4,29,0,9301],[5,9478,9479],[5,29,9480],[5,9477,9481],[5,182,9482],[5,45,9312],[5,25,720],[5,9485,9301],[4,29,0,9486],[5,9484,9487],[4,36,0,9488],[5,9483,9489],[5,9476,9490],[5,9195,852],[5,9492,1093],[5,9412,9493],[5,98,9494],[5,97,9495],[5,9418,2786],[5,9497,9419],[5,101,9498],[5,9499,2786],[5,98,9500],[5,9496,9501],[5,9477,110],[5,9316,9503],[5,98,9504],[5,97,9505],[5,9459,1506],[5,98,9507],[5,97,9508],[5,9509,439],[5,9506,9510],[5,97,9511],[5,9512,439],[5,9320,9513],[5,27,9312],[5,98,9515],[5,97,9516],[5,25,9301],[5,9518,110],[5,98,9519],[5,9517,9520],[4,89,0,9521],[5,127,9522],[5,97,9523],[5,9524,9319],[5,9309,9525],[5,309,3037],[5,9527,110],[5,9316,9528],[5,98,9529],[5,97,9530],[5,1512,9319],[5,9531,9532],[5,314,9288],[5,98,9534],[5,9309,9535],[5,9320,9535],[5,9320,9308],[5,101,9317],[5,9539,11],[5,101,9540],[5,9541,2245],[5,98,9542],[5,787,9317],[5,101,9544],[5,9545,2245],[5,98,9546],[5,0,9317],[5,30,1506],[5,309,9469],[5,9550,110],[4,91,0,9551],[5,9549,9552],[5,29,9553],[5,9548,9554],[0,200,1],[5,9556,11],[5,98,9557],[5,9556,3745],[5,98,9559],[5,97,9560],[5,9401,367],[5,25,9562],[5,9563,3745],[5,98,9564],[5,97,9565],[5,9273,367],[5,9271,9567],[5,9568,645],[5,25,9569],[5,9570,3745],[5,98,9571],[5,97,9572],[5,9573,1006],[5,9566,9574],[5,9561,9575],[5,9273,82],[5,9271,9577],[5,9578,26],[5,25,9579],[5,9580,3745],[5,98,9581],[5,97,9582],[5,9388,82],[5,25,9584],[5,9585,3745],[5,98,9586],[5,97,9587],[5,9588,907],[5,9583,9589],[4,63,0,9590],[5,127,9591],[4,23,0,9592],[5,127,9593],[5,97,9594],[5,9595,9560],[5,1120,9559],[5,98,9597],[5,73,3745],[5,9599,9288],[5,98,9600],[5,97,9601],[5,9556,9288],[5,98,9603],[5,97,9604],[5,9605,9560],[5,9602,9606],[5,9556,9382],[5,98,9608],[5,9599,9414],[5,98,9610],[5,97,9611],[0,201,1],[5,9613,3745],[5,9556,9614],[5,101,9615],[5,9616,9559],[5,98,9617],[5,9612,9618],[5,0,9559],[5,72,9581],[5,9621,9586],[5,81,9622],[5,9623,360],[4,63,0,9624],[5,6402,9625],[4,23,0,9626],[5,6402,9627],[5,9620,9628],[5,9306,5753],[5,98,9630],[5,97,9631],[5,101,9290],[5,9271,5753],[5,9634,307],[5,9633,9635],[5,98,9636],[5,97,9637],[5,101,9288],[5,9639,5753],[5,98,9640],[5,9638,9641],[5,9632,9642],[5,9309,9643],[5,9638,7047],[5,9632,9645],[5,9309,9646],[5,2322,1312],[5,98,9648],[5,97,9649],[5,2616,9294],[5,98,9651],[5,97,9652],[5,34,9290],[5,9654,1312],[5,101,9655],[5,3040,9294],[5,7,9657],[5,9658,4],[5,9300,1312],[5,9659,9660],[5,9656,9661],[5,98,9662],[5,9653,9663],[5,9650,9664],[5,1320,9665],[5,9309,9666],[5,9320,9666],[5,2616,9293],[5,98,9669],[5,97,9670],[5,9656,9660],[5,98,9672],[5,9671,9673],[5,9650,9674],[5,1320,9675],[5,9309,9676],[5,9320,9676],[5,9654,9294],[5,101,9679],[5,9680,4],[5,98,9681],[5,9309,9682],[5,9320,9682],[5,101,9636],[5,72,9640],[5,9686,7046],[5,9685,9687],[5,98,9688],[5,9632,9689],[5,9309,9690],[5,567,9288],[5,1187,9294],[5,9693,4],[5,9692,9694],[5,9633,9695],[5,98,9696],[5,9309,9697],[5,529,110],[5,98,9699],[5,97,9700],[5,25,9290],[5,9702,9317],[5,98,9703],[5,9701,9704],[5,9320,9705],[5,314,9290],[5,98,9707],[5,9309,9708],[5,9320,9708],[5,9306,9290],[5,98,9711],[5,9309,9712],[5,9633,9272],[5,101,9714],[5,9715,2245],[5,98,9716],[5,9309,9717],[5,455,9559],[5,101,9719],[5,9720,9559],[5,98,9721],[0,202,2],[5,9723,135],[5,9724,3745],[5,455,9725],[5,101,9726],[5,9727,9725],[5,98,9728],[0,203,2],[5,9730,135],[5,9731,3745],[5,455,9732],[5,101,9733],[5,9734,9732],[5,98,9735],[5,455,9307],[5,101,9737],[5,9738,9307],[5,98,9739],[0,204,2],[5,9741,135],[5,9742,3745],[5,455,9743],[5,101,9744],[5,9745,9743],[5,98,9746],[0,205,1],[5,9748,3745],[5,455,9749],[5,101,9750],[5,9751,9749],[5,98,9752],[0,206,1],[5,9754,3745],[5,455,9755],[5,101,9756],[5,9757,9755],[5,98,9758],[2,207,0,0],[5,25,9760],[5,9418,3745],[5,9762,9288],[5,9761,9763],[5,98,9764],[5,97,9765],[5,9599,9493],[5,98,9767],[5,97,9768],[5,73,9288],[5,9770,9414],[5,98,9771],[5,97,9772],[5,101,9760],[5,9273,4572],[5,9271,9775],[5,9776,26],[5,9774,9777],[5,98,9778],[5,97,9779],[5,9776,82],[5,25,9781],[5,9782,9288],[5,98,9783],[5,97,9784],[5,9583,439],[5,9785,9786],[5,9780,9787],[4,148,0,9788],[5,127,9789],[4,63,0,9790],[5,127,9791],[4,23,0,9792],[5,127,9793],[5,97,9794],[5,9795,439],[5,9773,9796],[5,9769,9797],[5,9766,9798],[5,9275,1389],[5,25,9800],[5,9801,9763],[5,98,9802],[5,97,9803],[5,9275,26],[5,25,9805],[5,9806,9288],[5,98,9807],[5,97,9808],[5,9388,1389],[5,25,9810],[5,9811,3745],[5,98,9812],[5,97,9813],[5,9814,439],[5,9809,9815],[4,97,0,9816],[5,127,9817],[5,97,9818],[5,9819,439],[5,9773,9820],[5,9769,9821],[5,9804,9822],[5,27,9763],[5,98,9824],[5,97,9825],[5,9826,7662],[4,23,0,9827],[5,127,9828],[5,97,9829],[5,7663,9825],[4,23,0,9831],[5,127,9832],[5,97,9833],[5,101,9763],[5,9835,852],[5,98,9836],[5,9834,9837],[5,9830,9838],[5,826,9825],[4,23,0,9840],[5,127,9841],[5,97,9842],[5,9826,825],[4,23,0,9844],[5,127,9845],[5,97,9846],[5,6382,9763],[5,98,9848],[5,9847,9849],[5,9843,9850],[5,9435,9288],[5,98,9852],[5,97,9853],[5,9273,1384],[5,9271,9855],[5,9856,1389],[5,25,9857],[5,9858,3745],[5,98,9859],[5,97,9860],[5,9861,9803],[5,9854,9862],[5,9773,9863],[5,9769,9864],[5,245,9414],[5,98,9866],[5,97,9867],[5,111,9493],[5,98,9869],[5,97,9870],[5,9195,1093],[5,9872,67],[5,9412,9873],[5,98,9874],[5,97,9875],[5,9497,110],[5,9418,9877],[5,9878,244],[5,101,9879],[5,9418,110],[5,9881,244],[5,9497,9882],[5,9880,9883],[5,98,9884],[5,9876,9885],[5,9871,9886],[5,9868,9887],[0,208,1],[5,9889,3745],[5,101,9890],[5,9891,135],[5,98,9892],[5,97,9893],[5,9413,135],[5,9599,9895],[5,98,9896],[5,97,9897],[5,9418,9614],[5,9899,3745],[5,101,9900],[5,9901,3745],[5,98,9902],[5,97,9903],[5,98,9725],[5,9904,9905],[5,9898,9906],[5,9894,9907],[5,9435,9614],[5,98,9909],[5,97,9910],[5,9856,963],[5,25,9912],[5,9913,3745],[5,98,9914],[5,9911,9915],[5,9612,9916],[2,209,0,0],[5,25,9918],[5,9919,9614],[5,98,9920],[5,97,9921],[5,101,9918],[5,9923,9584],[5,98,9924],[5,97,9925],[5,9926,9786],[4,63,0,9927],[5,127,9928],[4,23,0,9929],[5,127,9930],[5,97,9931],[5,9932,439],[5,9612,9933],[5,9922,9934],[5,27,9614],[5,98,9936],[5,97,9937],[5,9938,7662],[4,23,0,9939],[5,127,9940],[5,97,9941],[5,7663,9937],[4,23,0,9943],[5,127,9944],[5,97,9945],[5,101,9614],[5,9947,852],[5,98,9948],[5,9946,9949],[5,9942,9950],[5,826,9937],[4,23,0,9952],[5,127,9953],[5,97,9954],[5,9938,825],[4,23,0,9956],[5,127,9957],[5,97,9958],[5,6382,9614],[5,98,9960],[5,9959,9961],[5,9955,9962],[5,9435,3745],[5,98,9964],[5,97,9965],[5,9913,9614],[5,98,9967],[5,9966,9968],[5,73,9614],[5,9492,135],[5,9970,9971],[5,98,9972],[5,9612,9973],[5,9613,9426],[5,101,9975],[5,9976,9426],[5,98,9977],[5,9613,9763],[5,101,9979],[5,9613,9288],[5,9418,9981],[5,9982,9614],[5,9980,9983],[5,98,9984],[5,9773,9985],[5,9769,9986],[5,9613,9614],[5,101,9988],[5,9989,3745],[5,98,9990],[5,9612,9991],[5,0,9614],[5,30,3745],[5,4626,5370],[5,9273,9995],[5,9271,9996],[5,4626,1490],[5,9997,9998],[4,13,0,9999],[5,9994,10000],[5,9993,10001],[5,9613,11],[5,101,10003],[5,10004,11],[5,98,10005],[5,101,9909],[5,10007,9914],[5,98,10008],[5,9612,10009],[5,9970,9981],[5,101,10011],[5,10012,9600],[5,98,10013],[5,9773,10014],[5,9612,10015],[5,98,10011],[5,97,10017],[5,10018,9601],[5,9773,10019],[5,9612,10020],[5,9602,10017],[5,9773,10022],[5,9612,10023],[5,9613,9414],[5,101,10025],[5,10026,9971],[5,98,10027],[5,9889,9426],[5,101,10029],[5,10030,135],[5,98,10031],[5,182,9414],[4,13,0,2142],[5,10033,10034],[5,9889,10035],[5,73,10036],[5,10037,135],[5,98,10038],[5,31,9290],[5,101,10040],[5,10041,9295],[5,98,10042],[5,31,9272],[5,101,10044],[5,10045,11],[5,98,10046],[5,309,11],[5,10048,110],[5,308,10049],[5,101,10050],[5,578,9272],[5,10051,10052],[5,98,10053],[5,298,11],[4,23,0,367],[5,10055,10056],[5,101,10057],[5,10058,9272],[5,98,10059],[5,101,9272],[5,10061,10057],[5,98,10062],[5,97,9535],[5,9639,9272],[5,101,10065],[5,9311,11],[5,72,10067],[5,9454,1378],[5,10068,10069],[5,10066,10070],[5,98,10071],[5,10064,10072],[5,10061,9288],[5,101,10074],[5,10075,10070],[5,98,10076],[5,10064,10077],[5,25,9272],[5,10079,9317],[5,98,10080],[5,314,9272],[5,98,10082],[5,9306,9272],[5,98,10084],[5,0,9272],[5,3019,1378],[5,298,10087],[4,23,0,11],[5,10088,10089],[5,10086,10090],[5,97,9905],[5,10092,9903],[5,9898,10093],[5,1120,9725],[5,98,10095],[5,0,9725],[5,72,9743],[5,72,9749],[5,10099,9755],[5,10098,10100],[5,10097,10101],[5,27,9382],[5,98,10103],[5,97,10104],[5,10105,7662],[4,23,0,10106],[5,127,10107],[5,97,10108],[5,7663,10104],[4,23,0,10110],[5,127,10111],[5,97,10112],[5,101,9382],[5,10114,852],[5,98,10115],[5,10113,10116],[5,10109,10117],[5,826,10104],[4,23,0,10119],[5,127,10120],[5,97,10121],[5,10105,825],[4,23,0,10123],[5,127,10124],[5,97,10125],[5,6382,9382],[5,98,10127],[5,10126,10128],[5,10122,10129],[5,332,9290],[5,10131,135],[5,101,10132],[5,25,9294],[5,10134,135],[5,7,10135],[5,332,9288],[5,10137,135],[5,10,10138],[5,10136,10139],[5,10140,10138],[5,10133,10141],[5,98,10142],[5,9309,10143],[5,332,9272],[5,10145,135],[5,101,10146],[5,10147,11],[5,98,10148],[5,9435,9414],[5,101,10150],[5,7862,7707],[5,10151,10152],[5,98,10153],[5,9380,9414],[5,101,10155],[5,9386,9579],[4,97,0,10157],[5,7802,10158],[4,81,0,10159],[5,7764,10160],[5,10156,10161],[5,98,10162],[5,98,10155],[5,97,10164],[5,98,10157],[5,97,10166],[5,10167,439],[5,7663,10168],[5,1015,10169],[4,97,0,10170],[5,127,10171],[4,81,0,10172],[5,127,10173],[5,97,10174],[5,10175,439],[5,10165,10176],[5,493,9276],[5,98,10178],[5,97,10179],[5,855,9414],[5,10181,10034],[5,98,10182],[5,10180,10183],[5,7709,10184],[5,7557,10185],[5,27,9414],[5,98,10187],[5,97,10188],[5,101,9998],[5,10190,963],[5,98,10191],[5,97,10192],[5,101,9995],[5,10194,1384],[5,98,10195],[5,97,10196],[5,10197,3837],[5,10193,10198],[5,10189,10199],[4,13,0,10200],[5,127,10201],[5,97,10202],[5,10203,3837],[5,7709,10204],[5,7557,10205],[5,9380,9475],[5,98,10207],[5,97,10208],[5,9306,2],[5,98,10210],[5,97,10211],[5,9292,2],[5,101,10213],[5,10214,9293],[5,98,10215],[5,97,10216],[5,10137,9310],[5,29,10218],[5,9477,10219],[5,9380,10220],[5,98,10221],[5,97,10222],[5,34,2],[5,10224,26],[5,25,10225],[5,10226,9301],[4,89,0,10227],[5,9484,10228],[5,98,10229],[5,97,10230],[5,10231,439],[5,10223,10232],[5,10217,10233],[5,10212,10234],[5,97,10235],[5,10236,439],[5,9309,10237],[5,10209,10238],[5,10231,10208],[5,10217,10240],[5,9309,10241],[5,10212,10242],[5,9309,10211],[5,10209,10244],[5,9309,10216],[5,10209,10246],[5,25,5442],[5,9194,2786],[2,14,0,2],[5,10249,10250],[5,10248,10251],[5,98,10252],[5,97,10253],[5,9580,2786],[5,98,10255],[5,97,10256],[5,101,5442],[5,10250,82],[5,10259,26],[5,10258,10260],[5,98,10261],[5,97,10262],[5,10263,439],[5,10257,10264],[4,63,0,10265],[5,127,10266],[4,23,0,10267],[5,127,10268],[5,97,10269],[5,10270,439],[5,9417,10271],[5,10254,10272],[5,10250,645],[5,10274,367],[5,1463,10275],[5,98,10276],[5,97,10277],[5,9563,2786],[5,98,10279],[5,97,10280],[5,964,10251],[5,98,10282],[5,10281,10283],[5,10278,10284],[5,72,10255],[5,1463,10260],[5,10286,10287],[4,63,0,10288],[5,703,10289],[4,23,0,10290],[5,703,10291],[5,98,10292],[5,97,10293],[4,63,0,10260],[4,23,0,10295],[5,10249,10296],[5,964,10297],[5,98,10298],[5,10294,10299],[5,646,9890],[5,98,10301],[5,97,10302],[5,10303,869],[5,9612,10304],[0,210,1],[5,10306,3745],[5,9380,10307],[5,98,10308],[5,97,10309],[5,9380,852],[5,98,10311],[5,10310,10312],[5,9612,10313],[5,9401,26],[5,25,10315],[5,10316,3745],[5,98,10317],[5,97,10318],[5,10319,439],[4,63,0,10320],[5,127,10321],[5,97,10322],[5,10323,439],[5,9612,10324],[5,10303,10325],[5,9566,10302],[5,368,10307],[5,98,10328],[5,97,10329],[5,9388,367],[5,25,10331],[5,10332,3745],[5,98,10333],[5,97,10334],[5,10335,439],[4,23,0,10336],[5,127,10337],[5,97,10338],[5,10339,439],[5,9612,10340],[5,10330,10341],[5,9566,10329],[5,98,9732],[5,97,10344],[5,9403,3745],[5,47,10346],[5,98,10347],[5,870,10348],[5,10345,10349],[5,25,9389],[5,10351,3745],[5,47,10352],[5,98,10353],[5,826,10354],[4,23,0,10355],[5,127,10356],[5,97,10357],[5,10358,10344],[5,1120,9732],[5,98,10360],[5,0,9732],[4,23,0,10353],[5,7378,10363],[5,10362,10364],[5,97,9314],[5,10366,9510],[5,10064,10367],[5,97,10368],[5,10369,439],[5,9309,10370],[5,9453,9308],[5,1512,10372],[5,10064,10373],[5,101,9307],[5,9255,26],[5,9316,10376],[4,40,0,10377],[5,703,10378],[5,10375,10379],[5,98,10380],[5,1120,9307],[5,98,10382],[5,0,9307],[5,72,9534],[5,2109,9471],[5,10385,10386],[5,10384,10387],[5,318,9295],[5,98,10389],[5,97,10390],[5,386,9301],[4,91,0,10392],[5,9484,10393],[5,98,10394],[5,97,10395],[5,322,9294],[5,101,10397],[5,10398,4],[5,98,10399],[5,97,10400],[5,578,9290],[5,98,10402],[5,10401,10403],[5,10396,10404],[5,9309,10405],[5,10391,10406],[5,473,10407],[5,314,963],[5,98,10409],[5,97,10410],[5,31,963],[5,101,10412],[5,10413,9295],[5,98,10414],[5,97,10415],[5,34,963],[5,10417,26],[5,101,10418],[5,10419,9301],[4,91,0,10420],[5,9484,10421],[5,98,10422],[5,97,10423],[5,10417,9294],[5,101,10425],[5,10426,4],[5,98,10427],[5,97,10428],[5,9633,963],[5,98,10430],[5,10429,10431],[5,10424,10432],[5,9309,10433],[5,10416,10434],[5,10411,10435],[5,318,11],[5,98,10437],[5,97,10438],[5,98,10052],[5,10439,10440],[5,473,10441],[5,10061,307],[5,98,10443],[5,10439,10444],[5,473,10445],[5,9292,9290],[5,101,10447],[5,10448,9294],[5,98,10449],[5,9309,10450],[5,9320,10450],[5,9292,9272],[5,101,10453],[5,10454,1378],[5,98,10455],[5,9380,3745],[5,98,10457],[5,97,10458],[5,10224,1490],[5,9273,10460],[5,9271,10461],[5,10224,5370],[5,10462,10463],[5,25,10464],[5,10465,9414],[5,98,10466],[5,10459,10467],[5,9612,10468],[5,10465,3745],[5,98,10470],[5,10459,10471],[5,9612,10472],[5,101,9414],[5,10474,11],[5,101,10475],[5,8182,7394],[5,10476,10477],[5,98,10478],[5,787,9414],[5,101,10480],[5,10481,10477],[5,98,10482],[5,9386,10464],[5,98,10484],[5,10165,10485],[5,0,9414],[5,9273,135],[5,9271,10488],[5,10489,852],[5,9474,10490],[5,10487,10491],[5,9195,9890],[5,10493,10307],[5,10465,10494],[5,98,10495],[5,10459,10496],[5,9612,10497],[5,10306,9426],[5,101,10499],[5,10500,135],[5,98,10501],[5,10306,10035],[5,73,10503],[5,10504,852],[5,98,10505],[5,98,10352],[5,826,10507],[4,23,0,10508],[5,127,10509],[5,97,10510],[5,98,9743],[5,10511,10512],[5,97,10512],[5,9599,9900],[5,98,10515],[5,10514,10516],[5,9898,10517],[5,9275,963],[5,25,10519],[5,10520,3745],[5,98,10521],[5,7557,10522],[5,10514,10523],[5,1120,9743],[5,98,10525],[5,9741,110],[5,10527,9382],[5,98,10528],[5,9742,9614],[5,101,10530],[5,10531,9743],[5,98,10532],[5,9612,10533],[5,0,9743],[4,23,0,10352],[5,7378,10536],[5,10535,10537],[5,9741,11],[5,10539,11],[5,98,10540],[5,9612,7556],[5,9966,10542],[5,9612,7708],[5,9966,10544],[5,0,9763],[5,9889,9288],[5,9195,10547],[5,10548,10307],[5,182,10549],[5,101,4572],[5,10551,9579],[5,72,10552],[5,25,9777],[5,10554,9288],[5,72,10555],[5,10556,9586],[4,63,0,10557],[5,703,10558],[5,10553,10559],[4,148,0,10560],[5,703,10561],[4,23,0,10562],[5,703,10563],[4,13,0,10564],[5,10550,10565],[5,10546,10566],[5,9497,278],[5,101,10568],[5,28,9877],[5,9497,244],[5,10570,10571],[5,10569,10572],[5,98,10573],[5,9418,278],[5,10575,2786],[5,101,10576],[5,9881,2786],[5,28,10578],[5,9418,244],[5,10580,2786],[5,10579,10581],[5,10577,10582],[5,98,10583],[5,9418,11],[5,10585,2786],[5,101,10586],[5,10587,11],[5,98,10588],[5,9497,11],[5,101,10590],[5,10591,11],[5,98,10592],[5,73,9763],[5,9413,1093],[5,10594,10595],[5,98,10596],[5,9769,10597],[5,9773,10598],[5,9380,9763],[5,98,10600],[5,97,10601],[5,9380,10595],[5,98,10603],[5,9769,10604],[5,9773,10605],[5,10602,10606],[5,73,3944],[5,10608,3745],[5,98,10609],[5,97,10610],[2,211,0,0],[5,73,10612],[5,10613,9288],[5,98,10614],[5,97,10615],[5,9418,3944],[5,10617,10612],[5,73,10618],[5,10619,9763],[5,98,10620],[5,10616,10621],[5,10611,10622],[5,73,9890],[5,10624,135],[5,98,10625],[5,9612,10626],[5,0,9890],[4,13,0,9998],[5,9994,10629],[5,10628,10630],[0,212,2],[5,10632,3745],[5,10633,135],[5,0,10634],[5,182,10307],[4,23,0,9586],[5,7764,10637],[4,63,0,10638],[5,10636,10639],[5,10635,10640],[5,73,10307],[5,10642,852],[5,98,10643],[5,9612,10644],[5,0,10307],[4,13,0,9995],[5,9994,10647],[5,10646,10648],[5,98,10065],[5,97,10650],[5,10651,439],[5,97,10652],[5,898,9317],[5,98,10654],[5,97,10655],[5,9271,82],[5,10657,26],[5,9639,10658],[5,98,10659],[5,97,10660],[5,10661,439],[5,904,10662],[5,10656,10663],[4,14,0,10664],[5,127,10665],[4,154,0,10666],[5,127,10667],[5,97,10668],[5,10669,439],[5,10653,10670],[5,9320,10671],[5,98,2834],[5,97,10673],[5,1937,9293],[5,98,10675],[5,97,10676],[5,9300,1325],[5,25,10678],[5,10679,110],[5,98,10680],[5,10677,10681],[5,10674,10682],[5,1329,10683],[5,9320,10684],[5,477,10065],[5,855,9317],[4,14,0,10659],[5,1250,10688],[4,211,0,10689],[5,10687,10690],[5,10686,10691],[5,98,10692],[5,9320,10693],[5,97,9641],[5,9292,5753],[5,9454,10696],[5,98,10697],[5,97,10698],[5,3019,10696],[5,45,10700],[5,101,9301],[5,34,5753],[5,10703,26],[5,10702,10704],[4,89,0,10705],[5,10701,10706],[5,98,10707],[5,97,10708],[5,10709,439],[5,10699,10710],[5,97,10711],[5,10712,439],[5,10695,10713],[5,9632,10714],[5,9309,10715],[5,10709,9641],[5,10699,10717],[5,9632,10718],[5,9309,10719],[5,101,9640],[5,72,10697],[5,10722,10707],[5,10721,10723],[5,98,10724],[5,9632,10725],[5,9309,10726],[5,9320,9505],[5,9255,10218],[5,9316,10729],[5,98,10730],[5,9309,10731],[5,493,9272],[5,98,10733],[5,97,10734],[5,493,82],[5,98,10736],[5,97,10737],[5,493,10658],[5,98,10739],[5,10738,10740],[5,904,10741],[5,10656,10742],[4,14,0,10743],[5,127,10744],[4,191,0,10745],[5,127,10746],[5,97,10747],[5,493,9288],[5,98,10749],[5,10748,10750],[5,10735,10751],[5,9320,10752],[5,101,10069],[5,10754,10065],[5,98,10755],[5,9309,10756],[5,9273,9998],[5,9271,10758],[5,10759,9995],[4,13,0,10760],[5,9994,10761],[5,101,10762],[5,10763,3745],[5,98,10764],[5,9612,10765],[5,9580,110],[5,98,10767],[5,97,10768],[5,9580,244],[5,72,10770],[5,10250,4578],[5,10772,4572],[5,101,10773],[2,36,0,2],[5,10775,82],[5,10776,26],[5,10774,10777],[5,10771,10778],[4,214,0,10779],[5,703,10780],[4,213,0,10781],[5,703,10782],[5,98,10783],[5,10769,10784],[4,63,0,10785],[5,127,10786],[4,23,0,10787],[5,127,10788],[5,97,10789],[5,98,10770],[5,97,10791],[5,72,10767],[5,10775,4578],[5,10794,4572],[5,101,10795],[5,10796,10260],[5,10793,10797],[4,63,0,10798],[5,703,10799],[4,23,0,10800],[5,703,10801],[5,98,10802],[5,10792,10803],[4,214,0,10804],[5,127,10805],[4,213,0,10806],[5,127,10807],[5,97,10808],[5,111,9414],[5,98,10810],[5,97,10811],[5,245,9873],[5,98,10813],[5,97,10814],[5,9194,110],[5,10816,10296],[5,101,10817],[5,9194,244],[4,63,0,10777],[4,23,0,10820],[5,10819,10821],[5,10818,10822],[5,98,10823],[5,10815,10824],[5,10812,10825],[5,10809,10826],[5,10790,10827],[5,101,2786],[5,10829,110],[5,98,10830],[5,97,10831],[5,101,10260],[5,10833,10777],[5,98,10834],[5,10769,10835],[4,63,0,10836],[5,127,10837],[4,23,0,10838],[5,127,10839],[5,97,10840],[5,101,10297],[4,69,0,10777],[4,155,0,10843],[5,10816,10844],[5,10842,10845],[5,98,10846],[5,10841,10847],[5,10812,10848],[5,10832,10849],[5,10249,10775],[5,0,10851],[5,30,2786],[5,10775,9998],[5,10854,9995],[4,13,0,10855],[5,10853,10856],[5,10852,10857],[4,63,0,9579],[4,23,0,10859],[5,10249,10860],[5,101,10861],[5,10862,2786],[5,98,10863],[5,9417,10864],[5,9889,3944],[5,646,10866],[5,98,10867],[5,97,10868],[5,10869,10302],[5,10611,10870],[5,10306,3944],[5,646,10872],[5,98,10873],[5,97,10874],[5,646,10307],[5,98,10876],[5,10875,10877],[5,10611,10878],[2,215,0,0],[5,73,10880],[5,10881,135],[5,98,10882],[5,97,10883],[2,216,0,0],[5,73,10885],[5,10886,852],[5,98,10887],[5,97,10888],[5,9195,10880],[5,10890,10885],[5,73,10891],[5,10892,9414],[5,98,10893],[5,10889,10894],[5,10884,10895],[5,98,9749],[5,97,10897],[5,98,9755],[5,97,10899],[5,73,9900],[5,10901,3745],[5,98,10902],[5,10900,10903],[5,10898,10904],[5,9898,10905],[5,9566,9572],[5,10898,10907],[5,9583,9587],[4,63,0,10909],[5,127,10910],[4,23,0,10911],[5,127,10912],[5,97,10913],[5,10914,10897],[5,1120,9749],[5,98,10916],[5,9748,9382],[5,98,10918],[5,9748,9288],[5,98,10920],[5,97,10921],[5,249,3745],[5,10923,9288],[5,9748,10924],[5,98,10925],[5,10922,10926],[5,10898,10927],[5,9748,9614],[5,101,10929],[5,10930,9749],[5,98,10931],[5,9612,10932],[5,0,9749],[5,81,9581],[5,10935,9586],[4,63,0,10936],[5,6402,10937],[4,23,0,10938],[5,6402,10939],[5,10934,10940],[5,101,9749],[5,9947,3745],[5,10942,10943],[5,98,10944],[5,9612,10945],[5,9568,5442],[5,25,10947],[5,10948,3745],[5,98,10949],[5,97,10950],[5,9401,5442],[5,25,10952],[5,10953,3745],[5,98,10954],[5,10951,10955],[5,9566,10956],[5,10900,10957],[5,9754,9288],[5,98,10959],[5,97,10960],[5,9754,10924],[5,98,10962],[5,10961,10963],[5,10900,10964],[5,9782,3745],[5,98,10966],[5,97,10967],[5,10554,3745],[5,98,10969],[5,9583,10970],[5,10968,10971],[4,148,0,10972],[5,127,10973],[4,63,0,10974],[5,127,10975],[4,23,0,10976],[5,127,10977],[5,97,10978],[5,10979,10899],[5,1120,9755],[5,98,10981],[5,9754,9382],[5,98,10983],[5,9754,9614],[5,101,10985],[5,10986,9755],[5,98,10987],[5,9612,10988],[5,0,9755],[5,72,10966],[5,10991,9581],[5,81,10992],[5,10993,10969],[4,148,0,10994],[5,6402,10995],[4,63,0,10996],[5,6402,10997],[4,23,0,10998],[5,6402,10999],[5,10990,11000],[5,101,9755],[5,9762,3745],[5,73,11003],[5,11004,3745],[5,11002,11005],[5,98,11006],[5,904,4839],[4,23,0,11008],[5,127,11009],[5,5597,11010],[5,321,5966],[5,98,11012],[5,11011,11013],[5,81,902],[5,11015,2142],[4,23,0,11016],[5,6402,11017],[5,98,11018],[5,5597,11019],[5,11020,11013],[5,5936,5701],[5,97,11022],[5,11023,5701],[5,5611,11024],[5,5611,5935],[5,97,11013],[5,8060,2181],[5,11027,11028],[5,45,11],[5,34,3745],[5,11031,9344],[5,25,11032],[5,11033,9348],[4,29,0,11034],[5,11030,11035],[5,98,11036],[5,45,9288],[5,11038,11035],[5,98,11039],[5,97,11040],[5,9343,1353],[5,11031,11042],[5,25,11043],[5,9347,1353],[5,11044,11045],[5,98,11046],[5,97,11047],[5,9,1353],[5,11049,9288],[5,45,11050],[5,11051,11035],[5,98,11052],[5,11048,11053],[5,11041,11054],[5,98,6216],[5,97,11056],[5,6049,5701],[5,5768,11058],[5,97,11059],[5,11060,5701],[5,11057,11061],[5,11057,439],[5,11057,1285],[0,217,2],[2,218,0,0],[5,11065,11066],[5,11067,645],[5,0,11068],[0,219,1],[5,11070,11066],[5,9271,11071],[5,11072,645],[5,11069,11073],[2,178,0,0],[5,101,11075],[5,11076,5580],[5,477,11077],[5,11076,2245],[5,11078,11079],[5,98,11080],[5,97,11081],[5,493,11075],[5,98,11083],[5,97,11084],[5,98,11077],[5,97,11086],[5,5831,5701],[5,11087,11088],[5,97,11089],[5,98,11079],[5,97,11091],[5,5834,5701],[5,11092,11093],[5,97,11094],[5,11095,5701],[5,11090,11096],[5,11085,11097],[5,11082,11098],[5,5565,5945],[5,493,11100],[5,98,11101],[5,97,11102],[5,101,11100],[5,11104,5580],[5,98,11105],[5,97,11106],[5,11107,11088],[5,97,11108],[5,11104,2245],[5,98,11110],[5,97,11111],[5,11112,11093],[5,97,11113],[5,11114,5701],[5,11109,11115],[5,11103,11116],[5,493,5634],[5,98,11118],[5,97,11119],[5,101,5634],[5,11121,5580],[5,98,11122],[5,97,11123],[5,11124,11088],[5,97,11125],[5,11121,2245],[5,98,11127],[5,97,11128],[5,11129,11093],[5,97,11130],[5,11131,5701],[5,11126,11132],[5,11120,11133],[5,493,6383],[5,98,11135],[5,97,11136],[5,8706,5580],[5,98,11138],[5,97,11139],[5,11140,11088],[5,97,11141],[5,8706,2245],[5,98,11143],[5,97,11144],[5,11145,11093],[5,97,11146],[5,11147,5701],[5,11142,11148],[5,11137,11149],[5,493,5797],[5,98,11151],[5,97,11152],[5,6472,5580],[5,98,11154],[5,97,11155],[5,11156,11088],[5,97,11157],[5,6472,2245],[5,98,11159],[5,97,11160],[5,11161,11093],[5,97,11162],[5,11163,5701],[5,11158,11164],[5,11153,11165],[5,5569,5945],[5,493,11167],[5,98,11168],[5,97,11169],[5,101,11167],[5,11171,5580],[5,98,11172],[5,97,11173],[5,11174,11088],[5,97,11175],[5,11171,2245],[5,98,11177],[5,97,11178],[5,11179,11093],[5,97,11180],[5,11181,5701],[5,11176,11182],[5,11170,11183],[5,493,5698],[5,98,11185],[5,97,11186],[5,101,5698],[5,11188,5580],[5,98,11189],[5,97,11190],[5,11191,11088],[5,97,11192],[5,11188,2245],[5,98,11194],[5,97,11195],[5,11196,11093],[5,97,11197],[5,11198,5701],[5,11193,11199],[5,11187,11200],[5,493,8171],[5,98,11202],[5,97,11203],[5,101,8171],[5,11205,5580],[5,98,11206],[5,97,11207],[5,11208,11088],[5,97,11209],[5,11205,2245],[5,98,11211],[5,97,11212],[5,11213,11093],[5,97,11214],[5,11215,5701],[5,11210,11216],[5,11204,11217],[5,493,5560],[5,98,11219],[5,97,11220],[5,5561,5580],[5,98,11222],[5,97,11223],[5,11224,11088],[5,97,11225],[5,97,5563],[5,11227,11093],[5,97,11228],[5,11229,5701],[5,11226,11230],[5,11221,11231],[5,493,5666],[5,98,11233],[5,97,11234],[5,101,5666],[5,11236,5580],[5,98,11237],[5,97,11238],[5,11239,11088],[5,97,11240],[5,11236,2245],[5,98,11242],[5,97,11243],[5,11244,11093],[5,97,11245],[5,11246,5701],[5,11241,11247],[5,11235,11248],[2,220,0,0],[5,9273,11250],[5,58,11251],[2,221,0,0],[5,9273,11253],[5,11252,11254],[5,493,11255],[5,98,11256],[5,97,11257],[5,98,11250],[5,97,11259],[5,493,11253],[5,98,11261],[5,97,11262],[5,11263,5701],[5,11260,11264],[5,97,11265],[5,47,11250],[5,72,11267],[5,11268,5580],[5,98,11269],[5,97,11270],[5,11271,5701],[5,97,11272],[5,11273,5701],[5,11266,11274],[5,11258,11275],[5,9271,11251],[2,222,0,0],[5,11277,11278],[5,58,11279],[5,9271,11254],[2,223,0,0],[5,11281,11282],[5,11280,11283],[5,493,11284],[5,98,11285],[5,97,11286],[5,98,11278],[5,97,11288],[5,493,11282],[5,98,11290],[5,97,11291],[5,11292,5701],[5,11289,11293],[5,97,11294],[5,47,11278],[5,72,11296],[5,11297,11269],[5,98,11298],[5,97,11299],[5,11300,5701],[5,97,11301],[5,11302,5701],[5,11295,11303],[5,11266,11304],[5,11287,11305],[5,9271,11279],[2,224,0,0],[5,11307,11308],[5,58,11309],[5,9271,11283],[2,225,0,0],[5,11311,11312],[5,11310,11313],[5,493,11314],[5,98,11315],[5,97,11316],[5,98,11308],[5,97,11318],[5,493,11312],[5,98,11320],[5,97,11321],[5,11322,5701],[5,11319,11323],[5,97,11324],[5,47,11308],[5,72,11326],[5,11327,11298],[5,98,11328],[5,97,11329],[5,11330,5701],[5,97,11331],[5,11332,5701],[5,11325,11333],[5,11295,11334],[5,11266,11335],[5,11317,11336],[5,9271,11309],[2,226,0,0],[5,11338,11339],[5,58,11340],[5,9271,11313],[2,227,0,0],[5,11342,11343],[5,11341,11344],[5,493,11345],[5,98,11346],[5,97,11347],[5,98,11339],[5,97,11349],[5,493,11343],[5,98,11351],[5,97,11352],[5,11353,5701],[5,11350,11354],[5,97,11355],[5,47,11339],[5,72,11357],[5,11358,11328],[5,98,11359],[5,97,11360],[5,11361,5701],[5,97,11362],[5,11363,5701],[5,11356,11364],[5,11325,11365],[5,11295,11366],[5,11266,11367],[5,11348,11368],[5,9271,11340],[2,228,0,0],[5,11370,11371],[5,58,11372],[5,9271,11344],[2,229,0,0],[5,11374,11375],[5,11373,11376],[5,493,11377],[5,98,11378],[5,97,11379],[5,98,11371],[5,97,11381],[5,493,11375],[5,98,11383],[5,97,11384],[5,11385,5701],[5,11382,11386],[5,97,11387],[5,47,11371],[5,72,11389],[5,11390,11359],[5,98,11391],[5,97,11392],[5,11393,5701],[5,97,11394],[5,11395,5701],[5,11388,11396],[5,11356,11397],[5,11325,11398],[5,11295,11399],[5,11266,11400],[5,11380,11401],[5,1349,9310],[5,98,11403],[5,97,11404],[5,9289,645],[5,34,11406],[5,11407,1348],[5,101,11408],[5,9300,1348],[5,11409,11410],[5,98,11411],[5,11405,11412],[5,9309,11413],[2,230,0,0],[5,31,11415],[5,855,11416],[5,34,11415],[5,11418,26],[4,29,0,11419],[5,11417,11420],[5,98,11421],[5,97,11422],[5,30,11416],[5,1,11419],[5,11425,39],[4,29,0,11426],[5,11424,11427],[5,29,11428],[5,27,11429],[4,23,0,11430],[5,703,11431],[5,98,11432],[5,11423,11433],[5,30,10044],[5,34,9272],[5,11436,26],[5,1,11437],[5,11438,11437],[4,29,0,11439],[5,11435,11440],[5,29,11441],[5,646,11442],[5,98,11443],[5,97,11444],[5,11445,5701],[5,11070,11415],[5,9292,11447],[5,101,11448],[5,11070,19],[5,9292,11450],[5,11449,11451],[5,98,11452],[5,97,11453],[5,31,11447],[5,101,11455],[5,31,11450],[5,11456,11457],[5,98,11458],[5,11454,11459],[5,11065,11415],[5,11461,1389],[5,11070,11462],[5,9292,11463],[5,101,11464],[5,11065,19],[5,11466,4],[5,11070,11467],[5,9292,11468],[5,11465,11469],[5,101,11470],[5,11471,11452],[5,98,11472],[5,11070,9272],[5,31,11474],[5,30,11475],[5,34,11474],[5,11477,26],[5,1,11478],[5,11479,11478],[4,29,0,11480],[5,11476,11481],[5,29,11482],[5,28,11483],[5,45,11475],[5,47,11478],[4,29,0,11486],[5,11485,11487],[5,1,11488],[5,11489,21],[5,11484,11490],[5,1004,11491],[5,101,11492],[5,9,21],[5,11494,11],[5,1004,11495],[5,11493,11496],[5,98,11497],[5,477,1389],[2,231,0,0],[5,11499,11500],[5,47,11501],[5,72,11502],[5,72,11470],[5,31,11463],[5,30,11505],[5,34,11463],[5,11507,26],[5,1,11508],[5,34,11468],[5,11510,26],[5,11509,11511],[4,29,0,11512],[5,11506,11513],[5,29,11514],[5,28,11515],[5,45,11505],[5,47,11508],[4,29,0,11518],[5,11517,11519],[5,1,11520],[5,11521,21],[5,11516,11522],[5,1004,11523],[5,11504,11524],[5,11503,11525],[5,101,11526],[5,47,1389],[5,72,11528],[5,47,11500],[5,72,11530],[5,72,11452],[5,30,11455],[5,34,11447],[5,11534,26],[5,1,11535],[5,34,11450],[5,11537,26],[5,11536,11538],[4,29,0,11539],[5,11533,11540],[5,29,11541],[5,28,11542],[5,45,11455],[5,47,11535],[4,29,0,11545],[5,11544,11546],[5,1,11547],[5,11548,21],[5,11543,11549],[5,1004,11550],[5,11532,11551],[5,11531,11552],[5,11529,11553],[5,11527,11554],[5,98,11555],[5,98,11528],[5,97,11557],[5,9271,11447],[5,11559,1389],[5,31,11560],[5,45,11561],[5,34,11560],[5,11563,26],[5,47,11564],[4,29,0,11565],[5,11562,11566],[5,101,11567],[5,11568,11547],[5,98,11569],[5,11558,11570],[5,30,11561],[5,1,11564],[5,9271,11450],[5,11574,4],[5,34,11575],[5,11576,26],[5,11573,11577],[4,29,0,11578],[5,11572,11579],[5,29,11580],[5,101,11581],[5,11582,11542],[5,98,11583],[5,11454,11584],[5,11558,11585],[5,855,11475],[4,29,0,11478],[5,11587,11588],[5,98,11589],[5,97,11590],[5,11591,5701],[5,855,11505],[4,29,0,11508],[5,11593,11594],[5,101,11595],[5,855,11455],[4,29,0,11535],[5,11597,11598],[5,11499,11599],[5,11596,11600],[5,98,11601],[5,646,11515],[5,11504,11603],[5,101,11604],[5,1,1389],[5,11606,4],[5,646,11607],[5,11504,11608],[5,477,11609],[5,646,11542],[5,11532,11611],[5,11610,11612],[5,11605,11613],[5,98,11614],[5,646,11581],[5,98,11616],[5,97,11617],[5,477,11608],[5,11619,11611],[5,98,11620],[5,11454,11621],[5,11618,11622],[5,16,9272],[5,11624,9272],[2,232,0,0],[5,11625,11626],[5,493,11627],[5,98,11628],[5,97,11629],[5,493,11626],[5,98,11631],[5,97,11632],[5,11633,5701],[5,97,11634],[5,11635,5701],[5,11630,11636],[5,16,11251],[5,11638,11254],[5,11639,21],[5,493,11640],[5,98,11641],[5,97,11642],[5,493,21],[5,98,11644],[5,97,11645],[5,11646,5701],[5,11271,11647],[5,97,11648],[5,11649,5701],[5,11266,11650],[5,11643,11651],[5,16,11279],[5,11653,11283],[5,11654,21],[5,493,11655],[5,98,11656],[5,97,11657],[5,11300,11647],[5,97,11659],[5,11660,5701],[5,11295,11661],[5,11266,11662],[5,11658,11663],[5,16,11309],[5,11665,11313],[5,11666,21],[5,493,11667],[5,98,11668],[5,97,11669],[5,11330,11647],[5,97,11671],[5,11672,5701],[5,11325,11673],[5,11295,11674],[5,11266,11675],[5,11670,11676],[5,16,11340],[5,11678,11344],[5,11679,21],[5,493,11680],[5,98,11681],[5,97,11682],[5,11361,11647],[5,97,11684],[5,11685,5701],[5,11356,11686],[5,11325,11687],[5,11295,11688],[5,11266,11689],[5,11683,11690],[5,16,11372],[5,11692,11376],[5,11693,21],[5,493,11694],[5,98,11695],[5,97,11696],[5,11393,11647],[5,97,11698],[5,11699,5701],[5,11388,11700],[5,11356,11701],[5,11325,11702],[5,11295,11703],[5,11266,11704],[5,11697,11705],[5,47,5971],[5,98,11707],[5,97,11708],[5,47,5961],[4,23,0,11710],[5,703,11711],[5,98,11712],[5,97,11713],[5,11714,5701],[5,97,11715],[5,11716,5701],[5,11709,11717],[5,11709,11713],[5,97,9119],[5,9023,5701],[5,9118,11721],[5,97,11722],[5,11723,5701],[5,11720,11724],[5,11720,9025],[5,11720,9022],[5,5697,2245],[5,98,11728],[5,97,11729],[5,11730,5646],[5,5668,11731],[5,72,10084],[5,1870,10453],[5,72,11734],[5,3019,10453],[5,787,11736],[5,11735,11737],[5,11733,11738],[5,98,11739],[5,72,9307],[5,1519,9293],[5,72,11742],[5,1004,9312],[5,11743,11744],[5,11741,11745],[5,98,11746],[5,97,11747],[5,9289,367],[5,9306,11749],[5,72,11750],[5,9292,11749],[5,5273,11752],[5,72,11753],[5,5507,645],[5,101,11755],[5,3019,11752],[5,11756,11757],[5,11754,11758],[5,11751,11759],[5,98,11760],[5,11748,11761],[5,493,468],[5,98,11763],[5,97,11764],[5,493,317],[5,98,11766],[5,97,11767],[5,11768,5701],[5,97,11769],[5,11770,5701],[5,11765,11771],[5,11765,11767],[2,106,0,1],[5,299,11774],[5,31,11775],[5,493,11776],[5,98,11777],[5,97,11778],[5,493,110],[5,98,11780],[5,11779,11781],[5,5768,5701],[5,97,11783],[5,2347,5701],[5,97,11785],[5,11786,5701],[5,11784,11787],[5,5713,645],[5,98,11789],[5,97,11790],[5,47,645],[5,98,11792],[5,97,11793],[5,11794,5701],[5,97,11795],[5,11796,5701],[5,11791,11797],[5,11791,11793],[5,5706,645],[5,98,11800],[5,97,11801],[5,98,645],[5,97,11803],[5,11804,5701],[5,97,11805],[5,11806,5701],[5,11802,11807],[5,11802,11803],[5,6599,11797],[5,6599,11793],[5,6594,11807],[5,6594,11803],[5,5773,5753],[5,98,11814],[5,2092,5701],[5,1923,11816],[5,6057,5701],[5,2347,11818],[5,97,11819],[5,11820,11061],[5,5722,11821],[5,5685,5701],[4,23,6,11823],[5,5620,11824],[5,97,11825],[5,11826,5701],[5,5692,11827],[5,97,5939],[5,11829,5701],[5,97,11830],[5,11831,5701],[5,5692,11832],[5,309,135],[5,11834,852],[5,537,11835],[5,47,11836],[5,98,11837],[5,97,11838],[5,308,11835],[5,47,11840],[5,98,11841],[5,97,11842],[5,11843,5701],[5,97,11844],[5,529,852],[5,47,11846],[5,98,11847],[5,97,11848],[5,11849,5701],[5,97,11850],[5,11851,5701],[5,11845,11852],[5,11839,11853],[5,97,506],[5,6032,5701],[5,492,11856],[5,409,11857],[5,97,11858],[5,97,502],[5,11860,5701],[5,500,11861],[5,409,11862],[5,97,11863],[5,47,407],[5,98,11865],[5,97,11866],[5,11867,5701],[5,97,11868],[5,11869,5701],[5,11864,11870],[5,11859,11871],[5,11855,11872],[5,671,645],[5,493,11874],[5,98,11875],[5,97,11876],[5,47,756],[5,98,11878],[5,97,11879],[5,11880,5701],[5,97,11881],[5,493,8767],[5,98,11883],[5,97,11884],[5,11885,5701],[5,97,11886],[5,11887,5701],[5,11882,11888],[5,11877,11889],[5,97,739],[5,306,315],[5,11892,730],[5,72,11893],[5,11894,733],[5,72,11895],[5,6402,593],[5,11896,11897],[5,98,11898],[5,97,11899],[5,11900,5701],[5,97,11901],[5,11902,5701],[5,11891,11903],[5,11891,11899],[5,6043,963],[5,11906,1384],[5,493,11907],[5,98,11908],[5,97,11909],[5,97,7039],[5,11911,5701],[5,97,11912],[5,11913,5701],[5,11910,11914],[5,11910,7039],[5,7,1389],[5,11917,963],[5,11918,1384],[5,493,11919],[5,98,11920],[5,97,11921],[5,98,1389],[5,97,11923],[5,7037,5701],[5,11924,11925],[5,97,11926],[5,11558,11912],[5,97,11928],[5,11929,5701],[5,11927,11930],[5,11922,11931],[5,6078,963],[5,11933,1384],[5,493,11934],[5,98,11935],[5,97,11936],[5,97,11925],[5,11938,5701],[5,11937,11939],[5,11937,2181],[5,98,5923],[5,97,11942],[5,97,11058],[5,11944,5701],[5,11786,11945],[5,11943,11946],[5,98,7410],[5,97,11948],[5,98,7602],[5,97,11950],[5,11951,5701],[5,97,11952],[5,11953,5701],[5,11949,11954],[5,11949,11950],[5,29,9288],[5,646,11957],[5,98,11958],[5,97,11959],[5,27,9288],[5,72,11961],[5,646,26],[5,11962,11963],[4,97,0,11964],[5,703,11965],[5,98,11966],[5,97,11967],[5,11968,5701],[5,97,11969],[5,11970,5701],[5,11960,11971],[5,11960,11967],[5,7575,5701],[5,97,11974],[5,870,5701],[5,97,11976],[5,11977,5701],[5,11975,11978],[5,7572,11979],[5,646,7445],[5,98,11981],[5,97,11982],[5,9082,5701],[5,870,11984],[5,97,11985],[5,11986,5701],[5,11983,11987],[5,11983,869],[5,11983,9081],[5,97,11984],[5,11991,5701],[5,11977,11992],[5,9079,11993],[5,646,11],[5,98,11995],[5,97,11996],[5,11997,5701],[5,98,11840],[5,97,11999],[5,318,135],[5,98,12001],[5,97,12002],[5,324,852],[5,7732,12004],[4,23,0,12005],[5,6402,12006],[5,98,12007],[5,97,12008],[5,12009,5701],[5,12003,12010],[5,473,12011],[5,97,12012],[5,12013,5701],[5,12000,12014],[5,12000,472],[5,12000,12002],[5,12000,12008],[5,47,5540],[5,98,12019],[5,97,12020],[5,12021,5701],[5,25,1490],[5,12023,1506],[5,47,12024],[5,98,12025],[5,97,12026],[5,12027,5701],[5,25,5370],[5,12029,1506],[5,47,12030],[5,98,12031],[5,97,12032],[5,12033,5701],[5,47,4550],[5,98,12035],[5,97,12036],[5,47,4545],[5,98,12038],[5,97,12039],[5,12040,5701],[5,97,12041],[5,12042,5701],[5,12037,12043],[5,12037,12039],[5,1349,9312],[5,98,12046],[5,97,12047],[5,10224,1348],[5,25,12049],[5,12050,11410],[5,98,12051],[5,12048,12052],[5,9309,12053],[5,10209,12054],[5,3754,9326],[5,98,12056],[5,97,12057],[5,1349,9331],[5,98,12059],[5,97,12060],[5,9343,1348],[5,11031,12062],[5,25,12063],[5,9347,1348],[5,12064,12065],[5,98,12066],[5,12061,12067],[5,12058,12068],[5,646,1123],[5,98,12070],[5,97,12071],[5,47,9080],[5,98,12073],[5,97,12074],[5,12075,5701],[5,870,12076],[5,97,12077],[5,12078,5701],[5,12072,12079],[5,12072,869],[5,12072,12074],[5,646,8409],[5,98,12083],[5,97,12084],[5,1004,685],[5,8711,12086],[4,63,0,12087],[5,703,12088],[5,98,12089],[5,97,12090],[5,12091,5701],[5,97,12092],[5,12093,5701],[5,12085,12094],[5,12085,12090],[5,646,8397],[5,98,12097],[5,97,12098],[5,7685,5701],[5,758,12100],[5,97,12101],[5,12102,5701],[5,12099,12103],[5,12099,757],[5,12099,7684],[5,7651,367],[5,12107,5442],[5,646,12108],[5,98,12109],[5,97,12110],[5,1004,5442],[5,98,12112],[5,97,12113],[5,12114,5701],[5,97,12115],[5,12116,5701],[5,6369,12117],[5,12111,12118],[5,314,3745],[5,98,12120],[5,97,12121],[5,31,3745],[5,101,12123],[2,233,0,0],[5,9,12125],[5,12126,11],[5,12124,12127],[5,98,12128],[5,97,12129],[5,11031,12125],[5,25,12131],[2,234,0,0],[5,12132,12133],[5,98,12134],[5,97,12135],[5,9273,12125],[5,9322,12137],[5,9273,12133],[5,12138,12139],[5,3754,12140],[5,98,12141],[5,12136,12142],[5,12130,12143],[5,12122,12144],[2,235,0,0],[5,9,12146],[5,12147,11],[5,12126,12148],[5,12124,12149],[5,98,12150],[5,97,12151],[5,11031,12146],[5,25,12153],[2,236,0,0],[5,12154,12155],[5,98,12156],[5,97,12157],[5,9271,12137],[5,12159,12146],[5,9322,12160],[5,9271,12139],[5,12162,12155],[5,12161,12163],[5,3754,12164],[5,98,12165],[5,12158,12166],[5,12136,12167],[5,12152,12168],[5,12122,12169],[2,237,0,0],[5,9,12171],[5,12172,11],[5,12147,12173],[5,12126,12174],[5,12124,12175],[5,98,12176],[5,97,12177],[5,11031,12171],[5,25,12179],[2,238,0,0],[5,12180,12181],[5,98,12182],[5,97,12183],[5,9271,12160],[5,12185,12171],[5,9322,12186],[5,9271,12163],[5,12188,12181],[5,12187,12189],[5,3754,12190],[5,98,12191],[5,12184,12192],[5,12158,12193],[5,12136,12194],[5,12178,12195],[5,12122,12196],[2,239,0,0],[5,9,12198],[5,12199,11],[5,12172,12200],[5,12147,12201],[5,12126,12202],[5,12124,12203],[5,98,12204],[5,97,12205],[5,11031,12198],[5,25,12207],[2,240,0,0],[5,12208,12209],[5,98,12210],[5,97,12211],[5,9271,12186],[5,12213,12198],[5,9322,12214],[5,9271,12189],[5,12216,12209],[5,12215,12217],[5,3754,12218],[5,98,12219],[5,12212,12220],[5,12184,12221],[5,12158,12222],[5,12136,12223],[5,12206,12224],[5,12122,12225],[2,241,0,0],[5,9,12227],[5,12228,11],[5,12199,12229],[5,12172,12230],[5,12147,12231],[5,12126,12232],[5,12124,12233],[5,98,12234],[5,97,12235],[5,11031,12227],[5,25,12237],[2,242,0,0],[5,12238,12239],[5,98,12240],[5,97,12241],[5,9271,12214],[5,12243,12227],[5,9322,12244],[5,9271,12217],[5,12246,12239],[5,12245,12247],[5,3754,12248],[5,98,12249],[5,12242,12250],[5,12212,12251],[5,12184,12252],[5,12158,12253],[5,12136,12254],[5,12236,12255],[5,12122,12256],[2,243,0,0],[5,9,12258],[5,12259,11],[5,12228,12260],[5,12199,12261],[5,12172,12262],[5,12147,12263],[5,12126,12264],[5,12124,12265],[5,98,12266],[5,97,12267],[5,11031,12258],[5,25,12269],[2,244,0,0],[5,12270,12271],[5,98,12272],[5,97,12273],[5,9271,12244],[5,12275,12258],[5,9322,12276],[5,9271,12247],[5,12278,12271],[5,12277,12279],[5,3754,12280],[5,98,12281],[5,12274,12282],[5,12242,12283],[5,12212,12284],[5,12184,12285],[5,12158,12286],[5,12136,12287],[5,12268,12288],[5,12122,12289],[2,245,0,0],[5,9,12291],[5,12292,11],[5,12259,12293],[5,12228,12294],[5,12199,12295],[5,12172,12296],[5,12147,12297],[5,12126,12298],[5,12124,12299],[5,98,12300],[5,97,12301],[5,11031,12291],[5,25,12303],[2,246,0,0],[5,12304,12305],[5,98,12306],[5,97,12307],[5,9271,12276],[5,12309,12291],[5,9322,12310],[5,9271,12279],[5,12312,12305],[5,12311,12313],[5,3754,12314],[5,98,12315],[5,12308,12316],[5,12274,12317],[5,12242,12318],[5,12212,12319],[5,12184,12320],[5,12158,12321],[5,12136,12322],[5,12302,12323],[5,12122,12324],[5,9306,645],[5,98,12326],[5,97,12327],[5,11070,645],[5,101,12329],[5,12330,645],[5,98,12331],[5,12328,12332],[5,11786,439],[5,47,9029],[5,98,12335],[5,97,12336],[5,47,9024],[5,98,12338],[5,97,12339],[5,12340,5701],[5,97,12341],[5,47,9021],[5,98,12343],[5,97,12344],[5,12345,5701],[5,97,12346],[5,12347,5701],[5,12342,12348],[5,12337,12349],[5,199,1098],[5,47,12351],[5,98,12352],[5,97,12353],[5,8631,5701],[5,97,12355],[5,12342,5701],[5,12356,12357],[5,12354,12358],[5,98,6808],[5,97,12360],[5,98,5571],[5,97,12362],[5,12363,5701],[4,23,6,12364],[5,5620,12365],[5,97,12366],[5,12367,5701],[5,12361,12368],[5,5578,5572],[5,5566,12370],[5,47,12371],[5,98,12372],[5,97,12373],[5,12374,5701],[5,97,12375],[5,12376,5701],[5,12361,12377],[5,12361,12373],[5,98,5573],[5,97,12380],[5,12381,5701],[5,97,12382],[5,12383,5701],[5,12361,12384],[5,12361,12380],[5,98,6780],[5,97,12387],[5,97,11818],[5,12389,5701],[5,11786,12390],[5,12388,12391],[5,6772,5701],[5,47,11800],[5,98,12394],[5,97,12395],[5,12396,11797],[5,12396,11793],[5,47,6592],[5,98,12399],[5,97,12400],[5,12401,11797],[5,12401,11793],[5,5692,5701],[5,97,12404],[5,47,5690],[5,98,12406],[5,97,12407],[2,14,0,6],[5,5566,12409],[5,47,12410],[5,98,12411],[5,97,12412],[5,12413,5701],[5,12408,12414],[5,97,12415],[5,12416,5701],[5,12405,12417],[5,98,6791],[5,97,12419],[5,2347,11058],[5,97,12421],[5,5768,11818],[5,97,12423],[5,12424,5701],[5,12422,12425],[5,12420,12426],[5,47,5934],[5,98,12428],[5,97,12429],[5,12430,5701],[5,97,12431],[5,12432,5701],[5,12408,12433],[5,12408,12429],[5,1250,5966],[5,47,12436],[5,98,12437],[5,97,12438],[5,47,2180],[5,98,12440],[5,8060,12441],[5,12439,12442],[5,47,738],[5,98,12444],[5,97,12445],[5,316,730],[5,72,12447],[5,12448,733],[5,72,12449],[5,27,574],[5,81,12451],[5,12452,592],[4,23,0,12453],[5,6402,12454],[5,12450,12455],[5,47,12456],[5,98,12457],[5,97,12458],[5,12459,5701],[5,97,12460],[5,12461,5701],[5,12446,12462],[5,12446,12458],[5,47,5698],[5,98,12465],[5,97,12466],[5,6288,5701],[5,5559,12468],[5,97,12469],[5,12470,5701],[5,12467,12471],[5,12467,5558],[5,12467,6287],[5,47,7410],[5,98,12475],[5,97,12476],[5,47,7602],[5,98,12478],[5,97,12479],[5,12480,5701],[5,97,12481],[5,12482,5701],[5,12477,12483],[5,12477,12479],[5,47,11958],[5,98,12486],[5,97,12487],[5,47,11966],[5,98,12489],[5,97,12490],[5,12491,5701],[5,97,12492],[5,12493,5701],[5,12488,12494],[5,12488,12490],[5,47,7570],[5,98,12497],[5,97,12498],[5,7680,5701],[5,7611,12500],[5,97,12501],[5,12502,5701],[5,12499,12503],[5,12499,7610],[5,12499,7679],[5,47,11981],[5,98,12507],[5,97,12508],[5,97,12500],[5,97,12076],[5,12511,5701],[5,12510,12512],[5,12509,12513],[5,47,9077],[5,98,12515],[5,97,12516],[5,7680,12076],[5,97,12518],[5,12519,5701],[5,12517,12520],[5,12517,7679],[5,12517,12074],[5,47,315],[5,98,12524],[5,97,12525],[5,12526,5701],[5,97,12527],[5,47,12001],[5,98,12529],[5,97,12530],[5,12531,5701],[5,97,12532],[5,47,12007],[5,98,12534],[5,97,12535],[5,12536,5701],[5,97,12537],[5,12538,5701],[5,12533,12539],[5,12528,12540],[5,11843,12541],[5,47,12070],[5,98,12543],[5,97,12544],[5,12510,11992],[5,12545,12546],[5,47,12083],[5,98,12548],[5,97,12549],[5,47,12089],[5,98,12551],[5,97,12552],[5,12553,5701],[5,97,12554],[5,12555,5701],[5,12550,12556],[5,12550,12552],[5,7756,8397],[5,47,12559],[5,98,12560],[5,97,12561],[5,7756,110],[5,47,12563],[5,98,12564],[5,97,12565],[5,12566,5701],[5,97,12567],[5,47,5974],[5,98,12569],[5,97,12570],[5,12571,5701],[5,97,12572],[5,12573,5701],[5,12568,12574],[5,12562,12575],[5,47,12109],[5,98,12577],[5,97,12578],[5,47,12112],[5,98,12580],[5,97,12581],[5,12582,5701],[5,6737,12583],[5,97,12584],[5,12585,5701],[5,12579,12586],[5,12579,6736],[5,12579,12581],[5,314,414],[5,47,12590],[5,98,12591],[5,97,12592],[5,12593,5701],[5,47,643],[5,98,12595],[5,97,12596],[5,12597,5701],[5,298,9288],[5,12599,11774],[5,314,12600],[5,47,12601],[5,98,12602],[5,97,12603],[5,12604,5701],[2,247,0,0],[5,1187,12606],[2,248,0,0],[5,12607,12608],[5,314,12609],[5,47,12610],[5,98,12611],[5,97,12612],[5,12613,5701],[5,98,6801],[5,97,12615],[5,11784,5701],[5,12616,12617],[5,12616,439],[5,98,6774],[5,97,12620],[5,11820,5701],[5,12621,12622],[5,12621,2346],[5,12621,6056],[5,47,6383],[5,98,12626],[5,97,12627],[5,47,8179],[5,98,12629],[5,97,12630],[5,12631,5701],[5,97,12632],[5,12633,5701],[5,12628,12634],[5,12628,12630],[5,6763,5701],[5,47,902],[4,23,0,12638],[5,703,12639],[5,47,12640],[5,98,12641],[5,97,12642],[5,12643,5701],[5,47,4],[5,98,12645],[5,97,12646],[5,101,12606],[5,12648,12608],[5,98,12649],[5,97,12650],[5,6058,12606],[5,47,12652],[5,98,12653],[5,97,12654],[5,12655,5701],[5,97,12656],[5,47,12608],[5,98,12658],[5,97,12659],[5,12660,5701],[5,97,12661],[5,12662,5701],[5,12657,12663],[5,12651,12664],[5,12647,12665],[5,6058,12608],[5,47,12667],[5,98,12668],[5,97,12669],[5,12670,5701],[5,97,12671],[5,47,12606],[5,98,12673],[5,97,12674],[5,12675,5701],[5,97,12676],[5,12677,5701],[5,12672,12678],[5,12651,12679],[5,12647,12680],[5,98,6308],[5,97,12682],[5,11784,11945],[5,12683,12684],[5,98,12608],[5,97,12686],[5,12687,5701],[5,97,12688],[5,12689,5701],[5,12657,12690],[5,12651,12691],[5,6095,12692],[5,98,12606],[5,97,12694],[5,12695,5701],[5,97,12696],[5,12697,5701],[5,12672,12698],[5,12651,12699],[5,6095,12700],[5,10145,10044],[5,787,12702],[5,11733,12703],[5,98,12704],[5,1463,10218],[5,11741,12706],[5,98,12707],[5,97,12708],[5,9306,11406],[5,72,12710],[5,1127,963],[5,101,12712],[5,332,11406],[5,31,11406],[5,12714,12715],[5,12713,12716],[5,12711,12717],[5,98,12718],[5,12709,12719],[5,2634,12123],[5,72,12721],[5,11031,2633],[5,101,12723],[5,12724,412],[5,12722,12725],[5,98,12726],[5,97,12727],[5,567,3745],[5,1187,1310],[5,12730,405],[5,12729,12731],[5,31,12732],[5,2634,12733],[5,72,12734],[5,34,12732],[5,12736,2633],[5,101,12737],[5,12738,412],[5,12735,12739],[5,98,12740],[5,12728,12741],[5,47,12721],[5,98,12743],[5,97,12744],[5,1187,2633],[5,12746,412],[5,12729,12747],[5,31,12748],[5,2634,12749],[5,72,12750],[5,34,12748],[5,12752,2633],[5,101,12753],[5,12754,412],[5,12751,12755],[5,98,12756],[5,12745,12757],[5,31,12747],[5,2634,12759],[5,72,12760],[5,34,12747],[5,12762,2633],[5,101,12763],[5,12764,412],[5,12761,12765],[5,98,12766],[5,3011,1310],[5,47,12768],[5,98,12769],[5,97,12770],[5,12730,412],[5,12729,12772],[5,31,12773],[5,2634,12774],[5,47,12775],[5,98,12776],[5,12771,12777],[5,12745,12778],[5,31,12772],[5,2634,12780],[5,47,12781],[5,98,12782],[5,12771,12783],[5,9273,4],[5,101,12785],[0,249,2],[5,12787,9272],[5,12788,4],[5,12786,12789],[5,98,12790],[5,12787,9288],[5,12792,12606],[5,9271,12793],[5,12794,12608],[5,101,12795],[5,12787,12793],[5,12797,12608],[5,12796,12798],[5,98,12799],[5,12792,4],[5,0,12801],[5,7,9307],[5,12803,9290],[5,12804,12785],[5,12802,12805],[2,250,0,0],[5,12787,12807],[5,12808,12606],[5,12787,12809],[5,12810,12608],[5,101,12811],[2,251,0,0],[5,12788,12813],[5,12812,12814],[5,47,12815],[5,98,12816],[5,101,12814],[5,12818,12811],[5,47,12819],[5,98,12820],[5,47,7046],[5,98,12822],[5,97,12823],[5,101,12789],[5,12788,307],[5,12825,12826],[5,47,12827],[5,98,12828],[5,12824,12829],[5,12787,4],[5,12831,12807],[5,101,12832],[5,12787,307],[2,252,0,0],[5,12834,12835],[5,12833,12836],[5,47,12837],[5,98,12838],[5,97,12839],[5,12787,12832],[2,253,0,0],[5,12841,12842],[5,101,12843],[5,12787,12836],[5,12845,12842],[5,12844,12846],[5,47,12847],[5,98,12848],[5,12840,12849],[5,101,12842],[2,254,0,0],[5,12851,12852],[5,47,12853],[5,98,12854],[5,97,12855],[5,12845,12852],[5,12844,12857],[5,47,12858],[5,98,12859],[5,12856,12860],[5,9306,12801],[5,98,12862],[5,9306,12329],[5,98,12864],[5,101,11463],[5,12866,11560],[5,98,12867],[5,0,12329],[5,7,12326],[5,12870,645],[5,12871,9272],[5,12869,12872],[5,101,11474],[5,12874,9272],[5,98,12875],[5,9092,1389],[5,1463,12877],[5,98,12878],[5,97,12879],[5,98,9186],[5,12880,12881],[5,1127,1384],[5,28,12883],[5,12884,1389],[5,1463,12885],[5,98,12886],[5,97,12887],[5,28,1384],[5,1127,1389],[5,12889,12890],[5,1463,12891],[5,98,12892],[5,12888,12893],[5,97,7080],[5,28,1389],[5,12896,11],[5,1463,12897],[5,98,12898],[5,12895,12899],[5,98,8179],[5,97,12901],[5,12902,5701],[5,97,12903],[5,12904,5701],[5,6385,12905],[5,6385,12901],[5,8113,5701],[5,97,12908],[5,12909,5701],[5,8105,12910],[5,8105,8112],[0,255,1],[5,12913,1378],[5,2985,12914],[5,98,12915],[5,12913,645],[5,1331,12917],[5,101,12918],[5,12913,12917],[5,12919,12920],[5,98,12921],[5,12913,1325],[5,0,12923],[5,7,1510],[5,12925,1336],[5,12926,1490],[5,12924,12927],[5,1309,12914],[5,12792,645],[5,9292,12930],[5,12929,12931],[5,98,12932],[5,1309,12917],[5,12792,367],[5,9292,12935],[5,12934,12936],[5,98,12937],[5,97,12938],[5,1309,12920],[5,12787,12935],[5,12941,5442],[5,9292,12942],[5,12940,12943],[5,98,12944],[5,12939,12945],[5,25,12917],[5,12947,1506],[5,98,12948],[5,47,9640],[5,98,12950],[5,97,12951],[5,6058,9288],[5,98,12953],[5,97,12954],[5,578,5753],[5,98,12956],[5,97,12957],[5,12958,12823],[5,12955,12959],[5,12952,12960],[5,5773,307],[5,98,12962],[5,97,12963],[5,12964,12823],[5,12955,12965],[5,12952,12966],[5,9639,4],[5,98,12968],[5,97,12969],[5,12970,12959],[5,12952,12971],[5,12970,12965],[5,12952,12973],[5,98,12351],[5,97,12975],[5,9118,5701],[5,7368,12977],[5,97,12978],[5,12979,5701],[5,12976,12980],[5,12976,7367],[5,12976,9025],[5,493,135],[5,98,12984],[5,97,12985],[5,97,11088],[5,12987,5701],[5,5559,12988],[5,12986,12989],[5,5559,5830],[5,12986,12991],[5,9306,3745],[5,98,12993],[5,97,12994],[5,9292,3745],[5,101,12996],[5,12997,1325],[5,98,12998],[5,97,12999],[5,9271,3745],[5,13001,645],[5,34,13002],[5,13003,1336],[5,1004,13004],[5,98,13005],[5,13000,13006],[5,12995,13007],[5,1316,1506],[5,98,13009],[5,97,13010],[5,2616,12996],[5,98,13012],[5,97,13013],[5,11031,1312],[5,1004,13015],[5,98,13016],[5,97,13017],[5,13001,4],[5,34,13019],[5,13020,1312],[5,1004,13021],[5,98,13022],[5,13018,13023],[5,13014,13024],[5,9650,13025],[5,13011,13026],[5,12995,13027],[5,10045,10044],[5,11733,13029],[5,11733,13030],[5,98,13031],[5,72,9630],[5,31,5753],[5,9311,13034],[5,13033,13035],[5,11741,13036],[5,98,13037],[5,97,13038],[5,9634,367],[5,9306,13040],[5,72,13041],[5,101,12715],[5,31,13040],[5,13043,13044],[5,13042,13045],[5,12711,13046],[5,98,13047],[5,13039,13048],[5,98,13035],[5,13039,13050],[5,2322,12917],[5,98,13052],[5,4519,2851],[5,0,5786],[5,13055,2245],[5,0,5816],[5,13057,5580],[2,23,1,0],[5,455,13059],[5,455,13060],[5,0,13061],[5,13062,13060],[2,114,1,0],[5,9556,13064],[5,455,13065],[5,0,13066],[5,13067,13065],[2,48,1,0],[5,47,13069],[5,455,13070],[5,0,13071],[5,13072,13070],[0,149,77],[2,70,1,76],[5,13074,13075],[5,455,13076],[5,0,13077],[5,13078,13076],[5,9754,13064],[5,455,13080],[5,0,13081],[5,13082,13080],[0,78,77],[5,13084,13075],[5,455,13085],[5,0,13086],[5,13087,13085],[5,9748,13064],[5,455,13089],[5,0,13090],[5,13091,13089],[2,36,1,0],[5,314,13093],[5,455,13094],[5,0,13095],[5,13096,13094],[2,191,1,0],[5,9306,13098],[5,455,13099],[5,0,13100],[5,13101,13099],[2,81,1,0],[5,1589,13103],[2,97,1,0],[5,13104,13105],[5,455,13106],[5,0,13107],[5,13108,13106],[5,25,13103],[5,13110,1317],[5,98,13111],[5,97,13112],[5,25,13105],[5,13114,1317],[5,98,13115],[5,97,13116],[5,1309,13103],[5,13118,13105],[5,455,13119],[5,0,13120],[5,13121,13119],[5,13117,13122],[5,13113,13123],[5,344,13093],[5,13125,13069],[5,455,13126],[5,0,13127],[5,13128,13126],[5,394,13093],[5,13130,13069],[5,455,13131],[5,0,13132],[5,13133,13131],[5,477,13069],[2,79,1,0],[5,13135,13136],[5,455,13137],[5,0,13138],[5,13139,13137],[5,72,13069],[5,13141,13136],[5,455,13142],[5,0,13143],[5,13144,13142],[5,3733,13105],[5,13146,13103],[5,455,13147],[5,0,13148],[5,13149,13147],[5,13117,13150],[5,13113,13151],[5,9730,13069],[5,13153,13064],[5,455,13154],[5,0,13155],[5,13156,13154],[5,9723,13069],[5,13158,13064],[5,455,13159],[5,0,13160],[5,13161,13159],[5,81,13069],[5,13163,13136],[5,455,13164],[5,0,13165],[5,13166,13164],[5,306,13069],[5,13168,13136],[5,455,13169],[5,0,13170],[5,13171,13169],[5,7923,13069],[5,13173,13136],[5,455,13174],[5,0,13175],[5,13176,13174],[2,154,1,0],[5,101,13178],[2,155,1,0],[5,13179,13180],[5,455,13181],[5,0,13182],[5,13183,13181],[5,9741,13069],[5,13185,13064],[5,455,13186],[5,0,13187],[5,13188,13186],[5,73,13069],[5,13190,13136],[5,455,13191],[5,0,13192],[5,13193,13191],[5,45,13069],[2,70,1,1],[5,13196,26],[4,23,0,13197],[5,13195,13198],[5,455,13199],[5,0,13200],[5,13201,13199],[5,855,13069],[5,13203,13198],[5,455,13204],[5,0,13205],[5,13206,13204],[5,25,13059],[5,13208,13069],[5,455,13209],[5,0,13210],[5,13211,13209],[5,7,13069],[5,13213,13178],[5,13214,13180],[5,455,13215],[5,0,13216],[5,455,13178],[5,13213,13218],[5,455,13180],[5,13219,13220],[5,13217,13221],[5,0,6429],[5,13223,5580],[5,0,7083],[5,13225,5580],[2,23,2,0],[5,455,13227],[5,1120,13228],[5,0,13229],[5,13230,5580],[2,114,2,0],[5,9556,13232],[5,1120,13233],[5,0,13234],[5,13235,5580],[2,48,2,0],[5,47,13237],[5,1120,13238],[5,0,13239],[5,13240,5580],[0,149,80],[2,70,2,79],[5,13242,13243],[5,1120,13244],[5,0,13245],[5,13246,5580],[5,9754,13232],[5,1120,13248],[5,0,13249],[5,13250,5580],[0,78,80],[5,13252,13243],[5,1120,13253],[5,0,13254],[5,13255,5580],[5,9748,13232],[5,1120,13257],[5,0,13258],[5,13259,5580],[2,36,2,0],[5,314,13261],[5,1120,13262],[5,0,13263],[5,13264,5580],[2,191,2,0],[5,9306,13266],[5,1120,13267],[5,0,13268],[5,13269,5580],[2,81,2,0],[5,1589,13271],[2,97,2,0],[5,13272,13273],[5,1120,13274],[5,0,13275],[5,13276,5580],[5,25,13271],[5,13278,1317],[5,98,13279],[5,97,13280],[5,25,13273],[5,13282,1317],[5,98,13283],[5,97,13284],[5,1309,13271],[5,13286,13273],[5,1120,13287],[5,0,13288],[5,13289,5580],[5,13285,13290],[5,13281,13291],[5,344,13261],[5,13293,13237],[5,1120,13294],[5,0,13295],[5,13296,5580],[5,394,13261],[5,13298,13237],[5,1120,13299],[5,0,13300],[5,13301,5580],[5,477,13237],[2,79,2,0],[5,13303,13304],[5,1120,13305],[5,0,13306],[5,13307,5580],[5,72,13237],[5,13309,13304],[5,1120,13310],[5,0,13311],[5,13312,5580],[5,3733,13273],[5,13314,13271],[5,1120,13315],[5,0,13316],[5,13317,5580],[5,13285,13318],[5,13281,13319],[5,9730,13237],[5,13321,13232],[5,1120,13322],[5,0,13323],[5,13324,5580],[5,9723,13237],[5,13326,13232],[5,1120,13327],[5,0,13328],[5,13329,5580],[5,81,13237],[5,13331,13304],[5,1120,13332],[5,0,13333],[5,13334,5580],[5,306,13237],[5,13336,13304],[5,1120,13337],[5,0,13338],[5,13339,5580],[5,7923,13237],[5,13341,13304],[5,1120,13342],[5,0,13343],[5,13344,5580],[2,154,2,0],[5,101,13346],[2,155,2,0],[5,13347,13348],[5,1120,13349],[5,0,13350],[5,13351,5580],[5,9741,13237],[5,13353,13232],[5,1120,13354],[5,0,13355],[5,13356,5580],[5,73,13237],[5,13358,13304],[5,1120,13359],[5,0,13360],[5,13361,5580],[5,45,13237],[2,70,2,1],[5,13364,26],[4,23,0,13365],[5,13363,13366],[5,1120,13367],[5,0,13368],[5,13369,5580],[5,855,13237],[5,13371,13366],[5,1120,13372],[5,0,13373],[5,13374,5580],[5,25,13227],[5,13376,13237],[5,1120,13377],[5,0,13378],[5,13379,5580],[5,1120,13346],[5,98,13381],[5,97,13382],[2,14,2,0],[5,1120,13384],[5,98,13385],[5,97,13386],[5,7,13237],[5,13388,13346],[5,13389,13384],[5,1120,13390],[5,0,13391],[5,13392,5580],[5,13387,13393],[5,13383,13394],[5,559,5755],[4,23,0,13396],[5,24,13397],[5,0,13398],[5,13399,5755],[5,73,13064],[5,9195,13069],[5,13402,13136],[5,13401,13403],[5,98,13404],[5,97,13405],[5,9613,13064],[5,9556,13407],[5,0,13408],[5,13409,13065],[5,13406,13410],[2,40,2,0],[5,9381,13412],[5,9556,13413],[5,0,13414],[5,13415,5580],[5,0,6750],[5,13417,5580],[5,0,6758],[5,13419,2245],[5,0,13070],[5,455,13069],[5,101,13422],[5,13423,2245],[5,13421,13424],[2,70,1,0],[5,47,13426],[5,47,13427],[5,0,13428],[5,455,13426],[5,13429,13430],[5,13075,26],[4,23,75,13432],[5,13074,13433],[5,47,13434],[5,0,13435],[5,47,13432],[4,23,75,13437],[5,13084,13438],[5,13436,13439],[0,78,83],[2,70,1,82],[5,13442,26],[4,23,81,13443],[5,13441,13444],[5,47,13445],[5,0,13446],[0,149,83],[5,47,13443],[4,23,81,13449],[5,13448,13450],[5,13447,13451],[5,477,13426],[2,86,1,0],[5,13453,13454],[5,47,13455],[5,0,13456],[5,72,13427],[5,47,13454],[5,13458,13459],[5,13457,13460],[5,72,13426],[5,13462,13454],[5,47,13463],[5,0,13464],[5,477,13427],[5,13466,13459],[5,13465,13467],[5,81,13426],[5,13469,13454],[5,47,13470],[5,0,13471],[5,13462,13459],[5,13472,13473],[5,306,13426],[5,13475,13454],[5,47,13476],[5,0,13477],[5,13475,13459],[5,13478,13479],[5,787,13069],[5,47,13481],[5,0,13482],[5,27,13069],[4,23,0,13484],[5,703,13485],[5,13483,13486],[5,101,13069],[5,13488,11],[5,47,13489],[5,0,13490],[5,13491,13486],[5,101,13059],[5,13493,13059],[5,47,13494],[5,0,13495],[5,13496,2245],[5,47,13199],[5,0,13498],[5,47,13197],[4,23,0,13500],[5,13203,13501],[5,13499,13502],[5,47,13204],[5,0,13504],[5,13195,13501],[5,13505,13506],[0,149,86],[2,86,1,85],[5,13509,26],[5,13469,13510],[4,23,84,13511],[5,13508,13512],[5,0,13513],[4,23,84,13510],[5,13508,13515],[5,13469,13516],[5,13514,13517],[0,149,89],[2,70,1,88],[5,13520,26],[5,81,13521],[5,13522,13454],[4,23,87,13523],[5,13519,13524],[5,0,13525],[0,78,89],[4,23,87,13521],[5,13527,13528],[5,81,13529],[5,13530,13454],[5,13526,13531],[0,149,92],[2,86,1,91],[5,13534,26],[5,13453,13535],[4,23,90,13536],[5,13533,13537],[5,0,13538],[4,23,90,13535],[5,13533,13540],[5,13453,13541],[5,13539,13542],[0,149,95],[2,70,1,94],[5,13545,26],[5,477,13546],[5,13547,13454],[4,23,93,13548],[5,13544,13549],[5,0,13550],[4,23,93,13546],[5,13544,13552],[5,477,13553],[5,13554,13454],[5,13551,13555],[2,86,1,82],[5,13557,26],[5,13462,13558],[4,23,81,13559],[5,13448,13560],[5,0,13561],[4,23,81,13558],[5,13448,13563],[5,13462,13564],[5,13562,13565],[5,72,13432],[5,13567,13454],[4,23,75,13568],[5,13074,13569],[5,0,13570],[5,72,13434],[5,13572,13454],[5,13571,13573],[5,13179,26],[5,81,13575],[5,13576,13197],[4,23,0,13577],[5,6402,13578],[5,0,13579],[5,13196,13178],[5,455,13581],[5,13580,13582],[5,559,13178],[5,81,13584],[5,13585,13197],[4,23,0,13586],[5,6402,13587],[5,0,13588],[5,13589,13582],[4,23,81,13426],[5,13448,13591],[5,0,13592],[5,13593,13430],[5,9754,13407],[5,0,13595],[5,13596,13080],[5,13406,13597],[5,9754,13413],[5,0,13599],[5,13600,5580],[5,9381,5755],[5,9889,13602],[5,0,13603],[5,13604,5755],[0,78,86],[5,13606,13512],[5,0,13607],[5,13606,13515],[5,13469,13609],[5,13608,13610],[5,13527,13524],[5,0,13612],[5,13519,13528],[5,81,13614],[5,13615,13454],[5,13613,13616],[0,78,92],[5,13618,13537],[5,0,13619],[5,13618,13540],[5,13453,13621],[5,13620,13622],[0,78,95],[5,13624,13549],[5,0,13625],[5,13624,13552],[5,477,13627],[5,13628,13454],[5,13626,13629],[5,13441,13560],[5,0,13631],[5,13441,13563],[5,13462,13633],[5,13632,13634],[5,13084,13569],[5,0,13636],[5,13084,13433],[5,72,13638],[5,13639,13454],[5,13637,13640],[5,72,13575],[5,13642,13197],[4,23,0,13643],[5,703,13644],[5,0,13645],[5,13646,13582],[5,72,13584],[5,13648,13197],[4,23,0,13649],[5,703,13650],[5,0,13651],[5,13652,13582],[5,559,13346],[4,23,0,13654],[5,703,13655],[5,0,13656],[5,13657,5580],[4,23,75,13426],[5,13084,13659],[5,0,13660],[5,13661,13430],[5,13347,26],[4,23,0,13663],[5,703,13664],[5,0,13665],[5,13666,5580],[5,9748,13407],[5,0,13668],[5,13669,13089],[5,13406,13670],[5,9748,13413],[5,0,13672],[5,13673,5580],[5,10306,13602],[5,0,13675],[5,13676,5755],[5,0,7421],[5,13678,7424],[5,0,10082],[5,13680,5580],[5,0,5271],[5,13682,5580],[5,0,5087],[5,13684,5580],[5,0,4543],[5,13686,5580],[5,25,13261],[5,309,13412],[2,41,2,0],[5,13689,13690],[5,13688,13691],[5,98,13692],[5,97,13693],[5,0,13262],[5,13695,5580],[5,13694,13696],[5,373,13261],[5,314,13698],[5,0,13699],[5,13700,5580],[2,85,2,0],[5,1187,13702],[5,13703,13384],[5,314,13704],[5,0,13705],[5,13706,5580],[5,567,13261],[2,49,2,0],[5,13708,13709],[5,314,13710],[5,0,13711],[5,13712,5580],[5,98,13267],[5,97,13714],[5,9271,13266],[5,13716,13384],[5,314,13717],[5,0,13718],[5,13719,5580],[5,13715,13720],[5,25,13266],[5,9255,13412],[5,13722,13723],[5,98,13724],[5,97,13725],[5,13726,13720],[5,298,13412],[2,14,2,1],[5,13728,13729],[5,314,13730],[5,0,13731],[5,13732,5580],[5,410,13261],[2,98,2,0],[5,13734,13735],[5,13736,13384],[5,314,13737],[5,0,13738],[5,13739,5580],[5,0,10044],[5,13741,11],[5,31,1330],[5,0,13743],[5,13744,1317],[5,31,1691],[5,0,13746],[5,13747,1317],[5,0,4521],[5,13749,1506],[5,98,13099],[5,97,13751],[5,31,13098],[5,0,13753],[5,9292,13098],[5,3019,13755],[5,13754,13756],[5,13752,13757],[5,25,13098],[2,40,1,0],[5,9255,13760],[5,13759,13761],[5,98,13762],[5,97,13763],[5,13764,13757],[5,25,13093],[5,309,5755],[2,41,1,0],[5,13767,13768],[5,13766,13769],[5,98,13770],[5,97,13771],[5,31,13093],[5,0,13773],[5,13774,5755],[5,13772,13775],[5,373,13093],[5,31,13777],[5,0,13778],[5,332,13093],[5,13780,13773],[5,13779,13781],[2,85,1,0],[5,1187,13783],[2,14,1,0],[5,13784,13785],[5,31,13786],[5,0,13787],[5,9,13783],[5,13789,11],[5,13788,13790],[5,567,13093],[2,49,1,0],[5,13792,13793],[5,31,13794],[5,0,13795],[5,28,13773],[5,31,13793],[5,13797,13798],[5,13796,13799],[5,9271,13098],[5,13801,13785],[5,31,13802],[5,0,13803],[5,1331,13755],[5,3019,13805],[5,13804,13806],[5,298,5755],[2,14,1,1],[5,13808,13809],[5,31,13810],[5,0,13811],[5,13812,5755],[5,410,13093],[2,69,1,0],[5,13814,13815],[5,13816,13785],[5,31,13817],[5,0,13818],[5,13819,13773],[5,0,10003],[5,13821,11],[5,73,5755],[5,13823,13403],[5,98,13824],[5,97,13825],[5,9613,5755],[5,9613,13827],[5,0,13828],[5,13829,5755],[5,13826,13830],[5,9381,13069],[5,9613,13832],[5,0,13833],[5,13834,13832],[5,9613,13403],[5,0,13836],[5,9195,13136],[5,13838,13069],[5,13837,13839],[5,0,7497],[5,13841,11],[5,78,5755],[5,29,13843],[5,0,13844],[5,13845,5755],[5,9,13103],[5,13847,13069],[5,29,13848],[5,0,13849],[5,28,13103],[5,29,13069],[5,13851,13852],[5,13850,13853],[5,0,7324],[5,13855,11],[5,9,5755],[5,13857,11],[5,238,13858],[5,0,13859],[5,13860,5755],[5,98,13490],[5,97,13862],[5,238,13848],[5,0,13864],[5,249,13103],[5,238,13069],[5,13866,13867],[5,13865,13868],[5,13863,13869],[5,1419,1378],[5,0,13871],[5,13872,1378],[5,25,5755],[5,13874,1317],[5,98,13875],[5,97,13876],[5,1419,5755],[5,1419,13878],[5,0,13879],[5,13880,5755],[5,13877,13881],[5,1376,13103],[5,13883,13105],[5,1419,13884],[5,0,13885],[5,1419,13103],[5,1376,13887],[5,1419,13105],[5,13888,13889],[5,13886,13890],[5,13117,13891],[5,13113,13892],[5,0,10084],[5,13894,5580],[5,9306,13717],[5,0,13896],[5,13897,5580],[5,13715,13898],[5,0,10453],[5,13900,1378],[5,9292,13802],[5,0,13902],[5,13903,13805],[5,13752,13904],[5,13764,13904],[5,0,9431],[5,13907,11],[5,3272,13103],[5,0,13909],[5,13910,1378],[5,13113,13911],[5,1755,13103],[5,13913,1378],[5,0,13914],[5,13915,1378],[5,13113,13916],[5,13913,13889],[5,0,13918],[5,13913,13105],[5,1419,13920],[5,13919,13921],[5,13117,13922],[5,13113,13923],[5,1331,13105],[5,13913,13925],[5,0,13926],[5,1376,13920],[5,13928,13103],[5,13927,13929],[5,13117,13930],[5,13113,13931],[5,1692,13105],[5,13913,13933],[5,0,13934],[5,13928,13887],[5,13935,13936],[5,13117,13937],[5,13113,13938],[5,1755,13887],[5,13940,13105],[5,0,13941],[5,13942,13921],[5,13117,13943],[5,13113,13944],[5,1331,13103],[5,1755,13946],[5,13947,13105],[5,0,13948],[5,13928,13105],[5,13949,13950],[5,13117,13951],[5,13113,13952],[5,1692,13103],[5,1755,13954],[5,13955,13105],[5,0,13956],[5,13928,13889],[5,13957,13958],[5,13117,13959],[5,13113,13960],[5,1812,5755],[5,0,13962],[5,13963,5755],[5,13877,13964],[5,1376,5755],[5,13966,1378],[5,0,13967],[5,13968,5755],[5,13877,13969],[5,13883,13887],[5,0,13971],[5,13972,1378],[5,13113,13973],[5,1419,13925],[5,13883,13975],[5,0,13976],[5,13883,13889],[5,1692,13978],[5,13977,13979],[5,13117,13980],[5,13113,13981],[5,1419,13933],[5,13883,13983],[5,0,13984],[5,1331,13978],[5,13985,13986],[5,13117,13987],[5,13113,13988],[5,13883,13925],[5,0,13990],[5,1331,13884],[5,13991,13992],[5,13117,13993],[5,13113,13994],[5,13883,13933],[5,0,13996],[5,1692,13884],[5,13997,13998],[5,13117,13999],[5,13113,14000],[5,13888,13103],[5,0,14002],[5,14003,1378],[5,13113,14004],[5,1419,13946],[5,1376,14006],[5,14007,13105],[5,0,14008],[5,13888,13105],[5,1692,14010],[5,14009,14011],[5,13117,14012],[5,13113,14013],[5,1419,13954],[5,1376,14015],[5,14016,13105],[5,0,14017],[5,1331,14010],[5,14018,14019],[5,13117,14020],[5,13113,14021],[5,13966,13105],[5,1376,14023],[5,14024,13889],[5,0,14025],[5,14026,5755],[5,13117,14027],[5,13877,14028],[5,13883,5755],[5,1376,14030],[5,14031,13887],[5,0,14032],[5,14033,5755],[5,13877,14034],[5,13113,14035],[2,98,1,0],[5,25,14037],[5,14038,1317],[5,98,14039],[5,97,14040],[5,1376,13884],[5,1376,14037],[5,14043,13105],[5,1419,14044],[5,14042,14045],[5,0,14046],[5,1419,14037],[5,13883,14048],[5,14047,14049],[5,14041,14050],[5,13117,14051],[5,13113,14052],[5,13883,14037],[5,1419,14054],[5,14042,14055],[5,0,14056],[5,1376,13105],[5,14058,14048],[5,14057,14059],[5,14041,14060],[5,13117,14061],[5,13113,14062],[5,13966,13889],[5,1376,14064],[5,14065,13105],[5,0,14066],[5,14067,5755],[5,13117,14068],[5,13877,14069],[5,13888,5755],[5,1376,14071],[5,14072,13103],[5,0,14073],[5,14074,5755],[5,13877,14075],[5,13113,14076],[5,1376,13946],[5,14078,13105],[5,0,14079],[5,14080,13992],[5,13117,14081],[5,13113,14082],[5,1376,13954],[5,14084,13105],[5,0,14085],[5,14086,13998],[5,13117,14087],[5,13113,14088],[2,29,1,0],[5,25,14090],[5,14091,1317],[5,98,14092],[5,97,14093],[5,1334,14090],[5,14095,14090],[5,0,14096],[5,9,14090],[5,14098,11],[5,14097,14099],[5,14094,14100],[2,94,1,0],[5,25,14102],[5,14103,1317],[5,98,14104],[5,97,14105],[5,1309,14090],[5,1331,14102],[5,14107,14108],[5,98,14109],[5,97,14110],[5,14095,14108],[5,0,14112],[5,14095,14102],[5,28,14114],[5,9,14108],[5,14116,11],[5,14115,14117],[5,14113,14118],[5,14111,14119],[5,14106,14120],[5,14094,14121],[2,88,1,0],[5,25,14123],[5,14124,1506],[5,98,14125],[5,97,14126],[5,1331,14123],[5,1334,14128],[5,14129,1378],[5,0,14130],[5,14131,11],[5,14127,14132],[5,2322,13887],[5,0,14134],[5,13104,1378],[5,14135,14136],[5,13113,14137],[5,2322,13920],[5,0,14139],[5,2322,13103],[5,72,14141],[5,2322,13105],[5,14142,14143],[5,477,14144],[5,72,14136],[5,1589,13105],[5,14147,1378],[5,14146,14148],[5,14145,14149],[5,14140,14150],[5,13117,14151],[5,13113,14152],[2,91,2,0],[5,25,14154],[5,14155,1317],[5,98,14156],[5,97,14157],[5,1483,14154],[5,98,14159],[5,97,14160],[5,1331,14154],[5,2322,14162],[5,0,14163],[5,14164,5580],[5,14161,14165],[5,14158,14166],[5,1483,13105],[5,98,14168],[5,97,14169],[5,0,14148],[5,14171,2245],[5,13117,14172],[5,14170,14173],[5,13104,13103],[5,0,14175],[5,14176,2245],[2,29,2,0],[5,1309,14178],[2,94,2,0],[5,14179,14180],[5,98,14181],[5,97,14182],[5,25,14178],[5,14184,1317],[5,98,14185],[5,97,14186],[5,25,14180],[5,14188,1317],[5,98,14189],[5,97,14190],[2,88,2,0],[5,25,14192],[5,14193,1317],[5,98,14194],[5,97,14195],[5,2322,14192],[5,98,14197],[5,97,14198],[5,1589,14178],[5,1376,14192],[5,14201,14180],[5,14200,14202],[5,0,14203],[5,14204,5580],[5,14199,14205],[5,14196,14206],[5,14191,14207],[5,14187,14208],[5,14183,14209],[5,1376,14180],[5,14211,14192],[5,14200,14212],[5,0,14213],[5,14214,5580],[5,14199,14215],[5,14196,14216],[5,14191,14217],[5,14187,14218],[5,14183,14219],[5,14200,14180],[5,98,14221],[5,97,14222],[5,1483,14192],[5,98,14224],[5,97,14225],[5,14226,14205],[5,14196,14227],[5,14191,14228],[5,14187,14229],[5,14223,14230],[5,14226,14215],[5,14196,14232],[5,14191,14233],[5,14187,14234],[5,14223,14235],[5,1331,13271],[5,13272,14237],[5,0,14238],[5,14239,5580],[5,13281,14240],[5,13104,13925],[5,0,14242],[5,14243,13119],[5,13117,14244],[5,13113,14245],[5,13104,13933],[5,0,14247],[5,1589,13946],[5,14249,13105],[5,14248,14250],[5,13117,14251],[5,13113,14252],[5,1589,13887],[5,14254,1378],[5,0,14255],[5,14256,14141],[5,13113,14257],[5,14254,13889],[5,0,14259],[5,14147,13103],[5,14260,14261],[5,13117,14262],[5,13113,14263],[5,1589,14037],[5,14265,1378],[5,98,14266],[5,97,14267],[5,13913,14037],[5,1589,14269],[5,1755,13105],[5,14271,14037],[5,14270,14272],[5,0,14273],[5,14274,14261],[5,14268,14275],[5,14041,14276],[5,13117,14277],[5,13113,14278],[5,2322,14037],[5,98,14280],[5,97,14281],[5,14274,13106],[5,14282,14283],[5,14041,14284],[5,13117,14285],[5,13113,14286],[5,1755,14037],[5,14288,13103],[5,1589,14289],[5,14288,13105],[5,14290,14291],[5,0,14292],[5,14293,14261],[5,14268,14294],[5,14041,14295],[5,13117,14296],[5,13113,14297],[5,14293,13106],[5,14282,14299],[5,14041,14300],[5,13117,14301],[5,13113,14302],[2,89,1,0],[5,25,14304],[5,14305,1317],[5,98,14306],[5,97,14307],[5,1376,14102],[5,14309,14090],[5,1589,14310],[5,1376,14304],[5,14312,14090],[5,14311,14313],[5,0,14314],[5,1589,14102],[5,14316,14304],[5,14315,14317],[5,14308,14318],[5,14106,14319],[5,14094,14320],[5,1376,14090],[5,14322,14102],[5,1589,14323],[5,14322,14304],[5,14324,14325],[5,0,14326],[5,14327,14317],[5,14308,14328],[5,14106,14329],[5,14094,14330],[2,91,1,0],[5,25,14332],[5,14333,1317],[5,98,14334],[5,97,14335],[5,1483,14332],[5,98,14337],[5,97,14338],[5,1331,14332],[5,1589,14340],[5,14341,1378],[5,0,14342],[5,14343,2245],[5,14339,14344],[5,14336,14345],[5,14249,13925],[5,0,14347],[5,14348,13106],[5,13117,14349],[5,13113,14350],[5,1589,13954],[5,14352,13105],[5,0,14353],[5,14354,14242],[5,13117,14355],[5,13113,14356],[5,1692,13271],[5,1589,14358],[5,14359,13271],[5,0,14360],[5,14361,5580],[5,13281,14362],[5,14354,13119],[5,13117,14364],[5,13113,14365],[5,14352,13933],[5,0,14367],[5,14368,13106],[5,13117,14369],[5,13113,14370],[5,1483,13887],[5,0,14372],[5,13118,1378],[5,14373,14374],[5,13113,14375],[5,9292,13266],[5,1483,14377],[5,0,14378],[5,14379,5580],[5,13715,14380],[5,13726,14380],[5,1483,13946],[5,0,14383],[5,1483,13103],[5,477,14385],[5,101,13103],[5,14387,2998],[5,14386,14388],[5,14384,14389],[5,13113,14390],[5,1483,13954],[5,0,14392],[5,72,14385],[5,14387,1378],[5,47,14395],[5,14394,14396],[5,14393,14397],[5,13113,14398],[5,98,14143],[5,97,14400],[5,1309,13105],[5,14402,1378],[5,0,14403],[5,14404,2245],[5,13117,14405],[5,14401,14406],[5,1309,14332],[5,14408,1378],[5,0,14409],[5,101,14332],[5,14411,1378],[5,14410,14412],[5,14339,14413],[5,14336,14414],[5,13286,13271],[5,0,14416],[5,14417,5580],[5,13281,14418],[5,13118,13975],[5,0,14420],[5,13104,13889],[5,14421,14422],[5,13117,14423],[5,13113,14424],[5,98,13287],[5,97,14426],[5,14201,13273],[5,13286,14428],[5,0,14429],[5,14430,5580],[5,14226,14431],[5,14196,14432],[5,13285,14433],[5,13281,14434],[5,14427,14435],[5,1376,13273],[5,14437,14192],[5,13286,14438],[5,0,14439],[5,14440,5580],[5,14226,14441],[5,14196,14442],[5,13285,14443],[5,13281,14444],[5,14427,14445],[5,1483,13271],[5,98,14447],[5,97,14448],[5,1309,13273],[5,1376,13271],[5,14451,13273],[5,14450,14452],[5,0,14453],[5,14454,5580],[5,13285,14455],[5,14449,14456],[5,13281,14457],[5,14437,13271],[5,14450,14459],[5,0,14460],[5,14461,5580],[5,13285,14462],[5,14449,14463],[5,13281,14464],[5,13118,13925],[5,0,14466],[5,477,13119],[5,14387,13925],[5,14468,14469],[5,14467,14470],[5,13117,14471],[5,13113,14472],[5,13286,14237],[5,0,14474],[5,14475,5580],[5,13281,14476],[5,13118,13954],[5,0,14478],[5,14479,2245],[5,13113,14480],[5,13118,13933],[5,0,14482],[5,14483,13106],[5,13117,14484],[5,13113,14485],[5,1309,13946],[5,14487,13105],[5,14483,14488],[5,13117,14489],[5,13113,14490],[5,1309,13887],[5,14492,1378],[5,0,14493],[5,14494,14385],[5,13113,14495],[5,14492,13889],[5,0,14497],[5,14402,13103],[5,14498,14499],[5,13117,14500],[5,13113,14501],[5,1309,14015],[5,14503,13105],[5,0,14504],[5,14254,13105],[5,14505,14506],[5,13117,14507],[5,13113,14508],[5,1309,14269],[5,14510,14272],[5,0,14511],[5,14512,14499],[5,14268,14513],[5,14041,14514],[5,13117,14515],[5,13113,14516],[5,1309,14289],[5,14518,14291],[5,0,14519],[5,14520,14499],[5,14268,14521],[5,14041,14522],[5,13117,14523],[5,13113,14524],[5,14512,13119],[5,14282,14526],[5,14041,14527],[5,13117,14528],[5,13113,14529],[5,14520,13119],[5,14282,14531],[5,14041,14532],[5,13117,14533],[5,13113,14534],[5,1309,14310],[5,14536,14090],[5,0,14537],[5,1309,14102],[5,14539,1378],[5,14538,14540],[5,14106,14541],[5,14094,14542],[5,1309,14323],[5,14544,14090],[5,0,14545],[5,14546,14540],[5,14106,14547],[5,14094,14548],[5,14536,14313],[5,0,14550],[5,14539,14304],[5,14551,14552],[5,14308,14553],[5,14106,14554],[5,14094,14555],[5,14544,14325],[5,0,14557],[5,14558,14552],[5,14308,14559],[5,14106,14560],[5,14094,14561],[5,1376,14178],[5,1419,14192],[5,14563,14564],[5,1309,14565],[5,14566,14180],[5,0,14567],[5,14568,5580],[5,14226,14569],[5,14196,14570],[5,14191,14571],[5,14187,14572],[5,14183,14573],[5,1419,14154],[5,14563,14575],[5,1309,14576],[5,14577,14178],[5,0,14578],[5,14579,5580],[5,14161,14580],[5,14158,14581],[5,14187,14582],[5,1376,14564],[5,14584,14178],[5,1309,14585],[5,14586,14180],[5,0,14587],[5,14588,5580],[5,14226,14589],[5,14196,14590],[5,14191,14591],[5,14187,14592],[5,14183,14593],[5,1376,14575],[5,14595,14178],[5,1309,14596],[5,14597,14178],[5,0,14598],[5,14599,5580],[5,14161,14600],[5,14158,14601],[5,14187,14602],[5,14487,1378],[5,0,14604],[5,72,14374],[5,14606,14396],[5,14605,14607],[5,13113,14608],[5,14487,13103],[5,0,14610],[5,14611,2245],[5,13113,14612],[5,0,14488],[5,14614,13106],[5,13117,14615],[5,13113,14616],[5,14487,13925],[5,0,14618],[5,14619,13119],[5,13117,14620],[5,13113,14621],[5,1331,14310],[5,1309,14623],[5,14624,14313],[5,0,14625],[5,1309,14108],[5,14627,14304],[5,14626,14628],[5,14308,14629],[5,14106,14630],[5,14094,14631],[5,1331,14323],[5,1309,14633],[5,14634,14325],[5,0,14635],[5,14636,14628],[5,14308,14637],[5,14106,14638],[5,14094,14639],[5,1309,13954],[5,14641,1378],[5,0,14642],[5,477,14374],[5,14387,1490],[5,14644,14645],[5,14643,14646],[5,13113,14647],[5,14641,13105],[5,0,14649],[5,14650,14466],[5,13117,14651],[5,13113,14652],[5,1309,14358],[5,14654,13271],[5,0,14655],[5,14656,5580],[5,13281,14657],[5,14641,13933],[5,0,14659],[5,14660,13119],[5,13117,14661],[5,13113,14662],[5,1692,14310],[5,1309,14664],[5,14665,14313],[5,0,14666],[5,1692,14102],[5,1309,14668],[5,14669,14304],[5,14667,14670],[5,14308,14671],[5,14106,14672],[5,14094,14673],[5,1692,14323],[5,1309,14675],[5,14676,14325],[5,0,14677],[5,14678,14670],[5,14308,14679],[5,14106,14680],[5,14094,14681],[5,13293,11],[5,0,14683],[5,14684,5580],[5,9,13227],[5,14686,11],[5,13293,14687],[5,0,14688],[5,14689,5580],[5,344,13698],[5,31,13698],[5,14691,14692],[5,0,14693],[5,14694,5580],[5,6349,13426],[5,0,14696],[5,14697,13430],[5,6340,13426],[5,0,14699],[5,14700,5580],[5,13453,2245],[5,0,14702],[5,14703,13430],[5,13453,5580],[5,0,14705],[5,14706,5580],[5,13453,13426],[5,0,14708],[5,14709,13430],[5,13453,13455],[5,0,14711],[5,14712,13455],[5,477,13455],[2,107,1,0],[5,14714,14715],[5,0,14716],[5,477,13454],[5,14718,14715],[5,13453,14719],[5,14717,14720],[5,6266,13426],[5,0,14722],[5,14723,2245],[5,6257,13426],[5,0,14725],[5,14726,13430],[5,13462,2245],[5,0,14728],[5,14729,2245],[5,13462,5580],[5,0,14731],[5,14732,13430],[5,13462,13426],[5,0,14734],[5,14735,13430],[5,13462,13463],[5,0,14737],[5,14738,13463],[5,72,13463],[5,14740,14715],[5,0,14741],[5,72,13454],[5,14743,14715],[5,13462,14744],[5,14742,14745],[5,98,14141],[5,97,14747],[5,3706,13103],[5,14749,13103],[5,0,14750],[5,14751,1378],[5,14748,14752],[5,13113,14753],[5,14749,1490],[5,0,14755],[5,14756,1378],[5,13113,14757],[5,14271,13103],[5,3706,14759],[5,14760,13105],[5,0,14761],[5,14762,1378],[5,14401,14763],[5,13117,14764],[5,13113,14765],[5,3706,13920],[5,14767,13105],[5,0,14768],[5,14769,1378],[5,14401,14770],[5,13117,14771],[5,13113,14772],[5,14058,13103],[5,3706,14774],[5,14775,13105],[5,0,14776],[5,14749,13105],[5,14777,14778],[5,14401,14779],[5,13117,14780],[5,13113,14781],[5,3706,13884],[5,14783,13105],[5,0,14784],[5,14785,14778],[5,14401,14786],[5,13117,14787],[5,13113,14788],[5,3706,13978],[5,14790,13105],[5,0,14791],[5,14792,14778],[5,14401,14793],[5,13117,14794],[5,13113,14795],[5,13883,14272],[5,3706,14797],[5,14798,13105],[5,0,14799],[5,14800,14778],[5,14041,14801],[5,14401,14802],[5,13117,14803],[5,13113,14804],[5,13883,14291],[5,3706,14806],[5,14807,13105],[5,0,14808],[5,14809,14778],[5,14041,14810],[5,14401,14811],[5,13117,14812],[5,13113,14813],[5,1376,13889],[5,14815,13103],[5,3706,14816],[5,14817,13105],[5,0,14818],[5,14819,14778],[5,14401,14820],[5,13117,14821],[5,13113,14822],[5,1376,14291],[5,14824,13103],[5,3706,14825],[5,14826,13105],[5,0,14827],[5,14828,14778],[5,14041,14829],[5,14401,14830],[5,13117,14831],[5,13113,14832],[5,1376,14272],[5,14834,13103],[5,3706,14835],[5,14836,13105],[5,0,14837],[5,14838,14778],[5,14041,14839],[5,14401,14840],[5,13117,14841],[5,13113,14842],[5,3706,14778],[5,14844,13105],[5,0,14845],[5,14846,14778],[5,14401,14847],[5,13117,14848],[5,13113,14849],[5,4057,13103],[5,0,14851],[5,14852,14395],[5,13113,14853],[5,3733,13271],[5,14855,1378],[5,0,14856],[5,14857,5580],[5,13281,14858],[5,14855,13271],[5,0,14860],[5,14861,5580],[5,13281,14862],[5,1755,13271],[5,14864,13273],[5,14855,14865],[5,0,14866],[5,14867,5580],[5,13285,14868],[5,13281,14869],[5,1755,13273],[5,14871,13271],[5,14855,14872],[5,0,14873],[5,14874,5580],[5,13285,14875],[5,13281,14876],[5,25,13735],[5,14878,1317],[5,98,14879],[5,97,14880],[5,14855,13273],[5,98,14882],[5,97,14883],[5,14855,13735],[5,98,14885],[5,97,14886],[5,14437,13735],[5,14855,14888],[5,0,14889],[5,14890,5580],[5,14887,14891],[5,14884,14892],[5,14881,14893],[5,13285,14894],[5,13281,14895],[5,4300,13271],[5,0,14897],[5,14898,5580],[5,13281,14899],[5,3695,13103],[5,14901,13103],[5,0,14902],[5,14903,1490],[5,14748,14904],[5,13113,14905],[5,3695,5755],[5,14907,1490],[5,0,14908],[5,14909,5755],[5,13877,14910],[5,14271,5755],[5,3695,14912],[5,14913,13105],[5,0,14914],[5,14915,5755],[5,14401,14916],[5,13117,14917],[5,13877,14918],[5,1755,5755],[5,14920,13105],[5,3695,14921],[5,14922,13105],[5,0,14923],[5,14924,5755],[5,14401,14925],[5,13117,14926],[5,13877,14927],[5,3695,14774],[5,14929,13105],[5,0,14930],[5,14901,13105],[5,1331,14932],[5,14931,14933],[5,14401,14934],[5,13117,14935],[5,13113,14936],[5,3695,13884],[5,14938,13105],[5,0,14939],[5,14940,14933],[5,14401,14941],[5,13117,14942],[5,13113,14943],[5,3695,13978],[5,14945,13105],[5,0,14946],[5,1692,14932],[5,14947,14948],[5,14401,14949],[5,13117,14950],[5,13113,14951],[5,3695,14797],[5,14953,13105],[5,0,14954],[5,14043,14932],[5,14955,14956],[5,14041,14957],[5,14401,14958],[5,13117,14959],[5,13113,14960],[5,3695,14806],[5,14962,13105],[5,0,14963],[5,14964,14956],[5,14041,14965],[5,14401,14966],[5,13117,14967],[5,13113,14968],[5,3695,14816],[5,14970,13105],[5,0,14971],[5,14972,14948],[5,14401,14973],[5,13117,14974],[5,13113,14975],[5,3695,14825],[5,14977,13105],[5,0,14978],[5,14979,14956],[5,14041,14980],[5,14401,14981],[5,13117,14982],[5,13113,14983],[5,3695,14835],[5,14985,13105],[5,0,14986],[5,14987,14956],[5,14041,14988],[5,14401,14989],[5,13117,14990],[5,13113,14991],[5,3695,14778],[5,14993,13105],[5,0,14994],[5,14995,1378],[5,14401,14996],[5,13117,14997],[5,13113,14998],[5,7973,13196],[5,0,15000],[5,15001,11],[5,182,13069],[5,30,13136],[5,13809,26],[4,63,0,15005],[5,15004,15006],[5,27,15007],[4,23,0,15008],[5,15003,15009],[5,0,15010],[5,249,15007],[5,15012,13069],[5,15011,15013],[5,182,13136],[2,86,1,1],[5,15016,26],[4,63,0,15017],[5,15015,15018],[5,27,15019],[4,23,0,15020],[5,15003,15021],[5,0,15022],[5,249,13069],[5,15024,13136],[5,182,15025],[4,23,0,15017],[5,15026,15027],[5,15023,15028],[4,23,0,13426],[5,15003,15030],[5,0,15031],[5,7,13426],[5,15033,13069],[5,15034,11],[5,15032,15035],[4,63,0,13197],[5,15003,15037],[5,182,15038],[5,15039,15027],[5,0,15040],[5,72,13197],[5,15042,15017],[4,23,0,15043],[5,15003,15044],[5,15041,15045],[5,182,13848],[5,15047,13198],[5,0,15048],[5,13196,13103],[5,7,15050],[5,15003,13198],[5,13847,15052],[5,15051,15053],[5,15054,15052],[5,15049,15055],[5,8096,13069],[5,0,15057],[5,15058,11],[5,596,13069],[5,15060,13069],[5,0,15061],[5,15062,11],[5,13847,13136],[5,596,15064],[2,82,1,0],[5,15065,15066],[5,0,15067],[5,13110,15066],[5,7,15069],[5,596,13136],[5,15071,15066],[5,15070,15072],[5,13847,15072],[5,15073,15074],[5,15068,15075],[5,7968,13809],[5,0,15077],[5,15078,11],[5,30,13069],[4,23,0,13785],[5,15080,15081],[5,0,15082],[5,7,13489],[5,15084,11],[5,9,13785],[5,15086,11],[5,15085,15087],[5,15083,15088],[5,30,5755],[5,15090,8776],[5,0,15091],[5,15092,5755],[2,36,1,1],[5,15094,26],[4,63,0,15095],[5,15080,15096],[5,30,15097],[4,23,0,15005],[5,15098,15099],[5,0,15100],[5,13809,15095],[4,63,0,15102],[5,15080,15103],[5,15101,15104],[5,30,13848],[5,15106,15099],[5,0,15107],[5,13809,13103],[5,9,15109],[5,15080,15099],[5,15110,15111],[5,15108,15112],[5,6557,13426],[5,0,15114],[5,15115,5580],[5,6562,13426],[5,0,15117],[5,15118,13430],[5,13469,2245],[5,0,15120],[5,15121,13427],[5,13469,5580],[5,0,15123],[5,15124,5580],[5,13469,13426],[5,0,15126],[5,15127,5580],[5,13469,13427],[5,0,15129],[5,15130,13427],[5,6505,13426],[5,0,15132],[5,15133,13427],[5,6492,13426],[5,0,15135],[5,15136,13430],[5,13475,2245],[5,0,15138],[5,15139,13427],[5,13475,5580],[5,0,15141],[5,15142,13430],[5,13475,13426],[5,0,15144],[5,15145,5580],[5,13336,13237],[5,0,15147],[5,15148,5580],[5,306,13427],[5,15150,13459],[5,0,15151],[5,15152,13476],[5,101,13430],[5,15154,2245],[5,306,15155],[5,455,13454],[5,101,15157],[5,15158,2245],[5,15156,15159],[5,0,15160],[5,15161,13476],[5,9194,5755],[5,15163,10860],[5,0,15164],[5,15165,5755],[5,13826,15166],[5,0,6431],[5,15168,2245],[5,5713,13426],[5,0,15170],[5,101,13426],[5,15172,2245],[5,15171,15173],[5,0,7085],[5,15175,2245],[5,5706,13426],[5,0,15177],[5,15172,5580],[5,15178,15179],[5,5706,13059],[5,0,15181],[5,15182,13060],[5,78,13760],[5,787,15184],[5,0,15185],[5,15186,2245],[5,787,13761],[5,0,15188],[5,15189,2245],[5,182,13760],[5,15191,13196],[5,787,15192],[5,0,15193],[5,45,13760],[5,15195,13501],[5,15194,15196],[5,15060,13136],[5,787,15198],[5,0,15199],[5,15200,13191],[5,30,13760],[5,15202,13809],[5,787,15203],[5,0,15204],[5,101,13760],[5,15206,11],[5,15205,15207],[5,309,13760],[5,15209,13768],[5,787,15210],[5,0,15211],[5,47,15207],[5,72,15213],[5,101,13768],[5,15215,11],[5,15214,15216],[5,15212,15217],[5,13847,13760],[5,787,15219],[5,0,15220],[5,15221,2245],[5,28,13760],[5,15223,13768],[5,787,15224],[5,0,15225],[5,72,15207],[5,15227,15216],[5,15226,15228],[5,249,13760],[5,15230,13768],[5,787,15231],[5,0,15232],[5,27,13768],[5,47,15234],[4,23,0,15235],[5,15195,15236],[5,15233,15237],[5,13780,13069],[5,787,15239],[5,0,15240],[5,15024,13773],[5,101,15242],[5,15243,11],[5,15241,15244],[5,787,13403],[5,0,15246],[5,477,13489],[5,101,13136],[5,15249,11],[5,15248,15250],[5,15247,15251],[5,314,13098],[5,98,15253],[5,97,15254],[5,10061,13098],[5,0,15256],[5,101,13753],[5,15258,11],[5,72,15259],[5,101,13755],[5,15261,1378],[5,15260,15262],[5,15257,15263],[5,15255,15264],[5,1870,13887],[5,0,15266],[5,15267,14395],[5,13113,15268],[5,1870,13920],[5,0,15270],[5,477,14395],[5,101,13105],[5,15273,1378],[5,15272,15274],[5,15271,15275],[5,13117,15276],[5,13113,15277],[5,1870,13978],[5,0,15279],[5,14387,13105],[5,15280,15281],[5,13117,15282],[5,13113,15283],[5,1870,14010],[5,0,15285],[5,15286,15281],[5,13117,15287],[5,13113,15288],[5,14333,1506],[5,98,15290],[5,97,15291],[5,1870,14340],[5,0,15293],[5,15294,2245],[5,15292,15295],[5,4528,14332],[5,1870,15297],[5,0,15298],[5,15299,2245],[5,15292,15300],[5,13493,5580],[5,0,15302],[5,15303,13060],[5,101,13098],[5,15305,9272],[5,0,15306],[5,15307,15263],[5,15255,15308],[5,14387,13103],[5,0,15310],[5,15311,5580],[5,14387,13887],[5,0,15313],[5,15314,14395],[5,13113,15315],[5,1419,14128],[5,14411,15317],[5,0,15318],[5,15319,2245],[5,15292,15320],[5,14127,15321],[5,14387,14774],[5,0,15323],[5,15324,15274],[5,13117,15325],[5,13113,15326],[5,14387,13884],[5,0,15328],[5,15329,15274],[5,13117,15330],[5,13113,15331],[5,98,13094],[5,97,15333],[5,101,13093],[5,15335,13786],[5,0,15336],[5,101,13773],[5,15338,13790],[5,72,15339],[5,34,13093],[5,15341,13783],[5,101,15342],[5,15343,13785],[5,15340,15344],[5,15337,15345],[5,15334,15346],[5,14387,13946],[5,0,15348],[5,15349,2245],[5,13113,15350],[5,1331,14774],[5,14387,15352],[5,0,15353],[5,15273,2998],[5,15354,15355],[5,13117,15356],[5,13113,15357],[5,14387,13992],[5,0,15359],[5,15360,15355],[5,13117,15361],[5,13113,15362],[5,14387,13954],[5,0,15364],[5,15365,2245],[5,13113,15366],[5,1692,14774],[5,14387,15368],[5,0,15369],[5,15273,1490],[5,15370,15371],[5,13117,15372],[5,13113,15373],[5,14387,13998],[5,0,15375],[5,15376,15371],[5,13117,15377],[5,13113,15378],[5,567,13793],[2,75,1,0],[5,15380,15381],[5,15335,15382],[5,0,15383],[5,28,13798],[5,31,15381],[5,15385,15386],[5,15338,15387],[5,72,15388],[5,45,13798],[5,15341,26],[5,101,15391],[5,34,13793],[5,15393,26],[5,15392,15394],[4,23,0,15395],[5,15390,15396],[5,72,15397],[5,596,15386],[5,15399,13798],[5,45,15400],[5,34,15381],[5,15402,26],[5,15392,15403],[4,23,0,15404],[5,15401,15405],[5,15398,15406],[5,15389,15407],[5,15384,15408],[5,15334,15409],[5,101,13076],[5,15411,2245],[5,0,15412],[5,455,13432],[5,101,15414],[5,15415,2245],[4,23,75,15416],[5,13084,15417],[5,15413,15418],[5,13441,13442],[5,101,15420],[5,15421,2245],[5,0,15422],[5,455,13443],[5,101,15424],[5,15425,2245],[4,23,81,15426],[5,13448,15427],[5,15423,15428],[5,101,15184],[5,15430,11],[5,0,15431],[5,15432,2245],[5,29,13760],[5,101,15434],[5,15435,11],[5,0,15436],[5,15195,7511],[5,15437,15438],[5,101,13887],[5,15440,1378],[5,0,15441],[5,15442,14395],[5,13113,15443],[5,15440,13103],[5,0,15445],[5,15446,14395],[5,13113,15447],[5,15440,13889],[5,0,15449],[5,15450,15281],[5,13117,15451],[5,13113,15452],[5,1419,14332],[5,101,15454],[5,15455,14128],[5,0,15456],[5,15457,2245],[5,15292,15458],[5,14127,15459],[5,15440,13925],[5,0,15461],[5,15273,14006],[5,15462,15463],[5,13117,15464],[5,13113,15465],[5,101,15317],[5,15467,14332],[5,0,15468],[5,15469,2245],[5,15292,15470],[5,14127,15471],[5,101,13761],[5,15473,11],[5,0,15474],[5,15475,2245],[5,101,13920],[5,15477,1378],[5,0,15478],[5,15479,15275],[5,13117,15480],[5,13113,15481],[5,101,14759],[5,15483,13103],[5,0,15484],[5,477,15371],[5,15486,14395],[5,15485,15487],[5,13117,15488],[5,13113,15489],[5,15477,13103],[5,0,15491],[5,15492,15487],[5,13117,15493],[5,13113,15494],[5,101,14269],[5,15496,14272],[5,0,15497],[5,477,15281],[5,101,14037],[5,15500,1378],[5,15499,15501],[5,15498,15502],[5,14041,15503],[5,13117,15504],[5,13113,15505],[5,15477,14269],[5,0,15507],[5,15273,14037],[5,477,15509],[5,15510,14395],[5,15508,15511],[5,14041,15512],[5,13117,15513],[5,13113,15514],[5,15477,1490],[5,0,15516],[5,72,14645],[5,15518,15371],[5,477,15519],[5,72,14388],[5,15521,15355],[5,15520,15522],[5,15517,15523],[5,13117,15524],[5,13113,15525],[5,101,14774],[5,15527,13103],[5,0,15528],[5,15529,15274],[5,13117,15530],[5,13113,15531],[5,101,13884],[5,15533,13103],[5,0,15534],[5,15535,15274],[5,13117,15536],[5,13113,15537],[5,14043,13103],[5,15527,15539],[5,0,15540],[5,15541,15509],[5,14041,15542],[5,13117,15543],[5,13113,15544],[5,15533,14054],[5,0,15546],[5,15547,15509],[5,14041,15548],[5,13117,15549],[5,13113,15550],[5,101,13978],[5,15552,1378],[5,0,15553],[5,15554,15281],[5,13117,15555],[5,13113,15556],[5,101,14010],[5,15558,1378],[5,0,15559],[5,15560,15281],[5,13117,15561],[5,13113,15562],[2,106,1,0],[5,25,15564],[5,15565,1506],[5,98,15566],[5,97,15567],[5,14124,1317],[5,98,15569],[5,97,15570],[5,3673,15564],[5,101,15572],[5,1334,14123],[5,15574,14332],[5,15573,15575],[5,0,15576],[5,101,14123],[5,15578,1378],[5,72,15579],[5,101,15564],[5,15581,14332],[5,15580,15582],[5,15577,15583],[5,14336,15584],[5,15571,15585],[5,15568,15586],[5,15565,1317],[5,98,15588],[5,97,15589],[5,1334,14304],[5,15591,15564],[5,101,15592],[5,3673,14332],[5,15593,15594],[5,0,15595],[5,101,14304],[5,15597,1378],[5,72,15598],[5,15599,15582],[5,15596,15600],[5,15292,15601],[5,15590,15602],[5,14308,15603],[5,47,14412],[5,477,15605],[5,1491,14332],[5,15606,15607],[5,98,15608],[5,97,15609],[5,3019,14332],[5,15593,15611],[5,0,15612],[5,15597,1490],[5,72,15614],[5,15615,15582],[5,15613,15616],[5,15610,15617],[5,15292,15618],[5,15590,15619],[5,14308,15620],[5,15581,1378],[5,47,15622],[5,477,15623],[5,1491,15564],[5,15624,15625],[5,98,15626],[5,97,15627],[5,3019,15564],[5,101,15629],[5,15630,15575],[5,0,15631],[5,15578,1490],[5,72,15633],[5,15634,15582],[5,15632,15635],[5,15628,15636],[5,14336,15637],[5,15571,15638],[5,15568,15639],[5,101,13106],[5,15641,2245],[5,0,15642],[5,15643,14499],[5,13117,15644],[5,13113,15645],[5,101,13119],[5,15647,2245],[5,0,15648],[5,15649,14261],[5,13117,15650],[5,13113,15651],[5,101,13455],[5,15653,2245],[5,0,15654],[5,72,15155],[5,15656,15159],[5,15655,15657],[5,101,13463],[5,15659,2245],[5,0,15660],[5,477,15155],[5,15662,15159],[5,15661,15663],[5,101,14778],[5,15665,13103],[5,0,15666],[5,14058,2998],[5,3673,15668],[5,13110,15669],[5,15667,15670],[5,14401,15671],[5,13117,15672],[5,13113,15673],[5,101,14932],[5,15675,1378],[5,0,15676],[5,15677,15670],[5,14401,15678],[5,13117,15679],[5,13113,15680],[5,15675,2998],[5,0,15682],[5,1334,13889],[5,15684,2998],[5,13110,15685],[5,15683,15686],[5,14401,15687],[5,13117,15688],[5,13113,15689],[5,101,15192],[5,15691,11],[5,0,15692],[5,15693,15196],[5,101,15198],[5,15695,11],[5,0,15696],[5,15697,13191],[5,101,15203],[5,15699,11],[5,0,15700],[5,15701,15207],[5,101,13470],[5,15703,2245],[5,0,15704],[5,13462,15159],[5,15705,15706],[5,101,13476],[5,15708,2245],[5,0,15709],[5,13475,15159],[5,15710,15711],[5,101,13481],[5,15713,2245],[5,0,15714],[5,15715,13486],[5,1120,5755],[5,98,15717],[5,97,15718],[5,6133,2245],[5,101,15720],[5,15721,2245],[5,0,15722],[5,15723,5755],[5,15719,15724],[5,101,13489],[5,15726,2245],[5,0,15727],[5,15728,13486],[5,101,14412],[5,15730,2245],[5,0,15731],[5,2322,14332],[5,15732,15733],[5,14339,15734],[5,14336,15735],[5,101,15155],[5,15737,2245],[5,0,15738],[5,15739,13430],[5,101,15210],[5,15741,11],[5,0,15742],[5,15743,15217],[5,101,15219],[5,15745,11],[5,0,15746],[5,15747,2245],[5,101,13848],[5,9,13105],[5,15750,13136],[5,15749,15751],[5,0,15752],[5,13110,15751],[5,72,15754],[5,13190,15751],[5,72,15756],[5,13114,13848],[5,72,15758],[5,73,13136],[5,15760,13848],[5,15759,15761],[5,15757,15762],[5,15755,15763],[5,15753,15764],[5,101,13786],[5,15766,13093],[5,0,15767],[5,15768,15345],[5,15334,15769],[5,2985,13920],[5,0,15771],[5,15772,15523],[5,13117,15773],[5,13113,15774],[5,101,14340],[5,15776,1378],[5,0,15777],[5,15778,2245],[5,15292,15779],[5,101,13946],[5,15781,13103],[5,0,15782],[5,15783,2245],[5,13113,15784],[5,101,14128],[5,15786,15454],[5,0,15787],[5,15788,2245],[5,15292,15789],[5,14127,15790],[5,15781,13889],[5,0,15792],[5,14387,13975],[5,15793,15794],[5,13117,15795],[5,13113,15796],[5,15781,13925],[5,0,15798],[5,15799,15281],[5,13117,15800],[5,13113,15801],[5,101,15352],[5,15803,13103],[5,0,15804],[5,15805,15355],[5,13117,15806],[5,13113,15807],[5,101,13992],[5,15809,13103],[5,0,15810],[5,15811,15355],[5,13117,15812],[5,13113,15813],[5,101,13954],[5,15815,13103],[5,0,15816],[5,15817,2245],[5,13113,15818],[5,15815,13933],[5,0,15820],[5,15821,15281],[5,13117,15822],[5,13113,15823],[5,101,15368],[5,15825,13103],[5,0,15826],[5,15827,15371],[5,13117,15828],[5,13113,15829],[5,101,13998],[5,15831,13103],[5,0,15832],[5,15833,15371],[5,13117,15834],[5,13113,15835],[5,101,15297],[5,15837,1378],[5,0,15838],[5,15839,2245],[5,15292,15840],[5,4528,14123],[5,101,15842],[5,15843,15297],[5,0,15844],[5,15578,14332],[5,15845,15846],[5,15292,15847],[5,14127,15848],[5,101,15382],[5,15850,13093],[5,0,15851],[5,101,15394],[5,15853,15391],[4,23,0,15854],[5,15390,15855],[5,72,15856],[5,101,15403],[5,15858,15391],[4,23,0,15859],[5,15401,15860],[5,15857,15861],[5,15389,15862],[5,15852,15863],[5,15334,15864],[5,101,15224],[5,15866,11],[5,0,15867],[5,15868,15228],[5,101,15231],[5,15870,11],[5,0,15871],[5,15872,15237],[5,101,15239],[5,15874,11],[5,0,15875],[5,15876,15244],[5,101,13199],[5,15878,2245],[5,0,15879],[5,15880,13502],[5,101,13802],[5,15882,9272],[5,0,15883],[5,15884,2245],[5,13752,15885],[5,9306,13178],[5,98,15887],[5,97,15888],[5,9271,13178],[5,15890,13093],[5,15882,15891],[5,0,15892],[5,15305,13178],[5,72,15894],[5,101,13785],[5,15896,13093],[5,15895,15897],[5,15893,15898],[5,15889,15899],[5,13752,15900],[5,101,13204],[5,15902,2245],[5,0,15903],[5,15904,13506],[5,9200,13103],[5,15906,13105],[5,101,15907],[5,9200,14037],[5,15909,13783],[5,15908,15910],[5,0,15911],[5,14387,14037],[5,72,15913],[5,15273,13783],[5,15914,15915],[5,15912,15916],[5,101,13403],[5,15918,11],[5,0,15919],[5,15920,15251],[5,101,13817],[5,15922,13093],[5,0,15923],[5,25,13815],[5,15925,13773],[5,47,15926],[5,477,15927],[5,15341,13815],[5,101,15929],[5,15930,13785],[5,15928,15931],[5,15924,15932],[5,15334,15933],[5,13185,13407],[5,0,15935],[5,15936,13186],[5,13406,15937],[5,8101,13237],[5,0,15939],[5,15940,5580],[5,13190,11],[5,0,15942],[5,15943,13489],[5,13358,13237],[5,0,15945],[5,15946,5580],[5,73,15066],[5,15948,13867],[5,0,15949],[5,15948,26],[4,79,0,15951],[5,13195,15952],[5,15950,15953],[5,13863,15954],[5,15033,13760],[5,15956,13768],[5,13190,15957],[5,0,15958],[5,13190,13760],[5,13462,15960],[5,477,15961],[5,13190,13768],[5,13458,15963],[5,15962,15964],[5,15959,15965],[5,73,13852],[5,15967,15066],[5,0,15968],[5,128,15066],[4,23,0,15970],[5,13195,15971],[5,15969,15972],[5,73,13413],[5,9195,13412],[5,15975,13412],[5,15974,15976],[5,0,15977],[5,15978,5580],[5,73,13848],[5,15980,13136],[5,0,15981],[5,13110,13136],[5,72,15983],[5,15984,13191],[5,15982,15985],[5,73,13266],[5,9195,13237],[5,15988,13304],[5,15987,15989],[5,98,15990],[5,97,15991],[5,73,13232],[5,9195,13304],[2,82,2,0],[5,15994,15995],[5,15993,15996],[5,98,15997],[5,97,15998],[5,9418,13232],[5,16000,13266],[5,73,16001],[5,15988,15995],[5,16002,16003],[5,0,16004],[5,16005,5580],[5,15999,16006],[5,15992,16007],[5,15034,13136],[5,73,16009],[5,16010,13760],[5,0,16011],[5,15760,13760],[5,13458,16013],[5,15962,16014],[5,16012,16015],[5,13847,13848],[5,0,16017],[5,16018,13848],[5,15750,15066],[5,13847,16020],[5,0,16021],[5,13847,15066],[5,15750,16023],[5,16022,16024],[5,1331,14006],[5,0,16026],[5,16027,13887],[5,13113,16028],[5,1331,14085],[5,0,16030],[5,16031,13884],[5,13117,16032],[5,13113,16033],[5,1692,5755],[5,1331,16035],[5,0,16036],[5,16037,5755],[5,13877,16038],[5,1692,14079],[5,0,16040],[5,16041,13884],[5,13117,16042],[5,13113,16043],[5,1331,5755],[5,1692,16045],[5,0,16046],[5,16047,5755],[5,13877,16048],[5,13784,5755],[5,34,16050],[5,16051,13783],[5,0,16052],[5,16053,5755],[5,13208,13799],[5,98,16055],[5,97,16056],[5,34,13794],[5,16058,13059],[5,0,16059],[5,13208,13773],[5,7,16061],[5,15341,13059],[5,16062,16063],[5,15393,13059],[5,16064,16065],[5,16060,16066],[5,16057,16067],[5,2322,14304],[5,98,16069],[5,97,16070],[5,1309,14304],[5,16072,13805],[5,98,16073],[5,97,16074],[5,34,13802],[5,16076,14304],[5,0,16077],[5,15597,13805],[5,7,16079],[5,16080,13785],[5,34,13098],[5,16082,14304],[5,16081,16083],[5,16078,16084],[5,16075,16085],[5,16071,16086],[5,14308,16087],[5,13752,16088],[5,13764,16088],[5,16072,13755],[5,98,16091],[5,97,16092],[5,16078,16083],[5,16093,16094],[5,16071,16095],[5,14308,16096],[5,13752,16097],[5,13764,16097],[5,13801,5755],[5,34,16100],[5,16101,13805],[5,0,16102],[5,16103,5755],[5,13752,16104],[5,13764,16104],[5,15925,13760],[5,98,16107],[5,97,16108],[5,298,13760],[5,16110,13809],[5,34,16111],[5,16112,13815],[5,0,16113],[5,13809,13815],[5,16114,16115],[5,16109,16116],[2,67,1,0],[5,25,16118],[5,16119,13773],[5,98,16120],[5,97,16121],[5,34,13817],[5,16123,16118],[5,0,16124],[5,101,16118],[5,16126,13815],[5,7,16127],[5,16128,13785],[5,15341,16118],[5,16129,16130],[5,16125,16131],[5,16122,16132],[5,10585,14715],[5,0,16134],[5,16135,11],[5,9418,14715],[5,16137,11],[5,0,16138],[5,16139,11],[5,13838,15066],[5,13823,16141],[5,98,16142],[5,97,16143],[5,9418,5755],[5,9381,13136],[5,16145,16146],[5,0,16147],[5,16148,5755],[5,16144,16149],[5,16137,15224],[5,0,16151],[5,16137,13760],[5,28,16153],[5,16137,13768],[5,16154,16155],[5,16152,16156],[5,9418,16146],[5,16158,5755],[5,0,16159],[5,16160,5755],[5,13826,16161],[5,9418,15224],[5,16163,14715],[5,0,16164],[5,9418,13760],[5,16166,14715],[5,28,16167],[5,9418,13768],[5,16169,14715],[5,16168,16170],[5,16165,16171],[5,9092,5755],[5,0,16173],[5,16174,5755],[5,28,5755],[5,16176,11],[5,0,16177],[5,16178,5755],[5,16176,5755],[5,0,16180],[5,16181,5755],[5,28,15066],[5,16183,15064],[5,0,16184],[5,16183,13136],[5,13847,16186],[5,16185,16187],[5,28,15064],[5,16189,15066],[5,0,16190],[5,28,13136],[5,16192,15066],[5,13847,16193],[5,16191,16194],[5,8292,13069],[5,0,16196],[5,16197,11],[5,15024,11],[5,0,16199],[5,16200,11],[5,249,5755],[5,16202,5755],[5,0,16203],[5,16204,5755],[5,249,15066],[5,16206,15064],[5,0,16207],[5,16206,13136],[5,13847,16209],[5,15070,16210],[5,16211,16209],[5,16208,16212],[5,249,15064],[5,16214,15066],[5,0,16215],[5,249,13136],[5,16217,15066],[5,13847,16218],[5,15070,16219],[5,16220,16218],[5,16216,16221],[5,10145,13069],[5,0,16223],[5,16224,11],[5,332,13802],[5,16226,13069],[5,0,16227],[5,25,13805],[5,16229,13069],[5,7,16230],[5,332,13098],[5,16232,13069],[5,15086,16233],[5,16231,16234],[5,16235,16233],[5,16228,16236],[5,13752,16237],[5,11030,13196],[5,0,16239],[5,16240,5580],[5,14387,26],[5,81,16242],[5,16243,13197],[4,23,0,16244],[5,13195,16245],[5,0,16246],[5,13110,13069],[5,81,16248],[5,16249,15050],[5,16247,16250],[5,559,13103],[5,81,16252],[5,16253,13197],[4,23,0,16254],[5,13195,16255],[5,0,16256],[5,16257,16250],[5,13469,15017],[4,23,0,16259],[5,13195,16260],[5,0,16261],[5,13195,15027],[5,13469,16263],[5,16262,16264],[5,81,13197],[5,16266,13454],[4,23,0,16267],[5,13195,16268],[5,0,16269],[5,81,13204],[5,16271,13454],[5,16270,16272],[5,13453,15017],[4,23,0,16274],[5,13195,16275],[5,0,16276],[5,13453,16263],[5,16277,16278],[5,477,13197],[5,16280,13454],[4,23,0,16281],[5,13195,16282],[5,0,16283],[5,477,13199],[5,16285,13454],[5,16284,16286],[5,13462,15017],[4,23,0,16288],[5,13195,16289],[5,0,16290],[5,15248,13426],[5,72,16292],[5,16293,16263],[5,16291,16294],[5,15042,13454],[4,23,0,16296],[5,13195,16297],[5,0,16298],[5,72,13199],[5,15248,13454],[5,16300,16301],[5,16299,16302],[5,13195,15030],[5,0,16304],[5,81,13486],[5,16306,13426],[5,16305,16307],[5,27,13690],[5,81,16309],[5,16310,13365],[4,14,0,16311],[5,6402,16312],[5,98,16313],[5,97,16314],[5,45,13690],[4,14,0,13365],[5,16316,16317],[5,0,16318],[5,16319,5580],[5,16315,16320],[5,45,13852],[5,16322,13198],[5,0,16323],[5,4448,13198],[4,79,0,16325],[5,13195,16326],[5,16324,16327],[5,45,15038],[5,16329,15027],[5,0,16330],[5,16266,15017],[4,63,0,16332],[5,13195,16333],[5,16331,16334],[5,15080,15006],[5,45,16336],[5,16337,13198],[5,0,16338],[5,13196,15005],[4,63,0,16340],[5,13195,16341],[5,16339,16342],[5,45,13848],[5,16344,13198],[5,0,16345],[5,72,15050],[5,16347,13199],[5,16346,16348],[5,28,13069],[5,16350,13136],[5,45,16351],[5,16352,13198],[5,0,16353],[5,45,13136],[5,16355,13198],[5,16300,16356],[5,16354,16357],[5,45,15025],[5,16359,13198],[5,0,16360],[5,27,13136],[5,81,16362],[5,16363,13197],[4,23,0,16364],[5,13195,16365],[5,16361,16366],[5,855,11],[5,16368,13196],[5,0,16369],[5,16370,2245],[5,72,16242],[5,16372,13197],[4,23,0,16373],[5,13203,16374],[5,0,16375],[5,72,16248],[5,16377,15050],[5,16376,16378],[5,72,16252],[5,16380,13197],[4,23,0,16381],[5,13203,16382],[5,0,16383],[5,16384,16378],[4,23,0,16252],[5,13203,16386],[5,0,16387],[5,16388,16248],[5,13203,16260],[5,0,16390],[5,81,16292],[5,13203,15027],[5,16392,16393],[5,16391,16394],[5,13203,16268],[5,0,16396],[5,81,13199],[5,72,13490],[5,16399,13454],[5,16398,16400],[5,16397,16401],[5,13203,16275],[5,0,16403],[5,16399,13426],[5,477,16405],[5,16406,16393],[5,16404,16407],[5,13203,16282],[5,0,16409],[5,477,13204],[5,16411,16400],[5,16410,16412],[5,13203,16289],[5,0,16414],[5,13462,16393],[5,16415,16416],[5,13203,16297],[5,0,16418],[5,72,13204],[5,16420,13454],[5,16419,16421],[5,13203,15030],[5,0,16423],[5,72,13486],[5,16425,13426],[5,16424,16426],[4,23,0,16242],[5,13203,16428],[5,0,16429],[5,16430,16248],[5,855,13852],[5,16432,13198],[5,0,16433],[5,8573,13198],[4,79,0,16435],[5,13203,16436],[5,16434,16437],[5,15191,15037],[5,855,16439],[5,16440,15027],[5,0,16441],[5,855,13760],[4,63,0,15043],[5,16443,16444],[5,16442,16445],[5,15202,15006],[5,855,16447],[5,16448,13198],[5,0,16449],[5,16443,16341],[5,16450,16451],[5,855,13848],[5,16453,13198],[5,0,16454],[5,477,15050],[5,16456,13204],[5,16455,16457],[5,855,16351],[5,16459,13198],[5,0,16460],[5,855,13136],[5,16462,13198],[5,16411,16463],[5,16461,16464],[5,855,15025],[5,16466,13198],[5,0,16467],[5,72,16362],[5,16469,13197],[4,23,0,16470],[5,13203,16471],[5,16468,16472],[5,10079,13723],[5,0,16474],[5,16475,5580],[5,0,5540],[5,16477,5580],[5,0,5538],[5,16479,5580],[5,0,4526],[5,16481,5580],[5,13110,11],[5,0,16483],[5,16484,2245],[5,14038,9192],[5,0,16486],[5,15500,9202],[4,97,0,16488],[5,9280,16489],[4,81,0,16490],[5,9280,16491],[5,16487,16492],[5,9273,13227],[5,9271,16494],[2,63,2,0],[5,16495,16496],[5,25,16497],[5,16498,13232],[5,98,16499],[5,97,16500],[5,9889,13232],[5,13376,16502],[5,0,16503],[5,16504,5580],[5,16501,16505],[5,25,16496],[5,10306,13232],[5,16507,16508],[5,0,16509],[5,16510,5580],[5,16501,16511],[5,25,13069],[5,78,13136],[5,16513,16514],[5,0,16515],[5,16516,13191],[5,29,15066],[5,13110,16518],[5,0,16519],[5,855,15066],[5,13110,26],[4,79,0,16522],[5,16521,16523],[5,16520,16524],[5,238,15066],[5,13110,16526],[5,0,16527],[5,72,16519],[5,45,15066],[5,16530,16523],[5,16529,16531],[5,16528,16532],[5,14305,14114],[5,0,16534],[5,72,14306],[5,14107,14304],[5,72,16537],[5,16072,14102],[5,16538,16539],[5,16536,16540],[5,16535,16541],[2,89,2,0],[5,25,16543],[5,16544,1317],[5,98,16545],[5,97,16546],[5,14179,16543],[5,98,16548],[5,97,16549],[5,1309,16543],[5,16551,14180],[5,98,16552],[5,97,16553],[5,1334,14178],[5,16555,14180],[5,16544,16556],[5,0,16557],[5,16558,5580],[5,16554,16559],[5,16550,16560],[5,16547,16561],[5,15191,13198],[5,13110,16563],[5,0,16564],[5,13110,13760],[5,72,16566],[5,16567,15050],[5,16565,16568],[5,14038,15198],[5,0,16570],[5,14038,13069],[5,72,16572],[5,14038,13136],[5,47,16574],[5,16573,16575],[5,16571,16576],[5,15202,15099],[5,13110,16578],[5,0,16579],[5,14387,15005],[4,23,0,16581],[5,16443,16582],[5,16580,16583],[5,10048,13760],[5,13766,16585],[5,0,16586],[5,15335,9272],[5,16587,16588],[5,13208,13848],[5,0,16590],[5,13493,13103],[5,477,16592],[5,16593,13209],[5,16591,16594],[5,14038,16351],[5,0,16596],[5,477,16572],[5,16598,16574],[5,16597,16599],[5,14038,15025],[5,0,16601],[5,16573,16574],[5,16602,16603],[2,63,1,0],[5,25,16605],[5,16606,15239],[5,0,16607],[5,855,15242],[5,101,16605],[5,16610,15391],[4,23,0,16611],[5,16609,16612],[5,16608,16613],[5,13110,15957],[5,0,16615],[5,13462,16566],[5,477,16617],[5,13110,13768],[5,13458,16619],[5,16618,16620],[5,16616,16621],[5,25,15454],[5,16623,1506],[5,0,16624],[5,16625,14412],[5,15292,16626],[5,25,14575],[5,16628,1317],[5,0,16629],[5,16630,5580],[5,14158,16631],[5,25,14377],[5,16633,1317],[5,0,16634],[5,16635,5580],[5,13715,16636],[5,13726,16636],[5,14193,1506],[5,98,16639],[5,97,16640],[5,14155,1506],[5,98,16642],[5,97,16643],[5,1755,14192],[5,16645,14154],[5,25,16646],[5,16647,1506],[5,0,16648],[5,16649,5580],[5,16644,16650],[5,16641,16651],[5,25,14865],[5,16653,1317],[5,0,16654],[5,16655,5580],[5,13285,16656],[5,13281,16657],[5,14201,14154],[5,25,16659],[5,16660,1506],[5,0,16661],[5,16662,5580],[5,16644,16663],[5,16641,16664],[5,25,14452],[5,16666,1317],[5,0,16667],[5,16668,5580],[5,13285,16669],[5,13281,16670],[5,2322,13273],[5,98,16672],[5,97,16673],[5,3706,13271],[5,16675,13273],[5,25,16676],[5,16677,1317],[5,0,16678],[5,16679,5580],[5,16674,16680],[5,13285,16681],[5,13281,16682],[5,3695,13271],[5,16684,13273],[5,25,16685],[5,16686,1317],[5,0,16687],[5,16688,5580],[5,16674,16689],[5,13285,16690],[5,13281,16691],[5,13376,1317],[5,98,16693],[5,97,16694],[5,1331,13227],[5,25,16696],[5,16697,1317],[5,0,16698],[5,16699,5580],[5,16695,16700],[5,1692,13227],[5,25,16702],[5,16703,1317],[5,0,16704],[5,16705,5580],[5,16695,16706],[5,13376,1506],[5,98,16708],[5,97,16709],[5,4528,13227],[5,25,16711],[5,16712,1506],[5,0,16713],[5,16714,5580],[5,16710,16715],[5,13376,13412],[5,98,16717],[5,97,16718],[5,34,13261],[5,16720,13227],[5,25,16721],[5,16722,13690],[5,0,16723],[5,16724,5580],[5,16719,16725],[5,13694,16726],[5,25,13384],[5,16728,13412],[5,98,16729],[5,97,16730],[5,25,13717],[5,16732,13723],[5,0,16733],[5,16734,5580],[5,16731,16735],[5,13726,16736],[5,9273,13103],[5,9271,16738],[5,16739,13105],[5,25,16740],[5,16741,13407],[5,0,16742],[5,9273,13105],[5,9271,16744],[5,16745,13103],[5,25,16746],[5,16747,13064],[5,16743,16748],[5,13406,16749],[5,16495,13227],[5,25,16751],[5,16752,13413],[5,0,16753],[5,16754,5580],[5,16719,16755],[5,16741,13403],[5,0,16757],[5,13114,13136],[5,16377,16759],[5,16758,16760],[5,15033,13103],[5,16762,13105],[5,25,16763],[5,16764,13760],[5,0,16765],[5,13114,13760],[5,13458,16767],[5,16618,16768],[5,16766,16769],[5,6043,13178],[5,16771,5755],[5,0,16772],[5,16773,5755],[5,6078,5755],[5,16775,13785],[5,0,16776],[5,16777,5755],[5,13213,5755],[5,16779,5755],[5,0,16780],[5,16781,5755],[5,7,13136],[5,16783,13178],[5,16784,13180],[5,13213,16785],[5,16786,13815],[5,0,16787],[5,7,13142],[5,16789,13178],[5,47,13136],[5,13141,16791],[5,7,16792],[5,16793,13180],[5,16794,13815],[5,16790,16795],[5,16788,16796],[5,6133,16605],[5,7,16798],[5,16799,16605],[5,16800,5755],[5,0,16801],[5,16802,5755],[5,13213,13136],[5,16804,15066],[5,7,16805],[5,16806,13178],[5,16807,13785],[5,0,16808],[5,477,13142],[5,72,13070],[5,16811,15066],[5,16810,16812],[5,7,16813],[5,16814,13178],[5,16815,13785],[5,16809,16816],[5,0,7765],[5,16818,7803],[5,7667,16819],[5,6614,16820],[5,0,7668],[5,16822,7671],[5,7667,16823],[5,6614,16824],[5,0,7748],[5,16826,7751],[5,7667,16827],[5,6614,16828],[5,0,438],[5,16830,6229],[5,97,16831],[5,0,1284],[5,16833,6236],[5,97,16834],[5,0,5720],[5,16836,6482],[5,16835,16837],[5,16832,16838],[5,6234,16834],[5,97,16840],[5,0,5923],[5,16842,6541],[5,16841,16843],[5,16832,16844],[5,0,5967],[5,16846,5970],[5,5965,16847],[5,9381,13760],[5,13488,16849],[5,47,16850],[5,98,16851],[5,97,16852],[5,98,13484],[5,97,16854],[5,27,16849],[5,98,16856],[5,16855,16857],[5,6288,16858],[4,23,0,16859],[5,127,16860],[5,97,16861],[5,97,16857],[5,16863,16854],[5,6288,16864],[4,23,0,16865],[5,127,16866],[5,97,16867],[5,16868,5646],[5,16862,16869],[5,16853,16870],[5,101,16849],[5,16872,13136],[5,47,16873],[5,98,16874],[5,97,16875],[5,98,16362],[5,16863,16877],[5,6288,16878],[4,23,0,16879],[5,127,16880],[5,97,16881],[5,97,16877],[5,16883,16857],[5,6288,16884],[4,23,0,16885],[5,127,16886],[5,97,16887],[5,16888,5646],[5,16882,16889],[5,16876,16890],[5,16747,13407],[5,47,16892],[5,98,16893],[5,97,16894],[5,16741,13064],[5,98,16896],[5,6288,16897],[5,97,16898],[5,16899,5646],[5,16895,16900],[5,13488,13407],[5,47,16902],[5,98,16903],[5,97,16904],[5,27,13407],[5,98,16906],[5,16855,16907],[5,6288,16908],[4,23,0,16909],[5,127,16910],[5,97,16911],[5,97,16907],[5,16913,16854],[5,6288,16914],[4,23,0,16915],[5,127,16916],[5,97,16917],[5,16918,5646],[5,16912,16919],[5,16905,16920],[5,101,13407],[5,16922,13136],[5,47,16923],[5,98,16924],[5,97,16925],[5,16913,16877],[5,6288,16927],[4,23,0,16928],[5,127,16929],[5,97,16930],[5,16883,16907],[5,6288,16932],[4,23,0,16933],[5,127,16934],[5,97,16935],[5,16936,5646],[5,16931,16937],[5,16926,16938],[5,1120,13159],[5,47,16940],[5,98,16941],[5,97,16942],[5,16943,5646],[5,1120,13154],[5,47,16945],[5,98,16946],[5,97,16947],[5,16948,5646],[5,1120,13080],[5,47,16950],[5,98,16951],[5,97,16952],[5,16953,5646],[5,1120,13065],[5,47,16955],[5,98,16956],[5,97,16957],[5,16958,5646],[5,1120,13089],[5,47,16960],[5,98,16961],[5,97,16962],[5,16963,5646],[5,1120,13186],[5,47,16965],[5,98,16966],[5,97,16967],[5,16968,5646],[5,27,10851],[5,98,16970],[5,826,16971],[4,23,0,16972],[5,127,16973],[5,97,16974],[5,97,16971],[5,16976,825],[4,23,0,16977],[5,127,16978],[5,97,16979],[5,6382,10851],[5,98,16981],[5,16980,16982],[5,16975,16983],[5,9194,14715],[2,36,1,2],[5,16985,16986],[5,13488,16987],[5,47,16988],[5,98,16989],[5,97,16990],[5,27,16987],[5,98,16992],[5,16855,16993],[5,6288,16994],[4,23,0,16995],[5,127,16996],[5,97,16997],[5,97,16993],[5,16999,16854],[5,6288,17000],[4,23,0,17001],[5,127,17002],[5,97,17003],[5,17004,5646],[5,16998,17005],[5,16991,17006],[5,16976,7662],[4,23,0,17008],[5,127,17009],[5,97,17010],[5,7663,16971],[4,23,0,17012],[5,127,17013],[5,97,17014],[5,101,10851],[5,17016,852],[5,98,17017],[5,17015,17018],[5,17011,17019],[5,101,16987],[5,17021,13136],[5,47,17022],[5,98,17023],[5,97,17024],[5,16999,16877],[5,6288,17026],[4,23,0,17027],[5,127,17028],[5,97,17029],[5,16883,16993],[5,6288,17031],[4,23,0,17032],[5,127,17033],[5,97,17034],[5,17035,5646],[5,17030,17036],[5,17025,17037],[5,9195,11075],[2,256,0,0],[5,17039,17040],[5,27,17041],[5,98,17042],[5,826,17043],[4,23,0,17044],[5,127,17045],[5,97,17046],[5,97,17043],[5,17048,825],[4,23,0,17049],[5,127,17050],[5,97,17051],[5,6382,17041],[5,98,17053],[5,17052,17054],[5,17047,17055],[2,178,1,0],[5,9195,17057],[2,256,1,0],[5,17058,17059],[5,13488,17060],[5,47,17061],[5,98,17062],[5,97,17063],[5,27,17060],[5,98,17065],[5,16855,17066],[5,6288,17067],[4,23,0,17068],[5,127,17069],[5,97,17070],[5,97,17066],[5,17072,16854],[5,6288,17073],[4,23,0,17074],[5,127,17075],[5,97,17076],[5,17077,5646],[5,17071,17078],[5,17064,17079],[5,17048,7662],[4,23,0,17081],[5,127,17082],[5,97,17083],[5,7663,17043],[4,23,0,17085],[5,127,17086],[5,97,17087],[5,101,17041],[5,17089,852],[5,98,17090],[5,17088,17091],[5,17084,17092],[5,101,17060],[5,17094,13136],[5,47,17095],[5,98,17096],[5,97,17097],[5,17072,16877],[5,6288,17099],[4,23,0,17100],[5,127,17101],[5,97,17102],[5,16883,17066],[5,6288,17104],[4,23,0,17105],[5,127,17106],[5,97,17107],[5,17108,5646],[5,17103,17109],[5,17098,17110],[2,13,1,0],[5,25,17112],[5,9474,13098],[5,17113,17114],[5,47,17115],[5,98,17116],[5,97,17117],[5,9306,17112],[5,98,17119],[5,6288,17120],[5,97,17121],[5,6288,13751],[5,97,17123],[5,9292,17112],[5,101,17125],[5,17126,13755],[5,98,17127],[5,6288,17128],[5,97,17129],[5,45,13756],[5,34,17112],[5,17132,26],[5,25,17133],[5,16082,26],[5,17134,17135],[4,89,0,17136],[5,17131,17137],[5,98,17138],[5,6288,17139],[5,97,17140],[5,17141,5646],[5,17130,17142],[5,17124,17143],[5,17122,17144],[5,17118,17145],[5,27,9475],[5,98,17147],[5,826,17148],[4,23,0,17149],[5,127,17150],[5,97,17151],[5,97,17148],[5,17153,825],[4,23,0,17154],[5,127,17155],[5,97,17156],[5,6382,9475],[5,98,17158],[5,17157,17159],[5,17152,17160],[5,13488,17114],[5,47,17162],[5,98,17163],[5,97,17164],[5,27,17114],[5,98,17166],[5,16855,17167],[5,6288,17168],[4,23,0,17169],[5,127,17170],[5,97,17171],[5,97,17167],[5,17173,16854],[5,6288,17174],[4,23,0,17175],[5,127,17176],[5,97,17177],[5,17178,5646],[5,17172,17179],[5,17165,17180],[5,17153,7662],[4,23,0,17182],[5,127,17183],[5,97,17184],[5,7663,17148],[4,23,0,17186],[5,127,17187],[5,97,17188],[5,101,9475],[5,17190,852],[5,98,17191],[5,17189,17192],[5,17185,17193],[5,101,17114],[5,17195,13136],[5,47,17196],[5,98,17197],[5,97,17198],[5,17173,16877],[5,6288,17200],[4,23,0,17201],[5,127,17202],[5,97,17203],[5,16883,17167],[5,6288,17205],[4,23,0,17206],[5,127,17207],[5,97,17208],[5,17209,5646],[5,17204,17210],[5,17199,17211],[2,195,1,0],[5,9322,17213],[2,196,1,0],[5,17214,17215],[5,13766,17216],[5,47,17217],[5,98,17218],[5,97,17219],[5,6288,15333],[5,97,17221],[5,332,17213],[5,31,17213],[5,17223,17224],[5,15338,17225],[5,98,17226],[5,6288,17227],[5,97,17228],[5,31,17215],[5,101,17230],[5,17231,17224],[5,98,17232],[5,6288,17233],[5,97,17234],[5,45,17224],[5,34,17213],[5,17237,26],[5,15341,17238],[5,25,17239],[5,34,17215],[5,17241,26],[5,17240,17242],[4,29,0,17243],[5,17236,17244],[5,98,17245],[5,6288,17246],[5,97,17247],[5,17248,5646],[5,17235,17249],[5,17229,17250],[5,17222,17251],[5,17220,17252],[5,27,9326],[5,98,17254],[5,826,17255],[4,23,0,17256],[5,127,17257],[5,97,17258],[5,97,17255],[5,17260,825],[4,23,0,17261],[5,127,17262],[5,97,17263],[5,6382,9326],[5,98,17265],[5,17264,17266],[5,17259,17267],[5,13488,17216],[5,47,17269],[5,98,17270],[5,97,17271],[5,27,17216],[5,98,17273],[5,16855,17274],[5,6288,17275],[4,23,0,17276],[5,127,17277],[5,97,17278],[5,97,17274],[5,17280,16854],[5,6288,17281],[4,23,0,17282],[5,127,17283],[5,97,17284],[5,17285,5646],[5,17279,17286],[5,17272,17287],[5,17260,7662],[4,23,0,17289],[5,127,17290],[5,97,17291],[5,7663,17255],[4,23,0,17293],[5,127,17294],[5,97,17295],[5,101,9326],[5,17297,852],[5,98,17298],[5,17296,17299],[5,17292,17300],[5,101,17216],[5,17302,13136],[5,47,17303],[5,98,17304],[5,97,17305],[5,17280,16877],[5,6288,17307],[4,23,0,17308],[5,127,17309],[5,97,17310],[5,16883,17274],[5,6288,17312],[4,23,0,17313],[5,127,17314],[5,97,17315],[5,17316,5646],[5,17311,17317],[5,17306,17318],[5,10079,13761],[5,47,17320],[5,98,17321],[5,97,17322],[5,17323,5646],[5,47,10455],[5,98,17325],[5,97,17326],[5,17327,5646],[5,47,10082],[5,98,17329],[5,97,17330],[5,17331,5646],[5,47,10084],[5,98,17333],[5,97,17334],[5,17335,5646],[5,1120,13099],[5,47,17337],[5,98,17338],[5,97,17339],[5,17340,5646],[5,1120,4072],[5,98,17342],[5,97,17343],[5,5719,4072],[5,98,17345],[5,97,17346],[5,5709,4072],[5,98,17348],[5,17347,17349],[5,17344,17350],[5,5725,17351],[5,3733,13103],[5,17353,13105],[5,15172,17354],[5,47,17355],[5,98,17356],[5,97,17357],[5,1120,13426],[5,98,17359],[5,6288,17360],[5,97,17361],[5,1120,17354],[5,98,17363],[5,6288,17364],[5,97,17365],[5,13475,17354],[5,98,17367],[5,6288,17368],[5,97,17369],[5,17370,5646],[5,17366,17371],[5,17362,17372],[5,17358,17373],[5,306,4072],[5,17375,438],[5,98,17376],[5,97,17377],[5,101,4072],[5,17379,438],[5,98,17380],[5,17378,17381],[5,17344,17382],[5,5725,17383],[5,101,17354],[5,17385,13426],[5,47,17386],[5,98,17387],[5,97,17388],[5,306,17354],[5,17390,13426],[5,98,17391],[5,6288,17392],[5,97,17393],[5,17394,5646],[5,17366,17395],[5,17362,17396],[5,17389,17397],[5,1120,13147],[5,47,17399],[5,98,17400],[5,97,17401],[5,6288,13112],[5,97,17403],[5,6288,13116],[5,97,17405],[5,17406,5646],[5,17404,17407],[5,17402,17408],[5,47,14659],[5,98,17410],[5,97,17411],[5,98,13119],[5,6288,17413],[5,97,17414],[5,17415,5646],[5,17406,17416],[5,17404,17417],[5,17412,17418],[5,47,14618],[5,98,17420],[5,97,17421],[5,17422,17418],[5,1120,13106],[5,47,17424],[5,98,17425],[5,97,17426],[5,17427,5646],[5,1120,13119],[5,47,17429],[5,98,17430],[5,97,17431],[5,17432,17408],[5,98,5453],[5,826,17434],[4,23,0,17435],[5,127,17436],[5,97,17437],[5,97,17434],[5,17439,825],[4,23,0,17440],[5,127,17441],[5,97,17442],[5,6382,5128],[5,98,17444],[5,17443,17445],[5,17438,17446],[5,4554,14332],[5,13488,17448],[5,47,17449],[5,98,17450],[5,97,17451],[5,27,17448],[5,98,17453],[5,16855,17454],[5,6288,17455],[4,23,0,17456],[5,127,17457],[5,97,17458],[5,97,17454],[5,17460,16854],[5,6288,17461],[4,23,0,17462],[5,127,17463],[5,97,17464],[5,17465,5646],[5,17459,17466],[5,17452,17467],[5,17439,7662],[4,23,0,17469],[5,127,17470],[5,97,17471],[5,7663,17434],[4,23,0,17473],[5,127,17474],[5,97,17475],[5,5473,852],[5,98,17477],[5,17476,17478],[5,17472,17479],[5,101,17448],[5,17481,13136],[5,47,17482],[5,98,17483],[5,97,17484],[5,17460,16877],[5,6288,17486],[4,23,0,17487],[5,127,17488],[5,97,17489],[5,16883,17454],[5,6288,17491],[4,23,0,17492],[5,127,17493],[5,97,17494],[5,17495,5646],[5,17490,17496],[5,17485,17497],[5,646,1317],[5,98,17499],[5,97,17500],[5,1692,645],[5,25,17502],[5,17503,1317],[5,98,17504],[5,17501,17505],[5,1692,13059],[5,25,17507],[5,17508,1317],[5,47,17509],[5,98,17510],[5,97,17511],[5,13208,1317],[5,98,17513],[5,6288,17514],[5,97,17515],[5,17516,5646],[5,17512,17517],[5,101,13746],[5,17519,1317],[5,98,17520],[5,47,17520],[5,98,17522],[5,97,17523],[5,17524,5646],[5,47,5087],[5,98,17526],[5,97,17527],[5,17528,5646],[5,1331,645],[5,25,17530],[5,17531,1317],[5,98,17532],[5,17501,17533],[5,1331,13059],[5,25,17535],[5,17536,1317],[5,47,17537],[5,98,17538],[5,97,17539],[5,17540,17517],[5,101,13743],[5,17542,1317],[5,98,17543],[5,47,17543],[5,98,17545],[5,97,17546],[5,17547,5646],[5,47,5271],[5,98,17549],[5,97,17550],[5,17551,5646],[5,4528,13059],[5,25,17553],[5,17554,1506],[5,47,17555],[5,98,17556],[5,97,17557],[5,13208,1506],[5,98,17559],[5,6288,17560],[5,97,17561],[5,17562,5646],[5,17558,17563],[5,47,4741],[5,98,17565],[5,97,17566],[5,17567,5646],[5,47,4543],[5,98,17569],[5,97,17570],[5,17571,5646],[5,47,4526],[5,98,17573],[5,97,17574],[5,17575,5646],[5,47,5538],[5,98,17577],[5,97,17578],[5,17579,5646],[5,12021,5646],[5,16623,1317],[5,47,17582],[5,98,17583],[5,97,17584],[5,6288,14335],[5,97,17586],[5,17587,5646],[5,17585,17588],[5,826,2407],[4,23,0,17590],[5,127,17591],[5,97,17592],[5,2408,825],[4,23,0,17594],[5,127,17595],[5,97,17596],[5,6382,1317],[5,98,17598],[5,17597,17599],[5,17593,17600],[5,13488,1317],[5,47,17602],[5,98,17603],[5,97,17604],[5,16855,2407],[5,6288,17606],[4,23,0,17607],[5,127,17608],[5,97,17609],[5,2408,16854],[5,6288,17611],[4,23,0,17612],[5,127,17613],[5,97,17614],[5,17615,5646],[5,17610,17616],[5,17605,17617],[5,2408,7662],[4,23,0,17619],[5,127,17620],[5,97,17621],[5,7663,2407],[4,23,0,17623],[5,127,17624],[5,97,17625],[5,101,1317],[5,17627,852],[5,98,17628],[5,17626,17629],[5,17622,17630],[5,17627,13136],[5,47,17632],[5,98,17633],[5,97,17634],[5,2408,16877],[5,6288,17636],[4,23,0,17637],[5,127,17638],[5,97,17639],[5,16883,2407],[5,6288,17641],[4,23,0,17642],[5,127,17643],[5,97,17644],[5,17645,5646],[5,17640,17646],[5,17635,17647],[5,826,2164],[4,23,0,17649],[5,127,17650],[5,97,17651],[5,2165,825],[4,23,0,17653],[5,127,17654],[5,97,17655],[5,6382,1506],[5,98,17657],[5,17656,17658],[5,17652,17659],[5,13488,1506],[5,47,17661],[5,98,17662],[5,97,17663],[5,16855,2164],[5,6288,17665],[4,23,0,17666],[5,127,17667],[5,97,17668],[5,2165,16854],[5,6288,17670],[4,23,0,17671],[5,127,17672],[5,97,17673],[5,17674,5646],[5,17669,17675],[5,17664,17676],[5,2165,7662],[4,23,0,17678],[5,127,17679],[5,97,17680],[5,7663,2164],[4,23,0,17682],[5,127,17683],[5,97,17684],[5,2848,852],[5,98,17686],[5,17685,17687],[5,17681,17688],[5,2848,13136],[5,47,17690],[5,98,17691],[5,97,17692],[5,2165,16877],[5,6288,17694],[4,23,0,17695],[5,127,17696],[5,97,17697],[5,16883,2164],[5,6288,17699],[4,23,0,17700],[5,127,17701],[5,97,17702],[5,17703,5646],[5,17698,17704],[5,17693,17705],[5,314,13777],[5,47,17707],[5,98,17708],[5,97,17709],[5,17710,5646],[5,285,13760],[5,17712,13768],[5,13766,17713],[5,47,17714],[5,98,17715],[5,97,17716],[5,13766,15210],[5,98,17718],[5,6288,17719],[5,97,17720],[5,13125,13773],[5,98,17722],[5,6288,17723],[5,97,17724],[5,13130,13768],[5,98,17726],[5,6288,17727],[5,97,17728],[5,17729,5646],[5,17725,17730],[5,17721,17731],[5,17717,17732],[5,27,287],[5,98,17734],[5,826,17735],[4,23,0,17736],[5,127,17737],[5,97,17738],[5,97,17735],[5,17740,825],[4,23,0,17741],[5,127,17742],[5,97,17743],[5,6382,287],[5,98,17745],[5,17744,17746],[5,17739,17747],[5,13488,17713],[5,47,17749],[5,98,17750],[5,97,17751],[5,27,17713],[5,98,17753],[5,16855,17754],[5,6288,17755],[4,23,0,17756],[5,127,17757],[5,97,17758],[5,97,17754],[5,17760,16854],[5,6288,17761],[4,23,0,17762],[5,127,17763],[5,97,17764],[5,17765,5646],[5,17759,17766],[5,17752,17767],[5,17740,7662],[4,23,0,17769],[5,127,17770],[5,97,17771],[5,7663,17735],[4,23,0,17773],[5,127,17774],[5,97,17775],[5,101,287],[5,17777,852],[5,98,17778],[5,17776,17779],[5,17772,17780],[5,101,17713],[5,17782,13136],[5,47,17783],[5,98,17784],[5,97,17785],[5,17760,16877],[5,6288,17787],[4,23,0,17788],[5,127,17789],[5,97,17790],[5,16883,17754],[5,6288,17792],[4,23,0,17793],[5,127,17794],[5,97,17795],[5,17796,5646],[5,17791,17797],[5,17786,17798],[5,1120,13131],[5,47,17800],[5,98,17801],[5,97,17802],[5,17803,5646],[5,27,295],[5,98,17805],[5,826,17806],[4,23,0,17807],[5,127,17808],[5,97,17809],[5,97,17806],[5,17811,825],[4,23,0,17812],[5,127,17813],[5,97,17814],[5,6382,295],[5,98,17816],[5,17815,17817],[5,17810,17818],[5,293,13760],[5,17820,13768],[5,13488,17821],[5,47,17822],[5,98,17823],[5,97,17824],[5,27,17821],[5,98,17826],[5,16855,17827],[5,6288,17828],[4,23,0,17829],[5,127,17830],[5,97,17831],[5,97,17827],[5,17833,16854],[5,6288,17834],[4,23,0,17835],[5,127,17836],[5,97,17837],[5,17838,5646],[5,17832,17839],[5,17825,17840],[5,17811,7662],[4,23,0,17842],[5,127,17843],[5,97,17844],[5,7663,17806],[4,23,0,17846],[5,127,17847],[5,97,17848],[5,101,295],[5,17850,852],[5,98,17851],[5,17849,17852],[5,17845,17853],[5,101,17821],[5,17855,13136],[5,47,17856],[5,98,17857],[5,97,17858],[5,17833,16877],[5,6288,17860],[4,23,0,17861],[5,127,17862],[5,97,17863],[5,16883,17827],[5,6288,17865],[4,23,0,17866],[5,127,17867],[5,97,17868],[5,17869,5646],[5,17864,17870],[5,17859,17871],[5,9,13059],[5,17873,11],[5,13125,17874],[5,47,17875],[5,98,17876],[5,97,17877],[5,17878,5646],[5,13125,11],[5,47,17880],[5,98,17881],[5,97,17882],[5,17883,5646],[5,1120,13126],[5,47,17885],[5,98,17886],[5,97,17887],[5,17888,5646],[5,27,291],[5,98,17890],[5,826,17891],[4,23,0,17892],[5,127,17893],[5,97,17894],[5,97,17891],[5,17896,825],[4,23,0,17897],[5,127,17898],[5,97,17899],[5,6382,291],[5,98,17901],[5,17900,17902],[5,17895,17903],[5,289,13760],[5,17905,13768],[5,13488,17906],[5,47,17907],[5,98,17908],[5,97,17909],[5,27,17906],[5,98,17911],[5,16855,17912],[5,6288,17913],[4,23,0,17914],[5,127,17915],[5,97,17916],[5,97,17912],[5,17918,16854],[5,6288,17919],[4,23,0,17920],[5,127,17921],[5,97,17922],[5,17923,5646],[5,17917,17924],[5,17910,17925],[5,17896,7662],[4,23,0,17927],[5,127,17928],[5,97,17929],[5,7663,17891],[4,23,0,17931],[5,127,17932],[5,97,17933],[5,101,291],[5,17935,852],[5,98,17936],[5,17934,17937],[5,17930,17938],[5,101,17906],[5,17940,13136],[5,47,17941],[5,98,17942],[5,97,17943],[5,17918,16877],[5,6288,17945],[4,23,0,17946],[5,127,17947],[5,97,17948],[5,16883,17912],[5,6288,17950],[4,23,0,17951],[5,127,17952],[5,97,17953],[5,17954,5646],[5,17949,17955],[5,17944,17956],[5,27,1384],[5,306,17958],[5,17959,859],[5,98,17960],[4,63,0,17961],[5,127,17962],[5,97,17963],[5,1457,334],[5,98,17965],[5,17964,17966],[5,15273,15239],[5,47,17968],[5,98,17969],[5,97,17970],[5,27,13105],[5,306,17972],[5,359,15391],[4,23,0,17974],[5,16609,17975],[5,17973,17976],[5,98,17977],[5,6288,17978],[4,63,0,17979],[5,127,17980],[5,97,17981],[5,17982,5646],[5,17971,17983],[5,15874,13136],[5,47,17985],[5,98,17986],[5,97,17987],[5,306,16362],[5,17989,17976],[5,98,17990],[5,6288,17991],[4,63,0,17992],[5,127,17993],[5,97,17994],[5,17995,5646],[5,17988,17996],[5,314,581],[5,98,17998],[5,97,17999],[5,31,581],[5,318,18001],[5,98,18002],[5,97,18003],[5,45,18001],[5,34,581],[5,18006,26],[5,386,18007],[4,23,0,18008],[5,18005,18009],[5,98,18010],[5,97,18011],[5,98,582],[5,18012,18013],[5,18004,18014],[5,18000,18015],[5,473,18016],[5,47,15383],[5,98,18018],[5,97,18019],[5,314,15382],[5,98,18021],[5,6288,18022],[5,97,18023],[5,31,15382],[5,15338,18025],[5,98,18026],[5,6288,18027],[5,97,18028],[5,45,18025],[5,34,15382],[5,18031,26],[5,15392,18032],[4,23,0,18033],[5,18030,18034],[5,98,18035],[5,6288,18036],[5,97,18037],[5,18038,5646],[5,18029,18039],[5,18024,18040],[5,17222,18041],[5,18020,18042],[5,568,580],[5,314,18044],[5,98,18045],[5,97,18046],[5,31,18044],[5,101,18048],[5,18049,574],[5,98,18050],[5,97,18051],[5,34,18044],[5,18053,26],[5,101,18054],[5,18055,591],[4,23,0,18056],[5,589,18057],[5,98,18058],[5,97,18059],[5,101,18044],[5,18061,569],[5,98,18062],[5,18060,18063],[5,18052,18064],[5,732,18065],[5,18047,18066],[5,13792,15381],[5,101,18068],[5,18069,13793],[5,47,18070],[5,98,18071],[5,97,18072],[5,314,18068],[5,98,18074],[5,6288,18075],[5,97,18076],[5,314,13793],[5,98,18078],[5,6288,18079],[5,97,18080],[5,31,18068],[5,101,18082],[5,18083,13798],[5,98,18084],[5,6288,18085],[5,97,18086],[5,34,18068],[5,18088,26],[5,101,18089],[5,18090,15394],[4,23,0,18091],[5,15390,18092],[5,98,18093],[5,6288,18094],[5,97,18095],[5,18096,5646],[5,18087,18097],[5,18081,18098],[5,18077,18099],[5,18073,18100],[5,47,15336],[5,98,18102],[5,97,18103],[5,98,15339],[5,6288,18105],[5,97,18106],[5,98,15344],[5,6288,18108],[5,97,18109],[5,18110,5646],[5,18107,18111],[5,17222,18112],[5,18104,18113],[5,47,15767],[5,98,18115],[5,97,18116],[5,18117,18113],[5,314,13794],[5,47,18119],[5,98,18120],[5,97,18121],[5,18122,5646],[5,314,13786],[5,47,18124],[5,98,18125],[5,97,18126],[5,18127,5646],[5,47,17718],[5,98,18129],[5,97,18130],[5,15338,13760],[5,98,18132],[5,6288,18133],[5,97,18134],[5,25,15391],[5,18136,13768],[4,23,0,18137],[5,15195,18138],[5,98,18139],[5,6288,18140],[5,97,18141],[5,18142,5646],[5,18135,18143],[5,17222,18144],[5,18131,18145],[5,478,574],[5,98,18147],[5,97,18148],[5,483,405],[5,98,18150],[5,18149,18151],[5,97,18152],[5,47,560],[5,81,18154],[5,18155,592],[4,63,0,18156],[5,589,18157],[5,98,18158],[5,97,18159],[5,410,569],[5,18161,412],[5,18162,405],[5,578,18163],[5,98,18164],[5,18160,18165],[5,18153,18166],[5,735,18167],[5,473,18168],[5,410,13793],[5,18170,13815],[5,18171,16118],[5,15335,18172],[5,47,18173],[5,98,18174],[5,97,18175],[5,15338,13798],[5,98,18177],[5,6288,18178],[5,97,18179],[5,15925,13798],[5,98,18181],[5,97,18182],[5,15930,16118],[5,98,18184],[5,18183,18185],[5,6288,18186],[5,97,18187],[5,559,13815],[5,47,18189],[5,81,18190],[5,18191,15395],[4,63,0,18192],[5,15390,18193],[5,98,18194],[5,6288,18195],[5,97,18196],[5,18197,5646],[5,18188,18198],[5,18180,18199],[5,17222,18200],[5,18176,18201],[5,101,18163],[5,18203,307],[5,98,18204],[5,18160,18205],[5,18153,18206],[5,735,18207],[5,473,18208],[5,101,18172],[5,18210,13093],[5,47,18211],[5,98,18212],[5,97,18213],[5,18214,18201],[5,386,685],[4,23,0,18216],[5,321,18217],[5,98,18218],[5,97,18219],[5,578,694],[5,98,18221],[5,18220,18222],[5,523,18223],[5,473,18224],[5,16110,15099],[5,15335,18226],[5,47,18227],[5,98,18228],[5,97,18229],[5,15392,15005],[4,23,0,18231],[5,15195,18232],[5,98,18233],[5,6288,18234],[5,97,18235],[5,18236,5646],[5,18135,18237],[5,17222,18238],[5,18230,18239],[5,695,307],[5,98,18241],[5,18220,18242],[5,523,18243],[5,473,18244],[5,101,18226],[5,18246,13093],[5,47,18247],[5,98,18248],[5,97,18249],[5,18250,18239],[5,411,1389],[5,18252,4],[5,314,18253],[5,98,18254],[5,13814,14037],[5,18256,13785],[5,314,18257],[5,47,18258],[5,98,18259],[5,97,18260],[5,18261,5646],[5,1120,13094],[5,47,18263],[5,98,18264],[5,97,18265],[5,18266,5646],[5,27,311],[5,98,18268],[5,826,18269],[4,23,0,18270],[5,127,18271],[5,97,18272],[5,97,18269],[5,18274,825],[4,23,0,18275],[5,127,18276],[5,97,18277],[5,6382,311],[5,98,18279],[5,18278,18280],[5,18273,18281],[5,13488,15210],[5,47,18283],[5,98,18284],[5,97,18285],[5,27,15210],[5,98,18287],[5,16855,18288],[5,6288,18289],[4,23,0,18290],[5,127,18291],[5,97,18292],[5,97,18288],[5,18294,16854],[5,6288,18295],[4,23,0,18296],[5,127,18297],[5,97,18298],[5,18299,5646],[5,18293,18300],[5,18286,18301],[5,18274,7662],[4,23,0,18303],[5,127,18304],[5,97,18305],[5,7663,18269],[4,23,0,18307],[5,127,18308],[5,97,18309],[5,776,852],[5,98,18311],[5,18310,18312],[5,18306,18313],[5,15741,13136],[5,47,18315],[5,98,18316],[5,97,18317],[5,18294,16877],[5,6288,18319],[4,23,0,18320],[5,127,18321],[5,97,18322],[5,16883,18288],[5,6288,18324],[4,23,0,18325],[5,127,18326],[5,97,18327],[5,18328,5646],[5,18323,18329],[5,18318,18330],[5,826,827],[4,23,0,18332],[5,127,18333],[5,97,18334],[5,828,825],[4,23,0,18336],[5,127,18337],[5,97,18338],[5,6382,317],[5,98,18340],[5,18339,18341],[5,18335,18342],[5,13488,13773],[5,47,18344],[5,98,18345],[5,97,18346],[5,27,13773],[5,98,18348],[5,16855,18349],[5,6288,18350],[4,23,0,18351],[5,127,18352],[5,97,18353],[5,97,18349],[5,18355,16854],[5,6288,18356],[4,23,0,18357],[5,127,18358],[5,97,18359],[5,18360,5646],[5,18354,18361],[5,18347,18362],[5,828,7662],[4,23,0,18364],[5,127,18365],[5,97,18366],[5,7663,827],[4,23,0,18368],[5,127,18369],[5,97,18370],[5,318,852],[5,98,18372],[5,18371,18373],[5,18367,18374],[5,15338,13136],[5,47,18376],[5,98,18377],[5,97,18378],[5,18355,16877],[5,6288,18380],[4,23,0,18381],[5,127,18382],[5,97,18383],[5,16883,18349],[5,6288,18385],[4,23,0,18386],[5,127,18387],[5,97,18388],[5,18389,5646],[5,18384,18390],[5,18379,18391],[5,314,16111],[5,47,18393],[5,98,18394],[5,97,18395],[5,18396,5646],[5,47,16570],[5,98,18398],[5,97,18399],[5,98,16572],[5,6288,18401],[5,97,18402],[5,98,16575],[5,6288,18404],[5,97,18405],[5,18406,5646],[5,18403,18407],[5,18400,18408],[5,47,16601],[5,98,18410],[5,97,18411],[5,98,16574],[5,6288,18413],[5,97,18414],[5,18415,5646],[5,18403,18416],[5,18412,18417],[5,47,16590],[5,98,18419],[5,97,18420],[5,47,16592],[5,98,18422],[5,97,18423],[5,98,13209],[5,18424,18425],[5,6288,18426],[5,97,18427],[5,18428,5646],[5,18421,18429],[5,47,16596],[5,98,18431],[5,97,18432],[5,97,18404],[5,18434,18401],[5,6288,18435],[5,97,18436],[5,18437,5646],[5,18433,18438],[5,47,16515],[5,98,18440],[5,97,18441],[5,98,13191],[5,6288,18443],[5,97,18444],[5,18445,5646],[5,18442,18446],[5,8101,13069],[5,47,18448],[5,98,18449],[5,97,18450],[5,18451,5646],[5,787,13103],[5,47,18453],[5,98,18454],[5,97,18455],[5,27,13103],[5,47,18457],[4,23,0,18458],[5,6402,18459],[5,98,18460],[5,6288,18461],[5,97,18462],[5,18463,5646],[5,18456,18464],[5,47,13484],[4,23,0,18466],[5,6402,18467],[5,98,18468],[5,6288,18469],[5,97,18470],[5,18471,5646],[5,13863,18472],[5,47,16564],[5,98,18474],[5,97,18475],[5,98,16566],[5,6288,18477],[5,97,18478],[5,98,15050],[5,6288,18480],[5,97,18481],[5,18482,5646],[5,18479,18483],[5,18476,18484],[5,27,8409],[5,98,18486],[5,826,18487],[4,23,0,18488],[5,127,18489],[5,97,18490],[5,97,18487],[5,18492,825],[4,23,0,18493],[5,127,18494],[5,97,18495],[5,6382,8409],[5,98,18497],[5,18496,18498],[5,18491,18499],[5,13488,15203],[5,47,18501],[5,98,18502],[5,97,18503],[5,27,15203],[5,98,18505],[5,16855,18506],[5,6288,18507],[4,23,0,18508],[5,127,18509],[5,97,18510],[5,97,18506],[5,18512,16854],[5,6288,18513],[4,23,0,18514],[5,127,18515],[5,97,18516],[5,18517,5646],[5,18511,18518],[5,18504,18519],[5,18492,7662],[4,23,0,18521],[5,127,18522],[5,97,18523],[5,7663,18487],[4,23,0,18525],[5,127,18526],[5,97,18527],[5,8410,852],[5,98,18529],[5,18528,18530],[5,18524,18531],[5,15699,13136],[5,47,18533],[5,98,18534],[5,97,18535],[5,18512,16877],[5,6288,18537],[4,23,0,18538],[5,127,18539],[5,97,18540],[5,16883,18506],[5,6288,18542],[4,23,0,18543],[5,127,18544],[5,97,18545],[5,18546,5646],[5,18541,18547],[5,18536,18548],[5,27,8397],[5,98,18550],[5,826,18551],[4,23,0,18552],[5,127,18553],[5,97,18554],[5,97,18551],[5,18556,825],[4,23,0,18557],[5,127,18558],[5,97,18559],[5,6382,8397],[5,98,18561],[5,18560,18562],[5,18555,18563],[5,13488,15192],[5,47,18565],[5,98,18566],[5,97,18567],[5,27,15192],[5,98,18569],[5,16855,18570],[5,6288,18571],[4,23,0,18572],[5,127,18573],[5,97,18574],[5,97,18570],[5,18576,16854],[5,6288,18577],[4,23,0,18578],[5,127,18579],[5,97,18580],[5,18581,5646],[5,18575,18582],[5,18568,18583],[5,18556,7662],[4,23,0,18585],[5,127,18586],[5,97,18587],[5,7663,18551],[4,23,0,18589],[5,127,18590],[5,97,18591],[5,8398,852],[5,98,18593],[5,18592,18594],[5,18588,18595],[5,15691,13136],[5,47,18597],[5,98,18598],[5,97,18599],[5,18576,16877],[5,6288,18601],[4,23,0,18602],[5,127,18603],[5,97,18604],[5,16883,18570],[5,6288,18606],[4,23,0,18607],[5,127,18608],[5,97,18609],[5,18610,5646],[5,18605,18611],[5,18600,18612],[5,596,1093],[5,18614,67],[5,27,18615],[5,98,18616],[5,826,18617],[4,23,0,18618],[5,127,18619],[5,97,18620],[5,97,18617],[5,18622,825],[4,23,0,18623],[5,127,18624],[5,97,18625],[5,6382,18615],[5,98,18627],[5,18626,18628],[5,18621,18629],[5,596,15066],[2,35,1,0],[5,18631,18632],[5,13488,18633],[5,47,18634],[5,98,18635],[5,97,18636],[5,27,18633],[5,98,18638],[5,16855,18639],[5,6288,18640],[4,23,0,18641],[5,127,18642],[5,97,18643],[5,97,18639],[5,18645,16854],[5,6288,18646],[4,23,0,18647],[5,127,18648],[5,97,18649],[5,18650,5646],[5,18644,18651],[5,18637,18652],[5,18622,7662],[4,23,0,18654],[5,127,18655],[5,97,18656],[5,7663,18617],[4,23,0,18658],[5,127,18659],[5,97,18660],[5,101,18615],[5,18662,852],[5,98,18663],[5,18661,18664],[5,18657,18665],[5,101,18633],[5,18667,13136],[5,47,18668],[5,98,18669],[5,97,18670],[5,18645,16877],[5,6288,18672],[4,23,0,18673],[5,127,18674],[5,97,18675],[5,16883,18639],[5,6288,18677],[4,23,0,18678],[5,127,18679],[5,97,18680],[5,18681,5646],[5,18676,18682],[5,18671,18683],[5,8139,67],[5,27,18685],[5,98,18686],[5,826,18687],[4,23,0,18688],[5,127,18689],[5,97,18690],[5,97,18687],[5,18692,825],[4,23,0,18693],[5,127,18694],[5,97,18695],[5,6382,18685],[5,98,18697],[5,18696,18698],[5,18691,18699],[5,16206,18632],[5,13488,18701],[5,47,18702],[5,98,18703],[5,97,18704],[5,27,18701],[5,98,18706],[5,16855,18707],[5,6288,18708],[4,23,0,18709],[5,127,18710],[5,97,18711],[5,97,18707],[5,18713,16854],[5,6288,18714],[4,23,0,18715],[5,127,18716],[5,97,18717],[5,18718,5646],[5,18712,18719],[5,18705,18720],[5,18692,7662],[4,23,0,18722],[5,127,18723],[5,97,18724],[5,7663,18687],[4,23,0,18726],[5,127,18727],[5,97,18728],[5,101,18685],[5,18730,852],[5,98,18731],[5,18729,18732],[5,18725,18733],[5,101,18701],[5,18735,13136],[5,47,18736],[5,98,18737],[5,97,18738],[5,18713,16877],[5,6288,18740],[4,23,0,18741],[5,127,18742],[5,97,18743],[5,16883,18707],[5,6288,18745],[4,23,0,18746],[5,127,18747],[5,97,18748],[5,18749,5646],[5,18744,18750],[5,18739,18751],[5,8152,67],[5,27,18753],[5,98,18754],[5,826,18755],[4,23,0,18756],[5,127,18757],[5,97,18758],[5,97,18755],[5,18760,825],[4,23,0,18761],[5,127,18762],[5,97,18763],[5,6382,18753],[5,98,18765],[5,18764,18766],[5,18759,18767],[5,16183,18632],[5,13488,18769],[5,47,18770],[5,98,18771],[5,97,18772],[5,27,18769],[5,98,18774],[5,16855,18775],[5,6288,18776],[4,23,0,18777],[5,127,18778],[5,97,18779],[5,97,18775],[5,18781,16854],[5,6288,18782],[4,23,0,18783],[5,127,18784],[5,97,18785],[5,18786,5646],[5,18780,18787],[5,18773,18788],[5,18760,7662],[4,23,0,18790],[5,127,18791],[5,97,18792],[5,7663,18755],[4,23,0,18794],[5,127,18795],[5,97,18796],[5,101,18753],[5,18798,852],[5,98,18799],[5,18797,18800],[5,18793,18801],[5,101,18769],[5,18803,13136],[5,47,18804],[5,98,18805],[5,97,18806],[5,18781,16877],[5,6288,18808],[4,23,0,18809],[5,127,18810],[5,97,18811],[5,16883,18775],[5,6288,18813],[4,23,0,18814],[5,127,18815],[5,97,18816],[5,18817,5646],[5,18812,18818],[5,18807,18819],[5,27,7296],[5,98,18821],[5,826,18822],[4,23,0,18823],[5,127,18824],[5,97,18825],[5,97,18822],[5,18827,825],[4,23,0,18828],[5,127,18829],[5,97,18830],[5,6382,7296],[5,98,18832],[5,18831,18833],[5,18826,18834],[5,13488,16526],[5,47,18836],[5,98,18837],[5,97,18838],[5,27,16526],[5,98,18840],[5,16855,18841],[5,6288,18842],[4,23,0,18843],[5,127,18844],[5,97,18845],[5,97,18841],[5,18847,16854],[5,6288,18848],[4,23,0,18849],[5,127,18850],[5,97,18851],[5,18852,5646],[5,18846,18853],[5,18839,18854],[5,18827,7662],[4,23,0,18856],[5,127,18857],[5,97,18858],[5,7663,18822],[4,23,0,18860],[5,127,18861],[5,97,18862],[5,101,7296],[5,18864,852],[5,98,18865],[5,18863,18866],[5,18859,18867],[5,101,16526],[5,18869,13136],[5,47,18870],[5,98,18871],[5,97,18872],[5,18847,16877],[5,6288,18874],[4,23,0,18875],[5,127,18876],[5,97,18877],[5,16883,18841],[5,6288,18879],[4,23,0,18880],[5,127,18881],[5,97,18882],[5,18883,5646],[5,18878,18884],[5,18873,18885],[5,27,7300],[5,98,18887],[5,826,18888],[4,23,0,18889],[5,127,18890],[5,97,18891],[5,97,18888],[5,18893,825],[4,23,0,18894],[5,127,18895],[5,97,18896],[5,6382,7300],[5,98,18898],[5,18897,18899],[5,18892,18900],[5,13488,16518],[5,47,18902],[5,98,18903],[5,97,18904],[5,27,16518],[5,98,18906],[5,16855,18907],[5,6288,18908],[4,23,0,18909],[5,127,18910],[5,97,18911],[5,97,18907],[5,18913,16854],[5,6288,18914],[4,23,0,18915],[5,127,18916],[5,97,18917],[5,18918,5646],[5,18912,18919],[5,18905,18920],[5,18893,7662],[4,23,0,18922],[5,127,18923],[5,97,18924],[5,7663,18888],[4,23,0,18926],[5,127,18927],[5,97,18928],[5,101,7300],[5,18930,852],[5,98,18931],[5,18929,18932],[5,18925,18933],[5,101,16518],[5,18935,13136],[5,47,18936],[5,98,18937],[5,97,18938],[5,18913,16877],[5,6288,18940],[4,23,0,18941],[5,127,18942],[5,97,18943],[5,16883,18907],[5,6288,18945],[4,23,0,18946],[5,127,18947],[5,97,18948],[5,18949,5646],[5,18944,18950],[5,18939,18951],[5,78,1093],[5,27,18953],[5,98,18954],[5,826,18955],[4,23,0,18956],[5,127,18957],[5,97,18958],[5,97,18955],[5,18960,825],[4,23,0,18961],[5,127,18962],[5,97,18963],[5,6382,18953],[5,98,18965],[5,18964,18966],[5,18959,18967],[5,78,15066],[5,13488,18969],[5,47,18970],[5,98,18971],[5,97,18972],[5,27,18969],[5,98,18974],[5,16855,18975],[5,6288,18976],[4,23,0,18977],[5,127,18978],[5,97,18979],[5,97,18975],[5,18981,16854],[5,6288,18982],[4,23,0,18983],[5,127,18984],[5,97,18985],[5,18986,5646],[5,18980,18987],[5,18973,18988],[5,18960,7662],[4,23,0,18990],[5,127,18991],[5,97,18992],[5,7663,18955],[4,23,0,18994],[5,127,18995],[5,97,18996],[5,101,18953],[5,18998,852],[5,98,18999],[5,18997,19000],[5,18993,19001],[5,101,18969],[5,19003,13136],[5,47,19004],[5,98,19005],[5,97,19006],[5,18981,16877],[5,6288,19008],[4,23,0,19009],[5,127,19010],[5,97,19011],[5,16883,18975],[5,6288,19013],[4,23,0,19014],[5,127,19015],[5,97,19016],[5,19017,5646],[5,19012,19018],[5,19007,19019],[5,27,7566],[5,98,19021],[5,826,19022],[4,23,0,19023],[5,127,19024],[5,97,19025],[5,97,19022],[5,19027,825],[4,23,0,19028],[5,127,19029],[5,97,19030],[5,6382,7566],[5,98,19032],[5,19031,19033],[5,19026,19034],[5,13488,16023],[5,47,19036],[5,98,19037],[5,97,19038],[5,27,16023],[5,98,19040],[5,16855,19041],[5,6288,19042],[4,23,0,19043],[5,127,19044],[5,97,19045],[5,97,19041],[5,19047,16854],[5,6288,19048],[4,23,0,19049],[5,127,19050],[5,97,19051],[5,19052,5646],[5,19046,19053],[5,19039,19054],[5,19027,7662],[4,23,0,19056],[5,127,19057],[5,97,19058],[5,7663,19022],[4,23,0,19060],[5,127,19061],[5,97,19062],[5,101,7566],[5,19064,852],[5,98,19065],[5,19063,19066],[5,19059,19067],[5,101,16023],[5,19069,13136],[5,47,19070],[5,98,19071],[5,97,19072],[5,19047,16877],[5,6288,19074],[4,23,0,19075],[5,127,19076],[5,97,19077],[5,16883,19041],[5,6288,19079],[4,23,0,19080],[5,127,19081],[5,97,19082],[5,19083,5646],[5,19078,19084],[5,19073,19085],[5,13190,13069],[5,47,19087],[5,98,19088],[5,97,19089],[5,19090,5646],[5,47,13191],[5,98,19092],[5,97,19093],[5,16855,16877],[5,6288,19095],[4,23,0,19096],[5,127,19097],[5,97,19098],[5,19099,5646],[5,19094,19100],[5,98,13498],[5,97,19102],[5,98,13197],[5,16855,19104],[5,6288,19105],[4,23,0,19106],[5,127,19107],[5,97,19108],[5,19109,5646],[5,19103,19110],[5,5719,262],[5,98,19112],[5,97,19113],[5,5709,262],[5,98,19115],[5,19114,19116],[5,5725,19117],[5,73,13760],[5,19119,13768],[5,15172,19120],[5,47,19121],[5,98,19122],[5,97,19123],[5,13475,19120],[5,98,19125],[5,6288,19126],[5,97,19127],[5,19128,5646],[5,17362,19129],[5,19124,19130],[5,306,262],[5,19132,438],[5,98,19133],[5,97,19134],[5,101,262],[5,19136,438],[5,98,19137],[5,19135,19138],[5,5725,19139],[5,101,19120],[5,19141,13426],[5,47,19142],[5,98,19143],[5,97,19144],[5,306,19120],[5,19146,13426],[5,98,19147],[5,6288,19148],[5,97,19149],[5,19150,5646],[5,17362,19151],[5,19145,19152],[2,48,0,1],[5,1250,19154],[5,5719,19155],[5,98,19156],[5,97,19157],[5,5709,19155],[5,98,19159],[5,19158,19160],[5,5725,19161],[2,48,1,1],[5,16443,19163],[5,15172,19164],[5,47,19165],[5,98,19166],[5,97,19167],[5,13475,19164],[5,98,19169],[5,6288,19170],[5,97,19171],[5,19172,5646],[5,17362,19173],[5,19168,19174],[5,306,19155],[5,19176,438],[5,98,19177],[5,97,19178],[5,101,19155],[5,19180,438],[5,98,19181],[5,19179,19182],[5,5725,19183],[5,101,19164],[5,19185,13426],[5,47,19186],[5,98,19187],[5,97,19188],[5,306,19164],[5,19190,13426],[5,98,19191],[5,6288,19192],[5,97,19193],[5,19194,5646],[5,17362,19195],[5,19189,19196],[5,321,19154],[5,5719,19198],[5,98,19199],[5,97,19200],[5,5709,19198],[5,98,19202],[5,19201,19203],[5,5725,19204],[5,15195,19163],[5,15172,19206],[5,47,19207],[5,98,19208],[5,97,19209],[5,13475,19206],[5,98,19211],[5,6288,19212],[5,97,19213],[5,19214,5646],[5,17362,19215],[5,19210,19216],[5,306,19198],[5,19218,438],[5,98,19219],[5,97,19220],[5,101,19198],[5,19222,438],[5,98,19223],[5,19221,19224],[5,5725,19225],[5,101,19206],[5,19227,13426],[5,47,19228],[5,98,19229],[5,97,19230],[5,306,19206],[5,19232,13426],[5,98,19233],[5,6288,19234],[5,97,19235],[5,19236,5646],[5,17362,19237],[5,19231,19238],[5,5719,756],[5,98,19240],[5,97,19241],[5,5709,756],[5,98,19243],[5,19242,19244],[5,5725,19245],[5,13208,13760],[5,15172,19247],[5,47,19248],[5,98,19249],[5,97,19250],[5,13475,19247],[5,98,19252],[5,6288,19253],[5,97,19254],[5,19255,5646],[5,17362,19256],[5,19251,19257],[5,306,756],[5,19259,438],[5,98,19260],[5,97,19261],[5,101,756],[5,19263,438],[5,98,19264],[5,19262,19265],[5,5725,19266],[5,101,19247],[5,19268,13426],[5,47,19269],[5,98,19270],[5,97,19271],[5,306,19247],[5,19273,13426],[5,98,19274],[5,6288,19275],[5,97,19276],[5,19277,5646],[5,17362,19278],[5,19272,19279],[5,1120,13174],[5,47,19281],[5,98,19282],[5,97,19283],[5,19284,5646],[5,1120,13191],[5,47,19286],[5,98,19287],[5,97,19288],[5,19289,5646],[5,1120,13204],[5,47,19291],[5,98,19292],[5,97,19293],[5,19294,5646],[5,1120,13199],[5,47,19296],[5,98,19297],[5,97,19298],[5,19299,5646],[5,7923,13760],[5,19301,13768],[5,47,19302],[5,98,19303],[5,97,19304],[5,98,19120],[5,6288,19306],[5,97,19307],[5,15206,13768],[5,47,19309],[5,98,19310],[5,6288,19311],[5,97,19312],[5,19313,5646],[5,19308,19314],[5,19305,19315],[5,1120,13209],[5,47,19317],[5,98,19318],[5,97,19319],[5,19320,5646],[5,101,6296],[5,19322,5967],[5,98,19323],[5,6415,19324],[5,24,13198],[5,19322,19326],[5,47,19327],[5,98,19328],[5,97,19329],[5,16266,6410],[4,23,0,19331],[5,6402,19332],[5,98,19333],[5,6288,19334],[5,97,19335],[5,19336,5646],[5,19330,19337],[5,101,19326],[5,19339,6296],[5,47,19340],[5,98,19341],[5,97,19342],[5,19343,19337],[5,5569,5867],[5,5719,19345],[5,98,19346],[5,97,19347],[5,5709,19345],[5,98,19349],[5,19348,19350],[5,5725,19351],[2,48,1,76],[5,13084,19353],[5,15172,19354],[5,47,19355],[5,98,19356],[5,97,19357],[5,13475,19354],[5,98,19359],[5,6288,19360],[5,97,19361],[5,19362,5646],[5,17362,19363],[5,19358,19364],[5,306,19345],[5,19366,438],[5,98,19367],[5,97,19368],[5,101,19345],[5,19370,438],[5,98,19371],[5,19369,19372],[5,5725,19373],[5,101,19354],[5,19375,13426],[5,47,19376],[5,98,19377],[5,97,19378],[5,306,19354],[5,19380,13426],[5,98,19381],[5,6288,19382],[5,97,19383],[5,19384,5646],[5,17362,19385],[5,19379,19386],[5,5565,5867],[5,5719,19388],[5,98,19389],[5,97,19390],[5,5709,19388],[5,98,19392],[5,19391,19393],[5,5725,19394],[5,13074,19353],[5,15172,19396],[5,47,19397],[5,98,19398],[5,97,19399],[5,13475,19396],[5,98,19401],[5,6288,19402],[5,97,19403],[5,19404,5646],[5,17362,19405],[5,19400,19406],[5,306,19388],[5,19408,438],[5,98,19409],[5,97,19410],[5,101,19388],[5,19412,438],[5,98,19413],[5,19411,19414],[5,5725,19415],[5,101,19396],[5,19417,13426],[5,47,19418],[5,98,19419],[5,97,19420],[5,306,19396],[5,19422,13426],[5,98,19423],[5,6288,19424],[5,97,19425],[5,19426,5646],[5,17362,19427],[5,19421,19428],[5,306,1284],[5,19430,2786],[5,306,19431],[5,19432,438],[5,98,19433],[5,97,19434],[5,101,19431],[5,19436,438],[5,98,19437],[5,19435,19438],[5,5725,19439],[5,306,13454],[5,19441,14715],[5,101,19442],[5,19443,13426],[5,47,19444],[5,98,19445],[5,97,19446],[5,306,19442],[5,19448,13426],[5,98,19449],[5,6288,19450],[5,97,19451],[5,19452,5646],[5,17362,19453],[5,19447,19454],[5,5719,19431],[5,98,19456],[5,97,19457],[5,5709,19431],[5,98,19459],[5,19458,19460],[5,5725,19461],[5,15172,19442],[5,47,19463],[5,98,19464],[5,97,19465],[5,13475,19442],[5,98,19467],[5,6288,19468],[5,97,19469],[5,19470,5646],[5,17362,19471],[5,19466,19472],[5,306,6871],[5,19474,438],[5,98,19475],[5,97,19476],[5,101,6871],[5,19478,438],[5,98,19479],[5,19477,19480],[5,5725,19481],[5,81,13454],[5,19483,14715],[5,101,19484],[5,19485,13426],[5,47,19486],[5,98,19487],[5,97,19488],[5,306,19484],[5,19490,13426],[5,98,19491],[5,6288,19492],[5,97,19493],[5,19494,5646],[5,17362,19495],[5,19489,19496],[5,5719,6871],[5,98,19498],[5,97,19499],[5,5709,6871],[5,98,19501],[5,19500,19502],[5,5725,19503],[5,15172,19484],[5,47,19505],[5,98,19506],[5,97,19507],[5,13475,19484],[5,98,19509],[5,6288,19510],[5,97,19511],[5,19512,5646],[5,17362,19513],[5,19508,19514],[5,306,6314],[5,19516,438],[5,98,19517],[5,97,19518],[5,101,6314],[5,19520,438],[5,98,19521],[5,19519,19522],[5,5725,19523],[5,101,14719],[5,19525,13426],[5,47,19526],[5,98,19527],[5,97,19528],[5,306,14719],[5,19530,13426],[5,98,19531],[5,6288,19532],[5,97,19533],[5,19534,5646],[5,17362,19535],[5,19529,19536],[5,5719,6314],[5,98,19538],[5,97,19539],[5,5709,6314],[5,98,19541],[5,19540,19542],[5,5725,19543],[5,15172,14719],[5,47,19545],[5,98,19546],[5,97,19547],[5,13475,14719],[5,98,19549],[5,6288,19550],[5,97,19551],[5,19552,5646],[5,17362,19553],[5,19548,19554],[5,306,6222],[5,19556,438],[5,98,19557],[5,97,19558],[5,101,6222],[5,19560,438],[5,98,19561],[5,19559,19562],[5,5725,19563],[5,101,14744],[5,19565,13426],[5,47,19566],[5,98,19567],[5,97,19568],[5,306,14744],[5,19570,13426],[5,98,19571],[5,6288,19572],[5,97,19573],[5,19574,5646],[5,17362,19575],[5,19569,19576],[5,5719,6222],[5,98,19578],[5,97,19579],[5,5709,6222],[5,98,19581],[5,19580,19582],[5,5725,19583],[5,15172,14744],[5,47,19585],[5,98,19586],[5,97,19587],[5,13475,14744],[5,98,19589],[5,6288,19590],[5,97,19591],[5,19592,5646],[5,17362,19593],[5,19588,19594],[5,98,6793],[5,97,19596],[5,5709,6055],[5,98,19598],[5,19597,19599],[5,5725,19600],[5,15172,13459],[5,47,19602],[5,98,19603],[5,97,19604],[5,98,13479],[5,6288,19606],[5,97,19607],[5,19608,5646],[5,17362,19609],[5,19605,19610],[5,306,6055],[5,19612,438],[5,98,19613],[5,97,19614],[5,101,6055],[5,19616,438],[5,98,19617],[5,19615,19618],[5,5725,19619],[5,101,13459],[5,19621,13426],[5,47,19622],[5,98,19623],[5,97,19624],[5,306,13459],[5,19626,13426],[5,98,19627],[5,6288,19628],[5,97,19629],[5,19630,5646],[5,17362,19631],[5,19625,19632],[5,5719,5774],[5,98,19634],[5,97,19635],[5,5709,5774],[5,98,19637],[5,19636,19638],[5,5725,19639],[5,15172,13181],[5,47,19641],[5,98,19642],[5,97,19643],[5,13475,13181],[5,98,19645],[5,6288,19646],[5,97,19647],[5,19648,5646],[5,17362,19649],[5,19644,19650],[5,306,5774],[5,19652,438],[5,98,19653],[5,97,19654],[5,101,5774],[5,19656,438],[5,98,19657],[5,19655,19658],[5,5725,19659],[5,101,13181],[5,19661,13426],[5,47,19662],[5,98,19663],[5,97,19664],[5,306,13181],[5,19666,13426],[5,98,19667],[5,6288,19668],[5,97,19669],[5,19670,5646],[5,17362,19671],[5,19665,19672],[5,98,5716],[5,11784,19674],[5,5725,19675],[5,47,15173],[5,98,19677],[5,97,19678],[5,98,13426],[5,97,19680],[5,19681,5701],[5,6288,19682],[5,97,19683],[5,19684,5646],[5,17362,19685],[5,19679,19686],[5,98,5714],[5,11784,19688],[5,5725,19689],[5,47,15170],[5,98,19691],[5,97,19692],[5,19693,19686],[5,98,5710],[5,5768,19695],[5,47,15179],[5,98,19697],[5,97,19698],[5,6288,19680],[5,97,19700],[5,19701,5646],[5,19699,19702],[5,98,5707],[5,5768,19704],[5,47,15177],[5,98,19706],[5,97,19707],[5,19708,19702],[5,5709,5929],[5,98,19710],[5,5722,19711],[5,5725,19712],[5,15172,15157],[5,47,19714],[5,98,19715],[5,97,19716],[5,98,13476],[5,6288,19718],[5,97,19719],[5,19720,5646],[5,17362,19721],[5,19717,19722],[5,19430,438],[5,98,19724],[5,97,19725],[5,101,5929],[5,19727,438],[5,98,19728],[5,19726,19729],[5,5725,19730],[5,15158,13426],[5,47,19732],[5,98,19733],[5,97,19734],[5,19441,13426],[5,98,19736],[5,6288,19737],[5,97,19738],[5,19739,5646],[5,17362,19740],[5,19735,19741],[5,1120,13076],[5,47,19743],[5,98,19744],[5,97,19745],[5,19746,5646],[5,1120,13085],[5,47,19748],[5,98,19749],[5,97,19750],[5,19751,5646],[5,1120,13169],[5,47,19753],[5,98,19754],[5,97,19755],[5,19756,5646],[5,1120,13164],[5,47,19758],[5,98,19759],[5,97,19760],[5,19761,5646],[5,1120,13137],[5,47,19763],[5,98,19764],[5,97,19765],[5,19766,5646],[5,1120,13142],[5,47,19768],[5,98,19769],[5,97,19770],[5,19771,5646],[5,1120,13070],[5,47,19773],[5,98,19774],[5,97,19775],[5,19776,5646],[5,13214,13785],[5,1120,19778],[5,47,19779],[5,98,19780],[5,97,19781],[5,1120,13178],[5,98,19783],[5,6288,19784],[5,97,19785],[5,1120,13785],[5,98,19787],[5,6288,19788],[5,97,19789],[5,19790,5646],[5,19786,19791],[5,19782,19792],[5,1120,13181],[5,47,19794],[5,98,19795],[5,97,19796],[5,19797,5646],[5,1120,13060],[5,47,19799],[5,98,19800],[5,97,19801],[5,19802,5646],[5,47,6429],[5,98,19804],[5,97,19805],[5,19806,5646],[5,47,7083],[5,98,19808],[5,97,19809],[5,19810,5646],[5,47,13430],[5,98,19812],[5,97,19813],[5,19814,19702],[5,98,13435],[5,97,19816],[0,47,97],[5,98,13432],[5,6288,19819],[4,23,75,19820],[5,19818,19821],[5,97,19822],[5,19823,5646],[5,19817,19824],[5,101,13815],[5,19826,13215],[5,47,19827],[5,98,19828],[5,97,19829],[5,98,13069],[5,97,19831],[5,19826,13178],[5,98,19833],[5,19832,19834],[5,6288,19835],[5,97,19836],[5,98,13070],[5,97,19838],[5,19826,13180],[5,98,19840],[5,19839,19841],[5,6288,19842],[5,97,19843],[5,19844,5646],[5,19837,19845],[5,19830,19846],[5,101,13215],[5,19848,13815],[5,47,19849],[5,98,19850],[5,97,19851],[5,13179,13815],[5,98,19853],[5,19832,19854],[5,6288,19855],[5,97,19856],[5,101,13180],[5,19858,13815],[5,98,19859],[5,19839,19860],[5,6288,19861],[5,97,19862],[5,19863,5646],[5,19857,19864],[5,19852,19865],[5,13213,13426],[5,19867,13454],[5,47,19868],[5,98,19869],[5,97,19870],[5,19832,19680],[5,6288,19872],[5,97,19873],[5,98,13454],[5,19839,19875],[5,6288,19876],[5,97,19877],[5,19878,5646],[5,19874,19879],[5,19871,19880],[5,47,13169],[5,98,19882],[5,97,19883],[5,98,13136],[5,19832,19885],[5,6288,19886],[5,97,19887],[5,97,19885],[5,19889,19831],[5,6288,19890],[5,97,19891],[5,19892,5646],[5,19888,19893],[5,19884,19894],[5,47,13070],[5,98,19896],[5,97,19897],[5,19832,5701],[5,6288,19899],[5,97,19900],[5,19901,5646],[5,19898,19902],[5,47,13164],[5,98,19904],[5,97,19905],[5,19888,5646],[5,19906,19907],[5,47,13137],[5,98,19909],[5,97,19910],[5,19839,19885],[5,6288,19912],[5,97,19913],[5,19914,5646],[5,19911,19915],[5,47,13142],[5,98,19917],[5,97,19918],[5,6288,19831],[5,97,19920],[5,6288,19885],[5,97,19922],[5,19923,5646],[5,19921,19924],[5,19919,19925],[5,6763,5646],[5,47,15310],[5,98,19928],[5,97,19929],[5,19930,5646],[5,5790,9768],[5,97,19932],[2,257,0,0],[5,9195,19934],[5,19935,852],[5,9770,19936],[5,98,19937],[5,5790,19938],[5,97,19939],[5,9583,5558],[5,9785,19941],[5,9780,19942],[4,148,0,19943],[5,127,19944],[4,63,0,19945],[5,127,19946],[4,23,0,19947],[5,127,19948],[5,97,19949],[5,19950,5558],[5,19940,19951],[5,19933,19952],[5,9766,19953],[5,9412,19936],[5,98,19955],[5,5790,19956],[5,97,19957],[5,10263,5558],[5,10257,19959],[4,63,0,19960],[5,127,19961],[4,23,0,19962],[5,127,19963],[5,97,19964],[5,19965,5558],[5,19958,19966],[5,10254,19967],[5,5790,9308],[5,97,19969],[5,10231,5558],[5,10223,19971],[5,10217,19972],[5,10212,19973],[5,97,19974],[5,19975,5558],[5,19970,19976],[5,10209,19977],[5,5790,1374],[5,97,19979],[5,5790,1387],[5,97,19981],[5,1643,5558],[5,97,19983],[5,19984,5558],[5,19982,19985],[5,19980,19986],[5,2252,19987],[5,2544,19987],[5,1576,5558],[5,97,19990],[5,2280,5558],[5,97,19992],[5,19993,5558],[5,19991,19994],[5,19982,19995],[5,19980,19996],[5,2495,19997],[5,2277,19997],[5,19991,5558],[5,19982,20000],[5,19980,20001],[5,2554,20002],[5,2566,20002],[5,101,2056],[5,20005,2245],[5,98,20006],[5,97,20007],[5,20008,1642],[5,1576,20009],[5,98,2468],[5,97,20011],[5,20012,1642],[5,1576,20013],[5,7368,7073],[5,97,20015],[5,20016,7073],[5,7419,20017],[5,25,19934],[5,20019,7416],[5,98,20020],[5,97,20021],[5,73,19934],[5,20023,852],[5,98,20024],[5,97,20025],[5,20026,5558],[5,97,20027],[5,20028,5558],[5,20022,20029],[5,47,13154],[5,98,20031],[5,97,20032],[5,10351,13064],[5,47,20034],[5,98,20035],[5,16855,20036],[5,6288,20037],[4,23,0,20038],[5,127,20039],[5,97,20040],[5,20041,5646],[5,20033,20042],[5,47,9732],[5,98,20044],[5,97,20045],[5,20046,10355],[4,23,0,20047],[5,127,20048],[5,97,20049],[5,20050,10344],[5,20033,20037],[5,6288,20052],[4,23,0,20053],[5,127,20054],[5,97,20055],[5,20056,5646],[5,20033,20057],[5,47,13080],[5,98,20059],[5,97,20060],[5,9782,13064],[5,98,20062],[5,97,20063],[5,9580,13064],[5,98,20065],[5,97,20066],[5,10554,13064],[5,98,20068],[5,20067,20069],[5,20064,20070],[5,6288,20071],[4,148,0,20072],[5,127,20073],[4,63,0,20074],[5,127,20075],[4,23,0,20076],[5,127,20077],[5,97,20078],[5,20079,5646],[5,20061,20080],[5,47,9755],[5,98,20082],[5,97,20083],[5,20084,10972],[4,148,0,20085],[5,127,20086],[4,63,0,20087],[5,127,20088],[4,23,0,20089],[5,127,20090],[5,97,20091],[5,20092,10899],[5,20061,20071],[5,6288,20094],[4,148,0,20095],[5,127,20096],[4,63,0,20097],[5,127,20098],[4,23,0,20099],[5,127,20100],[5,97,20101],[5,20102,5646],[5,20061,20103],[5,47,13065],[5,98,20105],[5,97,20106],[5,9585,13064],[5,98,20108],[5,97,20109],[5,20110,907],[5,20067,20111],[5,6288,20112],[4,63,0,20113],[5,127,20114],[4,23,0,20115],[5,127,20116],[5,97,20117],[5,20118,5646],[5,20107,20119],[5,47,9559],[5,98,20121],[5,97,20122],[5,20123,9590],[4,63,0,20124],[5,127,20125],[4,23,0,20126],[5,127,20127],[5,97,20128],[5,20129,9560],[5,20107,20112],[5,6288,20131],[4,63,0,20132],[5,127,20133],[4,23,0,20134],[5,127,20135],[5,97,20136],[5,20137,5646],[5,20107,20138],[5,47,13186],[5,98,20140],[5,97,20141],[5,98,20034],[5,16855,20143],[5,6288,20144],[4,23,0,20145],[5,127,20146],[5,97,20147],[5,20148,5646],[5,20142,20149],[5,47,9743],[5,98,20151],[5,97,20152],[5,20153,10508],[4,23,0,20154],[5,127,20155],[5,97,20156],[5,20157,10512],[5,20142,20144],[5,6288,20159],[4,23,0,20160],[5,127,20161],[5,97,20162],[5,20163,5646],[5,20142,20164],[5,9418,13064],[5,20166,13098],[5,73,20167],[5,13402,15066],[5,20168,20169],[5,47,20170],[5,98,20171],[5,97,20172],[5,73,13098],[5,20174,13403],[5,98,20175],[5,6288,20176],[5,97,20177],[5,13401,16141],[5,98,20179],[5,6288,20180],[5,97,20181],[5,20182,5646],[5,20178,20183],[5,20173,20184],[5,47,10596],[5,98,20186],[5,97,20187],[5,20188,9772],[5,97,20189],[5,20188,9768],[5,97,20191],[5,20192,10597],[5,20190,20193],[5,20173,20176],[5,6288,20195],[5,97,20196],[5,20173,20180],[5,6288,20198],[5,97,20199],[5,20200,5646],[5,20197,20201],[5,20173,20202],[5,16739,14037],[5,25,20204],[5,20205,20167],[5,47,20206],[5,98,20207],[5,97,20208],[5,16741,13098],[5,98,20210],[5,6288,20211],[5,97,20212],[5,16745,14037],[5,25,20214],[5,20215,13064],[5,98,20216],[5,6288,20217],[5,97,20218],[5,20219,5646],[5,20213,20220],[5,20178,20221],[5,20182,20222],[5,20209,20223],[5,47,9802],[5,98,20225],[5,97,20226],[5,20227,9768],[5,97,20228],[5,20227,9772],[5,97,20230],[5,20227,9853],[5,97,20232],[5,20227,9860],[5,97,20234],[5,20235,9803],[5,20233,20236],[5,20231,20237],[5,20229,20238],[5,20209,20180],[5,6288,20240],[5,97,20241],[5,20209,20176],[5,6288,20243],[5,97,20244],[5,20209,20211],[5,6288,20246],[5,97,20247],[5,20209,20217],[5,6288,20249],[5,97,20250],[5,20251,5646],[5,20248,20252],[5,20245,20253],[5,20242,20254],[5,20209,20255],[5,17113,16849],[5,47,20257],[5,98,20258],[5,97,20259],[5,98,19247],[5,6288,20261],[5,97,20262],[5,101,17112],[5,9273,13059],[5,9271,20265],[5,20266,13059],[5,20264,20267],[5,98,20268],[5,6288,20269],[5,97,20270],[5,20271,5646],[5,20263,20272],[5,20260,20273],[5,47,9383],[5,98,20275],[5,97,20276],[5,20277,757],[5,97,20278],[5,20277,9408],[5,97,20280],[5,20281,9384],[5,20279,20282],[5,20260,20261],[5,6288,20284],[5,97,20285],[5,20260,20269],[5,6288,20287],[5,97,20288],[5,20289,5646],[5,20286,20290],[5,20260,20291],[5,25,20267],[5,20293,16849],[5,47,20294],[5,98,20295],[5,97,20296],[5,20263,5646],[5,20297,20298],[5,47,9404],[5,98,20300],[5,97,20301],[5,20302,757],[5,97,20303],[5,20304,9405],[5,20297,20261],[5,6288,20306],[5,97,20307],[5,20308,5646],[5,20297,20309],[5,10306,13064],[5,16606,20311],[5,47,20312],[5,98,20313],[5,97,20314],[5,20266,16605],[5,25,20316],[5,20317,13064],[5,98,20318],[5,6288,20319],[5,97,20320],[5,20321,5646],[5,20315,20322],[5,47,10328],[5,98,20324],[5,97,20325],[5,20326,9565],[5,97,20327],[5,20328,10329],[5,20315,20319],[5,6288,20330],[5,97,20331],[5,20332,5646],[5,20315,20333],[5,9889,13064],[5,13208,20335],[5,47,20336],[5,98,20337],[5,97,20338],[5,20339,20322],[5,47,10301],[5,98,20341],[5,97,20342],[5,20343,9565],[5,97,20344],[5,20345,10302],[5,20339,20319],[5,6288,20347],[5,97,20348],[5,20349,5646],[5,20339,20350],[2,14,1,2],[5,16985,20352],[5,13110,20353],[5,47,20354],[5,98,20355],[5,97,20356],[5,20352,13059],[5,20358,16605],[5,14387,20359],[5,98,20360],[5,6288,20361],[5,97,20362],[5,20317,14715],[5,98,20364],[5,6288,20365],[5,97,20366],[5,20367,5646],[5,20363,20368],[5,20357,20369],[5,47,10282],[5,98,20371],[5,97,20372],[5,20373,10277],[5,97,20374],[5,20373,10280],[5,97,20376],[5,20377,10283],[5,20375,20378],[5,20357,20361],[5,6288,20380],[5,97,20381],[5,20357,20365],[5,6288,20383],[5,97,20384],[5,20385,5646],[5,20382,20386],[5,20357,20387],[5,855,13403],[4,13,0,13197],[5,20389,20390],[5,47,20391],[5,98,20392],[5,97,20393],[5,98,16248],[5,6288,20395],[5,97,20396],[5,98,16759],[5,6288,20398],[5,97,20399],[5,13196,16740],[5,98,20401],[5,6288,20402],[5,97,20403],[5,20404,5646],[5,20400,20405],[5,20397,20406],[5,20394,20407],[5,47,10182],[5,98,20409],[5,97,20410],[5,20411,7556],[5,97,20412],[5,20411,7708],[5,97,20414],[5,20411,10179],[5,97,20416],[5,20417,10183],[5,20415,20418],[5,20413,20419],[5,20394,20395],[5,6288,20421],[5,97,20422],[5,20394,20398],[5,6288,20424],[5,97,20425],[5,20394,20402],[5,6288,20427],[5,97,20428],[5,20429,5646],[5,20426,20430],[5,20423,20431],[5,20394,20432],[5,15882,13103],[5,47,20434],[5,98,20435],[5,97,20436],[5,314,13103],[5,98,20438],[5,6288,20439],[5,97,20440],[5,31,13103],[5,101,20442],[5,20443,13806],[5,98,20444],[5,6288,20445],[5,97,20446],[5,34,13103],[5,20448,26],[5,101,20449],[5,20450,17135],[4,91,0,20451],[5,17131,20452],[5,98,20453],[5,6288,20454],[5,97,20455],[5,20448,13805],[5,101,20457],[5,20458,13785],[5,98,20459],[5,6288,20460],[5,97,20461],[5,20462,5646],[5,20456,20463],[5,17124,20464],[5,20447,20465],[5,20441,20466],[5,20437,20467],[5,47,10430],[5,98,20469],[5,97,20470],[5,20471,10410],[5,97,20472],[5,20471,10415],[5,97,20474],[5,20471,9308],[5,97,20476],[5,20471,10423],[5,97,20478],[5,20471,10428],[5,97,20480],[5,20481,10431],[5,20479,20482],[5,20477,20483],[5,20475,20484],[5,20473,20485],[5,20437,20439],[5,6288,20487],[5,97,20488],[5,20437,20445],[5,6288,20490],[5,97,20491],[5,20437,13751],[5,6288,20493],[5,97,20494],[5,20437,20454],[5,6288,20496],[5,97,20497],[5,20437,20460],[5,6288,20499],[5,97,20500],[5,20501,5646],[5,20498,20502],[5,20495,20503],[5,20492,20504],[5,20489,20505],[5,20437,20506],[5,15335,13802],[5,47,20508],[5,98,20509],[5,97,20510],[5,15338,13806],[5,98,20512],[5,6288,20513],[5,97,20514],[5,15392,17135],[4,91,0,20516],[5,17131,20517],[5,98,20518],[5,6288,20519],[5,97,20520],[5,15341,13805],[5,101,20522],[5,20523,13785],[5,98,20524],[5,6288,20525],[5,97,20526],[5,20527,5646],[5,20521,20528],[5,17124,20529],[5,20515,20530],[5,17222,20531],[5,20511,20532],[5,47,10402],[5,98,20534],[5,97,20535],[5,20536,472],[5,97,20537],[5,20536,10390],[5,97,20539],[5,20536,9308],[5,97,20541],[5,20536,10395],[5,97,20543],[5,20536,10400],[5,97,20545],[5,20546,10403],[5,20544,20547],[5,20542,20548],[5,20540,20549],[5,20538,20550],[5,20511,15333],[5,6288,20552],[5,97,20553],[5,20511,20513],[5,6288,20555],[5,97,20556],[5,20511,13751],[5,6288,20558],[5,97,20559],[5,20511,20519],[5,6288,20561],[5,97,20562],[5,20511,20525],[5,6288,20564],[5,97,20565],[5,20566,5646],[5,20563,20567],[5,20560,20568],[5,20557,20569],[5,20554,20570],[5,20511,20571],[5,10061,13093],[5,47,20573],[5,98,20574],[5,97,20575],[5,15338,11],[5,98,20577],[5,6288,20578],[5,97,20579],[5,20580,5646],[5,17222,20581],[5,20576,20582],[5,47,10443],[5,98,20584],[5,97,20585],[5,20586,472],[5,97,20587],[5,20586,10438],[5,97,20589],[5,20590,10444],[5,20588,20591],[5,20576,15333],[5,6288,20593],[5,97,20594],[5,20576,20578],[5,6288,20596],[5,97,20597],[5,20598,5646],[5,20595,20599],[5,20576,20600],[5,47,16588],[5,98,20602],[5,97,20603],[5,20604,20582],[5,47,10052],[5,98,20606],[5,97,20607],[5,20608,472],[5,97,20609],[5,20608,10438],[5,97,20611],[5,20612,10440],[5,20610,20613],[5,20604,15333],[5,6288,20615],[5,97,20616],[5,20604,20578],[5,6288,20618],[5,97,20619],[5,20620,5646],[5,20617,20621],[5,20604,20622],[5,314,13802],[5,47,20624],[5,98,20625],[5,97,20626],[5,6288,13763],[5,97,20628],[5,20629,5646],[5,20627,20630],[5,47,9707],[5,98,20632],[5,97,20633],[5,20634,9319],[5,97,20635],[5,20636,9708],[5,20627,13763],[5,6288,20638],[5,97,20639],[5,20640,5646],[5,20627,20641],[5,17124,5646],[5,20627,20643],[5,20634,9308],[5,97,20645],[5,20646,9708],[5,20627,13751],[5,6288,20648],[5,97,20649],[5,20650,5646],[5,20627,20651],[5,9306,13802],[5,47,20653],[5,98,20654],[5,97,20655],[5,20656,20643],[5,47,9711],[5,98,20658],[5,97,20659],[5,20660,9308],[5,97,20661],[5,20662,9712],[5,20656,13751],[5,6288,20664],[5,97,20665],[5,20666,5646],[5,20656,20667],[5,47,13762],[5,98,20669],[5,97,20670],[5,27,13756],[5,98,20672],[5,97,20673],[5,25,17135],[5,20675,13760],[5,98,20676],[5,20674,20677],[5,6288,20678],[4,89,0,20679],[5,127,20680],[5,97,20681],[5,20682,5646],[5,17124,20683],[5,20671,20684],[5,47,9318],[5,98,20686],[5,97,20687],[5,20688,9308],[5,97,20689],[5,20688,9521],[4,89,0,20691],[5,127,20692],[5,97,20693],[5,20694,9319],[5,20690,20695],[5,20671,13751],[5,6288,20697],[5,97,20698],[5,20671,20678],[5,6288,20700],[4,89,0,20701],[5,127,20702],[5,97,20703],[5,20704,5646],[5,20699,20705],[5,20671,20706],[5,15261,14332],[5,47,20708],[5,98,20709],[5,97,20710],[5,15258,15611],[5,98,20712],[5,6288,20713],[5,97,20714],[5,6288,15291],[5,97,20716],[5,20717,5646],[5,20715,20718],[5,20711,20719],[5,47,9455],[5,98,20721],[5,97,20722],[5,20723,9452],[5,97,20724],[5,20723,1511],[5,97,20726],[5,20727,9456],[5,20725,20728],[5,20711,20713],[5,6288,20730],[5,97,20731],[5,20711,15291],[5,6288,20733],[5,97,20734],[5,20735,5646],[5,20732,20736],[5,20711,20737],[5,47,13099],[5,98,20739],[5,97,20740],[5,6288,15254],[5,97,20742],[5,20715,5646],[5,20717,20744],[5,20743,20745],[5,20741,20746],[5,47,9307],[5,98,20748],[5,97,20749],[5,20750,9535],[5,97,20751],[5,20750,1511],[5,97,20753],[5,20750,9452],[5,97,20755],[5,20756,9308],[5,20754,20757],[5,20752,20758],[5,20741,15254],[5,6288,20760],[5,97,20761],[5,20741,15291],[5,6288,20763],[5,97,20764],[5,20741,20713],[5,6288,20766],[5,97,20767],[5,20768,5646],[5,20765,20769],[5,20762,20770],[5,20741,20771],[5,25,14778],[5,20773,1317],[5,47,20774],[5,98,20775],[5,97,20776],[5,6288,14400],[5,97,20778],[5,20779,5646],[5,17406,20780],[5,17404,20781],[5,20777,20782],[5,47,4281],[5,98,20784],[5,97,20785],[5,20786,1374],[5,97,20787],[5,20786,1387],[5,97,20789],[5,20786,3658],[5,97,20791],[5,20792,4282],[5,20790,20793],[5,20788,20794],[5,20777,13112],[5,6288,20796],[5,97,20797],[5,20777,13116],[5,6288,20799],[5,97,20800],[5,20777,14400],[5,6288,20802],[5,97,20803],[5,20804,5646],[5,20801,20805],[5,20798,20806],[5,20777,20807],[5,25,14932],[5,20809,1317],[5,47,20810],[5,98,20811],[5,97,20812],[5,20813,20782],[5,47,4025],[5,98,20815],[5,97,20816],[5,20817,1374],[5,97,20818],[5,20817,1387],[5,97,20820],[5,20817,3658],[5,97,20822],[5,20823,4026],[5,20821,20824],[5,20819,20825],[5,20813,13112],[5,6288,20827],[5,97,20828],[5,20813,13116],[5,6288,20830],[5,97,20831],[5,20813,14400],[5,6288,20833],[5,97,20834],[5,20835,5646],[5,20832,20836],[5,20829,20837],[5,20813,20838],[5,14058,14037],[5,17353,20840],[5,47,20841],[5,98,20842],[5,97,20843],[5,6288,14040],[5,97,20845],[5,98,17354],[5,6288,20847],[5,97,20848],[5,17353,14037],[5,98,20850],[5,6288,20851],[5,97,20852],[5,20853,5646],[5,20849,20854],[5,20846,20855],[5,17406,20856],[5,17404,20857],[5,20844,20858],[5,47,4078],[5,98,20860],[5,97,20861],[5,20862,1374],[5,97,20863],[5,20862,1387],[5,97,20865],[5,20862,1392],[5,97,20867],[5,20862,4073],[5,97,20869],[5,20862,4076],[5,97,20871],[5,20872,4079],[5,20870,20873],[5,20868,20874],[5,20866,20875],[5,20864,20876],[5,20844,13112],[5,6288,20878],[5,97,20879],[5,20844,13116],[5,6288,20881],[5,97,20882],[5,20844,14040],[5,6288,20884],[5,97,20885],[5,20844,20847],[5,6288,20887],[5,97,20888],[5,20844,20851],[5,6288,20890],[5,97,20891],[5,20892,5646],[5,20889,20893],[5,20886,20894],[5,20883,20895],[5,20880,20896],[5,20844,20897],[5,17353,13920],[5,47,20899],[5,98,20900],[5,97,20901],[5,20902,17408],[5,47,4158],[5,98,20904],[5,97,20905],[5,20906,1374],[5,97,20907],[5,20906,1387],[5,97,20909],[5,20910,4159],[5,20908,20911],[5,20902,13112],[5,6288,20913],[5,97,20914],[5,20902,13116],[5,6288,20916],[5,97,20917],[5,20918,5646],[5,20915,20919],[5,20902,20920],[5,17353,14759],[5,47,20922],[5,98,20923],[5,97,20924],[5,20925,17408],[5,47,4162],[5,98,20927],[5,97,20928],[5,20929,1374],[5,97,20930],[5,20929,1387],[5,97,20932],[5,20933,4163],[5,20931,20934],[5,20925,13112],[5,6288,20936],[5,97,20937],[5,20925,13116],[5,6288,20939],[5,97,20940],[5,20941,5646],[5,20938,20942],[5,20925,20943],[5,4300,13103],[5,47,20945],[5,98,20946],[5,97,20947],[5,17404,5646],[5,20948,20949],[5,47,4301],[5,98,20951],[5,97,20952],[5,20953,1374],[5,97,20954],[5,20955,4302],[5,20948,13112],[5,6288,20957],[5,97,20958],[5,20959,5646],[5,20948,20960],[5,17353,1378],[5,47,20962],[5,98,20963],[5,97,20964],[5,20965,20949],[5,47,4069],[5,98,20967],[5,97,20968],[5,20969,1374],[5,97,20970],[5,20971,4070],[5,20965,13112],[5,6288,20973],[5,97,20974],[5,20975,5646],[5,20965,20976],[5,17353,13103],[5,47,20978],[5,98,20979],[5,97,20980],[5,20981,20949],[5,47,4130],[5,98,20983],[5,97,20984],[5,20985,1374],[5,97,20986],[5,20987,4131],[5,20981,13112],[5,6288,20989],[5,97,20990],[5,20991,5646],[5,20981,20992],[5,47,13147],[5,98,20994],[5,97,20995],[5,6288,14307],[5,97,20997],[5,14271,14304],[5,14387,20999],[5,98,21000],[5,6288,21001],[5,97,21002],[5,21003,5646],[5,20998,21004],[5,17406,21005],[5,17404,21006],[5,20996,21007],[5,47,3735],[5,98,21009],[5,97,21010],[5,21011,1374],[5,97,21012],[5,21011,1387],[5,97,21014],[5,21011,1319],[5,97,21016],[5,21011,4047],[5,97,21018],[5,21019,4030],[5,21017,21020],[5,21015,21021],[5,21013,21022],[5,20996,13112],[5,6288,21024],[5,97,21025],[5,20996,13116],[5,6288,21027],[5,97,21028],[5,20996,14307],[5,6288,21030],[5,97,21031],[5,20996,21001],[5,6288,21033],[5,97,21034],[5,21035,5646],[5,21032,21036],[5,21029,21037],[5,21026,21038],[5,20996,21039],[5,27,1959],[5,98,21041],[5,826,21042],[4,23,0,21043],[5,127,21044],[5,97,21045],[5,97,21042],[5,21047,825],[4,23,0,21048],[5,127,21049],[5,97,21050],[5,6382,1959],[5,98,21052],[5,21051,21053],[5,21046,21054],[5,13488,14114],[5,47,21056],[5,98,21057],[5,97,21058],[5,27,14114],[5,98,21060],[5,16855,21061],[5,6288,21062],[4,23,0,21063],[5,127,21064],[5,97,21065],[5,97,21061],[5,21067,16854],[5,6288,21068],[4,23,0,21069],[5,127,21070],[5,97,21071],[5,21072,5646],[5,21066,21073],[5,21059,21074],[5,47,21052],[5,98,21076],[5,97,21077],[5,21078,21043],[4,23,0,21079],[5,127,21080],[5,97,21081],[5,21078,21048],[4,23,0,21083],[5,127,21084],[5,97,21085],[5,21086,21053],[5,21082,21087],[5,21059,21062],[5,6288,21089],[4,23,0,21090],[5,127,21091],[5,97,21092],[5,21059,21068],[5,6288,21094],[4,23,0,21095],[5,127,21096],[5,97,21097],[5,21098,5646],[5,21093,21099],[5,21059,21100],[5,21047,7662],[4,23,0,21102],[5,127,21103],[5,97,21104],[5,7663,21042],[4,23,0,21106],[5,127,21107],[5,97,21108],[5,2626,852],[5,98,21110],[5,21109,21111],[5,21105,21112],[5,101,14114],[5,21114,13136],[5,47,21115],[5,98,21116],[5,97,21117],[5,21067,16877],[5,6288,21119],[4,23,0,21120],[5,127,21121],[5,97,21122],[5,16883,21061],[5,6288,21124],[4,23,0,21125],[5,127,21126],[5,97,21127],[5,21128,5646],[5,21123,21129],[5,21118,21130],[5,47,21110],[5,98,21132],[5,97,21133],[5,21134,21102],[4,23,0,21135],[5,127,21136],[5,97,21137],[5,21134,21106],[4,23,0,21139],[5,127,21140],[5,97,21141],[5,21142,21111],[5,21138,21143],[5,21118,21119],[5,6288,21145],[4,23,0,21146],[5,127,21147],[5,97,21148],[5,21118,21124],[5,6288,21150],[4,23,0,21151],[5,127,21152],[5,97,21153],[5,21154,5646],[5,21149,21155],[5,21118,21156],[5,47,16534],[5,98,21158],[5,97,21159],[5,98,16537],[5,6288,21161],[5,97,21162],[5,98,16539],[5,6288,21164],[5,97,21165],[5,21166,5646],[5,21163,21167],[5,20998,21168],[5,21160,21169],[5,47,1960],[5,98,21171],[5,97,21172],[5,21173,1319],[5,97,21174],[5,21173,2614],[5,97,21176],[5,21173,2618],[5,97,21178],[5,21179,1961],[5,21177,21180],[5,21175,21181],[5,21160,14307],[5,6288,21183],[5,97,21184],[5,21160,21161],[5,6288,21186],[5,97,21187],[5,21160,21164],[5,6288,21189],[5,97,21190],[5,21191,5646],[5,21188,21192],[5,21185,21193],[5,21160,21194],[5,1589,14090],[5,1376,14123],[5,21197,14102],[5,21196,21198],[5,47,21199],[5,98,21200],[5,97,21201],[5,14107,14102],[5,98,21203],[5,6288,21204],[5,97,21205],[5,6288,14093],[5,97,21207],[5,6288,14105],[5,97,21209],[5,6288,15570],[5,97,21211],[5,2322,14123],[5,98,21213],[5,6288,21214],[5,97,21215],[5,21216,5646],[5,21212,21217],[5,21210,21218],[5,21208,21219],[5,21206,21220],[5,21202,21221],[5,47,3589],[5,98,21223],[5,97,21224],[5,21225,2123],[5,97,21226],[5,21225,1351],[5,97,21228],[5,21225,1356],[5,97,21230],[5,21225,1323],[5,97,21232],[5,21225,3578],[5,97,21234],[5,21235,3590],[5,21233,21236],[5,21231,21237],[5,21229,21238],[5,21227,21239],[5,21202,21204],[5,6288,21241],[5,97,21242],[5,21202,14093],[5,6288,21244],[5,97,21245],[5,21202,14105],[5,6288,21247],[5,97,21248],[5,21202,15570],[5,6288,21250],[5,97,21251],[5,21202,21214],[5,6288,21253],[5,97,21254],[5,21255,5646],[5,21252,21256],[5,21249,21257],[5,21246,21258],[5,21243,21259],[5,21202,21260],[5,14309,14123],[5,21196,21262],[5,47,21263],[5,98,21264],[5,97,21265],[5,21266,21221],[5,47,3581],[5,98,21268],[5,97,21269],[5,21270,2123],[5,97,21271],[5,21270,1351],[5,97,21273],[5,21270,1356],[5,97,21275],[5,21270,1323],[5,97,21277],[5,21270,3578],[5,97,21279],[5,21280,3582],[5,21278,21281],[5,21276,21282],[5,21274,21283],[5,21272,21284],[5,21266,21204],[5,6288,21286],[5,97,21287],[5,21266,14093],[5,6288,21289],[5,97,21290],[5,21266,14105],[5,6288,21292],[5,97,21293],[5,21266,15570],[5,6288,21295],[5,97,21296],[5,21266,21214],[5,6288,21298],[5,97,21299],[5,21300,5646],[5,21297,21301],[5,21294,21302],[5,21291,21303],[5,21288,21304],[5,21266,21305],[5,21196,14102],[5,98,21307],[5,6288,21308],[5,97,21309],[5,1483,14123],[5,98,21311],[5,6288,21312],[5,97,21313],[5,21314,5646],[5,21212,21315],[5,21210,21316],[5,21208,21317],[5,21310,21318],[5,21202,21319],[5,21225,1634],[5,97,21321],[5,21225,1485],[5,97,21323],[5,21324,3590],[5,21233,21325],[5,21231,21326],[5,21229,21327],[5,21322,21328],[5,21202,21308],[5,6288,21330],[5,97,21331],[5,21202,21312],[5,6288,21333],[5,97,21334],[5,21335,5646],[5,21252,21336],[5,21249,21337],[5,21246,21338],[5,21332,21339],[5,21202,21340],[5,21266,21319],[5,21270,1634],[5,97,21343],[5,21270,1485],[5,97,21345],[5,21346,3582],[5,21278,21347],[5,21276,21348],[5,21274,21349],[5,21344,21350],[5,21266,21308],[5,6288,21352],[5,97,21353],[5,21266,21312],[5,6288,21355],[5,97,21356],[5,21357,5646],[5,21297,21358],[5,21294,21359],[5,21291,21360],[5,21354,21361],[5,21266,21362],[5,21197,13105],[5,13118,21364],[5,47,21365],[5,98,21366],[5,97,21367],[5,17406,21316],[5,17404,21369],[5,17415,21370],[5,21368,21371],[5,47,3551],[5,98,21373],[5,97,21374],[5,21375,1575],[5,97,21376],[5,21375,1374],[5,97,21378],[5,21375,1387],[5,97,21380],[5,21375,1323],[5,97,21382],[5,21375,1485],[5,97,21384],[5,21385,3552],[5,21383,21386],[5,21381,21387],[5,21379,21388],[5,21377,21389],[5,21368,17413],[5,6288,21391],[5,97,21392],[5,21368,13112],[5,6288,21394],[5,97,21395],[5,21368,13116],[5,6288,21397],[5,97,21398],[5,21368,15570],[5,6288,21400],[5,97,21401],[5,21368,21312],[5,6288,21403],[5,97,21404],[5,21405,5646],[5,21402,21406],[5,21399,21407],[5,21396,21408],[5,21393,21409],[5,21368,21410],[5,14058,14123],[5,13118,21412],[5,47,21413],[5,98,21414],[5,97,21415],[5,21416,21371],[5,47,3543],[5,98,21418],[5,97,21419],[5,21420,1575],[5,97,21421],[5,21420,1374],[5,97,21423],[5,21420,1387],[5,97,21425],[5,21420,1323],[5,97,21427],[5,21420,1485],[5,97,21429],[5,21430,3544],[5,21428,21431],[5,21426,21432],[5,21424,21433],[5,21422,21434],[5,21416,17413],[5,6288,21436],[5,97,21437],[5,21416,13112],[5,6288,21439],[5,97,21440],[5,21416,13116],[5,6288,21442],[5,97,21443],[5,21416,15570],[5,6288,21445],[5,97,21446],[5,21416,21312],[5,6288,21448],[5,97,21449],[5,21450,5646],[5,21447,21451],[5,21444,21452],[5,21441,21453],[5,21438,21454],[5,21416,21455],[5,14402,13884],[5,47,21457],[5,98,21458],[5,97,21459],[5,98,14385],[5,6288,21461],[5,97,21462],[5,21463,17407],[5,17404,21464],[5,21460,21465],[5,47,2711],[5,98,21467],[5,97,21468],[5,21469,1374],[5,97,21470],[5,21469,2704],[5,97,21472],[5,21469,1387],[5,97,21474],[5,21475,2712],[5,21473,21476],[5,21471,21477],[5,21460,13112],[5,6288,21479],[5,97,21480],[5,21460,21461],[5,6288,21482],[5,97,21483],[5,21460,13116],[5,6288,21485],[5,97,21486],[5,21487,5646],[5,21484,21488],[5,21481,21489],[5,21460,21490],[5,14402,14774],[5,47,21492],[5,98,21493],[5,97,21494],[5,21495,21465],[5,47,2706],[5,98,21497],[5,97,21498],[5,21499,1374],[5,97,21500],[5,21499,2704],[5,97,21502],[5,21499,1387],[5,97,21504],[5,21505,2707],[5,21503,21506],[5,21501,21507],[5,21495,13112],[5,6288,21509],[5,97,21510],[5,21495,21461],[5,6288,21512],[5,97,21513],[5,21495,13116],[5,6288,21515],[5,97,21516],[5,21517,5646],[5,21514,21518],[5,21511,21519],[5,21495,21520],[5,2322,14340],[5,47,21522],[5,98,21523],[5,97,21524],[5,6288,14338],[5,97,21526],[5,21527,5646],[5,17587,21528],[5,21525,21529],[5,47,2966],[5,98,21531],[5,97,21532],[5,21533,1328],[5,97,21534],[5,21533,1488],[5,97,21536],[5,21537,2967],[5,21535,21538],[5,21525,14335],[5,6288,21540],[5,97,21541],[5,21525,14338],[5,6288,21543],[5,97,21544],[5,21545,5646],[5,21542,21546],[5,21525,21547],[5,14352,13103],[5,47,21549],[5,98,21550],[5,97,21551],[5,21552,20949],[5,47,2540],[5,98,21554],[5,97,21555],[5,21556,1374],[5,97,21557],[5,21558,2541],[5,21552,13112],[5,6288,21560],[5,97,21561],[5,21562,5646],[5,21552,21563],[5,13104,13946],[5,47,21565],[5,98,21566],[5,97,21567],[5,21568,20949],[5,47,2456],[5,98,21570],[5,97,21571],[5,21572,1374],[5,97,21573],[5,21574,2457],[5,21568,13112],[5,6288,21576],[5,97,21577],[5,21578,5646],[5,21568,21579],[5,47,14367],[5,98,21581],[5,97,21582],[5,98,13106],[5,6288,21584],[5,97,21585],[5,21586,5646],[5,17406,21587],[5,17404,21588],[5,21583,21589],[5,47,2528],[5,98,21591],[5,97,21592],[5,21593,1374],[5,97,21594],[5,21593,1387],[5,97,21596],[5,21593,1642],[5,97,21598],[5,21599,2534],[5,21597,21600],[5,21595,21601],[5,21583,13112],[5,6288,21603],[5,97,21604],[5,21583,13116],[5,6288,21606],[5,97,21607],[5,21583,21584],[5,6288,21609],[5,97,21610],[5,21611,5646],[5,21608,21612],[5,21605,21613],[5,21583,21614],[5,47,14347],[5,98,21616],[5,97,21617],[5,21618,21589],[5,47,2581],[5,98,21620],[5,97,21621],[5,21622,1374],[5,97,21623],[5,21622,1387],[5,97,21625],[5,21622,1642],[5,97,21627],[5,21628,2587],[5,21626,21629],[5,21624,21630],[5,21618,13112],[5,6288,21632],[5,97,21633],[5,21618,13116],[5,6288,21635],[5,97,21636],[5,21618,21584],[5,6288,21638],[5,97,21639],[5,21640,5646],[5,21637,21641],[5,21634,21642],[5,21618,21643],[5,47,14482],[5,98,21645],[5,97,21646],[5,21647,21589],[5,2237,1374],[5,97,21649],[5,2237,1387],[5,97,21651],[5,2237,1642],[5,97,21653],[5,21654,2251],[5,21652,21655],[5,21650,21656],[5,21647,13112],[5,6288,21658],[5,97,21659],[5,21647,13116],[5,6288,21661],[5,97,21662],[5,21647,21584],[5,6288,21664],[5,97,21665],[5,21666,5646],[5,21663,21667],[5,21660,21668],[5,21647,21669],[5,47,14488],[5,98,21671],[5,97,21672],[5,21673,21589],[5,2231,1374],[5,97,21675],[5,2231,1387],[5,97,21677],[5,2231,1642],[5,97,21679],[5,21680,2543],[5,21678,21681],[5,21676,21682],[5,21673,13112],[5,6288,21684],[5,97,21685],[5,21673,13116],[5,6288,21687],[5,97,21688],[5,21673,21584],[5,6288,21690],[5,97,21691],[5,21692,5646],[5,21689,21693],[5,21686,21694],[5,21673,21695],[5,47,14649],[5,98,21697],[5,97,21698],[5,17415,17408],[5,21699,21700],[5,47,1700],[5,98,21702],[5,97,21703],[5,21704,1575],[5,97,21705],[5,21704,1374],[5,97,21707],[5,21704,1387],[5,97,21709],[5,21710,1701],[5,21708,21711],[5,21706,21712],[5,21699,17413],[5,6288,21714],[5,97,21715],[5,21699,13112],[5,6288,21717],[5,97,21718],[5,21699,13116],[5,6288,21720],[5,97,21721],[5,21722,5646],[5,21719,21723],[5,21716,21724],[5,21699,21725],[5,47,14466],[5,98,21727],[5,97,21728],[5,21729,21700],[5,47,2275],[5,98,21731],[5,97,21732],[5,21733,1575],[5,97,21734],[5,21733,1374],[5,97,21736],[5,21733,1387],[5,97,21738],[5,21739,2276],[5,21737,21740],[5,21735,21741],[5,21729,17413],[5,6288,21743],[5,97,21744],[5,21729,13112],[5,6288,21746],[5,97,21747],[5,21729,13116],[5,6288,21749],[5,97,21750],[5,21751,5646],[5,21748,21752],[5,21745,21753],[5,21729,21754],[5,14641,13103],[5,47,21756],[5,98,21757],[5,97,21758],[5,21759,20949],[5,47,2492],[5,98,21761],[5,97,21762],[5,21763,1374],[5,97,21764],[5,21765,2493],[5,21759,13112],[5,6288,21767],[5,97,21768],[5,21769,5646],[5,21759,21770],[5,13118,13946],[5,47,21772],[5,98,21773],[5,97,21774],[5,21775,20949],[5,47,2272],[5,98,21777],[5,97,21778],[5,21779,1374],[5,97,21780],[5,21781,2273],[5,21775,13112],[5,6288,21783],[5,97,21784],[5,21785,5646],[5,21775,21786],[5,13118,13103],[5,47,21788],[5,98,21789],[5,97,21790],[5,21791,20949],[5,47,2269],[5,98,21793],[5,97,21794],[5,21795,1374],[5,97,21796],[5,21797,2270],[5,21791,13112],[5,6288,21799],[5,97,21800],[5,21801,5646],[5,21791,21802],[5,20008,2970],[5,47,13106],[5,98,21805],[5,97,21806],[5,15273,13103],[5,101,21808],[5,21809,2245],[5,98,21810],[5,6288,21811],[5,97,21812],[5,21813,17416],[5,21807,21814],[5,2048,20007],[5,97,21816],[5,2048,1575],[5,97,21818],[5,21819,1642],[5,21817,21820],[5,21807,21811],[5,6288,21822],[5,97,21823],[5,21807,17413],[5,6288,21825],[5,97,21826],[5,21827,5646],[5,21824,21828],[5,21807,21829],[5,47,21808],[5,98,21831],[5,6288,21832],[5,97,21833],[5,21834,17416],[5,21807,21835],[5,2048,2091],[5,97,21837],[5,21838,21820],[5,21807,21832],[5,6288,21840],[5,97,21841],[5,21842,21828],[5,21807,21843],[5,20012,2970],[5,101,15281],[5,21846,2245],[5,98,21847],[5,6288,21848],[5,97,21849],[5,21850,17416],[5,21807,21851],[5,2048,20011],[5,97,21853],[5,21854,21820],[5,21807,21848],[5,6288,21856],[5,97,21857],[5,21858,21828],[5,21807,21859],[5,47,15281],[5,98,21861],[5,6288,21862],[5,97,21863],[5,21864,17416],[5,21807,21865],[5,2048,2476],[5,97,21867],[5,21868,21820],[5,21807,21862],[5,6288,21870],[5,97,21871],[5,21872,21828],[5,21807,21873],[5,25,13920],[5,21875,1317],[5,47,21876],[5,98,21877],[5,97,21878],[5,21879,17408],[5,47,2818],[5,98,21881],[5,97,21882],[5,21883,1374],[5,97,21884],[5,21883,1387],[5,97,21886],[5,21887,2819],[5,21885,21888],[5,21879,13112],[5,6288,21890],[5,97,21891],[5,21879,13116],[5,6288,21893],[5,97,21894],[5,21895,5646],[5,21892,21896],[5,21879,21897],[5,25,13884],[5,21899,1317],[5,47,21900],[5,98,21901],[5,97,21902],[5,21903,17408],[5,47,1808],[5,98,21905],[5,97,21906],[5,21907,1374],[5,97,21908],[5,21907,1387],[5,97,21910],[5,21911,1809],[5,21909,21912],[5,21903,13112],[5,6288,21914],[5,97,21915],[5,21903,13116],[5,6288,21917],[5,97,21918],[5,21919,5646],[5,21916,21920],[5,21903,21921],[5,47,14334],[5,98,21923],[5,97,21924],[5,21925,20718],[5,47,1327],[5,98,21927],[5,97,21928],[5,21929,1511],[5,97,21930],[5,21931,1328],[5,21925,15291],[5,6288,21933],[5,97,21934],[5,21935,5646],[5,21925,21936],[5,344,13777],[5,21938,13778],[5,47,21939],[5,98,21940],[5,97,21941],[5,21942,5646],[5,47,16607],[5,98,21944],[5,97,21945],[5,98,16613],[5,6288,21947],[5,97,21948],[5,21949,5646],[5,21946,21950],[5,47,821],[5,98,21952],[5,97,21953],[5,21954,885],[5,97,21955],[5,21956,822],[5,21946,21947],[5,6288,21958],[5,97,21959],[5,21960,5646],[5,21946,21961],[5,25,16063],[5,21963,15239],[5,47,21964],[5,98,21965],[5,97,21966],[5,6288,18425],[5,97,21968],[5,98,16061],[5,6288,21970],[5,97,21971],[5,21972,5646],[5,21969,21973],[5,21967,21974],[5,47,873],[5,98,21976],[5,97,21977],[5,21978,869],[5,97,21979],[5,21978,871],[5,97,21981],[5,21982,874],[5,21980,21983],[5,21967,18425],[5,6288,21985],[5,97,21986],[5,21967,21970],[5,6288,21988],[5,97,21989],[5,21990,5646],[5,21987,21991],[5,21967,21992],[5,47,16527],[5,98,21994],[5,97,21995],[5,27,15066],[5,98,21997],[5,97,21998],[5,98,16522],[5,21999,22000],[5,6288,22001],[4,79,0,22002],[5,127,22003],[5,97,22004],[4,79,0,21997],[5,703,22006],[5,98,22007],[5,6288,22008],[5,97,22009],[5,22010,5646],[5,22005,22011],[5,21996,22012],[5,47,7297],[5,98,22014],[5,97,22015],[5,22016,7309],[4,79,0,22017],[5,127,22018],[5,97,22019],[5,22016,7320],[5,97,22021],[5,22022,7298],[5,22020,22023],[5,21996,22001],[5,6288,22025],[4,79,0,22026],[5,127,22027],[5,97,22028],[5,21996,22008],[5,6288,22030],[5,97,22031],[5,22032,5646],[5,22029,22033],[5,21996,22034],[5,47,16519],[5,98,22036],[5,97,22037],[5,25,13136],[5,22039,15066],[5,98,22040],[5,6288,22041],[5,97,22042],[5,98,15983],[5,6288,22044],[5,97,22045],[5,22046,5646],[5,22043,22047],[5,22038,22048],[5,47,7301],[5,98,22050],[5,97,22051],[5,22052,7482],[5,97,22053],[5,22052,7485],[5,97,22055],[5,22056,7302],[5,22054,22057],[5,22038,22041],[5,6288,22059],[5,97,22060],[5,22038,22044],[5,6288,22062],[5,97,22063],[5,22064,5646],[5,22061,22065],[5,22038,22066],[5,47,16579],[5,98,22068],[5,97,22069],[5,13809,13059],[5,14387,22071],[5,98,22072],[5,6288,22073],[5,97,22074],[5,22075,20298],[5,22070,22076],[5,47,8719],[5,98,22078],[5,97,22079],[5,22080,8769],[5,97,22081],[5,22080,757],[5,97,22083],[5,22084,8720],[5,22082,22085],[5,22070,22073],[5,6288,22087],[5,97,22088],[5,22070,20261],[5,6288,22090],[5,97,22091],[5,22092,5646],[5,22089,22093],[5,22070,22094],[5,98,13504],[5,97,22096],[5,13196,13059],[5,98,22098],[5,6288,22099],[5,97,22100],[5,22101,5646],[5,21969,22102],[5,22097,22103],[5,98,8566],[5,97,22105],[5,22106,869],[5,97,22107],[5,22106,7684],[5,97,22109],[5,22110,7766],[5,22108,22111],[5,22097,18425],[5,6288,22113],[5,97,22114],[5,22097,22099],[5,6288,22116],[5,97,22117],[5,22118,5646],[5,22115,22119],[5,22097,22120],[5,101,19778],[5,16783,13815],[5,22123,13093],[5,22122,22124],[5,47,22125],[5,98,22126],[5,97,22127],[5,98,13169],[5,6288,22129],[5,97,22130],[5,19889,19854],[5,19832,22132],[5,6288,22133],[5,97,22134],[5,98,16791],[5,97,22136],[5,98,15897],[5,22137,22138],[5,19839,22139],[5,6288,22140],[5,97,22141],[5,22142,5646],[5,22135,22143],[5,22131,22144],[5,22128,22145],[5,47,7053],[5,98,22147],[5,97,22148],[5,22149,6386],[5,97,22150],[5,22149,7044],[5,97,22152],[5,22149,7049],[5,97,22154],[5,22155,7054],[5,22153,22156],[5,22151,22157],[5,22128,22129],[5,6288,22159],[5,97,22160],[5,22128,22133],[5,6288,22162],[5,97,22163],[5,22128,22140],[5,6288,22165],[5,97,22166],[5,22167,5646],[5,22164,22168],[5,22161,22169],[5,22128,22170],[5,47,13424],[5,98,22172],[5,97,22173],[5,6288,19838],[5,97,22175],[5,22176,5646],[5,22174,22177],[5,47,5792],[5,98,22179],[5,97,22180],[5,22181,5704],[5,97,22182],[5,22183,5793],[5,22174,19838],[5,6288,22185],[5,97,22186],[5,22187,5646],[5,22174,22188],[5,13423,5580],[5,47,22190],[5,98,22191],[5,97,22192],[5,19921,5646],[5,22193,22194],[5,47,5826],[5,98,22196],[5,97,22197],[5,22198,5558],[5,97,22199],[5,22200,5827],[5,22193,19831],[5,6288,22202],[5,97,22203],[5,22204,5646],[5,22193,22205],[5,15273,19326],[5,47,22207],[5,98,22208],[5,97,22209],[5,98,13581],[5,6288,22211],[5,97,22212],[5,97,19104],[5,559,13105],[5,98,22215],[5,22214,22216],[5,6288,22217],[4,23,0,22218],[5,127,22219],[5,97,22220],[5,22221,5646],[5,22213,22222],[5,22210,22223],[5,47,5993],[5,98,22225],[5,97,22226],[5,22227,5975],[5,97,22228],[5,22227,5989],[4,23,0,22230],[5,127,22231],[5,97,22232],[5,22233,5994],[5,22229,22234],[5,22210,22211],[5,6288,22236],[5,97,22237],[5,22210,22217],[5,6288,22239],[4,23,0,22240],[5,127,22241],[5,97,22242],[5,22243,5646],[5,22238,22244],[5,22210,22245],[5,19339,13103],[5,47,22247],[5,98,22248],[5,97,22249],[5,98,16252],[5,22214,22251],[5,6288,22252],[4,23,0,22253],[5,127,22254],[5,97,22255],[5,22256,5646],[5,22213,22257],[5,22250,22258],[5,47,5983],[5,98,22260],[5,97,22261],[5,22262,5975],[5,97,22263],[5,22262,5979],[4,23,0,22265],[5,127,22266],[5,97,22267],[5,22268,5984],[5,22264,22269],[5,22250,22211],[5,6288,22271],[5,97,22272],[5,22250,22252],[5,6288,22274],[4,23,0,22275],[5,127,22276],[5,97,22277],[5,22278,5646],[5,22273,22279],[5,22250,22280],[5,47,13638],[5,98,22282],[5,97,22283],[2,154,1,75],[5,13075,22285],[5,98,22286],[5,6288,22287],[5,97,22288],[5,22289,5646],[5,22284,22290],[5,12408,5935],[5,97,22292],[5,22293,5691],[5,22284,22287],[5,6288,22295],[5,97,22296],[5,22297,5646],[5,22284,22298],[5,97,10348],[5,22300,7073],[5,97,22301],[5,22302,7073],[5,870,22303],[5,10345,22304],[5,9730,19934],[5,22306,3745],[5,98,22307],[5,97,22308],[5,646,19934],[5,98,22310],[5,5790,22311],[5,97,22312],[5,22300,5558],[5,97,22314],[5,22315,5558],[5,22313,22316],[5,22309,22317],[5,22309,22311],[5,5790,22319],[5,97,22320],[5,22309,5558],[5,22300,22322],[5,97,22323],[5,22324,5558],[5,22321,22325],[5,22309,22326],[5,10900,9565],[5,97,22328],[5,10900,10950],[5,97,22330],[5,22331,10955],[5,22329,22332],[5,10900,22333],[5,9561,9565],[5,97,22335],[5,9561,9572],[5,97,22337],[5,22338,1006],[5,22336,22339],[5,9561,22340],[5,9599,19936],[5,98,22342],[5,5790,22343],[5,97,22344],[5,9926,19941],[4,63,0,22346],[5,127,22347],[4,23,0,22348],[5,127,22349],[5,97,22350],[5,22351,5558],[5,22345,22352],[5,9922,22353],[5,9922,22343],[5,5790,22355],[5,97,22356],[5,9922,5558],[5,9583,22358],[5,9926,22359],[4,63,0,22360],[5,127,22361],[4,23,0,22362],[5,127,22363],[5,97,22364],[5,22365,5558],[5,22357,22366],[5,9922,22367],[5,10335,5558],[4,23,0,22369],[5,127,22370],[5,97,22371],[5,22372,5558],[5,22345,22373],[5,10330,22374],[5,10330,22343],[5,5790,22376],[5,97,22377],[5,10330,5558],[5,10335,22379],[4,23,0,22380],[5,127,22381],[5,97,22382],[5,22383,5558],[5,22378,22384],[5,10330,22385],[5,10319,5558],[4,63,0,22387],[5,127,22388],[5,97,22389],[5,22390,5558],[5,22345,22391],[5,10303,22392],[5,10303,22343],[5,5790,22394],[5,97,22395],[5,10303,5558],[5,10319,22397],[4,63,0,22398],[5,127,22399],[5,97,22400],[5,22401,5558],[5,22396,22402],[5,10303,22403],[5,9966,9611],[5,97,22405],[5,22406,7708],[5,9966,22407],[5,22406,7556],[5,9966,22409],[5,10165,439],[5,10167,22411],[5,7663,22412],[5,1015,22413],[4,97,0,22414],[5,127,22415],[4,81,0,22416],[5,127,22417],[5,97,22418],[5,22419,439],[5,10165,22420],[5,9320,1328],[5,97,22422],[5,9320,10673],[5,97,22424],[5,9320,10676],[5,97,22426],[5,22427,10681],[5,22425,22428],[5,22423,22429],[5,9320,22430],[5,9320,439],[5,9509,22432],[5,9506,22433],[5,97,22434],[5,22435,439],[5,9320,22436],[5,9309,439],[5,9509,22438],[5,10366,22439],[5,10064,22440],[5,97,22441],[5,22442,439],[5,9309,22443],[5,4035,5558],[5,2408,22445],[4,89,0,22446],[5,127,22447],[5,97,22448],[5,22449,5558],[5,19982,22450],[5,19980,22451],[5,4031,22452],[5,4031,1374],[5,5790,22454],[5,97,22455],[5,4031,1387],[5,5790,22457],[5,97,22458],[5,4031,5558],[5,4035,22460],[5,2408,22461],[4,89,0,22462],[5,127,22463],[5,97,22464],[5,22465,5558],[5,22459,22466],[5,22456,22467],[5,4031,22468],[5,1962,439],[5,2619,22470],[5,2615,22471],[5,1320,22472],[5,97,22473],[5,22474,439],[5,1962,22475],[5,1711,1374],[5,97,22477],[5,1711,1387],[5,97,22479],[5,1711,1319],[5,97,22481],[5,1711,1630],[5,97,22483],[5,22484,1701],[5,22482,22485],[5,22480,22486],[5,22478,22487],[5,1711,22488],[5,1697,1374],[5,97,22490],[5,1697,1387],[5,97,22492],[5,1697,1319],[5,97,22494],[5,1697,1630],[5,97,22496],[5,22497,1701],[5,22495,22498],[5,22493,22499],[5,22491,22500],[5,1697,22501],[5,1682,1374],[5,97,22503],[5,1682,1387],[5,97,22505],[5,1682,1319],[5,97,22507],[5,1682,1630],[5,97,22509],[5,22510,1575],[5,22508,22511],[5,22506,22512],[5,22504,22513],[5,1682,22514],[5,1672,1374],[5,97,22516],[5,1672,1387],[5,97,22518],[5,1672,1319],[5,97,22520],[5,1672,1630],[5,97,22522],[5,22523,1575],[5,22521,22524],[5,22519,22525],[5,22517,22526],[5,1672,22527],[5,2535,19987],[5,2535,1374],[5,5790,22530],[5,97,22531],[5,2535,1387],[5,5790,22533],[5,97,22534],[5,2535,5558],[5,1643,22536],[5,97,22537],[5,22538,5558],[5,22535,22539],[5,22532,22540],[5,2535,22541],[5,2588,19987],[5,2588,1374],[5,5790,22544],[5,97,22545],[5,2588,1387],[5,5790,22547],[5,97,22548],[5,2588,5558],[5,1643,22550],[5,97,22551],[5,22552,5558],[5,22549,22553],[5,22546,22554],[5,2588,22555],[5,1388,7035],[5,1375,22557],[5,1926,22558],[5,1576,22559],[5,1576,1925],[5,97,22561],[5,1576,1374],[5,97,22563],[5,1576,1387],[5,97,22565],[5,22566,7035],[5,22564,22567],[5,22562,22568],[5,1576,22569],[5,22566,1922],[5,22564,22571],[5,22562,22572],[5,1576,22573],[5,97,17445],[5,1390,5128],[5,98,22576],[5,97,22577],[5,22578,439],[5,8212,22579],[5,97,22580],[5,47,22576],[5,98,22582],[5,97,22583],[5,22584,439],[5,8689,22585],[5,97,22586],[5,22587,439],[5,22581,22588],[5,22575,22589],[5,22575,439],[5,22578,22591],[5,8212,22592],[5,97,22593],[5,22584,22591],[5,8689,22595],[5,97,22596],[5,22597,439],[5,22594,22598],[5,22575,22599],[5,97,17478],[5,22578,8283],[5,97,22602],[5,22584,8690],[5,97,22604],[5,22605,439],[5,22603,22606],[5,22601,22607],[5,22601,439],[5,8218,22609],[5,22578,22610],[5,97,22611],[5,8678,22609],[5,22584,22613],[5,97,22614],[5,22615,439],[5,22612,22616],[5,22601,22617],[5,1923,7073],[5,97,22619],[5,22620,7073],[5,1388,22621],[5,1375,22622],[5,5060,22623],[5,1923,5558],[5,97,22625],[5,22626,5558],[5,19982,22627],[5,19980,22628],[5,5060,22629],[5,5060,1374],[5,5790,22631],[5,97,22632],[5,5060,1387],[5,5790,22634],[5,97,22635],[5,5060,5558],[5,1923,22637],[5,97,22638],[5,22639,5558],[5,22636,22640],[5,22633,22641],[5,5060,22642],[5,5240,22623],[5,5240,22629],[5,5240,1374],[5,5790,22646],[5,97,22647],[5,5240,1387],[5,5790,22649],[5,97,22650],[5,5240,5558],[5,1923,22652],[5,97,22653],[5,22654,5558],[5,22651,22655],[5,22648,22656],[5,5240,22657],[5,5382,22623],[5,5382,22629],[5,5382,1374],[5,5790,22661],[5,97,22662],[5,5382,1387],[5,5790,22664],[5,97,22665],[5,5382,5558],[5,1923,22667],[5,97,22668],[5,22669,5558],[5,22666,22670],[5,22663,22671],[5,5382,22672],[5,1936,7073],[5,97,22674],[5,22675,7073],[5,1512,22676],[5,1509,22677],[5,4534,22678],[5,5790,1508],[5,97,22680],[5,5790,1511],[5,97,22682],[5,1936,5558],[5,97,22684],[5,22685,5558],[5,22683,22686],[5,22681,22687],[5,4534,22688],[5,4534,1508],[5,5790,22690],[5,97,22691],[5,4534,1511],[5,5790,22693],[5,97,22694],[5,4534,5558],[5,1936,22696],[5,97,22697],[5,22698,5558],[5,22695,22699],[5,22692,22700],[5,4534,22701],[5,97,17599],[5,1393,439],[5,8212,22704],[5,97,22705],[5,47,1391],[5,98,22707],[5,97,22708],[5,22709,439],[5,8689,22710],[5,97,22711],[5,22712,439],[5,22706,22713],[5,22703,22714],[5,22703,439],[5,1393,22716],[5,8212,22717],[5,97,22718],[5,22709,22716],[5,8689,22720],[5,97,22721],[5,22722,439],[5,22719,22723],[5,22703,22724],[5,97,17629],[5,1393,8283],[5,97,22727],[5,22709,8690],[5,97,22729],[5,22730,439],[5,22728,22731],[5,22726,22732],[5,22726,439],[5,8218,22734],[5,1393,22735],[5,97,22736],[5,8678,22734],[5,22709,22738],[5,97,22739],[5,22740,439],[5,22737,22741],[5,22726,22742],[5,97,17658],[5,3346,439],[5,8212,22745],[5,97,22746],[5,47,3344],[5,98,22748],[5,97,22749],[5,22750,439],[5,8689,22751],[5,97,22752],[5,22753,439],[5,22747,22754],[5,22744,22755],[5,22744,439],[5,3346,22757],[5,8212,22758],[5,97,22759],[5,22750,22757],[5,8689,22761],[5,97,22762],[5,22763,439],[5,22760,22764],[5,22744,22765],[5,97,17687],[5,3346,8283],[5,97,22768],[5,22750,8690],[5,97,22770],[5,22771,439],[5,22769,22772],[5,22767,22773],[5,22767,439],[5,8218,22775],[5,3346,22776],[5,97,22777],[5,8678,22775],[5,22750,22779],[5,97,22780],[5,22781,439],[5,22778,22782],[5,22767,22783],[5,823,439],[5,832,22785],[5,828,22786],[5,826,22787],[4,23,0,22788],[5,127,22789],[5,97,22790],[5,22791,439],[5,823,22792],[5,964,311],[5,98,22794],[5,97,22795],[5,314,1384],[5,98,22797],[5,97,22798],[5,31,1384],[5,101,22800],[5,22801,110],[5,98,22802],[5,97,22803],[5,34,1384],[5,22805,26],[5,10419,22806],[4,23,0,22807],[5,321,22808],[5,98,22809],[5,97,22810],[5,22811,7035],[5,22804,22812],[5,22799,22813],[5,22796,22814],[5,22796,22798],[5,97,22816],[5,22796,22803],[5,97,22818],[5,22796,22810],[5,97,22820],[5,22821,7035],[5,22819,22822],[5,22817,22823],[5,22796,22824],[5,431,439],[5,544,22826],[5,523,22827],[5,473,22828],[5,97,22829],[5,22830,439],[5,431,22831],[5,8877,439],[5,1092,22833],[5,97,22834],[5,8883,22833],[5,8880,22836],[4,82,0,22837],[5,127,22838],[5,97,22839],[5,22840,439],[5,22835,22841],[5,8877,22842],[5,7625,439],[5,7368,22844],[5,7486,22845],[5,97,22846],[5,22847,439],[5,7625,22848],[5,81,7304],[5,22850,7307],[4,79,0,22851],[5,6402,22852],[5,98,22853],[5,97,22854],[5,22855,439],[5,7303,22856],[5,97,22857],[5,22858,439],[5,7299,22859],[5,7299,439],[5,22855,22861],[5,7303,22862],[5,97,22863],[5,22864,439],[5,7299,22865],[5,97,18498],[5,1390,8409],[5,98,22868],[5,97,22869],[5,22870,439],[5,8212,22871],[5,97,22872],[5,47,22868],[5,98,22874],[5,97,22875],[5,22876,439],[5,8689,22877],[5,97,22878],[5,22879,439],[5,22873,22880],[5,22867,22881],[5,22867,439],[5,22870,22883],[5,8212,22884],[5,97,22885],[5,22876,22883],[5,8689,22887],[5,97,22888],[5,22889,439],[5,22886,22890],[5,22867,22891],[5,97,18530],[5,22870,8283],[5,97,22894],[5,22876,8690],[5,97,22896],[5,22897,439],[5,22895,22898],[5,22893,22899],[5,22893,439],[5,8218,22901],[5,22870,22902],[5,97,22903],[5,8678,22901],[5,22876,22905],[5,97,22906],[5,22907,439],[5,22904,22908],[5,22893,22909],[2,258,0,1],[5,8396,22911],[5,6382,22912],[5,98,22913],[5,97,22914],[5,1390,22912],[5,98,22916],[5,97,22917],[5,22918,439],[5,8212,22919],[5,97,22920],[5,47,22916],[5,98,22922],[5,97,22923],[5,22924,439],[5,8689,22925],[5,97,22926],[5,22927,439],[5,22921,22928],[5,22915,22929],[5,22915,439],[5,22918,22931],[5,8212,22932],[5,97,22933],[5,22924,22931],[5,8689,22935],[5,97,22936],[5,22937,439],[5,22934,22938],[5,22915,22939],[5,101,22912],[5,22941,852],[5,98,22942],[5,97,22943],[5,22918,8283],[5,97,22945],[5,22924,8690],[5,97,22947],[5,22948,439],[5,22946,22949],[5,22944,22950],[5,22944,439],[5,8218,22952],[5,22918,22953],[5,97,22954],[5,8678,22952],[5,22924,22956],[5,97,22957],[5,22958,439],[5,22955,22959],[5,22944,22960],[5,97,18628],[5,1390,18615],[5,98,22963],[5,97,22964],[5,22965,439],[5,8212,22966],[5,97,22967],[5,47,22963],[5,98,22969],[5,97,22970],[5,22971,439],[5,8689,22972],[5,97,22973],[5,22974,439],[5,22968,22975],[5,22962,22976],[5,22962,439],[5,22965,22978],[5,8212,22979],[5,97,22980],[5,22971,22978],[5,8689,22982],[5,97,22983],[5,22984,439],[5,22981,22985],[5,22962,22986],[5,97,18664],[5,22965,8283],[5,97,22989],[5,22971,8690],[5,97,22991],[5,22992,439],[5,22990,22993],[5,22988,22994],[5,22988,439],[5,8218,22996],[5,22965,22997],[5,97,22998],[5,8678,22996],[5,22971,23000],[5,97,23001],[5,23002,439],[5,22999,23003],[5,22988,23004],[5,97,18698],[5,1390,18685],[5,98,23007],[5,97,23008],[5,23009,439],[5,8212,23010],[5,97,23011],[5,47,23007],[5,98,23013],[5,97,23014],[5,23015,439],[5,8689,23016],[5,97,23017],[5,23018,439],[5,23012,23019],[5,23006,23020],[5,23006,439],[5,23009,23022],[5,8212,23023],[5,97,23024],[5,23015,23022],[5,8689,23026],[5,97,23027],[5,23028,439],[5,23025,23029],[5,23006,23030],[5,97,18732],[5,23009,8283],[5,97,23033],[5,23015,8690],[5,97,23035],[5,23036,439],[5,23034,23037],[5,23032,23038],[5,23032,439],[5,8218,23040],[5,23009,23041],[5,97,23042],[5,8678,23040],[5,23015,23044],[5,97,23045],[5,23046,439],[5,23043,23047],[5,23032,23048],[5,97,18766],[5,1390,18753],[5,98,23051],[5,97,23052],[5,23053,439],[5,8212,23054],[5,97,23055],[5,47,23051],[5,98,23057],[5,97,23058],[5,23059,439],[5,8689,23060],[5,97,23061],[5,23062,439],[5,23056,23063],[5,23050,23064],[5,23050,439],[5,23053,23066],[5,8212,23067],[5,97,23068],[5,23059,23066],[5,8689,23070],[5,97,23071],[5,23072,439],[5,23069,23073],[5,23050,23074],[5,97,18800],[5,23053,8283],[5,97,23077],[5,23059,8690],[5,97,23079],[5,23080,439],[5,23078,23081],[5,23076,23082],[5,23076,439],[5,8218,23084],[5,23053,23085],[5,97,23086],[5,8678,23084],[5,23059,23088],[5,97,23089],[5,23090,439],[5,23087,23091],[5,23076,23092],[5,97,18833],[5,1390,7296],[5,98,23095],[5,97,23096],[5,23097,439],[5,8212,23098],[5,97,23099],[5,47,23095],[5,98,23101],[5,97,23102],[5,23103,439],[5,8689,23104],[5,97,23105],[5,23106,439],[5,23100,23107],[5,23094,23108],[5,23094,439],[5,23097,23110],[5,8212,23111],[5,97,23112],[5,23103,23110],[5,8689,23114],[5,97,23115],[5,23116,439],[5,23113,23117],[5,23094,23118],[5,97,18866],[5,23097,8283],[5,97,23121],[5,23103,8690],[5,97,23123],[5,23124,439],[5,23122,23125],[5,23120,23126],[5,23120,439],[5,8218,23128],[5,23097,23129],[5,97,23130],[5,8678,23128],[5,23103,23132],[5,97,23133],[5,23134,439],[5,23131,23135],[5,23120,23136],[5,97,18899],[5,1390,7300],[5,98,23139],[5,97,23140],[5,23141,439],[5,8212,23142],[5,97,23143],[5,47,23139],[5,98,23145],[5,97,23146],[5,23147,439],[5,8689,23148],[5,97,23149],[5,23150,439],[5,23144,23151],[5,23138,23152],[5,23138,439],[5,23141,23154],[5,8212,23155],[5,97,23156],[5,23147,23154],[5,8689,23158],[5,97,23159],[5,23160,439],[5,23157,23161],[5,23138,23162],[5,97,18932],[5,23141,8283],[5,97,23165],[5,23147,8690],[5,97,23167],[5,23168,439],[5,23166,23169],[5,23164,23170],[5,23164,439],[5,8218,23172],[5,23141,23173],[5,97,23174],[5,8678,23172],[5,23147,23176],[5,97,23177],[5,23178,439],[5,23175,23179],[5,23164,23180],[5,97,18966],[5,1390,18953],[5,98,23183],[5,97,23184],[5,23185,439],[5,8212,23186],[5,97,23187],[5,47,23183],[5,98,23189],[5,97,23190],[5,23191,439],[5,8689,23192],[5,97,23193],[5,23194,439],[5,23188,23195],[5,23182,23196],[5,23182,439],[5,23185,23198],[5,8212,23199],[5,97,23200],[5,23191,23198],[5,8689,23202],[5,97,23203],[5,23204,439],[5,23201,23205],[5,23182,23206],[5,97,19000],[5,23185,8283],[5,97,23209],[5,23191,8690],[5,97,23211],[5,23212,439],[5,23210,23213],[5,23208,23214],[5,23208,439],[5,8218,23216],[5,23185,23217],[5,97,23218],[5,8678,23216],[5,23191,23220],[5,97,23221],[5,23222,439],[5,23219,23223],[5,23208,23224],[5,97,19033],[5,1390,7566],[5,98,23227],[5,97,23228],[5,23229,439],[5,8212,23230],[5,97,23231],[5,47,23227],[5,98,23233],[5,97,23234],[5,23235,439],[5,8689,23236],[5,97,23237],[5,23238,439],[5,23232,23239],[5,23226,23240],[5,23226,439],[5,23229,23242],[5,8212,23243],[5,97,23244],[5,23235,23242],[5,8689,23246],[5,97,23247],[5,23248,439],[5,23245,23249],[5,23226,23250],[5,97,19066],[5,23229,8283],[5,97,23253],[5,23235,8690],[5,97,23255],[5,23256,439],[5,23254,23257],[5,23252,23258],[5,23252,439],[5,8218,23260],[5,23229,23261],[5,97,23262],[5,8678,23260],[5,23235,23264],[5,97,23265],[5,23266,439],[5,23263,23267],[5,23252,23268],[5,1390,11],[5,98,23270],[5,97,23271],[5,23272,439],[5,8212,23273],[5,97,23274],[5,47,23270],[5,98,23276],[5,97,23277],[5,23278,439],[5,8689,23279],[5,97,23280],[5,23281,439],[5,23275,23282],[5,8105,23283],[5,8105,439],[5,23272,23285],[5,8212,23286],[5,97,23287],[5,23278,23285],[5,8689,23289],[5,97,23290],[5,23291,439],[5,23288,23292],[5,8105,23293],[5,787,852],[5,98,23295],[5,97,23296],[5,23272,8283],[5,97,23298],[5,23278,8690],[5,97,23300],[5,23301,439],[5,23299,23302],[5,23297,23303],[5,23297,439],[5,8218,23305],[5,23272,23306],[5,97,23307],[5,8678,23305],[5,23278,23309],[5,97,23310],[5,23311,439],[5,23308,23312],[5,23297,23313],[5,8689,7626],[5,97,23315],[5,8218,7626],[5,97,23317],[5,23318,439],[5,23316,23319],[5,7368,23320],[5,7368,8211],[5,97,23322],[5,23323,8217],[5,7368,23324],[5,7677,1285],[5,7680,23326],[5,97,23327],[5,7685,23326],[5,97,23329],[5,23330,1285],[5,23328,23331],[5,7677,23332],[5,5559,7073],[5,97,23334],[5,23335,7073],[5,6826,23336],[5,1589,26],[5,23338,82],[4,63,0,23339],[4,23,0,23340],[5,47,360],[4,63,0,23342],[4,23,0,23343],[5,3113,4635],[4,97,0,23345],[4,81,0,23346],[4,63,0,2139],[4,23,0,23348],[5,7923,26],[5,23350,82],[4,41,0,23351],[4,40,0,23352],[5,9,5580],[5,9,2245],[5,23355,11],[5,23354,23356],[5,128,82],[4,41,0,23358],[4,40,0,23359],[5,47,7379],[4,40,0,23361],[4,81,0,23362],[5,332,26],[5,23364,346],[4,36,0,23365],[5,28,82],[5,23367,26],[4,97,0,23368],[4,81,0,23369],[5,249,82],[5,23371,26],[4,97,0,23372],[4,81,0,23373]],"thms":[15,57,65,96,109,124,147,166,169,173,175,180,187,195,210,219,222,227,230,234,236,242,243,261,269,273,284,297,305,331,341,350,366,381,392,399,404,426,445,448,451,454,459,463,467,471,488,509,542,551,556,566,577,609,626,642,644,661,670,677,702,729,743,745,752,754,755,769,775,786,791,802,803,808,810,820,840,847,851,867,876,882,887,890,893,896,920,922,942,953,962,976,984,990,1012,1031,1033,1059,1075,1076,1088,1108,1119,1122,1126,1130,1134,1140,1144,1148,1152,1155,1157,1161,1171,1180,1184,1186,1196,1210,1215,1221,1225,1230,1232,1237,1242,1247,1260,1261,1268,1272,1279,1283,1293,1300,1302,1304,1308,1347,1372,1383,1405,1411,1418,1429,1440,1447,1454,1462,1469,1476,1482,1505,1525,1538,1546,1555,1565,1573,1584,1603,1616,1622,1639,1650,1656,1661,1667,1677,1683,1690,1706,1712,1720,1727,1735,1745,1754,1767,1781,1792,1801,1806,1811,1817,1825,1832,1839,1844,1850,1854,1862,1869,1876,1882,1889,1896,1905,1913,1921,1933,1944,1953,1966,1977,1986,1998,2009,2019,2027,2036,2045,2054,2061,2070,2080,2083,2087,2099,2105,2118,2122,2128,2162,2185,2190,2196,2202,2211,2216,2226,2233,2239,2243,2250,2256,2259,2264,2268,2271,2274,2287,2290,2296,2306,2313,2321,2331,2334,2343,2344,2354,2362,2371,2376,2381,2388,2390,2396,2433,2439,2447,2452,2455,2458,2459,2466,2474,2481,2486,2491,2494,2496,2499,2504,2508,2514,2518,2523,2527,2533,2536,2539,2542,2545,2548,2553,2558,2564,2567,2570,2580,2586,2589,2592,2600,2606,2612,2625,2632,2658,2661,2668,2672,2679,2693,2702,2710,2715,2722,2728,2736,2740,2744,2748,2750,2752,2759,2762,2767,2778,2779,2783,2788,2790,2791,2798,2809,2816,2821,2829,2841,2847,2853,2868,2880,2891,2896,2902,2926,2932,2944,2950,2957,2964,2965,2969,2971,2972,2978,2984,2991,3007,3031,3049,3055,3060,3068,3083,3092,3096,3101,3110,3125,3134,3141,3149,3155,3161,3169,3177,3183,3191,3196,3203,3212,3219,3227,3233,3239,3246,3253,3260,3266,3271,3277,3287,3291,3297,3306,3316,3324,3330,3343,3356,3365,3370,3379,3388,3394,3399,3408,3416,3422,3428,3437,3445,3451,3457,3464,3479,3489,3496,3504,3512,3519,3527,3535,3541,3549,3557,3567,3577,3587,3595,3600,3605,3613,3620,3627,3632,3637,3643,3649,3657,3665,3672,3683,3694,3721,3732,3741,3769,3783,3793,3801,3806,3811,3817,3823,3851,3860,3868,3878,3886,3892,3898,3904,3909,3917,3924,3932,3940,3968,3980,3991,4001,4012,4023,4029,4044,4052,4056,4063,4067,4071,4084,4090,4097,4108,4114,4115,4123,4129,4132,4143,4151,4157,4161,4165,4171,4175,4183,4191,4201,4208,4216,4224,4230,4238,4244,4253,4262,4271,4280,4285,4299,4303,4323,4330,4338,4349,4356,4364,4378,4387,4397,4404,4514,4518,4522,4527,4537,4542,4544,4552,4560,4566,4570,4590,4657,4681,4715,4739,4742,4747,4752,4768,4773,4778,4782,4786,4809,4820,4832,4838,4858,4862,4866,4875,4919,4925,4929,4944,4951,4954,4955,4979,4984,4988,4992,4999,5021,5032,5041,5045,5056,5061,5066,5070,5074,5078,5082,5086,5088,5093,5096,5100,5109,5116,5139,5162,5173,5180,5187,5202,5212,5219,5223,5226,5237,5241,5246,5250,5253,5257,5261,5265,5270,5272,5276,5283,5290,5297,5304,5311,5315,5319,5323,5327,5331,5336,5339,5344,5349,5361,5364,5368,5372,5375,5378,5383,5388,5392,5399,5404,5409,5414,5419,5426,5431,5436,5441,5447,5452,5472,5480,5487,5492,5495,5500,5503,5512,5517,5520,5533,5537,5539,5541,5546,5557,5564,5575,5587,5596,5603,5607,5619,5625,5627,5632,5636,5641,5643,5650,5658,5672,5680,5684,5694,5700,5705,5712,5718,5733,5738,5742,5746,5751,5764,5772,5778,5781,5785,5789,5794,5795,5801,5805,5807,5811,5815,5819,5825,5828,5838,5843,5847,5852,5857,5861,5866,5881,5890,5897,5900,5902,5905,5908,5910,5912,5914,5916,5918,5921,5931,5932,5940,5955,5956,5957,5973,5986,5996,6002,6005,6016,6022,6024,6038,6042,6048,6070,6077,6083,6086,6101,6105,6111,6128,6142,6160,6172,6176,6191,6207,6208,6209,6212,6214,6221,6228,6246,6252,6256,6261,6265,6270,6274,6278,6283,6286,6291,6295,6300,6301,6304,6305,6306,6313,6320,6331,6335,6339,6344,6348,6353,6357,6361,6366,6373,6379,6381,6387,6391,6392,6394,6398,6401,6408,6418,6421,6422,6424,6426,6428,6430,6434,6437,6439,6446,6453,6454,6456,6466,6469,6471,6476,6478,6486,6489,6491,6496,6500,6504,6509,6513,6521,6528,6533,6535,6536,6538,6545,6548,6552,6556,6561,6566,6570,6574,6578,6588,6604,6608,6611,6615,6617,6626,6638,6652,6664,6679,6691,6697,6704,6712,6719,6726,6733,6734,6738,6744,6746,6747,6749,6753,6754,6755,6757,6761,6764,6768,6773,6779,6785,6790,6795,6800,6804,6807,6811,6822,6823,6827,6828,6830,6836,6845,6851,6860,6866,6874,6881,6892,6902,6907,6912,6914,6918,6926,6933,6940,6947,6949,6951,6963,6966,6982,6985,7003,7007,7008,7024,7034,7041,7042,7057,7061,7062,7070,7076,7082,5598,7084,7088,7090,7094,7110,7113,7119,7120,7124,7133,7138,7142,7149,7165,7172,7176,7181,7186,7195,7202,7209,7218,7219,7220,7230,7234,7236,7237,7238,7239,7241,7242,7245,7249,7253,7269,7272,7276,7278,7284,7285,7291,7295,7317,7323,7327,7333,7347,7357,7365,7374,7384,7392,7407,7415,7420,7426,7427,7430,7433,7444,7451,7459,7472,7480,7488,7496,7500,7506,7514,7521,7525,7528,7533,7540,7544,7549,7555,7561,7569,7582,7597,7608,7614,7621,7630,7632,7637,7641,7649,7656,7661,7675,7690,7695,7704,7706,7712,7721,7729,7736,7746,7755,7763,7777,7778,7783,7784,7791,7800,7807,7814,7816,7818,7824,7828,7837,7845,7850,7856,7865,7872,7881,7888,7897,7906,7910,7914,7918,7922,7929,7931,7942,7953,7960,7967,7972,7977,7983,7991,8000,8010,8018,8027,8037,8044,8056,8071,8077,8088,8092,8095,8100,8103,8106,8108,8114,8123,8126,8130,8138,8147,8151,8158,8166,8170,8174,8181,8188,8197,8206,8224,8230,8234,8236,8240,8254,8260,8264,8269,8273,8277,8281,8282,8287,8291,8296,8303,8305,8313,8316,8318,8325,8332,8337,8343,8348,8354,8358,8363,8370,8374,8382,8386,8391,8395,8403,8407,8414,8418,8424,8428,8433,8437,8445,8454,8462,8469,8477,8484,8489,8496,8504,8513,8521,8527,8532,8539,8546,8552,8558,8565,8569,8578,8585,8593,8596,8600,8604,8608,8614,8615,8622,8629,8640,8645,8649,8653,8655,8662,8671,8673,8675,8682,8684,8686,8687,8688,8695,8705,8708,8717,8731,8758,8764,8766,8772,8775,8780,8787,8791,8792,8798,8802,8804,8814,8823,8829,8836,8840,8843,8849,8856,8861,8864,8868,8870,8875,8891,8899,8905,8912,8914,8921,8925,8926,8932,8934,8936,8944,8949,8954,8955,8960,8965,8994,8996,9000,9006,9010,9012,9020,9027,9034,9037,9042,9044,9046,9048,9054,9058,9063,9067,9071,9076,9087,9091,9096,9099,9100,9111,9117,9121,9126,9132,9139,9144,9146,9148,9153,9158,9170,9172,9174,9183,9191,9206,9252,9257,9269,9277,9287,9305,9315,9321,9358,9369,9379,9399,9406,9411,9425,9430,9434,9439,9445,9450,9458,9462,9465,9466,9467,9473,9491,9502,9514,9526,9533,9536,9537,9538,9543,9547,9555,9558,9576,9596,9598,9607,9609,9619,9629,9644,9647,9667,9668,9677,9678,9683,9684,9691,9698,9706,9709,9710,9713,9718,9722,9729,9736,9740,9747,9753,9759,9799,9823,9839,9851,9865,9888,9908,9917,9935,9951,9963,9969,9974,9978,9987,9992,10002,10006,10010,10016,10021,10024,10028,10032,10039,10043,10047,10054,10060,10063,10073,10078,10081,10083,10085,10091,10094,10096,10102,10118,10130,10144,10149,10154,10163,10177,10186,10206,10239,10243,10245,10247,10273,10285,10300,10305,10314,10326,10327,10342,10343,10350,10359,10361,10365,10371,10374,10381,10383,10388,10408,10436,10442,10446,10451,10452,10456,10469,10473,10479,10483,10486,10492,10498,10502,10506,10513,10518,10524,10526,10529,10534,10538,10541,10543,10545,10567,10574,10584,10589,10593,10599,10607,10623,10627,10631,10641,10645,10649,10672,10685,10694,10716,10720,10727,10728,10732,10753,10757,10766,10828,10850,10858,10865,10871,10879,10896,10906,10908,10915,10917,10919,10928,10933,10941,10946,10958,10965,10980,10982,10984,10989,11001,11007,11014,11021,11025,11026,11029,11037,11055,11062,11063,11064,11074,11099,11117,11134,11150,11166,11184,11201,11218,11232,11249,11276,11306,11337,11369,11402,11414,11434,11446,11460,11473,11498,11556,11571,11586,11592,11602,11615,11623,11637,11652,11664,11677,11691,11706,11718,11719,11725,11726,11727,11732,11740,11762,11772,11773,11782,11788,11798,11799,11808,11809,11810,11811,11812,11813,11815,11817,11822,11828,11833,11854,11873,11890,11904,11905,11915,11916,11932,11940,11941,11947,11955,11956,11972,11973,11980,11988,11989,11990,11994,11998,12015,12016,12017,12018,12022,12028,12034,12044,12045,12055,12069,12080,12081,12082,12095,12096,12104,12105,12106,12119,12145,12170,12197,12226,12257,12290,12325,12333,12334,12350,12359,12369,12378,12379,12385,12386,12392,12393,12397,12398,12402,12403,12418,12427,12434,12435,12443,12463,12464,12472,12473,12474,12484,12485,12495,12496,12504,12505,12506,12514,12521,12522,12523,12542,12547,12557,12558,12576,12587,12588,12589,12594,12598,12605,12614,12618,12619,12623,12624,12625,12635,12636,12637,12644,12666,12681,12685,12693,12701,12705,12720,12742,12758,12767,12779,12784,12791,12800,12806,12817,12821,12830,12850,12861,12863,12865,12868,12873,12876,12882,12894,12900,12906,12907,12911,12912,12916,12922,12928,12933,12946,12949,12961,12967,12972,12974,12981,12982,12983,12990,12992,13008,13028,13032,13049,13051,13053,13054,13056,13058,13063,13068,13073,13079,13083,13088,13092,13097,13102,13109,13124,13129,13134,13140,13145,13152,13157,13162,13167,13172,13177,13184,13189,13194,13202,13207,13212,13222,13224,13226,13231,13236,13241,13247,13251,13256,13260,13265,13270,13277,13292,13297,13302,13308,13313,13320,13325,13330,13335,13340,13345,13352,13357,13362,13370,13375,13380,13395,13400,13411,13416,13418,13420,13425,13431,13440,13452,13461,13468,13474,13480,13487,13492,13497,13503,13507,13518,13532,13543,13556,13566,13574,13583,13590,13594,13598,13601,13605,13611,13617,13623,13630,13635,13641,13647,13653,13658,13662,13667,13671,13674,13677,13679,13681,13683,13685,13687,13697,13701,13707,13713,13721,13727,13733,13740,13742,13745,13748,13750,13758,13765,13776,13782,13791,13800,13807,13813,13820,13822,13831,13835,13840,13842,13846,13854,13856,13861,13870,13873,13882,13893,13895,13899,13901,13905,13906,13908,13912,13917,13924,13932,13939,13945,13953,13961,13965,13970,13974,13982,13989,13995,14001,14005,14014,14022,14029,14036,14053,14063,14070,14077,14083,14089,14101,14122,14133,14138,14153,14167,14174,14177,14210,14220,14231,14236,14241,14246,14253,14258,14264,14279,14287,14298,14303,14321,14331,14346,14351,14357,14363,14366,14371,14376,14381,14382,14391,14399,14407,14415,14419,14425,14436,14446,14458,14465,14473,14477,14481,14486,14491,14496,14502,14509,14517,14525,14530,14535,14543,14549,14556,14562,14574,14583,14594,14603,14609,14613,14617,14622,14632,14640,14648,14653,14658,14663,14674,14682,14685,14690,14695,14698,14701,14704,14707,14710,14713,14721,14724,14727,14730,14733,14736,14739,14746,14754,14758,14766,14773,14782,14789,14796,14805,14814,14823,14833,14843,14850,14854,14859,14863,14870,14877,14896,14900,14906,14911,14919,14928,14937,14944,14952,14961,14969,14976,14984,14992,14999,15002,15014,15029,15036,15046,15056,15059,15063,15076,15079,15089,15093,15105,15113,15116,15119,15122,15125,15128,15131,15134,15137,15140,15143,15146,15149,15153,15162,15167,15169,15174,15176,15180,15183,15187,15190,15197,15201,15208,15218,15222,15229,15238,15245,15252,15265,15269,15278,15284,15289,15296,15301,15304,15309,15312,15316,15322,15327,15332,15347,15351,15358,15363,15367,15374,15379,15410,15419,15429,15433,15439,15444,15448,15453,15460,15466,15472,15476,15482,15490,15495,15506,15515,15526,15532,15538,15545,15551,15557,15563,15587,15604,15621,15640,15646,15652,15658,15664,15674,15681,15690,15694,15698,15702,15707,15712,15716,15725,15729,15736,15740,15744,15748,15765,15770,15775,15780,15785,15791,15797,15802,15808,15814,15819,15824,15830,15836,15841,15849,15865,15869,15873,15877,15881,15886,15901,15905,15917,15921,15934,15938,15941,15944,15947,15955,15966,15973,15979,15986,16008,16016,16019,16025,16029,16034,16039,16044,16049,16054,16068,16089,16090,16098,16099,16105,16106,16117,16133,16136,16140,16150,16157,16162,16172,16175,16179,16182,16188,16195,16198,16201,16205,16213,16222,16225,16238,16241,16251,16258,16265,16273,16279,16287,16295,16303,16308,16321,16328,16335,16343,16349,16358,16367,16371,16379,16385,16389,16395,16402,16408,16413,16417,16422,16427,16431,16438,16446,16452,16458,16465,16473,16476,16478,16480,16482,16485,16493,16506,16512,16517,16525,16533,16542,16562,16569,16577,16584,16589,16595,16600,16604,16614,16622,16627,16632,16637,16638,16652,16658,16665,16671,16683,16692,16701,16707,16716,16727,16737,16750,16756,16761,16770,16774,16778,16782,16797,16803,16817,16821,16825,16829,16839,16845,16848,16871,16891,16901,16921,16939,16944,16949,16954,16959,16964,16969,16984,17007,17020,17038,17056,17080,17093,17111,17146,17161,17181,17194,17212,17253,17268,17288,17301,17319,17324,17328,17332,17336,17341,17352,17374,17384,17398,17409,17419,17423,17428,17433,17447,17468,17480,17498,17506,17518,17521,17525,17529,17534,17541,17544,17548,17552,17564,17568,17572,17576,17580,17581,17589,17601,17618,17631,17648,17660,17677,17689,17706,17711,17733,17748,17768,17781,17799,17804,17819,17841,17854,17872,17879,17884,17889,17904,17926,17939,17957,17967,17984,17997,18017,18043,18067,18101,18114,18118,18123,18128,18146,18169,18202,18209,18215,18225,18240,18245,18251,18255,18262,18267,18282,18302,18314,18331,18343,18363,18375,18392,18397,18409,18418,18430,18439,18447,18452,18465,18473,18485,18500,18520,18532,18549,18564,18584,18596,18613,18630,18653,18666,18684,18700,18721,18734,18752,18768,18789,18802,18820,18835,18855,18868,18886,18901,18921,18934,18952,18968,18989,19002,19020,19035,19055,19068,19086,19091,19101,19111,19118,19131,19140,19153,19162,19175,19184,19197,19205,19217,19226,19239,19246,19258,19267,19280,19285,19290,19295,19300,19316,19321,19325,19338,19344,19352,19365,19374,19387,19395,19407,19416,19429,19440,19455,19462,19473,19482,19497,19504,19515,19524,19537,19544,19555,19564,19577,19584,19595,19601,19611,19620,19633,19640,19651,19660,19673,19676,19687,19690,19694,19696,19703,19705,19709,19713,19723,19731,19742,19747,19752,19757,19762,19767,19772,19777,19793,19798,19803,19807,19811,19815,19825,19847,19866,19881,19895,19903,19908,19916,19926,19927,19931,19954,19968,19978,19988,19989,19998,19999,20003,20004,20010,20014,20018,20030,20043,20051,20058,20081,20093,20104,20120,20130,20139,20150,20158,20165,20185,20194,20203,20224,20239,20256,20274,20283,20292,20299,20305,20310,20323,20329,20334,20340,20346,20351,20370,20379,20388,20408,20420,20433,20468,20486,20507,20533,20551,20572,20583,20592,20601,20605,20614,20623,20631,20637,20642,20644,20647,20652,20657,20663,20668,20685,20696,20707,20720,20729,20738,20747,20759,20772,20783,20795,20808,20814,20826,20839,20859,20877,20898,20903,20912,20921,20926,20935,20944,20950,20956,20961,20966,20972,20977,20982,20988,20993,21008,21023,21040,21055,21075,21088,21101,21113,21131,21144,21157,21170,21182,21195,21222,21240,21261,21267,21285,21306,21320,21329,21341,21342,21351,21363,21372,21390,21411,21417,21435,21456,21466,21478,21491,21496,21508,21521,21530,21539,21548,21553,21559,21564,21569,21575,21580,21590,21602,21615,21619,21631,21644,21648,21657,21670,21674,21683,21696,21701,21713,21726,21730,21742,21755,21760,21766,21771,21776,21782,21787,21792,21798,21803,21804,21815,21821,21830,21836,21839,21844,21845,21852,21855,21860,21866,21869,21874,21880,21889,21898,21904,21913,21922,21926,21932,21937,21943,21951,21957,21962,21975,21984,21993,22013,22024,22035,22049,22058,22067,22077,22086,22095,22104,22112,22121,22146,22158,22171,22178,22184,22189,22195,22201,22206,22224,22235,22246,22259,22270,22281,22291,22294,22299,22305,22318,22327,22334,22341,22354,22368,22375,22386,22393,22404,22408,22410,22421,22431,22437,22444,22453,22469,22476,22489,22502,22515,22528,22529,22542,22543,22556,22560,22570,22574,22590,22600,22608,22618,22624,22630,22643,22644,22645,22658,22659,22660,22673,22679,22689,22702,22715,22725,22733,22743,22756,22766,22774,22784,22793,22815,22825,22832,22843,22849,22860,22866,22882,22892,22900,22910,22930,22940,22951,22961,22977,22987,22995,23005,23021,23031,23039,23049,23065,23075,23083,23093,23109,23119,23127,23137,23153,23163,23171,23181,23197,23207,23215,23225,23241,23251,23259,23269,23284,23294,23304,23314,23321,23325,23333,23337],"consts":[["PredicateLogic.cases_implies",2],["IntegerArithmetic.pr_multint",1],["PredicateLogic.simp_implies",5],["PredicateLogic.cases_forall",8],["IntegerArithmetic.pr_addint",1],["PredicateLogic.cases_false",0],["PredicateLogic.cases_equal",2],["PredicateLogic.cases_true",0],["PredicateLogic.cases_conj",2],["Integers.primrec_nat_upto",10],["Integers.primrec_int_upto",14],["IntegerArithmetic.multint",2],["IntegerArithmetic.greater",2,23341],["CaseExpressions.CaseOther",11],["PredicateLogic.not_equal",2,23344],["PredicateLogic.arbitrary",0],["IntegerArithmetic.subint",2,23347],["IntegerArithmetic.addint",2],["PredicateLogic.Trueprop",15],["IntegerArithmetic.intvl",2],["CaseExpressions.CaseArm",2],["PredicateLogic.default",0],["PredicateLogic.boolify",1],["Integers.ExtendedPeano",17],["IntegerArithmetic.less",2],["PredicateLogic.isBool",1],["PredicateLogic.Choice",18],["IntegerArithmetic.leq",2],["IntegerArithmetic.geq",2,23349],["Functions.Surjections",2],["Functions.InjectiveOn",2],["FixedPoints.Monotonic",20],["Tuples.antisymmetric",1],["Pure.sort_constraint",22],["PredicateLogic.FALSE",0],["Integers.nat_primrec",25],["Integers.int_primrec",29],["Functions.Surjective",2],["Functions.Injections",2],["Functions.Bijections",2],["CaseExpressions.Case",2],["PredicateLogic.disj",2],["PredicateLogic.conj",2],["PredicateLogic.cond",11],["PredicateLogic.TRUE",0],["IntegerDivision.mod",2],["IntegerDivision.dvd",2],["IntegerDivision.div",2],["Functions.Injective",1,348],["Zenon.zenon_seqify",1],["Zenon.zenon_appseq",2],["Tuples.irreflexive",2],["Tuples.equivalence",2],["Tuples.EnumFuncSet",2],["SetTheory.subsetOf",20],["SetTheory.setminus",2],["SetTheory.setOfAll",20],["SetTheory.infinity",0],["SetTheory.emptyset",0],["Pure.dummy_pattern",6],["PredicateLogic.not",1],["PredicateLogic.imp",2],["PredicateLogic.iff",2],["PredicateLogic.Let",33],["PredicateLogic.All",8],["Tuples.transitive",1],["Tuples.setOfPairs",24],["Tuples.rel_domain",1],["SetTheory.psupset",2,23353],["SetTheory.psubset",2],["SetTheory.bChoose",20],["SetTheory.BOOLEAN",0,23357],["PredicateLogic.eq",2],["PredicateLogic.Ex",8],["Integers.thirteen",0],["Integers.fourteen",0],["Functions.Inverse",1],["Functions.FuncSet",2],["Tuples.symmetric",1],["Tuples.rel_range",1],["Tuples.rel_image",2],["Tuples.reflexive",2],["SetTheory.supset",2,23360],["SetTheory.subset",2],["SetTheory.addElt",2],["SetTheory.SUBSET",1],["Pure.conjunction",5],["Integers.intCplt",0],["Integers.fifteen",0],["Functions.oneArg",2],["Functions.isAFcn",1],["Functions.fapply",2],["Functions.extend",2],["Functions.except",11],["Functions.DOMAIN",1],["Tuples.rel_comp",2],["Tuples.emptySeq",0],["Tuples.converse",1],["SetTheory.upair",2],["SetTheory.union",2],["SetTheory.notin",2,23363],["SetTheory.inter",2],["SetTheory.UNION",1],["SetTheory.INTER",1],["Integers.uminus",1],["Integers.twelve",0],["Integers.eleven",0],["Functions.Range",1,23366],["Functions.Image",2],["FixedPoints.lfp",20],["FixedPoints.gfp",20],["Zenon.zenon_ss",1],["Zenon.zenon_sa",2],["Tuples.Product",1],["Strings.String",0],["Strings.Nibble",0],["SetTheory.bAll",20],["Integers.three",0],["Integers.seven",0],["Integers.eight",0],["Tuples.isASeq",1],["Tuples.Append",2],["SetTheory.bEx",20],["Pure.MinProof",34],["Integers.zero",0],["Integers.upto",1],["Integers.succ",0],["Integers.pred",0],["Integers.nine",0],["Integers.four",0],["Integers.five",0],["Integers.Succ",0],["Functions.Fcn",20],["Strings.char",2],["Strings.Char",0],["SetTheory.in",2],["Integers.two",0],["Integers.ten",0],["Integers.six",0],["Integers.one",0,1490],["Integers.Nat",0],["Integers.Int",0],["Tuples.prod",2],["Pure.PClass",35],["Pure.Oracle",36],["Tuples.Seq",1],["Tuples.Len",1],["Zenon.cup",2,23370],["Zenon.cap",2,23374],["Tuples.Id",1],["Pure.type",21],["Pure.term",37],["Pure.prop",4],["Pure.Appt",39],["Pure.AppP",41],["Pure.Abst",42],["Pure.AbsP",44],["Pure.imp",5],["Pure.all",45],["Pure.Hyp",36],["Pure.eq",46]],"names":[["pr_multint","IntegerArithmetic.pr_multint"],["simp_implies","PredicateLogic.simp_implies"],["pr_addint","IntegerArithmetic.pr_addint"],["primrec_nat_upto","Integers.primrec_nat_upto"],["primrec_int_upto","Integers.primrec_int_upto"],["multint","IntegerArithmetic.multint"],["greater","IntegerArithmetic.greater"],["CaseOther","CaseExpressions.CaseOther"],["not_equal","PredicateLogic.not_equal"],["arbitrary","PredicateLogic.arbitrary"],["subint","IntegerArithmetic.subint"],["addint","IntegerArithmetic.addint"],["Trueprop","PredicateLogic.Trueprop"],["intvl","IntegerArithmetic.intvl"],["CaseArm","CaseExpressions.CaseArm"],["default","PredicateLogic.default"],["boolify","PredicateLogic.boolify"],["ExtendedPeano","Integers.ExtendedPeano"],["less","IntegerArithmetic.less"],["isBool","PredicateLogic.isBool"],["Choice","PredicateLogic.Choice"],["leq","IntegerArithmetic.leq"],["geq","IntegerArithmetic.geq"],["Surjections","Functions.Surjections"],["InjectiveOn","Functions.InjectiveOn"],["Monotonic","FixedPoints.Monotonic"],["antisymmetric","Tuples.antisymmetric"],["FALSE","PredicateLogic.FALSE"],["nat_primrec","Integers.nat_primrec"],["int_primrec","Integers.int_primrec"],["Surjective","Functions.Surjective"],["Injections","Functions.Injections"],["Bijections","Functions.Bijections"],["Case","CaseExpressions.Case"],["disj","PredicateLogic.disj"],["conj","PredicateLogic.conj"],["cond","PredicateLogic.cond"],["TRUE","PredicateLogic.TRUE"],["mod","IntegerDivision.mod"],["dvd","IntegerDivision.dvd"],["div","IntegerDivision.div"],["Injective","Functions.Injective"],["zenon_seqify","Zenon.zenon_seqify"],["zenon_appseq","Zenon.zenon_appseq"],["irreflexive","Tuples.irreflexive"],["equivalence","Tuples.equivalence"],["EnumFuncSet","Tuples.EnumFuncSet"],["subsetOf","SetTheory.subsetOf"],["setminus","SetTheory.setminus"],["setOfAll","SetTheory.setOfAll"],["infinity","SetTheory.infinity"],["emptyset","SetTheory.emptyset"],["not","PredicateLogic.not"],["imp","PredicateLogic.imp"],["iff","PredicateLogic.iff"],["Let","PredicateLogic.Let"],["All","PredicateLogic.All"],["transitive","Tuples.transitive"],["setOfPairs","Tuples.setOfPairs"],["rel_domain","Tuples.rel_domain"],["psupset","SetTheory.psupset"],["psubset","SetTheory.psubset"],["bChoose","SetTheory.bChoose"],["BOOLEAN","SetTheory.BOOLEAN"],["eq","PredicateLogic.eq"],["Ex","PredicateLogic.Ex"],["thirteen","Integers.thirteen"],["fourteen","Integers.fourteen"],["Inverse","Functions.Inverse"],["FuncSet","Functions.FuncSet"],["symmetric","Tuples.symmetric"],["rel_range","Tuples.rel_range"],["rel_image","Tuples.rel_image"],["reflexive","Tuples.reflexive"],["supset","SetTheory.supset"],["subset","SetTheory.subset"],["addElt","SetTheory.addElt"],["SUBSET","SetTheory.SUBSET"],["intCplt","Integers.intCplt"],["fifteen","Integers.fifteen"],["oneArg","Functions.oneArg"],["isAFcn","Functions.isAFcn"],["fapply","Functions.fapply"],["extend","Functions.extend"],["except","Functions.except"],["DOMAIN","Functions.DOMAIN"],["rel_comp","Tuples.rel_comp"],["emptySeq","Tuples.emptySeq"],["converse","Tuples.converse"],["upair","SetTheory.upair"],["union","SetTheory.union"],["notin","SetTheory.notin"],["inter","SetTheory.inter"],["UNION","SetTheory.UNION"],["INTER","SetTheory.INTER"],["uminus","Integers.uminus"],["twelve","Integers.twelve"],["eleven","Integers.eleven"],["Range","Functions.Range"],["Image","Functions.Image"],["lfp","FixedPoints.lfp"],["gfp","FixedPoints.gfp"],["zenon_ss","Zenon.zenon_ss"],["zenon_sa","Zenon.zenon_sa"],["Product","Tuples.Product"],["String","Strings.String"],["Nibble","Strings.Nibble"],["bAll","SetTheory.bAll"],["three","Integers.three"],["seven","Integers.seven"],["eight","Integers.eight"],["isASeq","Tuples.isASeq"],["Append","Tuples.Append"],["bEx","SetTheory.bEx"],["zero","Integers.zero"],["upto","Integers.upto"],["succ","Integers.succ"],["pred","Integers.pred"],["nine","Integers.nine"],["four","Integers.four"],["five","Integers.five"],["Succ","Integers.Succ"],["Fcn","Functions.Fcn"],["char","Strings.char"],["Char","Strings.Char"],["in","SetTheory.in"],["two","Integers.two"],["ten","Integers.ten"],["six","Integers.six"],["one","Integers.one"],["Nat","Integers.Nat"],["Int","Integers.Int"],["prod","Tuples.prod"],["Seq","Tuples.Seq"],["Len","Tuples.Len"],["cup","Zenon.cup"],["cap","Zenon.cap"],["Id","Tuples.Id"]],"facts":[["CaseExpressions.CaseArm_def",[0]],["CaseExpressions.CaseOther_def",[1]],["CaseExpressions.Case_def",[2]],["CaseExpressions.Case_simps",[0,2,1]],["FixedPoints.Monotonic_def",[3]],["FixedPoints.gfpFixedPoint",[4]],["FixedPoints.gfpGreatestFixedPoint",[5]],["FixedPoints.gfpLUB",[6]],["FixedPoints.gfpMono",[7]],["FixedPoints.gfpPostFP",[8]],["FixedPoints.gfpPreFP",[9]],["FixedPoints.gfpSubsetDomain",[10]],["FixedPoints.gfpUB",[11]],["FixedPoints.gfp_def",[12]],["FixedPoints.lfpFixedPoint",[13]],["FixedPoints.lfpGLB",[14]],["FixedPoints.lfpLB",[15]],["FixedPoints.lfpLeastFixedPoint",[16]],["FixedPoints.lfpMono",[17]],["FixedPoints.lfpPostFP",[18]],["FixedPoints.lfpPreFP",[19]],["FixedPoints.lfpSubsetDomain",[20]],["FixedPoints.lfp_def",[21]],["FixedPoints.monotonicDomain",[22]],["FixedPoints.monotonicInter",[23]],["FixedPoints.monotonicSubset",[24]],["FixedPoints.monotonicSubsetDomain",[25]],["FixedPoints.monotonicUnion",[26]],["Functions.Bijections_def",[27]],["Functions.DOMAIN",[28]],["Functions.FuncSet",[29]],["Functions.Image_def",[30]],["Functions.Injections_def",[31]],["Functions.InjectiveOn_def",[32]],["Functions.Inverse",[33]],["Functions.Inverse_def",[34]],["Functions.Surjections_def",[35]],["Functions.Surjective_def",[36]],["Functions.applyExcept",[37]],["Functions.bijectionsE",[38]],["Functions.bijectionsI",[39]],["Functions.bijectionsInjections",[40]],["Functions.bijectionsSurjections",[41]],["Functions.boolifyInjectiveOn",[42]],["Functions.boolifyIsAFcn",[43]],["Functions.boolifySurjective",[44]],["Functions.domainExcept",[45]],["Functions.exceptEqual",[46]],["Functions.exceptI",[47]],["Functions.exceptInFuncSet",[48]],["Functions.exceptInFuncSetSame",[49]],["Functions.exceptTrivial",[50]],["Functions.except_def",[51]],["Functions.extendDomain",[52]],["Functions.extendEqualIff",[53,54]],["Functions.extendFuncSet",[55]],["Functions.extendIsAFcn",[56]],["Functions.extendVal",[57]],["Functions.extend_def",[58]],["Functions.fapply",[59]],["Functions.fcnCong",[60]],["Functions.fcnConstruct",[61]],["Functions.fcnEqual",[62]],["Functions.fcnEqual2",[63]],["Functions.fcnEqualIff",[64]],["Functions.fcnIsAFcn",[65]],["Functions.funcSetDomain",[66]],["Functions.funcSetE",[67]],["Functions.funcSetE'",[68]],["Functions.funcSetEmpty",[69,70]],["Functions.funcSetFcnEqual",[71]],["Functions.funcSetIsAFcn",[72]],["Functions.funcSetSubRange",[73]],["Functions.funcSetValue",[74]],["Functions.functionInFuncSet",[75]],["Functions.imageE",[76]],["Functions.imageEmpty",[77,78]],["Functions.imageEqualI",[79]],["Functions.imageI",[80]],["Functions.imageI_eq",[81]],["Functions.imageI_exEq",[82]],["Functions.inFuncSet",[83]],["Functions.inFuncSetIff",[84]],["Functions.inImageiff",[85]],["Functions.injectionsE",[86]],["Functions.injectionsI",[87]],["Functions.injectiveExtend",[88]],["Functions.injectiveIffExistsInverse",[89]],["Functions.injectiveImageEqual",[90]],["Functions.injectiveImageMember",[91]],["Functions.injectiveImageSubset",[92]],["Functions.injectiveInverse",[93]],["Functions.injectiveOnD",[94]],["Functions.injectiveOnE",[95]],["Functions.injectiveOnEmpty",[96]],["Functions.injectiveOnExcept",[97]],["Functions.injectiveOnExtend",[98]],["Functions.injectiveOnI",[99]],["Functions.injectiveOnIff",[100]],["Functions.injectiveOnImageInter",[101]],["Functions.injectiveOnImageSetminus",[102]],["Functions.injectiveOnIsBool",[103]],["Functions.injectiveOnSetminus",[104]],["Functions.injectiveOnSingleton",[105]],["Functions.injectiveOnSubset",[106]],["Functions.inverseBijections",[107]],["Functions.inverseDomain",[108]],["Functions.inverseFcnSet",[109]],["Functions.inverseInDomain",[110]],["Functions.inverseInjective",[111]],["Functions.inverseIsAFcn",[112]],["Functions.inverseOfInjectiveSurjective",[113]],["Functions.inverseThenInjective",[114]],["Functions.isAFcnFuncSet",[115]],["Functions.isAFcn_def",[116]],["Functions.isBoolIsAFcn",[117]],["Functions.oneArgDomain",[118]],["Functions.oneArgEqual",[119,120]],["Functions.oneArgEqualIff",[121,122]],["Functions.oneArgFuncSet",[123]],["Functions.oneArgIsAFcn",[124]],["Functions.oneArgVal",[125]],["Functions.oneArg_def",[126]],["Functions.rangeI",[127]],["Functions.surjectionsE",[128]],["Functions.surjectionsFuncSet",[129]],["Functions.surjectionsI",[130]],["Functions.surjectionsRange",[131]],["Functions.surjectionsSurjective",[132]],["Functions.surjectiveD",[133]],["Functions.surjectiveE",[134]],["Functions.surjectiveI",[135]],["Functions.surjectiveIsBool",[136]],["Functions.surjectiveRange",[137]],["Functions.surjectiveSubset",[138]],["IntegerArithmetic.SuccInIntvlSucc",[139]],["IntegerArithmetic.SuccInIntvlSuccSucc",[140]],["IntegerArithmetic.add_0_int",[141]],["IntegerArithmetic.add_ac",[142,143,144]],["IntegerArithmetic.add_assoc",[142]],["IntegerArithmetic.add_commute",[143]],["IntegerArithmetic.add_diff_cancel_left",[145]],["IntegerArithmetic.add_diff_cancel_right",[146]],["IntegerArithmetic.add_diff_same_1",[147]],["IntegerArithmetic.add_diff_same_2",[148]],["IntegerArithmetic.add_eq_self1",[149]],["IntegerArithmetic.add_eq_self2",[150,151,152]],["IntegerArithmetic.add_ge_1",[153]],["IntegerArithmetic.add_is_0_nat",[154]],["IntegerArithmetic.add_is_1_nat",[155]],["IntegerArithmetic.add_left_cancel",[156]],["IntegerArithmetic.add_left_commute",[144]],["IntegerArithmetic.add_left_diff_right",[157]],["IntegerArithmetic.add_leq_diff1",[158]],["IntegerArithmetic.add_leq_diff2",[159]],["IntegerArithmetic.add_leq_left_mono",[160]],["IntegerArithmetic.add_leq_less_mono",[161]],["IntegerArithmetic.add_leq_mono",[162]],["IntegerArithmetic.add_leq_right_mono",[163]],["IntegerArithmetic.add_lessD2",[164]],["IntegerArithmetic.add_less_left_mono",[165]],["IntegerArithmetic.add_less_leq_mono",[166]],["IntegerArithmetic.add_less_mono",[167]],["IntegerArithmetic.add_less_right_mono",[168]],["IntegerArithmetic.add_nat_leqD1",[169]],["IntegerArithmetic.add_nat_leqD2",[170]],["IntegerArithmetic.add_nat_lessD1",[171]],["IntegerArithmetic.add_nat_pred_leqD1",[172]],["IntegerArithmetic.add_nat_pred_leqD2",[173]],["IntegerArithmetic.add_pred_left",[174]],["IntegerArithmetic.add_right_cancel",[175]],["IntegerArithmetic.add_right_commute",[176]],["IntegerArithmetic.add_right_diff_left",[177]],["IntegerArithmetic.add_succ_left",[178]],["IntegerArithmetic.add_times_distrib_left",[179]],["IntegerArithmetic.add_times_distrib_right",[180]],["IntegerArithmetic.add_uminus_pred_left",[181]],["IntegerArithmetic.add_uminus_succ_left",[182]],["IntegerArithmetic.addintNat",[183]],["IntegerArithmetic.addintType",[184]],["IntegerArithmetic.addint_0_left",[185]],["IntegerArithmetic.addint_def",[186]],["IntegerArithmetic.addint_pred",[187]],["IntegerArithmetic.addint_succ",[188]],["IntegerArithmetic.addint_uminus_self",[189]],["IntegerArithmetic.boolify_leq",[190]],["IntegerArithmetic.boolify_less",[191]],["IntegerArithmetic.diff_0_eq",[192]],["IntegerArithmetic.diff_0_eqs",[193,194,195]],["IntegerArithmetic.diff_add_same_1",[196]],["IntegerArithmetic.diff_add_same_2",[197]],["IntegerArithmetic.diff_diff_left",[198]],["IntegerArithmetic.diff_nat_leq_self1",[199]],["IntegerArithmetic.diff_nat_leq_self2",[200]],["IntegerArithmetic.eq_leq_bothE",[201]],["IntegerArithmetic.eq_leq_trans",[202]],["IntegerArithmetic.eq_less_trans",[203]],["IntegerArithmetic.gtNotinIntvl",[204]],["IntegerArithmetic.int_add_left_cancel_leq",[205]],["IntegerArithmetic.int_add_left_cancel_less",[206]],["IntegerArithmetic.int_add_left_cancel_pred_leq",[207]],["IntegerArithmetic.int_add_left_cancel_succ_leq",[208]],["IntegerArithmetic.int_add_right_cancel_leq",[209]],["IntegerArithmetic.int_add_right_cancel_less",[210]],["IntegerArithmetic.int_add_right_cancel_pred_less",[211]],["IntegerArithmetic.int_add_right_cancel_succ_less",[212]],["IntegerArithmetic.int_antisym_conv1",[213]],["IntegerArithmetic.int_antisym_conv2",[214]],["IntegerArithmetic.int_antisym_conv3",[215]],["IntegerArithmetic.int_distrib",[179,180]],["IntegerArithmetic.int_leqE",[216]],["IntegerArithmetic.int_leqI",[217]],["IntegerArithmetic.int_leq_antisym",[218]],["IntegerArithmetic.int_leq_cases",[219]],["IntegerArithmetic.int_leq_def",[220]],["IntegerArithmetic.int_leq_iff_add",[221]],["IntegerArithmetic.int_leq_iff_zero_leq_diff",[222]],["IntegerArithmetic.int_leq_imp_add",[223]],["IntegerArithmetic.int_leq_induct",[224]],["IntegerArithmetic.int_leq_inductE",[225]],["IntegerArithmetic.int_leq_is_less_succ",[226]],["IntegerArithmetic.int_leq_is_pred_less",[227]],["IntegerArithmetic.int_leq_less",[228]],["IntegerArithmetic.int_leq_lessE",[229]],["IntegerArithmetic.int_leq_less_linear",[230]],["IntegerArithmetic.int_leq_less_trans",[231]],["IntegerArithmetic.int_leq_limit_1",[232]],["IntegerArithmetic.int_leq_limit_2",[233]],["IntegerArithmetic.int_leq_linear",[234]],["IntegerArithmetic.int_leq_not_less",[235]],["IntegerArithmetic.int_leq_predE",[236]],["IntegerArithmetic.int_leq_predI",[237]],["IntegerArithmetic.int_leq_pred_iff",[238]],["IntegerArithmetic.int_leq_pred_is_succ_leq",[239]],["IntegerArithmetic.int_leq_refl",[240]],["IntegerArithmetic.int_leq_succ",[241]],["IntegerArithmetic.int_leq_succE",[242]],["IntegerArithmetic.int_leq_succI",[243]],["IntegerArithmetic.int_leq_succ_iff",[244]],["IntegerArithmetic.int_leq_trans",[245]],["IntegerArithmetic.int_leq_uminus",[246]],["IntegerArithmetic.int_leq_uminus_succ_iff",[247]],["IntegerArithmetic.int_lessE",[248]],["IntegerArithmetic.int_lessI",[249]],["IntegerArithmetic.int_less_antisym",[250]],["IntegerArithmetic.int_less_antisym_false",[251]],["IntegerArithmetic.int_less_asym",[252]],["IntegerArithmetic.int_less_cases",[253]],["IntegerArithmetic.int_less_iff_succ_add",[254]],["IntegerArithmetic.int_less_iff_zero_less_diff",[255]],["IntegerArithmetic.int_less_imp_succ_add",[256]],["IntegerArithmetic.int_less_leq_not_leq",[257]],["IntegerArithmetic.int_less_leq_trans",[258]],["IntegerArithmetic.int_less_linear",[259]],["IntegerArithmetic.int_less_mono_imp_leq_mono",[260]],["IntegerArithmetic.int_less_not_leq",[261]],["IntegerArithmetic.int_less_not_sym",[251]],["IntegerArithmetic.int_less_pred_is_succ_less",[262]],["IntegerArithmetic.int_less_succ",[263]],["IntegerArithmetic.int_less_succE",[264]],["IntegerArithmetic.int_less_succ_same",[265]],["IntegerArithmetic.int_less_trans",[266]],["IntegerArithmetic.int_less_uminus",[267]],["IntegerArithmetic.int_neq_iff",[268]],["IntegerArithmetic.int_neq_lessE",[269]],["IntegerArithmetic.int_not_leq_pred",[270]],["IntegerArithmetic.int_not_succ_leq",[271]],["IntegerArithmetic.int_pred_leq",[272]],["IntegerArithmetic.int_pred_leqE",[273]],["IntegerArithmetic.int_pred_leqI",[274]],["IntegerArithmetic.int_pred_leq_iff",[275]],["IntegerArithmetic.int_pred_leq_is_leq_succ",[276]],["IntegerArithmetic.int_pred_leq_pred",[277]],["IntegerArithmetic.int_pred_leq_predI",[278]],["IntegerArithmetic.int_pred_less",[279]],["IntegerArithmetic.int_pred_less_is_less_succ",[280]],["IntegerArithmetic.int_pred_less_pred",[281]],["IntegerArithmetic.int_pred_less_predE",[282]],["IntegerArithmetic.int_pred_less_predI",[283]],["IntegerArithmetic.int_pred_less_same",[284]],["IntegerArithmetic.int_succ_leqE",[285]],["IntegerArithmetic.int_succ_leqI",[286]],["IntegerArithmetic.int_succ_leq_iff",[287]],["IntegerArithmetic.int_succ_leq_predE",[288]],["IntegerArithmetic.int_succ_leq_succ",[289]],["IntegerArithmetic.int_succ_leq_succE",[290]],["IntegerArithmetic.int_succ_leq_succI",[291]],["IntegerArithmetic.int_succ_lessI",[292]],["IntegerArithmetic.int_succ_less_succ",[293]],["IntegerArithmetic.int_succ_less_succE",[294]],["IntegerArithmetic.int_succ_less_succI",[295]],["IntegerArithmetic.int_uminus_pred_leq_iff",[296]],["IntegerArithmetic.int_uminus_zero",[297,298]],["IntegerArithmetic.intvlE",[299]],["IntegerArithmetic.intvlEmpty_iff",[300]],["IntegerArithmetic.intvlEqual_iff",[301]],["IntegerArithmetic.intvlI",[302]],["IntegerArithmetic.intvlIff",[303]],["IntegerArithmetic.intvlIsEmpty",[304]],["IntegerArithmetic.intvlSingleton",[305]],["IntegerArithmetic.intvlSucc",[306]],["IntegerArithmetic.intvl_def",[307]],["IntegerArithmetic.leq_add_nat1",[308]],["IntegerArithmetic.leq_add_nat2",[309]],["IntegerArithmetic.leq_add_self1",[310]],["IntegerArithmetic.leq_add_self2",[311]],["IntegerArithmetic.leq_eq_trans",[312]],["IntegerArithmetic.leq_isBool",[313]],["IntegerArithmetic.leq_neq_iff_less",[314]],["IntegerArithmetic.leq_neq_iff_less_sym",[315]],["IntegerArithmetic.leq_neq_trans",[316]],["IntegerArithmetic.leq_neq_trans_sym",[317]],["IntegerArithmetic.less_add_Succ2",[318]],["IntegerArithmetic.less_def",[319]],["IntegerArithmetic.less_eq_trans",[320]],["IntegerArithmetic.less_imp_add_positive",[321]],["IntegerArithmetic.less_imp_leq",[322]],["IntegerArithmetic.less_irrefl",[323]],["IntegerArithmetic.less_irreflE",[324]],["IntegerArithmetic.less_isBool",[325]],["IntegerArithmetic.less_not_refl",[326]],["IntegerArithmetic.less_succ_add_nat1",[327]],["IntegerArithmetic.mult_eq_self1",[328]],["IntegerArithmetic.mult_eq_self2",[329]],["IntegerArithmetic.multintType",[330]],["IntegerArithmetic.multint_def",[331]],["IntegerArithmetic.nat_add_gt_0",[332]],["IntegerArithmetic.nat_gt0_not0",[333]],["IntegerArithmetic.nat_is_int_geq0",[334]],["IntegerArithmetic.nat_leq_induct",[335]],["IntegerArithmetic.nat_leq_inductE",[336]],["IntegerArithmetic.nat_leq_times_left",[337]],["IntegerArithmetic.nat_leq_times_right",[338]],["IntegerArithmetic.nat_leq_zero",[339]],["IntegerArithmetic.nat_less_antisym_leq_false",[261]],["IntegerArithmetic.nat_less_mono_imp_leq_mono",[340]],["IntegerArithmetic.nat_less_one",[341]],["IntegerArithmetic.nat_less_times_left",[342]],["IntegerArithmetic.nat_less_times_right",[343]],["IntegerArithmetic.nat_less_trans_Succ",[344]],["IntegerArithmetic.nat_neq0_conv",[345]],["IntegerArithmetic.nat_zero_leq",[346]],["IntegerArithmetic.nat_zero_less_succ",[347]],["IntegerArithmetic.neq_leq_trans",[348]],["IntegerArithmetic.neq_leq_trans_sym",[349]],["IntegerArithmetic.not_leq_less",[350]],["IntegerArithmetic.not_less_leq",[351]],["IntegerArithmetic.one_is_add_nat",[352]],["IntegerArithmetic.one_is_times_iff",[353]],["IntegerArithmetic.onetoInj",[354]],["IntegerArithmetic.onetoInj'",[355]],["IntegerArithmetic.pr_addintType",[356]],["IntegerArithmetic.pr_addint_0",[357]],["IntegerArithmetic.pr_addint_SuccNat",[358]],["IntegerArithmetic.pr_addint_def",[359]],["IntegerArithmetic.pr_addint_uminusSuccNat",[360]],["IntegerArithmetic.pr_multintType",[361]],["IntegerArithmetic.pr_multint_0",[362]],["IntegerArithmetic.pr_multint_SuccNat",[363]],["IntegerArithmetic.pr_multint_def",[364]],["IntegerArithmetic.pr_multint_uminusSuccNat",[365]],["IntegerArithmetic.pred_add_eq_self1",[366]],["IntegerArithmetic.pred_add_eq_self2",[367,368,369]],["IntegerArithmetic.pred_geq_0",[370]],["IntegerArithmetic.pred_leq_0",[371]],["IntegerArithmetic.pred_succ_add",[372]],["IntegerArithmetic.subint_pred",[373]],["IntegerArithmetic.subint_self",[374]],["IntegerArithmetic.subint_succ",[375]],["IntegerArithmetic.succIntvl",[376]],["IntegerArithmetic.succ_add_eq_self1",[377]],["IntegerArithmetic.succ_add_eq_self2",[378,379,380]],["IntegerArithmetic.succ_geq_0",[381]],["IntegerArithmetic.succ_leq_0",[382]],["IntegerArithmetic.succ_nat_not_neg",[383]],["IntegerArithmetic.succ_pred_add",[384]],["IntegerArithmetic.times_0",[385]],["IntegerArithmetic.times_0_left",[386]],["IntegerArithmetic.times_ac",[387,388,389]],["IntegerArithmetic.times_assoc",[387]],["IntegerArithmetic.times_cancel1",[390]],["IntegerArithmetic.times_cancel2",[391]],["IntegerArithmetic.times_commute",[388]],["IntegerArithmetic.times_is_0_iff",[392]],["IntegerArithmetic.times_is_1_iff",[393]],["IntegerArithmetic.times_left_commute",[389]],["IntegerArithmetic.times_leq_left_neg_cancel",[394]],["IntegerArithmetic.times_leq_left_neg_mono",[395]],["IntegerArithmetic.times_leq_left_pos_cancel",[396]],["IntegerArithmetic.times_leq_left_pos_mono",[397]],["IntegerArithmetic.times_leq_right_neg_cancel",[398]],["IntegerArithmetic.times_leq_right_neg_mono",[399]],["IntegerArithmetic.times_leq_right_pos_cancel",[400]],["IntegerArithmetic.times_leq_right_pos_mono",[401]],["IntegerArithmetic.times_less_left_neg_cancel",[402]],["IntegerArithmetic.times_less_left_neg_mono",[403]],["IntegerArithmetic.times_less_left_pos_cancel",[404]],["IntegerArithmetic.times_less_left_pos_mono",[405]],["IntegerArithmetic.times_less_right_neg_cancel",[406]],["IntegerArithmetic.times_less_right_neg_mono",[407]],["IntegerArithmetic.times_less_right_pos_cancel",[408]],["IntegerArithmetic.times_less_right_pos_mono",[409]],["IntegerArithmetic.times_nat",[410]],["IntegerArithmetic.times_neg",[411]],["IntegerArithmetic.times_pos",[412]],["IntegerArithmetic.times_pred",[413]],["IntegerArithmetic.times_pred_left",[414]],["IntegerArithmetic.times_right_commute",[415]],["IntegerArithmetic.times_succ",[416]],["IntegerArithmetic.times_succ_left",[417]],["IntegerArithmetic.times_uminus_left",[418]],["IntegerArithmetic.times_uminus_right",[419]],["IntegerArithmetic.trans_leq_add_nat1",[420]],["IntegerArithmetic.trans_leq_add_nat2",[421]],["IntegerArithmetic.trans_leq_diff_nat1",[422]],["IntegerArithmetic.trans_leq_diff_nat2",[423]],["IntegerArithmetic.trans_leq_less_add_nat1",[424]],["IntegerArithmetic.trans_leq_less_add_nat2",[425]],["IntegerArithmetic.trans_less_add_nat1",[426]],["IntegerArithmetic.trans_less_add_nat2",[427]],["IntegerArithmetic.trans_less_diff_nat1",[428]],["IntegerArithmetic.uminus_add",[429]],["IntegerArithmetic.uminus_leq_nat",[430]],["IntegerArithmetic.uminus_leq_zero",[431,432]],["IntegerArithmetic.zero_is_add_nat",[433]],["IntegerArithmetic.zero_istimes_iff",[434]],["IntegerArithmetic.zero_leq_not_less_zero",[435]],["IntegerArithmetic.zero_less_not_leq_zero",[436]],["IntegerArithmetic.zerotoEmpty",[437]],["IntegerArithmetic.zerotoInj",[438]],["IntegerArithmetic.zerotoInj'",[439]],["IntegerDivision.add_div",[440]],["IntegerDivision.add_mod",[441]],["IntegerDivision.boolify_dvd",[442]],["IntegerDivision.div_equal",[443]],["IntegerDivision.div_exists",[444]],["IntegerDivision.div_is_minusone_iff",[445]],["IntegerDivision.div_is_zero_iff",[446]],["IntegerDivision.div_mod_by_one",[447,448]],["IntegerDivision.div_mod_by_self",[449,450]],["IntegerDivision.div_mod_decomposition",[451]],["IntegerDivision.div_mod_minus_divisor1",[452,453]],["IntegerDivision.div_mod_minus_divisor2",[454,455]],["IntegerDivision.div_mod_minus_less_divisor",[456,457]],["IntegerDivision.div_mod_nat_less_divisor",[458,459]],["IntegerDivision.div_mod_plus_divisor1",[460,461]],["IntegerDivision.div_mod_plus_divisor2",[462,463]],["IntegerDivision.div_mod_unique",[464,465]],["IntegerDivision.div_times_divisor1",[466]],["IntegerDivision.div_times_divisor2",[467]],["IntegerDivision.div_times_divisor3",[468]],["IntegerDivision.div_times_divisor4",[469]],["IntegerDivision.div_type",[470]],["IntegerDivision.dvdE",[471]],["IntegerDivision.dvdI",[472]],["IntegerDivision.dvdIsBool",[473]],["IntegerDivision.dvd_0_left",[474]],["IntegerDivision.dvd_0_left_iff",[475]],["IntegerDivision.dvd_0_right",[476]],["IntegerDivision.dvd_add",[477]],["IntegerDivision.dvd_def",[478]],["IntegerDivision.dvd_is_mod0",[479]],["IntegerDivision.dvd_mod_imp_dvd",[480]],["IntegerDivision.dvd_mult",[481]],["IntegerDivision.dvd_mult2",[482]],["IntegerDivision.dvd_mult_left",[483]],["IntegerDivision.dvd_mult_right",[484]],["IntegerDivision.dvd_refl",[485]],["IntegerDivision.dvd_times_div_distrib",[486]],["IntegerDivision.dvd_times_div_self",[487]],["IntegerDivision.dvd_trans",[488]],["IntegerDivision.dvd_triv_left",[489]],["IntegerDivision.dvd_triv_right",[490]],["IntegerDivision.int_div_def",[491]],["IntegerDivision.mod_def",[492]],["IntegerDivision.mod_div_equality",[493]],["IntegerDivision.mod_div_equality2",[494]],["IntegerDivision.mod_div_equality3",[495]],["IntegerDivision.mod_div_equality4",[496]],["IntegerDivision.mod_div_same",[497]],["IntegerDivision.mod_equal",[498]],["IntegerDivision.mod_is_self_iff",[499]],["IntegerDivision.mod_mod_same",[500]],["IntegerDivision.mod_range",[501]],["IntegerDivision.mod_times_divisor1",[502]],["IntegerDivision.mod_times_divisor2",[503]],["IntegerDivision.mod_times_divisor3",[504]],["IntegerDivision.mod_times_divisor4",[505]],["IntegerDivision.mod_type",[506]],["IntegerDivision.mult_dvd_mono",[507]],["IntegerDivision.one_dvd",[508]],["IntegerDivision.times_div",[509]],["IntegerDivision.times_div_self1",[510]],["IntegerDivision.times_div_self2",[511]],["IntegerDivision.times_mod",[512]],["IntegerDivision.times_mod_self1",[513]],["IntegerDivision.times_mod_self2",[514]],["IntegerDivision.uminus_div1",[515]],["IntegerDivision.uminus_div2",[516]],["IntegerDivision.uminus_mod1",[517]],["IntegerDivision.uminus_mod2",[518]],["Integers.ExtendedPeano_def",[519]],["Integers.Int_def",[520]],["Integers.Nat_def",[521]],["Integers.SuccInNatNat",[522]],["Integers.SuccInj",[523]],["Integers.SuccInjIff",[524]],["Integers.SuccIsAFcn",[525]],["Integers.SuccIsNat",[526]],["Integers.SuccNotUptoZero",[527]],["Integers.SuccNotZero",[528,529]],["Integers.Succ_def",[530]],["Integers.bprimrec_int",[531]],["Integers.bprimrec_nat",[532]],["Integers.diffInduct",[533]],["Integers.diffInduction",[534]],["Integers.domainSucc",[535]],["Integers.eight_def",[536]],["Integers.eleven_def",[537]],["Integers.extendedPeanoExists",[538]],["Integers.fifteen_def",[539]],["Integers.five_def",[540]],["Integers.four_def",[541]],["Integers.fourteen_def",[542]],["Integers.intCases",[543]],["Integers.intCplt_def",[544]],["Integers.intElim",[545]],["Integers.intExtendedPeano",[546]],["Integers.intInduct",[547]],["Integers.intInductE",[548]],["Integers.intIsSucc",[549]],["Integers.intZeroPosNeg",[550]],["Integers.int_primrecE",[551]],["Integers.int_primrecType",[552]],["Integers.int_primrec_def",[553]],["Integers.natCases",[554]],["Integers.natInduct",[555]],["Integers.natInductE",[556]],["Integers.natIsInt",[557]],["Integers.nat_primrecE",[558]],["Integers.nat_primrecType",[559]],["Integers.nat_primrec_def",[560]],["Integers.nine_def",[561]],["Integers.not0_implies_Suc",[562]],["Integers.pr_intCases",[563]],["Integers.pr_natCases",[564]],["Integers.pr_natInduct",[565]],["Integers.pred0",[566]],["Integers.predInNat",[567]],["Integers.predInj",[568]],["Integers.predInjIff",[569]],["Integers.predIrrefl",[570]],["Integers.predIrreflE",[571,572]],["Integers.predIrrefl_iff",[573,574]],["Integers.predIsAFcn",[575]],["Integers.predSucc",[576]],["Integers.predType",[577]],["Integers.predValue",[578]],["Integers.pred_def",[579]],["Integers.primrec_int",[580]],["Integers.primrec_int_upto_def",[581]],["Integers.primrec_int_upto_deterministic",[582,583]],["Integers.primrec_int_upto_exists",[584]],["Integers.primrec_nat",[585]],["Integers.primrec_nat_upto_def",[586]],["Integers.primrec_nat_upto_deterministic",[587]],["Integers.primrec_nat_upto_exists",[588]],["Integers.seven_def",[589]],["Integers.six_def",[590]],["Integers.succInNat",[591]],["Integers.succInj",[592]],["Integers.succInjIff",[593]],["Integers.succIrrefl",[594]],["Integers.succIrreflE",[595,596]],["Integers.succIrrefl_iff",[597,598]],["Integers.succIs0",[599]],["Integers.succIsAFcn",[600]],["Integers.succIsSucc",[601]],["Integers.succIsUminus",[602]],["Integers.succNatNotNeg",[603,604,605,606]],["Integers.succNatNotZero",[607,608]],["Integers.succNatZeroIff",[609,610]],["Integers.succNotinUpto",[611]],["Integers.succPred",[612]],["Integers.succType",[613]],["Integers.succUminusSucc",[614]],["Integers.succUminusSuccNat",[615]],["Integers.succ_def",[616]],["Integers.ten_def",[617]],["Integers.thirteen_def",[618]],["Integers.three_def",[619]],["Integers.twelve_def",[620]],["Integers.two_def",[621]],["Integers.uminusInj",[622]],["Integers.uminusInjIff",[623]],["Integers.uminusIsInt",[624]],["Integers.uminusIsSucc",[625]],["Integers.uminusNat",[626]],["Integers.uminusPred",[627]],["Integers.uminusReflZero",[628]],["Integers.uminusSucc",[629]],["Integers.uminusSwap",[630]],["Integers.uminusUminus",[631]],["Integers.uminusZero",[632]],["Integers.uminusZero'",[633]],["Integers.uminus_def",[634]],["Integers.uptoAntisym",[635]],["Integers.uptoInduct",[636]],["Integers.uptoInj",[637]],["Integers.uptoLimit",[638]],["Integers.uptoLinear",[639]],["Integers.uptoNat",[640]],["Integers.uptoPred",[641]],["Integers.uptoRefl",[642]],["Integers.uptoSucc",[643]],["Integers.uptoTrans",[644]],["Integers.uptoZero",[645]],["Integers.upto_def",[646]],["Integers.zeroInUpto",[647]],["Integers.zeroIsInt",[648]],["Integers.zeroIsNat",[649]],["Integers.zeroIsSucc",[650]],["Integers.zero_def",[651]],["PredicateLogic.A_then_notA_false",[652]],["PredicateLogic.All_def",[653]],["PredicateLogic.Ex_def",[654]],["PredicateLogic.Let_def",[655]],["PredicateLogic.TrueAssumption",[656]],["PredicateLogic.TruepropBoolify",[657]],["PredicateLogic.allE",[658]],["PredicateLogic.allI",[659]],["PredicateLogic.allIsBool",[660]],["PredicateLogic.all_dupE",[661]],["PredicateLogic.andIsBool",[662]],["PredicateLogic.arbitrary_def",[663]],["PredicateLogic.atomize_all",[664]],["PredicateLogic.atomize_conj",[665]],["PredicateLogic.atomize_conjL",[666]],["PredicateLogic.atomize_disjL",[667]],["PredicateLogic.atomize_elimL",[668]],["PredicateLogic.atomize_eq",[669]],["PredicateLogic.atomize_exL",[670]],["PredicateLogic.atomize_imp",[671]],["PredicateLogic.atomize_not",[672]],["PredicateLogic.boolConstEqual",[673,674]],["PredicateLogic.boolEqual",[675]],["PredicateLogic.boolEqualIff",[676]],["PredicateLogic.boolifyAll",[677]],["PredicateLogic.boolifyAnd",[678]],["PredicateLogic.boolifyBoolify",[679]],["PredicateLogic.boolifyCond",[680]],["PredicateLogic.boolifyE",[681]],["PredicateLogic.boolifyEq",[682]],["PredicateLogic.boolifyEquivalent",[683]],["PredicateLogic.boolifyEx",[684]],["PredicateLogic.boolifyFalse",[685]],["PredicateLogic.boolifyFalseI",[686]],["PredicateLogic.boolifyI",[687]],["PredicateLogic.boolifyIff",[688]],["PredicateLogic.boolifyImp",[689]],["PredicateLogic.boolifyIsBool",[690]],["PredicateLogic.boolifyNot",[691]],["PredicateLogic.boolifyOr",[692]],["PredicateLogic.boolifyTrue",[693]],["PredicateLogic.boolifyTrueFalse",[694]],["PredicateLogic.boolifyTrueI",[695]],["PredicateLogic.boolify_cases",[696]],["PredicateLogic.boolify_def",[697]],["PredicateLogic.case_split",[698]],["PredicateLogic.cases_atomize",[699,700,701,702]],["PredicateLogic.cases_atomize'",[699,700,701]],["PredicateLogic.cases_conj",[703,704,705]],["PredicateLogic.cases_conj_curry",[705]],["PredicateLogic.cases_conj_def",[706]],["PredicateLogic.cases_conj_eq",[700]],["PredicateLogic.cases_equal_def",[707]],["PredicateLogic.cases_equal_eq",[702]],["PredicateLogic.cases_false_def",[708]],["PredicateLogic.cases_forall_conj",[703]],["PredicateLogic.cases_forall_def",[709]],["PredicateLogic.cases_forall_eq",[701]],["PredicateLogic.cases_implies_conj",[704]],["PredicateLogic.cases_implies_def",[710]],["PredicateLogic.cases_implies_eq",[699]],["PredicateLogic.cases_rulify",[711,712,713,714]],["PredicateLogic.cases_rulify'",[711,712,713]],["PredicateLogic.cases_rulify_fallback",[707,710,706,709,715,708]],["PredicateLogic.cases_simp",[716]],["PredicateLogic.cases_trueI",[717]],["PredicateLogic.cases_true_def",[715]],["PredicateLogic.chooseI",[718]],["PredicateLogic.chooseI2",[719]],["PredicateLogic.chooseI2_ex",[720]],["PredicateLogic.chooseI_ex",[721]],["PredicateLogic.choose_det",[722]],["PredicateLogic.choose_equality",[723]],["PredicateLogic.choose_equality'",[724]],["PredicateLogic.choose_trivial",[725]],["PredicateLogic.classical",[726]],["PredicateLogic.condCong",[727]],["PredicateLogic.condD1",[728]],["PredicateLogic.condD2",[729]],["PredicateLogic.condE",[730]],["PredicateLogic.condElse",[731]],["PredicateLogic.condF",[732]],["PredicateLogic.condFullCong",[733]],["PredicateLogic.condI",[734]],["PredicateLogic.condT",[735]],["PredicateLogic.condThen",[736]],["PredicateLogic.cond_boolE",[737]],["PredicateLogic.cond_boolI",[738]],["PredicateLogic.cond_cancel",[739]],["PredicateLogic.cond_eqLE",[740]],["PredicateLogic.cond_eqLI",[741]],["PredicateLogic.cond_eqRE",[742]],["PredicateLogic.cond_eqRI",[743]],["PredicateLogic.cond_id",[744]],["PredicateLogic.cond_simps",[745,746]],["PredicateLogic.conjD1",[747]],["PredicateLogic.conjD2",[748]],["PredicateLogic.conjE",[749]],["PredicateLogic.conjI",[750]],["PredicateLogic.conj_comms",[751,752]],["PredicateLogic.conj_cong",[753]],["PredicateLogic.conj_def",[754]],["PredicateLogic.conj_simps",[755,756,757,758,759,760,761]],["PredicateLogic.contradiction",[762]],["PredicateLogic.contrapos",[763]],["PredicateLogic.contrapos2",[764]],["PredicateLogic.default_def",[765]],["PredicateLogic.disjE",[766]],["PredicateLogic.disjI",[767]],["PredicateLogic.disjI1",[768]],["PredicateLogic.disjI2",[769]],["PredicateLogic.disj_comms",[770,771]],["PredicateLogic.disj_cong",[772]],["PredicateLogic.disj_def",[773]],["PredicateLogic.disj_simps",[774,775,776,777,778,779,780]],["PredicateLogic.eqBoolean",[781]],["PredicateLogic.eqFalse_eqFalse",[782]],["PredicateLogic.eqIsBool",[783]],["PredicateLogic.eqThenIff",[784]],["PredicateLogic.eqTrueD",[785]],["PredicateLogic.eqTrueI",[786]],["PredicateLogic.eq_commute",[787]],["PredicateLogic.eq_false_not",[788]],["PredicateLogic.eq_reflection",[789]],["PredicateLogic.equal_arbitrary",[790]],["PredicateLogic.equal_default",[791]],["PredicateLogic.exE",[792]],["PredicateLogic.exI",[793]],["PredicateLogic.exIsBool",[794]],["PredicateLogic.excluded_middle",[795]],["PredicateLogic.falseE",[796]],["PredicateLogic.falseIsBool",[797]],["PredicateLogic.false_eq_trueE",[798]],["PredicateLogic.false_implies_equals",[799]],["PredicateLogic.false_neq_true",[800]],["PredicateLogic.if_bool_equiv_conj",[801]],["PredicateLogic.iffCE",[802]],["PredicateLogic.iffD1",[803]],["PredicateLogic.iffD2",[804]],["PredicateLogic.iffE",[805]],["PredicateLogic.iffI",[806]],["PredicateLogic.iffIsBool",[807]],["PredicateLogic.iffIsBoolifyEqual",[808]],["PredicateLogic.iffThenBoolifyEqual",[809]],["PredicateLogic.iff_cong",[810]],["PredicateLogic.iff_def",[811]],["PredicateLogic.iff_refl",[812]],["PredicateLogic.iff_simps",[813,814,815,816,817]],["PredicateLogic.iff_trans",[818]],["PredicateLogic.impCE",[819]],["PredicateLogic.impCE'",[820]],["PredicateLogic.impE",[821]],["PredicateLogic.impI",[822]],["PredicateLogic.impIsBool",[823]],["PredicateLogic.imp_cong",[824]],["PredicateLogic.imp_def",[825]],["PredicateLogic.imp_simps",[826,827,828,829,830,831]],["PredicateLogic.implies_true_equals",[832]],["PredicateLogic.isBoolCond",[833]],["PredicateLogic.isBoolE",[834]],["PredicateLogic.isBoolTrueFalse",[835]],["PredicateLogic.isBool_def",[836]],["PredicateLogic.meta_eq_to_iff",[837]],["PredicateLogic.meta_to_obj_eq",[838]],["PredicateLogic.miniscope_all",[839,840,841,842,843,844]],["PredicateLogic.miniscope_ex",[845,846,847,848,849,850]],["PredicateLogic.mp",[851]],["PredicateLogic.neq_conv_eq_False",[852]],["PredicateLogic.notBoolIsFalse",[853]],["PredicateLogic.notBoolifyFalse",[854]],["PredicateLogic.notE",[855]],["PredicateLogic.notE'",[856]],["PredicateLogic.notFalse",[857]],["PredicateLogic.notFalseI",[858]],["PredicateLogic.notI",[859]],["PredicateLogic.notIsBool",[860]],["PredicateLogic.notTrue",[861]],["PredicateLogic.notTrueE",[862]],["PredicateLogic.not_def",[863]],["PredicateLogic.not_refl_False",[864]],["PredicateLogic.not_simps",[865,866,867,868,869,870,871,872,873]],["PredicateLogic.not_sym",[874]],["PredicateLogic.notnotD",[875]],["PredicateLogic.notnotI",[876]],["PredicateLogic.orIsBool",[877]],["PredicateLogic.prop_distrib",[878,879,880,881,882,883,884]],["PredicateLogic.quant_distrib",[885,886]],["PredicateLogic.quant_simps",[887,888,889,890,891,892,893,894]],["PredicateLogic.refl",[895]],["PredicateLogic.rev_mp",[896]],["PredicateLogic.simp_impliesE",[897]],["PredicateLogic.simp_impliesI",[898]],["PredicateLogic.simp_implies_cong",[899]],["PredicateLogic.simp_implies_def",[900]],["PredicateLogic.skolem",[901]],["PredicateLogic.skolemI",[902]],["PredicateLogic.spec",[903]],["PredicateLogic.splitCond",[904]],["PredicateLogic.splitCondAsm",[905]],["PredicateLogic.ssubst",[906]],["PredicateLogic.subst",[907]],["PredicateLogic.substCond",[908]],["PredicateLogic.swap",[909]],["PredicateLogic.sym",[910]],["PredicateLogic.symEqLeft",[911]],["PredicateLogic.thin_refl",[912]],["PredicateLogic.trans",[913]],["PredicateLogic.trueI",[914]],["PredicateLogic.trueIsBool",[915]],["PredicateLogic.true_eq_falseE",[916]],["PredicateLogic.trueprop_eq_true",[917]],["PredicateLogic.trueprop_true_eq",[918]],["Pure.all_conjunction",[919]],["Pure.asm_rl",[920]],["Pure.conjunctionD1",[921]],["Pure.conjunctionD2",[922]],["Pure.conjunctionI",[923]],["Pure.conjunction_def",[924]],["Pure.conjunction_imp",[925]],["Pure.cut_rl",[926]],["Pure.distinct_prems_rl",[927]],["Pure.equal_allI",[928]],["Pure.equal_elim_rule1",[929]],["Pure.equal_elim_rule2",[930]],["Pure.equal_intr_rule",[931]],["Pure.equals_cong",[932]],["Pure.imp_cong",[933]],["Pure.imp_conjunction",[934]],["Pure.meta_allE",[935]],["Pure.meta_impE",[936]],["Pure.meta_mp",[937]],["Pure.meta_spec",[938]],["Pure.norm_hhf_eq",[939]],["Pure.prop_def",[940]],["Pure.protectD",[941]],["Pure.protectI",[942]],["Pure.protect_cong",[943]],["Pure.reflexive",[944]],["Pure.remdups_rl",[945]],["Pure.revcut_rl",[946]],["Pure.sort_constraintI",[947]],["Pure.sort_constraint_def",[948]],["Pure.sort_constraint_eq",[949]],["Pure.swap_params",[950]],["Pure.swap_prems_eq",[951]],["Pure.symmetric",[952]],["Pure.termI",[953]],["Pure.term_def",[954]],["Pure.thin_rl",[955]],["Pure.transitive",[956]],["Pure.triv_forall_equality",[957]],["SetTheory.INTERE",[958]],["SetTheory.INTERI",[959]],["SetTheory.INTERSimps",[960,961,962]],["SetTheory.INTER_GLB",[963]],["SetTheory.INTER_LB",[964]],["SetTheory.INTER_anti_mono",[965]],["SetTheory.INTER_def",[966]],["SetTheory.INTER_iff",[967]],["SetTheory.INTERunionDistrib",[968]],["SetTheory.SUBSET",[969]],["SetTheory.SUBSETD",[970]],["SetTheory.SUBSETEmpty",[971]],["SetTheory.SUBSETI",[972]],["SetTheory.SUBSET_UNION",[973]],["SetTheory.SUBSET_iff",[974]],["SetTheory.SUBSETaddElt",[975]],["SetTheory.SUBSETinter",[976]],["SetTheory.UNION",[977]],["SetTheory.UNIONDisjoint",[978]],["SetTheory.UNIONE",[979]],["SetTheory.UNIONI",[980]],["SetTheory.UNIONIsSubset",[981]],["SetTheory.UNIONSimps",[982,983,984]],["SetTheory.UNION_LUB",[985]],["SetTheory.UNION_SUBSET",[986]],["SetTheory.UNION_UB",[987]],["SetTheory.UNION_iff",[988]],["SetTheory.UNION_in_SUBSET",[989]],["SetTheory.UNION_mono",[990]],["SetTheory.UNIONinter",[991]],["SetTheory.UNIONunionDistrib",[992]],["SetTheory.addEltAbsorb",[993]],["SetTheory.addEltCommute",[994]],["SetTheory.addEltE",[995]],["SetTheory.addEltEqualAddElt",[996]],["SetTheory.addEltEqual_iff",[997]],["SetTheory.addEltI",[998]],["SetTheory.addEltInter",[999]],["SetTheory.addEltSubsetE",[1000]],["SetTheory.addEltSubsetI",[1001]],["SetTheory.addEltSubset_iff",[1002]],["SetTheory.addEltTwice",[1003]],["SetTheory.addEltUnion",[1004]],["SetTheory.addElt_def",[1005]],["SetTheory.addElt_iff",[1006]],["SetTheory.bAllCong",[1007]],["SetTheory.bAllE",[1008]],["SetTheory.bAllI",[1009]],["SetTheory.bAllInter",[1010]],["SetTheory.bAllIsBool",[1011]],["SetTheory.bAllSubset",[1012]],["SetTheory.bAllTriv",[1013]],["SetTheory.bAllUnion",[1014]],["SetTheory.bAll_def",[1015]],["SetTheory.bAll_unb",[1016]],["SetTheory.bChooseCong",[1017]],["SetTheory.bChooseI",[1018]],["SetTheory.bChooseI2",[1019]],["SetTheory.bChooseI_ex",[1020]],["SetTheory.bChooseInSet",[1021]],["SetTheory.bChooseInSet_ex",[1022]],["SetTheory.bChoose_def",[1023]],["SetTheory.bExCI",[1024]],["SetTheory.bExCong",[1025]],["SetTheory.bExE",[1026]],["SetTheory.bExI",[1027]],["SetTheory.bExIsBool",[1028]],["SetTheory.bExTriv",[1029]],["SetTheory.bEx_def",[1030]],["SetTheory.bExistsInter",[1031]],["SetTheory.bExistsUnion",[1032]],["SetTheory.bQuantOnePoint",[1033,1034,1035,1036,1037,1038]],["SetTheory.bQuant_distribs",[1039,1040]],["SetTheory.boolifyBAll",[1041]],["SetTheory.boolifyBEx",[1042]],["SetTheory.boolifyIn",[1043]],["SetTheory.boolifySubset",[1044]],["SetTheory.boolifypSubset",[1045]],["SetTheory.bspec",[1046]],["SetTheory.comprehensionDistribs",[1047,1048,1049,1050]],["SetTheory.comprehensionSimps",[1051,1052,1053,1054,1055,1056,1057,1058,1059,1060]],["SetTheory.condIn",[1061]],["SetTheory.condInE",[1062]],["SetTheory.condInI",[1063]],["SetTheory.condSubset",[1064]],["SetTheory.emptyE",[1065]],["SetTheory.emptySUBSET",[1066]],["SetTheory.emptySetminus",[1067]],["SetTheory.emptySubset",[1068]],["SetTheory.emptysetD",[1069]],["SetTheory.emptysetEmpty",[1070]],["SetTheory.emptysetI",[1071]],["SetTheory.emptysetI_rev",[1072]],["SetTheory.emptysetIffEmpty",[1073]],["SetTheory.emptysetIffEmpty'",[1074]],["SetTheory.enumeratedSetSimps",[1002,996,994,1003,1075,1076,1077,1078,1079]],["SetTheory.equalAddElt_iff",[1080]],["SetTheory.equalNotIn",[1081]],["SetTheory.extension",[1082]],["SetTheory.foundation",[1083]],["SetTheory.inAsym",[1084]],["SetTheory.inCond",[1085]],["SetTheory.inCondE",[1086]],["SetTheory.inCondI",[1087]],["SetTheory.inIrrefl",[1088]],["SetTheory.inIsBool",[1089]],["SetTheory.inNonEqual",[1090]],["SetTheory.infinity",[1091]],["SetTheory.interAC",[1092,1093,1094,1095]],["SetTheory.interAbsorb",[1096]],["SetTheory.interAddEltLeft",[1075]],["SetTheory.interAddEltRight",[1076]],["SetTheory.interAssoc",[1092]],["SetTheory.interCommute",[1093]],["SetTheory.interD1",[1097]],["SetTheory.interD2",[1098]],["SetTheory.interE",[1099]],["SetTheory.interEmpty",[1100,1101]],["SetTheory.interGLB",[1102]],["SetTheory.interI",[1103]],["SetTheory.interINTER",[1104]],["SetTheory.interLB1",[1105]],["SetTheory.interLB2",[1106]],["SetTheory.interLeftAbsorb",[1095]],["SetTheory.interLeftCommute",[1094]],["SetTheory.interSetminusLeft",[1107]],["SetTheory.interSetminusRight",[1108]],["SetTheory.interSubset",[1109]],["SetTheory.interSubsetOf",[1110]],["SetTheory.interUNION",[1111]],["SetTheory.interUnionDistrib",[1112]],["SetTheory.inter_def",[1113]],["SetTheory.inter_iff",[1114]],["SetTheory.isEmptySimps",[1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128]],["SetTheory.miniscope_bAll",[1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139]],["SetTheory.miniscope_bEx",[1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1150]],["SetTheory.nonEmpty",[1151,1152]],["SetTheory.nonEmpty'",[1153,1154]],["SetTheory.nonEmptyE",[1155]],["SetTheory.nonEmptyI",[1156]],["SetTheory.notIn_inFalse",[1157]],["SetTheory.notSubset",[1158]],["SetTheory.notSubsetE",[1159]],["SetTheory.notSubsetI",[1160]],["SetTheory.notbQuant'",[1161,1162]],["SetTheory.psubsetIsBool",[1163]],["SetTheory.psubset_def",[1164]],["SetTheory.psubset_elim",[1165]],["SetTheory.psubset_intro",[1166]],["SetTheory.rev_subsetD",[1167]],["SetTheory.rev_subsetNotIn",[1168]],["SetTheory.selfSUBSET",[1169]],["SetTheory.setEqual",[1170]],["SetTheory.setEqualD1",[1171]],["SetTheory.setEqualD2",[1172]],["SetTheory.setEqualE",[1173]],["SetTheory.setEqualI",[1174]],["SetTheory.setEqual_iff",[1175]],["SetTheory.setOfAll",[1176]],["SetTheory.setOfAllE",[1177]],["SetTheory.setOfAllEqual",[1178]],["SetTheory.setOfAllI",[1179]],["SetTheory.setOfAll_cong",[1180]],["SetTheory.setOfAll_eqI",[1181]],["SetTheory.setOfAll_iff",[1182]],["SetTheory.setOfAll_triv",[1183]],["SetTheory.setminusAddElt",[1184]],["SetTheory.setminusAddEltLeft",[1079]],["SetTheory.setminusD1",[1185]],["SetTheory.setminusD2",[1186]],["SetTheory.setminusDisjoint",[1187]],["SetTheory.setminusE",[1188]],["SetTheory.setminusI",[1189]],["SetTheory.setminusINTERLeft",[1190]],["SetTheory.setminusINTERRight",[1191]],["SetTheory.setminusInterLeft",[1192]],["SetTheory.setminusInterRight",[1193]],["SetTheory.setminusSelf",[1194]],["SetTheory.setminusSubset",[1195]],["SetTheory.setminusUNIONLeft",[1196]],["SetTheory.setminusUnionLeft",[1197]],["SetTheory.setminusUnionRight",[1198]],["SetTheory.setminus_def",[1199]],["SetTheory.setminus_iff",[1200]],["SetTheory.singletonI",[1201]],["SetTheory.singleton_iff",[1202]],["SetTheory.subsetAddEltE",[1203]],["SetTheory.subsetAddElt_iff",[1204]],["SetTheory.subsetCE",[1205]],["SetTheory.subsetCond",[1206]],["SetTheory.subsetD",[1207]],["SetTheory.subsetE",[1208]],["SetTheory.subsetEmpty",[1209]],["SetTheory.subsetI",[1210]],["SetTheory.subsetINTER",[1211]],["SetTheory.subsetIsBool",[1212]],["SetTheory.subsetNotIn",[1213]],["SetTheory.subsetOf",[1214]],["SetTheory.subsetOfConj",[1215]],["SetTheory.subsetOfD1",[1216]],["SetTheory.subsetOfD2",[1217]],["SetTheory.subsetOfDisj",[1218]],["SetTheory.subsetOfE",[1219]],["SetTheory.subsetOfEqual",[1220]],["SetTheory.subsetOfI",[1221]],["SetTheory.subsetOfInter",[1222]],["SetTheory.subsetOf_cong",[1223]],["SetTheory.subsetOf_iff",[1224]],["SetTheory.subsetRefl",[1225]],["SetTheory.subsetSetminus",[1226]],["SetTheory.subsetTrans",[1227]],["SetTheory.subsetUnion",[1228]],["SetTheory.subset_def",[1229]],["SetTheory.subst_elem",[1230]],["SetTheory.subst_elem_rev",[1231]],["SetTheory.subst_set",[1232]],["SetTheory.subst_set_rev",[1233]],["SetTheory.unionAC",[1234,1235,1236,1237]],["SetTheory.unionAbsorb",[1238]],["SetTheory.unionAddEltLeft",[1077]],["SetTheory.unionAddEltRight",[1078]],["SetTheory.unionAssoc",[1234]],["SetTheory.unionCI",[1239]],["SetTheory.unionCommute",[1235]],["SetTheory.unionE",[1240]],["SetTheory.unionEmpty",[1241,1242]],["SetTheory.unionI1",[1243]],["SetTheory.unionI2",[1244]],["SetTheory.unionINTER",[1245]],["SetTheory.unionInterDistrib",[1246]],["SetTheory.unionLUB",[1247]],["SetTheory.unionLeftAbsorb",[1237]],["SetTheory.unionLeftCommute",[1236]],["SetTheory.unionSUBSET",[1248]],["SetTheory.unionSetminusLeft",[1249]],["SetTheory.unionSetminusRight",[1250]],["SetTheory.unionSetminusSelf",[1251]],["SetTheory.unionUB1",[1252]],["SetTheory.unionUB2",[1253]],["SetTheory.union_def",[1254]],["SetTheory.union_iff",[1255]],["SetTheory.upairE",[1256]],["SetTheory.upairI1",[1257]],["SetTheory.upairI2",[1258]],["SetTheory.upair_def",[1259]],["SetTheory.upair_iff",[1260]],["Strings.Char_def",[1261]],["Strings.Nibble_def",[1262]],["Strings.String_def",[1263]],["Strings.charInj",[1264]],["Strings.char_def",[1265]],["Strings.isChar",[1266]],["Tuples.Append_def",[1267]],["Tuples.DomainSeqLen",[1268]],["Tuples.DomainSeqLen'",[1269]],["Tuples.EnumFuncSetE",[1270]],["Tuples.EnumFuncSetI",[1271]],["Tuples.EnumFuncSet_def",[1272]],["Tuples.IdE",[1273]],["Tuples.IdI",[1274]],["Tuples.IdI'",[1275]],["Tuples.Id_comp_R",[1276]],["Tuples.Id_def",[1277]],["Tuples.Id_empty",[1278]],["Tuples.Id_eqI",[1279]],["Tuples.Id_iff",[1280]],["Tuples.Id_subset_Prod",[1281]],["Tuples.LenI",[1282]],["Tuples.LenInNat",[1283,1284]],["Tuples.LenInNat'",[1285,1286]],["Tuples.Len_def",[1287]],["Tuples.Product_def",[1288]],["Tuples.R_comp_Id",[1289]],["Tuples.SeqE",[1290]],["Tuples.SeqI",[1291]],["Tuples.SeqI'",[1292]],["Tuples.SeqIsAFcn",[1293]],["Tuples.SeqIsAFcn'",[1294]],["Tuples.SeqIsASeq",[1295]],["Tuples.SeqNotEmpty",[1296,1297]],["Tuples.Seq_def",[1298]],["Tuples.antisym_empty",[1299]],["Tuples.antisymmetricE",[1300]],["Tuples.antisymmetricI",[1301]],["Tuples.antisymmetricIsBool",[1302]],["Tuples.antisymmetricSubset",[1303]],["Tuples.antisymmetric_Id",[1304]],["Tuples.antisymmetric_converse",[1305]],["Tuples.antisymmetric_def",[1306]],["Tuples.appendD1",[1307]],["Tuples.appendD2",[1308]],["Tuples.appendElt",[1309]],["Tuples.appendElt'",[1310]],["Tuples.appendElt1",[1311]],["Tuples.appendElt1'",[1312]],["Tuples.appendElt2",[1313]],["Tuples.appendElt2'",[1314]],["Tuples.appendEqualIff",[1315]],["Tuples.appendExtend",[1316]],["Tuples.appendInSeq",[1317]],["Tuples.appendIsAFcn",[1318]],["Tuples.appendIsAFcn'",[1319]],["Tuples.appendIsASeq",[1320]],["Tuples.appendNotEmpty",[1321]],["Tuples.boolifyAntisymmetric",[1322]],["Tuples.boolifyEquivalence",[1323]],["Tuples.boolifyIrreflexive",[1324]],["Tuples.boolifyIsASeq",[1325]],["Tuples.boolifyReflexive",[1326]],["Tuples.boolifySymmetric",[1327]],["Tuples.boolifyTransitive",[1328]],["Tuples.compE",[1329]],["Tuples.compEpair",[1330]],["Tuples.compEqualI",[1331,1332]],["Tuples.compI",[1333]],["Tuples.comp_assoc",[1334]],["Tuples.comp_equivI",[1335]],["Tuples.converseD",[1336]],["Tuples.converseE",[1337]],["Tuples.converseEqualI",[1338,1339]],["Tuples.converseI",[1340]],["Tuples.converseSubset",[1341]],["Tuples.converse_Id",[1342]],["Tuples.converse_comp",[1343]],["Tuples.converse_converse",[1344]],["Tuples.converse_def",[1345]],["Tuples.converse_empty",[1346]],["Tuples.converse_iff",[1347]],["Tuples.converse_mono",[1348]],["Tuples.converse_mono_1",[1349]],["Tuples.converse_mono_2",[1350]],["Tuples.converse_prod",[1351]],["Tuples.dom_Id",[1352]],["Tuples.dom_in_A",[1353]],["Tuples.domainAppend",[1354]],["Tuples.domainEmptySeq",[1355]],["Tuples.emptyDomainIsEmptySeq",[1356]],["Tuples.emptyFcnEmptySeq",[1357]],["Tuples.emptySeqEmptyFcn",[1358]],["Tuples.emptySeqIff",[1359]],["Tuples.emptySeqIff'",[1360]],["Tuples.emptySeqInSeq",[1361]],["Tuples.emptySeqIsAFcn",[1362]],["Tuples.emptySeqIsASeq",[1363]],["Tuples.emptySeq_def",[1364]],["Tuples.equiv_comp_eq",[1365]],["Tuples.equivalenceIsBool",[1366]],["Tuples.equivalence_def",[1367]],["Tuples.idEqualI",[1368,1369]],["Tuples.imageAppend",[1370]],["Tuples.imageEmptySeq",[1371]],["Tuples.inProd",[1372]],["Tuples.inProd'",[1373]],["Tuples.inProdE",[1374]],["Tuples.inProdI",[1375]],["Tuples.inProdI'",[1376]],["Tuples.inProductE",[1377]],["Tuples.inProductI",[1378]],["Tuples.inProductIsASeq",[1379]],["Tuples.inProductLen",[1380]],["Tuples.inSetOfPairsE",[1381]],["Tuples.inSetOfPairsI",[1382]],["Tuples.inSetOfPairsI_ex",[1383]],["Tuples.in_dom_imp_in_A",[1384]],["Tuples.in_ran_imp_in_B",[1385]],["Tuples.in_rel_domainE",[1386]],["Tuples.in_rel_domainI",[1387]],["Tuples.in_rel_rangeE",[1388]],["Tuples.in_rel_rangeI",[1389]],["Tuples.irreflexiveE",[1390]],["Tuples.irreflexiveI",[1391]],["Tuples.irreflexiveIsBool",[1392]],["Tuples.irreflexive_def",[1393]],["Tuples.isASeqE",[1394]],["Tuples.isASeqI",[1395]],["Tuples.isASeqInSeq",[1396]],["Tuples.isASeqIsBool",[1397]],["Tuples.isASeq_def",[1398]],["Tuples.isAppend",[1399]],["Tuples.isAppend'",[1400]],["Tuples.isEmptySeq",[1401,1402]],["Tuples.lenAppend",[1403]],["Tuples.lenAppend'",[1404]],["Tuples.lenEmptySeq",[1405]],["Tuples.pairProj_in_prod",[1406]],["Tuples.pairProj_in_rel",[1407]],["Tuples.prodEmptyIff",[1408]],["Tuples.prodEmptyIff'",[1409]],["Tuples.prodProj",[1410]],["Tuples.prod_def",[1411]],["Tuples.prod_in_dom_x_ran",[1412]],["Tuples.ran_Id",[1413]],["Tuples.ran_in_B",[1414]],["Tuples.reflI",[1415]],["Tuples.refl_comp_subset",[1416]],["Tuples.reflexiveD",[1417]],["Tuples.reflexiveIsBool",[1418]],["Tuples.reflexive_Id",[1419]],["Tuples.reflexive_converse",[1420]],["Tuples.reflexive_def",[1421]],["Tuples.reflexive_empty",[1422]],["Tuples.relProj1",[1423]],["Tuples.relProj2",[1424]],["Tuples.rel_comp_def",[1425]],["Tuples.rel_comp_distrib",[1426]],["Tuples.rel_comp_distrib2",[1427]],["Tuples.rel_comp_empty1",[1428]],["Tuples.rel_comp_empty2",[1429]],["Tuples.rel_comp_in_prod",[1430]],["Tuples.rel_comp_in_prodE",[1431]],["Tuples.rel_comp_mono",[1432]],["Tuples.rel_domain",[1433]],["Tuples.rel_domain_def",[1434]],["Tuples.rel_image_def",[1435]],["Tuples.rel_range",[1436]],["Tuples.rel_range_def",[1437]],["Tuples.seqCases",[1438]],["Tuples.seqElt",[1439]],["Tuples.seqEmptyOrAppend",[1440]],["Tuples.seqEqualE",[1441]],["Tuples.seqEqualI",[1442]],["Tuples.seqEqualIff",[1443]],["Tuples.seqFuncSet",[1444]],["Tuples.seqInSeqRange",[1445]],["Tuples.seqInduct",[1446]],["Tuples.seqLenZeroIsEmpty",[1447]],["Tuples.setOfAllPairs_eq_r",[1448]],["Tuples.setOfPairsEqual",[1449]],["Tuples.setOfPairs_cong",[1450]],["Tuples.setOfPairs_def",[1451]],["Tuples.setOfPairs_triv",[1452]],["Tuples.subrel_dom",[1453]],["Tuples.subrel_ran",[1454]],["Tuples.subsetsInProd",[1455]],["Tuples.sym_trans_comp_subset",[1456]],["Tuples.symmetricE",[1457]],["Tuples.symmetricI",[1458]],["Tuples.symmetricIsBool",[1459]],["Tuples.symmetric_Id",[1460]],["Tuples.symmetric_Int",[1461]],["Tuples.symmetric_converse",[1462]],["Tuples.symmetric_def",[1463]],["Tuples.symmetric_iff_converse_eq",[1464]],["Tuples.transD",[1465]],["Tuples.trans_Int",[1466]],["Tuples.transitiveI",[1467]],["Tuples.transitiveIsBool",[1468]],["Tuples.transitive_Id",[1469]],["Tuples.transitive_converse",[1470]],["Tuples.transitive_def",[1471]],["Tuples.transitive_iff_comp_subset",[1472]],["Zenon.atomize_meta_bAll",[1473]],["Zenon.atomize_object_bAll",[1474]],["Zenon.zenon_FALSE_neq_TRUE",[800]],["Zenon.zenon_all",[1475]],["Zenon.zenon_all_0",[1476]],["Zenon.zenon_all_in_0",[1477]],["Zenon.zenon_all_rec_1",[1478]],["Zenon.zenon_all_rec_2",[1479]],["Zenon.zenon_and",[1480]],["Zenon.zenon_and_0",[1481]],["Zenon.zenon_and_1",[1482]],["Zenon.zenon_appseq_def",[1483]],["Zenon.zenon_boolcase",[1484]],["Zenon.zenon_boolcase_all",[1485]],["Zenon.zenon_boolcase_and",[1486]],["Zenon.zenon_boolcase_equal",[1487]],["Zenon.zenon_boolcase_equiv",[1488]],["Zenon.zenon_boolcase_ex",[1489]],["Zenon.zenon_boolcase_imply",[1490]],["Zenon.zenon_boolcase_in",[1491]],["Zenon.zenon_boolcase_not",[1492]],["Zenon.zenon_boolcase_or",[1493]],["Zenon.zenon_case1",[1494]],["Zenon.zenon_case2",[1495]],["Zenon.zenon_case3",[1496]],["Zenon.zenon_case4",[1497]],["Zenon.zenon_case5",[1498]],["Zenon.zenon_case_append1",[1499]],["Zenon.zenon_case_domain",[1500]],["Zenon.zenon_case_empty_union",[1501]],["Zenon.zenon_case_len_domain",[1502]],["Zenon.zenon_case_len_simpl",[1503]],["Zenon.zenon_case_oth_empty",[1504]],["Zenon.zenon_case_oth_simpl",[1505]],["Zenon.zenon_case_oth_simpl_l1",[1506]],["Zenon.zenon_case_oth_simpl_l2",[1507]],["Zenon.zenon_case_seq_empty",[1508]],["Zenon.zenon_case_seq_simpl",[1509]],["Zenon.zenon_case_union_simpl",[1510]],["Zenon.zenon_case_union_split",[1511]],["Zenon.zenon_caseother0",[1512]],["Zenon.zenon_caseother1",[1513]],["Zenon.zenon_caseother2",[1514]],["Zenon.zenon_caseother3",[1515]],["Zenon.zenon_caseother4",[1516]],["Zenon.zenon_caseother5",[1517]],["Zenon.zenon_choose_diff_choose",[1518]],["Zenon.zenon_choose_diff_choose_0",[1519]],["Zenon.zenon_cup_subseteq",[1520]],["Zenon.zenon_cup_subseteq_0",[1521]],["Zenon.zenon_cup_subseteq_1",[1522]],["Zenon.zenon_disjE1",[1523]],["Zenon.zenon_dom_app_1",[1524]],["Zenon.zenon_dom_app_2",[1525]],["Zenon.zenon_domain_except",[1526]],["Zenon.zenon_domain_except_0",[1527]],["Zenon.zenon_domain_fcn_0",[1528]],["Zenon.zenon_em",[1529]],["Zenon.zenon_eq_false_x",[1530]],["Zenon.zenon_eq_false_x_0",[1531]],["Zenon.zenon_eq_true_x",[1532]],["Zenon.zenon_eq_true_x_0",[1533]],["Zenon.zenon_eq_x_false",[1534]],["Zenon.zenon_eq_x_false_0",[1535]],["Zenon.zenon_eq_x_true",[1536]],["Zenon.zenon_eq_x_true_0",[1537]],["Zenon.zenon_eqrefl",[1538]],["Zenon.zenon_eqsym",[1539]],["Zenon.zenon_equiv",[1540]],["Zenon.zenon_ex",[1541]],["Zenon.zenon_ex_choose",[1542]],["Zenon.zenon_ex_choose_0",[721]],["Zenon.zenon_except_notin_funcset",[1543]],["Zenon.zenon_fapplyexcept",[1544]],["Zenon.zenon_fapplyfcn",[1545]],["Zenon.zenon_funequal",[1546]],["Zenon.zenon_funequal_0",[1547]],["Zenon.zenon_iffalse",[1548]],["Zenon.zenon_iffalse_0",[1549]],["Zenon.zenon_ifthenelse",[1550]],["Zenon.zenon_iftrue",[1551]],["Zenon.zenon_iftrue_0",[1552]],["Zenon.zenon_imply",[1553]],["Zenon.zenon_in_SUBSET",[1554]],["Zenon.zenon_in_SUBSET_0",[1555]],["Zenon.zenon_in_UNION",[1556]],["Zenon.zenon_in_UNION_0",[1557]],["Zenon.zenon_in_addElt",[1558]],["Zenon.zenon_in_cap",[1559]],["Zenon.zenon_in_cap_0",[1560]],["Zenon.zenon_in_cap_1",[1561]],["Zenon.zenon_in_cup",[1562]],["Zenon.zenon_in_emptyset",[1563]],["Zenon.zenon_in_funcset",[1564]],["Zenon.zenon_in_funcset_0",[1565]],["Zenon.zenon_in_funcset_1",[1566]],["Zenon.zenon_in_funcset_2",[1567]],["Zenon.zenon_in_nat_0",[1568]],["Zenon.zenon_in_nat_1",[1569]],["Zenon.zenon_in_nat_2",[1570]],["Zenon.zenon_in_nat_succ",[1571]],["Zenon.zenon_in_nat_succ_0",[1572]],["Zenon.zenon_in_product_i",[1573]],["Zenon.zenon_in_recordset_field",[1574]],["Zenon.zenon_in_setminus",[1575]],["Zenon.zenon_in_setminus_0",[1576]],["Zenon.zenon_in_setminus_1",[1577]],["Zenon.zenon_in_setofall",[1578]],["Zenon.zenon_in_setofall_0",[1579]],["Zenon.zenon_in_subsetof",[1580]],["Zenon.zenon_in_subsetof_0",[1581]],["Zenon.zenon_in_subsetof_1",[1582]],["Zenon.zenon_in_upair",[1583]],["Zenon.zenon_inrecordsetI1",[1584]],["Zenon.zenon_inrecordsetI2",[1585]],["Zenon.zenon_inrecordsetI3",[1586]],["Zenon.zenon_inrecordsetI4",[1587]],["Zenon.zenon_inrecordsetI5",[1588]],["Zenon.zenon_inrecordsetI6",[1589]],["Zenon.zenon_inrecordsetI7",[1590]],["Zenon.zenon_isASeqSeqify",[1591]],["Zenon.zenon_nnpp",[1592]],["Zenon.zenon_not_cup_subseteq",[1593]],["Zenon.zenon_not_subseteq_cap",[1594]],["Zenon.zenon_notall",[1595]],["Zenon.zenon_notall_choose",[1596]],["Zenon.zenon_notall_choose_0",[1597]],["Zenon.zenon_notallex",[1598]],["Zenon.zenon_notallex_0",[1599]],["Zenon.zenon_notand",[1600]],["Zenon.zenon_noteq",[1601]],["Zenon.zenon_noteq_true_x",[1602]],["Zenon.zenon_noteq_true_x_0",[1603]],["Zenon.zenon_noteq_x_true",[1604]],["Zenon.zenon_noteq_x_true_0",[1605]],["Zenon.zenon_notequalchoose",[1606]],["Zenon.zenon_notequiv",[1607]],["Zenon.zenon_notex",[1608]],["Zenon.zenon_notex_0",[1609]],["Zenon.zenon_notex_in_0",[1610]],["Zenon.zenon_notfunequal",[1611]],["Zenon.zenon_notfunequal_0",[1612]],["Zenon.zenon_notimply",[1613]],["Zenon.zenon_notimply_0",[1614]],["Zenon.zenon_notimply_1",[1615]],["Zenon.zenon_notin_SUBSET",[1616]],["Zenon.zenon_notin_SUBSET_0",[1617]],["Zenon.zenon_notin_UNION",[1618]],["Zenon.zenon_notin_UNION_0",[1619]],["Zenon.zenon_notin_addElt",[1620]],["Zenon.zenon_notin_addElt_0",[1621]],["Zenon.zenon_notin_addElt_1",[1622]],["Zenon.zenon_notin_cap",[1623]],["Zenon.zenon_notin_cup",[1624]],["Zenon.zenon_notin_cup_0",[1625]],["Zenon.zenon_notin_cup_1",[1626]],["Zenon.zenon_notin_funcset",[1627]],["Zenon.zenon_notin_setminus",[1628]],["Zenon.zenon_notin_setofall",[1629]],["Zenon.zenon_notin_setofall_0",[1630]],["Zenon.zenon_notin_subsetof",[1631]],["Zenon.zenon_notin_upair",[1632]],["Zenon.zenon_notin_upair_0",[1633]],["Zenon.zenon_notin_upair_1",[1634]],["Zenon.zenon_notisafcn_except",[1635]],["Zenon.zenon_notisafcn_extend",[1636]],["Zenon.zenon_notisafcn_fcn",[1637]],["Zenon.zenon_notisafcn_onearg",[1638]],["Zenon.zenon_notnot",[1639]],["Zenon.zenon_notnot_0",[1640]],["Zenon.zenon_notor",[1641]],["Zenon.zenon_notor_0",[1642]],["Zenon.zenon_notor_1",[1643]],["Zenon.zenon_notsetequal",[1644]],["Zenon.zenon_notsetequal_0",[1645]],["Zenon.zenon_nottrue",[1646]],["Zenon.zenon_nouniverse",[1647]],["Zenon.zenon_np_eq_l",[1648]],["Zenon.zenon_np_eq_r",[1649]],["Zenon.zenon_or",[1650]],["Zenon.zenon_p_eq_l",[1651]],["Zenon.zenon_p_eq_r",[1652]],["Zenon.zenon_range_1",[1653]],["Zenon.zenon_range_2",[1654]],["Zenon.zenon_recfield_1",[1655]],["Zenon.zenon_recfield_2",[1656]],["Zenon.zenon_recfield_2b",[1657]],["Zenon.zenon_recfield_3",[1658]],["Zenon.zenon_recfield_3b",[1659]],["Zenon.zenon_sa_1",[1660]],["Zenon.zenon_sa_2",[1661]],["Zenon.zenon_sa_def",[1662]],["Zenon.zenon_sa_diff_0a",[1663]],["Zenon.zenon_sa_diff_0b",[1664]],["Zenon.zenon_sa_diff_1",[1665]],["Zenon.zenon_sa_diff_2",[1666]],["Zenon.zenon_sa_diff_3",[1667]],["Zenon.zenon_sa_seq",[1668]],["Zenon.zenon_seqifyIsASeq",[1669]],["Zenon.zenon_seqify_appseq",[1670]],["Zenon.zenon_seqify_def",[1671]],["Zenon.zenon_seqify_empty",[1672]],["Zenon.zenon_set_rev_1",[1673]],["Zenon.zenon_set_rev_2",[1674]],["Zenon.zenon_set_rev_3",[1675]],["Zenon.zenon_setequal",[1676]],["Zenon.zenon_setequal_0",[1677]],["Zenon.zenon_setequalempty",[1678]],["Zenon.zenon_setequalempty_0",[1679]],["Zenon.zenon_ss_1",[1680]],["Zenon.zenon_ss_2",[1681]],["Zenon.zenon_ss_def",[1682]],["Zenon.zenon_ss_le_sa_1",[1683]],["Zenon.zenon_ss_le_sa_2",[1684]],["Zenon.zenon_ss_nat",[1685]],["Zenon.zenon_stringdiffll",[1686]],["Zenon.zenon_stringdifflr",[1687]],["Zenon.zenon_stringdiffrl",[1688]],["Zenon.zenon_stringdiffrr",[1689]],["Zenon.zenon_subseteq_cap",[1690]],["Zenon.zenon_subseteq_cap_0",[1691]],["Zenon.zenon_subseteq_cap_1",[1692]],["Zenon.zenon_trueistrue",[1693]],["Zenon.zenon_trueistrue_0",[1694]],["Zenon.zenon_tuple_acc_1",[1695]],["Zenon.zenon_tuple_acc_2",[1696]],["Zenon.zenon_tuple_dom_1",[1697]],["Zenon.zenon_tuple_dom_2",[1698]],["Zenon.zenon_tuple_dom_3",[1699]],["Zenon.zenon_zero_lt",[1700]]],"factNames":[["CaseArm_def","CaseExpressions.CaseArm_def"],["CaseOther_def","CaseExpressions.CaseOther_def"],["Case_def","CaseExpressions.Case_def"],["Case_simps","CaseExpressions.Case_simps"],["Monotonic_def","FixedPoints.Monotonic_def"],["gfpFixedPoint","FixedPoints.gfpFixedPoint"],["gfpGreatestFixedPoint","FixedPoints.gfpGreatestFixedPoint"],["gfpLUB","FixedPoints.gfpLUB"],["gfpMono","FixedPoints.gfpMono"],["gfpPostFP","FixedPoints.gfpPostFP"],["gfpPreFP","FixedPoints.gfpPreFP"],["gfpSubsetDomain","FixedPoints.gfpSubsetDomain"],["gfpUB","FixedPoints.gfpUB"],["gfp_def","FixedPoints.gfp_def"],["lfpFixedPoint","FixedPoints.lfpFixedPoint"],["lfpGLB","FixedPoints.lfpGLB"],["lfpLB","FixedPoints.lfpLB"],["lfpLeastFixedPoint","FixedPoints.lfpLeastFixedPoint"],["lfpMono","FixedPoints.lfpMono"],["lfpPostFP","FixedPoints.lfpPostFP"],["lfpPreFP","FixedPoints.lfpPreFP"],["lfpSubsetDomain","FixedPoints.lfpSubsetDomain"],["lfp_def","FixedPoints.lfp_def"],["monotonicDomain","FixedPoints.monotonicDomain"],["monotonicInter","FixedPoints.monotonicInter"],["monotonicSubset","FixedPoints.monotonicSubset"],["monotonicSubsetDomain","FixedPoints.monotonicSubsetDomain"],["monotonicUnion","FixedPoints.monotonicUnion"],["Bijections_def","Functions.Bijections_def"],["DOMAIN","Functions.DOMAIN"],["FuncSet","Functions.FuncSet"],["Image_def","Functions.Image_def"],["Injections_def","Functions.Injections_def"],["InjectiveOn_def","Functions.InjectiveOn_def"],["Inverse","Functions.Inverse"],["Inverse_def","Functions.Inverse_def"],["Surjections_def","Functions.Surjections_def"],["Surjective_def","Functions.Surjective_def"],["applyExcept","Functions.applyExcept"],["bijectionsE","Functions.bijectionsE"],["bijectionsI","Functions.bijectionsI"],["bijectionsInjections","Functions.bijectionsInjections"],["bijectionsSurjections","Functions.bijectionsSurjections"],["boolifyInjectiveOn","Functions.boolifyInjectiveOn"],["boolifyIsAFcn","Functions.boolifyIsAFcn"],["boolifySurjective","Functions.boolifySurjective"],["domainExcept","Functions.domainExcept"],["exceptEqual","Functions.exceptEqual"],["exceptI","Functions.exceptI"],["exceptInFuncSet","Functions.exceptInFuncSet"],["exceptInFuncSetSame","Functions.exceptInFuncSetSame"],["exceptTrivial","Functions.exceptTrivial"],["except_def","Functions.except_def"],["extendDomain","Functions.extendDomain"],["extendEqualIff","Functions.extendEqualIff"],["extendFuncSet","Functions.extendFuncSet"],["extendIsAFcn","Functions.extendIsAFcn"],["extendVal","Functions.extendVal"],["extend_def","Functions.extend_def"],["fapply","Functions.fapply"],["fcnCong","Functions.fcnCong"],["fcnConstruct","Functions.fcnConstruct"],["fcnEqual","Functions.fcnEqual"],["fcnEqual2","Functions.fcnEqual2"],["fcnEqualIff","Functions.fcnEqualIff"],["fcnIsAFcn","Functions.fcnIsAFcn"],["funcSetDomain","Functions.funcSetDomain"],["funcSetE","Functions.funcSetE"],["funcSetE'","Functions.funcSetE'"],["funcSetEmpty","Functions.funcSetEmpty"],["funcSetFcnEqual","Functions.funcSetFcnEqual"],["funcSetIsAFcn","Functions.funcSetIsAFcn"],["funcSetSubRange","Functions.funcSetSubRange"],["funcSetValue","Functions.funcSetValue"],["functionInFuncSet","Functions.functionInFuncSet"],["imageE","Functions.imageE"],["imageEmpty","Functions.imageEmpty"],["imageEqualI","Functions.imageEqualI"],["imageI","Functions.imageI"],["imageI_eq","Functions.imageI_eq"],["imageI_exEq","Functions.imageI_exEq"],["inFuncSet","Functions.inFuncSet"],["inFuncSetIff","Functions.inFuncSetIff"],["inImageiff","Functions.inImageiff"],["injectionsE","Functions.injectionsE"],["injectionsI","Functions.injectionsI"],["injectiveExtend","Functions.injectiveExtend"],["injectiveIffExistsInverse","Functions.injectiveIffExistsInverse"],["injectiveImageEqual","Functions.injectiveImageEqual"],["injectiveImageMember","Functions.injectiveImageMember"],["injectiveImageSubset","Functions.injectiveImageSubset"],["injectiveInverse","Functions.injectiveInverse"],["injectiveOnD","Functions.injectiveOnD"],["injectiveOnE","Functions.injectiveOnE"],["injectiveOnEmpty","Functions.injectiveOnEmpty"],["injectiveOnExcept","Functions.injectiveOnExcept"],["injectiveOnExtend","Functions.injectiveOnExtend"],["injectiveOnI","Functions.injectiveOnI"],["injectiveOnIff","Functions.injectiveOnIff"],["injectiveOnImageInter","Functions.injectiveOnImageInter"],["injectiveOnImageSetminus","Functions.injectiveOnImageSetminus"],["injectiveOnIsBool","Functions.injectiveOnIsBool"],["injectiveOnSetminus","Functions.injectiveOnSetminus"],["injectiveOnSingleton","Functions.injectiveOnSingleton"],["injectiveOnSubset","Functions.injectiveOnSubset"],["inverseBijections","Functions.inverseBijections"],["inverseDomain","Functions.inverseDomain"],["inverseFcnSet","Functions.inverseFcnSet"],["inverseInDomain","Functions.inverseInDomain"],["inverseInjective","Functions.inverseInjective"],["inverseIsAFcn","Functions.inverseIsAFcn"],["inverseOfInjectiveSurjective","Functions.inverseOfInjectiveSurjective"],["inverseThenInjective","Functions.inverseThenInjective"],["isAFcnFuncSet","Functions.isAFcnFuncSet"],["isAFcn_def","Functions.isAFcn_def"],["isBoolIsAFcn","Functions.isBoolIsAFcn"],["oneArgDomain","Functions.oneArgDomain"],["oneArgEqual","Functions.oneArgEqual"],["oneArgEqualIff","Functions.oneArgEqualIff"],["oneArgFuncSet","Functions.oneArgFuncSet"],["oneArgIsAFcn","Functions.oneArgIsAFcn"],["oneArgVal","Functions.oneArgVal"],["oneArg_def","Functions.oneArg_def"],["rangeI","Functions.rangeI"],["surjectionsE","Functions.surjectionsE"],["surjectionsFuncSet","Functions.surjectionsFuncSet"],["surjectionsI","Functions.surjectionsI"],["surjectionsRange","Functions.surjectionsRange"],["surjectionsSurjective","Functions.surjectionsSurjective"],["surjectiveD","Functions.surjectiveD"],["surjectiveE","Functions.surjectiveE"],["surjectiveI","Functions.surjectiveI"],["surjectiveIsBool","Functions.surjectiveIsBool"],["surjectiveRange","Functions.surjectiveRange"],["surjectiveSubset","Functions.surjectiveSubset"],["SuccInIntvlSucc","IntegerArithmetic.SuccInIntvlSucc"],["SuccInIntvlSuccSucc","IntegerArithmetic.SuccInIntvlSuccSucc"],["add_0_int","IntegerArithmetic.add_0_int"],["add_ac","IntegerArithmetic.add_ac"],["add_assoc","IntegerArithmetic.add_assoc"],["add_commute","IntegerArithmetic.add_commute"],["add_diff_cancel_left","IntegerArithmetic.add_diff_cancel_left"],["add_diff_cancel_right","IntegerArithmetic.add_diff_cancel_right"],["add_diff_same_1","IntegerArithmetic.add_diff_same_1"],["add_diff_same_2","IntegerArithmetic.add_diff_same_2"],["add_eq_self1","IntegerArithmetic.add_eq_self1"],["add_eq_self2","IntegerArithmetic.add_eq_self2"],["add_ge_1","IntegerArithmetic.add_ge_1"],["add_is_0_nat","IntegerArithmetic.add_is_0_nat"],["add_is_1_nat","IntegerArithmetic.add_is_1_nat"],["add_left_cancel","IntegerArithmetic.add_left_cancel"],["add_left_commute","IntegerArithmetic.add_left_commute"],["add_left_diff_right","IntegerArithmetic.add_left_diff_right"],["add_leq_diff1","IntegerArithmetic.add_leq_diff1"],["add_leq_diff2","IntegerArithmetic.add_leq_diff2"],["add_leq_left_mono","IntegerArithmetic.add_leq_left_mono"],["add_leq_less_mono","IntegerArithmetic.add_leq_less_mono"],["add_leq_mono","IntegerArithmetic.add_leq_mono"],["add_leq_right_mono","IntegerArithmetic.add_leq_right_mono"],["add_lessD2","IntegerArithmetic.add_lessD2"],["add_less_left_mono","IntegerArithmetic.add_less_left_mono"],["add_less_leq_mono","IntegerArithmetic.add_less_leq_mono"],["add_less_mono","IntegerArithmetic.add_less_mono"],["add_less_right_mono","IntegerArithmetic.add_less_right_mono"],["add_nat_leqD1","IntegerArithmetic.add_nat_leqD1"],["add_nat_leqD2","IntegerArithmetic.add_nat_leqD2"],["add_nat_lessD1","IntegerArithmetic.add_nat_lessD1"],["add_nat_pred_leqD1","IntegerArithmetic.add_nat_pred_leqD1"],["add_nat_pred_leqD2","IntegerArithmetic.add_nat_pred_leqD2"],["add_pred_left","IntegerArithmetic.add_pred_left"],["add_right_cancel","IntegerArithmetic.add_right_cancel"],["add_right_commute","IntegerArithmetic.add_right_commute"],["add_right_diff_left","IntegerArithmetic.add_right_diff_left"],["add_succ_left","IntegerArithmetic.add_succ_left"],["add_times_distrib_left","IntegerArithmetic.add_times_distrib_left"],["add_times_distrib_right","IntegerArithmetic.add_times_distrib_right"],["add_uminus_pred_left","IntegerArithmetic.add_uminus_pred_left"],["add_uminus_succ_left","IntegerArithmetic.add_uminus_succ_left"],["addintNat","IntegerArithmetic.addintNat"],["addintType","IntegerArithmetic.addintType"],["addint_0_left","IntegerArithmetic.addint_0_left"],["addint_def","IntegerArithmetic.addint_def"],["addint_pred","IntegerArithmetic.addint_pred"],["addint_succ","IntegerArithmetic.addint_succ"],["addint_uminus_self","IntegerArithmetic.addint_uminus_self"],["boolify_leq","IntegerArithmetic.boolify_leq"],["boolify_less","IntegerArithmetic.boolify_less"],["diff_0_eq","IntegerArithmetic.diff_0_eq"],["diff_0_eqs","IntegerArithmetic.diff_0_eqs"],["diff_add_same_1","IntegerArithmetic.diff_add_same_1"],["diff_add_same_2","IntegerArithmetic.diff_add_same_2"],["diff_diff_left","IntegerArithmetic.diff_diff_left"],["diff_nat_leq_self1","IntegerArithmetic.diff_nat_leq_self1"],["diff_nat_leq_self2","IntegerArithmetic.diff_nat_leq_self2"],["eq_leq_bothE","IntegerArithmetic.eq_leq_bothE"],["eq_leq_trans","IntegerArithmetic.eq_leq_trans"],["eq_less_trans","IntegerArithmetic.eq_less_trans"],["gtNotinIntvl","IntegerArithmetic.gtNotinIntvl"],["int_add_left_cancel_leq","IntegerArithmetic.int_add_left_cancel_leq"],["int_add_left_cancel_less","IntegerArithmetic.int_add_left_cancel_less"],["int_add_left_cancel_pred_leq","IntegerArithmetic.int_add_left_cancel_pred_leq"],["int_add_left_cancel_succ_leq","IntegerArithmetic.int_add_left_cancel_succ_leq"],["int_add_right_cancel_leq","IntegerArithmetic.int_add_right_cancel_leq"],["int_add_right_cancel_less","IntegerArithmetic.int_add_right_cancel_less"],["int_add_right_cancel_pred_less","IntegerArithmetic.int_add_right_cancel_pred_less"],["int_add_right_cancel_succ_less","IntegerArithmetic.int_add_right_cancel_succ_less"],["int_antisym_conv1","IntegerArithmetic.int_antisym_conv1"],["int_antisym_conv2","IntegerArithmetic.int_antisym_conv2"],["int_antisym_conv3","IntegerArithmetic.int_antisym_conv3"],["int_distrib","IntegerArithmetic.int_distrib"],["int_leqE","IntegerArithmetic.int_leqE"],["int_leqI","IntegerArithmetic.int_leqI"],["int_leq_antisym","IntegerArithmetic.int_leq_antisym"],["int_leq_cases","IntegerArithmetic.int_leq_cases"],["int_leq_def","IntegerArithmetic.int_leq_def"],["int_leq_iff_add","IntegerArithmetic.int_leq_iff_add"],["int_leq_iff_zero_leq_diff","IntegerArithmetic.int_leq_iff_zero_leq_diff"],["int_leq_imp_add","IntegerArithmetic.int_leq_imp_add"],["int_leq_induct","IntegerArithmetic.int_leq_induct"],["int_leq_inductE","IntegerArithmetic.int_leq_inductE"],["int_leq_is_less_succ","IntegerArithmetic.int_leq_is_less_succ"],["int_leq_is_pred_less","IntegerArithmetic.int_leq_is_pred_less"],["int_leq_less","IntegerArithmetic.int_leq_less"],["int_leq_lessE","IntegerArithmetic.int_leq_lessE"],["int_leq_less_linear","IntegerArithmetic.int_leq_less_linear"],["int_leq_less_trans","IntegerArithmetic.int_leq_less_trans"],["int_leq_limit_1","IntegerArithmetic.int_leq_limit_1"],["int_leq_limit_2","IntegerArithmetic.int_leq_limit_2"],["int_leq_linear","IntegerArithmetic.int_leq_linear"],["int_leq_not_less","IntegerArithmetic.int_leq_not_less"],["int_leq_predE","IntegerArithmetic.int_leq_predE"],["int_leq_predI","IntegerArithmetic.int_leq_predI"],["int_leq_pred_iff","IntegerArithmetic.int_leq_pred_iff"],["int_leq_pred_is_succ_leq","IntegerArithmetic.int_leq_pred_is_succ_leq"],["int_leq_refl","IntegerArithmetic.int_leq_refl"],["int_leq_succ","IntegerArithmetic.int_leq_succ"],["int_leq_succE","IntegerArithmetic.int_leq_succE"],["int_leq_succI","IntegerArithmetic.int_leq_succI"],["int_leq_succ_iff","IntegerArithmetic.int_leq_succ_iff"],["int_leq_trans","IntegerArithmetic.int_leq_trans"],["int_leq_uminus","IntegerArithmetic.int_leq_uminus"],["int_leq_uminus_succ_iff","IntegerArithmetic.int_leq_uminus_succ_iff"],["int_lessE","IntegerArithmetic.int_lessE"],["int_lessI","IntegerArithmetic.int_lessI"],["int_less_antisym","IntegerArithmetic.int_less_antisym"],["int_less_antisym_false","IntegerArithmetic.int_less_antisym_false"],["int_less_asym","IntegerArithmetic.int_less_asym"],["int_less_cases","IntegerArithmetic.int_less_cases"],["int_less_iff_succ_add","IntegerArithmetic.int_less_iff_succ_add"],["int_less_iff_zero_less_diff","IntegerArithmetic.int_less_iff_zero_less_diff"],["int_less_imp_succ_add","IntegerArithmetic.int_less_imp_succ_add"],["int_less_leq_not_leq","IntegerArithmetic.int_less_leq_not_leq"],["int_less_leq_trans","IntegerArithmetic.int_less_leq_trans"],["int_less_linear","IntegerArithmetic.int_less_linear"],["int_less_mono_imp_leq_mono","IntegerArithmetic.int_less_mono_imp_leq_mono"],["int_less_not_leq","IntegerArithmetic.int_less_not_leq"],["int_less_not_sym","IntegerArithmetic.int_less_not_sym"],["int_less_pred_is_succ_less","IntegerArithmetic.int_less_pred_is_succ_less"],["int_less_succ","IntegerArithmetic.int_less_succ"],["int_less_succE","IntegerArithmetic.int_less_succE"],["int_less_succ_same","IntegerArithmetic.int_less_succ_same"],["int_less_trans","IntegerArithmetic.int_less_trans"],["int_less_uminus","IntegerArithmetic.int_less_uminus"],["int_neq_iff","IntegerArithmetic.int_neq_iff"],["int_neq_lessE","IntegerArithmetic.int_neq_lessE"],["int_not_leq_pred","IntegerArithmetic.int_not_leq_pred"],["int_not_succ_leq","IntegerArithmetic.int_not_succ_leq"],["int_pred_leq","IntegerArithmetic.int_pred_leq"],["int_pred_leqE","IntegerArithmetic.int_pred_leqE"],["int_pred_leqI","IntegerArithmetic.int_pred_leqI"],["int_pred_leq_iff","IntegerArithmetic.int_pred_leq_iff"],["int_pred_leq_is_leq_succ","IntegerArithmetic.int_pred_leq_is_leq_succ"],["int_pred_leq_pred","IntegerArithmetic.int_pred_leq_pred"],["int_pred_leq_predI","IntegerArithmetic.int_pred_leq_predI"],["int_pred_less","IntegerArithmetic.int_pred_less"],["int_pred_less_is_less_succ","IntegerArithmetic.int_pred_less_is_less_succ"],["int_pred_less_pred","IntegerArithmetic.int_pred_less_pred"],["int_pred_less_predE","IntegerArithmetic.int_pred_less_predE"],["int_pred_less_predI","IntegerArithmetic.int_pred_less_predI"],["int_pred_less_same","IntegerArithmetic.int_pred_less_same"],["int_succ_leqE","IntegerArithmetic.int_succ_leqE"],["int_succ_leqI","IntegerArithmetic.int_succ_leqI"],["int_succ_leq_iff","IntegerArithmetic.int_succ_leq_iff"],["int_succ_leq_predE","IntegerArithmetic.int_succ_leq_predE"],["int_succ_leq_succ","IntegerArithmetic.int_succ_leq_succ"],["int_succ_leq_succE","IntegerArithmetic.int_succ_leq_succE"],["int_succ_leq_succI","IntegerArithmetic.int_succ_leq_succI"],["int_succ_lessI","IntegerArithmetic.int_succ_lessI"],["int_succ_less_succ","IntegerArithmetic.int_succ_less_succ"],["int_succ_less_succE","IntegerArithmetic.int_succ_less_succE"],["int_succ_less_succI","IntegerArithmetic.int_succ_less_succI"],["int_uminus_pred_leq_iff","IntegerArithmetic.int_uminus_pred_leq_iff"],["int_uminus_zero","IntegerArithmetic.int_uminus_zero"],["intvlE","IntegerArithmetic.intvlE"],["intvlEmpty_iff","IntegerArithmetic.intvlEmpty_iff"],["intvlEqual_iff","IntegerArithmetic.intvlEqual_iff"],["intvlI","IntegerArithmetic.intvlI"],["intvlIff","IntegerArithmetic.intvlIff"],["intvlIsEmpty","IntegerArithmetic.intvlIsEmpty"],["intvlSingleton","IntegerArithmetic.intvlSingleton"],["intvlSucc","IntegerArithmetic.intvlSucc"],["intvl_def","IntegerArithmetic.intvl_def"],["leq_add_nat1","IntegerArithmetic.leq_add_nat1"],["leq_add_nat2","IntegerArithmetic.leq_add_nat2"],["leq_add_self1","IntegerArithmetic.leq_add_self1"],["leq_add_self2","IntegerArithmetic.leq_add_self2"],["leq_eq_trans","IntegerArithmetic.leq_eq_trans"],["leq_isBool","IntegerArithmetic.leq_isBool"],["leq_neq_iff_less","IntegerArithmetic.leq_neq_iff_less"],["leq_neq_iff_less_sym","IntegerArithmetic.leq_neq_iff_less_sym"],["leq_neq_trans","IntegerArithmetic.leq_neq_trans"],["leq_neq_trans_sym","IntegerArithmetic.leq_neq_trans_sym"],["less_add_Succ2","IntegerArithmetic.less_add_Succ2"],["less_def","IntegerArithmetic.less_def"],["less_eq_trans","IntegerArithmetic.less_eq_trans"],["less_imp_add_positive","IntegerArithmetic.less_imp_add_positive"],["less_imp_leq","IntegerArithmetic.less_imp_leq"],["less_irrefl","IntegerArithmetic.less_irrefl"],["less_irreflE","IntegerArithmetic.less_irreflE"],["less_isBool","IntegerArithmetic.less_isBool"],["less_not_refl","IntegerArithmetic.less_not_refl"],["less_succ_add_nat1","IntegerArithmetic.less_succ_add_nat1"],["mult_eq_self1","IntegerArithmetic.mult_eq_self1"],["mult_eq_self2","IntegerArithmetic.mult_eq_self2"],["multintType","IntegerArithmetic.multintType"],["multint_def","IntegerArithmetic.multint_def"],["nat_add_gt_0","IntegerArithmetic.nat_add_gt_0"],["nat_gt0_not0","IntegerArithmetic.nat_gt0_not0"],["nat_is_int_geq0","IntegerArithmetic.nat_is_int_geq0"],["nat_leq_induct","IntegerArithmetic.nat_leq_induct"],["nat_leq_inductE","IntegerArithmetic.nat_leq_inductE"],["nat_leq_times_left","IntegerArithmetic.nat_leq_times_left"],["nat_leq_times_right","IntegerArithmetic.nat_leq_times_right"],["nat_leq_zero","IntegerArithmetic.nat_leq_zero"],["nat_less_antisym_leq_false","IntegerArithmetic.nat_less_antisym_leq_false"],["nat_less_mono_imp_leq_mono","IntegerArithmetic.nat_less_mono_imp_leq_mono"],["nat_less_one","IntegerArithmetic.nat_less_one"],["nat_less_times_left","IntegerArithmetic.nat_less_times_left"],["nat_less_times_right","IntegerArithmetic.nat_less_times_right"],["nat_less_trans_Succ","IntegerArithmetic.nat_less_trans_Succ"],["nat_neq0_conv","IntegerArithmetic.nat_neq0_conv"],["nat_zero_leq","IntegerArithmetic.nat_zero_leq"],["nat_zero_less_succ","IntegerArithmetic.nat_zero_less_succ"],["neq_leq_trans","IntegerArithmetic.neq_leq_trans"],["neq_leq_trans_sym","IntegerArithmetic.neq_leq_trans_sym"],["not_leq_less","IntegerArithmetic.not_leq_less"],["not_less_leq","IntegerArithmetic.not_less_leq"],["one_is_add_nat","IntegerArithmetic.one_is_add_nat"],["one_is_times_iff","IntegerArithmetic.one_is_times_iff"],["onetoInj","IntegerArithmetic.onetoInj"],["onetoInj'","IntegerArithmetic.onetoInj'"],["pr_addintType","IntegerArithmetic.pr_addintType"],["pr_addint_0","IntegerArithmetic.pr_addint_0"],["pr_addint_SuccNat","IntegerArithmetic.pr_addint_SuccNat"],["pr_addint_def","IntegerArithmetic.pr_addint_def"],["pr_addint_uminusSuccNat","IntegerArithmetic.pr_addint_uminusSuccNat"],["pr_multintType","IntegerArithmetic.pr_multintType"],["pr_multint_0","IntegerArithmetic.pr_multint_0"],["pr_multint_SuccNat","IntegerArithmetic.pr_multint_SuccNat"],["pr_multint_def","IntegerArithmetic.pr_multint_def"],["pr_multint_uminusSuccNat","IntegerArithmetic.pr_multint_uminusSuccNat"],["pred_add_eq_self1","IntegerArithmetic.pred_add_eq_self1"],["pred_add_eq_self2","IntegerArithmetic.pred_add_eq_self2"],["pred_geq_0","IntegerArithmetic.pred_geq_0"],["pred_leq_0","IntegerArithmetic.pred_leq_0"],["pred_succ_add","IntegerArithmetic.pred_succ_add"],["subint_pred","IntegerArithmetic.subint_pred"],["subint_self","IntegerArithmetic.subint_self"],["subint_succ","IntegerArithmetic.subint_succ"],["succIntvl","IntegerArithmetic.succIntvl"],["succ_add_eq_self1","IntegerArithmetic.succ_add_eq_self1"],["succ_add_eq_self2","IntegerArithmetic.succ_add_eq_self2"],["succ_geq_0","IntegerArithmetic.succ_geq_0"],["succ_leq_0","IntegerArithmetic.succ_leq_0"],["succ_nat_not_neg","IntegerArithmetic.succ_nat_not_neg"],["succ_pred_add","IntegerArithmetic.succ_pred_add"],["times_0","IntegerArithmetic.times_0"],["times_0_left","IntegerArithmetic.times_0_left"],["times_ac","IntegerArithmetic.times_ac"],["times_assoc","IntegerArithmetic.times_assoc"],["times_cancel1","IntegerArithmetic.times_cancel1"],["times_cancel2","IntegerArithmetic.times_cancel2"],["times_commute","IntegerArithmetic.times_commute"],["times_is_0_iff","IntegerArithmetic.times_is_0_iff"],["times_is_1_iff","IntegerArithmetic.times_is_1_iff"],["times_left_commute","IntegerArithmetic.times_left_commute"],["times_leq_left_neg_cancel","IntegerArithmetic.times_leq_left_neg_cancel"],["times_leq_left_neg_mono","IntegerArithmetic.times_leq_left_neg_mono"],["times_leq_left_pos_cancel","IntegerArithmetic.times_leq_left_pos_cancel"],["times_leq_left_pos_mono","IntegerArithmetic.times_leq_left_pos_mono"],["times_leq_right_neg_cancel","IntegerArithmetic.times_leq_right_neg_cancel"],["times_leq_right_neg_mono","IntegerArithmetic.times_leq_right_neg_mono"],["times_leq_right_pos_cancel","IntegerArithmetic.times_leq_right_pos_cancel"],["times_leq_right_pos_mono","IntegerArithmetic.times_leq_right_pos_mono"],["times_less_left_neg_cancel","IntegerArithmetic.times_less_left_neg_cancel"],["times_less_left_neg_mono","IntegerArithmetic.times_less_left_neg_mono"],["times_less_left_pos_cancel","IntegerArithmetic.times_less_left_pos_cancel"],["times_less_left_pos_mono","IntegerArithmetic.times_less_left_pos_mono"],["times_less_right_neg_cancel","IntegerArithmetic.times_less_right_neg_cancel"],["times_less_right_neg_mono","IntegerArithmetic.times_less_right_neg_mono"],["times_less_right_pos_cancel","IntegerArithmetic.times_less_right_pos_cancel"],["times_less_right_pos_mono","IntegerArithmetic.times_less_right_pos_mono"],["times_nat","IntegerArithmetic.times_nat"],["times_neg","IntegerArithmetic.times_neg"],["times_pos","IntegerArithmetic.times_pos"],["times_pred","IntegerArithmetic.times_pred"],["times_pred_left","IntegerArithmetic.times_pred_left"],["times_right_commute","IntegerArithmetic.times_right_commute"],["times_succ","IntegerArithmetic.times_succ"],["times_succ_left","IntegerArithmetic.times_succ_left"],["times_uminus_left","IntegerArithmetic.times_uminus_left"],["times_uminus_right","IntegerArithmetic.times_uminus_right"],["trans_leq_add_nat1","IntegerArithmetic.trans_leq_add_nat1"],["trans_leq_add_nat2","IntegerArithmetic.trans_leq_add_nat2"],["trans_leq_diff_nat1","IntegerArithmetic.trans_leq_diff_nat1"],["trans_leq_diff_nat2","IntegerArithmetic.trans_leq_diff_nat2"],["trans_leq_less_add_nat1","IntegerArithmetic.trans_leq_less_add_nat1"],["trans_leq_less_add_nat2","IntegerArithmetic.trans_leq_less_add_nat2"],["trans_less_add_nat1","IntegerArithmetic.trans_less_add_nat1"],["trans_less_add_nat2","IntegerArithmetic.trans_less_add_nat2"],["trans_less_diff_nat1","IntegerArithmetic.trans_less_diff_nat1"],["uminus_add","IntegerArithmetic.uminus_add"],["uminus_leq_nat","IntegerArithmetic.uminus_leq_nat"],["uminus_leq_zero","IntegerArithmetic.uminus_leq_zero"],["zero_is_add_nat","IntegerArithmetic.zero_is_add_nat"],["zero_istimes_iff","IntegerArithmetic.zero_istimes_iff"],["zero_leq_not_less_zero","IntegerArithmetic.zero_leq_not_less_zero"],["zero_less_not_leq_zero","IntegerArithmetic.zero_less_not_leq_zero"],["zerotoEmpty","IntegerArithmetic.zerotoEmpty"],["zerotoInj","IntegerArithmetic.zerotoInj"],["zerotoInj'","IntegerArithmetic.zerotoInj'"],["add_div","IntegerDivision.add_div"],["add_mod","IntegerDivision.add_mod"],["boolify_dvd","IntegerDivision.boolify_dvd"],["div_equal","IntegerDivision.div_equal"],["div_exists","IntegerDivision.div_exists"],["div_is_minusone_iff","IntegerDivision.div_is_minusone_iff"],["div_is_zero_iff","IntegerDivision.div_is_zero_iff"],["div_mod_by_one","IntegerDivision.div_mod_by_one"],["div_mod_by_self","IntegerDivision.div_mod_by_self"],["div_mod_decomposition","IntegerDivision.div_mod_decomposition"],["div_mod_minus_divisor1","IntegerDivision.div_mod_minus_divisor1"],["div_mod_minus_divisor2","IntegerDivision.div_mod_minus_divisor2"],["div_mod_minus_less_divisor","IntegerDivision.div_mod_minus_less_divisor"],["div_mod_nat_less_divisor","IntegerDivision.div_mod_nat_less_divisor"],["div_mod_plus_divisor1","IntegerDivision.div_mod_plus_divisor1"],["div_mod_plus_divisor2","IntegerDivision.div_mod_plus_divisor2"],["div_mod_unique","IntegerDivision.div_mod_unique"],["div_times_divisor1","IntegerDivision.div_times_divisor1"],["div_times_divisor2","IntegerDivision.div_times_divisor2"],["div_times_divisor3","IntegerDivision.div_times_divisor3"],["div_times_divisor4","IntegerDivision.div_times_divisor4"],["div_type","IntegerDivision.div_type"],["dvdE","IntegerDivision.dvdE"],["dvdI","IntegerDivision.dvdI"],["dvdIsBool","IntegerDivision.dvdIsBool"],["dvd_0_left","IntegerDivision.dvd_0_left"],["dvd_0_left_iff","IntegerDivision.dvd_0_left_iff"],["dvd_0_right","IntegerDivision.dvd_0_right"],["dvd_add","IntegerDivision.dvd_add"],["dvd_def","IntegerDivision.dvd_def"],["dvd_is_mod0","IntegerDivision.dvd_is_mod0"],["dvd_mod_imp_dvd","IntegerDivision.dvd_mod_imp_dvd"],["dvd_mult","IntegerDivision.dvd_mult"],["dvd_mult2","IntegerDivision.dvd_mult2"],["dvd_mult_left","IntegerDivision.dvd_mult_left"],["dvd_mult_right","IntegerDivision.dvd_mult_right"],["dvd_refl","IntegerDivision.dvd_refl"],["dvd_times_div_distrib","IntegerDivision.dvd_times_div_distrib"],["dvd_times_div_self","IntegerDivision.dvd_times_div_self"],["dvd_trans","IntegerDivision.dvd_trans"],["dvd_triv_left","IntegerDivision.dvd_triv_left"],["dvd_triv_right","IntegerDivision.dvd_triv_right"],["int_div_def","IntegerDivision.int_div_def"],["mod_def","IntegerDivision.mod_def"],["mod_div_equality","IntegerDivision.mod_div_equality"],["mod_div_equality2","IntegerDivision.mod_div_equality2"],["mod_div_equality3","IntegerDivision.mod_div_equality3"],["mod_div_equality4","IntegerDivision.mod_div_equality4"],["mod_div_same","IntegerDivision.mod_div_same"],["mod_equal","IntegerDivision.mod_equal"],["mod_is_self_iff","IntegerDivision.mod_is_self_iff"],["mod_mod_same","IntegerDivision.mod_mod_same"],["mod_range","IntegerDivision.mod_range"],["mod_times_divisor1","IntegerDivision.mod_times_divisor1"],["mod_times_divisor2","IntegerDivision.mod_times_divisor2"],["mod_times_divisor3","IntegerDivision.mod_times_divisor3"],["mod_times_divisor4","IntegerDivision.mod_times_divisor4"],["mod_type","IntegerDivision.mod_type"],["mult_dvd_mono","IntegerDivision.mult_dvd_mono"],["one_dvd","IntegerDivision.one_dvd"],["times_div","IntegerDivision.times_div"],["times_div_self1","IntegerDivision.times_div_self1"],["times_div_self2","IntegerDivision.times_div_self2"],["times_mod","IntegerDivision.times_mod"],["times_mod_self1","IntegerDivision.times_mod_self1"],["times_mod_self2","IntegerDivision.times_mod_self2"],["uminus_div1","IntegerDivision.uminus_div1"],["uminus_div2","IntegerDivision.uminus_div2"],["uminus_mod1","IntegerDivision.uminus_mod1"],["uminus_mod2","IntegerDivision.uminus_mod2"],["ExtendedPeano_def","Integers.ExtendedPeano_def"],["Int_def","Integers.Int_def"],["Nat_def","Integers.Nat_def"],["SuccInNatNat","Integers.SuccInNatNat"],["SuccInj","Integers.SuccInj"],["SuccInjIff","Integers.SuccInjIff"],["SuccIsAFcn","Integers.SuccIsAFcn"],["SuccIsNat","Integers.SuccIsNat"],["SuccNotUptoZero","Integers.SuccNotUptoZero"],["SuccNotZero","Integers.SuccNotZero"],["Succ_def","Integers.Succ_def"],["bprimrec_int","Integers.bprimrec_int"],["bprimrec_nat","Integers.bprimrec_nat"],["diffInduct","Integers.diffInduct"],["diffInduction","Integers.diffInduction"],["domainSucc","Integers.domainSucc"],["eight_def","Integers.eight_def"],["eleven_def","Integers.eleven_def"],["extendedPeanoExists","Integers.extendedPeanoExists"],["fifteen_def","Integers.fifteen_def"],["five_def","Integers.five_def"],["four_def","Integers.four_def"],["fourteen_def","Integers.fourteen_def"],["intCases","Integers.intCases"],["intCplt_def","Integers.intCplt_def"],["intElim","Integers.intElim"],["intExtendedPeano","Integers.intExtendedPeano"],["intInduct","Integers.intInduct"],["intInductE","Integers.intInductE"],["intIsSucc","Integers.intIsSucc"],["intZeroPosNeg","Integers.intZeroPosNeg"],["int_primrecE","Integers.int_primrecE"],["int_primrecType","Integers.int_primrecType"],["int_primrec_def","Integers.int_primrec_def"],["natCases","Integers.natCases"],["natInduct","Integers.natInduct"],["natInductE","Integers.natInductE"],["natIsInt","Integers.natIsInt"],["nat_primrecE","Integers.nat_primrecE"],["nat_primrecType","Integers.nat_primrecType"],["nat_primrec_def","Integers.nat_primrec_def"],["nine_def","Integers.nine_def"],["not0_implies_Suc","Integers.not0_implies_Suc"],["pr_intCases","Integers.pr_intCases"],["pr_natCases","Integers.pr_natCases"],["pr_natInduct","Integers.pr_natInduct"],["pred0","Integers.pred0"],["predInNat","Integers.predInNat"],["predInj","Integers.predInj"],["predInjIff","Integers.predInjIff"],["predIrrefl","Integers.predIrrefl"],["predIrreflE","Integers.predIrreflE"],["predIrrefl_iff","Integers.predIrrefl_iff"],["predIsAFcn","Integers.predIsAFcn"],["predSucc","Integers.predSucc"],["predType","Integers.predType"],["predValue","Integers.predValue"],["pred_def","Integers.pred_def"],["primrec_int","Integers.primrec_int"],["primrec_int_upto_def","Integers.primrec_int_upto_def"],["primrec_int_upto_deterministic","Integers.primrec_int_upto_deterministic"],["primrec_int_upto_exists","Integers.primrec_int_upto_exists"],["primrec_nat","Integers.primrec_nat"],["primrec_nat_upto_def","Integers.primrec_nat_upto_def"],["primrec_nat_upto_deterministic","Integers.primrec_nat_upto_deterministic"],["primrec_nat_upto_exists","Integers.primrec_nat_upto_exists"],["seven_def","Integers.seven_def"],["six_def","Integers.six_def"],["succInNat","Integers.succInNat"],["succInj","Integers.succInj"],["succInjIff","Integers.succInjIff"],["succIrrefl","Integers.succIrrefl"],["succIrreflE","Integers.succIrreflE"],["succIrrefl_iff","Integers.succIrrefl_iff"],["succIs0","Integers.succIs0"],["succIsAFcn","Integers.succIsAFcn"],["succIsSucc","Integers.succIsSucc"],["succIsUminus","Integers.succIsUminus"],["succNatNotNeg","Integers.succNatNotNeg"],["succNatNotZero","Integers.succNatNotZero"],["succNatZeroIff","Integers.succNatZeroIff"],["succNotinUpto","Integers.succNotinUpto"],["succPred","Integers.succPred"],["succType","Integers.succType"],["succUminusSucc","Integers.succUminusSucc"],["succUminusSuccNat","Integers.succUminusSuccNat"],["succ_def","Integers.succ_def"],["ten_def","Integers.ten_def"],["thirteen_def","Integers.thirteen_def"],["three_def","Integers.three_def"],["twelve_def","Integers.twelve_def"],["two_def","Integers.two_def"],["uminusInj","Integers.uminusInj"],["uminusInjIff","Integers.uminusInjIff"],["uminusIsInt","Integers.uminusIsInt"],["uminusIsSucc","Integers.uminusIsSucc"],["uminusNat","Integers.uminusNat"],["uminusPred","Integers.uminusPred"],["uminusReflZero","Integers.uminusReflZero"],["uminusSucc","Integers.uminusSucc"],["uminusSwap","Integers.uminusSwap"],["uminusUminus","Integers.uminusUminus"],["uminusZero","Integers.uminusZero"],["uminusZero'","Integers.uminusZero'"],["uminus_def","Integers.uminus_def"],["uptoAntisym","Integers.uptoAntisym"],["uptoInduct","Integers.uptoInduct"],["uptoInj","Integers.uptoInj"],["uptoLimit","Integers.uptoLimit"],["uptoLinear","Integers.uptoLinear"],["uptoNat","Integers.uptoNat"],["uptoPred","Integers.uptoPred"],["uptoRefl","Integers.uptoRefl"],["uptoSucc","Integers.uptoSucc"],["uptoTrans","Integers.uptoTrans"],["uptoZero","Integers.uptoZero"],["upto_def","Integers.upto_def"],["zeroInUpto","Integers.zeroInUpto"],["zeroIsInt","Integers.zeroIsInt"],["zeroIsNat","Integers.zeroIsNat"],["zeroIsSucc","Integers.zeroIsSucc"],["zero_def","Integers.zero_def"],["A_then_notA_false","PredicateLogic.A_then_notA_false"],["All_def","PredicateLogic.All_def"],["Ex_def","PredicateLogic.Ex_def"],["Let_def","PredicateLogic.Let_def"],["TrueAssumption","PredicateLogic.TrueAssumption"],["TruepropBoolify","PredicateLogic.TruepropBoolify"],["allE","PredicateLogic.allE"],["allI","PredicateLogic.allI"],["allIsBool","PredicateLogic.allIsBool"],["all_dupE","PredicateLogic.all_dupE"],["andIsBool","PredicateLogic.andIsBool"],["arbitrary_def","PredicateLogic.arbitrary_def"],["atomize_all","PredicateLogic.atomize_all"],["atomize_conj","PredicateLogic.atomize_conj"],["atomize_conjL","PredicateLogic.atomize_conjL"],["atomize_disjL","PredicateLogic.atomize_disjL"],["atomize_elimL","PredicateLogic.atomize_elimL"],["atomize_eq","PredicateLogic.atomize_eq"],["atomize_exL","PredicateLogic.atomize_exL"],["atomize_imp","PredicateLogic.atomize_imp"],["atomize_not","PredicateLogic.atomize_not"],["boolConstEqual","PredicateLogic.boolConstEqual"],["boolEqual","PredicateLogic.boolEqual"],["boolEqualIff","PredicateLogic.boolEqualIff"],["boolifyAll","PredicateLogic.boolifyAll"],["boolifyAnd","PredicateLogic.boolifyAnd"],["boolifyBoolify","PredicateLogic.boolifyBoolify"],["boolifyCond","PredicateLogic.boolifyCond"],["boolifyE","PredicateLogic.boolifyE"],["boolifyEq","PredicateLogic.boolifyEq"],["boolifyEquivalent","PredicateLogic.boolifyEquivalent"],["boolifyEx","PredicateLogic.boolifyEx"],["boolifyFalse","PredicateLogic.boolifyFalse"],["boolifyFalseI","PredicateLogic.boolifyFalseI"],["boolifyI","PredicateLogic.boolifyI"],["boolifyIff","PredicateLogic.boolifyIff"],["boolifyImp","PredicateLogic.boolifyImp"],["boolifyIsBool","PredicateLogic.boolifyIsBool"],["boolifyNot","PredicateLogic.boolifyNot"],["boolifyOr","PredicateLogic.boolifyOr"],["boolifyTrue","PredicateLogic.boolifyTrue"],["boolifyTrueFalse","PredicateLogic.boolifyTrueFalse"],["boolifyTrueI","PredicateLogic.boolifyTrueI"],["boolify_cases","PredicateLogic.boolify_cases"],["boolify_def","PredicateLogic.boolify_def"],["case_split","PredicateLogic.case_split"],["cases_atomize","PredicateLogic.cases_atomize"],["cases_atomize'","PredicateLogic.cases_atomize'"],["cases_conj","PredicateLogic.cases_conj"],["cases_conj_curry","PredicateLogic.cases_conj_curry"],["cases_conj_eq","PredicateLogic.cases_conj_eq"],["cases_equal_eq","PredicateLogic.cases_equal_eq"],["cases_forall_conj","PredicateLogic.cases_forall_conj"],["cases_forall_eq","PredicateLogic.cases_forall_eq"],["cases_implies_conj","PredicateLogic.cases_implies_conj"],["cases_implies_eq","PredicateLogic.cases_implies_eq"],["cases_rulify","PredicateLogic.cases_rulify"],["cases_rulify'","PredicateLogic.cases_rulify'"],["cases_rulify_fallback","PredicateLogic.cases_rulify_fallback"],["cases_simp","PredicateLogic.cases_simp"],["cases_trueI","PredicateLogic.cases_trueI"],["chooseI","PredicateLogic.chooseI"],["chooseI2","PredicateLogic.chooseI2"],["chooseI2_ex","PredicateLogic.chooseI2_ex"],["chooseI_ex","PredicateLogic.chooseI_ex"],["choose_det","PredicateLogic.choose_det"],["choose_equality","PredicateLogic.choose_equality"],["choose_equality'","PredicateLogic.choose_equality'"],["choose_trivial","PredicateLogic.choose_trivial"],["classical","PredicateLogic.classical"],["condCong","PredicateLogic.condCong"],["condD1","PredicateLogic.condD1"],["condD2","PredicateLogic.condD2"],["condE","PredicateLogic.condE"],["condElse","PredicateLogic.condElse"],["condF","PredicateLogic.condF"],["condFullCong","PredicateLogic.condFullCong"],["condI","PredicateLogic.condI"],["condT","PredicateLogic.condT"],["condThen","PredicateLogic.condThen"],["cond_boolE","PredicateLogic.cond_boolE"],["cond_boolI","PredicateLogic.cond_boolI"],["cond_cancel","PredicateLogic.cond_cancel"],["cond_eqLE","PredicateLogic.cond_eqLE"],["cond_eqLI","PredicateLogic.cond_eqLI"],["cond_eqRE","PredicateLogic.cond_eqRE"],["cond_eqRI","PredicateLogic.cond_eqRI"],["cond_id","PredicateLogic.cond_id"],["cond_simps","PredicateLogic.cond_simps"],["conjD1","PredicateLogic.conjD1"],["conjD2","PredicateLogic.conjD2"],["conjE","PredicateLogic.conjE"],["conjI","PredicateLogic.conjI"],["conj_comms","PredicateLogic.conj_comms"],["conj_cong","PredicateLogic.conj_cong"],["conj_def","PredicateLogic.conj_def"],["conj_simps","PredicateLogic.conj_simps"],["contradiction","PredicateLogic.contradiction"],["contrapos","PredicateLogic.contrapos"],["contrapos2","PredicateLogic.contrapos2"],["default_def","PredicateLogic.default_def"],["disjE","PredicateLogic.disjE"],["disjI","PredicateLogic.disjI"],["disjI1","PredicateLogic.disjI1"],["disjI2","PredicateLogic.disjI2"],["disj_comms","PredicateLogic.disj_comms"],["disj_cong","PredicateLogic.disj_cong"],["disj_def","PredicateLogic.disj_def"],["disj_simps","PredicateLogic.disj_simps"],["eqBoolean","PredicateLogic.eqBoolean"],["eqFalse_eqFalse","PredicateLogic.eqFalse_eqFalse"],["eqIsBool","PredicateLogic.eqIsBool"],["eqThenIff","PredicateLogic.eqThenIff"],["eqTrueD","PredicateLogic.eqTrueD"],["eqTrueI","PredicateLogic.eqTrueI"],["eq_commute","PredicateLogic.eq_commute"],["eq_false_not","PredicateLogic.eq_false_not"],["eq_reflection","PredicateLogic.eq_reflection"],["equal_arbitrary","PredicateLogic.equal_arbitrary"],["equal_default","PredicateLogic.equal_default"],["exE","PredicateLogic.exE"],["exI","PredicateLogic.exI"],["exIsBool","PredicateLogic.exIsBool"],["excluded_middle","PredicateLogic.excluded_middle"],["falseE","PredicateLogic.falseE"],["falseIsBool","PredicateLogic.falseIsBool"],["false_eq_trueE","PredicateLogic.false_eq_trueE"],["false_implies_equals","PredicateLogic.false_implies_equals"],["false_neq_true","PredicateLogic.false_neq_true"],["if_bool_equiv_conj","PredicateLogic.if_bool_equiv_conj"],["iffCE","PredicateLogic.iffCE"],["iffD1","PredicateLogic.iffD1"],["iffD2","PredicateLogic.iffD2"],["iffE","PredicateLogic.iffE"],["iffI","PredicateLogic.iffI"],["iffIsBool","PredicateLogic.iffIsBool"],["iffIsBoolifyEqual","PredicateLogic.iffIsBoolifyEqual"],["iffThenBoolifyEqual","PredicateLogic.iffThenBoolifyEqual"],["iff_cong","PredicateLogic.iff_cong"],["iff_def","PredicateLogic.iff_def"],["iff_refl","PredicateLogic.iff_refl"],["iff_simps","PredicateLogic.iff_simps"],["iff_trans","PredicateLogic.iff_trans"],["impCE","PredicateLogic.impCE"],["impCE'","PredicateLogic.impCE'"],["impE","PredicateLogic.impE"],["impI","PredicateLogic.impI"],["impIsBool","PredicateLogic.impIsBool"],["imp_cong","PredicateLogic.imp_cong"],["imp_def","PredicateLogic.imp_def"],["imp_simps","PredicateLogic.imp_simps"],["implies_true_equals","PredicateLogic.implies_true_equals"],["isBoolCond","PredicateLogic.isBoolCond"],["isBoolE","PredicateLogic.isBoolE"],["isBoolTrueFalse","PredicateLogic.isBoolTrueFalse"],["isBool_def","PredicateLogic.isBool_def"],["meta_eq_to_iff","PredicateLogic.meta_eq_to_iff"],["meta_to_obj_eq","PredicateLogic.meta_to_obj_eq"],["miniscope_all","PredicateLogic.miniscope_all"],["miniscope_ex","PredicateLogic.miniscope_ex"],["mp","PredicateLogic.mp"],["neq_conv_eq_False","PredicateLogic.neq_conv_eq_False"],["notBoolIsFalse","PredicateLogic.notBoolIsFalse"],["notBoolifyFalse","PredicateLogic.notBoolifyFalse"],["notE","PredicateLogic.notE"],["notE'","PredicateLogic.notE'"],["notFalse","PredicateLogic.notFalse"],["notFalseI","PredicateLogic.notFalseI"],["notI","PredicateLogic.notI"],["notIsBool","PredicateLogic.notIsBool"],["notTrue","PredicateLogic.notTrue"],["notTrueE","PredicateLogic.notTrueE"],["not_def","PredicateLogic.not_def"],["not_refl_False","PredicateLogic.not_refl_False"],["not_simps","PredicateLogic.not_simps"],["not_sym","PredicateLogic.not_sym"],["notnotD","PredicateLogic.notnotD"],["notnotI","PredicateLogic.notnotI"],["orIsBool","PredicateLogic.orIsBool"],["prop_distrib","PredicateLogic.prop_distrib"],["quant_distrib","PredicateLogic.quant_distrib"],["quant_simps","PredicateLogic.quant_simps"],["refl","PredicateLogic.refl"],["rev_mp","PredicateLogic.rev_mp"],["simp_impliesE","PredicateLogic.simp_impliesE"],["simp_impliesI","PredicateLogic.simp_impliesI"],["simp_implies_cong","PredicateLogic.simp_implies_cong"],["simp_implies_def","PredicateLogic.simp_implies_def"],["skolem","PredicateLogic.skolem"],["skolemI","PredicateLogic.skolemI"],["spec","PredicateLogic.spec"],["splitCond","PredicateLogic.splitCond"],["splitCondAsm","PredicateLogic.splitCondAsm"],["ssubst","PredicateLogic.ssubst"],["subst","PredicateLogic.subst"],["substCond","PredicateLogic.substCond"],["swap","PredicateLogic.swap"],["sym","PredicateLogic.sym"],["symEqLeft","PredicateLogic.symEqLeft"],["thin_refl","PredicateLogic.thin_refl"],["trans","PredicateLogic.trans"],["trueI","PredicateLogic.trueI"],["trueIsBool","PredicateLogic.trueIsBool"],["true_eq_falseE","PredicateLogic.true_eq_falseE"],["trueprop_eq_true","PredicateLogic.trueprop_eq_true"],["trueprop_true_eq","PredicateLogic.trueprop_true_eq"],["all_conjunction","Pure.all_conjunction"],["asm_rl","Pure.asm_rl"],["conjunctionD1","Pure.conjunctionD1"],["conjunctionD2","Pure.conjunctionD2"],["conjunctionI","Pure.conjunctionI"],["conjunction_def","Pure.conjunction_def"],["conjunction_imp","Pure.conjunction_imp"],["cut_rl","Pure.cut_rl"],["distinct_prems_rl","Pure.distinct_prems_rl"],["equal_allI","Pure.equal_allI"],["equal_elim_rule1","Pure.equal_elim_rule1"],["equal_elim_rule2","Pure.equal_elim_rule2"],["equal_intr_rule","Pure.equal_intr_rule"],["equals_cong","Pure.equals_cong"],["imp_conjunction","Pure.imp_conjunction"],["meta_allE","Pure.meta_allE"],["meta_impE","Pure.meta_impE"],["meta_mp","Pure.meta_mp"],["meta_spec","Pure.meta_spec"],["norm_hhf_eq","Pure.norm_hhf_eq"],["prop_def","Pure.prop_def"],["protectD","Pure.protectD"],["protectI","Pure.protectI"],["protect_cong","Pure.protect_cong"],["reflexive","Pure.reflexive"],["remdups_rl","Pure.remdups_rl"],["revcut_rl","Pure.revcut_rl"],["sort_constraintI","Pure.sort_constraintI"],["sort_constraint_def","Pure.sort_constraint_def"],["sort_constraint_eq","Pure.sort_constraint_eq"],["swap_params","Pure.swap_params"],["swap_prems_eq","Pure.swap_prems_eq"],["symmetric","Pure.symmetric"],["termI","Pure.termI"],["term_def","Pure.term_def"],["thin_rl","Pure.thin_rl"],["transitive","Pure.transitive"],["triv_forall_equality","Pure.triv_forall_equality"],["INTERE","SetTheory.INTERE"],["INTERI","SetTheory.INTERI"],["INTERSimps","SetTheory.INTERSimps"],["INTER_GLB","SetTheory.INTER_GLB"],["INTER_LB","SetTheory.INTER_LB"],["INTER_anti_mono","SetTheory.INTER_anti_mono"],["INTER_def","SetTheory.INTER_def"],["INTER_iff","SetTheory.INTER_iff"],["INTERunionDistrib","SetTheory.INTERunionDistrib"],["SUBSET","SetTheory.SUBSET"],["SUBSETD","SetTheory.SUBSETD"],["SUBSETEmpty","SetTheory.SUBSETEmpty"],["SUBSETI","SetTheory.SUBSETI"],["SUBSET_UNION","SetTheory.SUBSET_UNION"],["SUBSET_iff","SetTheory.SUBSET_iff"],["SUBSETaddElt","SetTheory.SUBSETaddElt"],["SUBSETinter","SetTheory.SUBSETinter"],["UNION","SetTheory.UNION"],["UNIONDisjoint","SetTheory.UNIONDisjoint"],["UNIONE","SetTheory.UNIONE"],["UNIONI","SetTheory.UNIONI"],["UNIONIsSubset","SetTheory.UNIONIsSubset"],["UNIONSimps","SetTheory.UNIONSimps"],["UNION_LUB","SetTheory.UNION_LUB"],["UNION_SUBSET","SetTheory.UNION_SUBSET"],["UNION_UB","SetTheory.UNION_UB"],["UNION_iff","SetTheory.UNION_iff"],["UNION_in_SUBSET","SetTheory.UNION_in_SUBSET"],["UNION_mono","SetTheory.UNION_mono"],["UNIONinter","SetTheory.UNIONinter"],["UNIONunionDistrib","SetTheory.UNIONunionDistrib"],["addEltAbsorb","SetTheory.addEltAbsorb"],["addEltCommute","SetTheory.addEltCommute"],["addEltE","SetTheory.addEltE"],["addEltEqualAddElt","SetTheory.addEltEqualAddElt"],["addEltEqual_iff","SetTheory.addEltEqual_iff"],["addEltI","SetTheory.addEltI"],["addEltInter","SetTheory.addEltInter"],["addEltSubsetE","SetTheory.addEltSubsetE"],["addEltSubsetI","SetTheory.addEltSubsetI"],["addEltSubset_iff","SetTheory.addEltSubset_iff"],["addEltTwice","SetTheory.addEltTwice"],["addEltUnion","SetTheory.addEltUnion"],["addElt_def","SetTheory.addElt_def"],["addElt_iff","SetTheory.addElt_iff"],["bAllCong","SetTheory.bAllCong"],["bAllE","SetTheory.bAllE"],["bAllI","SetTheory.bAllI"],["bAllInter","SetTheory.bAllInter"],["bAllIsBool","SetTheory.bAllIsBool"],["bAllSubset","SetTheory.bAllSubset"],["bAllTriv","SetTheory.bAllTriv"],["bAllUnion","SetTheory.bAllUnion"],["bAll_def","SetTheory.bAll_def"],["bAll_unb","SetTheory.bAll_unb"],["bChooseCong","SetTheory.bChooseCong"],["bChooseI","SetTheory.bChooseI"],["bChooseI2","SetTheory.bChooseI2"],["bChooseI_ex","SetTheory.bChooseI_ex"],["bChooseInSet","SetTheory.bChooseInSet"],["bChooseInSet_ex","SetTheory.bChooseInSet_ex"],["bChoose_def","SetTheory.bChoose_def"],["bExCI","SetTheory.bExCI"],["bExCong","SetTheory.bExCong"],["bExE","SetTheory.bExE"],["bExI","SetTheory.bExI"],["bExIsBool","SetTheory.bExIsBool"],["bExTriv","SetTheory.bExTriv"],["bEx_def","SetTheory.bEx_def"],["bExistsInter","SetTheory.bExistsInter"],["bExistsUnion","SetTheory.bExistsUnion"],["bQuantOnePoint","SetTheory.bQuantOnePoint"],["bQuant_distribs","SetTheory.bQuant_distribs"],["boolifyBAll","SetTheory.boolifyBAll"],["boolifyBEx","SetTheory.boolifyBEx"],["boolifyIn","SetTheory.boolifyIn"],["boolifySubset","SetTheory.boolifySubset"],["boolifypSubset","SetTheory.boolifypSubset"],["bspec","SetTheory.bspec"],["comprehensionDistribs","SetTheory.comprehensionDistribs"],["comprehensionSimps","SetTheory.comprehensionSimps"],["condIn","SetTheory.condIn"],["condInE","SetTheory.condInE"],["condInI","SetTheory.condInI"],["condSubset","SetTheory.condSubset"],["emptyE","SetTheory.emptyE"],["emptySUBSET","SetTheory.emptySUBSET"],["emptySetminus","SetTheory.emptySetminus"],["emptySubset","SetTheory.emptySubset"],["emptysetD","SetTheory.emptysetD"],["emptysetEmpty","SetTheory.emptysetEmpty"],["emptysetI","SetTheory.emptysetI"],["emptysetI_rev","SetTheory.emptysetI_rev"],["emptysetIffEmpty","SetTheory.emptysetIffEmpty"],["emptysetIffEmpty'","SetTheory.emptysetIffEmpty'"],["enumeratedSetSimps","SetTheory.enumeratedSetSimps"],["equalAddElt_iff","SetTheory.equalAddElt_iff"],["equalNotIn","SetTheory.equalNotIn"],["extension","SetTheory.extension"],["foundation","SetTheory.foundation"],["inAsym","SetTheory.inAsym"],["inCond","SetTheory.inCond"],["inCondE","SetTheory.inCondE"],["inCondI","SetTheory.inCondI"],["inIrrefl","SetTheory.inIrrefl"],["inIsBool","SetTheory.inIsBool"],["inNonEqual","SetTheory.inNonEqual"],["infinity","SetTheory.infinity"],["interAC","SetTheory.interAC"],["interAbsorb","SetTheory.interAbsorb"],["interAddEltLeft","SetTheory.interAddEltLeft"],["interAddEltRight","SetTheory.interAddEltRight"],["interAssoc","SetTheory.interAssoc"],["interCommute","SetTheory.interCommute"],["interD1","SetTheory.interD1"],["interD2","SetTheory.interD2"],["interE","SetTheory.interE"],["interEmpty","SetTheory.interEmpty"],["interGLB","SetTheory.interGLB"],["interI","SetTheory.interI"],["interINTER","SetTheory.interINTER"],["interLB1","SetTheory.interLB1"],["interLB2","SetTheory.interLB2"],["interLeftAbsorb","SetTheory.interLeftAbsorb"],["interLeftCommute","SetTheory.interLeftCommute"],["interSetminusLeft","SetTheory.interSetminusLeft"],["interSetminusRight","SetTheory.interSetminusRight"],["interSubset","SetTheory.interSubset"],["interSubsetOf","SetTheory.interSubsetOf"],["interUNION","SetTheory.interUNION"],["interUnionDistrib","SetTheory.interUnionDistrib"],["inter_def","SetTheory.inter_def"],["inter_iff","SetTheory.inter_iff"],["isEmptySimps","SetTheory.isEmptySimps"],["miniscope_bAll","SetTheory.miniscope_bAll"],["miniscope_bEx","SetTheory.miniscope_bEx"],["nonEmpty","SetTheory.nonEmpty"],["nonEmpty'","SetTheory.nonEmpty'"],["nonEmptyE","SetTheory.nonEmptyE"],["nonEmptyI","SetTheory.nonEmptyI"],["notIn_inFalse","SetTheory.notIn_inFalse"],["notSubset","SetTheory.notSubset"],["notSubsetE","SetTheory.notSubsetE"],["notSubsetI","SetTheory.notSubsetI"],["notbQuant'","SetTheory.notbQuant'"],["psubsetIsBool","SetTheory.psubsetIsBool"],["psubset_def","SetTheory.psubset_def"],["psubset_elim","SetTheory.psubset_elim"],["psubset_intro","SetTheory.psubset_intro"],["rev_subsetD","SetTheory.rev_subsetD"],["rev_subsetNotIn","SetTheory.rev_subsetNotIn"],["selfSUBSET","SetTheory.selfSUBSET"],["setEqual","SetTheory.setEqual"],["setEqualD1","SetTheory.setEqualD1"],["setEqualD2","SetTheory.setEqualD2"],["setEqualE","SetTheory.setEqualE"],["setEqualI","SetTheory.setEqualI"],["setEqual_iff","SetTheory.setEqual_iff"],["setOfAll","SetTheory.setOfAll"],["setOfAllE","SetTheory.setOfAllE"],["setOfAllEqual","SetTheory.setOfAllEqual"],["setOfAllI","SetTheory.setOfAllI"],["setOfAll_cong","SetTheory.setOfAll_cong"],["setOfAll_eqI","SetTheory.setOfAll_eqI"],["setOfAll_iff","SetTheory.setOfAll_iff"],["setOfAll_triv","SetTheory.setOfAll_triv"],["setminusAddElt","SetTheory.setminusAddElt"],["setminusAddEltLeft","SetTheory.setminusAddEltLeft"],["setminusD1","SetTheory.setminusD1"],["setminusD2","SetTheory.setminusD2"],["setminusDisjoint","SetTheory.setminusDisjoint"],["setminusE","SetTheory.setminusE"],["setminusI","SetTheory.setminusI"],["setminusINTERLeft","SetTheory.setminusINTERLeft"],["setminusINTERRight","SetTheory.setminusINTERRight"],["setminusInterLeft","SetTheory.setminusInterLeft"],["setminusInterRight","SetTheory.setminusInterRight"],["setminusSelf","SetTheory.setminusSelf"],["setminusSubset","SetTheory.setminusSubset"],["setminusUNIONLeft","SetTheory.setminusUNIONLeft"],["setminusUnionLeft","SetTheory.setminusUnionLeft"],["setminusUnionRight","SetTheory.setminusUnionRight"],["setminus_def","SetTheory.setminus_def"],["setminus_iff","SetTheory.setminus_iff"],["singletonI","SetTheory.singletonI"],["singleton_iff","SetTheory.singleton_iff"],["subsetAddEltE","SetTheory.subsetAddEltE"],["subsetAddElt_iff","SetTheory.subsetAddElt_iff"],["subsetCE","SetTheory.subsetCE"],["subsetCond","SetTheory.subsetCond"],["subsetD","SetTheory.subsetD"],["subsetE","SetTheory.subsetE"],["subsetEmpty","SetTheory.subsetEmpty"],["subsetI","SetTheory.subsetI"],["subsetINTER","SetTheory.subsetINTER"],["subsetIsBool","SetTheory.subsetIsBool"],["subsetNotIn","SetTheory.subsetNotIn"],["subsetOf","SetTheory.subsetOf"],["subsetOfConj","SetTheory.subsetOfConj"],["subsetOfD1","SetTheory.subsetOfD1"],["subsetOfD2","SetTheory.subsetOfD2"],["subsetOfDisj","SetTheory.subsetOfDisj"],["subsetOfE","SetTheory.subsetOfE"],["subsetOfEqual","SetTheory.subsetOfEqual"],["subsetOfI","SetTheory.subsetOfI"],["subsetOfInter","SetTheory.subsetOfInter"],["subsetOf_cong","SetTheory.subsetOf_cong"],["subsetOf_iff","SetTheory.subsetOf_iff"],["subsetRefl","SetTheory.subsetRefl"],["subsetSetminus","SetTheory.subsetSetminus"],["subsetTrans","SetTheory.subsetTrans"],["subsetUnion","SetTheory.subsetUnion"],["subset_def","SetTheory.subset_def"],["subst_elem","SetTheory.subst_elem"],["subst_elem_rev","SetTheory.subst_elem_rev"],["subst_set","SetTheory.subst_set"],["subst_set_rev","SetTheory.subst_set_rev"],["unionAC","SetTheory.unionAC"],["unionAbsorb","SetTheory.unionAbsorb"],["unionAddEltLeft","SetTheory.unionAddEltLeft"],["unionAddEltRight","SetTheory.unionAddEltRight"],["unionAssoc","SetTheory.unionAssoc"],["unionCI","SetTheory.unionCI"],["unionCommute","SetTheory.unionCommute"],["unionE","SetTheory.unionE"],["unionEmpty","SetTheory.unionEmpty"],["unionI1","SetTheory.unionI1"],["unionI2","SetTheory.unionI2"],["unionINTER","SetTheory.unionINTER"],["unionInterDistrib","SetTheory.unionInterDistrib"],["unionLUB","SetTheory.unionLUB"],["unionLeftAbsorb","SetTheory.unionLeftAbsorb"],["unionLeftCommute","SetTheory.unionLeftCommute"],["unionSUBSET","SetTheory.unionSUBSET"],["unionSetminusLeft","SetTheory.unionSetminusLeft"],["unionSetminusRight","SetTheory.unionSetminusRight"],["unionSetminusSelf","SetTheory.unionSetminusSelf"],["unionUB1","SetTheory.unionUB1"],["unionUB2","SetTheory.unionUB2"],["union_def","SetTheory.union_def"],["union_iff","SetTheory.union_iff"],["upairE","SetTheory.upairE"],["upairI1","SetTheory.upairI1"],["upairI2","SetTheory.upairI2"],["upair_def","SetTheory.upair_def"],["upair_iff","SetTheory.upair_iff"],["Char_def","Strings.Char_def"],["Nibble_def","Strings.Nibble_def"],["String_def","Strings.String_def"],["charInj","Strings.charInj"],["char_def","Strings.char_def"],["isChar","Strings.isChar"],["Append_def","Tuples.Append_def"],["DomainSeqLen","Tuples.DomainSeqLen"],["DomainSeqLen'","Tuples.DomainSeqLen'"],["EnumFuncSetE","Tuples.EnumFuncSetE"],["EnumFuncSetI","Tuples.EnumFuncSetI"],["EnumFuncSet_def","Tuples.EnumFuncSet_def"],["IdE","Tuples.IdE"],["IdI","Tuples.IdI"],["IdI'","Tuples.IdI'"],["Id_comp_R","Tuples.Id_comp_R"],["Id_def","Tuples.Id_def"],["Id_empty","Tuples.Id_empty"],["Id_eqI","Tuples.Id_eqI"],["Id_iff","Tuples.Id_iff"],["Id_subset_Prod","Tuples.Id_subset_Prod"],["LenI","Tuples.LenI"],["LenInNat","Tuples.LenInNat"],["LenInNat'","Tuples.LenInNat'"],["Len_def","Tuples.Len_def"],["Product_def","Tuples.Product_def"],["R_comp_Id","Tuples.R_comp_Id"],["SeqE","Tuples.SeqE"],["SeqI","Tuples.SeqI"],["SeqI'","Tuples.SeqI'"],["SeqIsAFcn","Tuples.SeqIsAFcn"],["SeqIsAFcn'","Tuples.SeqIsAFcn'"],["SeqIsASeq","Tuples.SeqIsASeq"],["SeqNotEmpty","Tuples.SeqNotEmpty"],["Seq_def","Tuples.Seq_def"],["antisym_empty","Tuples.antisym_empty"],["antisymmetricE","Tuples.antisymmetricE"],["antisymmetricI","Tuples.antisymmetricI"],["antisymmetricIsBool","Tuples.antisymmetricIsBool"],["antisymmetricSubset","Tuples.antisymmetricSubset"],["antisymmetric_Id","Tuples.antisymmetric_Id"],["antisymmetric_converse","Tuples.antisymmetric_converse"],["antisymmetric_def","Tuples.antisymmetric_def"],["appendD1","Tuples.appendD1"],["appendD2","Tuples.appendD2"],["appendElt","Tuples.appendElt"],["appendElt'","Tuples.appendElt'"],["appendElt1","Tuples.appendElt1"],["appendElt1'","Tuples.appendElt1'"],["appendElt2","Tuples.appendElt2"],["appendElt2'","Tuples.appendElt2'"],["appendEqualIff","Tuples.appendEqualIff"],["appendExtend","Tuples.appendExtend"],["appendInSeq","Tuples.appendInSeq"],["appendIsAFcn","Tuples.appendIsAFcn"],["appendIsAFcn'","Tuples.appendIsAFcn'"],["appendIsASeq","Tuples.appendIsASeq"],["appendNotEmpty","Tuples.appendNotEmpty"],["boolifyAntisymmetric","Tuples.boolifyAntisymmetric"],["boolifyEquivalence","Tuples.boolifyEquivalence"],["boolifyIrreflexive","Tuples.boolifyIrreflexive"],["boolifyIsASeq","Tuples.boolifyIsASeq"],["boolifyReflexive","Tuples.boolifyReflexive"],["boolifySymmetric","Tuples.boolifySymmetric"],["boolifyTransitive","Tuples.boolifyTransitive"],["compE","Tuples.compE"],["compEpair","Tuples.compEpair"],["compEqualI","Tuples.compEqualI"],["compI","Tuples.compI"],["comp_assoc","Tuples.comp_assoc"],["comp_equivI","Tuples.comp_equivI"],["converseD","Tuples.converseD"],["converseE","Tuples.converseE"],["converseEqualI","Tuples.converseEqualI"],["converseI","Tuples.converseI"],["converseSubset","Tuples.converseSubset"],["converse_Id","Tuples.converse_Id"],["converse_comp","Tuples.converse_comp"],["converse_converse","Tuples.converse_converse"],["converse_def","Tuples.converse_def"],["converse_empty","Tuples.converse_empty"],["converse_iff","Tuples.converse_iff"],["converse_mono","Tuples.converse_mono"],["converse_mono_1","Tuples.converse_mono_1"],["converse_mono_2","Tuples.converse_mono_2"],["converse_prod","Tuples.converse_prod"],["dom_Id","Tuples.dom_Id"],["dom_in_A","Tuples.dom_in_A"],["domainAppend","Tuples.domainAppend"],["domainEmptySeq","Tuples.domainEmptySeq"],["emptyDomainIsEmptySeq","Tuples.emptyDomainIsEmptySeq"],["emptyFcnEmptySeq","Tuples.emptyFcnEmptySeq"],["emptySeqEmptyFcn","Tuples.emptySeqEmptyFcn"],["emptySeqIff","Tuples.emptySeqIff"],["emptySeqIff'","Tuples.emptySeqIff'"],["emptySeqInSeq","Tuples.emptySeqInSeq"],["emptySeqIsAFcn","Tuples.emptySeqIsAFcn"],["emptySeqIsASeq","Tuples.emptySeqIsASeq"],["emptySeq_def","Tuples.emptySeq_def"],["equiv_comp_eq","Tuples.equiv_comp_eq"],["equivalenceIsBool","Tuples.equivalenceIsBool"],["equivalence_def","Tuples.equivalence_def"],["idEqualI","Tuples.idEqualI"],["imageAppend","Tuples.imageAppend"],["imageEmptySeq","Tuples.imageEmptySeq"],["inProd","Tuples.inProd"],["inProd'","Tuples.inProd'"],["inProdE","Tuples.inProdE"],["inProdI","Tuples.inProdI"],["inProdI'","Tuples.inProdI'"],["inProductE","Tuples.inProductE"],["inProductI","Tuples.inProductI"],["inProductIsASeq","Tuples.inProductIsASeq"],["inProductLen","Tuples.inProductLen"],["inSetOfPairsE","Tuples.inSetOfPairsE"],["inSetOfPairsI","Tuples.inSetOfPairsI"],["inSetOfPairsI_ex","Tuples.inSetOfPairsI_ex"],["in_dom_imp_in_A","Tuples.in_dom_imp_in_A"],["in_ran_imp_in_B","Tuples.in_ran_imp_in_B"],["in_rel_domainE","Tuples.in_rel_domainE"],["in_rel_domainI","Tuples.in_rel_domainI"],["in_rel_rangeE","Tuples.in_rel_rangeE"],["in_rel_rangeI","Tuples.in_rel_rangeI"],["irreflexiveE","Tuples.irreflexiveE"],["irreflexiveI","Tuples.irreflexiveI"],["irreflexiveIsBool","Tuples.irreflexiveIsBool"],["irreflexive_def","Tuples.irreflexive_def"],["isASeqE","Tuples.isASeqE"],["isASeqI","Tuples.isASeqI"],["isASeqInSeq","Tuples.isASeqInSeq"],["isASeqIsBool","Tuples.isASeqIsBool"],["isASeq_def","Tuples.isASeq_def"],["isAppend","Tuples.isAppend"],["isAppend'","Tuples.isAppend'"],["isEmptySeq","Tuples.isEmptySeq"],["lenAppend","Tuples.lenAppend"],["lenAppend'","Tuples.lenAppend'"],["lenEmptySeq","Tuples.lenEmptySeq"],["pairProj_in_prod","Tuples.pairProj_in_prod"],["pairProj_in_rel","Tuples.pairProj_in_rel"],["prodEmptyIff","Tuples.prodEmptyIff"],["prodEmptyIff'","Tuples.prodEmptyIff'"],["prodProj","Tuples.prodProj"],["prod_def","Tuples.prod_def"],["prod_in_dom_x_ran","Tuples.prod_in_dom_x_ran"],["ran_Id","Tuples.ran_Id"],["ran_in_B","Tuples.ran_in_B"],["reflI","Tuples.reflI"],["refl_comp_subset","Tuples.refl_comp_subset"],["reflexiveD","Tuples.reflexiveD"],["reflexiveIsBool","Tuples.reflexiveIsBool"],["reflexive_Id","Tuples.reflexive_Id"],["reflexive_converse","Tuples.reflexive_converse"],["reflexive_def","Tuples.reflexive_def"],["reflexive_empty","Tuples.reflexive_empty"],["relProj1","Tuples.relProj1"],["relProj2","Tuples.relProj2"],["rel_comp_def","Tuples.rel_comp_def"],["rel_comp_distrib","Tuples.rel_comp_distrib"],["rel_comp_distrib2","Tuples.rel_comp_distrib2"],["rel_comp_empty1","Tuples.rel_comp_empty1"],["rel_comp_empty2","Tuples.rel_comp_empty2"],["rel_comp_in_prod","Tuples.rel_comp_in_prod"],["rel_comp_in_prodE","Tuples.rel_comp_in_prodE"],["rel_comp_mono","Tuples.rel_comp_mono"],["rel_domain","Tuples.rel_domain"],["rel_domain_def","Tuples.rel_domain_def"],["rel_image_def","Tuples.rel_image_def"],["rel_range","Tuples.rel_range"],["rel_range_def","Tuples.rel_range_def"],["seqCases","Tuples.seqCases"],["seqElt","Tuples.seqElt"],["seqEmptyOrAppend","Tuples.seqEmptyOrAppend"],["seqEqualE","Tuples.seqEqualE"],["seqEqualI","Tuples.seqEqualI"],["seqEqualIff","Tuples.seqEqualIff"],["seqFuncSet","Tuples.seqFuncSet"],["seqInSeqRange","Tuples.seqInSeqRange"],["seqInduct","Tuples.seqInduct"],["seqLenZeroIsEmpty","Tuples.seqLenZeroIsEmpty"],["setOfAllPairs_eq_r","Tuples.setOfAllPairs_eq_r"],["setOfPairsEqual","Tuples.setOfPairsEqual"],["setOfPairs_cong","Tuples.setOfPairs_cong"],["setOfPairs_def","Tuples.setOfPairs_def"],["setOfPairs_triv","Tuples.setOfPairs_triv"],["subrel_dom","Tuples.subrel_dom"],["subrel_ran","Tuples.subrel_ran"],["subsetsInProd","Tuples.subsetsInProd"],["sym_trans_comp_subset","Tuples.sym_trans_comp_subset"],["symmetricE","Tuples.symmetricE"],["symmetricI","Tuples.symmetricI"],["symmetricIsBool","Tuples.symmetricIsBool"],["symmetric_Id","Tuples.symmetric_Id"],["symmetric_Int","Tuples.symmetric_Int"],["symmetric_converse","Tuples.symmetric_converse"],["symmetric_def","Tuples.symmetric_def"],["symmetric_iff_converse_eq","Tuples.symmetric_iff_converse_eq"],["transD","Tuples.transD"],["trans_Int","Tuples.trans_Int"],["transitiveI","Tuples.transitiveI"],["transitiveIsBool","Tuples.transitiveIsBool"],["transitive_Id","Tuples.transitive_Id"],["transitive_converse","Tuples.transitive_converse"],["transitive_def","Tuples.transitive_def"],["transitive_iff_comp_subset","Tuples.transitive_iff_comp_subset"],["atomize_meta_bAll","Zenon.atomize_meta_bAll"],["atomize_object_bAll","Zenon.atomize_object_bAll"],["zenon_FALSE_neq_TRUE","Zenon.zenon_FALSE_neq_TRUE"],["zenon_all","Zenon.zenon_all"],["zenon_all_0","Zenon.zenon_all_0"],["zenon_all_in_0","Zenon.zenon_all_in_0"],["zenon_all_rec_1","Zenon.zenon_all_rec_1"],["zenon_all_rec_2","Zenon.zenon_all_rec_2"],["zenon_and","Zenon.zenon_and"],["zenon_and_0","Zenon.zenon_and_0"],["zenon_and_1","Zenon.zenon_and_1"],["zenon_appseq_def","Zenon.zenon_appseq_def"],["zenon_boolcase","Zenon.zenon_boolcase"],["zenon_boolcase_all","Zenon.zenon_boolcase_all"],["zenon_boolcase_and","Zenon.zenon_boolcase_and"],["zenon_boolcase_equal","Zenon.zenon_boolcase_equal"],["zenon_boolcase_equiv","Zenon.zenon_boolcase_equiv"],["zenon_boolcase_ex","Zenon.zenon_boolcase_ex"],["zenon_boolcase_imply","Zenon.zenon_boolcase_imply"],["zenon_boolcase_in","Zenon.zenon_boolcase_in"],["zenon_boolcase_not","Zenon.zenon_boolcase_not"],["zenon_boolcase_or","Zenon.zenon_boolcase_or"],["zenon_case1","Zenon.zenon_case1"],["zenon_case2","Zenon.zenon_case2"],["zenon_case3","Zenon.zenon_case3"],["zenon_case4","Zenon.zenon_case4"],["zenon_case5","Zenon.zenon_case5"],["zenon_case_append1","Zenon.zenon_case_append1"],["zenon_case_domain","Zenon.zenon_case_domain"],["zenon_case_empty_union","Zenon.zenon_case_empty_union"],["zenon_case_len_domain","Zenon.zenon_case_len_domain"],["zenon_case_len_simpl","Zenon.zenon_case_len_simpl"],["zenon_case_oth_empty","Zenon.zenon_case_oth_empty"],["zenon_case_oth_simpl","Zenon.zenon_case_oth_simpl"],["zenon_case_oth_simpl_l1","Zenon.zenon_case_oth_simpl_l1"],["zenon_case_oth_simpl_l2","Zenon.zenon_case_oth_simpl_l2"],["zenon_case_seq_empty","Zenon.zenon_case_seq_empty"],["zenon_case_seq_simpl","Zenon.zenon_case_seq_simpl"],["zenon_case_union_simpl","Zenon.zenon_case_union_simpl"],["zenon_case_union_split","Zenon.zenon_case_union_split"],["zenon_caseother0","Zenon.zenon_caseother0"],["zenon_caseother1","Zenon.zenon_caseother1"],["zenon_caseother2","Zenon.zenon_caseother2"],["zenon_caseother3","Zenon.zenon_caseother3"],["zenon_caseother4","Zenon.zenon_caseother4"],["zenon_caseother5","Zenon.zenon_caseother5"],["zenon_choose_diff_choose","Zenon.zenon_choose_diff_choose"],["zenon_choose_diff_choose_0","Zenon.zenon_choose_diff_choose_0"],["zenon_cup_subseteq","Zenon.zenon_cup_subseteq"],["zenon_cup_subseteq_0","Zenon.zenon_cup_subseteq_0"],["zenon_cup_subseteq_1","Zenon.zenon_cup_subseteq_1"],["zenon_disjE1","Zenon.zenon_disjE1"],["zenon_dom_app_1","Zenon.zenon_dom_app_1"],["zenon_dom_app_2","Zenon.zenon_dom_app_2"],["zenon_domain_except","Zenon.zenon_domain_except"],["zenon_domain_except_0","Zenon.zenon_domain_except_0"],["zenon_domain_fcn_0","Zenon.zenon_domain_fcn_0"],["zenon_em","Zenon.zenon_em"],["zenon_eq_false_x","Zenon.zenon_eq_false_x"],["zenon_eq_false_x_0","Zenon.zenon_eq_false_x_0"],["zenon_eq_true_x","Zenon.zenon_eq_true_x"],["zenon_eq_true_x_0","Zenon.zenon_eq_true_x_0"],["zenon_eq_x_false","Zenon.zenon_eq_x_false"],["zenon_eq_x_false_0","Zenon.zenon_eq_x_false_0"],["zenon_eq_x_true","Zenon.zenon_eq_x_true"],["zenon_eq_x_true_0","Zenon.zenon_eq_x_true_0"],["zenon_eqrefl","Zenon.zenon_eqrefl"],["zenon_eqsym","Zenon.zenon_eqsym"],["zenon_equiv","Zenon.zenon_equiv"],["zenon_ex","Zenon.zenon_ex"],["zenon_ex_choose","Zenon.zenon_ex_choose"],["zenon_ex_choose_0","Zenon.zenon_ex_choose_0"],["zenon_except_notin_funcset","Zenon.zenon_except_notin_funcset"],["zenon_fapplyexcept","Zenon.zenon_fapplyexcept"],["zenon_fapplyfcn","Zenon.zenon_fapplyfcn"],["zenon_funequal","Zenon.zenon_funequal"],["zenon_funequal_0","Zenon.zenon_funequal_0"],["zenon_iffalse","Zenon.zenon_iffalse"],["zenon_iffalse_0","Zenon.zenon_iffalse_0"],["zenon_ifthenelse","Zenon.zenon_ifthenelse"],["zenon_iftrue","Zenon.zenon_iftrue"],["zenon_iftrue_0","Zenon.zenon_iftrue_0"],["zenon_imply","Zenon.zenon_imply"],["zenon_in_SUBSET","Zenon.zenon_in_SUBSET"],["zenon_in_SUBSET_0","Zenon.zenon_in_SUBSET_0"],["zenon_in_UNION","Zenon.zenon_in_UNION"],["zenon_in_UNION_0","Zenon.zenon_in_UNION_0"],["zenon_in_addElt","Zenon.zenon_in_addElt"],["zenon_in_cap","Zenon.zenon_in_cap"],["zenon_in_cap_0","Zenon.zenon_in_cap_0"],["zenon_in_cap_1","Zenon.zenon_in_cap_1"],["zenon_in_cup","Zenon.zenon_in_cup"],["zenon_in_emptyset","Zenon.zenon_in_emptyset"],["zenon_in_funcset","Zenon.zenon_in_funcset"],["zenon_in_funcset_0","Zenon.zenon_in_funcset_0"],["zenon_in_funcset_1","Zenon.zenon_in_funcset_1"],["zenon_in_funcset_2","Zenon.zenon_in_funcset_2"],["zenon_in_nat_0","Zenon.zenon_in_nat_0"],["zenon_in_nat_1","Zenon.zenon_in_nat_1"],["zenon_in_nat_2","Zenon.zenon_in_nat_2"],["zenon_in_nat_succ","Zenon.zenon_in_nat_succ"],["zenon_in_nat_succ_0","Zenon.zenon_in_nat_succ_0"],["zenon_in_product_i","Zenon.zenon_in_product_i"],["zenon_in_recordset_field","Zenon.zenon_in_recordset_field"],["zenon_in_setminus","Zenon.zenon_in_setminus"],["zenon_in_setminus_0","Zenon.zenon_in_setminus_0"],["zenon_in_setminus_1","Zenon.zenon_in_setminus_1"],["zenon_in_setofall","Zenon.zenon_in_setofall"],["zenon_in_setofall_0","Zenon.zenon_in_setofall_0"],["zenon_in_subsetof","Zenon.zenon_in_subsetof"],["zenon_in_subsetof_0","Zenon.zenon_in_subsetof_0"],["zenon_in_subsetof_1","Zenon.zenon_in_subsetof_1"],["zenon_in_upair","Zenon.zenon_in_upair"],["zenon_inrecordsetI1","Zenon.zenon_inrecordsetI1"],["zenon_inrecordsetI2","Zenon.zenon_inrecordsetI2"],["zenon_inrecordsetI3","Zenon.zenon_inrecordsetI3"],["zenon_inrecordsetI4","Zenon.zenon_inrecordsetI4"],["zenon_inrecordsetI5","Zenon.zenon_inrecordsetI5"],["zenon_inrecordsetI6","Zenon.zenon_inrecordsetI6"],["zenon_inrecordsetI7","Zenon.zenon_inrecordsetI7"],["zenon_isASeqSeqify","Zenon.zenon_isASeqSeqify"],["zenon_nnpp","Zenon.zenon_nnpp"],["zenon_not_cup_subseteq","Zenon.zenon_not_cup_subseteq"],["zenon_not_subseteq_cap","Zenon.zenon_not_subseteq_cap"],["zenon_notall","Zenon.zenon_notall"],["zenon_notall_choose","Zenon.zenon_notall_choose"],["zenon_notall_choose_0","Zenon.zenon_notall_choose_0"],["zenon_notallex","Zenon.zenon_notallex"],["zenon_notallex_0","Zenon.zenon_notallex_0"],["zenon_notand","Zenon.zenon_notand"],["zenon_noteq","Zenon.zenon_noteq"],["zenon_noteq_true_x","Zenon.zenon_noteq_true_x"],["zenon_noteq_true_x_0","Zenon.zenon_noteq_true_x_0"],["zenon_noteq_x_true","Zenon.zenon_noteq_x_true"],["zenon_noteq_x_true_0","Zenon.zenon_noteq_x_true_0"],["zenon_notequalchoose","Zenon.zenon_notequalchoose"],["zenon_notequiv","Zenon.zenon_notequiv"],["zenon_notex","Zenon.zenon_notex"],["zenon_notex_0","Zenon.zenon_notex_0"],["zenon_notex_in_0","Zenon.zenon_notex_in_0"],["zenon_notfunequal","Zenon.zenon_notfunequal"],["zenon_notfunequal_0","Zenon.zenon_notfunequal_0"],["zenon_notimply","Zenon.zenon_notimply"],["zenon_notimply_0","Zenon.zenon_notimply_0"],["zenon_notimply_1","Zenon.zenon_notimply_1"],["zenon_notin_SUBSET","Zenon.zenon_notin_SUBSET"],["zenon_notin_SUBSET_0","Zenon.zenon_notin_SUBSET_0"],["zenon_notin_UNION","Zenon.zenon_notin_UNION"],["zenon_notin_UNION_0","Zenon.zenon_notin_UNION_0"],["zenon_notin_addElt","Zenon.zenon_notin_addElt"],["zenon_notin_addElt_0","Zenon.zenon_notin_addElt_0"],["zenon_notin_addElt_1","Zenon.zenon_notin_addElt_1"],["zenon_notin_cap","Zenon.zenon_notin_cap"],["zenon_notin_cup","Zenon.zenon_notin_cup"],["zenon_notin_cup_0","Zenon.zenon_notin_cup_0"],["zenon_notin_cup_1","Zenon.zenon_notin_cup_1"],["zenon_notin_funcset","Zenon.zenon_notin_funcset"],["zenon_notin_setminus","Zenon.zenon_notin_setminus"],["zenon_notin_setofall","Zenon.zenon_notin_setofall"],["zenon_notin_setofall_0","Zenon.zenon_notin_setofall_0"],["zenon_notin_subsetof","Zenon.zenon_notin_subsetof"],["zenon_notin_upair","Zenon.zenon_notin_upair"],["zenon_notin_upair_0","Zenon.zenon_notin_upair_0"],["zenon_notin_upair_1","Zenon.zenon_notin_upair_1"],["zenon_notisafcn_except","Zenon.zenon_notisafcn_except"],["zenon_notisafcn_extend","Zenon.zenon_notisafcn_extend"],["zenon_notisafcn_fcn","Zenon.zenon_notisafcn_fcn"],["zenon_notisafcn_onearg","Zenon.zenon_notisafcn_onearg"],["zenon_notnot","Zenon.zenon_notnot"],["zenon_notnot_0","Zenon.zenon_notnot_0"],["zenon_notor","Zenon.zenon_notor"],["zenon_notor_0","Zenon.zenon_notor_0"],["zenon_notor_1","Zenon.zenon_notor_1"],["zenon_notsetequal","Zenon.zenon_notsetequal"],["zenon_notsetequal_0","Zenon.zenon_notsetequal_0"],["zenon_nottrue","Zenon.zenon_nottrue"],["zenon_nouniverse","Zenon.zenon_nouniverse"],["zenon_np_eq_l","Zenon.zenon_np_eq_l"],["zenon_np_eq_r","Zenon.zenon_np_eq_r"],["zenon_or","Zenon.zenon_or"],["zenon_p_eq_l","Zenon.zenon_p_eq_l"],["zenon_p_eq_r","Zenon.zenon_p_eq_r"],["zenon_range_1","Zenon.zenon_range_1"],["zenon_range_2","Zenon.zenon_range_2"],["zenon_recfield_1","Zenon.zenon_recfield_1"],["zenon_recfield_2","Zenon.zenon_recfield_2"],["zenon_recfield_2b","Zenon.zenon_recfield_2b"],["zenon_recfield_3","Zenon.zenon_recfield_3"],["zenon_recfield_3b","Zenon.zenon_recfield_3b"],["zenon_sa_1","Zenon.zenon_sa_1"],["zenon_sa_2","Zenon.zenon_sa_2"],["zenon_sa_def","Zenon.zenon_sa_def"],["zenon_sa_diff_0a","Zenon.zenon_sa_diff_0a"],["zenon_sa_diff_0b","Zenon.zenon_sa_diff_0b"],["zenon_sa_diff_1","Zenon.zenon_sa_diff_1"],["zenon_sa_diff_2","Zenon.zenon_sa_diff_2"],["zenon_sa_diff_3","Zenon.zenon_sa_diff_3"],["zenon_sa_seq","Zenon.zenon_sa_seq"],["zenon_seqifyIsASeq","Zenon.zenon_seqifyIsASeq"],["zenon_seqify_appseq","Zenon.zenon_seqify_appseq"],["zenon_seqify_def","Zenon.zenon_seqify_def"],["zenon_seqify_empty","Zenon.zenon_seqify_empty"],["zenon_set_rev_1","Zenon.zenon_set_rev_1"],["zenon_set_rev_2","Zenon.zenon_set_rev_2"],["zenon_set_rev_3","Zenon.zenon_set_rev_3"],["zenon_setequal","Zenon.zenon_setequal"],["zenon_setequal_0","Zenon.zenon_setequal_0"],["zenon_setequalempty","Zenon.zenon_setequalempty"],["zenon_setequalempty_0","Zenon.zenon_setequalempty_0"],["zenon_ss_1","Zenon.zenon_ss_1"],["zenon_ss_2","Zenon.zenon_ss_2"],["zenon_ss_def","Zenon.zenon_ss_def"],["zenon_ss_le_sa_1","Zenon.zenon_ss_le_sa_1"],["zenon_ss_le_sa_2","Zenon.zenon_ss_le_sa_2"],["zenon_ss_nat","Zenon.zenon_ss_nat"],["zenon_stringdiffll","Zenon.zenon_stringdiffll"],["zenon_stringdifflr","Zenon.zenon_stringdifflr"],["zenon_stringdiffrl","Zenon.zenon_stringdiffrl"],["zenon_stringdiffrr","Zenon.zenon_stringdiffrr"],["zenon_subseteq_cap","Zenon.zenon_subseteq_cap"],["zenon_subseteq_cap_0","Zenon.zenon_subseteq_cap_0"],["zenon_subseteq_cap_1","Zenon.zenon_subseteq_cap_1"],["zenon_trueistrue","Zenon.zenon_trueistrue"],["zenon_trueistrue_0","Zenon.zenon_trueistrue_0"],["zenon_tuple_acc_1","Zenon.zenon_tuple_acc_1"],["zenon_tuple_acc_2","Zenon.zenon_tuple_acc_2"],["zenon_tuple_dom_1","Zenon.zenon_tuple_dom_1"],["zenon_tuple_dom_2","Zenon.zenon_tuple_dom_2"],["zenon_tuple_dom_3","Zenon.zenon_tuple_dom_3"],["zenon_zero_lt","Zenon.zenon_zero_lt"]],"simps":[1701,657,918,917,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,1746,1747,1748,1749,1750,1751,1752,1753,1754,1755,1756,1757,1758,1759,1760,1761,1762,1763,1764,1765,1766,1767,1768,1769,1770,1771,1772,1773,1774,1775,1776,1777,1778,1779,1780,1781,1782,1783,1784,1785,1786,1787,1788,1789,1790,1791,1792,1793,1794,1795,1796,1797,1798,1799,1800,1801,1802,1803,1804,1805,1806,1807,1808,1809,1810,1811,1812,1813,1814,1815,1816,1817,1818,1819,1820,1821,1822,1823,1824,1825,1826,1827,1828,1829,1830,1831,1832,1833,1834,1835,1836,1837,1838,1839,1840,1841,1842,1843,1844,1845,1846,1847,1848,1849,1850,957,1851,1852,1853,1854,1855,1856,1857,1858,1859,1860,1861,1862,1863,1864,1865,1866,1867,1868,1869,1870,1871,1872,1873,1874,1875,1876,1877,1878,1879,0,1880,1881,1882,1883,1884,1885,1886,1887,1888,1889,1890,1891,1892,1893,1894,1895,1896,1897,1898,1899,1900,1901,1902,1903,1904,1905,1906,1907,1908,1909,1910,1911,1912,1913,1914,1915,1916,1917,1918,1919,1920,1921,1922,1923,1924,1925,1926,1927,1928,1929,1930,1931,1932,1933,1934,1935,1936,1937,1938,1939,1940,1941,1942,1943,1944,1945,1946,1947,1948,1949,1950,1951,1952,1953,2,1954,1955,1956,1957,1958,1959,1960,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2072,2073,2074,2075,2076,2077,2078,2079,2080,2081,2082,2083,2084,2085,2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099,2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134,2135,2136,2137,2138,2139,2140,2141,2142,2143,2144,2145,2146,2147,2148,2149,2150,2151,2152,2153,2154,2155,2156,2157,2158,2159,2160,2161,2162,2163,2164,2165,2166,2167,2168,2169,2170,2171,2172,2173,2174,2175,2176,2177,2178,2179,2180,2181,2182,2183,2184,2185,2186,2187,2188,2189,2190,2191,2192,2193,2194,2195,2196,2197,2198,2199,2200,2201,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2213,2214,2215,2216,2217,2218,2219,2220,2221,2222,2223,2224,2225,2226,2227,2228,2229,2230,2231,2232,2233,2234,2235,2236,2237,2238,2239,2240,2241,2242,2243,2244,2245,2246,2247,2248,2249,2250,2251,2252,2253,2254,2255,2256,2257,2258,2259,2260,2261,2262,832,799,656,1,2263,2264,2265,2266,2267,2268],"congs":[[true,"SetTheory.bEx",2269],[true,"SetTheory.bAll",2270],[true,"SetTheory.bChoose",2271],[true,"PredicateLogic.iff",2272],[true,"PredicateLogic.imp",2273],[true,"PredicateLogic.Choice",2274],[true,"PredicateLogic.simp_implies",899]],"weakCongs":[[true,"SetTheory.bChoose"],[true,"SetTheory.bEx"],[true,"SetTheory.bAll"],[true,"PredicateLogic.Choice"]],"simprocs":[["PredicateLogic.neq",[1005]]],"loopers":["split PredicateLogic.cond :: (PredicateLogic.c, (PredicateLogic.c, (PredicateLogic.c, PredicateLogic.c)fun)fun)fun"],"unsafeSolvers":["PredicateLogic unsafe"],"safeSolvers":["PredicateLogic safe"],"claset":{"safeIs":[[1369,1369,[2275],1369,[2275]],[1368,1368,[2276],1368,[2276]],[1340,1340,[2277],1340,[2277]],[1339,1339,[2278],1339,[2278]],[1338,1338,[2279],1338,[2279]],[1366,1366,[2280],1366,[2280]],[1392,1392,[2281],1392,[2281]],[1468,1468,[2282],1468,[2282]],[1302,1302,[2283],1302,[2283]],[1459,1459,[2284],1459,[2284]],[1418,1418,[2285],1418,[2285]],[2286,2286,[2287],2286,[2287]],[2288,2288,[2289],2288,[2289]],[2290,2290,[2291],2290,[2291]],[2292,2292,[2293],2292,[2293]],[1378,1378,[2294],1378,[2294]],[2295,2295,[2296],2295,[2296]],[2297,2297,[2298],2297,[2298]],[1271,1271,[2299],1271,[2299]],[2300,2300,[2301],2300,[2301]],[2302,2302,[2303],2302,[2303]],[1361,1361,[2304],1361,[2304]],[1405,1405,[2305],1405,[2305]],[1362,1362,[2306],1362,[2306]],[1363,1363,[2307],1363,[2307]],[1397,1397,[2308],1397,[2308]],[2309,2309,[2310],2309,[2310]],[2311,2311,[2312],2311,[2312]],[473,473,[2313],473,[2313]],[278,278,[2314],278,[2314]],[291,291,[2315],291,[2315]],[325,325,[2316],325,[2316]],[313,313,[2317],313,[2317]],[2318,2318,[2319],2318,[2319]],[2320,2320,[2321],2320,[2321]],[2322,2322,[2323],2322,[2323]],[2324,2324,[2325],2324,[2325]],[575,575,[2326],575,[2326]],[2327,2327,[2328],2327,[2328]],[2329,2329,[2330],2329,[2330]],[600,600,[2331],600,[2331]],[526,526,[2332],526,[2332]],[535,535,[2333],535,[2333]],[525,525,[2334],525,[2334]],[522,522,[2335],522,[2335]],[648,648,[2336],648,[2336]],[649,649,[2337],649,[2337]],[624,624,[2338],624,[2338]],[2339,2339,[2340],2339,[2340]],[2341,2341,[2342],2341,[2342]],[2343,2343,[2344],2343,[2344]],[2345,2345,[2346],2345,[2346]],[112,112,[2347],112,[2347]],[39,39,[2348],39,[2348]],[2349,2349,[2350],2349,[2350]],[2351,2351,[2352],2351,[2352]],[136,136,[2353],136,[2353]],[2354,2354,[2355],2354,[2355]],[2356,2356,[2357],2356,[2357]],[105,105,[2358],105,[2358]],[96,96,[2359],96,[2359]],[103,103,[2360],103,[2360]],[2361,2361,[2362],2361,[2362]],[2363,2363,[2364],2363,[2364]],[2365,2365,[2366],2365,[2366]],[79,79,[2367],79,[2367]],[2368,2368,[2369],2368,[2369]],[2370,2370,[2371],2370,[2371]],[120,120,[2372],120,[2372]],[119,119,[2373],119,[2373]],[56,56,[2374],56,[2374]],[124,124,[2375],124,[2375]],[83,83,[2376],83,[2376]],[2377,2377,[2378],2377,[2378]],[2379,2379,[2380],2379,[2380]],[2381,2381,[2382],2381,[2382]],[2383,2383,[2384],2383,[2384]],[2385,2385,[2386],2385,[2386]],[117,117,[2387],117,[2387]],[2388,2388,[2389],2388,[2389]],[2390,2390,[2391],2390,[2391]],[2392,2392,[2393],2392,[2393]],[2394,2394,[2395],2394,[2395]],[65,65,[2396],65,[2396]],[1189,1189,[2397],1189,[2397]],[1103,1103,[2398],1103,[2398]],[998,998,[2399],998,[2399]],[1239,1239,[2400],1239,[2400]],[972,972,[2401],972,[2401]],[1068,1068,[2402],1068,[2402]],[1072,1072,[2403],1072,[2403]],[1071,1071,[2404],1071,[2404]],[1221,1221,[2405],1221,[2405]],[2406,2406,[2407],2406,[2407]],[2408,2408,[2409],2408,[2409]],[2410,2410,[2411],2410,[2411]],[2412,2412,[2413],2412,[2413]],[2414,2414,[2415],2414,[2415]],[2416,2416,[2417],2416,[2417]],[2418,2418,[2419],2418,[2419]],[2420,2420,[2421],2420,[2421]],[2422,2422,[2423],2422,[2423]],[2424,2424,[2425],2424,[2425]],[2426,2426,[2427],2426,[2427]],[2428,2428,[2429],2428,[2429]],[2430,2430,[2431],2430,[2431]],[2432,2432,[2433],2432,[2433]],[2434,2434,[2435],2434,[2435]],[2436,2436,[2437],2436,[2437]],[2438,2438,[2439],2438,[2439]],[2440,2440,[2441],2440,[2441]],[1225,1225,[2442],1225,[2442]],[1210,1210,[2443],1210,[2443]],[1009,1009,[2444],1009,[2444]],[2445,2445,[2446],2445,[2446]],[2447,2447,[2448],2447,[2448]],[2449,2449,[2450],2449,[2450]],[2451,2451,[2452],2451,[2452]],[2453,2453,[2454],2453,[2454]],[2455,2455,[2456],2455,[2456]],[2457,2457,[2458],2457,[2458]],[2459,2459,[2460],2459,[2460]],[1163,1163,[2461],1163,[2461]],[1212,1212,[2462],1212,[2462]],[1028,1028,[2463],1028,[2463]],[1011,1011,[2464],1011,[2464]],[1166,1166,[2465],1166,[2465]],[1089,1089,[2466],1089,[2466]],[2467,2467,[2468],2467,[2468]],[791,791,[2469],791,[2469]],[2470,2470,[2471],2470,[2471]],[2472,2472,[2473],2472,[2473]],[2474,2474,[2475],2474,[2475]],[2476,2476,[2477],2476,[2477]],[2478,2478,[2479],2478,[2479]],[2480,2480,[2481],2480,[2481]],[2482,2482,[2483],2482,[2483]],[2484,2484,[2485],2484,[2485]],[2486,2486,[2487],2486,[2487]],[2488,2488,[2489],2488,[2489]],[2490,2490,[2491],2490,[2491]],[2492,2492,[2493],2492,[2493]],[2494,2494,[2495],2494,[2495]],[2496,2496,[2497],2496,[2497]],[2498,2498,[2499],2498,[2499]],[2500,2500,[2501],2500,[2501]],[2502,2502,[2503],2502,[2503]],[2504,2504,[2505],2504,[2505]],[2506,2506,[2507],2506,[2507]],[2508,2508,[2509],2508,[2509]],[2510,2510,[2511],2510,[2511]],[2512,2512,[2513],2512,[2513]],[660,660,[2514],660,[2514]],[794,794,[2515],794,[2515]],[807,807,[2516],807,[2516]],[823,823,[2517],823,[2517]],[877,877,[2518],877,[2518]],[662,662,[2519],662,[2519]],[860,860,[2520],860,[2520]],[833,833,[2521],833,[2521]],[783,783,[2522],783,[2522]],[690,690,[2523],690,[2523]],[797,797,[2524],797,[2524]],[915,915,[2525],915,[2525]],[687,687,[2526],687,[2526]],[659,659,[2527],659,[2527]],[743,743,[2528],743,[2528]],[741,741,[2529],741,[2529]],[738,738,[2530],738,[2530]],[806,806,[2531],806,[2531]],[859,859,[2532],859,[2532]],[822,822,[2533],822,[2533]],[767,767,[2534],767,[2534]],[750,750,[2535],750,[2535]],[914,914,[2536],914,[2536]],[895,895,[2537],895,[2537]]],"safeEs":[[1417,1417,[],1417,[]],[1329,2538,[],2538,[]],[1273,1273,[],1273,[]],[1381,2539,[],2539,[]],[1377,2540,[],2540,[]],[1270,1270,[],1270,[]],[1295,1295,[],1295,[]],[236,2541,[],2541,[]],[285,2542,[],2542,[]],[273,2543,[],2543,[]],[242,2544,[],2544,[]],[288,2545,[],2545,[]],[290,2546,[],2546,[]],[2547,2547,[],2547,[]],[317,317,[],317,[]],[2548,2548,[],2548,[]],[316,316,[],316,[]],[324,324,[],324,[]],[322,322,[],322,[]],[48,48,[],48,[]],[71,71,[],71,[]],[63,63,[],63,[]],[62,62,[],62,[]],[1188,1188,[],1188,[]],[1099,1099,[],1099,[]],[995,995,[],995,[]],[1240,1240,[],1240,[]],[2549,2550,[],2550,[]],[1065,1065,[],1065,[]],[979,979,[],979,[]],[1219,1219,[],1219,[]],[1177,1177,[],1177,[]],[1026,1026,[],1026,[]],[1165,1165,[],1165,[]],[834,834,[],834,[]],[681,681,[],681,[]],[792,792,[],792,[]],[742,742,[],742,[]],[740,740,[],740,[]],[737,737,[],737,[]],[802,802,[],802,[]],[796,796,[],796,[]],[819,819,[],819,[]],[766,766,[],766,[]],[749,749,[],749,[]]],"unsafeIs":[[1391,1391,[2551],2552,[2553]],[1467,1467,[2554],2555,[2556]],[1301,1301,[2557],2558,[2559]],[1415,1415,[2560],2561,[2562]],[1430,1430,[2563],2564,[2565]],[1333,1333,[2566],2567,[2568]],[1275,1275,[2569],2570,[2571]],[1274,1274,[2572],2573,[2574]],[1389,1389,[2575],2576,[2577]],[1387,1387,[2578],2579,[2580]],[1382,1382,[2581],2582,[2583]],[1375,1375,[2584],2585,[2586]],[1400,1400,[2587],2588,[2589]],[1399,1399,[2590],2591,[2592]],[1402,1402,[2593],2594,[2595]],[1401,1401,[2596],2597,[2598]],[1319,1319,[2599],2600,[2601]],[1318,1318,[2602],2603,[2604]],[1320,1320,[2605],2606,[2607]],[1291,1291,[2608],2609,[2610]],[1282,1282,[2611],2612,[2613]],[1395,1395,[2614],2615,[2616]],[506,506,[2617],2618,[2619]],[470,470,[2620],2621,[2622]],[477,477,[2623],2624,[2625]],[489,489,[2626],2627,[2628]],[490,490,[2629],2630,[2631]],[508,508,[2632],2633,[2634]],[476,476,[2635],2636,[2637]],[485,485,[2638],2639,[2640]],[472,472,[2641],2642,[2643]],[2644,2644,[2645],2646,[2647]],[2648,2648,[2649],2650,[2651]],[302,302,[2652],2653,[2654]],[425,425,[2655],2656,[2657]],[424,424,[2658],2659,[2660]],[427,427,[2661],2662,[2663]],[426,426,[2664],2665,[2666]],[421,421,[2667],2668,[2669]],[420,420,[2670],2671,[2672]],[309,309,[2673],2674,[2675]],[308,308,[2676],2677,[2678]],[347,347,[2679],2680,[2681]],[284,284,[2682],2683,[2684]],[265,265,[2685],2686,[2687]],[283,283,[2688],2689,[2690]],[295,295,[2691],2692,[2693]],[237,237,[2694],2695,[2696]],[286,286,[2697],2698,[2699]],[274,274,[2700],2701,[2702]],[243,243,[2703],2704,[2705]],[272,272,[2706],2707,[2708]],[241,241,[2709],2710,[2711]],[240,240,[2712],2713,[2714]],[2715,2715,[2716],2717,[2718]],[349,349,[2719],2720,[2721]],[2722,2722,[2723],2724,[2725]],[348,348,[2726],2727,[2728]],[330,330,[2729],2730,[2731]],[184,184,[2732],2733,[2734]],[557,557,[2735],2736,[2737]],[111,111,[2738],111,[2738]],[82,82,[2739],2740,[2741]],[80,80,[2742],2743,[2744]],[959,959,[2745],2746,[2747]],[980,980,[2748],2749,[2750]],[1181,1181,[2751],2752,[2753]],[1027,1027,[2754],2755,[2756]],[908,908,[2757],2758,[2759]],[686,686,[2760],2761,[2762]],[695,695,[2763],2764,[2765]],[724,724,[2766],2767,[2768]],[723,723,[2769],2770,[2771]],[793,793,[2772],2773,[2774]]],"unsafeEs":[[2775,2776,[],2777,[]],[1465,1465,[],2778,[]],[1300,1300,[],2779,[]],[1337,2780,[],2781,[]],[1388,2782,[],2783,[]],[1386,2784,[],2785,[]],[1424,1424,[],2786,[]],[1423,1423,[],2787,[]],[1374,1374,[],2788,[]],[1439,1439,[],2789,[]],[1290,1290,[],2790,[]],[1394,1394,[],2791,[]],[471,2792,[],2793,[]],[299,299,[],2794,[]],[173,173,[],2795,[]],[172,172,[],2796,[]],[170,170,[],2797,[]],[169,169,[],2798,[]],[282,2799,[],2800,[]],[294,2801,[],2802,[]],[2803,2803,[],2804,[]],[218,218,[],2805,[]],[2806,2806,[],2807,[]],[2808,2808,[],2809,[]],[2810,2811,[],2812,[]],[2813,2814,[],2815,[]],[2816,2817,[],2818,[]],[2819,2820,[],2821,[]],[2822,2822,[],2823,[]],[2824,2824,[],2825,[]],[2826,2826,[],2827,[]],[2828,2828,[],2829,[]],[76,76,[],2830,[]],[2831,2831,[],2832,[]],[68,68,[],2833,[]],[1203,1203,[],2834,[]],[1000,1000,[],2835,[]],[958,2836,[],2837,[]],[2838,2838,[],2839,[]],[2840,2840,[],2841,[]],[2842,2842,[],2843,[]],[2844,2844,[],2845,[]],[2846,2846,[],2847,[]],[2848,2848,[],2849,[]],[2850,2850,[],2851,[]],[2852,2852,[],2853,[]],[2854,2854,[],2855,[]],[2856,2856,[],2857,[]],[2858,2858,[],2859,[]],[2860,2860,[],2861,[]],[2862,2862,[],2863,[]],[2864,2864,[],2865,[]],[2866,2866,[],2867,[]],[2868,2868,[],2869,[]],[2870,2870,[],2871,[]],[2872,2872,[],2873,[]],[2874,2874,[],2875,[]],[2876,2876,[],2877,[]],[1205,1205,[],2878,[]],[1207,1207,[],2879,[]],[1008,1008,[],2880,[]],[658,658,[],661,[]]],"swrappers":[],"uwrappers":["bspec"],"safe0":[[[-289,0,522],[-287,0,648],[-285,0,649],[-347,0,1361],[-142,0,1225],[-190,0,1068],[-345,0,1405],[-293,0,535],[-305,0,2324],[-299,0,2329],[-1,0,895],[-255,0,105],[-253,0,96],[-341,0,1363],[-219,0,2385],[-207,0,65],[-233,0,56],[-231,0,124],[-269,0,112],[-291,0,525],[-303,0,575],[-297,0,600],[-343,0,1362],[-108,0,1089],[-115,0,1028],[-113,0,1011],[-117,0,1212],[-369,0,1418],[-42,0,783],[-119,0,1163],[-54,0,807],[-52,0,823],[-379,0,1366],[-377,0,1392],[-48,0,662],[-50,0,877],[-261,0,136],[-251,0,103],[-315,0,325],[-339,0,1397],[-217,0,117],[-371,0,1459],[-56,0,794],[-375,0,1468],[-58,0,660],[-46,0,860],[-373,0,1302],[-39,0,690],[-35,0,915],[-37,0,797],[-3,0,914]],[[-391,1,1295],[-185,1,1065],[-318,1,324],[-317,1,322],[-290,1,2335],[-288,1,2336],[-286,1,2337],[-348,1,2304],[-143,1,2442],[-191,1,2402],[-346,1,2305],[-294,1,2333],[-306,1,2325],[-300,1,2330],[-2,1,2537],[-256,1,2358],[-254,1,2359],[-342,1,2307],[-220,1,2386],[-208,1,2396],[-234,1,2374],[-232,1,2375],[-270,1,2347],[-292,1,2334],[-304,1,2326],[-298,1,2331],[-344,1,2306],[-109,1,2466],[-116,1,2463],[-114,1,2464],[-118,1,2462],[-370,1,2285],[-43,1,2522],[-120,1,2461],[-55,1,2516],[-53,1,2517],[-380,1,2280],[-378,1,2281],[-49,1,2519],[-51,1,2518],[-262,1,2353],[-252,1,2360],[-316,1,2316],[-340,1,2308],[-218,1,2387],[-372,1,2284],[-57,1,2515],[-376,1,2282],[-59,1,2514],[-47,1,2520],[-374,1,2283],[-40,1,2523],[-36,1,2525],[-38,1,2524],[-4,1,2536],[-24,1,796]]],"safep":[[[1999985,0,738],[999615,0,1340],[999705,0,526],[999693,0,2322],[999699,0,2327],[999717,0,624],[1999799,0,1103],[999804,0,1239],[999802,0,998],[2999771,0,83],[1999796,0,1189],[1999819,0,1221],[3999647,0,1271],[2999733,0,39],[3999641,0,1378],[999808,0,972],[999863,0,1009],[999860,0,1210],[3999775,0,2379],[1999983,0,741],[1999639,0,2292],[1999879,0,2459],[2999779,0,2383],[1999871,0,2451],[1999875,0,2455],[999757,0,79],[1999836,0,2420],[1999840,0,2424],[3999761,0,2370],[2999765,0,119],[1999856,0,2440],[1999867,0,2447],[1999787,0,2390],[1999928,0,2500],[1999635,0,2288],[1999906,0,2478],[1999910,0,2482],[1999824,0,2408],[1999832,0,2416],[1999828,0,2412],[1999651,0,2302],[2999665,0,2311],[1999918,0,2490],[1999914,0,2486],[1999737,0,2351],[1999753,0,2363],[1999743,0,2356],[1999613,0,1368],[1999691,0,2320],[1999645,0,2297],[1999844,0,2428],[1999848,0,2432],[1999619,0,1338],[1999791,0,2394],[1999852,0,2436],[1999900,0,2472],[1999904,0,2476],[1999924,0,2496],[999896,0,791],[1999940,0,2512],[3999773,0,2377],[1999981,0,743],[1999637,0,2290],[1999877,0,2457],[2999777,0,2381],[1999869,0,2449],[1999873,0,2453],[999755,0,2365],[1999834,0,2418],[1999838,0,2422],[3999759,0,2368],[2999763,0,120],[1999854,0,2438],[1999865,0,2445],[1999785,0,2388],[1999926,0,2498],[1999633,0,2286],[1999908,0,2480],[1999912,0,2484],[1999822,0,2406],[1999830,0,2414],[1999826,0,2410],[1999649,0,2300],[2999663,0,2309],[1999920,0,2492],[1999916,0,2488],[1999735,0,2349],[1999751,0,2361],[1999741,0,2354],[1999611,0,1369],[1999689,0,2318],[1999643,0,2295],[1999842,0,2426],[1999846,0,2430],[1999617,0,1339],[1999789,0,2392],[1999850,0,2434],[1999898,0,2470],[1999902,0,2474],[1999922,0,2494],[1999938,0,2510],[1999719,0,2339],[1999723,0,2343],[999814,0,1071],[999934,0,2506],[1999930,0,2502],[1999721,0,2341],[1999725,0,2345],[999812,0,1072],[999936,0,2508],[1999932,0,2504],[999894,0,2467],[1999890,0,1166],[1999987,0,806],[999991,0,822],[1999995,0,750],[999993,0,767],[2999674,0,278],[2999677,0,291],[999971,0,659],[999989,0,859],[1999956,0,833],[1999667,0,473],[1999687,0,313],[999968,0,687]],[[1999974,1,737],[999797,1,1099],[1999805,1,1240],[2999604,1,2538],[1999800,1,995],[1999726,1,48],[2999727,1,71],[1999606,1,2539],[999820,1,1177],[999794,1,1188],[999817,1,1219],[999608,1,1270],[999605,1,1273],[1999607,1,2540],[999816,1,979],[999806,1,2550],[999861,1,1026],[999603,1,1417],[1999973,1,740],[1999972,1,742],[999888,1,1165],[1999975,1,802],[1999977,1,819],[999979,1,749],[1999978,1,766],[2999672,1,2545],[3999670,1,2543],[2999675,1,2546],[2999669,1,2542],[2999668,1,2541],[3999671,1,2544],[999678,1,2547],[999679,1,317],[999680,1,2548],[999681,1,316],[2999728,1,63],[2999729,1,62],[999969,1,792],[1999984,1,2530],[999614,1,2277],[999704,1,2332],[999692,1,2323],[999698,1,2328],[999716,1,2338],[1999798,1,2398],[999803,1,2400],[999801,1,2399],[2999770,1,2376],[1999795,1,2397],[1999818,1,2405],[3999646,1,2299],[2999732,1,2348],[3999640,1,2294],[999807,1,2401],[999862,1,2444],[999859,1,2443],[3999774,1,2380],[1999982,1,2529],[1999638,1,2293],[1999878,1,2460],[2999778,1,2384],[1999870,1,2452],[1999874,1,2456],[999756,1,2367],[1999835,1,2421],[1999839,1,2425],[3999760,1,2371],[2999764,1,2373],[1999855,1,2441],[1999866,1,2448],[1999786,1,2391],[1999927,1,2501],[1999634,1,2289],[1999905,1,2479],[1999909,1,2483],[1999823,1,2409],[1999831,1,2417],[1999827,1,2413],[1999650,1,2303],[2999664,1,2312],[1999917,1,2491],[1999913,1,2487],[1999736,1,2352],[1999752,1,2364],[1999742,1,2357],[1999612,1,2276],[1999690,1,2321],[1999644,1,2298],[1999843,1,2429],[1999847,1,2433],[1999618,1,2279],[1999790,1,2395],[1999851,1,2437],[1999899,1,2473],[1999903,1,2477],[1999923,1,2497],[999895,1,2469],[1999939,1,2513],[3999772,1,2378],[1999980,1,2528],[1999636,1,2291],[1999876,1,2458],[2999776,1,2382],[1999868,1,2450],[1999872,1,2454],[999754,1,2366],[1999833,1,2419],[1999837,1,2423],[3999758,1,2369],[2999762,1,2372],[1999853,1,2439],[1999864,1,2446],[1999784,1,2389],[1999925,1,2499],[1999632,1,2287],[1999907,1,2481],[1999911,1,2485],[1999821,1,2407],[1999829,1,2415],[1999825,1,2411],[1999648,1,2301],[2999662,1,2310],[1999919,1,2493],[1999915,1,2489],[1999734,1,2350],[1999750,1,2362],[1999740,1,2355],[1999610,1,2275],[1999688,1,2319],[1999642,1,2296],[1999841,1,2427],[1999845,1,2431],[1999616,1,2278],[1999788,1,2393],[1999849,1,2435],[1999897,1,2471],[1999901,1,2475],[1999921,1,2495],[1999937,1,2511],[1999718,1,2340],[1999722,1,2344],[999813,1,2404],[999933,1,2507],[1999929,1,2503],[1999720,1,2342],[1999724,1,2346],[999811,1,2403],[999935,1,2509],[1999931,1,2505],[999893,1,2468],[1999889,1,2465],[1999986,1,2531],[999990,1,2533],[1999994,1,2535],[999992,1,2534],[2999673,1,2314],[2999676,1,2315],[999970,1,2527],[999988,1,2532],[1999955,1,2521],[1999666,1,2313],[1999686,1,2317],[999967,1,2526],[1999959,1,834],[999966,1,681]]],"unsafe":[[[3999813,0,1333],[999817,0,1274],[1999952,0,80],[2999849,0,470],[2999847,0,506],[1999931,0,184],[1999929,0,330],[999950,0,82],[1999823,0,1382],[1999961,0,1181],[2999871,0,302],[1999815,0,1275],[1999841,0,1291],[1999957,0,959],[1999959,0,980],[999819,0,1389],[999821,0,1387],[999939,0,557],[2999825,0,1375],[1999985,0,1027],[1999811,0,1430],[999809,0,1415],[2999988,0,908],[4999827,0,1400],[1999868,0,2648],[1999843,0,1282],[1999996,0,723],[999992,0,695],[999990,0,686],[4999829,0,1399],[1999866,0,2644],[1999994,0,724],[1999833,0,1401],[1999831,0,1402],[999803,0,1391],[999857,0,508],[4999851,0,477],[1999853,0,489],[1999855,0,490],[999861,0,485],[3999864,0,472],[999859,0,476],[-52,0,111],[2999909,0,274],[999913,0,272],[2999907,0,286],[2999905,0,237],[2999911,0,243],[999915,0,241],[4999885,0,421],[4999887,0,420],[2999889,0,309],[2999891,0,308],[999919,0,240],[2999900,0,283],[999895,0,284],[2999903,0,295],[999897,0,265],[4999873,0,425],[4999875,0,424],[4999877,0,427],[4999879,0,426],[1999921,0,2715],[1999923,0,349],[1999925,0,2722],[1999927,0,348],[1999893,0,347],[999839,0,1320],[2999845,0,1395],[999835,0,1319],[999837,0,1318],[999999,0,793],[999805,0,1467],[999807,0,1301]],[[999796,1,1424],[999797,1,1423],[999798,1,1374],[999944,1,76],[2999945,1,2831],[999946,1,68],[999869,1,299],[2999799,1,1439],[999800,1,1290],[999955,1,2836],[1999793,1,2780],[1999794,1,2782],[1999795,1,2784],[1999986,1,1008],[999954,1,1000],[1999953,1,1203],[1999982,1,1205],[999983,1,1207],[1999969,1,2852],[1999971,1,2856],[2999937,1,2820],[2999934,1,2811],[2999935,1,2814],[1999979,1,2872],[1999963,1,2840],[1999967,1,2848],[1999965,1,2844],[1999933,1,2808],[2999936,1,2817],[1999973,1,2860],[1999975,1,2864],[1999977,1,2868],[1999968,1,2850],[1999970,1,2854],[1999978,1,2870],[1999962,1,2838],[1999966,1,2846],[1999964,1,2842],[1999932,1,2806],[1999972,1,2858],[1999974,1,2862],[1999976,1,2866],[1999940,1,2822],[1999942,1,2826],[1999980,1,2874],[1999941,1,2824],[1999943,1,2828],[1999981,1,2876],[1999790,1,2776],[2999862,1,2792],[3999880,1,173],[3999881,1,172],[3999882,1,170],[3999883,1,169],[2999916,1,2803],[2999917,1,218],[2999898,1,2799],[2999901,1,2801],[999801,1,1394],[1999791,1,1465],[999997,1,658],[3999812,1,2566],[999816,1,2572],[1999951,1,2742],[2999848,1,2620],[2999846,1,2617],[1999930,1,2732],[1999928,1,2729],[999949,1,2739],[1999822,1,2581],[1999960,1,2751],[2999870,1,2652],[1999814,1,2569],[1999840,1,2608],[1999956,1,2745],[1999958,1,2748],[999818,1,2575],[999820,1,2578],[999938,1,2735],[2999824,1,2584],[1999984,1,2754],[1999810,1,2563],[999808,1,2560],[2999987,1,2757],[4999826,1,2587],[1999867,1,2649],[1999842,1,2611],[1999995,1,2769],[999991,1,2763],[999989,1,2760],[4999828,1,2590],[1999865,1,2645],[1999993,1,2766],[1999832,1,2596],[1999830,1,2593],[999802,1,2551],[999856,1,2632],[4999850,1,2623],[1999852,1,2626],[1999854,1,2629],[999860,1,2638],[3999863,1,2641],[999858,1,2635],[-53,1,2738],[2999908,1,2700],[999912,1,2706],[2999906,1,2697],[2999904,1,2694],[2999910,1,2703],[999914,1,2709],[4999884,1,2667],[4999886,1,2670],[2999888,1,2673],[2999890,1,2676],[999918,1,2712],[2999899,1,2688],[999894,1,2682],[2999902,1,2691],[999896,1,2685],[4999872,1,2655],[4999874,1,2658],[4999876,1,2661],[4999878,1,2664],[1999920,1,2716],[1999922,1,2719],[1999924,1,2723],[1999926,1,2726],[1999892,1,2679],[999838,1,2605],[2999844,1,2614],[999834,1,2599],[999836,1,2602],[999998,1,2772],[999804,1,2554],[999806,1,2557],[1999792,1,1300]]],"dup":[[[3999813,0,2567],[999817,0,2573],[1999952,0,2743],[2999849,0,2621],[2999847,0,2618],[1999931,0,2733],[1999929,0,2730],[999950,0,2740],[1999823,0,2582],[1999961,0,2752],[2999871,0,2653],[1999815,0,2570],[1999841,0,2609],[1999957,0,2746],[1999959,0,2749],[999819,0,2576],[999821,0,2579],[999939,0,2736],[2999825,0,2585],[1999985,0,2755],[1999811,0,2564],[999809,0,2561],[2999988,0,2758],[4999827,0,2588],[1999868,0,2650],[1999843,0,2612],[1999996,0,2770],[999992,0,2764],[999990,0,2761],[4999829,0,2591],[1999866,0,2646],[1999994,0,2767],[1999833,0,2597],[1999831,0,2594],[999803,0,2552],[999857,0,2633],[4999851,0,2624],[1999853,0,2627],[1999855,0,2630],[999861,0,2639],[3999864,0,2642],[999859,0,2636],[-52,0,111],[2999909,0,2701],[999913,0,2707],[2999907,0,2698],[2999905,0,2695],[2999911,0,2704],[999915,0,2710],[4999885,0,2668],[4999887,0,2671],[2999889,0,2674],[2999891,0,2677],[999919,0,2713],[2999900,0,2689],[999895,0,2683],[2999903,0,2692],[999897,0,2686],[4999873,0,2656],[4999875,0,2659],[4999877,0,2662],[4999879,0,2665],[1999921,0,2717],[1999923,0,2720],[1999925,0,2724],[1999927,0,2727],[1999893,0,2680],[999839,0,2606],[2999845,0,2615],[999835,0,2600],[999837,0,2603],[999999,0,2773],[999805,0,2555],[999807,0,2558]],[[999796,1,2786],[999797,1,2787],[999798,1,2788],[999944,1,2830],[2999945,1,2832],[999946,1,2833],[999869,1,2794],[2999799,1,2789],[999800,1,2790],[999955,1,2837],[1999793,1,2781],[1999794,1,2783],[1999795,1,2785],[1999986,1,2880],[999954,1,2835],[1999953,1,2834],[1999982,1,2878],[999983,1,2879],[1999969,1,2853],[1999971,1,2857],[2999937,1,2821],[2999934,1,2812],[2999935,1,2815],[1999979,1,2873],[1999963,1,2841],[1999967,1,2849],[1999965,1,2845],[1999933,1,2809],[2999936,1,2818],[1999973,1,2861],[1999975,1,2865],[1999977,1,2869],[1999968,1,2851],[1999970,1,2855],[1999978,1,2871],[1999962,1,2839],[1999966,1,2847],[1999964,1,2843],[1999932,1,2807],[1999972,1,2859],[1999974,1,2863],[1999976,1,2867],[1999940,1,2823],[1999942,1,2827],[1999980,1,2875],[1999941,1,2825],[1999943,1,2829],[1999981,1,2877],[1999790,1,2777],[2999862,1,2793],[3999880,1,2795],[3999881,1,2796],[3999882,1,2797],[3999883,1,2798],[2999916,1,2804],[2999917,1,2805],[2999898,1,2800],[2999901,1,2802],[999801,1,2791],[1999791,1,2778],[999997,1,661],[3999812,1,2568],[999816,1,2574],[1999951,1,2744],[2999848,1,2622],[2999846,1,2619],[1999930,1,2734],[1999928,1,2731],[999949,1,2741],[1999822,1,2583],[1999960,1,2753],[2999870,1,2654],[1999814,1,2571],[1999840,1,2610],[1999956,1,2747],[1999958,1,2750],[999818,1,2577],[999820,1,2580],[999938,1,2737],[2999824,1,2586],[1999984,1,2756],[1999810,1,2565],[999808,1,2562],[2999987,1,2759],[4999826,1,2589],[1999867,1,2651],[1999842,1,2613],[1999995,1,2771],[999991,1,2765],[999989,1,2762],[4999828,1,2592],[1999865,1,2647],[1999993,1,2768],[1999832,1,2598],[1999830,1,2595],[999802,1,2553],[999856,1,2634],[4999850,1,2625],[1999852,1,2628],[1999854,1,2631],[999860,1,2640],[3999863,1,2643],[999858,1,2637],[-53,1,2738],[2999908,1,2702],[999912,1,2708],[2999906,1,2699],[2999904,1,2696],[2999910,1,2705],[999914,1,2711],[4999884,1,2669],[4999886,1,2672],[2999888,1,2675],[2999890,1,2678],[999918,1,2714],[2999899,1,2690],[999894,1,2684],[2999902,1,2693],[999896,1,2687],[4999872,1,2657],[4999874,1,2660],[4999876,1,2663],[4999878,1,2666],[1999920,1,2718],[1999922,1,2721],[1999924,1,2725],[1999926,1,2728],[1999892,1,2681],[999838,1,2607],[2999844,1,2616],[999834,1,2601],[999836,1,2604],[999998,1,2774],[999804,1,2556],[999806,1,2559],[1999792,1,2779]]],"extra":[[[0,-8,0,738],[1,-119,0,1333],[1,-117,0,1274],[0,-212,0,1340],[1,-38,0,80],[0,-161,0,526],[0,-167,0,2322],[0,-164,0,2327],[1,-101,0,470],[1,-102,0,506],[1,-55,0,184],[1,-56,0,330],[0,-155,0,624],[1,-39,0,82],[0,-111,0,1103],[0,-108,0,1239],[0,-109,0,998],[0,-126,0,83],[1,-114,0,1382],[1,-32,0,1181],[0,-113,0,1189],[0,-98,0,1221],[0,-196,0,1271],[0,-145,0,39],[1,-89,0,302],[1,-118,0,1275],[1,-105,0,1291],[0,-199,0,1378],[1,-34,0,959],[1,-33,0,980],[0,-105,0,972],[1,-116,0,1389],[1,-115,0,1387],[1,-48,0,557],[0,-158,0,522],[0,-157,0,648],[0,-156,0,649],[0,-193,0,1361],[1,-113,0,1375],[1,-9,0,1027],[0,-75,0,1009],[1,-120,0,1430],[0,-78,0,1225],[0,-77,0,1210],[0,-104,0,1068],[1,-121,0,1415],[0,-124,0,2379],[1,-7,0,908],[0,-9,0,741],[0,-200,0,2292],[0,-67,0,2459],[0,-122,0,2383],[0,-71,0,2451],[1,-112,0,1400],[0,-69,0,2455],[0,-133,0,79],[0,-89,0,2420],[0,-87,0,2424],[0,-131,0,2370],[0,-129,0,119],[0,-79,0,2440],[0,-73,0,2447],[0,-118,0,2390],[0,-42,0,2500],[0,-202,0,2288],[0,-53,0,2478],[0,-51,0,2482],[0,-95,0,2408],[0,-91,0,2416],[0,-93,0,2412],[0,-194,0,2302],[0,-187,0,2311],[0,-47,0,2490],[0,-49,0,2486],[0,-143,0,2351],[0,-135,0,2363],[0,-140,0,2356],[1,-91,0,2648],[0,-213,0,1368],[1,-104,0,1282],[0,-192,0,1405],[0,-168,0,2320],[0,-197,0,2297],[0,-85,0,2428],[0,-83,0,2432],[0,-210,0,1338],[0,-116,0,2394],[0,-160,0,535],[0,-166,0,2324],[0,-163,0,2329],[0,-81,0,2436],[0,-56,0,2472],[0,-54,0,2476],[0,-44,0,2496],[1,-3,0,723],[0,-58,0,791],[0,-36,0,2512],[1,-5,0,695],[1,-6,0,686],[0,-125,0,2377],[0,-10,0,743],[0,-201,0,2290],[0,-68,0,2457],[0,-123,0,2381],[0,-72,0,2449],[1,-111,0,1399],[0,-70,0,2453],[0,-134,0,2365],[0,-90,0,2418],[0,-88,0,2422],[0,-132,0,2368],[0,-130,0,120],[0,-80,0,2438],[0,-74,0,2445],[0,-119,0,2388],[0,-43,0,2498],[0,-203,0,2286],[0,-52,0,2480],[0,-50,0,2484],[0,-96,0,2406],[0,-92,0,2414],[0,-94,0,2410],[0,-195,0,2300],[0,-188,0,2309],[0,-46,0,2492],[0,-48,0,2488],[0,-144,0,2349],[0,-136,0,2361],[0,-141,0,2354],[1,-92,0,2644],[0,-214,0,1369],[0,-169,0,2318],[0,-198,0,2295],[0,-86,0,2426],[0,-84,0,2430],[0,-211,0,1339],[0,-117,0,2392],[0,-82,0,2434],[0,-57,0,2470],[0,-55,0,2474],[0,-45,0,2494],[1,-4,0,724],[0,-37,0,2510],[0,-1,0,895],[0,-154,0,2339],[0,-152,0,2343],[1,-109,0,1401],[0,-102,0,1071],[0,-39,0,2506],[0,-41,0,2502],[0,-153,0,2341],[0,-151,0,2345],[1,-110,0,1402],[0,-103,0,1072],[0,-38,0,2508],[0,-40,0,2504],[0,-59,0,2467],[0,-61,0,1166],[0,-7,0,806],[0,-5,0,822],[1,-124,0,1391],[1,-97,0,508],[1,-100,0,477],[1,-99,0,489],[1,-98,0,490],[1,-95,0,485],[1,-93,0,472],[1,-96,0,476],[0,-3,0,750],[0,-4,0,767],[1,-40,0,111],[0,-139,0,105],[0,-138,0,96],[0,-180,0,278],[1,-67,0,274],[1,-65,0,272],[0,-178,0,291],[1,-68,0,286],[1,-69,0,237],[1,-66,0,243],[1,-64,0,241],[1,-80,0,421],[1,-79,0,420],[1,-78,0,309],[1,-77,0,308],[1,-61,0,240],[1,-72,0,283],[1,-75,0,284],[1,-70,0,295],[1,-74,0,265],[1,-88,0,425],[1,-87,0,424],[1,-86,0,427],[1,-85,0,426],[1,-60,0,2715],[1,-59,0,349],[1,-58,0,2722],[1,-57,0,348],[1,-76,0,347],[1,-106,0,1320],[1,-103,0,1395],[0,-190,0,1363],[0,-121,0,2385],[0,-115,0,65],[1,-108,0,1319],[1,-107,0,1318],[0,-128,0,56],[0,-127,0,124],[0,-146,0,112],[0,-159,0,525],[0,-165,0,575],[0,-162,0,600],[0,-191,0,1362],[1,-1,0,793],[1,-123,0,1467],[0,-19,0,659],[0,-6,0,859],[1,-122,0,1301],[0,-28,0,833],[0,-60,0,1089],[0,-64,0,1028],[0,-63,0,1011],[0,-65,0,1212],[0,-204,0,1418],[0,-27,0,783],[0,-66,0,1163],[0,-33,0,807],[0,-32,0,823],[0,-209,0,1366],[0,-208,0,1392],[0,-186,0,473],[0,-30,0,662],[0,-31,0,877],[0,-142,0,136],[0,-137,0,103],[0,-170,0,313],[0,-171,0,325],[0,-189,0,1397],[0,-120,0,117],[0,-205,0,1459],[0,-34,0,794],[0,-207,0,1468],[0,-35,0,660],[0,-29,0,860],[0,-206,0,1302],[0,-25,0,690],[0,-23,0,915],[0,-24,0,797],[0,-21,0,687],[0,-2,0,914]],[[0,-16,1,737],[1,-130,1,1424],[1,-129,1,1423],[1,-128,1,1374],[1,-43,1,76],[0,-112,1,1099],[0,-107,1,1240],[0,-220,1,1329],[0,-110,1,995],[1,-42,1,2831],[1,-41,1,68],[0,-150,1,48],[0,-149,1,71],[0,-218,1,1381],[0,-97,1,1177],[0,-114,1,1188],[0,-99,1,1219],[0,-216,1,1270],[1,-90,1,299],[0,-219,1,1273],[1,-127,1,1439],[1,-126,1,1290],[0,-215,1,1295],[0,-217,1,1377],[1,-35,1,958],[0,-100,1,979],[1,-133,1,1337],[0,-106,1,2549],[1,-132,1,1388],[1,-131,1,1386],[0,-101,1,1065],[0,-76,1,1026],[1,-8,1,1008],[1,-36,1,1000],[1,-37,1,1203],[1,-11,1,1205],[1,-10,1,1207],[0,-221,1,1417],[0,-17,1,740],[1,-24,1,2852],[1,-22,1,2856],[1,-49,1,2819],[1,-52,1,2810],[1,-51,1,2813],[1,-14,1,2872],[1,-30,1,2840],[1,-26,1,2848],[1,-28,1,2844],[1,-53,1,2808],[1,-50,1,2816],[1,-20,1,2860],[1,-18,1,2864],[1,-16,1,2868],[0,-18,1,742],[1,-25,1,2850],[1,-23,1,2854],[1,-15,1,2870],[1,-31,1,2838],[1,-27,1,2846],[1,-29,1,2842],[1,-54,1,2806],[1,-21,1,2858],[1,-19,1,2862],[1,-17,1,2866],[1,-47,1,2822],[1,-45,1,2826],[1,-13,1,2874],[1,-46,1,2824],[1,-44,1,2828],[1,-12,1,2876],[0,-62,1,1165],[0,-15,1,802],[0,-13,1,819],[1,-136,1,2775],[1,-94,1,471],[0,-11,1,749],[0,-12,1,766],[1,-84,1,173],[1,-83,1,172],[0,-181,1,288],[0,-183,1,273],[0,-179,1,290],[0,-184,1,285],[1,-82,1,170],[1,-81,1,169],[0,-185,1,236],[0,-182,1,242],[1,-63,1,2803],[1,-62,1,218],[0,-177,1,2547],[0,-176,1,317],[0,-175,1,2548],[0,-174,1,316],[1,-73,1,282],[1,-71,1,294],[0,-173,1,324],[0,-172,1,322],[1,-125,1,1394],[0,-148,1,63],[0,-147,1,62],[0,-20,1,792],[1,-135,1,1465],[1,-2,1,658],[1,-134,1,1300],[0,-26,1,834],[0,-22,1,681],[0,-14,1,796]]]},"contextRules":{"bang":[[[2,-10,0,738],[2,-11,0,741],[2,-12,0,743],[0,-3,0,895],[2,-28,0,806],[1,-25,0,822],[2,-19,0,750],[1,-23,0,767],[1,-34,0,659],[1,-8,0,859],[0,-5,0,914]],[[2,-13,1,737],[2,-14,1,740],[2,-15,1,742],[2,-31,1,802],[1,-20,1,749],[2,-24,1,766],[1,-33,1,792],[0,-6,1,796]]],"plain":[[[2,-36,0,723],[2,-37,0,724],[1,-32,0,793]],[[2,-7,1,728],[2,-9,1,729],[2,-27,1,819],[2,-35,1,658],[1,-18,1,2881],[2,-16,1,856],[0,-21,1,768],[0,-22,1,769]]]}}`),t=[],n=r=>{let i=t[r];if(i!==void 0)return i;let a=e.types[r],o=a[0]===0?Se(e.strings[a[1]],a.slice(2).map(n)):a[0]===1?Ce(e.strings[a[1]]):we(e.strings[a[1]],a[2]);return t[r]=o,o},r=[],i=t=>{let a=r[t];if(a!==void 0)return a;let o=e.terms[t],s=o[0]===0?Te(e.strings[o[1]],n(o[2])):o[0]===1?Ee(e.strings[o[1]],n(o[2])):o[0]===2?D(e.strings[o[1]],o[2],n(o[3])):o[0]===3?O(o[1]):o[0]===4?k(e.strings[o[1]],n(o[2]),i(o[3])):A(i(o[1]),i(o[2]));return r[t]=s,s},a=e.thms.map(e=>Qi(i(e))),o=e=>({rule:a[e[0]],internal:a[e[1]],swapped:e[2].map(e=>a[e]),dup:a[e[3]],dupSwapped:e[4].map(e=>a[e])}),s=e=>{let[t,n]=e.map(e=>e.map(e=>({tag:e[0],isElim:e[1]===1,rule:a[e[2]]})));return{intro:t,elim:n}},c=e=>{let[t,n]=e.map(e=>e.map(e=>({weight:e[0],tag:e[1],isElim:e[2]===1,rule:a[e[3]]})));return{intro:t,elim:n}};return{consts:new Map(e.consts.map(e=>[e[0],{type:n(e[1]),typargs:Eu(n(e[1])),abbreviation:e.length===3?i(e[2]):void 0}])),constNames:new Map(e.names),facts:new Map(e.facts.map(e=>[e[0],e[1].map(e=>a[e])])),factNames:new Map(e.factNames),simps:e.simps.map(e=>a[e]),congs:e.congs.map(e=>({isConst:e[0],name:e[1],rule:a[e[2]]})),weakCongs:e.weakCongs.map(e=>({isConst:e[0],name:e[1]})),simprocs:e.simprocs.map(e=>({name:e[0],lhss:e[1].map(i)})),claset:{safeIs:e.claset.safeIs.map(o),safeEs:e.claset.safeEs.map(o),unsafeIs:e.claset.unsafeIs.map(o),unsafeEs:e.claset.unsafeEs.map(o),safe0:s(e.claset.safe0),safep:s(e.claset.safep),unsafe:s(e.claset.unsafe),dup:s(e.claset.dup)},contextRules:{bang:c(e.contextRules.bang),plain:c(e.contextRules.plain)}}},tm={},nm=()=>tm.logic??=em(),rm=e=>e instanceof RangeError&&e.message===`Maximum call stack size exceeded`,im=(e,t)=>{let n={deadline:Date.now()+t.timeLimitMs,signal:t.signal};try{let t=pd(e),r=nm(),i=sd(r,t),a=t.isUsingAssms?du(n,i):[],o=yn(Tu($p(r,n),mu(t.method),a,uu(i)));return o!==void 0&&o.tpairs.length===0&&j(o.prop,Ut(i.conclusion))&&o.hyps.every(e=>i.assumptions.some(t=>j(e,t)))?`unsat`:`unknown`}catch(e){if(e instanceof l||rm(e))return`unknown`;throw e}},am=e=>e>0?2*e:-2*e+1,om=(e,t)=>{let n=new Int8Array(e+1),r=new Int32Array(e+1),i=Array.from({length:e+1}),a=new Float64Array(e+1),o=new Uint8Array(e+1),s=Array.from({length:2*e+2},()=>[]),c=[],l=[],u={head:0,bump:1,isUnsatisfiable:!1},d=e=>e>0?n[e]:-n[-e],f=(e,t)=>{let a=Math.abs(e);n[a]=e>0?1:-1,r[a]=l.length,i[a]=t,c.push(e)},p=e=>{s[am(e[0])].push(e),s[am(e[1])].push(e)},m=()=>{for(;u.head<c.length;u.head++){let e=-c[u.head],t=s[am(e)];for(let n=0;n<t.length;n++){let r=t[n];if(r[0]===e&&([r[0],r[1]]=[r[1],r[0]]),d(r[0])>0)continue;let i=r.findIndex((e,t)=>t>1&&d(e)>=0);if(i!==-1)[r[1],r[i]]=[r[i],r[1]],s[am(r[1])].push(r),t[n--]=t[t.length-1],t.pop();else{if(d(r[0])<0)return r;f(r[0],r)}}}},h=e=>{if(e>=l.length)return;let t=l[e];for(;c.length>t;)n[Math.abs(c.pop()??0)]=0;l.length=e,u.head=c.length},g=e=>{let t=[0],n=l.length,s={pending:0,literal:0,index:c.length-1};for(let l=e;;){for(let e of l?.slice(s.literal===0?0:1)??[]){let i=Math.abs(e);o[i]||r[i]===0||(o[i]=1,a[i]+=u.bump,r[i]===n?s.pending++:t.push(e))}for(;!o[Math.abs(c[s.index])];)s.index--;if(s.literal=c[s.index--],o[Math.abs(s.literal)]=0,l=i[Math.abs(s.literal)],--s.pending===0)break}return t[0]=-s.literal,t.forEach(e=>o[Math.abs(e)]=0),u.bump*=1.05,t};return{addClause:e=>{h(0);let t=[...new Set(e)];if(u.isUnsatisfiable||t.some(e=>d(e)>0)||t.some(e=>t.includes(-e)))return;let n=t.filter(e=>d(e)===0);n.length>1?p(n):n.length===0?u.isUnsatisfiable=!0:(f(n[0],void 0),m()&&(u.isUnsatisfiable=!0))},solve:e=>{if(h(0),u.isUnsatisfiable)return`unsat`;for(;;){let i=m();if(i){if(l.length===0)return u.isUnsatisfiable=!0,`unsat`;if(t())return`unknown`;let e=g(i),n=e.slice(1).reduce((t,n,i)=>r[Math.abs(n)]>r[Math.abs(e[t])]?i+1:t,1);e.length>1&&([e[1],e[n]]=[e[n],e[1]]),h(e.length===1?0:r[Math.abs(e[1])]),e.length>1&&p(e),f(e[0],e.length>1?e:void 0);continue}let o=e.find(e=>d(e)<=0);if(o!==void 0&&d(o)<0)return`unsat`;let s=o??-n.reduce((e,t,n)=>n>0&&t===0&&(e===0||a[n]>a[e])?n:e,0);if(s===0)return Int8Array.from(n);l.push(c.length),f(s,void 0)}}}},sm=()=>{let e=[],t=/* @__PURE__ */ new Map,n=(n,r)=>{let i=t.get(n);return i===void 0?(t.set(n,e.length),e.push(r),e.length-1):i},r=e=>n(String(e),{kind:`Constant`,value:e}),i=(t,i)=>{let a=t===`Or`,o=/* @__PURE__ */ new Set;for(let n of i){let r=e[n];if(r.kind===`Constant`){if(r.value===a)return n}else r.kind===t?r.children.forEach(e=>o.add(e)):o.add(n)}let s=[...o].sort((e,t)=>e-t);return s.length===0?r(!a):s.length===1?s[0]:n(`${t}(${s.join(`,`)})`,{kind:t,children:s})},a=(t,r)=>{let i=e[r];return i.kind===`Constant`||t!==`Next`&&i.kind===t?r:n(`${t}(${r})`,{kind:t,body:r})},o=[/* @__PURE__ */ new WeakMap,/* @__PURE__ */ new WeakMap],s=(e,t)=>{let r=o[+!!t],c=r.get(e);if(c!==void 0)return c;let l=(()=>{switch(e.kind){case`Atom`:return n(`${t?`-`:`+`}${e.name}`,{kind:`Literal`,atom:e.name,isPositive:!t});case`Not`:return s(e.body,!t);case`Next`:return a(`Next`,s(e.body,t));case`Always`:case`Eventually`:return a(e.kind===`Always`===t?`Eventually`:`Always`,s(e.body,t));case`And`:case`Or`:return i(e.kind===`And`===t?`Or`:`And`,[s(e.left,t),s(e.right,t)]);case`Implies`:return i(t?`And`:`Or`,[s(e.left,!t),s(e.right,t)]);case`Equiv`:return i(t?`Or`:`And`,[i(t?`And`:`Or`,[s(e.left,!t),s(e.right,t)]),i(t?`And`:`Or`,[s(e.left,t),s(e.right,!t)])])}})();return r.set(e,l),l};return{normals:e,normalize:s}},cm=(e,t,n)=>{let r=[],i=/* @__PURE__ */ new Map,a=/* @__PURE__ */ new Map,o=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map,c={value:0},l=()=>++c.value,u=(e,t)=>{let n=e.get(t);if(n!==void 0)return n;let r=l();return e.set(t,r),r},d=t=>{let n=s.get(t);if(n!==void 0)return n;let c=e[t],f=(()=>{switch(c.kind){case`Constant`:{let e=l();return r.push([c.value?e:-e]),e}case`Literal`:{let e=u(i,c.atom);return c.isPositive?e:-e}case`Next`:return u(a,c.body);case`And`:{let e=l();return c.children.forEach(t=>r.push([-e,d(t)])),e}case`Or`:{let e=l();return r.push([-e,...c.children.map(d)]),e}case`Always`:{let e=l();return r.push([-e,d(c.body)],[-e,u(a,t)]),e}case`Eventually`:{let e=l(),n=d(c.body),i=u(a,t);return r.push([-e,n,i],[-i,n,u(o,t)]),e}}})();return s.set(t,f),f};t.forEach(e=>r.push([d(e)]));let f=[...a.values(),...o.values()],p=om(c.value,n);r.forEach(p.addClause);let m=[];for(;;){let e=p.solve([]);if(typeof e==`string`)return e===`unsat`?m:void 0;let t=f.reduce((e,t)=>{if(e?.[t]!==1)return e;let n=f.filter(t=>e[t]!==1),r=p.solve([-t,...n.map(e=>-e)]);if(r!==`unknown`)return r===`unsat`?e:r},e);if(!t)return;let n=e=>t[e]===1;m.push({next:[...a].flatMap(e=>n(e[1])?[e[0]]:[]),pending:[...o].flatMap(e=>n(e[1])?[e[0]]:[])}),p.addClause(f.filter(n).map(e=>-e))}},lm=(e,t)=>{let n=sm(),r=[],i=/* @__PURE__ */ new Map,a=e=>{let t=[...new Set(e)].sort((e,t)=>e-t),n=t.join(`,`),a=i.get(n);return a===void 0?(i.set(n,r.length),r.push(t),r.length-1):a};a([n.normalize(e,!1)]);let o=[];for(let e=0;e<r.length;e++){let i=t()?void 0:cm(n.normals,r[e],t);if(!i)return`unknown`;o.push(i.map(e=>({target:a(e.next),pending:e.pending})))}let s=new Int32Array(r.length).fill(-1),c=new Int32Array(r.length),l=new Int32Array(r.length).fill(-1),u=[],d={index:0,component:0},f=e=>{let t=o.flatMap((t,n)=>l[n]===e?t.filter(t=>l[t.target]===e):[]);return t.length!==0&&t.slice(1).reduce((e,t)=>e.filter(e=>t.pending.includes(e)),t[0].pending).length===0},p=e=>{s[e]=d.index,c[e]=d.index,d.index++,u.push(e);for(let t of o[e])if(s[t.target]===-1){if(p(t.target))return!0;c[e]=Math.min(c[e],c[t.target])}else l[t.target]===-1&&(c[e]=Math.min(c[e],s[t.target]));if(c[e]!==s[e])return!1;let t=d.component++;for(let n=u.pop();n!==void 0&&(l[n]=t,n!==e);n=u.pop());return f(t)};return p(0)?`sat`:`unsat`},um=e=>{let n=e.match(/<->|->|[()~&|]|[\w']+|\S/g)??[],r={position:0},i=e=>{let i=n[r.position++];if(i===void 0||e!==void 0&&i!==e)throw new t(`Expected ${e??`a formula`} in LS4 input, found ${i??`the end`}`);return i},a=()=>{let e=i();if(e===`(`){let e=c();return i(`)`),e}if(e===`~`||e===`not`)return{kind:`Not`,body:a()};if(e===`always`)return{kind:`Always`,body:a()};if(e===`sometime`)return{kind:`Eventually`,body:a()};if(e===`next`)return{kind:`Next`,body:a()};if(!/^[\w']+$/.test(e))throw new t(`Expected a formula in LS4 input, found ${e}`);return{kind:`Atom`,name:e}},o=(e,t,a)=>{let o=[a()];for(;n[r.position]===e;)i(),o.push(a());return o.reduce((e,n)=>({kind:t,left:e,right:n}))},s=()=>{let e=o(`|`,`Or`,()=>o(`&`,`And`,a));return n[r.position]===`->`?(i(),{kind:`Implies`,left:e,right:s()}):e},c=()=>{let e=s();return n[r.position]===`<->`?(i(),{kind:`Equiv`,left:e,right:c()}):e},l=c();if(r.position<n.length)throw new t(`Expected the end of LS4 input, found ${n[r.position]}`);return l},dm=(e,t)=>{let n=performance.now()+t.timeLimitMs;return lm(um(e),()=>t.signal?.aborted===!0||performance.now()>n)},fm=e=>e instanceof RangeError&&e.message===`Maximum call stack size exceeded`,N=(e,t)=>{for(;e.length>t;)e.pop()},pm=(e,t,n)=>{for(;e.length<t;)e.push(void 0);e[t]=n},mm=e=>{let t=new e.constructor(2*e.length);return t.set(e),t};var hm=class{manager;list=[];stamp=0;literalStamps=/* @__PURE__ */ new Int32Array(1024);negatedAtomStamps=/* @__PURE__ */ new Int32Array(1024);constructor(e){this.manager=e}clear(){N(this.list,0),this.stamp++}add(e){let t=this.manager;if(e>=this.literalStamps.length){let t=Math.max(2*this.literalStamps.length,e+1),n=new Int32Array(t);n.set(this.literalStamps),this.literalStamps=n;let r=new Int32Array(t);r.set(this.negatedAtomStamps),this.negatedAtomStamps=r}if(this.literalStamps[e]===this.stamp)return!1;let n=t.isNot(e),r=n?t.getArg(e,0):e;return(n?this.literalStamps[r]===this.stamp:this.negatedAtomStamps[r]===this.stamp)||(this.list.push(e),this.literalStamps[e]=this.stamp,n&&(this.negatedAtomStamps[r]=this.stamp),!1)}};const gm=2654435769,_m=e=>{let t=e[0],n=e[1],r=e[2];t=t-n-r>>>0,t=(t^r>>>13)>>>0,n=n-r-t>>>0,n=(n^t<<8)>>>0,r=r-t-n>>>0,r=(r^n>>>13)>>>0,t=t-n-r>>>0,t=(t^r>>>12)>>>0,n=n-r-t>>>0,n=(n^t<<16)>>>0,r=r-t-n>>>0,r=(r^n>>>5)>>>0,t=t-n-r>>>0,t=(t^r>>>3)>>>0,n=n-r-t>>>0,n=(n^t<<10)>>>0,r=r-t-n>>>0,r=(r^n>>>15)>>>0,e[0]=t,e[1]=n,e[2]=r},vm=/* @__PURE__ */ new Uint32Array(3),ym=(e,t,n)=>(vm[0]=e,vm[1]=t,vm[2]=n,vm),bm=(e,t,n)=>{let r=ym(e,t,n);return _m(r),r[2]},xm=e=>{let t=e>>>0;return t=t+2127912214+(t<<12)>>>0,t=(t^3345072700^t>>>19)>>>0,t=t+374761393+(t<<5)>>>0,t=(t+3550635116^t<<9)>>>0,t=t+4251993797+(t<<3)>>>0,t=(t^3042594569^t>>>16)>>>0,t},Sm=(e,t)=>xm((e^t+gm+(e<<6)+(e>>>2))>>>0),Cm=new TextEncoder,wm=(e,t)=>{let n=t=>(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0,r=ym(gm,gm,t),i=0,a=e.length;for(;a>=12;)r[0]+=n(i),r[1]+=n(i+4),r[2]+=n(i+8),_m(r),i+=12,a-=12;r[2]+=e.length;let o=[0,8,16,24,0,8,16,24,8,16,24];for(let t=a-1;t>=0;t--)r[t<4?0:t<8?1:2]+=e[i+t]<<o[t];return _m(r),r[2]},Tm=(e,t)=>wm(Cm.encode(e),t),Em=(e,t=17)=>{let n=e.length,r=ym(gm,gm,11);switch(n){case 0:return r[2];case 1:return r[0]+=t,r[1]=e[0],_m(r),r[2];case 2:return r[0]+=t,r[1]+=e[0],r[2]+=e[1],_m(r),r[2];case 3:return r[0]+=e[0],r[1]+=e[1],r[2]+=e[2],_m(r),r[0]+=t,_m(r),r[2];default:{let i=n;for(;i>=3;)r[0]+=e[--i],r[1]+=e[--i],r[2]+=e[--i],_m(r);return r[0]+=t,i===2&&(r[1]+=e[1]),i>=1&&(r[2]+=e[0]),_m(r),r[2]}}},Dm=(e,t,n)=>{let r=e.length;switch(r){case 0:return n;case 1:return Sm(t[e[0]],n);case 2:return Sm(Sm(t[e[0]],t[e[1]]),n);case 3:return Sm(Sm(t[e[0]],t[e[1]]),Sm(t[e[2]],n));default:{let i=ym(gm,gm,n),a=r;for(;a>=3;)i[0]+=t[e[--a]],i[1]+=t[e[--a]],i[2]+=t[e[--a]],_m(i);return a===2?(i[1]+=t[e[1]],i[2]+=t[e[0]]):a===1&&(i[2]+=t[e[0]]),_m(i),i[2]}}},Om=e=>e;var km=class{getHash;capacity=8;states=/* @__PURE__ */ new Uint8Array(8);slotKeys=[];values=[];numDeleted=0;size=0;constructor(e){this.getHash=e}findSlot(e){let t=this.capacity-1,n=this.getHash(e)&t;for(let r=0;r<this.capacity;r++){let i=n+r&t;if(this.states[i]===0)return-1;if(this.states[i]===2&&this.slotKeys[i]===e)return i}return-1}moveTable(e){let t=this.states,n=this.slotKeys,r=this.values;this.capacity=e,this.states=new Uint8Array(e),this.slotKeys=[],this.values=[],this.numDeleted=0;let i=e-1;for(let e=0;e<t.length;e++){if(t[e]!==2)continue;let a=this.getHash(n[e])&i;for(;this.states[a]!==0;)a=a+1&i;this.states[a]=2,this.slotKeys[a]=n[e],this.values[a]=r[e]}}has(e){return this.findSlot(e)!==-1}get(e){let t=this.findSlot(e);return t===-1?void 0:this.values[t]}replace(e,t){let n=this.findSlot(e);n!==-1&&(this.values[n]=t)}set(e,t){this.size+this.numDeleted<<2>this.capacity*3&&this.moveTable(this.capacity<<1);let n=this.capacity-1,i=this.getHash(e)&n,a=-1;for(let r=0;r<this.capacity;r++){let o=i+r&n;if(this.states[o]===2){if(this.slotKeys[o]===e){this.values[o]=t;return}}else if(this.states[o]===0){let n=a===-1?o:a;a!==-1&&this.numDeleted--,this.states[n]=2,this.slotKeys[n]=e,this.values[n]=t,this.size++;return}else a=o}throw new r(`the hash table is full`)}delete(e){let t=this.findSlot(e);t!==-1&&(this.size--,this.states[t+1&this.capacity-1]===0?this.states[t]=0:(this.states[t]=1,this.numDeleted++,this.numDeleted>this.size&&this.numDeleted>64&&this.moveTable(this.capacity)))}clear(){if(this.size===0&&this.numDeleted===0)return;let e=0;for(let t=0;t<this.capacity;t++)this.states[t]===0&&e++;this.capacity>16&&e<<2>this.capacity*3&&(this.capacity>>=1),this.states=new Uint8Array(this.capacity),this.slotKeys=[],this.values=[],this.size=0,this.numDeleted=0}*entries(){for(let e=0;e<this.capacity;e++)this.states[e]===2&&(yield[this.slotKeys[e],this.values[e]])}*keys(){for(let e=0;e<this.capacity;e++)this.states[e]===2&&(yield this.slotKeys[e])}[Symbol.iterator](){return this.entries()}},Am=class{map;constructor(e){this.map=new km(e)}get size(){return this.map.size}has(e){return this.map.has(e)}add(e){this.map.set(e,!0)}delete(e){this.map.delete(e)}[Symbol.iterator](){return this.map.keys()}};const jm=(e,t)=>{let n=e<0n?-e:e,r=t<0n?-t:t;for(;r!==0n;){let e=n%r;n=r,r=e}return n},Mm=e=>e<=-2147483648n||e>2147483647n,Nm=(e,t)=>{let n=e*t;return(n<0n?-n:n)/jm(e,t)},Pm=(e,t)=>{let n=e/t;return e>=0n||n*t===e?n:t<0n?n+1n:n-1n},Fm=(e,t)=>{let n=e%t;return n>=0n?n:t>0n?n+t:n-t},Im=(e,t)=>{if(e<0n){if(t%2==0)return;let n=Im(-e,t);return n===void 0?void 0:-n}if(e<2n||t===1)return e;let n=BigInt(t),r=0n,i=1n;for(;i**n<=e;)i*=2n;for(;i-r>1n;){let t=(r+i)/2n;t**n<=e?r=t:i=t}return r**n===e?r:void 0};var P=class e{num;den;static zero=new e(0n,1n);static one=new e(1n,1n);static minusOne=new e(-1n,1n);constructor(e,t){this.num=e,this.den=t}static of(t,n=1n){if(n===1n)return new e(t,1n);let r=n<0n?-1n:1n,i=jm(t,n);return new e(r*t/i,r*n/i)}static fromNumber(t){return new e(BigInt(t),1n)}isZero(){return this.num===0n}isInt(){return this.den===1n}isPositive(){return this.num>0n}isNegative(){return this.num<0n}add(t){return this.num===0n?t:t.num===0n?this:this.den===1n&&t.den===1n?new e(this.num+t.num,1n):e.of(this.num*t.den+t.num*this.den,this.den*t.den)}sub(t){return t.num===0n?this:this.den===1n&&t.den===1n?new e(this.num-t.num,1n):e.of(this.num*t.den-t.num*this.den,this.den*t.den)}mul(t){return this.den===1n&&t.den===1n?new e(this.num*t.num,1n):e.of(this.num*t.num,this.den*t.den)}div(t){return e.of(this.num*t.den,this.den*t.num)}neg(){return new e(-this.num,this.den)}abs(){return this.num<0n?this.neg():this}root(t){let n=Im(this.num,t),r=n===void 0?void 0:Im(this.den,t);return n===void 0||r===void 0?void 0:e.of(n,r)}pow(t){return e.of(this.num**BigInt(t),this.den**BigInt(t))}isBig(){return Mm(this.num)||Mm(this.den)}compare(e){let t=this.num*e.den,n=e.num*this.den;return t<n?-1:+(t>n)}equals(e){return this.num===e.num&&this.den===e.den}floor(){if(this.den===1n)return this;let t=this.num/this.den;return new e(this.num<0n?t-1n:t,1n)}ceil(){if(this.den===1n)return this;let t=this.num/this.den;return new e(this.num<0n?t:t+1n,1n)}toString(){return this.den===1n?`${this.num}`:`${this.num}/${this.den}`}};const Lm=e=>typeof e==`number`?`k!${e}`:e,Rm=[[`true`,0,0,0],[`false`,0,1,0],[`=`,0,2,0],[`distinct`,0,3,0],[`ite`,0,4,-1],[`and`,0,5,0],[`or`,0,6,0],[`xor`,0,7,0],[`not`,0,8,0],[`=>`,0,9,0],[`num`,1,10,1],[`<=`,1,11,0],[`>=`,1,12,0],[`<`,1,13,0],[`>`,1,14,0],[`+`,1,15,1],[`-`,1,16,1],[`-`,1,17,1],[`*`,1,18,1],[`div`,1,19,1],[`mod`,1,20,1],[`abs`,1,21,1],[`pattern`,0,22,0],[`/`,1,23,2],[`to_real`,1,24,2],[`to_int`,1,25,1],[`is_int`,1,26,0],[`/0`,1,27,2],[`div0`,1,28,1],[`mod0`,1,29,1]],zm=4294967295,Bm=/* @__PURE__ */ new Map([[0,[`true`,0,0]],[1,[`false`,1,0]],[2,[`=`,2,2]],[3,[`distinct`,3,-1]],[4,[`if`,4,3]],[5,[`and`,5,2]],[6,[`or`,6,2]],[7,[`xor`,7,2]],[8,[`not`,8,1]],[9,[`=>`,9,2]],[11,[`<=`,2,2]],[12,[`>=`,3,2]],[13,[`<`,4,2]],[14,[`>`,5,2]],[15,[`+`,6,2]],[16,[`-`,7,2]],[17,[`-`,8,1]],[18,[`*`,9,2]],[19,[`div`,11,2]],[20,[`mod`,16,2]],[21,[`abs`,21,1]],[22,[`pattern`,0,-1]],[23,[`/`,10,2]],[24,[`to_real`,18,1]],[25,[`to_int`,19,1]],[26,[`is_int`,20,1]],[27,[`/0`,12,2]],[28,[`div0`,13,2]],[29,[`mod0`,17,2]]]),Vm=/* @__PURE__ */ new Map([[0,1],[1,2],[5,3],[6,4],[7,5],[8,6],[9,7],[11,17],[12,18],[13,19],[14,20],[15,36],[16,37],[18,38],[19,39],[20,41],[17,42],[21,50],[23,24],[24,43],[25,45],[26,47]]),Hm=e=>typeof e==`number`?e:Tm(e,17),Um=e=>e===1||e===2,Wm=e=>{let t=e<0n?-e:e;if(t<=4294967295n)return Number(t);let n=[];for(let e=t;e>0n;e>>=32n)n.push(Number(e&4294967295n));return wm(new Uint8Array(Uint32Array.from(n).buffer),17)},Gm=(e,t,n)=>bm(e,t,n.length===0?0:Em(n));var Km=class{limit;numNodes=0;kinds=/* @__PURE__ */ new Uint8Array(1024);decls=/* @__PURE__ */ new Int32Array(1024);argPool=/* @__PURE__ */ new Int32Array(1024);argStarts=/* @__PURE__ */ new Int32Array(1024);sorts=/* @__PURE__ */ new Int32Array(1024);values=/* @__PURE__ */ new Int32Array(1024);numeralValues=[];intNumerals=/* @__PURE__ */ new Map;freeVarBounds=/* @__PURE__ */ new Int32Array(1024);hasQuantifierFlags=/* @__PURE__ */ new Uint8Array(1024);depths=/* @__PURE__ */ new Int32Array(1024);hashes=/* @__PURE__ */ new Uint32Array(1024);quantifiers=/* @__PURE__ */ new Map;flatLiterals=new hm(this);funcDecls=[];sortNames=[`Bool`,`Int`,`Real`];sortHashes=[Sm(Hm(`Bool`),Gm(0,0,[])),Sm(Hm(`Int`),Gm(5,1,[])),Sm(Hm(`Real`),Gm(5,0,[]))];declHashes=[];builtinKeys=(/* @__PURE__ */ new Int32Array(1024)).fill(-1);builtinHashes=/* @__PURE__ */ new Uint32Array(256);numBuiltinHashes=0;patternHashes=/* @__PURE__ */ new Map;table=/* @__PURE__ */ new Map;appHandles=(/* @__PURE__ */ new Int32Array(1024)).fill(-1);appHashes=/* @__PURE__ */ new Int32Array(1024);numApps=0;nextSmallId=143;freeSmallIds=[];numDecls=143;signatureDecls=/* @__PURE__ */ new Map;declRefCounts=[];macros=new km(e=>this.declHashes[e]);deletedDecls=/* @__PURE__ */ new Set;freshId=0;ids=/* @__PURE__ */ new Int32Array(1024);refCounts=/* @__PURE__ */ new Int32Array(1024);freeIds=[];nextId=1;numLive=0;temporaries=[];temporariesMark=-1;argBuffer=[];smallInts=[];smallReals=[];isFiniteSetPluginInitialized=!1;trueExpr;falseExpr;constructor(e){this.limit=e;for(let e of Rm)this.funcDecls.push({name:e[0],family:e[1],op:e[2],domain:[],range:e[3],isSkolem:!1,smallId:Vm.get(e[2])??-1});this.trueExpr=this.mkApp(0,[],0),this.falseExpr=this.mkApp(1,[],0),this.incRef(this.trueExpr),this.incRef(this.falseExpr),this.nextId=22}getRefCount(e){return this.refCounts[e]}getNumAsts(){return this.numLive+22-2+this.numDecls}getSignatureDecl(e){let t=this.signatureDecls.get(e);if(t===void 0)throw new r(`the signature ${e} is not held`);return t}mkSmallId(){return this.numDecls++,this.freeSmallIds.pop()??this.nextSmallId++}initFiniteSetPlugin(){if(!this.isFiniteSetPluginInitialized){this.isFiniteSetPluginInitialized=!0;for(let e=0;e<7;e++)this.mkSmallId();this.freeSmallIds.push(this.mkSmallId()),this.numDecls--}}mkMacro(e,t){let n=this.funcDecls.length;this.declHashes[n]=this.getFuncDeclHash(e,[],this.sorts[t],Gm(10,0,[0])),this.funcDecls.push({name:e,family:2,op:30,domain:[],range:this.sorts[t],isSkolem:!1,smallId:this.mkSmallId()}),this.declRefCounts[n]=1,this.mkSmallId(),this.macros.set(n,t)}getSignature(e){let t=this.decls[e];return t===10?8*this.values[e]+4:t===2?8*this.sorts[this.getArg(e,0)]+0:t===4?8*this.sorts[e]+1:t===27||t===28||t===29?8*t+2:t===3||t===22?`${t}:${this.mapArgs(e,e=>this.sorts[e]).join(`,`)}`:this.funcDecls[t].family===3?8*t+3:null}getDeclId(e){let t=this.getSignature(e);return t===null?this.funcDecls[this.decls[e]].smallId:this.getSignatureDecl(t).smallId}holdDecl(e){let t=this.decls[e];if(this.funcDecls[t].family===2){this.incDeclRef(t);return}let n=this.getSignature(e);if(n===null)return;let r=this.signatureDecls.get(n);if(r!==void 0){r.refCount++;return}let i=this.mkSmallId();this.signatureDecls.set(n,{smallId:i,refCount:t===2||t===4?2:1}),t!==10&&this.funcDecls[t].family===3&&(this.funcDecls[t].smallId=i)}releaseDecl(e){let t=this.decls[e];if(this.funcDecls[t].family===2)return this.declRefCounts[t]--,this.declRefCounts[t]>0?-1:(this.deletedDecls.add(t),this.funcDecls[t].smallId);let n=this.getSignature(e);if(n===null)return-1;let r=this.getSignatureDecl(n);return r.refCount--,r.refCount>0?-1:(this.signatureDecls.delete(n),r.smallId)}incRef(e){this.refCounts[e]++}incDeclRef(e){if(this.funcDecls[e].family===3){let t=8*e+3,n=this.signatureDecls.get(t);if(n!==void 0){n.refCount++;return}let r=this.mkSmallId();this.signatureDecls.set(t,{smallId:r,refCount:1}),this.funcDecls[e].smallId=r}else this.deletedDecls.delete(e)&&(this.funcDecls[e].smallId=this.mkSmallId()),this.declRefCounts[e]++}decDeclRef(e){if(this.funcDecls[e].family===3){let t=8*e+3,n=this.getSignatureDecl(t);if(n.refCount--,n.refCount>0)return;this.freeSmallIds.push(n.smallId),this.signatureDecls.delete(t),this.numDecls--}else this.declRefCounts[e]--,!(this.declRefCounts[e]>0)&&(this.deletedDecls.add(e),this.freeSmallIds.push(this.funcDecls[e].smallId),this.numDecls--)}withTemporaries(e,t=e=>[e]){let n=this.beginTemporaries(),r=e();for(let e of t(r))this.incRef(e);return this.endTemporaries(n),r}beginTemporaries(){let e=this.temporariesMark;return this.temporariesMark=this.temporaries.length,e}endTemporaries(e){let t=this.temporaries,n=this.temporariesMark;this.temporariesMark=e;for(let e=t.length-1;e>=n;e--)this.decRef(t[e]);N(t,n)}withoutTemporaries(e){let t=this.temporariesMark;this.temporariesMark=-1;let n=e();return this.temporariesMark=t,n}releaseLater(e){this.temporariesMark===-1?this.decRef(e):this.temporaries.push(e)}decRef(e){if(this.ids[e]===-1||(this.refCounts[e]--,this.refCounts[e]>0))return;let t=[e];for(let e=t.pop();e!==void 0;e=t.pop()){if(e<0){this.freeSmallIds.push(-1-e),this.numDecls--;continue}if(this.deleteNode(e),this.kinds[e]===0){let n=this.releaseDecl(e);n!==-1&&t.push(-1-n)}if(this.kinds[e]!==2){let n=this.argStarts[e+1];for(let r=this.argStarts[e];r<n;r++)this.releaseChild(this.argPool[r],t);continue}let n=this.getQuantifier(e);this.releaseChild(n.body,t);for(let e of n.patterns)this.releaseChild(e,t)}}releaseChild(e,t){this.refCounts[e]--,this.refCounts[e]===0&&t.push(e)}deleteNode(e){this.numLive--,this.freeIds.push(this.ids[e]),this.ids[e]=-1}registerNode(e){if(this.ids[e]=this.freeIds.pop()??this.nextId++,this.numLive++,this.refCounts[e]=0,this.kinds[e]!==2){let t=this.argStarts[e+1];for(let n=this.argStarts[e];n<t;n++)this.incRef(this.revive(this.argPool[n]))}else{let t=this.getQuantifier(e);this.incRef(this.revive(t.body));for(let e of t.patterns)this.incRef(this.revive(e))}this.kinds[e]===0&&this.holdDecl(e),this.temporariesMark!==-1&&(this.incRef(e),this.temporaries.push(e))}getNumArgs(e){return this.argStarts[e+1]-this.argStarts[e]}getArg(e,t){return this.argPool[this.argStarts[e]+t]}pushArgs(e,t){let n=this.argStarts[e+1];for(let r=this.argStarts[e];r<n;r++)t.push(this.argPool[r])}getArgs(e){let t=[];return this.pushArgs(e,t),t}mapArgs(e,t){let n=[];for(let r=0;r<this.getNumArgs(e);r++)n.push(t(this.getArg(e,r),r));return n}someArg(e,t){for(let n=0;n<this.getNumArgs(e);n++)if(t(this.getArg(e,n),n))return!0;return!1}everyArg(e,t){for(let n=0;n<this.getNumArgs(e);n++)if(!t(this.getArg(e,n),n))return!1;return!0}revive(e){return this.ids[e]===-1&&this.registerNode(e),e}mkSort(e){return this.sortHashes.push(Sm(Hm(e),Gm(4,this.sortNames.length-3,[]))),this.sortNames.push(e),this.mkSmallId(),this.sortNames.length-1}getFuncDeclHash(e,t,n,r){return Dm(t,this.sortHashes,Sm(Sm(Hm(e),this.sortHashes[n]),r))}getBuiltinSignature(e,t){let n=Bm.get(e);if(n===void 0)throw new r(`the operator ${e} has no Z3 declaration`);let i=e===4?this.sorts[t[1]]:this.sorts[t[0]],a=n[2]===-1?t.length:n[2],o=Array.from({length:a},(n,r)=>e===22?this.sorts[t[r]]:e===4&&r===0?0:i);return{name:n[0],kind:n[1],domain:o}}getPatternHash(e,t){let n=`${e.map(e=>this.sorts[e]).join(`,`)}:${t}`,r=this.patternHashes.get(n);if(r!==void 0)return r;let i=this.mkBuiltinHash(22,e,t);return this.patternHashes.set(n,i),i}getBuiltinSlot(e,t,n){let r=t.length===0?0:this.sorts[e===4?t[1]:t[0]],i=t.length,a=this.findBuiltinSlot(e,r,n,i);if(this.builtinKeys[4*a]!==-1)return a;let o=this.mkBuiltinHash(e,t,n);if(2*(this.numBuiltinHashes+1)>this.builtinHashes.length){let e=this.builtinKeys,t=this.builtinHashes;this.builtinKeys=new Int32Array(2*e.length).fill(-1),this.builtinHashes=new Uint32Array(2*t.length),this.numBuiltinHashes=0;for(let n=0;n<4*t.length;n+=4)e[n]!==-1&&this.insertBuiltinHash(e[n],e[n+1],e[n+2],e[n+3],t[n/4])}return this.insertBuiltinHash(e,r,n,i,o)}findBuiltinSlot(e,t,n,r){let i=this.builtinKeys,a=this.builtinHashes.length-1,o=Math.imul(Math.imul(Math.imul(e,2654435761)+t,2654435761)+n,2654435761)+r&a;for(;i[4*o]!==-1&&(i[4*o]!==e||i[4*o+1]!==t||i[4*o+2]!==n||i[4*o+3]!==r);)o=o+1&a;return o}insertBuiltinHash(e,t,n,r,i){let a=this.findBuiltinSlot(e,t,n,r);return this.builtinKeys.set([e,t,n,r],4*a),this.builtinHashes[a]=i,this.numBuiltinHashes++,a}mkBuiltinHash(e,t,n){let r=this.getBuiltinSignature(e,t),i=e===22?2:e<10?0:5;return this.getFuncDeclHash(r.name,r.domain,n,Gm(i,r.kind,[]))}getDeclHash(e){return this.declHashes[e]}mkFuncDecl(e,t,n,r=!1){return this.declHashes[this.funcDecls.length]=this.getFuncDeclHash(e,t,n,r?Gm(zm,zm,[]):0),this.funcDecls.push({name:e,family:2,op:30,domain:t,range:n,isSkolem:r,smallId:this.mkSmallId()}),this.declRefCounts[this.funcDecls.length-1]=1,this.funcDecls.length-1}mkFreshFuncDecl(e,t,n,r=!0){let i=e===null?this.freshId:`${Lm(e)}!${this.freshId}`;this.freshId++;let a=this.mkFuncDecl(i,t,n,r);return this.declRefCounts[a]=0,a}mkFreshVarName(e){let t=`${e??`var`}!${this.freshId}`;return this.freshId++,t}intern(e,t,n,r,i,a,o){let s=this.table.get(e);if(s!==void 0)return this.revive(s);let c=this.create(t,n,r,i,a,o());return this.table.set(e,c),this.registerNode(c),c}create(e,t,n,r,i,a){let o=this.numNodes++;o===this.kinds.length&&(this.kinds=mm(this.kinds),this.decls=mm(this.decls),this.sorts=mm(this.sorts),this.values=mm(this.values),this.freeVarBounds=mm(this.freeVarBounds),this.hasQuantifierFlags=mm(this.hasQuantifierFlags),this.depths=mm(this.depths),this.hashes=mm(this.hashes),this.ids=mm(this.ids),this.refCounts=mm(this.refCounts)),this.hashes[o]=a,this.kinds[o]=e,this.decls[o]=t;let s=this.argStarts[o],c=s+n.length;if(c>this.argPool.length){let e=new Int32Array(Math.max(2*this.argPool.length,c));e.set(this.argPool),this.argPool=e}for(let e=0;e<n.length;e++)this.argPool[s+e]=n[e];if(o+2>this.argStarts.length){let e=new Int32Array(2*this.argStarts.length);e.set(this.argStarts),this.argStarts=e}this.argStarts[o+1]=c,this.sorts[o]=r,this.values[o]=i;let l=e===1?i+1:0,u=e===2,d=1;for(let e=0;e<n.length;e++){let t=n[e];this.freeVarBounds[t]>l&&(l=this.freeVarBounds[t]),this.hasQuantifierFlags[t]&&(u=!0),this.depths[t]+1>d&&(d=this.depths[t]+1)}return this.freeVarBounds[o]=l,this.hasQuantifierFlags[o]=+!!u,this.depths[o]=d,o}mkApp(e,t,n,i=0){let a=this.funcDecls[e];if(e===10||a.family===3)throw new r(`${a.name} needs a value`);let o=e;for(let e=i;e<t.length;e++)o=Math.imul(o,2654435761)+t[e]|0;let s=t.length-i,c=this.appHandles.length-1,l=o&c;for(;this.appHandles[l]!==-1;l=l+1&c){let n=this.appHandles[l];if(this.appHashes[l]!==o||this.decls[n]!==e)continue;let r=this.argStarts[n];if(this.argStarts[n+1]-r!==s)continue;let a=!0;for(let e=0;e<s&&a;e++)a=this.argPool[r+e]===t[i+e];if(a)return this.revive(n)}if(i>0){N(this.argBuffer,0);for(let e=i;e<t.length;e++)this.argBuffer.push(t[e])}let u=i>0?this.argBuffer:t,d=a.family===2||a.op===22?-1:this.getBuiltinSlot(a.op,u,n),f=a.family===2?this.declHashes[e]:d===-1?this.getPatternHash(u,n):this.builtinHashes[d],p=this.create(0,e,u,n,0,Dm(u,this.hashes,f));if(2*(this.numApps+1)>this.appHandles.length){let e=this.appHandles,t=this.appHashes;this.appHandles=new Int32Array(2*e.length).fill(-1),this.appHashes=new Int32Array(2*e.length),this.numApps=0;for(let n=0;n<e.length;n++)e[n]!==-1&&this.insertApp(t[n],e[n]);this.insertApp(o,p)}else this.appHandles[l]=p,this.appHashes[l]=o,this.numApps++;return this.registerNode(p),p}insertApp(e,t){let n=this.appHandles.length-1,r=e&n;for(;this.appHandles[r]!==-1;)r=r+1&n;this.appHandles[r]=t,this.appHashes[r]=e,this.numApps++}internNumeral(e,t,n){let r=this.table.get(e);if(r!==void 0)return this.revive(r);this.numeralValues.push(t);let i=n===1;return this.intern(e,0,10,[],n,this.numeralValues.length-1,()=>this.getFuncDeclHash(i?`Int`:`Real`,[],n,Gm(5,0,[Wm(t.num)+3*Wm(t.den)>>>0,+!!i])))}mkRealNumeral(e){let t=this.internNumeral(`r${e}`,e,2);return e.isInt()?this.holdSmallNumeral(t,e.num,this.smallReals):t}mkNumeral(e){let t=this.intNumerals.get(e);if(t!==void 0)return this.holdSmallNumeral(this.revive(t),e,this.smallInts);let n=this.internNumeral(`n${e}`,P.of(e),1);return this.intNumerals.set(e,n),this.holdSmallNumeral(n,e,this.smallInts)}holdSmallNumeral(e,t,n){if(t<0n||t>=16)return e;let r=Number(t);return n[r]===void 0&&(this.incRef(e),n[r]=e),e}mkNumeralOfSort(e,t){return t===1?this.mkNumeral(e.num):this.mkRealNumeral(e)}mkModelValue(e,t){let n=`m${t}:${e}`,r=this.table.get(n);if(r!==void 0)return this.revive(r);this.funcDecls.push({name:`${this.sortNames[t]}!val!${e}`,family:3,op:31,domain:[],range:t,isSkolem:!1,smallId:-1});let i=this.funcDecls.length-1;return this.declHashes[i]=this.getFuncDeclHash(this.funcDecls[i].name,[],t,Gm(3,0,[e,this.sortHashes[t]])),this.intern(n,0,i,[],t,e,()=>this.declHashes[i])}mkFreshConst(e,t){return this.mkApp(this.mkFreshFuncDecl(e,[],t),[],t)}mkVar(e,t){return this.intern(`v${e}:${t}`,1,-1,[],t,e,()=>Sm(e,this.sortHashes[t]))}mkQuantifier(e){if(e.names.length!==e.sorts.length)throw new r(`a quantifier needs a name for each variable`);let t=`q${+!!e.isForall}:${e.sorts.join(`,`)}:${JSON.stringify(e.names)}:${e.body}:${e.patterns.join(`,`)}:${e.weight}`,n=this.table.get(t);if(n!==void 0)return this.revive(n);let i=this.create(2,-1,[e.body],0,0,bm(Dm(e.sorts,this.sortHashes,e.isForall?31:19),e.patterns.length,this.hashes[e.body]));this.table.set(t,i);let a=this.freeVarBounds[e.body];return this.freeVarBounds[i]=Math.max(0,a-e.sorts.length),this.quantifiers.set(i,{...e,sorts:[...e.sorts],names:[...e.names],patterns:[...e.patterns]}),this.registerNode(i),i}mkPattern(e){return this.mkApp(22,e,0)}getQuantifier(e){let t=this.quantifiers.get(e);if(t===void 0)throw new r(`the expression is not a quantifier`);return t}isApp(e){return this.kinds[e]===0}isVar(e){return this.kinds[e]===1}isGround(e){return this.freeVarBounds[e]===0}isGroundApp(e){return this.kinds[e]===0&&this.freeVarBounds[e]===0&&!this.hasQuantifierFlags[e]}getOp(e){return this.kinds[e]===0?this.funcDecls[this.decls[e]].op:-1}getFamily(e){return this.kinds[e]===0?this.funcDecls[this.decls[e]].family:-1}isBool(e){return this.sorts[e]===0}isInt(e){return this.sorts[e]===1}isReal(e){return this.sorts[e]===2}isTrue(e){return e===this.trueExpr}isFalse(e){return e===this.falseExpr}isNot(e){return this.getOp(e)===8}isComplement(e,t){return this.isNot(e)&&this.getArg(e,0)===t||this.isNot(t)&&this.getArg(t,0)===e||e===this.trueExpr&&t===this.falseExpr||e===this.falseExpr&&t===this.trueExpr}isNumeral(e){return this.getOp(e)===10}getNumeral(e){return this.isNumeral(e)&&this.sorts[e]===1?this.getNumeralValue(e):void 0}getNumeralValue(e){return this.numeralValues[this.values[e]].num}getRationalValue(e){return this.numeralValues[this.values[e]]}isUniqueValue(e){let t=this.getOp(e);return t===10||t===0||t===1||t===31}areDistinct(e,t){if(this.kinds[e]!==0||this.kinds[t]!==0)return!1;if(e!==t&&this.isUniqueValue(e)&&this.isUniqueValue(t))return!0;let n=this.funcDecls[this.decls[e]].family;if((n===2?this.funcDecls[this.decls[t]].family:n)!==1)return!1;let r=(e,t)=>{if(this.getOp(e)!==15||this.getNumArgs(e)!==2)return!1;let n=this.getArg(e,0),r=this.getArg(e,1),i=e=>this.isNumeral(e)&&!this.getRationalValue(e).isZero();return n===t&&i(r)||r===t&&i(n)};return r(e,t)||r(t,e)}isModelValue(e){return this.getOp(e)===31}isUninterpretedSort(e){return e>2}isUninterpretedConst(e){return this.isUninterpreted(e)&&this.getNumArgs(e)===0}isUninterpreted(e){return this.getFamily(e)===2}getTimesMinusOneArg(e){if(this.getOp(e)!==18||this.getNumArgs(e)!==2)return;let t=this.getArg(e,0);return this.isNumeral(t)&&this.getRationalValue(t).equals(P.minusOne)?this.getArg(e,1):void 0}isOccurring(e,t){return this.someSubterm(t,t=>this.decls[t]===e)}containsModelValue(e){return this.someSubterm(e,e=>this.isModelValue(e))}someSubterm(e,t){let n=/* @__PURE__ */ new Set,r=[e];for(let e=r.pop();e!==void 0;e=r.pop()){if(n.has(e))continue;n.add(e);let i=this.kinds[e];if(i===2)r.push(this.getQuantifier(e).body);else if(i!==1){if(t(e))return!0;this.pushArgs(e,r)}}return!1}mkNot(e){return e===this.trueExpr?this.falseExpr:e===this.falseExpr?this.trueExpr:this.mkApp(8,[e],0)}mkEq(e,t){return this.mkApp(2,[e,t],0)}mkOr(e){return e.length===0?this.falseExpr:e.length===1?e[0]:this.mkApp(6,e,0)}mkAnd(e){return e.length===0?this.trueExpr:e.length===1?e[0]:this.mkApp(5,e,0)}getDeclName(e){return Lm(this.funcDecls[this.decls[e]].name)}toString(e){let t=this.kinds[e];if(t===1)return`(:var ${this.values[e]})`;if(t===2){let t=this.getQuantifier(e);return`(${t.isForall?`forall`:`exists`} (${t.sorts.length}) ${this.toString(t.body)})`}if(this.getOp(e)===10){let t=this.getRationalValue(e);return this.sorts[e]===1?String(t.num):t.isInt()?`${t.num}.0`:`(/ ${t.num}.0 ${t.den}.0)`}let n=this.getDeclName(e);return this.getNumArgs(e)===0?n:`(${n} ${this.mapArgs(e,e=>this.toString(e)).join(` `)})`}},F=class{manager;items=[];constructor(e){this.manager=e}get size(){return this.items.length}incRef(e){e!==-1&&this.manager.incRef(e)}decRef(e){e!==-1&&this.manager.decRef(e)}push(e){this.incRef(e),this.items.push(e)}pushOwned(e){this.items.push(e)}set(e,t){this.incRef(t),this.decRef(this.items[e]),this.items[e]=t}setOwned(e,t){this.decRef(this.items[e]),this.items[e]=t}pop(){this.decRef(this.items.pop())}shrink(e){for(let t of this.items.splice(e))this.decRef(t)}resize(e){for(e<this.items.length&&this.shrink(e);this.items.length<e;)this.items.push(-1)}reset(){this.shrink(0)}};const qm=(e,t)=>e.isNot(t)?e.getArg(t,0):e.isTrue(t)?e.falseExpr:e.isFalse(t)?e.trueExpr:e.mkNot(t),Jm=(e,t,n)=>{let r=new F(e),i=/* @__PURE__ */ new Set,a=n?5:6,o=n?6:5,s=n?e.trueExpr:e.falseExpr,c=n?e.falseExpr:e.trueExpr,l=e=>{t.set(e,t.items[t.size-1]),t.pop()};for(let u=0;u<t.size;u++){let d=t.items[u];if(i.has(d)){l(u--);continue}i.add(d),r.push(d);let f=e.isNot(d)?e.getArg(d,0):-1,p=f===-1?-1:e.getOp(f);if(e.getOp(d)===a){for(let n=0;n<e.getNumArgs(d);n++){let r=e.getArg(d,n);t.push(r)}l(u--)}else if(p===8)t.set(u--,e.getArg(f,0));else if(p===o){for(let n=0;n<e.getNumArgs(f);n++){let r=e.getArg(f,n);t.push(qm(e,r))}l(u--)}else if(n&&p===9)t.push(e.getArg(f,0)),t.set(u--,qm(e,e.getArg(f,1)));else if(!n&&e.getOp(d)===9)t.push(e.getArg(d,1)),t.set(u--,qm(e,e.getArg(d,0)));else if(d===s||f===c)l(u--);else if(d===c||f===s){t.reset(),t.push(c);break}}r.reset()},Ym=(e,t)=>Jm(e,t,!0),Xm=(e,t)=>Jm(e,t,!1),Zm=(e,t)=>{let n=e.getOp(t);if(n!==5&&n!==6){let n=qm(e,t);return e.incRef(n),n}let r=new F(e);for(let n=0;n<e.getNumArgs(t);n++){let i=e.getArg(t,n);r.pushOwned(Zm(e,i))}let i=n===5?e.mkOr(r.items):e.mkAnd(r.items);return e.incRef(i),r.reset(),i};var Qm=class{manager;slots=8;capacity=10;keys=/* @__PURE__ */ new Int32Array;offsets=/* @__PURE__ */ new Int32Array;values=/* @__PURE__ */ new Int32Array;isUsed=/* @__PURE__ */ new Uint8Array;nexts=/* @__PURE__ */ new Int32Array;nextCell=8;freeCell=-1;size=0;queueKeys=[];queueOffsets=[];qhead=0;numUnused=0;maxUnused;spares=/* @__PURE__ */ new Map;constructor(e,t){this.manager=e,this.maxUnused=Math.max(t,1024),this.initTable(8,2)}initTable(e,t){this.slots=e,this.capacity=e+t;let n=this.spares.get(this.capacity);n!==void 0&&this.spares.delete(this.capacity),this.keys=n?.keys??new Int32Array(this.capacity),this.offsets=n?.offsets??new Int32Array(this.capacity),this.values=n?.values??new Int32Array(this.capacity),this.isUsed=n?.isUsed??new Uint8Array(this.capacity),this.nexts=(n?.nexts??new Int32Array(this.capacity)).fill(-2),this.nextCell=e,this.freeCell=-1,this.size=0}retireTable(){this.capacity>1024||this.spares.set(this.capacity,{keys:this.keys,offsets:this.offsets,values:this.values,isUsed:this.isUsed,nexts:this.nexts})}getHash(e,t){return this.manager.hashes[e]+t>>>0}findCell(e,t){let n=this.getHash(e,t)&this.slots-1;if(this.nexts[n]===-2)return-1;for(;n!==-1;){if(this.keys[n]===e&&this.offsets[n]===t)return n;n=this.nexts[n]}return-1}getFreeCell(){if(this.freeCell!==-1){let e=this.freeCell;return this.freeCell=this.nexts[e],e}return this.nextCell++}copyCell(e,t){this.keys[e]=this.keys[t],this.offsets[e]=this.offsets[t],this.values[e]=this.values[t],this.isUsed[e]=this.isUsed[t],this.nexts[e]=this.nexts[t]}expandTable(){let e={slots:this.slots,keys:this.keys,offsets:this.offsets,values:this.values,isUsed:this.isUsed,nexts:this.nexts},t=this.size;this.retireTable();for(let t=(this.capacity-this.slots)*2;;t*=2){this.initTable(e.slots*2,t);let n=!0;for(let t=0;t<e.slots&&n;t++)if(e.nexts[t]!==-2)for(let r=t;r!==-1;r=e.nexts[r]){let t=this.getHash(e.keys[r],e.offsets[r])&this.slots-1;if(this.nexts[t]!==-2){if(this.nextCell===this.capacity){n=!1;break}this.copyCell(this.nextCell,t),this.nexts[t]=this.nextCell++}else this.nexts[t]=-1;this.keys[t]=e.keys[r],this.offsets[t]=e.offsets[r],this.values[t]=e.values[r],this.isUsed[t]=e.isUsed[r]}if(n)break}this.size=t}delUnused(){for(;this.qhead<this.queueKeys.length;){let e=this.queueKeys[this.qhead],t=this.queueOffsets[this.qhead];this.qhead++;let n=this.findCell(e,t);if(!this.isUsed[n]){this.numUnused--;let r=this.values[n];this.erase(e,t),this.manager.decRef(e),this.manager.decRef(r);break}}this.qhead===this.queueKeys.length?(N(this.queueKeys,0),N(this.queueOffsets,0),this.qhead=0):this.qhead>this.maxUnused&&(this.queueKeys=this.queueKeys.slice(this.qhead),this.queueOffsets=this.queueOffsets.slice(this.qhead),this.qhead=0)}erase(e,t){let n=this.getHash(e,t)&this.slots-1,r=-1;for(;this.keys[n]!==e||this.offsets[n]!==t;)r=n,n=this.nexts[n];this.size--;let i=this.nexts[n];r===-1?i===-1?this.nexts[n]=-2:(this.copyCell(n,i),this.recycleCell(i)):(this.nexts[r]=i,this.recycleCell(n))}recycleCell(e){this.nexts[e]=this.freeCell,this.freeCell=e}insert(e,t,n){this.numUnused>=this.maxUnused&&this.delUnused(),this.freeCell===-1&&this.nextCell>=this.capacity&&this.expandTable();let r=this.getHash(e,t)&this.slots-1;if(this.nexts[r]!==-2){for(let i=r;i!==-1;i=this.nexts[i])if(this.keys[i]===e&&this.offsets[i]===t){this.values[i]!==n&&(this.manager.incRef(n),this.manager.decRef(this.values[i]),this.values[i]=n,this.isUsed[i]=0);return}let i=this.getFreeCell();this.copyCell(i,r),this.nexts[r]=i}else this.nexts[r]=-1;this.manager.incRef(e),this.manager.incRef(n),this.queueKeys.push(e),this.queueOffsets.push(t),this.numUnused++,this.size++,this.keys[r]=e,this.offsets[r]=t,this.values[r]=n,this.isUsed[r]=0}find(e,t){let n=this.findCell(e,t);if(n!==-1)return this.isUsed[n]||(this.isUsed[n]=1,this.numUnused--),this.values[n]}reset(){for(let e=0;e<this.slots&&this.size>0;e++)if(this.nexts[e]!==-2)for(let t=e;t!==-1;t=this.nexts[t])this.manager.decRef(this.keys[t]),this.manager.decRef(this.values[t]);this.size>0&&(this.retireTable(),this.initTable(8,2)),N(this.queueKeys,0),N(this.queueOffsets,0),this.qhead=0,this.numUnused=0}};const $m=e=>e.depth>=3?1/0:e.depth;var eh=class{manager;frames=[];numFrames=0;resultStack=[];caches;scopes=[];root=-1;numQvars=0;constructor(e){this.manager=e,this.caches=[new Qm(e,e.getNumAsts())]}get cache(){return this.caches[this.scopes.length]}isCaching(e){let t=this.manager;return t.getRefCount(e)>1&&e!==this.root&&(t.kinds[e]===2||t.kinds[e]===0&&t.getNumArgs(e)>0)}pushResult(e){this.manager.incRef(e),this.resultStack.push(e)}shrinkResults(e){let t=this.resultStack;for(let n=e;n<t.length;n++)this.manager.decRef(t[n]);N(t,e)}setNewChildFlag(e,t){e!==t&&this.numFrames>0&&(this.frames[this.numFrames-1].hasNewChild=!0)}pushFrame(e,t,n){if(this.numFrames===this.frames.length)this.frames.push({curr:e,state:0,childIndex:0,maxDepth:n,spos:this.resultStack.length,isCaching:t,hasNewChild:!1});else{let r=this.frames[this.numFrames];r.curr=e,r.state=0,r.childIndex=0,r.maxDepth=n,r.spos=this.resultStack.length,r.isCaching=t,r.hasNewChild=!1}this.numFrames++}beginScope(){this.scopes.push({root:this.root,numQvars:this.numQvars}),this.scopes.length===this.caches.length&&this.caches.push(new Qm(this.manager,this.manager.getNumAsts())),this.cache.reset()}endScope(){this.cache.reset();let e=this.scopes[this.scopes.length-1];this.scopes.pop(),this.root=e.root,this.numQvars=e.numQvars}resetCore(){this.caches[0].reset(),this.numFrames=0,this.shrinkResults(0),this.root=-1,this.numQvars=0,this.scopes=[]}releaseCaches(){for(let e of this.caches)e.reset()}cleanupCore(){this.releaseCaches(),this.shrinkResults(0),this.caches=[new Qm(this.manager,this.manager.getNumAsts())],this.frames=[],this.numFrames=0,this.scopes=[],this.root=-1,this.numQvars=0}},th=class extends eh{visit(e){let t=this.manager;if(t.isGroundApp(e))return this.pushResult(e),!0;let n=this.isCaching(e);if(n){let t=this.cache.find(e,0);if(t!==void 0)return this.pushResult(t),this.setNewChildFlag(e,t),!0}return t.kinds[e]===1?(this.processVar(e),!0):(this.pushFrame(e,n,1/0),!1)}processApp(e,t){let n=this.manager,r=n.getNumArgs(e);for(;t.childIndex<r;){let r=n.getArg(e,t.childIndex);if(t.childIndex++,!this.visit(r))return}let i=t.hasNewChild?n.mkApp(n.decls[e],this.resultStack.slice(t.spos),n.sorts[e]):e;this.finish(e,t,i),t.isCaching&&this.cache.insert(e,0,i)}processQuantifier(e,t){let n=this.manager,r=n.getQuantifier(e);t.childIndex===0&&(this.beginScope(),this.numQvars+=r.sorts.length,this.root=r.body);let i=[r.body,...r.patterns];for(;t.childIndex<i.length;){let e=i[t.childIndex];if(t.childIndex++,!this.visit(e))return}let a=t.hasNewChild?n.mkQuantifier({...r,body:this.resultStack[t.spos],patterns:this.resultStack.slice(t.spos+1)}):e;this.finish(e,t,a),this.endScope(),t.isCaching&&this.cache.insert(e,0,a)}finish(e,t,n){this.shrinkResults(t.spos),this.pushResult(n),this.numFrames--,this.setNewChildFlag(e,n)}mainLoop(e){if(this.root=e,!this.visit(e))for(;this.numFrames>0;){let e=this.frames[this.numFrames-1],t=e.curr;if(e.childIndex===0&&e.isCaching){let e=this.cache.find(t,0);if(e!==void 0){this.pushResult(e),this.numFrames--,this.setNewChildFlag(t,e);continue}}this.manager.kinds[t]===0?this.processApp(t,e):this.processQuantifier(t,e)}let t=this.resultStack[this.resultStack.length-1];return this.resultStack.pop(),t}reset(){this.resetCore()}cleanup(){this.cleanupCore()}release(){this.releaseCaches()}},nh=class extends th{bound=0;shift1=0;shift2=0;shift(e,t,n,r){return this.manager.isGroundApp(e)?(this.manager.incRef(e),e):(this.caches[0].reset(),this.bound=t,this.shift1=n,this.shift2=r,this.mainLoop(e))}processVar(e){let t=this.manager,n=t.values[e];if(n<this.numQvars){this.pushResult(e);return}let r=n+(n-this.numQvars>=this.bound?this.shift1:this.shift2);this.pushResult(t.mkVar(r,t.sorts[e])),this.setNewChildFlag(e,-1)}},rh=class extends th{amount=0;shift(e,t){return this.manager.isGroundApp(e)||t===0?(this.manager.incRef(e),e):(this.caches[0].reset(),this.amount=t,this.mainLoop(e))}processVar(e){let t=this.manager,n=t.values[e];n<this.numQvars?this.pushResult(e):(this.pushResult(t.mkVar(n-this.amount,t.sorts[e])),this.setNewChildFlag(e,-1))}},ih=class extends eh{bindings=[];shifts=[];setInvBindings(e){N(this.bindings,0),N(this.shifts,0);for(let t of e)this.bindings.push(t),this.shifts.push(e.length)}setBindings(e){N(this.bindings,0),N(this.shifts,0);for(let t=e.length-1;t>=0;t--)this.bindings.push(e[t]),this.shifts.push(e.length)}updateInvBindingAt(e,t){this.bindings[e]=t}},ah=class extends ih{config;lastResult=-1;newArgs=[];shifter;invShifter;blocked=/* @__PURE__ */ new Set;isSubstituting;isExpandingMacros;reduceAppHook;isFlatAssocHook;getMacroHook;getSubstHook;constructor(e,t){super(e),this.config=t,this.isSubstituting=t.getSubst!==oh.prototype.getSubst,this.isExpandingMacros=t.getMacro!==oh.prototype.getMacro,this.reduceAppHook=t.reduceApp,this.isFlatAssocHook=t.isFlatAssoc,this.getMacroHook=t.getMacro,this.getSubstHook=t.getSubst,this.shifter=new nh(e),this.invShifter=new rh(e)}reset(){this.resetCore(),N(this.bindings,0),N(this.shifts,0),this.shifter.reset(),this.invShifter.reset()}cleanup(){this.cleanupCore(),this.bindings=[],this.shifter.cleanup(),this.invShifter.cleanup(),this.shifts=[]}release(){this.invShifter.release(),this.shifter.release(),this.releaseCaches()}rewrite(e){let t=this.manager;return t.withoutTemporaries(()=>{if((this.numFrames>0||this.scopes.length>0)&&(this.numFrames=0,this.shrinkResults(0),this.scopes=[],this.caches[0].reset()),this.root=e,this.numQvars=0,t.limit.checkpoint(),!this.visit(e,1/0))for(;this.numFrames>0;){t.limit.checkpoint();let e=this.frames[this.numFrames-1],n=e.curr;if(e.childIndex===0&&e.state===0&&e.isCaching){let e=this.cache.find(n,0);if(e!==void 0){this.pushResult(e),this.numFrames--,this.setNewChildFlag(n,e);continue}}let r=t.kinds[n];r===0?this.processApp(n,e):r===2?this.processQuantifier(n,e):(this.numFrames--,this.processVar(n))}let n=this.resultStack[this.resultStack.length-1];return this.resultStack.pop(),n})}rewriteWithBindings(e,t){return this.reset(),this.setInvBindings(t),this.rewrite(e)}setLastResult(e){e!==-1&&this.manager.incRef(e),this.lastResult!==-1&&this.manager.decRef(this.lastResult),this.lastResult=e}cacheResult(e,t,n){n&&this.cache.insert(e,0,t)}visit(e,t){let n=this.manager,r=this.isSubstituting?this.getSubstHook.call(this.config,e):void 0;if(r!==void 0)return this.pushResult(r),this.setNewChildFlag(e,r),!0;if(t===0)return this.pushResult(e),!0;let i=this.isCaching(e);if(i){let t=this.cache.find(e,0);if(t!==void 0)return this.pushResult(t),this.setNewChildFlag(e,t),!0}let a=n.kinds[e];return a===1?(this.processVar(e),!0):a===0&&n.getNumArgs(e)===0?(this.processConst(e)||this.rewriteConstResult(e),!0):(this.pushFrame(e,i,t===1/0?t:t-1),!1)}processConst(e){let t=this.manager,n=e;t.incRef(n);for(let r=!1;;r=!0){let i=this.reduceAppHook.call(this.config,t.decls[n],[],t.sorts[n]);if(i!==-1){let e=typeof i==`number`?i:i.expr;this.setLastResult(e),t.decRef(e)}if(i===-1&&!r)return this.pushResult(n),t.decRef(n),!0;if(typeof i==`number`)return i===-1&&this.setLastResult(n),this.pushResult(this.lastResult),this.setLastResult(-1),this.setNewChildFlag(e,-1),t.decRef(n),!0;let a=i.expr;if(t.kinds[a]!==0||t.getNumArgs(a)>0)return t.decRef(n),!1;t.incRef(a),t.decRef(n),n=a}}rewriteConstResult(e){let t=this.manager;if(!this.blocked.has(e)){let n=this.config.mkNested();for(let e of this.blocked)n.engine.blocked.add(e);n.engine.blocked.add(e);let r=n.rewrite(this.lastResult);this.setLastResult(r),t.decRef(r),n.release()}this.setNewChildFlag(e,-1),this.pushResult(this.lastResult)}processVar(e){let t=this.manager,n=t.values[e],r=this.bindings.length-n-1,i=n<this.bindings.length?this.bindings[r]:-1;if(i===-1){this.pushResult(e);return}let a=this.bindings.length-this.shifts[r];if(t.isGroundApp(i)||a===0)this.pushResult(i);else{let e=this.cache.find(i,a);if(e!==void 0)this.pushResult(e);else{let e=this.shifter.shift(i,0,a,0);this.pushResult(e),this.cache.insert(i,a,e),t.decRef(e)}}this.setNewChildFlag(e,-1)}processApp(e,t){let n=this.manager;if(t.state===1){this.finishRewriteBuiltin(e,t);return}if(t.state===2){this.finishExpandDef(e,t);return}let r=n.getNumArgs(e);if(t.maxDepth===0&&!this.isSubstituting&&n.getOp(e)!==4)for(;t.childIndex<r;t.childIndex++)this.pushResult(n.getArg(e,t.childIndex));for(;t.childIndex<r;){if(this.isConstantFolded(e,t))return;let r=n.getArg(e,t.childIndex);if(t.childIndex++,!this.visit(r,t.maxDepth))return}let i=n.decls[e];if(this.isFlatAssocHook.call(this.config,i)&&n.getRefCount(e)<=1&&this.numFrames>1){let t=this.frames[this.numFrames-2];if(n.kinds[t.curr]===0&&n.decls[t.curr]===i&&t.state===0){this.numFrames--,this.setNewChildFlag(e,-1);return}}let a=this.newArgs,o=this.resultStack;N(a,0);for(let e=t.spos;e<o.length;e++)a.push(o[e]);let s=this.reduceAppHook.call(this.config,i,a,n.sorts[e]);if(typeof s!=`number`){this.setLastResult(s.expr),n.decRef(s.expr),this.shrinkResults(t.spos),this.pushResult(s.expr),t.state=1,this.visit(s.expr,$m(s))&&this.finishRewriteBuiltin(e,t),this.setLastResult(-1);return}let c=s===-1&&this.isExpandingMacros?this.getMacroHook.call(this.config,i):-1;if(c!==-1&&(!n.isGroundApp(c)||this.config.isReducingMacro())){t.state=2;let e=this.bindings.length;for(let t=a.length-1;t>=0;t--)this.bindings.push(a[t]),this.shifts.push(e);this.pushResult(c),this.beginScope(),this.numQvars+=a.length,this.root=c,this.pushFrame(c,!1,1/0);return}c===-1?s===-1?this.setLastResult(t.hasNewChild?n.mkApp(i,a,n.sorts[e]):e):(this.setLastResult(s),n.decRef(s)):this.setLastResult(c);let l=this.lastResult;this.shrinkResults(t.spos),this.pushResult(l),this.cacheResult(e,l,t.isCaching),this.numFrames--,this.setNewChildFlag(e,l),this.setLastResult(-1)}finishRewriteBuiltin(e,t){let n=this.resultStack[this.resultStack.length-1];this.setLastResult(n),this.shrinkResults(this.resultStack.length-1),this.shrinkResults(this.resultStack.length-1),this.pushResult(n),this.cacheResult(e,n,t.isCaching),this.numFrames--,this.setNewChildFlag(e,-1)}finishExpandDef(e,t){let n=this.manager,r=n.getNumArgs(e);N(this.bindings,this.bindings.length-r),N(this.shifts,this.shifts.length-r),this.numQvars-=r,this.endScope();let i=this.resultStack[this.resultStack.length-1];if(n.isGroundApp(i))this.setLastResult(i);else{let e=this.invShifter.shift(i,r);this.setLastResult(e),n.decRef(e)}let a=this.lastResult;this.shrinkResults(t.spos),this.pushResult(a),this.cacheResult(e,a,t.isCaching),this.numFrames--,this.setNewChildFlag(e,-1)}isConstantFolded(e,t){let n=this.manager;if(t.childIndex!==1||n.getOp(e)!==4)return!1;let r=this.resultStack[t.spos],i=n.isTrue(r)?n.getArg(e,1):n.isFalse(r)?n.getArg(e,2):-1;return i!==-1&&(this.shrinkResults(t.spos),this.pushResult(i),t.state=1,this.visit(i,t.maxDepth)&&this.finishRewriteBuiltin(e,t),this.setLastResult(-1),!0)}processQuantifier(e,t){let n=this.manager,r=n.getQuantifier(e),i=r.sorts.length;if(t.childIndex===0){this.beginScope(),this.root=r.body;let e=this.bindings.length;for(let t=0;t<i;t++)this.bindings.push(-1),this.shifts.push(e);this.numQvars+=i}let a=this.config.isRewritingPatterns(),o=a?[r.body,...r.patterns]:[r.body];for(;t.childIndex<o.length;){let e=o[t.childIndex];if(t.childIndex++,!this.visit(e,t.maxDepth))return}let s=this.resultStack[t.spos],c=a?this.resultStack.slice(t.spos+1):r.patterns;for(let e of c)n.incRef(e);let l=this.config.reduceQuantifier(e,s,c);l===-1?this.setLastResult(t.hasNewChild?n.mkQuantifier({...r,body:s,patterns:c}):e):(this.setLastResult(l),n.decRef(l));let u=this.lastResult;this.shrinkResults(t.spos),this.pushResult(u),N(this.bindings,this.bindings.length-i),N(this.shifts,this.shifts.length-i),this.endScope(),this.cacheResult(e,u,t.isCaching),this.setLastResult(-1),this.numFrames--,this.setNewChildFlag(e,u);for(let e of c)n.decRef(e)}},oh=class e{manager;engine;constructor(e){this.manager=e,this.engine=new ah(e,this)}isFlatAssoc(e){return!1}isRewritingPatterns(){return!0}getSubst(e){}reduceApp(e,t,n){return-1}getMacro(e){return-1}isReducingMacro(){return!1}reduceQuantifier(e,t,n){return-1}mkNested(){return new e(this.manager)}setInvBindings(e){this.engine.setInvBindings(e)}setBindings(e){this.engine.setBindings(e)}updateInvBindingAt(e,t){this.engine.updateInvBindingAt(e,t)}reset(){this.engine.reset()}cleanup(){this.engine.cleanup()}release(){this.engine.release()}rewrite(e){return this.engine.rewrite(e)}rewriteWithBindings(e,t){return this.engine.rewriteWithBindings(e,t)}setLastResult(e){this.engine.setLastResult(e)}},sh=class extends ih{lastResult=-1;shifter;isShifted=!1;frameExprs=/* @__PURE__ */ new Int32Array(16);frameChildIndexes=/* @__PURE__ */ new Int32Array(16);frameStarts=/* @__PURE__ */ new Int32Array(16);frameFlags=/* @__PURE__ */ new Uint8Array(16);constructor(e){super(e),this.shifter=new nh(e)}reset(){this.resetCore(),N(this.bindings,0),N(this.shifts,0),this.isShifted&&=(this.shifter.reset(),!1)}release(){this.shifter.release(),this.releaseCaches()}rewrite(e){let t=this.manager;return t.withoutTemporaries(()=>{if((this.numFrames>0||this.scopes.length>0)&&(this.numFrames=0,this.shrinkResults(0),this.scopes=[],this.caches[0].reset()),this.root=e,this.numQvars=0,t.limit.checkpoint(),!this.visit(e))for(;this.numFrames>0;){t.limit.checkpoint();let e=this.numFrames-1,n=this.frameExprs[e];if(this.frameChildIndexes[e]===0&&(this.frameFlags[e]&5)==1){let e=this.cache.find(n,0);if(e!==void 0){this.pushResult(e),this.numFrames--,this.markNewChild(n,e);continue}}t.kinds[n]===0?this.processApp(n,e):this.processQuantifier(n,e)}let n=this.resultStack[this.resultStack.length-1];return this.resultStack.pop(),n})}rewriteWithBindings(e,t){return this.reset(),this.setInvBindings(t),this.rewrite(e)}setLastResult(e){e!==-1&&this.manager.incRef(e),this.lastResult!==-1&&this.manager.decRef(this.lastResult),this.lastResult=e}markNewChild(e,t){e!==t&&this.numFrames>0&&(this.frameFlags[this.numFrames-1]|=2)}openFrame(e,t){let n=this.numFrames;n===this.frameExprs.length&&(this.frameExprs=mm(this.frameExprs),this.frameChildIndexes=mm(this.frameChildIndexes),this.frameStarts=mm(this.frameStarts),this.frameFlags=mm(this.frameFlags)),this.frameExprs[n]=e,this.frameChildIndexes[n]=0,this.frameStarts[n]=this.resultStack.length,this.frameFlags[n]=+!!t,this.numFrames++}visit(e){let t=this.manager;if(t.isGroundApp(e))return this.pushResult(e),!0;let n=this.isCaching(e);if(n){let t=this.cache.find(e,0);if(t!==void 0)return this.pushResult(t),this.markNewChild(e,t),!0}return t.kinds[e]===1?(this.processVar(e),!0):(this.openFrame(e,n),!1)}processVar(e){let t=this.manager,n=t.values[e],r=this.bindings.length-n-1,i=n<this.bindings.length?this.bindings[r]:-1;if(i===-1){this.pushResult(e);return}let a=this.bindings.length-this.shifts[r];if(t.isGroundApp(i)||a===0)this.pushResult(i);else{let e=this.cache.find(i,a);if(e!==void 0)this.pushResult(e);else{this.isShifted=!0;let e=this.shifter.shift(i,0,a,0);this.pushResult(e),this.cache.insert(i,a,e),t.decRef(e)}}this.markNewChild(e,-1)}processApp(e,t){let n=this.manager;if(this.frameFlags[t]&4){this.finishFolded(e,t);return}let r=n.getNumArgs(e);for(;this.frameChildIndexes[t]<r;){let r=this.frameChildIndexes[t];if(r===1&&this.isConstantFolded(e,t)||(this.frameChildIndexes[t]=r+1,!this.visit(n.getArg(e,r))))return}let i=this.frameStarts[t];this.setLastResult(this.frameFlags[t]&2?n.mkApp(n.decls[e],this.resultStack,n.sorts[e],i):e);let a=this.lastResult;this.shrinkResults(i),this.pushResult(a),this.frameFlags[t]&1&&this.cache.insert(e,0,a),this.numFrames--,this.markNewChild(e,a),this.setLastResult(-1)}finishFolded(e,t){let n=this.resultStack[this.resultStack.length-1];this.setLastResult(n),this.shrinkResults(this.resultStack.length-1),this.shrinkResults(this.resultStack.length-1),this.pushResult(n),this.frameFlags[t]&1&&this.cache.insert(e,0,n),this.numFrames--,this.markNewChild(e,-1)}isConstantFolded(e,t){let n=this.manager;if(n.getOp(e)!==4)return!1;let r=this.frameStarts[t],i=this.resultStack[r],a=n.isTrue(i)?n.getArg(e,1):n.isFalse(i)?n.getArg(e,2):-1;return a!==-1&&(this.shrinkResults(r),this.pushResult(a),this.frameFlags[t]|=4,this.visit(a)&&this.finishFolded(e,t),this.setLastResult(-1),!0)}processQuantifier(e,t){let n=this.manager,r=n.getQuantifier(e),i=r.sorts.length;if(this.frameChildIndexes[t]===0){this.beginScope(),this.root=r.body;let e=this.bindings.length;for(let t=0;t<i;t++)this.bindings.push(-1),this.shifts.push(e);this.numQvars+=i}for(;this.frameChildIndexes[t]<=r.patterns.length;){let e=this.frameChildIndexes[t];if(this.frameChildIndexes[t]=e+1,!this.visit(e===0?r.body:r.patterns[e-1]))return}let a=this.frameStarts[t],o=this.resultStack[a],s=this.resultStack.slice(a+1);for(let e of s)n.incRef(e);this.setLastResult(this.frameFlags[t]&2?n.mkQuantifier({...r,body:o,patterns:s}):e);let c=this.lastResult;this.shrinkResults(a),this.pushResult(c),N(this.bindings,this.bindings.length-i),N(this.shifts,this.shifts.length-i),this.endScope(),this.frameFlags[t]&1&&this.cache.insert(e,0,c),this.setLastResult(-1),this.numFrames--,this.markNewChild(e,c);for(let e of s)n.decRef(e)}},ch=class e{manager;sources;targets;refs;cache=/* @__PURE__ */ new Map;constructor(e){this.manager=e,this.sources=new F(e),this.targets=new F(e),this.refs=new F(e)}insert(e,t){this.sources.push(e),this.targets.push(t),this.cache.clear()}apply(e){let t=this.manager;if(this.sources.size===0)return t.incRef(e),e;this.cache.size===0&&this.sources.items.forEach((e,t)=>{this.cache.has(e)||this.cache.set(e,this.targets.items[t])});let n=[e];for(this.refs.push(e);n.length>0;){let e=n[n.length-1];if(this.cache.get(e)!==void 0)n.pop();else if(t.kinds[e]===1)this.cache.set(e,e),n.pop();else if(t.kinds[e]===0){let r=[],i=!1,a=!0;for(let o=0;o<t.getNumArgs(e);o++){let s=t.getArg(e,o),c=a?this.cache.get(s):void 0;c===void 0?(n.push(s),a=!1):(r.push(c),i||=s!==c)}if(a){let a=i?t.mkApp(t.decls[e],r,t.sorts[e]):e;i&&this.refs.push(a),this.cache.set(e,a),n.pop()}}else this.applyQuantifier(e,n)}let i=this.cache.get(e);if(i===void 0)throw new r(`the replaced expression has no result`);return t.incRef(i),this.refs.size>1<<20&&(this.cache.clear(),this.refs.reset()),i}applyQuantifier(t,n){let r=this.manager,i=r.getQuantifier(t),a=new F(r),o=-1;if(this.sources.items.every(e=>r.isGroundApp(e))&&this.targets.items.every(e=>r.isGroundApp(e))){let e=!0,t=this.cache.get(i.body);t===void 0?(n.push(i.body),e=!1):(o=t,r.incRef(o));for(let t of i.patterns){let r=e?this.cache.get(t):void 0;r===void 0?(n.push(t),e=!1):a.push(r)}if(!e){a.reset(),o!==-1&&r.decRef(o);return}}else{let t=new e(r),n=new nh(r),s=i.sorts.length,c=-1,l=-1,u=-1;this.sources.items.forEach((e,i)=>{let a=n.shift(e,0,s,0);c!==-1&&r.decRef(c),c=a;let o=n.shift(this.targets.items[i],0,s,0);l!==-1&&r.decRef(l),l=o,t.insert(c,l)});for(let e of i.patterns){let n=t.apply(e);u!==-1&&r.decRef(u),u=n,a.push(u)}if(t.sources.items.every(e=>r.kinds[e]===1)){let e=Math.max(0,...t.sources.items.map(e=>r.values[e])),n=Array.from({length:e+1},()=>-1);t.sources.items.forEach((e,i)=>{n[r.values[e]]=t.targets.items[i]});let a=new lh(r,!1);o=a.apply(i.body,n),a.release()}else o=t.apply(i.body);for(let e of[u,l,c])e!==-1&&r.decRef(e);n.release(),t.release()}let s=r.mkQuantifier({...i,body:o,patterns:[...a.items]});this.refs.push(s),this.cache.set(t,s),n.pop(),a.reset(),r.decRef(o)}release(){this.cache.clear(),this.refs.reset(),this.targets.reset(),this.sources.reset()}},lh=class{manager;isStdOrder;reducer;constructor(e,t){this.manager=e,this.isStdOrder=t,this.reducer=new sh(e)}apply(e,t){let n=this.manager,r=t.length;if(n.isGroundApp(e)||r===0)return n.incRef(e),e;if(n.hasQuantifierFlags[e]){let i=new ch(n);t.forEach((e,t)=>{e!==-1&&i.insert(n.mkVar(this.isStdOrder?r-t-1:t,n.sorts[e]),e)});let a=i.apply(e);return i.release(),a}if(n.kinds[e]===0&&n.everyArg(e,e=>n.isGroundApp(e)||n.kinds[e]===1)){let i=n.mkApp(n.decls[e],n.mapArgs(e,e=>{if(n.isGroundApp(e))return e;let i=n.values[e],a=i<r?this.isStdOrder?t[r-i-1]:t[i]:-1;return a===-1?e:a}),n.sorts[e]);return n.incRef(i),i}return this.reducer.reset(),this.isStdOrder?this.reducer.setInvBindings(t):this.reducer.setBindings(t),this.reducer.rewrite(e)}release(){this.reducer.release()}};const uh=(e,t,n)=>{let r=/* @__PURE__ */ new Map,i=[],a=[],o=(t,o)=>{if(e.freeVarBounds[t]<=o){a.push(t);return}let s=t*64+o,c=r.get(s);if(c!==void 0)a.push(c);else if(e.kinds[t]!==1)i.push({expr:t,shift:o,start:a.length,next:0});else{let i=n(t,e.values[t]-o,o);r.set(s,i),a.push(i)}};for(o(t,0);i.length>0;){let t=i[i.length-1],n=t.expr,s=e.kinds[n]===2?e.getQuantifier(n):null,c=s===null?e.getNumArgs(n):1+s.patterns.length;if(t.next<c){let r=t.next++;s===null?o(e.getArg(n,r),t.shift):o(r===0?s.body:s.patterns[r-1],t.shift+s.sorts.length);continue}let l=a.splice(t.start),u=s===null?e.mkApp(e.decls[n],l,e.sorts[n]):e.mkQuantifier({...s,body:l[0],patterns:l.slice(1)});i.pop(),r.set(n*64+t.shift,u),a.push(u)}return a[0]},dh=(e,t,n)=>{let r=Array.from({length:n},()=>void 0),i=[t],a=[0],o=/* @__PURE__ */ new Set;for(let t=i.pop();t!==void 0;t=i.pop()){let s=a.pop()??0;if(e.freeVarBounds[t]<=s)continue;if(e.getRefCount(t)>1){let e=t*64+s;if(o.has(e))continue;o.add(e)}let c=e.kinds[t];if(c===1){let i=e.values[t]-s;i<n&&r[i]===void 0&&(r[i]=e.sorts[t])}else if(c===0)for(let n=0;n<e.getNumArgs(t);n++){let r=e.getArg(t,n);i.push(r),a.push(s)}else{let n=e.getQuantifier(t);for(let e of[n.body,...n.patterns])i.push(e),a.push(s+n.sorts.length)}}return r},fh=(e,t,n)=>dh(e,t,n).map(e=>e!==void 0);var ph=class{manager;subst;constructor(e){this.manager=e,this.subst=new lh(e,!0)}apply(e){let t=this.manager;return t.withoutTemporaries(()=>{let n=t.kinds[e]===2?t.getQuantifier(e):null,r=n===null?e:t.isGround(n.body)?n.body:-1;if(r!==-1||n===null)return t.incRef(r),r;let i=[];for(let e of[n.body,...n.patterns])dh(t,e,t.freeVarBounds[e]).forEach((e,t)=>{e!==void 0&&(i[t]=e)});let a=n.sorts.length;if(i.slice(0,a).filter(e=>e!==void 0).length===a)return t.incRef(e),e;let o=[],s=[];n.sorts.forEach((e,t)=>{i[a-t-1]!==void 0&&(o.push(e),s.push(n.names[t]))});let c=[],l=0;for(let e=0;e<Math.max(a,i.length);e++){let n=i[e];if(n===void 0){e<a&&l++,c.push(-1);continue}let r=t.mkVar(e-l,n);t.incRef(r),c.push(r)}c.reverse();let u=this.subst.apply(n.body,c),d=l===a?[]:n.patterns.map(e=>this.subst.apply(e,c)),f=l===a?u:t.mkQuantifier({...n,sorts:o,names:s,body:u,patterns:d});if(f!==u){t.incRef(f);for(let e of d)t.decRef(e);t.decRef(u)}for(let e of c)e!==-1&&t.decRef(e);return f})}release(){this.subst.release()}};const mh=(e,t)=>{let n=new ph(e),r=n.apply(t);return n.release(),e.releaseLater(r),r};var hh=class{manager;names=/* @__PURE__ */ new Map;exprs;nameRefs;lims=[];constructor(e){this.manager=e,this.exprs=new F(e),this.nameRefs=new F(e)}push(){this.lims.push(this.exprs.size)}pop(){let e=this.lims[this.lims.length-1];for(this.lims.pop();this.exprs.size>e;)this.names.delete(this.exprs.items[this.exprs.size-1]),this.exprs.shrink(this.exprs.size-1),this.nameRefs.shrink(this.nameRefs.size-1)}mkName(e){let t=this.manager,n=this.names.get(e);if(n!==void 0)return{name:n,definition:-1};let r=dh(t,e,t.freeVarBounds[e]),i=r.map(e=>e??0),a=t.mkApp(t.mkFreshFuncDecl(`z3name`,i,0),r.map((e,n)=>e===void 0?t.trueExpr:t.mkVar(n,e)),0);return this.names.set(e,a),this.exprs.push(e),this.nameRefs.push(a),{name:a,definition:t.withTemporaries(()=>{let n=e=>i.length===0?e:mh(t,t.mkQuantifier({isForall:!0,sorts:i.toReversed(),names:i.map((e,t)=>i.length-1-t),body:e,patterns:[t.mkPattern([a])],weight:1,qid:``})),r=n(t.mkOr([t.mkNot(a),e])),o=n(t.mkOr([a,t.mkNot(e)]));return t.mkAnd([r,o])})}}},gh=class extends oh{names;definitions=null;constructor(e,t){super(e),this.names=t}getSubst(e){if(this.manager.kinds[e]!==2)return;let t=this.names.mkName(e);return t.definition!==-1&&(this.definitions?.push(t.definition),this.manager.decRef(t.definition)),t.name}name(e,t){return this.definitions=t,this.rewrite(e)}},_h=class{manager;cache;subst;constructor(e){this.manager=e,this.cache=new Qm(e,e.getNumAsts()),this.subst=new lh(e,!0)}skolemize(e){let t=this.manager,n=this.cache.find(e,0);if(n!==void 0)return t.incRef(n),n;let r=t.getQuantifier(e),i=r.sorts.length,a=dh(t,r.body,t.freeVarBounds[r.body]).slice(i),o=new F(t),s=[];a.forEach((e,n)=>{e!==void 0&&(o.push(t.mkVar(n,e)),s.push(e))});let c=new F(t);for(let e=i-1;e>=0;e--){let n=r.sorts[e];c.push(t.mkApp(t.mkFreshFuncDecl(r.names[e],s,n),o.items,n))}a.forEach((e,n)=>c.push(e===void 0?-1:t.mkVar(n,e))),c.items.reverse();let l=this.subst.apply(r.body,c.items);return c.reset(),o.reset(),this.cache.insert(e,0,l),l}release(){this.cache.reset(),this.subst.release()}},vh=class{manager;frames=[];results;caches;todoDefs;skolemizer;namer;constructor(e,t){this.manager=e,this.results=new F(e),this.caches=Array.from({length:4},()=>new Qm(e,e.getNumAsts())),this.todoDefs=new F(e),this.skolemizer=new _h(e),this.namer=new gh(e,t)}apply(e,t){return this.manager.withoutTemporaries(()=>{this.reset();let n=this.process(e),r=t.size;for(let e=0;e<this.todoDefs.size;e++){let n=this.process(this.todoDefs.items[e]);t.pushOwned(n)}let i=t.items.splice(r).reverse();return t.items.push(...i),n})}release(){this.manager.withoutTemporaries(()=>{this.namer.release(),this.skolemizer.release(),this.todoDefs.reset();for(let e=this.caches.length-1;e>=0;e--)this.caches[e].reset();this.results.reset(),this.popFrames(0)})}reset(){this.popFrames(0),this.results.reset(),this.todoDefs.reset()}popFrames(e){for(let t of this.frames.splice(e))this.manager.decRef(t.curr)}getCache(e,t){return this.caches[(t?2:0)+ +!!e]}pushFrame(e,t,n,r){this.manager.incRef(e),this.frames.push({curr:e,index:0,isPositive:t,isInQuantifier:n,isCaching:r,spos:this.results.size})}skip(e,t){this.results.push(t?e:qm(this.manager,e))}visit(e,t,n){let r=this.manager;if(!r.hasQuantifierFlags[e])return this.skip(e,t),!0;let i=r.getRefCount(e)>1;if(i){let r=this.getCache(t,n).find(e,0);if(r!==void 0)return this.results.push(r),!0}let a=r.kinds[e];return a===1||a===0&&r.getNumArgs(e)===0?(this.skip(e,t),!0):(this.pushFrame(e,t,n,i),!1)}process(e){let t=this.manager;if(!this.visit(e,!0,!1))for(;this.frames.length>0;){t.limit.checkpoint();let e=this.frames[this.frames.length-1],n=e.curr;if(e.index===0&&t.getRefCount(n)>1){let t=this.getCache(e.isPositive,e.isInQuantifier).find(n,0);if(t!==void 0){this.results.push(t),this.popFrames(this.frames.length-1);continue}}(t.kinds[n]===2?this.processQuantifier(n,e):this.processApp(n,e))&&(e.isCaching&&this.getCache(e.isPositive,e.isInQuantifier).insert(n,0,this.results.items[this.results.size-1]),this.popFrames(this.frames.length-1))}let n=this.results.items[this.results.size-1];return this.results.items.pop(),n}visitChildren(e,t){for(;e.index<t.length;){let n=t[e.index++];if(!this.visit(n[0],n[1],e.isInQuantifier))return!1}return!0}setResult(e,t){this.manager.incRef(t),this.results.shrink(e),this.results.pushOwned(t)}processApp(e,t){let n=this.manager,r=t.isPositive,i=n.getOp(e);switch(i===2&&!n.isBool(n.getArg(e,0))?-1:i){case 5:case 6:{if(!this.visitChildren(t,n.mapArgs(e,e=>[e,r])))return!1;let a=this.results.items.slice(t.spos);return this.setResult(t.spos,n.mkApp(i===5===r?5:6,a,0)),!0}case 8:return this.visitChildren(t,[[n.getArg(e,0),!r]]);case 9:{if(!this.visitChildren(t,[[n.getArg(e,0),!r],[n.getArg(e,1),r]]))return!1;let i=this.results.items.slice(t.spos);return this.setResult(t.spos,n.mkApp(r?6:5,i,0)),!0}case 4:{if(!this.visitChildren(t,[[n.getArg(e,0),!0],[n.getArg(e,0),!1],[n.getArg(e,1),r],[n.getArg(e,2),r]]))return!1;let i=this.results.items.slice(t.spos),a=n.mkApp(6,[i[1],i[2]],0),o=n.mkApp(6,[i[0],i[3]],0);return this.setResult(t.spos,n.mkApp(5,[a,o],0)),!0}case 2:case 7:{if(!this.visitChildren(t,[[n.getArg(e,0),!0],[n.getArg(e,0),!1],[n.getArg(e,1),!0],[n.getArg(e,1),!1]]))return!1;let a=this.results.items.slice(t.spos),o=i===2===r,s=n.mkApp(6,o?[a[1],a[2]]:[a[0],a[2]],0),c=n.mkApp(6,o?[a[0],a[3]]:[a[1],a[3]],0);return this.setResult(t.spos,n.mkApp(5,[s,c],0)),!0}default:{let t=this.namer.name(e,this.todoDefs);return r?this.results.pushOwned(t):(this.results.push(qm(n,t)),n.decRef(t)),!0}}}processQuantifier(e,t){let n=this.manager,r=n.getQuantifier(e),i=r.isForall===t.isPositive;if(t.index===0){if(t.index=1,i){if(!this.visit(r.body,t.isPositive,!0))return!1}else{let i=this.skolemizer.skolemize(e),a=this.visit(i,!r.isForall,t.isInQuantifier);if(n.decRef(i),!a)return!1}}if(!i)return!0;let a=this.results.items[this.results.size-1];return this.setResult(this.results.size-1,n.mkQuantifier({...r,isForall:!0,body:a})),!0}};const yh=(e,t)=>e.size===t.size&&[...e].every(e=>t.has(e)),bh=(e,t)=>[...e].every(e=>t.has(e));var xh=class{manager;candidates;candidateInfos=/* @__PURE__ */ new Map;numBindings=0;isArithForbidden=!0;isNestedArithOnly=!0;isBlockingLoopPatterns=!0;constructor(e){this.manager=e,this.candidates=new F(e)}isForbidden(e){let t=this.manager;if(t.isGround(e))return!1;let n=t.funcDecls[t.decls[e]];return n.isSkolem?!0:n.family===0?n.op!==0&&n.op!==1:n.family===1&&this.isArithForbidden}collect(e){let t=this.manager,n=/* @__PURE__ */ new Map,r=(e,i)=>{let a=`${e}:${i}`;if(n.has(a))return n.get(a)??null;let o=null,s=t.kinds[e];if(s===1){let n=t.values[e],r=/* @__PURE__ */ new Set,a=/* @__PURE__ */ new Set;i<=n&&n<this.numBindings+i?r.add(n-i):n<i&&a.add(n),o={freeVars:r,boundVars:a,size:1}}else if(s===0){let n=t.mapArgs(e,e=>r(e,i));if(this.isForbidden(e))o=null;else if(t.getNumArgs(e)===0)o={freeVars:/* @__PURE__ */ new Set,boundVars:/* @__PURE__ */ new Set,size:1};else if(n.every(e=>e!==null)){let r=/* @__PURE__ */ new Set,a=/* @__PURE__ */ new Set,s=1;for(let e of n)e!==null&&(e.freeVars.forEach(e=>r.add(e)),e.boundVars.forEach(e=>a.add(e)),s+=e.size);o={freeVars:r,boundVars:a,size:s};let c=t.funcDecls[t.decls[e]],l=!this.isNestedArithOnly&&(c.op===19||c.op===20||c.op===18);if(r.size>0&&a.size===0&&(c.family!==1||l)){let n=new rh(t),a=t.withoutTemporaries(()=>n.shift(e,i));this.addCandidate(a,r,s),t.decRef(a),n.release()}}}else if(s===2){let n=t.getQuantifier(e),a=n.sorts.length,s=r(n.body,i+a);if(s!==null){let e=/* @__PURE__ */ new Set;s.boundVars.forEach(t=>{t>=a&&e.add(t-a)}),o={freeVars:s.freeVars,boundVars:e,size:s.size+1}}}return n.set(a,o),o};r(e,0)}addCandidate(e,t,n){this.candidateInfos.has(e)||(this.candidateInfos.set(e,{freeVars:t,boundVars:/* @__PURE__ */ new Set,size:n}),this.candidates.push(e))}isSmaller(e,t){let n=this.manager,r=Array.from({length:this.numBindings},()=>-1),i=[[e,t]];for(;i.length>0;){let e=i.pop();if(e===void 0)break;let t=e[0],a=e[1],o=n.kinds[t];if(o===0){if(n.kinds[a]!==0||n.decls[t]!==n.decls[a]||n.getNumArgs(t)!==n.getNumArgs(a)||n.values[t]!==n.values[a])return!1;for(let e=0;e<n.getNumArgs(t);e++)i.push([n.getArg(t,e),n.getArg(a,e)])}else if(o===1&&n.values[t]<this.numBindings){let e=n.values[t];if(r[e]===-1)r[e]=a;else if(r[e]!==a)return!1}else if(t!==a)return!1}return!0}filterLoopingPatterns(){let e=[];for(let t of this.candidates.items){let n=this.candidateInfos.get(t);n!==void 0&&(this.isBlockingLoopPatterns&&this.candidates.items.some(e=>{if(e===t)return!1;let r=this.candidateInfos.get(e);return r!==void 0&&yh(n.freeVars,r.freeVars)&&this.isSmaller(t,e)&&!this.isSmaller(e,t)})?this.candidateInfos.delete(t):e.push(t))}return e}containsSubpattern(e){let t=this.manager,n=this.candidateInfos.get(e);if(n===void 0)return!1;let r=/* @__PURE__ */ new Set([e]),i=[e];for(;i.length>0;){let a=i.pop();if(a===void 0)break;if(t.kinds[a]===0){if(a!==e){let e=this.candidateInfos.get(a);if(e!==void 0&&yh(e.freeVars,n.freeVars))return!0}for(let e=0;e<t.getNumArgs(a);e++){let n=t.getArg(a,e);r.has(n)||(r.add(n),i.push(n))}}}return!1}mkPattern(e){let t=this.manager,n=e=>t.kinds[e]===0&&t.someArg(e,e=>t.isVar(e));if(n(e))return t.mkPattern([e]);let r=[];for(let n=0;n<t.getNumArgs(e);n++){let i=t.getArg(e,n);if(t.kinds[i]!==0)return t.mkPattern([e]);r.push(i)}for(let i=0;i<r.length;i++){let a=r[i];if(!n(a)&&(r[i]=r[r.length-1],i--,r.pop(),!t.isGround(a)))for(let n=0;n<t.getNumArgs(a);n++){let i=t.getArg(a,n);if(t.kinds[i]!==0)return t.mkPattern([e]);r.push(i)}}return t.mkPattern(r)}candidatesToMultiPatterns(e,t,n){let r=[{exprs:[],freeVars:/* @__PURE__ */ new Set,index:0}],i=0;for(let a=0;a<r.length;a++){let o=r[a];if(o!==null){if(o.freeVars.size===this.numBindings){if(n.push(this.manager.mkPattern(o.exprs)),n.length>=e)return}else if(o.index<t.length){let e=t[o.index],n=this.candidateInfos.get(e)?.freeVars??/* @__PURE__ */ new Set;bh(n,o.freeVars)?(r[a]=null,o.index++,r.push(o)):(r.push({exprs:[...o.exprs,e],freeVars:/* @__PURE__ */ new Set([...o.freeVars,...n]),index:o.index+1}),i<32&&(r[a]=null,o.index++,r.push(o),i++))}}}}mkPatterns(e,t){this.numBindings=e,this.collect(t);let n=[];if(this.candidates.size>0){let t=this.filterLoopingPatterns().filter(e=>!this.containsSubpattern(e)),r=[];for(let i of t){let t=this.candidateInfos.get(i);t!==void 0&&t.freeVars.size===e?n.push(this.mkPattern(i)):r.push(i)}let i=+(n.length===0);if(i>0&&r.length>0){let e=e=>this.candidateInfos.get(e),t=r.map((e,t)=>({candidate:e,index:t})).sort((t,n)=>{let r=e(t.candidate),i=e(n.candidate);return r===void 0||i===void 0?t.index-n.index:r.freeVars.size===i.freeVars.size?r.size===i.size?t.index-n.index:r.size-i.size:i.freeVars.size-r.freeVars.size}).map(e=>e.candidate);this.candidatesToMultiPatterns(i,t,n)}}return this.candidateInfos=/* @__PURE__ */ new Map,this.candidates.reset(),n}infer(e,t,n){this.isArithForbidden=!0,this.isNestedArithOnly=!0,this.isBlockingLoopPatterns=!0;let r=this.mkPatterns(e,t);if(r.length>0)return{patterns:r,weight:n};this.isArithForbidden=!1,this.isBlockingLoopPatterns=!1;let i=this.mkPatterns(e,t);if(i.length>0)return{patterns:i,weight:Math.max(n,5)};this.isNestedArithOnly=!1;let a=this.mkPatterns(e,t);return{patterns:a,weight:a.length>0?Math.max(n,10):n}}inferPulled(e,t){return this.isArithForbidden=!1,this.isNestedArithOnly=!0,this.isBlockingLoopPatterns=!0,this.mkPatterns(e,t)}},Sh=class extends oh{isInit=!1;entries=[];pairCache=/* @__PURE__ */ new Map;pairScopes=[];constructor(e){super(e)}reduceApp(e,t,n){let r=this.manager,i=r.funcDecls[e].op;return!this.isInit||i!==6&&i!==15||t.length<=2?-1:r.withTemporaries(()=>{let i=[...t];for(let t=0;i.length>1&&i.length<128;){let a=-1,o=-1;for(let n=0;n<t&&a===-1;n++)this.hasPair(e,i[n],i[t])&&(a=n,o=t);for(let n=t;n+1<i.length&&a===-1;n++)for(let t=n+1;t<i.length&&a===-1;t++)this.hasPair(e,i[n],i[t])&&(a=n,o=t);if(a===-1)break;i[a]=r.mkApp(e,[i[a],i[o]],n),i.splice(o,1),t=a}for(;i.length>1;){let t=[];for(let a=0;a<i.length;a+=2)a===i.length-1?t.push(i[a]):(this.insert(e,i[a],i[a+1]),t.push(r.mkApp(e,[i[a],i[a+1]],n)));i.splice(0,i.length,...t)}return i[0]})}insert(e,t,n){let r=this.manager.ids[t]<=this.manager.ids[n];this.entries.push({decl:e,first:r?t:n,second:r?n:t});let i=this.pairCache.get(e)??/* @__PURE__ */ new Map;this.pairCache.set(e,i);let a=Math.min(t,n),o=i.get(a)??/* @__PURE__ */ new Set;i.set(a,o),o.add(Math.max(t,n)),this.manager.incRef(t),this.manager.incRef(n)}hasPair(e,t,n){return this.pairCache.get(e)?.get(Math.min(t,n))?.has(Math.max(t,n))===!0}pushScope(){this.isInit=!0,this.pairScopes.push(this.entries.length)}popScope(){let e=this.pairScopes.pop();for(let t=this.entries.length-1;t>=e;t--){let e=this.entries[t];this.pairCache.get(e.decl)?.get(Math.min(e.first,e.second))?.delete(Math.max(e.first,e.second)),this.manager.decRef(e.first),this.manager.decRef(e.second)}N(this.entries,e)}},Ch=class extends oh{varShifter;constructor(e){super(e),this.varShifter=new nh(e)}pullFromApp(e,t,n){let r=this.manager;if(r.funcDecls[e].op===8){let e=t[0];if(r.kinds[e]!==2)return-1;let n=r.getQuantifier(e),i=r.mkQuantifier({...n,isForall:!n.isForall,body:qm(r,n.body)});return r.incRef(i),i}let i,a=[],o=[],s=1/0,c=``;for(let e of t){if(r.kinds[e]!==2)continue;let t=r.getQuantifier(e);if(i===void 0)i=t.isForall;else if(i!==t.isForall)return-1;a.length===0&&(c=t.qid),s=Math.min(s,t.weight);for(let e=t.sorts.length-1;e>=0;e--){let n=t.names[e];a.push(t.sorts[e]),o.push(o.includes(n)?r.mkFreshVarName(typeof n==`number`?null:n):n)}}if(i===void 0)return-1;let l=a.length,u=0,d=t.map(e=>{if(r.kinds[e]!==2)return this.varShifter.shift(e,0,l,0);let t=r.getQuantifier(e),n=this.varShifter.shift(t.body,t.sorts.length,l-t.sorts.length,u);return u+=t.sorts.length,n}),f=r.mkQuantifier({isForall:i,sorts:a.reverse(),names:o.reverse(),body:r.mkApp(e,d,n),patterns:[],weight:s,qid:c});r.incRef(f);for(let e of d)r.decRef(e);return f}reduceApp(e,t,n){let r=this.manager,i=r.funcDecls[e].op;if(i===8&&r.isNot(t[0])){let e=r.getArg(t[0],0);return r.incRef(e),{expr:e,depth:1}}return i!==6&&i!==5&&i!==8?-1:this.pullFromApp(e,t,n)}reduceQuantifier(e,t){let n=this.manager,r=n.getQuantifier(e);if(!r.isForall){let e=n.mkNot(n.mkQuantifier({...r,isForall:!0,body:qm(n,t)}));return n.incRef(e),e}if(n.kinds[t]!==2||!n.getQuantifier(t).isForall)return-1;let i=n.getQuantifier(t),a=n.mkQuantifier({isForall:!0,sorts:[...r.sorts,...i.sorts],names:[...r.names,...i.names],body:i.body,patterns:[],weight:Math.min(r.weight,i.weight),qid:r.qid});return n.incRef(a),a}release(){this.varShifter.release(),super.release()}};const wh=(e,t)=>{let n=new Ch(e),r=n.rewrite(t);return n.release(),r},Th=/* @__PURE__ */ new Set([10,15,16,17,18,19,20,21,11,12,13,14,23,24,25,26]);var Eh=class{manager;options;currSort=1;visitedStamps=/* @__PURE__ */ new Int32Array;multipleStamps=/* @__PURE__ */ new Int32Array;stamp=0;constructor(e,t){this.manager=e,this.options=t}reduce(e,t){return{expr:e,depth:t}}isZero(e){return this.manager.isNumeral(e)&&this.getValue(e).isZero()}getValue(e){return this.manager.getRationalValue(e)}mkNumeral(e){return this.manager.mkNumeralOfSort(e,this.currSort)}isAdd(e){return this.manager.getOp(e)===15}isMul(e){return this.manager.getOp(e)===18}isArithTerm(e){return this.manager.kinds[e]===0&&Th.has(this.manager.getOp(e))}getNumMonomials(e){return this.isAdd(e)?this.manager.getNumArgs(e):1}getMonomial(e,t){return this.isAdd(e)?this.manager.getArg(e,t):e}getPowerProduct(e){return this.isMul(e)&&this.manager.getNumArgs(e)===2&&this.manager.isNumeral(this.manager.getArg(e,0))?this.manager.getArg(e,1):e}getCoefficient(e){return this.isMul(e)&&this.manager.getNumArgs(e)===2&&this.manager.isNumeral(this.manager.getArg(e,0))?this.getValue(this.manager.getArg(e,0)):P.one}getOrdinal(e){let t=this.manager;return t.kinds[e]!==0||!Th.has(t.getOp(e))?t.ids[e]:this.isMul(e)?t.ids[t.isNumeral(t.getArg(e,0))?t.getArg(e,1):e]:t.isNumeral(e)?-1:t.ids[e]}sortMonomials(e,t){for(let n=t+1;n<e.length;n++){let r=e[n],i=this.getOrdinal(r),a=n;for(;a>t&&this.getOrdinal(e[a-1])>i;a--)e[a]=e[a-1];e[a]=r}return e}mkAddApp(e){return e.length===0?this.mkNumeral(P.zero):e.length===1?e[0]:this.manager.mkApp(15,e,this.currSort)}mkMulApp(e){return e.length===0?this.mkNumeral(P.one):e.length===1?e[0]:e.length>2&&this.manager.isNumeral(e[0])?this.mkMulAppWith(this.getValue(e[0]),this.mkMulApp(e.slice(1))):this.manager.mkApp(18,e,this.currSort)}mkMulAppWith(e,t){return e.equals(P.one)||this.isZero(t)?t:this.mkMulApp([this.mkNumeral(e),t])}mkAdd(e){if(e.length<2)return;if(this.currSort=this.manager.sorts[e[0]],!e.some(e=>this.isAdd(e)))return this.mkNflatAdd(e);let t=[];for(let n of e)this.isAdd(n)?this.manager.pushArgs(n,t):t.push(n);return this.mkNflatAdd(t)??this.mkAddApp(t)}mkNflatAdd(e){let t=this.manager,n=this.options.isSortSums,r=P.zero,i=0,a=!0,o=-1,s=!1,c=++this.stamp;for(let l=0;l<e.length;l++){let u=e[l];t.isNumeral(u)?(i++,r=r.add(this.getValue(u)),a=!n||l===0):n&&a&&(o!==-1&&this.getOrdinal(u)<this.getOrdinal(o)&&(a=!1),o=u);let d=this.getPowerProduct(u);d>=this.visitedStamps.length&&this.growStamps(d),this.visitedStamps[d]===c?(this.multipleStamps[d]=c,s=!0):this.visitedStamps[d]=c}if(s){let i=/* @__PURE__ */ new Map;for(let n of e){if(t.isNumeral(n))continue;let e=this.getPowerProduct(n);this.multipleStamps[e]===c&&i.set(e,(i.get(e)??P.zero).add(this.getCoefficient(n)))}let a=r.isZero()?[]:[this.mkNumeral(r)],o=++this.stamp;for(let n of e){if(t.isNumeral(n))continue;let e=this.getPowerProduct(n);if(this.multipleStamps[e]!==c)a.push(n);else if(this.visitedStamps[e]!==o){this.visitedStamps[e]=o;let t=i.get(e)??P.zero;t.isZero()||a.push(this.mkMulAppWith(t,e))}}return this.mkAddApp(n?this.sortMonomials(a,+!r.isZero()):a)}if(a&&(i===0||i===1&&t.isNumeral(e[0])&&!this.getValue(e[0]).isZero()))return;let l=r.isZero()?[]:[this.mkNumeral(r)];for(let n of e)t.isNumeral(n)||l.push(n);return this.mkAddApp(a?l:this.sortMonomials(l,+!r.isZero()))}growStamps(e){let t=Math.max(2*this.visitedStamps.length,e+1,1024),n=new Int32Array(t);n.set(this.visitedStamps),this.visitedStamps=n;let r=new Int32Array(t);r.set(this.multipleStamps),this.multipleStamps=r}mkMul(e){if(e.length<2)return;if(this.currSort=this.manager.sorts[e[0]],e.length===2&&this.manager.isNumeral(e[0])&&!(this.isMul(e[1])&&this.manager.isNumeral(this.manager.getArg(e[1],0)))||!e.some(e=>this.isMul(e)))return this.mkNflatMul(e);let t=[],n=e=>{if(this.isMul(e))for(let t=0;t<this.manager.getNumArgs(e);t++)n(this.manager.getArg(e,t));else t.push(e)};for(let t of e)n(t);return this.mkNflatMul(t)??this.mkMulApp(t)}mkNflatMul(e){let t=this.manager;if(e.length===2&&this.manager.isNumeral(e[0])&&!this.getValue(e[0]).equals(P.one)&&!this.getValue(e[0]).isZero()&&!this.isArithTerm(e[1]))return;let n=P.one,r=0,i=0,a=-1;for(let t of e)this.manager.isNumeral(t)?(r++,n=n.mul(this.getValue(t))):(a=t,this.isAdd(t)&&i++);if(r===e.length||n.isZero())return this.mkNumeral(n);if(r===e.length-1)return n.equals(P.one)?a:this.isMul(a)?t.getNumArgs(a)!==2||!this.manager.isNumeral(t.getArg(a,0))?void 0:this.reduce(this.mkMulAppWith(n.mul(this.getValue(t.getArg(a,0))),t.getArg(a,1)),1):i===0?e.length===2&&e[1]===a?void 0:this.mkMulAppWith(n,a):this.reduce(this.mkAddApp(t.mapArgs(a,e=>this.mkMulAppWith(n,e))),2);if(r>1||r===1&&!this.manager.isNumeral(e[0]))return this.reduce(this.mkMulAppWith(n,this.mkMulApp(e.filter(e=>!this.manager.isNumeral(e)))),2);if(!this.options.isSom||i===0){let t=e.filter(e=>!this.manager.isNumeral(e)),i=t.every((e,n)=>n===0||this.getOrdinal(e)>=this.getOrdinal(t[n-1]));if(i&&r===0)return;let a=i?t:this.sortMonomials(t,0);return this.mkMulAppWith(n,this.mkMulApp(a))}let o=e.map(e=>this.isAdd(e)?t.getArgs(e):[e]),s=o.map(()=>0),c=[],l=t.withTemporaries(()=>{for(;;){if(c.length>10*o.length)return!0;c.push(this.mkMulApp(o.map((e,t)=>e[s[t]])));let e=0;for(;e<o.length&&(s[e]++,!(s[e]<o[e].length));e++)s[e]=0;if(e===o.length)return!1}},()=>c)?void 0:this.reduce(this.mkAddApp(c),2);for(let e of c)t.decRef(e);return l}mkSub(e){if(e.length===1)return e[0];this.currSort=this.manager.sorts[e[0]];let t=this.mkNumeral(P.minusOne),n=[e[0]];for(let r of e.slice(1))this.isZero(r)||n.push(this.mkMulApp([t,r]));return this.reduce(this.mkAddApp(n),2)}mkUminus(e){return this.currSort=this.manager.sorts[e],this.manager.isNumeral(e)?this.mkNumeral(this.getValue(e).neg()):this.reduce(this.mkMulAppWith(P.minusOne,e),1)}cancelMonomials(e,t,n){let r=this.manager;this.currSort=r.sorts[e];let i=++this.stamp,a=P.zero,o=0;for(let t=0;t<this.getNumMonomials(e);t++){let n=this.getMonomial(e,t);if(r.isNumeral(n)){a=a.add(this.getValue(n)),o++;continue}let s=this.getPowerProduct(n);s>=this.visitedStamps.length&&this.growStamps(s),this.visitedStamps[s]=i}if(n&&o===0&&r.isNumeral(t))return;let s=!1;for(let e=0;e<this.getNumMonomials(t);e++){let n=this.getMonomial(t,e);if(r.isNumeral(n)){a=a.sub(this.getValue(n)),o++;continue}let c=this.getPowerProduct(n);c<this.visitedStamps.length&&this.visitedStamps[c]===i&&(this.multipleStamps[c]=i,s=!0)}if(!s&&o<=1&&(n?r.isNumeral(t):o===0||r.isNumeral(t)))return;let c=e=>e<this.multipleStamps.length&&this.multipleStamps[e]===i,l=/* @__PURE__ */ new Map;if(s){for(let t=0;t<this.getNumMonomials(e);t++){let n=this.getMonomial(e,t);if(r.isNumeral(n))continue;let i=this.getPowerProduct(n);c(i)&&l.set(i,(l.get(i)??P.zero).add(this.getCoefficient(n)))}for(let e=0;e<this.getNumMonomials(t);e++){let n=this.getMonomial(t,e);if(r.isNumeral(n))continue;let i=this.getPowerProduct(n);c(i)&&l.set(i,(l.get(i)??P.zero).sub(this.getCoefficient(n)))}}let u=[],d=++this.stamp;for(let t=0;t<this.getNumMonomials(e);t++){let n=this.getMonomial(e,t);if(r.isNumeral(n))continue;let i=this.getPowerProduct(n);if(!c(i))u.push(n);else if(this.visitedStamps[i]!==d){this.visitedStamps[i]=d;let e=l.get(i)??P.zero;e.isZero()||u.push(this.mkMulAppWith(e,i))}}let f=[];for(let e=0;e<this.getNumMonomials(t);e++){let i=this.getMonomial(t,e);if(r.isNumeral(i))continue;let a=this.getPowerProduct(i);if(!c(a)){if(!n)f.push(i);else{let e=this.getCoefficient(i);e.equals(P.minusOne)?u.push(a):e.isZero()||u.push(this.mkMulApp([this.mkNumeral(e.neg()),a]))}}}let p=n&&this.options.isSortSums?this.sortMonomials(u,0):u,m=n||f.length===0||u.length>0,h=m?a.neg():a,g=!m&&(p.length===0||!h.isZero()),_=m&&(f.length===0||!h.isZero());return g&&p.unshift(this.mkNumeral(h)),_&&f.unshift(this.mkNumeral(h)),{lhs:this.mkAddApp(p),rhs:this.mkAddApp(f)}}};const Dh={isSom:!0,isSortSums:!0,isArithIneqLhs:!0,isGcdRounding:!0},Oh={isSom:!1,isSortSums:!1,isArithIneqLhs:!1,isGcdRounding:!1},kh=(e,t)=>-Pm(-e,t),Ah=(e,t)=>{let n=Fm(e,t);return 2n*n>t?n-t:n},jh=e=>e===0?1:e===1?0:2;var Mh=class extends Eh{factors=[];mkLe(e,t){return this.mkLeGeEq(e,t,0)}mkGe(e,t){return this.mkLeGeEq(e,t,1)}mkLt(e,t){return this.reduce(this.manager.mkNot(this.mkAtom(t,e,0)),2)}mkGt(e,t){return this.reduce(this.manager.mkNot(this.mkAtom(e,t,0)),2)}mkEq(e,t){if(this.isArithTerm(e)||this.isArithTerm(t))return this.mkLeGeEq(e,t,2)}mkIdivApp(e,t){return this.manager.mkApp(19,[e,t],1)}mkModApp(e,t){return this.manager.mkApp(20,[e,t],1)}mkFlatMulApp(e){return e.length===1?e[0]:this.manager.mkApp(18,e,1)}mkIntIte(e,t,n){return this.manager.mkApp(4,[e,t,n],1)}getFlatMul(e){let t=[e];for(let e=0;e<t.length;e++)this.isMul(t[e])&&(this.manager.pushArgs(t[e],t),t[e]=t[t.length-1],t.pop(),e--);return t}removeFactor(e,t){let n=t.indexOf(e);t[n]=t[t.length-1],t.pop()}removeDivisor(e,t,n){let r=this.manager,i=this.getFlatMul(t),a=this.getFlatMul(n);this.removeFactor(e,i),this.removeFactor(e,a);let o=r.mkNumeral(0n),s=i.length===0?r.mkNumeral(1n):this.mkFlatMulApp(i),c=a.length===0?r.mkNumeral(1n):this.mkFlatMulApp(a);return this.mkIntIte(r.mkEq(o,e),this.mkIdivApp(o,o),this.mkIntIte(r.mkApp(12,[e,o],0),this.mkIdivApp(s,c),this.mkIdivApp(r.mkApp(17,[s],1),r.mkApp(17,[c],1))))}getDivides(e,t){let n=this.manager,r=this.getFlatMul(e),i=this.getFlatMul(t),a=1n,o=1n,s,c,l=new Set(r);for(let e of r){let t=n.getNumeral(e);t!==void 0&&(a=t,s=e)}for(let r of i){let i=n.getNumeral(r);if(l.has(r)&&i!==-1n)return this.removeDivisor(r,e,t);l.has(r)&&(a=-1n),i!==void 0&&(o=i,c=r)}let u=jm(a,o);if(u===1n)return;let d=(e,t,r)=>{let i=e.indexOf(t??-1);return i!==-1&&(e[i]=n.mkNumeral(r/u)),this.mkFlatMulApp(e)};return this.mkIdivApp(d(r,s,a),d(i,c,o))}mkIdiv(e,t){let n=this.manager;this.currSort=1;let r=n.getNumeral(e),i=n.getNumeral(t);if(r!==void 0&&i!==void 0&&i!==0n)return n.mkNumeral(Pm(r,i));if(i===1n)return e;if(i===-1n)return this.reduce(this.mkFlatMulApp([n.mkNumeral(-1n),e]),1);if(i===0n)return;let a=n.mkNumeral(0n);if(e===t)return this.reduce(this.mkIntIte(n.mkEq(e,a),this.mkIdivApp(a,a),n.mkNumeral(1n)),3);if(i!==void 0&&i>0n&&this.isAdd(e)){let r=!1,a=0n,o=n.mapArgs(e,e=>{let t=n.getNumeral(e);return t===void 0||t<=0n||Fm(t,i)===t?e:(r=!0,a+=Pm(t,i),n.mkNumeral(Fm(t,i)))});if(r)return this.reduce(this.mkAddApp([n.mkNumeral(a),this.mkIdivApp(n.mkApp(15,o,1),t)]),3)}let o=this.getDivides(e,t);if(o!==void 0)return this.reduce(this.mkIntIte(n.mkEq(a,t),this.mkIdivApp(e,a),o),1/0)}mkMod(e,t){let n=this.manager;this.currSort=1;let r=n.getNumeral(e),i=n.getNumeral(t);if(r!==void 0&&i!==void 0&&i!==0n)return n.mkNumeral(Fm(r,i));if(i===1n||i===-1n)return n.mkNumeral(0n);let a=n.mkNumeral(0n);if(e===t&&i===void 0)return this.mkIntIte(n.mkEq(t,a),this.mkModApp(a,a),a);if(n.getOp(e)===20&&n.getArg(e,1)===t){if(i!==void 0&&i!==0n)return e;if(i===void 0)return this.reduce(this.mkIntIte(n.mkEq(t,a),this.mkModApp(this.mkModApp(n.getArg(e,0),a),a),e),2)}if(i!==void 0&&i>0n&&(this.isAdd(e)||this.isMul(e))){let r=!1,a=n.mapArgs(e,e=>{let a=n.getNumeral(e);if(a!==void 0&&Fm(a,i)!==a)return r=!0,n.mkNumeral(Fm(a,i));if(n.getOp(e)===20&&n.getArg(e,1)===t)return r=!0,n.getArg(e,0);let o=this.isMul(e)&&n.getNumArgs(e)===2?n.getNumeral(n.getArg(e,0)):void 0;return o!==void 0&&Ah(o,i)!==o?(r=!0,n.mkApp(18,[n.mkNumeral(Ah(o,i)),n.getArg(e,1)],1)):e});if(r)return this.reduce(this.mkModApp(n.mkApp(n.decls[e],a,1),t),3)}if(i===void 0&&this.isAdd(e)){let r=[];for(let i=0;i<n.getNumArgs(e);i++){let a=n.getArg(e,i);a!==t&&!(this.isMul(a)&&n.getNumArgs(a)===2&&(n.isNumeral(n.getArg(a,0))&&n.getArg(a,1)===t||n.isNumeral(n.getArg(a,1))&&n.getArg(a,0)===t))&&r.push(a)}if(r.length<n.getNumArgs(e))return this.reduce(this.mkModApp(r.length===0?a:this.mkAddApp(r),t),3)}let o=this.isMul(e)&&n.getNumArgs(e)===2?n.getNumeral(n.getArg(e,0)):void 0;if(i!==void 0&&i>0n&&o!==void 0&&o>0n&&i%o===0n)return this.reduce(n.mkApp(18,[n.mkNumeral(o),this.mkModApp(n.getArg(e,1),n.mkNumeral(i/o))],1),1);if(this.isMul(t)&&n.getNumArgs(t)===2&&n.getNumeral(n.getArg(t,0))===-1n)return this.reduce(this.mkModApp(e,n.getArg(t,1)),1);if(n.getOp(t)===4)return this.reduce(this.mkIntIte(n.getArg(t,0),this.mkModApp(e,n.getArg(t,1)),this.mkModApp(e,n.getArg(t,2))),3)}mkAbs(e){let t=this.manager,n=t.sorts[e];return this.reduce(t.mkApp(4,[this.mkAtom(e,t.mkNumeralOfSort(P.zero,n),1),e,t.mkApp(17,[e],n)],n),2)}mkDiv(e,t){let n=this.manager;if(this.currSort=n.sorts[e],!n.isNumeral(t)||this.getValue(t).isZero())return;let r=this.getValue(t);return n.isNumeral(e)?n.mkRealNumeral(this.getValue(e).div(r)):this.reduce(n.mkApp(18,[n.mkRealNumeral(P.one.div(r)),e],2),1)}mkToInt(e){let t=this.manager;if(t.isInt(e))return e;if(t.isNumeral(e))return t.mkNumeral(this.getValue(e).floor().num);let n=t.getOp(e);if(n===24&&t.isInt(t.getArg(e,0)))return t.getArg(e,0);if(n!==15&&n!==18)return;let r=[],i=[];for(let n=0;n<t.getNumArgs(e);n++){let a=t.getArg(e,n);t.isNumeral(a)&&this.getValue(a).isInt()?r.push(t.mkNumeral(this.getValue(a).num)):t.getOp(a)===24?r.push(t.getArg(a,0)):i.push(a)}let a=(e,r)=>e.length===1?e[0]:t.mkApp(n,e,r);if(i.length===0)return this.reduce(a(r,1),1);if(r.length===0||n!==15)return;let o=a(r,1),s=a(i,2);return this.reduce(t.mkApp(15,[o,t.mkApp(25,[s],1)],1),3)}mkToReal(e){let t=this.manager;if(t.isNumeral(e))return t.mkRealNumeral(this.getValue(e));if(t.isReal(e))return e;let n=t.getOp(e);if(n===15||n===18)return this.reduce(t.mkApp(n,t.mapArgs(e,e=>t.mkApp(24,[e],2)),2),2)}mkIsInt(e){let t=this.manager;if(t.isNumeral(e))return this.getValue(e).isInt()?t.trueExpr:t.falseExpr;let n=[e],r=/* @__PURE__ */ new Set,i=!0;for(;i;){let e=n.pop();if(e===void 0)break;if(r.has(e))continue;r.add(e);let a=t.getOp(e);a!==24&&(t.isNumeral(e)?i=this.getValue(e).isInt():a===18||a===15||a===16||a===17?t.pushArgs(e,n):i=!1)}return i?t.trueExpr:this.reduce(t.mkEq(t.mkApp(24,[t.mkApp(25,[e],1)],2),e),3)}mkAtom(e,t,n){let r=this.manager;return n===2?r.mkEq(e,t):r.mkApp(n===0?11:12,[e,t],0)}flattenMul(e,t){if(this.isMul(e))for(let n=0;n<this.manager.getNumArgs(e);n++)this.flattenMul(this.manager.getArg(e,n),t);else t.push(e)}isNonNegative(e){if(!this.isMul(e))return!1;let t=this.factors;N(t,0),this.flattenMul(e,t);let n=!1,r=0;for(let e of t)this.manager.isNumeral(e)?this.getValue(e).isNegative()&&(n=!n):t[r++]=e;if(n)return!1;let i=0,a=-1,o=-1;for(let e=0;e<r;e++){let n=t[e];if(t.indexOf(n)<e)continue;let s=0;for(let i=e;i<r;i++)t[i]===n&&s++;if(s%2!=0){if(i++,i===1)a=n;else if(i===2)o=n;else return!1}}return i===0?!0:i!==2||!this.manager.isInt(e)?!1:this.isSuccessor(a,o)||this.isSuccessor(o,a)}isSuccessor(e,t){if(!this.isAdd(t))return!1;let n=P.zero,r=0;for(let i=0;i<this.manager.getNumArgs(t);i++){let a=this.manager.getArg(t,i);if(this.manager.isNumeral(a))n=n.add(this.getValue(a));else if(a===e)r++;else return!1}return r===1&&(n.equals(P.one)||n.equals(P.minusOne))}negateMonomial(e){let t=this.manager;if(this.manager.isNumeral(e))return this.mkNumeral(this.getValue(e).neg());if(this.isMul(e)){let n=t.getArg(e,0);if(!this.manager.isNumeral(n))return this.mkMulApp([this.mkNumeral(P.minusOne),e]);let r=this.getValue(n),i=r.equals(P.minusOne)?[]:[this.mkNumeral(r.neg())];for(let n=1;n<t.getNumArgs(e);n++)i.push(t.getArg(e,n));return i.length===1?i[0]:t.mkApp(18,i,this.currSort)}return t.mkApp(18,[this.mkNumeral(P.minusOne),e],this.currSort)}getNegatedPolynomial(e){let t=this.manager,n=e=>this.isMul(e)&&this.manager.isNumeral(t.getArg(e,0))&&this.getValue(t.getArg(e,0)).isNegative();if(n(e))return this.negateMonomial(e);if(this.isAdd(e)&&n(t.getArg(e,0)))return t.mkApp(15,t.mapArgs(e,e=>this.negateMonomial(e)),this.currSort)}getSeparated(e,t,n){let r=this.manager;if(n===2||!this.manager.isNumeral(t))return;let i=this.getValue(t);if(n===1&&i.isZero()&&this.isMul(e)&&this.isNonNegative(e))return r.trueExpr;let a=P.zero,o=!0,s;for(let t=0;t<this.getNumMonomials(e);t++){let i=this.getMonomial(e,t);if(this.manager.isNumeral(i))a=a.add(this.getValue(i));else if(n===0&&this.isNonNegative(i))continue;else if(n===1){let e=r.withTemporaries(()=>this.getNegatedPolynomial(i),e=>e===void 0?[]:[e]);e!==void 0&&(s!==void 0&&r.decRef(s),s=e),e!==void 0&&this.isNonNegative(e)||(o=!1)}else o=!1}let c=o?this.mkSeparated(e,n,a,i):void 0;return s!==void 0&&r.decRef(s),c}mkSeparated(e,t,n,r){let i=this.manager,a=n.compare(r);if(t===0&&a<0||t===1&&a>0)return;if(t===0&&a>0||t===1&&a<0)return i.falseExpr;let o=this.mkNumeral(P.zero);if(n.isZero()&&this.isMul(e)){let t=[];return this.flattenMul(e,t),this.reduce(i.mkOr(t.filter(e=>!this.manager.isNumeral(e)).map(e=>i.mkEq(e,o))),2)}if(!this.isAdd(e))return;let s=[];for(let n=0;n<i.getNumArgs(e);n++){let r=i.getArg(e,n);i.isNumeral(r)||s.push(this.mkAtom(r,o,t))}return this.reduce(i.mkAnd(s),2)}getBound(e,t,n){let r=this.manager;if(!this.isAdd(e)&&r.getOp(e)!==20&&this.manager.isNumeral(t)){let i=this.getPowerProduct(e),a=this.getCoefficient(e),o=a.isNegative(),s=a.abs(),c=o?jh(n):n;if(a.isZero()||!o&&s.equals(P.one))return;let l=this.getValue(t),u=(o?l.neg():l).div(s);return!r.isInt(e)||u.isInt()?this.mkAtom(i,r.mkNumeralOfSort(u,r.sorts[e]),c):c===2?r.falseExpr:this.mkAtom(i,r.mkNumeral(c===0?u.floor().num:u.ceil().num),c)}let i=r.getOp(t)===20,a=i?t:e,o=i?e:t,s=i?jh(n):n;if(r.getNumeral(o)===void 0||r.getOp(a)!==20)return;let c=r.getArg(a,1);if(!this.manager.isNumeral(c)||this.manager.getNumeralValue(c)===0n)return;let l=this.manager.getNumeralValue(o),u=this.manager.getNumeralValue(c),d=u<0n?-u:u;if(l<0n)return s===1?r.trueExpr:r.falseExpr;if(l===0n&&s===1)return r.trueExpr;if(l>0n&&l>=d)return s===0?r.trueExpr:r.falseExpr;if(l+1n===d&&s===0)return r.trueExpr}dividePolynomial(e,t,n){let r=this.manager,i=[],a=e=>{r.incRef(e),i.push(e)},o=r.withoutTemporaries(()=>{for(let i=0;i<this.getNumMonomials(e);i++){let o=this.getMonomial(e,i);if(r.isNumeral(o)){let e=r.getNumeralValue(o),i=e%t===0n;if(!i&&n===`none`)return;let s=i||n===`floor`?Pm(e,t):kh(e,t);s!==0n&&a(r.mkNumeral(s));continue}let s=this.getCoefficient(o).num/t,c=this.getPowerProduct(o);s===1n?a(c):s!==0n&&a(r.mkApp(18,[r.mkNumeral(s),c],1))}return this.mkAddApp(i)});o!==void 0&&r.incRef(o);for(let e of i)r.decRef(e);return o}getCoeffsGcd(e,t){for(let n=0;n<this.getNumMonomials(e);n++){let r=this.getMonomial(e,n);if(this.manager.isNumeral(r))this.manager.getNumeralValue(r)!==0n&&t.numConsts++;else if(t.gcd=t.isFirst?this.getCoefficient(r).num:jm(this.getCoefficient(r).num,t.gcd),t.isFirst=!1,t.gcd===1n)return}}isHolding(e,t,n){let r=e.compare(t);return n===0?r<=0:n===1?r>=0:r===0}mkLeGeEq(e,t,n){let r=this.manager,i=[],a=this.mkLeGeEqCore(e,t,n,i);for(let e=i.length-1;e>=0;e--)r.decRef(i[e]);return a}mkLeGeEqCore(e,t,n,r){let i=this.manager;this.currSort=i.sorts[e];let a=(e,t)=>{i.incRef(t),e<r.length&&i.decRef(r[e]),r[e]=t},o=i.withTemporaries(()=>this.cancelMonomials(e,t,this.options.isArithIneqLhs),e=>e===void 0?[]:[e.lhs,e.rhs]);o!==void 0&&r.push(o.lhs,o.rhs);let s=o!==void 0,c=o===void 0?e:o.lhs,l=o===void 0?t:o.rhs;if(this.manager.isNumeral(c)&&this.manager.isNumeral(l))return this.isHolding(this.getValue(c),this.getValue(l),n)?i.trueExpr:i.falseExpr;let u=this.getSeparated(c,l,n);if(u!==void 0)return u;let d=this.getBound(c,l,n)??this.getBound(l,c,jh(n));if(d!==void 0)return d;if(i.isInt(c)&&this.options.isGcdRounding){let e={gcd:0n,isFirst:!0,numConsts:0};this.getCoeffsGcd(c,e),(e.isFirst||e.gcd!==1n)&&e.numConsts<=1&&this.getCoeffsGcd(l,e);let t=e.gcd<0n?-e.gcd:e.gcd;if(!e.isFirst&&t!==1n&&e.numConsts<=1){let e=this.dividePolynomial(c,t,n===0?`ceil`:n===1?`floor`:`none`);if(e===void 0)return i.falseExpr;a(0,e),i.decRef(e);let r=this.dividePolynomial(l,t,n===0?`floor`:n===1?`ceil`:`none`);if(r===void 0)return i.falseExpr;a(1,r),i.decRef(r),c=e,l=r,s=!0}}if(i.getOp(c)===4&&this.manager.isNumeral(l)){let e=i.getArg(c,0),t=this.getValue(l),r=e=>this.isHolding(e,t,n),a=e=>n===2?this.mkArithEq(e,l):this.mkAtom(e,l,n);if(this.manager.isNumeral(i.getArg(c,1))){let t=i.mkNot(e);return this.reduce(r(this.getValue(i.getArg(c,1)))?i.mkOr([e,this.mkAtom(i.getArg(c,2),l,n)]):i.mkAnd([t,a(i.getArg(c,2))]),2)}if(this.manager.isNumeral(i.getArg(c,2))){let t=i.mkNot(e);return this.reduce(r(this.getValue(i.getArg(c,2)))?i.mkOr([t,this.mkAtom(i.getArg(c,1),l,n)]):i.mkAnd([e,a(i.getArg(c,1))]),2)}}let f=i.getOp(l)===25&&i.isNumeral(c),p=i.getOp(f?l:c)===25?i.getArg(f?l:c,0):void 0,m=f?c:l;if(p!==void 0&&i.isNumeral(m)){let e=f?jh(n):n,t=this.getValue(m),r=()=>i.mkApp(12,[p,i.mkRealNumeral(t)],0),a=()=>i.mkApp(13,[p,i.mkRealNumeral(t.add(P.one))],0);if(e===0)return this.reduce(a(),1);if(e===1)return this.reduce(r(),1);let o=r();return this.reduce(i.mkAnd([a(),o]),3)}let h=this.options.isArithIneqLhs&&this.manager.isNumeral(l)?this.getNegatedPolynomial(c):void 0;if(h!==void 0){a(0,h);let e=this.mkNumeral(this.getValue(l).neg());return a(1,e),this.mkAtom(h,e,jh(n))}if(!(s&&c===e&&l===t))return s?this.mkAtom(c,l,n):this.factorLeGeEq(c,l,n)}factorLeGeEq(e,t,n){if(!this.isZero(t))return;let r=this.findNlFactor(e);if(r===void 0)return;let i=this.manager,a=this.removeNlFactor(r,e),o=i.mkNumeralOfSort(P.zero,i.sorts[e]),s=this.mkArithEq(r,o),c=this.mkArithEq(a,o),l=i.mkOr([s,c]);if(n===2)return this.reduce(l,3);let u=i.mkApp(12,[r,o],0),d=i.mkApp(12,[a,o],0),f=i.mkEq(u,d);return this.reduce(i.mkOr([n===1?f:i.mkNot(f),l]),3)}mkArithEq(e,t){let n=this.manager,r=n.isNumeral(e)||!n.isNumeral(t)&&n.ids[e]>n.ids[t],i=r?t:e,a=r?e:t;return i===a?n.trueExpr:n.isNumeral(i)&&n.isNumeral(a)?n.falseExpr:n.mkEq(i,a)}findNlFactor(e){let t=[e];for(let n=0;n<t.length;n++){let r=t[n];if(this.isAdd(r)){this.manager.pushArgs(r,t);continue}if(!this.isMul(r))continue;let i=[];if(this.getNlMuls(r,i),!(i.length<=1))return i.find(t=>this.isAddFactor(t,e))}}getNlMuls(e,t){if(this.isMul(e))for(let n=0;n<this.manager.getNumArgs(e);n++)this.getNlMuls(this.manager.getArg(e,n),t);else this.manager.isNumeral(e)||t.push(e)}isMulFactor(e,t){return this.isMul(t)?this.manager.someArg(t,t=>this.isMulFactor(e,t)):e===t}isAddFactor(e,t){return this.isAdd(t)?this.manager.everyArg(t,t=>this.isAddFactor(e,t)):this.isMulFactor(e,t)}removeNlFactor(e,t){let n=this.manager,r=n.sorts[t];if(this.isMul(t)){let i=[t];for(let t=0;t<i.length;t++){let r=i[t];if(this.isMul(r))n.pushArgs(r,i),i[t]=i[i.length-1],i.pop(),t--;else if(r===e){i[t]=i[i.length-1],i.pop();break}}return i.length===0?n.mkNumeralOfSort(P.one,r):i.length===1?i[0]:n.mkApp(18,i,r)}if(this.isAdd(t)){let i=[t];for(let t=0;t<i.length;t++){let r=i[t];this.isAdd(r)?(n.pushArgs(r,i),i[t]=i[i.length-1],i.pop(),t--):i[t]=this.removeNlFactor(e,r)}return i.length===1?i[0]:n.mkApp(15,i,r)}return n.mkNumeralOfSort(P.one,r)}};const Nh=(e,t)=>e===t?0:e<t?-1:1,Ph=(e,t)=>e instanceof P&&t instanceof P?e.compare(t):typeof e==`number`&&typeof t==`number`?Nh(e,t):0,Fh=(e,t)=>e===t?0:typeof e==`number`?typeof t==`number`?Nh(e,t):-1:typeof t==`number`?1:e<t?-1:1,Ih=(e,t)=>{let n=e.funcDecls[e.decls[t]],r=e.sorts[t];if(n.family===2)return{name:n.name,parameters:[],domain:n.domain,range:r};if(n.op===10){let n=r===1;return{name:n?`Int`:`Real`,parameters:[3,e.getRationalValue(t),0,+!!n],domain:[],range:r}}if(n.family===3)return{name:n.name,parameters:[0,e.values[t]],domain:[],range:r};let i=e.getBuiltinSignature(n.op,e.getArgs(t));return{name:i.name,parameters:[],domain:i.domain,range:r}},Lh=(e,t,n)=>t===n?0:Fh(e.sortNames[t],e.sortNames[n]),Rh=(e,t,n)=>{let r=e.funcDecls[e.decls[t]];if(r.family===2)return!0;if(r.op===10||r.op===22||r.family===3)return!1;let i=+(r.op===4);return e.sorts[t]===e.sorts[n]&&e.sorts[e.getArg(t,i)]===e.sorts[e.getArg(n,i)]},zh=(e,t,n)=>{if(e.decls[t]===e.decls[n]&&Rh(e,t,n))return 0;let r=Ih(e,t),i=Ih(e,n),a=Fh(r.name,i.name);if(a!==0)return a;let o=Nh(r.domain.length,i.domain.length);if(o!==0)return o;let s=Nh(r.parameters.length,i.parameters.length);if(s!==0)return s;for(let e=0;e<r.parameters.length;e++){let t=Ph(r.parameters[e],i.parameters[e]);if(t!==0)return t}for(let t=0;t<r.domain.length;t++){let n=Lh(e,r.domain[t],i.domain[t]);if(n!==0)return n}return Lh(e,r.range,i.range)},Bh=(e,t,n)=>{if(t===n)return 0;let r=Nh(e.kinds[t],e.kinds[n]);if(r!==0)return r;if(e.kinds[t]===1){let r=Nh(e.values[t],e.values[n]);return r===0?Lh(e,e.sorts[t],e.sorts[n]):r}if(e.kinds[t]===2){let r=e.getQuantifier(t),i=e.getQuantifier(n),a=Nh(+!r.isForall,+!i.isForall)||Nh(r.sorts.length,i.sorts.length)||Nh(r.patterns.length,i.patterns.length)||Nh(r.weight,i.weight);if(a!==0)return a;for(let t=0;t<r.sorts.length;t++){let n=Fh(r.names[t],i.names[t])||Lh(e,r.sorts[t],i.sorts[t]);if(n!==0)return n}for(let t=0;t<r.patterns.length;t++){let n=Bh(e,r.patterns[t],i.patterns[t]);if(n!==0)return n}return Bh(e,r.body,i.body)}if(e.kinds[t]!==0)return 0;let i=Nh(e.getNumArgs(t),e.getNumArgs(n))||Nh(e.depths[t],e.depths[n])||zh(e,t,n);if(i!==0)return i;for(let r=0;r<e.getNumArgs(t);r++){let i=Bh(e,e.getArg(t,r),e.getArg(n,r));if(i!==0)return i}return 0},Vh=(e,t,n)=>Bh(e,t,n)<0,Hh=(e,t,n,r)=>{let i=t=>e.kinds[t]===1&&e.values[t]<n,a=t=>e.isNot(t)&&i(e.getArg(t,0)),o=(t,n)=>{let r=!i(e.getArg(t,0)),a=r?e.getArg(t,1):e.getArg(t,0),o=r?e.getArg(t,0):e.getArg(t,1);if(i(a))return{index:e.values[a],definition:n?e.mkNot(o):o}};if(r){if(e.isNot(t)&&e.getOp(e.getArg(t,0))===2)return o(e.getArg(t,0),!1);if(e.getOp(t)===2&&e.sorts[e.getArg(t,0)]===0){let n=o(t,!0);if(n!==void 0)return n;let r=!a(e.getArg(t,0)),i=r?e.getArg(t,1):e.getArg(t,0),s=r?e.getArg(t,0):e.getArg(t,1);return a(i)?{index:e.values[e.getArg(i,0)],definition:s}:void 0}return i(t)?{index:e.values[t],definition:e.falseExpr}:a(t)?{index:e.values[e.getArg(t,0)],definition:e.trueExpr}:void 0}if(e.getOp(t)===2)return o(t,!1);if(i(t))return{index:e.values[t],definition:e.trueExpr};if(a(t))return{index:e.values[e.getArg(t,0)],definition:e.falseExpr}},Uh=(e,t,n)=>fh(e,n,t+1)[t],Wh=(e,t)=>{for(let n=0;n<t.length;n++){let r=t[n];r!==void 0&&(e.hasQuantifierFlags[r]||Uh(e,n,r))&&(t[n]=void 0)}let n=[],r=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new Set,a=o=>{if(!i.has(o)){if(e.kinds[o]===1){let s=e.values[o],c=s<t.length?t[s]:void 0;c!==void 0&&r.has(o)?(r.delete(o),t[s]=void 0):c!==void 0&&(r.add(o),a(c),t[s]!==void 0&&(r.delete(o),n.push(s))),i.add(o)}else{for(let t=0;t<e.getNumArgs(o);t++){let n=e.getArg(o,t);a(n)}i.add(o)}}};return t.forEach((t,n)=>{t!==void 0&&a(e.mkVar(n,e.sorts[t]))}),n};var Gh=class{manager;subst;map;substMap;newArgs;constructor(e){this.manager=e,this.subst=new lh(e,!0),this.map=new F(e),this.substMap=new F(e),this.newArgs=new F(e)}apply(e){let t=this.manager,n=e;for(let e=this.reduce(n);e!==n;e=this.reduce(n))if(n=e,t.kinds[n]!==2)return n;return n===e?e:mh(t,n)}release(){this.newArgs.reset(),this.substMap.reset(),this.map.reset(),this.subst.release()}reduce(e){let t=this.manager,n=t.getQuantifier(e),r=n.sorts.length,i=Hh(t,n.body,r,n.isForall);if(i!==void 0&&!t.hasQuantifierFlags[i.definition]&&!Uh(t,i.index,i.definition))return n.isForall?t.falseExpr:t.trueExpr;let a=new F(t);t.withoutTemporaries(()=>{a.push(n.body),n.isForall?Xm(t,a):Ym(t,a)});let o=this.reduceLiterals(e,a.items);return a.reset(),o}reduceLiterals(e,t){let n=this.manager,r=n.getQuantifier(e),i=r.sorts.length,a=this.map;a.reset();let o=t.map(e=>{let t=Hh(n,e,i,r.isForall);return t===void 0||(a.items[t.index]??-1)!==-1?-1:(a.size<=t.index&&a.resize(t.index+1),a.set(t.index,t.definition),t.index)});if(o.every(e=>e===-1))return e;let s=a.items.map(e=>e===-1?void 0:e),c=Wh(n,s);if(s.forEach((e,t)=>{e===void 0&&a.items[t]!==-1&&a.set(t,-1)}),c.length===0)return e;let l=a.size,u=this.substMap;u.reset(),u.resize(l);for(let e of c)u.setOwned(l-e-1,this.subst.apply(a.items[e],u.items));this.newArgs.reset(),t.forEach((e,t)=>{let n=o[t];(n===-1||a.items[n]===-1)&&this.newArgs.push(e)});let d=this.newArgs.items,f=r.isForall?n.falseExpr:n.trueExpr,p=n.withoutTemporaries(()=>d.length===0?f:d.length===1?d[0]:r.isForall?n.mkOr(d):n.mkAnd(d));n.incRef(p);let m=this.subst.apply(p,u.items),h=r.patterns.map(e=>this.subst.apply(e,u.items)),g=n.mkQuantifier({...r,body:m,patterns:h});for(let e of h)n.releaseLater(e);return n.releaseLater(m),n.decRef(p),g}};const Kh=(e,t)=>{if(e.length>16)e.sort((e,n)=>t(e)-t(n));else for(let n=1;n<e.length;n++){let r=e[n],i=t(r),a=n;for(;a>0&&t(e[a-1])>i;a--)e[a]=e[a-1];e[a]=r}},qh=e=>{if(e.length>16)e.sort((e,t)=>e-t);else for(let t=1;t<e.length;t++){let n=e[t],r=t;for(;r>0&&e[r-1]>n;r--)e[r]=e[r-1];e[r]=n}},Jh={isEliminatingAnd:!1,arith:Dh,isRewritingPatterns:!0},Yh={isEliminatingAnd:!1,arith:Oh,isRewritingPatterns:!1};var Xh=class e extends oh{options;isNestedDer;arith;substitution=/* @__PURE__ */ new Map;unusedVarsEliminator;der;releaseResult=()=>this.setLastResult(-1);constructor(e,t,n=!1){super(e),this.options=t,this.isNestedDer=n,this.arith=new Mh(e,t.arith),this.unusedVarsEliminator=new ph(e),this.der=new Gh(e)}release(){this.unusedVarsEliminator.release(),this.der.release(),super.release()}reduceTo(e,t){let n=this.manager,r=[],i=[],a=(e,t)=>{t===0||n.kinds[e]!==0||n.getNumArgs(e)===0?i.push(e):r.push({expr:e,depth:t-1,childIndex:0,spos:i.length})};for(a(e,t);r.length>0;){let e=r[r.length-1];if(e.childIndex<n.getNumArgs(e.expr)){a(n.getArg(e.expr,e.childIndex++),e.depth);continue}r.pop();let t=n.decls[e.expr],o=i.splice(e.spos),s=this.reduceAppTop(t,o,n.sorts[e.expr]);s===-1?i.push(n.mkApp(t,o,n.sorts[e.expr])):typeof s==`number`?i.push(s):a(s.expr,$m(s))}return i[0]}setEliminatingAnd(e){this.options={...this.options,isEliminatingAnd:e}}setSubstitution(e){this.substitution=e,this.reset()}getSubst(e){return this.substitution.size===0?void 0:this.substitution.get(e)}isFlatAssoc(e){let t=this.manager.funcDecls[e].op;return t===5||t===6||t===15}isRewritingPatterns(){return this.options.isRewritingPatterns}reduceApp(e,t,n){let r=this.manager;if(r.funcDecls[e].op===30&&(t.length!==2||this.options.isPullingCheapIte!==!0))return-1;let i=r.beginTemporaries(),a=this.reduceAppTop(e,t,n);return a!==-1&&r.incRef(typeof a==`number`?a:a.expr),r.endTemporaries(i),a}reduceQuantifier(e,t,n){return this.manager.withTemporaries(()=>this.reduceQuantifierCore(e,t,n))}reduceQuantifierCore(t,n,r){let i=this.manager,a=i.getQuantifier(t),o=i.isNot(n),s=o?i.getArg(n,0):n;if(i.getOp(s)===(a.isForall===o?6:5)&&i.someArg(s,e=>{let t=i.isNot(e)?i.getArg(e,0):e;return i.kinds[t]===1&&i.values[t]<a.sorts.length}))return a.isForall?i.falseExpr:i.trueExpr;let c=i.kinds[n]===2?i.getQuantifier(n):void 0,l=r.filter((e,t)=>r.indexOf(e)===t),u=c!==void 0&&c.isForall===a.isForall&&a.patterns.length===0&&c.patterns.length===0?i.mkQuantifier({...a,sorts:[...a.sorts,...c.sorts],names:[...a.names,...c.names],body:c.body,patterns:[],weight:Math.min(a.weight,c.weight)}):i.mkQuantifier({...a,body:n,patterns:this.substitutePatterns(l)}),d=this.unusedVarsEliminator.apply(u);if(i.releaseLater(d),i.kinds[d]!==2||i.getQuantifier(d).patterns.length>0)return d;let f=this.der.apply(d);if(f===d||this.isNestedDer)return f;let p=new e(i,this.options,!0),m=p.rewrite(f);return p.release(),i.releaseLater(m),m}substitutePatterns(e){let t=this.manager;if(this.substitution.size===0)return e;let n=/* @__PURE__ */ new Map,r=e=>{let i=this.substitution.get(e);if(i!==void 0)return i;if(t.kinds[e]!==0||t.getNumArgs(e)===0)return e;let a=n.get(e);if(a!==void 0)return a;let o=t.mkApp(t.decls[e],t.mapArgs(e,r),t.sorts[e]);return n.set(e,o),o};return e.map(e=>t.mkPattern(t.mapArgs(e,r)))}mkApp(e,t,n){let r=this.reduceAppTop(e,t,n);return r===-1?this.manager.mkApp(e,t,n):typeof r==`number`?r:r.expr}mkAppCore(e,t,n){let r=this.reduceAppTop(e,t,n);return r===-1?this.manager.mkApp(e,t,n):typeof r==`number`?r:this.reduceTo(r.expr,$m(r))}reduceAppTop(e,t,n){let r=this.manager,i=this.reduceAppCore(e,t);return typeof i!=`number`||this.options.isPullingCheapIte!==!0?i:i===-1?(t.length===2?this.pullIte(e,t[0],t[1],n):void 0)??-1:r.kinds[i]===0&&r.getNumArgs(i)===2?this.pullIte(r.decls[i],r.getArg(i,0),r.getArg(i,1),r.sorts[i])??i:i}pullIte(e,t,n,r){let i=this.manager;if(r===0&&i.sorts[t]!==0){if(this.isIte(t)){if(i.isUniqueValue(n)&&i.getRefCount(t)===1)return this.pullIteCore(e,t,n,r,!1);if(this.isIte(n)&&i.getArg(t,0)===i.getArg(n,0)){let a=[1,2].map(a=>i.mkApp(e,[i.getArg(t,a),i.getArg(n,a)],r));return{expr:i.mkApp(4,[i.getArg(t,0),...a],0),depth:2}}}if(this.isIte(n)&&i.isUniqueValue(t)&&i.getRefCount(n)===1)return this.pullIteCore(e,n,t,r,!0)}let a=i.funcDecls[e].family;if(a===0||a===1){if(i.isUniqueValue(t)&&this.isIteValueTree(n))return this.pullIteCore(e,n,t,r,!0);if(i.isUniqueValue(n)&&this.isIteValueTree(t))return this.pullIteCore(e,t,n,r,!1)}}pullIteCore(e,t,n,r,i){let a=this.manager,o=[a.getArg(t,1),a.getArg(t,2)].map(t=>a.funcDecls[e].op===2?t===n?a.trueExpr:this.areDistinct(t,n)?a.falseExpr:a.mkEq(t,n):a.mkApp(e,i?[n,t]:[t,n],r));return{expr:a.mkApp(4,[a.getArg(t,0),...o],r),depth:2}}isIteValueTree(e){let t=this.manager;if(!this.isIte(e)||t.getRefCount(e)!==1)return!1;let n=[e];for(let e=n.pop();e!==void 0;e=n.pop())for(let r of[t.getArg(e,1),t.getArg(e,2)])if(this.isIte(r)&&t.getRefCount(r)===1)n.push(r);else if(!t.isUniqueValue(r))return!1;return!0}reduceAppCore(e,t){let n=this.manager;switch(n.funcDecls[e].op){case 5:return this.mkAndCore(t);case 6:return this.mkOr(t);case 8:return this.mkNot(t[0]);case 9:return this.mkOr([this.mkNot(t[0]),t[1]]);case 7:return this.mkEq(this.mkNot(t[0]),t[1]);case 2:return(Um(n.sorts[t[0]])?this.arith.mkEq(t[0],t[1]):void 0)??this.mkEqCore(t[0],t[1])??-1;case 3:return this.mkDistinct(t);case 4:return this.mkIte(t[0],t[1],t[2]);case 11:return this.arith.mkLe(t[0],t[1])??-1;case 12:return this.arith.mkGe(t[0],t[1])??-1;case 13:return this.arith.mkLt(t[0],t[1]);case 14:return this.arith.mkGt(t[0],t[1]);case 15:return this.arith.mkAdd(t)??-1;case 16:return this.arith.mkSub(t);case 17:return this.arith.mkUminus(t[0]);case 18:return this.arith.mkMul(t)??-1;case 19:return this.arith.mkIdiv(t[0],t[1])??-1;case 20:return this.arith.mkMod(t[0],t[1])??-1;case 21:return this.arith.mkAbs(t[0]);case 23:return this.arith.mkDiv(t[0],t[1])??-1;case 24:return this.arith.mkToReal(t[0])??-1;case 25:return this.arith.mkToInt(t[0])??-1;case 26:return this.arith.mkIsInt(t[0]);default:return-1}}mkNot(e){let t=this.manager;return t.isNot(e)?t.getArg(e,0):t.getOp(e)===2&&t.sorts[t.getArg(e,0)]===0?this.mkEq(this.mkNot(t.getArg(e,0)),t.getArg(e,1)):t.mkNot(e)}mkOr(e){let t=this.manager,n=e.some(e=>t.getOp(e)===6),r=n?this.flattenArgs(e,6):e,i=t.flatLiterals;i.clear();for(let e of r)if(t.isTrue(e)||!t.isFalse(e)&&i.add(e))return t.trueExpr;let a=i.list,o=a.some((e,n)=>n>0&&Vh(t,e,a[n-1]));return(n||a.length!==r.length||o)&&Kh(a,e=>t.ids[e]),t.mkOr(a)}mkAndCore(e){let t=this.manager;return this.options.isEliminatingAnd?this.mkAndAsOr(e):e.some(e=>t.getOp(e)===5)?{expr:this.mkNflatAnd(this.flattenArgs(e,5)),depth:1}:this.mkNflatAnd(e)}flattenArgs(e,t){let n=this.manager,r=[];for(let i of e)n.getOp(i)===t?n.pushArgs(i,r):r.push(i);return r}mkAnd(e){let t=this.mkAndCore(e);return typeof t==`number`?t:t.expr}mkNflatAnd(e){let t=this.manager,n=t.flatLiterals;n.clear();for(let r of e)if(!t.isTrue(r)&&(t.isFalse(r)||n.add(r)))return t.falseExpr;let r=n.list;return r.length===0?t.trueExpr:r.length===1?r[0]:t.mkAnd(r)}mkAndAsOr(e){let t=this.manager,n=e.map(e=>t.withTemporaries(()=>this.mkNot(e))),r=t.withTemporaries(()=>this.mkNot(this.mkOr(n)));for(let e of n)t.decRef(e);return t.releaseLater(r),r}tryIteEq(e,t){let n=this.manager;if(this.isIte(e)){if(n.getArg(e,1)===t&&this.areDistinct(n.getArg(e,2),t))return{expr:n.getArg(e,0),depth:1};if(n.getArg(e,2)===t&&this.areDistinct(n.getArg(e,1),t))return{expr:n.mkNot(n.getArg(e,0)),depth:1}}}isIte(e){return this.manager.getOp(e)===4}areDistinct(e,t){let n=this.manager;return e!==t&&n.isUniqueValue(e)&&n.isUniqueValue(t)}mkIteValueEq(e,t){let n=this.manager;if(this.isIte(e)&&n.isUniqueValue(t))return this.tryIteValue(e,t);if(this.isIte(t)&&n.isUniqueValue(e))return this.tryIteValue(t,e);if(!this.isIte(e)||!this.isIte(t)||![n.getArg(e,1),n.getArg(e,2),n.getArg(t,1),n.getArg(t,2)].every(e=>n.isUniqueValue(e)))return;let r=e=>n.mkApp(6,e,0),i=[r([n.getArg(e,0),n.getArg(t,0),n.mkEq(n.getArg(e,2),n.getArg(t,2))])],a=n.mkNot(n.getArg(e,0)),o=n.mkNot(n.getArg(t,0));return i.push(r([a,o,n.mkEq(n.getArg(e,1),n.getArg(t,1))]),r([a,n.getArg(t,0),n.mkEq(n.getArg(e,1),n.getArg(t,2))]),r([n.getArg(e,0),o,n.mkEq(n.getArg(e,2),n.getArg(t,1))])),{expr:n.mkApp(5,i,0),depth:1/0}}tryIteValue(e,t){let n=this.manager,r=n.getArg(e,0),i=n.getArg(e,1),a=n.getArg(e,2),o=e=>(this.releaseResult(),e),s=e=>o(n.depths[e]<500?this.mkEq(e,t):n.mkEq(e,t)),c=e=>e===t?n.trueExpr:this.areDistinct(e,t)?n.falseExpr:n.mkEq(e,t),l=(e,t)=>n.mkApp(5,[e,t],0),u=(e,t)=>n.mkApp(6,[e,t],0);if(this.areDistinct(t,a))return{expr:l(s(i),r),depth:2};if(this.areDistinct(t,i))return{expr:l(s(a),n.mkNot(r)),depth:2};if(t===i)return t===a?n.trueExpr:{expr:u(o(this.mkEq(a,t)),r),depth:2};if(t===a)return{expr:u(o(this.mkEq(i,t)),n.mkNot(r)),depth:2};let d=e=>this.isIte(e)&&n.isUniqueValue(n.getArg(e,1))&&n.isUniqueValue(n.getArg(e,2)),f=e=>typeof e==`number`?e:e.expr,p=d(i)?this.tryIteValue(i,t):void 0;if(p!==void 0){let e=[f(p),c(a)];return{expr:n.mkApp(4,[r,...e],0),depth:2}}let m=d(a)?this.tryIteValue(a,t):void 0;if(m!==void 0){let e=[c(i),f(m)];return{expr:n.mkApp(4,[r,...e],0),depth:2}}return this.releaseResult(),this.isDisjointFrom(e,t)?n.falseExpr:void 0}isDisjointFrom(e,t){let n=this.manager,r=/* @__PURE__ */ new Set,i=[e];for(;i.length>0;){let a=i.pop()??e;if(!r.has(a)&&(r.add(a),!this.areDistinct(a,t))){if(!this.isIte(a))return!1;i.push(n.getArg(a,1),n.getArg(a,2))}}return!0}mkEq(e,t){let n=this.mkEqCore(e,t);return n===void 0?this.manager.mkEq(e,t):typeof n==`number`?n:n.expr}mkEqCore(e,t){let n=this.manager;if(e===t)return n.trueExpr;if(n.isUniqueValue(e)&&n.isUniqueValue(t))return n.falseExpr;let r=this.tryIteEq(e,t)??this.tryIteEq(t,e);if(r!==void 0)return r;let i=this.mkIteValueEq(e,t);if(i!==void 0)return i;if(n.sorts[e]!==0)return;let a=n.isNot(e)&&n.isNot(t),o=a?n.getArg(e,0):e,s=a?n.getArg(t,0):t;if(n.isTrue(o))return s;if(n.isFalse(o))return this.mkNot(s);if(n.isTrue(s))return o;if(n.isFalse(s))return this.mkNot(o);if(n.isComplement(o,s))return n.falseExpr;let c=n.isNot(s),l=c?s:o,u=c?o:s;if(n.isNot(l))return{expr:n.mkNot(n.mkEq(n.getArg(l,0),u)),depth:2};if(a)return{expr:n.mkEq(l,u),depth:1};if(n.getOp(l)===2&&n.getOp(u)===2){let e=(e,t)=>n.isNot(e)&&n.getArg(e,0)===t;if(n.getArg(l,0)===n.getArg(u,0)&&(e(n.getArg(u,1),n.getArg(l,1))||e(n.getArg(l,1),n.getArg(u,1)))||n.getArg(l,1)===n.getArg(u,1)&&(e(n.getArg(u,0),n.getArg(l,0))||e(n.getArg(l,0),n.getArg(u,0))))return n.falseExpr}}mkDistinct(e){if(e.length===2)return{expr:this.mkNot(this.mkEq(e[0],e[1])),depth:2};let t=[];for(let n=0;n<e.length;n++)for(let r=n+1;r<e.length;r++)t.push(this.mkNot(this.mkEq(e[n],e[r])));return this.mkAnd(t)}mkIte(e,t,n){let r=this.manager,i=r.isNot(e),a=i?r.getArg(e,0):e,o=i?t:n,s=i?n:t,c=this.isIte(s)&&r.getArg(s,0)===a?r.getArg(s,1):s,l=r.sorts[c];if(this.isIte(o)&&r.getArg(o,1)===c){let e=r.mkApp(6,[a,r.getArg(o,0)],0);return{expr:r.mkApp(4,[e,c,r.getArg(o,2)],l),depth:3}}let u=this.isIte(o)&&r.getArg(o,0)===a?r.getArg(o,2):o;if(r.isTrue(a))return c;if(r.isFalse(a))return u;if(c===u)return c;if(l===0){if(r.isTrue(c))return r.isFalse(u)?a:this.mkOr([a,u]);if(r.isFalse(c))return r.isTrue(u)?this.mkNot(a):{expr:this.mkAnd([this.mkNot(a),u]),depth:1};if(r.isTrue(u))return this.mkOr([this.mkNot(a),c]);if(r.isFalse(u)||u===a)return{expr:this.mkAnd([a,c]),depth:1};if(c===a)return this.mkOr([a,u]);if(r.isNot(c)&&r.getArg(c,0)===u||r.isNot(u)&&r.getArg(u,0)===c)return this.mkEq(a,c)}let d=this.isIte(u);if(this.isIte(c)){if(u===r.getArg(c,1)){let e=this.mkAnd([a,this.mkNot(r.getArg(c,0))]);return{expr:r.mkApp(4,[e,r.getArg(c,2),u],l),depth:2}}if(u===r.getArg(c,2)){let e=this.mkAnd([a,r.getArg(c,0)]);return{expr:r.mkApp(4,[e,r.getArg(c,1),u],l),depth:2}}let e=d&&r.getArg(c,1)===r.getArg(u,1)&&r.getArg(c,2)===r.getArg(u,2),t=d&&r.getArg(c,1)===r.getArg(u,2)&&r.getArg(c,2)===r.getArg(u,1);if(e||t){let t=this.mkAnd([a,r.getArg(c,0)]),n=this.mkNot(a),i=this.mkAnd([n,e?r.getArg(u,0):this.mkNot(r.getArg(u,0))]),o=this.mkOr([t,i]);return{expr:r.mkApp(4,[o,r.getArg(c,1),r.getArg(c,2)],l),depth:3}}}if(d){if(c===r.getArg(u,1)){let e=this.mkOr([a,r.getArg(u,0)]);return{expr:r.mkApp(4,[e,c,r.getArg(u,2)],l),depth:1}}if(c===r.getArg(u,2)){let e=this.mkOr([a,this.mkNot(r.getArg(u,0))]);return{expr:r.mkApp(4,[e,c,r.getArg(u,1)],l),depth:1}}}return r.mkApp(4,[a,c,u],l)}mkAdd(e){return this.arith.mkAdd(e)??this.arith.mkAddApp(e)}mkSub(e,t){let n=this.arith.mkSub([e,t]);return typeof n==`number`?n:n.expr}},Zh=class extends oh{inference;constructor(e,t){super(e),this.inference=t}reduceQuantifier(e,t){let n=this.manager,r=n.getQuantifier(e);if(!r.isForall||r.patterns.length>0)return-1;let i=n.withTemporaries(()=>{let e=this.inference.infer(r.sorts.length,t,r.weight),i=n.mkQuantifier({...r,body:t,patterns:e.patterns});return e.weight===r.weight?i:n.mkQuantifier({...r,body:t,patterns:e.patterns,weight:e.weight})});if(n.getQuantifier(i).patterns.length>0)return i;let a=new Ch(n),o=a.rewrite(i),s=n.getQuantifier(o),c=o===i?-1:n.withTemporaries(()=>{let e=this.inference.inferPulled(s.sorts.length,s.body);return e.length===0?-1:n.mkQuantifier({...s,patterns:e})},e=>e===-1?[]:[e]);return c!==-1&&n.decRef(i),n.decRef(o),a.release(),c===-1?i:c}};const Qh=(e,t,n)=>{if(t===n)return!1;let r=e.isUniqueValue(t),i=e.isUniqueValue(n);if(!r&&i)return!0;if(r&&!i)return!1;if(e.depths[t]!==e.depths[n])return e.depths[t]>e.depths[n];if(e.kinds[t]!==0||e.kinds[n]!==0)return!1;let a=e.getDeclId(t),o=e.getDeclId(n);if(a!==o)return a>o;if(e.getNumArgs(t)!==e.getNumArgs(n))return e.getNumArgs(t)>e.getNumArgs(n);for(let r=0;r<e.getNumArgs(t);r++)if(e.getArg(t,r)!==e.getArg(n,r))return Qh(e,e.getArg(t,r),e.getArg(n,r));return!1};var $h=class{manager;map=/* @__PURE__ */ new Map;trail;trailLims=[];constructor(e){this.manager=e,this.trail=new F(e)}insert(e,t){this.map.has(e)||(this.manager.incRef(e),this.manager.incRef(t),this.map.set(e,t),this.trail.push(e))}push(){this.trailLims.push(this.trail.size)}pop(){let e=this.trailLims[this.trailLims.length-1];this.trailLims.pop();for(let t of this.trail.items.slice(e)){let e=this.map.get(t);if(e===void 0)throw new r(`a trailed key has no substitution`);this.manager.decRef(e),this.map.delete(t),this.manager.decRef(t)}this.trail.shrink(e)}update(e){let t=this.manager;if(t.isGround(e)&&t.getOp(e)===2){let n=t.getArg(e,0),r=t.getArg(e,1);if(Qh(t,n,r)){this.insert(n,r);return}if(Qh(t,r,n)){this.insert(r,n);return}}t.isNot(e)?this.insert(t.getArg(e,0),t.falseExpr):this.insert(e,t.trueExpr)}},eg=class{manager;formulas;qhead=0;substitution;rewriter;isEliminatingAnd=!1;isReducePending=!0;names;patternInference;bvSharing;hasQuantifiers=!1;isInconsistent=!1;numLazyScopes=0;scopes=[];constructor(e){this.manager=e,this.formulas=new F(e),this.substitution=new $h(e),this.rewriter=new Xh(e,Jh),this.names=new hh(e),this.patternInference=new Zh(e,new xh(e)),this.bvSharing=new Sh(e)}push(){this.numLazyScopes++}pop(){if(this.numLazyScopes>0){this.numLazyScopes--;return}let e=this.scopes[this.scopes.length-1];this.scopes.pop(),this.isInconsistent=e.isInconsistent,this.bvSharing.popScope(),this.names.pop(),this.substitution.pop(),this.formulas.shrink(e.numFormulas),this.qhead=e.numFormulas,this.flushCache()}forcePush(){for(;this.numLazyScopes>0;this.numLazyScopes--)this.substitution.push(),this.scopes.push({numFormulas:this.formulas.size,isInconsistent:this.isInconsistent}),this.names.push(),this.bvSharing.pushScope()}assertExpr(e){this.forcePush();let t=this.manager;if(this.isInconsistent||t.isTrue(e))return;this.setEliminateAnd(!1);let n=this.rewriter.rewrite(e);t.hasQuantifierFlags[e]&&(this.hasQuantifiers=!0),this.pushAssertion(n,this.formulas),t.decRef(n),this.isReducePending=!0}getNumFormulas(){return this.formulas.size}reduce(){if(this.qhead===this.formulas.size||(this.isInconsistent||this.reduceCore(),this.isInconsistent))return[];let e=this.formulas.items.slice(this.qhead);for(let t of e)this.substitution.update(t);return this.qhead=this.formulas.size,e}reduceCore(){this.setEliminateAnd(!1),this.propagateValues(),!this.isInconsistent&&(this.isReducePending=!0,this.nnfCnf(),!this.isInconsistent&&(this.setEliminateAnd(!0),this.reduceAsserted(),!this.isInconsistent&&(this.hasQuantifiers&&this.simplifyFormulas(e=>this.patternInference.rewrite(e))&&(this.isReducePending=!0),!this.isInconsistent&&(this.simplifyFormulas(e=>this.bvSharing.rewrite(e))&&(this.isReducePending=!0),!this.isInconsistent&&(this.reduceAsserted(),!this.isInconsistent&&(this.isReducePending=!0,this.flattenClauses(),!this.isInconsistent&&this.flushCache()))))))}pushAssertion(e,t){let n=this.manager;if(this.isInconsistent||n.isTrue(e))return;if(n.isFalse(e)){t.push(e),this.isInconsistent=!0;return}let r=n.getOp(e);if(r===5)for(let r=0;r<n.getNumArgs(e);r++){let i=n.getArg(e,r);this.pushAssertion(i,t)}else if(r===8&&n.getOp(n.getArg(e,0))===6){let r=n.getArg(e,0);for(let e=0;e<n.getNumArgs(r);e++){let i=qm(n,n.getArg(r,e));n.incRef(i),this.pushAssertion(i,t),n.decRef(i)}}else t.push(e)}flushCache(){this.rewriter.setSubstitution(this.substitution.map)}setEliminateAnd(e){this.isEliminatingAnd!==e&&(this.isEliminatingAnd=e,this.isReducePending=!0,this.rewriter.setEliminatingAnd(e),this.flushCache())}swapFormulas(e){this.formulas.shrink(this.qhead);for(let t of e.items)this.formulas.push(t);e.reset()}simplifyFormulas(e){let t=this.manager,n=new F(t),r=!1;for(let i=this.qhead;i<this.formulas.size;i++){let a=this.formulas.items[i],o=e(a);o===a?n.push(a):(this.pushAssertion(o,n),r=!0),t.decRef(o)}return this.swapFormulas(n),r}reduceAsserted(){this.isReducePending&&=(this.simplifyFormulas(e=>this.rewriter.rewrite(e)),!1)}propagateValues(){let e=this.manager,t=this.substitution,n=this.formulas.size,r=0,i=n=>{let i=this.formulas.items[n];e.incRef(i);let a=this.rewriter.rewrite(i);this.formulas.set(n,a),e.isFalse(a)&&(this.isInconsistent=!0),t.update(a),a!==i&&r++,e.decRef(a),e.decRef(i)};this.flushCache(),t.push();for(let e=this.qhead;e<n;e++)i(e);this.flushCache(),t.pop(),t.push();for(let e=n-1;e>=this.qhead;e--)i(e);t.pop(),this.flushCache(),r>0&&this.reduceAsserted()}nnfCnf(){let e=this.manager,t=new vh(e,this.names),n=new F(e),r=new F(e);for(let i=this.qhead;i<this.formulas.size;i++){r.reset();let a=t.apply(this.formulas.items[i],r);r.push(a);for(let t=0;t<r.size;t++){let i=this.rewriter.rewrite(r.items[t]);e.decRef(a),a=i,this.pushAssertion(a,n)}e.decRef(a)}this.swapFormulas(n),r.reset(),t.release()}flattenClauses(){let e=this.manager,t=t=>e.isNot(t)?e.getArg(t,0):e.mkApp(8,[t],0),n=t=>e.isNot(t)&&e.getOp(e.getArg(t,0))===6;for(let r=!0;r;){r=!1;let i=new F(e),a=/* @__PURE__ */ new Map;for(let t=this.qhead;t<this.formulas.size;t++){let r=this.formulas.items[t];if(e.getOp(r)===6&&e.getNumArgs(r)===2)for(let t=0;t<2;t++){let i=e.getArg(r,t);n(i)&&a.set(i,(a.get(i)??0)+1)}}for(let o=this.qhead;o<this.formulas.size;o++){let s=this.formulas.items[o];if(e.getOp(s)===6&&e.getNumArgs(s)===2){let o=[1,0].find(t=>n(e.getArg(s,t))&&a.get(e.getArg(s,t))===1);if(o!==void 0){let n=e.getArg(s,1-o),a=e.getArg(e.getArg(s,o),0);for(let r=0;r<e.getNumArgs(a);r++)i.push(e.mkApp(6,[n,t(e.getArg(a,r))],0));r=!0;continue}}e.getOp(s)===4?(i.push(e.mkApp(6,[t(e.getArg(s,0)),e.getArg(s,1)],0)),i.push(e.mkApp(6,[e.getArg(s,0),e.getArg(s,2)],0)),r=!0):i.push(s)}this.swapFormulas(i)}}},tg=class{isMarked=!1};const ng={kind:`axiom`},rg=[{kind:`congruence`,isCommutative:!1},{kind:`congruence`,isCommutative:!0}],ig=[];var ag=class{owner;decl;generation;iscopeLevel;root=this;next=this;cg=this;classSize=1;parents=ig;transTarget=null;transJustification=ng;thVar=-1;lbls=0;lblsHigh=0;plbls=0;plblsHigh=0;lblHash=-1;flags;arg0;arg1;moreArgs;constructor(e,t,n,r,i,a,o,s,c,l,u,d){this.owner=e,this.decl=t,this.generation=o,this.iscopeLevel=d,this.arg0=r??this,this.arg1=i??this,this.moreArgs=a,this.flags=n<<7|!!s|(c?2:0)|(l?4:0)|(u?8:0)}setFlag(e,t){this.flags=t?this.flags|e:this.flags&~e}get numArgs(){return this.flags>>>7}getArg(e){return e===0?this.arg0:e===1?this.arg1:this.moreArgs[e-2]}get isEq(){return!!(this.flags&1)}get isBool(){return!!(this.flags&2)}get isCgcEnabled(){return!!(this.flags&8)}get isMergeTf(){return!!(this.flags&4)}set isMergeTf(e){this.setFlag(4,e)}get isMarked(){return!!(this.flags&16)}set isMarked(e){this.setFlag(16,e)}get isMarked2(){return!!(this.flags&32)}set isMarked2(e){this.setFlag(32,e)}get isInterpreted(){return!!(this.flags&64)}set isInterpreted(e){this.setFlag(64,e)}addParent(e){this.parents.length===0?this.parents=[e]:this.parents.push(e)}isCgr(){return this.cg===this}isTrueEq(){return this.isEq&&this.arg0.root===this.arg1.root}usesCgTable(){return this.numArgs>0&&this.isCgcEnabled&&!this.isTrueEq()}},og=class extends tg{first;second;constructor(e,t){super(),this.first=e,this.second=t}getAntecedents(e){e.markEq(this.first,this.second)}},sg=class extends tg{node;constructor(e){super(),this.node=e}getAntecedents(e){e.markEq(this.node,this.node.root)}},cg=class extends tg{first;second;justification;constructor(e,t,n){super(),this.first=e,this.second=t,this.justification=n}getAntecedents(e){e.markEq(this.first,this.first.root),e.markEq(this.second,this.second.root),e.markJustifiedEq(this.first,this.second,this.justification)}},lg=class extends tg{first;second;getLiteral;constructor(e,t,n){super(),this.first=e,this.second=t,this.getLiteral=n}getAntecedents(e){e.markEq(this.first,this.second),e.markLiteral(this.getLiteral(this.first))}},ug=class extends tg{justification;literals;constructor(e,t){super(),this.justification=e,this.literals=t}getAntecedents(e){this.justification!==null&&e.markJustification(this.justification);for(let t of this.literals)e.markLiteral(t)}},dg=class extends tg{literals;eqs;constructor(e,t){super(),this.literals=e,this.eqs=t}getAntecedents(e){for(let t of this.literals)e.markLiteral(t);for(let t=0;t<this.eqs.length;t+=2)e.markEq(this.eqs[t],this.eqs[t+1])}};const fg=(e,t,n)=>t<n?Math.imul(Math.imul(e,2654435761)+t,2246822507)+n|0:Math.imul(Math.imul(e,2654435761)+n,2246822507)+t|0,pg=(e,t,n)=>{if(n)return fg(e,t[0].root.owner,t[1].root.owner);let r=e;for(let e=0;e<t.length;e++)r=Math.imul(r,2654435761)+t[e].root.owner|0;return r},mg=e=>{if(e.isEq)return fg(e.decl,e.getArg(0).root.owner,e.getArg(1).root.owner);let t=e.decl;for(let n=0;n<e.numArgs;n++)t=Math.imul(t,2654435761)+e.getArg(n).root.owner|0;return t},hg=(e,t,n,r)=>{let i=e.getArg(0).root,a=e.getArg(1).root;return i===t.root&&a===n.root||r&&i===n.root&&a===t.root},gg=(e,t,n,r)=>{if(e.decl!==t||e.numArgs!==n.length)return!1;if(r)return hg(e,n[0],n[1],!0);for(let t=0;t<n.length;t++)if(e.getArg(t).root!==n[t].root)return!1;return!0},_g=(e,t)=>{if(e.decl!==t.decl||e.numArgs!==t.numArgs)return!1;if(e.numArgs===2)return hg(e,t.getArg(0),t.getArg(1),e.isEq);for(let n=0;n<e.numArgs;n++)if(e.getArg(n).root!==t.getArg(n).root)return!1;return!0},vg=(e,t)=>rg[e.isEq&&t.getArg(0).root!==e.getArg(0).root?1:0];var yg=class{nodes=Array(1024).fill(null);hashes=/* @__PURE__ */ new Int32Array(1024);states=/* @__PURE__ */ new Uint8Array(1024);numFull=0;numDeleted=0;find(e,t,n,r){let i=this.states.length-1;for(let a=r&i;this.states[a]!==0;a=a+1&i){let i=this.nodes[a];if(this.states[a]===1&&this.hashes[a]===r&&i!==null&&gg(i,e,t,n))return i}}findNode(e,t){let n=this.states.length-1;for(let r=t&n;this.states[r]!==0;r=r+1&n){let n=this.nodes[r];if(this.states[r]===1&&this.hashes[r]===t&&n!==null&&_g(n,e))return n}}insert(e){let t=mg(e),n=this.findNode(e,t);if(n!==void 0)return n;2*(this.numFull+this.numDeleted+1)>this.states.length&&this.rebuild();let r=this.states.length-1,i=t&r;for(;this.states[i]===1;)i=i+1&r;return this.states[i]===2&&this.numDeleted--,this.place(i,e,t),e}place(e,t,n){this.nodes[e]=t,this.hashes[e]=n,this.states[e]=1,this.numFull++}rebuild(){let e=this.nodes,t=this.hashes,n=this.states,r=4*this.numFull>n.length?2*n.length:n.length;this.nodes=Array(r).fill(null),this.hashes=new Int32Array(r),this.states=new Uint8Array(r),this.numFull=0,this.numDeleted=0;let i=r-1;for(let r=0;r<n.length;r++){let a=e[r];if(n[r]!==1||a===null)continue;let o=t[r]&i;for(;this.states[o]===1;)o=o+1&i;this.place(o,a,t[r])}}findFor(e,t,n){return this.find(e,t,n,pg(e,t,n))}findCongruent(e){return this.findNode(e,mg(e))}getSlot(e){let t=this.states.length-1;for(let n=mg(e)&t;this.states[n]!==0;n=n+1&t)if(this.nodes[n]===e)return n;return-1}erase(e){let t=this.getSlot(e);t!==-1&&(this.nodes[t]=null,this.states[t]=2,this.numFull--,this.numDeleted++)}contains(e){return this.getSlot(e)!==-1}},bg=class{literal;constructor(e){this.literal=e}};const xg=16777215,Sg=1<<26,Cg=1<<27,wg=1<<28,Tg=1<<29,Eg=1<<30,Dg=1<<31;var Og=class{data=/* @__PURE__ */ new Int32Array(65536);top=0;freeLists=[];delEhs=[];freeDelEhSlots=[];justifications=[];freeJustificationSlots=[];getSize(e){let t=e&xg;return 2+t+ +!!kg(e>>>24&3)+(e&Tg?1:0)+(e&Eg?1:0)+(e&wg?t:0)}allocate(e){let t=this.freeLists[e];if(t!==void 0&&t!==-1)return this.freeLists[e]=this.data[t],t;let n=this.top;if(this.top+=e,this.top>this.data.length){let e=new Int32Array(Math.max(2*this.data.length,this.top));e.set(this.data),this.data=e}return n}mk(e,t,n,r,i){let a=e.length,o=a|t<<24|(i===null?0:wg)|(r===null?0:Tg)|(n===null?0:Eg),s=this.allocate(this.getSize(o)),c=this.data;c[s]=a,c[s+1]=o;for(let t=0;t<a;t++)c[s+2+t]=e[t];let l=s+2+a;if(kg(t)&&(c[l++]=1),r!==null&&(c[l++]=this.mkSlot(this.delEhs,this.freeDelEhSlots,r)),n!==null&&(c[l++]=this.mkSlot(this.justifications,this.freeJustificationSlots,n)),i!==null)for(let t=0;t<a;t++)c[l+t]=2*i[t]+(e[t]&1);return s}mkSlot(e,t,n){let r=t.pop()??e.length;return pm(e,r,n),r}free(e){let t=this.data,n=t[e+1];if(n&Tg){let n=t[this.getSlotAddress(e,Tg)];this.delEhs[n]=null,this.freeDelEhSlots.push(n)}if(n&Eg){let n=t[this.getSlotAddress(e,Eg)];this.justifications[n]=null,this.freeJustificationSlots.push(n)}let r=this.getSize(n);t[e]=this.freeLists[r]??-1,t[e+1]=0,pm(this.freeLists,r,e)}getExtra(e){return e+2+(this.data[e+1]&xg)}checkLive(e){if(!(this.data[e+1]&xg))throw new r(`the clause was freed`)}getNumLiterals(e){return this.data[e]}getLiteral(e,t){return this.data[e+2+t]}setLiteral(e,t,n){this.data[e+2+t]=n}getLiterals(e){let t=[];for(let n=0;n<this.data[e];n++)t.push(this.getLiteral(e,n));return t}swapLiterals(e,t,n){let r=this.data,i=r[e+2+t];r[e+2+t]=r[e+2+n],r[e+2+n]=i}getKind(e){return this.data[e+1]>>>24&3}isLemma(e){return kg(this.getKind(e))}setFlag(e,t,n){this.data[e+1]=n?this.data[e+1]|t:this.data[e+1]&~t}isDeleted(e){return!!(this.data[e+1]&Dg)}markAsDeleted(e){this.setFlag(e,Dg,!0)}isReinit(e){return!!(this.data[e+1]&Sg)}setReinit(e,t){this.setFlag(e,Sg,t)}isReinternalizeAtoms(e){return!!(this.data[e+1]&Cg)}setReinternalizeAtoms(e,t){this.setFlag(e,Cg,t)}getActivity(e){return this.data[this.getExtra(e)]}incActivity(e){this.data[this.getExtra(e)]++}getSlotAddress(e,t){let n=this.data[e+1];return this.getExtra(e)+ +!!kg(n>>>24&3)+(t===Eg&&n&Tg?1:0)}getDelEh(e){return this.data[e+1]&Tg?this.delEhs[this.data[this.getSlotAddress(e,Tg)]]:null}getJustification(e){return this.data[e+1]&Eg?this.justifications[this.data[this.getSlotAddress(e,Eg)]]:null}getAtomsAddress(e){let t=this.data[e+1];return t&wg?this.getSlotAddress(e,Eg)+(t&Eg?1:0):-1}getAtoms(e){let t=this.getAtomsAddress(e);if(t===-1||this.data[t]===-1)return[];let n=[];for(let r=0;r<this.data[e];r++)n.push(this.data[t+r]>>1);return n}getAtomSign(e,t){return(this.data[this.getAtomsAddress(e)+t]&1)==1}clearAtoms(e){let t=this.getAtomsAddress(e);if(t!==-1)for(let n=0;n<(this.data[e+1]&xg);n++)this.data[t+n]=-1}};const kg=e=>e===1||e===3,Ag=e=>e,I=(e,t=!1)=>e*2+ +!!t,L=e=>e^1,R=e=>e>>1,jg=e=>(e&1)==1;var Mg=class{context;antecedents=[];todoJustifications=[];todoJustificationsHead=0;todoEqs=[];processedEqs=/* @__PURE__ */ new Set;lemma=[];lemmaAtoms;conflictLevel=0;newScopeLevel=0;lemmaIscopeLevel=0;unmark=[];levelSet=0;minimizationStack=[];constructor(e){this.context=e,this.lemmaAtoms=new F(e.manager)}markLiteral(e){this.antecedents.push(e)}markEq(e,t){if(e===t)return;let n=this.context.manager.ids,r=n[e.owner]>n[t.owner],i=r?t:e,a=r?e:t,o=`${i.owner}:${a.owner}`;this.processedEqs.has(o)||(this.processedEqs.add(o),this.todoEqs.push(i,a))}markJustification(e){e.isMarked||(e.isMarked=!0,this.todoJustifications.push(e))}markJustifiedEq(e,t,n){this.eqJustificationToLiterals(e,t,n)}findCommonAncestor(e,t){for(let t=e;t!==null;t=t.transTarget)t.isMarked2=!0;let n=t;for(;!n.isMarked2;){let e=n.transTarget;if(e===null)break;n=e}for(let t=e;t!==null;t=t.transTarget)t.isMarked2=!1;return n}eqJustificationToLiterals(e,t,n){if(n.kind===`equation`)this.antecedents.push(n.literal);else if(n.kind===`justification`)this.markJustification(n.justification);else if(n.kind===`congruence`){if(n.isCommutative)this.markEq(e.getArg(0),t.getArg(1)),this.markEq(e.getArg(1),t.getArg(0));else for(let n=0;n<e.numArgs;n++)this.markEq(e.getArg(n),t.getArg(n))}}eqBranchToLiterals(e,t){let n=e;for(;n!==t;){let e=n.transTarget;if(e===null)break;this.eqJustificationToLiterals(n,e,n.transJustification),n=e}}processJustifications(){for(;;){for(;this.todoJustificationsHead<this.todoJustifications.length;){let e=this.todoJustifications[this.todoJustificationsHead];this.todoJustificationsHead++,e.getAntecedents(this)}for(;this.todoEqs.length>0;){let e=this.todoEqs.pop(),t=this.todoEqs.pop();if(t===void 0||e===void 0)break;let n=this.findCommonAncestor(t,e);this.eqBranchToLiterals(t,n),this.eqBranchToLiterals(e,n)}if(this.todoJustificationsHead===this.todoJustifications.length)return}}unmarkJustifications(e){for(let t=e;t<this.todoJustifications.length;t++)this.todoJustifications[t].isMarked=!1;N(this.todoJustifications,e),this.todoJustificationsHead=e,this.todoEqs.length=0,this.processedEqs.clear()}justificationToLiteralsCore(e){let t=this.antecedents;this.antecedents=[],this.markJustification(e),this.processJustifications();let n=this.antecedents;return this.antecedents=t,n}justificationToLiterals(e){let t=this.justificationToLiteralsCore(e);return this.unmarkJustifications(0),t}getJustificationMaxLevel(e){let t=0;for(let n of this.justificationToLiterals(e))t=Math.max(t,this.context.getAssignLevel(n));return t}getMaxLevel(e,t){let n=this.context,r=e===n.falseLiteral?0:n.getAssignLevel(e);if(t instanceof tg)return Math.max(r,this.getJustificationMaxLevel(t));if(t instanceof bg)return Math.max(r,n.getAssignLevel(t.literal));if(t===null||t===`axiom`)return r;let i=n.clauses,a=i.getNumLiterals(t),o=0;e!==n.falseLiteral&&(i.getLiteral(t,0)===e?o=1:(r=Math.max(r,n.getAssignLevel(i.getLiteral(t,0))),o=2));for(let e=o;e<a;e++)r=Math.max(r,n.getAssignLevel(i.getLiteral(t,e)));let s=i.getJustification(t);return s!==null&&(r=Math.max(r,this.getJustificationMaxLevel(s))),r}processAntecedent(e,t){let n=this.context,r=R(e),i=n.getLevel(r);n.isMarked(r)||i<=n.baseLevel||(n.setMark(r,!0),n.incBvarActivity(r),i===this.conflictLevel?t.count++:(this.lemma.push(L(e)),this.lemmaAtoms.push(n.boolVar2Expr[r])))}processJustification(e,t){for(let n of this.justificationToLiteralsCore(e))this.processAntecedent(n,t)}resolve(e,t){let n=this.context;this.lemma=[],this.lemmaAtoms.reset();let r=e,i=t===null?n.falseLiteral:L(t);if(this.conflictLevel=this.getMaxLevel(i,r),this.conflictLevel<=n.searchLevel)return!1;let a=n.assignedLiterals,o=a.length-1;for(;o>0&&n.getAssignLevel(a[o])>this.conflictLevel;)o--;this.lemma.push(n.falseLiteral),this.lemmaAtoms.push(-1);let s={count:0};t!==null&&this.processAntecedent(t,s);do{if(r instanceof tg)this.processJustification(r,s);else if(r instanceof bg)this.processAntecedent(r.literal,s);else if(r!==null&&r!==`axiom`){let e=r,t=n.clauses;t.isLemma(e)&&t.incActivity(e);let a=t.getNumLiterals(e),o=0;i!==n.falseLiteral&&(t.getLiteral(e,0)===i?o=1:(this.processAntecedent(L(t.getLiteral(e,0)),s),o=2));for(let n=o;n<a;n++)this.processAntecedent(L(t.getLiteral(e,n)),s);let c=t.getJustification(e);c!==null&&this.processJustification(c,s)}for(;!n.isMarked(R(a[o]));)o--;i=a[o];let e=R(i);r=n.justifications[e],o--,s.count--,n.setMark(e,!1)}while(s.count>0);return this.lemma[0]=L(i),this.lemmaAtoms.set(0,n.boolVar2Expr[R(i)]),this.finalizeResolve(),!0}finalizeResolve(){let e=this.context;this.unmarkJustifications(0),this.minimizeLemma(),this.newScopeLevel=e.searchLevel,this.lemmaIscopeLevel=e.getInternLevel(R(this.lemma[0]));for(let t=1;t<this.lemma.length;t++){let n=R(this.lemma[t]);e.setMark(n,!1),this.newScopeLevel=Math.max(this.newScopeLevel,e.getLevel(n)),this.lemmaIscopeLevel=Math.max(this.lemmaIscopeLevel,e.getInternLevel(n))}}processAntecedentForMinimization(e){let t=this.context,n=R(e),r=t.getLevel(n);return t.isMarked(n)||r<=t.baseLevel?!0:this.levelSet&1<<(r&31)?(t.setMark(n,!0),this.unmark.push(n),this.minimizationStack.push(n),!0):!1}processJustificationForMinimization(e){for(let t of this.justificationToLiteralsCore(e))if(!this.processAntecedentForMinimization(t))return!1;return!0}resetUnmark(e,t){for(let t=e;t<this.unmark.length;t++)this.context.setMark(this.unmark[t],!1);N(this.unmark,e),this.unmarkJustifications(t)}isImpliedByMarked(e){let t=this.context;this.minimizationStack=[R(e)];let n=this.unmark.length,r=this.todoJustificationsHead;for(;this.minimizationStack.length>0;){let e=this.minimizationStack.pop()??-1,i=t.justifications[e],a=!0;if(i instanceof tg)a=this.processJustificationForMinimization(i);else if(i instanceof bg)a=this.processAntecedentForMinimization(i.literal);else if(i===null||i===`axiom`)a=t.getLevel(e)<=t.baseLevel;else{let n=t.clauses,r=n.getNumLiterals(i),o=+(R(n.getLiteral(i,1))===e);for(let e=0;e<r&&a;e++)e!==o&&(a=this.processAntecedentForMinimization(L(n.getLiteral(i,e))));let s=n.getJustification(i);a&&s!==null&&(a=this.processJustificationForMinimization(s))}if(!a)return this.resetUnmark(n,r),!1}return!0}minimizeLemma(){let e=this.context;this.unmark=[],this.levelSet=0;for(let t of this.lemma)this.levelSet|=1<<(e.getLevel(R(t))&31);let t=1;for(let e=1;e<this.lemma.length;e++){let n=this.lemma[e];this.isImpliedByMarked(n)?this.unmark.push(R(n)):(this.lemma[t]=n,t!==e&&this.lemmaAtoms.set(t,this.lemmaAtoms.items[e]),t++)}this.resetUnmark(0,0),N(this.lemma,t),this.lemmaAtoms.shrink(t)}},Ng=class{context;appPair2NumOccs=/* @__PURE__ */ new Map;appPairs=[];toInstantiate=[];qhead=0;numInstances=0;numPropagationsSinceLastGc=0;instantiated=/* @__PURE__ */ new Set;constructor(e){this.context=e}resetAppPairs(){let e=this.context.manager;for(let t of this.appPairs)e.decRef(t.first),e.decRef(t.second);this.appPairs=[]}initSearchEh(){this.appPair2NumOccs.clear(),this.resetAppPairs(),this.toInstantiate=[],this.qhead=0,this.numInstances=0,this.numPropagationsSinceLastGc=0}cgConflictEh(e,t){let n=this.context.manager;if(n.decls[e]===2)return;let r=n.ids[e]>n.ids[t],i=r?t:e,a=r?e:t,o=`${i},${a}`;if(this.instantiated.has(o))return;let s=this.appPair2NumOccs.get(o),c={first:i,second:a,key:o};s===void 0&&(n.incRef(i),n.incRef(a),this.appPairs.push(c));let l=(s??0)+1;this.appPair2NumOccs.set(o,l),l===10&&this.toInstantiate.push(c)}gc(){let e=this.context.manager;this.toInstantiate=[],this.qhead=0;let t=0;for(let n of this.appPairs){if(this.instantiated.has(n.key)){e.decRef(n.first),e.decRef(n.second);continue}let r=Math.trunc((this.appPair2NumOccs.get(n.key)??0)*.8);r<=1?(this.appPair2NumOccs.delete(n.key),e.decRef(n.first),e.decRef(n.second)):(this.appPairs[t++]=n,this.appPair2NumOccs.set(n.key,r),r>=10&&this.toInstantiate.push(n))}this.appPairs.length=t;let n=e=>this.appPair2NumOccs.get(e.key)??0;this.toInstantiate.sort((e,t)=>n(t)-n(e))}propagateEh(){this.numPropagationsSinceLastGc++,this.numPropagationsSinceLastGc>2e3&&(this.gc(),this.numPropagationsSinceLastGc=0);let e=Math.trunc(this.context.getNumConflicts()*.1);for(;this.numInstances<e&&this.qhead<this.toInstantiate.length;){let e=this.toInstantiate[this.qhead];this.qhead++,this.numInstances++,this.instantiate(e)}}mkEq(e,t){let n=this.context,r=n.manager.mkEq(e,t);return n.internalize(r,!0),n.getLiteral(r)}instantiate(e){let t=this.context,n=t.manager,r=[];for(let t=0;t<n.getNumArgs(e.first);t++)n.getArg(e.first,t)!==n.getArg(e.second,t)&&r.push(L(this.mkEq(n.getArg(e.first,t),n.getArg(e.second,t))));this.appPair2NumOccs.delete(e.key),this.instantiated.add(e.key),r.push(this.mkEq(e.first,e.second));for(let e of r)t.markLiteralAsRelevant(e);t.mkClause(r,null,3,()=>this.instantiated.delete(e.key))}},Pg=class{activity;values=[Ag(-1)];indices=/* @__PURE__ */ new Int32Array(1024);constructor(e){this.activity=e}isLess(e,t){return this.activity[e]>this.activity[t]}contains(e){return e<this.indices.length&&this.indices[e]!==0}isEmpty(){return this.values.length===1}insert(e){if(e>=this.indices.length){let t=new Int32Array(Math.max(2*this.indices.length,e+1));t.set(this.indices),this.indices=t}this.values.push(e),this.indices[e]=this.values.length-1,this.moveUp(this.values.length-1)}eraseMin(){let e=this.values[1],t=this.values[this.values.length-1];return this.values.pop(),this.indices[e]=0,this.values.length>1&&(this.values[1]=t,this.indices[t]=1,this.moveDown(1)),e}erase(e){let t=this.indices[e];if(t===this.values.length-1){this.indices[e]=0,this.values.pop();return}let n=this.values[this.values.length-1];this.values.pop(),this.values[t]=n,this.indices[n]=t,this.indices[e]=0;let r=t>>1;r!==0&&this.isLess(n,this.values[r])?this.moveUp(t):this.moveDown(t)}decreased(e){this.moveUp(this.indices[e])}swap(e){let t=this.values,n=this.indices;this.values=e.values,this.indices=e.indices,e.values=t,e.indices=n}moveUp(e){let t=e,n=this.values[t];for(;;){let e=t>>1;if(e===0||!this.isLess(n,this.values[e]))break;this.values[t]=this.values[e],this.indices[this.values[t]]=t,t=e}this.values[t]=n,this.indices[n]=t}moveDown(e){let t=e,n=this.values[t],r=this.values.length;for(;;){let e=t*2;if(e>=r)break;let i=e+1,a=i<r&&this.isLess(this.values[i],this.values[e])?i:e;if(!this.isLess(this.values[a],n))break;this.values[t]=this.values[a],this.indices[this.values[t]]=t,t=a}this.values[t]=n,this.indices[n]=t}},Fg=class{context;isDelayingNew;queue;delayedQueue;constructor(e,t){this.context=e,this.isDelayingNew=t,this.queue=new Pg(e.activity),this.delayedQueue=new Pg(e.activity)}activityIncreased(e){this.queue.contains(e)&&this.queue.decreased(e),this.delayedQueue.contains(e)&&this.delayedQueue.decreased(e)}mkVar(e){this.isDelayingNew&&this.context.getIsSearching()?this.delayedQueue.insert(e):this.queue.insert(e)}delVar(e){this.queue.contains(e)&&this.queue.erase(e),this.delayedQueue.contains(e)&&this.delayedQueue.erase(e)}unassignVar(e){this.queue.contains(e)||this.queue.insert(e)}nextCaseSplit(){let e=this.context;if(e.getRandomValue()<327){let t=Ag(e.getRandomValue()%e.getNumBoolVars());if(e.isUnassigned(t))return t}for(;!this.queue.isEmpty();){let t=this.queue.eraseMin();if(e.isUnassigned(t))return t}for(this.queue.swap(this.delayedQueue);!this.queue.isEmpty();){let t=this.queue.eraseMin();if(e.isUnassigned(t))return t}}},Ig=class{context;isEnabled;qhead=0;relevantExprs=[];isRelevantFlags=/* @__PURE__ */ new Uint8Array(1024);heads=/* @__PURE__ */ new Int32Array(3072);trailKinds=[];trailExprs=[];trailHandlers=[];trailNext=[];scopes=[];isPropagating=!1;constructor(e,t){this.context=e,this.isEnabled=t}isRelevant(e){return!this.isEnabled||this.isRelevantFlags[e]===1}addHandler(e,t){this.isEnabled&&(this.isRelevant(e)?t():this.pushTrail(2,e,t))}addDependency(e,t){this.isRelevant(e)?this.markAsRelevant(t):this.addHandler(e,()=>this.markAsRelevant(t))}addWatch(e,t,n){if(!this.isEnabled)return;let r=this.context.findAssignment(e)*(t?1:-1);r<0||(r>0?n():this.pushTrail(+!t,e,n))}pushTrail(e,t,n){this.context.manager.incRef(t);let r=3*t+e;if(r>=this.heads.length){let e=new Int32Array(Math.max(2*this.heads.length,3*t+3));e.set(this.heads),this.heads=e}this.trailNext.push(this.heads[r]),this.trailHandlers.push(n),this.trailKinds.push(e),this.trailExprs.push(t),this.heads[r]=this.trailKinds.length}runList(e,t){let n=3*t+e;if(!(n>=this.heads.length))for(let e=this.heads[n];e!==0;e=this.trailNext[e-1])this.trailHandlers[e-1]()}push(){this.scopes.push(this.relevantExprs.length,this.trailKinds.length)}pop(e){let t=this.scopes.length-e*2,n=this.scopes[t],r=this.scopes[t+1],i=this.context.manager;for(let e=this.relevantExprs.length-1;e>=n;e--)this.isRelevantFlags[this.relevantExprs[e]]=0;for(let e=n;e<this.relevantExprs.length;e++)i.decRef(this.relevantExprs[e]);N(this.relevantExprs,n),this.qhead=n;for(let e=this.trailKinds.length-1;e>=r;e--){let t=this.trailExprs[e];this.heads[3*t+this.trailKinds[e]]=this.trailNext[e],i.decRef(t)}N(this.trailKinds,r),N(this.trailExprs,r),N(this.trailHandlers,r),N(this.trailNext,r),N(this.scopes,t)}setRelevant(e){if(e>=this.isRelevantFlags.length){let t=new Uint8Array(Math.max(2*this.isRelevantFlags.length,e+1));t.set(this.isRelevantFlags),this.isRelevantFlags=t}this.isRelevantFlags[e]=1,this.context.manager.incRef(e),this.relevantExprs.push(e),this.context.relevantEh(e)}markAsRelevant(e){if(this.isRelevant(e))return;let t=this.context.findEnode(e);if(t===void 0){this.setRelevant(e);return}let n=t;do this.isRelevant(n.owner)||this.setRelevant(n.owner),n=n.next;while(n!==t)}propagateApp(e){for(let t=this.context.manager.getNumArgs(e)-1;t>=0;t--)this.markAsRelevant(this.context.manager.getArg(e,t))}propagateImplies(e){let t=this.context;t.findAssignment(e)<0?this.propagateApp(e):t.findAssignment(t.manager.getArg(e,0))<0?this.markAsRelevant(t.manager.getArg(e,0)):t.findAssignment(t.manager.getArg(e,1))>0&&this.markAsRelevant(t.manager.getArg(e,1))}propagateOr(e){let t=this.context;if(t.findAssignment(e)<0){this.propagateApp(e);return}let n=-1;for(let r=0;r<t.manager.getNumArgs(e);r++){let i=t.manager.getArg(e,r);if(!(t.findAssignment(i)<=0)){if(this.isRelevant(i))return;n===-1&&(n=i)}}n!==-1&&this.markAsRelevant(n)}propagateAnd(e){let t=this.context,n=t.findAssignment(e);if(n>0){this.propagateApp(e);return}if(n===0)return;let r=-1;for(let n=0;n<t.manager.getNumArgs(e);n++){let i=t.manager.getArg(e,n);if(!(t.findAssignment(i)>=0)){if(this.isRelevant(i))return;r===-1&&(r=i)}}r!==-1&&this.markAsRelevant(r)}propagateIte(e){this.markAsRelevant(this.context.manager.getArg(e,0));let t=this.context.findAssignment(this.context.manager.getArg(e,0));t<0?this.markAsRelevant(this.context.manager.getArg(e,2)):t>0&&this.markAsRelevant(this.context.manager.getArg(e,1))}canPropagate(){return this.qhead<this.relevantExprs.length}propagate(){if(this.isPropagating)return;this.isPropagating=!0;let e=this.context.manager;for(;this.qhead<this.relevantExprs.length;){let t=this.relevantExprs[this.qhead];if(this.qhead++,e.kinds[t]===0){let n=e.getOp(t);n===6?this.propagateOr(t):n===5?this.propagateAnd(t):n===9?this.propagateImplies(t):n===4?this.propagateIte(t):this.propagateApp(t)}this.runList(2,t)}this.isPropagating=!1}assignEh(e,t){if(this.isRelevant(e)){let t=this.context.manager.getOp(e);t===6?this.propagateOr(e):t===5?this.propagateAnd(e):t===9&&this.propagateImplies(e)}this.runList(+!t,e)}},Lg=class{groups=/* @__PURE__ */ new Map;set(e,t){let n=this.groups.get(e.decl);if(n===void 0){this.groups.set(e.decl,{nodes:[e],generations:[t],indices:/* @__PURE__ */ new Map([[e,0]]),numHoles:0});return}let r=n.indices.get(e);r===void 0?(n.indices.set(e,n.nodes.length),n.nodes.push(e),n.generations.push(t)):n.generations[r]=t}delete(e){let t=this.groups.get(e.decl),n=t?.indices.get(e);t!==void 0&&n!==void 0&&(t.indices.delete(e),t.nodes[n]=null,t.numHoles++,2*t.numHoles>t.nodes.length&&Rg(t))}getGroup(e){return this.groups.get(e)}};const Rg=e=>{let t=0;for(let n=0;n<e.nodes.length;n++){let r=e.nodes[n];r!==null&&(e.nodes[t]=r,e.generations[t]=e.generations[n],e.indices.set(r,t),t++)}N(e.nodes,t),N(e.generations,t),e.numHoles=0},zg=1<<24,Bg=1<<25,Vg=1<<27,Hg=1<<28,Ug=1<<29,Wg=1<<31;var Gg=class{manager;trueLiteral=0;falseLiteral=1;rewriter;relevancy;caseSplitQueue;cgTable=new yg;stickyGenerations=new Lg;numBoolVars=0;boolVar2Expr=[];boolVarData=/* @__PURE__ */ new Int32Array(2048);justifications=[];activity=[];assignment=[];clauses=new Og;watches=[];watchMarks=/* @__PURE__ */ new Uint8Array(1024);removedLiterals=[];gateBuffer=[];gateLiterals=[];binaryWatches=[];binJustifications=[];exprToBoolVar=(/* @__PURE__ */ new Int32Array(1024)).fill(-1);exprToEnode=[];assignedLiterals=[];scopeLevel=0;baseLevel=0;searchLevel=0;trailKinds=[];trailNodes=[];trailInts=[];trailClosures=[];auxClauses=[];lemmas=[];clausesToReinit=[];conflict=null;eqPropagationQueue=[];enodes=[];decl2enodes=/* @__PURE__ */ new Map;trueEnode;isDiseqTmp=-1;falseEnode;generation=0;cachedGeneration=/* @__PURE__ */ new Map;randomSeed=0;isSearching=!1;constructor(e,t,n){this.manager=e,this.rewriter=new Xh(e,Jh),this.relevancy=new Ig({manager:e,findAssignment:e=>this.findAssignment(e),findEnode:e=>this.exprToEnode[e],relevantEh:e=>this.relevantEh(e)},t),this.caseSplitQueue=new Fg({activity:this.activity,getIsSearching:()=>this.isSearching,getRandomValue:()=>this.getRandomValue(),getNumBoolVars:()=>this.numBoolVars,isUnassigned:e=>this.assignment[I(e)]===0},n),this.mkBoolVar(e.trueExpr),this.assignment[0]=1,this.assignment[1]=-1,this.justifications[0]=`axiom`,this.trueEnode=this.mkEnode(e.trueExpr,!0,!0,!1),this.setExprBoolVar(e.falseExpr,0),this.falseEnode=this.mkEnode(e.falseExpr,!0,!0,!1)}setConflict(e,t){this.conflict===null&&(this.conflict={justification:e,notLiteral:t})}pushEq(e,t,n){this.eqPropagationQueue.push({lhs:e,rhs:t,justification:n})}getRandomValue(){return this.randomSeed=Math.imul(this.randomSeed,214013)+2531011>>>0,this.randomSeed>>>16&32767}pushTrail(e){this.trailClosures.push(e),this.trailKinds.push(0)}popTrail(e){let t=this.trailKinds;for(let n=t.length-1;n>=e;n--)this.undoTrailEntry(t[n]);N(t,e)}popTrailNode(){let e=this.trailNodes,t=e[e.length-1];return e.pop(),t}popTrailInt(){let e=this.trailInts,t=e[e.length-1];return e.pop(),t}undoTrailEntry(e){switch(e){case 0:this.trailClosures.pop()?.();return;case 1:this.undoMkBoolVar();return;case 2:this.undoMkEnode();return;case 3:this.setBoolVarFlag(this.popTrailInt(),Wg,!1);return;case 4:this.setBoolVarFlag(this.popTrailInt(),Hg,!1);return;case 5:{let e=this.popTrailNode(),t=this.popTrailNode(),n=this.popTrailInt();this.undoMergeCgcGenerations(t,this.popTrailInt(),e,n);return}case 6:this.popTrailNode().isMergeTf=!1;return;case 7:this.setBoolVarFlag(this.popTrailInt(),Ug,!1);return}}getAssignment(e){return this.assignment[e]}getBoolVarAssignment(e){return this.assignment[I(e)]}getAssignLevel(e){return this.getLevel(R(e))}isBInternalized(e){return this.findBoolVar(e)!==void 0}findBoolVar(e){let t=e<this.exprToBoolVar.length?this.exprToBoolVar[e]:-1;return t===-1?void 0:Ag(t)}setExprBoolVar(e,t){if(e>=this.exprToBoolVar.length){let t=new Int32Array(Math.max(2*this.exprToBoolVar.length,e+1)).fill(-1);t.set(this.exprToBoolVar),this.exprToBoolVar=t}this.exprToBoolVar[e]=t}getBoolVar(e){let t=this.findBoolVar(e);if(t===void 0)throw new r(`the formula has no Boolean variable`);return t}getEnode(e){return this.exprToEnode[e]}isEInternalized(e){return this.exprToEnode[e]!==void 0}findCongruent(e,t){return this.cgTable.findFor(e,t,e===2)}isDiseq(e,t){let n=this.manager;if(n.areDistinct(e.root.owner,t.root.owner))return!0;let r=this.isDiseqTmp;(r===-1||n.sorts[n.getArg(r,0)]!==n.sorts[e.owner])&&(r!==-1&&n.decRef(r),this.isDiseqTmp=n.mkEq(e.owner,t.owner),n.incRef(this.isDiseqTmp));let i=this.cgTable.findFor(2,[e,t],!0)?.root;return i===void 0||i===this.trueEnode?!1:i===this.falseEnode||this.isRelevant(i.owner)&&this.getAssignmentOfExpr(i.owner)===-1}enodesOf(e){return this.decl2enodes.get(e)??[]}getLiteral(e){let t=this.manager;return t.isNot(e)?L(this.getLiteral(t.getArg(e,0))):e===t.trueExpr?this.trueLiteral:e===t.falseExpr?this.falseLiteral:I(this.getBoolVar(e))}getAssignmentOfExpr(e){return this.assignment[I(this.getBoolVar(e))]}findAssignment(e){let t=this.manager;if(t.isNot(e)){let n=t.getArg(e,0);return this.isBInternalized(n)?-this.getAssignmentOfExpr(n):n===t.falseExpr?1:n===t.trueExpr?-1:0}return this.isBInternalized(e)?this.getAssignmentOfExpr(e):e===t.falseExpr?-1:+(e===t.trueExpr)}enodeToLiteral(e){let t=this.getBoolVar(e.owner);return I(t,this.assignment[I(t)]===-1)}isRelevant(e){return this.relevancy.isRelevant(e)}markAsRelevant(e){this.relevancy.markAsRelevant(e),this.relevancy.propagate()}markLiteralAsRelevant(e){this.markAsRelevant(this.boolVar2Expr[R(e)])}isInconsistent(){return this.conflict!==null}getGeneration(e){return e.isEq?0:this.getCgRoot(e).generation}getCgRoot(e){return!e.usesCgTable()||e.isCgr()?e:this.cgTable.findCongruent(e)??e}setGeneration(e,t){e.isEq||(this.getCgRoot(e).generation=t)}undoMergeCgcGenerations(e,t,n,r){this.setGeneration(e,t),this.setGeneration(n,r),this.applyStickyUpdates(e,t,n,r),n.decl!==e.decl&&this.applyStickyUpdates(n,r,null,0)}applyStickyUpdates(e,t,n,r){let i=this.stickyGenerations.getGroup(e.decl);if(i===void 0)return;let a=e.getArg(0).root,o=n!==null&&n.decl===e.decl?n.getArg(0).root:null;for(let s=0;s<i.nodes.length;s++){let c=i.nodes[s];if(c===null)continue;let l=i.generations[s],u=c.getArg(0).root;l<t&&u===a&&_g(c,e)?this.setGeneration(e,l):n!==null&&l<r&&u===o&&_g(c,n)&&this.setGeneration(n,l)}}mkBoolVar(e){let t=Ag(this.numBoolVars++),n=I(t);if(this.manager.incRef(e),this.setExprBoolVar(e,t),this.boolVar2Expr[t]=e,2*t+1>=this.boolVarData.length){let e=new Int32Array(2*this.boolVarData.length);e.set(this.boolVarData),this.boolVarData=e}return this.boolVarData[2*t]=0,this.boolVarData[2*t+1]=this.scopeLevel,this.justifications[t]=null,this.activity[t]=this.isSearching?-(this.getRandomValue()%1e3/1e3):0,this.assignment[n]=0,this.assignment[n+1]=0,this.resetWatches(n),this.resetWatches(n+1),this.caseSplitQueue.mkVar(t),this.trailKinds.push(1),t}undoMkBoolVar(){let e=Ag(--this.numBoolVars),t=this.boolVar2Expr[e];this.caseSplitQueue.delVar(e),this.hasBoolVarFlag(e,1073741824)&&this.qmanager.del(t),this.exprToBoolVar[t]=-1,this.justifications[e]=null,this.manager.decRef(t)}getLevel(e){return this.boolVarData[2*e]&16777215}setLevel(e,t){let n=2*e;this.boolVarData[n]=this.boolVarData[n]&-16777216|t}getInternLevel(e){return this.boolVarData[2*e+1]}hasBoolVarFlag(e,t){return(this.boolVarData[2*e]&t)!==0}setBoolVarFlag(e,t,n){let r=2*e;this.boolVarData[r]=n?this.boolVarData[r]|t:this.boolVarData[r]&~t}isMarked(e){return this.hasBoolVarFlag(e,zg)}setMark(e,t){this.setBoolVarFlag(e,zg,t)}resetWatches(e){let t=this.watches[e];t===void 0?this.watches[e]=void 0:N(t,0);let n=this.binaryWatches[e];n===void 0?this.binaryWatches[e]=void 0:N(n,0)}isAtom(e){return this.hasBoolVarFlag(e,-402653184)}setVarTheory(e){this.scopeLevel>this.getInternLevel(e)&&(this.trailInts.push(e),this.trailKinds.push(3)),this.setBoolVarFlag(e,Wg,!0)}setTrueFirstFlag(e){this.trailInts.push(e),this.trailKinds.push(4),this.setBoolVarFlag(e,Hg,!0)}isTrueFirst(e){return this.hasBoolVarFlag(e,Hg)}mkEnode(e,t,n,r){let i=this.manager,a=this.cachedGeneration.get(e)??this.generation,o=t?0:i.getNumArgs(e),s=o>2?[]:ig;for(let t=2;t<o;t++)s.push(this.getArgEnode(e,t));let c=!t&&i.getOp(e)===2,l=new ag(e,i.decls[e],o,o>0?this.getArgEnode(e,0):null,o>1?this.getArgEnode(e,1):null,s,a,c,i.sorts[e]===0,n,r,this.scopeLevel);for(let e=0;e<o;e++)l.getArg(e).root.addParent(l);if(i.isUniqueValue(e)&&(l.isInterpreted=!0),pm(this.exprToEnode,e,l),i.incRef(e),this.trailKinds.push(2),this.enodes.push(l),o>0){if(l.isTrueEq())this.assign(I(this.getBoolVar(e)),new og(l.getArg(0),l.getArg(1))),this.pushEq(l,this.trueEnode,ng);else if(r){let e=this.cgTable.insert(l);e!==l&&(l.cg=e,c||this.mergeCgcGenerations(l,a,e),this.pushEq(l,e,vg(l,e)))}if(!c){let e=this.decl2enodes.get(l.decl);e===void 0?this.decl2enodes.set(l.decl,[l]):e.push(l)}}return l}getArgEnode(e,t){let n=this.exprToEnode[this.manager.getArg(e,t)];if(n===void 0)throw new r(`an argument was not internalized`);return n}undoMkEnode(){let e=this.enodes.pop();if(e!==void 0){this.exprToEnode[e.owner]=void 0,e.isCgr()&&e.usesCgTable()&&this.cgTable.erase(e),e.numArgs>0&&!e.isEq&&this.decl2enodes.get(e.decl)?.pop();for(let t=0;t<e.numArgs;t++)e.getArg(t).root.parents.pop();this.manager.decRef(e.owner),this.stickyGenerations.delete(e)}}mergeCgcGenerations(e,t,n){this.trailInts.push(t,n.generation),this.trailNodes.push(e,n),this.trailKinds.push(5),t<n.generation&&(n.generation=t)}setMergeTf(e,t,n){if(e.isMergeTf)return;n||(this.trailNodes.push(e),this.trailKinds.push(6)),e.isMergeTf=!0;let r=this.assignment[I(t)];r===1&&e.root!==this.trueEnode.root?this.pushEq(e,this.trueEnode,{kind:`equation`,literal:I(t)}):r===-1&&e.root!==this.falseEnode.root&&this.pushEq(e,this.falseEnode,{kind:`equation`,literal:I(t,!0)})}setEnodeFlag(e,t){this.hasBoolVarFlag(e,536870912)||(t||(this.trailInts.push(e),this.trailKinds.push(7)),this.setBoolVarFlag(e,Ug,!0))}updateGeneration(e){e.isEq||this.generation>0&&this.generation<this.getGeneration(e)&&(this.setGeneration(e,this.generation),e.usesCgTable()&&this.stickyGenerations.set(e,this.generation))}isGate(e){let t=this.manager.getOp(e);return t===5||t===6||t===4||t===2&&this.manager.isBool(this.manager.getArg(e,0))}shouldInternalizeRec(e){let t=this.manager;if(t.kinds[e]!==0||t.sorts[e]!==0)return!0;let n=t.getFamily(e);return n===0||n===2}internalizeDeep(e){if(this.isEInternalized(e)||this.manager.depths[e]<=1024||!this.shouldInternalizeRec(e))return;let t=this.manager,n=/* @__PURE__ */ new Map,r=(e,t)=>n.get(e*2+ +!!t)??0,i=[[e,!0]],a=[],o=(e,t)=>{r(e,t)===0&&i.push([e,t])},s=e=>{if(t.kinds[e]===2||!this.shouldInternalizeRec(e))return;let n=this.exprToEnode[e];if(n!==void 0&&this.updateGeneration(n),t.sorts[e]===0?this.isBInternalized(e):n!==void 0)return;if(t.getOp(e)===4&&t.sorts[e]!==0){o(t.getArg(e,0),!0),o(t.getArg(e,1),!1),o(t.getArg(e,2),!1);return}let r=t.sorts[e]===0&&(this.isGate(e)||t.isNot(e));for(let n=t.getNumArgs(e)-1;n>=0;n--)o(t.getArg(e,n),r)};for(;i.length>0;){let o=i[i.length-1],c=r(o[0],o[1]);c===2?i.pop():c===0?(n.set(o[0]*2+ +!!o[1],1),s(o[0])):(n.set(o[0]*2+ +!!o[1],2),o[0]!==e&&!t.isNot(o[0])&&this.shouldInternalizeRec(o[0])&&a.push(o))}for(let e of a)this.internalizeRec(e[0],e[1])}internalizeAssertion(e,t){let n=this.generation;this.generation=t,this.internalizeDeep(e);let r=this.manager;if(this.isGate(e)){switch(r.getOp(e)){case 5:for(let t=0;t<r.getNumArgs(e);t++){let n=r.getArg(e,t);this.internalizeRec(n,!0),this.mkClause([this.getLiteral(n)],null,0)}break;case 6:for(let t=0;t<r.getNumArgs(e);t++){let n=r.getArg(e,t);this.internalizeRec(n,!0)}this.mkClause(r.mapArgs(e,e=>this.getLiteral(e)),null,0),this.addOrRelWatches(e);break;case 2:{this.internalizeRec(r.getArg(e,0),!0),this.internalizeRec(r.getArg(e,1),!0);let t=this.getLiteral(r.getArg(e,0)),n=this.getLiteral(r.getArg(e,1));this.mkClause([t,L(n)],null,0),this.mkClause([L(t),n],null,0);break}default:{for(let t=0;t<r.getNumArgs(e);t++){let n=r.getArg(e,t);this.internalizeRec(n,!0)}let t=this.getLiteral(r.getArg(e,0));this.mkClause([L(t),this.getLiteral(r.getArg(e,1))],null,0),this.mkClause([t,this.getLiteral(r.getArg(e,2))],null,0),this.addIteRelWatches(e)}}this.markAsRelevant(e)}else{this.internalizeRec(e,!0);let t=this.getLiteral(e);t===this.falseLiteral?this.setConflict(`axiom`,null):t!==this.trueLiteral&&(this.assign(t,`axiom`),this.markLiteralAsRelevant(t))}this.generation=n}internalize(e,t,n=this.generation){let r=this.generation;this.generation=n,this.internalizeDeep(e),this.internalizeRec(e,t),this.generation=r}internalizeRec(e,t){this.manager.sorts[e]===0?this.internalizeFormula(e,t):this.internalizeTerm(e)}internalizeFormula(e,t){let n=this.manager;if(e!==n.trueExpr&&e!==n.falseExpr){if(n.isNot(e)&&t)this.internalizeRec(n.getArg(e,0),!0);else if(this.isBInternalized(e)){let r=this.getBoolVar(e),i=this.exprToEnode[e];i!==void 0&&this.updateGeneration(i),!t&&n.kinds[e]===0&&(i===void 0?(this.mkEnode(e,!0,!0,!1),this.setEnodeFlag(r,!1),this.assignment[I(r)]!==0&&this.propagateBoolVarEnode(r)):this.setMergeTf(i,r,!1))}else if(n.getOp(e)===2&&!n.isBool(n.getArg(e,0)))this.internalizeEq(e,t);else if(n.kinds[e]===0&&this.internalizeTheoryAtom(e,t))return;else n.kinds[e]===2?this.internalizeQuantifier(e):this.internalizeFormulaCore(e,t)}}internalizeEq(e,t){this.internalizeFormulaCore(e,t);let n=this.getBoolVar(e);this.setBoolVarFlag(n,Vg,!0),this.manager.sorts[this.manager.getArg(e,0)]!==0&&this.isArithSort(e)&&this.theory.internalizeEqEh(e)}isArithSort(e){return Um(this.manager.sorts[this.manager.getArg(e,0)])}internalizeTheoryAtom(e,t){if(this.manager.getFamily(e)!==1||!this.theory.internalizeAtom(e))return!1;let n=this.getBoolVar(e);if(!t){let t=this.exprToEnode[e];t===void 0?this.mkEnode(e,!0,!0,!1):(this.setEnodeFlag(n,!0),this.setMergeTf(t,n,!0))}return this.exprToEnode[e]!==void 0&&(this.setEnodeFlag(n,!0),this.assignment[I(n)]!==0&&this.propagateBoolVarEnode(n)),!0}internalizeQuantifier(e){let t=this.mkBoolVar(e),n=this.cachedGeneration.get(e)??this.generation;this.setBoolVarFlag(t,1073741824,!0),this.qmanager.add(e,n)}internalizeFormulaCore(e,t){let n=this.manager,r=n.getOp(e),i=this.isGate(e)||r===8;for(let t=0;t<n.getNumArgs(e);t++){let r=n.getArg(e,t);this.internalizeRec(r,i)}let a=!this.isBInternalized(e),o=a?this.mkBoolVar(e):this.getBoolVar(e),s=this.exprToEnode[e];if(s===void 0&&(!t||!i&&n.getNumArgs(e)>0)?(this.mkEnode(e,i,!t,!0),this.setEnodeFlag(o,a)):!t&&s!==void 0&&this.setMergeTf(s,o,a),!a||n.getFamily(e)!==0)return;let c=I(o);switch(r){case 8:{let t=this.getLiteral(n.getArg(e,0));this.mkGateClause(L(c),L(t)),this.mkGateClause(c,t);break}case 5:{let t=this.gateBuffer;N(t,0),t.push(c);for(let r=0;r<n.getNumArgs(e);r++){let i=n.getArg(e,r),a=this.getLiteral(i);this.mkGateClause(L(c),a),t.push(L(a))}this.mkClause(t,null,0),this.addAndRelWatches(e);break}case 6:{let t=this.gateBuffer;N(t,0),t.push(L(c));for(let r=0;r<n.getNumArgs(e);r++){let i=n.getArg(e,r),a=this.getLiteral(i);this.mkGateClause(c,L(a)),t.push(a)}this.mkClause(t,null,0),this.addOrRelWatches(e);break}case 9:{let t=this.getLiteral(n.getArg(e,0)),r=this.getLiteral(n.getArg(e,1));this.mkGateClause(c,t),this.mkGateClause(c,L(r)),this.mkGateClause(L(c),L(t),r);break}case 2:case 7:{if(r===2&&!n.isBool(n.getArg(e,0)))break;let t=r===7?L(c):c,i=this.getLiteral(n.getArg(e,0)),a=this.getLiteral(n.getArg(e,1));this.mkGateClause(L(t),i,L(a)),this.mkGateClause(L(t),L(i),a),this.mkGateClause(t,i,a),this.mkGateClause(t,L(i),L(a));break}case 4:{let t=this.getLiteral(n.getArg(e,0)),r=this.getLiteral(n.getArg(e,1)),i=this.getLiteral(n.getArg(e,2));this.mkGateClause(L(c),L(t),r),this.mkGateClause(L(c),t,i),this.mkGateClause(c,L(t),L(r)),this.mkGateClause(c,t,L(i)),this.addIteRelWatches(e);break}}}mkGateClause(e,t,n){let r=this.gateLiterals;N(r,0),r.push(e,t),n!==void 0&&r.push(n),this.mkClause(r,null,0)}internalizeTerm(e){let t=this.manager,n=this.exprToEnode[e];if(n!==void 0)this.updateGeneration(n),t.getFamily(e)===1&&!this.theory.isAttachedToVar(n)&&this.theory.internalizeTerm(e);else if(t.getOp(e)===4)this.internalizeIteTerm(e);else if(!(t.getFamily(e)===1&&this.theory.internalizeTerm(e))){for(let n=0;n<t.getNumArgs(e);n++){let r=t.getArg(e,n);this.internalizeRec(r,!1)}this.exprToEnode[e]===void 0&&this.mkEnode(e,!1,!1,!0)}}mkEqAtom(e,t){let n=this.manager.ids;return n[e]<n[t]?this.manager.mkEq(e,t):this.manager.mkEq(t,e)}internalizeIteTerm(e){let t=this.mkEqAtom(e,this.manager.getArg(e,1)),n=this.mkEqAtom(e,this.manager.getArg(e,2));this.mkEnode(e,!0,!1,!1),this.internalizeRec(this.manager.getArg(e,0),!0),this.internalizeRec(this.manager.getArg(e,1),!1),this.internalizeRec(this.manager.getArg(e,2),!1),this.internalizeRec(t,!0),this.internalizeRec(n,!0);let r=this.getLiteral(this.manager.getArg(e,0));this.mkClause([L(r),this.getLiteral(t)],null,0),this.mkClause([r,this.getLiteral(n)],null,0);let i=()=>{if(!this.isRelevant(e))return;this.relevancy.markAsRelevant(this.manager.getArg(e,0));let r=this.findAssignment(this.manager.getArg(e,0));r<0?this.relevancy.markAsRelevant(n):r>0&&this.relevancy.markAsRelevant(t)};this.addRelWatch(r,i),this.addRelWatch(L(r),i),this.relevancy.addHandler(e,i)}addRelWatch(e,t){this.relevancy.addWatch(this.boolVar2Expr[R(e)],!jg(e),t)}addAndRelWatches(e){let t=()=>{this.isRelevant(e)&&this.relevancy.propagateAnd(e)};for(let n=0;n<this.manager.getNumArgs(e);n++){let r=this.manager.getArg(e,n),i=this.getLiteral(r);i>1&&this.addRelWatch(L(i),t)}}addOrRelWatches(e){let t=()=>{this.isRelevant(e)&&this.relevancy.propagateOr(e)};for(let n=0;n<this.manager.getNumArgs(e);n++){let r=this.manager.getArg(e,n),i=this.getLiteral(r);i>1&&this.addRelWatch(i,t)}}addIteRelWatches(e){let t=()=>{this.isRelevant(e)&&this.relevancy.propagateIte(e)},n=this.getLiteral(this.manager.getArg(e,0));n<=1||(this.addRelWatch(n,t),this.addRelWatch(L(n),t))}mkThAxiom(e){this.mkClause(e,null,2)}simplifyAuxClauseLiterals(e,t){qh(e);let n=null,r=0;for(let i of e){let a=this.assignment[i];if(a===-1)i!==n&&(n=i,t.push(L(i)));else if(a===0){if(n!==null&&i===L(n))return!1;i!==n&&(n=i,e[r++]=i)}else return!1}return N(e,r),!0}simplifyAuxLemmaLiterals(e){qh(e);let t=null,n=0;for(let r of e){if(this.getLevel(R(r))<=this.baseLevel&&this.assignment[r]===1||t!==null&&r===L(t))return!1;r!==t&&(t=r,e[n++]=r)}return N(e,n),!0}selectWatchLiteral(e,t){let n=this.clauses,r=-1,i=-1,a=-1;for(let o=t;o<n.getNumLiterals(e);o++){let t=n.getLiteral(e,o),s=this.assignment[t];s===-1?(i===-1||this.getLevel(R(t))>this.getLevel(R(n.getLiteral(e,i))))&&(i=o):s===0?a=o:(r===-1||this.getLevel(R(t))<this.getLevel(R(n.getLiteral(e,r))))&&(r=o)}return r===-1?a===-1?i:a:r}selectLearnedWatchLiteral(e){let t=this.clauses,n=-1,r=0;for(let i=1;i<t.getNumLiterals(e);i++){let a=t.getLiteral(e,i),o=this.assignment[a]===-1?this.getLevel(R(a)):this.scopeLevel;(n===-1||o>r)&&(n=i,r=o)}return n}addWatchLiteral(e,t){this.addWatch(L(this.clauses.getLiteral(e,t)),e)}addWatch(e,t){let n=this.watches[e];n===void 0?this.watches[e]=[t]:n.push(t)}removeWatchLiteral(e,t){let n=this.watches[L(this.clauses.getLiteral(e,t))];if(n===void 0)return;let r=n.lastIndexOf(e);r!==-1&&(n.copyWithin(r,r+1),n.pop())}getBinJustification(e){let t=this.binJustifications[e];if(t!==void 0)return t;let n=new bg(e);return this.binJustifications[e]=n,n}isUsingBinaryClauseOpt(e,t,n){return n&&this.relevancy.isEnabled||this.baseLevel>0||!n&&this.scopeLevel>0?!1:this.getInternLevel(R(e))===0&&this.getInternLevel(R(t))===0}getMaxIscopeLevel(e){let t=0;for(let n of e)t=Math.max(t,this.getInternLevel(R(n)));return t}markForReinit(e,t,n){for(this.clauses.setReinit(e,!0),this.clauses.setReinternalizeAtoms(e,n);this.clausesToReinit.length<=t;)this.clausesToReinit.push([]);this.clausesToReinit[t].push(e)}mkClause(e,t,n,r=null){let i=e,a=t;if(n===3){if(!this.simplifyAuxLemmaLiterals(i))return null}else if(n!==1){let e=this.removedLiterals;if(N(e,0),!this.simplifyAuxClauseLiterals(i,e))return null;e.length>0&&(a=new ug(a,e.slice()))}if(i.length===0)return this.setConflict(a??`axiom`,null),null;if(i.length===1)return this.assign(i[0],a??`axiom`),null;let o=n===1||n===3;if(i.length===2&&this.isUsingBinaryClauseOpt(i[0],i[1],o)){let e=i[0],t=i[1];return(this.binaryWatches[L(e)]??=[]).push(t),(this.binaryWatches[L(t)]??=[]).push(e),this.assignment[e]===-1?this.assign(t,this.getBinJustification(L(e))):this.assignment[t]===-1&&this.assign(e,this.getBinJustification(L(t))),null}let s=o?this.getMaxIscopeLevel(i):0,c=o&&s>this.baseLevel,l=c?i.map(e=>this.boolVar2Expr[R(e)]):null;for(let e of l??[])this.manager.incRef(e);let u=this.clauses,d=u.mk(i,n,a,r,l);if(o){n===1?u.swapLiterals(d,1,this.selectLearnedWatchLiteral(d)):(u.swapLiterals(d,0,this.selectWatchLiteral(d,0)),u.swapLiterals(d,1,this.selectWatchLiteral(d,1))),this.lemmas.push(d),this.addWatchLiteral(d,0),this.addWatchLiteral(d,1);let e=u.getLiteral(d,0),t=u.getLiteral(d,1),r=this.assignment[e]===-1||this.assignment[t]===-1;this.assignment[e]===-1?this.setConflict(d,null):this.assignment[t]===-1&&this.assign(e,d);let i=n===3&&r&&this.scopeLevel>this.baseLevel;return(c||i)&&this.markForReinit(d,i?this.scopeLevel:s,c),d}return this.auxClauses.push(d),this.addWatchLiteral(d,0),this.addWatchLiteral(d,1),this.assignment[i[0]]===-1?this.setConflict(d,null):this.assignment[i[1]]===-1&&this.assign(i[0],d),d}deleteClause(e){let t=this.clauses;t.isDeleted(e)||(this.removeWatchLiteral(e,0),this.removeWatchLiteral(e,1),t.markAsDeleted(e),t.getDelEh(e)?.(),t.isReinternalizeAtoms(e)&&this.releaseAtoms(e),t.isReinit(e)||t.free(e))}releaseAtoms(e){for(let t of this.clauses.getAtoms(e))this.manager.decRef(t);this.clauses.clearAtoms(e)}deleteClauses(e,t){if(e.length-t<=1e3){for(let n=e.length-1;n>=t;n--)this.deleteClause(e[n]);N(e,t);return}this.watchMarks.length<this.watches.length&&(this.watchMarks=new Uint8Array(Math.max(2*this.watchMarks.length,this.watches.length)));let n=[],r=e=>{this.watchMarks[e]!==1&&(this.watchMarks[e]=1,n.push(e))},i=this.clauses;for(let n=e.length-1;n>=t;n--){let t=e[n];i.isDeleted(t)||(i.markAsDeleted(t),i.getDelEh(t)?.()),r(L(i.getLiteral(t,0))),r(L(i.getLiteral(t,1)))}for(let e of n){this.watchMarks[e]=0;let t=this.watches[e];if(t===void 0)continue;let n=0;for(let e=0;e<t.length;e++)i.isDeleted(t[e])||(t[n++]=t[e]);N(t,n)}for(let n=e.length-1;n>=t;n--){let t=e[n];i.isReinternalizeAtoms(t)&&this.releaseAtoms(t),i.isReinit(t)||i.free(t)}N(e,t)}},Kg=class{seed;constructor(e){this.seed=e}next(){return this.seed=Math.imul(this.seed,214013)+2531011>>>0,this.seed>>>16&32767}};const qg=/* @__PURE__ */ new Map([[23,27],[19,28],[20,29]]);var Jg=class e extends oh{model;rewriter;isModelCompletion=!1;reducedArgs=[];constructor(e,t){super(e),this.model=t,this.rewriter=new Xh(e,Yh),this.rewriter.releaseResult=()=>this.setLastResult(-1)}setModelCompletion(e){this.isModelCompletion!==e&&(this.reset(),this.isModelCompletion=e)}mkNested(){let t=new e(this.manager,this.model);return t.isModelCompletion=this.isModelCompletion,t}reduceApp(e,t,n){let r=this.manager,i=r.beginTemporaries(),a=this.reduceAppCore(e,t,n);return a!==-1&&r.incRef(typeof a==`number`?a:a.expr),r.endTemporaries(i),a}reduceAppCore(e,t,n){let r=this.manager,i=this.model,a=r.funcDecls[e].family;if(a===2){if(t.length>0){let n=this.evaluate(e,t);return n===void 0?-1:{expr:n,depth:1}}let r=i.constInterps.get(e);if(r!==void 0)return this.containsRedex(r)?{expr:r,depth:1/0}:r;if(!this.isModelCompletion)return-1;let a=i.getSomeValue(n);return i.registerConst(e,a),a}if(r.funcDecls[e].op===5){let e=this.mkArithAndCore(t);if(e!==void 0)return e}let o=this.rewriter.reduceAppCore(e,t),s=o===-1&&a===1?this.evaluatePartialTheoryFunc(e,t,n):o;if(a!==1||typeof s!=`number`||s===-1||r.kinds[s]!==0)return s;let c=this.reducedArgs;c.length=0,r.pushArgs(s,c);let l=this.evaluate(r.decls[s],c);return l===void 0?s:{expr:l,depth:1}}evaluate(e,t){let n=this.manager,r=this.model.funcInterps.get(e);if(r!==void 0&&r.entries.length!==0&&t.every(e=>n.isUniqueValue(e)))return r.getEntry(t)?.result}evaluatePartialTheoryFunc(e,t,n){let r=this.manager,i=this.model,a=r.funcDecls[e].op,o=qg.get(a),s=i.funcInterps.get(e);if(s===void 0&&o!==void 0&&!r.isNumeral(t[1])){let a=i.funcInterps.get(o)?.getInterp();if(a==null)return-1;let s=this.substitute(a,t),c=r.mkNumeralOfSort(P.zero,r.sorts[t[1]]);return r.mkApp(4,[r.mkEq(c,t[1]),s,r.mkApp(e,t,n)],n)}if(s===void 0){let e=o!==void 0&&r.getRationalValue(t[1]).isZero();if(!e&&a!==27&&a!==28&&a!==29)return-1;if(s=e?i.funcInterps.get(o):void 0,s===void 0)return r.mkNumeralOfSort(P.zero,n)}return s.isPartial()&&s.setElse(i.getSomeValue(n)),{expr:this.substitute(s.getInterp(),t),depth:1/0}}substitute(e,t){let n=new lh(this.manager,!1),r=n.apply(e,t);return n.release(),this.manager.releaseLater(r),r}containsRedex(e){let t=this.manager;if(t.kinds[e]!==0||t.getNumArgs(e)===0)return!1;let n=/* @__PURE__ */ new Set,r=[e];for(;r.length>0;){let e=r.pop();if(!n.has(e)){if(n.add(e),t.getOp(e)===2)return!0;if(t.kinds[e]===0)t.pushArgs(e,r);else if(t.kinds[e]===2){let n=t.getQuantifier(e);r.push(n.body,...n.patterns)}}}return!1}mkArithAndCore(e){let t=this.manager;if(e.length<=1||t.getOp(e[0])!==11)return;let n=t.getArg(e[0],0),r=t.getArg(e[0],1);if(!t.isNumeral(n))return;let i=e[0],a=[];for(let n of e.slice(1))t.getOp(n)===11&&t.getArg(n,1)===r&&t.isNumeral(t.getArg(n,0))?t.getRationalValue(t.getArg(n,0)).compare(t.getRationalValue(t.getArg(i,0)))>0&&(i=n):a.push(n);if(a.length!==e.length-1)return a.push(i),{expr:t.mkApp(5,a,0),depth:1}}getMacro(e){let t=this.manager,n=this.model,r=t.funcDecls[e],i=n.funcInterps.get(e);if(i!==void 0){if(i.isPartial()){if(!this.isModelCompletion)return-1;i.setElse(n.getSomeValue(r.range))}return i.getInterp()}if(!this.isModelCompletion||r.family!==2)return-1;let a=n.getSomeValue(r.range),o=new Yg(t,r.domain.length);return o.setElse(a),n.registerFunc(e,o),a}isReducingMacro(){return!0}reduceQuantifier(e,t,n){let r=new Xh(this.manager,Yh),i=r.reduceQuantifier(e,t,n);return r.release(),i}release(){this.rewriter.release(),super.release()}},Yg=class{manager;arity;entries=[];entryTable=/* @__PURE__ */ new Map;elseExpr=null;interp=null;constructor(e,t){this.manager=e,this.arity=t}isPartial(){return this.elseExpr===null}getEntry(e){return this.entryTable.get(e.join(`,`))}insertNewEntry(e,t){let n=this.manager;this.resetInterpCache(),n.incRef(t);for(let t of e)n.incRef(t);let r={args:[...e],result:t};this.entries.push(r),this.entryTable.set(e.join(`,`),r)}insertEntry(e,t){this.resetInterpCache();let n=this.getEntry(e);n===void 0?this.insertNewEntry(e,t):(this.manager.incRef(t),this.manager.decRef(n.result),n.result=t)}resetInterpCache(){this.interp!==null&&this.manager.decRef(this.interp),this.interp=null}releaseEntry(e){for(let t of e.args)this.manager.decRef(t);this.manager.decRef(e.result)}release(){for(let e of this.entries)this.releaseEntry(e);this.elseExpr!==null&&this.manager.decRef(this.elseExpr),this.resetInterpCache()}getEntryArgs(e){let t=this.manager;if(t.getOp(e)!==4)return;let n=t.getArg(e,0);if(!t.isGround(t.getArg(e,1))||this.arity===0||this.arity===1&&t.getOp(n)!==2||this.arity>1&&(t.getOp(n)!==5||t.getNumArgs(n)!==this.arity))return;let r=[];for(let e=0;e<this.arity;e++){let i=this.arity===1?n:t.getArg(n,e);if(t.getOp(i)!==2)return;let a=t.getArg(i,0),o=t.getArg(i,1);if(t.kinds[a]===1&&t.values[a]===e)r.push(o);else if(t.kinds[o]===1&&t.values[o]===e)r.push(a);else return}return r}setElse(e){if(e===this.elseExpr)return;this.resetInterpCache();let t=e;for(let e=this.getEntryArgs(t);e!==void 0;)this.getEntry(e)===void 0&&this.insertEntry(e,this.manager.getArg(t,1)),t=this.manager.getArg(t,2),e=this.getEntryArgs(t);this.manager.incRef(t),this.elseExpr!==null&&this.manager.decRef(this.elseExpr),this.elseExpr=t}isConstant(){let e=this.elseExpr;return e===null||!this.manager.isGround(e)?!1:this.entries.every(t=>t.result===e)}getMaxOccResult(){let e=/* @__PURE__ */ new Map,t=null,n=0;for(let r of this.entries){let i=(e.get(r.result)??0)+1;e.set(r.result,i),i>n&&(n=i,t=r.result)}return t}compress(){let e=this.manager,t=this.elseExpr;if(t===null||this.entries.length===0||!e.isGround(t))return;let n=this.entries.filter(e=>e.result!==t||(this.releaseEntry(e),!1));if(n.length<this.entries.length&&(this.resetInterpCache(),this.entries=n,this.entryTable=new Map(n.map(e=>[e.args.join(`,`),e]))),this.entries.length>0&&this.isIdentity()){for(let e of this.entries)this.releaseEntry(e);this.entries=[],this.entryTable.clear(),this.resetInterpCache();let n=e.mkVar(0,e.sorts[t]);e.incRef(n),e.decRef(t),this.elseExpr=n}}isIdentity(){let e=this.manager,t=this.elseExpr;if(this.arity!==1||t===null)return!1;for(let e of this.entries)if(e.args[0]!==e.result||e.result===t)return!1;return e.kinds[t]===1?!0:!e.isUniqueValue(t)||e.sorts[t]!==0?!1:this.entries.length+1===2}getInterp(){if(this.interp!==null)return this.interp;let e=this.manager,t=this.elseExpr;if(t===null)return null;let n=t,r=[];for(let i of this.entries){if(i.result===t)continue;r.length===0&&i.args.forEach((t,n)=>r.push(e.mkVar(n,e.sorts[t])));let a=e.mkAnd(i.args.map((t,n)=>e.mkEq(r[n],t)));if(e.isTrue(i.result))n=e.isFalse(n)?a:e.mkOr([a,n]);else if(e.isFalse(i.result)){let t=e.mkNot(a);n=e.isTrue(n)?t:e.mkAnd([t,n])}else i.result!==n&&(n=e.mkApp(4,[a,i.result,n],e.sorts[n]))}return e.incRef(n),this.interp=n,n}},Xg=class e{manager;constInterps;constDecls=[];funcInterps;funcDecls=[];auxDecls;values=/* @__PURE__ */ new Map;userSortValues;arithValues;nextValue=/* @__PURE__ */ new Map;finiteSorts=/* @__PURE__ */ new Set;boolRandom;evaluator;rewriter;refCount=0;constructor(e){this.manager=e,this.boolRandom=new Kg(e.getNumAsts()),this.constInterps=new km(t=>e.getDeclHash(t)),this.funcInterps=new km(t=>e.getDeclHash(t)),this.userSortValues=new F(e),this.arithValues=new F(e),this.auxDecls=new Am(t=>e.getDeclHash(t)),this.evaluator=new Jg(e,this),this.rewriter=new Xh(e,Yh)}registerConst(e,t){let n=this.constInterps.get(e);n===void 0&&this.manager.incDeclRef(e),this.manager.incRef(t),n===void 0?this.constDecls.push(e):this.manager.decRef(n),this.constInterps.set(e,t)}registerFunc(e,t){let n=this.funcInterps.get(e);n===void 0&&(this.funcDecls.push(e),this.manager.incDeclRef(e)),this.funcInterps.set(e,t),n?.release()}registerAuxDecl(e,t){t!==void 0&&this.registerFunc(e,t),this.auxDecls.add(e)}reregisterDecl(e,t,n){let r=this.funcInterps.get(e);r===void 0?this.registerFunc(e,t):(this.registerFunc(n,r),this.auxDecls.add(n),this.funcInterps.set(e,t))}eval(e,t){return this.evaluator.setModelCompletion(t),this.evaluator.rewrite(e)}getValueSet(e){let t=this.values.get(e);if(t!==void 0)return t;let n=new Am(e=>this.manager.hashes[e]);return this.values.set(e,n),n}mkIndexedValue(e,t){return Um(t)?this.manager.mkNumeralOfSort(P.of(BigInt(e)),t):this.manager.mkModelValue(e,t)}addValue(e,t){let n=this.getValueSet(e);n.has(t)||((Um(e)?this.arithValues:this.userSortValues).push(t),n.add(t))}mkValue(e,t){let n=this.mkIndexedValue(e,t);return this.addValue(t,n),n}registerValue(e){let t=this.manager.sorts[e];t!==0&&this.addValue(t,e)}getSomeValue(e){let t=this.manager;if(e===0)return this.boolRandom.next()%2==0?t.falseExpr:t.trueExpr;let n=this.values.get(e);if(this.finiteSorts.has(e)&&n!==void 0){let e=new Kg(t.getNumAsts()),r=1,i=t.falseExpr;for(let t of n)if(e.next()%r++===0&&(i=t),r>10)break;return i}return n!==void 0&&n.size>0?n[Symbol.iterator]().next().value??this.mkValue(0,e):this.mkValue(0,e)}getFreshValue(e){if(e===0||this.finiteSorts.has(e))return null;let t=this.getValueSet(e),n=this.nextValue.get(e)??0;for(;;){let r=this.mkIndexedValue(n,e);if(n++,!t.has(r))return this.addValue(e,r),this.nextValue.set(e,n),r}}freezeUniverse(e){if(this.finiteSorts.has(e))return;let t=this.values.get(e);(t===void 0||t.size===0)&&this.getSomeValue(e),this.finiteSorts.add(e)}isFinite(e){return this.manager.isUninterpretedSort(e)&&this.finiteSorts.has(e)}getKnownUniverse(e){return[...this.values.get(e)??[]]}compress(){for(let e of this.funcDecls)this.funcInterps.get(e)?.compress()}completePartialFunc(e,t){let n=this.funcInterps.get(e);if(n===void 0||!n.isPartial())return;let r=this.manager.funcDecls[e].range,i=t?this.getFreshValue(r):null;n.setElse(i??n.getMaxOccResult()??this.getSomeValue(r))}completePartialFuncs(e){for(let t=0;t<this.funcDecls.length;t++)this.completePartialFunc(this.funcDecls[t],e)}cleanupExpr(e,t,n){let r=this.manager;e.reset();let i=/* @__PURE__ */ new Map,a=[t];for(;a.length>0;){let t=a[a.length-1];if(r.isUninterpretedConst(t)){a.pop();let e=r.decls[t],n=this.constInterps.get(e),o=n??this.getSomeValue(r.sorts[t]);n===void 0&&this.registerConst(e,o),i.set(t,o);continue}if(r.kinds[t]!==0||r.getNumArgs(t)===0){a.pop(),i.set(t,t);continue}let o=a.length;for(let e=0;e<r.getNumArgs(t);e++){let n=r.getArg(t,e);i.has(n)||a.push(n)}if(a.length>o)continue;a.pop();let s=r.decls[t];this.auxDecls.has(s)&&n.add(s);let c=r.withTemporaries(()=>this.rewriter.mkApp(s,r.mapArgs(t,e=>i.get(e)??e),r.sorts[t]));c===t?r.decRef(c):e.pushOwned(c),i.set(t,c)}return i.get(t)??t}cleanup(){let e=this.manager,t=new Am(t=>e.getDeclHash(t)),n=new F(e),r=Array.from(this.funcInterps,e=>e[1]);for(let e of r)e.elseExpr!==null&&e.setElse(this.cleanupExpr(n,e.elseExpr,t));for(let e=0;e<this.constDecls.length;e++){let r=this.constDecls[e],i=this.constInterps.get(r),a=this.cleanupExpr(n,i,t);a!==i&&this.registerConst(r,a)}if(t.size!==this.auxDecls.size){this.funcDecls=this.funcDecls.filter(e=>!this.auxDecls.has(e)||t.has(e));for(let e of this.auxDecls)t.has(e)||this.unregisterDecl(e);this.auxDecls=t}n.reset()}unregisterDecl(e){let t=this.constInterps.get(e);if(t!==void 0){let n=this.constDecls.indexOf(e);this.constDecls[n]=this.constDecls[this.constDecls.length-1],this.constDecls.pop(),this.constInterps.delete(e),this.manager.decDeclRef(e),this.manager.decRef(t);return}let n=this.funcInterps.get(e);if(n===void 0)return;this.funcInterps.delete(e);let r=this.funcDecls.indexOf(e);r!==-1&&this.funcDecls.splice(r,1),this.manager.decDeclRef(e),n.release()}incRef(){this.refCount++}decRef(){this.refCount--,this.refCount===0&&this.release()}release(){this.rewriter.release(),this.evaluator.release(),this.userSortValues.reset(),this.arithValues.reset();for(let e of this.constInterps)this.manager.decDeclRef(e[0]),this.manager.decRef(e[1]);for(let e of this.funcInterps)this.manager.decDeclRef(e[0]),e[1].release()}mkModel(){let t=new e(this.manager);for(let e of this.constInterps)t.registerConst(e[0],e[1]);for(let e of this.funcInterps)t.registerFunc(e[0],e[1]),this.manager.decDeclRef(e[0]);this.funcInterps.clear(),this.funcDecls=[];for(let e of this.values)if(!Um(e[0]))for(let n of e[1])t.registerValue(n);return t}getSomeConstInterp(e){return this.constInterps.get(e)??this.getSomeValue(this.manager.funcDecls[e].range)}areEqual(e,t){return e===t}};const Zg=e=>e.family===2||e.family===3||e.op===27||e.op===28||e.op===29,Qg=e=>{let t=e.manager,n=new Xg(t);e.theory?.initModel(n);for(let r of e.enodes)r.root===r&&e.isRelevant(r.owner)&&t.isModelValue(r.owner)&&n.registerValue(r.owner);for(let r=0;r<e.numBoolVars;r++){let i=e.boolVar2Expr[r];t.isUninterpretedConst(i)&&e.isRelevant(i)&&n.registerConst(t.decls[i],e.findAssignment(i)>0?t.trueExpr:t.falseExpr)}let r=/* @__PURE__ */ new Map,i=[];for(let a of e.enodes){if(a.root!==a)continue;let o=a.owner;if(!e.isRelevant(o)&&!t.isUniqueValue(o))continue;let s=t.sorts[o];if(s===0)r.set(a,e.findAssignment(o)>0?t.trueExpr:t.falseExpr);else if(t.isUniqueValue(o)&&!Um(s))r.set(a,o);else if(Um(s)){let t=e.theory?.mkValue(a);t===void 0?i.push(a):r.set(a,t)}else r.set(a,n.getFreshValue(s)??n.getSomeValue(s))}for(let e of r.values())n.registerValue(e);for(let e of i){let i=t.sorts[e.owner];r.set(e,n.getFreshValue(i)??n.getSomeValue(i))}let a=e=>r.get(e.root)??n.getSomeValue(t.sorts[e.owner]);for(let r of e.enodes)t.isUninterpretedConst(r.owner)&&e.isRelevant(r.owner)&&n.registerConst(t.decls[r.owner],a(r));for(let r of e.enodes){let i=r.owner;if(!e.isRelevant(i)||!Zg(t.funcDecls[r.decl]))continue;if(r.numArgs===0){n.registerConst(r.decl,a(r));continue}if(r.cg!==r)continue;let o=n.funcInterps.get(r.decl);o===void 0&&(o=new Yg(t,r.numArgs),n.registerFunc(r.decl,o));let s=Array.from({length:r.numArgs},(e,t)=>a(r.getArg(t)));o.getEntry(s)===void 0&&o.insertNewEntry(s,a(r))}return{model:n,root2value:r}},$g=e=>({op:e,next:null,numArgs:0,reg:0,reg2:0,oreg:0,label:-1,enode:null,lblLow:0,lblHigh:0,alt:null,quantifier:-1,regs:[],joints:[]}),e_=(e,t,n)=>!!((n<32?e:t)&1<<n),t_=e=>{let t=0;for(let n=e;n!==0;n&=n-1)t++;return t},n_=(e,t)=>{t<32?e.lblLow|=1<<t:e.lblHigh|=1<<t},r_=(e,t,n,r)=>{let i=$g(e);return i.reg=t,i.lblLow=n,i.lblHigh=r,i},i_=(e,t,n)=>{let r=r_(e,t,0,0);return n_(r,n),r},a_=(e,t)=>{let n=$g(3);return n.reg=e,n.reg2=t,n},o_=(e,t)=>{let n=$g(4);return n.reg=e,n.enode=t,n},s_=e=>{let t=$g(8);return t.alt=e,t},c_=e=>{let t=$g(0);return t.numArgs=e,t};var l_=class{manager;context;hasher;registers=[];todo=[];aux=[];vars=[];quantifier=-1;patterns=[];tree={rootLabel:-1,numArgs:0,isFilteringCandidates:!1,numRegs:0,numChoices:0,root:c_(0),candidates:[],candidateGcThreshold:0};numChoices=0;isTmpTree=!1;isMpAlreadyProcessed=[];matchedExprs=/* @__PURE__ */ new Map;marks=[];toReset=[];compatible=[];incompatible=[];seq=[];constructor(e,t,n){this.manager=e,this.context=t,this.hasher=n}getRegister(e){return this.registers[e]??-1}getMark(e){return this.marks[e]??0}setMark(e,t){this.marks[e]=t}isApp(e){return e!==-1&&this.manager.kinds[e]!==1}init(e,t,n,r){let i=this.manager;this.tree=e,this.quantifier=t,this.patterns=n,this.numChoices=0,this.todo=[],this.registers.fill(-1);let a=n[r];for(let e=0;e<i.getNumArgs(a);e++)this.registers[e+1]=i.getArg(a,e),this.todo.push(e+1);let o=i.getQuantifier(t).sorts.length;for(;this.vars.length<o;)this.vars.push(-1);this.vars.fill(-1,0,o)}isAllArgsBoundVars(e){let t=this.manager;return t.everyArg(e,e=>t.kinds[e]===1&&this.vars[t.values[e]]!==-1)}getStats(e){let t=this.manager,n=0,r=0,i=e=>{if(n++,!t.isGround(e))for(let a=0;a<t.getNumArgs(e);a++){let o=t.getArg(e,a);t.kinds[o]===1?(n++,this.vars[t.values[o]]===-1&&r++):i(o)}};return i(e),{size:n,numUnboundVars:r}}lineariseCore(){let e=this.manager,t=this.hasher;this.aux.length=0;let n=-1,r=0,i=0,a=0;for(let o of this.todo){let s=this.registers[o];if(e.kinds[s]===1){let t=e.values[s];this.vars[t]===-1?this.vars[t]=o:this.seq.push(a_(this.vars[t],o));continue}if(e.isGround(s)){this.seq.push(o_(o,t.getGroundEnode(s,this.quantifier))),this.setMark(o,0);continue}let c=this.matchedExprs.get(s);if(c!==void 0&&o!==c)this.seq.push(a_(c,o)),this.setMark(o,0);else if(this.matchedExprs.set(s,o),this.getMark(o)!==2&&(this.seq.push(i_(5,o,t.getLabelHash(e.decls[s]))),this.setMark(o,2)),n===-1){n=s,r=o;let e=this.getStats(s);i=e.size,a=e.numUnboundVars}else if(a===0)this.aux.push(o);else{let e=this.getStats(s);e.numUnboundVars===0||e.size>i||e.size===i&&e.numUnboundVars<a?(this.aux.push(r),n=s,r=o,i=e.size,a=e.numUnboundVars):this.aux.push(o)}}if(n!==-1){let t=e.decls[n],i=e.getNumArgs(n);if(this.isAllArgsBoundVars(n)){let a=$g(13);a.label=t,a.reg=r,a.numArgs=i,a.regs=e.mapArgs(n,t=>this.vars[e.values[t]]),this.seq.push(a)}else{let a=this.tree.numRegs;this.tree.numRegs+=i;for(let t=0;t<i;t++)this.registers[a+t]=e.getArg(n,t),this.aux.push(a+t);let o=$g(1);o.label=t,o.numArgs=i,o.reg=r,o.oreg=a,this.seq.push(o),this.numChoices++}this.setMark(r,0)}let o=this.todo;this.todo=this.aux,this.aux=o}getNumBoundVars(e){let t=this.manager,n=0,r=!1,i=e=>{if(!t.isGround(e))for(let a=0;a<t.getNumArgs(e);a++){let o=t.getArg(e,a);t.kinds[o]===1?this.vars[t.values[o]]===-1?r=!0:n++:i(o)}};return i(e),{count:n,hasUnboundVars:r}}genMpFilter(e){let t=this.manager;if(t.isGround(e)){let t=this.tree.numRegs;this.tree.numRegs+=1;let n=$g(11);return n.oreg=t,n.enode=this.hasher.getGroundEnode(e,this.quantifier),this.seq.push(n),t}let n=t.mapArgs(e,e=>t.kinds[e]===1?this.vars[t.values[e]]:this.genMpFilter(e)),r=this.tree.numRegs;this.tree.numRegs+=1;let i=$g(12);return i.label=t.decls[e],i.numArgs=n.length,i.oreg=r,i.regs=n,n_(i,this.hasher.getLabelHash(i.label)),this.seq.push(i),r}lineariseMultiPattern(){let e=this.manager,t=this.patterns;for(let n=1;n<t.length;n++){let n=-1,r=0,i=0,a=!1;for(let e=0;e<t.length;e++){if(this.isMpAlreadyProcessed[e])continue;let o=t[e],s=this.getNumBoundVars(o);if(!s.hasUnboundVars){n=o,i=e,a=!0;break}(n===-1||s.count>r)&&(n=o,r=s.count,i=e)}if(n===-1)continue;if(this.isMpAlreadyProcessed[i]=!0,a){this.genMpFilter(n);continue}let o=this.tree.numRegs;this.tree.numRegs+=e.getNumArgs(n);let s=!1;for(let t=0;t<e.getNumArgs(n);t++){let r=e.getArg(n,t);this.registers[o+t]=r,this.todo.push(o+t),(e.kinds[r]===1&&this.vars[e.values[r]]>=0||e.kinds[r]!==1&&e.isGround(r))&&(s=!0)}let c=()=>({kind:0,enode:null,reg:0,decl:-1,argPos:0}),l=e.mapArgs(n,t=>{if(s){if(e.kinds[t]===1){let n=this.vars[e.values[t]];return n>=0?{...c(),kind:2,reg:n}:c()}return e.isGround(t)?{...c(),kind:1,enode:this.hasher.getGroundEnode(t,this.quantifier)}:c()}if(e.kinds[t]===1)return c();let n=-1;for(let r=0;r<e.getNumArgs(t)&&n===-1;r++){let i=e.getArg(t,r);e.kinds[i]===1&&this.vars[e.values[i]]>=0&&(n=r)}return n===-1?c():{kind:3,enode:null,reg:this.vars[e.values[e.getArg(t,n)]],decl:e.decls[t],argPos:n}}),u=$g(10);for(u.label=e.decls[n],u.numArgs=e.getNumArgs(n),u.oreg=o,u.joints=l,n_(u,this.hasher.getLabelHash(u.label)),this.seq.push(u),this.numChoices++;this.todo.length>0;)this.lineariseCore()}}linearise(e,t){for(this.seq=[],this.matchedExprs.clear();this.todo.length>0;)this.lineariseCore();this.patterns.length>1&&(this.isMpAlreadyProcessed=this.patterns.map((e,n)=>n===t),this.lineariseMultiPattern());let n=this.manager.getQuantifier(this.quantifier).sorts.length;for(let e=0;e<n;e++)if(this.vars[e]===-1)return;let r=$g(2);r.quantifier=this.quantifier,r.numArgs=n,r.regs=this.vars.slice(0,n),this.seq.push(r);let i=e;for(let e of this.seq)i.next=e,i=e}setNext(e,t){if(!this.isTmpTree){let t=e.next;this.context.pushTrail(()=>{e.next=t})}e.next=t}findBestChild(e){let t=0,n=null,r=0;for(let i=e;i!==null;i=i.alt){let e=this.getCompatibilityMeasure(i);if(e.isSimple&&(t++,t>64))return null;e.weight>r&&(n=i,r=e.weight)}return n}isBindCompatible(e){let t=this.manager,n=this.getRegister(e.reg);return this.isApp(n)&&!t.isGround(n)&&t.decls[n]===e.label&&t.getNumArgs(n)===e.numArgs}isCompareCompatible(e){let t=this.getRegister(e.reg);return t!==-1&&t===this.getRegister(e.reg2)}isCheckCompatible(e){let t=this.getRegister(e.reg);if(!this.isApp(t)||!this.manager.isGround(t))return!1;let n=this.hasher.getGroundEnode(t,this.quantifier);return e.enode!==null&&n!==null&&e.enode.root===n.root}getPatLblHash(e){let t=this.registers[e];if(this.manager.isGround(t)){let e=this.hasher.getGroundEnode(t,this.quantifier);return e===null?-1:this.hasher.getLblHash(e)}return this.hasher.getLabelHash(this.manager.decls[t])}isCheckSemiCompatible(e){e.enode!==null&&this.hasher.getLblHash(e.enode);let t=this.getRegister(e.reg);return t!==-1&&this.getMark(e.reg)===0&&this.manager.isGround(t)&&e.enode!==null&&this.getPatLblHash(e.reg)===e.enode.lblHash}isFilterCompatible(e){let t=this.getRegister(e.reg);return this.isApp(t)&&!this.manager.isGround(t)&&e_(e.lblLow,e.lblHigh,this.getPatLblHash(e.reg))}isCfilterCompatible(e){let t=this.getRegister(e.reg);return t!==-1&&this.manager.isGround(t)&&e_(e.lblLow,e.lblHigh,this.getPatLblHash(e.reg))}isFilterSemiCompatible(e){let t=this.getRegister(e.reg);return this.getMark(e.reg)===0&&this.isApp(t)&&!this.manager.isGround(t)}getCompatibilityMeasure(e){let t=this.manager;this.toReset.length=0;let n=0,r=0,i=e.next;for(;i!==null&&i.op!==8&&i.op!==9;){switch(r++,i.op){case 1:if(this.isBindCompatible(i)){n+=4;let e=this.registers[i.reg];for(let n=0;n<i.numArgs;n++)this.registers[i.oreg+n]=t.getArg(e,n),this.toReset.push(i.oreg+n)}break;case 3:this.isCompareCompatible(i)&&(n+=2);break;case 4:this.isCheckCompatible(i)?n+=2:this.isCheckSemiCompatible(i)&&(n+=1);break;case 6:this.isCfilterCompatible(i)&&(n+=2);break;case 5:this.isFilterCompatible(i)?n+=2:this.isFilterSemiCompatible(i)&&(n+=1)}i=i.next}let a=!(r>4||i!==null&&i.op===8);for(let e of this.toReset)this.registers[e]=-1;return{weight:n,isSimple:a}}eraseTodo(e){let t=this.todo.indexOf(e);t!==-1&&this.todo.splice(t,1)}insertAt(e,t){let n=this.manager,r=e;for(;;){let e=this.compatible,i=this.incompatible;e.length=0,i.length=0;let a=r.next,o=r;for(;a!==null&&a.op!==8&&a.op!==9;){switch(a.op){case 1:if(this.isBindCompatible(a)){this.eraseTodo(a.reg),this.setMark(a.reg,0),e.push(a);let t=this.registers[a.reg];for(let e=0;e<a.numArgs;e++)this.registers[a.oreg+e]=n.getArg(t,e),this.todo.push(a.oreg+e)}else i.push(a);break;case 4:if(this.isCheckCompatible(a))this.eraseTodo(a.reg),this.setMark(a.reg,0),e.push(a);else if(this.isCheckSemiCompatible(a)&&a.enode!==null){let t=r_(6,a.reg,0,0);n_(t,this.hasher.getLblHash(a.enode)),n_(t,this.getPatLblHash(a.reg)),this.setMark(a.reg,1),e.push(t),i.push(a)}else i.push(a);break;case 3:if(this.isCompareCompatible(a)){this.eraseTodo(a.reg2),this.setMark(a.reg2,0);let t=this.registers[a.reg];if(n.kinds[t]===1){this.eraseTodo(a.reg),this.setMark(a.reg,0);let e=n.values[t];this.vars[e]===-1&&(this.vars[e]=a.reg)}e.push(a)}else i.push(a);break;case 6:this.isCfilterCompatible(a)?(this.setMark(a.reg,2),e.push(a)):i.push(a);break;case 5:if(this.isFilterCompatible(a)){let t=t_(a.lblLow)+t_(a.lblHigh)===1;this.setMark(a.reg,t?2:1),e.push(a)}else if(this.isFilterSemiCompatible(a)){let t=this.getPatLblHash(a.reg);if(this.setMark(a.reg,1),t_(a.lblLow)+t_(a.lblHigh)>1){let n=a,r=n.lblLow,i=n.lblHigh;this.context.pushTrail(()=>{n.lblLow=r,n.lblHigh=i}),n_(n,t),e.push(a)}else{let n=r_(5,a.reg,a.lblLow,a.lblHigh);n_(n,t),e.push(n),i.push(a)}}else i.push(a);break;default:i.push(a)}o=a,a=a.next}if(i.length===0){if(a===null)return;let e=this.findBestChild(a);if(e===null){let e=s_(a);this.numChoices++,this.setNext(o,e),this.linearise(e,t);return}r=e;continue}let s=a,c=$g(9),l=s_(c);this.numChoices++;let u=r;for(let t of e)this.setNext(u,t),u=t;this.setNext(u,l),u=l;for(let e of i)u===l?u.next=e:this.setNext(u,e),u=e;this.setNext(u,s),this.linearise(c,t);return}}mkTree(e,t,n,r){let i=t[n],a=this.manager.getNumArgs(i),o={rootLabel:this.manager.decls[i],numArgs:a,isFilteringCandidates:r,numRegs:a+1,numChoices:0,root:c_(a),candidates:[],candidateGcThreshold:1e4};return this.init(o,e,t,n),this.linearise(o.root,n),o.numChoices=this.numChoices,o}insert(e,t,n,r,i){if(e.numArgs===this.manager.getNumArgs(n[r])){if(this.isTmpTree=i,!i){let t=e.numRegs;this.context.pushTrail(()=>{e.numRegs=t})}if(this.init(e,t,n,r),this.numChoices=e.numChoices,this.insertAt(e.root,r),!(this.numChoices<=e.numChoices)){if(!i){let t=e.numChoices;this.context.pushTrail(()=>{e.numChoices=t})}e.numChoices=this.numChoices}}}},u_=class{context;onMatch;registers=[];bindings=[];backtrackStack=[];top=0;maxGeneration=0;constructor(e,t){this.context=e,this.onMatch=t}updateMaxGeneration(e){this.maxGeneration=Math.max(this.maxGeneration,this.context.getGeneration(e))}pushPoint(e,t){let n=this.backtrackStack[this.top];return n===void 0&&(n={instr:e,oldMaxGeneration:t,curr:null,candidates:[],index:0,end:0},this.backtrackStack.push(n)),n.instr=e,n.oldMaxGeneration=t,this.top++,n}getNextFApp(e,t,n,r){let i=r===null?n:r.next;if(r!==null&&i===n)return null;do{if(i.decl===e&&i.isCgr()&&i.numArgs===t)return this.updateMaxGeneration(i),i;i=i.next}while(i!==n);return null}isCgr(e){let t=this.registers,n=[];for(let r of e.regs){let e=t[r];if(e==null)return!1;n.push(e.root)}let r=t[e.reg];if(r==null)return!1;let i=r;do{if(i.decl===e.label&&i.numArgs===e.numArgs&&n.every((e,t)=>i.getArg(t).root===e))return this.updateMaxGeneration(i),!0;i=i.next}while(i!==r);return!1}isRelevantParent(e,t,n,r){return e.decl===t&&n<e.numArgs&&this.context.isRelevant(e.owner)&&e.isCgr()&&e.getArg(n).root===r}getDepth1Vector(e,t,n,r){let i=e.root,a=[];for(let e of i.parents)if(this.isRelevantParent(e,t,n,i)){if(a.length+1>=r)return null;a.push(e)}return a}getDepth2Vector(e,t,n,r){let i=this.registers[e.reg];if(i==null)return null;let a=i.root;if(a.parents.length===0)return null;let o=[];for(let i of a.parents){if(!this.isRelevantParent(i,e.decl,e.argPos,a))continue;let s=i.root;for(let e of s.parents)if(this.isRelevantParent(e,t,n,s)){if(o.length+1>=r)return null;o.push(e)}}return o}hasParentLabels(e){for(let t of e.regs){let n=this.registers[t].root;if((n.plbls&e.lblLow)===0&&(n.plblsHigh&e.lblHigh)===0)return!1}return!0}getJointNode(e){return e.kind===1?e.enode:e.kind===2?this.registers[e.reg]??null:null}initContinue(e){let t=this.context,n=e.label,r=t.enodesOf(n);for(let t of e.joints){let n=this.getJointNode(t);if(n===null)continue;let r=n.root;if((r.plbls&e.lblLow)===0&&(r.plblsHigh&e.lblHigh)===0||r.parents.length===0)return null}let i=null;for(let t=0;t<e.joints.length;t++){let a=e.joints[t],o=this.getJointNode(a),s=i===null?r.length:Math.min(r.length,i.length),c=o===null?a.kind===3?this.getDepth2Vector(a,n,t,s):null:this.getDepth1Vector(o,n,t,s);if(!(c===null||c.length>=r.length||i!==null&&c.length>=i.length)){if(c.length===0)return null;i=c}}let a=i??r,o=a.length,s=0;for(;s<o;){let n=a[s];if(n.numArgs===e.numArgs&&t.isRelevant(n.owner))break;s++}if(s===o)return null;let c=this.pushPoint(e,this.maxGeneration);return c.candidates=a,c.index=s,c.end=o,this.updateMaxGeneration(a[s]),a[s]}setArgs(e,t,n){for(let r=0;r<n;r++)this.registers[e+r]=t.getArg(r)}resume(e){let t=e.instr;if(t.op===8)return this.top--,t.alt;if(t.op===1){let n=this.getNextFApp(t.label,t.numArgs,this.registers[t.reg],e.curr);return n===null?(this.top--,null):(e.curr=n,this.setArgs(t.oreg,n,t.numArgs),t.next)}let n=this.context;for(e.index++;e.index<e.end;e.index++){let r=e.candidates[e.index];if(r.numArgs===t.numArgs&&n.isRelevant(r.owner))return this.updateMaxGeneration(r),this.setArgs(t.oreg,r,t.numArgs),t.next}return this.top--,null}executeCore(e,t){let n=this.context,r=this.registers;this.maxGeneration=n.getGeneration(t),r[0]=t,this.top=0;let i=0,a=e.root;for(;;){if(a===null){if(this.top===0)return!0;let e=this.backtrackStack[this.top-1];if(this.maxGeneration=e.oldMaxGeneration,i++>100&&(i=0,n.checkCanceled()))return this.top=0,!1;a=this.resume(e);continue}let e=a;switch(a=null,e.op){case 0:{let t=r[0];if(t.numArgs!==e.numArgs)break;this.setArgs(1,t,e.numArgs),a=e.next;break}case 3:{let t=r[e.reg],n=r[e.reg2];if(t==null||n==null)break;t.root===n.root&&(a=e.next);break}case 4:{let t=r[e.reg],i=e.enode;if(t==null||i===null)break;(t.root===i.root||n.manager.getOp(i.owner)===4)&&(a=e.next);break}case 6:case 5:case 7:{let t=r[e.reg].root,n=e.op===7,i=n?t.plbls:t.lbls,o=n?t.plblsHigh:t.lblsHigh;((i&e.lblLow)!==0||(o&e.lblHigh)!==0)&&(a=e.next);break}case 8:this.pushPoint(e,this.maxGeneration),a=e.next;break;case 9:a=e.next;break;case 1:{let t=this.maxGeneration,n=this.getNextFApp(e.label,e.numArgs,r[e.reg],null);if(n===null)break;this.pushPoint(e,t).curr=n,this.setArgs(e.oreg,n,e.numArgs),a=e.next;break}case 2:{let t=e.regs.length,n=this.bindings;N(n,0);for(let i=0;i<t;i++){let a=r[e.regs[t-i-1]];n.push(a),this.updateMaxGeneration(a)}this.onMatch(e.quantifier,n,this.maxGeneration);break}case 11:r[e.oreg]=e.enode,a=e.next;break;case 12:{if(e.numArgs<=6&&!this.hasParentLabels(e))break;let t=n.findCongruent(e.label,e.regs.map(e=>r[e]));if(t===void 0||!n.isRelevant(t.owner))break;this.updateMaxGeneration(t),r[e.oreg]=t,a=e.next;break}case 13:this.isCgr(e)&&(a=e.next);break;case 10:{let t=this.initContinue(e);if(t===null)break;this.setArgs(e.oreg,t,e.numArgs),a=e.next;break}}}}execute(e){let t=this.context,n=e.isFilteringCandidates?/* @__PURE__ */ new Set:null;for(let r of e.candidates)if(!n?.has(r)&&r.isCgr()){if(t.checkCanceled()||!this.executeCore(e,r))return!1;n?.add(r)}return!0}};const d_=(e,t)=>{let n=e,r=t;for(;;){if(n.label!==r.label||n.argIndex!==r.argIndex||n.patternIndex!==r.patternIndex||n.child===null!=(r.child===null))return!1;if(n.child===null||r.child===null)return!0;n=n.child,r=r.child}};var f_=class{context;trees=/* @__PURE__ */ new Map;sharedEnodes=/* @__PURE__ */ new Set;toMatch=[];newPatterns=[];pc=/* @__PURE__ */ new Map;pp=/* @__PURE__ */ new Map;plbls=/* @__PURE__ */ new Set;clbls=/* @__PURE__ */ new Set;r1=null;r2=null;visitedParents=[];queuedRoots=[];labelHashes=[];trail=[];trailScopes=[];compiler;interpreter;constructor(e,t){this.context=e,this.compiler=new l_(e.manager,e,this),this.interpreter=new u_(e,t)}get manager(){return this.context.manager}getLabelHash(e){let t=this.labelHashes[e];if(t!==void 0)return t;let n=bm(17,3,this.manager.funcDecls[e].smallId)&63;return pm(this.labelHashes,e,n),n}setLblHash(e){let t=xm(this.manager.ids[e.owner])&63;e.lblHash=t,this.context.pushTrail(()=>{e.lblHash=-1});let n=e.root;if(e_(n.lbls,n.lblsHigh,t))return;let r=n.lbls,i=n.lblsHigh;this.context.pushTrail(()=>{n.lbls=r,n.lblsHigh=i}),t<32?n.lbls|=1<<t:n.lblsHigh|=1<<t}pushTrail(e){this.trail.push(e)}getLblHash(e){return e.lblHash===-1&&this.setLblHash(e),e.lblHash}hasWork(){return this.toMatch.length>0||this.newPatterns.length>0}updateLbls(e,t){let n=e.root;if(e_(n.lbls,n.lblsHigh,t))return;let r=n.lbls,i=n.lblsHigh;this.pushTrail(()=>{n.lbls=r,n.lblsHigh=i}),t<32?n.lbls|=1<<t:n.lblsHigh|=1<<t}updateChildrenPlbls(e,t){for(let n=0;n<e.numArgs;n++){let r=e.getArg(n).root;if(e_(r.plbls,r.plblsHigh,t))continue;let i=r.plbls,a=r.plblsHigh;this.pushTrail(()=>{r.plbls=i,r.plblsHigh=a}),t<32?r.plbls|=1<<t:r.plblsHigh|=1<<t}}updatePlbls(e){if(this.plbls.has(e))return;this.plbls.add(e),this.pushTrail(()=>this.plbls.delete(e));let t=this.getLabelHash(e);for(let n of this.context.enodesOf(e))this.context.isRelevant(n.owner)&&this.updateChildrenPlbls(n,t)}updateClbls(e){if(this.clbls.has(e))return;this.clbls.add(e),this.pushTrail(()=>this.clbls.delete(e));let t=this.getLabelHash(e);for(let n of this.context.enodesOf(e))this.context.isRelevant(n.owner)&&this.updateLbls(n,t)}mkCode(e,t){return this.compiler.mkTree(e.quantifier,e.patterns,t,!0)}mkPathTree(e,t){let n={label:e.label,argIndex:e.argIndex,groundArgIndex:e.groundArgIndex,groundArg:e.groundArg,filter:0,filterHigh:0,code:null,firstChild:null,sibling:null,todo:null},r=this.getLabelHash(e.label);return r<32?n.filter=1<<r:n.filterHigh=1<<r,e.child===null?n.code=this.mkCode(t,e.patternIndex):n.firstChild=this.mkPathTree(e.child,t),n}insertPath(e,t,n){let r=!1,i=e;for(let a=e;a!==null;a=a.sibling){if(i=a,a.label!==t.label||(r=!0,a.argIndex!==t.argIndex||a.groundArg!==t.groundArg||a.groundArgIndex!==t.groundArgIndex))continue;let e=a;t.child!==null&&e.firstChild!==null?this.insertPath(e.firstChild,t.child,n):t.child===null?e.code===null?(e.code=this.mkCode(n,t.patternIndex),this.pushTrail(()=>{e.code=null})):this.compiler.insert(e.code,n.quantifier,n.patterns,t.patternIndex,!1):(e.firstChild=this.mkPathTree(t.child,n),this.pushTrail(()=>{e.firstChild=null}));return}let a=i;if(a.sibling=this.mkPathTree(t,n),this.pushTrail(()=>{a.sibling=null}),r)return;let o=e.filter,s=e.filterHigh;this.pushTrail(()=>{e.filter=o,e.filterHigh=s});let c=this.getLabelHash(t.label);c<32?e.filter|=1<<c:e.filterHigh|=1<<c}updatePc(e,t,n,r){let i=e*64+t,a=this.pc.get(i);a===void 0?(this.pc.set(i,this.mkPathTree(n,r)),this.pushTrail(()=>this.pc.delete(i))):this.insertPath(a,n,r)}insertPpPath(e,t,n,r){let i=e[t];i===null?(e[t]=this.mkPathTree(n,r),this.pushTrail(()=>{e[t]=null})):this.insertPath(i,n,r)}updatePp(e,t,n,r,i){let a=e>t,o=a?t:e,s=a?e:t,c=a?r:n,l=a?n:r,u=o*64+s,d=this.pp.get(u);d===void 0&&(d=[null,null],this.pp.set(u,d),this.pushTrail(()=>this.pp.delete(u))),o===s?(this.insertPpPath(d,0,c,i),d_(c,l)||this.insertPpPath(d,0,l,i)):(this.insertPpPath(d,0,c,i),this.insertPpPath(d,1,l,i))}getGroundEnode(e,t){let n=this.context;return n.isEInternalized(e)||n.internalize(e,!1,n.qmanager.getGeneration(t)),n.getEnode(e)??null}updateFilters(e,t,n,r,i){let a=this.manager,o=a.getNumArgs(e),s=-1;for(let t=0;t<o&&s===-1;t++)a.isGround(a.getArg(e,t))&&(s=t);let c=s===-1?null:this.getGroundEnode(a.getArg(e,s),i.quantifier),l=a.decls[e];for(let u=0;u<o;u++){let o=a.getArg(e,u),d={label:l,argIndex:u,groundArgIndex:s===-1?0:s,groundArg:c,patternIndex:n,child:t};if(a.kinds[o]===1){let e=r[a.values[o]],t=!1;for(let n of e)d_(d,n)&&(t=!0),this.updatePlbls(n.label),this.updatePlbls(d.label),this.updatePp(this.getLabelHash(n.label),this.getLabelHash(d.label),n,d,i);t||e.push(d);continue}if(a.isGround(o)){let e=this.getGroundEnode(o,i.quantifier);if(e===null)continue;this.updatePlbls(l),this.updatePc(this.getLabelHash(l),this.getLblHash(e),d,i);continue}let f=a.decls[o];this.updatePlbls(l),this.updateClbls(f),this.updatePc(this.getLabelHash(l),this.getLabelHash(f),d,i),this.updateFilters(o,d,n,r,i)}}addPattern(e,t){let n=this.manager;if(t.every(e=>n.isGround(e))||t.some(e=>n.hasQuantifierFlags[e]))return;let r={quantifier:e,patterns:t},i=n.getQuantifier(e).sorts.length,a=Array.from({length:i},()=>[]);t.forEach((e,t)=>this.updateFilters(e,null,t,a,r)),this.collectGroundExprs(e,t),this.newPatterns.push(r),t.forEach((r,i)=>{if(n.isGround(r))return;let a=n.decls[r],o=this.trees.get(a);o===void 0?(this.trees.set(a,this.compiler.mkTree(e,t,i,!1)),this.pushTrail(()=>this.trees.delete(a))):o.numArgs===n.getNumArgs(r)&&this.compiler.insert(o,e,t,i,!1)})}collectGroundExprs(e,t){let n=this.manager,r=[];for(let i of t){if(!n.isGround(i)){r.push(i);continue}let t=this.getGroundEnode(i,e);t!==null&&(this.context.markAsRelevant(t.owner),this.addSharedEnode(t))}for(let t=r.pop();t!==void 0;t=r.pop())if(n.isGround(t)){let n=this.getGroundEnode(t,e);n!==null&&this.addSharedEnode(n)}else for(let e=0;e<n.getNumArgs(t);e++){let i=n.getArg(t,e);n.kinds[i]!==1&&r.push(i)}}addSharedEnode(e){this.sharedEnodes.has(e)||(this.sharedEnodes.add(e),this.context.pushTrail(()=>this.sharedEnodes.delete(e)))}isShared(e){return this.sharedEnodes.has(e)}addCandidateTo(e,t){e.candidates.length===0&&this.toMatch.push(e),e.candidates.push(t),!(e.candidates.length<e.candidateGcThreshold)&&(e.candidates=[...new Set(e.candidates)],2*e.candidates.length>e.candidateGcThreshold&&(e.candidateGcThreshold*=2))}relevantEh(e,t){if(e.lblHash!==-1&&this.updateLbls(e,e.lblHash),e.numArgs===0)return;let n=this.getLabelHash(e.decl);this.clbls.has(e.decl)&&this.updateLbls(e,n),this.plbls.has(e.decl)&&this.updateChildrenPlbls(e,n);let r=this.trees.get(e.decl);!t&&r!==void 0&&this.addCandidateTo(r,e)}isEqModMerge(e,t){let n=e.root,r=t.root;return n===r||n===this.r1&&r===this.r2||n===this.r2&&r===this.r1}collectParents(e,t){if(t==null)return;let n=this.context,r=[t],i=this.visitedParents,a=this.queuedRoots;t.todo=[e];for(let e=0;e<r.length;e++){let t=r[e],o=t.todo??[];t.todo=null;let s=t.filter,c=t.filterHigh;for(let e of o){let o=e.root;if((o.plbls&s)!==0||(o.plblsHigh&c)!==0)for(let e of o.parents){if(e.isEq)continue;let l=e.decl,u=e.root;if(!(!e_(s,c,this.getLabelHash(l))||e.isMarked||e.cg!==e&&this.isEqModMerge(e.cg,u)||!n.isRelevant(e.owner))){for(let n=t;n!==null;n=n.sibling){if(n.label!==l||n.argIndex>=e.numArgs||e.getArg(n.argIndex).root!==o||n.groundArg!==null&&!this.isEqModMerge(n.groundArg,e.getArg(n.groundArgIndex)))continue;n.code!==null&&this.addCandidateTo(n.code,e);let t=n.firstChild;t!==null&&(t.todo===null&&(t.todo=[],r.push(t)),u.isMarked2||t.todo.push(u))}e.isMarked=!0,i.push(e),u.isMarked2||(u.isMarked2=!0,a.push(u))}}}for(let e of i)e.isMarked=!1;for(let e of a)e.isMarked2=!1;i.length=0,a.length=0}}processPc(e,t){if(!(e.plbls===0&&e.plblsHigh===0||t.lbls===0&&t.lblsHigh===0)){for(let n=0;n<64;n++)if(e_(e.plbls,e.plblsHigh,n)){if(this.context.checkCanceled())return;for(let r=0;r<64;r++)e_(t.lbls,t.lblsHigh,r)&&this.collectParents(e,this.pc.get(n*64+r))}}}processPp(e,t){if(!(e.plbls===0&&e.plblsHigh===0||t.plbls===0&&t.plblsHigh===0)){for(let n=0;n<64;n++)if(e_(e.plbls,e.plblsHigh,n)){if(this.context.checkCanceled())return;for(let r=0;r<64;r++){if(!e_(t.plbls,t.plblsHigh,r))continue;let i=n>r,a=i?r:n,o=i?n:r,s=i?t:e,c=i?e:t,l=this.pp.get(a*64+o);l!==void 0&&(a===o?s.parents.length<=c.parents.length?this.collectParents(s,l[0]):this.collectParents(c,l[0]):s.parents.length<=c.parents.length?this.collectParents(s,l[0]):this.collectParents(c,l[1]))}}}}addEqEh(e,t){this.r1=e,this.r2=t,this.processPc(e,t),this.processPc(t,e),this.processPp(e,t),this.r1=null,this.r2=null;let n=t.lbls,r=t.lblsHigh,i=t.plbls,a=t.plblsHigh;this.pushTrail(()=>{t.lbls=n,t.lblsHigh=r,t.plbls=i,t.plblsHigh=a}),t.lbls|=e.lbls,t.lblsHigh|=e.lblsHigh,t.plbls|=e.plbls,t.plblsHigh|=e.plblsHigh}match(){for(let e of this.toMatch){if(!this.interpreter.execute(e))return;e.candidates=[]}this.toMatch=[],this.newPatterns.length>0&&this.matchNewPatterns()}matchNewPatterns(){let e=this.context,t=this.manager,n=/* @__PURE__ */ new Map;for(let r of this.newPatterns){if(e.checkCanceled())break;let i=t.decls[r.patterns[0]];if(e.enodesOf(i).length===0)continue;let a=n.get(i);a===void 0?n.set(i,this.compiler.mkTree(r.quantifier,r.patterns,0,!1)):this.compiler.insert(a,r.quantifier,r.patterns,0,!0)}for(let t of n){let n=e.enodesOf(t[0]);for(let r=0;r<n.length;r++)e.isRelevant(n[r].owner)&&this.interpreter.executeCore(t[1],n[r])}this.newPatterns=[]}rematch(){let e=this.context,t=this.manager.funcDecls,n=[...this.trees].sort((e,n)=>t[e[0]].smallId-t[n[0]].smallId);for(let t of n){let n=t[1],r=e.enodesOf(t[0]);for(let t=0;t<r.length;t++)e.isRelevant(r[t].owner)&&this.interpreter.executeCore(n,r[t])}}pushScope(){this.trailScopes.push(this.trail.length)}popScope(e){for(let e of this.toMatch)e.candidates=[];this.toMatch=[],this.newPatterns=[];let t=this.trailScopes[this.trailScopes.length-e];for(let e=this.trail.length-1;e>=t;e--)this.trail[e]();N(this.trail,t),N(this.trailScopes,this.trailScopes.length-e)}},p_=class{manager;quantifiers=[];hashes=[];roots=[];slots=(/* @__PURE__ */ new Int32Array(1024)).fill(-1);scopes=[];bindingHashes=[];bindingRoots=[];constructor(e){this.manager=e}insert(e,t){let n=this.manager,r=this.bindingHashes;N(r,0);for(let e of t)r.push(n.hashes[e.owner]);let i=Em(r,n.ids[e]);if(this.find(e,i,t)===-1)return null;let a=this.bindingRoots;N(a,0);for(let e of t)a.push(e.root);let o=this.find(e,i,a);if(o===-1)return null;let s=a.slice();if(this.quantifiers.push(e),this.hashes.push(i),this.roots.push(s),2*this.quantifiers.length<=this.slots.length)this.slots[o]=this.quantifiers.length-1;else{this.slots=new Int32Array(2*this.slots.length).fill(-1);for(let e=0;e<this.quantifiers.length;e++)this.place(e)}return s}find(e,t,n){let r=this.slots.length-1,i=t&r;for(;this.slots[i]!==-1;i=i+1&r){let r=this.slots[i];if(this.hashes[r]!==t||this.quantifiers[r]!==e)continue;let a=this.roots[r],o=0;for(;o<n.length&&a[o]===n[o];)o++;if(o===n.length)return-1}return i}place(e){let t=this.slots.length-1,n=this.hashes[e]&t;for(;this.slots[n]!==-1;)n=n+1&t;this.slots[n]=e}push(){this.scopes.push(this.quantifiers.length)}pop(e){let t=this.scopes[this.scopes.length-e],n=this.slots.length-1;for(let e=this.quantifiers.length-1;e>=t;e--){let t=this.hashes[e]&n;for(;this.slots[t]!==e;)t=t+1&n;this.slots[t]=-1}N(this.quantifiers,t),N(this.hashes,t),N(this.roots,t),N(this.scopes,this.scopes.length-e)}},m_=class{manager;context;asserted;polyQhead=0;polyAssumption=-1;constructor(e){this.manager=e,this.asserted=new eg(e),this.context=new iw(e,{isMbqi:!0,relevancyLevel:0}),this.context.setupContext()}push(){this.context.push(),this.asserted.push()}pop(){this.context.pop(1),this.asserted.pop(),this.polyQhead=0}assert(e){this.context.popToBaseLevel(),this.asserted.assertExpr(e)}check(){let e=this.context;e.popToBaseLevel(),e.internalizeAssertions(this.asserted);let t=this.manager,n=this.asserted.getNumFormulas(),r=n!==this.polyQhead;if(this.polyQhead=n,r){let e=t.mkFreshConst(`poly`,0);t.incRef(e),this.polyAssumption!==-1&&t.decRef(this.polyAssumption),this.polyAssumption=e}e.initAssumptions(r?[this.polyAssumption]:[]);let i=e.search();return i===1?e.getModel():i===-1?`unsat`:`unknown`}},h_=class{context;modelFinder;qmanager;maxCexs=1;iterationIndex=0;newInstances=[];pinnedExprs;root2value=/* @__PURE__ */ new Map;value2expr=null;freshExprs=[];aux=null;constructor(e,t,n){this.context=e,this.modelFinder=t,this.qmanager=n,this.pinnedExprs=new F(e.manager)}get manager(){return this.context.manager}getValue2expr(){if(this.value2expr!==null)return this.value2expr;let e=/* @__PURE__ */ new Map;for(let t of this.root2value){let n=this.getEqEnodeWithMinGen(t[0]);this.manager.isUniqueValue(n.owner)||e.set(t[1],n.owner)}return this.value2expr=e,e}getEqEnodeWithMinGen(e){let t=this.context,n=e,r=t.getGeneration(e),i=e;do{let e=t.getGeneration(i);if(e===0)return i;e<r&&(n=i,r=e),i=i.next}while(i!==e);return n}getTypeCompatibleTerm(e){let t=this.manager,n;if(t.kinds[e]===0&&t.getNumArgs(e)>0)n=t.mkApp(t.decls[e],t.mapArgs(e,e=>this.getTypeCompatibleTerm(e)),t.sorts[e]);else{let r=this.getValue2expr().get(e);if(r!==void 0)return r;let i=this.freshExprs.find(n=>t.sorts[n]===t.sorts[e]);if(i!==void 0)return i;n=t.mkFreshConst(`sk`,t.sorts[e])}return this.freshExprs.push(n),this.context.isEInternalized(n)||this.context.internalize(n,!1),n}assertNegQM(e,t,n,r){let i=this.manager,a=i.getQuantifier(t),o=n.eval(a.body,!0),s=a.sorts.length;r.resize(s);for(let t=0;t<s;t++){let o=a.sorts[s-t-1],c=i.mkFreshConst(null,o);if(r.set(s-t-1,c),n.isFinite(o)){let t=n.getKnownUniverse(o).map(e=>i.mkEq(c,e)),r=i.mkApp(6,t,0);i.incRef(r),e.assert(r),i.decRef(r)}}let c=new lh(i,!0),l=c.apply(o,r.items),u=i.mkApp(8,[l],0);i.incRef(u),e.assert(u),i.decRef(u),i.decRef(l),c.release(),i.decRef(o)}addInstance(e,t,n,r){if(n.length===0)return!1;let i=this.manager,a=i.getQuantifier(e).sorts.length,o=[],s=0;for(let c=0;c<a;c++){let l=n[a-c-1],u=t.getSomeConstInterp(i.decls[l]);if(r){let n=this.modelFinder.getInv(e,c,u,t);if(n===null)return!1;s=Math.max(s,n.generation),u=n.term}else u=this.getValue2expr().get(u)??u;i.containsModelValue(u)&&(u=this.getTypeCompatibleTerm(u)),o[a-c-1]=u}let c=this.pinnedExprs.size;for(let e of o)this.pinnedExprs.push(e);return this.pinnedExprs.push(e),this.newInstances.push({quantifier:e,offset:c,generation:Math.max(this.qmanager.getGeneration(e),s)}),!0}checkQuantifier(e,t){let n=this.manager,r=this.aux??new m_(n);this.aux=r,r.push();let i=new F(n),a=this.checkInScope(r,e,t,i);return i.reset(),r.pop(),a}checkInScope(e,t,n,r){let i=this.modelFinder.getFlatQuantifier(t);this.assertNegQM(e,i,n,r);let a=r.items,o=e.check();if(o===`unsat`)return!0;if(o===`unknown`)return!1;o.incRef(),this.modelFinder.restrictSksToInstSet(t,a,t=>e.assert(t));let s=0;for(;;){let n=e.check();if(typeof n==`string`)break;n.incRef();let r=this.addInstance(t,n,a,!0);if(r&&s++,r&&s<this.maxCexs&&this.addBlockingClause(e,n,a),n.decRef(),!r||s>=this.maxCexs)break}return s===0&&this.addInstance(t,o,a,!1),o.decRef(),!1}addBlockingClause(e,t,n){let r=this.manager,i=new F(r);for(let e of n)i.push(r.mkNot(r.mkEq(e,t.getSomeConstInterp(r.decls[e]))));let a=r.mkApp(6,i.items,0);r.incRef(a),e.assert(a),r.decRef(a),i.reset()}checkQuantifiers(e){let t=this.context,n=!1,r=0;for(let i of this.qmanager.quantifiers){if(t.checkCanceled())return{isFoundRelevant:n,numFailures:r+1};t.isRelevant(i)&&t.getAssignment(t.getLiteral(i))===1&&(n=!0,this.checkQuantifier(i,e)||r++)}return{isFoundRelevant:n,numFailures:r}}check(e,t){if(this.root2value=t,this.qmanager.quantifiers.length===0)return!0;if(this.iterationIndex>=1e3)return!1;this.value2expr=null,e.compress();let n=this.checkQuantifiers(e);n.isFoundRelevant&&this.iterationIndex++,this.maxCexs+=1;let r=n.numFailures;return r===0&&!this.context.validateModel(e)&&(r=1+this.checkQuantifiers(e).numFailures),r===0&&e.cleanup(),r===0}initSearchEh(){this.maxCexs=1,this.iterationIndex=0}hasNewInstances(){return this.newInstances.length>0}restartEh(){let e=this.context;for(let t of this.newInstances){if(!e.isBInternalized(t.quantifier))continue;let n=this.manager.getQuantifier(t.quantifier).sorts.length,i=this.pinnedExprs.items.slice(t.offset,t.offset+n).map(n=>{e.isEInternalized(n)||e.internalize(n,!1,t.generation);let i=e.getEnode(n);if(i===void 0)throw new r(`the binding was not internalized`);return i});this.qmanager.addInstance(t.quantifier,i,t.generation)}this.pinnedExprs.reset(),this.newInstances=[]}};const g_=(e,t)=>e.kinds[t]===0&&e.funcDecls[e.decls[t]].family===2,__=(e,t)=>e.kinds[t]===2||e.sorts[t]!==0?!1:e.kinds[t]===1||e.funcDecls[e.decls[t]].family!==0||e.getOp(t)===2&&!e.isBool(e.getArg(t,0))||e.isTrue(t)||e.isFalse(t),v_=(e,t)=>__(e,t)||e.isNot(t)&&__(e,e.getArg(t,0)),y_=(e,t)=>e.getOp(t)===15?e.getArgs(t):[t],b_=(e,t,n)=>{if(!g_(e,t)||e.getNumArgs(t)!==n)return!1;let r=/* @__PURE__ */ new Set;for(let i=0;i<e.getNumArgs(t);i++){let a=e.getArg(t,i);if(e.kinds[a]!==1)return!1;let o=e.values[a];if(o>=n||r.has(o))return!1;r.add(o)}return!0},x_=(e,t,n)=>{if(!g_(e,t)||e.getNumArgs(t)<n)return!1;let r=/* @__PURE__ */ new Set;for(let i=0;i<e.getNumArgs(t);i++){let a=e.getArg(t,i);if(e.kinds[a]===1){let t=e.values[a];if(t>=n)return!1;r.add(t)}else if(e.isOccurring(e.decls[t],a))return!1}return r.size===n},S_=(e,t)=>{let n=[];if(!g_(e,t))return n;for(let r=0;r<e.getNumArgs(t);r++){let i=e.getArg(t,r);e.kinds[i]===1&&n.push(i)}return n},C_=(e,t,n)=>{let r=/* @__PURE__ */ new Set,i=t=>{if(e.isGround(t)||r.has(t))return!0;r.add(t);let a=e.kinds[t];return a===1?n.includes(t):a!==2&&e.everyArg(t,e=>i(e))};return i(t)},w_=(e,t,n)=>{let r=S_(e,t);return r.length>0&&!e.isOccurring(e.decls[t],n)&&C_(e,n,r)},T_=(e,t,n,r)=>{let i=S_(e,n);if(i.length===0)return!1;let a=e.decls[n];return y_(e,t).every(t=>t===r||!e.isOccurring(a,t)&&C_(e,t,i))},E_=(e,t,n)=>{let r=e.getQuantifier(n),i=r.isForall?n:e.withTemporaries(()=>e.mkQuantifier({...r,isForall:!0,body:e.mkNot(r.body)})),a=e.hasQuantifierFlags[e.getQuantifier(i).body]?[]:O_(e,t,i);return i!==n&&e.decRef(i),a},D_=(e,t)=>{for(let n of t)n.cond!==null&&e.decRef(n.cond),e.decRef(n.def)},O_=(e,t,n)=>{let r=e.getQuantifier(n),i=r.body,a=[],o=t=>e.withTemporaries(t,()=>[]),s=e=>t.mkAppCore(8,[e],0),c=n=>n.length===0?e.trueExpr:n.length===1?n[0]:t.mkAppCore(5,n,0),l=(e,n)=>t.mkSub(e,n),u=(t,n)=>t.length===0?e.mkNumeralOfSort(P.zero,n):t.length===1?t[0]:e.mkApp(15,t,n),d=v_(e,i)||e.getOp(i)===6&&e.everyArg(i,t=>v_(e,t))?e.getOp(i)===6?e.getArgs(i):[i]:null,f=(t,n)=>d!==null&&d.some(r=>r!==n&&e.isOccurring(t,r)),p=t=>d===null?null:e.withTemporaries(()=>{let e=d.filter(e=>e!==t).map(e=>s(e));return e.length===0?null:c(e)},e=>e===null?[]:[e]),m=(t,n)=>{let r=p(t);n(r),r!==null&&e.decRef(r)},h=(t,n)=>{let r=/* @__PURE__ */ new Map;for(let n=0;n<e.getNumArgs(t);n++)r.set(e.values[e.getArg(t,n)],n);return[...r].every(e=>e[0]===e[1])?n:uh(e,n,(t,n,i)=>{let a=r.get(n);return a===void 0?t:e.mkVar(a+i,e.sorts[t])})},g=(t,n,i,s,c)=>o(()=>{let o=h(t,n),l=i===null?c?null:e.trueExpr:h(t,i);e.incRef(o),l!==null&&e.incRef(l),a.push({decl:e.decls[t],def:o,cond:l,isIneq:s,isSatisfyAtom:!0,isHint:c,weight:r.weight})}),_=(t,n,r,i,a,o)=>{if(b_(e,t,e.getNumArgs(t))){g(t,r,i,a,o);return}let s=e.withTemporaries(()=>{let r=/* @__PURE__ */ new Set,i=[],a=[],s=n;for(let n=0;n<e.getNumArgs(t);n++){let c=e.getArg(t,n);if(e.kinds[c]===1&&!r.has(e.values[c])){r.add(e.values[c]),i.push(c);continue}let l=e.mkVar(s,e.sorts[c]);s++,i.push(l),o||a.push(e.mkEq(l,c))}return{extraCond:o?null:c(a),newHead:e.mkApp(e.decls[t],i,e.sorts[t])}},e=>e.extraCond===null?[e.newHead]:[e.extraCond,e.newHead]),l=s.extraCond,u=l===null?null:i===null?l:e.withTemporaries(()=>c([i,l]));u===l&&l!==null&&e.incRef(l),g(s.newHead,r,u,a,o),u!==null&&e.decRef(u),l!==null&&e.decRef(l),e.decRef(s.newHead)},v=(t,n,r,i,a)=>{if(e.getOp(t)!==15&&e.getOp(r)===2)return;let s=y_(e,t),c=(c,d,p)=>{let h=e.decls[c],g=x_(e,c,i)&&!s.some(t=>t!==d&&e.isOccurring(h,t))&&!e.isOccurring(h,n)&&!f(h,r),v=!g&&T_(e,t,c,d);return!g&&!v?!1:(o(()=>{let o=u(s.filter(e=>e!==d),e.sorts[t]),f=p?l(o,n):l(n,o);(!v||T_(e,f,c,null))&&(v?_(c,i,f,null,a,!0):m(r,e=>_(c,i,f,e,a,!1)))}),!0)};for(let t of s){if(e.kinds[t]!==0||c(t,t,!1))continue;let n=e.getTimesMinusOneArg(t);n!==void 0&&e.kinds[n]===0&&c(n,t,!0)}},y=(t,n)=>{let r=(r,i)=>!x_(e,r,n)||e.isOccurring(e.decls[r],i)||f(e.decls[r],t)?!1:(m(t,e=>_(r,n,i,e,!1,!1)),!0),i=(t,r)=>{w_(e,t,r)&&_(t,n,r,null,!1,!0)},a=e.getOp(t);if(a===2){let n=e.getArg(t,0),a=e.getArg(t,1);r(n,a)||i(n,a),r(a,n)||i(a,n)}if(a===8){let n=e.getArg(t,0);e.getOp(n)===2&&e.isBool(e.getArg(n,0))&&o(()=>{let t=e.getArg(n,0),a=e.getArg(n,1),o=e.mkNot(t),s=e.mkNot(a);r(t,s)||i(t,s),r(a,o)||i(a,o)})}if(a===2||a===11||a===12){let r=e.getArg(t,0),i=e.getArg(t,1);v(r,i,t,n,a!==2),v(i,r,t,n,a!==2)}};for(let e of d??[i])o(()=>y(e,r.sorts.length));return a},k_=(e,t,n,r)=>{let i=t.funcInterps.get(n);i===void 0&&(i=new Yg(e,e.funcDecls[n].domain.length),t.registerFunc(n,i)),i.setElse(r)},A_=(e,t,n)=>{let r=e,i=[];for(;n(r,i,t);)r=i,i=[];return i},j_=(e,t,n)=>(r,i)=>{let a=!1;for(let o of r){let s=n(o),c=s.condMacros.find(e=>e.isSatisfyAtom&&!r.some(t=>t!==o&&n(t).ngDecls.has(e.decl)));c===void 0?i.push(o):(s.theOne=c.decl,k_(e,t,c.decl,c.def),a=!0)}return a},M_=(e,t,n)=>(r,i)=>{let a=/* @__PURE__ */ new Set,o=e=>n(e).condMacros.some(e=>e.isSatisfyAtom&&!a.has(e.decl)),s=r,c=[];for(;;){for(let e of s)if(o(e))c.push(e);else{for(let t of n(e).ngDecls)a.add(t);i.push(e)}if(s.length===c.length)break;s=c,c=[]}if(c.length===0)return!1;let l=/* @__PURE__ */ new Map,u=/* @__PURE__ */ new Map,d=/* @__PURE__ */ new Set;for(let e of c){let t=n(e);for(let n of t.ngDecls){if(a.has(n))continue;let t=l.get(n)??/* @__PURE__ */ new Set;l.set(n,t),t.add(e)}for(let n of t.condMacros){if(!n.isSatisfyAtom||a.has(n.decl))continue;let t=u.get(n.decl)??/* @__PURE__ */ new Map;u.set(n.decl,t);let r=t.get(n.def)??/* @__PURE__ */ new Set;t.set(n.def,r),r.add(e),d.add(n.decl)}}let f=/* @__PURE__ */ new Set,p=/* @__PURE__ */ new Set,m=/* @__PURE__ */ new Map,h=()=>{let t=/* @__PURE__ */ new Set,n=n=>{let r=/* @__PURE__ */ new Set,i=n=>{if(r.has(n))return!0;r.add(n);let a=e.kinds[n];if(a===1)return!0;if(a===2)return i(e.getQuantifier(n).body);let o=e.decls[n];return m.has(o)&&!t.has(o)?!1:e.everyArg(n,e=>i(e))};return i(n)};for(;;){let e=t.size;if(e===m.size)return!1;for(let e of m)!t.has(e[0])&&n(e[1])&&t.add(e[0]);if(e===t.size)return!0}},g=e=>{if(p.size===0)return!h();let t=/* @__PURE__ */ new Set;for(let e of p)for(let r of n(e).condMacros)r.isSatisfyAtom&&!a.has(r.decl)&&!m.has(r.decl)&&t.add(r.decl);for(let n of t)if(_(n,e))return!0;return!1},_=(e,t)=>{if(t>=10)return!1;for(let r of u.get(e)??[]){let i=[...f],a=[...p];m.set(e,r[0]);let o=!1;for(let t of r[1])f.has(t)||(o=!0,p.delete(t),f.add(t),n(t).theOne=e);if(o){for(let t of l.get(e)??[])f.has(t)||p.add(t);if(g(t+1))return!0}for(let e of f)i.includes(e)||(n(e).theOne=null);f.clear();for(let e of i)f.add(e);p.clear();for(let e of a)p.add(e);m.delete(e)}return!1};for(let n of d)if(_(n,0)){for(let n of m)k_(e,t,n[0],n[1]);for(let e of c)f.has(e)||i.push(e);return!0}return i.push(...c),!1},N_=(e,t)=>{let n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Set,i=t=>{if(r.has(t))return;r.add(t);let a=e.kinds[t];if(a!==1&&a!==2){for(let n=0;n<e.getNumArgs(t);n++){let r=e.getArg(t,n);i(r)}e.getNumArgs(t)>0&&!e.isGround(t)&&g_(e,t)&&n.add(e.decls[t])}};return i(t),n},P_=(e,t,n,r,i)=>(a,o,s)=>{let c=(n,i)=>{if(r.has(n))return!1;r.set(n,N_(e,i));let a=/* @__PURE__ */ new Map,o=e=>{let t=a.get(e);if(t===`closed`)return!1;if(t===`progress`)return!0;a.set(e,`progress`);for(let t of r.get(e)??[])if(o(t))return!0;return a.set(e,`closed`),!1};return o(n)?(r.delete(n),!1):(k_(e,t,n,i),!0)},l=(t,n)=>n===null||!t.isHint?!0:n.isHint?e.isGround(t.def)&&!e.isGround(n.def):!1,u=(e,t)=>{let r=null;for(let i of n(t).condMacros)i.decl===e&&!i.isHint&&l(i,r)&&(r=i);return r},d=t=>t.cond===null||e.isTrue(t.cond),f=/* @__PURE__ */ new Map,p=/* @__PURE__ */ new Set;for(let e of a){let t=n(e);for(let n of t.condMacros)n.isHint||(d(n)&&(!t.isAuf||n.weight>=i)?(f.set(n.decl,{macro:n,quantifier:e}),p.delete(n.decl)):!f.has(n.decl)&&!t.isAuf&&p.add(n.decl))}let m=/* @__PURE__ */ new Set;for(let e of f)c(e[0],e[1].macro.def)&&(n(e[1].quantifier).theOne=e[0],m.add(e[1].quantifier));for(let t of p){let r=null,i=[],o=!1;for(let n of a){if(m.has(n))continue;let a=u(t,n);if(a!==null){if(d(a)){o=!0;break}i.push(n),r=r===null?a.def:e.mkApp(4,[a.cond??e.trueExpr,a.def,r],e.sorts[r])}}if(!o&&r!==null&&c(t,r))for(let e of i)n(e).theOne=t,m.add(e)}for(let e of a)m.has(e)||(o.push(e),s.push(e));return m.size>0},F_=(e,t,n,r,i)=>{let a=[],o=A_(n,a,j_(e,t,r)),s=A_(o,a,M_(e,t,r));return[...A_(s,a,P_(e,t,r,/* @__PURE__ */ new Map,i)),...a]};var I_=class{manager;elems;inv;constructor(e){this.manager=e;let t=t=>e.hashes[t];this.elems=new km(t),this.inv=new km(t)}insert(e,t){this.elems.has(e)||this.manager.containsModelValue(e)||(this.manager.incRef(e),this.elems.set(e,t))}remove(e){this.elems.delete(e),this.manager.decRef(e)}release(){for(let e of this.elems)this.manager.decRef(e[0])}getInv(e,t){let n=this.inv.get(e);if(n!==void 0)return n;for(let n of this.inv)if(t.areEqual(n[0],e))return n[1]}getGeneration(e){return this.elems.get(e)??0}mkInverse(e){for(let t of this.elems){let n=e(t[0]);if(n===null)break;let r=this.inv.get(n);(r===void 0||t[1]<(this.elems.get(r)??0))&&this.inv.set(n,t[0])}}},L_=class{id;sort;find=null;eqcSize=1;isMono=!1;avoidSet=[];exceptions=[];set=null;elseExpr=null;proj=null;constructor(e,t){this.id=e,this.sort=t}isRoot(){return this.find===null}getRoot(){return this.find===null?this:this.find.getRoot()}merge(e){let t=this.getRoot(),n=e.getRoot();t!==n&&(t.eqcSize>n.eqcSize&&([t,n]=[n,t]),t.find=n,n.eqcSize+=t.eqcSize,n.isMono=n.isMono||t.isMono,n.avoidSet=R_(n.avoidSet,t.avoidSet),n.exceptions=R_(n.exceptions,t.exceptions))}insertAvoid(e){let t=this.getRoot();t.avoidSet.includes(e)||t.avoidSet.push(e)}insertException(e){let t=this.getRoot();t.exceptions.includes(e)||t.exceptions.push(e)}setMonoProj(){this.getRoot().isMono=!0}isMonoProj(){return this.getRoot().isMono}mkInstantiationSet(e){this.set=new I_(e)}release(){this.set?.release()}insert(e,t,n){e.isGround(t)&&this.getRoot().set?.insert(t,n)}getInstantiationSet(){let e=this.getRoot().set;if(e===null)throw new r(`the instantiation set was not created`);return e}getExceptions(){return this.getRoot().exceptions}getAvoidSet(){return this.getRoot().avoidSet}setElse(e){this.getRoot().elseExpr=e}getElse(){return this.getRoot().elseExpr}setProj(e){this.getRoot().proj=e}getProj(){return this.getRoot().proj}};const R_=(e,t)=>{if(t.length===0)return e;if(e.length===0)return t;for(let n of t)e.includes(n)||e.push(n);return e},z_=2**20,B_=(e,t)=>e*z_+t;var V_=class{manager;rewriter;nodes=[];uvars=/* @__PURE__ */ new Map;aFIs;sort2k=/* @__PURE__ */ new Map;ks;model=null;evalCache=[/* @__PURE__ */ new Map,/* @__PURE__ */ new Map];evalCacheRange;rootNodes=[];newConstraints=[];random;constructor(e,t){this.manager=e,this.rewriter=t,this.evalCacheRange=new F(e),this.ks=new F(e),this.random=new Kg(e.limit.count>>>0),e.limit.inc(),this.aFIs=new km(t=>Sm(e.getDeclHash(Math.floor(t/z_)),t%z_))}reset(){for(let e of this.nodes)e.release();this.nodes=[],this.uvars.clear(),this.aFIs.clear(),this.rootNodes=[],this.sort2k.clear(),this.ks.reset()}setModel(e){this.resetEvalCache(),this.model=e}getModel(){if(this.model===null)throw new r(`the model finder has no model`);return this.model}resetEvalCache(){this.evalCache[0].clear(),this.evalCache[1].clear(),this.evalCacheRange.reset()}mkNode(e,t,n){let r=t.get(e);if(r!==void 0)return r;let i=new L_(this.nodes.length,n);return t.set(e,i),this.nodes.push(i),i}getUvar(e,t){let n=this.manager.getQuantifier(e).sorts;return this.mkNode(`${e}:${t}`,this.uvars,n[n.length-t-1])}getAFI(e,t){let n=B_(e,t),r=this.aFIs.get(n);if(r!==void 0)return r.node;let i=new L_(this.nodes.length,this.manager.funcDecls[e].domain[t]);return this.nodes.push(i),this.aFIs.set(n,{decl:e,index:t,node:i}),i}getUvarInstSet(e,t){return this.uvars.get(`${e}:${t}`)?.getInstantiationSet()??null}mkInstantiationSets(){for(let e of this.nodes)e.isRoot()&&e.mkInstantiationSet(this.manager)}cleanupInstantiationSets(){let e=this.manager;for(let t of this.nodes){if(!t.isRoot())continue;let n=t.getInstantiationSet(),r=[];for(let t of n.elems.keys()){let n=this.eval(t,!0);n!==null&&e.isUniqueValue(n)||r.push(t)}for(let e of r)n.remove(e);this.resetEvalCache()}}eval(e,t){let n=this.evalCache[+!!t],r=n.get(e);if(r!==void 0)return r;let i=this.getModel().eval(e,t);return n.set(e,i),this.evalCacheRange.pushOwned(i),i}collectExceptionsValues(e){let t=[];for(let n of e.getExceptions()){let e=this.eval(n,!0);e!==null&&t.push(e)}for(let n of e.getAvoidSet()){let e=n.getRoot(),r=e.getElse();if(!e.isMonoProj()&&r!==null){let e=this.eval(r,!0);e!==null&&t.push(e)}}return t}areDistinct(e,t){let n=this.manager;return e!==t&&n.isUniqueValue(e)&&n.isUniqueValue(t)}pickInstanceDiffExceptions(e,t){let n=null,r=1/0;for(let i of e.getInstantiationSet().elems){let e=this.eval(i[0],!0);if(e===null)return n;!t.some(t=>!this.areDistinct(e,t))&&(n===null||i[1]<r)&&(n=i[0],r=i[1])}return n}isInfinite(e){return Um(e)}getKFor(e){let t=this.sort2k.get(e);if(t!==void 0)return t;let n=this.manager.mkFreshConst(`k`,e);return this.getModel().registerAuxDecl(this.manager.decls[n]),this.sort2k.set(e,n),this.ks.push(n),n}getKInterp(e){let t=this.getModel(),n=this.manager.decls[e],r=t.constInterps.get(n);if(r!==void 0)return r;let i=t.getFreshValue(this.manager.sorts[e]);return i===null?null:(t.registerConst(n,i),i)}assertKDiseqExceptions(e,t){let n=this.getKInterp(e);if(n===null)return!1;for(let r of t){let t=this.eval(r,!0);t!==null&&!this.areDistinct(n,t)&&this.newConstraints.push(this.manager.mkNot(this.manager.mkEq(e,r)))}return!0}setProjectionElse(e){let t=e.getInstantiationSet(),n=e.getExceptions();if(t.elems.size!==0){if(n.length>0||e.getAvoidSet().length>0){let t=this.pickInstanceDiffExceptions(e,this.collectExceptionsValues(e));if(t!==null){e.setElse(t);return}if(this.isInfinite(e.sort)){let t=this.getKFor(e.sort);if(this.assertKDiseqExceptions(t,n)){e.insert(this.manager,t,0),e.setElse(t);return}}}e.setElse(t.elems.keys().next().value??0)}}addMonoExceptions(e){if(e.sort!==1)return;let t=this.rewriter,n=this.manager.mkNumeral(1n);for(let r of e.getExceptions()){let i=t.mkSub(r,n),a=t.mkAdd([r,n]);e.insert(this.manager,a,0),e.insert(this.manager,i,0)}}getInstantiationSetValues(e){let t=this.manager,n=[],r=/* @__PURE__ */ new Set;for(let i of e.getInstantiationSet().elems.keys()){let e=this.eval(i,!0);e!==null&&(!t.isUniqueValue(e)&&n.includes(e)||r.has(e)||(n.push(e),r.add(e)))}return n}mkMonoProj(e){let t=this.manager;this.addMonoExceptions(e);let n=this.getInstantiationSetValues(e);if(n.length===0||!Um(e.sort)||!n.every(e=>t.isNumeral(e)))return;n.sort((e,n)=>t.getRationalValue(e).compare(t.getRationalValue(n)));let r=t.mkVar(0,e.sort),i=n[n.length-1];for(let a=n.length-1;a>=1;a--)i=t.mkApp(4,[t.mkApp(13,[r,n[a]],0),n[a-1],i],e.sort);let a=new Yg(t,1);a.setElse(i);let o=t.mkFreshFuncDecl(null,[e.sort],e.sort);this.getModel().registerAuxDecl(o,a),e.setProj(o)}mkSimpleProj(e){let t=this.manager;this.setProjectionElse(e);let n=this.getInstantiationSetValues(e),r=t.mkFreshFuncDecl(null,[e.sort],e.sort),i=new Yg(t,1);this.getModel().registerAuxDecl(r,i);let a=e.getElse();if(a!==null){let e=this.eval(a,!0);e!==null&&i.setElse(e)}for(let e of n)i.insertNewEntry([e],e);e.setProj(r)}collectPartialFuncs(){let e=this.manager,t=this.getModel(),n=new Am(t=>e.getDeclHash(t));for(let r of this.aFIs.entries()){let i=r[1].decl;if(n.has(i))continue;let a=t.funcInterps.get(i);a===void 0&&(a=new Yg(e,e.funcDecls[i].domain.length),t.registerFunc(i,a)),a.isPartial()&&n.add(i)}return n}mkSortsFinite(){let e=this.getModel();for(let t of this.rootNodes)this.manager.isUninterpretedSort(t.sort)&&!e.isFinite(t.sort)&&e.freezeUniverse(t.sort)}addElemToEmptyInstSets(){let e=this.manager,t=/* @__PURE__ */ new Map,n=[];for(let r of this.rootNodes){let i=r.getInstantiationSet().elems;i.size===0?e.isUninterpretedSort(r.sort)?n.push(r):r.insert(e,this.getModel().getSomeValue(r.sort),0):t.set(r.sort,i.keys().next().value??0)}for(let r of n){let n=t.get(r.sort);n===void 0&&(n=e.mkFreshConst(`elem`,r.sort),t.set(r.sort,n)),r.insert(e,n,0)}}collectRootNodes(){this.rootNodes=this.nodes.filter(e=>e.isRoot())}getFIProj(e,t){return this.aFIs.get(B_(e,t))?.node.getProj()??null}completePartialFuncs(e){let t=this.manager,n=this.getModel();for(let r of e){n.completePartialFunc(r,!0);let e=n.funcInterps.get(r);if(e===void 0||e.isConstant())continue;let i=t.funcDecls[r],a=!1,o=i.domain.map((e,n)=>{let i=t.mkVar(n,e),o=this.getFIProj(r,n);return o===null?i:(a=!0,t.mkApp(o,[i],e))});if(!a)continue;let s=t.mkFreshFuncDecl(i.name,i.domain,i.range),c=new Yg(t,i.domain.length);c.setElse(t.mkApp(s,o,i.range)),n.reregisterDecl(r,c,s)}}mkInverses(){let e=this.random.next(),t=this.rootNodes.length;for(let n=t-1;n>=0;n--)this.rootNodes[(n+e)%t].getInstantiationSet().mkInverse(e=>this.eval(e,!0))}fixModel(e){this.cleanupInstantiationSets(),this.newConstraints=e;let t=this.collectPartialFuncs();this.resetEvalCache(),this.collectRootNodes(),this.addElemToEmptyInstSets(),this.mkSortsFinite();for(let e of this.rootNodes)e.isMonoProj()?this.mkMonoProj(e):this.mkSimpleProj(e);this.mkInverses(),this.completePartialFuncs(t)}isDefaultRepresentative(e){return this.sort2k.get(this.manager.sorts[e])===e}};const H_=(e,t)=>JSON.stringify(e)===JSON.stringify(t),U_=(e,t,n)=>t>n?{kind:e,first:n,second:t}:{kind:e,first:t,second:n};var W_=class{manager;context;quantifier;flatQ;qinfos=[];isAuf=!0;hasXEqY=!1;ngDecls=/* @__PURE__ */ new Set;theOne=null;uvarInstSets=null;condMacros;constructor(e,t,n,r){this.manager=e,this.context=t,this.quantifier=n;let i=e.hasQuantifierFlags[e.getQuantifier(n).body];this.flatQ=i?wh(e,n):n,i||e.incRef(n),this.condMacros=E_(e,r,this.flatQ)}release(){D_(this.manager,this.condMacros),this.manager.decRef(this.flatQ)}insertQInfo(e){this.qinfos.some(t=>H_(t,e))||this.qinfos.push(e)}processAuf(e){let t=this.flatQ,n=this.manager.getQuantifier(t).sorts.length;for(let r=0;r<n;r++)e.getUvar(t,r);for(let n of this.qinfos)switch(n.kind){case`f_var`:e.getAFI(n.decl,n.argIndex).merge(e.getUvar(t,n.varIndex));break;case`f_var_plus_offset`:e.getAFI(n.decl,n.argIndex),e.getUvar(t,n.varIndex);break;case`x_eq_y`:{let r=e.getUvar(t,n.first),i=e.getUvar(t,n.second);r.insertAvoid(i),r!==i&&i.insertAvoid(r);break}case`x_neq_y`:e.getUvar(t,n.first).merge(e.getUvar(t,n.second));break;case`x_leq_y`:{let r=e.getUvar(t,n.first);r.merge(e.getUvar(t,n.second)),r.setMonoProj();break}case`x_eq_t`:e.getUvar(t,n.varIndex).insertException(n.term);break;case`x_neq_t`:e.getUvar(t,n.varIndex);break;case`x_gle_t`:e.getUvar(t,n.varIndex).setMonoProj()}}populateFVar(e,t,n){let r=this.context;for(let i of r.enodesOf(t))if(r.isRelevant(i.owner)){let t=i.getArg(n);e.insert(this.manager,t.owner,r.getGeneration(t))}}populateInstSets(e){let t=this.manager,n=this.context,r=this.flatQ,i=t.getQuantifier(r).sorts;for(let a of this.qinfos)switch(a.kind){case`f_var`:this.populateFVar(e.getAFI(a.decl,a.argIndex),a.decl,a.argIndex);break;case`f_var_plus_offset`:{let i=e.getAFI(a.decl,a.argIndex).getRoot(),o=e.getUvar(r,a.varIndex).getRoot();if(i===o){for(let r of n.enodesOf(a.decl))if(n.isRelevant(r.owner)){let i=r.getArg(a.argIndex);o.insert(t,e.rewriter.mkSub(i.owner,a.offset),n.getGeneration(i))}}else this.populateFVar(i,a.decl,a.argIndex),i.isMonoProj()&&o.setMonoProj(),o.isMonoProj()&&i.setMonoProj();break}case`x_eq_t`:{let o=i[i.length-a.varIndex-1];if(t.isUninterpretedSort(o)){let i=e.getUvar(r,a.varIndex);for(let e of n.enodes)n.isRelevant(e.owner)&&t.sorts[e.owner]===o&&i.insert(t,e.owner,n.getGeneration(e))}break}case`x_neq_t`:case`x_gle_t`:e.getUvar(r,a.varIndex).insert(t,a.term,0)}for(let t of this.qinfos){if(t.kind!==`f_var_plus_offset`)continue;let n=e.getAFI(t.decl,t.argIndex).getRoot(),i=e.getUvar(r,t.varIndex).getRoot();n!==i&&(this.copyInstances(e.rewriter,n,i,t.offset,!1),this.copyInstances(e.rewriter,i,n,t.offset,!0))}}copyInstances(e,t,n,r,i){for(let a of t.getInstantiationSet().elems)n.insert(this.manager,i?e.mkAdd([a[0],r]):e.mkSub(a[0],r),a[1])}getMacroBasedInstSet(e,t){let n=this.theOne;if(n===null)return null;if(this.uvarInstSets===null){let e=[];for(let t of this.qinfos){if(t.kind!==`f_var`||t.decl!==n)continue;let r=e[t.varIndex]??new I_(this.manager);e[t.varIndex]=r;for(let e of this.context.enodesOf(t.decl))if(this.context.isRelevant(e.owner)){let n=e.getArg(t.argIndex);r.insert(n.owner,this.context.getGeneration(n))}}for(let n of e)n?.mkInverse(t);this.uvarInstSets=e}return this.uvarInstSets[e]??null}resetTheOne(){this.theOne=null,this.uvarInstSets=null}},G_=class{manager;rewriter;info;posCache=/* @__PURE__ */ new Set;negCache=/* @__PURE__ */ new Set;ftodo=[];ttodo=[];constructor(e,t,n){this.manager=e,this.rewriter=t,this.info=n}isGround(e){return this.manager.isGround(e)}isVar(e){return this.manager.kinds[e]===1}isVarPlusGround(e){let t=this.manager;if(t.getOp(e)!==15||this.isGround(e))return;let n=[],r,i=!1,a=e;for(let e=!1;!e;){let o;t.getOp(a)===15?(o=t.getArg(a,0),a=t.getArg(a,1)):(o=a,e=!0);let s=this.manager.getTimesMinusOneArg(o);if(this.isGround(o))n.push(o);else if(this.isVar(o)){if(r!==void 0)return;r=o}else if(s!==void 0&&this.isVar(s)){if(r!==void 0)return;r=s,i=!0}else return}if(r===void 0)return;let o=n.length===1?n[0]:this.rewriter.mkAdd(n);return{variable:r,term:o,isInverted:i}}mkSub(e,t){return this.rewriter.mkSub(e,t)}mkAdd(e,t){return this.rewriter.mkAdd([e,t])}isVarAndGround(e,t){if(this.isVar(e)&&this.isGround(t))return{variable:e,term:t,isInverted:!1};if(this.isVar(t)&&this.isGround(e))return{variable:t,term:e,isInverted:!1};let n=this.isVarPlusGround(e);if(n!==void 0&&this.isGround(t))return{variable:n.variable,term:n.isInverted?this.mkSub(n.term,t):this.mkSub(t,n.term),isInverted:n.isInverted};let r=this.isVarPlusGround(t);if(r!==void 0&&this.isGround(e))return{variable:r.variable,term:r.isInverted?this.mkSub(r.term,e):this.mkSub(e,r.term),isInverted:r.isInverted}}isVarMinusVar(e){let t=this.manager;if(t.getOp(e)!==15)return;let n=t.getArg(e,0),r=t.getArg(e,1);if(this.isVar(n)||([n,r]=[r,n]),!this.isVar(n))return;let i=this.manager.getTimesMinusOneArg(r);if(i!==void 0&&this.isVar(i))return[n,i]}isZero(e){return this.manager.getNumeral(e)===0n}isVarAndVar(e,t){if(this.isVar(e)&&this.isVar(t))return[e,t];let n=this.isVarMinusVar(e);if(n!==void 0&&this.isZero(t))return n;let r=this.isVarMinusVar(t);if(r!==void 0&&this.isZero(e))return r}isLeGe(e){let t=this.manager.getOp(e);return t===11||t===12}isXGleTAtom(e,t){let n=this.manager;if(n.kinds[e]!==0||!this.isLeGe(e))return;let r=this.isVarAndGround(n.getArg(e,0),n.getArg(e,1));if(r===void 0)return;if(t)return{variable:r.variable,term:r.term};let i=n.getOp(e)===11!==r.isInverted,a=n.mkNumeralOfSort(P.one,n.sorts[r.term]);return{variable:r.variable,term:i?this.mkAdd(r.term,a):this.mkSub(r.term,a)}}visitFormula(e,t){if(this.isGround(e))return;let n=t===`pos`?this.posCache:this.negCache;n.has(e)||(this.ftodo.push([e,t]),n.add(e))}visitTerm(e){this.isGround(e)||this.posCache.has(e)||(this.ttodo.push(e),this.posCache.add(e))}processUApp(e){let t=this.manager,n=this.info,r=t.decls[e];for(let i=0;i<t.getNumArgs(e);i++){let a=t.getArg(e,i);if(this.isVar(a)){n.insertQInfo({kind:`f_var`,decl:r,argIndex:i,varIndex:t.values[a]});continue}let o=this.isVarPlusGround(a);o!==void 0&&!o.isInverted?n.insertQInfo({kind:`f_var_plus_offset`,decl:r,argIndex:i,varIndex:t.values[o.variable],offset:o.term}):this.visitTerm(a)}}processApp(e){let t=this.manager,n=t.decls[e];if(t.funcDecls[n].family!==0&&this.info.ngDecls.add(n),t.funcDecls[n].family===2)this.processUApp(e);else for(let n=0;n<t.getNumArgs(e);n++)this.visitTerm(t.getArg(e,n))}processTermsOnStack(){let e=this.manager;for(let t=this.ttodo.pop();t!==void 0;t=this.ttodo.pop())e.isBool(t)?(this.visitFormula(t,`pos`),this.visitFormula(t,`neg`)):e.kinds[t]===0?this.processApp(t):this.isVar(t)&&(this.info.isAuf=!1)}processLiteral(e,t){let n=this.manager,r=this.info;if(this.isVar(e)){r.insertQInfo({kind:`x_neq_t`,varIndex:n.values[e],term:t?n.trueExpr:n.falseExpr});return}if(n.kinds[e]!==0)return;let i=n.getOp(e)===2,a=i?this.isVarAndGround(n.getArg(e,0),n.getArg(e,1)):void 0;if(a!==void 0){r.insertQInfo({kind:t?`x_neq_t`:`x_eq_t`,varIndex:n.values[a.variable],term:a.term});return}let o=i?this.isVarAndVar(n.getArg(e,0),n.getArg(e,1)):void 0;if(o!==void 0){t?r.insertQInfo(U_(`x_neq_y`,n.values[o[0]],n.values[o[1]])):(r.hasXEqY=!0,r.insertQInfo(U_(`x_eq_y`,n.values[o[0]],n.values[o[1]])));return}let s=t&&this.isLeGe(e)?this.isVarAndVar(n.getArg(e,0),n.getArg(e,1)):void 0;if(s!==void 0){r.insertQInfo(U_(`x_leq_y`,n.values[s[0]],n.values[s[1]]));return}let c=this.isXGleTAtom(e,t);c===void 0?this.processApp(e):r.insertQInfo({kind:`x_gle_t`,varIndex:n.values[c.variable],term:c.term})}processFormulasOnStack(){let e=this.manager;for(let t=this.ftodo.pop();t!==void 0;t=this.ftodo.pop()){let n=t[0],r=t[1],i=r===`pos`?`neg`:`pos`;if(e.kinds[n]===1)this.processLiteral(n,r===`neg`);else if(e.kinds[n]===0){if(e.getFamily(n)!==0||!e.isBool(n))this.processLiteral(n,r===`neg`);else switch(e.getOp(n)){case 9:this.processLiteral(e.getArg(n,0),i===`neg`),this.processLiteral(e.getArg(n,1),r===`neg`);break;case 7:for(let t=0;t<e.getNumArgs(n);t++){let a=e.getArg(n,t);this.visitFormula(a,r),this.visitFormula(a,i)}break;case 6:case 5:for(let t=0;t<e.getNumArgs(n);t++){let i=e.getArg(n,t);this.visitFormula(i,r)}break;case 8:this.visitFormula(e.getArg(n,0),i);break;case 4:this.visitFormula(e.getArg(n,0),r),this.visitFormula(e.getArg(n,0),i),this.visitFormula(e.getArg(n,1),r),this.visitFormula(e.getArg(n,2),r);break;case 2:if(e.isBool(e.getArg(n,0)))for(let t=0;t<e.getNumArgs(n);t++){let r=e.getArg(n,t);this.visitFormula(r,`pos`),this.visitFormula(r,`neg`)}else this.processLiteral(n,r===`neg`);break;default:this.processLiteral(n,r===`neg`)}}}}isLiteral(e){let t=this.manager,n=t.isNot(e)?t.getArg(e,0):e;return t.kinds[n]===0?t.getFamily(n)===0?t.getOp(n)===2?!t.isBool(t.getArg(n,0)):t.getNumArgs(n)===0:!0:t.kinds[n]===1}analyze(){let e=this.manager,t=e.getQuantifier(this.info.flatQ).body,n=e.getOp(t)===6?e.getArgs(t):[t];if(n.every(e=>this.isLiteral(e)))for(let t of n){let n=e.isNot(t),r=n?e.getArg(t,0):t;this.isGround(r)||this.processLiteral(r,n)}else this.visitFormula(t,`pos`);for(;this.ftodo.length>0||this.ttodo.length>0;)this.processFormulasOnStack(),this.processTermsOnStack()}},K_=class{manager;context;q2info=/* @__PURE__ */ new Map;quantifiers=[];scopes=[];rewriter;macroRewriter;aufSolver;newConstraints=[];constructor(e,t){this.manager=e,this.context=t,this.rewriter=new Xh(e,Yh),this.macroRewriter=new Xh(e,Yh),this.aufSolver=new V_(e,this.rewriter)}getQuantifierInfo(e){return this.q2info.get(e)??this.registerQuantifier(e)}registerQuantifier(e){let t=new W_(this.manager,this.context,e,this.macroRewriter);return this.q2info.set(e,t),this.quantifiers.push(e),new G_(this.manager,this.rewriter,t).analyze(),t}pushScope(){this.scopes.push(this.quantifiers.length)}popScope(e){let t=this.scopes[this.scopes.length-e];for(let e=t;e<this.quantifiers.length;e++)this.q2info.get(this.quantifiers[e])?.release(),this.q2info.delete(this.quantifiers[e]);N(this.quantifiers,t),N(this.scopes,this.scopes.length-e)}fixModel(e){let t=this.context;if(this.quantifiers.length===0)return;let n=this.quantifiers.filter(e=>t.isRelevant(e)&&t.getAssignment(t.getLiteral(e))===1);if(n.length===0)return;for(let e of n)this.getQuantifierInfo(e).resetTheOne();let r=F_(this.manager,e,n,e=>this.getQuantifierInfo(e),10),i=this.aufSolver;i.reset(),i.setModel(e);for(let e of r)this.getQuantifierInfo(e).processAuf(i);i.mkInstantiationSets();for(let e of r)this.getQuantifierInfo(e).populateInstSets(i);i.fixModel(this.newConstraints)}getFlatQuantifier(e){return this.getQuantifierInfo(e).flatQ}getUvarInstSet(e,t){let n=this.manager,r=this.getFlatQuantifier(e),i=n.getQuantifier(r).sorts.length-n.getQuantifier(e).sorts.length,a=this.aufSolver.getUvarInstSet(r,i+t);return a===null?this.getQuantifierInfo(e).getMacroBasedInstSet(t,e=>this.aufSolver.eval(e,!0)):a}getInv(e,t,n,r){let i=this.getUvarInstSet(e,t);if(i===null)return null;let a=i.getInv(n,r);return a!==void 0&&this.aufSolver.isDefaultRepresentative(a)?{term:n,generation:0}:a===void 0?null:{term:a,generation:i.getGeneration(a)}}restrictSksToInstSet(e,t,n){let r=this.manager,i=r.getQuantifier(e).sorts.length,a=!1;for(let o=0;o<i;o++){let i=t[t.length-o-1],s=this.getUvarInstSet(e,o);if(s===null||s.inv.size===0)continue;let c=new F(r);for(let e of s.inv.keys())r.sorts[e]===r.sorts[i]&&c.push(r.mkEq(i,e));if(c.size>0){let e=r.mkApp(6,c.items,0);r.incRef(e),n(e),r.decRef(e),a=!0}c.reset()}return a}restartEh(){let e=this.context;for(let t of this.newConstraints){e.internalize(t,!0);let n=e.getLiteral(t);e.markLiteralAsRelevant(n),e.assign(n,`axiom`)}this.newConstraints=[]}};const q_=(e,t)=>{let n=new Int32Array(Math.max(2*e.length,t+1));return n.set(e),n};var J_=class{context;bindings=[];stamp=0;checkStamps=/* @__PURE__ */ new Int32Array(1024);checkResults=/* @__PURE__ */ new Int32Array(1024);enodeStamps=/* @__PURE__ */ new Int32Array(1024);enodeResults=[];argBuffers=[];argDepth=0;constructor(e){this.context=e}isSat(e,t){return this.run(e,t,!0)}isUnsat(e,t){return this.run(e,t,!1)}run(e,t,n){return this.bindings=t,this.stamp++,this.check(e,0,n)}check(e,t,n){let r=e*2+ +!!n;if(r>=this.checkStamps.length&&(this.checkStamps=q_(this.checkStamps,r),this.checkResults=q_(this.checkResults,r)),this.checkStamps[r]===this.stamp)return this.checkResults[r]===1;let i=this.checkCore(e,t,n);return this.checkStamps[r]=this.stamp,this.checkResults[r]=+!!i,i}isAssigned(e,t){let n=this.context,r=n.isBInternalized(e)?n.getBoolVarAssignment(n.getBoolVar(e)):0;return r!==0&&t===r>0}checkAny(e,t,n){let r=this.context.manager,i=r.getNumArgs(e);for(let a=0;a<i;a++)if(this.check(r.getArg(e,a),t,n))return!0;return!1}checkAll(e,t,n){let r=this.context.manager,i=r.getNumArgs(e);for(let a=0;a<i;a++)if(!this.check(r.getArg(e,a),t,n))return!1;return!0}checkCore(e,t,n){if(t>600)return!1;let r=this.context,i=r.manager;if(r.isBInternalized(e)&&r.isRelevant(e))return this.isAssigned(e,n);if(i.kinds[e]!==0)return!1;let a=t+1;switch(i.getOp(e)){case 0:return n;case 1:return!n;case 8:return this.check(i.getArg(e,0),a,!n);case 6:return n?this.checkAny(e,a,!0):this.checkAll(e,a,!1);case 5:return n?this.checkAll(e,a,!0):this.checkAny(e,a,!1);case 2:if(!i.isBool(i.getArg(e,0))){let t=this.getEnodeEqTo(i.getArg(e,0)),a=this.getEnodeEqTo(i.getArg(e,1));return t===null||a===null||!r.isRelevant(t.owner)||!r.isRelevant(a.owner)?!1:n?t.root===a.root:r.isDiseq(t,a)}return this.check(i.getArg(e,0),a,!0)&&this.check(i.getArg(e,1),a,n)||this.check(i.getArg(e,0),a,!1)&&this.check(i.getArg(e,1),a,!n);case 4:{let t=i.getArg(e,0),o=i.isNot(t)?i.getArg(t,0):t;if(t!==i.falseExpr&&(!r.isBInternalized(o)||!r.isRelevant(t)))return this.check(i.getArg(e,1),a,n)&&this.check(i.getArg(e,2),a,n);let s=r.getAssignment(r.getLiteral(t));return s!==0&&this.check(s>0?i.getArg(e,1):i.getArg(e,2),a,n)}}let o=this.getEnodeEqTo(e);return o===null||!i.isBool(o.owner)||!r.isRelevant(o.owner)?!1:this.isAssigned(o.owner,n)}getEnodeEqTo(e){let t=this.context,n=t.manager;if(n.kinds[e]===1){let t=n.values[e];return t<this.bindings.length?this.bindings[this.bindings.length-t-1]:null}let r=t.getEnode(e);if(r!==void 0&&t.isRelevant(e))return r;if(n.kinds[e]!==0||n.getNumArgs(e)===0)return null;if(e>=this.enodeStamps.length&&(this.enodeStamps=q_(this.enodeStamps,e)),this.enodeStamps[e]===this.stamp)return this.enodeResults[e]??null;let i=this.argDepth;i===this.argBuffers.length&&this.argBuffers.push([]);let a=this.argBuffers[i];N(a,0),this.argDepth=i+1;for(let t=0;t<n.getNumArgs(e);t++){let r=n.getArg(e,t),o=this.getEnodeEqTo(r);if(o===null)return this.argDepth=i,this.enodeStamps[e]=this.stamp,pm(this.enodeResults,e,null),null;a.push(o)}this.argDepth=i;let o=t.findCongruent(n.decls[e],a),s=o!==void 0&&t.isRelevant(o.owner)?o:null;return this.enodeStamps[e]=this.stamp,pm(this.enodeResults,e,s),s}},Y_=class{context;newEntries=[];delayedEntries=[];instantiatedTrail=[];scopes=[];checker;subst;instances=/* @__PURE__ */ new Map;instanceRefs=[];instanceStarts=[];instanceNext=[];bindingOwners=[];lemmas;numInstances=0;constructor(e){this.context=e,this.checker=new J_(e),this.subst=new lh(e.manager,!0),this.lemmas=new F(e.manager)}getInstance(e,t){let n=this.context.manager,r=this.instanceRefs,i=e;for(let e of t)i=Math.imul(i,2654435761)+e|0;let a=this.instances.get(i)??-1;for(let n=a;n!==-1;n=this.instanceNext[n]){let i=this.instanceStarts[n],a=r[i]===e;for(let e=0;e<t.length&&a;e++)a=r[i+1+e]===t[e];if(a)return r[i+1+t.length]}let o=this.subst.apply(n.getQuantifier(e).body,t);this.instances.set(i,this.instanceStarts.length),this.instanceStarts.push(r.length),this.instanceNext.push(a),n.incRef(e),r.push(e);for(let e of t)n.incRef(e),r.push(e);return r.push(o),o}hasWork(){return this.newEntries.length>0}insert(e,t,n){let r=this.context.manager.getQuantifier(e).weight;this.newEntries.push({quantifier:e,bindings:t,cost:r+n,generation:n,isInstantiated:!1})}instantiate(){let e=this.newEntries;this.newEntries=[];let t=0;for(let n of e)if(n.cost<=10||this.checker.isUnsat(this.context.manager.getQuantifier(n.quantifier).body,n.bindings)?this.instantiateEntry(n):this.delayedEntries.push(n),t++>100){if(this.context.checkCanceled())break;t=0}}instantiateEntry(e){let t=this.context;if(t.isInconsistent())return;e.isInstantiated=!0;let n=t.manager,r=n.getQuantifier(e.quantifier);if(this.checker.isSat(r.body,e.bindings))return;let i=this.bindingOwners;N(i,0);for(let t of e.bindings)i.push(t.owner);let a=this.getInstance(e.quantifier,i);n.incRef(a);let o=t.rewriter.rewrite(a);if(o!==n.trueExpr){let i=[n.mkNot(e.quantifier)];n.getOp(o)===6?n.pushArgs(o,i):o!==n.falseExpr&&i.push(o);let a=n.mkOr(i);this.lemmas.push(a),this.numInstances++;let s=r.weight>0||e.cost>0?Math.trunc(e.cost):Math.max(e.generation+1,Math.trunc(e.cost));t.internalizeAssertion(a,s)}n.decRef(o),n.decRef(a)}finalCheckEh(){let e=!0;for(let t=0;t<this.delayedEntries.length;t++){let n=this.delayedEntries[t];if(!(n.isInstantiated||n.cost>20)&&(e=!1,this.instantiatedTrail.push(t),this.instantiateEntry(n),this.context.checkCanceled()))break}return e}push(){this.scopes.push(this.delayedEntries.length,this.instantiatedTrail.length,this.lemmas.size)}pop(e){let t=this.scopes.length-e*3,n=this.scopes[t],r=this.scopes[t+1];for(let e=r;e<this.instantiatedTrail.length;e++)this.delayedEntries[this.instantiatedTrail[e]].isInstantiated=!1;N(this.instantiatedTrail,r),N(this.delayedEntries,n),this.lemmas.shrink(this.scopes[t+2]),this.newEntries=[],N(this.scopes,t)}initSearchEh(){let e=this.context.manager;for(let t of this.instanceRefs)e.decRef(t);this.instanceRefs=[],this.instanceStarts=[],this.instanceNext=[],this.instances.clear(),this.newEntries=[]}},X_=class{context;quantifiers=[];generations=/* @__PURE__ */ new Map;qiQueue;mam;lazyMam;fingerprints;isActive=!1;lazyMatchingIndex=0;mbqi=null;constructor(e,t){this.context=e,this.qiQueue=new Y_(e),this.fingerprints=new p_(e.manager);let n=(e,t,n)=>this.addInstance(e,t,n);if(this.mam=new f_(e,n),this.lazyMam=new f_(e,n),!t)return;let r=new K_(e.manager,e);this.mbqi={finder:r,checker:new h_(e,r,this)}}getNumInstances(){return this.qiQueue.numInstances}add(e,t){this.quantifiers.push(e),this.generations.set(e,t),this.mbqi?.finder.registerQuantifier(e)}del(e){this.quantifiers.pop(),this.generations.delete(e)}hasQuantifiers(){return this.quantifiers.length>0}getGeneration(e){return this.generations.get(e)??0}assignEh(e){this.isActive=!0;let t=this.context.manager,n=t.getQuantifier(e).patterns.map(e=>t.getArgs(e)),r=0+ +!n.some(e=>e.length===1),i=0;for(let t of n){let n=t.length===1;!n&&i>=r?this.lazyMam.addPattern(e,t):this.mam.addPattern(e,t),n||i++}}isShared(e){return this.isActive&&(this.mam.isShared(e)||this.lazyMam.isShared(e))}addEqEh(e,t){this.quantifiers.length>0&&this.mam.addEqEh(e,t)}relevantEh(e){this.quantifiers.length!==0&&(this.mam.relevantEh(e,!1),this.lazyMam.relevantEh(e,!0))}push(){this.mam.pushScope(),this.lazyMam.pushScope(),this.mbqi?.finder.pushScope(),this.qiQueue.push(),this.fingerprints.push()}pop(e){this.mam.popScope(e),this.lazyMam.popScope(e),this.mbqi?.finder.popScope(e),this.qiQueue.pop(e),this.fingerprints.pop(e)}canPropagate(){return this.qiQueue.hasWork()||this.isActive&&this.mam.hasWork()}propagate(){this.isActive&&this.mam.match(),this.qiQueue.instantiate()}addInstance(e,t,n){let r=Math.max(n,this.getGeneration(e)),i=this.fingerprints.insert(e,t);i!==null&&this.qiQueue.insert(e,i,r)}finalCheckEh(e){if(!e)return 0;let t=+!this.qiQueue.finalCheckEh();if(this.quantifiers.length>0&&this.lazyMatchingIndex<2){this.lazyMam.rematch();let e=this.lazyMatchingIndex;this.context.pushTrail(()=>{this.lazyMatchingIndex=e}),this.lazyMatchingIndex++}return this.context.canPropagate()&&(t=1),t}initSearchEh(){this.lazyMatchingIndex=0,this.mbqi?.checker.initSearchEh(),this.qiQueue.initSearchEh()}restartEh(){this.mbqi?.finder.restartEh(),this.mbqi?.checker.restartEh()}isModelBased(){return this.mbqi!==null}adjustModel(e){this.mbqi?.finder.fixModel(e)}checkModel(e,t){let n=this.mbqi?.checker;return this.quantifiers.length===0?0:n===void 0?1:n.check(e,t)?0:n.hasNewInstances()?2:1}};const Z_=e=>({isLeaf:!0,value:e,isMarked:!1}),Q_=(e,t)=>e===null?t:t===null||e===t?e:{isLeaf:!1,first:e,second:t,isMarked:!1},$_=e=>{let t=[];for(let n of e)n===null||n.isMarked||(n.isMarked=!0,t.push(n));let n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.isLeaf)n.push(r.value);else for(let e of[r.first,r.second])e===null||e.isMarked||(e.isMarked=!0,t.push(e))}for(let e of t)e.isMarked=!1;return n};var ev=class{constraints=[];active=[];scopes=[];isAuxiliaryMode=!1;add(e,t,n){let r=this.constraints.length;return this.constraints.push({column:e,kind:t,rhs:n,dep:Z_(r),isActive:!1,isAuxiliary:this.isAuxiliaryMode}),r}activate(e){let t=this.constraints[e];t.isActive||(t.isActive=!0,this.active.push(e))}pushScope(){this.scopes.push({size:this.constraints.length,activeSize:this.active.length})}popScope(e){let t=this.scopes[this.scopes.length-e];N(this.scopes,this.scopes.length-e);for(let e=this.active.length;e-->t.activeSize;)this.constraints[this.active[e]].isActive=!1;N(this.active,t.activeSize),N(this.constraints,t.size)}},tv=class{elems=[];positions=[];get size(){return this.elems.length}has(e){let t=this.positions[e];return t!==void 0&&t<this.elems.length&&this.elems[t]===e}add(e){this.has(e)||(this.positions[e]=this.elems.length,this.elems.push(e))}delete(e){let t=this.elems[this.elems.length-1];if(e!==t){let n=this.positions[e];this.positions[t]=n,this.elems[n]=t,this.positions[e]=this.elems.length-1,this.elems[this.elems.length-1]=e}this.elems.pop()}clear(){this.elems=[]}},nv=class{values=[];positions=[];get size(){return this.values.length}has(e){let t=this.positions[e];return t!==void 0&&t>=0&&this.values[t]===e}getMin(){return this.values[0]}[Symbol.iterator](){return this.values[Symbol.iterator]()}insert(e){this.values.push(e),this.positions[e]=this.values.length-1,this.moveUp(this.values.length-1)}erase(e){let t=this.positions[e],n=this.values.pop()??-1;this.positions[e]=-1,n!==e&&(this.values[t]=n,this.positions[n]=t,this.moveUp(t),this.moveDown(this.positions[n]))}clear(){for(let e of this.values)this.positions[e]=-1;this.values=[]}swap(e,t){let n=this.values,r=n[e];n[e]=n[t],n[t]=r,this.positions[n[e]]=e,this.positions[n[t]]=t}moveUp(e){let t=e;for(;t>0;){let e=t-1>>1;if(this.values[e]<=this.values[t])return;this.swap(e,t),t=e}}moveDown(e){let t=e;for(;;){let e=2*t+1;if(e>=this.values.length)return;let n=e+1,r=n<this.values.length&&this.values[n]<this.values[e]?n:e;if(this.values[t]<=this.values[r])return;this.swap(t,r),t=r}}},rv=class{values=[];log=[];scopes=[];get(e){return this.values[e]}set(e,t){this.values[e]!==t&&(this.scopes.length>0&&this.log.push({index:e,value:this.values[e]}),this.values[e]=t)}push(e){this.values.push(e)}pushScope(){this.scopes.push({size:this.values.length,logSize:this.log.length})}popScope(e){let t=this.scopes[this.scopes.length-e];N(this.scopes,this.scopes.length-e),N(this.values,t.size);for(let e=this.log.length;e-->t.logSize;){let t=this.log[e];t.index<this.values.length&&(this.values[t.index]=t.value)}N(this.log,t.logSize)}};const iv=(e,t)=>t&t-1?e<t?e:e%t:e&t-1,av=e=>e>2&&!(e&e-1),ov=e=>{for(let t=2;t*t<=e;t++)if(e%t===0)return!1;return e>=2},sv=e=>{let t=e;for(;!ov(t);)t++;return t};var cv=class{anchor={key:-1,next:null};buckets=[];nodes=/* @__PURE__ */ new Map;get size(){return this.nodes.size}has(e){return this.nodes.has(e)}get(e){return this.nodes.get(e)?.value}*[Symbol.iterator](){for(let e=this.anchor.next;e!==null;e=e.next)yield[e.key,e.value]}insert(e,t){let n={key:e,value:t,next:null},r=this.buckets.length;(this.nodes.size+1>r||r===0)&&this.rehash(Math.max(2*r+ +!av(r),this.nodes.size+1)),this.nodes.set(e,n);let i=iv(e,this.buckets.length),a=this.buckets[i];a===null?(n.next=this.anchor.next,this.anchor.next=n,this.buckets[i]=this.anchor,n.next!==null&&(this.buckets[iv(n.next.key,this.buckets.length)]=n)):(n.next=a.next,a.next=n)}delete(e){let t=this.nodes.get(e);if(t===void 0)return;this.nodes.delete(e);let n=this.buckets.length,r=iv(e,n),i=this.buckets[r]??this.anchor;for(;i.next!==t;)i=i.next??this.anchor;if(i!==this.anchor&&iv(i.key,n)===r||t.next!==null&&iv(t.next.key,n)===r||(this.buckets[r]=null),t.next!==null){let e=iv(t.next.key,n);e!==r&&(this.buckets[e]=i)}i.next=t.next}clear(){this.anchor.next=null,this.buckets.fill(null),this.nodes.clear()}rehash(e){let t=e===1?2:e&e-1?sv(e):e;if(t<=this.buckets.length)return;this.buckets=Array.from({length:t}).fill(null);let n=this.anchor,r=n.next;if(r===null)return;let i=iv(r.key,t);for(this.buckets[i]=n,n=r,r=r.next;r!==null;r=n.next){let e=iv(r.key,t);if(e===i){n=r;continue}let a=this.buckets[e];a===null?(this.buckets[e]=n,n=r,i=e):(n.next=r.next,r.next=a.next,a.next=r)}}},z=class e{x;y;static zero=new e(P.zero,P.zero);constructor(e,t=P.zero){this.x=e,this.y=t}add(t){return new e(this.x.add(t.x),this.y.add(t.y))}sub(t){return new e(this.x.sub(t.x),this.y.sub(t.y))}mul(t){return new e(this.x.mul(t),this.y.mul(t))}div(t){return new e(this.x.div(t),this.y.div(t))}neg(){return new e(this.x.neg(),this.y.neg())}compare(e){let t=this.x.compare(e.x);return t===0?this.y.compare(e.y):t}equals(e){return this.x.equals(e.x)&&this.y.equals(e.y)}isZero(){return this.x.isZero()&&this.y.isZero()}isInt(){return this.y.isZero()&&this.x.isInt()}floor(){return this.x.isInt()?this.y.isNegative()?this.x.sub(P.one):this.x:this.x.floor()}ceil(){return this.x.isInt()?this.y.isPositive()?this.x.add(P.one):this.x:this.x.ceil()}toString(){return this.y.isZero()?this.x.toString():`(${this.x}, ${this.y})`}};const lv=e=>[...e.coeffs].map(e=>({column:e[0],coeff:e[1]}));var uv=class{rows=[];columns=[];rowOffsets=[];getRowCount(){return this.rows.length}getColumnCount(){return this.columns.length}getVal(e){return this.rows[e.row][e.offset].coeff}addRow(){this.rows.push([])}addColumn(){this.columns.push([]),this.rowOffsets.push(-1)}popColumn(){this.columns.pop(),this.rowOffsets.pop()}addColumnsUpTo(e){for(;e>=this.columns.length;)this.addColumn()}clear(){this.rows=[],this.columns=[],this.rowOffsets=[]}set(e,t,n){n.isZero()||this.addNewElement(e,t,n)}addNewElement(e,t,n){let r=this.rows[e],i=this.columns[t];r.push({column:t,offset:i.length,coeff:n}),i.push({row:e,offset:r.length-1})}removeElement(e,t){let n=t.offset,r=this.columns[t.column],i=r[n].offset;if(n!==r.length-1){let e=r[r.length-1];r[n]=e,this.rows[e.row][e.offset].offset=n}if(i!==e.length-1){let t=e[e.length-1];e[i]=t,this.columns[t.column][t.offset].offset=i}r.pop(),e.pop()}scanRowToOffsets(e){for(let t=0;t<e.length;t++)this.rowOffsets[e[t].column]=t}pivotRowToRowGivenCell(e,t,n){let r=t.row,i=this.rows[r],a=this.getVal(t).neg();this.removeElement(i,i[t.offset]),this.scanRowToOffsets(i);let o=i.length,s=0;for(let t of this.rows[e]){let e=t.column;if(e===n)continue;let o=this.rowOffsets[e];if(o===-1){this.addNewElement(r,e,a.mul(t.coeff));continue}let c=i[o];c.coeff=c.coeff.add(t.coeff.mul(a)),c.coeff.isZero()&&s++}for(let e=0;e<o;e++)this.rowOffsets[i[e].column]=-1;for(let e=o;e-->0&&s>0;)i[e].coeff.isZero()&&(this.removeElement(i,i[e]),s--)}multiplyRow(e,t){for(let n of this.rows[e])n.coeff=n.coeff.mul(t)}divideRow(e,t){for(let n of this.rows[e])n.coeff=n.coeff.div(t)}addRows(e,t,n){this.addCellsToRow(n,this.rows[t],e,-1)}pivotRowToRowGivenCellWithSign(e,t,n,r){this.pivotCellsToRow(this.rows[e],t,n,r)}pivotTermToRowGivenCell(e,t,n,r){this.pivotCellsToRow(lv(e),t,n,r)}addTermToRow(e,t,n){for(let e of t.coeffs)this.addColumnsUpTo(e[0]);this.addCellsToRow(n,lv(t),e,-1)}pivotCellsToRow(e,t,n,r){let i=t.row,a=this.getVal(t).neg().mul(P.fromNumber(r)),o=this.rows[i];this.removeElement(o,o[t.offset]),this.addCellsToRow(i,e,a,n)}addCellsToRow(e,t,n,r){let i=this.rows[e];this.scanRowToOffsets(i);let a=i.length;for(let a of t){if(a.column===r)continue;let t=this.rowOffsets[a.column];t===-1?this.addNewElement(e,a.column,n.mul(a.coeff)):i[t].coeff=i[t].coeff.add(a.coeff.mul(n))}for(let e=0;e<a;e++)this.rowOffsets[i[e].column]=-1;for(let e=i.length;e-->0;)i[e].coeff.isZero()&&this.removeElement(i,i[e])}transposeRows(e,t){let n=this.rows[e];this.rows[e]=this.rows[t],this.rows[t]=n;for(let t of this.rows[e])this.columns[t.column][t.offset].row=e;for(let e of this.rows[t])this.columns[e.column][e.offset].row=t}fillLastRowWithPivoting(e,t,n){let r=[],i=[],a=e=>r[e]??P.zero,o=e=>{let t=i.indexOf(e);t!==-1&&i.splice(t,1)};r[t]=P.one,i.push(t);for(let t of e.coeffs)r[t[0]]=t[1].neg(),i.push(t[0]);let s=e=>{let t=n[e];if(t<0)return;let s=a(e);if(!s.isZero()){for(let n of this.rows[t]){if(n.column===e)continue;let t=a(n.column).isZero();r[n.column]=a(n.column).sub(s.mul(n.coeff)),t?i.push(n.column):a(n.column).isZero()&&o(n.column)}r[e]=P.zero,o(e)}};s(t);for(let t of e.coeffs)s(t[0]);let c=this.rows.length-1;for(let e of i)this.set(c,e,a(e));this.set(c,this.columns.length-1,P.one)}},dv=class{settings;matrix=new uv;columnTypes=new rv;lowerBounds=[];upperBounds=[];x=[];basis=[];nbasis=[];heading=[];infHeap=new nv;touchedRows=null;status=3;infRowIndex=-1;infeasibleSumSign=0;infeasibleCombination=[];reducedCosts;isBlandMode=!1;leftBasis=new tv;leftBasisRepeated=0;constructor(e){this.settings=e}getColumnCount(){return this.matrix.getColumnCount()}addColumn(e){let t=this.matrix.getColumnCount();this.matrix.addColumn(),this.x.push(z.zero),this.lowerBounds[t]=z.zero,this.upperBounds[t]=z.zero,e?(this.matrix.addRow(),this.heading.push(this.basis.length),this.basis.push(t)):(this.heading.push(-this.nbasis.length-1),this.nbasis.push(t))}removeLastColumn(e){this.x.length=this.matrix.getColumnCount();let t=this.heading[e];if(t>=0){let e=this.basis.length-1;if(t!==e){let n=this.basis[e];this.basis[t]=n,this.heading[n]=t}this.basis.pop()}else{let e=-1-t,n=this.nbasis.length-1;if(e!==n){let t=this.nbasis[n];this.nbasis[e]=t,this.heading[t]=-e-1}this.nbasis.pop()}this.heading.pop()}withoutTouchedRows(e){let t=this.touchedRows;this.touchedRows=null;let n=e();return this.touchedRows=t,n}getColumnType(e){return this.columnTypes.get(e)}isBase(e){return this.heading[e]>=0}isFixed(e){return this.columnTypes.get(e)===4}hasLowerBound(e){let t=this.columnTypes.get(e);return t!==0&&t!==2}hasUpperBound(e){let t=this.columnTypes.get(e);return t!==0&&t!==1}isFeasible(){return this.infHeap.size===0}columnIsFeasible(e){let t=this.x[e];switch(this.columnTypes.get(e)){case 4:case 3:return t.compare(this.upperBounds[e])<=0&&t.compare(this.lowerBounds[e])>=0;case 1:return t.compare(this.lowerBounds[e])>=0;case 2:return t.compare(this.upperBounds[e])<=0;default:return!0}}trackColumnFeasibility(e){this.columnIsFeasible(e)?this.infHeap.has(e)&&this.infHeap.erase(e):this.infHeap.has(e)||this.infHeap.insert(e)}addDeltaToXAndTrackFeasibility(e,t){this.x[e]=this.x[e].add(t),this.trackColumnFeasibility(e)}submulFromXAndTrackFeasibility(e,t,n){this.x[e]=this.x[e].sub(t.mul(n)),this.trackColumnFeasibility(e)}makeColumnFeasible(e){let t=this.x[e],n=this.lowerBounds[e],r=this.upperBounds[e],i;switch(this.columnTypes.get(e)){case 4:t.equals(n)||(i=n);break;case 3:t.compare(n)<0?i=n:t.compare(r)>0&&(i=r);break;case 1:t.compare(n)<0&&(i=n);break;case 2:t.compare(r)>0&&(i=r)}if(i===void 0)return;let a=i.sub(t);return this.x[e]=i,a}changeBasis(e,t){let n=this.heading[t],r=-this.heading[e]-1;this.heading[e]=n,this.basis[n]=e,this.heading[t]=-r-1,this.nbasis[r]=t}changeBasisUnconditionally(e,t){let n=-1-this.heading[e];n>=this.nbasis.length&&(n=this.nbasis.length,this.heading[e]=n,this.nbasis.push(e));let r=this.heading[t];this.heading[e]=r,this.basis[r]=e,this.heading[t]=-n-1,this.nbasis[n]=t}divideRowByPivot(e,t){let n=this.matrix.rows[e],r=n.find(e=>e.column===t);if(r===void 0||r.coeff.isZero())return!1;let i=r.coeff;for(let e of n)e.column!==t&&(e.coeff=e.coeff.div(i));return r.coeff=i.div(i),!0}pivotColumnTableau(e,t){if(!this.divideRowByPivot(t,e))return!1;this.settings.stats.pivots++;let n=this.matrix,r=n.columns[e],i=r.findIndex(e=>e.row===t);if(i<0)return!1;if(i!==0){let e=r[0];r[0]=r[i],r[i]=e,n.rows[t][r[0].offset].offset=0,n.rows[e.row][e.offset].offset=i}for(;r.length>1;){let i=r[r.length-1];this.touchedRows?.add(i.row),n.pivotRowToRowGivenCell(t,i,e)}return this.reducedCosts!==void 0&&this.pivotToReducedCosts(this.reducedCosts,t,e),!0}pivotToReducedCosts(e,t,n){let r=e[n];if(!r.isZero()){for(let i of this.matrix.rows[t])i.column!==n&&(e[i.column]=e[i.column].sub(r.mul(i.coeff)));e[n]=P.zero}}pivot(e,t){this.pivotColumnTableau(e,this.heading[t]),this.changeBasis(e,t)}transposeRows(e,t){let n=this.basis,r=n[e];n[e]=n[t],n[t]=r;let i=this.heading[n[e]];this.heading[n[e]]=this.heading[n[t]],this.heading[n[t]]=i,this.matrix.transposeRows(e,t)}needsToGrow(e){let t=this.columnTypes.get(e);return(t===4||t===1||t===3)&&this.x[e].compare(this.lowerBounds[e])<0}infSignOfColumn(e){switch(this.columnTypes.get(e)){case 0:return 0;case 1:return 1;case 4:case 3:return this.x[e].compare(this.upperBounds[e])>0?-1:1;default:return-1}}isAboveLower(e){return this.x[e].compare(this.lowerBounds[e])>0}isBelowUpper(e){return this.x[e].compare(this.upperBounds[e])<0}monoidCanDecrease(e){let t=e.column;switch(this.columnTypes.get(t)){case 0:return!0;case 4:return!1;case 1:return!e.coeff.isPositive()||this.isAboveLower(t);case 2:return e.coeff.isPositive()||this.isBelowUpper(t);default:return e.coeff.isPositive()?this.isAboveLower(t):this.isBelowUpper(t)}}monoidCanIncrease(e){let t=e.column;switch(this.columnTypes.get(t)){case 0:return!0;case 4:return!1;case 1:return!e.coeff.isNegative()||this.isAboveLower(t);case 2:return e.coeff.isNegative()?!0:this.isBelowUpper(t);default:return e.coeff.isNegative()?this.isAboveLower(t):this.isBelowUpper(t)}}getNumOfNotFreeBasicDependentVars(e,t,n){let r=0;for(let i of this.matrix.columns[e]){let e=this.basis[i.row];if(e!==n&&this.columnTypes.get(e)!==0&&r++>t)return r}return r}findBeneficialEntering(e){let t=this.matrix.rows[e],n=this.basis[e],r=this.needsToGrow(n),i=e=>e.column!==n&&(r?this.monoidCanDecrease(e):this.monoidCanIncrease(e));if(this.isBlandMode){let n;for(let e of t)i(e)&&(n===void 0||e.column<n.column)&&(n=e);return n===void 0&&(this.infRowIndex=e),n}let a=-1,o=0,s=2**53-1,c=2**53-1;for(let e=0;e<t.length;e++){let r=t[e];if(!i(r))continue;let l=this.getNumOfNotFreeBasicDependentVars(r.column,s,n),u=this.matrix.columns[r.column].length;l<s||l===s&&u<c?(s=l,c=u,a=e,o=1):l===s&&u===c&&this.settings.getRandomNext(++o)===0&&(a=e)}if(a===-1)this.infRowIndex=e;else return t[a]}getValForLeaving(e){switch(this.columnTypes.get(e)){case 4:case 2:return this.upperBounds[e];case 3:return this.x[e].compare(this.upperBounds[e])>0?this.upperBounds[e]:this.lowerBounds[e];default:return this.lowerBounds[e]}}oneIterationTableauRows(){if(this.infHeap.size===0){this.status=2;return}let e=this.infHeap.getMin();this.isBlandMode||(this.leftBasis.has(e)?++this.leftBasisRepeated>1e3&&(this.isBlandMode=!0):this.leftBasis.add(e));let t=this.findBeneficialEntering(this.heading[e]);if(t===void 0){this.status=1;return}if(this.settings.isCanceled()){this.status=4;return}let n=t.column,r=this.getValForLeaving(e),i=this.x[e].sub(r).div(t.coeff);this.x[e]=r,this.infHeap.erase(e),this.x[n]=this.x[n].add(i);for(let t of this.matrix.columns[n]){let n=this.basis[t.row];n!==e&&this.submulFromXAndTrackFeasibility(n,i,this.matrix.getVal(t))}this.pivotColumnTableau(n,this.heading[e]),this.changeBasis(n,e),this.trackColumnFeasibility(n),this.isFeasible()&&(this.status=2)}solveTableau(){if(this.isFeasible())this.status=3;else{this.isBlandMode=!1,this.leftBasis.clear(),this.leftBasisRepeated=0;do{if(this.settings.isCanceled()){this.status=4;return}this.oneIterationTableauRows()}while(this.status!==2&&this.status!==1&&this.status!==4&&!this.isFeasible())}}solve(){if(this.isFeasible())this.status=2;else if(this.status=0,this.solveTableau(),this.status===1){let e=this.basis[this.infRowIndex];this.infeasibleSumSign=this.infSignOfColumn(e),this.infeasibleCombination=this.matrix.rows[this.infRowIndex].map(e=>[e.coeff,e.column])}else this.status!==4&&(this.status=2)}pushScope(){this.columnTypes.pushScope()}popScope(e){this.columnTypes.popScope(e);let t=this.matrix.getColumnCount();this.x.length=t,this.infeasibleCombination=[]}},fv=class{pairs=[];indices=new km(Om);clear(){this.pairs=[],this.indices.clear()}addPair(e,t){this.pairs.push([e,t])}push(e){this.indices.set(e,!0)}pushDependency(e){for(let t of $_([e]))this.push(t)}get isEmpty(){return this.pairs.length===0&&this.indices.size===0}addExplanation(e){if(e.pairs.length===0)for(let t of e.indices.keys())this.push(t);else for(let t of e.pairs)this.addPair(t[0],t[1])}*[Symbol.iterator](){if(this.pairs.length>0)for(let e of this.pairs)yield e[0];else yield*this.indices.keys()}},B=class e{coeffs=new km(Om);column=-1;constructor(e=[]){for(let t of e)this.addMonomial(t[1],t[0])}get size(){return this.coeffs.size}clear(){this.coeffs.clear()}addMonomial(e,t){if(e.isZero())return;let n=this.coeffs.get(t);if(n===void 0){this.coeffs.set(t,e);return}let r=n.add(e);r.isZero()?this.coeffs.delete(t):this.coeffs.replace(t,r)}apply(e){let t=z.zero;for(let n of this.coeffs)t=t.add(e[n[0]].mul(n[1]));return t}substByTerm(e,t){let n=this.coeffs.get(t);if(n!==void 0){this.coeffs.delete(t);for(let t of e.coeffs)this.addMonomial(n.mul(t[1]),t[0])}}getNormalized(){let t=[...this.coeffs];if(t.length===0)return{term:this,coeff:P.one};let n=t[0][1];if(n.equals(P.one))return{term:this,coeff:n};let r=new e;r.addMonomial(P.one,t[0][0]);for(let e=1;e<t.length;e++)r.addMonomial(t[e][1].div(n),t[e][0]);return{term:r,coeff:n}}};const pv=(e,t)=>e===t||t===`undef`?e:e===`undef`?t:e===`conflict`||t===`conflict`?`conflict`:`continue`,mv=e=>[...e.coeffs].map(e=>({coeff:e[1],column:e[0]})),hv=e=>[...mv(e),{coeff:P.minusOne,column:e.column}],gv=e=>e.equals(P.one)||e.equals(P.minusOne),_v=(e,t)=>P.of(e.num%t.num),vv=(e,t)=>P.of(e.num/t.num),yv=e=>{let t=e=>e===0n?1:(e<0n?-e:e).toString(2).length;return e.isInt()?t(e.num):t(e.num)+t(e.den)},bv=(e,t)=>{if(t){for(let t of e)if(gv(t.coeff))return P.one}let n=P.zero;for(let t of e)if(n=n.isZero()?t.coeff.abs():P.of(jm(n.num,t.coeff.num)),n.equals(P.one))break;return n};var xv=class{data=[];positions=[];get size(){return this.data.length}has(e){return(this.positions[e]??-1)>=0}get(e){return this.data[this.positions[e]].coeff}erase(e){let t=this.positions[e]??-1;if(t===-1)return;let n=this.data.length-1;t!==n&&(this.data[t]=this.data[n],this.positions[this.data[t].column]=t),this.data.pop(),this.positions[e]=-1}add(e,t){let n=this.positions[t]??-1;if(n===-1){this.data.push({coeff:e,column:t}),this.positions[t]=this.data.length-1;return}let r=this.data[n].coeff.add(e);r.isZero()?this.erase(t):this.data[n]={coeff:r,column:t}}clear(){for(let e of this.data)this.positions[e.column]=-1;this.data.length=0}},Sv=class{items=[];members=/* @__PURE__ */ new Set;get isEmpty(){return this.items.length===0}push(e){this.members.has(e)||(this.items.push(e),this.members.add(e))}popFront(){let e=this.items.shift()??-1;return this.members.delete(e),e}remove(e){this.members.delete(e)&&this.items.splice(this.items.indexOf(e),1)}reset(){this.items.length=0,this.members.clear()}},Cv=class{localToExternal=[];externalToLocal=/* @__PURE__ */ new Map;addVar(e){let t=e===-1?void 0:this.externalToLocal.get(e);if(t!==void 0)return t;let n=this.localToExternal.length;return this.localToExternal.push(e),e!==-1&&this.externalToLocal.set(e,n),n}getExternal(e){return e<this.localToExternal.length?this.localToExternal[e]:-1}isUsed(e){return this.externalToLocal.has(e)}getLocal(e){let t=this.externalToLocal.get(e);if(t===void 0)throw new r(`the Diophantine solver has no column for ${e}`);return t}shrink(e){for(let t=this.localToExternal.length;t-->e;)this.externalToLocal.delete(this.localToExternal[t]);N(this.localToExternal,e)}clear(){this.localToExternal=[],this.externalToLocal.clear()}},wv=class{keyToFresh=new cv;freshToKey=/* @__PURE__ */ new Map;definitions=/* @__PURE__ */ new Map;add(e,t,n){this.keyToFresh.insert(e,t),this.freshToKey.set(t,e),this.definitions.set(t,n)}hasKey(e){return this.keyToFresh.has(e)}hasFresh(e){return this.definitions.has(e)}getByKey(e){return this.getByFresh(this.keyToFresh.get(e)??-1)}getByFresh(e){let t=this.definitions.get(e);if(t===void 0)throw new r(`the Diophantine solver has no definition for ${e}`);return t}eraseByFresh(e){this.keyToFresh.delete(this.freshToKey.get(e)??-1),this.freshToKey.delete(e),this.definitions.delete(e)}clear(){this.keyToFresh.clear(),this.freshToKey.clear(),this.definitions.clear()}},Tv=class{lia;hasIgnoredTerms=!1;solver;sumOfFixed=[];varRegister=new Cv;eMatrix=new uv;lMatrix=new uv;infeasExplanation=new fv;constant=P.zero;lspace=new xv;espace=new xv;keyToRow=/* @__PURE__ */ new Map;rowToKey=/* @__PURE__ */ new Map;freshDefinitions=new wv;rowToFreshDefs=/* @__PURE__ */ new Map;changedRows=new tv;changedFixedColumns=new tv;changedTerms=new tv;termsToTighten=new tv;columnsToTerms=/* @__PURE__ */ new Map;conflictRow=-1;conflictGcd=P.zero;undoWork=0;addedTerms=[];activeTerms=/* @__PURE__ */ new Set;queue=new Sv;constructor(e){this.lia=e,this.solver=e.solver,this.solver.onAddTerm=e=>this.addTermCallback(e),this.solver.onColumnBoundUpdate=e=>this.updateColumnBoundCallback(e)}check(){let e=this.solver.settings;e.stats.dioCalls++;let t=[],n;do this.init(t),n=this.processFAndTightenTerms(t);while(n===`continue`);return n}explain(e){if(e.clear(),this.conflictRow===-1){for(let t of this.infeasExplanation)e.push(t);return}let t=this.explainFixedInMetaTerm(this.getRowMonomials(this.lMatrix,this.conflictRow),this.conflictGcd);e.pushDependency(t)}addTermCallback(e){this.solver.isInt(e.column)?(this.addedTerms.push(e),this.changedTerms.add(e.column),this.solver.pushTrail(()=>this.undoAddTerm(e))):this.hasIgnoredTerms=!0}updateColumnBoundCallback(e){let t=this.solver;t.isInt(e)&&(t.hasTerm(e)&&this.termsToTighten.add(e),t.isFixed(e)&&(this.changedFixedColumns.add(e),t.pushTrail(()=>this.changedFixedColumns.add(e))))}undoAddTerm(e){if(!this.activeTerms.has(e)){let t=this.addedTerms.lastIndexOf(e);t!==-1&&(this.addedTerms[t]=this.addedTerms[this.addedTerms.length-1],this.addedTerms.pop());return}this.deregisterColumnsOfTerm(e),this.activeTerms.delete(e);let t=this.solver.settings;this.undoWork+=1+this.getEliminationWorkEstimate(),this.undoWork>t.dioUndoMaxWork||t.isCanceled()?this.resetState():this.shrinkMatrices()}deregisterColumnsOfTerm(e){for(let t of hv(e)){let n=this.columnsToTerms.get(t.column);n!==void 0&&(n.delete(e.column),n.size===0&&this.columnsToTerms.delete(t.column))}}getEliminationWorkEstimate(){let e=this.lMatrix;if(e.getColumnCount()===0||e.getRowCount()===0)return 0;let t=e.columns[e.getColumnCount()-1].length;if(t<=1)return 0;let n=0;for(let t of e.rows[e.getRowCount()-1])n+=1+Math.floor(yv(t.coeff)/32);return(t-1)*n}resetState(){for(let e of this.activeTerms)this.deregisterColumnsOfTerm(e),this.addedTerms.push(e);this.activeTerms.clear(),this.addedTerms.sort((e,t)=>e.column-t.column),this.eMatrix.clear(),this.lMatrix.clear(),this.sumOfFixed=[],this.varRegister.clear(),this.keyToRow.clear(),this.rowToKey.clear(),this.freshDefinitions.clear(),this.rowToFreshDefs.clear(),this.changedRows.clear(),this.changedFixedColumns.clear(),this.changedTerms.clear(),this.termsToTighten.clear(),this.espace.clear(),this.lspace.clear(),this.queue.reset(),this.infeasExplanation.clear(),this.conflictRow=-1,this.undoWork=0,this.solver.settings.stats.dioStateResets++}shrinkMatrices(){let e=this.lMatrix.getRowCount()-1;this.eliminateLastTermColumn(),Ev(this.lMatrix),Ev(this.eMatrix);for(let t of this.rowToFreshDefs.get(e)??[])if(t<this.eMatrix.getColumnCount())for(let e of this.eMatrix.columns[t])this.changedRows.add(e.row);Dv(this.lMatrix),Dv(this.eMatrix),this.varRegister.shrink(this.eMatrix.getColumnCount()),this.removeOutOfBoundsFreshDefs(),this.removeIrrelevantFreshDefsForRow(e),this.rowToKey.has(e)&&this.removeFromS(e),this.sumOfFixed.pop()}eliminateLastTermColumn(){let e=this.lMatrix,t=e.getColumnCount()-1,n=e.getRowCount()-1;e.rows[n].some(e=>e.column===t)||e.addRows(P.one,e.columns[t][0].row,n);let r=e.rows[n].find(e=>e.column===t)?.coeff;if(r===void 0)return;e.divideRow(n,r);let i=e.columns[t],a=i.findIndex(e=>e.row===n);for(a>0&&Ov(e,i,a);i.length>1;){let r=i[i.length-1];this.changedRows.add(r.row),e.pivotRowToRowGivenCell(n,r,t)}}init(e){this.infeasExplanation.clear(),this.lia.term.clear(),this.conflictRow=-1,this.undoWork=0,this.processChangedFixedColumns(e);for(let t of this.addedTerms)this.activeTerms.add(t),e.push(this.eMatrix.getRowCount()),this.fillEntry(t),this.registerColumnsToTerm(t);this.addedTerms=[]}registerColumnsToTerm(e){for(let t of hv(e)){let n=this.columnsToTerms.get(t.column);n===void 0?this.columnsToTerms.set(t.column,/* @__PURE__ */ new Set([e.column])):n.add(e.column)}}fillEntry(e){let t=this.solver,n=this.eMatrix.getRowCount();this.lMatrix.addRow(),this.lMatrix.addColumnsUpTo(e.column),this.lMatrix.addNewElement(n,e.column,P.one),this.eMatrix.addRow();let r=P.zero;for(let i of hv(e)){if(t.isFixed(i.column)){r=r.add(i.coeff.mul(t.getLowerBound(i.column).x));continue}let e=this.varRegister.addVar(i.column);this.eMatrix.addColumnsUpTo(e),this.eMatrix.addNewElement(n,e,i.coeff)}this.sumOfFixed.push(r),this.subsEntry(n)}subsEntry(e){if(e>=this.eMatrix.getRowCount())return;let t=this.queue;t.reset();for(let n of this.eMatrix.rows[e])this.canSubstitute(n.column)&&t.push(n.column);for(;!t.isEmpty;){let n=t.popFront(),r=this.getCoeffInERow(e,n);if(r.isZero())continue;let i=this.keyToRow.get(n);i===void 0?this.eMatrix.addTermToRow(r.neg(),this.freshDefinitions.getByKey(n).term,e):this.addTwoEntries(r.neg().mul(P.fromNumber(this.getSignInERow(i,n))),i,e);for(let n of this.eMatrix.rows[e])this.canSubstitute(n.column)&&t.push(n.column)}}addTwoEntries(e,t,n){this.eMatrix.addRows(e,t,n),this.lMatrix.addRows(e,t,n),this.sumOfFixed[n]=this.sumOfFixed[n].add(e.mul(this.sumOfFixed[t]))}recalculateEntry(e){let t=this.openLTermToEspace(e),n=this.eMatrix.rows[e];for(;n.length>0;)this.eMatrix.removeElement(n,n[n.length-1]);let r=1n;for(let t of this.espace.data){let n=this.varRegister.addVar(t.column);this.eMatrix.addColumnsUpTo(n),this.eMatrix.addNewElement(e,n,t.coeff),t.coeff.den!==1n&&(r=Nm(r,t.coeff.den))}if(r!==1n){let n=P.of(r);t=t.mul(n),this.lMatrix.multiplyRow(e,n),this.eMatrix.multiplyRow(e,n)}this.sumOfFixed[e]=t,this.rowToKey.has(e)&&this.removeFromS(e)}openLTermToEspace(e){let t=this.solver;this.espace.clear();let n=P.zero;for(let r of this.lMatrix.rows[e])for(let e of hv(t.getTerm(r.column))){let i=r.coeff.mul(e.coeff);t.isFixed(e.column)?n=n.add(i.mul(t.getLowerBound(e.column).x)):this.espace.add(i,e.column)}return n}processChangedFixedColumns(e){for(let e of this.changedFixedColumns.elems.slice()){let t=this.columnsToTerms.get(e);if(t!==void 0)for(let e of[...t].sort((e,t)=>e-t))this.changedTerms.add(e);if(this.varRegister.isUsed(e))for(let t of this.eMatrix.columns[this.varRegister.getLocal(e)])this.changedRows.add(t.row)}for(let e of this.changedTerms.elems.slice())if(this.isBigTermOrNoTerm(e)||this.termsToTighten.add(e),e<this.lMatrix.getColumnCount())for(let t of this.lMatrix.columns[e])this.changedRows.add(t.row);let t=[];for(let e of this.changedRows.elems)for(let n of this.rowToFreshDefs.get(e)??[])for(let e of this.eMatrix.columns[n])t.push(e.row);for(let e of t)this.changedRows.add(e);this.removeOutOfBoundsFreshDefs();for(let e of this.changedRows.elems.slice())this.removeIrrelevantFreshDefsForRow(e);for(let t of this.changedRows.elems.slice()){if(t>=this.eMatrix.getRowCount())continue;this.rowToKey.has(t)&&e.push(t),this.recalculateEntry(t);let n=this.eMatrix;n.getColumnCount()>0&&n.columns[n.getColumnCount()-1].length===0&&(n.popColumn(),this.varRegister.shrink(n.getColumnCount()),this.removeOutOfBoundsFreshDefs());let r=this.lMatrix;r.getColumnCount()>0&&r.columns[r.getColumnCount()-1].length===0&&r.popColumn()}for(let e of this.changedRows.elems.slice())this.subsEntry(e);this.changedFixedColumns.clear(),this.changedRows.clear(),this.changedTerms.clear()}isBigTermOrNoTerm(e){let t=this.solver;if(e>=t.getColumnCount()||!t.hasTerm(e))return!0;if(!t.settings.isDioIgnoringBigNums)return!1;for(let n of t.getTerm(e).coeffs){let e=t.isFixed(n[0])&&t.getLowerBound(n[0]).x.isBig();if(n[1].isBig()||e)return this.hasIgnoredTerms=!0,!0}return!1}collectDependentFreshVars(e,t){let n=[];for(let r of this.freshDefinitions.keyToFresh){let i=r[1];if(i===e||t.includes(i))continue;let a=this.freshDefinitions.getByFresh(i).term.coeffs;(a.has(e)||t.some(e=>a.has(e)))&&n.push(i)}t.push(...n);for(let e of n)this.collectDependentFreshVars(e,t)}deepRemoveFreshVar(e){if(!this.freshDefinitions.hasFresh(e))return;let t=[e];this.collectDependentFreshVars(e,t);for(let e of t){if(!this.freshDefinitions.hasFresh(e))continue;let t=this.freshDefinitions.getByFresh(e).row;this.freshDefinitions.eraseByFresh(e);let n=this.rowToFreshDefs.get(t);if(n!==void 0){let r=n.filter(t=>t!==e);r.length===0?this.rowToFreshDefs.delete(t):this.rowToFreshDefs.set(t,r)}if(e<this.eMatrix.getColumnCount())for(let t of this.eMatrix.columns[e])this.changedRows.add(t.row)}}removeIrrelevantFreshDefsForRow(e){let t=this.rowToFreshDefs.get(e);if(t!==void 0){for(let e of t.slice())this.deepRemoveFreshVar(e);this.rowToFreshDefs.delete(e)}}removeOutOfBoundsFreshDefs(){let e=[],t=[];for(let n of this.freshDefinitions.keyToFresh)n[1]<this.eMatrix.getColumnCount()||(e.push(n[1]),t.push(this.freshDefinitions.getByFresh(n[1]).row));for(let t of e)this.deepRemoveFreshVar(t);for(let e of t)this.removeIrrelevantFreshDefsForRow(e)}freshVarStep(e,t,n){let r=this.varRegister.addVar(-1);for(;r>=this.eMatrix.getColumnCount();)this.eMatrix.addColumn();let i=new B;i.addMonomial(P.minusOne,r),i.addMonomial(P.one,t);for(let r of this.eMatrix.rows[e]){if(r.column===t)continue;let e=vv(r.coeff,n);e.isZero()||i.addMonomial(e,r.column)}let a=new B(new B(i.coeffs).coeffs);this.freshDefinitions.add(t,r,{term:a,row:e});let o=this.rowToFreshDefs.get(e);o===void 0?this.rowToFreshDefs.set(e,[r]):o.push(r);let s=this.eMatrix.columns[t];for(let e=s.length;e-->0;){let n=s[e];this.rowToKey.has(n.row)||this.eMatrix.pivotTermToRowGivenCell(i,n,t,1)}}processFAndTightenTerms(e){let t=this.processF(e);if(t!==`undef`)return t;let n=this.tightenTermsWithS();return n===`conflict`&&this.solver.settings.stats.dioTightenConflicts++,n}processF(e){if(this.conflictRow!==-1)return`conflict`;let t;do{if(t=this.rewriteEqs(e),this.solver.settings.isCanceled())return`undef`;if(t!==`continue`)break}while(e.length>0);return t===`conflict`?`conflict`:`undef`}setRewriteConflict(e,t){this.conflictRow=e,this.conflictGcd=t,this.solver.settings.stats.dioRewriteConflicts++}rewriteEqs(e){if(e.length===0)return`undef`;let t=-1,n=0,r=-1,i=0,a=0,o=P.zero,s=0;for(let c=0;c<e.length;c++){let l=e[c];if(this.eMatrix.rows[l].length===0){if(this.sumOfFixed[l].isZero())continue;return this.setRewriteConflict(l,P.zero),`conflict`}if(!this.sumOfFixed[l].isInt())return this.setRewriteConflict(l,P.zero),`conflict`;let u=this.findMinimalAbsCoeff(l),d=this.normalizeEByGcd(l);if(d===void 0)return`conflict`;let f=d.equals(P.one)?u.ahk:u.ahk.div(d);if(s===0||o.compare(f)>0)r=c,s=1,o=f,t=l,n=u.column,i=u.sign,a=u.markovich;else if(o.equals(f)&&a>u.markovich&&(r=c,t=l,n=u.column,i=u.sign,a=u.markovich),o.equals(P.one)&&a===0)break}return t===-1?`undef`:(o.equals(P.one)?(this.keyToRow.set(n,t),this.rowToKey.set(t,n),this.eliminateVarInF(t,n,i),e[r]=e[e.length-1],e.pop()):this.freshVarStep(t,n,o.mul(P.fromNumber(i))),`continue`)}findMinimalAbsCoeff(e){let t=P.zero,n=-1,r=0;for(let i of this.eMatrix.rows[e]){let e=i.coeff.abs();if(!(n!==-1&&e.compare(t)>=0)&&(t=e,r=i.coeff.isPositive()?1:-1,n=i.column,t.equals(P.one)))break}let i=(this.eMatrix.columns[n].length-1)*(this.eMatrix.rows[e].length-1);return{ahk:t,column:n,sign:r,markovich:i}}normalizeEByGcd(e){let t=bv(this.eMatrix.rows[e],!0);if(t.isZero()||t.equals(P.one))return t;let n=this.sumOfFixed[e].div(t);if(!n.isInt())this.setRewriteConflict(e,t);else return this.eMatrix.divideRow(e,t),this.sumOfFixed[e]=n,this.lMatrix.divideRow(e,t),t}eliminateVarInF(e,t,n){let r=this.sumOfFixed[e],i=this.eMatrix.columns[t],a=i.findIndex(t=>t.row===e);a>0&&Ov(this.eMatrix,i,a);let o=P.fromNumber(n);for(let a=i.length;a-->0;){let s=i[a];if(this.rowToKey.has(s.row))continue;let c=this.eMatrix.getVal(s),l=s.row;this.sumOfFixed[l]=this.sumOfFixed[l].sub(o.mul(c).mul(r)),this.eMatrix.pivotRowToRowGivenCellWithSign(e,s,t,n),this.lMatrix.addRows(o.neg().mul(c),e,l)}}removeFromS(e){let t=this.rowToKey.get(e);t!==void 0&&(this.rowToKey.delete(e),this.keyToRow.delete(t))}canSubstitute(e){return this.keyToRow.has(e)||this.freshDefinitions.hasKey(e)}isFresh(e){return this.freshDefinitions.hasFresh(e)}getCoeffInERow(e,t){return this.eMatrix.rows[e].find(e=>e.column===t)?.coeff??P.zero}getSignInERow(e,t){return this.getCoeffInERow(e,t).isPositive()?1:-1}getRowMonomials(e,t){return e.rows[t].map(e=>({coeff:e.coeff,column:e.column}))}tightenTermsWithS(){let e=this.solver,t=[],n=[];for(let r of this.termsToTighten.elems)r>=e.getColumnCount()||!e.hasTerm(r)||e.isFree(r)||!e.isInt(r)?n.push(r):t.push(r);let r=new Map(t.map(t=>[t,this.getTermWeight(e.getTerm(t))]));t.sort((e,t)=>(r.get(t)??0)-(r.get(e)??0)||e-t);let i=`undef`;for(let e of t){if(this.isBigTermOrNoTerm(e)){this.termsToTighten.delete(e);continue}let t=this.tightenBoundsForTermColumn(e);if(this.termsToTighten.delete(e),i=pv(t,i),i===`conflict`)break}for(let e of n)this.termsToTighten.delete(e);return i}getTermWeight(e){let t=0;for(let n of e.coeffs)t=Math.max(t,this.columnsToTerms.get(n[0])?.size??0);return t}tightenBoundsForTermColumn(e){let t=new Sv;return this.initSubstitutions(this.solver.getTerm(e),t)?this.subsWithSAndFresh(t,e)===`conflict`?`conflict`:(this.processFixedInEspace(),this.tightenOnEspace(e)):`undef`}initSubstitutions(e,t){let n=this.solver,r=n.settings.isDioIgnoringBigNums;this.espace.clear(),this.constant=P.zero,this.lspace.clear(),this.lspace.add(P.one,e.column);for(let i of e.coeffs){let e=i[0],a=i[1];if(n.isFixed(e)){let t=n.getLowerBound(e).x;if(r&&t.isBig())return!1;this.constant=this.constant.add(a.mul(t));continue}let o=this.varRegister.getLocal(e);if(r&&a.isBig())return!1;this.espace.add(a,o),this.canSubstitute(o)&&t.push(o)}return!0}subsWithSAndFresh(e,t){let n=`undef`;for(;!e.isEmpty&&n!==`conflict`&&this.espace.size<=10;)n=pv(this.subsFrontWithSAndFresh(e,t),n);return n}subsFrontWithSAndFresh(e,t){this.processFixedInEspace();let n=this.tightenOnEspace(t);if(n===`conflict`)return`conflict`;let r=this.findVarToSubstituteOnEspace(e);if(r===-1)return`undef`;let i=this.freshDefinitions.hasKey(r)?this.subsByFresh(r,e,t):this.subsByS(r,e,t);return pv(i,n)}findVarToSubstituteOnEspace(e){let t=this.espace,n=-1,r=2**53-1,i=0,a=[];for(let o of e.items){if(!t.has(o)){a.push(o);continue}let e=0,s=this.keyToRow.get(o);if(s!==void 0)for(let n of this.eMatrix.rows[s])n.column!==o&&!t.has(n.column)&&e++;else if(this.freshDefinitions.hasKey(o))for(let n of this.freshDefinitions.getByKey(o).term.coeffs)n[0]!==o&&!t.has(n[0])&&e++;e<r?(r=e,n=o,i=1):e===r&&this.solver.settings.getRandomNext()%++i===0&&(n=o)}n!==-1&&e.remove(n);for(let t of a)e.remove(t);return n}subsByFresh(e,t,n){let r=this.freshDefinitions.getByKey(e).term,i=this.espace.get(e).neg();this.espace.erase(e);for(let n of r.coeffs)n[0]!==e&&(this.espace.add(n[1].mul(i),n[0]),this.espace.has(n[0])&&this.canSubstitute(n[0])&&t.push(n[0]));return this.tightenOnEspace(n)}subsByS(e,t,n){let r=this.keyToRow.get(e)??-1,i=this.sumOfFixed[r],a=this.espace.get(e);this.espace.erase(e);let o=this.eMatrix.rows[r];this.getCoeffInERow(r,e).equals(P.one)&&(a=a.neg());for(let n of o)n.column!==e&&(this.espace.add(n.coeff.mul(a),n.column),this.espace.has(n.column)&&this.canSubstitute(n.column)&&t.push(n.column));this.constant=this.constant.add(a.mul(i));for(let e of this.lMatrix.rows[r])this.lspace.add(a.mul(e.coeff),e.column);return this.tightenOnEspace(n)}processFixedInEspace(){let e=this.solver,t=[];for(let n of this.espace.data)!this.isFresh(n.column)&&e.isFixed(this.varRegister.getExternal(n.column))&&t.push(n.column);for(let n of t){let t=e.getLowerBound(this.varRegister.getExternal(n)).x;this.constant=this.constant.add(this.espace.get(n).mul(t)),this.espace.erase(n)}}tightenOnEspace(e){let t=bv(this.espace.data,!0);return t.equals(P.one)?`undef`:t.isZero()?(this.handleConstantTerm(e),this.infeasExplanation.isEmpty?`undef`:`conflict`):this.tightenBoundsForNonTrivialGcd(t,e,!0)||this.tightenBoundsForNonTrivialGcd(t,e,!1)?`conflict`:this.changedFixedColumns.has(e)?`continue`:`undef`}handleConstantTerm(e){let t=this.solver,n=this.constant;if(n.isZero())return;let r=t.getBound(e,!0),i=r!==void 0&&(n.compare(r.value)>0||r.isStrict&&n.equals(r.value)),a=i?void 0:t.getBound(e,!1),o=a!==void 0&&(n.compare(a.value)<0||a.isStrict&&n.equals(a.value));if(!i&&!o)return;let s=Q_(Q_(this.explainFixed(mv(t.getTerm(e)),P.zero),this.explainFixedInMetaTerm(this.lspace.data,P.zero)),this.solver.getBoundWitnesses(e));this.infeasExplanation.pushDependency(s)}tightenBoundsForNonTrivialGcd(e,t,n){let r=this.solver.getBound(t,n);if(r===void 0)return!1;let i=_v(r.value.sub(this.constant),e);return i.isNegative()&&(i=i.add(e)),!i.isZero()&&this.tightenBoundKind(e,t,r.value,i,n)}tightenBoundKind(e,t,n,r,i){let a=this.solver,o=i?n.sub(r):n.add(e).sub(r),s=i?a.getUpperWitness(t):a.getLowerWitness(t),c=this.openFixedFromMl(this.lspace.data);a.isFixed(t)&&c.add(P.one,t);for(let t of c.data)t.coeff.isInt()&&_v(t.coeff,e).isZero()||(s=Q_(s,this.solver.getBoundWitnesses(t.column)));if(a.settings.isCanceled())return!1;a.updateColumnTypeAndBound(t,i?-2:2,new z(o),s);let l=a.findFeasibleSolution();return l===3||l===2||l===4?!1:(a.getInfeasibilityExplanation(this.infeasExplanation),!0)}openFixedFromMl(e){let t=this.solver,n=new xv;for(let r of e)for(let e of hv(t.getTerm(r.column)))t.isFixed(e.column)&&n.add(r.coeff.mul(e.coeff),e.column);return n}explainFixedInMetaTerm(e,t){return this.explainFixed(this.openFixedFromMl(e).data,t)}explainFixed(e,t){let n=null;for(let r of e)this.solver.isFixed(r.column)&&(t.isZero()||!r.coeff.div(t).isInt())&&(n=Q_(n,this.solver.getBoundWitnesses(r.column)));return n}};const Ev=e=>{let t=e.rows[e.getRowCount()-1];for(let n=t.length;n-->0;)e.removeElement(t,t[n]);e.rows.pop()},Dv=e=>{for(;e.getColumnCount()>0&&e.columns[e.getColumnCount()-1].length===0;)e.popColumn()},Ov=(e,t,n)=>{let r=t[0];t[0]=t[n],t[n]=r,e.rows[t[0].row][t[0].offset].offset=0,e.rows[r.row][r.offset].offset=n},kv=P.of(1n,2n),Av=e=>e.sub(e.floor());var jv=class{lia;infColumn;row;polarity=0;offset=P.one;dep=null;f;oneMinusF;bigNumber=P.zero;isBigFound=!1;constructor(e,t,n){this.lia=e,this.infColumn=t,this.row=n,this.f=Av(e.solver.getValue(t).x),this.oneMinusF=P.one.sub(this.f)}setPolarity(e){this.polarity!==3&&(this.polarity===0?this.polarity=e:this.polarity!==e&&(this.polarity=3))}setPolarityForInt(e,t){let n=this.lia.atLower(t),r=!n&&this.lia.atUpper(t),i=e.isPositive()?n:r,a=e.isPositive()?r:n;this.setPolarity(i?2:a?1:3)}addMonomial(e,t){this.lia.term.addMonomial(e,t),P.of(e.num).compare(this.bigNumber)>0&&(this.isBigFound=!0)}addIntCase(e,t){let n=this.lia.solver,r=P.one.sub(t);if(this.lia.atLower(e)){let i=t.compare(this.oneMinusF)<=0?t.div(this.oneMinusF):r.div(this.f);this.offset=this.offset.add(i.mul(n.getLowerBound(e).x)),this.lia.explanation.pushDependency(n.getLowerWitness(e)),this.addMonomial(i,e);return}let i=(t.compare(this.f)<=0?t.div(this.f):r.div(this.oneMinusF)).neg();this.offset=this.offset.add(i.mul(n.getUpperBound(e).x)),this.lia.explanation.pushDependency(n.getUpperWitness(e)),this.addMonomial(i,e)}addRealCase(e,t){let n=this.lia.solver,r=this.lia.atLower(t),i=e.isPositive()===r,a=i?e.div(this.oneMinusF):e.neg().div(this.f);this.setPolarity(i?1:2);let o=r?n.getLowerBound(t):n.getUpperBound(t);this.offset=this.offset.add(a.mul(o.x)),this.lia.explanation.pushDependency(r?n.getLowerWitness(t):n.getUpperWitness(t)),this.addMonomial(a,t)}cut(){let e=this.lia,t=e.solver;e.term.clear(),e.explanation.clear();let n=P.zero;for(let e of this.row){let t=e.coeff.ceil().abs();t.compare(n)>0&&(n=t)}this.bigNumber=n.mul(n);for(let e of this.row){let n=e.column;if(n!==this.infColumn){if(t.isFixed(n))this.lia.explanation.pushDependency(t.getLowerWitness(n)),this.lia.explanation.pushDependency(t.getUpperWitness(n));else if(t.isInt(n)?(e.coeff.isInt()||this.addIntCase(n,Av(e.coeff.neg())),this.polarity!==3&&this.setPolarityForInt(e.coeff,n)):this.addRealCase(e.coeff.neg(),n),this.isBigFound)return`undef`}}if(e.term.size===0)return`conflict`;for(let t of e.explanation)this.dep=Q_(Z_(t),this.dep);return`cut`}};const Mv=(e,t)=>{let n=e.solver.getValue(t).x,r=Av(n);return r.compare(kv)<=0?r:P.one.sub(r)},Nv=(e,t)=>{let n=e.solver;for(let r of n.getRow(n.core.heading[t])){if(r.column===t)continue;let i=n.getValue(r.column);if(!(r.coeff.isInt()&&n.isInt(r.column)&&i.isInt())&&(!e.atBound(r.column)||!i.y.isZero()))return!1}return!0},Pv=(e,t)=>{let n=e.solver,r=/* @__PURE__ */ new Map,i=[];for(let t of n.core.basis)e.isColumnIntInf(t)&&Nv(e,t)&&(i.push(t),r.set(t,Mv(e,t)));i.sort((e,t)=>{let i=(r.get(e)??P.zero).compare(r.get(t)??P.zero);return i===0?n.getUsageInTerms(t)-n.getUsageInTerms(e):i});let a=[];for(let e=t;e>0&&i.length>0;e--){let e=i.length,t=n.settings.getRandomNext()%e/e,r=Math.floor(t*t*t*e);a.push(i[r]),i.splice(r,1)}return a},Fv=(e,t,n,r)=>{let i=e.solver,a=t;for(let t of n){let n=t.column;if(n===r||i.isFixed(n)||!i.isInt(n)||!t.coeff.isInt())continue;let o=e.atLower(n)?i.getLowerWitness(n):i.getUpperWitness(n);a=Q_(o,a)}return a},Iv=(e,t)=>{let n=e.solver,r=[],i=!1,a=e=>{let t=n.addTerm(e.coeffs,-1);n.updateColumnTypeAndBound(t,2,new z(e.offset),e.dep)},o=()=>(n.findFeasibleSolution(),n.isFeasible()||n.settings.isCanceled()?!0:(n.getInfeasibilityExplanation(e.explanation),!1));for(let o of Pv(e,t)){let t=n.getRow(n.core.heading[o]),s=new jv(e,o,t),c=s.cut();if(c===`conflict`)return{kind:`conflict`};if(c!==`cut`)continue;let l=n.getValue(o).x;s.polarity===2?n.updateColumnTypeAndBound(o,-2,new z(l.floor()),Fv(e,s.dep,t,o)):s.polarity===1&&n.updateColumnTypeAndBound(o,2,new z(l.ceil()),Fv(e,s.dep,t,o));let u={coeffs:[...e.term.coeffs],offset:s.offset,dep:s.dep};if(u.coeffs.some(e=>e[1].isBig()))r.push(u);else if(i=!0,a(u),n.settings.isCanceled())return{kind:`undef`}}if(r.length>0){n.push();for(let e of r)a(e);let e=o();if(n.pop(1),!e)for(let e of r)a(e)}return o()?n.status===4?{kind:`undef`}:n.hasInfInt()?i||r.length>0?{kind:`continue`}:(n.moveNonBasicColumnsToBounds(),{kind:`undef`}):{kind:`sat`}:{kind:`conflict`}},Lv=(e,t)=>P.of(e.num%t.num),Rv=(e,t)=>{let n=e.num<0n?-e.num:e.num,r=t.num<0n?-t.num:t.num,i=1n,a=0n,o=0n,s=1n;for(n<r&&([n,r]=[r,n],[i,a]=[a,i],[o,s]=[s,o]);r>0n;){let e=n/r;[n,r]=[r,n%r],[i,o]=[o,i-e*o],[a,s]=[s,a-e*s]}return{gcd:P.of(n),u:P.of(e.num<0n?-i:i),v:P.of(t.num<0n?-a:a)}},zv=(e,t)=>{if(e.isZero())return{d:t,u:P.zero,v:P.one};if(t.isZero())return{d:e,u:P.one,v:P.zero};let n=Rv(e,t),r=n.gcd,i=n.u,a=n.v;if(r.isNegative()&&(r=r.neg(),i=i.neg(),a=a.neg()),r.equals(e))return{d:r,u:P.one,v:P.zero};if(r.equals(e.neg()))return{d:r,u:P.minusOne,v:P.zero};let o=e.abs().div(r),s=P.of(a.num/o.num),c=P.of(a.num%o.num);c.isNegative()&&(c=c.add(o),s=s.sub(P.one));let l=t.div(r),u=t.isPositive()?s.add(P.one):s;return a=t.isPositive()?c.sub(o):c,i=e.isPositive()?i.add(u.mul(l)):i.sub(u.mul(l)),{d:r,u:i,v:a}};var Bv=class e{forward;reverse;constructor(e,t){this.forward=e,this.reverse=t}static identity(t){let n=(e,t)=>t;return new e(Array.from({length:t},n),Array.from({length:t},n))}copy(){return new e([...this.forward],[...this.reverse])}setValue(e,t){this.forward[e]=t,this.reverse[t]=e}transposeFromLeft(e,t){let n=this.reverse[e],r=this.reverse[t];this.setValue(n,t),this.setValue(r,e)}transposeFromRight(e,t){let n=this.forward[e],r=this.forward[t];this.setValue(e,r),this.setValue(t,n)}},Vv=class e{rowPermutation;columnPermutation;data;constructor(e,t){this.rowPermutation=Bv.identity(e),this.columnPermutation=Bv.identity(t),this.data=Array.from({length:e},()=>Array.from({length:t},()=>P.zero))}copy(){let t=new e(0,0);return t.rowPermutation=this.rowPermutation.copy(),t.columnPermutation=this.columnPermutation.copy(),t.data=this.data.map(e=>[...e]),t}getRowCount(){return this.data.length}getColumnCount(){return this.data.length>0?this.data[0].length:0}adjustRow(e){return this.rowPermutation.forward[e]}get(e,t){return this.data[this.adjustRow(e)][this.columnPermutation.reverse[t]]}set(e,t,n){this.data[this.adjustRow(e)][this.columnPermutation.reverse[t]]=n}transposeRows(e,t){this.rowPermutation.transposeFromRight(e,t)}transposeColumns(e,t){this.columnPermutation.transposeFromLeft(e,t)}shrinkToRank(e){e.length!==this.getRowCount()&&(this.data=e.map(e=>this.data[e]))}};const Hv=(e,t)=>{for(let n=t;n<e.getRowCount();n++)for(let r=t;r<e.getColumnCount();r++)if(!e.get(n,r).isZero())return n!==t&&e.transposeRows(n,t),r!==t&&e.transposeColumns(r,t),!0;return!1},Uv=(e,t,n)=>{let r=e.get(t,t),i=t>0?e.get(t-1,t-1):void 0;for(let a=t+1;a<e.getColumnCount();a++){let o=e.get(t,a);for(let s=t+1;s<e.getRowCount();s++){let c=e.get(s,a).mul(r).sub(e.get(s,t).mul(o));if(i!==void 0&&(c=c.div(i)),e.set(s,a,c),c.compare(n)>=0)return!1}}return!0},Wv=(e,t,n)=>{let r=e.copy(),i=0;for(;i<r.getRowCount()&&Hv(r,i);i++)if(!Uv(r,i,n))return n;if(i===0)return P.one;for(let e=0;e<i;e++)t.push(r.adjustRow(e));let a=i-1,o=P.zero,s=a;for(;s<r.getColumnCount()&&o.isZero();s++){let e=r.get(a,s);e.isZero()||(o=e.abs())}for(;s<r.getColumnCount();s++){let e=r.get(a,s);e.isZero()||(o=Rv(o,e).gcd)}return o},Gv=(e,t,n)=>{let r=e.data.map(e=>[...e]),i=e.getRowCount(),a=e.getColumnCount();if(i===0||a===0||t.isZero())return r;let o=[],s=t,c=s.div(P.of(2n)).floor(),l=e=>{let t=Lv(e,s);return t.compare(c)>0?t.sub(s):t.compare(c.neg())<0?t.add(s):t},u=e=>{let t=Lv(e,s);return t.isNegative()?t.add(s):t};for(let e=0;e<i;e++){if(n())return;for(let t=e+1;t<a;t++){let n=zv(r[e][e],r[e][t]);if(n.d.isZero())continue;let a=u(r[e][e].div(n.d)),s=u(r[e][t].div(n.d));for(let a=e;a<i;a++)o[a]=l(l(n.u.mul(r[a][e])).add(l(n.v.mul(r[a][t]))));r[e][t]=P.zero;for(let n=e+1;n<i;n++)r[n][t]=l(l(s.neg().mul(r[n][e])).add(l(a.mul(r[n][t]))));for(let t=e;t<i;t++)r[t][e]=o[t]}let t=s,d=P.one;if(r[e][e].isZero())r[e][e]=s;else{let n=zv(r[e][e],s);t=n.d,d=n.u}r[e][e]=u(r[e][e].mul(d)),r[e][e].isZero()&&(r[e][e]=t);let f=r[e][e];for(let t=e+1;t<i;t++)r[t][e]=l(r[t][e].mul(d));for(let t=0;t<e;t++){let n=r[e][t];if(!n.isPositive()&&n.neg().compare(f)<0)continue;let a=n.div(f).ceil();for(let n=e;n<i;n++)r[n][t]=r[n][t].sub(a.mul(r[n][e]))}s=s.div(r[e][e]),c=s.div(P.of(2n)).floor()}return r},Kv=(e,t)=>{let n=e.solver,r=t.column;if(!n.isInt(r))return;let i=P.zero;for(let e of t.coeffs){let t=n.getValue(e[0]);if(!t.y.isZero())return;i=i.add(t.x.mul(e[1]))}let a=n.getUpperWitness(r),o=n.getUpperBound(r);if(a!==null&&!o.y.isNegative()&&i.equals(o.x))return{term:t,isUpper:!0,rightSide:i,dep:a};let s=n.getLowerWitness(r),c=n.getLowerBound(r);if(s!==null&&!c.y.isPositive()&&i.equals(c.x))return{term:t,isUpper:!1,rightSide:i.neg(),dep:s}},qv=(e,t)=>{let n=-1,r=0;for(let i=0;i<t.length;i++)t[i].isInt()||(r===0?(r=1,n=i):e.solver.settings.getRandomNext()%++r===0&&(n=i));return n},Jv=e=>{let t=e.solver,n=t.settings,r=[],i=[],a=/* @__PURE__ */ new Map,o=P.zero;for(let s of t.terms){if(r.length>=n.limitOnRowsForHnfCutter||i.length>=n.limitOnColumnsForHnfCutter)continue;let t=Kv(e,s);if(t!==void 0){r.push(t);for(let e of s.coeffs){a.has(e[0])||(a.set(e[0],i.length),i.push(e[0]));let t=e[1].ceil().abs();t.compare(o)>0&&(o=t)}}}if(i.every(e=>t.getValue(e).isInt()))return{kind:`undef`};let s=new Vv(r.length,i.length);r.forEach((e,t)=>{let n=e.isUpper?P.one:P.minusOne;for(let r of e.term.coeffs)s.data[t][a.get(r[0])??0]=n.mul(r[1])});let c=[],l=o.mul(o).mul(o),u=Wv(s,c,l);if(u.compare(l)>=0||n.isCanceled())return{kind:`undef`};let d=c.length===r.length;s.shrinkToRank(c);let f=d?r.map(e=>e.dep):c.map(e=>r[e].dep),p=Gv(s,u,()=>n.isCanceled());if(p===void 0)return{kind:`undef`};let m=d?r.map(e=>e.rightSide):c.map(e=>r[e].rightSide);for(let e=0;e<p.length;e++){for(let t=0;t<e;t++)m[e]=m[e].sub(p[e][t].mul(m[t]));m[e]=m[e].div(p[e][e])}let h=qv(e,m);if(h===-1)return{kind:`undef`};let g=Array.from({length:s.getColumnCount()},()=>P.zero);g[h]=P.one.div(p[h][h]);for(let e=h-1;e>=0;e--){let t=P.zero;for(let n=e+1;n<=h;n++)t=t.add(p[n][e].mul(g[n]));g[e]=t.neg().div(p[e][e])}for(let t=0;t<s.getColumnCount();t++){let n=P.zero;for(let e=0;e<s.getRowCount();e++)n=n.add(g[e].mul(s.get(e,t)));n.isZero()||e.term.addMonomial(n,i[t])}e.explanation.clear();for(let t of f)e.explanation.pushDependency(t);return{kind:`cut`,offset:m[h].floor(),isUpper:!0}};var Yv=class{isCanceled;random=new Kg(0);stats={makeFeasible:0,pivots:0,patches:0,patchesSuccess:0,gcdCalls:0,gcdConflicts:0,branches:0,bpRowsAnalyzed:0,offsetEqs:0,fixedEqs:0,dioCalls:0,dioTightenConflicts:0,dioRewriteConflicts:0,dioStateResets:0,lcubeCalls:0,lcubeSuccess:0,lcubeFlipSuccess:0,nlaCalls:0,nlaAddBounds:0,nlaPropagateBounds:0,nlaPropagateEq:0,nlaLemmas:0,nlaBoundsImprovements:0,nlaThrottledLemmas:0,nraCalls:0};maxRowLengthForBoundPropagation=300;maxIterationsWithNoImprovements=2e6;isPropagatingEqs=!0;intFindCubePeriod=4;lcubeFlips=16;hnfCutPeriod=4;limitOnRowsForHnfCutter=75;limitOnColumnsForHnfCutter=150;intGomoryCutPeriod=4;dioCallsPeriod=1;dioCallsPeriodDecrease=2;dioGomoryEnablePeriod=16;isRunningGomoryWithDio=!1;isDioIgnoringBigNums=!0;dioUndoMaxWork=1e6;constructor(e){this.isCanceled=e}getRandomNext(e){let t=this.random.next();return e===void 0?t:t%e}};const Xv=e=>[...e.coeffs].map(e=>`${e[0]}:${e[1]}`).sort().join(`,`);var Zv=class{settings;core;constraints=new ev;columns=[];terms=[];touchedRows=new tv;columnsWithChangedBounds=new tv;rowBoundsToReplay=[];status=0;crossedBoundsColumn=-1;crossedBoundsDeps=null;externalToLocal=/* @__PURE__ */ new Map;localToExternal=[];localIsInt=[];trail=[];trailScopes=[];usageInTerms=new rv;fixedVarTableInt=/* @__PURE__ */ new Map;fixedVarTableReal=/* @__PURE__ */ new Map;fixedBaseVarSet=new tv;normalizedTermsToColumns=/* @__PURE__ */ new Map;isRegisteringTerms=!1;delta=P.zero;onChangedBounds;onAddTerm;onColumnBoundUpdate;constructor(e){this.settings=new Yv(e),this.core=new dv(this.settings),this.core.touchedRows=this.touchedRows}getColumnCount(){return this.core.matrix.getColumnCount()}getRowCount(){return this.core.matrix.getRowCount()}getValue(e){return this.core.x[e]}getLowerBound(e){return this.core.lowerBounds[e]}getUpperBound(e){return this.core.upperBounds[e]}isInt(e){return this.localIsInt[e]}isBase(e){return this.core.isBase(e)}isFixed(e){return this.core.isFixed(e)}isFree(e){return this.core.getColumnType(e)===0}hasTerm(e){return this.columns[e].term!==null}getTerm(e){let t=this.columns[e].term;if(t===null)throw new r(`column ${e} has no term`);return t}externalToLocalColumn(e){return this.externalToLocal.get(e)??-1}getExternal(e){return this.localToExternal[e]}isFeasible(){return this.status===2||this.status===3}getRow(e){return this.core.matrix.rows[e]}getUsageInTerms(e){return e<this.usageInTerms.values.length?this.usageInTerms.get(e):0}registerExternal(e,t){let n=this.localToExternal.length;this.localToExternal.push(e),this.localIsInt.push(t),e!==-1&&this.externalToLocal.set(e,n)}addNewVarToCoreFields(e){this.core.addColumn(e),e&&this.addTouchedRow(this.getRowCount()-1)}pushUndoAddColumn(){this.trail.push(()=>{let e=this.columns[this.columns.length-1];e.term!==null&&(this.isRegisteringTerms&&this.deregisterNormalizedTerm(e.term),this.terms.pop()),this.removeLastColumnFromTableau(),this.columns.pop();let t=this.columns.length;this.columnsWithChangedBounds.has(t)&&this.columnsWithChangedBounds.delete(t)})}addVar(e,t){let n=this.externalToLocal.get(e);if(n!==void 0)return n;let r=this.getColumnCount();for(this.columns.push({lowerWitness:null,upperWitness:null,term:null}),this.pushUndoAddColumn();this.usageInTerms.values.length<=r;)this.usageInTerms.push(0);return this.registerExternal(e,t),this.core.columnTypes.push(0),this.addNewVarToCoreFields(!1),r}isTermInt(e){for(let t of e.coeffs)if(!this.isInt(t[0])||!t[1].isInt())return!1;return!0}substKnownTerms(e){let t=/* @__PURE__ */ new Set;for(let n of e.coeffs)this.hasTerm(n[0])&&t.add(n[0]);for(;t.size>0;){let n=Math.min(...t);t.delete(n);let r=this.getTerm(n);for(let e of r.coeffs)this.hasTerm(e[0])&&t.add(e[0]);e.substByTerm(r,n)}}addTerm(e,t){let n=new B(e);this.substKnownTerms(n),this.terms.push(n);let r=this.getColumnCount();this.registerExternal(t,this.isTermInt(n)),n.column=r,this.columns.push({lowerWitness:null,upperWitness:null,term:n}),this.pushUndoAddColumn(),this.core.columnTypes.push(0),this.addNewVarToCoreFields(!0),this.core.matrix.fillLastRowWithPivoting(n,r,this.core.heading),this.core.x[r]=this.getBasicVarValueFromRow(this.getRowCount()-1);for(let e of n.coeffs){for(;this.usageInTerms.values.length<=e[0];)this.usageInTerms.push(0);this.usageInTerms.set(e[0],this.usageInTerms.get(e[0])+1)}return this.isRegisteringTerms&&this.registerNormalizedTerm(n,r),this.onAddTerm?.(n),r}getBasicVarValueFromRow(e){let t=this.core.basis[e],n=z.zero;for(let r of this.core.matrix.rows[e]){if(r.column===t)continue;let e=this.core.x[r.column];e.isZero()||(n=n.sub(e.mul(r.coeff)))}return n}registerNormalizedTerm(e,t){let n=e.getNormalized(),r=Xv(n.term);this.normalizedTermsToColumns.has(r)||this.normalizedTermsToColumns.set(r,{coeff:n.coeff,column:t})}deregisterNormalizedTerm(e){this.normalizedTermsToColumns.delete(Xv(e.getNormalized().term))}registerExistingTerms(){if(!this.isRegisteringTerms)for(let e of this.terms)this.registerNormalizedTerm(e,e.column);this.isRegisteringTerms=!0}fetchNormalizedTermColumn(e){return this.normalizedTermsToColumns.get(Xv(e))}removeLastColumnFromTableau(){let e=this.core,t=e.matrix,n=t.getColumnCount()-1;if(this.columns[n].term!==null){let r=t.getRowCount()-1,i=t.columns[n],a=-1,o=!1;for(let e=i.length;e-->0;){if(i[e].row===r){o=!0;break}a=e}o||e.transposeRows(i[a].row,r),e.heading[n]<0&&e.pivotColumnTableau(n,r);let s=t.rows[r];for(let e=s.length;e-->0;)t.removeElement(s,s[e]);t.rows.pop(),t.popColumn(),e.heading[n]<0&&e.changeBasisUnconditionally(n,e.basis[t.getRowCount()])}else t.popColumn();e.removeLastColumn(n)}setUpperBoundWitness(e,t,n){let r=this.columns[e],i=this.core.upperBounds[e],a=r.upperWitness;this.trail.push(()=>{this.core.upperBounds[e]=i,r.upperWitness=a}),r.upperWitness=t,this.core.upperBounds[e]=n,this.columnsWithChangedBounds.add(e)}setLowerBoundWitness(e,t,n){let r=this.columns[e],i=this.core.lowerBounds[e],a=r.lowerWitness;this.trail.push(()=>{this.core.lowerBounds[e]=i,r.lowerWitness=a}),r.lowerWitness=t,this.core.lowerBounds[e]=n,this.columnsWithChangedBounds.add(e)}setCrossedBounds(e,t,n){if(this.crossedBoundsColumn!==-1)return;this.status=1,this.crossedBoundsColumn=e;let r=this.columns[e];this.crossedBoundsDeps=Q_(t?r.lowerWitness:r.upperWitness,n)}adjustBoundForInt(e,t,n){return!this.isInt(e)||n.isInt()?{kind:t,bound:n}:t===-1||t===-2?{kind:-2,bound:n.floor()}:t===1||t===2?{kind:2,bound:n.ceil()}:{kind:t,bound:n}}mkVarBound(e,t,n){let r=this.adjustBoundForInt(e,t,n);return this.constraints.add(e,r.kind,new z(r.bound))}constraintIsRedundant(e){let t=this.constraints.constraints[e],n=t.column,r=t.rhs;if(this.isInt(n)&&!r.x.isInt())return!1;let i=t.kind;if(i===-2||i===-1){if(!this.core.hasUpperBound(n))return!1;let e=this.getUpperBound(n);return e.x.equals(r.x)?(i===-1?e.y.add(P.one):e.y).compare(r.y)<=0:e.x.compare(r.x)<0}if(i===2||i===1){if(!this.core.hasLowerBound(n))return!1;let e=this.getLowerBound(n);return e.x.equals(r.x)?(i===1?r.y.add(P.one):r.y).compare(e.y)<=0:e.x.compare(r.x)>0}return!1}activate(e){this.constraints.activate(e);let t=this.constraints.constraints[e];this.updateColumnTypeAndBound(t.column,t.kind,t.rhs,t.dep)}activateCheckOnEqual(e){this.activate(e);let t=this.constraints.constraints[e].column;if(!this.isFixed(t))return-1;let n=this.getLowerBound(t);if(!n.y.isZero())return-1;let r=n.x.toString(),i=this.isInt(t)?this.fixedVarTableInt:this.fixedVarTableReal,a=i.get(r);return a===void 0?(i.set(r,t),-1):a!==t&&this.isFixed(a)?a:-1}findInFixedTables(e,t){return(t?this.fixedVarTableInt:this.fixedVarTableReal).get(e.toString())}updateColumnTypeAndBound(e,t,n,r){let i=this.adjustBoundForInt(e,t,n.x),a=i.kind,o=this.core,s=o.hasUpperBound(e),c=o.hasLowerBound(e),l=t=>o.columnTypes.set(e,t),u=a===-2||a===-1,d=a===2||a===1,f=a===-1?n.y.sub(P.one):a===1?n.y.add(P.one):n.y,p=new z(i.bound,a===0?P.zero:f),m=this.getLowerBound(e),h=this.getUpperBound(e);u?c&&p.compare(m)<0?this.setCrossedBounds(e,!0,r):(!s||p.compare(h)<0)&&(this.setUpperBoundWitness(e,r,p),s||l(c?p.equals(m)?4:3:2)):d?s&&p.compare(h)>0?this.setCrossedBounds(e,!1,r):(!c||p.compare(m)>=0)&&(this.setLowerBoundWitness(e,r,p),s?l(p.equals(h)?4:3):c||l(1)):a===0&&(s&&p.compare(h)>0?this.setCrossedBounds(e,!1,r):c&&p.compare(m)<0?this.setCrossedBounds(e,!0,r):(this.setUpperBoundWitness(e,r,p),this.setLowerBoundWitness(e,r,p),l(4))),s&&c&&this.getLowerBound(e).equals(this.getUpperBound(e))&&l(4),this.isBase(e)&&this.isFixed(e)&&this.fixedBaseVarSet.add(e),this.onColumnBoundUpdate?.(e)}addTouchedRow(e){this.touchedRows.add(e)}addColumnRowsToTouchedRows(e){for(let t of this.core.matrix.columns[e])this.addTouchedRow(t.row)}changeBasicColumnsDependingOn(e,t){let n=this.core;for(let r of n.matrix.columns[e])n.submulFromXAndTrackFeasibility(n.basis[r.row],t,n.matrix.getVal(r))}setValueForNbasicColumn(e,t){let n=t.sub(this.core.x[e]);this.core.x[e]=t,this.changeBasicColumnsDependingOn(e,n)}findFeasibleSolution(){if(this.settings.stats.makeFeasible++,this.status===1)return this.status;let e=this.core;for(let t of this.columnsWithChangedBounds.elems){if(e.isBase(t)){e.trackColumnFeasibility(t);continue}let n=e.makeColumnFeasible(t);n!==void 0&&this.changeBasicColumnsDependingOn(t,n)}if(e.solve(),this.status=e.status,this.status===1||this.status===4)return this.status;for(let t of this.columnsWithChangedBounds.elems)e.isBase(t)?this.addTouchedRow(e.heading[t]):this.addColumnRowsToTouchedRows(t);return this.onChangedBounds?.(this.columnsWithChangedBounds),this.columnsWithChangedBounds.clear(),this.status}getInfeasibilityExplanation(e){if(e.clear(),this.crossedBoundsColumn!==-1){for(let t of $_([this.crossedBoundsDeps]))e.addPair(t,P.minusOne);return}let t=this.core,n=t.infeasibleSumSign;if(n!==0)for(let r of t.infeasibleCombination){let t=r[0].isPositive()?n:-n,i=this.columns[r[1]],a=t<0?i.upperWitness:i.lowerWitness;for(let t of $_([a]))e.addPair(t,r[0])}}removeFixedVarsFromBase(){let e=this.core,t=this.getColumnCount(),n=[];e.withoutTouchedRows(()=>{for(let r of this.fixedBaseVarSet.elems)if(r>=t||!this.isBase(r)||!this.isFixed(r))n.push(r);else for(let t of e.matrix.rows[e.heading[r]])if(!this.isFixed(t.column)){e.pivot(t.column,r),n.push(r);break}});for(let e of n)this.fixedBaseVarSet.delete(e)}removeFromBasis(e){let t=this.core;for(let n of t.matrix.rows[t.heading[e]])if(!(n.column===e||this.isFixed(n.column)))return t.pivot(n.column,e),!0;return!1}insideBounds(e,t){let n=this.core;return n.hasUpperBound(e)&&t.compare(n.upperBounds[e])>0?!1:!(n.hasLowerBound(e)&&t.compare(n.lowerBounds[e])<0)}tryToPatch(e,t,n,r){let i=this.core;if(this.isBase(e)&&!this.removeFromBasis(e))return!1;let a=new z(t);if(n(e,a))return!1;let o=i.x[e].sub(a);for(let t of i.matrix.columns[e]){let e=i.basis[t.row];if(n(e,o.mul(i.matrix.getVal(t)).add(i.x[e])))return!1}let s=a.sub(i.x[e]);i.x[e]=a,r(e);for(let t of i.matrix.columns[e]){let e=i.basis[t.row];i.addDeltaToXAndTrackFeasibility(e,s.mul(i.matrix.getVal(t).neg())),r(e)}return!0}moveNonBasicColumnsToBounds(){let e=this.core,t=!1;for(let n of e.nbasis)this.moveNonBasicColumnToBounds(n)&&(t=!0);t&&this.findFeasibleSolution()}moveNonBasicColumnToBounds(e){let t=this.core,n=t.x[e],r=t.lowerBounds[e],i=t.upperBounds[e];switch(t.getColumnType(e)){case 3:return n.equals(r)||n.equals(i)?!1:(this.setValueForNbasicColumn(e,r),!0);case 1:return!n.equals(r)&&(this.setValueForNbasicColumn(e,r),!0);case 4:case 2:return!n.equals(i)&&(this.setValueForNbasicColumn(e,i),!0);default:return!this.isInt(e)||n.isInt()?!1:(this.setValueForNbasicColumn(e,new z(n.floor())),!0)}}hasInfInt(){for(let e=0;e<this.getColumnCount();e++)if(this.isInt(e)&&!this.core.x[e].isInt())return!0;return!1}initModel(){if(this.status!==2&&this.status!==3||this.columnsWithChangedBounds.size>0)return!1;let e=this.core,t=P.one,n=(e,n)=>{if(e.x.compare(n.x)<0&&e.y.compare(n.y)>0){let r=n.x.sub(e.x).div(e.y.sub(n.y));r.compare(t)<0&&(t=r)}};for(let t=0;t<this.getColumnCount();t++)e.hasLowerBound(t)&&n(e.lowerBounds[t],e.x[t]),e.hasUpperBound(t)&&n(e.x[t],e.upperBounds[t]);let r=/* @__PURE__ */ new Map;for(let t of e.x)r.set(t.toString(),t);for(;;){let e=/* @__PURE__ */ new Set;for(let n of r.values())e.add(n.x.add(t.mul(n.y)).toString());if(e.size===r.size)break;t=t.div(P.of(2n))}return this.delta=t,!0}getModelValue(e){let t=this.core.x[e];return t.x.add(this.delta.mul(t.y))}getExactValue(e){let t=this.columns[e].term;if(t===null){let t=this.core.x[e];return t.y.isZero()?t.x:void 0}let n=P.zero;for(let e of t.coeffs){let t=this.core.x[e[0]];if(!t.y.isZero())return;n=n.add(t.x.mul(e[1]))}return n}getBound(e,t){if(e>=this.columns.length)return;let n=this.columns[e],r=t?n.upperWitness:n.lowerWitness;if(r===null)return;let i=t?this.core.upperBounds[e]:this.core.lowerBounds[e];return{dep:r,value:i.x,isStrict:t?i.y.isNegative():i.y.isPositive()}}getRidOfInfEps(){let e=this.core,t=this.getColumnCount();if(e.x.slice(0,t).every(e=>e.y.isZero()))return;let n=P.one,r=(e,t)=>{if(e.x.compare(t.x)<0&&e.y.compare(t.y)>0){let r=t.x.sub(e.x).div(e.y.sub(t.y));r.compare(n)<0&&(n=r)}};for(let n=0;n<t;n++)e.hasLowerBound(n)&&r(e.lowerBounds[n],e.x[n]),e.hasUpperBound(n)&&r(e.x[n],e.upperBounds[n]);for(let r=0;r<t;r++){let t=e.x[r];t.y.isZero()||(e.x[r]=new z(t.x.add(n.mul(t.y))))}}getBoundWitnesses(e){return Q_(this.columns[e].lowerWitness,this.columns[e].upperWitness)}collectMoreRowsForLpPropagation(){for(let e of this.columnsWithChangedBounds.elems)this.core.isBase(e)?this.addTouchedRow(this.core.heading[e]):this.addColumnRowsToTouchedRows(e)}getLowerWitness(e){return this.columns[e].lowerWitness}getUpperWitness(e){return this.columns[e].upperWitness}pushTrail(e){this.trail.push(e)}push(){this.trailScopes.push(this.trail.length),this.crossedBoundsColumn=-1,this.crossedBoundsDeps=null,this.core.pushScope(),this.constraints.pushScope(),this.usageInTerms.pushScope()}pop(e){this.crossedBoundsColumn=-1,this.crossedBoundsDeps=null;let t=this.trailScopes[this.trailScopes.length-e];for(N(this.trailScopes,this.trailScopes.length-e);this.trail.length>t;)this.trail.pop()?.();let n=this.columns.length;for(let e=this.localToExternal.length;e-->n;){let t=this.localToExternal[e];t!==-1&&this.externalToLocal.delete(t)}N(this.localToExternal,n),N(this.localIsInt,n),this.core.popScope(e);for(let e of[this.fixedVarTableInt,this.fixedVarTableReal])for(let t of e)(t[1]>=n||!this.isFixed(t[1]))&&e.delete(t[0]);for(let e of this.rowBoundsToReplay)this.addTouchedRow(e);this.rowBoundsToReplay=[];let r=this.getRowCount();for(let e of this.touchedRows.elems.filter(e=>e>=r))this.touchedRows.delete(e);this.cleanInfHeapAfterPop(),this.constraints.popScope(e),this.usageInTerms.popScope(e),this.status=0}cleanInfHeapAfterPop(){let e=this.core,t=this.getColumnCount();for(let n of[...e.infHeap].filter(e=>e>=t))e.infHeap.erase(n);let n=[];for(let t of Array.from(e.infHeap)){if(e.isBase(t))continue;let r=e.makeColumnFeasible(t);r!==void 0&&this.changeBasicColumnsDependingOn(t,r),n.push(t)}for(let t of n)e.infHeap.has(t)&&e.infHeap.erase(t);for(let t of Array.from(e.infHeap))e.columnIsFeasible(t)&&e.infHeap.erase(t)}addEquality(e,t){let n=this.addTerm([[e,P.one],[t,P.minusOne]],-1);this.getValue(e).equals(this.getValue(t))||(this.status=0);let r=this.mkVarBound(n,-2,P.zero);this.activate(r);let i=this.mkVarBound(n,2,P.zero);return this.activate(i),[r,i]}};const Qv=(e,t)=>{e.isUnlimited?(e.theta=t,e.isUnlimited=!1):t.compare(e.theta)<0&&(e.theta=t)},$v=e=>{e.theta.compare(z.zero)<0&&(e.theta=z.zero)},ey=e=>{e.theta=z.zero,e.isUnlimited=!1};var ty=class{core;reducedCosts;sortCounter=0;nonBasisList=[];signOfEnteringDelta=1;constructor(e,t){this.core=e,this.reducedCosts=t}solve(){let e=this.core,t=e.settings;e.status=3;do if(t.isCanceled()||(this.oneIteration(),t.isCanceled())){e.status=4;return}while(e.status!==5&&e.status!==2&&e.status!==1)}oneIteration(){let e=this.core,t=this.chooseEntering();if(t===-1){e.status=e.isFeasible()?2:1;return}let n={theta:z.zero,isUnlimited:!0},r=this.findLeaving(t,n);r===-1?e.status=5:this.advance(t,r,n.theta)}sortNonBasis(){let e=this.core,t=e.matrix.columns;e.nbasis.sort((e,n)=>{let r=t[e].length,i=t[n].length;return r===0&&i!==0?1:r!==0&&i===0?-1:r===i?e-n:r-i}),this.nonBasisList=e.nbasis.slice();for(let t=0;t<e.nbasis.length;t++)e.heading[e.nbasis[t]]=-t-1}getNumberToTry(){let e=this.core.nbasis.length,t=e>300?Math.floor(e*5/100):e;return t===0?0:Math.max(this.core.settings.getRandomNext()%t,1)}chooseEntering(){let e=this.core;this.sortCounter===0?(this.sortNonBasis(),this.sortCounter=20):this.sortCounter--;let t=this.getNumberToTry();if(t===0)return-1;let n=e.matrix.getRowCount()+1,r=-1,i=0,a=this.nonBasisList;for(let o=0;t>0&&o<a.length;o++){let s=a[o];if(!this.isBeneficial(s))continue;let c=e.matrix.columns[s].length;c<n?(n=c,r=o,t--,i=1):c===n&&e.settings.getRandomNext(++i)===0&&(r=o)}if(r===-1)return-1;let o=a[r];return this.signOfEnteringDelta=this.reducedCosts[o].isPositive()?1:-1,a.splice(r,1),a.push(o),o}isBeneficial(e){let t=this.core,n=this.reducedCosts[e];if(n.isZero())return!1;switch(t.getColumnType(e)){case 0:return!0;case 1:return n.isPositive();case 2:return n.isNegative();case 3:return n.isPositive()?t.x[e].equals(t.lowerBounds[e]):t.x[e].equals(t.upperBounds[e]);default:return!1}}findLeaving(e,t){let n=this.core,r=n.matrix,i=r.columns[e],a=P.fromNumber(this.signOfEnteringDelta),o=[],s=r.getColumnCount()+1,c=0;for(;c<i.length&&t.isUnlimited;c++){let e=i[c],l=n.basis[e.row];this.limitThetaOnBasisColumn(l,r.getVal(e).neg().mul(a),t),!t.isUnlimited&&(o.push(l),s=r.rows[e.row].length)}if(t.isUnlimited)return n.getColumnType(e)===3?(t.theta=this.signOfEnteringDelta>0?n.upperBounds[e].sub(n.x[e]):n.x[e].sub(n.lowerBounds[e]),e):-1;for(;c<i.length;c++){let e=i[c],l=n.basis[e.row],u={theta:z.zero,isUnlimited:!0};if(this.limitThetaOnBasisColumn(l,r.getVal(e).neg().mul(a),u),u.isUnlimited)continue;let d=r.rows[e.row].length,f=u.theta.compare(t.theta);f<0?(t.theta=u.theta,o=[l],s=d):f===0&&d<s?(o=[l],s=d):f===0&&d===s&&o.push(l)}if(n.getColumnType(e)===3){let r=n.upperBounds[e].sub(n.lowerBounds[e]);if(r.compare(t.theta)<=0)return t.theta=r,e}return o.length===1?o[0]:o[n.settings.getRandomNext()%o.length]}limitThetaOnBasisColumn(e,t,n){let r=this.core,i=r.x[e],a=r.lowerBounds[e],o=r.upperBounds[e],s=r.isFeasible(),c=e=>Qv(n,e.sub(i).div(t)),l=e=>{c(e),$v(n)};switch(r.getColumnType(e)){case 0:break;case 2:s?t.isPositive()&&l(o):t.isPositive()?i.compare(o)<0?c(o):i.compare(o)===0&&ey(n):i.compare(o)>0&&c(o);break;case 1:s?t.isNegative()&&l(a):t.isNegative()?i.compare(a)>0?c(a):i.compare(a)===0&&ey(n):i.compare(a)<0&&c(a);break;case 4:case 3:s?l(t.isPositive()?o:a):t.isPositive()?i.compare(a)<0?c(a):i.compare(o)<0?c(o):i.compare(o)<=0&&ey(n):i.compare(o)>0?c(o):i.compare(a)>0?c(a):i.compare(a)>=0&&ey(n)}n.isUnlimited||$v(n)}advance(e,t,n){let r=this.core,i=P.fromNumber(this.signOfEnteringDelta);e===t?this.updateX(e,n.mul(i)):(n.isZero()||this.updateX(e,r.isFeasible()?n.mul(i):n),r.pivot(e,t),this.nonBasisList[this.nonBasisList.length-1]=t)}updateX(e,t){let n=this.core;n.x[e]=n.x[e].add(t);for(let r of n.matrix.columns[e])n.addDeltaToXAndTrackFeasibility(n.basis[r.row],t.mul(n.matrix.getVal(r)).neg())}};const ny=(e,t)=>{let n=e.core;e.moveNonBasicColumnsToBounds();let r=n.x.map(()=>P.zero);for(let e of t.coeffs){let t=e[0],i=n.heading[t];if(i<0)r[t]=r[t].add(e[1]);else for(let a of n.matrix.rows[i])a.column!==t&&(r[a.column]=r[a.column].sub(e[1].mul(a.coeff)))}n.reducedCosts=r,new ty(n,r).solve(),n.reducedCosts=void 0;let i=n.status;return n.status=2,i===5||i===4?void 0:t.apply(n.x)},ry=(e,t)=>{let n=e.hasTerm(t)?e.getTerm(t):new B([[t,P.one]]),r=e.core.x.slice(),i=ny(e,n);if(i===void 0)e.core.x.splice(0,r.length,...r);else return e.status=2,i},iy=P.of(1n,2n),ay=(e,t)=>{let n=[...t.coeffs];if(n.length===2){let t=!1,r=!1;if(n.every(n=>{if(!e.isInt(n[0]))return!1;if(n[1].equals(P.one))t=!0;else if(n[1].equals(P.minusOne))r=!0;else return!1;return!0}))return t&&r?z.zero:new z(P.zero,P.one)}let r=P.zero;for(let t of n)e.isInt(t[0])&&(r=r.add(t[1].abs()));return new z(r.mul(iy))},oy=(e,t,n,r)=>e.activate(e.mkVarBound(t,n,r)),sy=(e,t,n)=>{let r=e.core,i=r.hasUpperBound(t),a=r.hasLowerBound(t);if(i&&a&&e.getUpperBound(t).sub(n).compare(e.getLowerBound(t).add(n))<0)return!1;if(i){let r=e.getUpperBound(t),i=!n.y.isZero()||!r.y.isZero();oy(e,t,i?-1:-2,r.x.sub(n.x))}if(a){let r=e.getLowerBound(t),i=!n.y.isZero()||!r.y.isZero();oy(e,t,i?1:2,r.x.add(n.x))}return!0},cy=e=>{let t=e.core.x,n=/* @__PURE__ */ new Set;for(let r=0;r<e.getColumnCount();r++){if(!e.isInt(r)||e.hasTerm(r))continue;let i=t[r];if(i.isInt())continue;let a=new z(i.floor());t[r]=a.sub(i).compare(new z(iy.neg()))<0?new z(i.ceil()):a,n.add(r)}if(n.size!==0)for(let r of e.terms)[...r.coeffs].some(e=>n.has(e[0]))&&(t[r.column]=r.apply(t))},ly=e=>e.core.basis.some(t=>e.isInt(t)&&!e.getValue(t).isInt()),uy=e=>{e.push();for(let t of e.terms){let n=ay(e,t);if(!(n.isZero()||sy(e,t.column,n)))return e.pop(1),e.status=2,!1}let t=e.findFeasibleSolution();return t!==3&&t!==2?(e.pop(1),e.moveNonBasicColumnsToBounds(),!ly(e)):(e.pop(1),cy(e),e.status=3,!0)},dy=(e,t,n)=>{let r=ay(e,e.getTerm(t));if(r.isZero())return!0;if(!r.y.isZero())return sy(e,t,r);let i=e.core;if(i.hasUpperBound(t)){let i=e.getUpperBound(t),a=e.addTerm([[t,P.one],[n,r.x]],-1);oy(e,a,i.y.isZero()?-2:-1,i.x)}if(i.hasLowerBound(t)){let i=e.getLowerBound(t),a=e.addTerm([[t,P.one],[n,r.x.neg()]],-1);oy(e,a,i.y.isZero()?2:1,i.x)}return!0},fy=e=>(cy(e),e.status=3,e.settings.stats.lcubeSuccess++,!0),py=(e,t)=>{let n=e.core,r=[];for(let t of e.terms)(n.hasUpperBound(t.column)||n.hasLowerBound(t.column))&&r.push({column:t.column,value:t.apply(n.x)});let i=(e,t)=>{let i=r[e].column,a=z.zero;return n.hasUpperBound(i)&&t.compare(n.upperBounds[i])>0&&(a=a.add(t.sub(n.upperBounds[i]))),n.hasLowerBound(i)&&t.compare(n.lowerBounds[i])<0&&(a=a.add(n.lowerBounds[i].sub(t))),a},a=z.zero;for(let e=0;e<r.length;e++)a=a.add(i(e,r[e].value));if(a.isZero())return!0;if(t.length===0)return!1;let o=new Map(t.map((e,t)=>[e.column,t])),s=t.map(()=>[]);for(let t=0;t<r.length;t++)for(let n of e.getTerm(r[t].column).coeffs){let e=o.get(n[0]);e!==void 0&&s[e].push([t,n[1]])}let c=Math.min(2*t.length,e.settings.lcubeFlips),l=!1,u=e=>e.isAtHigh?P.minusOne:P.one;for(;!a.isZero()&&c-->0;){let e=-1,n=z.zero;for(let a=0;a<t.length;a++){if(s[a].length===0)continue;let o=u(t[a]),c=z.zero;for(let e of s[a]){let t=r[e[0]].value,n=t.add(new z(o.mul(e[1])));c=c.add(i(e[0],n).sub(i(e[0],t)))}c.compare(n)<0&&(n=c,e=a)}if(e===-1)return!1;let o=u(t[e]);for(let t of s[e]){let e=r[t[0]];e.value=e.value.add(new z(o.mul(t[1])))}t[e].isAtHigh=!t[e].isAtHigh,a=a.add(n),l=!0}if(!a.isZero())return!1;for(let e of t)n.x[e.column]=new z(e.isAtHigh?e.floor.add(P.one):e.floor);for(let t of e.terms)n.x[t.column]=t.apply(n.x);return l&&e.settings.stats.lcubeFlipSuccess++,!0},my=e=>{let t=e.core,n=t.x.slice(),r=[];for(let n=0;n<e.getColumnCount();n++){if(!e.isInt(n)||e.hasTerm(n))continue;let i=t.x[n];i.isInt()||r.push({column:n,floor:i.floor(),isAtHigh:!1})}cy(e);for(let e of r)e.isAtHigh=t.x[e.column].x.compare(e.floor)>0;return e.status=3,py(e,r)?(e.settings.stats.lcubeSuccess++,!0):(t.x.splice(0,n.length,...n),!1)},hy=e=>{e.settings.stats.lcubeCalls++,e.push();let t=e.onAddTerm;e.onAddTerm=void 0;let n=e.addVar(-1,!1);oy(e,n,2,P.zero);let r=e.terms.map(e=>e.column).every(t=>dy(e,t,n));if(e.onAddTerm=t,!r)return e.pop(1),e.status=2,!1;let i=e.findFeasibleSolution();if(i!==3&&i!==2)return e.pop(1),e.moveNonBasicColumnsToBounds(),!ly(e);let a=ry(e,n);if(e.settings.isCanceled())return e.pop(1),!1;if(a===void 0){oy(e,n,2,P.one);let t=e.findFeasibleSolution();return e.pop(1),t===3||t===2?fy(e):!1}return e.pop(1),a.compare(new z(P.one))>=0?fy(e):my(e)},gy=e=>e.sub(e.floor()),_y=(e,t)=>{let n=[e,1n,0n],r=[t,0n,1n];for(;r[0]!==0n;){let e=n[0]/r[0],t=[n[0]-e*r[0],n[1]-e*r[1],n[2]-e*r[2]];n=r,r=t}return n[0]<0n?n.map(e=>-e):n},vy=(e,t)=>{if(t.den%e.den!==0n)return;let n=t.den/e.den,r=(_y(t.num,e.den)[1]*n*e.num%t.den+t.den)%t.den,i=P.of(r);return{plus:i,minus:i.sub(P.of(t.den))}};var yy=class{solver;numberOfCalls=0;parities=/* @__PURE__ */ new Map;parityColumns=[];lcubePeriod;explanation=new fv;term=new B;dio;initialDioCallsPeriod;dioUndefInARow=0;constructor(e){this.solver=e,this.lcubePeriod=e.settings.intFindCubePeriod,this.initialDioCallsPeriod=e.settings.dioCallsPeriod,this.dio=new Tv(this)}isColumnIntInf(e){return this.solver.isInt(e)&&!this.solver.getValue(e).isInt()}atBound(e){let t=this.solver.core,n=t.x[e];switch(t.getColumnType(e)){case 4:case 3:return t.lowerBounds[e].equals(n)||t.upperBounds[e].equals(n);case 1:return t.lowerBounds[e].equals(n);case 2:return t.upperBounds[e].equals(n);default:return!1}}atLower(e){let t=this.solver.core,n=t.getColumnType(e);return(n===4||n===3||n===1)&&t.lowerBounds[e].equals(t.x[e])}atUpper(e){let t=this.solver.core,n=t.getColumnType(e);return(n===4||n===3||n===2)&&t.upperBounds[e].equals(t.x[e])}hitPeriod(e){return e<=1||this.solver.settings.getRandomNext(e)===0}check(){let e=this.solver;if(!e.hasInfInt())return{kind:`sat`};this.term.clear(),this.explanation.clear();let t=this.dio.hasIgnoredTerms?this.gcdTest():{kind:`undef`};return e.core.withoutTouchedRows(()=>this.checkAfterGcd(t))}checkAfterGcd(e){let t=this.solver.settings;if(t.isCanceled())return{kind:`undef`};this.numberOfCalls++;let n=e.kind===`undef`?this.getMoveAfterGcd():e;return t.isCanceled()?{kind:`undef`}:n}getMoveAfterGcd(){let e=this.solver,t=e.settings;if(this.patchBasicColumns()||this.hitPeriod(t.intFindCubePeriod)&&uy(e)||this.hitPeriod(this.lcubePeriod)&&this.findLcube())return{kind:`sat`};if(e.moveNonBasicColumnsToBounds(),this.hitPeriod(t.hnfCutPeriod)){let e=Jv(this);if(e.kind!==`undef`)return e}if(this.shouldSolveDiophantineEquations()){let e=this.solveDiophantineEquations();if(e.kind!==`undef`)return e}if((t.isRunningGomoryWithDio||this.dio.hasIgnoredTerms)&&this.hitPeriod(t.intGomoryCutPeriod)){let e=Iv(this,2);if(e.kind!==`undef`)return e}return this.branch()}findLcube(){let e=hy(this.solver);return e?this.lcubePeriod=this.solver.settings.intFindCubePeriod:this.lcubePeriod<1<<30&&(this.lcubePeriod*=2),e}shouldSolveDiophantineEquations(){let e=this.solver.settings,t=this.hitPeriod(e.dioCallsPeriod);if(!t&&e.dioCallsPeriod>this.initialDioCallsPeriod){let t=e.dioCallsPeriodDecrease;e.dioCallsPeriod=e.dioCallsPeriod>this.initialDioCallsPeriod+t?e.dioCallsPeriod-t:this.initialDioCallsPeriod}return t}solveDiophantineEquations(){let e=this.solver.settings;return this.dio.check()===`conflict`?(this.dio.explain(this.explanation),e.dioCallsPeriod=this.initialDioCallsPeriod,this.dioUndefInARow=0,e.isRunningGomoryWithDio=!1,{kind:`conflict`}):(e.dioCallsPeriod*=2,this.dioUndefInARow++,this.dioUndefInARow>=e.dioGomoryEnablePeriod&&(e.isRunningGomoryWithDio=!0),{kind:`undef`})}gcdTest(){let e=this.solver;return e.settings.stats.gcdCalls++,this.isGcdTestFeasible()?{kind:`undef`}:(e.settings.stats.gcdConflicts++,{kind:`conflict`})}isGcdTestFeasible(){let e=this.solver;this.parities.clear(),this.parityColumns=[];let t=/* @__PURE__ */ new Set;for(let n=0;n<e.getRowCount();n++){let r=e.core.basis[n];if(e.isInt(r)&&!e.getValue(r).isInt()){if(!this.gcdTestForRow(n))return!1;t.add(n)}}for(let n=this.parityColumns.length;n-->0;)for(let r of e.core.matrix.columns[this.parityColumns[n]])if(!t.has(r.row)&&(t.add(r.row),!this.gcdTestForRow(r.row)))return!1;return!0}gcdTestForRow(e){let t=this.solver,n=t.core.basis[e];if(!t.isInt(n))return!0;let r=t.getRow(e),i=1n;for(let e of r)i=Nm(i,e.coeff.den);let a=P.of(i),o=P.zero,s=P.zero,c=P.zero,l=!1,u=!1,d=0;for(let e of r){let n=e.column,r=a.mul(e.coeff);if(t.isFixed(n)){o=o.add(r.mul(t.getLowerBound(n).x));continue}if(!t.isInt(n))return!0;let i=r.abs(),f=this.isBounded(n);if(s.isZero()){s=i,c=i,l=f,u=!0,d=n;continue}s=P.of(jm(s.num,i.num));let p=i.compare(c);p<0?(c=i,l=f,u=!0,d=n):p===0&&(l&&=f,u=!1)}return s.isZero()?!0:o.div(s).isInt()?l&&!c.equals(P.one)&&!t.getValue(n).isInt()&&!this.extGcdTest(r,a,o,c)?!1:!u||this.accumulateParity(r,d,a,o,c):(this.fillExplanationFromFixedColumns(r),!1)}accumulateParity(e,t,n,r,i){let a=this.solver,o=0n,s=!1;for(let r of e)if(r.column===t)s=r.coeff.isNegative();else if(!a.isFixed(r.column)){let e=n.mul(r.coeff).abs().num;if(jm(i.num,e)!==i.num||(o=o===0n?e:jm(o,e),o===1n))return!0}if(o/=i.num,o===0n)return!0;let c=r.div(i);if(!c.isInt())return!0;let l=(c.num%o+o)%o;return!s&&l!==0n&&(l=o-l),this.insertParity(t,e,l,o)}insertParity(e,t,n,r){let i=this.parities.get(e)??[];for(let e of i)if(e.modulus===r)return e.offset===n||(this.fillExplanationFromFixedColumns(t),this.fillExplanationFromFixedColumns(e.row),!1);return this.parityColumns.push(e),i.push({offset:n,modulus:r,row:t}),this.parities.set(e,i),!0}isBounded(e){let t=this.solver.core.getColumnType(e);return t===3||t===4}extGcdTest(e,t,n,r){let i=this.solver,a=P.zero,o=n,s=n,c=[];for(let n of e){let e=n.column;if(i.isFixed(e))continue;let l=t.mul(n.coeff),u=l.abs();if(u.equals(r)){let t=i.getLowerBound(e).x,n=i.getUpperBound(e).x;o=o.add(l.mul(l.isPositive()?t:n)),s=s.add(l.mul(l.isPositive()?n:t)),c.push(e)}else a=a.isZero()?u:P.of(jm(a.num,u.num))}if(a.isZero()||s.div(a).floor().compare(o.div(a).ceil())>=0)return!0;for(let e of c)this.addBoundWitnesses(e);return this.fillExplanationFromFixedColumns(e),!1}addBoundWitnesses(e){this.explanation.pushDependency(this.solver.getBoundWitnesses(e))}fillExplanationFromFixedColumns(e){for(let t of e)this.solver.isFixed(t.column)&&this.addBoundWitnesses(t.column)}patchBasicColumns(){let e=this.solver;e.settings.stats.patches++,e.removeFixedVarsFromBase();for(let t of e.core.basis)!e.getModelValue(t).isInt()&&e.isInt(t)&&!e.isFixed(t)&&this.patchBasicColumn(t);return!e.hasInfInt()&&(e.settings.stats.patchesSuccess++,!0)}patchBasicColumn(e){let t=this.solver;for(let n of t.getRow(t.core.heading[e])){if(n.column===e||!t.isInt(n.column)||n.coeff.isInt())continue;let r=vy(gy(t.getModelValue(e)),gy(n.coeff));if(r===void 0)continue;let i=t.settings.getRandomNext()%2!=0,a=i?r.plus:r.minus,o=i?r.minus:r.plus;if(this.tryPatchColumn(n.column,a)||this.tryPatchColumn(n.column,o))return}}tryPatchColumn(e,t){let n=this.solver,r=n.core,i=n.getValue(e).add(new z(t));if(t.isNegative()){if(r.hasLowerBound(e)&&i.compare(n.getLowerBound(e))<0)return!1}else if(r.hasUpperBound(e)&&i.compare(n.getUpperBound(e))>0)return!1;for(let i of r.matrix.columns[e]){let e=r.basis[i.row],a=n.getValue(e),o=new z(a.x.sub(r.matrix.getVal(i).mul(t)),a.y);if(r.hasLowerBound(e)&&o.compare(n.getLowerBound(e))<0||r.hasUpperBound(e)&&o.compare(n.getUpperBound(e))>0||a.isInt()&&!o.isInt())return!1}return n.setValueForNbasicColumn(e,i),!0}branch(){let e=this.solver;e.moveNonBasicColumnsToBounds();let t=this.findInfIntBaseColumn();if(t===-1)return{kind:`sat`};let n=e.settings;e.settings.stats.branches++,this.term.clear(),this.term.addMonomial(P.one,t);let r=n.getRandomNext()%2!=0,i=e.getValue(t);return{kind:`branch`,isUpper:r,offset:e.core.getColumnType(t)===0?P.zero:r?i.floor():i.ceil()}}findInfIntBaseColumn(){let e=this.solver,t=e.settings,n=e.core,r=P.of(1024n),i=-1,a=-1,o=-1,s=1,c=1,l=1,u=P.zero,d=P.zero,f=0;for(let p of n.basis){if(!this.isColumnIntInf(p))continue;if(t.isCanceled())return-1;let m=e.getUsageInTerms(p);if(n.getColumnType(p)===3){let n=e.getUpperBound(p).x.sub(e.getLowerBound(p).x).sub(P.of(BigInt(2*m)));if(n.compare(r)<=0){let e=i===-1||n.compare(u)<=0;e&&(u=n),(i===-1||e&&t.getRandomNext()%++s===0)&&(i=p);continue}}let h=e.getValue(p);if(h.x.abs().compare(r)<0||n.hasUpperBound(p)&&r.compare(e.getUpperBound(p).x.sub(h.x))>0||n.hasLowerBound(p)&&r.compare(h.x.sub(e.getLowerBound(p).x))>0){(a===-1||t.getRandomNext()%++c===0)&&(a=p);continue}let g=h.x.abs();o===-1||g.compare(d)<0?(o=p,d=g,l=1,f=m):g.equals(d)&&(m>=f&&t.getRandomNext()%++l===0&&(o=p),m>f&&(f=m))}return i!==-1&&t.getRandomNext()%3!=0?i:a!==-1&&t.getRandomNext()%3!=0?a:o===-1?i===-1?a:i:o}};const by=e=>{if(e===0n)return 0;let t=0,n=e<0n?-e:e;for(;(n&1n)==0n;)n>>=1n,t++;return t},xy=e=>(e<0n?-e:e).toString(2).length-1;var Sy=class e{num;k;constructor(e,t){this.num=e,this.k=t}static zero=new e(0n,0);static one=new e(1n,0);static of(t,n=0){if(n===0||t===0n)return new e(t,0);let r=Math.min(by(t),n);return new e(t>>BigInt(r),n-r)}static fromRational(t){if(t.den===1n)return{value:e.of(t.num),isExact:!0};let n=xy(t.den);return t.den===1n<<BigInt(n)?{value:e.of(t.num,n),isExact:!0}:{value:e.of(t.num,n+1),isExact:!1}}get isZero(){return this.num===0n}get isNeg(){return this.num<0n}get isPos(){return this.num>0n}get isInt(){return this.k===0}toRational(){return P.of(this.num,1n<<BigInt(this.k))}align(e){let t=Math.max(this.k,e.k);return[this.num<<BigInt(t-this.k),e.num<<BigInt(t-e.k),t]}add(t){let n=this.align(t);return e.of(n[0]+n[1],n[2])}sub(t){let n=this.align(t);return e.of(n[0]-n[1],n[2])}mul(t){let n=new e(this.num*t.num,this.k+t.k);return this.k===0||t.k===0?e.of(n.num,n.k):n}mulIntoOther(t){let n=new e(this.num*t.num,this.k+t.k);return this.k===0?e.of(n.num,n.k):n}neg(){return new e(-this.num,this.k)}div2(){return this.k===0?e.of(this.num,1):new e(this.num,this.k+1)}mul2k(t){return this.k>=t?new e(this.num,this.k-t):e.of(this.num<<BigInt(t-this.k))}power(t){return new e(this.num**BigInt(t),this.k*t)}compare(e){let t=this.align(e);return t[0]<t[1]?-1:+(t[0]>t[1])}compareRational(e){return this.toRational().compare(e)}isLessThanOneDiv2k(e){return this.num<=0n?!0:this.k<=e?!1:this.num<1n<<BigInt(this.k-e)}floor(){return this.isInt?this.num:this.num>>BigInt(this.k)}ceil(){return this.isInt?this.num:(this.num>>BigInt(this.k))+1n}toString(){return this.k===0?`${this.num}`:this.k===1?`${this.num}/2`:`${this.num}/2^${this.k}`}};const Cy=(e,t,n)=>{let r=t;for(;;){let t=r.add(n).div2();if(t.compareRational(e)>0)return{lower:r,upper:t};r=t}},wy=(e,t,n)=>{let r=n;for(;;){let n=t.add(r).div2();if(n.compareRational(e)<0)return{lower:n,upper:r};r=n}},Ty=[39103,39107,39113,39119,39133,39139,39157,39161,39163,39181,39191,39199,39209,39217,39227,39229,39233,39239,39241,39251,39293,39301,39313,39317,39323,39341,39343,39359,39367,39371,39373,39383,39397,39409,39419,39439,39443,39451,39461,39499,39503,39509,39511,39521,39541,39551,39563,39569,39581,39607,39619,39623,39631,39659,39667,39671,39679,39703,39709,39719,39727,39733,39749,39761,39769,39779,39791,39799,39821,39827,39829,39839,39841,39847,39857,39863,39869,39877,39883,39887,39901,39929,39937,39953,39971,39979,39983,39989,40009,40013,40031,40037,40039,40063,40087,40093,40099,40111,40123,40127,40129,40151,40153,40163,40169,40177,40189,40193,40213,40231,40237,40241,40253,40277,40283,40289,40343,40351,40357,40361,40387,40423,40427,40429,40433,40459,40471,40483,40487,40493,40499,40507,40519,40529,40531,40543,40559,40577,40583,40591,40597,40609,40627,40637,40639,40693,40697,40699,40709,40739,40751,40759,40763,40771,40787,40801,40813,40819,40823,40829,40841,40847,40849,40853,40867,40879,40883,40897,40903,40927,40933,40939,40949,40961,40973,40993,41011,41017,41023,41039,41047,41051,41057,41077,41081,41113,41117,41131,41141,41143,41149,41161,41177,41179,41183,41189,41201,41203,41213,41221,41227,41231,41233,41243,41257,41263,41269,41281,41299,41333,41341,41351,41357,41381,41387,41389,41399,41411,41413,41443,41453,41467,41479,41491,41507,41513,41519,41521,41539,41543,41549].map(BigInt),Ey=e=>e>0n?1:e<0n?-1:0,Dy=(e,t)=>{let n=e/t;return e%t!==0n&&e<0n!=t<0n?n-1n:n},Oy=(e,t)=>{let[n,r]=[e,t],[i,a]=[1n,0n],[o,s]=[0n,1n];for(;r!==0n;){let e=n/r;[n,r]=[r,n-e*r],[i,a]=[a,i-e*a],[o,s]=[s,o-e*s]}return n<0n?{x:-i,y:-o,gcd:-n}:{x:i,y:o,gcd:n}},ky=e=>{let t=e.length;for(;t>0&&e[t-1]===0n;)t--;return e.length=t,e};var Ay=class{modulus;isPrimeModulus=!0;constructor(e=null){this.modulus=e}get zp(){return this.modulus}get isField(){return this.modulus!==null&&this.isPrimeModulus}setZp(e){this.modulus=e,this.isPrimeModulus=!0}squareModulus(){if(this.modulus===null)throw new r(`squaring the modulus of Z`);this.modulus*=this.modulus,this.isPrimeModulus=!1}withZp(e,t){let n=this.modulus,r=this.isPrimeModulus;this.setZp(e);let i=t();return this.modulus=n,this.isPrimeModulus=r,i}normalizeNumeral(e){let t=this.modulus;if(t===null)return e;let n=t/2n,r=t%2n==0n?-n+1n:-n,i=e%t;return i>n?i-t:i<r?i+t:i}inv(e){let t=this.modulus;if(t===null)throw new r(`inverse over Z`);return this.normalizeNumeral(Oy(this.normalizeNumeral(e),t).x)}divNumeral(e,t){return this.modulus===null?Dy(e,t):this.normalizeNumeral(e*this.inv(t))}dividesNumeral(e,t){return this.isField&&e!==0n?!0:e===0n?t===0n:t%e===0n}set(e){return ky(e.map(e=>this.normalizeNumeral(e)))}getContent(e){let t=0n;for(let n of e)t=jm(t,n);return t}getPrimitive(e){let t=this.getContent(e);return t===1n?[...e]:ky(e.map(e=>e/t))}neg(e){return e.map(e=>this.normalizeNumeral(-e))}add(e,t){let n=Math.max(e.length,t.length);return ky(Array.from({length:n},(n,r)=>this.normalizeNumeral((e[r]??0n)+(t[r]??0n))))}sub(e,t){let n=Math.max(e.length,t.length);return ky(Array.from({length:n},(n,r)=>this.normalizeNumeral((e[r]??0n)-(t[r]??0n))))}mul(e,t){if(e.length===0||t.length===0)return[];let n=Array.from({length:e.length+t.length-1},()=>0n);for(let r=0;r<e.length;r++)if(e[r]!==0n)for(let i=0;i<t.length;i++)t[i]!==0n&&(n[r+i]=this.normalizeNumeral(n[r+i]+e[r]*t[i]));return ky(n)}mulConst(e,t){return t===0n?[]:ky(e.map(e=>this.normalizeNumeral(e*t)))}divConst(e,t){return t===1n?[...e]:ky(e.map(e=>this.divNumeral(e,t)))}derivative(e){return e.length<=1?[]:ky(e.slice(1).map((e,t)=>this.normalizeNumeral(e*BigInt(t+1))))}normalize(e){if(e.length===0)return[];if(e.length===1)return[e[0]>0n?1n:this.normalizeNumeral(-1n)];let t=this.getContent(e);return t===1n?[...e]:e.map(e=>this.divNumeral(e,t))}flipSignIfLmNeg(e){return e.length>0&&e[e.length-1]<0n?this.neg(e):[...e]}mkMonic(e){if(e.length===0||e[e.length-1]===1n)return[...e];let t=this.inv(e[e.length-1]);return e.map((n,r)=>r===e.length-1?1n:this.normalizeNumeral(n*t))}divRem(e,t){let n=this.isField;if(t.length===1)return{quotient:n?this.divConst(e,t[0]):this.set(e),remainder:[],power:0};let r=this.set(e);if(e.length<=1)return{quotient:[],remainder:r,power:0};let i=e.length>=t.length?e.length-t.length+1:0,a=Array.from({length:i},()=>0n),o=t[t.length-1],s=0;for(;r.length>=t.length;){let e=r.length,c=e-t.length;if(n){let n=this.divNumeral(r[e-1],o);a[c]=this.normalizeNumeral(a[c]+n);for(let e=0;e<t.length-1;e++)r[e+c]=this.normalizeNumeral(r[e+c]-n*t[e])}else{s++;let n=r[e-1];for(let t=0;t<e-1;t++)r[t]=this.normalizeNumeral(r[t]*o);for(let e=0;e<i;e++)a[e]=this.normalizeNumeral(a[e]*o);a[c]=this.normalizeNumeral(a[c]+n);for(let e=0;e<t.length-1;e++)r[e+c]=this.normalizeNumeral(r[e+c]-n*t[e])}r.length=e-1,ky(r)}return{quotient:ky(a),remainder:r,power:s}}div(e,t){return this.divRem(e,t).quotient}remWithPower(e,t){if(t.length===1)return{remainder:[],power:0};let n=this.set(e);if(e.length<=1)return{remainder:n,power:0};let r=this.isField,i=t[t.length-1],a=0;for(;n.length>=t.length;){let e=n.length,o=e-t.length;if(r){let r=this.divNumeral(n[e-1],i);for(let e=0;e<t.length-1;e++)n[e+o]=this.normalizeNumeral(n[e+o]-r*t[e])}else{a++;let r=n[e-1];for(let t=0;t<e-1;t++)n[t]=this.normalizeNumeral(n[t]*i);for(let e=0;e<t.length-1;e++)n[e+o]=this.normalizeNumeral(n[e+o]-r*t[e])}n.length=e-1,ky(n)}return{remainder:n,power:a}}rem(e,t){return this.remWithPower(e,t).remainder}srem(e,t){let n=this.remWithPower(e,t);return n.power%2==0||t.length>0&&t[t.length-1]>0n?this.neg(n.remainder):n.remainder}divides(e,t){if(t.length===0)return!1;if(e.length===0)return!0;let n=t[t.length-1],r=this.set(e);for(;r.length>0;){if(t.length>r.length||!this.dividesNumeral(n,r[r.length-1]))return!1;let e=r.length-t.length,i=this.divNumeral(r[r.length-1],n);for(let n=0;n<t.length-1;n++)t[n]!==0n&&(r[n+e]=this.normalizeNumeral(r[n+e]-i*t[n]));r[r.length-1]=0n,ky(r)}return!0}exactDiv(e,t){if(t.length===0)return null;if(e.length===0)return[];let n=t[t.length-1];if(t.length>e.length)return null;let r=Array.from({length:e.length-t.length+1},()=>0n),i=this.set(e);for(;i.length>0;){if(t.length>i.length||!this.dividesNumeral(n,i[i.length-1])||!this.dividesNumeral(t[0],i[0]))return null;let e=i.length-t.length,a=this.divNumeral(i[i.length-1],n);r[e]=a;for(let n=0;n<t.length-1;n++)t[n]!==0n&&(i[n+e]=this.normalizeNumeral(i[n+e]-a*t[n]));i[i.length-1]=0n,ky(i)}return ky(r)}euclidGcd(e,t){if(e.length===0)return this.flipSignIfLmNeg(this.set(t));if(t.length===0)return this.flipSignIfLmNeg(this.set(e));let n=this.set(e),r=this.set(t);for(;r.length>0;){let e=this.normalize(this.rem(n,r));n=r,r=e}let i=this.normalize(n);return this.isField?this.mkMonic(i):this.flipSignIfLmNeg(i)}combineImages(e,t,n,r){let i=Oy(t,r),a=(e,t)=>(e%t+t)%t,o=a(i.x,r),s=r*a(i.y,t),c=t*o,l=t*r,u=l/2n,d=Math.max(e.length,n.length),f=[];for(let t=0;t<d;t++){let r=a((e[t]??0n)*s+(n[t]??0n)*c,l);f.push(r>u?r-l:r)}return{coeffs:f,bound:l}}modGcd(e,t){let n=this.getContent(e),r=this.getContent(t),i=this.getPrimitive(e),a=this.getPrimitive(t),o=jm(n,r),s=e.length-1,c=t.length-1,l=jm(i[s],a[c]),u=[],d=0n;for(let e of Ty){let t=this.withZp(e,()=>{let e=this.set(i),t=this.set(a);return e.length-1<s||t.length-1<c?null:this.mulConst(this.mkMonic(this.euclidGcd(e,t)),l)});if(t===null)continue;if(t.length<=1)return[o];if(t.length<u.length||d%2n==0n)u=t,d=e;else{let n=this.combineImages(t,e,u,d);u=n.coeffs,d=n.bound}let n=this.getPrimitive(u);if(this.dividesNumeral(n[n.length-1],l)&&this.divides(i,n)&&this.divides(a,n))return this.flipSignIfLmNeg(this.mulConst(n,o))}return this.euclidGcd(e,t)}gcd(e,t){return e.length===0?this.flipSignIfLmNeg(this.set(t)):t.length===0?this.flipSignIfLmNeg(this.set(e)):this.modulus===null?this.modGcd(e,t):this.euclidGcd(e,t)}squareFree(e){if(e.length<=1)return this.set(e);let t=this.gcd(e,this.derivative(e));return t.length<=1?this.set(e):this.normalize(this.div(e,t))}isSquareFree(e){return e.length<=1||this.gcd(e,this.derivative(e)).length<=1}pw(e,t){if(t===0)return[1n];let n=this.set(e);for(let r=1;r<t;r++)n=this.mul(n,e);return n}extGcd(e,t){let n=[1n],r=this.mkMonic(this.set(e)),i=[],a=this.set(t);for(;a.length>0;){let e=this.divRem(r,a),t=this.sub(n,this.mul(i,e.quotient));n=i,r=a,i=t,a=e.remainder}let o=this.div(this.sub(r,this.mul(e,n)),t);if(r.length===0||r[r.length-1]===1n)return{u:n,v:o,d:r};let s=this.inv(r[r.length-1]);return{u:this.mulConst(n,s),v:this.mulConst(o,s),d:this.mkMonic(r)}}hasZeroRoots(e){return e.length>0&&e[0]===0n}removeZeroRoots(e){let t=0;for(;e[t]===0n;)t++;return e.slice(t)}hasOneHalfRoot(e){if(e.length===0)return!0;if(e.length===1)return!1;let t=e[e.length-1];for(let n=e.length-2,r=1n;n>=0;n--,r++)t+=e[n]<<r;return t===0n}descartesBound01(e){if(e.length<=1)return 0;let t=[...e],n=0,r=0;for(let e=0;e<t.length;e++){let i=1;for(;i<t.length-e;i++)t[i]+=t[i-1];let a=Ey(t[i-1]);if(a!==0){if(a!==n&&n!==0&&(r++,r>1))return r;n=a}}return r}translate(e){let t=[...e],n=t.length-1;for(let e=1;e<=n;e++)for(let r=n-e;r<=n-1;r++)t[r]+=t[r+1];return t}translateQ(e,t){if(e.length<=1)return[...e];let n=this.composeAnPxDivA(e,t.den),r=n.length-1;for(let e=1;e<=r;e++){n[r-e]+=t.num*n[r-e+1];for(let i=r-e+1;i<=r-1;i++)n[i]=n[i]*t.den+t.num*n[i+1];n[r]*=t.den}return n}compose2nPxDiv2(e){let t=e.length-1;return e.map((e,n)=>e<<BigInt(t-n))}pMinusX(e){return e.map((e,t)=>t%2==1&&e!==0n?-e:e)}p1DivX(e){return[...e].reverse()}composeP2kX(e,t){return e.map((e,n)=>e<<BigInt(t*n))}composeAnPxDivA(e,t){let n=e.length-1;return e.map((e,r)=>e===0n?0n:e*t**BigInt(n-r))}composePQX(e,t){let n=e.length-1;return e.map((e,r)=>e===0n?0n:e*t.den**BigInt(n-r)*t.num**BigInt(r))}evalSignAtBq(e,t){if(e.length===0)return 0;if(e.length===1)return Ey(e[0]);let n=e[e.length-1],r=t.k;for(let i=e.length-2;i>=0;i--,r+=t.k)n=e[i]===0n?n*t.num:(e[i]<<BigInt(r))+n*t.num;return Ey(n)}evalSignAtQ(e,t){if(e.length===0)return 0;if(e.length===1)return Ey(e[0]);let n=e[e.length-1],r=t.den;for(let i=e.length-2;i>=0;i--,r*=t.den)n=e[i]===0n?n*t.num:e[i]*r+n*t.num;return Ey(n)}evalSignAtZero(e){return e.length===0?0:Ey(e[0])}evalSignAtPlusInf(e){return e.length===0?0:Ey(e[e.length-1])}evalSignAtMinusInf(e){if(e.length===0)return 0;let t=Ey(e[e.length-1]);return(e.length-1)%2==0?t:-t}countSignVariations(e){if(e.length<=1)return 0;let t=0,n=0;for(let r of e)r!==0&&(r!==n&&n!==0&&t++,n=r);return t}signVariationsAtMinusInf(e){return this.countSignVariations(e.map(e=>this.evalSignAtMinusInf(e)))}signVariationsAtPlusInf(e){return this.countSignVariations(e.map(e=>this.evalSignAtPlusInf(e)))}signVariationsAtZero(e){return this.countSignVariations(e.map(e=>this.evalSignAtZero(e)))}signVariationsAt(e,t){return this.countSignVariations(e.map(e=>this.evalSignAtBq(e,t)))}knuthPositiveRootUpperBound(e){if(e.length===0)return 0;let t=0,n=e.length-1,r=e[n]>0n,i=xy(e[n]);for(let a=1;a<=n;a++){let o=e[n-a];if(o===0n||o>0n===r)continue;let s=xy(o);if(i>s)continue;let c=s+1-i,l=c%a===0?c/a:Math.floor(c/a)+1;l>t&&(t=l)}return t+1}knuthNegativeRootUpperBound(e){return this.knuthPositiveRootUpperBound(this.pMinusX(e))}nonzeroRootLowerBound(e){let t=this.removeZeroRoots(e).reverse();return Math.max(this.knuthPositiveRootUpperBound(t),this.knuthNegativeRootUpperBound(t))}pushChildFrames(e,t){let n=t.length-1,r=this.normalize(this.compose2nPxDiv2(e));t.push({parent:n,coeffs:r,isFirst:!0,isLeft:!0}),t.push({parent:n,coeffs:this.normalize(this.translate(r)),isFirst:!0,isLeft:!1})}mapToRoot(e,t){let n=t;for(let t=e.length-1;t!==-1;t=e[t].parent)n=e[t].isLeft?n.div2():n.add(Sy.one).div2();return n}drsIsolate01Roots(e,t){let n=this.descartesBound01(e);if(n===0)return;if(n===1){t.lowers.push(Sy.zero),t.uppers.push(Sy.one);return}let r=Sy.of(1n,1),i=[],a=[-1n,2n];for(this.hasOneHalfRoot(e)?(t.roots.push(r),this.pushChildFrames(this.div(e,a),i)):this.pushChildFrames(e,i);i.length>0;){let e=i[i.length-1];if(!e.isFirst){i.pop();continue}e.isFirst=!1;let n=this.descartesBound01(e.coeffs);n===0?i.pop():n===1?(t.lowers.push(this.mapToRoot(i,Sy.zero)),t.uppers.push(this.mapToRoot(i,Sy.one)),i.pop()):this.hasOneHalfRoot(e.coeffs)?(t.roots.push(this.mapToRoot(i,r)),this.pushChildFrames(this.div(e.coeffs,a),i)):this.pushChildFrames(e.coeffs,i)}}drsIsolateRoots(e,t){let n=this.normalize(e),r=this.knuthNegativeRootUpperBound(e),i=Math.max(r,this.knuthPositiveRootUpperBound(e)),a=(e,n,r)=>{let i=t.roots.length,a=t.lowers.length;this.drsIsolate01Roots(this.composeP2kX(e,n),t);let o=(e,t)=>{for(let i=t;i<e.length;i++){let t=e[i].mul2k(n);e[i]=r?t.neg():t}};return o(t.roots,i),o(t.lowers,a),o(t.uppers,a),a};a(n,i,!1);let o=a(this.pMinusX(n),r,!0);for(let e=o;e<t.lowers.length;e++){let n=t.lowers[e];t.lowers[e]=t.uppers[e],t.uppers[e]=n}}sqfIsolateRoots(e){let t={roots:[],lowers:[],uppers:[]};return this.hasZeroRoots(e)?(t.roots.push(Sy.zero),this.drsIsolateRoots(this.removeZeroRoots(e),t)):this.drsIsolateRoots(e,t),t}sturmSeqCore(e){for(;;){let t=this.srem(e[e.length-2],e[e.length-1]);if(t.length===0)return e;e.push(this.normalize(t))}}sturmSeq(e){return this.sturmSeqCore([[...e],this.derivative(e)])}sturmTarskiSeq(e,t){return this.sturmSeqCore([[...e],this.mul(this.derivative(e),t)])}isolating2refinable(e,t,n){let r=this.evalSignAtBq(e,t),i=this.evalSignAtBq(e,n);if(r!==0&&i!==0)return{isInterval:!0,lower:t,upper:n};if(r===0&&i!==0){let r=t,a=n,o=r.add(a).div2();for(;;){let t=this.evalSignAtBq(e,o);if(t!==i)return{isInterval:t!==0,lower:o,upper:a};a=o,o=a.add(r).div2()}}if(r!==0&&i===0){let i=t,a=n,o=i.add(a).div2();for(;;){let t=this.evalSignAtBq(e,o);if(t!==r)return t===0?{isInterval:!1,lower:o,upper:a}:{isInterval:!0,lower:i,upper:o};i=o,o=a.add(i).div2()}}let a=t,o=n,s=a.add(o).div2(),c=s,l=this.evalSignAtBq(e,s),u=l;if(l===0)return{isInterval:!1,lower:s,upper:n};let d=a.add(s).div2(),f=c.add(o).div2();for(;;){let t=this.evalSignAtBq(e,d);if(t===0)return{isInterval:!1,lower:d,upper:n};if(t===-l)return{isInterval:!0,lower:d,upper:s};let r=this.evalSignAtBq(e,f);if(r===0)return{isInterval:!1,lower:f,upper:n};if(r===-u)return{isInterval:!0,lower:c,upper:f};s=d,d=s.add(a).div2(),c=f,f=o.add(c).div2()}}refineCore(e,t,n,r){let i=n.add(r).div2(),a=this.evalSignAtBq(e,i);return a===0?{isInterval:!1,lower:i,upper:r}:a===t?{isInterval:!0,lower:i,upper:r}:{isInterval:!0,lower:n,upper:i}}refine(e,t,n){return this.refineCore(e,this.evalSignAtBq(e,t),t,n)}refineToPrecision(e,t,n,r){let i=this.evalSignAtBq(e,t),a={isInterval:!0,lower:t,upper:n};for(;;)if(a.upper.sub(a.lower).isLessThanOneDiv2k(r)||(a=this.refineCore(e,i,a.lower,a.upper),!a.isInterval))return a}convertQ2bqInterval(e,t,n){let r=this.evalSignAtQ(e,t),i=this.evalSignAtQ(e,n),a=Sy.zero,o=Sy.zero,s=!1,c=Sy.fromRational(t);if(c.isExact)a=c.value;else{let i=c.value,l=i.mul2k(1);for(t.num<0n&&([i,l]=[l,i]);l.compareRational(n)>=0;){let e=Cy(t,i,l);i=e.lower,l=e.upper}for(;;){let n=this.evalSignAtBq(e,l);if(n===0)return{isInterval:!1,lower:l,upper:l};if(n===r){a=l;break}s||(s=!0,o=l);let c=Cy(t,i,l);i=c.lower,l=c.upper}}if(s)return{isInterval:!0,lower:a,upper:o};let l=Sy.fromRational(n);if(l.isExact)return{isInterval:!0,lower:a,upper:l.value};let u=l.value,d=u.mul2k(1);for(n.num<0n&&([u,d]=[d,u]);u.compare(a)<=0;){let e=wy(n,u,d);u=e.lower,d=e.upper}for(;;){let t=this.evalSignAtBq(e,u);if(t===0)return{isInterval:!1,lower:u,upper:d};if(t===i)return{isInterval:!0,lower:a,upper:u};let r=wy(n,u,d);u=r.lower,d=r.upper}}normalizeInterval(e,t,n,r){return t.isNeg&&n.isPos?this.hasZeroRoots(e)?null:r===this.evalSignAtZero(e)?{lower:Sy.zero,upper:n}:{lower:t,upper:Sy.zero}:{lower:t,upper:n}}getRootId(e,t){let n=this.sturmSeq(e);return this.signVariationsAtMinusInf(n)-this.signVariationsAt(n,t)}};const jy=4294967295,My={maxPrime:jy,primeTrials:4,maxSearchSize:jy},Ny=()=>({constant:1n,factors:[],degrees:[]}),Py=e=>e.degrees.reduce((e,t)=>e+t,0),Fy=e=>e.factors.reduce((t,n,r)=>t+(n.length-1)*e.degrees[r],0),Iy=(e,t,n,r)=>{t.factors.push(e.set(n)),t.degrees.push(r)},Ly=(e,t)=>{if(t.constant===0n)return[];let n=[e.normalizeNumeral(t.constant)];for(let r=0;r<t.factors.length;r++)n=e.mul(n,t.degrees[r]>1?e.pw(t.factors[r],t.degrees[r]):t.factors[r]);return n},Ry=()=>{let e=1;return()=>{for(e++;;e++){let t=!0;for(let n=2;n*n<=e;n++)if(e%n===0){t=!1;break}if(t)return e}}},zy=e=>{if(e===0n)return e;let t=e.toString(2).length-1,n=1n<<BigInt(Math.floor(t/2)),r=1n<<BigInt(Math.ceil((t+1)/2));if(n===r)return n;for(;;){let t=r+n>>1n,i=t*t;if(i===e)return t;if(t===n||t===r)return r;i<e?n=t:r=t}},By=e=>{if(e<0n)return null;if(e<2n)return e;let t=BigInt(Math.floor(Math.sqrt(Number(e))));for(;t*t>e;)t--;for(;(t+1n)*(t+1n)<=e;)t++;return t*t===e?t:null},Vy=e=>{let t=[!0];for(let n=0;n<e.factors.length;n++){let r=e.factors[n].length-1;for(let i=0;i<e.degrees[n];i++)t=[...Array.from({length:r},()=>!1),...t].map((e,n)=>e||(t[n]??!1))}return t},Hy=e=>{for(let t=1;t<e.length-1;t++)if(e[t])return!1;return!0};var Uy=class{zp;matrix;size;nullRow=1;columnPivot;rowPivot;constructor(e,t){this.zp=e;let n=t.length-1;this.size=n,this.columnPivot=Array.from({length:n},()=>-1),this.rowPivot=Array.from({length:n},()=>-1);let r=Number(e.zp);this.matrix=[1n,...Array.from({length:n},()=>0n)];let i=0;for(let e=1,a=0;;a=i,e++){if(e%r===1){if(++i>=n)break;for(let e=0;e<n;e++)this.matrix.push(0n)}let o=this.get(a,n-1);for(let e=n-1;e>0;e--)this.put(i,e,this.get(a,e-1)-o*t[e]);this.put(i,0,-(t[0]*o))}for(let e=0;e<n;e++)this.put(e,e,this.get(e,e)-1n)}get(e,t){return this.matrix[e*this.size+t]}put(e,t,n){this.matrix[e*this.size+t]=this.zp.normalizeNumeral(n)}diagonalize(){let e=0;for(let t=0;t<this.size;t++){let n=!1;for(let e=0;e<this.size;e++){if(this.columnPivot[e]>=0||this.get(t,e)===0n)continue;n=!0,this.columnPivot[e]=t,this.rowPivot[t]=e;let r=this.zp.normalizeNumeral(-this.zp.inv(this.get(t,e)));for(let t=this.nullRow;t<this.size;t++)this.put(t,e,this.get(t,e)*r);for(let n=0;n<this.size;n++){if(n===e)continue;let r=this.get(t,n);for(let t=this.nullRow;t<this.size;t++)this.put(t,n,this.get(t,n)+r*this.get(t,e))}}n||e++}return e}nextNullSpaceVector(){for(;this.nullRow<this.size;this.nullRow++){if(this.rowPivot[this.nullRow]>=0)continue;let e=Array.from({length:this.size},(e,t)=>this.rowPivot[t]>=0?this.get(this.nullRow,this.rowPivot[t]):t===this.nullRow?1n:0n);return this.nullRow++,e}return null}};const Wy=(e,t,n)=>{let r=Number(e.zp),i=new Uy(e,t),a=n.factors.length;Iy(e,n,t,1);let o=i.diagonalize();if(o===1)return!1;for(let t=i.nextNullSpaceVector();t!==null;){let s=e.set(t),c=n.factors.length;for(let t=a;t<c;t++)if(n.factors[t].length!==2)for(let i=0;i<r;i++){let r=n.factors[t];s[0]=e.normalizeNumeral(s[0]-1n);let i=e.gcd(s,r);if(i.length!==1&&i.length!==r.length&&(n.factors[t]=e.div(r,i),Iy(e,n,i,1)),n.factors.length-a===o)return!0}t=i.nextNullSpaceVector()}return!0},Gy=(e,t,n,r)=>{let i=new Ay(n),a=i.set(e.divConst(e.sub(r.c,e.mul(r.a,r.b)),t)),o=i.divRem(i.mul(r.v,a),r.a),s=i.add(i.mul(r.u,a),i.mul(r.b,o.quotient));return{a:e.add(r.a,e.mulConst(o.remainder,t)),b:e.add(r.b,e.mulConst(s,t))}},Ky=(e,t,n,r,i,a)=>{let o=new Ay(n.zp).extGcd(r,i),s=o.u,c=o.v,l=[...r],u=[...i];for(let r=1;r<a;r*=2){let r=n.zp,i=Gy(e,r,r,{u:s,a:l,v:c,b:u,c:t}),a=n.set(e.divConst(e.sub(e.sub([1n],e.mul(i.a,s)),e.mul(i.b,c)),r)),o=n.divRem(n.mul(a,c),l),d=n.add(n.mul(a,s),n.mul(o.quotient,u));s=e.add(s,e.mulConst(d,r)),c=e.add(c,e.mulConst(o.remainder,r)),n.squareModulus(),s=n.set(s),c=n.set(c),l=n.set(i.a),u=n.set(i.b)}return{a:l,b:u}},qy=(e,t,n,r,i,a)=>{let o=n.zp,s=Ny();a.setZp(o);let c=e.set(t),l=[];for(let u=0;u<r.factors.length-1;u++){let d=n.set(r.factors[u]),f=u>0?n.set(c):n.mulConst(Ly(n,r),n.normalizeNumeral(t[t.length-1]));a.setZp(o);let p=Ky(e,c,a,d,n.div(f,d),i);l=p.b,u===0&&(c=a.set(t)),c=a.div(c,p.a),s.factors.push(p.a),s.degrees.push(1)}return s.factors.push(a.mulConst(l,a.inv(t[t.length-1]))),s.degrees.push(1),s},Jy=(e,t)=>{let n=0n;for(let t of e)t!==0n&&(n+=t*t);let r=e[e.length-1],i=(1n<<BigInt(Math.floor((e.length-1)/2)))*(zy(n)+(r<0n?-r:r)),a=1;for(let e=t;e<=i;a*=2)e*=e;return a};var Yy=class{zpe;fs;degreeSet;totalSize;maxSize;isEnabled;currentSize=0;current;constructor(e,t,n){this.zpe=e,this.fs=t,this.degreeSet=n;let r=t.factors.length;this.totalSize=r,this.maxSize=Math.floor(r/2),this.isEnabled=Array.from({length:r},()=>!0),this.current=Array.from({length:r+1},()=>r)}find(e,t){let n=this.current[e]+1;for(;n<t&&!this.isEnabled[n];)n++;return n===t?-1:n}next(e){let t=this.fs.factors.length,n=e;do{let e=this.currentSize-1,r=-1;if(n){for(e=this.currentSize-1;e>0;e--)this.isEnabled[this.current[e]]=!1,this.current[e]=t;this.isEnabled[this.current[0]]=!1,n=!1,this.totalSize-=this.currentSize,this.maxSize=Math.floor(this.totalSize/2)}for(;e>=0;){if(r=this.find(e,this.current[e+1]),r>=0){this.current[e]=r;break}e--}do{if(r===-1){if(this.currentSize>=this.maxSize||(this.currentSize++,this.current[0]=-1,e=0,r=this.find(e,t),r===-1))return!1;this.current[e]=r}for(e++;e<this.currentSize;e++){if(this.current[e]=this.current[e-1],r=this.find(e,t),r===-1){this.current[0]=-1;break}this.current[e]=r}}while(r===-1)}while(!this.degreeSet[this.getCurrentDegree()]);return!0}getCurrentDegree(){let e=0;for(let t=0;t<this.currentSize;t++)e+=this.fs.factors[this.current[t]].length-1;return e}getRest(){let e=[];for(let t=0,n=0;t<this.fs.factors.length;t++)this.isEnabled[t]&&(n>=this.current.length||t<this.current[n]?e.push(t):n++);return e}getLeft(){let e=this.zpe.set(this.fs.factors[this.current[0]]);for(let t=1;t<this.currentSize;t++)e=this.zpe.mul(e,this.fs.factors[this.current[t]]);return e}getRight(){let e=[];for(let t of this.getRest())e=e.length===0?this.zpe.set(this.fs.factors[t]):this.zpe.mul(e,this.fs.factors[t]);return e}getLeftTailCoeff(e){let t=this.zpe.normalizeNumeral(e);for(let e=0;e<this.currentSize;e++)t=this.zpe.normalizeNumeral(t*this.fs.factors[this.current[e]][0]);return t}getRightTailCoeff(e){let t=this.zpe.normalizeNumeral(e);for(let e of this.getRest())t=this.zpe.normalizeNumeral(t*this.fs.factors[e][0]);return t}};const Xy=(e,t)=>e===0n?t===0n:t%e===0n,Zy=(e,t,n,r,i)=>{let a=e.set(t);a.length>0&&a[a.length-1]<0n&&(a=a.map(e=>-e),r%2==1&&(n.constant=-n.constant));let o=new Ay(2n),s=Ny(),c=2n,l=[!0],u=Ry();for(let t=0;t<=i.primeTrials;){let d=u();if(d>i.maxPrime)return Iy(e,n,a,r),!1;let f=BigInt(d);if(o.setZp(f),a[a.length-1]%f===0n)continue;let p=o.set(a);if(!o.isSquareFree(p))continue;let m=Ny();if(!Wy(o,o.mkMonic(p),m))return Iy(e,n,a,r),!0;let h=Vy(m);if(l=l.length===1?h:l.map((e,t)=>e&&(h[t]??!1)),Hy(l))return Iy(e,n,a,r),!0;t++,(s.factors.length===0||Py(s)>Py(m))&&(s=m,c=f)}o.setZp(c);let d=new Ay(c),f=qy(e,a,o,s,Jy(a,c),d),p=d.normalizeNumeral(a[a.length-1]);a=e.mulConst(a,p);let m=new Yy(d,f,l),h=Math.floor(Fy(s)/2),g=!0,_=!1;for(let t=1;m.next(_);t++){if(t>i.maxSearchSize){g=!1;break}let o=m.getCurrentDegree()<=h,s=o?m.getLeftTailCoeff(p):m.getRightTailCoeff(p);if(!Xy(s,a[0])){_=!1;continue}let c=d.mulConst(o?m.getLeft():m.getRight(),p),l=e.exactDiv(a,c);l===null?_=!1:(Iy(e,n,e.getPrimitive(o?c:l),r),a=e.getPrimitive(o?l:c),p=a[a.length-1],a=e.mulConst(a,p),_=!0)}return a.length>1&&Iy(e,n,e.divConst(a,p),r),g},Qy=(e,t,n,r)=>{let i=By(t[1]*t[1]-4n*t[2]*t[0]);i===null?Iy(e,n,t,r):(Iy(e,n,e.normalize([t[1]-i,2n*t[2]]),r),Iy(e,n,e.normalize([t[1]+i,2n*t[2]]),r))},$y=(e,t,n,r,i)=>t.length<=2?(Iy(e,n,t,r),!0):t.length===3?(Qy(e,t,n,r),!0):Zy(e,t,n,r,i),eb=(e,t,n)=>e.length===0||e[e.length-1]>=0n?e:(n%2==1&&(t.constant=-t.constant),e.map(e=>-e)),tb=(e,t,n)=>{let r=Ny();if(t.length<=1)return r.constant=t.length===0?0n:t[0],{isComplete:!0,factors:r};r.constant=e.getContent(t);let i=e.getPrimitive(t),a=e.gcd(i,e.derivative(i));if(a.length<=1)return{isComplete:$y(e,eb(i,r,1),r,1,n),factors:r};let o=!0,s=e.exactDiv(i,a);for(let t=1;s.length>1;t++){let i=e.gcd(s,a),c=e.exactDiv(s,i);c.length>1?$y(e,eb(c,r,t),r,t,n)||(o=!1):c[0]===-1n&&t%2==1&&(r.constant=-r.constant),a=e.exactDiv(a,i),s=i}return{isComplete:o,factors:r}},nb=[0n,1n,-1n,2n,-2n,3n,-3n],rb=[39103n,104729n,1000003n,100000007n],ib=(e,t)=>{let n=e/t;return e%t!==0n&&e<0n!=t<0n?n-1n:n},ab={fromInteger:e=>P.of(e),add:(e,t)=>e.add(t),mul:(e,t)=>e.mul(t),power:(e,t)=>e.pow(t)},ob=(e,t)=>e.map((e,n)=>`${e}^${t[n]}`).join(`,`);var sb=class{id;vars;degrees;totalDegree;constructor(e,t,n){this.id=e,this.vars=t,this.degrees=n;let r=0;for(let e of n)r+=e;this.totalDegree=r}get size(){return this.vars.length}get maxVar(){return this.vars.length===0?-1:this.vars[this.vars.length-1]}get maxVarDegree(){return this.vars.length===0?0:this.degrees[this.degrees.length-1]}degreeOf(e){let t=this.vars.indexOf(e);return t===-1?0:this.degrees[t]}maxSmallerThan(e){let t=-1;for(let n of this.vars)n<e&&(t=n);return t}};const cb=(e,t)=>{if(e===t)return 0;let n=e.size-1,r=t.size-1;for(;n>=0&&r>=0;){let i=e.vars[n],a=t.vars[r];if(i===a){let i=e.degrees[n],a=t.degrees[r];if(i===a){n--,r--;continue}return i<a?-1:1}return i>a?1:-1}return n<0?-1:1},lb=(e,t)=>e.totalDegree===t.totalDegree?cb(e,t):e.totalDegree<t.totalDegree?-1:1,ub=(e,t)=>e.size===0?!1:t.size===0?!0:e.maxVar===t.maxVar?e.maxVarDegree>t.maxVarDegree:e.maxVar>t.maxVar;var db=class{id;as;ms;isLexSorted=!1;constructor(e,t,n){this.id=e,this.as=t,this.ms=n,this.makeFirstMaximal()}makeFirstMaximal(){if(this.ms.length<=1)return;let e=0;for(let t=1;t<this.ms.length;t++)ub(this.ms[t],this.ms[e])&&(e=t);this.swapFirst(e),this.isLexSorted=!1}get size(){return this.ms.length}swapFirst(e){if(e===0)return;let t=this.as[0];this.as[0]=this.as[e],this.as[e]=t;let n=this.ms[0];this.ms[0]=this.ms[e],this.ms[e]=n}lexSort(){if(this.isLexSorted||(this.isLexSorted=!0,this.ms.length<=1))return;let e=this.ms.map((e,t)=>t);e.sort((e,t)=>cb(this.ms[t],this.ms[e]));let t=e.map(e=>this.as[e]),n=e.map(e=>this.ms[e]);for(let r=0;r<e.length;r++)this.as[r]=t[r],this.ms[r]=n[r]}getGradedLexMaxPos(){if(this.ms.length===0)return-1;let e=0;for(let t=1;t<this.ms.length;t++)lb(this.ms[t],this.ms[e])>0&&(e=t);return e}toString(){return this.ms.length===0?`0`:this.ms.map((e,t)=>{let n=e.vars.map((t,n)=>e.degrees[n]===1?`x${t}`:`x${t}^${e.degrees[n]}`);return[`${this.as[t]}`,...n].join(`*`)}).join(` + `)}},fb=class{manager;as=[];ms=[];positions=/* @__PURE__ */ new Map;constructor(e){this.manager=e}reset(){this.as=[],this.ms=[],this.positions.clear()}addTerm(e,t){if(e===0n)return;let n=this.positions.get(t.id);n===void 0?(this.positions.set(t.id,this.ms.length),this.ms.push(t),this.as.push(e)):this.as[n]+=e}add(e){for(let t=0;t<e.size;t++){let n=e.ms[t],r=this.positions.get(n.id);r===void 0?(this.positions.set(n.id,this.ms.length),this.ms.push(n),this.as.push(e.as[t])):this.as[r]+=e.as[t]}}addmul(e,t,n){if(e!==0n)for(let r=0;r<n.size;r++){let i=this.manager.mulMonomials(t,n.ms[r]),a=this.positions.get(i.id);a===void 0?(this.positions.set(i.id,this.ms.length),this.ms.push(i),this.as.push(e*n.as[r])):this.as[a]+=e*n.as[r]}}addmulBuffer(e,t,n){if(e!==0n)for(let r=0;r<n.ms.length;r++){let i=this.manager.mulMonomials(t,n.ms[r]),a=this.positions.get(i.id);a===void 0?(this.positions.set(i.id,this.ms.length),this.ms.push(i),this.as.push(e*n.as[r])):this.as[a]+=e*n.as[r]}}getGradedLexMaxPos(){let e=-1;for(let t=0;t<this.as.length;t++)this.as[t]!==0n&&(e===-1||lb(this.ms[t],this.ms[e])>0)&&(e=t);return e}mk(e=!1){let t=[],n=[];for(let e=0;e<this.as.length;e++)this.as[e]!==0n&&(t.push(this.as[e]),n.push(this.ms[e]));this.reset();let r=e?t.reduce((e,t)=>jm(e,t),0n):1n;return this.manager.mkPolynomialCore(r>1n?t.map(e=>e/r):t,n)}},pb=class{manager;as=[];ms=[];constructor(e){this.manager=e}add(e,t){e!==0n&&(this.as.push(e),this.ms.push(t))}addmul(e,t,n){if(e!==0n)for(let r=0;r<n.size;r++)this.as.push(e*n.as[r]),this.ms.push(this.manager.mulMonomials(t,n.ms[r]))}mk(){let e=this.manager.mkPolynomialCore(this.as,this.ms);return this.as=[],this.ms=[],e}},mb=class{monomials=/* @__PURE__ */ new Map;nextPolynomialId=0;unit;zero;one;um=new Ay;som=new fb(this);som2=new fb(this);cheap=new pb(this);constructor(){this.unit=this.mkMonomial([],[]),this.zero=this.mkPolynomialCore([],[]),this.one=this.mkPolynomialCore([1n],[this.unit])}mkMonomial(e,t){let n=ob(e,t),r=this.monomials.get(n);if(r!==void 0)return r;let i=new sb(this.monomials.size,e,t);return this.monomials.set(n,i),i}rename(e,t){let n=/* @__PURE__ */ new Map;for(let t of this.monomials.values()){let r=t.vars.map((e,t)=>t).sort((n,r)=>e[t.vars[n]]-e[t.vars[r]]),i=t.degrees;t.degrees=r.map(e=>i[e]),t.vars=r.map(n=>e[t.vars[n]]),n.set(ob(t.vars,t.degrees),t)}this.monomials=n;for(let e of t)e.makeFirstMaximal()}mkPower(e,t){return t===0?this.unit:this.mkMonomial([e],[t])}mulMonomials(e,t){if(e.size===0)return t;if(t.size===0)return e;let n=[],r=[],i=0,a=0;for(;i<e.size||a<t.size;){let o=i<e.size?e.vars[i]:1/0,s=a<t.size?t.vars[a]:1/0;o===s?(n.push(o),r.push(e.degrees[i++]+t.degrees[a++])):o<s?(n.push(o),r.push(e.degrees[i++])):(n.push(s),r.push(t.degrees[a++]))}return this.mkMonomial(n,r)}divMonomials(e,t){let n=[],r=[],i=0;for(let a=0;a<e.size;a++){let o=e.vars[a],s=e.degrees[a];if(i<t.size&&t.vars[i]===o){if(s-=t.degrees[i++],s<0)return null}else if(i<t.size&&t.vars[i]<o)return null;s>0&&(n.push(o),r.push(s))}return i<t.size?null:this.mkMonomial(n,r)}divXk(e,t,n){let r=[],i=[];for(let a=0;a<e.size;a++){let o=e.vars[a]===t?e.degrees[a]-n:e.degrees[a];o!==0&&(r.push(e.vars[a]),i.push(o))}return this.mkMonomial(r,i)}divX(e,t){return this.divXk(e,t,e.degreeOf(t))}mkPolynomialCore(e,t){return new db(this.nextPolynomialId++,e,t)}mkConst(e){return e===0n?this.zero:e===1n?this.one:this.mkPolynomialCore([e],[this.unit])}mkVar(e,t=1){return this.mkPolynomialCore([1n],[this.mkMonomial([e],[t])])}mkPolynomial(e,t){this.som.reset();for(let n=0;n<e.length;n++)this.som.addTerm(e[n],t[n]);return this.som.mk()}mkLinear(e,t,n){let r=[],i=[];for(let n=0;n<e.length;n++)e[n]!==0n&&(r.push(e[n]),i.push(this.mkMonomial([t[n]],[1])));return n!==0n&&(r.push(n),i.push(this.unit)),this.mkPolynomial(r,i)}isZero(e){return e.size===0}isConst(e){return e.size===0||e.size===1&&e.ms[0].size===0}isUnivariate(e){if(this.isConst(e))return!0;let t=this.maxVar(e);for(let n of e.ms)if(n.size>1||n.size===1&&n.vars[0]!==t)return!1;return!0}maxVar(e){return e.size===0?-1:e.ms[0].maxVar}degree(e,t){let n=0;for(let r of e.ms)n=Math.max(n,r.degreeOf(t));return n}totalDegree(e){let t=0;for(let n of e.ms)t=Math.max(t,n.totalDegree);return t}eq(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;if(e.size===0)return!0;if(this.maxVar(e)!==this.maxVar(t))return!1;let n=/* @__PURE__ */ new Map;for(let t=0;t<e.size;t++)n.set(e.ms[t].id,e.as[t]);for(let e=0;e<t.size;e++)if(n.get(t.ms[e].id)!==t.as[e])return!1;return!0}getKey(e){e.lexSort();let t=``;for(let n=0;n<e.size;n++)t+=`${e.as[n]}:${e.ms[n].id};`;return t}addmul(e,t,n,r){return this.som.reset(),this.som.addmul(e,this.unit,t),this.som.addmul(n,this.unit,r),this.som.mk()}add(e,t){return this.addmul(1n,e,1n,t)}sub(e,t){return this.addmul(1n,e,-1n,t)}mul(e,t){if(e.size===0||t.size===0)return this.zero;this.som.reset();for(let n=0;n<e.size;n++)this.som.addmul(e.as[n],e.ms[n],t);return this.som.mk()}mulTerm(e,t,n){return e===0n?this.zero:e===1n&&t===this.unit?n:(this.cheap.addmul(e,t,n),this.cheap.mk())}mulConst(e,t){return this.mulTerm(e,this.unit,t)}neg(e){for(let t=0;t<e.size;t++)this.cheap.add(-e.as[t],e.ms[t]);return this.cheap.mk()}pw(e,t){if(t===0)return this.one;let n=e;for(let r=1;r<t;r++)n=this.mul(n,e);return n}coeff(e,t,n){for(let r=0;r<e.size;r++){let i=e.ms[r];i.degreeOf(t)===n&&this.cheap.add(e.as[r],this.divX(i,t))}return this.cheap.mk()}getConstCoeff(e,t,n){let r=0n;for(let i=0;i<e.size;i++){let a=e.ms[i];if(a.degreeOf(t)===n){if(n>0&&a.size>1||n===0&&a.size>0)return null;r=e.as[i]}}return r}lc(e,t){return this.coeff(e,t,this.degree(e,t))}derivative(e,t){for(let n=0;n<e.size;n++){let r=e.ms[n],i=r.degreeOf(t);i>0&&this.cheap.add(e.as[n]*BigInt(i),this.divXk(r,t,1))}return this.cheap.mk()}flipSignIfLmNeg(e){return e.size===0?e:e.as[e.getGradedLexMaxPos()]<0n?this.neg(e):e}getIc(e){if(e.size===0)return 0n;if(this.isConst(e))return e.as[0];let t=e.as[0];for(let n=1;n<e.size;n++){if(t===1n)return t;t=jm(t,e.as[n])}return t}icWithContent(e){if(e.size===0)return[0n,e];if(this.isConst(e))return[e.as[0],this.one];let t=0n;for(let n of e.as)t=jm(t,n);if(t===1n)return[1n,e];for(let n=0;n<e.size;n++)this.cheap.add(e.as[n]/t,e.ms[n]);return[t,this.cheap.mk()]}iccp(e,t){if(e.size===0)return[0n,this.one,e];if(this.isConst(e))return[e.as[0],this.one,this.one];let n=this.degree(e,t);if(n===0){let[t,n]=this.icWithContent(e);return[t,n,this.one]}let r=Array.from({length:n+1},()=>0),i=[];for(let n of e.ms){let e=n.degreeOf(t);r[e]===0&&i.push(e),r[e]+=n.size===+(e>0)?1:2}let[a,o]=this.icWithContent(e);for(let e of i)if(r[e]===1)return[a,this.one,o];let s=this.coeff(o,t,i[0]);for(let e=1;e<i.length;e++)if(s=this.gcd(s,this.coeff(o,t,i[e])),this.isConst(s))return[a,this.one,o];return s=this.flipSignIfLmNeg(s),[a,s,this.exactDiv(o,s)]}pp(e,t){return this.iccp(e,t)[2]}squareFree(e){if(this.isConst(e))return e;let t=this.maxVar(e),[n,r,i]=this.iccp(e,t),a=this.squareFree(r),o=this.gcd(i,this.derivative(i,t));if(this.isConst(o)&&this.eq(a,r))return e;let s=this.isConst(o)?i:this.exactDiv(i,o);return this.mul(this.mulConst(n,a),s)}normalize(e){if(e.size===0)return e;let t=0n;for(let n of e.as)t=jm(t,n);if(t===1n)return e;for(let n=0;n<e.size;n++)this.cheap.add(e.as[n]/t,e.ms[n]);return this.cheap.mk()}isNonzeroConstCoeff(e,t,n){let r=this.getConstCoeff(e,t,n);return r!==null&&r!==0n}exactDiv(e,t){if(e.size===0)return e;let n=this.som,i=this.som2;n.reset(),i.reset(),n.add(e);let a=t.getGradedLexMaxPos(),o=t.ms[a],s=t.as[a];for(;;){let e=n.getGradedLexMaxPos();if(e===-1)return n.reset(),i.mk();let a=this.divMonomials(n.ms[e],o);if(a===null)throw new r(`exact_div: the divisor does not divide`);let c=n.as[e]/s;i.addTerm(c,a),n.addmul(-c,a,t)}}exactPseudoDivision(e,t,n,r=!0){return this.pseudoDivisionCore(e,t,n,!0,r)}pseudoRemainder(e,t,n){return this.pseudoDivisionCore(e,t,n,!1,!1)}pseudoDivisionCore(e,t,n,r,i){let a=this.degree(e,n),o=this.degree(t,n);if(o===0){let n=r?a+1:1;return!i||!r||a===0?{quotient:e,remainder:this.zero,steps:n}:{quotient:this.mul(e,this.pw(t,a)),remainder:this.zero,steps:n}}let s=this.coeff(t,n,o),c=this.reduct(t,n,o),l=e,u=this.zero,d=0;for(;;){let e=this.degree(l,n);if(o>e){let e=a-o+1;if(r&&d<e){let t=this.pw(s,e-d);i&&(u=this.mul(t,u)),l=this.mul(t,l)}return{quotient:u,remainder:l,steps:d}}this.som.reset(),this.som2.reset();for(let t=0;t<l.size;t++){let r=l.ms[t],a=l.as[t];if(r.degreeOf(n)===e){let e=this.divXk(r,n,o);i&&this.som2.addTerm(a,e),this.som.addmul(-a,e,c)}else this.som.addmul(a,r,s)}if(l=this.som.mk(),i){for(let e=0;e<u.size;e++)this.som2.addmul(u.as[e],u.ms[e],s);u=this.som2.mk()}d++}}exactPseudoRemainder(e,t,n){return this.exactPseudoDivision(e,t,n,!1).remainder}reduct(e,t,n){for(let r=0;r<e.size;r++)e.ms[r].degreeOf(t)!==n&&this.cheap.add(e.as[r],e.ms[r]);return this.cheap.mk()}getVarMaxDegrees(e){let t=/* @__PURE__ */ new Map;for(let n of e.ms)for(let e=0;e<n.size;e++){let r=n.vars[e];t.set(r,Math.max(t.get(r)??0,n.degrees[e]))}return[...t.entries()].sort((e,t)=>e[0]-t[0])}gcd(e,t){if(e.size===0)return this.flipSignIfLmNeg(t);if(t.size===0||e===t)return this.flipSignIfLmNeg(e);if(this.isConst(e)||this.isConst(t))return this.mkConst(jm(this.getIc(t),this.getIc(e)));let n=this.getVarMaxDegrees(e),r=this.getVarMaxDegrees(t),i=Math.min(n.length,r.length);for(let a=0;a<i;a++){let i=n[a][0],o=r[a][0];if(i<o)return this.gcdContent(e,i,t);if(i>o)return this.gcdContent(t,o,e)}return i<n.length?this.gcdContent(e,n[i][0],t):i<r.length?this.gcdContent(t,r[i][0],e):this.gcdPrs(e,t,n[i-1][0])}gcdContent(e,t,n){let[r,i]=this.iccp(e,t);return this.gcd(this.mulConst(r,i),n)}gcdPrs(e,t,n){let[r,i]=this.degree(e,n)<this.degree(t,n)?[t,e]:[e,t],[a,o,s]=this.iccp(r,n),[c,l,u]=this.iccp(i,n),d=this.gcd(o,l),f=jm(a,c),p=s,m=u,h=this.one,g=this.one;for(;;){let e=this.degree(p,n)-this.degree(m,n),t=this.exactPseudoRemainder(p,m,n);if(t.size===0){let e=this.pp(this.flipSignIfLmNeg(m),n);return this.mulConst(f,this.mul(d,e))}if(this.isConst(t))return this.mulConst(f,d);p=m,m=this.exactDiv(t,h);for(let t=0;t<e;t++)m=this.exactDiv(m,g);h=this.lc(p,n);let r=this.one;for(let t=0;t<e;t++)r=this.mul(r,h);for(let t=1;t<e;t++)r=this.exactDiv(r,g);g=r}}getMinDegreeVar(e){let t=/* @__PURE__ */ new Map;for(let n of e.ms)for(let e=0;e<n.size;e++){let r=n.vars[e];n.degrees[e]>(t.get(r)??0)&&t.set(r,n.degrees[e])}let n=-1,r=1/0;for(let[e,i]of t)i<r&&(n=e,r=i);return n}factor(e){let t={constant:1n,factors:[],degrees:[]};return e.size===0?t.constant=0n:this.factorCore(e,t),t}factorCore(e,t){if(this.isConst(e)){t.constant*=e.as[0];return}let n=this.getMinDegreeVar(e),[r,i,a]=this.iccp(e,n);t.constant*=r,this.factorCore(i,t);let o=this.gcd(a,this.derivative(a,n));if(this.isConst(o)){this.factorSqfPp(a,n,1,t);return}let s=this.exactDiv(a,o);for(let e=1;!this.isConst(s);e++){let r=this.gcd(s,o),i=this.exactDiv(s,r);this.isConst(i)?i.as[0]===-1n&&e%2==1&&(t.constant=-t.constant):this.factorSqfPp(i,n,e,t),o=this.exactDiv(o,r),s=r}}factorSqfPp(e,t,n,r){let i=this.degree(e,t);i===1?this.pushFactor(r,e,n):this.isUnivariate(e)?this.factorSqfPpUniv(e,n,r):i===2?this.factorQuadratic(e,t,n,r):this.factorMultivariate(e,t,n,r)||this.pushFactor(r,e,n)}pushFactor(e,t,n){e.factors.push(t),e.degrees.push(n)}toCoeffs(e){let t=Array.from({length:this.totalDegree(e)+1},()=>0n);for(let n=0;n<e.size;n++)t[e.ms[n].totalDegree]=e.as[n];return this.um.set(t)}fromCoeffs(e,t){for(let n=e.length-1;n>=0;n--)this.cheap.add(e[n],this.mkPower(t,n));return this.cheap.mk()}factorSqfPpUniv(e,t,n){let r=this.maxVar(e),i={constant:1n,factors:[],degrees:[]};if(Zy(this.um,this.toCoeffs(e),i,1,My),i.factors.length===1&&i.degrees[0]===1)this.pushFactor(n,e,t);else{for(let e=0;e<i.factors.length;e++)this.pushFactor(n,this.fromCoeffs(i.factors[e],r),t*i.degrees[e]);i.constant===-1n&&t%2==1&&(n.constant=-n.constant)}}factorQuadratic(e,t,n,r){let i=this.coeff(e,t,2),a=this.coeff(e,t,1),o=this.coeff(e,t,0),s=i.as[i.getGradedLexMaxPos()]<0n;s&&(i=this.neg(i),a=this.neg(a),o=this.neg(o));let c=this.sqrt(this.addmul(1n,this.mul(a,a),-4n,this.mul(i,o)));if(c===null){this.pushFactor(r,e,n);return}s&&n%2==1&&(r.constant=-r.constant);let l=this.add(this.mulTerm(2n,this.mkPower(t,1),i),a);this.pushFactor(r,this.pp(this.sub(l,c),t),n),this.pushFactor(r,this.pp(this.add(l,c),t),n)}getTermSquareRoot(e,t){return e.ms[t].degrees.some(e=>e%2==1)?null:By(e.as[t])}sqrt(e){if(e.size===0)return e;if(this.getTermSquareRoot(e,this.getGradedLexMinPos(e))===null)return null;let t=e.getGradedLexMaxPos(),n=this.getTermSquareRoot(e,t);if(n===null)return null;let r=e.ms[t],i=this.mkMonomial(r.vars,r.degrees.map(e=>e/2)),a=this.som,o=this.som2;a.reset(),o.reset();let s=2n*n;a.addTerm(n,i);for(let n=0;n<e.size;n++)n!==t&&o.addTerm(e.as[n],e.ms[n]);for(;;){let e=o.getGradedLexMaxPos();if(e===-1)return o.reset(),a.mk();let t=this.divMonomials(o.ms[e],i);if(t===null||o.as[e]%s!==0n)return a.reset(),o.reset(),null;let n=ib(o.as[e],s),r=a.as.length;for(let e=0;e<r;e++)a.as[e]!==0n&&o.addTerm(-(a.as[e]*n*2n),this.mulMonomials(a.ms[e],t));o.addTerm(-(n*n),this.mulMonomials(t,t)),a.addTerm(n,t)}}getGradedLexMinPos(e){let t=0;for(let n=1;n<e.size;n++)lb(e.ms[n],e.ms[t])<0&&(t=n);return t}getVars(e){let t=[];for(let n of e.ms)for(let e of n.vars)t.includes(e)||t.push(e);return t}substitute(e,t,n){this.som.reset();for(let r=0;r<e.size;r++){let i=e.ms[r],a=e.as[r],o=[],s=[];for(let e=0;e<i.size;e++){let r=t.indexOf(i.vars[e]);r===-1?(o.push(i.vars[e]),s.push(i.degrees[e])):a*=n[r]**BigInt(i.degrees[e])}this.som.addTerm(a,this.mkMonomial(o,s))}return this.som.mk()}translate(e,t,n){let r=this.degree(e,t);if(r===0||n===0n)return e;let i=Array.from({length:r+1},()=>new fb(this));for(let n=0;n<e.size;n++){let r=e.ms[n];i[r.degreeOf(t)].addTerm(e.as[n],this.divX(r,t))}for(let e=1;e<=r;e++)for(let t=r-e;t<=r-1;t++)i[t].addmulBuffer(n,this.unit,i[t+1]);this.som.reset();for(let e=0;e<=r;e++)this.som.addmulBuffer(1n,this.mkPower(t,e),i[e]);return this.som.mk()}substituteRational(e,t){let n=/* @__PURE__ */ new Map;for(let t of e.ms)for(let e=0;e<t.size;e++){let r=t.vars[e];t.degrees[e]>(n.get(r)??0)&&n.set(r,t.degrees[e])}if(![...n.keys()].some(e=>t[e]!==void 0))return e;this.som.reset();for(let r=0;r<e.size;r++){let i=e.ms[r],a=e.as[r],o=[],s=[];for(let e=0;e<i.size;e++){let r=i.vars[e],c=i.degrees[e],l=t[r];if(l===void 0){o.push(r),s.push(c);continue}a*=l.num**BigInt(c);let u=n.get(r)??0;c<u&&(a*=l.den**BigInt(u-c))}for(let[e,r]of n){let n=t[e];n!==void 0&&i.degreeOf(e)===0&&(a*=n.den**BigInt(r))}this.som.addTerm(a,this.mkMonomial(o,s))}return this.som.mk(!0)}muladd(e,t,n){if(e.size===0||t.size===0)return this.mkConst(n);this.som.reset();for(let n=0;n<e.size;n++)this.som.addmul(e.as[n],e.ms[n],t);return this.som.addTerm(n,this.unit),this.som.mk()}compose(e,t){if(this.isConst(e))return e;let n=this.maxVar(e),r=this.degree(e,n),i=Array.from({length:r+1},()=>0n);for(let t=0;t<e.size;t++)i[e.ms[t].degreeOf(n)]=e.as[t];let a=this.mkConst(i[r]);for(let e=r-1;e>=0;e--)a=this.muladd(t,a,i[e]);return a}composeXMinusY(e,t){let n=this.maxVar(e);return t===n?this.coeff(e,n,0):this.compose(e,this.mkLinear([1n,-1n],[n,t],0n))}composeXDivY(e,t){if(this.isConst(e))return e;let n=this.maxVar(e),r=this.degree(e,n);for(let i=0;i<e.size;i++){let a=e.ms[i].degreeOf(n),o=(n<t?[[n,a],[t,r-a]]:[[t,r-a],[n,a]]).filter(e=>e[1]>0);this.cheap.add(e.as[i],this.mkMonomial(o.map(e=>e[0]),o.map(e=>e[1])))}return this.cheap.mk()}resultant(e,t,n){if(e.size===0||t.size===0)return this.zero;if(this.isConst(e))return this.isConst(t)?this.one:this.pw(e,this.degree(t,n));if(this.isConst(t))return this.pw(t,this.degree(e,n));let[r,i,a]=this.iccp(e,n),[o,s,c]=this.iccp(t,n),l=this.mul(this.pw(this.mulConst(r,i),this.degree(t,n)),this.pw(this.mulConst(o,s),this.degree(e,n))),u=a,d=c,f=1;this.degree(u,n)<this.degree(d,n)&&(this.degree(u,n)%2==1&&this.degree(d,n)%2==1&&(f=-1),[u,d]=[d,u]);let p=this.one,m=this.one;for(;;){let e=this.degree(u,n),t=this.degree(d,n),r=e-t;e%2==1&&t%2==1&&(f=-f);let i=this.exactPseudoRemainder(u,d,n);u=d,d=this.exactDiv(i,p);for(let e=0;e<r;e++)d=this.exactDiv(d,m);p=this.lc(u,n);let a=this.pw(p,r);for(let e=1;e<r;e++)a=this.exactDiv(a,m);if(m=a,this.degree(d,n)===0){let e=this.degree(u,n),t=this.pw(this.lc(d,n),e);for(let n=1;n<e;n++)t=this.exactDiv(t,m);let r=this.mul(l,t);return f<0?this.neg(r):r}}}isSquareFreeIn(e,t){return this.isConst(e)?e.size>0:this.isConst(this.gcd(e,this.derivative(e,t)))}isPrimitive(e,t){return this.eq(e,this.pp(e,t))}factorMultivariate(e,t,n,r){let i=this.getVars(e),a=[t,...i.filter(e=>e!==t).map(t=>[this.degree(e,t),t]).sort((e,t)=>t[0]-e[0]||t[1]-e[1]).filter(e=>e[0]>1).map(e=>e[1])];for(let o of a){let a=this.degree(e,o);if(!(a<=1))for(let s of i){if(s===o)continue;let c=i.filter(e=>e!==o&&e!==s),l=c.length===0?1:5;for(let i=0;i<l;i++){let l=c.length===0?e:this.substitute(e,c,c.map((e,t)=>nb[Math.floor(i/nb.length**t)%nb.length]));if(this.degree(l,o)!==a)continue;let u=this.degree(l,s);if(u!==0)for(let i of nb){let d=this.substitute(l,[s],[i]);if(!this.isUnivariate(d)||this.degree(d,o)!==a||!this.isSquareFreeIn(d,o))continue;let f={constant:1n,factors:[],degrees:[]};Zy(this.um,this.um.getPrimitive(this.toCoeffs(d)),f,1,My);let p=f.factors.length;if(p<=1)continue;let m=this.translate(l,s,i),h=this.coeff(m,o,a),g=this.isConst(h)?h.as[0]??0n:this.getConstValue(this.substitute(h,[s],[0n]));if(g!==null){for(let a of rb)if(jm(a,g)===1n)for(let l=1;l<=Math.floor(p/2);l++){let d=f.factors[0];for(let e=1;e<l;e++)d=this.um.mul(d,f.factors[e]);let h=f.factors[l];for(let e=l+1;e<p;e++)h=this.um.mul(h,f.factors[e]);let _=this.liftBivariate(m,o,s,u,this.um.flipSignIfLmNeg(d),this.um.flipSignIfLmNeg(h),g,a);if(_===null)continue;let v=_.map(e=>this.translate(e,s,-i));if(c.length===0){for(let e of v)this.isConst(e)||this.degree(e,t)===0||this.pushSmallFactor(e,t,n,r);return!0}for(let i of v){if(this.isConst(i))continue;let a=this.exactPseudoDivision(e,i,this.maxVar(i));if(a.remainder.size===0&&this.eq(this.mul(i,a.quotient),e)){for(let e of[i,a.quotient])this.isConst(e)?r.constant*=e.as[0]:this.degree(e,t)!==0&&this.pushSmallFactor(e,t,n,r);return!0}}}}}}}}return!1}pushSmallFactor(e,t,n,r){this.degree(e,t)===2&&this.isPrimitive(e,t)&&this.isSquareFreeIn(e,t)?this.factorQuadratic(e,t,n,r):this.pushFactor(r,e,n)}getConstValue(e){return this.isConst(e)?e.as[0]??0n:null}liftBivariate(e,t,n,r,i,a,o,s){let c=new Ay(s),l=c.mkMonic(c.set(i)),u=c.mkMonic(c.set(a)),d=c.extGcd(l,u);if(d.d.length!==1||d.d[0]!==1n)return null;let f=[];for(let t=0;t<=r;t++){let r=this.coeff(e,n,t);if(r.size!==0&&!this.isUnivariate(r)&&!this.isConst(r))return null;f.push(c.set(r.size===0?[]:this.toCoeffs(r)))}let p=Array.from({length:r+1},()=>[]),m=Array.from({length:r+1},()=>[]);p[0]=c.set(l),m[0]=c.mulConst(u,c.normalizeNumeral(o));let h=c.inv(o);for(let e=1;e<=r;e++){let t=c.set(f[e]);for(let n=0;n<=e;n++){let i=e-n;i>r||i===0||n===0||p[n].length!==0&&m[i].length!==0&&(t=c.sub(t,c.mul(p[n],m[i])))}if(t.length===0)continue;let n=c.divRem(c.mul(t,d.v),l).remainder,i=c.divRem(c.mul(t,d.u),u).remainder;p[e]=c.mulConst(n,h),m[e]=c.set(i)}let g=e=>{let i=this.zero;for(let a=0;a<=r;a++){if(e[a].length===0)continue;let r=this.fromCoeffs(e[a],t);r.size!==0&&(i=this.add(i,this.mulTerm(1n,this.mkPower(n,a),r)))}return i},_=g(p),v=g(m);return this.eq(this.mul(_,v),e)?[_,v]:null}pscChain(e,t,n){let r=this.degree(e,n)>=this.degree(t,n)?this.pscChainCore(e,t,n):this.pscChainCore(t,e,n);return r.length===0?[this.zero]:r.reverse()}pscChainCore(e,t,n){let r=[],i=this.pw(this.lc(t,n),this.degree(e,n)-this.degree(t,n)),a=t,o=this.exactPseudoRemainder(e,this.neg(t),n);for(;o.size>0;){let e=this.degree(a,n),t=this.degree(o,n),s=this.coeff(o,n,e-1);s.size>0&&r.push(s);let c=o;if(e-t>1){c=this.getSeLazard(e,i,o,n);let a=this.coeff(c,n,t);a.size>0&&r.push(a)}if(t===0)break;o=this.getOptimizedSe1(e,t,a,o,c,i,n),a=c,i=this.lc(a,n)}return r}getSeLazard(e,t,n,r){let i=e-this.degree(n,r)-1;if(i===0)return n;let a=this.lc(n,r),o=1<<31-Math.clz32(i),s=a;for(i-=o;o!==1;)o/=2,s=this.exactDiv(this.mul(s,s),t),i>=o&&(s=this.exactDiv(this.mul(s,a),t),i-=o);return this.exactDiv(this.mul(s,n),t)}getOptimizedSe1(e,t,n,r,i,a,o){let s=this.lc(r,o),c=this.lc(i,o),l=e=>e===0?this.one:this.mkVar(o,e),u=[];for(let e=0;e<t;e++)u.push(this.mul(c,l(e)));u.push(this.sub(this.mul(c,l(t)),i));let d=this.mkVar(o);for(let n=t+1;n<e;n++){let e=this.mul(d,u[n-1]);u.push(this.sub(e,this.exactDiv(this.mul(this.coeff(e,o,t),r),s)))}let f=this.zero;for(let t=0;t<e;t++)f=this.add(f,this.mul(this.coeff(n,o,t),u[t]));let p=this.exactDiv(f,this.lc(n,o)),m=this.mul(d,u[e-1]),h=this.exactDiv(this.sub(this.mul(s,this.add(m,p)),this.mul(this.coeff(m,o,t),r)),a);return(e-t+1)%2==1?this.neg(h):h}evaluateWith(e,t,n){return e.size===0?t.fromInteger(0n):this.isConst(e)?t.fromInteger(e.as[0]):(e.lexSort(),this.evaluateCore(e,t,n,0,e.size,this.maxVar(e)))}evaluateCore(e,t,n,r,i,a){if(i===r+1){let i=t.fromInteger(e.as[r]),o=e.ms[r];for(let e=0;e<o.size;e++){let r=o.vars[e];if(r>a)break;i=t.mul(i,t.power(n(r),o.degrees[e]))}return i}let o=n(a),s=t.fromInteger(0n),c=r;for(;c<i;){let r=e.ms[c].degreeOf(a);if(r===0){let r=this.maxSmallerThan(e,c,i,a);s=t.add(s,r===-1?t.fromInteger(e.as[c]):this.evaluateCore(e,t,n,c,i,r));break}let l=c+1,u=0;for(;l<i;l++){let t=e.ms[l].degreeOf(a);if(t<r){u=t;break}}let d=this.maxSmallerThan(e,c,l,a);s=t.add(s,d===-1?t.fromInteger(e.as[c]):this.evaluateCore(e,t,n,c,l,d)),s=t.mul(s,t.power(o,r-u)),c=l}return s}maxSmallerThan(e,t,n,r){let i=-1;for(let a=t;a<n;a++)i=Math.max(i,e.ms[a].maxSmallerThan(r));return i}evaluate(e,t){return this.evaluateWith(e,ab,e=>{let n=t[e];if(n===void 0)throw new r(`x${e} is unassigned`);return n})}getSign(e,t){let n=this.evaluate(e,t);return n.isZero()?0:n.isPositive()?1:-1}},hb=class{pm;table=/* @__PURE__ */ new Map;inCache=/* @__PURE__ */ new Set;pscChains=/* @__PURE__ */ new Map;factorizations=/* @__PURE__ */ new Map;constructor(e){this.pm=e}reset(){this.table.clear(),this.inCache.clear(),this.pscChains.clear(),this.factorizations.clear()}mkUnique(e){if(this.inCache.has(e.id))return e;let t=this.pm.getKey(e),n=this.table.get(t);return n===void 0?(this.table.set(t,e),this.inCache.add(e.id),e):n}contains(e){return this.inCache.has(e.id)}pscChain(e,t,n){let r=this.mkUnique(e),i=this.mkUnique(t),a=`${r.id},${i.id},${n}`,o=this.pscChains.get(a);if(o!==void 0)return o;let s=this.pm.pscChain(r,i,n).map(e=>this.mkUnique(e));return this.pscChains.set(a,s),s}factor(e){let t=this.mkUnique(e),n=this.factorizations.get(t.id);if(n!==void 0)return n;let r=this.pm.factor(t).factors.map(e=>this.mkUnique(e));return this.factorizations.set(t.id,r),r}};const gb={maxPrime:31,primeTrials:1,maxSearchSize:5e3};var _b=class e{p;lower;upper;isMinimal;isSignLowerNeg;isNotRational;rootIndex;constructor(e,t,n,r,i,a,o){this.p=e,this.lower=t,this.upper=n,this.isMinimal=r,this.isSignLowerNeg=i,this.isNotRational=a,this.rootIndex=o}get signLower(){return this.isSignLowerNeg?-1:1}clone(){return new e(this.p,this.lower,this.upper,this.isMinimal,this.isSignLowerNeg,this.isNotRational,this.rootIndex)}},V=class{value;constructor(e){this.value=e}};const vb=(e,t)=>t.compare(e)<0?t:e,yb=(e,t)=>t.compare(e)>0?t:e,bb={fromInteger:e=>({lower:Sy.of(e),upper:Sy.of(e)}),add:(e,t)=>({lower:e.lower.add(t.lower),upper:e.upper.add(t.upper)}),mul:(e,t)=>{let n=[e.lower.mul(t.lower),e.lower.mul(t.upper),e.upper.mul(t.lower),e.upper.mul(t.upper)];return{lower:n.reduce(vb),upper:n.reduce(yb)}},power:(e,t)=>xb(e,t)},xb=(e,t)=>{let n=e.lower.power(t),r=e.upper.power(t);return t%2==1||!e.lower.isNeg?{lower:n,upper:r}:e.upper.isNeg?{lower:r,upper:n}:{lower:Sy.zero,upper:yb(n,r)}},Sb=e=>e.lower.isNeg&&e.upper.isPos,Cb=e=>e<=0n?0:xy(e),wb=e=>e>=0n?0:xy(e),Tb=e=>e.isZero?0:e.isPos?xy(e.num)-e.k+1:wb(e.num)-e.k,Eb=(e,t)=>{if(e.k===t.k)return Tb(e);let n=e.isNeg?wb:Cb;return n(t.num)-n(e.num)-t.k+e.k-t.k},Db=(e,t,n,r)=>{if(!e.isOpen&&n.isInt())return n.num;if(!t.isOpen&&r.isInt())return r.num;let i=e.isOpen&&n.isInt()?n.num+1n:n.ceil().num;return i<=(t.isOpen&&r.isInt()?r.num-1n:r.floor().num)?i:null},Ob=(e,t)=>{for(let n=0;;n++){let r=P.of(1n<<BigInt(n)),i=Db(e,t,e.value.mul(r),t.value.mul(r));if(i!==null)return Sy.of(i,n)}},kb=e=>{if(e===void 0||e.value instanceof P)throw new r(`expected an irrational algebraic number`);return e.value},Ab=(e,t)=>{let n=e[t];if(n===void 0)throw new r(`x${t} is unassigned`);return n},jb=e=>e.map(e=>e?.value instanceof P?e.value:void 0),Mb=(e,t,n)=>{let r=[...e];return r[t]=n,r},Nb=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);var Pb=class{um=new Ay;pm=new mb;anumOps={fromInteger:e=>new V(P.of(e)),add:(e,t)=>this.add(e,t),mul:(e,t)=>this.mul(e,t),power:(e,t)=>this.power(e,t)};isZero(e){return e.value instanceof P&&e.value.isZero()}degree(e){return this.isZero(e)?0:e.value instanceof P?1:e.value.p.length-1}copy(e){return new V(e.value instanceof P?e.value:e.value.clone())}isInt(e){if(e.value instanceof P)return e.value.isInt();let t=e.value;if(t.isNotRational)return!1;if(!this.refineUntilPrecision(e,1))return this.isInt(e);let n=P.of(t.upper.floor());return t.lower.compareRational(n)<0&&this.um.evalSignAtQ(t.p,n)===0&&(e.value=n,!0)}isRational(e){if(e.value instanceof P)return!0;let t=e.value;if(t.isNotRational)return!1;let n=this.saveInterval(e),r=t.p[t.p.length-1],i=r<0n?-r:r;if(!this.refineUntilPrecision(e,xy(i)+1))return!0;let a=P.of(t.upper.mul(Sy.of(i)).floor(),i),o=t.lower.compareRational(a)<0&&this.um.evalSignAtQ(t.p,a)===0;return this.restoreIfTooSmall(n),o?e.value=a:t.isNotRational=!0,o}getRootIndex(e){if(e.value instanceof P)return+!this.isZero(e);let t=e.value;return t.rootIndex===0&&(t.rootIndex=this.um.getRootId(t.p,t.lower)+1),t.rootIndex}mkCell(e,t,n,r){let i=new _b(e,t,n,r,!1,r,0);return this.updateSignLower(i),i.p=this.um.normalize(i.p),i.p[i.p.length-1]<0n&&(i.p=this.um.neg(i.p),i.isSignLowerNeg=!i.isSignLowerNeg),i}updateSignLower(e){e.isSignLowerNeg=this.um.evalSignAtBq(e.p,e.lower)<0}mkAnum(e,t,n,r){return e.length===2?new V(P.of(e[0]).div(P.of(e[1])).neg()):new V(this.mkCell(e,t,n,r))}normalize(e){if(e.value instanceof P)return;let t=e.value,n=this.um.normalizeInterval(t.p,t.lower,t.upper,t.signLower);n===null?e.value=P.zero:(t.lower=n.lower,t.upper=n.upper)}refine(e){if(e.value instanceof P)return!1;let t=e.value,n=this.um.refineCore(t.p,t.signLower,t.lower,t.upper);return n.isInterval?(t.lower=n.lower,t.upper=n.upper,!0):(e.value=n.lower.toRational(),!1)}refineTimes(e,t){for(let n=0;n<t;n++)if(!this.refine(e))return!1;return!0}refineUntilPrecision(e,t){if(e.value instanceof P)return!0;let n=e.value,r=this.um.refineToPrecision(n.p,n.lower,n.upper,t);return r.isInterval?(n.lower=r.lower,n.upper=r.upper,!0):(e.value=r.lower.toRational(),!1)}getCellMagnitude(e){return Eb(e.lower,e.upper)}saveInterval(e){let t=kb(e);return{anum:e,lower:t.lower,upper:t.upper,isRestored:!1}}restoreIfTooSmall(e){if(e.isRestored=!0,e.anum.value instanceof P)return;let t=e.anum.value;this.getCellMagnitude(t)>=-16||([t.lower,t.upper,e.lower,e.upper]=[e.lower,e.upper,t.lower,t.upper])}releaseInterval(e){e.isRestored||this.restoreIfTooSmall(e)}factor(e){return tb(this.um,e,gb)}isolateUnivariateRoots(e){let t=[];if(e.length===0)return t;let n=this.um.hasZeroRoots(e);n&&t.push(new V(P.zero));let r=this.factor(n?this.um.removeZeroRoots(e):e);for(let e of r.factors.factors){let n=e.length-1;if(n<=0)continue;if(n===1){t.push(new V(P.of(e[0]).div(P.of(e[1])).neg()));continue}let i=this.um.sqfIsolateRoots(e);for(let e of i.roots)t.push(new V(e.toRational()));for(let n=0;n<i.lowers.length;n++){let a=this.um.isolating2refinable(e,i.lowers[n],i.uppers[n]);t.push(new V(a.isInterval?this.mkCell(e,a.lower,a.upper,r.isComplete):a.lower.toRational()))}}return this.sortRoots(t),t}sortRoots(e){let t=e.length;if(t<2)return;let n=(t,n)=>{let r=this.compare(e[t],e[n]);return r===0?t<n:r<0},r=e.map((e,t)=>t),i=[...r];for(let e=1;e<t;e*=2){for(let a=0;a<t;a+=2*e){let o=Math.min(a+e,t),s=Math.min(a+2*e,t),c=a,l=o,u=a;for(;c<o&&l<s;)i[u++]=n(r[l],r[c])?r[l++]:r[c++];for(;c<o;)i[u++]=r[c++];for(;l<s;)i[u++]=r[l++]}[r,i]=[i,r]}let a=r.map(t=>e[t]);for(let n=0;n<t;n++)e[n]=a[n]}getSignVariationsAtQ(e,t){if(e.length<=1)return 0;let n=0,r=0;for(let i of e){let e=this.um.evalSignAtQ(i,t);e!==0&&(r!==0&&e!==r&&n++,r=e)}return n}isolateKthRoot(e,t,n){if(e.length===2)return new V(P.of(e[0]).div(P.of(e[1])).neg());let r=this.um.signVariationsAtMinusInf(t),i=this.um.signVariationsAtZero(t),a=r-i,o=n<=a,s=o?Sy.of(-(1n<<BigInt(this.um.knuthNegativeRootUpperBound(e)))):Sy.zero,c=o?Sy.zero:Sy.of(1n<<BigInt(this.um.knuthPositiveRootUpperBound(e))),l=o?r:i,u=o?i:this.um.signVariationsAtPlusInf(t),d=o?n:n-a;for(;l>u+1;){let e=s.add(c).div2(),n=this.um.signVariationsAt(t,e),r=l-n;d<=r?(c=e,u=n):(s=e,l=n,d-=r)}if(this.um.evalSignAtBq(e,c)===0)return new V(c.toRational());let f=this.um.isolating2refinable(e,s,c);if(!f.isInterval)return new V(f.lower.toRational());let p=this.getRationalRootIn(e,f.lower,f.upper);return new V(p instanceof P?p:this.mkCell(e,p.lower,p.upper,!1))}getRationalRootIn(e,t,n){let r=e[e.length-1],i=r<0n?-r:r,a=this.um.refineToPrecision(e,t,n,xy(i)+1);if(!a.isInterval)return a.lower.toRational();let o=P.of(a.upper.mul(Sy.of(i)).floor(),i);return a.lower.compareRational(o)<0&&this.um.evalSignAtQ(e,o)===0?o:{lower:a.lower,upper:a.upper}}isolateUnivariateClosest(e,t,n){let r={roots:[],indices:[]};if(e.isConst(t))return r;let i=e.toCoeffs(t);if(i.length===0)return r;let a=this.um.squareFree(i);if(a.length<=1)return r;let o=this.um.sturmSeq(a),s=this.um.signVariationsAtMinusInf(o),c=this.um.signVariationsAtPlusInf(o);if(s<=c)return r;let l=s-c,u=s-this.getSignVariationsAtQ(o,n);return this.um.evalSignAtQ(a,n)===0?{roots:[new V(n)],indices:[u]}:(u>0&&(r.roots.push(this.isolateKthRoot(a,o,u)),r.indices.push(u)),u<l&&(r.roots.push(this.isolateKthRoot(a,o,u+1)),r.indices.push(u+1)),r)}isolateRoots(e,t,n,i=!1){if(e.isConst(t))return[];if(e.isUnivariate(t))return this.isolateUnivariateRoots(e.toCoeffs(t));let a=e.substituteRational(t,jb(n));if(e.isConst(a))return[];if(e.isUnivariate(a))return n[e.maxVar(a)]===void 0?this.isolateUnivariateRoots(e.toCoeffs(a)):[];let o=this.sortByDegree(e.getVars(a),n),s=o[o.length-1];if(n[s]!==void 0)return[];let c=a;for(let t of o.slice(0,-1))if(c=e.resultant(c,e.fromCoeffs(kb(n[t]).p,t),t),c.size===0)break;if(c.size>0)return e.isConst(c)?[]:this.filterRoots(e,a,n,s,this.isolateUnivariateRoots(e.toCoeffs(c)));if(i)throw new r(`resultant vanished during nested isolate_roots call`);return this.isolateVanishedRoots(e,a,n,o,s)}isolateVanishedRoots(e,t,n,r,i){let a=t=>e.evaluateWith(t,this.anumOps,e=>Ab(n,e)),o=e.degree(t,i);if(o===1){let n=a(e.coeff(t,i,0)),r=a(e.coeff(t,i,1));if(this.isZero(r))return[];let o=this.div(n,r);return this.neg(o),[o]}let s=o,c=new V(P.zero);for(;s>=1&&(c=a(e.coeff(t,i,s)),this.isZero(c));s--);if(s===0)return[];let l=Math.max(...r)+1,u=this.pm.add(this.pm.mul(this.pm.mkVar(l),this.pm.mkVar(i,s)),this.convert(e,t,i,s-1));return this.isolateRoots(this.pm,u,Mb(n,l,c),!0)}convert(e,t,n=-1,r=1/0){if(e===this.pm)return t;let i=[],a=[];for(let e=0;e<t.size;e++){let o=t.ms[e];n!==-1&&o.degreeOf(n)>r||(i.push(t.as[e]),a.push(this.pm.mkMonomial(o.vars,o.degrees)))}return this.pm.mkPolynomial(i,a)}sortByDegree(e,t){let n=e=>{let n=t[e];return n===void 0?1/0:this.degree(n)};return[...e].sort((e,t)=>n(e)-n(t))}filterRoots(e,t,n,r,i){return i.filter(i=>this.evalSignAt(e,t,Mb(n,r,i))===0)}isolateRootsClosest(e,t,n,r){let i={roots:[],indices:[]};if(e.isConst(t))return i;if(e.isUnivariate(t))return this.isolateUnivariateClosest(e,t,r);let a=e.substituteRational(t,jb(n));if(e.isConst(a))return i;if(e.isUnivariate(a))return n[e.maxVar(a)]===void 0?this.isolateUnivariateClosest(e,a,r):i;let o=this.isolateRoots(e,t,n),s=new V(r),c=-1,l=-1;for(let e=0;e<o.length;e++)if(this.compare(o[e],s)<=0)c=e;else{l=e;break}return c!==-1&&this.compare(o[c],s)===0?{roots:[o[c]],indices:[c+1]}:(c!==-1&&(i.roots.push(o[c]),i.indices.push(c+1)),l!==-1&&(i.roots.push(o[l]),i.indices.push(l+1)),i)}isolateRootsWithSigns(e,t,n){let r=this.isolateRoots(e,t,n),i=r=>{let i=[...n];for(let n of e.getVars(t))i[n]===void 0&&(i[n]=r);return this.evalSignAt(e,t,i)};if(r.length===0)return{roots:r,signs:[i(new V(P.zero))]};for(let e of r)this.refineUntilPrecision(e,2);let a=[i(this.intLt(r[0]))];for(let e=1;e<r.length;e++)a.push(i(this.select(r[e-1],r[e])));return a.push(i(this.intGt(r[r.length-1]))),{roots:r,signs:a}}evalSignAt(e,t,n){for(;;){let r=jb(n);if(e.getVars(t).every(e=>r[e]!==void 0))return e.getSign(t,r);let i=e.substituteRational(t,r);if(i.size===0)return 0;if(e.isConst(i))return i.as[0]>0n?1:-1;let a=e.getVars(i),o=e=>{let t=kb(n[e]);return{lower:t.lower,upper:t.upper}},s=()=>e.evaluateWith(i,bb,o),c=s(),l=!1;for(;;){if(!Sb(c))return c.lower.isNeg?-1:1;let e=!1;for(let t of a){let r=Ab(n,t);if(!(this.getCellMagnitude(kb(r))<=-16)){if(!this.refine(r)){l=!0;break}e=!0}}if(!e||l)break;c=s()}if(l)continue;let u=this.evalSignByResultant(e,i,n,a,c,s);if(u!==null)return u}}evalSignByResultant(e,t,n,r,i,a){let o=this.sortByDegree(r,n),s=this.pm.sub(this.pm.mkVar(Math.max(...r)+1),this.convert(e,t));for(let e of o)s=this.pm.resultant(s,this.pm.fromCoeffs(kb(n[e]).p,e),e);let c=this.um.nonzeroRootLowerBound(this.pm.toCoeffs(s)),l=Sy.of(1n,c),u=e=>l.neg().compare(e.lower)<0&&e.upper.compare(l)<0;if(u(i))return 0;let d=o.map(e=>this.saveInterval(Ab(n,e))),f=null;for(;f===null;){let e=a();if(!Sb(e))f=e.lower.isNeg?-1:1;else if(u(e))f=0;else if(!o.every(e=>this.refine(Ab(n,e))))break}for(let e of d)this.releaseInterval(e);return f}add(e,t){return this.isZero(e)?this.copy(t):this.isZero(t)?this.copy(e):e.value instanceof P?t.value instanceof P?new V(e.value.add(t.value)):this.addRational(t.value,e.value):t.value instanceof P?this.addRational(e.value,t.value):this.mkBinary(e,t,!0)}addRational(e,t){let n=this.um.translateQ(e.p,t.neg()),r=Sy.fromRational(t),i=r.isExact?{lower:e.lower.add(r.value),upper:e.upper.add(r.value)}:this.um.convertQ2bqInterval(n,e.lower.toRational().add(t),e.upper.toRational().add(t)),a=this.mkAnum(n,i.lower,i.upper,e.isMinimal);return this.normalize(a),a}mul(e,t){return this.isZero(e)||this.isZero(t)?new V(P.zero):e.value instanceof P?t.value instanceof P?new V(e.value.mul(t.value)):this.mulRational(t.value,e.value):t.value instanceof P?this.mulRational(e.value,t.value):this.mkBinary(e,t,!1)}mulRational(e,t){let n=this.um.composePQX(e.p,P.one.div(t)),r=Sy.fromRational(t),i=t.isNegative(),a,o;if(r.isExact)o=e.upper.mul(r.value),a=e.lower.mulIntoOther(r.value),i&&([a,o]=[o,a]);else{let r=e.lower.toRational().mul(t),s=e.upper.toRational().mul(t);i&&([r,s]=[s,r]);let c=this.um.convertQ2bqInterval(n,r,s);a=c.lower,o=c.upper}let s=this.mkAnum(n,a,o,e.isMinimal);return this.normalize(s),s}neg(e){if(e.value instanceof P){e.value=e.value.neg();return}let t=e.value;t.p=this.um.pMinusX(t.p),[t.lower,t.upper]=[t.upper.neg(),t.lower.neg()],t.rootIndex!==0&&(t.rootIndex=this.um.getRootId(t.p,t.lower)+1),this.updateSignLower(t)}refineNonzeroBound(e){if(e.value instanceof P)return;let t=e.value;if(!t.lower.isZero&&!t.upper.isZero)return;let n=t.lower.isZero,r=n?t.signLower:-t.signLower,i=n?t.upper:t.lower;for(;;){i=i.div2(),n?t.lower=i:t.upper=i;let a=this.um.evalSignAtBq(t.p,i);if(a===0){e.value=i.toRational();return}if(a===r)return}}inv(e){if(this.isZero(e))throw new r(`division by zero`);if(this.refineNonzeroBound(e),e.value instanceof P){e.value=P.one.div(e.value);return}let t=e.value;t.p=this.um.p1DivX(t.p);let n=this.um.convertQ2bqInterval(t.p,P.one.div(t.upper.toRational()),P.one.div(t.lower.toRational()));if(!n.isInterval)throw new r(`inversion of algebraic number failed`);t.lower=n.lower,t.upper=n.upper,this.updateSignLower(t)}div(e,t){if(this.isZero(t))throw new r(`division by zero`);let n=this.copy(t);return this.inv(n),this.mul(e,n)}power(e,t){if(t===0){if(this.isZero(e))throw new r(`0^0 is indeterminate`);return new V(P.one)}return t===1?this.copy(e):e.value instanceof P?new V(e.value.pow(t)):this.mkPower(e,t)}getSumPolynomial(e,t){let n=this.pm.composeXMinusY(this.pm.fromCoeffs(e.p,0),1);return this.pm.toCoeffs(this.pm.resultant(n,this.pm.fromCoeffs(t.p,1),1))}getProductPolynomial(e,t){let n=this.pm.composeXDivY(this.pm.fromCoeffs(e.p,0),1);return this.pm.toCoeffs(this.pm.resultant(n,this.pm.fromCoeffs(t.p,1),1))}findIsolatingFactor(e,t,n){let r=0,i=-1,a=0;for(let o=0;o<e.length;o++){let e=t[o];if(e===null)continue;let s=this.um.signVariationsAt(e,n.lower),c=s-this.um.signVariationsAt(e,n.upper);c<=0?t[o]=null:(c===1&&(i=o,a=s),r++)}let o=t[i];return r===1&&o!=null?{factor:e[i],sequence:o,lowerVariations:a}:null}mkBinary(e,t,n){let r=kb(e),i=kb(t),a=this.factor(n?this.getSumPolynomial(r,i):this.getProductPolynomial(r,i)),o=a.factors.factors,s=o.map(e=>this.um.sturmSeq(e)),c=this.saveInterval(e),l=this.saveInterval(t);for(;;){let u=n?bb.add(r,i):bb.mul(r,i),d=this.findIsolatingFactor(o,s,u);if(d!==null)return this.restoreIfTooSmall(c),this.restoreIfTooSmall(l),this.setCore(d,u,a.isComplete);if(!this.refine(e)||!this.refine(t)){this.restoreIfTooSmall(c),this.restoreIfTooSmall(c);let r=n?this.add(e,t):this.mul(e,t);return this.releaseInterval(l),r}}}getPowerPolynomial(e,t){let n=this.pm.sub(this.pm.mkVar(0),this.pm.mkVar(1,t));return this.pm.toCoeffs(this.pm.resultant(n,this.pm.fromCoeffs(e.p,1),1))}mkPower(e,t){let n=kb(e),r=this.factor(this.getPowerPolynomial(n,t)),i=r.factors.factors,a=i.map(e=>this.um.sturmSeq(e)),o=this.saveInterval(e);for(;;){let s=xb(n,t),c=this.findIsolatingFactor(i,a,s);if(c!==null)return this.restoreIfTooSmall(o),this.setCore(c,s,r.isComplete);if(!this.refine(e))return this.restoreIfTooSmall(o),this.power(e,t)}}setCore(e,t,n){let r=e.factor,i=t.lower,a=t.upper;if(Sb(t)){if(this.um.hasZeroRoots(r))return new V(P.zero);e.lowerVariations===this.um.signVariationsAtZero(e.sequence)?i=Sy.zero:a=Sy.zero}let o=this.um.hasZeroRoots(r)?this.um.removeZeroRoots(r):r,s=this.um.isolating2refinable(o,i,a);return s.isInterval?this.mkAnum(o,s.lower,s.upper,n):new V(s.lower.toRational())}compareRational(e,t){if(e.upper.compareRational(t)<=0)return-1;if(e.lower.compareRational(t)>=0)return 1;let n=this.um.evalSignAtQ(e.p,t);return n===0?0:n===e.signLower?1:-1}compare(e,t){return e.value instanceof P?t.value instanceof P?e.value.compare(t.value):-this.compareRational(t.value,e.value):t.value instanceof P?this.compareRational(e.value,t.value):this.compareCore(e,t)}compareCore(e,t){let n=kb(e),r=kb(t),i=()=>n.upper.compare(r.lower)<=0?-1:+(n.lower.compare(r.upper)>=0),a=i();if(a!==0)return a;if(Nb(n.p,r.p))return 0;if(n.isMinimal&&r.isMinimal){for(;;)if(this.refine(e),this.refine(t),a=i(),a!==0)return a}let o=this.getCellMagnitude(n),s=this.getCellMagnitude(r),c=Math.max(-16,Math.min(o,s));if(s>c){if(!this.refineTimes(t,s-c))return this.compare(e,t);if(a=i(),a!==0)return a}if(o>c){if(!this.refineTimes(e,o-c))return this.compare(e,t);if(a=i(),a!==0)return a}for(let n=0;n<c- -16;n++){if(!this.refine(e)||!this.refine(t))return this.compare(e,t);if(a=i(),a!==0)return a}let l=this.um.refineToPrecision(n.p,n.lower,n.upper,40),u=this.um.refineToPrecision(r.p,r.lower,r.upper,40);if(l.isInterval&&u.isInterval){if(l.lower.compare(u.upper)>0)return 1;if(l.upper.compare(u.lower)<0)return-1}if(this.compareRational(n,u.lower.toRational())<0)return-1;if(this.compareRational(n,u.upper.toRational())>0||this.compareRational(r,l.lower.toRational())<0)return 1;if(this.compareRational(r,l.upper.toRational())>0)return-1;let d=this.um.sturmTarskiSeq(n.p,r.p),f=this.um.signVariationsAt(d,n.lower)-this.um.signVariationsAt(d,n.upper);return f===0?0:f<0==r.signLower<0?-1:1}intLt(e){return this.refineUntilPrecision(e,1),new V(P.of(e.value instanceof P?e.value.floor().num-1n:e.value.lower.floor()))}intGt(e){return this.refineUntilPrecision(e,1),new V(P.of(e.value instanceof P?e.value.ceil().num+1n:e.value.upper.ceil()))}separate(e,t){if(e.value instanceof P){let n=e.value;for(;t.value instanceof _b&&t.value.lower.compareRational(n)<=0;)this.refine(t)}else if(t.value instanceof P){let n=t.value;for(;e.value instanceof _b&&e.value.upper.compareRational(n)>=0;)this.refine(e)}else for(;e.value instanceof _b&&t.value instanceof _b&&e.value.upper.compare(t.value.lower)>=0;)this.refine(e),this.refine(t)}select(e,t){this.separate(e,t);let n=e.value instanceof P?{value:e.value,isOpen:!0}:{value:e.value.upper.toRational(),isOpen:!1},r=t.value instanceof P?{value:t.value,isOpen:!0}:{value:t.value.lower.toRational(),isOpen:!1};return new V(Ob(n,r).toRational())}};const Fb=1e5,Ib=(e,t)=>{let n=e.core;if(n.isBase(t)||e.isFixed(t))return;let r=e.getValue(t),i,a,o=1n,s=e=>{(i===void 0||e.compare(i)>0)&&(i=e)},c=e=>{(a===void 0||e.compare(a)<0)&&(a=e)};n.hasLowerBound(t)&&s(e.getLowerBound(t).sub(r)),n.hasUpperBound(t)&&c(e.getUpperBound(t).sub(r));let l=(e,t,n)=>e.equals(P.one)?t.sub(n):e.equals(P.minusOne)?n.sub(t):t.sub(n).div(e);for(let r of n.matrix.columns[t]){let t=n.matrix.getVal(r),u=n.basis[r.row],d=e.getValue(u);e.isInt(u)&&!t.isInt()&&d.isInt()&&(o=Nm(o,t.den)),!(i!==void 0&&a!==void 0&&i.equals(a))&&(t.isNegative()?(n.hasLowerBound(u)&&s(l(t,d,e.getLowerBound(u))),n.hasUpperBound(u)&&c(l(t,d,e.getUpperBound(u)))):(n.hasUpperBound(u)&&s(l(t,d,e.getUpperBound(u))),n.hasLowerBound(u)&&c(l(t,d,e.getLowerBound(u)))))}let u=i?.add(r),d=a?.add(r);if(!(u!==void 0&&d!==void 0&&u.compare(d)>0))return{lower:u,upper:d,multiple:P.of(o)}},Lb=(e,t)=>{if(e.isFixed(t)||e.isBase(t)||e.settings.isCanceled())return!1;let n=Ib(e,t);if(n===void 0)return!1;let r=e.settings,i=e.getValue(t),a=n.multiple,o=e=>new z(a.mul(P.fromNumber(r.getRandomNext()%(e+1))));if(n.lower===void 0&&n.upper===void 0)return e.setValueForNbasicColumn(t,o(Fb).add(i)),!0;let s=e.isInt(t),c=n.lower===void 0?void 0:s?new z(n.lower.ceil()):n.lower,l=n.upper===void 0?void 0:s?new z(n.upper.floor()):n.upper;if(c!==void 0&&l!==void 0&&c.compare(l)>=0)return!1;if(l===void 0)return e.setValueForNbasicColumn(t,i.add(o(Fb))),!0;if(c===void 0)return e.setValueForNbasicColumn(t,i.sub(o(Fb))),!0;let u=l.sub(i).div(a).floor(),d=c.sub(i).div(a).ceil(),f=u.sub(d);if(!f.isPositive())return!1;let p=f.compare(P.fromNumber(Fb))<0?Number(f.num):Fb,m=d.add(P.fromNumber(r.getRandomNext()%(p+1)));return e.setValueForNbasicColumn(t,i.add(new z(a.mul(m)))),!0},Rb=(e,t)=>{let n=new tv;for(let e of t)n.add(e);let r=t=>{if(!Lb(e,t))return!1;for(let r of e.core.matrix.columns[t]){let t=e.core.basis[r.row];n.has(t)&&n.delete(t)}return!0};for(let t of n.elems.slice())if(n.has(t)){if(!e.isBase(t))r(t);else for(let n of e.getRow(e.core.heading[t]))if(!e.isBase(n.column)&&!e.isFixed(n.column)&&r(n.column))break}},zb=(e,t)=>e?t?1:2:t?-1:-2,Bb=e=>zb(e.isLower,e.isStrict);var Vb=class{solver;host;ibounds=[];improvedLower=/* @__PURE__ */ new Map;improvedUpper=/* @__PURE__ */ new Map;visitedRows=/* @__PURE__ */ new Set;val2fixedRow=/* @__PURE__ */ new Map;row2indexPos=/* @__PURE__ */ new Map;row2indexNeg=/* @__PURE__ */ new Map;constructor(e,t){this.solver=e,this.host=t}init(){this.improvedLower.clear(),this.improvedUpper.clear(),this.ibounds=[]}propagateBoundsForTouchedRows(){let e=this.solver,t=e.settings;if(t.isPropagatingEqs){t.getRandomNext()%10==0&&e.removeFixedVarsFromBase(),this.visitedRows.clear();for(let n of e.touchedRows.elems.slice()){let r=t.stats.offsetEqs;if(this.cheapEqOnNbase(n),t.isCanceled())return;t.stats.offsetEqs>r&&e.rowBoundsToReplay.push(n)}}for(let n of e.touchedRows.elems.slice()){let r=e.getRow(n);if(r.length<=t.maxRowLengthForBoundPropagation&&(t.stats.bpRowsAnalyzed++,this.analyzeRow(r)),t.isCanceled())return}e.touchedRows.clear()}analyzeRow(e){let t=this.solver.core,n=-1,r=-1,i=e=>{n=n===-1?e:-2},a=e=>{r=r===-1?e:-2};for(let o of e){if(r===-2&&n===-2||o.coeff.isBig())return;switch(t.getColumnType(o.column)){case 1:o.coeff.isPositive()?i(o.column):a(o.column);break;case 2:o.coeff.isNegative()?i(o.column):a(o.column);break;case 0:i(o.column),a(o.column)}}let o,s=()=>(o??=e.some(e=>this.host.columnIsInteresting(e.column)),o);n>=0?this.host.columnIsInteresting(n)&&this.limitMonoidFromOne(e,n,!0):n===-1&&s()&&this.limitAllMonoids(e,!0),r>=0?this.host.columnIsInteresting(r)&&this.limitMonoidFromOne(e,r,!1):r===-1&&s()&&this.limitAllMonoids(e,!1)}getMonoidBound(e,t,n){let r=this.solver,i=e.isPositive()===n?r.getUpperBound(t):r.getLowerBound(t);return{value:i.x,isStrict:!i.y.isZero()}}limitAllMonoids(e,t){let n=0,r=P.zero;for(let i of e){let e=this.getMonoidBound(i.coeff,i.column,t);r=r.sub(i.coeff.mul(e.value)),e.isStrict&&n++}for(let i of e){if(!this.host.columnIsInteresting(i.column))continue;let a=this.getMonoidBound(i.coeff,i.column,t),o=r.div(i.coeff).add(a.value),s=i.coeff.isPositive(),c=n-+!!a.isStrict>0;this.limitJ(e,i.column,o,s,s===t,c)}}limitMonoidFromOne(e,t,n){let r=P.zero,i=P.zero,a=!1;for(let o of e){if(o.column===t){i=o.coeff;continue}let e=this.getMonoidBound(o.coeff,o.column,n);r=r.sub(o.coeff.mul(e.value)),e.isStrict&&(a=!0)}r=r.div(i);let o=i.isPositive();this.limitJ(e,t,r,o,o===n,a)}limitJ(e,t,n,r,i,a){if(!this.host.boundIsInteresting(t,zb(i,a),n))return;let o=this.solver;this.addBound(n,t,i,a,()=>{let n=(r?1:-1)*(i?1:-1),a=e.find(e=>e.column===t)?.coeff.abs()??P.one,s=[];for(let r of e){if(r.column===t)continue;let e=n*(r.coeff.isPositive()?1:-1)>0?o.getUpperWitness(r.column):o.getLowerWitness(r.column);s.push([r.coeff.abs().div(a),e])}return s})}addBound(e,t,n,r,i){let a=n?this.improvedLower:this.improvedUpper,o=a.get(t);if(o===void 0){a.set(t,this.ibounds.length),this.ibounds.push({column:t,bound:e,isLower:n,isStrict:r,explain:i});return}let s=this.ibounds[o],c=e.compare(s.bound);((n?c>0:c<0)||c===0&&!s.isStrict&&r)&&(s.bound=e,s.isStrict=r,s.explain=i)}isFixed(e){let t=this.solver;return t.core.getColumnType(e)===4&&t.getLowerBound(e).y.isZero()}getVal(e){return this.solver.getValue(e).x.toString()}isEqNew(e,t){let n=this.solver.getExternal(e),r=this.solver.getExternal(t);return n!==-1&&r!==-1&&!this.host.isEqual(n,r)}explainFixedInRow(e,t){let n=this.solver,r=[];for(let t of n.getRow(e))n.isFixed(t.column)&&r.push(n.getLowerWitness(t.column),n.getUpperWitness(t.column));for(let e of $_(r))t.push(e)}addEqOnColumns(e,t,n,r){if(!this.host.addEq(t,n,e,r))return;let i=this.solver.settings.stats;r?i.fixedEqs++:i.offsetEqs++}getOnlyOneNonFixed(e){let t=-1;for(let n of this.solver.getRow(e))if(!this.isFixed(n.column)){if(t!==-1)return-1;t=n.column}return t}tryAddEquationWithInternalFixedTables(e){let t=this.solver,n=this.getOnlyOneNonFixed(e);if(n===-1)return;let r=this.getVal(n),i=this.val2fixedRow.get(r);if(i===void 0||i>=t.getRowCount()){this.val2fixedRow.set(r,e);return}let a=this.getOnlyOneNonFixed(i);if(a===-1||!t.getValue(n).equals(t.getValue(a))||t.isInt(n)!==t.isInt(a)){this.val2fixedRow.set(r,e);return}if(n===a||!this.isEqNew(n,a))return;let o=new fv;this.explainFixedInRow(e,o),this.explainFixedInRow(i,o),this.addEqOnColumns(o,n,a,!0)}tryAddEquationWithLpFixedTables(e,t){let n=this.solver;if(this.isFixed(t))return;let r=n.getValue(t),i=r.y.isZero()?n.findInFixedTables(r.x,n.isInt(t)):void 0;if(i===void 0){this.tryAddEquationWithInternalFixedTables(e);return}if(!this.isEqNew(i,t))return;let a=new fv;this.explainFixedInRow(e,a);for(let e of $_([n.getLowerWitness(i),n.getUpperWitness(i)]))a.push(e);this.addEqOnColumns(a,i,t,!0)}extractNonFixed(e){let t=this.solver,n=t.core.basis[e];if(this.isFixed(n))return{count:0,x:n,y:-1,ySign:0};let r=1,i=-1,a=0;for(let o of t.getRow(e))if(!(o.column===n||this.isFixed(o.column))&&(++r>2||(i=o.column,a=o.coeff.equals(P.one)?1:o.coeff.equals(P.minusOne)?-1:0,a===0)))return{count:r,x:n,y:i,ySign:a};return{count:r,x:n,y:i,ySign:a}}cheapEqOnNbase(e){this.cheapEqOnNbaseCore(e),this.row2indexPos.clear(),this.row2indexNeg.clear()}cheapEqOnNbaseCore(e){let t=this.solver;if(this.visitedRows.has(e))return;this.visitedRows.add(e);let n=this.extractNonFixed(e);if(!(n.count===0||n.count>2)){if(n.count===1)this.tryAddEquationWithLpFixedTables(e,n.x);else if(n.ySign!==0){(n.ySign===1?this.row2indexPos:this.row2indexNeg).set(this.getVal(n.x),e);for(let r of t.core.matrix.columns[n.y]){let n=r.row;if(n===e||this.visitedRows.has(n))continue;this.visitedRows.add(n);let i=this.extractNonFixed(n);if(i.count!==2||i.ySign===0)continue;let a=i.ySign===1?this.row2indexPos:this.row2indexNeg,o=this.getVal(i.x),s=a.get(o);if(s===void 0){a.set(o,n);continue}let c=t.core.basis[s];if(t.isInt(i.x)!==t.isInt(c)||!t.getValue(i.x).y.equals(t.getValue(c).y)||!this.isEqNew(i.x,c))continue;let l=new fv;this.explainFixedInRow(s,l),this.explainFixedInRow(n,l),this.addEqOnColumns(l,i.x,c,!1)}}}}},Hb=class{delayBound;delay=0;constructor(e){this.delayBound=e}shouldRun(){return this.delay>0&&this.delay--,this.delay<2}update(e){e?this.delayBound=Math.floor(this.delayBound/2):this.delayBound<1<<20&&(this.delayBound=Math.max(2*this.delayBound,1)),this.delay=this.delayBound}},Ub=class{failStreak=0;squeezesSinceSatCheck=0;get isEnabled(){return this.squeezesSinceSatCheck<50}get isEager(){return this.failStreak<3}onSqueeze(e){this.squeezesSinceSatCheck++,this.failStreak=e?0:this.failStreak+1}onNothingToRefine(){this.squeezesSinceSatCheck=Math.floor(this.squeezesSinceSatCheck/2)}};const Wb=e=>{switch(e){case-2:return 1;case-1:return 2;case 2:return-1;case 1:return-2;case 0:return 3;default:return 0}},Gb=e=>e.isPositive()?1:e.isNegative()?-1:0,Kb=e=>e?P.minusOne:P.one,H=(e,t,n)=>({cmp:t,term:typeof e==`number`?new B([[e,P.one]]):e,rs:typeof n==`number`?P.fromNumber(n):n}),qb=e=>e.ineqs.length===0&&!e.expl.isEmpty;var U=class{core;lemma={ineqs:[],expl:new fv};constructor(e){this.core=e,e.lemmas.push(this.lemma)}get expl(){return this.lemma.expl}addIneq(e){return this.core.explainIneq(this,e.term,e.cmp,e.rs)||this.lemma.ineqs.push(e),this}addExplanation(e){return this.lemma.expl.addExplanation(e),this}explainMonic(e){for(let t of e.vars)this.explainVar(t);return this}explainFactor(e){return e.isMon?this.explainMonic(this.core.emons.get(e.variable)):this.explainVar(e.variable),this}explainFactorization(e){if(e.mon!==null)return this;for(let t of e.factors)this.explainFactor(t);return this}explainVar(e){return this.core.varEqs.explainVar(e,this.lemma.expl),this}explainFixed(e){return this.explainExistingLowerBound(e),this.explainExistingUpperBound(e),this}explainVarSeparatedFromZero(e){return this.core.varHasNegativeUpperBound(e)?this.explainExistingUpperBound(e):this.explainExistingLowerBound(e),this}explainExistingLowerBound(e){let t=new fv;return t.pushDependency(this.core.lra.getLowerWitness(e)),this.addExplanation(t)}explainExistingUpperBound(e){let t=new fv;return t.pushDependency(this.core.lra.getUpperWitness(e)),this.addExplanation(t)}},Jb=class{core;constructor(e){this.core=e}basicLemma(e){let t=this.core;if(this.basicSignLemma(e)||e)return;let n=t.toRefine,r=t.random(),i=n.size;for(let e=0;e<i;e++)this.basicLemmaForMonModelBased(t.emons.get(n.elems[(e+r)%n.size]))}basicSignLemmaOnTwoMonics(e,t){let n=Kb(e.rsign!==t.rsign);return!this.core.varVal(e).equals(this.core.varVal(t).mul(n))&&(this.generateSignLemma(e,t,n),!0)}generateZeroLemmas(e){let t=Gb(this.core.varVal(e)),n=[],r=this.findBestZero(e,n),i=0;for(let n of e.vars)if(n===r)i++;else if(t=this.getNonStrictSign(n,t),t===0)break;t!==0&&i%2==0&&(t=0),t===0?this.addTrivialZeroLemma(r,e):this.generateStrictCaseZeroLemma(e,r,t);for(let t of n)this.addFixedZeroLemma(e,t)}getNonStrictSign(e,t){let n=this.core,r=n.val(e);return r.isZero()?n.hasLowerBound(e)&&!n.getLowerBound(e).isNegative()?t:n.hasUpperBound(e)&&!n.getUpperBound(e).isPositive()?-t:0:t*Gb(r)}basicSignLemmaModelBasedOneMon(e,t){if(t===0){this.generateZeroLemmas(e);return}let n=new U(this.core);for(let t of e.vars)this.negateStrictSign(n,t);n.addIneq(H(e.variable,t===1?1:-1,0))}basicSignLemmaModelBased(){let e=this.core,t=e.random(),n=e.toRefine.size;for(let r=n;r-->0;){let i=e.emons.get(e.toRefine.elems[(t+r)%n]),a=e.getMonicSign(i);if(Gb(e.varVal(i))!==a&&(this.basicSignLemmaModelBasedOneMon(i,a),e.done()))return!0}return e.lemmas.length>0}basicSignLemmaOnMon(e,t){if(t.has(e))return!1;t.add(e);let n=this.core,r=n.emons.get(e);for(let e of n.emons.getSignEquivMonics(r))if(r.variable!==e.variable&&this.basicSignLemmaOnTwoMonics(r,e)&&n.done())return!0;return!1}basicSignLemma(e){if(!e)return this.basicSignLemmaModelBased();let t=/* @__PURE__ */ new Set;for(let e of this.core.toRefine.elems)if(this.basicSignLemmaOnMon(e,t))return!0;return!1}generateSignLemma(e,t,n){let r=new U(this.core);r.addIneq(H(new B([[e.variable,P.one],[t.variable,n.neg()]]),0,0)),r.explainMonic(e),r.explainMonic(t)}findBestZero(e,t){let n=this.core,r=-1;for(let i of e.vars)n.val(i).isZero()&&(n.varIsFixedToZero(i)&&t.push(i),(r===-1||n.zeroIsAnInnerPointOfBounds(i))&&(r=i));return r}addTrivialZeroLemma(e,t){let n=new U(this.core);n.addIneq(H(e,3,0)),n.addIneq(H(t.variable,0,0))}generateStrictCaseZeroLemma(e,t,n){let r=new U(this.core);r.addIneq(H(t,n===1?1:-1,0));for(let n of e.vars)n!==t&&this.negateStrictSign(r,n);this.negateStrictSign(r,e.variable)}addFixedZeroLemma(e,t){let n=new U(this.core);n.explainFixed(t),n.addIneq(H(e.variable,0,0))}negateStrictSign(e,t){let n=this.core,r=n.val(t);r.isZero()?n.hasLowerBound(t)&&!n.getLowerBound(t).isNegative()?(e.explainExistingLowerBound(t),e.addIneq(H(t,1,0))):(e.explainExistingUpperBound(t),e.addIneq(H(t,-1,0))):e.addIneq(H(t,Gb(r)===1?-2:2,0))}basicLemmaForMonModelBased(e){let t=this.core,n=t.varVal(e).isZero();for(let r of t.getFactorizations(e))r.factors.length!==0&&(n?(this.basicLemmaForMonZeroModelBased(e,r),this.basicLemmaForMonNeutralModelBased(e,r)):(this.basicLemmaForMonNonZeroModelBased(r),this.basicLemmaForMonNeutralModelBased(e,r),this.proportionLemmaModelBased(e,r)))}proportionLemmaModelBased(e,t){let n=this.core;if(n.hasRealFactorization(t))return;let r=n.varVal(e).abs();if(r.isZero())return;let i=t.factors.findIndex(e=>n.valFactor(e).abs().compare(r)>0);i!==-1&&this.generatePl(e,t,i)}generatePlOnMon(e,t){let n=this.core,r=new U(n),i=e.variable,a=P.fromNumber(Gb(n.val(i)));r.addIneq(H(new B([[i,a]]),-1,0)),e.vars.forEach((e,o)=>{if(o!==t){r.addIneq(H(e,0,0));return}let s=P.fromNumber(Gb(n.val(e)));r.addIneq(H(new B([[i,a],[e,s.neg()]]),2,0))})}generatePl(e,t,n){if(t.mon!==null){this.generatePlOnMon(e,n);return}let r=this.core,i=new U(r),a=P.fromNumber(Gb(r.varVal(e))),o=e.variable;i.addIneq(H(new B([[o,a]]),-1,0)),t.factors.forEach((e,t)=>{if(t!==n){i.addIneq(H(e.variable,0,0));return}let s=P.fromNumber(Gb(r.val(e.variable)));i.addIneq(H(new B([[o,a],[e.variable,s.neg()]]),2,0))}),i.explainFactorization(t),i.explainMonic(e)}isSeparatedFromZero(e){let t=this.core;return e.factors.every(e=>t.varHasPositiveLowerBound(e.variable)||t.varHasNegativeUpperBound(e.variable))}basicLemmaForMonZeroModelBased(e,t){let n=new U(this.core);if(n.addIneq(H(e.variable,3,0)),this.isSeparatedFromZero(t))for(let e of t.factors)n.explainVarSeparatedFromZero(e.variable);else for(let e of t.factors)n.addIneq(H(e.variable,0,0));n.explainFactorization(t)}basicLemmaForMonNeutralFromFactorsToMonicModelBasedFm(e){let t=this.core,n=this.getNeutralNotOne(e,e.vars.map(e=>({variable:e,value:t.val(e)})));if(n===void 0)return;let r=new U(t);for(let i of e.vars)n.notOne!==i&&r.addIneq(H(i,3,t.val(i)));this.addNeutralConclusion(r,e,n.notOne,n.sign)}addNeutralConclusion(e,t,n,r){n===-1?e.addIneq(H(t.variable,0,r)):e.addIneq(H(new B([[t.variable,P.one],[n,r.neg()]]),0,0))}basicLemmaForMonNeutralModelBased(e,t){t.mon===null?this.basicLemmaForMonNeutralFromFactorsToMonicModelBased(e,t):this.basicLemmaForMonNeutralFromFactorsToMonicModelBasedFm(t.mon)}getNeutralNotOne(e,t){let n=P.one,r=-1;for(let e of t)if(!e.value.equals(P.one)){if(e.value.equals(P.minusOne))n=n.neg();else if(r===-1)r=e.variable;else return}let i=this.core.varVal(e);if(!(r===-1&&i.equals(n))&&!(r!==-1&&i.equals(this.core.val(r).mul(n))))return{notOne:r,sign:n}}basicLemmaForMonNeutralFromFactorsToMonicModelBased(e,t){let n=this.core,r=this.getNeutralNotOne(e,t.factors.map(e=>({variable:e.variable,value:n.valFactor(e)})));if(r===void 0||t.factors.some(e=>e.isNegated))return;let i=new U(n);for(let e of t.factors)r.notOne!==e.variable&&i.addIneq(H(e.variable,3,n.val(e.variable)));this.addNeutralConclusion(i,e,r.notOne,r.sign),i.explainMonic(e),i.explainFactorization(t)}basicLemmaForMonNonZeroModelBased(e){let t=e.mon;if(t===null)return;let n=this.core,r=e.factors.find(e=>n.valFactor(e).isZero());if(r===void 0)return;let i=new U(n);i.addIneq(H(r.variable,3,0)),i.addIneq(H(t.variable,0,0)),i.explainFactorization(e)}};const Yb=(e,t)=>P.of(Pm(e.num,t.num)),Xb=e=>e.quotient===-1||e.dividend===-1||e.divisor===-1||e.remainder===-1,Zb=(e,t)=>new B([[e,P.one],[t,P.minusOne]]);var Qb=class{core;idivisions=[];boundedDivisions=[];divisibility=[];constructor(e){this.core=e}pushDivision(e,t){e.push(t),this.core.emons.trail.push(()=>e.pop())}addIdivision(e){Xb(e)||this.pushDivision(this.idivisions,e)}addBoundedDivision(e){if(Xb(e))return;let t=this.core.lra;t.hasTerm(e.dividend)||t.hasTerm(e.divisor)||t.hasTerm(e.quotient)||this.pushDivision(this.boundedDivisions,e)}addDivisibility(e){Xb(e)||this.pushDivision(this.divisibility,e)}monotonicity1(e,t){if(!(e.divisorValue.compare(t.divisorValue)>=0&&t.divisorValue.isPositive()&&!e.dividendValue.isNegative()&&e.dividendValue.compare(t.dividendValue)<=0&&e.quotientValue.compare(t.quotientValue)>0))return!1;let n=new U(this.core);return n.addIneq(H(Zb(e.divisor,t.divisor),-1,0)),n.addIneq(H(t.divisor,-2,0)),n.addIneq(H(e.dividend,-1,0)),n.addIneq(H(Zb(e.dividend,t.dividend),1,0)),n.addIneq(H(Zb(e.quotient,t.quotient),-2,0)),!0}monotonicity2(e,t){if(!(t.divisorValue.compare(e.divisorValue)<=0&&e.divisorValue.isNegative()&&e.dividendValue.compare(t.dividendValue)>=0&&!t.dividendValue.isNegative()&&e.quotientValue.compare(t.quotientValue)>0))return!1;let n=new U(this.core);return n.addIneq(H(Zb(e.divisor,t.divisor),-1,0)),n.addIneq(H(e.divisor,2,0)),n.addIneq(H(Zb(e.dividend,t.dividend),-1,0)),n.addIneq(H(t.dividend,-1,0)),n.addIneq(H(Zb(e.quotient,t.quotient),-2,0)),!0}monotonicity3(e,t){if(!(t.divisorValue.compare(e.divisorValue)<=0&&e.divisorValue.isNegative()&&e.dividendValue.compare(t.dividendValue)<=0&&!t.dividendValue.isPositive()&&e.quotientValue.compare(t.quotientValue)<0))return!1;let n=new U(this.core);return n.addIneq(H(Zb(e.divisor,t.divisor),-1,0)),n.addIneq(H(e.divisor,2,0)),n.addIneq(H(Zb(e.dividend,t.dividend),1,0)),n.addIneq(H(t.dividend,1,0)),n.addIneq(H(Zb(e.quotient,t.quotient),2,0)),!0}monotonicity(e,t){return this.monotonicity1(e,t)||this.monotonicity1(t,e)||this.monotonicity2(e,t)||this.monotonicity2(t,e)||this.monotonicity3(e,t)||this.monotonicity3(t,e)}getValues(e){let t=this.core;return{dividend:e.dividend,dividendValue:t.val(e.dividend),divisor:e.divisor,divisorValue:t.val(e.divisor),quotient:e.quotient,quotientValue:t.val(e.quotient)}}checkMonotonicity(e){let t=this.core;for(let n of e){if(!t.isRelevant(n.quotient))continue;let r=this.getValues(n),i=r.dividendValue,a=r.divisorValue;if(!a.isZero()&&i.isInt()&&a.isInt()&&!r.quotientValue.equals(Yb(i,a))){for(let i of e)if(i.quotient!==n.quotient&&t.isRelevant(i.quotient)&&this.monotonicity(r,this.getValues(i)))return!0}}return!1}check(){this.core.isUsingNraModel||this.checkMonotonicity(this.idivisions)||(this.checkModMult(),this.checkLinearDivisibility(),this.checkModCongruence())}checkBoundedDivisions(){let e=this.core,t=e.random(),n=this.boundedDivisions.length;for(let r=0;r<n;r++){let i=this.boundedDivisions[(t+r)%n],a=i.quotient;if(!e.isRelevant(a))continue;let o=e.val(i.dividend),s=e.val(i.divisor);if(o.isNegative()||!o.isInt()||!s.isPositive()||!s.isInt())continue;let c=Yb(o,s);if(e.val(a).equals(c))continue;let l=s.mul(c).add(s).sub(P.one),u=s.mul(c);if(o.compare(l)>0){let t=new U(e);t.addIneq(H(i.divisor,3,s)),t.addIneq(H(i.dividend,1,l)),t.addIneq(H(a,-2,c));return}if(o.compare(u)<0){let t=new U(e);t.addIneq(H(i.divisor,3,s)),t.addIneq(H(i.dividend,-1,u)),t.addIneq(H(a,2,c));return}}}checkModMult(){let e=this.core,t=e.random(),n=this.boundedDivisions.length;for(let r=0;r<n;r++){let i=this.boundedDivisions[(t+r)%n],a=i.remainder;if(!e.isRelevant(i.quotient)||e.varIsFixedToZero(a)||e.val(a).isZero()||!e.isMonicVar(i.dividend))continue;let o=e.val(i.divisor);if(o.isPositive()&&o.isInt())for(let t of e.emons.get(i.dividend).vars)for(let n of this.boundedDivisions){if(n.dividend!==t||!e.val(n.divisor).equals(o)||!e.varIsFixedToZero(n.remainder))continue;let r=new U(e);r.addIneq(H(n.remainder,3,0)),r.addIneq(H(a,0,0));return}}}checkLinearDivisibility(){let e=this.core,t=this.divisibility.length;for(let n=0;n<t;n++){let r=this.divisibility[n],i=r.dividend,a=r.divisor;if(!e.isRelevant(r.remainder)||e.val(r.remainder).isZero())continue;let o=e.val(i),s=e.val(a);if(!(s.isZero()||o.isZero()))for(let c=0;c<t;c++){if(n===c)continue;let t=this.divisibility[c],l=t.dividend,u=t.divisor;if(u!==a&&!e.val(u).equals(s)||!e.isRelevant(t.remainder)||!e.val(t.remainder).isZero())continue;let d=e.val(l);if(d.isZero())continue;let f=o.div(d);if(!f.isInt()||f.isZero()||!o.equals(f.mul(d)))continue;let p=new U(e);p.addIneq(H(a,0,0)),u!==a&&p.addIneq(H(Zb(a,u),3,0)),p.addIneq(H(new B([[i,P.one],[l,f.neg()]]),3,0)),p.addIneq(H(t.remainder,3,0)),p.addIneq(H(r.remainder,0,0));return}}}checkModCongruence(){let e=this.core,t=this.divisibility.length;for(let n=0;n<t;n++){let r=this.divisibility[n],i=r.divisor;if(!e.isRelevant(r.remainder))continue;let a=e.val(i);if(!a.isZero())for(let o=n+1;o<t;o++){let t=this.divisibility[o],n=t.divisor;if(!e.isRelevant(t.remainder)||n!==i&&!e.val(n).equals(a))continue;let s=e.val(r.quotient).sub(e.val(t.quotient)),c=e.val(r.remainder).sub(e.val(t.remainder)),l=e.val(r.dividend).sub(e.val(t.dividend)).sub(s.mul(a));if(c.equals(l))continue;let u=new U(e);u.addIneq(H(i,0,0)),n!==i&&u.addIneq(H(Zb(i,n),3,0)),u.addIneq(H(Zb(r.quotient,t.quotient),3,s));let d=new B;d.addMonomial(P.one,r.remainder),d.addMonomial(P.minusOne,t.remainder),d.addMonomial(P.minusOne,r.dividend),d.addMonomial(P.one,t.dividend),d.addMonomial(s,i),u.addIneq(H(d,0,0));return}}}},$b=class{trail=[];scopes=[];push(e){this.trail.push(e)}pushScope(){this.scopes.push(this.trail.length)}popScope(e){if(e===0)return;let t=this.scopes[this.scopes.length-e];for(N(this.scopes,this.scopes.length-e);this.trail.length>t;)this.trail.pop()?.()}},ex=class{trail;finds=[];sizes=[];nexts=[];handler={};constructor(e){this.trail=e}get numVars(){return this.finds.length}mkVar(){let e=this.finds.length;return this.finds.push(e),this.sizes.push(1),this.nexts.push(e),this.trail.push(()=>{this.finds.pop(),this.sizes.pop(),this.nexts.pop()}),e}find(e){let t=e;for(;this.finds[t]!==t;)t=this.finds[t];return t}next(e){return this.nexts[e]}merge(e,t){let n=this.find(e),r=this.find(t);if(n===r)return;let i=this.sizes[n]>this.sizes[r],a=i?r:n,o=i?n:r,s=i?t:e,c=i?e:t;this.handler.mergeEh?.(o,a,c,s),this.finds[a]=o,this.sizes[o]+=this.sizes[a],this.swapNexts(a,o),this.trail.push(()=>{this.sizes[o]-=this.sizes[a],this.finds[a]=a,this.swapNexts(a,o),this.handler.unmergeEh?.(o,a)}),this.handler.afterMergeEh?.(o,a,c,s)}swapNexts(e,t){let n=this.nexts[e];this.nexts[e]=this.nexts[t],this.nexts[t]=n}};const tx=(e,t)=>e*2+ +!!t,nx=e=>e>>1,rx=e=>(e&1)==1,ix=e=>e^1;var ax=class{trail=new $b;eqTrail=[];eqTrailScopes=[];eqs=[];isMarked=[];unionFind=new ex(this.trail);setMergeHandler(e){this.unionFind.handler=e}push(){this.eqTrailScopes.push(this.eqTrail.length),this.trail.pushScope()}pop(e){let t=this.eqTrailScopes[this.eqTrailScopes.length-e];for(let e=this.eqTrail.length;e-->t;){let t=this.eqTrail[e];this.eqs[t[0]].pop(),this.eqs[t[1]].pop(),this.eqs[ix(t[0])].pop(),this.eqs[ix(t[1])].pop()}N(this.eqTrail,t),N(this.eqTrailScopes,this.eqTrailScopes.length-e),this.trail.popScope(e)}merge(e,t,n){if(e===t||nx(this.find(e))===nx(this.find(t)))return;let r=Math.max(e,t)+2;for(;this.eqs.length<r;)this.eqs.push([]);for(;this.unionFind.numVars<=r;)this.unionFind.mkVar();this.eqTrail.push([e,t]),this.unionFind.merge(e,t),this.unionFind.merge(ix(e),ix(t)),this.eqs[e].push({signedVar:t,justification:n}),this.eqs[t].push({signedVar:e,justification:n}),this.eqs[ix(e)].push({signedVar:ix(t),justification:n}),this.eqs[ix(t)].push({signedVar:ix(e),justification:n})}mergePlus(e,t,n){this.merge(tx(e,!1),tx(t,!1),n)}mergeMinus(e,t,n){this.merge(tx(e,!1),tx(t,!0),n)}find(e){return e>=this.unionFind.numVars?e:this.unionFind.find(e)}findVar(e){return this.find(tx(e,!1))}isRoot(e){return nx(this.findVar(e))===e}explain(e,t,n){if(e===t)return;let r=[{signedVar:e,index:0}],i=[[]],a=[e];this.isMarked[e]=!0;let o=0;for(;;o++){let e=r[o];if(e.signedVar===t)break;let n=this.eqs[e.signedVar];for(let e=n.length;e-->0;){let t=n[e];this.isMarked[t.signedVar]||(r.push({signedVar:t.signedVar,index:o}),i.push(t.justification),a.push(t.signedVar),this.isMarked[t.signedVar]=!0)}}for(;o!==0;){for(let e of i[o]){if(e===null)break;n.pushDependency(e)}o=r[o].index}for(let e of a)this.isMarked[e]=!1}explainVar(e,t){let n=tx(e,!1);this.explain(this.find(n),n,t)}*getClass(e){if(e>=this.unionFind.numVars){yield e;return}let t=e;do yield t,t=this.unionFind.next(t);while(t!==e)}};const ox=(e,t)=>e-t;var sx=class{variable;vars;rvars=[];rsign=!1;visited=0;isPropagated=!1;isBoundPropagated=!1;constructor(e,t){this.variable=e,this.vars=[...t].sort(ox)}get size(){return this.vars.length}containsVar(e){return this.vars.includes(e)}},cx=class{index;next=this;constructor(e){this.index=e}};const lx=e=>e.join(`,`);var ux=class{varEqs;trail=new $b;unionFind=new ex(this.trail);monics=[];var2index=[];visitedStamp=0;useLists=[];cgTable=/* @__PURE__ */ new Map;constructor(e){this.varEqs=e,e.setMergeHandler(this.varEqsHandler)}varEqsHandler={afterMergeEh:(e,t)=>{(nx(t)===nx(e)||this.varEqs.find(ix(t))===this.varEqs.find(ix(e)))&&(this.reserveUseLists(Math.max(nx(e),nx(t))+1),this.rehashCg(nx(t)),this.mergeCells(this.useLists[nx(e)],this.useLists[nx(t)]))},unmergeEh:(e,t)=>{(nx(t)===nx(e)||this.varEqs.find(ix(t))!==this.varEqs.find(ix(e)))&&(this.unmergeCells(this.useLists[nx(e)],this.useLists[nx(t)]),this.rehashCg(nx(t)))}};get numMonics(){return this.monics.length}get(e){return this.monics[this.var2index[e]]}isMonicVar(e){let t=this.var2index[e];return t!==void 0&&t!==-1}push(){this.trail.pushScope(),this.varEqs.push()}pop(e){for(let t=0;t<e;t++)this.varEqs.pop(1),this.trail.popScope(1)}add(e,t){this.varEqs.push();let n=this.monics.length,r=new sx(e,t);this.monics.push(r),this.doCanonize(r),this.trail.push(()=>this.popMonic());let i=-1;for(let e of r.rvars)e!==i&&(this.reserveUseLists(e+1),this.insertCell(this.useLists[e],n),i=e);for(;this.var2index.length<e;)this.var2index.push(-1);this.var2index[e]=n,this.insertCgMon(r),this.varEqs.push()}popMonic(){this.varEqs.pop(1);let e=this.monics[this.monics.length-1];this.removeCgMon(e),this.var2index[e.variable]=-1,this.doCanonize(e);let t=-1;for(let n of e.rvars)n!==t&&(this.removeCell(this.useLists[n]),t=n);this.varEqs.pop(1),this.monics.pop()}setPropagated(e){let t=this.get(e.variable);t.isPropagated=!0,this.trail.push(()=>{t.isPropagated=!1})}setBoundPropagated(e){let t=this.get(e.variable);t.isBoundPropagated=!0,this.trail.push(()=>{t.isBoundPropagated=!1})}reserveUseLists(e){for(;this.useLists.length<e;)this.useLists.push({head:null,tail:null})}incVisited(){this.visitedStamp++}setVisited(e){this.get(e.variable).visited=this.visitedStamp}isVisited(e){return this.get(e.variable).visited===this.visitedStamp}removeCell(e){let t=e.head,n=e.tail;if(t===null||n===null)return;let r=t.next;r===t?(e.head=null,e.tail=null):(e.head=r,n.next=r)}insertCell(e,t){let n=new cx(t);e.head!==null&&(n.next=e.head),e.head=n,e.tail??=n,e.tail.next=n}mergeCells(e,t){e!==t&&(e.head===null?(e.head=t.head,e.tail=t.tail):t.head!==null&&t.tail!==null&&e.tail!==null&&(e.tail.next=t.head,t.tail.next=e.head,e.head=t.head))}unmergeCells(e,t){e!==t&&t.head!==null&&t.tail!==null&&(e.tail===t.tail?(e.head=null,e.tail=null):e.tail!==null&&(e.head=t.tail.next,e.tail.next=e.head,t.tail.next=t.head))}getHead(e){let t=nx(this.varEqs.findVar(e));return this.reserveUseLists(t+1),this.useLists[t].head}*getUseList(e){let t=this.getHead(e);if(t===null)return;let n=t;do yield this.monics[n.index],n=n.next;while(n!==t)}findCanonical(e){let t=this.cgTable.get(lx([...e].sort(ox)));return t===void 0||t.length===0?void 0:this.get(t[0])}isCanonicalMonic(e){let t=this.var2index[e];return t>=this.unionFind.numVars||this.unionFind.find(t)===t}removeCg(e){let t=this.useLists[e].head;if(t===null)return;this.incVisited();let n=t;do{let e=this.monics[n.index];n=n.next,!this.isVisited(e)&&(this.setVisited(e),this.removeCgMon(e))}while(n!==t)}removeCgMon(e){let t=lx(e.rvars),n=this.cgTable.get(t);n!==void 0&&(n.length===1?this.cgTable.delete(t):n.splice(n.indexOf(e.variable),1))}insertCg(e){let t=this.useLists[e].head;if(t===null)return;this.incVisited();let n=t;do{let e=this.monics[n.index];n=n.next,!this.isVisited(e)&&(this.setVisited(e),this.insertCgMon(e))}while(n!==t)}insertCgMon(e){this.doCanonize(e);let t=lx(e.rvars),n=this.cgTable.get(t);if(n===void 0){this.cgTable.set(t,[e.variable]);return}if(n.includes(e.variable))return;let r=n[0];n.push(e.variable);let i=this.var2index[e.variable],a=this.var2index[r],o=Math.max(i,a);for(;this.unionFind.numVars<=o;)this.unionFind.mkVar();this.unionFind.merge(i,a)}rehashCg(e){this.removeCg(e),this.insertCg(e)}doCanonize(e){e.rsign=!1,e.rvars=[];for(let t of e.vars){let n=this.varEqs.findVar(t);e.rsign=e.rsign!==rx(n),e.rvars.push(nx(n))}e.rvars.sort(ox)}ensureCanonized(){for(let e of this.monics)this.doCanonize(e)}canonizeDivides(e,t){if(e.size>t.size)return!1;let n=0,r=0;for(;;){if(n===e.size)return!0;if(r===t.size)return!1;let i=e.rvars[n],a=t.rvars[r];if(i===a)n++,r++;else if(i<a)return!1;else r++}}*getProductsOf(e){this.incVisited();let t=e instanceof sx;for(let n of this.getUseList(t?e.vars[0]:e))(!t||e.variable!==n.variable&&this.canonizeDivides(e,n))&&(this.isVisited(n)||(this.setVisited(n),yield n))}*getSignEquivMonics(e){let t=this.var2index[e.variable],n=t;do{if(yield this.monics[n],n>=this.unionFind.numVars)return;n=this.unionFind.next(n)}while(n!==t)}};const dx=(e,t)=>({variable:e,isMon:t,isNegated:!1}),fx=e=>Kb(e.isNegated),px=e=>({factors:e.vars.map(e=>dx(e,!1)),mon:e}),mx=()=>({lower:P.zero,upper:P.zero,isLowerOpen:!0,isUpperOpen:!0,isLowerInf:!0,isUpperInf:!0,lowerDep:null,upperDep:null}),hx={kind:`minus-inf`,value:P.zero},gx={kind:`plus-inf`,value:P.zero},_x=e=>({kind:`numeral`,value:e}),vx=e=>e.isLowerInf?hx:_x(e.lower),yx=e=>e.isUpperInf?gx:_x(e.upper),bx=e=>e.kind===`numeral`&&e.value.isZero(),xx=e=>e.kind===`plus-inf`||e.kind===`numeral`&&e.value.isPositive(),Sx=e=>e.kind===`minus-inf`||e.kind===`numeral`&&e.value.isNegative(),Cx=(e,t)=>e.kind===`numeral`?t.kind===`numeral`?_x(e.value.add(t.value)):t:e,wx=(e,t)=>bx(e)||bx(t)?_x(P.zero):e.kind!==`numeral`||t.kind!==`numeral`?xx(e)===xx(t)?gx:hx:_x(e.value.mul(t.value)),Tx=(e,t)=>bx(e)?_x(P.zero):e.kind===`numeral`?t.kind===`numeral`?_x(e.value.div(t.value)):_x(P.zero):xx(e)===xx(t)?gx:hx,Ex=(e,t)=>e.kind===`numeral`?_x(e.value.pow(t)):e.kind===`minus-inf`&&t%2==0?gx:e,Dx=(e,t)=>e.kind===`numeral`?t.kind===`numeral`&&e.value.equals(t.value):e.kind===t.kind,Ox=(e,t)=>e.kind===`minus-inf`?t.kind!==`minus-inf`:e.kind===`plus-inf`?!1:t.kind===`numeral`?e.value.compare(t.value)<0:t.kind===`plus-inf`,kx=(e,t,n,r,i)=>{e.lower=t.value,e.isLowerInf=t.kind===`minus-inf`,e.isLowerOpen=n,e.upper=r.value,e.isUpperInf=r.kind===`plus-inf`,e.isUpperOpen=i},Ax=e=>Sx(vx(e)),jx=e=>xx(vx(e)),Mx=e=>bx(vx(e)),Nx=e=>Sx(yx(e)),Px=e=>xx(yx(e)),Fx=e=>bx(yx(e)),Ix=e=>Mx(e)&&!e.isLowerOpen,Lx=e=>jx(e)||Mx(e)&&e.isLowerOpen,Rx=e=>Nx(e)||Fx(e),zx=e=>Fx(e)&&!e.isUpperOpen,Bx=e=>Nx(e)||Fx(e)&&e.isUpperOpen,Vx=e=>Ax(e)&&Px(e),Hx=e=>Mx(e)&&Fx(e),Ux=(e,t)=>{e!==t&&(t.isLowerInf||(e.lower=t.lower),e.isLowerInf=t.isLowerInf,t.isUpperInf||(e.upper=t.upper),e.isUpperInf=t.isUpperInf,e.isLowerOpen=t.isLowerOpen,e.isUpperOpen=t.isUpperOpen)},Wx=(e,t,n)=>kx(n,Cx(vx(e),vx(t)),e.isLowerOpen||t.isLowerOpen,Cx(yx(e),yx(t)),e.isUpperOpen||t.isUpperOpen),Gx=(e,t,n)=>{if(e.isZero())return kx(n,hx,!0,gx,!0);let r=_x(e),i=wx(vx(t),r),a=wx(yx(t),r);if(e.isPositive())return kx(n,i,t.isLowerOpen,a,t.isUpperOpen);kx(n,a,t.isUpperOpen,i,t.isLowerOpen)},Kx=(e,t,n)=>{if(Hx(e))return Ux(n,e);if(Hx(t))return Ux(n,t);let r=vx(e),i=yx(e),a=vx(t),o=yx(t),s=e.isLowerOpen,c=e.isUpperOpen,l=t.isLowerOpen,u=t.isUpperOpen;if(Rx(e))return Rx(t)?kx(n,wx(i,o),zx(e)||zx(t)?!1:c||u,wx(r,a),s||l):Vx(t)?kx(n,wx(r,o),s||u,wx(r,a),s||l):kx(n,wx(r,o),s||u,wx(i,a),zx(e)||Ix(t)?!1:c||l);if(Vx(e)){if(Rx(t))return kx(n,wx(i,a),c||l,wx(r,a),s||l);if(Vx(t)){let e=wx(r,o),t=wx(i,a),d=wx(r,a),f=wx(i,o),p=s||u,m=c||l,h=s||l,g=c||u,_=Ox(e,t)||Dx(e,t)&&!p&&m,v=Ox(f,d)||Dx(d,f)&&!h&&g;return kx(n,_?e:t,_?p:m,v?d:f,v?h:g)}return kx(n,wx(r,o),s||u,wx(i,o),c||u)}if(Rx(t))return kx(n,wx(i,a),c||l,wx(r,o),Ix(e)||zx(t)?!1:s||u);if(Vx(t))return kx(n,wx(i,a),c||l,wx(i,o),c||u);kx(n,wx(r,a),Ix(e)||Ix(t)?!1:s||l,wx(i,o),c||u)},qx=(e,t,n)=>{if(Hx(e))return kx(n,_x(P.zero),!1,_x(P.zero),!1);let r=vx(e),i=yx(e),a=vx(t),o=yx(t),s=e.isLowerOpen,c=e.isUpperOpen,l=t.isLowerOpen,u=t.isUpperOpen,d=t.lower.isZero(),f=t.upper.isZero();if(Rx(e))return Bx(t)?kx(n,Tx(i,a),zx(e)?!1:c||l,f?gx:Tx(r,o),s||u):kx(n,d?hx:Tx(r,a),s||l,Tx(i,o),zx(e)?!1:c||u);if(Vx(e))return Bx(t)?kx(n,f?hx:Tx(i,o),c||u,f?gx:Tx(r,o),s||u):kx(n,d?hx:Tx(r,a),s||l,d?gx:Tx(i,a),c||l);if(Bx(t))return kx(n,f?hx:Tx(i,o),c||u,Tx(r,a),Ix(e)?!1:s||l);kx(n,Tx(r,o),Ix(e)?!1:s||u,d?gx:Tx(i,a),c||l)},Jx=(e,t,n)=>{if(t===1)return Ux(n,e);let r=vx(e),i=yx(e);if(t%2==1)return kx(n,e.isLowerInf?hx:Ex(r,t),e.isLowerInf||e.isLowerOpen,e.isUpperInf?gx:Ex(i,t),e.isUpperInf||e.isUpperOpen);if(jx(e))return kx(n,Ex(r,t),e.isLowerOpen,e.isUpperInf?gx:Ex(i,t),e.isUpperInf||e.isUpperOpen);if(Nx(e))return kx(n,Ex(i,t),e.isUpperOpen,e.isLowerInf?gx:Ex(r,t),e.isLowerInf||e.isLowerOpen);let a=Ex(r,t),o=Ex(i,t),s=Ox(o,a)||Dx(a,o)&&!e.isLowerOpen&&e.isUpperOpen;kx(n,_x(P.zero),!1,s?a:o,s?e.isLowerOpen:e.isUpperOpen)},Yx=()=>({lower:5,upper:10}),Xx=(e,t)=>Hx(e)?{lower:3,upper:3}:Hx(t)?{lower:12,upper:12}:Rx(e)?Rx(t)?{lower:10,upper:7}:Vx(t)?{lower:11,upper:7}:{lower:11,upper:6}:Vx(e)?Rx(t)?{lower:14,upper:13}:Vx(t)?{lower:15,upper:15}:{lower:13,upper:14}:Rx(t)?{lower:7,upper:9}:Vx(t)?{lower:7,upper:11}:{lower:5,upper:11},Zx=(e,t)=>Hx(e)?Lx(t)?{lower:5,upper:6}:{lower:10,upper:9}:Rx(e)?Bx(t)?{lower:14,upper:9}:{lower:5,upper:14}:Vx(e)?Bx(t)?{lower:10,upper:9}:{lower:5,upper:6}:Bx(t)?{lower:10,upper:13}:{lower:13,upper:6},Qx=(e,t)=>t===1?{lower:1,upper:2}:t%2==1?{lower:+!e.isLowerInf,upper:e.isUpperInf?0:2}:jx(e)?{lower:1,upper:e.isUpperInf?0:3}:Nx(e)?{lower:2,upper:e.isLowerInf?0:3}:{lower:0,upper:3},$x=(e,t,n)=>{let r=n&1?e.lowerDep:null,i=t!==null&&n&4?Q_(r,t.lowerDep):r,a=n&2?Q_(i,e.upperDep):i;return t!==null&&n&8?Q_(a,t.upperDep):a},eS=(e,t,n,r)=>{let i=r.isLowerInf?null:$x(e,t,n.lower),a=r.isUpperInf?null:$x(e,t,n.upper);r.lowerDep=i,r.upperDep=a},tS=(e,t,n)=>{Ux(e,t),n!==`without-deps`&&(e.lowerDep=t.lowerDep,e.upperDep=t.upperDep)},nS=(e,t,n,r)=>{if(t===1&&e===n)return;let i=Qx(e,t);Jx(e,t,n),r===`with-deps`&&eS(e,null,i,n)},rS=(e,t,n,r)=>{let i=t.lowerDep,a=t.upperDep;Gx(e,t,n),r!==`without-deps`&&(n.lowerDep=e.isPositive()?i:a,n.upperDep=e.isPositive()?a:i)},iS=(e,t,n,r)=>{let i=Xx(e,t);Kx(e,t,n),r===`with-deps`&&eS(e,t,i,n)},aS=(e,t,n,r)=>{let i=Zx(e,t);qx(e,t,n),r===`with-deps`&&eS(e,t,i,n)},oS=(e,t,n,r)=>{Wx(e,t,n),r===`with-deps`&&eS(e,t,Yx(),n)},sS=(e,t)=>{t.isLowerInf||(t.lower=t.lower.add(e)),t.isUpperInf||(t.upper=t.upper.add(e))},cS=(e,t,n)=>{t.isLowerInf=!1,t.lower=e.lower,t.isLowerOpen=e.isLowerOpen,n===`with-deps`&&(t.lowerDep=e.lowerDep)},lS=(e,t,n)=>{t.isUpperInf=!1,t.upper=e.upper,t.isUpperOpen=e.isUpperOpen,n===`with-deps`&&(t.upperDep=e.upperDep)},uS=(e,t,n,r)=>{if(!e.isLowerInf||!t.isLowerInf){let i=t.isLowerInf||!e.isLowerInf&&(e.lower.compare(t.lower)>0||e.lower.equals(t.lower)&&e.isLowerOpen);cS(i?e:t,n,r)}if(!e.isUpperInf||!t.isUpperInf){let i=t.isUpperInf||!e.isUpperInf&&(e.upper.compare(t.upper)<0||e.upper.equals(t.upper)&&e.isUpperOpen);lS(i?e:t,n,r)}},dS=(e,t)=>kx(e,_x(t),!1,_x(t),!1),fS=e=>{e.lowerDep=Q_(e.lowerDep,e.upperDep),e.upperDep=e.lowerDep},pS=e=>{if(e.isLowerInf||e.isUpperInf)return!1;let t=e.lower.compare(e.upper);return t>0||t===0&&(e.isLowerOpen||e.isUpperOpen)},mS=e=>!e.isLowerInf&&!e.lower.isNegative()&&!(e.lower.isZero()&&!e.isLowerOpen),hS=e=>!e.isUpperInf&&!e.upper.isPositive()&&!(e.upper.isZero()&&!e.isUpperOpen),gS=e=>hS(e)||mS(e),_S=(e,t,n)=>mS(e)?(n($_([Q_(t,e.lowerDep)])),!0):hS(e)?(n($_([Q_(t,e.upperDep)])),!0):!1,vS=e=>e.kind===`scalar`||e.kind===`var`,yS=e=>e.kind===`scalar`&&e.value.isZero(),bS=(e,t)=>e.kind===`var`?e.variable===t:e.kind===`mul`&&e.children.some(e=>bS(e.expr,t)),xS=e=>e.kind===`scalar`?0:e.kind===`var`?1:e.kind===`mul`?e.children.reduce((e,t)=>e+xS(t.expr)*t.power,0):e.children.reduce((e,t)=>Math.max(e,xS(t)),0),SS=e=>e.kind===`mul`?xS(e)<2:e.kind!==`sum`||e.children.every(SS),CS=e=>{let t=0;for(let n of e.children){let e=xS(n);if(e!==0){if(e>1)return!1;t++}}return t>1},wS=(e,t)=>{t.clear();for(let n of e.children)n.expr.kind===`var`&&t.set(n.expr.variable,n.power)},TS=e=>{if(e.kind===`scalar`)return/* @__PURE__ */ new Set;if(e.kind===`var`)return/* @__PURE__ */ new Set([e.variable]);let t=e.kind===`sum`?e.children:e.children.map(e=>e.expr);return new Set(t.flatMap(e=>[...TS(e)]))},ES=(e,t)=>({get:()=>e.children[t].expr,set:n=>{e.children[t]={expr:n,power:e.children[t].power}}}),DS=(e,t)=>({get:()=>e.children[t],set:n=>{e.children[t]=n}}),OS=(e,t)=>e.kind===`mul`&&bS(e,t)||e.kind===`var`&&e.variable===t,kS=e=>{let t=e.kind===`sum`?e.children:[e];for(let e of TS(t[0]))if(t.slice(1).every(t=>bS(t,e)))return!0;return!1};var AS=class{callOnResult;varIsFixed;limit;randomSeed;nexCreator;root={kind:`sum`,children:[]};isDone=!1;isLimitExceeded=!1;reported=0;isRandomBit=!1;constructor(e,t,n,r,i){this.callOnResult=e,this.varIsFixed=t,this.limit=n,this.randomSeed=r,this.nexCreator=i}run(e){this.root=e,this.exploreExprOnFrontElem({get:()=>this.root,set:e=>{this.root=e}},[])}done(){return this.isDone}nextRandom(){return this.randomSeed=Math.imul(this.randomSeed,214013)+2531011>>>0,this.randomSeed>>>16&32767}report(){this.isDone=this.callOnResult(this.root)||++this.reported>100}extractCommonFactor(e){let t=e.children.length,n=[...this.nexCreator.occurencesMap].filter(e=>e[1].occs===t).map(e=>({expr:this.nexCreator.mkVar(e[0]),power:e[1].power}));return n.length===0?null:this.nexCreator.mkMulWithPowers(P.one,n)}proceedWithCommonFactor(e,t,n){let r=this.extractCommonFactor(t);if(r===null)return!1;let i=this.nexCreator.simplify(this.nexCreator.mkDiv(t,r)),a=this.nexCreator.mkMul(r,i);return e.set(a),this.exploreExprOnFrontElem(ES(a,1),n),!0}exploreExprOnFrontElemVars(e,t,n){let r=e.get(),i=t.map(e=>e.get());for(let a of n){if(this.isDone||this.isLimitExceeded)return;if(!this.varIsFixed(a)){if(this.exploreOfExprOnSumAndVar(e,a,[...t]),this.isDone||this.isLimitExceeded)return;e.set(r),t.forEach((e,t)=>e.set(i[t]))}}}calcOccurences(e){let t=this.nexCreator.occurencesMap;t.clear(),this.nexCreator.powers.clear();for(let n of e.children)if(n.kind===`mul`){wS(n,this.nexCreator.powers);for(let e of this.nexCreator.powers){let n=t.get(e[0]);n===void 0?t.set(e[0],{occs:1,power:e[1]}):(n.occs++,n.power=Math.min(n.power,e[1]))}}else if(n.kind===`var`){let e=t.get(n.variable);e===void 0?t.set(n.variable,{occs:1,power:1}):(e.occs++,e.power=1)}for(let e of t)e[1].occs<=1&&t.delete(e[0])}getVarsFromOccurencesMap(){let e=this.nexCreator.occurencesMap;return this.isRandomBit=this.nextRandom()%2==1,[...e.keys()].sort((t,n)=>{let r=e.get(t),i=e.get(n);return r===void 0||i===void 0?0:r.occs===i.occs?r.power===i.power?this.isRandomBit?t-n:n-t:i.power-r.power:i.occs-r.occs})}exploreExprOnFrontElem(e,t){if(this.isDone||this.isLimitExceeded)return;if(!this.limit.inc()){this.isLimitExceeded=!0;return}let n=e.get();if(n.kind===`sum`){if(this.calcOccurences(n),this.proceedWithCommonFactor(e,n,[...t]))return;let r=this.getVarsFromOccurencesMap();if(r.length>0)return this.exploreExprOnFrontElemVars(e,t,r)}let r=t.pop();if(r===void 0)return this.report();this.exploreExprOnFrontElem(r,t)}exploreOfExprOnSumAndVar(e,t,n){if(this.isDone||this.isLimitExceeded)return;if(!this.limit.inc()){this.isLimitExceeded=!0;return}if(!this.splitWithVar(e,t,n))return;let r=n.pop();if(r===void 0)return this.report();this.exploreExprOnFrontElem(r,n)}splitWithVar(e,t,n){let r=e.get();if(r.kind!==`sum`)return!1;let i=[],a=[];for(let e of r.children)OS(e,t)?i.push(this.nexCreator.mkDivByVar(e,t)):a.push(e);let o=this.nexCreator.simplifySum(this.nexCreator.mkSum(i)),s=a.length===1?a[0]:this.nexCreator.mkSum(a);if(kS(o))return!1;let c=this.nexCreator.mkMul(this.nexCreator.mkVar(t),o),l=this.nexCreator.mkSum([c,s]);return e.set(l),SS(o)||n.push(ES(c,1)),s.kind===`sum`&&!SS(s)&&n.push(DS(l,1)),!0}},jS=class e{occurencesMap=/* @__PURE__ */ new Map;powers=/* @__PURE__ */ new Map;activeVarsWeights=[];setNumberOfVars(e){let t=this.activeVarsWeights.length;this.activeVarsWeights.length=e,this.activeVarsWeights.fill(0,t)}setVarWeight(e,t){this.activeVarsWeights[e]=t}mkVar(e){return{kind:`var`,variable:e}}mkScalar(e){return{kind:`scalar`,value:e}}mkSum(e){return{kind:`sum`,children:[...e]}}mkMul(...e){let t=[],n=P.one;for(let r of e)r instanceof P?n=n.mul(r):t.push({expr:r,power:1});return this.mkMulWithPowers(n,t)}mkMulWithPowers(e,t){return{kind:`mul`,coeff:e,children:[...t]}}mkReducedMul(e,t){return t.length===0?this.mkScalar(e):e.equals(P.one)&&t.length===1&&t[0].power===1?t[0].expr:this.mkMulWithPowers(e,t)}gtVar(e,t){let n=this.activeVarsWeights[e],r=this.activeVarsWeights[t];return n===r?e>t:n>r}gt(e,t){return e===t?!1:e.kind===`var`?this.gtOnVarNex(e,t):e.kind===`scalar`?t.kind===`scalar`&&e.value.compare(t.value)>0:e.kind===`mul`?this.gtOnMulNex(e,t):t.kind===`sum`?this.gtOnSumSum(e,t):this.gt(e.children[0],t)}gtOnVarNex(e,t){return t.kind===`scalar`?!0:t.kind===`var`?this.gtVar(e.variable,t.variable):t.kind===`mul`?xS(t)<=1&&this.gtOnVarNex(e,t.children[0].expr):this.gt(e,t.children[0])?!0:!this.gt(t.children[0],e)}gtOnMulNex(e,t){return t.kind===`scalar`?!1:t.kind===`var`?xS(e)>1||this.gt(e.children[0].expr,t):t.kind===`mul`?this.gtOnMulMul(e,t):this.gtOnMulNex(e,t.children[0])}gtOnMulMul(e,t){let n=xS(e),r=xS(t);return n===r?this.gtOnPowersMulSameDegree(e,t):n>r}gtOnPowersMulSameDegree(e,t){let n=e.children[0].power,r=t.children[0].power;for(let i=0,a=0;i<e.children.length&&a<t.children.length;){if(this.gt(e.children[i].expr,t.children[a].expr))return!0;if(this.gt(t.children[a].expr,e.children[i].expr))return!1;if(n>r)return!0;if(n<r)return!1;i++,a++,i<e.children.length&&(n=e.children[i].power),a<t.children.length&&(r=t.children[a].power)}return!1}gtOnSumSum(e,t){let n=Math.min(e.children.length,t.children.length);for(let r=0;r<n;r++){if(this.gt(e.children[r],t.children[r]))return!0;if(this.gt(t.children[r],e.children[r]))return!1}return e.children.length>n}findOrInsert(e,t,n){let r=0,i=e.length;for(;r<i;){let n=r+i>>1;this.gt(e[n].key,t)?r=n+1:i=n}return r<e.length&&!this.gt(t,e[r].key)?{index:r,isFound:!0}:(e.splice(r,0,{key:t,value:n}),{index:r,isFound:!1})}simplify(e){return e.kind===`mul`?this.simplifyMul(e):e.kind===`sum`?this.simplifySum(e):e}eatScalarPow(e,t,n){return t.expr.kind===`mul`&&t.expr.children.length===0?t.expr.coeff.equals(P.one)?e:e.mul(t.expr.coeff.pow(t.power*n)):t.expr.kind===`scalar`?t.expr.value.equals(P.one)?e:e.mul(t.expr.value.pow(t.power*n)):null}simplifyMul(e){let t=[],n=[];for(let r of e.children){let i=this.eatScalarPow(e.coeff,r,1);if(i!==null){e.coeff=i;continue}let a={expr:this.simplify(r.expr),power:r.power};a.expr.kind===`mul`?n.push(a):t.push(a)}for(let r of n)if(r.expr.kind===`mul`){for(let n of r.expr.children){let i=this.eatScalarPow(e.coeff,n,r.power);i===null?t.push({expr:n.expr,power:n.power*r.power}):e.coeff=i}e.coeff=e.coeff.mul(r.expr.coeff.pow(r.power))}return e.children=this.mulToPowers(t),e.children.length===1&&e.children[0].power===1&&e.coeff.equals(P.one)?e.children[0].expr:e.children.length===0||e.coeff.isZero()?this.mkScalar(e.coeff):e}mulToPowers(e){let t=[];for(let n of e){let e=this.findOrInsert(t,n.expr,n.power);e.isFound&&(t[e.index].value+=n.power)}return t.map(e=>({expr:e.key,power:e.value}))}simplifySum(e){return this.simplifyChildrenOfSum(e),e.children.length===1?e.children[0]:e.children.length===0?this.mkScalar(P.zero):e}simplifyChildrenOfSum(e){let t=[],n=[];for(let r of e.children){let e=this.simplify(r);if(e.kind===`sum`)n.push(e);else if(yS(e))continue;else if(e.kind===`mul`&&e.coeff.isZero())continue;else t.push(e)}for(let e of n)for(let n of e.children)yS(n)||t.push(n);e.children=t,this.sortJoinSum(e)}sortJoinSum(e){let t=[],n=P.zero;for(let r of e.children){if(r.kind===`scalar`){n=n.add(r.value);continue}let e=r.kind===`mul`?r.coeff:P.one,i=this.findOrInsert(t,r,e);i.isFound&&(t[i.index].value=t[i.index].value.add(e))}e.children=[];for(let n of t)n.value.isZero()||(n.key.kind===`mul`?(n.key.coeff=n.value,e.children.push(this.simplify(n.key))):n.value.equals(P.one)?e.children.push(n.key):e.children.push(this.mkMul(n.value,n.key)));n.isZero()||e.children.push(this.mkScalar(n))}clone(e){return e.kind===`var`?this.mkVar(e.variable):e.kind===`scalar`?this.mkScalar(e.value):e.kind===`mul`?this.mkMulWithPowers(e.coeff,e.children.map(e=>({expr:this.clone(e.expr),power:e.power}))):this.mkSum(e.children.map(e=>this.clone(e)))}mkDivByVar(e,t){if(e.kind!==`mul`)return this.mkScalar(P.one);let n=[],r=!1;for(let i of e.children)r||!bS(i.expr,t)?n.push({expr:this.clone(i.expr),power:i.power}):(i.expr.kind!==`var`&&n.push({expr:this.mkDivByVar(i.expr,t),power:1}),i.power!==1&&n.push({expr:this.clone(i.expr),power:i.power-1}),r=!0);return this.mkReducedMul(e.coeff,n)}mkDiv(e,t){if(e.kind===`sum`)return this.mkSum(e.children.map(e=>this.mkDiv(e,t)));if(e.kind!==`mul`)return this.mkScalar(P.one);wS(t,this.powers);let n=[];for(let t of e.children){if(t.expr.kind!==`var`){n.push({expr:this.clone(t.expr),power:t.power});continue}let e=t.expr.variable,r=this.powers.get(e);r===void 0?n.push({expr:this.clone(t.expr),power:t.power}):t.power>r?(n.push({expr:this.mkVar(e),power:t.power-r}),this.powers.delete(e)):t.power===r?this.powers.delete(e):this.powers.set(e,r-t.power)}return this.mkReducedMul(e.coeff.div(t.coeff),n)}canonize(e){if(vS(e))return this.clone(e);let t=this.simplify(this.clone(e));return t.kind===`sum`?(t.children=t.children.map(e=>this.canonize(e)),this.simplify(t)):t.kind===`mul`?this.canonizeMul(t):t}canonizeMul(e){let t=e.children.findIndex(e=>e.expr.kind===`sum`);if(t===-1)return e;let n=e.children[t];if(n.expr.kind!==`sum`)return e;let r=n.power>1?this.clone(n.expr):null,i=n.expr.children.map(i=>{let a=[];return r!==null&&a.push({expr:r,power:n.power-1}),a.push({expr:i,power:1}),e.children.forEach((e,n)=>{n!==t&&a.push({expr:this.clone(e.expr),power:e.power})}),this.mkMulWithPowers(e.coeff,a)});return this.canonize(this.mkSum(i))}static equal(t,n){let r=new e,i=Math.max(0,...[...TS(t),...TS(n)].map(e=>e+1));r.setNumberOfVars(i);for(let e=0;e<i;e++)r.setVarWeight(e,e);let a=r.canonize(t),o=r.canonize(n);return!(r.gt(a,o)||r.gt(o,a))}},MS=class{levels=[];los=[];his=[];values=[];nodeTable=/* @__PURE__ */ new Map;valueTable=/* @__PURE__ */ new Map;opCache=/* @__PURE__ */ new Map;factorCache=/* @__PURE__ */ new Map;degrees=[];numAllocated=0;maxNumNodes=1<<24;isApplying=!1;var2pdd=[];var2level=[];level2var=[];constructor(e){this.initNodes(Array.from({length:e},(e,t)=>t))}reset(e){this.levels=[],this.los=[],this.his=[],this.values=[],this.nodeTable.clear(),this.valueTable.clear(),this.opCache.clear(),this.factorCache.clear(),this.degrees=[],this.initNodes(e)}initNodes(e){for(let e=0;e<10;e++)this.levels.push(0),this.los.push(0),this.his.push(0);this.los[1]=1,this.values.push(P.zero,P.one),this.numAllocated=1034+e.length,this.var2pdd=[],this.var2level=[],this.level2var=[];for(let t=0;t<e.length;t++){let n=e[t];this.var2pdd[n]=this.makeNode(t,0,1),this.var2level[n]=t,this.level2var[t]=n}}setMaxNumNodes(e){this.maxNumNodes=e+this.level2var.length}numNodes(){return this.levels.length}numVars(){return this.var2pdd.length}isVal(e){return this.his[e]===0}level(e){return this.levels[e]}var(e){return this.level2var[this.levels[e]]}lo(e){return this.los[e]}hi(e){return this.his[e]}val(e){return this.values[this.los[e]]}offset(e){let t=e;for(;!this.isVal(t);)t=this.lo(t);return this.val(t)}mkVar(e){for(;this.var2level.length<=e;){let e=this.var2level.length;this.var2pdd.push(this.makeNode(e,0,1)),this.var2level.push(e),this.level2var.push(e)}return new NS(this,this.var2pdd[e])}mkVal(e){return new NS(this,this.imkVal(e))}zero(){return new NS(this,0)}one(){return new NS(this,1)}add(e,t){return new NS(this,this.apply(e.root,t.root,2))}sub(e,t){return new NS(this,this.apply(e.root,t.root,3))}mul(e,t){return new NS(this,this.apply(e.root,t.root,5))}reduce(e,t){return new NS(this,this.apply(e.root,t.root,6))}minus(e){return new NS(this,this.whileApplying(()=>this.minusRec(e.root)))}pow(e,t){if(t===0)return this.one();if(t===1||e.isZero()||e.isOne())return e;if(e.isVal())return this.mkVal(e.val().pow(t));let n=this.pow(this.mul(e,e),Math.floor(t/2));return t%2==1?this.mul(n,e):n}apply(e,t,n){return this.whileApplying(()=>this.applyRec(e,t,n))}whileApplying(e){this.isApplying=!0;try{return e()}finally{this.isApplying=!1}}applyRec(e,t,n){switch(n){case 3:if(t===0)return e;if(this.isVal(e)&&this.isVal(t))return this.imkVal(this.val(e).sub(this.val(t)));break;case 2:if(e===0)return t;if(t===0)return e;if(this.isVal(e)&&this.isVal(t))return this.imkVal(this.val(e).add(this.val(t)));if(this.isVal(e)||!this.isVal(t)&&this.level(e)<this.level(t))return this.applyRec(t,e,n);break;case 5:if(e===0||t===0)return 0;if(e===1)return t;if(t===1)return e;if(this.isVal(e)&&this.isVal(t))return this.imkVal(this.val(e).mul(this.val(t)));if(this.isVal(e)||!this.isVal(t)&&this.level(e)<this.level(t))return this.applyRec(t,e,n);break;case 6:if(t===0||this.isVal(e)||this.degree(e)<this.degree(t)||this.level(this.firstLeading(t))>this.level(e))return e}let r=`${n},${e},${t}`,i=this.opCache.get(r);if(i!==void 0)return i;let a=this.computeApply(e,t,n);return this.opCache.set(r,a),a}computeApply(e,t,n){let r=this.level(e),i=this.level(t),a=this.lo(e),o=this.hi(e);switch(n){case 2:{if(this.isVal(t)||r!==i)return this.makeNode(r,this.applyRec(a,t,n),o);let e=this.applyRec(a,this.lo(t),n);return this.makeNode(r,e,this.applyRec(o,this.hi(t),n))}case 3:{if(this.isVal(e)||!this.isVal(t)&&r<i){let r=this.applyRec(e,this.lo(t),n);return this.makeNode(i,r,this.minusRec(this.hi(t)))}if(this.isVal(t)||r>i)return this.makeNode(r,this.applyRec(a,t,n),o);let s=this.applyRec(a,this.lo(t),n);return this.makeNode(r,s,this.applyRec(o,this.hi(t),n))}case 5:{if(this.isVal(t)||r!==i){let e=this.applyRec(a,t,n);return this.makeNode(r,e,this.applyRec(o,t,n))}let e=this.applyRec(o,this.hi(t),n),s=this.applyRec(o,this.lo(t),n),c=this.applyRec(a,this.hi(t),n),l=this.applyRec(a,this.lo(t),n),u=this.applyRec(s,c,2);if(!this.isVal(u)&&this.level(u)===r){let t=this.applyRec(e,this.hi(u),2);return this.makeNode(r,l,this.makeNode(r,this.lo(u),t))}return this.makeNode(r,l,this.makeNode(r,u,e))}default:{if(this.level(this.firstLeading(t))>=r)return this.reduceOnMatch(e,t);let i=this.applyRec(a,t,n),s=this.applyRec(o,t,n);if(i===a&&s===o)return e;if(this.level(i)<r&&this.level(s)<=r)return this.makeNode(r,i,s);let c=this.applyRec(s,this.var2pdd[this.var(e)],5);return this.applyRec(c,i,2)}}}minusRec(e){if(e===0)return 0;if(this.isVal(e))return this.imkVal(this.val(e).neg());let t=`4,${e},${e}`,n=this.opCache.get(t);if(n!==void 0)return n;let r=this.minusRec(this.lo(e)),i=this.makeNode(this.level(e),r,this.minusRec(this.hi(e)));return this.opCache.set(t,i),i}reduceOnMatch(e,t){let n=e;for(;this.lmOccurs(t,n);){let e=this.applyRec(this.ltQuotient(t,n),t,5);n=this.applyRec(n,e,2)}return n}lmOccurs(e,t){let n=this.firstLeading(e),r=t;for(;;){if(this.isVal(n))return!0;if(this.isVal(r)||this.level(n)>this.level(r))return!1;if(this.level(n)===this.level(r))n=this.nextLeading(n),r=this.hi(r);else if(this.lmOccurs(n,this.hi(r)))return!0;else r=this.lo(r)}}ltQuotient(e,t){let n=this.firstLeading(e),r=t;for(;!this.isVal(n);)if(this.level(n)===this.level(r))n=this.nextLeading(n),r=this.lmOccurs(n,this.hi(r))?this.hi(r):this.lo(r);else if(this.lmOccurs(n,this.hi(r)))return this.ltQuotientHi(n,r);else r=this.lo(r);return this.isVal(r)?this.imkVal(this.val(r).neg().div(this.val(n))):this.ltQuotientHi(n,r)}ltQuotientHi(e,t){let n=this.ltQuotient(e,this.hi(t));return this.applyRec(this.var2pdd[this.var(t)],n,5)}trySpoly(e,t){let n=this.commonFactors(e,t);if(n===null)return null;let r=this.mkVal(n.secondCoeff);for(let e=n.second.length;e-->0;)r=r.mul(this.mkVar(n.second[e]));let i=this.mkVal(n.firstCoeff.neg());for(let e=n.first.length;e-->0;)i=i.mul(this.mkVar(n.first[e]));return r.mul(e).add(i.mul(t))}commonFactors(e,t){let n=[],r=[],i=this.firstLeading(e.root),a=this.firstLeading(t.root),o=!1;for(;;){if(this.isVal(i)||this.isVal(a)){if(!o)return null;for(;!this.isVal(a);)r.push(this.var(a)),a=this.nextLeading(a);for(;!this.isVal(i);)n.push(this.var(i)),i=this.nextLeading(i);let e=this.val(i),t=this.val(a);if(!e.isInt()||!t.isInt())return{first:n,second:r,firstCoeff:e,secondCoeff:t};let s=P.of(jm(e.num,t.num));return{first:n,second:r,firstCoeff:e.div(s),secondCoeff:t.div(s)}}this.level(i)===this.level(a)?(o=!0,i=this.nextLeading(i),a=this.nextLeading(a)):this.level(i)>this.level(a)?(n.push(this.var(i)),i=this.nextLeading(i)):(r.push(this.var(a)),a=this.nextLeading(a))}}lmLt(e,t){let n=this.firstLeading(e.root),r=this.firstLeading(t.root);for(;n!==r&&!(this.isVal(n)&&this.isVal(r));){if(this.isVal(n))return!0;if(this.isVal(r))return!1;if(this.level(n)!==this.level(r))return this.level(n)<this.level(r);n=this.nextLeading(n),r=this.nextLeading(r)}let i=(e,t)=>{if(e.length!==t.length)return e.length>t.length;let n=0;for(;n<e.length&&e[n]===t[n];)n++;return n<e.length&&this.var2level[e[n]]>this.var2level[t[n]]},a=(e,t)=>i(e,t)?-1:+!!i(t,e),o=[...e].map(e=>e.vars).sort(a),s=[...t].map(e=>e.vars).sort(a),c=Math.min(o.length,s.length);for(let e=0;e<c;e++){if(i(s[e],o[e]))return!0;if(i(o[e],s[e]))return!1}return o.length===c&&s.length>c}differentLeadingTerm(e,t){let n=this.firstLeading(e.root),r=this.firstLeading(t.root);for(;;){if(n===r)return!1;if(this.isVal(n)||this.isVal(r)||this.level(n)!==this.level(r))return!0;n=this.nextLeading(n),r=this.nextLeading(r)}}firstLeading(e){let t=e;for(;!this.isVal(t)&&this.degree(this.hi(t))+1<this.degree(this.lo(t));)t=this.lo(t);return t}nextLeading(e){return this.firstLeading(this.hi(e))}degree(e){if(e===0||e===1)return 0;let t=this.degrees[e];if(t!==void 0)return t;let n=this.isVal(e)?0:Math.max(this.degree(this.lo(e)),this.degree(this.hi(e))+1);return this.degrees[e]=n,n}factor(e,t,n){let r=this.var2level[t];if(n===0||this.level(e.root)<r)return{lc:this.zero(),rest:e};let i=`${e.root},${t},${n}`,a=this.factorCache.get(i);if(a!==void 0)return a;let o=this.computeFactor(e,t,n);return this.factorCache.set(i,o),o}computeFactor(e,t,n){let r=this.var2level[t];if(this.level(e.root)>r){let r=this.mkVar(e.var()),i=this.factor(e.hi(),t,n),a=this.factor(e.lo(),t,n),o=i.lc.mul(r),s=i.rest.mul(r);return{lc:o.add(a.lc),rest:s.add(a.rest)}}let i=0,a=e;for(;i<n&&!a.isVal()&&this.level(a.root)===r;)i++,a=a.hi();if(i<n)return{lc:this.zero(),rest:e};let o=this.zero(),s=this.one(),c=e;for(let e=0;e<n;e++)o=o.add(s.mul(c.lo())),c=c.hi(),s=s.mul(this.mkVar(t));return{lc:a,rest:o}}isBinary(e){let t=this.lo(e);return this.isVal(e)||this.isVal(this.hi(e))&&(this.isVal(t)||this.isVal(this.hi(t))&&this.isVal(this.lo(t)))}getPowers(e){let t=[],n=/* @__PURE__ */ new Set,r=[e.root];for(let e=r.pop();e!==void 0;e=r.pop()){if(this.isVal(e)||n.has(e))continue;n.add(e);let i=this.var(e),a=e,o=1;for(;!this.isVal(a)&&this.var(this.hi(a))===i;)o++,r.push(this.lo(a)),a=this.hi(a);o>1&&t.push({var:i,degree:o}),this.isVal(a)||r.push(this.hi(a),this.lo(a))}return t}varIsLeaf(e,t){let n=/* @__PURE__ */ new Set,r=[e.root];for(let e=r.pop();e!==void 0;e=r.pop())if(!(this.isVal(e)||n.has(e))){if(n.add(e),this.var(e)===t){if(!this.isVal(this.lo(e))||!this.isVal(this.hi(e)))return!1}else n.has(this.lo(e))||r.push(this.lo(e)),n.has(this.hi(e))||r.push(this.hi(e))}return!0}treeSize(e){let t=/* @__PURE__ */ new Map,n=e=>{let r=t.get(e);if(r!==void 0)return r;let i=this.isVal(e)?1:1+n(this.lo(e))+n(this.hi(e));return t.set(e,i),i};return n(e.root)}freeVars(e){let t=[],n=/* @__PURE__ */ new Set,r=[e.root];for(let e=r.pop();e!==void 0;e=r.pop()){if(this.isVal(e)||n.has(e))continue;let i=this.var2pdd[this.var(e)];n.has(i)||t.push(this.var(e)),n.add(e),n.add(i),n.has(this.lo(e))||r.push(this.lo(e)),n.has(this.hi(e))||r.push(this.hi(e))}return t}imkVal(e){if(e.isZero())return 0;if(e.equals(P.one))return 1;let t=e.toString(),n=this.valueTable.get(t);if(n!==void 0)return n;let r=this.insertNode(0,this.values.length,0);return this.values.push(e),this.valueTable.set(t,r),r}makeNode(e,t,n){return n===0?t:this.insertNode(e,t,n)}insertNode(e,t,r){let i=`${e},${t},${r}`,a=this.nodeTable.get(i);if(a!==void 0)return a;if(this.levels.length===this.numAllocated){if(this.numAllocated>this.maxNumNodes&&!this.isApplying)throw new n;for(;this.numAllocated>this.maxNumNodes;)this.maxNumNodes*=2;this.numAllocated+=Math.floor(this.numAllocated/2)}let o=this.levels.length;return this.levels.push(e),this.los.push(t),this.his.push(r),this.nodeTable.set(i,o),o}},NS=class e{manager;root;constructor(e,t){this.manager=e,this.root=t}lo(){return new e(this.manager,this.manager.lo(this.root))}hi(){return new e(this.manager,this.manager.hi(this.root))}var(){return this.manager.var(this.root)}val(){return this.manager.val(this.root)}offset(){return this.manager.offset(this.root)}isVal(){return this.manager.isVal(this.root)}isZero(){return this.root===0}isOne(){return this.root===1}isLinear(){return this.manager.degree(this.root)===1}isVar(){return!this.isVal()&&this.lo().isZero()&&this.hi().isOne()}isUnary(){return!this.isVal()&&this.lo().isZero()&&this.hi().isVal()}isOffset(){return!this.isVal()&&this.lo().isVal()&&this.hi().isOne()}isBinary(){return this.manager.isBinary(this.root)}equals(e){return this.root===e.root}neg(){return this.manager.minus(this)}add(e){return e instanceof P?this.manager.add(this.manager.mkVal(e),this):this.manager.add(this,e)}sub(e){return e instanceof P?this.add(e.neg()):this.manager.sub(this,e)}mul(e){return e instanceof P?this.manager.mul(this.manager.mkVal(e),this):this.manager.mul(this,e)}div(e){return this.mul(P.one.div(e))}pow(e){return this.manager.pow(this,e)}reduce(e){return this.manager.reduce(this,e)}factor(e,t){return this.manager.factor(this,e,t)}differentLeadingTerm(e){return this.manager.differentLeadingTerm(this,e)}degree(){return this.manager.degree(this.root)}treeSize(){return this.manager.treeSize(this)}freeVars(){return this.manager.freeVars(this)}varIsLeaf(e){return this.manager.varIsLeaf(this,e)}getPowers(){return this.manager.getPowers(this)}varFactors(){if(this.isVal())return{vars:[],poly:this};let e=this.manager,t=this.var();if(this.lo().isVal()){if(!this.lo().isZero())return{vars:[],poly:this};let e=this.hi().varFactors();return e.vars.push(t),e}let n=this.lo().varFactors(),r=n.vars;if(r.length===0)return{vars:[],poly:this};let i=[],a=t=>{let n=0,a=0,o=0,s=0;for(;o<r.length||s<t.length;)o===r.length?t[a++]=t[s++]:s===t.length?r[n++]=r[o++]:r[o]===t[s]?(i.push(r[o]),o++,s++):e.var2level[r[o]]>e.var2level[t[s]]?t[a++]=t[s++]:r[n++]=r[o++];N(r,n),N(t,a)},o=(t,n)=>t.reduce((t,n)=>t.mul(e.mkVar(n)),n),s=this.hi().varFactors(),c=s.vars;return r[r.length-1]===t?(r.pop(),a(c),i.push(t),{vars:i,poly:o(r,n.poly).add(o(c,s.poly))}):c.length===0||(a(c),c.push(t),i.length===0)?{vars:[],poly:this}:{vars:i,poly:o(r,n.poly).add(o(c,s.poly))}}substPdd(e,t){let n=this.manager;if(this.isVal()||n.var2level[this.var()]<n.var2level[e])return this;let r=this.lo().substPdd(e,t),i=this.hi().substPdd(e,t);return this.var()===e?t.mul(i).add(r):r.equals(this.lo())&&i.equals(this.hi())?this:n.mkVar(this.var()).mul(i).add(r)}*[Symbol.iterator](){let e=this.manager,t=[],n=[],r=this.root;for(;!e.isVal(r);)t.push({isFirst:!0,node:r}),n.push(e.var(r)),r=e.hi(r);if(t.length===0)e.val(r).isZero()||(yield{coeff:e.val(r),vars:[]});else for(yield{coeff:e.val(r),vars:[...n]};t.length>0;){let r=t[t.length-1];if(!r.isFirst){t.pop();continue}r.isFirst=!1,n.pop();let i=e.lo(r.node);if(i===0)t.pop();else{for(;!e.isVal(i);)t.push({isFirst:!0,node:i}),n.push(e.var(i)),i=e.hi(i);yield{coeff:e.val(i),vars:[...n]}}}}*coefficients(){let e=this.manager,t=[],n=this.root;for(;!e.isVal(n);)t.push(n),n=e.hi(n);yield{coeff:e.val(n),isConstant:t.length===0};for(let n=t.pop();n!==void 0;n=t.pop()){let r=e.lo(n);if(r!==0){for(;!e.isVal(r);)t.push(r),r=e.hi(r);yield{coeff:e.val(r),isConstant:t.length===0}}}}toString(){let e=``;for(let t of this){e!==``&&(e+=` `),t.coeff.isNegative()?e+=`- `:e!==``&&(e+=`+ `);let n=t.coeff.abs(),r=t.vars;n.equals(P.one)&&r.length!==0||(e+=r.length===0?`${n}`:`${n}*`);let i=[];for(let e=0;e<r.length;){let t=e;for(;t<r.length&&r[t]===r[e];)t++;i.push(t-e>1?`v${r[e]}^${t-e}`:`v${r[e]}`),e=t}e+=i.join(`*`)}return e===``?`0`:e}};const PS=(e,t)=>e.isVal()?e.val():PS(e.hi(),t).mul(t(e.var())).add(PS(e.lo(),t)),FS=(e,t,n)=>{let r=mx();if(e.isVal())return dS(r,e.val()),r;let i=n(e.var(),t),a=FS(e.hi(),t,n),o=FS(e.lo(),t,n),s=mx();return iS(a,i,s,t),oS(s,o,r,t),r},IS=4294967295,LS=()=>({eqsThreshold:IS,exprSizeLimit:IS,exprDegreeLimit:IS,maxSteps:IS,maxSimplified:IS,eqsGrowth:10,exprSizeGrowth:10,exprDegreeGrowth:5,numberOfConflictsToReport:1});var RS=class{simplified=0;maxExprSize=0;maxExprDegree=0;superposed=0;computeSteps=0},zS=class{poly;dep;state=2;idx=0;constructor(e,t){this.poly=e,this.dep=t}},BS=class{set;i=0;j=0;size;constructor(e){this.set=e,this.size=e.length}get(){return this.set[this.i]}nextj(){this.set[this.j]=this.set[this.i],this.set[this.i].idx=this.j++}finish(){for(;this.i<this.size;this.i++)this.nextj();N(this.set,this.j)}},VS=class{manager;isCanceled;stats=new RS;config=LS();solved=[];processed=[];toSimplify=[];substs=[];conflict=null;isTooComplexFound=!1;levelp1=0;level2var=[];var2level=[];constructor(e,t){this.manager=e,this.isCanceled=t}adjustConfig(){let e=this.config,t=this.toSimplify.length;e.eqsThreshold=Math.trunc(e.eqsGrowth*Math.ceil(Math.log(1+t))*t),e.exprSizeLimit=0,e.exprDegreeLimit=0;for(let t of this.toSimplify)e.exprSizeLimit=Math.max(e.exprSizeLimit,t.poly.treeSize()),e.exprDegreeLimit=Math.max(e.exprDegreeLimit,t.poly.degree());e.exprSizeLimit*=e.exprSizeGrowth,e.exprDegreeLimit*=e.exprDegreeGrowth}reset(){this.substs=[],this.solved=[],this.processed=[],this.toSimplify=[],this.stats=new RS,this.level2var=[],this.var2level=[],this.conflict=null}add(e,t=null){if(e.isZero())return;let n=new zS(e,t);this.checkConflict(n)||(this.pushEquation(2,n),this.var2level.length>0&&(this.levelp1=Math.max(this.var2level[e.var()]+1,this.levelp1)),this.updateStats(n))}simplify(e,t){let n=e,r=t;for(let e of this.substs){let t=n.substPdd(e.variable,e.poly);t.equals(n)||(n=t,r=Q_(r,e.dep))}return{poly:n,dep:r}}addSubst(e,t,n){this.substs.push({variable:e,poly:t,dep:n}),this.var2level.length>0&&(this.levelp1=Math.max(this.var2level[e]+1,Math.max(this.var2level[t.var()]+1,this.levelp1)));let r=r=>{let i=r.poly.substPdd(e,t);if(i.equals(r.poly))return null;if(this.isTooComplex(i))return this.isTooComplexFound=!0,null;let a=i.differentLeadingTerm(r.poly);return r.poly=i,r.dep=Q_(r.dep,n),this.updateStats(r),a};this.isDone()||this.simplifySetUsing(this.processed,r),this.isDone()||this.simplifySetUsing(this.toSimplify,r),this.isDone()||this.simplifySetUsing(this.solved,r)}saturate(){if(!this.isDone()){this.initSaturate();try{for(;!this.isDone()&&this.step(););}catch(e){if(!(e instanceof n))throw e}}}equations(){return[...this.solved,...this.toSimplify,...this.processed]}step(){this.stats.computeSteps++;let e=this.pickNext();if(e===null)return!1;let t=e;try{if(this.simplifyUsingAll(e,this.processed),this.isTrivial(e))return t=null,!0;if(this.checkConflict(e))return t=null,!1;if(this.isTooComplexFound=!1,this.simplifySetUsingEquation(this.processed,e),this.isDone())return!1;for(let t of this.processed)this.superpose(e,t);return this.simplifySetUsingEquation(this.toSimplify,e),!this.isDone()&&(this.isTooComplexFound||(t=null,this.pushEquation(e.poly.degree()===1?0:1,e)),!0)}finally{t!==null&&this.pushEquation(1,t)}}initSaturate(){let e=this.manager.level2var;this.level2var=[...e],this.var2level=[];for(let t=0;t<e.length;t++)this.var2level[e[t]]=t;this.levelp1=e.length}pickNext(){for(;this.levelp1>0;){let e=this.level2var[this.levelp1-1],t=null;for(let n of this.toSimplify)n.state===2&&n.poly.var()===e&&(t===null||this.isSimpler(n,t))&&(t=n);if(t!==null)return this.popEquation(t),t;this.levelp1--}return null}superpose(e,t){let n=this.manager.trySpoly(e.poly,t.poly);n===null||n.isZero()||(this.isTooComplex(n)?this.isTooComplexFound=!0:(this.stats.superposed++,this.add(n,Q_(e.dep,t.dep))))}simplifyUsingAll(e,t){let n=!1;do{n=!1;for(let r of t)if(this.trySimplifyUsing(e,r)!==null&&(n=!0),this.isCanceled()||e.poly.isVal())break}while(n&&!e.poly.isVal());e.poly.isUnary()&&e.poly.hi().val().isNegative()&&(e.poly=e.poly.neg())}simplifySetUsingEquation(e,t){this.simplifySetUsing(e,e=>this.trySimplifyUsing(e,t))}simplifySetUsing(e,t){let n=new BS(e);for(;n.i<n.size;n.i++){let r=e[n.i],i=this.isDone()?null:t(r);i!==null&&this.isTrivial(r)||i!==null&&this.checkConflict(r)||(i===!0?(e===this.toSimplify?n.nextj():this.pushEquation(2,r),this.var2level.length>0&&(this.levelp1=Math.max(this.var2level[r.poly.var()]+1,this.levelp1))):n.nextj())}n.finish()}trySimplifyUsing(e,t){if(t===e)return null;this.stats.simplified++;let n=e.poly.reduce(t.poly);if(n.equals(e.poly))return null;if(this.isTooComplex(n))return this.isTooComplexFound=!0,null;let r=e.state===1&&n.differentLeadingTerm(e.poly);return e.poly=n,e.dep=Q_(e.dep,t.dep),this.updateStats(e),r}simplifyUsing(e,t){if(t===e)return!1;this.stats.simplified++;let n=e.poly.reduce(t.poly),r=e.state===1&&n.differentLeadingTerm(e.poly);return n.equals(e.poly)||(e.poly=n,e.dep=Q_(e.dep,t.dep),this.updateStats(e)),r}isDone(){return this.toSimplify.length+this.processed.length>=this.config.eqsThreshold||this.stats.simplified>=this.config.maxSimplified||this.isCanceled()||this.stats.computeSteps>this.config.maxSteps||this.conflict!==null}isTrivial(e){return e.poly.isZero()}isConflict(e){return e.poly.isVal()&&!this.isTrivial(e)}checkConflict(e){return this.isConflict(e)?(this.setConflict(e),!0):!1}setConflict(e){this.conflict=e,this.pushEquation(0,e)}isSimpler(e,t){return this.manager.lmLt(e.poly,t.poly)}isTooComplex(e){return e.treeSize()>this.config.exprSizeLimit||e.degree()>this.config.exprDegreeLimit}getQueue(e){return e===1?this.processed:e===2?this.toSimplify:this.solved}popEquation(e){let t=this.getQueue(e.state),n=t[t.length-1];e.idx!==t.length-1&&(n.idx=e.idx,t[e.idx]=n),t.pop()}pushEquation(e,t){t.state=e;let n=this.getQueue(e);t.idx=n.length,n.push(t)}updateStats(e){this.stats.maxExprSize=Math.max(this.stats.maxExprSize,e.poly.treeSize()),this.stats.maxExprDegree=Math.max(this.stats.maxExprDegree,e.poly.degree())}};const HS=1e6,US=(e,t)=>P.of(jm(e.num,t.num)),WS=(e,t)=>P.of(Nm(e.num,t.num)),GS=e=>P.of(e.den),KS=(e,t)=>e.isZero()?t.isZero():t.num%e.num===0n,qS=(e,t)=>{if(t.length%2==1)return;let n=e.root(2);if(n!==void 0){for(let e=0;e<t.length;){let n=e;for(;e<t.length&&t[e]===t[n];)e++;if((e-n)%2==1)return}return n}},JS=(e,t,n,r,i,a)=>{if(!i.isNegative()||!i.equals(P.fromNumber(-2).mul(e).mul(n))||t.length+r.length!==a.length*2)return!1;let o=0,s=0;for(let e of a)if(o<t.length&&t[o]===e)o+=2;else if(s<r.length&&r[s]===e)s+=2;else return!1;return o>=t.length&&s>=r.length};var YS=class{core;propagatesQuotients=W.grobnerPropagateQuotients;hasGcdTest=W.grobnerGcdTest;expandsTerms=W.grobnerExpandTerms;manager;solver;nexCreator=new jS;rows=new tv;quota=W.grQ;delayBase=0;delay=0;growthBoost=16;hitStreak=0;isAddingAllEqs=!1;mon2var=/* @__PURE__ */ new Map;constructor(e){this.core=e,this.manager=new MS(e.lra.getColumnCount()),this.solver=new VS(this.manager,()=>e.isCanceled())}run(){if(this.core.lra.getColumnCount()>5e3)return;if(this.quota===0&&(this.quota=W.grQ),this.quota===1&&(W.grobnerExpDelay?(this.delayBase===0?this.delayBase=1:this.delayBase<HS&&(this.delayBase=Math.min(this.delayBase*2,HS)),this.delay=this.delayBase):this.delay=++this.delayBase,this.quota=W.grQ),this.delay>0){this.delay--;return}if(this.findNlCluster(),!this.configure())return;let e=this.catchMemoryOut(()=>this.propagateGcdTest());e||=(this.solver.saturate(),this.delayBase>0&&this.delayBase--,this.catchMemoryOut(()=>this.isConflicting()||this.propagateQuotients()||this.propagateGcdTest()||this.propagateEqs()||this.propagateFactorization()||this.propagateLinearEquations())),W.grobnerAdaptive&&this.updateGrowthBoost(e),!e&&(this.delayBase++,this.quota>0&&this.quota--)}catchMemoryOut(e){try{return e()}catch(e){if(!(e instanceof n))throw e;return!1}}updateGrowthBoost(e){if(e){if(++this.hitStreak<2)return;this.growthBoost=Math.min(this.growthBoost+(this.growthBoost>>1),64),this.hitStreak=0;return}if(this.hitStreak=0,this.growthBoost<=16)return;let t=this.growthBoost-16;this.growthBoost=Math.max(this.growthBoost-Math.floor((t+3)/4),16)}countPropagations(e){let t=0;for(let n of this.solver.equations())if(e(n)&&++t>=this.solver.config.numberOfConflictsToReport)return!0;return t>0}isConflicting(){return this.solver.equations().some(e=>this.isEquationConflicting(e))}propagateEqs(){return this.countPropagations(e=>this.propagateFixed(e))}propagateFactorization(){return this.countPropagations(e=>this.propagateFactorizationOf(e))}propagateGcdTest(){return this.hasGcdTest?this.countPropagations(e=>this.propagateGcdTestOf(e)):!1}propagateQuotients(){return this.propagatesQuotients?this.countPropagations(e=>this.propagateQuotientsOf(e)):!1}propagateFixed(e){let t=e.poly;if(t.isUnary()){let n=t.var();return!this.core.varIsFixed(n)&&this.addLemmaUnlessHolds(e,H(n,0,0))}if(!t.isOffset())return!1;let n=t.var();if(this.core.varIsFixed(n))return!1;let r=t.hi().val(),i=t.lo().val().neg(),a=WS(GS(r),GS(i)),o=H(new B([[n,r.mul(a)]]),0,i.mul(a));return this.addLemmaUnlessHolds(e,o)}addLemmaUnlessHolds(e,t){return!this.core.ineqHolds(t)&&(this.addDependencies(new U(this.core),e).addIneq(t),!0)}propagateFactorizationOf(e){let t=e.poly.varFactors();if(t.vars.length===0||!t.poly.isLinear())return!1;let n=this.linearToTerm(t.poly),r=t.vars.map(e=>H(e,0,0));if(r.push(H(n.term,0,n.offset.neg())),r.some(e=>this.core.ineqHolds(e)))return!1;let i=this.addDependencies(new U(this.core),e);for(let e of r)i.addIneq(e);return!0}linearToTerm(e){let t=P.one,n=e;for(;!n.isVal();)t=WS(t,GS(n.hi().val())),n=n.lo();t=WS(GS(n.val()),t);let r=new B;for(n=e;!n.isVal();)r.addMonomial(t.mul(n.hi().val()),n.var()),n=n.lo();return{term:r,offset:t.mul(n.val())}}getValue(e){return PS(e,e=>this.core.val(e))}isIntPoly(e){return this.core.varIsInt(e.var())&&e.freeVars().every(e=>this.core.varIsInt(e))}propagateGcdTestOf(e){let t=e.poly;if(t.isLinear()||t.isVal()||!this.isIntPoly(t)||this.getValue(t).isZero())return!1;let n=t.getPowers();if(n.length===0)return!1;let r=P.one;for(let e of t.coefficients())r=WS(r,GS(e.coeff));r.equals(P.one)||(t=t.mul(r));let i=this.manager,a=e=>{let t=P.zero,n=P.zero;for(let r of e.coefficients())if(r.isConstant)n=n.add(r.coeff);else if(t=US(t,r.coeff),t.equals(P.one))return!1;return!n.isZero()&&!KS(t,n)};for(let r of n){if(r.degree>4)continue;let n=i.mkVar(r.var).mul(i.mkVal(P.fromNumber(r.degree))),o=!0;for(let e=0;o&&e<r.degree;e++){let s=n.add(i.mkVal(P.fromNumber(e)));a(t.substPdd(r.var,s))||(o=!1)}if(o)return this.addDependencies(new U(this.core),e),!0}return!1}propagateQuotientsOf(e){let t=e.poly;if(t.isLinear()||t.isVal()||!this.isIntPoly(t)||this.getValue(t).isZero())return!1;let n=/* @__PURE__ */ new Set,r=P.one;for(let e of t)if(r=WS(r,GS(e.coeff)),e.vars.length!==1)for(let t of e.vars)n.add(t);if(this.propagateModResidue(e))return!0;let i=!1;for(let a of n){let n=t.factor(a,1);if(!n.rest.isLinear())continue;let o=r.equals(P.one)?n.lc:n.lc.mul(r),s=r.equals(P.one)?n.rest:n.rest.mul(r);this.addQuotientLemma(e,a,o,s)&&(i=!0)}return i}propagateModResidue(e){let t=e.poly;for(let n of t){if(n.vars.length!==1)continue;let r=n.vars[0];if(!this.core.varIsInt(r))continue;let i=n.coeff,a=P.zero,o=P.zero,s=!0;for(let e of t){if(e.vars.length===1&&e.vars[0]===r)continue;if(e.vars.length===0){o=e.coeff;continue}let t=e.coeff.div(i);if(!t.isInt()||(a=a.isZero()?t.abs():US(a,t.abs()),a.equals(P.one))){s=!1;break}}if(!s||a.isZero())continue;let c=o.div(i);if(!c.isInt())continue;let l=P.of(Fm(c.neg().num,a.num)),u=this.core.val(r);if(!(u.isNegative()||u.compare(a)>=0||u.equals(l)))return this.addDependencies(new U(this.core),e).addIneq(H(r,-1,0)).addIneq(H(r,2,a)).addIneq(H(r,0,l)),!0}return!1}addQuotientLemma(e,t,n,r){let i=this.core.val(t),a=this.getValue(r),o=this.getValue(n);if(a.isZero()){if(i.isZero()||o.isZero()||!n.isLinear())return!1;let a=this.linearToTerm(n),s=this.linearToTerm(r);return this.addDependencies(new U(this.core),e).addIneq(H(t,0,0)).addIneq(H(a.term,0,a.offset.neg())).addIneq(H(s.term,3,s.offset.neg())),!0}if(i.isZero()){let n=this.addDependencies(new U(this.core),e),i=this.linearToTerm(r);return n.addIneq(H(t,3,0)).addIneq(H(i.term,0,i.offset.neg())),!0}if(o.isZero()){if(!n.isLinear())return!1;let t=this.addDependencies(new U(this.core),e),i=this.linearToTerm(n),a=this.linearToTerm(r);return t.addIneq(H(i.term,3,i.offset.neg())).addIneq(H(a.term,0,a.offset.neg())),!0}if(KS(i,a))return!1;let s=i.isPositive(),c=a.isPositive();if(i.abs().compare(a.abs())>0){let n=new U(this.core),i=this.linearToTerm(r);this.addDependencies(n,e);let a=i.offset.neg();n.addIneq(H(t,s?-2:2,0)),n.addIneq(H(i.term,c?-2:2,a));let o=this.linearToTerm(r).term;return o.addMonomial(P.fromNumber(s===c?-1:1),t),n.addIneq(H(o,c?2:-2,a)),!0}let l=P.one;if(o.abs().compare(l)>0&&i.abs().compare(l)>0&&i.abs().compare(a.abs())>=0){let i=new U(this.core),a=this.linearToTerm(r),u=this.linearToTerm(n);return this.addDependencies(i,e),o.compare(l)>0?i.addIneq(H(u.term,-2,l.sub(u.offset))):i.addIneq(H(u.term,2,P.minusOne.sub(u.offset))),i.addIneq(s?H(t,-2,l):H(t,2,P.minusOne)),a.term.addMonomial(P.fromNumber(s===c?-1:1),t),i.addIneq(c?H(a.term,2,l.sub(a.offset)):H(a.term,-2,P.minusOne.sub(a.offset))),!0}return!1}addDependencies(e,t){let n=new fv;return n.pushDependency(t.dep),e.addExplanation(n)}configure(){this.solver.reset();try{this.setLevel2var();for(let e of this.core.activeVarSet.elems)this.core.lra.isBase(e)&&this.addRow(this.core.lra.getRow(this.core.lra.core.heading[e])),this.core.isMonicVar(e)&&this.core.varIsFixed(e)&&this.addFixedMonic(e)}catch(e){if(!(e instanceof n))throw e;return!1}let e=LS();if(e.maxSteps=this.solver.equations().length,e.maxSimplified=W.grobnerMaxSimplified,e.eqsGrowth=W.grobnerEqsGrowth,e.exprSizeGrowth=W.grobnerExprSizeGrowth,e.exprDegreeGrowth=W.grobnerExprDegreeGrowth,W.grobnerAdaptive&&this.growthBoost!==16){let t=e=>Math.min(Math.floor(e*this.growthBoost/16),4294967295);e.eqsGrowth=t(e.eqsGrowth),e.exprSizeGrowth=t(e.exprSizeGrowth),e.exprDegreeGrowth=t(e.exprDegreeGrowth),e.maxSimplified=t(e.maxSimplified)}return e.numberOfConflictsToReport=W.grobnerCnflToReport,this.solver.config=e,this.solver.adjustConfig(),this.manager.setMaxNumNodes(1e4),!0}isEquationTrue(e){return e.poly.freeVars().some(e=>this.core.lra.isFree(e))?!0:this.getValue(e.poly).isZero()}getVarInterval=(e,t)=>{let n=mx();return this.core.intervals.setVarInterval(e,n,t),n};isEquationConflicting(e){if(this.isEquationTrue(e))return!1;let t=FS(e.poly,`without-deps`,this.getVarInterval);if(!gS(t))return this.addHornerConflict(e)?!0:W.grobnerPerfectSquares&&this.addPerfectSquareConflict(e);let n=FS(e.poly,`with-deps`,this.getVarInterval);return _S(n,e.dep,e=>this.addConflict(e))}addConflict(e){let t=new fv;for(let n of e)t.push(n);new U(this.core).addExplanation(t)}getMonomialInterval(e,t,n){let r=mx();dS(r,e);for(let e=0;e<t.length;){let i=t[e],a=e;for(;e<t.length&&t[e]===i;)e++;let o=mx();nS(this.getVarInterval(i,n),e-a,o,n);let s=mx();iS(r,o,s,n),tS(r,s,n)}return r}addPerfectSquareConflict(e){let t=[...e.poly].map(e=>({coeff:e.coeff,vars:e.vars.toSorted((e,t)=>e-t)})),n=t.length;if(n<3)return!1;let r=Array.from({length:n},()=>!1),i=!1;for(let e=0;e<n;e++){if(r[e])continue;let a=qS(t[e].coeff,t[e].vars);if(a!==void 0)for(let o=e+1;o<n&&!r[e];o++){if(r[o])continue;let s=qS(t[o].coeff,t[o].vars);if(s!==void 0)for(let c=e+1;c<n;c++){if(c===o||r[c]||!JS(a,t[e].vars,s,t[o].vars,t[c].coeff,t[c].vars))continue;let n=mx(),l=mx();if(oS(this.getSortedInterval(t[e]),this.getSortedInterval(t[o]),n,`without-deps`),oS(n,this.getSortedInterval(t[c]),l,`without-deps`),l.isLowerInf||l.lower.isNegative()){r[e]=!0,r[o]=!0,r[c]=!0,i=!0;break}}}}if(!i)return!1;let a=mx();a.isLowerInf=!1,a.lower=P.zero,a.isLowerOpen=!1;for(let e=0;e<n;e++){if(r[e])continue;let n=t[e],i=mx();oS(a,this.getMonomialInterval(n.coeff,n.vars,`with-deps`),i,`with-deps`),tS(a,i,`with-deps`)}return _S(a,e.dep,e=>this.addConflict(e))}getSortedInterval(e){return this.getMonomialInterval(e.coeff,e.vars,`without-deps`)}addHornerConflict(e){let t=this.nexCreator,n=e.poly.freeVars(),r=[];for(let e of n)r[e]=t.mkVar(e);t.setNumberOfVars(Math.max(0,...n)+1);let i=[];for(let n of e.poly){if(n.vars.length===0){i.push(t.mkScalar(n.coeff));continue}let e=n.vars.map(e=>r[e]);i.push(t.mkMul(n.coeff,...e))}let a=t.simplify(t.mkSum(i));if(xS(a)<2||a.kind!==`sum`)return!1;let o=e.dep,s=new AS(e=>this.core.intervals.checkNex(e,o),e=>this.core.varIsFixed(e),{inc:()=>!this.core.isCanceled()},this.core.random(),t);return s.run(a),s.done()}propagateLinearEquations(){this.mon2var.clear();for(let e of this.core.emons.monics)this.mon2var.set(e.vars.join(`,`),e.variable);let e=0;for(let t of this.solver.equations())this.propagateLinearEquation(t)&&e++;return e>0}getMonomialColumn(e){return this.mon2var.get(e.join(`,`))}propagateLinearEquation(e){if(this.isEquationTrue(e))return!1;let t=P.zero,n=[];for(let r of e.poly){if(r.vars.length===0){t=t.add(r.coeff);continue}let e=r.vars.length===1?r.vars[0]:this.getMonomialColumn(r.vars);if(e===void 0)return!1;n.push(e),t=t.add(r.coeff.mul(this.core.val(e)))}if(t.isZero())return!1;let r=P.one;for(let t of e.poly)r=WS(GS(t.coeff),r);let i=[],a=P.zero;for(let t of e.poly){let e=r.mul(t.coeff);t.vars.length===0?a=a.sub(e):i.push([n[i.length],e])}let o=this.core.lra,s=o.addTerm(i,-1);return o.updateColumnTypeAndBound(s,0,new z(a),e.dep),this.core.isCheckFeasible=!0,!0}findNlCluster(){this.rows.clear(),this.core.activeVarSet.clear();let e=[...this.core.toRefine.elems];for(let t=e.pop();t!==void 0;t=e.pop())this.addVarAndItsFactorsToQueue(t,e)}addVarAndItsFactorsToQueue(e,t){let n=this.core,r=n.lra;if(!n.activeVarSet.has(e)){if(n.activeVarSet.add(e),n.isMonicVar(e))for(let r of n.getFactorizations(n.emons.get(e)))for(let e of r.factors)t.push(e.variable);else if(r.hasTerm(e))for(let n of r.getTerm(e).coeffs)t.push(n[0]);else if(n.varIsFixed(e))return;for(let n of r.core.matrix.columns[e]){let i=n.row;if(this.rows.has(i))continue;this.rows.add(i);let a=r.core.basis[i];if((!r.isFree(a)||a===e||r.isInt(a)&&(this.isAddingAllEqs||this.hasGcdTest||this.propagatesQuotients)&&(this.isAddingAllEqs||!r.getRow(i).every(e=>e.coeff.isInt())))&&!(!this.isAddingAllEqs&&r.getRow(i).length>W.hornerRowLengthLimit))for(let e of r.getRow(i))this.addVarAndItsFactorsToQueue(e.column,t)}}}getValOfFixedVarWithDeps(e,t){let n=this.core.lra.getBoundWitnesses(e);return n!==null&&(t.dep=Q_(t.dep,n)),this.core.lra.getLowerBound(e).x}getTermPdd(e,t){let n=this.manager.mkVal(P.zero);for(let r of e.coeffs)n=n.add(this.getPdd(r[1],r[0],t));return n}getPdd(e,t,n){let r=this.core,i=this.manager.mkVal(e),a=[t],o={dep:n.dep};for(let e=a.pop();e!==void 0;e=a.pop()){if(W.grobnerSubsFixed>0&&r.varIsFixedToZero(e))return i=this.manager.mkVal(this.getValOfFixedVarWithDeps(e,o)),n.dep=o.dep,i;W.grobnerSubsFixed===1&&r.varIsFixed(e)?i=i.mul(this.getValOfFixedVarWithDeps(e,n)):this.expandsTerms&&r.lra.hasTerm(e)?i=i.mul(this.getTermPdd(r.lra.getTerm(e),n)):r.isMonicVar(e)?a.push(...r.emons.get(e).vars):i=i.mul(this.manager.mkVar(e))}return i}getSolvedForm(e){if(!e.isLinear())return null;let t=0,n=0,r=0,i=0,a=P.zero,o=P.zero;for(let s=e;!s.isVal();s=s.lo()){let e=s.var(),c=s.hi().val(),l=this.core.lra.core.getColumnType(e);if(l===1||l===2)c.isPositive()===(l===1)?(t++,r=e,a=c):(n++,i=e,o=c);else if(l!==4&&l!==3)return null;if(t>1&&n>1)return null}let s=t===1&&n>1;if(!s&&!(n===1&&t>1))return null;let c=s?r:i,l=s?a:o,u=this.manager.mkVar(c).mul(l).sub(e);return{variable:c,poly:l.equals(P.one)?u:u.mul(P.one.div(l))}}addEq(e,t){let n=this.solver.simplify(e,t),r=this.getSolvedForm(n.poly);r===null?this.solver.add(n.poly,n.dep):this.solver.addSubst(r.variable,r.poly,n.dep)}addFixedMonic(e){let t={dep:null},n=this.manager.mkVal(P.one);for(let r of this.core.emons.get(e).vars)n=n.mul(this.getPdd(P.one,r,t));n=n.sub(this.getValOfFixedVarWithDeps(e,t)),this.addEq(n,t.dep)}addRow(e){let t={dep:null},n=this.manager.mkVal(P.zero);for(let r of e)n=n.add(this.getPdd(r.coeff,r.column,t));this.addEq(n,t.dep)}setLevel2var(){let e=this.core,t=e.lra.getColumnCount(),n=Array.from({length:t},(t,n)=>e.getVarWeight(n));for(let r=0;r<t;r++)if(e.isMonicVar(r)&&e.toRefine.has(r))for(let t of e.emons.get(r).vars)n[t]+=6;let r=Array.from({length:t},(e,t)=>t).sort((e,t)=>n[e]-n[t]||e-t);this.manager.reset(r)}},XS=class{core;nexCreator=new jS;fixedDep=null;constructor(e){this.core=e}hornerLemmas(){if(!W.horner)return!1;let e=this.core;if(e.toRefine.size===0)return e.isNlaSatisfied=!0,!1;let t=e.lra.core.matrix,n=/* @__PURE__ */ new Set;for(let r of e.toRefine.elems)for(let e of t.columns[r])n.add(e.row);e.activeVarSet.clear();let r=[...n].sort((e,t)=>e-t).filter(e=>this.rowIsInteresting(t.rows[e])),i=e.random();for(let e=0;e<r.length;e++)if(this.lemmasOnRow(t.rows[r[(e+i)%r.length]]))return!0;return!1}rowIsInteresting(e){if(e.length>W.hornerRowLengthLimit)return!1;let t=this.core;t.activeVarSet.clear();for(let n of e){if(!t.isMonicVar(n.column)){if(t.activeVarSet.has(n.column))return!0;t.activeVarSet.add(n.column);continue}let e=t.emons.get(n.column).vars;if(e.some(e=>t.activeVarSet.has(e)))return!0;for(let n of e)t.activeVarSet.add(n)}return!1}lemmasOnRow(e){let t=this.core;t.activeVarSet.clear(),this.fixedDep=null;let n=e.map(e=>this.nexvar(e.coeff,e.column)),r=this.fixedDep;this.setActiveVarsWeights();let i=this.nexCreator.simplify(this.nexCreator.mkSum(n));if(xS(i)<2||i.kind!==`sum`)return!1;let a=new AS(e=>t.intervals.checkNex(e,r),e=>t.varIsFixed(e),{inc:()=>!t.isCanceled()},t.random(),this.nexCreator);return a.run(i),a.done()}setActiveVarsWeights(){this.nexCreator.setNumberOfVars(this.core.lra.getColumnCount());for(let e of this.core.activeVarSet.elems)this.nexCreator.setVarWeight(e,this.core.getVarWeight(e))}addDepsOfFixed(e){this.fixedDep=Q_(this.fixedDep,this.core.lra.getBoundWitnesses(e))}nexvar(e,t){let n=this.core,r=this.nexCreator,i=W.hornerSubsFixed;if(i===1&&n.varIsFixed(t))return this.addDepsOfFixed(t),r.mkScalar(e.mul(n.lra.core.lowerBounds[t].x));if(i===2&&n.varIsFixedToZero(t))return this.addDepsOfFixed(t),r.mkScalar(P.zero);if(!n.isMonicVar(t))return n.activeVarSet.add(t),r.mkMul(r.mkScalar(e),r.mkVar(t));let a=[e],o=this.fixedDep;for(let e of n.emons.get(t).vars)if(i===1&&n.varIsFixed(e))this.addDepsOfFixed(e),a.push(n.lra.core.lowerBounds[e].x);else if(i===2&&n.varIsFixedToZero(e))return this.fixedDep=o,this.addDepsOfFixed(e),r.mkScalar(P.zero);else n.activeVarSet.add(e),a.push(r.mkVar(e));return r.mkMul(...a)}};const ZS=e=>{let t=new fv;for(let n of e)t.push(n);return t};var QS=class{core;constructor(e){this.core=e}checkNex(e,t){let n=e=>new U(this.core).addExplanation(e),r=mx();if(!this.intervalOfExpr(e,1,r,`without-deps`,n))return!0;if(!gS(r))return!1;let i=mx();return this.intervalOfExpr(e,1,i,`with-deps`,n),_S(i,t,e=>n(ZS(e))),!0}hasZeroInterval(e){return e.kind===`var`&&this.core.varIsFixedToZero(e.variable)}hasInfInterval(e){return e.kind===`var`?this.core.noBounds(e.variable):e.kind===`mul`?this.mulHasInfInterval(e):e.kind!==`scalar`&&e.children.some(e=>this.hasInfInterval(e))}mulHasInfInterval(e){let t=!1;for(let n of e.children){if(!vS(n.expr)||this.hasZeroInterval(n.expr))return!1;t||=this.hasInfInterval(n.expr)}return t}expressionToNormalizedTerm(e){let t=[],n=P.zero,r=0,i=-1;for(let a of e.children){if(a.kind===`scalar`){n=n.add(a.value);continue}if(a.kind===`mul`){let e=a.children[0].expr;e.kind===`var`&&t.push([a.coeff,e.variable])}else a.kind===`var`&&t.push([P.one,a.variable]);if(t.length===0)continue;let e=t[t.length-1];(t.length===1||r>e[1])&&(r=e[1],i=t.length-1)}let a=t[i][0],o=new B;return t.forEach((e,t)=>{a.equals(P.one)?o.addMonomial(e[0],e[1]):t===i?o.addMonomial(P.one,e[1]):o.addMonomial(e[0].div(a),e[1])}),{term:o,coeff:a,constant:n}}setVarInterval(e,t,n){let r=this.core.lra,i=e<r.columns.length,a=i?r.getLowerWitness(e):null;if(a!==null){let n=r.core.lowerBounds[e];t.lower=n.x,t.isLowerOpen=n.y.isPositive(),t.isLowerInf=!1}else t.isLowerOpen=!0,t.isLowerInf=!0;n===`with-deps`&&(t.lowerDep=a);let o=i?r.getUpperWitness(e):null;if(o!==null){let n=r.core.upperBounds[e];t.upper=n.x,t.isUpperOpen=n.y.isNegative(),t.isUpperInf=!1}else t.isUpperOpen=!0,t.isUpperInf=!0;n===`with-deps`&&(t.upperDep=o)}intervalFromTerm(e,t,n){let r=this.expressionToNormalizedTerm(e),i=new fv;if(this.core.explainByEquiv(r.term,i)){if(dS(t,r.constant),n===`with-deps`){for(let e of i)t.lowerDep=Q_(t.lowerDep,Z_(e));t.upperDep=t.lowerDep}return!0}let a=this.core.lra.fetchNormalizedTermColumn(r.term);if(a===void 0)return!1;this.setVarInterval(a.column,t,n);let o=mx();return rS(r.coeff.div(a.coeff),t,o,n),sS(r.constant,o),tS(t,o,n),!0}intervalOfSumNoTerm(e,t,n,r){if(this.hasInfInterval(e))return!0;if(!this.intervalOfExpr(e.children[0],1,t,n,r))return!1;for(let i of e.children.slice(1)){let e=mx();if(!this.intervalOfExpr(i,1,e,n,r))return!1;let a=mx();oS(t,e,a,n),tS(t,a,n)}return!0}conflictUpperLower(e,t){if(e.isUpperInf||t.isLowerInf)return!1;let n=e.upper.compare(t.lower);return n===0?e.isUpperOpen||t.isUpperOpen:n<0}intervalOfSum(e,t,n,r){if(!this.intervalOfSumNoTerm(e,t,n,r))return!1;if(!CS(e))return!0;let i=mx();if(!this.intervalFromTerm(e,i,n))return!0;let a=mx();if(uS(t,i,a,n),!pS(a))return tS(t,a,n),!0;if(n===`with-deps`){let e=new fv,n=this.conflictUpperLower(t,i)?[t.upperDep,a.lowerDep]:[a.upperDep,t.lowerDep];for(let t of n)e.pushDependency(t);r(e)}else this.intervalOfSum(e,mx(),`with-deps`,r);return!1}intervalOfMul(e,t,n,r){let i=e.children.find(e=>this.hasZeroInterval(e.expr));if(i!==void 0)return this.intervalOfExpr(i.expr,1,t,n,r),n===`with-deps`&&fS(t),!0;dS(t,e.coeff);for(let i of e.children){let e=mx();if(!this.intervalOfExpr(i.expr,i.power,e,n,r))return!1;let a=mx();iS(t,e,a,n),tS(t,a,n)}return!0}toPower(e,t,n){if(t===1)return;let r=mx();nS(e,t,r,n),tS(e,r,n)}intervalOfExpr(e,t,n,r,i){if(e.kind===`scalar`)return dS(n,e.value.pow(t)),!0;if(e.kind===`sum`){if(!this.intervalOfSum(e,n,r,i))return!1}else if(e.kind===`mul`){if(!this.intervalOfMul(e,n,r,i))return!1}else this.setVarInterval(e.variable,n,r);return this.toPower(n,t,r),!0}};const $S=e=>e.x.isNegative()||e.x.isZero()&&e.y.isNegative()?e.neg():e,eC=(e,t)=>t.equals(P.one)?new z(e.floor()):t.equals(P.minusOne)?e:new z(e.div(t).floor().mul(t));var tC=class{core;constructor(e){this.core=e}generateLemmas(){this.core.toRefine.size>0&&this.addLemma()}computeProduct(e,t,n){let r=mx();for(let i=e;i<t.size;){let e=t.vars[i];this.varToInterval(e,r),i++;let a=1;for(;i<t.size&&t.vars[i]===e;i++)a++;nS(r,a,r,`with-deps`),iS(n,r,n,`with-deps`)}}varToInterval(e,t){let n=this.core.lra,r=n.getBound(e,!1);r===void 0?t.isLowerInf=!0:(t.isLowerOpen=r.isStrict,t.lower=r.value,t.lowerDep=r.dep,t.isLowerInf=!1);let i=n.getBound(e,!0);i===void 0?t.isUpperInf=!0:(t.isUpperOpen=i.isStrict,t.upper=i.value,t.upperDep=i.dep,t.isUpperInf=!1)}tightenLp(e){let t=this.analyzeMonomial(e),n=t.numFree===0,r=!this.isFree(e.variable)&&t.numFree<=1;if(!n&&!r)return!1;let i=mx(),a=mx(),o=mx(),s=mx();this.varToInterval(e.variable,o),dS(i,P.one);let c=!1;for(let n=0;n<e.size;){let l=e.vars[n];n++;let u=1;for(;n<e.size&&l===e.vars[n];n++)u++;this.varToInterval(l,a),nS(a,u,a,`with-deps`),r&&(t.numFree===0||t.freeVar===l)&&(tS(s,i,`with-deps`),this.computeProduct(n,e,s),this.tightenLpBoundByDivision(o,l,u,s)&&(c=!0)),iS(i,a,i,`with-deps`)}return n&&this.tightenLpBound(i,e.variable,1)||c}tightenLpBoundByDivision(e,t,n,r){if(!gS(r))return!1;let i=mx();return aS(e,r,i,`with-deps`),this.tightenLpBound(i,t,n)}isFree(e){return!this.core.hasLowerBound(e)&&!this.core.hasUpperBound(e)}isZero(e){let t=this.core;return t.hasLowerBound(e)&&t.hasUpperBound(e)&&t.getLowerBound(e).isZero()&&t.getUpperBound(e).isZero()}analyzeMonomial(e){let t=0,n=-1;for(let r=0;r<e.vars.length;){let i=e.vars[r];r++;let a=1;for(;r<e.vars.length&&e.vars[r]===i;r++)a++;if(this.isZero(i))return{numFree:0,freeVar:n};a%2==1&&this.isFree(i)&&(t++,n=i)}return{numFree:t,freeVar:n}}propagateChangedBounds(){let e=this.core,t=!1;for(let n of e.monicsWithChangedBounds.elems){if(!e.isMonicVar(n))continue;let r=e.emon(n);if(this.propagateLinearBound(r)&&(t=!0),this.tightenLp(r)&&(t=!0),e.lra.status===1)break}return t}addLemma(){let e=this.core.lra;if(e.status!==1)return!1;let t=new fv;return e.getInfeasibilityExplanation(t),new U(this.core).addExplanation(t),!0}propagateLinearBound(e){if(e.isPropagated)return!1;let t=this.getLinear(e);return t!==void 0&&(this.core.emons.setPropagated(e),this.linearize(e,t.nonFixed,t.fixedToZero))}linearize(e,t,n){let r;if(n!==-1)r=this.propagateFixedToZero(e,n);else{let n=this.getFixedVarProduct(e,t);r=t===-1?this.propagateFixed(e,n):this.propagateNonfixed(e,n,t)}return r&&this.core.stats.nlaPropagateEq++,r}propagateViolatedLinearMonomials(){let e=this.core;if(!W.linearizeViolatedMonomials||!e.lra.isFeasible())return!1;let t=!1;for(let n of e.emons.monics){if(e.checkMonic(n))continue;let r=this.getLinear(n);if(r!==void 0){if(r.fixedToZero===-1&&r.nonFixed!==-1){let e=this.getFixedVarProduct(n,r.nonFixed);if(e.isInt()&&nC(e)<=16)continue}if(this.linearize(n,r.nonFixed,r.fixedToZero)&&(t=!0),e.lra.status===1)break}}return t}getExplanation(e){let t=new fv;for(let n of $_([e]))t.addPair(n,P.one);return t}propagateFixedToZero(e,t){let n=this.core;if(n.varIsFixedToZero(e.variable))return!1;let r=n.lra.getBoundWitnesses(t);return n.lra.updateColumnTypeAndBound(e.variable,0,z.zero,r),n.fixedEqualities.push({lpVar:e.variable,value:P.zero,explanation:this.getExplanation(r)}),!0}propagateFixed(e,t){let n=this.core;if(n.varIsFixed(e.variable)&&n.getLowerBound(e.variable).equals(t))return!1;let r=this.explainFixed(e,t);return n.lra.updateColumnTypeAndBound(e.variable,0,new z(t),r),n.fixedEqualities.push({lpVar:e.variable,value:t,explanation:this.getExplanation(r)}),!0}propagateNonfixed(e,t,n){let r=this.core;if(r.val(e.variable).equals(t.mul(r.val(n))))return!1;let i=r.lra.addTerm([[n,t.neg()],[e.variable,P.one]],-1),a=this.explainFixed(e,t);return r.lra.updateColumnTypeAndBound(i,0,z.zero,a),t.equals(P.one)&&r.equalities.push({first:e.variable,second:n,explanation:this.getExplanation(a)}),!0}explainFixed(e,t){let n=this.core,r=n.lra,i=null,a=e=>(i=Q_(i,r.getLowerWitness(e)),i=Q_(i,r.getUpperWitness(e)),i);if(t.isZero()){for(let t of e.vars)if(n.varIsFixedToZero(t))return a(t)}else for(let t of e.vars)n.varIsFixed(t)&&a(t);return i}getLinear(e){let t=this.core,n=-1;for(let r of e.vars)if(!t.varIsFixed(r)){if(n!==-1)return;n=r}else if(t.getLowerBound(r).isZero())return{nonFixed:n,fixedToZero:r};return{nonFixed:n,fixedToZero:-1}}getFixedVarProduct(e,t){let n=P.one;for(let r of e.vars)r!==t&&(n=n.mul(this.core.lra.getLowerBound(r).x));return n}tightenLpUpperBound(e,t,n){let r=this.core,i=e=>!r.hasUpperBound(t)||e.compare(r.getUpperBound(t))<0,a=!1;if(!e.isUpperInf){let r=e.upper.root(n);r!==void 0&&i(r)&&(this.propagateLpBound(t,e.isUpperOpen?-1:-2,r,e.upperDep),a=!0)}if(n%2==0&&!e.isLowerInf&&r.hasUpperBound(t)&&!r.getUpperBound(t).isPositive()&&!e.lower.isNegative()){let o=e.lower.root(n);if(o!==void 0&&i(o.neg())){let n=Q_(e.lowerDep,r.lra.getUpperWitness(t));this.propagateLpBound(t,e.isLowerOpen?-1:-2,o.neg(),n),a=!0}}return a}tightenLpLowerBound(e,t,n){let r=this.core,i=e=>!r.hasLowerBound(t)||e.compare(r.getLowerBound(t))>0,a=!1;if(n%2==1){if(!e.isLowerInf){let r=e.lower.root(n);r!==void 0&&i(r)&&(this.propagateLpBound(t,e.isLowerOpen?1:2,r,e.lowerDep),a=!0)}return a}if(!e.isUpperInf&&!e.upper.isNegative()){let r=e.upper.root(n);r!==void 0&&i(r.neg())&&(this.propagateLpBound(t,e.isUpperOpen?1:2,r.neg(),e.upperDep),a=!0)}if(!e.isLowerInf&&r.hasLowerBound(t)&&!r.getLowerBound(t).isNegative()&&!e.lower.isNegative()){let o=e.lower.root(n);if(o!==void 0&&i(o)){let n=Q_(e.lowerDep,r.lra.getLowerWitness(t));this.propagateLpBound(t,e.isLowerOpen?1:2,o,n),a=!0}}return a}propagateLpBound(e,t,n,r){let i=this.core.lra,a=(t,n)=>i.updateColumnTypeAndBound(e,t,new z(n),r);this.core.varIsInt(e)?n.isInt()?t===1?a(2,n.add(P.one)):t===-1?a(-2,n.sub(P.one)):a(t,n):t===2||t===1?a(2,n.ceil()):a(-2,n.floor()):a(t,n)}tightenLpBound(e,t,n){let r=!1;return this.tightenLpUpperBound(e,t,n)&&(r=!0),this.tightenLpLowerBound(e,t,n)&&(r=!0),r}tightenLpBounds(){let e=!1;for(let t of this.core.emons.monics)this.tightenLp(t)&&(e=!0);return e}isSafeGain(e){return e.isUnbounded||new z(e.minGain).compare(e.maxGain)<=0}initGains(e,t){let n=this.core.lra,r=n.core,i={isUnbounded:!0,minGain:P.minusOne,maxGain:z.zero};return t&&r.hasUpperBound(e)?(i.isUnbounded=!1,i.maxGain=r.upperBounds[e].sub(r.x[e])):!t&&r.hasLowerBound(e)&&(i.isUnbounded=!1,i.maxGain=r.x[e].sub(r.lowerBounds[e])),n.isInt(e)&&(i.minGain=P.one),i}updateGains(e,t,n,r){let i=this.core.lra,a=i.core;if(!this.isSafeGain(r))return!1;let o=e&&n.isPositive()||!e&&n.isNegative(),s=!1,c=z.zero;o&&a.hasLowerBound(t)?(c=$S(a.x[t].sub(a.lowerBounds[t]).div(n)),s=!0):!o&&a.hasUpperBound(t)&&(c=$S(a.upperBounds[t].sub(a.x[t]).div(n)),s=!0);let l=i.isInt(t),u=l?P.of(n.den):P.one;return l&&!u.equals(P.one)&&(r.minGain=r.minGain.isNegative()?u:P.of(Nm(r.minGain.num,u.num)),r.isUnbounded||(r.maxGain=eC(r.maxGain,r.minGain))),l&&!r.isUnbounded&&!r.maxGain.isInt()&&(r.maxGain=eC(new z(r.maxGain.floor()),r.minGain)),s?(l&&(c=eC(new z(c.floor()),r.minGain)),r.isUnbounded?(r.isUnbounded=!1,r.maxGain=c,!0):r.maxGain.compare(c)>0&&(r.maxGain=c,!0)):!1}pickVarToLeave(e,t){let n=this.core.lra,r=n.core,i=-1,a=P.zero,o=this.initGains(e,t);if(n.isInt(e)&&!r.x[e].isInt())return{isSafe:!1,gain:o,leaving:i,leavingCoeff:a};for(let n of r.matrix.columns[e]){let e=r.basis[n.row],s=r.matrix.getVal(n);(this.updateGains(t,e,s,o)||i===-1&&!o.isUnbounded)&&(i=e,a=s)}return{isSafe:this.isSafeGain(o),gain:o,leaving:i,leavingCoeff:a}}updateValue(e,t){if(t.isZero())return;let n=this.core.lra;n.setValueForNbasicColumn(e,n.core.x[e].add(t))}moveToBound(e,t){let n=this.core.lra,r=n.core;if(n.isInt(e)&&!r.x[e].isInt())return!1;let i=this.initGains(e,t);for(let n of r.matrix.columns[e])this.updateGains(t,r.basis[n.row],r.matrix.getVal(n),i);return!this.isSafeGain(i)||i.isUnbounded?!1:(this.updateValue(e,t?i.maxGain:i.maxGain.neg()),!i.maxGain.isZero())}optimize(e,t){let n=this.core.lra.core,r=0;for(let i=0;r<20&&i<200&&!this.core.isCanceled();){i++;let a=-1,o=-1,s=P.zero,c={isUnbounded:!0,minGain:P.minusOne,maxGain:z.zero},l=!1,u=!1,d=(e,i)=>{let d=i.isPositive()?t:!t;if((d&&n.hasUpperBound(e)||!d&&n.hasLowerBound(e))&&(u=!0),d&&n.hasUpperBound(e)&&n.x[e].equals(n.upperBounds[e])||!d&&n.hasLowerBound(e)&&n.x[e].equals(n.lowerBounds[e]))return!1;let f=this.pickVarToLeave(e,d);if(!f.isSafe)return u=!0,r++,!1;let p=()=>{o=f.leaving,a=e,s=f.leavingCoeff,c=f.gain,l=d};return f.leaving===-1?(p(),!0):((f.gain.maxGain.compare(c.maxGain)>0||f.gain.maxGain.isZero()&&(o===-1||f.leaving<o))&&p(),!1)};if(!n.isBase(e))d(e,P.one);else{let t=n.matrix.rows[n.heading[e]],r=t.find(t=>t.column===e)?.coeff??P.zero;for(let n of t){if(n.column===e)continue;let t=r.isNegative()?n.coeff:n.coeff.neg();if(d(n.column,t))break}}if(!u&&o===-1&&a===-1)return;if(a===-1)return r!==0||!n.x[e].y.isZero()?void 0:n.x[e].x;let f=c;if(f.minGain.isPositive()&&!f.minGain.equals(P.one)&&r++,o===-1){if(!(l?n.hasUpperBound(a):n.hasLowerBound(a))||f.maxGain.isZero())return;this.updateValue(a,l?f.maxGain:f.maxGain.neg());continue}if(n.hasLowerBound(a)&&n.hasUpperBound(a)&&!n.lowerBounds[a].equals(n.upperBounds[a])&&n.upperBounds[a].sub(n.lowerBounds[a]).equals(f.maxGain)){this.updateValue(a,l?f.maxGain:f.maxGain.neg());continue}n.pivot(a,o);let p=l?s.isNegative():s.isPositive();this.moveToBound(o,p)||r++}}getDepFromRow(e,t){let n=this.core.lra,r=n.core;if(!r.isBase(e))return null;let i=r.matrix.rows[r.heading[e]],a=i.find(t=>t.column===e)?.coeff??P.zero;if(a.isZero())return null;let o=null;for(let s of i){if(s.column===e)continue;let i=s.coeff.neg().div(a);if(!i.isZero()){if(t?i.isPositive():i.isNegative()){if(!r.hasUpperBound(s.column))return null;o=Q_(o,n.getUpperWitness(s.column))}else{if(!r.hasLowerBound(s.column))return null;o=Q_(o,n.getLowerWitness(s.column))}}}return o}improveBound(e,t){let n=this.core.lra,r=n.core;if(!n.isFeasible())return;let i=this.optimize(e,!t);if(i===void 0)return;let a=this.getDepFromRow(e,!t);if(a!==null&&!(t&&r.hasLowerBound(e)&&i.compare(r.lowerBounds[e].x)<=0)&&!(!t&&r.hasUpperBound(e)&&i.compare(r.upperBounds[e].x)>=0))return{bound:i,dep:a}}optimizeNlBounds(){let e=this.core,t=e.lra;if(!W.optimizeBounds||!t.isFeasible())return!1;if(t.findFeasibleSolution()===1)return e.initToRefine(),!1;let n=[],r=r=>{e.activeVarSet.has(r)||(e.activeVarSet.add(r),t.isFixed(r)||n.push(r))};e.activeVarSet.clear();for(let t of e.emons.monics){r(t.variable);for(let e of t.vars)r(e)}let i=W.optimizeBoundsLpMaxVars;if(i!==0&&n.length>i)return e.initToRefine(),!1;let a=[];for(let e of n){if(!t.isFeasible())break;for(let t of[!0,!1]){let n=this.improveBound(e,t);n!==void 0&&a.push({column:e,kind:t?2:-2,bound:n.bound,dep:n.dep})}}for(let e of a)t.updateColumnTypeAndBound(e.column,e.kind,new z(e.bound),e.dep);return t.findFeasibleSolution(),e.initToRefine(),a.length>0}};const nC=e=>{let t=e.num<0n?-e.num:e.num;return t===0n?1:t.toString(2).length},rC=e=>e.isPositive()?1:e.isNegative()?255:0,iC=e=>e+127>>>0;var aC=class{lra;stats;seen=/* @__PURE__ */ new Set;constructor(e,t){this.lra=e,this.stats=t}insertNew(e){let t=[...e,...Array.from({length:8-e.length},()=>0)].join(`,`);return this.seen.has(t)?(this.stats.nlaThrottledLemmas++,!0):(this.seen.add(t),this.lra.pushTrail(()=>this.seen.delete(t)),!1)}insertMonotone(e,t,n){return this.insertNew([e,t,+!!n])}insertBinomialSign(e,t,n,r,i,a){return this.insertNew([e,t,n,r,iC(i),iC(a)])}insertOrder(e,t,n,r,i,a,o,s,c,l){let u=(rC(s)<<24|(c&65535)<<8|l>>>0&255)>>>0;return this.insertNew([e,t,n,rC(r),i,a,o,u])}insertTangent(e,t,n,r,i,a){return this.insertNew([e,t,n,r,+!!i,a])}insertSimplifiedTangent(e,t,n,r,i){return this.insertNew([e,t,n,r,+!!i])}},oC=class{core;constructor(e){this.core=e}monotonicityLemma(){let e=this.core,t=e.random(),n=e.toRefine.size;for(let r=0;r<n&&!e.done();r++)this.monotonicityLemmaOnMonic(e.emons.get(e.toRefine.elems[(r+t)%n]))}monotonicityLemmaOnMonic(e){let t=this.core;if(t.monHasZero(e.vars)||t.hasBigNum(e))return;let n=t.productValue(e).abs(),r=t.varVal(e).abs(),i=r.compare(n)<0;t.throttle.insertMonotone(2,e.variable,i)||(i?this.monotonicityLemmaLt(e):r.compare(n)>0&&this.monotonicityLemmaGt(e))}monotonicityLemmaGt(e){let t=this.core,n=new U(t),r=P.one;for(let i of e.vars){let e=t.val(i);n.addIneq(H(i,e.isNegative()?-1:1,e)),n.addIneq(H(i,e.isNegative()?1:-1,0)),r=r.mul(e)}n.addIneq(H(e.variable,r.isNegative()?2:-2,r))}monotonicityLemmaLt(e){let t=this.core,n=new U(t),r=P.one;for(let i of e.vars){let e=t.val(i);n.addIneq(H(i,e.isNegative()?1:-1,e)),r=r.mul(e)}n.addIneq(H(e.variable,r.isNegative()?-2:2,r))}},sC=class{core;constructor(e){this.core=e}orderLemma(){if(!W.order)return;let e=this.core,t=e.toRefine,n=e.random(),r=t.size;for(let i=0;i<r&&!e.done();i++)this.orderLemmaOnMonic(e.emons.get(t.elems[(i+n)%r]))}orderLemmaOnMonic(e){let t=this.core;for(let n of t.getFactorizations(e))if(n.factors.length===2&&(n.mon===null?this.orderLemmaOnFactorization(e,n):this.orderLemmaOnBinomial(n.mon),t.done()))break}orderLemmaOnBinomial(e){let t=this.core,n=t.varVal(e).compare(t.mulVal(e))>0;for(let t of[0,1])this.orderLemmaOnBinomialSign(e,e.vars[t],e.vars[1-t],n?1:-1),this.orderLemmaOnFactorBinomialExplore(e,t)}orderLemmaOnBinomialSign(e,t,n,r){if(!W.orderBinomialSign)return;let i=this.core;if(!i.varIsInt(t)&&i.val(t).isBig())return;let a=Gb(i.val(n));if(i.throttle.insertBinomialSign(1,e.variable,t,n,r,a))return;let o=new U(i);o.addIneq(H(n,a===1?-2:2,0)),o.addIneq(H(t,a*r===1?1:-1,i.val(t))),o.addIneq(H(new B([[e.variable,P.one],[n,i.val(t).neg()]]),r===1?-2:2,0))}orderLemmaOnFactorBinomialExplore(e,t){let n=this.core;for(let r of n.emons.getProductsOf(e.vars[t]))if(r.variable!==e.variable&&(this.orderLemmaOnFactorBinomialRm(e,t,r),n.done()))break}orderLemmaOnFactorBinomialRm(e,t,n){let r=dx(nx(this.core.varEqs.findVar(e.vars[t])),!1),i=this.core.divide(n,r);i!==void 0&&this.orderLemmaOnBinomialAcBd(e,t,n,i,r.variable)}orderLemmaOnBinomialAcBd(e,t,n,r,i){let a=this.core,o=e.vars[1-t],s=e.vars[t],c=a.varVal(e),l=P.fromNumber(Gb(a.val(s))),u=P.fromNumber(Gb(a.val(i))),d=a.varVal(n),f=a.val(o).mul(l),p=a.valFactor(r).mul(u);c.compare(d)>=0&&f.compare(p)<0?this.generateMonOl(e,o,l,s,n,r,u,i,-1):c.compare(d)<=0&&f.compare(p)>0&&this.generateMonOl(e,o,l,s,n,r,u,i,1)}generateMonOl(e,t,n,r,i,a,o,s,c){let l=this.core;if(l.throttle.insertOrder(0,e.variable,t,n,r,i.variable,a.variable,o,s,c))return;let u=new U(l);u.addIneq(H(new B([[r,n]]),-2,0)),u.explainVar(r),u.addIneq(H(new B([[t,n],[a.variable,o.mul(fx(a)).neg()]]),Wb(c),0)),u.addIneq(H(new B([[e.variable,P.one],[i.variable,P.minusOne]]),c,0)),u.explainMonic(i),u.explainFactor(a),u.explainVar(s)}orderLemmaOnAcAndBc(e,t,n,r){let i=t.factors,a=this.core.divide(r,i[n]);return a!==void 0&&this.orderLemmaOnAcAndBcAndFactors(e,i[1-n],i[n],r,a)}orderLemmaOnFactorization(e,t){let n=this.core,r=!1;for(let e of t.factors)r=r!==e.isNegated;let i=Kb(r),a=n.val(t.factors[0].variable).mul(n.val(t.factors[1].variable)),o=i.mul(n.varVal(e));if(!o.equals(a)&&!n.hasReal(e)){let r=o.compare(a)>0;for(let a=0,o=1;a<2;a++,o--){let s=new U(n);this.orderLemmaOnAb(s,e,i,t.factors[o].variable,t.factors[a].variable,r),s.explainFactorization(t),s.explainMonic(e)}}for(let n of[0,1])this.orderLemmaOnAcExplore(e,t,n)}orderLemmaOnAcExplore(e,t,n){let r=t.factors[n],i=this.core.emons,a=r.isMon?i.getProductsOf(r.variable):i.getUseList(r.variable);for(let r of a)if(this.orderLemmaOnAcAndBc(e,t,n,r))return}generateOlEq(e,t,n,r,i){let a=new U(this.core);a.addIneq(H(n.variable,0,0)),a.addIneq(H(new B([[e.variable,P.one],[r.variable,P.minusOne]]),3,0)),a.addIneq(H(new B([[t.variable,fx(t)],[i.variable,fx(i).neg()]]),0,0)),this.explainOl(a,e,t,r,i,n)}generateOl(e,t,n,r,i){let a=this.core,o=new U(a);o.addIneq(H(n.variable,a.val(n.variable).isNegative()?2:-2,0)),o.addIneq(H(new B([[e.variable,P.one],[r.variable,P.minusOne]]),a.varVal(e).compare(a.varVal(r))<0?1:-1,0)),o.addIneq(H(new B([[t.variable,fx(t)],[i.variable,fx(i).neg()]]),a.valFactor(t).compare(a.valFactor(i))<0?2:-2,0)),this.explainOl(o,e,t,r,i,n)}explainOl(e,t,n,r,i,a){e.explainMonic(t),e.explainFactor(n),e.explainMonic(r),e.explainFactor(i),e.explainFactor(a)}orderLemmaOnAcAndBcAndFactors(e,t,n,r,i){let a=this.core,o=P.fromNumber(Gb(a.valFactor(n))),s=a.valFactor(t).mul(o),c=a.valFactor(i).mul(o),l=a.varVal(e).compare(a.varVal(r)),u=s.compare(c);return l>0&&u<0||l<0&&u>0?(this.generateOl(e,t,n,r,i),!0):l===0&&u!==0&&(this.generateOlEq(e,t,n,r,i),!0)}orderLemmaOnAb(e,t,n,r,i,a){let o=this.core;e.addIneq(H(i,3,o.val(i))),e.addIneq(H(new B([[t.variable,n],[r,o.val(i).neg()]]),a?-2:2,0))}};const cC=(e,t)=>{let n=e[t];return t!==0&&e[t-1]===n||t+1<e.length&&n===e[t+1]};var lC=class{core;patchedVar=0;patchedMonic;constructor(e){this.core=e}varBreaksCorrectMonicAsFactor(e,t){let n=this.core;return n.varVal(t).isZero()?n.val(e).isZero()?!t.vars.some(t=>t!==e&&n.val(t).isZero()):!1:!0}varBreaksCorrectMonic(e){let t=this.core;if(t.isMonicVar(e)&&!t.toRefine.has(e))return!0;for(let n of t.emons.getUseList(e))if(!t.toRefine.has(n.variable)&&this.varBreaksCorrectMonicAsFactor(e,n))return!0;return!1}updateToRefineOfVar(e){let t=this.core,n=e=>{t.varVal(e).equals(t.mulVal(e))?t.eraseFromToRefine(e.variable):t.insertToRefine(e.variable)};for(let r of t.emons.getUseList(e))n(r);t.isMonicVar(e)&&n(t.emon(e))}isPatchBlocked(e,t){let n=this.core;if(!n.lra.insideBounds(e,t)||n.varIsInt(e)&&!t.isInt())return!0;if(e===this.patchedVar)return!1;let r=this.patchedMonic;return r!==void 0&&(r.containsVar(e)||e===r.variable)?!0:this.varBreaksCorrectMonic(e)}tryToPatch(e){return this.core.lra.tryToPatch(this.patchedVar,e,(e,t)=>this.isPatchBlocked(e,t),e=>this.updateToRefineOfVar(e))}patchMonomial(e){let t=this.core,n=t.emon(e);this.patchedMonic=n,this.patchedVar=e;let r=t.mulVal(n);if(t.val(e).equals(r)){t.eraseFromToRefine(e);return}if(!this.varBreaksCorrectMonic(e)&&this.tryToPatch(r))return;if(n.vars.length===2&&n.vars[0]===n.vars[1]){let e=r.root(2);e===void 0||(this.patchedVar=n.vars[0],this.varBreaksCorrectMonic(this.patchedVar)||this.tryToPatch(e)||this.tryToPatch(e.neg()));return}if(r.isZero())return;let i=t.val(e).div(r);for(let r=0;r<n.size;r++)if(this.patchedVar=n.vars[r],!cC(n.vars,r)&&!this.varBreaksCorrectMonic(this.patchedVar)&&this.tryToPatch(i.mul(t.val(this.patchedVar)))){t.eraseFromToRefine(e);break}}patchMonomials(){let e=this.core,t=[...e.toRefine.elems],n=t.length,r=e.random();for(let i=0;i<n&&e.toRefine.size>0;i++)this.patchMonomial(t[(r+i)%n])}};const uC=(e,t)=>({x:e,y:t}),dC=P.of(2n);var fC=class{core;xy;value;monic;a=uC(P.zero,P.zero);b=uC(P.zero,P.zero);correctValue;isBelow;isPlStrictInterior=!0;monicVar;x;y;xVar;yVar;isMon;constructor(e,t,n,r,i){this.core=e,this.xy=t,this.value=n,this.monic=r,this.correctValue=t.x.mul(t.y),this.isBelow=n.compare(this.correctValue)<0,this.monicVar=r.variable,this.x=i.factors[0],this.y=i.factors[1],this.xVar=this.x.variable,this.yVar=this.y.variable,this.isMon=i.mon!==null}run(){this.getPoints(),this.generateLine1(),this.generateLine2(),this.generatePlane(this.a),this.generatePlane(this.b)}explain(e){this.isMon||(e.explainMonic(this.monic),e.explainFactor(this.x),e.explainFactor(this.y))}generatePlane(e){let t=this.core;if(t.throttle.insertSimplifiedTangent(3,this.monicVar,this.xVar,this.yVar,this.isBelow))return;let n=new U(t);t.negateRelation(n,this.xVar,fx(this.x).mul(e.x)),t.negateRelation(n,this.yVar,fx(this.y).mul(e.y));let r=new B;r.addMonomial(fx(this.y).mul(e.x).neg(),this.yVar),r.addMonomial(fx(this.x).mul(e.y).neg(),this.xVar),r.addMonomial(P.one,this.monicVar);let i=this.isBelow?this.isPlStrictInterior?1:2:this.isPlStrictInterior?-1:-2;n.addIneq(H(r,i,e.x.mul(e.y).neg())),this.explain(n)}generateLine1(){let e=this.core;if(e.throttle.insertTangent(3,this.monicVar,this.xVar,this.yVar,this.isBelow,1))return;let t=new U(e);t.addIneq(H(this.xVar,3,e.val(this.xVar))),t.addIneq(H(new B([[this.monicVar,P.one],[this.yVar,fx(this.y).mul(this.xy.x).neg()]]),0,0)),this.explain(t)}generateLine2(){let e=this.core;if(e.throttle.insertTangent(3,this.monicVar,this.xVar,this.yVar,this.isBelow,2))return;let t=new U(e);t.addIneq(H(this.yVar,3,e.val(this.yVar))),t.addIneq(H(new B([[this.monicVar,P.one],[this.xVar,fx(this.x).mul(this.xy.y).neg()]]),0,0)),this.explain(t)}getInitialPoints(){let e=this.xy.x,t=this.xy.y,n=this.value.isInt()&&e.isInt()&&t.isInt(),r=this.correctValue.sub(this.value).abs(),i=n||P.one.compare(r)<=0?P.one:r;this.isBelow?(this.a=uC(e.sub(i),t.sub(i)),this.b=uC(e.add(i),t.add(i))):(this.a=uC(e.sub(i),t.add(i)),this.b=uC(e.add(i),t.sub(i)))}pushPoint(e){let t=e,n=uC(e.x.sub(this.xy.x),e.y.sub(this.xy.y));for(let e=10;e>0&&!this.core.done();e--){n=uC(n.x.mul(dC),n.y.mul(dC));let e=uC(this.xy.x.add(n.x),this.xy.y.add(n.y));if(!this.isPlaneCorrectCut(e))return t;t=e}return t}getTangPlane(e){return e.x.mul(this.xy.y).add(e.y.mul(this.xy.x)).sub(e.x.mul(e.y))}setBoxCorners(){let e=this.core,t=this.xVar,n=this.yVar;if(!e.hasLowerBound(t)||!e.hasUpperBound(t)||!e.hasLowerBound(n)||!e.hasUpperBound(n))return!1;let r=e.getLowerBound(t),i=e.getUpperBound(t),a=e.getLowerBound(n),o=e.getUpperBound(n);if(r.equals(i)||a.equals(o))return!1;let s=e.val(t),c=e.val(n);return[r,i].some(e=>e.equals(s))||[a,o].some(e=>e.equals(c))?!1:(this.isBelow?(this.a=uC(r,a),this.b=uC(i,o)):(this.a=uC(r,o),this.b=uC(i,a)),this.isPlStrictInterior=!1,!0)}getPoints(){W.tangentsBoxCorners&&this.setBoxCorners()||(this.getInitialPoints(),this.a=this.pushPoint(this.a),this.b=this.pushPoint(this.b))}isPlaneCorrectCut(e){let t=this.isBelow?P.one:P.minusOne,n=this.getTangPlane(e);return this.correctValue.sub(n).mul(t).isPositive()&&!n.sub(this.value).mul(t).isNegative()}},pC=class{core;constructor(e){this.core=e}tangentLemma(){let e=this.core;if(!W.tangents)return;let t=e.findBfcToRefine();if(t===void 0)return;let n=t.factorization.factors;new fC(e,uC(e.valFactor(n[0]),e.valFactor(n[1])),e.val(t.monic.variable),t.monic,t.factorization).run()}};const mC={EQ:`EQ`,LT:`GT`,GT:`LT`},hC=e=>mC[e];var gC=class{pm;cache;hooks;atoms=[];refCounts=[];nextBoolVar=0;freeBoolVars=[];ineqAtoms=/* @__PURE__ */ new Map;rootAtoms=/* @__PURE__ */ new Map;rootKeys=/* @__PURE__ */ new Map;constructor(e,t,n=null){this.pm=e,this.cache=t,this.hooks=n,this.mkBoolVar()}mkBoolVar(){let e=this.freeBoolVars.pop()??this.nextBoolVar++;return this.atoms[e]=null,this.refCounts[e]=0,this.hooks?.onMk(e),e}getDegree(e){if(!(`polynomials`in e))return this.pm.degree(e.polynomial,e.maxVar);let t=0;for(let n of e.polynomials)t=Math.max(t,this.pm.degree(n,e.maxVar));return t}reinitCache(){for(let e of this.atoms)if(e!=null){if(`polynomials`in e){let t=0;for(let n of e.polynomials)this.cache.mkUnique(n),t=Math.max(t,this.pm.maxVar(n));e.maxVar=t}else this.cache.mkUnique(e.polynomial),e.maxVar=this.pm.maxVar(e.polynomial)}}getAtom(e){return this.atoms[e>>1]??null}getMaxVar(e){return this.getAtom(e)?.maxVar??-1}incRef(e){let t=e>>1;this.atoms[t]!==null&&this.atoms[t]!==void 0&&this.refCounts[t]++}decRef(e){let t=e>>1,n=this.atoms[t];n!=null&&(--this.refCounts[t]>0||(`polynomials`in n?this.ineqAtoms.delete(this.getIneqKey(n)):(this.rootAtoms.delete(this.rootKeys.get(t)),this.rootKeys.delete(t)),this.atoms[t]=null,this.hooks?.onDelete(t),this.freeBoolVars.push(t)))}getIneqKey(e){return`${e.kind},${e.polynomials.map((t,n)=>`${t.id}${e.isEven[n]?`e`:`o`}`).join(`,`)}`}getRootKey(e){return`${e.kind},${e.maxVar},${e.index},${e.polynomial.id}`}mkIneqAtom(e,t,n){let r=1,i=-1,a=t.map((e,t)=>{let a=this.pm.flipSignIfLmNeg(e);a!==e&&!n[t]&&(r=-r);let o=this.pm.maxVar(a);return(o>i||i===-1)&&(i=o),this.cache.mkUnique(a)}),o={kind:r<0?hC(e):e,boolVar:0,maxVar:i,polynomials:a,isEven:[...n]},s=this.getIneqKey(o),c=this.ineqAtoms.get(s);return c===void 0?(o.boolVar=this.mkBoolVar(),this.atoms[o.boolVar]=o,this.ineqAtoms.set(s,o),o.boolVar):c.boolVar}mkIneqLiteral(e,t,n){let r=1n,i=!0;for(let[e,a]of t.entries()){if(!this.pm.isConst(a)){i=!1;continue}if(this.pm.isZero(a)){r=0n,i=!0;break}let t=a.as[0];r*=t,n[e]&&t<0n&&(r=-r)}return i?r>0n&&e===`GT`||r<0n&&e===`LT`||r===0n&&e===`EQ`?0:1:2*this.mkIneqAtom(e,t,n)}mkRootAtom(e,t,n,r){let i={kind:e,boolVar:0,maxVar:t,index:n,polynomial:this.cache.mkUnique(this.pm.flipSignIfLmNeg(r))},a=this.getRootKey(i),o=this.rootAtoms.get(a);return o===void 0?(i.boolVar=this.mkBoolVar(),this.atoms[i.boolVar]=i,this.rootAtoms.set(a,i),this.rootKeys.set(i.boolVar,a),i.boolVar):o.boolVar}},_C=class{table;literals=[];constructor(e){this.table=e}get size(){return this.literals.length}push(e){this.table.incRef(e),this.literals.push(e)}set(e,t){this.table.incRef(t),this.table.decRef(this.literals[e]),this.literals[e]=t}shrink(e){for(let t of this.literals.slice(e))this.table.decRef(t);this.literals.length=e}reset(){this.shrink(0)}},vC=class{table;literal=0;constructor(e){this.table=e}set(e){this.table.incRef(e),this.table.decRef(this.literal),this.literal=e}},yC=class{am;rand=new Kg(0);constructor(e){this.am=e}setSeed(e){this.rand=new Kg(e)}mk(e,t,n,r,i,a){return{intervals:[{isLowerOpen:e,lower:t===null?null:this.am.copy(t),isUpperOpen:n,upper:r===null?null:this.am.copy(r),justification:i,clause:a}],isFull:t===null&&r===null}}compareLowerLower(e,t){if(e.lower===null)return t.lower===null?0:-1;if(t.lower===null)return 1;let n=this.am.compare(e.lower,t.lower);return n===0?e.isLowerOpen===t.isLowerOpen?0:e.isLowerOpen?1:-1:n}compareUpperUpper(e,t){if(e.upper===null)return t.upper===null?0:1;if(t.upper===null)return-1;let n=this.am.compare(e.upper,t.upper);return n===0?e.isUpperOpen===t.isUpperOpen?0:e.isUpperOpen?-1:1:n}compareUpperLower(e,t){if(e.upper===null||t.lower===null)return 1;let n=this.am.compare(e.upper,t.lower);return n===0?!e.isUpperOpen&&!t.isLowerOpen?0:-1:n}isAdjacent(e,t){return this.am.compare(e.upper,t.lower)===0&&(!e.isUpperOpen||!t.isLowerOpen)}copyInterval(e,t={isOpen:e.isUpperOpen,value:e.upper}){return{isLowerOpen:e.isLowerOpen,lower:e.lower===null?null:this.am.copy(e.lower),isUpperOpen:t.isOpen,upper:t.value===null?null:this.am.copy(t.value),justification:e.justification,clause:null}}mkUnion(e,t){if(e===null||e===t)return t;if(t===null||e.isFull)return e;if(t.isFull)return t;let n=[],r=0,i=0;for(;r<e.intervals.length&&i<t.intervals.length;){let a=e.intervals[r],o=t.intervals[i],s=this.compareLowerLower(a,o),c=this.compareUpperUpper(a,o);if(s<=0){if(c===0)n.push(this.copyInterval(a)),r++,i++;else if(c>0)i++;else{let e=this.compareUpperLower(a,o);e<0?n.push(this.copyInterval(a)):e===0?s!==0&&n.push(this.copyInterval(a,{isOpen:!0,value:a.upper})):s!==0&&n.push(this.copyInterval(a,{isOpen:!o.isLowerOpen,value:o.lower})),r++}}else if(c===0)n.push(this.copyInterval(o)),r++,i++;else if(c<0)r++;else{let e=this.compareUpperLower(o,a);e<0?n.push(this.copyInterval(o)):e===0?n.push(this.copyInterval(o,{isOpen:!0,value:o.upper})):n.push(this.copyInterval(o,{isOpen:!a.isLowerOpen,value:a.lower})),i++}}for(;r<e.intervals.length;r++)n.push(this.copyInterval(e.intervals[r]));for(;i<t.intervals.length;i++)n.push(this.copyInterval(t.intervals[i]));let a=[n[0]];for(let e of n.slice(1)){let t=a[a.length-1];t.justification===e.justification&&this.isAdjacent(t,e)?(t.isUpperOpen=e.isUpperOpen,t.upper=e.upper):a.push(e)}let o=a[0].lower!==null||a[a.length-1].upper!==null;for(let e=0;e<a.length-1&&!o;e++)this.isAdjacent(a[e],a[e+1])||(o=!0);return{intervals:a,isFull:!o}}isFull(e){return e!==null&&e.isFull}subset(e,t){if(e===t||e===null)return!0;if(t===null)return!1;if(t.isFull)return!0;if(e.isFull)return!1;let n=0,r=0;for(;n<e.intervals.length&&r<t.intervals.length;){let i=e.intervals[n];if(this.compareLowerLower(i,t.intervals[r])<0)return!1;for(;r<t.intervals.length;){let e=t.intervals[r],a=this.compareUpperUpper(i,e);if(a===0){n++,r++;break}if(a<0){n++;break}if(this.compareUpperLower(e,i)<0){r++;break}if(r===t.intervals.length-1||!this.isAdjacent(e,t.intervals[r+1]))return!1;r++}}return n===e.intervals.length}getJustifications(e){let t=[],n=[];for(let r of e?.intervals??[])t.includes(r.justification)||(t.push(r.justification),r.clause!==null&&n.push(r.clause));return{literals:t,clauses:n}}pickInComplement(e,t){if(e===null)return new V(P.zero);let n=new V(P.zero),r=!0;for(let t of e.intervals){let e=this.compareIntervalWithZero(t,n);if(e===0){r=!1;break}if(e>0)break}if(r)return n;let i=e.intervals,a=i[i.length-1],o=0,s=null;if(a.upper!==null&&(o++,s=this.am.intGt(a.upper),!t)||i[0].lower!==null&&(o++,s=this.am.intLt(i[0].lower),!t))return s;for(let e=1;e<i.length;e++)if(this.am.compare(i[e-1].upper,i[e].lower)<0&&(o++,(o===1||this.rand.next()%o===0)&&(s=this.am.select(i[e-1].upper,i[e].lower)),!t))return s;if(s!==null)return s;let c=null;for(let e=1;e<i.length;e++){let t=i[e-1].upper;if(i[e-1].isUpperOpen&&i[e].isLowerOpen){if(this.am.isRational(t))return this.am.copy(t);c??=t}}return this.am.copy(c)}compareIntervalWithZero(e,t){if(e.upper!==null){let n=this.am.compare(e.upper,t);if(n<0||n===0&&e.isUpperOpen)return-1}if(e.lower!==null){let n=this.am.compare(e.lower,t);if(n>0||n===0&&e.isLowerOpen)return 1}return 0}findComplementSup(e){if(e===null||e.intervals[e.intervals.length-1].upper!==null)return null;for(let t=e.intervals.length-1;;t--){let n=e.intervals[t];if(n.lower===null)return null;let r=t>0?e.intervals[t-1]:null;if(r===null||this.am.compare(r.upper,n.lower)<0||n.isLowerOpen&&r.isUpperOpen)return t}}pickMaxInComplement(e){let t=this.findComplementSup(e);if(t===null)return null;let n=e.intervals[t];return n.isLowerOpen?this.am.copy(n.lower):t===0?this.am.intLt(n.lower):this.am.select(e.intervals[t-1].upper,n.lower)}queryMaxInComplement(e){let t=this.findComplementSup(e);if(t===null)return null;let n=e.intervals[t];return{sup:this.am.copy(n.lower),isAttained:n.isLowerOpen}}};const bC=e=>e.kind===`EQ`||e.kind===`LT`||e.kind===`GT`;var xC=class{am;sections=[];sortedSections=[];polynomialSections=[];polynomialSigns=[];infos=[];constructor(e){this.am=e}mkSection(e,t){return this.sections.push({root:this.am.copy(e),position:t}),this.sections.length-1}merge(e){let t=[],n=[],r=0,i=0;for(;r<this.sortedSections.length&&i<e.length;){let a=this.sortedSections[r],o=this.sections[a],s=this.am.compare(o.root,e[i]);if(s<=0)n.push(a),s===0&&(t.push(a),i++),o.position=n.length-1,r++;else{let r=this.mkSection(e[i],n.length);n.push(r),t.push(r),i++}}for(;r<this.sortedSections.length;r++)this.sections[this.sortedSections[r]].position=n.length,n.push(this.sortedSections[r]);for(;i<e.length;i++){let r=this.mkSection(e[i],n.length);n.push(r),t.push(r)}return this.sortedSections=n,t}add(e,t){let n=e.length===0?[]:this.merge(e);this.infos.push({rootCount:e.length,firstSection:this.polynomialSections.length,firstSign:this.polynomialSigns.length}),this.polynomialSigns.push(...t),this.polynomialSections.push(...n)}addConst(e){this.infos.push({rootCount:0,firstSection:this.polynomialSections.length,firstSign:this.polynomialSigns.length}),this.polynomialSigns.push(e)}get cellCount(){return this.sections.length*2+1}isSection(e){return e%2==1}getRoot(e){return this.sections[this.sortedSections[Math.floor(e/2)]].root}getCellId(e,t){return this.sections[this.polynomialSections[e.firstSection+t]].position*2+1}getSign(e,t){return this.polynomialSigns[e.firstSign+t]}signAt(e,t){let n=this.infos[e],r=n.rootCount;if(r<8){let e=0;for(;e<r;e++){let r=this.getCellId(n,e);if(r===t)return 0;if(r>t)break}return this.getSign(n,e)}let i=this.getCellId(n,0),a=this.getCellId(n,r-1);if(t<i)return this.getSign(n,0);if(t===i||t===a)return 0;if(t>a)return this.getSign(n,r);let o=0,s=r-1;for(;s!==o+1;){let e=o+Math.floor((s-o)/2),r=this.getCellId(n,e);if(r===t)return 0;t<r?s=e:o=e}return this.getSign(n,o+1)}};const SC=(e,t,n)=>{let r=e===0&&(t===`EQ`||t===`ROOT_EQ`||t===`ROOT_LE`||t===`ROOT_GE`)||e<0&&(t===`LT`||t===`ROOT_LT`||t===`ROOT_LE`)||e>0&&(t===`GT`||t===`ROOT_GT`||t===`ROOT_GE`);return n?!r:r},CC=(e,t)=>2*e.boolVar+ +!!t;var wC=class{pm;am;assignment;ism;constructor(e,t,n){this.pm=e,this.am=t,this.assignment=n,this.ism=new yC(t)}getValuesWithout(e){return this.assignment.map((t,n)=>n===e?void 0:t)}eval(e,t){return bC(e)?this.evalIneq(e,t):this.evalRoot(e,t)}evalIneq(e,t){let n=1;for(let[t,r]of e.polynomials.entries()){let i=this.am.evalSignAt(this.pm,r,this.assignment);if(n*=e.isEven[t]&&i<0?1:i,n===0)break}return SC(n,e.kind,t)}evalRoot(e,t){let n=this.am.isolateRoots(this.pm,e.polynomial,this.getValuesWithout(e.maxVar));if(e.index>n.length)return t;let r=this.am.compare(this.assignment[e.maxVar],n[e.index-1]);return SC(r,e.kind,t)}infeasibleIntervals(e,t,n){return bC(e)?this.getIneqInfeasibleIntervals(e,t,n):this.getRootInfeasibleIntervals(e,t,n)}addToTable(e,t,n){if(this.pm.maxVar(e)<t){n.addConst(this.am.evalSignAt(this.pm,e,this.assignment));return}let r=this.am.isolateRootsWithSigns(this.pm,e,this.getValuesWithout(t));n.add(r.roots,r.signs)}getIneqInfeasibleIntervals(e,t,n){let r=new xC(this.am);for(let t of e.polynomials)this.addToTable(t,e.maxVar,r);let i=CC(e,t),a=t=>{let n=1;for(let i=0;i<e.polynomials.length;i++){let a=r.signAt(i,t);if(n*=e.isEven[i]&&a<0?1:a,n===0)break}return n},o=null,s=!0,c=!0,l=null,u=r.cellCount;for(let d=0;d<u;d++)if(SC(a(d),e.kind,t)){if(!s){let e=this.ism.mk(c,l,r.isSection(d),r.getRoot(r.isSection(d)?d:d-1),i,n);o=this.ism.mkUnion(o,e),s=!0}}else if(s&&=(d===0?(u===1&&(o=this.ism.mk(!0,null,!0,null,i,n)),c=!0,l=null):(c=!r.isSection(d),l=r.getRoot(r.isSection(d)?d:d-1)),!1),d===u-1){let e=this.ism.mk(c,l,!0,null,i,n);o=this.ism.mkUnion(o,e)}return o}getRootInfeasibleIntervals(e,t,n){let r=CC(e,t),i=this.am.isolateRoots(this.pm,e.polynomial,this.getValuesWithout(e.maxVar));if(e.index>i.length)return t?null:this.ism.mk(!0,null,!0,null,r,n);let a=i[e.index-1],o=(e,t,i,a)=>this.ism.mk(e,t,i,a,r,n);switch(e.kind){case`ROOT_EQ`:return t?o(!1,a,!1,a):this.ism.mkUnion(o(!0,null,!0,a),o(!0,a,!0,null));case`ROOT_LT`:return t?o(!0,null,!0,a):o(!1,a,!0,null);case`ROOT_GT`:return t?o(!0,a,!0,null):o(!0,null,!1,a);case`ROOT_LE`:return t?o(!0,null,!1,a):o(!0,a,!0,null);case`ROOT_GE`:return t?o(!1,a,!0,null):o(!0,null,!0,a)}}};const TC={spanningTreeThreshold:4,isWitnessSubsLc:!0,isWitnessSubsDisc:!0},EC=(e,t)=>{let n=Array.from({length:e},(e,t)=>t);for(let r=1;r<e;r*=2){let i=[];for(let a=0;a<e;a+=2*r){let o=Math.min(a+r,e),s=Math.min(a+2*r,e),c=a,l=o;for(;c<o&&l<s;)i.push(t(n[l],n[c])?n[l++]:n[c++]);for(;c<o;)i.push(n[c++]);for(;l<s;)i.push(n[l++])}n=i}return n};var DC=class{pm;cache;polynomials=[];inSet=/* @__PURE__ */ new Set;constructor(e,t){this.pm=e,this.cache=t}get isEmpty(){return this.polynomials.length===0}reset(){this.polynomials=[],this.inSet.clear()}contains(e){return this.inSet.has(e.id)}insert(e){if(this.inSet.has(e.id))return e;if(this.cache.contains(e))return this.inSet.add(e.id),this.polynomials.push(e),e;let t=this.pm.isZero(e)||this.pm.isConst(e)?e:this.pm.pp(e,this.pm.maxVar(e)),n=this.cache.mkUnique(this.pm.flipSignIfLmNeg(t));return this.inSet.has(n.id)||(this.inSet.add(n.id),this.polynomials.push(n)),n}getMaxVar(){let e=-1;for(let t of this.polynomials){let n=this.pm.maxVar(t);(e===-1||n>e)&&(e=n)}return e}extractMaxPolys(e){e.length=0;let t=this.getMaxVar();return this.extractPolysAtLevel(t,e),t}extractPolysAtLevel(e,t){let n=[];for(let r of this.polynomials)this.pm.maxVar(r)===e?(t.push(r),this.inSet.delete(r.id)):n.push(r);this.polynomials=n}},OC=class{pm;am;cache;sample;maxVar;isLinear;params;intervals;todo;level=0;levelPolys=[];witnesses=[];hasRoots=[];rootFunctions=[];pairs=/* @__PURE__ */ new Map;sideMask=[];isLcOmitted=[];lowerRf=-1;upperRf=-1;constructor(e,t,n,r,i,a,o){this.pm=e,this.am=t,this.cache=n,this.sample=r,this.maxVar=i,this.isLinear=a,this.params=o,this.todo=new DC(e,n),this.intervals=Array.from({length:i},()=>({isSection:!1,lower:null,lowerIndex:0,upper:null,upperIndex:0}))}getSign(e){return this.am.evalSignAt(this.pm,e,this.sample)}getValuesWithout(e){return this.sample.map((t,n)=>n===e?void 0:t)}requestFactorized(e){if(!(e===null||this.pm.isConst(e)))for(let t of this.cache.factor(e))this.pm.isConst(t)||this.todo.insert(t)}getFirstPsc(e,t,n){for(let r of this.cache.pscChain(e,t,n))if(!this.pm.isZero(r))return this.pm.isConst(r)?null:r;return null}getPscDiscriminant(e,t){return this.pm.isConst(e)||this.pm.degree(e,t)<2?null:this.getFirstPsc(e,this.pm.derivative(e,t),t)}handleNullifiedPoly(e){let t=this.pm.degree(e,this.level);for(let n=0;n<=t;n++)this.requestFactorized(this.pm.coeff(e,this.level,n));let n=[{polynomial:e,minVar:0}];for(;n.length>0;){let e=[];for(let t of n){let n=this.pm.maxVar(t.polynomial);if(n!==-1)for(let r=t.minVar;r<=n;r++){if(this.pm.degree(t.polynomial,r)===0)continue;let n=this.pm.derivative(t.polynomial,r);if(!this.pm.isConst(n)){if(this.getSign(n)!==0){this.requestFactorized(n);return}e.push({polynomial:n,minVar:r})}}}for(let t of e)this.requestFactorized(t.polynomial);n=e}}chooseNonzeroCoeff(e,t){let n=this.pm.degree(e,t);for(let r=0;r<=n;r++){let n=this.pm.coeff(e,t,r);if(!this.pm.isZero(n)&&this.pm.isConst(n))return n}let r=null;for(let i=0;i<=n;i++){let n=this.pm.coeff(e,t,i);if(this.pm.isZero(n)||this.getSign(n)===0)continue;let a=this.pm.totalDegree(n),o=r===null?0:this.pm.totalDegree(r);(r===null||a<o||a===o&&(n.size<r.size||n.size===r.size&&this.pm.maxVar(n)<this.pm.maxVar(r)))&&(r=n)}return r}addProjectionForPoly(e,t,n,r,i){let a=n!==null&&!this.pm.isConst(n);if(r){let n=this.pm.lc(e,t);this.requestFactorized(n),a&&this.params.isWitnessSubsDisc&&this.getSign(n)!==0&&(a=!1)}if(i){let n=this.getPscDiscriminant(e,t);n!==null&&(this.requestFactorized(n),a&&this.params.isWitnessSubsDisc&&this.getSign(n)!==0&&(a=!1))}a&&this.requestFactorized(n)}addPair(e,t){let n=this.rootFunctions[e].psIndex,r=this.rootFunctions[t].psIndex;n!==r&&this.addPsPair(n,r)}addPsPair(e,t){let n=e<t?[e,t]:[t,e];this.pairs.set(`${n[0]},${n[1]}`,n)}getSortedPairs(){return[...this.pairs.values()].sort((e,t)=>e[0]===t[0]?e[1]-t[1]:e[0]-t[0])}computeSideMask(){if(this.lowerRf!==-1){for(;this.sideMask.length<this.levelPolys.length;)this.sideMask.push(0);this.rootFunctions.forEach((e,t)=>{this.sideMask[e.psIndex]|=t<=this.lowerRf?1:2})}}getBoundIndex(e){return e===-1?-1:this.rootFunctions[e].psIndex}computeOmitLcBothSides(e){if(this.isLcOmitted=this.levelPolys.map(()=>!1),this.rootFunctions.length===0||this.pairs.size===0||this.sideMask.length===0)return;let t=this.levelPolys.map(()=>0);for(let e of this.pairs.values())t[e[0]]++,t[e[1]]++;let n=this.getBoundIndex(this.lowerRf),r=this.getBoundIndex(this.upperRf);for(let i=0;i<this.levelPolys.length;i++)this.sideMask[i]===3&&(e&&t[i]!==1||i!==n&&i!==r&&(this.isLcOmitted[i]=!0))}fillRelationSector(){if(this.lowerRf!==-1)for(let e=0;e<this.lowerRf;e++)this.addPair(e,this.lowerRf);if(this.upperRf!==-1)for(let e=this.upperRf+1;e<this.rootFunctions.length;e++)this.addPair(this.upperRf,e);this.lowerRf!==-1&&this.upperRf!==-1&&this.addPair(this.lowerRf,this.upperRf)}fillRelationSection(){for(let e=0;e<this.lowerRf;e++)this.addPair(e,this.lowerRf);for(let e=this.lowerRf+1;e<this.rootFunctions.length;e++)this.addPair(this.lowerRf,e)}buildBothSideSpanningTree(){let e=this.levelPolys.map(()=>-1),t=this.levelPolys.map(()=>-1);for(let t=0;t<=this.lowerRf;t++)e[this.rootFunctions[t].psIndex]=t;for(let e=this.upperRf;e<this.rootFunctions.length;e++)t[this.rootFunctions[e].psIndex]=e;let n=this.levelPolys.map((n,r)=>({psIndex:r,lowerRf:e[r],upperRf:t[r]})).filter(e=>this.sideMask[e.psIndex]===3).sort((e,t)=>e.lowerRf-t.lowerRf);for(let e=0;e<n.length-1;e++){let t=e+1;for(let r=e+2;r<n.length;r++)n[r].upperRf<n[t].upperRf&&(t=r);this.addPsPair(n[e].psIndex,n[t].psIndex)}}fillRelationSpanningTree(){this.buildBothSideSpanningTree();let e=e=>this.sideMask[this.rootFunctions[e].psIndex]===3;for(let t=0;t<this.lowerRf;t++)e(t)||this.addPair(t,this.lowerRf);for(let t=this.upperRf+1;t<this.rootFunctions.length;t++)e(t)||this.addPair(this.upperRf,t);let t=-1;for(let n=0;n<this.lowerRf;n++)e(n)&&(t=n);let n=-1;for(let t=this.upperRf+1;t<this.rootFunctions.length;t++)if(e(t)){n=t;break}t!==-1&&this.addPair(t,this.lowerRf),n!==-1&&this.addPair(this.upperRf,n),this.addPair(this.lowerRf,this.upperRf)}isolateRootsAroundSample(e,t,n,r){let i=this.levelPolys[e],a=this.getValuesWithout(this.level),o=(t,n)=>({value:this.am.copy(t),polynomial:i,index:n,psIndex:e});if(t.value instanceof P){let e=this.am.isolateRootsClosest(this.pm,i,a,t.value);return e.roots.forEach((i,a)=>{(this.am.compare(i,t)<=0?n:r).push(o(i,e.indices[a]))}),e.roots.length>0}let s=this.am.isolateRoots(this.pm,i,a),c=-1,l=-1,u=!1;for(let[e,n]of s.entries()){let r=this.am.compare(n,t);if(r>0){l=e;break}if(c=e,r===0){u=!0;break}}return c!==-1&&(n.push(o(s[c],c+1)),u)||l!==-1&&r.push(o(s[l],l+1)),s.length>0}isRootFunctionLess(e,t,n){if(e.polynomial===t.polynomial)return e.index<t.index;let r=this.am.compare(e.value,t.value);if(r!==0)return r<0;let i=this.pm.degree(e.polynomial,this.level),a=this.pm.degree(t.polynomial,this.level);return i===a?e.polynomial.id<t.polynomial.id:n?i>a:i<a}sortRootFunctions(e,t){return EC(e.length,(n,r)=>this.isRootFunctionLess(e[n],e[r],t)).map(t=>e[t])}setIntervalFromRootPartition(e,t){let n=this.intervals[this.level],r=this.rootFunctions;if(t===0){this.lowerRf=-1,this.upperRf=0,n.upper=r[0].polynomial,n.upperIndex=r[0].index;return}this.lowerRf=t-1;let i=r[t-1];n.lower=i.polynomial,n.lowerIndex=i.index,this.am.compare(i.value,e)===0?(n.isSection=!0,this.upperRf=this.lowerRf):t<r.length&&(this.upperRf=this.lowerRf+1,n.upper=r[t].polynomial,n.upperIndex=r[t].index)}addLinearPolyFromRoot(e,t){let n=e.value,r=this.pm.sub(this.pm.mul(this.pm.mkConst(n.den),this.pm.mkVar(this.level)),this.pm.mkConst(n.num)),i=this.intervals[this.level];return t?(i.lower=r,i.lowerIndex=1):(i.upper=r,i.upperIndex=1),this.levelPolys.push(r),this.hasRoots.push(!0),this.witnesses.push(this.chooseNonzeroCoeff(r,this.level)),r}addLinearApproximations(e){let t=this.intervals[this.level],n=(e,t)=>({value:this.am.copy(t),polynomial:e,index:1,psIndex:this.levelPolys.length-1});if(t.isSection){if(!this.am.isRational(e))throw new a(`a linear cell around an irrational section`);if(this.pm.totalDegree(t.lower)>1){let t=this.addLinearPolyFromRoot(e,!0);this.rootFunctions.splice(this.lowerRf,0,n(t,e))}}else{if(t.lower!==null&&this.pm.totalDegree(t.lower)>1){let t=this.am.select(this.rootFunctions[this.lowerRf].value,e),r=this.addLinearPolyFromRoot(t,!0);this.rootFunctions.splice(this.lowerRf+1,0,n(r,t)),this.lowerRf++,this.upperRf!==-1&&this.upperRf++}if(t.upper!==null&&this.pm.totalDegree(t.upper)>1){let t=this.am.select(e,this.rootFunctions[this.upperRf].value),r=this.addLinearPolyFromRoot(t,!1);this.rootFunctions.splice(this.upperRf,0,n(r,t))}}}buildInterval(){this.rootFunctions=[],this.pairs.clear(),Object.assign(this.intervals[this.level],{isSection:!1,lower:null,lowerIndex:0,upper:null,upperIndex:0}),this.lowerRf=-1,this.upperRf=-1;let e=this.sample[this.level],t=[],n=[];return this.hasRoots=this.levelPolys.map((r,i)=>this.isolateRootsAroundSample(i,e,t,n)),t.length===0&&n.length===0?!1:(this.rootFunctions=[...this.sortRootFunctions(t,!0),...this.sortRootFunctions(n,!1)],this.setIntervalFromRootPartition(e,t.length),this.isLinear&&this.addLinearApproximations(e),this.computeSideMask(),!0)}addRelationResultants(){for(let e of this.getSortedPairs())this.requestFactorized(this.getFirstPsc(this.levelPolys[e[0]],this.levelPolys[e[1]],this.level))}addAdjacentRootResultants(){let e=[],t=this.getValuesWithout(this.maxVar);if(this.hasRoots=this.levelPolys.map(n=>{let r=this.am.isolateRoots(this.pm,n,t);for(let t of r)e.push({root:this.am.copy(t),polynomial:n});return r.length>0}),e.length<2)return;let n=EC(e.length,(t,n)=>this.am.compare(e[t].root,e[n].root)<0),r=/* @__PURE__ */ new Set;for(let t=0;t+1<n.length;t++){let i=e[n[t]].polynomial,a=e[n[t+1]].polynomial;if(i===a)continue;let[o,s]=i.id<a.id?[i,a]:[a,i],c=`${o.id},${s.id}`;r.has(c)||(r.add(c),this.requestFactorized(this.getFirstPsc(o,s,this.maxVar)))}}addSectionProjections(){let e=this.intervals[this.level].lower,t=new Set(this.rootFunctions.map(e=>e.psIndex));this.levelPolys.forEach((n,r)=>{let i=n===e||!t.has(r);this.addProjectionForPoly(n,this.level,this.witnesses[r],i,!0)})}addSectorProjections(){this.levelPolys.forEach((e,t)=>{let n=!(this.isLcOmitted[t]??!1),r=this.witnesses[t];n&&r!==null&&!this.pm.isConst(r)&&this.params.isWitnessSubsLc&&this.getSign(this.pm.lc(e,this.level))!==0&&(r=null),this.addProjectionForPoly(e,this.level,r,n,!0)})}shouldUseSpanningTree(){if(this.params.spanningTreeThreshold<2||this.rootFunctions.length<4||this.sideMask.length===0||this.lowerRf===-1||this.upperRf===-1||this.getBoundIndex(this.lowerRf)===this.getBoundIndex(this.upperRf))return!1;let e=0;for(let t=0;t<this.levelPolys.length;t++)if(this.sideMask[t]===3&&++e>=this.params.spanningTreeThreshold)return!0;return!1}processLevelWithMode(e,t){t&&(e===`section`?this.fillRelationSection():(e===`sector`?this.fillRelationSector():this.fillRelationSpanningTree(),this.computeSideMask(),this.computeOmitLcBothSides(e===`spanningTree`))),e===`section`?this.addSectionProjections():this.addSectorProjections(),this.addRelationResultants()}collectNonNullWitnesses(){this.witnesses=[];for(let e=0;e<this.levelPolys.length;e++){let t=this.levelPolys[e],n=this.chooseNonzeroCoeff(t,this.level);n===null&&this.handleNullifiedPoly(t),this.witnesses.push(n),e+1===this.levelPolys.length&&this.todo.extractPolysAtLevel(this.level,this.levelPolys)}}processLevel(){this.isLcOmitted=[],this.pairs.clear(),this.sideMask=[],this.collectNonNullWitnesses();let e=this.buildInterval(),t=this.intervals[this.level].isSection?`section`:this.shouldUseSpanningTree()?`spanningTree`:`sector`;this.processLevelWithMode(t,e)}processTopLevel(){this.collectNonNullWitnesses(),this.addAdjacentRootResultants(),this.levelPolys.forEach((e,t)=>{let n=this.pm.lc(e,this.maxVar),r=this.hasRoots[t]||this.pm.isZero(n)||this.getSign(n)===0;r||(this.witnesses[t]=null),this.addProjectionForPoly(e,this.maxVar,this.witnesses[t],r,!0)})}singleCell(e){if(this.maxVar===0)return this.intervals;for(let t of e)this.requestFactorized(t);if(this.todo.isEmpty)return this.intervals;for(this.todo.getMaxVar()===this.maxVar&&(this.level=this.todo.extractMaxPolys(this.levelPolys),this.processTopLevel());!this.todo.isEmpty;)this.level=this.todo.extractMaxPolys(this.levelPolys),this.processLevel();return this.intervals}};const kC=(e,t,n,r,i,a,o,s=TC)=>new OC(e,t,n,a,i,o,s).singleCell(r);var AC=class{};const jC={ROOT_EQ:{kind:`EQ`,isNeg:!1},ROOT_LT:{kind:`LT`,isNeg:!1},ROOT_GT:{kind:`GT`,isNeg:!1},ROOT_LE:{kind:`GT`,isNeg:!0},ROOT_GE:{kind:`LT`,isNeg:!0}},MC=e=>{e.isLcAdded=!0,e.isLcIneqAdded=!0},NC=e=>{e.isLcAdded||(e.isLcAdded=!0,e.isLcIneqAdded=!1)},PC=e=>e===0?`EQ`:e<0?`LT`:`GT`;var FC=class{pm;am;cache;context;result=null;added=/* @__PURE__ */ new Set;todo;lowerStagePolys=[];core;isAddAllCoeffs=!1;isFullDimensional=!1;constructor(e,t,n,r){this.pm=e,this.am=t,this.cache=n,this.context=r,this.todo=new DC(e,n),this.core=new _C(r.atoms)}getSign(e){return this.am.evalSignAt(this.pm,e,this.context.sample)}getAtom(e){return this.context.atoms.getAtom(e)}addLiteral(e){e===1||this.added.has(e)||(this.added.add(e),this.result.push(e))}resetResult(){this.added.clear(),this.result=null}collectPolys(e){return e.flatMap(e=>{let t=this.getAtom(e);return bC(t)?t.polynomials:[t.polynomial]})}getMaxVarOfPolys(e){let t=-1;for(let n of e){let e=this.pm.maxVar(n);(t===-1||e>t)&&(t=e)}return t}getMaxVarOfLiterals(e){let t=-1;for(let n of e){let e=this.context.atoms.getAtom(n);e!==null&&(t===-1||e.maxVar>t)&&(t=e.maxVar)}return t}addAssumption(e,t,n=!1){let r=this.context.atoms.mkIneqAtom(e,[t],[!1]);this.addLiteral(2*r+ +!n)}findSectionRoot(e,t){let n=this.context.sample[t],r=this.context.sample.map((e,n)=>n===t?void 0:e),i=this.am.isolateRoots(this.pm,e,r);for(let[e,t]of i.entries()){let r=this.am.compare(n,t);if(r===0)return e+1;if(r<0)return null}return null}addZeroAssumption(e){let t=this.pm.squareFree(e);if(this.pm.isConst(t))return;let n=this.pm.maxVar(t),r=this.findSectionRoot(t,n);r!==null&&this.addRootLiteral(`ROOT_EQ`,n,r,t)}elimVanishing(e){let t=e,n=this.pm.maxVar(t),r=this.pm.degree(t,n);for(;;){if(this.pm.isConst(t)||(r===0&&(n=this.pm.maxVar(t),r=this.pm.degree(t,n)),this.pm.isNonzeroConstCoeff(t,n,r)))return t;let e=this.insertFreshFactorsInTodo(this.pm.coeff(t,n,r)),i=this.pm.reduct(t,n,r);if(!this.pm.isZero(e)&&this.getSign(e)!==0)return t;if(r===0){if(this.isAddAllCoeffs)return this.addZeroAssumption(e),this.pm.zero;throw this.isAddAllCoeffs=!0,new AC}this.addZeroAssumption(e),r--,t=i}}elimVanishingAll(e){return e.map(e=>this.elimVanishing(e)).filter(e=>!this.pm.isConst(e))}insertFreshFactorsInTodo(e){if(this.pm.isConst(e))return e;let t=this.elimVanishing(e);if(this.pm.isConst(t))return t;for(let e of this.cache.factor(t)){let t=this.elimVanishing(e);this.pm.isConst(t)||this.todo.insert(t)}return t}normalizeLiteral(e,t){if(!(e>>1))return e;let n=this.getAtom(e);if(!bC(n))return e;let r=(e&1)==1,i=[],a=[],o=1,s=!1;for(let[e,c]of n.polynomials.entries()){let l=this.pm.maxVar(c)===t?this.elimVanishing(c):c;if(this.pm.isConst(l)||this.pm.maxVar(l)<t){let t=this.getSign(l);if(this.pm.isConst(l)||(this.lowerStagePolys.push(l),t===0?this.addAssumption(`EQ`,l):n.isEven[e]?this.addAssumption(`EQ`,l,!0):this.addAssumption(PC(t),l)),t===0)return+(n.kind===`EQ`===r);t<0&&!n.isEven[e]&&(o=-o),s=!0}else l!==c&&(s=!0),a.push(n.isEven[e]),i.push(l)}if(i.length===0)return+((n.kind===`EQ`?!1:n.kind===`LT`?o<0:o>0)===r);if(!s)return e;let c=o<0?hC(n.kind):n.kind;return this.context.atoms.mkIneqLiteral(c,i,a)^+!!r}normalizeCore(e,t){let n=0;for(let r of e.literals){let i=this.normalizeLiteral(r,t);if(i!==0){if(i===1){e.reset();return}e.set(n++,i)}}e.shrink(n)}simplifyLiteral(e,t,n,r){let i=this.getAtom(e);if(!bC(i)||i.polynomials.length===1&&i.polynomials[0]===t.eq){r.set(e);return}let a=(e&1)==1,o=[],s=[],c=1,l=!1,u=(e,n)=>{t.isLcConst||(e%2==0||n||i.kind===`EQ`?NC(t):MC(t))};for(let[e,n]of i.polynomials.entries()){let d=i.isEven[e];if(this.pm.degree(n,t.variable)<t.degree){o.push(n),s.push(d);continue}l=!0;let f=this.pm.pseudoRemainder(n,t.eq,t.variable);f.steps%2==1&&!d&&t.lcSign<0&&(c=-c);let p=f.remainder;if(!this.pm.isConst(p)){o.push(p),s.push(d),u(f.steps,d);continue}let m=this.getSign(p);if(m===0){r.set(+(i.kind===`EQ`===a)),t.isLcConst||NC(t);return}u(f.steps,d),m<0&&!d&&(c=-c)}if(!l){r.set(e);return}let d=c<0?hC(i.kind):i.kind;r.set(this.context.atoms.mkIneqLiteral(d,o,s)^+!!a);let f=this.context.atoms.getMaxVar(r.literal);f===-1||f>=n?r.set(this.normalizeLiteral(r.literal,n)):this.context.getValue(r.literal)===1?r.set(e):(this.addLiteral(r.literal),r.set(0))}simplifyWithEq(e,t,n){let r=this.pm.maxVar(t),i=this.pm.degree(t,r),a=this.pm.coeff(t,r,i),o={eq:t,variable:r,degree:i,lc:a,lcSign:this.getSign(a),isLcConst:this.pm.isConst(a),isLcAdded:!1,isLcIneqAdded:!1},s=new vC(this.context.atoms);try{let t=!1,r=0;for(let i of e.literals)if(s.set(0),this.simplifyLiteral(i,o,n,s),s.literal===i)e.set(r++,i);else if(t=!0,s.literal!==0){if(s.literal===1){r=0;break}e.set(r++,s.literal)}return e.shrink(r),o.isLcAdded&&(o.isLcIneqAdded?this.addAssumption(o.lcSign<0?`LT`:`GT`,o.lc):this.addAssumption(`EQ`,o.lc,!0)),t}finally{s.set(0)}}selectEq(e,t){let n=null,r=1/0;for(let i of e.literals){if((i&1)==1)continue;let e=this.getAtom(i);if(!bC(e)||e.kind!==`EQ`||e.polynomials.length>1||e.isEven[0])continue;let a=this.pm.degree(e.polynomials[0],t);if(a<r&&(n=e.polynomials[0],r=a,r===1))break}return n}selectLowerStageEq(e,t){for(let n of e.literals){let e=this.getAtom(n);if(bC(e))for(let n of e.polynomials){let e=new Set(n.ms.flatMap(e=>[...e.vars]));for(let r of e){if(r>=t)continue;let e=this.context.var2eq[r]??null;if(e===null)continue;let i=e.polynomials[0],a=this.pm.degree(i,r);if(this.pm.isNonzeroConstCoeff(i,r,a)&&this.pm.degree(n,r)>=a)return e}}}return null}simplifyCore(e,t){for(;e.size>0;){let n=this.selectEq(e,t);if(n===null||!this.simplifyWithEq(e,n,t))break}for(;e.size>0;){let n=this.selectLowerStageEq(e,t);if(n===null)break;this.simplifyWithEq(e,n.polynomials[0],t),this.addLiteral(2*n.boolVar+1)}}addRootLiteral(e,t,n,r){if(this.mkLinearRoot(e,t,r)||this.mkQuadraticRoot(e,t,n,r))return;let i=this.context.atoms.mkRootAtom(e,t,n,r);this.addLiteral(2*i+1)}mkLinearRoot(e,t,n){let r=this.pm.getConstCoeff(n,t,1);return this.pm.degree(n,t)!==1||r===null?!1:(this.addLinearRoot(e,n,r<0n),!0)}addLinearRoot(e,t,n){let r=jC[e];this.addAssumption(r.kind,n?this.pm.neg(t):t,r.isNeg)}mkPlinearRoot(e,t,n){if(this.pm.degree(n,t)!==1)return!1;let r=this.pm.coeff(n,t,1),i=this.getSign(r);return i!==0&&(this.ensureSign(r),this.addLinearRoot(e,n,i<0),!0)}mkQuadraticRoot(e,t,n,r){if(this.pm.degree(r,t)!==2||n!==1&&n!==2)return!1;let i=this.pm.coeff(r,t,2),a=this.pm.coeff(r,t,1),o=this.pm.coeff(r,t,0),s=this.pm.sub(this.pm.mul(a,a),this.pm.mul(this.pm.mulConst(4n,i),o)),c=this.pm.mkVar(t),l=this.pm.normalize(this.pm.add(this.pm.mul(this.pm.mulConst(2n,i),c),a));return this.ensureSignQuad(s)<0?!1:this.ensureSignQuad(i)===0?this.mkPlinearRoot(e,t,this.pm.add(this.pm.mul(a,c),o)):(this.ensureSign(l),this.getSign(s)>0&&this.ensureSign(r),!0)}ensureSign(e){this.pm.isConst(e)||(this.addAssumption(PC(this.getSign(e)),e),this.insertFreshFactorsInTodo(e))}ensureSignQuad(e){let t=this.getSign(e);return this.pm.isConst(e)||(this.addAssumption(PC(t),e),this.insertFreshFactorsInTodo(e)),t}addCellLiterals(e,t,n){let r=kC(this.pm,this.am,this.cache,e,t,this.context.sample,n),i=this.isFullDimensional;for(let e of r)if(e.isSection){let t=e.lower;this.addRootLiteral(`ROOT_EQ`,this.pm.maxVar(t),e.lowerIndex,t)}else e.lower!==null&&this.addRootLiteral(i?`ROOT_GE`:`ROOT_GT`,this.pm.maxVar(e.lower),e.lowerIndex,e.lower),e.upper!==null&&this.addRootLiteral(i?`ROOT_LE`:`ROOT_LT`,this.pm.maxVar(e.upper),e.upperIndex,e.upper)}project(e,t){if(e.length!==0){this.todo.reset();for(let t of e)this.insertFreshFactorsInTodo(t);this.addCellLiterals([...this.todo.polynomials],t,!1)}}explainCore(e){if(e.length===0)return;let t=[...this.collectPolys(e),...this.lowerStagePolys],n=this.getMaxVarOfPolys(t);this.project(this.elimVanishingAll(t),n)}process(e){this.lowerStagePolys=[];let t=this.core;t.reset();for(let n of e)t.push(n);let n=this.getMaxVarOfLiterals(e);this.normalizeCore(t,n),this.simplifyCore(t,n),this.explainCore(t.literals),t.reset()}computeConflictExplanation(e,t){if(this.getMaxVarOfLiterals(e)===0&&this.context.sample[0]===void 0){t.reset();return}let n=this.isAddAllCoeffs,r=t.size;try{for(;;){this.result=t;try{this.process(e);return}catch(e){if(!(e instanceof AC))throw e;t.shrink(r)}finally{this.resetResult()}}}finally{this.isAddAllCoeffs=n}}computeLinearExplanation(e,t){this.result=t,this.lowerStagePolys=[];let n=this.collectPolys(e);try{n.length>0&&this.addCellLiterals(n,this.getMaxVarOfPolys(n)+1,!0)}finally{this.resetResult()}}};const IC=1/0,LC={kind:`decision`};var RC=class{limit;budget;pm=new mb;am=new Pb;cache=new hb(this.pm);bvalues=[];levels=[];justifications=[];bwatches=[];isDead=[];atoms=new gC(this.pm,this.cache,{onMk:e=>{this.bvalues[e]=0,this.levels[e]=1/0,this.justifications[e]=null,this.bwatches[e]=[],this.isDead[e]=!1},onDelete:e=>{this.isDead[e]=!0,this.bvalues[e]=0}});assignment=[];evaluator=new wC(this.pm,this.am,this.assignment);ism=this.evaluator.ism;clauses=[];learned=[];nextClauseId=0;isInt=[];watches=[];infeasible=[];var2eq=[];perm=[];invPerm=[];explain=new FC(this.pm,this.am,this.cache,{atoms:this.atoms,sample:this.assignment,getValue:e=>this.value(e),var2eq:this.var2eq});bk=0;xk=-1;scopeLevel=0;trail=[];marks=[];markCount=0;lemma=new _C(this.atoms);lazyClause=new _C(this.atoms);lemmaAssumptions=null;randomSeed=0;isReordered=!1;maxConflicts=1/0;stats={conflicts:0,restarts:0,propagations:0,decisions:0,stages:0,irrationalAssignments:0};steps=0;constructor(e=null,t=1/0){this.limit=e,this.budget=t,this.mkClause([0],!1,null)}checkpoint(){if(this.steps++,this.limit!==null&&!this.limit.inc()||this.steps>this.budget)throw new s}mkVar(e){let t=this.isInt.length;return this.isInt.push(e),this.watches.push([]),this.infeasible.push(null),this.var2eq.push(null),this.perm.push(t),this.invPerm.push(t),t}mkIneqLiteral(e,t,n){return this.atoms.mkIneqLiteral(e,t,n)}getAtom(e){return this.atoms.getAtom(e)}mkExternalClause(e,t){this.mkClause(e,!1,t===null?null:Z_(t))}getValue(e){return this.assignment[e]??new V(P.zero)}getCore(){return $_([this.lemmaAssumptions])}getMaxVar(e){let t=-1;for(let n of e.literals){let e=this.atoms.getAtom(n);e!==null&&(t===-1||e.maxVar>t)&&(t=e.maxVar)}return t}getClauseDegree(e){if(this.getMaxVar(e)===-1)return 0;let t=0;for(let n of e.literals){let e=this.atoms.getAtom(n);e!==null&&(t=Math.max(t,this.atoms.getDegree(e)))}return t}compareLiterals(e,t){let n=this.atoms.getAtom(e),r=this.atoms.getAtom(t);if(n===null||r===null)return n===null&&r===null?e-t:n===null?-1:1;if(n.maxVar!==r.maxVar)return n.maxVar-r.maxVar;let i=this.atoms.getDegree(n),a=this.atoms.getDegree(r);if(i!==a)return i-a;let o=n.kind===`EQ`;return o===(r.kind===`EQ`)?e-t:o?1:-1}mkClause(e,t,n){let r={id:this.nextClauseId++,literals:e.length===0?[1]:[...e],isLearned:t,assumptions:n,isActive:!1};for(let e of r.literals)this.atoms.incRef(e);return r.literals.sort((e,t)=>this.compareLiterals(e,t)),(t?this.learned:this.clauses).push(r),this.addClauseToWatches(r),r}addClauseToWatches(e){let t=this.getMaxVar(e);t===-1?this.bwatches[Math.max(...e.literals.map(e=>e>>1))].push(e):this.watches[t].push(e)}delClause(e){let t=this.getMaxVar(e),n=t===-1?this.bwatches[Math.max(...e.literals.map(e=>e>>1))]:this.watches[t],r=n.indexOf(e);r!==-1&&n.splice(r,1);for(let t of e.literals)this.atoms.decRef(t)}unassignBoolVar(e){this.bvalues[e]=0,this.levels[e]=1/0,this.justifications[e]=null,this.atoms.atoms[e]===null&&e<this.bk&&(this.bk=e)}undoUntil(e){for(;e()&&this.trail.length>0;){let e=this.trail[this.trail.length-1];switch(e.kind){case`assignment`:this.unassignBoolVar(e.boolVar);break;case`infeasible`:this.xk!==-1&&this.xk<this.infeasible.length&&(this.infeasible[this.xk]=e.old);break;case`stage`:this.xk===0?this.xk=-1:this.xk!==-1&&(this.assignment[--this.xk]=void 0);break;case`level`:this.scopeLevel--;break;case`eq`:this.xk!==-1&&this.var2eq.length>this.xk&&(this.var2eq[this.xk]=e.old)}this.trail.pop()}}undoUntilLevel(e){this.undoUntil(()=>this.scopeLevel>e)}undoUntilStage(e){this.undoUntil(()=>this.xk!==e)}newLevel(){this.scopeLevel++,this.trail.push({kind:`level`})}getAssignedValue(e){let t=this.bvalues[e>>1];return(e&1)==1?-t:t}setLiteralToTrue(e,t){t.kind===`decision`?this.stats.decisions++:this.stats.propagations++;let n=e>>1;this.bvalues[n]=(e&1)==1?-1:1,this.levels[n]=this.scopeLevel,this.justifications[n]=t,this.trail.push({kind:`assignment`,boolVar:n}),this.updateEq(n,t)}decideLiteral(e){this.newLevel(),this.setLiteralToTrue(e,LC)}value(e){let t=this.getAssignedValue(e);if(t!==0)return t;let n=this.atoms.getAtom(e);return n===null||this.assignment[n.maxVar]===void 0?0:this.evaluator.eval(n,(e&1)==1)?1:-1}isClauseSatisfied(e){return e.literals.some(e=>this.value(e)===1)}processBooleanClause(e){let t=0,n=-1;for(let[r,i]of e.literals.entries())this.value(i)!==-1&&(t++,n===-1&&(n=r));return t!==0&&(t===1?this.setLiteralToTrue(e.literals[n],{kind:`clause`,clause:e}):this.decideLiteral(e.literals[n]),!0)}propagate(e,t,n=!0){let r=this.ism.getJustifications(t),i=[...r.literals];n&&i.push(e^1),this.setLiteralToTrue(e,{kind:`lazy`,literals:i,clauses:r.clauses})}updateInfeasible(e){let t=this.infeasible[this.xk];this.trail.push({kind:`infeasible`,old:t}),this.infeasible[this.xk]=this.ism.mkUnion(e,t)}updateEq(e,t){if(this.bvalues[e]!==1)return;let n=this.atoms.atoms[e];if(n===null||!bC(n)||n.kind!==`EQ`||n.polynomials.length>1||n.isEven[0]||t.kind===`clause`&&t.clause.assumptions!==null||t.kind===`lazy`&&(t.clauses.length>0||t.literals.length>0))return;let r=this.var2eq[this.xk];r!==null&&this.atoms.getDegree(r)<=this.atoms.getDegree(n)||(this.trail.push({kind:`eq`,old:r}),this.var2eq[this.xk]=n)}processArithClause(e){let t=0,n=-1,r=null,i=this.infeasible[this.xk];for(let[a,o]of e.literals.entries()){if(this.checkpoint(),this.value(o)===-1)continue;if(this.value(o)===1)return!0;let s=this.atoms.getAtom(o),c=this.evaluator.infeasibleIntervals(s,(o&1)==1,e);if(c===null)return this.propagate(o,null),!0;if(this.ism.isFull(c)){this.propagate(o^1,null);continue}if(this.ism.subset(c,i))return this.propagate(o,i),!0;let l=this.ism.mkUnion(c,i);this.ism.isFull(l)?this.propagate(o^1,l,!1):(t++,n===-1&&(n=a,r=c))}return t!==0&&(t===1?this.setLiteralToTrue(e.literals[n],{kind:`clause`,clause:e}):this.decideLiteral(e.literals[n]),this.updateInfeasible(r),!0)}processClause(e){return this.isClauseSatisfied(e)?!0:this.xk===-1?this.processBooleanClause(e):this.processArithClause(e)}processClauses(e){for(let t of e)if(!this.processClause(t))return t;return null}peekNextBoolVar(){for(;this.bk<this.atoms.atoms.length;this.bk++)if(!this.isDead[this.bk]&&this.atoms.atoms[this.bk]===null&&this.bvalues[this.bk]===0)return;this.bk=IC}newStage(){this.stats.stages++,this.trail.push({kind:`stage`}),this.xk=this.xk===-1?0:this.xk+1}selectWitness(){let e=this.ism.pickInComplement(this.infeasible[this.xk],!0);this.am.isRational(e)||this.stats.irrationalAssignments++,this.assignment[this.xk]=e}search(){for(this.bk=0,this.xk=-1;;){if(this.stats.conflicts>0&&this.stats.conflicts%1e4==0&&this.reorderAtRestart(),this.xk===-1?(this.peekNextBoolVar(),this.bk===IC&&this.newStage()):this.newStage(),this.bk===IC&&this.xk>=this.isInt.length)return 1;for(;;){this.checkpoint();let e=this.processClauses(this.xk===-1?this.bwatches[this.bk]:this.watches[this.xk]);if(e===null)break;if(!this.resolve(e))return-1;if(this.stats.conflicts>=this.maxConflicts)return 0}this.xk===-1?this.bvalues[this.bk]===0&&(this.decideLiteral(2*this.bk+1),this.bk++):this.selectWitness()}}gc(){if(this.learned.length<=4*this.clauses.length)return;this.resetWatches(),this.atoms.reinitCache();let e=0;for(let[t,n]of this.learned.entries())t-e<this.clauses.length&&n.literals.length>1&&!n.isActive?this.delClause(n):(this.learned[e++]=n,n.isActive=!1);this.learned.length=e,this.reattachArithClauses(this.clauses),this.reattachArithClauses(this.learned)}undoToBase(){this.initSearch(),this.bk=0,this.xk=-1}reorderAtRestart(){this.undoToBase(),this.stats.restarts++,this.stats.conflicts++,this.isReordered&&this.restoreOrder(),this.applyReorder()}tryReorder(){this.gc(),this.stats.restarts%10==0&&(this.isReordered&&this.restoreOrder(),this.applyReorder())}searchCheck(){for(this.stats.conflicts=0,this.stats.restarts=0;;){let e=this.search();if(e!==1)return e;this.stats.restarts++,this.tryReorder();let t=[];for(let e=0;e<this.isInt.length;e++){let n=this.assignment[e];if(!this.isInt[e]||n===void 0||this.am.isInt(n))continue;let r=this.am.intLt(n).value;if(!(r instanceof P))continue;let i=r;for(;;)if(i=i.add(P.one),this.am.compare(n,new V(i))<=0){i=i.sub(P.one);break}t.push([e,i])}if(t.length===0)return e;this.initSearch();for(let e of t){this.lemma.reset();let t=this.pm.mkLinear([1n],[e[0]],-e[1].num);this.lemma.push(this.mkIneqLiteral(`GT`,[t],[!1])^1);let n=this.pm.mkLinear([1n],[e[0]],-e[1].num-1n);this.lemma.push(this.mkIneqLiteral(`LT`,[n],[!1])^1),this.mkClause(this.lemma.literals,!0,null)}}}initSearch(){for(this.undoUntil(()=>!0);this.scopeLevel>0;)this.scopeLevel--;this.xk=-1,this.bvalues.fill(0),this.assignment.length=0}check(){this.initSearch(),this.explain.isFullDimensional=this.clauses.every(e=>e.literals.every(e=>this.isFullDimensional(e)));let e=this.canReorder();e&&this.reorderHeuristically();for(let e of this.watches)this.sortClausesByDegree(e);let t=this.searchCheck();return e&&this.restoreOrder(),t}isFullDimensional(e){let t=this.atoms.getAtom(e);if(t===null)return!0;let n=(e&1)==1;switch(t.kind){case`EQ`:case`ROOT_EQ`:case`ROOT_LE`:case`ROOT_GE`:return n;default:return!n}}sortClausesByDegree(e){if(e.length<=1)return;let t=e.map(e=>this.getClauseDegree(e)),n=e.map((e,t)=>t).sort((e,n)=>t[e]-t[n]||e-n).map(t=>e[t]);for(let t=0;t<n.length;t++)e[t]=n[t]}checkAssignment(e){let t=this.assignment.map(e=>e===void 0?void 0:this.am.copy(e));this.setAssignment(e);let n=null,r=1;for(let e of this.clauses){let t=e.literals.map(e=>this.value(e));if(!t.some(e=>e===1)){if(!t.every(e=>e===-1))r=0;else for(let t of e.literals)(n===null||this.atoms.getDegree(this.atoms.getAtom(t))<this.atoms.getDegree(this.atoms.getAtom(n)))&&(n=t)}}if(n===null)return{result:r,clause:[]};this.lazyClause.reset(),this.explain.computeLinearExplanation([n],this.lazyClause);let i=[...this.lazyClause.literals,n^1];return this.setAssignment(t),{result:-1,clause:i}}setAssignment(e){this.assignment.length=0;for(let[t,n]of e.entries())this.assignment[t]=n===void 0?void 0:this.am.copy(n)}processAntecedent(e){this.checkpoint();let t=e>>1;this.getAssignedValue(e)===0?(this.checkpoint(),this.marks[t]||(this.marks[t]=!0,this.lemma.push(e))):this.marks[t]||(this.marks[t]=!0,this.levels[t]===this.scopeLevel&&this.atoms.getMaxVar(e)===this.xk?this.markCount++:this.lemma.push(e))}resolveLiterals(e,t){for(let n of t)n>>1!==e&&this.processAntecedent(n)}resolveClause(e,t){t.isActive=!0,this.resolveLiterals(e,t.literals),this.lemmaAssumptions=Q_(t.assumptions,this.lemmaAssumptions)}resolveLazyJustification(e,t,n){this.lazyClause.reset(),this.explain.computeConflictExplanation(t,this.lazyClause);for(let e of t)this.lazyClause.push(e^1);this.checkpoint(),this.resolveLiterals(e,this.lazyClause.literals);for(let e of n)this.lemmaAssumptions=Q_(e.assumptions,this.lemmaAssumptions)}resetMarks(){for(let e of this.lemma.literals)this.marks[e>>1]=!1}releaseMarks(){this.markCount>0?(this.markCount=0,this.marks.fill(!1)):this.resetMarks()}resolve(e){let t=e;for(;;){this.stats.conflicts++,this.markCount=0,this.lemma.reset(),this.lemmaAssumptions=null;try{let e=this.learn(t);if(e===null)return!1;if(e===!0||this.processClause(e))return!0;t=e}finally{this.releaseMarks()}}}learn(e){this.resolveClause(-1,e);let t=this.trail.length,n=!1;for(;;){for(;this.markCount>0;){this.checkpoint();let e=this.trail[t-1];if(e.kind===`assignment`&&this.marks[e.boolVar]){let t=e.boolVar;this.markCount--,this.marks[t]=!1;let r=this.justifications[t];r.kind===`clause`?this.resolveClause(t,r.clause):r.kind===`lazy`?this.resolveLazyJustification(t,r.literals,r.clauses):(n=!0,this.lemma.push(2*t+ +(this.bvalues[t]===1)))}t--}if(n)break;let e=this.lemma.literals;if(e.every(e=>this.atoms.getMaxVar(e)!==this.xk))break;let r=0;for(let t of e)this.getAssignedValue(t)===-1&&(r=Math.max(r,this.levels[t>>1]));let i=0;for(let t of e){let e=t>>1;this.getAssignedValue(t)===-1&&this.levels[e]===r&&this.atoms.getMaxVar(t)===this.xk?this.markCount++:this.lemma.set(i++,t)}this.lemma.shrink(i),this.undoUntilLevel(r),t=this.trail.length}if(this.lemma.size===0)return null;this.resetMarks();let r=this.lemma.literals;if(!n){let e=-1;for(let t of r){let n=this.atoms.getMaxVar(t);n!==-1&&(e===-1||n>e)&&(e=n)}return this.undoUntilStage(e),this.mkClause(r,!0,this.lemmaAssumptions)}if(r.every(e=>this.atoms.getAtom(e)===null)){let e=r[r.length-1]>>1;this.undoUntil(()=>this.bvalues[e]!==0)}else this.undoUntilLevel(this.findNewLevel(r));return r.length===e.literals.length&&r.every((t,n)=>t===e.literals[n])?(this.processClause(e),!0):this.mkClause(r,!0,this.lemmaAssumptions)}findNewLevel(e){let t=-1;for(let n of e.slice(0,-1))this.atoms.getMaxVar(n)===this.xk&&(t=Math.max(t,this.levels[n>>1]));return t===-1?this.scopeLevel-1:t}canReorder(){return[...this.learned,...this.clauses].every(e=>e.literals.every(e=>this.atoms.getAtom(e)?.kind.startsWith(`ROOT`)!==!0))}applyReorder(){this.isReordered=!1,this.canReorder()&&(this.reorderHeuristically(),this.isReordered=!0)}reorderHeuristically(){let e=this.isInt.length,t=Array.from({length:e},()=>0),n=Array.from({length:e},()=>0),r=e=>{let r=new Set(e.ms.flatMap(e=>[...e.vars]));for(let i of r)n[i]++,t[i]=Math.max(t[i],this.pm.degree(e,i))};for(let e of[...this.clauses,...this.learned])for(let t of e.literals){let e=this.atoms.getAtom(t);e!==null&&(bC(e)?e.polynomials.forEach(r):r(e.polynomial))}let i=Array.from({length:e},(e,t)=>t),a=new Kg(++this.randomSeed);for(let t=e;t-->0;){let e=a.next()%(t+1);[i[t],i[e]]=[i[e],i[t]]}let o=Array.from({length:e},(e,t)=>t).sort((e,r)=>t[r]-t[e]||n[r]-n[e]||i[e]-i[r]),s=[];for(let[e,t]of o.entries())s[t]=e;this.reorder(s)}reorder(e){let t=0;for(let e of this.learned)e.literals.some(e=>this.atoms.getAtom(e)?.kind.startsWith(`ROOT`))?this.delClause(e):this.learned[t++]=e;this.learned.length=t,this.atoms.reinitCache(),this.resetWatches();let n=[];for(let[t,r]of this.assignment.entries())r!==void 0&&(n[e[t]]=r);this.undoUntilStage(-1),this.cache.reset();let r=this.invPerm.map(t=>e[t]);for(let[e,t]of r.entries())this.perm[t]=e;let i=[...this.isInt];for(let[t,n]of i.entries())this.isInt[e[t]]=n;this.invPerm=r;let a=/* @__PURE__ */ new Set;for(let e of this.atoms.atoms)if(e!=null){if(bC(e))for(let t of e.polynomials)a.add(t);else a.add(e.polynomial)}this.pm.rename(e,a),this.atoms.reinitCache(),this.setAssignment(n),this.reattachArithClauses(this.clauses),this.reattachArithClauses(this.learned)}restoreOrder(){this.reorder([...this.perm])}resetWatches(){for(let e of this.watches)e.length=0}reattachArithClauses(e){for(let t of e){let e=this.getMaxVar(t);e!==-1&&this.watches[e].push(t)}}};const zC=(e,t)=>e.hasTerm(t.column)?[...e.getTerm(t.column).coeffs]:[[t.column,P.one]],BC=e=>{let t=e.lra,n=[],r=e=>n[e]??={constraints:[],monics:[],terms:[]};t.constraints.constraints.forEach((e,n)=>{if(e.isActive)for(let i of zC(t,e))r(i[0]).constraints.push(n)});for(let t of e.emons.monics)for(let e of t.vars)r(e).monics.push(t.variable);for(let e of t.terms)for(let t of e.coeffs)r(t[0]).terms.push(e.column);let i=[...e.toRefine.elems],a=/* @__PURE__ */ new Set,o=/* @__PURE__ */ new Set,s=/* @__PURE__ */ new Set;for(let n=0;n<i.length;n++){let c=i[n];if(a.has(c))continue;a.add(c);let l=r(c);for(let e of l.constraints){o.add(e);for(let n of zC(t,t.constraints.constraints[e]))i.push(n[0])}i.push(...l.monics);for(let e of l.terms){for(let n of t.getTerm(e).coeffs)i.push(n[0]);i.push(e)}if(t.hasTerm(c))for(let e of t.getTerm(c).coeffs)i.push(e[0]);e.emons.isMonicVar(c)&&(s.add(c),i.push(...e.emons.get(c).vars))}return{vars:a,constraints:o,monics:s}},VC=e=>{let t=e.den;return t>=1n<<24n&&(t&t-1n)==0n},HC=(e,t)=>t.isAuxiliary&&(VC(t.rhs.x)||zC(e,t).some(e=>VC(e[1])));var UC=class{core;solver=new RC;values=[];lp2nl=/* @__PURE__ */ new Map;constructor(e){this.core=e}get am(){return this.solver.am}get steps(){return this.solver.steps}mkDefinitions(e){let t=this.core,n=t.lra,r=this.solver,i=r.pm,a=[],o=[];for(let s=0;s<n.columns.length;s++){if(!e(s)){a.push(null),o.push(0n);continue}let c=r.mkVar(n.isInt(s));if(this.lp2nl.set(s,c),t.emons.isMonicVar(s)){let e=null,n=1n;for(let r of t.emons.get(s).vars)n=o[r]*n,e=e===null?a[r]:i.mul(e,a[r]);a.push(e??i.mkVar(c)),o.push(n)}else if(n.hasTerm(s)){let e=[...n.getTerm(s).coeffs],t=e.reduce((e,t)=>Nm(t[1].div(P.of(o[t[0]])).den,e),1n),r=null;for(let n of e){let e=n[1].mul(P.of(t,o[n[0]])),s=i.mul(i.mkConst(e.num),a[n[0]]);r=r===null?s:i.add(r,s)}a.push(r??i.zero),o.push(t)}else a.push(i.mkVar(c)),o.push(1n)}return{definitions:a,denominators:o}}addConstraint(e,t,n){let r=this.core.lra,i=this.solver,a=i.pm,o=r.constraints.constraints[e],s=o.rhs.x,c=zC(r,o),l=c.reduce((e,t)=>Nm(e,t[1].div(P.of(n[t[0]])).den),s.den),u=a.mkConst(-(s.num*l)/s.den);for(let e of c){let r=e[1].mul(P.of(l,n[e[0]]));u=a.add(u,a.mul(t[e[0]],a.mkConst(r.num)))}let d=o.kind,f=d===-2?i.mkIneqLiteral(`GT`,[u],[!1])^1:d===2?i.mkIneqLiteral(`LT`,[u],[!1])^1:i.mkIneqLiteral(d===-1?`LT`:d===1?`GT`:`EQ`,[u],[!1]);return i.mkExternalClause([f],e),f}check(e,t){let n=this.core,i=n.lra;this.solver=new RC(n.limit,t),this.solver.maxConflicts=e,this.values=[],this.lp2nl.clear();let o=BC(n),s=this.mkDefinitions(e=>o.vars.has(e)),c=/* @__PURE__ */ new Set;for(let e of o.constraints)HC(i,i.constraints.constraints[e])?c.add(e):this.addConstraint(e,s.definitions,s.denominators);let l=(()=>{try{return this.solver.check()}catch(e){if(e instanceof a)return 0;throw e}})();if(l===1){this.solver.restoreOrder(),n.setUseNraModel(!0),i.initModel();for(let[e,t]of i.constraints.constraints.entries())if(t.isActive&&!this.isConstraintSatisfied(t)){if(o.constraints.has(e)&&!c.has(e))throw new r(`nlsat's model violates constraint ${e}`);return 0}for(let e of n.emons.monics)if(!this.isMonicSatisfied(e.variable,e.vars)){if(o.monics.has(e.variable))throw new r(`nlsat's model violates monomial ${e.variable}`);return 0}}if(l===-1){let e=new fv;for(let t of this.solver.getCore())e.push(t);new U(n).addExplanation(e),n.setUseNraModel(!0)}return l}value(e){let t=this.core,n=t.lra,r=this.solver.am;for(let i=this.values.length;i<=e;i++){if(t.emons.isMonicVar(i)){this.values.push(t.emons.get(i).vars.reduce((e,t)=>r.mul(e,this.values[t]),new V(P.one)));continue}if(n.hasTerm(i)){this.values.push([...n.getTerm(i).coeffs].reduce((e,t)=>r.add(e,r.mul(new V(t[1]),this.values[t[0]])),new V(P.zero)));continue}let e=this.lp2nl.get(i);this.values.push(e===void 0?new V(t.val(i)):this.solver.getValue(e))}return this.values[e]}isMonicSatisfied(e,t){let n=this.solver.am,r=t.reduce((e,t)=>n.mul(e,this.value(t)),new V(P.one));return n.compare(this.value(e),r)===0}isConstraintSatisfied(e){let t=this.solver.am,n=zC(this.core.lra,e).reduce((e,n)=>t.add(e,t.mul(new V(n[1]),this.value(n[0]))),new V(e.rhs.x.neg())),r=t.compare(n,new V(P.zero)),i=e.kind;return i===-2?r<=0:i===2?r>=0:i===-1?r<0:i===1?r>0:r===0}getClause(){let e=this.core,t=e.lra;this.solver=new RC(e.limit),this.lp2nl.clear();let n=BC(e),r=this.mkDefinitions(()=>!0),i=t.columns.map((t,n)=>new V(e.val(n)));this.values=i;let a=/* @__PURE__ */ new Map;for(let e of n.constraints){let t=this.addConstraint(e,r.definitions,r.denominators);a.set(t,e)}let o=this.solver.checkAssignment(i);return o.result===-1?{clause:o.clause,literalConstraints:a}:null}checkAssignment(){let e=(()=>{try{return this.getClause()}catch(e){if(e instanceof a)return null;throw e}})();return e===null?0:this.addLemma(e.clause,e.literalConstraints)}addLemma(e,t){let n=this.core,i=this.solver,a=i.pm,o=new U(n);for(let s of e){let e=t.get(s^1);if(e!==void 0){let t=new fv;t.push(e),o.addExplanation(t);continue}let c=i.getAtom(s);if(c===null)throw new r(`nlsat literal ${s} has no atom`);if(!bC(c)||c.polynomials.length!==1||a.totalDegree(c.polynomials[0])>1)return n.lemmas.pop(),0;let l=c.polynomials[0],u=new B,d=P.zero;for(let e=0;e<l.size;e++){let t=l.ms[e],n=P.of(l.as[e]);t.size===0?d=d.sub(n):u.addMonomial(n,t.vars[0])}let f=(s&1)==1,p=c.kind===`EQ`?f?3:0:c.kind===`LT`?f?2:-1:f?-2:1,m=H(u,p,d);if(n.ineqHolds(m))return n.lemmas.pop(),0;o.addIneq(m)}return n.isCheckFeasible=!0,-1}};const WC=new z(P.of(4n)),W={horner:!0,hornerSubsFixed:2,hornerFrequency:4,hornerRowLengthLimit:10,grobner:!0,grobnerRowLengthLimit:10,grobnerFrequency:4,grobnerEqsGrowth:10,grobnerExprSizeGrowth:2,grobnerExprDegreeGrowth:2,grobnerMaxSimplified:1e4,grobnerCnflToReport:1,grobnerPropagateQuotients:!0,grobnerGcdTest:!0,grobnerExpDelay:!0,grobnerAdaptive:!1,grQ:10,grobnerSubsFixed:1,grobnerExpandTerms:!0,grobnerPerfectSquares:!0,branching:!0,nra:!0,nraCheckAssignment:!0,nraCheckAssignmentMaxFail:7,order:!0,orderBinomialSign:!0,tangents:!0,tangentsBoxCorners:!1,expensivePatching:!1,expp:!1,monomialSandwich:!1,monomialSandwichMaxFanout:0,monomialBinomialSign:!1,reducePseudoLinear:!0,delay:10,propagateLinearMonomials:!0,linearizeViolatedMonomials:!0,optimizeBounds:!0,optimizeBoundsLpMaxVars:120,crossNested:!0};var GC=class{lra;limit;varEqs=new ax;emons=new ux(this.varEqs);lemmas=[];literals=[];equalities=[];fixedEqualities=[];toRefine=new tv;monicsWithChangedBounds=new tv;activeVarSet=new tv;isCheckFeasible=!1;isNlaSatisfied=!1;throttle;tangents;basics;order;monotone;divisions;intervals;monomialBounds;patcher;horner;grobner;nra=new UC(this);isUsingNraModel=!1;nlsatBackoff;checkAssignmentFailCount=0;squeezeSchedule=new Ub;isRelevant=()=>!0;constructor(e,t){this.lra=e,this.limit=t,this.nlsatBackoff=new Hb(W.delay),this.throttle=new aC(e,e.settings.stats),this.tangents=new pC(this),this.basics=new Jb(this),this.order=new sC(this),this.monotone=new oC(this),this.divisions=new Qb(this),this.intervals=new QS(this),this.monomialBounds=new tC(this),this.patcher=new lC(this),this.horner=new XS(this),this.grobner=new YS(this),e.onChangedBounds=e=>{for(let t of e.elems){this.isMonicVar(t)&&this.monicsWithChangedBounds.add(t);for(let e of this.emons.getUseList(t))this.monicsWithChangedBounds.add(e.variable)}}}get settings(){return this.lra.settings}get stats(){return this.lra.settings.stats}val(e){return this.lra.getValue(e).x}varVal(e){return this.val(e.variable)}mulVal(e){let t=P.one;for(let n of e.vars)t=t.mul(this.val(n));return t}valFactor(e){let t=this.val(e.variable);return e.isNegated?t.neg():t}compareHolds(e,t,n){let r=e.compare(n);switch(t){case-2:return r<=0;case-1:return r<0;case 2:return r>=0;case 1:return r>0;case 0:return r===0;default:return r!==0}}value(e){let t=P.zero;for(let n of e.coeffs)t=t.add(n[1].mul(this.val(n[0])));return t}ineqHolds(e){return this.compareHolds(this.value(e.term),e.cmp,e.rs)}hasUpperBound(e){return this.lra.core.hasUpperBound(e)}hasLowerBound(e){return this.lra.core.hasLowerBound(e)}getUpperBound(e){return this.lra.getUpperBound(e).x}getLowerBound(e){return this.lra.getLowerBound(e).x}noBounds(e){return!this.hasUpperBound(e)&&!this.hasLowerBound(e)}zeroIsAnInnerPointOfBounds(e){return this.hasUpperBound(e)&&!this.getUpperBound(e).isPositive()?!1:!(this.hasLowerBound(e)&&!this.getLowerBound(e).isNegative())}varIsInt(e){return this.lra.isInt(e)}varIsFixedToZero(e){return this.lra.isFixed(e)&&this.lra.getLowerBound(e).isZero()}varIsFixed(e){return this.lra.isFixed(e)}varIsFree(e){return this.lra.isFree(e)}varHasPositiveLowerBound(e){let t=this.lra.getLowerBound(e);return this.hasLowerBound(e)&&(t.x.isPositive()||t.x.isZero()&&t.y.isPositive())}varHasNegativeUpperBound(e){let t=this.lra.getUpperBound(e);return this.hasUpperBound(e)&&(t.x.isNegative()||t.x.isZero()&&t.y.isNegative())}varIsBig(e){return!this.varIsInt(e)&&this.val(e).isBig()}hasBigNum(e){return this.varIsBig(e.variable)||e.vars.some(e=>this.varIsBig(e))}hasReal(e){return e.vars.some(e=>!this.varIsInt(e))}hasRealFactorization(e){return e.factors.some(e=>!this.varIsInt(e.variable))}monHasZero(e){return e.some(e=>this.val(e).isZero())}isMonicVar(e){return this.emons.isMonicVar(e)}emon(e){return this.emons.get(e)}mapToRoot(e){return nx(this.varEqs.findVar(e))}sortedRvars(e){return e.isMon?this.emons.get(e.variable).rvars:[this.mapToRoot(e.variable)]}canonizeSignVar(e){return rx(this.varEqs.findVar(e))}canonizeSignFactor(e){return e.isNegated!==(e.isMon?this.emons.get(e.variable).rsign:this.canonizeSignVar(e.variable))}canonizeSignFactorization(e){let t=!1;for(let n of e.factors)t=t!==this.canonizeSignFactor(n);return t}getMonicSign(e){let t=1;for(let n of e.vars){let e=this.val(n);if(e.isNegative())t=-t;else if(!e.isPositive())return 0}return t}findCanonicalMonicOfVars(e){return this.emons.findCanonical(e)?.variable}isCanonicalMonic(e){return this.emons.isCanonicalMonic(e)}addMonic(e,t){this.emons.add(e,t),this.monicsWithChangedBounds.add(e)}productValue(e){return this.mulVal(e)}checkMonic(e){let t=this.lra.getValue(e.variable);return this.lra.isInt(e.variable)&&!t.x.isInt()?!0:this.productValue(e).equals(t.x)}hasRelevantMonomial(){return this.emons.monics.some(e=>this.isRelevant(e.variable))}getVarWeight(e){let t=this.lra.core.getColumnType(e),n=t===4?0:t===3?3:t===1||t===2?6:t===0?9:0;return this.isMonicVar(e)&&(n++,this.toRefine.has(e)&&n++),n}divide(e,t){let n=this.sortedRvars(t),r=KC(e.rvars,n);if(r===void 0)return;let i;if(r.length===1)i=dx(r[0],!1);else{let e=this.emons.findCanonical(r);if(e===void 0)return;i=dx(e.variable,!0)}return i.isNegated=this.canonizeSignFactor(i)!==this.canonizeSignFactor(t)!==e.rsign,i}*getFactorizations(e){let t=e.rvars,n=this.emons.get(e.variable),r=t.length===2?[!0]:Array.from({length:t.length-1},()=>!1),i=!1,a=0,o=e=>{if(e.length===1)return dx(e[0],!1);let t=this.findCanonicalMonicOfVars(e);if(t===void 0)a++;else return dx(t,!0)},s=()=>{let e=[t[t.length-1]],s=[];if(r.forEach((n,r)=>(n?e:s).push(t[r])),e.sort((e,t)=>e-t),s.sort((e,t)=>e-t),a>1e3)return r.fill(!0),r[0]=!1,i=!0,{factors:[],mon:null};let c=o(e);if(c===void 0)return{factors:[],mon:null};a=0;let l=o(s);if(l===void 0)return{factors:[],mon:null};let u={factors:[c,l],mon:null};return c.isNegated=c.isNegated!==(this.canonizeSignFactorization(u)!==n.rsign),u};for(;;){if(i&&r.every(Boolean))return;if(yield i?s():px(n),!i){i=!0;continue}let e=r.indexOf(!1);r.fill(!1,0,e===-1?r.length:e),e!==-1&&(r[e]=!0)}}negateRelation(e,t,n){e.addIneq(H(t,this.val(t).compare(n)<0?2:-2,n))}explainCoeffBound(e,t,n,r){let i=n?!t.isNegative():t.isNegative(),a=i?this.lra.getUpperWitness(e):this.lra.getLowerWitness(e);if(a===null)return;let o=i?this.lra.getUpperBound(e):this.lra.getLowerBound(e);return r.pushDependency(a),t.mul(o.x)}explainBound(e,t,n,r){let i=P.zero;for(let t of e.coeffs){let e=this.explainCoeffBound(t[0],t[1],n,r);if(e===void 0)return r.clear(),!1;i=i.add(e)}return!(n?i.compare(t)>0:i.compare(t)<0)||(r.clear(),!1)}explainIneq(e,t,n,r){if(t.size===0&&r.isZero()&&(n===-1||n===1||n===3))return!0;let i=new fv,a=P.one;return(()=>{switch(Wb(n)){case-2:return this.explainBound(t,r,!0,i);case-1:return this.explainBound(t,r.sub(a),!0,i);case 2:return this.explainBound(t,r,!1,i);case 1:return this.explainBound(t,r.add(a),!1,i);case 0:return this.explainBound(t,r,!1,i)&&this.explainBound(t,r,!0,i)||r.isZero()&&this.explainByEquiv(t,i);default:return this.explainBound(t,r.add(a),!1,i)||this.explainBound(t,r.sub(a),!0,i)}})()?(e.addExplanation(i),!0):!1}getOctagonTerm(e){if(e.size!==2)return;let t=!1,n=!1,r=[];for(let i of e.coeffs){if(i[1].equals(P.one))n=!0;else if(i[1].equals(P.minusOne))t=!0;else return;r.push(i[0])}return{first:r[0],second:r[1],isNegated:!(t&&n)}}explainByEquiv(e,t){let n=this.getOctagonTerm(e);if(n===void 0)return!1;let r=tx(n.first,!1),i=tx(n.second,n.isNegated);return this.varEqs.find(r)===this.varEqs.find(i)&&(this.varEqs.explain(r,i,t),!0)}collectEquivs(){let e=this.lra;for(let t of e.terms){let n=t.column;if(!e.hasTerm(n)||!this.varIsFixedToZero(n))continue;let r=this.getOctagonTerm(t);if(r===void 0)continue;let i=[e.getUpperWitness(n),e.getLowerWitness(n)];r.isNegated?this.varEqs.mergeMinus(r.first,r.second,i):this.varEqs.mergePlus(r.first,r.second,i)}this.emons.ensureCanonized()}random(){return this.settings.getRandomNext()}isCanceled(){return this.settings.isCanceled()}checkBoundedDivisions(){this.clear(),this.divisions.checkBoundedDivisions()}clear(){this.lemmas=[],this.literals=[],this.fixedEqualities=[],this.equalities=[],this.isCheckFeasible=!1}initSearch(){this.clear(),this.collectEquivs()}insertToRefine(e){this.toRefine.add(e)}eraseFromToRefine(e){this.toRefine.has(e)&&this.toRefine.delete(e)}initToRefine(){this.lra.isFeasible()&&this.lra.getRidOfInfEps(),this.toRefine.clear();let e=this.random(),t=this.emons.numMonics;for(let n=0;n<t;n++){let r=this.emons.monics[(n+e)%t];this.checkMonic(r)||this.insertToRefine(r.variable)}}conflictFound(){return this.lemmas.some(qb)}done(){return this.lemmas.length>=10||this.conflictFound()||this.isCanceled()}findBfcToRefineOnMonic(e){for(let t of this.getFactorizations(e)){if(t.factors.length!==2)continue;let n=this.valFactor(t.factors[0]).mul(this.valFactor(t.factors[1]));if(!this.varVal(e).equals(n))return t}}findBfcToRefine(){let e=this.random(),t=this.toRefine.size;for(let n=0;n<t;n++){let r=this.emons.get(this.toRefine.elems[(n+e)%t]);if(this.hasReal(r))continue;if(r.size===2)return{monic:r,factorization:{factors:[dx(r.vars[0],!1),dx(r.vars[1],!1)],mon:r}};let i=this.findBfcToRefineOnMonic(r);if(i!==void 0)return{monic:r,factorization:i}}}checkWeighted(e){let t=0;for(let n of e)t+=n[0];let n=/* @__PURE__ */ new Set;for(;t>0&&!this.done()&&this.lemmas.length===0;){let r=this.random()%t;for(let i=0;i<e.length;i++)if(!n.has(i)){if(r<e[i][0]){n.add(i),e[i][1](),t-=e[i][0];break}r-=e[i][0]}}}addBounds(){let e=this.random(),t=this.toRefine.size;for(let n=0;n<t;n++){let r=this.emons.get(this.toRefine.elems[(n+e)%t]);for(let e of r.vars)if(this.varIsFree(e)&&!r.isBoundPropagated){this.emons.setBoundPropagated(r),this.literals.push(H(e,0,0)),this.stats.nlaAddBounds++;return}}}onToRefineEmpty(){return this.squeezeSchedule.onNothingToRefine(),1}check(e){let t=this.stats;if(t.nlaCalls++,this.lra.getRidOfInfEps(),this.lra.status!==2&&this.lra.status!==3)return 0;if(this.initToRefine(),this.patcher.patchMonomials(),this.setUseNraModel(!1),this.toRefine.size===0)return this.onToRefineEmpty();this.initSearch(),this.isNlaSatisfied=!1;let n=0,r=W.grobner,i=W.horner&&t.nlaCalls%W.hornerFrequency===0,a=W.branching,o=a&&this.emons.numMonics<=8,s=()=>n===0&&!this.done()&&!this.isNlaSatisfied&&this.lemmas.length===0&&this.literals.length===0&&!this.isCheckFeasible;if(s()&&this.monomialBounds.generateLemmas(),s()&&this.refinePseudoLinear())return-1;let c=t.nlaCalls%W.hornerFrequency===0;if(s()&&this.squeezeSchedule.isEnabled&&(i||r)&&(this.squeezeSchedule.isEager||c)&&(this.squeezeSchedule.onSqueeze(this.monomialBounds.optimizeNlBounds()),this.toRefine.size===0))return this.onToRefineEmpty();let l=()=>{s()&&i&&this.horner.hornerLemmas()},u=()=>{s()&&r&&this.grobner.run()};if(this.checkWeighted(o?[[1,l],[1,u]]:[[1,l],[1,u],[1,()=>{s()&&a&&this.addBounds()}]]),this.isCanceled())return 0;if(this.lemmas.length>0||this.literals.length>0||this.isCheckFeasible)return-1;if(this.isNlaSatisfied)return 1;if(s()&&W.nraCheckAssignment&&this.checkAssignmentFailCount<W.nraCheckAssignmentMaxFail&&(n=this.nra.checkAssignment(),n!==1&&this.checkAssignmentFailCount++),s()&&this.shouldRunBoundedNlsat()&&(n=this.boundedNlsat()),s()&&this.basics.basicLemma(!0),s()&&o&&this.basics.basicLemma(!1),s()&&o&&this.addBounds(),s()&&!o&&this.basics.basicLemma(!1),s()&&this.divisions.check(),s()){this.checkWeighted([[6,()=>this.order.orderLemma()],[2,()=>this.monotone.monotonicityLemma()],[1,()=>this.tangents.tangentLemma()]]);let e=t.nlaCalls;!this.conflictFound()&&W.nra&&e%50==0&&e>500&&(n=this.boundedNlsat())}return s()&&W.nra&&e>=2&&(n=this.nra.check(1/0,1/0),t.nraCalls++),n===0&&!s()&&(n=-1),t.nlaLemmas+=this.lemmas.length,n}shouldRunBoundedNlsat(){return W.nra&&this.nlsatBackoff.shouldRun()}boundedNlsat(){let e=1e5,t=this.nra.check(100,e);return this.stats.nraCalls++,this.nlsatBackoff.update(t===-1||this.nra.steps<e/10),t===1&&this.clear(),t}setUseNraModel(e){e!==this.isUsingNraModel&&(this.emons.trail.push(()=>{this.isUsingNraModel=!e}),this.isUsingNraModel=e)}propagate(){this.clear();let e=!1;return this.monomialBounds.tightenLpBounds()&&(e=!0),this.monomialBounds.propagateChangedBounds()&&(e=!0),this.monomialBounds.propagateViolatedLinearMonomials()&&(e=!0),this.monicsWithChangedBounds.clear(),e&&(this.isCheckFeasible=!0),e}incrementalPropagate(){this.clear();let e=this.monomialBounds.propagateChangedBounds();return this.monicsWithChangedBounds.clear(),e&&(this.isCheckFeasible=!0),e}isPseudoLinear(e){let t=!1;for(let n of e.vars)if(!this.isSmallIntRange(n)){if(t)return!1;t=!0}return!0}isSmallIntRange(e){let t=this.lra,n=t.core.getColumnType(e);return n!==3&&n!==4||!t.isInt(e)?!1:t.getUpperBound(e).sub(t.getLowerBound(e)).compare(WC)<=0}refinePseudoLinear(){if(!W.reducePseudoLinear)return!1;for(let e of this.toRefine.elems){let t=this.emons.get(e);if(this.isPseudoLinear(t))return this.refinePseudoLinearMonic(t),!0}return!1}refinePseudoLinearMonic(e){let t=new U(this),n=-1,r=P.one;for(let i=0;i<e.vars.length;i++){let a=e.vars[i];if(i===e.vars.length-1&&n===-1){n=a;break}this.isSmallIntRange(a)?(t.addIneq(H(a,3,this.val(a))),r=r.mul(this.val(a))):n=a}t.addIneq(H(new B([[e.variable,P.one],[n,r.neg()]]),0,0))}push(){this.emons.push()}pop(e){this.emons.pop(e)}};const KC=(e,t)=>{if(t.length>=e.length)return;let n=[],r=0;for(let i of e)if(r<t.length&&t[r]===i)r++;else if(r<t.length&&t[r]<i)return;else n.push(i);return r===t.length?n:void 0};var qC=class{context;varEnodes=[];solver;constructor(e){this.context=e,this.solver=new Zv(()=>e.checkCanceled())}get manager(){return this.context.manager}getEnode(e){return this.varEnodes[e]}getExpr(e){return this.varEnodes[e].owner}getNumVars(){return this.varEnodes.length}isIntExpr(e){return this.manager.isInt(e)}isIntVar(e){return this.isIntExpr(this.getExpr(e))}},JC=class extends qC{processedEqs=/* @__PURE__ */ new Set;restartPairs=[];getInternalizedEnode(e){let t=this.context;t.isEInternalized(e)||t.internalize(e,!1);let n=t.getEnode(e);if(n===void 0)throw new r(`the term was not internalized`);return n}isZeroNumeral(e){return this.manager.isNumeral(e)&&this.manager.getRationalValue(e).isZero()}mkEqAxioms(e,t){if(e===t)return;let n=this.context,r=this.manager,i=r.ids[e.owner]>r.ids[t.owner],a=i?t:e,o=i?e:t,s=a.owner,c=o.owner;if(r.isNumeral(s)&&r.isNumeral(c))return;let l=`${s}:${c}`;if(this.processedEqs.has(l))return;this.processedEqs.add(l),n.pushTrail(()=>this.processedEqs.delete(l));let u=n.mkEqAtom(s,c);if(r.isNumeral(s)){let e=s;s=c,c=e}let d=r.sorts[s],f,p;if(r.isNumeral(c))f=r.mkApp(11,[s,c],0),p=r.mkApp(12,[s,c],0);else{let e=r.mkNumeralOfSort(P.minusOne,d),t=r.mkNumeralOfSort(P.zero,d),n=r.mkApp(15,[s,r.mkApp(18,[e,c],d)],d);f=r.mkApp(11,[n,t],0),p=r.mkApp(12,[n,t],0)}n.internalize(u,!0),n.internalize(f,!0),n.internalize(p,!0);let m=n.getLiteral(u),h=n.getLiteral(f),g=n.getLiteral(p);n.isTrueFirst(R(m))&&(n.setTrueFirstFlag(R(h)),n.setTrueFirstFlag(R(g))),n.mkThAxiom([L(m),h]),n.mkThAxiom([L(m),g]),n.mkThAxiom([m,L(h),L(g)]);let _=()=>{n.isRelevant(a.owner)&&n.isRelevant(o.owner)&&(n.relevancy.markAsRelevant(u),n.relevancy.markAsRelevant(f),n.relevancy.markAsRelevant(p))};n.relevancy.addHandler(a.owner,_),n.relevancy.addHandler(o.owner,_),n.scopeLevel!==n.baseLevel&&a.iscopeLevel<=n.baseLevel&&o.iscopeLevel<=n.baseLevel&&this.restartPairs.push([a,o])}internalizeEqEh(e){let t=this.context,n=t.getEnode(this.manager.getArg(e,0)),r=t.getEnode(this.manager.getArg(e,1));n!==void 0&&r!==void 0&&n.thVar>=0&&r.thVar>=0&&n!==r&&this.mkEqAxioms(n,r)}newEqEh(e,t){this.mkEqAxioms(this.getEnode(e),this.getEnode(t))}newDiseqEh(e,t){this.mkEqAxioms(this.getEnode(e),this.getEnode(t))}relevantEh(e){let t=this.manager,n=t.getOp(e);n===23?this.mkDivAxiom(t.getArg(e,0),t.getArg(e,1)):n===25?this.mkToIntAxiom(e):n===26?this.mkIsIntAxiom(e):n===20&&this.mkIdivModAxioms(t.getArg(e,0),t.getArg(e,1))}mkLiteral(e){let t=this.context;return t.isEInternalized(e)||t.internalize(e,!1),t.getLiteral(e)}ensureEnode(e){let t=this.getInternalizedEnode(e);return this.context.markAsRelevant(e),t}mkAxiom(e){let t=this.context;if(t.mkThAxiom(e.length===1?[t.falseLiteral,e[0]]:e.slice()),!t.relevancy.isEnabled)return;if(e.length!==2){for(let n of e)t.markLiteralAsRelevant(n);return}t.markLiteralAsRelevant(e[0]);let n=t.boolVar2Expr[R(e[1])];t.relevancy.addWatch(t.boolVar2Expr[R(e[0])],jg(e[0]),()=>t.relevancy.markAsRelevant(n))}mkDivAxiom(e,t){let n=this.manager;if(this.isZeroNumeral(t))return;let r=this.mkEq(t,n.mkRealNumeral(P.zero)),i=n.mkApp(18,[t,n.mkApp(23,[e,t],2)],2);this.mkAxiom([r,this.mkEq(i,e)])}mkToIntAxiom(e){let t=this.manager,n=t.getArg(e,0);if(t.getOp(n)===24){this.mkAxiom([this.mkEq(t.getArg(n,0),e)]);return}let r=t.mkApp(24,[e],2),i=t.mkApp(11,[t.mkApp(16,[r,n],2),t.mkRealNumeral(P.zero)],0),a=t.mkApp(12,[t.mkApp(16,[n,r],2),t.mkRealNumeral(P.one)],0),o=this.mkLiteral(i),s=this.mkLiteral(a);this.mkAxiom([o]),this.mkAxiom([L(s)])}mkIsIntAxiom(e){let t=this.manager,n=t.getArg(e,0),r=this.mkEq(t.mkApp(24,[t.mkApp(25,[n],1)],2),n),i=this.context.getLiteral(e);this.mkAxiom([L(i),r]),this.mkAxiom([i,L(r)])}mkEq(e,t){let n=this.manager;if(e===t)return 0;if(n.isUniqueValue(e)&&n.isUniqueValue(t))return 1;let r=this.context.mkEqAtom(e,t);return this.context.internalize(r,!1),this.context.getLiteral(r)}mkIdivModAxioms(e,t){let n=this.manager;if(n.getNumeral(t)===0n)return;let r=[],i=e=>(n.incRef(e),r.push(e),e);n.withoutTemporaries(()=>this.mkIdivModAxiomsCore(e,t,i));for(let e=r.length-1;e>=0;e--)n.decRef(r[e])}mkIdivModAxiomsCore(e,t,n){let r=this.manager,i=this.context,a=n(r.mkApp(19,[e,t],1)),o=n(r.mkApp(20,[e,t],1)),s=n(r.mkNumeral(0n));if(r.getNumeral(e)===0n){let e=this.mkLiteral(r.mkApp(12,[t,s],0)),n=this.mkLiteral(r.mkApp(11,[t,s],0)),i=[r.mkApp(12,[a,s],0),r.mkApp(11,[a,s],0),r.mkApp(12,[o,s],0),r.mkApp(11,[o,s],0)].map(e=>this.mkLiteral(e));for(let t of[e,n])for(let e of i)this.mkAxiom([t,e]);return}let c=n(r.mkApp(15,[r.mkApp(18,[t,a],1),o],1)),l=n(i.mkEqAtom(c,e));i.internalize(l,!1);let u=i.getLiteral(l),d=r.getNumeral(t);if(d!==void 0){let t=n(r.mkNumeral((d<0n?-d:d)-1n));this.mkAxiom([u]),this.mkEqAxioms(this.ensureEnode(c),this.ensureEnode(e)),this.mkAxiom([this.mkLiteral(r.mkApp(12,[o,s],0))]),this.mkAxiom([this.mkLiteral(r.mkApp(11,[o,t],0))]);return}let f=n(r.mkNumeral(-1n)),p=n(r.mkApp(18,[f,t],1)),m=this.mkLiteral(r.mkEq(t,s)),h=this.mkLiteral(r.mkApp(12,[o,s],0));this.mkAxiom([m,u]),this.mkAxiom([m,h]);let g=this.mkLiteral(r.mkApp(11,[t,s],0)),_=this.mkLiteral(r.mkApp(11,[r.mkApp(15,[o,p],1),f],0));this.mkAxiom([g,_]);let v=this.mkLiteral(r.mkApp(12,[t,s],0)),y=this.mkLiteral(r.mkApp(11,[r.mkApp(15,[o,t],1),f],0));this.mkAxiom([v,y]),this.mkEqAxioms(this.ensureEnode(c),this.ensureEnode(e));let b=r.mkApp(12,[r.mkApp(16,[e,r.mkApp(18,[t,a],1)],1),s],0);r.incRef(b);let x=i.rewriter.rewrite(b);r.decRef(b),this.mkAxiom([m,this.mkLiteral(x)]),r.decRef(x)}},YC=class extends JC{oneVar=-1;zeroVar=-1;realOneVar=-1;realZeroVar=-1;constraintSources=[];bounds=[];unassignedBounds=[];isNewDef=!1;internalizeStates=[];internalizeHead=0;scopes=[];value2var=/* @__PURE__ */ new Map;unsupportedTerms=[];underspecifiedTerms=[];nla;init(){let e=this.manager;this.oneVar=this.addConst(e.mkNumeral(1n)),this.realOneVar=this.addConst(e.mkRealNumeral(P.one)),this.zeroVar=this.addConst(e.mkNumeral(0n)),this.realZeroVar=this.addConst(e.mkRealNumeral(P.zero))}addConst(e){let t=this.manager.getRationalValue(e);this.mkEnode(e);let n=this.solver.addVar(this.mkVar(e),this.isIntExpr(e));return this.solver.push(),this.addDefConstraintAndEquality(n,2,t),this.addDefConstraintAndEquality(n,-2,t),n}isAttachedToVar(e){return e.thVar>=0&&this.varEnodes[e.thVar]===e}mkVar(e){let t=this.getInternalizedEnode(e);if(this.isAttachedToVar(t))return t.thVar;let n=this.varEnodes.length;for(this.varEnodes.push(t);this.bounds.length<=n;)this.bounds.push([]),this.unassignedBounds.push(0);return this.context.attachThVar(t,n),n}registerVar(e){let t=this.solver.externalToLocalColumn(e);return t===-1?this.solver.addVar(e,this.isIntVar(e)):t}mkEnode(e){let t=this.context;for(let n=0;n<this.manager.getNumArgs(e);n++){let r=this.manager.getArg(e,n);t.isEInternalized(r)||(t.internalize(r,!1),t.markAsRelevant(r))}if(t.isEInternalized(e))return;let n=this.manager.getOp(e),r=this.manager.getFamily(e)===1;t.mkEnode(e,!1,!1,!r||n!==15&&n!==18)}internalizeArgs(e){let t=this.context;for(let n=0;n<this.manager.getNumArgs(e);n++){let r=this.manager.getArg(e,n);t.isEInternalized(r)||t.internalize(r,!1)}}foundUnsupported(e){this.unsupportedTerms.push(e),this.context.pushTrail(()=>this.unsupportedTerms.pop())}foundUnderspecified(e){let t=this.manager,n=this.context;this.underspecifiedTerms.push(e),n.pushTrail(()=>this.underspecifiedTerms.pop());let r=t.getOp(e),i=t.mkNumeral(0n),a=r===20?t.mkApp(20,[t.getArg(e,0),i],1):e,o=r===23?t.mkApp(27,t.getArgs(e),2):r===19?t.mkApp(28,t.getArgs(e),1):t.mkApp(29,[t.getArg(e,0),i],1),s=this.mkEq(o,a);n.relevancy.isEnabled&&n.relevancy.addDependency(a,n.boolVar2Expr[R(s)]),n.assign(s,null)}registerFixedVar(e,t){let n=`${this.isIntVar(e)}:${t}`;this.value2var.has(n)||(this.value2var.set(n,e),this.context.pushTrail(()=>this.value2var.delete(n)))}internalizeNumeral(e,t){this.context.isEInternalized(e)||this.mkEnode(e);let n=this.mkVar(e);if(this.solver.externalToLocalColumn(n)===-1){let r=this.solver.addVar(n,this.isIntExpr(e));this.addDefConstraintAndEquality(r,2,t),this.addDefConstraintAndEquality(r,-2,t),this.registerFixedVar(n,t)}return n}internalizeMul(e){this.internalizeArgs(e);let t=this.context.isEInternalized(e)&&this.isAttachedExpr(e);this.mkEnode(e);let n=this.mkVar(e);if(!t){let t=this.manager.mapArgs(e,e=>(this.internalizeTermCore(e),this.registerVar(this.mkVar(e))));this.solver.registerExistingTerms(),this.ensureNla().addMonic(this.registerVar(n),t)}return n}ensureNla(){if(this.nla!==void 0)return this.nla;let e=new GC(this.solver,this.manager.limit);for(let t=0;t<this.scopes.length;t++)e.push();return e.isRelevant=e=>this.context.isRelevant(this.getExpr(this.solver.getExternal(e))),this.nla=e,e}registerDivision(e,t){let n=e=>(this.internalizeTermCore(e),this.registerVar(this.mkVar(e)));return{quotient:n(e),dividend:n(this.manager.getArg(e,0)),divisor:n(this.manager.getArg(e,1)),remainder:n(t)}}isNonzeroNumeral(e){return this.manager.isNumeral(e)&&!this.manager.getRationalValue(e).isZero()}isBounded(e){let t=this.manager,n=t.getOp(e);return n===19&&t.isNumeral(t.getArg(e,1))?this.isBounded(t.getArg(e,0)):n===20&&t.isNumeral(t.getArg(e,1))||t.isNumeral(e)}isAttachedExpr(e){let t=this.context.getEnode(e);return t!==void 0&&this.isAttachedToVar(t)}pushInternalizeState(){let e=this.internalizeStates[this.internalizeHead]??=new F(this.manager);return this.internalizeHead++,e.reset(),e}linearize(e,t){let n=this.manager,r=this.context,i=[],a=[],o=[],s=(n,r)=>{e.push(n),t.push(r)},c=(e,n)=>{t[i.length]=t[e],i.push(n)},l=0;for(;l<e.size;){let i=e.items[l];a.push(i);let u=n.getOp(i);if(u===15){for(let e=0;e<n.getNumArgs(i);e++)s(n.getArg(i,e),t[l]);e.size!==l+1&&(e.set(l,e.items[e.size-1]),t[l]=t[t.length-1],e.pop(),t.pop())}else if(u===16){e.set(l,n.getArg(i,0));for(let e=1;e<n.getNumArgs(i);e++)s(n.getArg(i,e),t[l].neg())}else if(u===18&&n.getNumArgs(i)===2&&n.isNumeral(n.getArg(i,0)))t[l]=t[l].mul(n.getRationalValue(n.getArg(i,0))),e.set(l,n.getArg(i,1)),a.push(n.getArg(i,0));else if(u===18&&n.getNumArgs(i)===2&&n.isNumeral(n.getArg(i,1)))t[l]=t[l].mul(n.getRationalValue(n.getArg(i,1))),e.set(l,n.getArg(i,0)),a.push(n.getArg(i,1));else if(u===18)c(l,this.internalizeMul(i)),l++;else if(u===10)c(l,this.internalizeNumeral(i,n.getRationalValue(i))),l++;else if(u===17)t[l]=t[l].neg(),e.set(l,n.getArg(i,0));else if(u===24){if(e.set(l,n.getArg(i,0)),!r.isEInternalized(i)){this.internalizeTermCore(n.getArg(i,0)),this.mkEnode(i);let e=this.registerVar(this.mkVar(i)),t=this.registerVar(this.mkVar(n.getArg(i,0)));for(let n of this.solver.addEquality(e,t))this.constraintSources[n]=null}}else if(n.getFamily(i)===1){let e=!r.isEInternalized(i);if(this.internalizeArgs(i),this.mkEnode(i),c(l,this.mkVar(i)),l++,e){if(u===23){let e=r.rewriter.rewrite(n.getArg(i,1));this.isNonzeroNumeral(e)||this.foundUnderspecified(i);for(let e=0;e<n.getNumArgs(i);e++){let t=n.getArg(i,e);o.push(t)}}else if(u===19){this.isNonzeroNumeral(n.getArg(i,1))||this.foundUnderspecified(i);let e=n.mkApp(20,n.getArgs(i),1);r.internalize(e,!1),r.relevancy.isEnabled&&r.relevancy.addDependency(i,e),this.nla!==void 0&&!n.isNumeral(n.getArg(i,1))&&this.nla.divisions.addIdivision(this.registerDivision(i,e)),n.isNumeral(n.getArg(i,1))&&this.isBounded(n.getArg(i,0))&&this.ensureNla().divisions.addBoundedDivision(this.registerDivision(i,e))}else if(u===20){let e=this.isNonzeroNumeral(n.getArg(i,1));if(e||this.foundUnderspecified(i),r.relevancy.isEnabled||this.mkIdivModAxioms(n.getArg(i,0),n.getArg(i,1)),this.nla!==void 0&&e){let e=n.mkApp(19,n.getArgs(i),1);r.internalize(e,!1),this.nla.divisions.addBoundedDivision(this.registerDivision(e,i))}if(!n.isNumeral(n.getArg(i,1))&&!this.isZeroNumeral(n.getArg(i,0))){let e=this.ensureNla(),t=n.mkApp(19,n.getArgs(i),1);r.internalize(t,!1),e.divisions.addDivisibility(this.registerDivision(t,i))}}else if(u===28||u===29)for(let e=0;e<n.getNumArgs(i);e++){let t=n.getArg(i,e);o.push(t)}else if(u!==25&&u!==27){this.foundUnsupported(i);for(let e=0;e<n.getNumArgs(i);e++){let t=n.getArg(i,e);o.push(t)}}!r.relevancy.isEnabled&&u!==20&&this.relevantEh(i)}}else this.internalizeArgs(i),c(l,this.mkVar(i)),l++}for(let e=a.length;e-->0;)this.mkEnode(a[e]);for(let e=o.length;e-->0;)this.internalizeTermCore(o[e]);return{vars:i,coeffs:t.slice(0,i.length)}}initLeftSide(e,t){let n=/* @__PURE__ */ new Map;e.forEach((e,r)=>n.set(e,(n.get(e)??P.zero).add(t[r])));let r=[];for(let t of e){let e=n.get(t);e===void 0||e.isZero()||(r.push([this.registerVar(t),e]),n.delete(t))}return r}internalizeDef(e){let t=this.pushInternalizeState();t.push(e);let n=this.internalizeLinearizedDef(e,this.linearize(t,[P.one]));return this.internalizeHead--,n}internalizeLinearizedDef(e,t){let n=this.mkVar(e);if(t.vars.length===1&&t.coeffs[0].equals(P.one)&&n===t.vars[0])return n;let r=this.initLeftSide(t.vars,t.coeffs);if(this.solver.externalToLocalColumn(n)!==-1)return n;if(r.length===0){let t=this.solver.addVar(n,this.isIntExpr(e));this.addDefConstraintAndEquality(t,2,P.zero),this.addDefConstraintAndEquality(t,-2,P.zero)}else this.solver.addTerm(r,n);return n}internalizeTermCore(e){this.manager.getFamily(e)!==1&&this.manager.isBool(e)||this.context.isEInternalized(e)&&this.isAttachedExpr(e)||this.internalizeDef(e)}internalizeTerm(e){return this.internalizeTermCore(e),!0}addDefConstraintAndEquality(e,t,n){let r=this.solver.mkVarBound(e,t,n),i=this.solver.activateCheckOnEqual(r);this.constraintSources[r]=null,i!==-1&&this.reportEqualityOfFixedVars(e,i),this.isNewDef=!0}};const XC=e=>I(e.boolVar);var ZC=class extends YC{assertedAtoms=[];boundsTrail=[];boolVarToBound=[];newBounds=[];delayIneqs=[];internalizeAtom(e){let t=this.manager,n=this.context,r=t.getOp(e),i=n.mkBoolVar(e);if(this.boolVarToBound[i]=void 0,n.setVarTheory(i),r===26)return this.mkEnode(e),n.relevancy.isEnabled||this.mkIsIntAxiom(e),!0;if(r!==11&&r!==12)return this.foundUnsupported(e),!0;let a=t.isNumeral(t.getArg(e,1));if(!a&&!t.isNumeral(t.getArg(e,0)))return this.delayIneqs.push(e),n.pushTrail(()=>this.delayIneqs.pop()),!0;let o=a?t.getArg(e,0):t.getArg(e,1),s=t.getRationalValue(a?t.getArg(e,1):t.getArg(e,0)),c=r===12===a,l=this.internalizeDef(o),u=this.isIntVar(l)&&!s.isInt()?c?s.ceil():s.floor():s,d=this.mkVarBound(i,l,c,u);return this.bounds[l].push(d),this.updateUnassignedBounds(l,1),this.boundsTrail.push(l),this.boolVarToBound[i]=d,this.mkBoundAxioms(d),!0}updateUnassignedBounds(e,t){let n=this.unassignedBounds[e];this.context.pushTrail(()=>{this.unassignedBounds[e]=n}),this.unassignedBounds[e]=n+t}getBoundKind(e,t){return e.isLower?t?2:e.isInt?-2:-1:t?-2:e.isInt?2:1}mkVarBound(e,t,n,r){this.pushInternalizeState(),this.internalizeHead--;let i=this.registerVar(t),a=this.isIntVar(t),o={isLower:n,isInt:a},s=n?2:-2,c=n?a?-2:-1:a?2:1,l=this.solver.mkVarBound(i,s,r),u=a?n?r.sub(P.one):r.add(P.one):r,d=this.solver.mkVarBound(i,c,u);return this.constraintSources[l]=I(e),this.constraintSources[d]=I(e,!0),{boolVar:e,thVar:t,column:i,value:r,constraintTrue:l,constraintFalse:d,...o}}mkBoundAxioms(e){if(!this.context.isSearching){this.newBounds.push(e);return}let t,n,r,i;for(let a of this.bounds[e.thVar]){if(a===e||a.boolVar===e.boolVar)continue;let o=a.value.compare(e.value);(o!==0||a.isLower!==e.isLower)&&(a.isLower?o<0?(t===void 0||a.value.compare(t.value)>0)&&(t=a):(n===void 0||a.value.compare(n.value)<0)&&(n=a):o<0?(r===void 0||a.value.compare(r.value)>0)&&(r=a):(i===void 0||a.value.compare(i.value)<0)&&(i=a))}for(let a of[t,n,r,i])a!==void 0&&this.mkBoundAxiom(e,a)}mkBoundAxiom(e,t){let n=XC(e),r=XC(t),i=e.value,a=t.value;if(i.equals(a)&&e.isLower===t.isLower)return;let o=e=>this.context.mkThAxiom(e);e.isLower?t.isLower?a.compare(i)<=0?o([L(n),r]):o([n,L(r)]):i.compare(a)<=0?o([n,r]):(o([L(n),L(r)]),e.isInt&&i.equals(a.add(P.one))&&o([n,r])):t.isLower?i.compare(a)>=0?o([n,r]):(o([L(n),L(r)]),e.isInt&&i.equals(a.sub(P.one))&&o([n,r])):i.compare(a)>=0?o([n,L(r)]):o([L(n),r])}flushBoundAxioms(){for(;this.newBounds.length>0;){let e=this.newBounds.slice().sort((e,t)=>e.thVar-t.thVar);this.newBounds=[];for(let t=0;t<e.length;){let n=e[t].thVar,r=[];for(;t<e.length&&e[t].thVar===n;t++)r.push(e[t]);let i=(e,t)=>e.value.compare(t.value);r.sort(i);let a=this.bounds[n].slice().sort(i),o=a.length,s=e=>{let t=a.findIndex(t=>t.isLower===e);return t===-1?o:t},c=(e,t,n)=>{let r=o,i=!1;for(let s=n;s<o;s++){let n=a[s];if(n!==e&&n.isLower===t){if(i=!0,n.value.compare(e.value)<=0)r=s;else break}}return{result:r,isFound:i}},l=(e,t,n)=>{let r=!1;for(let i=n;i<o;i++){let n=a[i];if(n!==e&&n.isLower===t&&(r=!0,e.value.compare(n.value)<0))return{result:i,isFound:r}}return{result:o,isFound:r}},u=s(!0),d=u,f=s(!1),p=f,m=/* @__PURE__ */ new Set;for(let e of r){let t=c(e,!0,u),n=c(e,!1,f),r=l(e,!0,d),i=l(e,!1,p);t.result!==o&&(u=t.result),r.result!==o&&(d=r.result),n.result!==o&&(f=n.result),i.result!==o&&(p=i.result),t.isFound||(u=o),n.isFound||(f=o),r.isFound||(d=o),i.isFound||(p=o),m.add(e);let s=(t,n)=>{t!==o&&n!==o&&!m.has(a[n])&&this.mkBoundAxiom(e,a[n])};s(t.result,u),s(r.result,d),s(n.result,f),s(i.result,p)}}}}assignEh(e,t){this.assertedAtoms.push({boolVar:e,isTrue:t});let n=this.boolVarToBound[e];n!==void 0&&this.updateUnassignedBounds(n.thVar,-1)}},QC=class extends ZC{bp=new Vb(this.solver,{columnIsInteresting:e=>this.columnIsInteresting(e),boundIsInteresting:(e,t,n)=>this.boundIsInteresting(e,t,n),isEqual:(e,t)=>this.isEqual(e,t),addEq:(e,t,n,r)=>this.addEq(e,t,n,r)});assertedQhead=0;delayIneqsQhead=0;explanation=new fv;coreLiterals=[];numConflicts=0;lowerTerms=[];upperTerms=[];isModelInitialized=!1;canPropagate(){return this.assertedAtoms.length>this.assertedQhead||this.isNewDef||this.solver.columnsWithChangedBounds.size>0||this.delayIneqsQhead<this.delayIneqs.length}propagate(){this.propagateCore()}propagateCore(){let e=this.context;if(this.isModelInitialized=!1,this.flushBoundAxioms(),e.isInconsistent())return!0;if(!this.canPropagate())return!1;let t=this.manager;for(;this.delayIneqsQhead<this.delayIneqs.length&&!e.isInconsistent()&&!e.checkCanceled();this.delayIneqsQhead++){let n=this.delayIneqsQhead;e.pushTrail(()=>{this.delayIneqsQhead=n});let r=this.delayIneqs[this.delayIneqsQhead],i=t.sorts[t.getArg(r,0)],a=t.mkNumeralOfSort(P.zero,i),o=t.mkApp(16,[t.getArg(r,0),t.getArg(r,1)],i),s=t.mkApp(t.getOp(r),[o,a],0),c=this.mkLiteral(r),l=this.mkLiteral(s);this.mkAxiom([L(c),l]),this.mkAxiom([c,L(l)])}for(this.isNewDef=!1;this.assertedQhead<this.assertedAtoms.length&&!e.isInconsistent()&&!e.checkCanceled();){let e=this.assertedAtoms[this.assertedQhead],t=this.boolVarToBound[e.boolVar];if(t!==void 0&&!this.assertBound(e.isTrue,t))return this.setInfeasibilityConflict(),!0;this.assertedQhead++}if(e.isInconsistent())return!0;let n=this.makeFeasible();return e.checkCanceled()||(n===-1?this.setInfeasibilityConflict():n===1&&(this.propagateNla(!0),this.propagateBoundsWithLpSolver())),!0}makeFeasible(){let e=this.solver.findFeasibleSolution();return this.solver.isFeasible()?1:e===1?-1:0}assertBound(e,t){let n=this.solver,r=e?t.constraintTrue:t.constraintFalse;if(n.constraintIsRedundant(r))return n.status!==1;if(n.activate(r),n.status===1)return!1;let i=this.getBoundKind(t,e),a=e?t.value:t.isLower?t.value.sub(P.one):t.value.add(P.one);return(t.isInt||e)&&this.propagateEqs(t.column,r,i,t,a),!0}propagateEqs(e,t,n,r,i){let a=n===2;if(n!==2&&n!==-2||!this.setTermBound(e,t,i,a))return;let o=this.getFixingBound(e,i,!a);o!==void 0&&this.fixedVarEh(r.thVar,e,Q_(Z_(t),o),i)}setTermBound(e,t,n,r){let i=this.solver;if(!i.hasTerm(e)){let t=i.getBound(e,!r);return t!==void 0&&!t.isStrict&&t.value.equals(n)}let a=r?this.lowerTerms:this.upperTerms,o=a[e];return(o===void 0||(r?o.value.compare(n)<0:o.value.compare(n)>0))&&(this.context.pushTrail(()=>{a[e]=o}),a[e]={constraint:t,value:n}),!0}getFixingBound(e,t,n){let r=this.solver;if(r.hasTerm(e)){let i=r.getExternal(e);if(i!==-1){let e=this.getExpr(i);if(this.manager.isNumeral(e)&&this.manager.getRationalValue(e).equals(t))return null}let a=(n?this.lowerTerms:this.upperTerms)[e];return a===void 0||!a.value.equals(t)?void 0:Z_(a.constraint)}let i=r.getBound(e,!n);if(i!==void 0&&i.value.equals(t)&&!i.isStrict)return i.dep}isEqual(e,t){return this.getEnode(e).root===this.getEnode(t).root}reportEqualityOfFixedVars(e,t){let n=this.solver,r=n.getExternal(e),i=n.getExternal(t);if(r===-1||i===-1||this.isEqual(r,i)||this.isIntVar(r)!==this.isIntVar(i))return;let a=P.zero,o=[this.getFixingBound(e,a,!0),this.getFixingBound(e,a,!1),this.getFixingBound(t,a,!0),this.getFixingBound(t,a,!1)];if(!o.some(e=>e===void 0)){this.resetEvidence();for(let e of o)e!==void 0&&this.setEvidenceOfDep(e);this.assignEq(r,i)}}fixedVarEh(e,t,n,r){if(this.propagateOffsetEq(t,n,r))return;let i=this.isIntVar(e),a=this.value2var.get(`${i}:${r}`);if(a===void 0){if(r.isZero())a=this.solver.getExternal(i?this.zeroVar:this.realZeroVar);else if(r.equals(P.one))a=this.solver.getExternal(i?this.oneVar:this.realOneVar);else return}this.isIntVar(a)!==i||this.isEqual(e,a)||(this.resetEvidence(),this.setEvidenceOfDep(n),this.assignEq(e,a))}propagateOffsetEq(e,t,n){if(!n.isZero()||!this.solver.hasTerm(e))return!1;let r=this.getTermCoeffs(this.solver.getTerm(e));if(r.length!==2)return!1;let i=r[0],a=r[1];return!i[1].add(a[1]).isZero()||i[0]===a[0]||this.isEqual(i[0],a[0])||this.isIntVar(i[0])!==this.isIntVar(a[0])?!1:(this.resetEvidence(),this.setEvidenceOfDep(t),this.assignEq(i[0],a[0]),!0)}getTermCoeffs(e){let t=new km(Om),n=(e,r)=>{for(let i of e.coeffs){if(this.solver.hasTerm(i[0])){n(this.solver.getTerm(i[0]),r.mul(i[1]));continue}let e=this.solver.getExternal(i[0]),a=(t.get(e)??P.zero).add(i[1].mul(r));t.has(e)?t.replace(e,a):t.set(e,a)}};return n(e,P.one),[...t]}assignEq(e,t){this.context.pushEq(this.getEnode(e),this.getEnode(t),{kind:`justification`,justification:new dg(this.coreLiterals,[])})}addEq(e,t,n,r){if(this.context.isInconsistent())return!1;let i=this.solver.getExternal(e),a=this.solver.getExternal(t);if(i===-1||a===-1||this.isEqual(i,a)||this.isIntVar(i)!==this.isIntVar(a))return!1;let o=this.manager,s=this.getExpr(i),c=this.getExpr(a);if(!r&&!o.isNumeral(s)&&!o.isNumeral(c)&&(o.getOp(s)===4||o.getOp(c)===4))return!1;this.resetEvidence();for(let e of n)this.setEvidence(e);return this.assignEq(i,a),!0}columnIsInteresting(e){let t=this.solver.getExternal(e);return t!==-1&&t<this.unassignedBounds.length&&this.unassignedBounds[t]>0}boundIsInteresting(e,t,n){let r=this.solver.getExternal(e);if(r===-1||r>=this.bounds.length||this.unassignedBounds[r]===0)return!1;let i=this.context;return this.bounds[r].some(e=>i.getAssignment(XC(e))===0&&this.isBoundImplied(t,n,e)!==void 0)}propagateBoundsWithLpSolver(){if(this.bp.init(),this.bp.propagateBoundsForTouchedRows(),!this.context.checkCanceled()){if(this.solver.status===1)this.setInfeasibilityConflict();else for(let e of this.bp.ibounds){if(this.context.isInconsistent())break;this.propagateLpSolverBound(e)}}}propagateLpSolverBound(e){let t=this.solver.getExternal(e.column);if(t===-1||this.unassignedBounds[t]===0)return;let n=this.context,r=Bb(e),i=!0;for(let a of this.bounds[t]){if(n.getAssignment(XC(a))!==0)continue;let t=this.isBoundImplied(r,e.bound,a);if(t!==void 0){if(i){i=!1,this.resetEvidence(),this.explanation.clear();for(let t of e.explain())for(let e of $_([t[1]]))this.setEvidence(e),this.explanation.addPair(e,t[0])}n.assign(t,new dg(this.coreLiterals,[]))}}}isBoundImplied(e,t,n){let r=XC(n),i=t.compare(n.value),a=e===-2||e===-1,o=e===2||e===1;if(a&&!n.isLower&&i<=0||o&&n.isLower&&i>=0)return r;if(e===-2&&n.isLower&&i<0||e===-1&&n.isLower&&i<=0||e===2&&!n.isLower&&i>0||e===1&&!n.isLower&&i>=0)return L(r)}resetEvidence(){this.coreLiterals=[]}setEvidenceOfDep(e){for(let t of $_([e]))this.setEvidence(t)}setEvidence(e){let t=this.constraintSources[e];t!=null&&this.coreLiterals.push(t)}setInfeasibilityConflict(){this.solver.getInfeasibilityExplanation(this.explanation),this.setConflict()}setConflict(){this.resetEvidence(),this.numConflicts++;for(let e of this.explanation)this.setEvidence(e);this.context.setConflict(new dg(this.coreLiterals,[]),null)}},$C=class extends QC{assumeEqCandidates=[];assumeEqHead=0;initVariableValues(){if(this.isModelInitialized=!1,this.context.checkCanceled()||this.getNumVars()===0)return;let e=this.isModelInitialized;this.context.pushTrail(()=>{this.isModelInitialized=e}),this.isModelInitialized=this.solver.initModel()}isRelevantAndShared(e){return this.context.isRelevant(e.owner)&&this.isShared(e)}randomUpdate(){if(this.nla?.hasRelevantMonomial())return;let e=this.solver,t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Set,r=[];for(let i=0;i<this.getNumVars();i++){if(!this.isRelevantAndShared(this.getEnode(i)))continue;let a=this.registerVar(i),o=`${this.isIntVar(i)}:${e.getValue(a)}`,s=t.get(o);if(s===void 0)t.set(o,i);else if(!this.isEqual(i,s)){if(!e.isFixed(a))r.push(a);else if(!n.has(s)){let t=e.externalToLocalColumn(s);e.isFixed(t)||(n.add(s),r.push(t))}}}r.length>0&&Rb(e,r)}assumeEqs(){if(this.delayedAssumeEqs())return!0;this.randomUpdate();let e=this.context,t=this.solver,n=this.getNumVars(),r=this.assumeEqCandidates.length,i=0,a=e.getRandomValue(),o=/* @__PURE__ */ new Map,s=[];for(let e=0;e<n;e++){let r=(e+a)%n;if(!this.isRelevantAndShared(this.getEnode(r)))continue;let c=this.registerVar(r),l=`${this.isIntVar(r)}:${t.getValue(c)}`,u=this.nla?.isUsingNraModel?s.find(e=>this.isIntVar(e)===this.isIntVar(r)&&this.isEq(e,r)):o.get(l);u===void 0?(o.set(l,r),s.push(r)):this.isEqual(r,u)||(this.assumeEqCandidates.push([r,u]),i++)}return i>0&&e.pushTrail(()=>{N(this.assumeEqCandidates,r)}),this.delayedAssumeEqs()}delayedAssumeEqs(){if(this.assumeEqHead===this.assumeEqCandidates.length)return!1;let e=this.assumeEqHead;for(this.context.pushTrail(()=>{this.assumeEqHead=e});this.assumeEqHead<this.assumeEqCandidates.length;){let e=this.assumeEqCandidates[this.assumeEqHead];if(this.assumeEqHead++,this.isEq(e[0],e[1])&&!this.isEqual(e[0],e[1])&&this.context.assumeEq(this.getEnode(e[0]),this.getEnode(e[1])))return!0}return!1}initModel(e){if(this.initVariableValues(),this.isModelInitialized)for(let t=0;t<this.getNumVars();t++){let n=this.solver.externalToLocalColumn(t),r=n===-1?void 0:this.solver.getExactValue(n);r!==void 0&&(this.isIntVar(t)?r.isInt()&&e.registerValue(this.manager.mkNumeral(r.num)):e.registerValue(this.manager.mkRealNumeral(r)))}}mkValue(e){if(e.thVar<0)return;let t=this.nla;if(t===void 0||!t.isUsingNraModel||this.solver.externalToLocalColumn(e.thVar)===-1)return this.getValueExpr(e.thVar);let n=this.getNlValue(t,e.thVar).value;if(this.isIntVar(e.thVar))return this.manager.mkNumeral(n instanceof P&&n.isInt()?n.num:0n);if(!(n instanceof P))throw new o(`an irrational model value`);return this.manager.mkRealNumeral(n)}isEq(e,t){let n=this.nla;if(n!==void 0&&n.isUsingNraModel)return n.nra.am.compare(this.getNlValue(n,e),this.getNlValue(n,t))===0;let r=this.solver;return r.getValue(this.registerVar(e)).equals(r.getValue(this.registerVar(t)))}getNlValue(e,t){let n=this.solver,r=e.nra.am,i=n.externalToLocalColumn(t);if(!n.hasTerm(i))return e.nra.value(i);let a=new V(P.zero),o=[[i,P.one]];for(;o.length>0;){let t=o.pop();for(let i of n.getTerm(t[0]).coeffs){let s=i[1].mul(t[1]);n.hasTerm(i[0])?o.push([i[0],s]):a=r.add(r.mul(e.nra.value(i[0]),new V(s)),a)}}return a}getValue(e){let t=this.solver.externalToLocalColumn(e);return t===-1?P.zero:this.solver.getModelValue(t)}getValueExpr(e){let t=this.getValue(e);return this.isIntVar(e)?this.manager.mkNumeral(t.floor().num):this.manager.mkRealNumeral(t)}isShared(e){let t=e.root;if(this.manager.getOp(t.owner)===4)return!0;if(t.thVar<0)return!1;if(this.context.qmanager.isShared(t))return!0;for(let e of t.parents){let t=this.manager.getFamily(e.owner);if(t!==1&&t!==0)return!0}return this.isSharedWithUnderspecified(t)}isSharedWithUnderspecified(e){let t=this.manager,n=this.underspecifiedTerms.length;return n===0?!1:e.parents.length>2*n?this.underspecifiedTerms.some(n=>t.someArg(n,t=>this.context.getEnode(t)?.root===e)):e.parents.some(e=>this.isUnderspecified(e.owner))}isUnderspecified(e){let t=this.manager.getOp(e);return t===23||t===19||t===20||t===27||t===28||t===29}},ew=class extends $C{lia=new yy(this.solver);finalCheckEh(e){let t=this.context;if(this.propagateCore())return 1;this.isModelInitialized=!1;let n=this.solver;this.propagateNla(!1);let r=!n.isFeasible()||n.columnsWithChangedBounds.size>0?this.makeFeasible():1;if(r===-1)return this.setInfeasibilityConflict(),1;if(r===0)return t.checkCanceled()?2:1;if(!this.isLiaSat()||!this.checkIdivBounds())return 1;let i=0,a=this.checkNla(e);return a===1||a===0&&!this.nla?.isUsingNraModel&&n.hasInfInt()||(a===2&&(i=2),this.assumeEqs())?1:(this.unsupportedTerms.length>0&&this.initVariableValues(),this.unsupportedTerms.some(e=>t.isRelevant(e))?2:i)}checkNla(e){if(this.context.checkCanceled())return 2;let t=this.nla;if(t===void 0||!t.hasRelevantMonomial())return 0;let n=t.check(e);return n===-1?(this.addLemmas(t),1):n===1?0:2}checkIdivBounds(){let e=this.nla;return e===void 0||(e.checkBoundedDivisions(),this.addLemmas(e),e.lemmas.length===0)}propagateNla(e){let t=this.nla;t!==void 0&&(e?t.incrementalPropagate():t.propagate(),this.addLemmas(t),this.solver.collectMoreRowsForLpPropagation())}addLemmas(e){if(e.isCheckFeasible&&this.makeFeasible()===-1)this.setInfeasibilityConflict();else{for(let t of e.literals){let e=this.mkNlaLiteral(t);this.context.markLiteralAsRelevant(e),this.context.setTrueFirstFlag(R(e))}for(let t of e.lemmas)this.falseCaseOfCheckNla(t);for(let t of e.fixedEqualities)this.addEquality(t.lpVar,t.value,t.explanation);for(let t of e.equalities)this.addEq(t.first,t.second,t.explanation,!1)}}addEquality(e,t,n){let r=t.equals(P.one)?this.oneVar:t.isZero()?this.zeroVar:this.value2var.get(`true:${t}`)??this.value2var.get(`false:${t}`);r===void 0||this.solver.getExternal(e)<0||this.addEq(this.registerVar(r),e,n,!0)}mkNlaLiteral(e){let t=this.solver.constraints;t.isAuxiliaryMode=!0;let n=this.mkNlaLiteralCore(e);return t.isAuxiliaryMode=!1,n}mkNlaLiteralCore(e){let t=e.cmp;if(t===0||t===3){let n=this.mkTermEq(e.term,e.rs),r=this.context.getLiteral(n);return t===3?L(r):r}let n=t===-1||t===2,r=this.context.getLiteral(this.mkBound(e.term,e.rs,n));return t===-1||t===1?L(r):r}mkTermEq(e,t){let n=this.manager,r=this.getTermCoeffs(e),i=t.isInt()&&r.every(e=>this.isIntVar(e[0])&&e[1].isInt()),a=this.coeffsToApp(r,i),o=n.mkNumeralOfSort(t,i?1:2);if(a===o)return n.trueExpr;let s=n.mkEq(a,o);return this.context.internalize(s,!0),this.context.markAsRelevant(s),s}falseCaseOfCheckNla(e){let t=this.context,n=e.ineqs.map(e=>L(this.mkNlaLiteral(e)));this.resetEvidence(),this.coreLiterals.push(...n),this.numConflicts++;for(let t of e.expl)this.setEvidence(t);let r=[];for(let e of this.coreLiterals){let n=L(e);if(r.push(n),t.markLiteralAsRelevant(n),t.getAssignment(n)===1)return}t.mkThAxiom(r)}isLiaSat(){if(this.context.checkCanceled())return!1;let e=this.lia.check();if(e.kind===`branch`)this.mkBound(this.lia.term,e.offset,!e.isUpper);else if(e.kind===`cut`){this.resetEvidence();for(let e of this.lia.explanation)this.setEvidence(e);let t=this.mkBound(this.lia.term,e.offset,!e.isUpper);this.context.assign(this.context.getLiteral(t),new dg(this.coreLiterals,[]))}else e.kind===`conflict`&&(this.explanation.clear(),this.explanation.addExplanation(this.lia.explanation),this.setConflict());return e.kind===`sat`}mkBound(e,t,n){let r=this.manager,i=this.context,a=this.getTermCoeffs(e),o=t,s=n,c=o.den,l=a.every(e=>this.isIntVar(e[0]));if(l){for(let e of a)c=Nm(c,e[1].den);if(c!==1n){let e=P.of(c);o=o.mul(e),a=a.map(t=>[t[0],t[1].mul(e)])}let e=0n;for(let t of a)e=jm(e,t[1].num);if(e!==0n&&e!==1n){let t=P.of(e);a=a.map(e=>[e[0],e[1].div(t)]),o=s?o.div(t).ceil():o.div(t).floor()}}a.length>0&&a[0][1].isNegative()&&(o=o.neg(),s=!s,a=a.map(e=>[e[0],e[1].neg()]));let u=l?1:2,d=this.coeffsToApp(a,l),f=r.mkApp(s?12:11,[d,r.mkNumeralOfSort(o,u)],0);return i.internalize(f,!0),i.markAsRelevant(f),f}coeffsToApp(e,t){let n=this.manager,r=t?1:2,i=e.filter(e=>!e[1].isZero()).map(e=>{let i=this.getExpr(e[0]),a=!t&&n.isInt(i)?n.mkApp(24,[i],2):i;return e[1].equals(P.one)?a:n.mkApp(18,[n.mkNumeralOfSort(e[1],r),a],r)});return i.length===0?n.mkNumeralOfSort(P.zero,r):i.length===1?i[0]:n.mkApp(15,i,r)}},tw=class extends ew{pushScopeEh(){this.scopes.push({boundsLimit:this.boundsTrail.length,assertedQhead:this.assertedQhead,assertedAtomsLimit:this.assertedAtoms.length,numVars:this.getNumVars()}),this.solver.push(),this.nla?.push()}popScopeEh(e=1){if(e===0)return;let t=this.scopes.length-e,n=this.scopes[t];for(let e=this.boundsTrail.length;e-->n.boundsLimit;)this.bounds[this.boundsTrail[e]].pop();N(this.boundsTrail,n.boundsLimit),N(this.assertedAtoms,n.assertedAtomsLimit),this.assertedQhead=n.assertedQhead,N(this.scopes,t),this.solver.pop(e);let r=this.solver.constraints.constraints.length;this.constraintSources.length>r&&N(this.constraintSources,r),this.newBounds=[],this.nla?.pop(e),N(this.varEnodes,n.numVars)}restartEh(){let e=this.restartPairs;this.restartPairs=[];for(let t of e){if(this.context.isInconsistent())break;this.mkEqAxioms(t[0],t[1])}}initSearchEh(){this.numConflicts=0,this.restartPairs=[]}};const nw=1e-100,rw=1.1;var iw=class extends Gg{theory;qmanager;conflictResolution=new Mg(this);dynAck=new Ng(this);qhead=0;scopeAssignedLimits=[];scopeAuxClauseLimits=[];scopeTrailLimits=[];baseScopeLemmaLimits=[];atomPropagationQueue=[];thEqQueue=[];thDiseqQueue=[];bvarInc=1;agility=0;numConflicts=0;numConflictsSinceRestart=0;numConflictsSinceLemmaGc=0;restartThreshold=100;restartOuterThreshold=100;isPhaseCacheOn=!0;phaseCounter=0;finalCheckIndex=0;r1ParentGenerations=/* @__PURE__ */ new Map;erasedGenerations=/* @__PURE__ */ new Map;lastSearchFailure=0;modelState={kind:`none`};constructor(e,t){super(e,t.relevancyLevel>0,t.relevancyLevel>0),this.qmanager=new X_(this,t.isMbqi)}setupContext(){this.theory=new tw(this),this.theory.init()}checkCanceled(){return!this.manager.limit.inc()}assign(e,t,n=!1){let r=this.assignment[e];r===-1?this.setConflict(t,L(e)):r===0&&this.assignCore(e,t,n)}assignCore(e,t,n){let r=R(e);this.assignedLiterals.push(e),this.assignment[e]=1,this.assignment[L(e)]=-1,this.justifications[r]=t,this.setLevel(r,this.scopeLevel);let i=jg(e);this.hasBoolVarFlag(r,33554432)&&(this.agility*=.9999,!n&&this.hasBoolVarFlag(r,67108864)===i&&(this.agility+=9999999999998899e-20)),this.setBoolVarFlag(r,Bg,!0),this.setBoolVarFlag(r,67108864,!i),this.isAtom(r)&&this.isRelevant(this.boolVar2Expr[r])&&this.atomPropagationQueue.push(e)}bcp(){for(;this.qhead<this.assignedLiterals.length;){if(this.checkCanceled())return!0;let e=this.assignedLiterals[this.qhead];this.qhead++;let t=L(e),n=this.binaryWatches[e];if(n!==void 0&&n.length>0){let t=this.getBinJustification(e);for(let e=n.length-1;e>=0;e--){let r=n[e],i=this.assignment[r];if(i===-1)return this.setConflict(t,L(r)),!1;i===0&&this.assignCore(r,t,!1)}}let r=this.watches[e];if(r===void 0)continue;let i=this.clauses.data,a=0,o=0;for(;o<r.length;o++){let e=r[o],n=e+2;i[n]===t&&(i[n]=i[n+1],i[n+1]=t);let s=i[n],c=this.assignment[s];if(c===1){r[a++]=e;continue}let l=!1,u=n+i[e];for(let r=n+2;r<u;r++){let a=i[r];if(this.assignment[a]!==-1){this.addWatch(L(a),e),i[n+1]=a,i[r]=t,l=!0;break}}if(!l){if(r[a++]=e,c===-1){for(o++;o<r.length;o++)r[a++]=r[o];return N(r,a),this.setConflict(e,null),!1}this.assignCore(s,e,!1)}}N(r,a)}return!0}propagateEqs(){for(let e=0;e<this.eqPropagationQueue.length&&!this.checkCanceled();e++){let t=this.eqPropagationQueue[e];if(this.addEq(t.lhs,t.rhs,t.justification),this.isInconsistent())return this.eqPropagationQueue=[],!1}return this.eqPropagationQueue=[],!0}propagateAtoms(){let e=this.atomPropagationQueue;for(let t=0;t<e.length&&!this.checkCanceled();t++){let n=e[t],r=R(n),i=this.assignment[I(r)];if(this.hasBoolVarFlag(r,536870912)&&this.propagateBoolVarEnode(r),this.isInconsistent())return!1;if(this.hasBoolVarFlag(r,134217728)){let e=this.boolVar2Expr[r];if(!this.manager.isBool(this.manager.getArg(e,0))){let t=this.exprToEnode[this.manager.getArg(e,0)],a=this.exprToEnode[this.manager.getArg(e,1)];t!==void 0&&a!==void 0&&(i===1?this.addEq(t,a,{kind:`equation`,literal:n}):!this.addDiseq(t,a)&&!this.isInconsistent()&&this.setConflict(new og(t,a),I(r,!0)))}}else this.hasBoolVarFlag(r,-2147483648)?this.theory.assignEh(r,i===1):this.hasBoolVarFlag(r,1073741824)&&i===1&&this.qmanager.assignEh(this.boolVar2Expr[r]);if(this.isInconsistent())return!1}return this.atomPropagationQueue=[],!0}propagateBoolVarEnode(e){let t=this.assignment[I(e)],n=this.exprToEnode[this.boolVar2Expr[e]];if(n===void 0)return;let r=t===-1;n.isMergeTf&&this.addEq(n,r?this.falseEnode:this.trueEnode,{kind:`equation`,literal:I(e,r)});let i=n.root;if(i!==this.trueEnode&&i!==this.falseEnode&&(n===i||!this.isRelevant(i.owner)||this.assignment[I(this.getBoolVar(i.owner))]!==t)){let e=n;for(n=n.next;n!==e;){let i=this.getBoolVar(n.owner);this.assignment[I(i)]!==t&&this.assign(I(i,r),this.mkMpIff(e,n)),n=n.next}}}mkMpIff(e,t){return new lg(e,t,e=>this.enodeToLiteral(e))}relevantEh(e){let t=this.findBoolVar(e);if(t!==void 0&&this.isAtom(t)){let e=this.assignment[I(t)];e!==0&&this.atomPropagationQueue.push(I(t,e===-1))}if(this.manager.kinds[e]!==0)return;let n=this.exprToEnode[e];n!==void 0&&this.qmanager.relevantEh(n),(this.manager.getFamily(e)===1||n!==void 0&&n.thVar>=0)&&this.theory.relevantEh(e)}propagateRelevancy(e){for(let t=e;t<this.assignedLiterals.length;t++){let e=this.assignedLiterals[t];this.relevancy.assignEh(this.boolVar2Expr[R(e)],!jg(e))}this.relevancy.propagate()}propagateThEqs(){let e=this.thEqQueue;for(let t=0;t<e.length&&!this.isInconsistent();t+=2)this.theory.newEqEh(e[t],e[t+1]);this.thEqQueue=[]}propagateThDiseqs(){let e=this.thDiseqQueue;for(let t=0;t<e.length&&!this.isInconsistent();t+=2)this.theory.newDiseqEh(e[t],e[t+1]);this.thDiseqQueue=[]}canPropagate(){return this.qhead!==this.assignedLiterals.length||this.relevancy.canPropagate()||this.atomPropagationQueue.length>0||this.qmanager.canPropagate()||this.theory.canPropagate()||this.eqPropagationQueue.length>0||this.thEqQueue.length>0||this.thDiseqQueue.length>0}propagate(){for(;;){if(this.isInconsistent())return!1;let e=this.qhead;if(!this.bcp()||(this.propagateRelevancy(e),this.isInconsistent())||!this.propagateAtoms()||!this.propagateEqs()||(this.propagateThEqs(),this.propagateThDiseqs(),this.isInconsistent())||(this.theory.propagate(),this.isInconsistent())||(this.checkCanceled()||this.qmanager.propagate(),this.isInconsistent()))return!1;if(this.isResourceLimitExceeded())return this.qhead=e,!0;if(!this.canPropagate())return!0}}getClosestVar(e){for(let t=e;t!==null;t=t.transTarget)if(t.thVar>=0)return t.thVar;return-1}invertTrans(e){let t=e.transTarget,n=e.transJustification,r=e;for(e.transTarget=null;t!==null;){let e=t.transTarget,i=t.transJustification;t.transTarget=r,t.transJustification=n,r=t,t=e,n=i}}pushNewThEq(e,t){this.thEqQueue.push(e,t)}pushNewThDiseq(e,t){let n=this.theory;n.getEnode(e).isInterpreted&&n.getEnode(t).isInterpreted||this.thDiseqQueue.push(e,t)}pushNewThDiseqs(e,t){for(let n of e.parents){if(!n.isEq||this.assignment[I(this.getBoolVar(n.owner))]!==-1)continue;let r=n.getArg(0),i=n.getArg(1);if(i.root===e.root){let e=r;r=i,i=e}let a=this.getClosestVar(i),o=this.getClosestVar(r),s=o>=0?o:t;a>=0&&s!==a&&this.pushNewThDiseq(s,a)}}mergeTheoryVars(e,t,n){let r=e.root,i=t.root;if(i.thVar<0&&r.thVar<0)return;let a=n.kind===`justification`,o=this.getClosestVar(e),s=this.getClosestVar(t);o>=0&&s>=0?a||this.pushNewThEq(o,s):s<0&&o>=0?this.pushNewThDiseqs(i,o):s>=0&&o<0&&(r.thVar=s,this.pushNewThDiseqs(r,s))}attachThVar(e,t){let n=e.thVar;if(n>=0){e.thVar=t,this.pushTrail(()=>{e.thVar=n}),this.pushNewThEq(t,n);return}let r=e.root,i=r.thVar;e.thVar=t,this.trailInts.push(t),this.trailNodes.push(e),this.trailKinds.push(9),i<0?(r!==e&&(r.thVar=t),this.pushNewThDiseqs(r,t)):r!==e&&this.pushNewThEq(i,t)}addEq(e,t,n){let r=e,i=t,a=r.root,o=i.root;if(a===o)return;if(a.isInterpreted&&o.isInterpreted){this.setConflict(new cg(r,i,n),null);return}if(a.classSize>o.classSize&&!o.isInterpreted||a.isInterpreted){let e=r;r=i,i=e;let t=a;a=o,o=t}this.isRelevant(a.owner)?this.markAsRelevant(o.owner):this.isRelevant(o.owner)&&this.markAsRelevant(a.owner);let s=o.parents.length;this.qmanager.addEqEh(a,o),this.mergeTheoryVars(i,r,n),this.invertTrans(r),r.transTarget=i,r.transJustification=n,this.removeParentsFromCgTable(a);let c=a;do c.root=o,c=c.next;while(c!==a);this.reinsertParentsIntoCgTable(a,o,r,i,n),this.trailInts.push(s),this.trailNodes.push(a,r),this.trailKinds.push(8),i.isBool&&this.propagateBoolEnodeAssignment(a,o,r,i);let l=a.next;a.next=o.next,o.next=l,o.classSize+=a.classSize}removeParentsFromCgTable(e){for(let t of e.parents)t.isMarked||!t.isCgr()||t.isTrueEq()||(t.isMarked=!0,t.isCgcEnabled&&(t.isEq||this.r1ParentGenerations.set(t,t.generation),this.cgTable.erase(t)))}reinsertParentsIntoCgTable(e,t,n,r,i){let a=e.parents;for(let e=0;e<a.length;e++){let o=a[e];if(!o.isMarked)continue;if(o.isMarked=!1,o.isEq){let e=o.getArg(0),t=o.getArg(1);if(e.root===t.root){let a=I(this.getBoolVar(o.owner)),s=this.assignment[a];s!==1&&(s===-1&&i.kind===`congruence`&&this.dynAck.cgConflictEh(n.owner,r.owner),this.assign(a,new og(e,t)));continue}}if(!o.isCgcEnabled){t.addParent(o);continue}let s=o.isEq?0:this.r1ParentGenerations.get(o)??this.getGeneration(o),c=this.cgTable.insert(o);c===o?(o.generation=s,t.addParent(o)):(o.cg=c,this.mergeCgcGenerations(o,s,c),c.root!==o.root&&this.pushEq(o,c,vg(o,c)))}this.r1ParentGenerations.clear()}undoTrailEntry(e){switch(e){case 8:{let e=this.popTrailNode();this.undoAddEq(this.popTrailNode(),e,this.popTrailInt());return}case 9:{let e=this.popTrailNode(),t=this.popTrailInt();e.thVar=-1,e.root!==e&&e.root.thVar===t&&(e.root.thVar=-1);return}default:super.undoTrailEntry(e)}}undoAddEq(e,t,n){let r=e.root;r.classSize-=e.classSize;let i=e.next;e.next=r.next,r.next=i;let a=this.erasedGenerations;a.clear();for(let e=n;e<r.parents.length;e++){let t=r.parents[e];t.isCgcEnabled&&(t.isEq||a.set(t,t.generation),this.cgTable.erase(t))}let o=e;do o.root=e,o=o.next;while(o!==e);N(r.parents,n);for(let t of e.parents){if(!t.isCgcEnabled)continue;let e=t.cg;if(t.isTrueEq()||t!==e&&_g(t,e))continue;let n=1e5;if(t.isEq)n=0;else if(t===e){let e=a.get(t);if(e===void 0)continue;n=e}let r=this.cgTable.insert(t);t.cg=r,r===t&&(t.generation=n)}r.thVar>=0&&this.theory.getEnode(r.thVar).root!==r&&(r.thVar=-1),t.transTarget=null,this.invertTrans(e)}propagateBoolEnodeAssignment(e,t,n,r){if(t===this.falseEnode||t===this.trueEnode){let n=t===this.falseEnode,r=e;do{let e=I(this.getBoolVar(r.owner),n);this.assignment[e]!==1&&this.assign(e,new sg(r)),r=r.next}while(r!==e);return}let i=this.assignment[I(this.getBoolVar(n.owner))],a=this.assignment[I(this.getBoolVar(r.owner))];i!==a&&(a===0?this.propagateBoolEnodeAssignmentCore(n,r):this.propagateBoolEnodeAssignmentCore(r,n))}propagateBoolEnodeAssignmentCore(e,t){let n=this.assignment[I(this.getBoolVar(e.owner))],r=t;do{let t=this.getBoolVar(r.owner),i=this.assignment[I(t)];i!==n&&(i!==0&&_g(e,r)&&e.numArgs>0&&this.dynAck.cgConflictEh(e.owner,r.owner),this.assign(I(t,n===-1),this.mkMpIff(e,r))),r=r.next}while(r!==t)}addDiseq(e,t){let n=e.root;if(n===t.root)return n.thVar>=0;let r=this.getClosestVar(e),i=this.getClosestVar(t);return r>=0&&i>=0&&this.pushNewThDiseq(r,i),!0}assumeEq(e,t){if(e.root===t.root)return!1;let n=this.mkEqAtom(e.owner,t.owner),r=!1;if(!this.isBInternalized(n)){this.internalizeFormulaCore(n,!0);let e=this.getBoolVar(n);this.setBoolVarFlag(e,Vg,!0),this.setTrueFirstFlag(e),this.theory.internalizeEqEh(n),r=!0}let i=this.getBoolVar(n);return this.hasBoolVarFlag(i,268435456)||(this.setTrueFirstFlag(i),r=!0),this.assignment[I(i)]===0&&(r=!0),this.isRelevant(n)||(this.markAsRelevant(n),r=!0),r}incBvarActivity(e){if(this.activity[e]+=this.bvarInc,this.activity[e]>1e100){for(let e=0;e<this.numBoolVars;e++)this.activity[e]*=nw;this.bvarInc*=nw}this.caseSplitQueue.activityIncreased(e)}pushScope(){this.scopeLevel++,this.scopeAssignedLimits.push(this.assignedLiterals.length),this.scopeAuxClauseLimits.push(this.auxClauses.length),this.scopeTrailLimits.push(this.trailKinds.length),this.relevancy.push(),this.qmanager.push(),this.theory.pushScopeEh()}cacheGenerationOfExpr(e,t,n){let r=this.manager,i=[e];for(;i.length>0;){let e=i.pop()??-1;if(!n.has(e)){if(n.add(e),r.kinds[e]===0){let n=this.exprToEnode[e];if(n!==void 0){if(n.iscopeLevel<=t)continue;this.cachedGeneration.set(e,this.getGeneration(n))}for(let t=0;t<r.getNumArgs(e);t++){let n=r.getArg(e,t);r.kinds[n]!==1&&i.push(n)}}else r.kinds[e]===2&&this.isBInternalized(e)&&(this.cachedGeneration.set(e,this.qmanager.getGeneration(e)),i.push(r.getQuantifier(e).body))}}}cacheGenerationOfLiterals(e,t,n){for(let r of e){let e=R(r);this.getInternLevel(e)>t&&this.cacheGenerationOfExpr(this.boolVar2Expr[e],t,n)}}cacheGeneration(e,t){let n=Math.min(this.scopeLevel,this.clausesToReinit.length-1);for(let r=e;r<=n;r++)for(let n of this.clausesToReinit[r])this.cacheGenerationOfLiterals(this.clauses.getLiterals(n),e,t)}unassignVars(e){for(let t=this.assignedLiterals.length-1;t>=e;t--){let e=this.assignedLiterals[t];this.assignment[e]=0,this.assignment[L(e)]=0,this.justifications[R(e)]=null,this.caseSplitQueue.unassignVar(R(e))}N(this.assignedLiterals,e),this.qhead=e}popScopeCore(e,t){let n=this.scopeLevel-e;this.cacheGeneration(n,t),this.qmanager.pop(e),n<this.baseLevel&&(this.deleteClauses(this.lemmas,this.baseScopeLemmaLimits[n]),N(this.baseScopeLemmaLimits,n)),this.conflict=null,this.deleteClauses(this.auxClauses,this.scopeAuxClauseLimits[n]),this.relevancy.pop(e),this.unassignVars(this.scopeAssignedLimits[n]),this.popTrail(this.scopeTrailLimits[n]),this.theory.popScopeEh(e),this.eqPropagationQueue=[],this.thEqQueue=[],this.thDiseqQueue=[],this.atomPropagationQueue=[],N(this.scopeAssignedLimits,n),N(this.scopeAuxClauseLimits,n),N(this.scopeTrailLimits,n),this.scopeLevel=n,n<this.baseLevel&&(this.baseLevel=n,this.searchLevel=n);let r=this.numBoolVars;return this.reinitClauses(e,r),r}popScope(e){this.popScopeCore(e,/* @__PURE__ */ new Set),this.cachedGeneration.clear()}reinitClauses(e,t){if(this.clausesToReinit.length===0)return;let n=this.clauses,r=Math.min(this.scopeLevel+e,this.clausesToReinit.length-1);for(let e=this.scopeLevel+1;e<=r;e++){let r=this.clausesToReinit[e];for(let e of r){if(n.checkLive(e),n.isDeleted(e)){n.setReinit(e,!1),n.setReinternalizeAtoms(e,!1),n.free(e);continue}let r=!1,i=n.getAtoms(e);if(n.isReinternalizeAtoms(e)&&i.length>0){for(let r=0;r<2;r++)R(n.getLiteral(e,r))<t&&this.removeWatchLiteral(e,r);let a=n.getKind(e)===3;for(let t=0;t<i.length;t++){let r=i[t];this.internalize(r,!this.manager.isNot(r));let o=I(this.getBoolVar(r),n.getAtomSign(e,t));n.setLiteral(e,t,o),a&&this.markLiteralAsRelevant(o)}n.swapLiterals(e,0,this.selectWatchLiteral(e,0)),n.swapLiterals(e,1,this.selectWatchLiteral(e,1)),this.addWatchLiteral(e,0),this.addWatchLiteral(e,1);let o=n.getLiteral(e,0);this.assignment[o]===-1?this.setConflict(e,null):this.assignment[n.getLiteral(e,1)]===-1&&this.assign(o,e),r=!0}else{let t=n.getLiteral(e,0),i=n.getLiteral(e,1);n.getKind(e)===3&&(this.markLiteralAsRelevant(t),this.markLiteralAsRelevant(i)),this.assignment[t]===-1&&this.isEmptyClause(e)?(this.setConflict(e,null),r=!0):this.assignment[i]===-1&&this.assignment[t]===0&&this.isUnitClause(e)&&(this.assign(t,e),r=!0)}if(r&&this.scopeLevel>this.baseLevel){for(;this.clausesToReinit.length<=this.scopeLevel;)this.clausesToReinit.push([]);this.clausesToReinit[this.scopeLevel].push(e)}else n.isReinternalizeAtoms(e)&&this.releaseAtoms(e),n.setReinit(e,!1),n.setReinternalizeAtoms(e,!1)}this.clausesToReinit[e]=[]}}isEmptyClause(e){let t=this.clauses;for(let n=0;n<t.getNumLiterals(e);n++)if(this.assignment[t.getLiteral(e,n)]!==-1)return!1;return!0}isUnitClause(e){let t=this.clauses,n=!1;for(let r=0;r<t.getNumLiterals(e);r++){let i=this.assignment[t.getLiteral(e,r)];if(i===1)return!1;if(i===0){if(n)return!1;n=!0}}return n}guess(e){return this.manager.kinds[this.boolVar2Expr[e]]===2?!1:this.hasBoolVarFlag(e,268435456)?!0:this.isPhaseCacheOn&&this.hasBoolVarFlag(e,33554432)&&this.hasBoolVarFlag(e,67108864)}updatePhaseCacheCounter(){this.phaseCounter++,!(this.phaseCounter<(this.isPhaseCacheOn?400:100))&&(this.phaseCounter=0,this.isPhaseCacheOn=!this.isPhaseCacheOn)}decide(){let e=this.caseSplitQueue.nextCaseSplit();if(e===void 0)return!1;let t=this.guess(e);return this.pushScope(),this.assign(I(e,!t),`axiom`,!0),!0}resolveConflict(){this.numConflicts++,this.numConflictsSinceRestart++,this.numConflictsSinceLemmaGc++,this.atomPropagationQueue=[],this.eqPropagationQueue=[],this.thEqQueue=[],this.thDiseqQueue=[];let e=this.scopeLevel===0?0:this.scopeAssignedLimits[this.scopeLevel-1];for(let t=e;t<this.assignedLiterals.length;t++)this.setBoolVarFlag(R(this.assignedLiterals[t]),Bg,!1);let t=this.conflictResolution;if(this.conflict===null||!t.resolve(this.conflict.justification,this.conflict.notLiteral))return!1;let n=t.newScopeLevel,r=t.lemma,i=t.lemmaAtoms.items,a=/* @__PURE__ */ new Set;t.lemmaIscopeLevel>n&&this.cacheGenerationOfLiterals(r,n,a);let o=r.map(e=>this.isRelevant(this.boolVar2Expr[R(e)])),s=this.popScopeCore(this.scopeLevel-n,a);if(t.lemmaIscopeLevel>this.scopeLevel)for(let e=0;e<r.length;e++){let t=r[e];R(t)<s||(this.internalize(i[e],!0),r[e]=jg(t)?L(this.getLiteral(i[e])):this.getLiteral(i[e]))}for(let e=0;e<r.length;e++)o[e]&&!this.isRelevant(this.boolVar2Expr[R(r[e])])&&this.markLiteralAsRelevant(r[e]);return this.cachedGeneration.clear(),this.mkClause([...r],null,1),t.lemmaAtoms.reset(),this.bvarInc*=1.052,this.updatePhaseCacheCounter(),!0}finalCheck(){let e=this.qmanager,t=e.finalCheckEh(!1);if(t!==0)return t;let n=this.finalCheckIndex,r=0,i=0,a=1,o=1;for(;;){let t=this.finalCheckIndex===0;t||(this.manager.initFiniteSetPlugin(),this.getRandomValue());let s=t?this.theory.finalCheckEh(a):e.finalCheckEh(!0);t&&(o=Math.max(o,2));let c=t&&this.checkCanceled();if(c?i=3:t&&s===2&&(i=1),this.finalCheckIndex=(this.finalCheckIndex+1)%2,s===1)return 1;if((s===2||c)&&(r=2),this.finalCheckIndex===n){if(a>=o||r===0||this.canPropagate())break;a++,r=0,i=0}}return this.canPropagate()?1:(r===2&&i!==0&&(this.lastSearchFailure=i),r)}boundedSearch(){for(;;){for(;!this.propagate();){if(!this.resolveConflict())return-1;if(!this.isInconsistent()&&(this.isResourceLimitExceeded()||this.checkCanceled()||this.numConflictsSinceRestart>this.restartThreshold&&this.scopeLevel-this.baseLevel>2))return 0;this.numConflictsSinceLemmaGc>5e3&&this.delInactiveLemmas(),this.dynAck.propagateEh()}if(this.isResourceLimitExceeded()&&!this.isInconsistent()||this.checkCanceled())return 0;if(!this.decide()){if(this.isInconsistent())return-1;let e=this.finalCheck();if(e===0)return 1;if(e===2)return 0}if(this.isResourceLimitExceeded()&&!this.isInconsistent())return 0}}isResourceLimitExceeded(){return this.isSearching&&(this.lastSearchFailure!==0||this.checkCanceled())?!0:this.checkCanceled()}resetModel(){let e=this.modelState;e.kind!==`none`&&e.kind!==`generated`&&(e.kind===`final`&&e.model.decRef(),e.generated.model.decRef(),this.modelState={kind:`generated`,generated:e.generated})}mkProtoModel(){this.modelState.kind!==`none`&&this.modelState.generated.model.decRef();let e=Qg(this);return e.model.incRef(),this.modelState={kind:`generated`,generated:e},this.qmanager.adjustModel(e.model),e.model.completePartialFuncs(!1),e.model.cleanup(),e.model.incRef(),this.modelState={kind:`proto`,generated:e},e}getModel(){if(this.modelState.kind===`final`)return this.modelState.model;let e=this.modelState.kind===`proto`?this.modelState.generated:this.mkProtoModel(),t=e.model.mkModel();for(let e of this.manager.macros)t.constInterps.has(e[0])||t.registerConst(e[0],e[1]);return t.incRef(),this.modelState={kind:`final`,generated:e,model:t},t}validateModel(e){let t=this.manager;for(let n of this.assignedLiterals){let r=this.boolVar2Expr[R(n)];if(!this.isRelevant(r))continue;let i=jg(n)?t.mkNot(r):r;t.incRef(i);let a=t.isGround(i)?e.eval(i,!1):-1;if(a!==-1&&t.decRef(a),t.decRef(i),a===t.falseExpr)return!1}return!0}restart(e,t){let n=this.qmanager;this.resetModel();let r=!1;if(this.lastSearchFailure!==0){if(this.lastSearchFailure!==1||e===-1||this.isInconsistent()||!n.hasQuantifiers()||!n.isModelBased())return e;let t=this.mkProtoModel();if(n.checkModel(t.model,t.root2value)!==2)return e;this.lastSearchFailure=0,e=0,r=!0}if(e===-1)return-1;if(e===1&&!n.hasQuantifiers())return 1;if(e===1){let e=this.mkProtoModel(),t=n.isModelBased()?n.checkModel(e.model,e.root2value):1;if(t===0)return 1;if(t===1)return this.lastSearchFailure=2,0}if(this.numConflictsSinceRestart>=this.restartThreshold&&(this.restartThreshold=Math.trunc(this.restartThreshold*rw),this.restartThreshold>this.restartOuterThreshold&&(this.restartThreshold=100,this.restartOuterThreshold=Math.trunc(this.restartOuterThreshold*rw))),this.numConflictsSinceRestart=0,(r||e===1||this.agility<.18)&&(this.scopeLevel>t&&this.popScope(this.scopeLevel-t),this.isInconsistent()||this.theory.restartEh(),this.isInconsistent()||n.restartEh(),this.isInconsistent()))return this.resolveConflict(),-1}isDeletable(e){let t=this.clauses;return!t.isReinit(e)&&this.justifications[R(t.getLiteral(e,0))]!==e&&this.justifications[R(t.getLiteral(e,1))]!==e}hasMoreThanKUnassignedLiterals(e,t){let n=this.clauses,r=t;for(let t=0;t<n.getNumLiterals(e);t++)if(this.assignment[n.getLiteral(e,t)]===0&&--r===0)return!0;return!1}delInactiveLemmas(){let e=this.lemmas,t=this.baseLevel===0?0:this.baseScopeLemmaLimits[this.baseLevel-1],n=e.length-t,r=t+Math.trunc(n/16)*15,i=t;for(let n=t;n<e.length;n++){let t=e[n];this.clauses.checkLive(t),this.isDeletable(t)&&(this.clauses.isDeleted(t)||this.clauses.getActivity(t)<500&&this.hasMoreThanKUnassignedLiterals(t,n>=r?45:6))?this.deleteClause(t):e[i++]=t}N(e,i),this.numConflictsSinceLemmaGc=0}push(){this.popToBaseLevel(),this.pushScope(),this.baseScopeLemmaLimits.push(this.lemmas.length),this.baseLevel++,this.searchLevel++}pop(e){this.popToBaseLevel(),this.popScope(e)}popToBaseLevel(){this.scopeLevel>this.baseLevel&&this.popScope(this.scopeLevel-this.baseLevel)}internalizeAssertions(e){let t=e.reduce();if(e.isInconsistent)this.setConflict(`axiom`,null);else for(let e of t){if(this.isInconsistent())break;this.internalizeAssertion(e,0)}}initAssumptions(e){if(e.length>0){if(this.propagate(),this.isInconsistent())return;this.delInactiveLemmas(),this.pushScope();for(let t of e){if(this.isInconsistent())break;this.internalizeAssertion(t,0)}}this.searchLevel=this.scopeLevel}search(){if(this.isInconsistent())return-1;this.resetModel(),this.theory.initSearchEh(),this.qmanager.initSearchEh(),this.dynAck.initSearchEh(),this.numConflicts=0,this.numConflictsSinceRestart=0,this.numConflictsSinceLemmaGc=0,this.restartThreshold=100,this.restartOuterThreshold=100,this.agility=0,this.finalCheckIndex=0,this.lastSearchFailure=0,this.isSearching=!0;let e=this.scopeLevel,t;for(;t===void 0;){let n=this.boundedSearch();t=n!==-1&&this.checkCanceled()?0:this.restart(n,e)}return this.isSearching=!1,t}getNumConflicts(){return this.numConflicts}},aw=class{manager;occs=/* @__PURE__ */ new Map;pinned;assertions=/* @__PURE__ */ new Map;trail;scopes=[];cache=/* @__PURE__ */ new Map;cacheUndo=[];depth=0;numSteps=0;rewriter;constructor(e){this.manager=e,this.pinned=new F(e),this.trail=new F(e),this.rewriter=new Xh(e,Yh)}apply(e){let t=this.manager;if(e.isInconsistent)return;this.countOccurrences(e);let n=e.forms.size;for(let r=0;!e.isInconsistent&&r<n;r++){this.depth=0;let i=this.simplify(e.forms.items[r]);r<n-1&&!t.isTrue(i)&&!t.isFalse(i)&&this.assertExpr(i,!1),e.update(r,i),t.decRef(i)}this.pop(this.scopes.length),this.countOccurrences(e);for(let n=e.forms.size;!e.isInconsistent&&n>0;){this.depth=0,n--;let r=this.simplify(e.forms.items[n]);n>0&&!t.isTrue(r)&&!t.isFalse(r)&&this.assertExpr(r,!1),e.update(n,r),t.decRef(r)}this.pop(this.scopes.length)}release(){this.restoreCache(0),this.pinned.reset()}countOccurrences(e){let t=this.manager,n=/* @__PURE__ */ new Set,r=[],i=e=>{t.getRefCount(e)>1&&this.occs.set(e,(this.occs.get(e)??0)+1),!n.has(e)&&(n.add(e),r.push(e))};for(let n of e.forms.items)for(this.pinned.push(n),i(n);r.length>0;){let e=r.pop();if(t.kinds[e]===0)for(let n=t.getNumArgs(e)-1;n>=0;n--)i(t.getArg(e,n))}}isShared(e){return this.manager.getRefCount(e)>1&&(this.occs.get(e)??0)>1}assertExpr(e,t){let n=this.manager,r=e,i=t;for(;n.isNot(r);)r=n.getArg(r,0),i=!i;let a=!0;if((this.isShared(r)||this.isShared(e))&&(this.scopes.push(this.trail.size),a=!1,this.assertEqCore(r,i?n.falseExpr:n.trueExpr)),i||n.getOp(r)!==2)return;let o=n.getArg(r,0),s=n.getArg(r,1),c=n.isUniqueValue(s);if(!c&&!n.isUniqueValue(o))return;let l=c?o:s;this.isShared(l)&&(a&&this.scopes.push(this.trail.size),this.assertEqCore(l,c?s:o))}assertEqCore(e,t){this.assertions.has(e)||(this.assertions.set(e,t),this.trail.push(e))}pop(e){if(e===0)return;let t=this.scopes.length,n=this.scopes[t-e];for(;this.trail.size>n;)this.assertions.delete(this.trail.items[this.trail.size-1]),this.trail.pop();N(this.scopes,this.scopes.length-e);for(let n=0;n<e;n++)this.restoreCache(t--)}restoreCache(e){let t=this.manager,n=this.cacheUndo[e];if(n!==void 0){for(let e=n.length-1;e>=0;e--){let r=this.cache.get(n[e]);t.decRef(r.pop().to),!(r.length>0)&&(this.cache.delete(n[e]),t.decRef(n[e]))}n.length=0}}cacheResult(e,t){let n=this.manager;if(!this.isShared(e))return;let r=this.scopes.length,i=this.cache.get(e);i===void 0?(this.cache.set(e,[{to:t,level:r}]),n.incRef(e)):i.push({to:t,level:r}),n.incRef(t),(this.cacheUndo[r]??=[]).push(e)}getCached(e){let t=this.cache.get(e)?.at(-1);return t!==void 0&&t.level===this.scopes.length?t.to:void 0}mkApp(e,t,n){return this.manager.withTemporaries(()=>this.rewriter.mkApp(e,t,n))}simplify(e){let t=this.manager;if(this.depth>=30||this.numSteps>=5e6||t.kinds[e]!==0)return t.incRef(e),e;t.limit.checkpoint();let n=this.getCached(e)??this.assertions.get(e);if(n!==void 0)return t.incRef(n),n;this.numSteps++,this.depth++;let r=t.getOp(e),i=r===6||r===5?this.simplifyOrAnd(e,r===6):r===4?this.simplifyIte(e):this.simplifyApp(e);return this.depth--,i}simplifyOrAnd(e,t){let n=this.manager,r=this.scopes.length,i=e=>t?n.isFalse(e):n.isTrue(e),a=e=>t?n.isTrue(e):n.isFalse(e),o=!1,s=[new F(n),new F(n)],c=()=>{s[1].reset(),s[0].reset()};for(let[l,u]of s.entries()){let d=l===0?n.getArgs(e):[...s[0].items].reverse();for(let[s,l]of d.entries()){let f=this.simplify(l);if(f!==l&&(o=!0),s<d.length-1&&!n.isTrue(f)&&!n.isFalse(f)&&this.assertExpr(f,t),i(f))o=!0,n.decRef(f);else{if(a(f))return this.pop(this.scopes.length-r),this.cacheResult(e,f),c(),f;u.pushOwned(f)}}this.pop(this.scopes.length-r)}let l=s[1].items,u=o?l.length===0?t?n.falseExpr:n.trueExpr:l.length===1?l[0]:-1:e;u!==-1&&n.incRef(u);let d=u===-1?this.mkApp(n.decls[e],[...l].reverse(),n.sorts[e]):u;return this.cacheResult(e,d),c(),d}simplifyIte(e){let t=this.manager,n=t.getArg(e,0),r=t.getArg(e,1),i=t.getArg(e,2),a=this.scopes.length,o=this.simplify(n),s;if(t.isTrue(o))s=this.simplify(r);else if(t.isFalse(o))s=this.simplify(i);else{this.assertExpr(o,!1);let c=this.simplify(r);this.pop(this.scopes.length-a),this.assertExpr(o,!0);let l=this.simplify(i);this.pop(this.scopes.length-a),n===o&&r===c&&i===l?(t.incRef(e),s=e):c===l?(t.incRef(c),s=c):s=this.mkApp(t.decls[e],[o,c,l],t.sorts[e]),t.decRef(l),t.decRef(c)}return this.cacheResult(e,s),t.decRef(o),s}simplifyApp(e){let t=this.manager,n=new F(t),r=!1;for(let i=0;i<t.getNumArgs(e);i++){let a=t.getArg(e,i),o=this.simplify(a);o!==a&&(r=!0),n.pushOwned(o)}r||t.incRef(e);let i=r?this.mkApp(t.decls[e],n.items,t.sorts[e]):e;return n.reset(),i}};const ow=(e,t)=>{let n=new aw(e);n.apply(t),n.release()};var sw=class{manager;forms;isInconsistent=!1;constructor(e){this.manager=e,this.forms=new F(e)}pushBack(e){let t=this.manager;t.isTrue(e)||(t.isFalse(e)&&(this.forms.reset(),this.isInconsistent=!0),this.forms.push(e))}quickProcess(e,t){let n=this.manager;if(n.getOp(e)!==5&&!(n.isNot(e)&&n.getOp(n.getArg(e,0))===6))return t||this.pushBack(e),e;let r=e,i=t,a=new F(n),o=[{expr:e,isPositive:!0}];for(let e=o.pop();e!==void 0&&!this.isInconsistent;e=o.pop()){let t=n.getOp(e.expr);if(e.isPositive&&t===5||!e.isPositive&&t===6)for(let t=n.getNumArgs(e.expr)-1;t>=0;t--)o.push({expr:n.getArg(e.expr,t),isPositive:e.isPositive});else if(n.isNot(e.expr))o.push({expr:n.getArg(e.expr,0),isPositive:!e.isPositive});else{let t=e.isPositive?e.expr:n.mkApp(8,[e.expr],0);e.isPositive||a.push(t),i?(n.incRef(t),n.decRef(r),r=t,i=!1):this.pushBack(t)}}return a.reset(),r}assert(e){let t=this.manager;t.incRef(e),this.isInconsistent||(t.incRef(e),t.decRef(this.quickProcess(e,!1))),t.decRef(e)}update(e,t){let n=this.manager;if(this.isInconsistent)return;n.incRef(t);let r=this.quickProcess(t,!0);this.isInconsistent||(n.isFalse(r)?this.pushBack(r):this.forms.set(e,r)),n.decRef(r)}shrink(e){for(;this.forms.size>e;)this.forms.pop()}elimTrue(){let e=this.manager,t=0;for(let[n,r]of[...this.forms.items].entries())e.isTrue(r)||(n!==t&&this.forms.set(t,r),t++);this.shrink(t)}elimRedundancies(){let e=this.manager;if(this.isInconsistent)return;let t=new F(e),n=new F(e),r=0;for(let[i,a]of[...this.forms.items].entries()){if(e.isTrue(a))continue;let o=e.isNot(a),s=o?e.getArg(a,0):a,c=o?t:n;if(!c.items.includes(s)){if((o?n:t).items.includes(s)){this.pushBack(e.falseExpr);break}c.push(s),i!==r&&this.forms.set(r,a),r++}}this.isInconsistent||this.shrink(r),n.reset(),t.reset()}};const cw=(e,t)=>{let n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Set,i=[...t];for(let t=i.pop();t!==void 0;t=i.pop())n.has(t)?r.add(t):(n.add(t),e.kinds[t]===0?e.pushArgs(t,i):e.kinds[t]===2&&i.push(e.getQuantifier(t).body));return r},lw=(e,t)=>{if(t.isInconsistent)return;let n=new Xh(e,Yh),r=/* @__PURE__ */ new Map;n.setSubstitution(r);let i=cw(e,t.forms.items),a=!1,o=o=>{let s=t.forms.items[o],c=r.size!==0,l=c?n.rewrite(s):s;l!==s&&(a=!0),t.update(o,l),c&&e.decRef(l),i.has(l)&&r.set(l,e.trueExpr),e.isNot(l)&&i.has(e.getArg(l,0))&&r.set(e.getArg(l,0),e.falseExpr),e.getOp(l)===2&&(e.isUniqueValue(e.getArg(l,0))&&i.has(e.getArg(l,1))?r.set(e.getArg(l,1),e.getArg(l,0)):e.isUniqueValue(e.getArg(l,1))&&i.has(e.getArg(l,0))&&r.set(e.getArg(l,0),e.getArg(l,1)))};for(let s=0;s<4;s+=2){let s=t.forms.size;for(let e=0;e<s;e++)if(o(e),t.isInconsistent)return;if(r.size===0&&!a)break;i=cw(e,t.forms.items),r.clear(),n.setSubstitution(r);for(let e=t.forms.size-1;e>=0;e--)if(o(e),t.isInconsistent)return;if(!a)break;r.clear(),n.setSubstitution(r),a=!1,i=cw(e,t.forms.items)}t.elimRedundancies()},uw=(e,t,n)=>(n!==-1&&e.incRef(n),t!==-1&&e.decRef(t),n),dw=(e,t,n)=>(t!==-1&&e.decRef(t),n),fw=(e,t)=>{t!==-1&&e.decRef(t)};var pw=class{manager;subst;substMap;newExprs;rewriter;map=[];pos2var=[];var2pos=[];inx2var=[];order=[];numVars=0;constructor(e){this.manager=e,this.subst=new sh(e),this.substMap=new F(e),this.newExprs=new F(e),this.rewriter=new Xh(e,Yh)}isVariable(e){let t=this.manager;return t.kinds[e]===1&&t.values[e]<this.numVars}apply(e){for(;this.reduceVarSet(e););this.newExprs.reset()}release(){this.rewriter.release(),this.newExprs.reset(),this.substMap.reset(),this.subst.release()}reduceVarSet(e){let t=this.manager,n=e.items.find(e=>t.isFalse(e));n!==void 0&&(e.set(0,n),e.shrink(1));let r=!1,i=this.findDefinitions(e.items);if(i.numDefs>0&&(this.sortVars(),this.order.length>0)){let n=t.mkApp(5,e.items,0);t.incRef(n),this.createSubstitution(i.largestIndex+1);let a=this.subst.rewriteWithBindings(n,this.substMap.items);a=dw(t,a,this.rewriter.rewrite(a)),e.reset(),e.push(a),Ym(t,e),r=!0,t.decRef(a),t.decRef(n)}return this.removeUnconstrained(e)||r}findDefinitions(e){let t=this.manager,n=0,r=0;return this.map=[],this.pos2var=e.map(()=>-1),this.var2pos=[],this.inx2var=[],e.forEach((e,i)=>{t.limit.checkpoint();let a=[],o=new F(t),s=-1;this.getVarEq(e,a,o)&&a.forEach((e,a)=>{s=uw(t,s,o.items[a]),s=dw(t,s,this.rewriter.rewrite(s)),s!==o.items[a]&&this.newExprs.push(s);let c=t.values[e],l=this.map[c]??-1;if(l===-1)this.map[c]=s,this.inx2var[c]=e,this.pos2var[i]=c,this.var2pos[c]=i,n++,r=Math.max(c,r);else if(t.isUniqueValue(l)||!(t.isUniqueValue(s)||t.isGroundApp(s)&&!t.isGroundApp(l)||t.isUninterpretedConst(s)))return;else this.pos2var[this.var2pos[c]]=-1,this.pos2var[i]=c,this.var2pos[c]=i,this.map[c]=s;this.newExprs.pushOwned(s),s=-1}),fw(t,s),o.reset()}),{numDefs:n,largestIndex:r}}getVarEq(e,t,n){let r=this.manager,i=r.getOp(e)===2;if(i){let i=r.getArg(e,0),a=r.getArg(e,1),o=!this.isVariable(i);if(this.isVariable(o?a:i))return t.push(o?a:i),n.push(o?i:a),!0}let a=i?r.sorts[r.getArg(e,0)]:r.sorts[e];if(a!==0&&a!==1)return!1;let o=r.isNot(e),s=a===1?this.solveArithEq(e):this.solveBasic(o?r.getArg(e,0):e,!o),c=s!==e&&r.getOp(s)===2&&this.isVariable(r.getArg(s,0));return c&&(t.push(r.getArg(s,0)),n.push(r.getArg(s,1))),r.decRef(s),c}getInvertibleConst(e){let t=this.manager;if(t.getOp(e)===17){let n=this.getInvertibleConst(t.getArg(e,0));return n===void 0?void 0:-n}let n=t.getNumeral(e);return n===1n||n===-1n?n:void 0}getInvertibleMul(e){let t=this.manager;if(this.isVariable(e))return{variable:e,coefficient:1n};if(t.getOp(e)!==18||t.getNumArgs(e)!==2)return;let n=t.getArg(e,0),r=t.getArg(e,1),i=this.getInvertibleConst(r);if(this.isVariable(n)&&i!==void 0)return{variable:n,coefficient:i};let a=this.getInvertibleConst(n);if(this.isVariable(r)&&a!==void 0)return{variable:r,coefficient:a}}solveLinear(e,t){let n=this.manager;if(n.sorts[e]!==1)return;let r=[{isLeft:!0,expr:e},{isLeft:!1,expr:t}],i=[];for(let e=r.pop();e!==void 0;e=r.pop()){let t=n.getOp(e.expr);if(t===15)for(let t=0;t<n.getNumArgs(e.expr);t++)r.push({isLeft:e.isLeft,expr:n.getArg(e.expr,t)});else if(t===16){r.push({isLeft:e.isLeft,expr:n.getArg(e.expr,0)});for(let t=1;t<n.getNumArgs(e.expr);t++)r.push({isLeft:!e.isLeft,expr:n.getArg(e.expr,t)})}else if(t===17)r.push({isLeft:!e.isLeft,expr:n.getArg(e.expr,0)});else{let t=this.getInvertibleMul(e.expr);if(t===void 0){i.push(e);continue}i.push(...r);let a=1n/t.coefficient,o=e.isLeft,s=new F(n);for(let e of i){let t=e.isLeft===o?-a:a;s.push(t===1n?e.expr:n.mkApp(18,[n.mkNumeral(t),e.expr],1))}let c=s.size===0?n.mkNumeral(0n):s.size===1?s.items[0]:n.mkApp(15,s.items,1);return n.incRef(c),s.reset(),{variable:t.variable,term:c}}}}mkArithEqCore(e,t){let n=this.manager,r=this.solveLinear(e,t);if(r!==void 0){let e=n.mkEq(r.variable,r.term);return n.incRef(e),n.decRef(r.term),e}let i=n.getNumeral(e)===0n,a=i?t:e,o=i?e:t,s=n.getNumeral(o)===0n&&n.getOp(a)===15&&n.getNumArgs(a)===2,c=s?n.getTimesMinusOneArg(n.getArg(a,1)):void 0,l=s?n.getTimesMinusOneArg(n.getArg(a,0)):void 0,u=c===void 0?l===void 0?n.mkEq(a,o):n.mkEq(n.getArg(a,1),l):n.mkEq(n.getArg(a,0),c);return n.incRef(u),u}tryIntMulSolve(e){let t=this.manager;if(t.sorts[t.getArg(e,0)]!==1)return-1;let n=t.getOp(t.getArg(e,1))!==18;if(n&&t.getOp(t.getArg(e,0))!==18)return-1;let r=t.getArg(e,+!!n),i=t.getArg(e,+!n);if(t.getNumArgs(i)!==2)return-1;let a=!t.isNumeral(t.getArg(i,0));if(a&&!t.isNumeral(t.getArg(i,1)))return-1;let o=t.getArg(i,+!!a),s=t.getArg(i,+!a);if(t.getNumeralValue(o)===0n){let e=t.mkEq(r,t.mkNumeral(0n));return t.incRef(e),e}let c=new F(t),l=t.mkEq(s,t.mkApp(19,[r,o],1));c.push(l);let u=t.mkNumeral(0n);c.push(u);let d=t.mkApp(20,[r,o],1);c.push(d);let f=t.mkEq(u,d);c.push(f);let p=t.mkApp(5,[l,f],0);return t.incRef(p),c.items.reverse(),c.reset(),p}solveArithEq(e){let t=this.manager,n=this.tryIntMulSolve(e);if(n!==-1)return n;let r=t.getArg(e,0),i=t.getArg(e,1),a=uw(t,-1,r),o=uw(t,-1,i),s=this.solveLinear(r,i);s!==void 0&&(a=uw(t,a,s.variable),o=dw(t,o,s.term));let c=this.mkArithEqCore(a,o);return t.decRef(o),t.decRef(a),c}solveBasic(e,t){let n=this.manager,r=uw(n,-1,e);if(n.getOp(e)===2){let t=n.getArg(e,0),i=n.getArg(e,1);n.isNot(t)&&this.isVariable(n.getArg(t,0))?r=uw(n,r,n.mkEq(n.getArg(t,0),qm(n,i))):n.isNot(i)&&this.isVariable(n.getArg(i,0))?r=uw(n,r,n.mkEq(n.getArg(i,0),qm(n,t))):this.isVariable(i)&&!this.isVariable(t)&&(r=uw(n,r,n.mkEq(i,t)))}if(n.getOp(e)===4){let t=n.getArg(e,0),i=n.getArg(e,1),a=n.getArg(e,2),o=this.solveBasic(i,!0),s=this.solveBasic(a,!0);if(n.getOp(o)===2&&n.getOp(s)===2&&n.getArg(o,0)===n.getArg(s,0)){let e=n.getArg(o,1),i=n.mkApp(4,[t,e,n.getArg(s,1)],n.sorts[e]);r=uw(n,r,n.mkEq(n.getArg(o,0),i))}n.decRef(s),n.decRef(o)}if(this.isVariable(e)&&n.sorts[e]===0)return uw(n,r,n.mkEq(e,t?n.trueExpr:n.falseExpr));if(t)return r;let i=uw(n,-1,qm(n,r));return n.decRef(r),i}sortVars(){let e=this.manager,t=this.map,n=e=>t[e]??-1;this.order=[];let r=!1;for(let i=0;i<t.length;i++){let a=n(i);a===-1||e.hasQuantifierFlags[a]||Uh(e,e.values[this.inx2var[i]],a)?t[i]=-1:r=!0}if(!r)return;let i=/* @__PURE__ */ new Set,a=/* @__PURE__ */ new Set;for(let r=0;r<t.length;r++){if(n(r)===-1)continue;let o=[[this.inx2var[r],0]];for(;o.length>0;){let r=o[o.length-1],s=r[0];if(a.has(s))o.pop();else{if(e.kinds[s]===1){let a=e.values[s];if(r[1]===0&&n(a)!==-1){if(!i.has(s)){i.add(s),r[1]=1,o.push([n(a),0]);continue}i.delete(s),t[a]=-1}else r[1]===1&&(i.delete(s),n(a)!==-1&&this.order.push(a))}else{let t=!1;for(;r[1]<e.getNumArgs(s)&&!t;){let n=e.getArg(s,r[1]++);a.has(n)||(o.push([n,0]),t=!0)}if(t)continue}a.add(s),o.pop()}}}}createSubstitution(e){let t=this.manager;this.substMap.reset(),this.substMap.resize(e),this.subst.reset(),this.subst.setInvBindings(this.substMap.items);for(let n of this.order){let r=this.map[n],i=t.isGroundApp(r)?uw(t,-1,r):this.subst.rewrite(r),a=e-n-1;this.subst.updateInvBindingAt(a,i),this.substMap.setOwned(a,i)}}isUnconstrained(e,t,n,r){let i=this.manager,a=i.values[e];return i.sorts[e]===1&&!Uh(i,a,t)&&r.every((e,t)=>t===n||!Uh(i,a,e))}removeUnconstrained(e){let t=this.manager,n=!1;for(let r=!0;r;){r=!1;for(let i=0;i<e.size;i++){let a=e.items[i];if(!t.isNot(a)||t.getOp(t.getArg(a,0))!==2)continue;let o=t.getArg(t.getArg(a,0),0),s=t.getArg(t.getArg(a,0),1);(this.isVariable(o)&&this.isUnconstrained(o,s,i,e.items)||this.isVariable(s)&&this.isUnconstrained(s,o,i,e.items))&&(e.set(i,t.trueExpr),n=!0,r=!0)}}return n}},mw=class{manager;constraints=[];bvar2expr;bvar2sign=[];expr2bvar=/* @__PURE__ */ new Map;isInt=[];forbidden=[];var2expr;expr2var=/* @__PURE__ */ new Map;var2pos=[];lowers=[];uppers=[];forbiddenSet=/* @__PURE__ */ new Set;newFmls;counter=0;isInconsistent=!1;subTodo=[];numVars=0;constructor(e){this.manager=e,this.bvar2expr=new F(e),this.var2expr=new F(e),this.newFmls=new F(e)}release(){this.resetConstraints(),this.newFmls.reset(),this.var2expr.reset(),this.bvar2expr.reset()}apply(e){let t=this.manager;if(this.init(e.items),this.initUseList(e.items),!e.items.some(e=>t.hasQuantifierFlags[e])){if(this.isInconsistent)this.setFalse();else{this.subsume();for(let e of this.sortCandidates()){if(t.limit.checkpoint(),this.counter>5e6)break;if(this.counter++,this.tryEliminate(e),this.isInconsistent){this.setFalse();break}}this.isInconsistent||this.copyRemaining()}this.resetConstraints(),e.reset();for(let t of this.newFmls.items)e.push(t)}}setFalse(){this.newFmls.reset(),this.newFmls.push(this.manager.falseExpr)}init(e){this.subTodo=[],this.resetConstraints(),this.bvar2expr.reset(),this.bvar2sign=[0],this.bvar2expr.push(-1),this.expr2bvar.clear(),this.expr2var.clear(),this.isInt=[],this.var2pos=[],this.forbidden=[],this.var2expr.reset(),this.lowers=[],this.uppers=[],this.newFmls.reset(),this.counter=0,this.isInconsistent=!1,this.initForbiddenSet(e)}isVariable(e){let t=this.manager;return t.kinds[e]===1&&t.values[e]<this.numVars}isLiteral(e){let t=this.manager;return t.isUninterpretedConst(e)||t.isNot(e)&&t.isUninterpretedConst(t.getArg(e,0))}getMonomialVar(e){let t=this.manager;if(t.getOp(e)===18&&t.getNumArgs(e)===2){let n=t.getArg(e,0),r=t.getArg(e,1);if(t.isNumeral(n)&&this.isVariable(r))return r}return this.isVariable(e)?e:-1}isLinearPol(e){let t=this.manager,n=t.getOp(e)===15,r=n?t.getNumArgs(e):1,i=/* @__PURE__ */ new Set,a=!0;for(let o=0;o<r;o++){let r=n?t.getArg(e,o):e,s=this.getMonomialVar(r);if(s===-1||i.has(s))return!1;i.add(s),this.forbiddenSet.has(t.values[s])||(a=!1)}return!a}isLinearIneq(e){let t=this.manager,n=t.isNot(e)?t.getArg(e,0):e,r=t.getOp(n);if(r!==11&&r!==12||t.getNumArgs(n)!==2)return!1;let i=t.getArg(n,0),a=t.getArg(n,1);return t.isInt(i)&&t.isNumeral(a)&&this.isLinearPol(i)}isOcc(e){let t=this.manager;if(t.getOp(e)!==6)return this.isLinearIneq(e);let n=!1;for(let r=0;r<t.getNumArgs(e);r++){let i=t.getArg(e,r);if(!this.isLiteral(i)){if(!this.isLinearIneq(i)||n)return!1;n=!0}}return n}initForbiddenSet(e){let t=this.manager;this.forbiddenSet.clear();let n=/* @__PURE__ */ new Set;for(let r of e){if(this.isOcc(r))continue;let e=[r];for(let r=e.pop();r!==void 0;r=e.pop()){if(n.has(r))continue;n.add(r);let i=t.kinds[r];if(i===1)this.isVariable(r)&&t.sorts[r]===1&&this.forbiddenSet.add(t.values[r]);else if(i===2){let n=t.getQuantifier(r);e.push(n.body,...n.patterns)}else t.pushArgs(r,e)}}}initUseList(e){for(let t of e){if(this.isInconsistent)break;this.isOcc(t)?this.addConstraint(t):this.newFmls.push(t)}}toVar(e){let t=this.manager,n=this.expr2var.get(e);if(n!==void 0)return n;let r=this.var2expr.size;return this.var2expr.push(e),this.isInt.push(t.sorts[e]===1),this.var2pos.push(-1),this.expr2var.set(e,r),this.lowers.push([]),this.uppers.push([]),this.forbidden.push(this.forbiddenSet.has(t.values[e])),r}toLiteral(e){let t=this.manager,n=t.isNot(e),r=n?t.getArg(e,0):e,i=this.expr2bvar.get(r);return i===void 0&&(i=this.bvar2expr.size,this.bvar2expr.push(r),this.bvar2sign.push(0),this.expr2bvar.set(r,i)),n?-i:i}addConstraint(e){let t=this.manager,n=t.getOp(e)===6,r=n?t.getNumArgs(e):1,i=[],a=[],o=[],s=0n,c=!1;for(let l=0;l<r;l++){let r=n?t.getArg(e,l):e;if(this.isLiteral(r)){i.push(this.toLiteral(r));continue}let u=t.isNot(r),d=u?t.getArg(r,0):r;c=u;let f=t.getOp(d)===12?!u:u,p=t.getArg(d,0),m=t.getArg(d,1);s=f?-t.getNumeralValue(m):t.getNumeralValue(m);let h=t.getOp(p)===15,g=h?t.getNumArgs(p):1,_=!0;for(let e=0;e<g;e++){let n=h?t.getArg(p,e):p,r=t.getOp(n)===18&&t.getNumArgs(n)===2,i=r?t.getNumeralValue(t.getArg(n,0)):1n,s=this.toVar(r?t.getArg(n,1):n);a.push(s),o.push(f?-i:i),this.isInt[s]||(_=!1)}_&&c&&(c=!1,s--)}this.registerConstraint({lits:i,xs:a,as:o,c:s,isStrict:c,isDead:!1})}normalizeCoeffs(e){if(e.xs.length===0)return;let t=e.c<0n?-e.c:e.c;for(let n of e.as){if(t===1n)break;t=jm(n,t)}t!==1n&&(e.c/=t,e.as=e.as.map(e=>e/t))}isFalseConstraint(e){return e.lits.length===0&&e.xs.length===0&&(e.c<0n||e.isStrict&&e.c===0n)}registerConstraint(e){if(this.normalizeCoeffs(e),this.isFalseConstraint(e)){this.delConstraint(e),this.isInconsistent=!0;return}let t=!1;e.xs.forEach((n,r)=>{this.forbidden[n]||(t=!0,(e.as[r]<0n?this.lowers:this.uppers)[n].push(e))}),t?(this.subTodo.includes(e)||this.subTodo.push(e),this.constraints.push(e)):(this.newFmls.push(this.toExpr(e)),this.delConstraint(e))}delConstraint(e){let t=this.subTodo.indexOf(e);t!==-1&&(this.subTodo[t]=this.subTodo[this.subTodo.length-1],this.subTodo.pop())}resetConstraints(){for(let e of this.constraints)this.delConstraint(e);this.constraints=[]}toExpr(e){let t=this.manager,n=-1;if(e.xs.length===0){if(e.c>0n||!e.isStrict&&e.c===0n)return t.trueExpr}else{let r=e.xs.map((n,r)=>{let i=this.var2expr.items[n],a=e.as[r];return a===1n?i:t.mkApp(18,[t.mkNumeral(a),i],1)}),i=r.length===1?r[0]:t.mkApp(15,r,1),a=t.mkNumeral(e.c);n=e.isStrict?t.mkApp(8,[t.mkApp(12,[i,a],0)],0):t.mkApp(11,[i,a],0)}if(e.lits.length===0)return n===-1?t.falseExpr:n;let r=e.lits.map(e=>{let n=this.bvar2expr.items[Math.abs(e)];return e<0?t.mkApp(8,[n],0):n});return n!==-1&&r.push(n),r.length===1?r[0]:t.mkApp(6,r,0)}isSubsuming(e,t){if(e===t||e.lits.length>t.lits.length||e.xs.length!==t.xs.length||e.c>t.c||!e.isStrict&&t.isStrict&&e.c===t.c)return!1;this.counter+=e.lits.length+t.lits.length,e.xs.forEach((e,t)=>{this.var2pos[e]=t});let n=t.xs.every((n,r)=>{let i=this.var2pos[n];return i!==-1&&e.as[i]===t.as[r]});for(let t of e.xs)this.var2pos[t]=-1;if(!n)return!1;for(let e of t.lits)this.bvar2sign[Math.abs(e)]=e<0?-1:1;let r=e.lits.every(e=>this.bvar2sign[Math.abs(e)]===(e<0?-1:1));for(let e of t.lits)this.bvar2sign[Math.abs(e)]=0;return r}backwardSubsumption(e){if(e.xs.length===0)return;let t=-1,n=1/0,r=!1;if(e.xs.forEach((i,a)=>{if(this.forbidden[i])return;let o=e.as[a]<0n,s=(o?this.lowers:this.uppers)[i];s.length<n&&(t=i,n=s.length,r=o)}),n===0||t===-1)return;let i=r?this.lowers:this.uppers;this.counter+=i[t].length,i[t]=i[t].filter(t=>t.isDead?!1:!this.isSubsuming(e,t)||(t.isDead=!0,!1))}subsume(){for(let e=this.subTodo.pop();e!==void 0;e=this.subTodo.pop())e.isDead||this.backwardSubsumption(e)}sortCandidates(){let e=[];this.forbidden.forEach((t,n)=>{t||e.push([n,this.lowers[n].length*this.uppers[n].length])});let t=(e,t)=>{if(e[1]===0)return t[1]>0||e[0]<t[0];if(t[1]===0)return!1;let n=this.isInt[e[0]],r=this.isInt[t[0]];return!n&&r||n===r&&e[1]<t[1]};return e.sort((e,n)=>t(e,n)?-1:+!!t(n,e)),e.map(e=>e[0])}analyze(e,t){let n=!0;for(let r of e)for(let e=0;e<r.xs.length;e++){let i=r.xs[e];if(!this.isInt[i])return{isAllInt:!1,isUnit:n};i===t&&r.as[e]!==1n&&r.as[e]!==-1n&&(n=!1)}return{isAllInt:!0,isUnit:n}}canEliminate(e){if(!this.isInt[e])return!0;let t=this.analyze(this.lowers[e],e);if(!t.isAllInt)return!1;let n=this.analyze(this.uppers[e],e);return n.isAllInt&&(t.isUnit||n.isUnit)}markDead(e){for(let t of this.lowers[e])t.isDead=!0;for(let t of this.uppers[e])t.isDead=!0}resolve(e,t,n){this.counter+=e.xs.length+t.xs.length+e.lits.length+t.lits.length;let r=-e.as[e.xs.indexOf(n)],i=t.as[t.xs.indexOf(n)],a=e.c*i+t.c*r,o=e.isStrict||t.isStrict,s=[],c=[];e.xs.forEach((t,r)=>{t!==n&&(this.var2pos[t]=s.length,s.push(t),c.push(e.as[r]*i))}),t.xs.forEach((e,i)=>{if(e===n)return;let a=this.var2pos[e];a===-1?(s.push(e),c.push(t.as[i]*r)):c[a]+=t.as[i]*r});let l=c.flatMap((e,t)=>e===0n?[]:[t]),u=l.map(e=>s[e]),d=l.map(e=>c[e]);o&&u.every(e=>this.isInt[e])&&(o=!1,a--);for(let t of e.xs)this.var2pos[t]=-1;if(u.length===0&&(a>0n||!o&&a===0n))return;for(let t of e.lits)this.bvar2sign[Math.abs(t)]=t<0?-1:1;let f=[...e.lits],p=!1;for(let e of t.lits){if(p)break;let t=this.bvar2sign[Math.abs(e)];t===0?f.push(e):(t===-1?e>0:e<0)&&(p=!0)}for(let t of e.lits)this.bvar2sign[Math.abs(t)]=0;if(!p){if(f.length===0&&u.length===0&&(a<0n||o&&a===0n))this.isInconsistent=!0;else return{lits:f,xs:u,as:d,c:a,isStrict:o,isDead:!1}}}tryEliminate(e){let t=this.lowers[e].filter(e=>!e.isDead),n=this.uppers[e].filter(e=>!e.isDead);if(this.lowers[e]=t,this.uppers[e]=n,t.length===0||n.length===0){this.markDead(e);return}if(t.length>8&&n.length>8||t.length*n.length>256||!this.canEliminate(e))return;this.counter+=t.length*n.length;let r=t.length+n.length+0,i=[];for(let a of t)for(let t of n){if(this.isInconsistent||i.length>r)return;let n=this.resolve(a,t,e);n!==void 0&&i.push(n)}this.markDead(e),this.counter+=i.length;for(let e of i)this.backwardSubsumption(e),this.registerConstraint(e)}copyRemaining(){for(let e of[this.uppers,this.lowers])for(let t of e)for(let e of t)e.isDead||(e.isDead=!0,this.newFmls.push(this.toExpr(e)));this.uppers=[],this.lowers=[]}},hw=class extends oh{reduce;constructor(e,t){super(e),this.reduce=t}reduceQuantifier(e,t,n){return this.reduce(e,t,n)}},gw=class{manager;der;fm;elimStar;rewriter;constructor(e){this.manager=e,this.der=new pw(e),this.fm=new mw(e),this.elimStar=new hw(e,(e,t,n)=>this.reduceQuantifier(e,t,n)),this.rewriter=new Xh(e,Yh)}apply(e){return this.elimStar.rewrite(e)}release(){this.rewriter.release(),this.elimStar.release(),this.fm.release(),this.der.release()}mkAnd(e){return this.manager.withTemporaries(()=>this.rewriter.mkAnd(e))}mkOr(e){return this.manager.withTemporaries(()=>this.rewriter.mkOr(e))}reduceQuantifier(e,t,n){let r=this.manager,i=r.getQuantifier(e),a=uw(r,-1,t);i.isForall&&(a=uw(r,a,r.mkApp(8,[a],0))),a=this.reduceFormula(i.sorts.length,a),a=this.eliminateDiseqVars(i.sorts,a);let o=this.tryExpandBoundedQuantifier(i.sorts,a);if(o!==-1)return i.isForall&&(o=dw(r,o,Zm(r,o))),a=dw(r,a,this.rewriter.rewrite(o)),r.decRef(o),a;i.isForall&&(a=dw(r,a,Zm(r,a)));let s=uw(r,-1,r.mkQuantifier({...i,body:a,patterns:n}));return a=dw(r,a,this.rewriter.rewrite(s)),r.decRef(s),a}reduceFormula(e,t){let n=this.manager,r=new F(n),i=new F(n);r.push(t),Xm(n,r);let a=t,o=r.size;for(let t=0;t<o;t++)i.reset(),i.push(r.items[t]),this.reduceConjs(e,i),a=dw(n,a,this.mkAnd(i.items)),r.setOwned(t,a),a=-1;return a=dw(n,a,this.mkOr(r.items)),i.reset(),r.reset(),a}reduceConjs(e,t){let n=this.manager;Ym(n,t);let r=t.items.flatMap((e,t)=>n.isGroundApp(e)?[]:[t]);if(t.size>1&&r.length===1){let i=r[0],a=this.reduceFormula(e,uw(n,-1,t.items[i]));t.set(i,a),n.decRef(a)}else{this.der.numVars=e,this.fm.numVars=e,this.der.apply(t),this.fm.apply(t);for(let e=0;e<t.size;e++)n.limit.checkpoint()}}collectNegativeEqualities(e,t,n,r){let i=this.manager;if(i.isGroundApp(e))return!0;let a=i.kinds[e];if(a===1)return i.values[e]!==t;if(a===2){let n=i.getQuantifier(e);return!Uh(i,t+n.sorts.length,n.body)}let o=i.getOp(e);if(i.isNot(e))return this.collectNegativeEqualities(i.getArg(e,0),t,!n,r);if(o===5||o===6)return i.everyArg(e,e=>this.collectNegativeEqualities(e,t,n,r));if(o===2){let a=e=>i.kinds[e]===1&&i.values[e]===t,o=a(i.getArg(e,0));if(o!==a(i.getArg(e,1))){let a=o?i.getArg(e,1):i.getArg(e,0);if(!n&&!Uh(i,t,a))return r.add(e),!0}}return!Uh(i,t,e)}eliminateDiseqVars(e,t){let n=this.manager,r=new ch(n),i=!1;for(let a=0;a<e.length;a++){let o=new Am(e=>n.hashes[e]);if(this.collectNegativeEqualities(t,a,!0,o)&&o.size>0&&e[e.length-a-1]===1){for(let e of o)r.insert(e,n.falseExpr);i=!0}}if(!i)return r.release(),t;let a=r.apply(t),o=dw(n,t,this.rewriter.rewrite(a));return n.decRef(a),r.release(),o}getBound(e,t){let n=this.manager,r=n.isNot(e),i=r?n.getArg(e,0):e,a=n.getOp(i);if(a!==11&&a!==12&&a!==13&&a!==14)return;let o=a===12||a===14,s=a===13||a===14,c=n.getArg(i,+!!o),l=n.getArg(i,+!o);if(n.sorts[c]!==1)return;let u=e=>n.kinds[e]===1&&n.values[e]===t,d=u(c)&&n.isNumeral(l);if(!d&&!(u(l)&&n.isNumeral(c)))return;let f=n.getNumeralValue(d?l:c),p=d?s?f-1n:f:s?f+1n:f;return r?{isLower:d,value:d?p+1n:p-1n}:{isLower:!d,value:p}}tryExpandBoundedQuantifier(e,t){let n=this.manager,r=e.length;if(r===0)return-1;let i=fh(n,t,r),a=i.flatMap((e,t)=>e?[t]:[]);if(a.length===0||a.some(t=>e[r-1-t]!==1))return-1;let o=new F(n);o.push(t),Ym(n,o);let s=[],c=[],l=o.items.map(e=>{let t=!1;for(let n of a){let r=this.getBound(e,n);if(r===void 0)continue;let i=r.isLower?s:c,a=i[n];(a===void 0||(r.isLower?r.value>a:r.value<a))&&(i[n]=r.value),t=!0}return t}),u=1n;for(let e of a){let t=s[e],r=c[e];if(t===void 0||r===void 0)return o.reset(),-1;let i=r-t+1n;if(i<=0n)return o.reset(),uw(n,-1,n.falseExpr);if(u*=i,u>1e4)return o.reset(),-1}let d=new F(n);o.items.forEach((e,t)=>{l[t]||d.push(e)});let f=new F(n);f.resize(r);for(let t=0;t<r;t++)i[t]||f.set(t,n.mkVar(t,e[t]));let p=a.map(e=>s[e]??0n),m=new lh(n,!1),h=new rh(n),g=new F(n);for(;;){a.forEach((e,t)=>{f.set(e,n.mkNumeral(p[t]))});let e=new F(n);for(let t of d.items){let i=m.apply(t,f.items);i=dw(n,i,h.shift(i,r)),e.push(i),n.decRef(i)}let t=this.mkAnd(e.items);g.push(t),n.decRef(t),e.reset();let i=a.length-1;for(;i>=0&&(p[i]++,!(p[i]<=(c[a[i]]??0n)));i--)p[i]=s[a[i]]??0n;if(i<0)break}let _=this.mkOr(g.items);return g.reset(),h.release(),m.release(),f.reset(),d.reset(),o.reset(),_}};const _w=(e,t)=>{let n=new gw(e),r=-1;for(let n of t.forms.items)r=uw(e,r,n);if(t.forms.items.some(t=>e.hasQuantifierFlags[t])){let i=-1,a=t.forms.size;for(let o=0;o<a&&!t.isInconsistent;o++){let a=t.forms.items[o];r=uw(e,r,a),e.hasQuantifierFlags[a]&&(i=uw(e,i,a),i=dw(e,i,n.apply(i)),i!==a&&t.update(o,i)),e.limit.checkpoint()}fw(e,i)}t.elimTrue(),t.elimRedundancies(),n.release(),fw(e,r)},vw=(e,t,n=!1)=>{if(t.isInconsistent)return;let r=new Xh(e,{...Yh,isPullingCheapIte:n}),i=t.forms.size,a=-1;for(let n=0;n<i&&!t.isInconsistent;n++){let i=r.rewrite(t.forms.items[n]);a!==-1&&e.decRef(a),a=i,t.update(n,a)}a!==-1&&e.decRef(a),t.elimRedundancies(),r.release()},yw=(e,t)=>{let n=/* @__PURE__ */ new Set,r=[],i=/* @__PURE__ */ new Set,a=[...t.forms.items];for(;a.length>0;){let t=a.pop(),o=e.isUninterpretedConst(t);n.has(t)?o&&i.add(t):(n.add(t),o?r.push(t):e.kinds[t]===0?e.pushArgs(t,a):e.kinds[t]===2&&a.push(e.getQuantifier(t).body))}return r.some(e=>!i.has(e))},bw=(e,t)=>{let n=yw(e,t);if(xw(e,t),!n)return;let r=new oh(e);for(let n=0;n<2;n++){for(let n of t.forms.items)e.decRef(r.rewrite(n));r.reset()}r.release()},xw=(e,t)=>{let n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Set,i=t=>{if(r.has(t))return;e.incRef(t);let n=[t];for(;n.length>0;){let t=n.pop();r.has(t)||(r.add(t),e.kinds[t]===0&&e.pushArgs(t,n))}},a=[...t.forms.items];for(;a.length>0;){let t=a.pop();if(!n.has(t)){if(n.add(t),e.kinds[t]===2){let n=e.getQuantifier(t).body;i(n),a.push(n)}else e.kinds[t]===0&&e.pushArgs(t,a)}}},Sw=(e,t)=>{let n=new sw(e);for(let e of t)n.assert(e);vw(e,n);let r=[()=>lw(e,n),()=>ow(e,n),()=>vw(e,n,!0),()=>bw(e,n),()=>vw(e,n),()=>_w(e,n)];for(let e of r){if(n.isInconsistent||n.forms.size===0)break;e()}return n};var Cw=class{deadline;signal;count=0;isCanceled=!1;profiler=null;constructor(e,t){this.deadline=e,this.signal=t}inc(){return this.count++,!this.isCanceled&&(this.count&Tw)===0&&(Date.now()>this.deadline||this.signal?.aborted===!0||this.isHeapNearlyFull())&&(this.isCanceled=!0,this.release()),!this.isCanceled}checkpoint(){if(!this.inc())throw new s}isHeapNearlyFull(){if(Ew===void 0)return!1;let e=Ew.getHeapStatistics(),t=ww*(e.used_heap_size+e.total_available_size);if(e.used_heap_size<=t)return this.release(),!1;if(this.profiler===null)return this.profiler=new Ew.GCProfiler,this.profiler.start(),!1;let n=this.profiler.stop().statistics.findLast(e=>e.gcType===`MarkSweepCompact`);return this.profiler.start(),n!==void 0&&(this.release(),n.afterGC.heapStatistics.usedHeapSize>t)}release(){this.profiler?.stop(),this.profiler=null}};const ww=.8,Tw=255,Ew=typeof process>`u`?void 0:process.getBuiltinModule?.(`node:v8`),Dw=/* @__PURE__ */ new Map([[`and`,5],[`or`,6],[`not`,8],[`=>`,9],[`xor`,7],[`ite`,4],[`distinct`,3],[`+`,15],[`*`,18],[`/`,23],[`div`,19],[`mod`,20],[`abs`,21],[`to_real`,24],[`to_int`,25],[`is_int`,26]]),Ow=/* @__PURE__ */ new Set([15,16,17,18,11,12,13,14]),kw=/^([0-9]+)\.([0-9]+)$/,Aw=/* @__PURE__ */ new Map([[`=`,2],[`<=`,11],[`>=`,12],[`<`,13],[`>`,14]]),jw=e=>{let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===`;`){let t=e.indexOf(`
10
+ `,n);n=t===-1?e.length:t+1}else if(r===`(`||r===`)`)t.push(r),n++;else if(r===` `||r===`
11
+ `||r===` `||r===`\r`)n++;else if(r===`|`){let r=e.indexOf(`|`,n+1);if(r===-1)throw new i(`unterminated quoted symbol`);t.push(e.slice(n+1,r)),n=r+1}else if(r===`"`){let r=n+1;for(;r<e.length&&(e[r]!==`"`||e[r+1]===`"`);)r+=e[r]===`"`?2:1;t.push(e.slice(n,r+1)),n=r+1}else{let r=n;for(;r<e.length&&!`
12
+ \r();|"`.includes(e[r]);)r++;t.push(e.slice(n,r)),n=r}}return t},Mw=e=>{let t=[[]];for(let n of e)if(n===`(`)t.push([]);else if(n===`)`){let e=t.pop();if(e===void 0||t.length===0)throw new i(`unbalanced parentheses`);t[t.length-1].push(e)}else t[t.length-1].push(n);if(t.length!==1)throw new i(`unbalanced parentheses`);return t[0]},Nw=e=>{if(!Array.isArray(e))throw new i(`expected a list`);return e},Pw=e=>{if(typeof e!=`string`)throw new i(`expected a symbol`);return e},Fw=(e,t,n)=>{let r=/* @__PURE__ */ new Map([[`Bool`,0],[`Int`,1],[`Real`,2]]),a=/* @__PURE__ */ new Map,s=[],c=[],l=0,u=e=>{let t=r.get(Pw(e));if(t===void 0)throw new i(`unknown sort ${String(e)}`);return t},d=e=>{for(let t=c.length-1;t>=0;t--){let n=c[t].get(e);if(n!==void 0)return n}},f=e=>{let n=e.map(e=>t.sorts[e]);return n.every(Um)?n.includes(2)?2:1:n[0]},p=(e,n)=>e===4?f(n.slice(1)):e===2||e===3?f(n):Ow.has(e)?f(n)===2?2:1:e===21||e===24||e===25?t.sorts[n[0]]:e===19||e===20?1:e===23||e===26?2:0,m=(e,t)=>e===24||e===23?2:e===25||e===19||e===20?1:e===4||e===21||e===15||e===16||e===17||e===18?t:0,h=(e,n)=>{let r=t.sorts[e];return r===n||!Um(r)||!Um(n)?e:n===2?t.mkApp(24,[e],2):t.mkApp(25,[e],1)},g=(e,n,r)=>{let a=t.funcDecls[e].op,o=t.funcDecls[e].name,s=a===30,c=t.funcDecls[e].domain,l=s?-1:r??p(a,n),u=e=>s?c[e]:a===4&&e===0?0:l,d=n.map((e,t)=>u(t)===void 0?e:h(e,u(t))),f=(e,t)=>d.length>=e&&d.length<=t,g=s?d.length===c.length:a===5||a===6?!0:a===4?f(3,3):a===2||a===3?f(2,1/0):a===8||a===17||a===21||a===24||a===25||a===26?f(1,1):a===9||a===7||a===19||a===20||a===23||a===11||a===12||a===13||a===14?f(2,2):f(1,1/0),_=t.funcDecls[e].family===1;if(!g||_&&!Um(l)||!d.every((e,n)=>t.sorts[e]===u(n)))throw new i(`ill-sorted application of ${o}`);return t.mkApp(e,d,s?t.funcDecls[e].range:m(a,l))},_=(e,t)=>{let n=p(e,t),r=[];for(let i=0;i+1<t.length;i++)r.push(g(e,[t[i],t[i+1]],n));return r.length===1?r[0]:g(5,r)},v=e=>{if(t.sorts[e]!==0)throw new i(`expected a formula`);return e},y=e=>{if(!Array.isArray(e)||e.length===0)return;let n=e[0];if(Array.isArray(n))return t.mkPattern(e.map(C));let r=n===`true`||n===`false`?-1:a.get(n);if(!(r===-1||r!==void 0&&t.funcDecls[r].domain.length===0))return t.mkPattern([C(e)])},b=(e,n)=>{let r=/* @__PURE__ */ new Set,i=e=>{let a=t.kinds[e];if(a===2)return!1;if(a===1)return t.values[e]<n&&r.add(t.values[e]),!0;let o=t.funcDecls[t.decls[e]];return o.family===0&&o.op!==2&&o.op!==0&&o.op!==1?!1:t.everyArg(e,i)};return t.everyArg(e,i)&&r.size===n},x=(e,n)=>{let r=Nw(e[1]),i=/* @__PURE__ */ new Map,a=r.map(e=>Pw(Nw(e)[0])),o=r.map((e,t)=>{let n=u(Nw(e)[1]);return i.set(a[t],{kind:`var`,depth:l+t,sort:n}),n});c.push(i),l+=o.length;let s=o.map((e,n)=>t.mkVar(o.length-1-n,e));for(let e of s)t.incRef(e);let d=e[2],f=Array.isArray(d)&&d[0]===`!`,p=v(C(f?d[1]:d)),m=[],h=1,g=``;if(f)for(let e=2;e<d.length;e+=2){let n=d[e],r=d[e+1];if(n===`:pattern`){let e=y(r);e!==void 0&&(t.incRef(e),m.push(e))}else n===`:weight`?h=Number(r):n===`:qid`&&(g=Pw(r))}c.pop(),l-=o.length;let _=0;for(let e of m)b(e,o.length)&&(t.incRef(e),t.decRef(m[_]),m[_]=e,_++);for(let e of m.splice(_))t.decRef(e);let x=t.mkQuantifier({isForall:n,sorts:o,names:a,body:p,patterns:m,weight:h,qid:g});for(let e of m)t.decRef(e);for(let e of s)t.decRef(e);return x},ee=e=>{let t=/* @__PURE__ */ new Map;for(let n of Nw(e[1])){let e=Nw(n),r=C(e[1]);t.set(Pw(e[0]),{kind:`let`,depth:l,expr:r})}c.push(t);let n=C(e[2]);return c.pop(),n},S=(e,t)=>{let n=Aw.get(e);if(n!==void 0)return _(n,t);if(e===`-`)return g(t.length===1?17:16,t);if(e===`/`&&t.length>2)return t.slice(1).reduce((e,t)=>g(23,[e,t]),t[0]);let r=Dw.get(e);if(r!==void 0)return g(r,t);let o=a.get(e);if(o===void 0)throw new i(`unknown function ${e}`);return g(o,t)},te=e=>{if(typeof e==`string`){if(/^[0-9]+$/.test(e))return t.mkNumeral(BigInt(e));let n=kw.exec(e);if(n!==null)return t.mkRealNumeral(P.of(BigInt(n[1]+n[2]),10n**BigInt(n[2].length)));if(e===`true`)return t.trueExpr;if(e===`false`)return t.falseExpr;let r=d(e);return r?.kind===`var`?t.mkVar(l-1-r.depth,r.sort):r===void 0?S(e,[]):l===r.depth?r.expr:uh(t,r.expr,(e,n,i)=>t.mkVar(n+i+l-r.depth,t.sorts[e]))}let n=e[0];if(n===`forall`||n===`exists`)return x(e,n===`forall`);if(n===`let`)return ee(e);let r=C(e[1]),i=e.indexOf(`:named`);return i!==-1&&(t.incRef(r),t.mkMacro(Pw(e[i+1]),r)),r},C=e=>{let t=[],n=[],r=e=>{let r=Array.isArray(e)?e[0]:void 0;!Array.isArray(e)||r===`forall`||r===`exists`||r===`let`||r===`!`?n.push(te(e)):t.push({name:Pw(r),list:e,start:n.length,next:1})};for(r(e);t.length>0;){let e=t[t.length-1];e.next<e.list.length?r(e.list[e.next++]):(t.pop(),n.push(S(e.name,n.splice(e.start))))}return n[0]},w=!1;for(let i of Mw(jw(e))){let e=Nw(i),c=Pw(e[0]);if(c===`declare-sort`){if(e[2]!==void 0&&e[2]!==`0`)throw new o(`parametric sorts are not supported`);r.set(Pw(e[1]),t.mkSort(Pw(e[1])))}else if(c===`declare-fun`||c===`declare-const`){let n=c===`declare-fun`?Nw(e[2]).map(u):[],r=u(c===`declare-fun`?e[3]:e[2]);for(let e=0;e<2;e++){let e=n.map((e,n)=>t.mkVar(n,e));for(let n of e)t.incRef(n);for(let n of e)t.decRef(n)}a.set(Pw(e[1]),t.mkFuncDecl(Pw(e[1]),n,r))}else if(c===`assert`){let r=v(C(e[1]));t.incRef(r),s.push(r),n(r)}else if(c===`check-sat`){w=!0;break}else if(c===`push`||c===`pop`||c===`define-fun`||c===`define-sort`)throw new o(`the command ${c} is not supported`)}return{assertions:s,hasCheckSat:w}},Iw=(e,t)=>{let n=new Km(new Cw(Date.now()+t.timeLimitMs,t.signal)),r=new eg(n);n.limit.inc();let i=Fw(e,n,e=>{n.limit.inc(),r.assertExpr(e)});if(!i.hasCheckSat)return{verdict:`unknown`,numInstances:0};let a=Sw(n,i.assertions);if(a.isInconsistent||a.forms.size===0)return n.limit.release(),{verdict:a.isInconsistent?`unsat`:`sat`,numInstances:0};let o=new eg(n),s=new iw(n,{isMbqi:!0,relevancyLevel:2});for(let e of a.forms.items)o.assertExpr(e);s.setupContext(),s.internalizeAssertions(o);let c=s.search();return n.limit.release(),{verdict:c===-1?`unsat`:c===1?`sat`:`unknown`,numInstances:s.qmanager.getNumInstances()}},Lw=(e,t)=>{try{return Iw(e,t).verdict}catch(e){if(e instanceof o||e instanceof s||fm(e))return`unknown`;throw e}},Rw=e=>Date.now()>e.deadline?`time limit`:e.signal?.aborted===!0?`aborted`:void 0;var zw=class extends Error{};const G=e=>{if(!e)throw new zw},Bw=(e,t,n)=>({kind:e,symbol:t,args:n}),Vw=e=>Bw(`var`,e,[]),Hw=(e,t)=>Bw(`app`,e,t),K=e=>Bw(`not`,``,[e]),Uw=(e,t)=>Bw(`and`,``,[e,t]),Ww=(e,t)=>Bw(`or`,``,[e,t]),Gw=(e,t)=>Bw(`imply`,``,[e,t]),Kw=(e,t)=>Bw(`equiv`,``,[e,t]),q=(e,t)=>Hw(`=`,[e,t]),J=(e,t)=>Hw(`TLA.in`,[e,t]),qw=(e,t)=>Hw(`TLA.fapply`,[e,t]),Jw=e=>Hw(`TLA.DOMAIN`,[e]),Yw=Bw(`true`,``,[]),Xw=Bw(`false`,``,[]),Y=(e,t)=>Bw(`subst`,e.args[0].symbol,[e.args[1],t]),Zw=(e,t,n)=>e.kind===`app`&&e.symbol===t&&(n===void 0||e.args.length===n),X=(e,t,n)=>(G(Zw(e,t,n)),e.args),Qw=(e,t)=>(G(e.kind===t),e.args),$w=e=>Qw(e,`not`)[0],eT=(e,t)=>e.kind===`var`&&e.symbol===t,tT=e=>{G(Zw(e,`$string`,1)&&e.args[0].kind===`var`);let t=e.args[0].symbol;return G(!t.includes(`\\`)),t},nT=e=>{G(e.length%2==0);let t=[];for(let n=0;n<e.length;n+=2)t.push([e[n],e[n+1]]);return t},rT=e=>{let t=Vw(`0`);for(let n=0;n<e;n++)t=qw(Vw(`TLA.Succ`),t);return t},iT=(e,t,n,r,i,a=!1)=>{if(e.isSame(n,r))return!0;let o=n.kind===`app`&&n.symbol===t.symbol,s=n.kind===`var`&&n.symbol===t.symbol;if(o||s){if(i&&a)return!1;let s=n.args,c=t.body;if(t.params.length===0&&o&&c.kind===`var`)return t.kind===`real`&&e.isSame(r,Hw(c.symbol,s));if(t.params.length!==s.length)return!1;let l=/* @__PURE__ */ new Map,u=/* @__PURE__ */ new Map;return t.params.forEach((e,t)=>{l.set(e.symbol,{formula:s[t],env:/* @__PURE__ */ new Map}),u.set(e.symbol,s[t])}),e.getKey(c,l,0,u)===e.getTopKey(r)}return n.kind!==r.kind||n.symbol!==r.symbol||n.kind!==`app`&&n.kind!==`not`||n.args.length!==r.args.length?!1:n.args.every((o,s)=>iT(e,t,o,r.args[s],i,a||n.kind===`app`))},aT=e=>{let t=[],n=e;for(;n.kind===`all`;)t.push(n.args[0].symbol),n=n.args[1];return{bound:t,matrix:n}},oT=(e,t,n)=>{let r=aT(n),i=r.bound,a=r.matrix;if(!Zw(a,`=`,2)&&a.kind!==`equiv`)return!1;let o=t.params.map(e=>e.symbol);if(new Set(o).size!==o.length||new Set(i).size!==i.length||o.length!==i.length||o.some(e=>!i.includes(e)))return!1;let s=t.params,c=[Hw(t.symbol,s.map(e=>Vw(e.symbol)))];s.length===0&&c.push(Vw(t.symbol));let l=a.args,u=new Map(i.map((e,t)=>[e,t])),d=t=>e.getKey(t,u,i.length),f=c.map(d),p=d(t.body);return f.includes(d(l[0]))&&d(l[1])===p||f.includes(d(l[1]))&&d(l[0])===p},sT=(e,t)=>{(e.kind===`var`||e.kind===`app`)&&t.add(e.symbol);for(let n of e.args)sT(n,t);return t},cT=(e,t)=>{let n=t.filter(e=>e.kind===`real`),r=new Map(n.map(e=>[e.symbol,e]));if(n.filter(t=>t.symbol===e.symbol).length!==1)return!1;let i=/* @__PURE__ */ new Set,a=e=>{if(i.has(e.symbol))return!1;i.add(e.symbol);let t=new Set(e.params.map(e=>e.symbol));for(let n of sT(e.body,/* @__PURE__ */ new Set)){let e=r.get(n);if(!t.has(n)&&e!==void 0&&!a(e))return!1}return i.delete(e.symbol),!0};return a(e)},lT=(e,t,n)=>{let r=n.context.definitions;G(r.includes(e));let i=e.kind===`pseudo`&&aT(e.origin).matrix.kind===`equiv`;return G(iT(n,e,t[0],t[1],i)),e.kind===`real`?(G(cT(e,r)),{premises:[t[0]],branches:[[t[1]]]}):(G(oT(n,e,e.origin)),{premises:[t[0],e.origin],branches:[[t[1]]]})},uT=(e,t,n)=>Hw(e,[t,n]),dT=(e,t,n)=>{let r=$w(t[1]),i=r.symbol,a=X(t[0],i,2),o=X(r,i,2);e.ensureRelation(i,n?[`transitive`,`symmetric`]:[`transitive`]);let s=a[0],c=a[1],l=o[0],u=o[1],d=n?[u,s,c,l]:[l,s,c,u];return{premises:[t[0],t[1]],branches:[[K(q(d[0],d[1])),K(uT(i,d[0],d[1]))],[K(q(d[2],d[3])),K(uT(i,d[2],d[3]))]]}},fT=(e,t,n)=>{let r=t[0],i=t[1],a=$w(t[2]),o=a.symbol,s=X(a,o,2);e.ensureRelation(o,n===`trans_eq_sym`?[`transitive`,`symmetric`]:[`transitive`]);let c=s[0],l=s[1],u=n===`trans_eq`?[c,r,i,l]:n===`trans_eq_sym`?[l,r,i,c]:[c,i,r,l],d=K(uT(o,u[0],u[1])),f=K(uT(o,u[2],u[3]));return{premises:[q(r,i),t[2]],branches:[[K(q(u[0],u[1])),d],[d,f],[K(q(u[2],u[3])),f]]}},pT=(e,t)=>{let n=e[0],r=e[1],i=e[2],a=e[3];return G(tT(r)!==tT(a)),{premises:[t[0]===`l`?q(n,r):q(r,n),t[1]===`l`?q(i,a):q(a,i)],branches:[[K(q(n,i))]]}},mT=(e,t,n)=>{let r=Qw(t,`app`),i=Qw(n,`app`);return G(t.symbol===n.symbol&&r.length===i.length),{premises:e,branches:r.map((e,t)=>[K(q(e,i[t]))])}},hT={not_equal:e=>mT([K(q(e[0],e[1]))],e[0],e[1]),p_not_p:e=>mT([e[0],e[1]],e[0],$w(e[1])),trans:(e,t)=>dT(t,e,!1),trans_sym:(e,t)=>dT(t,e,!0),trans_eq:(e,t)=>fT(t,e,`trans_eq`),trans_eq_sym:(e,t)=>fT(t,e,`trans_eq_sym`),trans_eq2:(e,t)=>fT(t,e,`trans_eq2`),congruence_lr:e=>(G(e[0].kind===`lam`),{premises:[Y(e[0],e[1]),q(e[1],e[2])],branches:[[Y(e[0],e[2])]]}),congruence_rl:e=>(G(e[0].kind===`lam`),{premises:[Y(e[0],e[1]),q(e[2],e[1])],branches:[[Y(e[0],e[2])]]}),stringequal:e=>(G(tT(Hw(`$string`,[e[0]]))!==tT(Hw(`$string`,[e[1]]))),{premises:[q(Hw(`$string`,[e[0]]),Hw(`$string`,[e[1]]))],branches:[]}),stringdiffll:e=>pT(e,`ll`),stringdifflr:e=>pT(e,`lr`),stringdiffrl:e=>pT(e,`rl`),stringdiffrr:e=>pT(e,`rr`)},gT=(e,t)=>{let n=e.relation;switch(e.name){case`close_refl`:return t.ensureRelation(n,[`reflexive`]),{premises:[K(uT(n,e.args[0],e.args[0]))],branches:[]};case`close_sym`:return t.ensureRelation(n,[`symmetric`]),{premises:[uT(n,e.args[0],e.args[1]),K(uT(n,e.args[1],e.args[0]))],branches:[]};case`refl`:return t.ensureRelation(n,[`reflexive`]),{premises:[K(uT(n,e.args[0],e.args[1]))],branches:[[K(q(e.args[0],e.args[1]))]]};case`p_not_p_sym`:{t.ensureRelation(n,[`symmetric`]);let r=X(e.args[0],n,2),i=X($w(e.args[1]),n,2);return{premises:[e.args[0],e.args[1]],branches:[[K(q(r[1],i[0]))],[K(q(r[0],i[1]))]]}}}},_T=(e,t,n)=>(X(X($w(e),`TLA.isAFcn`,1)[0],t,n),{premises:[e],branches:[]}),vT={notisafcn_fcn:e=>_T(e[0],`TLA.Fcn`,2),notisafcn_except:e=>_T(e[0],`TLA.except`,3),notisafcn_onearg:e=>_T(e[0],`TLA.oneArg`,2),notisafcn_extend:e=>_T(e[0],`TLA.extend`,2),funequal:(e,t)=>{let n=X(e[0],`=`,2),r=n[0],i=n[1],a=Uw(Uw(Kw(Hw(`TLA.isAFcn`,[r]),Hw(`TLA.isAFcn`,[i])),q(Jw(r),Jw(i))),t.bind(`all`,``,e=>q(qw(r,e),qw(i,e))));return{premises:[e[0]],branches:[[a]]}},notfunequal:(e,t)=>{let n=X($w(e[0]),`=`,2),r=n[0],i=n[1],a=K(Uw(Uw(Uw(Hw(`TLA.isAFcn`,[r]),Hw(`TLA.isAFcn`,[i])),q(Jw(r),Jw(i))),t.bind(`all`,``,e=>Gw(J(e,Jw(i)),q(qw(r,e),qw(i,e))))));return{premises:[e[0]],branches:[[a]]}}},yT=()=>{let e=/* @__PURE__ */ new WeakMap,t=/* @__PURE__ */ new WeakMap,n=0,r=t=>{let n=e.get(t);if(n!==void 0)return n;let i=/* @__PURE__ */ new Set,a=t.kind===`subst`?t.symbol:t.kind===`all`||t.kind===`ex`||t.kind===`tau`||t.kind===`lam`?t.args[0].symbol:void 0;return(t.kind===`var`||t.kind===`app`)&&i.add(t.symbol),t.kind!==`meta`&&t.args.forEach((e,n)=>{for(let o of r(e))(o!==a||t.kind===`subst`&&n===1)&&i.add(o)}),e.set(t,i),i},i=(e,t,n,i)=>{for(let o of r(e))if(t.has(o)||i?.has(o)===!0)return a(e,t,n,i);return o(e)},a=(e,t,n,r)=>{let a=e=>i(e,t,n,r),s=(e,t)=>`${e}${t.length}:${t}`,c=e=>{if(r===void 0||!r.has(e))return r;let t=new Map(r);return t.delete(e),t};switch(e.kind){case`var`:{let r=t.get(e.symbol);return r===void 0?s(`v`,e.symbol):typeof r==`number`?`#${n-r}`:i(r.formula,r.env,n,r.operators)}case`meta`:return`m(${o(e.args[0])})`;case`true`:return`T`;case`false`:return`F`;case`subst`:{let a=new Map(t);return a.set(e.symbol,{formula:e.args[1],env:t,operators:r}),i(e.args[0],a,n,c(e.symbol))}case`app`:{let o=e.args.map(a);if(e.symbol===`$notequiv`&&o.length===2)return`~(equiv(${o[0]},${o[1]}))`;let c=r?.get(e.symbol);if(c===void 0)return`${s(`a`,e.symbol)}(${o.join(`,`)})`;if(c.kind===`lam`&&o.length===1){let a=/* @__PURE__ */ new Map([[c.args[0].symbol,{formula:e.args[0],env:t,operators:r}]]);return i(c.args[1],a,n)}if(c.kind===`var`)return`${s(`a`,c.symbol)}(${o.join(`,`)})`;if(c.kind===`app`)return`${s(`a`,c.symbol)}(${[...c.args.map(e=>i(e,/* @__PURE__ */ new Map,n)),...o].join(`,`)})`;throw new zw}case`not`:return`~(${a(e.args[0])})`;case`and`:case`or`:case`imply`:case`equiv`:return`${e.kind}(${a(e.args[0])},${a(e.args[1])})`;default:{let r=new Map(t);r.set(e.args[0].symbol,n);let a=i(e.args[1],r,n+1,c(e.args[0].symbol));return`${e.kind}${s(``,e.symbol)}{${a}}`}}},o=e=>{let n=t.get(e);if(n!==void 0)return n;let r=a(e,/* @__PURE__ */ new Map,0);return t.set(e,r),r};return{getKey:i,getTopKey:o,isSame:(e,t)=>o(e)===o(t),bind:(e,t,r)=>{let i=Vw(`\u0000${n++}`);return Bw(e,t,[i,r(i)])}}},bT=e=>{if(e.kind===`and`)return e.args.flatMap(bT);if(e.kind!==`not`)return[e];let t=e.args[0];return t.kind===`or`?t.args.flatMap(e=>bT(K(e))):t.kind===`imply`?[...bT(t.args[0]),...bT(K(t.args[1]))]:t.kind===`not`?bT(t.args[0]):[e]},xT=e=>{if(e.kind===`or`)return e.args.flatMap(xT);if(e.kind===`imply`)return[...xT(K(e.args[0])),...xT(e.args[1])];if(e.kind!==`not`)return[e];let t=e.args[0];return t.kind===`and`?t.args.flatMap(e=>xT(K(e))):t.kind===`not`?xT(t.args[0]):[e]},ST=e=>Y(e,Bw(`tau`,e.symbol,e.args)),CT={close:e=>({premises:[e[0],K(e[0])],branches:[]}),false:()=>({premises:[Xw],branches:[]}),not_true:()=>({premises:[K(Yw)],branches:[]}),conj_tree:e=>({premises:[e[0]],branches:[bT(e[0])]}),disj_tree:e=>({premises:[e[0]],branches:xT(e[0]).map(e=>[e])}),and:e=>({premises:[Uw(e[0],e[1])],branches:[[e[0],e[1]]]}),not_not:e=>({premises:[K(K(e[0]))],branches:[[e[0]]]}),not_or:e=>({premises:[K(Ww(e[0],e[1]))],branches:[[K(e[0]),K(e[1])]]}),not_impl:e=>({premises:[K(Gw(e[0],e[1]))],branches:[[e[0],K(e[1])]]}),or:e=>({premises:[Ww(e[0],e[1])],branches:[[e[0]],[e[1]]]}),impl:e=>({premises:[Gw(e[0],e[1])],branches:[[K(e[0])],[e[1]]]}),equiv:e=>({premises:[Kw(e[0],e[1])],branches:[[K(e[0]),K(e[1])],[e[0],e[1]]]}),not_and:e=>({premises:[K(Uw(e[0],e[1]))],branches:[[K(e[0])],[K(e[1])]]}),not_equiv:e=>({premises:[K(Kw(e[0],e[1]))],branches:[[K(e[0]),e[1]],[e[0],K(e[1])]]}),ex:e=>(Qw(e[0],`ex`),{premises:[e[0]],branches:[[ST(e[0])]]}),not_all_ex:e=>{let t=$w(e[0]);Qw(t,`all`);let n=Bw(`ex`,t.symbol,[t.args[0],K(t.args[1])]);return{premises:[e[0]],branches:[[ST(n),n]]}},all:e=>(Qw(e[0],`all`),{premises:[e[0]],branches:[[Y(e[0],e[1])]]}),not_ex:e=>{let t=$w(e[0]);return Qw(t,`ex`),{premises:[e[0]],branches:[[K(Y(t,e[1]))]]}},cut:e=>({premises:[],branches:[[e[0]],[K(e[0])]]})},wT=(e,t)=>{let n=nT(X(e,t)),r=n.map(e=>tT(e[0]));return G(new Set(r).size===r.length),n},TT=e=>Hw(`TLA.set`,e.map(e=>e[0])),ET=(e,t)=>{let n=X($w(e),`=`,2),r=t?n[0]:n[1],i=wT(t?n[1]:n[0],`TLA.record`);return{premises:[e],branches:[[K(Hw(`TLA.isAFcn`,[r]))],[K(q(Jw(r),TT(i)))],...i.map(e=>[K(q(qw(r,e[0]),e[1]))])]}},DT=(e,t,n)=>{let r=new Set(n.map(e.getTopKey));return G(t.length===r.size&&t.every(t=>r.has(e.getTopKey(t)))),t.map(e=>[e])},OT={tuple_eq_match:e=>{let t=X(e[0],`=`,2),n=X(t[0],`TLA.tuple`),r=X(t[1],`TLA.tuple`);return G(n.length===r.length),{premises:[e[0]],branches:[n.map((e,t)=>q(e,r[t]))]}},tuple_eq_mismatch:e=>{let t=X(e[0],`=`,2);return G(X(t[0],`TLA.tuple`).length!==X(t[1],`TLA.tuple`).length),{premises:[e[0]],branches:[]}},in_product:e=>{let t=X(e[0],`TLA.in`,2),n=t[0],r=X(X(t[1],`TLA.Product`,1)[0],`TLA.tuple`);return{premises:[e[0]],branches:[[Hw(`TLA.isASeq`,[n]),q(Hw(`TLA.Len`,[n]),rT(r.length)),...r.map((e,t)=>J(qw(n,rT(t+1)),e))]]}},notin_product:e=>{let t=X($w(e[0]),`TLA.in`,2),n=t[0],r=X(X(t[1],`TLA.Product`,1)[0],`TLA.tuple`);return{premises:[e[0]],branches:[[K(Hw(`TLA.isASeq`,[n]))],[K(q(Hw(`TLA.Len`,[n]),rT(r.length)))],...r.map((e,t)=>[K(J(qw(n,rT(t+1)),e))])]}},tuple_notisaseq:e=>(X(X($w(e[0]),`TLA.isASeq`,1)[0],`TLA.tuple`),{premises:[e[0]],branches:[]}),record_eq_match:(e,t)=>{let n=X(e[0],`=`,2),r=wT(n[0],`TLA.record`),i=wT(n[1],`TLA.record`),a=new Map(i.map(e=>[tT(e[0]),e[1]])),o=r.flatMap(e=>{let t=a.get(tT(e[0]));return t===void 0?[]:[q(e[1],t)]}),s=new Set(o.map(t.getTopKey)),c=e.slice(1);return G(c.every(e=>s.has(t.getTopKey(e)))),{premises:[e[0]],branches:[c]}},record_eq_mismatch:e=>{let t=X(e[0],`=`,2),n=wT(t[0],`TLA.record`).map(e=>tT(e[0])),r=new Set(wT(t[1],`TLA.record`).map(e=>tT(e[0])));return G(n.length!==r.size||n.some(e=>!r.has(e))),{premises:[e[0]],branches:[]}},record_neq_match:(e,t)=>{let n=X($w(e[0]),`=`,2),r=wT(n[0],`TLA.record`),i=wT(n[1],`TLA.record`),a=new Map(i.map(e=>[tT(e[0]),e[1]]));G(r.length===i.length);let o=r.map(e=>{let t=a.get(tT(e[0]));return G(t!==void 0),K(q(e[1],t))});return{premises:[e[0]],branches:DT(t,e.slice(1),o)}},neq_record:e=>ET(e[0],!0),record_neq:e=>ET(e[0],!1),in_recordset:e=>{let t=X(e[0],`TLA.in`,2),n=t[0],r=wT(t[1],`TLA.recordset`);return{premises:[e[0]],branches:[[Hw(`TLA.isAFcn`,[n]),q(Jw(n),TT(r)),...r.map(e=>J(qw(n,e[0]),e[1]))]]}},notin_recordset:e=>{let t=X($w(e[0]),`TLA.in`,2),n=t[0],r=wT(t[1],`TLA.recordset`);return{premises:[e[0]],branches:[[K(Hw(`TLA.isAFcn`,[n]))],[K(q(Jw(n),TT(r)))],...r.map(e=>[K(J(qw(n,e[0]),e[1]))])]}},record_notisafcn:e=>(X(X($w(e[0]),`TLA.isAFcn`,1)[0],`TLA.record`),{premises:[e[0]],branches:[]})},kT=[0,1,2],AT=(e,t,n,r)=>{let i=()=>r===`both`?`both`:r===`positive`?`negative`:`positive`;switch(e.kind){case`true`:return()=>!0;case`false`:return()=>!1;case`not`:{let r=AT(e.args[0],t,n,i());return r&&((e,t)=>!r(e,t))}case`and`:case`or`:case`imply`:case`equiv`:{let a=AT(e.args[0],t,n,e.kind===`imply`?i():e.kind===`equiv`?`both`:r),o=AT(e.args[1],t,n,e.kind===`equiv`?`both`:r);return a===void 0||o===void 0?void 0:e.kind===`and`?(e,t)=>a(e,t)&&o(e,t):e.kind===`or`?(e,t)=>a(e,t)||o(e,t):e.kind===`imply`?(e,t)=>!a(e,t)||o(e,t):(e,t)=>a(e,t)===o(e,t)}case`all`:case`ex`:{if(!(e.kind===`all`?r===`positive`:r===`negative`)||e.symbol!==`zenon_U`)return;let i=AT(e.args[1],t,[...n,e.args[0].symbol],r);return i===void 0?void 0:e.kind===`all`?(e,t)=>kT.every(n=>i([...e,n],t)):(e,t)=>kT.some(n=>i([...e,n],t))}case`app`:{if(e.symbol!==t||e.args.length!==2)return;let r=e.args.map(e=>e.kind===`var`?n.lastIndexOf(e.symbol):-1);return r.includes(-1)?void 0:(e,t)=>(t>>3*e[r[0]]+e[r[1]]&1)==1}default:return}},jT=e=>{let t=/* @__PURE__ */ new Map,n=(n,r)=>{let i=`${r}:${n}`,a=t.get(i);if(a!==void 0)return a;let o=e.hypotheses.flatMap(e=>{let t=AT(e,n,[],`positive`);return t===void 0?[]:[t]}),s=(e,t,n)=>(e>>3*t+n&1)==1,c=e=>r===`reflexive`?!s(e,0,0):r===`symmetric`?s(e,0,1)&&!s(e,1,0):s(e,0,1)&&s(e,1,2)&&!s(e,0,2),l=[...Array(512).keys()].every(e=>!c(e)||!o.every(t=>t([],e)));return t.set(i,l),l};return(e,t)=>e===`=`||t.every(t=>n(e,t))},MT=(e,t)=>{G(e.kind===`lam`);let n=e.args[0].symbol,r=(e,t)=>{if(e.kind===`var`&&e.symbol===n)return t;if(e.kind===t.kind&&e.symbol===t.symbol&&e.args.length===t.args.length&&(e.kind===`app`||e.kind===`not`))for(let n=0;n<e.args.length;n++){let i=r(e.args[n],t.args[n]);if(i!==void 0)return i}},i=r(e.args[1],t);return G(i!==void 0),i},NT=(e,t,n,r)=>{let i=MT(n,t);return G(e.isSame(t,Y(n,i))),{premises:[t],branches:r(i)}},PT=(e,t,n)=>t.length===0?[[n]]:t.length===1?[[n,Y(e,t[0])]]:[[t[0],Y(e,t[1])],...PT(e,t.slice(2),Uw(K(t[0]),n))],FT=(e,t,n)=>{let r=X(t[1],`=`,2)[0];G(n(r));let i=t[5],a=MT(i,t[0]);return G(e.isSame(a,r)&&e.isSame(t[0],Y(i,r))),{premises:[t[0]],branches:[[q(r,Yw),Y(i,Yw)],[q(r,Xw),Y(i,Xw)]]}},IT=e=>{let t=0,n=e;for(;Zw(n,`TLA.fapply`,2)&&eT(n.args[0],`TLA.Succ`);)t++,n=n.args[1];return G(n.kind===`var`&&/^(0|[1-9][0-9]*)$/.test(n.symbol)),t+Number(n.symbol)},LT={trueistrue:(e,t)=>{let n=e[3],r=e[1];return G(n.kind===`lam`&&t.isSame(e[0],Y(n,r))),{premises:[e[0],r],branches:[[Y(n,Yw)]]}},fapplyfcn:(e,t)=>NT(t,e[0],e[3],t=>{let n=X(t,`TLA.fapply`,2),r=X(n[0],`TLA.Fcn`,2);return G(r[1].kind===`lam`),[[K(J(n[1],r[0]))],[Y(e[3],Y(r[1],n[1]))]]}),fapplyexcept:(e,t)=>NT(t,e[0],e[8],t=>{let n=X(t,`TLA.fapply`,2),r=X(n[0],`TLA.except`,3),i=n[1],a=J(i,Jw(r[0]));return[[a,q(r[1],i),Y(e[8],r[2])],[a,K(q(r[1],i)),Y(e[8],qw(r[0],i))],[K(a)]]}),tuple_access:(e,t)=>NT(t,e[0],e[2],t=>{let n=X(t,`TLA.fapply`,2),r=X(n[0],`TLA.tuple`),i=IT(n[1]);return G(i>=1&&i<=r.length),[[Y(e[2],r[i-1])]]}),record_access:(e,t)=>NT(t,e[0],e[2],t=>{let n=X(t,`TLA.fapply`,2),r=tT(n[1]),i=wT(n[0],`TLA.record`).find(e=>tT(e[0])===r);return G(i!==void 0),[[Y(e[2],i[1])]]}),domain_fcn:(e,t)=>NT(t,e[0],e[2],t=>{let n=X(X(t,`TLA.DOMAIN`,1)[0],`TLA.Fcn`,2);return[[Y(e[2],n[0])]]}),domain_except:(e,t)=>NT(t,e[0],e[2],t=>{let n=X(X(t,`TLA.DOMAIN`,1)[0],`TLA.except`,3);return[[Y(e[2],Jw(n[0]))]]}),record_domain:(e,t)=>NT(t,e[0],e[2],t=>{let n=X(t,`TLA.DOMAIN`,1)[0],r=nT(X(n,`TLA.record`));return[[Y(e[2],Hw(`TLA.set`,r.map(e=>e[0])))]]}),boolcase_not:(e,t)=>FT(t,e,e=>e.kind===`not`),boolcase_and:(e,t)=>FT(t,e,e=>e.kind===`and`),boolcase_or:(e,t)=>FT(t,e,e=>e.kind===`or`),boolcase_imply:(e,t)=>FT(t,e,e=>e.kind===`imply`),boolcase_equiv:(e,t)=>FT(t,e,e=>e.kind===`equiv`),boolcase_equal:(e,t)=>FT(t,e,e=>Zw(e,`=`,2)),boolcase_all:(e,t)=>FT(t,e,e=>e.kind===`all`),boolcase_ex:(e,t)=>FT(t,e,e=>e.kind===`ex`),iftrue:(e,t)=>NT(t,e[0],e[2],t=>{let n=X(t,`TLA.cond`,3);return G(n[0].kind===`true`),[[Y(e[2],n[1])]]}),iffalse:(e,t)=>NT(t,e[0],e[2],t=>{let n=X(t,`TLA.cond`,3);return G(n[0].kind===`false`),[[Y(e[2],n[2])]]}),ifthenelse:(e,t)=>NT(t,e[0],e[5],t=>{let n=X(t,`TLA.cond`,3);return[[n[0],Y(e[5],n[1])],[K(n[0]),Y(e[5],n[2])]]}),case:(e,t)=>NT(t,e[0],e[1],t=>PT(e[1],X(t,`TLA.CASE`),Yw)),tuple_len:(e,t)=>NT(t,e[0],e[2],t=>{let n=X(X(t,`TLA.Len`,1)[0],`TLA.tuple`);return[[Y(e[2],rT(n.length))]]})},RT=(e,t,n,r)=>{let i=t?$w(e):e,a=X(i,`TLA.in`,2);return{element:a[0],operands:X(a[1],n,r),set:a[1]}},zT=(e,t,n)=>{let r=X(t?$w(e):e,`=`,2),i=n.bind(`all`,``,e=>Kw(J(e,r[0]),J(e,r[1])));return{premises:[e],branches:[[t?K(i):i]]}},BT={in_emptyset:e=>(G(eT(X(e[0],`TLA.in`,2)[1],`TLA.emptyset`)),{premises:[e[0]],branches:[]}),in_upair:e=>{let t=RT(e[0],!1,`TLA.upair`,2);return{premises:[e[0]],branches:t.operands.map(e=>[q(t.element,e)])}},notin_upair:e=>{let t=RT(e[0],!0,`TLA.upair`,2);return{premises:[e[0]],branches:[t.operands.map(e=>K(q(t.element,e)))]}},in_addElt:e=>{let t=RT(e[0],!1,`TLA.addElt`,2),n=[],r=t.set;for(;Zw(r,`TLA.addElt`,2);)n.push([q(t.element,r.args[0])]),r=r.args[1];return{premises:[e[0]],branches:eT(r,`TLA.emptyset`)?n:[...n,[J(t.element,r)]]}},notin_addElt:e=>{let t=RT(e[0],!0,`TLA.addElt`,2),n=[],r=t.set;for(;Zw(r,`TLA.addElt`,2);)n.push(K(q(t.element,r.args[0]))),r=r.args[1];return eT(r,`TLA.emptyset`)||n.push(K(J(t.element,r))),{premises:[e[0]],branches:[n]}},in_set:e=>{let t=X(e[0],`TLA.in`,2),n=X(t[1],`TLA.set`);return{premises:[e[0]],branches:n.map(e=>[q(t[0],e)])}},notin_set:e=>{let t=X($w(e[0]),`TLA.in`,2),n=X(t[1],`TLA.set`);return{premises:[e[0]],branches:[n.map(e=>K(q(t[0],e)))]}},in_SUBSET:e=>{let t=RT(e[0],!1,`TLA.SUBSET`,1);return{premises:[e[0]],branches:[[Hw(`TLA.subseteq`,[t.element,t.operands[0]])]]}},notin_SUBSET:e=>{let t=RT(e[0],!0,`TLA.SUBSET`,1);return{premises:[e[0]],branches:[[K(Hw(`TLA.subseteq`,[t.element,t.operands[0]]))]]}},in_UNION:(e,t)=>{let n=RT(e[0],!1,`TLA.UNION`,1),r=t.bind(`ex`,``,e=>Uw(J(e,n.operands[0]),J(n.element,e)));return{premises:[e[0]],branches:[[r]]}},notin_UNION:(e,t)=>{let n=RT(e[0],!0,`TLA.UNION`,1),r=t.bind(`ex`,``,e=>Uw(J(e,n.operands[0]),J(n.element,e)));return{premises:[e[0]],branches:[[K(r)]]}},in_cup:e=>{let t=RT(e[0],!1,`TLA.cup`,2);return{premises:[e[0]],branches:t.operands.map(e=>[J(t.element,e)])}},notin_cup:e=>{let t=RT(e[0],!0,`TLA.cup`,2);return{premises:[e[0]],branches:[t.operands.map(e=>K(J(t.element,e)))]}},in_cap:e=>{let t=RT(e[0],!1,`TLA.cap`,2);return{premises:[e[0]],branches:[t.operands.map(e=>J(t.element,e))]}},notin_cap:e=>{let t=RT(e[0],!0,`TLA.cap`,2);return{premises:[e[0]],branches:t.operands.map(e=>[K(J(t.element,e))])}},in_setminus:e=>{let t=RT(e[0],!1,`TLA.setminus`,2);return{premises:[e[0]],branches:[[J(t.element,t.operands[0]),K(J(t.element,t.operands[1]))]]}},notin_setminus:e=>{let t=RT(e[0],!0,`TLA.setminus`,2);return{premises:[e[0]],branches:[[K(J(t.element,t.operands[0]))],[J(t.element,t.operands[1])]]}},in_subsetof:e=>{let t=RT(e[0],!1,`TLA.subsetOf`,2),n=t.operands[1];return G(n.kind===`lam`),{premises:[e[0]],branches:[[J(t.element,t.operands[0]),Y(n,t.element)]]}},notin_subsetof:e=>{let t=RT(e[0],!0,`TLA.subsetOf`,2),n=t.operands[1];return G(n.kind===`lam`),{premises:[e[0]],branches:[[K(J(t.element,t.operands[0]))],[K(Y(n,t.element))]]}},in_setofall:(e,t)=>{let n=RT(e[0],!1,`TLA.setOfAll`,2),r=n.operands[1];G(r.kind===`lam`);let i=t.bind(`ex`,``,e=>Uw(J(e,n.operands[0]),q(n.element,Y(r,e))));return{premises:[e[0]],branches:[[i]]}},notin_setofall:(e,t)=>{let n=RT(e[0],!0,`TLA.setOfAll`,2),r=n.operands[1];G(r.kind===`lam`);let i=t.bind(`ex`,``,e=>Uw(J(e,n.operands[0]),q(n.element,Y(r,e))));return{premises:[e[0]],branches:[[K(i)]]}},in_funcset:(e,t)=>{let n=RT(e[0],!1,`TLA.FuncSet`,2),r=n.element,i=t.bind(`all`,``,e=>Gw(J(e,n.operands[0]),J(qw(r,e),n.operands[1])));return{premises:[e[0]],branches:[[Hw(`TLA.isAFcn`,[r]),q(Jw(r),n.operands[0]),i]]}},notin_funcset:(e,t)=>{let n=RT(e[0],!0,`TLA.FuncSet`,2),r=n.element,i=t.bind(`all`,``,e=>Gw(J(e,n.operands[0]),J(qw(r,e),n.operands[1])));return{premises:[e[0]],branches:[[K(Hw(`TLA.isAFcn`,[r]))],[K(q(Jw(r),n.operands[0]))],[K(i)]]}},except_notin_funcset:e=>{let t=RT(e[0],!0,`TLA.FuncSet`,2),n=X(t.element,`TLA.except`,3);return{premises:[e[0]],branches:[[K(J(n[0],t.set))],[K(J(n[2],t.operands[1]))]]}},setequalempty:(e,t)=>{let n=X(e[0],`=`,2);return G(eT(n[1],`TLA.emptyset`)),{premises:[e[0]],branches:[[t.bind(`all`,``,e=>K(J(e,n[0])))]]}},setemptyequal:(e,t)=>{let n=X(e[0],`=`,2);return G(eT(n[0],`TLA.emptyset`)),{premises:[e[0]],branches:[[t.bind(`all`,``,e=>K(J(e,n[1])))]]}},setequal:(e,t)=>zT(e[0],!1,t),notsetequal:(e,t)=>zT(e[0],!0,t),cup_subseteq:e=>{let t=X(e[0],`TLA.subseteq`,2),n=X(t[0],`TLA.cup`,2);return{premises:[e[0]],branches:[n.map(e=>Hw(`TLA.subseteq`,[e,t[1]]))]}},not_cup_subseteq:e=>{let t=X($w(e[0]),`TLA.subseteq`,2),n=X(t[0],`TLA.cup`,2);return{premises:[e[0]],branches:n.map(e=>[K(Hw(`TLA.subseteq`,[e,t[1]]))])}},subseteq_cap:e=>{let t=X(e[0],`TLA.subseteq`,2),n=X(t[1],`TLA.cap`,2);return{premises:[e[0]],branches:[n.map(e=>Hw(`TLA.subseteq`,[t[0],e]))]}},not_subseteq_cap:e=>{let t=X($w(e[0]),`TLA.subseteq`,2),n=X(t[1],`TLA.cap`,2);return{premises:[e[0]],branches:n.map(e=>[K(Hw(`TLA.subseteq`,[t[0],e]))])}}},VT=(e,t,n)=>{let r=t?$w(e[0]):e[0],i=X(e[1],`=`,2),a=n?i[0]:i[1],o=n?i[1]:i[0];return{premises:[e[0],e[1]],branches:[[K(q(r,a))],[t?K(o):o]]}},HT={eq_x_true:e=>{let t=X(e[0],`=`,2);return G(t[1].kind===`true`),{premises:[e[0]],branches:[[t[0]]]}},eq_true_x:e=>{let t=X(e[0],`=`,2);return G(t[0].kind===`true`),{premises:[e[0]],branches:[[t[1]]]}},noteq_x_true:e=>{let t=X($w(e[0]),`=`,2);return G(t[1].kind===`true`),{premises:[e[0]],branches:[[K(t[0])]]}},noteq_true_x:e=>{let t=X($w(e[0]),`=`,2);return G(t[0].kind===`true`),{premises:[e[0]],branches:[[K(t[1])]]}},eq_x_false:e=>{let t=X(e[0],`=`,2);return G(t[1].kind===`false`),{premises:[e[0]],branches:[[K(t[0])]]}},eq_false_x:e=>{let t=X(e[0],`=`,2);return G(t[0].kind===`false`),{premises:[e[0]],branches:[[K(t[1])]]}},choose_diff_choose:(e,t)=>{let n=e[2],r=e[3];G(n.kind===`lam`&&r.kind===`lam`&&n.symbol===r.symbol);let i=e=>Bw(`tau`,e.symbol,e.args);G(t.isSame(e[0],K(q(i(n),i(r)))));let a=t.bind(`ex`,n.symbol,e=>K(Kw(Y(n,e),Y(r,e))));return{premises:[e[0]],branches:[[a]]}},notequivdef:(e,t,n)=>{G(n.length===1);let r=X(n[0],`$notequiv`,2);return{premises:[n[0]],branches:[[K(Kw(r[0],r[1]))]]}},notequalchoose:e=>{let t=e[3];G(t.kind===`lam`);let n=Bw(`ex`,t.symbol,t.args);return{premises:[],branches:[[n],[K(n),K(Y(t,e[4]))]]}},in_nat_0:e=>{let t=X($w(e[0]),`TLA.in`,2);return G(eT(t[0],`0`)&&eT(t[1],`arith.N`)),{premises:[e[0]],branches:[]}},in_nat_succ:e=>{let t=X($w(e[0]),`TLA.in`,2),n=X(t[0],`TLA.fapply`,2);return G(eT(n[0],`TLA.Succ`)&&eT(t[1],`arith.N`)),{premises:[e[0]],branches:[[K(J(n[1],t[1]))]]}},box_p:e=>({premises:[e[0]],branches:[[X(e[0],`TLA.box`,1)[0]]]}),all_in:(e,t)=>{let n=X(e[0],`TLA.bAll`,2),r=X(e[1],`TLA.in`,2);return G(t.isSame(n[0],r[1])&&n[1].kind===`lam`),{premises:[e[0],e[1]],branches:[[Y(n[1],r[0])]]}},notex_in:(e,t)=>{let n=X($w(e[0]),`TLA.bEx`,2),r=X(e[1],`TLA.in`,2);return G(t.isSame(n[0],r[1])&&n[1].kind===`lam`),{premises:[e[0],e[1]],branches:[[K(Y(n[1],r[0]))]]}},p_eq_l:e=>VT(e,!1,!0),p_eq_r:e=>VT(e,!1,!1),np_eq_l:e=>VT(e,!0,!0),np_eq_r:e=>VT(e,!0,!1)},UT={...CT,...hT,...BT,...vT,...OT,...LT,...HT},WT=(e,t,n)=>UT[e.name](e.args,t,n),GT=(e,t)=>{let n=e.rule;switch(n.name){case`definition`:return lT(n.definition,n.args,t);case`close_refl`:case`close_sym`:case`refl`:case`p_not_p_sym`:return gT(n,t);default:return WT(n,t,e.uses)}},KT=(e,t,n)=>{let r=yT(),i=jT(t),a={...r,context:t,ensureRelation:(e,t)=>G(i(e,t))},o=/* @__PURE__ */ new Map,s=e=>{let t=GT(e,a);G(t.branches.length===e.subproofs.length);let n=new Set(t.premises.map(r.getTopKey));return e.subproofs.forEach((e,i)=>{let a=new Set(t.branches[i].map(r.getTopKey));for(let t of o.get(e)??[])a.has(t)||n.add(t)}),n};try{let i=[[e,!1]];for(;i.length>0;){if(Rw(n)!==void 0)return!1;let e=i.pop();if(e===void 0)break;let t=e[0];if(!o.has(t)){if(e[1])o.set(t,s(t));else{i.push([t,!0]);for(let e of t.subproofs)o.has(e)||i.push([e,!1])}}}let a=new Set(t.hypotheses.map(r.getTopKey));return[...o.get(e)??[]].filter(e=>!a.has(e)).length===0}catch(e){if(e instanceof zw)return!1;throw e}},qT=4294967296,JT=2147483648,YT=2048,XT=new TextEncoder,ZT=(e,t)=>e<<t|e>>>32-t,QT=(e,t)=>{let n=Math.imul(ZT(Math.imul(t,3432918353),15),461845907);return Math.imul(ZT(e^n,13),5)+3864292196|0},$T=e=>{let t=Math.imul(e^e>>>16,2246822507),n=Math.imul(t^t>>>13,3266489909);return(n^n>>>16)>>>0&1073741823},eE=e=>{let t=XT.encode(e),n=[];for(let e=0;e<t.length;e+=4)n.push(t[e]|(t[e+1]??0)<<8|(t[e+2]??0)<<16|(t[e+3]??0)<<24);return{words:n,length:t.length}},tE=(e,t)=>{let n=e;for(let e of t.words)n=QT(n,e);return n^t.length},nE=(e,t,n)=>{let r=(n*2+1)%qT,i=t*2+Math.floor((n*2+1)/qT);return QT(e,i^(i<0?-1:0)^r)},rE=()=>{let e=/* @__PURE__ */ new Map,t=/* @__PURE__ */ new Map,n=(t,n)=>{let r=e.get(n),i=r??eE(n);return r===void 0&&e.set(n,i),tE(t,i)};return{hashString:e=>{let r=t.get(e);if(r!==void 0)return r;let i=$T(n(0,e));return t.set(e,i),i},hashIntAndStrings:(e,t,r)=>{let i=nE(QT(0,YT),e,t),a=9;for(let e of r){if(a===0)return $T(i);i=n(QT(i,YT),e),a--}return $T(a===0?i:nE(i,0,0))}}},iE=e=>{let t=(e%JT+JT)%JT;return t>=1073741824?t-JT:t},aE=(e,t)=>{let n=t.low*131,r=Math.floor(n/qT),i=e.low+(n-r*qT)+1,a=Math.floor(i/qT);return{high:iE(e.high+t.high*131+r+a),low:i-a*qT}},oE=e=>({high:0,low:e}),sE=(e,t,n)=>{let r=[],i=0,a=0;for(;i<e.length&&a<t.length;)n(e[i],t[a])?r.push(e[i++]):r.push(t[a++]);for(;i<e.length;)r.push(e[i++]);for(;a<t.length;)r.push(t[a++]);return r.reverse()},cE=(e,t)=>{let n=(r,i,a)=>{let o=(e,n)=>a?t(e,n)>0:t(e,n)<=0;if(r===2){let t=e[i],n=e[i+1];return o(t,n)?[t,n]:[n,t]}if(r===3){let t=e[i],n=e[i+1],r=e[i+2];return o(t,n)?o(n,r)?[t,n,r]:o(t,r)?[t,r,n]:[r,t,n]:o(t,r)?[n,t,r]:o(n,r)?[n,r,t]:[r,n,t]}let s=r>>1,c=n(s,i,!a),l=n(r-s,i+s,!a);return a?sE(c,l,(e,n)=>t(e,n)<=0):sE(c,l,(e,n)=>t(e,n)>0)};return e.length<2?[...e]:n(e.length,0,!1)},lE={true:oE(184958167),false:oE(224049648),meta:oE(54331692),app:oE(54238245),not:oE(130279378),and:oE(214810971),or:oE(77288889),imply:oE(132905583),equiv:oE(185538807),all:oE(263469055),ex:oE(7433042),tau:oE(78544813),lam:oE(38460595)},uE=oE(0),dE=(e,t,n)=>({id:t,kind:e,symbol:``,args:[],hash:rE().hashIntAndStrings(n.high,n.low,[]),skeleton:n,freeVars:[],size:1,taus:0,metas:[]}),fE=dE(`true`,0,lE.true),pE=dE(`false`,1,lE.false),mE=e=>e.kind===`and`||e.kind===`or`||e.kind===`imply`||e.kind===`equiv`,hE=e=>e.kind===`all`||e.kind===`ex`||e.kind===`tau`||e.kind===`lam`,gE=(e,t)=>{if(e.length===0)return t;if(t.length===0)return e;let n=[...t];for(let t of e)n.includes(t)||n.unshift(t);return n},_E=(e,t)=>{let n=t.indexOf(e);return n===-1?t:[...t.slice(0,n),...t.slice(n+1)]},vE=(e,t)=>e.filter(e=>!t.includes(e)),yE=(e,t)=>{let n=vE(e,t);return n.length===0?t:[...n.reverse(),...t]},bE=(e,t)=>!e.some(e=>t.includes(e)),xE=(e,t)=>t.some(t=>e.some(e=>e.symbol===t)),SE=(e,t,n,r)=>{let i=e.indexOf(t),a=n.indexOf(r);return i===-1?a===-1&&t===r:i===a},CE=(e,t,n,r)=>{let i=xE(e,n.freeVars),a=xE(t,r.freeVars);if(!i&&!a)return n===r;if(!i||!a||n.kind!==r.kind)return!1;switch(n.kind){case`var`:return SE(e,n,t,r);case`meta`:return r.kind===`meta`&&n.args[0]===r.args[0];case`app`:return r.kind===`app`&&n.symbol===r.symbol&&n.args.length===r.args.length&&n.args.every((n,i)=>CE(e,t,n,r.args[i]));case`not`:return r.kind===`not`&&CE(e,t,n.args[0],r.args[0]);case`and`:case`or`:case`imply`:case`equiv`:return mE(r)&&CE(e,t,n.args[0],r.args[0])&&CE(e,t,n.args[1],r.args[1]);case`true`:case`false`:return!0;default:return hE(r)&&n.args[1].freeVars.includes(n.args[0].symbol)===r.args[1].freeVars.includes(r.args[0].symbol)&&CE([n.args[0],...e],[r.args[0],...t],n.args[1],r.args[1])}},wE=(e,t,n,r)=>{let i=n.freeVars.includes(e.symbol),a=r.freeVars.includes(t.symbol);return!i&&!a&&n===r||i&&a&&CE([e],[t],n,r)},TE=(e,t)=>e.kind===t.kind&&e.symbol===t.symbol&&(e.args[0]===t.args[0]?e.args[1]===t.args[1]:wE(e.args[0],t.args[0],e.args[1],t.args[1])),Z=(e,t,n)=>e.kind===`app`&&e.symbol===t&&(n===void 0||e.args.length===n),EE=e=>e.kind===`meta`,DE=e=>e.kind===`app`&&e.args.length===2,OE=e=>e.kind===`not`&&DE(e.args[0]),kE=(e,t)=>{if(e.hash!==t.hash)return e.hash<t.hash?-1:1;if(e===t)return 0;if(e.kind!==t.kind)return e.kind<t.kind?-1:1;if(e.symbol!==t.symbol)return e.symbol<t.symbol?-1:1;if(e.args.length!==t.args.length)return e.args.length-t.args.length;for(let n=0;n<e.args.length;n++){let r=kE(e.args[n],t.args[n]);if(r!==0)return r}return 0},AE=(e,t)=>e.find(e=>e[0]===t)?.[1],jE=(e,t)=>e.every(e=>t.every(t=>t[0].symbol!==e)),ME=(e,t)=>t.some(t=>t[1].freeVars.includes(e.symbol)),NE=()=>{let t=rE(),n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=pE.id+1,o=0,s=`e`,c=(e,n,r,i,o,s)=>({...e,id:a++,hash:t.hashIntAndStrings(n.high,n.low,r),skeleton:n,freeVars:r,size:i,taus:o,metas:s}),l=e=>{let t=n.get(e.hash),r=t?.find(t=>TE(t,e));return r===void 0?(t===void 0?n.set(e.hash,[e]):t.push(e),o++,e):r},u=e=>{let t=i.get(e);return t===void 0?(i.set(e,i.size),i.size-1):t},d=(e,t,n,i)=>{let a=u(t);for(let e of n)a=Math.imul(a,16777619)^e.id;let s=r.get(a),c=s?.find(r=>r.kind===e&&r.symbol===t&&r.args.length===n.length&&r.args.every((e,t)=>e===n[t]));if(c!==void 0)return c;let l=i();return s===void 0?r.set(a,[l]):s.push(l),o++,l},f=e=>d(`var`,e,[],()=>c({kind:`var`,symbol:e,args:[]},uE,[e],1,0,[])),p=e=>d(`meta`,``,[e],()=>c({kind:`meta`,symbol:``,args:[e]},aE(lE.meta,e.skeleton),[],1,0,[e])),m=(e,n)=>d(`app`,e,n,()=>{let r=oE(t.hashString(e)),i=[],a=1,o=0,s=[];for(let e of n)r=aE(e.skeleton,r),i=gE(i,e.freeVars),a+=e.size,o=Math.max(e.taus,o),s=yE(e.metas,s);return c({kind:`app`,symbol:e,args:n},aE(lE.app,r),i,a,o,s)}),h=e=>d(`not`,``,[e],()=>c({kind:`not`,symbol:``,args:[e]},aE(lE.not,e.skeleton),e.freeVars,e.size+1,e.taus,e.metas)),g=(e,t,n)=>d(e,``,[t,n],()=>c({kind:e,symbol:``,args:[t,n]},aE(lE[e],aE(t.skeleton,n.skeleton)),gE(t.freeVars,n.freeVars),t.size+n.size+1,Math.max(t.taus,n.taus),yE(t.metas,n.metas))),_=(e,n,r,i)=>l(c({kind:e,symbol:r,args:[n,i]},aE(lE[e],aE(oE(t.hashString(r)),i.skeleton)),_E(n.symbol,i.freeVars),e===`tau`||e===`lam`?1:i.size+1,e===`tau`?i.taus+1:i.taus,i.metas)),v=(e,t)=>e.kind===`app`?m(e.symbol,t):e.kind===`not`?h(t[0]):g(e.kind,t[0],t[1]),y=()=>{let e=[...s],t=0;for(;t<e.length&&e[t]===`z`;)e[t++]=`a`;return t===e.length?e.push(`a`):e[t]=String.fromCharCode(e[t].charCodeAt(0)+1),s=e.join(``),f(`zenon_V`+s)},b=(e,t)=>{let n=e.args[0],r=t.filter(e=>e[0]!==n);if(!ME(n,r))return[n,r];let i=y();return[i,[[n,i],...r]]},x=(e,t)=>{if(jE(t.freeVars,e))return t;switch(t.kind){case`var`:return AE(e,t)??t;case`meta`:case`true`:case`false`:return t;case`all`:case`ex`:case`tau`:case`lam`:{let n=b(t,e);return _(t.kind,n[0],t.symbol,x(n[1],t.args[1]))}default:return v(t,t.args.map(t=>x(e,t)))}},ee=(e,t)=>{let n=[];for(let r of t){let t=S(e,r);if(t===void 0)return;n.push(t)}return n},S=(e,t)=>{switch(t.kind){case`var`:return AE(e,t)??t;case`meta`:case`true`:case`false`:return t;case`app`:{let n=ee(e,t.args);if(n===void 0)return;let r=AE(e,f(t.symbol));return r===void 0?m(t.symbol,n):r.kind===`lam`&&n.length===1?x([[r.args[0],n[0]]],r.args[1]):r.kind===`var`?m(r.symbol,n):r.kind===`app`?m(r.symbol,[...r.args,...n]):void 0}case`all`:case`ex`:case`tau`:case`lam`:{let n=b(t,e),r=S(n[1],t.args[1]);return r===void 0?void 0:_(t.kind,n[0],t.symbol,r)}default:{let n=ee(e,t.args);return n===void 0?void 0:v(t,n)}}};return{evar:f,emeta:p,eapp:m,enot:h,eand:(e,t)=>g(`and`,e,t),eor:(e,t)=>g(`or`,e,t),eimply:(e,t)=>g(`imply`,e,t),eequiv:(e,t)=>g(`equiv`,e,t),eall:(e,t,n)=>_(`all`,e,t,n),eex:(e,t,n)=>_(`ex`,e,t,n),etau:(e,t,n)=>_(`tau`,e,t,n),elam:(e,t,n)=>_(`lam`,e,t,n),newVar:y,substitute:x,substituteSecondOrder:S,apply:(t,n)=>{if(t.kind!==`lam`)throw new e(`Zenon: higher-order application`);return x([[t.args[0],n]],t.args[1])},getCreatedCount:()=>o}},PE=(e,t,n,r)=>{let i=[],a,o=``,s=e=>e.kind===`var`?n.find(t=>t.name===e.symbol):void 0,c=e=>{let t=e.kind===`not`?e.args[0]:e;if(t.kind!==`app`)return!1;let n=s(t.args[0]);return t.args.length!==2||a!==void 0&&t.symbol!==a||n===void 0||s(t.args[1])===void 0?!1:(a===void 0&&(o=n.type),a=t.symbol,i.unshift(e),!0)},l=t=>{if(t.kind===`or`)return l(t.args[0])&&l(t.args[1]);if(t.kind===`imply`)return l(e.enot(t.args[0]))&&l(t.args[1]);if(t.kind===`not`){let n=t.args[0];if(n.kind===`and`)return l(e.enot(n.args[0]))&&l(e.enot(n.args[1]));if(n.kind===`not`)return l(n.args[0]);if(n.kind===`true`)return!0}return t.kind===`false`||c(t)};return l(r)?{directions:t,env:n,leaves:i,type:o}:{directions:t,env:n,leaves:[],type:``}},FE=(e,t)=>{let n=[],r=(t,i,a)=>{let o=[...t,`left`],s=[...t,`right`],c=a.kind===`not`?a.args[0]:void 0;if(a.kind===`and`)r(o,i,a.args[0]),r(s,i,a.args[1]);else if(a.kind===`all`){let e={name:a.args[0].symbol,type:a.symbol};r(t,[e,...i],a.args[1])}else if(c?.kind===`or`)r(o,i,e.enot(c.args[0])),r(s,i,e.enot(c.args[1]));else if(c?.kind===`imply`)r(o,i,c.args[0]),r(s,i,e.enot(c.args[1]));else if(c?.kind===`ex`){let n={name:c.args[0].symbol,type:c.symbol};r(t,[n,...i],e.enot(c.args[1]))}else c?.kind===`not`?r(t,i,c.args[0]):a.kind===`equiv`?(r(o,i,e.eimply(a.args[0],a.args[1])),r(s,i,e.eimply(a.args[1],a.args[0]))):c?.kind===`equiv`?(r(o,i,e.eor(c.args[0],c.args[1])),r(s,i,e.eor(e.enot(c.args[0]),e.enot(c.args[1])))):n.unshift(PE(e,t,i,a))};return r([],[],t),n},IE=e=>{let t=(e.kind===`not`?e.args[0]:e).args;return[t[0].symbol,t[1].symbol]},LE=e=>({positive:e.filter(e=>e.kind!==`not`).reverse().map(IE),negative:e.filter(e=>e.kind===`not`).reverse().map(IE)}),RE=e=>{if(e.length!==1||e[0].kind===`not`)return;let t=IE(e[0]);return t[0]===t[1]?[t[0]]:void 0},zE=e=>{let t=LE(e);if(t.positive.length!==1||t.negative.length!==1)return;let n=t.positive[0],r=t.negative[0];return n[0]===r[1]&&n[1]===r[0]?r:void 0},BE=e=>{let t=LE(e);return t.positive.length===1&&t.negative.length===2?{result:t.positive[0],first:t.negative[0],second:t.negative[1]}:void 0},VE=e=>{let t=BE(e);if(t===void 0)return;let n=t.result,r=t.first,i=t.second;if(r[1]===i[0]&&n[0]===r[0]&&n[1]===i[1])return[n[0],r[1],n[1]];if(i[1]===r[0]&&n[0]===i[0]&&n[1]===r[1])return[n[0],r[0],n[1]]},HE=e=>{let t=BE(e);if(t===void 0)return;let n=t.result,r=t.first,i=t.second;if(r[1]===i[0]&&n[1]===r[0]&&n[0]===i[1])return[n[1],r[1],n[0]];if(i[1]===r[0]&&n[1]===i[0]&&n[0]===r[1])return[n[1],r[0],n[0]]},UE=e=>(e[0].kind===`not`?e[0].args[0]:e[0]).symbol,WE=e=>{let t={formula:fE,directions:[],variables:[]},n=/* @__PURE__ */ new Map([[`=`,{reflexive:t,symmetric:t,transitive:t,transitiveSymmetric:t,type:``}]]),r=e=>{let t=n.get(e);if(t!==void 0)return t;let r={reflexive:void 0,symmetric:void 0,transitive:void 0,transitiveSymmetric:void 0,type:``};return n.set(e,r),r},i=t=>{for(let n of FE(e,t)){let e=n.leaves,i=n.env,a=e=>e===void 0?void 0:{formula:t,directions:n.directions,variables:e.map(e=>i.length-1-i.findIndex(t=>t.name===e))},o=a(RE(e)),s=a(zE(e)),c=a(VE(e)),l=a(HE(e));if(!o&&!s&&!c&&!l)continue;let u=r(UE(e));o&&(u.reflexive=o),s&&(u.symmetric=s),c&&(u.transitive=c),l&&(u.transitiveSymmetric=l),u.type=n.type}},a=t=>FE(e,t).every(e=>{let t=e.leaves;if(RE(t))return r(UE(t)).reflexive!==void 0;if(zE(t))return r(UE(t)).symmetric!==void 0;if(VE(t))return r(UE(t)).transitive!==void 0;if(HE(t)){let e=r(UE(t));return e.symmetric!==void 0&&e.transitive!==void 0}return!1}),o=e=>n.get(e);return{analyse:i,isSubsumed:a,isReflexive:e=>o(e)?.reflexive!==void 0,isSymmetric:e=>{let t=o(e);return t!==void 0&&(t.symmetric!==void 0||t.reflexive!==void 0&&t.transitiveSymmetric!==void 0)},isTransitive:e=>{let t=o(e);return t!==void 0&&(t.transitive!==void 0||t.reflexive!==void 0&&t.transitiveSymmetric!==void 0)},isAny:e=>{let t=o(e);return t!==void 0&&(t.reflexive!==void 0||t.symmetric!==void 0||t.transitive!==void 0)},get:o}},GE=(e,t,n)=>{let r=e.get(t);r===void 0?e.set(t,[n]):r.push(n)},KE=(e,t)=>{let n=e.get(t);n!==void 0&&(n.pop(),n.length===0&&e.delete(t))},qE=(e,t)=>[...e.get(t)??[]].reverse(),JE=e=>{switch(e.kind){case`app`:case`var`:return e.symbol;case`meta`:case`tau`:return e;case`true`:return`$true`;case`false`:return`$false`;case`all`:return`A.`;case`ex`:return`E.`;default:return}},YE=e=>typeof e==`string`?e:e.kind===`tau`?`t.`:``,XE=(e,t,n)=>{let r=e.get(t);r===void 0?e.set(t,[n]):r.push(n)},ZE=(e,t,n)=>{let r=e.get(t);return r!==void 0&&(r.length===1?e.delete(t):r[r.length-1]===n&&r.pop(),!0)},QE=(e,t)=>qE(e,t),$E=e=>typeof e==`string`?`s${e}`:`e${e.id}`,eD=(e,t)=>`${e}\u0000${$E(t)}`,tD=e=>{let t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=/* @__PURE__ */ new Map,o=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map,c=/* @__PURE__ */ new Map,l=/* @__PURE__ */ new Map,u=/* @__PURE__ */ new Map,d=/* @__PURE__ */ new Map,f=/* @__PURE__ */ new Map,p=/* @__PURE__ */ new Map,m=[],h=[],g=/* @__PURE__ */ new Map,_=/* @__PURE__ */ new Map,v=[],y=[],b=0,x=0,ee=e=>t.has(e),S=e=>{let n=t.get(e);return n===void 0?0:n[n.length-1]},te=e=>e.map(e=>[e,S(e)]),C=(e,t)=>{if(e.kind===`not`){let n=JE(e.args[0]);n!==void 0&&t(r,YE(n),e);return}let i=JE(e);i!==void 0&&t(n,YE(i),e)},w=e=>e.kind===`app`&&e.symbol===`$string`&&e.args.length===1&&e.args[0].kind===`var`?e.args[0].symbol:void 0,T=e=>{if(e.kind!==`app`||e.symbol!==`=`||e.args.length!==2)return;let t=w(e.args[1]);if(t!==void 0)return{isReversed:!1,term:e.args[0],value:t};let n=w(e.args[0]);return n===void 0?void 0:{isReversed:!0,term:e.args[1],value:n}},ne=e=>e.kind===`app`&&e.symbol===`=`&&e.args.length===2,re=(e,n)=>{GE(t,e,n),ne(e)?(GE(u,e.args[0],e.args[1]),GE(d,e.args[1],e.args[0])):e.kind===`not`&&ne(e.args[0])&&(GE(f,e.args[0].args[0],e.args[0].args[1]),GE(p,e.args[0].args[1],e.args[0].args[0]));let r=T(e);r!==void 0&&(r.isReversed?h:m).unshift([r.term,r.value]),b++,x=Math.max(x,b),C(e,XE);let i=_.get(e);i!==void 0&&(i.isPresent=!0),v.unshift(e)},ie=e=>{if(!DE(e))return;let t=JE(e.args[0]);t!==void 0&&ZE(i,eD(e.symbol,t),e);let n=JE(e.args[1]);n!==void 0&&ZE(a,eD(e.symbol,n),e)},ae=e=>{if(!OE(e))return;let t=e.args[0],n=JE(t.args[0]);n!==void 0&&ZE(o,eD(t.symbol,n),e)&&ZE(c,$E(n),e);let r=JE(t.args[1]);r!==void 0&&ZE(s,eD(t.symbol,r),e)&&ZE(l,$E(r),e)};return{add:re,remove:e=>{b--,ie(e),ae(e),C(e,ZE);let n=T(e);n!==void 0&&(n.isReversed?h:m).shift(),ne(e)?(KE(u,e.args[0]),KE(d,e.args[1])):e.kind===`not`&&ne(e.args[0])&&(KE(f,e.args[0].args[0]),KE(p,e.args[0].args[1])),KE(t,e);let r=_.get(e);r!==void 0&&(r.isPresent=!1)},isMember:ee,getGoalness:S,findPositive:e=>te(QE(n,e)),findNegative:e=>te(QE(r,e)),findEqualRight:e=>qE(u,e),findEqualLeft:e=>qE(d,e),findDisequalities:t=>[...qE(f,t).map(n=>e.enot(e.eapp(`=`,[t,n]))),...qE(p,t).map(n=>e.enot(e.eapp(`=`,[n,t])))],getStringEqualities:()=>m,getReversedStringEqualities:()=>h,addTrans:e=>{let t=JE(e.args[0]);if(t===void 0)return!1;XE(i,eD(e.symbol,t),e);let n=JE(e.args[1]);return n!==void 0&&(XE(a,eD(e.symbol,n),e),!0)},addNegTrans:e=>{let t=e.args[0],n=JE(t.args[0]);n!==void 0&&(XE(o,eD(t.symbol,n),e),XE(c,$E(n),e));let r=JE(t.args[1]);r!==void 0&&(XE(s,eD(t.symbol,r),e),XE(l,$E(r),e))},findTransLeft:(e,t)=>te(QE(i,eD(e,t))),findTransRight:(e,t)=>te(QE(a,eD(e,t))),findNegTransLeft:(e,t)=>te(QE(o,eD(e,t))),findNegTransRight:(e,t)=>te(QE(s,eD(e,t))),findAllNegTransLeft:e=>te(QE(c,$E(e))),findAllNegTransRight:e=>te(QE(l,$E(e))),addLemma:e=>{let n=e.conclusions.map(e=>{let n=_.get(e);if(n!==void 0)return n;let r={isPresent:t.has(e),proofs:[]};return _.set(e,r),r});y.unshift([{proof:e,cursor:0,records:n}])},searchLemma:()=>{for(let e of v){let t=_.get(e);t!==void 0&&t.isPresent&&(y.unshift(t.proofs),t.proofs=[])}for(v=[];y.length>0;){let e=y[0];if(e.length===0){y=y.slice(1);continue}let t=e[0],n=t.records.length,r=[...Array.from({length:n-t.cursor},(e,n)=>t.cursor+n),...Array.from({length:t.cursor},(e,t)=>t)].find(e=>!t.records[e].isPresent);if(r===void 0)return t.proof;y=[e.slice(1),...y.slice(1)],t.records[r].proofs=[t,...t.records[r].proofs],t.cursor=r+1}},addDefinition:e=>g.set(e.symbol,e),getDefinition:e=>g.get(e),getTopFormulaCount:()=>x}},nD=e=>e!==void 0&&e>=`0`&&e<=`9`,rD=e=>e.match(/[0-9]+|[^0-9]+/g)?.map(e=>({isNumber:nD(e[0]),text:e}))??[],iD=e=>{let t=Math.floor(e.length/2),n=e.length%2;for(let r=0;r<t;r++){let i=e.slice(0,t-r);if(i===e.slice(t+r+n,t+r+n+t-r))return{pieces:[i],separator:e.slice(t-r,t+r+n)}}return{pieces:[],separator:e}},aD=(t,n)=>{if(t.length!==n.length)throw new e(`Zenon: an uneven template`);let r=t.map((e,t)=>{let r=n[t];if(!e.isNumber&&!r.isNumber&&e.text===r.text)return e.text;if(e.isNumber&&r.isNumber)return{base:Number(e.text),step:Number(r.text)-Number(e.text)}});return r.every(e=>e!==void 0)?r:void 0},oD=(e,t,n)=>{if(!e.isNumber&&!t.startsWith(e.text)||!n.isNumber&&!t.endsWith(n.text))return;let r=e.isNumber?0:e.text.length,i=n.isNumber?0:n.text.length;if(!(r+i>t.length))return[e.isNumber?[]:[e],t.slice(r,t.length-i),n.isNumber?[]:[n]]},sD=(t,n,r,i)=>{if(!t.isNumber&&!n.isNumber&&r.isNumber&&i.isNumber&&n.text.startsWith(t.text))return[[t],n.text.slice(t.text.length),[r]];if(t.isNumber&&n.isNumber&&!r.isNumber&&!i.isNumber&&r.text.endsWith(i.text))return[[n],r.text.slice(0,r.text.length-i.text.length),[i]];throw new e(`Zenon: a template whose instances don't meet`)},cD=e=>{let t=rD(e),n=t.length;if(n===0)return{pieces:[],separator:``};if(n===1){let e=t[0];if(!e.isNumber)return iD(e.text);if(e.text.length%2==1)return;let n=e.text.length/2,r=Number(e.text.slice(0,n));return{pieces:[{base:r,step:Number(e.text.slice(n))-r}],separator:``}}let r=Math.floor(n/2);if(n%4==0){let e=t.slice(0,r-1),n=t.slice(r+1),i=sD(n[n.length-1],t[r-1],t[r],e[0]),a=aD([...e,...i[0]],[...i[2],...n]);return a===void 0?void 0:{pieces:a,separator:i[1]}}if(n%2==0)return;let i=t[r];if(i.isNumber)return;let a=t.slice(0,r),o=t.slice(r+1),s=oD(o[o.length-1],i.text,a[0]);if(s===void 0)return;let c=aD([...a,...s[0]],[...s[2],...o]);return c===void 0?void 0:{pieces:c,separator:s[1]}},lD=(e,t)=>e.map(e=>typeof e==`string`?e:String(t(e))).join(``),uD=(e,t,n)=>{let r=cD(t);if(r!==void 0)return Array.from({length:e},(t,r)=>n?e-1-r:r).map(e=>lD(r.pieces,t=>n?t.base+t.step-e*t.step:t.base+e*t.step)).join(r.separator)},dD=(e,t)=>{let n=/^\[n(?:\]|([+-])([0-9]*)\])/.exec(e.slice(t));if(n===null)return[0,t];let r=n[1]===`-`?-1:1;return[n[1]===void 0?0:r*Number(n[2]),t+n[0].length]},fD=t=>{if(t.length>=2&&t.startsWith(`
13
+ `)&&t.endsWith(`
14
+ `))return t.slice(1,-1);if(t.length>=4&&t.startsWith(`\r
15
+ `)&&t.endsWith(`\r
16
+ `))return t.slice(2,-2);throw new e(`Zenon: a bad template`)},pD=(t,n)=>{let r=[],i=0;for(;;){let a=n.indexOf(`@@@`,i),o=n.indexOf(`...`,i);if(a===-1&&o===-1)break;let s=a===-1||o!==-1&&o<a,c=s?o:a,l=n.indexOf(s?`@@@`:`...`,c+3);if(l===-1)throw new e(`Zenon: a bad template`);r.push(n.slice(i,c));let u=n.slice(c+3,l),d=dD(n,l+3),f=uD(t+d[0],u,s)??uD(t+d[0],fD(u),s);if(f===void 0)throw new e(`Zenon: a bad template`);r.push(f),i=d[1]}return r.push(n.slice(i)),r.join(``)},mD=(e,t)=>`have zenon_case${t?`other`:``}${e} :${pD(e,t?_D:gD)}`,hD=e=>`have zenon_inrecordsetI${e} :${pD(e,vD(e))}`,gD=String.raw`
17
+ "!! P @@@c1x e1x c2x e2x... .
18
+ P (CASE @@@c1x -> e1x [] c2x -> e2x...) ==>
19
+ @@@
20
+ (c1x ==> P (e1x) ==> FALSE) ==>
21
+ (c2x ==> P (e2x) ==> FALSE) ==>
22
+ ...
23
+ (...~c2x & ~c1x@@@ & TRUE ==> FALSE) ==>
24
+ FALSE"
25
+ proof -
26
+ fix P @@@c1x e1x c2x e2x...
27
+ assume h: "P (CASE @@@c1x -> e1x [] c2x -> e2x...)"
28
+ (is "P (?cas)")
29
+ @@@
30
+ assume h1: "c1x ==> P (e1x) ==> FALSE"
31
+ assume h2: "c2x ==> P (e2x) ==> FALSE"
32
+ ...
33
+ assume hoth: "...~c2x & ~c1x@@@ & TRUE ==> FALSE"
34
+ def cs == "<<@@@c1x, c2x...>>" (is "?cs")
35
+ def es == "<<@@@e1x, e2x...>>" (is "?es")
36
+ def arms == "UNION {CaseArm (?cs[i], ?es[i]) : i \\in DOMAIN ?cs}"
37
+ (is "?arms")
38
+ def cas == "?cas"
39
+ have h0: "P (cas)" using h by (fold cas_def)
40
+ def dcs == "...c2x | c1x@@@" (is "?dcs")
41
+ show FALSE
42
+ proof (rule zenon_em [of "?dcs"])
43
+ assume ha: "~(?dcs)"
44
+ @@@
45
+ have hh1: "~c1x" using ha by blast
46
+ have hh2: "~c2x" using ha by blast
47
+ ...
48
+ show FALSE
49
+ using hoth @@@hh1 hh2... by blast
50
+ next
51
+ assume ha: "?dcs"
52
+ def scs == "zenon_seqify (@@@zenon_appseq (zenon_appseq (...
53
+ <<>>, @@@c1x), c2x)...)"
54
+ (is "?scs")
55
+ def ses == "zenon_seqify (@@@zenon_appseq (zenon_appseq (...
56
+ <<>>, @@@e1x), e2x)...)"
57
+ (is "?ses")
58
+ have ha1: "\<exists> i \<in> DOMAIN ?scs : ?scs[i]"
59
+ using ha zenon_case_seq_empty
60
+ by (simp only: zenon_case_seq_simpl zenon_seqify_empty, blast)
61
+ have ha2: "\<exists> i \<in> DOMAIN ?cs : ?cs[i]"
62
+ using ha1 by (simp only: zenon_seqify_appseq zenon_seqify_empty)
63
+ have hb: "\\E x : x \\in arms"
64
+ using zenon_case_domain [OF ha2, where es = "?es"]
65
+ by (unfold arms_def, blast)
66
+ have hc: "(CHOOSE x : x \\in arms) \\in arms"
67
+ using hb by (unfold Ex_def, auto)
68
+ have hf0: "?cas \\in arms"
69
+ using hc by (unfold arms_def, fold Case_def)
70
+ have hf3: "cas \\in UNION {CaseArm (?scs[i], ?ses[i])
71
+ : i \\in DOMAIN ?scs}"
72
+ (is "?hf3")
73
+ using hf0 by (fold cas_def, unfold arms_def,
74
+ simp only: zenon_seqify_appseq zenon_seqify_empty)
75
+ have hf4: "Len (?scs) = Len (?ses)" (is "?hf4")
76
+ by (simp only: zenon_case_len_simpl)
77
+ have hf5: "?hf4 & ?hf3"
78
+ by (rule conjI [OF hf4 hf3])
79
+ have hf: "
80
+ ...cas \\in CaseArm (c2x, e2x)
81
+ | cas \\in CaseArm (c1x, e1x)@@@
82
+ | cas \\in UNION {CaseArm (zenon_seqify (<<>>)[i],
83
+ zenon_seqify (<<>>)[i])
84
+ : i \\in DOMAIN zenon_seqify (<<>>)}
85
+ " (is "_ | ?gxx")
86
+ using hf5 by (simp only: zenon_case_union_simpl, blast)
87
+ @@@
88
+ have hg1x: "cas \\in CaseArm (c1x, e1x) => FALSE"
89
+ using h0 h1 by auto
90
+ have hg2x: "cas \\in CaseArm (c2x, e2x) => FALSE"
91
+ using h0 h2 by auto
92
+ ...
93
+ from hf
94
+ have hh0: "?gxx" ...(is "_ | ?g1")
95
+ by (rule zenon_disjE1 [OF _ hg3x])
96
+ then have hh1: "?g1" (is "_ | ?g0")
97
+ by (rule zenon_disjE1 [OF _ hg2x])
98
+ then have hh0: "?g0"@@@[n-1]
99
+ by (rule zenon_disjE1 [OF _ hg1x])
100
+ have hi: "cas \\in UNION {CaseArm (<<>>[i], <<>>[i])
101
+ : i \\in DOMAIN <<>>}"
102
+ using hh0 by (simp only: zenon_seqify_empty)
103
+ show FALSE
104
+ by (rule zenon_case_empty_union [OF hi])
105
+ qed
106
+ qed
107
+ `,_D=String.raw`
108
+ "!! P oth @@@c1x e1x c2x e2x... .
109
+ P (CASE @@@c1x -> e1x [] c2x -> e2x... [] OTHER -> oth) ==>
110
+ @@@
111
+ (c1x ==> P (e1x) ==> FALSE) ==>
112
+ (c2x ==> P (e2x) ==> FALSE) ==>
113
+ ...
114
+ (...~c2x & ~c1x@@@ & TRUE ==> P (oth) ==> FALSE) ==>
115
+ FALSE"
116
+ proof -
117
+ fix P oth @@@c1x e1x c2x e2x...
118
+ assume h: "P (CASE @@@c1x -> e1x [] c2x -> e2x... [] OTHER -> oth)"
119
+ (is "P (?cas)")
120
+ @@@
121
+ assume h1: "c1x ==> P (e1x) ==> FALSE"
122
+ assume h2: "c2x ==> P (e2x) ==> FALSE"
123
+ ...
124
+ assume hoth: "...~c2x & ~c1x@@@ & TRUE ==> P (oth) ==> FALSE"
125
+ def cs == "<<@@@c1x, c2x...>>" (is "?cs")
126
+ def es == "<<@@@e1x, e2x...>>" (is "?es")
127
+ def arms == "UNION {CaseArm (?cs[i], ?es[i]) : i \\in DOMAIN ?cs}"
128
+ (is "?arms")
129
+ def cas == "?cas"
130
+ have h0: "P (cas)" using h by (fold cas_def)
131
+ def dcs == "...c2x | c1x@@@ | FALSE" (is "?dcs")
132
+ def scs == "zenon_seqify (@@@zenon_appseq (zenon_appseq (...
133
+ <<>>, @@@c1x), c2x)...)"
134
+ (is "?scs")
135
+ have hscs : "?cs = ?scs"
136
+ by (simp only: zenon_seqify_appseq zenon_seqify_empty)
137
+ def ses == "zenon_seqify (@@@zenon_appseq (zenon_appseq (...
138
+ <<>>, @@@e1x), e2x)...)"
139
+ (is "?ses")
140
+ have hses : "?es = ?ses"
141
+ by (simp only: zenon_seqify_appseq zenon_seqify_empty)
142
+ have hlen: "Len (?scs) = Len (?ses)" (is "?hlen")
143
+ by (simp only: zenon_case_len_simpl)
144
+ def armoth == "CaseArm (\<forall> i \<in> DOMAIN ?cs : ~?cs[i], oth)"
145
+ (is "?armoth")
146
+ show FALSE
147
+ proof (rule zenon_em [of "?dcs"])
148
+ assume ha: "~(?dcs)"
149
+ have hb: "P (CHOOSE x : x \\in arms \<union> armoth)"
150
+ using h by (unfold CaseOther_def, fold arms_def armoth_def)
151
+ have hc: "arms \\cup armoth
152
+ = UNION {CaseArm (?scs[i], ?ses[i]) : i \\in DOMAIN ?scs}
153
+ \\cup CaseArm (\<forall> i \<in> DOMAIN ?scs : ~?scs[i],
154
+ oth)"
155
+ (is "_ = ?sarmsoth")
156
+ using hscs hses by (unfold arms_def armoth_def, auto)
157
+ have hd: "~(?dcs) & ?hlen & arms \<union> armoth = ?sarmsoth"
158
+ using ha hlen hc by blast
159
+ have he: "arms \<union> armoth = {oth}"
160
+ using hd by (simp only: zenon_case_oth_simpl zenon_case_oth_empty)
161
+ have hf: "(CHOOSE x : x \\in arms \\cup armoth) = oth"
162
+ using he by auto
163
+ have hg: "P (oth)"
164
+ using hb hf by auto
165
+ @@@
166
+ have hh1: "~c1x" using ha by blast
167
+ have hh2: "~c2x" using ha by blast
168
+ ...
169
+ show FALSE
170
+ using hg hoth @@@hh1 hh2... by blast
171
+ next
172
+ assume ha: "?dcs"
173
+ have ha1: "\<exists> i \<in> DOMAIN ?scs : ?scs[i]"
174
+ using ha zenon_case_seq_empty
175
+ by (simp only: zenon_case_seq_simpl zenon_seqify_empty, blast)
176
+ have ha2: "\<exists> i \<in> DOMAIN ?cs : ?cs[i]"
177
+ using ha1 hscs by auto
178
+ have ha3: "~ (\<forall> i \<in> DOMAIN ?cs : ~?cs[i])"
179
+ using ha2 by blast
180
+ have ha4: "armoth = {}"
181
+ using ha3 condElse [OF ha3, where t = "{oth}" and e = "{}"]
182
+ by (unfold armoth_def CaseArm_def, blast)
183
+ have hb: "\\E x : x \\in arms \\cup armoth"
184
+ using zenon_case_domain [OF ha2, where es = "?es"]
185
+ by (unfold arms_def, blast)
186
+ have hc: "(CHOOSE x : x \\in arms \\cup armoth)
187
+ \\in arms \\cup armoth"
188
+ using hb by (unfold Ex_def, auto)
189
+ have hf0: "?cas \\in arms \\cup armoth"
190
+ using hc by (unfold arms_def armoth_def, fold CaseOther_def)
191
+ have hf1: "cas \\in arms \\cup armoth"
192
+ using hf0 by (fold cas_def)
193
+ have hf2: "cas \\in arms"
194
+ using hf1 ha4 by auto
195
+ have hf3: "cas \\in UNION {CaseArm (?scs[i], ?ses[i])
196
+ : i \\in DOMAIN ?scs}"
197
+ (is "?hf3")
198
+ using hf2 by (unfold arms_def,
199
+ simp only: zenon_seqify_appseq zenon_seqify_empty)
200
+ have hf5: "?hlen & ?hf3"
201
+ by (rule conjI [OF hlen hf3])
202
+ have hf: "
203
+ ...cas \\in CaseArm (c2x, e2x)
204
+ | cas \\in CaseArm (c1x, e1x)@@@
205
+ | cas \\in UNION {CaseArm (zenon_seqify (<<>>)[i],
206
+ zenon_seqify (<<>>)[i])
207
+ : i \\in DOMAIN zenon_seqify (<<>>)}
208
+ " (is "_ | ?gxx")
209
+ using hf5 by (simp only: zenon_case_union_simpl, blast)
210
+ @@@
211
+ have hg1x: "cas \\in CaseArm (c1x, e1x) => FALSE"
212
+ using h0 h1 by auto
213
+ have hg2x: "cas \\in CaseArm (c2x, e2x) => FALSE"
214
+ using h0 h2 by auto
215
+ ...
216
+ from hf
217
+ have hh0: "?gxx" ...(is "_ | ?g1")
218
+ by (rule zenon_disjE1 [OF _ hg3x])
219
+ then have hh1: "?g1" (is "_ | ?g0")
220
+ by (rule zenon_disjE1 [OF _ hg2x])
221
+ then have hh0: "?g0"@@@[n-1]
222
+ by (rule zenon_disjE1 [OF _ hg1x])
223
+ have hi: "cas \\in UNION {CaseArm (<<>>[i], <<>>[i])
224
+ : i \\in DOMAIN <<>>}"
225
+ using hh0 by (simp only: zenon_seqify_empty)
226
+ show FALSE
227
+ by (rule zenon_case_empty_union [OF hi])
228
+ qed
229
+ qed
230
+ `,vD=e=>String.raw`
231
+ "!! r @@@l1x s1x l2x s2x... .
232
+ isAFcn (r) ==>
233
+ DOMAIN r = {@@@l1x, l2x...} ==>
234
+ @@@
235
+ r[l1x] \\in s1x ==>
236
+ r[l2x] \\in s2x ==>
237
+ ...
238
+ r \\in [@@@l1x : s1x, l2x : s2x...]"
239
+ proof -
240
+ fix r @@@l1x s1x l2x s2x...
241
+ assume hfcn: "isAFcn (r)"
242
+ assume hdom: "DOMAIN r = {@@@l1x, l2x...}"
243
+ @@@
244
+ assume h1: "r[l1x] \\in s1x"
245
+ assume h2: "r[l2x] \\in s2x"
246
+ ...
247
+ let ?doms = "<<@@@l1x, l2x...>>"
248
+ let ?domset = "{@@@l1x, l2x...}"
249
+ let ?domsetrev = "{...l2x, l1x@@@}"
250
+ let ?rngs = "<<@@@s1x, s2x...>>"
251
+ let ?n0n = "0"
252
+ @@@
253
+ let ?n1n = "Succ[?n0n]"
254
+ let ?n2n = "Succ[?n1n]"
255
+ ...
256
+ let ?indices = "{...?n2n, ?n1n@@@}"
257
+ have hdomx : "?domsetrev = DOMAIN r"
258
+ by (rule zenon_set_rev_1, (rule zenon_set_rev_2)+, rule zenon_set_rev_3,
259
+ rule hdom)
260
+ show "r \\in EnumFuncSet (?doms, ?rngs)"
261
+ proof (rule EnumFuncSetI [of r, OF hfcn])
262
+ have hx1: "isASeq (?doms) & ?domsetrev = Range (?doms)"
263
+ by ((rule zenon_range_2)+, rule zenon_range_1)
264
+ have hx2: "?domsetrev = Range (?doms)"
265
+ by (rule conjD2 [OF hx1])
266
+ show "DOMAIN r = Range (?doms)"
267
+ by (rule subst [where P = "%x. x = Range (?doms)", OF hdomx hx2])
268
+ next
269
+ show "DOMAIN ?rngs = DOMAIN ?doms"
270
+ by (rule zenon_tuple_dom_3, (rule zenon_tuple_dom_2)+,
271
+ rule zenon_tuple_dom_1)
272
+ next
273
+ have hdomseq: "isASeq (?doms)" by auto
274
+ have hindx: "isASeq (?doms) & ?n${e}n = Len (?doms)
275
+ & ?indices = DOMAIN ?doms"
276
+ by (simp only: DomainSeqLen [OF hdomseq], (rule zenon_dom_app_2)+,
277
+ rule zenon_dom_app_1)
278
+ have hind: "?indices = DOMAIN ?doms" by (rule conjE [OF hindx], elim conjE)
279
+ show "ALL i in DOMAIN ?doms : r[?doms[i]] \\in ?rngs[i]"
280
+ proof (rule subst [OF hind], (rule zenon_all_rec_2)+, rule zenon_all_rec_1)
281
+ @@@
282
+ have hn: "l1x = ?doms[?n1n]"
283
+ by (((rule zenon_tuple_acc_2, safe, simp only: zenon_ss_1 zenon_ss_2,
284
+ rule zenon_zero_lt,
285
+ simp only: zenon_ss_1 zenon_ss_2 zenon_sa_1 zenon_sa_2,
286
+ ((rule zenon_ss_le_sa_2)+)?, rule zenon_ss_le_sa_1
287
+ )+)?,
288
+ rule zenon_tuple_acc_1, auto)
289
+ have hs: "s1x = ?rngs[?n1n]"
290
+ by (((rule zenon_tuple_acc_2, safe, simp only: zenon_ss_1 zenon_ss_2,
291
+ rule zenon_zero_lt,
292
+ simp only: zenon_ss_1 zenon_ss_2 zenon_sa_1 zenon_sa_2,
293
+ ((rule zenon_ss_le_sa_2)+)?, rule zenon_ss_le_sa_1
294
+ )+)?,
295
+ rule zenon_tuple_acc_1, auto)
296
+ show "r[?doms[?n1n]] \\in ?rngs[?n1n]"
297
+ by (rule subst[OF hs], rule subst[OF hn], rule h1)
298
+ next
299
+ have hn: "l2x = ?doms[?n2n]"
300
+ by (((rule zenon_tuple_acc_2, safe, simp only: zenon_ss_1 zenon_ss_2,
301
+ rule zenon_zero_lt,
302
+ simp only: zenon_ss_1 zenon_ss_2 zenon_sa_1 zenon_sa_2,
303
+ ((rule zenon_ss_le_sa_2)+)?, rule zenon_ss_le_sa_1
304
+ )+)?,
305
+ rule zenon_tuple_acc_1, auto)
306
+ have hs: "s2x = ?rngs[?n2n]"
307
+ by (((rule zenon_tuple_acc_2, safe, simp only: zenon_ss_1 zenon_ss_2,
308
+ rule zenon_zero_lt,
309
+ simp only: zenon_ss_1 zenon_ss_2 zenon_sa_1 zenon_sa_2,
310
+ ((rule zenon_ss_le_sa_2)+)?, rule zenon_ss_le_sa_1
311
+ )+)?,
312
+ rule zenon_tuple_acc_1, auto)
313
+ show "r[?doms[?n2n]] \\in ?rngs[?n2n]"
314
+ by (rule subst[OF hs], rule subst[OF hn], rule h2)
315
+ ...
316
+ qed
317
+ qed
318
+ qed
319
+ `,yD=(e,t,n,r)=>t===`and`?e.eand(n,r):t===`or`?e.eor(n,r):t===`imply`?e.eimply(n,r):e.eequiv(n,r),bD=(t,n)=>{let r=t.get(n);if(r===void 0)throw new e(`Zenon: no lemma ${n}`);return r},xD=(e,t)=>({conclusions:e,rule:t,subproofs:[]}),SD=(e,t)=>{for(let[n,r]of t.entries()){let i=t.slice(n+1);if(r.kind===`false`)return xD([r],{kind:`false`});if(r.kind===`not`){let e=r.args[0];if(e.kind===`true`)return xD([r],{kind:`nottrue`});if(e.kind===`app`&&e.symbol===`=`&&e.args.length===2&&e.args[0]===e.args[1])return xD([r],{kind:`noteq`,term:e.args[0]});if(i.includes(e))return xD([r,e],{kind:`axiom`,formula:e});continue}let a=e.enot(r);if(i.includes(a))return xD([r,a],{kind:`axiom`,formula:r})}},CD=(e,t,n)=>{let r=(t,n)=>e.eapp(`=`,[t,n]);switch(n.kind){case`false`:return[pE];case`nottrue`:return[e.enot(fE)];case`axiom`:return[n.formula,e.enot(n.formula)];case`cut`:return[];case`noteq`:return[e.enot(r(n.term,n.term))];case`eqsym`:return[r(n.left,n.right),e.enot(r(n.right,n.left))];case`notnot`:return[e.enot(e.enot(n.formula))];case`connect`:return[yD(e,n.connective,n.left,n.right)];case`notconnect`:return[e.enot(yD(e,n.connective,n.left,n.right))];case`ex`:case`all`:return[n.quantified];case`notex`:case`notall`:return[e.enot(n.quantified)];case`pnotp`:return[n.positive,n.negative];case`notequal`:return[e.enot(r(n.left,n.right))];case`congruencelr`:return[e.apply(n.context,n.left),r(n.left,n.right)];case`congruencerl`:return[e.apply(n.context,n.left),r(n.right,n.left)];case`definition`:return[n.folded];case`extension`:return n.conclusions;case`lemma`:return bD(t,n.name).proof.conclusions}},wD=(e,t)=>{let n=/* @__PURE__ */ new Map,r=t=>{let i=t.subproofs.map(r),a=SD(e,t.conclusions);if(a!==void 0)return a;let o=/* @__PURE__ */ new Set([...CD(e,n,t.rule),...i.flatMap(e=>e.conclusions)]),s=t.conclusions.filter(e=>o.has(e)),c=i.find(e=>e.conclusions.every(e=>s.includes(e)));return c===void 0?{conclusions:s,rule:t.rule.kind===`lemma`?{kind:`lemma`,name:t.rule.name,args:bD(n,t.rule.name).params.map(e=>e[1])}:t.rule,subproofs:i}:c};return t.map(e=>{let t={...e,proof:r(e.proof)};return n.set(t.name,t),t})},TD=t=>new e(`Zenon: the rule ${t} has too few arguments`),ED=(e,t)=>{let[n,r,i,...a]=t;if(i===void 0)throw TD(e);return[`zenon_${e}`,a,[n],[[r,i]]]},DD=(e,t)=>{let[n,r,i,...a]=t;if(i===void 0)throw TD(e);return[`zenon_${e}`,a,[n],[[r],[i]]]},OD=(e,t)=>{let[n,r,i,a,o,...s]=t;if(o===void 0)throw TD(e);return[`zenon_${e}`,s,[n],[[r,i],[a,o]]]},kD=(e,t)=>{let[n,r,i,...a]=t;if(i===void 0)throw TD(e);return[`zenon_${e}`,a,[],[[n],[r,i]]]},AD=(e,t)=>{let[n,r,...i]=t;if(r===void 0)throw TD(e);return[`zenon_${e}`,i,[n],[[r]]]},jD=(e,t)=>{let[n,...r]=t;if(n===void 0)throw TD(e);return[`zenon_${e}`,r,[n],[]]},MD=(e,t)=>{let[n,r,i,...a]=t;if(i===void 0)throw TD(e);return[`zenon_${e}`,a,[n,r],[[i]]]},ND=(e,t)=>{let[n,r,i,a,...o]=t;if(a===void 0)throw TD(e);return[`zenon_${e}`,o,[n,r],[[i],[a]]]},PD=e=>(t,n)=>{let[r,i,a,...o]=n;if(a===void 0)throw TD(t);return[`zenon_${t}`,[i,a],[r],e?o.map(e=>[e]):[o]]},FD=e=>(t,n)=>{let[r,...i]=n;if(r===void 0)throw TD(t);return[`zenon_${t}`,[],[r],e?i.map(e=>[e]):[i]]},ID=e=>e.length<=1?e.length===0?[]:[e]:[e.slice(0,2),...ID(e.slice(2))],LD={in_emptyset:(e,t)=>[`zenon_${e}`,t.slice(1),t.slice(0,1),[]],in_nat_0:jD,in_nat_1:jD,in_nat_2:jD,in_upair:DD,notin_upair:ED,in_cup:DD,notin_cup:ED,in_cap:ED,notin_cap:DD,in_setminus:ED,notin_setminus:DD,in_subsetof:ED,notin_subsetof:DD,in_funcset:(e,t)=>{let[n,r,i,a,...o]=t;if(a===void 0)throw TD(e);return[`zenon_${e}`,o,[n],[[r,i,a]]]},except_notin_funcset:(e,t)=>{let[n,r,i,...a]=t;if(i===void 0)throw TD(e);return[`zenon_${e}`,a,[n],[[r],[i]]]},notin_funcset:(e,t)=>{let[n,r,i,a,...o]=t;if(a===void 0)throw TD(e);return[`zenon_${e}`,o,[n],[[r],[i],[a]]]},trueistrue:MD,fapplyfcn:DD,fapplyexcept:(e,t)=>{let[n,r,i,a,o,s,c,l,...u]=t;if(l===void 0)throw TD(e);return[`zenon_${e}`,u,[n],[[r,i,a],[o,s,c],[l]]]},boolcase_not:OD,boolcase_and:OD,boolcase_or:OD,boolcase_imply:OD,boolcase_equiv:OD,boolcase_equal:OD,boolcase_all:OD,boolcase_ex:OD,notisafcn_fcn:jD,notisafcn_except:jD,notisafcn_onearg:jD,notisafcn_extend:jD,ifthenelse:OD,notequalchoose:kD,case:(e,t)=>{let[n,r,...i]=t;if(r===void 0)throw TD(e);return[`zenon_${e}`,[r],[n],ID(i)]},p_eq_l:ND,p_eq_r:ND,np_eq_l:ND,np_eq_r:ND,all_in:MD,notex_in:MD,cup_subseteq:ED,not_cup_subseteq:DD,subseteq_cap:ED,not_subseteq_cap:DD,tuple_eq_match:FD(!1),tuple_eq_mismatch:jD,in_product:PD(!1),notin_product:PD(!0),tuple_notisaseq:jD,record_eq_match:FD(!1),record_neq_match:FD(!0),record_eq_mismatch:jD,neq_record:PD(!0),record_neq:PD(!0),in_recordset:PD(!1),notin_recordset:PD(!0),record_notisafcn:jD},RD=(t,n,r,i)=>{let a=t,o=r.rule,s=(e,t)=>n.eapp(`TLA.in`,[e,t]),c=(e,t)=>n.eapp(`=`,[e,t]),l=(e,t,n,r,i,o)=>({conclusions:e.map(a),rule:{kind:`extension`,name:t,args:n.map(a),conclusions:r.map(a),branches:i.map(e=>e.map(a))},subproofs:o}),u=(t,r,i,a,o)=>{if(o?r.kind===`app`&&r.symbol===`TLA.set`&&r.args.length===0:r.kind===`var`&&r.symbol===`TLA.emptyset`)return[l(a,`zenon_in_emptyset`,[t],[s(t,r)],[],[]),[]];let d=r.kind===`app`&&r.symbol===(o?`TLA.set`:`TLA.addElt`)&&r.args.length>=(o?1:2)?[r.args[0],o?n.eapp(`TLA.set`,r.args.slice(1)):r.args[1]]:void 0,f=i[0];if(d===void 0||f===void 0){if(!o&&i.length===1)return i[0];throw new e(`Zenon: a membership proof that doesn't match its set`)}let p=d[0],m=d[1],h=s(t,r),g=c(t,p),_=s(t,m),v=u(t,m,i.slice(1),[_,...a],o),y=vE(yE(f[1],v[1]),a);return[l([...y.toReversed(),...a],`zenon_in_addElt`,[t,p,m],[h],[[g],[_]],[f[0],v[0]]),y]},d=(e,t,r,i,a)=>{let o=t.kind===`app`&&t.symbol===(a?`TLA.set`:`TLA.addElt`)&&t.args.length>=(a?1:2)?[t.args[0],a?n.eapp(`TLA.set`,t.args.slice(1)):t.args[1]]:void 0;if(o===void 0)return r;let u=o[0],f=o[1],p=n.enot(s(e,t)),m=n.enot(c(e,u)),h=n.enot(s(e,f)),g=d(e,f,r,[m,h,...i],a),_=vE(g[1],i);return[l([..._.toReversed(),...i],`zenon_notin_addElt`,[e,u,f],[p],[[m,h]],[g[0]]),_]};switch(o.name){case`in_addElt`:case`in_set`:return u(o.args[1],o.args[2],i,r.conclusions,o.name===`in_set`);case`notin_addElt`:case`notin_set`:if(i.length!==1)throw new e(`Zenon: ${o.name} with ${i.length} subproofs`);return d(o.args[1],o.args[2],i[0],r.conclusions,o.name===`notin_set`);case`notequivdef`:if(i.length!==1)throw new e(`Zenon: notequivdef with several subproofs`);return i[0];default:{let e=o.args,t=(LD[o.name]??AD)(o.name,e),n=vE(i.reduce((e,t)=>yE(e,t[1]),[]),r.conclusions);return[l([...n.toReversed(),...r.conclusions],t[0],t[1],t[2],t[3],i.map(e=>e[0])),n]}}},zD=(t,n)=>{let r=/* @__PURE__ */ new Map,i=n=>{let a=r.get(n);if(a!==void 0)return a;let o=(()=>{switch(n.kind){case`var`:case`true`:case`false`:return n;case`meta`:throw new e(`Zenon: a metavariable in a low-level proof`);case`app`:{if(n.symbol!==`$notequiv`)return t.eapp(n.symbol,n.args.map(i));if(n.args.length!==2)throw new e(`Zenon: $notequiv without two arguments`);let r=i(n.args[1]);return t.enot(t.eequiv(i(n.args[0]),r))}case`not`:return t.enot(i(n.args[0]));case`and`:case`or`:case`imply`:case`equiv`:{let e=i(n.args[1]);return yD(t,n.kind,i(n.args[0]),e)}case`all`:return t.eall(n.args[0],n.symbol,i(n.args[1]));case`ex`:return t.eex(n.args[0],n.symbol,i(n.args[1]));case`tau`:return t.etau(n.args[0],n.symbol,i(n.args[1]));case`lam`:return t.elam(n.args[0],n.symbol,i(n.args[1]))}})();return r.set(n,o),o},a=e=>{switch(e.kind){case`false`:case`nottrue`:return e;case`axiom`:case`cut`:case`notnot`:return{kind:e.kind,formula:i(e.formula)};case`noteq`:return{kind:`noteq`,term:i(e.term)};case`eqsym`:case`notequal`:return{kind:e.kind,left:i(e.left),right:i(e.right)};case`connect`:case`notconnect`:return{kind:e.kind,connective:e.connective,left:i(e.left),right:i(e.right)};case`ex`:case`all`:case`notex`:case`notall`:return{kind:e.kind,quantified:i(e.quantified),term:i(e.term)};case`pnotp`:return{kind:`pnotp`,positive:i(e.positive),negative:i(e.negative)};case`congruencelr`:case`congruencerl`:return{kind:e.kind,context:i(e.context),left:i(e.left),right:i(e.right)};case`definition`:return{kind:`definition`,name:e.name,folded:i(e.folded),unfolded:i(e.unfolded)};case`extension`:return{kind:`extension`,name:e.name,args:e.args.map(i),conclusions:e.conclusions.map(i),branches:e.branches.map(e=>e.map(i))};case`lemma`:return{kind:`lemma`,name:e.name,args:e.args.map(i)}}},o=e=>({conclusions:e.conclusions.map(i),rule:a(e.rule),subproofs:e.subproofs.map(o)});return n.map(e=>({name:e.name,params:e.params.map(e=>[e[0],i(e[1])]),proof:o(e.proof)}))},BD=`zenon_X`,VD=e=>e.startsWith(BD),HD=e=>/^[A-Za-z0-9]$/.test(e),UD=e=>[...e].map(e=>HD(e)?e:`_${e.charCodeAt(0).toString(16).padStart(2,`0`)}`).join(``),WD=(t,n)=>{if(t.kind!==n)throw new e(`Zenon: expected a ${n} binder`);return t},GD=t=>{if(t.subproofs.length!==1)throw new e(`Zenon: expected one subproof`);return t.subproofs[0]},Q=(e,t,n,r)=>({conclusions:yE(e,r.map((e,t)=>vE(e.conclusions,n[t])).reduce((e,t)=>yE(e,t),[])),rule:t,subproofs:r}),KD=e=>{switch(e.name){case`close_refl`:case`close_sym`:return e.relation!==`=`;case`definition`:return e.definition.kind!==`real`;case`conj_tree`:case`disj_tree`:case`not_all_ex`:case`refl`:case`p_not_p_sym`:case`trans`:case`trans_sym`:case`trans_eq`:case`trans_eq2`:case`trans_eq_sym`:return!0;default:return!qD.has(e.name)}},qD=/* @__PURE__ */ new Set(/* @__PURE__ */ `close.false.not_true.not_not.and.not_or.not_impl.ex.all.not_ex.or.impl.not_and.equiv.not_equiv.p_not_p.not_equal.cut.congruence_lr.congruence_rl.notall.notallex.stringequal.stringdiffll.stringdifflr.stringdiffrl.stringdiffrr`.split(`.`)),JD=(t,n,r)=>{let i=t.exprs,a=/* @__PURE__ */ new Map,o=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map,c=[],l=e=>`zenon_L${e}_`,u=(e,t)=>i.eapp(`=`,[e,t]),d=n=>{if(n.metas.length===0)return n;let r=a.get(n);if(r!==void 0)return r;let o=(()=>{switch(n.kind){case`meta`:{let r=n.args[0];if(r.kind!==`all`&&r.kind!==`ex`)throw new e(`Zenon: a metavariable without a quantifier`);return i.evar(`${BD}${t.getNumber(r)}_${UD(r.symbol)}`)}case`app`:return i.eapp(n.symbol,n.args.map(d));case`not`:return i.enot(d(n.args[0]));case`and`:case`or`:case`imply`:case`equiv`:{let e=d(n.args[1]);return yD(i,n.kind,d(n.args[0]),e)}case`all`:case`ex`:case`tau`:case`lam`:return f(n.kind,n.args[0],n.symbol,d(n.args[1]));default:return n}})();return a.set(n,o),o},f=(e,t,n,r)=>e===`all`?i.eall(t,n,r):e===`ex`?i.eex(t,n,r):e===`tau`?i.etau(t,n,r):i.elam(t,n,r),p=t=>{let n=d;switch(t.name){case`close`:return{kind:`axiom`,formula:n(t.args[0])};case`close_refl`:return{kind:`noteq`,term:n(t.args[0])};case`close_sym`:{let e=n(t.args[1]);return{kind:`eqsym`,left:n(t.args[0]),right:e}}case`false`:return{kind:`false`};case`not_true`:return{kind:`nottrue`};case`not_not`:return{kind:`notnot`,formula:n(t.args[0])};case`and`:case`or`:case`impl`:case`equiv`:{let e=n(t.args[1]);return{kind:`connect`,connective:YD[t.name],left:n(t.args[0]),right:e}}case`not_or`:case`not_impl`:case`not_and`:case`not_equiv`:{let e=n(t.args[1]);return{kind:`notconnect`,connective:YD[t.name],left:n(t.args[0]),right:e}}case`ex`:{let e=WD(t.args[0],`ex`),r=n(i.etau(e.args[0],e.symbol,e.args[1]));return{kind:`ex`,quantified:n(e),term:r}}case`all`:{let e=n(t.args[1]);return{kind:`all`,quantified:n(t.args[0]),term:e}}case`not_ex`:{let r=t.args[0];if(r.kind!==`not`)throw new e(`Zenon: not_ex without a negation`);let i=n(t.args[1]);return{kind:`notex`,quantified:n(r.args[0]),term:i}}case`p_not_p`:{let e=n(t.args[1]);return{kind:`pnotp`,positive:n(t.args[0]),negative:e}}case`not_equal`:{let e=n(t.args[1]);return{kind:`notequal`,left:n(t.args[0]),right:e}}case`definition`:{if(t.definition.kind!==`real`)throw new e(`Zenon: a pseudo-definition in tr_rule`);let r=n(t.args[1]);return{kind:`definition`,name:t.definition.name,folded:n(t.args[0]),unfolded:r}}case`cut`:return{kind:`cut`,formula:n(t.args[0])};case`congruence_lr`:case`congruence_rl`:{let e=n(t.args[2]),r=n(t.args[1]);return{kind:t.name===`congruence_lr`?`congruencelr`:`congruencerl`,context:n(t.args[0]),left:r,right:e}}case`notall`:{let e=t.args[0],r=WD(e.kind===`not`?e.args[0]:e,`all`),a=n(i.etau(r.args[0],r.symbol,i.enot(r.args[1])));return{kind:`notall`,quantified:n(r),term:a}}case`notallex`:{let e=WD(t.args[0],`lam`),n=e.args[0],r=e.args[1],a=i.enot(i.eall(n,e.symbol,r)),o=i.eex(n,e.symbol,i.enot(r));return{kind:`extension`,name:`zenon_notallex`,args:[e],conclusions:[a],branches:[[o]]}}case`stringequal`:{let e=t.args[0],n=t.args[1],r=u(i.eapp(`$string`,[e]),i.eapp(`$string`,[n]));return{kind:`extension`,name:`zenon_stringequal`,args:[e,n],conclusions:[r],branches:[]}}case`stringdiffll`:case`stringdifflr`:case`stringdiffrl`:case`stringdiffrr`:{let[e,n,r,a]=t.args,o=t.name===`stringdiffll`||t.name===`stringdifflr`,s=t.name===`stringdiffll`||t.name===`stringdiffrl`,c=o?u(e,n):u(n,e),l=s?u(r,a):u(a,r),d=i.enot(u(e,r));return{kind:`extension`,name:t.name===`stringdiffrr`?`zenon_stringdiffrl`:`zenon_${t.name}`,args:t.args,conclusions:[c,l],branches:[[d]]}}default:throw new e(`Zenon: the derived rule ${t.name} in tr_rule`)}},m=(t,n)=>{let r=(e,n)=>t.some(e=>e[1]===n)?t:[[e,n],...t];switch(n.kind){case`tau`:return r(n.symbol,n);case`all`:case`ex`:case`lam`:return m(t,n.args[1]);case`meta`:throw new e(`Zenon: a metavariable in a translated formula`);default:return n.args.reduce(m,t)}},h=t=>{let n=o.get(t),r=n===void 0?void 0:s.get(l(n));if(r===void 0)throw new e(`Zenon: a lemma that was never made`);let i=r[0];return[{conclusions:i.proof.conclusions,rule:{kind:`lemma`,name:i.name,args:i.params.map(e=>e[1])},subproofs:[]},r[1]]},g=(e,t,n)=>{let r=c.length+1;o.set(n,r);let i={name:l(r),params:e.conclusions.reduce(m,[]),proof:e};s.set(i.name,[i,t]),c.push(i)},_=e=>{if(o.has(e))return h(e);let t=KD(e.rule)?k(e):(()=>{let t=y(e.subproofs),n=vE(t[1],e.conclusions);return[{conclusions:[...n.toReversed(),...e.conclusions].map(d),rule:p(e.rule),subproofs:t[0]},n]})();return v(e)?(g(t[0],t[1],e),h(e)):t},v=e=>t.sharedProofs.has(e)&&!o.has(e),y=e=>{let t=e.map(_);return[t.map(e=>e[0]),t.reduceRight((e,t)=>yE(t[1],e),[])]},b=(e,t,n,r,i)=>[{conclusions:yE([e],vE(r[0].conclusions,n)),rule:t,subproofs:[r[0]]},vE(r[1],[i])],x=(e,t)=>{if(t.kind===`not`)return ee(e,t.args[0]);if(t.kind!==`and`)return e;let n=d(t.args[0]),r=d(t.args[1]),i=x(x(e,t.args[0]),t.args[1]);return b(d(t),{kind:`connect`,connective:`and`,left:n,right:r},[n,r],i,t)},ee=(e,t)=>{let n=i.enot(d(t)),r=i.enot(t);switch(t.kind){case`or`:{let a=d(t.args[0]),o=d(t.args[1]),s=ee(ee(e,t.args[0]),t.args[1]);return b(n,{kind:`notconnect`,connective:`or`,left:a,right:o},[i.enot(a),i.enot(o)],s,r)}case`imply`:{let a=d(t.args[0]),o=d(t.args[1]),s=ee(x(e,t.args[0]),t.args[1]);return b(n,{kind:`notconnect`,connective:`imply`,left:a,right:o},[a,i.enot(o)],s,r)}case`not`:{let i=d(t.args[0]);return b(n,{kind:`notnot`,formula:i},[i],x(e,t.args[0]),r)}default:return e}},S=(e,t)=>{let n=(e,t,n,r,i,a,o,s,c,l)=>[{conclusions:yE([e],yE(vE(a[0].conclusions,[o]),vE(s[0].conclusions,[c]))),rule:{kind:n?`notconnect`:`connect`,connective:t,left:r,right:i},subproofs:[a[0],s[0]]},vE(yE(a[1],s[1]),[l]),s[2]];switch(t.kind){case`or`:{let r=d(t.args[0]),i=d(t.args[1]),a=S(e,t.args[0]),o=S(a[2],t.args[1]);return n(d(t),`or`,!1,r,i,a,r,o,i,t)}case`imply`:{let r=d(t.args[0]),a=d(t.args[1]),o=te(e,t.args[0]),s=S(o[2],t.args[1]);return n(d(t),`imply`,!1,r,a,o,i.enot(r),s,a,t)}case`not`:return te(e,t.args[0]);default:return C(e)}},te=(e,t)=>{switch(t.kind){case`and`:{let n=d(t.args[0]),r=d(t.args[1]),a=te(e,t.args[0]),o=te(a[2],t.args[1]),s=i.enot(t);return[{conclusions:yE([i.enot(d(t))],yE(vE(a[0].conclusions,[i.enot(n)]),vE(o[0].conclusions,[i.enot(r)]))),rule:{kind:`notconnect`,connective:`and`,left:n,right:r},subproofs:[a[0],o[0]]},vE(yE(a[1],o[1]),[s]),o[2]]}case`not`:{let n=d(t.args[0]),r=S(e,t.args[0]);return[{conclusions:yE([i.enot(d(t))],vE(r[0].conclusions,[n])),rule:{kind:`notnot`,formula:n},subproofs:[r[0]]},vE(r[1],[i.enot(t)]),r[2]]}default:return C(e)}},C=t=>{if(t.length===0)throw new e(`Zenon: a disjunction tree without subproofs`);return[t[0][0],t[0][1],t.slice(1)]},w=e=>Q([e,i.enot(e)],{name:`close`,args:[e]},[],[]),T=(e,t)=>Q([i.enot(i.eapp(e,[t,t]))],{name:`close_refl`,relation:e,args:[t]},[],[]),ne=(e,t,n)=>Q([i.eapp(e,[t,n]),i.enot(i.eapp(e,[n,t]))],{name:`close_sym`,relation:e,args:[t,n]},[],[]),re=(e,t)=>Q([i.enot(i.enot(e))],{name:`not_not`,args:[e]},[[e]],[t]),ie=(e,t,n)=>Q([i.eand(e,t)],{name:`and`,args:[e,t]},[[e,t]],[n]),ae=(e,t,n,r)=>Q([i.eimply(e,t)],{name:`impl`,args:[e,t]},[[i.enot(e)],[t]],[n,r]),oe=(e,t,n,r)=>Q([i.enot(i.eand(e,t))],{name:`not_and`,args:[e,t]},[[i.enot(e)],[i.enot(t)]],[n,r]),se=(e,t,n)=>{let r=WD(e,`all`),a=i.substitute([[r.args[0],t]],r.args[1]);return Q([e],{name:`all`,args:[e,t]},[[a]],[n])},ce=(e,t,n)=>{if(t.length===0)return n;let r=WD(e,`all`),a=i.substitute([[r.args[0],t[0]]],r.args[1]);return se(e,t[0],ce(a,t.slice(1),n))},le=(e,t,n,r)=>{if(e.length===0)return[t,r];let a=le(e.slice(1),t,n.slice(1),r);return[i.eimply(e[0],a[0]),ae(e[0],a[0],n[0],a[1])]},ue=(t,n,r)=>{if(t.kind!==`app`||n.kind!==`not`||n.args[0].kind!==`app`)throw new e(`Zenon: make_pnp on a formula that isn't an application`);let a=n.args[0].args;return Q([t,n],{name:`p_not_p`,args:[t,n]},t.args.map((e,t)=>[i.enot(u(e,a[t]))]),r)},de=(e,t,n)=>Q([],{name:`cut`,args:[e]},[[e],[i.enot(e)]],[t,n]),fe=/* @__PURE__ */ new Map,pe=/* @__PURE__ */ new Map,me=(n,r)=>{let a=`${n} ${r}`,o=fe.get(a);if(o!==void 0)return o;let s=t.relations.get(r);if(r===`=`||s===void 0)throw new e(`Zenon: no ${n} hypothesis for ${r}`);let c=s.type,l=i.evar(`x`),u=i.evar(`y`),d=i.evar(`z`),f=n===`reflexive`?i.eall(l,c,E(r,l,l)):n===`symmetric`?i.eall(l,c,i.eall(u,c,i.eimply(E(r,l,u),E(r,u,l)))):i.eall(l,c,i.eall(u,c,i.eall(d,c,i.eimply(E(r,l,u),i.eimply(E(r,u,d),E(r,l,d))))));fe.set(a,f);let p=s[n],m=(()=>{if(p!==void 0)return{kind:n,origin:p};if(n!==`reflexive`&&s.reflexive!==void 0&&s.transitiveSymmetric!==void 0)return{kind:n===`symmetric`?`symmetric2`:`transitive2`,relation:r,reflexive:s.reflexive,transitiveSymmetric:s.transitiveSymmetric}})();if(m===void 0)throw new e(`Zenon: ${r} isn't ${n}`);return pe.set(f,m),f},he=t=>{if(t.kind!==`not`)throw new e(`Zenon: inst_nall without a negation`);let n=WD(t.args[0],`all`),r=i.enot(n.args[1]),a=i.etau(n.args[0],n.symbol,r);return[i.substitute([[n.args[0],a]],r),a]},ge=(t,n)=>{let r=e=>ge(e,n),a=t=>{if(!n.includes(t))throw new e(`Zenon: decompose_disj lacks a literal`);return t};switch(t.kind){case`or`:return Q([t],{name:`or`,args:[t.args[0],t.args[1]]},[[t.args[0]],[t.args[1]]],[r(t.args[0]),r(t.args[1])]);case`imply`:{let e=i.enot(t.args[0]);return Q([t],{name:`impl`,args:[t.args[0],t.args[1]]},[[e],[t.args[1]]],[r(e),r(t.args[1])])}case`false`:return Q([t],{name:`false`,args:[]},[],[]);case`app`:return Q([t,a(i.enot(t))],{name:`close`,args:[t]},[],[]);case`not`:{let n=t.args[0];if(n.kind===`and`){let e=i.enot(n.args[0]),a=i.enot(n.args[1]);return Q([t],{name:`not_and`,args:[n.args[0],n.args[1]]},[[e],[a]],[r(e),r(a)])}if(n.kind===`not`)return Q([t],{name:`not_not`,args:[n.args[0]]},[[n.args[0]]],[r(n.args[0])]);if(n.kind===`true`)return Q([t],{name:`not_true`,args:[]},[],[]);if(n.kind===`app`)return Q([a(n),t],{name:`close`,args:[n]},[],[]);throw new e(`Zenon: decompose_disj on an unexpected formula`)}default:throw new e(`Zenon: decompose_disj on an unexpected formula`)}},_e=(t,n,r,a,o,s)=>{let c=(e,n)=>_e(t,e,n,a,o,s),l=r[0],u=r.slice(1),d=(n,c,l,u)=>{let d=a[0]===t,f=d?s[0]:i.emeta(c);if(f===void 0)throw new e(`Zenon: decompose_conj ran out of witnesses`);let p=l(i.substitute([[c.args[0],f]],c.args[1])),m=_e(t+1,p,r,d?a.slice(1):a,o,d?s.slice(1):s);return Q([n],{name:u,args:[n,f]},[[p]],[m])};if(n.kind===`and`&&l!==void 0){let e=l===`left`?n.args[0]:n.args[1];return Q([n],{name:`and`,args:[n.args[0],n.args[1]]},[[e]],[c(e,u)])}if(n.kind===`all`)return d(n,n,e=>e,`all`);if(n.kind===`equiv`&&l!==void 0){let e=n.args[0],t=n.args[1],r={name:`equiv`,args:[e,t]};return l===`left`?Q([n],r,[[i.enot(e)],[t]],[ge(i.enot(e),o),ge(t,o)]):Q([n],r,[[i.enot(t)],[e]],[ge(i.enot(t),o),ge(e,o)])}let f=n.kind===`not`?n.args[0]:void 0;if(f?.kind===`or`&&l!==void 0){let e=i.enot(l===`left`?f.args[0]:f.args[1]);return Q([n],{name:`not_or`,args:[f.args[0],f.args[1]]},[[e]],[c(e,u)])}if(f?.kind===`imply`&&l!==void 0){let e=l===`left`?f.args[0]:i.enot(f.args[1]);return Q([n],{name:l===`left`?`not_impl`:`not_or`,args:[f.args[0],f.args[1]]},[[e]],[c(e,u)])}if(f?.kind===`ex`)return d(n,f,e=>i.enot(e),`not_ex`);if(f?.kind===`not`)return Q([n],{name:`not_not`,args:[f.args[0]]},[[f.args[0]]],[c(f.args[0],r)]);if(f?.kind===`equiv`&&l!==void 0){let e=f.args[0],t=f.args[1],r={name:`not_equiv`,args:[e,t]};return l===`left`?Q([n],r,[[t],[e]],[ge(t,o),ge(e,o)]):Q([n],r,[[i.enot(e)],[t]],[ge(i.enot(e),o),ge(i.enot(t),o)])}if(r.length>0||a.length>0||s.length>0)throw new e(`Zenon: decompose_conj left directions or variables`);return ge(n,o)},ve=t=>{let n=pe.get(t);if(n===void 0)throw new e(`Zenon: an extra hypothesis that isn't a relation's`);let r=i.enot(t),a=(e,t,n)=>Q([e],{name:`notall`,args:[e]},[[t]],[n]),o=(e,t,n)=>_e(0,e.formula,e.directions,e.variables,t,n),s=t=>{if(t.kind!==`not`||t.args[0].kind!==`imply`)throw new e(`Zenon: a relation hypothesis that isn't an implication`);return t.args[0]},c=he(r);if(n.kind===`reflexive`){let e=o(n.origin,[c[0]],[c[1]]);return[a(r,c[0],e),[n.origin.formula]]}let l=he(c[0]);if(n.kind===`symmetric`||n.kind===`symmetric2`){let e=s(l[0]),t=e.args[0],u=i.enot(e.args[1]),d=n.kind===`symmetric`?o(n.origin,[t,u],[c[1],l[1]]):(()=>{let e=E(n.relation,c[1],c[1]),r=i.enot(e),a=o(n.reflexive,[r],[c[1]]),s=o(n.transitiveSymmetric,[e,t,u],[c[1],c[1],l[1]]);return de(e,s,a)})();return[a(r,c[0],a(c[0],l[0],Q([l[0]],{name:`not_impl`,args:[t,e.args[1]]},[[t,u]],[d]))),n.kind===`symmetric`?[n.origin.formula]:[n.reflexive.formula,n.transitiveSymmetric.formula]]}let u=he(l[0]),d=s(u[0]),f=d.args[1];if(f.kind!==`imply`)throw new e(`Zenon: a transitivity hypothesis that isn't an implication`);let p=d.args[0],m=f.args[0],h=i.enot(f.args[1]),g=n.kind===`transitive`?o(n.origin,[p,m,h],[c[1],l[1],u[1]]):(()=>{let e=E(n.relation,c[1],c[1]),t=i.enot(e),r=E(n.relation,u[1],c[1]),a=i.enot(r),s=o(n.transitiveSymmetric,[r,e,h],[u[1],c[1],c[1]]),d=o(n.transitiveSymmetric,[p,m,a],[c[1],l[1],u[1]]),f=de(r,s,d),g=o(n.reflexive,[t],[c[1]]);return de(e,f,g)})();return[a(r,c[0],a(c[0],l[0],a(l[0],u[0],Q([u[0]],{name:`not_impl`,args:[p,f]},[[p,i.enot(f)]],[Q([f],{name:`not_impl`,args:[m,f.args[1]]},[[m,h]],[g])])))),n.kind===`transitive`?[n.origin.formula]:[n.reflexive.formula,n.transitiveSymmetric.formula]]},E=(e,t,n)=>i.eapp(e,[t,n]),ye=(e,t,n,r,i)=>{let a=me(`transitive`,e),o=E(e,t,n),s=E(e,n,r),c=le([o,s],E(e,t,r),[w(o),w(s)],i);return ce(a,[t,n,r],c[1])},be=(e,t,n,r)=>{let i=me(`symmetric`,e),a=E(e,t,n),o=E(e,n,t);return ce(i,[n,t],ae(o,a,r,w(a)))},xe=(e,t,n)=>{let r=u(t,t),a=T(`=`,t),o=ue(r,i.enot(u(e,t)),[n,a]);return de(r,o,a)},Se=(e,t,n)=>{let r=u(e,t);return de(u(t,e),n,xe(t,e,w(r)))},Ce=(e,t,n,r,a,o,s)=>{let c=u(r,t),l=i.enot(c),d=E(e,r,t),f=i.enot(d),p=u(n,a),m=i.enot(E(e,r,a)),h=i.eand(l,f),g=w(p),_=oe(l,f,re(c,xe(t,r,w(c))),re(d,ye(e,r,t,n,ue(E(e,r,n),m,[T(`=`,r),g])))),v=oe(l,f,re(c,ne(`=`,r,t)),re(d,ye(e,r,t,a,w(E(e,r,a))))),y=ue(E(e,t,n),m,[_,g]),b=ye(e,t,n,a,ue(E(e,t,a),m,[v,T(`=`,a)])),x=de(p,y,de(E(e,n,a),b,s));return de(h,ie(l,f,o),x)},we=(e,t,n,r,a,o)=>{let s=E(e,r,a),c=E(e,n,a),l=E(e,r,n),d=E(e,r,t),f=E(e,t,a),p=i.enot(s),m=T(`=`,r),h=w(u(t,n)),g=T(`=`,a),_=ue(l,p,[m,de(c,ye(e,r,n,a,w(s)),o[2])]),v=ue(d,i.enot(l),[m,h]),y=ue(f,p,[xe(t,r,o[0]),g]),b=ue(c,i.enot(f),[xe(n,t,h),g]);return de(d,de(l,_,v),de(c,de(f,y,b),o[1]))},Te=(e,t,n,r,a,o)=>{let s=xe(e,n,a);return ue(u(e,t),i.enot(u(n,r)),[s,o])},Ee=t=>{let n=t.kind===`not`?t.args[0]:t;if(n.kind!==`app`||n.args.length!==2)throw new e(`Zenon: a transitivity rule on a formula that isn't a relation`);return n},D=t=>{if(t.subproofs.length!==3)throw new e(`Zenon: expected three subproofs`);return[t.subproofs[0],t.subproofs[1],t.subproofs[2]]},O=(e,t)=>{let n=_(e);return[n[0],yE(t,n[1])]},k=t=>{let n=t.rule;switch(n.name){case`definition`:{if(n.definition.kind!==`pseudo`)throw new e(`Zenon: a real definition in translate_derived`);let r=Oe(t,n.definition,n.args[0],n.args[1]);return O(r,[n.definition.origin])}case`conj_tree`:return x(_(GD(t)),n.args[0]);case`disj_tree`:{let r=S(t.subproofs.map(_),n.args[0]);if(r[2].length>0)throw new e(`Zenon: a disjunction tree with extra subproofs`);return[r[0],r[1]]}case`close_sym`:{let e=me(`symmetric`,n.relation),[t,r]=n.args,i=E(n.relation,t,r),a=E(n.relation,r,t),o=ae(i,a,w(i),w(a));return O(ce(e,[t,r],o),[e])}case`close_refl`:{let e=me(`reflexive`,n.relation),t=n.args[0];return O(se(e,t,w(E(n.relation,t,t))),[e])}case`refl`:{let e=me(`reflexive`,n.relation),[r,a]=n.args,o=E(n.relation,r,r),s=i.enot(E(n.relation,r,a)),c=ue(o,s,[T(`=`,r),GD(t)]);return O(se(e,r,c),[e])}case`p_not_p_sym`:{let e=Ee(n.args[0]),r=Ee(n.args[1]);if(n.relation===`=`){let e=i.enot(u(r.args[1],r.args[0])),a=ue(n.args[0],e,[t.subproofs[1],t.subproofs[0]]);return _(xe(r.args[0],r.args[1],a))}let a=me(`symmetric`,n.relation),[o,s]=e.args,c=E(n.relation,s,o),l=ue(c,n.args[1],[t.subproofs[0],t.subproofs[1]]),d=ae(n.args[0],c,w(n.args[0]),l);return O(ce(a,[o,s],d),[a])}case`trans`:case`trans_sym`:{let e=Ee(n.args[0]),r=e.symbol,[i,a]=e.args,[o,s]=Ee(n.args[1]).args,c=t.subproofs[0],l=t.subproofs[1];if(r===`=`)return n.name===`trans`?_(Te(i,a,o,s,c,l)):_(xe(o,s,Te(i,a,s,o,c,l)));if(n.name===`trans`)return O(Ce(r,i,a,o,s,c,l),[me(`transitive`,r)]);let u=be(r,o,s,Ce(r,i,a,s,o,c,l));return O(u,[me(`transitive`,r),me(`symmetric`,r)])}case`trans_eq`:case`trans_eq2`:case`trans_eq_sym`:{let e=Ee(n.args[2]),r=e.symbol,[i,a]=e.args,o=n.args[0],s=n.args[1],c=D(t);if(r===`=`&&n.name===`trans_eq`)return _(Te(o,s,i,a,c[0],c[2]));if(r===`=`&&n.name===`trans_eq_sym`)return _(xe(i,a,Te(o,s,a,i,c[0],c[2])));let l=me(`transitive`,r),u=n.name===`trans_eq`?we(r,o,s,i,a,c):n.name===`trans_eq2`?Se(o,s,we(r,s,o,i,a,c)):be(r,i,a,we(r,o,s,a,i,c));return O(u,[l])}case`not_all_ex`:{let e=n.args[0],r=e.kind===`not`?e.args[0]:e,a=WD(r,`all`),o=a.args[0],s=a.args[1],c=i.eex(o,a.symbol,i.enot(s)),l=i.elam(o,a.symbol,s),u=A(c,GD(t));return _(Q([e],{name:`notallex`,args:[l]},[[c]],[u]))}default:return RD(d,i,t,t.subproofs.map(_))}},A=(e,t)=>{let n=WD(e,`ex`),r=i.etau(n.args[0],n.symbol,n.args[1]),a=i.substitute([[n.args[0],r]],n.args[1]);return Q([e],{name:`ex`,args:[e]},[[a]],[t])},De=(t,n,r)=>{if(n===r)throw new e(`Zenon: find_diff on equal formulas`);if(n.kind===`app`&&r.kind===`app`&&n.symbol===r.symbol){let e=n.args.findIndex((e,t)=>e!==r.args[t]),a=De(t,n.args[e],r.args[e]);return[i.eapp(n.symbol,n.args.map((t,n)=>n===e?a[0]:t)),a[1],a[2]]}if(n.kind===`not`&&r.kind===`not`){let e=De(t,n.args[0],r.args[0]);return[i.enot(e[0]),e[1],e[2]]}if((n.kind===`and`||n.kind===`or`||n.kind===`imply`||n.kind===`equiv`)&&r.kind===`and`){if(n.args[0]===r.args[0]){let e=De(t,n.args[1],r.args[1]);return[yD(i,n.kind,n.args[0],e[0]),e[1],e[2]]}let e=De(t,n.args[0],r.args[0]);return[yD(i,n.kind,e[0],n.args[1]),e[1],e[2]]}if(n.kind===r.kind&&(n.kind===`all`||n.kind===`ex`||n.kind===`tau`||n.kind===`lam`))throw new e(`Zenon: find_diff under a binder`);return[t,n,r]},Oe=(t,n,r,a)=>{let o=n.origin,s=(()=>{let t=De(i.newVar(),r,a);if(t[1].kind===`app`)return t[1].args;if(t[1].kind===`var`)return[];throw new e(`Zenon: a pseudo-definition of something other than a symbol`)})(),c=[];for(let e=o;e.kind===`all`;e=e.args[1])c.push([e.args[0],e]);let l=c.map((e,t)=>{let r=c.slice(t+1).some(t=>t[0]===e[0]),a=n.params.indexOf(e[0]);return r||a===-1?i.emeta(e[1]):s[a]}),d=(o,s)=>{if(s.length>0){let e=WD(o,`all`),t=i.substitute([[e.args[0],s[0]]],e.args[1]),n=d(t,s.slice(1));return Q([o],{name:`all`,args:[o,s[0]]},[[t]],[n])}let c=GD(t);if(o.kind===`equiv`){let e=r.kind===`not`&&a.kind===`not`,t=e&&r.kind===`not`?r.args[0]:r,n=e?r:i.enot(r),s=e&&a.kind===`not`?a.args[0]:a,l=e?a:i.enot(a),u=w(t),d={name:`equiv`,args:[o.args[0],o.args[1]]};return e?Q([o],d,[[l],[t]],[c,u]):Q([o],d,[[n],[s]],[u,c])}if(o.kind===`app`&&o.symbol===`=`&&o.args.length===2){if(r===i.enot(o))return Q([r,o],{name:`close`,args:[o]},[],[]);let t=ke(o.args[0],n.symbol);if(!t&&!ke(o.args[1],n.symbol))throw new e(`Zenon: a pseudo-definition that doesn't define its symbol`);let s=i.newVar(),l=De(s,r,a),d=i.elam(s,``,l[0]),f=l[1],p=l[2];return t?Q([i.apply(d,f),u(f,p)],{name:`congruence_lr`,args:[d,f,p]},[[i.apply(d,p)]],[c]):Q([i.apply(d,f),u(p,f)],{name:`congruence_rl`,args:[d,f,p]},[[i.apply(d,p)]],[c])}throw new e(`Zenon: a pseudo-definition of an unexpected shape`)};return d(o,l)},ke=(e,t)=>(e.kind===`app`||e.kind===`var`)&&e.symbol===t,Ae=_(r),je=Ae[1].filter(e=>!n.some(t=>t.kind===`hyp`&&t.formula===e)).reduce((t,n)=>{let r=ve(n),i=_(r[0]);if(i[1].length>0)throw new e(`Zenon: a relation proof with extras`);let a=d(n);return{conclusions:yE(r[1].map(d),vE(t.conclusions,[a])),rule:{kind:`cut`,formula:a},subproofs:[t,i[0]]}},Ae[0]);return[...c,{name:`zenon_thm`,params:[],proof:je}]},YD={and:`and`,or:`or`,impl:`imply`,equiv:`equiv`,not_or:`or`,not_impl:`imply`,not_and:`and`,not_equiv:`equiv`},XD={"=":`=`,"TLA.cup":` \\\\cup `,"TLA.cap":` \\\\cap `,"TLA.setminus":` \\\\ `,"TLA.in":` \\\\in `,"TLA.subseteq":` \\\\subseteq `,"arith.natrange":`..`,"arith.add":` + `,"arith.sub":` - `,"arith.mul":` * `,"arith.le":` <= `,"arith.lt":` < `,"TLA.concat":` \\\\circ `,"TLA.oneArg":` :> `,"TLA.extend":` @@ `},ZD={"TLA.emptyset":`{}`,"arith.N":`Nat`,"arith.Z":`Int`,"arith.R":`isReal`,"arith.Infinity":`isInfinity`},QD={"arith.div":`isa'slash`,"arith.euclidiv":`isa'div`,"arith.mod":`isa'pc`,"arith.minus":` -.`,"arith.intrange":`isa'dotdot`,"TLA.box":`isa'box`},$D=e=>e.length>4&&e.startsWith(`TLA.`)?e.slice(4):e.length>6&&e.startsWith(`arith.`)?e.slice(6):e,eO=e=>e<26?String.fromCharCode(97+e):`${eO(Math.floor(e/26))}${String.fromCharCode(97+e%26)}`,tO=e=>Array.from({length:Math.floor(e.length/2)},(t,n)=>[e[2*n],e[2*n+1]]),nO=(e,t)=>{if(!(t<0)){if(e.kind===`var`&&e.symbol===`0`)return 0;if(e.kind===`app`&&e.symbol===`TLA.fapply`&&e.args.length===2&&e.args[0].kind===`var`&&e.args[0].symbol===`TLA.Succ`){let n=nO(e.args[1],t-1);return n===void 0?void 0:n+1}}},rO=t=>{if(t.subproofs.length!==1)throw new e(`Zenon: expected one subproof`);return t.subproofs[0]},iO=t=>{let n=t[t.length-1];if(n===void 0||n.length!==1&&n.length!==2)throw new e(`Zenon: a CASE rule with a malformed last branch`);return n.length===2},aO=e=>e>=15?e:e+1,oO=(t,n)=>{let r=n.exprs,i=/* @__PURE__ */ new Map,a=e=>{let t=i.get(e);return t===void 0?(i.set(e,i.size),i.size-1):t},o=wD(r,zD(r,JD({exprs:r,getNumber:a,sharedProofs:n.sharedProofs,relations:n.relations},n.phrases,t))),s=[],c=e=>s.push(e),l=(e,t)=>s.push(` `.repeat(e),t),u=e=>`z_H${eO(a(e))}`,d=e=>`?z_h${eO(a(e))}`,f=(e,t)=>r.eapp(`=`,[e,t]),p=t=>{if(t.kind!==`all`&&t.kind!==`ex`)throw new e(`Zenon: expected a quantifier`);return r.elam(t.args[0],t.symbol,t.args[1])},m=[],h=/* @__PURE__ */ new Map,g=(e,t)=>{let n=h.get(t);return n!==void 0&&n<e&&m[n]===t},_=(e,t)=>(m.length=e,h.set(t,e),m.push(t),e+1),v=(t,n,r)=>{let i=a(r);if(g(n,i)&&!r.freeVars.some(e=>t.includes(e)))return`?z_h${eO(i)}`;let o=e=>v(t,n,e),s=e=>e.map(o).join(`, `),c=(e,r,i)=>`(${e}${r.args[0].symbol}${i}${v([r.args[0].symbol,...t],n,r.args[1])})`;switch(r.kind){case`var`:return VD(r.symbol)?`(CHOOSE x : TRUE)`:ZD[r.symbol]??$D(r.symbol);case`app`:{let i=r.args;switch(r.symbol){case`$string`:{let t=i[0];if(i.length!==1||t.kind!==`var`||t.symbol.length<2)throw new e(`Zenon: a malformed string`);return`''${t.symbol.slice(1,-1)}''`}case`TLA.set`:return`{${s(i)}}`;case`TLA.tuple`:return`<<${s(i)}>>`;case`TLA.record`:return`(${tO(i).map(e=>`${o(e[0])} :> (${o(e[1])})`).join(` @@ `)})`;case`TLA.recordset`:return`[${tO(i).map(e=>`${o(e[0])} : (${o(e[1])})`).join(`, `)}]`;case`TLA.CASE`:return`(CASE ${y(t,n,i)})`}if(r.symbol===`TLA.fapply`&&i.length===2){let e=i[0].kind===`var`&&i[0].symbol===`TLA.Succ`?nO(i[1],14):void 0;return e===void 0?`(${o(i[0])}[${o(i[1])}])`:String(e+1)}let a=XD[r.symbol];return a!==void 0&&i.length===2?`(${o(i[0])}${a}${o(i[1])})`:i.length===0?r.symbol:`${QD[r.symbol]??$D(r.symbol)}(${s(i)})`}case`not`:{let e=r.args[0];return e.kind===`app`&&e.symbol===`=`&&e.args.length===2?`(${o(e.args[0])}~=${o(e.args[1])})`:`(~${o(e)})`}case`and`:return`(${o(r.args[0])}&${o(r.args[1])})`;case`or`:return`(${o(r.args[0])}|${o(r.args[1])})`;case`imply`:return`(${o(r.args[0])}=>${o(r.args[1])})`;case`equiv`:return`(${o(r.args[0])}<=>${o(r.args[1])})`;case`true`:return`TRUE`;case`false`:return`FALSE`;case`all`:return c(`\\\\A `,r,`:`);case`ex`:return c(`\\\\E `,r,`:`);case`lam`:return c(`\\<lambda>`,r,`. `);case`tau`:return c(`CHOOSE `,r,`:`);case`meta`:throw new e(`Zenon: a metavariable in the Isar output`)}},y=(t,n,r)=>{let i=e=>v(t,n,e);if(r.length===0)throw new e(`Zenon: a CASE without arms`);if(r.length===1)return`OTHER -> ${i(r[0])}`;let a=`${i(r[0])} -> ${i(r[1])}`;return r.length===2?a:`${a} [] ${y(t,n,r.slice(2))}`},b=(e,t)=>v([],e,t),x=(e,t,n)=>{let i=a(t);return g(e,i)?`?z_h${eO(i)}(${b(e,n)})`:b(e,r.apply(t,n))},ee=(e,t)=>{if(t.kind===`var`&&!VD(t.symbol))return[`_`,e];let n=a(t);return g(e,n)?[`_`,e]:[d(t),_(e,n)]},S=(e,t)=>{let n=(t,n,r,i,a)=>{let o=ee(e,n),s=ee(o[1],i);return c(o[0]===`_`&&s[0]===`_`?`
320
+ `:` (is "${t}${o[0]}${r}${s[0]}${a}")\n`),s[1]},r=(t,n,r)=>{let i=ee(e,n);return c(i[0]===`_`?`
321
+ `:` (is "${t}${i[0]}${r}")\n`),i[1]},i=t.kind===`not`?t.args[0]:void 0;switch(t.kind){case`and`:return n(``,t.args[0],`&`,t.args[1],``);case`or`:return n(``,t.args[0],`|`,t.args[1],``);case`imply`:return n(``,t.args[0],`=>`,t.args[1],``);case`equiv`:return n(``,t.args[0],`<=>`,t.args[1],``);case`all`:return r(`\\\\A x : `,p(t),`(x)`);case`ex`:return r(`\\\\E x : `,p(t),`(x)`)}if(t.kind===`app`&&t.symbol===`=`&&t.args.length===2)return n(``,t.args[0],`=`,t.args[1],``);if(i===void 0)return r(``,t,``);switch(i.kind){case`and`:return n(`~(`,i.args[0],`&`,i.args[1],`)`);case`or`:return n(`~(`,i.args[0],`|`,i.args[1],`)`);case`imply`:return n(`~(`,i.args[0],`=>`,i.args[1],`)`);case`equiv`:return n(`~(`,i.args[0],`<=>`,i.args[1],`)`);case`all`:return r(`~(\\\\A x : `,p(i),`(x))`);case`ex`:return r(`~(\\\\E x : `,p(i),`(x))`);case`not`:return r(`~~`,i.args[0],``)}return i.kind===`app`&&i.symbol===`=`&&i.args.length===2?n(``,i.args[0],`~=`,i.args[1],``):r(`~`,i,``)},te=(e,t,n)=>{let r=ee(e,n);return r[0]!==`_`&&l(t,`let ${r[0]} = "${b(e,n)}"\n`),r[1]},C=(e,t,n)=>n.reduce((t,n)=>(l(e,`assume ${u(n)}:"${b(t,n)}"`),S(t,n)),t),w=(t,n,r,i)=>{if(r.length!==i.length)throw new e(`Zenon: a rule whose branches don't match its subproofs`);r.forEach((e,a)=>{le(aO(t),C(aO(t),n,e),i[a]),l(t,a===r.length-1?`qed
322
+ `:`next
323
+ `)})},T=(e,t,n,r,i)=>{let a=n.reduce((t,n,a)=>{if(!r.conclusions.includes(n))return t;l(e,`have ${u(n)}: "${b(t,n)}"`);let o=S(t,n);return l(e,i(o,a)),o},t);le(e,a,r)},ne=(e,t,n,r,i,a)=>{let o=rO(a),s=u(r);T(e,t,i,o,(e,t)=>`by (rule zenon_${n}_${t} [OF ${s}])\n`)},re=(e,t,n,r,i,a)=>{let o=u(r);l(e,`show FALSE
324
+ `),l(e,`proof (rule zenon_${n} [OF ${o}])\n`),w(e,t,i,a.subproofs)},ie=(e,t,n,i,a,o,s,c,d)=>{let f=rO(c),m=p(a),h=r.apply(m,o),g=i?r.enot(h):h;l(e,`have ${u(g)}: "${i?`~`:``}${x(t,m,o)}"`);let _=S(t,g),v=u(s),y=d?`"${b(_,m)}" "${b(_,o)}"`:`"${b(_,m)}"`;l(e,`by (rule zenon_${n}_0 [of ${y}, OF ${v}])\n`),le(e,_,f)},ae=(e,t,n,i,a)=>{let o=f(n,i);if(n===i||a.conclusions.includes(o))return t;let s=r.enot(o);l(e,`have ${u(o)}: "${b(t,o)}"`);let c=S(t,o),d=f(i,n);return a.conclusions.includes(d)?(l(e,`by (rule sym [OF ${u(d)}])\n`),c):(l(e,`proof (rule zenon_nnpp [of "${b(c,o)}"])\n`),le(aO(e),C(aO(e),c,[s]),a),l(e,`qed
325
+ `),c)},oe=(t,n,i,a,o,s,c)=>{if(a.length!==o.length)throw new e(`Zenon: arguments of different lengths`);if(a.length===0){l(aO(t),`thus "${b(n,c)}" .\n`),l(t,`qed
326
+ `);return}let d=a[0],p=o[0];if(d===p){oe(t,n,i,a.slice(1),o.slice(1),[...s,p],c);return}let m=r.newVar(),h=r.elam(m,``,i([...s,m,...a.slice(1)])),g=r.apply(h,p);l(aO(t),`have ${u(g)}: "${b(n,g)}"`);let _=S(n,g),v=u(c),y=u(f(d,p));l(aO(t),`by (rule subst [where P="${b(_,h)}", OF ${y}], fact ${v})\n`),oe(t,_,i,a.slice(1),o.slice(1),[...s,p],g)},se=(e,t)=>t.map(t=>`"${b(e,t)}"`).join(` `),ce=e=>e.map(u).join(` `),le=(t,i,a)=>{if(Rw(n.limits)!==void 0)return;let o=a.rule;switch(o.kind){case`connect`:{let e=o.left,n=o.right;switch(o.connective){case`and`:return ne(t,i,`and`,r.eand(e,n),[e,n],a);case`or`:return re(t,i,`or`,r.eor(e,n),[[e],[n]],a);case`imply`:return re(t,i,`imply`,r.eimply(e,n),[[r.enot(e)],[n]],a);case`equiv`:return re(t,i,`equiv`,r.eequiv(e,n),[[r.enot(e),r.enot(n)],[e,n]],a)}return}case`notconnect`:{let e=o.left,n=o.right;switch(o.connective){case`and`:return re(t,i,`notand`,r.enot(r.eand(e,n)),[[r.enot(e)],[r.enot(n)]],a);case`or`:return ne(t,i,`notor`,r.enot(r.eor(e,n)),[r.enot(e),r.enot(n)],a);case`imply`:return ne(t,i,`notimply`,r.enot(r.eimply(e,n)),[e,r.enot(n)],a);case`equiv`:return re(t,i,`notequiv`,r.enot(r.eequiv(e,n)),[[r.enot(e),n],[e,r.enot(n)]],a)}return}case`extension`:return pe(t,i,a,o);case`notnot`:return ne(t,i,`notnot`,r.enot(r.enot(o.formula)),[o.formula],a);case`ex`:return ie(t,i,`ex_choose`,!1,o.quantified,o.term,o.quantified,a,!1);case`notall`:return ie(t,i,`notall_choose`,!0,o.quantified,o.term,r.enot(o.quantified),a,!1);case`all`:return ie(t,i,`all`,!1,o.quantified,o.term,o.quantified,a,!0);case`notex`:return ie(t,i,`notex`,!0,o.quantified,o.term,r.enot(o.quantified),a,!0);case`lemma`:{let n=o.args.flatMap(t=>{if(t.kind===`var`)return[t.symbol];if(t.kind===`tau`)return[];throw new e(`Zenon: a lemma argument that is neither a variable nor a tau`)});l(t,`show FALSE
327
+ `),l(t,`by (rule ${o.name} [`),n.length>0&&c(`where ${n.map(e=>`?${e}=${e}`).join(` and `)}, `),c(`OF ${ce(a.conclusions)}])\n`);return}case`cut`:return l(t,`show FALSE
328
+ `),l(t,`proof (rule zenon_em [of "${b(i,o.formula)}"])\n`),w(t,i,[[o.formula],[r.enot(o.formula)]],a.subproofs);case`axiom`:{let e=u(o.formula),n=u(r.enot(o.formula));l(t,`show FALSE
329
+ `),l(t,`by (rule notE [OF ${n} ${e}])\n`);return}case`definition`:{let e=u(o.folded),n=u(o.unfolded);l(t,`have ${n}_${e}: "${b(i,o.unfolded)} == ${b(i,o.folded)}"`);let r=ee(i,o.unfolded),s=ee(r[1],o.folded);c(` (is "${r[0]} == ${s[0]}")\n`),l(t,`by (unfold ${o.name})\n`),l(t,`have ${n}: "${b(s[1],o.unfolded)}"`);let d=S(s[1],o.unfolded);return l(t,`by (unfold ${n}_${e}, fact ${e})\n`),le(t,d,rO(a))}case`notequal`:{let n=o.left,s=o.right;if(n.kind!==`app`||s.kind!==`app`||n.symbol!==s.symbol)throw new e(`Zenon: notequal on different applications`);let c=r.enot(f(n,s));l(t,`show FALSE
330
+ `),l(t,`proof (rule zenon_noteq [of "${b(i,s)}"])\n`);let u=ue(t,i,n.args,s.args,a.subproofs);return oe(t,u,e=>r.enot(f(r.eapp(n.symbol,e),s)),n.args,s.args,[],c)}case`pnotp`:{let n=o.positive,s=o.negative,c=s.kind===`not`?s.args[0]:void 0;if(n.kind!==`app`||c?.kind!==`app`||n.symbol!==c.symbol)throw new e(`Zenon: pnotp on different applications`);l(t,`show FALSE
331
+ `),l(t,`proof (rule notE [OF ${u(s)}])\n`);let d=ue(t,i,n.args,c.args,a.subproofs);return oe(t,d,e=>r.eapp(n.symbol,e),n.args,c.args,[],n)}case`noteq`:{let e=u(r.enot(f(o.term,o.term)));l(t,`show FALSE
332
+ `),l(t,`by (rule zenon_noteq [OF ${e}])\n`);return}case`eqsym`:{let e=u(f(o.left,o.right)),n=u(r.enot(f(o.right,o.left)));l(t,`show FALSE
333
+ `),l(t,`by (rule zenon_eqsym [OF ${e} ${n}])\n`);return}case`nottrue`:l(t,`show FALSE
334
+ `),l(t,`by (rule zenon_nottrue [OF ${u(r.enot(fE))}])\n`);return;case`false`:l(t,`show FALSE
335
+ `),l(t,`by (rule ${u(pE)})\n`);return;case`congruencelr`:case`congruencerl`:{let e=rO(a),n=o.kind===`congruencelr`?f(o.left,o.right):f(o.right,o.left),s=r.apply(o.context,o.left),c=r.apply(o.context,o.right);l(t,`have ${u(c)}: "${b(i,c)}"`);let d=S(i,c),p=u(s),m=u(n),h=o.kind===`congruencelr`?`subst`:`ssubst`;return l(t,`by (rule ${h} [where P="${b(d,o.context)}", OF ${m} ${p}])\n`),le(t,d,e)}}},ue=(t,n,r,i,a)=>{if(r.length!==i.length||r.length!==a.length)throw new e(`Zenon: list_fold_left3`);return r.reduce((e,n,r)=>ae(aO(t),e,n,i[r],a[r]),n)},de=(t,n,r,i)=>{if(r.length!==i.length)throw new e(`Zenon: List.fold_left2`);return r.reduce((n,r,a)=>{let o=r[0];if(r.length!==1||o.kind!==`not`)throw new e(`Zenon: a branch that isn't one negation`);let s=o.args[0];l(t,`have ${u(s)}: "${b(n,s)}"`);let c=S(n,s);return l(t,`proof (rule zenon_nnpp)
336
+ `),l(t+1,`assume ${u(o)}: "${b(c,o)}"`),le(t+1,S(c,o),i[a]),l(t,`qed
337
+ `),c},n)},fe=t=>t.map(t=>{let n=t[0];if(t.length!==1||n.kind!==`not`)throw new e(`Zenon: a branch that isn't one negation`);return`${u(n.args[0])} `}).join(``),pe=(t,n,i,a)=>{let o=a.args,s=a.conclusions,d=a.branches,p=()=>new e(`Zenon: a malformed ${a.name} rule`);switch(a.name){case`zenon_case`:{if(o.length!==1||s.length!==1)throw p();let e=iO(d),r=u(s[0]);return l(t,`show FALSE
338
+ `),l(t,`proof (rule zenon_case${e?`other`:``}${d.length-1} [of "${b(n,o[0])}", OF ${r}])\n`),w(t,n,d,i.subproofs)}case`zenon_stringequal`:{if(o.length!==2||s.length!==1||d.length!==0)throw p();let e=s[0],i=r.enot(e);l(t,`have ${u(i)}: "${b(n,i)}"\n`),l(t,`by (simp only: zenon_sa_1 zenon_sa_2,
339
+ `),l(t,` ((rule zenon_sa_diff_2)+)?,
340
+ `),l(t,` (rule zenon_sa_diff_3, auto)?,
341
+ `),l(t,` (rule zenon_sa_diff_1, auto)?,
342
+ `),l(t,` (rule zenon_sa_diff_0a)?, (rule zenon_sa_diff_0b)?)
343
+ `),l(t,`show FALSE
344
+ `);let a=u(e);l(t,`by (rule notE [OF ${u(i)} ${a}])\n`);return}case`zenon_stringdiffll`:case`zenon_stringdifflr`:case`zenon_stringdiffrl`:case`zenon_stringdiffrr`:{let e=d[0]?.[0];if(o.length!==4||s.length!==2||d.length!==1||d[0].length!==1||e===void 0)throw p();let c=rO(i),m=r.enot(f(o[1],o[3]));l(t,`have ${u(m)}: "${b(n,m)}"\n`),l(t,`by auto
345
+ `),l(t,`have ${u(e)}: "${b(n,e)}"`);let h=S(n,e),g=u(s[1]),_=u(s[0]);return l(t,`by (rule ${a.name} [OF ${u(m)} ${_} ${g}])\n`),le(aO(t),h,c)}case`zenon_tuple_eq_match`:case`zenon_record_eq_match`:{if(o.length!==0||s.length!==1||d.length!==1)throw p();let e=s[0];return T(t,n,d[0],rO(i),()=>`using ${u(e)} by auto\n`)}case`zenon_tuple_eq_mismatch`:case`zenon_record_eq_mismatch`:if(o.length!==1||s.length!==1||d.length!==0)throw p();l(t,`show FALSE
346
+ `),l(t,`using ${u(o[0])} by auto\n`);return;case`zenon_tuple_access`:case`zenon_tuple_len`:case`zenon_record_domain`:{let e=d[0]?.[0];if(o.length!==3||s.length!==1||d.length!==1||d[0].length!==1||e===void 0)throw p();let r=rO(i),a=f(o[1],o[2]);l(t,`have ${u(a)}: "${b(n,a)}"`);let c=S(n,a);l(t,`by auto
347
+ `),l(t,`have ${u(e)}: "${b(c,e)}"`);let m=S(c,e),h=u(s[0]),g=u(a);return l(t,`by (rule subst [where P="${b(n,o[0])}", OF ${g} ${h}])\n`),le(t,m,r)}case`zenon_record_access`:{let a=d[0]?.[0],c=o[1];if(o.length!==3||s.length!==1||d.length!==1||d[0].length!==1||a===void 0)throw p();let m=c.kind===`app`&&c.symbol===`TLA.fapply`&&c.args.length===2,h=m?c.args[0]:void 0,g=m?c.args[1]:void 0;if(h?.kind!==`app`||h.symbol!==`TLA.record`||g===void 0)throw p();let _=rO(i),v=h.args.indexOf(g);if(v===-1)throw new e(`Zenon: list_indexq`);let y=Math.floor(v/2)+1,x=Math.floor(h.args.length/2),ee=r.eapp(`TLA.in`,[g,r.eapp(`TLA.DOMAIN`,[h])]),te=f(c,o[2]),C=r.eand(ee,te);l(t,`have ${u(C)}: "${b(n,C)}"`);let w=S(n,C);l(t,y===1?`by ((rule zenon_recfield_1)+, rule zenon_recfield_2b)
348
+ `:`by (${`rule zenon_recfield_1, `.repeat(Math.max(0,x-y))}rule zenon_recfield_2, ((rule zenon_recfield_3)+)?, rule zenon_recfield_3b, auto)\n`),l(t,`have ${u(te)}: "${b(w,te)}"`);let T=S(w,te);l(t,`by (rule conjD2 [OF ${u(C)}])\n`),l(t,`have ${u(a)}: "${b(T,a)}"`);let ne=S(T,a),re=u(s[0]),ie=u(te);return l(t,`by (rule subst [where P="${b(ne,o[0])}", OF ${ie} ${re}])\n`),le(t,ne,_)}case`zenon_in_product`:case`zenon_in_recordset`:{let e=d[0]??[];if(o.length!==2||s.length!==1||d.length!==1||e.length<2)throw p();let c=rO(i),f=s[0],m=o[0],h=o[1],g=a.name===`zenon_in_product`,_=te(n,t,m),v=g?te(_,t,h):_,y=e=>{if(!c.conclusions.includes(e))return;let n=u(f);l(t,`have ${u(e)}: "${b(v,e)}" using ${n} by auto\n`)};y(e[0]),y(e[1]);let x=r.eapp(`TLA.fapply`,[r.evar(`TLA.Succ`),r.evar(`0`)]),ee=e=>r.eapp(`TLA.fapply`,[r.evar(`TLA.Succ`),e]);if(g){let n=r.eapp(`TLA.isASeq`,[h]);l(t,`have ${u(n)}: "${b(v,n)}" by auto\n`);let i=e.slice(2).reduce((e,i)=>{let a=e[0],o=e[1];if(!c.conclusions.includes(i))return[a,ee(o)];let s=r.eapp(`TLA.in`,[o,r.eapp(`arith.natrange`,[x,r.eapp(`TLA.Len`,[h])])]);l(t,`have ${u(s)}: "${b(a,s)}" by auto\n`);let d=r.eapp(`TLA.in`,[r.eapp(`TLA.fapply`,[m,o]),r.eapp(`TLA.fapply`,[h,o])]);l(t,`have ${u(d)}: "${b(a,d)}"`);let p=S(a,d),g=u(s),_=u(n);l(t,`by (rule zenon_in_product_i [OF ${u(f)} ${_} ${g}])\n`),l(t,`have ${u(i)}: "${b(p,i)}"`);let v=S(p,i);return l(t,`using ${u(d)} by auto\n`),[v,ee(o)]},[v,x]);return le(t,i[0],c)}if(h.kind!==`app`||h.symbol!==`TLA.recordset`)throw p();let C=tO(h.args),w=r.eapp(`TLA.tuple`,C.map(e=>e[0])),T=r.eapp(`TLA.tuple`,C.map(e=>e[1])),ne=te(v,t,w),re=te(ne,t,T),ie=e.slice(2).reduce((e,n)=>{let i=e[0],a=e[1];if(!c.conclusions.includes(n))return[i,ee(a)];let o=r.eapp(`TLA.in`,[a,r.eapp(`TLA.DOMAIN`,[w])]);l(t,`have ${u(o)}: "${b(i,o)}" by auto\n`);let s=r.eapp(`TLA.in`,[r.eapp(`TLA.fapply`,[m,r.eapp(`TLA.fapply`,[w,a])]),r.eapp(`TLA.fapply`,[T,a])]);l(t,`have ${u(s)}: "${b(i,s)}"`);let d=S(i,s),p=u(o);l(t,`by (rule zenon_in_recordset_field [OF ${u(f)} ${p}])\n`),l(t,`have ${u(n)}: "${b(d,n)}"`);let h=S(d,n);return l(t,`using ${u(s)} by auto\n`),[h,ee(a)]},[re,x]);return le(t,ie[0],c)}case`zenon_notin_product`:{if(o.length!==2||s.length!==1)throw p();let e=de(t,te(n,t,o[0]),d,i.subproofs);l(t,`show FALSE using ${u(s[0])} `),c(fe(d)),c(`inProductI[where s="${b(e,o[1])}"] `),c(`by auto
349
+ `);return}case`zenon_notin_recordset`:if(o.length!==2||s.length!==1)throw p();de(t,te(n,t,o[0]),d,i.subproofs),l(t,`show FALSE by (rule notE [OF ${u(s[0])}],\n`),l(t,` rule zenon_inrecordsetI${d.length-2} [OF `),c(fe(d)),c(`])
350
+ `);return;case`zenon_tuple_notisaseq`:case`zenon_record_notisafcn`:if(o.length!==0||s.length!==1||d.length!==0)throw p();l(t,`show FALSE using ${u(s[0])} by auto\n`);return;case`zenon_record_neq_match`:l(t,`sorry
351
+ `);return;case`zenon_neq_record`:case`zenon_record_neq`:if(o.length!==2||s.length!==1||d.length<2)throw p();l(t,`sorry
352
+ `);return}if(d.length===0)l(t,`show FALSE
353
+ `),l(t,`by (rule ${a.name} [of ${se(n,o)}, OF ${ce(s)}])\n`);else{if(d.length===1)return T(t,n,d[0],rO(i),(e,t)=>`by (rule ${a.name}_${t} [of ${se(e,o)}, OF ${ce(s)}])\n`);l(t,`show FALSE
354
+ `),l(t,`proof (rule ${a.name} [of ${se(n,o)}, OF ${ce(s)}])\n`),w(t,n,d,i.subproofs)}},me=(t,r,i)=>{if(Rw(n.limits)!==void 0)return;let a=i.params.flatMap(t=>{if(t[1].kind===`var`)return[t[1].symbol];if(t[1].kind===`tau`)return[];throw new e(`Zenon: a lemma parameter that is neither a variable nor a tau`)}),o=i.proof.conclusions;l(t,`have ${i.name}: "`),c(a.map(e=>`!!${e}. `).join(``)),c(o.map(e=>`${b(r,e)} ==> `).join(``)),c(`FALSE"`);let s=[],u=o.reduce((e,t)=>{let n=ee(e,t);return s.push(n[0]),n[1]},r);c(s.every(e=>e===`_`)?`
355
+ `:` (is "${s.map(e=>`${e} ==> `).join(``)}FALSE")\n`),l(t,`proof -
356
+ `);for(let e of a)l(aO(t),`fix "${e}"\n`);le(aO(t),C(aO(t),u,o),i.proof),l(t,`qed
357
+ `)},he=o[o.length-1],ge=n.phrases.flatMap(e=>e.kind===`hyp`?[e]:[]),_e=ge.find(e=>e.name===`zenon_G`)?.formula??r.enot(pE);if(_e.kind!==`not`)throw new e(`Zenon: a goal that isn't negated`);let ve=_e.args[0],E=he.proof.conclusions.filter(e=>e!==_e),ye=/* @__PURE__ */ new Map;for(let e of ge)e.name!==``&&ye.set(a(e.formula),e.name);c(`(* PROOF-FOUND *)
358
+ (* BEGIN-PROOF *)
359
+ `),l(0,`proof (rule zenon_nnpp)
360
+ `);let be=/* @__PURE__ */ new Map,xe=e=>{let t=e.rule;if(t.kind===`extension`&&t.name===`zenon_case`){let e=t.branches.length-1,n=iO(t.branches);e>5&&be.set(`0 ${String(e).padStart(9,`0`)} ${+!!n}`,mD(e,n))}if(t.kind===`extension`&&t.name===`zenon_notin_recordset`){let e=t.branches.length-2;e>7&&be.set(`1 ${String(e).padStart(9,`0`)}`,hD(e))}e.subproofs.forEach(xe)};[he,...o.slice(0,-1)].forEach(e=>xe(e.proof));for(let e of[...be.keys()].sort())c(be.get(e)??``);let Se=aO(0),Ce=E.reduce((e,t)=>{l(Se,`have ${u(t)}:"${b(e,t)}"`);let n=S(e,t),r=ye.get(a(t));return l(Se,r===void 0?`by fact
361
+ `:`using ${r} by blast\n`),n},0);for(let e of o.slice(0,-1))me(Se,Ce,e);return le(Se,C(Se,Ce,[r.enot(ve)]),he.proof),l(0,`qed
362
+ `),c(`(* END-PROOF *)
363
+ `),Rw(n.limits)===void 0?s.join(``):void 0},sO=[`<=>`,`-.`,`/\\`,`\\/`,`=>`,`<=`,`=`],cO=/* @__PURE__ */ new Set([`T.`,`F.`,`A.`,`E.`,`t.`]),lO=[`$fixpoint`,`$include`,`$indprop`,`$indset`,`$match`,`$goal`,`$self`,`$def`,`$fix`,`$hyp`,`$let`,`$sig`],uO=/[A-Za-z_0-9]/,dO=/[A-Za-z0-9_'.]/,fO=/^\\([abfnrtv'"\\?]|x[0-9A-Fa-f]{2})/,pO=t=>{let n=[],r=1,i=0;for(;i<t.length;){let a=t[i];if(a===`
364
+ `||a===`\r`)r+=a===`\r`&&t[i+1]===`
365
+ `?0:1,i++;else if(a===` `||a===` `||a===`\f`)i++;else if(a===`#`||a===`;`)for(;i<t.length&&t[i]!==`
366
+ `&&t[i]!==`\r`;)i++;else if(a===`(`||a===`)`)n.push({kind:a===`(`?`open`:`close`,text:a,line:r}),i++;else if(a===`$`){let a=/^\$[0-9]+/.exec(t.slice(i,i+32)),o=lO.find(e=>t.startsWith(e,i));if(a!==null)n.push({kind:`int`,text:a[0].slice(1),line:r}),i+=a[0].length;else if(o!==void 0)n.push({kind:`keyword`,text:o,line:r}),i+=o.length;else throw new e(`Zenon: line ${r}: bad character '$'`)}else if(a===`"`){let a=i+1;for(;a<t.length&&t[a]!==`"`;){let n=t[a]===`\\`?fO.exec(t.slice(a,a+4)):null;if(t[a]===`\\`&&n===null)throw new e(`Zenon: line ${r}: bad escape in string`);if(n===null&&(t.charCodeAt(a)<32||t.charCodeAt(a)>=127))throw new e(`Zenon: line ${r}: bad character in string`);a+=n===null?1:n[0].length}if(a>=t.length)throw new e(`Zenon: line ${r}: unterminated string`);n.push({kind:`string`,text:t.slice(i+1,a),line:r}),i=a+1}else if(uO.test(a)){let e=i+1;for(;e<t.length&&dO.test(t[e]);)e++;let a=t.slice(i,e);n.push({kind:cO.has(a)?`keyword`:`ident`,text:a,line:r}),i=e}else{let o=sO.find(e=>t.startsWith(e,i));if(o===void 0)throw new e(`Zenon: line ${r}: bad character '${a}'`);n.push({kind:`operator`,text:o,line:r}),i+=o.length}}return n.push({kind:`end`,text:``,line:r}),n},mO=(e,t,n)=>n.length===0?t:e(t,mO(e,n[0],n.slice(1))),hO=(t,n)=>{let r={"A.":t.eall,"E.":t.eex},i={"/\\":t.eand,"\\/":t.eor,"=>":t.eimply,"<=":(e,n)=>t.eimply(n,e),"<=>":t.eequiv},a=pO(n),o=0,s=(e=0)=>a[o+e],c=()=>a[o++],l=(t,n)=>{let r=c();if(r.kind!==t||n!==void 0&&r.text!==n)throw new e(`Zenon: line ${r.line}: syntax error`);return r},u=(e,t)=>s().kind===e&&(t===void 0||s().text===t),d=()=>{l(`open`);let e=[];for(;u(`ident`);)e.push(c().text);let t=u(`string`)?c().text:`zenon_U`;l(`close`);let n=m();return l(`close`),{names:e,type:t,body:n}},f=(e,n)=>n.names.reduceRight((r,i)=>e(t.evar(i),n.type,r),n.body),p=()=>{let e=[];for(;!u(`close`);)e.push(m());return e},m=()=>{let n=c();if(n.kind===`ident`)return t.evar(n.text);if(n.kind===`string`)return t.eapp(`$string`,[t.evar(`"${n.text}"`)]);if(n.kind===`keyword`&&n.text===`T.`)return fE;if(n.kind===`keyword`&&n.text===`F.`)return pE;if(n.kind!==`open`)throw new e(`Zenon: line ${n.line}: syntax error`);let a=c();if(a.kind===`open`)return o--,f(t.elam,d());if(a.kind===`ident`){let e=p();return l(`close`),t.eapp(a.text,e)}if(a.kind===`operator`&&a.text===`-.`){let e=m();return l(`close`),t.enot(e)}if(a.kind===`operator`&&a.text===`=`){let e=m(),n=m();return l(`close`),t.eapp(`=`,[e,n])}if(a.kind===`operator`){let e=m(),t=p();return l(`close`),mO(i[a.text],e,t)}if(a.kind===`keyword`&&(a.text===`T.`||a.text===`F.`))return l(`close`),a.text===`T.`?fE:pE;if(a.kind===`keyword`&&a.text in r){l(`open`);let e=d();return l(`close`),f(r[a.text],e)}if(a.kind===`keyword`&&a.text===`t.`){l(`open`);let n=d();if(l(`close`),n.names.length!==1)throw new e(`Zenon: line ${a.line}: syntax error`);return t.etau(t.evar(n.names[0]),n.type,n.body)}throw new e(`Zenon: line ${a.line}: unsupported construct ${a.text}`)},h=[];for(;!u(`end`);){let n=c();if(n.kind===`keyword`&&n.text===`$hyp`){let e=u(`int`)?Number(c().text):1,t=l(`string`).text;h.push({kind:`hyp`,name:t,formula:m(),goalness:e})}else if(n.kind===`keyword`&&n.text===`$goal`)h.push({kind:`hyp`,name:`zenon_G`,formula:t.enot(m()),goalness:0});else if(n.kind===`keyword`&&n.text===`$def`){let e=l(`string`).text;l(`open`);let n=l(`ident`).text,r=[];for(;u(`ident`);)r.push(t.evar(c().text));l(`close`);let i=m();h.push({kind:`def`,definition:{kind:`real`,name:e,symbol:n,params:r,body:i}})}else throw new e(`Zenon: line ${n.line}: unsupported phrase ${n.text}`)}return h},gO=(e,t)=>e.some(e=>e.symbol===t),_O=(e,t)=>{if(!t.every(e=>e.kind===`var`))return!1;let n=e.map(e=>e.symbol).sort(),r=t.map(e=>e.symbol).sort();return n.length===r.length&&n.every((e,t)=>e===r[t])&&n.every((e,t)=>t===0||e!==n[t-1])},vO=(e,t,n)=>{switch(n.kind){case`var`:return n.symbol!==t||gO(e,n.symbol);case`app`:return n.symbol!==t&&n.args.every(n=>vO(e,t,n));case`all`:case`ex`:case`tau`:case`lam`:return vO([n.args[0],...e],t,n.args[1]);default:return n.args.every(n=>vO(e,t,n))}},yO=e=>{let t=e.kind===`equiv`||e.kind===`app`&&e.symbol===`=`?e.args:void 0;if(t===void 0||t.length!==2)return[];let n=t[0],r=t[1],i=(e,t)=>e.kind===`app`?[{symbol:e.symbol,params:e.args,body:t}]:e.kind===`var`?[{symbol:e.symbol,params:void 0,body:t}]:[],a=[...i(n,r),...i(r,n)],o=a.filter(e=>e.params!==void 0),s=a.filter(e=>e.params===void 0);return e.kind===`equiv`?[...o,...s]:[...s,...o]},bO=(e,t)=>e.kind===`all`?bO(e.args[1],[e.args[0],...t]):{env:t,body:e},xO=(e,t)=>{let n=bO(t.formula,[]),r=yO(n.body),i=r.find(t=>!e.includes(t.symbol));if(i===void 0||!(i.params===void 0?n.env.length===0:_O(n.env,i.params))||!vO([],i.symbol,i.body))return;let a=r.find(t=>!e.includes(t.symbol)&&(t.params===void 0||_O(n.env,t.params)));return a&&{kind:`pseudo`,origin:t.formula,goalness:t.goalness,symbol:a.symbol,params:a.params??[],body:a.body}},SO=(e,t,n)=>{switch(n.kind){case`var`:return gO(e,n.symbol)?t:[n.symbol,...t];case`app`:return n.args.reduce((t,n)=>SO(e,t,n),[n.symbol,...t]);case`all`:case`ex`:case`tau`:case`lam`:return SO([n.args[0],...e],t,n.args[1]);default:return n.args.reduce((t,n)=>SO(e,t,n),t)}},CO=(e,t)=>e.flatMap(e=>t.find(t=>t[0]===e)?.[1]??[]),wO=(e,t,n)=>t.length>0&&(t.includes(e)||wO(e,CO(t,n),n)),TO=(e,t)=>{let n=[],r=[],i=[],a=[];for(let o of t){if(o.kind===`def`){i.unshift(o.definition);continue}let t={formula:o.formula,goalness:o.goalness},s=xO(e,t);if(s===void 0){a.unshift(t);continue}let c=s.symbol,l=[c,SO(s.params,[],s.body)],u=i.findIndex(e=>e.kind===`pseudo`&&e.symbol===c),d=i[u];if(r.includes(c)||wO(c,l[1],n))a.unshift(t);else if(d?.kind===`pseudo`){i=[...i.slice(0,u).reverse(),...i.slice(u+1)];let e=n.findIndex(e=>e[0]===c);n=n.filter((t,n)=>n!==e),r.unshift(c),a.unshift(t,{formula:d.origin,goalness:d.goalness})}else n.unshift(l),i.unshift(s)}return{definitions:i.reverse(),hypotheses:a.reverse()}},EO=(e,t)=>({head:e,tail:t}),DO=e=>{let t;for(let n=e;n!==void 0;n=n.tail)t=EO(n.head,t);return t},OO=e=>e.size+e.metas.length*5+Math.floor(e.taus/8),kO=(e,t,n)=>{if(e===void 0)return{entry:t,left:void 0,right:void 0};let r=t.size<e.entry.size,i=r?t:e.entry,a=r?e.entry:t,o=Math.floor(n/2);return n%2==0?{entry:i,left:kO(e.left,a,o),right:e.right}:{entry:i,left:e.left,right:kO(e.right,a,o)}},AO=(e,t)=>({tree:kO(e.tree,t,e.path),path:e.path+1}),jO=e=>{if(e.left===void 0)return[e.entry,e.right];if(e.right===void 0)return[e.entry,e.left];let t=e.left.entry.size<e.right.entry.size,n=t?e.left:e.right,r=t?e.right:e.left,i=jO(n);return[e.entry,{entry:i[0],left:i[1],right:r}]},MO=e=>{if(e.tree===void 0)return;let t=jO(e.tree);return[t[0].node,{tree:t[1],path:e.path}]},NO={prop1:void 0,prop2:void 0,unary:void 0,binary:void 0,nary:void 0,eqFront:void 0,eqBack:void 0,eqCount:10,instState:0,instSize:void 0,instFront:void 0,instBack:void 0,insertedCount:0},PO=(e,t)=>{let n=t.node.goalness,r={tree:void 0,path:0};for(let t=e;t!==void 0;t=t.tail)if(t.head[0]===n){r=t.head[1];break}let i=[n,AO(r,t)],a=e=>e===void 0?EO(i,void 0):e.head[0]===n?EO(i,e.tail):e.head[0]>n?EO(i,e):EO(e.head,a(e.tail));return a(e)},FO=(e,t)=>{switch(t.kind){case`var`:case`true`:case`false`:return!0;case`meta`:return!t.args[0].metas.includes(e);case`all`:case`ex`:case`tau`:case`lam`:return FO(e,t.args[1]);default:return t.args.every(t=>FO(e,t))}},IO=(e,t)=>{let n={...e,insertedCount:e.insertedCount+1},r=t.priority;if(r===`prop`)return t.branches.length<2?{...n,prop1:EO(t,n.prop1)}:{...n,prop2:EO(t,n.prop2)};if(r===`arity`){let e=t.branches.length;return e===0?{...n,prop1:EO(t,n.prop1)}:e===1?{...n,unary:EO(t,n.unary)}:e===2?{...n,binary:EO(t,n.binary)}:{...n,nary:EO(t,n.nary)}}if(r===`arity_eq`)return{...n,eqBack:EO(t,n.eqBack)};let i=t.rule,a=i.name===`all`?i.args[0]:i.name===`not_ex`&&i.args[0].kind===`not`?i.args[0].args[0]:void 0;return(i.name===`all`||i.name===`not_ex`)&&a!==void 0&&FO(a,i.args[1])?{...n,instBack:EO(t,n.instBack),instSize:PO(n.instSize,{node:t,size:OO(i.args[1])})}:{...n,instBack:EO(t,n.instBack)}},LO=(e,t)=>{if(t===void 0)return;if(t.head[0]<e){let n=LO(e,t.tail);return n&&[n[0],EO(t.head,n[1])]}let n=MO(t.head[1]);return n===void 0?LO(e,t.tail):[n[0],EO([t.head[0],n[1]],t.tail)]},RO=(e,t)=>{if(e%2==0)return LO(0,t);let n=0,r;for(let e=t;e!==void 0;e=e.tail){let t=e.head[1].tree?.entry;t!==void 0&&(r===void 0||t.size<r)&&(n=e.head[0],r=t.size)}return LO(n,t)},zO=e=>{for(let t=e;t!==void 0;t=t.tail)if(t.head[1].tree!==void 0)return!1;return!0},BO=e=>{if(e.eqFront!==void 0)return[e.eqFront.head,{...e,eqFront:e.eqFront.tail}];if(e.eqBack===void 0)return;let t=DO(e.eqBack);return t&&[t.head,{...e,eqFront:t.tail,eqBack:void 0}]},VO=e=>{if(e.instState<16){let t=RO(e.instState,e.instSize);return t===void 0?VO({...e,instState:16}):[t[0],{...e,instState:e.instState+1,instSize:t[1]}]}return e.instFront===void 0?e.instBack===void 0?zO(e.instSize)?void 0:VO({...e,instState:0}):VO({...e,instFront:DO(e.instBack),instBack:void 0}):[e.instFront.head,{...e,instFront:e.instFront.tail,instState:(e.instState+1)%18}]},HO=e=>{if(e.prop1!==void 0)return[e.prop1.head,{...e,prop1:e.prop1.tail}];if(e.prop2!==void 0)return[e.prop2.head,{...e,prop2:e.prop2.tail}];if(e.unary!==void 0)return[e.unary.head,{...e,unary:e.unary.tail}];if(e.binary!==void 0)return[e.binary.head,{...e,binary:e.binary.tail}];if(e.nary!==void 0)return[e.nary.head,{...e,nary:e.nary.tail}];if(e.eqCount>0){let t={...e,eqCount:e.eqCount-1};return BO(t)??VO(t)}let t={...e,eqCount:10};return VO(t)??BO(t)},UO=e=>{let t=e;for(;t.tail!==void 0;)t=t.tail;return t.head},WO=e=>e.prop1?.head??e.prop2?.head??e.unary?.head??e.binary?.head??e.nary?.head??e.eqFront?.head??(e.eqBack&&UO(e.eqBack))??e.instFront?.head??(e.instBack&&UO(e.instBack)),$=(e,t)=>({name:e,args:t}),GO=(e,t,n)=>({name:e,relation:t,args:n}),KO=(t,n,r,i,a)=>{if(r.kind===`all`){let e=t.substitute([[r.args[0],i]],r.args[1]);return IO(n,xA([r],$(`all`,[r,i]),{instance:r},a,[[e]]))}if(r.kind===`ex`){let e=t.substitute([[r.args[0],i]],t.enot(r.args[1])),o=t.enot(r);return IO(n,xA([o],$(`not_ex`,[o,i]),{instance:r},a,[[e]]))}if(r.kind===`app`)return n;throw new e(`Zenon: make_inst on a formula that isn't quantified`)},qO=(e,t,n)=>t.map((t,r)=>[SA(e,t,n[r])]),JO=(e,t)=>{if(e.kind===`meta`||t.kind===`meta`)return!0;if(e.kind!==t.kind)return!1;switch(e.kind){case`var`:return e.symbol===t.symbol;case`app`:return e.symbol===t.symbol;case`not`:return t.kind===`not`&&JO(e.args[0],t.args[0]);case`and`:case`or`:case`imply`:case`equiv`:{let n=t.args;return JO(e.args[0],n[0])||JO(e.args[1],n[1])}case`true`:case`false`:return!0;case`tau`:return e===t;default:return!1}},YO=(e,t,n,r,i)=>{let a=r[0],o=i[0],s=o.args[0],c=a.args,l=s.args;if(Z(a,`TLA.in`,2)&&c[1].kind===`var`&&l.length===2&&c[1]!==l[1]&&!EE(c[0])&&!EE(c[1])&&!EE(l[0])&&!EE(l[1])&&c[0]!==l[0]||n&&l.length!==2||c.length!==l.length)return t;let u=c.every((e,t)=>JO(e,l[t]))?a.symbol===`=`?`arity_eq`:`arity`:{instance:a};return IO(t,xA([a,o],n?GO(`p_not_p_sym`,a.symbol,[a,o]):$(`p_not_p`,[a,o]),u,Math.min(r[1],i[1]),qO(e,n?[...c].reverse():c,l)))},XO=e=>Z(e,`$string`,1)?e.args[0]:void 0,ZO=(e,t,n,r)=>{let i=e.exprs;if(!Z(n,`=`,2))return[t,!1];let a=XO(n.args[1])!==void 0;if(!a&&XO(n.args[0])===void 0)return[t,!1];let o=a?n.args[1]:n.args[0],s=a?n.args[0]:n.args[1],c=a?[`stringdiffll`,`stringdifflr`]:[`stringdiffrl`,`stringdiffrr`],l=t,u=(e,t,a)=>{for(let c of a){let a=i.eapp(`$string`,[i.evar(c[1])]),u=i.eapp(`=`,t?[a,c[0]]:[c[0],a]);o!==a&&(l=IO(l,xA([n,u],$(e,[s,o,c[0],a]),`prop`,r,[[SA(i,s,c[0])]])))}};return u(c[0],!1,e.index.getStringEqualities()),u(c[1],!0,e.index.getReversedStringEqualities()),[l,!1]},QO=(e,t,n,r)=>{let i=e.exprs;if(n.kind!==`not`)return[t,!1];let a=n.args[0];if(a.kind!==`app`||a.args.length!==2)return[t,!1];let o=a.args[0],s=a.args[1];return a.symbol===`=`?o.kind===`meta`&&s.kind===`meta`?[KO(i,KO(i,t,s.args[0],o,r),o.args[0],s,r),!1]:o.kind===`meta`?[KO(i,t,o.args[0],s,r),!1]:s.kind===`meta`?[KO(i,t,s.args[0],o,r),!1]:[t,!1]:e.relations.isReflexive(a.symbol)?[IO(t,xA([n],GO(`refl`,a.symbol,[o,s]),`arity`,r,[[SA(i,o,s)]])),!1]:[t,!1]},$O=(e,t,n,r)=>{let i=e.exprs;if(n.kind!==`not`||!Z(n.args[0],`=`,2))return[t,!1];let a=n.args[0].args[0],o=n.args[0].args[1],s=XO(a),c=XO(o);return s!==void 0&&c!==void 0&&s!==c||a.kind!==`app`||o.kind!==`app`||a.symbol!==o.symbol||a.args.length!==o.args.length?[t,!1]:[IO(t,xA([n],$(`not_equal`,[a,o]),`arity`,r,qO(i,a.args,o.args))),!1]},ek=(e,t,n,r)=>{let i=n[0],a=r[0].args[0],o=i.symbol,s=i.args[0],c=i.args[1],l=a.args[0],u=a.args[1],d=t?[u,s,c,l]:[l,s,c,u];return xA([i,r[0]],$(t?`trans_sym`:`trans`,[i,r[0]]),o===`=`?`arity_eq`:`arity`,Math.min(n[1],r[1]),[[SA(e,d[0],d[1]),e.enot(e.eapp(o,[d[0],d[1]]))],[SA(e,d[2],d[3]),e.enot(e.eapp(o,[d[2],d[3]]))]])},tk=(e,t,n,r)=>{let i=e.exprs,a=n[0].args[0],o=n[0].args[1],s=r[0].args[0],c=s.symbol,l=s.args[0],u=s.args[1],d=e.relations.isSymmetric(c),f=t?d?[u,a,o,l]:[l,o,a,u]:[l,a,o,u],p=i.enot(i.eapp(c,[f[0],f[1]])),m=i.enot(i.eapp(c,[f[2],f[3]])),h=t?d?`trans_eq_sym`:`trans_eq2`:`trans_eq`;return xA([n[0],r[0]],$(h,[a,o,r[0]]),c===`=`?`arity_eq`:`arity`,Math.min(n[1],r[1]),[[SA(i,f[0],f[1]),p],[p,m],[SA(i,f[2],f[3]),m]])},nk=(e,t,n,r)=>{let i=e.exprs,a=e.index,o=e.relations;if(DE(n)&&n.symbol===`=`){let i=[n,r],o=t=>n=>tk(e,t,i,n),s=n.args[0],c=n.args[1];if(s.kind===`meta`&&c.kind===`meta`)return[CA(t,a.findNegative(`=`).filter(e=>OE(e[0])).map(o(!1))),!1];if(!a.addTrans(n))return[t,!1];let l=JE(s),u=JE(c);return l===void 0||u===void 0?[t,!1]:[CA(t,[...a.findAllNegTransLeft(l).map(o(!1)),...a.findAllNegTransLeft(u).map(o(!0)),...a.findAllNegTransRight(l).map(o(!0)),...a.findAllNegTransRight(u).map(o(!1))]),!1]}if(DE(n)&&o.isTransitive(n.symbol)){let e=[n,r],s=t=>n=>ek(i,t,e,n);if(!a.addTrans(n))return[t,!1];let c=n.symbol,l=JE(n.args[0]),u=JE(n.args[1]);if(l===void 0||u===void 0)return[t,!1];let d=o.isSymmetric(c);return[CA(t,[...a.findNegTransLeft(c,l).map(s(!1)),...(d?a.findNegTransLeft(c,u):[]).map(s(!0)),...(d?a.findNegTransRight(c,l):[]).map(s(!0)),...a.findNegTransRight(c,u).map(s(!1))]),!1]}if(!OE(n))return[t,!1];let s=n.args[0];if(!o.isTransitive(s.symbol))return[t,!1];let c=[n,r],l=e=>t=>ek(i,e,t,c),u=t=>n=>tk(e,t,n,c),d=s.symbol;a.addNegTrans(n);let f=JE(s.args[0]),p=JE(s.args[1]);if(f===void 0||p===void 0)return[t,!1];let m=o.isSymmetric(d),h=[...a.findTransLeft(d,f).map(l(!1)),...(m?a.findTransRight(d,f):[]).map(l(!0)),...(m?a.findTransLeft(d,p):[]).map(l(!0)),...a.findTransRight(d,p).map(l(!1))],g=d===`=`?[]:[...a.findTransLeft(`=`,f).map(u(!1)),...a.findTransRight(`=`,f).map(u(!0)),...a.findTransLeft(`=`,p).map(u(!0)),...a.findTransRight(`=`,p).map(u(!1))];return[CA(t,[...g.reverse(),...h]),!1]},rk=(e,t,n,r)=>{let i=[n,r],a=n.kind===`not`?n.args[0]:n;return a.kind!==`app`||a.args.length!==2||a.symbol===`=`||!e.relations.isSymmetric(a.symbol)?[t,!1]:n.kind===`not`?[e.index.findPositive(a.symbol).reduce((t,i)=>YO(e.exprs,t,!0,i,[n,r]),t),!1]:[e.index.findNegative(a.symbol).reduce((t,n)=>YO(e.exprs,t,!0,i,n),t),!1]},ik=(e,t,n,r)=>{let i=[n,r],a=n.kind===`not`?n.args[0]:n;return a.kind!==`app`||a.symbol===`=`?[t,!1]:n.kind===`not`?[e.index.findPositive(a.symbol).reduce((t,i)=>YO(e.exprs,t,!1,i,[n,r]),t),!0]:[e.index.findNegative(a.symbol).reduce((t,n)=>YO(e.exprs,t,!1,i,n),t),!0]},ak=(e,t)=>t<=0?0:e.kind===`and`?ak(e.args[1],ak(e.args[0],t)):e.kind===`not`?ok(e.args[0],t):t-1,ok=(e,t)=>t<=0?0:e.kind===`or`?ok(e.args[1],ok(e.args[0],t)):e.kind===`imply`?ok(e.args[1],ak(e.args[0],t)):e.kind===`not`?ak(e.args[0],t):t-1,sk=(e,t,n,r)=>r.kind===`and`?sk(e,t,sk(e,t,n,r.args[1]),r.args[0]):r.kind===`not`?ck(e,!t,n,r.args[0]):[t?e.enot(r):r,...n],ck=(e,t,n,r)=>r.kind===`or`?ck(e,t,ck(e,t,n,r.args[1]),r.args[0]):r.kind===`imply`?sk(e,!t,ck(e,t,n,r.args[1]),r.args[0]):r.kind===`not`?sk(e,!t,n,r.args[0]):[t?e.enot(r):r,...n],lk=(e,t,n,r)=>{let i=e.exprs;if(n.kind===`not`&&e.index.isMember(n.args[0]))return[IO(t,xA([n,n.args[0]],$(`close`,[n.args[0]]),`prop`,r,[])),!0];let a=i.enot(n);return e.index.isMember(a)?[IO(t,xA([n,a],$(`close`,[n]),`prop`,r,[])),!0]:[t,!1]},uk=(e,t,n,r)=>{let i=e.exprs,a=(e,n)=>[IO(t,xA(e,n,`prop`,r,[])),!0];if(n.kind===`false`)return a([n],$(`false`,[]));let o=n.kind===`not`?n.args[0]:void 0;if(o?.kind===`true`)return a([n],$(`not_true`,[]));let s=e.relations;if(o?.kind===`app`&&o.args.length===2&&s.isReflexive(o.symbol)&&o.args[0]===o.args[1])return a([n],GO(`close_refl`,o.symbol,[o.args[0]]));if(n.kind===`app`&&n.args.length===2&&s.isSymmetric(n.symbol)){let t=i.enot(i.eapp(n.symbol,[n.args[1],n.args[0]]));if(e.index.isMember(t))return a([n,t],GO(`close_sym`,n.symbol,[n.args[0],n.args[1]]))}if(o?.kind===`app`&&o.args.length===2&&s.isSymmetric(o.symbol)){let t=i.eapp(o.symbol,[o.args[1],o.args[0]]);if(e.index.isMember(t))return a([n,t],GO(`close_sym`,o.symbol,[o.args[1],o.args[0]]))}if(Z(n,`=`,2)){let e=XO(n.args[0]),t=XO(n.args[1]);if(e!==void 0&&t!==void 0&&e!==t)return a([n],$(`stringequal`,[e,t]))}return[t,!1]},dk=(e,t,n,r)=>{let i=e.exprs,a=n.kind===`not`?n.args[0]:void 0;return(n.kind===`and`||a?.kind===`or`||a?.kind===`imply`)&&ak(n,3)===0?[IO(t,xA([n],$(`conj_tree`,[n]),`prop`,r,[sk(i,!1,[],n)])),!0]:(n.kind===`or`||a?.kind===`and`||n.kind===`imply`)&&ok(n,3)===0?[IO(t,xA([n],$(`disj_tree`,[n]),`prop`,r,ck(i,!1,[],n).map(e=>[e]))),!0]:[t,!1]},fk=(e,t,n,r)=>{let i=e.exprs,a=(e,i)=>[IO(t,xA([n],e,`prop`,r,[i])),!0];if(n.kind===`and`)return a($(`and`,[n.args[0],n.args[1]]),[n.args[0],n.args[1]]);if(n.kind!==`not`)return[t,!1];let o=n.args[0];return o.kind===`not`?a($(`not_not`,[o.args[0]]),[o.args[0]]):o.kind===`or`?a($(`not_or`,[o.args[0],o.args[1]]),[i.enot(o.args[0]),i.enot(o.args[1])]):o.kind===`imply`?a($(`not_impl`,[o.args[0],o.args[1]]),[o.args[0],i.enot(o.args[1])]):[t,!1]},pk=(e,t,n,r)=>{let i=e.exprs,a=(e,i)=>[IO(t,xA([n],e,`prop`,r,i)),!0];if(n.kind===`or`||n.kind===`imply`||n.kind===`equiv`){let e=n.args[0],t=n.args[1];return n.kind===`or`?a($(`or`,[e,t]),[[e],[t]]):n.kind===`imply`?a($(`impl`,[e,t]),[[i.enot(e)],[t]]):a($(`equiv`,[e,t]),[[i.enot(e),i.enot(t)],[e,t]])}if(n.kind!==`not`)return[t,!1];let o=n.args[0];if(o.kind!==`and`&&o.kind!==`equiv`)return[t,!1];let s=o.args[0],c=o.args[1];return o.kind===`and`?a($(`not_and`,[s,c]),[[i.enot(s)],[i.enot(c)]]):a($(`not_equiv`,[s,c]),[[i.enot(s),c],[s,i.enot(c)]])},mk=(e,t,n,r)=>{let i=e.exprs;if(n.kind===`ex`){let e=n.args[0],a=n.args[1],o=i.substitute([[e,i.etau(e,n.symbol,a)]],a);return[IO(t,xA([n],$(`ex`,[n]),`prop`,r,[[o]])),!0]}if(n.kind!==`not`||n.args[0].kind!==`all`)return[t,!1];let a=n.args[0],o=a.args[0],s=i.enot(a.args[1]),c=i.substitute([[o,i.etau(o,a.symbol,s)]],s),l=i.eex(o,a.symbol,s);return[IO(t,xA([n],$(`not_all_ex`,[n]),`prop`,r,[[c,l]])),!0]},hk=(e,t,n,r)=>{let i=e.exprs;if(n.kind===`all`){let e=i.emeta(n),a=i.substitute([[n.args[0],e]],n.args[1]);return[IO(t,xA([n],$(`all`,[n,e]),`arity`,r,[[a]])),!0]}if(n.kind!==`not`||n.args[0].kind!==`ex`)return[t,!1];let a=n.args[0],o=i.emeta(a),s=i.enot(i.substitute([[a.args[0],o]],a.args[1]));return[IO(t,xA([n],$(`not_ex`,[n,o]),`arity`,r,[[s]])),!0]},gk=(e,t,n,r,i,a,o)=>{let s=i.params,c=i.body,l=e=>[IO(t,xA([n],{name:`definition`,definition:i,args:[n,e]},`prop`,r,[[e]])),!0];if(s.length===0&&a!==void 0&&c.kind===`var`)return l(o(e.eapp(c.symbol,a)));let u=a??[];if(s.length!==u.length)return[t,!1];let d=e.substituteSecondOrder(s.map((e,t)=>[e,u[t]]),c);return d===void 0?[t,!1]:l(o(d))},_k=(e,t,n,r)=>{let i=e.exprs,a=e.index,o=e.relations.isAny,s=n.kind===`not`,c=s?n.args[0]:n,l=e=>s?i.enot(e):e,u=(e,o)=>{let s=e.kind===`app`||e.kind===`var`?a.getDefinition(e.symbol):void 0;return s===void 0?void 0:gk(i,t,n,r,s,e.kind===`app`?e.args:void 0,o)};for(let e of[`app`,`var`]){if(c.kind===e){let e=u(c,l);if(e!==void 0)return e}if(c.kind!==`app`||c.args.length!==2||!o(c.symbol))continue;let t=c.args[0],n=c.args[1];if(t.kind===e){let e=u(t,e=>l(i.eapp(c.symbol,[e,n])));if(e!==void 0)return e}if(n.kind===e){let e=u(n,e=>l(i.eapp(c.symbol,[t,e])));if(e!==void 0)return e}}return[t,!1]},vk=(e,t,n)=>{let r=n.kind===`not`?n.args[0]:n;return[t,r.kind===`var`||r.kind===`tau`||n.kind===`true`||n.kind===`not`&&r.kind===`false`]},yk=[`TLA.emptyset`,`TLA.upair`,`TLA.addElt`,`TLA.set`,`TLA.infinity`,`TLA.SUBSET`,`TLA.UNION`,`TLA.INTER`,`TLA.cup`,`TLA.cap`,`TLA.setminus`,`TLA.subsetOf`,`TLA.setOfAll`,`TLA.FuncSet`,`TLA.DOMAIN`,`TLA.Product`,`arith.N`,`arith.Z`,`arith.R`,`arith.natrange`,`arith.intrange`,`TLA.Seq`,`TLA.recordset`],bk=[`TLA.Fcn`,`TLA.except`,`TLA.oneArg`,`TLA.extend`],xk=[`TLA.in`,`TLA.isAFcn`,`TLA.cond`,`TLA.CASE`,`TLA.tuple`,`TLA.record`,`TLA.fapply`,`TLA.box`];[...yk,...bk,...xk];const Sk=(e,t)=>e.kind===`var`&&e.symbol===t,Ck=(e,t)=>(t.kind===`var`||t.kind===`app`)&&e.includes(t.symbol),wk=e=>Z(e,`$notequiv`),Tk=e=>Z(e,`$string`),Ek=(e,t,n)=>e.eapp(`=`,[t,n]),Dk=(e,t,n)=>e.eapp(`TLA.in`,[t,n]),Ok=(e,t,n)=>e.eapp(`TLA.fapply`,[t,n]),kk=(e,t)=>e.eapp(`TLA.DOMAIN`,[t]),Ak=e=>e.map(e=>[e]),jk=(e,t)=>{let n=e.evar(`0`);for(let r=0;r<t;r++)n=Ok(e,e.evar(`TLA.Succ`),n);return n},Mk=(e,t)=>Tk(e)&&Z(t,`TLA.set`)&&t.args.every(t=>Tk(t)&&t!==e),Nk=e=>{let t=[];for(let n=0;n+1<e.length;n+=2)t.push([e[n],e[n+1]]);return t},Pk=(e,t,n)=>{let r=t.kind===`not`?t.args[0]:t;return{context:e,formula:t,goalness:n,isNegated:t.kind===`not`,atom:r,relation:DE(r)?r:void 0}},Fk=(e,t,n,r)=>[{conclusions:[e.formula],rule:n,priority:t,goalness:e.goalness,branches:r}],Ik=(t,n,r,i)=>{let a=t.context.exprs,o=t.goalness;if(r.kind===`all`)return[{conclusions:[r],rule:$(`all`,[r,i]),priority:n,goalness:o,branches:[[a.substitute([[r.args[0],i]],r.args[1])]]}];if(r.kind===`ex`){let e=a.enot(r);return[{conclusions:[e],rule:$(`not_ex`,[e,i]),priority:n,goalness:o,branches:[[a.substitute([[r.args[0],i]],a.enot(r.args[1]))]]}]}throw new e(`Zenon: instantiating a formula that isn't quantified`)},Lk=e=>{let t=e.context.exprs,n=e.formula,r=e.isNegated,i=e.relation,a=(t,n,r)=>Fk(e,t,n,r);if(i?.symbol===`TLA.in`){let e=i.args[0],o=i.args[1];if(Z(o,`TLA.FuncSet`,2)){let i=e,s=o.args[0],c=o.args[1],l=t.eapp(`TLA.isAFcn`,[i]),u=Ek(t,kk(t,i),s),d=t.newVar(),f=t.eall(d,``,t.eimply(Dk(t,d,s),Dk(t,Ok(t,i,d),c)));if(!r){let e=$(`in_funcset`,[n,l,u,f,i,s,c]);return[...a(`arity`,e,[[l,u]]),...a({instance:f},e,[[l,u,f]])]}let p=t.enot(l),m=t.enot(u),h=t.enot(f),g=i.kind===`app`&&bk.includes(i.symbol)?`arity`:{instance:h};return[...Z(i,`TLA.except`,3)?a(`arity`,$(`except_notin_funcset`,[n,t.enot(Dk(t,i.args[0],t.eapp(`TLA.FuncSet`,[s,c]))),t.enot(Dk(t,i.args[2],c)),i.args[0],i.args[1],i.args[2],s,c]),[[t.enot(Dk(t,i.args[0],t.eapp(`TLA.FuncSet`,[s,c])))],[t.enot(Dk(t,i.args[2],c))]]):[],...a(g,$(`notin_funcset`,[n,p,m,h,i,s,c]),[[p],[m],[h]])]}}},Rk=e=>{let t=e.context.exprs,n=e.formula,r=e.isNegated,i=e.atom,a=e.relation,o=(t,n,r)=>Fk(e,t,n,r);if(r&&Z(i,`TLA.isAFcn`,1)){let e=i.args[0];if(Z(e,`TLA.Fcn`,2))return o(`prop`,$(`notisafcn_fcn`,[n,e.args[0],e.args[1]]),[]);if(Z(e,`TLA.except`,3))return o(`prop`,$(`notisafcn_except`,[n,e.args[0],e.args[1],e.args[2]]),[]);if(Z(e,`TLA.oneArg`,2))return o(`prop`,$(`notisafcn_onearg`,[n,e.args[0],e.args[1]]),[]);if(Z(e,`TLA.extend`,2))return o(`prop`,$(`notisafcn_extend`,[n,e.args[0],e.args[1]]),[])}if(a?.symbol!==`=`)return;let s=a.args[0],c=a.args[1];if(Ck(bk,s)||Ck(bk,c)){let e=t.newVar(),i=Ek(t,kk(t,s),kk(t,c)),a=Ek(t,Ok(t,s,e),Ok(t,c,e));if(!r){let r=t.eequiv(t.eapp(`TLA.isAFcn`,[s]),t.eapp(`TLA.isAFcn`,[c])),l=t.eall(e,``,a),u=t.eand(t.eand(r,i),l);return o({instance:l},$(`funequal`,[n,u,s,c]),[[u]])}let l=t.eall(e,``,t.eimply(Dk(t,e,kk(t,c)),a)),u=t.enot(t.eand(t.eand(t.eand(t.eapp(`TLA.isAFcn`,[s]),t.eapp(`TLA.isAFcn`,[c])),i),l));return o({instance:l},$(`notfunequal`,[n,u,s,c]),[[u]])}},zk=e=>Z(e,`$string`,1)&&e.args[0].kind===`var`?e.args[0].symbol:void 0,Bk=e=>{for(let t=0;t+1<e.length;t++){let n=e[t][0],r=e[t+1][0],i=zk(n);if(i!==void 0&&i===zk(r)||n===r)return!1}return!0},Vk=e=>cE(e,(e,t)=>kE(e[0],t[0])),Hk=e=>{let t=cE(Nk(e).map(e=>e[0]),kE);return t.filter((e,n)=>n===0||kE(t[n-1],e)!==0)},Uk=e=>{let t=e.context.exprs,n=e.formula,r=e.isNegated,i=e.atom,a=e.relation,o=(t,n,r)=>Fk(e,t,n,r);if(r&&Z(i,`TLA.isASeq`,1)&&Z(i.args[0],`TLA.tuple`))return o(`prop`,$(`tuple_notisaseq`,[n]),[]);if(a===void 0)return;let s=a.args[0],c=a.args[1],l=a.symbol===`=`,u=a.symbol===`TLA.in`;if(!r&&l&&Z(s,`TLA.tuple`)&&Z(c,`TLA.tuple`)){if(s.args.length!==c.args.length)return o(`prop`,$(`tuple_eq_mismatch`,[n,n]),[]);let e=s.args.map((e,n)=>Ek(t,e,c.args[n]));return o(`prop`,$(`tuple_eq_match`,[n,...e]),[e])}if(u&&Z(c,`TLA.Product`,1)&&Z(c.args[0],`TLA.tuple`)){let e=s,i=c.args[0];if(!r){let r=i.args.map((n,r)=>Dk(t,Ok(t,e,jk(t,r+1)),n)),a=t.eapp(`TLA.isASeq`,[e]),s=Ek(t,t.eapp(`TLA.Len`,[e]),jk(t,i.args.length));return o(`prop`,$(`in_product`,[n,e,i,a,s,...r]),[[a,s,...r]])}if(Z(e,`TLA.tuple`)&&(e.args.length!==i.args.length||e.args.some((e,t)=>Mk(e,i.args[t]))))return[];let a=i.args.map((n,r)=>t.enot(Dk(t,Ok(t,e,jk(t,r+1)),n))),l=[t.enot(t.eapp(`TLA.isASeq`,[e])),t.enot(Ek(t,t.eapp(`TLA.Len`,[e]),jk(t,i.args.length))),...a];return o(`prop`,$(`notin_product`,[n,e,i,...l]),Ak(l))}},Wk=e=>{let t=e.context.exprs,n=e.formula,r=e.isNegated,i=e.atom,a=e.relation,o=(t,n,r)=>Fk(e,t,n,r);if(r&&Z(i,`TLA.isAFcn`,1)&&Z(i.args[0],`TLA.record`))return o(`prop`,$(`record_notisafcn`,[n]),[]);if(a===void 0)return;let s=a.args[0],c=a.args[1],l=a.symbol===`=`,u=a.symbol===`TLA.in`;if(l&&Z(s,`TLA.record`)&&Z(c,`TLA.record`)){let e=Vk(Nk(s.args)),i=Vk(Nk(c.args));if(!Bk(e)||!Bk(i))return[];if(!(e.length===i.length&&e.every((e,t)=>e[0]===i[t][0])))return r?[]:o(`prop`,$(`record_eq_mismatch`,[n,n]),[]);let a=e.map((e,n)=>Ek(t,e[1],i[n][1]));if(!r)return o(`prop`,$(`record_eq_match`,[n,...a]),[a]);let l=a.map(e=>t.enot(e));return o(`prop`,$(`record_neq_match`,[n,...l]),Ak(l))}if(r&&l&&(Z(c,`TLA.record`)||Z(s,`TLA.record`))){let e=Z(c,`TLA.record`)?c:s,r=Z(c,`TLA.record`)?s:c,i=Nk(e.args),a=[t.enot(t.eapp(`TLA.isAFcn`,[r])),t.enot(Ek(t,kk(t,r),t.eapp(`TLA.set`,i.map(e=>e[0])))),...i.map(e=>t.enot(Ek(t,Ok(t,r,e[0]),e[1])))];return o(`prop`,$(e===c?`neq_record`:`record_neq`,[n,r,e,...a]),Ak(a))}if(u&&Z(c,`TLA.recordset`)){let e=Nk(c.args),i=t.eapp(`TLA.set`,e.map(e=>e[0]));if(!r){let r=[t.eapp(`TLA.isAFcn`,[s]),Ek(t,kk(t,s),i),...e.map(e=>Dk(t,Ok(t,s,e[0]),e[1]))];return o(`prop`,$(`in_recordset`,[n,s,c,...r]),[r])}if(Z(s,`TLA.record`)){let t=Hk(s.args),n=Hk(c.args),r=t.length===n.length&&t.every((e,t)=>e===n[t]),i=Nk(s.args).some(t=>{let n=e.find(e=>e[0]===t[0]);return n===void 0||Mk(t[1],n[1])});if(!r||i)return[]}let a=[t.enot(t.eapp(`TLA.isAFcn`,[s])),t.enot(Ek(t,kk(t,s),i)),...e.map(e=>t.enot(Dk(t,Ok(t,s,e[0]),e[1])))];return o(`prop`,$(`notin_recordset`,[n,s,c,...a]),Ak(a))}},Gk=e=>/^[-+]?(0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|0[uU][0-9_]+|[0-9][0-9_]*)$/.test(e)?Number(e.replace(/_/g,``).replace(/^([-+]?)0[uU]/,`$1`)):void 0,Kk=e=>{let t=0,n=e;for(;Z(n,`TLA.fapply`,2)&&Sk(n.args[0],`TLA.Succ`);)t++,n=n.args[1];if(n.kind!==`var`)return;let r=Gk(n.symbol);return r===void 0?void 0:t+r},qk=(e,t)=>{let n=Kk(e);return n!==void 0&&n>0&&n<=t},Jk=(e,t,n,r)=>{if(n.length===0)return[[r]];if(n.length===1)return[[r,t(n[0])]];let i=Jk(e,t,n.slice(2),e.eand(e.enot(n[0]),r));return[[n[0],t(n[1])],...i]},Yk=[`TLA.emptyset`,`TLA.upair`,`TLA.addElt`,`TLA.set`,`TLA.SUBSET`,`TLA.UNION`,`TLA.cup`,`TLA.cap`,`TLA.setminus`,`TLA.subsetOf`,`TLA.setOfAll`,`TLA.FuncSet`,`TLA.Product`],Xk=(t,n,r,i,a,o)=>{let s=t.exprs,c=t.index,l=s.elam(r,``,i),u=e=>s.substitute([[r,e]],i),d=e=>{let t=Ek(s,a,fE),n=u(fE),r=Ek(s,a,pE),i=u(pE);return o(e([u(a),t,n,r,i,l]),[],[[t,n],[r,i]])},f=(e,t,n)=>{let r=e=>(e.kind===`app`||e.kind===`var`)&&(t.length===0||t.includes(e.symbol)),i=c.findEqualRight(n).filter(r),a=c.findEqualLeft(n).filter(r),l=i.flatMap(t=>o($(`congruence_lr`,[e,n,t]),[Ek(s,n,t)],[[s.apply(e,t)]])),u=a.flatMap(t=>o($(`congruence_rl`,[e,n,t]),[Ek(s,t,n)],[[s.apply(e,t)]]));return[...l,...u]},p=(e,t,n,r)=>{let i=s.newVar(),a=s.elam(i,``,u(s.eapp(e,r===void 0?[i]:[r,i])));return f(a,t,n)};if(n&&c.isMember(a)){let e=u(fE);return o($(`trueistrue`,[u(a),a,e,l,a]),[a],[[e]])}if(Z(a,`$notequiv`,2))return[];if(n&&(a.kind===`var`||a.kind===`app`)){let t=c.getDefinition(a.symbol);if(t!==void 0){if(a.kind===`var`){if(t.params.length!==0)return[];let e=u(t.body);return o({name:`definition`,definition:t,args:[u(a),e]},[],[[e]])}if(t.params.length!==a.args.length)return[];let n=s.substituteSecondOrder(t.params.map((e,t)=>[e,a.args[t]]),t.body);if(n===void 0)throw new e(`Zenon: higher-order definition`);let r=u(n);return o({name:`definition`,definition:t,args:[u(a),r]},[],[[r]])}}if(Z(a,`TLA.fapply`,2)){let e=a.args[0],t=a.args[1];if(Z(e,`TLA.Fcn`,2)&&e.args[1].kind===`lam`){let n=e.args[1],r=s.enot(Dk(s,t,e.args[0])),i=u(s.substitute([[n.args[0],t]],n.args[1]));return o($(`fapplyfcn`,[u(a),r,i,l,e.args[0],n,t]),[],[[r],[i]])}if(Z(e,`TLA.except`,3)){let n=e.args[0],r=e.args[1],i=e.args[2],c=Dk(s,t,kk(s,n)),d=Ek(s,r,t),f=u(i),p=s.enot(Ek(s,r,t)),m=u(Ok(s,n,t)),h=s.enot(c);return o($(`fapplyexcept`,[u(a),c,d,f,c,p,m,h,l,n,r,i,t]),[],[[c,d,f],[c,p,m],[h]])}if(Z(e,`TLA.tuple`)&&qk(t,e.args.length)){let n=e.args[(Kk(t)??0)-1],r=u(n);return o($(`tuple_access`,[u(a),r,l,a,n]),[],[[r]])}if(Z(e,`TLA.record`)){let n=Nk(e.args).find(e=>e[0]===t);if(n===void 0)return[];let r=u(n[1]);return o($(`record_access`,[u(a),r,l,a,n[1]]),[],[[r]])}}if(Z(a,`TLA.DOMAIN`,1)){let e=a.args[0];if(Z(e,`TLA.Fcn`,2)){let t=u(e.args[0]);return o($(`domain_fcn`,[u(a),t,l,e.args[0],e.args[1]]),[],[[t]])}if(Z(e,`TLA.except`,3)){let t=u(kk(s,e.args[0]));return o($(`domain_except`,[u(a),t,l,e.args[0],e.args[1],e.args[2]]),[],[[t]])}if(Z(e,`TLA.record`)){let t=s.eapp(`TLA.set`,Nk(e.args).map(e=>e[0])),n=u(t);return o($(`record_domain`,[u(a),n,l,a,t]),[],[[n]])}return p(`TLA.DOMAIN`,[`TLA.Fcn`,`TLA.except`,`TLA.record`],e)}if(n){if(a.kind===`not`)return d(e=>$(`boolcase_not`,[...e,a.args[0]]));if(a.kind===`and`)return d(e=>$(`boolcase_and`,[...e,...a.args]));if(a.kind===`or`)return d(e=>$(`boolcase_or`,[...e,...a.args]));if(a.kind===`imply`)return d(e=>$(`boolcase_imply`,[...e,...a.args]));if(a.kind===`equiv`)return d(e=>$(`boolcase_equiv`,[...e,...a.args]));if(DE(a)&&a.symbol===`=`)return d(e=>$(`boolcase_equal`,[...e,a.args[0],a.args[1]]));if(a.kind===`all`||a.kind===`ex`){let e=s.elam(a.args[0],a.symbol,a.args[1]);return d(t=>$(a.kind===`all`?`boolcase_all`:`boolcase_ex`,[...t,e]))}}if(Z(a,`TLA.cond`,3)){let e=a.args[0],t=a.args[1],n=a.args[2];if(e.kind===`true`){let e=u(t);return o($(`iftrue`,[u(a),e,l,t,n]),[],[[e]])}if(e.kind===`false`){let e=u(n);return o($(`iffalse`,[u(a),e,l,t,n]),[],[[e]])}let r=u(t),i=s.enot(e),c=u(n);return o($(`ifthenelse`,[u(a),e,r,i,c,l,e,t,n]),[],[[e,r],[i,c]])}if(Z(a,`TLA.CASE`)){let e=Jk(s,u,a.args,fE),t=u(a);return o($(`case`,[t,l,...e.flat()]),[t],e)}if(a.kind===`tau`&&!Zk(s,c,a)){let e=s.eex(a.args[0],a.symbol,a.args[1]);return o($(`cut`,[e]),[],[[e],[s.enot(e)]])}if(Z(a,`TLA.Len`,1)){let e=a.args[0];if(Z(e,`TLA.tuple`)){let t=jk(s,e.args.length),n=u(t);return o($(`tuple_len`,[u(a),n,l,a,t]),[],[[n]])}return p(`TLA.Len`,[`TLA.tuple`],e)}if(Z(a,`TLA.isASeq`,1))return p(`TLA.isASeq`,[`TLA.tuple`],a.args[0]);if(Z(a,`TLA.in`,2)){let e=a.args[1];return p(`TLA.in`,e.kind===`var`?[]:Yk,e,a.args[0])}return Z(a,`TLA.isAFcn`,1)?p(`TLA.isAFcn`,[`TLA.Fcn`,`TLA.except`,`TLA.oneArg`,`TLA.extend`,`TLA.record`],a.args[0]):[]},Zk=(e,t,n)=>{let r=n.args[1];return r.kind===`not`?t.isMember(e.eex(n.args[0],n.symbol,r))||t.isMember(e.enot(e.eall(n.args[0],n.symbol,r.args[0]))):t.isMember(e.eex(n.args[0],n.symbol,r))},Qk=(e,t,n,r,i,a)=>{let o=e.exprs,s=Xk(e,t,n,r,i,a);if(s.length>0)return s;if(Z(i,`$notequiv`,2))return[];if(i.kind===`app`){for(let t=0;t<i.args.length;t++){let s=[...i.args];s[t]=n;let c=o.substitute([[n,o.eapp(i.symbol,s)]],r),l=Qk(e,!0,n,c,i.args[t],a);if(l.length>0)return l}return[]}return i.kind===`not`?Qk(e,!1,n,o.substitute([[n,o.enot(n)]],r),i.args[0],a):[]},$k=(e,t,n)=>{let r=e.exprs,i=(e,r,i)=>{let a={conclusions:e.name===`cut`?r:[t,...r],rule:e,priority:`arity`,goalness:n,branches:i};return e.name===`ifthenelse`?[a,`stop`]:[a]},a=r.newVar();return Qk(e,!1,a,a,t,i)},eA=e=>{let t=[],n=e;for(;Z(n,`TLA.addElt`,2);)t.push(n.args[0]),n=n.args[1];return[t,n]},tA=e=>{let t=e.context.exprs,n=e.formula,r=e.isNegated,i=e.relation,a=(t,n,r)=>Fk(e,t,n,r),o=(t,n,r)=>Ik(e,t,n,r);if(i?.symbol===`TLA.in`){let e=i.args[0],s=i.args[1];if(!r&&Sk(s,`TLA.emptyset`))return a(`prop`,$(`in_emptyset`,[n,e]),[]);if(Z(s,`TLA.upair`,2)){let i=Ek(t,e,s.args[0]),o=Ek(t,e,s.args[1]);return r?a(`prop`,$(`notin_upair`,[n,t.enot(i),t.enot(o),e,s.args[0],s.args[1]]),[[t.enot(i),t.enot(o)]]):a(`prop`,$(`in_upair`,[n,i,o,e,s.args[0],s.args[1]]),[[i],[o]])}if(Z(s,`TLA.addElt`,2)){let i=eA(s),o=i[1]===t.evar(`TLA.emptyset`);if(!r){let r=i[0].map(n=>Ek(t,e,n)),c=o?r:[...r,Dk(t,e,i[1])];return a(`prop`,$(`in_addElt`,[n,e,s]),Ak(c))}let c=i[0].map(n=>t.enot(Ek(t,e,n))),l=o?c:[t.enot(Dk(t,e,i[1])),...c];return a(`prop`,$(`notin_addElt`,[n,e,s]),[l])}if(Z(s,`TLA.set`))return r?a(`prop`,$(`notin_set`,[n,e,s]),[s.args.map(n=>t.enot(Ek(t,e,n)))]):a(`prop`,$(`in_set`,[n,e,s]),Ak(s.args.map(n=>Ek(t,e,n))));if(r&&s.kind===`meta`)return o({instance:s.args[0]},s.args[0],t.eapp(`TLA.set`,[e]));if(Z(s,`TLA.SUBSET`,1)){let i=t.eapp(`TLA.subseteq`,[e,s.args[0]]);return r?a(`prop`,$(`notin_SUBSET`,[n,t.enot(i),e,s.args[0]]),[[t.enot(i)]]):a(`prop`,$(`in_SUBSET`,[n,i,e,s.args[0]]),[[i]])}if(Z(s,`TLA.UNION`,1)){let i=t.newVar(),o=t.eex(i,``,t.eand(Dk(t,i,s.args[0]),Dk(t,e,i)));return r?a(`arity`,$(`notin_UNION`,[n,t.enot(o),e,s.args[0]]),[[t.enot(o)]]):a(`prop`,$(`in_UNION`,[n,o,e,s.args[0]]),[[o]])}let c=s.kind===`app`?{"TLA.cup":[`in_cup`,`notin_cup`,!0,!1],"TLA.cap":[`in_cap`,`notin_cap`,!1,!0],"TLA.setminus":[`in_setminus`,`notin_setminus`,!1,!0]}[s.symbol]:void 0;if(c!==void 0&&s.args.length===2){let i=Dk(t,e,s.args[0]),o=Dk(t,e,s.args[1]),l=s.symbol===`TLA.setminus`===r?o:t.enot(o),u=r?t.enot(i):i,d=r?c[3]:c[2];return a(`prop`,$(r?c[1]:c[0],[n,u,l,e,s.args[0],s.args[1]]),d?[[u],[l]]:[[u,l]])}if(Z(s,`TLA.subsetOf`,2)&&s.args[1].kind===`lam`){let i=s.args[1],o=Dk(t,e,s.args[0]),c=t.substitute([[i.args[0],e]],i.args[1]);return r?a(`prop`,$(`notin_subsetof`,[n,t.enot(o),t.enot(c),e,s.args[0],i]),[[t.enot(o)],[t.enot(c)]]):a(`prop`,$(`in_subsetof`,[n,o,c,e,s.args[0],i]),[[o,c]])}if(Z(s,`TLA.setOfAll`,2)&&s.args[1].kind===`lam`){let i=s.args[1],o=t.newVar(),c=t.eex(o,``,t.eand(Dk(t,o,s.args[0]),Ek(t,e,t.substitute([[i.args[0],o]],i.args[1])))),l=r?t.enot(c):c;return a({instance:l},$(r?`notin_setofall`:`in_setofall`,[n,l,e,s.args[0],i]),[[l]])}}},nA=e=>{let t=e.context.exprs,n=e.formula,r=e.isNegated,i=e.relation,a=(t,n,r)=>Fk(e,t,n,r);if(i?.symbol!==`=`)return;let o=i.args[0],s=i.args[1];if(!r&&Sk(s,`TLA.emptyset`)){let e=t.newVar(),r=t.eall(e,``,t.enot(Dk(t,e,o)));return a(`arity`,$(`setequalempty`,[n,r,o]),[[r]])}if(!r&&Sk(o,`TLA.emptyset`)){let e=t.newVar(),r=t.eall(e,``,t.enot(Dk(t,e,s)));return a(`arity`,$(`setemptyequal`,[n,r,s]),[[r]])}if(Ck(yk,o)||Ck(yk,s)){let e=t.newVar(),i=t.eall(e,``,t.eequiv(Dk(t,e,o),Dk(t,e,s))),c=r?t.enot(i):i;return a({instance:c},$(r?`notsetequal`:`setequal`,[n,c,o,s]),[[c]])}},rA=e=>{let t=e.context.exprs,n=e.context.index,r=e.relation,i=(t,n,r)=>Fk(e,t,n,r);if(r?.symbol===`TLA.in`&&r.args[0].kind===`meta`){let e=t.newVar();return n.findDisequalities(r.args[1]).flatMap(n=>{let r=n.args[0].args,a=t.enot(t.eall(e,``,t.eequiv(Dk(t,e,r[0]),Dk(t,e,r[1]))));return i({instance:a},$(`notsetequal`,[n,a,r[0],r[1]]),[[a]])})}},iA=e=>{let t=e.context.exprs,n=e.formula,r=e.isNegated,i=e.relation,a=(t,n,r)=>Fk(e,t,n,r);if(i?.symbol===`TLA.subseteq`){let e=i.args[0],o=i.args[1];if(Z(e,`TLA.cup`,2)){let i=t.eapp(`TLA.subseteq`,[e.args[0],o]),s=t.eapp(`TLA.subseteq`,[e.args[1],o]);return r?a(`arity`,$(`not_cup_subseteq`,[n,t.enot(i),t.enot(s)]),[[t.enot(i)],[t.enot(s)]]):a(`arity`,$(`cup_subseteq`,[n,i,s]),[[i,s]])}if(Z(o,`TLA.cap`,2)){let i=t.eapp(`TLA.subseteq`,[e,o.args[1]]);return r?a(`arity`,$(`not_subseteq_cap`,[n,t.enot(i),t.enot(i)]),[[t.enot(i)],[t.enot(i)]]):a(`arity`,$(`subseteq_cap`,[n,i,i]),[[i,i]])}}},aA=[`TLA.in`,`TLA.isAFcn`,`TLA.cond`,`TLA.CASE`,`TLA.tuple`,`TLA.record`,`TLA.fapply`,`TLA.box`],oA=[`=`,...yk,...bk,...aA],sA=(e,t,n,r,i)=>({kind:`def`,definition:{kind:`real`,name:t,symbol:n,params:r.map(t=>e.evar(t)),body:i}}),cA=e=>{let t=e.evar(`x`),n=e.eapp(`TLA.in`,[t,e.evar(`S`)]),r=e.eapp(`P`,[t]);return[sA(e,`subset_def`,`TLA.subseteq`,[`A`,`B`],e.eapp(`TLA.bAll`,[e.evar(`A`),e.elam(t,``,e.eapp(`TLA.in`,[t,e.evar(`B`)]))])),sA(e,`bAll_def`,`TLA.bAll`,[`S`,`P`],e.eall(t,``,e.eimply(n,r))),sA(e,`bEx_def`,`TLA.bEx`,[`S`,`P`],e.eex(t,``,e.eand(n,r))),sA(e,`bChoose_def`,`TLA.bChoice`,[`S`,`P`],e.etau(t,``,e.eand(n,r))),sA(e,`prod_def`,`TLA.prod`,[`A`,`B`],e.eapp(`TLA.Product`,[e.eapp(`TLA.tuple`,[e.evar(`A`),e.evar(`B`)])]))]},lA=e=>{if(Sk(e,`TLA.emptyset`))return[[],!1];if(Z(e,`TLA.upair`,2)||Z(e,`TLA.set`))return[e.args,!1];if(Z(e,`TLA.addElt`,2)){let t=lA(e.args[1]);return[[e.args[0],...t[0]],t[1]]}if(Z(e,`TLA.union`,2)){let t=lA(e.args[0]),n=lA(e.args[1]);return[[...t[0],...n[0]],t[1]||n[1]]}return[[],!0]},uA=e=>{let t=e.context.exprs,n=e.formula,r=e.isNegated,i=e.atom,a=e.relation,o=(t,n,r)=>Fk(e,t,n,r),s=(t,n,r)=>Ik(e,t,n,r);if(i.kind===`meta`)return s(`arity`,i.args[0],r?fE:pE);if(a?.symbol!==`=`)return;let c=a.args[0],l=a.args[1];if(l.kind===`true`)return r?o(`prop`,$(`noteq_x_true`,[n,t.enot(c),c]),[[t.enot(c)]]):o(`prop`,$(`eq_x_true`,[n,c,c]),[[c]]);if(c.kind===`true`)return r?o(`prop`,$(`noteq_true_x`,[n,t.enot(l),l]),[[t.enot(l)]]):o(`prop`,$(`eq_true_x`,[n,l,l]),[[l]]);if(!r&&l.kind===`false`)return o(`prop`,$(`eq_x_false`,[n,t.enot(c),c]),[[t.enot(c)]]);if(!r&&c.kind===`false`)return o(`prop`,$(`eq_false_x`,[n,t.enot(l),l]),[[t.enot(l)]])},dA=e=>{let t=e.context.exprs,n=e.formula,r=e.goalness,i=e.isNegated,a=e.relation,o=(t,n,r)=>Fk(e,t,n,r);if(a===void 0)return;let s=a.args[0],c=a.args[1],l=a.symbol===`=`;if(i&&l&&s.kind===`tau`&&c.kind===`tau`&&!wk(s.args[1])&&!wk(c.args[1])){let e=t.newVar(),r=t.substitute([[s.args[0],e]],s.args[1]),i=t.substitute([[c.args[0],e]],c.args[1]),a=t.eex(e,s.symbol,t.eapp(`$notequiv`,[r,i]));return o({instance:a},$(`choose_diff_choose`,[n,a,t.elam(s.args[0],s.symbol,s.args[1]),t.elam(c.args[0],c.symbol,c.args[1])]),[[a]])}if(!i&&a.symbol===`$notequiv`)return o(`arity`,$(`notequivdef`,[]),[[t.enot(t.eequiv(s,c))]]);let u=c.kind===`tau`?c:s.kind===`tau`?s:void 0;if(i&&l&&u!==void 0){let e=c.kind===`tau`?s:c,n=t.eex(u.args[0],u.symbol,u.args[1]),i=t.enot(n),a=t.enot(t.substitute([[u.args[0],e]],u.args[1]));return[{conclusions:[],rule:$(`notequalchoose`,[n,i,a,t.elam(u.args[0],u.symbol,u.args[1]),e]),priority:{instance:i},goalness:r,branches:[[n],[i,a]]}]}},fA=e=>{let t=e=>Sk(e,`TLA.emptyset`)||e.kind===`app`&&[`TLA.addElt`,`TLA.upair`,`TLA.set`,`TLA.union`].includes(e.symbol);if(e.kind===`all`){let n=e.args[1];if(n.kind===`imply`&&Z(n.args[0],`TLA.in`,2)&&t(n.args[0].args[1]))return{quantified:e,set:n.args[0].args[1]}}if(e.kind===`not`&&e.args[0].kind===`ex`){let n=e.args[0].args[1];if(n.kind===`and`&&Z(n.args[0],`TLA.in`,2)&&t(n.args[0].args[1]))return{quantified:e.args[0],set:n.args[0].args[1]}}},pA=e=>{let t=e.formula,n=(t,n,r)=>Ik(e,t,n,r),r=fA(t);if(r!==void 0){let e=lA(r.set),t=e[0].flatMap(e=>n(`arity`,r.quantified,e));return e[1]?t:[...t,`stop`]}},mA=e=>{let t=e.context.exprs,n=e.formula,r=e.isNegated,i=e.relation,a=(t,n,r)=>Fk(e,t,n,r),o=(t,n,r)=>Ik(e,t,n,r);if(r&&i?.symbol===`TLA.in`&&Sk(i.args[1],`arith.N`)){let e=i.args[0];if(Sk(e,`0`))return a(`prop`,$(`in_nat_0`,[n]),[]);if(Z(e,`TLA.fapply`,2)&&Sk(e.args[0],`TLA.Succ`)){let r=t.enot(Dk(t,e.args[1],t.evar(`arith.N`)));return a(`prop`,$(`in_nat_succ`,[n,r,e.args[1]]),[[r]])}if(e.kind===`meta`)return o({instance:e.args[0]},e.args[0],t.evar(`0`))}},hA=(e,t,n)=>{let r=Pk(e,t,n);return uA(r)??tA(r)??Lk(r)??nA(r)??Rk(r)??dA(r)??pA(r)??mA(r)??rA(r)??(!r.isNegated&&Z(r.atom,`TLA.box`,1)?Fk(r,`prop`,$(`box_p`,[t,r.atom.args[0]]),[[r.atom.args[0]]]):void 0)??Uk(r)??Wk(r)??iA(r)??[]},gA=(e,t,n)=>{let r=e.exprs,i=e.index,a=(e,i,a,o,s,c)=>{let l=e===`all_in`?r.apply(s,c):r.enot(r.apply(s,c));return{conclusions:i===t?[a,t]:[t,i],rule:$(e,[i,a,l,o,s]),priority:{instance:t},goalness:n,branches:[[l]]}},o=e=>i.findPositive(`TLA.in`).map(e=>e[0]).filter(t=>Z(t,`TLA.in`,2)&&t.args[0].metas.length===0&&t.args[1]===e);if(Z(t,`TLA.in`,2)&&t.args[0].metas.length===0){let e=t.args[0],n=t.args[1],r=i.findPositive(`TLA.bAll`).map(e=>e[0]).filter(e=>Z(e,`TLA.bAll`,2)&&e.args[0]===n),o=i.findNegative(`TLA.bEx`).map(e=>e[0]).filter(e=>e.kind===`not`&&Z(e.args[0],`TLA.bEx`,2)&&e.args[0].args[0]===n).map(r=>a(`notex_in`,r,t,n,r.args[0].args[1],e));return[...r.map(r=>a(`all_in`,r,t,n,r.args[1],e)).reverse(),...o]}if(Z(t,`TLA.bAll`,2))return o(t.args[0]).map(e=>a(`all_in`,t,e,t.args[0],t.args[1],e.args[0]));if(t.kind===`not`&&Z(t.args[0],`TLA.bEx`,2)){let e=t.args[0];return o(e.args[0]).map(n=>a(`notex_in`,t,n,e.args[0],e.args[1],n.args[0]))}return[]},_A=(e,t,n,r,i,a)=>{let o=t===`np_eq_l`||t===`np_eq_r`,s=t===`p_eq_l`||t===`np_eq_l`,c=o&&n.kind===`not`?n.args[0]:n,l=Ek(e,r,i),u=e.enot(Ek(e,c,s?r:i)),d=s?i:r,f=o?e.enot(d):d;return{conclusions:[n,l],rule:$(t,o?[n,l,u,f,c,r,i]:[n,l,u,d,n,r,i]),priority:`arity_eq`,goalness:a,branches:[[u],[f]]}},vA=(e,t,n)=>{let r=e.exprs,i=e.index,a=t.kind===`not`?t.args[0]:t;if(a.kind!==`app`)return[];let o=t.kind===`not`,s=e=>i=>_A(r,o?e?`np_eq_l`:`np_eq_r`:e?`p_eq_l`:`p_eq_r`,t,i[0].args[0],i[0].args[1],n);return[...i.findTransLeft(`=`,a.symbol).map(s(!0)),...i.findTransRight(`=`,a.symbol).map(s(!1))]},yA=(e,t,n)=>{let r=e.exprs;if(!Z(t,`=`,2))return[];let i=t.args[+!n];if(i.kind!==`app`)return[];let a=e.index,o=e=>i=>_A(r,e?n?`np_eq_l`:`np_eq_r`:n?`p_eq_l`:`p_eq_r`,i[0],t.args[0],t.args[1],i[1]);return[...a.findPositive(i.symbol).map(o(!1)),...a.findNegative(i.symbol).map(o(!0))]},bA=(e,t,n)=>{let r=gA(e,t,n),i=yA(e,t,!1),a=yA(e,t,!0),o=vA(e,t,n),s=$k(e,t,n),c=[...hA(e,t,n),...s,...o,...a,...i,...r],l=c.indexOf(`stop`);return{nodes:(l===-1?c:c.slice(0,l)).filter(e=>e!==`stop`),isStopped:l!==-1}},xA=(e,t,n,r,i)=>({conclusions:e,rule:t,priority:n,goalness:r,branches:i}),SA=(e,t,n)=>e.enot(e.eapp(`=`,[t,n])),CA=(e,t)=>t.reduce(IO,e),wA=[lk,uk,(e,t,n,r)=>{let i=bA(e,n,r);return[CA(t,i.nodes),i.isStopped]},dk,fk,pk,ZO,mk,hk,_k,QO,$O,nk,rk,ik,vk],TA=(e,t,n,r)=>{let i=t;for(let t of wA){let a=t(e,i,n,r);if(i=a[0],a[1])break}return i},EA=(e,t)=>t.kind===`true`||t.kind===`not`&&t.args[0].kind===`false`||t.kind===`app`&&t.args.length===2&&t.args[0]===t.args[1]&&e.relations.isReflexive(t.symbol),DA=(e,t)=>{let n=e.exprs,r=e.index,i=e.relations,a=[],o=e=>r.isMember(e)||a.includes(e);for(let e of t){if(e.kind===`true`||e.kind===`not`&&e.args[0].kind===`false`||e.kind===`not`&&Z(e.args[0],`TLA.in`,2)&&e.args[0].args[1].kind===`var`&&e.args[0].args[1].symbol===`TLA.emptyset`)continue;let t=e.kind===`not`?e.args[0]:e,r=t.kind===`app`&&t.args.length===2;if(!(e.kind===`app`&&r&&e.args[0]===e.args[1]&&i.isReflexive(e.symbol))){if(r&&i.isSymmetric(t.symbol)){let r=n.eapp(t.symbol,[t.args[1],t.args[0]]),i=e.kind===`not`?n.enot(r):r;!o(e)&&!o(i)&&a.unshift(e)}else o(e)||a.unshift(e)}}return a},OA=e=>e.kind===`app`&&e.args.length===2&&e.symbol===`=`?!EE(e.args[0])&&!EE(e.args[1]):e.kind===`app`&&e.args.length===3&&e.args[0].kind===`var`?!(e.args[0].symbol===`_`&&EE(e.args[1])):e.kind===`app`&&e.args.length===2?!EE(e.args[1]):e.kind===`and`||e.kind===`or`?OA(e.args[0])||OA(e.args[1]):!0,kA=e=>{if(e.kind===`not`&&Z(e.args[0],`=`,2)){let t=e.args[0];return!EE(t.args[0])&&!EE(t.args[1])}if(e.kind===`not`&&Z(e.args[0],`TLA.in`,2)){let t=e.args[0];return EE(t.args[0])&&t.args[1].kind===`var`?t.args[1].symbol===`TLA.emptyset`:!0}return e.kind===`and`||e.kind===`or`?kA(e.args[0])||kA(e.args[1]):!0},AA=e=>[...new Set(e.filter(OA).flatMap(e=>e.metas))].filter(e=>e.metas.length===0).length,jA=(e,t)=>{let n=t.length-1;if(n<0)return;if(t[n]===`open`&&e.branches[n].some(OA))return n;let r=[];for(let e=0;e<=n;e++)t[e]===`open`&&r.push(e);if(r.length<=1)return r[0];let i=r.map(t=>{let n=e.branches[t];return{index:t,nontrivial:n.filter(kA).length,metas:AA(n),size:n.reduce((e,t)=>e+t.size,0)}}).reverse();return cE(i,(e,t)=>e.nontrivial===0?1:t.nontrivial===0?-1:e.metas===t.metas?e.size-t.size:t.metas-e.metas)[0].index},MA=e=>e.name!==`close`&&e.name!==`close_refl`&&e.name!==`close_sym`&&e.name!==`false`&&e.name!==`not_true`,NA=(t,n,r,i,a)=>{let o=t.index;n.forEach(o.addDefinition);let s=[];for(let e of r)s.some(t=>t[0]===e.formula)||s.unshift([e.formula,e.goalness]);let c=[],l=s,u=0,d=NO,f=(t,n)=>{let r=[],i=[];n.forEach((n,a)=>{if(n===`open`)throw new e(`Zenon: an open branch in a closed node`);i.push(n),r=yE(vE(n.conclusions,t.branches[a]),r)}),a.proofNodes++;let s={conclusions:yE(t.conclusions,r),rule:t.rule,uses:t.conclusions,subproofs:i};return MA(t.rule)&&o.addLemma(s),s},p=(e,t,n)=>{let r=e,i=t,a=n;for(;;){let e=jA(r,a);if(e!==void 0){c.push({node:r,queue:i,states:a,current:e}),l=r.branches[e].map(e=>[e,r.goalness]),u=0,d=i;return}let t=f(r,a),n=m(t);if(n!==void 0)return n;let o=c[c.length-1];r=o.node,i=o.queue,a=o.states,c.pop()}},m=e=>{for(;;){let t=c.pop();if(t===void 0)return e;let n=t.node.branches[t.current];for(let e=n.length-1;e>=0;e--)o.isMember(n[e])&&o.remove(n[e]);if(!bE(n,e.conclusions)){t.states[t.current]=e,c.push(t);return}}};for(;;){let e=Rw(i);if(e!==void 0)return e;if(d.insertedCount>19e5)return`memory limit`;if(u<l.length){let e=l[u++],n=e[0];if(EA(t,n))continue;o.add(n,e[1]),d=TA(t,d,n,e[1]);continue}let n=WO(d),r=n===void 0||MA(n.rule)?o.searchLemma():void 0;if(r!==void 0){a.reusedProofs.add(r);let e=m(r);if(e!==void 0)return e;let t=c[c.length-1];c.pop();let n=p(t.node,t.queue,t.states);if(n!==void 0)return n}else for(;;){a.inferences++;let e=HO(d);if(e===void 0)return`exhausted`;d=e[1];let n=e[0].branches.map(e=>DA(t,e));if(n.some(e=>e.length===0))continue;let r=p({...e[0],branches:n},d,n.map(()=>`open`));if(r!==void 0)return r;break}}},PA=(t,n)=>{let r={deadline:Date.now()+n.timeLimitMs,signal:n.signal},i=NE(),a=hO(i,t),o=[...cA(i),...a],s=TO(oA,o),c=WE(i);for(let e of s.hypotheses)c.analyse(e.formula);let l=s.hypotheses.filter(e=>!c.isSubsumed(e.formula)),u=tD(i),d={inferences:0,proofNodes:0,reusedProofs:/* @__PURE__ */ new Set},f=(()=>{try{return NA({index:u,relations:c,exprs:i},s.definitions,l,r,d)}catch(t){if(t instanceof e)return`zenon error`;throw t}})(),p=typeof f==`string`?void 0:f,m=p!==void 0&&KT(p,{hypotheses:o.flatMap(e=>e.kind===`hyp`?[e.formula]:[]),definitions:s.definitions},r)?oO(p,{exprs:i,phrases:a,sharedProofs:d.reusedProofs,relations:c,limits:r}):void 0;return{proof:p,failure:typeof f==`string`?f:m===void 0?Rw(r):void 0,isar:m,nodesSearched:d.inferences,maxBranchFormulas:u.getTopFormulaCount(),proofNodes:d.proofNodes,formulasCreated:i.getCreatedCount()}},FA=(e,t)=>{let n=PA(e,t).isar;return n===void 0?{verdict:`unknown`}:{verdict:`unsat`,proof:n}},IA=(e,t)=>{try{return Lw(e,t)}catch(e){throw e instanceof i?new c(e.message,e):e}},LA={smt:IA,z3:IA,zenon:(e,t)=>FA(e,t).verdict,isabelle:im,ls4:dm},RA=(e,t,n)=>{let r=performance.now();return{verdict:LA[e](t,n),timeUsedMs:performance.now()-r}};export{RA as t};