--- a/.hgtags Sat Jun 25 13:34:41 2022 +0200
+++ b/.hgtags Fri Sep 02 13:41:55 2022 +0200
@@ -39,3 +39,4 @@
abf3e80bd815c2c062b02c78b256f7ba27481380 Isabelle2020
7e2a9a8c2b85f10d81f3be433878fe51fa13eb6f Isabelle2021
c2a2be496f35aa1a6072393aebfdb1b85c9f2e9e Isabelle2021-1
+b42e20adaeed48e1e926839f236643e6094d70a7 Isabelle2022-RC0
--- a/Admin/Windows/Cygwin/README Sat Jun 25 13:34:41 2022 +0200
+++ b/Admin/Windows/Cygwin/README Fri Sep 02 13:41:55 2022 +0200
@@ -20,6 +20,7 @@
- https://isabelle.sketis.net/cygwin_2020 (Isabelle2020)
- https://isabelle.sketis.net/cygwin_2021 (Isabelle2021)
- https://isabelle.sketis.net/cygwin_2021-1 (Isabelle2021-1)
+ - https://isabelle.sketis.net/cygwin_2022 (Isabelle2022)
* Apache2 redirects for virtual host isabelle.conf:
```
@@ -49,6 +50,8 @@
Redirect /cygwin_2021/noarch/release https://ftp.eq.uc.pt/software/pc/prog/cygwin/noarch/release
Redirect /cygwin_2021-1/x86_64/release https://ftp.eq.uc.pt/software/pc/prog/cygwin/x86_64/release
Redirect /cygwin_2021-1/noarch/release https://ftp.eq.uc.pt/software/pc/prog/cygwin/noarch/release
+ Redirect /cygwin_2022/x86_64/release https://ftp.eq.uc.pt/software/pc/prog/cygwin/x86_64/release
+ Redirect /cygwin_2022/noarch/release https://ftp.eq.uc.pt/software/pc/prog/cygwin/noarch/release
```
* Quasi-component: "isabelle build_cygwin" (as Administrator)
--- a/Admin/components/PLATFORMS Sat Jun 25 13:34:41 2022 +0200
+++ b/Admin/components/PLATFORMS Fri Sep 02 13:41:55 2022 +0200
@@ -37,15 +37,15 @@
x86_64-darwin macOS 10.13 High Sierra (lapbroy68 MacBookPro11,2)
macOS 10.14 Mojave (mini2 Macmini8,1)
- macOS 10.15 Catalina (laramac01 Macmini8,1)
+ macOS 10.15 Catalina (???)
macOS 11 Big Sur (mini1 Macmini8,1)
- macOS 12 Monterey (???)
+ macOS 12 Monterey (laramac01 Macmini8,1)
macOS 13 Ventura (???)
arm64-darwin macOS 11 Big Sur
x86_64-windows Windows 10
- x86_64-cygwin Cygwin 3.2.x https://isabelle.sketis.net/cygwin_2021-1 (x86_64/release)
+ x86_64-cygwin Cygwin 3.3.x https://isabelle.sketis.net/cygwin_2022 (x86_64/release)
Experimental platforms:
--- a/Admin/components/components.sha1 Sat Jun 25 13:34:41 2022 +0200
+++ b/Admin/components/components.sha1 Fri Sep 02 13:41:55 2022 +0200
@@ -40,6 +40,7 @@
76ff6103b8560f0e2778bbfbdb05f5fa18f850b7 cvc4-1.5pre-4.tar.gz
03aec2ec5757301c9df149f115d1f4f1d2cafd9e cvc4-1.5pre.tar.gz
e99560d0b7cb9bafde2b0ec1a3a95af315918a25 cvc4-1.8.tar.gz
+9e0d91f9f3bc0b69e60e50ca683cfcdcbfee6d62 cvc5-1.0.2.tar.gz
842d9526f37b928cf9e22f141884365129990d63 cygwin-20130110.tar.gz
cb3b0706d208f104b800267697204f6d82f7b48a cygwin-20130114.tar.gz
3b44cca04855016d5f8cfb5101b2e0579ab80197 cygwin-20130117.tar.gz
@@ -71,6 +72,7 @@
5b1820b87b25d8f2d237515d9854e3ce54ee331b cygwin-20211002.tar.gz
5dff30be394d88dd83ea584fa6f8063bdcdc21fd cygwin-20211004.tar.gz
fffaae24da4d274d34b8dc79a76b478b87ec31dd cygwin-20211007.tar.gz
+66e16dccd7b177c086ab53013c1b74d09c1893ad cygwin-20220831.tar.gz
0fe549949a025d65d52d6deca30554de8fca3b6e e-1.5.tar.gz
2e293256a134eb8e5b1a283361b15eb812fbfbf1 e-1.6-1.tar.gz
e1919e72416cbd7ac8de5455caba8901acc7b44d e-1.6-2.tar.gz
@@ -99,6 +101,7 @@
9908e5ab721f1c0035c0ab04dc7ad0bd00a8db27 flatlaf-1.2.tar.gz
9534b721b7b78344f3225067ee4df28a5440b87e flatlaf-1.6.4.tar.gz
212a0f1f867511722024cc60156fd71872a16f92 flatlaf-1.6.tar.gz
+6d4dbb6f2bde5804298d9008e3edceb0b9ee20ae flatlaf-2.4.tar.gz
f339234ec18369679be0095264e0c0af7762f351 gnu-utils-20210414.tar.gz
71259aa46134e6cf2c6473b4fc408051b3336490 gnu-utils-20211030.tar.gz
683acd94761ef460cca1a628f650355370de5afb hol-light-bundle-0.5-126.tar.gz
@@ -151,6 +154,8 @@
b22066a9dcde6f813352dcf6404ac184440a22df isabelle_setup-20211109.tar.gz
91c5d29e9fa40aee015e8e65ffea043e218c2fc5 isabelle_setup-20220323.tar.gz
056979bd1c08eb9d0d12cc1118b4ff70bfe2d594 isabelle_setup-20220701.tar.gz
+be91402b3e5ef5bc6d4802a45175ee238cd9653e isabelle_setup-20220808.tar.gz
+171df3eb58bdac4cc495f773b797fa578f7d4be6 isabelle_setup-20220817.tar.gz
0b2206f914336dec4923dd0479d8cee4b904f544 jdk-11+28.tar.gz
e12574d838ed55ef2845acf1152329572ab0cc56 jdk-11.0.10+9.tar.gz
3e05213cad47dbef52804fe329395db9b4e57f39 jdk-11.0.2+9.tar.gz
@@ -280,6 +285,7 @@
d858eb0ede6aea6b8cc40de63bd3a17f8f9f5300 naproche-20210129.tar.gz
810ee0f35adada9bf970c33fd80b986ab2255bf3 naproche-20210201.tar.gz
37bb6d934cfaf157efcadb349a0244d145ce15b0 naproche-20211211.tar.gz
+5a8a59132476ae75cfddefc98781db55f18ed82c naproche-20220808.tar.gz
d098dd0873b1720a77dc4e060267f9a6c93f341a naproche-2d99afe5c349.tar.gz
4a4e56fd03b7ba4edd38046f853873a90cf55d1a naproche-4ad61140062f.tar.gz
77252e0b40f89825b9b5935f9f0c4cd5d4e7012a naproche-6d0d76ce2f2a.tar.gz
@@ -295,6 +301,7 @@
fc66802c169f44511d3be30435eb89a11e635742 opam-2.0.7.tar.gz
108e947d17e9aa6170872614492d8f647802f483 opam-2.1.0.tar.gz
f8d0218371457eabe2b4214427d9570de92ed861 pdfjs-2.12.313.tar.gz
+aa7fc4a3d2cbd6c8744ddfeefd863828ea602bcd pdfjs-2.14.305.tar.gz
1c8cb6a8f4cbeaedce2d6d1ba8fc7e2ab3663aeb polyml-5.4.1.tar.gz
a3f9c159a0ee9a63b7a5d0c835ed9c2c908f8b56 polyml-5.5.0-1.tar.gz
7d604a99355efbfc1459d80db3279ffa7ade3e39 polyml-5.5.0-2.tar.gz
@@ -373,6 +380,7 @@
1aaa38429dc9aa7b1095394d9a7ba3465f8d6e04 postgresql-42.2.24.tar.gz
231b33c9c3c27d47e3ba01b399103d70509e0731 postgresql-42.2.5.tar.gz
6335fbc0658e447b5b9bc48c9ad36e33a05bb72b postgresql-42.2.9.tar.gz
+f84c7ecafb07a0d763f1d70edc54f7c43c2e8c63 postgresql-42.4.0.tar.gz
f132329ca1045858ef456cc08b197c9eeea6881b postgresql-9.4.1212.tar.gz
f042bba5fb82c7eb8aee99f92eb6ec38c8a067f7 python-3.10.4.tar.gz
0885e1f1d8feaca78d2f204b6487e6eec6dfab4b scala-2.10.0.tar.gz
@@ -439,6 +447,7 @@
3b3239b2e6f8062b90d819f3703e30a50f4fa1e7 sumatra_pdf-3.1.2-2.tar.gz
8486387f61557147ec06b1f637117c017c8f0528 sumatra_pdf-3.1.2.tar.gz
e8648878f908e93d64a393231ab21fdac976a9c2 sumatra_pdf-3.3.3.tar.gz
+25d2004325585fceb0a951181716f77fc4d9d0d4 sumatra_pdf-3.4.6.tar.gz
869ea6d8ea35c8ba68d7fcb028f16b2b7064c5fd vampire-1.0.tar.gz
399f687b56575b93e730f68c91c989cb48aa34d8 vampire-4.2.2.tar.gz
0402978ca952f08eea73e483b694928ac402a304 vampire-4.5.1-1.tar.gz
@@ -453,7 +462,9 @@
19c6e5677b0a26cbc5805da79d00d06a66b7a671 verit-2021.06.2-rmx.tar.gz
c4666a6d8080b5e376b50471fd2d9edeb1f9c988 vscode_extension-20220324.tar.gz
86c952d739d1eb868be88898982d4870a3d8c2dc vscode_extension-20220325.tar.gz
+5293b9e77e5c887d449b671828b133fad4f18632 vscode_extension-20220829.tar.gz
67b271186631f84efd97246bf85f6d8cfaa5edfd vscodium-1.65.2.tar.gz
+c439ab741e0cc49354cc03aa9af501202a5a38e3 vscodium-1.70.1.tar.gz
81d21dfd0ea5c58f375301f5166be9dbf8921a7a windows_app-20130716.tar.gz
fe15e1079cf5ad86f3cbab4553722a0d20002d11 windows_app-20130905.tar.gz
e6a43b7b3b21295853bd2a63b27ea20bd6102f5f windows_app-20130906.tar.gz
--- a/Admin/components/main Sat Jun 25 13:34:41 2022 +0200
+++ b/Admin/components/main Fri Sep 02 13:41:55 2022 +0200
@@ -6,10 +6,10 @@
csdp-6.1.1
cvc4-1.8
e-2.6-1
-flatlaf-1.6.4
+flatlaf-2.4
idea-icons-20210508
isabelle_fonts-20211004
-isabelle_setup-20220323
+isabelle_setup-20220817
jdk-17.0.2+8
jedit-20211103
jfreechart-1.5.3
@@ -18,10 +18,10 @@
minisat-2.2.1-1
nunchaku-0.5
opam-2.0.7
-pdfjs-2.12.313
+pdfjs-2.14.305
polyml-test-15c840d48c9a
-postgresql-42.2.24
-scala-2.13.5-1
+postgresql-42.4.0
+scala-3.1.3
smbc-0.4.1
spass-3.8ds-2
sqlite-jdbc-3.36.0.3
@@ -29,8 +29,8 @@
stack-2.7.3
vampire-4.6
verit-2021.06.2-rmx
-vscode_extension-20220325
-vscodium-1.65.2
+vscode_extension-20220829
+vscodium-1.70.1
xz-java-1.9
z3-4.4.0_4.4.1
zipperposition-2.1-1
--- a/Admin/components/windows Sat Jun 25 13:34:41 2022 +0200
+++ b/Admin/components/windows Fri Sep 02 13:41:55 2022 +0200
@@ -1,2 +1,2 @@
-#additional components to be bundled for release
-sumatra_pdf-3.3.3
+#additional components for Windows platform
+sumatra_pdf-3.4.6
--- a/NEWS Sat Jun 25 13:34:41 2022 +0200
+++ b/NEWS Fri Sep 02 13:41:55 2022 +0200
@@ -12,6 +12,15 @@
* Old-style {* verbatim *} tokens have been discontinued (legacy feature
since Isabelle2019). INCOMPATIBILITY, use \<open>cartouche\<close> syntax instead.
+* Session ROOT files support 'chapter_definition' entries (optional).
+This allows to associate additional information as follows:
+
+ - "chapter_definition NAME (GROUPS)" to make all sessions that belong
+ to this chapter members of the given groups
+
+ - "chapter_definition NAME description TEXT" to provide a description
+ for presentation purposes
+
*** Isabelle/VSCode Prover IDE ***
@@ -32,14 +41,53 @@
--app="$(isabelle getenv -b ISABELLE_HOME)"/src/Tools/Electron/test
+*** HTML/PDF presentation ***
+
+* Management of dependencies has become more robust and accurate,
+following the session build hierarchy, and the up-to-date notion of
+"isabelle build". Changed sessions and updated builds will cause new
+HTML presentation, when that is enabled eventually. Unchanged sessions
+retain their HTML output that is already present. Thus HTML presentation
+for basic sessions like "HOL" and "HOL-Analysis" is produced at most
+once, as required by user sessions.
+
+* HTML presentation no longer supports README.html, which was meant as
+add-on to the index.html of a session. Rare INCOMPATIBILITY, consider
+using a separate theory "README" with Isabelle document markup/markdown.
+
+* ML files (and other auxiliary files) are presented with detailed
+hyperlinks, just like regular theory sources.
+
+* Support for external hyperlinks (URLs).
+
+* Support for internal hyperlinks to files that belong formally to the
+presented session.
+
+
*** HOL ***
+* HOL-Algebra: Facts renamed to avoid fact name clashes on interpretation:
+
+ is_ring ~> ring_axioms
+ cring ~> cring_axioms
+ R_def ~> R_m_def
+
+INCOMPATIBILITY.
+
+* Moved auxiliary computation constant "divmod_nat" to theory
+"Euclidean_Division". Minor INCOMPATIBILITY.
+
+* Renamed attribute "arith_split" to "linarith_split". Minor
+INCOMPATIBILITY.
+
* Theory Char_ord: streamlined logical specifications.
Minor INCOMPATIBILITY.
* New Theory Code_Abstract_Char implements characters by target language
integers, sacrificing pattern patching in exchange for dramatically
-increased performance for comparisions.
+increased performance for comparisons.
+
+* New theory HOL-Library.NList of fixed length lists.
* Rule split_of_bool_asm is not split any longer, analogously to
split_if_asm. INCOMPATIBILITY.
@@ -47,6 +95,9 @@
* Theory "HOL.Bit_Operations": rule bit_0 is not default [simp] any
longer. INCOMPATIBILITY.
+* Streamlined primitive definitions of division and modulus on integers.
+INCOMPATIBILITY.
+
* Theory "HOL.Fun":
- Added predicate monotone_on and redefined monotone to be an
abbreviation. Lemma monotone_def is explicitly provided for backward
@@ -97,6 +148,11 @@
totalp_on_subset
totalp_on_total_on_eq[pred_set_conv]
+* Theory "HOL.Transitive_Closure":
+ - Added lemmas.
+ total_on_trancl
+ totalp_on_tranclp
+
* Theory "HOL-Library.Multiset":
- Consolidated operation and fact names.
multp ~> multp_code
@@ -128,6 +184,12 @@
* Theory "HOL-Library.Sublist":
- Added lemma map_mono_strict_suffix.
+* Theory "HOL-ex.Sum_of_Powers":
+ - Deleted. The same material is in the AFP as Bernoulli.
+
+* Nitpick: To avoid technical issues, prefer non-JNI solvers to JNI solvers by
+ default. Minor INCOMPATIBILITY.
+
* Sledgehammer:
- Redesigned multithreading to provide more fine grained prover schedules.
The binary option 'slice' has been replaced by a numeric value 'slices'
@@ -142,6 +204,9 @@
INCOMPATIBILITY.
- Added support for TX0 and TX1 TPTP formats and $ite/$let expressions
in TH0 and TH1.
+ - Added support for cvc5.
+ - Generate Isar proofs by default when and only when the one-liner proof
+ fails to replay and the Isar proof succeeds.
- Replaced option "sledgehammer_atp_dest_dir" by
"sledgehammer_atp_problem_dest_dir", for problem files, and
"sledgehammer_atp_proof_dest_dir", for proof files. Minor INCOMPATIBILITY.
@@ -190,6 +255,12 @@
*** System ***
+* Isabelle/Scala is now based on Scala 3. This is a completely different
+compiler ("dotty") and a quite different source language (we are using
+the classic Java-style syntax, not the new Python-style syntax).
+Occasional INCOMPATIBILITY, see also the official Scala documentation
+https://docs.scala-lang.org/scala3/guides/migration/compatibility-intro.html
+
* Command-line tool "isabelle scala_project" supports Gradle as
alternative to Maven: either option -G or -M needs to be specified
explicitly. This increases the chances that the Java/Scala IDE project
@@ -206,6 +277,10 @@
Isabelle repository: a regular download of the distribution will not
work!
+* The session build database now maintains an additional "uuid" column
+to identity the original build process uniquely. Thus other tools may
+dependent symbolically on a particular build instance.
+
* External Isabelle tools implemented as .scala scripts are no longer
supported. INCOMPATIBILITY, instead provide a proper Isabelle/Scala
module with etc/build.props and "services" for a suitable class instance
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ROOT Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,37 @@
+chapter_definition HOL
+ description "
+ Higher-Order Logic.
+
+ Isabelle/HOL is a version of classical higher-order logic resembling
+ that of the HOL System (https://www.cl.cam.ac.uk/Research/HVG/HOL).
+ "
+
+chapter_definition FOL
+ description "
+ First-Order Logic with some variations: single-sorted vs. many-sorted
+ (polymorphic), classical vs. intuitionistic, domain-theory (LCF) vs.
+ set-theory (ZF).
+ "
+
+chapter_definition Pure
+ description "
+ The Pure logical framework.
+
+ Isabelle/Pure is a version of intuitionistic higher-order logic that
+ expresses rules for Natural Deduction declaratively.
+ "
+
+chapter_definition Misc
+ description "
+ Miscellaneous object-logics, tools, and experiments.
+ "
+
+chapter_definition Doc
+ description "
+ Sources of Documentation.
+ "
+
+chapter_definition Unsorted
+ description "
+ Sessions without 'chapter' declaration.
+ "
--- a/etc/build.props Sat Jun 25 13:34:41 2022 +0200
+++ b/etc/build.props Fri Sep 02 13:41:55 2022 +0200
@@ -11,6 +11,7 @@
src/HOL/Tools/Mirabelle/mirabelle.scala \
src/HOL/Tools/Nitpick/kodkod.scala \
src/Pure/Admin/afp.scala \
+ src/Pure/Admin/build_cvc5.scala \
src/Pure/Admin/build_csdp.scala \
src/Pure/Admin/build_cygwin.scala \
src/Pure/Admin/build_doc.scala \
@@ -116,6 +117,7 @@
src/Pure/PIDE/command_span.scala \
src/Pure/PIDE/document.scala \
src/Pure/PIDE/document_id.scala \
+ src/Pure/PIDE/document_info.scala \
src/Pure/PIDE/document_status.scala \
src/Pure/PIDE/editor.scala \
src/Pure/PIDE/headless.scala \
@@ -135,6 +137,7 @@
src/Pure/PIDE/yxml.scala \
src/Pure/ROOT.scala \
src/Pure/System/bash.scala \
+ src/Pure/System/classpath.scala \
src/Pure/System/command_line.scala \
src/Pure/System/components.scala \
src/Pure/System/executable.scala \
@@ -158,13 +161,13 @@
src/Pure/System/system_channel.scala \
src/Pure/System/tty_loop.scala \
src/Pure/Thy/bibtex.scala \
+ src/Pure/Thy/browser_info.scala \
src/Pure/Thy/document_build.scala \
src/Pure/Thy/export.scala \
src/Pure/Thy/export_theory.scala \
src/Pure/Thy/file_format.scala \
src/Pure/Thy/html.scala \
src/Pure/Thy/latex.scala \
- src/Pure/Thy/presentation.scala \
src/Pure/Thy/sessions.scala \
src/Pure/Thy/thy_element.scala \
src/Pure/Thy/thy_header.scala \
@@ -235,6 +238,7 @@
src/Tools/jEdit/src/context_menu.scala \
src/Tools/jEdit/src/debugger_dockable.scala \
src/Tools/jEdit/src/dockable.scala \
+ src/Tools/jEdit/src/document_dockable.scala \
src/Tools/jEdit/src/document_model.scala \
src/Tools/jEdit/src/document_view.scala \
src/Tools/jEdit/src/documentation_dockable.scala \
--- a/etc/settings Sat Jun 25 13:34:41 2022 +0200
+++ b/etc/settings Fri Sep 02 13:41:55 2022 +0200
@@ -17,7 +17,7 @@
ISABELLE_TOOL_JAVA_OPTIONS="-Djava.awt.headless=true -Xms512m -Xmx4g -Xss16m"
ISABELLE_JAVAC_OPTIONS="-encoding UTF-8 -Xlint:-options -deprecation -source 11 -target 11"
-ISABELLE_SCALAC_OPTIONS="-encoding UTF-8 -feature -deprecation -target:11 -Xsource:3 -J-Xms512m -J-Xmx4g -J-Xss16m"
+ISABELLE_SCALAC_OPTIONS="-encoding UTF-8 -feature -deprecation -release 11 -source 3.1 -old-syntax -no-indent -color never -pagewidth 78 -J-Xms512m -J-Xmx4g -J-Xss16m"
ISABELLE_SCALA_JAR="$ISABELLE_HOME/lib/classes/isabelle.jar"
--- a/lib/Tools/scala Sat Jun 25 13:34:41 2022 +0200
+++ b/lib/Tools/scala Fri Sep 02 13:41:55 2022 +0200
@@ -6,16 +6,10 @@
isabelle scala_build || exit $?
-eval "declare -a JAVA_ARGS=($ISABELLE_JAVA_SYSTEM_OPTIONS)"
-declare -a SCALA_ARGS=()
-for ARG in "${JAVA_ARGS[@]}"
-do
- SCALA_ARGS["${#SCALA_ARGS[@]}"]="-J$ARG"
-done
-
classpath "$ISABELLE_SETUP_CLASSPATH"; unset ISABELLE_SETUP_CLASSPATH
classpath "$CLASSPATH"; unset CLASSPATH
-isabelle_scala scala "${SCALA_ARGS[@]}" \
- -classpath "$(platform_path "$ISABELLE_CLASSPATH")" \
- -Disabelle.scala.classpath="$(platform_path "$ISABELLE_CLASSPATH")" "$@"
+export jvm_cp_args="$(platform_path "$ISABELLE_CLASSPATH")"
+export JAVA_OPTS="$ISABELLE_JAVA_SYSTEM_OPTIONS -J-Dscala.usejavacp=true"
+
+isabelle_scala scala $ISABELLE_SCALAC_OPTIONS "$@"
--- a/lib/html/library_index_content.template Sat Jun 25 13:34:41 2022 +0200
+++ b/lib/html/library_index_content.template Fri Sep 02 13:41:55 2022 +0200
@@ -16,20 +16,20 @@
<li style="list-style: none">
<ul>
- <li><a href="FOL/index.html">FOL (Many-sorted First-Order Logic)</a>
+ <li><a href="ZF/index.html">ZF (Set Theory)</a>
+ offers a formulation of Zermelo-Fraenkel set theory on top of FOL.
+ </li>
+
+ <li><a href="FOL/FOL/index.html">FOL (Many-sorted First-Order Logic)</a>
provides basic classical and intuitionistic first-order logic. It is
polymorphic.
</li>
- <li><a href="ZF/index.html">ZF (Set Theory)</a>
- offers a formulation of Zermelo-Fraenkel set theory on top of FOL.
- </li>
+ <li><a href="FOL/CCL/index.html">CCL (Classical Computational Logic)</a></li>
- <li><a href="CCL/index.html">CCL (Classical Computational Logic)</a></li>
+ <li><a href="FOL/LCF/index.html">LCF (Logic of Computable Functions)</a></li>
- <li><a href="LCF/index.html">LCF (Logic of Computable Functions)</a></li>
-
- <li><a href="FOLP/index.html">FOLP (FOL with Proof Terms)</a></li>
+ <li><a href="FOL/FOLP/index.html">FOLP (FOL with Proof Terms)</a></li>
</ul>
</li>
</ul>
@@ -39,12 +39,12 @@
<li style="list-style: none">
<ul>
- <li><a href="Sequents/index.html">Sequents (first-order, modal and linear logics)</a></li>
+ <li><a href="Misc/Sequents/index.html">Sequents (first-order, modal and linear logics)</a></li>
- <li><a href="CTT/index.html">CTT (Constructive Type Theory)</a>
+ <li><a href="Misc/CTT/index.html">CTT (Constructive Type Theory)</a>
is an extensional version of Martin-Löf's Type Theory.</li>
- <li><a href="Cube/index.html">Cube (The Lambda Cube)</a></li>
+ <li><a href="Misc/Cube/index.html">Cube (The Lambda Cube)</a></li>
<li><a href="Pure/index.html">The Pure logical framework</a></li>
--- a/lib/scripts/getsettings Sat Jun 25 13:34:41 2022 +0200
+++ b/lib/scripts/getsettings Fri Sep 02 13:41:55 2022 +0200
@@ -130,7 +130,7 @@
fi
if [ -e "$ISABELLE_SETUP_JAR" ]; then
- ISABELLE_SETUP_CLASSPATH="$(isabelle_jdk java -classpath "$(platform_path "$ISABELLE_SETUP_JAR")" isabelle.setup.Setup classpath)"
+ ISABELLE_SETUP_CLASSPATH="$(isabelle_jdk java -classpath "$(platform_path "$SCALA_INTERFACES:$ISABELLE_SETUP_JAR")" isabelle.setup.Setup classpath)"
fi
set +o allexport
--- a/src/CCL/ROOT Sat Jun 25 13:34:41 2022 +0200
+++ b/src/CCL/ROOT Fri Sep 02 13:41:55 2022 +0200
@@ -1,4 +1,4 @@
-chapter CCL
+chapter FOL
session CCL = Pure +
description "
--- a/src/CTT/ROOT Sat Jun 25 13:34:41 2022 +0200
+++ b/src/CTT/ROOT Fri Sep 02 13:41:55 2022 +0200
@@ -1,4 +1,4 @@
-chapter CTT
+chapter Misc
session CTT = Pure +
description "
--- a/src/Cube/ROOT Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Cube/ROOT Fri Sep 02 13:41:55 2022 +0200
@@ -1,4 +1,4 @@
-chapter Cube
+chapter Misc
session Cube = Pure +
description "
--- a/src/Doc/Isar_Ref/HOL_Specific.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Doc/Isar_Ref/HOL_Specific.thy Fri Sep 02 13:41:55 2022 +0200
@@ -2003,7 +2003,7 @@
\begin{matharray}{rcl}
@{method_def (HOL) arith} & : & \<open>method\<close> \\
@{attribute_def (HOL) arith} & : & \<open>attribute\<close> \\
- @{attribute_def (HOL) arith_split} & : & \<open>attribute\<close> \\
+ @{attribute_def (HOL) linarith_split} & : & \<open>attribute\<close> \\
\end{matharray}
\<^descr> @{method (HOL) arith} decides linear arithmetic problems (on types \<open>nat\<close>,
@@ -2013,7 +2013,7 @@
\<^descr> @{attribute (HOL) arith} declares facts that are supplied to the
arithmetic provers implicitly.
- \<^descr> @{attribute (HOL) arith_split} attribute declares case split rules to be
+ \<^descr> @{attribute (HOL) linarith_split} attribute declares case split rules to be
expanded before @{method (HOL) arith} is invoked.
--- a/src/Doc/Isar_Ref/Spec.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Doc/Isar_Ref/Spec.thy Fri Sep 02 13:41:55 2022 +0200
@@ -1320,6 +1320,16 @@
browsed via the virtual file-system with prefix ``\<^verbatim>\<open>isabelle-export:\<close>''
(using the regular file-browser).
+ \<^descr> \<^theory_text>\<open>scala_build_generated_files paths (in thy)\<close> retrieves named generated
+ files as for \<^theory_text>\<open>export_generated_files\<close> and writes them into a temporary
+ directory, which is taken as starting point for build process of
+ Isabelle/Scala/Java modules (see @{cite "isabelle-system"}). The
+ corresponding @{path build.props} file is expected directly in the toplevel
+ directory, instead of @{path "etc/build.props"} for Isabelle system
+ components. These properties need to specify sources, resources, services
+ etc. as usual. The resulting \<^verbatim>\<open>jar\<close> module becomes an export artifact of the
+ session database.
+
\<^descr> \<^theory_text>\<open>compile_generated_files paths (in thy) where compile_body\<close> retrieves
named generated files as for \<^theory_text>\<open>export_generated_files\<close> and writes them into
a temporary directory, such that the \<open>compile_body\<close> may operate on them as
--- a/src/Doc/Prog_Prove/Types_and_funs.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Doc/Prog_Prove/Types_and_funs.thy Fri Sep 02 13:41:55 2022 +0200
@@ -220,7 +220,9 @@
Then define a function \<open>sum_tree ::\<close> \<^typ>\<open>nat tree \<Rightarrow> nat\<close>
that sums up all values in a tree of natural numbers
and prove \<^prop>\<open>sum_tree t = sum_list(contents t)\<close>
-(where \<^const>\<open>sum_list\<close> is predefined).
+where \<^const>\<open>sum_list\<close> is predefined by the equations
+@{thm sum_list.Nil[where 'a=nat]} and
+@{thm sum_list.Cons}.
\end{exercise}
\begin{exercise}
@@ -272,8 +274,7 @@
empty. Note that \<^const>\<open>itrev\<close> is tail-recursive: it can be
compiled into a loop; no stack is necessary for executing it.
-Naturally, we would like to show that \<^const>\<open>itrev\<close> does indeed reverse
-its first argument provided the second one is empty:
+Naturally, we would like to show that \<^const>\<open>itrev\<close> reverses its first argument:
\<close>
lemma "itrev xs [] = rev xs"
@@ -323,7 +324,7 @@
(*>*)
apply(induction xs arbitrary: ys)
-txt\<open>The induction hypothesis in the induction step is now universally quantified over \<open>ys\<close>:
+txt\<open>The induction hypothesis is now universally quantified over \<open>ys\<close>:
@{subgoals[display,margin=65]}
Thus the proof succeeds:
\<close>
--- a/src/Doc/Sledgehammer/document/root.tex Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Doc/Sledgehammer/document/root.tex Fri Sep 02 13:41:55 2022 +0200
@@ -109,8 +109,9 @@
Vampire \cite{riazanov-voronkov-2002}, Waldmeister \cite{waldmeister}, and
Zipperposition \cite{cruanes-2014}. The ATPs are run either locally or remotely
via the System\-On\-TPTP web service \cite{sutcliffe-2000}. The supported SMT
-solvers are CVC4 \cite{cvc4}, veriT \cite{bouton-et-al-2009}, and Z3
-\cite{de-moura-2008}. These are always run locally.
+solvers are CVC4 \cite{cvc4}, cvc5 \cite{barbosa-et-al-cvc5}, veriT
+\cite{bouton-et-al-2009}, and Z3 \cite{de-moura-2008}. These are always run
+locally.
The problem passed to the external provers (or solvers) consists of your current
goal together with a heuristic selection of hundreds of facts (theorems) from the
@@ -151,15 +152,15 @@
and Zipperposition can be run locally; in addition, agsyHOL, Alt-Ergo, E,
iProver, LEO-II, Leo-III, Satallax, Vampire, Waldmeister, and Zipperposition are
available remotely via System\-On\-TPTP \cite{sutcliffe-2000}. The SMT solvers
-CVC4, veriT, and Z3 can be run locally.
+CVC4, cvc5, veriT, and Z3 can be run locally.
There are three main ways to install automatic provers on your machine:
\begin{sloppy}
\begin{enum}
\item[\labelitemi] If you installed an official Isabelle package, it should
-already include properly set up executables for CVC4, E, SPASS, Vampire, veriT,
-Z3, and Zipperposition ready to use.
+already include properly set up executables for CVC4, cvc5, E, SPASS, Vampire,
+veriT, Z3, and Zipperposition ready to use.
\item[\labelitemi] Alternatively, you can download the Isabelle-aware CVC4, E,
SPASS, Vampire, veriT, Z3, and Zipperposition binary packages from \download.
@@ -191,10 +192,11 @@
\texttt{LEO3\_VERSION}, \texttt{SATALLAX\_VERSION}, or
\texttt{ZIPPERPOSITION\_VERSION} to the prover's version number (e.g., ``3.6'').
-Similarly, if you want to install CVC4, veriT, or Z3, set the environment
-variable \texttt{CVC4\_\allowbreak SOLVER}, \texttt{ISABELLE\_\allowbreak VERIT},
+Similarly, if you want to install CVC4, cvc5, veriT, or Z3, set the environment
+variable \texttt{CVC4\_\allowbreak SOLVER}, \texttt{CVC5\_\allowbreak SOLVER},
+\texttt{ISABELLE\_\allowbreak VERIT},
or \texttt{Z3\_SOLVER} to the complete path of the executable, \emph{including
-the file name}. Ideally, also set \texttt{CVC4\_VERSION},
+the file name}. Ideally, also set \texttt{CVC4\_VERSION}, \texttt{CVC5\_VERSION},
\texttt{VERIT\_VERSION}, or \texttt{Z3\_VERSION} to the solver's version number
(e.g., ``4.4.0'').
\end{enum}
@@ -673,11 +675,16 @@
requires Alt-Ergo 0.95.2 and Why3 0.83.
\item[\labelitemi] \textbf{\textit{cvc4}:} CVC4 is an SMT solver developed by
-Clark Barrett, Cesare Tinelli, and their colleagues \cite{cvc4}. To use CVC4,
+Barrett et al.\ \cite{cvc4}. To use CVC4,
set the environment variable \texttt{CVC4\_SOLVER} to the complete path of the
executable, including the file name, or install the prebuilt CVC4 package from
\download.
+\item[\labelitemi] \textbf{\textit{cvc5}:} cvc5 is an SMT solver developed by
+Barbosa et al.\ \cite{barbosa-et-al-cvc5}. To use cvc5,
+set the environment variable \texttt{CVC5\_SOLVER} to the complete path of the
+executable, including the file name.
+
\item[\labelitemi] \textbf{\textit{e}:} E is a first-order resolution prover
developed by Stephan Schulz \cite{schulz-2019}. To use E, set the environment
variable \texttt{E\_HOME} to the directory that contains the \texttt{eproof}
@@ -776,10 +783,10 @@
version of Zipperposition runs on Geoff Sutcliffe's Miami servers.
\end{enum}
-By default, Sledgehammer runs a subset of CVC4, E, SPASS, Vampire, veriT, and
-Z3 in parallel, either locally or remotely---depending on the number of
-processor cores available and on which provers are actually installed. It is
-generally desirable to run several provers in parallel.
+By default, Sledgehammer runs a subset of CVC4, E, SPASS, Vampire, veriT, Z3,
+and Zipperposition in parallel, either locally or remotely---depending on the
+number of processor cores available and on which provers are actually installed.
+It is generally beneficial to run several provers in parallel.
\opnodefault{prover}{string}
Alias for \textit{provers}.
@@ -1122,9 +1129,9 @@
\opsmart{isar\_proofs}{no\_isar\_proofs}
Specifies whether Isar proofs should be output in addition to one-line proofs.
The construction of Isar proof is still experimental and may sometimes fail;
-however, when they succeed they are usually faster and more intelligible than
-one-line proofs. If the option is set to \textit{smart} (the default), Isar
-proofs are only generated when no working one-line proof is available.
+however, when they succeed they can be faster and sometimes more intelligible
+than one-line proofs. If the option is set to \textit{smart} (the default), Isar
+proofs are generated only when no working one-line proof is available.
\opdefault{compress}{int}{smart}
Specifies the granularity of the generated Isar proofs if \textit{isar\_proofs}
@@ -1184,14 +1191,13 @@
Specifies the maximum number of seconds that the automatic provers should spend
searching for a proof. This excludes problem preparation and is a soft limit.
-\opdefault{slices}{int}{\upshape 6 times the number of cores detected}
-Specifies the number of time slices. Each time slice corresponds to a prover
-invocation and has its own set of options. For example, for SPASS, one slice
-might specify the fast but incomplete set-of-support (SOS) strategy with 100
-relevant lemmas, whereas other slices might run without SOS and with 500 lemmas.
-Slicing (and thereby parallelism) can be disable by setting \textit{slices} to
-1. Since slicing is a valuable optimization, you should probably leave it
-enabled unless you are conducting experiments.
+\opdefault{slices}{int}{\upshape 12 times the number of cores detected}
+Specifies the number of time slices. Time slices are the basic unit for prover
+invocations. They are divided among the available provers. A single prover
+invocation can occupy a single slice, two slices, or more, depending on the
+prover. Slicing (and thereby parallelism) can be disable by setting
+\textit{slices} to 1. Since slicing is a valuable optimization, you should
+probably leave it enabled unless you are conducting experiments.
\nopagebreak
{\small See also \textit{verbose} (\S\ref{output-format}).}
--- a/src/Doc/System/Phabricator.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Doc/System/Phabricator.thy Fri Sep 02 13:41:55 2022 +0200
@@ -29,19 +29,20 @@
providers --- there is no need to follow big cloud corporations. So it is
feasible to remain the master of your virtual home, following the slogan
``own all your data''. In many respects, Phabricator is similar to the
- well-known Nextcloud\<^footnote>\<open>\<^url>\<open>https://nextcloud.org\<close>\<close> product, concerning both
+ well-known Nextcloud\<^footnote>\<open>\<^url>\<open>https://nextcloud.com\<close>\<close> product, concerning both
the technology and sociology.
\<^medskip>
The following Phabricator instances may serve as examples:
- \<^item> Phabricator development \<^url>\<open>https://secure.phabricator.com\<close>
\<^item> Wikimedia development \<^url>\<open>https://phabricator.wikimedia.org\<close>
\<^item> Blender development \<^url>\<open>https://developer.blender.org\<close>
\<^item> LLVM development \<^url>\<open>https://reviews.llvm.org\<close>
\<^item> Mozilla development \<^url>\<open>https://phabricator.services.mozilla.com\<close>
- \<^item> Mercurial development \<^url>\<open>https://phab.mercurial-scm.org\<close>
\<^item> Isabelle development \<^url>\<open>https://isabelle-dev.sketis.net\<close>
+ \<^item> Phabricator development (inactive) \<^url>\<open>https://secure.phabricator.com\<close>
+ \<^item> Phorge development (planned successor of Phabricator)
+ \<^url>\<open>https://we.phorge.it\<close>
\<^medskip>
Initial Phabricator configuration requires many details to be done right.
@@ -234,7 +235,7 @@
\<^item> Install \<^verbatim>\<open>certbot\<close> from \<^url>\<open>https://certbot.eff.org\<close> following the
description for Apache and Ubuntu 20.04 on
- \<^url>\<open>https://certbot.eff.org/lets-encrypt/ubuntubionic-apache\<close>. Run
+ \<^url>\<open>https://certbot.eff.org/instructions?ws=apache&os=ubuntufocal\<close>. Run
\<^verbatim>\<open>certbot\<close> interactively and let it operate on the domain
\<^verbatim>\<open>vcs.example.org\<close>.
--- a/src/Doc/System/Presentation.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Doc/System/Presentation.thy Fri Sep 02 13:41:55 2022 +0200
@@ -186,8 +186,7 @@
Further engines can be defined by add-on components in Isabelle/Scala
(\secref{sec:scala-build}), providing a service class derived from
- \<^scala_type>\<open>isabelle.Document_Build.Engine\<close>. Available classes are listed
- in \<^scala>\<open>isabelle.Document_Build.engines\<close>.
+ \<^scala_type>\<open>isabelle.Document_Build.Engine\<close>.
\<close>
--- a/src/Doc/System/Scala.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Doc/System/Scala.thy Fri Sep 02 13:41:55 2022 +0200
@@ -256,7 +256,7 @@
Option \<^verbatim>\<open>-q\<close> suppresses all output on stdout/stderr produced by the Scala or
Java compiler.
- \<^medskip> Explicit invocation of \<^verbatim>\<open>isabelle scala_build\<close> mainly serves testing or
+ \<^medskip> Explicit invocation of @{tool scala_build} mainly serves testing or
applications with special options: the Isabelle system normally does an
automatic the build on demand.
\<close>
--- a/src/Doc/System/Sessions.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Doc/System/Sessions.thy Fri Sep 02 13:41:55 2022 +0200
@@ -38,18 +38,23 @@
The ROOT file format follows the lexical conventions of the \<^emph>\<open>outer syntax\<close>
of Isabelle/Isar, see also @{cite "isabelle-isar-ref"}. This defines common
forms like identifiers, names, quoted strings, verbatim text, nested
- comments etc. The grammar for @{syntax session_chapter} and @{syntax
- session_entry} is given as syntax diagram below; each ROOT file may contain
- multiple specifications like this. Chapters help to organize browser info
- (\secref{sec:info}), but have no formal meaning. The default chapter is
- ``\<open>Unsorted\<close>''.
+ comments etc. The grammar for @{syntax chapter_def}, @{syntax chapter_entry}
+ and @{syntax session_entry} is given as syntax diagram below. Each ROOT file
+ may contain multiple specifications like this. Chapters help to organize
+ browser info (\secref{sec:info}), but have no formal meaning. The default
+ chapter is ``\<open>Unsorted\<close>''. Chapter definitions, which are optional, allow to
+ associate additional information.
Isabelle/jEdit @{cite "isabelle-jedit"} includes a simple editing mode
\<^verbatim>\<open>isabelle-root\<close> for session ROOT files, which is enabled by default for any
file of that name.
\<^rail>\<open>
- @{syntax_def session_chapter}: @'chapter' @{syntax name}
+ @{syntax_def chapter_def}: @'chapter_definition' @{syntax name} \<newline>
+ groups? description?
+ ;
+
+ @{syntax_def chapter_entry}: @'chapter' @{syntax name}
;
@{syntax_def session_entry}: @'session' @{syntax system_name} groups? dir? '=' \<newline>
@@ -86,6 +91,10 @@
(@{syntax embedded}+)
\<close>
+ \<^descr> \isakeyword{chapter{\isacharunderscorekeyword}definition}~\<open>A (groups)\<close>
+ associates a collection of groups with chapter \<open>A\<close>. All sessions that belong
+ to this chapter will automatically become members of these groups.
+
\<^descr> \isakeyword{session}~\<open>A = B + body\<close> defines a new session \<open>A\<close> based on
parent session \<open>B\<close>, with its content given in \<open>body\<close> (imported sessions and
theories). Note that a parent (like \<open>HOL\<close>) is mandatory in practical
@@ -110,8 +119,8 @@
All theory files are located relatively to the session directory. The prover
process is run within the same as its current working directory.
- \<^descr> \isakeyword{description}~\<open>text\<close> is a free-form annotation for this
- session.
+ \<^descr> \isakeyword{description}~\<open>text\<close> is a free-form description for this
+ session (or chapter), e.g. for presentation purposes.
\<^descr> \isakeyword{options}~\<open>[x = a, y = b, z]\<close> defines separate options
(\secref{sec:system-options}) that are used when processing this session,
--- a/src/Doc/manual.bib Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Doc/manual.bib Fri Sep 02 13:41:55 2022 +0200
@@ -181,6 +181,36 @@
editor = {A. Robinson and A. Voronkov}
}
+@inproceedings{barbosa-et-al-cvc5,
+ author = {Haniel Barbosa and
+ Clark W. Barrett and
+ Martin Brain and
+ Gereon Kremer and
+ Hanna Lachnitt and
+ Makai Mann and
+ Abdalrhman Mohamed and
+ Mudathir Mohamed and
+ Aina Niemetz and
+ Andres N{\"{o}}tzli and
+ Alex Ozdemir and
+ Mathias Preiner and
+ Andrew Reynolds and
+ Ying Sheng and
+ Cesare Tinelli and
+ Yoni Zohar},
+ editor = {Dana Fisman and
+ Grigore Rosu},
+ title = {{cvc5}: A Versatile and Industrial-Strength {SMT} Solver},
+ booktitle = "Tools and Algorithms for the Construction and Analysis of Systems: TACAS 2022 (I)",
+ series = {Lecture Notes in Computer Science},
+ volume = {13243},
+ pages = {415--442},
+ publisher = {Springer},
+ year = {2022},
+ XXXurl = {https://doi.org/10.1007/978-3-030-99524-9\_24},
+ XXXdoi = {10.1007/978-3-030-99524-9\_24},
+}
+
@inproceedings{cvc3,
author = {Clark Barrett and Cesare Tinelli},
title = {{CVC3}},
--- a/src/FOLP/ROOT Sat Jun 25 13:34:41 2022 +0200
+++ b/src/FOLP/ROOT Fri Sep 02 13:41:55 2022 +0200
@@ -1,4 +1,4 @@
-chapter FOLP
+chapter FOL
session FOLP = Pure +
description "
--- a/src/HOL/Algebra/Ideal_Product.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Algebra/Ideal_Product.thy Fri Sep 02 13:41:55 2022 +0200
@@ -49,7 +49,7 @@
assumes "ideal I R" "ideal J R"
shows "ideal (I \<cdot> J) R"
proof (rule idealI)
- show "ring R" using is_ring .
+ show "ring R" using ring_axioms .
next
show "subgroup (I \<cdot> J) (add_monoid R)"
unfolding subgroup_def
--- a/src/HOL/Algebra/README.html Sat Jun 25 13:34:41 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
-<HTML>
-
-<HEAD>
- <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
- <TITLE>HOL/Algebra/README.html</TITLE>
-</HEAD>
-
-<BODY>
-
-<H1>Algebra --- Classical Algebra, using Explicit Structures and Locales</H1>
-
-This directory contains proofs in classical algebra. It is intended
-as a base for any algebraic development in Isabelle. Emphasis is on
-reusability. This is achieved by modelling algebraic structures
-as first-class citizens of the logic (not axiomatic type classes, say).
-The library is expected to grow in future releases of Isabelle.
-Contributions are welcome.
-
-<H2>GroupTheory, including Sylow's Theorem</H2>
-
-<P>These proofs are mainly by Florian Kammüller. (Later, Larry
-Paulson simplified some of the proofs.) These theories were indeed
-the original motivation for locales.
-
-Here is an outline of the directory's contents: <UL> <LI>Theory <A
-HREF="Group.html"><CODE>Group</CODE></A> defines semigroups, monoids,
-groups, commutative monoids, commutative groups, homomorphisms and the
-subgroup relation. It also defines the product of two groups
-(This theory was reimplemented by Clemens Ballarin).
-
-<LI>Theory <A HREF="FiniteProduct.html"><CODE>FiniteProduct</CODE></A> extends
-commutative groups by a product operator for finite sets (provided by
-Clemens Ballarin).
-
-<LI>Theory <A HREF="Coset.html"><CODE>Coset</CODE></A> defines
-the factorization of a group and shows that the factorization a normal
-subgroup is a group.
-
-<LI>Theory <A HREF="Bij.html"><CODE>Bij</CODE></A>
-defines bijections over sets and operations on them and shows that they
-are a group. It shows that automorphisms form a group.
-
-<LI>Theory <A HREF="Exponent.html"><CODE>Exponent</CODE></A> the
- combinatorial argument underlying Sylow's first theorem.
-
-<LI>Theory <A HREF="Sylow.html"><CODE>Sylow</CODE></A>
-contains a proof of the first Sylow theorem.
-</UL>
-
-<H2>Rings and Polynomials</H2>
-
-<UL><LI>Theory <A HREF="Ring.html"><CODE>CRing</CODE></A>
-defines Abelian monoids and groups. The difference to commutative
- structures is merely notational: the binary operation is
- addition rather than multiplication. Commutative rings are
- obtained by inheriting properties from Abelian groups and
- commutative monoids. Further structures in the algebraic
- hierarchy of rings: integral domain.
-
-<LI>Theory <A HREF="Module.html"><CODE>Module</CODE></A>
-introduces the notion of a R-left-module over an Abelian group, where
- R is a ring.
-
-<LI>Theory <A HREF="UnivPoly.html"><CODE>UnivPoly</CODE></A>
-constructs univariate polynomials over rings and integral domains.
- Degree function. Universal Property.
-</UL>
-
-<H2>Development of Polynomials using Type Classes</H2>
-
-<P>A development of univariate polynomials for HOL's ring classes
-is available at <CODE>HOL/Library/Polynomial</CODE>.
-
-<P>[Jacobson1985] Nathan Jacobson, Basic Algebra I, Freeman, 1985.
-
-<P>[Ballarin1999] Clemens Ballarin, Computer Algebra and Theorem Proving,
- Author's PhD thesis, 1999. Also University of Cambridge, Computer Laboratory Technical Report number 473.
-
-<ADDRESS>
-<P><A HREF="http://www21.in.tum.de/~ballarin">Clemens Ballarin</A>.
-</ADDRESS>
-</BODY>
-</HTML>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/Algebra/README.thy Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,74 @@
+theory README imports Main
+begin
+
+section \<open>Algebra --- Classical Algebra, using Explicit Structures and Locales\<close>
+
+text \<open>
+ This directory contains proofs in classical algebra. It is intended as a
+ base for any algebraic development in Isabelle. Emphasis is on reusability.
+ This is achieved by modelling algebraic structures as first-class citizens
+ of the logic (not axiomatic type classes, say). The library is expected to
+ grow in future releases of Isabelle. Contributions are welcome.
+\<close>
+
+subsection \<open>GroupTheory, including Sylow's Theorem\<close>
+
+text \<open>
+ These proofs are mainly by Florian Kammüller. (Later, Larry Paulson
+ simplified some of the proofs.) These theories were indeed the original
+ motivation for locales.
+
+ Here is an outline of the directory's contents:
+
+ \<^item> Theory \<^file>\<open>Group.thy\<close> defines semigroups, monoids, groups, commutative
+ monoids, commutative groups, homomorphisms and the subgroup relation. It
+ also defines the product of two groups (This theory was reimplemented by
+ Clemens Ballarin).
+
+ \<^item> Theory \<^file>\<open>FiniteProduct.thy\<close> extends commutative groups by a product
+ operator for finite sets (provided by Clemens Ballarin).
+
+ \<^item> Theory \<^file>\<open>Coset.thy\<close> defines the factorization of a group and shows that
+ the factorization a normal subgroup is a group.
+
+ \<^item> Theory \<^file>\<open>Bij.thy\<close> defines bijections over sets and operations on them and
+ shows that they are a group. It shows that automorphisms form a group.
+
+ \<^item> Theory \<^file>\<open>Exponent.thy\<close> the combinatorial argument underlying Sylow's
+ first theorem.
+
+ \<^item> Theory \<^file>\<open>Sylow.thy\<close> contains a proof of the first Sylow theorem.
+\<close>
+
+
+subsection \<open>Rings and Polynomials\<close>
+
+text \<open>
+ \<^item> Theory \<^file>\<open>Ring.thy\<close> defines Abelian monoids and groups. The difference to
+ commutative structures is merely notational: the binary operation is
+ addition rather than multiplication. Commutative rings are obtained by
+ inheriting properties from Abelian groups and commutative monoids. Further
+ structures in the algebraic hierarchy of rings: integral domain.
+
+ \<^item> Theory \<^file>\<open>Module.thy\<close> introduces the notion of a R-left-module over an
+ Abelian group, where R is a ring.
+
+ \<^item> Theory \<^file>\<open>UnivPoly.thy\<close> constructs univariate polynomials over rings and
+ integral domains. Degree function. Universal Property.
+\<close>
+
+
+subsection \<open>Development of Polynomials using Type Classes\<close>
+
+text \<open>
+ A development of univariate polynomials for HOL's ring classes is available
+ at \<^file>\<open>~~/src/HOL/Computational_Algebra/Polynomial.thy\<close>.
+
+ [Jacobson1985] Nathan Jacobson, Basic Algebra I, Freeman, 1985.
+
+ [Ballarin1999] Clemens Ballarin, Computer Algebra and Theorem Proving,
+ Author's PhD thesis, 1999. Also University of Cambridge, Computer Laboratory
+ Technical Report number 473.
+\<close>
+
+end
--- a/src/HOL/Algebra/Ring.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Algebra/Ring.thy Fri Sep 02 13:41:55 2022 +0200
@@ -292,10 +292,8 @@
lemma is_monoid: "monoid R"
by (auto intro!: monoidI m_assoc)
-lemma is_ring: "ring R"
- by (rule ring_axioms)
+end
-end
thm monoid_record_simps
lemmas ring_record_simps = monoid_record_simps ring.simps
--- a/src/HOL/Algebra/RingHom.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Algebra/RingHom.thy Fri Sep 02 13:41:55 2022 +0200
@@ -98,7 +98,7 @@
\<comment> \<open>the kernel of a ring homomorphism is an ideal\<close>
lemma (in ring_hom_ring) kernel_is_ideal: "ideal (a_kernel R S h) R"
- apply (rule idealI [OF R.is_ring])
+ apply (rule idealI [OF R.ring_axioms])
apply (rule additive_subgroup.a_subgroup[OF additive_subgroup_a_kernel])
apply (auto simp: a_kernel_def')
done
--- a/src/HOL/Algebra/UnivPoly.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Algebra/UnivPoly.thy Fri Sep 02 13:41:55 2022 +0200
@@ -501,11 +501,8 @@
Interpretation of lemmas from \<^term>\<open>algebra\<close>.
\<close>
-lemma (in cring) cring:
- "cring R" ..
-
lemma (in UP_cring) UP_algebra:
- "algebra R P" by (auto intro!: algebraI R.cring UP_cring UP_smult_l_distr UP_smult_r_distr
+ "algebra R P" by (auto intro!: algebraI R.cring_axioms UP_cring UP_smult_l_distr UP_smult_r_distr
UP_smult_assoc1 UP_smult_assoc2)
sublocale UP_cring < algebra R P using UP_algebra .
--- a/src/HOL/Analysis/Infinite_Products.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Analysis/Infinite_Products.thy Fri Sep 02 13:41:55 2022 +0200
@@ -145,6 +145,30 @@
by blast
qed (auto simp: prod_defs)
+lemma raw_has_prod_norm:
+ fixes a :: "'a ::real_normed_field"
+ assumes "raw_has_prod f M a"
+ shows "raw_has_prod (\<lambda>n. norm (f n)) M (norm a)"
+ using assms by (auto simp: raw_has_prod_def prod_norm tendsto_norm)
+
+lemma has_prod_norm:
+ fixes a :: "'a ::real_normed_field"
+ assumes f: "f has_prod a"
+ shows "(\<lambda>n. norm (f n)) has_prod (norm a)"
+ using f [unfolded has_prod_def]
+proof (elim disjE exE conjE)
+ assume f0: "raw_has_prod f 0 a"
+ then show "(\<lambda>n. norm (f n)) has_prod norm a"
+ using has_prod_def raw_has_prod_norm by blast
+next
+ fix i p
+ assume "a = 0" and "f i = 0" and p: "raw_has_prod f (Suc i) p"
+ then have "Ex (raw_has_prod (\<lambda>n. norm (f n)) (Suc i))"
+ using raw_has_prod_norm by blast
+ then show ?thesis
+ by (metis \<open>a = 0\<close> \<open>f i = 0\<close> has_prod_0_iff norm_zero)
+qed
+
subsection\<open>Absolutely convergent products\<close>
--- a/src/HOL/Analysis/Weierstrass_Theorems.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Analysis/Weierstrass_Theorems.thy Fri Sep 02 13:41:55 2022 +0200
@@ -853,11 +853,31 @@
using polynomial_function_diff [of f]
by (simp add: real_polynomial_function_eq)
+lemma real_polynomial_function_divide [intro]:
+ assumes "real_polynomial_function p" shows "real_polynomial_function (\<lambda>x. p x / c)"
+proof -
+ have "real_polynomial_function (\<lambda>x. p x * Fields.inverse c)"
+ using assms by auto
+ then show ?thesis
+ by (simp add: divide_inverse)
+qed
+
lemma real_polynomial_function_sum [intro]:
"\<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> real_polynomial_function (\<lambda>x. f x i)\<rbrakk> \<Longrightarrow> real_polynomial_function (\<lambda>x. sum (f x) I)"
using polynomial_function_sum [of I f]
by (simp add: real_polynomial_function_eq)
+lemma real_polynomial_function_prod [intro]:
+ "\<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> real_polynomial_function (\<lambda>x. f x i)\<rbrakk> \<Longrightarrow> real_polynomial_function (\<lambda>x. prod (f x) I)"
+ by (induct I rule: finite_induct) auto
+
+lemma real_polynomial_function_gchoose:
+ obtains p where "real_polynomial_function p" "\<And>x. x gchoose r = p x"
+proof
+ show "real_polynomial_function (\<lambda>x. (\<Prod>i = 0..<r. x - real i) / fact r)"
+ by force
+qed (simp add: gbinomial_prod_rev)
+
lemma real_polynomial_function_power [intro]:
"real_polynomial_function f \<Longrightarrow> real_polynomial_function (\<lambda>x. f x^n)"
by (induct n) (simp_all add: const mult)
--- a/src/HOL/Archimedean_Field.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Archimedean_Field.thy Fri Sep 02 13:41:55 2022 +0200
@@ -243,7 +243,7 @@
lemma floor_le_iff: "\<lfloor>x\<rfloor> \<le> z \<longleftrightarrow> x < of_int z + 1"
by (simp add: not_less [symmetric] less_floor_iff)
-lemma floor_split[arith_split]: "P \<lfloor>t\<rfloor> \<longleftrightarrow> (\<forall>i. of_int i \<le> t \<and> t < of_int i + 1 \<longrightarrow> P i)"
+lemma floor_split[linarith_split]: "P \<lfloor>t\<rfloor> \<longleftrightarrow> (\<forall>i. of_int i \<le> t \<and> t < of_int i + 1 \<longrightarrow> P i)"
by (metis floor_correct floor_unique less_floor_iff not_le order_refl)
lemma floor_mono:
@@ -618,7 +618,7 @@
lemma ceiling_diff_one [simp]: "\<lceil>x - 1\<rceil> = \<lceil>x\<rceil> - 1"
using ceiling_diff_of_int [of x 1] by simp
-lemma ceiling_split[arith_split]: "P \<lceil>t\<rceil> \<longleftrightarrow> (\<forall>i. of_int i - 1 < t \<and> t \<le> of_int i \<longrightarrow> P i)"
+lemma ceiling_split[linarith_split]: "P \<lceil>t\<rceil> \<longleftrightarrow> (\<forall>i. of_int i - 1 < t \<and> t \<le> of_int i \<longrightarrow> P i)"
by (auto simp add: ceiling_unique ceiling_correct)
lemma ceiling_diff_floor_le_1: "\<lceil>x\<rceil> - \<lfloor>x\<rfloor> \<le> 1"
--- a/src/HOL/Auth/Guard/README.html Sat Jun 25 13:34:41 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
-<HTML>
-
-<HEAD>
- <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
- <TITLE>HOL/Auth/Guard/README.html</TITLE>
-</HEAD>
-
-<BODY>
-
-<H1>Protocol-Independent Secrecy Results</H1>
-
-date: april 2002
-author: Frederic Blanqui
-email: blanqui@lri.fr
-webpage:
-
-<P>The current development is built above the HOL (Higher-Order Logic)
-Isabelle theory and the formalization of protocols introduced by <A
-HREF="http://www.cl.cam.ac.uk/users/lcp/">Larry Paulson</A>. More details are
-in his paper <A
-HREF="http://www.cl.cam.ac.uk/users/lcp/papers/Auth/jcs.pdf">
-The Inductive approach
-to verifying cryptographic protocols</A> (J. Computer Security 6, pages
-85-128, 1998).
-
-<P>
-This directory contains a number of files:
-
-<UL>
-<LI>Extensions.thy contains extensions of Larry Paulson's files with many useful
-lemmas.
-
-<LI>Analz contains an important theorem about the decomposition of analz
-between pparts (pairs) and kparts (messages that are not pairs).
-
-<LI>Guard contains the protocol-independent secrecy theorem for nonces.
-<LI>GuardK is the same for keys.
-<LI>Guard_Public extends Guard and GuardK for public-key protocols.
-<LI>Guard_Shared extends Guard and GuardK for symmetric-key protocols.
-
-<LI>List_Msg contains definitions on lists (inside messages).
-
-<LI>P1 contains the definition of the protocol P1 and the proof of its
-properties (strong forward integrity, insertion resilience, truncation
-resilience, data confidentiality and non-repudiability)
-
-<LI>P2 is the same for the protocol P2
-
-<LI>NS_Public is for Needham-Schroeder-Lowe
-<LI>OtwayRees is for Otway-Rees
-<LI>Yahalom is for Yahalom
-
-<LI>Proto contains a more precise formalization of protocols with rules
-and a protocol-independent theorem for proving guardness from a preservation
-property. It also contains the proofs for Needham-Schroeder as an example.
-</UL>
-
-<HR>
-<P>Last modified 20 August 2002
-
-<ADDRESS>
-<A HREF="http://www.lri.fr/~blanqui/">Frederic Blanqui</A>,
-<A HREF="mailto:blanqui@lri.fr">blanqui@lri.fr</A>
-</ADDRESS>
-</BODY>
-</HTML>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/Auth/Guard/README_Guard.thy Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,57 @@
+theory README_Guard imports Main
+begin
+
+section \<open>Protocol-Independent Secrecy Results\<close>
+
+text \<open>
+ \<^item> date: April 2002
+ \<^item> author: Frederic Blanqui
+ \<^item> email: blanqui@lri.fr
+
+ The current development is built above the HOL (Higher-Order Logic) Isabelle
+ theory and the formalization of protocols introduced by Larry Paulson. More
+ details are in his paper
+ \<^url>\<open>https://www.cl.cam.ac.uk/users/lcp/papers/Auth/jcs.pdf\<close>: \<^emph>\<open>The Inductive
+ approach to verifying cryptographic protocols\<close> (J. Computer Security 6,
+ pages 85-128, 1998).
+
+ This directory contains a number of files:
+
+ \<^item> \<^file>\<open>Extensions.thy\<close> contains extensions of Larry Paulson's files with
+ many useful lemmas.
+
+ \<^item> \<^file>\<open>Analz.thy\<close> contains an important theorem about the decomposition of
+ analz between pparts (pairs) and kparts (messages that are not pairs).
+
+ \<^item> \<^file>\<open>Guard.thy\<close> contains the protocol-independent secrecy theorem for
+ nonces.
+
+ \<^item> \<^file>\<open>GuardK.thy\<close> is the same for keys.
+
+ \<^item> \<^file>\<open>Guard_Public.thy\<close> extends \<^file>\<open>Guard.thy\<close> and \<^file>\<open>GuardK.thy\<close> for
+ public-key protocols.
+
+ \<^item> \<^file>\<open>Guard_Shared.thy\<close> extends \<^file>\<open>Guard.thy\<close> and \<^file>\<open>GuardK.thy\<close> for
+ symmetric-key protocols.
+
+ \<^item> \<^file>\<open>List_Msg.thy\<close> contains definitions on lists (inside messages).
+
+ \<^item> \<^file>\<open>P1.thy\<close> contains the definition of the protocol P1 and the proof of
+ its properties (strong forward integrity, insertion resilience,
+ truncation resilience, data confidentiality and non-repudiability).
+
+ \<^item> \<^file>\<open>P2.thy\<close> is the same for the protocol P2
+
+ \<^item> \<^file>\<open>Guard_NS_Public.thy\<close> is for Needham-Schroeder-Lowe
+
+ \<^item> \<^file>\<open>Guard_OtwayRees.thy\<close> is for Otway-Rees
+
+ \<^item> \<^file>\<open>Guard_Yahalom.thy\<close> is for Yahalom
+
+ \<^item> \<^file>\<open>Proto.thy\<close> contains a more precise formalization of protocols with
+ rules and a protocol-independent theorem for proving guardness from a
+ preservation property. It also contains the proofs for Needham-Schroeder
+ as an example.
+\<close>
+
+end
--- a/src/HOL/Auth/README.html Sat Jun 25 13:34:41 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
-<HTML>
-
-<HEAD>
- <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
- <TITLE>HOL/Auth/README</TITLE>
-</HEAD>
-
-<BODY>
-
-<H1>Auth--The Inductive Approach to Verifying Security Protocols</H1>
-
-<P>Cryptographic protocols are of major importance, especially with the
-growing use of the Internet. This directory demonstrates the ``inductive
-method'' of protocol verification, which is described in <A
-HREF="http://www.cl.cam.ac.uk/users/lcp/papers/protocols.html">various
-papers</A>. The operational semantics of protocol participants is defined
-inductively.
-
-<P>This directory contains proofs concerning
-
-<UL>
-<LI>three versions of the Otway-Rees protocol
-
-<LI>the Needham-Schroeder shared-key protocol
-
-<LI>the Needham-Schroeder public-key protocol (original and with Lowe's
-modification)
-
-<LI>two versions of Kerberos: the simplified form published in the BAN paper
- and also the full protocol (Kerberos IV)
-
-<LI>three versions of the Yahalom protocol, including a bad one that
- illustrates the purpose of the Oops rule
-
-<LI>a novel recursive authentication protocol
-
-<LI>the Internet protocol TLS
-
-<LI>The certified e-mail protocol of Abadi et al.
-</UL>
-
-<P>Frederic Blanqui has contributed a theory of guardedness, which is
-demonstrated by proofs of some roving agent protocols.
-
-<ADDRESS>
-<A
-HREF="http://www.cl.cam.ac.uk/users/lcp/">Larry Paulson</A>,
-<A HREF="mailto:lcp@cl.cam.ac.uk">lcp@cl.cam.ac.uk</A>
-</ADDRESS>
-</BODY>
-</HTML>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/Auth/README.thy Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,38 @@
+theory README imports Main
+begin
+
+section \<open>Auth--The Inductive Approach to Verifying Security Protocols\<close>
+
+text \<open>
+ Cryptographic protocols are of major importance, especially with the growing
+ use of the Internet. This directory demonstrates the ``inductive method'' of
+ protocol verification, which is described in papers:
+ \<^url>\<open>http://www.cl.cam.ac.uk/users/lcp/papers/protocols.html\<close>. The operational
+ semantics of protocol participants is defined inductively.
+
+ This directory contains proofs concerning:
+
+ \<^item> three versions of the Otway-Rees protocol
+
+ \<^item> the Needham-Schroeder shared-key protocol
+
+ \<^item> the Needham-Schroeder public-key protocol (original and with Lowe's
+ modification)
+
+ \<^item> two versions of Kerberos: the simplified form published in the BAN paper
+ and also the full protocol (Kerberos IV)
+
+ \<^item> three versions of the Yahalom protocol, including a bad one that
+ illustrates the purpose of the Oops rule
+
+ \<^item> a novel recursive authentication protocol
+
+ \<^item> the Internet protocol TLS
+
+ \<^item> The certified e-mail protocol of Abadi et al.
+
+ Frederic Blanqui has contributed a theory of guardedness, which is
+ demonstrated by proofs of some roving agent protocols.
+\<close>
+
+end
--- a/src/HOL/BNF_Wellorder_Constructions.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/BNF_Wellorder_Constructions.thy Fri Sep 02 13:41:55 2022 +0200
@@ -106,12 +106,22 @@
lemma ofilter_Restr_under:
assumes WELL: "Well_order r" and OF: "wo_rel.ofilter r A" and IN: "a \<in> A"
shows "under (Restr r A) a = under r a"
-using assms wo_rel_def
-proof(auto simp add: wo_rel.ofilter_def under_def)
- fix b assume *: "a \<in> A" and "(b,a) \<in> r"
- hence "b \<in> under r a \<and> a \<in> Field r"
- unfolding under_def using Field_def by fastforce
- thus "b \<in> A" using * assms by (auto simp add: wo_rel_def wo_rel.ofilter_def)
+ unfolding wo_rel.ofilter_def under_def
+proof
+ show "{b. (b, a) \<in> Restr r A} \<subseteq> {b. (b, a) \<in> r}"
+ by auto
+next
+ have "under r a \<subseteq> A"
+ proof
+ fix x
+ assume *: "x \<in> under r a"
+ then have "a \<in> Field r"
+ unfolding under_def using Field_def by fastforce
+ then show "x \<in> A" using IN assms *
+ by (auto simp add: wo_rel_def wo_rel.ofilter_def)
+ qed
+ then show "{b. (b, a) \<in> r} \<subseteq> {b. (b, a) \<in> Restr r A}"
+ unfolding under_def using assms by auto
qed
lemma ofilter_embed:
@@ -120,12 +130,13 @@
proof
assume *: "wo_rel.ofilter r A"
show "A \<le> Field r \<and> embed (Restr r A) r id"
- proof(unfold embed_def, auto)
+ unfolding embed_def
+ proof safe
fix a assume "a \<in> A" thus "a \<in> Field r" using assms *
by (auto simp add: wo_rel_def wo_rel.ofilter_def)
next
fix a assume "a \<in> Field (Restr r A)"
- thus "bij_betw id (under (Restr r A) a) (under r a)" using assms *
+ thus "bij_betw id (under (Restr r A) a) (under r (id a))" using assms *
by (simp add: ofilter_Restr_under Field_Restr_ofilter)
qed
next
@@ -160,7 +171,8 @@
by (simp add: Well_order_Restr wo_rel_def)
(* Main proof *)
show ?thesis using WellB assms
- proof(auto simp add: wo_rel.ofilter_def under_def)
+ unfolding wo_rel.ofilter_def under_def ofilter_def
+ proof safe
fix a assume "a \<in> A" and *: "a \<in> B"
hence "a \<in> Field r" using OFA Well by (auto simp add: wo_rel.ofilter_def)
with * show "a \<in> Field ?rB" using Field by auto
@@ -714,7 +726,7 @@
lemma ordLess_iff_ordIso_Restr:
assumes WELL: "Well_order r" and WELL': "Well_order r'"
shows "(r' <o r) = (\<exists>a \<in> Field r. r' =o Restr r (underS r a))"
-proof(auto)
+proof safe
fix a assume *: "a \<in> Field r" and **: "r' =o Restr r (underS r a)"
hence "Restr r (underS r a) <o r" using WELL underS_Restr_ordLess[of r] by blast
thus "r' <o r" using ** ordIso_ordLess_trans by blast
@@ -779,7 +791,7 @@
lemma ordLeq_iff_ordLess_Restr:
assumes WELL: "Well_order r" and WELL': "Well_order r'"
shows "(r \<le>o r') = (\<forall>a \<in> Field r. Restr r (underS r a) <o r')"
-proof(auto)
+proof safe
assume *: "r \<le>o r'"
fix a assume "a \<in> Field r"
hence "Restr r (underS r a) <o r"
@@ -932,7 +944,8 @@
lemma trans_dir_image:
assumes TRANS: "trans r" and INJ: "inj_on f (Field r)"
shows "trans(dir_image r f)"
-proof(unfold trans_def, auto)
+unfolding trans_def
+proof safe
fix a' b' c'
assume "(a',b') \<in> dir_image r f" "(b',c') \<in> dir_image r f"
then obtain a b1 b2 c where 1: "a' = f a \<and> b' = f b1 \<and> b' = f b2 \<and> c' = f c" and
@@ -953,7 +966,8 @@
lemma antisym_dir_image:
assumes AN: "antisym r" and INJ: "inj_on f (Field r)"
shows "antisym(dir_image r f)"
-proof(unfold antisym_def, auto)
+unfolding antisym_def
+proof safe
fix a' b'
assume "(a',b') \<in> dir_image r f" "(b',a') \<in> dir_image r f"
then obtain a1 b1 a2 b2 where 1: "a' = f a1 \<and> a' = f a2 \<and> b' = f b1 \<and> b' = f b2" and
@@ -1096,7 +1110,7 @@
qed
next
show "Field r \<times> Field r \<le> Field (bsqr r)"
- proof(auto)
+ proof safe
fix a1 a2 assume "a1 \<in> Field r" and "a2 \<in> Field r"
hence "((a1,a2),(a1,a2)) \<in> bsqr r" unfolding bsqr_def by blast
thus "(a1,a2) \<in> Field (bsqr r)" unfolding Field_def by auto
@@ -1109,7 +1123,8 @@
lemma bsqr_Trans:
assumes "Well_order r"
shows "trans (bsqr r)"
-proof(unfold trans_def, auto)
+unfolding trans_def
+proof safe
(* Preliminary facts *)
have Well: "wo_rel r" using assms wo_rel_def by auto
hence Trans: "trans r" using wo_rel.TRANS by auto
@@ -1573,12 +1588,11 @@
lemma bij_betw_curr:
"bij_betw (curr A) (Func (A \<times> B) C) (Func A (Func B C))"
-unfolding bij_betw_def inj_on_def image_def
-apply (intro impI conjI ballI)
-apply (erule curr_inj[THEN iffD1], assumption+)
-apply auto
-apply (erule curr_in)
-using curr_surj by blast
+ unfolding bij_betw_def inj_on_def image_def
+ apply (intro impI conjI ballI)
+ apply (erule curr_inj[THEN iffD1], assumption+, safe)
+ using curr_surj curr_in apply blast+
+ done
definition Func_map where
"Func_map B2 f1 f2 g b2 \<equiv> if b2 \<in> B2 then f1 (g (f2 b2)) else undefined"
@@ -1661,7 +1675,7 @@
using j2A2 B1 A2 unfolding j1_def by (fast intro: inv_into_into)+
ultimately show "h \<in> Func_map B2 f1 f2 ` Func A2 A1"
unfolding Func_map_def[abs_def] by auto
- qed(insert B1 Func_map[OF _ _ A2(2)], auto)
+ qed(use B1 Func_map[OF _ _ A2(2)] in auto)
qed
end
--- a/src/HOL/BNF_Wellorder_Relation.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/BNF_Wellorder_Relation.thy Fri Sep 02 13:41:55 2022 +0200
@@ -220,27 +220,26 @@
shows "\<exists>b. isMinim B b"
proof-
from spec[OF WF[unfolded wf_eq_minimal[of "r - Id"]], of B] NE obtain b where
- *: "b \<in> B \<and> (\<forall>b'. b' \<noteq> b \<and> (b',b) \<in> r \<longrightarrow> b' \<notin> B)" by auto
- show ?thesis
- proof(simp add: isMinim_def, rule exI[of _ b], auto)
- show "b \<in> B" using * by simp
- next
- fix b' assume As: "b' \<in> B"
- hence **: "b \<in> Field r \<and> b' \<in> Field r" using As SUB * by auto
- (* *)
- from As * have "b' = b \<or> (b',b) \<notin> r" by auto
- moreover
- {assume "b' = b"
- hence "(b,b') \<in> r"
- using ** REFL by (auto simp add: refl_on_def)
- }
- moreover
- {assume "b' \<noteq> b \<and> (b',b) \<notin> r"
- hence "(b,b') \<in> r"
- using ** TOTAL by (auto simp add: total_on_def)
- }
- ultimately show "(b,b') \<in> r" by blast
+ *: "b \<in> B \<and> (\<forall>b'. b' \<noteq> b \<and> (b',b) \<in> r \<longrightarrow> b' \<notin> B)" by auto
+ have "\<forall>b'. b' \<in> B \<longrightarrow> (b, b') \<in> r"
+ proof
+ fix b'
+ show "b' \<in> B \<longrightarrow> (b, b') \<in> r"
+ proof
+ assume As: "b' \<in> B"
+ hence **: "b \<in> Field r \<and> b' \<in> Field r" using As SUB * by auto
+ from As * have "b' = b \<or> (b',b) \<notin> r" by auto
+ moreover have "b' = b \<Longrightarrow> (b, b') \<in> r"
+ using ** REFL by (auto simp add: refl_on_def)
+ moreover have "b' \<noteq> b \<and> (b',b) \<notin> r \<Longrightarrow> (b,b') \<in> r"
+ using ** TOTAL by (auto simp add: total_on_def)
+ ultimately show "(b,b') \<in> r" by blast
+ qed
qed
+ then have "isMinim B b"
+ unfolding isMinim_def using * by auto
+ then show ?thesis
+ by auto
qed
lemma minim_isMinim:
@@ -395,16 +394,22 @@
lemma under_ofilter:
"ofilter (under a)"
-proof(unfold ofilter_def under_def, auto simp add: Field_def)
- fix aa x
- assume "(aa,a) \<in> r" "(x,aa) \<in> r"
- thus "(x,a) \<in> r"
- using TRANS trans_def[of r] by blast
+proof -
+ have "\<And>aa x. (aa, a) \<in> r \<Longrightarrow> (x, aa) \<in> r \<Longrightarrow> (x, a) \<in> r"
+ proof -
+ fix aa x
+ assume "(aa,a) \<in> r" "(x,aa) \<in> r"
+ then show "(x,a) \<in> r"
+ using TRANS trans_def[of r] by blast
+ qed
+ then show ?thesis unfolding ofilter_def under_def
+ by (auto simp add: Field_def)
qed
lemma underS_ofilter:
"ofilter (underS a)"
-proof(unfold ofilter_def underS_def under_def, auto simp add: Field_def)
+ unfolding ofilter_def underS_def under_def
+proof safe
fix aa assume "(a, aa) \<in> r" "(aa, a) \<in> r" and DIFF: "aa \<noteq> a"
thus False
using ANTISYM antisym_def[of r] by blast
@@ -412,7 +417,13 @@
fix aa x
assume "(aa,a) \<in> r" "aa \<noteq> a" "(x,aa) \<in> r"
thus "(x,a) \<in> r"
- using TRANS trans_def[of r] by blast
+ using TRANS trans_def[of r] by blast
+next
+ fix x
+ assume "x \<noteq> a" and "(x, a) \<in> r"
+ then show "x \<in> Field r"
+ unfolding Field_def
+ by auto
qed
lemma Field_ofilter:
@@ -430,7 +441,7 @@
let ?One = "(\<exists>a\<in>Field r. A = underS a)"
let ?Two = "(A = Field r)"
show "?One \<or> ?Two"
- proof(cases ?Two, simp)
+ proof(cases ?Two)
let ?B = "(Field r) - A"
let ?a = "minim ?B"
assume "A \<noteq> Field r"
@@ -445,7 +456,7 @@
have "A = underS ?a"
proof
show "A \<le> underS ?a"
- proof(unfold underS_def, auto simp add: 4)
+ proof
fix x assume **: "x \<in> A"
hence 11: "x \<in> Field r" using 5 by auto
have 12: "x \<noteq> ?a" using 4 ** by auto
@@ -458,25 +469,32 @@
hence "?a \<in> A" using ** 13 by blast
with 4 have False by simp
}
- thus "(x,?a) \<in> r" by blast
+ then have "(x,?a) \<in> r" by blast
+ thus "x \<in> underS ?a"
+ unfolding underS_def by (auto simp add: 12)
qed
next
show "underS ?a \<le> A"
- proof(unfold underS_def, auto)
+ proof
fix x
- assume **: "x \<noteq> ?a" and ***: "(x,?a) \<in> r"
- hence 11: "x \<in> Field r" using Field_def by fastforce
+ assume **: "x \<in> underS ?a"
+ hence 11: "x \<in> Field r"
+ using Field_def unfolding underS_def by fastforce
{assume "x \<notin> A"
hence "x \<in> ?B" using 11 by auto
hence "(?a,x) \<in> r" using 3 minim_least[of ?B x] by blast
hence False
- using ANTISYM antisym_def[of r] ** *** by auto
+ using ANTISYM antisym_def[of r] ** unfolding underS_def by auto
}
thus "x \<in> A" by blast
qed
qed
ultimately have ?One using 2 by blast
thus ?thesis by simp
+ next
+ assume "A = Field r"
+ then show ?thesis
+ by simp
qed
qed
--- a/src/HOL/Binomial.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Binomial.thy Fri Sep 02 13:41:55 2022 +0200
@@ -1045,17 +1045,11 @@
by (simp add: binomial_altdef_nat)
also have "... = fact (m + r + k) * fact (m + k) div
(fact (m + k) * fact (m + r - m) * (fact k * fact m))"
- apply (subst div_mult_div_if_dvd)
- apply (auto simp: algebra_simps fact_fact_dvd_fact)
- apply (metis add.assoc add.commute fact_fact_dvd_fact)
- done
+ by (metis add_implies_diff add_le_mono1 choose_dvd diff_cancel2 div_mult_div_if_dvd le_add1 le_add2)
also have "\<dots> = fact (m + r + k) div (fact r * (fact k * fact m))"
by (auto simp: algebra_simps fact_fact_dvd_fact)
also have "\<dots> = (fact (m + r + k) * fact (m + r)) div (fact r * (fact k * fact m) * fact (m + r))"
- apply (subst div_mult_div_if_dvd [symmetric])
- apply (auto simp add: algebra_simps)
- apply (metis fact_fact_dvd_fact dvd_trans nat_mult_dvd_cancel_disj)
- done
+ by simp
also have "\<dots> =
(fact (m + r + k) div (fact k * fact (m + r)) * (fact (m + r) div (fact r * fact m)))"
by (auto simp: div_mult_div_if_dvd fact_fact_dvd_fact algebra_simps)
@@ -1068,24 +1062,45 @@
"k \<le> m \<Longrightarrow> m \<le> n \<Longrightarrow> (n choose m) * (m choose k) = (n choose k) * ((n - k) choose (m - k))"
using choose_mult_lemma [of "m-k" "n-m" k] by simp
+lemma of_nat_binomial_eq_mult_binomial_Suc:
+ assumes "k \<le> n"
+ shows "(of_nat :: (nat \<Rightarrow> ('a :: field_char_0))) (n choose k) = of_nat (n + 1 - k) / of_nat (n + 1) * of_nat (Suc n choose k)"
+proof (cases k)
+ case 0 then show ?thesis
+ using of_nat_neq_0 by auto
+next
+ case (Suc l)
+ have "of_nat (n + 1) * (\<Prod>i=0..<k. of_nat (n - i)) = (of_nat :: (nat \<Rightarrow> 'a)) (n + 1 - k) * (\<Prod>i=0..<k. of_nat (Suc n - i))"
+ using prod.atLeast0_lessThan_Suc [where ?'a = 'a, symmetric, of "\<lambda>i. of_nat (Suc n - i)" k]
+ by (simp add: ac_simps prod.atLeast0_lessThan_Suc_shift del: prod.op_ivl_Suc)
+ also have "... = (of_nat :: (nat \<Rightarrow> 'a)) (Suc n - k) * (\<Prod>i=0..<k. of_nat (Suc n - i))"
+ by (simp add: Suc atLeast0_atMost_Suc atLeastLessThanSuc_atLeastAtMost)
+ also have "... = (of_nat :: (nat \<Rightarrow> 'a)) (n + 1 - k) * (\<Prod>i=0..<k. of_nat (Suc n - i))"
+ by (simp only: Suc_eq_plus1)
+ finally have "(\<Prod>i=0..<k. of_nat (n - i)) = (of_nat :: (nat \<Rightarrow> 'a)) (n + 1 - k) / of_nat (n + 1) * (\<Prod>i=0..<k. of_nat (Suc n - i))"
+ using of_nat_neq_0 by (auto simp: mult.commute divide_simps)
+ with assms show ?thesis
+ by (simp add: binomial_altdef_of_nat prod_dividef)
+qed
+
subsection \<open>More on Binomial Coefficients\<close>
lemma choose_one: "n choose 1 = n" for n :: nat
by simp
-lemma card_UNION:
+text \<open>The famous inclusion-exclusion formula for the cardinality of a union\<close>
+lemma int_card_UNION:
assumes "finite A"
and "\<forall>k \<in> A. finite k"
- shows "card (\<Union>A) = nat (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter>I)))"
+ shows "int (card (\<Union>A)) = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter>I)))"
(is "?lhs = ?rhs")
proof -
- have "?rhs = nat (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * (\<Sum>_\<in>\<Inter>I. 1))"
+ have "?rhs = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * (\<Sum>_\<in>\<Inter>I. 1))"
by simp
- also have "\<dots> = nat (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (\<Sum>_\<in>\<Inter>I. (- 1) ^ (card I + 1)))"
- (is "_ = nat ?rhs")
+ also have "\<dots> = (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (\<Sum>_\<in>\<Inter>I. (- 1) ^ (card I + 1)))"
by (subst sum_distrib_left) simp
- also have "?rhs = (\<Sum>(I, _)\<in>Sigma {I. I \<subseteq> A \<and> I \<noteq> {}} Inter. (- 1) ^ (card I + 1))"
+ also have "\<dots> = (\<Sum>(I, _)\<in>Sigma {I. I \<subseteq> A \<and> I \<noteq> {}} Inter. (- 1) ^ (card I + 1))"
using assms by (subst sum.Sigma) auto
also have "\<dots> = (\<Sum>(x, I)\<in>(SIGMA x:UNIV. {I. I \<subseteq> A \<and> I \<noteq> {} \<and> x \<in> \<Inter>I}). (- 1) ^ (card I + 1))"
by (rule sum.reindex_cong [where l = "\<lambda>(x, y). (y, x)"]) (auto intro: inj_onI)
@@ -1132,7 +1147,7 @@
also have "\<dots> = {}"
using \<open>finite A\<close> i by (auto simp add: K_def dest: card_mono[rotated 1])
finally show "(- 1) ^ (i + 1) * (\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter>I. 1 :: int) = 0"
- by (simp only:) simp
+ by (metis mult_zero_right sum.empty)
next
fix i
have "(\<Sum>I | I \<subseteq> A \<and> card I = i \<and> x \<in> \<Inter>I. 1) = (\<Sum>I | I \<subseteq> K \<and> card I = i. 1 :: int)"
@@ -1155,11 +1170,23 @@
using x K by (auto simp add: K_def card_gt_0_iff)
finally show "?lhs x = 1" .
qed
- also have "nat \<dots> = card (\<Union>A)"
+ also have "\<dots> = int (card (\<Union>A))"
by simp
finally show ?thesis ..
qed
+lemma card_UNION:
+ assumes "finite A"
+ and "\<forall>k \<in> A. finite k"
+ shows "card (\<Union>A) = nat (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter>I)))"
+ by (simp only: flip: int_card_UNION [OF assms])
+
+lemma card_UNION_nonneg:
+ assumes "finite A"
+ and "\<forall>k \<in> A. finite k"
+ shows "(\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter>I))) \<ge> 0"
+ using int_card_UNION [OF assms] by presburger
+
text \<open>The number of nat lists of length \<open>m\<close> summing to \<open>N\<close> is \<^term>\<open>(N + m - 1) choose N\<close>:\<close>
lemma card_length_sum_list_rec:
assumes "m \<ge> 1"
--- a/src/HOL/Bit_Operations.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Bit_Operations.thy Fri Sep 02 13:41:55 2022 +0200
@@ -1465,7 +1465,7 @@
lemma not_int_div_2:
\<open>NOT k div 2 = NOT (k div 2)\<close> for k :: int
- by (cases k) (simp_all add: not_int_def divide_int_def nat_add_distrib)
+ by (simp add: not_int_def)
lemma bit_not_int_iff:
\<open>bit (NOT k) n \<longleftrightarrow> \<not> bit k n\<close>
@@ -1729,7 +1729,7 @@
case (odd k)
from odd.IH [of \<open>l div 2\<close>] odd.hyps odd.prems
show ?case
- by (simp add: and_int_rec [of _ l]) linarith
+ by (simp add: and_int_rec [of _ l])
qed
lemma or_nonnegative_int_iff [simp]:
@@ -1754,7 +1754,7 @@
case (even k)
from even.IH [of \<open>l div 2\<close>] even.hyps even.prems
show ?case
- by (simp add: or_int_rec [of _ l]) linarith
+ by (simp add: or_int_rec [of _ l])
next
case (odd k)
from odd.IH [of \<open>l div 2\<close>] odd.hyps odd.prems
@@ -2045,17 +2045,17 @@
qed
qed
-lemma and_int_unfold [code]:
+lemma and_int_unfold:
\<open>k AND l = (if k = 0 \<or> l = 0 then 0 else if k = - 1 then l else if l = - 1 then k
else (k mod 2) * (l mod 2) + 2 * ((k div 2) AND (l div 2)))\<close> for k l :: int
by (auto simp add: and_int_rec [of k l] zmult_eq_1_iff elim: oddE)
-lemma or_int_unfold [code]:
+lemma or_int_unfold:
\<open>k OR l = (if k = - 1 \<or> l = - 1 then - 1 else if k = 0 then l else if l = 0 then k
else max (k mod 2) (l mod 2) + 2 * ((k div 2) OR (l div 2)))\<close> for k l :: int
by (auto simp add: or_int_rec [of k l] elim: oddE)
-lemma xor_int_unfold [code]:
+lemma xor_int_unfold:
\<open>k XOR l = (if k = - 1 then NOT l else if l = - 1 then NOT k else if k = 0 then l else if l = 0 then k
else \<bar>k mod 2 - l mod 2\<bar> + 2 * ((k div 2) XOR (l div 2)))\<close> for k l :: int
by (auto simp add: xor_int_rec [of k l] not_int_def elim!: oddE)
@@ -2173,22 +2173,6 @@
\<open>\<not> 2 ^ n \<le> (0::int)\<close>
by (simp add: power_le_zero_eq)
-lemma half_nonnegative_int_iff [simp]:
- \<open>k div 2 \<ge> 0 \<longleftrightarrow> k \<ge> 0\<close> for k :: int
-proof (cases \<open>k \<ge> 0\<close>)
- case True
- then show ?thesis
- by (auto simp add: divide_int_def sgn_1_pos)
-next
- case False
- then show ?thesis
- by (auto simp add: divide_int_def not_le elim!: evenE)
-qed
-
-lemma half_negative_int_iff [simp]:
- \<open>k div 2 < 0 \<longleftrightarrow> k < 0\<close> for k :: int
- by (subst Not_eq_iff [symmetric]) (simp add: not_less)
-
lemma int_bit_bound:
fixes k :: int
obtains n where \<open>\<And>m. n \<le> m \<Longrightarrow> bit k m \<longleftrightarrow> bit k n\<close>
@@ -3139,7 +3123,7 @@
definition take_bit_num :: \<open>nat \<Rightarrow> num \<Rightarrow> num option\<close>
where \<open>take_bit_num n m =
- (if take_bit n (numeral m ::nat) = 0 then None else Some (num_of_nat (take_bit n (numeral m ::nat))))\<close>
+ (if take_bit n (numeral m :: nat) = 0 then None else Some (num_of_nat (take_bit n (numeral m :: nat))))\<close>
lemma take_bit_num_simps:
\<open>take_bit_num 0 m = None\<close>
@@ -3712,6 +3696,93 @@
qed
+subsection \<open>Symbolic computations for code generation\<close>
+
+lemma bit_int_code [code]:
+ \<open>bit (0::int) n \<longleftrightarrow> False\<close>
+ \<open>bit (Int.Neg num.One) n \<longleftrightarrow> True\<close>
+ \<open>bit (Int.Pos num.One) 0 \<longleftrightarrow> True\<close>
+ \<open>bit (Int.Pos (num.Bit0 m)) 0 \<longleftrightarrow> False\<close>
+ \<open>bit (Int.Pos (num.Bit1 m)) 0 \<longleftrightarrow> True\<close>
+ \<open>bit (Int.Neg (num.Bit0 m)) 0 \<longleftrightarrow> False\<close>
+ \<open>bit (Int.Neg (num.Bit1 m)) 0 \<longleftrightarrow> True\<close>
+ \<open>bit (Int.Pos num.One) (Suc n) \<longleftrightarrow> False\<close>
+ \<open>bit (Int.Pos (num.Bit0 m)) (Suc n) \<longleftrightarrow> bit (Int.Pos m) n\<close>
+ \<open>bit (Int.Pos (num.Bit1 m)) (Suc n) \<longleftrightarrow> bit (Int.Pos m) n\<close>
+ \<open>bit (Int.Neg (num.Bit0 m)) (Suc n) \<longleftrightarrow> bit (Int.Neg m) n\<close>
+ \<open>bit (Int.Neg (num.Bit1 m)) (Suc n) \<longleftrightarrow> bit (Int.Neg (Num.inc m)) n\<close>
+ by (simp_all add: Num.add_One bit_0 bit_Suc)
+
+lemma not_int_code [code]:
+ \<open>NOT (0 :: int) = - 1\<close>
+ \<open>NOT (Int.Pos n) = Int.Neg (Num.inc n)\<close>
+ \<open>NOT (Int.Neg n) = Num.sub n num.One\<close>
+ by (simp_all add: Num.add_One not_int_def)
+
+lemma and_int_code [code]:
+ fixes i j :: int shows
+ \<open>0 AND j = 0\<close>
+ \<open>i AND 0 = 0\<close>
+ \<open>Int.Pos n AND Int.Pos m = (case and_num n m of None \<Rightarrow> 0 | Some n' \<Rightarrow> Int.Pos n')\<close>
+ \<open>Int.Neg n AND Int.Neg m = NOT (Num.sub n num.One OR Num.sub m num.One)\<close>
+ \<open>Int.Pos n AND Int.Neg num.One = Int.Pos n\<close>
+ \<open>Int.Pos n AND Int.Neg (num.Bit0 m) = Num.sub (or_not_num_neg (Num.BitM m) n) num.One\<close>
+ \<open>Int.Pos n AND Int.Neg (num.Bit1 m) = Num.sub (or_not_num_neg (num.Bit0 m) n) num.One\<close>
+ \<open>Int.Neg num.One AND Int.Pos m = Int.Pos m\<close>
+ \<open>Int.Neg (num.Bit0 n) AND Int.Pos m = Num.sub (or_not_num_neg (Num.BitM n) m) num.One\<close>
+ \<open>Int.Neg (num.Bit1 n) AND Int.Pos m = Num.sub (or_not_num_neg (num.Bit0 n) m) num.One\<close>
+ apply (auto simp add: and_num_eq_None_iff [where ?'a = int] and_num_eq_Some_iff [where ?'a = int]
+ split: option.split)
+ apply (simp_all only: sub_one_eq_not_neg numeral_or_not_num_eq minus_minus and_not_numerals
+ bit.de_Morgan_disj bit.double_compl and_not_num_eq_None_iff and_not_num_eq_Some_iff ac_simps)
+ done
+
+lemma or_int_code [code]:
+ fixes i j :: int shows
+ \<open>0 OR j = j\<close>
+ \<open>i OR 0 = i\<close>
+ \<open>Int.Pos n OR Int.Pos m = Int.Pos (or_num n m)\<close>
+ \<open>Int.Neg n OR Int.Neg m = NOT (Num.sub n num.One AND Num.sub m num.One)\<close>
+ \<open>Int.Pos n OR Int.Neg num.One = Int.Neg num.One\<close>
+ \<open>Int.Pos n OR Int.Neg (num.Bit0 m) = (case and_not_num (Num.BitM m) n of None \<Rightarrow> -1 | Some n' \<Rightarrow> Int.Neg (Num.inc n'))\<close>
+ \<open>Int.Pos n OR Int.Neg (num.Bit1 m) = (case and_not_num (num.Bit0 m) n of None \<Rightarrow> -1 | Some n' \<Rightarrow> Int.Neg (Num.inc n'))\<close>
+ \<open>Int.Neg num.One OR Int.Pos m = Int.Neg num.One\<close>
+ \<open>Int.Neg (num.Bit0 n) OR Int.Pos m = (case and_not_num (Num.BitM n) m of None \<Rightarrow> -1 | Some n' \<Rightarrow> Int.Neg (Num.inc n'))\<close>
+ \<open>Int.Neg (num.Bit1 n) OR Int.Pos m = (case and_not_num (num.Bit0 n) m of None \<Rightarrow> -1 | Some n' \<Rightarrow> Int.Neg (Num.inc n'))\<close>
+ apply (auto simp add: numeral_or_num_eq split: option.splits)
+ apply (simp_all only: and_not_num_eq_None_iff and_not_num_eq_Some_iff and_not_numerals
+ numeral_or_not_num_eq or_int_def bit.double_compl ac_simps flip: numeral_eq_iff [where ?'a = int])
+ apply simp_all
+ done
+
+lemma xor_int_code [code]:
+ fixes i j :: int shows
+ \<open>0 XOR j = j\<close>
+ \<open>i XOR 0 = i\<close>
+ \<open>Int.Pos n XOR Int.Pos m = (case xor_num n m of None \<Rightarrow> 0 | Some n' \<Rightarrow> Int.Pos n')\<close>
+ \<open>Int.Neg n XOR Int.Neg m = Num.sub n num.One XOR Num.sub m num.One\<close>
+ \<open>Int.Neg n XOR Int.Pos m = NOT (Num.sub n num.One XOR Int.Pos m)\<close>
+ \<open>Int.Pos n XOR Int.Neg m = NOT (Int.Pos n XOR Num.sub m num.One)\<close>
+ by (simp_all add: xor_num_eq_None_iff [where ?'a = int] xor_num_eq_Some_iff [where ?'a = int] split: option.split)
+
+lemma push_bit_int_code [code]:
+ \<open>push_bit 0 i = i\<close>
+ \<open>push_bit (Suc n) i = push_bit n (Int.dup i)\<close>
+ by (simp_all add: ac_simps)
+
+lemma drop_bit_int_code [code]:
+ fixes i :: int shows
+ \<open>drop_bit 0 i = i\<close>
+ \<open>drop_bit (Suc n) 0 = (0 :: int)\<close>
+ \<open>drop_bit (Suc n) (Int.Pos num.One) = 0\<close>
+ \<open>drop_bit (Suc n) (Int.Pos (num.Bit0 m)) = drop_bit n (Int.Pos m)\<close>
+ \<open>drop_bit (Suc n) (Int.Pos (num.Bit1 m)) = drop_bit n (Int.Pos m)\<close>
+ \<open>drop_bit (Suc n) (Int.Neg num.One) = - 1\<close>
+ \<open>drop_bit (Suc n) (Int.Neg (num.Bit0 m)) = drop_bit n (Int.Neg m)\<close>
+ \<open>drop_bit (Suc n) (Int.Neg (num.Bit1 m)) = drop_bit n (Int.Neg (Num.inc m))\<close>
+ by (simp_all add: drop_bit_Suc add_One)
+
+
subsection \<open>Key ideas of bit operations\<close>
text \<open>
--- a/src/HOL/Code_Numeral.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Code_Numeral.thy Fri Sep 02 13:41:55 2022 +0200
@@ -378,37 +378,21 @@
end
-instantiation integer :: unique_euclidean_semiring_numeral
+instantiation integer :: unique_euclidean_semiring_with_nat_division
begin
definition divmod_integer :: "num \<Rightarrow> num \<Rightarrow> integer \<times> integer"
where
divmod_integer'_def: "divmod_integer m n = (numeral m div numeral n, numeral m mod numeral n)"
-definition divmod_step_integer :: "num \<Rightarrow> integer \<times> integer \<Rightarrow> integer \<times> integer"
+definition divmod_step_integer :: "integer \<Rightarrow> integer \<times> integer \<Rightarrow> integer \<times> integer"
where
"divmod_step_integer l qr = (let (q, r) = qr
- in if r \<ge> numeral l then (2 * q + 1, r - numeral l)
+ in if \<bar>l\<bar> \<le> \<bar>r\<bar> then (2 * q + 1, r - l)
else (2 * q, r))"
-instance proof
- show "divmod m n = (numeral m div numeral n :: integer, numeral m mod numeral n)"
- for m n by (fact divmod_integer'_def)
- show "divmod_step l qr = (let (q, r) = qr
- in if r \<ge> numeral l then (2 * q + 1, r - numeral l)
- else (2 * q, r))" for l and qr :: "integer \<times> integer"
- by (fact divmod_step_integer_def)
-qed (transfer,
- fact le_add_diff_inverse2
- unique_euclidean_semiring_numeral_class.div_less
- unique_euclidean_semiring_numeral_class.mod_less
- unique_euclidean_semiring_numeral_class.div_positive
- unique_euclidean_semiring_numeral_class.mod_less_eq_dividend
- unique_euclidean_semiring_numeral_class.pos_mod_bound
- unique_euclidean_semiring_numeral_class.pos_mod_sign
- unique_euclidean_semiring_numeral_class.mod_mult2_eq
- unique_euclidean_semiring_numeral_class.div_mult2_eq
- unique_euclidean_semiring_numeral_class.discrete)+
+instance by standard
+ (auto simp add: divmod_integer'_def divmod_step_integer_def integer_less_eq_iff)
end
--- a/src/HOL/Codegenerator_Test/Candidates.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Codegenerator_Test/Candidates.thy Fri Sep 02 13:41:55 2022 +0200
@@ -16,7 +16,7 @@
"HOL-Computational_Algebra.Polynomial_Factorial"
"HOL-Number_Theory.Eratosthenes"
"HOL-Examples.Records"
- "HOL-Library.Word"
+ "HOL-Examples.Gauss_Numbers"
begin
text \<open>Drop technical stuff from \<^theory>\<open>HOL.Quickcheck_Narrowing\<close> which is tailored towards Haskell\<close>
--- a/src/HOL/Codegenerator_Test/Generate_Efficient_Datastructures.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Codegenerator_Test/Generate_Efficient_Datastructures.thy Fri Sep 02 13:41:55 2022 +0200
@@ -29,6 +29,7 @@
Euclidean_Algorithm.Lcm
"Gcd :: _ poly set \<Rightarrow> _"
"Lcm :: _ poly set \<Rightarrow> _"
+ nlists
]]
text \<open>
--- a/src/HOL/Complete_Lattices.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Complete_Lattices.thy Fri Sep 02 13:41:55 2022 +0200
@@ -988,9 +988,9 @@
by blast
lemma disjnt_inj_on_iff:
- "\<lbrakk>inj_on f (\<Union>\<A>); X \<in> \<A>; Y \<in> \<A>\<rbrakk> \<Longrightarrow> disjnt (f ` X) (f ` Y) \<longleftrightarrow> disjnt X Y"
- apply (auto simp: disjnt_def)
- using inj_on_eq_iff by fastforce
+ "\<lbrakk>inj_on f (\<Union>\<A>); X \<in> \<A>; Y \<in> \<A>\<rbrakk> \<Longrightarrow> disjnt (f ` X) (f ` Y) \<longleftrightarrow> disjnt X Y"
+ unfolding disjnt_def
+ by safe (use inj_on_eq_iff in \<open>fastforce+\<close>)
lemma disjnt_Union1 [simp]: "disjnt (\<Union>\<A>) B \<longleftrightarrow> (\<forall>A \<in> \<A>. disjnt A B)"
by (auto simp: disjnt_def)
--- a/src/HOL/Conditionally_Complete_Lattices.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Conditionally_Complete_Lattices.thy Fri Sep 02 13:41:55 2022 +0200
@@ -522,31 +522,29 @@
assumes "a < b" and "P a" and "\<not> P b"
shows "\<exists>c. a \<le> c \<and> c \<le> b \<and> (\<forall>x. a \<le> x \<and> x < c \<longrightarrow> P x) \<and>
(\<forall>d. (\<forall>x. a \<le> x \<and> x < d \<longrightarrow> P x) \<longrightarrow> d \<le> c)"
-proof (rule exI [where x = "Sup {d. \<forall>x. a \<le> x \<and> x < d \<longrightarrow> P x}"], auto)
+proof (rule exI [where x = "Sup {d. \<forall>x. a \<le> x \<and> x < d \<longrightarrow> P x}"], safe)
show "a \<le> Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
by (rule cSup_upper, auto simp: bdd_above_def)
(metis \<open>a < b\<close> \<open>\<not> P b\<close> linear less_le)
next
show "Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c} \<le> b"
- apply (rule cSup_least)
- apply auto
- apply (metis less_le_not_le)
- apply (metis \<open>a<b\<close> \<open>\<not> P b\<close> linear less_le)
- done
+ by (rule cSup_least)
+ (use \<open>a<b\<close> \<open>\<not> P b\<close> in \<open>auto simp add: less_le_not_le\<close>)
next
fix x
assume x: "a \<le> x" and lt: "x < Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
show "P x"
- apply (rule less_cSupE [OF lt], auto)
- apply (metis less_le_not_le)
- apply (metis x)
- done
+ by (rule less_cSupE [OF lt]) (use less_le_not_le x in \<open>auto\<close>)
next
fix d
- assume 0: "\<forall>x. a \<le> x \<and> x < d \<longrightarrow> P x"
- thus "d \<le> Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
- by (rule_tac cSup_upper, auto simp: bdd_above_def)
- (metis \<open>a<b\<close> \<open>\<not> P b\<close> linear less_le)
+ assume 0: "\<forall>x. a \<le> x \<and> x < d \<longrightarrow> P x"
+ then have "d \<in> {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
+ by auto
+ moreover have "bdd_above {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
+ unfolding bdd_above_def using \<open>a<b\<close> \<open>\<not> P b\<close> linear
+ by (simp add: less_le) blast
+ ultimately show "d \<le> Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
+ by (auto simp: cSup_upper)
qed
end
--- a/src/HOL/Data_Structures/Binomial_Heap.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Data_Structures/Binomial_Heap.thy Fri Sep 02 13:41:55 2022 +0200
@@ -23,61 +23,61 @@
datatype 'a tree = Node (rank: nat) (root: 'a) (children: "'a tree list")
-type_synonym 'a heap = "'a tree list"
+type_synonym 'a trees = "'a tree list"
subsubsection \<open>Multiset of elements\<close>
fun mset_tree :: "'a::linorder tree \<Rightarrow> 'a multiset" where
"mset_tree (Node _ a ts) = {#a#} + (\<Sum>t\<in>#mset ts. mset_tree t)"
-definition mset_heap :: "'a::linorder heap \<Rightarrow> 'a multiset" where
- "mset_heap ts = (\<Sum>t\<in>#mset ts. mset_tree t)"
+definition mset_trees :: "'a::linorder trees \<Rightarrow> 'a multiset" where
+ "mset_trees ts = (\<Sum>t\<in>#mset ts. mset_tree t)"
lemma mset_tree_simp_alt[simp]:
- "mset_tree (Node r a ts) = {#a#} + mset_heap ts"
- unfolding mset_heap_def by auto
+ "mset_tree (Node r a ts) = {#a#} + mset_trees ts"
+ unfolding mset_trees_def by auto
declare mset_tree.simps[simp del]
lemma mset_tree_nonempty[simp]: "mset_tree t \<noteq> {#}"
by (cases t) auto
-lemma mset_heap_Nil[simp]:
- "mset_heap [] = {#}"
-by (auto simp: mset_heap_def)
+lemma mset_trees_Nil[simp]:
+ "mset_trees [] = {#}"
+by (auto simp: mset_trees_def)
-lemma mset_heap_Cons[simp]: "mset_heap (t#ts) = mset_tree t + mset_heap ts"
-by (auto simp: mset_heap_def)
+lemma mset_trees_Cons[simp]: "mset_trees (t#ts) = mset_tree t + mset_trees ts"
+by (auto simp: mset_trees_def)
-lemma mset_heap_empty_iff[simp]: "mset_heap ts = {#} \<longleftrightarrow> ts=[]"
-by (auto simp: mset_heap_def)
+lemma mset_trees_empty_iff[simp]: "mset_trees ts = {#} \<longleftrightarrow> ts=[]"
+by (auto simp: mset_trees_def)
lemma root_in_mset[simp]: "root t \<in># mset_tree t"
by (cases t) auto
-lemma mset_heap_rev_eq[simp]: "mset_heap (rev ts) = mset_heap ts"
-by (auto simp: mset_heap_def)
+lemma mset_trees_rev_eq[simp]: "mset_trees (rev ts) = mset_trees ts"
+by (auto simp: mset_trees_def)
subsubsection \<open>Invariants\<close>
text \<open>Binomial tree\<close>
-fun invar_btree :: "'a::linorder tree \<Rightarrow> bool" where
-"invar_btree (Node r x ts) \<longleftrightarrow>
- (\<forall>t\<in>set ts. invar_btree t) \<and> map rank ts = rev [0..<r]"
+fun btree :: "'a::linorder tree \<Rightarrow> bool" where
+"btree (Node r x ts) \<longleftrightarrow>
+ (\<forall>t\<in>set ts. btree t) \<and> map rank ts = rev [0..<r]"
-text \<open>Ordering (heap) invariant\<close>
-fun invar_otree :: "'a::linorder tree \<Rightarrow> bool" where
-"invar_otree (Node _ x ts) \<longleftrightarrow> (\<forall>t\<in>set ts. invar_otree t \<and> x \<le> root t)"
+text \<open>Heap invariant\<close>
+fun heap :: "'a::linorder tree \<Rightarrow> bool" where
+"heap (Node _ x ts) \<longleftrightarrow> (\<forall>t\<in>set ts. heap t \<and> x \<le> root t)"
-definition "invar_tree t \<longleftrightarrow> invar_btree t \<and> invar_otree t"
+definition "bheap t \<longleftrightarrow> btree t \<and> heap t"
text \<open>Binomial Heap invariant\<close>
-definition "invar ts \<longleftrightarrow> (\<forall>t\<in>set ts. invar_tree t) \<and> (sorted_wrt (<) (map rank ts))"
+definition "invar ts \<longleftrightarrow> (\<forall>t\<in>set ts. bheap t) \<and> (sorted_wrt (<) (map rank ts))"
text \<open>The children of a node are a valid heap\<close>
lemma invar_children:
- "invar_tree (Node r v ts) \<Longrightarrow> invar (rev ts)"
- by (auto simp: invar_tree_def invar_def rev_map[symmetric])
+ "bheap (Node r v ts) \<Longrightarrow> invar (rev ts)"
+ by (auto simp: bheap_def invar_def rev_map[symmetric])
subsection \<open>Operations and Their Functional Correctness\<close>
@@ -95,11 +95,11 @@
end
lemma invar_link:
- assumes "invar_tree t\<^sub>1"
- assumes "invar_tree t\<^sub>2"
+ assumes "bheap t\<^sub>1"
+ assumes "bheap t\<^sub>2"
assumes "rank t\<^sub>1 = rank t\<^sub>2"
- shows "invar_tree (link t\<^sub>1 t\<^sub>2)"
-using assms unfolding invar_tree_def
+ shows "bheap (link t\<^sub>1 t\<^sub>2)"
+using assms unfolding bheap_def
by (cases "(t\<^sub>1, t\<^sub>2)" rule: link.cases) auto
lemma rank_link[simp]: "rank (link t\<^sub>1 t\<^sub>2) = rank t\<^sub>1 + 1"
@@ -110,29 +110,29 @@
subsubsection \<open>\<open>ins_tree\<close>\<close>
-fun ins_tree :: "'a::linorder tree \<Rightarrow> 'a heap \<Rightarrow> 'a heap" where
+fun ins_tree :: "'a::linorder tree \<Rightarrow> 'a trees \<Rightarrow> 'a trees" where
"ins_tree t [] = [t]"
| "ins_tree t\<^sub>1 (t\<^sub>2#ts) =
(if rank t\<^sub>1 < rank t\<^sub>2 then t\<^sub>1#t\<^sub>2#ts else ins_tree (link t\<^sub>1 t\<^sub>2) ts)"
-lemma invar_tree0[simp]: "invar_tree (Node 0 x [])"
-unfolding invar_tree_def by auto
+lemma bheap0[simp]: "bheap (Node 0 x [])"
+unfolding bheap_def by auto
lemma invar_Cons[simp]:
"invar (t#ts)
- \<longleftrightarrow> invar_tree t \<and> invar ts \<and> (\<forall>t'\<in>set ts. rank t < rank t')"
+ \<longleftrightarrow> bheap t \<and> invar ts \<and> (\<forall>t'\<in>set ts. rank t < rank t')"
by (auto simp: invar_def)
lemma invar_ins_tree:
- assumes "invar_tree t"
+ assumes "bheap t"
assumes "invar ts"
assumes "\<forall>t'\<in>set ts. rank t \<le> rank t'"
shows "invar (ins_tree t ts)"
using assms
by (induction t ts rule: ins_tree.induct) (auto simp: invar_link less_eq_Suc_le[symmetric])
-lemma mset_heap_ins_tree[simp]:
- "mset_heap (ins_tree t ts) = mset_tree t + mset_heap ts"
+lemma mset_trees_ins_tree[simp]:
+ "mset_trees (ins_tree t ts) = mset_tree t + mset_trees ts"
by (induction t ts rule: ins_tree.induct) auto
lemma ins_tree_rank_bound:
@@ -147,13 +147,13 @@
hide_const (open) insert
-definition insert :: "'a::linorder \<Rightarrow> 'a heap \<Rightarrow> 'a heap" where
+definition insert :: "'a::linorder \<Rightarrow> 'a trees \<Rightarrow> 'a trees" where
"insert x ts = ins_tree (Node 0 x []) ts"
lemma invar_insert[simp]: "invar t \<Longrightarrow> invar (insert x t)"
by (auto intro!: invar_ins_tree simp: insert_def)
-lemma mset_heap_insert[simp]: "mset_heap (insert x t) = {#x#} + mset_heap t"
+lemma mset_trees_insert[simp]: "mset_trees (insert x t) = {#x#} + mset_trees t"
by(auto simp: insert_def)
subsubsection \<open>\<open>merge\<close>\<close>
@@ -162,7 +162,7 @@
includes pattern_aliases
begin
-fun merge :: "'a::linorder heap \<Rightarrow> 'a heap \<Rightarrow> 'a heap" where
+fun merge :: "'a::linorder trees \<Rightarrow> 'a trees \<Rightarrow> 'a trees" where
"merge ts\<^sub>1 [] = ts\<^sub>1"
| "merge [] ts\<^sub>2 = ts\<^sub>2"
| "merge (t\<^sub>1#ts\<^sub>1 =: h\<^sub>1) (t\<^sub>2#ts\<^sub>2 =: h\<^sub>2) = (
@@ -205,7 +205,7 @@
case (3 t\<^sub>1 ts\<^sub>1 t\<^sub>2 ts\<^sub>2)
\<comment> \<open>Invariants of the parts can be shown automatically\<close>
from "3.prems" have [simp]:
- "invar_tree t\<^sub>1" "invar_tree t\<^sub>2"
+ "bheap t\<^sub>1" "bheap t\<^sub>2"
(*"invar (merge (t\<^sub>1#ts\<^sub>1) ts\<^sub>2)"
"invar (merge ts\<^sub>1 (t\<^sub>2#ts\<^sub>2))"
"invar (merge ts\<^sub>1 ts\<^sub>2)"*)
@@ -259,50 +259,50 @@
qed auto
-lemma mset_heap_merge[simp]:
- "mset_heap (merge ts\<^sub>1 ts\<^sub>2) = mset_heap ts\<^sub>1 + mset_heap ts\<^sub>2"
+lemma mset_trees_merge[simp]:
+ "mset_trees (merge ts\<^sub>1 ts\<^sub>2) = mset_trees ts\<^sub>1 + mset_trees ts\<^sub>2"
by (induction ts\<^sub>1 ts\<^sub>2 rule: merge.induct) auto
subsubsection \<open>\<open>get_min\<close>\<close>
-fun get_min :: "'a::linorder heap \<Rightarrow> 'a" where
+fun get_min :: "'a::linorder trees \<Rightarrow> 'a" where
"get_min [t] = root t"
| "get_min (t#ts) = min (root t) (get_min ts)"
-lemma invar_tree_root_min:
- assumes "invar_tree t"
+lemma bheap_root_min:
+ assumes "bheap t"
assumes "x \<in># mset_tree t"
shows "root t \<le> x"
-using assms unfolding invar_tree_def
-by (induction t arbitrary: x rule: mset_tree.induct) (fastforce simp: mset_heap_def)
+using assms unfolding bheap_def
+by (induction t arbitrary: x rule: mset_tree.induct) (fastforce simp: mset_trees_def)
lemma get_min_mset:
assumes "ts\<noteq>[]"
assumes "invar ts"
- assumes "x \<in># mset_heap ts"
+ assumes "x \<in># mset_trees ts"
shows "get_min ts \<le> x"
using assms
apply (induction ts arbitrary: x rule: get_min.induct)
apply (auto
- simp: invar_tree_root_min min_def intro: order_trans;
- meson linear order_trans invar_tree_root_min
+ simp: bheap_root_min min_def intro: order_trans;
+ meson linear order_trans bheap_root_min
)+
done
lemma get_min_member:
- "ts\<noteq>[] \<Longrightarrow> get_min ts \<in># mset_heap ts"
+ "ts\<noteq>[] \<Longrightarrow> get_min ts \<in># mset_trees ts"
by (induction ts rule: get_min.induct) (auto simp: min_def)
lemma get_min:
- assumes "mset_heap ts \<noteq> {#}"
+ assumes "mset_trees ts \<noteq> {#}"
assumes "invar ts"
- shows "get_min ts = Min_mset (mset_heap ts)"
+ shows "get_min ts = Min_mset (mset_trees ts)"
using assms get_min_member get_min_mset
by (auto simp: eq_Min_iff)
subsubsection \<open>\<open>get_min_rest\<close>\<close>
-fun get_min_rest :: "'a::linorder heap \<Rightarrow> 'a tree \<times> 'a heap" where
+fun get_min_rest :: "'a::linorder trees \<Rightarrow> 'a tree \<times> 'a trees" where
"get_min_rest [t] = (t,[])"
| "get_min_rest (t#ts) = (let (t',ts') = get_min_rest ts
in if root t \<le> root t' then (t,ts) else (t',t#ts'))"
@@ -332,9 +332,9 @@
assumes "get_min_rest ts = (t',ts')"
assumes "ts\<noteq>[]"
assumes "invar ts"
- shows "invar_tree t'" and "invar ts'"
+ shows "bheap t'" and "invar ts'"
proof -
- have "invar_tree t' \<and> invar ts'"
+ have "bheap t' \<and> invar ts'"
using assms
proof (induction ts arbitrary: t' ts' rule: get_min.induct)
case (2 t v va)
@@ -343,12 +343,12 @@
apply (drule set_get_min_rest; fastforce)
done
qed auto
- thus "invar_tree t'" and "invar ts'" by auto
+ thus "bheap t'" and "invar ts'" by auto
qed
subsubsection \<open>\<open>del_min\<close>\<close>
-definition del_min :: "'a::linorder heap \<Rightarrow> 'a::linorder heap" where
+definition del_min :: "'a::linorder trees \<Rightarrow> 'a::linorder trees" where
"del_min ts = (case get_min_rest ts of
(Node r x ts\<^sub>1, ts\<^sub>2) \<Rightarrow> merge (rev ts\<^sub>1) ts\<^sub>2)"
@@ -364,15 +364,15 @@
dest: invar_get_min_rest
)
-lemma mset_heap_del_min:
+lemma mset_trees_del_min:
assumes "ts \<noteq> []"
- shows "mset_heap ts = mset_heap (del_min ts) + {# get_min ts #}"
+ shows "mset_trees ts = mset_trees (del_min ts) + {# get_min ts #}"
using assms
unfolding del_min_def
apply (clarsimp split: tree.split prod.split)
apply (frule (1) get_min_rest_get_min_same_root)
apply (frule (1) mset_get_min_rest)
-apply (auto simp: mset_heap_def)
+apply (auto simp: mset_trees_def)
done
@@ -381,10 +381,10 @@
text \<open>Last step of functional correctness proof: combine all the above lemmas
to show that binomial heaps satisfy the specification of priority queues with merge.\<close>
-interpretation binheap: Priority_Queue_Merge
+interpretation bheaps: Priority_Queue_Merge
where empty = "[]" and is_empty = "(=) []" and insert = insert
and get_min = get_min and del_min = del_min and merge = merge
- and invar = invar and mset = mset_heap
+ and invar = invar and mset = mset_trees
proof (unfold_locales, goal_cases)
case 1 thus ?case by simp
next
@@ -393,7 +393,7 @@
case 3 thus ?case by auto
next
case (4 q)
- thus ?case using mset_heap_del_min[of q] get_min[OF _ \<open>invar q\<close>]
+ thus ?case using mset_trees_del_min[of q] get_min[OF _ \<open>invar q\<close>]
by (auto simp: union_single_eq_diff)
next
case (5 q) thus ?case using get_min[of q] by auto
@@ -414,7 +414,7 @@
text \<open>The size of a binomial tree is determined by its rank\<close>
lemma size_mset_btree:
- assumes "invar_btree t"
+ assumes "btree t"
shows "size (mset_tree t) = 2^rank t"
using assms
proof (induction t)
@@ -424,7 +424,7 @@
from Node have COMPL: "map rank ts = rev [0..<r]" by auto
- have "size (mset_heap ts) = (\<Sum>t\<leftarrow>ts. size (mset_tree t))"
+ have "size (mset_trees ts) = (\<Sum>t\<leftarrow>ts. size (mset_tree t))"
by (induction ts) auto
also have "\<dots> = (\<Sum>t\<leftarrow>ts. 2^rank t)" using IH
by (auto cong: map_cong)
@@ -440,32 +440,32 @@
qed
lemma size_mset_tree:
- assumes "invar_tree t"
+ assumes "bheap t"
shows "size (mset_tree t) = 2^rank t"
-using assms unfolding invar_tree_def
+using assms unfolding bheap_def
by (simp add: size_mset_btree)
text \<open>The length of a binomial heap is bounded by the number of its elements\<close>
-lemma size_mset_heap:
+lemma size_mset_trees:
assumes "invar ts"
- shows "length ts \<le> log 2 (size (mset_heap ts) + 1)"
+ shows "length ts \<le> log 2 (size (mset_trees ts) + 1)"
proof -
from \<open>invar ts\<close> have
ASC: "sorted_wrt (<) (map rank ts)" and
- TINV: "\<forall>t\<in>set ts. invar_tree t"
+ TINV: "\<forall>t\<in>set ts. bheap t"
unfolding invar_def by auto
have "(2::nat)^length ts = (\<Sum>i\<in>{0..<length ts}. 2^i) + 1"
by (simp add: sum_power2)
- also have "\<dots> \<le> (\<Sum>t\<leftarrow>ts. 2^rank t) + 1"
- using sorted_wrt_less_sum_mono_lowerbound[OF _ ASC, of "(^) (2::nat)"]
- using power_increasing[where a="2::nat"]
- by (auto simp: o_def)
- also have "\<dots> = (\<Sum>t\<leftarrow>ts. size (mset_tree t)) + 1" using TINV
+ also have "\<dots> = (\<Sum>i\<leftarrow>[0..<length ts]. 2^i) + 1" (is "_ = ?S + 1")
+ by (simp add: interv_sum_list_conv_sum_set_nat)
+ also have "?S \<le> (\<Sum>t\<leftarrow>ts. 2^rank t)" (is "_ \<le> ?T")
+ using sorted_wrt_less_idx[OF ASC] by(simp add: sum_list_mono2)
+ also have "?T + 1 \<le> (\<Sum>t\<leftarrow>ts. size (mset_tree t)) + 1" using TINV
by (auto cong: map_cong simp: size_mset_tree)
- also have "\<dots> = size (mset_heap ts) + 1"
- unfolding mset_heap_def by (induction ts) auto
- finally have "2^length ts \<le> size (mset_heap ts) + 1" .
+ also have "\<dots> = size (mset_trees ts) + 1"
+ unfolding mset_trees_def by (induction ts) auto
+ finally have "2^length ts \<le> size (mset_trees ts) + 1" by simp
then show ?thesis using le_log2_of_power by blast
qed
@@ -481,14 +481,14 @@
text \<open>This function is non-canonical: we omitted a \<open>+1\<close> in the \<open>else\<close>-part,
to keep the following analysis simpler and more to the point.
\<close>
-fun T_ins_tree :: "'a::linorder tree \<Rightarrow> 'a heap \<Rightarrow> nat" where
+fun T_ins_tree :: "'a::linorder tree \<Rightarrow> 'a trees \<Rightarrow> nat" where
"T_ins_tree t [] = 1"
| "T_ins_tree t\<^sub>1 (t\<^sub>2 # ts) = (
(if rank t\<^sub>1 < rank t\<^sub>2 then 1
else T_link t\<^sub>1 t\<^sub>2 + T_ins_tree (link t\<^sub>1 t\<^sub>2) ts)
)"
-definition T_insert :: "'a::linorder \<Rightarrow> 'a heap \<Rightarrow> nat" where
+definition T_insert :: "'a::linorder \<Rightarrow> 'a trees \<Rightarrow> nat" where
"T_insert x ts = T_ins_tree (Node 0 x []) ts + 1"
lemma T_ins_tree_simple_bound: "T_ins_tree t ts \<le> length ts + 1"
@@ -498,12 +498,12 @@
lemma T_insert_bound:
assumes "invar ts"
- shows "T_insert x ts \<le> log 2 (size (mset_heap ts) + 1) + 2"
+ shows "T_insert x ts \<le> log 2 (size (mset_trees ts) + 1) + 2"
proof -
have "real (T_insert x ts) \<le> real (length ts) + 2"
unfolding T_insert_def using T_ins_tree_simple_bound
using of_nat_mono by fastforce
- also note size_mset_heap[OF \<open>invar ts\<close>]
+ also note size_mset_trees[OF \<open>invar ts\<close>]
finally show ?thesis by simp
qed
@@ -513,7 +513,7 @@
includes pattern_aliases
begin
-fun T_merge :: "'a::linorder heap \<Rightarrow> 'a heap \<Rightarrow> nat" where
+fun T_merge :: "'a::linorder trees \<Rightarrow> 'a trees \<Rightarrow> nat" where
"T_merge ts\<^sub>1 [] = 1"
| "T_merge [] ts\<^sub>2 = 1"
| "T_merge (t\<^sub>1#ts\<^sub>1 =: h\<^sub>1) (t\<^sub>2#ts\<^sub>2 =: h\<^sub>2) = 1 + (
@@ -532,15 +532,15 @@
by (induction t ts rule: ins_tree.induct) auto
lemma T_merge_length:
- "length (merge ts\<^sub>1 ts\<^sub>2) + T_merge ts\<^sub>1 ts\<^sub>2 \<le> 2 * (length ts\<^sub>1 + length ts\<^sub>2) + 1"
+ "T_merge ts\<^sub>1 ts\<^sub>2 + length (merge ts\<^sub>1 ts\<^sub>2) \<le> 2 * (length ts\<^sub>1 + length ts\<^sub>2) + 1"
by (induction ts\<^sub>1 ts\<^sub>2 rule: T_merge.induct)
(auto simp: T_ins_tree_length algebra_simps)
text \<open>Finally, we get the desired logarithmic bound\<close>
lemma T_merge_bound:
fixes ts\<^sub>1 ts\<^sub>2
- defines "n\<^sub>1 \<equiv> size (mset_heap ts\<^sub>1)"
- defines "n\<^sub>2 \<equiv> size (mset_heap ts\<^sub>2)"
+ defines "n\<^sub>1 \<equiv> size (mset_trees ts\<^sub>1)"
+ defines "n\<^sub>2 \<equiv> size (mset_trees ts\<^sub>2)"
assumes "invar ts\<^sub>1" "invar ts\<^sub>2"
shows "T_merge ts\<^sub>1 ts\<^sub>2 \<le> 4*log 2 (n\<^sub>1 + n\<^sub>2 + 1) + 1"
proof -
@@ -548,8 +548,8 @@
have "T_merge ts\<^sub>1 ts\<^sub>2 \<le> 2 * real (length ts\<^sub>1) + 2 * real (length ts\<^sub>2) + 1"
using T_merge_length[of ts\<^sub>1 ts\<^sub>2] by simp
- also note size_mset_heap[OF \<open>invar ts\<^sub>1\<close>]
- also note size_mset_heap[OF \<open>invar ts\<^sub>2\<close>]
+ also note size_mset_trees[OF \<open>invar ts\<^sub>1\<close>]
+ also note size_mset_trees[OF \<open>invar ts\<^sub>2\<close>]
finally have "T_merge ts\<^sub>1 ts\<^sub>2 \<le> 2 * log 2 (n\<^sub>1 + 1) + 2 * log 2 (n\<^sub>2 + 1) + 1"
unfolding n_defs by (simp add: algebra_simps)
also have "log 2 (n\<^sub>1 + 1) \<le> log 2 (n\<^sub>1 + n\<^sub>2 + 1)"
@@ -561,7 +561,7 @@
subsubsection \<open>\<open>T_get_min\<close>\<close>
-fun T_get_min :: "'a::linorder heap \<Rightarrow> nat" where
+fun T_get_min :: "'a::linorder trees \<Rightarrow> nat" where
"T_get_min [t] = 1"
| "T_get_min (t#ts) = 1 + T_get_min ts"
@@ -571,16 +571,16 @@
lemma T_get_min_bound:
assumes "invar ts"
assumes "ts\<noteq>[]"
- shows "T_get_min ts \<le> log 2 (size (mset_heap ts) + 1)"
+ shows "T_get_min ts \<le> log 2 (size (mset_trees ts) + 1)"
proof -
have 1: "T_get_min ts = length ts" using assms T_get_min_estimate by auto
- also note size_mset_heap[OF \<open>invar ts\<close>]
+ also note size_mset_trees[OF \<open>invar ts\<close>]
finally show ?thesis .
qed
subsubsection \<open>\<open>T_del_min\<close>\<close>
-fun T_get_min_rest :: "'a::linorder heap \<Rightarrow> nat" where
+fun T_get_min_rest :: "'a::linorder trees \<Rightarrow> nat" where
"T_get_min_rest [t] = 1"
| "T_get_min_rest (t#ts) = 1 + T_get_min_rest ts"
@@ -590,10 +590,10 @@
lemma T_get_min_rest_bound:
assumes "invar ts"
assumes "ts\<noteq>[]"
- shows "T_get_min_rest ts \<le> log 2 (size (mset_heap ts) + 1)"
+ shows "T_get_min_rest ts \<le> log 2 (size (mset_trees ts) + 1)"
proof -
have 1: "T_get_min_rest ts = length ts" using assms T_get_min_rest_estimate by auto
- also note size_mset_heap[OF \<open>invar ts\<close>]
+ also note size_mset_trees[OF \<open>invar ts\<close>]
finally show ?thesis .
qed
@@ -603,14 +603,14 @@
definition "T_rev xs = length xs + 1"
-definition T_del_min :: "'a::linorder heap \<Rightarrow> nat" where
+definition T_del_min :: "'a::linorder trees \<Rightarrow> nat" where
"T_del_min ts = T_get_min_rest ts + (case get_min_rest ts of (Node _ x ts\<^sub>1, ts\<^sub>2)
\<Rightarrow> T_rev ts\<^sub>1 + T_merge (rev ts\<^sub>1) ts\<^sub>2
) + 1"
lemma T_del_min_bound:
fixes ts
- defines "n \<equiv> size (mset_heap ts)"
+ defines "n \<equiv> size (mset_trees ts)"
assumes "invar ts" and "ts\<noteq>[]"
shows "T_del_min ts \<le> 6 * log 2 (n+1) + 3"
proof -
@@ -621,12 +621,12 @@
using invar_get_min_rest[OF GM \<open>ts\<noteq>[]\<close> \<open>invar ts\<close>] invar_children
by auto
- define n\<^sub>1 where "n\<^sub>1 = size (mset_heap ts\<^sub>1)"
- define n\<^sub>2 where "n\<^sub>2 = size (mset_heap ts\<^sub>2)"
+ define n\<^sub>1 where "n\<^sub>1 = size (mset_trees ts\<^sub>1)"
+ define n\<^sub>2 where "n\<^sub>2 = size (mset_trees ts\<^sub>2)"
have "n\<^sub>1 \<le> n" "n\<^sub>1 + n\<^sub>2 \<le> n" unfolding n_def n\<^sub>1_def n\<^sub>2_def
using mset_get_min_rest[OF GM \<open>ts\<noteq>[]\<close>]
- by (auto simp: mset_heap_def)
+ by (auto simp: mset_trees_def)
have "T_del_min ts = real (T_get_min_rest ts) + real (T_rev ts\<^sub>1) + real (T_merge (rev ts\<^sub>1) ts\<^sub>2) + 1"
unfolding T_del_min_def GM
@@ -634,7 +634,7 @@
also have "T_get_min_rest ts \<le> log 2 (n+1)"
using T_get_min_rest_bound[OF \<open>invar ts\<close> \<open>ts\<noteq>[]\<close>] unfolding n_def by simp
also have "T_rev ts\<^sub>1 \<le> 1 + log 2 (n\<^sub>1 + 1)"
- unfolding T_rev_def n\<^sub>1_def using size_mset_heap[OF I1] by simp
+ unfolding T_rev_def n\<^sub>1_def using size_mset_trees[OF I1] by simp
also have "T_merge (rev ts\<^sub>1) ts\<^sub>2 \<le> 4*log 2 (n\<^sub>1 + n\<^sub>2 + 1) + 1"
unfolding n\<^sub>1_def n\<^sub>2_def using T_merge_bound[OF I1 I2] by (simp add: algebra_simps)
finally have "T_del_min ts \<le> log 2 (n+1) + log 2 (n\<^sub>1 + 1) + 4*log 2 (real (n\<^sub>1 + n\<^sub>2) + 1) + 3"
--- a/src/HOL/Data_Structures/Set2_Join.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Data_Structures/Set2_Join.thy Fri Sep 02 13:41:55 2022 +0200
@@ -64,18 +64,19 @@
subsection "\<open>join2\<close>"
-definition join2 :: "('a*'b) tree \<Rightarrow> ('a*'b) tree \<Rightarrow> ('a*'b) tree" where
-"join2 l r = (if r = Leaf then l else let (m,r') = split_min r in join l m r')"
+fun join2 :: "('a*'b) tree \<Rightarrow> ('a*'b) tree \<Rightarrow> ('a*'b) tree" where
+"join2 l \<langle>\<rangle> = l" |
+"join2 l r = (let (m,r') = split_min r in join l m r')"
lemma set_join2[simp]: "set_tree (join2 l r) = set_tree l \<union> set_tree r"
-by(simp add: join2_def split_min_set split: prod.split)
+by(cases r)(simp_all add: split_min_set split: prod.split)
lemma bst_join2: "\<lbrakk> bst l; bst r; \<forall>x \<in> set_tree l. \<forall>y \<in> set_tree r. x < y \<rbrakk>
\<Longrightarrow> bst (join2 l r)"
-by(simp add: join2_def bst_join split_min_set split_min_bst split: prod.split)
+by(cases r)(simp_all add: bst_join split_min_set split_min_bst split: prod.split)
lemma inv_join2: "\<lbrakk> inv l; inv r \<rbrakk> \<Longrightarrow> inv (join2 l r)"
-by(simp add: join2_def inv_join split_min_set split_min_inv split: prod.split)
+by(cases r)(simp_all add: inv_join split_min_set split_min_inv split: prod.split)
subsection "\<open>split\<close>"
--- a/src/HOL/Deriv.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Deriv.thy Fri Sep 02 13:41:55 2022 +0200
@@ -811,7 +811,7 @@
lemma DERIV_def: "DERIV f x :> D \<longleftrightarrow> (\<lambda>h. (f (x + h) - f x) / h) \<midarrow>0\<rightarrow> D"
unfolding field_has_derivative_at has_field_derivative_def has_field_derivative_iff ..
-text \<open>due to Christian Pardillo Laursen, replacing a proper epsilon-delta horror\<close>
+text \<open>due to Christian Pardillo Laursen, replacing a proper epsilon-delta horror\<close>
lemma field_derivative_lim_unique:
assumes f: "(f has_field_derivative df) (at z)"
and s: "s \<longlonglongrightarrow> 0" "\<And>n. s n \<noteq> 0"
--- a/src/HOL/Divides.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Divides.thy Fri Sep 02 13:41:55 2022 +0200
@@ -11,19 +11,7 @@
subsection \<open>More on division\<close>
-inductive eucl_rel_int :: "int \<Rightarrow> int \<Rightarrow> int \<times> int \<Rightarrow> bool"
- where eucl_rel_int_by0: "eucl_rel_int k 0 (0, k)"
- | eucl_rel_int_dividesI: "l \<noteq> 0 \<Longrightarrow> k = q * l \<Longrightarrow> eucl_rel_int k l (q, 0)"
- | eucl_rel_int_remainderI: "sgn r = sgn l \<Longrightarrow> \<bar>r\<bar> < \<bar>l\<bar>
- \<Longrightarrow> k = q * l + r \<Longrightarrow> eucl_rel_int k l (q, r)"
-
-lemma eucl_rel_int_iff:
- "eucl_rel_int k l (q, r) \<longleftrightarrow>
- k = l * q + r \<and>
- (if 0 < l then 0 \<le> r \<and> r < l else if l < 0 then l < r \<and> r \<le> 0 else q = 0)"
- by (cases "r = 0")
- (auto elim!: eucl_rel_int.cases intro: eucl_rel_int_by0 eucl_rel_int_dividesI eucl_rel_int_remainderI
- simp add: ac_simps sgn_1_pos sgn_1_neg)
+subsubsection \<open>Monotonicity in the First Argument (Dividend)\<close>
lemma unique_quotient_lemma:
assumes "b * q' + r' \<le> b * q + r" "0 \<le> r'" "r' < b" "r < b" shows "q' \<le> (q::int)"
@@ -40,186 +28,16 @@
lemma unique_quotient_lemma_neg:
"b * q' + r' \<le> b*q + r \<Longrightarrow> r \<le> 0 \<Longrightarrow> b < r \<Longrightarrow> b < r' \<Longrightarrow> q \<le> (q'::int)"
- by (rule_tac b = "-b" and r = "-r'" and r' = "-r" in unique_quotient_lemma) auto
-
-lemma unique_quotient:
- "eucl_rel_int a b (q, r) \<Longrightarrow> eucl_rel_int a b (q', r') \<Longrightarrow> q = q'"
- apply (rule order_antisym)
- apply (simp_all add: eucl_rel_int_iff linorder_neq_iff split: if_split_asm)
- apply (blast intro: order_eq_refl [THEN unique_quotient_lemma] order_eq_refl [THEN unique_quotient_lemma_neg] sym)+
- done
-
-lemma unique_remainder:
- "eucl_rel_int a b (q, r) \<Longrightarrow> eucl_rel_int a b (q', r') \<Longrightarrow> r = r'"
-apply (subgoal_tac "q = q'")
- apply (simp add: eucl_rel_int_iff)
-apply (blast intro: unique_quotient)
-done
-
-lemma eucl_rel_int:
- "eucl_rel_int k l (k div l, k mod l)"
-proof (cases k rule: int_cases3)
- case zero
- then show ?thesis
- by (simp add: eucl_rel_int_iff divide_int_def modulo_int_def)
-next
- case (pos n)
- then show ?thesis
- using div_mult_mod_eq [of n]
- by (cases l rule: int_cases3)
- (auto simp del: of_nat_mult of_nat_add
- simp add: mod_greater_zero_iff_not_dvd of_nat_mult [symmetric] of_nat_add [symmetric] algebra_simps
- eucl_rel_int_iff divide_int_def modulo_int_def)
-next
- case (neg n)
- then show ?thesis
- using div_mult_mod_eq [of n]
- by (cases l rule: int_cases3)
- (auto simp del: of_nat_mult of_nat_add
- simp add: mod_greater_zero_iff_not_dvd of_nat_mult [symmetric] of_nat_add [symmetric] algebra_simps
- eucl_rel_int_iff divide_int_def modulo_int_def)
-qed
-
-lemma divmod_int_unique:
- assumes "eucl_rel_int k l (q, r)"
- shows div_int_unique: "k div l = q" and mod_int_unique: "k mod l = r"
- using assms eucl_rel_int [of k l]
- using unique_quotient [of k l] unique_remainder [of k l]
- by auto
-
-lemma div_abs_eq_div_nat:
- "\<bar>k\<bar> div \<bar>l\<bar> = int (nat \<bar>k\<bar> div nat \<bar>l\<bar>)"
- by (simp add: divide_int_def)
-
-lemma mod_abs_eq_div_nat:
- "\<bar>k\<bar> mod \<bar>l\<bar> = int (nat \<bar>k\<bar> mod nat \<bar>l\<bar>)"
- by (simp add: modulo_int_def)
-
-lemma zdiv_int:
- "int (a div b) = int a div int b"
- by (simp add: divide_int_def)
-
-lemma zmod_int:
- "int (a mod b) = int a mod int b"
- by (simp add: modulo_int_def)
-
-lemma div_sgn_abs_cancel:
- fixes k l v :: int
- assumes "v \<noteq> 0"
- shows "(sgn v * \<bar>k\<bar>) div (sgn v * \<bar>l\<bar>) = \<bar>k\<bar> div \<bar>l\<bar>"
-proof -
- from assms have "sgn v = - 1 \<or> sgn v = 1"
- by (cases "v \<ge> 0") auto
- then show ?thesis
- using assms unfolding divide_int_def [of "sgn v * \<bar>k\<bar>" "sgn v * \<bar>l\<bar>"]
- by (fastforce simp add: not_less div_abs_eq_div_nat)
-qed
-
-lemma div_eq_sgn_abs:
- fixes k l v :: int
- assumes "sgn k = sgn l"
- shows "k div l = \<bar>k\<bar> div \<bar>l\<bar>"
-proof (cases "l = 0")
- case True
- then show ?thesis
- by simp
-next
- case False
- with assms have "(sgn k * \<bar>k\<bar>) div (sgn l * \<bar>l\<bar>) = \<bar>k\<bar> div \<bar>l\<bar>"
- using div_sgn_abs_cancel [of l k l] by simp
- then show ?thesis
- by (simp add: sgn_mult_abs)
-qed
-
-lemma div_dvd_sgn_abs:
- fixes k l :: int
- assumes "l dvd k"
- shows "k div l = (sgn k * sgn l) * (\<bar>k\<bar> div \<bar>l\<bar>)"
-proof (cases "k = 0 \<or> l = 0")
- case True
- then show ?thesis
- by auto
-next
- case False
- then have "k \<noteq> 0" and "l \<noteq> 0"
- by auto
- show ?thesis
- proof (cases "sgn l = sgn k")
- case True
- then show ?thesis
- by (auto simp add: div_eq_sgn_abs)
- next
- case False
- with \<open>k \<noteq> 0\<close> \<open>l \<noteq> 0\<close>
- have "sgn l * sgn k = - 1"
- by (simp add: sgn_if split: if_splits)
- with assms show ?thesis
- unfolding divide_int_def [of k l]
- by (auto simp add: zdiv_int ac_simps)
- qed
-qed
-
-lemma div_noneq_sgn_abs:
- fixes k l :: int
- assumes "l \<noteq> 0"
- assumes "sgn k \<noteq> sgn l"
- shows "k div l = - (\<bar>k\<bar> div \<bar>l\<bar>) - of_bool (\<not> l dvd k)"
- using assms
- by (simp only: divide_int_def [of k l], auto simp add: not_less zdiv_int)
-
-
-subsubsection \<open>Laws for div and mod with Unary Minus\<close>
-
-lemma zminus1_lemma:
- "eucl_rel_int a b (q, r) ==> b \<noteq> 0
- ==> eucl_rel_int (-a) b (if r=0 then -q else -q - 1,
- if r=0 then 0 else b-r)"
-by (force simp add: eucl_rel_int_iff right_diff_distrib)
-
-
-lemma zdiv_zminus1_eq_if:
- "b \<noteq> (0::int)
- \<Longrightarrow> (-a) div b = (if a mod b = 0 then - (a div b) else - (a div b) - 1)"
-by (blast intro: eucl_rel_int [THEN zminus1_lemma, THEN div_int_unique])
-
-lemma zmod_zminus1_eq_if:
- "(-a::int) mod b = (if a mod b = 0 then 0 else b - (a mod b))"
-proof (cases "b = 0")
- case False
- then show ?thesis
- by (blast intro: eucl_rel_int [THEN zminus1_lemma, THEN mod_int_unique])
-qed auto
-
-lemma zmod_zminus1_not_zero:
- fixes k l :: int
- shows "- k mod l \<noteq> 0 \<Longrightarrow> k mod l \<noteq> 0"
- by (simp add: mod_eq_0_iff_dvd)
-
-lemma zmod_zminus2_not_zero:
- fixes k l :: int
- shows "k mod - l \<noteq> 0 \<Longrightarrow> k mod l \<noteq> 0"
- by (simp add: mod_eq_0_iff_dvd)
-
-lemma zdiv_zminus2_eq_if:
- "b \<noteq> (0::int)
- ==> a div (-b) =
- (if a mod b = 0 then - (a div b) else - (a div b) - 1)"
- by (auto simp add: zdiv_zminus1_eq_if div_minus_right)
-
-lemma zmod_zminus2_eq_if:
- "a mod (-b::int) = (if a mod b = 0 then 0 else (a mod b) - b)"
- by (auto simp add: zmod_zminus1_eq_if mod_minus_right)
-
-
-subsubsection \<open>Monotonicity in the First Argument (Dividend)\<close>
+ using unique_quotient_lemma[where b = "-b" and r = "-r'" and r'="-r"] by auto
lemma zdiv_mono1:
- fixes b::int
- assumes "a \<le> a'" "0 < b" shows "a div b \<le> a' div b"
+ \<open>a div b \<le> a' div b\<close>
+ if \<open>a \<le> a'\<close> \<open>0 < b\<close>
+ for a b b' :: int
proof (rule unique_quotient_lemma)
show "b * (a div b) + a mod b \<le> b * (a' div b) + a' mod b"
- using assms(1) by auto
-qed (use assms in auto)
+ using \<open>a \<le> a'\<close> by auto
+qed (use that in auto)
lemma zdiv_mono1_neg:
fixes b::int
@@ -295,6 +113,72 @@
by simp
qed (use assms in auto)
+
+subsubsection \<open>Computing \<open>div\<close> and \<open>mod\<close> with shifting\<close>
+
+inductive eucl_rel_int :: "int \<Rightarrow> int \<Rightarrow> int \<times> int \<Rightarrow> bool"
+ where eucl_rel_int_by0: "eucl_rel_int k 0 (0, k)"
+ | eucl_rel_int_dividesI: "l \<noteq> 0 \<Longrightarrow> k = q * l \<Longrightarrow> eucl_rel_int k l (q, 0)"
+ | eucl_rel_int_remainderI: "sgn r = sgn l \<Longrightarrow> \<bar>r\<bar> < \<bar>l\<bar>
+ \<Longrightarrow> k = q * l + r \<Longrightarrow> eucl_rel_int k l (q, r)"
+
+lemma eucl_rel_int_iff:
+ "eucl_rel_int k l (q, r) \<longleftrightarrow>
+ k = l * q + r \<and>
+ (if 0 < l then 0 \<le> r \<and> r < l else if l < 0 then l < r \<and> r \<le> 0 else q = 0)"
+ by (cases "r = 0")
+ (auto elim!: eucl_rel_int.cases intro: eucl_rel_int_by0 eucl_rel_int_dividesI eucl_rel_int_remainderI
+ simp add: ac_simps sgn_1_pos sgn_1_neg)
+
+lemma unique_quotient:
+ "eucl_rel_int a b (q, r) \<Longrightarrow> eucl_rel_int a b (q', r') \<Longrightarrow> q = q'"
+ apply (rule order_antisym)
+ apply (simp_all add: eucl_rel_int_iff linorder_neq_iff split: if_split_asm)
+ apply (blast intro: order_eq_refl [THEN unique_quotient_lemma] order_eq_refl [THEN unique_quotient_lemma_neg] sym)+
+ done
+
+lemma unique_remainder:
+ assumes "eucl_rel_int a b (q, r)"
+ and "eucl_rel_int a b (q', r')"
+ shows "r = r'"
+proof -
+ have "q = q'"
+ using assms by (blast intro: unique_quotient)
+ then show "r = r'"
+ using assms by (simp add: eucl_rel_int_iff)
+qed
+
+lemma eucl_rel_int:
+ "eucl_rel_int k l (k div l, k mod l)"
+proof (cases k rule: int_cases3)
+ case zero
+ then show ?thesis
+ by (simp add: eucl_rel_int_iff divide_int_def modulo_int_def)
+next
+ case (pos n)
+ then show ?thesis
+ using div_mult_mod_eq [of n]
+ by (cases l rule: int_cases3)
+ (auto simp del: of_nat_mult of_nat_add
+ simp add: mod_greater_zero_iff_not_dvd of_nat_mult [symmetric] of_nat_add [symmetric] algebra_simps
+ eucl_rel_int_iff divide_int_def modulo_int_def)
+next
+ case (neg n)
+ then show ?thesis
+ using div_mult_mod_eq [of n]
+ by (cases l rule: int_cases3)
+ (auto simp del: of_nat_mult of_nat_add
+ simp add: mod_greater_zero_iff_not_dvd of_nat_mult [symmetric] of_nat_add [symmetric] algebra_simps
+ eucl_rel_int_iff divide_int_def modulo_int_def)
+qed
+
+lemma divmod_int_unique:
+ assumes "eucl_rel_int k l (q, r)"
+ shows div_int_unique: "k div l = q" and mod_int_unique: "k mod l = r"
+ using assms eucl_rel_int [of k l]
+ using unique_quotient [of k l] unique_remainder [of k l]
+ by auto
+
lemma div_pos_geq:
fixes k l :: int
assumes "0 < l" and "l \<le> k"
@@ -315,54 +199,6 @@
with assms show ?thesis by simp
qed
-
-subsubsection \<open>Splitting Rules for div and mod\<close>
-
-text\<open>The proofs of the two lemmas below are essentially identical\<close>
-
-lemma split_pos_lemma:
- "0<k \<Longrightarrow>
- P(n div k :: int)(n mod k) = (\<forall>i j. 0\<le>j \<and> j<k \<and> n = k*i + j \<longrightarrow> P i j)"
- by auto
-
-lemma split_neg_lemma:
- "k<0 \<Longrightarrow>
- P(n div k :: int)(n mod k) = (\<forall>i j. k<j \<and> j\<le>0 \<and> n = k*i + j \<longrightarrow> P i j)"
- by auto
-
-lemma split_zdiv:
- "P(n div k :: int) =
- ((k = 0 \<longrightarrow> P 0) \<and>
- (0<k \<longrightarrow> (\<forall>i j. 0\<le>j \<and> j<k \<and> n = k*i + j \<longrightarrow> P i)) \<and>
- (k<0 \<longrightarrow> (\<forall>i j. k<j \<and> j\<le>0 \<and> n = k*i + j \<longrightarrow> P i)))"
-proof (cases "k = 0")
- case False
- then show ?thesis
- unfolding linorder_neq_iff
- by (auto simp add: split_pos_lemma [of concl: "\<lambda>x y. P x"] split_neg_lemma [of concl: "\<lambda>x y. P x"])
-qed auto
-
-lemma split_zmod:
- "P(n mod k :: int) =
- ((k = 0 \<longrightarrow> P n) \<and>
- (0<k \<longrightarrow> (\<forall>i j. 0\<le>j \<and> j<k \<and> n = k*i + j \<longrightarrow> P j)) \<and>
- (k<0 \<longrightarrow> (\<forall>i j. k<j \<and> j\<le>0 \<and> n = k*i + j \<longrightarrow> P j)))"
-proof (cases "k = 0")
- case False
- then show ?thesis
- unfolding linorder_neq_iff
- by (auto simp add: split_pos_lemma [of concl: "\<lambda>x y. P y"] split_neg_lemma [of concl: "\<lambda>x y. P y"])
-qed auto
-
-text \<open>Enable (lin)arith to deal with \<^const>\<open>divide\<close> and \<^const>\<open>modulo\<close>
- when these are applied to some constant that is of the form
- \<^term>\<open>numeral k\<close>:\<close>
-declare split_zdiv [of _ _ "numeral k", arith_split] for k
-declare split_zmod [of _ _ "numeral k", arith_split] for k
-
-
-subsubsection \<open>Computing \<open>div\<close> and \<open>mod\<close> with shifting\<close>
-
lemma pos_eucl_rel_int_mult_2:
assumes "0 \<le> b"
assumes "eucl_rel_int a b (q, r)"
@@ -426,31 +262,6 @@
unfolding mult_2 [symmetric] add.commute [of _ 1]
by (rule pos_zmod_mult_2, simp)
-lemma zdiv_eq_0_iff:
- "i div k = 0 \<longleftrightarrow> k = 0 \<or> 0 \<le> i \<and> i < k \<or> i \<le> 0 \<and> k < i" (is "?L = ?R")
- for i k :: int
-proof
- assume ?L
- moreover have "?L \<longrightarrow> ?R"
- by (rule split_zdiv [THEN iffD2]) simp
- ultimately show ?R
- by blast
-next
- assume ?R then show ?L
- by auto
-qed
-
-lemma zmod_trivial_iff:
- fixes i k :: int
- shows "i mod k = i \<longleftrightarrow> k = 0 \<or> 0 \<le> i \<and> i < k \<or> i \<le> 0 \<and> k < i"
-proof -
- have "i mod k = i \<longleftrightarrow> i div k = 0"
- by safe (insert div_mult_mod_eq [of i k], auto)
- with zdiv_eq_0_iff
- show ?thesis
- by simp
-qed
-
subsubsection \<open>Quotients of Signs\<close>
@@ -482,17 +293,15 @@
by simp
next
case False
- moreover have \<open>0 < k mod l\<close> \<open>k mod l < 1 + l\<close>
- using \<open>0 < l\<close> le_imp_0_less False apply auto
- using le_less apply fastforce
- using pos_mod_bound [of l k] apply linarith
- done
- with \<open>l > 0\<close> have \<open>(k mod l - 1) mod l = k mod l - 1\<close>
+ moreover have 1: \<open>0 < k mod l\<close>
+ using \<open>0 < l\<close> False le_less by fastforce
+ moreover have 2: \<open>k mod l < 1 + l\<close>
+ using \<open>0 < l\<close> pos_mod_bound[of l k] by linarith
+ from 1 2 \<open>l > 0\<close> have \<open>(k mod l - 1) mod l = k mod l - 1\<close>
by (simp add: zmod_trivial_iff)
ultimately show ?thesis
- apply (simp only: zmod_zminus1_eq_if)
- apply (simp add: mod_eq_0_iff_dvd algebra_simps mod_simps)
- done
+ by (simp only: zmod_zminus1_eq_if)
+ (simp add: mod_eq_0_iff_dvd algebra_simps mod_simps)
qed
qed
@@ -539,7 +348,6 @@
"0<k \<Longrightarrow> 0 < (i::int) div k \<longleftrightarrow> k \<le> i"
using pos_imp_zdiv_nonneg_iff[of k i] zdiv_eq_0_iff[of i k] by arith
-
lemma neg_imp_zdiv_nonneg_iff:
fixes a::int
assumes "b < 0"
@@ -572,6 +380,28 @@
lemma zmod_le_nonneg_dividend: "(m::int) \<ge> 0 \<Longrightarrow> m mod k \<le> m"
by (rule split_zmod[THEN iffD2]) (fastforce dest: q_pos_lemma intro: split_mult_pos_le)
+lemma sgn_div_eq_sgn_mult:
+ \<open>sgn (k div l) = of_bool (k div l \<noteq> 0) * sgn (k * l)\<close>
+ for k l :: int
+proof (cases \<open>k div l = 0\<close>)
+ case True
+ then show ?thesis
+ by simp
+next
+ case False
+ have \<open>0 \<le> \<bar>k\<bar> div \<bar>l\<bar>\<close>
+ by (cases \<open>l = 0\<close>) (simp_all add: pos_imp_zdiv_nonneg_iff)
+ then have \<open>\<bar>k\<bar> div \<bar>l\<bar> \<noteq> 0 \<longleftrightarrow> 0 < \<bar>k\<bar> div \<bar>l\<bar>\<close>
+ by (simp add: less_le)
+ also have \<open>\<dots> \<longleftrightarrow> \<bar>k\<bar> \<ge> \<bar>l\<bar>\<close>
+ using False nonneg1_imp_zdiv_pos_iff by auto
+ finally have *: \<open>\<bar>k\<bar> div \<bar>l\<bar> \<noteq> 0 \<longleftrightarrow> \<bar>l\<bar> \<le> \<bar>k\<bar>\<close> .
+ show ?thesis
+ using \<open>0 \<le> \<bar>k\<bar> div \<bar>l\<bar>\<close> False
+ by (auto simp add: div_eq_div_abs [of k l] div_eq_sgn_abs [of k l]
+ sgn_mult sgn_1_pos sgn_1_neg sgn_eq_0_iff nonneg1_imp_zdiv_pos_iff * dest: sgn_not_eq_imp)
+qed
+
subsubsection \<open>Further properties\<close>
@@ -581,9 +411,12 @@
for k l :: int
proof (cases "k = 0 \<or> l = 0")
case False
+ then have *: "k \<noteq> 0" "l \<noteq> 0"
+ by auto
+ then have "0 \<le> k div l \<Longrightarrow> \<not> k < 0 \<Longrightarrow> 0 \<le> l"
+ by (meson neg_imp_zdiv_neg_iff not_le not_less_iff_gr_or_eq)
then show ?thesis
- apply (auto simp add: pos_imp_zdiv_nonneg_iff neg_imp_zdiv_nonneg_iff)
- by (meson neg_imp_zdiv_neg_iff not_le not_less_iff_gr_or_eq)
+ using * by (auto simp add: pos_imp_zdiv_nonneg_iff neg_imp_zdiv_nonneg_iff)
qed auto
lemma mod_int_pos_iff:
@@ -672,7 +505,7 @@
lemma nat_mod_eq_lemma:
assumes "(x::nat) mod n = y mod n" and "y \<le> x"
shows "\<exists>q. x = y + n * q"
- using assms by (rule mod_eq_nat1E) rule
+ using assms by (rule mod_eq_nat1E) (rule exI)
lemma nat_mod_eq_iff: "(x::nat) mod n = y mod n \<longleftrightarrow> (\<exists>q1 q2. x + n * q1 = y + n * q2)"
(is "?lhs = ?rhs")
@@ -681,11 +514,25 @@
{assume xy: "x \<le> y"
from H have th: "y mod n = x mod n" by simp
from nat_mod_eq_lemma[OF th xy] have ?rhs
- apply clarify apply (rule_tac x="q" in exI) by (rule exI[where x="0"], simp)}
+ proof
+ fix q
+ assume "y = x + n * q"
+ then have "x + n * q = y + n * 0"
+ by simp
+ then show "\<exists>q1 q2. x + n * q1 = y + n * q2"
+ by blast
+ qed}
moreover
{assume xy: "y \<le> x"
from nat_mod_eq_lemma[OF H xy] have ?rhs
- apply clarify apply (rule_tac x="0" in exI) by (rule_tac x="q" in exI, simp)}
+ proof
+ fix q
+ assume "x = y + n * q"
+ then have "x + n * 0 = y + n * q"
+ by simp
+ then show "\<exists>q1 q2. x + n * q1 = y + n * q2"
+ by blast
+ qed}
ultimately show ?rhs using linear[of x y] by blast
next
assume ?rhs then obtain q1 q2 where q12: "x + n * q1 = y + n * q2" by blast
@@ -694,15 +541,11 @@
qed
-subsection \<open>Numeral division with a pragmatic type class\<close>
+code_identifier
+ code_module Divides \<rightharpoonup> (SML) Arith and (OCaml) Arith and (Haskell) Arith
-text \<open>
- The following type class contains everything necessary to formulate
- a division algorithm in ring structures with numerals, restricted
- to its positive segments. This is its primary motivation, and it
- could surely be formulated using a more fine-grained, more algebraic
- and less technical class hierarchy.
-\<close>
+
+subsection \<open>Lemmas of doubtful value\<close>
class unique_euclidean_semiring_numeral = unique_euclidean_semiring_with_nat + linordered_semidom +
assumes div_less: "0 \<le> a \<Longrightarrow> a < b \<Longrightarrow> a div b = 0"
@@ -714,15 +557,6 @@
and mod_mult2_eq: "0 \<le> c \<Longrightarrow> a mod (b * c) = b * (a div b mod c) + a mod b"
and div_mult2_eq: "0 \<le> c \<Longrightarrow> a div (b * c) = a div b div c"
assumes discrete: "a < b \<longleftrightarrow> a + 1 \<le> b"
- fixes divmod :: "num \<Rightarrow> num \<Rightarrow> 'a \<times> 'a"
- and divmod_step :: "num \<Rightarrow> 'a \<times> 'a \<Rightarrow> 'a \<times> 'a"
- assumes divmod_def: "divmod m n = (numeral m div numeral n, numeral m mod numeral n)"
- and divmod_step_def: "divmod_step l qr = (let (q, r) = qr
- in if r \<ge> numeral l then (2 * q + 1, r - numeral l)
- else (2 * q, r))"
- \<comment> \<open>These are conceptually definitions but force generated code
- to be monomorphic wrt. particular instances of this class which
- yields a significant speedup.\<close>
begin
lemma divmod_digit_1:
@@ -740,7 +574,7 @@
have mod_w: "a mod (2 * b) = a mod b + b * w"
by (simp add: w_def mod_mult2_eq ac_simps)
from assms w_exhaust have "w = 1"
- by (auto simp add: mod_w) (insert mod_less, auto)
+ using mod_less by (auto simp add: mod_w)
with mod_w have mod: "a mod (2 * b) = a mod b + b" by simp
have "2 * (a div (2 * b)) = a div b - w"
by (simp add: w_def div_mult2_eq minus_mod_eq_mult_div ac_simps)
@@ -789,435 +623,17 @@
thus ?thesis by simp
qed
-lemma fst_divmod:
- "fst (divmod m n) = numeral m div numeral n"
- by (simp add: divmod_def)
-
-lemma snd_divmod:
- "snd (divmod m n) = numeral m mod numeral n"
- by (simp add: divmod_def)
-
-text \<open>
- This is a formulation of one step (referring to one digit position)
- in school-method division: compare the dividend at the current
- digit position with the remainder from previous division steps
- and evaluate accordingly.
-\<close>
-
-lemma divmod_step_eq [simp]:
- "divmod_step l (q, r) = (if numeral l \<le> r
- then (2 * q + 1, r - numeral l) else (2 * q, r))"
- by (simp add: divmod_step_def)
-
-text \<open>
- This is a formulation of school-method division.
- If the divisor is smaller than the dividend, terminate.
- If not, shift the dividend to the right until termination
- occurs and then reiterate single division steps in the
- opposite direction.
-\<close>
-
-lemma divmod_divmod_step:
- "divmod m n = (if m < n then (0, numeral m)
- else divmod_step n (divmod m (Num.Bit0 n)))"
-proof (cases "m < n")
- case True then have "numeral m < numeral n" by simp
- then show ?thesis
- by (simp add: prod_eq_iff div_less mod_less fst_divmod snd_divmod)
-next
- case False
- have "divmod m n =
- divmod_step n (numeral m div (2 * numeral n),
- numeral m mod (2 * numeral n))"
- proof (cases "numeral n \<le> numeral m mod (2 * numeral n)")
- case True
- with divmod_step_eq
- have "divmod_step n (numeral m div (2 * numeral n), numeral m mod (2 * numeral n)) =
- (2 * (numeral m div (2 * numeral n)) + 1, numeral m mod (2 * numeral n) - numeral n)"
- by simp
- moreover from True divmod_digit_1 [of "numeral m" "numeral n"]
- have "2 * (numeral m div (2 * numeral n)) + 1 = numeral m div numeral n"
- and "numeral m mod (2 * numeral n) - numeral n = numeral m mod numeral n"
- by simp_all
- ultimately show ?thesis by (simp only: divmod_def)
- next
- case False then have *: "numeral m mod (2 * numeral n) < numeral n"
- by (simp add: not_le)
- with divmod_step_eq
- have "divmod_step n (numeral m div (2 * numeral n), numeral m mod (2 * numeral n)) =
- (2 * (numeral m div (2 * numeral n)), numeral m mod (2 * numeral n))"
- by auto
- moreover from * divmod_digit_0 [of "numeral n" "numeral m"]
- have "2 * (numeral m div (2 * numeral n)) = numeral m div numeral n"
- and "numeral m mod (2 * numeral n) = numeral m mod numeral n"
- by (simp_all only: zero_less_numeral)
- ultimately show ?thesis by (simp only: divmod_def)
- qed
- then have "divmod m n =
- divmod_step n (numeral m div numeral (Num.Bit0 n),
- numeral m mod numeral (Num.Bit0 n))"
- by (simp only: numeral.simps distrib mult_1)
- then have "divmod m n = divmod_step n (divmod m (Num.Bit0 n))"
- by (simp add: divmod_def)
- with False show ?thesis by simp
-qed
-
-text \<open>The division rewrite proper -- first, trivial results involving \<open>1\<close>\<close>
-
-lemma divmod_trivial [simp]:
- "divmod m Num.One = (numeral m, 0)"
- "divmod num.One (num.Bit0 n) = (0, Numeral1)"
- "divmod num.One (num.Bit1 n) = (0, Numeral1)"
- using divmod_divmod_step [of "Num.One"] by (simp_all add: divmod_def)
-
-text \<open>Division by an even number is a right-shift\<close>
-
-lemma divmod_cancel [simp]:
- "divmod (Num.Bit0 m) (Num.Bit0 n) = (case divmod m n of (q, r) \<Rightarrow> (q, 2 * r))" (is ?P)
- "divmod (Num.Bit1 m) (Num.Bit0 n) = (case divmod m n of (q, r) \<Rightarrow> (q, 2 * r + 1))" (is ?Q)
-proof -
- have *: "\<And>q. numeral (Num.Bit0 q) = 2 * numeral q"
- "\<And>q. numeral (Num.Bit1 q) = 2 * numeral q + 1"
- by (simp_all only: numeral_mult numeral.simps distrib) simp_all
- have "1 div 2 = 0" "1 mod 2 = 1" by (auto intro: div_less mod_less)
- then show ?P and ?Q
- by (simp_all add: fst_divmod snd_divmod prod_eq_iff split_def * [of m] * [of n] mod_mult_mult1
- div_mult2_eq [of _ _ 2] mod_mult2_eq [of _ _ 2]
- add.commute del: numeral_times_numeral)
-qed
-
-text \<open>The really hard work\<close>
-
-lemma divmod_steps [simp]:
- "divmod (num.Bit0 m) (num.Bit1 n) =
- (if m \<le> n then (0, numeral (num.Bit0 m))
- else divmod_step (num.Bit1 n)
- (divmod (num.Bit0 m)
- (num.Bit0 (num.Bit1 n))))"
- "divmod (num.Bit1 m) (num.Bit1 n) =
- (if m < n then (0, numeral (num.Bit1 m))
- else divmod_step (num.Bit1 n)
- (divmod (num.Bit1 m)
- (num.Bit0 (num.Bit1 n))))"
- by (simp_all add: divmod_divmod_step)
-
-lemmas divmod_algorithm_code = divmod_step_eq divmod_trivial divmod_cancel divmod_steps
-
-text \<open>Special case: divisibility\<close>
-
-definition divides_aux :: "'a \<times> 'a \<Rightarrow> bool"
-where
- "divides_aux qr \<longleftrightarrow> snd qr = 0"
-
-lemma divides_aux_eq [simp]:
- "divides_aux (q, r) \<longleftrightarrow> r = 0"
- by (simp add: divides_aux_def)
-
-lemma dvd_numeral_simp [simp]:
- "numeral m dvd numeral n \<longleftrightarrow> divides_aux (divmod n m)"
- by (simp add: divmod_def mod_eq_0_iff_dvd)
-
-text \<open>Generic computation of quotient and remainder\<close>
-
-lemma numeral_div_numeral [simp]:
- "numeral k div numeral l = fst (divmod k l)"
- by (simp add: fst_divmod)
-
-lemma numeral_mod_numeral [simp]:
- "numeral k mod numeral l = snd (divmod k l)"
- by (simp add: snd_divmod)
-
-lemma one_div_numeral [simp]:
- "1 div numeral n = fst (divmod num.One n)"
- by (simp add: fst_divmod)
-
-lemma one_mod_numeral [simp]:
- "1 mod numeral n = snd (divmod num.One n)"
- by (simp add: snd_divmod)
-
-text \<open>Computing congruences modulo \<open>2 ^ q\<close>\<close>
-
-lemma cong_exp_iff_simps:
- "numeral n mod numeral Num.One = 0
- \<longleftrightarrow> True"
- "numeral (Num.Bit0 n) mod numeral (Num.Bit0 q) = 0
- \<longleftrightarrow> numeral n mod numeral q = 0"
- "numeral (Num.Bit1 n) mod numeral (Num.Bit0 q) = 0
- \<longleftrightarrow> False"
- "numeral m mod numeral Num.One = (numeral n mod numeral Num.One)
- \<longleftrightarrow> True"
- "numeral Num.One mod numeral (Num.Bit0 q) = (numeral Num.One mod numeral (Num.Bit0 q))
- \<longleftrightarrow> True"
- "numeral Num.One mod numeral (Num.Bit0 q) = (numeral (Num.Bit0 n) mod numeral (Num.Bit0 q))
- \<longleftrightarrow> False"
- "numeral Num.One mod numeral (Num.Bit0 q) = (numeral (Num.Bit1 n) mod numeral (Num.Bit0 q))
- \<longleftrightarrow> (numeral n mod numeral q) = 0"
- "numeral (Num.Bit0 m) mod numeral (Num.Bit0 q) = (numeral Num.One mod numeral (Num.Bit0 q))
- \<longleftrightarrow> False"
- "numeral (Num.Bit0 m) mod numeral (Num.Bit0 q) = (numeral (Num.Bit0 n) mod numeral (Num.Bit0 q))
- \<longleftrightarrow> numeral m mod numeral q = (numeral n mod numeral q)"
- "numeral (Num.Bit0 m) mod numeral (Num.Bit0 q) = (numeral (Num.Bit1 n) mod numeral (Num.Bit0 q))
- \<longleftrightarrow> False"
- "numeral (Num.Bit1 m) mod numeral (Num.Bit0 q) = (numeral Num.One mod numeral (Num.Bit0 q))
- \<longleftrightarrow> (numeral m mod numeral q) = 0"
- "numeral (Num.Bit1 m) mod numeral (Num.Bit0 q) = (numeral (Num.Bit0 n) mod numeral (Num.Bit0 q))
- \<longleftrightarrow> False"
- "numeral (Num.Bit1 m) mod numeral (Num.Bit0 q) = (numeral (Num.Bit1 n) mod numeral (Num.Bit0 q))
- \<longleftrightarrow> numeral m mod numeral q = (numeral n mod numeral q)"
- by (auto simp add: case_prod_beta dest: arg_cong [of _ _ even])
-
end
hide_fact (open) div_less mod_less mod_less_eq_dividend mod_mult2_eq div_mult2_eq
-instantiation nat :: unique_euclidean_semiring_numeral
-begin
-
-definition divmod_nat :: "num \<Rightarrow> num \<Rightarrow> nat \<times> nat"
-where
- divmod'_nat_def: "divmod_nat m n = (numeral m div numeral n, numeral m mod numeral n)"
-
-definition divmod_step_nat :: "num \<Rightarrow> nat \<times> nat \<Rightarrow> nat \<times> nat"
-where
- "divmod_step_nat l qr = (let (q, r) = qr
- in if r \<ge> numeral l then (2 * q + 1, r - numeral l)
- else (2 * q, r))"
-
-instance by standard
- (auto simp add: divmod'_nat_def divmod_step_nat_def div_greater_zero_iff div_mult2_eq mod_mult2_eq)
-
-end
-
-declare divmod_algorithm_code [where ?'a = nat, code]
-
-lemma Suc_0_div_numeral [simp]:
- fixes k l :: num
- shows "Suc 0 div numeral k = fst (divmod Num.One k)"
- by (simp_all add: fst_divmod)
-
-lemma Suc_0_mod_numeral [simp]:
- fixes k l :: num
- shows "Suc 0 mod numeral k = snd (divmod Num.One k)"
- by (simp_all add: snd_divmod)
-
-instantiation int :: unique_euclidean_semiring_numeral
-begin
-
-definition divmod_int :: "num \<Rightarrow> num \<Rightarrow> int \<times> int"
-where
- "divmod_int m n = (numeral m div numeral n, numeral m mod numeral n)"
-
-definition divmod_step_int :: "num \<Rightarrow> int \<times> int \<Rightarrow> int \<times> int"
-where
- "divmod_step_int l qr = (let (q, r) = qr
- in if r \<ge> numeral l then (2 * q + 1, r - numeral l)
- else (2 * q, r))"
-
-instance
- by standard (auto intro: zmod_le_nonneg_dividend simp add: divmod_int_def divmod_step_int_def
- pos_imp_zdiv_pos_iff zmod_zmult2_eq zdiv_zmult2_eq)
-
-end
-
-declare divmod_algorithm_code [where ?'a = int, code]
-
-context
-begin
-
-qualified definition adjust_div :: "int \<times> int \<Rightarrow> int"
-where
- "adjust_div qr = (let (q, r) = qr in q + of_bool (r \<noteq> 0))"
-
-qualified lemma adjust_div_eq [simp, code]:
- "adjust_div (q, r) = q + of_bool (r \<noteq> 0)"
- by (simp add: adjust_div_def)
-
-qualified definition adjust_mod :: "int \<Rightarrow> int \<Rightarrow> int"
-where
- [simp]: "adjust_mod l r = (if r = 0 then 0 else l - r)"
-
-lemma minus_numeral_div_numeral [simp]:
- "- numeral m div numeral n = - (adjust_div (divmod m n) :: int)"
-proof -
- have "int (fst (divmod m n)) = fst (divmod m n)"
- by (simp only: fst_divmod divide_int_def) auto
- then show ?thesis
- by (auto simp add: split_def Let_def adjust_div_def divides_aux_def divide_int_def)
-qed
-
-lemma minus_numeral_mod_numeral [simp]:
- "- numeral m mod numeral n = adjust_mod (numeral n) (snd (divmod m n) :: int)"
-proof (cases "snd (divmod m n) = (0::int)")
- case True
- then show ?thesis
- by (simp add: mod_eq_0_iff_dvd divides_aux_def)
-next
- case False
- then have "int (snd (divmod m n)) = snd (divmod m n)" if "snd (divmod m n) \<noteq> (0::int)"
- by (simp only: snd_divmod modulo_int_def) auto
- then show ?thesis
- by (simp add: divides_aux_def adjust_div_def)
- (simp add: divides_aux_def modulo_int_def)
-qed
-
-lemma numeral_div_minus_numeral [simp]:
- "numeral m div - numeral n = - (adjust_div (divmod m n) :: int)"
-proof -
- have "int (fst (divmod m n)) = fst (divmod m n)"
- by (simp only: fst_divmod divide_int_def) auto
- then show ?thesis
- by (auto simp add: split_def Let_def adjust_div_def divides_aux_def divide_int_def)
-qed
-
-lemma numeral_mod_minus_numeral [simp]:
- "numeral m mod - numeral n = - adjust_mod (numeral n) (snd (divmod m n) :: int)"
-proof (cases "snd (divmod m n) = (0::int)")
- case True
- then show ?thesis
- by (simp add: mod_eq_0_iff_dvd divides_aux_def)
-next
- case False
- then have "int (snd (divmod m n)) = snd (divmod m n)" if "snd (divmod m n) \<noteq> (0::int)"
- by (simp only: snd_divmod modulo_int_def) auto
- then show ?thesis
- by (simp add: divides_aux_def adjust_div_def)
- (simp add: divides_aux_def modulo_int_def)
-qed
-
-lemma minus_one_div_numeral [simp]:
- "- 1 div numeral n = - (adjust_div (divmod Num.One n) :: int)"
- using minus_numeral_div_numeral [of Num.One n] by simp
-
-lemma minus_one_mod_numeral [simp]:
- "- 1 mod numeral n = adjust_mod (numeral n) (snd (divmod Num.One n) :: int)"
- using minus_numeral_mod_numeral [of Num.One n] by simp
+instance nat :: unique_euclidean_semiring_numeral
+ by standard
+ (auto simp add: div_greater_zero_iff div_mult2_eq mod_mult2_eq)
-lemma one_div_minus_numeral [simp]:
- "1 div - numeral n = - (adjust_div (divmod Num.One n) :: int)"
- using numeral_div_minus_numeral [of Num.One n] by simp
-
-lemma one_mod_minus_numeral [simp]:
- "1 mod - numeral n = - adjust_mod (numeral n) (snd (divmod Num.One n) :: int)"
- using numeral_mod_minus_numeral [of Num.One n] by simp
-
-end
-
-lemma divmod_BitM_2_eq [simp]:
- \<open>divmod (Num.BitM m) (Num.Bit0 Num.One) = (numeral m - 1, (1 :: int))\<close>
- by (cases m) simp_all
-
-lemma div_positive_int:
- "k div l > 0" if "k \<ge> l" and "l > 0" for k l :: int
- using that div_positive [of l k] by blast
-
-
-subsubsection \<open>Dedicated simproc for calculation\<close>
-
-text \<open>
- There is space for improvement here: the calculation itself
- could be carried out outside the logic, and a generic simproc
- (simplifier setup) for generic calculation would be helpful.
-\<close>
-
-simproc_setup numeral_divmod
- ("0 div 0 :: 'a :: unique_euclidean_semiring_numeral" | "0 mod 0 :: 'a :: unique_euclidean_semiring_numeral" |
- "0 div 1 :: 'a :: unique_euclidean_semiring_numeral" | "0 mod 1 :: 'a :: unique_euclidean_semiring_numeral" |
- "0 div - 1 :: int" | "0 mod - 1 :: int" |
- "0 div numeral b :: 'a :: unique_euclidean_semiring_numeral" | "0 mod numeral b :: 'a :: unique_euclidean_semiring_numeral" |
- "0 div - numeral b :: int" | "0 mod - numeral b :: int" |
- "1 div 0 :: 'a :: unique_euclidean_semiring_numeral" | "1 mod 0 :: 'a :: unique_euclidean_semiring_numeral" |
- "1 div 1 :: 'a :: unique_euclidean_semiring_numeral" | "1 mod 1 :: 'a :: unique_euclidean_semiring_numeral" |
- "1 div - 1 :: int" | "1 mod - 1 :: int" |
- "1 div numeral b :: 'a :: unique_euclidean_semiring_numeral" | "1 mod numeral b :: 'a :: unique_euclidean_semiring_numeral" |
- "1 div - numeral b :: int" |"1 mod - numeral b :: int" |
- "- 1 div 0 :: int" | "- 1 mod 0 :: int" | "- 1 div 1 :: int" | "- 1 mod 1 :: int" |
- "- 1 div - 1 :: int" | "- 1 mod - 1 :: int" | "- 1 div numeral b :: int" | "- 1 mod numeral b :: int" |
- "- 1 div - numeral b :: int" | "- 1 mod - numeral b :: int" |
- "numeral a div 0 :: 'a :: unique_euclidean_semiring_numeral" | "numeral a mod 0 :: 'a :: unique_euclidean_semiring_numeral" |
- "numeral a div 1 :: 'a :: unique_euclidean_semiring_numeral" | "numeral a mod 1 :: 'a :: unique_euclidean_semiring_numeral" |
- "numeral a div - 1 :: int" | "numeral a mod - 1 :: int" |
- "numeral a div numeral b :: 'a :: unique_euclidean_semiring_numeral" | "numeral a mod numeral b :: 'a :: unique_euclidean_semiring_numeral" |
- "numeral a div - numeral b :: int" | "numeral a mod - numeral b :: int" |
- "- numeral a div 0 :: int" | "- numeral a mod 0 :: int" |
- "- numeral a div 1 :: int" | "- numeral a mod 1 :: int" |
- "- numeral a div - 1 :: int" | "- numeral a mod - 1 :: int" |
- "- numeral a div numeral b :: int" | "- numeral a mod numeral b :: int" |
- "- numeral a div - numeral b :: int" | "- numeral a mod - numeral b :: int") =
-\<open> let
- val if_cong = the (Code.get_case_cong \<^theory> \<^const_name>\<open>If\<close>);
- fun successful_rewrite ctxt ct =
- let
- val thm = Simplifier.rewrite ctxt ct
- in if Thm.is_reflexive thm then NONE else SOME thm end;
- in fn phi =>
- let
- val simps = Morphism.fact phi (@{thms div_0 mod_0 div_by_0 mod_by_0 div_by_1 mod_by_1
- one_div_numeral one_mod_numeral minus_one_div_numeral minus_one_mod_numeral
- one_div_minus_numeral one_mod_minus_numeral
- numeral_div_numeral numeral_mod_numeral minus_numeral_div_numeral minus_numeral_mod_numeral
- numeral_div_minus_numeral numeral_mod_minus_numeral
- div_minus_minus mod_minus_minus Divides.adjust_div_eq of_bool_eq one_neq_zero
- numeral_neq_zero neg_equal_0_iff_equal arith_simps arith_special divmod_trivial
- divmod_cancel divmod_steps divmod_step_eq fst_conv snd_conv numeral_One
- case_prod_beta rel_simps Divides.adjust_mod_def div_minus1_right mod_minus1_right
- minus_minus numeral_times_numeral mult_zero_right mult_1_right}
- @ [@{lemma "0 = 0 \<longleftrightarrow> True" by simp}]);
- fun prepare_simpset ctxt = HOL_ss |> Simplifier.simpset_map ctxt
- (Simplifier.add_cong if_cong #> fold Simplifier.add_simp simps)
- in fn ctxt => successful_rewrite (Simplifier.put_simpset (prepare_simpset ctxt) ctxt) end
- end
-\<close>
-
-
-subsubsection \<open>Code generation\<close>
-
-definition divmod_nat :: "nat \<Rightarrow> nat \<Rightarrow> nat \<times> nat"
- where "divmod_nat m n = (m div n, m mod n)"
-
-lemma fst_divmod_nat [simp]:
- "fst (divmod_nat m n) = m div n"
- by (simp add: divmod_nat_def)
-
-lemma snd_divmod_nat [simp]:
- "snd (divmod_nat m n) = m mod n"
- by (simp add: divmod_nat_def)
-
-lemma divmod_nat_if [code]:
- "Divides.divmod_nat m n = (if n = 0 \<or> m < n then (0, m) else
- let (q, r) = Divides.divmod_nat (m - n) n in (Suc q, r))"
- by (simp add: prod_eq_iff case_prod_beta not_less le_div_geq le_mod_geq)
-
-lemma [code]:
- "m div n = fst (divmod_nat m n)"
- "m mod n = snd (divmod_nat m n)"
- by simp_all
-
-lemma [code]:
- fixes k :: int
- shows
- "k div 0 = 0"
- "k mod 0 = k"
- "0 div k = 0"
- "0 mod k = 0"
- "k div Int.Pos Num.One = k"
- "k mod Int.Pos Num.One = 0"
- "k div Int.Neg Num.One = - k"
- "k mod Int.Neg Num.One = 0"
- "Int.Pos m div Int.Pos n = (fst (divmod m n) :: int)"
- "Int.Pos m mod Int.Pos n = (snd (divmod m n) :: int)"
- "Int.Neg m div Int.Pos n = - (Divides.adjust_div (divmod m n) :: int)"
- "Int.Neg m mod Int.Pos n = Divides.adjust_mod (Int.Pos n) (snd (divmod m n) :: int)"
- "Int.Pos m div Int.Neg n = - (Divides.adjust_div (divmod m n) :: int)"
- "Int.Pos m mod Int.Neg n = - Divides.adjust_mod (Int.Pos n) (snd (divmod m n) :: int)"
- "Int.Neg m div Int.Neg n = (fst (divmod m n) :: int)"
- "Int.Neg m mod Int.Neg n = - (snd (divmod m n) :: int)"
- by simp_all
-
-code_identifier
- code_module Divides \<rightharpoonup> (SML) Arith and (OCaml) Arith and (Haskell) Arith
-
-
-subsection \<open>Lemmas of doubtful value\<close>
+instance int :: unique_euclidean_semiring_numeral
+ by standard (auto intro: zmod_le_nonneg_dividend simp add:
+ pos_imp_zdiv_pos_iff zmod_zmult2_eq zdiv_zmult2_eq)
lemma div_geq: "m div n = Suc ((m - n) div n)" if "0 < n" and " \<not> m < n" for m n :: nat
by (rule le_div_geq) (use that in \<open>simp_all add: not_less\<close>)
@@ -1241,4 +657,8 @@
lemma zmod_eq_0D [dest!]: "\<exists>q. m = d * q" if "m mod d = 0" for m d :: int
using that by auto
+lemma div_positive_int:
+ "k div l > 0" if "k \<ge> l" and "l > 0" for k l :: int
+ using that by (simp add: nonneg1_imp_zdiv_pos_iff)
+
end
--- a/src/HOL/Equiv_Relations.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Equiv_Relations.thy Fri Sep 02 13:41:55 2022 +0200
@@ -264,11 +264,10 @@
assume cd: "(c,d) \<in> r1"
then have "c \<in> A1" "d \<in> A1"
using \<open>equiv A1 r1\<close> by (auto elim!: equiv_type [THEN subsetD, THEN SigmaE2])
- with assms show "\<Union> (f c ` r2 `` {a}) = \<Union> (f d ` r2 `` {a})"
- proof (simp add: UN_equiv_class congruent2_implies_congruent)
- show "f c a = f d a"
- using assms cd unfolding congruent2_def equiv_def refl_on_def by blast
- qed
+ moreover have "f c a = f d a"
+ using assms cd unfolding congruent2_def equiv_def refl_on_def by blast
+ ultimately show "\<Union> (f c ` r2 `` {a}) = \<Union> (f d ` r2 `` {a})"
+ using assms by (simp add: UN_equiv_class congruent2_implies_congruent)
qed
lemma UN_equiv_class2:
@@ -368,7 +367,7 @@
assume ?lhs
then show ?rhs
unfolding proj_def quotient_def
- proof clarsimp
+ proof safe
fix y
assume y: "y \<in> A" and "r `` {x} = r `` {y}"
moreover have "y \<in> r `` {y}"
--- a/src/HOL/Euclidean_Division.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Euclidean_Division.thy Fri Sep 02 13:41:55 2022 +0200
@@ -99,7 +99,8 @@
with size_mult_mono'[OF assms(1), of b]
have eq: "euclidean_size (a * b) = euclidean_size b" by simp
have "a * b dvd b"
- by (rule dvd_euclidean_size_eq_imp_dvd [OF _ eq]) (insert assms, simp_all)
+ by (rule dvd_euclidean_size_eq_imp_dvd [OF _ eq])
+ (use assms in simp_all)
hence "a * b dvd 1 * b" by simp
with \<open>b \<noteq> 0\<close> have "is_unit a" by (subst (asm) dvd_times_right_cancel_iff)
with assms(3) show False by contradiction
@@ -108,7 +109,7 @@
lemma dvd_imp_size_le:
assumes "a dvd b" "b \<noteq> 0"
shows "euclidean_size a \<le> euclidean_size b"
- using assms by (auto elim!: dvdE simp: size_mult_mono)
+ using assms by (auto simp: size_mult_mono)
lemma dvd_proper_imp_size_less:
assumes "a dvd b" "\<not> b dvd a" "b \<noteq> 0"
@@ -139,7 +140,7 @@
lemma coprime_mod_left_iff [simp]:
"coprime (a mod b) b \<longleftrightarrow> coprime a b" if "b \<noteq> 0"
- by (rule; rule coprimeI)
+ by (rule iffI; rule coprimeI)
(use that in \<open>auto dest!: dvd_mod_imp_dvd coprime_common_divisor simp add: dvd_mod_iff\<close>)
lemma coprime_mod_right_iff [simp]:
@@ -320,7 +321,7 @@
lemma div_plus_div_distrib_dvd_left:
"c dvd a \<Longrightarrow> (a + b) div c = a div c + b div c"
- by (cases "c = 0") (auto elim: dvdE)
+ by (cases "c = 0") auto
lemma div_plus_div_distrib_dvd_right:
"c dvd b \<Longrightarrow> (a + b) div c = a div c + b div c"
@@ -602,7 +603,7 @@
subsection \<open>Uniquely determined division\<close>
-
+
class unique_euclidean_semiring = euclidean_semiring +
assumes euclidean_size_mult: "euclidean_size (a * b) = euclidean_size a * euclidean_size b"
fixes division_segment :: "'a \<Rightarrow> 'a"
@@ -936,6 +937,14 @@
end
+lemma div_nat_eqI:
+ "m div n = q" if "n * q \<le> m" and "m < n * Suc q" for m n q :: nat
+ by (rule div_eqI [of _ "m - n * q"]) (use that in \<open>simp_all add: algebra_simps\<close>)
+
+lemma mod_nat_eqI:
+ "m mod n = r" if "r < n" and "r \<le> m" and "n dvd m - r" for m n r :: nat
+ by (rule mod_eqI [of _ _ "(m - r) div n"]) (use that in \<open>simp_all add: algebra_simps\<close>)
+
text \<open>Tool support\<close>
ML \<open>
@@ -966,14 +975,6 @@
simproc_setup cancel_div_mod_nat ("(m::nat) + n") =
\<open>K Cancel_Div_Mod_Nat.proc\<close>
-lemma div_nat_eqI:
- "m div n = q" if "n * q \<le> m" and "m < n * Suc q" for m n q :: nat
- by (rule div_eqI [of _ "m - n * q"]) (use that in \<open>simp_all add: algebra_simps\<close>)
-
-lemma mod_nat_eqI:
- "m mod n = r" if "r < n" and "r \<le> m" and "n dvd m - r" for m n r :: nat
- by (rule mod_eqI [of _ _ "(m - r) div n"]) (use that in \<open>simp_all add: algebra_simps\<close>)
-
lemma div_mult_self_is_m [simp]:
"m * n div n = m" if "n > 0" for m n :: nat
using that by simp
@@ -1029,6 +1030,41 @@
and mod_less [simp]: "m mod n = m"
if "m < n" for m n :: nat
using that by (auto intro: div_eqI mod_eqI)
+
+lemma split_div:
+ \<open>P (m div n) \<longleftrightarrow>
+ (n = 0 \<longrightarrow> P 0) \<and>
+ (n \<noteq> 0 \<longrightarrow> (\<forall>i j. j < n \<and> m = n * i + j \<longrightarrow> P i))\<close> (is ?div)
+ and split_mod:
+ \<open>Q (m mod n) \<longleftrightarrow>
+ (n = 0 \<longrightarrow> Q m) \<and>
+ (n \<noteq> 0 \<longrightarrow> (\<forall>i j. j < n \<and> m = n * i + j \<longrightarrow> Q j))\<close> (is ?mod)
+ for m n :: nat
+proof -
+ have *: \<open>R (m div n) (m mod n) \<longleftrightarrow>
+ (n = 0 \<longrightarrow> R 0 m) \<and>
+ (n \<noteq> 0 \<longrightarrow> (\<forall>i j. j < n \<and> m = n * i + j \<longrightarrow> R i j))\<close> for R
+ by (cases \<open>n = 0\<close>) auto
+ from * [of \<open>\<lambda>q _. P q\<close>] show ?div .
+ from * [of \<open>\<lambda>_ r. Q r\<close>] show ?mod .
+qed
+
+declare split_div [of _ _ \<open>numeral n\<close>, linarith_split] for n
+declare split_mod [of _ _ \<open>numeral n\<close>, linarith_split] for n
+
+lemma split_div':
+ "P (m div n) \<longleftrightarrow> n = 0 \<and> P 0 \<or> (\<exists>q. (n * q \<le> m \<and> m < n * Suc q) \<and> P q)"
+proof (cases "n = 0")
+ case True
+ then show ?thesis
+ by simp
+next
+ case False
+ then have "n * q \<le> m \<and> m < n * Suc q \<longleftrightarrow> m div n = q" for q
+ by (auto intro: div_nat_eqI dividend_less_times_div)
+ then show ?thesis
+ by auto
+qed
lemma le_div_geq:
"m div n = Suc ((m - n) div n)" if "0 < n" and "n \<le> m" for m n :: nat
@@ -1417,68 +1453,6 @@
by simp
qed
-lemma split_div:
- "P (m div n) \<longleftrightarrow> (n = 0 \<longrightarrow> P 0) \<and> (n \<noteq> 0 \<longrightarrow>
- (\<forall>i j. j < n \<longrightarrow> m = n * i + j \<longrightarrow> P i))"
- (is "?P = ?Q") for m n :: nat
-proof (cases "n = 0")
- case True
- then show ?thesis
- by simp
-next
- case False
- show ?thesis
- proof
- assume ?P
- with False show ?Q
- by auto
- next
- assume ?Q
- with False have *: "\<And>i j. j < n \<Longrightarrow> m = n * i + j \<Longrightarrow> P i"
- by simp
- with False show ?P
- by (auto intro: * [of "m mod n"])
- qed
-qed
-
-lemma split_div':
- "P (m div n) \<longleftrightarrow> n = 0 \<and> P 0 \<or> (\<exists>q. (n * q \<le> m \<and> m < n * Suc q) \<and> P q)"
-proof (cases "n = 0")
- case True
- then show ?thesis
- by simp
-next
- case False
- then have "n * q \<le> m \<and> m < n * Suc q \<longleftrightarrow> m div n = q" for q
- by (auto intro: div_nat_eqI dividend_less_times_div)
- then show ?thesis
- by auto
-qed
-
-lemma split_mod:
- "P (m mod n) \<longleftrightarrow> (n = 0 \<longrightarrow> P m) \<and> (n \<noteq> 0 \<longrightarrow>
- (\<forall>i j. j < n \<longrightarrow> m = n * i + j \<longrightarrow> P j))"
- (is "?P \<longleftrightarrow> ?Q") for m n :: nat
-proof (cases "n = 0")
- case True
- then show ?thesis
- by simp
-next
- case False
- show ?thesis
- proof
- assume ?P
- with False show ?Q
- by auto
- next
- assume ?Q
- with False have *: "\<And>i j. j < n \<Longrightarrow> m = n * i + j \<Longrightarrow> P j"
- by simp
- with False show ?P
- by (auto intro: * [of _ "m div n"])
- qed
-qed
-
lemma funpow_mod_eq: \<^marker>\<open>contributor \<open>Lars Noschinski\<close>\<close>
\<open>(f ^^ (m mod n)) x = (f ^^ m) x\<close> if \<open>(f ^^ n) x = x\<close>
proof -
@@ -1493,31 +1467,35 @@
qed
-subsection \<open>Euclidean division on \<^typ>\<open>int\<close>\<close>
+subsection \<open>Elementary euclidean division on \<^typ>\<open>int\<close>\<close>
-instantiation int :: normalization_semidom
+subsubsection \<open>Basic instantiation\<close>
+
+instantiation int :: "{normalization_semidom, idom_modulo}"
begin
-definition normalize_int :: "int \<Rightarrow> int"
- where [simp]: "normalize = (abs :: int \<Rightarrow> int)"
-
-definition unit_factor_int :: "int \<Rightarrow> int"
- where [simp]: "unit_factor = (sgn :: int \<Rightarrow> int)"
+definition normalize_int :: \<open>int \<Rightarrow> int\<close>
+ where [simp]: \<open>normalize = (abs :: int \<Rightarrow> int)\<close>
-definition divide_int :: "int \<Rightarrow> int \<Rightarrow> int"
- where "k div l = (if l = 0 then 0
- else if sgn k = sgn l
- then int (nat \<bar>k\<bar> div nat \<bar>l\<bar>)
- else - int (nat \<bar>k\<bar> div nat \<bar>l\<bar> + of_bool (\<not> l dvd k)))"
+definition unit_factor_int :: \<open>int \<Rightarrow> int\<close>
+ where [simp]: \<open>unit_factor = (sgn :: int \<Rightarrow> int)\<close>
+
+definition divide_int :: \<open>int \<Rightarrow> int \<Rightarrow> int\<close>
+ where \<open>k div l = (sgn k * sgn l * int (nat \<bar>k\<bar> div nat \<bar>l\<bar>)
+ - of_bool (l \<noteq> 0 \<and> sgn k \<noteq> sgn l \<and> \<not> l dvd k))\<close>
lemma divide_int_unfold:
- "(sgn k * int m) div (sgn l * int n) =
- (if sgn l = 0 \<or> sgn k = 0 \<or> n = 0 then 0
- else if sgn k = sgn l
- then int (m div n)
- else - int (m div n + of_bool (\<not> n dvd m)))"
- by (auto simp add: divide_int_def sgn_0_0 sgn_1_pos sgn_mult abs_mult
- nat_mult_distrib)
+ \<open>(sgn k * int m) div (sgn l * int n) = (sgn k * sgn l * int (m div n)
+ - of_bool ((k = 0 \<longleftrightarrow> m = 0) \<and> l \<noteq> 0 \<and> n \<noteq> 0 \<and> sgn k \<noteq> sgn l \<and> \<not> n dvd m))\<close>
+ by (simp add: divide_int_def sgn_mult nat_mult_distrib abs_mult sgn_eq_0_iff ac_simps)
+
+definition modulo_int :: \<open>int \<Rightarrow> int \<Rightarrow> int\<close>
+ where \<open>k mod l = sgn k * int (nat \<bar>k\<bar> mod nat \<bar>l\<bar>) + l * of_bool (sgn k \<noteq> sgn l \<and> \<not> l dvd k)\<close>
+
+lemma modulo_int_unfold:
+ \<open>(sgn k * int m) mod (sgn l * int n) =
+ sgn k * int (m mod (of_bool (l \<noteq> 0) * n)) + (sgn l * int n) * of_bool ((k = 0 \<longleftrightarrow> m = 0) \<and> sgn k \<noteq> sgn l \<and> \<not> n dvd m)\<close>
+ by (auto simp add: modulo_int_def sgn_mult abs_mult)
instance proof
fix k :: int show "k div 0 = 0"
@@ -1532,10 +1510,19 @@
with k l \<open>l \<noteq> 0\<close> show "k * l div l = k"
by (simp only: divide_int_unfold)
(auto simp add: algebra_simps sgn_mult sgn_1_pos sgn_0_0)
+next
+ fix k l :: int
+ obtain n m and s t where "k = sgn s * int n" and "l = sgn t * int m"
+ by (blast intro: int_sgnE elim: that)
+ then show "k div l * l + k mod l = k"
+ by (simp add: divide_int_unfold modulo_int_unfold algebra_simps modulo_nat_def of_nat_diff)
qed (auto simp add: sgn_mult mult_sgn_abs abs_eq_iff')
end
+
+subsubsection \<open>Algebraic foundations\<close>
+
lemma coprime_int_iff [simp]:
"coprime (int m) (int n) \<longleftrightarrow> coprime m n" (is "?P \<longleftrightarrow> ?Q")
proof
@@ -1594,36 +1581,66 @@
for a b :: int
by (drule coprime_common_divisor [of _ _ x]) simp_all
-instantiation int :: idom_modulo
-begin
+
+subsubsection \<open>Basic conversions\<close>
+
+lemma div_abs_eq_div_nat:
+ "\<bar>k\<bar> div \<bar>l\<bar> = int (nat \<bar>k\<bar> div nat \<bar>l\<bar>)"
+ by (auto simp add: divide_int_def)
+
+lemma div_eq_div_abs:
+ \<open>k div l = sgn k * sgn l * (\<bar>k\<bar> div \<bar>l\<bar>)
+ - of_bool (l \<noteq> 0 \<and> sgn k \<noteq> sgn l \<and> \<not> l dvd k)\<close>
+ for k l :: int
+ by (simp add: divide_int_def [of k l] div_abs_eq_div_nat)
-definition modulo_int :: "int \<Rightarrow> int \<Rightarrow> int"
- where "k mod l = (if l = 0 then k
- else if sgn k = sgn l
- then sgn l * int (nat \<bar>k\<bar> mod nat \<bar>l\<bar>)
- else sgn l * (\<bar>l\<bar> * of_bool (\<not> l dvd k) - int (nat \<bar>k\<bar> mod nat \<bar>l\<bar>)))"
+lemma div_abs_eq:
+ \<open>\<bar>k\<bar> div \<bar>l\<bar> = sgn k * sgn l * (k div l + of_bool (sgn k \<noteq> sgn l \<and> \<not> l dvd k))\<close>
+ for k l :: int
+ by (simp add: div_eq_div_abs [of k l] ac_simps)
+
+lemma mod_abs_eq_div_nat:
+ "\<bar>k\<bar> mod \<bar>l\<bar> = int (nat \<bar>k\<bar> mod nat \<bar>l\<bar>)"
+ by (simp add: modulo_int_def)
+
+lemma mod_eq_mod_abs:
+ \<open>k mod l = sgn k * (\<bar>k\<bar> mod \<bar>l\<bar>) + l * of_bool (sgn k \<noteq> sgn l \<and> \<not> l dvd k)\<close>
+ for k l :: int
+ by (simp add: modulo_int_def [of k l] mod_abs_eq_div_nat)
-lemma modulo_int_unfold:
- "(sgn k * int m) mod (sgn l * int n) =
- (if sgn l = 0 \<or> sgn k = 0 \<or> n = 0 then sgn k * int m
- else if sgn k = sgn l
- then sgn l * int (m mod n)
- else sgn l * (int (n * of_bool (\<not> n dvd m)) - int (m mod n)))"
- by (auto simp add: modulo_int_def sgn_0_0 sgn_1_pos sgn_mult abs_mult
- nat_mult_distrib)
+lemma mod_abs_eq:
+ \<open>\<bar>k\<bar> mod \<bar>l\<bar> = sgn k * (k mod l - l * of_bool (sgn k \<noteq> sgn l \<and> \<not> l dvd k))\<close>
+ for k l :: int
+ by (auto simp: mod_eq_mod_abs [of k l])
+
+lemma div_sgn_abs_cancel:
+ fixes k l v :: int
+ assumes "v \<noteq> 0"
+ shows "(sgn v * \<bar>k\<bar>) div (sgn v * \<bar>l\<bar>) = \<bar>k\<bar> div \<bar>l\<bar>"
+ using assms by (simp add: sgn_mult abs_mult sgn_0_0
+ divide_int_def [of "sgn v * \<bar>k\<bar>" "sgn v * \<bar>l\<bar>"] flip: div_abs_eq_div_nat)
-instance proof
- fix k l :: int
- obtain n m and s t where "k = sgn s * int n" and "l = sgn t * int m"
- by (blast intro: int_sgnE elim: that)
- then show "k div l * l + k mod l = k"
- by (auto simp add: divide_int_unfold modulo_int_unfold algebra_simps dest!: sgn_not_eq_imp)
- (simp_all add: of_nat_mult [symmetric] of_nat_add [symmetric]
- distrib_left [symmetric] minus_mult_right
- del: of_nat_mult minus_mult_right [symmetric])
-qed
+lemma div_eq_sgn_abs:
+ fixes k l v :: int
+ assumes "sgn k = sgn l"
+ shows "k div l = \<bar>k\<bar> div \<bar>l\<bar>"
+ using assms by (auto simp add: div_abs_eq)
-end
+lemma div_dvd_sgn_abs:
+ fixes k l :: int
+ assumes "l dvd k"
+ shows "k div l = (sgn k * sgn l) * (\<bar>k\<bar> div \<bar>l\<bar>)"
+ using assms by (auto simp add: div_abs_eq ac_simps)
+
+lemma div_noneq_sgn_abs:
+ fixes k l :: int
+ assumes "l \<noteq> 0"
+ assumes "sgn k \<noteq> sgn l"
+ shows "k div l = - (\<bar>k\<bar> div \<bar>l\<bar>) - of_bool (\<not> l dvd k)"
+ using assms by (auto simp add: div_abs_eq ac_simps sgn_0_0 dest!: sgn_not_eq_imp)
+
+
+subsubsection \<open>Euclidean division\<close>
instantiation int :: unique_euclidean_ring
begin
@@ -1648,8 +1665,9 @@
obtain n m and s t where "k = sgn s * int n" and "l = sgn t * int m"
by (blast intro: int_sgnE elim: that)
with that show ?thesis
- by (simp add: modulo_int_unfold sgn_0_0 sgn_1_pos sgn_1_neg
- abs_mult mod_greater_zero_iff_not_dvd)
+ by (auto simp add: modulo_int_unfold abs_mult mod_greater_zero_iff_not_dvd
+ simp flip: right_diff_distrib dest!: sgn_not_eq_imp)
+ (simp add: sgn_0_0)
qed
lemma sgn_mod:
@@ -1658,8 +1676,8 @@
obtain n m and s t where "k = sgn s * int n" and "l = sgn t * int m"
by (blast intro: int_sgnE elim: that)
with that show ?thesis
- by (simp add: modulo_int_unfold sgn_0_0 sgn_1_pos sgn_1_neg sgn_mult)
- (simp add: dvd_eq_mod_eq_0)
+ by (auto simp add: modulo_int_unfold sgn_mult mod_greater_zero_iff_not_dvd
+ simp flip: right_diff_distrib dest!: sgn_not_eq_imp)
qed
instance proof
@@ -1699,8 +1717,8 @@
from \<open>r = 0\<close> have *: "q * l + r = sgn (t * s) * int (n * m)"
using q l by (simp add: ac_simps sgn_mult)
from \<open>s \<noteq> 0\<close> \<open>n > 0\<close> show ?thesis
- by (simp only: *, simp only: q l divide_int_unfold)
- (auto simp add: sgn_mult sgn_0_0 sgn_1_pos)
+ by (simp only: *, simp only: * q l divide_int_unfold)
+ (auto simp add: sgn_mult ac_simps)
qed
next
case False
@@ -1727,123 +1745,6 @@
end
-lemma pos_mod_bound [simp]:
- "k mod l < l" if "l > 0" for k l :: int
-proof -
- obtain m and s where "k = sgn s * int m"
- by (rule int_sgnE)
- moreover from that obtain n where "l = sgn 1 * int n"
- by (cases l) simp_all
- moreover from this that have "n > 0"
- by simp
- ultimately show ?thesis
- by (simp only: modulo_int_unfold)
- (simp add: mod_greater_zero_iff_not_dvd)
-qed
-
-lemma neg_mod_bound [simp]:
- "l < k mod l" if "l < 0" for k l :: int
-proof -
- obtain m and s where "k = sgn s * int m"
- by (rule int_sgnE)
- moreover from that obtain q where "l = sgn (- 1) * int (Suc q)"
- by (cases l) simp_all
- moreover define n where "n = Suc q"
- then have "Suc q = n"
- by simp
- ultimately show ?thesis
- by (simp only: modulo_int_unfold)
- (simp add: mod_greater_zero_iff_not_dvd)
-qed
-
-lemma pos_mod_sign [simp]:
- "0 \<le> k mod l" if "l > 0" for k l :: int
-proof -
- obtain m and s where "k = sgn s * int m"
- by (rule int_sgnE)
- moreover from that obtain n where "l = sgn 1 * int n"
- by (cases l) auto
- moreover from this that have "n > 0"
- by simp
- ultimately show ?thesis
- by (simp only: modulo_int_unfold) simp
-qed
-
-lemma neg_mod_sign [simp]:
- "k mod l \<le> 0" if "l < 0" for k l :: int
-proof -
- obtain m and s where "k = sgn s * int m"
- by (rule int_sgnE)
- moreover from that obtain q where "l = sgn (- 1) * int (Suc q)"
- by (cases l) simp_all
- moreover define n where "n = Suc q"
- then have "Suc q = n"
- by simp
- ultimately show ?thesis
- by (simp only: modulo_int_unfold) simp
-qed
-
-lemma div_pos_pos_trivial [simp]:
- "k div l = 0" if "k \<ge> 0" and "k < l" for k l :: int
- using that by (simp add: unique_euclidean_semiring_class.div_eq_0_iff division_segment_int_def)
-
-lemma mod_pos_pos_trivial [simp]:
- "k mod l = k" if "k \<ge> 0" and "k < l" for k l :: int
- using that by (simp add: mod_eq_self_iff_div_eq_0)
-
-lemma div_neg_neg_trivial [simp]:
- "k div l = 0" if "k \<le> 0" and "l < k" for k l :: int
- using that by (cases "k = 0") (simp, simp add: unique_euclidean_semiring_class.div_eq_0_iff division_segment_int_def)
-
-lemma mod_neg_neg_trivial [simp]:
- "k mod l = k" if "k \<le> 0" and "l < k" for k l :: int
- using that by (simp add: mod_eq_self_iff_div_eq_0)
-
-lemma div_pos_neg_trivial:
- "k div l = - 1" if "0 < k" and "k + l \<le> 0" for k l :: int
-proof (cases \<open>l = - k\<close>)
- case True
- with that show ?thesis
- by (simp add: divide_int_def)
-next
- case False
- show ?thesis
- apply (rule div_eqI [of _ "k + l"])
- using False that apply (simp_all add: division_segment_int_def)
- done
-qed
-
-lemma mod_pos_neg_trivial:
- "k mod l = k + l" if "0 < k" and "k + l \<le> 0" for k l :: int
-proof (cases \<open>l = - k\<close>)
- case True
- with that show ?thesis
- by (simp add: divide_int_def)
-next
- case False
- show ?thesis
- apply (rule mod_eqI [of _ _ \<open>- 1\<close>])
- using False that apply (simp_all add: division_segment_int_def)
- done
-qed
-
-text \<open>There is neither \<open>div_neg_pos_trivial\<close> nor \<open>mod_neg_pos_trivial\<close>
- because \<^term>\<open>0 div l = 0\<close> would supersede it.\<close>
-
-text \<open>Distributive laws for function \<open>nat\<close>.\<close>
-
-lemma nat_div_distrib:
- \<open>nat (x div y) = nat x div nat y\<close> if \<open>0 \<le> x\<close>
- using that by (simp add: divide_int_def sgn_if)
-
-lemma nat_div_distrib':
- \<open>nat (x div y) = nat x div nat y\<close> if \<open>0 \<le> y\<close>
- using that by (simp add: divide_int_def sgn_if)
-
-lemma nat_mod_distrib: \<comment> \<open>Fails if y<0: the LHS collapses to (nat z) but the RHS doesn't\<close>
- \<open>nat (x mod y) = nat x mod nat y\<close> if \<open>0 \<le> x\<close> \<open>0 \<le> y\<close>
- using that by (simp add: modulo_int_def sgn_if)
-
subsection \<open>Special case: euclidean rings containing the natural numbers\<close>
@@ -2074,7 +1975,7 @@
proof (cases \<open>n \<le> m\<close>)
case True
then show ?thesis
- by (simp add: Suc_le_lessD min.absorb2)
+ by (simp add: Suc_le_lessD)
next
case False
then have \<open>m < n\<close>
@@ -2108,7 +2009,218 @@
by standard (simp_all add: dvd_eq_mod_eq_0)
instance int :: unique_euclidean_ring_with_nat
- by standard (simp_all add: dvd_eq_mod_eq_0 divide_int_def division_segment_int_def)
+ by standard (auto simp add: divide_int_def division_segment_int_def elim: contrapos_np)
+
+
+subsection \<open>More on euclidean division on \<^typ>\<open>int\<close>\<close>
+
+subsubsection \<open>Trivial reduction steps\<close>
+
+lemma div_pos_pos_trivial [simp]:
+ "k div l = 0" if "k \<ge> 0" and "k < l" for k l :: int
+ using that by (simp add: unique_euclidean_semiring_class.div_eq_0_iff division_segment_int_def)
+
+lemma mod_pos_pos_trivial [simp]:
+ "k mod l = k" if "k \<ge> 0" and "k < l" for k l :: int
+ using that by (simp add: mod_eq_self_iff_div_eq_0)
+
+lemma div_neg_neg_trivial [simp]:
+ "k div l = 0" if "k \<le> 0" and "l < k" for k l :: int
+ using that by (cases "k = 0") (simp, simp add: unique_euclidean_semiring_class.div_eq_0_iff division_segment_int_def)
+
+lemma mod_neg_neg_trivial [simp]:
+ "k mod l = k" if "k \<le> 0" and "l < k" for k l :: int
+ using that by (simp add: mod_eq_self_iff_div_eq_0)
+
+lemma div_pos_neg_trivial:
+ "k div l = - 1" if "0 < k" and "k + l \<le> 0" for k l :: int
+proof (cases \<open>l = - k\<close>)
+ case True
+ with that show ?thesis
+ by (simp add: divide_int_def)
+next
+ case False
+ show ?thesis
+ apply (rule div_eqI [of _ "k + l"])
+ using False that apply (simp_all add: division_segment_int_def)
+ done
+qed
+
+lemma mod_pos_neg_trivial:
+ "k mod l = k + l" if "0 < k" and "k + l \<le> 0" for k l :: int
+proof (cases \<open>l = - k\<close>)
+ case True
+ with that show ?thesis
+ by (simp add: divide_int_def)
+next
+ case False
+ show ?thesis
+ apply (rule mod_eqI [of _ _ \<open>- 1\<close>])
+ using False that apply (simp_all add: division_segment_int_def)
+ done
+qed
+
+text \<open>There is neither \<open>div_neg_pos_trivial\<close> nor \<open>mod_neg_pos_trivial\<close>
+ because \<^term>\<open>0 div l = 0\<close> would supersede it.\<close>
+
+
+subsubsection \<open>Laws for unary minus\<close>
+
+lemma zmod_zminus1_not_zero:
+ fixes k l :: int
+ shows "- k mod l \<noteq> 0 \<Longrightarrow> k mod l \<noteq> 0"
+ by (simp add: mod_eq_0_iff_dvd)
+
+lemma zmod_zminus2_not_zero:
+ fixes k l :: int
+ shows "k mod - l \<noteq> 0 \<Longrightarrow> k mod l \<noteq> 0"
+ by (simp add: mod_eq_0_iff_dvd)
+
+lemma zdiv_zminus1_eq_if:
+ \<open>(- a) div b = (if a mod b = 0 then - (a div b) else - (a div b) - 1)\<close>
+ if \<open>b \<noteq> 0\<close> for a b :: int
+ using that sgn_not_eq_imp [of b \<open>- a\<close>]
+ by (cases \<open>a = 0\<close>) (auto simp add: div_eq_div_abs [of \<open>- a\<close> b] div_eq_div_abs [of a b] sgn_eq_0_iff)
+
+lemma zdiv_zminus2_eq_if:
+ \<open>a div (- b) = (if a mod b = 0 then - (a div b) else - (a div b) - 1)\<close>
+ if \<open>b \<noteq> 0\<close> for a b :: int
+ using that by (auto simp add: zdiv_zminus1_eq_if div_minus_right)
+
+lemma zmod_zminus1_eq_if:
+ \<open>(- a) mod b = (if a mod b = 0 then 0 else b - (a mod b))\<close>
+ for a b :: int
+ by (cases \<open>b = 0\<close>)
+ (auto simp flip: minus_div_mult_eq_mod simp add: zdiv_zminus1_eq_if algebra_simps)
+
+lemma zmod_zminus2_eq_if:
+ \<open>a mod (- b) = (if a mod b = 0 then 0 else (a mod b) - b)\<close>
+ for a b :: int
+ by (auto simp add: zmod_zminus1_eq_if mod_minus_right)
+
+
+subsubsection \<open>Borders\<close>
+
+lemma pos_mod_bound [simp]:
+ "k mod l < l" if "l > 0" for k l :: int
+proof -
+ obtain m and s where "k = sgn s * int m"
+ by (rule int_sgnE)
+ moreover from that obtain n where "l = sgn 1 * int n"
+ by (cases l) simp_all
+ moreover from this that have "n > 0"
+ by simp
+ ultimately show ?thesis
+ by (simp only: modulo_int_unfold)
+ (auto simp add: mod_greater_zero_iff_not_dvd sgn_1_pos)
+qed
+
+lemma neg_mod_bound [simp]:
+ "l < k mod l" if "l < 0" for k l :: int
+proof -
+ obtain m and s where "k = sgn s * int m"
+ by (rule int_sgnE)
+ moreover from that obtain q where "l = sgn (- 1) * int (Suc q)"
+ by (cases l) simp_all
+ moreover define n where "n = Suc q"
+ then have "Suc q = n"
+ by simp
+ ultimately show ?thesis
+ by (simp only: modulo_int_unfold)
+ (auto simp add: mod_greater_zero_iff_not_dvd sgn_1_neg)
+qed
+
+lemma pos_mod_sign [simp]:
+ "0 \<le> k mod l" if "l > 0" for k l :: int
+proof -
+ obtain m and s where "k = sgn s * int m"
+ by (rule int_sgnE)
+ moreover from that obtain n where "l = sgn 1 * int n"
+ by (cases l) auto
+ moreover from this that have "n > 0"
+ by simp
+ ultimately show ?thesis
+ by (simp only: modulo_int_unfold) (auto simp add: sgn_1_pos)
+qed
+
+lemma neg_mod_sign [simp]:
+ "k mod l \<le> 0" if "l < 0" for k l :: int
+proof -
+ obtain m and s where "k = sgn s * int m"
+ by (rule int_sgnE)
+ moreover from that obtain q where "l = sgn (- 1) * int (Suc q)"
+ by (cases l) simp_all
+ moreover define n where "n = Suc q"
+ then have "Suc q = n"
+ by simp
+ moreover have \<open>int (m mod n) \<le> int n\<close>
+ using \<open>Suc q = n\<close> by simp
+ then have \<open>sgn s * int (m mod n) \<le> int n\<close>
+ by (cases s \<open>0::int\<close> rule: linorder_cases) simp_all
+ ultimately show ?thesis
+ by (simp only: modulo_int_unfold) auto
+qed
+
+
+subsubsection \<open>Splitting Rules for div and mod\<close>
+
+lemma split_zdiv:
+ \<open>P (n div k) \<longleftrightarrow>
+ (k = 0 \<longrightarrow> P 0) \<and>
+ (0 < k \<longrightarrow> (\<forall>i j. 0 \<le> j \<and> j < k \<and> n = k * i + j \<longrightarrow> P i)) \<and>
+ (k < 0 \<longrightarrow> (\<forall>i j. k < j \<and> j \<le> 0 \<and> n = k * i + j \<longrightarrow> P i))\<close> (is ?div)
+ and split_zmod:
+ \<open>Q (n mod k) \<longleftrightarrow>
+ (k = 0 \<longrightarrow> Q n) \<and>
+ (0 < k \<longrightarrow> (\<forall>i j. 0 \<le> j \<and> j < k \<and> n = k * i + j \<longrightarrow> Q j)) \<and>
+ (k < 0 \<longrightarrow> (\<forall>i j. k < j \<and> j \<le> 0 \<and> n = k * i + j \<longrightarrow> Q j))\<close> (is ?mod)
+ for n k :: int
+proof -
+ have *: \<open>R (n div k) (n mod k) \<longleftrightarrow>
+ (k = 0 \<longrightarrow> R 0 n) \<and>
+ (0 < k \<longrightarrow> (\<forall>i j. 0 \<le> j \<and> j < k \<and> n = k * i + j \<longrightarrow> R i j)) \<and>
+ (k < 0 \<longrightarrow> (\<forall>i j. k < j \<and> j \<le> 0 \<and> n = k * i + j \<longrightarrow> R i j))\<close> for R
+ by (cases \<open>k = 0\<close>)
+ (auto simp add: linorder_class.neq_iff)
+ from * [of \<open>\<lambda>q _. P q\<close>] show ?div .
+ from * [of \<open>\<lambda>_ r. Q r\<close>] show ?mod .
+qed
+
+text \<open>Enable (lin)arith to deal with \<^const>\<open>divide\<close> and \<^const>\<open>modulo\<close>
+ when these are applied to some constant that is of the form
+ \<^term>\<open>numeral k\<close>:\<close>
+declare split_zdiv [of _ _ \<open>numeral n\<close>, linarith_split] for n
+declare split_zdiv [of _ _ \<open>- numeral n\<close>, linarith_split] for n
+declare split_zmod [of _ _ \<open>numeral n\<close>, linarith_split] for n
+declare split_zmod [of _ _ \<open>- numeral n\<close>, linarith_split] for n
+
+lemma zdiv_eq_0_iff:
+ "i div k = 0 \<longleftrightarrow> k = 0 \<or> 0 \<le> i \<and> i < k \<or> i \<le> 0 \<and> k < i" (is "?L = ?R")
+ for i k :: int
+proof
+ assume ?L
+ moreover have "?L \<longrightarrow> ?R"
+ by (rule split_zdiv [THEN iffD2]) simp
+ ultimately show ?R
+ by blast
+next
+ assume ?R then show ?L
+ by auto
+qed
+
+lemma zmod_trivial_iff:
+ fixes i k :: int
+ shows "i mod k = i \<longleftrightarrow> k = 0 \<or> 0 \<le> i \<and> i < k \<or> i \<le> 0 \<and> k < i"
+proof -
+ have "i mod k = i \<longleftrightarrow> i div k = 0"
+ using div_mult_mod_eq [of i k] by safe auto
+ with zdiv_eq_0_iff
+ show ?thesis
+ by simp
+qed
+
+
+subsubsection \<open>Algebraic rewrites\<close>
lemma zdiv_zmult2_eq:
\<open>a div (b * c) = (a div b) div c\<close> if \<open>c \<ge> 0\<close> for a b c :: int
@@ -2122,6 +2234,18 @@
using div_mult2_eq' [of \<open>- a\<close> \<open>nat (- b)\<close> \<open>nat c\<close>] by simp
qed
+lemma zdiv_zmult2_eq':
+ \<open>k div (l * j) = ((sgn j * k) div l) div \<bar>j\<bar>\<close> for k l j :: int
+proof -
+ have \<open>k div (l * j) = (sgn j * k) div (sgn j * (l * j))\<close>
+ by (simp add: sgn_0_0)
+ also have \<open>sgn j * (l * j) = l * \<bar>j\<bar>\<close>
+ by (simp add: mult.left_commute [of _ l] abs_sgn) (simp add: ac_simps)
+ also have \<open>(sgn j * k) div (l * \<bar>j\<bar>) = ((sgn j * k) div l) div \<bar>j\<bar>\<close>
+ by (simp add: zdiv_zmult2_eq)
+ finally show ?thesis .
+qed
+
lemma zmod_zmult2_eq:
\<open>a mod (b * c) = b * (a div b mod c) + a mod b\<close> if \<open>c \<ge> 0\<close> for a b c :: int
proof (cases \<open>b \<ge> 0\<close>)
@@ -2134,8 +2258,434 @@
using mod_mult2_eq' [of \<open>- a\<close> \<open>nat (- b)\<close> \<open>nat c\<close>] by simp
qed
+lemma half_nonnegative_int_iff [simp]:
+ \<open>k div 2 \<ge> 0 \<longleftrightarrow> k \<ge> 0\<close> for k :: int
+ by auto
-subsection \<open>Code generation\<close>
+lemma half_negative_int_iff [simp]:
+ \<open>k div 2 < 0 \<longleftrightarrow> k < 0\<close> for k :: int
+ by auto
+
+
+subsubsection \<open>Distributive laws for conversions.\<close>
+
+lemma zdiv_int:
+ "int (a div b) = int a div int b"
+ by (fact of_nat_div)
+
+lemma zmod_int:
+ "int (a mod b) = int a mod int b"
+ by (fact of_nat_mod)
+
+lemma nat_div_distrib:
+ \<open>nat (x div y) = nat x div nat y\<close> if \<open>0 \<le> x\<close>
+ using that by (simp add: divide_int_def sgn_if)
+
+lemma nat_div_distrib':
+ \<open>nat (x div y) = nat x div nat y\<close> if \<open>0 \<le> y\<close>
+ using that by (simp add: divide_int_def sgn_if)
+
+lemma nat_mod_distrib: \<comment> \<open>Fails if y<0: the LHS collapses to (nat z) but the RHS doesn't\<close>
+ \<open>nat (x mod y) = nat x mod nat y\<close> if \<open>0 \<le> x\<close> \<open>0 \<le> y\<close>
+ using that by (simp add: modulo_int_def sgn_if)
+
+
+subsection \<open>Generic symbolic computations\<close>
+
+text \<open>
+ The following type class contains everything necessary to formulate
+ a division algorithm in ring structures with numerals, restricted
+ to its positive segments.
+\<close>
+
+class unique_euclidean_semiring_with_nat_division = unique_euclidean_semiring_with_nat +
+ fixes divmod :: \<open>num \<Rightarrow> num \<Rightarrow> 'a \<times> 'a\<close>
+ and divmod_step :: \<open>'a \<Rightarrow> 'a \<times> 'a \<Rightarrow> 'a \<times> 'a\<close> \<comment> \<open>
+ These are conceptually definitions but force generated code
+ to be monomorphic wrt. particular instances of this class which
+ yields a significant speedup.\<close>
+ assumes divmod_def: \<open>divmod m n = (numeral m div numeral n, numeral m mod numeral n)\<close>
+ and divmod_step_def [simp]: \<open>divmod_step l (q, r) =
+ (if euclidean_size l \<le> euclidean_size r then (2 * q + 1, r - l)
+ else (2 * q, r))\<close> \<comment> \<open>
+ This is a formulation of one step (referring to one digit position)
+ in school-method division: compare the dividend at the current
+ digit position with the remainder from previous division steps
+ and evaluate accordingly.\<close>
+begin
+
+lemma fst_divmod:
+ \<open>fst (divmod m n) = numeral m div numeral n\<close>
+ by (simp add: divmod_def)
+
+lemma snd_divmod:
+ \<open>snd (divmod m n) = numeral m mod numeral n\<close>
+ by (simp add: divmod_def)
+
+text \<open>
+ Following a formulation of school-method division.
+ If the divisor is smaller than the dividend, terminate.
+ If not, shift the dividend to the right until termination
+ occurs and then reiterate single division steps in the
+ opposite direction.
+\<close>
+
+lemma divmod_divmod_step:
+ \<open>divmod m n = (if m < n then (0, numeral m)
+ else divmod_step (numeral n) (divmod m (Num.Bit0 n)))\<close>
+proof (cases \<open>m < n\<close>)
+ case True
+ then show ?thesis
+ by (simp add: prod_eq_iff fst_divmod snd_divmod flip: of_nat_numeral of_nat_div of_nat_mod)
+next
+ case False
+ define r s t where \<open>r = (numeral m :: nat)\<close> \<open>s = (numeral n :: nat)\<close> \<open>t = 2 * s\<close>
+ then have *: \<open>numeral m = of_nat r\<close> \<open>numeral n = of_nat s\<close> \<open>numeral (num.Bit0 n) = of_nat t\<close>
+ and \<open>\<not> s \<le> r mod s\<close>
+ by (simp_all add: not_le)
+ have t: \<open>2 * (r div t) = r div s - r div s mod 2\<close>
+ \<open>r mod t = s * (r div s mod 2) + r mod s\<close>
+ by (simp add: Rings.minus_mod_eq_mult_div Groups.mult.commute [of 2] Euclidean_Division.div_mult2_eq \<open>t = 2 * s\<close>)
+ (use mod_mult2_eq [of r s 2] in \<open>simp add: ac_simps \<open>t = 2 * s\<close>\<close>)
+ have rs: \<open>r div s mod 2 = 0 \<or> r div s mod 2 = Suc 0\<close>
+ by auto
+ from \<open>\<not> s \<le> r mod s\<close> have \<open>s \<le> r mod t \<Longrightarrow>
+ r div s = Suc (2 * (r div t)) \<and>
+ r mod s = r mod t - s\<close>
+ using rs
+ by (auto simp add: t)
+ moreover have \<open>r mod t < s \<Longrightarrow>
+ r div s = 2 * (r div t) \<and>
+ r mod s = r mod t\<close>
+ using rs
+ by (auto simp add: t)
+ ultimately show ?thesis
+ by (simp add: divmod_def prod_eq_iff split_def Let_def
+ not_less mod_eq_0_iff_dvd Rings.mod_eq_0_iff_dvd False not_le *)
+ (simp add: flip: of_nat_numeral of_nat_mult add.commute [of 1] of_nat_div of_nat_mod of_nat_Suc of_nat_diff)
+qed
+
+text \<open>The division rewrite proper -- first, trivial results involving \<open>1\<close>\<close>
+
+lemma divmod_trivial [simp]:
+ "divmod m Num.One = (numeral m, 0)"
+ "divmod num.One (num.Bit0 n) = (0, Numeral1)"
+ "divmod num.One (num.Bit1 n) = (0, Numeral1)"
+ using divmod_divmod_step [of "Num.One"] by (simp_all add: divmod_def)
+
+text \<open>Division by an even number is a right-shift\<close>
+
+lemma divmod_cancel [simp]:
+ \<open>divmod (Num.Bit0 m) (Num.Bit0 n) = (case divmod m n of (q, r) \<Rightarrow> (q, 2 * r))\<close> (is ?P)
+ \<open>divmod (Num.Bit1 m) (Num.Bit0 n) = (case divmod m n of (q, r) \<Rightarrow> (q, 2 * r + 1))\<close> (is ?Q)
+proof -
+ define r s where \<open>r = (numeral m :: nat)\<close> \<open>s = (numeral n :: nat)\<close>
+ then have *: \<open>numeral m = of_nat r\<close> \<open>numeral n = of_nat s\<close>
+ \<open>numeral (num.Bit0 m) = of_nat (2 * r)\<close> \<open>numeral (num.Bit0 n) = of_nat (2 * s)\<close>
+ \<open>numeral (num.Bit1 m) = of_nat (Suc (2 * r))\<close>
+ by simp_all
+ have **: \<open>Suc (2 * r) div 2 = r\<close>
+ by simp
+ show ?P and ?Q
+ by (simp_all add: divmod_def *)
+ (simp_all flip: of_nat_numeral of_nat_div of_nat_mod of_nat_mult add.commute [of 1] of_nat_Suc
+ add: Euclidean_Division.mod_mult_mult1 div_mult2_eq [of _ 2] mod_mult2_eq [of _ 2] **)
+qed
+
+text \<open>The really hard work\<close>
+
+lemma divmod_steps [simp]:
+ "divmod (num.Bit0 m) (num.Bit1 n) =
+ (if m \<le> n then (0, numeral (num.Bit0 m))
+ else divmod_step (numeral (num.Bit1 n))
+ (divmod (num.Bit0 m)
+ (num.Bit0 (num.Bit1 n))))"
+ "divmod (num.Bit1 m) (num.Bit1 n) =
+ (if m < n then (0, numeral (num.Bit1 m))
+ else divmod_step (numeral (num.Bit1 n))
+ (divmod (num.Bit1 m)
+ (num.Bit0 (num.Bit1 n))))"
+ by (simp_all add: divmod_divmod_step)
+
+lemmas divmod_algorithm_code = divmod_trivial divmod_cancel divmod_steps
+
+text \<open>Special case: divisibility\<close>
+
+definition divides_aux :: "'a \<times> 'a \<Rightarrow> bool"
+where
+ "divides_aux qr \<longleftrightarrow> snd qr = 0"
+
+lemma divides_aux_eq [simp]:
+ "divides_aux (q, r) \<longleftrightarrow> r = 0"
+ by (simp add: divides_aux_def)
+
+lemma dvd_numeral_simp [simp]:
+ "numeral m dvd numeral n \<longleftrightarrow> divides_aux (divmod n m)"
+ by (simp add: divmod_def mod_eq_0_iff_dvd)
+
+text \<open>Generic computation of quotient and remainder\<close>
+
+lemma numeral_div_numeral [simp]:
+ "numeral k div numeral l = fst (divmod k l)"
+ by (simp add: fst_divmod)
+
+lemma numeral_mod_numeral [simp]:
+ "numeral k mod numeral l = snd (divmod k l)"
+ by (simp add: snd_divmod)
+
+lemma one_div_numeral [simp]:
+ "1 div numeral n = fst (divmod num.One n)"
+ by (simp add: fst_divmod)
+
+lemma one_mod_numeral [simp]:
+ "1 mod numeral n = snd (divmod num.One n)"
+ by (simp add: snd_divmod)
+
+end
+
+instantiation nat :: unique_euclidean_semiring_with_nat_division
+begin
+
+definition divmod_nat :: "num \<Rightarrow> num \<Rightarrow> nat \<times> nat"
+where
+ divmod'_nat_def: "divmod_nat m n = (numeral m div numeral n, numeral m mod numeral n)"
+
+definition divmod_step_nat :: "nat \<Rightarrow> nat \<times> nat \<Rightarrow> nat \<times> nat"
+where
+ "divmod_step_nat l qr = (let (q, r) = qr
+ in if r \<ge> l then (2 * q + 1, r - l)
+ else (2 * q, r))"
+
+instance
+ by standard (simp_all add: divmod'_nat_def divmod_step_nat_def)
+
+end
+
+declare divmod_algorithm_code [where ?'a = nat, code]
+
+lemma Suc_0_div_numeral [simp]:
+ \<open>Suc 0 div numeral Num.One = 1\<close>
+ \<open>Suc 0 div numeral (Num.Bit0 n) = 0\<close>
+ \<open>Suc 0 div numeral (Num.Bit1 n) = 0\<close>
+ by simp_all
+
+lemma Suc_0_mod_numeral [simp]:
+ \<open>Suc 0 mod numeral Num.One = 0\<close>
+ \<open>Suc 0 mod numeral (Num.Bit0 n) = 1\<close>
+ \<open>Suc 0 mod numeral (Num.Bit1 n) = 1\<close>
+ by simp_all
+
+instantiation int :: unique_euclidean_semiring_with_nat_division
+begin
+
+definition divmod_int :: "num \<Rightarrow> num \<Rightarrow> int \<times> int"
+where
+ "divmod_int m n = (numeral m div numeral n, numeral m mod numeral n)"
+
+definition divmod_step_int :: "int \<Rightarrow> int \<times> int \<Rightarrow> int \<times> int"
+where
+ "divmod_step_int l qr = (let (q, r) = qr
+ in if \<bar>l\<bar> \<le> \<bar>r\<bar> then (2 * q + 1, r - l)
+ else (2 * q, r))"
+
+instance
+ by standard (auto simp add: divmod_int_def divmod_step_int_def)
+
+end
+
+declare divmod_algorithm_code [where ?'a = int, code]
+
+context
+begin
+
+qualified definition adjust_div :: "int \<times> int \<Rightarrow> int"
+where
+ "adjust_div qr = (let (q, r) = qr in q + of_bool (r \<noteq> 0))"
+
+qualified lemma adjust_div_eq [simp, code]:
+ "adjust_div (q, r) = q + of_bool (r \<noteq> 0)"
+ by (simp add: adjust_div_def)
+
+qualified definition adjust_mod :: "num \<Rightarrow> int \<Rightarrow> int"
+where
+ [simp]: "adjust_mod l r = (if r = 0 then 0 else numeral l - r)"
+
+lemma minus_numeral_div_numeral [simp]:
+ "- numeral m div numeral n = - (adjust_div (divmod m n) :: int)"
+proof -
+ have "int (fst (divmod m n)) = fst (divmod m n)"
+ by (simp only: fst_divmod divide_int_def) auto
+ then show ?thesis
+ by (auto simp add: split_def Let_def adjust_div_def divides_aux_def divide_int_def)
+qed
+
+lemma minus_numeral_mod_numeral [simp]:
+ "- numeral m mod numeral n = adjust_mod n (snd (divmod m n) :: int)"
+proof (cases "snd (divmod m n) = (0::int)")
+ case True
+ then show ?thesis
+ by (simp add: mod_eq_0_iff_dvd divides_aux_def)
+next
+ case False
+ then have "int (snd (divmod m n)) = snd (divmod m n)" if "snd (divmod m n) \<noteq> (0::int)"
+ by (simp only: snd_divmod modulo_int_def) auto
+ then show ?thesis
+ by (simp add: divides_aux_def adjust_div_def)
+ (simp add: divides_aux_def modulo_int_def)
+qed
+
+lemma numeral_div_minus_numeral [simp]:
+ "numeral m div - numeral n = - (adjust_div (divmod m n) :: int)"
+proof -
+ have "int (fst (divmod m n)) = fst (divmod m n)"
+ by (simp only: fst_divmod divide_int_def) auto
+ then show ?thesis
+ by (auto simp add: split_def Let_def adjust_div_def divides_aux_def divide_int_def)
+qed
+
+lemma numeral_mod_minus_numeral [simp]:
+ "numeral m mod - numeral n = - adjust_mod n (snd (divmod m n) :: int)"
+proof (cases "snd (divmod m n) = (0::int)")
+ case True
+ then show ?thesis
+ by (simp add: mod_eq_0_iff_dvd divides_aux_def)
+next
+ case False
+ then have "int (snd (divmod m n)) = snd (divmod m n)" if "snd (divmod m n) \<noteq> (0::int)"
+ by (simp only: snd_divmod modulo_int_def) auto
+ then show ?thesis
+ by (simp add: divides_aux_def adjust_div_def)
+ (simp add: divides_aux_def modulo_int_def)
+qed
+
+lemma minus_one_div_numeral [simp]:
+ "- 1 div numeral n = - (adjust_div (divmod Num.One n) :: int)"
+ using minus_numeral_div_numeral [of Num.One n] by simp
+
+lemma minus_one_mod_numeral [simp]:
+ "- 1 mod numeral n = adjust_mod n (snd (divmod Num.One n) :: int)"
+ using minus_numeral_mod_numeral [of Num.One n] by simp
+
+lemma one_div_minus_numeral [simp]:
+ "1 div - numeral n = - (adjust_div (divmod Num.One n) :: int)"
+ using numeral_div_minus_numeral [of Num.One n] by simp
+
+lemma one_mod_minus_numeral [simp]:
+ "1 mod - numeral n = - adjust_mod n (snd (divmod Num.One n) :: int)"
+ using numeral_mod_minus_numeral [of Num.One n] by simp
+
+lemma [code]:
+ fixes k :: int
+ shows
+ "k div 0 = 0"
+ "k mod 0 = k"
+ "0 div k = 0"
+ "0 mod k = 0"
+ "k div Int.Pos Num.One = k"
+ "k mod Int.Pos Num.One = 0"
+ "k div Int.Neg Num.One = - k"
+ "k mod Int.Neg Num.One = 0"
+ "Int.Pos m div Int.Pos n = (fst (divmod m n) :: int)"
+ "Int.Pos m mod Int.Pos n = (snd (divmod m n) :: int)"
+ "Int.Neg m div Int.Pos n = - (adjust_div (divmod m n) :: int)"
+ "Int.Neg m mod Int.Pos n = adjust_mod n (snd (divmod m n) :: int)"
+ "Int.Pos m div Int.Neg n = - (adjust_div (divmod m n) :: int)"
+ "Int.Pos m mod Int.Neg n = - adjust_mod n (snd (divmod m n) :: int)"
+ "Int.Neg m div Int.Neg n = (fst (divmod m n) :: int)"
+ "Int.Neg m mod Int.Neg n = - (snd (divmod m n) :: int)"
+ by simp_all
+
+end
+
+lemma divmod_BitM_2_eq [simp]:
+ \<open>divmod (Num.BitM m) (Num.Bit0 Num.One) = (numeral m - 1, (1 :: int))\<close>
+ by (cases m) simp_all
+
+
+subsubsection \<open>Computation by simplification\<close>
+
+lemma euclidean_size_nat_less_eq_iff:
+ \<open>euclidean_size m \<le> euclidean_size n \<longleftrightarrow> m \<le> n\<close> for m n :: nat
+ by simp
+
+lemma euclidean_size_int_less_eq_iff:
+ \<open>euclidean_size k \<le> euclidean_size l \<longleftrightarrow> \<bar>k\<bar> \<le> \<bar>l\<bar>\<close> for k l :: int
+ by auto
+
+simproc_setup numeral_divmod
+ ("0 div 0 :: 'a :: unique_euclidean_semiring_with_nat_division" | "0 mod 0 :: 'a :: unique_euclidean_semiring_with_nat_division" |
+ "0 div 1 :: 'a :: unique_euclidean_semiring_with_nat_division" | "0 mod 1 :: 'a :: unique_euclidean_semiring_with_nat_division" |
+ "0 div - 1 :: int" | "0 mod - 1 :: int" |
+ "0 div numeral b :: 'a :: unique_euclidean_semiring_with_nat_division" | "0 mod numeral b :: 'a :: unique_euclidean_semiring_with_nat_division" |
+ "0 div - numeral b :: int" | "0 mod - numeral b :: int" |
+ "1 div 0 :: 'a :: unique_euclidean_semiring_with_nat_division" | "1 mod 0 :: 'a :: unique_euclidean_semiring_with_nat_division" |
+ "1 div 1 :: 'a :: unique_euclidean_semiring_with_nat_division" | "1 mod 1 :: 'a :: unique_euclidean_semiring_with_nat_division" |
+ "1 div - 1 :: int" | "1 mod - 1 :: int" |
+ "1 div numeral b :: 'a :: unique_euclidean_semiring_with_nat_division" | "1 mod numeral b :: 'a :: unique_euclidean_semiring_with_nat_division" |
+ "1 div - numeral b :: int" |"1 mod - numeral b :: int" |
+ "- 1 div 0 :: int" | "- 1 mod 0 :: int" | "- 1 div 1 :: int" | "- 1 mod 1 :: int" |
+ "- 1 div - 1 :: int" | "- 1 mod - 1 :: int" | "- 1 div numeral b :: int" | "- 1 mod numeral b :: int" |
+ "- 1 div - numeral b :: int" | "- 1 mod - numeral b :: int" |
+ "numeral a div 0 :: 'a :: unique_euclidean_semiring_with_nat_division" | "numeral a mod 0 :: 'a :: unique_euclidean_semiring_with_nat_division" |
+ "numeral a div 1 :: 'a :: unique_euclidean_semiring_with_nat_division" | "numeral a mod 1 :: 'a :: unique_euclidean_semiring_with_nat_division" |
+ "numeral a div - 1 :: int" | "numeral a mod - 1 :: int" |
+ "numeral a div numeral b :: 'a :: unique_euclidean_semiring_with_nat_division" | "numeral a mod numeral b :: 'a :: unique_euclidean_semiring_with_nat_division" |
+ "numeral a div - numeral b :: int" | "numeral a mod - numeral b :: int" |
+ "- numeral a div 0 :: int" | "- numeral a mod 0 :: int" |
+ "- numeral a div 1 :: int" | "- numeral a mod 1 :: int" |
+ "- numeral a div - 1 :: int" | "- numeral a mod - 1 :: int" |
+ "- numeral a div numeral b :: int" | "- numeral a mod numeral b :: int" |
+ "- numeral a div - numeral b :: int" | "- numeral a mod - numeral b :: int") = \<open>
+ let
+ val if_cong = the (Code.get_case_cong \<^theory> \<^const_name>\<open>If\<close>);
+ fun successful_rewrite ctxt ct =
+ let
+ val thm = Simplifier.rewrite ctxt ct
+ in if Thm.is_reflexive thm then NONE else SOME thm end;
+ in fn phi =>
+ let
+ val simps = Morphism.fact phi (@{thms div_0 mod_0 div_by_0 mod_by_0 div_by_1 mod_by_1
+ one_div_numeral one_mod_numeral minus_one_div_numeral minus_one_mod_numeral
+ one_div_minus_numeral one_mod_minus_numeral
+ numeral_div_numeral numeral_mod_numeral minus_numeral_div_numeral minus_numeral_mod_numeral
+ numeral_div_minus_numeral numeral_mod_minus_numeral
+ div_minus_minus mod_minus_minus Euclidean_Division.adjust_div_eq of_bool_eq one_neq_zero
+ numeral_neq_zero neg_equal_0_iff_equal arith_simps arith_special divmod_trivial
+ divmod_cancel divmod_steps divmod_step_def fst_conv snd_conv numeral_One
+ case_prod_beta rel_simps Euclidean_Division.adjust_mod_def div_minus1_right mod_minus1_right
+ minus_minus numeral_times_numeral mult_zero_right mult_1_right
+ euclidean_size_nat_less_eq_iff euclidean_size_int_less_eq_iff diff_nat_numeral nat_numeral}
+ @ [@{lemma "0 = 0 \<longleftrightarrow> True" by simp}]);
+ fun prepare_simpset ctxt = HOL_ss |> Simplifier.simpset_map ctxt
+ (Simplifier.add_cong if_cong #> fold Simplifier.add_simp simps)
+ in fn ctxt => successful_rewrite (Simplifier.put_simpset (prepare_simpset ctxt) ctxt) end
+ end
+\<close> \<comment> \<open>
+ There is space for improvement here: the calculation itself
+ could be carried out outside the logic, and a generic simproc
+ (simplifier setup) for generic calculation would be helpful.
+\<close>
+
+
+subsubsection \<open>Code generation\<close>
+
+context
+begin
+
+qualified definition divmod_nat :: "nat \<Rightarrow> nat \<Rightarrow> nat \<times> nat"
+ where "divmod_nat m n = (m div n, m mod n)"
+
+qualified lemma divmod_nat_if [code]:
+ "divmod_nat m n = (if n = 0 \<or> m < n then (0, m) else
+ let (q, r) = divmod_nat (m - n) n in (Suc q, r))"
+ by (simp add: divmod_nat_def prod_eq_iff case_prod_beta not_less le_div_geq le_mod_geq)
+
+qualified lemma [code]:
+ "m div n = fst (divmod_nat m n)"
+ "m mod n = snd (divmod_nat m n)"
+ by (simp_all add: divmod_nat_def)
+
+end
code_identifier
code_module Euclidean_Division \<rightharpoonup> (SML) Arith and (OCaml) Arith and (Haskell) Arith
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/Examples/Gauss_Numbers.thy Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,329 @@
+(* Author: Florian Haftmann, TU Muenchen; based on existing material on gauss numbers\<close>
+*)
+
+section \<open>Gauss Numbers: integral gauss numbers\<close>
+
+theory Gauss_Numbers
+imports Main
+begin
+
+codatatype gauss = Gauss (Re: int) (Im: int)
+
+lemma gauss_eqI [intro?]:
+ \<open>x = y\<close> if \<open>Re x = Re y\<close> \<open>Im x = Im y\<close>
+ by (rule gauss.expand) (use that in simp)
+
+lemma gauss_eq_iff:
+ \<open>x = y \<longleftrightarrow> Re x = Re y \<and> Im x = Im y\<close>
+ by (auto intro: gauss_eqI)
+
+
+subsection \<open>Basic arithmetic\<close>
+
+instantiation gauss :: comm_ring_1
+begin
+
+primcorec zero_gauss :: \<open>gauss\<close>
+ where
+ \<open>Re 0 = 0\<close>
+ | \<open>Im 0 = 0\<close>
+
+primcorec one_gauss :: \<open>gauss\<close>
+ where
+ \<open>Re 1 = 1\<close>
+ | \<open>Im 1 = 0\<close>
+
+primcorec plus_gauss :: \<open>gauss \<Rightarrow> gauss \<Rightarrow> gauss\<close>
+ where
+ \<open>Re (x + y) = Re x + Re y\<close>
+ | \<open>Im (x + y) = Im x + Im y\<close>
+
+primcorec uminus_gauss :: \<open>gauss \<Rightarrow> gauss\<close>
+ where
+ \<open>Re (- x) = - Re x\<close>
+ | \<open>Im (- x) = - Im x\<close>
+
+primcorec minus_gauss :: \<open>gauss \<Rightarrow> gauss \<Rightarrow> gauss\<close>
+ where
+ \<open>Re (x - y) = Re x - Re y\<close>
+ | \<open>Im (x - y) = Im x - Im y\<close>
+
+primcorec times_gauss :: \<open>gauss \<Rightarrow> gauss \<Rightarrow> gauss\<close>
+ where
+ \<open>Re (x * y) = Re x * Re y - Im x * Im y\<close>
+ | \<open>Im (x * y) = Re x * Im y + Im x * Re y\<close>
+
+instance
+ by standard (simp_all add: gauss_eq_iff algebra_simps)
+
+end
+
+lemma of_nat_gauss:
+ \<open>of_nat n = Gauss (int n) 0\<close>
+ by (induction n) (simp_all add: gauss_eq_iff)
+
+lemma numeral_gauss:
+ \<open>numeral n = Gauss (numeral n) 0\<close>
+proof -
+ have \<open>numeral n = (of_nat (numeral n) :: gauss)\<close>
+ by simp
+ also have \<open>\<dots> = Gauss (of_nat (numeral n)) 0\<close>
+ by (simp add: of_nat_gauss)
+ finally show ?thesis
+ by simp
+qed
+
+lemma of_int_gauss:
+ \<open>of_int k = Gauss k 0\<close>
+ by (simp add: gauss_eq_iff of_int_of_nat of_nat_gauss)
+
+lemma conversion_simps [simp]:
+ \<open>Re (numeral m) = numeral m\<close>
+ \<open>Im (numeral m) = 0\<close>
+ \<open>Re (of_nat n) = int n\<close>
+ \<open>Im (of_nat n) = 0\<close>
+ \<open>Re (of_int k) = k\<close>
+ \<open>Im (of_int k) = 0\<close>
+ by (simp_all add: numeral_gauss of_nat_gauss of_int_gauss)
+
+lemma gauss_eq_0:
+ \<open>z = 0 \<longleftrightarrow> (Re z)\<^sup>2 + (Im z)\<^sup>2 = 0\<close>
+ by (simp add: gauss_eq_iff sum_power2_eq_zero_iff)
+
+lemma gauss_neq_0:
+ \<open>z \<noteq> 0 \<longleftrightarrow> (Re z)\<^sup>2 + (Im z)\<^sup>2 > 0\<close>
+ by (simp add: gauss_eq_0 sum_power2_ge_zero less_le)
+
+lemma Re_sum [simp]:
+ \<open>Re (sum f s) = (\<Sum>x\<in>s. Re (f x))\<close>
+ by (induct s rule: infinite_finite_induct) auto
+
+lemma Im_sum [simp]:
+ \<open>Im (sum f s) = (\<Sum>x\<in>s. Im (f x))\<close>
+ by (induct s rule: infinite_finite_induct) auto
+
+instance gauss :: idom
+proof
+ fix x y :: gauss
+ assume \<open>x \<noteq> 0\<close> \<open>y \<noteq> 0\<close>
+ then show \<open>x * y \<noteq> 0\<close>
+ by (simp_all add: gauss_eq_iff)
+ (smt (verit, best) mult_eq_0_iff mult_neg_neg mult_neg_pos mult_pos_neg mult_pos_pos)
+qed
+
+
+
+subsection \<open>The Gauss Number $i$\<close>
+
+primcorec imaginary_unit :: gauss (\<open>\<i>\<close>)
+ where
+ \<open>Re \<i> = 0\<close>
+ | \<open>Im \<i> = 1\<close>
+
+lemma Gauss_eq:
+ \<open>Gauss a b = of_int a + \<i> * of_int b\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_eq:
+ \<open>a = of_int (Re a) + \<i> * of_int (Im a)\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_i_not_zero [simp]:
+ \<open>\<i> \<noteq> 0\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_i_not_one [simp]:
+ \<open>\<i> \<noteq> 1\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_i_not_numeral [simp]:
+ \<open>\<i> \<noteq> numeral n\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_i_not_neg_numeral [simp]:
+ \<open>\<i> \<noteq> - numeral n\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma i_mult_i_eq [simp]:
+ \<open>\<i> * \<i> = - 1\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_i_mult_minus [simp]:
+ \<open>\<i> * (\<i> * x) = - x\<close>
+ by (simp flip: mult.assoc)
+
+lemma i_squared [simp]:
+ \<open>\<i>\<^sup>2 = - 1\<close>
+ by (simp add: power2_eq_square)
+
+lemma i_even_power [simp]:
+ \<open>\<i> ^ (n * 2) = (- 1) ^ n\<close>
+ unfolding mult.commute [of n] power_mult by simp
+
+lemma Re_i_times [simp]:
+ \<open>Re (\<i> * z) = - Im z\<close>
+ by simp
+
+lemma Im_i_times [simp]:
+ \<open>Im (\<i> * z) = Re z\<close>
+ by simp
+
+lemma i_times_eq_iff:
+ \<open>\<i> * w = z \<longleftrightarrow> w = - (\<i> * z)\<close>
+ by auto
+
+lemma is_unit_i [simp]:
+ \<open>\<i> dvd 1\<close>
+ by (rule dvdI [of _ _ \<open>- \<i>\<close>]) simp
+
+lemma gauss_numeral [code_post]:
+ \<open>Gauss 0 0 = 0\<close>
+ \<open>Gauss 1 0 = 1\<close>
+ \<open>Gauss (- 1) 0 = - 1\<close>
+ \<open>Gauss (numeral n) 0 = numeral n\<close>
+ \<open>Gauss (- numeral n) 0 = - numeral n\<close>
+ \<open>Gauss 0 1 = \<i>\<close>
+ \<open>Gauss 0 (- 1) = - \<i>\<close>
+ \<open>Gauss 0 (numeral n) = numeral n * \<i>\<close>
+ \<open>Gauss 0 (- numeral n) = - numeral n * \<i>\<close>
+ \<open>Gauss 1 1 = 1 + \<i>\<close>
+ \<open>Gauss (- 1) 1 = - 1 + \<i>\<close>
+ \<open>Gauss (numeral n) 1 = numeral n + \<i>\<close>
+ \<open>Gauss (- numeral n) 1 = - numeral n + \<i>\<close>
+ \<open>Gauss 1 (- 1) = 1 - \<i>\<close>
+ \<open>Gauss 1 (numeral n) = 1 + numeral n * \<i>\<close>
+ \<open>Gauss 1 (- numeral n) = 1 - numeral n * \<i>\<close>
+ \<open>Gauss (- 1) (- 1) = - 1 - \<i>\<close>
+ \<open>Gauss (numeral n) (- 1) = numeral n - \<i>\<close>
+ \<open>Gauss (- numeral n) (- 1) = - numeral n - \<i>\<close>
+ \<open>Gauss (- 1) (numeral n) = - 1 + numeral n * \<i>\<close>
+ \<open>Gauss (- 1) (- numeral n) = - 1 - numeral n * \<i>\<close>
+ \<open>Gauss (numeral m) (numeral n) = numeral m + numeral n * \<i>\<close>
+ \<open>Gauss (- numeral m) (numeral n) = - numeral m + numeral n * \<i>\<close>
+ \<open>Gauss (numeral m) (- numeral n) = numeral m - numeral n * \<i>\<close>
+ \<open>Gauss (- numeral m) (- numeral n) = - numeral m - numeral n * \<i>\<close>
+ by (simp_all add: gauss_eq_iff)
+
+
+subsection \<open>Gauss Conjugation\<close>
+
+primcorec cnj :: \<open>gauss \<Rightarrow> gauss\<close>
+ where
+ \<open>Re (cnj z) = Re z\<close>
+ | \<open>Im (cnj z) = - Im z\<close>
+
+lemma gauss_cnj_cancel_iff [simp]:
+ \<open>cnj x = cnj y \<longleftrightarrow> x = y\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_cnj_cnj [simp]:
+ \<open>cnj (cnj z) = z\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_cnj_zero [simp]:
+ \<open>cnj 0 = 0\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_cnj_zero_iff [iff]:
+ \<open>cnj z = 0 \<longleftrightarrow> z = 0\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_cnj_one_iff [simp]:
+ \<open>cnj z = 1 \<longleftrightarrow> z = 1\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_cnj_add [simp]:
+ \<open>cnj (x + y) = cnj x + cnj y\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma cnj_sum [simp]:
+ \<open>cnj (sum f s) = (\<Sum>x\<in>s. cnj (f x))\<close>
+ by (induct s rule: infinite_finite_induct) auto
+
+lemma gauss_cnj_diff [simp]:
+ \<open>cnj (x - y) = cnj x - cnj y\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_cnj_minus [simp]:
+ \<open>cnj (- x) = - cnj x\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_cnj_one [simp]:
+ \<open>cnj 1 = 1\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_cnj_mult [simp]:
+ \<open>cnj (x * y) = cnj x * cnj y\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma cnj_prod [simp]:
+ \<open>cnj (prod f s) = (\<Prod>x\<in>s. cnj (f x))\<close>
+ by (induct s rule: infinite_finite_induct) auto
+
+lemma gauss_cnj_power [simp]:
+ \<open>cnj (x ^ n) = cnj x ^ n\<close>
+ by (induct n) simp_all
+
+lemma gauss_cnj_numeral [simp]:
+ \<open>cnj (numeral w) = numeral w\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_cnj_of_nat [simp]:
+ \<open>cnj (of_nat n) = of_nat n\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_cnj_of_int [simp]:
+ \<open>cnj (of_int z) = of_int z\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_cnj_i [simp]:
+ \<open>cnj \<i> = - \<i>\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_add_cnj:
+ \<open>z + cnj z = of_int (2 * Re z)\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_diff_cnj:
+ \<open>z - cnj z = of_int (2 * Im z) * \<i>\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_mult_cnj:
+ \<open>z * cnj z = of_int ((Re z)\<^sup>2 + (Im z)\<^sup>2)\<close>
+ by (simp add: gauss_eq_iff power2_eq_square)
+
+lemma cnj_add_mult_eq_Re:
+ \<open>z * cnj w + cnj z * w = of_int (2 * Re (z * cnj w))\<close>
+ by (simp add: gauss_eq_iff)
+
+lemma gauss_In_mult_cnj_zero [simp]:
+ \<open>Im (z * cnj z) = 0\<close>
+ by simp
+
+
+subsection \<open>Algebraic division\<close>
+
+instantiation gauss :: idom_modulo
+begin
+
+primcorec divide_gauss :: \<open>gauss \<Rightarrow> gauss \<Rightarrow> gauss\<close>
+ where
+ \<open>Re (x div y) = (Re x * Re y + Im x * Im y) div ((Re y)\<^sup>2 + (Im y)\<^sup>2)\<close>
+ | \<open>Im (x div y) = (Im x * Re y - Re x * Im y) div ((Re y)\<^sup>2 + (Im y)\<^sup>2)\<close>
+
+definition modulo_gauss :: \<open>gauss \<Rightarrow> gauss \<Rightarrow> gauss\<close>
+ where
+ \<open>x mod y = x - x div y * y\<close> for x y :: gauss
+
+instance
+ apply standard
+ apply (simp_all add: modulo_gauss_def)
+ apply (auto simp add: gauss_eq_iff algebra_simps power2_eq_square)
+ apply (simp_all only: flip: mult.assoc distrib_right)
+ apply (simp_all only: mult.assoc [of \<open>Im k\<close> \<open>Re l\<close> \<open>Re r\<close> for k l r])
+ apply (simp_all add: sum_squares_eq_zero_iff mult.commute flip: distrib_left)
+ done
+
+end
+
+end
--- a/src/HOL/Examples/Rewrite_Examples.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Examples/Rewrite_Examples.thy Fri Sep 02 13:41:55 2022 +0200
@@ -7,7 +7,7 @@
text\<open>
This theory gives an overview over the features of the pattern-based rewrite proof method.
-Documentation: @{url "https://arxiv.org/abs/2111.04082"}
+Documentation: \<^url>\<open>https://arxiv.org/abs/2111.04082\<close>
\<close>
lemma
--- a/src/HOL/Factorial.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Factorial.thy Fri Sep 02 13:41:55 2022 +0200
@@ -64,11 +64,7 @@
by (cases n) auto
lemma fact_nonzero [simp]: "fact n \<noteq> (0::'a::{semiring_char_0,semiring_no_zero_divisors})"
- apply (induct n)
- apply auto
- using of_nat_eq_0_iff
- apply fastforce
- done
+ using of_nat_0_neq by (induct n) auto
lemma fact_mono_nat: "m \<le> n \<Longrightarrow> fact m \<le> (fact n :: nat)"
by (induct n) (auto simp: le_Suc_eq)
--- a/src/HOL/Fields.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Fields.thy Fri Sep 02 13:41:55 2022 +0200
@@ -13,32 +13,6 @@
imports Nat
begin
-context idom
-begin
-
-lemma inj_mult_left [simp]: \<open>inj ((*) a) \<longleftrightarrow> a \<noteq> 0\<close> (is \<open>?P \<longleftrightarrow> ?Q\<close>)
-proof
- assume ?P
- show ?Q
- proof
- assume \<open>a = 0\<close>
- with \<open>?P\<close> have "inj ((*) 0)"
- by simp
- moreover have "0 * 0 = 0 * 1"
- by simp
- ultimately have "0 = 1"
- by (rule injD)
- then show False
- by simp
- qed
-next
- assume ?Q then show ?P
- by (auto intro: injI)
-qed
-
-end
-
-
subsection \<open>Division rings\<close>
text \<open>
@@ -60,7 +34,7 @@
ML_file \<open>~~/src/Provers/Arith/fast_lin_arith.ML\<close>
ML_file \<open>Tools/lin_arith.ML\<close>
setup \<open>Lin_Arith.global_setup\<close>
-declaration \<open>K (
+declaration \<open>K (
Lin_Arith.init_arith_data
#> Lin_Arith.add_discrete_type \<^type_name>\<open>nat\<close>
#> Lin_Arith.add_lessD @{thm Suc_leI}
@@ -85,7 +59,7 @@
\<^text>\<open>fast_nat_arith_simproc\<close> anyway. However, it seems cheaper to activate the
solver all the time rather than add the additional check.\<close>
-lemmas [arith_split] = nat_diff_split split_min split_max
+lemmas [linarith_split] = nat_diff_split split_min split_max abs_split
text\<open>Lemmas \<open>divide_simps\<close> move division to the outside and eliminates them on (in)equalities.\<close>
@@ -286,7 +260,7 @@
lemma inverse_nonzero_iff_nonzero [simp]:
"inverse a = 0 \<longleftrightarrow> a = 0"
- by rule (fact inverse_zero_imp_zero, simp)
+ by (rule iffI) (fact inverse_zero_imp_zero, simp)
lemma inverse_minus_eq [simp]:
"inverse (- a) = - inverse a"
@@ -519,7 +493,7 @@
lemma inverse_eq_1_iff [simp]:
"inverse x = 1 \<longleftrightarrow> x = 1"
- by (insert inverse_eq_iff_eq [of x 1], simp)
+ using inverse_eq_iff_eq [of x 1] by simp
lemma divide_eq_0_iff [simp]:
"a / b = 0 \<longleftrightarrow> a = 0 \<or> b = 0"
@@ -647,8 +621,8 @@
lemma negative_imp_inverse_negative:
"a < 0 \<Longrightarrow> inverse a < 0"
- by (insert positive_imp_inverse_positive [of "-a"],
- simp add: nonzero_inverse_minus_eq less_imp_not_eq)
+ using positive_imp_inverse_positive [of "-a"]
+ by (simp add: nonzero_inverse_minus_eq less_imp_not_eq)
lemma inverse_le_imp_le:
assumes invle: "inverse a \<le> inverse b" and apos: "0 < a"
--- a/src/HOL/Finite_Set.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Finite_Set.thy Fri Sep 02 13:41:55 2022 +0200
@@ -1226,7 +1226,7 @@
subsubsection \<open>Expressing set operations via \<^const>\<open>fold\<close>\<close>
lemma comp_fun_commute_const: "comp_fun_commute (\<lambda>_. f)"
- by standard rule
+ by standard (rule refl)
lemma comp_fun_idem_insert: "comp_fun_idem insert"
by standard auto
@@ -1571,7 +1571,7 @@
global_interpretation card: folding "\<lambda>_. Suc" 0
defines card = "folding_on.F (\<lambda>_. Suc) 0"
- by standard rule
+ by standard (rule refl)
lemma card_insert_disjoint: "finite A \<Longrightarrow> x \<notin> A \<Longrightarrow> card (insert x A) = Suc (card A)"
by (fact card.insert)
@@ -1824,11 +1824,12 @@
from "2.prems"(1,2,5) "2.hyps"(1,2) have cst: "card s \<le> card t"
by simp
from "2.prems"(3) [OF "2.hyps"(1) cst]
- obtain f where "f ` s \<subseteq> t" "inj_on f s"
+ obtain f where *: "f ` s \<subseteq> t" "inj_on f s"
by blast
- with "2.prems"(2) "2.hyps"(2) show ?case
- unfolding inj_on_def
- by (rule_tac x = "\<lambda>z. if z = x then y else f z" in exI) auto
+ let ?g = "(\<lambda>a. if a = x then y else f a)"
+ have "?g ` insert x s \<subseteq> insert y t \<and> inj_on ?g (insert x s)"
+ using * "2.prems"(2) "2.hyps"(2) unfolding inj_on_def by auto
+ then show ?case by (rule exI[where ?x="?g"])
qed
qed
@@ -2102,6 +2103,56 @@
case True thus ?thesis using assms[of F] by auto
qed
+lemma obtain_subset_with_card_n:
+ assumes "n \<le> card S"
+ obtains T where "T \<subseteq> S" "card T = n" "finite T"
+proof -
+ obtain n' where "card S = n + n'"
+ using le_Suc_ex[OF assms] by blast
+ with that show thesis
+ proof (induct n' arbitrary: S)
+ case 0
+ thus ?case by (cases "finite S") auto
+ next
+ case Suc
+ thus ?case by (auto simp add: card_Suc_eq)
+ qed
+qed
+
+lemma exists_subset_between:
+ assumes
+ "card A \<le> n"
+ "n \<le> card C"
+ "A \<subseteq> C"
+ "finite C"
+ shows "\<exists>B. A \<subseteq> B \<and> B \<subseteq> C \<and> card B = n"
+ using assms
+proof (induct n arbitrary: A C)
+ case 0
+ thus ?case using finite_subset[of A C] by (intro exI[of _ "{}"], auto)
+next
+ case (Suc n A C)
+ show ?case
+ proof (cases "A = {}")
+ case True
+ from obtain_subset_with_card_n[OF Suc(3)]
+ obtain B where "B \<subseteq> C" "card B = Suc n" by blast
+ thus ?thesis unfolding True by blast
+ next
+ case False
+ then obtain a where a: "a \<in> A" by auto
+ let ?A = "A - {a}"
+ let ?C = "C - {a}"
+ have 1: "card ?A \<le> n" using Suc(2-) a
+ using finite_subset by fastforce
+ have 2: "card ?C \<ge> n" using Suc(2-) a by auto
+ from Suc(1)[OF 1 2 _ finite_subset[OF _ Suc(5)]] Suc(2-)
+ obtain B where "?A \<subseteq> B" "B \<subseteq> ?C" "card B = n" by blast
+ thus ?thesis using a Suc(2-)
+ by (intro exI[of _ "insert a B"], auto intro!: card_insert_disjoint finite_subset[of B C])
+ qed
+qed
+
subsubsection \<open>Cardinality of image\<close>
@@ -2365,7 +2416,7 @@
by (simp add: fS)
have "\<lbrakk>x \<noteq> y; x \<in> S; z \<in> S; f x = f y\<rbrakk>
\<Longrightarrow> \<exists>x \<in> S. x \<noteq> y \<and> f z = f x" for z
- by (case_tac "z = y \<longrightarrow> z = x") auto
+ by (cases "z = y \<longrightarrow> z = x") auto
then show "T \<subseteq> f ` (S - {y})"
using h xy x y f by fastforce
qed
--- a/src/HOL/Fun.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Fun.thy Fri Sep 02 13:41:55 2022 +0200
@@ -377,28 +377,30 @@
lemma bij_betw_comp_iff2:
assumes bij: "bij_betw f' A' A''"
and img: "f ` A \<le> A'"
- shows "bij_betw f A A' \<longleftrightarrow> bij_betw (f' \<circ> f) A A''"
- using assms
-proof (auto simp add: bij_betw_comp_iff)
- assume *: "bij_betw (f' \<circ> f) A A''"
- then show "bij_betw f A A'"
- using img
- proof (auto simp add: bij_betw_def)
- assume "inj_on (f' \<circ> f) A"
- then show "inj_on f A"
- using inj_on_imageI2 by blast
+ shows "bij_betw f A A' \<longleftrightarrow> bij_betw (f' \<circ> f) A A''" (is "?L \<longleftrightarrow> ?R")
+proof
+ assume "?L"
+ then show "?R"
+ using assms by (auto simp add: bij_betw_comp_iff)
next
- fix a'
- assume **: "a' \<in> A'"
- with bij have "f' a' \<in> A''"
- unfolding bij_betw_def by auto
- with * obtain a where 1: "a \<in> A \<and> f' (f a) = f' a'"
- unfolding bij_betw_def by force
- with img have "f a \<in> A'" by auto
- with bij ** 1 have "f a = a'"
- unfolding bij_betw_def inj_on_def by auto
- with 1 show "a' \<in> f ` A" by auto
- qed
+ assume *: "?R"
+ have "inj_on (f' \<circ> f) A \<Longrightarrow> inj_on f A"
+ using inj_on_imageI2 by blast
+ moreover have "A' \<subseteq> f ` A"
+ proof
+ fix a'
+ assume **: "a' \<in> A'"
+ with bij have "f' a' \<in> A''"
+ unfolding bij_betw_def by auto
+ with * obtain a where 1: "a \<in> A \<and> f' (f a) = f' a'"
+ unfolding bij_betw_def by force
+ with img have "f a \<in> A'" by auto
+ with bij ** 1 have "f a = a'"
+ unfolding bij_betw_def inj_on_def by auto
+ with 1 show "a' \<in> f ` A" by auto
+ qed
+ ultimately show "?L"
+ using img * by (auto simp add: bij_betw_def)
qed
lemma bij_betw_inv:
@@ -425,7 +427,7 @@
from g [OF a1] a1 g [OF a2] a2 \<open>?g x = ?g y\<close> show "x = y" by simp
qed
moreover have "?g ` B = A"
- proof (auto simp: image_def)
+ proof safe
fix b
assume "b \<in> B"
with s obtain a where P: "?P b a" by blast
@@ -435,7 +437,9 @@
assume "a \<in> A"
with s obtain b where P: "?P b a" by blast
with s have "b \<in> B" by blast
- with g[OF P] show "\<exists>b\<in>B. a = ?g b" by blast
+ with g[OF P] have "\<exists>b\<in>B. a = ?g b" by blast
+ then show "a \<in> ?g ` B"
+ by auto
qed
ultimately show ?thesis
by (auto simp: bij_betw_def)
@@ -634,7 +638,7 @@
next
assume *: "bij_betw f (A \<union> {b}) (A' \<union> {f b})"
have "f ` A = A'"
- proof auto
+ proof safe
fix a
assume **: "a \<in> A"
then have "f a \<in> A' \<union> {f b}"
@@ -794,7 +798,6 @@
unfolding fun_upd_def
apply safe
apply (erule subst)
- apply (rule_tac [2] ext)
apply auto
done
@@ -900,12 +903,13 @@
"bij_betw f A B \<longleftrightarrow> (\<exists>g. (\<forall>x \<in> A. f x \<in> B \<and> g(f x) = x) \<and> (\<forall>y \<in> B. g y \<in> A \<and> f(g y) = y))"
(is "?lhs = ?rhs")
proof
- assume L: ?lhs
- then show ?rhs
- apply (rule_tac x="the_inv_into A f" in exI)
- apply (auto simp: bij_betw_def f_the_inv_into_f the_inv_into_f_f the_inv_into_into)
- done
-qed (force intro: bij_betw_byWitness)
+ show "?lhs \<Longrightarrow> ?rhs"
+ by (auto simp: bij_betw_def f_the_inv_into_f the_inv_into_f_f the_inv_into_into
+ exI[where ?x="the_inv_into A f"])
+next
+ show "?rhs \<Longrightarrow> ?lhs"
+ by (force intro: bij_betw_byWitness)
+qed
abbreviation the_inv :: "('a \<Rightarrow> 'b) \<Rightarrow> ('b \<Rightarrow> 'a)"
where "the_inv f \<equiv> the_inv_into UNIV f"
@@ -1202,17 +1206,21 @@
lemma strict_mono_on_leD:
assumes "strict_mono_on A (f :: (_ :: linorder) \<Rightarrow> _ :: preorder)" "x \<in> A" "y \<in> A" "x \<le> y"
shows "f x \<le> f y"
-proof (insert le_less_linear[of y x], elim disjE)
- assume "x < y"
- with assms have "f x < f y" by (rule_tac strict_mono_onD[OF assms(1)]) simp_all
- thus ?thesis by (rule less_imp_le)
-qed (insert assms, simp)
+proof (cases "x = y")
+ case True
+ then show ?thesis by simp
+next
+ case False
+ with assms have "f x < f y"
+ using strict_mono_onD[OF assms(1)] by simp
+ then show ?thesis by (rule less_imp_le)
+qed
lemma strict_mono_on_eqD:
fixes f :: "(_ :: linorder) \<Rightarrow> (_ :: preorder)"
assumes "strict_mono_on A f" "f x = f y" "x \<in> A" "y \<in> A"
shows "y = x"
- using assms by (rule_tac linorder_cases[of x y]) (auto dest: strict_mono_onD)
+ using assms by (cases rule: linorder_cases) (auto dest: strict_mono_onD)
lemma strict_mono_on_imp_mono_on:
"strict_mono_on A (f :: (_ :: linorder) \<Rightarrow> _ :: preorder) \<Longrightarrow> mono_on A f"
--- a/src/HOL/Fun_Def.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Fun_Def.thy Fri Sep 02 13:41:55 2022 +0200
@@ -40,20 +40,14 @@
assumes ex1: "\<exists>!y. G x y"
assumes elm: "G x (h x)"
shows "h x = f x"
- apply (simp only: f_def)
- apply (rule THE_default1_equality [symmetric])
- apply (rule ex1)
- apply (rule elm)
- done
+ by (auto simp add: f_def ex1 elm THE_default1_equality[symmetric])
lemma fundef_ex1_iff:
assumes f_def: "f \<equiv> (\<lambda>x::'a. THE_default (d x) (\<lambda>y. G x y))"
assumes ex1: "\<exists>!y. G x y"
shows "(G x y) = (f x = y)"
- apply (auto simp:ex1 f_def THE_default1_equality)
- apply (rule THE_defaultI')
- apply (rule ex1)
- done
+ by (auto simp add: ex1 f_def THE_default1_equality THE_defaultI')
+
lemma fundef_default_value:
assumes f_def: "f \<equiv> (\<lambda>x::'a. THE_default (d x) (\<lambda>y. G x y))"
@@ -243,17 +237,33 @@
lemma max_ext_compat:
assumes "R O S \<subseteq> R"
shows "max_ext R O (max_ext S \<union> {({}, {})}) \<subseteq> max_ext R"
- using assms
- apply auto
- apply (elim max_ext.cases)
- apply rule
- apply auto[3]
- apply (drule_tac x=xa in meta_spec)
- apply simp
- apply (erule bexE)
- apply (drule_tac x=xb in meta_spec)
- apply auto
- done
+proof -
+ have "\<And>X Y Z. (X, Y) \<in> max_ext R \<Longrightarrow> (Y, Z) \<in> max_ext S \<Longrightarrow> (X, Z) \<in> max_ext R"
+ proof -
+ fix X Y Z
+ assume "(X,Y)\<in>max_ext R"
+ "(Y, Z)\<in>max_ext S"
+ then have *: "finite X" "finite Y" "finite Z" "Y\<noteq>{}" "Z\<noteq>{}"
+ "(\<And>x. x\<in>X \<Longrightarrow> \<exists>y\<in>Y. (x, y)\<in>R)"
+ "(\<And>y. y\<in>Y \<Longrightarrow> \<exists>z\<in>Z. (y, z)\<in>S)"
+ by (auto elim: max_ext.cases)
+ moreover have "\<And>x. x\<in>X \<Longrightarrow> \<exists>z\<in>Z. (x, z)\<in>R"
+ proof -
+ fix x
+ assume "x\<in>X"
+ then obtain y where 1: "y\<in>Y" "(x, y)\<in>R"
+ using * by auto
+ then obtain z where "z\<in>Z" "(y, z)\<in>S"
+ using * by auto
+ then show "\<exists>z\<in>Z. (x, z)\<in>R"
+ using assms 1 by (auto elim: max_ext.cases)
+ qed
+ ultimately show "(X,Z)\<in>max_ext R"
+ by auto
+ qed
+ then show "max_ext R O (max_ext S \<union> {({}, {})}) \<subseteq> max_ext R"
+ by auto
+qed
lemma max_rpair_set: "reduction_pair (max_strict, max_weak)"
unfolding max_strict_def max_weak_def
@@ -265,15 +275,25 @@
lemma min_ext_compat:
assumes "R O S \<subseteq> R"
- shows "min_ext R O (min_ext S \<union> {({},{})}) \<subseteq> min_ext R"
- using assms
- apply (auto simp: min_ext_def)
- apply (drule_tac x=ya in bspec, assumption)
- apply (erule bexE)
- apply (drule_tac x=xc in bspec)
- apply assumption
- apply auto
- done
+ shows "min_ext R O (min_ext S \<union> {({},{})}) \<subseteq> min_ext R"
+proof -
+ have "\<And>X Y Z z. \<forall>y\<in>Y. \<exists>x\<in>X. (x, y) \<in> R \<Longrightarrow> \<forall>z\<in>Z. \<exists>y\<in>Y. (y, z) \<in> S
+ \<Longrightarrow> z \<in> Z \<Longrightarrow> \<exists>x\<in>X. (x, z) \<in> R"
+ proof -
+ fix X Y Z z
+ assume *: "\<forall>y\<in>Y. \<exists>x\<in>X. (x, y) \<in> R"
+ "\<forall>z\<in>Z. \<exists>y\<in>Y. (y, z) \<in> S"
+ "z\<in>Z"
+ then obtain y' where 1: "y'\<in>Y" "(y', z) \<in> S"
+ by auto
+ then obtain x' where 2: "x'\<in>X" "(x', y') \<in> R"
+ using * by auto
+ show "\<exists>x\<in>X. (x, z) \<in> R"
+ using 1 2 assms by auto
+ qed
+ then show ?thesis
+ using assms by (auto simp: min_ext_def)
+qed
lemma min_rpair_set: "reduction_pair (min_strict, min_weak)"
unfolding min_strict_def min_weak_def
--- a/src/HOL/Groups_Big.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Groups_Big.thy Fri Sep 02 13:41:55 2022 +0200
@@ -1001,12 +1001,15 @@
case empty
then show ?case by simp
next
- case insert
+ case (insert x F)
then show ?case
- apply (auto simp: insert_Diff_if)
- apply (drule mk_disjoint_insert)
- apply auto
- done
+ proof (cases "a \<in> F")
+ case True
+ then have "\<exists>B. F = insert a B \<and> a \<notin> B"
+ by (auto simp: mk_disjoint_insert)
+ then show ?thesis using insert
+ by (auto simp: insert_Diff_if)
+ qed (auto)
qed
lemma sum_diff_nat:
@@ -1497,7 +1500,7 @@
next
case (insert a A)
then have "f a = 0 \<or> (\<exists>a\<in>A. f a = 0)" by simp
- then have "f a * prod f A = 0" by rule (simp_all add: insert)
+ then have "f a * prod f A = 0" by (rule disjE) (simp_all add: insert)
with insert show ?case by simp
qed
--- a/src/HOL/Groups_List.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Groups_List.thy Fri Sep 02 13:41:55 2022 +0200
@@ -252,6 +252,15 @@
qed
qed
+text \<open>A much more general version of this monotonicity lemma
+can be formulated with multisets and the multiset order\<close>
+
+lemma sum_list_mono2: fixes xs :: "'a ::ordered_comm_monoid_add list"
+shows "\<lbrakk> length xs = length ys; \<And>i. i < length xs \<longrightarrow> xs!i \<le> ys!i \<rbrakk>
+ \<Longrightarrow> sum_list xs \<le> sum_list ys"
+apply(induction xs ys rule: list_induct2)
+by(auto simp: nth_Cons' less_Suc_eq_0_disj imp_ex add_mono)
+
lemma (in monoid_add) sum_list_distinct_conv_sum_set:
"distinct xs \<Longrightarrow> sum_list (map f xs) = sum f (set xs)"
by (induct xs) simp_all
@@ -403,6 +412,89 @@
end
+context linordered_semidom
+begin
+
+lemma horner_sum_nonnegative:
+ \<open>0 \<le> horner_sum of_bool 2 bs\<close>
+ by (induction bs) simp_all
+
+end
+
+context unique_euclidean_semiring_numeral
+begin
+
+lemma horner_sum_bound:
+ \<open>horner_sum of_bool 2 bs < 2 ^ length bs\<close>
+proof (induction bs)
+ case Nil
+ then show ?case
+ by simp
+next
+ case (Cons b bs)
+ moreover define a where \<open>a = 2 ^ length bs - horner_sum of_bool 2 bs\<close>
+ ultimately have *: \<open>2 ^ length bs = horner_sum of_bool 2 bs + a\<close>
+ by simp
+ have \<open>1 < a * 2\<close> if \<open>0 < a\<close>
+ using that add_mono [of 1 a 1 a]
+ by (simp add: mult_2_right discrete)
+ with Cons show ?case
+ by (simp add: algebra_simps *)
+qed
+
+end
+
+lemma nat_horner_sum [simp]:
+ \<open>nat (horner_sum of_bool 2 bs) = horner_sum of_bool 2 bs\<close>
+ by (induction bs) (auto simp add: nat_add_distrib horner_sum_nonnegative)
+
+context unique_euclidean_semiring_numeral
+begin
+
+lemma horner_sum_less_eq_iff_lexordp_eq:
+ \<open>horner_sum of_bool 2 bs \<le> horner_sum of_bool 2 cs \<longleftrightarrow> lexordp_eq (rev bs) (rev cs)\<close>
+ if \<open>length bs = length cs\<close>
+proof -
+ have \<open>horner_sum of_bool 2 (rev bs) \<le> horner_sum of_bool 2 (rev cs) \<longleftrightarrow> lexordp_eq bs cs\<close>
+ if \<open>length bs = length cs\<close> for bs cs
+ using that proof (induction bs cs rule: list_induct2)
+ case Nil
+ then show ?case
+ by simp
+ next
+ case (Cons b bs c cs)
+ with horner_sum_nonnegative [of \<open>rev bs\<close>] horner_sum_nonnegative [of \<open>rev cs\<close>]
+ horner_sum_bound [of \<open>rev bs\<close>] horner_sum_bound [of \<open>rev cs\<close>]
+ show ?case
+ by (auto simp add: horner_sum_append not_le Cons intro: add_strict_increasing2 add_increasing)
+ qed
+ from that this [of \<open>rev bs\<close> \<open>rev cs\<close>] show ?thesis
+ by simp
+qed
+
+lemma horner_sum_less_iff_lexordp:
+ \<open>horner_sum of_bool 2 bs < horner_sum of_bool 2 cs \<longleftrightarrow> ord_class.lexordp (rev bs) (rev cs)\<close>
+ if \<open>length bs = length cs\<close>
+proof -
+ have \<open>horner_sum of_bool 2 (rev bs) < horner_sum of_bool 2 (rev cs) \<longleftrightarrow> ord_class.lexordp bs cs\<close>
+ if \<open>length bs = length cs\<close> for bs cs
+ using that proof (induction bs cs rule: list_induct2)
+ case Nil
+ then show ?case
+ by simp
+ next
+ case (Cons b bs c cs)
+ with horner_sum_nonnegative [of \<open>rev bs\<close>] horner_sum_nonnegative [of \<open>rev cs\<close>]
+ horner_sum_bound [of \<open>rev bs\<close>] horner_sum_bound [of \<open>rev cs\<close>]
+ show ?case
+ by (auto simp add: horner_sum_append not_less Cons intro: add_strict_increasing2 add_increasing)
+ qed
+ from that this [of \<open>rev bs\<close> \<open>rev cs\<close>] show ?thesis
+ by simp
+qed
+
+end
+
subsection \<open>Further facts about \<^const>\<open>List.n_lists\<close>\<close>
--- a/src/HOL/HOL.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/HOL.thy Fri Sep 02 13:41:55 2022 +0200
@@ -745,13 +745,13 @@
subsubsection \<open>Atomizing elimination rules\<close>
lemma atomize_exL[atomize_elim]: "(\<And>x. P x \<Longrightarrow> Q) \<equiv> ((\<exists>x. P x) \<Longrightarrow> Q)"
- by rule iprover+
+ by (rule equal_intr_rule) iprover+
lemma atomize_conjL[atomize_elim]: "(A \<Longrightarrow> B \<Longrightarrow> C) \<equiv> (A \<and> B \<Longrightarrow> C)"
- by rule iprover+
+ by (rule equal_intr_rule) iprover+
lemma atomize_disjL[atomize_elim]: "((A \<Longrightarrow> C) \<Longrightarrow> (B \<Longrightarrow> C) \<Longrightarrow> C) \<equiv> ((A \<or> B \<Longrightarrow> C) \<Longrightarrow> C)"
- by rule iprover+
+ by (rule equal_intr_rule) iprover+
lemma atomize_elimL[atomize_elim]: "(\<And>B. (A \<Longrightarrow> B) \<Longrightarrow> B) \<equiv> Trueprop A" ..
@@ -1923,7 +1923,7 @@
by (rule ext equal_eq)+
lemma equal_refl: "equal x x \<longleftrightarrow> True"
- unfolding equal by rule+
+ unfolding equal by (rule iffI TrueI refl)+
lemma eq_equal: "(=) \<equiv> equal"
by (rule eq_reflection) (rule ext, rule ext, rule sym, rule equal_eq)
--- a/src/HOL/HOLCF/README.html Sat Jun 25 13:34:41 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
-<html>
-
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>HOLCF/README</title>
-</head>
-
-<body>
-
-<h3>HOLCF: A higher-order version of LCF based on Isabelle/HOL</h3>
-
-HOLCF is the definitional extension of Church's Higher-Order Logic with
-Scott's Logic for Computable Functions that has been implemented in the
-theorem prover Isabelle. This results in a flexible setup for reasoning
-about functional programs. HOLCF supports standard domain theory (in particular
-fixpoint reasoning and recursive domain equations) but also coinductive
-arguments about lazy datatypes.
-
-<p>
-
-The most recent description of HOLCF is found here:
-
-<ul>
- <li><a href="http://web.cecs.pdx.edu/~brianh/phdthesis.html">HOLCF '11: A Definitional Domain Theory for Verifying Functional Programs</a>, <br>
- Brian Huffman.<br>
- Ph.D. thesis, Portland State University.<br>
- Year: 2012.
-</ul>
-
-Descriptions of earlier versions can also be found online:
-
-<ul>
- <li><a href="/~nipkow/pubs/jfp99.html">HOLCF = HOL+LCF</a>
-</ul>
-
-A detailed description (in German) of the entire development can be found in:
-
-<ul>
- <li><a href="http://www4.informatik.tu-muenchen.de/publ/papers/Diss_Regensbu.pdf">HOLCF: eine konservative Erweiterung von HOL um LCF</a>, <br>
- Franz Regensburger.<br>
- Dissertation Technische Universität München.<br>
- Year: 1994.
-</ul>
-
-A short survey is available in:
-<ul>
- <li><a href="http://www4.informatik.tu-muenchen.de/publ/papers/Regensburger_HOLT1995.pdf">HOLCF: Higher Order Logic of Computable Functions</a><br>
-</ul>
-
-</body>
-
-</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/HOLCF/README.thy Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,37 @@
+theory README imports Main
+begin
+
+section \<open>HOLCF: A higher-order version of LCF based on Isabelle/HOL\<close>
+
+text \<open>
+ HOLCF is the definitional extension of Church's Higher-Order Logic with
+ Scott's Logic for Computable Functions that has been implemented in the
+ theorem prover Isabelle. This results in a flexible setup for reasoning
+ about functional programs. HOLCF supports standard domain theory (in
+ particular fixpoint reasoning and recursive domain equations) but also
+ coinductive arguments about lazy datatypes.
+
+ The most recent description of HOLCF is found here:
+
+ \<^item> \<^emph>\<open>HOLCF '11: A Definitional Domain Theory for Verifying Functional
+ Programs\<close> \<^url>\<open>http://web.cecs.pdx.edu/~brianh/phdthesis.html\<close>, Brian
+ Huffman. Ph.D. thesis, Portland State University. 2012.
+
+ Descriptions of earlier versions can also be found online:
+
+ \<^item> \<^emph>\<open>HOLCF = HOL+LCF\<close> \<^url>\<open>https://www21.in.tum.de/~nipkow/pubs/jfp99.html\<close>
+
+ A detailed description (in German) of the entire development can be found
+ in:
+
+ \<^item> \<^emph>\<open>HOLCF: eine konservative Erweiterung von HOL um LCF\<close>
+ \<^url>\<open>http://www4.informatik.tu-muenchen.de/publ/papers/Diss_Regensbu.pdf\<close>,
+ Franz Regensburger. Dissertation Technische Universität München. 1994.
+
+ A short survey is available in:
+
+ \<^item> \<^emph>\<open>HOLCF: Higher Order Logic of Computable Functions\<close>
+ \<^url>\<open>http://www4.informatik.tu-muenchen.de/publ/papers/Regensburger_HOLT1995.pdf\<close>
+\<close>
+
+end
--- a/src/HOL/Hoare/README.html Sat Jun 25 13:34:41 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
-<HTML>
-
-<HEAD>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <TITLE>HOL/Hoare/ReadMe</TITLE>
-</HEAD>
-
-<BODY>
-
-<H2>Hoare Logic for a Simple WHILE Language</H2>
-
-<H3>Language and logic</H3>
-
-This directory contains an implementation of Hoare logic for a simple WHILE
-language. The constructs are
-<UL>
-<LI> <kbd>SKIP</kbd>
-<LI> <kbd>_ := _</kbd>
-<LI> <kbd>_ ; _</kbd>
-<LI> <kbd>IF _ THEN _ ELSE _ FI</kbd>
-<LI> <kbd>WHILE _ INV {_} DO _ OD</kbd>
-</UL>
-Note that each WHILE-loop must be annotated with an invariant.
-<P>
-
-After loading theory Hoare, you can state goals of the form
-<PRE>
-VARS x y ... {P} prog {Q}
-</PRE>
-where <kbd>prog</kbd> is a program in the above language, <kbd>P</kbd> is the
-precondition, <kbd>Q</kbd> the postcondition, and <kbd>x y ...</kbd> is the
-list of all <i>program variables</i> in <kbd>prog</kbd>. The latter list must
-be nonempty and it must include all variables that occur on the left-hand
-side of an assignment in <kbd>prog</kbd>. Example:
-<PRE>
-VARS x {x = a} x := x+1 {x = a+1}
-</PRE>
-The (normal) variable <kbd>a</kbd> is merely used to record the initial
-value of <kbd>x</kbd> and is not a program variable. Pre/post conditions
-can be arbitrary HOL formulae mentioning both program variables and normal
-variables.
-<P>
-
-The implementation hides reasoning in Hoare logic completely and provides a
-method <kbd>vcg</kbd> for transforming a goal in Hoare logic into an
-equivalent list of verification conditions in HOL:
-<PRE>
-apply vcg
-</PRE>
-If you want to simplify the resulting verification conditions at the same
-time:
-<PRE>
-apply vcg_simp
-</PRE>
-which, given the example goal above, solves it completely. For further
-examples see <a href="Examples.html">Examples</a>.
-<P>
-
-IMPORTANT:
-This is a logic of partial correctness. You can only prove that your program
-does the right thing <i>if</i> it terminates, but not <i>that</i> it
-terminates.
-A logic of total correctness is also provided and described below.
-
-<H3>Total correctness</H3>
-
-To prove termination, each WHILE-loop must be annotated with a variant:
-<UL>
-<LI> <kbd>WHILE _ INV {_} VAR {_} DO _ OD</kbd>
-</UL>
-A variant is an expression with type <kbd>nat</kbd>, which may use program
-variables and normal variables.
-<P>
-
-A total-correctness goal has the form
-<PRE>
-VARS x y ... [P] prog [Q]
-</PRE>
-enclosing the pre- and postcondition in square brackets.
-<P>
-
-Methods <kbd>vcg_tc</kbd> and <kbd>vcg_tc_simp</kbd> can be used to derive
-verification conditions.
-<P>
-
-From a total-correctness proof, a function can be extracted which
-for every input satisfying the precondition returns an output
-satisfying the postcondition.
-
-<H3>Notes on the implementation</H3>
-
-The implementation loosely follows
-<P>
-Mike Gordon.
-<cite>Mechanizing Programming Logics in Higher Order Logic.</cite><BR>
-University of Cambridge, Computer Laboratory, TR 145, 1988.
-<P>
-published as
-<P>
-Mike Gordon.
-<cite>Mechanizing Programming Logics in Higher Order Logic.</cite><BR>
-In
-<cite>Current Trends in Hardware Verification and Automated Theorem Proving
-</cite>,<BR>
-edited by G. Birtwistle and P.A. Subrahmanyam, Springer-Verlag, 1989.
-<P>
-
-The main differences: the state is modelled as a tuple as suggested in
-<P>
-J. von Wright and J. Hekanaho and P. Luostarinen and T. Langbacka.
-<cite>Mechanizing Some Advanced Refinement Concepts</cite>.
-Formal Methods in System Design, 3, 1993, 49-81.
-<P>
-and the embeding is deep, i.e. there is a concrete datatype of programs. The
-latter is not really necessary.
-</BODY>
-</HTML>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/Hoare/README.thy Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,93 @@
+theory README imports Main
+begin
+
+section \<open>Hoare Logic for a Simple WHILE Language\<close>
+
+subsection \<open>Language and logic\<close>
+
+text \<open>
+ This directory contains an implementation of Hoare logic for a simple WHILE
+ language. The constructs are
+
+ \<^item> \<^verbatim>\<open>SKIP\<close>
+ \<^item> \<^verbatim>\<open>_ := _\<close>
+ \<^item> \<^verbatim>\<open>_ ; _\<close>
+ \<^item> \<^verbatim>\<open>IF _ THEN _ ELSE _ FI\<close>
+ \<^item> \<^verbatim>\<open>WHILE _ INV {_} DO _ OD\<close>
+
+ Note that each WHILE-loop must be annotated with an invariant.
+
+ Within the context of theory \<^verbatim>\<open>Hoare\<close>, you can state goals of the form
+ @{verbatim [display] \<open>VARS x y ... {P} prog {Q}\<close>}
+ where \<^verbatim>\<open>prog\<close> is a program in the above language, \<^verbatim>\<open>P\<close> is the precondition,
+ \<^verbatim>\<open>Q\<close> the postcondition, and \<^verbatim>\<open>x y ...\<close> is the list of all \<^emph>\<open>program
+ variables\<close> in \<^verbatim>\<open>prog\<close>. The latter list must be nonempty and it must include
+ all variables that occur on the left-hand side of an assignment in \<^verbatim>\<open>prog\<close>.
+ Example:
+ @{verbatim [display] \<open>VARS x {x = a} x := x+1 {x = a+1}\<close>}
+ The (normal) variable \<^verbatim>\<open>a\<close> is merely used to record the initial value of
+ \<^verbatim>\<open>x\<close> and is not a program variable. Pre/post conditions can be arbitrary HOL
+ formulae mentioning both program variables and normal variables.
+
+ The implementation hides reasoning in Hoare logic completely and provides a
+ method \<^verbatim>\<open>vcg\<close> for transforming a goal in Hoare logic into an equivalent list
+ of verification conditions in HOL: \<^theory_text>\<open>apply vcg\<close>
+
+ If you want to simplify the resulting verification conditions at the same
+ time: \<^theory_text>\<open>apply vcg_simp\<close> which, given the example goal above, solves it
+ completely. For further examples see \<^file>\<open>Examples.thy\<close>.
+
+ \<^bold>\<open>IMPORTANT:\<close>
+ This is a logic of partial correctness. You can only prove that your program
+ does the right thing \<^emph>\<open>if\<close> it terminates, but not \<^emph>\<open>that\<close> it terminates. A
+ logic of total correctness is also provided and described below.
+\<close>
+
+
+subsection \<open>Total correctness\<close>
+
+text \<open>
+ To prove termination, each WHILE-loop must be annotated with a variant:
+
+ \<^item> \<^verbatim>\<open>WHILE _ INV {_} VAR {_} DO _ OD\<close>
+
+ A variant is an expression with type \<^verbatim>\<open>nat\<close>, which may use program variables
+ and normal variables.
+
+ A total-correctness goal has the form \<^verbatim>\<open>VARS x y ... [P] prog [Q]\<close> enclosing
+ the pre- and postcondition in square brackets.
+
+ Methods \<^verbatim>\<open>vcg_tc\<close> and \<^verbatim>\<open>vcg_tc_simp\<close> can be used to derive verification
+ conditions.
+
+ From a total-correctness proof, a function can be extracted which for every
+ input satisfying the precondition returns an output satisfying the
+ postcondition.
+\<close>
+
+
+subsection \<open>Notes on the implementation\<close>
+
+text \<open>
+ The implementation loosely follows
+
+ Mike Gordon. \<^emph>\<open>Mechanizing Programming Logics in Higher Order Logic\<close>.
+ University of Cambridge, Computer Laboratory, TR 145, 1988.
+
+ published as
+
+ Mike Gordon. \<^emph>\<open>Mechanizing Programming Logics in Higher Order Logic\<close>. In
+ \<^emph>\<open>Current Trends in Hardware Verification and Automated Theorem Proving\<close>,
+ edited by G. Birtwistle and P.A. Subrahmanyam, Springer-Verlag, 1989.
+
+ The main differences: the state is modelled as a tuple as suggested in
+
+ J. von Wright and J. Hekanaho and P. Luostarinen and T. Langbacka.
+ \<^emph>\<open>Mechanizing Some Advanced Refinement Concepts\<close>. Formal Methods in System
+ Design, 3, 1993, 49-81.
+
+ and the embeding is deep, i.e. there is a concrete datatype of programs. The
+ latter is not really necessary.
+\<close>
+
+end
--- a/src/HOL/Imperative_HOL/Heap_Monad.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Imperative_HOL/Heap_Monad.thy Fri Sep 02 13:41:55 2022 +0200
@@ -605,14 +605,13 @@
def toList: List[A] = array.toList.asInstanceOf[List[A]]
override def toString: String = array.mkString("Array.T(", ",", ")")
}
- def make[A](n: BigInt)(f: BigInt => A): T[A] =
- {
- val m = n.toInt
- val a = new T[A](m)
- for (i <- 0 until m) a(i) = f(i)
+ def init[A](n: Int)(f: Int => A): T[A] = {
+ val a = new T[A](n)
+ for (i <- 0 until n) a(i) = f(i)
a
}
- def alloc[A](n: BigInt)(x: A): T[A] = make(n)(_ => x)
+ def make[A](n: BigInt)(f: BigInt => A): T[A] = init(n.toInt)((i: Int) => f(BigInt(i)))
+ def alloc[A](n: BigInt)(x: A): T[A] = init(n.toInt)(_ => x)
def len[A](a: T[A]): BigInt = BigInt(a.length)
def nth[A](a: T[A], n: BigInt): A = a(n.toInt)
def upd[A](a: T[A], n: BigInt, x: A): Unit = a.update(n.toInt, x)
--- a/src/HOL/Int.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Int.thy Fri Sep 02 13:41:55 2022 +0200
@@ -53,7 +53,7 @@
lift_definition times_int :: "int \<Rightarrow> int \<Rightarrow> int"
is "\<lambda>(x, y) (u, v). (x*u + y*v, x*v + y*u)"
-proof (clarsimp)
+proof (unfold intrel_def, clarify)
fix s t u v w x y z :: nat
assume "s + v = u + t" and "w + z = y + x"
then have "(s + v) * w + (u + t) * x + u * (w + z) + v * (y + x) =
@@ -140,7 +140,7 @@
assumes "k \<ge> (0::int)" shows "\<exists>n. k = int n"
proof -
have "b \<le> a \<Longrightarrow> \<exists>n::nat. a = n + b" for a b
- by (rule_tac x="a - b" in exI) simp
+ using exI[of _ "a - b"] by simp
with assms show ?thesis
by transfer auto
qed
@@ -149,7 +149,7 @@
assumes "k > (0::int)" shows "\<exists>n>0. k = int n"
proof -
have "b < a \<Longrightarrow> \<exists>n::nat. n>0 \<and> a = n + b" for a b
- by (rule_tac x="a - b" in exI) simp
+ using exI[of _ "a - b"] by simp
with assms show ?thesis
by transfer auto
qed
@@ -189,7 +189,14 @@
for w z :: int
proof -
have "\<And>a b c d. a + d < c + b \<Longrightarrow> \<exists>n. c + b = Suc (a + n + d)"
- by (rule_tac x="c+b - Suc(a+d)" in exI) arith
+ proof -
+ fix a b c d :: nat
+ assume "a + d < c + b"
+ then have "c + b = Suc (a + (c + b - Suc (a + d)) + d) "
+ by arith
+ then show "\<exists>n. c + b = Suc (a + n + d)"
+ by (rule exI)
+ qed
then show ?thesis
by transfer auto
qed
@@ -474,14 +481,20 @@
instance int :: no_top
proof
- show "\<And>x::int. \<exists>y. x < y"
- by (rule_tac x="x + 1" in exI) simp
+ fix x::int
+ have "x < x + 1"
+ by simp
+ then show "\<exists>y. x < y"
+ by (rule exI)
qed
instance int :: no_bot
proof
- show "\<And>x::int. \<exists>y. y < x"
- by (rule_tac x="x - 1" in exI) simp
+ fix x::int
+ have "x - 1< x"
+ by simp
+ then show "\<exists>y. y < x"
+ by (rule exI)
qed
@@ -639,7 +652,7 @@
"nat (of_bool P) = of_bool P"
by auto
-lemma split_nat [arith_split]: "P (nat i) \<longleftrightarrow> ((\<forall>n. i = int n \<longrightarrow> P n) \<and> (i < 0 \<longrightarrow> P 0))"
+lemma split_nat [linarith_split]: "P (nat i) \<longleftrightarrow> ((\<forall>n. i = int n \<longrightarrow> P n) \<and> (i < 0 \<longrightarrow> P 0))"
(is "?P = (?L \<and> ?R)")
for i :: int
proof (cases "i < 0")
@@ -724,21 +737,18 @@
lemma zadd_int_left: "int m + (int n + z) = int (m + n) + z"
by simp
-text \<open>
- This version is proved for all ordered rings, not just integers!
- It is proved here because attribute \<open>arith_split\<close> is not available
- in theory \<open>Rings\<close>.
- But is it really better than just rewriting with \<open>abs_if\<close>?
-\<close>
-lemma abs_split [arith_split, no_atp]: "P \<bar>a\<bar> \<longleftrightarrow> (0 \<le> a \<longrightarrow> P a) \<and> (a < 0 \<longrightarrow> P (- a))"
- for a :: "'a::linordered_idom"
- by (force dest: order_less_le_trans simp add: abs_if linorder_not_less)
-
lemma negD:
assumes "x < 0" shows "\<exists>n. x = - (int (Suc n))"
proof -
have "\<And>a b. a < b \<Longrightarrow> \<exists>n. Suc (a + n) = b"
- by (rule_tac x="b - Suc a" in exI) arith
+ proof -
+ fix a b:: nat
+ assume "a < b"
+ then have "Suc (a + (b - Suc a)) = b"
+ by arith
+ then show "\<exists>n. Suc (a + n) = b"
+ by (rule exI)
+ qed
with assms show ?thesis
by transfer auto
qed
@@ -1148,9 +1158,9 @@
proof (rule Ints_cases [OF \<open>x \<in> Ints\<close>])
fix z::int
assume "x = of_int z"
- with \<open>x \<noteq> 0\<close>
+ with \<open>x \<noteq> 0\<close>
show "1 \<le> \<bar>x\<bar>"
- apply (auto simp add: abs_if)
+ apply (auto simp: abs_if)
by (metis diff_0 of_int_1 of_int_le_iff of_int_minus zle_diff1_eq)
qed
@@ -1425,7 +1435,7 @@
obtain i where "i \<le> n - m" "k = f (m + i)"
using nat_ivt_aux [of "n - m" "f \<circ> plus m" k] assms by auto
with assms show ?thesis
- by (rule_tac x = "m + i" in exI) auto
+ using exI[of _ "m + i"] by auto
qed
lemma nat0_intermed_int_val:
--- a/src/HOL/Lattices_Big.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Lattices_Big.thy Fri Sep 02 13:41:55 2022 +0200
@@ -1042,16 +1042,22 @@
lemma ex_has_greatest_nat_lemma:
"P k \<Longrightarrow> \<forall>x. P x \<longrightarrow> (\<exists>y. P y \<and> \<not> f y \<le> f x) \<Longrightarrow> \<exists>y. P y \<and> \<not> f y < f k + n"
for f :: "'a \<Rightarrow> nat"
-by (induct n) (force simp: le_Suc_eq)+
+ by (induct n) (force simp: le_Suc_eq)+
lemma ex_has_greatest_nat:
- "P k \<Longrightarrow> \<forall>y. P y \<longrightarrow> f y < b \<Longrightarrow> \<exists>x. P x \<and> (\<forall>y. P y \<longrightarrow> f y \<le> f x)"
- for f :: "'a \<Rightarrow> nat"
-apply (rule ccontr)
-apply (cut_tac P = P and n = "b - f k" in ex_has_greatest_nat_lemma)
- apply (subgoal_tac [3] "f k \<le> b")
- apply auto
-done
+ assumes "P k"
+ and "\<forall>y. P y \<longrightarrow> (f:: 'a \<Rightarrow> nat) y < b"
+shows "\<exists>x. P x \<and> (\<forall>y. P y \<longrightarrow> f y \<le> f x)"
+proof (rule ccontr)
+ assume "\<nexists>x. P x \<and> (\<forall>y. P y \<longrightarrow> f y \<le> f x)"
+ then have "\<forall>x. P x \<longrightarrow> (\<exists>y. P y \<and> \<not> f y \<le> f x)"
+ by auto
+ then have "\<exists>y. P y \<and> \<not> f y < f k + (b - f k)"
+ using assms ex_has_greatest_nat_lemma[of P k f "b - f k"]
+ by blast
+ then show "False"
+ using assms by auto
+qed
lemma arg_max_nat_lemma:
"\<lbrakk> P k; \<forall>y. P y \<longrightarrow> f y < b \<rbrakk>
--- a/src/HOL/Library/Char_ord.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Library/Char_ord.thy Fri Sep 02 13:41:55 2022 +0200
@@ -8,85 +8,6 @@
imports Main
begin
-context linordered_semidom
-begin
-
-lemma horner_sum_nonnegative:
- \<open>0 \<le> horner_sum of_bool 2 bs\<close>
- by (induction bs) simp_all
-
-end
-
-context unique_euclidean_semiring_numeral
-begin
-
-lemma horner_sum_bound:
- \<open>horner_sum of_bool 2 bs < 2 ^ length bs\<close>
-proof (induction bs)
- case Nil
- then show ?case
- by simp
-next
- case (Cons b bs)
- moreover define a where \<open>a = 2 ^ length bs - horner_sum of_bool 2 bs\<close>
- ultimately have *: \<open>2 ^ length bs = horner_sum of_bool 2 bs + a\<close>
- by simp
- have \<open>1 < a * 2\<close> if \<open>0 < a\<close>
- using that add_mono [of 1 a 1 a]
- by (simp add: mult_2_right discrete)
- with Cons show ?case
- by (simp add: algebra_simps *)
-qed
-
-end
-
-context unique_euclidean_semiring_numeral
-begin
-
-lemma horner_sum_less_eq_iff_lexordp_eq:
- \<open>horner_sum of_bool 2 bs \<le> horner_sum of_bool 2 cs \<longleftrightarrow> lexordp_eq (rev bs) (rev cs)\<close>
- if \<open>length bs = length cs\<close>
-proof -
- have \<open>horner_sum of_bool 2 (rev bs) \<le> horner_sum of_bool 2 (rev cs) \<longleftrightarrow> lexordp_eq bs cs\<close>
- if \<open>length bs = length cs\<close> for bs cs
- using that proof (induction bs cs rule: list_induct2)
- case Nil
- then show ?case
- by simp
- next
- case (Cons b bs c cs)
- with horner_sum_nonnegative [of \<open>rev bs\<close>] horner_sum_nonnegative [of \<open>rev cs\<close>]
- horner_sum_bound [of \<open>rev bs\<close>] horner_sum_bound [of \<open>rev cs\<close>]
- show ?case
- by (auto simp add: horner_sum_append not_le Cons intro: add_strict_increasing2 add_increasing)
- qed
- from that this [of \<open>rev bs\<close> \<open>rev cs\<close>] show ?thesis
- by simp
-qed
-
-lemma horner_sum_less_iff_lexordp:
- \<open>horner_sum of_bool 2 bs < horner_sum of_bool 2 cs \<longleftrightarrow> ord_class.lexordp (rev bs) (rev cs)\<close>
- if \<open>length bs = length cs\<close>
-proof -
- have \<open>horner_sum of_bool 2 (rev bs) < horner_sum of_bool 2 (rev cs) \<longleftrightarrow> ord_class.lexordp bs cs\<close>
- if \<open>length bs = length cs\<close> for bs cs
- using that proof (induction bs cs rule: list_induct2)
- case Nil
- then show ?case
- by simp
- next
- case (Cons b bs c cs)
- with horner_sum_nonnegative [of \<open>rev bs\<close>] horner_sum_nonnegative [of \<open>rev cs\<close>]
- horner_sum_bound [of \<open>rev bs\<close>] horner_sum_bound [of \<open>rev cs\<close>]
- show ?case
- by (auto simp add: horner_sum_append not_less Cons intro: add_strict_increasing2 add_increasing)
- qed
- from that this [of \<open>rev bs\<close> \<open>rev cs\<close>] show ?thesis
- by simp
-qed
-
-end
-
instantiation char :: linorder
begin
--- a/src/HOL/Library/Code_Abstract_Char.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Library/Code_Abstract_Char.thy Fri Sep 02 13:41:55 2022 +0200
@@ -17,13 +17,19 @@
by (simp add: integer_of_char_def)
lemma char_of_integer_code [code]:
- \<open>integer_of_char (char_of_integer k) = take_bit 8 k\<close>
- by (simp add: integer_of_char_def char_of_integer_def take_bit_eq_mod)
+ \<open>integer_of_char (char_of_integer k) = (if 0 \<le> k \<and> k < 256 then k else k mod 256)\<close>
+ by (simp add: integer_of_char_def char_of_integer_def integer_eq_iff integer_less_eq_iff integer_less_iff)
-context comm_semiring_1
-begin
+lemma of_char_code [code]:
+ \<open>of_char c = of_nat (nat_of_integer (integer_of_char c))\<close>
+proof -
+ have \<open>int_of_integer (of_char c) = of_char c\<close>
+ by (cases c) simp
+ then show ?thesis
+ by (simp add: integer_of_char_def nat_of_integer_def of_nat_of_char)
+qed
-definition byte :: \<open>bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> 'a\<close>
+definition byte :: \<open>bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> bool \<Rightarrow> integer\<close>
where [simp]: \<open>byte b0 b1 b2 b3 b4 b5 b6 b7 = horner_sum of_bool 2 [b0, b1, b2, b3, b4, b5, b6, b7]\<close>
lemma byte_code [code]:
@@ -40,12 +46,10 @@
in s7)\<close>
by simp
-end
-
lemma Char_code [code]:
\<open>integer_of_char (Char b0 b1 b2 b3 b4 b5 b6 b7) = byte b0 b1 b2 b3 b4 b5 b6 b7\<close>
by (simp add: integer_of_char_def)
-
+
lemma digit_0_code [code]:
\<open>digit0 c \<longleftrightarrow> bit (integer_of_char c) 0\<close>
by (cases c) (simp add: integer_of_char_def)
@@ -100,7 +104,7 @@
then have \<open>(0 :: integer) \<le> of_char c\<close>
by (simp only: of_nat_0 of_nat_of_char)
ultimately show ?thesis
- by (simp add: Let_def integer_of_char_def take_bit_eq_mod unique_euclidean_semiring_numeral_class.mod_less)
+ by (simp add: Let_def integer_of_char_def take_bit_eq_mod integer_eq_iff integer_less_eq_iff integer_less_iff)
next
case False
then have \<open>(128 :: integer) \<le> of_char c\<close>
@@ -113,7 +117,7 @@
then have \<open>of_char c = k + 128\<close>
by simp
ultimately show ?thesis
- by (simp add: Let_def integer_of_char_def take_bit_eq_mod unique_euclidean_semiring_numeral_class.mod_less)
+ by (simp add: Let_def integer_of_char_def take_bit_eq_mod integer_eq_iff integer_less_eq_iff integer_less_iff)
qed
lemma equal_char_code [code]:
--- a/src/HOL/Library/Code_Abstract_Nat.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Library/Code_Abstract_Nat.thy Fri Sep 02 13:41:55 2022 +0200
@@ -114,7 +114,11 @@
\<close>
-subsection \<open>One candidate which needs special treatment\<close>
+subsection \<open>Candidates which need special treatment\<close>
+
+lemma drop_bit_int_code [code]:
+ \<open>drop_bit n k = k div 2 ^ n\<close> for k :: int
+ by (fact drop_bit_eq_div)
lemma take_bit_num_code [code]:
\<open>take_bit_num n Num.One =
--- a/src/HOL/Library/Code_Binary_Nat.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Library/Code_Binary_Nat.thy Fri Sep 02 13:41:55 2022 +0200
@@ -127,13 +127,13 @@
"nat_of_num k < nat_of_num l \<longleftrightarrow> k < l"
by (simp_all add: nat_of_num_numeral)
-declare [[code drop: Divides.divmod_nat]]
+declare [[code drop: Euclidean_Division.divmod_nat]]
lemma divmod_nat_code [code]:
- "Divides.divmod_nat (nat_of_num k) (nat_of_num l) = divmod k l"
- "Divides.divmod_nat m 0 = (0, m)"
- "Divides.divmod_nat 0 n = (0, 0)"
- by (simp_all add: prod_eq_iff nat_of_num_numeral)
+ "Euclidean_Division.divmod_nat (nat_of_num k) (nat_of_num l) = divmod k l"
+ "Euclidean_Division.divmod_nat m 0 = (0, m)"
+ "Euclidean_Division.divmod_nat 0 n = (0, 0)"
+ by (simp_all add: Euclidean_Division.divmod_nat_def nat_of_num_numeral)
end
--- a/src/HOL/Library/Code_Real_Approx_By_Float.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Library/Code_Real_Approx_By_Float.thy Fri Sep 02 13:41:55 2022 +0200
@@ -1,4 +1,6 @@
(* Title: HOL/Library/Code_Real_Approx_By_Float.thy
+ Author: Jesús Aransay <jesus-maria.aransay at unirioja.es>
+ Author: Jose Divasón <jose.divasonm at unirioja.es>
Author: Florian Haftmann
Author: Johannes Hölzl
Author: Tobias Nipkow
@@ -20,191 +22,157 @@
purposes.
\<close>
-code_printing
- type_constructor real \<rightharpoonup>
- (SML) "real"
- and (OCaml) "float"
-
-code_printing
- constant Ratreal \<rightharpoonup>
- (SML) "error/ \"Bad constant: Ratreal\""
-
-code_printing
- constant "0 :: real" \<rightharpoonup>
- (SML) "0.0"
- and (OCaml) "0.0"
+context
+begin
-code_printing
- constant "1 :: real" \<rightharpoonup>
- (SML) "1.0"
- and (OCaml) "1.0"
-
-code_printing
- constant "HOL.equal :: real \<Rightarrow> real \<Rightarrow> bool" \<rightharpoonup>
- (SML) "Real.== ((_), (_))"
- and (OCaml) "Pervasives.(=)"
+qualified definition real_of_integer :: "integer \<Rightarrow> real"
+ where [code_abbrev]: "real_of_integer = of_int \<circ> int_of_integer"
-code_printing
- constant "Orderings.less_eq :: real \<Rightarrow> real \<Rightarrow> bool" \<rightharpoonup>
- (SML) "Real.<= ((_), (_))"
- and (OCaml) "Pervasives.(<=)"
-
-code_printing
- constant "Orderings.less :: real \<Rightarrow> real \<Rightarrow> bool" \<rightharpoonup>
- (SML) "Real.< ((_), (_))"
- and (OCaml) "Pervasives.(<)"
+end
-code_printing
- constant "(+) :: real \<Rightarrow> real \<Rightarrow> real" \<rightharpoonup>
- (SML) "Real.+ ((_), (_))"
- and (OCaml) "Pervasives.( +. )"
-
-code_printing
- constant "(*) :: real \<Rightarrow> real \<Rightarrow> real" \<rightharpoonup>
- (SML) "Real.* ((_), (_))"
- and (OCaml) "Pervasives.( *. )"
-
-code_printing
- constant "(-) :: real \<Rightarrow> real \<Rightarrow> real" \<rightharpoonup>
- (SML) "Real.- ((_), (_))"
- and (OCaml) "Pervasives.( -. )"
+code_datatype Code_Real_Approx_By_Float.real_of_integer \<open>(/) :: real \<Rightarrow> real \<Rightarrow> real\<close>
-code_printing
- constant "uminus :: real \<Rightarrow> real" \<rightharpoonup>
- (SML) "Real.~"
- and (OCaml) "Pervasives.( ~-. )"
-
-code_printing
- constant "(/) :: real \<Rightarrow> real \<Rightarrow> real" \<rightharpoonup>
- (SML) "Real.'/ ((_), (_))"
- and (OCaml) "Pervasives.( '/. )"
+lemma [code_unfold del]: "numeral k \<equiv> real_of_rat (numeral k)"
+ by simp
-code_printing
- constant "HOL.equal :: real \<Rightarrow> real \<Rightarrow> bool" \<rightharpoonup>
- (SML) "Real.== ((_:real), (_))"
-
-code_printing
- constant "sqrt :: real \<Rightarrow> real" \<rightharpoonup>
- (SML) "Math.sqrt"
- and (OCaml) "Pervasives.sqrt"
-declare sqrt_def[code del]
+lemma [code_unfold del]: "- numeral k \<equiv> real_of_rat (- numeral k)"
+ by simp
context
begin
-qualified definition real_exp :: "real \<Rightarrow> real"
- where "real_exp = exp"
+qualified definition real_of_int :: \<open>int \<Rightarrow> real\<close>
+ where [code_abbrev]: \<open>real_of_int = of_int\<close>
+
+lemma [code]: "real_of_int = Code_Real_Approx_By_Float.real_of_integer \<circ> integer_of_int"
+ by (simp add: fun_eq_iff Code_Real_Approx_By_Float.real_of_integer_def real_of_int_def)
+
+qualified definition exp_real :: \<open>real \<Rightarrow> real\<close>
+ where [code_abbrev, code del]: \<open>exp_real = exp\<close>
-lemma exp_eq_real_exp [code_unfold]: "exp = real_exp"
- unfolding real_exp_def ..
+qualified definition sin_real :: \<open>real \<Rightarrow> real\<close>
+ where [code_abbrev, code del]: \<open>sin_real = sin\<close>
+
+qualified definition cos_real :: \<open>real \<Rightarrow> real\<close>
+ where [code_abbrev, code del]: \<open>cos_real = cos\<close>
+
+qualified definition tan_real :: \<open>real \<Rightarrow> real\<close>
+ where [code_abbrev, code del]: \<open>tan_real = tan\<close>
end
-code_printing
- constant Code_Real_Approx_By_Float.real_exp \<rightharpoonup>
- (SML) "Math.exp"
- and (OCaml) "Pervasives.exp"
-declare Code_Real_Approx_By_Float.real_exp_def[code del]
-declare exp_def[code del]
+lemma [code]: \<open>Ratreal r = (case quotient_of r of (p, q) \<Rightarrow> real_of_int p / real_of_int q)\<close>
+ by (cases r) (simp add: quotient_of_Fract of_rat_rat)
-code_printing
- constant ln \<rightharpoonup>
- (SML) "Math.ln"
- and (OCaml) "Pervasives.ln"
-declare ln_real_def[code del]
-
-code_printing
- constant cos \<rightharpoonup>
- (SML) "Math.cos"
- and (OCaml) "Pervasives.cos"
-declare cos_def[code del]
-
-code_printing
- constant sin \<rightharpoonup>
- (SML) "Math.sin"
- and (OCaml) "Pervasives.sin"
-declare sin_def[code del]
+lemma [code]: \<open>inverse r = 1 / r\<close> for r :: real
+ by (fact inverse_eq_divide)
-code_printing
- constant pi \<rightharpoonup>
- (SML) "Math.pi"
- and (OCaml) "Pervasives.pi"
-declare pi_def[code del]
-
-code_printing
- constant arctan \<rightharpoonup>
- (SML) "Math.atan"
- and (OCaml) "Pervasives.atan"
-declare arctan_def[code del]
+declare [[code drop: \<open>HOL.equal :: real \<Rightarrow> real \<Rightarrow> bool\<close>
+ \<open>(\<le>) :: real \<Rightarrow> real \<Rightarrow> bool\<close>
+ \<open>(<) :: real \<Rightarrow> real \<Rightarrow> bool\<close>
+ \<open>plus :: real \<Rightarrow> real \<Rightarrow> real\<close>
+ \<open>times :: real \<Rightarrow> real \<Rightarrow> real\<close>
+ \<open>uminus :: real \<Rightarrow> real\<close>
+ \<open>minus :: real \<Rightarrow> real \<Rightarrow> real\<close>
+ \<open>divide :: real \<Rightarrow> real \<Rightarrow> real\<close>
+ sqrt
+ \<open>ln :: real \<Rightarrow> real\<close>
+ pi
+ arcsin
+ arccos
+ arctan]]
-code_printing
- constant arccos \<rightharpoonup>
- (SML) "Math.scos"
- and (OCaml) "Pervasives.acos"
-declare arccos_def[code del]
-
-code_printing
- constant arcsin \<rightharpoonup>
- (SML) "Math.asin"
- and (OCaml) "Pervasives.asin"
-declare arcsin_def[code del]
-
-definition real_of_integer :: "integer \<Rightarrow> real"
- where "real_of_integer = of_int \<circ> int_of_integer"
+code_reserved SML Real
code_printing
- constant real_of_integer \<rightharpoonup>
+ type_constructor real \<rightharpoonup>
+ (SML) "real"
+ and (OCaml) "float"
+ and (Haskell) "Prelude.Double" (*Double precision*)
+| constant "0 :: real" \<rightharpoonup>
+ (SML) "0.0"
+ and (OCaml) "0.0"
+ and (Haskell) "0.0"
+| constant "1 :: real" \<rightharpoonup>
+ (SML) "1.0"
+ and (OCaml) "1.0"
+ and (Haskell) "1.0"
+| constant "HOL.equal :: real \<Rightarrow> real \<Rightarrow> bool" \<rightharpoonup>
+ (SML) "Real.== ((_), (_))"
+ and (OCaml) "Pervasives.(=)"
+ and (Haskell) infix 4 "=="
+| class_instance real :: "HOL.equal" => (Haskell) - (*This is necessary. See the tutorial on code generation, page 29*)
+| constant "(\<le>) :: real \<Rightarrow> real \<Rightarrow> bool" \<rightharpoonup>
+ (SML) "Real.<= ((_), (_))"
+ and (OCaml) "Pervasives.(<=)"
+ and (Haskell) infix 4 "<="
+| constant "(<) :: real \<Rightarrow> real \<Rightarrow> bool" \<rightharpoonup>
+ (SML) "Real.< ((_), (_))"
+ and (OCaml) "Pervasives.(<)"
+ and (Haskell) infix 4 "<"
+| constant "(+) :: real \<Rightarrow> real \<Rightarrow> real" \<rightharpoonup>
+ (SML) "Real.+ ((_), (_))"
+ and (OCaml) "Pervasives.( +. )"
+ and (Haskell) infixl 6 "+"
+| constant "(*) :: real \<Rightarrow> real \<Rightarrow> real" \<rightharpoonup>
+ (SML) "Real.* ((_), (_))"
+ and (Haskell) infixl 7 "*"
+| constant "uminus :: real \<Rightarrow> real" \<rightharpoonup>
+ (SML) "Real.~"
+ and (OCaml) "Pervasives.( ~-. )"
+ and (Haskell) "negate"
+| constant "(-) :: real \<Rightarrow> real \<Rightarrow> real" \<rightharpoonup>
+ (SML) "Real.- ((_), (_))"
+ and (OCaml) "Pervasives.( -. )"
+ and (Haskell) infixl 6 "-"
+| constant "(/) :: real \<Rightarrow> real \<Rightarrow> real" \<rightharpoonup>
+ (SML) "Real.'/ ((_), (_))"
+ and (OCaml) "Pervasives.( '/. )"
+ and (Haskell) infixl 7 "/"
+| constant "sqrt :: real \<Rightarrow> real" \<rightharpoonup>
+ (SML) "Math.sqrt"
+ and (OCaml) "Pervasives.sqrt"
+ and (Haskell) "Prelude.sqrt"
+| constant Code_Real_Approx_By_Float.exp_real \<rightharpoonup>
+ (SML) "Math.exp"
+ and (OCaml) "Pervasives.exp"
+ and (Haskell) "Prelude.exp"
+| constant ln \<rightharpoonup>
+ (SML) "Math.ln"
+ and (OCaml) "Pervasives.ln"
+ and (Haskell) "Prelude.log"
+| constant Code_Real_Approx_By_Float.sin_real \<rightharpoonup>
+ (SML) "Math.sin"
+ and (OCaml) "Pervasives.sin"
+ and (Haskell) "Prelude.sin"
+| constant Code_Real_Approx_By_Float.cos_real \<rightharpoonup>
+ (SML) "Math.cos"
+ and (OCaml) "Pervasives.cos"
+ and (Haskell) "Prelude.cos"
+| constant Code_Real_Approx_By_Float.tan_real \<rightharpoonup>
+ (SML) "Math.tan"
+ and (OCaml) "Pervasives.tan"
+ and (Haskell) "Prelude.tan"
+| constant pi \<rightharpoonup>
+ (SML) "Math.pi"
+ (*missing in OCaml*)
+ and (Haskell) "Prelude.pi"
+| constant arcsin \<rightharpoonup>
+ (SML) "Math.asin"
+ and (OCaml) "Pervasives.asin"
+ and (Haskell) "Prelude.asin"
+| constant arccos \<rightharpoonup>
+ (SML) "Math.scos"
+ and (OCaml) "Pervasives.acos"
+ and (Haskell) "Prelude.acos"
+| constant arctan \<rightharpoonup>
+ (SML) "Math.atan"
+ and (OCaml) "Pervasives.atan"
+ and (Haskell) "Prelude.atan"
+| constant Code_Real_Approx_By_Float.real_of_integer \<rightharpoonup>
(SML) "Real.fromInt"
and (OCaml) "Pervasives.float/ (Big'_int.to'_int (_))"
-
-context
-begin
-
-qualified definition real_of_int :: "int \<Rightarrow> real"
- where [code_abbrev]: "real_of_int = of_int"
-
-lemma [code]: "real_of_int = real_of_integer \<circ> integer_of_int"
- by (simp add: fun_eq_iff real_of_integer_def real_of_int_def)
-
-lemma [code_unfold del]: "0 \<equiv> (of_rat 0 :: real)"
- by simp
-
-lemma [code_unfold del]: "1 \<equiv> (of_rat 1 :: real)"
- by simp
-
-lemma [code_unfold del]: "numeral k \<equiv> (of_rat (numeral k) :: real)"
- by simp
-
-lemma [code_unfold del]: "- numeral k \<equiv> (of_rat (- numeral k) :: real)"
- by simp
-
-end
-
-code_printing
- constant Ratreal \<rightharpoonup> (SML)
-
-definition Realfract :: "int \<Rightarrow> int \<Rightarrow> real"
- where "Realfract p q = of_int p / of_int q"
-
-code_datatype Realfract
-
-code_printing
- constant Realfract \<rightharpoonup> (SML) "Real.fromInt _/ '// Real.fromInt _"
-
-lemma [code]: "Ratreal r = case_prod Realfract (quotient_of r)"
- by (cases r) (simp add: Realfract_def quotient_of_Fract of_rat_rat)
-
-declare [[code drop: "HOL.equal :: real \<Rightarrow> real \<Rightarrow> bool"
- "plus :: real \<Rightarrow> real \<Rightarrow> real"
- "uminus :: real \<Rightarrow> real"
- "minus :: real \<Rightarrow> real \<Rightarrow> real"
- "times :: real \<Rightarrow> real \<Rightarrow> real"
- "divide :: real \<Rightarrow> real \<Rightarrow> real"
- "(<) :: real \<Rightarrow> real \<Rightarrow> bool"
- "(\<le>) :: real \<Rightarrow> real \<Rightarrow> bool"]]
-
-lemma [code]: "inverse r = 1 / r" for r :: real
- by (fact inverse_eq_divide)
+ and (Haskell) "Prelude.fromIntegral (_)"
notepad
begin
--- a/src/HOL/Library/Code_Target_Int.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Library/Code_Target_Int.thy Fri Sep 02 13:41:55 2022 +0200
@@ -116,11 +116,11 @@
lemma gcd_int_of_integer [code]:
"gcd (int_of_integer x) (int_of_integer y) = int_of_integer (gcd x y)"
-by transfer rule
+ by transfer rule
lemma lcm_int_of_integer [code]:
"lcm (int_of_integer x) (int_of_integer y) = int_of_integer (lcm x y)"
-by transfer rule
+ by transfer rule
end
@@ -159,6 +159,64 @@
including integer.lifting unfolding integer_of_char_def int_of_char_def
by transfer (simp add: fun_eq_iff)
+context
+ includes integer.lifting bit_operations_syntax
+begin
+
+declare [[code drop: \<open>bit :: int \<Rightarrow> _\<close> \<open>not :: int \<Rightarrow> _\<close>
+ \<open>and :: int \<Rightarrow> _\<close> \<open>or :: int \<Rightarrow> _\<close> \<open>xor :: int \<Rightarrow> _\<close>
+ \<open>push_bit :: _ \<Rightarrow> _ \<Rightarrow> int\<close> \<open>drop_bit :: _ \<Rightarrow> _ \<Rightarrow> int\<close> \<open>take_bit :: _ \<Rightarrow> _ \<Rightarrow> int\<close>]]
+
+lemma [code]:
+ \<open>bit (int_of_integer k) n \<longleftrightarrow> bit k n\<close>
+ by transfer rule
+
+lemma [code]:
+ \<open>NOT (int_of_integer k) = int_of_integer (NOT k)\<close>
+ by transfer rule
+
+lemma [code]:
+ \<open>int_of_integer k AND int_of_integer l = int_of_integer (k AND l)\<close>
+ by transfer rule
+
+lemma [code]:
+ \<open>int_of_integer k OR int_of_integer l = int_of_integer (k OR l)\<close>
+ by transfer rule
+
+lemma [code]:
+ \<open>int_of_integer k XOR int_of_integer l = int_of_integer (k XOR l)\<close>
+ by transfer rule
+
+lemma [code]:
+ \<open>push_bit n (int_of_integer k) = int_of_integer (push_bit n k)\<close>
+ by transfer rule
+
+lemma [code]:
+ \<open>drop_bit n (int_of_integer k) = int_of_integer (drop_bit n k)\<close>
+ by transfer rule
+
+lemma [code]:
+ \<open>take_bit n (int_of_integer k) = int_of_integer (take_bit n k)\<close>
+ by transfer rule
+
+lemma [code]:
+ \<open>mask n = int_of_integer (mask n)\<close>
+ by transfer rule
+
+lemma [code]:
+ \<open>set_bit n (int_of_integer k) = int_of_integer (set_bit n k)\<close>
+ by transfer rule
+
+lemma [code]:
+ \<open>unset_bit n (int_of_integer k) = int_of_integer (unset_bit n k)\<close>
+ by transfer rule
+
+lemma [code]:
+ \<open>flip_bit n (int_of_integer k) = int_of_integer (flip_bit n k)\<close>
+ by transfer rule
+
+end
+
code_identifier
code_module Code_Target_Int \<rightharpoonup>
(SML) Arith and (OCaml) Arith and (Haskell) Arith
--- a/src/HOL/Library/Code_Target_Nat.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Library/Code_Target_Nat.thy Fri Sep 02 13:41:55 2022 +0200
@@ -98,13 +98,13 @@
begin
lemma divmod_nat_code [code]: \<^marker>\<open>contributor \<open>René Thiemann\<close>\<close> \<^marker>\<open>contributor \<open>Akihisa Yamada\<close>\<close>
- "Divides.divmod_nat m n = (
+ "Euclidean_Division.divmod_nat m n = (
let k = integer_of_nat m; l = integer_of_nat n
in map_prod nat_of_integer nat_of_integer
(if k = 0 then (0, 0)
else if l = 0 then (0, k) else
Code_Numeral.divmod_abs k l))"
- by (simp add: prod_eq_iff Let_def; transfer)
+ by (simp add: prod_eq_iff Let_def Euclidean_Division.divmod_nat_def; transfer)
(simp add: nat_div_distrib nat_mod_distrib)
end
@@ -136,15 +136,12 @@
lemma (in semiring_1) of_nat_code_if:
"of_nat n = (if n = 0 then 0
else let
- (m, q) = Divides.divmod_nat n 2;
+ (m, q) = Euclidean_Division.divmod_nat n 2;
m' = 2 * of_nat m
in if q = 0 then m' else m' + 1)"
-proof -
- from div_mult_mod_eq have *: "of_nat n = of_nat (n div 2 * 2 + n mod 2)" by simp
- show ?thesis
- by (simp add: Let_def divmod_nat_def of_nat_add [symmetric])
- (simp add: * mult.commute of_nat_mult add.commute)
-qed
+ by (cases n)
+ (simp_all add: Let_def Euclidean_Division.divmod_nat_def ac_simps
+ flip: of_nat_numeral of_nat_mult minus_mod_eq_mult_div)
declare of_nat_code_if [code]
--- a/src/HOL/Library/FuncSet.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Library/FuncSet.thy Fri Sep 02 13:41:55 2022 +0200
@@ -686,6 +686,82 @@
by (simp add: PiE_insert_eq inj_combinator card_image card_cartesian_product)
qed
+lemma card_funcsetE: "finite A \<Longrightarrow> card (A \<rightarrow>\<^sub>E B) = card B ^ card A"
+ by (subst card_PiE, auto)
+
+lemma card_inj_on_subset_funcset: assumes finB: "finite B"
+ and finC: "finite C"
+ and AB: "A \<subseteq> B"
+shows "card {f \<in> B \<rightarrow>\<^sub>E C. inj_on f A} =
+ card C^(card B - card A) * prod ((-) (card C)) {0 ..< card A}"
+proof -
+ define D where "D = B - A"
+ from AB have B: "B = A \<union> D" and disj: "A \<inter> D = {}" unfolding D_def by auto
+ have sub: "card B - card A = card D" unfolding D_def using finB AB
+ by (metis card_Diff_subset finite_subset)
+ have "finite A" "finite D" using finB unfolding B by auto
+ thus ?thesis unfolding sub unfolding B using disj
+ proof (induct A rule: finite_induct)
+ case empty
+ from card_funcsetE[OF this(1), of C] show ?case by auto
+ next
+ case (insert a A)
+ have "{f. f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f (insert a A)}
+ = {f(a := c) | f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}"
+ (is "?l = ?r")
+ proof
+ show "?r \<subseteq> ?l"
+ by (auto intro: inj_on_fun_updI split: if_splits)
+ {
+ fix f
+ assume f: "f \<in> ?l"
+ let ?g = "f(a := undefined)"
+ let ?h = "?g(a := f a)"
+ have mem: "f a \<in> C - ?g ` A" using insert(1,2,4,5) f by auto
+ from f have f: "f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C" "inj_on f (insert a A)" by auto
+ hence "?g \<in> A \<union> D \<rightarrow>\<^sub>E C" "inj_on ?g A" using \<open>a \<notin> A\<close> \<open>insert a A \<inter> D = {}\<close>
+ by (auto split: if_splits simp: inj_on_def)
+ with mem have "?h \<in> ?r" by blast
+ also have "?h = f" by auto
+ finally have "f \<in> ?r" .
+ }
+ thus "?l \<subseteq> ?r" by auto
+ qed
+ also have "\<dots> = (\<lambda> (f, c). f (a := c)) `
+ (Sigma {f . f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A} (\<lambda> f. C - f ` A))"
+ by auto
+ also have "card (...) = card (Sigma {f . f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A} (\<lambda> f. C - f ` A))"
+ proof (rule card_image, intro inj_onI, clarsimp, goal_cases)
+ case (1 f c g d)
+ let ?f = "f(a := c, a := undefined)"
+ let ?g = "g(a := d, a := undefined)"
+ from 1 have id: "f(a := c) = g(a := d)" by auto
+ from fun_upd_eqD[OF id]
+ have cd: "c = d" by auto
+ from id have "?f = ?g" by auto
+ also have "?f = f" using `f \<in> A \<union> D \<rightarrow>\<^sub>E C` insert(1,2,4,5)
+ by (intro ext, auto)
+ also have "?g = g" using `g \<in> A \<union> D \<rightarrow>\<^sub>E C` insert(1,2,4,5)
+ by (intro ext, auto)
+ finally show "f = g \<and> c = d" using cd by auto
+ qed
+ also have "\<dots> = (\<Sum>f\<in>{f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}. card (C - f ` A))"
+ by (rule card_SigmaI, rule finite_subset[of _ "A \<union> D \<rightarrow>\<^sub>E C"],
+ insert \<open>finite C\<close> \<open>finite D\<close> \<open>finite A\<close>, auto intro!: finite_PiE)
+ also have "\<dots> = (\<Sum>f\<in>{f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}. card C - card A)"
+ by (rule sum.cong[OF refl], subst card_Diff_subset, insert \<open>finite A\<close>, auto simp: card_image)
+ also have "\<dots> = (card C - card A) * card {f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}"
+ by simp
+ also have "\<dots> = card C ^ card D * ((card C - card A) * prod ((-) (card C)) {0..<card A})"
+ using insert by (auto simp: ac_simps)
+ also have "(card C - card A) * prod ((-) (card C)) {0..<card A} =
+ prod ((-) (card C)) {0..<Suc (card A)}" by simp
+ also have "Suc (card A) = card (insert a A)" using insert by auto
+ finally show ?case .
+ qed
+qed
+
+
subsection \<open>The pigeonhole principle\<close>
text \<open>
--- a/src/HOL/Library/IArray.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Library/IArray.thy Fri Sep 02 13:41:55 2022 +0200
@@ -148,8 +148,10 @@
let l = k - 1 in p (sub' (as, l)) \<or> exists_upto p l as)"
proof (cases "k \<ge> 1")
case False
+ then have \<open>k \<le> 0\<close>
+ including integer.lifting by transfer simp
then show ?thesis
- by (auto simp add: not_le discrete)
+ by simp
next
case True
then have less: "k \<le> 0 \<longleftrightarrow> False"
--- a/src/HOL/Library/Infinite_Set.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Library/Infinite_Set.thy Fri Sep 02 13:41:55 2022 +0200
@@ -267,6 +267,10 @@
"infinite S \<Longrightarrow> enumerate S m < enumerate S n \<longleftrightarrow> m < n"
by (metis enumerate_mono less_asym less_linear)
+lemma enumerate_mono_le_iff [simp]:
+ "infinite S \<Longrightarrow> enumerate S m \<le> enumerate S n \<longleftrightarrow> m \<le> n"
+ by (meson enumerate_mono_iff not_le)
+
lemma le_enumerate:
assumes S: "infinite S"
shows "n \<le> enumerate S n"
--- a/src/HOL/Library/Library.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Library/Library.thy Fri Sep 02 13:41:55 2022 +0200
@@ -54,6 +54,7 @@
Monad_Syntax
More_List
Multiset_Order
+ NList
Nonpos_Ints
Numeral_Type
Omega_Words_Fun
--- a/src/HOL/Library/List_Lenlexorder.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Library/List_Lenlexorder.thy Fri Sep 02 13:41:55 2022 +0200
@@ -3,6 +3,8 @@
section \<open>Lexicographic order on lists\<close>
+text \<open>This version prioritises length and can yield wellorderings\<close>
+
theory List_Lenlexorder
imports Main
begin
@@ -51,6 +53,14 @@
by (auto simp add: total_on_def list_le_def list_less_def)
qed
+instance list :: (wellorder) wellorder
+proof
+ fix P :: "'a list \<Rightarrow> bool" and a
+ assume "\<And>x. (\<And>y. y < x \<Longrightarrow> P y) \<Longrightarrow> P x"
+ then show "P a"
+ unfolding list_less_def by (metis wf_lenlex wf_induct wf_lenlex wf)
+qed
+
instantiation list :: (linorder) distrib_lattice
begin
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/Library/NList.thy Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,104 @@
+(* Author: Tobias Nipkow
+ Copyright 2000 TUM
+*)
+
+section \<open>Fixed Length Lists\<close>
+
+theory NList
+imports Main
+begin
+
+definition nlists :: "nat \<Rightarrow> 'a set \<Rightarrow> 'a list set"
+ where "nlists n A = {xs. size xs = n \<and> set xs \<subseteq> A}"
+
+lemma nlistsI: "\<lbrakk> size xs = n; set xs \<subseteq> A \<rbrakk> \<Longrightarrow> xs \<in> nlists n A"
+ by (simp add: nlists_def)
+
+text \<open>These [simp] attributes are double-edged.
+ Many proofs in Jinja rely on it but they can degrade performance.\<close>
+
+lemma nlistsE_length [simp]: "xs \<in> nlists n A \<Longrightarrow> size xs = n"
+ by (simp add: nlists_def)
+
+lemma less_lengthI: "\<lbrakk> xs \<in> nlists n A; p < n \<rbrakk> \<Longrightarrow> p < size xs"
+by (simp)
+
+lemma nlistsE_set[simp]: "xs \<in> nlists n A \<Longrightarrow> set xs \<subseteq> A"
+unfolding nlists_def by (simp)
+
+lemma nlists_mono:
+assumes "A \<subseteq> B" shows "nlists n A \<subseteq> nlists n B"
+proof
+ fix xs assume "xs \<in> nlists n A"
+ then obtain size: "size xs = n" and inA: "set xs \<subseteq> A" by (simp)
+ with assms have "set xs \<subseteq> B" by simp
+ with size show "xs \<in> nlists n B" by(clarsimp intro!: nlistsI)
+qed
+
+lemma nlists_n_0 [simp]: "nlists 0 A = {[]}"
+unfolding nlists_def by (auto)
+
+lemma in_nlists_Suc_iff: "(xs \<in> nlists (Suc n) A) = (\<exists>y\<in>A. \<exists>ys \<in> nlists n A. xs = y#ys)"
+unfolding nlists_def by (cases "xs") auto
+
+lemma Cons_in_nlists_Suc [iff]: "(x#xs \<in> nlists (Suc n) A) \<longleftrightarrow> (x\<in>A \<and> xs \<in> nlists n A)"
+unfolding nlists_def by (auto)
+
+lemma nlists_not_empty: "A\<noteq>{} \<Longrightarrow> \<exists>xs. xs \<in> nlists n A"
+by (induct "n") (auto simp: in_nlists_Suc_iff)
+
+
+lemma nlistsE_nth_in: "\<lbrakk> xs \<in> nlists n A; i < n \<rbrakk> \<Longrightarrow> xs!i \<in> A"
+unfolding nlists_def by (auto)
+
+lemma nlists_Cons_Suc [elim!]:
+ "l#xs \<in> nlists n A \<Longrightarrow> (\<And>n'. n = Suc n' \<Longrightarrow> l \<in> A \<Longrightarrow> xs \<in> nlists n' A \<Longrightarrow> P) \<Longrightarrow> P"
+unfolding nlists_def by (auto)
+
+lemma nlists_appendE [elim!]:
+ "a@b \<in> nlists n A \<Longrightarrow> (\<And>n1 n2. n=n1+n2 \<Longrightarrow> a \<in> nlists n1 A \<Longrightarrow> b \<in> nlists n2 A \<Longrightarrow> P) \<Longrightarrow> P"
+proof -
+ have "\<And>n. a@b \<in> nlists n A \<Longrightarrow> \<exists>n1 n2. n=n1+n2 \<and> a \<in> nlists n1 A \<and> b \<in> nlists n2 A"
+ (is "\<And>n. ?list a n \<Longrightarrow> \<exists>n1 n2. ?P a n n1 n2")
+ proof (induct a)
+ fix n assume "?list [] n"
+ hence "?P [] n 0 n" by simp
+ thus "\<exists>n1 n2. ?P [] n n1 n2" by fast
+ next
+ fix n l ls
+ assume "?list (l#ls) n"
+ then obtain n' where n: "n = Suc n'" "l \<in> A" and n': "ls@b \<in> nlists n' A" by fastforce
+ assume "\<And>n. ls @ b \<in> nlists n A \<Longrightarrow> \<exists>n1 n2. n = n1 + n2 \<and> ls \<in> nlists n1 A \<and> b \<in> nlists n2 A"
+ from this and n' have "\<exists>n1 n2. n' = n1 + n2 \<and> ls \<in> nlists n1 A \<and> b \<in> nlists n2 A" .
+ then obtain n1 n2 where "n' = n1 + n2" "ls \<in> nlists n1 A" "b \<in> nlists n2 A" by fast
+ with n have "?P (l#ls) n (n1+1) n2" by simp
+ thus "\<exists>n1 n2. ?P (l#ls) n n1 n2" by fastforce
+ qed
+ moreover assume "a@b \<in> nlists n A" "\<And>n1 n2. n=n1+n2 \<Longrightarrow> a \<in> nlists n1 A \<Longrightarrow> b \<in> nlists n2 A \<Longrightarrow> P"
+ ultimately show ?thesis by blast
+qed
+
+
+lemma nlists_update_in_list [simp, intro!]:
+ "\<lbrakk> xs \<in> nlists n A; x\<in>A \<rbrakk> \<Longrightarrow> xs[i := x] \<in> nlists n A"
+ by (metis length_list_update nlistsE_length nlistsE_set nlistsI set_update_subsetI)
+
+lemma nlists_appendI [intro?]:
+ "\<lbrakk> a \<in> nlists n A; b \<in> nlists m A \<rbrakk> \<Longrightarrow> a @ b \<in> nlists (n+m) A"
+unfolding nlists_def by (auto)
+
+lemma nlists_append:
+ "xs @ ys \<in> nlists k A \<longleftrightarrow>
+ k = length(xs @ ys) \<and> xs \<in> nlists (length xs) A \<and> ys \<in> nlists (length ys) A"
+unfolding nlists_def by (auto)
+
+lemma nlists_map [simp]: "(map f xs \<in> nlists (size xs) A) = (f ` set xs \<subseteq> A)"
+unfolding nlists_def by (auto)
+
+lemma nlists_replicateI [intro]: "x \<in> A \<Longrightarrow> replicate n x \<in> nlists n A"
+ by (induct n) auto
+
+lemma nlists_set[code]: "nlists n (set xs) = set (List.n_lists n xs)"
+unfolding nlists_def by (rule sym, induct n) (auto simp: image_iff length_Suc_conv)
+
+end
--- a/src/HOL/Library/RBT_Impl.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Library/RBT_Impl.thy Fri Sep 02 13:41:55 2022 +0200
@@ -1154,24 +1154,24 @@
else if n = 1 then
case kvs of (k, v) # kvs' \<Rightarrow>
(Branch R Empty k v Empty, kvs')
- else let (n', r) = Divides.divmod_nat n 2 in
+ else let (n', r) = Euclidean_Division.divmod_nat n 2 in
if r = 0 then
case rbtreeify_f n' kvs of (t1, (k, v) # kvs') \<Rightarrow>
apfst (Branch B t1 k v) (rbtreeify_g n' kvs')
else case rbtreeify_f n' kvs of (t1, (k, v) # kvs') \<Rightarrow>
apfst (Branch B t1 k v) (rbtreeify_f n' kvs'))"
-by (subst rbtreeify_f.simps) (simp only: Let_def divmod_nat_def prod.case)
+by (subst rbtreeify_f.simps) (simp only: Let_def Euclidean_Division.divmod_nat_def prod.case)
lemma rbtreeify_g_code [code]:
"rbtreeify_g n kvs =
(if n = 0 \<or> n = 1 then (Empty, kvs)
- else let (n', r) = Divides.divmod_nat n 2 in
+ else let (n', r) = Euclidean_Division.divmod_nat n 2 in
if r = 0 then
case rbtreeify_g n' kvs of (t1, (k, v) # kvs') \<Rightarrow>
apfst (Branch B t1 k v) (rbtreeify_g n' kvs')
else case rbtreeify_f n' kvs of (t1, (k, v) # kvs') \<Rightarrow>
apfst (Branch B t1 k v) (rbtreeify_g n' kvs'))"
-by(subst rbtreeify_g.simps)(simp only: Let_def divmod_nat_def prod.case)
+by(subst rbtreeify_g.simps)(simp only: Let_def Euclidean_Division.divmod_nat_def prod.case)
lemma Suc_double_half: "Suc (2 * n) div 2 = n"
by simp
--- a/src/HOL/Library/README.html Sat Jun 25 13:34:41 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
-<html>
-
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>HOL-Library/README</title>
-</head>
-
-<body>
-
-<h1>HOL-Library: supplemental theories for main Isabelle/HOL</h1>
-
-This is a collection of generic theories that may be used together
-with main Isabelle/HOL.
-
-<p>
-
-Addition of new theories should be done with some care, as the
-``module system'' of Isabelle is rather simplistic. The following
-guidelines may be helpful to achieve maximum re-usability and minimum
-clashes with existing developments.
-
-<dl>
-
-<dt><strong>Examples</strong>
-
-<dd>Theories should be as ``generic'' as is sensible. Unused (or
-rather unusable?) theories should be avoided; common applications
-should actually refer to the present theory. Small example uses may
-be included in the library as well, but should be put in a separate
-theory, such as <tt>Foobar</tt> accompanied by
-<tt>Foobar_Examples</tt>.
-
-<dt><strong>Theory names</strong>
-
-<dd>The theory loader name space is <em>flat</em>, so use sufficiently
-long and descriptive names to reduce the danger of clashes with the
-user's own theories. The convention for theory names is as follows:
-<tt>Foobar_Doobar</tt> (this looks best in LaTeX output).
-
-<dt><strong>Names of logical items</strong>
-
-<dd>There are separate hierarchically structured name spaces for
-types, constants, theorems etc. Nevertheless, some care should be
-taken, as the name spaces are always ``open''. Use adequate names;
-avoid unreadable abbreviations. The general naming convention is to
-separate word constituents by underscores, as in <tt>foo_bar</tt> or
-<tt>Foo_Bar</tt> (this looks best in LaTeX output).
-
-<dt><strong>Global context declarations</strong>
-
-<dd>Only items introduced in the present theory should be declared
-globally (e.g. as Simplifier rules). Note that adding and deleting
-rules from parent theories may result in strange behavior later,
-depending on the user's arrangement of import lists.
-
-<dt><strong>Spacing</strong>
-
-<dd>Isabelle is able to produce a high-quality LaTeX document from the
-theory sources, provided some minor issues are taken care of. In
-particular, spacing and line breaks are directly taken from source
-text. Incidentally, output looks very good if common type-setting
-conventions are observed: put a single space <em>after</em> each
-punctuation character ("<tt>,</tt>", "<tt>.</tt>", etc.), but none
-before it; do not extra spaces inside of parentheses; do not attempt
-to simulate table markup with spaces, avoid ``hanging'' indentations.
-
-</dl>
-
-</body>
-</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/Library/README.thy Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,43 @@
+theory README imports Main
+begin
+
+section \<open>HOL-Library: supplemental theories for main Isabelle/HOL\<close>
+
+text \<open>
+ This is a collection of generic theories that may be used together with main
+ Isabelle/HOL.
+
+ Addition of new theories should be done with some care, as the ``module
+ system'' of Isabelle is rather simplistic. The following guidelines may be
+ helpful to achieve maximum re-usability and minimum clashes with existing
+ developments.
+
+ \<^descr>[Examples] Theories should be as ``generic'' as is sensible. Unused (or
+ rather unusable?) theories should be avoided; common applications should
+ actually refer to the present theory. Small example uses may be included in
+ the library as well, but should be put in a separate theory, such as
+ \<^verbatim>\<open>Foobar.thy\<close> accompanied by \<^verbatim>\<open>Foobar_Examples.thy\<close>.
+
+ \<^descr>[Names of logical items] There are separate hierarchically structured name
+ spaces for types, constants, theorems etc. Nevertheless, some care should be
+ taken, as the name spaces are always ``open''. Use adequate names; avoid
+ unreadable abbreviations. The general naming convention is to separate word
+ constituents by underscores, as in \<^verbatim>\<open>foo_bar\<close> or \<^verbatim>\<open>Foo_Bar\<close> (this looks best
+ in LaTeX output).
+
+ \<^descr>[Global context declarations] Only items introduced in the present theory
+ should be declared globally (e.g. as Simplifier rules). Note that adding and
+ deleting rules from parent theories may result in strange behavior later,
+ depending on the user's arrangement of import lists.
+
+ \<^descr>[Spacing] Isabelle is able to produce a high-quality LaTeX document from
+ the theory sources, provided some minor issues are taken care of. In
+ particular, spacing and line breaks are directly taken from source text.
+ Incidentally, output looks very good if common type-setting conventions are
+ observed: put a single space \<^emph>\<open>after\<close> each punctuation character ("\<^verbatim>\<open>,\<close>",
+ "\<^verbatim>\<open>.\<close>", etc.), but none before it; do not extra spaces inside of
+ parentheses; do not attempt to simulate table markup with spaces, avoid
+ ``hanging'' indentations.
+\<close>
+
+end
--- a/src/HOL/Library/Signed_Division.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Library/Signed_Division.thy Fri Sep 02 13:41:55 2022 +0200
@@ -7,9 +7,41 @@
imports Main
begin
-class signed_division =
- fixes signed_divide :: \<open>'a \<Rightarrow> 'a \<Rightarrow> 'a\<close> (infixl "sdiv" 70)
- and signed_modulo :: \<open>'a \<Rightarrow> 'a \<Rightarrow> 'a\<close> (infixl "smod" 70)
+class signed_division = comm_semiring_1_cancel +
+ fixes signed_divide :: \<open>'a \<Rightarrow> 'a \<Rightarrow> 'a\<close> (infixl \<open>sdiv\<close> 70)
+ and signed_modulo :: \<open>'a \<Rightarrow> 'a \<Rightarrow> 'a\<close> (infixl \<open>smod\<close> 70)
+ assumes sdiv_mult_smod_eq: \<open>a sdiv b * b + a smod b = a\<close>
+begin
+
+lemma mult_sdiv_smod_eq:
+ \<open>b * (a sdiv b) + a smod b = a\<close>
+ using sdiv_mult_smod_eq [of a b] by (simp add: ac_simps)
+
+lemma smod_sdiv_mult_eq:
+ \<open>a smod b + a sdiv b * b = a\<close>
+ using sdiv_mult_smod_eq [of a b] by (simp add: ac_simps)
+
+lemma smod_mult_sdiv_eq:
+ \<open>a smod b + b * (a sdiv b) = a\<close>
+ using sdiv_mult_smod_eq [of a b] by (simp add: ac_simps)
+
+lemma minus_sdiv_mult_eq_smod:
+ \<open>a - a sdiv b * b = a smod b\<close>
+ by (rule add_implies_diff [symmetric]) (fact smod_sdiv_mult_eq)
+
+lemma minus_mult_sdiv_eq_smod:
+ \<open>a - b * (a sdiv b) = a smod b\<close>
+ by (rule add_implies_diff [symmetric]) (fact smod_mult_sdiv_eq)
+
+lemma minus_smod_eq_sdiv_mult:
+ \<open>a - a smod b = a sdiv b * b\<close>
+ by (rule add_implies_diff [symmetric]) (fact sdiv_mult_smod_eq)
+
+lemma minus_smod_eq_mult_sdiv:
+ \<open>a - a smod b = b * (a sdiv b)\<close>
+ by (rule add_implies_diff [symmetric]) (fact mult_sdiv_smod_eq)
+
+end
instantiation int :: signed_division
begin
@@ -18,12 +50,45 @@
where \<open>k sdiv l = sgn k * sgn l * (\<bar>k\<bar> div \<bar>l\<bar>)\<close> for k l :: int
definition signed_modulo_int :: \<open>int \<Rightarrow> int \<Rightarrow> int\<close>
- where \<open>k smod l = k - (k sdiv l) * l\<close> for k l :: int
+ where \<open>k smod l = sgn k * (\<bar>k\<bar> mod \<bar>l\<bar>)\<close> for k l :: int
-instance ..
+instance by standard
+ (simp add: signed_divide_int_def signed_modulo_int_def div_abs_eq mod_abs_eq algebra_simps)
end
+lemma divide_int_eq_signed_divide_int:
+ \<open>k div l = k sdiv l - of_bool (l \<noteq> 0 \<and> sgn k \<noteq> sgn l \<and> \<not> l dvd k)\<close>
+ for k l :: int
+ by (simp add: div_eq_div_abs [of k l] signed_divide_int_def)
+
+lemma signed_divide_int_eq_divide_int:
+ \<open>k sdiv l = k div l + of_bool (l \<noteq> 0 \<and> sgn k \<noteq> sgn l \<and> \<not> l dvd k)\<close>
+ for k l :: int
+ by (simp add: divide_int_eq_signed_divide_int)
+
+lemma modulo_int_eq_signed_modulo_int:
+ \<open>k mod l = k smod l + l * of_bool (sgn k \<noteq> sgn l \<and> \<not> l dvd k)\<close>
+ for k l :: int
+ by (simp add: mod_eq_mod_abs [of k l] signed_modulo_int_def)
+
+lemma signed_modulo_int_eq_modulo_int:
+ \<open>k smod l = k mod l - l * of_bool (sgn k \<noteq> sgn l \<and> \<not> l dvd k)\<close>
+ for k l :: int
+ by (simp add: modulo_int_eq_signed_modulo_int)
+
+lemma sdiv_int_div_0:
+ "(x :: int) sdiv 0 = 0"
+ by (clarsimp simp: signed_divide_int_def)
+
+lemma sdiv_int_0_div [simp]:
+ "0 sdiv (x :: int) = 0"
+ by (clarsimp simp: signed_divide_int_def)
+
+lemma smod_int_alt_def:
+ "(a::int) smod b = sgn (a) * (abs a mod abs b)"
+ by (fact signed_modulo_int_def)
+
lemma int_sdiv_simps [simp]:
"(a :: int) sdiv 1 = a"
"(a :: int) sdiv 0 = 0"
@@ -31,11 +96,13 @@
apply (auto simp: signed_divide_int_def sgn_if)
done
-lemma sgn_div_eq_sgn_mult:
- "a div b \<noteq> 0 \<Longrightarrow> sgn ((a :: int) div b) = sgn (a * b)"
- apply (clarsimp simp: sgn_if zero_le_mult_iff neg_imp_zdiv_nonneg_iff not_less)
- apply (metis less_le mult_le_0_iff neg_imp_zdiv_neg_iff not_less pos_imp_zdiv_neg_iff zdiv_eq_0_iff)
- done
+lemma smod_int_mod_0 [simp]:
+ "x smod (0 :: int) = x"
+ by (clarsimp simp: signed_modulo_int_def abs_mult_sgn ac_simps)
+
+lemma smod_int_0_mod [simp]:
+ "0 smod (x :: int) = 0"
+ by (clarsimp simp: smod_int_alt_def)
lemma sgn_sdiv_eq_sgn_mult:
"a sdiv b \<noteq> 0 \<Longrightarrow> sgn ((a :: int) sdiv b) = sgn (a * b)"
@@ -71,38 +138,17 @@
done
lemma sdiv_int_range:
- "(a :: int) sdiv b \<in> { - (abs a) .. (abs a) }"
- apply (unfold signed_divide_int_def)
- apply (subgoal_tac "(abs a) div (abs b) \<le> (abs a)")
- apply (auto simp add: sgn_if not_less)
- apply (metis le_less le_less_trans neg_equal_0_iff_equal neg_less_iff_less not_le pos_imp_zdiv_neg_iff)
- apply (metis add.inverse_neutral div_int_pos_iff le_less neg_le_iff_le order_trans)
- apply (metis div_minus_right le_less_trans neg_imp_zdiv_neg_iff neg_less_0_iff_less not_le)
- using div_int_pos_iff apply fastforce
- apply (auto simp add: abs_if not_less)
- apply (metis add.inverse_inverse add_0_left div_by_1 div_minus_right less_le neg_0_le_iff_le not_le not_one_le_zero zdiv_mono2 zless_imp_add1_zle)
- apply (metis div_by_1 neg_0_less_iff_less pos_imp_zdiv_pos_iff zdiv_mono2 zero_less_one)
- apply (metis add.inverse_neutral div_by_0 div_by_1 int_div_less_self int_one_le_iff_zero_less less_le less_minus_iff order_refl)
- apply (metis div_by_1 divide_int_def int_div_less_self less_le linorder_neqE_linordered_idom order_refl unique_euclidean_semiring_numeral_class.div_less)
- done
-
-lemma sdiv_int_div_0 [simp]:
- "(x :: int) sdiv 0 = 0"
- by (clarsimp simp: signed_divide_int_def)
-
-lemma sdiv_int_0_div [simp]:
- "0 sdiv (x :: int) = 0"
- by (clarsimp simp: signed_divide_int_def)
-
-lemma smod_int_alt_def:
- "(a::int) smod b = sgn (a) * (abs a mod abs b)"
- apply (clarsimp simp: signed_modulo_int_def signed_divide_int_def)
- apply (clarsimp simp: minus_div_mult_eq_mod [symmetric] abs_sgn sgn_mult sgn_if algebra_split_simps)
- done
+ \<open>a sdiv b \<in> {- \<bar>a\<bar>..\<bar>a\<bar>}\<close> for a b :: int
+ using zdiv_mono2 [of \<open>\<bar>a\<bar>\<close> 1 \<open>\<bar>b\<bar>\<close>]
+ by (cases \<open>b = 0\<close>; cases \<open>sgn b = sgn a\<close>)
+ (auto simp add: signed_divide_int_def pos_imp_zdiv_nonneg_iff
+ dest!: sgn_not_eq_imp intro: order_trans [of _ 0])
lemma smod_int_range:
- "b \<noteq> 0 \<Longrightarrow> (a::int) smod b \<in> { - abs b + 1 .. abs b - 1 }"
- apply (case_tac "b > 0")
+ \<open>a smod b \<in> {- \<bar>b\<bar> + 1..\<bar>b\<bar> - 1}\<close>
+ if \<open>b \<noteq> 0\<close> for a b :: int
+ using that
+ apply (cases \<open>b > 0\<close>)
apply (insert pos_mod_conj [where a=a and b=b])[1]
apply (insert pos_mod_conj [where a="-a" and b=b])[1]
apply (auto simp: smod_int_alt_def algebra_simps sgn_if
@@ -129,14 +175,6 @@
apply (auto simp: add1_zle_eq smod_int_alt_def sgn_if)
done
-lemma smod_int_mod_0 [simp]:
- "x smod (0 :: int) = x"
- by (clarsimp simp: signed_modulo_int_def)
-
-lemma smod_int_0_mod [simp]:
- "0 smod (x :: int) = 0"
- by (clarsimp simp: smod_int_alt_def)
-
lemma smod_mod_positive:
"\<lbrakk> 0 \<le> (a :: int); 0 \<le> b \<rbrakk> \<Longrightarrow> a smod b = a mod b"
by (clarsimp simp: smod_int_alt_def zsgn_def)
--- a/src/HOL/Library/Z2.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Library/Z2.thy Fri Sep 02 13:41:55 2022 +0200
@@ -140,7 +140,7 @@
\<open>a mod b = of_bool (odd a \<and> even b)\<close> for a b :: bit
by (simp add: modulo_bit_def Abs_bit_eq_of_bool Rep_bit_eq_odd)
-lemma power_bit_unfold [simp, code]:
+lemma power_bit_unfold [simp]:
\<open>a ^ n = of_bool (odd a \<or> n = 0)\<close> for a :: bit
by (cases a) simp_all
@@ -235,10 +235,12 @@
by (simp add: fun_eq_iff)
-lemma bit_numeral_even [simp]: "numeral (Num.Bit0 w) = (0 :: bit)"
+lemma bit_numeral_even [simp]:
+ \<open>numeral (Num.Bit0 n) = (0 :: bit)\<close>
by (simp only: Z2.bit_eq_iff even_numeral) simp
-lemma bit_numeral_odd [simp]: "numeral (Num.Bit1 w) = (1 :: bit)"
+lemma bit_numeral_odd [simp]:
+ \<open>numeral (Num.Bit1 n) = (1 :: bit)\<close>
by (simp only: Z2.bit_eq_iff odd_numeral) simp
end
--- a/src/HOL/Library/code_test.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Library/code_test.ML Fri Sep 02 13:41:55 2022 +0200
@@ -506,7 +506,7 @@
}\<close>
val _ = File.write code_path code
val _ = File.write driver_path driver
- val _ = Scala_Compiler.toplevel true (code ^ driver)
+ val _ = Scala_Compiler.toplevel (code ^ driver)
handle ERROR msg => error ("Evaluation for " ^ scalaN ^ " failed:\n" ^ msg)
in File.read out_path end
--- a/src/HOL/Matrix_LP/ComputeNumeral.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Matrix_LP/ComputeNumeral.thy Fri Sep 02 13:41:55 2022 +0200
@@ -51,10 +51,10 @@
one_div_minus_numeral one_mod_minus_numeral
numeral_div_numeral numeral_mod_numeral minus_numeral_div_numeral minus_numeral_mod_numeral
numeral_div_minus_numeral numeral_mod_minus_numeral
- div_minus_minus mod_minus_minus Divides.adjust_div_eq of_bool_eq one_neq_zero
+ div_minus_minus mod_minus_minus Euclidean_Division.adjust_div_eq of_bool_eq one_neq_zero
numeral_neq_zero neg_equal_0_iff_equal arith_simps arith_special divmod_trivial
- divmod_steps divmod_cancel divmod_step_eq fst_conv snd_conv numeral_One
- case_prod_beta rel_simps Divides.adjust_mod_def div_minus1_right mod_minus1_right
+ divmod_steps divmod_cancel divmod_step_def fst_conv snd_conv numeral_One
+ case_prod_beta rel_simps Euclidean_Division.adjust_mod_def div_minus1_right mod_minus1_right
minus_minus numeral_times_numeral mult_zero_right mult_1_right
--- a/src/HOL/Nat.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Nat.thy Fri Sep 02 13:41:55 2022 +0200
@@ -77,11 +77,20 @@
free_constructors case_nat for "0 :: nat" | Suc pred
where "pred (0 :: nat) = (0 :: nat)"
- apply atomize_elim
- apply (rename_tac n, induct_tac n rule: nat_induct0, auto)
- apply (simp add: Suc_def Nat_Abs_Nat_inject Nat_Rep_Nat Suc_RepI Suc_Rep_inject' Rep_Nat_inject)
- apply (simp only: Suc_not_Zero)
- done
+proof atomize_elim
+ fix n
+ show "n = 0 \<or> (\<exists>m. n = Suc m)"
+ by (induction n rule: nat_induct0) auto
+next
+ fix n m
+ show "(Suc n = Suc m) = (n = m)"
+ by (simp add: Suc_def Nat_Abs_Nat_inject Nat_Rep_Nat Suc_RepI Suc_Rep_inject' Rep_Nat_inject)
+next
+ fix n
+ show "0 \<noteq> Suc n"
+ by (simp add: Suc_not_Zero)
+qed
+
\<comment> \<open>Avoid name clashes by prefixing the output of \<open>old_rep_datatype\<close> with \<open>old\<close>.\<close>
setup \<open>Sign.mandatory_path "old"\<close>
@@ -1084,8 +1093,9 @@
and "\<And>n. n > 0 \<Longrightarrow> \<not> P n \<Longrightarrow> \<exists>m. m < n \<and> \<not> P m"
shows "P n"
proof (rule infinite_descent)
- show "\<And>n. \<not> P n \<Longrightarrow> \<exists>m<n. \<not> P m"
- using assms by (case_tac "n > 0") auto
+ fix n
+ show "\<not> P n \<Longrightarrow> \<exists>m<n. \<not> P m"
+ using assms by (cases "n > 0") auto
qed
text \<open>
@@ -1124,9 +1134,11 @@
proof -
from assms obtain n where "n = V x" by auto
moreover have "\<And>x. V x = n \<Longrightarrow> P x"
- proof (induct n rule: infinite_descent, auto)
- show "\<exists>m < V x. \<exists>y. V y = m \<and> \<not> P y" if "\<not> P x" for x
+ proof -
+ have "\<exists>m < V x. \<exists>y. V y = m \<and> \<not> P y" if "\<not> P x" for x
using assms and that by auto
+ then show "\<And>x. V x = n \<Longrightarrow> P x"
+ by (induct n rule: infinite_descent, auto)
qed
ultimately show "P x" by auto
qed
--- a/src/HOL/Nonstandard_Analysis/CLim.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Nonstandard_Analysis/CLim.thy Fri Sep 02 13:41:55 2022 +0200
@@ -20,22 +20,7 @@
text \<open>Changing the quantified variable. Install earlier?\<close>
lemma all_shift: "(\<forall>x::'a::comm_ring_1. P x) \<longleftrightarrow> (\<forall>x. P (x - a))"
- apply auto
- apply (drule_tac x = "x + a" in spec)
- apply (simp add: add.assoc)
- done
-
-lemma complex_add_minus_iff [simp]: "x + - a = 0 \<longleftrightarrow> x = a"
- for x a :: complex
- by (simp add: diff_eq_eq)
-
-lemma complex_add_eq_0_iff [iff]: "x + y = 0 \<longleftrightarrow> y = - x"
- for x y :: complex
- apply auto
- apply (drule sym [THEN diff_eq_eq [THEN iffD2]])
- apply auto
- done
-
+ by (metis add_diff_cancel)
subsection \<open>Limit of Complex to Complex Function\<close>
--- a/src/HOL/Nonstandard_Analysis/Examples/NSPrimes.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Nonstandard_Analysis/Examples/NSPrimes.thy Fri Sep 02 13:41:55 2022 +0200
@@ -26,12 +26,17 @@
lemma dvd_by_all2: "\<exists>N>0. \<forall>m. 0 < m \<and> m \<le> M \<longrightarrow> m dvd N"
for M :: nat
- apply (induct M)
- apply auto
- apply (rule_tac x = "N * Suc M" in exI)
- apply auto
- apply (metis dvdI dvd_add_times_triv_left_iff dvd_add_triv_right_iff dvd_refl dvd_trans le_Suc_eq mult_Suc_right)
- done
+proof (induct M)
+ case 0
+ then show ?case
+ by auto
+next
+ case (Suc M)
+ then obtain N where "N>0" and "\<And>m. 0 < m \<and> m \<le> M \<Longrightarrow> m dvd N"
+ by metis
+ then show ?case
+ by (metis nat_0_less_mult_iff zero_less_Suc dvd_mult dvd_mult2 dvd_refl le_Suc_eq)
+qed
lemma dvd_by_all: "\<forall>M::nat. \<exists>N>0. \<forall>m. 0 < m \<and> m \<le> M \<longrightarrow> m dvd N"
using dvd_by_all2 by blast
@@ -40,22 +45,13 @@
by transfer simp
text \<open>Goldblatt: Exercise 5.11(2) -- p. 57.\<close>
-lemma hdvd_by_all: "\<forall>M. \<exists>N. 0 < N \<and> (\<forall>m::hypnat. 0 < m \<and> m \<le> M \<longrightarrow> m dvd N)"
+lemma hdvd_by_all [rule_format]: "\<forall>M. \<exists>N. 0 < N \<and> (\<forall>m::hypnat. 0 < m \<and> m \<le> M \<longrightarrow> m dvd N)"
by transfer (rule dvd_by_all)
-lemmas hdvd_by_all2 = hdvd_by_all [THEN spec]
-
text \<open>Goldblatt: Exercise 5.11(2) -- p. 57.\<close>
lemma hypnat_dvd_all_hypnat_of_nat:
"\<exists>N::hypnat. 0 < N \<and> (\<forall>n \<in> - {0::nat}. hypnat_of_nat n dvd N)"
- apply (cut_tac hdvd_by_all)
- apply (drule_tac x = whn in spec)
- apply auto
- apply (rule exI)
- apply auto
- apply (drule_tac x = "hypnat_of_nat n" in spec)
- apply (auto simp add: linorder_not_less)
- done
+ by (metis Compl_iff gr0I hdvd_by_all hypnat_of_nat_le_whn singletonI star_of_0_less)
text \<open>The nonstandard extension of the set prime numbers consists of precisely
@@ -74,50 +70,12 @@
by (rule starset_finite)
-subsection \<open>Another characterization of infinite set of natural numbers\<close>
-
-lemma finite_nat_set_bounded: "finite N \<Longrightarrow> \<exists>n::nat. \<forall>i \<in> N. i < n"
- apply (erule_tac F = N in finite_induct)
- apply auto
- apply (rule_tac x = "Suc n + x" in exI)
- apply auto
- done
-
-lemma finite_nat_set_bounded_iff: "finite N \<longleftrightarrow> (\<exists>n::nat. \<forall>i \<in> N. i < n)"
- by (blast intro: finite_nat_set_bounded bounded_nat_set_is_finite)
-
-lemma not_finite_nat_set_iff: "\<not> finite N \<longleftrightarrow> (\<forall>n::nat. \<exists>i \<in> N. n \<le> i)"
- by (auto simp add: finite_nat_set_bounded_iff not_less)
-
-lemma bounded_nat_set_is_finite2: "\<forall>i::nat \<in> N. i \<le> n \<Longrightarrow> finite N"
- apply (rule finite_subset)
- apply (rule_tac [2] finite_atMost)
- apply auto
- done
-
-lemma finite_nat_set_bounded2: "finite N \<Longrightarrow> \<exists>n::nat. \<forall>i \<in> N. i \<le> n"
- apply (erule_tac F = N in finite_induct)
- apply auto
- apply (rule_tac x = "n + x" in exI)
- apply auto
- done
-
-lemma finite_nat_set_bounded_iff2: "finite N \<longleftrightarrow> (\<exists>n::nat. \<forall>i \<in> N. i \<le> n)"
- by (blast intro: finite_nat_set_bounded2 bounded_nat_set_is_finite2)
-
-lemma not_finite_nat_set_iff2: "\<not> finite N \<longleftrightarrow> (\<forall>n::nat. \<exists>i \<in> N. n < i)"
- by (auto simp add: finite_nat_set_bounded_iff2 not_le)
-
subsection \<open>An injective function cannot define an embedded natural number\<close>
lemma lemma_infinite_set_singleton:
"\<forall>m n. m \<noteq> n \<longrightarrow> f n \<noteq> f m \<Longrightarrow> {n. f n = N} = {} \<or> (\<exists>m. {n. f n = N} = {m})"
- apply auto
- apply (drule_tac x = x in spec, auto)
- apply (subgoal_tac "\<forall>n. f n = f x \<longleftrightarrow> x = n")
- apply auto
- done
+ by (metis (mono_tags) is_singletonI' is_singleton_the_elem mem_Collect_eq)
lemma inj_fun_not_hypnat_in_SHNat:
fixes f :: "nat \<Rightarrow> nat"
@@ -143,10 +101,7 @@
qed
lemma range_subset_mem_starsetNat: "range f \<subseteq> A \<Longrightarrow> starfun f whn \<in> *s* A"
- apply (rule_tac x="whn" in spec)
- apply transfer
- apply auto
- done
+ by (metis STAR_subset_closed UNIV_I image_eqI starset_UNIV starset_image)
text \<open>
Gleason Proposition 11-5.5. pg 149, pg 155 (ex. 3) and pg. 360.
@@ -162,68 +117,53 @@
by auto
lemma choicefun_mem_set [simp]: "E \<noteq> {} \<Longrightarrow> choicefun E \<in> E"
- apply (unfold choicefun_def)
- apply (rule lemmaPow3 [THEN someI2_ex], auto)
- done
+ unfolding choicefun_def
+ by (force intro: lemmaPow3 [THEN someI2_ex])
lemma injf_max_mem_set: "E \<noteq>{} \<Longrightarrow> \<forall>x. \<exists>y \<in> E. x < y \<Longrightarrow> injf_max n E \<in> E"
- apply (induct n)
- apply force
- apply (simp add: choicefun_def)
- apply (rule lemmaPow3 [THEN someI2_ex], auto)
- done
+proof (induct n)
+ case 0
+ then show ?case by force
+next
+ case (Suc n)
+ then show ?case
+ apply (simp add: choicefun_def)
+ apply (rule lemmaPow3 [THEN someI2_ex], auto)
+ done
+qed
lemma injf_max_order_preserving: "\<forall>x. \<exists>y \<in> E. x < y \<Longrightarrow> injf_max n E < injf_max (Suc n) E"
- apply (simp add: choicefun_def)
- apply (rule lemmaPow3 [THEN someI2_ex])
- apply auto
- done
+ by (metis (no_types, lifting) choicefun_mem_set empty_iff injf_max.simps(2) mem_Collect_eq)
-lemma injf_max_order_preserving2: "\<forall>x. \<exists>y \<in> E. x < y \<Longrightarrow> \<forall>n m. m < n \<longrightarrow> injf_max m E < injf_max n E"
- apply (rule allI)
- apply (induct_tac n)
- apply auto
- apply (simp add: choicefun_def)
- apply (rule lemmaPow3 [THEN someI2_ex])
- apply (auto simp add: less_Suc_eq)
- apply (drule_tac x = m in spec)
- apply (drule subsetD)
- apply auto
- done
+lemma injf_max_order_preserving2:
+ assumes "m < n" and E: "\<forall>x. \<exists>y \<in> E. x < y"
+ shows "injf_max m E < injf_max n E"
+ using \<open>m < n\<close>
+proof (induction n arbitrary: m)
+ case 0 then show ?case by auto
+next
+ case (Suc n)
+ then show ?case
+ by (metis E injf_max_order_preserving less_Suc_eq order_less_trans)
+qed
+
lemma inj_injf_max: "\<forall>x. \<exists>y \<in> E. x < y \<Longrightarrow> inj (\<lambda>n. injf_max n E)"
- apply (rule inj_onI)
- apply (rule ccontr)
- apply auto
- apply (drule injf_max_order_preserving2)
- apply (metis antisym_conv3 order_less_le)
- done
+ by (metis injf_max_order_preserving2 linorder_injI order_less_irrefl)
lemma infinite_set_has_order_preserving_inj:
"E \<noteq> {} \<Longrightarrow> \<forall>x. \<exists>y \<in> E. x < y \<Longrightarrow> \<exists>f. range f \<subseteq> E \<and> inj f \<and> (\<forall>m. f m < f (Suc m))"
for E :: "'a::order set" and f :: "nat \<Rightarrow> 'a"
- apply (rule_tac x = "\<lambda>n. injf_max n E" in exI)
- apply safe
- apply (rule injf_max_mem_set)
- apply (rule_tac [3] inj_injf_max)
- apply (rule_tac [4] injf_max_order_preserving)
- apply auto
- done
+ by (metis image_subsetI inj_injf_max injf_max_mem_set injf_max_order_preserving)
text \<open>Only need the existence of an injective function from \<open>N\<close> to \<open>A\<close> for proof.\<close>
-lemma hypnat_infinite_has_nonstandard: "\<not> finite A \<Longrightarrow> hypnat_of_nat ` A < ( *s* A)"
- apply auto
- apply (subgoal_tac "A \<noteq> {}")
- prefer 2 apply force
- apply (drule infinite_set_has_order_preserving_inj)
- apply (erule not_finite_nat_set_iff2 [THEN iffD1])
- apply auto
- apply (drule inj_fun_not_hypnat_in_SHNat)
- apply (drule range_subset_mem_starsetNat)
- apply (auto simp add: SHNat_eq)
- done
+lemma hypnat_infinite_has_nonstandard:
+ assumes "infinite A"
+ shows "hypnat_of_nat ` A < ( *s* A)"
+ by (metis assms IntE NatStar_hypreal_of_real_Int STAR_star_of_image_subset psubsetI
+ infinite_iff_countable_subset inj_fun_not_hypnat_in_SHNat range_subset_mem_starsetNat)
lemma starsetNat_eq_hypnat_of_nat_image_finite: "*s* A = hypnat_of_nat ` A \<Longrightarrow> finite A"
by (metis hypnat_infinite_has_nonstandard less_irrefl)
@@ -231,24 +171,19 @@
lemma finite_starsetNat_iff: "*s* A = hypnat_of_nat ` A \<longleftrightarrow> finite A"
by (blast intro!: starsetNat_eq_hypnat_of_nat_image_finite NatStar_hypnat_of_nat)
-lemma hypnat_infinite_has_nonstandard_iff: "\<not> finite A \<longleftrightarrow> hypnat_of_nat ` A < *s* A"
- apply (rule iffI)
- apply (blast intro!: hypnat_infinite_has_nonstandard)
- apply (auto simp add: finite_starsetNat_iff [symmetric])
- done
+lemma hypnat_infinite_has_nonstandard_iff: "infinite A \<longleftrightarrow> hypnat_of_nat ` A < *s* A"
+ by (metis finite_starsetNat_iff hypnat_infinite_has_nonstandard nless_le)
subsection \<open>Existence of Infinitely Many Primes: a Nonstandard Proof\<close>
-lemma lemma_not_dvd_hypnat_one [simp]: "\<not> (\<forall>n \<in> - {0}. hypnat_of_nat n dvd 1)"
- apply auto
- apply (rule_tac x = 2 in bexI)
- apply transfer
- apply auto
- done
-
-lemma lemma_not_dvd_hypnat_one2 [simp]: "\<exists>n \<in> - {0}. \<not> hypnat_of_nat n dvd 1"
- using lemma_not_dvd_hypnat_one by (auto simp del: lemma_not_dvd_hypnat_one)
+lemma lemma_not_dvd_hypnat_one [simp]: "\<exists>n \<in> - {0}. \<not> hypnat_of_nat n dvd 1"
+proof -
+ have "\<not> hypnat_of_nat 2 dvd 1"
+ by transfer auto
+ then show ?thesis
+ by (metis ComplI singletonD zero_neq_numeral)
+qed
lemma hypnat_add_one_gt_one: "\<And>N::hypnat. 0 < N \<Longrightarrow> 1 < N + 1"
by transfer simp
@@ -272,17 +207,16 @@
by transfer simp
text \<open>Already proved as \<open>primes_infinite\<close>, but now using non-standard naturals.\<close>
-theorem not_finite_prime: "\<not> finite {p::nat. prime p}"
- apply (rule hypnat_infinite_has_nonstandard_iff [THEN iffD2])
- using hypnat_dvd_all_hypnat_of_nat
- apply clarify
- apply (drule hypnat_add_one_gt_one)
- apply (drule hyperprime_factor_exists)
- apply clarify
- apply (subgoal_tac "k \<notin> hypnat_of_nat ` {p. prime p}")
- apply (force simp: starprime_def)
- apply (metis Compl_iff add.commute dvd_add_left_iff empty_iff hdvd_one_eq_one hypnat_one_not_prime
- imageE insert_iff mem_Collect_eq not_prime_0)
- done
+theorem not_finite_prime: "infinite {p::nat. prime p}"
+proof -
+ obtain N k where N: "\<forall>n\<in>- {0}. hypnat_of_nat n dvd N" "k\<in>starprime" "k dvd N + 1"
+ by (meson hyperprime_factor_exists hypnat_add_one_gt_one hypnat_dvd_all_hypnat_of_nat)
+ then have "k \<noteq> 1"
+ using \<open>k \<in> starprime\<close> by force
+ then have "k \<notin> hypnat_of_nat ` {p. prime p}"
+ using N dvd_add_right_iff hdvd_one_eq_one not_prime_0 by blast
+ then show ?thesis
+ by (metis \<open>k \<in> starprime\<close> finite_starsetNat_iff starprime_def)
+qed
end
--- a/src/HOL/Nonstandard_Analysis/HSeries.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Nonstandard_Analysis/HSeries.thy Fri Sep 02 13:41:55 2022 +0200
@@ -91,21 +91,16 @@
lemma sumhr_hypreal_of_hypnat_omega: "sumhr (0, whn, \<lambda>i. 1) = hypreal_of_hypnat whn"
by (simp add: sumhr_const)
+lemma whn_eq_\<omega>m1: "hypreal_of_hypnat whn = \<omega> - 1"
+ unfolding star_class_defs omega_def hypnat_omega_def of_hypnat_def star_of_def
+ by (simp add: starfun_star_n starfun2_star_n)
+
lemma sumhr_hypreal_omega_minus_one: "sumhr(0, whn, \<lambda>i. 1) = \<omega> - 1"
- apply (simp add: sumhr_const)
- (* FIXME: need lemma: hypreal_of_hypnat whn = \<omega> - 1 *)
- (* maybe define \<omega> = hypreal_of_hypnat whn + 1 *)
- apply (unfold star_class_defs omega_def hypnat_omega_def of_hypnat_def star_of_def)
- apply (simp add: starfun_star_n starfun2_star_n)
- done
+ by (simp add: sumhr_const whn_eq_\<omega>m1)
lemma sumhr_minus_one_realpow_zero [simp]: "\<And>N. sumhr (0, N + N, \<lambda>i. (-1) ^ (i + 1)) = 0"
unfolding sumhr_app
- apply transfer
- apply (simp del: power_Suc add: mult_2 [symmetric])
- apply (induct_tac N)
- apply simp_all
- done
+ by transfer (induct_tac N, auto)
lemma sumhr_interval_const:
"(\<forall>n. m \<le> Suc n \<longrightarrow> f n = r) \<and> m \<le> na \<Longrightarrow>
@@ -145,17 +140,19 @@
by (auto simp add: sums_NSsums_iff [symmetric] not_le[symmetric] intro!: sums_finite)
lemma NSsummable_NSCauchy:
- "NSsummable f \<longleftrightarrow> (\<forall>M \<in> HNatInfinite. \<forall>N \<in> HNatInfinite. \<bar>sumhr (M, N, f)\<bar> \<approx> 0)"
- apply (auto simp add: summable_NSsummable_iff [symmetric]
- summable_iff_convergent convergent_NSconvergent_iff atLeast0LessThan[symmetric]
- NSCauchy_NSconvergent_iff [symmetric] NSCauchy_def starfunNat_sumr)
- apply (cut_tac x = M and y = N in linorder_less_linear)
- by (metis approx_hrabs_zero_cancel approx_minus_iff approx_refl approx_sym sumhr_split_diff)
+ "NSsummable f \<longleftrightarrow> (\<forall>M \<in> HNatInfinite. \<forall>N \<in> HNatInfinite. \<bar>sumhr (M, N, f)\<bar> \<approx> 0)" (is "?L=?R")
+proof -
+ have "?L = (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. sumhr (0, M, f) \<approx> sumhr (0, N, f))"
+ by (auto simp add: summable_iff_convergent convergent_NSconvergent_iff NSCauchy_def starfunNat_sumr
+ simp flip: NSCauchy_NSconvergent_iff summable_NSsummable_iff atLeast0LessThan)
+ also have "... \<longleftrightarrow> ?R"
+ by (metis approx_hrabs_zero_cancel approx_minus_iff approx_refl approx_sym linorder_less_linear sumhr_hrabs_approx sumhr_split_diff)
+ finally show ?thesis .
+qed
text \<open>Terms of a convergent series tend to zero.\<close>
lemma NSsummable_NSLIMSEQ_zero: "NSsummable f \<Longrightarrow> f \<longlonglongrightarrow>\<^sub>N\<^sub>S 0"
- apply (auto simp add: NSLIMSEQ_def NSsummable_NSCauchy)
- by (metis HNatInfinite_add approx_hrabs_zero_cancel sumhr_Suc)
+ by (metis HNatInfinite_add NSLIMSEQ_def NSsummable_NSCauchy approx_hrabs_zero_cancel star_of_zero sumhr_Suc)
text \<open>Nonstandard comparison test.\<close>
lemma NSsummable_comparison_test: "\<exists>N. \<forall>n. N \<le> n \<longrightarrow> \<bar>f n\<bar> \<le> g n \<Longrightarrow> NSsummable g \<Longrightarrow> NSsummable f"
--- a/src/HOL/Nonstandard_Analysis/HTranscendental.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Nonstandard_Analysis/HTranscendental.thy Fri Sep 02 13:41:55 2022 +0200
@@ -122,7 +122,7 @@
lemma HFinite_hypreal_sqrt_imp_HFinite:
"\<lbrakk>0 \<le> x; ( *f* sqrt) x \<in> HFinite\<rbrakk> \<Longrightarrow> x \<in> HFinite"
- by (metis HFinite_mult hrealpow_two hypreal_sqrt_pow2_iff numeral_2_eq_2)
+ by (metis HFinite_mult hypreal_sqrt_pow2_iff power2_eq_square)
lemma HFinite_hypreal_sqrt_iff [simp]:
"0 \<le> x \<Longrightarrow> (( *f* sqrt) x \<in> HFinite) = (x \<in> HFinite)"
--- a/src/HOL/Nonstandard_Analysis/HyperDef.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Nonstandard_Analysis/HyperDef.thy Fri Sep 02 13:41:55 2022 +0200
@@ -278,46 +278,6 @@
for r :: hypreal
by (rule power_Suc)
-lemma hrealpow_two: "r ^ Suc (Suc 0) = r * r"
- for r :: hypreal
- by simp
-
-lemma hrealpow_two_le [simp]: "0 \<le> r ^ Suc (Suc 0)"
- for r :: hypreal
- by (auto simp add: zero_le_mult_iff)
-
-lemma hrealpow_two_le_add_order [simp]: "0 \<le> u ^ Suc (Suc 0) + v ^ Suc (Suc 0)"
- for u v :: hypreal
- by (simp only: hrealpow_two_le add_nonneg_nonneg)
-
-lemma hrealpow_two_le_add_order2 [simp]: "0 \<le> u ^ Suc (Suc 0) + v ^ Suc (Suc 0) + w ^ Suc (Suc 0)"
- for u v w :: hypreal
- by (simp only: hrealpow_two_le add_nonneg_nonneg)
-
-lemma hypreal_add_nonneg_eq_0_iff: "0 \<le> x \<Longrightarrow> 0 \<le> y \<Longrightarrow> x + y = 0 \<longleftrightarrow> x = 0 \<and> y = 0"
- for x y :: hypreal
- by arith
-
-
-(* FIXME: DELETE THESE *)
-lemma hypreal_three_squares_add_zero_iff: "x * x + y * y + z * z = 0 \<longleftrightarrow> x = 0 \<and> y = 0 \<and> z = 0"
- for x y z :: hypreal
- by (simp only: zero_le_square add_nonneg_nonneg hypreal_add_nonneg_eq_0_iff) auto
-
-lemma hrealpow_three_squares_add_zero_iff [simp]:
- "x ^ Suc (Suc 0) + y ^ Suc (Suc 0) + z ^ Suc (Suc 0) = 0 \<longleftrightarrow> x = 0 \<and> y = 0 \<and> z = 0"
- for x y z :: hypreal
- by (simp only: hypreal_three_squares_add_zero_iff hrealpow_two)
-
-(*FIXME: This and RealPow.abs_realpow_two should be replaced by an abstract
- result proved in Rings or Fields*)
-lemma hrabs_hrealpow_two [simp]: "\<bar>x ^ Suc (Suc 0)\<bar> = x ^ Suc (Suc 0)"
- for x :: hypreal
- by (simp add: abs_mult)
-
-lemma two_hrealpow_ge_one [simp]: "(1::hypreal) \<le> 2 ^ n"
- using power_increasing [of 0 n "2::hypreal"] by simp
-
lemma hrealpow: "star_n X ^ m = star_n (\<lambda>n. (X n::real) ^ m)"
by (induct m) (auto simp: star_n_one_num star_n_mult)
@@ -336,14 +296,6 @@
"(- numeral v :: hypreal) ^ n = hypreal_of_real ((- numeral v) ^ n)"
by simp
declare power_hypreal_of_real_neg_numeral [of _ "numeral w", simp] for w
-(*
-lemma hrealpow_HFinite:
- fixes x :: "'a::{real_normed_algebra,power} star"
- shows "x \<in> HFinite ==> x ^ n \<in> HFinite"
-apply (induct_tac "n")
-apply (auto simp add: power_Suc intro: HFinite_mult)
-done
-*)
subsection \<open>Powers with Hypernatural Exponents\<close>
--- a/src/HOL/Nonstandard_Analysis/NSA.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Nonstandard_Analysis/NSA.thy Fri Sep 02 13:41:55 2022 +0200
@@ -460,7 +460,6 @@
for x :: hypreal
by (auto intro: Infinitesimal_interval simp add: order_le_less)
-
lemma lemma_Infinitesimal_hyperpow: "x \<in> Infinitesimal \<Longrightarrow> 0 < N \<Longrightarrow> \<bar>x pow N\<bar> \<le> \<bar>x\<bar>"
for x :: hypreal
apply (clarsimp simp: Infinitesimal_def)
@@ -1465,13 +1464,13 @@
by (simp add: FreeUltrafilterNat_HFinite [where u = "u+1"] eventually_mono)
lemma HInfinite_FreeUltrafilterNat:
- "star_n X \<in> HInfinite \<Longrightarrow> eventually (\<lambda>n. u < norm (X n)) \<U>"
- apply (drule HInfinite_HFinite_iff [THEN iffD1])
- apply (simp add: HFinite_FreeUltrafilterNat_iff)
- apply (drule_tac x="u + 1" in spec)
- apply (simp add: FreeUltrafilterNat.eventually_not_iff[symmetric])
- apply (auto elim: eventually_mono)
- done
+ assumes "star_n X \<in> HInfinite" shows "\<forall>\<^sub>F n in \<U>. u < norm (X n)"
+proof -
+have "\<not> (\<forall>\<^sub>F n in \<U>. norm (X n) < u + 1)"
+ using FreeUltrafilterNat_HFinite HFinite_HInfinite_iff assms by auto
+ then show ?thesis
+ by (auto simp flip: FreeUltrafilterNat.eventually_not_iff elim: eventually_mono)
+qed
lemma FreeUltrafilterNat_HInfinite:
assumes "\<And>u. eventually (\<lambda>n. u < norm (X n)) \<U>"
@@ -1500,18 +1499,12 @@
lemma Infinitesimal_FreeUltrafilterNat_iff:
"(star_n X \<in> Infinitesimal) = (\<forall>u>0. eventually (\<lambda>n. norm (X n) < u) \<U>)" (is "?lhs = ?rhs")
-proof
- assume ?lhs
- then show ?rhs
- apply (simp add: Infinitesimal_def ball_SReal_eq)
- apply (simp add: hnorm_def starfun_star_n star_of_def star_less_def starP2_star_n)
- done
-next
- assume ?rhs
- then show ?lhs
- apply (simp add: Infinitesimal_def ball_SReal_eq)
- apply (simp add: hnorm_def starfun_star_n star_of_def star_less_def starP2_star_n)
- done
+proof -
+ have "?lhs \<longleftrightarrow> (\<forall>r>0. hnorm (star_n X) < hypreal_of_real r)"
+ by (simp add: Infinitesimal_def ball_SReal_eq)
+ also have "... \<longleftrightarrow> ?rhs"
+ by (simp add: hnorm_def starfun_star_n star_of_def star_less_def starP2_star_n)
+ finally show ?thesis .
qed
@@ -1521,16 +1514,18 @@
by (meson inverse_positive_iff_positive less_trans of_nat_0_less_iff reals_Archimedean zero_less_Suc)
lemma lemma_Infinitesimal2:
- "(\<forall>r \<in> Reals. 0 < r \<longrightarrow> x < r) \<longleftrightarrow> (\<forall>n. x < inverse(hypreal_of_nat (Suc n)))"
- apply safe
- apply (drule_tac x = "inverse (hypreal_of_real (real (Suc n))) " in bspec)
- apply simp_all
- using less_imp_of_nat_less apply fastforce
- apply (auto dest!: reals_Archimedean simp add: SReal_iff simp del: of_nat_Suc)
- apply (drule star_of_less [THEN iffD2])
- apply simp
- apply (blast intro: order_less_trans)
- done
+ "(\<forall>r \<in> Reals. 0 < r \<longrightarrow> x < r) \<longleftrightarrow> (\<forall>n. x < inverse(hypreal_of_nat (Suc n)))" (is "_ = ?rhs")
+proof (intro iffI strip)
+ assume R: ?rhs
+ fix r::hypreal
+ assume "r \<in> \<real>" "0 < r"
+ then obtain n y where "inverse (real (Suc n)) < y" and r: "r = hypreal_of_real y"
+ by (metis SReal_iff reals_Archimedean star_of_0_less)
+ then have "inverse (1 + hypreal_of_nat n) < hypreal_of_real y"
+ by (metis of_nat_Suc star_of_inverse star_of_less star_of_nat_def)
+ then show "x < r"
+ by (metis R r le_less_trans less_imp_le of_nat_Suc)
+qed (meson Reals_inverse Reals_of_nat of_nat_0_less_iff positive_imp_inverse_positive zero_less_Suc)
lemma Infinitesimal_hypreal_of_nat_iff:
@@ -1552,10 +1547,14 @@
by auto
lemma finite_real_of_nat_less_real: "finite {n::nat. real n < u}"
- apply (cut_tac x = u in reals_Archimedean2, safe)
- apply (rule finite_real_of_nat_segment [THEN [2] finite_subset])
- apply (auto dest: order_less_trans)
- done
+proof -
+ obtain m where "u < real m"
+ using reals_Archimedean2 by blast
+ then have "{n. real n < u} \<subseteq> {..<m}"
+ by force
+ then show ?thesis
+ using finite_nat_iff_bounded by force
+qed
lemma finite_real_of_nat_le_real: "finite {n::nat. real n \<le> u}"
by (metis infinite_nat_iff_unbounded leD le_nat_floor mem_Collect_eq)
@@ -1619,7 +1618,7 @@
shows "finite {n. u \<le> inverse (real (Suc n))}"
proof -
have "\<forall>na. u \<le> inverse (1 + real na) \<longrightarrow> na \<le> ceiling (inverse u)"
- by (metis add.commute add1_zle_eq assms ceiling_mono ceiling_of_nat dual_order.order_iff_strict inverse_inverse_eq le_imp_inverse_le semiring_1_class.of_nat_simps(2))
+ by (smt (verit, best) assms ceiling_less_cancel ceiling_of_nat inverse_inverse_eq inverse_le_iff_le)
then show ?thesis
apply (auto simp add: finite_nat_set_iff_bounded_le)
by (meson assms inverse_positive_iff_positive le_nat_iff less_imp_le zero_less_ceiling)
--- a/src/HOL/Num.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Num.thy Fri Sep 02 13:41:55 2022 +0200
@@ -391,20 +391,42 @@
by (induct k) (simp_all add: numeral.simps is_num.intros)
lemma is_num_add_commute: "is_num x \<Longrightarrow> is_num y \<Longrightarrow> x + y = y + x"
- apply (induct x rule: is_num.induct)
- apply (induct y rule: is_num.induct)
- apply simp
- apply (rule_tac a=x in add_left_imp_eq)
- apply (rule_tac a=x in add_right_imp_eq)
- apply (simp add: add.assoc)
- apply (simp add: add.assoc [symmetric])
- apply (simp add: add.assoc)
- apply (rule_tac a=x in add_left_imp_eq)
- apply (rule_tac a=x in add_right_imp_eq)
- apply (simp add: add.assoc)
- apply (simp add: add.assoc)
- apply (simp add: add.assoc [symmetric])
- done
+proof(induction x rule: is_num.induct)
+ case 1
+ then show ?case
+ proof (induction y rule: is_num.induct)
+ case 1
+ then show ?case by simp
+ next
+ case (2 y)
+ then have "y + (1 + - y) + y = y + (- y + 1) + y"
+ by (simp add: add.assoc)
+ then have "y + (1 + - y) = y + (- y + 1)"
+ by simp
+ then show ?case
+ by (rule add_left_imp_eq[of y])
+ next
+ case (3 x y)
+ then have "1 + (x + y) = x + 1 + y"
+ by (simp add: add.assoc [symmetric])
+ then show ?case using 3
+ by (simp add: add.assoc)
+ qed
+next
+ case (2 x)
+ then have "x + (- x + y) + x = x + (y + - x) + x"
+ by (simp add: add.assoc)
+ then have "x + (- x + y) = x + (y + - x)"
+ by simp
+ then show ?case
+ by (rule add_left_imp_eq[of x])
+next
+ case (3 x z)
+ moreover have "x + (y + z) = (x + y) + z"
+ by (simp add: add.assoc[symmetric])
+ ultimately show ?case
+ by (simp add: add.assoc)
+qed
lemma is_num_add_left_commute: "is_num x \<Longrightarrow> is_num y \<Longrightarrow> x + (y + z) = y + (x + z)"
by (simp only: add.assoc [symmetric] is_num_add_commute)
@@ -1508,21 +1530,22 @@
by simp
next
case (Bit0 q)
- then show ?case
- apply (simp only: Num.numeral_Bit0 Num.numeral_add)
- apply (subst num_of_nat_double)
- apply simp_all
- done
+ then have "num_of_nat (numeral (num.Bit0 q)) = num_of_nat (numeral q + numeral q)"
+ by (simp only: Num.numeral_Bit0 Num.numeral_add)
+ also have "\<dots> = num.Bit0 (num_of_nat (numeral q))"
+ by (rule num_of_nat_double) simp
+ finally show ?case
+ using Bit0.IH by simp
next
case (Bit1 q)
- then show ?case
- apply (simp only: Num.numeral_Bit1 Num.numeral_add)
- apply (subst num_of_nat_plus_distrib)
- apply simp
- apply simp
- apply (subst num_of_nat_double)
- apply simp_all
- done
+ then have "num_of_nat (numeral (num.Bit1 q)) = num_of_nat (numeral q + numeral q + 1)"
+ by (simp only: Num.numeral_Bit1 Num.numeral_add)
+ also have "\<dots> = num_of_nat (numeral q + numeral q) + num_of_nat 1"
+ by (rule num_of_nat_plus_distrib) auto
+ also have "\<dots> = num.Bit0 (num_of_nat (numeral q)) + num_of_nat 1"
+ by (subst num_of_nat_double) auto
+ finally show ?case
+ using Bit1.IH by simp
qed
end
--- a/src/HOL/Number_Theory/Residues.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Number_Theory/Residues.thy Fri Sep 02 13:41:55 2022 +0200
@@ -38,7 +38,7 @@
locale residues =
fixes m :: int and R (structure)
assumes m_gt_one: "m > 1"
- defines "R \<equiv> residue_ring m"
+ defines R_m_def: "R \<equiv> residue_ring m"
begin
lemma abelian_group: "abelian_group R"
@@ -55,11 +55,11 @@
by (metis False atLeastAtMost_iff diff_ge_0_iff_ge diff_left_mono int_one_le_iff_zero_less less_le)
qed
with m_gt_one show ?thesis
- by (fastforce simp add: R_def residue_ring_def mod_add_right_eq ac_simps intro!: abelian_groupI)
+ by (fastforce simp add: R_m_def residue_ring_def mod_add_right_eq ac_simps intro!: abelian_groupI)
qed
lemma comm_monoid: "comm_monoid R"
- unfolding R_def residue_ring_def
+ unfolding R_m_def residue_ring_def
apply (rule comm_monoidI)
using m_gt_one apply auto
apply (metis mod_mult_right_eq mult.assoc mult.commute)
@@ -68,7 +68,7 @@
lemma cring: "cring R"
apply (intro cringI abelian_group comm_monoid)
- unfolding R_def residue_ring_def
+ unfolding R_m_def residue_ring_def
apply (auto simp add: comm_semiring_class.distrib mod_add_eq mod_mult_left_eq)
done
@@ -87,29 +87,29 @@
\<close>
lemma res_carrier_eq: "carrier R = {0..m - 1}"
- by (auto simp: R_def residue_ring_def)
+ by (auto simp: R_m_def residue_ring_def)
lemma res_add_eq: "x \<oplus> y = (x + y) mod m"
- by (auto simp: R_def residue_ring_def)
+ by (auto simp: R_m_def residue_ring_def)
lemma res_mult_eq: "x \<otimes> y = (x * y) mod m"
- by (auto simp: R_def residue_ring_def)
+ by (auto simp: R_m_def residue_ring_def)
lemma res_zero_eq: "\<zero> = 0"
- by (auto simp: R_def residue_ring_def)
+ by (auto simp: R_m_def residue_ring_def)
lemma res_one_eq: "\<one> = 1"
- by (auto simp: R_def residue_ring_def units_of_def)
+ by (auto simp: R_m_def residue_ring_def units_of_def)
lemma res_units_eq: "Units R = {x. 0 < x \<and> x < m \<and> coprime x m}"
using m_gt_one
- apply (auto simp add: Units_def R_def residue_ring_def ac_simps invertible_coprime intro: ccontr)
+ apply (auto simp add: Units_def R_m_def residue_ring_def ac_simps invertible_coprime intro: ccontr)
apply (subst (asm) coprime_iff_invertible'_int)
apply (auto simp add: cong_def)
done
lemma res_neg_eq: "\<ominus> x = (- x) mod m"
- using m_gt_one unfolding R_def a_inv_def m_inv_def residue_ring_def
+ using m_gt_one unfolding R_m_def a_inv_def m_inv_def residue_ring_def
apply simp
apply (rule the_equality)
apply (simp add: mod_add_right_eq)
@@ -134,16 +134,16 @@
using insert m_gt_one by auto
lemma add_cong: "(x mod m) \<oplus> (y mod m) = (x + y) mod m"
- by (auto simp: R_def residue_ring_def mod_simps)
+ by (auto simp: R_m_def residue_ring_def mod_simps)
lemma mult_cong: "(x mod m) \<otimes> (y mod m) = (x * y) mod m"
- by (auto simp: R_def residue_ring_def mod_simps)
+ by (auto simp: R_m_def residue_ring_def mod_simps)
lemma zero_cong: "\<zero> = 0"
- by (auto simp: R_def residue_ring_def)
+ by (auto simp: R_m_def residue_ring_def)
lemma one_cong: "\<one> = 1 mod m"
- using m_gt_one by (auto simp: R_def residue_ring_def)
+ using m_gt_one by (auto simp: R_m_def residue_ring_def)
(* FIXME revise algebra library to use 1? *)
lemma pow_cong: "(x mod m) [^] n = x^n mod m"
@@ -276,7 +276,7 @@
by (simp add: totient_def totatives_eq card_image)
qed
-lemma (in residues_prime) totient_eq: "totient p = p - 1"
+lemma (in residues_prime) prime_totient_eq: "totient p = p - 1"
using totient_eq by (simp add: res_prime_units_eq)
lemma (in residues) euler_theorem:
--- a/src/HOL/Numeral_Simprocs.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Numeral_Simprocs.thy Fri Sep 02 13:41:55 2022 +0200
@@ -15,14 +15,11 @@
lemmas semiring_norm =
Let_def arith_simps diff_nat_numeral rel_simps
if_False if_True
- add_0 add_Suc add_numeral_left
+ add_Suc add_numeral_left
add_neg_numeral_left mult_numeral_left
numeral_One [symmetric] uminus_numeral_One [symmetric] Suc_eq_plus1
eq_numeral_iff_iszero not_iszero_Numeral1
-declare split_div [of _ _ "numeral k", arith_split] for k
-declare split_mod [of _ _ "numeral k", arith_split] for k
-
text \<open>For \<open>combine_numerals\<close>\<close>
lemma left_add_mult_distrib: "i*u + (j*u + k) = (i+j)*u + (k::nat)"
@@ -92,16 +89,16 @@
lemma nat_mult_eq_cancel_disj:
fixes k m n :: nat
shows "k * m = k * n \<longleftrightarrow> k = 0 \<or> m = n"
- by auto
+ by (fact mult_cancel_left)
-lemma nat_mult_div_cancel_disj [simp]:
+lemma nat_mult_div_cancel_disj:
fixes k m n :: nat
shows "(k * m) div (k * n) = (if k = 0 then 0 else m div n)"
by (fact div_mult_mult1_if)
lemma numeral_times_minus_swap:
fixes x:: "'a::comm_ring_1" shows "numeral w * -x = x * - numeral w"
- by (simp add: mult.commute)
+ by (simp add: ac_simps)
ML_file \<open>Tools/numeral_simprocs.ML\<close>
--- a/src/HOL/Order_Relation.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Order_Relation.thy Fri Sep 02 13:41:55 2022 +0200
@@ -133,15 +133,19 @@
assumes "Total r"
and not_Id: "\<not> r \<subseteq> Id"
shows "Field r = Field (r - Id)"
- using mono_Field[of "r - Id" r] Diff_subset[of r Id]
-proof auto
- fix a assume *: "a \<in> Field r"
- from not_Id have "r \<noteq> {}" by fast
- with not_Id obtain b and c where "b \<noteq> c \<and> (b,c) \<in> r" by auto
- then have "b \<noteq> c \<and> {b, c} \<subseteq> Field r" by (auto simp: Field_def)
- with * obtain d where "d \<in> Field r" "d \<noteq> a" by auto
- with * \<open>Total r\<close> have "(a, d) \<in> r \<or> (d, a) \<in> r" by (simp add: total_on_def)
- with \<open>d \<noteq> a\<close> show "a \<in> Field (r - Id)" unfolding Field_def by blast
+proof -
+ have "Field r \<subseteq> Field (r - Id)"
+ proof (rule subsetI)
+ fix a assume *: "a \<in> Field r"
+ from not_Id have "r \<noteq> {}" by fast
+ with not_Id obtain b and c where "b \<noteq> c \<and> (b,c) \<in> r" by auto
+ then have "b \<noteq> c \<and> {b, c} \<subseteq> Field r" by (auto simp: Field_def)
+ with * obtain d where "d \<in> Field r" "d \<noteq> a" by auto
+ with * \<open>Total r\<close> have "(a, d) \<in> r \<or> (d, a) \<in> r" by (simp add: total_on_def)
+ with \<open>d \<noteq> a\<close> show "a \<in> Field (r - Id)" unfolding Field_def by blast
+ qed
+ then show ?thesis
+ using mono_Field[of "r - Id" r] Diff_subset[of r Id] by auto
qed
subsection\<open>Relations given by a predicate and the field\<close>
@@ -323,7 +327,7 @@
and "(a, b) \<in> r"
shows "under r a \<subseteq> under r b"
unfolding under_def
-proof auto
+proof safe
fix x assume "(x, a) \<in> r"
with assms trans_def[of r] show "(x, b) \<in> r" by blast
qed
@@ -334,7 +338,7 @@
and ab: "(a, b) \<in> r"
shows "underS r a \<subseteq> underS r b"
unfolding underS_def
-proof auto
+proof safe
assume *: "b \<noteq> a" and **: "(b, a) \<in> r"
with \<open>antisym r\<close> antisym_def[of r] ab show False
by blast
@@ -440,12 +444,18 @@
then have "(\<forall>b. (\<forall>c. (c, b) \<in> R a \<longrightarrow> chi c) \<longrightarrow> chi b) \<longrightarrow> (\<forall>b. chi b)"
unfolding wf_def by blast
also have "\<forall>b. (\<forall>c. (c, b) \<in> R a \<longrightarrow> chi c) \<longrightarrow> chi b"
- proof (auto simp add: chi_def R_def)
+ proof safe
fix b
- assume "(b, a) \<in> r" and "\<forall>c. (c, b) \<in> r \<and> (c, a) \<in> r \<longrightarrow> phi c"
- then have "\<forall>c. (c, b) \<in> r \<longrightarrow> phi c"
- using assms trans_def[of r] by blast
- with ** show "phi b" by blast
+ assume "\<forall>c. (c, b) \<in> R a \<longrightarrow> chi c"
+ moreover have "(b, a) \<in> r \<Longrightarrow> \<forall>c. (c, b) \<in> r \<and> (c, a) \<in> r \<longrightarrow> phi c \<Longrightarrow> phi b"
+ proof -
+ assume "(b, a) \<in> r" and "\<forall>c. (c, b) \<in> r \<and> (c, a) \<in> r \<longrightarrow> phi c"
+ then have "\<forall>c. (c, b) \<in> r \<longrightarrow> phi c"
+ using assms trans_def[of r] by blast
+ with ** show "phi b" by blast
+ qed
+ ultimately show "chi b"
+ by (auto simp add: chi_def R_def)
qed
finally have "\<forall>b. chi b" .
with ** chi_def show "phi a" by blast
@@ -456,13 +466,18 @@
text\<open>A transitive relation is well-founded if all initial segments are finite.\<close>
corollary wf_finite_segments:
assumes "irrefl r" and "trans r" and "\<And>x. finite {y. (y, x) \<in> r}"
- shows "wf (r)"
-proof (clarsimp simp: trans_wf_iff wf_iff_acyclic_if_finite converse_def assms)
- fix a
- have "trans (r \<inter> ({x. (x, a) \<in> r} \<times> {x. (x, a) \<in> r}))"
- using assms unfolding trans_def Field_def by blast
- then show "acyclic (r \<inter> {x. (x, a) \<in> r} \<times> {x. (x, a) \<in> r})"
- using assms acyclic_def assms irrefl_def by fastforce
+ shows "wf r"
+proof -
+ have "\<And>a. acyclic (r \<inter> {x. (x, a) \<in> r} \<times> {x. (x, a) \<in> r})"
+ proof -
+ fix a
+ have "trans (r \<inter> ({x. (x, a) \<in> r} \<times> {x. (x, a) \<in> r}))"
+ using assms unfolding trans_def Field_def by blast
+ then show "acyclic (r \<inter> {x. (x, a) \<in> r} \<times> {x. (x, a) \<in> r})"
+ using assms acyclic_def assms irrefl_def by fastforce
+ qed
+ then show ?thesis
+ by (clarsimp simp: trans_wf_iff wf_iff_acyclic_if_finite converse_def assms)
qed
text \<open>The next lemma is a variation of \<open>wf_eq_minimal\<close> from Wellfounded,
@@ -472,13 +487,26 @@
proof-
let ?phi = "\<lambda>A. A \<noteq> {} \<longrightarrow> (\<exists>a \<in> A. \<forall>a' \<in> A. (a',a) \<notin> r)"
have "wf r \<longleftrightarrow> (\<forall>A. ?phi A)"
- apply (auto simp: ex_in_conv [THEN sym])
- apply (erule wfE_min)
- apply assumption
- apply blast
- apply (rule wfI_min)
- apply fast
- done
+ proof
+ assume "wf r"
+ show "\<forall>A. ?phi A"
+ proof clarify
+ fix A:: "'a set"
+ assume "A \<noteq> {}"
+ then obtain x where "x \<in> A"
+ by auto
+ show "\<exists>a\<in>A. \<forall>a'\<in>A. (a', a) \<notin> r"
+ apply (rule wfE_min[of r x A])
+ apply fact+
+ by blast
+ qed
+ next
+ assume *: "\<forall>A. ?phi A"
+ then show "wf r"
+ apply (clarsimp simp: ex_in_conv [THEN sym])
+ apply (rule wfI_min)
+ by fast
+ qed
also have "(\<forall>A. ?phi A) \<longleftrightarrow> (\<forall>B \<subseteq> Field r. ?phi B)"
proof
assume "\<forall>A. ?phi A"
--- a/src/HOL/Orderings.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Orderings.thy Fri Sep 02 13:41:55 2022 +0200
@@ -790,109 +790,109 @@
end
-lemma order_less_subst2: "(a::'a::order) < b ==> f b < (c::'c::order) ==>
- (!!x y. x < y ==> f x < f y) ==> f a < c"
+lemma order_less_subst2: "(a::'a::order) < b \<Longrightarrow> f b < (c::'c::order) \<Longrightarrow>
+ (!!x y. x < y \<Longrightarrow> f x < f y) \<Longrightarrow> f a < c"
proof -
- assume r: "!!x y. x < y ==> f x < f y"
+ assume r: "!!x y. x < y \<Longrightarrow> f x < f y"
assume "a < b" hence "f a < f b" by (rule r)
also assume "f b < c"
finally (less_trans) show ?thesis .
qed
-lemma order_less_subst1: "(a::'a::order) < f b ==> (b::'b::order) < c ==>
- (!!x y. x < y ==> f x < f y) ==> a < f c"
+lemma order_less_subst1: "(a::'a::order) < f b \<Longrightarrow> (b::'b::order) < c \<Longrightarrow>
+ (!!x y. x < y \<Longrightarrow> f x < f y) \<Longrightarrow> a < f c"
proof -
- assume r: "!!x y. x < y ==> f x < f y"
+ assume r: "!!x y. x < y \<Longrightarrow> f x < f y"
assume "a < f b"
also assume "b < c" hence "f b < f c" by (rule r)
finally (less_trans) show ?thesis .
qed
-lemma order_le_less_subst2: "(a::'a::order) <= b ==> f b < (c::'c::order) ==>
- (!!x y. x <= y ==> f x <= f y) ==> f a < c"
+lemma order_le_less_subst2: "(a::'a::order) <= b \<Longrightarrow> f b < (c::'c::order) \<Longrightarrow>
+ (!!x y. x <= y \<Longrightarrow> f x <= f y) \<Longrightarrow> f a < c"
proof -
- assume r: "!!x y. x <= y ==> f x <= f y"
+ assume r: "!!x y. x <= y \<Longrightarrow> f x <= f y"
assume "a <= b" hence "f a <= f b" by (rule r)
also assume "f b < c"
finally (le_less_trans) show ?thesis .
qed
-lemma order_le_less_subst1: "(a::'a::order) <= f b ==> (b::'b::order) < c ==>
- (!!x y. x < y ==> f x < f y) ==> a < f c"
+lemma order_le_less_subst1: "(a::'a::order) <= f b \<Longrightarrow> (b::'b::order) < c \<Longrightarrow>
+ (!!x y. x < y \<Longrightarrow> f x < f y) \<Longrightarrow> a < f c"
proof -
- assume r: "!!x y. x < y ==> f x < f y"
+ assume r: "!!x y. x < y \<Longrightarrow> f x < f y"
assume "a <= f b"
also assume "b < c" hence "f b < f c" by (rule r)
finally (le_less_trans) show ?thesis .
qed
-lemma order_less_le_subst2: "(a::'a::order) < b ==> f b <= (c::'c::order) ==>
- (!!x y. x < y ==> f x < f y) ==> f a < c"
+lemma order_less_le_subst2: "(a::'a::order) < b \<Longrightarrow> f b <= (c::'c::order) \<Longrightarrow>
+ (!!x y. x < y \<Longrightarrow> f x < f y) \<Longrightarrow> f a < c"
proof -
- assume r: "!!x y. x < y ==> f x < f y"
+ assume r: "!!x y. x < y \<Longrightarrow> f x < f y"
assume "a < b" hence "f a < f b" by (rule r)
also assume "f b <= c"
finally (less_le_trans) show ?thesis .
qed
-lemma order_less_le_subst1: "(a::'a::order) < f b ==> (b::'b::order) <= c ==>
- (!!x y. x <= y ==> f x <= f y) ==> a < f c"
+lemma order_less_le_subst1: "(a::'a::order) < f b \<Longrightarrow> (b::'b::order) <= c \<Longrightarrow>
+ (!!x y. x <= y \<Longrightarrow> f x <= f y) \<Longrightarrow> a < f c"
proof -
- assume r: "!!x y. x <= y ==> f x <= f y"
+ assume r: "!!x y. x <= y \<Longrightarrow> f x <= f y"
assume "a < f b"
also assume "b <= c" hence "f b <= f c" by (rule r)
finally (less_le_trans) show ?thesis .
qed
-lemma order_subst1: "(a::'a::order) <= f b ==> (b::'b::order) <= c ==>
- (!!x y. x <= y ==> f x <= f y) ==> a <= f c"
+lemma order_subst1: "(a::'a::order) <= f b \<Longrightarrow> (b::'b::order) <= c \<Longrightarrow>
+ (!!x y. x <= y \<Longrightarrow> f x <= f y) \<Longrightarrow> a <= f c"
proof -
- assume r: "!!x y. x <= y ==> f x <= f y"
+ assume r: "!!x y. x <= y \<Longrightarrow> f x <= f y"
assume "a <= f b"
also assume "b <= c" hence "f b <= f c" by (rule r)
finally (order_trans) show ?thesis .
qed
-lemma order_subst2: "(a::'a::order) <= b ==> f b <= (c::'c::order) ==>
- (!!x y. x <= y ==> f x <= f y) ==> f a <= c"
+lemma order_subst2: "(a::'a::order) <= b \<Longrightarrow> f b <= (c::'c::order) \<Longrightarrow>
+ (!!x y. x <= y \<Longrightarrow> f x <= f y) \<Longrightarrow> f a <= c"
proof -
- assume r: "!!x y. x <= y ==> f x <= f y"
+ assume r: "!!x y. x <= y \<Longrightarrow> f x <= f y"
assume "a <= b" hence "f a <= f b" by (rule r)
also assume "f b <= c"
finally (order_trans) show ?thesis .
qed
-lemma ord_le_eq_subst: "a <= b ==> f b = c ==>
- (!!x y. x <= y ==> f x <= f y) ==> f a <= c"
+lemma ord_le_eq_subst: "a <= b \<Longrightarrow> f b = c \<Longrightarrow>
+ (!!x y. x <= y \<Longrightarrow> f x <= f y) \<Longrightarrow> f a <= c"
proof -
- assume r: "!!x y. x <= y ==> f x <= f y"
+ assume r: "!!x y. x <= y \<Longrightarrow> f x <= f y"
assume "a <= b" hence "f a <= f b" by (rule r)
also assume "f b = c"
finally (ord_le_eq_trans) show ?thesis .
qed
-lemma ord_eq_le_subst: "a = f b ==> b <= c ==>
- (!!x y. x <= y ==> f x <= f y) ==> a <= f c"
+lemma ord_eq_le_subst: "a = f b \<Longrightarrow> b <= c \<Longrightarrow>
+ (!!x y. x <= y \<Longrightarrow> f x <= f y) \<Longrightarrow> a <= f c"
proof -
- assume r: "!!x y. x <= y ==> f x <= f y"
+ assume r: "!!x y. x <= y \<Longrightarrow> f x <= f y"
assume "a = f b"
also assume "b <= c" hence "f b <= f c" by (rule r)
finally (ord_eq_le_trans) show ?thesis .
qed
-lemma ord_less_eq_subst: "a < b ==> f b = c ==>
- (!!x y. x < y ==> f x < f y) ==> f a < c"
+lemma ord_less_eq_subst: "a < b \<Longrightarrow> f b = c \<Longrightarrow>
+ (!!x y. x < y \<Longrightarrow> f x < f y) \<Longrightarrow> f a < c"
proof -
- assume r: "!!x y. x < y ==> f x < f y"
+ assume r: "!!x y. x < y \<Longrightarrow> f x < f y"
assume "a < b" hence "f a < f b" by (rule r)
also assume "f b = c"
finally (ord_less_eq_trans) show ?thesis .
qed
-lemma ord_eq_less_subst: "a = f b ==> b < c ==>
- (!!x y. x < y ==> f x < f y) ==> a < f c"
+lemma ord_eq_less_subst: "a = f b \<Longrightarrow> b < c \<Longrightarrow>
+ (!!x y. x < y \<Longrightarrow> f x < f y) \<Longrightarrow> a < f c"
proof -
- assume r: "!!x y. x < y ==> f x < f y"
+ assume r: "!!x y. x < y \<Longrightarrow> f x < f y"
assume "a = f b"
also assume "b < c" hence "f b < f c" by (rule r)
finally (ord_eq_less_trans) show ?thesis .
@@ -975,7 +975,7 @@
trans
text \<open>These support proving chains of decreasing inequalities
- a >= b >= c ... in Isar proofs.\<close>
+ a \<open>\<ge>\<close> b \<open>\<ge>\<close> c ... in Isar proofs.\<close>
lemma xt1 [no_atp]:
"a = b \<Longrightarrow> b > c \<Longrightarrow> a > c"
@@ -997,54 +997,78 @@
by auto
lemma xt2 [no_atp]:
- "(a::'a::order) >= f b ==> b >= c ==> (!!x y. x >= y ==> f x >= f y) ==> a >= f c"
-by (subgoal_tac "f b >= f c", force, force)
+ assumes "(a::'a::order) \<ge> f b"
+ and "b \<ge> c"
+ and "\<And>x y. x \<ge> y \<Longrightarrow> f x \<ge> f y"
+ shows "a \<ge> f c"
+ using assms by force
-lemma xt3 [no_atp]: "(a::'a::order) >= b ==> (f b::'b::order) >= c ==>
- (!!x y. x >= y ==> f x >= f y) ==> f a >= c"
-by (subgoal_tac "f a >= f b", force, force)
+lemma xt3 [no_atp]:
+ assumes "(a::'a::order) \<ge> b"
+ and "(f b::'b::order) \<ge> c"
+ and "\<And>x y. x \<ge> y \<Longrightarrow> f x \<ge> f y"
+ shows "f a \<ge> c"
+ using assms by force
-lemma xt4 [no_atp]: "(a::'a::order) > f b ==> (b::'b::order) >= c ==>
- (!!x y. x >= y ==> f x >= f y) ==> a > f c"
-by (subgoal_tac "f b >= f c", force, force)
+lemma xt4 [no_atp]:
+ assumes "(a::'a::order) > f b"
+ and "(b::'b::order) \<ge> c"
+ and "\<And>x y. x \<ge> y \<Longrightarrow> f x \<ge> f y"
+ shows "a > f c"
+ using assms by force
-lemma xt5 [no_atp]: "(a::'a::order) > b ==> (f b::'b::order) >= c==>
- (!!x y. x > y ==> f x > f y) ==> f a > c"
-by (subgoal_tac "f a > f b", force, force)
+lemma xt5 [no_atp]:
+ assumes "(a::'a::order) > b"
+ and "(f b::'b::order) \<ge> c"
+ and "\<And>x y. x > y \<Longrightarrow> f x > f y"
+ shows "f a > c"
+ using assms by force
-lemma xt6 [no_atp]: "(a::'a::order) >= f b ==> b > c ==>
- (!!x y. x > y ==> f x > f y) ==> a > f c"
-by (subgoal_tac "f b > f c", force, force)
+lemma xt6 [no_atp]:
+ assumes "(a::'a::order) \<ge> f b"
+ and "b > c"
+ and "\<And>x y. x > y \<Longrightarrow> f x > f y"
+ shows "a > f c"
+ using assms by force
-lemma xt7 [no_atp]: "(a::'a::order) >= b ==> (f b::'b::order) > c ==>
- (!!x y. x >= y ==> f x >= f y) ==> f a > c"
-by (subgoal_tac "f a >= f b", force, force)
+lemma xt7 [no_atp]:
+ assumes "(a::'a::order) \<ge> b"
+ and "(f b::'b::order) > c"
+ and "\<And>x y. x \<ge> y \<Longrightarrow> f x \<ge> f y"
+ shows "f a > c"
+ using assms by force
-lemma xt8 [no_atp]: "(a::'a::order) > f b ==> (b::'b::order) > c ==>
- (!!x y. x > y ==> f x > f y) ==> a > f c"
-by (subgoal_tac "f b > f c", force, force)
+lemma xt8 [no_atp]:
+ assumes "(a::'a::order) > f b"
+ and "(b::'b::order) > c"
+ and "\<And>x y. x > y \<Longrightarrow> f x > f y"
+ shows "a > f c"
+ using assms by force
-lemma xt9 [no_atp]: "(a::'a::order) > b ==> (f b::'b::order) > c ==>
- (!!x y. x > y ==> f x > f y) ==> f a > c"
-by (subgoal_tac "f a > f b", force, force)
+lemma xt9 [no_atp]:
+ assumes "(a::'a::order) > b"
+ and "(f b::'b::order) > c"
+ and "\<And>x y. x > y \<Longrightarrow> f x > f y"
+ shows "f a > c"
+ using assms by force
lemmas xtrans = xt1 xt2 xt3 xt4 xt5 xt6 xt7 xt8 xt9
(*
- Since "a >= b" abbreviates "b <= a", the abbreviation "..." stands
+ Since "a \<ge> b" abbreviates "b \<le> a", the abbreviation "..." stands
for the wrong thing in an Isar proof.
The extra transitivity rules can be used as follows:
lemma "(a::'a::order) > z"
proof -
- have "a >= b" (is "_ >= ?rhs")
+ have "a \<ge> b" (is "_ \<ge> ?rhs")
sorry
- also have "?rhs >= c" (is "_ >= ?rhs")
+ also have "?rhs \<ge> c" (is "_ \<ge> ?rhs")
sorry
also (xtrans) have "?rhs = d" (is "_ = ?rhs")
sorry
- also (xtrans) have "?rhs >= e" (is "_ >= ?rhs")
+ also (xtrans) have "?rhs \<ge> e" (is "_ \<ge> ?rhs")
sorry
also (xtrans) have "?rhs > f" (is "_ > ?rhs")
sorry
--- a/src/HOL/Parity.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Parity.thy Fri Sep 02 13:41:55 2022 +0200
@@ -669,6 +669,44 @@
end
+
+subsection \<open>Computing congruences modulo \<open>2 ^ q\<close>\<close>
+
+context unique_euclidean_semiring_with_nat_division
+begin
+
+lemma cong_exp_iff_simps:
+ "numeral n mod numeral Num.One = 0
+ \<longleftrightarrow> True"
+ "numeral (Num.Bit0 n) mod numeral (Num.Bit0 q) = 0
+ \<longleftrightarrow> numeral n mod numeral q = 0"
+ "numeral (Num.Bit1 n) mod numeral (Num.Bit0 q) = 0
+ \<longleftrightarrow> False"
+ "numeral m mod numeral Num.One = (numeral n mod numeral Num.One)
+ \<longleftrightarrow> True"
+ "numeral Num.One mod numeral (Num.Bit0 q) = (numeral Num.One mod numeral (Num.Bit0 q))
+ \<longleftrightarrow> True"
+ "numeral Num.One mod numeral (Num.Bit0 q) = (numeral (Num.Bit0 n) mod numeral (Num.Bit0 q))
+ \<longleftrightarrow> False"
+ "numeral Num.One mod numeral (Num.Bit0 q) = (numeral (Num.Bit1 n) mod numeral (Num.Bit0 q))
+ \<longleftrightarrow> (numeral n mod numeral q) = 0"
+ "numeral (Num.Bit0 m) mod numeral (Num.Bit0 q) = (numeral Num.One mod numeral (Num.Bit0 q))
+ \<longleftrightarrow> False"
+ "numeral (Num.Bit0 m) mod numeral (Num.Bit0 q) = (numeral (Num.Bit0 n) mod numeral (Num.Bit0 q))
+ \<longleftrightarrow> numeral m mod numeral q = (numeral n mod numeral q)"
+ "numeral (Num.Bit0 m) mod numeral (Num.Bit0 q) = (numeral (Num.Bit1 n) mod numeral (Num.Bit0 q))
+ \<longleftrightarrow> False"
+ "numeral (Num.Bit1 m) mod numeral (Num.Bit0 q) = (numeral Num.One mod numeral (Num.Bit0 q))
+ \<longleftrightarrow> (numeral m mod numeral q) = 0"
+ "numeral (Num.Bit1 m) mod numeral (Num.Bit0 q) = (numeral (Num.Bit0 n) mod numeral (Num.Bit0 q))
+ \<longleftrightarrow> False"
+ "numeral (Num.Bit1 m) mod numeral (Num.Bit0 q) = (numeral (Num.Bit1 n) mod numeral (Num.Bit0 q))
+ \<longleftrightarrow> numeral m mod numeral q = (numeral n mod numeral q)"
+ by (auto simp add: case_prod_beta dest: arg_cong [of _ _ even])
+
+end
+
+
code_identifier
code_module Parity \<rightharpoonup> (SML) Arith and (OCaml) Arith and (Haskell) Arith
--- a/src/HOL/Partial_Function.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Partial_Function.thy Fri Sep 02 13:41:55 2022 +0200
@@ -219,11 +219,18 @@
and step: "\<And>f. P (U f) \<Longrightarrow> P (U (F f))"
shows "P (U f)"
unfolding eq inverse
-apply (rule ccpo.fixp_induct[OF ccpo adm])
-apply (insert mono, auto simp: monotone_def fun_ord_def bot fun_lub_def)[2]
-apply (rule_tac f5="C x" in step)
-apply (simp add: inverse)
-done
+proof (rule ccpo.fixp_induct[OF ccpo adm])
+ show "monotone le_fun le_fun (\<lambda>f. U (F (C f)))"
+ using mono by (auto simp: monotone_def fun_ord_def)
+next
+ show "P (lub_fun {})"
+ by (auto simp: bot fun_lub_def)
+next
+ fix x
+ assume "P x"
+ then show "P (U (F (C x)))"
+ using step[of "C x"] by (simp add: inverse)
+qed
text \<open>Rules for \<^term>\<open>mono_body\<close>:\<close>
--- a/src/HOL/Power.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Power.thy Fri Sep 02 13:41:55 2022 +0200
@@ -368,7 +368,7 @@
also from \<open>m > n\<close> have "m = n + (m - n)" by simp
also have "x ^ \<dots> = x ^ n * x ^ (m - n)" by (rule power_add)
finally have "x ^ (m - n) dvd 1"
- by (subst (asm) dvd_times_left_cancel_iff) (insert assms, simp_all)
+ using assms by (subst (asm) dvd_times_left_cancel_iff) simp_all
with \<open>m > n\<close> have "is_unit x" by (simp add: is_unit_power_iff)
}
thus "is_unit x \<or> m \<le> n" by force
@@ -490,9 +490,16 @@
\<close>
lemma power_less_imp_less_exp: "1 < a \<Longrightarrow> a ^ m < a ^ n \<Longrightarrow> m < n"
by (simp add: order_less_le [of m n] less_le [of "a^m" "a^n"] power_le_imp_le_exp)
-
-lemma power_strict_mono [rule_format]: "a < b \<Longrightarrow> 0 \<le> a \<Longrightarrow> 0 < n \<longrightarrow> a ^ n < b ^ n"
- by (induct n) (auto simp: mult_strict_mono le_less_trans [of 0 a b])
+
+lemma power_strict_mono: "a < b \<Longrightarrow> 0 \<le> a \<Longrightarrow> 0 < n \<Longrightarrow> a ^ n < b ^ n"
+proof (induct n)
+ case 0
+ then show ?case by simp
+next
+ case (Suc n)
+ then show ?case
+ by (cases "n = 0") (auto simp: mult_strict_mono le_less_trans [of 0 a b])
+qed
lemma power_mono_iff [simp]:
shows "\<lbrakk>a \<ge> 0; b \<ge> 0; n>0\<rbrakk> \<Longrightarrow> a ^ n \<le> b ^ n \<longleftrightarrow> a \<le> b"
@@ -502,35 +509,27 @@
lemma power_Suc_less: "0 < a \<Longrightarrow> a < 1 \<Longrightarrow> a * a ^ n < a ^ n"
by (induct n) (auto simp: mult_strict_left_mono)
-lemma power_strict_decreasing [rule_format]: "n < N \<Longrightarrow> 0 < a \<Longrightarrow> a < 1 \<longrightarrow> a ^ N < a ^ n"
-proof (induct N)
+lemma power_strict_decreasing: "n < N \<Longrightarrow> 0 < a \<Longrightarrow> a < 1 \<Longrightarrow> a ^ N < a ^ n"
+proof (induction N)
+ case 0
+ then show ?case by simp
+ next
+ case (Suc N)
+ then show ?case
+ using mult_strict_mono[of a 1 "a ^ N" "a ^ n"]
+ by (auto simp add: power_Suc_less less_Suc_eq)
+ qed
+
+text \<open>Proof resembles that of \<open>power_strict_decreasing\<close>.\<close>
+lemma power_decreasing: "n \<le> N \<Longrightarrow> 0 \<le> a \<Longrightarrow> a \<le> 1 \<Longrightarrow> a ^ N \<le> a ^ n"
+proof (induction N)
case 0
then show ?case by simp
next
case (Suc N)
then show ?case
- apply (auto simp add: power_Suc_less less_Suc_eq)
- apply (subgoal_tac "a * a^N < 1 * a^n")
- apply simp
- apply (rule mult_strict_mono)
- apply auto
- done
-qed
-
-text \<open>Proof resembles that of \<open>power_strict_decreasing\<close>.\<close>
-lemma power_decreasing: "n \<le> N \<Longrightarrow> 0 \<le> a \<Longrightarrow> a \<le> 1 \<Longrightarrow> a ^ N \<le> a ^ n"
-proof (induct N)
- case 0
- then show ?case by simp
-next
- case (Suc N)
- then show ?case
- apply (auto simp add: le_Suc_eq)
- apply (subgoal_tac "a * a^N \<le> 1 * a^n")
- apply simp
- apply (rule mult_mono)
- apply auto
- done
+ using mult_mono[of a 1 "a^N" "a ^ n"]
+ by (auto simp add: le_Suc_eq)
qed
lemma power_decreasing_iff [simp]: "\<lbrakk>0 < b; b < 1\<rbrakk> \<Longrightarrow> b ^ m \<le> b ^ n \<longleftrightarrow> n \<le> m"
@@ -552,12 +551,8 @@
next
case (Suc N)
then show ?case
- apply (auto simp add: le_Suc_eq)
- apply (subgoal_tac "1 * a^n \<le> a * a^N")
- apply simp
- apply (rule mult_mono)
- apply (auto simp add: order_trans [OF zero_le_one])
- done
+ using mult_mono[of 1 a "a ^ n" "a ^ N"]
+ by (auto simp add: le_Suc_eq order_trans [OF zero_le_one])
qed
text \<open>Lemma for \<open>power_strict_increasing\<close>.\<close>
@@ -571,12 +566,8 @@
next
case (Suc N)
then show ?case
- apply (auto simp add: power_less_power_Suc less_Suc_eq)
- apply (subgoal_tac "1 * a^n < a * a^N")
- apply simp
- apply (rule mult_strict_mono)
- apply (auto simp add: less_trans [OF zero_less_one] less_imp_le)
- done
+ using mult_strict_mono[of 1 a "a^n" "a^N"]
+ by (auto simp add: power_less_power_Suc less_Suc_eq less_trans [OF zero_less_one] less_imp_le)
qed
lemma power_increasing_iff [simp]: "1 < b \<Longrightarrow> b ^ x \<le> b ^ y \<longleftrightarrow> x \<le> y"
--- a/src/HOL/Presburger.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Presburger.thy Fri Sep 02 13:41:55 2022 +0200
@@ -28,7 +28,36 @@
"\<exists>z.\<forall>(x::'b::{linorder,plus,Rings.dvd})<z. (d dvd x + s) = (d dvd x + s)"
"\<exists>z.\<forall>(x::'b::{linorder,plus,Rings.dvd})<z. (\<not> d dvd x + s) = (\<not> d dvd x + s)"
"\<exists>z.\<forall>x<z. F = F"
- by ((erule exE, erule exE,rule_tac x="min z za" in exI,simp)+, (rule_tac x="t" in exI,fastforce)+) simp_all
+proof safe
+ fix z1 z2
+ assume "\<forall>x<z1. P x = P' x" and "\<forall>x<z2. Q x = Q' x"
+ then have "\<forall>x < min z1 z2. (P x \<and> Q x) = (P' x \<and> Q' x)"
+ by simp
+ then show "\<exists>z. \<forall>x<z. (P x \<and> Q x) = (P' x \<and> Q' x)"
+ by blast
+next
+ fix z1 z2
+ assume "\<forall>x<z1. P x = P' x" and "\<forall>x<z2. Q x = Q' x"
+ then have "\<forall>x < min z1 z2. (P x \<or> Q x) = (P' x \<or> Q' x)"
+ by simp
+ then show "\<exists>z. \<forall>x<z. (P x \<or> Q x) = (P' x \<or> Q' x)"
+ by blast
+next
+ have "\<forall>x<t. x \<le> t"
+ by fastforce
+ then show "\<exists>z. \<forall>x<z. (x \<le> t) = True"
+ by auto
+next
+ have "\<forall>x<t. \<not> t < x"
+ by fastforce
+ then show "\<exists>z. \<forall>x<z. (t < x) = False"
+ by auto
+next
+ have "\<forall>x<t. \<not> t \<le> x"
+ by fastforce
+ then show "\<exists>z. \<forall>x<z. (t \<le> x) = False"
+ by auto
+qed auto
lemma pinf:
"\<lbrakk>\<exists>(z ::'a::linorder).\<forall>x>z. P x = P' x; \<exists>z.\<forall>x>z. Q x = Q' x\<rbrakk>
@@ -44,7 +73,36 @@
"\<exists>z.\<forall>(x::'b::{linorder,plus,Rings.dvd})>z. (d dvd x + s) = (d dvd x + s)"
"\<exists>z.\<forall>(x::'b::{linorder,plus,Rings.dvd})>z. (\<not> d dvd x + s) = (\<not> d dvd x + s)"
"\<exists>z.\<forall>x>z. F = F"
- by ((erule exE, erule exE,rule_tac x="max z za" in exI,simp)+,(rule_tac x="t" in exI,fastforce)+) simp_all
+proof safe
+ fix z1 z2
+ assume "\<forall>x>z1. P x = P' x" and "\<forall>x>z2. Q x = Q' x"
+ then have "\<forall>x > max z1 z2. (P x \<and> Q x) = (P' x \<and> Q' x)"
+ by simp
+ then show "\<exists>z. \<forall>x>z. (P x \<and> Q x) = (P' x \<and> Q' x)"
+ by blast
+next
+ fix z1 z2
+ assume "\<forall>x>z1. P x = P' x" and "\<forall>x>z2. Q x = Q' x"
+ then have "\<forall>x > max z1 z2. (P x \<or> Q x) = (P' x \<or> Q' x)"
+ by simp
+ then show "\<exists>z. \<forall>x>z. (P x \<or> Q x) = (P' x \<or> Q' x)"
+ by blast
+next
+ have "\<forall>x>t. \<not> x < t"
+ by fastforce
+ then show "\<exists>z. \<forall>x>z. x < t = False"
+ by blast
+next
+ have "\<forall>x>t. \<not> x \<le> t"
+ by fastforce
+ then show "\<exists>z. \<forall>x>z. x \<le> t = False"
+ by blast
+next
+ have "\<forall>x>t. t \<le> x"
+ by fastforce
+ then show "\<exists>z. \<forall>x>z. t \<le> x = True"
+ by blast
+qed auto
lemma inf_period:
"\<lbrakk>\<forall>x k. P x = P (x - k*D); \<forall>x k. Q x = Q (x - k*D)\<rbrakk>
@@ -166,8 +224,19 @@
thus "\<forall>x.(\<forall>j\<in>{1 .. D}. \<forall>b\<in>A. x \<noteq> b - j)\<longrightarrow> (x \<le> t) \<longrightarrow> (x + D \<le> t)" by blast
next
assume d: "d dvd D"
- {fix x assume H: "d dvd x + t" with d have "d dvd (x + D) + t"
- by (clarsimp simp add: dvd_def,rule_tac x= "ka + k" in exI,simp add: algebra_simps)}
+ have "\<And>x. d dvd x + t \<Longrightarrow> d dvd x + D + t"
+ proof -
+ fix x
+ assume H: "d dvd x + t"
+ then obtain ka where "x + t = d * ka"
+ unfolding dvd_def by blast
+ moreover from d obtain k where *:"D = d * k"
+ unfolding dvd_def by blast
+ ultimately have "x + d * k + t = d * (ka + k)"
+ by (simp add: algebra_simps)
+ then show "d dvd (x + D) + t"
+ using * unfolding dvd_def by blast
+ qed
thus "\<forall>(x::int).(\<forall>j\<in>{1 .. D}. \<forall>b\<in>A. x \<noteq> b - j)\<longrightarrow> (d dvd x+t) \<longrightarrow> (d dvd (x + D) + t)" by simp
next
assume d: "d dvd D"
@@ -346,20 +415,7 @@
done
theorem unity_coeff_ex: "(\<exists>(x::'a::{semiring_0,Rings.dvd}). P (l * x)) \<equiv> (\<exists>x. l dvd (x + 0) \<and> P x)"
- apply (rule eq_reflection [symmetric])
- apply (rule iffI)
- defer
- apply (erule exE)
- apply (rule_tac x = "l * x" in exI)
- apply (simp add: dvd_def)
- apply (rule_tac x = x in exI, simp)
- apply (erule exE)
- apply (erule conjE)
- apply simp
- apply (erule dvdE)
- apply (rule_tac x = k in exI)
- apply simp
- done
+ unfolding dvd_def by (rule eq_reflection, rule iffI) auto
lemma zdvd_mono:
fixes k m t :: int
--- a/src/HOL/Product_Type.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Product_Type.thy Fri Sep 02 13:41:55 2022 +0200
@@ -177,7 +177,7 @@
end
lemma [code]: "HOL.equal u v \<longleftrightarrow> True" for u v :: unit
- unfolding equal unit_eq [of u] unit_eq [of v] by rule+
+ unfolding equal unit_eq [of u] unit_eq [of v] by (rule iffI TrueI refl)+
code_printing
type_constructor unit \<rightharpoonup>
@@ -694,7 +694,12 @@
lemma prod_cases3 [cases type]:
obtains (fields) a b c where "y = (a, b, c)"
- by (cases y, case_tac b) blast
+proof (cases y)
+ case (Pair a b)
+ with that show ?thesis
+ by (cases b) blast
+qed
+
lemma prod_induct3 [case_names fields, induct type]:
"(\<And>a b c. P (a, b, c)) \<Longrightarrow> P x"
@@ -702,7 +707,11 @@
lemma prod_cases4 [cases type]:
obtains (fields) a b c d where "y = (a, b, c, d)"
- by (cases y, case_tac c) blast
+proof (cases y)
+ case (fields a b c)
+ with that show ?thesis
+ by (cases c) blast
+qed
lemma prod_induct4 [case_names fields, induct type]:
"(\<And>a b c d. P (a, b, c, d)) \<Longrightarrow> P x"
@@ -710,7 +719,11 @@
lemma prod_cases5 [cases type]:
obtains (fields) a b c d e where "y = (a, b, c, d, e)"
- by (cases y, case_tac d) blast
+proof (cases y)
+ case (fields a b c d)
+ with that show ?thesis
+ by (cases d) blast
+qed
lemma prod_induct5 [case_names fields, induct type]:
"(\<And>a b c d e. P (a, b, c, d, e)) \<Longrightarrow> P x"
@@ -718,7 +731,11 @@
lemma prod_cases6 [cases type]:
obtains (fields) a b c d e f where "y = (a, b, c, d, e, f)"
- by (cases y, case_tac e) blast
+proof (cases y)
+ case (fields a b c d e)
+ with that show ?thesis
+ by (cases e) blast
+qed
lemma prod_induct6 [case_names fields, induct type]:
"(\<And>a b c d e f. P (a, b, c, d, e, f)) \<Longrightarrow> P x"
@@ -726,7 +743,12 @@
lemma prod_cases7 [cases type]:
obtains (fields) a b c d e f g where "y = (a, b, c, d, e, f, g)"
- by (cases y, case_tac f) blast
+proof (cases y)
+ case (fields a b c d e f)
+ with that show ?thesis
+ by (cases f) blast
+qed
+
lemma prod_induct7 [case_names fields, induct type]:
"(\<And>a b c d e f g. P (a, b, c, d, e, f, g)) \<Longrightarrow> P x"
@@ -852,11 +874,12 @@
assumes major: "c \<in> map_prod f g ` R"
and cases: "\<And>x y. c = (f x, g y) \<Longrightarrow> (x, y) \<in> R \<Longrightarrow> P"
shows P
- apply (rule major [THEN imageE])
- apply (case_tac x)
- apply (rule cases)
- apply simp_all
- done
+proof (rule major [THEN imageE])
+ fix x
+ assume "c = map_prod f g x" "x \<in> R"
+ then show P
+ using cases by (cases x) simp
+qed
definition apfst :: "('a \<Rightarrow> 'c) \<Rightarrow> 'a \<times> 'b \<Rightarrow> 'c \<times> 'b"
where "apfst f = map_prod f id"
--- a/src/HOL/Quotient.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Quotient.thy Fri Sep 02 13:41:55 2022 +0200
@@ -148,8 +148,8 @@
moreover
have "(R1 ===> R2) ((abs1 ---> rep2) a) ((abs1 ---> rep2) a)" for a
by (rule rel_funI)
- (insert q1 q2 Quotient3_rel_abs [of R1 abs1 rep1] Quotient3_rel_rep [of R2 abs2 rep2],
- simp (no_asm) add: Quotient3_def, simp)
+ (use q1 q2 Quotient3_rel_abs [of R1 abs1 rep1] Quotient3_rel_rep [of R2 abs2 rep2]
+ in \<open>simp (no_asm) add: Quotient3_def, simp\<close>)
moreover
have "(R1 ===> R2) r s = ((R1 ===> R2) r r \<and> (R1 ===> R2) s s \<and>
(rep1 ---> abs2) r = (rep1 ---> abs2) s)" for r s
@@ -322,9 +322,9 @@
lemma babs_rsp:
assumes q: "Quotient3 R1 Abs1 Rep1"
- and a: "(R1 ===> R2) f g"
- shows "(R1 ===> R2) (Babs (Respects R1) f) (Babs (Respects R1) g)"
-proof (clarsimp simp add: Babs_def in_respects rel_fun_def)
+ and a: "(R1 ===> R2) f g"
+ shows "(R1 ===> R2) (Babs (Respects R1) f) (Babs (Respects R1) g)"
+proof
fix x y
assume "R1 x y"
then have "x \<in> Respects R1 \<and> y \<in> Respects R1"
@@ -542,7 +542,7 @@
then have "Abs (Collect (R r)) = Abs (Collect (R s)) \<longleftrightarrow> Collect (R r) = Collect (R s)"
by (metis abs_inverse)
also have "Collect (R r) = Collect (R s) \<longleftrightarrow> (\<lambda>A x. x \<in> A) (Collect (R r)) = (\<lambda>A x. x \<in> A) (Collect (R s))"
- by rule simp_all
+ by (rule iffI) simp_all
finally show "Abs (Collect (R r)) = Abs (Collect (R s)) \<longleftrightarrow> R r = R s" by simp
qed
then show "R r s \<longleftrightarrow> R r r \<and> R s s \<and> (Abs (Collect (R r)) = Abs (Collect (R s)))"
--- a/src/HOL/ROOT Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/ROOT Fri Sep 02 13:41:55 2022 +0200
@@ -29,6 +29,7 @@
Commands
Drinker
Functions
+ Gauss_Numbers
Groebner_Examples
Iff_Oracle
Induction_Schema
@@ -58,6 +59,8 @@
description "
Classical Higher-order Logic -- batteries included.
"
+ theories [document = false]
+ README
theories
Library
(*conflicting type class instantiations and dependent applications*)
@@ -72,6 +75,7 @@
Datatype_Records
(*data refinements and dependent applications*)
AList_Mapping
+ Code_Abstract_Char
Code_Binary_Nat
Code_Prolog
Code_Real_Approx_By_Float
@@ -326,6 +330,8 @@
Verification of imperative programs (verification conditions are generated
automatically from pre/post conditions and loop invariants).
"
+ theories [document = false]
+ README
theories
Examples
ExamplesAbort
@@ -406,6 +412,8 @@
sessions
"HOL-Cardinals"
"HOL-Combinatorics"
+ theories [document = false]
+ README
theories
(* Orders and Lattices *)
Galois_Connection (* Knaster-Tarski theorem and Galois connections *)
@@ -429,10 +437,15 @@
"
sessions "HOL-Library"
directories "Smartcard" "Guard"
+ theories [document = false]
+ README
theories
Auth_Shared
Auth_Public
"Smartcard/Auth_Smartcard"
+ theories [document = false]
+ "Guard/README_Guard"
+ theories
"Guard/Auth_Guard_Shared"
"Guard/Auth_Guard_Public"
document_files "root.tex"
@@ -445,10 +458,15 @@
Verifying security protocols using Chandy and Misra's UNITY formalism.
"
directories "Simple" "Comp"
+ theories [document = false]
+ README
theories
(*Basic meta-theory*)
UNITY_Main
+ theories [document = false]
+ "Simple/README_Simple"
+ theories
(*Simple examples: no composition*)
"Simple/Deadlock"
"Simple/Common"
@@ -463,6 +481,9 @@
(*Verifying security protocols using UNITY*)
"Simple/NSP_Bad"
+ theories [document = false]
+ "Comp/README_Comp"
+ theories
(*Example of composition*)
"Comp/Handshake"
@@ -707,7 +728,6 @@
Specifications_with_bundle_mixins
Sqrt_Script
Sudoku
- Sum_of_Powers
Tarski
Termination
ThreeDivides
@@ -783,7 +803,9 @@
description "
Lamport's Temporal Logic of Actions.
"
- theories TLA
+ theories
+ README
+ TLA
session "HOL-TLA-Inc" in "TLA/Inc" = "HOL-TLA" +
theories Inc
@@ -1083,6 +1105,8 @@
"
sessions
"HOL-Library"
+ theories [document = false]
+ README
theories
HOLCF (global)
document_files "root.tex"
--- a/src/HOL/Real.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Real.thy Fri Sep 02 13:41:55 2022 +0200
@@ -1076,6 +1076,12 @@
lemma real_of_nat_div4: "real (n div x) \<le> real n / real x" for n x :: nat
using real_of_nat_div2 [of n x] by simp
+lemma real_binomial_eq_mult_binomial_Suc:
+ assumes "k \<le> n"
+ shows "real(n choose k) = (n + 1 - k) / (n + 1) * (Suc n choose k)"
+ using assms
+ by (simp add: of_nat_binomial_eq_mult_binomial_Suc [of k n] add.commute of_nat_diff)
+
subsection \<open>The Archimedean Property of the Reals\<close>
--- a/src/HOL/Relation.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Relation.thy Fri Sep 02 13:41:55 2022 +0200
@@ -1180,12 +1180,19 @@
by blast
text \<open>Converse inclusion requires some assumptions\<close>
-lemma Image_INT_eq: "single_valued (r\<inverse>) \<Longrightarrow> A \<noteq> {} \<Longrightarrow> r `` (\<Inter>(B ` A)) = (\<Inter>x\<in>A. r `` B x)"
- apply (rule equalityI)
- apply (rule Image_INT_subset)
- apply (auto simp add: single_valued_def)
- apply blast
- done
+lemma Image_INT_eq:
+ assumes "single_valued (r\<inverse>)"
+ and "A \<noteq> {}"
+ shows "r `` (\<Inter>(B ` A)) = (\<Inter>x\<in>A. r `` B x)"
+proof(rule equalityI, rule Image_INT_subset)
+ show "(\<Inter>x\<in>A. r `` B x) \<subseteq> r `` \<Inter> (B ` A)"
+ proof
+ fix x
+ assume "x \<in> (\<Inter>x\<in>A. r `` B x)"
+ then show "x \<in> r `` \<Inter> (B ` A)"
+ using assms unfolding single_valued_def by simp blast
+ qed
+qed
lemma Image_subset_eq: "r``A \<subseteq> B \<longleftrightarrow> A \<subseteq> - ((r\<inverse>) `` (- B))"
by blast
--- a/src/HOL/Rings.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Rings.thy Fri Sep 02 13:41:55 2022 +0200
@@ -191,7 +191,7 @@
by (auto intro: dvdI)
lemma dvd_mult [simp]: "a dvd (b * c)" if "a dvd c"
- using that by rule (auto intro: mult.left_commute dvdI)
+ using that by (auto intro: mult.left_commute dvdI)
lemma dvd_mult2 [simp]: "a dvd (b * c)" if "a dvd b"
using that dvd_mult [of a b c] by (simp add: ac_simps)
@@ -382,7 +382,7 @@
subclass semiring_1_cancel ..
-lemma of_bool_not_iff [simp]:
+lemma of_bool_not_iff:
\<open>of_bool (\<not> P) = 1 - of_bool P\<close>
by simp
@@ -560,6 +560,26 @@
then show "a * a = b * b" by auto
qed
+lemma inj_mult_left [simp]: \<open>inj ((*) a) \<longleftrightarrow> a \<noteq> 0\<close> (is \<open>?P \<longleftrightarrow> ?Q\<close>)
+proof
+ assume ?P
+ show ?Q
+ proof
+ assume \<open>a = 0\<close>
+ with \<open>?P\<close> have "inj ((*) 0)"
+ by simp
+ moreover have "0 * 0 = 0 * 1"
+ by simp
+ ultimately have "0 = 1"
+ by (rule injD)
+ then show False
+ by simp
+ qed
+next
+ assume ?Q then show ?P
+ by (auto intro: injI)
+qed
+
end
class idom_abs_sgn = idom + abs + sgn +
@@ -1175,7 +1195,7 @@
lemma unit_div_eq_0_iff:
assumes "is_unit b"
shows "a div b = 0 \<longleftrightarrow> a = 0"
- by (rule dvd_div_eq_0_iff) (insert assms, auto)
+ using assms by (simp add: dvd_div_eq_0_iff unit_imp_dvd)
lemma div_mult_unit2:
"is_unit c \<Longrightarrow> b dvd a \<Longrightarrow> a div (b * c) = a div b div c"
@@ -1542,7 +1562,7 @@
lemma coprime_normalize_left_iff [simp]:
"coprime (normalize a) b \<longleftrightarrow> coprime a b"
- by (rule; rule coprimeI) (auto intro: coprime_common_divisor)
+ by (rule iffI; rule coprimeI) (auto intro: coprime_common_divisor)
lemma coprime_normalize_right_iff [simp]:
"coprime a (normalize b) \<longleftrightarrow> coprime a b"
@@ -2039,7 +2059,7 @@
lemma mult_strict_mono':
assumes "a < b" and "c < d" and "0 \<le> a" and "0 \<le> c"
shows "a * c < b * d"
- by (rule mult_strict_mono) (insert assms, auto)
+ using assms by (auto simp add: mult_strict_mono)
lemma mult_less_le_imp_less:
assumes "a < b" and "c \<le> d" and "0 \<le> a" and "0 < c"
@@ -2365,7 +2385,7 @@
begin
subclass zero_neq_one
- by standard (insert zero_less_one, blast)
+ by standard
subclass comm_semiring_1
by standard (rule mult_1_left)
@@ -2405,10 +2425,12 @@
subclass linordered_nonzero_semiring
proof
show "a + 1 < b + 1" if "a < b" for a b
- proof (rule ccontr, simp add: not_less)
- assume "b \<le> a"
- with that show False
+ proof (rule ccontr)
+ assume "\<not> a + 1 < b + 1"
+ moreover with that have "a + 1 < b + 1"
by simp
+ ultimately show False
+ by contradiction
qed
qed
@@ -2565,6 +2587,10 @@
"sgn a * sgn a = of_bool (a \<noteq> 0)"
by (cases "a > 0") simp_all
+lemma left_sgn_mult_self_eq [simp]:
+ \<open>sgn a * (sgn a * b) = of_bool (a \<noteq> 0) * b\<close>
+ by (simp flip: mult.assoc)
+
lemma abs_mult_self_eq [simp]:
"\<bar>a\<bar> * \<bar>a\<bar> = a * a"
by (cases "a > 0") simp_all
@@ -2645,6 +2671,12 @@
shows "x+y < 0 \<Longrightarrow> x<0 \<or> y<0"
by (auto simp: not_less intro: le_less_trans [of _ "x+y"])
+text \<open>
+ Is this really better than just rewriting with \<open>abs_if\<close>?
+\<close>
+lemma abs_split [no_atp]: \<open>P \<bar>a\<bar> \<longleftrightarrow> (0 \<le> a \<longrightarrow> P a) \<and> (a < 0 \<longrightarrow> P (- a))\<close>
+ by (force dest: order_less_le_trans simp add: abs_if linorder_not_less)
+
end
text \<open>Reasoning about inequalities with division\<close>
--- a/src/HOL/SMT.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/SMT.thy Fri Sep 02 13:41:55 2022 +0200
@@ -445,7 +445,7 @@
lemmas [smt_arith_simplify] =
div_add dvd_numeral_simp divmod_steps less_num_simps le_num_simps if_True if_False divmod_cancel
- dvd_mult dvd_mult2 less_irrefl prod.case numeral_plus_one divmod_step_eq order.refl le_zero_eq
+ dvd_mult dvd_mult2 less_irrefl prod.case numeral_plus_one divmod_step_def order.refl le_zero_eq
le_numeral_simps less_numeral_simps mult.right_neutral simp_thms divides_aux_eq
mult_nonneg_nonneg dvd_imp_mod_0 dvd_add zero_less_one mod_mult_self4 numeral_mod_numeral
divmod_trivial prod.sel mult.left_neutral div_pos_pos_trivial arith_simps div_add div_mult_self1
@@ -453,7 +453,7 @@
zero_neq_one zero_le_one le_num_simps add_Suc mod_div_trivial nat.distinct mult_minus_right
add.inverse_inverse distrib_left_numeral mult_num_simps numeral_times_numeral add_num_simps
divmod_steps rel_simps if_True if_False numeral_div_numeral divmod_cancel prod.case
- add_num_simps one_plus_numeral fst_conv divmod_step_eq arith_simps sub_num_simps dbl_inc_simps
+ add_num_simps one_plus_numeral fst_conv arith_simps sub_num_simps dbl_inc_simps
dbl_simps mult_1 add_le_cancel_right left_diff_distrib_numeral add_uminus_conv_diff zero_neq_one
zero_le_one One_nat_def add_Suc mod_div_trivial nat.distinct of_int_1 numerals numeral_One
of_int_numeral add_uminus_conv_diff zle_diff1_eq add_less_same_cancel2 minus_add_distrib
@@ -622,12 +622,11 @@
ML_file \<open>Tools/SMT/z3_proof.ML\<close>
ML_file \<open>Tools/SMT/z3_isar.ML\<close>
ML_file \<open>Tools/SMT/smt_solver.ML\<close>
-ML_file \<open>Tools/SMT/cvc4_interface.ML\<close>
+ML_file \<open>Tools/SMT/cvc_interface.ML\<close>
ML_file \<open>Tools/SMT/lethe_proof.ML\<close>
ML_file \<open>Tools/SMT/lethe_isar.ML\<close>
ML_file \<open>Tools/SMT/lethe_proof_parse.ML\<close>
-ML_file \<open>Tools/SMT/cvc4_proof_parse.ML\<close>
-ML_file \<open>Tools/SMT/verit_proof.ML\<close>
+ML_file \<open>Tools/SMT/cvc_proof_parse.ML\<close>
ML_file \<open>Tools/SMT/conj_disj_perm.ML\<close>
ML_file \<open>Tools/SMT/smt_replay_methods.ML\<close>
ML_file \<open>Tools/SMT/smt_replay.ML\<close>
@@ -638,6 +637,7 @@
ML_file \<open>Tools/SMT/z3_replay.ML\<close>
ML_file \<open>Tools/SMT/lethe_replay_methods.ML\<close>
ML_file \<open>Tools/SMT/verit_replay_methods.ML\<close>
+ML_file \<open>Tools/SMT/verit_strategies.ML\<close>
ML_file \<open>Tools/SMT/verit_replay.ML\<close>
ML_file \<open>Tools/SMT/smt_systems.ML\<close>
@@ -691,6 +691,7 @@
\<close>
declare [[cvc4_options = ""]]
+declare [[cvc5_options = ""]]
declare [[verit_options = ""]]
declare [[z3_options = ""]]
@@ -705,11 +706,11 @@
text \<open>
Enable the following option to use built-in support for datatypes,
-codatatypes, and records in CVC4. Currently, this is implemented only
-in oracle mode.
+codatatypes, and records in CVC4 and cvc5. Currently, this is implemented
+only in oracle mode.
\<close>
-declare [[cvc4_extensions = false]]
+declare [[cvc_extensions = false]]
text \<open>
Enable the following option to use built-in support for div/mod, datatypes,
@@ -890,6 +891,7 @@
"(if P then \<not> Q else R) \<or> \<not> P \<or> Q"
"(if P then Q else \<not> R) \<or> P \<or> R"
by auto
+
hide_type (open) symb_list pattern
hide_const (open) Symb_Nil Symb_Cons trigger pat nopat fun_app z3div z3mod
--- a/src/HOL/SMT_Examples/SMT_Examples_Verit.certs Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/SMT_Examples/SMT_Examples_Verit.certs Fri Sep 02 13:41:55 2022 +0200
@@ -8866,3 +8866,3566 @@
(step t354 (cl @p_704 @p_705 @p_588 @p_625 @p_626 @p_413) :rule th_resolution :premises (t353 t261))
(step t355 (cl @p_705 @p_588 @p_625 @p_626 @p_413 @p_661 @p_693 @p_689 @p_595) :rule th_resolution :premises (t354 t337))
(step t356 (cl) :rule resolution :premises (t355 t350 t168 t266 t352 t200 t207 t232 t234 t329))
+eae55ce4deb2476399eb5222073e987ca2cc4536 3015 0
+unsat
+(define-fun veriT_sk0 () A_b_c_M_state_fun$ (! (choice ((veriT_vr57 A_b_c_M_state_fun$)) (not (forall ((veriT_vr58 A_b_c_M_state_fun$)) (! (=> (! (forall ((veriT_vr59 A$) (veriT_vr60 C$)) (! (or (! (is_fail$ (! (run$ (! (fun_app$ veriT_vr57 veriT_vr59) :named @p_552) veriT_vr60) :named @p_544)) :named @p_542) (! (and (! (= (! (is_fail$ (! (run$ (! (fun_app$ veriT_vr58 veriT_vr59) :named @p_554) veriT_vr60) :named @p_543)) :named @p_556) @p_542) :named @p_561) (! (forall ((veriT_vr61 B$) (veriT_vr62 C$)) (! (= (! (is_res$ @p_543 (! (pair$ veriT_vr61 veriT_vr62) :named @p_545)) :named @p_566) (! (is_res$ @p_544 @p_545) :named @p_570)) :named @p_571)) :named @p_562)) :named @p_572)) :named @p_573)) :named @p_551) (! (forall ((veriT_vr63 D$)) (! (or (! (is_fail$a (! (run$a (! (b$ veriT_vr57) :named @p_575) veriT_vr63) :named @p_546)) :named @p_548) (! (exists ((veriT_vr64 E$) (veriT_vr65 D$)) (! (and (! (is_res$a @p_546 (! (pair$a veriT_vr64 veriT_vr65) :named @p_580)) :named @p_581) (! (is_fail$b (! (run$b (! (c$ veriT_vr64 veriT_vr57) :named @p_583) veriT_vr65) :named @p_585)) :named @p_586)) :named @p_587)) :named @p_576) (! (and (! (and (! (=> (! (or (! (is_fail$a (! (run$a (! (b$ veriT_vr58) :named @p_588) veriT_vr63) :named @p_547)) :named @p_549) (! (exists ((veriT_vr66 E$) (veriT_vr67 D$)) (! (and (! (is_res$a @p_547 (! (pair$a veriT_vr66 veriT_vr67) :named @p_592)) :named @p_593) (! (is_fail$b (! (run$b (! (c$ veriT_vr66 veriT_vr58) :named @p_595) veriT_vr67) :named @p_597)) :named @p_598)) :named @p_599)) :named @p_589)) :named @p_600) (! (or @p_548 (! (exists ((veriT_vr68 E$) (veriT_vr69 D$)) (! (and (! (is_res$a @p_546 (! (pair$a veriT_vr68 veriT_vr69) :named @p_603)) :named @p_604) (! (is_fail$b (! (run$b (! (c$ veriT_vr68 veriT_vr57) :named @p_606) veriT_vr69) :named @p_608)) :named @p_609)) :named @p_610)) :named @p_602)) :named @p_611)) :named @p_613) (! (=> (! (or @p_548 (! (exists ((veriT_vr70 E$) (veriT_vr71 D$)) (! (and (! (is_res$a @p_546 (! (pair$a veriT_vr70 veriT_vr71) :named @p_615)) :named @p_616) (! (is_fail$b (! (run$b (! (c$ veriT_vr70 veriT_vr57) :named @p_618) veriT_vr71) :named @p_620)) :named @p_621)) :named @p_622)) :named @p_614)) :named @p_623) (! (or @p_549 (! (exists ((veriT_vr72 E$) (veriT_vr73 D$)) (! (and (! (is_res$a @p_547 (! (pair$a veriT_vr72 veriT_vr73) :named @p_626)) :named @p_627) (! (is_fail$b (! (run$b (! (c$ veriT_vr72 veriT_vr58) :named @p_629) veriT_vr73) :named @p_631)) :named @p_632)) :named @p_633)) :named @p_625)) :named @p_634)) :named @p_636)) :named @p_637) (! (forall ((veriT_vr74 F$) (veriT_vr75 D$)) (! (and (! (=> (! (or @p_549 (! (exists ((veriT_vr76 E$) (veriT_vr77 D$)) (! (and (! (is_res$a @p_547 (! (pair$a veriT_vr76 veriT_vr77) :named @p_640)) :named @p_641) (! (is_res$b (! (run$b (! (c$ veriT_vr76 veriT_vr58) :named @p_643) veriT_vr77) :named @p_645) (! (pair$b veriT_vr74 veriT_vr75) :named @p_550)) :named @p_646)) :named @p_647)) :named @p_639)) :named @p_648) (! (or @p_548 (! (exists ((veriT_vr78 E$) (veriT_vr79 D$)) (! (and (! (is_res$a @p_546 (! (pair$a veriT_vr78 veriT_vr79) :named @p_650)) :named @p_651) (! (is_res$b (! (run$b (! (c$ veriT_vr78 veriT_vr57) :named @p_653) veriT_vr79) :named @p_655) @p_550) :named @p_659)) :named @p_660)) :named @p_649)) :named @p_661)) :named @p_663) (! (=> (! (or @p_548 (! (exists ((veriT_vr80 E$) (veriT_vr81 D$)) (! (and (! (is_res$a @p_546 (! (pair$a veriT_vr80 veriT_vr81) :named @p_665)) :named @p_666) (! (is_res$b (! (run$b (! (c$ veriT_vr80 veriT_vr57) :named @p_668) veriT_vr81) :named @p_670) @p_550) :named @p_671)) :named @p_672)) :named @p_664)) :named @p_673) (! (or @p_549 (! (exists ((veriT_vr82 E$) (veriT_vr83 D$)) (! (and (! (is_res$a @p_547 (! (pair$a veriT_vr82 veriT_vr83) :named @p_675)) :named @p_676) (! (is_res$b (! (run$b (! (c$ veriT_vr82 veriT_vr58) :named @p_678) veriT_vr83) :named @p_680) @p_550) :named @p_681)) :named @p_682)) :named @p_674)) :named @p_683)) :named @p_685)) :named @p_686)) :named @p_638)) :named @p_687)) :named @p_688)) :named @p_574)) :named @p_689)))) :named @p_696))
+(define-fun veriT_sk1 () A_b_c_M_state_fun$ (! (choice ((veriT_vr58 A_b_c_M_state_fun$)) (not (=> (forall ((veriT_vr59 A$) (veriT_vr60 C$)) (or (! (is_fail$ (! (run$ (fun_app$ @p_696 veriT_vr59) veriT_vr60) :named @p_698)) :named @p_697) (and (= @p_556 @p_697) (forall ((veriT_vr61 B$) (veriT_vr62 C$)) (= @p_566 (is_res$ @p_698 @p_545)))))) (forall ((veriT_vr63 D$)) (or (! (is_fail$a (! (run$a (! (b$ @p_696) :named @p_721) veriT_vr63) :named @p_699)) :named @p_700) (! (exists ((veriT_vr64 E$) (veriT_vr65 D$)) (and (is_res$a @p_699 @p_580) (is_fail$b (run$b (c$ veriT_vr64 @p_696) veriT_vr65)))) :named @p_704) (and (and (=> @p_600 (! (or @p_700 (exists ((veriT_vr68 E$) (veriT_vr69 D$)) (and (is_res$a @p_699 @p_603) (is_fail$b (run$b (c$ veriT_vr68 @p_696) veriT_vr69))))) :named @p_707)) (=> (! (or @p_700 (exists ((veriT_vr70 E$) (veriT_vr71 D$)) (and (is_res$a @p_699 @p_615) (! (is_fail$b (run$b (c$ veriT_vr70 @p_696) veriT_vr71)) :named @p_722)))) :named @p_708) @p_634)) (forall ((veriT_vr74 F$) (veriT_vr75 D$)) (and (=> @p_648 (! (or @p_700 (exists ((veriT_vr78 E$) (veriT_vr79 D$)) (and (is_res$a @p_699 @p_650) (! (is_res$b (! (run$b (c$ veriT_vr78 @p_696) veriT_vr79) :named @p_737) @p_550) :named @p_730)))) :named @p_710)) (=> (! (or @p_700 (exists ((veriT_vr80 E$) (veriT_vr81 D$)) (and (is_res$a @p_699 @p_665) (! (is_res$b (! (run$b (c$ veriT_vr80 @p_696) veriT_vr81) :named @p_740) @p_550) :named @p_732)))) :named @p_711) @p_683))))))))) :named @p_705))
+(define-fun veriT_sk2 () D$ (! (choice ((veriT_vr63 D$)) (not (or @p_700 @p_704 (and (and (=> (or (! (is_fail$a (! (run$a (! (b$ @p_705) :named @p_715) veriT_vr63) :named @p_706)) :named @p_709) (exists ((veriT_vr66 E$) (veriT_vr67 D$)) (and (is_res$a @p_706 @p_592) (! (is_fail$b (run$b (c$ veriT_vr66 @p_705) veriT_vr67)) :named @p_716)))) @p_707) (=> @p_708 (or @p_709 (exists ((veriT_vr72 E$) (veriT_vr73 D$)) (and (is_res$a @p_706 @p_626) (is_fail$b (run$b (c$ veriT_vr72 @p_705) veriT_vr73))))))) (forall ((veriT_vr74 F$) (veriT_vr75 D$)) (and (=> (or @p_709 (exists ((veriT_vr76 E$) (veriT_vr77 D$)) (and (is_res$a @p_706 @p_640) (! (is_res$b (! (run$b (c$ veriT_vr76 @p_705) veriT_vr77) :named @p_727) @p_550) :named @p_729)))) @p_710) (=> @p_711 (or @p_709 (exists ((veriT_vr82 E$) (veriT_vr83 D$)) (and (is_res$a @p_706 @p_675) (! (is_res$b (! (run$b (c$ veriT_vr82 @p_705) veriT_vr83) :named @p_742) @p_550) :named @p_734))))))))))) :named @p_713))
+(define-fun veriT_sk3 () E$ (! (choice ((veriT_vr66 E$)) (exists ((veriT_vr67 D$)) (and (is_res$a (! (run$a @p_715 @p_713) :named @p_717) @p_592) @p_716))) :named @p_718))
+(define-fun veriT_sk4 () D$ (! (choice ((veriT_vr67 D$)) (and (is_res$a @p_717 (pair$a @p_718 veriT_vr67)) (is_fail$b (run$b (c$ @p_718 @p_705) veriT_vr67)))) :named @p_719))
+(define-fun veriT_sk5 () E$ (! (choice ((veriT_vr70 E$)) (exists ((veriT_vr71 D$)) (and (is_res$a (! (run$a @p_721 @p_713) :named @p_723) @p_615) @p_722))) :named @p_724))
+(define-fun veriT_sk6 () D$ (! (choice ((veriT_vr71 D$)) (and (is_res$a @p_723 (pair$a @p_724 veriT_vr71)) (is_fail$b (run$b (c$ @p_724 @p_696) veriT_vr71)))) :named @p_725))
+(define-fun veriT_sk7 () F$ (! (choice ((veriT_vr74 F$)) (not (forall ((veriT_vr75 D$)) (and (=> (or (! (is_fail$a @p_717) :named @p_733) (exists ((veriT_vr76 E$) (veriT_vr77 D$)) (and (! (is_res$a @p_717 @p_640) :named @p_728) @p_729))) (or (! (is_fail$a @p_723) :named @p_731) (exists ((veriT_vr78 E$) (veriT_vr79 D$)) (and (! (is_res$a @p_723 @p_650) :named @p_736) @p_730)))) (=> (or @p_731 (exists ((veriT_vr80 E$) (veriT_vr81 D$)) (and (! (is_res$a @p_723 @p_665) :named @p_739) @p_732))) (or @p_733 (exists ((veriT_vr82 E$) (veriT_vr83 D$)) (and (! (is_res$a @p_717 @p_675) :named @p_741) @p_734)))))))) :named @p_735))
+(define-fun veriT_sk8 () D$ (! (choice ((veriT_vr75 D$)) (not (and (=> (or @p_733 (exists ((veriT_vr76 E$) (veriT_vr77 D$)) (and @p_728 (is_res$b @p_727 (! (pair$b @p_735 veriT_vr75) :named @p_738))))) (or @p_731 (exists ((veriT_vr78 E$) (veriT_vr79 D$)) (and @p_736 (is_res$b @p_737 @p_738))))) (=> (or @p_731 (exists ((veriT_vr80 E$) (veriT_vr81 D$)) (and @p_739 (is_res$b @p_740 @p_738)))) (or @p_733 (exists ((veriT_vr82 E$) (veriT_vr83 D$)) (and @p_741 (is_res$b @p_742 @p_738)))))))) :named @p_746))
+(define-fun veriT_sk9 () E$ (! (choice ((veriT_vr76 E$)) (exists ((veriT_vr77 D$)) (and @p_728 (is_res$b @p_727 (! (pair$b @p_735 @p_746) :named @p_744))))) :named @p_743))
+(define-fun veriT_sk10 () D$ (! (choice ((veriT_vr77 D$)) (and (is_res$a @p_717 (pair$a @p_743 veriT_vr77)) (is_res$b (run$b (c$ @p_743 @p_705) veriT_vr77) @p_744))) :named @p_745))
+(define-fun veriT_sk11 () E$ (! (choice ((veriT_vr80 E$)) (exists ((veriT_vr81 D$)) (and @p_739 (is_res$b @p_740 @p_744)))) :named @p_748))
+(define-fun veriT_sk12 () D$ (! (choice ((veriT_vr81 D$)) (and (is_res$a @p_723 (pair$a @p_748 veriT_vr81)) (is_res$b (run$b (c$ @p_748 @p_696) veriT_vr81) @p_744))) :named @p_749))
+(define-fun veriT_sk13 () A$ (! (choice ((veriT_vr122 A$)) (not (forall ((veriT_vr123 C$)) (! (or (! (is_fail$ (! (run$ (! (fun_app$ veriT_sk0 veriT_vr122) :named @p_1255) veriT_vr123) :named @p_1191)) :named @p_1189) (! (and (! (= (! (is_fail$ (! (run$ (! (fun_app$ veriT_sk1 veriT_vr122) :named @p_1257) veriT_vr123) :named @p_1190)) :named @p_1259) @p_1189) :named @p_1263) (! (forall ((veriT_vr124 B$) (veriT_vr125 C$)) (! (= (! (is_res$ @p_1190 (! (pair$ veriT_vr124 veriT_vr125) :named @p_1192)) :named @p_1267) (! (is_res$ @p_1191 @p_1192) :named @p_1271)) :named @p_1272)) :named @p_1264)) :named @p_1273)) :named @p_1254)))) :named @p_1193))
+(define-fun veriT_sk14 () C$ (! (choice ((veriT_vr123 C$)) (not (or (! (is_fail$ (! (run$ (! (fun_app$ veriT_sk0 @p_1193) :named @p_1201) veriT_vr123) :named @p_1196)) :named @p_1194) (and (= (is_fail$ (! (run$ (! (fun_app$ veriT_sk1 @p_1193) :named @p_1200) veriT_vr123) :named @p_1195)) @p_1194) (forall ((veriT_vr124 B$) (veriT_vr125 C$)) (= (is_res$ @p_1195 @p_1192) (is_res$ @p_1196 @p_1192))))))) :named @p_1197))
+(define-fun veriT_sk15 () B$ (! (choice ((veriT_vr124 B$)) (not (forall ((veriT_vr125 C$)) (= (is_res$ (! (run$ @p_1200 @p_1197) :named @p_1202) @p_1192) (is_res$ (! (run$ @p_1201 @p_1197) :named @p_1204) @p_1192))))) :named @p_1203))
+(define-fun veriT_sk16 () C$ (! (choice ((veriT_vr125 C$)) (not (= (is_res$ @p_1202 (! (pair$ @p_1203 veriT_vr125) :named @p_1205)) (is_res$ @p_1204 @p_1205)))) :named @p_1300))
+(define-fun veriT_sk25 () A$ (! (choice ((veriT_vr171 A$)) (not (forall ((veriT_vr172 C$)) (! (or (! (is_fail$ (! (run$ (! (fun_app$ veriT_sk0 veriT_vr171) :named @p_1468) veriT_vr172) :named @p_1393)) :named @p_1391) (! (and (! (= (! (is_fail$ (! (run$ (! (fun_app$ veriT_sk1 veriT_vr171) :named @p_1470) veriT_vr172) :named @p_1392)) :named @p_1472) @p_1391) :named @p_1476) (! (forall ((veriT_vr173 B$) (veriT_vr174 C$)) (! (= (! (is_res$ @p_1392 (! (pair$ veriT_vr173 veriT_vr174) :named @p_1394)) :named @p_1480) (! (is_res$ @p_1393 @p_1394) :named @p_1484)) :named @p_1485)) :named @p_1477)) :named @p_1486)) :named @p_1467)))) :named @p_1395))
+(define-fun veriT_sk26 () C$ (! (choice ((veriT_vr172 C$)) (not (or (! (is_fail$ (! (run$ (! (fun_app$ veriT_sk0 @p_1395) :named @p_1403) veriT_vr172) :named @p_1398)) :named @p_1396) (and (= (is_fail$ (! (run$ (! (fun_app$ veriT_sk1 @p_1395) :named @p_1402) veriT_vr172) :named @p_1397)) @p_1396) (forall ((veriT_vr173 B$) (veriT_vr174 C$)) (= (is_res$ @p_1397 @p_1394) (is_res$ @p_1398 @p_1394))))))) :named @p_1399))
+(define-fun veriT_sk27 () B$ (! (choice ((veriT_vr173 B$)) (not (forall ((veriT_vr174 C$)) (= (is_res$ (! (run$ @p_1402 @p_1399) :named @p_1404) @p_1394) (is_res$ (! (run$ @p_1403 @p_1399) :named @p_1406) @p_1394))))) :named @p_1405))
+(define-fun veriT_sk28 () C$ (! (choice ((veriT_vr174 C$)) (not (= (is_res$ @p_1404 (! (pair$ @p_1405 veriT_vr174) :named @p_1407)) (is_res$ @p_1406 @p_1407)))) :named @p_1513))
+(define-fun veriT_sk29 () A$ (! (choice ((veriT_vr185 A$)) (not (forall ((veriT_vr186 C$)) (! (or (! (is_fail$ (! (run$ (! (fun_app$ veriT_sk0 veriT_vr185) :named @p_1602) veriT_vr186) :named @p_1538)) :named @p_1536) (! (and (! (= (! (is_fail$ (! (run$ (! (fun_app$ veriT_sk1 veriT_vr185) :named @p_1604) veriT_vr186) :named @p_1537)) :named @p_1606) @p_1536) :named @p_1610) (! (forall ((veriT_vr187 B$) (veriT_vr188 C$)) (! (= (! (is_res$ @p_1537 (! (pair$ veriT_vr187 veriT_vr188) :named @p_1539)) :named @p_1614) (! (is_res$ @p_1538 @p_1539) :named @p_1618)) :named @p_1619)) :named @p_1611)) :named @p_1620)) :named @p_1601)))) :named @p_1540))
+(define-fun veriT_sk30 () C$ (! (choice ((veriT_vr186 C$)) (not (or (! (is_fail$ (! (run$ (! (fun_app$ veriT_sk0 @p_1540) :named @p_1548) veriT_vr186) :named @p_1543)) :named @p_1541) (and (= (is_fail$ (! (run$ (! (fun_app$ veriT_sk1 @p_1540) :named @p_1547) veriT_vr186) :named @p_1542)) @p_1541) (forall ((veriT_vr187 B$) (veriT_vr188 C$)) (= (is_res$ @p_1542 @p_1539) (is_res$ @p_1543 @p_1539))))))) :named @p_1544))
+(define-fun veriT_sk31 () B$ (! (choice ((veriT_vr187 B$)) (not (forall ((veriT_vr188 C$)) (= (is_res$ (! (run$ @p_1547 @p_1544) :named @p_1549) @p_1539) (is_res$ (! (run$ @p_1548 @p_1544) :named @p_1551) @p_1539))))) :named @p_1550))
+(define-fun veriT_sk32 () C$ (! (choice ((veriT_vr188 C$)) (not (= (is_res$ @p_1549 (! (pair$ @p_1550 veriT_vr188) :named @p_1552)) (is_res$ @p_1551 @p_1552)))) :named @p_1647))
+(define-fun veriT_sk41 () A$ (! (choice ((veriT_vr243 A$)) (not (forall ((veriT_vr244 C$)) (! (or (! (is_fail$ (! (run$ (! (fun_app$ veriT_sk0 veriT_vr243) :named @p_1825) veriT_vr244) :named @p_1761)) :named @p_1759) (! (and (! (= (! (is_fail$ (! (run$ (! (fun_app$ veriT_sk1 veriT_vr243) :named @p_1827) veriT_vr244) :named @p_1760)) :named @p_1829) @p_1759) :named @p_1833) (! (forall ((veriT_vr245 B$) (veriT_vr246 C$)) (! (= (! (is_res$ @p_1760 (! (pair$ veriT_vr245 veriT_vr246) :named @p_1762)) :named @p_1837) (! (is_res$ @p_1761 @p_1762) :named @p_1841)) :named @p_1842)) :named @p_1834)) :named @p_1843)) :named @p_1824)))) :named @p_1763))
+(define-fun veriT_sk42 () C$ (! (choice ((veriT_vr244 C$)) (not (or (! (is_fail$ (! (run$ (! (fun_app$ veriT_sk0 @p_1763) :named @p_1771) veriT_vr244) :named @p_1766)) :named @p_1764) (and (= (is_fail$ (! (run$ (! (fun_app$ veriT_sk1 @p_1763) :named @p_1770) veriT_vr244) :named @p_1765)) @p_1764) (forall ((veriT_vr245 B$) (veriT_vr246 C$)) (= (is_res$ @p_1765 @p_1762) (is_res$ @p_1766 @p_1762))))))) :named @p_1767))
+(define-fun veriT_sk43 () B$ (! (choice ((veriT_vr245 B$)) (not (forall ((veriT_vr246 C$)) (= (is_res$ (! (run$ @p_1770 @p_1767) :named @p_1772) @p_1762) (is_res$ (! (run$ @p_1771 @p_1767) :named @p_1774) @p_1762))))) :named @p_1773))
+(define-fun veriT_sk44 () C$ (! (choice ((veriT_vr246 C$)) (not (= (is_res$ @p_1772 (! (pair$ @p_1773 veriT_vr246) :named @p_1775)) (is_res$ @p_1774 @p_1775)))) :named @p_1870))
+(assume axiom0 (! (not (! (=> (! (and (! (forall ((?v0 A_b_c_M_state_fun$) (?v1 A_b_c_M_state_fun$)) (! (=> (! (forall ((?v2 A$) (?v3 C$)) (! (or (! (is_fail$ (! (run$ (! (fun_app$ ?v0 ?v2) :named @p_34) ?v3) :named @p_3)) :named @p_1) (! (and (! (= (! (is_fail$ (! (run$ (! (fun_app$ ?v1 ?v2) :named @p_37) ?v3) :named @p_2)) :named @p_40) @p_1) :named @p_46) (! (forall ((?v4 B$) (?v5 C$)) (! (= (! (is_res$ @p_2 (! (pair$ ?v4 ?v5) :named @p_4)) :named @p_53) (! (is_res$ @p_3 @p_4) :named @p_58)) :named @p_60)) :named @p_48)) :named @p_62)) :named @p_64)) :named @p_17) (! (forall ((?v2 D$)) (! (or (! (is_fail$a (! (run$a (! (b$ ?v0) :named @p_68) ?v2) :named @p_7)) :named @p_5) (! (and (! (= (! (is_fail$a (! (run$a (! (b$ ?v1) :named @p_70) ?v2) :named @p_6)) :named @p_19) @p_5) :named @p_77) (! (forall ((?v3 E$) (?v4 D$)) (! (= (! (is_res$a @p_6 (! (pair$a ?v3 ?v4) :named @p_8)) :named @p_20) (! (is_res$a @p_7 @p_8) :named @p_18)) :named @p_88)) :named @p_79)) :named @p_90)) :named @p_92)) :named @p_66)) :named @p_94)) :named @p_24) (! (forall ((?v0 E$) (?v1 A_b_c_M_state_fun$) (?v2 A_b_c_M_state_fun$)) (! (=> (! (forall ((?v3 A$) (?v4 C$)) (! (or (! (is_fail$ (! (run$ (! (fun_app$ ?v1 ?v3) :named @p_102) ?v4) :named @p_11)) :named @p_9) (! (and (! (= (! (is_fail$ (! (run$ (! (fun_app$ ?v2 ?v3) :named @p_104) ?v4) :named @p_10)) :named @p_106) @p_9) :named @p_111) (! (forall ((?v5 B$) (?v6 C$)) (! (= (! (is_res$ @p_10 (! (pair$ ?v5 ?v6) :named @p_12)) :named @p_116) (! (is_res$ @p_11 @p_12) :named @p_120)) :named @p_121)) :named @p_112)) :named @p_122)) :named @p_123)) :named @p_101) (! (forall ((?v3 D$)) (! (or (! (is_fail$b (! (run$b (! (c$ ?v0 ?v1) :named @p_126) ?v3) :named @p_15)) :named @p_13) (! (and (! (= (! (is_fail$b (! (run$b (! (c$ ?v0 ?v2) :named @p_129) ?v3) :named @p_14)) :named @p_132) @p_13) :named @p_137) (! (forall ((?v4 F$) (?v5 D$)) (! (= (! (is_res$b @p_14 (! (pair$b ?v4 ?v5) :named @p_16)) :named @p_143) (! (is_res$b @p_15 @p_16) :named @p_148)) :named @p_150)) :named @p_139)) :named @p_152)) :named @p_154)) :named @p_124)) :named @p_156)) :named @p_96)) :named @p_158) (! (forall ((?v0 A_b_c_M_state_fun$) (?v1 A_b_c_M_state_fun$)) (! (=> @p_17 (! (forall ((?v2 D$)) (! (or @p_5 (! (or (! (exists ((?v3 E$) (?v4 D$)) (! (and @p_18 (! (is_fail$b (! (run$b (! (c$ ?v3 ?v0) :named @p_176) ?v4) :named @p_177)) :named @p_179)) :named @p_181)) :named @p_21) (! (and (! (= (! (or @p_19 (! (exists ((?v3 E$) (?v4 D$)) (! (and @p_20 (! (is_fail$b (! (run$b (! (c$ ?v3 ?v1) :named @p_187) ?v4) :named @p_188)) :named @p_190)) :named @p_192)) :named @p_184)) :named @p_194) (! (or @p_5 @p_21) :named @p_201)) :named @p_203) (! (forall ((?v3 F$) (?v4 D$)) (! (= (! (or @p_19 (! (exists ((?v5 E$) (?v6 D$)) (! (and (! (is_res$a @p_6 (! (pair$a ?v5 ?v6) :named @p_22)) :named @p_209) (! (is_res$b (! (run$b (! (c$ ?v5 ?v1) :named @p_212) ?v6) :named @p_214) (! (pair$b ?v3 ?v4) :named @p_23)) :named @p_216)) :named @p_218)) :named @p_207)) :named @p_220) (! (or @p_5 (! (exists ((?v5 E$) (?v6 D$)) (! (and (! (is_res$a @p_7 @p_22) :named @p_225) (! (is_res$b (! (run$b (! (c$ ?v5 ?v0) :named @p_227) ?v6) :named @p_228) @p_23) :named @p_232)) :named @p_234)) :named @p_222)) :named @p_236)) :named @p_238)) :named @p_205)) :named @p_240)) :named @p_242)) :named @p_244)) :named @p_173)) :named @p_246)) :named @p_161)) :named @p_248)) :named @p_251))
+(anchor :step t2 :args ((:= (?v0 A_b_c_M_state_fun$) veriT_vr0) (:= (?v1 A_b_c_M_state_fun$) veriT_vr1)))
+(anchor :step t2.t1 :args ((:= (?v2 A$) veriT_vr2) (:= (?v3 C$) veriT_vr3)))
+(step t2.t1.t1 (cl (! (= ?v0 veriT_vr0) :named @p_42)) :rule refl)
+(step t2.t1.t2 (cl (! (= ?v2 veriT_vr2) :named @p_36)) :rule refl)
+(step t2.t1.t3 (cl (! (= @p_34 (! (fun_app$ veriT_vr0 veriT_vr2) :named @p_35)) :named @p_43)) :rule cong :premises (t2.t1.t1 t2.t1.t2))
+(step t2.t1.t4 (cl (! (= ?v3 veriT_vr3) :named @p_39)) :rule refl)
+(step t2.t1.t5 (cl (! (= @p_3 (! (run$ @p_35 veriT_vr3) :named @p_27)) :named @p_44)) :rule cong :premises (t2.t1.t3 t2.t1.t4))
+(step t2.t1.t6 (cl (! (= @p_1 (! (is_fail$ @p_27) :named @p_25)) :named @p_45)) :rule cong :premises (t2.t1.t5))
+(step t2.t1.t7 (cl (! (= ?v1 veriT_vr1) :named @p_50)) :rule refl)
+(step t2.t1.t8 (cl @p_36) :rule refl)
+(step t2.t1.t9 (cl (! (= @p_37 (! (fun_app$ veriT_vr1 veriT_vr2) :named @p_38)) :named @p_51)) :rule cong :premises (t2.t1.t7 t2.t1.t8))
+(step t2.t1.t10 (cl @p_39) :rule refl)
+(step t2.t1.t11 (cl (! (= @p_2 (! (run$ @p_38 veriT_vr3) :named @p_26)) :named @p_52)) :rule cong :premises (t2.t1.t9 t2.t1.t10))
+(step t2.t1.t12 (cl (! (= @p_40 (! (is_fail$ @p_26) :named @p_41)) :named @p_165)) :rule cong :premises (t2.t1.t11))
+(step t2.t1.t13 (cl @p_42) :rule refl)
+(step t2.t1.t14 (cl @p_36) :rule refl)
+(step t2.t1.t15 (cl @p_43) :rule cong :premises (t2.t1.t13 t2.t1.t14))
+(step t2.t1.t16 (cl @p_39) :rule refl)
+(step t2.t1.t17 (cl @p_44) :rule cong :premises (t2.t1.t15 t2.t1.t16))
+(step t2.t1.t18 (cl @p_45) :rule cong :premises (t2.t1.t17))
+(step t2.t1.t19 (cl (! (= @p_46 (! (= @p_41 @p_25) :named @p_47)) :named @p_166)) :rule cong :premises (t2.t1.t12 t2.t1.t18))
+(anchor :step t2.t1.t20 :args ((:= (?v4 B$) veriT_vr4) (:= (?v5 C$) veriT_vr5)))
+(step t2.t1.t20.t1 (cl @p_50) :rule refl)
+(step t2.t1.t20.t2 (cl @p_36) :rule refl)
+(step t2.t1.t20.t3 (cl @p_51) :rule cong :premises (t2.t1.t20.t1 t2.t1.t20.t2))
+(step t2.t1.t20.t4 (cl @p_39) :rule refl)
+(step t2.t1.t20.t5 (cl @p_52) :rule cong :premises (t2.t1.t20.t3 t2.t1.t20.t4))
+(step t2.t1.t20.t6 (cl (! (= ?v4 veriT_vr4) :named @p_55)) :rule refl)
+(step t2.t1.t20.t7 (cl (! (= ?v5 veriT_vr5) :named @p_56)) :rule refl)
+(step t2.t1.t20.t8 (cl (! (= @p_4 (! (pair$ veriT_vr4 veriT_vr5) :named @p_28)) :named @p_57)) :rule cong :premises (t2.t1.t20.t6 t2.t1.t20.t7))
+(step t2.t1.t20.t9 (cl (! (= @p_53 (! (is_res$ @p_26 @p_28) :named @p_54)) :named @p_168)) :rule cong :premises (t2.t1.t20.t5 t2.t1.t20.t8))
+(step t2.t1.t20.t10 (cl @p_42) :rule refl)
+(step t2.t1.t20.t11 (cl @p_36) :rule refl)
+(step t2.t1.t20.t12 (cl @p_43) :rule cong :premises (t2.t1.t20.t10 t2.t1.t20.t11))
+(step t2.t1.t20.t13 (cl @p_39) :rule refl)
+(step t2.t1.t20.t14 (cl @p_44) :rule cong :premises (t2.t1.t20.t12 t2.t1.t20.t13))
+(step t2.t1.t20.t15 (cl @p_55) :rule refl)
+(step t2.t1.t20.t16 (cl @p_56) :rule refl)
+(step t2.t1.t20.t17 (cl @p_57) :rule cong :premises (t2.t1.t20.t15 t2.t1.t20.t16))
+(step t2.t1.t20.t18 (cl (! (= @p_58 (! (is_res$ @p_27 @p_28) :named @p_59)) :named @p_169)) :rule cong :premises (t2.t1.t20.t14 t2.t1.t20.t17))
+(step t2.t1.t20.t19 (cl (! (= @p_60 (! (= @p_54 @p_59) :named @p_61)) :named @p_170)) :rule cong :premises (t2.t1.t20.t9 t2.t1.t20.t18))
+(step t2.t1.t20 (cl (! (= @p_48 (! (forall ((veriT_vr4 B$) (veriT_vr5 C$)) @p_61) :named @p_49)) :named @p_167)) :rule bind)
+(step t2.t1.t21 (cl (! (= @p_62 (! (and @p_47 @p_49) :named @p_63)) :named @p_171)) :rule cong :premises (t2.t1.t19 t2.t1.t20))
+(step t2.t1.t22 (cl (! (= @p_64 (! (or @p_25 @p_63) :named @p_65)) :named @p_172)) :rule cong :premises (t2.t1.t6 t2.t1.t21))
+(step t2.t1 (cl (! (= @p_17 (! (forall ((veriT_vr2 A$) (veriT_vr3 C$)) @p_65) :named @p_33)) :named @p_164)) :rule bind)
+(anchor :step t2.t2 :args ((:= (?v2 D$) veriT_vr6)))
+(step t2.t2.t1 (cl @p_42) :rule refl)
+(step t2.t2.t2 (cl (! (= @p_68 (! (b$ veriT_vr0) :named @p_69)) :named @p_74)) :rule cong :premises (t2.t2.t1))
+(step t2.t2.t3 (cl (! (= ?v2 veriT_vr6) :named @p_72)) :rule refl)
+(step t2.t2.t4 (cl (! (= @p_7 (! (run$a @p_69 veriT_vr6) :named @p_31)) :named @p_75)) :rule cong :premises (t2.t2.t2 t2.t2.t3))
+(step t2.t2.t5 (cl (! (= @p_5 (! (is_fail$a @p_31) :named @p_29)) :named @p_76)) :rule cong :premises (t2.t2.t4))
+(step t2.t2.t6 (cl @p_50) :rule refl)
+(step t2.t2.t7 (cl (! (= @p_70 (! (b$ veriT_vr1) :named @p_71)) :named @p_81)) :rule cong :premises (t2.t2.t6))
+(step t2.t2.t8 (cl @p_72) :rule refl)
+(step t2.t2.t9 (cl (! (= @p_6 (! (run$a @p_71 veriT_vr6) :named @p_30)) :named @p_82)) :rule cong :premises (t2.t2.t7 t2.t2.t8))
+(step t2.t2.t10 (cl (! (= @p_19 (! (is_fail$a @p_30) :named @p_73)) :named @p_183)) :rule cong :premises (t2.t2.t9))
+(step t2.t2.t11 (cl @p_42) :rule refl)
+(step t2.t2.t12 (cl @p_74) :rule cong :premises (t2.t2.t11))
+(step t2.t2.t13 (cl @p_72) :rule refl)
+(step t2.t2.t14 (cl @p_75) :rule cong :premises (t2.t2.t12 t2.t2.t13))
+(step t2.t2.t15 (cl @p_76) :rule cong :premises (t2.t2.t14))
+(step t2.t2.t16 (cl (= @p_77 (! (= @p_73 @p_29) :named @p_78))) :rule cong :premises (t2.t2.t10 t2.t2.t15))
+(anchor :step t2.t2.t17 :args ((:= (?v3 E$) veriT_vr7) (:= (?v4 D$) veriT_vr8)))
+(step t2.t2.t17.t1 (cl @p_50) :rule refl)
+(step t2.t2.t17.t2 (cl @p_81) :rule cong :premises (t2.t2.t17.t1))
+(step t2.t2.t17.t3 (cl @p_72) :rule refl)
+(step t2.t2.t17.t4 (cl @p_82) :rule cong :premises (t2.t2.t17.t2 t2.t2.t17.t3))
+(step t2.t2.t17.t5 (cl (! (= ?v3 veriT_vr7) :named @p_84)) :rule refl)
+(step t2.t2.t17.t6 (cl (! (= ?v4 veriT_vr8) :named @p_85)) :rule refl)
+(step t2.t2.t17.t7 (cl (! (= @p_8 (! (pair$a veriT_vr7 veriT_vr8) :named @p_32)) :named @p_86)) :rule cong :premises (t2.t2.t17.t5 t2.t2.t17.t6))
+(step t2.t2.t17.t8 (cl (! (= @p_20 (! (is_res$a @p_30 @p_32) :named @p_83)) :named @p_186)) :rule cong :premises (t2.t2.t17.t4 t2.t2.t17.t7))
+(step t2.t2.t17.t9 (cl @p_42) :rule refl)
+(step t2.t2.t17.t10 (cl @p_74) :rule cong :premises (t2.t2.t17.t9))
+(step t2.t2.t17.t11 (cl @p_72) :rule refl)
+(step t2.t2.t17.t12 (cl @p_75) :rule cong :premises (t2.t2.t17.t10 t2.t2.t17.t11))
+(step t2.t2.t17.t13 (cl @p_84) :rule refl)
+(step t2.t2.t17.t14 (cl @p_85) :rule refl)
+(step t2.t2.t17.t15 (cl @p_86) :rule cong :premises (t2.t2.t17.t13 t2.t2.t17.t14))
+(step t2.t2.t17.t16 (cl (! (= @p_18 (! (is_res$a @p_31 @p_32) :named @p_87)) :named @p_175)) :rule cong :premises (t2.t2.t17.t12 t2.t2.t17.t15))
+(step t2.t2.t17.t17 (cl (= @p_88 (! (= @p_83 @p_87) :named @p_89))) :rule cong :premises (t2.t2.t17.t8 t2.t2.t17.t16))
+(step t2.t2.t17 (cl (= @p_79 (! (forall ((veriT_vr7 E$) (veriT_vr8 D$)) @p_89) :named @p_80))) :rule bind)
+(step t2.t2.t18 (cl (= @p_90 (! (and @p_78 @p_80) :named @p_91))) :rule cong :premises (t2.t2.t16 t2.t2.t17))
+(step t2.t2.t19 (cl (= @p_92 (! (or @p_29 @p_91) :named @p_93))) :rule cong :premises (t2.t2.t5 t2.t2.t18))
+(step t2.t2 (cl (= @p_66 (! (forall ((veriT_vr6 D$)) @p_93) :named @p_67))) :rule bind)
+(step t2.t3 (cl (= @p_94 (! (=> @p_33 @p_67) :named @p_95))) :rule cong :premises (t2.t1 t2.t2))
+(step t2 (cl (= @p_24 (! (forall ((veriT_vr0 A_b_c_M_state_fun$) (veriT_vr1 A_b_c_M_state_fun$)) @p_95) :named @p_159))) :rule bind)
+(anchor :step t3 :args ((:= (?v0 E$) veriT_vr7) (:= (?v1 A_b_c_M_state_fun$) veriT_vr0) (:= (?v2 A_b_c_M_state_fun$) veriT_vr1)))
+(anchor :step t3.t1 :args ((:= (?v3 A$) veriT_vr2) (:= (?v4 C$) veriT_vr3)))
+(step t3.t1.t1 (cl (! (= ?v1 veriT_vr0) :named @p_107)) :rule refl)
+(step t3.t1.t2 (cl (! (= ?v3 veriT_vr2) :named @p_103)) :rule refl)
+(step t3.t1.t3 (cl (! (= @p_102 @p_35) :named @p_108)) :rule cong :premises (t3.t1.t1 t3.t1.t2))
+(step t3.t1.t4 (cl (! (= ?v4 veriT_vr3) :named @p_105)) :rule refl)
+(step t3.t1.t5 (cl (! (= @p_11 @p_27) :named @p_109)) :rule cong :premises (t3.t1.t3 t3.t1.t4))
+(step t3.t1.t6 (cl (! (= @p_9 @p_25) :named @p_110)) :rule cong :premises (t3.t1.t5))
+(step t3.t1.t7 (cl (! (= ?v2 veriT_vr1) :named @p_113)) :rule refl)
+(step t3.t1.t8 (cl @p_103) :rule refl)
+(step t3.t1.t9 (cl (! (= @p_104 @p_38) :named @p_114)) :rule cong :premises (t3.t1.t7 t3.t1.t8))
+(step t3.t1.t10 (cl @p_105) :rule refl)
+(step t3.t1.t11 (cl (! (= @p_10 @p_26) :named @p_115)) :rule cong :premises (t3.t1.t9 t3.t1.t10))
+(step t3.t1.t12 (cl (= @p_106 @p_41)) :rule cong :premises (t3.t1.t11))
+(step t3.t1.t13 (cl @p_107) :rule refl)
+(step t3.t1.t14 (cl @p_103) :rule refl)
+(step t3.t1.t15 (cl @p_108) :rule cong :premises (t3.t1.t13 t3.t1.t14))
+(step t3.t1.t16 (cl @p_105) :rule refl)
+(step t3.t1.t17 (cl @p_109) :rule cong :premises (t3.t1.t15 t3.t1.t16))
+(step t3.t1.t18 (cl @p_110) :rule cong :premises (t3.t1.t17))
+(step t3.t1.t19 (cl (= @p_111 @p_47)) :rule cong :premises (t3.t1.t12 t3.t1.t18))
+(anchor :step t3.t1.t20 :args ((:= (?v5 B$) veriT_vr4) (:= (?v6 C$) veriT_vr5)))
+(step t3.t1.t20.t1 (cl @p_113) :rule refl)
+(step t3.t1.t20.t2 (cl @p_103) :rule refl)
+(step t3.t1.t20.t3 (cl @p_114) :rule cong :premises (t3.t1.t20.t1 t3.t1.t20.t2))
+(step t3.t1.t20.t4 (cl @p_105) :rule refl)
+(step t3.t1.t20.t5 (cl @p_115) :rule cong :premises (t3.t1.t20.t3 t3.t1.t20.t4))
+(step t3.t1.t20.t6 (cl (! (= ?v5 veriT_vr4) :named @p_117)) :rule refl)
+(step t3.t1.t20.t7 (cl (! (= ?v6 veriT_vr5) :named @p_118)) :rule refl)
+(step t3.t1.t20.t8 (cl (! (= @p_12 @p_28) :named @p_119)) :rule cong :premises (t3.t1.t20.t6 t3.t1.t20.t7))
+(step t3.t1.t20.t9 (cl (= @p_116 @p_54)) :rule cong :premises (t3.t1.t20.t5 t3.t1.t20.t8))
+(step t3.t1.t20.t10 (cl @p_107) :rule refl)
+(step t3.t1.t20.t11 (cl @p_103) :rule refl)
+(step t3.t1.t20.t12 (cl @p_108) :rule cong :premises (t3.t1.t20.t10 t3.t1.t20.t11))
+(step t3.t1.t20.t13 (cl @p_105) :rule refl)
+(step t3.t1.t20.t14 (cl @p_109) :rule cong :premises (t3.t1.t20.t12 t3.t1.t20.t13))
+(step t3.t1.t20.t15 (cl @p_117) :rule refl)
+(step t3.t1.t20.t16 (cl @p_118) :rule refl)
+(step t3.t1.t20.t17 (cl @p_119) :rule cong :premises (t3.t1.t20.t15 t3.t1.t20.t16))
+(step t3.t1.t20.t18 (cl (= @p_120 @p_59)) :rule cong :premises (t3.t1.t20.t14 t3.t1.t20.t17))
+(step t3.t1.t20.t19 (cl (= @p_121 @p_61)) :rule cong :premises (t3.t1.t20.t9 t3.t1.t20.t18))
+(step t3.t1.t20 (cl (= @p_112 @p_49)) :rule bind)
+(step t3.t1.t21 (cl (= @p_122 @p_63)) :rule cong :premises (t3.t1.t19 t3.t1.t20))
+(step t3.t1.t22 (cl (= @p_123 @p_65)) :rule cong :premises (t3.t1.t6 t3.t1.t21))
+(step t3.t1 (cl (= @p_101 @p_33)) :rule bind)
+(anchor :step t3.t2 :args ((:= (?v3 D$) veriT_vr6)))
+(step t3.t2.t1 (cl (! (= ?v0 veriT_vr7) :named @p_128)) :rule refl)
+(step t3.t2.t2 (cl @p_107) :rule refl)
+(step t3.t2.t3 (cl (! (= @p_126 (! (c$ veriT_vr7 veriT_vr0) :named @p_127)) :named @p_134)) :rule cong :premises (t3.t2.t1 t3.t2.t2))
+(step t3.t2.t4 (cl (! (= ?v3 veriT_vr6) :named @p_131)) :rule refl)
+(step t3.t2.t5 (cl (! (= @p_15 (! (run$b @p_127 veriT_vr6) :named @p_99)) :named @p_135)) :rule cong :premises (t3.t2.t3 t3.t2.t4))
+(step t3.t2.t6 (cl (! (= @p_13 (! (is_fail$b @p_99) :named @p_97)) :named @p_136)) :rule cong :premises (t3.t2.t5))
+(step t3.t2.t7 (cl @p_128) :rule refl)
+(step t3.t2.t8 (cl @p_113) :rule refl)
+(step t3.t2.t9 (cl (! (= @p_129 (! (c$ veriT_vr7 veriT_vr1) :named @p_130)) :named @p_141)) :rule cong :premises (t3.t2.t7 t3.t2.t8))
+(step t3.t2.t10 (cl @p_131) :rule refl)
+(step t3.t2.t11 (cl (! (= @p_14 (! (run$b @p_130 veriT_vr6) :named @p_98)) :named @p_142)) :rule cong :premises (t3.t2.t9 t3.t2.t10))
+(step t3.t2.t12 (cl (= @p_132 (! (is_fail$b @p_98) :named @p_133))) :rule cong :premises (t3.t2.t11))
+(step t3.t2.t13 (cl @p_128) :rule refl)
+(step t3.t2.t14 (cl @p_107) :rule refl)
+(step t3.t2.t15 (cl @p_134) :rule cong :premises (t3.t2.t13 t3.t2.t14))
+(step t3.t2.t16 (cl @p_131) :rule refl)
+(step t3.t2.t17 (cl @p_135) :rule cong :premises (t3.t2.t15 t3.t2.t16))
+(step t3.t2.t18 (cl @p_136) :rule cong :premises (t3.t2.t17))
+(step t3.t2.t19 (cl (= @p_137 (! (= @p_133 @p_97) :named @p_138))) :rule cong :premises (t3.t2.t12 t3.t2.t18))
+(anchor :step t3.t2.t20 :args ((:= (?v4 F$) veriT_vr9) (:= (?v5 D$) veriT_vr8)))
+(step t3.t2.t20.t1 (cl @p_128) :rule refl)
+(step t3.t2.t20.t2 (cl @p_113) :rule refl)
+(step t3.t2.t20.t3 (cl @p_141) :rule cong :premises (t3.t2.t20.t1 t3.t2.t20.t2))
+(step t3.t2.t20.t4 (cl @p_131) :rule refl)
+(step t3.t2.t20.t5 (cl @p_142) :rule cong :premises (t3.t2.t20.t3 t3.t2.t20.t4))
+(step t3.t2.t20.t6 (cl (! (= ?v4 veriT_vr9) :named @p_145)) :rule refl)
+(step t3.t2.t20.t7 (cl (! (= ?v5 veriT_vr8) :named @p_146)) :rule refl)
+(step t3.t2.t20.t8 (cl (! (= @p_16 (! (pair$b veriT_vr9 veriT_vr8) :named @p_100)) :named @p_147)) :rule cong :premises (t3.t2.t20.t6 t3.t2.t20.t7))
+(step t3.t2.t20.t9 (cl (= @p_143 (! (is_res$b @p_98 @p_100) :named @p_144))) :rule cong :premises (t3.t2.t20.t5 t3.t2.t20.t8))
+(step t3.t2.t20.t10 (cl @p_128) :rule refl)
+(step t3.t2.t20.t11 (cl @p_107) :rule refl)
+(step t3.t2.t20.t12 (cl @p_134) :rule cong :premises (t3.t2.t20.t10 t3.t2.t20.t11))
+(step t3.t2.t20.t13 (cl @p_131) :rule refl)
+(step t3.t2.t20.t14 (cl @p_135) :rule cong :premises (t3.t2.t20.t12 t3.t2.t20.t13))
+(step t3.t2.t20.t15 (cl @p_145) :rule refl)
+(step t3.t2.t20.t16 (cl @p_146) :rule refl)
+(step t3.t2.t20.t17 (cl @p_147) :rule cong :premises (t3.t2.t20.t15 t3.t2.t20.t16))
+(step t3.t2.t20.t18 (cl (= @p_148 (! (is_res$b @p_99 @p_100) :named @p_149))) :rule cong :premises (t3.t2.t20.t14 t3.t2.t20.t17))
+(step t3.t2.t20.t19 (cl (= @p_150 (! (= @p_144 @p_149) :named @p_151))) :rule cong :premises (t3.t2.t20.t9 t3.t2.t20.t18))
+(step t3.t2.t20 (cl (= @p_139 (! (forall ((veriT_vr9 F$) (veriT_vr8 D$)) @p_151) :named @p_140))) :rule bind)
+(step t3.t2.t21 (cl (= @p_152 (! (and @p_138 @p_140) :named @p_153))) :rule cong :premises (t3.t2.t19 t3.t2.t20))
+(step t3.t2.t22 (cl (= @p_154 (! (or @p_97 @p_153) :named @p_155))) :rule cong :premises (t3.t2.t6 t3.t2.t21))
+(step t3.t2 (cl (= @p_124 (! (forall ((veriT_vr6 D$)) @p_155) :named @p_125))) :rule bind)
+(step t3.t3 (cl (= @p_156 (! (=> @p_33 @p_125) :named @p_157))) :rule cong :premises (t3.t1 t3.t2))
+(step t3 (cl (= @p_96 (! (forall ((veriT_vr7 E$) (veriT_vr0 A_b_c_M_state_fun$) (veriT_vr1 A_b_c_M_state_fun$)) @p_157) :named @p_160))) :rule bind)
+(step t4 (cl (= @p_158 (! (and @p_159 @p_160) :named @p_249))) :rule cong :premises (t2 t3))
+(anchor :step t5 :args ((:= (?v0 A_b_c_M_state_fun$) veriT_vr0) (:= (?v1 A_b_c_M_state_fun$) veriT_vr1)))
+(anchor :step t5.t1 :args ((:= (?v2 A$) veriT_vr2) (:= (?v3 C$) veriT_vr3)))
+(step t5.t1.t1 (cl @p_42) :rule refl)
+(step t5.t1.t2 (cl @p_36) :rule refl)
+(step t5.t1.t3 (cl @p_43) :rule cong :premises (t5.t1.t1 t5.t1.t2))
+(step t5.t1.t4 (cl @p_39) :rule refl)
+(step t5.t1.t5 (cl @p_44) :rule cong :premises (t5.t1.t3 t5.t1.t4))
+(step t5.t1.t6 (cl @p_45) :rule cong :premises (t5.t1.t5))
+(step t5.t1.t7 (cl @p_50) :rule refl)
+(step t5.t1.t8 (cl @p_36) :rule refl)
+(step t5.t1.t9 (cl @p_51) :rule cong :premises (t5.t1.t7 t5.t1.t8))
+(step t5.t1.t10 (cl @p_39) :rule refl)
+(step t5.t1.t11 (cl @p_52) :rule cong :premises (t5.t1.t9 t5.t1.t10))
+(step t5.t1.t12 (cl @p_165) :rule cong :premises (t5.t1.t11))
+(step t5.t1.t13 (cl @p_42) :rule refl)
+(step t5.t1.t14 (cl @p_36) :rule refl)
+(step t5.t1.t15 (cl @p_43) :rule cong :premises (t5.t1.t13 t5.t1.t14))
+(step t5.t1.t16 (cl @p_39) :rule refl)
+(step t5.t1.t17 (cl @p_44) :rule cong :premises (t5.t1.t15 t5.t1.t16))
+(step t5.t1.t18 (cl @p_45) :rule cong :premises (t5.t1.t17))
+(step t5.t1.t19 (cl @p_166) :rule cong :premises (t5.t1.t12 t5.t1.t18))
+(anchor :step t5.t1.t20 :args ((:= (?v4 B$) veriT_vr4) (:= (?v5 C$) veriT_vr5)))
+(step t5.t1.t20.t1 (cl @p_50) :rule refl)
+(step t5.t1.t20.t2 (cl @p_36) :rule refl)
+(step t5.t1.t20.t3 (cl @p_51) :rule cong :premises (t5.t1.t20.t1 t5.t1.t20.t2))
+(step t5.t1.t20.t4 (cl @p_39) :rule refl)
+(step t5.t1.t20.t5 (cl @p_52) :rule cong :premises (t5.t1.t20.t3 t5.t1.t20.t4))
+(step t5.t1.t20.t6 (cl @p_55) :rule refl)
+(step t5.t1.t20.t7 (cl @p_56) :rule refl)
+(step t5.t1.t20.t8 (cl @p_57) :rule cong :premises (t5.t1.t20.t6 t5.t1.t20.t7))
+(step t5.t1.t20.t9 (cl @p_168) :rule cong :premises (t5.t1.t20.t5 t5.t1.t20.t8))
+(step t5.t1.t20.t10 (cl @p_42) :rule refl)
+(step t5.t1.t20.t11 (cl @p_36) :rule refl)
+(step t5.t1.t20.t12 (cl @p_43) :rule cong :premises (t5.t1.t20.t10 t5.t1.t20.t11))
+(step t5.t1.t20.t13 (cl @p_39) :rule refl)
+(step t5.t1.t20.t14 (cl @p_44) :rule cong :premises (t5.t1.t20.t12 t5.t1.t20.t13))
+(step t5.t1.t20.t15 (cl @p_55) :rule refl)
+(step t5.t1.t20.t16 (cl @p_56) :rule refl)
+(step t5.t1.t20.t17 (cl @p_57) :rule cong :premises (t5.t1.t20.t15 t5.t1.t20.t16))
+(step t5.t1.t20.t18 (cl @p_169) :rule cong :premises (t5.t1.t20.t14 t5.t1.t20.t17))
+(step t5.t1.t20.t19 (cl @p_170) :rule cong :premises (t5.t1.t20.t9 t5.t1.t20.t18))
+(step t5.t1.t20 (cl @p_167) :rule bind)
+(step t5.t1.t21 (cl @p_171) :rule cong :premises (t5.t1.t19 t5.t1.t20))
+(step t5.t1.t22 (cl @p_172) :rule cong :premises (t5.t1.t6 t5.t1.t21))
+(step t5.t1 (cl @p_164) :rule bind)
+(anchor :step t5.t2 :args ((:= (?v2 D$) veriT_vr6)))
+(step t5.t2.t1 (cl @p_42) :rule refl)
+(step t5.t2.t2 (cl @p_74) :rule cong :premises (t5.t2.t1))
+(step t5.t2.t3 (cl @p_72) :rule refl)
+(step t5.t2.t4 (cl @p_75) :rule cong :premises (t5.t2.t2 t5.t2.t3))
+(step t5.t2.t5 (cl @p_76) :rule cong :premises (t5.t2.t4))
+(anchor :step t5.t2.t6 :args ((:= (?v3 E$) veriT_vr7) (:= (?v4 D$) veriT_vr8)))
+(step t5.t2.t6.t1 (cl @p_42) :rule refl)
+(step t5.t2.t6.t2 (cl @p_74) :rule cong :premises (t5.t2.t6.t1))
+(step t5.t2.t6.t3 (cl @p_72) :rule refl)
+(step t5.t2.t6.t4 (cl @p_75) :rule cong :premises (t5.t2.t6.t2 t5.t2.t6.t3))
+(step t5.t2.t6.t5 (cl @p_84) :rule refl)
+(step t5.t2.t6.t6 (cl @p_85) :rule refl)
+(step t5.t2.t6.t7 (cl @p_86) :rule cong :premises (t5.t2.t6.t5 t5.t2.t6.t6))
+(step t5.t2.t6.t8 (cl @p_175) :rule cong :premises (t5.t2.t6.t4 t5.t2.t6.t7))
+(step t5.t2.t6.t9 (cl @p_84) :rule refl)
+(step t5.t2.t6.t10 (cl @p_42) :rule refl)
+(step t5.t2.t6.t11 (cl (! (= @p_176 @p_127) :named @p_197)) :rule cong :premises (t5.t2.t6.t9 t5.t2.t6.t10))
+(step t5.t2.t6.t12 (cl @p_85) :rule refl)
+(step t5.t2.t6.t13 (cl (! (= @p_177 (! (run$b @p_127 veriT_vr8) :named @p_178)) :named @p_198)) :rule cong :premises (t5.t2.t6.t11 t5.t2.t6.t12))
+(step t5.t2.t6.t14 (cl (! (= @p_179 (! (is_fail$b @p_178) :named @p_180)) :named @p_199)) :rule cong :premises (t5.t2.t6.t13))
+(step t5.t2.t6.t15 (cl (! (= @p_181 (! (and @p_87 @p_180) :named @p_182)) :named @p_200)) :rule cong :premises (t5.t2.t6.t8 t5.t2.t6.t14))
+(step t5.t2.t6 (cl (! (= @p_21 (! (exists ((veriT_vr7 E$) (veriT_vr8 D$)) @p_182) :named @p_162)) :named @p_196)) :rule bind)
+(step t5.t2.t7 (cl @p_50) :rule refl)
+(step t5.t2.t8 (cl @p_81) :rule cong :premises (t5.t2.t7))
+(step t5.t2.t9 (cl @p_72) :rule refl)
+(step t5.t2.t10 (cl @p_82) :rule cong :premises (t5.t2.t8 t5.t2.t9))
+(step t5.t2.t11 (cl @p_183) :rule cong :premises (t5.t2.t10))
+(anchor :step t5.t2.t12 :args ((:= (?v3 E$) veriT_vr7) (:= (?v4 D$) veriT_vr8)))
+(step t5.t2.t12.t1 (cl @p_50) :rule refl)
+(step t5.t2.t12.t2 (cl @p_81) :rule cong :premises (t5.t2.t12.t1))
+(step t5.t2.t12.t3 (cl @p_72) :rule refl)
+(step t5.t2.t12.t4 (cl @p_82) :rule cong :premises (t5.t2.t12.t2 t5.t2.t12.t3))
+(step t5.t2.t12.t5 (cl @p_84) :rule refl)
+(step t5.t2.t12.t6 (cl @p_85) :rule refl)
+(step t5.t2.t12.t7 (cl @p_86) :rule cong :premises (t5.t2.t12.t5 t5.t2.t12.t6))
+(step t5.t2.t12.t8 (cl @p_186) :rule cong :premises (t5.t2.t12.t4 t5.t2.t12.t7))
+(step t5.t2.t12.t9 (cl @p_84) :rule refl)
+(step t5.t2.t12.t10 (cl @p_50) :rule refl)
+(step t5.t2.t12.t11 (cl (= @p_187 @p_130)) :rule cong :premises (t5.t2.t12.t9 t5.t2.t12.t10))
+(step t5.t2.t12.t12 (cl @p_85) :rule refl)
+(step t5.t2.t12.t13 (cl (= @p_188 (! (run$b @p_130 veriT_vr8) :named @p_189))) :rule cong :premises (t5.t2.t12.t11 t5.t2.t12.t12))
+(step t5.t2.t12.t14 (cl (= @p_190 (! (is_fail$b @p_189) :named @p_191))) :rule cong :premises (t5.t2.t12.t13))
+(step t5.t2.t12.t15 (cl (= @p_192 (! (and @p_83 @p_191) :named @p_193))) :rule cong :premises (t5.t2.t12.t8 t5.t2.t12.t14))
+(step t5.t2.t12 (cl (= @p_184 (! (exists ((veriT_vr7 E$) (veriT_vr8 D$)) @p_193) :named @p_185))) :rule bind)
+(step t5.t2.t13 (cl (= @p_194 (! (or @p_73 @p_185) :named @p_195))) :rule cong :premises (t5.t2.t11 t5.t2.t12))
+(step t5.t2.t14 (cl @p_42) :rule refl)
+(step t5.t2.t15 (cl @p_74) :rule cong :premises (t5.t2.t14))
+(step t5.t2.t16 (cl @p_72) :rule refl)
+(step t5.t2.t17 (cl @p_75) :rule cong :premises (t5.t2.t15 t5.t2.t16))
+(step t5.t2.t18 (cl @p_76) :rule cong :premises (t5.t2.t17))
+(anchor :step t5.t2.t19 :args ((:= (?v3 E$) veriT_vr7) (:= (?v4 D$) veriT_vr8)))
+(step t5.t2.t19.t1 (cl @p_42) :rule refl)
+(step t5.t2.t19.t2 (cl @p_74) :rule cong :premises (t5.t2.t19.t1))
+(step t5.t2.t19.t3 (cl @p_72) :rule refl)
+(step t5.t2.t19.t4 (cl @p_75) :rule cong :premises (t5.t2.t19.t2 t5.t2.t19.t3))
+(step t5.t2.t19.t5 (cl @p_84) :rule refl)
+(step t5.t2.t19.t6 (cl @p_85) :rule refl)
+(step t5.t2.t19.t7 (cl @p_86) :rule cong :premises (t5.t2.t19.t5 t5.t2.t19.t6))
+(step t5.t2.t19.t8 (cl @p_175) :rule cong :premises (t5.t2.t19.t4 t5.t2.t19.t7))
+(step t5.t2.t19.t9 (cl @p_84) :rule refl)
+(step t5.t2.t19.t10 (cl @p_42) :rule refl)
+(step t5.t2.t19.t11 (cl @p_197) :rule cong :premises (t5.t2.t19.t9 t5.t2.t19.t10))
+(step t5.t2.t19.t12 (cl @p_85) :rule refl)
+(step t5.t2.t19.t13 (cl @p_198) :rule cong :premises (t5.t2.t19.t11 t5.t2.t19.t12))
+(step t5.t2.t19.t14 (cl @p_199) :rule cong :premises (t5.t2.t19.t13))
+(step t5.t2.t19.t15 (cl @p_200) :rule cong :premises (t5.t2.t19.t8 t5.t2.t19.t14))
+(step t5.t2.t19 (cl @p_196) :rule bind)
+(step t5.t2.t20 (cl (= @p_201 (! (or @p_29 @p_162) :named @p_202))) :rule cong :premises (t5.t2.t18 t5.t2.t19))
+(step t5.t2.t21 (cl (= @p_203 (! (= @p_195 @p_202) :named @p_204))) :rule cong :premises (t5.t2.t13 t5.t2.t20))
+(anchor :step t5.t2.t22 :args ((:= (?v3 F$) veriT_vr9) (:= (?v4 D$) veriT_vr8)))
+(step t5.t2.t22.t1 (cl @p_50) :rule refl)
+(step t5.t2.t22.t2 (cl @p_81) :rule cong :premises (t5.t2.t22.t1))
+(step t5.t2.t22.t3 (cl @p_72) :rule refl)
+(step t5.t2.t22.t4 (cl @p_82) :rule cong :premises (t5.t2.t22.t2 t5.t2.t22.t3))
+(step t5.t2.t22.t5 (cl @p_183) :rule cong :premises (t5.t2.t22.t4))
+(anchor :step t5.t2.t22.t6 :args ((:= (?v5 E$) veriT_vr7) (:= (?v6 D$) veriT_vr10)))
+(step t5.t2.t22.t6.t1 (cl @p_50) :rule refl)
+(step t5.t2.t22.t6.t2 (cl @p_81) :rule cong :premises (t5.t2.t22.t6.t1))
+(step t5.t2.t22.t6.t3 (cl @p_72) :rule refl)
+(step t5.t2.t22.t6.t4 (cl @p_82) :rule cong :premises (t5.t2.t22.t6.t2 t5.t2.t22.t6.t3))
+(step t5.t2.t22.t6.t5 (cl (! (= ?v5 veriT_vr7) :named @p_211)) :rule refl)
+(step t5.t2.t22.t6.t6 (cl (! (= ?v6 veriT_vr10) :named @p_213)) :rule refl)
+(step t5.t2.t22.t6.t7 (cl (! (= @p_22 (! (pair$a veriT_vr7 veriT_vr10) :named @p_163)) :named @p_224)) :rule cong :premises (t5.t2.t22.t6.t5 t5.t2.t22.t6.t6))
+(step t5.t2.t22.t6.t8 (cl (= @p_209 (! (is_res$a @p_30 @p_163) :named @p_210))) :rule cong :premises (t5.t2.t22.t6.t4 t5.t2.t22.t6.t7))
+(step t5.t2.t22.t6.t9 (cl @p_211) :rule refl)
+(step t5.t2.t22.t6.t10 (cl @p_50) :rule refl)
+(step t5.t2.t22.t6.t11 (cl (= @p_212 @p_130)) :rule cong :premises (t5.t2.t22.t6.t9 t5.t2.t22.t6.t10))
+(step t5.t2.t22.t6.t12 (cl @p_213) :rule refl)
+(step t5.t2.t22.t6.t13 (cl (= @p_214 (! (run$b @p_130 veriT_vr10) :named @p_215))) :rule cong :premises (t5.t2.t22.t6.t11 t5.t2.t22.t6.t12))
+(step t5.t2.t22.t6.t14 (cl (! (= ?v3 veriT_vr9) :named @p_230)) :rule refl)
+(step t5.t2.t22.t6.t15 (cl @p_85) :rule refl)
+(step t5.t2.t22.t6.t16 (cl (! (= @p_23 @p_100) :named @p_231)) :rule cong :premises (t5.t2.t22.t6.t14 t5.t2.t22.t6.t15))
+(step t5.t2.t22.t6.t17 (cl (= @p_216 (! (is_res$b @p_215 @p_100) :named @p_217))) :rule cong :premises (t5.t2.t22.t6.t13 t5.t2.t22.t6.t16))
+(step t5.t2.t22.t6.t18 (cl (= @p_218 (! (and @p_210 @p_217) :named @p_219))) :rule cong :premises (t5.t2.t22.t6.t8 t5.t2.t22.t6.t17))
+(step t5.t2.t22.t6 (cl (= @p_207 (! (exists ((veriT_vr7 E$) (veriT_vr10 D$)) @p_219) :named @p_208))) :rule bind)
+(step t5.t2.t22.t7 (cl (= @p_220 (! (or @p_73 @p_208) :named @p_221))) :rule cong :premises (t5.t2.t22.t5 t5.t2.t22.t6))
+(step t5.t2.t22.t8 (cl @p_42) :rule refl)
+(step t5.t2.t22.t9 (cl @p_74) :rule cong :premises (t5.t2.t22.t8))
+(step t5.t2.t22.t10 (cl @p_72) :rule refl)
+(step t5.t2.t22.t11 (cl @p_75) :rule cong :premises (t5.t2.t22.t9 t5.t2.t22.t10))
+(step t5.t2.t22.t12 (cl @p_76) :rule cong :premises (t5.t2.t22.t11))
+(anchor :step t5.t2.t22.t13 :args ((:= (?v5 E$) veriT_vr7) (:= (?v6 D$) veriT_vr10)))
+(step t5.t2.t22.t13.t1 (cl @p_42) :rule refl)
+(step t5.t2.t22.t13.t2 (cl @p_74) :rule cong :premises (t5.t2.t22.t13.t1))
+(step t5.t2.t22.t13.t3 (cl @p_72) :rule refl)
+(step t5.t2.t22.t13.t4 (cl @p_75) :rule cong :premises (t5.t2.t22.t13.t2 t5.t2.t22.t13.t3))
+(step t5.t2.t22.t13.t5 (cl @p_211) :rule refl)
+(step t5.t2.t22.t13.t6 (cl @p_213) :rule refl)
+(step t5.t2.t22.t13.t7 (cl @p_224) :rule cong :premises (t5.t2.t22.t13.t5 t5.t2.t22.t13.t6))
+(step t5.t2.t22.t13.t8 (cl (= @p_225 (! (is_res$a @p_31 @p_163) :named @p_226))) :rule cong :premises (t5.t2.t22.t13.t4 t5.t2.t22.t13.t7))
+(step t5.t2.t22.t13.t9 (cl @p_211) :rule refl)
+(step t5.t2.t22.t13.t10 (cl @p_42) :rule refl)
+(step t5.t2.t22.t13.t11 (cl (= @p_227 @p_127)) :rule cong :premises (t5.t2.t22.t13.t9 t5.t2.t22.t13.t10))
+(step t5.t2.t22.t13.t12 (cl @p_213) :rule refl)
+(step t5.t2.t22.t13.t13 (cl (= @p_228 (! (run$b @p_127 veriT_vr10) :named @p_229))) :rule cong :premises (t5.t2.t22.t13.t11 t5.t2.t22.t13.t12))
+(step t5.t2.t22.t13.t14 (cl @p_230) :rule refl)
+(step t5.t2.t22.t13.t15 (cl @p_85) :rule refl)
+(step t5.t2.t22.t13.t16 (cl @p_231) :rule cong :premises (t5.t2.t22.t13.t14 t5.t2.t22.t13.t15))
+(step t5.t2.t22.t13.t17 (cl (= @p_232 (! (is_res$b @p_229 @p_100) :named @p_233))) :rule cong :premises (t5.t2.t22.t13.t13 t5.t2.t22.t13.t16))
+(step t5.t2.t22.t13.t18 (cl (= @p_234 (! (and @p_226 @p_233) :named @p_235))) :rule cong :premises (t5.t2.t22.t13.t8 t5.t2.t22.t13.t17))
+(step t5.t2.t22.t13 (cl (= @p_222 (! (exists ((veriT_vr7 E$) (veriT_vr10 D$)) @p_235) :named @p_223))) :rule bind)
+(step t5.t2.t22.t14 (cl (= @p_236 (! (or @p_29 @p_223) :named @p_237))) :rule cong :premises (t5.t2.t22.t12 t5.t2.t22.t13))
+(step t5.t2.t22.t15 (cl (= @p_238 (! (= @p_221 @p_237) :named @p_239))) :rule cong :premises (t5.t2.t22.t7 t5.t2.t22.t14))
+(step t5.t2.t22 (cl (= @p_205 (! (forall ((veriT_vr9 F$) (veriT_vr8 D$)) @p_239) :named @p_206))) :rule bind)
+(step t5.t2.t23 (cl (= @p_240 (! (and @p_204 @p_206) :named @p_241))) :rule cong :premises (t5.t2.t21 t5.t2.t22))
+(step t5.t2.t24 (cl (= @p_242 (! (or @p_162 @p_241) :named @p_243))) :rule cong :premises (t5.t2.t6 t5.t2.t23))
+(step t5.t2.t25 (cl (= @p_244 (! (or @p_29 @p_243) :named @p_245))) :rule cong :premises (t5.t2.t5 t5.t2.t24))
+(step t5.t2 (cl (= @p_173 (! (forall ((veriT_vr6 D$)) @p_245) :named @p_174))) :rule bind)
+(step t5.t3 (cl (= @p_246 (! (=> @p_33 @p_174) :named @p_247))) :rule cong :premises (t5.t1 t5.t2))
+(step t5 (cl (= @p_161 (! (forall ((veriT_vr0 A_b_c_M_state_fun$) (veriT_vr1 A_b_c_M_state_fun$)) @p_247) :named @p_250))) :rule bind)
+(step t6 (cl (= @p_248 (! (=> @p_249 @p_250) :named @p_252))) :rule cong :premises (t4 t5))
+(step t7 (cl (! (= @p_251 (! (not @p_252) :named @p_254)) :named @p_253)) :rule cong :premises (t6))
+(step t8 (cl (! (not @p_253) :named @p_256) (! (not @p_251) :named @p_255) @p_254) :rule equiv_pos2)
+(step t9 (cl (not @p_255) @p_248) :rule not_not)
+(step t10 (cl @p_256 @p_248 @p_254) :rule th_resolution :premises (t9 t8))
+(step t11 (cl @p_254) :rule th_resolution :premises (axiom0 t7 t10))
+(step t12 (cl (! (= @p_254 (! (and @p_249 (! (not @p_250) :named @p_264)) :named @p_258)) :named @p_257)) :rule bool_simplify)
+(step t13 (cl (! (not @p_257) :named @p_260) (! (not @p_254) :named @p_259) @p_258) :rule equiv_pos2)
+(step t14 (cl (not @p_259) @p_252) :rule not_not)
+(step t15 (cl @p_260 @p_252 @p_258) :rule th_resolution :premises (t14 t13))
+(step t16 (cl @p_258) :rule th_resolution :premises (t11 t12 t15))
+(anchor :step t17 :args ((veriT_vr0 A_b_c_M_state_fun$) (veriT_vr1 A_b_c_M_state_fun$)))
+(anchor :step t17.t1 :args ((veriT_vr6 D$)))
+(step t17.t1.t1 (cl (= @p_245 (! (or @p_29 @p_162 @p_241) :named @p_262))) :rule ac_simp)
+(step t17.t1 (cl (= @p_174 (! (forall ((veriT_vr6 D$)) @p_262) :named @p_261))) :rule bind)
+(step t17.t2 (cl (= @p_247 (! (=> @p_33 @p_261) :named @p_263))) :rule cong :premises (t17.t1))
+(step t17 (cl (= @p_250 (! (forall ((veriT_vr0 A_b_c_M_state_fun$) (veriT_vr1 A_b_c_M_state_fun$)) @p_263) :named @p_265))) :rule bind)
+(step t18 (cl (= @p_264 (! (not @p_265) :named @p_266))) :rule cong :premises (t17))
+(step t19 (cl (! (= @p_258 (! (and @p_159 @p_160 @p_266) :named @p_268)) :named @p_267)) :rule ac_simp :premises (t18))
+(step t20 (cl (not @p_267) (not @p_258) @p_268) :rule equiv_pos2)
+(step t21 (cl @p_268) :rule th_resolution :premises (t16 t19 t20))
+(anchor :step t22 :args ((:= (veriT_vr7 E$) veriT_vr11) (:= (veriT_vr0 A_b_c_M_state_fun$) veriT_vr12) (:= (veriT_vr1 A_b_c_M_state_fun$) veriT_vr13)))
+(anchor :step t22.t1 :args ((:= (veriT_vr2 A$) veriT_vr14) (:= (veriT_vr3 C$) veriT_vr15)))
+(step t22.t1.t1 (cl (! (= veriT_vr0 veriT_vr12) :named @p_283)) :rule refl)
+(step t22.t1.t2 (cl (! (= veriT_vr2 veriT_vr14) :named @p_279)) :rule refl)
+(step t22.t1.t3 (cl (! (= @p_35 (! (fun_app$ veriT_vr12 veriT_vr14) :named @p_278)) :named @p_284)) :rule cong :premises (t22.t1.t1 t22.t1.t2))
+(step t22.t1.t4 (cl (! (= veriT_vr3 veriT_vr15) :named @p_281)) :rule refl)
+(step t22.t1.t5 (cl (! (= @p_27 (! (run$ @p_278 veriT_vr15) :named @p_271)) :named @p_285)) :rule cong :premises (t22.t1.t3 t22.t1.t4))
+(step t22.t1.t6 (cl (! (= @p_25 (! (is_fail$ @p_271) :named @p_269)) :named @p_286)) :rule cong :premises (t22.t1.t5))
+(step t22.t1.t7 (cl (! (= veriT_vr1 veriT_vr13) :named @p_289)) :rule refl)
+(step t22.t1.t8 (cl @p_279) :rule refl)
+(step t22.t1.t9 (cl (! (= @p_38 (! (fun_app$ veriT_vr13 veriT_vr14) :named @p_280)) :named @p_290)) :rule cong :premises (t22.t1.t7 t22.t1.t8))
+(step t22.t1.t10 (cl @p_281) :rule refl)
+(step t22.t1.t11 (cl (! (= @p_26 (! (run$ @p_280 veriT_vr15) :named @p_270)) :named @p_291)) :rule cong :premises (t22.t1.t9 t22.t1.t10))
+(step t22.t1.t12 (cl (= @p_41 (! (is_fail$ @p_270) :named @p_282))) :rule cong :premises (t22.t1.t11))
+(step t22.t1.t13 (cl @p_283) :rule refl)
+(step t22.t1.t14 (cl @p_279) :rule refl)
+(step t22.t1.t15 (cl @p_284) :rule cong :premises (t22.t1.t13 t22.t1.t14))
+(step t22.t1.t16 (cl @p_281) :rule refl)
+(step t22.t1.t17 (cl @p_285) :rule cong :premises (t22.t1.t15 t22.t1.t16))
+(step t22.t1.t18 (cl @p_286) :rule cong :premises (t22.t1.t17))
+(step t22.t1.t19 (cl (= @p_47 (! (= @p_282 @p_269) :named @p_287))) :rule cong :premises (t22.t1.t12 t22.t1.t18))
+(anchor :step t22.t1.t20 :args ((:= (veriT_vr4 B$) veriT_vr16) (:= (veriT_vr5 C$) veriT_vr17)))
+(step t22.t1.t20.t1 (cl @p_289) :rule refl)
+(step t22.t1.t20.t2 (cl @p_279) :rule refl)
+(step t22.t1.t20.t3 (cl @p_290) :rule cong :premises (t22.t1.t20.t1 t22.t1.t20.t2))
+(step t22.t1.t20.t4 (cl @p_281) :rule refl)
+(step t22.t1.t20.t5 (cl @p_291) :rule cong :premises (t22.t1.t20.t3 t22.t1.t20.t4))
+(step t22.t1.t20.t6 (cl (! (= veriT_vr4 veriT_vr16) :named @p_293)) :rule refl)
+(step t22.t1.t20.t7 (cl (! (= veriT_vr5 veriT_vr17) :named @p_294)) :rule refl)
+(step t22.t1.t20.t8 (cl (! (= @p_28 (! (pair$ veriT_vr16 veriT_vr17) :named @p_272)) :named @p_295)) :rule cong :premises (t22.t1.t20.t6 t22.t1.t20.t7))
+(step t22.t1.t20.t9 (cl (= @p_54 (! (is_res$ @p_270 @p_272) :named @p_292))) :rule cong :premises (t22.t1.t20.t5 t22.t1.t20.t8))
+(step t22.t1.t20.t10 (cl @p_283) :rule refl)
+(step t22.t1.t20.t11 (cl @p_279) :rule refl)
+(step t22.t1.t20.t12 (cl @p_284) :rule cong :premises (t22.t1.t20.t10 t22.t1.t20.t11))
+(step t22.t1.t20.t13 (cl @p_281) :rule refl)
+(step t22.t1.t20.t14 (cl @p_285) :rule cong :premises (t22.t1.t20.t12 t22.t1.t20.t13))
+(step t22.t1.t20.t15 (cl @p_293) :rule refl)
+(step t22.t1.t20.t16 (cl @p_294) :rule refl)
+(step t22.t1.t20.t17 (cl @p_295) :rule cong :premises (t22.t1.t20.t15 t22.t1.t20.t16))
+(step t22.t1.t20.t18 (cl (= @p_59 (! (is_res$ @p_271 @p_272) :named @p_296))) :rule cong :premises (t22.t1.t20.t14 t22.t1.t20.t17))
+(step t22.t1.t20.t19 (cl (= @p_61 (! (= @p_292 @p_296) :named @p_297))) :rule cong :premises (t22.t1.t20.t9 t22.t1.t20.t18))
+(step t22.t1.t20 (cl (= @p_49 (! (forall ((veriT_vr16 B$) (veriT_vr17 C$)) @p_297) :named @p_288))) :rule bind)
+(step t22.t1.t21 (cl (= @p_63 (! (and @p_287 @p_288) :named @p_298))) :rule cong :premises (t22.t1.t19 t22.t1.t20))
+(step t22.t1.t22 (cl (= @p_65 (! (or @p_269 @p_298) :named @p_299))) :rule cong :premises (t22.t1.t6 t22.t1.t21))
+(step t22.t1 (cl (= @p_33 (! (forall ((veriT_vr14 A$) (veriT_vr15 C$)) @p_299) :named @p_277))) :rule bind)
+(anchor :step t22.t2 :args ((:= (veriT_vr6 D$) veriT_vr10)))
+(step t22.t2.t1 (cl (! (= veriT_vr7 veriT_vr11) :named @p_302)) :rule refl)
+(step t22.t2.t2 (cl @p_283) :rule refl)
+(step t22.t2.t3 (cl (! (= @p_127 (! (c$ veriT_vr11 veriT_vr12) :named @p_301)) :named @p_306)) :rule cong :premises (t22.t2.t1 t22.t2.t2))
+(step t22.t2.t4 (cl (! (= veriT_vr6 veriT_vr10) :named @p_304)) :rule refl)
+(step t22.t2.t5 (cl (! (= @p_99 (! (run$b @p_301 veriT_vr10) :named @p_275)) :named @p_307)) :rule cong :premises (t22.t2.t3 t22.t2.t4))
+(step t22.t2.t6 (cl (! (= @p_97 (! (is_fail$b @p_275) :named @p_273)) :named @p_308)) :rule cong :premises (t22.t2.t5))
+(step t22.t2.t7 (cl @p_302) :rule refl)
+(step t22.t2.t8 (cl @p_289) :rule refl)
+(step t22.t2.t9 (cl (! (= @p_130 (! (c$ veriT_vr11 veriT_vr13) :named @p_303)) :named @p_311)) :rule cong :premises (t22.t2.t7 t22.t2.t8))
+(step t22.t2.t10 (cl @p_304) :rule refl)
+(step t22.t2.t11 (cl (! (= @p_98 (! (run$b @p_303 veriT_vr10) :named @p_274)) :named @p_312)) :rule cong :premises (t22.t2.t9 t22.t2.t10))
+(step t22.t2.t12 (cl (= @p_133 (! (is_fail$b @p_274) :named @p_305))) :rule cong :premises (t22.t2.t11))
+(step t22.t2.t13 (cl @p_302) :rule refl)
+(step t22.t2.t14 (cl @p_283) :rule refl)
+(step t22.t2.t15 (cl @p_306) :rule cong :premises (t22.t2.t13 t22.t2.t14))
+(step t22.t2.t16 (cl @p_304) :rule refl)
+(step t22.t2.t17 (cl @p_307) :rule cong :premises (t22.t2.t15 t22.t2.t16))
+(step t22.t2.t18 (cl @p_308) :rule cong :premises (t22.t2.t17))
+(step t22.t2.t19 (cl (= @p_138 (! (= @p_305 @p_273) :named @p_309))) :rule cong :premises (t22.t2.t12 t22.t2.t18))
+(anchor :step t22.t2.t20 :args ((:= (veriT_vr9 F$) veriT_vr9) (:= (veriT_vr8 D$) veriT_vr18)))
+(step t22.t2.t20.t1 (cl @p_302) :rule refl)
+(step t22.t2.t20.t2 (cl @p_289) :rule refl)
+(step t22.t2.t20.t3 (cl @p_311) :rule cong :premises (t22.t2.t20.t1 t22.t2.t20.t2))
+(step t22.t2.t20.t4 (cl @p_304) :rule refl)
+(step t22.t2.t20.t5 (cl @p_312) :rule cong :premises (t22.t2.t20.t3 t22.t2.t20.t4))
+(step t22.t2.t20.t6 (cl (! (= veriT_vr8 veriT_vr18) :named @p_314)) :rule refl)
+(step t22.t2.t20.t7 (cl (! (= @p_100 (! (pair$b veriT_vr9 veriT_vr18) :named @p_276)) :named @p_315)) :rule cong :premises (t22.t2.t20.t6))
+(step t22.t2.t20.t8 (cl (= @p_144 (! (is_res$b @p_274 @p_276) :named @p_313))) :rule cong :premises (t22.t2.t20.t5 t22.t2.t20.t7))
+(step t22.t2.t20.t9 (cl @p_302) :rule refl)
+(step t22.t2.t20.t10 (cl @p_283) :rule refl)
+(step t22.t2.t20.t11 (cl @p_306) :rule cong :premises (t22.t2.t20.t9 t22.t2.t20.t10))
+(step t22.t2.t20.t12 (cl @p_304) :rule refl)
+(step t22.t2.t20.t13 (cl @p_307) :rule cong :premises (t22.t2.t20.t11 t22.t2.t20.t12))
+(step t22.t2.t20.t14 (cl @p_314) :rule refl)
+(step t22.t2.t20.t15 (cl @p_315) :rule cong :premises (t22.t2.t20.t14))
+(step t22.t2.t20.t16 (cl (= @p_149 (! (is_res$b @p_275 @p_276) :named @p_316))) :rule cong :premises (t22.t2.t20.t13 t22.t2.t20.t15))
+(step t22.t2.t20.t17 (cl (= @p_151 (! (= @p_313 @p_316) :named @p_317))) :rule cong :premises (t22.t2.t20.t8 t22.t2.t20.t16))
+(step t22.t2.t20 (cl (= @p_140 (! (forall ((veriT_vr9 F$) (veriT_vr18 D$)) @p_317) :named @p_310))) :rule bind)
+(step t22.t2.t21 (cl (= @p_153 (! (and @p_309 @p_310) :named @p_318))) :rule cong :premises (t22.t2.t19 t22.t2.t20))
+(step t22.t2.t22 (cl (= @p_155 (! (or @p_273 @p_318) :named @p_319))) :rule cong :premises (t22.t2.t6 t22.t2.t21))
+(step t22.t2 (cl (= @p_125 (! (forall ((veriT_vr10 D$)) @p_319) :named @p_300))) :rule bind)
+(step t22.t3 (cl (= @p_157 (! (=> @p_277 @p_300) :named @p_320))) :rule cong :premises (t22.t1 t22.t2))
+(step t22 (cl (= @p_160 (! (forall ((veriT_vr11 E$) (veriT_vr12 A_b_c_M_state_fun$) (veriT_vr13 A_b_c_M_state_fun$)) @p_320) :named @p_422))) :rule bind)
+(anchor :step t23 :args ((:= (veriT_vr0 A_b_c_M_state_fun$) veriT_vr19) (:= (veriT_vr1 A_b_c_M_state_fun$) veriT_vr20)))
+(anchor :step t23.t1 :args ((:= (veriT_vr2 A$) veriT_vr21) (:= (veriT_vr3 C$) veriT_vr22)))
+(step t23.t1.t1 (cl (! (= veriT_vr0 veriT_vr19) :named @p_336)) :rule refl)
+(step t23.t1.t2 (cl (! (= veriT_vr2 veriT_vr21) :named @p_332)) :rule refl)
+(step t23.t1.t3 (cl (! (= @p_35 (! (fun_app$ veriT_vr19 veriT_vr21) :named @p_331)) :named @p_337)) :rule cong :premises (t23.t1.t1 t23.t1.t2))
+(step t23.t1.t4 (cl (! (= veriT_vr3 veriT_vr22) :named @p_334)) :rule refl)
+(step t23.t1.t5 (cl (! (= @p_27 (! (run$ @p_331 veriT_vr22) :named @p_323)) :named @p_338)) :rule cong :premises (t23.t1.t3 t23.t1.t4))
+(step t23.t1.t6 (cl (! (= @p_25 (! (is_fail$ @p_323) :named @p_321)) :named @p_339)) :rule cong :premises (t23.t1.t5))
+(step t23.t1.t7 (cl (! (= veriT_vr1 veriT_vr20) :named @p_342)) :rule refl)
+(step t23.t1.t8 (cl @p_332) :rule refl)
+(step t23.t1.t9 (cl (! (= @p_38 (! (fun_app$ veriT_vr20 veriT_vr21) :named @p_333)) :named @p_343)) :rule cong :premises (t23.t1.t7 t23.t1.t8))
+(step t23.t1.t10 (cl @p_334) :rule refl)
+(step t23.t1.t11 (cl (! (= @p_26 (! (run$ @p_333 veriT_vr22) :named @p_322)) :named @p_344)) :rule cong :premises (t23.t1.t9 t23.t1.t10))
+(step t23.t1.t12 (cl (= @p_41 (! (is_fail$ @p_322) :named @p_335))) :rule cong :premises (t23.t1.t11))
+(step t23.t1.t13 (cl @p_336) :rule refl)
+(step t23.t1.t14 (cl @p_332) :rule refl)
+(step t23.t1.t15 (cl @p_337) :rule cong :premises (t23.t1.t13 t23.t1.t14))
+(step t23.t1.t16 (cl @p_334) :rule refl)
+(step t23.t1.t17 (cl @p_338) :rule cong :premises (t23.t1.t15 t23.t1.t16))
+(step t23.t1.t18 (cl @p_339) :rule cong :premises (t23.t1.t17))
+(step t23.t1.t19 (cl (= @p_47 (! (= @p_335 @p_321) :named @p_340))) :rule cong :premises (t23.t1.t12 t23.t1.t18))
+(anchor :step t23.t1.t20 :args ((:= (veriT_vr4 B$) veriT_vr23) (:= (veriT_vr5 C$) veriT_vr24)))
+(step t23.t1.t20.t1 (cl @p_342) :rule refl)
+(step t23.t1.t20.t2 (cl @p_332) :rule refl)
+(step t23.t1.t20.t3 (cl @p_343) :rule cong :premises (t23.t1.t20.t1 t23.t1.t20.t2))
+(step t23.t1.t20.t4 (cl @p_334) :rule refl)
+(step t23.t1.t20.t5 (cl @p_344) :rule cong :premises (t23.t1.t20.t3 t23.t1.t20.t4))
+(step t23.t1.t20.t6 (cl (! (= veriT_vr4 veriT_vr23) :named @p_346)) :rule refl)
+(step t23.t1.t20.t7 (cl (! (= veriT_vr5 veriT_vr24) :named @p_347)) :rule refl)
+(step t23.t1.t20.t8 (cl (! (= @p_28 (! (pair$ veriT_vr23 veriT_vr24) :named @p_324)) :named @p_348)) :rule cong :premises (t23.t1.t20.t6 t23.t1.t20.t7))
+(step t23.t1.t20.t9 (cl (= @p_54 (! (is_res$ @p_322 @p_324) :named @p_345))) :rule cong :premises (t23.t1.t20.t5 t23.t1.t20.t8))
+(step t23.t1.t20.t10 (cl @p_336) :rule refl)
+(step t23.t1.t20.t11 (cl @p_332) :rule refl)
+(step t23.t1.t20.t12 (cl @p_337) :rule cong :premises (t23.t1.t20.t10 t23.t1.t20.t11))
+(step t23.t1.t20.t13 (cl @p_334) :rule refl)
+(step t23.t1.t20.t14 (cl @p_338) :rule cong :premises (t23.t1.t20.t12 t23.t1.t20.t13))
+(step t23.t1.t20.t15 (cl @p_346) :rule refl)
+(step t23.t1.t20.t16 (cl @p_347) :rule refl)
+(step t23.t1.t20.t17 (cl @p_348) :rule cong :premises (t23.t1.t20.t15 t23.t1.t20.t16))
+(step t23.t1.t20.t18 (cl (= @p_59 (! (is_res$ @p_323 @p_324) :named @p_349))) :rule cong :premises (t23.t1.t20.t14 t23.t1.t20.t17))
+(step t23.t1.t20.t19 (cl (= @p_61 (! (= @p_345 @p_349) :named @p_350))) :rule cong :premises (t23.t1.t20.t9 t23.t1.t20.t18))
+(step t23.t1.t20 (cl (= @p_49 (! (forall ((veriT_vr23 B$) (veriT_vr24 C$)) @p_350) :named @p_341))) :rule bind)
+(step t23.t1.t21 (cl (= @p_63 (! (and @p_340 @p_341) :named @p_351))) :rule cong :premises (t23.t1.t19 t23.t1.t20))
+(step t23.t1.t22 (cl (= @p_65 (! (or @p_321 @p_351) :named @p_352))) :rule cong :premises (t23.t1.t6 t23.t1.t21))
+(step t23.t1 (cl (= @p_33 (! (forall ((veriT_vr21 A$) (veriT_vr22 C$)) @p_352) :named @p_330))) :rule bind)
+(anchor :step t23.t2 :args ((:= (veriT_vr6 D$) veriT_vr25)))
+(step t23.t2.t1 (cl @p_336) :rule refl)
+(step t23.t2.t2 (cl (! (= @p_69 (! (b$ veriT_vr19) :named @p_354)) :named @p_356)) :rule cong :premises (t23.t2.t1))
+(step t23.t2.t3 (cl (! (= veriT_vr6 veriT_vr25) :named @p_357)) :rule refl)
+(step t23.t2.t4 (cl (! (= @p_31 (! (run$a @p_354 veriT_vr25) :named @p_325)) :named @p_358)) :rule cong :premises (t23.t2.t2 t23.t2.t3))
+(step t23.t2.t5 (cl (! (= @p_29 (! (is_fail$a @p_325) :named @p_327)) :named @p_380)) :rule cong :premises (t23.t2.t4))
+(anchor :step t23.t2.t6 :args ((:= (veriT_vr7 E$) veriT_vr26) (:= (veriT_vr8 D$) veriT_vr27)))
+(step t23.t2.t6.t1 (cl @p_336) :rule refl)
+(step t23.t2.t6.t2 (cl @p_356) :rule cong :premises (t23.t2.t6.t1))
+(step t23.t2.t6.t3 (cl @p_357) :rule refl)
+(step t23.t2.t6.t4 (cl @p_358) :rule cong :premises (t23.t2.t6.t2 t23.t2.t6.t3))
+(step t23.t2.t6.t5 (cl (! (= veriT_vr7 veriT_vr26) :named @p_361)) :rule refl)
+(step t23.t2.t6.t6 (cl (! (= veriT_vr8 veriT_vr27) :named @p_363)) :rule refl)
+(step t23.t2.t6.t7 (cl (= @p_32 (! (pair$a veriT_vr26 veriT_vr27) :named @p_359))) :rule cong :premises (t23.t2.t6.t5 t23.t2.t6.t6))
+(step t23.t2.t6.t8 (cl (= @p_87 (! (is_res$a @p_325 @p_359) :named @p_360))) :rule cong :premises (t23.t2.t6.t4 t23.t2.t6.t7))
+(step t23.t2.t6.t9 (cl @p_361) :rule refl)
+(step t23.t2.t6.t10 (cl @p_336) :rule refl)
+(step t23.t2.t6.t11 (cl (= @p_127 (! (c$ veriT_vr26 veriT_vr19) :named @p_362))) :rule cong :premises (t23.t2.t6.t9 t23.t2.t6.t10))
+(step t23.t2.t6.t12 (cl @p_363) :rule refl)
+(step t23.t2.t6.t13 (cl (= @p_178 (! (run$b @p_362 veriT_vr27) :named @p_364))) :rule cong :premises (t23.t2.t6.t11 t23.t2.t6.t12))
+(step t23.t2.t6.t14 (cl (= @p_180 (! (is_fail$b @p_364) :named @p_365))) :rule cong :premises (t23.t2.t6.t13))
+(step t23.t2.t6.t15 (cl (= @p_182 (! (and @p_360 @p_365) :named @p_366))) :rule cong :premises (t23.t2.t6.t8 t23.t2.t6.t14))
+(step t23.t2.t6 (cl (= @p_162 (! (exists ((veriT_vr26 E$) (veriT_vr27 D$)) @p_366) :named @p_355))) :rule bind)
+(step t23.t2.t7 (cl @p_342) :rule refl)
+(step t23.t2.t8 (cl (! (= @p_71 (! (b$ veriT_vr20) :named @p_367)) :named @p_369)) :rule cong :premises (t23.t2.t7))
+(step t23.t2.t9 (cl @p_357) :rule refl)
+(step t23.t2.t10 (cl (! (= @p_30 (! (run$a @p_367 veriT_vr25) :named @p_326)) :named @p_370)) :rule cong :premises (t23.t2.t8 t23.t2.t9))
+(step t23.t2.t11 (cl (! (= @p_73 (! (is_fail$a @p_326) :named @p_328)) :named @p_393)) :rule cong :premises (t23.t2.t10))
+(anchor :step t23.t2.t12 :args ((:= (veriT_vr7 E$) veriT_vr28) (:= (veriT_vr8 D$) veriT_vr29)))
+(step t23.t2.t12.t1 (cl @p_342) :rule refl)
+(step t23.t2.t12.t2 (cl @p_369) :rule cong :premises (t23.t2.t12.t1))
+(step t23.t2.t12.t3 (cl @p_357) :rule refl)
+(step t23.t2.t12.t4 (cl @p_370) :rule cong :premises (t23.t2.t12.t2 t23.t2.t12.t3))
+(step t23.t2.t12.t5 (cl (! (= veriT_vr7 veriT_vr28) :named @p_373)) :rule refl)
+(step t23.t2.t12.t6 (cl (! (= veriT_vr8 veriT_vr29) :named @p_375)) :rule refl)
+(step t23.t2.t12.t7 (cl (= @p_32 (! (pair$a veriT_vr28 veriT_vr29) :named @p_371))) :rule cong :premises (t23.t2.t12.t5 t23.t2.t12.t6))
+(step t23.t2.t12.t8 (cl (= @p_83 (! (is_res$a @p_326 @p_371) :named @p_372))) :rule cong :premises (t23.t2.t12.t4 t23.t2.t12.t7))
+(step t23.t2.t12.t9 (cl @p_373) :rule refl)
+(step t23.t2.t12.t10 (cl @p_342) :rule refl)
+(step t23.t2.t12.t11 (cl (= @p_130 (! (c$ veriT_vr28 veriT_vr20) :named @p_374))) :rule cong :premises (t23.t2.t12.t9 t23.t2.t12.t10))
+(step t23.t2.t12.t12 (cl @p_375) :rule refl)
+(step t23.t2.t12.t13 (cl (= @p_189 (! (run$b @p_374 veriT_vr29) :named @p_376))) :rule cong :premises (t23.t2.t12.t11 t23.t2.t12.t12))
+(step t23.t2.t12.t14 (cl (= @p_191 (! (is_fail$b @p_376) :named @p_377))) :rule cong :premises (t23.t2.t12.t13))
+(step t23.t2.t12.t15 (cl (= @p_193 (! (and @p_372 @p_377) :named @p_378))) :rule cong :premises (t23.t2.t12.t8 t23.t2.t12.t14))
+(step t23.t2.t12 (cl (= @p_185 (! (exists ((veriT_vr28 E$) (veriT_vr29 D$)) @p_378) :named @p_368))) :rule bind)
+(step t23.t2.t13 (cl (= @p_195 (! (or @p_328 @p_368) :named @p_379))) :rule cong :premises (t23.t2.t11 t23.t2.t12))
+(step t23.t2.t14 (cl @p_336) :rule refl)
+(step t23.t2.t15 (cl @p_356) :rule cong :premises (t23.t2.t14))
+(step t23.t2.t16 (cl @p_357) :rule refl)
+(step t23.t2.t17 (cl @p_358) :rule cong :premises (t23.t2.t15 t23.t2.t16))
+(step t23.t2.t18 (cl @p_380) :rule cong :premises (t23.t2.t17))
+(anchor :step t23.t2.t19 :args ((:= (veriT_vr7 E$) veriT_vr30) (:= (veriT_vr8 D$) veriT_vr31)))
+(step t23.t2.t19.t1 (cl @p_336) :rule refl)
+(step t23.t2.t19.t2 (cl @p_356) :rule cong :premises (t23.t2.t19.t1))
+(step t23.t2.t19.t3 (cl @p_357) :rule refl)
+(step t23.t2.t19.t4 (cl @p_358) :rule cong :premises (t23.t2.t19.t2 t23.t2.t19.t3))
+(step t23.t2.t19.t5 (cl (! (= veriT_vr7 veriT_vr30) :named @p_384)) :rule refl)
+(step t23.t2.t19.t6 (cl (! (= veriT_vr8 veriT_vr31) :named @p_386)) :rule refl)
+(step t23.t2.t19.t7 (cl (= @p_32 (! (pair$a veriT_vr30 veriT_vr31) :named @p_382))) :rule cong :premises (t23.t2.t19.t5 t23.t2.t19.t6))
+(step t23.t2.t19.t8 (cl (= @p_87 (! (is_res$a @p_325 @p_382) :named @p_383))) :rule cong :premises (t23.t2.t19.t4 t23.t2.t19.t7))
+(step t23.t2.t19.t9 (cl @p_384) :rule refl)
+(step t23.t2.t19.t10 (cl @p_336) :rule refl)
+(step t23.t2.t19.t11 (cl (= @p_127 (! (c$ veriT_vr30 veriT_vr19) :named @p_385))) :rule cong :premises (t23.t2.t19.t9 t23.t2.t19.t10))
+(step t23.t2.t19.t12 (cl @p_386) :rule refl)
+(step t23.t2.t19.t13 (cl (= @p_178 (! (run$b @p_385 veriT_vr31) :named @p_387))) :rule cong :premises (t23.t2.t19.t11 t23.t2.t19.t12))
+(step t23.t2.t19.t14 (cl (= @p_180 (! (is_fail$b @p_387) :named @p_388))) :rule cong :premises (t23.t2.t19.t13))
+(step t23.t2.t19.t15 (cl (= @p_182 (! (and @p_383 @p_388) :named @p_389))) :rule cong :premises (t23.t2.t19.t8 t23.t2.t19.t14))
+(step t23.t2.t19 (cl (= @p_162 (! (exists ((veriT_vr30 E$) (veriT_vr31 D$)) @p_389) :named @p_381))) :rule bind)
+(step t23.t2.t20 (cl (= @p_202 (! (or @p_327 @p_381) :named @p_390))) :rule cong :premises (t23.t2.t18 t23.t2.t19))
+(step t23.t2.t21 (cl (= @p_204 (! (= @p_379 @p_390) :named @p_391))) :rule cong :premises (t23.t2.t13 t23.t2.t20))
+(anchor :step t23.t2.t22 :args ((:= (veriT_vr9 F$) veriT_vr32) (:= (veriT_vr8 D$) veriT_vr33)))
+(step t23.t2.t22.t1 (cl @p_342) :rule refl)
+(step t23.t2.t22.t2 (cl @p_369) :rule cong :premises (t23.t2.t22.t1))
+(step t23.t2.t22.t3 (cl @p_357) :rule refl)
+(step t23.t2.t22.t4 (cl @p_370) :rule cong :premises (t23.t2.t22.t2 t23.t2.t22.t3))
+(step t23.t2.t22.t5 (cl @p_393) :rule cong :premises (t23.t2.t22.t4))
+(anchor :step t23.t2.t22.t6 :args ((:= (veriT_vr7 E$) veriT_vr34) (:= (veriT_vr10 D$) veriT_vr35)))
+(step t23.t2.t22.t6.t1 (cl @p_342) :rule refl)
+(step t23.t2.t22.t6.t2 (cl @p_369) :rule cong :premises (t23.t2.t22.t6.t1))
+(step t23.t2.t22.t6.t3 (cl @p_357) :rule refl)
+(step t23.t2.t22.t6.t4 (cl @p_370) :rule cong :premises (t23.t2.t22.t6.t2 t23.t2.t22.t6.t3))
+(step t23.t2.t22.t6.t5 (cl (! (= veriT_vr7 veriT_vr34) :named @p_397)) :rule refl)
+(step t23.t2.t22.t6.t6 (cl (! (= veriT_vr10 veriT_vr35) :named @p_399)) :rule refl)
+(step t23.t2.t22.t6.t7 (cl (= @p_163 (! (pair$a veriT_vr34 veriT_vr35) :named @p_395))) :rule cong :premises (t23.t2.t22.t6.t5 t23.t2.t22.t6.t6))
+(step t23.t2.t22.t6.t8 (cl (= @p_210 (! (is_res$a @p_326 @p_395) :named @p_396))) :rule cong :premises (t23.t2.t22.t6.t4 t23.t2.t22.t6.t7))
+(step t23.t2.t22.t6.t9 (cl @p_397) :rule refl)
+(step t23.t2.t22.t6.t10 (cl @p_342) :rule refl)
+(step t23.t2.t22.t6.t11 (cl (= @p_130 (! (c$ veriT_vr34 veriT_vr20) :named @p_398))) :rule cong :premises (t23.t2.t22.t6.t9 t23.t2.t22.t6.t10))
+(step t23.t2.t22.t6.t12 (cl @p_399) :rule refl)
+(step t23.t2.t22.t6.t13 (cl (= @p_215 (! (run$b @p_398 veriT_vr35) :named @p_400))) :rule cong :premises (t23.t2.t22.t6.t11 t23.t2.t22.t6.t12))
+(step t23.t2.t22.t6.t14 (cl (! (= veriT_vr9 veriT_vr32) :named @p_411)) :rule refl)
+(step t23.t2.t22.t6.t15 (cl (! (= veriT_vr8 veriT_vr33) :named @p_412)) :rule refl)
+(step t23.t2.t22.t6.t16 (cl (! (= @p_100 (! (pair$b veriT_vr32 veriT_vr33) :named @p_329)) :named @p_413)) :rule cong :premises (t23.t2.t22.t6.t14 t23.t2.t22.t6.t15))
+(step t23.t2.t22.t6.t17 (cl (= @p_217 (! (is_res$b @p_400 @p_329) :named @p_401))) :rule cong :premises (t23.t2.t22.t6.t13 t23.t2.t22.t6.t16))
+(step t23.t2.t22.t6.t18 (cl (= @p_219 (! (and @p_396 @p_401) :named @p_402))) :rule cong :premises (t23.t2.t22.t6.t8 t23.t2.t22.t6.t17))
+(step t23.t2.t22.t6 (cl (= @p_208 (! (exists ((veriT_vr34 E$) (veriT_vr35 D$)) @p_402) :named @p_394))) :rule bind)
+(step t23.t2.t22.t7 (cl (= @p_221 (! (or @p_328 @p_394) :named @p_403))) :rule cong :premises (t23.t2.t22.t5 t23.t2.t22.t6))
+(step t23.t2.t22.t8 (cl @p_336) :rule refl)
+(step t23.t2.t22.t9 (cl @p_356) :rule cong :premises (t23.t2.t22.t8))
+(step t23.t2.t22.t10 (cl @p_357) :rule refl)
+(step t23.t2.t22.t11 (cl @p_358) :rule cong :premises (t23.t2.t22.t9 t23.t2.t22.t10))
+(step t23.t2.t22.t12 (cl @p_380) :rule cong :premises (t23.t2.t22.t11))
+(anchor :step t23.t2.t22.t13 :args ((:= (veriT_vr7 E$) veriT_vr36) (:= (veriT_vr10 D$) veriT_vr37)))
+(step t23.t2.t22.t13.t1 (cl @p_336) :rule refl)
+(step t23.t2.t22.t13.t2 (cl @p_356) :rule cong :premises (t23.t2.t22.t13.t1))
+(step t23.t2.t22.t13.t3 (cl @p_357) :rule refl)
+(step t23.t2.t22.t13.t4 (cl @p_358) :rule cong :premises (t23.t2.t22.t13.t2 t23.t2.t22.t13.t3))
+(step t23.t2.t22.t13.t5 (cl (! (= veriT_vr7 veriT_vr36) :named @p_407)) :rule refl)
+(step t23.t2.t22.t13.t6 (cl (! (= veriT_vr10 veriT_vr37) :named @p_409)) :rule refl)
+(step t23.t2.t22.t13.t7 (cl (= @p_163 (! (pair$a veriT_vr36 veriT_vr37) :named @p_405))) :rule cong :premises (t23.t2.t22.t13.t5 t23.t2.t22.t13.t6))
+(step t23.t2.t22.t13.t8 (cl (= @p_226 (! (is_res$a @p_325 @p_405) :named @p_406))) :rule cong :premises (t23.t2.t22.t13.t4 t23.t2.t22.t13.t7))
+(step t23.t2.t22.t13.t9 (cl @p_407) :rule refl)
+(step t23.t2.t22.t13.t10 (cl @p_336) :rule refl)
+(step t23.t2.t22.t13.t11 (cl (= @p_127 (! (c$ veriT_vr36 veriT_vr19) :named @p_408))) :rule cong :premises (t23.t2.t22.t13.t9 t23.t2.t22.t13.t10))
+(step t23.t2.t22.t13.t12 (cl @p_409) :rule refl)
+(step t23.t2.t22.t13.t13 (cl (= @p_229 (! (run$b @p_408 veriT_vr37) :named @p_410))) :rule cong :premises (t23.t2.t22.t13.t11 t23.t2.t22.t13.t12))
+(step t23.t2.t22.t13.t14 (cl @p_411) :rule refl)
+(step t23.t2.t22.t13.t15 (cl @p_412) :rule refl)
+(step t23.t2.t22.t13.t16 (cl @p_413) :rule cong :premises (t23.t2.t22.t13.t14 t23.t2.t22.t13.t15))
+(step t23.t2.t22.t13.t17 (cl (= @p_233 (! (is_res$b @p_410 @p_329) :named @p_414))) :rule cong :premises (t23.t2.t22.t13.t13 t23.t2.t22.t13.t16))
+(step t23.t2.t22.t13.t18 (cl (= @p_235 (! (and @p_406 @p_414) :named @p_415))) :rule cong :premises (t23.t2.t22.t13.t8 t23.t2.t22.t13.t17))
+(step t23.t2.t22.t13 (cl (= @p_223 (! (exists ((veriT_vr36 E$) (veriT_vr37 D$)) @p_415) :named @p_404))) :rule bind)
+(step t23.t2.t22.t14 (cl (= @p_237 (! (or @p_327 @p_404) :named @p_416))) :rule cong :premises (t23.t2.t22.t12 t23.t2.t22.t13))
+(step t23.t2.t22.t15 (cl (= @p_239 (! (= @p_403 @p_416) :named @p_417))) :rule cong :premises (t23.t2.t22.t7 t23.t2.t22.t14))
+(step t23.t2.t22 (cl (= @p_206 (! (forall ((veriT_vr32 F$) (veriT_vr33 D$)) @p_417) :named @p_392))) :rule bind)
+(step t23.t2.t23 (cl (= @p_241 (! (and @p_391 @p_392) :named @p_418))) :rule cong :premises (t23.t2.t21 t23.t2.t22))
+(step t23.t2.t24 (cl (= @p_262 (! (or @p_327 @p_355 @p_418) :named @p_419))) :rule cong :premises (t23.t2.t5 t23.t2.t6 t23.t2.t23))
+(step t23.t2 (cl (= @p_261 (! (forall ((veriT_vr25 D$)) @p_419) :named @p_353))) :rule bind)
+(step t23.t3 (cl (= @p_263 (! (=> @p_330 @p_353) :named @p_420))) :rule cong :premises (t23.t1 t23.t2))
+(step t23 (cl (= @p_265 (! (forall ((veriT_vr19 A_b_c_M_state_fun$) (veriT_vr20 A_b_c_M_state_fun$)) @p_420) :named @p_421))) :rule bind)
+(step t24 (cl (= @p_266 (! (not @p_421) :named @p_423))) :rule cong :premises (t23))
+(step t25 (cl (! (= @p_268 (! (and @p_159 @p_422 @p_423) :named @p_425)) :named @p_424)) :rule cong :premises (t22 t24))
+(step t26 (cl (not @p_424) (not @p_268) @p_425) :rule equiv_pos2)
+(step t27 (cl @p_425) :rule th_resolution :premises (t21 t25 t26))
+(anchor :step t28 :args ((veriT_vr19 A_b_c_M_state_fun$) (veriT_vr20 A_b_c_M_state_fun$)))
+(anchor :step t28.t1 :args ((veriT_vr25 D$)))
+(step t28.t1.t1 (cl (= @p_391 (! (and (! (=> @p_379 @p_390) :named @p_612) (! (=> @p_390 @p_379) :named @p_635)) :named @p_427))) :rule connective_def)
+(anchor :step t28.t1.t2 :args ((veriT_vr32 F$) (veriT_vr33 D$)))
+(step t28.t1.t2.t1 (cl (= @p_417 (! (and (! (=> @p_403 @p_416) :named @p_662) (! (=> @p_416 @p_403) :named @p_684)) :named @p_429))) :rule connective_def)
+(step t28.t1.t2 (cl (= @p_392 (! (forall ((veriT_vr32 F$) (veriT_vr33 D$)) @p_429) :named @p_428))) :rule bind)
+(step t28.t1.t3 (cl (= @p_418 (! (and @p_427 @p_428) :named @p_430))) :rule cong :premises (t28.t1.t1 t28.t1.t2))
+(step t28.t1.t4 (cl (= @p_419 (! (or @p_327 @p_355 @p_430) :named @p_431))) :rule cong :premises (t28.t1.t3))
+(step t28.t1 (cl (= @p_353 (! (forall ((veriT_vr25 D$)) @p_431) :named @p_426))) :rule bind)
+(step t28.t2 (cl (= @p_420 (! (=> @p_330 @p_426) :named @p_432))) :rule cong :premises (t28.t1))
+(step t28 (cl (= @p_421 (! (forall ((veriT_vr19 A_b_c_M_state_fun$) (veriT_vr20 A_b_c_M_state_fun$)) @p_432) :named @p_433))) :rule bind)
+(step t29 (cl (= @p_423 (! (not @p_433) :named @p_434))) :rule cong :premises (t28))
+(step t30 (cl (! (= @p_425 (! (and @p_159 @p_422 @p_434) :named @p_436)) :named @p_435)) :rule cong :premises (t29))
+(step t31 (cl (not @p_435) (not @p_425) @p_436) :rule equiv_pos2)
+(step t32 (cl @p_436) :rule th_resolution :premises (t27 t30 t31))
+(anchor :step t33 :args ((:= (veriT_vr0 A_b_c_M_state_fun$) veriT_vr38) (:= (veriT_vr1 A_b_c_M_state_fun$) veriT_vr39)))
+(anchor :step t33.t1 :args ((:= (veriT_vr2 A$) veriT_vr40) (:= (veriT_vr3 C$) veriT_vr41)))
+(step t33.t1.t1 (cl (! (= veriT_vr0 veriT_vr38) :named @p_451)) :rule refl)
+(step t33.t1.t2 (cl (! (= veriT_vr2 veriT_vr40) :named @p_447)) :rule refl)
+(step t33.t1.t3 (cl (! (= @p_35 (! (fun_app$ veriT_vr38 veriT_vr40) :named @p_446)) :named @p_452)) :rule cong :premises (t33.t1.t1 t33.t1.t2))
+(step t33.t1.t4 (cl (! (= veriT_vr3 veriT_vr41) :named @p_449)) :rule refl)
+(step t33.t1.t5 (cl (! (= @p_27 (! (run$ @p_446 veriT_vr41) :named @p_439)) :named @p_453)) :rule cong :premises (t33.t1.t3 t33.t1.t4))
+(step t33.t1.t6 (cl (! (= @p_25 (! (is_fail$ @p_439) :named @p_437)) :named @p_454)) :rule cong :premises (t33.t1.t5))
+(step t33.t1.t7 (cl (! (= veriT_vr1 veriT_vr39) :named @p_457)) :rule refl)
+(step t33.t1.t8 (cl @p_447) :rule refl)
+(step t33.t1.t9 (cl (! (= @p_38 (! (fun_app$ veriT_vr39 veriT_vr40) :named @p_448)) :named @p_458)) :rule cong :premises (t33.t1.t7 t33.t1.t8))
+(step t33.t1.t10 (cl @p_449) :rule refl)
+(step t33.t1.t11 (cl (! (= @p_26 (! (run$ @p_448 veriT_vr41) :named @p_438)) :named @p_459)) :rule cong :premises (t33.t1.t9 t33.t1.t10))
+(step t33.t1.t12 (cl (= @p_41 (! (is_fail$ @p_438) :named @p_450))) :rule cong :premises (t33.t1.t11))
+(step t33.t1.t13 (cl @p_451) :rule refl)
+(step t33.t1.t14 (cl @p_447) :rule refl)
+(step t33.t1.t15 (cl @p_452) :rule cong :premises (t33.t1.t13 t33.t1.t14))
+(step t33.t1.t16 (cl @p_449) :rule refl)
+(step t33.t1.t17 (cl @p_453) :rule cong :premises (t33.t1.t15 t33.t1.t16))
+(step t33.t1.t18 (cl @p_454) :rule cong :premises (t33.t1.t17))
+(step t33.t1.t19 (cl (= @p_47 (! (= @p_450 @p_437) :named @p_455))) :rule cong :premises (t33.t1.t12 t33.t1.t18))
+(anchor :step t33.t1.t20 :args ((:= (veriT_vr4 B$) veriT_vr42) (:= (veriT_vr5 C$) veriT_vr43)))
+(step t33.t1.t20.t1 (cl @p_457) :rule refl)
+(step t33.t1.t20.t2 (cl @p_447) :rule refl)
+(step t33.t1.t20.t3 (cl @p_458) :rule cong :premises (t33.t1.t20.t1 t33.t1.t20.t2))
+(step t33.t1.t20.t4 (cl @p_449) :rule refl)
+(step t33.t1.t20.t5 (cl @p_459) :rule cong :premises (t33.t1.t20.t3 t33.t1.t20.t4))
+(step t33.t1.t20.t6 (cl (! (= veriT_vr4 veriT_vr42) :named @p_461)) :rule refl)
+(step t33.t1.t20.t7 (cl (! (= veriT_vr5 veriT_vr43) :named @p_462)) :rule refl)
+(step t33.t1.t20.t8 (cl (! (= @p_28 (! (pair$ veriT_vr42 veriT_vr43) :named @p_440)) :named @p_463)) :rule cong :premises (t33.t1.t20.t6 t33.t1.t20.t7))
+(step t33.t1.t20.t9 (cl (= @p_54 (! (is_res$ @p_438 @p_440) :named @p_460))) :rule cong :premises (t33.t1.t20.t5 t33.t1.t20.t8))
+(step t33.t1.t20.t10 (cl @p_451) :rule refl)
+(step t33.t1.t20.t11 (cl @p_447) :rule refl)
+(step t33.t1.t20.t12 (cl @p_452) :rule cong :premises (t33.t1.t20.t10 t33.t1.t20.t11))
+(step t33.t1.t20.t13 (cl @p_449) :rule refl)
+(step t33.t1.t20.t14 (cl @p_453) :rule cong :premises (t33.t1.t20.t12 t33.t1.t20.t13))
+(step t33.t1.t20.t15 (cl @p_461) :rule refl)
+(step t33.t1.t20.t16 (cl @p_462) :rule refl)
+(step t33.t1.t20.t17 (cl @p_463) :rule cong :premises (t33.t1.t20.t15 t33.t1.t20.t16))
+(step t33.t1.t20.t18 (cl (= @p_59 (! (is_res$ @p_439 @p_440) :named @p_464))) :rule cong :premises (t33.t1.t20.t14 t33.t1.t20.t17))
+(step t33.t1.t20.t19 (cl (= @p_61 (! (= @p_460 @p_464) :named @p_465))) :rule cong :premises (t33.t1.t20.t9 t33.t1.t20.t18))
+(step t33.t1.t20 (cl (= @p_49 (! (forall ((veriT_vr42 B$) (veriT_vr43 C$)) @p_465) :named @p_456))) :rule bind)
+(step t33.t1.t21 (cl (= @p_63 (! (and @p_455 @p_456) :named @p_466))) :rule cong :premises (t33.t1.t19 t33.t1.t20))
+(step t33.t1.t22 (cl (= @p_65 (! (or @p_437 @p_466) :named @p_467))) :rule cong :premises (t33.t1.t6 t33.t1.t21))
+(step t33.t1 (cl (= @p_33 (! (forall ((veriT_vr40 A$) (veriT_vr41 C$)) @p_467) :named @p_445))) :rule bind)
+(anchor :step t33.t2 :args ((:= (veriT_vr6 D$) veriT_vr44)))
+(step t33.t2.t1 (cl @p_451) :rule refl)
+(step t33.t2.t2 (cl (! (= @p_69 (! (b$ veriT_vr38) :named @p_469)) :named @p_473)) :rule cong :premises (t33.t2.t1))
+(step t33.t2.t3 (cl (! (= veriT_vr6 veriT_vr44) :named @p_471)) :rule refl)
+(step t33.t2.t4 (cl (! (= @p_31 (! (run$a @p_469 veriT_vr44) :named @p_443)) :named @p_474)) :rule cong :premises (t33.t2.t2 t33.t2.t3))
+(step t33.t2.t5 (cl (! (= @p_29 (! (is_fail$a @p_443) :named @p_441)) :named @p_475)) :rule cong :premises (t33.t2.t4))
+(step t33.t2.t6 (cl @p_457) :rule refl)
+(step t33.t2.t7 (cl (! (= @p_71 (! (b$ veriT_vr39) :named @p_470)) :named @p_478)) :rule cong :premises (t33.t2.t6))
+(step t33.t2.t8 (cl @p_471) :rule refl)
+(step t33.t2.t9 (cl (! (= @p_30 (! (run$a @p_470 veriT_vr44) :named @p_442)) :named @p_479)) :rule cong :premises (t33.t2.t7 t33.t2.t8))
+(step t33.t2.t10 (cl (= @p_73 (! (is_fail$a @p_442) :named @p_472))) :rule cong :premises (t33.t2.t9))
+(step t33.t2.t11 (cl @p_451) :rule refl)
+(step t33.t2.t12 (cl @p_473) :rule cong :premises (t33.t2.t11))
+(step t33.t2.t13 (cl @p_471) :rule refl)
+(step t33.t2.t14 (cl @p_474) :rule cong :premises (t33.t2.t12 t33.t2.t13))
+(step t33.t2.t15 (cl @p_475) :rule cong :premises (t33.t2.t14))
+(step t33.t2.t16 (cl (= @p_78 (! (= @p_472 @p_441) :named @p_476))) :rule cong :premises (t33.t2.t10 t33.t2.t15))
+(anchor :step t33.t2.t17 :args ((:= (veriT_vr7 E$) veriT_vr45) (:= (veriT_vr8 D$) veriT_vr46)))
+(step t33.t2.t17.t1 (cl @p_457) :rule refl)
+(step t33.t2.t17.t2 (cl @p_478) :rule cong :premises (t33.t2.t17.t1))
+(step t33.t2.t17.t3 (cl @p_471) :rule refl)
+(step t33.t2.t17.t4 (cl @p_479) :rule cong :premises (t33.t2.t17.t2 t33.t2.t17.t3))
+(step t33.t2.t17.t5 (cl (! (= veriT_vr7 veriT_vr45) :named @p_481)) :rule refl)
+(step t33.t2.t17.t6 (cl (! (= veriT_vr8 veriT_vr46) :named @p_482)) :rule refl)
+(step t33.t2.t17.t7 (cl (! (= @p_32 (! (pair$a veriT_vr45 veriT_vr46) :named @p_444)) :named @p_483)) :rule cong :premises (t33.t2.t17.t5 t33.t2.t17.t6))
+(step t33.t2.t17.t8 (cl (= @p_83 (! (is_res$a @p_442 @p_444) :named @p_480))) :rule cong :premises (t33.t2.t17.t4 t33.t2.t17.t7))
+(step t33.t2.t17.t9 (cl @p_451) :rule refl)
+(step t33.t2.t17.t10 (cl @p_473) :rule cong :premises (t33.t2.t17.t9))
+(step t33.t2.t17.t11 (cl @p_471) :rule refl)
+(step t33.t2.t17.t12 (cl @p_474) :rule cong :premises (t33.t2.t17.t10 t33.t2.t17.t11))
+(step t33.t2.t17.t13 (cl @p_481) :rule refl)
+(step t33.t2.t17.t14 (cl @p_482) :rule refl)
+(step t33.t2.t17.t15 (cl @p_483) :rule cong :premises (t33.t2.t17.t13 t33.t2.t17.t14))
+(step t33.t2.t17.t16 (cl (= @p_87 (! (is_res$a @p_443 @p_444) :named @p_484))) :rule cong :premises (t33.t2.t17.t12 t33.t2.t17.t15))
+(step t33.t2.t17.t17 (cl (= @p_89 (! (= @p_480 @p_484) :named @p_485))) :rule cong :premises (t33.t2.t17.t8 t33.t2.t17.t16))
+(step t33.t2.t17 (cl (= @p_80 (! (forall ((veriT_vr45 E$) (veriT_vr46 D$)) @p_485) :named @p_477))) :rule bind)
+(step t33.t2.t18 (cl (= @p_91 (! (and @p_476 @p_477) :named @p_486))) :rule cong :premises (t33.t2.t16 t33.t2.t17))
+(step t33.t2.t19 (cl (= @p_93 (! (or @p_441 @p_486) :named @p_487))) :rule cong :premises (t33.t2.t5 t33.t2.t18))
+(step t33.t2 (cl (= @p_67 (! (forall ((veriT_vr44 D$)) @p_487) :named @p_468))) :rule bind)
+(step t33.t3 (cl (= @p_95 (! (=> @p_445 @p_468) :named @p_488))) :rule cong :premises (t33.t1 t33.t2))
+(step t33 (cl (= @p_159 (! (forall ((veriT_vr38 A_b_c_M_state_fun$) (veriT_vr39 A_b_c_M_state_fun$)) @p_488) :named @p_691))) :rule bind)
+(anchor :step t34 :args ((:= (veriT_vr11 E$) veriT_vr47) (:= (veriT_vr12 A_b_c_M_state_fun$) veriT_vr48) (:= (veriT_vr13 A_b_c_M_state_fun$) veriT_vr49)))
+(anchor :step t34.t1 :args ((:= (veriT_vr14 A$) veriT_vr50) (:= (veriT_vr15 C$) veriT_vr51)))
+(step t34.t1.t1 (cl (! (= veriT_vr12 veriT_vr48) :named @p_503)) :rule refl)
+(step t34.t1.t2 (cl (! (= veriT_vr14 veriT_vr50) :named @p_499)) :rule refl)
+(step t34.t1.t3 (cl (! (= @p_278 (! (fun_app$ veriT_vr48 veriT_vr50) :named @p_498)) :named @p_504)) :rule cong :premises (t34.t1.t1 t34.t1.t2))
+(step t34.t1.t4 (cl (! (= veriT_vr15 veriT_vr51) :named @p_501)) :rule refl)
+(step t34.t1.t5 (cl (! (= @p_271 (! (run$ @p_498 veriT_vr51) :named @p_491)) :named @p_505)) :rule cong :premises (t34.t1.t3 t34.t1.t4))
+(step t34.t1.t6 (cl (! (= @p_269 (! (is_fail$ @p_491) :named @p_489)) :named @p_506)) :rule cong :premises (t34.t1.t5))
+(step t34.t1.t7 (cl (! (= veriT_vr13 veriT_vr49) :named @p_509)) :rule refl)
+(step t34.t1.t8 (cl @p_499) :rule refl)
+(step t34.t1.t9 (cl (! (= @p_280 (! (fun_app$ veriT_vr49 veriT_vr50) :named @p_500)) :named @p_510)) :rule cong :premises (t34.t1.t7 t34.t1.t8))
+(step t34.t1.t10 (cl @p_501) :rule refl)
+(step t34.t1.t11 (cl (! (= @p_270 (! (run$ @p_500 veriT_vr51) :named @p_490)) :named @p_511)) :rule cong :premises (t34.t1.t9 t34.t1.t10))
+(step t34.t1.t12 (cl (= @p_282 (! (is_fail$ @p_490) :named @p_502))) :rule cong :premises (t34.t1.t11))
+(step t34.t1.t13 (cl @p_503) :rule refl)
+(step t34.t1.t14 (cl @p_499) :rule refl)
+(step t34.t1.t15 (cl @p_504) :rule cong :premises (t34.t1.t13 t34.t1.t14))
+(step t34.t1.t16 (cl @p_501) :rule refl)
+(step t34.t1.t17 (cl @p_505) :rule cong :premises (t34.t1.t15 t34.t1.t16))
+(step t34.t1.t18 (cl @p_506) :rule cong :premises (t34.t1.t17))
+(step t34.t1.t19 (cl (= @p_287 (! (= @p_502 @p_489) :named @p_507))) :rule cong :premises (t34.t1.t12 t34.t1.t18))
+(anchor :step t34.t1.t20 :args ((:= (veriT_vr16 B$) veriT_vr52) (:= (veriT_vr17 C$) veriT_vr53)))
+(step t34.t1.t20.t1 (cl @p_509) :rule refl)
+(step t34.t1.t20.t2 (cl @p_499) :rule refl)
+(step t34.t1.t20.t3 (cl @p_510) :rule cong :premises (t34.t1.t20.t1 t34.t1.t20.t2))
+(step t34.t1.t20.t4 (cl @p_501) :rule refl)
+(step t34.t1.t20.t5 (cl @p_511) :rule cong :premises (t34.t1.t20.t3 t34.t1.t20.t4))
+(step t34.t1.t20.t6 (cl (! (= veriT_vr16 veriT_vr52) :named @p_513)) :rule refl)
+(step t34.t1.t20.t7 (cl (! (= veriT_vr17 veriT_vr53) :named @p_514)) :rule refl)
+(step t34.t1.t20.t8 (cl (! (= @p_272 (! (pair$ veriT_vr52 veriT_vr53) :named @p_492)) :named @p_515)) :rule cong :premises (t34.t1.t20.t6 t34.t1.t20.t7))
+(step t34.t1.t20.t9 (cl (= @p_292 (! (is_res$ @p_490 @p_492) :named @p_512))) :rule cong :premises (t34.t1.t20.t5 t34.t1.t20.t8))
+(step t34.t1.t20.t10 (cl @p_503) :rule refl)
+(step t34.t1.t20.t11 (cl @p_499) :rule refl)
+(step t34.t1.t20.t12 (cl @p_504) :rule cong :premises (t34.t1.t20.t10 t34.t1.t20.t11))
+(step t34.t1.t20.t13 (cl @p_501) :rule refl)
+(step t34.t1.t20.t14 (cl @p_505) :rule cong :premises (t34.t1.t20.t12 t34.t1.t20.t13))
+(step t34.t1.t20.t15 (cl @p_513) :rule refl)
+(step t34.t1.t20.t16 (cl @p_514) :rule refl)
+(step t34.t1.t20.t17 (cl @p_515) :rule cong :premises (t34.t1.t20.t15 t34.t1.t20.t16))
+(step t34.t1.t20.t18 (cl (= @p_296 (! (is_res$ @p_491 @p_492) :named @p_516))) :rule cong :premises (t34.t1.t20.t14 t34.t1.t20.t17))
+(step t34.t1.t20.t19 (cl (= @p_297 (! (= @p_512 @p_516) :named @p_517))) :rule cong :premises (t34.t1.t20.t9 t34.t1.t20.t18))
+(step t34.t1.t20 (cl (= @p_288 (! (forall ((veriT_vr52 B$) (veriT_vr53 C$)) @p_517) :named @p_508))) :rule bind)
+(step t34.t1.t21 (cl (= @p_298 (! (and @p_507 @p_508) :named @p_518))) :rule cong :premises (t34.t1.t19 t34.t1.t20))
+(step t34.t1.t22 (cl (= @p_299 (! (or @p_489 @p_518) :named @p_519))) :rule cong :premises (t34.t1.t6 t34.t1.t21))
+(step t34.t1 (cl (= @p_277 (! (forall ((veriT_vr50 A$) (veriT_vr51 C$)) @p_519) :named @p_497))) :rule bind)
+(anchor :step t34.t2 :args ((:= (veriT_vr10 D$) veriT_vr54)))
+(step t34.t2.t1 (cl (! (= veriT_vr11 veriT_vr47) :named @p_522)) :rule refl)
+(step t34.t2.t2 (cl @p_503) :rule refl)
+(step t34.t2.t3 (cl (! (= @p_301 (! (c$ veriT_vr47 veriT_vr48) :named @p_521)) :named @p_526)) :rule cong :premises (t34.t2.t1 t34.t2.t2))
+(step t34.t2.t4 (cl (! (= veriT_vr10 veriT_vr54) :named @p_524)) :rule refl)
+(step t34.t2.t5 (cl (! (= @p_275 (! (run$b @p_521 veriT_vr54) :named @p_495)) :named @p_527)) :rule cong :premises (t34.t2.t3 t34.t2.t4))
+(step t34.t2.t6 (cl (! (= @p_273 (! (is_fail$b @p_495) :named @p_493)) :named @p_528)) :rule cong :premises (t34.t2.t5))
+(step t34.t2.t7 (cl @p_522) :rule refl)
+(step t34.t2.t8 (cl @p_509) :rule refl)
+(step t34.t2.t9 (cl (! (= @p_303 (! (c$ veriT_vr47 veriT_vr49) :named @p_523)) :named @p_531)) :rule cong :premises (t34.t2.t7 t34.t2.t8))
+(step t34.t2.t10 (cl @p_524) :rule refl)
+(step t34.t2.t11 (cl (! (= @p_274 (! (run$b @p_523 veriT_vr54) :named @p_494)) :named @p_532)) :rule cong :premises (t34.t2.t9 t34.t2.t10))
+(step t34.t2.t12 (cl (= @p_305 (! (is_fail$b @p_494) :named @p_525))) :rule cong :premises (t34.t2.t11))
+(step t34.t2.t13 (cl @p_522) :rule refl)
+(step t34.t2.t14 (cl @p_503) :rule refl)
+(step t34.t2.t15 (cl @p_526) :rule cong :premises (t34.t2.t13 t34.t2.t14))
+(step t34.t2.t16 (cl @p_524) :rule refl)
+(step t34.t2.t17 (cl @p_527) :rule cong :premises (t34.t2.t15 t34.t2.t16))
+(step t34.t2.t18 (cl @p_528) :rule cong :premises (t34.t2.t17))
+(step t34.t2.t19 (cl (= @p_309 (! (= @p_525 @p_493) :named @p_529))) :rule cong :premises (t34.t2.t12 t34.t2.t18))
+(anchor :step t34.t2.t20 :args ((:= (veriT_vr9 F$) veriT_vr55) (:= (veriT_vr18 D$) veriT_vr56)))
+(step t34.t2.t20.t1 (cl @p_522) :rule refl)
+(step t34.t2.t20.t2 (cl @p_509) :rule refl)
+(step t34.t2.t20.t3 (cl @p_531) :rule cong :premises (t34.t2.t20.t1 t34.t2.t20.t2))
+(step t34.t2.t20.t4 (cl @p_524) :rule refl)
+(step t34.t2.t20.t5 (cl @p_532) :rule cong :premises (t34.t2.t20.t3 t34.t2.t20.t4))
+(step t34.t2.t20.t6 (cl (! (= veriT_vr9 veriT_vr55) :named @p_534)) :rule refl)
+(step t34.t2.t20.t7 (cl (! (= veriT_vr18 veriT_vr56) :named @p_535)) :rule refl)
+(step t34.t2.t20.t8 (cl (! (= @p_276 (! (pair$b veriT_vr55 veriT_vr56) :named @p_496)) :named @p_536)) :rule cong :premises (t34.t2.t20.t6 t34.t2.t20.t7))
+(step t34.t2.t20.t9 (cl (= @p_313 (! (is_res$b @p_494 @p_496) :named @p_533))) :rule cong :premises (t34.t2.t20.t5 t34.t2.t20.t8))
+(step t34.t2.t20.t10 (cl @p_522) :rule refl)
+(step t34.t2.t20.t11 (cl @p_503) :rule refl)
+(step t34.t2.t20.t12 (cl @p_526) :rule cong :premises (t34.t2.t20.t10 t34.t2.t20.t11))
+(step t34.t2.t20.t13 (cl @p_524) :rule refl)
+(step t34.t2.t20.t14 (cl @p_527) :rule cong :premises (t34.t2.t20.t12 t34.t2.t20.t13))
+(step t34.t2.t20.t15 (cl @p_534) :rule refl)
+(step t34.t2.t20.t16 (cl @p_535) :rule refl)
+(step t34.t2.t20.t17 (cl @p_536) :rule cong :premises (t34.t2.t20.t15 t34.t2.t20.t16))
+(step t34.t2.t20.t18 (cl (= @p_316 (! (is_res$b @p_495 @p_496) :named @p_537))) :rule cong :premises (t34.t2.t20.t14 t34.t2.t20.t17))
+(step t34.t2.t20.t19 (cl (= @p_317 (! (= @p_533 @p_537) :named @p_538))) :rule cong :premises (t34.t2.t20.t9 t34.t2.t20.t18))
+(step t34.t2.t20 (cl (= @p_310 (! (forall ((veriT_vr55 F$) (veriT_vr56 D$)) @p_538) :named @p_530))) :rule bind)
+(step t34.t2.t21 (cl (= @p_318 (! (and @p_529 @p_530) :named @p_539))) :rule cong :premises (t34.t2.t19 t34.t2.t20))
+(step t34.t2.t22 (cl (= @p_319 (! (or @p_493 @p_539) :named @p_540))) :rule cong :premises (t34.t2.t6 t34.t2.t21))
+(step t34.t2 (cl (= @p_300 (! (forall ((veriT_vr54 D$)) @p_540) :named @p_520))) :rule bind)
+(step t34.t3 (cl (= @p_320 (! (=> @p_497 @p_520) :named @p_541))) :rule cong :premises (t34.t1 t34.t2))
+(step t34 (cl (= @p_422 (! (forall ((veriT_vr47 E$) (veriT_vr48 A_b_c_M_state_fun$) (veriT_vr49 A_b_c_M_state_fun$)) @p_541) :named @p_692))) :rule bind)
+(anchor :step t35 :args ((:= (veriT_vr19 A_b_c_M_state_fun$) veriT_vr57) (:= (veriT_vr20 A_b_c_M_state_fun$) veriT_vr58)))
+(anchor :step t35.t1 :args ((:= (veriT_vr21 A$) veriT_vr59) (:= (veriT_vr22 C$) veriT_vr60)))
+(step t35.t1.t1 (cl (! (= veriT_vr19 veriT_vr57) :named @p_557)) :rule refl)
+(step t35.t1.t2 (cl (! (= veriT_vr21 veriT_vr59) :named @p_553)) :rule refl)
+(step t35.t1.t3 (cl (! (= @p_331 @p_552) :named @p_558)) :rule cong :premises (t35.t1.t1 t35.t1.t2))
+(step t35.t1.t4 (cl (! (= veriT_vr22 veriT_vr60) :named @p_555)) :rule refl)
+(step t35.t1.t5 (cl (! (= @p_323 @p_544) :named @p_559)) :rule cong :premises (t35.t1.t3 t35.t1.t4))
+(step t35.t1.t6 (cl (! (= @p_321 @p_542) :named @p_560)) :rule cong :premises (t35.t1.t5))
+(step t35.t1.t7 (cl (! (= veriT_vr20 veriT_vr58) :named @p_563)) :rule refl)
+(step t35.t1.t8 (cl @p_553) :rule refl)
+(step t35.t1.t9 (cl (! (= @p_333 @p_554) :named @p_564)) :rule cong :premises (t35.t1.t7 t35.t1.t8))
+(step t35.t1.t10 (cl @p_555) :rule refl)
+(step t35.t1.t11 (cl (! (= @p_322 @p_543) :named @p_565)) :rule cong :premises (t35.t1.t9 t35.t1.t10))
+(step t35.t1.t12 (cl (= @p_335 @p_556)) :rule cong :premises (t35.t1.t11))
+(step t35.t1.t13 (cl @p_557) :rule refl)
+(step t35.t1.t14 (cl @p_553) :rule refl)
+(step t35.t1.t15 (cl @p_558) :rule cong :premises (t35.t1.t13 t35.t1.t14))
+(step t35.t1.t16 (cl @p_555) :rule refl)
+(step t35.t1.t17 (cl @p_559) :rule cong :premises (t35.t1.t15 t35.t1.t16))
+(step t35.t1.t18 (cl @p_560) :rule cong :premises (t35.t1.t17))
+(step t35.t1.t19 (cl (= @p_340 @p_561)) :rule cong :premises (t35.t1.t12 t35.t1.t18))
+(anchor :step t35.t1.t20 :args ((:= (veriT_vr23 B$) veriT_vr61) (:= (veriT_vr24 C$) veriT_vr62)))
+(step t35.t1.t20.t1 (cl @p_563) :rule refl)
+(step t35.t1.t20.t2 (cl @p_553) :rule refl)
+(step t35.t1.t20.t3 (cl @p_564) :rule cong :premises (t35.t1.t20.t1 t35.t1.t20.t2))
+(step t35.t1.t20.t4 (cl @p_555) :rule refl)
+(step t35.t1.t20.t5 (cl @p_565) :rule cong :premises (t35.t1.t20.t3 t35.t1.t20.t4))
+(step t35.t1.t20.t6 (cl (! (= veriT_vr23 veriT_vr61) :named @p_567)) :rule refl)
+(step t35.t1.t20.t7 (cl (! (= veriT_vr24 veriT_vr62) :named @p_568)) :rule refl)
+(step t35.t1.t20.t8 (cl (! (= @p_324 @p_545) :named @p_569)) :rule cong :premises (t35.t1.t20.t6 t35.t1.t20.t7))
+(step t35.t1.t20.t9 (cl (= @p_345 @p_566)) :rule cong :premises (t35.t1.t20.t5 t35.t1.t20.t8))
+(step t35.t1.t20.t10 (cl @p_557) :rule refl)
+(step t35.t1.t20.t11 (cl @p_553) :rule refl)
+(step t35.t1.t20.t12 (cl @p_558) :rule cong :premises (t35.t1.t20.t10 t35.t1.t20.t11))
+(step t35.t1.t20.t13 (cl @p_555) :rule refl)
+(step t35.t1.t20.t14 (cl @p_559) :rule cong :premises (t35.t1.t20.t12 t35.t1.t20.t13))
+(step t35.t1.t20.t15 (cl @p_567) :rule refl)
+(step t35.t1.t20.t16 (cl @p_568) :rule refl)
+(step t35.t1.t20.t17 (cl @p_569) :rule cong :premises (t35.t1.t20.t15 t35.t1.t20.t16))
+(step t35.t1.t20.t18 (cl (= @p_349 @p_570)) :rule cong :premises (t35.t1.t20.t14 t35.t1.t20.t17))
+(step t35.t1.t20.t19 (cl (= @p_350 @p_571)) :rule cong :premises (t35.t1.t20.t9 t35.t1.t20.t18))
+(step t35.t1.t20 (cl (= @p_341 @p_562)) :rule bind)
+(step t35.t1.t21 (cl (= @p_351 @p_572)) :rule cong :premises (t35.t1.t19 t35.t1.t20))
+(step t35.t1.t22 (cl (= @p_352 @p_573)) :rule cong :premises (t35.t1.t6 t35.t1.t21))
+(step t35.t1 (cl (= @p_330 @p_551)) :rule bind)
+(anchor :step t35.t2 :args ((:= (veriT_vr25 D$) veriT_vr63)))
+(step t35.t2.t1 (cl @p_557) :rule refl)
+(step t35.t2.t2 (cl (! (= @p_354 @p_575) :named @p_577)) :rule cong :premises (t35.t2.t1))
+(step t35.t2.t3 (cl (! (= veriT_vr25 veriT_vr63) :named @p_578)) :rule refl)
+(step t35.t2.t4 (cl (! (= @p_325 @p_546) :named @p_579)) :rule cong :premises (t35.t2.t2 t35.t2.t3))
+(step t35.t2.t5 (cl (! (= @p_327 @p_548) :named @p_601)) :rule cong :premises (t35.t2.t4))
+(anchor :step t35.t2.t6 :args ((:= (veriT_vr26 E$) veriT_vr64) (:= (veriT_vr27 D$) veriT_vr65)))
+(step t35.t2.t6.t1 (cl @p_557) :rule refl)
+(step t35.t2.t6.t2 (cl @p_577) :rule cong :premises (t35.t2.t6.t1))
+(step t35.t2.t6.t3 (cl @p_578) :rule refl)
+(step t35.t2.t6.t4 (cl @p_579) :rule cong :premises (t35.t2.t6.t2 t35.t2.t6.t3))
+(step t35.t2.t6.t5 (cl (! (= veriT_vr26 veriT_vr64) :named @p_582)) :rule refl)
+(step t35.t2.t6.t6 (cl (! (= veriT_vr27 veriT_vr65) :named @p_584)) :rule refl)
+(step t35.t2.t6.t7 (cl (= @p_359 @p_580)) :rule cong :premises (t35.t2.t6.t5 t35.t2.t6.t6))
+(step t35.t2.t6.t8 (cl (= @p_360 @p_581)) :rule cong :premises (t35.t2.t6.t4 t35.t2.t6.t7))
+(step t35.t2.t6.t9 (cl @p_582) :rule refl)
+(step t35.t2.t6.t10 (cl @p_557) :rule refl)
+(step t35.t2.t6.t11 (cl (= @p_362 @p_583)) :rule cong :premises (t35.t2.t6.t9 t35.t2.t6.t10))
+(step t35.t2.t6.t12 (cl @p_584) :rule refl)
+(step t35.t2.t6.t13 (cl (= @p_364 @p_585)) :rule cong :premises (t35.t2.t6.t11 t35.t2.t6.t12))
+(step t35.t2.t6.t14 (cl (= @p_365 @p_586)) :rule cong :premises (t35.t2.t6.t13))
+(step t35.t2.t6.t15 (cl (= @p_366 @p_587)) :rule cong :premises (t35.t2.t6.t8 t35.t2.t6.t14))
+(step t35.t2.t6 (cl (= @p_355 @p_576)) :rule bind)
+(step t35.t2.t7 (cl @p_563) :rule refl)
+(step t35.t2.t8 (cl (! (= @p_367 @p_588) :named @p_590)) :rule cong :premises (t35.t2.t7))
+(step t35.t2.t9 (cl @p_578) :rule refl)
+(step t35.t2.t10 (cl (! (= @p_326 @p_547) :named @p_591)) :rule cong :premises (t35.t2.t8 t35.t2.t9))
+(step t35.t2.t11 (cl (! (= @p_328 @p_549) :named @p_624)) :rule cong :premises (t35.t2.t10))
+(anchor :step t35.t2.t12 :args ((:= (veriT_vr28 E$) veriT_vr66) (:= (veriT_vr29 D$) veriT_vr67)))
+(step t35.t2.t12.t1 (cl @p_563) :rule refl)
+(step t35.t2.t12.t2 (cl @p_590) :rule cong :premises (t35.t2.t12.t1))
+(step t35.t2.t12.t3 (cl @p_578) :rule refl)
+(step t35.t2.t12.t4 (cl @p_591) :rule cong :premises (t35.t2.t12.t2 t35.t2.t12.t3))
+(step t35.t2.t12.t5 (cl (! (= veriT_vr28 veriT_vr66) :named @p_594)) :rule refl)
+(step t35.t2.t12.t6 (cl (! (= veriT_vr29 veriT_vr67) :named @p_596)) :rule refl)
+(step t35.t2.t12.t7 (cl (= @p_371 @p_592)) :rule cong :premises (t35.t2.t12.t5 t35.t2.t12.t6))
+(step t35.t2.t12.t8 (cl (= @p_372 @p_593)) :rule cong :premises (t35.t2.t12.t4 t35.t2.t12.t7))
+(step t35.t2.t12.t9 (cl @p_594) :rule refl)
+(step t35.t2.t12.t10 (cl @p_563) :rule refl)
+(step t35.t2.t12.t11 (cl (= @p_374 @p_595)) :rule cong :premises (t35.t2.t12.t9 t35.t2.t12.t10))
+(step t35.t2.t12.t12 (cl @p_596) :rule refl)
+(step t35.t2.t12.t13 (cl (= @p_376 @p_597)) :rule cong :premises (t35.t2.t12.t11 t35.t2.t12.t12))
+(step t35.t2.t12.t14 (cl (= @p_377 @p_598)) :rule cong :premises (t35.t2.t12.t13))
+(step t35.t2.t12.t15 (cl (= @p_378 @p_599)) :rule cong :premises (t35.t2.t12.t8 t35.t2.t12.t14))
+(step t35.t2.t12 (cl (= @p_368 @p_589)) :rule bind)
+(step t35.t2.t13 (cl (= @p_379 @p_600)) :rule cong :premises (t35.t2.t11 t35.t2.t12))
+(step t35.t2.t14 (cl @p_557) :rule refl)
+(step t35.t2.t15 (cl @p_577) :rule cong :premises (t35.t2.t14))
+(step t35.t2.t16 (cl @p_578) :rule refl)
+(step t35.t2.t17 (cl @p_579) :rule cong :premises (t35.t2.t15 t35.t2.t16))
+(step t35.t2.t18 (cl @p_601) :rule cong :premises (t35.t2.t17))
+(anchor :step t35.t2.t19 :args ((:= (veriT_vr30 E$) veriT_vr68) (:= (veriT_vr31 D$) veriT_vr69)))
+(step t35.t2.t19.t1 (cl @p_557) :rule refl)
+(step t35.t2.t19.t2 (cl @p_577) :rule cong :premises (t35.t2.t19.t1))
+(step t35.t2.t19.t3 (cl @p_578) :rule refl)
+(step t35.t2.t19.t4 (cl @p_579) :rule cong :premises (t35.t2.t19.t2 t35.t2.t19.t3))
+(step t35.t2.t19.t5 (cl (! (= veriT_vr30 veriT_vr68) :named @p_605)) :rule refl)
+(step t35.t2.t19.t6 (cl (! (= veriT_vr31 veriT_vr69) :named @p_607)) :rule refl)
+(step t35.t2.t19.t7 (cl (= @p_382 @p_603)) :rule cong :premises (t35.t2.t19.t5 t35.t2.t19.t6))
+(step t35.t2.t19.t8 (cl (= @p_383 @p_604)) :rule cong :premises (t35.t2.t19.t4 t35.t2.t19.t7))
+(step t35.t2.t19.t9 (cl @p_605) :rule refl)
+(step t35.t2.t19.t10 (cl @p_557) :rule refl)
+(step t35.t2.t19.t11 (cl (= @p_385 @p_606)) :rule cong :premises (t35.t2.t19.t9 t35.t2.t19.t10))
+(step t35.t2.t19.t12 (cl @p_607) :rule refl)
+(step t35.t2.t19.t13 (cl (= @p_387 @p_608)) :rule cong :premises (t35.t2.t19.t11 t35.t2.t19.t12))
+(step t35.t2.t19.t14 (cl (= @p_388 @p_609)) :rule cong :premises (t35.t2.t19.t13))
+(step t35.t2.t19.t15 (cl (= @p_389 @p_610)) :rule cong :premises (t35.t2.t19.t8 t35.t2.t19.t14))
+(step t35.t2.t19 (cl (= @p_381 @p_602)) :rule bind)
+(step t35.t2.t20 (cl (= @p_390 @p_611)) :rule cong :premises (t35.t2.t18 t35.t2.t19))
+(step t35.t2.t21 (cl (= @p_612 @p_613)) :rule cong :premises (t35.t2.t13 t35.t2.t20))
+(step t35.t2.t22 (cl @p_557) :rule refl)
+(step t35.t2.t23 (cl @p_577) :rule cong :premises (t35.t2.t22))
+(step t35.t2.t24 (cl @p_578) :rule refl)
+(step t35.t2.t25 (cl @p_579) :rule cong :premises (t35.t2.t23 t35.t2.t24))
+(step t35.t2.t26 (cl @p_601) :rule cong :premises (t35.t2.t25))
+(anchor :step t35.t2.t27 :args ((:= (veriT_vr30 E$) veriT_vr70) (:= (veriT_vr31 D$) veriT_vr71)))
+(step t35.t2.t27.t1 (cl @p_557) :rule refl)
+(step t35.t2.t27.t2 (cl @p_577) :rule cong :premises (t35.t2.t27.t1))
+(step t35.t2.t27.t3 (cl @p_578) :rule refl)
+(step t35.t2.t27.t4 (cl @p_579) :rule cong :premises (t35.t2.t27.t2 t35.t2.t27.t3))
+(step t35.t2.t27.t5 (cl (! (= veriT_vr30 veriT_vr70) :named @p_617)) :rule refl)
+(step t35.t2.t27.t6 (cl (! (= veriT_vr31 veriT_vr71) :named @p_619)) :rule refl)
+(step t35.t2.t27.t7 (cl (= @p_382 @p_615)) :rule cong :premises (t35.t2.t27.t5 t35.t2.t27.t6))
+(step t35.t2.t27.t8 (cl (= @p_383 @p_616)) :rule cong :premises (t35.t2.t27.t4 t35.t2.t27.t7))
+(step t35.t2.t27.t9 (cl @p_617) :rule refl)
+(step t35.t2.t27.t10 (cl @p_557) :rule refl)
+(step t35.t2.t27.t11 (cl (= @p_385 @p_618)) :rule cong :premises (t35.t2.t27.t9 t35.t2.t27.t10))
+(step t35.t2.t27.t12 (cl @p_619) :rule refl)
+(step t35.t2.t27.t13 (cl (= @p_387 @p_620)) :rule cong :premises (t35.t2.t27.t11 t35.t2.t27.t12))
+(step t35.t2.t27.t14 (cl (= @p_388 @p_621)) :rule cong :premises (t35.t2.t27.t13))
+(step t35.t2.t27.t15 (cl (= @p_389 @p_622)) :rule cong :premises (t35.t2.t27.t8 t35.t2.t27.t14))
+(step t35.t2.t27 (cl (= @p_381 @p_614)) :rule bind)
+(step t35.t2.t28 (cl (= @p_390 @p_623)) :rule cong :premises (t35.t2.t26 t35.t2.t27))
+(step t35.t2.t29 (cl @p_563) :rule refl)
+(step t35.t2.t30 (cl @p_590) :rule cong :premises (t35.t2.t29))
+(step t35.t2.t31 (cl @p_578) :rule refl)
+(step t35.t2.t32 (cl @p_591) :rule cong :premises (t35.t2.t30 t35.t2.t31))
+(step t35.t2.t33 (cl @p_624) :rule cong :premises (t35.t2.t32))
+(anchor :step t35.t2.t34 :args ((:= (veriT_vr28 E$) veriT_vr72) (:= (veriT_vr29 D$) veriT_vr73)))
+(step t35.t2.t34.t1 (cl @p_563) :rule refl)
+(step t35.t2.t34.t2 (cl @p_590) :rule cong :premises (t35.t2.t34.t1))
+(step t35.t2.t34.t3 (cl @p_578) :rule refl)
+(step t35.t2.t34.t4 (cl @p_591) :rule cong :premises (t35.t2.t34.t2 t35.t2.t34.t3))
+(step t35.t2.t34.t5 (cl (! (= veriT_vr28 veriT_vr72) :named @p_628)) :rule refl)
+(step t35.t2.t34.t6 (cl (! (= veriT_vr29 veriT_vr73) :named @p_630)) :rule refl)
+(step t35.t2.t34.t7 (cl (= @p_371 @p_626)) :rule cong :premises (t35.t2.t34.t5 t35.t2.t34.t6))
+(step t35.t2.t34.t8 (cl (= @p_372 @p_627)) :rule cong :premises (t35.t2.t34.t4 t35.t2.t34.t7))
+(step t35.t2.t34.t9 (cl @p_628) :rule refl)
+(step t35.t2.t34.t10 (cl @p_563) :rule refl)
+(step t35.t2.t34.t11 (cl (= @p_374 @p_629)) :rule cong :premises (t35.t2.t34.t9 t35.t2.t34.t10))
+(step t35.t2.t34.t12 (cl @p_630) :rule refl)
+(step t35.t2.t34.t13 (cl (= @p_376 @p_631)) :rule cong :premises (t35.t2.t34.t11 t35.t2.t34.t12))
+(step t35.t2.t34.t14 (cl (= @p_377 @p_632)) :rule cong :premises (t35.t2.t34.t13))
+(step t35.t2.t34.t15 (cl (= @p_378 @p_633)) :rule cong :premises (t35.t2.t34.t8 t35.t2.t34.t14))
+(step t35.t2.t34 (cl (= @p_368 @p_625)) :rule bind)
+(step t35.t2.t35 (cl (= @p_379 @p_634)) :rule cong :premises (t35.t2.t33 t35.t2.t34))
+(step t35.t2.t36 (cl (= @p_635 @p_636)) :rule cong :premises (t35.t2.t28 t35.t2.t35))
+(step t35.t2.t37 (cl (= @p_427 @p_637)) :rule cong :premises (t35.t2.t21 t35.t2.t36))
+(anchor :step t35.t2.t38 :args ((:= (veriT_vr32 F$) veriT_vr74) (:= (veriT_vr33 D$) veriT_vr75)))
+(step t35.t2.t38.t1 (cl @p_563) :rule refl)
+(step t35.t2.t38.t2 (cl @p_590) :rule cong :premises (t35.t2.t38.t1))
+(step t35.t2.t38.t3 (cl @p_578) :rule refl)
+(step t35.t2.t38.t4 (cl @p_591) :rule cong :premises (t35.t2.t38.t2 t35.t2.t38.t3))
+(step t35.t2.t38.t5 (cl @p_624) :rule cong :premises (t35.t2.t38.t4))
+(anchor :step t35.t2.t38.t6 :args ((:= (veriT_vr34 E$) veriT_vr76) (:= (veriT_vr35 D$) veriT_vr77)))
+(step t35.t2.t38.t6.t1 (cl @p_563) :rule refl)
+(step t35.t2.t38.t6.t2 (cl @p_590) :rule cong :premises (t35.t2.t38.t6.t1))
+(step t35.t2.t38.t6.t3 (cl @p_578) :rule refl)
+(step t35.t2.t38.t6.t4 (cl @p_591) :rule cong :premises (t35.t2.t38.t6.t2 t35.t2.t38.t6.t3))
+(step t35.t2.t38.t6.t5 (cl (! (= veriT_vr34 veriT_vr76) :named @p_642)) :rule refl)
+(step t35.t2.t38.t6.t6 (cl (! (= veriT_vr35 veriT_vr77) :named @p_644)) :rule refl)
+(step t35.t2.t38.t6.t7 (cl (= @p_395 @p_640)) :rule cong :premises (t35.t2.t38.t6.t5 t35.t2.t38.t6.t6))
+(step t35.t2.t38.t6.t8 (cl (= @p_396 @p_641)) :rule cong :premises (t35.t2.t38.t6.t4 t35.t2.t38.t6.t7))
+(step t35.t2.t38.t6.t9 (cl @p_642) :rule refl)
+(step t35.t2.t38.t6.t10 (cl @p_563) :rule refl)
+(step t35.t2.t38.t6.t11 (cl (= @p_398 @p_643)) :rule cong :premises (t35.t2.t38.t6.t9 t35.t2.t38.t6.t10))
+(step t35.t2.t38.t6.t12 (cl @p_644) :rule refl)
+(step t35.t2.t38.t6.t13 (cl (= @p_400 @p_645)) :rule cong :premises (t35.t2.t38.t6.t11 t35.t2.t38.t6.t12))
+(step t35.t2.t38.t6.t14 (cl (! (= veriT_vr32 veriT_vr74) :named @p_656)) :rule refl)
+(step t35.t2.t38.t6.t15 (cl (! (= veriT_vr33 veriT_vr75) :named @p_657)) :rule refl)
+(step t35.t2.t38.t6.t16 (cl (! (= @p_329 @p_550) :named @p_658)) :rule cong :premises (t35.t2.t38.t6.t14 t35.t2.t38.t6.t15))
+(step t35.t2.t38.t6.t17 (cl (= @p_401 @p_646)) :rule cong :premises (t35.t2.t38.t6.t13 t35.t2.t38.t6.t16))
+(step t35.t2.t38.t6.t18 (cl (= @p_402 @p_647)) :rule cong :premises (t35.t2.t38.t6.t8 t35.t2.t38.t6.t17))
+(step t35.t2.t38.t6 (cl (= @p_394 @p_639)) :rule bind)
+(step t35.t2.t38.t7 (cl (= @p_403 @p_648)) :rule cong :premises (t35.t2.t38.t5 t35.t2.t38.t6))
+(step t35.t2.t38.t8 (cl @p_557) :rule refl)
+(step t35.t2.t38.t9 (cl @p_577) :rule cong :premises (t35.t2.t38.t8))
+(step t35.t2.t38.t10 (cl @p_578) :rule refl)
+(step t35.t2.t38.t11 (cl @p_579) :rule cong :premises (t35.t2.t38.t9 t35.t2.t38.t10))
+(step t35.t2.t38.t12 (cl @p_601) :rule cong :premises (t35.t2.t38.t11))
+(anchor :step t35.t2.t38.t13 :args ((:= (veriT_vr36 E$) veriT_vr78) (:= (veriT_vr37 D$) veriT_vr79)))
+(step t35.t2.t38.t13.t1 (cl @p_557) :rule refl)
+(step t35.t2.t38.t13.t2 (cl @p_577) :rule cong :premises (t35.t2.t38.t13.t1))
+(step t35.t2.t38.t13.t3 (cl @p_578) :rule refl)
+(step t35.t2.t38.t13.t4 (cl @p_579) :rule cong :premises (t35.t2.t38.t13.t2 t35.t2.t38.t13.t3))
+(step t35.t2.t38.t13.t5 (cl (! (= veriT_vr36 veriT_vr78) :named @p_652)) :rule refl)
+(step t35.t2.t38.t13.t6 (cl (! (= veriT_vr37 veriT_vr79) :named @p_654)) :rule refl)
+(step t35.t2.t38.t13.t7 (cl (= @p_405 @p_650)) :rule cong :premises (t35.t2.t38.t13.t5 t35.t2.t38.t13.t6))
+(step t35.t2.t38.t13.t8 (cl (= @p_406 @p_651)) :rule cong :premises (t35.t2.t38.t13.t4 t35.t2.t38.t13.t7))
+(step t35.t2.t38.t13.t9 (cl @p_652) :rule refl)
+(step t35.t2.t38.t13.t10 (cl @p_557) :rule refl)
+(step t35.t2.t38.t13.t11 (cl (= @p_408 @p_653)) :rule cong :premises (t35.t2.t38.t13.t9 t35.t2.t38.t13.t10))
+(step t35.t2.t38.t13.t12 (cl @p_654) :rule refl)
+(step t35.t2.t38.t13.t13 (cl (= @p_410 @p_655)) :rule cong :premises (t35.t2.t38.t13.t11 t35.t2.t38.t13.t12))
+(step t35.t2.t38.t13.t14 (cl @p_656) :rule refl)
+(step t35.t2.t38.t13.t15 (cl @p_657) :rule refl)
+(step t35.t2.t38.t13.t16 (cl @p_658) :rule cong :premises (t35.t2.t38.t13.t14 t35.t2.t38.t13.t15))
+(step t35.t2.t38.t13.t17 (cl (= @p_414 @p_659)) :rule cong :premises (t35.t2.t38.t13.t13 t35.t2.t38.t13.t16))
+(step t35.t2.t38.t13.t18 (cl (= @p_415 @p_660)) :rule cong :premises (t35.t2.t38.t13.t8 t35.t2.t38.t13.t17))
+(step t35.t2.t38.t13 (cl (= @p_404 @p_649)) :rule bind)
+(step t35.t2.t38.t14 (cl (= @p_416 @p_661)) :rule cong :premises (t35.t2.t38.t12 t35.t2.t38.t13))
+(step t35.t2.t38.t15 (cl (= @p_662 @p_663)) :rule cong :premises (t35.t2.t38.t7 t35.t2.t38.t14))
+(step t35.t2.t38.t16 (cl @p_557) :rule refl)
+(step t35.t2.t38.t17 (cl @p_577) :rule cong :premises (t35.t2.t38.t16))
+(step t35.t2.t38.t18 (cl @p_578) :rule refl)
+(step t35.t2.t38.t19 (cl @p_579) :rule cong :premises (t35.t2.t38.t17 t35.t2.t38.t18))
+(step t35.t2.t38.t20 (cl @p_601) :rule cong :premises (t35.t2.t38.t19))
+(anchor :step t35.t2.t38.t21 :args ((:= (veriT_vr36 E$) veriT_vr80) (:= (veriT_vr37 D$) veriT_vr81)))
+(step t35.t2.t38.t21.t1 (cl @p_557) :rule refl)
+(step t35.t2.t38.t21.t2 (cl @p_577) :rule cong :premises (t35.t2.t38.t21.t1))
+(step t35.t2.t38.t21.t3 (cl @p_578) :rule refl)
+(step t35.t2.t38.t21.t4 (cl @p_579) :rule cong :premises (t35.t2.t38.t21.t2 t35.t2.t38.t21.t3))
+(step t35.t2.t38.t21.t5 (cl (! (= veriT_vr36 veriT_vr80) :named @p_667)) :rule refl)
+(step t35.t2.t38.t21.t6 (cl (! (= veriT_vr37 veriT_vr81) :named @p_669)) :rule refl)
+(step t35.t2.t38.t21.t7 (cl (= @p_405 @p_665)) :rule cong :premises (t35.t2.t38.t21.t5 t35.t2.t38.t21.t6))
+(step t35.t2.t38.t21.t8 (cl (= @p_406 @p_666)) :rule cong :premises (t35.t2.t38.t21.t4 t35.t2.t38.t21.t7))
+(step t35.t2.t38.t21.t9 (cl @p_667) :rule refl)
+(step t35.t2.t38.t21.t10 (cl @p_557) :rule refl)
+(step t35.t2.t38.t21.t11 (cl (= @p_408 @p_668)) :rule cong :premises (t35.t2.t38.t21.t9 t35.t2.t38.t21.t10))
+(step t35.t2.t38.t21.t12 (cl @p_669) :rule refl)
+(step t35.t2.t38.t21.t13 (cl (= @p_410 @p_670)) :rule cong :premises (t35.t2.t38.t21.t11 t35.t2.t38.t21.t12))
+(step t35.t2.t38.t21.t14 (cl @p_656) :rule refl)
+(step t35.t2.t38.t21.t15 (cl @p_657) :rule refl)
+(step t35.t2.t38.t21.t16 (cl @p_658) :rule cong :premises (t35.t2.t38.t21.t14 t35.t2.t38.t21.t15))
+(step t35.t2.t38.t21.t17 (cl (= @p_414 @p_671)) :rule cong :premises (t35.t2.t38.t21.t13 t35.t2.t38.t21.t16))
+(step t35.t2.t38.t21.t18 (cl (= @p_415 @p_672)) :rule cong :premises (t35.t2.t38.t21.t8 t35.t2.t38.t21.t17))
+(step t35.t2.t38.t21 (cl (= @p_404 @p_664)) :rule bind)
+(step t35.t2.t38.t22 (cl (= @p_416 @p_673)) :rule cong :premises (t35.t2.t38.t20 t35.t2.t38.t21))
+(step t35.t2.t38.t23 (cl @p_563) :rule refl)
+(step t35.t2.t38.t24 (cl @p_590) :rule cong :premises (t35.t2.t38.t23))
+(step t35.t2.t38.t25 (cl @p_578) :rule refl)
+(step t35.t2.t38.t26 (cl @p_591) :rule cong :premises (t35.t2.t38.t24 t35.t2.t38.t25))
+(step t35.t2.t38.t27 (cl @p_624) :rule cong :premises (t35.t2.t38.t26))
+(anchor :step t35.t2.t38.t28 :args ((:= (veriT_vr34 E$) veriT_vr82) (:= (veriT_vr35 D$) veriT_vr83)))
+(step t35.t2.t38.t28.t1 (cl @p_563) :rule refl)
+(step t35.t2.t38.t28.t2 (cl @p_590) :rule cong :premises (t35.t2.t38.t28.t1))
+(step t35.t2.t38.t28.t3 (cl @p_578) :rule refl)
+(step t35.t2.t38.t28.t4 (cl @p_591) :rule cong :premises (t35.t2.t38.t28.t2 t35.t2.t38.t28.t3))
+(step t35.t2.t38.t28.t5 (cl (! (= veriT_vr34 veriT_vr82) :named @p_677)) :rule refl)
+(step t35.t2.t38.t28.t6 (cl (! (= veriT_vr35 veriT_vr83) :named @p_679)) :rule refl)
+(step t35.t2.t38.t28.t7 (cl (= @p_395 @p_675)) :rule cong :premises (t35.t2.t38.t28.t5 t35.t2.t38.t28.t6))
+(step t35.t2.t38.t28.t8 (cl (= @p_396 @p_676)) :rule cong :premises (t35.t2.t38.t28.t4 t35.t2.t38.t28.t7))
+(step t35.t2.t38.t28.t9 (cl @p_677) :rule refl)
+(step t35.t2.t38.t28.t10 (cl @p_563) :rule refl)
+(step t35.t2.t38.t28.t11 (cl (= @p_398 @p_678)) :rule cong :premises (t35.t2.t38.t28.t9 t35.t2.t38.t28.t10))
+(step t35.t2.t38.t28.t12 (cl @p_679) :rule refl)
+(step t35.t2.t38.t28.t13 (cl (= @p_400 @p_680)) :rule cong :premises (t35.t2.t38.t28.t11 t35.t2.t38.t28.t12))
+(step t35.t2.t38.t28.t14 (cl @p_656) :rule refl)
+(step t35.t2.t38.t28.t15 (cl @p_657) :rule refl)
+(step t35.t2.t38.t28.t16 (cl @p_658) :rule cong :premises (t35.t2.t38.t28.t14 t35.t2.t38.t28.t15))
+(step t35.t2.t38.t28.t17 (cl (= @p_401 @p_681)) :rule cong :premises (t35.t2.t38.t28.t13 t35.t2.t38.t28.t16))
+(step t35.t2.t38.t28.t18 (cl (= @p_402 @p_682)) :rule cong :premises (t35.t2.t38.t28.t8 t35.t2.t38.t28.t17))
+(step t35.t2.t38.t28 (cl (= @p_394 @p_674)) :rule bind)
+(step t35.t2.t38.t29 (cl (= @p_403 @p_683)) :rule cong :premises (t35.t2.t38.t27 t35.t2.t38.t28))
+(step t35.t2.t38.t30 (cl (= @p_684 @p_685)) :rule cong :premises (t35.t2.t38.t22 t35.t2.t38.t29))
+(step t35.t2.t38.t31 (cl (= @p_429 @p_686)) :rule cong :premises (t35.t2.t38.t15 t35.t2.t38.t30))
+(step t35.t2.t38 (cl (= @p_428 @p_638)) :rule bind)
+(step t35.t2.t39 (cl (= @p_430 @p_687)) :rule cong :premises (t35.t2.t37 t35.t2.t38))
+(step t35.t2.t40 (cl (= @p_431 @p_688)) :rule cong :premises (t35.t2.t5 t35.t2.t6 t35.t2.t39))
+(step t35.t2 (cl (= @p_426 @p_574)) :rule bind)
+(step t35.t3 (cl (= @p_432 @p_689)) :rule cong :premises (t35.t1 t35.t2))
+(step t35 (cl (= @p_433 (! (forall ((veriT_vr57 A_b_c_M_state_fun$) (veriT_vr58 A_b_c_M_state_fun$)) @p_689) :named @p_690))) :rule bind)
+(step t36 (cl (= @p_434 (! (not @p_690) :named @p_693))) :rule cong :premises (t35))
+(step t37 (cl (! (= @p_436 (! (and @p_691 @p_692 @p_693) :named @p_695)) :named @p_694)) :rule cong :premises (t33 t34 t36))
+(step t38 (cl (not @p_694) (not @p_436) @p_695) :rule equiv_pos2)
+(step t39 (cl @p_695) :rule th_resolution :premises (t32 t37 t38))
+(anchor :step t40 :args ((:= (veriT_vr57 A_b_c_M_state_fun$) veriT_sk0) (:= (veriT_vr58 A_b_c_M_state_fun$) veriT_sk1)))
+(anchor :step t40.t1 :args ((veriT_vr59 A$) (veriT_vr60 C$)))
+(step t40.t1.t1 (cl (! (= veriT_vr57 veriT_sk0) :named @p_754)) :rule refl)
+(step t40.t1.t2 (cl (! (= @p_552 (! (fun_app$ veriT_sk0 veriT_vr59) :named @p_751)) :named @p_755)) :rule cong :premises (t40.t1.t1))
+(step t40.t1.t3 (cl (! (= @p_544 (! (run$ @p_751 veriT_vr60) :named @p_703)) :named @p_756)) :rule cong :premises (t40.t1.t2))
+(step t40.t1.t4 (cl (! (= @p_542 (! (is_fail$ @p_703) :named @p_701)) :named @p_757)) :rule cong :premises (t40.t1.t3))
+(step t40.t1.t5 (cl (! (= veriT_vr58 veriT_sk1) :named @p_760)) :rule refl)
+(step t40.t1.t6 (cl (! (= @p_554 (! (fun_app$ veriT_sk1 veriT_vr59) :named @p_752)) :named @p_761)) :rule cong :premises (t40.t1.t5))
+(step t40.t1.t7 (cl (! (= @p_543 (! (run$ @p_752 veriT_vr60) :named @p_702)) :named @p_762)) :rule cong :premises (t40.t1.t6))
+(step t40.t1.t8 (cl (= @p_556 (! (is_fail$ @p_702) :named @p_753))) :rule cong :premises (t40.t1.t7))
+(step t40.t1.t9 (cl @p_754) :rule refl)
+(step t40.t1.t10 (cl @p_755) :rule cong :premises (t40.t1.t9))
+(step t40.t1.t11 (cl @p_756) :rule cong :premises (t40.t1.t10))
+(step t40.t1.t12 (cl @p_757) :rule cong :premises (t40.t1.t11))
+(step t40.t1.t13 (cl (= @p_561 (! (= @p_753 @p_701) :named @p_758))) :rule cong :premises (t40.t1.t8 t40.t1.t12))
+(anchor :step t40.t1.t14 :args ((veriT_vr61 B$) (veriT_vr62 C$)))
+(step t40.t1.t14.t1 (cl @p_760) :rule refl)
+(step t40.t1.t14.t2 (cl @p_761) :rule cong :premises (t40.t1.t14.t1))
+(step t40.t1.t14.t3 (cl @p_762) :rule cong :premises (t40.t1.t14.t2))
+(step t40.t1.t14.t4 (cl (= @p_566 (! (is_res$ @p_702 @p_545) :named @p_763))) :rule cong :premises (t40.t1.t14.t3))
+(step t40.t1.t14.t5 (cl @p_754) :rule refl)
+(step t40.t1.t14.t6 (cl @p_755) :rule cong :premises (t40.t1.t14.t5))
+(step t40.t1.t14.t7 (cl @p_756) :rule cong :premises (t40.t1.t14.t6))
+(step t40.t1.t14.t8 (cl (= @p_570 (! (is_res$ @p_703 @p_545) :named @p_764))) :rule cong :premises (t40.t1.t14.t7))
+(step t40.t1.t14.t9 (cl (= @p_571 (! (= @p_763 @p_764) :named @p_765))) :rule cong :premises (t40.t1.t14.t4 t40.t1.t14.t8))
+(step t40.t1.t14 (cl (= @p_562 (! (forall ((veriT_vr61 B$) (veriT_vr62 C$)) @p_765) :named @p_759))) :rule bind)
+(step t40.t1.t15 (cl (= @p_572 (! (and @p_758 @p_759) :named @p_766))) :rule cong :premises (t40.t1.t13 t40.t1.t14))
+(step t40.t1.t16 (cl (= @p_573 (! (or @p_701 @p_766) :named @p_767))) :rule cong :premises (t40.t1.t4 t40.t1.t15))
+(step t40.t1 (cl (= @p_551 (! (forall ((veriT_vr59 A$) (veriT_vr60 C$)) @p_767) :named @p_750))) :rule bind)
+(anchor :step t40.t2 :args ((:= (veriT_vr63 D$) veriT_sk2)))
+(step t40.t2.t1 (cl @p_754) :rule refl)
+(step t40.t2.t2 (cl (! (= @p_575 (! (b$ veriT_sk0) :named @p_769)) :named @p_771)) :rule cong :premises (t40.t2.t1))
+(step t40.t2.t3 (cl (! (= veriT_vr63 veriT_sk2) :named @p_772)) :rule refl)
+(step t40.t2.t4 (cl (! (= @p_546 (! (run$a @p_769 veriT_sk2) :named @p_712)) :named @p_773)) :rule cong :premises (t40.t2.t2 t40.t2.t3))
+(step t40.t2.t5 (cl (! (= @p_548 (! (is_fail$a @p_712) :named @p_720)) :named @p_791)) :rule cong :premises (t40.t2.t4))
+(anchor :step t40.t2.t6 :args ((veriT_vr64 E$) (veriT_vr65 D$)))
+(step t40.t2.t6.t1 (cl @p_754) :rule refl)
+(step t40.t2.t6.t2 (cl @p_771) :rule cong :premises (t40.t2.t6.t1))
+(step t40.t2.t6.t3 (cl @p_772) :rule refl)
+(step t40.t2.t6.t4 (cl @p_773) :rule cong :premises (t40.t2.t6.t2 t40.t2.t6.t3))
+(step t40.t2.t6.t5 (cl (= @p_581 (! (is_res$a @p_712 @p_580) :named @p_774))) :rule cong :premises (t40.t2.t6.t4))
+(step t40.t2.t6.t6 (cl @p_754) :rule refl)
+(step t40.t2.t6.t7 (cl (= @p_583 (! (c$ veriT_vr64 veriT_sk0) :named @p_775))) :rule cong :premises (t40.t2.t6.t6))
+(step t40.t2.t6.t8 (cl (= @p_585 (! (run$b @p_775 veriT_vr65) :named @p_776))) :rule cong :premises (t40.t2.t6.t7))
+(step t40.t2.t6.t9 (cl (= @p_586 (! (is_fail$b @p_776) :named @p_777))) :rule cong :premises (t40.t2.t6.t8))
+(step t40.t2.t6.t10 (cl (= @p_587 (! (and @p_774 @p_777) :named @p_778))) :rule cong :premises (t40.t2.t6.t5 t40.t2.t6.t9))
+(step t40.t2.t6 (cl (= @p_576 (! (exists ((veriT_vr64 E$) (veriT_vr65 D$)) @p_778) :named @p_770))) :rule bind)
+(step t40.t2.t7 (cl @p_760) :rule refl)
+(step t40.t2.t8 (cl (! (= @p_588 (! (b$ veriT_sk1) :named @p_779)) :named @p_781)) :rule cong :premises (t40.t2.t7))
+(step t40.t2.t9 (cl @p_772) :rule refl)
+(step t40.t2.t10 (cl (! (= @p_547 (! (run$a @p_779 veriT_sk2) :named @p_714)) :named @p_782)) :rule cong :premises (t40.t2.t8 t40.t2.t9))
+(step t40.t2.t11 (cl (! (= @p_549 (! (is_fail$a @p_714) :named @p_726)) :named @p_809)) :rule cong :premises (t40.t2.t10))
+(anchor :step t40.t2.t12 :args ((:= (veriT_vr66 E$) veriT_sk3) (:= (veriT_vr67 D$) veriT_sk4)))
+(step t40.t2.t12.t1 (cl @p_760) :rule refl)
+(step t40.t2.t12.t2 (cl @p_781) :rule cong :premises (t40.t2.t12.t1))
+(step t40.t2.t12.t3 (cl @p_772) :rule refl)
+(step t40.t2.t12.t4 (cl @p_782) :rule cong :premises (t40.t2.t12.t2 t40.t2.t12.t3))
+(step t40.t2.t12.t5 (cl (! (= veriT_vr66 veriT_sk3) :named @p_785)) :rule refl)
+(step t40.t2.t12.t6 (cl (! (= veriT_vr67 veriT_sk4) :named @p_787)) :rule refl)
+(step t40.t2.t12.t7 (cl (= @p_592 (! (pair$a veriT_sk3 veriT_sk4) :named @p_783))) :rule cong :premises (t40.t2.t12.t5 t40.t2.t12.t6))
+(step t40.t2.t12.t8 (cl (= @p_593 (! (is_res$a @p_714 @p_783) :named @p_784))) :rule cong :premises (t40.t2.t12.t4 t40.t2.t12.t7))
+(step t40.t2.t12.t9 (cl @p_785) :rule refl)
+(step t40.t2.t12.t10 (cl @p_760) :rule refl)
+(step t40.t2.t12.t11 (cl (= @p_595 (! (c$ veriT_sk3 veriT_sk1) :named @p_786))) :rule cong :premises (t40.t2.t12.t9 t40.t2.t12.t10))
+(step t40.t2.t12.t12 (cl @p_787) :rule refl)
+(step t40.t2.t12.t13 (cl (= @p_597 (! (run$b @p_786 veriT_sk4) :named @p_788))) :rule cong :premises (t40.t2.t12.t11 t40.t2.t12.t12))
+(step t40.t2.t12.t14 (cl (= @p_598 (! (is_fail$b @p_788) :named @p_789))) :rule cong :premises (t40.t2.t12.t13))
+(step t40.t2.t12.t15 (cl (= @p_599 (! (and @p_784 @p_789) :named @p_780))) :rule cong :premises (t40.t2.t12.t8 t40.t2.t12.t14))
+(step t40.t2.t12 (cl (= @p_589 @p_780)) :rule sko_ex)
+(step t40.t2.t13 (cl (= @p_600 (! (or @p_726 @p_780) :named @p_790))) :rule cong :premises (t40.t2.t11 t40.t2.t12))
+(step t40.t2.t14 (cl @p_754) :rule refl)
+(step t40.t2.t15 (cl @p_771) :rule cong :premises (t40.t2.t14))
+(step t40.t2.t16 (cl @p_772) :rule refl)
+(step t40.t2.t17 (cl @p_773) :rule cong :premises (t40.t2.t15 t40.t2.t16))
+(step t40.t2.t18 (cl @p_791) :rule cong :premises (t40.t2.t17))
+(anchor :step t40.t2.t19 :args ((veriT_vr68 E$) (veriT_vr69 D$)))
+(step t40.t2.t19.t1 (cl @p_754) :rule refl)
+(step t40.t2.t19.t2 (cl @p_771) :rule cong :premises (t40.t2.t19.t1))
+(step t40.t2.t19.t3 (cl @p_772) :rule refl)
+(step t40.t2.t19.t4 (cl @p_773) :rule cong :premises (t40.t2.t19.t2 t40.t2.t19.t3))
+(step t40.t2.t19.t5 (cl (= @p_604 (! (is_res$a @p_712 @p_603) :named @p_793))) :rule cong :premises (t40.t2.t19.t4))
+(step t40.t2.t19.t6 (cl @p_754) :rule refl)
+(step t40.t2.t19.t7 (cl (= @p_606 (! (c$ veriT_vr68 veriT_sk0) :named @p_794))) :rule cong :premises (t40.t2.t19.t6))
+(step t40.t2.t19.t8 (cl (= @p_608 (! (run$b @p_794 veriT_vr69) :named @p_795))) :rule cong :premises (t40.t2.t19.t7))
+(step t40.t2.t19.t9 (cl (= @p_609 (! (is_fail$b @p_795) :named @p_796))) :rule cong :premises (t40.t2.t19.t8))
+(step t40.t2.t19.t10 (cl (= @p_610 (! (and @p_793 @p_796) :named @p_797))) :rule cong :premises (t40.t2.t19.t5 t40.t2.t19.t9))
+(step t40.t2.t19 (cl (= @p_602 (! (exists ((veriT_vr68 E$) (veriT_vr69 D$)) @p_797) :named @p_792))) :rule bind)
+(step t40.t2.t20 (cl (= @p_611 (! (or @p_720 @p_792) :named @p_798))) :rule cong :premises (t40.t2.t18 t40.t2.t19))
+(step t40.t2.t21 (cl (= @p_613 (! (=> @p_790 @p_798) :named @p_799))) :rule cong :premises (t40.t2.t13 t40.t2.t20))
+(step t40.t2.t22 (cl @p_754) :rule refl)
+(step t40.t2.t23 (cl @p_771) :rule cong :premises (t40.t2.t22))
+(step t40.t2.t24 (cl @p_772) :rule refl)
+(step t40.t2.t25 (cl @p_773) :rule cong :premises (t40.t2.t23 t40.t2.t24))
+(step t40.t2.t26 (cl @p_791) :rule cong :premises (t40.t2.t25))
+(anchor :step t40.t2.t27 :args ((:= (veriT_vr70 E$) veriT_sk5) (:= (veriT_vr71 D$) veriT_sk6)))
+(step t40.t2.t27.t1 (cl @p_754) :rule refl)
+(step t40.t2.t27.t2 (cl @p_771) :rule cong :premises (t40.t2.t27.t1))
+(step t40.t2.t27.t3 (cl @p_772) :rule refl)
+(step t40.t2.t27.t4 (cl @p_773) :rule cong :premises (t40.t2.t27.t2 t40.t2.t27.t3))
+(step t40.t2.t27.t5 (cl (! (= veriT_vr70 veriT_sk5) :named @p_803)) :rule refl)
+(step t40.t2.t27.t6 (cl (! (= veriT_vr71 veriT_sk6) :named @p_805)) :rule refl)
+(step t40.t2.t27.t7 (cl (= @p_615 (! (pair$a veriT_sk5 veriT_sk6) :named @p_801))) :rule cong :premises (t40.t2.t27.t5 t40.t2.t27.t6))
+(step t40.t2.t27.t8 (cl (= @p_616 (! (is_res$a @p_712 @p_801) :named @p_802))) :rule cong :premises (t40.t2.t27.t4 t40.t2.t27.t7))
+(step t40.t2.t27.t9 (cl @p_803) :rule refl)
+(step t40.t2.t27.t10 (cl @p_754) :rule refl)
+(step t40.t2.t27.t11 (cl (= @p_618 (! (c$ veriT_sk5 veriT_sk0) :named @p_804))) :rule cong :premises (t40.t2.t27.t9 t40.t2.t27.t10))
+(step t40.t2.t27.t12 (cl @p_805) :rule refl)
+(step t40.t2.t27.t13 (cl (= @p_620 (! (run$b @p_804 veriT_sk6) :named @p_806))) :rule cong :premises (t40.t2.t27.t11 t40.t2.t27.t12))
+(step t40.t2.t27.t14 (cl (= @p_621 (! (is_fail$b @p_806) :named @p_807))) :rule cong :premises (t40.t2.t27.t13))
+(step t40.t2.t27.t15 (cl (= @p_622 (! (and @p_802 @p_807) :named @p_800))) :rule cong :premises (t40.t2.t27.t8 t40.t2.t27.t14))
+(step t40.t2.t27 (cl (= @p_614 @p_800)) :rule sko_ex)
+(step t40.t2.t28 (cl (= @p_623 (! (or @p_720 @p_800) :named @p_808))) :rule cong :premises (t40.t2.t26 t40.t2.t27))
+(step t40.t2.t29 (cl @p_760) :rule refl)
+(step t40.t2.t30 (cl @p_781) :rule cong :premises (t40.t2.t29))
+(step t40.t2.t31 (cl @p_772) :rule refl)
+(step t40.t2.t32 (cl @p_782) :rule cong :premises (t40.t2.t30 t40.t2.t31))
+(step t40.t2.t33 (cl @p_809) :rule cong :premises (t40.t2.t32))
+(anchor :step t40.t2.t34 :args ((veriT_vr72 E$) (veriT_vr73 D$)))
+(step t40.t2.t34.t1 (cl @p_760) :rule refl)
+(step t40.t2.t34.t2 (cl @p_781) :rule cong :premises (t40.t2.t34.t1))
+(step t40.t2.t34.t3 (cl @p_772) :rule refl)
+(step t40.t2.t34.t4 (cl @p_782) :rule cong :premises (t40.t2.t34.t2 t40.t2.t34.t3))
+(step t40.t2.t34.t5 (cl (= @p_627 (! (is_res$a @p_714 @p_626) :named @p_811))) :rule cong :premises (t40.t2.t34.t4))
+(step t40.t2.t34.t6 (cl @p_760) :rule refl)
+(step t40.t2.t34.t7 (cl (= @p_629 (! (c$ veriT_vr72 veriT_sk1) :named @p_812))) :rule cong :premises (t40.t2.t34.t6))
+(step t40.t2.t34.t8 (cl (= @p_631 (! (run$b @p_812 veriT_vr73) :named @p_813))) :rule cong :premises (t40.t2.t34.t7))
+(step t40.t2.t34.t9 (cl (= @p_632 (! (is_fail$b @p_813) :named @p_814))) :rule cong :premises (t40.t2.t34.t8))
+(step t40.t2.t34.t10 (cl (= @p_633 (! (and @p_811 @p_814) :named @p_815))) :rule cong :premises (t40.t2.t34.t5 t40.t2.t34.t9))
+(step t40.t2.t34 (cl (= @p_625 (! (exists ((veriT_vr72 E$) (veriT_vr73 D$)) @p_815) :named @p_810))) :rule bind)
+(step t40.t2.t35 (cl (= @p_634 (! (or @p_726 @p_810) :named @p_816))) :rule cong :premises (t40.t2.t33 t40.t2.t34))
+(step t40.t2.t36 (cl (= @p_636 (! (=> @p_808 @p_816) :named @p_817))) :rule cong :premises (t40.t2.t28 t40.t2.t35))
+(step t40.t2.t37 (cl (= @p_637 (! (and @p_799 @p_817) :named @p_818))) :rule cong :premises (t40.t2.t21 t40.t2.t36))
+(anchor :step t40.t2.t38 :args ((:= (veriT_vr74 F$) veriT_sk7) (:= (veriT_vr75 D$) veriT_sk8)))
+(step t40.t2.t38.t1 (cl @p_760) :rule refl)
+(step t40.t2.t38.t2 (cl @p_781) :rule cong :premises (t40.t2.t38.t1))
+(step t40.t2.t38.t3 (cl @p_772) :rule refl)
+(step t40.t2.t38.t4 (cl @p_782) :rule cong :premises (t40.t2.t38.t2 t40.t2.t38.t3))
+(step t40.t2.t38.t5 (cl @p_809) :rule cong :premises (t40.t2.t38.t4))
+(anchor :step t40.t2.t38.t6 :args ((:= (veriT_vr76 E$) veriT_sk9) (:= (veriT_vr77 D$) veriT_sk10)))
+(step t40.t2.t38.t6.t1 (cl @p_760) :rule refl)
+(step t40.t2.t38.t6.t2 (cl @p_781) :rule cong :premises (t40.t2.t38.t6.t1))
+(step t40.t2.t38.t6.t3 (cl @p_772) :rule refl)
+(step t40.t2.t38.t6.t4 (cl @p_782) :rule cong :premises (t40.t2.t38.t6.t2 t40.t2.t38.t6.t3))
+(step t40.t2.t38.t6.t5 (cl (! (= veriT_vr76 veriT_sk9) :named @p_823)) :rule refl)
+(step t40.t2.t38.t6.t6 (cl (! (= veriT_vr77 veriT_sk10) :named @p_825)) :rule refl)
+(step t40.t2.t38.t6.t7 (cl (= @p_640 (! (pair$a veriT_sk9 veriT_sk10) :named @p_821))) :rule cong :premises (t40.t2.t38.t6.t5 t40.t2.t38.t6.t6))
+(step t40.t2.t38.t6.t8 (cl (= @p_641 (! (is_res$a @p_714 @p_821) :named @p_822))) :rule cong :premises (t40.t2.t38.t6.t4 t40.t2.t38.t6.t7))
+(step t40.t2.t38.t6.t9 (cl @p_823) :rule refl)
+(step t40.t2.t38.t6.t10 (cl @p_760) :rule refl)
+(step t40.t2.t38.t6.t11 (cl (= @p_643 (! (c$ veriT_sk9 veriT_sk1) :named @p_824))) :rule cong :premises (t40.t2.t38.t6.t9 t40.t2.t38.t6.t10))
+(step t40.t2.t38.t6.t12 (cl @p_825) :rule refl)
+(step t40.t2.t38.t6.t13 (cl (= @p_645 (! (run$b @p_824 veriT_sk10) :named @p_826))) :rule cong :premises (t40.t2.t38.t6.t11 t40.t2.t38.t6.t12))
+(step t40.t2.t38.t6.t14 (cl (! (= veriT_vr74 veriT_sk7) :named @p_833)) :rule refl)
+(step t40.t2.t38.t6.t15 (cl (! (= veriT_vr75 veriT_sk8) :named @p_834)) :rule refl)
+(step t40.t2.t38.t6.t16 (cl (! (= @p_550 (! (pair$b veriT_sk7 veriT_sk8) :named @p_747)) :named @p_835)) :rule cong :premises (t40.t2.t38.t6.t14 t40.t2.t38.t6.t15))
+(step t40.t2.t38.t6.t17 (cl (= @p_646 (! (is_res$b @p_826 @p_747) :named @p_827))) :rule cong :premises (t40.t2.t38.t6.t13 t40.t2.t38.t6.t16))
+(step t40.t2.t38.t6.t18 (cl (= @p_647 (! (and @p_822 @p_827) :named @p_820))) :rule cong :premises (t40.t2.t38.t6.t8 t40.t2.t38.t6.t17))
+(step t40.t2.t38.t6 (cl (= @p_639 @p_820)) :rule sko_ex)
+(step t40.t2.t38.t7 (cl (= @p_648 (! (or @p_726 @p_820) :named @p_828))) :rule cong :premises (t40.t2.t38.t5 t40.t2.t38.t6))
+(step t40.t2.t38.t8 (cl @p_754) :rule refl)
+(step t40.t2.t38.t9 (cl @p_771) :rule cong :premises (t40.t2.t38.t8))
+(step t40.t2.t38.t10 (cl @p_772) :rule refl)
+(step t40.t2.t38.t11 (cl @p_773) :rule cong :premises (t40.t2.t38.t9 t40.t2.t38.t10))
+(step t40.t2.t38.t12 (cl @p_791) :rule cong :premises (t40.t2.t38.t11))
+(anchor :step t40.t2.t38.t13 :args ((veriT_vr78 E$) (veriT_vr79 D$)))
+(step t40.t2.t38.t13.t1 (cl @p_754) :rule refl)
+(step t40.t2.t38.t13.t2 (cl @p_771) :rule cong :premises (t40.t2.t38.t13.t1))
+(step t40.t2.t38.t13.t3 (cl @p_772) :rule refl)
+(step t40.t2.t38.t13.t4 (cl @p_773) :rule cong :premises (t40.t2.t38.t13.t2 t40.t2.t38.t13.t3))
+(step t40.t2.t38.t13.t5 (cl (= @p_651 (! (is_res$a @p_712 @p_650) :named @p_830))) :rule cong :premises (t40.t2.t38.t13.t4))
+(step t40.t2.t38.t13.t6 (cl @p_754) :rule refl)
+(step t40.t2.t38.t13.t7 (cl (= @p_653 (! (c$ veriT_vr78 veriT_sk0) :named @p_831))) :rule cong :premises (t40.t2.t38.t13.t6))
+(step t40.t2.t38.t13.t8 (cl (= @p_655 (! (run$b @p_831 veriT_vr79) :named @p_832))) :rule cong :premises (t40.t2.t38.t13.t7))
+(step t40.t2.t38.t13.t9 (cl @p_833) :rule refl)
+(step t40.t2.t38.t13.t10 (cl @p_834) :rule refl)
+(step t40.t2.t38.t13.t11 (cl @p_835) :rule cong :premises (t40.t2.t38.t13.t9 t40.t2.t38.t13.t10))
+(step t40.t2.t38.t13.t12 (cl (= @p_659 (! (is_res$b @p_832 @p_747) :named @p_836))) :rule cong :premises (t40.t2.t38.t13.t8 t40.t2.t38.t13.t11))
+(step t40.t2.t38.t13.t13 (cl (= @p_660 (! (and @p_830 @p_836) :named @p_837))) :rule cong :premises (t40.t2.t38.t13.t5 t40.t2.t38.t13.t12))
+(step t40.t2.t38.t13 (cl (= @p_649 (! (exists ((veriT_vr78 E$) (veriT_vr79 D$)) @p_837) :named @p_829))) :rule bind)
+(step t40.t2.t38.t14 (cl (= @p_661 (! (or @p_720 @p_829) :named @p_838))) :rule cong :premises (t40.t2.t38.t12 t40.t2.t38.t13))
+(step t40.t2.t38.t15 (cl (= @p_663 (! (=> @p_828 @p_838) :named @p_839))) :rule cong :premises (t40.t2.t38.t7 t40.t2.t38.t14))
+(step t40.t2.t38.t16 (cl @p_754) :rule refl)
+(step t40.t2.t38.t17 (cl @p_771) :rule cong :premises (t40.t2.t38.t16))
+(step t40.t2.t38.t18 (cl @p_772) :rule refl)
+(step t40.t2.t38.t19 (cl @p_773) :rule cong :premises (t40.t2.t38.t17 t40.t2.t38.t18))
+(step t40.t2.t38.t20 (cl @p_791) :rule cong :premises (t40.t2.t38.t19))
+(anchor :step t40.t2.t38.t21 :args ((:= (veriT_vr80 E$) veriT_sk11) (:= (veriT_vr81 D$) veriT_sk12)))
+(step t40.t2.t38.t21.t1 (cl @p_754) :rule refl)
+(step t40.t2.t38.t21.t2 (cl @p_771) :rule cong :premises (t40.t2.t38.t21.t1))
+(step t40.t2.t38.t21.t3 (cl @p_772) :rule refl)
+(step t40.t2.t38.t21.t4 (cl @p_773) :rule cong :premises (t40.t2.t38.t21.t2 t40.t2.t38.t21.t3))
+(step t40.t2.t38.t21.t5 (cl (! (= veriT_vr80 veriT_sk11) :named @p_843)) :rule refl)
+(step t40.t2.t38.t21.t6 (cl (! (= veriT_vr81 veriT_sk12) :named @p_845)) :rule refl)
+(step t40.t2.t38.t21.t7 (cl (= @p_665 (! (pair$a veriT_sk11 veriT_sk12) :named @p_841))) :rule cong :premises (t40.t2.t38.t21.t5 t40.t2.t38.t21.t6))
+(step t40.t2.t38.t21.t8 (cl (= @p_666 (! (is_res$a @p_712 @p_841) :named @p_842))) :rule cong :premises (t40.t2.t38.t21.t4 t40.t2.t38.t21.t7))
+(step t40.t2.t38.t21.t9 (cl @p_843) :rule refl)
+(step t40.t2.t38.t21.t10 (cl @p_754) :rule refl)
+(step t40.t2.t38.t21.t11 (cl (= @p_668 (! (c$ veriT_sk11 veriT_sk0) :named @p_844))) :rule cong :premises (t40.t2.t38.t21.t9 t40.t2.t38.t21.t10))
+(step t40.t2.t38.t21.t12 (cl @p_845) :rule refl)
+(step t40.t2.t38.t21.t13 (cl (= @p_670 (! (run$b @p_844 veriT_sk12) :named @p_846))) :rule cong :premises (t40.t2.t38.t21.t11 t40.t2.t38.t21.t12))
+(step t40.t2.t38.t21.t14 (cl @p_833) :rule refl)
+(step t40.t2.t38.t21.t15 (cl @p_834) :rule refl)
+(step t40.t2.t38.t21.t16 (cl @p_835) :rule cong :premises (t40.t2.t38.t21.t14 t40.t2.t38.t21.t15))
+(step t40.t2.t38.t21.t17 (cl (= @p_671 (! (is_res$b @p_846 @p_747) :named @p_847))) :rule cong :premises (t40.t2.t38.t21.t13 t40.t2.t38.t21.t16))
+(step t40.t2.t38.t21.t18 (cl (= @p_672 (! (and @p_842 @p_847) :named @p_840))) :rule cong :premises (t40.t2.t38.t21.t8 t40.t2.t38.t21.t17))
+(step t40.t2.t38.t21 (cl (= @p_664 @p_840)) :rule sko_ex)
+(step t40.t2.t38.t22 (cl (= @p_673 (! (or @p_720 @p_840) :named @p_848))) :rule cong :premises (t40.t2.t38.t20 t40.t2.t38.t21))
+(step t40.t2.t38.t23 (cl @p_760) :rule refl)
+(step t40.t2.t38.t24 (cl @p_781) :rule cong :premises (t40.t2.t38.t23))
+(step t40.t2.t38.t25 (cl @p_772) :rule refl)
+(step t40.t2.t38.t26 (cl @p_782) :rule cong :premises (t40.t2.t38.t24 t40.t2.t38.t25))
+(step t40.t2.t38.t27 (cl @p_809) :rule cong :premises (t40.t2.t38.t26))
+(anchor :step t40.t2.t38.t28 :args ((veriT_vr82 E$) (veriT_vr83 D$)))
+(step t40.t2.t38.t28.t1 (cl @p_760) :rule refl)
+(step t40.t2.t38.t28.t2 (cl @p_781) :rule cong :premises (t40.t2.t38.t28.t1))
+(step t40.t2.t38.t28.t3 (cl @p_772) :rule refl)
+(step t40.t2.t38.t28.t4 (cl @p_782) :rule cong :premises (t40.t2.t38.t28.t2 t40.t2.t38.t28.t3))
+(step t40.t2.t38.t28.t5 (cl (= @p_676 (! (is_res$a @p_714 @p_675) :named @p_850))) :rule cong :premises (t40.t2.t38.t28.t4))
+(step t40.t2.t38.t28.t6 (cl @p_760) :rule refl)
+(step t40.t2.t38.t28.t7 (cl (= @p_678 (! (c$ veriT_vr82 veriT_sk1) :named @p_851))) :rule cong :premises (t40.t2.t38.t28.t6))
+(step t40.t2.t38.t28.t8 (cl (= @p_680 (! (run$b @p_851 veriT_vr83) :named @p_852))) :rule cong :premises (t40.t2.t38.t28.t7))
+(step t40.t2.t38.t28.t9 (cl @p_833) :rule refl)
+(step t40.t2.t38.t28.t10 (cl @p_834) :rule refl)
+(step t40.t2.t38.t28.t11 (cl @p_835) :rule cong :premises (t40.t2.t38.t28.t9 t40.t2.t38.t28.t10))
+(step t40.t2.t38.t28.t12 (cl (= @p_681 (! (is_res$b @p_852 @p_747) :named @p_853))) :rule cong :premises (t40.t2.t38.t28.t8 t40.t2.t38.t28.t11))
+(step t40.t2.t38.t28.t13 (cl (= @p_682 (! (and @p_850 @p_853) :named @p_854))) :rule cong :premises (t40.t2.t38.t28.t5 t40.t2.t38.t28.t12))
+(step t40.t2.t38.t28 (cl (= @p_674 (! (exists ((veriT_vr82 E$) (veriT_vr83 D$)) @p_854) :named @p_849))) :rule bind)
+(step t40.t2.t38.t29 (cl (= @p_683 (! (or @p_726 @p_849) :named @p_855))) :rule cong :premises (t40.t2.t38.t27 t40.t2.t38.t28))
+(step t40.t2.t38.t30 (cl (= @p_685 (! (=> @p_848 @p_855) :named @p_856))) :rule cong :premises (t40.t2.t38.t22 t40.t2.t38.t29))
+(step t40.t2.t38.t31 (cl (= @p_686 (! (and @p_839 @p_856) :named @p_819))) :rule cong :premises (t40.t2.t38.t15 t40.t2.t38.t30))
+(step t40.t2.t38 (cl (= @p_638 @p_819)) :rule sko_forall)
+(step t40.t2.t39 (cl (= @p_687 (! (and @p_818 @p_819) :named @p_857))) :rule cong :premises (t40.t2.t37 t40.t2.t38))
+(step t40.t2.t40 (cl (= @p_688 (! (or @p_720 @p_770 @p_857) :named @p_768))) :rule cong :premises (t40.t2.t5 t40.t2.t6 t40.t2.t39))
+(step t40.t2 (cl (= @p_574 @p_768)) :rule sko_forall)
+(step t40.t3 (cl (= @p_689 (! (=> @p_750 @p_768) :named @p_858))) :rule cong :premises (t40.t1 t40.t2))
+(step t40 (cl (= @p_690 @p_858)) :rule sko_forall)
+(step t41 (cl (= @p_693 (! (not @p_858) :named @p_859))) :rule cong :premises (t40))
+(step t42 (cl (! (= @p_695 (! (and @p_691 @p_692 @p_859) :named @p_861)) :named @p_860)) :rule cong :premises (t41))
+(step t43 (cl (not @p_860) (not @p_695) @p_861) :rule equiv_pos2)
+(step t44 (cl @p_861) :rule th_resolution :premises (t39 t42 t43))
+(anchor :step t45 :args ((:= (veriT_vr38 A_b_c_M_state_fun$) veriT_vr84) (:= (veriT_vr39 A_b_c_M_state_fun$) veriT_vr85)))
+(anchor :step t45.t1 :args ((:= (veriT_vr40 A$) veriT_vr86) (:= (veriT_vr41 C$) veriT_vr87)))
+(step t45.t1.t1 (cl (! (= veriT_vr38 veriT_vr84) :named @p_876)) :rule refl)
+(step t45.t1.t2 (cl (! (= veriT_vr40 veriT_vr86) :named @p_872)) :rule refl)
+(step t45.t1.t3 (cl (! (= @p_446 (! (fun_app$ veriT_vr84 veriT_vr86) :named @p_871)) :named @p_877)) :rule cong :premises (t45.t1.t1 t45.t1.t2))
+(step t45.t1.t4 (cl (! (= veriT_vr41 veriT_vr87) :named @p_874)) :rule refl)
+(step t45.t1.t5 (cl (! (= @p_439 (! (run$ @p_871 veriT_vr87) :named @p_864)) :named @p_878)) :rule cong :premises (t45.t1.t3 t45.t1.t4))
+(step t45.t1.t6 (cl (! (= @p_437 (! (is_fail$ @p_864) :named @p_862)) :named @p_879)) :rule cong :premises (t45.t1.t5))
+(step t45.t1.t7 (cl (! (= veriT_vr39 veriT_vr85) :named @p_882)) :rule refl)
+(step t45.t1.t8 (cl @p_872) :rule refl)
+(step t45.t1.t9 (cl (! (= @p_448 (! (fun_app$ veriT_vr85 veriT_vr86) :named @p_873)) :named @p_883)) :rule cong :premises (t45.t1.t7 t45.t1.t8))
+(step t45.t1.t10 (cl @p_874) :rule refl)
+(step t45.t1.t11 (cl (! (= @p_438 (! (run$ @p_873 veriT_vr87) :named @p_863)) :named @p_884)) :rule cong :premises (t45.t1.t9 t45.t1.t10))
+(step t45.t1.t12 (cl (= @p_450 (! (is_fail$ @p_863) :named @p_875))) :rule cong :premises (t45.t1.t11))
+(step t45.t1.t13 (cl @p_876) :rule refl)
+(step t45.t1.t14 (cl @p_872) :rule refl)
+(step t45.t1.t15 (cl @p_877) :rule cong :premises (t45.t1.t13 t45.t1.t14))
+(step t45.t1.t16 (cl @p_874) :rule refl)
+(step t45.t1.t17 (cl @p_878) :rule cong :premises (t45.t1.t15 t45.t1.t16))
+(step t45.t1.t18 (cl @p_879) :rule cong :premises (t45.t1.t17))
+(step t45.t1.t19 (cl (= @p_455 (! (= @p_875 @p_862) :named @p_880))) :rule cong :premises (t45.t1.t12 t45.t1.t18))
+(anchor :step t45.t1.t20 :args ((:= (veriT_vr42 B$) veriT_vr88) (:= (veriT_vr43 C$) veriT_vr89)))
+(step t45.t1.t20.t1 (cl @p_882) :rule refl)
+(step t45.t1.t20.t2 (cl @p_872) :rule refl)
+(step t45.t1.t20.t3 (cl @p_883) :rule cong :premises (t45.t1.t20.t1 t45.t1.t20.t2))
+(step t45.t1.t20.t4 (cl @p_874) :rule refl)
+(step t45.t1.t20.t5 (cl @p_884) :rule cong :premises (t45.t1.t20.t3 t45.t1.t20.t4))
+(step t45.t1.t20.t6 (cl (! (= veriT_vr42 veriT_vr88) :named @p_886)) :rule refl)
+(step t45.t1.t20.t7 (cl (! (= veriT_vr43 veriT_vr89) :named @p_887)) :rule refl)
+(step t45.t1.t20.t8 (cl (! (= @p_440 (! (pair$ veriT_vr88 veriT_vr89) :named @p_865)) :named @p_888)) :rule cong :premises (t45.t1.t20.t6 t45.t1.t20.t7))
+(step t45.t1.t20.t9 (cl (= @p_460 (! (is_res$ @p_863 @p_865) :named @p_885))) :rule cong :premises (t45.t1.t20.t5 t45.t1.t20.t8))
+(step t45.t1.t20.t10 (cl @p_876) :rule refl)
+(step t45.t1.t20.t11 (cl @p_872) :rule refl)
+(step t45.t1.t20.t12 (cl @p_877) :rule cong :premises (t45.t1.t20.t10 t45.t1.t20.t11))
+(step t45.t1.t20.t13 (cl @p_874) :rule refl)
+(step t45.t1.t20.t14 (cl @p_878) :rule cong :premises (t45.t1.t20.t12 t45.t1.t20.t13))
+(step t45.t1.t20.t15 (cl @p_886) :rule refl)
+(step t45.t1.t20.t16 (cl @p_887) :rule refl)
+(step t45.t1.t20.t17 (cl @p_888) :rule cong :premises (t45.t1.t20.t15 t45.t1.t20.t16))
+(step t45.t1.t20.t18 (cl (= @p_464 (! (is_res$ @p_864 @p_865) :named @p_889))) :rule cong :premises (t45.t1.t20.t14 t45.t1.t20.t17))
+(step t45.t1.t20.t19 (cl (= @p_465 (! (= @p_885 @p_889) :named @p_890))) :rule cong :premises (t45.t1.t20.t9 t45.t1.t20.t18))
+(step t45.t1.t20 (cl (= @p_456 (! (forall ((veriT_vr88 B$) (veriT_vr89 C$)) @p_890) :named @p_881))) :rule bind)
+(step t45.t1.t21 (cl (= @p_466 (! (and @p_880 @p_881) :named @p_891))) :rule cong :premises (t45.t1.t19 t45.t1.t20))
+(step t45.t1.t22 (cl (= @p_467 (! (or @p_862 @p_891) :named @p_892))) :rule cong :premises (t45.t1.t6 t45.t1.t21))
+(step t45.t1 (cl (= @p_445 (! (forall ((veriT_vr86 A$) (veriT_vr87 C$)) @p_892) :named @p_870))) :rule bind)
+(anchor :step t45.t2 :args ((:= (veriT_vr44 D$) veriT_vr90)))
+(step t45.t2.t1 (cl @p_876) :rule refl)
+(step t45.t2.t2 (cl (! (= @p_469 (! (b$ veriT_vr84) :named @p_894)) :named @p_898)) :rule cong :premises (t45.t2.t1))
+(step t45.t2.t3 (cl (! (= veriT_vr44 veriT_vr90) :named @p_896)) :rule refl)
+(step t45.t2.t4 (cl (! (= @p_443 (! (run$a @p_894 veriT_vr90) :named @p_868)) :named @p_899)) :rule cong :premises (t45.t2.t2 t45.t2.t3))
+(step t45.t2.t5 (cl (! (= @p_441 (! (is_fail$a @p_868) :named @p_866)) :named @p_900)) :rule cong :premises (t45.t2.t4))
+(step t45.t2.t6 (cl @p_882) :rule refl)
+(step t45.t2.t7 (cl (! (= @p_470 (! (b$ veriT_vr85) :named @p_895)) :named @p_903)) :rule cong :premises (t45.t2.t6))
+(step t45.t2.t8 (cl @p_896) :rule refl)
+(step t45.t2.t9 (cl (! (= @p_442 (! (run$a @p_895 veriT_vr90) :named @p_867)) :named @p_904)) :rule cong :premises (t45.t2.t7 t45.t2.t8))
+(step t45.t2.t10 (cl (= @p_472 (! (is_fail$a @p_867) :named @p_897))) :rule cong :premises (t45.t2.t9))
+(step t45.t2.t11 (cl @p_876) :rule refl)
+(step t45.t2.t12 (cl @p_898) :rule cong :premises (t45.t2.t11))
+(step t45.t2.t13 (cl @p_896) :rule refl)
+(step t45.t2.t14 (cl @p_899) :rule cong :premises (t45.t2.t12 t45.t2.t13))
+(step t45.t2.t15 (cl @p_900) :rule cong :premises (t45.t2.t14))
+(step t45.t2.t16 (cl (= @p_476 (! (= @p_897 @p_866) :named @p_901))) :rule cong :premises (t45.t2.t10 t45.t2.t15))
+(anchor :step t45.t2.t17 :args ((:= (veriT_vr45 E$) veriT_vr91) (:= (veriT_vr46 D$) veriT_vr92)))
+(step t45.t2.t17.t1 (cl @p_882) :rule refl)
+(step t45.t2.t17.t2 (cl @p_903) :rule cong :premises (t45.t2.t17.t1))
+(step t45.t2.t17.t3 (cl @p_896) :rule refl)
+(step t45.t2.t17.t4 (cl @p_904) :rule cong :premises (t45.t2.t17.t2 t45.t2.t17.t3))
+(step t45.t2.t17.t5 (cl (! (= veriT_vr45 veriT_vr91) :named @p_906)) :rule refl)
+(step t45.t2.t17.t6 (cl (! (= veriT_vr46 veriT_vr92) :named @p_907)) :rule refl)
+(step t45.t2.t17.t7 (cl (! (= @p_444 (! (pair$a veriT_vr91 veriT_vr92) :named @p_869)) :named @p_908)) :rule cong :premises (t45.t2.t17.t5 t45.t2.t17.t6))
+(step t45.t2.t17.t8 (cl (= @p_480 (! (is_res$a @p_867 @p_869) :named @p_905))) :rule cong :premises (t45.t2.t17.t4 t45.t2.t17.t7))
+(step t45.t2.t17.t9 (cl @p_876) :rule refl)
+(step t45.t2.t17.t10 (cl @p_898) :rule cong :premises (t45.t2.t17.t9))
+(step t45.t2.t17.t11 (cl @p_896) :rule refl)
+(step t45.t2.t17.t12 (cl @p_899) :rule cong :premises (t45.t2.t17.t10 t45.t2.t17.t11))
+(step t45.t2.t17.t13 (cl @p_906) :rule refl)
+(step t45.t2.t17.t14 (cl @p_907) :rule refl)
+(step t45.t2.t17.t15 (cl @p_908) :rule cong :premises (t45.t2.t17.t13 t45.t2.t17.t14))
+(step t45.t2.t17.t16 (cl (= @p_484 (! (is_res$a @p_868 @p_869) :named @p_909))) :rule cong :premises (t45.t2.t17.t12 t45.t2.t17.t15))
+(step t45.t2.t17.t17 (cl (= @p_485 (! (= @p_905 @p_909) :named @p_910))) :rule cong :premises (t45.t2.t17.t8 t45.t2.t17.t16))
+(step t45.t2.t17 (cl (= @p_477 (! (forall ((veriT_vr91 E$) (veriT_vr92 D$)) @p_910) :named @p_902))) :rule bind)
+(step t45.t2.t18 (cl (= @p_486 (! (and @p_901 @p_902) :named @p_911))) :rule cong :premises (t45.t2.t16 t45.t2.t17))
+(step t45.t2.t19 (cl (= @p_487 (! (or @p_866 @p_911) :named @p_912))) :rule cong :premises (t45.t2.t5 t45.t2.t18))
+(step t45.t2 (cl (= @p_468 (! (forall ((veriT_vr90 D$)) @p_912) :named @p_893))) :rule bind)
+(step t45.t3 (cl (= @p_488 (! (=> @p_870 @p_893) :named @p_913))) :rule cong :premises (t45.t1 t45.t2))
+(step t45 (cl (= @p_691 (! (forall ((veriT_vr84 A_b_c_M_state_fun$) (veriT_vr85 A_b_c_M_state_fun$)) @p_913) :named @p_1018))) :rule bind)
+(anchor :step t46 :args ((:= (veriT_vr47 E$) veriT_vr91) (:= (veriT_vr48 A_b_c_M_state_fun$) veriT_vr84) (:= (veriT_vr49 A_b_c_M_state_fun$) veriT_vr85)))
+(anchor :step t46.t1 :args ((:= (veriT_vr50 A$) veriT_vr86) (:= (veriT_vr51 C$) veriT_vr87)))
+(step t46.t1.t1 (cl (! (= veriT_vr48 veriT_vr84) :named @p_920)) :rule refl)
+(step t46.t1.t2 (cl (! (= veriT_vr50 veriT_vr86) :named @p_918)) :rule refl)
+(step t46.t1.t3 (cl (! (= @p_498 @p_871) :named @p_921)) :rule cong :premises (t46.t1.t1 t46.t1.t2))
+(step t46.t1.t4 (cl (! (= veriT_vr51 veriT_vr87) :named @p_919)) :rule refl)
+(step t46.t1.t5 (cl (! (= @p_491 @p_864) :named @p_922)) :rule cong :premises (t46.t1.t3 t46.t1.t4))
+(step t46.t1.t6 (cl (! (= @p_489 @p_862) :named @p_923)) :rule cong :premises (t46.t1.t5))
+(step t46.t1.t7 (cl (! (= veriT_vr49 veriT_vr85) :named @p_924)) :rule refl)
+(step t46.t1.t8 (cl @p_918) :rule refl)
+(step t46.t1.t9 (cl (! (= @p_500 @p_873) :named @p_925)) :rule cong :premises (t46.t1.t7 t46.t1.t8))
+(step t46.t1.t10 (cl @p_919) :rule refl)
+(step t46.t1.t11 (cl (! (= @p_490 @p_863) :named @p_926)) :rule cong :premises (t46.t1.t9 t46.t1.t10))
+(step t46.t1.t12 (cl (= @p_502 @p_875)) :rule cong :premises (t46.t1.t11))
+(step t46.t1.t13 (cl @p_920) :rule refl)
+(step t46.t1.t14 (cl @p_918) :rule refl)
+(step t46.t1.t15 (cl @p_921) :rule cong :premises (t46.t1.t13 t46.t1.t14))
+(step t46.t1.t16 (cl @p_919) :rule refl)
+(step t46.t1.t17 (cl @p_922) :rule cong :premises (t46.t1.t15 t46.t1.t16))
+(step t46.t1.t18 (cl @p_923) :rule cong :premises (t46.t1.t17))
+(step t46.t1.t19 (cl (= @p_507 @p_880)) :rule cong :premises (t46.t1.t12 t46.t1.t18))
+(anchor :step t46.t1.t20 :args ((:= (veriT_vr52 B$) veriT_vr88) (:= (veriT_vr53 C$) veriT_vr89)))
+(step t46.t1.t20.t1 (cl @p_924) :rule refl)
+(step t46.t1.t20.t2 (cl @p_918) :rule refl)
+(step t46.t1.t20.t3 (cl @p_925) :rule cong :premises (t46.t1.t20.t1 t46.t1.t20.t2))
+(step t46.t1.t20.t4 (cl @p_919) :rule refl)
+(step t46.t1.t20.t5 (cl @p_926) :rule cong :premises (t46.t1.t20.t3 t46.t1.t20.t4))
+(step t46.t1.t20.t6 (cl (! (= veriT_vr52 veriT_vr88) :named @p_927)) :rule refl)
+(step t46.t1.t20.t7 (cl (! (= veriT_vr53 veriT_vr89) :named @p_928)) :rule refl)
+(step t46.t1.t20.t8 (cl (! (= @p_492 @p_865) :named @p_929)) :rule cong :premises (t46.t1.t20.t6 t46.t1.t20.t7))
+(step t46.t1.t20.t9 (cl (= @p_512 @p_885)) :rule cong :premises (t46.t1.t20.t5 t46.t1.t20.t8))
+(step t46.t1.t20.t10 (cl @p_920) :rule refl)
+(step t46.t1.t20.t11 (cl @p_918) :rule refl)
+(step t46.t1.t20.t12 (cl @p_921) :rule cong :premises (t46.t1.t20.t10 t46.t1.t20.t11))
+(step t46.t1.t20.t13 (cl @p_919) :rule refl)
+(step t46.t1.t20.t14 (cl @p_922) :rule cong :premises (t46.t1.t20.t12 t46.t1.t20.t13))
+(step t46.t1.t20.t15 (cl @p_927) :rule refl)
+(step t46.t1.t20.t16 (cl @p_928) :rule refl)
+(step t46.t1.t20.t17 (cl @p_929) :rule cong :premises (t46.t1.t20.t15 t46.t1.t20.t16))
+(step t46.t1.t20.t18 (cl (= @p_516 @p_889)) :rule cong :premises (t46.t1.t20.t14 t46.t1.t20.t17))
+(step t46.t1.t20.t19 (cl (= @p_517 @p_890)) :rule cong :premises (t46.t1.t20.t9 t46.t1.t20.t18))
+(step t46.t1.t20 (cl (= @p_508 @p_881)) :rule bind)
+(step t46.t1.t21 (cl (= @p_518 @p_891)) :rule cong :premises (t46.t1.t19 t46.t1.t20))
+(step t46.t1.t22 (cl (= @p_519 @p_892)) :rule cong :premises (t46.t1.t6 t46.t1.t21))
+(step t46.t1 (cl (= @p_497 @p_870)) :rule bind)
+(anchor :step t46.t2 :args ((:= (veriT_vr54 D$) veriT_vr90)))
+(step t46.t2.t1 (cl (! (= veriT_vr47 veriT_vr91) :named @p_932)) :rule refl)
+(step t46.t2.t2 (cl @p_920) :rule refl)
+(step t46.t2.t3 (cl (! (= @p_521 (! (c$ veriT_vr91 veriT_vr84) :named @p_931)) :named @p_936)) :rule cong :premises (t46.t2.t1 t46.t2.t2))
+(step t46.t2.t4 (cl (! (= veriT_vr54 veriT_vr90) :named @p_934)) :rule refl)
+(step t46.t2.t5 (cl (! (= @p_495 (! (run$b @p_931 veriT_vr90) :named @p_916)) :named @p_937)) :rule cong :premises (t46.t2.t3 t46.t2.t4))
+(step t46.t2.t6 (cl (! (= @p_493 (! (is_fail$b @p_916) :named @p_914)) :named @p_938)) :rule cong :premises (t46.t2.t5))
+(step t46.t2.t7 (cl @p_932) :rule refl)
+(step t46.t2.t8 (cl @p_924) :rule refl)
+(step t46.t2.t9 (cl (! (= @p_523 (! (c$ veriT_vr91 veriT_vr85) :named @p_933)) :named @p_941)) :rule cong :premises (t46.t2.t7 t46.t2.t8))
+(step t46.t2.t10 (cl @p_934) :rule refl)
+(step t46.t2.t11 (cl (! (= @p_494 (! (run$b @p_933 veriT_vr90) :named @p_915)) :named @p_942)) :rule cong :premises (t46.t2.t9 t46.t2.t10))
+(step t46.t2.t12 (cl (= @p_525 (! (is_fail$b @p_915) :named @p_935))) :rule cong :premises (t46.t2.t11))
+(step t46.t2.t13 (cl @p_932) :rule refl)
+(step t46.t2.t14 (cl @p_920) :rule refl)
+(step t46.t2.t15 (cl @p_936) :rule cong :premises (t46.t2.t13 t46.t2.t14))
+(step t46.t2.t16 (cl @p_934) :rule refl)
+(step t46.t2.t17 (cl @p_937) :rule cong :premises (t46.t2.t15 t46.t2.t16))
+(step t46.t2.t18 (cl @p_938) :rule cong :premises (t46.t2.t17))
+(step t46.t2.t19 (cl (= @p_529 (! (= @p_935 @p_914) :named @p_939))) :rule cong :premises (t46.t2.t12 t46.t2.t18))
+(anchor :step t46.t2.t20 :args ((:= (veriT_vr55 F$) veriT_vr93) (:= (veriT_vr56 D$) veriT_vr92)))
+(step t46.t2.t20.t1 (cl @p_932) :rule refl)
+(step t46.t2.t20.t2 (cl @p_924) :rule refl)
+(step t46.t2.t20.t3 (cl @p_941) :rule cong :premises (t46.t2.t20.t1 t46.t2.t20.t2))
+(step t46.t2.t20.t4 (cl @p_934) :rule refl)
+(step t46.t2.t20.t5 (cl @p_942) :rule cong :premises (t46.t2.t20.t3 t46.t2.t20.t4))
+(step t46.t2.t20.t6 (cl (! (= veriT_vr55 veriT_vr93) :named @p_944)) :rule refl)
+(step t46.t2.t20.t7 (cl (! (= veriT_vr56 veriT_vr92) :named @p_945)) :rule refl)
+(step t46.t2.t20.t8 (cl (! (= @p_496 (! (pair$b veriT_vr93 veriT_vr92) :named @p_917)) :named @p_946)) :rule cong :premises (t46.t2.t20.t6 t46.t2.t20.t7))
+(step t46.t2.t20.t9 (cl (= @p_533 (! (is_res$b @p_915 @p_917) :named @p_943))) :rule cong :premises (t46.t2.t20.t5 t46.t2.t20.t8))
+(step t46.t2.t20.t10 (cl @p_932) :rule refl)
+(step t46.t2.t20.t11 (cl @p_920) :rule refl)
+(step t46.t2.t20.t12 (cl @p_936) :rule cong :premises (t46.t2.t20.t10 t46.t2.t20.t11))
+(step t46.t2.t20.t13 (cl @p_934) :rule refl)
+(step t46.t2.t20.t14 (cl @p_937) :rule cong :premises (t46.t2.t20.t12 t46.t2.t20.t13))
+(step t46.t2.t20.t15 (cl @p_944) :rule refl)
+(step t46.t2.t20.t16 (cl @p_945) :rule refl)
+(step t46.t2.t20.t17 (cl @p_946) :rule cong :premises (t46.t2.t20.t15 t46.t2.t20.t16))
+(step t46.t2.t20.t18 (cl (= @p_537 (! (is_res$b @p_916 @p_917) :named @p_947))) :rule cong :premises (t46.t2.t20.t14 t46.t2.t20.t17))
+(step t46.t2.t20.t19 (cl (= @p_538 (! (= @p_943 @p_947) :named @p_948))) :rule cong :premises (t46.t2.t20.t9 t46.t2.t20.t18))
+(step t46.t2.t20 (cl (= @p_530 (! (forall ((veriT_vr93 F$) (veriT_vr92 D$)) @p_948) :named @p_940))) :rule bind)
+(step t46.t2.t21 (cl (= @p_539 (! (and @p_939 @p_940) :named @p_949))) :rule cong :premises (t46.t2.t19 t46.t2.t20))
+(step t46.t2.t22 (cl (= @p_540 (! (or @p_914 @p_949) :named @p_950))) :rule cong :premises (t46.t2.t6 t46.t2.t21))
+(step t46.t2 (cl (= @p_520 (! (forall ((veriT_vr90 D$)) @p_950) :named @p_930))) :rule bind)
+(step t46.t3 (cl (= @p_541 (! (=> @p_870 @p_930) :named @p_951))) :rule cong :premises (t46.t1 t46.t2))
+(step t46 (cl (= @p_692 (! (forall ((veriT_vr91 E$) (veriT_vr84 A_b_c_M_state_fun$) (veriT_vr85 A_b_c_M_state_fun$)) @p_951) :named @p_1019))) :rule bind)
+(anchor :step t47 :args ((:= (veriT_vr59 A$) veriT_vr86) (:= (veriT_vr60 C$) veriT_vr87)))
+(step t47.t1 (cl (! (= veriT_vr59 veriT_vr86) :named @p_956)) :rule refl)
+(step t47.t2 (cl (! (= @p_751 (! (fun_app$ veriT_sk0 veriT_vr86) :named @p_955)) :named @p_960)) :rule cong :premises (t47.t1))
+(step t47.t3 (cl (! (= veriT_vr60 veriT_vr87) :named @p_958)) :rule refl)
+(step t47.t4 (cl (! (= @p_703 (! (run$ @p_955 veriT_vr87) :named @p_954)) :named @p_961)) :rule cong :premises (t47.t2 t47.t3))
+(step t47.t5 (cl (! (= @p_701 (! (is_fail$ @p_954) :named @p_952)) :named @p_962)) :rule cong :premises (t47.t4))
+(step t47.t6 (cl @p_956) :rule refl)
+(step t47.t7 (cl (! (= @p_752 (! (fun_app$ veriT_sk1 veriT_vr86) :named @p_957)) :named @p_965)) :rule cong :premises (t47.t6))
+(step t47.t8 (cl @p_958) :rule refl)
+(step t47.t9 (cl (! (= @p_702 (! (run$ @p_957 veriT_vr87) :named @p_953)) :named @p_966)) :rule cong :premises (t47.t7 t47.t8))
+(step t47.t10 (cl (= @p_753 (! (is_fail$ @p_953) :named @p_959))) :rule cong :premises (t47.t9))
+(step t47.t11 (cl @p_956) :rule refl)
+(step t47.t12 (cl @p_960) :rule cong :premises (t47.t11))
+(step t47.t13 (cl @p_958) :rule refl)
+(step t47.t14 (cl @p_961) :rule cong :premises (t47.t12 t47.t13))
+(step t47.t15 (cl @p_962) :rule cong :premises (t47.t14))
+(step t47.t16 (cl (= @p_758 (! (= @p_959 @p_952) :named @p_963))) :rule cong :premises (t47.t10 t47.t15))
+(anchor :step t47.t17 :args ((:= (veriT_vr61 B$) veriT_vr88) (:= (veriT_vr62 C$) veriT_vr89)))
+(step t47.t17.t1 (cl @p_956) :rule refl)
+(step t47.t17.t2 (cl @p_965) :rule cong :premises (t47.t17.t1))
+(step t47.t17.t3 (cl @p_958) :rule refl)
+(step t47.t17.t4 (cl @p_966) :rule cong :premises (t47.t17.t2 t47.t17.t3))
+(step t47.t17.t5 (cl (! (= veriT_vr61 veriT_vr88) :named @p_968)) :rule refl)
+(step t47.t17.t6 (cl (! (= veriT_vr62 veriT_vr89) :named @p_969)) :rule refl)
+(step t47.t17.t7 (cl (! (= @p_545 @p_865) :named @p_970)) :rule cong :premises (t47.t17.t5 t47.t17.t6))
+(step t47.t17.t8 (cl (= @p_763 (! (is_res$ @p_953 @p_865) :named @p_967))) :rule cong :premises (t47.t17.t4 t47.t17.t7))
+(step t47.t17.t9 (cl @p_956) :rule refl)
+(step t47.t17.t10 (cl @p_960) :rule cong :premises (t47.t17.t9))
+(step t47.t17.t11 (cl @p_958) :rule refl)
+(step t47.t17.t12 (cl @p_961) :rule cong :premises (t47.t17.t10 t47.t17.t11))
+(step t47.t17.t13 (cl @p_968) :rule refl)
+(step t47.t17.t14 (cl @p_969) :rule refl)
+(step t47.t17.t15 (cl @p_970) :rule cong :premises (t47.t17.t13 t47.t17.t14))
+(step t47.t17.t16 (cl (= @p_764 (! (is_res$ @p_954 @p_865) :named @p_971))) :rule cong :premises (t47.t17.t12 t47.t17.t15))
+(step t47.t17.t17 (cl (= @p_765 (! (= @p_967 @p_971) :named @p_972))) :rule cong :premises (t47.t17.t8 t47.t17.t16))
+(step t47.t17 (cl (= @p_759 (! (forall ((veriT_vr88 B$) (veriT_vr89 C$)) @p_972) :named @p_964))) :rule bind)
+(step t47.t18 (cl (= @p_766 (! (and @p_963 @p_964) :named @p_973))) :rule cong :premises (t47.t16 t47.t17))
+(step t47.t19 (cl (= @p_767 (! (or @p_952 @p_973) :named @p_974))) :rule cong :premises (t47.t5 t47.t18))
+(step t47 (cl (= @p_750 (! (forall ((veriT_vr86 A$) (veriT_vr87 C$)) @p_974) :named @p_1015))) :rule bind)
+(anchor :step t48 :args ((:= (veriT_vr64 E$) veriT_vr91) (:= (veriT_vr65 D$) veriT_vr90)))
+(step t48.t1 (cl (! (= veriT_vr64 veriT_vr91) :named @p_977)) :rule refl)
+(step t48.t2 (cl (! (= veriT_vr65 veriT_vr90) :named @p_979)) :rule refl)
+(step t48.t3 (cl (= @p_580 (! (pair$a veriT_vr91 veriT_vr90) :named @p_975))) :rule cong :premises (t48.t1 t48.t2))
+(step t48.t4 (cl (= @p_774 (! (is_res$a @p_712 @p_975) :named @p_976))) :rule cong :premises (t48.t3))
+(step t48.t5 (cl @p_977) :rule refl)
+(step t48.t6 (cl (= @p_775 (! (c$ veriT_vr91 veriT_sk0) :named @p_978))) :rule cong :premises (t48.t5))
+(step t48.t7 (cl @p_979) :rule refl)
+(step t48.t8 (cl (= @p_776 (! (run$b @p_978 veriT_vr90) :named @p_980))) :rule cong :premises (t48.t6 t48.t7))
+(step t48.t9 (cl (= @p_777 (! (is_fail$b @p_980) :named @p_981))) :rule cong :premises (t48.t8))
+(step t48.t10 (cl (= @p_778 (! (and @p_976 @p_981) :named @p_982))) :rule cong :premises (t48.t4 t48.t9))
+(step t48 (cl (= @p_770 (! (exists ((veriT_vr91 E$) (veriT_vr90 D$)) @p_982) :named @p_983))) :rule bind)
+(anchor :step t49 :args ((:= (veriT_vr68 E$) veriT_vr91) (:= (veriT_vr69 D$) veriT_vr90)))
+(step t49.t1 (cl (! (= veriT_vr68 veriT_vr91) :named @p_984)) :rule refl)
+(step t49.t2 (cl (! (= veriT_vr69 veriT_vr90) :named @p_985)) :rule refl)
+(step t49.t3 (cl (= @p_603 @p_975)) :rule cong :premises (t49.t1 t49.t2))
+(step t49.t4 (cl (= @p_793 @p_976)) :rule cong :premises (t49.t3))
+(step t49.t5 (cl @p_984) :rule refl)
+(step t49.t6 (cl (= @p_794 @p_978)) :rule cong :premises (t49.t5))
+(step t49.t7 (cl @p_985) :rule refl)
+(step t49.t8 (cl (= @p_795 @p_980)) :rule cong :premises (t49.t6 t49.t7))
+(step t49.t9 (cl (= @p_796 @p_981)) :rule cong :premises (t49.t8))
+(step t49.t10 (cl (= @p_797 @p_982)) :rule cong :premises (t49.t4 t49.t9))
+(step t49 (cl (= @p_792 @p_983)) :rule bind)
+(step t50 (cl (= @p_798 (! (or @p_720 @p_983) :named @p_986))) :rule cong :premises (t49))
+(step t51 (cl (= @p_799 (! (=> @p_790 @p_986) :named @p_996))) :rule cong :premises (t50))
+(anchor :step t52 :args ((:= (veriT_vr72 E$) veriT_vr91) (:= (veriT_vr73 D$) veriT_vr90)))
+(step t52.t1 (cl (! (= veriT_vr72 veriT_vr91) :named @p_988)) :rule refl)
+(step t52.t2 (cl (! (= veriT_vr73 veriT_vr90) :named @p_990)) :rule refl)
+(step t52.t3 (cl (= @p_626 @p_975)) :rule cong :premises (t52.t1 t52.t2))
+(step t52.t4 (cl (= @p_811 (! (is_res$a @p_714 @p_975) :named @p_987))) :rule cong :premises (t52.t3))
+(step t52.t5 (cl @p_988) :rule refl)
+(step t52.t6 (cl (= @p_812 (! (c$ veriT_vr91 veriT_sk1) :named @p_989))) :rule cong :premises (t52.t5))
+(step t52.t7 (cl @p_990) :rule refl)
+(step t52.t8 (cl (= @p_813 (! (run$b @p_989 veriT_vr90) :named @p_991))) :rule cong :premises (t52.t6 t52.t7))
+(step t52.t9 (cl (= @p_814 (! (is_fail$b @p_991) :named @p_992))) :rule cong :premises (t52.t8))
+(step t52.t10 (cl (= @p_815 (! (and @p_987 @p_992) :named @p_993))) :rule cong :premises (t52.t4 t52.t9))
+(step t52 (cl (= @p_810 (! (exists ((veriT_vr91 E$) (veriT_vr90 D$)) @p_993) :named @p_994))) :rule bind)
+(step t53 (cl (= @p_816 (! (or @p_726 @p_994) :named @p_995))) :rule cong :premises (t52))
+(step t54 (cl (= @p_817 (! (=> @p_808 @p_995) :named @p_997))) :rule cong :premises (t53))
+(step t55 (cl (= @p_818 (! (and @p_996 @p_997) :named @p_1012))) :rule cong :premises (t51 t54))
+(anchor :step t56 :args ((:= (veriT_vr78 E$) veriT_vr91) (:= (veriT_vr79 D$) veriT_vr90)))
+(step t56.t1 (cl (! (= veriT_vr78 veriT_vr91) :named @p_998)) :rule refl)
+(step t56.t2 (cl (! (= veriT_vr79 veriT_vr90) :named @p_999)) :rule refl)
+(step t56.t3 (cl (= @p_650 @p_975)) :rule cong :premises (t56.t1 t56.t2))
+(step t56.t4 (cl (= @p_830 @p_976)) :rule cong :premises (t56.t3))
+(step t56.t5 (cl @p_998) :rule refl)
+(step t56.t6 (cl (= @p_831 @p_978)) :rule cong :premises (t56.t5))
+(step t56.t7 (cl @p_999) :rule refl)
+(step t56.t8 (cl (= @p_832 @p_980)) :rule cong :premises (t56.t6 t56.t7))
+(step t56.t9 (cl (= @p_836 (! (is_res$b @p_980 @p_747) :named @p_1000))) :rule cong :premises (t56.t8))
+(step t56.t10 (cl (= @p_837 (! (and @p_976 @p_1000) :named @p_1001))) :rule cong :premises (t56.t4 t56.t9))
+(step t56 (cl (= @p_829 (! (exists ((veriT_vr91 E$) (veriT_vr90 D$)) @p_1001) :named @p_1002))) :rule bind)
+(step t57 (cl (= @p_838 (! (or @p_720 @p_1002) :named @p_1003))) :rule cong :premises (t56))
+(step t58 (cl (= @p_839 (! (=> @p_828 @p_1003) :named @p_1010))) :rule cong :premises (t57))
+(anchor :step t59 :args ((:= (veriT_vr82 E$) veriT_vr91) (:= (veriT_vr83 D$) veriT_vr90)))
+(step t59.t1 (cl (! (= veriT_vr82 veriT_vr91) :named @p_1004)) :rule refl)
+(step t59.t2 (cl (! (= veriT_vr83 veriT_vr90) :named @p_1005)) :rule refl)
+(step t59.t3 (cl (= @p_675 @p_975)) :rule cong :premises (t59.t1 t59.t2))
+(step t59.t4 (cl (= @p_850 @p_987)) :rule cong :premises (t59.t3))
+(step t59.t5 (cl @p_1004) :rule refl)
+(step t59.t6 (cl (= @p_851 @p_989)) :rule cong :premises (t59.t5))
+(step t59.t7 (cl @p_1005) :rule refl)
+(step t59.t8 (cl (= @p_852 @p_991)) :rule cong :premises (t59.t6 t59.t7))
+(step t59.t9 (cl (= @p_853 (! (is_res$b @p_991 @p_747) :named @p_1006))) :rule cong :premises (t59.t8))
+(step t59.t10 (cl (= @p_854 (! (and @p_987 @p_1006) :named @p_1007))) :rule cong :premises (t59.t4 t59.t9))
+(step t59 (cl (= @p_849 (! (exists ((veriT_vr91 E$) (veriT_vr90 D$)) @p_1007) :named @p_1008))) :rule bind)
+(step t60 (cl (= @p_855 (! (or @p_726 @p_1008) :named @p_1009))) :rule cong :premises (t59))
+(step t61 (cl (= @p_856 (! (=> @p_848 @p_1009) :named @p_1011))) :rule cong :premises (t60))
+(step t62 (cl (= @p_819 (! (and @p_1010 @p_1011) :named @p_1013))) :rule cong :premises (t58 t61))
+(step t63 (cl (= @p_857 (! (and @p_1012 @p_1013) :named @p_1014))) :rule cong :premises (t55 t62))
+(step t64 (cl (= @p_768 (! (or @p_720 @p_983 @p_1014) :named @p_1016))) :rule cong :premises (t48 t63))
+(step t65 (cl (= @p_858 (! (=> @p_1015 @p_1016) :named @p_1017))) :rule cong :premises (t47 t64))
+(step t66 (cl (= @p_859 (! (not @p_1017) :named @p_1020))) :rule cong :premises (t65))
+(step t67 (cl (! (= @p_861 (! (and @p_1018 @p_1019 @p_1020) :named @p_1022)) :named @p_1021)) :rule cong :premises (t45 t46 t66))
+(step t68 (cl (not @p_1021) (not @p_861) @p_1022) :rule equiv_pos2)
+(step t69 (cl @p_1022) :rule th_resolution :premises (t44 t67 t68))
+(step t70 (cl (= @p_1020 (! (and @p_1015 (! (not @p_1016) :named @p_1027)) :named @p_1023))) :rule bool_simplify)
+(step t71 (cl (! (= @p_1022 (! (and @p_1018 @p_1019 @p_1023) :named @p_1025)) :named @p_1024)) :rule cong :premises (t70))
+(step t72 (cl (not @p_1024) (not @p_1022) @p_1025) :rule equiv_pos2)
+(step t73 (cl @p_1025) :rule th_resolution :premises (t69 t71 t72))
+(step t74 (cl (= @p_1014 (! (and @p_996 @p_997 @p_1010 @p_1011) :named @p_1026))) :rule ac_simp)
+(step t75 (cl (= @p_1016 (! (or @p_720 @p_983 @p_1026) :named @p_1028))) :rule ac_simp :premises (t74))
+(step t76 (cl (= @p_1027 (! (not @p_1028) :named @p_1029))) :rule cong :premises (t75))
+(step t77 (cl (! (= @p_1025 (! (and @p_1018 @p_1019 @p_1015 @p_1029) :named @p_1031)) :named @p_1030)) :rule ac_simp :premises (t76))
+(step t78 (cl (not @p_1030) (not @p_1025) @p_1031) :rule equiv_pos2)
+(step t79 (cl @p_1031) :rule th_resolution :premises (t73 t77 t78))
+(anchor :step t80 :args ((:= (veriT_vr91 E$) veriT_vr94) (:= (veriT_vr84 A_b_c_M_state_fun$) veriT_vr95) (:= (veriT_vr85 A_b_c_M_state_fun$) veriT_vr96)))
+(anchor :step t80.t1 :args ((:= (veriT_vr86 A$) veriT_vr97) (:= (veriT_vr87 C$) veriT_vr98)))
+(step t80.t1.t1 (cl (! (= veriT_vr84 veriT_vr95) :named @p_1046)) :rule refl)
+(step t80.t1.t2 (cl (! (= veriT_vr86 veriT_vr97) :named @p_1042)) :rule refl)
+(step t80.t1.t3 (cl (! (= @p_871 (! (fun_app$ veriT_vr95 veriT_vr97) :named @p_1041)) :named @p_1047)) :rule cong :premises (t80.t1.t1 t80.t1.t2))
+(step t80.t1.t4 (cl (! (= veriT_vr87 veriT_vr98) :named @p_1044)) :rule refl)
+(step t80.t1.t5 (cl (! (= @p_864 (! (run$ @p_1041 veriT_vr98) :named @p_1034)) :named @p_1048)) :rule cong :premises (t80.t1.t3 t80.t1.t4))
+(step t80.t1.t6 (cl (! (= @p_862 (! (is_fail$ @p_1034) :named @p_1032)) :named @p_1049)) :rule cong :premises (t80.t1.t5))
+(step t80.t1.t7 (cl (! (= veriT_vr85 veriT_vr96) :named @p_1052)) :rule refl)
+(step t80.t1.t8 (cl @p_1042) :rule refl)
+(step t80.t1.t9 (cl (! (= @p_873 (! (fun_app$ veriT_vr96 veriT_vr97) :named @p_1043)) :named @p_1053)) :rule cong :premises (t80.t1.t7 t80.t1.t8))
+(step t80.t1.t10 (cl @p_1044) :rule refl)
+(step t80.t1.t11 (cl (! (= @p_863 (! (run$ @p_1043 veriT_vr98) :named @p_1033)) :named @p_1054)) :rule cong :premises (t80.t1.t9 t80.t1.t10))
+(step t80.t1.t12 (cl (= @p_875 (! (is_fail$ @p_1033) :named @p_1045))) :rule cong :premises (t80.t1.t11))
+(step t80.t1.t13 (cl @p_1046) :rule refl)
+(step t80.t1.t14 (cl @p_1042) :rule refl)
+(step t80.t1.t15 (cl @p_1047) :rule cong :premises (t80.t1.t13 t80.t1.t14))
+(step t80.t1.t16 (cl @p_1044) :rule refl)
+(step t80.t1.t17 (cl @p_1048) :rule cong :premises (t80.t1.t15 t80.t1.t16))
+(step t80.t1.t18 (cl @p_1049) :rule cong :premises (t80.t1.t17))
+(step t80.t1.t19 (cl (= @p_880 (! (= @p_1045 @p_1032) :named @p_1050))) :rule cong :premises (t80.t1.t12 t80.t1.t18))
+(anchor :step t80.t1.t20 :args ((:= (veriT_vr88 B$) veriT_vr99) (:= (veriT_vr89 C$) veriT_vr100)))
+(step t80.t1.t20.t1 (cl @p_1052) :rule refl)
+(step t80.t1.t20.t2 (cl @p_1042) :rule refl)
+(step t80.t1.t20.t3 (cl @p_1053) :rule cong :premises (t80.t1.t20.t1 t80.t1.t20.t2))
+(step t80.t1.t20.t4 (cl @p_1044) :rule refl)
+(step t80.t1.t20.t5 (cl @p_1054) :rule cong :premises (t80.t1.t20.t3 t80.t1.t20.t4))
+(step t80.t1.t20.t6 (cl (! (= veriT_vr88 veriT_vr99) :named @p_1056)) :rule refl)
+(step t80.t1.t20.t7 (cl (! (= veriT_vr89 veriT_vr100) :named @p_1057)) :rule refl)
+(step t80.t1.t20.t8 (cl (! (= @p_865 (! (pair$ veriT_vr99 veriT_vr100) :named @p_1035)) :named @p_1058)) :rule cong :premises (t80.t1.t20.t6 t80.t1.t20.t7))
+(step t80.t1.t20.t9 (cl (= @p_885 (! (is_res$ @p_1033 @p_1035) :named @p_1055))) :rule cong :premises (t80.t1.t20.t5 t80.t1.t20.t8))
+(step t80.t1.t20.t10 (cl @p_1046) :rule refl)
+(step t80.t1.t20.t11 (cl @p_1042) :rule refl)
+(step t80.t1.t20.t12 (cl @p_1047) :rule cong :premises (t80.t1.t20.t10 t80.t1.t20.t11))
+(step t80.t1.t20.t13 (cl @p_1044) :rule refl)
+(step t80.t1.t20.t14 (cl @p_1048) :rule cong :premises (t80.t1.t20.t12 t80.t1.t20.t13))
+(step t80.t1.t20.t15 (cl @p_1056) :rule refl)
+(step t80.t1.t20.t16 (cl @p_1057) :rule refl)
+(step t80.t1.t20.t17 (cl @p_1058) :rule cong :premises (t80.t1.t20.t15 t80.t1.t20.t16))
+(step t80.t1.t20.t18 (cl (= @p_889 (! (is_res$ @p_1034 @p_1035) :named @p_1059))) :rule cong :premises (t80.t1.t20.t14 t80.t1.t20.t17))
+(step t80.t1.t20.t19 (cl (= @p_890 (! (= @p_1055 @p_1059) :named @p_1060))) :rule cong :premises (t80.t1.t20.t9 t80.t1.t20.t18))
+(step t80.t1.t20 (cl (= @p_881 (! (forall ((veriT_vr99 B$) (veriT_vr100 C$)) @p_1060) :named @p_1051))) :rule bind)
+(step t80.t1.t21 (cl (= @p_891 (! (and @p_1050 @p_1051) :named @p_1061))) :rule cong :premises (t80.t1.t19 t80.t1.t20))
+(step t80.t1.t22 (cl (= @p_892 (! (or @p_1032 @p_1061) :named @p_1062))) :rule cong :premises (t80.t1.t6 t80.t1.t21))
+(step t80.t1 (cl (= @p_870 (! (forall ((veriT_vr97 A$) (veriT_vr98 C$)) @p_1062) :named @p_1040))) :rule bind)
+(anchor :step t80.t2 :args ((:= (veriT_vr90 D$) veriT_vr101)))
+(step t80.t2.t1 (cl (! (= veriT_vr91 veriT_vr94) :named @p_1065)) :rule refl)
+(step t80.t2.t2 (cl @p_1046) :rule refl)
+(step t80.t2.t3 (cl (! (= @p_931 (! (c$ veriT_vr94 veriT_vr95) :named @p_1064)) :named @p_1069)) :rule cong :premises (t80.t2.t1 t80.t2.t2))
+(step t80.t2.t4 (cl (! (= veriT_vr90 veriT_vr101) :named @p_1067)) :rule refl)
+(step t80.t2.t5 (cl (! (= @p_916 (! (run$b @p_1064 veriT_vr101) :named @p_1038)) :named @p_1070)) :rule cong :premises (t80.t2.t3 t80.t2.t4))
+(step t80.t2.t6 (cl (! (= @p_914 (! (is_fail$b @p_1038) :named @p_1036)) :named @p_1071)) :rule cong :premises (t80.t2.t5))
+(step t80.t2.t7 (cl @p_1065) :rule refl)
+(step t80.t2.t8 (cl @p_1052) :rule refl)
+(step t80.t2.t9 (cl (! (= @p_933 (! (c$ veriT_vr94 veriT_vr96) :named @p_1066)) :named @p_1074)) :rule cong :premises (t80.t2.t7 t80.t2.t8))
+(step t80.t2.t10 (cl @p_1067) :rule refl)
+(step t80.t2.t11 (cl (! (= @p_915 (! (run$b @p_1066 veriT_vr101) :named @p_1037)) :named @p_1075)) :rule cong :premises (t80.t2.t9 t80.t2.t10))
+(step t80.t2.t12 (cl (= @p_935 (! (is_fail$b @p_1037) :named @p_1068))) :rule cong :premises (t80.t2.t11))
+(step t80.t2.t13 (cl @p_1065) :rule refl)
+(step t80.t2.t14 (cl @p_1046) :rule refl)
+(step t80.t2.t15 (cl @p_1069) :rule cong :premises (t80.t2.t13 t80.t2.t14))
+(step t80.t2.t16 (cl @p_1067) :rule refl)
+(step t80.t2.t17 (cl @p_1070) :rule cong :premises (t80.t2.t15 t80.t2.t16))
+(step t80.t2.t18 (cl @p_1071) :rule cong :premises (t80.t2.t17))
+(step t80.t2.t19 (cl (= @p_939 (! (= @p_1068 @p_1036) :named @p_1072))) :rule cong :premises (t80.t2.t12 t80.t2.t18))
+(anchor :step t80.t2.t20 :args ((:= (veriT_vr93 F$) veriT_vr93) (:= (veriT_vr92 D$) veriT_vr102)))
+(step t80.t2.t20.t1 (cl @p_1065) :rule refl)
+(step t80.t2.t20.t2 (cl @p_1052) :rule refl)
+(step t80.t2.t20.t3 (cl @p_1074) :rule cong :premises (t80.t2.t20.t1 t80.t2.t20.t2))
+(step t80.t2.t20.t4 (cl @p_1067) :rule refl)
+(step t80.t2.t20.t5 (cl @p_1075) :rule cong :premises (t80.t2.t20.t3 t80.t2.t20.t4))
+(step t80.t2.t20.t6 (cl (! (= veriT_vr92 veriT_vr102) :named @p_1077)) :rule refl)
+(step t80.t2.t20.t7 (cl (! (= @p_917 (! (pair$b veriT_vr93 veriT_vr102) :named @p_1039)) :named @p_1078)) :rule cong :premises (t80.t2.t20.t6))
+(step t80.t2.t20.t8 (cl (= @p_943 (! (is_res$b @p_1037 @p_1039) :named @p_1076))) :rule cong :premises (t80.t2.t20.t5 t80.t2.t20.t7))
+(step t80.t2.t20.t9 (cl @p_1065) :rule refl)
+(step t80.t2.t20.t10 (cl @p_1046) :rule refl)
+(step t80.t2.t20.t11 (cl @p_1069) :rule cong :premises (t80.t2.t20.t9 t80.t2.t20.t10))
+(step t80.t2.t20.t12 (cl @p_1067) :rule refl)
+(step t80.t2.t20.t13 (cl @p_1070) :rule cong :premises (t80.t2.t20.t11 t80.t2.t20.t12))
+(step t80.t2.t20.t14 (cl @p_1077) :rule refl)
+(step t80.t2.t20.t15 (cl @p_1078) :rule cong :premises (t80.t2.t20.t14))
+(step t80.t2.t20.t16 (cl (= @p_947 (! (is_res$b @p_1038 @p_1039) :named @p_1079))) :rule cong :premises (t80.t2.t20.t13 t80.t2.t20.t15))
+(step t80.t2.t20.t17 (cl (= @p_948 (! (= @p_1076 @p_1079) :named @p_1080))) :rule cong :premises (t80.t2.t20.t8 t80.t2.t20.t16))
+(step t80.t2.t20 (cl (= @p_940 (! (forall ((veriT_vr93 F$) (veriT_vr102 D$)) @p_1080) :named @p_1073))) :rule bind)
+(step t80.t2.t21 (cl (= @p_949 (! (and @p_1072 @p_1073) :named @p_1081))) :rule cong :premises (t80.t2.t19 t80.t2.t20))
+(step t80.t2.t22 (cl (= @p_950 (! (or @p_1036 @p_1081) :named @p_1082))) :rule cong :premises (t80.t2.t6 t80.t2.t21))
+(step t80.t2 (cl (= @p_930 (! (forall ((veriT_vr101 D$)) @p_1082) :named @p_1063))) :rule bind)
+(step t80.t3 (cl (= @p_951 (! (=> @p_1040 @p_1063) :named @p_1083))) :rule cong :premises (t80.t1 t80.t2))
+(step t80 (cl (= @p_1019 (! (forall ((veriT_vr94 E$) (veriT_vr95 A_b_c_M_state_fun$) (veriT_vr96 A_b_c_M_state_fun$)) @p_1083) :named @p_1154))) :rule bind)
+(anchor :step t81 :args ((:= (veriT_vr86 A$) veriT_vr103) (:= (veriT_vr87 C$) veriT_vr104)))
+(step t81.t1 (cl (! (= veriT_vr86 veriT_vr103) :named @p_1089)) :rule refl)
+(step t81.t2 (cl (! (= @p_955 (! (fun_app$ veriT_sk0 veriT_vr103) :named @p_1088)) :named @p_1093)) :rule cong :premises (t81.t1))
+(step t81.t3 (cl (! (= veriT_vr87 veriT_vr104) :named @p_1091)) :rule refl)
+(step t81.t4 (cl (! (= @p_954 (! (run$ @p_1088 veriT_vr104) :named @p_1086)) :named @p_1094)) :rule cong :premises (t81.t2 t81.t3))
+(step t81.t5 (cl (! (= @p_952 (! (is_fail$ @p_1086) :named @p_1084)) :named @p_1095)) :rule cong :premises (t81.t4))
+(step t81.t6 (cl @p_1089) :rule refl)
+(step t81.t7 (cl (! (= @p_957 (! (fun_app$ veriT_sk1 veriT_vr103) :named @p_1090)) :named @p_1098)) :rule cong :premises (t81.t6))
+(step t81.t8 (cl @p_1091) :rule refl)
+(step t81.t9 (cl (! (= @p_953 (! (run$ @p_1090 veriT_vr104) :named @p_1085)) :named @p_1099)) :rule cong :premises (t81.t7 t81.t8))
+(step t81.t10 (cl (= @p_959 (! (is_fail$ @p_1085) :named @p_1092))) :rule cong :premises (t81.t9))
+(step t81.t11 (cl @p_1089) :rule refl)
+(step t81.t12 (cl @p_1093) :rule cong :premises (t81.t11))
+(step t81.t13 (cl @p_1091) :rule refl)
+(step t81.t14 (cl @p_1094) :rule cong :premises (t81.t12 t81.t13))
+(step t81.t15 (cl @p_1095) :rule cong :premises (t81.t14))
+(step t81.t16 (cl (= @p_963 (! (= @p_1092 @p_1084) :named @p_1096))) :rule cong :premises (t81.t10 t81.t15))
+(anchor :step t81.t17 :args ((:= (veriT_vr88 B$) veriT_vr105) (:= (veriT_vr89 C$) veriT_vr106)))
+(step t81.t17.t1 (cl @p_1089) :rule refl)
+(step t81.t17.t2 (cl @p_1098) :rule cong :premises (t81.t17.t1))
+(step t81.t17.t3 (cl @p_1091) :rule refl)
+(step t81.t17.t4 (cl @p_1099) :rule cong :premises (t81.t17.t2 t81.t17.t3))
+(step t81.t17.t5 (cl (! (= veriT_vr88 veriT_vr105) :named @p_1101)) :rule refl)
+(step t81.t17.t6 (cl (! (= veriT_vr89 veriT_vr106) :named @p_1102)) :rule refl)
+(step t81.t17.t7 (cl (! (= @p_865 (! (pair$ veriT_vr105 veriT_vr106) :named @p_1087)) :named @p_1103)) :rule cong :premises (t81.t17.t5 t81.t17.t6))
+(step t81.t17.t8 (cl (= @p_967 (! (is_res$ @p_1085 @p_1087) :named @p_1100))) :rule cong :premises (t81.t17.t4 t81.t17.t7))
+(step t81.t17.t9 (cl @p_1089) :rule refl)
+(step t81.t17.t10 (cl @p_1093) :rule cong :premises (t81.t17.t9))
+(step t81.t17.t11 (cl @p_1091) :rule refl)
+(step t81.t17.t12 (cl @p_1094) :rule cong :premises (t81.t17.t10 t81.t17.t11))
+(step t81.t17.t13 (cl @p_1101) :rule refl)
+(step t81.t17.t14 (cl @p_1102) :rule refl)
+(step t81.t17.t15 (cl @p_1103) :rule cong :premises (t81.t17.t13 t81.t17.t14))
+(step t81.t17.t16 (cl (= @p_971 (! (is_res$ @p_1086 @p_1087) :named @p_1104))) :rule cong :premises (t81.t17.t12 t81.t17.t15))
+(step t81.t17.t17 (cl (= @p_972 (! (= @p_1100 @p_1104) :named @p_1105))) :rule cong :premises (t81.t17.t8 t81.t17.t16))
+(step t81.t17 (cl (= @p_964 (! (forall ((veriT_vr105 B$) (veriT_vr106 C$)) @p_1105) :named @p_1097))) :rule bind)
+(step t81.t18 (cl (= @p_973 (! (and @p_1096 @p_1097) :named @p_1106))) :rule cong :premises (t81.t16 t81.t17))
+(step t81.t19 (cl (= @p_974 (! (or @p_1084 @p_1106) :named @p_1107))) :rule cong :premises (t81.t5 t81.t18))
+(step t81 (cl (= @p_1015 (! (forall ((veriT_vr103 A$) (veriT_vr104 C$)) @p_1107) :named @p_1155))) :rule bind)
+(anchor :step t82 :args ((:= (veriT_vr91 E$) veriT_vr107) (:= (veriT_vr90 D$) veriT_vr108)))
+(step t82.t1 (cl (! (= veriT_vr91 veriT_vr107) :named @p_1110)) :rule refl)
+(step t82.t2 (cl (! (= veriT_vr90 veriT_vr108) :named @p_1112)) :rule refl)
+(step t82.t3 (cl (= @p_975 (! (pair$a veriT_vr107 veriT_vr108) :named @p_1108))) :rule cong :premises (t82.t1 t82.t2))
+(step t82.t4 (cl (= @p_976 (! (is_res$a @p_712 @p_1108) :named @p_1109))) :rule cong :premises (t82.t3))
+(step t82.t5 (cl @p_1110) :rule refl)
+(step t82.t6 (cl (= @p_978 (! (c$ veriT_vr107 veriT_sk0) :named @p_1111))) :rule cong :premises (t82.t5))
+(step t82.t7 (cl @p_1112) :rule refl)
+(step t82.t8 (cl (= @p_980 (! (run$b @p_1111 veriT_vr108) :named @p_1113))) :rule cong :premises (t82.t6 t82.t7))
+(step t82.t9 (cl (= @p_981 (! (is_fail$b @p_1113) :named @p_1114))) :rule cong :premises (t82.t8))
+(step t82.t10 (cl (= @p_982 (! (and @p_1109 @p_1114) :named @p_1115))) :rule cong :premises (t82.t4 t82.t9))
+(step t82 (cl (= @p_983 (! (exists ((veriT_vr107 E$) (veriT_vr108 D$)) @p_1115) :named @p_1116))) :rule bind)
+(step t83 (cl (= @p_986 (! (or @p_720 @p_1116) :named @p_1117))) :rule cong :premises (t82))
+(step t84 (cl (= @p_996 (! (=> @p_790 @p_1117) :named @p_1148))) :rule cong :premises (t83))
+(anchor :step t85 :args ((:= (veriT_vr91 E$) veriT_vr109) (:= (veriT_vr90 D$) veriT_vr110)))
+(step t85.t1 (cl (! (= veriT_vr91 veriT_vr109) :named @p_1120)) :rule refl)
+(step t85.t2 (cl (! (= veriT_vr90 veriT_vr110) :named @p_1122)) :rule refl)
+(step t85.t3 (cl (= @p_975 (! (pair$a veriT_vr109 veriT_vr110) :named @p_1118))) :rule cong :premises (t85.t1 t85.t2))
+(step t85.t4 (cl (= @p_987 (! (is_res$a @p_714 @p_1118) :named @p_1119))) :rule cong :premises (t85.t3))
+(step t85.t5 (cl @p_1120) :rule refl)
+(step t85.t6 (cl (= @p_989 (! (c$ veriT_vr109 veriT_sk1) :named @p_1121))) :rule cong :premises (t85.t5))
+(step t85.t7 (cl @p_1122) :rule refl)
+(step t85.t8 (cl (= @p_991 (! (run$b @p_1121 veriT_vr110) :named @p_1123))) :rule cong :premises (t85.t6 t85.t7))
+(step t85.t9 (cl (= @p_992 (! (is_fail$b @p_1123) :named @p_1124))) :rule cong :premises (t85.t8))
+(step t85.t10 (cl (= @p_993 (! (and @p_1119 @p_1124) :named @p_1125))) :rule cong :premises (t85.t4 t85.t9))
+(step t85 (cl (= @p_994 (! (exists ((veriT_vr109 E$) (veriT_vr110 D$)) @p_1125) :named @p_1126))) :rule bind)
+(step t86 (cl (= @p_995 (! (or @p_726 @p_1126) :named @p_1127))) :rule cong :premises (t85))
+(step t87 (cl (= @p_997 (! (=> @p_808 @p_1127) :named @p_1149))) :rule cong :premises (t86))
+(anchor :step t88 :args ((:= (veriT_vr91 E$) veriT_vr111) (:= (veriT_vr90 D$) veriT_vr112)))
+(step t88.t1 (cl (! (= veriT_vr91 veriT_vr111) :named @p_1130)) :rule refl)
+(step t88.t2 (cl (! (= veriT_vr90 veriT_vr112) :named @p_1132)) :rule refl)
+(step t88.t3 (cl (= @p_975 (! (pair$a veriT_vr111 veriT_vr112) :named @p_1128))) :rule cong :premises (t88.t1 t88.t2))
+(step t88.t4 (cl (= @p_976 (! (is_res$a @p_712 @p_1128) :named @p_1129))) :rule cong :premises (t88.t3))
+(step t88.t5 (cl @p_1130) :rule refl)
+(step t88.t6 (cl (= @p_978 (! (c$ veriT_vr111 veriT_sk0) :named @p_1131))) :rule cong :premises (t88.t5))
+(step t88.t7 (cl @p_1132) :rule refl)
+(step t88.t8 (cl (= @p_980 (! (run$b @p_1131 veriT_vr112) :named @p_1133))) :rule cong :premises (t88.t6 t88.t7))
+(step t88.t9 (cl (= @p_1000 (! (is_res$b @p_1133 @p_747) :named @p_1134))) :rule cong :premises (t88.t8))
+(step t88.t10 (cl (= @p_1001 (! (and @p_1129 @p_1134) :named @p_1135))) :rule cong :premises (t88.t4 t88.t9))
+(step t88 (cl (= @p_1002 (! (exists ((veriT_vr111 E$) (veriT_vr112 D$)) @p_1135) :named @p_1136))) :rule bind)
+(step t89 (cl (= @p_1003 (! (or @p_720 @p_1136) :named @p_1137))) :rule cong :premises (t88))
+(step t90 (cl (= @p_1010 (! (=> @p_828 @p_1137) :named @p_1150))) :rule cong :premises (t89))
+(anchor :step t91 :args ((:= (veriT_vr91 E$) veriT_vr113) (:= (veriT_vr90 D$) veriT_vr114)))
+(step t91.t1 (cl (! (= veriT_vr91 veriT_vr113) :named @p_1140)) :rule refl)
+(step t91.t2 (cl (! (= veriT_vr90 veriT_vr114) :named @p_1142)) :rule refl)
+(step t91.t3 (cl (= @p_975 (! (pair$a veriT_vr113 veriT_vr114) :named @p_1138))) :rule cong :premises (t91.t1 t91.t2))
+(step t91.t4 (cl (= @p_987 (! (is_res$a @p_714 @p_1138) :named @p_1139))) :rule cong :premises (t91.t3))
+(step t91.t5 (cl @p_1140) :rule refl)
+(step t91.t6 (cl (= @p_989 (! (c$ veriT_vr113 veriT_sk1) :named @p_1141))) :rule cong :premises (t91.t5))
+(step t91.t7 (cl @p_1142) :rule refl)
+(step t91.t8 (cl (= @p_991 (! (run$b @p_1141 veriT_vr114) :named @p_1143))) :rule cong :premises (t91.t6 t91.t7))
+(step t91.t9 (cl (= @p_1006 (! (is_res$b @p_1143 @p_747) :named @p_1144))) :rule cong :premises (t91.t8))
+(step t91.t10 (cl (= @p_1007 (! (and @p_1139 @p_1144) :named @p_1145))) :rule cong :premises (t91.t4 t91.t9))
+(step t91 (cl (= @p_1008 (! (exists ((veriT_vr113 E$) (veriT_vr114 D$)) @p_1145) :named @p_1146))) :rule bind)
+(step t92 (cl (= @p_1009 (! (or @p_726 @p_1146) :named @p_1147))) :rule cong :premises (t91))
+(step t93 (cl (= @p_1011 (! (=> @p_848 @p_1147) :named @p_1151))) :rule cong :premises (t92))
+(step t94 (cl (= @p_1026 (! (and @p_1148 @p_1149 @p_1150 @p_1151) :named @p_1152))) :rule cong :premises (t84 t87 t90 t93))
+(step t95 (cl (= @p_1028 (! (or @p_720 @p_1116 @p_1152) :named @p_1153))) :rule cong :premises (t82 t94))
+(step t96 (cl (= @p_1029 (! (not @p_1153) :named @p_1156))) :rule cong :premises (t95))
+(step t97 (cl (! (= @p_1031 (! (and @p_1018 @p_1154 @p_1155 @p_1156) :named @p_1158)) :named @p_1157)) :rule cong :premises (t80 t81 t96))
+(step t98 (cl (not @p_1157) (not @p_1031) @p_1158) :rule equiv_pos2)
+(step t99 (cl @p_1158) :rule th_resolution :premises (t79 t97 t98))
+(step t100 (cl (= @p_1116 (! (not (! (forall ((veriT_vr107 E$) (veriT_vr108 D$)) (not @p_1115)) :named @p_1177)) :named @p_1159))) :rule connective_def)
+(step t101 (cl (= @p_1117 (! (or @p_720 @p_1159) :named @p_1160))) :rule cong :premises (t100))
+(step t102 (cl (= @p_1148 (! (=> @p_790 @p_1160) :named @p_1167))) :rule cong :premises (t101))
+(step t103 (cl (= @p_1126 (! (not (forall ((veriT_vr109 E$) (veriT_vr110 D$)) (not @p_1125))) :named @p_1161))) :rule connective_def)
+(step t104 (cl (= @p_1127 (! (or @p_726 @p_1161) :named @p_1162))) :rule cong :premises (t103))
+(step t105 (cl (= @p_1149 (! (=> @p_808 @p_1162) :named @p_1168))) :rule cong :premises (t104))
+(step t106 (cl (= @p_1136 (! (not (! (forall ((veriT_vr111 E$) (veriT_vr112 D$)) (not @p_1135)) :named @p_1181)) :named @p_1163))) :rule connective_def)
+(step t107 (cl (= @p_1137 (! (or @p_720 @p_1163) :named @p_1164))) :rule cong :premises (t106))
+(step t108 (cl (= @p_1150 (! (=> @p_828 @p_1164) :named @p_1169))) :rule cong :premises (t107))
+(step t109 (cl (= @p_1146 (! (not (! (forall ((veriT_vr113 E$) (veriT_vr114 D$)) (not @p_1145)) :named @p_1184)) :named @p_1165))) :rule connective_def)
+(step t110 (cl (= @p_1147 (! (or @p_726 @p_1165) :named @p_1166))) :rule cong :premises (t109))
+(step t111 (cl (= @p_1151 (! (=> @p_848 @p_1166) :named @p_1170))) :rule cong :premises (t110))
+(step t112 (cl (= @p_1152 (! (and @p_1167 @p_1168 @p_1169 @p_1170) :named @p_1171))) :rule cong :premises (t102 t105 t108 t111))
+(step t113 (cl (= @p_1153 (! (or @p_720 @p_1159 @p_1171) :named @p_1172))) :rule cong :premises (t100 t112))
+(step t114 (cl (= @p_1156 (! (not @p_1172) :named @p_1173))) :rule cong :premises (t113))
+(step t115 (cl (! (= @p_1158 (! (and @p_1018 @p_1154 @p_1155 @p_1173) :named @p_1175)) :named @p_1174)) :rule cong :premises (t114))
+(step t116 (cl (not @p_1174) (not @p_1158) @p_1175) :rule equiv_pos2)
+(step t117 (cl @p_1175) :rule th_resolution :premises (t99 t115 t116))
+(step t118 (cl @p_1018) :rule and :premises (t117))
+(step t119 (cl @p_1154) :rule and :premises (t117))
+(step t120 (cl @p_1155) :rule and :premises (t117))
+(step t121 (cl @p_1173) :rule and :premises (t117))
+(step t122 (cl (not @p_720)) :rule not_or :premises (t121))
+(step t123 (cl (! (not @p_1159) :named @p_1176)) :rule not_or :premises (t121))
+(step t124 (cl (not @p_1176) @p_1177) :rule not_not)
+(step t125 (cl @p_1177) :rule th_resolution :premises (t124 t123))
+(step t126 (cl (not @p_1171)) :rule not_or :premises (t121))
+(step t127 (cl (! (not @p_780) :named @p_1178) @p_784) :rule and_pos)
+(step t128 (cl @p_1178 @p_789) :rule and_pos)
+(step t129 (cl (! (not @p_790) :named @p_1925) @p_726 @p_780) :rule or_pos)
+(step t130 (cl @p_1167 @p_790) :rule implies_neg1)
+(step t131 (cl (! (not @p_808) :named @p_1185) @p_720 @p_800) :rule or_pos)
+(step t132 (cl @p_1168 @p_808) :rule implies_neg1)
+(step t133 (cl (! (not @p_820) :named @p_1179) @p_822) :rule and_pos)
+(step t134 (cl @p_1179 @p_827) :rule and_pos)
+(step t135 (cl (not @p_828) @p_726 @p_820) :rule or_pos)
+(step t136 (cl @p_1169 @p_828) :rule implies_neg1)
+(step t137 (cl @p_1164 (! (not @p_1163) :named @p_1180)) :rule or_neg)
+(step t138 (cl (not @p_1180) @p_1181) :rule not_not)
+(step t139 (cl @p_1164 @p_1181) :rule th_resolution :premises (t138 t137))
+(step t140 (cl @p_1169 (! (not @p_1164) :named @p_1927)) :rule implies_neg2)
+(step t141 (cl (! (not @p_840) :named @p_1182) @p_842) :rule and_pos)
+(step t142 (cl @p_1182 @p_847) :rule and_pos)
+(step t143 (cl (! (not @p_848) :named @p_1186) @p_720 @p_840) :rule or_pos)
+(step t144 (cl @p_1170 @p_848) :rule implies_neg1)
+(step t145 (cl @p_1166 (! (not @p_1165) :named @p_1183)) :rule or_neg)
+(step t146 (cl (not @p_1183) @p_1184) :rule not_not)
+(step t147 (cl @p_1166 @p_1184) :rule th_resolution :premises (t146 t145))
+(step t148 (cl @p_1170 (not @p_1166)) :rule implies_neg2)
+(step t149 (cl (not @p_1167) (not @p_1168) (! (not @p_1169) :named @p_1926) (not @p_1170)) :rule not_and :premises (t126))
+(step t150 (cl @p_1185 @p_800) :rule resolution :premises (t131 t122))
+(step t151 (cl @p_1186 @p_840) :rule resolution :premises (t143 t122))
+(step t152 (cl (or (! (not @p_1155) :named @p_1187) (! (forall ((veriT_vr103 A$) (veriT_vr104 C$)) (or @p_1084 (not @p_1092) @p_1084)) :named @p_1340))) :rule qnt_cnf)
+(step t153 (cl (or @p_1187 (! (forall ((veriT_vr103 A$) (veriT_vr104 C$) (veriT_vr105 B$) (veriT_vr106 C$)) (or @p_1084 (not @p_1100) @p_1104)) :named @p_1351))) :rule qnt_cnf)
+(step t154 (cl (or @p_1187 (! (forall ((veriT_vr103 A$) (veriT_vr104 C$) (veriT_vr105 B$) (veriT_vr106 C$)) (or @p_1084 (not @p_1104) @p_1100)) :named @p_1352))) :rule qnt_cnf)
+(step t155 (cl (or @p_1159 (! (not @p_800) :named @p_1323))) :rule forall_inst :args ((:= veriT_vr107 veriT_sk5) (:= veriT_vr108 veriT_sk6)))
+(step t156 (cl (or @p_1159 (! (not (! (and @p_842 (! (is_fail$b @p_846) :named @p_1325)) :named @p_1324)) :named @p_1326))) :rule forall_inst :args ((:= veriT_vr107 veriT_sk11) (:= veriT_vr108 veriT_sk12)))
+(step t157 (cl (or @p_1159 (! (not (! (and (! (is_res$a @p_712 @p_821) :named @p_1328) (! (is_fail$b (! (run$b (c$ veriT_sk9 veriT_sk0) veriT_sk10) :named @p_1353)) :named @p_1329)) :named @p_1327)) :named @p_1330))) :rule forall_inst :args ((:= veriT_vr107 veriT_sk9) (:= veriT_vr108 veriT_sk10)))
+(step t158 (cl (or @p_1159 (! (not (! (and (! (is_res$a @p_712 @p_783) :named @p_1332) (! (is_fail$b (! (run$b (c$ veriT_sk3 veriT_sk0) veriT_sk4) :named @p_1389)) :named @p_1333)) :named @p_1331)) :named @p_1334))) :rule forall_inst :args ((:= veriT_vr107 veriT_sk3) (:= veriT_vr108 veriT_sk4)))
+(step t159 (cl (not (! (not (! (not @p_1154) :named @p_1385)) :named @p_1533)) @p_1154) :rule not_not)
+(step t160 (cl (or (! (not @p_1018) :named @p_1320) (! (=> @p_1015 (! (or @p_720 (! (and (! (= @p_726 @p_720) :named @p_1208) (! (forall ((veriT_vr91 E$) (veriT_vr92 D$)) (! (= (! (is_res$a @p_714 @p_869) :named @p_1236) (! (is_res$a @p_712 @p_869) :named @p_1241)) :named @p_1243)) :named @p_1234)) :named @p_1245)) :named @p_1247)) :named @p_1188))) :rule forall_inst :args ((:= veriT_vr84 veriT_sk0) (:= veriT_vr85 veriT_sk1) (:= veriT_vr90 veriT_sk2)))
+(anchor :step t161)
+(assume t161.h1 @p_1188)
+(anchor :step t161.t2 :args ((:= (veriT_vr86 A$) veriT_vr115) (:= (veriT_vr87 C$) veriT_vr116)))
+(step t161.t2.t1 (cl (! (= veriT_vr86 veriT_vr115) :named @p_1215)) :rule refl)
+(step t161.t2.t2 (cl (! (= @p_955 (! (fun_app$ veriT_sk0 veriT_vr115) :named @p_1214)) :named @p_1219)) :rule cong :premises (t161.t2.t1))
+(step t161.t2.t3 (cl (! (= veriT_vr87 veriT_vr116) :named @p_1217)) :rule refl)
+(step t161.t2.t4 (cl (! (= @p_954 (! (run$ @p_1214 veriT_vr116) :named @p_1212)) :named @p_1220)) :rule cong :premises (t161.t2.t2 t161.t2.t3))
+(step t161.t2.t5 (cl (! (= @p_952 (! (is_fail$ @p_1212) :named @p_1210)) :named @p_1221)) :rule cong :premises (t161.t2.t4))
+(step t161.t2.t6 (cl @p_1215) :rule refl)
+(step t161.t2.t7 (cl (! (= @p_957 (! (fun_app$ veriT_sk1 veriT_vr115) :named @p_1216)) :named @p_1224)) :rule cong :premises (t161.t2.t6))
+(step t161.t2.t8 (cl @p_1217) :rule refl)
+(step t161.t2.t9 (cl (! (= @p_953 (! (run$ @p_1216 veriT_vr116) :named @p_1211)) :named @p_1225)) :rule cong :premises (t161.t2.t7 t161.t2.t8))
+(step t161.t2.t10 (cl (= @p_959 (! (is_fail$ @p_1211) :named @p_1218))) :rule cong :premises (t161.t2.t9))
+(step t161.t2.t11 (cl @p_1215) :rule refl)
+(step t161.t2.t12 (cl @p_1219) :rule cong :premises (t161.t2.t11))
+(step t161.t2.t13 (cl @p_1217) :rule refl)
+(step t161.t2.t14 (cl @p_1220) :rule cong :premises (t161.t2.t12 t161.t2.t13))
+(step t161.t2.t15 (cl @p_1221) :rule cong :premises (t161.t2.t14))
+(step t161.t2.t16 (cl (= @p_963 (! (= @p_1218 @p_1210) :named @p_1222))) :rule cong :premises (t161.t2.t10 t161.t2.t15))
+(anchor :step t161.t2.t17 :args ((:= (veriT_vr88 B$) veriT_vr117) (:= (veriT_vr89 C$) veriT_vr118)))
+(step t161.t2.t17.t1 (cl @p_1215) :rule refl)
+(step t161.t2.t17.t2 (cl @p_1224) :rule cong :premises (t161.t2.t17.t1))
+(step t161.t2.t17.t3 (cl @p_1217) :rule refl)
+(step t161.t2.t17.t4 (cl @p_1225) :rule cong :premises (t161.t2.t17.t2 t161.t2.t17.t3))
+(step t161.t2.t17.t5 (cl (! (= veriT_vr88 veriT_vr117) :named @p_1227)) :rule refl)
+(step t161.t2.t17.t6 (cl (! (= veriT_vr89 veriT_vr118) :named @p_1228)) :rule refl)
+(step t161.t2.t17.t7 (cl (! (= @p_865 (! (pair$ veriT_vr117 veriT_vr118) :named @p_1213)) :named @p_1229)) :rule cong :premises (t161.t2.t17.t5 t161.t2.t17.t6))
+(step t161.t2.t17.t8 (cl (= @p_967 (! (is_res$ @p_1211 @p_1213) :named @p_1226))) :rule cong :premises (t161.t2.t17.t4 t161.t2.t17.t7))
+(step t161.t2.t17.t9 (cl @p_1215) :rule refl)
+(step t161.t2.t17.t10 (cl @p_1219) :rule cong :premises (t161.t2.t17.t9))
+(step t161.t2.t17.t11 (cl @p_1217) :rule refl)
+(step t161.t2.t17.t12 (cl @p_1220) :rule cong :premises (t161.t2.t17.t10 t161.t2.t17.t11))
+(step t161.t2.t17.t13 (cl @p_1227) :rule refl)
+(step t161.t2.t17.t14 (cl @p_1228) :rule refl)
+(step t161.t2.t17.t15 (cl @p_1229) :rule cong :premises (t161.t2.t17.t13 t161.t2.t17.t14))
+(step t161.t2.t17.t16 (cl (= @p_971 (! (is_res$ @p_1212 @p_1213) :named @p_1230))) :rule cong :premises (t161.t2.t17.t12 t161.t2.t17.t15))
+(step t161.t2.t17.t17 (cl (= @p_972 (! (= @p_1226 @p_1230) :named @p_1231))) :rule cong :premises (t161.t2.t17.t8 t161.t2.t17.t16))
+(step t161.t2.t17 (cl (= @p_964 (! (forall ((veriT_vr117 B$) (veriT_vr118 C$)) @p_1231) :named @p_1223))) :rule bind)
+(step t161.t2.t18 (cl (= @p_973 (! (and @p_1222 @p_1223) :named @p_1232))) :rule cong :premises (t161.t2.t16 t161.t2.t17))
+(step t161.t2.t19 (cl (= @p_974 (! (or @p_1210 @p_1232) :named @p_1233))) :rule cong :premises (t161.t2.t5 t161.t2.t18))
+(step t161.t2 (cl (= @p_1015 (! (forall ((veriT_vr115 A$) (veriT_vr116 C$)) @p_1233) :named @p_1249))) :rule bind)
+(anchor :step t161.t3 :args ((:= (veriT_vr91 E$) veriT_vr121) (:= (veriT_vr92 D$) veriT_vr120)))
+(step t161.t3.t1 (cl (! (= veriT_vr91 veriT_vr121) :named @p_1238)) :rule refl)
+(step t161.t3.t2 (cl (! (= veriT_vr92 veriT_vr120) :named @p_1239)) :rule refl)
+(step t161.t3.t3 (cl (! (= @p_869 (! (pair$a veriT_vr121 veriT_vr120) :named @p_1235)) :named @p_1240)) :rule cong :premises (t161.t3.t1 t161.t3.t2))
+(step t161.t3.t4 (cl (= @p_1236 (! (is_res$a @p_714 @p_1235) :named @p_1237))) :rule cong :premises (t161.t3.t3))
+(step t161.t3.t5 (cl @p_1238) :rule refl)
+(step t161.t3.t6 (cl @p_1239) :rule refl)
+(step t161.t3.t7 (cl @p_1240) :rule cong :premises (t161.t3.t5 t161.t3.t6))
+(step t161.t3.t8 (cl (= @p_1241 (! (is_res$a @p_712 @p_1235) :named @p_1242))) :rule cong :premises (t161.t3.t7))
+(step t161.t3.t9 (cl (= @p_1243 (! (= @p_1237 @p_1242) :named @p_1244))) :rule cong :premises (t161.t3.t4 t161.t3.t8))
+(step t161.t3 (cl (= @p_1234 (! (forall ((veriT_vr121 E$) (veriT_vr120 D$)) @p_1244) :named @p_1246))) :rule bind)
+(step t161.t4 (cl (= @p_1245 (! (and @p_1208 @p_1246) :named @p_1248))) :rule cong :premises (t161.t3))
+(step t161.t5 (cl (= @p_1247 (! (or @p_720 @p_1248) :named @p_1250))) :rule cong :premises (t161.t4))
+(step t161.t6 (cl (! (= @p_1188 (! (=> @p_1249 @p_1250) :named @p_1253)) :named @p_1251)) :rule cong :premises (t161.t2 t161.t5))
+(step t161.t7 (cl (not @p_1251) (! (not @p_1188) :named @p_1252) @p_1253) :rule equiv_pos2)
+(step t161.t8 (cl @p_1253) :rule th_resolution :premises (t161.h1 t161.t6 t161.t7))
+(anchor :step t161.t9 :args ((:= (veriT_vr115 A$) veriT_vr122) (:= (veriT_vr116 C$) veriT_vr123)))
+(step t161.t9.t1 (cl (! (= veriT_vr115 veriT_vr122) :named @p_1256)) :rule refl)
+(step t161.t9.t2 (cl (! (= @p_1214 @p_1255) :named @p_1260)) :rule cong :premises (t161.t9.t1))
+(step t161.t9.t3 (cl (! (= veriT_vr116 veriT_vr123) :named @p_1258)) :rule refl)
+(step t161.t9.t4 (cl (! (= @p_1212 @p_1191) :named @p_1261)) :rule cong :premises (t161.t9.t2 t161.t9.t3))
+(step t161.t9.t5 (cl (! (= @p_1210 @p_1189) :named @p_1262)) :rule cong :premises (t161.t9.t4))
+(step t161.t9.t6 (cl @p_1256) :rule refl)
+(step t161.t9.t7 (cl (! (= @p_1216 @p_1257) :named @p_1265)) :rule cong :premises (t161.t9.t6))
+(step t161.t9.t8 (cl @p_1258) :rule refl)
+(step t161.t9.t9 (cl (! (= @p_1211 @p_1190) :named @p_1266)) :rule cong :premises (t161.t9.t7 t161.t9.t8))
+(step t161.t9.t10 (cl (= @p_1218 @p_1259)) :rule cong :premises (t161.t9.t9))
+(step t161.t9.t11 (cl @p_1256) :rule refl)
+(step t161.t9.t12 (cl @p_1260) :rule cong :premises (t161.t9.t11))
+(step t161.t9.t13 (cl @p_1258) :rule refl)
+(step t161.t9.t14 (cl @p_1261) :rule cong :premises (t161.t9.t12 t161.t9.t13))
+(step t161.t9.t15 (cl @p_1262) :rule cong :premises (t161.t9.t14))
+(step t161.t9.t16 (cl (= @p_1222 @p_1263)) :rule cong :premises (t161.t9.t10 t161.t9.t15))
+(anchor :step t161.t9.t17 :args ((:= (veriT_vr117 B$) veriT_vr124) (:= (veriT_vr118 C$) veriT_vr125)))
+(step t161.t9.t17.t1 (cl @p_1256) :rule refl)
+(step t161.t9.t17.t2 (cl @p_1265) :rule cong :premises (t161.t9.t17.t1))
+(step t161.t9.t17.t3 (cl @p_1258) :rule refl)
+(step t161.t9.t17.t4 (cl @p_1266) :rule cong :premises (t161.t9.t17.t2 t161.t9.t17.t3))
+(step t161.t9.t17.t5 (cl (! (= veriT_vr117 veriT_vr124) :named @p_1268)) :rule refl)
+(step t161.t9.t17.t6 (cl (! (= veriT_vr118 veriT_vr125) :named @p_1269)) :rule refl)
+(step t161.t9.t17.t7 (cl (! (= @p_1213 @p_1192) :named @p_1270)) :rule cong :premises (t161.t9.t17.t5 t161.t9.t17.t6))
+(step t161.t9.t17.t8 (cl (= @p_1226 @p_1267)) :rule cong :premises (t161.t9.t17.t4 t161.t9.t17.t7))
+(step t161.t9.t17.t9 (cl @p_1256) :rule refl)
+(step t161.t9.t17.t10 (cl @p_1260) :rule cong :premises (t161.t9.t17.t9))
+(step t161.t9.t17.t11 (cl @p_1258) :rule refl)
+(step t161.t9.t17.t12 (cl @p_1261) :rule cong :premises (t161.t9.t17.t10 t161.t9.t17.t11))
+(step t161.t9.t17.t13 (cl @p_1268) :rule refl)
+(step t161.t9.t17.t14 (cl @p_1269) :rule refl)
+(step t161.t9.t17.t15 (cl @p_1270) :rule cong :premises (t161.t9.t17.t13 t161.t9.t17.t14))
+(step t161.t9.t17.t16 (cl (= @p_1230 @p_1271)) :rule cong :premises (t161.t9.t17.t12 t161.t9.t17.t15))
+(step t161.t9.t17.t17 (cl (= @p_1231 @p_1272)) :rule cong :premises (t161.t9.t17.t8 t161.t9.t17.t16))
+(step t161.t9.t17 (cl (= @p_1223 @p_1264)) :rule bind)
+(step t161.t9.t18 (cl (= @p_1232 @p_1273)) :rule cong :premises (t161.t9.t16 t161.t9.t17))
+(step t161.t9.t19 (cl (= @p_1233 @p_1254)) :rule cong :premises (t161.t9.t5 t161.t9.t18))
+(step t161.t9 (cl (= @p_1249 (! (forall ((veriT_vr122 A$) (veriT_vr123 C$)) @p_1254) :named @p_1283))) :rule bind)
+(anchor :step t161.t10 :args ((:= (veriT_vr121 E$) veriT_vr126) (:= (veriT_vr120 D$) veriT_vr127)))
+(step t161.t10.t1 (cl (! (= veriT_vr121 veriT_vr126) :named @p_1276)) :rule refl)
+(step t161.t10.t2 (cl (! (= veriT_vr120 veriT_vr127) :named @p_1277)) :rule refl)
+(step t161.t10.t3 (cl (! (= @p_1235 (! (pair$a veriT_vr126 veriT_vr127) :named @p_1274)) :named @p_1278)) :rule cong :premises (t161.t10.t1 t161.t10.t2))
+(step t161.t10.t4 (cl (= @p_1237 (! (is_res$a @p_714 @p_1274) :named @p_1275))) :rule cong :premises (t161.t10.t3))
+(step t161.t10.t5 (cl @p_1276) :rule refl)
+(step t161.t10.t6 (cl @p_1277) :rule refl)
+(step t161.t10.t7 (cl @p_1278) :rule cong :premises (t161.t10.t5 t161.t10.t6))
+(step t161.t10.t8 (cl (= @p_1242 (! (is_res$a @p_712 @p_1274) :named @p_1279))) :rule cong :premises (t161.t10.t7))
+(step t161.t10.t9 (cl (= @p_1244 (! (= @p_1275 @p_1279) :named @p_1280))) :rule cong :premises (t161.t10.t4 t161.t10.t8))
+(step t161.t10 (cl (= @p_1246 (! (forall ((veriT_vr126 E$) (veriT_vr127 D$)) @p_1280) :named @p_1281))) :rule bind)
+(step t161.t11 (cl (= @p_1248 (! (and @p_1208 @p_1281) :named @p_1282))) :rule cong :premises (t161.t10))
+(step t161.t12 (cl (= @p_1250 (! (or @p_720 @p_1282) :named @p_1284))) :rule cong :premises (t161.t11))
+(step t161.t13 (cl (! (= @p_1253 (! (=> @p_1283 @p_1284) :named @p_1286)) :named @p_1285)) :rule cong :premises (t161.t9 t161.t12))
+(step t161.t14 (cl (not @p_1285) (not @p_1253) @p_1286) :rule equiv_pos2)
+(step t161.t15 (cl @p_1286) :rule th_resolution :premises (t161.t8 t161.t13 t161.t14))
+(anchor :step t161.t16 :args ((:= (veriT_vr122 A$) veriT_sk13) (:= (veriT_vr123 C$) veriT_sk14)))
+(step t161.t16.t1 (cl (! (= veriT_vr122 veriT_sk13) :named @p_1289)) :rule refl)
+(step t161.t16.t2 (cl (! (= @p_1255 (! (fun_app$ veriT_sk0 veriT_sk13) :named @p_1288)) :named @p_1293)) :rule cong :premises (t161.t16.t1))
+(step t161.t16.t3 (cl (! (= veriT_vr123 veriT_sk14) :named @p_1291)) :rule refl)
+(step t161.t16.t4 (cl (! (= @p_1191 (! (run$ @p_1288 veriT_sk14) :named @p_1206)) :named @p_1294)) :rule cong :premises (t161.t16.t2 t161.t16.t3))
+(step t161.t16.t5 (cl (! (= @p_1189 (! (is_fail$ @p_1206) :named @p_1198)) :named @p_1295)) :rule cong :premises (t161.t16.t4))
+(step t161.t16.t6 (cl @p_1289) :rule refl)
+(step t161.t16.t7 (cl (! (= @p_1257 (! (fun_app$ veriT_sk1 veriT_sk13) :named @p_1290)) :named @p_1298)) :rule cong :premises (t161.t16.t6))
+(step t161.t16.t8 (cl @p_1291) :rule refl)
+(step t161.t16.t9 (cl (! (= @p_1190 (! (run$ @p_1290 veriT_sk14) :named @p_1199)) :named @p_1299)) :rule cong :premises (t161.t16.t7 t161.t16.t8))
+(step t161.t16.t10 (cl (= @p_1259 (! (is_fail$ @p_1199) :named @p_1292))) :rule cong :premises (t161.t16.t9))
+(step t161.t16.t11 (cl @p_1289) :rule refl)
+(step t161.t16.t12 (cl @p_1293) :rule cong :premises (t161.t16.t11))
+(step t161.t16.t13 (cl @p_1291) :rule refl)
+(step t161.t16.t14 (cl @p_1294) :rule cong :premises (t161.t16.t12 t161.t16.t13))
+(step t161.t16.t15 (cl @p_1295) :rule cong :premises (t161.t16.t14))
+(step t161.t16.t16 (cl (= @p_1263 (! (= @p_1292 @p_1198) :named @p_1296))) :rule cong :premises (t161.t16.t10 t161.t16.t15))
+(anchor :step t161.t16.t17 :args ((:= (veriT_vr124 B$) veriT_sk15) (:= (veriT_vr125 C$) veriT_sk16)))
+(step t161.t16.t17.t1 (cl @p_1289) :rule refl)
+(step t161.t16.t17.t2 (cl @p_1298) :rule cong :premises (t161.t16.t17.t1))
+(step t161.t16.t17.t3 (cl @p_1291) :rule refl)
+(step t161.t16.t17.t4 (cl @p_1299) :rule cong :premises (t161.t16.t17.t2 t161.t16.t17.t3))
+(step t161.t16.t17.t5 (cl (! (= veriT_vr124 veriT_sk15) :named @p_1302)) :rule refl)
+(step t161.t16.t17.t6 (cl (! (= veriT_vr125 veriT_sk16) :named @p_1303)) :rule refl)
+(step t161.t16.t17.t7 (cl (! (= @p_1192 (! (pair$ veriT_sk15 veriT_sk16) :named @p_1207)) :named @p_1304)) :rule cong :premises (t161.t16.t17.t5 t161.t16.t17.t6))
+(step t161.t16.t17.t8 (cl (= @p_1267 (! (is_res$ @p_1199 @p_1207) :named @p_1301))) :rule cong :premises (t161.t16.t17.t4 t161.t16.t17.t7))
+(step t161.t16.t17.t9 (cl @p_1289) :rule refl)
+(step t161.t16.t17.t10 (cl @p_1293) :rule cong :premises (t161.t16.t17.t9))
+(step t161.t16.t17.t11 (cl @p_1291) :rule refl)
+(step t161.t16.t17.t12 (cl @p_1294) :rule cong :premises (t161.t16.t17.t10 t161.t16.t17.t11))
+(step t161.t16.t17.t13 (cl @p_1302) :rule refl)
+(step t161.t16.t17.t14 (cl @p_1303) :rule refl)
+(step t161.t16.t17.t15 (cl @p_1304) :rule cong :premises (t161.t16.t17.t13 t161.t16.t17.t14))
+(step t161.t16.t17.t16 (cl (= @p_1271 (! (is_res$ @p_1206 @p_1207) :named @p_1305))) :rule cong :premises (t161.t16.t17.t12 t161.t16.t17.t15))
+(step t161.t16.t17.t17 (cl (= @p_1272 (! (= @p_1301 @p_1305) :named @p_1297))) :rule cong :premises (t161.t16.t17.t8 t161.t16.t17.t16))
+(step t161.t16.t17 (cl (= @p_1264 @p_1297)) :rule sko_forall)
+(step t161.t16.t18 (cl (= @p_1273 (! (and @p_1296 @p_1297) :named @p_1306))) :rule cong :premises (t161.t16.t16 t161.t16.t17))
+(step t161.t16.t19 (cl (= @p_1254 (! (or @p_1198 @p_1306) :named @p_1287))) :rule cong :premises (t161.t16.t5 t161.t16.t18))
+(step t161.t16 (cl (= @p_1283 @p_1287)) :rule sko_forall)
+(step t161.t17 (cl (! (= @p_1286 (! (=> @p_1287 @p_1284) :named @p_1308)) :named @p_1307)) :rule cong :premises (t161.t16))
+(step t161.t18 (cl (not @p_1307) (not @p_1286) @p_1308) :rule equiv_pos2)
+(step t161.t19 (cl @p_1308) :rule th_resolution :premises (t161.t15 t161.t17 t161.t18))
+(anchor :step t161.t20 :args ((:= (veriT_vr126 E$) veriT_vr128) (:= (veriT_vr127 D$) veriT_vr129)))
+(step t161.t20.t1 (cl (! (= veriT_vr126 veriT_vr128) :named @p_1311)) :rule refl)
+(step t161.t20.t2 (cl (! (= veriT_vr127 veriT_vr129) :named @p_1312)) :rule refl)
+(step t161.t20.t3 (cl (! (= @p_1274 (! (pair$a veriT_vr128 veriT_vr129) :named @p_1209)) :named @p_1313)) :rule cong :premises (t161.t20.t1 t161.t20.t2))
+(step t161.t20.t4 (cl (= @p_1275 (! (is_res$a @p_714 @p_1209) :named @p_1310))) :rule cong :premises (t161.t20.t3))
+(step t161.t20.t5 (cl @p_1311) :rule refl)
+(step t161.t20.t6 (cl @p_1312) :rule refl)
+(step t161.t20.t7 (cl @p_1313) :rule cong :premises (t161.t20.t5 t161.t20.t6))
+(step t161.t20.t8 (cl (= @p_1279 (! (is_res$a @p_712 @p_1209) :named @p_1314))) :rule cong :premises (t161.t20.t7))
+(step t161.t20.t9 (cl (= @p_1280 (! (= @p_1310 @p_1314) :named @p_1315))) :rule cong :premises (t161.t20.t4 t161.t20.t8))
+(step t161.t20 (cl (= @p_1281 (! (forall ((veriT_vr128 E$) (veriT_vr129 D$)) @p_1315) :named @p_1309))) :rule bind)
+(step t161.t21 (cl (= @p_1282 (! (and @p_1208 @p_1309) :named @p_1316))) :rule cong :premises (t161.t20))
+(step t161.t22 (cl (= @p_1284 (! (or @p_720 @p_1316) :named @p_1317))) :rule cong :premises (t161.t21))
+(step t161.t23 (cl (! (= @p_1308 (! (=> @p_1287 @p_1317) :named @p_1318)) :named @p_1319)) :rule cong :premises (t161.t22))
+(step t161.t24 (cl (not @p_1319) (not @p_1308) @p_1318) :rule equiv_pos2)
+(step t161.t25 (cl @p_1318) :rule th_resolution :premises (t161.t19 t161.t23 t161.t24))
+(step t161 (cl @p_1252 @p_1318) :rule subproof :discharge (h1))
+(step t162 (cl @p_1320 @p_1188) :rule or :premises (t160))
+(step t163 (cl (! (or @p_1320 @p_1318) :named @p_1322) (! (not @p_1320) :named @p_1321)) :rule or_neg)
+(step t164 (cl (not @p_1321) @p_1018) :rule not_not)
+(step t165 (cl @p_1322 @p_1018) :rule th_resolution :premises (t164 t163))
+(step t166 (cl @p_1322 (! (not @p_1318) :named @p_1336)) :rule or_neg)
+(step t167 (cl @p_1322) :rule th_resolution :premises (t162 t161 t165 t166))
+(step t168 (cl @p_1159 @p_1323) :rule or :premises (t155))
+(step t169 (cl @p_1323) :rule resolution :premises (t168 t125))
+(step t170 (cl @p_1185) :rule resolution :premises (t150 t169))
+(step t171 (cl @p_1168) :rule resolution :premises (t132 t170))
+(step t172 (cl @p_1324 (! (not @p_842) :named @p_1676) (not @p_1325)) :rule and_neg)
+(step t173 (cl @p_1159 @p_1326) :rule or :premises (t156))
+(step t174 (cl @p_1326) :rule resolution :premises (t173 t125))
+(step t175 (cl @p_1327 (! (not @p_1328) :named @p_1669) (not @p_1329)) :rule and_neg)
+(step t176 (cl @p_1159 @p_1330) :rule or :premises (t157))
+(step t177 (cl @p_1330) :rule resolution :premises (t176 t125))
+(step t178 (cl @p_1331 (not @p_1332) (not @p_1333)) :rule and_neg)
+(step t179 (cl @p_1159 @p_1334) :rule or :premises (t158))
+(step t180 (cl @p_1334) :rule resolution :premises (t179 t125))
+(step t181 (cl @p_1287 (not @p_1198)) :rule or_neg)
+(step t182 (cl @p_1296 @p_1292 @p_1198) :rule equiv_neg2)
+(step t183 (cl @p_1306 (not @p_1296) (not @p_1297)) :rule and_neg)
+(step t184 (cl @p_1287 (not @p_1306)) :rule or_neg)
+(step t185 (cl (! (not @p_1208) :named @p_1337) (! (not @p_726) :named @p_1338) @p_720) :rule equiv_pos2)
+(step t186 (cl (! (not @p_1316) :named @p_1335) @p_1208) :rule and_pos)
+(step t187 (cl @p_1335 @p_1309) :rule and_pos)
+(step t188 (cl (! (not @p_1317) :named @p_1339) @p_720 @p_1316) :rule or_pos)
+(step t189 (cl @p_1336 (not @p_1287) @p_1317) :rule implies_pos)
+(step t190 (cl @p_1320 @p_1318) :rule or :premises (t167))
+(step t191 (cl @p_1337 @p_1338) :rule resolution :premises (t185 t122))
+(step t192 (cl @p_1339 @p_1316) :rule resolution :premises (t188 t122))
+(step t193 (cl @p_1318) :rule resolution :premises (t190 t118))
+(step t194 (cl @p_1187 @p_1340) :rule or :premises (t152))
+(step t195 (cl (or (! (not @p_1340) :named @p_1341) (! (or @p_1198 (! (not @p_1292) :named @p_1346) @p_1198) :named @p_1342))) :rule forall_inst :args ((:= veriT_vr103 veriT_sk13) (:= veriT_vr104 veriT_sk14)))
+(step t196 (cl @p_1341 @p_1342) :rule or :premises (t195))
+(step t197 (cl (! (or @p_1187 @p_1342) :named @p_1344) (! (not @p_1187) :named @p_1343)) :rule or_neg)
+(step t198 (cl (not @p_1343) @p_1155) :rule not_not)
+(step t199 (cl @p_1344 @p_1155) :rule th_resolution :premises (t198 t197))
+(step t200 (cl @p_1344 (! (not @p_1342) :named @p_1345)) :rule or_neg)
+(step t201 (cl @p_1344) :rule th_resolution :premises (t194 t196 t199 t200))
+(anchor :step t202)
+(assume t202.h1 @p_1342)
+(step t202.t2 (cl (! (= @p_1342 (! (or @p_1198 @p_1346) :named @p_1347)) :named @p_1348)) :rule ac_simp)
+(step t202.t3 (cl (not @p_1348) @p_1345 @p_1347) :rule equiv_pos2)
+(step t202.t4 (cl @p_1347) :rule th_resolution :premises (t202.h1 t202.t2 t202.t3))
+(step t202 (cl @p_1345 @p_1347) :rule subproof :discharge (h1))
+(step t203 (cl @p_1187 @p_1342) :rule or :premises (t201))
+(step t204 (cl (! (or @p_1187 @p_1347) :named @p_1349) @p_1343) :rule or_neg)
+(step t205 (cl @p_1349 @p_1155) :rule th_resolution :premises (t198 t204))
+(step t206 (cl @p_1349 (! (not @p_1347) :named @p_1350)) :rule or_neg)
+(step t207 (cl @p_1349) :rule th_resolution :premises (t203 t202 t205 t206))
+(step t208 (cl @p_1350 @p_1198 @p_1346) :rule or_pos)
+(step t209 (cl @p_1187 @p_1347) :rule or :premises (t207))
+(step t210 (cl @p_1347) :rule resolution :premises (t209 t120))
+(step t211 (cl @p_1187 @p_1351) :rule or :premises (t153))
+(step t212 (cl @p_1187 @p_1352) :rule or :premises (t154))
+(step t213 (cl (or @p_1163 (! (not (! (and @p_1328 (! (is_res$b @p_1353 @p_747) :named @p_1670)) :named @p_1668)) :named @p_1671))) :rule forall_inst :args ((:= veriT_vr111 veriT_sk9) (:= veriT_vr112 veriT_sk10)))
+(step t214 (cl (or (! (not @p_1309) :named @p_1354) (! (= @p_822 @p_1328) :named @p_1672))) :rule forall_inst :args ((:= veriT_vr128 veriT_sk9) (:= veriT_vr129 veriT_sk10)))
+(step t215 (cl (or @p_1354 (! (= @p_784 @p_1332) :named @p_1673))) :rule forall_inst :args ((:= veriT_vr128 veriT_sk3) (:= veriT_vr129 veriT_sk4)))
+(step t216 (cl (or @p_1354 (! (= (! (is_res$a @p_714 @p_841) :named @p_1675) @p_842) :named @p_1674))) :rule forall_inst :args ((:= veriT_vr128 veriT_sk11) (:= veriT_vr129 veriT_sk12)))
+(step t217 (cl (or @p_1187 (! (or @p_1198 (! (and @p_1296 (! (forall ((veriT_vr105 B$) (veriT_vr106 C$)) (! (= (! (is_res$ @p_1199 @p_1087) :named @p_1359) (! (is_res$ @p_1206 @p_1087) :named @p_1364)) :named @p_1366)) :named @p_1357)) :named @p_1368)) :named @p_1355))) :rule forall_inst :args ((:= veriT_vr103 veriT_sk13) (:= veriT_vr104 veriT_sk14)))
+(anchor :step t218)
+(assume t218.h1 @p_1355)
+(anchor :step t218.t2 :args ((:= (veriT_vr105 B$) veriT_vr148) (:= (veriT_vr106 C$) veriT_vr149)))
+(step t218.t2.t1 (cl (! (= veriT_vr105 veriT_vr148) :named @p_1361)) :rule refl)
+(step t218.t2.t2 (cl (! (= veriT_vr106 veriT_vr149) :named @p_1362)) :rule refl)
+(step t218.t2.t3 (cl (! (= @p_1087 (! (pair$ veriT_vr148 veriT_vr149) :named @p_1358)) :named @p_1363)) :rule cong :premises (t218.t2.t1 t218.t2.t2))
+(step t218.t2.t4 (cl (= @p_1359 (! (is_res$ @p_1199 @p_1358) :named @p_1360))) :rule cong :premises (t218.t2.t3))
+(step t218.t2.t5 (cl @p_1361) :rule refl)
+(step t218.t2.t6 (cl @p_1362) :rule refl)
+(step t218.t2.t7 (cl @p_1363) :rule cong :premises (t218.t2.t5 t218.t2.t6))
+(step t218.t2.t8 (cl (= @p_1364 (! (is_res$ @p_1206 @p_1358) :named @p_1365))) :rule cong :premises (t218.t2.t7))
+(step t218.t2.t9 (cl (= @p_1366 (! (= @p_1360 @p_1365) :named @p_1367))) :rule cong :premises (t218.t2.t4 t218.t2.t8))
+(step t218.t2 (cl (= @p_1357 (! (forall ((veriT_vr148 B$) (veriT_vr149 C$)) @p_1367) :named @p_1369))) :rule bind)
+(step t218.t3 (cl (= @p_1368 (! (and @p_1296 @p_1369) :named @p_1370))) :rule cong :premises (t218.t2))
+(step t218.t4 (cl (! (= @p_1355 (! (or @p_1198 @p_1370) :named @p_1373)) :named @p_1371)) :rule cong :premises (t218.t3))
+(step t218.t5 (cl (not @p_1371) (! (not @p_1355) :named @p_1372) @p_1373) :rule equiv_pos2)
+(step t218.t6 (cl @p_1373) :rule th_resolution :premises (t218.h1 t218.t4 t218.t5))
+(anchor :step t218.t7 :args ((:= (veriT_vr148 B$) veriT_vr150) (:= (veriT_vr149 C$) veriT_vr151)))
+(step t218.t7.t1 (cl (! (= veriT_vr148 veriT_vr150) :named @p_1376)) :rule refl)
+(step t218.t7.t2 (cl (! (= veriT_vr149 veriT_vr151) :named @p_1377)) :rule refl)
+(step t218.t7.t3 (cl (! (= @p_1358 (! (pair$ veriT_vr150 veriT_vr151) :named @p_1356)) :named @p_1378)) :rule cong :premises (t218.t7.t1 t218.t7.t2))
+(step t218.t7.t4 (cl (= @p_1360 (! (is_res$ @p_1199 @p_1356) :named @p_1375))) :rule cong :premises (t218.t7.t3))
+(step t218.t7.t5 (cl @p_1376) :rule refl)
+(step t218.t7.t6 (cl @p_1377) :rule refl)
+(step t218.t7.t7 (cl @p_1378) :rule cong :premises (t218.t7.t5 t218.t7.t6))
+(step t218.t7.t8 (cl (= @p_1365 (! (is_res$ @p_1206 @p_1356) :named @p_1379))) :rule cong :premises (t218.t7.t7))
+(step t218.t7.t9 (cl (= @p_1367 (! (= @p_1375 @p_1379) :named @p_1380))) :rule cong :premises (t218.t7.t4 t218.t7.t8))
+(step t218.t7 (cl (= @p_1369 (! (forall ((veriT_vr150 B$) (veriT_vr151 C$)) @p_1380) :named @p_1374))) :rule bind)
+(step t218.t8 (cl (= @p_1370 (! (and @p_1296 @p_1374) :named @p_1381))) :rule cong :premises (t218.t7))
+(step t218.t9 (cl (! (= @p_1373 (! (or @p_1198 @p_1381) :named @p_1382)) :named @p_1383)) :rule cong :premises (t218.t8))
+(step t218.t10 (cl (not @p_1383) (not @p_1373) @p_1382) :rule equiv_pos2)
+(step t218.t11 (cl @p_1382) :rule th_resolution :premises (t218.t6 t218.t9 t218.t10))
+(step t218 (cl @p_1372 @p_1382) :rule subproof :discharge (h1))
+(step t219 (cl @p_1187 @p_1355) :rule or :premises (t217))
+(step t220 (cl (! (or @p_1187 @p_1382) :named @p_1384) @p_1343) :rule or_neg)
+(step t221 (cl @p_1384 @p_1155) :rule th_resolution :premises (t198 t220))
+(step t222 (cl @p_1384 (! (not @p_1382) :named @p_1677)) :rule or_neg)
+(step t223 (cl @p_1384) :rule th_resolution :premises (t219 t218 t221 t222))
+(step t224 (cl (or @p_1385 (! (=> (! (forall ((veriT_vr97 A$) (veriT_vr98 C$)) (! (or (! (is_fail$ (! (run$ (! (fun_app$ veriT_sk0 veriT_vr97) :named @p_1417) veriT_vr98) :named @p_1388)) :named @p_1386) (! (and (! (= (! (is_fail$ (! (run$ (! (fun_app$ veriT_sk1 veriT_vr97) :named @p_1420) veriT_vr98) :named @p_1387)) :named @p_1423) @p_1386) :named @p_1428) (! (forall ((veriT_vr99 B$) (veriT_vr100 C$)) (! (= (! (is_res$ @p_1387 @p_1035) :named @p_1434) (! (is_res$ @p_1388 @p_1035) :named @p_1439)) :named @p_1441)) :named @p_1430)) :named @p_1443)) :named @p_1445)) :named @p_1412) (! (or @p_1333 (! (and (! (= @p_789 @p_1333) :named @p_1410) (! (forall ((veriT_vr93 F$) (veriT_vr102 D$)) (! (= (! (is_res$b @p_788 @p_1039) :named @p_1449) (! (is_res$b @p_1389 @p_1039) :named @p_1454)) :named @p_1456)) :named @p_1447)) :named @p_1458)) :named @p_1460)) :named @p_1390))) :rule forall_inst :args ((:= veriT_vr94 veriT_sk3) (:= veriT_vr95 veriT_sk0) (:= veriT_vr96 veriT_sk1) (:= veriT_vr101 veriT_sk4)))
+(anchor :step t225)
+(assume t225.h1 @p_1390)
+(anchor :step t225.t2 :args ((:= (veriT_vr97 A$) veriT_vr165) (:= (veriT_vr98 C$) veriT_vr166)))
+(step t225.t2.t1 (cl (! (= veriT_vr97 veriT_vr165) :named @p_1419)) :rule refl)
+(step t225.t2.t2 (cl (! (= @p_1417 (! (fun_app$ veriT_sk0 veriT_vr165) :named @p_1418)) :named @p_1425)) :rule cong :premises (t225.t2.t1))
+(step t225.t2.t3 (cl (! (= veriT_vr98 veriT_vr166) :named @p_1422)) :rule refl)
+(step t225.t2.t4 (cl (! (= @p_1388 (! (run$ @p_1418 veriT_vr166) :named @p_1415)) :named @p_1426)) :rule cong :premises (t225.t2.t2 t225.t2.t3))
+(step t225.t2.t5 (cl (! (= @p_1386 (! (is_fail$ @p_1415) :named @p_1413)) :named @p_1427)) :rule cong :premises (t225.t2.t4))
+(step t225.t2.t6 (cl @p_1419) :rule refl)
+(step t225.t2.t7 (cl (! (= @p_1420 (! (fun_app$ veriT_sk1 veriT_vr165) :named @p_1421)) :named @p_1432)) :rule cong :premises (t225.t2.t6))
+(step t225.t2.t8 (cl @p_1422) :rule refl)
+(step t225.t2.t9 (cl (! (= @p_1387 (! (run$ @p_1421 veriT_vr166) :named @p_1414)) :named @p_1433)) :rule cong :premises (t225.t2.t7 t225.t2.t8))
+(step t225.t2.t10 (cl (= @p_1423 (! (is_fail$ @p_1414) :named @p_1424))) :rule cong :premises (t225.t2.t9))
+(step t225.t2.t11 (cl @p_1419) :rule refl)
+(step t225.t2.t12 (cl @p_1425) :rule cong :premises (t225.t2.t11))
+(step t225.t2.t13 (cl @p_1422) :rule refl)
+(step t225.t2.t14 (cl @p_1426) :rule cong :premises (t225.t2.t12 t225.t2.t13))
+(step t225.t2.t15 (cl @p_1427) :rule cong :premises (t225.t2.t14))
+(step t225.t2.t16 (cl (= @p_1428 (! (= @p_1424 @p_1413) :named @p_1429))) :rule cong :premises (t225.t2.t10 t225.t2.t15))
+(anchor :step t225.t2.t17 :args ((:= (veriT_vr99 B$) veriT_vr167) (:= (veriT_vr100 C$) veriT_vr168)))
+(step t225.t2.t17.t1 (cl @p_1419) :rule refl)
+(step t225.t2.t17.t2 (cl @p_1432) :rule cong :premises (t225.t2.t17.t1))
+(step t225.t2.t17.t3 (cl @p_1422) :rule refl)
+(step t225.t2.t17.t4 (cl @p_1433) :rule cong :premises (t225.t2.t17.t2 t225.t2.t17.t3))
+(step t225.t2.t17.t5 (cl (! (= veriT_vr99 veriT_vr167) :named @p_1436)) :rule refl)
+(step t225.t2.t17.t6 (cl (! (= veriT_vr100 veriT_vr168) :named @p_1437)) :rule refl)
+(step t225.t2.t17.t7 (cl (! (= @p_1035 (! (pair$ veriT_vr167 veriT_vr168) :named @p_1416)) :named @p_1438)) :rule cong :premises (t225.t2.t17.t5 t225.t2.t17.t6))
+(step t225.t2.t17.t8 (cl (= @p_1434 (! (is_res$ @p_1414 @p_1416) :named @p_1435))) :rule cong :premises (t225.t2.t17.t4 t225.t2.t17.t7))
+(step t225.t2.t17.t9 (cl @p_1419) :rule refl)
+(step t225.t2.t17.t10 (cl @p_1425) :rule cong :premises (t225.t2.t17.t9))
+(step t225.t2.t17.t11 (cl @p_1422) :rule refl)
+(step t225.t2.t17.t12 (cl @p_1426) :rule cong :premises (t225.t2.t17.t10 t225.t2.t17.t11))
+(step t225.t2.t17.t13 (cl @p_1436) :rule refl)
+(step t225.t2.t17.t14 (cl @p_1437) :rule refl)
+(step t225.t2.t17.t15 (cl @p_1438) :rule cong :premises (t225.t2.t17.t13 t225.t2.t17.t14))
+(step t225.t2.t17.t16 (cl (= @p_1439 (! (is_res$ @p_1415 @p_1416) :named @p_1440))) :rule cong :premises (t225.t2.t17.t12 t225.t2.t17.t15))
+(step t225.t2.t17.t17 (cl (= @p_1441 (! (= @p_1435 @p_1440) :named @p_1442))) :rule cong :premises (t225.t2.t17.t8 t225.t2.t17.t16))
+(step t225.t2.t17 (cl (= @p_1430 (! (forall ((veriT_vr167 B$) (veriT_vr168 C$)) @p_1442) :named @p_1431))) :rule bind)
+(step t225.t2.t18 (cl (= @p_1443 (! (and @p_1429 @p_1431) :named @p_1444))) :rule cong :premises (t225.t2.t16 t225.t2.t17))
+(step t225.t2.t19 (cl (= @p_1445 (! (or @p_1413 @p_1444) :named @p_1446))) :rule cong :premises (t225.t2.t5 t225.t2.t18))
+(step t225.t2 (cl (= @p_1412 (! (forall ((veriT_vr165 A$) (veriT_vr166 C$)) @p_1446) :named @p_1462))) :rule bind)
+(anchor :step t225.t3 :args ((:= (veriT_vr93 F$) veriT_vr169) (:= (veriT_vr102 D$) veriT_vr170)))
+(step t225.t3.t1 (cl (! (= veriT_vr93 veriT_vr169) :named @p_1451)) :rule refl)
+(step t225.t3.t2 (cl (! (= veriT_vr102 veriT_vr170) :named @p_1452)) :rule refl)
+(step t225.t3.t3 (cl (! (= @p_1039 (! (pair$b veriT_vr169 veriT_vr170) :named @p_1448)) :named @p_1453)) :rule cong :premises (t225.t3.t1 t225.t3.t2))
+(step t225.t3.t4 (cl (= @p_1449 (! (is_res$b @p_788 @p_1448) :named @p_1450))) :rule cong :premises (t225.t3.t3))
+(step t225.t3.t5 (cl @p_1451) :rule refl)
+(step t225.t3.t6 (cl @p_1452) :rule refl)
+(step t225.t3.t7 (cl @p_1453) :rule cong :premises (t225.t3.t5 t225.t3.t6))
+(step t225.t3.t8 (cl (= @p_1454 (! (is_res$b @p_1389 @p_1448) :named @p_1455))) :rule cong :premises (t225.t3.t7))
+(step t225.t3.t9 (cl (= @p_1456 (! (= @p_1450 @p_1455) :named @p_1457))) :rule cong :premises (t225.t3.t4 t225.t3.t8))
+(step t225.t3 (cl (= @p_1447 (! (forall ((veriT_vr169 F$) (veriT_vr170 D$)) @p_1457) :named @p_1459))) :rule bind)
+(step t225.t4 (cl (= @p_1458 (! (and @p_1410 @p_1459) :named @p_1461))) :rule cong :premises (t225.t3))
+(step t225.t5 (cl (= @p_1460 (! (or @p_1333 @p_1461) :named @p_1463))) :rule cong :premises (t225.t4))
+(step t225.t6 (cl (! (= @p_1390 (! (=> @p_1462 @p_1463) :named @p_1466)) :named @p_1464)) :rule cong :premises (t225.t2 t225.t5))
+(step t225.t7 (cl (not @p_1464) (! (not @p_1390) :named @p_1465) @p_1466) :rule equiv_pos2)
+(step t225.t8 (cl @p_1466) :rule th_resolution :premises (t225.h1 t225.t6 t225.t7))
+(anchor :step t225.t9 :args ((:= (veriT_vr165 A$) veriT_vr171) (:= (veriT_vr166 C$) veriT_vr172)))
+(step t225.t9.t1 (cl (! (= veriT_vr165 veriT_vr171) :named @p_1469)) :rule refl)
+(step t225.t9.t2 (cl (! (= @p_1418 @p_1468) :named @p_1473)) :rule cong :premises (t225.t9.t1))
+(step t225.t9.t3 (cl (! (= veriT_vr166 veriT_vr172) :named @p_1471)) :rule refl)
+(step t225.t9.t4 (cl (! (= @p_1415 @p_1393) :named @p_1474)) :rule cong :premises (t225.t9.t2 t225.t9.t3))
+(step t225.t9.t5 (cl (! (= @p_1413 @p_1391) :named @p_1475)) :rule cong :premises (t225.t9.t4))
+(step t225.t9.t6 (cl @p_1469) :rule refl)
+(step t225.t9.t7 (cl (! (= @p_1421 @p_1470) :named @p_1478)) :rule cong :premises (t225.t9.t6))
+(step t225.t9.t8 (cl @p_1471) :rule refl)
+(step t225.t9.t9 (cl (! (= @p_1414 @p_1392) :named @p_1479)) :rule cong :premises (t225.t9.t7 t225.t9.t8))
+(step t225.t9.t10 (cl (= @p_1424 @p_1472)) :rule cong :premises (t225.t9.t9))
+(step t225.t9.t11 (cl @p_1469) :rule refl)
+(step t225.t9.t12 (cl @p_1473) :rule cong :premises (t225.t9.t11))
+(step t225.t9.t13 (cl @p_1471) :rule refl)
+(step t225.t9.t14 (cl @p_1474) :rule cong :premises (t225.t9.t12 t225.t9.t13))
+(step t225.t9.t15 (cl @p_1475) :rule cong :premises (t225.t9.t14))
+(step t225.t9.t16 (cl (= @p_1429 @p_1476)) :rule cong :premises (t225.t9.t10 t225.t9.t15))
+(anchor :step t225.t9.t17 :args ((:= (veriT_vr167 B$) veriT_vr173) (:= (veriT_vr168 C$) veriT_vr174)))
+(step t225.t9.t17.t1 (cl @p_1469) :rule refl)
+(step t225.t9.t17.t2 (cl @p_1478) :rule cong :premises (t225.t9.t17.t1))
+(step t225.t9.t17.t3 (cl @p_1471) :rule refl)
+(step t225.t9.t17.t4 (cl @p_1479) :rule cong :premises (t225.t9.t17.t2 t225.t9.t17.t3))
+(step t225.t9.t17.t5 (cl (! (= veriT_vr167 veriT_vr173) :named @p_1481)) :rule refl)
+(step t225.t9.t17.t6 (cl (! (= veriT_vr168 veriT_vr174) :named @p_1482)) :rule refl)
+(step t225.t9.t17.t7 (cl (! (= @p_1416 @p_1394) :named @p_1483)) :rule cong :premises (t225.t9.t17.t5 t225.t9.t17.t6))
+(step t225.t9.t17.t8 (cl (= @p_1435 @p_1480)) :rule cong :premises (t225.t9.t17.t4 t225.t9.t17.t7))
+(step t225.t9.t17.t9 (cl @p_1469) :rule refl)
+(step t225.t9.t17.t10 (cl @p_1473) :rule cong :premises (t225.t9.t17.t9))
+(step t225.t9.t17.t11 (cl @p_1471) :rule refl)
+(step t225.t9.t17.t12 (cl @p_1474) :rule cong :premises (t225.t9.t17.t10 t225.t9.t17.t11))
+(step t225.t9.t17.t13 (cl @p_1481) :rule refl)
+(step t225.t9.t17.t14 (cl @p_1482) :rule refl)
+(step t225.t9.t17.t15 (cl @p_1483) :rule cong :premises (t225.t9.t17.t13 t225.t9.t17.t14))
+(step t225.t9.t17.t16 (cl (= @p_1440 @p_1484)) :rule cong :premises (t225.t9.t17.t12 t225.t9.t17.t15))
+(step t225.t9.t17.t17 (cl (= @p_1442 @p_1485)) :rule cong :premises (t225.t9.t17.t8 t225.t9.t17.t16))
+(step t225.t9.t17 (cl (= @p_1431 @p_1477)) :rule bind)
+(step t225.t9.t18 (cl (= @p_1444 @p_1486)) :rule cong :premises (t225.t9.t16 t225.t9.t17))
+(step t225.t9.t19 (cl (= @p_1446 @p_1467)) :rule cong :premises (t225.t9.t5 t225.t9.t18))
+(step t225.t9 (cl (= @p_1462 (! (forall ((veriT_vr171 A$) (veriT_vr172 C$)) @p_1467) :named @p_1496))) :rule bind)
+(anchor :step t225.t10 :args ((:= (veriT_vr169 F$) veriT_vr175) (:= (veriT_vr170 D$) veriT_vr176)))
+(step t225.t10.t1 (cl (! (= veriT_vr169 veriT_vr175) :named @p_1489)) :rule refl)
+(step t225.t10.t2 (cl (! (= veriT_vr170 veriT_vr176) :named @p_1490)) :rule refl)
+(step t225.t10.t3 (cl (! (= @p_1448 (! (pair$b veriT_vr175 veriT_vr176) :named @p_1487)) :named @p_1491)) :rule cong :premises (t225.t10.t1 t225.t10.t2))
+(step t225.t10.t4 (cl (= @p_1450 (! (is_res$b @p_788 @p_1487) :named @p_1488))) :rule cong :premises (t225.t10.t3))
+(step t225.t10.t5 (cl @p_1489) :rule refl)
+(step t225.t10.t6 (cl @p_1490) :rule refl)
+(step t225.t10.t7 (cl @p_1491) :rule cong :premises (t225.t10.t5 t225.t10.t6))
+(step t225.t10.t8 (cl (= @p_1455 (! (is_res$b @p_1389 @p_1487) :named @p_1492))) :rule cong :premises (t225.t10.t7))
+(step t225.t10.t9 (cl (= @p_1457 (! (= @p_1488 @p_1492) :named @p_1493))) :rule cong :premises (t225.t10.t4 t225.t10.t8))
+(step t225.t10 (cl (= @p_1459 (! (forall ((veriT_vr175 F$) (veriT_vr176 D$)) @p_1493) :named @p_1494))) :rule bind)
+(step t225.t11 (cl (= @p_1461 (! (and @p_1410 @p_1494) :named @p_1495))) :rule cong :premises (t225.t10))
+(step t225.t12 (cl (= @p_1463 (! (or @p_1333 @p_1495) :named @p_1497))) :rule cong :premises (t225.t11))
+(step t225.t13 (cl (! (= @p_1466 (! (=> @p_1496 @p_1497) :named @p_1499)) :named @p_1498)) :rule cong :premises (t225.t9 t225.t12))
+(step t225.t14 (cl (not @p_1498) (not @p_1466) @p_1499) :rule equiv_pos2)
+(step t225.t15 (cl @p_1499) :rule th_resolution :premises (t225.t8 t225.t13 t225.t14))
+(anchor :step t225.t16 :args ((:= (veriT_vr171 A$) veriT_sk25) (:= (veriT_vr172 C$) veriT_sk26)))
+(step t225.t16.t1 (cl (! (= veriT_vr171 veriT_sk25) :named @p_1502)) :rule refl)
+(step t225.t16.t2 (cl (! (= @p_1468 (! (fun_app$ veriT_sk0 veriT_sk25) :named @p_1501)) :named @p_1506)) :rule cong :premises (t225.t16.t1))
+(step t225.t16.t3 (cl (! (= veriT_vr172 veriT_sk26) :named @p_1504)) :rule refl)
+(step t225.t16.t4 (cl (! (= @p_1393 (! (run$ @p_1501 veriT_sk26) :named @p_1408)) :named @p_1507)) :rule cong :premises (t225.t16.t2 t225.t16.t3))
+(step t225.t16.t5 (cl (! (= @p_1391 (! (is_fail$ @p_1408) :named @p_1400)) :named @p_1508)) :rule cong :premises (t225.t16.t4))
+(step t225.t16.t6 (cl @p_1502) :rule refl)
+(step t225.t16.t7 (cl (! (= @p_1470 (! (fun_app$ veriT_sk1 veriT_sk25) :named @p_1503)) :named @p_1511)) :rule cong :premises (t225.t16.t6))
+(step t225.t16.t8 (cl @p_1504) :rule refl)
+(step t225.t16.t9 (cl (! (= @p_1392 (! (run$ @p_1503 veriT_sk26) :named @p_1401)) :named @p_1512)) :rule cong :premises (t225.t16.t7 t225.t16.t8))
+(step t225.t16.t10 (cl (= @p_1472 (! (is_fail$ @p_1401) :named @p_1505))) :rule cong :premises (t225.t16.t9))
+(step t225.t16.t11 (cl @p_1502) :rule refl)
+(step t225.t16.t12 (cl @p_1506) :rule cong :premises (t225.t16.t11))
+(step t225.t16.t13 (cl @p_1504) :rule refl)
+(step t225.t16.t14 (cl @p_1507) :rule cong :premises (t225.t16.t12 t225.t16.t13))
+(step t225.t16.t15 (cl @p_1508) :rule cong :premises (t225.t16.t14))
+(step t225.t16.t16 (cl (= @p_1476 (! (= @p_1505 @p_1400) :named @p_1509))) :rule cong :premises (t225.t16.t10 t225.t16.t15))
+(anchor :step t225.t16.t17 :args ((:= (veriT_vr173 B$) veriT_sk27) (:= (veriT_vr174 C$) veriT_sk28)))
+(step t225.t16.t17.t1 (cl @p_1502) :rule refl)
+(step t225.t16.t17.t2 (cl @p_1511) :rule cong :premises (t225.t16.t17.t1))
+(step t225.t16.t17.t3 (cl @p_1504) :rule refl)
+(step t225.t16.t17.t4 (cl @p_1512) :rule cong :premises (t225.t16.t17.t2 t225.t16.t17.t3))
+(step t225.t16.t17.t5 (cl (! (= veriT_vr173 veriT_sk27) :named @p_1515)) :rule refl)
+(step t225.t16.t17.t6 (cl (! (= veriT_vr174 veriT_sk28) :named @p_1516)) :rule refl)
+(step t225.t16.t17.t7 (cl (! (= @p_1394 (! (pair$ veriT_sk27 veriT_sk28) :named @p_1409)) :named @p_1517)) :rule cong :premises (t225.t16.t17.t5 t225.t16.t17.t6))
+(step t225.t16.t17.t8 (cl (= @p_1480 (! (is_res$ @p_1401 @p_1409) :named @p_1514))) :rule cong :premises (t225.t16.t17.t4 t225.t16.t17.t7))
+(step t225.t16.t17.t9 (cl @p_1502) :rule refl)
+(step t225.t16.t17.t10 (cl @p_1506) :rule cong :premises (t225.t16.t17.t9))
+(step t225.t16.t17.t11 (cl @p_1504) :rule refl)
+(step t225.t16.t17.t12 (cl @p_1507) :rule cong :premises (t225.t16.t17.t10 t225.t16.t17.t11))
+(step t225.t16.t17.t13 (cl @p_1515) :rule refl)
+(step t225.t16.t17.t14 (cl @p_1516) :rule refl)
+(step t225.t16.t17.t15 (cl @p_1517) :rule cong :premises (t225.t16.t17.t13 t225.t16.t17.t14))
+(step t225.t16.t17.t16 (cl (= @p_1484 (! (is_res$ @p_1408 @p_1409) :named @p_1518))) :rule cong :premises (t225.t16.t17.t12 t225.t16.t17.t15))
+(step t225.t16.t17.t17 (cl (= @p_1485 (! (= @p_1514 @p_1518) :named @p_1510))) :rule cong :premises (t225.t16.t17.t8 t225.t16.t17.t16))
+(step t225.t16.t17 (cl (= @p_1477 @p_1510)) :rule sko_forall)
+(step t225.t16.t18 (cl (= @p_1486 (! (and @p_1509 @p_1510) :named @p_1519))) :rule cong :premises (t225.t16.t16 t225.t16.t17))
+(step t225.t16.t19 (cl (= @p_1467 (! (or @p_1400 @p_1519) :named @p_1500))) :rule cong :premises (t225.t16.t5 t225.t16.t18))
+(step t225.t16 (cl (= @p_1496 @p_1500)) :rule sko_forall)
+(step t225.t17 (cl (! (= @p_1499 (! (=> @p_1500 @p_1497) :named @p_1521)) :named @p_1520)) :rule cong :premises (t225.t16))
+(step t225.t18 (cl (not @p_1520) (not @p_1499) @p_1521) :rule equiv_pos2)
+(step t225.t19 (cl @p_1521) :rule th_resolution :premises (t225.t15 t225.t17 t225.t18))
+(anchor :step t225.t20 :args ((:= (veriT_vr175 F$) veriT_vr177) (:= (veriT_vr176 D$) veriT_vr178)))
+(step t225.t20.t1 (cl (! (= veriT_vr175 veriT_vr177) :named @p_1524)) :rule refl)
+(step t225.t20.t2 (cl (! (= veriT_vr176 veriT_vr178) :named @p_1525)) :rule refl)
+(step t225.t20.t3 (cl (! (= @p_1487 (! (pair$b veriT_vr177 veriT_vr178) :named @p_1411)) :named @p_1526)) :rule cong :premises (t225.t20.t1 t225.t20.t2))
+(step t225.t20.t4 (cl (= @p_1488 (! (is_res$b @p_788 @p_1411) :named @p_1523))) :rule cong :premises (t225.t20.t3))
+(step t225.t20.t5 (cl @p_1524) :rule refl)
+(step t225.t20.t6 (cl @p_1525) :rule refl)
+(step t225.t20.t7 (cl @p_1526) :rule cong :premises (t225.t20.t5 t225.t20.t6))
+(step t225.t20.t8 (cl (= @p_1492 (! (is_res$b @p_1389 @p_1411) :named @p_1527))) :rule cong :premises (t225.t20.t7))
+(step t225.t20.t9 (cl (= @p_1493 (! (= @p_1523 @p_1527) :named @p_1528))) :rule cong :premises (t225.t20.t4 t225.t20.t8))
+(step t225.t20 (cl (= @p_1494 (! (forall ((veriT_vr177 F$) (veriT_vr178 D$)) @p_1528) :named @p_1522))) :rule bind)
+(step t225.t21 (cl (= @p_1495 (! (and @p_1410 @p_1522) :named @p_1529))) :rule cong :premises (t225.t20))
+(step t225.t22 (cl (= @p_1497 (! (or @p_1333 @p_1529) :named @p_1530))) :rule cong :premises (t225.t21))
+(step t225.t23 (cl (! (= @p_1521 (! (=> @p_1500 @p_1530) :named @p_1531)) :named @p_1532)) :rule cong :premises (t225.t22))
+(step t225.t24 (cl (not @p_1532) (not @p_1521) @p_1531) :rule equiv_pos2)
+(step t225.t25 (cl @p_1531) :rule th_resolution :premises (t225.t19 t225.t23 t225.t24))
+(step t225 (cl @p_1465 @p_1531) :rule subproof :discharge (h1))
+(step t226 (cl @p_1385 @p_1390) :rule or :premises (t224))
+(step t227 (cl (! (or @p_1385 @p_1531) :named @p_1534) @p_1533) :rule or_neg)
+(step t228 (cl @p_1534 @p_1154) :rule th_resolution :premises (t159 t227))
+(step t229 (cl @p_1534 (! (not @p_1531) :named @p_1678)) :rule or_neg)
+(step t230 (cl @p_1534) :rule th_resolution :premises (t226 t225 t228 t229))
+(step t231 (cl (or @p_1385 (! (=> @p_1412 (! (or @p_1329 (! (and (! (= (is_fail$b @p_826) @p_1329) :named @p_1555) (! (forall ((veriT_vr93 F$) (veriT_vr102 D$)) (! (= (! (is_res$b @p_826 @p_1039) :named @p_1583) (! (is_res$b @p_1353 @p_1039) :named @p_1588)) :named @p_1590)) :named @p_1581)) :named @p_1592)) :named @p_1594)) :named @p_1535))) :rule forall_inst :args ((:= veriT_vr94 veriT_sk9) (:= veriT_vr95 veriT_sk0) (:= veriT_vr96 veriT_sk1) (:= veriT_vr101 veriT_sk10)))
+(anchor :step t232)
+(assume t232.h1 @p_1535)
+(anchor :step t232.t2 :args ((:= (veriT_vr97 A$) veriT_vr179) (:= (veriT_vr98 C$) veriT_vr180)))
+(step t232.t2.t1 (cl (! (= veriT_vr97 veriT_vr179) :named @p_1562)) :rule refl)
+(step t232.t2.t2 (cl (! (= @p_1417 (! (fun_app$ veriT_sk0 veriT_vr179) :named @p_1561)) :named @p_1566)) :rule cong :premises (t232.t2.t1))
+(step t232.t2.t3 (cl (! (= veriT_vr98 veriT_vr180) :named @p_1564)) :rule refl)
+(step t232.t2.t4 (cl (! (= @p_1388 (! (run$ @p_1561 veriT_vr180) :named @p_1559)) :named @p_1567)) :rule cong :premises (t232.t2.t2 t232.t2.t3))
+(step t232.t2.t5 (cl (! (= @p_1386 (! (is_fail$ @p_1559) :named @p_1557)) :named @p_1568)) :rule cong :premises (t232.t2.t4))
+(step t232.t2.t6 (cl @p_1562) :rule refl)
+(step t232.t2.t7 (cl (! (= @p_1420 (! (fun_app$ veriT_sk1 veriT_vr179) :named @p_1563)) :named @p_1571)) :rule cong :premises (t232.t2.t6))
+(step t232.t2.t8 (cl @p_1564) :rule refl)
+(step t232.t2.t9 (cl (! (= @p_1387 (! (run$ @p_1563 veriT_vr180) :named @p_1558)) :named @p_1572)) :rule cong :premises (t232.t2.t7 t232.t2.t8))
+(step t232.t2.t10 (cl (= @p_1423 (! (is_fail$ @p_1558) :named @p_1565))) :rule cong :premises (t232.t2.t9))
+(step t232.t2.t11 (cl @p_1562) :rule refl)
+(step t232.t2.t12 (cl @p_1566) :rule cong :premises (t232.t2.t11))
+(step t232.t2.t13 (cl @p_1564) :rule refl)
+(step t232.t2.t14 (cl @p_1567) :rule cong :premises (t232.t2.t12 t232.t2.t13))
+(step t232.t2.t15 (cl @p_1568) :rule cong :premises (t232.t2.t14))
+(step t232.t2.t16 (cl (= @p_1428 (! (= @p_1565 @p_1557) :named @p_1569))) :rule cong :premises (t232.t2.t10 t232.t2.t15))
+(anchor :step t232.t2.t17 :args ((:= (veriT_vr99 B$) veriT_vr181) (:= (veriT_vr100 C$) veriT_vr182)))
+(step t232.t2.t17.t1 (cl @p_1562) :rule refl)
+(step t232.t2.t17.t2 (cl @p_1571) :rule cong :premises (t232.t2.t17.t1))
+(step t232.t2.t17.t3 (cl @p_1564) :rule refl)
+(step t232.t2.t17.t4 (cl @p_1572) :rule cong :premises (t232.t2.t17.t2 t232.t2.t17.t3))
+(step t232.t2.t17.t5 (cl (! (= veriT_vr99 veriT_vr181) :named @p_1574)) :rule refl)
+(step t232.t2.t17.t6 (cl (! (= veriT_vr100 veriT_vr182) :named @p_1575)) :rule refl)
+(step t232.t2.t17.t7 (cl (! (= @p_1035 (! (pair$ veriT_vr181 veriT_vr182) :named @p_1560)) :named @p_1576)) :rule cong :premises (t232.t2.t17.t5 t232.t2.t17.t6))
+(step t232.t2.t17.t8 (cl (= @p_1434 (! (is_res$ @p_1558 @p_1560) :named @p_1573))) :rule cong :premises (t232.t2.t17.t4 t232.t2.t17.t7))
+(step t232.t2.t17.t9 (cl @p_1562) :rule refl)
+(step t232.t2.t17.t10 (cl @p_1566) :rule cong :premises (t232.t2.t17.t9))
+(step t232.t2.t17.t11 (cl @p_1564) :rule refl)
+(step t232.t2.t17.t12 (cl @p_1567) :rule cong :premises (t232.t2.t17.t10 t232.t2.t17.t11))
+(step t232.t2.t17.t13 (cl @p_1574) :rule refl)
+(step t232.t2.t17.t14 (cl @p_1575) :rule refl)
+(step t232.t2.t17.t15 (cl @p_1576) :rule cong :premises (t232.t2.t17.t13 t232.t2.t17.t14))
+(step t232.t2.t17.t16 (cl (= @p_1439 (! (is_res$ @p_1559 @p_1560) :named @p_1577))) :rule cong :premises (t232.t2.t17.t12 t232.t2.t17.t15))
+(step t232.t2.t17.t17 (cl (= @p_1441 (! (= @p_1573 @p_1577) :named @p_1578))) :rule cong :premises (t232.t2.t17.t8 t232.t2.t17.t16))
+(step t232.t2.t17 (cl (= @p_1430 (! (forall ((veriT_vr181 B$) (veriT_vr182 C$)) @p_1578) :named @p_1570))) :rule bind)
+(step t232.t2.t18 (cl (= @p_1443 (! (and @p_1569 @p_1570) :named @p_1579))) :rule cong :premises (t232.t2.t16 t232.t2.t17))
+(step t232.t2.t19 (cl (= @p_1445 (! (or @p_1557 @p_1579) :named @p_1580))) :rule cong :premises (t232.t2.t5 t232.t2.t18))
+(step t232.t2 (cl (= @p_1412 (! (forall ((veriT_vr179 A$) (veriT_vr180 C$)) @p_1580) :named @p_1596))) :rule bind)
+(anchor :step t232.t3 :args ((:= (veriT_vr93 F$) veriT_vr183) (:= (veriT_vr102 D$) veriT_vr184)))
+(step t232.t3.t1 (cl (! (= veriT_vr93 veriT_vr183) :named @p_1585)) :rule refl)
+(step t232.t3.t2 (cl (! (= veriT_vr102 veriT_vr184) :named @p_1586)) :rule refl)
+(step t232.t3.t3 (cl (! (= @p_1039 (! (pair$b veriT_vr183 veriT_vr184) :named @p_1582)) :named @p_1587)) :rule cong :premises (t232.t3.t1 t232.t3.t2))
+(step t232.t3.t4 (cl (= @p_1583 (! (is_res$b @p_826 @p_1582) :named @p_1584))) :rule cong :premises (t232.t3.t3))
+(step t232.t3.t5 (cl @p_1585) :rule refl)
+(step t232.t3.t6 (cl @p_1586) :rule refl)
+(step t232.t3.t7 (cl @p_1587) :rule cong :premises (t232.t3.t5 t232.t3.t6))
+(step t232.t3.t8 (cl (= @p_1588 (! (is_res$b @p_1353 @p_1582) :named @p_1589))) :rule cong :premises (t232.t3.t7))
+(step t232.t3.t9 (cl (= @p_1590 (! (= @p_1584 @p_1589) :named @p_1591))) :rule cong :premises (t232.t3.t4 t232.t3.t8))
+(step t232.t3 (cl (= @p_1581 (! (forall ((veriT_vr183 F$) (veriT_vr184 D$)) @p_1591) :named @p_1593))) :rule bind)
+(step t232.t4 (cl (= @p_1592 (! (and @p_1555 @p_1593) :named @p_1595))) :rule cong :premises (t232.t3))
+(step t232.t5 (cl (= @p_1594 (! (or @p_1329 @p_1595) :named @p_1597))) :rule cong :premises (t232.t4))
+(step t232.t6 (cl (! (= @p_1535 (! (=> @p_1596 @p_1597) :named @p_1600)) :named @p_1598)) :rule cong :premises (t232.t2 t232.t5))
+(step t232.t7 (cl (not @p_1598) (! (not @p_1535) :named @p_1599) @p_1600) :rule equiv_pos2)
+(step t232.t8 (cl @p_1600) :rule th_resolution :premises (t232.h1 t232.t6 t232.t7))
+(anchor :step t232.t9 :args ((:= (veriT_vr179 A$) veriT_vr185) (:= (veriT_vr180 C$) veriT_vr186)))
+(step t232.t9.t1 (cl (! (= veriT_vr179 veriT_vr185) :named @p_1603)) :rule refl)
+(step t232.t9.t2 (cl (! (= @p_1561 @p_1602) :named @p_1607)) :rule cong :premises (t232.t9.t1))
+(step t232.t9.t3 (cl (! (= veriT_vr180 veriT_vr186) :named @p_1605)) :rule refl)
+(step t232.t9.t4 (cl (! (= @p_1559 @p_1538) :named @p_1608)) :rule cong :premises (t232.t9.t2 t232.t9.t3))
+(step t232.t9.t5 (cl (! (= @p_1557 @p_1536) :named @p_1609)) :rule cong :premises (t232.t9.t4))
+(step t232.t9.t6 (cl @p_1603) :rule refl)
+(step t232.t9.t7 (cl (! (= @p_1563 @p_1604) :named @p_1612)) :rule cong :premises (t232.t9.t6))
+(step t232.t9.t8 (cl @p_1605) :rule refl)
+(step t232.t9.t9 (cl (! (= @p_1558 @p_1537) :named @p_1613)) :rule cong :premises (t232.t9.t7 t232.t9.t8))
+(step t232.t9.t10 (cl (= @p_1565 @p_1606)) :rule cong :premises (t232.t9.t9))
+(step t232.t9.t11 (cl @p_1603) :rule refl)
+(step t232.t9.t12 (cl @p_1607) :rule cong :premises (t232.t9.t11))
+(step t232.t9.t13 (cl @p_1605) :rule refl)
+(step t232.t9.t14 (cl @p_1608) :rule cong :premises (t232.t9.t12 t232.t9.t13))
+(step t232.t9.t15 (cl @p_1609) :rule cong :premises (t232.t9.t14))
+(step t232.t9.t16 (cl (= @p_1569 @p_1610)) :rule cong :premises (t232.t9.t10 t232.t9.t15))
+(anchor :step t232.t9.t17 :args ((:= (veriT_vr181 B$) veriT_vr187) (:= (veriT_vr182 C$) veriT_vr188)))
+(step t232.t9.t17.t1 (cl @p_1603) :rule refl)
+(step t232.t9.t17.t2 (cl @p_1612) :rule cong :premises (t232.t9.t17.t1))
+(step t232.t9.t17.t3 (cl @p_1605) :rule refl)
+(step t232.t9.t17.t4 (cl @p_1613) :rule cong :premises (t232.t9.t17.t2 t232.t9.t17.t3))
+(step t232.t9.t17.t5 (cl (! (= veriT_vr181 veriT_vr187) :named @p_1615)) :rule refl)
+(step t232.t9.t17.t6 (cl (! (= veriT_vr182 veriT_vr188) :named @p_1616)) :rule refl)
+(step t232.t9.t17.t7 (cl (! (= @p_1560 @p_1539) :named @p_1617)) :rule cong :premises (t232.t9.t17.t5 t232.t9.t17.t6))
+(step t232.t9.t17.t8 (cl (= @p_1573 @p_1614)) :rule cong :premises (t232.t9.t17.t4 t232.t9.t17.t7))
+(step t232.t9.t17.t9 (cl @p_1603) :rule refl)
+(step t232.t9.t17.t10 (cl @p_1607) :rule cong :premises (t232.t9.t17.t9))
+(step t232.t9.t17.t11 (cl @p_1605) :rule refl)
+(step t232.t9.t17.t12 (cl @p_1608) :rule cong :premises (t232.t9.t17.t10 t232.t9.t17.t11))
+(step t232.t9.t17.t13 (cl @p_1615) :rule refl)
+(step t232.t9.t17.t14 (cl @p_1616) :rule refl)
+(step t232.t9.t17.t15 (cl @p_1617) :rule cong :premises (t232.t9.t17.t13 t232.t9.t17.t14))
+(step t232.t9.t17.t16 (cl (= @p_1577 @p_1618)) :rule cong :premises (t232.t9.t17.t12 t232.t9.t17.t15))
+(step t232.t9.t17.t17 (cl (= @p_1578 @p_1619)) :rule cong :premises (t232.t9.t17.t8 t232.t9.t17.t16))
+(step t232.t9.t17 (cl (= @p_1570 @p_1611)) :rule bind)
+(step t232.t9.t18 (cl (= @p_1579 @p_1620)) :rule cong :premises (t232.t9.t16 t232.t9.t17))
+(step t232.t9.t19 (cl (= @p_1580 @p_1601)) :rule cong :premises (t232.t9.t5 t232.t9.t18))
+(step t232.t9 (cl (= @p_1596 (! (forall ((veriT_vr185 A$) (veriT_vr186 C$)) @p_1601) :named @p_1630))) :rule bind)
+(anchor :step t232.t10 :args ((:= (veriT_vr183 F$) veriT_vr189) (:= (veriT_vr184 D$) veriT_vr190)))
+(step t232.t10.t1 (cl (! (= veriT_vr183 veriT_vr189) :named @p_1623)) :rule refl)
+(step t232.t10.t2 (cl (! (= veriT_vr184 veriT_vr190) :named @p_1624)) :rule refl)
+(step t232.t10.t3 (cl (! (= @p_1582 (! (pair$b veriT_vr189 veriT_vr190) :named @p_1621)) :named @p_1625)) :rule cong :premises (t232.t10.t1 t232.t10.t2))
+(step t232.t10.t4 (cl (= @p_1584 (! (is_res$b @p_826 @p_1621) :named @p_1622))) :rule cong :premises (t232.t10.t3))
+(step t232.t10.t5 (cl @p_1623) :rule refl)
+(step t232.t10.t6 (cl @p_1624) :rule refl)
+(step t232.t10.t7 (cl @p_1625) :rule cong :premises (t232.t10.t5 t232.t10.t6))
+(step t232.t10.t8 (cl (= @p_1589 (! (is_res$b @p_1353 @p_1621) :named @p_1626))) :rule cong :premises (t232.t10.t7))
+(step t232.t10.t9 (cl (= @p_1591 (! (= @p_1622 @p_1626) :named @p_1627))) :rule cong :premises (t232.t10.t4 t232.t10.t8))
+(step t232.t10 (cl (= @p_1593 (! (forall ((veriT_vr189 F$) (veriT_vr190 D$)) @p_1627) :named @p_1628))) :rule bind)
+(step t232.t11 (cl (= @p_1595 (! (and @p_1555 @p_1628) :named @p_1629))) :rule cong :premises (t232.t10))
+(step t232.t12 (cl (= @p_1597 (! (or @p_1329 @p_1629) :named @p_1631))) :rule cong :premises (t232.t11))
+(step t232.t13 (cl (! (= @p_1600 (! (=> @p_1630 @p_1631) :named @p_1633)) :named @p_1632)) :rule cong :premises (t232.t9 t232.t12))
+(step t232.t14 (cl (not @p_1632) (not @p_1600) @p_1633) :rule equiv_pos2)
+(step t232.t15 (cl @p_1633) :rule th_resolution :premises (t232.t8 t232.t13 t232.t14))
+(anchor :step t232.t16 :args ((:= (veriT_vr185 A$) veriT_sk29) (:= (veriT_vr186 C$) veriT_sk30)))
+(step t232.t16.t1 (cl (! (= veriT_vr185 veriT_sk29) :named @p_1636)) :rule refl)
+(step t232.t16.t2 (cl (! (= @p_1602 (! (fun_app$ veriT_sk0 veriT_sk29) :named @p_1635)) :named @p_1640)) :rule cong :premises (t232.t16.t1))
+(step t232.t16.t3 (cl (! (= veriT_vr186 veriT_sk30) :named @p_1638)) :rule refl)
+(step t232.t16.t4 (cl (! (= @p_1538 (! (run$ @p_1635 veriT_sk30) :named @p_1553)) :named @p_1641)) :rule cong :premises (t232.t16.t2 t232.t16.t3))
+(step t232.t16.t5 (cl (! (= @p_1536 (! (is_fail$ @p_1553) :named @p_1545)) :named @p_1642)) :rule cong :premises (t232.t16.t4))
+(step t232.t16.t6 (cl @p_1636) :rule refl)
+(step t232.t16.t7 (cl (! (= @p_1604 (! (fun_app$ veriT_sk1 veriT_sk29) :named @p_1637)) :named @p_1645)) :rule cong :premises (t232.t16.t6))
+(step t232.t16.t8 (cl @p_1638) :rule refl)
+(step t232.t16.t9 (cl (! (= @p_1537 (! (run$ @p_1637 veriT_sk30) :named @p_1546)) :named @p_1646)) :rule cong :premises (t232.t16.t7 t232.t16.t8))
+(step t232.t16.t10 (cl (= @p_1606 (! (is_fail$ @p_1546) :named @p_1639))) :rule cong :premises (t232.t16.t9))
+(step t232.t16.t11 (cl @p_1636) :rule refl)
+(step t232.t16.t12 (cl @p_1640) :rule cong :premises (t232.t16.t11))
+(step t232.t16.t13 (cl @p_1638) :rule refl)
+(step t232.t16.t14 (cl @p_1641) :rule cong :premises (t232.t16.t12 t232.t16.t13))
+(step t232.t16.t15 (cl @p_1642) :rule cong :premises (t232.t16.t14))
+(step t232.t16.t16 (cl (= @p_1610 (! (= @p_1639 @p_1545) :named @p_1643))) :rule cong :premises (t232.t16.t10 t232.t16.t15))
+(anchor :step t232.t16.t17 :args ((:= (veriT_vr187 B$) veriT_sk31) (:= (veriT_vr188 C$) veriT_sk32)))
+(step t232.t16.t17.t1 (cl @p_1636) :rule refl)
+(step t232.t16.t17.t2 (cl @p_1645) :rule cong :premises (t232.t16.t17.t1))
+(step t232.t16.t17.t3 (cl @p_1638) :rule refl)
+(step t232.t16.t17.t4 (cl @p_1646) :rule cong :premises (t232.t16.t17.t2 t232.t16.t17.t3))
+(step t232.t16.t17.t5 (cl (! (= veriT_vr187 veriT_sk31) :named @p_1649)) :rule refl)
+(step t232.t16.t17.t6 (cl (! (= veriT_vr188 veriT_sk32) :named @p_1650)) :rule refl)
+(step t232.t16.t17.t7 (cl (! (= @p_1539 (! (pair$ veriT_sk31 veriT_sk32) :named @p_1554)) :named @p_1651)) :rule cong :premises (t232.t16.t17.t5 t232.t16.t17.t6))
+(step t232.t16.t17.t8 (cl (= @p_1614 (! (is_res$ @p_1546 @p_1554) :named @p_1648))) :rule cong :premises (t232.t16.t17.t4 t232.t16.t17.t7))
+(step t232.t16.t17.t9 (cl @p_1636) :rule refl)
+(step t232.t16.t17.t10 (cl @p_1640) :rule cong :premises (t232.t16.t17.t9))
+(step t232.t16.t17.t11 (cl @p_1638) :rule refl)
+(step t232.t16.t17.t12 (cl @p_1641) :rule cong :premises (t232.t16.t17.t10 t232.t16.t17.t11))
+(step t232.t16.t17.t13 (cl @p_1649) :rule refl)
+(step t232.t16.t17.t14 (cl @p_1650) :rule refl)
+(step t232.t16.t17.t15 (cl @p_1651) :rule cong :premises (t232.t16.t17.t13 t232.t16.t17.t14))
+(step t232.t16.t17.t16 (cl (= @p_1618 (! (is_res$ @p_1553 @p_1554) :named @p_1652))) :rule cong :premises (t232.t16.t17.t12 t232.t16.t17.t15))
+(step t232.t16.t17.t17 (cl (= @p_1619 (! (= @p_1648 @p_1652) :named @p_1644))) :rule cong :premises (t232.t16.t17.t8 t232.t16.t17.t16))
+(step t232.t16.t17 (cl (= @p_1611 @p_1644)) :rule sko_forall)
+(step t232.t16.t18 (cl (= @p_1620 (! (and @p_1643 @p_1644) :named @p_1653))) :rule cong :premises (t232.t16.t16 t232.t16.t17))
+(step t232.t16.t19 (cl (= @p_1601 (! (or @p_1545 @p_1653) :named @p_1634))) :rule cong :premises (t232.t16.t5 t232.t16.t18))
+(step t232.t16 (cl (= @p_1630 @p_1634)) :rule sko_forall)
+(step t232.t17 (cl (! (= @p_1633 (! (=> @p_1634 @p_1631) :named @p_1655)) :named @p_1654)) :rule cong :premises (t232.t16))
+(step t232.t18 (cl (not @p_1654) (not @p_1633) @p_1655) :rule equiv_pos2)
+(step t232.t19 (cl @p_1655) :rule th_resolution :premises (t232.t15 t232.t17 t232.t18))
+(anchor :step t232.t20 :args ((:= (veriT_vr189 F$) veriT_vr191) (:= (veriT_vr190 D$) veriT_vr192)))
+(step t232.t20.t1 (cl (! (= veriT_vr189 veriT_vr191) :named @p_1658)) :rule refl)
+(step t232.t20.t2 (cl (! (= veriT_vr190 veriT_vr192) :named @p_1659)) :rule refl)
+(step t232.t20.t3 (cl (! (= @p_1621 (! (pair$b veriT_vr191 veriT_vr192) :named @p_1556)) :named @p_1660)) :rule cong :premises (t232.t20.t1 t232.t20.t2))
+(step t232.t20.t4 (cl (= @p_1622 (! (is_res$b @p_826 @p_1556) :named @p_1657))) :rule cong :premises (t232.t20.t3))
+(step t232.t20.t5 (cl @p_1658) :rule refl)
+(step t232.t20.t6 (cl @p_1659) :rule refl)
+(step t232.t20.t7 (cl @p_1660) :rule cong :premises (t232.t20.t5 t232.t20.t6))
+(step t232.t20.t8 (cl (= @p_1626 (! (is_res$b @p_1353 @p_1556) :named @p_1661))) :rule cong :premises (t232.t20.t7))
+(step t232.t20.t9 (cl (= @p_1627 (! (= @p_1657 @p_1661) :named @p_1662))) :rule cong :premises (t232.t20.t4 t232.t20.t8))
+(step t232.t20 (cl (= @p_1628 (! (forall ((veriT_vr191 F$) (veriT_vr192 D$)) @p_1662) :named @p_1656))) :rule bind)
+(step t232.t21 (cl (= @p_1629 (! (and @p_1555 @p_1656) :named @p_1663))) :rule cong :premises (t232.t20))
+(step t232.t22 (cl (= @p_1631 (! (or @p_1329 @p_1663) :named @p_1664))) :rule cong :premises (t232.t21))
+(step t232.t23 (cl (! (= @p_1655 (! (=> @p_1634 @p_1664) :named @p_1665)) :named @p_1666)) :rule cong :premises (t232.t22))
+(step t232.t24 (cl (not @p_1666) (not @p_1655) @p_1665) :rule equiv_pos2)
+(step t232.t25 (cl @p_1665) :rule th_resolution :premises (t232.t19 t232.t23 t232.t24))
+(step t232 (cl @p_1599 @p_1665) :rule subproof :discharge (h1))
+(step t233 (cl @p_1385 @p_1535) :rule or :premises (t231))
+(step t234 (cl (! (or @p_1385 @p_1665) :named @p_1667) @p_1533) :rule or_neg)
+(step t235 (cl @p_1667 @p_1154) :rule th_resolution :premises (t159 t234))
+(step t236 (cl @p_1667 (! (not @p_1665) :named @p_1679)) :rule or_neg)
+(step t237 (cl @p_1667) :rule th_resolution :premises (t233 t232 t235 t236))
+(step t238 (cl @p_1668 @p_1669 (not @p_1670)) :rule and_neg)
+(step t239 (cl @p_1163 @p_1671) :rule or :premises (t213))
+(step t240 (cl (! (not @p_1672) :named @p_1721) (not @p_822) @p_1328) :rule equiv_pos2)
+(step t241 (cl @p_1354 @p_1672) :rule or :premises (t214))
+(step t242 (cl (! (not @p_1673) :named @p_1711) (not @p_784) @p_1332) :rule equiv_pos2)
+(step t243 (cl @p_1354 @p_1673) :rule or :premises (t215))
+(step t244 (cl (not @p_1674) @p_1675 @p_1676) :rule equiv_pos1)
+(step t245 (cl @p_1354 @p_1674) :rule or :premises (t216))
+(step t246 (cl (not @p_1381) @p_1374) :rule and_pos)
+(step t247 (cl @p_1677 @p_1198 @p_1381) :rule or_pos)
+(step t248 (cl @p_1187 @p_1382) :rule or :premises (t223))
+(step t249 (cl @p_1382) :rule resolution :premises (t248 t120))
+(step t250 (cl @p_1500 (not @p_1400)) :rule or_neg)
+(step t251 (cl @p_1509 @p_1505 @p_1400) :rule equiv_neg2)
+(step t252 (cl @p_1510 (! (not @p_1514) :named @p_1696) (! (not @p_1518) :named @p_1919)) :rule equiv_neg1)
+(step t253 (cl @p_1510 @p_1514 @p_1518) :rule equiv_neg2)
+(step t254 (cl @p_1519 (not @p_1509) (not @p_1510)) :rule and_neg)
+(step t255 (cl @p_1500 (not @p_1519)) :rule or_neg)
+(step t256 (cl (not @p_1410) (not @p_789) @p_1333) :rule equiv_pos2)
+(step t257 (cl (not @p_1529) @p_1410) :rule and_pos)
+(step t258 (cl (! (not @p_1530) :named @p_1710) @p_1333 @p_1529) :rule or_pos)
+(step t259 (cl @p_1678 (not @p_1500) @p_1530) :rule implies_pos)
+(step t260 (cl @p_1385 @p_1531) :rule or :premises (t230))
+(step t261 (cl @p_1531) :rule resolution :premises (t260 t119))
+(step t262 (cl @p_1634 (! (not @p_1545) :named @p_1929)) :rule or_neg)
+(step t263 (cl @p_1643 @p_1639 @p_1545) :rule equiv_neg2)
+(step t264 (cl @p_1644 (! (not @p_1648) :named @p_1700) (! (not @p_1652) :named @p_1705)) :rule equiv_neg1)
+(step t265 (cl @p_1644 @p_1648 @p_1652) :rule equiv_neg2)
+(step t266 (cl @p_1653 (not @p_1643) (! (not @p_1644) :named @p_1931)) :rule and_neg)
+(step t267 (cl @p_1634 (! (not @p_1653) :named @p_1930)) :rule or_neg)
+(step t268 (cl (not @p_1663) @p_1656) :rule and_pos)
+(step t269 (cl (! (not @p_1664) :named @p_1720) @p_1329 @p_1663) :rule or_pos)
+(step t270 (cl @p_1679 (! (not @p_1634) :named @p_1928) @p_1664) :rule implies_pos)
+(step t271 (cl @p_1385 @p_1665) :rule or :premises (t237))
+(step t272 (cl @p_1665) :rule resolution :premises (t271 t119))
+(step t273 (cl (or @p_1341 (! (or @p_1400 (! (not @p_1505) :named @p_1683) @p_1400) :named @p_1680))) :rule forall_inst :args ((:= veriT_vr103 veriT_sk25) (:= veriT_vr104 veriT_sk26)))
+(step t274 (cl @p_1341 @p_1680) :rule or :premises (t273))
+(step t275 (cl (! (or @p_1187 @p_1680) :named @p_1681) @p_1343) :rule or_neg)
+(step t276 (cl @p_1681 @p_1155) :rule th_resolution :premises (t198 t275))
+(step t277 (cl @p_1681 (! (not @p_1680) :named @p_1682)) :rule or_neg)
+(step t278 (cl @p_1681) :rule th_resolution :premises (t194 t274 t276 t277))
+(anchor :step t279)
+(assume t279.h1 @p_1680)
+(step t279.t2 (cl (! (= @p_1680 (! (or @p_1400 @p_1683) :named @p_1684)) :named @p_1685)) :rule ac_simp)
+(step t279.t3 (cl (not @p_1685) @p_1682 @p_1684) :rule equiv_pos2)
+(step t279.t4 (cl @p_1684) :rule th_resolution :premises (t279.h1 t279.t2 t279.t3))
+(step t279 (cl @p_1682 @p_1684) :rule subproof :discharge (h1))
+(step t280 (cl @p_1187 @p_1680) :rule or :premises (t278))
+(step t281 (cl (! (or @p_1187 @p_1684) :named @p_1686) @p_1343) :rule or_neg)
+(step t282 (cl @p_1686 @p_1155) :rule th_resolution :premises (t198 t281))
+(step t283 (cl @p_1686 (! (not @p_1684) :named @p_1694)) :rule or_neg)
+(step t284 (cl @p_1686) :rule th_resolution :premises (t280 t279 t282 t283))
+(step t285 (cl (or @p_1341 (! (or @p_1545 (! (not @p_1639) :named @p_1690) @p_1545) :named @p_1687))) :rule forall_inst :args ((:= veriT_vr103 veriT_sk29) (:= veriT_vr104 veriT_sk30)))
+(step t286 (cl @p_1341 @p_1687) :rule or :premises (t285))
+(step t287 (cl (! (or @p_1187 @p_1687) :named @p_1688) @p_1343) :rule or_neg)
+(step t288 (cl @p_1688 @p_1155) :rule th_resolution :premises (t198 t287))
+(step t289 (cl @p_1688 (! (not @p_1687) :named @p_1689)) :rule or_neg)
+(step t290 (cl @p_1688) :rule th_resolution :premises (t194 t286 t288 t289))
+(anchor :step t291)
+(assume t291.h1 @p_1687)
+(step t291.t2 (cl (! (= @p_1687 (! (or @p_1545 @p_1690) :named @p_1691)) :named @p_1692)) :rule ac_simp)
+(step t291.t3 (cl (not @p_1692) @p_1689 @p_1691) :rule equiv_pos2)
+(step t291.t4 (cl @p_1691) :rule th_resolution :premises (t291.h1 t291.t2 t291.t3))
+(step t291 (cl @p_1689 @p_1691) :rule subproof :discharge (h1))
+(step t292 (cl @p_1187 @p_1687) :rule or :premises (t290))
+(step t293 (cl (! (or @p_1187 @p_1691) :named @p_1693) @p_1343) :rule or_neg)
+(step t294 (cl @p_1693 @p_1155) :rule th_resolution :premises (t198 t293))
+(step t295 (cl @p_1693 (! (not @p_1691) :named @p_1695)) :rule or_neg)
+(step t296 (cl @p_1693) :rule th_resolution :premises (t292 t291 t294 t295))
+(step t297 (cl @p_1694 @p_1400 @p_1683) :rule or_pos)
+(step t298 (cl @p_1187 @p_1684) :rule or :premises (t284))
+(step t299 (cl @p_1684) :rule resolution :premises (t298 t120))
+(step t300 (cl @p_1695 @p_1545 @p_1690) :rule or_pos)
+(step t301 (cl @p_1187 @p_1691) :rule or :premises (t296))
+(step t302 (cl @p_1691) :rule resolution :premises (t301 t120))
+(step t303 (cl (or (! (not @p_1351) :named @p_1697) (! (or @p_1400 @p_1696 @p_1518) :named @p_1698))) :rule forall_inst :args ((:= veriT_vr103 veriT_sk25) (:= veriT_vr104 veriT_sk26) (:= veriT_vr105 veriT_sk27) (:= veriT_vr106 veriT_sk28)))
+(step t304 (cl @p_1697 @p_1698) :rule or :premises (t303))
+(step t305 (cl (! (or @p_1187 @p_1698) :named @p_1699) @p_1343) :rule or_neg)
+(step t306 (cl @p_1699 @p_1155) :rule th_resolution :premises (t198 t305))
+(step t307 (cl @p_1699 (! (not @p_1698) :named @p_1703)) :rule or_neg)
+(step t308 (cl @p_1699) :rule th_resolution :premises (t211 t304 t306 t307))
+(step t309 (cl (or @p_1697 (! (or @p_1545 @p_1700 @p_1652) :named @p_1701))) :rule forall_inst :args ((:= veriT_vr103 veriT_sk29) (:= veriT_vr104 veriT_sk30) (:= veriT_vr105 veriT_sk31) (:= veriT_vr106 veriT_sk32)))
+(step t310 (cl @p_1697 @p_1701) :rule or :premises (t309))
+(step t311 (cl (! (or @p_1187 @p_1701) :named @p_1702) @p_1343) :rule or_neg)
+(step t312 (cl @p_1702 @p_1155) :rule th_resolution :premises (t198 t311))
+(step t313 (cl @p_1702 (! (not @p_1701) :named @p_1704)) :rule or_neg)
+(step t314 (cl @p_1702) :rule th_resolution :premises (t211 t310 t312 t313))
+(step t315 (cl @p_1703 @p_1400 @p_1696 @p_1518) :rule or_pos)
+(step t316 (cl @p_1187 @p_1698) :rule or :premises (t308))
+(step t317 (cl @p_1698) :rule resolution :premises (t316 t120))
+(step t318 (cl @p_1704 @p_1545 @p_1700 @p_1652) :rule or_pos)
+(step t319 (cl @p_1187 @p_1701) :rule or :premises (t314))
+(step t320 (cl @p_1701) :rule resolution :premises (t319 t120))
+(step t321 (cl @p_1545 @p_1652 @p_1644) :rule resolution :premises (t318 t265 t320))
+(step t322 (cl (or (! (not @p_1352) :named @p_1706) (! (or @p_1545 @p_1705 @p_1648) :named @p_1707))) :rule forall_inst :args ((:= veriT_vr103 veriT_sk29) (:= veriT_vr104 veriT_sk30) (:= veriT_vr105 veriT_sk31) (:= veriT_vr106 veriT_sk32)))
+(step t323 (cl @p_1706 @p_1707) :rule or :premises (t322))
+(step t324 (cl (! (or @p_1187 @p_1707) :named @p_1708) @p_1343) :rule or_neg)
+(step t325 (cl @p_1708 @p_1155) :rule th_resolution :premises (t198 t324))
+(step t326 (cl @p_1708 (! (not @p_1707) :named @p_1709)) :rule or_neg)
+(step t327 (cl @p_1708) :rule th_resolution :premises (t212 t323 t325 t326))
+(step t328 (cl @p_1709 @p_1545 @p_1705 @p_1648) :rule or_pos)
+(step t329 (cl @p_1187 @p_1707) :rule or :premises (t327))
+(step t330 (cl @p_1707) :rule resolution :premises (t329 t120))
+(step t331 (cl @p_1710 @p_1711 @p_1178) :rule resolution :premises (t257 t258 t256 t178 t242 t128 t127 t180))
+(step t332 (cl (or (! (not @p_1656) :named @p_1712) (! (forall ((veriT_vr191 F$) (veriT_vr192 D$)) (or (not @p_1657) @p_1661)) :named @p_1713))) :rule qnt_cnf)
+(step t333 (cl @p_1712 @p_1713) :rule or :premises (t332))
+(step t334 (cl (or (! (not @p_1713) :named @p_1714) (! (or (! (not @p_827) :named @p_1719) @p_1670) :named @p_1715))) :rule forall_inst :args ((:= veriT_vr191 veriT_sk7) (:= veriT_vr192 veriT_sk8)))
+(step t335 (cl @p_1714 @p_1715) :rule or :premises (t334))
+(step t336 (cl (! (or @p_1712 @p_1715) :named @p_1717) (! (not @p_1712) :named @p_1716)) :rule or_neg)
+(step t337 (cl (not @p_1716) @p_1656) :rule not_not)
+(step t338 (cl @p_1717 @p_1656) :rule th_resolution :premises (t337 t336))
+(step t339 (cl @p_1717 (! (not @p_1715) :named @p_1718)) :rule or_neg)
+(step t340 (cl @p_1717) :rule th_resolution :premises (t333 t335 t338 t339))
+(step t341 (cl @p_1718 @p_1719 @p_1670) :rule or_pos)
+(step t342 (cl @p_1712 @p_1715) :rule or :premises (t340))
+(step t343 (cl @p_1720 @p_1668 @p_1721 @p_1179) :rule resolution :premises (t342 t268 t341 t269 t238 t175 t240 t134 t133 t177))
+(step t344 (cl (or @p_1165 @p_1179)) :rule forall_inst :args ((:= veriT_vr113 veriT_sk9) (:= veriT_vr114 veriT_sk10)))
+(step t345 (cl (or @p_1165 (! (not (! (and @p_1675 (! (is_res$b (! (run$b (c$ veriT_sk11 veriT_sk1) veriT_sk12) :named @p_1757) @p_747) :named @p_1753)) :named @p_1752)) :named @p_1754))) :rule forall_inst :args ((:= veriT_vr113 veriT_sk11) (:= veriT_vr114 veriT_sk12)))
+(step t346 (cl (or (! (not @p_1374) :named @p_1755) @p_1297)) :rule forall_inst :args ((:= veriT_vr150 veriT_sk15) (:= veriT_vr151 veriT_sk16)))
+(step t347 (cl (or @p_1187 (! (or @p_1400 (! (and @p_1509 (! (forall ((veriT_vr105 B$) (veriT_vr106 C$)) (! (= (! (is_res$ @p_1401 @p_1087) :named @p_1726) (! (is_res$ @p_1408 @p_1087) :named @p_1731)) :named @p_1733)) :named @p_1724)) :named @p_1735)) :named @p_1722))) :rule forall_inst :args ((:= veriT_vr103 veriT_sk25) (:= veriT_vr104 veriT_sk26)))
+(anchor :step t348)
+(assume t348.h1 @p_1722)
+(anchor :step t348.t2 :args ((:= (veriT_vr105 B$) veriT_vr207) (:= (veriT_vr106 C$) veriT_vr208)))
+(step t348.t2.t1 (cl (! (= veriT_vr105 veriT_vr207) :named @p_1728)) :rule refl)
+(step t348.t2.t2 (cl (! (= veriT_vr106 veriT_vr208) :named @p_1729)) :rule refl)
+(step t348.t2.t3 (cl (! (= @p_1087 (! (pair$ veriT_vr207 veriT_vr208) :named @p_1725)) :named @p_1730)) :rule cong :premises (t348.t2.t1 t348.t2.t2))
+(step t348.t2.t4 (cl (= @p_1726 (! (is_res$ @p_1401 @p_1725) :named @p_1727))) :rule cong :premises (t348.t2.t3))
+(step t348.t2.t5 (cl @p_1728) :rule refl)
+(step t348.t2.t6 (cl @p_1729) :rule refl)
+(step t348.t2.t7 (cl @p_1730) :rule cong :premises (t348.t2.t5 t348.t2.t6))
+(step t348.t2.t8 (cl (= @p_1731 (! (is_res$ @p_1408 @p_1725) :named @p_1732))) :rule cong :premises (t348.t2.t7))
+(step t348.t2.t9 (cl (= @p_1733 (! (= @p_1727 @p_1732) :named @p_1734))) :rule cong :premises (t348.t2.t4 t348.t2.t8))
+(step t348.t2 (cl (= @p_1724 (! (forall ((veriT_vr207 B$) (veriT_vr208 C$)) @p_1734) :named @p_1736))) :rule bind)
+(step t348.t3 (cl (= @p_1735 (! (and @p_1509 @p_1736) :named @p_1737))) :rule cong :premises (t348.t2))
+(step t348.t4 (cl (! (= @p_1722 (! (or @p_1400 @p_1737) :named @p_1740)) :named @p_1738)) :rule cong :premises (t348.t3))
+(step t348.t5 (cl (not @p_1738) (! (not @p_1722) :named @p_1739) @p_1740) :rule equiv_pos2)
+(step t348.t6 (cl @p_1740) :rule th_resolution :premises (t348.h1 t348.t4 t348.t5))
+(anchor :step t348.t7 :args ((:= (veriT_vr207 B$) veriT_vr209) (:= (veriT_vr208 C$) veriT_vr210)))
+(step t348.t7.t1 (cl (! (= veriT_vr207 veriT_vr209) :named @p_1743)) :rule refl)
+(step t348.t7.t2 (cl (! (= veriT_vr208 veriT_vr210) :named @p_1744)) :rule refl)
+(step t348.t7.t3 (cl (! (= @p_1725 (! (pair$ veriT_vr209 veriT_vr210) :named @p_1723)) :named @p_1745)) :rule cong :premises (t348.t7.t1 t348.t7.t2))
+(step t348.t7.t4 (cl (= @p_1727 (! (is_res$ @p_1401 @p_1723) :named @p_1742))) :rule cong :premises (t348.t7.t3))
+(step t348.t7.t5 (cl @p_1743) :rule refl)
+(step t348.t7.t6 (cl @p_1744) :rule refl)
+(step t348.t7.t7 (cl @p_1745) :rule cong :premises (t348.t7.t5 t348.t7.t6))
+(step t348.t7.t8 (cl (= @p_1732 (! (is_res$ @p_1408 @p_1723) :named @p_1746))) :rule cong :premises (t348.t7.t7))
+(step t348.t7.t9 (cl (= @p_1734 (! (= @p_1742 @p_1746) :named @p_1747))) :rule cong :premises (t348.t7.t4 t348.t7.t8))
+(step t348.t7 (cl (= @p_1736 (! (forall ((veriT_vr209 B$) (veriT_vr210 C$)) @p_1747) :named @p_1741))) :rule bind)
+(step t348.t8 (cl (= @p_1737 (! (and @p_1509 @p_1741) :named @p_1748))) :rule cong :premises (t348.t7))
+(step t348.t9 (cl (! (= @p_1740 (! (or @p_1400 @p_1748) :named @p_1749)) :named @p_1750)) :rule cong :premises (t348.t8))
+(step t348.t10 (cl (not @p_1750) (not @p_1740) @p_1749) :rule equiv_pos2)
+(step t348.t11 (cl @p_1749) :rule th_resolution :premises (t348.t6 t348.t9 t348.t10))
+(step t348 (cl @p_1739 @p_1749) :rule subproof :discharge (h1))
+(step t349 (cl @p_1187 @p_1722) :rule or :premises (t347))
+(step t350 (cl (! (or @p_1187 @p_1749) :named @p_1751) @p_1343) :rule or_neg)
+(step t351 (cl @p_1751 @p_1155) :rule th_resolution :premises (t198 t350))
+(step t352 (cl @p_1751 (! (not @p_1749) :named @p_1756)) :rule or_neg)
+(step t353 (cl @p_1751) :rule th_resolution :premises (t349 t348 t351 t352))
+(step t354 (cl @p_1165 @p_1179) :rule or :premises (t344))
+(step t355 (cl @p_1752 (not @p_1675) (not @p_1753)) :rule and_neg)
+(step t356 (cl @p_1165 @p_1754) :rule or :premises (t345))
+(step t357 (cl @p_1755 @p_1297) :rule or :premises (t346))
+(step t358 (cl (not @p_1748) @p_1741) :rule and_pos)
+(step t359 (cl @p_1756 @p_1400 @p_1748) :rule or_pos)
+(step t360 (cl @p_1187 @p_1749) :rule or :premises (t353))
+(step t361 (cl @p_1749) :rule resolution :premises (t360 t120))
+(step t362 (cl (or @p_1385 (! (=> @p_1412 (! (or @p_1325 (! (and (! (= (is_fail$b @p_1757) @p_1325) :named @p_1778) (! (forall ((veriT_vr93 F$) (veriT_vr102 D$)) (! (= (! (is_res$b @p_1757 @p_1039) :named @p_1806) (! (is_res$b @p_846 @p_1039) :named @p_1811)) :named @p_1813)) :named @p_1804)) :named @p_1815)) :named @p_1817)) :named @p_1758))) :rule forall_inst :args ((:= veriT_vr94 veriT_sk11) (:= veriT_vr95 veriT_sk0) (:= veriT_vr96 veriT_sk1) (:= veriT_vr101 veriT_sk12)))
+(anchor :step t363)
+(assume t363.h1 @p_1758)
+(anchor :step t363.t2 :args ((:= (veriT_vr97 A$) veriT_vr237) (:= (veriT_vr98 C$) veriT_vr238)))
+(step t363.t2.t1 (cl (! (= veriT_vr97 veriT_vr237) :named @p_1785)) :rule refl)
+(step t363.t2.t2 (cl (! (= @p_1417 (! (fun_app$ veriT_sk0 veriT_vr237) :named @p_1784)) :named @p_1789)) :rule cong :premises (t363.t2.t1))
+(step t363.t2.t3 (cl (! (= veriT_vr98 veriT_vr238) :named @p_1787)) :rule refl)
+(step t363.t2.t4 (cl (! (= @p_1388 (! (run$ @p_1784 veriT_vr238) :named @p_1782)) :named @p_1790)) :rule cong :premises (t363.t2.t2 t363.t2.t3))
+(step t363.t2.t5 (cl (! (= @p_1386 (! (is_fail$ @p_1782) :named @p_1780)) :named @p_1791)) :rule cong :premises (t363.t2.t4))
+(step t363.t2.t6 (cl @p_1785) :rule refl)
+(step t363.t2.t7 (cl (! (= @p_1420 (! (fun_app$ veriT_sk1 veriT_vr237) :named @p_1786)) :named @p_1794)) :rule cong :premises (t363.t2.t6))
+(step t363.t2.t8 (cl @p_1787) :rule refl)
+(step t363.t2.t9 (cl (! (= @p_1387 (! (run$ @p_1786 veriT_vr238) :named @p_1781)) :named @p_1795)) :rule cong :premises (t363.t2.t7 t363.t2.t8))
+(step t363.t2.t10 (cl (= @p_1423 (! (is_fail$ @p_1781) :named @p_1788))) :rule cong :premises (t363.t2.t9))
+(step t363.t2.t11 (cl @p_1785) :rule refl)
+(step t363.t2.t12 (cl @p_1789) :rule cong :premises (t363.t2.t11))
+(step t363.t2.t13 (cl @p_1787) :rule refl)
+(step t363.t2.t14 (cl @p_1790) :rule cong :premises (t363.t2.t12 t363.t2.t13))
+(step t363.t2.t15 (cl @p_1791) :rule cong :premises (t363.t2.t14))
+(step t363.t2.t16 (cl (= @p_1428 (! (= @p_1788 @p_1780) :named @p_1792))) :rule cong :premises (t363.t2.t10 t363.t2.t15))
+(anchor :step t363.t2.t17 :args ((:= (veriT_vr99 B$) veriT_vr239) (:= (veriT_vr100 C$) veriT_vr240)))
+(step t363.t2.t17.t1 (cl @p_1785) :rule refl)
+(step t363.t2.t17.t2 (cl @p_1794) :rule cong :premises (t363.t2.t17.t1))
+(step t363.t2.t17.t3 (cl @p_1787) :rule refl)
+(step t363.t2.t17.t4 (cl @p_1795) :rule cong :premises (t363.t2.t17.t2 t363.t2.t17.t3))
+(step t363.t2.t17.t5 (cl (! (= veriT_vr99 veriT_vr239) :named @p_1797)) :rule refl)
+(step t363.t2.t17.t6 (cl (! (= veriT_vr100 veriT_vr240) :named @p_1798)) :rule refl)
+(step t363.t2.t17.t7 (cl (! (= @p_1035 (! (pair$ veriT_vr239 veriT_vr240) :named @p_1783)) :named @p_1799)) :rule cong :premises (t363.t2.t17.t5 t363.t2.t17.t6))
+(step t363.t2.t17.t8 (cl (= @p_1434 (! (is_res$ @p_1781 @p_1783) :named @p_1796))) :rule cong :premises (t363.t2.t17.t4 t363.t2.t17.t7))
+(step t363.t2.t17.t9 (cl @p_1785) :rule refl)
+(step t363.t2.t17.t10 (cl @p_1789) :rule cong :premises (t363.t2.t17.t9))
+(step t363.t2.t17.t11 (cl @p_1787) :rule refl)
+(step t363.t2.t17.t12 (cl @p_1790) :rule cong :premises (t363.t2.t17.t10 t363.t2.t17.t11))
+(step t363.t2.t17.t13 (cl @p_1797) :rule refl)
+(step t363.t2.t17.t14 (cl @p_1798) :rule refl)
+(step t363.t2.t17.t15 (cl @p_1799) :rule cong :premises (t363.t2.t17.t13 t363.t2.t17.t14))
+(step t363.t2.t17.t16 (cl (= @p_1439 (! (is_res$ @p_1782 @p_1783) :named @p_1800))) :rule cong :premises (t363.t2.t17.t12 t363.t2.t17.t15))
+(step t363.t2.t17.t17 (cl (= @p_1441 (! (= @p_1796 @p_1800) :named @p_1801))) :rule cong :premises (t363.t2.t17.t8 t363.t2.t17.t16))
+(step t363.t2.t17 (cl (= @p_1430 (! (forall ((veriT_vr239 B$) (veriT_vr240 C$)) @p_1801) :named @p_1793))) :rule bind)
+(step t363.t2.t18 (cl (= @p_1443 (! (and @p_1792 @p_1793) :named @p_1802))) :rule cong :premises (t363.t2.t16 t363.t2.t17))
+(step t363.t2.t19 (cl (= @p_1445 (! (or @p_1780 @p_1802) :named @p_1803))) :rule cong :premises (t363.t2.t5 t363.t2.t18))
+(step t363.t2 (cl (= @p_1412 (! (forall ((veriT_vr237 A$) (veriT_vr238 C$)) @p_1803) :named @p_1819))) :rule bind)
+(anchor :step t363.t3 :args ((:= (veriT_vr93 F$) veriT_vr241) (:= (veriT_vr102 D$) veriT_vr242)))
+(step t363.t3.t1 (cl (! (= veriT_vr93 veriT_vr241) :named @p_1808)) :rule refl)
+(step t363.t3.t2 (cl (! (= veriT_vr102 veriT_vr242) :named @p_1809)) :rule refl)
+(step t363.t3.t3 (cl (! (= @p_1039 (! (pair$b veriT_vr241 veriT_vr242) :named @p_1805)) :named @p_1810)) :rule cong :premises (t363.t3.t1 t363.t3.t2))
+(step t363.t3.t4 (cl (= @p_1806 (! (is_res$b @p_1757 @p_1805) :named @p_1807))) :rule cong :premises (t363.t3.t3))
+(step t363.t3.t5 (cl @p_1808) :rule refl)
+(step t363.t3.t6 (cl @p_1809) :rule refl)
+(step t363.t3.t7 (cl @p_1810) :rule cong :premises (t363.t3.t5 t363.t3.t6))
+(step t363.t3.t8 (cl (= @p_1811 (! (is_res$b @p_846 @p_1805) :named @p_1812))) :rule cong :premises (t363.t3.t7))
+(step t363.t3.t9 (cl (= @p_1813 (! (= @p_1807 @p_1812) :named @p_1814))) :rule cong :premises (t363.t3.t4 t363.t3.t8))
+(step t363.t3 (cl (= @p_1804 (! (forall ((veriT_vr241 F$) (veriT_vr242 D$)) @p_1814) :named @p_1816))) :rule bind)
+(step t363.t4 (cl (= @p_1815 (! (and @p_1778 @p_1816) :named @p_1818))) :rule cong :premises (t363.t3))
+(step t363.t5 (cl (= @p_1817 (! (or @p_1325 @p_1818) :named @p_1820))) :rule cong :premises (t363.t4))
+(step t363.t6 (cl (! (= @p_1758 (! (=> @p_1819 @p_1820) :named @p_1823)) :named @p_1821)) :rule cong :premises (t363.t2 t363.t5))
+(step t363.t7 (cl (not @p_1821) (! (not @p_1758) :named @p_1822) @p_1823) :rule equiv_pos2)
+(step t363.t8 (cl @p_1823) :rule th_resolution :premises (t363.h1 t363.t6 t363.t7))
+(anchor :step t363.t9 :args ((:= (veriT_vr237 A$) veriT_vr243) (:= (veriT_vr238 C$) veriT_vr244)))
+(step t363.t9.t1 (cl (! (= veriT_vr237 veriT_vr243) :named @p_1826)) :rule refl)
+(step t363.t9.t2 (cl (! (= @p_1784 @p_1825) :named @p_1830)) :rule cong :premises (t363.t9.t1))
+(step t363.t9.t3 (cl (! (= veriT_vr238 veriT_vr244) :named @p_1828)) :rule refl)
+(step t363.t9.t4 (cl (! (= @p_1782 @p_1761) :named @p_1831)) :rule cong :premises (t363.t9.t2 t363.t9.t3))
+(step t363.t9.t5 (cl (! (= @p_1780 @p_1759) :named @p_1832)) :rule cong :premises (t363.t9.t4))
+(step t363.t9.t6 (cl @p_1826) :rule refl)
+(step t363.t9.t7 (cl (! (= @p_1786 @p_1827) :named @p_1835)) :rule cong :premises (t363.t9.t6))
+(step t363.t9.t8 (cl @p_1828) :rule refl)
+(step t363.t9.t9 (cl (! (= @p_1781 @p_1760) :named @p_1836)) :rule cong :premises (t363.t9.t7 t363.t9.t8))
+(step t363.t9.t10 (cl (= @p_1788 @p_1829)) :rule cong :premises (t363.t9.t9))
+(step t363.t9.t11 (cl @p_1826) :rule refl)
+(step t363.t9.t12 (cl @p_1830) :rule cong :premises (t363.t9.t11))
+(step t363.t9.t13 (cl @p_1828) :rule refl)
+(step t363.t9.t14 (cl @p_1831) :rule cong :premises (t363.t9.t12 t363.t9.t13))
+(step t363.t9.t15 (cl @p_1832) :rule cong :premises (t363.t9.t14))
+(step t363.t9.t16 (cl (= @p_1792 @p_1833)) :rule cong :premises (t363.t9.t10 t363.t9.t15))
+(anchor :step t363.t9.t17 :args ((:= (veriT_vr239 B$) veriT_vr245) (:= (veriT_vr240 C$) veriT_vr246)))
+(step t363.t9.t17.t1 (cl @p_1826) :rule refl)
+(step t363.t9.t17.t2 (cl @p_1835) :rule cong :premises (t363.t9.t17.t1))
+(step t363.t9.t17.t3 (cl @p_1828) :rule refl)
+(step t363.t9.t17.t4 (cl @p_1836) :rule cong :premises (t363.t9.t17.t2 t363.t9.t17.t3))
+(step t363.t9.t17.t5 (cl (! (= veriT_vr239 veriT_vr245) :named @p_1838)) :rule refl)
+(step t363.t9.t17.t6 (cl (! (= veriT_vr240 veriT_vr246) :named @p_1839)) :rule refl)
+(step t363.t9.t17.t7 (cl (! (= @p_1783 @p_1762) :named @p_1840)) :rule cong :premises (t363.t9.t17.t5 t363.t9.t17.t6))
+(step t363.t9.t17.t8 (cl (= @p_1796 @p_1837)) :rule cong :premises (t363.t9.t17.t4 t363.t9.t17.t7))
+(step t363.t9.t17.t9 (cl @p_1826) :rule refl)
+(step t363.t9.t17.t10 (cl @p_1830) :rule cong :premises (t363.t9.t17.t9))
+(step t363.t9.t17.t11 (cl @p_1828) :rule refl)
+(step t363.t9.t17.t12 (cl @p_1831) :rule cong :premises (t363.t9.t17.t10 t363.t9.t17.t11))
+(step t363.t9.t17.t13 (cl @p_1838) :rule refl)
+(step t363.t9.t17.t14 (cl @p_1839) :rule refl)
+(step t363.t9.t17.t15 (cl @p_1840) :rule cong :premises (t363.t9.t17.t13 t363.t9.t17.t14))
+(step t363.t9.t17.t16 (cl (= @p_1800 @p_1841)) :rule cong :premises (t363.t9.t17.t12 t363.t9.t17.t15))
+(step t363.t9.t17.t17 (cl (= @p_1801 @p_1842)) :rule cong :premises (t363.t9.t17.t8 t363.t9.t17.t16))
+(step t363.t9.t17 (cl (= @p_1793 @p_1834)) :rule bind)
+(step t363.t9.t18 (cl (= @p_1802 @p_1843)) :rule cong :premises (t363.t9.t16 t363.t9.t17))
+(step t363.t9.t19 (cl (= @p_1803 @p_1824)) :rule cong :premises (t363.t9.t5 t363.t9.t18))
+(step t363.t9 (cl (= @p_1819 (! (forall ((veriT_vr243 A$) (veriT_vr244 C$)) @p_1824) :named @p_1853))) :rule bind)
+(anchor :step t363.t10 :args ((:= (veriT_vr241 F$) veriT_vr247) (:= (veriT_vr242 D$) veriT_vr248)))
+(step t363.t10.t1 (cl (! (= veriT_vr241 veriT_vr247) :named @p_1846)) :rule refl)
+(step t363.t10.t2 (cl (! (= veriT_vr242 veriT_vr248) :named @p_1847)) :rule refl)
+(step t363.t10.t3 (cl (! (= @p_1805 (! (pair$b veriT_vr247 veriT_vr248) :named @p_1844)) :named @p_1848)) :rule cong :premises (t363.t10.t1 t363.t10.t2))
+(step t363.t10.t4 (cl (= @p_1807 (! (is_res$b @p_1757 @p_1844) :named @p_1845))) :rule cong :premises (t363.t10.t3))
+(step t363.t10.t5 (cl @p_1846) :rule refl)
+(step t363.t10.t6 (cl @p_1847) :rule refl)
+(step t363.t10.t7 (cl @p_1848) :rule cong :premises (t363.t10.t5 t363.t10.t6))
+(step t363.t10.t8 (cl (= @p_1812 (! (is_res$b @p_846 @p_1844) :named @p_1849))) :rule cong :premises (t363.t10.t7))
+(step t363.t10.t9 (cl (= @p_1814 (! (= @p_1845 @p_1849) :named @p_1850))) :rule cong :premises (t363.t10.t4 t363.t10.t8))
+(step t363.t10 (cl (= @p_1816 (! (forall ((veriT_vr247 F$) (veriT_vr248 D$)) @p_1850) :named @p_1851))) :rule bind)
+(step t363.t11 (cl (= @p_1818 (! (and @p_1778 @p_1851) :named @p_1852))) :rule cong :premises (t363.t10))
+(step t363.t12 (cl (= @p_1820 (! (or @p_1325 @p_1852) :named @p_1854))) :rule cong :premises (t363.t11))
+(step t363.t13 (cl (! (= @p_1823 (! (=> @p_1853 @p_1854) :named @p_1856)) :named @p_1855)) :rule cong :premises (t363.t9 t363.t12))
+(step t363.t14 (cl (not @p_1855) (not @p_1823) @p_1856) :rule equiv_pos2)
+(step t363.t15 (cl @p_1856) :rule th_resolution :premises (t363.t8 t363.t13 t363.t14))
+(anchor :step t363.t16 :args ((:= (veriT_vr243 A$) veriT_sk41) (:= (veriT_vr244 C$) veriT_sk42)))
+(step t363.t16.t1 (cl (! (= veriT_vr243 veriT_sk41) :named @p_1859)) :rule refl)
+(step t363.t16.t2 (cl (! (= @p_1825 (! (fun_app$ veriT_sk0 veriT_sk41) :named @p_1858)) :named @p_1863)) :rule cong :premises (t363.t16.t1))
+(step t363.t16.t3 (cl (! (= veriT_vr244 veriT_sk42) :named @p_1861)) :rule refl)
+(step t363.t16.t4 (cl (! (= @p_1761 (! (run$ @p_1858 veriT_sk42) :named @p_1776)) :named @p_1864)) :rule cong :premises (t363.t16.t2 t363.t16.t3))
+(step t363.t16.t5 (cl (! (= @p_1759 (! (is_fail$ @p_1776) :named @p_1768)) :named @p_1865)) :rule cong :premises (t363.t16.t4))
+(step t363.t16.t6 (cl @p_1859) :rule refl)
+(step t363.t16.t7 (cl (! (= @p_1827 (! (fun_app$ veriT_sk1 veriT_sk41) :named @p_1860)) :named @p_1868)) :rule cong :premises (t363.t16.t6))
+(step t363.t16.t8 (cl @p_1861) :rule refl)
+(step t363.t16.t9 (cl (! (= @p_1760 (! (run$ @p_1860 veriT_sk42) :named @p_1769)) :named @p_1869)) :rule cong :premises (t363.t16.t7 t363.t16.t8))
+(step t363.t16.t10 (cl (= @p_1829 (! (is_fail$ @p_1769) :named @p_1862))) :rule cong :premises (t363.t16.t9))
+(step t363.t16.t11 (cl @p_1859) :rule refl)
+(step t363.t16.t12 (cl @p_1863) :rule cong :premises (t363.t16.t11))
+(step t363.t16.t13 (cl @p_1861) :rule refl)
+(step t363.t16.t14 (cl @p_1864) :rule cong :premises (t363.t16.t12 t363.t16.t13))
+(step t363.t16.t15 (cl @p_1865) :rule cong :premises (t363.t16.t14))
+(step t363.t16.t16 (cl (= @p_1833 (! (= @p_1862 @p_1768) :named @p_1866))) :rule cong :premises (t363.t16.t10 t363.t16.t15))
+(anchor :step t363.t16.t17 :args ((:= (veriT_vr245 B$) veriT_sk43) (:= (veriT_vr246 C$) veriT_sk44)))
+(step t363.t16.t17.t1 (cl @p_1859) :rule refl)
+(step t363.t16.t17.t2 (cl @p_1868) :rule cong :premises (t363.t16.t17.t1))
+(step t363.t16.t17.t3 (cl @p_1861) :rule refl)
+(step t363.t16.t17.t4 (cl @p_1869) :rule cong :premises (t363.t16.t17.t2 t363.t16.t17.t3))
+(step t363.t16.t17.t5 (cl (! (= veriT_vr245 veriT_sk43) :named @p_1872)) :rule refl)
+(step t363.t16.t17.t6 (cl (! (= veriT_vr246 veriT_sk44) :named @p_1873)) :rule refl)
+(step t363.t16.t17.t7 (cl (! (= @p_1762 (! (pair$ veriT_sk43 veriT_sk44) :named @p_1777)) :named @p_1874)) :rule cong :premises (t363.t16.t17.t5 t363.t16.t17.t6))
+(step t363.t16.t17.t8 (cl (= @p_1837 (! (is_res$ @p_1769 @p_1777) :named @p_1871))) :rule cong :premises (t363.t16.t17.t4 t363.t16.t17.t7))
+(step t363.t16.t17.t9 (cl @p_1859) :rule refl)
+(step t363.t16.t17.t10 (cl @p_1863) :rule cong :premises (t363.t16.t17.t9))
+(step t363.t16.t17.t11 (cl @p_1861) :rule refl)
+(step t363.t16.t17.t12 (cl @p_1864) :rule cong :premises (t363.t16.t17.t10 t363.t16.t17.t11))
+(step t363.t16.t17.t13 (cl @p_1872) :rule refl)
+(step t363.t16.t17.t14 (cl @p_1873) :rule refl)
+(step t363.t16.t17.t15 (cl @p_1874) :rule cong :premises (t363.t16.t17.t13 t363.t16.t17.t14))
+(step t363.t16.t17.t16 (cl (= @p_1841 (! (is_res$ @p_1776 @p_1777) :named @p_1875))) :rule cong :premises (t363.t16.t17.t12 t363.t16.t17.t15))
+(step t363.t16.t17.t17 (cl (= @p_1842 (! (= @p_1871 @p_1875) :named @p_1867))) :rule cong :premises (t363.t16.t17.t8 t363.t16.t17.t16))
+(step t363.t16.t17 (cl (= @p_1834 @p_1867)) :rule sko_forall)
+(step t363.t16.t18 (cl (= @p_1843 (! (and @p_1866 @p_1867) :named @p_1876))) :rule cong :premises (t363.t16.t16 t363.t16.t17))
+(step t363.t16.t19 (cl (= @p_1824 (! (or @p_1768 @p_1876) :named @p_1857))) :rule cong :premises (t363.t16.t5 t363.t16.t18))
+(step t363.t16 (cl (= @p_1853 @p_1857)) :rule sko_forall)
+(step t363.t17 (cl (! (= @p_1856 (! (=> @p_1857 @p_1854) :named @p_1878)) :named @p_1877)) :rule cong :premises (t363.t16))
+(step t363.t18 (cl (not @p_1877) (not @p_1856) @p_1878) :rule equiv_pos2)
+(step t363.t19 (cl @p_1878) :rule th_resolution :premises (t363.t15 t363.t17 t363.t18))
+(anchor :step t363.t20 :args ((:= (veriT_vr247 F$) veriT_vr249) (:= (veriT_vr248 D$) veriT_vr250)))
+(step t363.t20.t1 (cl (! (= veriT_vr247 veriT_vr249) :named @p_1881)) :rule refl)
+(step t363.t20.t2 (cl (! (= veriT_vr248 veriT_vr250) :named @p_1882)) :rule refl)
+(step t363.t20.t3 (cl (! (= @p_1844 (! (pair$b veriT_vr249 veriT_vr250) :named @p_1779)) :named @p_1883)) :rule cong :premises (t363.t20.t1 t363.t20.t2))
+(step t363.t20.t4 (cl (= @p_1845 (! (is_res$b @p_1757 @p_1779) :named @p_1880))) :rule cong :premises (t363.t20.t3))
+(step t363.t20.t5 (cl @p_1881) :rule refl)
+(step t363.t20.t6 (cl @p_1882) :rule refl)
+(step t363.t20.t7 (cl @p_1883) :rule cong :premises (t363.t20.t5 t363.t20.t6))
+(step t363.t20.t8 (cl (= @p_1849 (! (is_res$b @p_846 @p_1779) :named @p_1884))) :rule cong :premises (t363.t20.t7))
+(step t363.t20.t9 (cl (= @p_1850 (! (= @p_1880 @p_1884) :named @p_1885))) :rule cong :premises (t363.t20.t4 t363.t20.t8))
+(step t363.t20 (cl (= @p_1851 (! (forall ((veriT_vr249 F$) (veriT_vr250 D$)) @p_1885) :named @p_1879))) :rule bind)
+(step t363.t21 (cl (= @p_1852 (! (and @p_1778 @p_1879) :named @p_1886))) :rule cong :premises (t363.t20))
+(step t363.t22 (cl (= @p_1854 (! (or @p_1325 @p_1886) :named @p_1887))) :rule cong :premises (t363.t21))
+(step t363.t23 (cl (! (= @p_1878 (! (=> @p_1857 @p_1887) :named @p_1888)) :named @p_1889)) :rule cong :premises (t363.t22))
+(step t363.t24 (cl (not @p_1889) (not @p_1878) @p_1888) :rule equiv_pos2)
+(step t363.t25 (cl @p_1888) :rule th_resolution :premises (t363.t19 t363.t23 t363.t24))
+(step t363 (cl @p_1822 @p_1888) :rule subproof :discharge (h1))
+(step t364 (cl @p_1385 @p_1758) :rule or :premises (t362))
+(step t365 (cl (! (or @p_1385 @p_1888) :named @p_1890) @p_1533) :rule or_neg)
+(step t366 (cl @p_1890 @p_1154) :rule th_resolution :premises (t159 t365))
+(step t367 (cl @p_1890 (! (not @p_1888) :named @p_1891)) :rule or_neg)
+(step t368 (cl @p_1890) :rule th_resolution :premises (t364 t363 t366 t367))
+(step t369 (cl @p_1857 (not @p_1768)) :rule or_neg)
+(step t370 (cl @p_1866 @p_1862 @p_1768) :rule equiv_neg2)
+(step t371 (cl @p_1867 (! (not @p_1871) :named @p_1900) (! (not @p_1875) :named @p_1904)) :rule equiv_neg1)
+(step t372 (cl @p_1867 @p_1871 @p_1875) :rule equiv_neg2)
+(step t373 (cl @p_1876 (not @p_1866) (not @p_1867)) :rule and_neg)
+(step t374 (cl @p_1857 (not @p_1876)) :rule or_neg)
+(step t375 (cl (not @p_1886) @p_1879) :rule and_pos)
+(step t376 (cl (! (not @p_1887) :named @p_1916) @p_1325 @p_1886) :rule or_pos)
+(step t377 (cl @p_1891 (not @p_1857) @p_1887) :rule implies_pos)
+(step t378 (cl @p_1385 @p_1888) :rule or :premises (t368))
+(step t379 (cl @p_1888) :rule resolution :premises (t378 t119))
+(step t380 (cl (or @p_1341 (! (or @p_1768 (! (not @p_1862) :named @p_1895) @p_1768) :named @p_1892))) :rule forall_inst :args ((:= veriT_vr103 veriT_sk41) (:= veriT_vr104 veriT_sk42)))
+(step t381 (cl @p_1341 @p_1892) :rule or :premises (t380))
+(step t382 (cl (! (or @p_1187 @p_1892) :named @p_1893) @p_1343) :rule or_neg)
+(step t383 (cl @p_1893 @p_1155) :rule th_resolution :premises (t198 t382))
+(step t384 (cl @p_1893 (! (not @p_1892) :named @p_1894)) :rule or_neg)
+(step t385 (cl @p_1893) :rule th_resolution :premises (t194 t381 t383 t384))
+(anchor :step t386)
+(assume t386.h1 @p_1892)
+(step t386.t2 (cl (! (= @p_1892 (! (or @p_1768 @p_1895) :named @p_1896)) :named @p_1897)) :rule ac_simp)
+(step t386.t3 (cl (not @p_1897) @p_1894 @p_1896) :rule equiv_pos2)
+(step t386.t4 (cl @p_1896) :rule th_resolution :premises (t386.h1 t386.t2 t386.t3))
+(step t386 (cl @p_1894 @p_1896) :rule subproof :discharge (h1))
+(step t387 (cl @p_1187 @p_1892) :rule or :premises (t385))
+(step t388 (cl (! (or @p_1187 @p_1896) :named @p_1898) @p_1343) :rule or_neg)
+(step t389 (cl @p_1898 @p_1155) :rule th_resolution :premises (t198 t388))
+(step t390 (cl @p_1898 (! (not @p_1896) :named @p_1899)) :rule or_neg)
+(step t391 (cl @p_1898) :rule th_resolution :premises (t387 t386 t389 t390))
+(step t392 (cl @p_1899 @p_1768 @p_1895) :rule or_pos)
+(step t393 (cl @p_1187 @p_1896) :rule or :premises (t391))
+(step t394 (cl @p_1896) :rule resolution :premises (t393 t120))
+(step t395 (cl (or @p_1697 (! (or @p_1768 @p_1900 @p_1875) :named @p_1901))) :rule forall_inst :args ((:= veriT_vr103 veriT_sk41) (:= veriT_vr104 veriT_sk42) (:= veriT_vr105 veriT_sk43) (:= veriT_vr106 veriT_sk44)))
+(step t396 (cl @p_1697 @p_1901) :rule or :premises (t395))
+(step t397 (cl (! (or @p_1187 @p_1901) :named @p_1902) @p_1343) :rule or_neg)
+(step t398 (cl @p_1902 @p_1155) :rule th_resolution :premises (t198 t397))
+(step t399 (cl @p_1902 (! (not @p_1901) :named @p_1903)) :rule or_neg)
+(step t400 (cl @p_1902) :rule th_resolution :premises (t211 t396 t398 t399))
+(step t401 (cl @p_1903 @p_1768 @p_1900 @p_1875) :rule or_pos)
+(step t402 (cl @p_1187 @p_1901) :rule or :premises (t400))
+(step t403 (cl @p_1901) :rule resolution :premises (t402 t120))
+(step t404 (cl @p_1768 @p_1875 @p_1867) :rule resolution :premises (t401 t372 t403))
+(step t405 (cl (or @p_1706 (! (or @p_1768 @p_1904 @p_1871) :named @p_1905))) :rule forall_inst :args ((:= veriT_vr103 veriT_sk41) (:= veriT_vr104 veriT_sk42) (:= veriT_vr105 veriT_sk43) (:= veriT_vr106 veriT_sk44)))
+(step t406 (cl @p_1706 @p_1905) :rule or :premises (t405))
+(step t407 (cl (! (or @p_1187 @p_1905) :named @p_1906) @p_1343) :rule or_neg)
+(step t408 (cl @p_1906 @p_1155) :rule th_resolution :premises (t198 t407))
+(step t409 (cl @p_1906 (! (not @p_1905) :named @p_1907)) :rule or_neg)
+(step t410 (cl @p_1906) :rule th_resolution :premises (t212 t406 t408 t409))
+(step t411 (cl @p_1907 @p_1768 @p_1904 @p_1871) :rule or_pos)
+(step t412 (cl @p_1187 @p_1905) :rule or :premises (t410))
+(step t413 (cl @p_1905) :rule resolution :premises (t412 t120))
+(step t414 (cl (or (! (not @p_1879) :named @p_1908) (! (forall ((veriT_vr249 F$) (veriT_vr250 D$)) (or (not @p_1884) @p_1880)) :named @p_1909))) :rule qnt_cnf)
+(step t415 (cl @p_1908 @p_1909) :rule or :premises (t414))
+(step t416 (cl (or (! (not @p_1909) :named @p_1910) (! (or (! (not @p_847) :named @p_1915) @p_1753) :named @p_1911))) :rule forall_inst :args ((:= veriT_vr249 veriT_sk7) (:= veriT_vr250 veriT_sk8)))
+(step t417 (cl @p_1910 @p_1911) :rule or :premises (t416))
+(step t418 (cl (! (or @p_1908 @p_1911) :named @p_1913) (! (not @p_1908) :named @p_1912)) :rule or_neg)
+(step t419 (cl (not @p_1912) @p_1879) :rule not_not)
+(step t420 (cl @p_1913 @p_1879) :rule th_resolution :premises (t419 t418))
+(step t421 (cl @p_1913 (! (not @p_1911) :named @p_1914)) :rule or_neg)
+(step t422 (cl @p_1913) :rule th_resolution :premises (t415 t417 t420 t421))
+(step t423 (cl @p_1914 @p_1915 @p_1753) :rule or_pos)
+(step t424 (cl @p_1908 @p_1911) :rule or :premises (t422))
+(step t425 (cl @p_1916 @p_820 @p_780 @p_1335) :rule resolution :premises (t424 t423 t375 t355 t376 t244 t172 t356 t142 t141 t147 t151 t148 t144 t149 t136 t130 t135 t129 t245 t191 t187 t186 t174 t171))
+(step t426 (cl @p_1287) :rule resolution :premises (t357 t183 t246 t182 t247 t208 t184 t181 t249 t210))
+(step t427 (cl @p_1317) :rule resolution :premises (t189 t426 t193))
+(step t428 (cl @p_1316) :rule resolution :premises (t192 t427))
+(step t429 (cl @p_1208) :rule resolution :premises (t186 t428))
+(step t430 (cl @p_1309) :rule resolution :premises (t187 t428))
+(step t431 (cl @p_1338) :rule resolution :premises (t191 t429))
+(step t432 (cl @p_1672) :rule resolution :premises (t241 t430))
+(step t433 (cl @p_1673) :rule resolution :premises (t243 t430))
+(step t434 (cl @p_1857) :rule resolution :premises (t411 t371 t404 t373 t370 t392 t374 t369 t413 t394))
+(step t435 (cl @p_1887) :rule resolution :premises (t377 t434 t379))
+(step t436 (cl @p_1400 @p_1518 @p_1510) :rule resolution :premises (t315 t253 t317))
+(step t437 (cl (or (! (not @p_1741) :named @p_1917) (! (forall ((veriT_vr209 B$) (veriT_vr210 C$)) (or (not @p_1746) @p_1742)) :named @p_1918))) :rule qnt_cnf)
+(step t438 (cl @p_1917 @p_1918) :rule or :premises (t437))
+(step t439 (cl (or (! (not @p_1918) :named @p_1920) (! (or @p_1919 @p_1514) :named @p_1921))) :rule forall_inst :args ((:= veriT_vr209 veriT_sk27) (:= veriT_vr210 veriT_sk28)))
+(step t440 (cl @p_1920 @p_1921) :rule or :premises (t439))
+(step t441 (cl (! (or @p_1917 @p_1921) :named @p_1923) (! (not @p_1917) :named @p_1922)) :rule or_neg)
+(step t442 (cl (not @p_1922) @p_1741) :rule not_not)
+(step t443 (cl @p_1923 @p_1741) :rule th_resolution :premises (t442 t441))
+(step t444 (cl @p_1923 (! (not @p_1921) :named @p_1924)) :rule or_neg)
+(step t445 (cl @p_1923) :rule th_resolution :premises (t438 t440 t443 t444))
+(step t446 (cl @p_1924 @p_1919 @p_1514) :rule or_pos)
+(step t447 (cl @p_1917 @p_1921) :rule or :premises (t445))
+(step t448 (cl @p_1500) :rule resolution :premises (t446 t252 t436 t447 t254 t358 t251 t359 t297 t255 t250 t361 t299))
+(step t449 (cl @p_1530) :rule resolution :premises (t259 t448 t261))
+(step t450 (cl @p_1178) :rule resolution :premises (t331 t449 t433))
+(step t451 (cl @p_820) :rule resolution :premises (t425 t450 t428 t435))
+(step t452 (cl @p_1925) :rule resolution :premises (t129 t450 t431))
+(step t453 (cl @p_1165) :rule resolution :premises (t354 t451))
+(step t454 (cl @p_1167) :rule resolution :premises (t130 t452))
+(step t455 (cl @p_1166) :rule resolution :premises (t147 t453))
+(step t456 (cl @p_1170) :rule resolution :premises (t148 t455))
+(step t457 (cl @p_1926) :rule resolution :premises (t149 t456 t171 t454))
+(step t458 (cl @p_1927) :rule resolution :premises (t140 t457))
+(step t459 (cl @p_1181) :rule resolution :premises (t139 t458))
+(step t460 (cl @p_1671) :rule resolution :premises (t239 t459))
+(step t461 (cl @p_1720) :rule resolution :premises (t343 t460 t432 t451))
+(step t462 (cl @p_1928) :rule resolution :premises (t270 t461 t272))
+(step t463 (cl @p_1929) :rule resolution :premises (t262 t462))
+(step t464 (cl @p_1930) :rule resolution :premises (t267 t462))
+(step t465 (cl @p_1690) :rule resolution :premises (t300 t463 t302))
+(step t466 (cl @p_1643) :rule resolution :premises (t263 t465 t463))
+(step t467 (cl @p_1931) :rule resolution :premises (t266 t466 t464))
+(step t468 (cl @p_1652) :rule resolution :premises (t321 t467 t463))
+(step t469 (cl @p_1700) :rule resolution :premises (t264 t468 t467))
+(step t470 (cl) :rule resolution :premises (t328 t468 t463 t330 t469))
+a352c3d2d258129c9c0fa30de525ad6ea4644748 543 0
+unsat
+(define-fun veriT_sk0 () Exp$ (! (choice ((veriT_vr40 Exp$)) (not (! (=> (! (member$ veriT_vr40 (! (myset$ z$) :named @p_199)) :named @p_278) (! (not (! (forall ((veriT_vr41 FreeExp$)) (! (not (! (= veriT_vr40 (! (fun_app$ uu$ veriT_vr41) :named @p_281)) :named @p_282)) :named @p_283)) :named @p_279)) :named @p_284)) :named @p_277))) :named @p_201))
+(define-fun veriT_sk1 () FreeExp_list$ (! (choice ((veriT_vr42 FreeExp_list$)) (! (= z$ (! (map2$ uu$ veriT_vr42) :named @p_286)) :named @p_285)) :named @p_301))
+(define-fun veriT_sk2 () FreeExp$ (! (choice ((veriT_vr48 FreeExp$)) (not (! (not (! (= veriT_sk0 (! (abs_Exp$ (! (myImage$ exprel$ (! (insert$ veriT_vr48 bot$) :named @p_356)) :named @p_357)) :named @p_358)) :named @p_359)) :named @p_355))) :named @p_366))
+(assume axiom0 (! (forall ((?v0 FreeExp$)) (! (= (! (fun_app$ uu$ ?v0) :named @p_3) (! (abs_Exp$ (! (myImage$ exprel$ (! (insert$ ?v0 bot$) :named @p_6)) :named @p_8)) :named @p_10)) :named @p_12)) :named @p_2))
+(assume axiom1 (! (forall ((?v0 FreeExp_list$)) (! (= (! (abs_ExpList$ ?v0) :named @p_1) (! (map2$ uu$ ?v0) :named @p_27)) :named @p_29)) :named @p_24))
+(assume axiom2 (! (forall ((?v0 Exp$)) (! (=> (! (forall ((?v1 FreeExp$)) (! (=> (! (= ?v0 (! (abs_Exp$ (! (myImage$ exprel$ (! (insert$ ?v1 bot$) :named @p_42)) :named @p_44)) :named @p_46)) :named @p_48) false) :named @p_50)) :named @p_40) false) :named @p_52)) :named @p_39))
+(assume axiom3 (! (forall ((?v0 Exp_list$) (?v1 FreeExp_exp_fun$)) (! (= (! (exists ((?v2 FreeExp_list$)) (! (= ?v0 (! (map2$ ?v1 ?v2) :named @p_74)) :named @p_76)) :named @p_72) (! (forall ((?v2 Exp$)) (! (=> (! (member$ ?v2 (! (myset$ ?v0) :named @p_81)) :named @p_83) (! (exists ((?v3 FreeExp$)) (! (= ?v2 (! (fun_app$ ?v1 ?v3) :named @p_89)) :named @p_91)) :named @p_85)) :named @p_93)) :named @p_78)) :named @p_95)) :named @p_71))
+(assume axiom4 (! (not (! (exists ((?v0 FreeExp_list$)) (! (= @p_1 z$) :named @p_178)) :named @p_176)) :named @p_180))
+(anchor :step t6 :args ((:= (?v0 FreeExp$) veriT_vr0)))
+(step t6.t1 (cl (! (= ?v0 veriT_vr0) :named @p_5)) :rule refl)
+(step t6.t2 (cl (= @p_3 (! (fun_app$ uu$ veriT_vr0) :named @p_4))) :rule cong :premises (t6.t1))
+(step t6.t3 (cl @p_5) :rule refl)
+(step t6.t4 (cl (= @p_6 (! (insert$ veriT_vr0 bot$) :named @p_7))) :rule cong :premises (t6.t3))
+(step t6.t5 (cl (= @p_8 (! (myImage$ exprel$ @p_7) :named @p_9))) :rule cong :premises (t6.t4))
+(step t6.t6 (cl (= @p_10 (! (abs_Exp$ @p_9) :named @p_11))) :rule cong :premises (t6.t5))
+(step t6.t7 (cl (= @p_12 (! (= @p_4 @p_11) :named @p_13))) :rule cong :premises (t6.t2 t6.t6))
+(step t6 (cl (! (= @p_2 (! (forall ((veriT_vr0 FreeExp$)) @p_13) :named @p_15)) :named @p_14)) :rule bind)
+(step t7 (cl (not @p_14) (not @p_2) @p_15) :rule equiv_pos2)
+(step t8 (cl @p_15) :rule th_resolution :premises (axiom0 t6 t7))
+(anchor :step t9 :args ((:= (veriT_vr0 FreeExp$) veriT_vr1)))
+(step t9.t1 (cl (! (= veriT_vr0 veriT_vr1) :named @p_17)) :rule refl)
+(step t9.t2 (cl (= @p_4 (! (fun_app$ uu$ veriT_vr1) :named @p_16))) :rule cong :premises (t9.t1))
+(step t9.t3 (cl @p_17) :rule refl)
+(step t9.t4 (cl (= @p_7 (! (insert$ veriT_vr1 bot$) :named @p_18))) :rule cong :premises (t9.t3))
+(step t9.t5 (cl (= @p_9 (! (myImage$ exprel$ @p_18) :named @p_19))) :rule cong :premises (t9.t4))
+(step t9.t6 (cl (= @p_11 (! (abs_Exp$ @p_19) :named @p_20))) :rule cong :premises (t9.t5))
+(step t9.t7 (cl (= @p_13 (! (= @p_16 @p_20) :named @p_21))) :rule cong :premises (t9.t2 t9.t6))
+(step t9 (cl (! (= @p_15 (! (forall ((veriT_vr1 FreeExp$)) @p_21) :named @p_23)) :named @p_22)) :rule bind)
+(step t10 (cl (not @p_22) (not @p_15) @p_23) :rule equiv_pos2)
+(step t11 (cl @p_23) :rule th_resolution :premises (t8 t9 t10))
+(anchor :step t12 :args ((:= (?v0 FreeExp_list$) veriT_vr2)))
+(step t12.t1 (cl (! (= ?v0 veriT_vr2) :named @p_26)) :rule refl)
+(step t12.t2 (cl (= @p_1 (! (abs_ExpList$ veriT_vr2) :named @p_25))) :rule cong :premises (t12.t1))
+(step t12.t3 (cl @p_26) :rule refl)
+(step t12.t4 (cl (= @p_27 (! (map2$ uu$ veriT_vr2) :named @p_28))) :rule cong :premises (t12.t3))
+(step t12.t5 (cl (= @p_29 (! (= @p_25 @p_28) :named @p_30))) :rule cong :premises (t12.t2 t12.t4))
+(step t12 (cl (! (= @p_24 (! (forall ((veriT_vr2 FreeExp_list$)) @p_30) :named @p_32)) :named @p_31)) :rule bind)
+(step t13 (cl (not @p_31) (not @p_24) @p_32) :rule equiv_pos2)
+(step t14 (cl @p_32) :rule th_resolution :premises (axiom1 t12 t13))
+(anchor :step t15 :args ((:= (veriT_vr2 FreeExp_list$) veriT_vr3)))
+(step t15.t1 (cl (! (= veriT_vr2 veriT_vr3) :named @p_34)) :rule refl)
+(step t15.t2 (cl (= @p_25 (! (abs_ExpList$ veriT_vr3) :named @p_33))) :rule cong :premises (t15.t1))
+(step t15.t3 (cl @p_34) :rule refl)
+(step t15.t4 (cl (= @p_28 (! (map2$ uu$ veriT_vr3) :named @p_35))) :rule cong :premises (t15.t3))
+(step t15.t5 (cl (= @p_30 (! (= @p_33 @p_35) :named @p_36))) :rule cong :premises (t15.t2 t15.t4))
+(step t15 (cl (! (= @p_32 (! (forall ((veriT_vr3 FreeExp_list$)) @p_36) :named @p_38)) :named @p_37)) :rule bind)
+(step t16 (cl (not @p_37) (not @p_32) @p_38) :rule equiv_pos2)
+(step t17 (cl @p_38) :rule th_resolution :premises (t14 t15 t16))
+(anchor :step t18 :args ((:= (?v0 Exp$) veriT_vr4)))
+(anchor :step t18.t1 :args ((:= (?v1 FreeExp$) veriT_vr5)))
+(step t18.t1.t1 (cl (= ?v0 veriT_vr4)) :rule refl)
+(step t18.t1.t2 (cl (= ?v1 veriT_vr5)) :rule refl)
+(step t18.t1.t3 (cl (= @p_42 (! (insert$ veriT_vr5 bot$) :named @p_43))) :rule cong :premises (t18.t1.t2))
+(step t18.t1.t4 (cl (= @p_44 (! (myImage$ exprel$ @p_43) :named @p_45))) :rule cong :premises (t18.t1.t3))
+(step t18.t1.t5 (cl (= @p_46 (! (abs_Exp$ @p_45) :named @p_47))) :rule cong :premises (t18.t1.t4))
+(step t18.t1.t6 (cl (= @p_48 (! (= veriT_vr4 @p_47) :named @p_49))) :rule cong :premises (t18.t1.t1 t18.t1.t5))
+(step t18.t1.t7 (cl (= @p_50 (! (=> @p_49 false) :named @p_51))) :rule cong :premises (t18.t1.t6))
+(step t18.t1 (cl (= @p_40 (! (forall ((veriT_vr5 FreeExp$)) @p_51) :named @p_41))) :rule bind)
+(step t18.t2 (cl (= @p_52 (! (=> @p_41 false) :named @p_53))) :rule cong :premises (t18.t1))
+(step t18 (cl (! (= @p_39 (! (forall ((veriT_vr4 Exp$)) @p_53) :named @p_55)) :named @p_54)) :rule bind)
+(step t19 (cl (not @p_54) (not @p_39) @p_55) :rule equiv_pos2)
+(step t20 (cl @p_55) :rule th_resolution :premises (axiom2 t18 t19))
+(anchor :step t21 :args ((veriT_vr4 Exp$)))
+(anchor :step t21.t1 :args ((veriT_vr5 FreeExp$)))
+(step t21.t1.t1 (cl (= @p_51 (! (not @p_49) :named @p_57))) :rule implies_simplify)
+(step t21.t1 (cl (= @p_41 (! (forall ((veriT_vr5 FreeExp$)) @p_57) :named @p_56))) :rule bind)
+(step t21.t2 (cl (= @p_53 (! (=> @p_56 false) :named @p_58))) :rule cong :premises (t21.t1))
+(step t21.t3 (cl (= @p_58 (! (not @p_56) :named @p_59))) :rule implies_simplify)
+(step t21.t4 (cl (= @p_53 @p_59)) :rule trans :premises (t21.t2 t21.t3))
+(step t21 (cl (! (= @p_55 (! (forall ((veriT_vr4 Exp$)) @p_59) :named @p_61)) :named @p_60)) :rule bind)
+(step t22 (cl (not @p_60) (not @p_55) @p_61) :rule equiv_pos2)
+(step t23 (cl @p_61) :rule th_resolution :premises (t20 t21 t22))
+(anchor :step t24 :args ((:= (veriT_vr4 Exp$) veriT_vr6)))
+(anchor :step t24.t1 :args ((:= (veriT_vr5 FreeExp$) veriT_vr7)))
+(step t24.t1.t1 (cl (= veriT_vr4 veriT_vr6)) :rule refl)
+(step t24.t1.t2 (cl (= veriT_vr5 veriT_vr7)) :rule refl)
+(step t24.t1.t3 (cl (= @p_43 (! (insert$ veriT_vr7 bot$) :named @p_63))) :rule cong :premises (t24.t1.t2))
+(step t24.t1.t4 (cl (= @p_45 (! (myImage$ exprel$ @p_63) :named @p_64))) :rule cong :premises (t24.t1.t3))
+(step t24.t1.t5 (cl (= @p_47 (! (abs_Exp$ @p_64) :named @p_65))) :rule cong :premises (t24.t1.t4))
+(step t24.t1.t6 (cl (= @p_49 (! (= veriT_vr6 @p_65) :named @p_66))) :rule cong :premises (t24.t1.t1 t24.t1.t5))
+(step t24.t1.t7 (cl (= @p_57 (! (not @p_66) :named @p_67))) :rule cong :premises (t24.t1.t6))
+(step t24.t1 (cl (= @p_56 (! (forall ((veriT_vr7 FreeExp$)) @p_67) :named @p_62))) :rule bind)
+(step t24.t2 (cl (= @p_59 (! (not @p_62) :named @p_68))) :rule cong :premises (t24.t1))
+(step t24 (cl (! (= @p_61 (! (forall ((veriT_vr6 Exp$)) @p_68) :named @p_70)) :named @p_69)) :rule bind)
+(step t25 (cl (not @p_69) (not @p_61) @p_70) :rule equiv_pos2)
+(step t26 (cl @p_70) :rule th_resolution :premises (t23 t24 t25))
+(anchor :step t27 :args ((:= (?v0 Exp_list$) veriT_vr8) (:= (?v1 FreeExp_exp_fun$) veriT_vr9)))
+(anchor :step t27.t1 :args ((:= (?v2 FreeExp_list$) veriT_vr10)))
+(step t27.t1.t1 (cl (! (= ?v0 veriT_vr8) :named @p_80)) :rule refl)
+(step t27.t1.t2 (cl (! (= ?v1 veriT_vr9) :named @p_88)) :rule refl)
+(step t27.t1.t3 (cl (= ?v2 veriT_vr10)) :rule refl)
+(step t27.t1.t4 (cl (= @p_74 (! (map2$ veriT_vr9 veriT_vr10) :named @p_75))) :rule cong :premises (t27.t1.t2 t27.t1.t3))
+(step t27.t1.t5 (cl (= @p_76 (! (= veriT_vr8 @p_75) :named @p_77))) :rule cong :premises (t27.t1.t1 t27.t1.t4))
+(step t27.t1 (cl (= @p_72 (! (exists ((veriT_vr10 FreeExp_list$)) @p_77) :named @p_73))) :rule bind)
+(anchor :step t27.t2 :args ((:= (?v2 Exp$) veriT_vr11)))
+(step t27.t2.t1 (cl (! (= ?v2 veriT_vr11) :named @p_87)) :rule refl)
+(step t27.t2.t2 (cl @p_80) :rule refl)
+(step t27.t2.t3 (cl (= @p_81 (! (myset$ veriT_vr8) :named @p_82))) :rule cong :premises (t27.t2.t2))
+(step t27.t2.t4 (cl (= @p_83 (! (member$ veriT_vr11 @p_82) :named @p_84))) :rule cong :premises (t27.t2.t1 t27.t2.t3))
+(anchor :step t27.t2.t5 :args ((:= (?v3 FreeExp$) veriT_vr12)))
+(step t27.t2.t5.t1 (cl @p_87) :rule refl)
+(step t27.t2.t5.t2 (cl @p_88) :rule refl)
+(step t27.t2.t5.t3 (cl (= ?v3 veriT_vr12)) :rule refl)
+(step t27.t2.t5.t4 (cl (= @p_89 (! (fun_app$ veriT_vr9 veriT_vr12) :named @p_90))) :rule cong :premises (t27.t2.t5.t2 t27.t2.t5.t3))
+(step t27.t2.t5.t5 (cl (= @p_91 (! (= veriT_vr11 @p_90) :named @p_92))) :rule cong :premises (t27.t2.t5.t1 t27.t2.t5.t4))
+(step t27.t2.t5 (cl (= @p_85 (! (exists ((veriT_vr12 FreeExp$)) @p_92) :named @p_86))) :rule bind)
+(step t27.t2.t6 (cl (= @p_93 (! (=> @p_84 @p_86) :named @p_94))) :rule cong :premises (t27.t2.t4 t27.t2.t5))
+(step t27.t2 (cl (= @p_78 (! (forall ((veriT_vr11 Exp$)) @p_94) :named @p_79))) :rule bind)
+(step t27.t3 (cl (= @p_95 (! (= @p_73 @p_79) :named @p_96))) :rule cong :premises (t27.t1 t27.t2))
+(step t27 (cl (! (= @p_71 (! (forall ((veriT_vr8 Exp_list$) (veriT_vr9 FreeExp_exp_fun$)) @p_96) :named @p_98)) :named @p_97)) :rule bind)
+(step t28 (cl (not @p_97) (not @p_71) @p_98) :rule equiv_pos2)
+(step t29 (cl @p_98) :rule th_resolution :premises (axiom3 t27 t28))
+(anchor :step t30 :args ((veriT_vr8 Exp_list$) (veriT_vr9 FreeExp_exp_fun$)))
+(step t30.t1 (cl (= @p_96 (! (and (! (=> @p_73 @p_79) :named @p_115) (! (=> @p_79 @p_73) :named @p_128)) :named @p_99))) :rule connective_def)
+(step t30 (cl (! (= @p_98 (! (forall ((veriT_vr8 Exp_list$) (veriT_vr9 FreeExp_exp_fun$)) @p_99) :named @p_101)) :named @p_100)) :rule bind)
+(step t31 (cl (not @p_100) (not @p_98) @p_101) :rule equiv_pos2)
+(step t32 (cl @p_101) :rule th_resolution :premises (t29 t30 t31))
+(anchor :step t33 :args ((:= (veriT_vr8 Exp_list$) veriT_vr13) (:= (veriT_vr9 FreeExp_exp_fun$) veriT_vr14)))
+(anchor :step t33.t1 :args ((:= (veriT_vr10 FreeExp_list$) veriT_vr15)))
+(step t33.t1.t1 (cl (! (= veriT_vr8 veriT_vr13) :named @p_107)) :rule refl)
+(step t33.t1.t2 (cl (! (= veriT_vr9 veriT_vr14) :named @p_111)) :rule refl)
+(step t33.t1.t3 (cl (= veriT_vr10 veriT_vr15)) :rule refl)
+(step t33.t1.t4 (cl (= @p_75 (! (map2$ veriT_vr14 veriT_vr15) :named @p_104))) :rule cong :premises (t33.t1.t2 t33.t1.t3))
+(step t33.t1.t5 (cl (= @p_77 (! (= veriT_vr13 @p_104) :named @p_105))) :rule cong :premises (t33.t1.t1 t33.t1.t4))
+(step t33.t1 (cl (= @p_73 (! (exists ((veriT_vr15 FreeExp_list$)) @p_105) :named @p_103))) :rule bind)
+(anchor :step t33.t2 :args ((:= (veriT_vr11 Exp$) veriT_vr16)))
+(step t33.t2.t1 (cl (! (= veriT_vr11 veriT_vr16) :named @p_110)) :rule refl)
+(step t33.t2.t2 (cl @p_107) :rule refl)
+(step t33.t2.t3 (cl (! (= @p_82 (! (myset$ veriT_vr13) :named @p_102)) :named @p_118)) :rule cong :premises (t33.t2.t2))
+(step t33.t2.t4 (cl (= @p_84 (! (member$ veriT_vr16 @p_102) :named @p_108))) :rule cong :premises (t33.t2.t1 t33.t2.t3))
+(anchor :step t33.t2.t5 :args ((:= (veriT_vr12 FreeExp$) veriT_vr17)))
+(step t33.t2.t5.t1 (cl @p_110) :rule refl)
+(step t33.t2.t5.t2 (cl @p_111) :rule refl)
+(step t33.t2.t5.t3 (cl (= veriT_vr12 veriT_vr17)) :rule refl)
+(step t33.t2.t5.t4 (cl (= @p_90 (! (fun_app$ veriT_vr14 veriT_vr17) :named @p_112))) :rule cong :premises (t33.t2.t5.t2 t33.t2.t5.t3))
+(step t33.t2.t5.t5 (cl (= @p_92 (! (= veriT_vr16 @p_112) :named @p_113))) :rule cong :premises (t33.t2.t5.t1 t33.t2.t5.t4))
+(step t33.t2.t5 (cl (= @p_86 (! (exists ((veriT_vr17 FreeExp$)) @p_113) :named @p_109))) :rule bind)
+(step t33.t2.t6 (cl (= @p_94 (! (=> @p_108 @p_109) :named @p_114))) :rule cong :premises (t33.t2.t4 t33.t2.t5))
+(step t33.t2 (cl (= @p_79 (! (forall ((veriT_vr16 Exp$)) @p_114) :named @p_106))) :rule bind)
+(step t33.t3 (cl (= @p_115 (! (=> @p_103 @p_106) :named @p_116))) :rule cong :premises (t33.t1 t33.t2))
+(anchor :step t33.t4 :args ((:= (veriT_vr11 Exp$) veriT_vr18)))
+(step t33.t4.t1 (cl (! (= veriT_vr11 veriT_vr18) :named @p_121)) :rule refl)
+(step t33.t4.t2 (cl @p_107) :rule refl)
+(step t33.t4.t3 (cl @p_118) :rule cong :premises (t33.t4.t2))
+(step t33.t4.t4 (cl (= @p_84 (! (member$ veriT_vr18 @p_102) :named @p_119))) :rule cong :premises (t33.t4.t1 t33.t4.t3))
+(anchor :step t33.t4.t5 :args ((:= (veriT_vr12 FreeExp$) veriT_vr19)))
+(step t33.t4.t5.t1 (cl @p_121) :rule refl)
+(step t33.t4.t5.t2 (cl @p_111) :rule refl)
+(step t33.t4.t5.t3 (cl (= veriT_vr12 veriT_vr19)) :rule refl)
+(step t33.t4.t5.t4 (cl (= @p_90 (! (fun_app$ veriT_vr14 veriT_vr19) :named @p_122))) :rule cong :premises (t33.t4.t5.t2 t33.t4.t5.t3))
+(step t33.t4.t5.t5 (cl (= @p_92 (! (= veriT_vr18 @p_122) :named @p_123))) :rule cong :premises (t33.t4.t5.t1 t33.t4.t5.t4))
+(step t33.t4.t5 (cl (= @p_86 (! (exists ((veriT_vr19 FreeExp$)) @p_123) :named @p_120))) :rule bind)
+(step t33.t4.t6 (cl (= @p_94 (! (=> @p_119 @p_120) :named @p_124))) :rule cong :premises (t33.t4.t4 t33.t4.t5))
+(step t33.t4 (cl (= @p_79 (! (forall ((veriT_vr18 Exp$)) @p_124) :named @p_117))) :rule bind)
+(anchor :step t33.t5 :args ((:= (veriT_vr10 FreeExp_list$) veriT_vr20)))
+(step t33.t5.t1 (cl @p_107) :rule refl)
+(step t33.t5.t2 (cl @p_111) :rule refl)
+(step t33.t5.t3 (cl (= veriT_vr10 veriT_vr20)) :rule refl)
+(step t33.t5.t4 (cl (= @p_75 (! (map2$ veriT_vr14 veriT_vr20) :named @p_126))) :rule cong :premises (t33.t5.t2 t33.t5.t3))
+(step t33.t5.t5 (cl (= @p_77 (! (= veriT_vr13 @p_126) :named @p_127))) :rule cong :premises (t33.t5.t1 t33.t5.t4))
+(step t33.t5 (cl (= @p_73 (! (exists ((veriT_vr20 FreeExp_list$)) @p_127) :named @p_125))) :rule bind)
+(step t33.t6 (cl (= @p_128 (! (=> @p_117 @p_125) :named @p_129))) :rule cong :premises (t33.t4 t33.t5))
+(step t33.t7 (cl (= @p_99 (! (and @p_116 @p_129) :named @p_130))) :rule cong :premises (t33.t3 t33.t6))
+(step t33 (cl (! (= @p_101 (! (forall ((veriT_vr13 Exp_list$) (veriT_vr14 FreeExp_exp_fun$)) @p_130) :named @p_132)) :named @p_131)) :rule bind)
+(step t34 (cl (not @p_131) (not @p_101) @p_132) :rule equiv_pos2)
+(step t35 (cl @p_132) :rule th_resolution :premises (t32 t33 t34))
+(anchor :step t36 :args ((:= (veriT_vr13 Exp_list$) veriT_vr21) (:= (veriT_vr14 FreeExp_exp_fun$) veriT_vr22)))
+(anchor :step t36.t1 :args ((:= (veriT_vr15 FreeExp_list$) veriT_vr23)))
+(step t36.t1.t1 (cl (! (= veriT_vr13 veriT_vr21) :named @p_137)) :rule refl)
+(step t36.t1.t2 (cl (! (= veriT_vr14 veriT_vr22) :named @p_142)) :rule refl)
+(step t36.t1.t3 (cl (= veriT_vr15 veriT_vr23)) :rule refl)
+(step t36.t1.t4 (cl (= @p_104 (! (map2$ veriT_vr22 veriT_vr23) :named @p_135))) :rule cong :premises (t36.t1.t2 t36.t1.t3))
+(step t36.t1.t5 (cl (= @p_105 (! (= veriT_vr21 @p_135) :named @p_136))) :rule cong :premises (t36.t1.t1 t36.t1.t4))
+(step t36.t1 (cl (= @p_103 (! (exists ((veriT_vr23 FreeExp_list$)) @p_136) :named @p_134))) :rule bind)
+(anchor :step t36.t2 :args ((:= (veriT_vr16 Exp$) veriT_vr24)))
+(step t36.t2.t1 (cl (! (= veriT_vr16 veriT_vr24) :named @p_141)) :rule refl)
+(step t36.t2.t2 (cl @p_137) :rule refl)
+(step t36.t2.t3 (cl (! (= @p_102 (! (myset$ veriT_vr21) :named @p_138)) :named @p_147)) :rule cong :premises (t36.t2.t2))
+(step t36.t2.t4 (cl (= @p_108 (! (member$ veriT_vr24 @p_138) :named @p_139))) :rule cong :premises (t36.t2.t1 t36.t2.t3))
+(anchor :step t36.t2.t5 :args ((:= (veriT_vr17 FreeExp$) veriT_vr25)))
+(step t36.t2.t5.t1 (cl @p_141) :rule refl)
+(step t36.t2.t5.t2 (cl @p_142) :rule refl)
+(step t36.t2.t5.t3 (cl (= veriT_vr17 veriT_vr25)) :rule refl)
+(step t36.t2.t5.t4 (cl (= @p_112 (! (fun_app$ veriT_vr22 veriT_vr25) :named @p_143))) :rule cong :premises (t36.t2.t5.t2 t36.t2.t5.t3))
+(step t36.t2.t5.t5 (cl (= @p_113 (! (= veriT_vr24 @p_143) :named @p_144))) :rule cong :premises (t36.t2.t5.t1 t36.t2.t5.t4))
+(step t36.t2.t5 (cl (= @p_109 (! (exists ((veriT_vr25 FreeExp$)) @p_144) :named @p_140))) :rule bind)
+(step t36.t2.t6 (cl (= @p_114 (! (=> @p_139 @p_140) :named @p_145))) :rule cong :premises (t36.t2.t4 t36.t2.t5))
+(step t36.t2 (cl (= @p_106 (! (forall ((veriT_vr24 Exp$)) @p_145) :named @p_133))) :rule bind)
+(step t36.t3 (cl (= @p_116 (! (=> @p_134 @p_133) :named @p_146))) :rule cong :premises (t36.t1 t36.t2))
+(anchor :step t36.t4 :args ((:= (veriT_vr18 Exp$) veriT_vr24)))
+(step t36.t4.t1 (cl (! (= veriT_vr18 veriT_vr24) :named @p_148)) :rule refl)
+(step t36.t4.t2 (cl @p_137) :rule refl)
+(step t36.t4.t3 (cl @p_147) :rule cong :premises (t36.t4.t2))
+(step t36.t4.t4 (cl (= @p_119 @p_139)) :rule cong :premises (t36.t4.t1 t36.t4.t3))
+(anchor :step t36.t4.t5 :args ((:= (veriT_vr19 FreeExp$) veriT_vr25)))
+(step t36.t4.t5.t1 (cl @p_148) :rule refl)
+(step t36.t4.t5.t2 (cl @p_142) :rule refl)
+(step t36.t4.t5.t3 (cl (= veriT_vr19 veriT_vr25)) :rule refl)
+(step t36.t4.t5.t4 (cl (= @p_122 @p_143)) :rule cong :premises (t36.t4.t5.t2 t36.t4.t5.t3))
+(step t36.t4.t5.t5 (cl (= @p_123 @p_144)) :rule cong :premises (t36.t4.t5.t1 t36.t4.t5.t4))
+(step t36.t4.t5 (cl (= @p_120 @p_140)) :rule bind)
+(step t36.t4.t6 (cl (= @p_124 @p_145)) :rule cong :premises (t36.t4.t4 t36.t4.t5))
+(step t36.t4 (cl (= @p_117 @p_133)) :rule bind)
+(anchor :step t36.t5 :args ((:= (veriT_vr20 FreeExp_list$) veriT_vr23)))
+(step t36.t5.t1 (cl @p_137) :rule refl)
+(step t36.t5.t2 (cl @p_142) :rule refl)
+(step t36.t5.t3 (cl (= veriT_vr20 veriT_vr23)) :rule refl)
+(step t36.t5.t4 (cl (= @p_126 @p_135)) :rule cong :premises (t36.t5.t2 t36.t5.t3))
+(step t36.t5.t5 (cl (= @p_127 @p_136)) :rule cong :premises (t36.t5.t1 t36.t5.t4))
+(step t36.t5 (cl (= @p_125 @p_134)) :rule bind)
+(step t36.t6 (cl (= @p_129 (! (=> @p_133 @p_134) :named @p_149))) :rule cong :premises (t36.t4 t36.t5))
+(step t36.t7 (cl (= @p_130 (! (and @p_146 @p_149) :named @p_150))) :rule cong :premises (t36.t3 t36.t6))
+(step t36 (cl (! (= @p_132 (! (forall ((veriT_vr21 Exp_list$) (veriT_vr22 FreeExp_exp_fun$)) @p_150) :named @p_152)) :named @p_151)) :rule bind)
+(step t37 (cl (not @p_151) (not @p_132) @p_152) :rule equiv_pos2)
+(step t38 (cl @p_152) :rule th_resolution :premises (t35 t36 t37))
+(anchor :step t39 :args ((:= (veriT_vr21 Exp_list$) veriT_vr21) (:= (veriT_vr22 FreeExp_exp_fun$) veriT_vr22)))
+(anchor :step t39.t1 :args ((:= (veriT_vr24 Exp$) veriT_vr26)))
+(step t39.t1.t1 (cl (! (= veriT_vr24 veriT_vr26) :named @p_156)) :rule refl)
+(step t39.t1.t2 (cl (= @p_139 (! (member$ veriT_vr26 @p_138) :named @p_154))) :rule cong :premises (t39.t1.t1))
+(anchor :step t39.t1.t3 :args ((:= (veriT_vr25 FreeExp$) veriT_vr27)))
+(step t39.t1.t3.t1 (cl @p_156) :rule refl)
+(step t39.t1.t3.t2 (cl (= veriT_vr25 veriT_vr27)) :rule refl)
+(step t39.t1.t3.t3 (cl (= @p_143 (! (fun_app$ veriT_vr22 veriT_vr27) :named @p_157))) :rule cong :premises (t39.t1.t3.t2))
+(step t39.t1.t3.t4 (cl (= @p_144 (! (= veriT_vr26 @p_157) :named @p_158))) :rule cong :premises (t39.t1.t3.t1 t39.t1.t3.t3))
+(step t39.t1.t3 (cl (= @p_140 (! (exists ((veriT_vr27 FreeExp$)) @p_158) :named @p_155))) :rule bind)
+(step t39.t1.t4 (cl (= @p_145 (! (=> @p_154 @p_155) :named @p_159))) :rule cong :premises (t39.t1.t2 t39.t1.t3))
+(step t39.t1 (cl (= @p_133 (! (forall ((veriT_vr26 Exp$)) @p_159) :named @p_153))) :rule bind)
+(anchor :step t39.t2 :args ((:= (veriT_vr23 FreeExp_list$) veriT_vr28)))
+(step t39.t2.t1 (cl (= veriT_vr23 veriT_vr28)) :rule refl)
+(step t39.t2.t2 (cl (= @p_135 (! (map2$ veriT_vr22 veriT_vr28) :named @p_161))) :rule cong :premises (t39.t2.t1))
+(step t39.t2.t3 (cl (= @p_136 (! (= veriT_vr21 @p_161) :named @p_162))) :rule cong :premises (t39.t2.t2))
+(step t39.t2 (cl (= @p_134 (! (exists ((veriT_vr28 FreeExp_list$)) @p_162) :named @p_160))) :rule bind)
+(step t39.t3 (cl (= @p_149 (! (=> @p_153 @p_160) :named @p_163))) :rule cong :premises (t39.t1 t39.t2))
+(step t39.t4 (cl (= @p_150 (! (and @p_146 @p_163) :named @p_164))) :rule cong :premises (t39.t3))
+(step t39 (cl (! (= @p_152 (! (forall ((veriT_vr21 Exp_list$) (veriT_vr22 FreeExp_exp_fun$)) @p_164) :named @p_166)) :named @p_165)) :rule bind)
+(step t40 (cl (not @p_165) (not @p_152) @p_166) :rule equiv_pos2)
+(step t41 (cl @p_166) :rule th_resolution :premises (t38 t39 t40))
+(anchor :step t42 :args ((veriT_vr21 Exp_list$) (veriT_vr22 FreeExp_exp_fun$)))
+(step t42.t1 (cl (= @p_134 (! (not (forall ((veriT_vr23 FreeExp_list$)) (not @p_136))) :named @p_167))) :rule connective_def)
+(step t42.t2 (cl (= @p_146 (! (=> @p_167 @p_133) :named @p_168))) :rule cong :premises (t42.t1))
+(anchor :step t42.t3 :args ((veriT_vr26 Exp$)))
+(step t42.t3.t1 (cl (= @p_155 (! (not (forall ((veriT_vr27 FreeExp$)) (not @p_158))) :named @p_170))) :rule connective_def)
+(step t42.t3.t2 (cl (= @p_159 (! (=> @p_154 @p_170) :named @p_171))) :rule cong :premises (t42.t3.t1))
+(step t42.t3 (cl (= @p_153 (! (forall ((veriT_vr26 Exp$)) @p_171) :named @p_169))) :rule bind)
+(step t42.t4 (cl (= @p_163 (! (=> @p_169 @p_160) :named @p_172))) :rule cong :premises (t42.t3))
+(step t42.t5 (cl (= @p_164 (! (and @p_168 @p_172) :named @p_173))) :rule cong :premises (t42.t2 t42.t4))
+(step t42 (cl (! (= @p_166 (! (forall ((veriT_vr21 Exp_list$) (veriT_vr22 FreeExp_exp_fun$)) @p_173) :named @p_175)) :named @p_174)) :rule bind)
+(step t43 (cl (not @p_174) (not @p_166) @p_175) :rule equiv_pos2)
+(step t44 (cl @p_175) :rule th_resolution :premises (t41 t42 t43))
+(anchor :step t45 :args ((:= (?v0 FreeExp_list$) veriT_vr29)))
+(step t45.t1 (cl (= ?v0 veriT_vr29)) :rule refl)
+(step t45.t2 (cl (= @p_1 (! (abs_ExpList$ veriT_vr29) :named @p_177))) :rule cong :premises (t45.t1))
+(step t45.t3 (cl (= @p_178 (! (= z$ @p_177) :named @p_179))) :rule cong :premises (t45.t2))
+(step t45 (cl (= @p_176 (! (exists ((veriT_vr29 FreeExp_list$)) @p_179) :named @p_181))) :rule bind)
+(step t46 (cl (! (= @p_180 (! (not @p_181) :named @p_183)) :named @p_182)) :rule cong :premises (t45))
+(step t47 (cl (! (not @p_182) :named @p_185) (! (not @p_180) :named @p_184) @p_183) :rule equiv_pos2)
+(step t48 (cl (not @p_184) @p_176) :rule not_not)
+(step t49 (cl @p_185 @p_176 @p_183) :rule th_resolution :premises (t48 t47))
+(step t50 (cl @p_183) :rule th_resolution :premises (axiom4 t46 t49))
+(anchor :step t51 :args ((:= (veriT_vr29 FreeExp_list$) veriT_vr30)))
+(step t51.t1 (cl (= veriT_vr29 veriT_vr30)) :rule refl)
+(step t51.t2 (cl (= @p_177 (! (abs_ExpList$ veriT_vr30) :named @p_186))) :rule cong :premises (t51.t1))
+(step t51.t3 (cl (= @p_179 (! (= z$ @p_186) :named @p_187))) :rule cong :premises (t51.t2))
+(step t51 (cl (= @p_181 (! (exists ((veriT_vr30 FreeExp_list$)) @p_187) :named @p_188))) :rule bind)
+(step t52 (cl (! (= @p_183 (! (not @p_188) :named @p_190)) :named @p_189)) :rule cong :premises (t51))
+(step t53 (cl (! (not @p_189) :named @p_192) (! (not @p_183) :named @p_191) @p_190) :rule equiv_pos2)
+(step t54 (cl (not @p_191) @p_181) :rule not_not)
+(step t55 (cl @p_192 @p_181 @p_190) :rule th_resolution :premises (t54 t53))
+(step t56 (cl @p_190) :rule th_resolution :premises (t50 t52 t55))
+(step t57 (cl (= @p_188 (! (not (! (forall ((veriT_vr30 FreeExp_list$)) (not @p_187)) :named @p_198)) :named @p_193))) :rule connective_def)
+(step t58 (cl (! (= @p_190 (! (not @p_193) :named @p_195)) :named @p_194)) :rule cong :premises (t57))
+(step t59 (cl (! (not @p_194) :named @p_197) (! (not @p_190) :named @p_196) @p_195) :rule equiv_pos2)
+(step t60 (cl (not @p_196) @p_188) :rule not_not)
+(step t61 (cl @p_197 @p_188 @p_195) :rule th_resolution :premises (t60 t59))
+(step t62 (cl (not @p_195) @p_198) :rule not_not)
+(step t63 (cl @p_197 @p_188 @p_198) :rule th_resolution :premises (t62 t61))
+(step t64 (cl @p_195) :rule th_resolution :premises (t56 t58 t63))
+(step t65 (cl @p_198) :rule th_resolution :premises (t62 t64))
+(step t66 (cl (or (! (not @p_175) :named @p_336) (! (and (! (=> (! (not (! (forall ((veriT_vr23 FreeExp_list$)) (! (not (! (= z$ (! (map2$ uu$ veriT_vr23) :named @p_203)) :named @p_205)) :named @p_207)) :named @p_202)) :named @p_209) (! (forall ((veriT_vr24 Exp$)) (! (=> (! (member$ veriT_vr24 @p_199) :named @p_212) (! (exists ((veriT_vr25 FreeExp$)) (! (= veriT_vr24 (! (fun_app$ uu$ veriT_vr25) :named @p_217)) :named @p_219)) :named @p_214)) :named @p_221)) :named @p_211)) :named @p_223) (! (=> (! (forall ((veriT_vr26 Exp$)) (! (=> (! (member$ veriT_vr26 @p_199) :named @p_227) (! (not (! (forall ((veriT_vr27 FreeExp$)) (! (not (! (= veriT_vr26 (! (fun_app$ uu$ veriT_vr27) :named @p_231)) :named @p_232)) :named @p_233)) :named @p_228)) :named @p_235)) :named @p_237)) :named @p_226) (! (exists ((veriT_vr28 FreeExp_list$)) (! (= z$ (! (map2$ uu$ veriT_vr28) :named @p_240)) :named @p_241)) :named @p_239)) :named @p_242)) :named @p_200))) :rule forall_inst :args ((:= veriT_vr21 z$) (:= veriT_vr22 uu$)))
+(anchor :step t67)
+(assume t67.h1 @p_200)
+(anchor :step t67.t2 :args ((:= (veriT_vr23 FreeExp_list$) veriT_vr31)))
+(step t67.t2.t1 (cl (= veriT_vr23 veriT_vr31)) :rule refl)
+(step t67.t2.t2 (cl (= @p_203 (! (map2$ uu$ veriT_vr31) :named @p_204))) :rule cong :premises (t67.t2.t1))
+(step t67.t2.t3 (cl (= @p_205 (! (= z$ @p_204) :named @p_206))) :rule cong :premises (t67.t2.t2))
+(step t67.t2.t4 (cl (= @p_207 (! (not @p_206) :named @p_208))) :rule cong :premises (t67.t2.t3))
+(step t67.t2 (cl (= @p_202 (! (forall ((veriT_vr31 FreeExp_list$)) @p_208) :named @p_210))) :rule bind)
+(step t67.t3 (cl (= @p_209 (! (not @p_210) :named @p_224))) :rule cong :premises (t67.t2))
+(anchor :step t67.t4 :args ((:= (veriT_vr24 Exp$) veriT_vr32)))
+(step t67.t4.t1 (cl (! (= veriT_vr24 veriT_vr32) :named @p_216)) :rule refl)
+(step t67.t4.t2 (cl (= @p_212 (! (member$ veriT_vr32 @p_199) :named @p_213))) :rule cong :premises (t67.t4.t1))
+(anchor :step t67.t4.t3 :args ((:= (veriT_vr25 FreeExp$) veriT_vr33)))
+(step t67.t4.t3.t1 (cl @p_216) :rule refl)
+(step t67.t4.t3.t2 (cl (= veriT_vr25 veriT_vr33)) :rule refl)
+(step t67.t4.t3.t3 (cl (= @p_217 (! (fun_app$ uu$ veriT_vr33) :named @p_218))) :rule cong :premises (t67.t4.t3.t2))
+(step t67.t4.t3.t4 (cl (= @p_219 (! (= veriT_vr32 @p_218) :named @p_220))) :rule cong :premises (t67.t4.t3.t1 t67.t4.t3.t3))
+(step t67.t4.t3 (cl (= @p_214 (! (exists ((veriT_vr33 FreeExp$)) @p_220) :named @p_215))) :rule bind)
+(step t67.t4.t4 (cl (= @p_221 (! (=> @p_213 @p_215) :named @p_222))) :rule cong :premises (t67.t4.t2 t67.t4.t3))
+(step t67.t4 (cl (= @p_211 (! (forall ((veriT_vr32 Exp$)) @p_222) :named @p_225))) :rule bind)
+(step t67.t5 (cl (= @p_223 (! (=> @p_224 @p_225) :named @p_245))) :rule cong :premises (t67.t3 t67.t4))
+(anchor :step t67.t6 :args ((:= (veriT_vr26 Exp$) veriT_vr32)))
+(step t67.t6.t1 (cl (! (= veriT_vr26 veriT_vr32) :named @p_230)) :rule refl)
+(step t67.t6.t2 (cl (= @p_227 @p_213)) :rule cong :premises (t67.t6.t1))
+(anchor :step t67.t6.t3 :args ((:= (veriT_vr27 FreeExp$) veriT_vr33)))
+(step t67.t6.t3.t1 (cl @p_230) :rule refl)
+(step t67.t6.t3.t2 (cl (= veriT_vr27 veriT_vr33)) :rule refl)
+(step t67.t6.t3.t3 (cl (= @p_231 @p_218)) :rule cong :premises (t67.t6.t3.t2))
+(step t67.t6.t3.t4 (cl (= @p_232 @p_220)) :rule cong :premises (t67.t6.t3.t1 t67.t6.t3.t3))
+(step t67.t6.t3.t5 (cl (= @p_233 (! (not @p_220) :named @p_234))) :rule cong :premises (t67.t6.t3.t4))
+(step t67.t6.t3 (cl (= @p_228 (! (forall ((veriT_vr33 FreeExp$)) @p_234) :named @p_229))) :rule bind)
+(step t67.t6.t4 (cl (= @p_235 (! (not @p_229) :named @p_236))) :rule cong :premises (t67.t6.t3))
+(step t67.t6.t5 (cl (= @p_237 (! (=> @p_213 @p_236) :named @p_238))) :rule cong :premises (t67.t6.t2 t67.t6.t4))
+(step t67.t6 (cl (= @p_226 (! (forall ((veriT_vr32 Exp$)) @p_238) :named @p_243))) :rule bind)
+(anchor :step t67.t7 :args ((:= (veriT_vr28 FreeExp_list$) veriT_vr31)))
+(step t67.t7.t1 (cl (= veriT_vr28 veriT_vr31)) :rule refl)
+(step t67.t7.t2 (cl (= @p_240 @p_204)) :rule cong :premises (t67.t7.t1))
+(step t67.t7.t3 (cl (= @p_241 @p_206)) :rule cong :premises (t67.t7.t2))
+(step t67.t7 (cl (= @p_239 (! (exists ((veriT_vr31 FreeExp_list$)) @p_206) :named @p_244))) :rule bind)
+(step t67.t8 (cl (= @p_242 (! (=> @p_243 @p_244) :named @p_246))) :rule cong :premises (t67.t6 t67.t7))
+(step t67.t9 (cl (! (= @p_200 (! (and @p_245 @p_246) :named @p_249)) :named @p_247)) :rule cong :premises (t67.t5 t67.t8))
+(step t67.t10 (cl (not @p_247) (! (not @p_200) :named @p_248) @p_249) :rule equiv_pos2)
+(step t67.t11 (cl @p_249) :rule th_resolution :premises (t67.h1 t67.t9 t67.t10))
+(anchor :step t67.t12 :args ((:= (veriT_vr32 Exp$) veriT_vr34)))
+(step t67.t12.t1 (cl (! (= veriT_vr32 veriT_vr34) :named @p_252)) :rule refl)
+(step t67.t12.t2 (cl (= @p_213 (! (member$ veriT_vr34 @p_199) :named @p_250))) :rule cong :premises (t67.t12.t1))
+(anchor :step t67.t12.t3 :args ((:= (veriT_vr33 FreeExp$) veriT_vr35)))
+(step t67.t12.t3.t1 (cl @p_252) :rule refl)
+(step t67.t12.t3.t2 (cl (= veriT_vr33 veriT_vr35)) :rule refl)
+(step t67.t12.t3.t3 (cl (= @p_218 (! (fun_app$ uu$ veriT_vr35) :named @p_253))) :rule cong :premises (t67.t12.t3.t2))
+(step t67.t12.t3.t4 (cl (= @p_220 (! (= veriT_vr34 @p_253) :named @p_254))) :rule cong :premises (t67.t12.t3.t1 t67.t12.t3.t3))
+(step t67.t12.t3.t5 (cl (= @p_234 (! (not @p_254) :named @p_255))) :rule cong :premises (t67.t12.t3.t4))
+(step t67.t12.t3 (cl (= @p_229 (! (forall ((veriT_vr35 FreeExp$)) @p_255) :named @p_251))) :rule bind)
+(step t67.t12.t4 (cl (= @p_236 (! (not @p_251) :named @p_256))) :rule cong :premises (t67.t12.t3))
+(step t67.t12.t5 (cl (= @p_238 (! (=> @p_250 @p_256) :named @p_257))) :rule cong :premises (t67.t12.t2 t67.t12.t4))
+(step t67.t12 (cl (= @p_243 (! (forall ((veriT_vr34 Exp$)) @p_257) :named @p_260))) :rule bind)
+(anchor :step t67.t13 :args ((:= (veriT_vr31 FreeExp_list$) veriT_vr36)))
+(step t67.t13.t1 (cl (= veriT_vr31 veriT_vr36)) :rule refl)
+(step t67.t13.t2 (cl (= @p_204 (! (map2$ uu$ veriT_vr36) :named @p_258))) :rule cong :premises (t67.t13.t1))
+(step t67.t13.t3 (cl (= @p_206 (! (= z$ @p_258) :named @p_259))) :rule cong :premises (t67.t13.t2))
+(step t67.t13 (cl (= @p_244 (! (exists ((veriT_vr36 FreeExp_list$)) @p_259) :named @p_261))) :rule bind)
+(step t67.t14 (cl (= @p_246 (! (=> @p_260 @p_261) :named @p_262))) :rule cong :premises (t67.t12 t67.t13))
+(step t67.t15 (cl (! (= @p_249 (! (and @p_245 @p_262) :named @p_264)) :named @p_263)) :rule cong :premises (t67.t14))
+(step t67.t16 (cl (not @p_263) (not @p_249) @p_264) :rule equiv_pos2)
+(step t67.t17 (cl @p_264) :rule th_resolution :premises (t67.t11 t67.t15 t67.t16))
+(anchor :step t67.t18 :args ((:= (veriT_vr31 FreeExp_list$) veriT_vr37)))
+(step t67.t18.t1 (cl (= veriT_vr31 veriT_vr37)) :rule refl)
+(step t67.t18.t2 (cl (= @p_204 (! (map2$ uu$ veriT_vr37) :named @p_265))) :rule cong :premises (t67.t18.t1))
+(step t67.t18.t3 (cl (= @p_206 (! (= z$ @p_265) :named @p_266))) :rule cong :premises (t67.t18.t2))
+(step t67.t18.t4 (cl (= @p_208 (! (not @p_266) :named @p_267))) :rule cong :premises (t67.t18.t3))
+(step t67.t18 (cl (= @p_210 (! (forall ((veriT_vr37 FreeExp_list$)) @p_267) :named @p_268))) :rule bind)
+(step t67.t19 (cl (= @p_224 (! (not @p_268) :named @p_275))) :rule cong :premises (t67.t18))
+(anchor :step t67.t20 :args ((:= (veriT_vr32 Exp$) veriT_vr38)))
+(step t67.t20.t1 (cl (! (= veriT_vr32 veriT_vr38) :named @p_271)) :rule refl)
+(step t67.t20.t2 (cl (= @p_213 (! (member$ veriT_vr38 @p_199) :named @p_269))) :rule cong :premises (t67.t20.t1))
+(anchor :step t67.t20.t3 :args ((:= (veriT_vr33 FreeExp$) veriT_vr39)))
+(step t67.t20.t3.t1 (cl @p_271) :rule refl)
+(step t67.t20.t3.t2 (cl (= veriT_vr33 veriT_vr39)) :rule refl)
+(step t67.t20.t3.t3 (cl (= @p_218 (! (fun_app$ uu$ veriT_vr39) :named @p_272))) :rule cong :premises (t67.t20.t3.t2))
+(step t67.t20.t3.t4 (cl (= @p_220 (! (= veriT_vr38 @p_272) :named @p_273))) :rule cong :premises (t67.t20.t3.t1 t67.t20.t3.t3))
+(step t67.t20.t3 (cl (= @p_215 (! (exists ((veriT_vr39 FreeExp$)) @p_273) :named @p_270))) :rule bind)
+(step t67.t20.t4 (cl (= @p_222 (! (=> @p_269 @p_270) :named @p_274))) :rule cong :premises (t67.t20.t2 t67.t20.t3))
+(step t67.t20 (cl (= @p_225 (! (forall ((veriT_vr38 Exp$)) @p_274) :named @p_276))) :rule bind)
+(step t67.t21 (cl (= @p_245 (! (=> @p_275 @p_276) :named @p_289))) :rule cong :premises (t67.t19 t67.t20))
+(anchor :step t67.t22 :args ((:= (veriT_vr34 Exp$) veriT_vr40)))
+(step t67.t22.t1 (cl (! (= veriT_vr34 veriT_vr40) :named @p_280)) :rule refl)
+(step t67.t22.t2 (cl (= @p_250 @p_278)) :rule cong :premises (t67.t22.t1))
+(anchor :step t67.t22.t3 :args ((:= (veriT_vr35 FreeExp$) veriT_vr41)))
+(step t67.t22.t3.t1 (cl @p_280) :rule refl)
+(step t67.t22.t3.t2 (cl (= veriT_vr35 veriT_vr41)) :rule refl)
+(step t67.t22.t3.t3 (cl (= @p_253 @p_281)) :rule cong :premises (t67.t22.t3.t2))
+(step t67.t22.t3.t4 (cl (= @p_254 @p_282)) :rule cong :premises (t67.t22.t3.t1 t67.t22.t3.t3))
+(step t67.t22.t3.t5 (cl (= @p_255 @p_283)) :rule cong :premises (t67.t22.t3.t4))
+(step t67.t22.t3 (cl (= @p_251 @p_279)) :rule bind)
+(step t67.t22.t4 (cl (= @p_256 @p_284)) :rule cong :premises (t67.t22.t3))
+(step t67.t22.t5 (cl (= @p_257 @p_277)) :rule cong :premises (t67.t22.t2 t67.t22.t4))
+(step t67.t22 (cl (= @p_260 (! (forall ((veriT_vr40 Exp$)) @p_277) :named @p_287))) :rule bind)
+(anchor :step t67.t23 :args ((:= (veriT_vr36 FreeExp_list$) veriT_vr42)))
+(step t67.t23.t1 (cl (= veriT_vr36 veriT_vr42)) :rule refl)
+(step t67.t23.t2 (cl (= @p_258 @p_286)) :rule cong :premises (t67.t23.t1))
+(step t67.t23.t3 (cl (= @p_259 @p_285)) :rule cong :premises (t67.t23.t2))
+(step t67.t23 (cl (= @p_261 (! (exists ((veriT_vr42 FreeExp_list$)) @p_285) :named @p_288))) :rule bind)
+(step t67.t24 (cl (= @p_262 (! (=> @p_287 @p_288) :named @p_290))) :rule cong :premises (t67.t22 t67.t23))
+(step t67.t25 (cl (! (= @p_264 (! (and @p_289 @p_290) :named @p_292)) :named @p_291)) :rule cong :premises (t67.t21 t67.t24))
+(step t67.t26 (cl (not @p_291) (not @p_264) @p_292) :rule equiv_pos2)
+(step t67.t27 (cl @p_292) :rule th_resolution :premises (t67.t17 t67.t25 t67.t26))
+(anchor :step t67.t28 :args ((:= (veriT_vr40 Exp$) veriT_sk0)))
+(step t67.t28.t1 (cl (! (= veriT_vr40 veriT_sk0) :named @p_295)) :rule refl)
+(step t67.t28.t2 (cl (= @p_278 (! (member$ veriT_sk0 @p_199) :named @p_293))) :rule cong :premises (t67.t28.t1))
+(anchor :step t67.t28.t3 :args ((veriT_vr41 FreeExp$)))
+(step t67.t28.t3.t1 (cl @p_295) :rule refl)
+(step t67.t28.t3.t2 (cl (= @p_282 (! (= @p_281 veriT_sk0) :named @p_296))) :rule cong :premises (t67.t28.t3.t1))
+(step t67.t28.t3.t3 (cl (= @p_283 (! (not @p_296) :named @p_297))) :rule cong :premises (t67.t28.t3.t2))
+(step t67.t28.t3 (cl (= @p_279 (! (forall ((veriT_vr41 FreeExp$)) @p_297) :named @p_294))) :rule bind)
+(step t67.t28.t4 (cl (= @p_284 (! (not @p_294) :named @p_298))) :rule cong :premises (t67.t28.t3))
+(step t67.t28.t5 (cl (= @p_277 (! (=> @p_293 @p_298) :named @p_299))) :rule cong :premises (t67.t28.t2 t67.t28.t4))
+(step t67.t28 (cl (= @p_287 @p_299)) :rule sko_forall)
+(anchor :step t67.t29 :args ((:= (veriT_vr42 FreeExp_list$) veriT_sk1)))
+(step t67.t29.t1 (cl (= veriT_vr42 veriT_sk1)) :rule refl)
+(step t67.t29.t2 (cl (= @p_286 (! (map2$ uu$ veriT_sk1) :named @p_302))) :rule cong :premises (t67.t29.t1))
+(step t67.t29.t3 (cl (= @p_285 (! (= z$ @p_302) :named @p_300))) :rule cong :premises (t67.t29.t2))
+(step t67.t29 (cl (= @p_288 @p_300)) :rule sko_ex)
+(step t67.t30 (cl (= @p_290 (! (=> @p_299 @p_300) :named @p_303))) :rule cong :premises (t67.t28 t67.t29))
+(step t67.t31 (cl (! (= @p_292 (! (and @p_289 @p_303) :named @p_305)) :named @p_304)) :rule cong :premises (t67.t30))
+(step t67.t32 (cl (not @p_304) (not @p_292) @p_305) :rule equiv_pos2)
+(step t67.t33 (cl @p_305) :rule th_resolution :premises (t67.t27 t67.t31 t67.t32))
+(anchor :step t67.t34 :args ((:= (veriT_vr37 FreeExp_list$) veriT_vr43)))
+(step t67.t34.t1 (cl (= veriT_vr37 veriT_vr43)) :rule refl)
+(step t67.t34.t2 (cl (= @p_265 (! (map2$ uu$ veriT_vr43) :named @p_307))) :rule cong :premises (t67.t34.t1))
+(step t67.t34.t3 (cl (= @p_266 (! (= z$ @p_307) :named @p_308))) :rule cong :premises (t67.t34.t2))
+(step t67.t34.t4 (cl (= @p_267 (! (not @p_308) :named @p_309))) :rule cong :premises (t67.t34.t3))
+(step t67.t34 (cl (= @p_268 (! (forall ((veriT_vr43 FreeExp_list$)) @p_309) :named @p_306))) :rule bind)
+(step t67.t35 (cl (= @p_275 (! (not @p_306) :named @p_310))) :rule cong :premises (t67.t34))
+(anchor :step t67.t36 :args ((:= (veriT_vr38 Exp$) veriT_vr44)))
+(step t67.t36.t1 (cl (! (= veriT_vr38 veriT_vr44) :named @p_314)) :rule refl)
+(step t67.t36.t2 (cl (= @p_269 (! (member$ veriT_vr44 @p_199) :named @p_312))) :rule cong :premises (t67.t36.t1))
+(anchor :step t67.t36.t3 :args ((:= (veriT_vr39 FreeExp$) veriT_vr45)))
+(step t67.t36.t3.t1 (cl @p_314) :rule refl)
+(step t67.t36.t3.t2 (cl (= veriT_vr39 veriT_vr45)) :rule refl)
+(step t67.t36.t3.t3 (cl (= @p_272 (! (fun_app$ uu$ veriT_vr45) :named @p_315))) :rule cong :premises (t67.t36.t3.t2))
+(step t67.t36.t3.t4 (cl (= @p_273 (! (= veriT_vr44 @p_315) :named @p_316))) :rule cong :premises (t67.t36.t3.t1 t67.t36.t3.t3))
+(step t67.t36.t3 (cl (= @p_270 (! (exists ((veriT_vr45 FreeExp$)) @p_316) :named @p_313))) :rule bind)
+(step t67.t36.t4 (cl (= @p_274 (! (=> @p_312 @p_313) :named @p_317))) :rule cong :premises (t67.t36.t2 t67.t36.t3))
+(step t67.t36 (cl (= @p_276 (! (forall ((veriT_vr44 Exp$)) @p_317) :named @p_311))) :rule bind)
+(step t67.t37 (cl (= @p_289 (! (=> @p_310 @p_311) :named @p_318))) :rule cong :premises (t67.t35 t67.t36))
+(anchor :step t67.t38 :args ((:= (veriT_vr41 FreeExp$) veriT_vr45)))
+(step t67.t38.t1 (cl (= veriT_vr41 veriT_vr45)) :rule refl)
+(step t67.t38.t2 (cl (= @p_281 @p_315)) :rule cong :premises (t67.t38.t1))
+(step t67.t38.t3 (cl (= @p_296 (! (= veriT_sk0 @p_315) :named @p_319))) :rule cong :premises (t67.t38.t2))
+(step t67.t38.t4 (cl (= @p_297 (! (not @p_319) :named @p_320))) :rule cong :premises (t67.t38.t3))
+(step t67.t38 (cl (= @p_294 (! (forall ((veriT_vr45 FreeExp$)) @p_320) :named @p_321))) :rule bind)
+(step t67.t39 (cl (= @p_298 (! (not @p_321) :named @p_322))) :rule cong :premises (t67.t38))
+(step t67.t40 (cl (= @p_299 (! (=> @p_293 @p_322) :named @p_323))) :rule cong :premises (t67.t39))
+(step t67.t41 (cl (= @p_303 (! (=> @p_323 @p_300) :named @p_324))) :rule cong :premises (t67.t40))
+(step t67.t42 (cl (! (= @p_305 (! (and @p_318 @p_324) :named @p_326)) :named @p_325)) :rule cong :premises (t67.t37 t67.t41))
+(step t67.t43 (cl (not @p_325) (not @p_305) @p_326) :rule equiv_pos2)
+(step t67.t44 (cl @p_326) :rule th_resolution :premises (t67.t33 t67.t42 t67.t43))
+(anchor :step t67.t45 :args ((:= (veriT_vr45 FreeExp$) veriT_vr46)))
+(step t67.t45.t1 (cl (= veriT_vr45 veriT_vr46)) :rule refl)
+(step t67.t45.t2 (cl (= @p_315 (! (fun_app$ uu$ veriT_vr46) :named @p_328))) :rule cong :premises (t67.t45.t1))
+(step t67.t45.t3 (cl (= @p_319 (! (= veriT_sk0 @p_328) :named @p_329))) :rule cong :premises (t67.t45.t2))
+(step t67.t45.t4 (cl (= @p_320 (! (not @p_329) :named @p_330))) :rule cong :premises (t67.t45.t3))
+(step t67.t45 (cl (= @p_321 (! (forall ((veriT_vr46 FreeExp$)) @p_330) :named @p_327))) :rule bind)
+(step t67.t46 (cl (= @p_322 (! (not @p_327) :named @p_331))) :rule cong :premises (t67.t45))
+(step t67.t47 (cl (= @p_323 (! (=> @p_293 @p_331) :named @p_332))) :rule cong :premises (t67.t46))
+(step t67.t48 (cl (= @p_324 (! (=> @p_332 @p_300) :named @p_333))) :rule cong :premises (t67.t47))
+(step t67.t49 (cl (! (= @p_326 (! (and @p_318 @p_333) :named @p_334)) :named @p_335)) :rule cong :premises (t67.t48))
+(step t67.t50 (cl (not @p_335) (not @p_326) @p_334) :rule equiv_pos2)
+(step t67.t51 (cl @p_334) :rule th_resolution :premises (t67.t44 t67.t49 t67.t50))
+(step t67 (cl @p_248 @p_334) :rule subproof :discharge (h1))
+(step t68 (cl @p_336 @p_200) :rule or :premises (t66))
+(step t69 (cl (! (or @p_336 @p_334) :named @p_338) (! (not @p_336) :named @p_337)) :rule or_neg)
+(step t70 (cl (not @p_337) @p_175) :rule not_not)
+(step t71 (cl @p_338 @p_175) :rule th_resolution :premises (t70 t69))
+(step t72 (cl @p_338 (! (not @p_334) :named @p_340)) :rule or_neg)
+(step t73 (cl @p_338) :rule th_resolution :premises (t68 t67 t71 t72))
+(step t74 (cl @p_332 (! (not @p_331) :named @p_339)) :rule implies_neg2)
+(step t75 (cl (not @p_339) @p_327) :rule not_not)
+(step t76 (cl @p_332 @p_327) :rule th_resolution :premises (t75 t74))
+(step t77 (cl (not @p_333) (! (not @p_332) :named @p_393) @p_300) :rule implies_pos)
+(step t78 (cl @p_340 @p_333) :rule and_pos)
+(step t79 (cl @p_336 @p_334) :rule or :premises (t73))
+(step t80 (cl @p_334) :rule resolution :premises (t79 t44))
+(step t81 (cl @p_333) :rule resolution :premises (t78 t80))
+(step t82 (cl (or (! (not @p_70) :named @p_377) (! (not (! (forall ((veriT_vr7 FreeExp$)) (! (not (! (= @p_65 veriT_sk0) :named @p_346)) :named @p_348)) :named @p_342)) :named @p_341))) :rule forall_inst :args ((:= veriT_vr6 veriT_sk0)))
+(anchor :step t83)
+(assume t83.h1 @p_341)
+(anchor :step t83.t2 :args ((:= (veriT_vr7 FreeExp$) veriT_vr47)))
+(step t83.t2.t1 (cl (= veriT_vr7 veriT_vr47)) :rule refl)
+(step t83.t2.t2 (cl (= @p_63 (! (insert$ veriT_vr47 bot$) :named @p_343))) :rule cong :premises (t83.t2.t1))
+(step t83.t2.t3 (cl (= @p_64 (! (myImage$ exprel$ @p_343) :named @p_344))) :rule cong :premises (t83.t2.t2))
+(step t83.t2.t4 (cl (= @p_65 (! (abs_Exp$ @p_344) :named @p_345))) :rule cong :premises (t83.t2.t3))
+(step t83.t2.t5 (cl (= @p_346 (! (= veriT_sk0 @p_345) :named @p_347))) :rule cong :premises (t83.t2.t4))
+(step t83.t2.t6 (cl (= @p_348 (! (not @p_347) :named @p_349))) :rule cong :premises (t83.t2.t5))
+(step t83.t2 (cl (= @p_342 (! (forall ((veriT_vr47 FreeExp$)) @p_349) :named @p_350))) :rule bind)
+(step t83.t3 (cl (! (= @p_341 (! (not @p_350) :named @p_353)) :named @p_351)) :rule cong :premises (t83.t2))
+(step t83.t4 (cl (! (not @p_351) :named @p_354) (! (not @p_341) :named @p_352) @p_353) :rule equiv_pos2)
+(step t83.t5 (cl (! (not @p_352) :named @p_376) @p_342) :rule not_not)
+(step t83.t6 (cl @p_354 @p_342 @p_353) :rule th_resolution :premises (t83.t5 t83.t4))
+(step t83.t7 (cl @p_353) :rule th_resolution :premises (t83.h1 t83.t3 t83.t6))
+(anchor :step t83.t8 :args ((:= (veriT_vr47 FreeExp$) veriT_vr48)))
+(step t83.t8.t1 (cl (= veriT_vr47 veriT_vr48)) :rule refl)
+(step t83.t8.t2 (cl (= @p_343 @p_356)) :rule cong :premises (t83.t8.t1))
+(step t83.t8.t3 (cl (= @p_344 @p_357)) :rule cong :premises (t83.t8.t2))
+(step t83.t8.t4 (cl (= @p_345 @p_358)) :rule cong :premises (t83.t8.t3))
+(step t83.t8.t5 (cl (= @p_347 @p_359)) :rule cong :premises (t83.t8.t4))
+(step t83.t8.t6 (cl (= @p_349 @p_355)) :rule cong :premises (t83.t8.t5))
+(step t83.t8 (cl (= @p_350 (! (forall ((veriT_vr48 FreeExp$)) @p_355) :named @p_360))) :rule bind)
+(step t83.t9 (cl (! (= @p_353 (! (not @p_360) :named @p_362)) :named @p_361)) :rule cong :premises (t83.t8))
+(step t83.t10 (cl (! (not @p_361) :named @p_364) (! (not @p_353) :named @p_363) @p_362) :rule equiv_pos2)
+(step t83.t11 (cl (not @p_363) @p_350) :rule not_not)
+(step t83.t12 (cl @p_364 @p_350 @p_362) :rule th_resolution :premises (t83.t11 t83.t10))
+(step t83.t13 (cl @p_362) :rule th_resolution :premises (t83.t7 t83.t9 t83.t12))
+(anchor :step t83.t14 :args ((:= (veriT_vr48 FreeExp$) veriT_sk2)))
+(step t83.t14.t1 (cl (= veriT_vr48 veriT_sk2)) :rule refl)
+(step t83.t14.t2 (cl (= @p_356 (! (insert$ veriT_sk2 bot$) :named @p_367))) :rule cong :premises (t83.t14.t1))
+(step t83.t14.t3 (cl (= @p_357 (! (myImage$ exprel$ @p_367) :named @p_368))) :rule cong :premises (t83.t14.t2))
+(step t83.t14.t4 (cl (= @p_358 (! (abs_Exp$ @p_368) :named @p_369))) :rule cong :premises (t83.t14.t3))
+(step t83.t14.t5 (cl (= @p_359 (! (= veriT_sk0 @p_369) :named @p_365))) :rule cong :premises (t83.t14.t4))
+(step t83.t14.t6 (cl (= @p_355 (! (not @p_365) :named @p_370))) :rule cong :premises (t83.t14.t5))
+(step t83.t14 (cl (= @p_360 @p_370)) :rule sko_forall)
+(step t83.t15 (cl (! (= @p_362 (! (not @p_370) :named @p_372)) :named @p_371)) :rule cong :premises (t83.t14))
+(step t83.t16 (cl (! (not @p_371) :named @p_374) (! (not @p_362) :named @p_373) @p_372) :rule equiv_pos2)
+(step t83.t17 (cl (not @p_373) @p_360) :rule not_not)
+(step t83.t18 (cl @p_374 @p_360 @p_372) :rule th_resolution :premises (t83.t17 t83.t16))
+(step t83.t19 (cl (! (not @p_372) :named @p_375) @p_365) :rule not_not)
+(step t83.t20 (cl @p_374 @p_360 @p_365) :rule th_resolution :premises (t83.t19 t83.t18))
+(step t83.t21 (cl @p_372) :rule th_resolution :premises (t83.t13 t83.t15 t83.t20))
+(step t83.t22 (cl @p_375 @p_365) :rule not_not)
+(step t83.t23 (cl @p_365) :rule th_resolution :premises (t83.t22 t83.t21))
+(step t83.t24 (cl (= @p_372 @p_365)) :rule not_simplify)
+(step t83.t25 (cl @p_365) :rule th_resolution :premises (t83.t23 t83.t24))
+(step t83 (cl @p_352 @p_365) :rule subproof :discharge (h1))
+(step t84 (cl @p_376 @p_342) :rule not_not)
+(step t85 (cl @p_342 @p_365) :rule th_resolution :premises (t84 t83))
+(step t86 (cl @p_377 @p_341) :rule or :premises (t82))
+(step t87 (cl (! (or @p_377 @p_365) :named @p_379) (! (not @p_377) :named @p_378)) :rule or_neg)
+(step t88 (cl (not @p_378) @p_70) :rule not_not)
+(step t89 (cl @p_379 @p_70) :rule th_resolution :premises (t88 t87))
+(step t90 (cl @p_379 @p_370) :rule or_neg)
+(step t91 (cl @p_379) :rule th_resolution :premises (t86 t85 t89 t90))
+(step t92 (cl @p_377 @p_365) :rule or :premises (t91))
+(step t93 (cl @p_365) :rule resolution :premises (t92 t26))
+(step t94 (cl (or @p_331 (! (not (! (= veriT_sk0 (! (fun_app$ uu$ veriT_sk2) :named @p_381)) :named @p_392)) :named @p_382))) :rule forall_inst :args ((:= veriT_vr46 veriT_sk2)))
+(step t95 (cl (or @p_193 (! (not (! (= z$ (! (abs_ExpList$ veriT_sk1) :named @p_380)) :named @p_389)) :named @p_383))) :rule forall_inst :args ((:= veriT_vr30 veriT_sk1)))
+(step t96 (cl (or (! (not @p_38) :named @p_384) (! (= @p_302 @p_380) :named @p_385))) :rule forall_inst :args ((:= veriT_vr3 veriT_sk1)))
+(step t97 (cl (or (! (not @p_23) :named @p_386) (! (= @p_369 @p_381) :named @p_387))) :rule forall_inst :args ((:= veriT_vr1 veriT_sk2)))
+(step t98 (cl @p_331 @p_382) :rule or :premises (t94))
+(step t99 (cl @p_193 @p_383) :rule or :premises (t95))
+(step t100 (cl @p_383) :rule resolution :premises (t99 t65))
+(step t101 (cl @p_384 @p_385) :rule or :premises (t96))
+(step t102 (cl @p_385) :rule resolution :premises (t101 t17))
+(step t103 (cl @p_386 @p_387) :rule or :premises (t97))
+(step t104 (cl @p_387) :rule resolution :premises (t103 t11))
+(step t105 (cl (! (= z$ z$) :named @p_388)) :rule eq_reflexive)
+(step t106 (cl (not @p_388) (! (not @p_300) :named @p_390) (! (not @p_385) :named @p_391) @p_389) :rule eq_transitive)
+(step t107 (cl @p_390 @p_391 @p_389) :rule th_resolution :premises (t106 t105))
+(step t108 (cl @p_390) :rule resolution :premises (t107 t100 t102))
+(step t109 (cl @p_370 (not @p_387) @p_392) :rule eq_transitive)
+(step t110 (cl @p_392) :rule resolution :premises (t109 t93 t104))
+(step t111 (cl @p_393) :rule resolution :premises (t77 t108 t81))
+(step t112 (cl @p_331) :rule resolution :premises (t98 t110))
+(step t113 (cl) :rule resolution :premises (t76 t111 t112))
+c24fc06f55d92aed7783d8234aedb7ced3e99be7 2 0
+(error "status is not unsat.")
+unknown
--- a/src/HOL/SMT_Examples/SMT_Examples_Verit.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/SMT_Examples/SMT_Examples_Verit.thy Fri Sep 02 13:41:55 2022 +0200
@@ -15,7 +15,7 @@
external_file \<open>SMT_Examples_Verit.certs\<close>
declare [[smt_certificates = "SMT_Examples_Verit.certs"]]
-declare [[smt_read_only_certificates = true]]
+declare [[smt_read_only_certificates = false]]
section \<open>Propositional and first-order logic\<close>
@@ -737,4 +737,82 @@
lemma "g (Some (3::int)) = g (Some True)" by (smt (verit) g1 g2 g3 list.size)
+experiment
+begin
+
+lemma duplicate_goal: \<open>A \<Longrightarrow> A \<Longrightarrow> A\<close>
+ by auto
+
+datatype 'a M_nres = is_fail: FAIL | SPEC "'a \<Rightarrow> bool"
+
+definition "is_res m x \<equiv> case m of FAIL \<Rightarrow> True | SPEC P \<Rightarrow> P x"
+
+datatype ('a,'s) M_state = M_STATE (run: "'s \<Rightarrow> ('a\<times>'s) M_nres")
+
+(*Courtesy of Peter Lammich
+https://isabelle.zulipchat.com/#narrow/stream/247541-Mirror.3A-Isabelle-Users-Mailing-List/topic/.5Bisabelle.5D.20smt.20.28verit.29.3A.20exception.20THM.200.20raised.20.28line.20312.20.2E.2E.2E/near/290088165
+*)
+lemma "\<lbrakk>\<forall>x y. (\<forall>xa s. is_fail (run (x xa) s) \<or>
+ is_fail (run (y xa) s) = is_fail (run (x xa) s) \<and>
+ (\<forall>a b. is_res (run (y xa) s) (a, b) = is_res (run (x xa) s) (a, b)))
+\<longrightarrow>
+ (\<forall>s. is_fail (run (B x) s) \<or>
+ is_fail (run (B y) s) = is_fail (run (B x) s) \<and>
+ (\<forall>a b. is_res (run (B y) s) (a, b) = is_res (run (B x) s) (a, b)));
+ \<And>y. \<forall>x ya. (\<forall>xa s. is_fail (run (x xa) s) \<or>
+ is_fail (run (ya xa) s) = is_fail (run (x xa) s) \<and>
+ (\<forall>a b. is_res (run (ya xa) s) (a, b) = is_res (run (x xa) s) (a, b)))
+\<longrightarrow>
+ (\<forall>s. is_fail (run (C y x) s) \<or>
+ is_fail (run (C y ya) s) = is_fail (run (C y x) s) \<and>
+ (\<forall>a b. is_res (run (C y ya) s) (a, b) = is_res (run (C y x) s) (a,
+b)))\<rbrakk>
+ \<Longrightarrow> \<forall>x y. (\<forall>xa s.
+ is_fail (run (x xa) s) \<or>
+ is_fail (run (y xa) s) = is_fail (run (x xa) s) \<and>
+ (\<forall>a b. is_res (run (y xa) s) (a, b) = is_res (run (x xa) s) (a, b)))
+\<longrightarrow>
+ (\<forall>s. is_fail (run (B x) s) \<or>
+ (\<exists>a b. is_res (run (B x) s) (a, b) \<and> is_fail (run (C a x) b)) \<or>
+ (is_fail (run (B y) s) \<or> (\<exists>a b. is_res (run (B y) s) (a, b) \<and>
+is_fail (run (C a y) b))) =
+ (is_fail (run (B x) s) \<or> (\<exists>a b. is_res (run (B x) s) (a, b) \<and>
+is_fail (run (C a x) b))) \<and>
+ (\<forall>a b. (is_fail (run (B y) s) \<or>
+ (\<exists>aa ba. is_res (run (B y) s) (aa, ba) \<and> is_res (run (C aa y)
+ba) (a, b))) =
+ (is_fail (run (B x) s) \<or>
+ (\<exists>aa ba. is_res (run (B x) s) (aa, ba) \<and> is_res (run (C aa x)
+ba) (a, b)))))"
+ apply (rule duplicate_goal)
+ subgoal
+ supply [[verit_compress_proofs=true]]
+ by (smt (verit))
+ subgoal
+ supply [[verit_compress_proofs=false]]
+ by (smt (verit))
+ done
+
+(*Example of Reordering in skolemization*)
+lemma
+ fixes Abs_ExpList :: "'freeExp_list \<Rightarrow> 'exp_list" and
+ Abs_Exp:: "'freeExp_set \<Rightarrow> 'exp" and
+ exprel:: "('freeExp \<times> 'freeExp) set" and
+ map2 :: "('freeExp \<Rightarrow> 'exp) \<Rightarrow> 'freeExp_list \<Rightarrow> 'exp_list"
+ assumes "\<And>Xs. Abs_ExpList Xs \<equiv> map2 (\<lambda>U. Abs_Exp (myImage exprel {U})) Xs"
+ "\<And>P z. (\<And>U. z = Abs_Exp (myImage exprel {U}) \<Longrightarrow> P) \<Longrightarrow> P"
+ "\<And>(ys::'exp_list) (f::'freeExp \<Rightarrow> _). (\<exists>xs. ys = map2 f xs) = (\<forall>y\<in>myset ys. \<exists>x. y = f x)"
+ shows "\<exists>Us. z = Abs_ExpList Us"
+ apply (rule duplicate_goal)
+ subgoal
+ supply [[verit_compress_proofs=true]]
+ using assms
+ by (smt (verit,del_insts))
+ subgoal
+ using assms
+ supply [[verit_compress_proofs=false]]
+ by (smt (verit,del_insts))
+ done
+
+end
end
\ No newline at end of file
--- a/src/HOL/Set_Interval.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Set_Interval.thy Fri Sep 02 13:41:55 2022 +0200
@@ -464,11 +464,16 @@
lemma (in linorder) atLeastLessThan_subset_iff:
"{a..<b} \<subseteq> {c..<d} \<Longrightarrow> b \<le> a \<or> c\<le>a \<and> b\<le>d"
- apply (auto simp:subset_eq Ball_def not_le)
- apply(frule_tac x=a in spec)
- apply(erule_tac x=d in allE)
- apply auto
- done
+proof (cases "a < b")
+ case True
+ assume assm: "{a..<b} \<subseteq> {c..<d}"
+ then have 1: "c \<le> a \<and> a \<le> d"
+ using True by (auto simp add: subset_eq Ball_def)
+ then have 2: "b \<le> d"
+ using assm by (auto simp add: subset_eq)
+ from 1 2 show ?thesis
+ by simp
+qed (auto)
lemma atLeastLessThan_inj:
fixes a b c d :: "'a::linorder"
@@ -941,7 +946,7 @@
next
fix y assume "y \<le> -x"
have "- (-y) \<in> uminus ` {x..}"
- by (rule imageI) (insert \<open>y \<le> -x\<close>[THEN le_imp_neg_le], simp)
+ by (rule imageI) (use \<open>y \<le> -x\<close>[THEN le_imp_neg_le] in \<open>simp\<close>)
thus "y \<in> uminus ` {x..}" by simp
qed simp_all
@@ -991,9 +996,17 @@
lemma image_diff_atLeastAtMost [simp]:
fixes d::"'a::linordered_idom" shows "((-) d ` {a..b}) = {d-b..d-a}"
- apply auto
- apply (rule_tac x="d-x" in rev_image_eqI, auto)
- done
+proof
+ show "{d - b..d - a} \<subseteq> (-) d ` {a..b}"
+ proof
+ fix x
+ assume "x \<in> {d - b..d - a}"
+ then have "d - x \<in> {a..b}" and "x = d - (d - x)"
+ by auto
+ then show "x \<in> (-) d ` {a..b}"
+ by (rule rev_image_eqI)
+ qed
+qed(auto)
lemma image_diff_atLeastLessThan [simp]:
fixes a b c::"'a::linordered_idom"
@@ -1144,10 +1157,7 @@
lemma image_add_int_atLeastLessThan:
"(\<lambda>x. x + (l::int)) ` {0..<u-l} = {l..<u}"
- apply (auto simp add: image_def)
- apply (rule_tac x = "x - l" in bexI)
- apply auto
- done
+ by safe auto
lemma image_minus_const_atLeastLessThan_nat:
fixes c :: nat
@@ -1218,8 +1228,9 @@
by (blast dest:less_imp_le_nat le_imp_less_Suc)
lemma finite_less_ub:
- "!!f::nat=>nat. (!!n. n \<le> f n) ==> finite {n. f n \<le> u}"
-by (rule_tac B="{..u}" in finite_subset, auto intro: order_trans)
+ "\<And>f::nat\<Rightarrow>nat. (!!n. n \<le> f n) \<Longrightarrow> finite {n. f n \<le> u}"
+ by (rule finite_subset[of _ "{..u}"])
+ (auto intro: order_trans)
lemma bounded_Max_nat:
fixes P :: "nat \<Rightarrow> bool"
@@ -1315,7 +1326,7 @@
lemma UN_finite2_subset:
assumes "\<And>n::nat. (\<Union>i\<in>{0..<n}. A i) \<subseteq> (\<Union>i\<in>{0..<n + k}. B i)"
shows "(\<Union>n. A n) \<subseteq> (\<Union>n. B n)"
-proof (rule UN_finite_subset, rule)
+proof (rule UN_finite_subset, rule subsetI)
fix n and a
from assms have "(\<Union>i\<in>{0..<n}. A i) \<subseteq> (\<Union>i\<in>{0..<n + k}. B i)" .
moreover assume "a \<in> (\<Union>i\<in>{0..<n}. A i)"
@@ -1324,12 +1335,17 @@
qed
lemma UN_finite2_eq:
- "(\<And>n::nat. (\<Union>i\<in>{0..<n}. A i) = (\<Union>i\<in>{0..<n + k}. B i)) \<Longrightarrow>
- (\<Union>n. A n) = (\<Union>n. B n)"
- apply (rule subset_antisym [OF UN_finite_subset UN_finite2_subset])
- apply auto
- apply (force simp add: atLeastLessThan_add_Un [of 0])+
- done
+ assumes "(\<And>n::nat. (\<Union>i\<in>{0..<n}. A i) = (\<Union>i\<in>{0..<n + k}. B i))"
+ shows "(\<Union>n. A n) = (\<Union>n. B n)"
+proof (rule subset_antisym [OF UN_finite_subset UN_finite2_subset])
+ fix n
+ show "\<Union> (A ` {0..<n}) \<subseteq> (\<Union>n. B n)"
+ using assms by auto
+next
+ fix n
+ show "\<Union> (B ` {0..<n}) \<subseteq> \<Union> (A ` {0..<n + k})"
+ using assms by (force simp add: atLeastLessThan_add_Un [of 0])+
+qed
subsubsection \<open>Cardinality\<close>
@@ -1342,11 +1358,21 @@
lemma card_atLeastLessThan [simp]: "card {l..<u} = u - l"
proof -
- have "{l..<u} = (\<lambda>x. x + l) ` {..<u-l}"
- apply (auto simp add: image_def atLeastLessThan_def lessThan_def)
- apply (rule_tac x = "x - l" in exI)
- apply arith
- done
+ have "(\<lambda>x. x + l) ` {..<u - l} \<subseteq> {l..<u}"
+ by auto
+ moreover have "{l..<u} \<subseteq> (\<lambda>x. x + l) ` {..<u-l}"
+ proof
+ fix x
+ assume *: "x \<in> {l..<u}"
+ then have "x - l \<in> {..< u -l}"
+ by auto
+ then have "(x - l) + l \<in> (\<lambda>x. x + l) ` {..< u -l}"
+ by auto
+ then show "x \<in> (\<lambda>x. x + l) ` {..<u - l}"
+ using * by auto
+ qed
+ ultimately have "{l..<u} = (\<lambda>x. x + l) ` {..<u-l}"
+ by auto
then have "card {l..<u} = card {..<u-l}"
by (simp add: card_image inj_on_def)
then show ?thesis
@@ -1430,7 +1456,8 @@
let ?f = "\<lambda>a. SOME b. ?P a b"
have 1: "?f ` A \<subseteq> B" by (auto intro: someI2_ex[OF assms(2)])
have "inj_on ?f A"
- proof (auto simp: inj_on_def)
+ unfolding inj_on_def
+ proof safe
fix a1 a2 assume asms: "a1 \<in> A" "a2 \<in> A" "?f a1 = ?f a2"
have 0: "?f a1 \<in> B" using "1" \<open>a1 \<in> A\<close> by blast
have 1: "r a1 (?f a1)" using someI_ex[OF assms(2)[OF \<open>a1 \<in> A\<close>]] by blast
@@ -1475,13 +1502,24 @@
subsubsection \<open>Finiteness\<close>
-lemma image_atLeastZeroLessThan_int: "0 \<le> u ==>
- {(0::int)..<u} = int ` {..<nat u}"
+lemma image_atLeastZeroLessThan_int:
+ assumes "0 \<le> u"
+ shows "{(0::int)..<u} = int ` {..<nat u}"
unfolding image_def lessThan_def
- apply auto
- apply (rule_tac x = "nat x" in exI)
- apply (auto simp add: zless_nat_eq_int_zless [THEN sym])
- done
+proof
+ show "{0..<u} \<subseteq> {y. \<exists>x\<in>{x. x < nat u}. y = int x}"
+ proof
+ fix x
+ assume "x \<in> {0..<u}"
+ then have "x = int (nat x)" and "nat x < nat u"
+ by (auto simp add: zless_nat_eq_int_zless [THEN sym])
+ then have "\<exists>xa<nat u. x = int xa"
+ using exI[of _ "(nat x)"] by simp
+ then show "x \<in> {y. \<exists>x\<in>{x. x < nat u}. y = int x}"
+ by simp
+ qed
+qed (auto)
+
lemma finite_atLeastZeroLessThan_int: "finite {(0::int)..<u}"
proof (cases "0 \<le> u")
@@ -1695,27 +1733,8 @@
lemma ivl_subset [simp]: "({i..<j} \<subseteq> {m..<n}) = (j \<le> i \<or> m \<le> i \<and> j \<le> (n::'a::linorder))"
using linorder_class.le_less_linear[of i n]
- apply (auto simp: linorder_not_le)
- apply (force intro: leI)+
- done
-
-lemma obtain_subset_with_card_n:
- assumes "n \<le> card S"
- obtains T where "T \<subseteq> S" "card T = n" "finite T"
-proof -
- obtain n' where "card S = n + n'"
- by (metis assms le_add_diff_inverse)
- with that show thesis
- proof (induct n' arbitrary: S)
- case 0
- then show ?case
- by (cases "finite S") auto
- next
- case Suc
- then show ?case
- by (simp add: card_Suc_eq) (metis subset_insertI2)
- qed
-qed
+ by safe (force intro: leI)+
+
subsection \<open>Generic big monoid operation over intervals\<close>
@@ -1724,7 +1743,7 @@
lemma inj_on_of_nat [simp]:
"inj_on of_nat N"
- by rule simp
+ by (rule inj_onI) simp
lemma bij_betw_of_nat [simp]:
"bij_betw of_nat N A \<longleftrightarrow> of_nat ` N = A"
@@ -2327,8 +2346,24 @@
(if n < m then 0
else if x = 1 then of_nat((n + 1) - m)
else (x^m - x^Suc n) / (1 - x))"
-using sum_gp_multiplied [of m n x] apply auto
-by (metis eq_iff_diff_eq_0 mult.commute nonzero_divide_eq_eq)
+proof (cases "n < m")
+ case False
+ assume *: "\<not> n < m"
+ then show ?thesis
+ proof (cases "x = 1")
+ case False
+ assume "x \<noteq> 1"
+ then have not_zero: "1 - x \<noteq> 0"
+ by auto
+ have "(1 - x) * (\<Sum>i=m..n. x^i) = x ^ m - x * x ^ n"
+ using sum_gp_multiplied [of m n x] * by auto
+ then have "(\<Sum>i=m..n. x^i) = (x ^ m - x * x ^ n) / (1 - x) "
+ using nonzero_divide_eq_eq mult.commute not_zero
+ by metis
+ then show ?thesis
+ by auto
+ qed (auto)
+qed (auto)
subsubsection\<open>Geometric progressions\<close>
--- a/src/HOL/String.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/String.thy Fri Sep 02 13:41:55 2022 +0200
@@ -46,6 +46,10 @@
\<open>of_int (of_char c) = of_char c\<close>
by (cases c) simp
+lemma nat_of_char [simp]:
+ \<open>nat (of_char c) = of_char c\<close>
+ by (cases c) (simp only: of_char_Char nat_horner_sum)
+
context unique_euclidean_semiring_with_bit_operations
begin
@@ -711,8 +715,8 @@
end
-code_reserved SML string String Char List
-code_reserved OCaml string String Char List
+code_reserved SML string String Char Str_Literal
+code_reserved OCaml string String Char Str_Literal
code_reserved Haskell Prelude
code_reserved Scala string
@@ -737,26 +741,72 @@
\<close>
code_printing
- constant "(+) :: String.literal \<Rightarrow> String.literal \<Rightarrow> String.literal" \<rightharpoonup>
+ code_module "Str_Literal" \<rightharpoonup>
+ (SML) \<open>structure Str_Literal =
+struct
+
+fun map f [] = []
+ | map f (x :: xs) = f x :: map f xs; (* deliberate clone not relying on List._ module *)
+
+fun check_ascii (k : IntInf.int) =
+ if 0 <= k andalso k < 128
+ then k
+ else raise Fail "Non-ASCII character in literal";
+
+val char_of_ascii = Char.chr o IntInf.toInt o check_ascii;
+
+val ascii_of_char = check_ascii o IntInf.fromInt o Char.ord;
+
+val literal_of_asciis = String.implode o map char_of_ascii;
+
+val asciis_of_literal = map ascii_of_char o String.explode;
+
+end;\<close> for constant String.literal_of_asciis String.asciis_of_literal
+ and (OCaml) \<open>module Str_Literal =
+struct
+
+let implode f xs =
+ let rec length xs = match xs with
+ [] -> 0
+ | x :: xs -> 1 + length xs in
+ let rec nth xs n = match xs with
+ (x :: xs) -> if n <= 0 then x else nth xs (n - 1)
+ in String.init (length xs) (fun n -> f (nth xs n));;
+
+let explode f s =
+ let rec map_range f n =
+ if n <= 0 then [] else map_range f (n - 1) @ [f n]
+ in map_range (fun n -> f (String.get s n)) (String.length s);;
+
+let z_128 = Z.of_int 128;;
+
+let check_ascii (k : Z.t) =
+ if Z.leq Z.zero k && Z.lt k z_128
+ then k
+ else failwith "Non-ASCII character in literal";;
+
+let char_of_ascii k = Char.chr (Z.to_int (check_ascii k));;
+
+let ascii_of_char c = check_ascii (Z.of_int (Char.code c));;
+
+let literal_of_asciis ks = implode char_of_ascii ks;;
+
+let asciis_of_literal s = explode ascii_of_char s;;
+
+end;;\<close> for constant String.literal_of_asciis String.asciis_of_literal
+| constant "(+) :: String.literal \<Rightarrow> String.literal \<Rightarrow> String.literal" \<rightharpoonup>
(SML) infixl 18 "^"
and (OCaml) infixr 6 "^"
and (Haskell) infixr 5 "++"
and (Scala) infixl 7 "+"
| constant String.literal_of_asciis \<rightharpoonup>
- (SML) "!(String.implode/ o List.map (fn k => if 0 <= k andalso k < 128 then (Char.chr o IntInf.toInt) k else raise Fail \"Non-ASCII character in literal\"))"
- and (OCaml) "!(let xs = _
- and chr k =
- let l = Z.to'_int k
- in if 0 <= l && l < 128
- then Char.chr l
- else failwith \"Non-ASCII character in literal\"
- in String.init (List.length xs) (List.nth (List.map chr xs)))"
+ (SML) "Str'_Literal.literal'_of'_asciis"
+ and (OCaml) "Str'_Literal.literal'_of'_asciis"
and (Haskell) "map/ (let chr k | (0 <= k && k < 128) = Prelude.toEnum k :: Prelude.Char in chr . Prelude.fromInteger)"
and (Scala) "\"\"/ ++/ _.map((k: BigInt) => if (BigInt(0) <= k && k < BigInt(128)) k.charValue else sys.error(\"Non-ASCII character in literal\"))"
| constant String.asciis_of_literal \<rightharpoonup>
- (SML) "!(List.map (fn c => let val k = Char.ord c in if k < 128 then IntInf.fromInt k else raise Fail \"Non-ASCII character in literal\" end)/ o String.explode)"
- and (OCaml) "!(let s = _ in let rec exp i l = if i < 0 then l else exp (i - 1) (let k = Char.code (String.get s i) in
- if k < 128 then Z.of'_int k :: l else failwith \"Non-ASCII character in literal\") in exp (String.length s - 1) [])"
+ (SML) "Str'_Literal.asciis'_of'_literal"
+ and (OCaml) "Str'_Literal.asciis'_of'_literal"
and (Haskell) "map/ (let ord k | (k < 128) = Prelude.toInteger k in ord . (Prelude.fromEnum :: Prelude.Char -> Prelude.Int))"
and (Scala) "!(_.toList.map(c => { val k: Int = c.toInt; if (k < 128) BigInt(k) else sys.error(\"Non-ASCII character in literal\") }))"
| class_instance String.literal :: equal \<rightharpoonup>
--- a/src/HOL/TLA/README.html Sat Jun 25 13:34:41 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
-<HTML>
-
-<HEAD>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <TITLE>HOL/TLA</TITLE>
-</HEAD>
-
-<BODY>
-
-<H2>TLA: Lamport's Temporal Logic of Actions</H2>
-
-<A HREF="http://www.research.digital.com/SRC/personal/Leslie_Lamport/tla/tla.html">TLA</A>
-is a linear-time temporal logic introduced by Leslie Lamport in
-<EM>The Temporal Logic of Actions</EM> (ACM TOPLAS 16(3), 1994,
-872-923). Unlike other temporal logics, both systems and properties
-are represented as logical formulas, and logical connectives such as
-implication, conjunction, and existential quantification represent
-structural relations such as refinement, parallel composition, and
-hiding. TLA has been applied to numerous case studies.
-
-<P>This directory formalizes TLA in Isabelle/HOL, as follows:
-<UL>
-<LI>Theory <A HREF="Intensional.html">Intensional</A> prepares the
- ground by introducing basic syntax for "lifted", possibl-world based
- logics.
-<LI>Theories <A HREF="Stfun.html">Stfun</A> and
- <A HREF="Action.html">Action</A> represent the state and transition
- level formulas of TLA, evaluated over single states and pairs of
- states.
-<LI>Theory <A HREF="Init.html">Init</A> introduces temporal logic
- and defines conversion functions from nontemporal to temporal
- formulas.
-<LI>Theory <A HREF="TLA.html">TLA</A> axiomatizes proper temporal
- logic.
-</UL>
-
-Please consult the
-<A HREF="http://www.pst.informatik.uni-muenchen.de/~merz/isabelle/IsaTLADesign.ps">design notes</A>
-for further information regarding the setup and use of this encoding
-of TLA.
-
-<P>
-The theories are accompanied by a small number of examples:
-<UL>
-<LI><A HREF="Inc/index.html">Inc</A>: Lamport's <EM>increment</EM>
- example, a standard TLA benchmark, illustrates an elementary TLA
- proof.
-<LI><A HREF="Buffer/index.html">Buffer</A>: a proof that two buffers
- in a row implement a single buffer, uses a simple refinement
- mapping.
-<LI><A HREF="Memory/index.html">Memory</A>: a verification of (the
- untimed part of) Broy and Lamport's <em>RPC-Memory</em> case study,
- more fully explained in LNCS 1169 (the
- <A HREF="http://www.pst.informatik.uni-muenchen.de/~merz/papers/RPCMemory.html">TLA
- solution</A> is available separately).
-</UL>
-
-<HR>
-
-<ADDRESS>
-<A HREF="mailto:merz@informatik.uni-muenchen.de">Stephan Merz</A>
-</ADDRESS>
-<!-- hhmts start -->
-Last modified: Sat Mar 5 00:54:49 CET 2005
-<!-- hhmts end -->
-</BODY></HTML>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/TLA/README.thy Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,48 @@
+theory README imports Main
+begin
+
+section \<open>TLA: Lamport's Temporal Logic of Actions\<close>
+
+text \<open>
+ TLA \<^url>\<open>http://www.research.digital.com/SRC/personal/Leslie_Lamport/tla/tla.html\<close>
+ is a linear-time temporal logic introduced by Leslie Lamport in \<^emph>\<open>The
+ Temporal Logic of Actions\<close> (ACM TOPLAS 16(3), 1994, 872-923). Unlike other
+ temporal logics, both systems and properties are represented as logical
+ formulas, and logical connectives such as implication, conjunction, and
+ existential quantification represent structural relations such as
+ refinement, parallel composition, and hiding. TLA has been applied to
+ numerous case studies.
+
+ This directory formalizes TLA in Isabelle/HOL, as follows:
+
+ \<^item> \<^file>\<open>Intensional.thy\<close> prepares the ground by introducing basic syntax for
+ "lifted", possible-world based logics.
+
+ \<^item> \<^file>\<open>Stfun.thy\<close> and \<^file>\<open>Action.thy\<close> represent the state and transition
+ level formulas of TLA, evaluated over single states and pairs of states.
+
+ \<^item> \<^file>\<open>Init.thy\<close> introduces temporal logic and defines conversion functions
+ from nontemporal to temporal formulas.
+
+ \<^item> \<^file>\<open>TLA.thy\<close> axiomatizes proper temporal logic.
+
+
+ Please consult the \<^emph>\<open>design notes\<close>
+ \<^url>\<open>http://www.pst.informatik.uni-muenchen.de/~merz/isabelle/IsaTLADesign.ps\<close>
+ for further information regarding the setup and use of this encoding of TLA.
+
+ The theories are accompanied by a small number of examples:
+
+ \<^item> \<^dir>\<open>Inc\<close>: Lamport's \<^emph>\<open>increment\<close> example, a standard TLA benchmark,
+ illustrates an elementary TLA proof.
+
+ \<^item> \<^dir>\<open>Buffer\<close>: a proof that two buffers in a row implement a single buffer,
+ uses a simple refinement mapping.
+
+ \<^item> \<^dir>\<open>Memory\<close>: a verification of (the untimed part of) Broy and Lamport's
+ \<^emph>\<open>RPC-Memory\<close> case study, more fully explained in LNCS 1169 (the \<^emph>\<open>TLA
+ solution\<close> is available separately from
+ \<^url>\<open>http://www.pst.informatik.uni-muenchen.de/~merz/papers/RPCMemory.html\<close>).
+\<close>
+
+end
--- a/src/HOL/Tools/Mirabelle/mirabelle.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/Mirabelle/mirabelle.scala Fri Sep 02 13:41:55 2022 +0200
@@ -17,7 +17,7 @@
(for {
file <-
File.find_files(Path.explode("~~/src/HOL/Tools/Mirabelle").file,
- pred = _.getName.endsWith(".ML"))
+ pred = file => File.is_ML(file.getName))
line <- split_lines(File.read(file))
name <- line match { case Pattern(a) => Some(a) case _ => None }
} yield name).sorted
--- a/src/HOL/Tools/Nitpick/kodkod_sat.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/Nitpick/kodkod_sat.ML Fri Sep 02 13:41:55 2022 +0200
@@ -30,11 +30,8 @@
val berkmin_exec = getenv "BERKMIN_EXE"
val static_list =
- [("Lingeling_JNI", Internal (JNI, Batch, ["Lingeling"])),
- ("CryptoMiniSat", External ("CRYPTOMINISAT_HOME", "cryptominisat", [])),
- ("CryptoMiniSat_JNI", Internal (JNI, Batch, ["CryptoMiniSat"])),
+ [("CryptoMiniSat", External ("CRYPTOMINISAT_HOME", "cryptominisat", [])),
("MiniSat", ExternalV2 (ToFile, "MINISAT_HOME", "minisat", [], "SAT", "", "UNSAT")),
- ("MiniSat_JNI", Internal (JNI, Incremental, ["MiniSat"])),
("zChaff", ExternalV2 (ToStdout, "ZCHAFF_HOME", "zchaff", [],
"Instance Satisfiable", "",
"Instance Unsatisfiable")),
@@ -47,7 +44,10 @@
"solution =", "UNSATISFIABLE !!")),
("BerkMin_Alloy", External ("BERKMINALLOY_HOME", "berkmin", [])),
("SAT4J", Internal (Java, Incremental, ["DefaultSAT4J"])),
- ("SAT4J_Light", Internal (Java, Incremental, ["LightSAT4J"]))]
+ ("SAT4J_Light", Internal (Java, Incremental, ["LightSAT4J"])),
+ ("Lingeling_JNI", Internal (JNI, Batch, ["Lingeling"])),
+ ("CryptoMiniSat_JNI", Internal (JNI, Batch, ["CryptoMiniSat"])),
+ ("MiniSat_JNI", Internal (JNI, Incremental, ["MiniSat"]))]
fun dynamic_entry_for_external name dev home exec args markers =
let
--- a/src/HOL/Tools/SMT/cvc4_interface.ML Sat Jun 25 13:34:41 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-(* Title: HOL/Tools/SMT/cvc4_interface.ML
- Author: Jasmin Blanchette, TU Muenchen
-
-Interface to CVC4 based on an extended version of SMT-LIB.
-*)
-
-signature CVC4_INTERFACE =
-sig
- val smtlib_cvc4C: SMT_Util.class
- val hosmtlib_cvc4C: SMT_Util.class
-end;
-
-structure CVC4_Interface: CVC4_INTERFACE =
-struct
-
-val cvc4C = ["cvc4"]
-val smtlib_cvc4C = SMTLIB_Interface.smtlibC @ cvc4C
-val hosmtlib_cvc4C = SMTLIB_Interface.hosmtlibC @ cvc4C
-
-
-(* interface *)
-
-local
- fun translate_config order ctxt =
- {order = order,
- logic = K (K "(set-logic ALL_SUPPORTED)\n"),
- fp_kinds = [BNF_Util.Least_FP, BNF_Util.Greatest_FP],
- serialize = #serialize (SMTLIB_Interface.translate_config order ctxt)}
-in
-
-val _ = Theory.setup (Context.theory_map
- (SMT_Translate.add_config (smtlib_cvc4C, translate_config SMT_Util.First_Order) #>
- SMT_Translate.add_config (hosmtlib_cvc4C, translate_config SMT_Util.Higher_Order)))
-
-end
-
-end;
--- a/src/HOL/Tools/SMT/cvc4_proof_parse.ML Sat Jun 25 13:34:41 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-(* Title: HOL/Tools/SMT/cvc4_proof_parse.ML
- Author: Jasmin Blanchette, TU Muenchen
-
-CVC4 proof (actually, unsat core) parsing.
-*)
-
-signature CVC4_PROOF_PARSE =
-sig
- val parse_proof: SMT_Translate.replay_data ->
- ((string * ATP_Problem_Generate.stature) * thm) list -> term list -> term -> string list ->
- SMT_Solver.parsed_proof
-end;
-
-structure CVC4_Proof_Parse: CVC4_PROOF_PARSE =
-struct
-
-fun parse_proof ({ll_defs, assms, ...} : SMT_Translate.replay_data) xfacts prems _ output =
- if exists (String.isPrefix "(error \"This build of CVC4 doesn't have proof support") output then
- {outcome = NONE, fact_ids = NONE, atp_proof = K []}
- else
- let
- val num_ll_defs = length ll_defs
-
- val id_of_index = Integer.add num_ll_defs
- val index_of_id = Integer.add (~ num_ll_defs)
-
- val used_assert_ids =
- map_filter (try (snd o SMTLIB_Interface.role_and_index_of_assert_name)) output
- val used_assm_js =
- map_filter (fn id => let val i = index_of_id id in if i >= 0 then SOME i else NONE end)
- used_assert_ids
-
- val conjecture_i = 0
- val prems_i = conjecture_i + 1
- val num_prems = length prems
- val facts_i = prems_i + num_prems
-
- val fact_ids' =
- map_filter (fn j =>
- let val ((i, _), _) = nth assms j in
- try (apsnd (nth xfacts)) (id_of_index j, i - facts_i)
- end) used_assm_js
- in
- {outcome = NONE, fact_ids = SOME fact_ids', atp_proof = K []}
- end
-
-end;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/Tools/SMT/cvc_interface.ML Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,37 @@
+(* Title: HOL/Tools/SMT/cvc_interface.ML
+ Author: Jasmin Blanchette, TU Muenchen
+
+Interface to CVC4 and cvc5 based on an extended version of SMT-LIB.
+*)
+
+signature CVC_INTERFACE =
+sig
+ val smtlib_cvcC: SMT_Util.class
+ val hosmtlib_cvcC: SMT_Util.class
+end;
+
+structure CVC_Interface: CVC_INTERFACE =
+struct
+
+val cvcC = ["cvc"]
+val smtlib_cvcC = SMTLIB_Interface.smtlibC @ cvcC
+val hosmtlib_cvcC = SMTLIB_Interface.hosmtlibC @ cvcC
+
+
+(* interface *)
+
+local
+ fun translate_config order ctxt =
+ {order = order,
+ logic = K (K "(set-logic ALL_SUPPORTED)\n"),
+ fp_kinds = [BNF_Util.Least_FP, BNF_Util.Greatest_FP],
+ serialize = #serialize (SMTLIB_Interface.translate_config order ctxt)}
+in
+
+val _ = Theory.setup (Context.theory_map
+ (SMT_Translate.add_config (smtlib_cvcC, translate_config SMT_Util.First_Order) #>
+ SMT_Translate.add_config (hosmtlib_cvcC, translate_config SMT_Util.Higher_Order)))
+
+end
+
+end;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/Tools/SMT/cvc_proof_parse.ML Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,47 @@
+(* Title: HOL/Tools/SMT/cvc_proof_parse.ML
+ Author: Jasmin Blanchette, TU Muenchen
+
+CVC4 and cvc5 proof (actually, unsat core) parsing.
+*)
+
+signature CVC_PROOF_PARSE =
+sig
+ val parse_proof: SMT_Translate.replay_data ->
+ ((string * ATP_Problem_Generate.stature) * thm) list -> term list -> term -> string list ->
+ SMT_Solver.parsed_proof
+end;
+
+structure CVC_Proof_Parse: CVC_PROOF_PARSE =
+struct
+
+fun parse_proof ({ll_defs, assms, ...} : SMT_Translate.replay_data) xfacts prems _ output =
+ if exists (String.isPrefix "(error \"This build of CVC4 doesn't have proof support") output then
+ {outcome = NONE, fact_ids = NONE, atp_proof = K []}
+ else
+ let
+ val num_ll_defs = length ll_defs
+
+ val id_of_index = Integer.add num_ll_defs
+ val index_of_id = Integer.add (~ num_ll_defs)
+
+ val used_assert_ids =
+ map_filter (try (snd o SMTLIB_Interface.role_and_index_of_assert_name)) output
+ val used_assm_js =
+ map_filter (fn id => let val i = index_of_id id in if i >= 0 then SOME i else NONE end)
+ used_assert_ids
+
+ val conjecture_i = 0
+ val prems_i = conjecture_i + 1
+ val num_prems = length prems
+ val facts_i = prems_i + num_prems
+
+ val fact_ids' =
+ map_filter (fn j =>
+ let val ((i, _), _) = nth assms j in
+ try (apsnd (nth xfacts)) (id_of_index j, i - facts_i)
+ end) used_assm_js
+ in
+ {outcome = NONE, fact_ids = SOME fact_ids', atp_proof = K []}
+ end
+
+end;
--- a/src/HOL/Tools/SMT/lethe_proof.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/SMT/lethe_proof.ML Fri Sep 02 13:41:55 2022 +0200
@@ -48,6 +48,7 @@
val simp_arith_rule : string
val lethe_deep_skolemize_rule : string
val lethe_def : string
+ val is_lethe_def : string -> bool
val subproof_rule : string
val local_input_rule : string
val not_not_rule : string
@@ -145,6 +146,7 @@
val th_resolution_rule = "th_resolution"
val and_pos_rule = "and_pos"
+val is_lethe_def = String.isSuffix lethe_def
val skolemization_steps = ["sko_forall", "sko_ex"]
val is_skolemization = member (op =) skolemization_steps
val keep_app_symbols = member (op =) [eq_congruent_pred_rule, eq_congruent_rule, ite_intro_rule, and_pos_rule]
@@ -546,10 +548,9 @@
(* fix step *)
val _ = if bounds <> [] then raise (Fail "found dangling variable in concl") else ()
-
val skolem_defs = (if is_skolemization rule
then map (fn id => id ^ lethe_def) (skolems_introduced_by_rule (SMTLIB.S (map fst args))) else [])
- val skolems_of_subproof = (if is_skolemization rule
+ val skolems_of_subproof = (if compress andalso is_skolemization rule
then flat (map collect_skolem_defs subproof) else [])
val fixed_prems =
prems @ (if is_assm_repetition id rule then [id] else []) @
--- a/src/HOL/Tools/SMT/lethe_replay_methods.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/SMT/lethe_replay_methods.ML Fri Sep 02 13:41:55 2022 +0200
@@ -404,6 +404,14 @@
#> extract_all_exists_quantified_names_q
+fun extract_all_forall_exists_quantified_names_q (Const(\<^const_name>\<open>HOL.Ex\<close>, _) $ Abs (name, _, t)) =
+ name :: (extract_all_forall_exists_quantified_names_q t)
+ | extract_all_forall_exists_quantified_names_q (Const(\<^const_name>\<open>HOL.All\<close>, _) $ Abs (name, _, t)) =
+ name :: (extract_all_forall_exists_quantified_names_q t)
+ | extract_all_forall_exists_quantified_names_q (t $ u) =
+ extract_all_forall_exists_quantified_names_q t @ extract_all_forall_exists_quantified_names_q u
+ | extract_all_forall_exists_quantified_names_q _ = []
+
val extract_bind_names =
HOLogic.dest_eq
#> apply2 (fn (Free (name, _)) => name)
@@ -482,7 +490,8 @@
in
(Method.insert_tac ctxt [inst_thm]
THEN' TRY' (fn i => assume_tac ctxt i)
- THEN' TRY' (partial_simplify_tac ctxt @{thms eq_commute})) i
+ THEN' TRY' (partial_simplify_tac ctxt @{thms eq_commute ac_simps})
+ THEN' TRY' (blast_tac ctxt)) i
end
| instantiate_and_solve _ ({context = ctxt, prems = thms, ...}: Subgoal.focus) =
replay_error ctxt "invalid application" Forall_Inst thms t
@@ -510,7 +519,12 @@
resolve_tac ctxt implies_pos_thm)
(* Skolemization *)
-
+local
+ fun split _ [] = ([], [])
+ | split f (a :: xs) =
+ split f xs
+ |> (if f a then apfst (curry (op ::) a) else apsnd (curry (op ::) a))
+in
fun extract_rewrite_rule_assumption _ thms =
let
fun is_rewrite_rule thm =
@@ -521,23 +535,34 @@
(case Thm.prop_of thm of
\<^term>\<open>Trueprop\<close> $ (Const(\<^const_name>\<open>HOL.eq\<close>, _) $ Free(_, _) $ Free(_, _)) => true
| _ => false)
- val ctxt_eq =
+ val (ctxt_eq, other) =
thms
- |> filter is_context_rule
- val rew =
- thms
- |> filter_out is_context_rule
- |> filter is_rewrite_rule
+ |> split is_context_rule
+ val (rew, other) =
+ other
+ |> split is_rewrite_rule
in
- (ctxt_eq, rew)
+ (ctxt_eq, rew, other)
end
+end
+(*
+Without compression, we have to rewrite skolems only once. However, it can happen than the same
+skolem constant is used multiple times with a different name under the forall.
+For strictness, we use the multiple rewriting only when compressing is activated.
+*)
local
- fun rewrite_all_skolems thm_indirect ctxt (SOME thm :: thms) =
- EqSubst.eqsubst_tac ctxt [0] [thm_indirect OF [thm]]
- THEN' (partial_simplify_tac ctxt (@{thms eq_commute}))
- THEN' rewrite_all_skolems thm_indirect ctxt thms
- | rewrite_all_skolems thm_indirect ctxt (NONE :: thms) = rewrite_all_skolems thm_indirect ctxt thms
+ fun rewrite_all_skolems thm_indirect ctxt ((v,SOME thm) :: thms) =
+ let
+ val rewrite_sk_thms =
+ List.mapPartial (fn tm => SOME (tm OF [thm]) handle THM _ => NONE) thm_indirect
+ val multiple_rew = if SMT_Config.compress_verit_proofs ctxt then REPEAT_CHANGED else fn x => x
+ in
+ multiple_rew (EqSubst.eqsubst_tac ctxt [0] rewrite_sk_thms
+ THEN' SOLVED' (K (HEADGOAL (partial_simplify_tac ctxt (@{thms eq_commute})))))
+ THEN' rewrite_all_skolems thm_indirect ctxt thms
+ end
+ | rewrite_all_skolems thm_indirect ctxt ((_,NONE) :: thms) = rewrite_all_skolems thm_indirect ctxt thms
| rewrite_all_skolems _ _ [] = K (all_tac)
fun extract_var_name (thm :: thms) =
@@ -552,30 +577,31 @@
fun skolem_tac extractor thm1 thm2 ctxt thms t =
let
- val (ctxt_eq, ts) = extract_rewrite_rule_assumption ctxt thms
+ val (ctxt_eq, ts, other) = extract_rewrite_rule_assumption ctxt thms
+
fun ordered_definitions () =
let
val var_order = extractor t
val thm_names_with_var = extract_var_name ts |> flat
- in map (AList.lookup (op =) thm_names_with_var) var_order end
-
+ in map (fn v => (v, AList.lookup (op =) thm_names_with_var v)) var_order end
in
SMT_Replay_Methods.prove ctxt t (fn _ =>
K (unfold_tac ctxt ctxt_eq)
- THEN' ((SOLVED' (K (unfold_tac ctxt (map (fn thm => thm1 OF [@{thm sym} OF [thm]]) ts))))
- ORELSE'
- (rewrite_all_skolems thm2 ctxt (ordered_definitions ())
- THEN' partial_simplify_tac ctxt @{thms eq_commute})))
+ THEN' rewrite_all_skolems thm2 ctxt (ordered_definitions ())
+ THEN' (eqsubst_all ctxt (map (fn thm => thm RS sym) other))
+ THEN_ALL_NEW TRY' (resolve_tac ctxt @{thms refl})
+ THEN' K (unfold_tac ctxt ctxt_eq)
+ THEN' TRY' (partial_simplify_tac ctxt (@{thms eq_commute})))
end
in
val skolem_forall =
- skolem_tac extract_all_forall_quantified_names @{thm verit_sko_forall_indirect}
- @{thm verit_sko_forall_indirect2}
+ skolem_tac extract_all_forall_exists_quantified_names_q @{thm verit_sko_forall_indirect}
+ @{thms verit_sko_forall_indirect2 verit_sko_ex_indirect2}
val skolem_ex =
- skolem_tac extract_all_exists_quantified_names @{thm verit_sko_ex_indirect}
- @{thm verit_sko_ex_indirect2}
+ skolem_tac extract_all_forall_exists_quantified_names_q @{thm verit_sko_ex_indirect}
+ @{thms verit_sko_ex_indirect2 verit_sko_forall_indirect2}
end
--- a/src/HOL/Tools/SMT/smt_systems.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/SMT/smt_systems.ML Fri Sep 02 13:41:55 2022 +0200
@@ -6,7 +6,7 @@
signature SMT_SYSTEMS =
sig
- val cvc4_extensions: bool Config.T
+ val cvc_extensions: bool Config.T
val z3_extensions: bool Config.T
end;
@@ -59,9 +59,9 @@
on_first_line test_outcome solver_name (filter (curry (op <>) "unsupported") lines)
-(* CVC4 *)
+(* CVC4 and cvc5 *)
-val cvc4_extensions = Attrib.setup_config_bool \<^binding>\<open>cvc4_extensions\<close> (K false)
+val cvc_extensions = Attrib.setup_config_bool \<^binding>\<open>cvc_extensions\<close> (K false)
local
fun cvc4_options ctxt =
@@ -72,12 +72,20 @@
NONE => []
| SOME t => ["--tlimit", string_of_int (Time.toMilliseconds t)])
+ fun cvc5_options ctxt =
+ ["--no-stats",
+ "--sat-random-seed=" ^ string_of_int (Config.get ctxt SMT_Config.random_seed),
+ "--lang=smt2"] @
+ (case SMT_Config.get_timeout ctxt of
+ NONE => []
+ | SOME t => ["--tlimit", string_of_int (Time.toMilliseconds t)])
+
fun select_class ctxt =
- if Config.get ctxt cvc4_extensions then
+ if Config.get ctxt cvc_extensions then
if Config.get ctxt SMT_Config.higher_order then
- CVC4_Interface.hosmtlib_cvc4C
+ CVC_Interface.hosmtlib_cvcC
else
- CVC4_Interface.smtlib_cvc4C
+ CVC_Interface.smtlib_cvcC
else
if Config.get ctxt SMT_Config.higher_order then
SMTLIB_Interface.hosmtlibC
@@ -96,15 +104,35 @@
smt_options = [(":produce-unsat-cores", "true")],
good_slices =
(* FUDGE *)
- [((1, 512, meshN), ["--full-saturate-quant", "--inst-when=full-last-call", "--inst-no-entail", "--term-db-mode=relevant", "--multi-trigger-linear"]),
- ((1, 64, meshN), ["--decision=internal", "--simplification=none", "--full-saturate-quant"]),
- ((1, 1024, meshN), ["--relevant-triggers", "--full-saturate-quant"]),
- ((1, 256, mepoN), ["--trigger-sel=max", "--full-saturate-quant"]),
- ((1, 32, meshN), ["--term-db-mode=relevant", "--full-saturate-quant"]),
- ((1, 128, meshN), ["--no-e-matching", "--full-saturate-quant"]),
- ((1, 256, meshN), ["--finite-model-find", "--fmf-inst-engine"])],
+ [((2, 512, meshN), ["--full-saturate-quant", "--inst-when=full-last-call", "--inst-no-entail", "--term-db-mode=relevant", "--multi-trigger-linear"]),
+ ((2, 64, meshN), ["--decision=internal", "--simplification=none", "--full-saturate-quant"]),
+ ((2, 1024, meshN), ["--relevant-triggers", "--full-saturate-quant"]),
+ ((2, 256, mepoN), ["--trigger-sel=max", "--full-saturate-quant"]),
+ ((2, 32, meshN), ["--term-db-mode=relevant", "--full-saturate-quant"]),
+ ((2, 128, meshN), ["--no-e-matching", "--full-saturate-quant"]),
+ ((2, 256, meshN), ["--finite-model-find", "--fmf-inst-engine"])],
outcome = on_first_line (outcome_of "unsat" "sat" "unknown" "timeout"),
- parse_proof = SOME (K CVC4_Proof_Parse.parse_proof),
+ parse_proof = SOME (K CVC_Proof_Parse.parse_proof),
+ replay = NONE }
+
+val cvc5: SMT_Solver.solver_config = {
+ name = "cvc5",
+ class = select_class,
+ avail = make_avail "CVC5",
+ command = make_command "CVC5",
+ options = cvc5_options,
+ smt_options = [(":produce-unsat-cores", "true")],
+ good_slices =
+ (* FUDGE *)
+ [((2, 512, meshN), ["--full-saturate-quant", "--inst-when=full-last-call", "--inst-no-entail", "--term-db-mode=relevant", "--multi-trigger-linear"]),
+ ((2, 64, meshN), ["--decision=internal", "--simplification=none", "--full-saturate-quant"]),
+ ((2, 1024, meshN), ["--relevant-triggers", "--full-saturate-quant"]),
+ ((2, 256, mepoN), ["--trigger-sel=max", "--full-saturate-quant"]),
+ ((2, 32, meshN), ["--term-db-mode=relevant", "--full-saturate-quant"]),
+ ((2, 128, meshN), ["--no-e-matching", "--full-saturate-quant"]),
+ ((2, 256, meshN), ["--finite-model-find", "--fmf-inst-engine"])],
+ outcome = on_first_line (outcome_of "unsat" "sat" "unknown" "timeout"),
+ parse_proof = SOME (K CVC_Proof_Parse.parse_proof),
replay = NONE }
end
@@ -126,7 +154,7 @@
"--proof-merge",
"--disable-print-success",
"--disable-banner"] @
- Verit_Proof.veriT_current_strategy (Context.Proof ctxt) @
+ Verit_Strategies.veriT_current_strategy (Context.Proof ctxt) @
(case SMT_Config.get_timeout ctxt of
NONE => []
| SOME t => ["--max-time=" ^ string_of_int (Time.toMilliseconds t)])
@@ -141,12 +169,12 @@
smt_options = [(":produce-proofs", "true")],
good_slices =
(* FUDGE *)
- [((1, 1024, meshN), []),
- ((1, 512, mashN), []),
- ((1, 64, meshN), []),
- ((1, 128, meshN), []),
- ((1, 256, mepoN), []),
- ((1, 32, meshN), [])],
+ [((2, 1024, meshN), []),
+ ((2, 512, mashN), []),
+ ((2, 64, meshN), []),
+ ((2, 128, meshN), []),
+ ((2, 256, mepoN), []),
+ ((2, 32, meshN), [])],
outcome = on_first_non_unsupported_line (outcome_of "unsat" "sat" "unknown" "Time limit exceeded"),
parse_proof = SOME (K Lethe_Proof_Parse.parse_proof),
replay = SOME Verit_Replay.replay }
@@ -182,12 +210,12 @@
smt_options = [(":produce-proofs", "true")],
good_slices =
(* FUDGE *)
- [((1, 1024, meshN), []),
- ((1, 512, mepoN), []),
- ((1, 64, meshN), []),
- ((1, 256, meshN), []),
- ((1, 128, mashN), []),
- ((1, 32, meshN), [])],
+ [((2, 1024, meshN), []),
+ ((2, 512, mepoN), []),
+ ((2, 64, meshN), []),
+ ((2, 256, meshN), []),
+ ((2, 128, mashN), []),
+ ((2, 32, meshN), [])],
outcome = on_first_line (outcome_of "unsat" "sat" "unknown" "timeout"),
parse_proof = SOME Z3_Replay.parse_proof,
replay = SOME Z3_Replay.replay }
@@ -210,7 +238,7 @@
else ()
val ctxt =
ctxt
- |> (if stgy <> NONE then Context.proof_map (Verit_Proof.select_veriT_stgy (the stgy)) else I)
+ |> (if stgy <> NONE then Context.proof_map (Verit_Strategies.select_veriT_stgy (the stgy)) else I)
|> Context.Proof
|> SMT_Config.select_solver solver
|> Context.proof_of
@@ -228,6 +256,7 @@
val _ = Theory.setup (
SMT_Solver.add_solver cvc4 #>
+ SMT_Solver.add_solver cvc5 #>
SMT_Solver.add_solver veriT #>
SMT_Solver.add_solver z3)
--- a/src/HOL/Tools/SMT/verit_proof.ML Sat Jun 25 13:34:41 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,895 +0,0 @@
-(* Title: HOL/Tools/SMT/Verit_Proof.ML
- Author: Mathias Fleury, ENS Rennes
- Author: Sascha Boehme, TU Muenchen
-
-VeriT proofs: parsing and abstract syntax tree.
-*)
-
-signature VERIT_PROOF =
-sig
- (*proofs*)
- datatype veriT_step = VeriT_Step of {
- id: string,
- rule: string,
- prems: string list,
- proof_ctxt: term list,
- concl: term,
- fixes: string list}
-
- datatype veriT_replay_node = VeriT_Replay_Node of {
- id: string,
- rule: string,
- args: term list,
- prems: string list,
- proof_ctxt: term list,
- concl: term,
- bounds: (string * typ) list,
- declarations: (string * term) list,
- insts: term Symtab.table,
- subproof: (string * typ) list * term list * term list * veriT_replay_node list}
-
- (*proof parser*)
- val parse: typ Symtab.table -> term Symtab.table -> string list ->
- Proof.context -> veriT_step list * Proof.context
- val parse_replay: typ Symtab.table -> term Symtab.table -> string list ->
- Proof.context -> veriT_replay_node list * Proof.context
-
- val step_prefix : string
- val input_rule: string
- val keep_app_symbols: string -> bool
- val keep_raw_lifting: string -> bool
- val normalized_input_rule: string
- val la_generic_rule : string
- val rewrite_rule : string
- val simp_arith_rule : string
- val veriT_deep_skolemize_rule : string
- val veriT_def : string
- val subproof_rule : string
- val local_input_rule : string
- val not_not_rule : string
- val contract_rule : string
- val ite_intro_rule : string
- val eq_congruent_rule : string
- val eq_congruent_pred_rule : string
- val skolemization_steps : string list
- val theory_resolution2_rule: string
- val equiv_pos2_rule: string
- val th_resolution_rule: string
- val and_pos_rule: string
-
- val is_skolemization: string -> bool
- val is_skolemization_step: veriT_replay_node -> bool
-
- val number_of_steps: veriT_replay_node list -> int
-
- (*Strategy related*)
- val veriT_strategy : string Config.T
- val veriT_current_strategy : Context.generic -> string list
- val all_veriT_stgies: Context.generic -> string list;
-
- val select_veriT_stgy: string -> Context.generic -> Context.generic;
- val valid_veriT_stgy: string -> Context.generic -> bool;
- val verit_add_stgy: string * string list -> Context.generic -> Context.generic
- val verit_rm_stgy: string -> Context.generic -> Context.generic
-
- (*Global tactic*)
- val verit_tac: Proof.context -> thm list -> int -> tactic
- val verit_tac_stgy: string -> Proof.context -> thm list -> int -> tactic
-end;
-
-structure Verit_Proof: VERIT_PROOF =
-struct
-
-open SMTLIB_Proof
-
-val veriT_strategy_default_name = "default"; (*FUDGE*)
-val veriT_strategy_del_insts_name = "del_insts"; (*FUDGE*)
-val veriT_strategy_rm_insts_name = "ccfv_SIG"; (*FUDGE*)
-val veriT_strategy_ccfv_insts_name = "ccfv_threshold"; (*FUDGE*)
-val veriT_strategy_best_name = "best"; (*FUDGE*)
-
-val veriT_strategy_best = ["--index-sorts", "--index-fresh-sorts", "--triggers-new",
- "--triggers-sel-rm-specific"];
-val veriT_strategy_del_insts = ["--index-sorts", "--index-fresh-sorts", "--ccfv-breadth",
- "--inst-deletion", "--index-SAT-triggers", "--inst-deletion-loops", "--inst-deletion-track-vars",
- "--inst-deletion", "--index-SAT-triggers"];
-val veriT_strategy_rm_insts = ["--index-SIG", "--triggers-new", "--triggers-sel-rm-specific"];
-val veriT_strategy_ccfv_insts = ["--index-sorts", "--index-fresh-sorts", "--triggers-new",
- "--triggers-sel-rm-specific", "--triggers-restrict-combine", "--inst-deletion",
- "--index-SAT-triggers", "--inst-deletion-loops", "--inst-deletion-track-vars", "--inst-deletion",
- "--index-SAT-triggers", "--inst-sorts-threshold=100000", "--ematch-exp=10000000",
- "--ccfv-index=100000", "--ccfv-index-full=1000"]
-
-val veriT_strategy_default = [];
-
-type verit_strategy = {default_strategy: string, strategies: (string * string list) list}
-fun mk_verit_strategy default_strategy strategies : verit_strategy = {default_strategy=default_strategy,strategies=strategies}
-
-val empty_data = mk_verit_strategy veriT_strategy_best_name
- [(veriT_strategy_default_name, veriT_strategy_default),
- (veriT_strategy_del_insts_name, veriT_strategy_del_insts),
- (veriT_strategy_rm_insts_name, veriT_strategy_rm_insts),
- (veriT_strategy_ccfv_insts_name, veriT_strategy_ccfv_insts),
- (veriT_strategy_best_name, veriT_strategy_best)]
-
-fun merge_data ({strategies=strategies1,...}:verit_strategy,
- {default_strategy,strategies=strategies2}:verit_strategy) : verit_strategy =
- mk_verit_strategy default_strategy (AList.merge (op =) (op =) (strategies1, strategies2))
-
-structure Data = Generic_Data
-(
- type T = verit_strategy
- val empty = empty_data
- val merge = merge_data
-)
-
-fun veriT_current_strategy ctxt =
- let
- val {default_strategy,strategies} = (Data.get ctxt)
- in
- AList.lookup (op=) strategies default_strategy
- |> the
- end
-
-val veriT_strategy = Attrib.setup_config_string \<^binding>\<open>smt_verit_strategy\<close> (K veriT_strategy_best_name);
-
-fun valid_veriT_stgy stgy context =
- let
- val {strategies,...} = Data.get context
- in
- AList.defined (op =) strategies stgy
- end
-
-fun select_veriT_stgy stgy context =
- let
- val {strategies,...} = Data.get context
- val upd = Data.map (K (mk_verit_strategy stgy strategies))
- in
- if not (AList.defined (op =) strategies stgy) then
- error ("Trying to select unknown veriT strategy: " ^ quote stgy)
- else upd context
- end
-
-fun verit_add_stgy stgy context =
- let
- val {default_strategy,strategies} = Data.get context
- in
- Data.map
- (K (mk_verit_strategy default_strategy (AList.update (op =) stgy strategies)))
- context
- end
-
-fun verit_rm_stgy stgy context =
- let
- val {default_strategy,strategies} = Data.get context
- in
- Data.map
- (K (mk_verit_strategy default_strategy (AList.delete (op =) stgy strategies)))
- context
- end
-
-fun all_veriT_stgies context =
- let
- val {strategies,...} = Data.get context
- in
- map fst strategies
- end
-
-val select_verit = SMT_Config.select_solver "verit"
-fun verit_tac ctxt = SMT_Solver.smt_tac (Config.put SMT_Config.native_bv false ((Context.proof_map select_verit ctxt)))
-fun verit_tac_stgy stgy ctxt = verit_tac (Context.proof_of (select_veriT_stgy stgy (Context.Proof ctxt)))
-
-datatype raw_veriT_node = Raw_VeriT_Node of {
- id: string,
- rule: string,
- args: SMTLIB.tree,
- prems: string list,
- concl: SMTLIB.tree,
- declarations: (string * SMTLIB.tree) list,
- subproof: raw_veriT_node list}
-
-fun mk_raw_node id rule args prems declarations concl subproof =
- Raw_VeriT_Node {id = id, rule = rule, args = args, prems = prems, declarations = declarations,
- concl = concl, subproof = subproof}
-
-datatype veriT_node = VeriT_Node of {
- id: string,
- rule: string,
- prems: string list,
- proof_ctxt: term list,
- concl: term}
-
-fun mk_node id rule prems proof_ctxt concl =
- VeriT_Node {id = id, rule = rule, prems = prems, proof_ctxt = proof_ctxt, concl = concl}
-
-datatype veriT_replay_node = VeriT_Replay_Node of {
- id: string,
- rule: string,
- args: term list,
- prems: string list,
- proof_ctxt: term list,
- concl: term,
- bounds: (string * typ) list,
- insts: term Symtab.table,
- declarations: (string * term) list,
- subproof: (string * typ) list * term list * term list * veriT_replay_node list}
-
-fun mk_replay_node id rule args prems proof_ctxt concl bounds insts declarations subproof =
- VeriT_Replay_Node {id = id, rule = rule, args = args, prems = prems, proof_ctxt = proof_ctxt,
- concl = concl, bounds = bounds, insts = insts, declarations = declarations,
- subproof = subproof}
-
-datatype veriT_step = VeriT_Step of {
- id: string,
- rule: string,
- prems: string list,
- proof_ctxt: term list,
- concl: term,
- fixes: string list}
-
-fun mk_step id rule prems proof_ctxt concl fixes =
- VeriT_Step {id = id, rule = rule, prems = prems, proof_ctxt = proof_ctxt, concl = concl,
- fixes = fixes}
-
-val step_prefix = ".c"
-val input_rule = "input"
-val la_generic_rule = "la_generic"
-val normalized_input_rule = "__normalized_input" (*arbitrary*)
-val rewrite_rule = "__rewrite" (*arbitrary*)
-val subproof_rule = "subproof"
-val local_input_rule = "__local_input" (*arbitrary*)
-val simp_arith_rule = "simp_arith"
-val veriT_def = "__skolem_definition" (*arbitrary*)
-val not_not_rule = "not_not"
-val contract_rule = "contraction"
-val eq_congruent_pred_rule = "eq_congruent_pred"
-val eq_congruent_rule = "eq_congruent"
-val ite_intro_rule = "ite_intro"
-val default_skolem_rule = "sko_forall" (*arbitrary, but must be one of the skolems*)
-val theory_resolution2_rule = "__theory_resolution2" (*arbitrary*)
-val equiv_pos2_rule = "equiv_pos2"
-val th_resolution_rule = "th_resolution"
-val and_pos_rule = "and_pos"
-
-val skolemization_steps = ["sko_forall", "sko_ex"]
-val is_skolemization = member (op =) skolemization_steps
-val keep_app_symbols = member (op =) [eq_congruent_pred_rule, eq_congruent_rule, ite_intro_rule, and_pos_rule]
-val keep_raw_lifting = member (op =) [eq_congruent_pred_rule, eq_congruent_rule, ite_intro_rule, and_pos_rule]
-val is_SH_trivial = member (op =) [not_not_rule, contract_rule]
-
-fun is_skolemization_step (VeriT_Replay_Node {id, ...}) = is_skolemization id
-
-(* Even the veriT developers do not know if the following rule can still appear in proofs: *)
-val veriT_deep_skolemize_rule = "deep_skolemize"
-
-fun number_of_steps [] = 0
- | number_of_steps ((VeriT_Replay_Node {subproof = (_, _, _, subproof), ...}) :: pf) =
- 1 + number_of_steps subproof + number_of_steps pf
-
-(* proof parser *)
-
-fun node_of p cx =
- ([], cx)
- ||>> `(with_fresh_names (term_of p))
- |>> snd
-
-fun find_type_in_formula (Abs (v, T, u)) var_name =
- if String.isPrefix var_name v then SOME T else find_type_in_formula u var_name
- | find_type_in_formula (u $ v) var_name =
- (case find_type_in_formula u var_name of
- NONE => find_type_in_formula v var_name
- | some_T => some_T)
- | find_type_in_formula (Free(v, T)) var_name =
- if String.isPrefix var_name v then SOME T else NONE
- | find_type_in_formula _ _ = NONE
-
-fun synctactic_var_subst old_name new_name (u $ v) =
- (synctactic_var_subst old_name new_name u $ synctactic_var_subst old_name new_name v)
- | synctactic_var_subst old_name new_name (Abs (v, T, u)) =
- Abs (if String.isPrefix old_name v then new_name else v, T,
- synctactic_var_subst old_name new_name u)
- | synctactic_var_subst old_name new_name (Free (v, T)) =
- if String.isPrefix old_name v then Free (new_name, T) else Free (v, T)
- | synctactic_var_subst _ _ t = t
-
-fun synctatic_rew_in_lhs_subst old_name new_name (Const(\<^const_name>\<open>HOL.eq\<close>, T) $ t1 $ t2) =
- Const(\<^const_name>\<open>HOL.eq\<close>, T) $ synctactic_var_subst old_name new_name t1 $ t2
- | synctatic_rew_in_lhs_subst old_name new_name (Const(\<^const_name>\<open>Trueprop\<close>, T) $ t1) =
- Const(\<^const_name>\<open>Trueprop\<close>, T) $ (synctatic_rew_in_lhs_subst old_name new_name t1)
- | synctatic_rew_in_lhs_subst _ _ t = t
-
-fun add_bound_variables_to_ctxt cx =
- fold (update_binding o
- (fn (s, SOME typ) => (s, Term (Free (s, type_of cx typ)))))
-
-local
-
- fun extract_symbols bds =
- bds
- |> map (fn (SMTLIB.S [SMTLIB.Sym "=", SMTLIB.Sym x, SMTLIB.Sym y], typ) => [([x, y], typ)]
- | t => raise (Fail ("match error " ^ @{make_string} t)))
- |> flat
-
- (* onepoint can bind a variable to another variable or to a constant *)
- fun extract_qnt_symbols cx bds =
- bds
- |> map (fn (SMTLIB.S [SMTLIB.Sym "=", SMTLIB.Sym x, SMTLIB.Sym y], typ) =>
- (case node_of (SMTLIB.Sym y) cx of
- ((_, []), _) => [([x], typ)]
- | _ => [([x, y], typ)])
- | (SMTLIB.S (SMTLIB.Sym "=" :: SMTLIB.Sym x :: _), typ) => [([x], typ)]
- | t => raise (Fail ("match error " ^ @{make_string} t)))
- |> flat
-
- fun extract_symbols_map bds =
- bds
- |> map (fn (SMTLIB.S [SMTLIB.Sym "=", SMTLIB.Sym x, _], typ) => [([x], typ)])
- |> flat
-in
-
-fun declared_csts _ "__skolem_definition" [(SMTLIB.S [SMTLIB.Sym x, typ, _], _)] = [(x, typ)]
- | declared_csts _ "__skolem_definition" t = raise (Fail ("unrecognized skolem_definition " ^ @{make_string} t))
- | declared_csts _ _ _ = []
-
-fun skolems_introduced_by_rule (SMTLIB.S bds) =
- fold (fn (SMTLIB.S [SMTLIB.Sym "=", _, SMTLIB.Sym y]) => curry (op ::) y) bds []
-
-(*FIXME there is probably a way to use the information given by onepoint*)
-fun bound_vars_by_rule _ "bind" (bds) = extract_symbols bds
- | bound_vars_by_rule cx "onepoint" bds = extract_qnt_symbols cx bds
- | bound_vars_by_rule _ "sko_forall" bds = extract_symbols_map bds
- | bound_vars_by_rule _ "sko_ex" bds = extract_symbols_map bds
- | bound_vars_by_rule _ "__skolem_definition" [(SMTLIB.S [SMTLIB.Sym x, typ, _], _)] = [([x], SOME typ)]
- | bound_vars_by_rule _ "__skolem_definition" [(SMTLIB.S [_, SMTLIB.Sym x, _], _)] = [([x], NONE)]
- | bound_vars_by_rule _ _ _ = []
-
-(* VeriT adds "?" before some variables. *)
-fun remove_all_qm (SMTLIB.Sym v :: l) =
- SMTLIB.Sym (perhaps (try (unprefix "?")) v) :: remove_all_qm l
- | remove_all_qm (SMTLIB.S l :: l') = SMTLIB.S (remove_all_qm l) :: remove_all_qm l'
- | remove_all_qm (SMTLIB.Key v :: l) = SMTLIB.Key v :: remove_all_qm l
- | remove_all_qm (v :: l) = v :: remove_all_qm l
- | remove_all_qm [] = []
-
-fun remove_all_qm2 (SMTLIB.Sym v) = SMTLIB.Sym (perhaps (try (unprefix "?")) v)
- | remove_all_qm2 (SMTLIB.S l) = SMTLIB.S (remove_all_qm l)
- | remove_all_qm2 (SMTLIB.Key v) = SMTLIB.Key v
- | remove_all_qm2 v = v
-
-end
-
-datatype step_kind = ASSUME | ANCHOR | NO_STEP | NORMAL_STEP | SKOLEM
-
-fun parse_raw_proof_steps (limit : string option) (ls : SMTLIB.tree list) (cx : name_bindings) :
- (raw_veriT_node list * SMTLIB.tree list * name_bindings) =
- let
- fun rotate_pair (a, (b, c)) = ((a, b), c)
- fun step_kind [] = (NO_STEP, SMTLIB.S [], [])
- | step_kind ((p as SMTLIB.S (SMTLIB.Sym "anchor" :: _)) :: l) = (ANCHOR, p, l)
- | step_kind ((p as SMTLIB.S (SMTLIB.Sym "assume" :: _)) :: l) = (ASSUME, p, l)
- | step_kind ((p as SMTLIB.S (SMTLIB.Sym "step" :: _)) :: l) = (NORMAL_STEP, p, l)
- | step_kind ((p as SMTLIB.S (SMTLIB.Sym "define-fun" :: _)) :: l) = (SKOLEM, p, l)
- fun parse_skolem (SMTLIB.S [SMTLIB.Sym "define-fun", SMTLIB.Sym id, _, typ,
- SMTLIB.S (SMTLIB.Sym "!" :: t :: [SMTLIB.Key _, SMTLIB.Sym name])]) cx =
- (*replace the name binding by the constant instead of the full term in order to reduce
- the size of the generated terms and therefore the reconstruction time*)
- let val (l, cx) = (fst oo SMTLIB_Proof.extract_and_update_name_bindings) t cx
- |> apsnd (SMTLIB_Proof.update_name_binding (name, SMTLIB.Sym id))
- in
- (mk_raw_node (id ^ veriT_def) veriT_def (SMTLIB.S [SMTLIB.Sym id, typ, l]) [] []
- (SMTLIB.S [SMTLIB.Sym "=", SMTLIB.Sym id, l]) [], cx)
- end
- | parse_skolem (SMTLIB.S [SMTLIB.Sym "define-fun", SMTLIB.Sym id, _, typ, SMTLIB.S l]) cx =
- let val (l, cx) = (fst oo SMTLIB_Proof.extract_and_update_name_bindings) (SMTLIB.S l ) cx
- in
- (mk_raw_node (id ^ veriT_def) veriT_def (SMTLIB.S [SMTLIB.Sym id, typ, l]) [] []
- (SMTLIB.S [SMTLIB.Sym "=", SMTLIB.Sym id, l]) [], cx)
- end
- | parse_skolem t _ = raise Fail ("unrecognized VeriT proof " ^ \<^make_string> t)
- fun get_id_cx (SMTLIB.S ((SMTLIB.Sym _) :: (SMTLIB.Sym id) :: l), cx) = (id, (l, cx))
- | get_id_cx t = raise Fail ("unrecognized VeriT proof " ^ \<^make_string> t)
- fun get_id (SMTLIB.S ((SMTLIB.Sym _) :: (SMTLIB.Sym id) :: l)) = (id, l)
- | get_id t = raise Fail ("unrecognized VeriT proof " ^ \<^make_string> t)
- fun parse_source (SMTLIB.Key "premises" :: SMTLIB.S source ::l, cx) =
- (SOME (map (fn (SMTLIB.Sym id) => id) source), (l, cx))
- | parse_source (l, cx) = (NONE, (l, cx))
- fun parse_rule (SMTLIB.Key "rule" :: SMTLIB.Sym r :: l, cx) = (r, (l, cx))
- | parse_rule t = raise Fail ("unrecognized VeriT proof " ^ \<^make_string> t)
- fun parse_anchor_step (SMTLIB.S (SMTLIB.Sym "anchor" :: SMTLIB.Key "step" :: SMTLIB.Sym r :: l), cx) = (r, (l, cx))
- | parse_anchor_step t = raise Fail ("unrecognized VeriT proof " ^ \<^make_string> t)
- fun parse_args (SMTLIB.Key "args" :: args :: l, cx) =
- let val ((args, cx), _) = SMTLIB_Proof.extract_and_update_name_bindings args cx
- in (args, (l, cx)) end
- | parse_args (l, cx) = (SMTLIB.S [], (l, cx))
- fun parse_and_clausify_conclusion (SMTLIB.S (SMTLIB.Sym "cl" :: []) :: l, cx) =
- (SMTLIB.Sym "false", (l, cx))
- | parse_and_clausify_conclusion (SMTLIB.S (SMTLIB.Sym "cl" :: concl) :: l, cx) =
- let val (concl, cx) = fold_map (fst oo SMTLIB_Proof.extract_and_update_name_bindings) concl cx
- in (SMTLIB.S (SMTLIB.Sym "or" :: concl), (l, cx)) end
- | parse_and_clausify_conclusion t = raise Fail ("unrecognized VeriT proof " ^ \<^make_string> t)
- val parse_normal_step =
- get_id_cx
- ##> parse_and_clausify_conclusion
- #> rotate_pair
- ##> parse_rule
- #> rotate_pair
- ##> parse_source
- #> rotate_pair
- ##> parse_args
- #> rotate_pair
-
- fun to_raw_node subproof ((((id, concl), rule), prems), args) =
- mk_raw_node id rule args (the_default [] prems) [] concl subproof
- fun at_discharge NONE _ = false
- | at_discharge (SOME id) p = p |> get_id |> fst |> (fn id2 => id = id2)
- in
- case step_kind ls of
- (NO_STEP, _, _) => ([],[], cx)
- | (NORMAL_STEP, p, l) =>
- if at_discharge limit p then ([], ls, cx) else
- let
- val (s, (_, cx)) = (p, cx)
- |> parse_normal_step
- ||> (fn i => i)
- |>> (to_raw_node [])
- val (rp, rl, cx) = parse_raw_proof_steps limit l cx
- in (s :: rp, rl, cx) end
- | (ASSUME, p, l) =>
- let
- val (id, t :: []) = p
- |> get_id
- val ((t, cx), _) = SMTLIB_Proof.extract_and_update_name_bindings t cx
- val s = mk_raw_node id input_rule (SMTLIB.S []) [] [] t []
- val (rp, rl, cx) = parse_raw_proof_steps limit l cx
- in (s :: rp, rl, cx) end
- | (ANCHOR, p, l) =>
- let
- val (anchor_id, (anchor_args, (_, cx))) = (p, cx) |> (parse_anchor_step ##> parse_args)
- val (subproof, discharge_step :: remaining_proof, cx) = parse_raw_proof_steps (SOME anchor_id) l cx
- val (curss, (_, cx)) = parse_normal_step (discharge_step, cx)
- val s = to_raw_node subproof (fst curss, anchor_args)
- val (rp, rl, cx) = parse_raw_proof_steps limit remaining_proof cx
- in (s :: rp, rl, cx) end
- | (SKOLEM, p, l) =>
- let
- val (s, cx) = parse_skolem p cx
- val (rp, rl, cx) = parse_raw_proof_steps limit l cx
- in (s :: rp, rl, cx) end
- end
-
-fun proof_ctxt_of_rule "bind" t = t
- | proof_ctxt_of_rule "sko_forall" t = t
- | proof_ctxt_of_rule "sko_ex" t = t
- | proof_ctxt_of_rule "let" t = t
- | proof_ctxt_of_rule "onepoint" t = t
- | proof_ctxt_of_rule _ _ = []
-
-fun args_of_rule "bind" t = t
- | args_of_rule "la_generic" t = t
- | args_of_rule "lia_generic" t = t
- | args_of_rule _ _ = []
-
-fun insts_of_forall_inst "forall_inst" t = map (fn SMTLIB.S [_, SMTLIB.Sym x, a] => (x, a)) t
- | insts_of_forall_inst _ _ = []
-
-fun id_of_last_step prems =
- if null prems then []
- else
- let val VeriT_Replay_Node {id, ...} = List.last prems in [id] end
-
-fun extract_assumptions_from_subproof subproof =
- let fun extract_assumptions_from_subproof (VeriT_Replay_Node {rule, concl, ...}) assms =
- if rule = local_input_rule then concl :: assms else assms
- in
- fold extract_assumptions_from_subproof subproof []
- end
-
-fun normalized_rule_name id rule =
- (case (rule = input_rule, can SMTLIB_Interface.role_and_index_of_assert_name id) of
- (true, true) => normalized_input_rule
- | (true, _) => local_input_rule
- | _ => rule)
-
-fun is_assm_repetition id rule =
- rule = input_rule andalso can SMTLIB_Interface.role_and_index_of_assert_name id
-
-fun extract_skolem ([SMTLIB.Sym var, typ, choice]) = (var, typ, choice)
- | extract_skolem t = raise Fail ("fail to parse type" ^ @{make_string} t)
-
-(* The preprocessing takes care of:
- 1. unfolding the shared terms
- 2. extract the declarations of skolems to make sure that there are not unfolded
-*)
-fun preprocess compress step =
- let
- fun expand_assms cs =
- map (fn t => case AList.lookup (op =) cs t of NONE => t | SOME a => a)
- fun expand_lonely_arguments (args as SMTLIB.S [SMTLIB.Sym "=", _, _]) = [args]
- | expand_lonely_arguments (x as SMTLIB.S [SMTLIB.Sym var, _]) = [SMTLIB.S [SMTLIB.Sym "=", x, SMTLIB.Sym var]]
-
- fun preprocess (Raw_VeriT_Node {id, rule, args, prems, concl, subproof, ...}) (cx, remap_assms) =
- let
- val (skolem_names, stripped_args) = args
- |> (fn SMTLIB.S args => args)
- |> map
- (fn SMTLIB.S [SMTLIB.Key "=", x, y] => SMTLIB.S [SMTLIB.Sym "=", x, y]
- | x => x)
- |> (rule = "bind" orelse rule = "onepoint") ? flat o (map expand_lonely_arguments)
- |> `(if rule = veriT_def then single o extract_skolem else K [])
- ||> SMTLIB.S
- val (subproof, (cx, _)) = fold_map preprocess subproof (cx, remap_assms) |> apfst flat
- val remap_assms = (if rule = "or" then (id, hd prems) :: remap_assms else remap_assms)
- (* declare variables in the context *)
- val declarations =
- if rule = veriT_def
- then skolem_names |> map (fn (name, _, choice) => (name, choice))
- else []
- in
- if compress andalso rule = "or"
- then ([], (cx, remap_assms))
- else ([Raw_VeriT_Node {id = id, rule = rule, args = stripped_args,
- prems = expand_assms remap_assms prems, declarations = declarations, concl = concl, subproof = subproof}],
- (cx, remap_assms))
- end
- in preprocess step end
-
-fun filter_split _ [] = ([], [])
- | filter_split f (a :: xs) =
- (if f a then apfst (curry op :: a) else apsnd (curry op :: a)) (filter_split f xs)
-
-fun collect_skolem_defs (Raw_VeriT_Node {rule, subproof = subproof, args, ...}) =
- (if is_skolemization rule then map (fn id => id ^ veriT_def) (skolems_introduced_by_rule args) else []) @
- flat (map collect_skolem_defs subproof)
-
-fun extract_types_of_args (SMTLIB.S [var, typ, t as SMTLIB.S [SMTLIB.Sym "choice", _, _]]) =
- (SMTLIB.S [var, typ, t], SOME typ)
- |> single
- | extract_types_of_args (SMTLIB.S t) =
- let
- fun extract_types_of_arg (SMTLIB.S [eq, SMTLIB.S [var, typ], t]) = (SMTLIB.S [eq, var, t], SOME typ)
- | extract_types_of_arg t = (t, NONE)
- in
- t
- |> map extract_types_of_arg
- end
-
-(*The postprocessing does:
- 1. translate the terms to Isabelle syntax, taking care of free variables
- 2. remove the ambiguity in the proof terms:
- x \<leadsto> y |- x = x
- means y = x. To remove ambiguity, we use the fact that y is a free variable and replace the term
- by:
- xy \<leadsto> y |- xy = x.
- This is now does not have an ambiguity and we can safely move the "xy \<leadsto> y" to the proof
- assumptions.
-*)
-fun postprocess_proof compress ctxt step cx =
- let
- fun postprocess (Raw_VeriT_Node {id, rule, args, prems, declarations, concl, subproof}) (cx, rew) =
- let
- val _ = (SMT_Config.verit_msg ctxt) (fn () => @{print} ("id =", id, "concl =", concl))
-
- val (args) = extract_types_of_args args
- val globally_bound_vars = declared_csts cx rule args
- val cx = fold (update_binding o (fn (s, typ) => (s, Term (Free (s, type_of cx typ)))))
- globally_bound_vars cx
-
- (*find rebound variables specific to the LHS of the equivalence symbol*)
- val bound_vars = bound_vars_by_rule cx rule args
- val bound_vars_no_typ = map fst bound_vars
- val rhs_vars =
- fold (fn [t', t] => t <> t' ? (curry (op ::) t) | _ => fn x => x) bound_vars_no_typ []
- fun not_already_bound cx t = SMTLIB_Proof.lookup_binding cx t = None andalso
- not (member (op =) rhs_vars t)
- val (shadowing_vars, rebound_lhs_vars) = bound_vars
- |> filter_split (fn ([t, _], typ) => not_already_bound cx t | _ => true)
- |>> map (apfst (hd))
- |>> (fn vars => vars @ flat (map (fn ([_, t], typ) => [(t, typ)] | _ => []) bound_vars))
- val subproof_rew = fold (fn [t, t'] => curry (op ::) (t, t ^ t'))
- (map fst rebound_lhs_vars) rew
- val subproof_rewriter = fold (fn (t, t') => synctatic_rew_in_lhs_subst t t')
- subproof_rew
-
- val ((concl, bounds), cx') = node_of concl cx
-
- val extra_lhs_vars = map (fn ([a,b], typ) => (a, a^b, typ)) rebound_lhs_vars
- val old_lhs_vars = map (fn (a, _, typ) => (a, typ)) extra_lhs_vars
- val new_lhs_vars = map (fn (_, newvar, typ) => (newvar, typ)) extra_lhs_vars
-
- (* postprocess conclusion *)
- val concl = SMTLIB_Isar.unskolemize_names ctxt (subproof_rewriter concl)
-
- val _ = (SMT_Config.verit_msg ctxt) (fn () => \<^print> ("id =", id, "concl =", concl))
- val _ = (SMT_Config.verit_msg ctxt) (fn () => \<^print> ("id =", id, "cx' =", cx',
- "bound_vars =", bound_vars))
-
- val bound_tvars =
- map (fn (s, SOME typ) => (s, type_of cx typ))
- (shadowing_vars @ new_lhs_vars)
- val subproof_cx =
- add_bound_variables_to_ctxt cx (shadowing_vars @ new_lhs_vars) cx
-
- fun could_unify (Bound i, Bound j) = i = j
- | could_unify (Var v, Var v') = v = v'
- | could_unify (Free v, Free v') = v = v'
- | could_unify (Const (v, ty), Const (v', ty')) = v = v' andalso ty = ty'
- | could_unify (Abs (_, ty, bdy), Abs (_, ty', bdy')) = ty = ty' andalso could_unify (bdy, bdy')
- | could_unify (u $ v, u' $ v') = could_unify (u, u') andalso could_unify (v, v')
- | could_unify _ = false
- fun is_alpha_renaming t =
- t
- |> HOLogic.dest_Trueprop
- |> HOLogic.dest_eq
- |> could_unify
- handle TERM _ => false
- val alpha_conversion = rule = "bind" andalso is_alpha_renaming concl
-
- val can_remove_subproof =
- compress andalso (is_skolemization rule orelse alpha_conversion)
- val (fixed_subproof : veriT_replay_node list, _) =
- fold_map postprocess (if can_remove_subproof then [] else subproof)
- (subproof_cx, subproof_rew)
-
- val unsk_and_rewrite = SMTLIB_Isar.unskolemize_names ctxt o subproof_rewriter
-
- (* postprocess assms *)
- val stripped_args = map fst args
- val sanitized_args = proof_ctxt_of_rule rule stripped_args
-
- val arg_cx = add_bound_variables_to_ctxt cx (shadowing_vars @ old_lhs_vars) subproof_cx
- val (termified_args, _) = fold_map node_of sanitized_args arg_cx |> apfst (map fst)
- val normalized_args = map unsk_and_rewrite termified_args
-
- val subproof_assms = proof_ctxt_of_rule rule normalized_args
-
- (* postprocess arguments *)
- val rule_args = args_of_rule rule stripped_args
- val (termified_args, _) = fold_map term_of rule_args subproof_cx
- val normalized_args = map unsk_and_rewrite termified_args
- val rule_args = map subproof_rewriter normalized_args
-
- val raw_insts = insts_of_forall_inst rule stripped_args
- fun termify_term (x, t) cx = let val (t, cx) = term_of t cx in ((x, t), cx) end
- val (termified_args, _) = fold_map termify_term raw_insts subproof_cx
- val insts = Symtab.empty
- |> fold (fn (x, t) => fn insts => Symtab.update_new (x, t) insts) termified_args
- |> Symtab.map (K unsk_and_rewrite)
-
- (* declarations *)
- val (declarations, _) = fold_map termify_term declarations cx
- |> apfst (map (apsnd unsk_and_rewrite))
-
- (* fix step *)
- val _ = if bounds <> [] then raise (Fail "found dangling variable in concl") else ()
- val skolem_defs = (if is_skolemization rule
- then map (fn id => id ^ veriT_def) (skolems_introduced_by_rule (SMTLIB.S (map fst args))) else [])
- val skolems_of_subproof = (if is_skolemization rule
- then flat (map collect_skolem_defs subproof) else [])
- val fixed_prems =
- prems @ (if is_assm_repetition id rule then [id] else []) @
- skolem_defs @ skolems_of_subproof @ (id_of_last_step fixed_subproof)
-
- (* fix subproof *)
- val normalized_rule = normalized_rule_name id rule
- |> (if compress andalso alpha_conversion then K "refl" else I)
-
- val extra_assms2 =
- (if rule = subproof_rule then extract_assumptions_from_subproof fixed_subproof else [])
-
- val step = mk_replay_node id normalized_rule rule_args fixed_prems subproof_assms concl
- [] insts declarations (bound_tvars, subproof_assms, extra_assms2, fixed_subproof)
-
- in
- (step, (cx', rew))
- end
- in
- postprocess step (cx, [])
- |> (fn (step, (cx, _)) => (step, cx))
- end
-
-fun combine_proof_steps ((step1 : veriT_replay_node) :: step2 :: steps) =
- let
- val (VeriT_Replay_Node {id = id1, rule = rule1, args = args1, prems = prems1,
- proof_ctxt = proof_ctxt1, concl = concl1, bounds = bounds1, insts = insts1,
- declarations = declarations1,
- subproof = (bound_sub1, assms_sub1, assms_extra1, subproof1)}) = step1
- val (VeriT_Replay_Node {id = id2, rule = rule2, args = args2, prems = prems2,
- proof_ctxt = proof_ctxt2, concl = concl2, bounds = bounds2, insts = insts2,
- declarations = declarations2,
- subproof = (bound_sub2, assms_sub2, assms_extra2, subproof2)}) = step2
- val goals1 =
- (case concl1 of
- _ $ (Const (\<^const_name>\<open>HOL.disj\<close>, _) $ _ $
- (Const (\<^const_name>\<open>HOL.disj\<close>, _) $ (Const (\<^const_name>\<open>HOL.Not\<close>, _) $a) $ b)) => [a,b]
- | _ => [])
- val goal2 = (case concl2 of _ $ a => a)
- in
- if rule1 = equiv_pos2_rule andalso rule2 = th_resolution_rule andalso member (op =) prems2 id1
- andalso member (op =) goals1 goal2
- then
- mk_replay_node id2 theory_resolution2_rule args2 (filter_out (curry (op =) id1) prems2)
- proof_ctxt2 concl2 bounds2 insts2 declarations2
- (bound_sub2, assms_sub2, assms_extra2, combine_proof_steps subproof2) ::
- combine_proof_steps steps
- else
- mk_replay_node id1 rule1 args1 prems1
- proof_ctxt1 concl1 bounds1 insts1 declarations1
- (bound_sub1, assms_sub1, assms_extra1, combine_proof_steps subproof1) ::
- combine_proof_steps (step2 :: steps)
- end
- | combine_proof_steps steps = steps
-
-
-val linearize_proof =
- let
- fun map_node_concl f (VeriT_Node {id, rule, prems, proof_ctxt, concl}) =
- mk_node id rule prems proof_ctxt (f concl)
- fun linearize (VeriT_Replay_Node {id = id, rule = rule, args = _, prems = prems,
- proof_ctxt = proof_ctxt, concl = concl, bounds = bounds, insts = _, declarations = _,
- subproof = (bounds', assms, inputs, subproof)}) =
- let
- val bounds = distinct (op =) bounds
- val bounds' = distinct (op =) bounds'
- fun mk_prop_of_term concl =
- concl |> fastype_of concl = \<^typ>\<open>bool\<close> ? curry (op $) \<^term>\<open>Trueprop\<close>
- fun remove_assumption_id assumption_id prems =
- filter_out (curry (op =) assumption_id) prems
- fun add_assumption assumption concl =
- \<^Const>\<open>Pure.imp for \<open>mk_prop_of_term assumption\<close> \<open>mk_prop_of_term concl\<close>\<close>
- fun inline_assumption assumption assumption_id
- (VeriT_Node {id, rule, prems, proof_ctxt, concl}) =
- mk_node id rule (remove_assumption_id assumption_id prems) proof_ctxt
- (add_assumption assumption concl)
- fun find_input_steps_and_inline [] = []
- | find_input_steps_and_inline
- (VeriT_Node {id = id', rule, prems, concl, ...} :: steps) =
- if rule = input_rule then
- find_input_steps_and_inline (map (inline_assumption concl id') steps)
- else
- mk_node (id') rule prems [] concl :: find_input_steps_and_inline steps
-
- fun free_bounds bounds (concl) =
- fold (fn (var, typ) => fn t => Logic.all (Free (var, typ)) t) bounds concl
- val subproof = subproof
- |> flat o map linearize
- |> map (map_node_concl (fold add_assumption (assms @ inputs)))
- |> map (map_node_concl (free_bounds (bounds @ bounds')))
- |> find_input_steps_and_inline
- val concl = free_bounds bounds concl
- in
- subproof @ [mk_node id rule prems proof_ctxt concl]
- end
- in linearize end
-
-fun rule_of (VeriT_Replay_Node {rule,...}) = rule
-fun subproof_of (VeriT_Replay_Node {subproof = (_, _, _, subproof),...}) = subproof
-
-
-(* Massage Skolems for Sledgehammer.
-
-We have to make sure that there is an "arrow" in the graph for skolemization steps.
-
-
-A. The normal easy case
-
-This function detects the steps of the form
- P \<longleftrightarrow> Q :skolemization
- Q :resolution with P
-and replace them by
- Q :skolemization
-Throwing away the step "P \<longleftrightarrow> Q" completely. This throws away a lot of information, but it does not
-matter too much for Sledgehammer.
-
-
-B. Skolems in subproofs
-Supporting this is more or less hopeless as long as the Isar reconstruction of Sledgehammer
-does not support more features like definitions. veriT is able to generate proofs with skolemization
-happening in subproofs inside the formula.
- (assume "A \<or> P"
- ...
- P \<longleftrightarrow> Q :skolemization in the subproof
- ...)
- hence A \<or> P \<longrightarrow> A \<or> Q :lemma
- ...
- R :something with some rule
-and replace them by
- R :skolemization with some rule
-Without any subproof
-*)
-fun remove_skolem_definitions_proof steps =
- let
- fun replace_equivalent_by_imp (judgement $ ((Const(\<^const_name>\<open>HOL.eq\<close>, typ) $ arg1) $ arg2)) =
- judgement $ ((Const(\<^const_name>\<open>HOL.implies\<close>, typ) $ arg1) $ arg2)
- | replace_equivalent_by_imp a = a (*This case is probably wrong*)
- fun remove_skolem_definitions (VeriT_Replay_Node {id = id, rule = rule, args = args,
- prems = prems,
- proof_ctxt = proof_ctxt, concl = concl, bounds = bounds, insts = insts,
- declarations = declarations,
- subproof = (vars, assms', extra_assms', subproof)}) (prems_to_remove, skolems) =
- let
- val prems = prems
- |> filter_out (member (op =) prems_to_remove)
- val trivial_step = is_SH_trivial rule
- fun has_skolem_substep st NONE = if is_skolemization (rule_of st) then SOME (rule_of st)
- else fold has_skolem_substep (subproof_of st) NONE
- | has_skolem_substep _ a = a
- val promote_to_skolem = exists (fn t => member (op =) skolems t) prems
- val promote_from_assms = fold has_skolem_substep subproof NONE <> NONE
- val promote_step = promote_to_skolem orelse promote_from_assms
- val skolem_step_to_skip = is_skolemization rule orelse
- (promote_from_assms andalso length prems > 1)
- val is_skolem = is_skolemization rule orelse promote_step
- val prems = prems
- |> filter_out (fn t => member (op =) skolems t)
- |> is_skolem ? filter_out (String.isPrefix id)
- val rule = (if promote_step then default_skolem_rule else rule)
- val subproof = subproof
- |> (is_skolem ? K []) (*subproofs of skolemization steps are useless for SH*)
- |> map (fst o (fn st => remove_skolem_definitions st (prems_to_remove, skolems)))
- (*no new definitions in subproofs*)
- |> flat
- val concl = concl
- |> is_skolem ? replace_equivalent_by_imp
- val step = (if skolem_step_to_skip orelse rule = veriT_def orelse trivial_step then []
- else mk_replay_node id rule args prems proof_ctxt concl bounds insts declarations
- (vars, assms', extra_assms', subproof)
- |> single)
- val defs = (if rule = veriT_def orelse trivial_step then id :: prems_to_remove
- else prems_to_remove)
- val skolems = (if skolem_step_to_skip then id :: skolems else skolems)
- in
- (step, (defs, skolems))
- end
- in
- fold_map remove_skolem_definitions steps ([], [])
- |> fst
- |> flat
- end
-
-local
- fun import_proof_and_post_process typs funs lines ctxt =
- let
- val compress = SMT_Config.compress_verit_proofs ctxt
- val smtlib_lines_without_qm =
- lines
- |> map single
- |> map SMTLIB.parse
- |> map remove_all_qm2
- val (raw_steps, _, _) =
- parse_raw_proof_steps NONE smtlib_lines_without_qm SMTLIB_Proof.empty_name_binding
-
- fun process step (cx, cx') =
- let fun postprocess step (cx, cx') =
- let val (step, cx) = postprocess_proof compress ctxt step cx
- in (step, (cx, cx')) end
- in uncurry (fold_map postprocess) (preprocess compress step (cx, cx')) end
- val step =
- (empty_context ctxt typs funs, [])
- |> fold_map process raw_steps
- |> (fn (steps, (cx, _)) => (flat steps, cx))
- |> compress? apfst combine_proof_steps
- in step end
-in
-
-fun parse typs funs lines ctxt =
- let
- val (u, env) = import_proof_and_post_process typs funs lines ctxt
- val t = u
- |> remove_skolem_definitions_proof
- |> flat o (map linearize_proof)
- fun node_to_step (VeriT_Node {id, rule, prems, concl, ...}) =
- mk_step id rule prems [] concl []
- in
- (map node_to_step t, ctxt_of env)
- end
-
-fun parse_replay typs funs lines ctxt =
- let
- val (u, env) = import_proof_and_post_process typs funs lines ctxt
- val _ = (SMT_Config.verit_msg ctxt) (fn () => \<^print> u)
- in
- (u, ctxt_of env)
- end
-end
-
-end;
--- a/src/HOL/Tools/SMT/verit_replay.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/SMT/verit_replay.ML Fri Sep 02 13:41:55 2022 +0200
@@ -41,14 +41,14 @@
fun replay_thm method_for rewrite_rules ll_defs ctxt assumed unchanged_prems prems nthms
concl_transformation global_transformation args insts
- (Verit_Proof.VeriT_Replay_Node {id, rule, concl, bounds, declarations = decls, ...}) =
+ (Lethe_Proof.Lethe_Replay_Node {id, rule, concl, bounds, declarations = decls, ...}) =
let
val _ = SMT_Config.verit_msg ctxt (fn () => \<^print> id)
val rewrite = let val thy = Proof_Context.theory_of (empty_simpset ctxt) in
Raw_Simplifier.rewrite_term thy rewrite_rules []
- #> not (null ll_defs andalso Verit_Proof.keep_raw_lifting rule) ? SMTLIB_Isar.unlift_term ll_defs
+ #> not (null ll_defs andalso Lethe_Proof.keep_raw_lifting rule) ? SMTLIB_Isar.unlift_term ll_defs
end
- val rewrite_concl = if Verit_Proof.keep_app_symbols rule then
+ val rewrite_concl = if Lethe_Proof.keep_app_symbols rule then
filter (curry Term.could_unify (Thm.concl_of @{thm SMT.fun_app_def}) o Thm.concl_of) rewrite_rules
else rewrite_rules
val post = let val thy = Proof_Context.theory_of (empty_simpset ctxt) in
@@ -63,7 +63,7 @@
|> subst_only_free global_transformation
|> post
in
- if rule = Verit_Proof.input_rule then
+ if rule = Lethe_Proof.input_rule then
(case Symtab.lookup assumed id of
SOME (_, thm) => thm
| _ => raise Fail ("assumption " ^ @{make_string} id ^ " not found"))
@@ -77,20 +77,20 @@
|> Simplifier.simplify (empty_simpset ctxt addsimps rewrite_rules)
end
-fun add_used_asserts_in_step (Verit_Proof.VeriT_Replay_Node {prems,
+fun add_used_asserts_in_step (Lethe_Proof.Lethe_Replay_Node {prems,
subproof = (_, _, _, subproof), ...}) =
union (op =) (map_filter (try (snd o SMTLIB_Interface.role_and_index_of_assert_name)) prems @
flat (map (fn x => add_used_asserts_in_step x []) subproof))
fun remove_rewrite_rules_from_rules n =
- (fn (step as Verit_Proof.VeriT_Replay_Node {id, ...}) =>
+ (fn (step as Lethe_Proof.Lethe_Replay_Node {id, ...}) =>
(case try (snd o SMTLIB_Interface.role_and_index_of_assert_name) id of
NONE => SOME step
| SOME a => if a < n then NONE else SOME step))
fun replay_theorem_step rewrite_rules ll_defs assumed inputs proof_prems
- (step as Verit_Proof.VeriT_Replay_Node {id, rule, prems, bounds, args, insts,
+ (step as Lethe_Proof.Lethe_Replay_Node {id, rule, prems, bounds, args, insts,
subproof = (fixes, assms, input, subproof), concl, ...}) state =
let
val (proofs, stats, ctxt, concl_tranformation, global_transformation) = state
@@ -104,9 +104,9 @@
(ListPair.zip (map Free fixes, map Free (ListPair.zip (names, map snd fixes))))
val post = let val thy = Proof_Context.theory_of (empty_simpset ctxt) in
- Raw_Simplifier.rewrite_term thy ((if Verit_Proof.keep_raw_lifting rule then tl rewrite_rules else rewrite_rules)) []
+ Raw_Simplifier.rewrite_term thy ((if Lethe_Proof.keep_raw_lifting rule then tl rewrite_rules else rewrite_rules)) []
#> Object_Logic.atomize_term ctxt
- #> not (null ll_defs andalso Verit_Proof.keep_raw_lifting rule) ? SMTLIB_Isar.unlift_term ll_defs
+ #> not (null ll_defs andalso Lethe_Proof.keep_raw_lifting rule) ? SMTLIB_Isar.unlift_term ll_defs
#> SMTLIB_Isar.unskolemize_names ctxt
#> HOLogic.mk_Trueprop
end
@@ -130,9 +130,10 @@
(*for sko_ex and sko_forall, assumptions are in proofs', but the definition of the skolem
function is in proofs *)
val nthms = prems
+ |> filter_out Lethe_Proof.is_lethe_def
|> map (apsnd export_thm) o map_filter (Symtab.lookup (if (null subproof) then proofs else proofs'))
- val nthms' = (if Verit_Proof.is_skolemization rule
- then prems else [])
+ val nthms' = (if Lethe_Proof.is_skolemization rule then prems else [])
+ |> filter Lethe_Proof.is_lethe_def
|> map_filter (Symtab.lookup proofs)
val args = map (Term.subst_free concl_tranformation o subst_only_free global_transformation) args
val insts = Symtab.map (K (Term.subst_free concl_tranformation o subst_only_free global_transformation)) insts
@@ -148,21 +149,12 @@
SMT_Config.with_time_limit ctxt SMT_Config.reconstruction_step_timeout replay step
handle Timeout.TIMEOUT _ => raise SMT_Failure.SMT SMT_Failure.Time_Out
val stats' = Symtab.cons_list (rule, Time.toNanoseconds elapsed) stats
-(* val _ = ((Time.toMilliseconds elapsed > 10 andalso (rule = "cong")) ? @{print})
- ("WARNING slow " ^ id ^ @{make_string} rule ^ ": " ^ string_of_int (Time.toMilliseconds elapsed) ^ " "
- ^ @{make_string} (proof_prems @ local_inputs))
- val _ = ((Time.toMilliseconds elapsed > 10 andalso (rule = "cong")) ? @{print})
- ( (proof_prems @ local_inputs))
- val _ = ((Time.toMilliseconds elapsed > 10 andalso (rule = "cong")) ? @{print})
- thm
- val _ = ((Time.toMilliseconds elapsed > 40) ? @{print})
- ("WARNING slow " ^ id ^ @{make_string} rule ^ ": " ^ string_of_int (Time.toMilliseconds elapsed)) *)
val proofs = Symtab.update (id, (map fst bounds, thm)) proofs
in (proofs, stats', ctxt,
concl_tranformation, sub_global_rew) end
fun replay_definition_step rewrite_rules ll_defs _ _ _
- (Verit_Proof.VeriT_Replay_Node {id, declarations = raw_declarations, subproof = (_, _, _, subproof), ...}) state =
+ (Lethe_Proof.Lethe_Replay_Node {id, declarations = raw_declarations, subproof = (_, _, _, subproof), ...}) state =
let
val _ = if null subproof then ()
else raise (Fail ("unrecognized veriT proof, definition has a subproof"))
@@ -213,15 +205,15 @@
SMT_Config.with_time_limit ctxt SMT_Config.reconstruction_step_timeout replay
(fn _ => Method.insert_tac ctxt (map snd assms) THEN' Classical.fast_tac ctxt)
handle Timeout.TIMEOUT _ => raise SMT_Failure.SMT SMT_Failure.Time_Out
- val stats' = Symtab.cons_list (Verit_Proof.input_rule, Time.toNanoseconds elapsed) stats
+ val stats' = Symtab.cons_list (Lethe_Proof.input_rule, Time.toNanoseconds elapsed) stats
in
(thm, stats')
end
fun replay_step rewrite_rules ll_defs assumed inputs proof_prems
- (step as Verit_Proof.VeriT_Replay_Node {rule, ...}) state =
- if rule = Verit_Proof.veriT_def
+ (step as Lethe_Proof.Lethe_Replay_Node {rule, ...}) state =
+ if rule = Lethe_Proof.lethe_def
then replay_definition_step rewrite_rules ll_defs assumed inputs proof_prems step state
else replay_theorem_step rewrite_rules ll_defs assumed inputs proof_prems step state
@@ -240,13 +232,13 @@
val start0 = Timing.start ()
val (actual_steps, ctxt2) =
- Verit_Proof.parse_replay typs terms output ctxt
+ Lethe_Proof.parse_replay typs terms output ctxt
val parsing_time = Time.toNanoseconds (#elapsed (Timing.result start0))
fun step_of_assume (j, (_, th)) =
- Verit_Proof.VeriT_Replay_Node {
+ Lethe_Proof.Lethe_Replay_Node {
id = SMTLIB_Interface.assert_name_of_role_and_index SMT_Util.Axiom (id_of_index j),
- rule = Verit_Proof.input_rule,
+ rule = Lethe_Proof.input_rule,
args = [],
prems = [],
proof_ctxt = [],
@@ -267,9 +259,9 @@
val assm_steps = map step_of_assume used_assm_js
- fun extract (Verit_Proof.VeriT_Replay_Node {id, rule, concl, bounds, ...}) =
+ fun extract (Lethe_Proof.Lethe_Replay_Node {id, rule, concl, bounds, ...}) =
(id, rule, concl, map fst bounds)
- fun cond rule = rule = Verit_Proof.input_rule
+ fun cond rule = rule = Lethe_Proof.input_rule
val add_asssert = SMT_Replay.add_asserted Symtab.update Symtab.empty extract cond
val ((_, _), (ctxt3, assumed)) =
add_asssert outer_ctxt rewrite_rules (map (apfst fst) assms)
@@ -292,10 +284,10 @@
ctxt3
|> put_simpset (SMT_Replay.make_simpset ctxt3 [])
|> Config.put SAT.solver (Config.get ctxt3 SMT_Config.sat_solver)
- val len = Verit_Proof.number_of_steps actual_steps
+ val len = Lethe_Proof.number_of_steps actual_steps
fun steps_with_depth _ [] = []
- | steps_with_depth i (p :: ps) = (i + Verit_Proof.number_of_steps [p], p) ::
- steps_with_depth (i + Verit_Proof.number_of_steps [p]) ps
+ | steps_with_depth i (p :: ps) = (i + Lethe_Proof.number_of_steps [p], p) ::
+ steps_with_depth (i + Lethe_Proof.number_of_steps [p]) ps
val actual_steps = steps_with_depth 0 actual_steps
val start = Timing.start ()
val print_runtime_statistics = SMT_Replay.intermediate_statistics ctxt4 start len
@@ -307,7 +299,7 @@
fold (blockwise (replay_step rewrite_rules ll_defs assumed [] [])) actual_steps
(1, (assumed, stats, ctxt4, [], global_transformation))
val total = Time.toMilliseconds (#elapsed (Timing.result start))
- val (_, (_, Verit_Proof.VeriT_Replay_Node {id, ...})) = split_last actual_steps
+ val (_, (_, Lethe_Proof.Lethe_Replay_Node {id, ...})) = split_last actual_steps
val _ = print_runtime_statistics len
val thm_with_defs = Symtab.lookup proofs id |> the |> snd
|> singleton (Proof_Context.export ctxt5 outer_ctxt)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/Tools/SMT/verit_strategies.ML Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,126 @@
+(* Title: HOL/Tools/SMT/Verit_Proof.ML
+ Author: Mathias Fleury, ENS Rennes, MPI, JKU, Freiburg University
+
+VeriT proofs: parsing and abstract syntax tree.
+*)
+
+signature VERIT_STRATEGIES =
+sig
+ (*Strategy related*)
+ val veriT_strategy : string Config.T
+ val veriT_current_strategy : Context.generic -> string list
+ val all_veriT_stgies: Context.generic -> string list;
+
+ val select_veriT_stgy: string -> Context.generic -> Context.generic;
+ val valid_veriT_stgy: string -> Context.generic -> bool;
+ val verit_add_stgy: string * string list -> Context.generic -> Context.generic
+ val verit_rm_stgy: string -> Context.generic -> Context.generic
+
+ (*Global tactic*)
+ val verit_tac: Proof.context -> thm list -> int -> tactic
+ val verit_tac_stgy: string -> Proof.context -> thm list -> int -> tactic
+end;
+
+structure Verit_Strategies: VERIT_STRATEGIES =
+struct
+
+open SMTLIB_Proof
+
+val veriT_strategy_default_name = "default"; (*FUDGE*)
+val veriT_strategy_del_insts_name = "del_insts"; (*FUDGE*)
+val veriT_strategy_rm_insts_name = "ccfv_SIG"; (*FUDGE*)
+val veriT_strategy_ccfv_insts_name = "ccfv_threshold"; (*FUDGE*)
+val veriT_strategy_best_name = "best"; (*FUDGE*)
+
+val veriT_strategy_best = ["--index-sorts", "--index-fresh-sorts", "--triggers-new",
+ "--triggers-sel-rm-specific"];
+val veriT_strategy_del_insts = ["--index-sorts", "--index-fresh-sorts", "--ccfv-breadth",
+ "--inst-deletion", "--index-SAT-triggers", "--inst-deletion-loops", "--inst-deletion-track-vars",
+ "--inst-deletion", "--index-SAT-triggers"];
+val veriT_strategy_rm_insts = ["--index-SIG", "--triggers-new", "--triggers-sel-rm-specific"];
+val veriT_strategy_ccfv_insts = ["--index-sorts", "--index-fresh-sorts", "--triggers-new",
+ "--triggers-sel-rm-specific", "--triggers-restrict-combine", "--inst-deletion",
+ "--index-SAT-triggers", "--inst-deletion-loops", "--inst-deletion-track-vars", "--inst-deletion",
+ "--index-SAT-triggers", "--inst-sorts-threshold=100000", "--ematch-exp=10000000",
+ "--ccfv-index=100000", "--ccfv-index-full=1000"]
+
+val veriT_strategy_default = [];
+
+type verit_strategy = {default_strategy: string, strategies: (string * string list) list}
+fun mk_verit_strategy default_strategy strategies : verit_strategy = {default_strategy=default_strategy,strategies=strategies}
+
+val empty_data = mk_verit_strategy veriT_strategy_best_name
+ [(veriT_strategy_default_name, veriT_strategy_default),
+ (veriT_strategy_del_insts_name, veriT_strategy_del_insts),
+ (veriT_strategy_rm_insts_name, veriT_strategy_rm_insts),
+ (veriT_strategy_ccfv_insts_name, veriT_strategy_ccfv_insts),
+ (veriT_strategy_best_name, veriT_strategy_best)]
+
+fun merge_data ({strategies=strategies1,...}:verit_strategy,
+ {default_strategy,strategies=strategies2}:verit_strategy) : verit_strategy =
+ mk_verit_strategy default_strategy (AList.merge (op =) (op =) (strategies1, strategies2))
+
+structure Data = Generic_Data
+(
+ type T = verit_strategy
+ val empty = empty_data
+ val merge = merge_data
+)
+
+fun veriT_current_strategy ctxt =
+ let
+ val {default_strategy,strategies} = (Data.get ctxt)
+ in
+ AList.lookup (op=) strategies default_strategy
+ |> the
+ end
+
+val veriT_strategy = Attrib.setup_config_string \<^binding>\<open>smt_verit_strategy\<close> (K veriT_strategy_best_name);
+
+fun valid_veriT_stgy stgy context =
+ let
+ val {strategies,...} = Data.get context
+ in
+ AList.defined (op =) strategies stgy
+ end
+
+fun select_veriT_stgy stgy context =
+ let
+ val {strategies,...} = Data.get context
+ val upd = Data.map (K (mk_verit_strategy stgy strategies))
+ in
+ if not (AList.defined (op =) strategies stgy) then
+ error ("Trying to select unknown veriT strategy: " ^ quote stgy)
+ else upd context
+ end
+
+fun verit_add_stgy stgy context =
+ let
+ val {default_strategy,strategies} = Data.get context
+ in
+ Data.map
+ (K (mk_verit_strategy default_strategy (AList.update (op =) stgy strategies)))
+ context
+ end
+
+fun verit_rm_stgy stgy context =
+ let
+ val {default_strategy,strategies} = Data.get context
+ in
+ Data.map
+ (K (mk_verit_strategy default_strategy (AList.delete (op =) stgy strategies)))
+ context
+ end
+
+fun all_veriT_stgies context =
+ let
+ val {strategies,...} = Data.get context
+ in
+ map fst strategies
+ end
+
+val select_verit = SMT_Config.select_solver "verit"
+fun verit_tac ctxt = SMT_Solver.smt_tac (Config.put SMT_Config.native_bv false ((Context.proof_map select_verit ctxt)))
+fun verit_tac_stgy stgy ctxt = verit_tac (Context.proof_of (select_veriT_stgy stgy (Context.Proof ctxt)))
+
+end;
--- a/src/HOL/Tools/Sledgehammer/sledgehammer.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/Sledgehammer/sledgehammer.ML Fri Sep 02 13:41:55 2022 +0200
@@ -110,7 +110,7 @@
comment = ""}
val ress' =
preplay_isar_step ctxt chained timeout [] (mk_step meths)
- |> map (fn result as (meth, play_outcome) =>
+ |> map (fn (meth, play_outcome) =>
(case (minimize, play_outcome) of
(true, Played time) =>
let
@@ -137,8 +137,11 @@
(* Select best method if preplay succeeded *)
(best_meth, best_outcome as Played _, best_used_facts) :: _ =>
(best_used_facts, (best_meth, best_outcome))
- (* Otherwise select preferred method with dummy timeout *)
- | _ => (used_facts, (preferred_meth, Play_Timed_Out Time.zeroTime)))
+ (* Otherwise select preferred method *)
+ | (fst_meth, fst_outcome, _) :: _ =>
+ (used_facts, (preferred_meth,
+ if fst_meth = preferred_meth then fst_outcome else Play_Timed_Out Time.zeroTime))
+ | [] => (used_facts, (preferred_meth, Play_Timed_Out Time.zeroTime)))
|> apfst (filter_out (fn (_, (sc, _)) => sc = Chained))
fun launch_prover (params as {verbose, spy, slices, timeout, ...}) mode learn
@@ -266,7 +269,7 @@
else
(really_go ()
handle
- ERROR msg => (SH_Unknown, fn () => "Error: " ^ msg ^ "\n")
+ ERROR msg => (SH_Unknown, fn () => "Warning: " ^ msg ^ "\n")
| exn =>
if Exn.is_interrupt exn then Exn.reraise exn
else (SH_Unknown, fn () => "Internal error:\n" ^ Runtime.exn_message exn ^ "\n"))
@@ -297,10 +300,13 @@
cat_lines (map (fn (filter, facts) => string_of_facts filter facts) factss)
val default_slice_schedule =
- (* FUDGE (inspired by Seventeen evaluation) *)
- [cvc4N, zipperpositionN, vampireN, veritN, eN, cvc4N, zipperpositionN, cvc4N, vampireN, cvc4N,
- cvc4N, vampireN, cvc4N, iproverN, zipperpositionN, vampireN, vampireN, zipperpositionN, z3N,
- zipperpositionN, vampireN, iproverN, vampireN, cvc4N, z3N, z3N, cvc4N, cvc4N]
+ (* FUDGE (loosely inspired by Seventeen evaluation) *)
+ [cvc4N, zipperpositionN, vampireN, veritN, spassN, zipperpositionN, eN, cvc4N,
+ zipperpositionN, cvc4N, zipperpositionN, vampireN, cvc4N, cvc4N, vampireN,
+ cvc4N, iproverN, zipperpositionN, spassN, vampireN, zipperpositionN,
+ vampireN, zipperpositionN, z3N, zipperpositionN, vampireN, iproverN, spassN,
+ zipperpositionN, vampireN, cvc4N, zipperpositionN, z3N, z3N, cvc4N, cvc4N,
+ zipperpositionN]
fun schedule_of_provers provers num_slices =
let
@@ -495,7 +501,7 @@
| SH_Unknown => (the_default writeln writeln_result message; false)
| SH_Timeout => (the_default writeln writeln_result "No proof found"; false)
| SH_None => (the_default writeln writeln_result
- (if message = "" then "No proof found" else "Error: " ^ message);
+ (if message = "" then "No proof found" else "Warning: " ^ message);
false)))
end)
--- a/src/HOL/Tools/Sledgehammer/sledgehammer_atp_systems.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/Sledgehammer/sledgehammer_atp_systems.ML Fri Sep 02 13:41:55 2022 +0200
@@ -139,7 +139,7 @@
prem_role = Hypothesis,
good_slices =
(* FUDGE *)
- K [((1, 60, meshN), (THF (Monomorphic, {with_ite = false, with_let = false}, THF_Without_Choice), "mono_native_higher", keep_lamsN, false, ""))],
+ K [((2, 60, meshN), (THF (Monomorphic, {with_ite = false, with_let = false}, THF_Without_Choice), "mono_native_higher", keep_lamsN, false, ""))],
good_max_mono_iters = default_max_mono_iters - 1 (* FUDGE *),
good_max_new_mono_instances = default_max_new_mono_instances}
@@ -223,11 +223,11 @@
prem_role = Hypothesis,
good_slices =
(* FUDGE *)
- K [((1, 32, meshN), (TF0, "mono_native", liftingN, false, "")),
- ((1, 512, meshN), (TX0, "mono_native", liftingN, false, "")),
- ((1, 128, mashN), (TF0, "mono_native", combsN, false, "")),
- ((1, 1024, meshN), (TF0, "mono_native", liftingN, false, "")),
- ((1, 256, mepoN), (TF0, "mono_native", combsN, false, ""))],
+ K [((2, 32, meshN), (TF0, "mono_native", liftingN, false, "")),
+ ((2, 512, meshN), (TX0, "mono_native", liftingN, false, "")),
+ ((2, 128, mashN), (TF0, "mono_native", combsN, false, "")),
+ ((2, 1024, meshN), (TF0, "mono_native", liftingN, false, "")),
+ ((2, 256, mepoN), (TF0, "mono_native", combsN, false, ""))],
good_max_mono_iters = default_max_mono_iters,
good_max_new_mono_instances = default_max_new_mono_instances}
@@ -252,7 +252,7 @@
prem_role = Hypothesis,
good_slices =
(* FUDGE *)
- K [((1, 40, meshN), (THF (Monomorphic, {with_ite = false, with_let = false}, THF_Without_Choice), "mono_native_higher", keep_lamsN, false, ""))],
+ K [((2, 40, meshN), (THF (Monomorphic, {with_ite = false, with_let = false}, THF_Without_Choice), "mono_native_higher", keep_lamsN, false, ""))],
good_max_mono_iters = default_max_mono_iters - 1 (* FUDGE *),
good_max_new_mono_instances = default_max_new_mono_instances}
@@ -273,8 +273,8 @@
prem_role = Hypothesis,
good_slices =
(* FUDGE *)
- K [((3, 512, meshN), (TH0, "mono_native_higher", keep_lamsN, false, "")),
- ((3, 512, meshN), (TF0, "mono_native", liftingN, false, ""))],
+ K [((6, 512, meshN), (TH0, "mono_native_higher", keep_lamsN, false, "")),
+ ((6, 512, meshN), (TF0, "mono_native", liftingN, false, ""))],
good_max_mono_iters = default_max_mono_iters - 1 (* FUDGE *),
good_max_new_mono_instances = default_max_new_mono_instances}
@@ -297,7 +297,7 @@
prem_role = Hypothesis,
good_slices =
(* FUDGE *)
- K [((6, 256, meshN), (THF (Monomorphic, {with_ite = false, with_let = false}, THF_Without_Choice), "mono_native_higher", keep_lamsN, false, ""))],
+ K [((12, 256, meshN), (THF (Monomorphic, {with_ite = false, with_let = false}, THF_Without_Choice), "mono_native_higher", keep_lamsN, false, ""))],
good_max_mono_iters = default_max_mono_iters - 1 (* FUDGE *),
good_max_new_mono_instances = default_max_new_mono_instances}
@@ -334,14 +334,14 @@
prem_role = Conjecture,
good_slices =
(* FUDGE *)
- K [((1, 150, meshN), (format, "mono_native", combsN, true, "")),
- ((1, 500, meshN), (format, "mono_native", liftingN, true, spass_H2SOS)),
- ((1, 50, meshN), (format, "mono_native", liftingN, true, spass_H2LR0LT0)),
- ((1, 250, meshN), (format, "mono_native", combsN, true, spass_H2NuVS0)),
- ((1, 1000, mepoN), (format, "mono_native", liftingN, true, spass_H1SOS)),
- ((1, 150, meshN), (format, "poly_guards??", liftingN, false, spass_H2NuVS0Red2)),
- ((1, 300, meshN), (format, "mono_native", combsN, true, spass_H2SOS)),
- ((1, 100, meshN), (format, "mono_native", combs_and_liftingN, true, spass_H2))],
+ K [((2, 150, meshN), (format, "mono_native", combsN, true, "")),
+ ((2, 500, meshN), (format, "mono_native", liftingN, true, spass_H2SOS)),
+ ((2, 50, meshN), (format, "mono_native", liftingN, true, spass_H2LR0LT0)),
+ ((2, 250, meshN), (format, "mono_native", combsN, true, spass_H2NuVS0)),
+ ((2, 1000, mepoN), (format, "mono_native", liftingN, true, spass_H1SOS)),
+ ((2, 150, meshN), (format, "poly_guards??", liftingN, false, spass_H2NuVS0Red2)),
+ ((2, 300, meshN), (format, "mono_native", combsN, true, spass_H2SOS)),
+ ((2, 100, meshN), (format, "mono_native", combs_and_liftingN, true, spass_H2))],
good_max_mono_iters = default_max_mono_iters,
good_max_new_mono_instances = default_max_new_mono_instances}
end
@@ -380,14 +380,14 @@
prem_role = Hypothesis,
good_slices =
(* FUDGE *)
- K [((1, 512, meshN), (TX1, "mono_native_fool", combsN, false, sosN)),
- ((1, 1024, meshN), (TX1, "mono_native_fool", liftingN, false, sosN)),
- ((1, 256, mashN), (TX1, "mono_native_fool", liftingN, false, no_sosN)),
- ((1, 512, mepoN), (TF1, "poly_native", liftingN, false, no_sosN)),
- ((1, 16, meshN), (TX1, "mono_native_fool", liftingN, false, no_sosN)),
- ((1, 32, meshN), (TX1, "mono_native_fool", combsN, false, no_sosN)),
- ((1, 64, meshN), (TX1, "mono_native_fool", combs_or_liftingN, false, no_sosN)),
- ((1, 128, meshN), (TX1, "mono_native_fool", liftingN, false, no_sosN))],
+ K [((2, 512, meshN), (TX1, "mono_native_fool", combsN, false, sosN)),
+ ((2, 1024, meshN), (TX1, "mono_native_fool", liftingN, false, sosN)),
+ ((2, 256, mashN), (TX1, "mono_native_fool", liftingN, false, no_sosN)),
+ ((2, 512, mepoN), (TF1, "poly_native", liftingN, false, no_sosN)),
+ ((2, 16, meshN), (TX1, "mono_native_fool", liftingN, false, no_sosN)),
+ ((2, 32, meshN), (TX1, "mono_native_fool", combsN, false, no_sosN)),
+ ((2, 64, meshN), (TX1, "mono_native_fool", combs_or_liftingN, false, no_sosN)),
+ ((2, 128, meshN), (TX1, "mono_native_fool", liftingN, false, no_sosN))],
good_max_mono_iters = default_max_mono_iters,
good_max_new_mono_instances = 2 * default_max_new_mono_instances (* FUDGE *)}
@@ -411,12 +411,21 @@
known_szs_status_failures,
prem_role = Hypothesis,
good_slices =
- K [((1, 1024, meshN), (format, "mono_native_higher_fool", keep_lamsN, false, "--mode=ho-pragmatic --tptp-def-as-rewrite --rewrite-before-cnf=true --max-inferences=1 --ho-unif-max-depth=1 --ho-max-elims=0 --ho-max-app-projections=0 --ho-max-rigid-imitations=1 --ho-max-identifications=0 --boolean-reasoning=bool-hoist --bool-hoist-simpl=true --bool-select=LI --recognize-injectivity=true --ext-rules=ext-family --ext-rules-max-depth=1 --ho-choice-inst=true --ho-prim-enum=none --ho-elim-leibniz=0 --interpret-bool-funs=true --try-e=\"$E_HOME/eprover\" --tmp-dir=\"$ISABELLE_TMP_PREFIX\" --ho-unif-level=pragmatic-framework --select=bb+e-selection2 --post-cnf-lambda-lifting=true -q \"4|prefer-sos|pnrefined(2,1,1,1,2,2,2)\" -q \"6|prefer-processed|conjecture-relative-struct(1.5,3.5,2,3)\" -q \"1|const|fifo\" -q \"4|prefer-ground|orient-lmax(2,1,2,1,1)\" -q \"4|defer-sos|conjecture-relative-struct(1,5,2,3)\" --avatar=off --recognize-injectivity=true --ho-neg-ext=true --e-timeout=2 --ho-pattern-decider=true --ho-fixpoint-decider=true --e-max-derived=50 --ignore-orphans=true --e-auto=true --presaturate=true --e-call-point=0.1")),
- ((1, 128, mepoN), (format, "mono_native_higher_fool", keep_lamsN, false, "-nc --tptp-def-as-rewrite --rewrite-before-cnf=true --mode=ho-competitive --boolean-reasoning=simpl-only --ext-rules=off --ho-prim-enum=full --ho-prim-max=1 --avatar=off --recognize-injectivity=true --ho-elim-leibniz=4 --ho-unif-level=full-framework --no-max-vars -q \"2|prefer-goals|conjecture-relative-e(0.5,1,100,100,100,100,1.5,1.5,1)\" -q \"4|const|conjecture-relative-e(0.1,1,100,100,100,100,1.5,1.5,1.5)\" -q \"1|prefer-processed|fifo\" -q \"1|prefer-non-goals|conjecture-relative-e(0.5,1,100,100,100,100,1.5,1.5,1.5)\" -q \"4|prefer-sos|pnrefined(1,1,1,1,2,1.5,2)\" --select=ho-selection5 --ho-choice-inst=true --try-e=\"$E_HOME/eprover\" --tmp-dir=\"$ISABELLE_TMP_PREFIX\" --e-timeout=5 --e-call-point=0.25 --e-auto=true --sine=50 --sine-tolerance=2 --sine-depth-max=4 --sine-depth-min=1 --e-max-derived=96 --e-encode-lambdas=lift --scan-clause-ac=false --kbo-weight-fun=arity0 --prec-gen-fun=invfreq_conj")),
- ((1, 512, mashN), (format, "mono_native_higher_fool", keep_lamsN, false, "--mode=ho-pragmatic --tptp-def-as-rewrite --rewrite-before-cnf=true --mode=ho-competitive --boolean-reasoning=simpl-only --ext-rules=ext-family --ext-rules-max-depth=1 --ho-prim-enum=none --avatar=off --recognize-injectivity=true --ho-elim-leibniz=1 --ho-unif-level=pragmatic-framework --no-max-vars --max-inferences=2 --ho-unif-max-depth=1 -q \"6|prefer-sos|pnrefined(1,1,1,2,2,2,0.5)\" -q \"6|const|conjecture-relative-var(1.02,l,f)\" -q \"1|prefer-processed|fifo\" -q \"1|prefer-non-goals|conjecture-relative-var(1,l,f)\" -q \"4|prefer-easy-ho|conjecture-relative-var(1.01,s,f)\" --select=e-selection16 --ho-choice-inst=true --try-e=\"$E_HOME/eprover\" --tmp-dir=\"$ISABELLE_TMP_PREFIX\" --e-timeout=3 --e-auto=true --sine=50 --sine-tolerance=1.0 --sine-depth-max=3 --sine-depth-min=1 --sine-trim-implications=true --ho-unif-level=pragmatic-framework --e-encode-lambdas=lift --scan-clause-ac=false --kbo-weight-fun=lambda-def-invfreqrank --e-call-point=0.1")),
- ((1, 32, meshN), (format, "mono_native_higher_fool", keep_lamsN, false, "--mode=ho-pragmatic -nc --tptp-def-as-rewrite --rewrite-before-cnf=true --mode=ho-competitive --boolean-reasoning=simpl-only --ext-rules=ext-family --ext-rules-max-depth=1 --ho-prim-enum=none --avatar=off --recognize-injectivity=true --ho-elim-leibniz=1 --ho-unif-level=pragmatic-framework --no-max-vars --max-inferences=4 --ho-max-app-projections=1 --ho-max-elims=0 --ho-max-rigid-imitations=2 --ho-max-identifications=0 --ho-unif-max-depth=3 -q \"6|prefer-sos|pnrefined(1,1,1,2,2,2,0.5)\" -q \"6|const|conjecture-relative-var(1.02,l,f)\" -q \"1|prefer-processed|fifo\" -q \"1|prefer-non-goals|conjecture-relative-var(1,l,f)\" -q \"4|prefer-easy-ho|conjecture-relative-var(1.01,s,f)\" --select=e-selection7 --ho-choice-inst=true --try-e=\"$E_HOME/eprover\" --tmp-dir=\"$ISABELLE_TMP_PREFIX\" --e-timeout=7 --sine=50 --sine-tolerance=1 --sine-depth-max=2 --sine-depth-min=1 --e-max-derived=64 --sine-ignore-k-most-common-syms=2 --sine-trim-implications=true --e-encode-lambdas=lift --scan-clause-ac=false --lambdasup=0 --kbo-weight-fun=lambda-def-invfreqrank --demod-in-var-args=true --bool-demod=true --lambda-demod=true --e-call-point=0.1 --lazy-cnf-kind=simp")),
- ((1, 64, meshN), (format, "mono_native_higher_fool", keep_lamsN, false, "--mode=ho-comb-complete --boolean-reasoning=simpl-only --ext-rules=off --kbo-weight-fun=lambda-def-sqarity --ho-prim-enum=none --tptp-def-as-rewrite -q \"4|prefer-sos|orient-lmax(2,1,2,1,1)\" -q \"4|defer-sos|conjecture-relative-var(1,s,f)\" -q \"3|const|default\" -q \"1|prefer-processed|fifo\" --ho-elim-leibniz=1 --select=NoSelection --solve-formulas=true --lazy-cnf=true --lazy-cnf-kind=simp --lazy-cnf-renaming-threshold=8 --sine=60 --sine-tolerance=2 --sine-depth-max=5 --sine-depth-min=1 --try-e=\"$E_HOME/eprover\" --tmp-dir=\"$ISABELLE_TMP_PREFIX\" --e-timeout=3 --e-auto=true --e-max-derived=50 --e-encode-lambdas=ignore --scan-clause-ac=false --presaturate=true --comb-b-penalty=3 --comb-c-penalty=3 --comb-k-penalty=1 --comb-s-penalty=5 --subvarsup=false --e-call-point=0.15 --lazy-cnf-kind=simp --trigger-bool-ind=1")),
- ((1, 256, meshN), (format, "mono_native_higher_fool", keep_lamsN, false, "--mode=ho-pragmatic --boolean-reasoning=simpl-only --ho-unif-max-depth=0 --ho-prim-enum=none -q \"2|prefer-ho-steps|conjecture-relative-e(0.1,0.5,100,100,100,100,1.5,1.5,1.5)\" -q \"1|prefer-sos|pnrefined(1,1,1,2,2,2,0.5)\" -q \"2|prefer-ground|default\" -q \"2|prefer-empty-trail|conjecture-relative-e(0.1,0.5,100,100,100,100,1.5,1.5,1.5)\" -q \"1|prefer-processed|fifo\" --select=bb+e-selection7 --ho-pattern-decider=false --ho-fixpoint-decider=true --ho-solid-decider=false --sine=150 --sine-tolerance=2 --sine-depth-max=3 --sine-depth-min=1 --prec-gen-fun=invfreqhack --lazy-cnf=true --lazy-cnf-kind=simp --lazy-cnf-renaming-threshold=2 --fluid-log-hoist=false --tptp-def-as-rewrite --rewrite-before-cnf=true --ho-prim-enum=eq --ho-prim-enum-add-var=true --ho-prim-max=1 --ho-prim-enum-early-bird=true -o tptp --avatar=eager --split-only-ground=true"))],
+ K [((1, 512, meshN), (format, "mono_native_higher_fool", keep_lamsN, false, "--mode=ho-pragmatic --tptp-def-as-rewrite --rewrite-before-cnf=true --max-inferences=1 --ho-unif-max-depth=1 --ho-max-elims=0 --ho-max-app-projections=0 --ho-max-rigid-imitations=1 --ho-max-identifications=0 --boolean-reasoning=bool-hoist --bool-hoist-simpl=true --bool-select=LI --recognize-injectivity=true --ext-rules=ext-family --ext-rules-max-depth=1 --ho-choice-inst=true --ho-prim-enum=none --ho-elim-leibniz=0 --interpret-bool-funs=true --try-e=\"$E_HOME/eprover\" --tmp-dir=\"$ISABELLE_TMP_PREFIX\" --ho-unif-level=pragmatic-framework --select=bb+e-selection2 --post-cnf-lambda-lifting=true -q \"4|prefer-sos|pnrefined(2,1,1,1,2,2,2)\" -q \"6|prefer-processed|conjecture-relative-struct(1.5,3.5,2,3)\" -q \"1|const|fifo\" -q \"4|prefer-ground|orient-lmax(2,1,2,1,1)\" -q \"4|defer-sos|conjecture-relative-struct(1,5,2,3)\" --avatar=off --recognize-injectivity=true --ho-neg-ext=true --e-timeout=2 --ho-pattern-decider=true --ho-fixpoint-decider=true --e-max-derived=50 --ignore-orphans=true --e-auto=true --presaturate=true --e-call-point=0.1")), (* sh5_sh1.sh *)
+ ((1, 1024, meshN), (format, "mono_native_higher_fool", keep_lamsN, false, "--mode=ho-pragmatic --tptp-def-as-rewrite --rewrite-before-cnf=true --mode=ho-competitive --boolean-reasoning=simpl-only --ext-rules=ext-family --ext-rules-max-depth=1 --ho-prim-enum=none --avatar=off --recognize-injectivity=true --ho-elim-leibniz=1 --ho-unif-level=pragmatic-framework --no-max-vars --max-inferences=2 --ho-unif-max-depth=1 -q \"6|prefer-sos|pnrefined(1,1,1,2,2,2,0.5)\" -q \"6|const|conjecture-relative-var(1.02,l,f)\" -q \"1|prefer-processed|fifo\" -q \"1|prefer-non-goals|conjecture-relative-var(1,l,f)\" -q \"4|prefer-easy-ho|conjecture-relative-var(1.01,s,f)\" --select=e-selection16 --ho-choice-inst=true --try-e=\"$E_HOME/eprover\" --tmp-dir=\"$ISABELLE_TMP_PREFIX\" --e-timeout=3 --e-auto=true --sine=50 --sine-tolerance=1.0 --sine-depth-max=3 --sine-depth-min=1 --sine-trim-implications=true --ho-unif-level=pragmatic-framework --e-encode-lambdas=lift --scan-clause-ac=false --kbo-weight-fun=lambda-def-invfreqrank --e-call-point=0.1")), (* sh8_shallow_sine.sh *)
+ ((1, 256, mepoN), (format, "mono_native_higher_fool", keep_lamsN, false, "-nc --tptp-def-as-rewrite --rewrite-before-cnf=true --mode=ho-competitive --boolean-reasoning=simpl-only --ext-rules=off --ho-prim-enum=full --ho-prim-max=1 --avatar=off --recognize-injectivity=true --ho-elim-leibniz=4 --ho-unif-level=full-framework --no-max-vars -q \"2|prefer-goals|conjecture-relative-e(0.5,1,100,100,100,100,1.5,1.5,1)\" -q \"4|const|conjecture-relative-e(0.1,1,100,100,100,100,1.5,1.5,1.5)\" -q \"1|prefer-processed|fifo\" -q \"1|prefer-non-goals|conjecture-relative-e(0.5,1,100,100,100,100,1.5,1.5,1.5)\" -q \"4|prefer-sos|pnrefined(1,1,1,1,2,1.5,2)\" --select=ho-selection5 --ho-choice-inst=true --try-e=\"$E_HOME/eprover\" --tmp-dir=\"$ISABELLE_TMP_PREFIX\" --e-timeout=5 --e-call-point=0.25 --e-auto=true --sine=50 --sine-tolerance=2 --sine-depth-max=4 --sine-depth-min=1 --e-max-derived=96 --e-encode-lambdas=lift --scan-clause-ac=false --kbo-weight-fun=arity0 --prec-gen-fun=invfreq_conj")), (* sh10_new_c.s3.sh *)
+ ((1, 512, mepoN), (format, "mono_native_higher_fool", keep_lamsN, false, "--mode=ho-pragmatic -nc --tptp-def-as-rewrite --rewrite-before-cnf=true --mode=ho-competitive --boolean-reasoning=simpl-only --ext-rules=ext-family --ext-rules-max-depth=1 --ho-prim-enum=none --avatar=off --recognize-injectivity=true --ho-elim-leibniz=1 --ho-unif-level=pragmatic-framework --no-max-vars --max-inferences=4 --ho-max-app-projections=1 --ho-max-elims=0 --ho-max-rigid-imitations=2 --ho-max-identifications=0 --ho-unif-max-depth=3 -q \"6|prefer-sos|pnrefined(1,1,1,2,2,2,0.5)\" -q \"6|const|conjecture-relative-var(1.02,l,f)\" -q \"1|prefer-processed|fifo\" -q \"1|prefer-non-goals|conjecture-relative-var(1,l,f)\" -q \"4|prefer-easy-ho|conjecture-relative-var(1.01,s,f)\" --select=e-selection7 --ho-choice-inst=true --try-e=\"$E_HOME/eprover\" --tmp-dir=\"$ISABELLE_TMP_PREFIX\" --e-timeout=7 --sine=50 --sine-tolerance=1 --sine-depth-max=2 --sine-depth-min=1 --e-max-derived=64 --sine-ignore-k-most-common-syms=2 --sine-trim-implications=true --e-encode-lambdas=lift --scan-clause-ac=false --lambdasup=0 --kbo-weight-fun=lambda-def-invfreqrank --demod-in-var-args=true --bool-demod=true --lambda-demod=true --e-call-point=0.1")), (* sh10_c_ic.sh *)
+ ((1, 512, meshN), (format, "mono_native_higher_fool", keep_lamsN, false, "--mode=ho-comb-complete --boolean-reasoning=simpl-only --ext-rules=off --kbo-weight-fun=lambda-def-sqarity --ho-prim-enum=none --tptp-def-as-rewrite -q \"4|prefer-sos|orient-lmax(2,1,2,1,1)\" -q \"4|defer-sos|conjecture-relative-var(1,s,f)\" -q \"3|const|default\" -q \"1|prefer-processed|fifo\" --ho-elim-leibniz=1 --select=NoSelection --solve-formulas=true --lazy-cnf=true --lazy-cnf-kind=simp --lazy-cnf-renaming-threshold=8 --sine=60 --sine-tolerance=2 --sine-depth-max=5 --sine-depth-min=1 --try-e=\"$E_HOME/eprover\" --tmp-dir=\"$ISABELLE_TMP_PREFIX\" --e-timeout=3 --e-auto=true --e-max-derived=50 --e-encode-lambdas=lift --scan-clause-ac=false --presaturate=true --comb-b-penalty=3 --comb-c-penalty=3 --comb-k-penalty=1 --comb-s-penalty=5 --subvarsup=false --e-call-point=0.15")), (* sh8_b.comb.sh (modified) *)
+ ((1, 1024, mashN), (format, "mono_native_higher_fool", keep_lamsN, false, "--mode=ho-pragmatic --boolean-reasoning=simpl-only --ho-unif-max-depth=0 --ho-prim-enum=none -q \"2|prefer-ho-steps|conjecture-relative-e(0.1,0.5,100,100,100,100,1.5,1.5,1.5)\" -q \"1|prefer-sos|pnrefined(1,1,1,2,2,2,0.5)\" -q \"2|prefer-ground|default\" -q \"2|prefer-empty-trail|conjecture-relative-e(0.1,0.5,100,100,100,100,1.5,1.5,1.5)\" -q \"1|prefer-processed|fifo\" --select=bb+e-selection7 --ho-pattern-decider=false --ho-fixpoint-decider=true --ho-solid-decider=false --sine=150 --sine-tolerance=2 --sine-depth-max=3 --sine-depth-min=1 --prec-gen-fun=invfreqhack --lazy-cnf=true --lazy-cnf-kind=simp --lazy-cnf-renaming-threshold=2 --fluid-log-hoist=false --tptp-def-as-rewrite --rewrite-before-cnf=true --ho-prim-enum=eq --ho-prim-enum-add-var=true --ho-prim-max=1 --ho-prim-enum-early-bird=true --avatar=eager --split-only-ground=true")), (* sh5_add_var_l_av.sh *)
+ ((1, 256, mashN), (format, "mono_native_higher_fool", keep_lamsN, false, "--mode=ho-pragmatic --max-inferences=4 --ho-max-app-projections=1 --ho-max-elims=0 --ho-max-rigid-imitations=2 --ho-max-identifications=0 --ho-unif-max-depth=2 --max-inferences=3 --boolean-reasoning=bool-hoist --bool-select=LO --ext-rules=off --kbo-weight-fun=lambda-def-invfreqrank --ho-prim-enum=none --ho-unif-level=pragmatic-framework -q \"1|prefer-sos|conjecture-relative-var(1.01,s,f)\" -q \"4|const|conjecture-relative-var(1.05,l,f)\" -q \"1|prefer-processed|fifo\" -q \"1|prefer-non-goals|conjecture-relative-var(1.02,l,f)\" -q \"4|prefer-sos|pnrefined(3,2,3,2,2,1.5,2)\" --ho-elim-leibniz=1 --ho-fixpoint-decider=true --ho-pattern-decider=true --ho-solid-decider=true --select=e-selection2 --solve-formulas=true --lambdasup=0 --try-e=\"$E_HOME/eprover\" --tmp-dir=\"$ISABELLE_TMP_PREFIX\" --e-timeout=3 --e-max-derived=48 --e-encode-lambdas=lift --presaturate=true --prec-gen-fun=invfreq --e-call-point=0.2 --e-auto=true --sine-trim-implications=true")), (* sh10_e_lift.sh *)
+ ((1, 512, mepoN), (format, "mono_native_higher_fool", keep_lamsN, false, "-nc --tptp-def-as-rewrite --mode=ho-pragmatic --max-inferences=4 --ho-max-app-projections=1 --ho-max-elims=0 --ho-max-rigid-imitations=1 --ho-max-identifications=0 --ho-unif-max-depth=2 --boolean-reasoning=simpl-only --ext-rules=off --kbo-weight-fun=lambda-def-const --ho-prim-enum=neg --ho-prim-enum-early-bird=true --tptp-def-as-rewrite --rewrite-before-cnf=true --ho-unif-level=pragmatic-framework --ho-unif-max-depth=1 --sine=50 --sine-tolerance=1.0 --sine-depth-max=3 --sine-depth-min=1 --sine-trim-implications=true -q \"4|prefer-sos|orient-lmax(2,1,2,1,1)\" -q \"4|defer-sos|conjecture-relative-var(1,s,f)\" -q \"3|const|default\" -q \"1|prefer-processed|fifo\" --ho-elim-leibniz=1 --ho-fixpoint-decider=true --ho-pattern-decider=true --ho-solid-decider=false --select=e-selection10 --solve-formulas=true --sup-at-vars=false --sup-at-var-headed=false --sup-from-var-headed=true --lazy-cnf=true --lazy-cnf-kind=simp --lazy-cnf-renaming-threshold=4 --try-e=\"$E_HOME/eprover\" --tmp-dir=\"$ISABELLE_TMP_PREFIX\" --e-timeout=2 --e-auto=true --e-max-derived=32 --e-encode-lambdas=lift --scan-clause-ac=false --presaturate=true --e-call-point=0.16")), (* sh5_shallow_sine.sh *)
+ ((1, 512, mashN), (format, "mono_native_higher_fool", keep_lamsN, false, "-nc --tptp-def-as-rewrite --rewrite-before-cnf=true --mode=ho-competitive --boolean-reasoning=bool-hoist --ext-rules=off --recognize-injectivity=true --ho-unif-level=full-framework -q \"4|prefer-goals|pnrefined(1,1,1,2,2,2,0.5)\" -q \"1|prefer-fo|conjecture-relative-var(1.02,l,f)\" -q \"1|prefer-non-goals|conjecture-relative-var(1,l,f)\" -q \"4|prefer-ho-steps|conjecture-relative-var(1.01,s,f)\" -q \"1|prefer-processed|fifo\" --select=bb+ho-selection --scan-clause-ac=false --kbo-weight-fun=invfreqrank --fluidsup=true --boolean-reasoning=bool-hoist --fluid-log-hoist=true --fluid-hoist=true --ite-axioms=true --lazy-cnf=true --ho-solid-decider=true --ho-fixpoint-decider=true --bool-select=\"sel1(pos_ctx)\" --try-e=\"$E_HOME/eprover\" --tmp-dir=\"$ISABELLE_TMP_PREFIX\" --e-timeout=2 --e-auto=true --e-call-point=0.35 --avatar=off --e-max-derived=50")), (* sh5_e_short1.sh *)
+ ((1, 1024, meshN), (format, "mono_native_higher_fool", keep_lamsN, false, "--mode=ho-pragmatic --tptp-def-as-rewrite --rewrite-before-cnf=true --boolean-reasoning=simpl-only --select=e-selection12 --prec-gen-fun=invfreq_conj --ord=lambda_kbo --ho-unif-level=full-framework --ho-pattern-decider=true --ho-solid-decider=false --ho-fixpoint-decider=true --lazy-cnf=true --lazy-cnf-kind=simp --lazy-cnf-renaming-threshold=1 --sine=100 --sine-depth-min=1 --sine-depth-max=5 --sine-tolerance=1.5 -q \"1|prefer-sos|default\" -q \"8|prefer-processed|conjecture-relative-var(1,l,f)\" -q \"1|prefer-processed|fifo\" -q \"1|prefer-lambdas|explore\" -q \"1|prefer-non-goals|explore\" -q \"1|prefer-processed|conjecture-relative-var(1,s,f)\" --kbo-weight-fun=arity0")), (* sh5_32.sh *)
+ ((1, 256, meshN), (format, "mono_native_higher_fool", keep_lamsN, false, "--mode=ho-pragmatic --boolean-reasoning=simpl-only --ho-unif-max-depth=2 --ho-max-app-projections=0 --ho-max-rigid-imitations=1 --ho-max-elims=0 --ho-max-identifications=1 --max-inferences=3 --ext-rules=off --recognize-injectivity=true --ho-prim-enum=none --ho-choice-inst=true -q \"3|prefer-fo|conjecture-relative-var(1.02,l,f)\" -q \"3|prefer-sos|pnrefined(1,1,1,2,2,2,0.5)\" -q \"2|prefer-ground|orient-lmax(2,1,2,1,1)\" -q \"1|prefer-processed|fifo\" --select=MaxGoalNS --sine=60 --sine-tolerance=1.5 --sine-depth-max=3 --sine-depth-min=1 --prec-gen-fun=invfreqhack --lazy-cnf=true --lazy-cnf-kind=simp --lazy-cnf-renaming-threshold=3 --kbo-weight-fun-from-precedence=true --kbo-weight-fun-from-precedence-rank=5 --trigger-bool-inst=1 --avatar=lazy --tptp-def-as-rewrite --rewrite-before-cnf=true --sup-from-var-headed=false --sup-at-vars=false")), (* sh5_sh4.sh *)
+ ((1, 512, mashN), (format, "mono_native_higher_fool", keep_lamsN, false, "--tptp-def-as-rewrite --rewrite-before-cnf=true --mode=lambda-free-intensional --check-lambda-free=false --boolean-reasoning=simpl-only --post-cnf-lambda-lifting=true --ext-rules=off --ho-prim-enum=none --recognize-injectivity=true --no-max-vars --select=e-selection8 --prec-gen-fun=invfreq --kbo-weight-fun=invfreqrank --kbo-const-weight=2 --ord=lambdafree_kbo --ignore-orphans=true -q \"1|prefer-sos|conjecture-relative-struct(1.5,3.5,2,3)\" -q \"1|const|conj_pref_weight(0.5,100,0.2,0.2,4)\" -q \"1|prefer-processed|fifo\" -q \"1|prefer-non-goals|conjecture-relative-e(0.3,0.25,100,100,100,100,1.5,1.5,1)\" -q \"1|prefer-sos|pnrefined(3,2,3,2,2,1.5,2)\" --lazy-cnf=true --lazy-cnf-renaming-threshold=2")), (* sh5_lifting2.sh *)
+ ((1, 512, meshN), (format, "mono_native_higher_fool", keep_lamsN, false, "-nc --tptp-def-as-rewrite --rewrite-before-cnf=true --tptp-rewrite-formulas-only=true --mode=ho-pragmatic --boolean-reasoning=simpl-only --ext-rules=ext-family --ext-rules-max-depth=1 --ho-prim-enum=neg --ho-prim-max=1 --recognize-injectivity=true --ho-elim-leibniz=1 --ho-unif-level=pragmatic-framework --no-max-vars -q \"1|prefer-sos|conjecture-relative-var(1.02,l,f)\" -q \"4|const|conjecture-relative-var(1,s,f)\" -q \"1|prefer-processed|fifo\" -q \"1|prefer-non-goals|conjecture-relative-var(1,l,f)\" -q \"4|prefer-sos|pnrefined(2,1,1,1,2,2,2)\" --select=e-selection7 --ho-choice-inst=true --try-e=\"$E_HOME/eprover\" --tmp-dir=\"$ISABELLE_TMP_PREFIX\" --e-timeout=2 --e-auto=true --sine=50 --sine-tolerance=10 --sine-depth-max=5 --sine-depth-min=1 --e-max-derived=64 --e-encode-lambdas=lift --scan-clause-ac=false --prec-gen-fun=invfreq_conj --ord=lambda_kbo --solid-subsumption=true --ignore-orphans=true --e-call-point=0.2")), (* sh5_noforms.sh *)
+ ((1, 1024, meshN), (format, "mono_native_higher_fool", keep_lamsN, false, "--mode=ho-pragmatic --tptp-def-as-rewrite --rewrite-before-cnf=true --max-inferences=4 --ho-unif-max-depth=3 --ho-max-elims=0 --ho-max-app-projections=1 --ho-max-identifications=0 --ho-max-rigid-imitations=2 --ho-unif-level=pragmatic-framework --boolean-reasoning=simpl-only --kbo-weight-fun=freqrank --ext-rules=ext-family --ext-rules-max-depth=2 --ho-prim-enum=eq --ho-prim-max=2 --interpret-bool-funs=false -q \"2|prefer-goals|default\" -q \"8|prefer-sos|conjecture-relative-var(1,l,f)\" -q \"1|prefer-processed|fifo\" -q \"1|prefer-lambdas|explore\" -q \"1|prefer-non-goals|explore\" -q \"1|prefer-processed|conjecture-relative-var(1,s,f)\" --recognize-injectivity=true --ho-selection-restriction=none --select=ho-selection2 --solve-formulas=true")), (* sh8_old_zip1.sh *)
+ ((1, 256, mashN), (format, "mono_native_higher_fool", keep_lamsN, false, "--mode=ho-pragmatic --boolean-reasoning=simpl-only --tptp-def-as-rewrite --rewrite-before-cnf=true --kbo-weight-fun=freqrank -q \"1|prefer-sos|default\" -q \"1|prefer-goals|conjecture-relative-var(1.03,s,f)\" -q \"1|prefer-non-goals|default\" -q \"5|const|conjecture-relative-var(1.01,l,f)\" -q \"1|prefer-processed|fifo\" -q \"1|const|conjecture-relative-var(1.05,l,f)\" -q \"1|defer-sos|conjecture-relative-var(1.1,s,f)\" --select=e-selection9 --recognize-injectivity=true --ho-choice-inst=false --ho-selection-restriction=none --sine=50 --sine-tolerance=3 --sine-depth-max=3 --sine-depth-min=1 --eq-encode=true --avatar=eager --sine-trim-implications=true"))], (* sh5_sh.eqenc.sh *)
good_max_mono_iters = default_max_mono_iters,
good_max_new_mono_instances = default_max_new_mono_instances}
end
@@ -528,7 +537,7 @@
known_failures = known_szs_status_failures,
prem_role = prem_role,
good_slices =
- K [((1, 256, "mepo"), (format, type_enc,
+ K [((2, 256, "mepo"), (format, type_enc,
if is_format_higher_order format then keep_lamsN else combsN, uncurried_aliases, ""))],
good_max_mono_iters = default_max_mono_iters,
good_max_new_mono_instances = default_max_new_mono_instances}
--- a/src/HOL/Tools/Sledgehammer/sledgehammer_commands.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/Sledgehammer/sledgehammer_commands.ML Fri Sep 02 13:41:55 2022 +0200
@@ -70,7 +70,7 @@
("try0", "true"),
("smt_proofs", "true"),
("minimize", "true"),
- ("slices", string_of_int (6 * Multithreading.max_threads ())),
+ ("slices", string_of_int (12 * Multithreading.max_threads ())),
("preplay_timeout", "1")]
val alias_params =
--- a/src/HOL/Tools/Sledgehammer/sledgehammer_isar.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/Sledgehammer/sledgehammer_isar.ML Fri Sep 02 13:41:55 2022 +0200
@@ -54,7 +54,7 @@
val vampire_skolemisation_rule = "skolemisation"
val veriT_la_generic_rule = "la_generic"
val veriT_simp_arith_rule = "simp_arith"
-val veriT_skolemize_rules = Verit_Proof.skolemization_steps
+val veriT_skolemize_rules = Lethe_Proof.skolemization_steps
val z3_skolemize_rule = Z3_Proof.string_of_rule Z3_Proof.Skolemize
val z3_th_lemma_rule_prefix = Z3_Proof.string_of_rule (Z3_Proof.Th_Lemma "")
val zipperposition_cnf_rule = "cnf"
@@ -162,7 +162,7 @@
fun massage_methods (meths as meth :: _) =
if not try0 then [meth]
- else if smt_proofs then SMT_Method SMT_Z3 :: meths
+ else if smt_proofs then insert (op =) (SMT_Method SMT_Z3) meths
else meths
val (params, _, concl_t) = strip_subgoal goal subgoal ctxt
@@ -494,9 +494,12 @@
(if do_preplay then [string_of_play_outcome play_outcome] else [])
in
one_line_proof_text ctxt 0 one_line_params ^
- "\n\nIsar proof" ^ (commas msg |> not (null msg) ? enclose " (" ")") ^ ":\n" ^
- Active.sendback_markup_command
- (string_of_isar_proof ctxt subgoal subgoal_count isar_proof)
+ (if isar_proofs <> NONE orelse (case play_outcome of Played _ => true | _ => false) then
+ "\n\nIsar proof" ^ (commas msg |> not (null msg) ? enclose " (" ")") ^ ":\n" ^
+ Active.sendback_markup_command
+ (string_of_isar_proof ctxt subgoal subgoal_count isar_proof)
+ else
+ "")
end)
end
end
--- a/src/HOL/Tools/Sledgehammer/sledgehammer_proof_methods.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/Sledgehammer/sledgehammer_proof_methods.ML Fri Sep 02 13:41:55 2022 +0200
@@ -127,7 +127,7 @@
end
fun tac_of_smt SMT_Z3 = SMT_Solver.smt_tac
- | tac_of_smt (SMT_Verit strategy) = Verit_Proof.verit_tac_stgy strategy
+ | tac_of_smt (SMT_Verit strategy) = Verit_Strategies.verit_tac_stgy strategy
in
(case meth of
Metis_Method options => tac_of_metis options
--- a/src/HOL/Tools/Sledgehammer/sledgehammer_prover.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/Sledgehammer/sledgehammer_prover.ML Fri Sep 02 13:41:55 2022 +0200
@@ -84,8 +84,7 @@
val overlord_file_location_of_prover : string -> string * string
val proof_banner : mode -> string -> string
val is_atp : string -> bool
- val bunches_of_proof_methods : Proof.context -> bool -> bool -> bool -> string ->
- proof_method list list
+ val bunches_of_proof_methods : Proof.context -> bool -> bool -> string -> proof_method list list
val facts_of_filter : string -> (string * fact list) list -> fact list
val facts_of_basic_slice : base_slice -> (string * fact list) list -> fact list
val is_fact_chained : (('a * stature) * 'b) -> bool
@@ -205,33 +204,29 @@
| Try => "Sledgehammer (" ^ prover_name ^ ") found a proof: "
| _ => "Try this: ")
-fun bunches_of_proof_methods ctxt try0 smt_proofs needs_full_types desperate_lam_trans =
+fun bunches_of_proof_methods ctxt smt_proofs needs_full_types desperate_lam_trans =
let
- val try0_methodss =
- if try0 then
- [[Simp_Method, Auto_Method, Blast_Method, Linarith_Method, Meson_Method,
- Metis_Method (NONE, NONE), Fastforce_Method, Force_Method, Presburger_Method]]
- else
- []
+ val misc_methodss =
+ [[Simp_Method, Auto_Method, Blast_Method, Linarith_Method, Meson_Method,
+ Metis_Method (NONE, NONE), Fastforce_Method, Force_Method, Presburger_Method]]
- val metis_methods =
- (if try0 then [] else [Metis_Method (NONE, NONE)]) @
- Metis_Method (SOME full_typesN, NONE) ::
- Metis_Method (SOME really_full_type_enc, SOME desperate_lam_trans) ::
- (if needs_full_types then
- [Metis_Method (SOME really_full_type_enc, NONE),
- Metis_Method (SOME full_typesN, SOME desperate_lam_trans)]
- else
- [Metis_Method (SOME no_typesN, SOME desperate_lam_trans)])
+ val metis_methodss =
+ [Metis_Method (SOME full_typesN, NONE) ::
+ Metis_Method (SOME really_full_type_enc, SOME desperate_lam_trans) ::
+ (if needs_full_types then
+ [Metis_Method (SOME really_full_type_enc, NONE),
+ Metis_Method (SOME full_typesN, SOME desperate_lam_trans)]
+ else
+ [Metis_Method (SOME no_typesN, SOME desperate_lam_trans)])]
val smt_methodss =
if smt_proofs then
- [map (SMT_Method o SMT_Verit) (Verit_Proof.all_veriT_stgies (Context.Proof ctxt)),
+ [map (SMT_Method o SMT_Verit) (Verit_Strategies.all_veriT_stgies (Context.Proof ctxt)),
[SMT_Method SMT_Z3]]
else
[]
in
- try0_methodss @ [metis_methods] @ smt_methodss
+ misc_methodss @ metis_methodss @ smt_methodss
end
fun facts_of_filter fact_filter factss =
--- a/src/HOL/Tools/Sledgehammer/sledgehammer_prover_atp.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/Sledgehammer/sledgehammer_prover_atp.ML Fri Sep 02 13:41:55 2022 +0200
@@ -291,10 +291,14 @@
let
val used_facts = sort_by fst (used_facts_in_atp_proof ctxt (map fst used_from) atp_proof)
val needs_full_types = is_typed_helper_used_in_atp_proof atp_proof
+ val preferred = Metis_Method (NONE, NONE)
val preferred_methss =
- (Metis_Method (NONE, NONE),
- bunches_of_proof_methods ctxt try0 smt_proofs needs_full_types
- (if atp_proof_prefers_lifting atp_proof then liftingN else opaque_liftingN))
+ (preferred,
+ if try0 then
+ bunches_of_proof_methods ctxt smt_proofs needs_full_types
+ (if atp_proof_prefers_lifting atp_proof then liftingN else opaque_liftingN)
+ else
+ [[preferred]])
in
(used_facts, preferred_methss,
fn preplay =>
--- a/src/HOL/Tools/Sledgehammer/sledgehammer_prover_minimize.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/Sledgehammer/sledgehammer_prover_minimize.ML Fri Sep 02 13:41:55 2022 +0200
@@ -234,7 +234,7 @@
"Timeout: You can increase the time limit using the \"timeout\" option (e.g., \
\timeout = " ^ string_of_int (10 + Time.toMilliseconds timeout div 1000) ^ "\")")
| {message, ...} => (NONE, (prefix "Prover error: " o message))))
- handle ERROR msg => (NONE, fn _ => "Error: " ^ msg)
+ handle ERROR msg => (NONE, fn _ => "Warning: " ^ msg)
end
fun maybe_minimize mode do_learn name (params as {verbose, minimize, ...})
--- a/src/HOL/Tools/Sledgehammer/sledgehammer_prover_smt.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/Sledgehammer/sledgehammer_prover_smt.ML Fri Sep 02 13:41:55 2022 +0200
@@ -145,7 +145,11 @@
SMT_Method (if name = "z3" then SMT_Z3 else SMT_Verit "default")
else
Metis_Method (NONE, NONE);
- val methss = bunches_of_proof_methods ctxt try0 smt_proofs false liftingN;
+ val methss =
+ if try0 then
+ bunches_of_proof_methods ctxt smt_proofs false liftingN
+ else
+ [[preferred]]
in
((preferred, methss),
fn preplay =>
--- a/src/HOL/Tools/Sledgehammer/sledgehammer_tactics.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/Sledgehammer/sledgehammer_tactics.ML Fri Sep 02 13:41:55 2022 +0200
@@ -51,7 +51,7 @@
(case prover params problem slice of
{outcome = NONE, used_facts, ...} => used_facts |> map fst |> SOME
| _ => NONE)
- handle ERROR message => (warning ("Error: " ^ message ^ "\n"); NONE)
+ handle ERROR message => (warning ("Warning: " ^ message ^ "\n"); NONE)
end
fun sledgehammer_with_metis_tac ctxt override_params fact_override chained i th =
--- a/src/HOL/Tools/lin_arith.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/lin_arith.ML Fri Sep 02 13:41:55 2022 +0200
@@ -104,6 +104,15 @@
val neq_limit = Attrib.setup_config_int \<^binding>\<open>linarith_neq_limit\<close> (K 9);
val trace = Attrib.setup_config_bool \<^binding>\<open>linarith_trace\<close> (K false);
+fun nnf_simpset ctxt =
+ (empty_simpset ctxt
+ |> Simplifier.set_mkeqTrue mk_eq_True
+ |> Simplifier.set_mksimps (mksimps mksimps_pairs))
+ addsimps @{thms imp_conv_disj iff_conv_conj_imp de_Morgan_disj
+ de_Morgan_conj not_all not_ex not_not}
+
+fun prem_nnf_tac ctxt = full_simp_tac (nnf_simpset ctxt)
+
structure LA_Data: LIN_ARITH_DATA =
struct
@@ -764,6 +773,7 @@
result
end;
+
(* takes the i-th subgoal [| A1; ...; An |] ==> B to *)
(* An --> ... --> A1 --> B, performs splitting with the given 'split_thms' *)
(* (resulting in a different subgoal P), takes P to ~P ==> False, *)
@@ -773,16 +783,6 @@
(* general form [| Q1; ...; Qm |] ==> False. Fails if more than *)
(* !split_limit splits are possible. *)
-local
- fun nnf_simpset ctxt =
- (empty_simpset ctxt
- |> Simplifier.set_mkeqTrue mk_eq_True
- |> Simplifier.set_mksimps (mksimps mksimps_pairs))
- addsimps [@{thm imp_conv_disj}, @{thm iff_conv_conj_imp}, @{thm de_Morgan_disj},
- @{thm de_Morgan_conj}, not_all, not_ex, not_not]
- fun prem_nnf_tac ctxt = full_simp_tac (nnf_simpset ctxt)
-in
-
fun split_once_tac ctxt split_thms =
let
val thy = Proof_Context.theory_of ctxt
@@ -813,8 +813,6 @@
]
end;
-end; (* local *)
-
(* remove irrelevant premises, then split the i-th subgoal (and all new *)
(* subgoals) by using 'split_once_tac' repeatedly. Beta-eta-normalize new *)
(* subgoals and finally attempt to solve them by finding an immediate *)
@@ -897,16 +895,6 @@
where the Ai are atomic, i.e. no top-level &, | or EX
*)
-local
- fun nnf_simpset ctxt =
- (empty_simpset ctxt
- |> Simplifier.set_mkeqTrue mk_eq_True
- |> Simplifier.set_mksimps (mksimps mksimps_pairs))
- addsimps [@{thm imp_conv_disj}, @{thm iff_conv_conj_imp}, @{thm de_Morgan_disj},
- @{thm de_Morgan_conj}, @{thm not_all}, @{thm not_ex}, @{thm not_not}];
- fun prem_nnf_tac ctxt = full_simp_tac (nnf_simpset ctxt);
-in
-
fun refute_tac ctxt test prep_tac ref_tac =
let val refute_prems_tac =
REPEAT_DETERM
@@ -921,8 +909,6 @@
SELECT_GOAL (DEPTH_SOLVE refute_prems_tac)]
end;
-end;
-
(* arith proof method *)
@@ -961,7 +947,7 @@
val global_setup =
map_theory_simpset (fn ctxt => ctxt
addSolver (mk_solver "lin_arith" (add_arith_facts #> Fast_Arith.prems_lin_arith_tac))) #>
- Attrib.setup \<^binding>\<open>arith_split\<close> (Scan.succeed (Thm.declaration_attribute add_split))
+ Attrib.setup \<^binding>\<open>linarith_split\<close> (Scan.succeed (Thm.declaration_attribute add_split))
"declaration of split rules for arithmetic procedure" #>
Method.setup \<^binding>\<open>linarith\<close>
(Scan.succeed (fn ctxt =>
--- a/src/HOL/Tools/numeral_simprocs.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Tools/numeral_simprocs.ML Fri Sep 02 13:41:55 2022 +0200
@@ -166,7 +166,7 @@
simpset_of (put_simpset HOL_basic_ss \<^context> |> Simplifier.set_term_ord numterm_ord);
(*Maps 1 to Numeral1 so that arithmetic isn't complicated by the abstract 1.*)
-val numeral_syms = [@{thm numeral_One} RS sym];
+val numeral_syms = @{thms numeral_One [symmetric]};
(*Simplify 0+n, n+0, Numeral1*n, n*Numeral1, 1*x, x*1, x/1 *)
val add_0s = @{thms add_0_left add_0_right};
@@ -174,57 +174,54 @@
(* For post-simplification of the rhs of simproc-generated rules *)
val post_simps =
- [@{thm numeral_One},
- @{thm add_0_left}, @{thm add_0_right},
- @{thm mult_zero_left}, @{thm mult_zero_right},
- @{thm mult_1_left}, @{thm mult_1_right},
- @{thm mult_minus1}, @{thm mult_minus1_right}]
+ @{thms numeral_One
+ add_0_left add_0_right
+ mult_zero_left mult_zero_right
+ mult_1_left mult_1_right
+ mult_minus1 mult_minus1_right}
val field_post_simps =
- post_simps @ [@{thm div_0}, @{thm div_by_1}]
+ post_simps @ @{thms div_0 div_by_1}
(*Simplify inverse Numeral1*)
-val inverse_1s = [@{thm inverse_numeral_1}];
+val inverse_1s = @{thms inverse_numeral_1}
(*To perform binary arithmetic. The "left" rewriting handles patterns
created by the Numeral_Simprocs, such as 3 * (5 * x). *)
val simps =
- [@{thm numeral_One} RS sym] @
- @{thms add_numeral_left} @
- @{thms add_neg_numeral_left} @
- @{thms mult_numeral_left} @
- @{thms arith_simps} @ @{thms rel_simps};
+ @{thms numeral_One [symmetric]
+ add_numeral_left
+ add_neg_numeral_left
+ mult_numeral_left
+ arith_simps rel_simps}
(*Binary arithmetic BUT NOT ADDITION since it may collapse adjacent terms
during re-arrangement*)
val non_add_simps =
subtract Thm.eq_thm
- (@{thms add_numeral_left} @
- @{thms add_neg_numeral_left} @
- @{thms numeral_plus_numeral} @
- @{thms add_neg_numeral_simps}) simps;
-
-(*To evaluate binary negations of coefficients*)
-val minus_simps = [@{thm minus_zero}, @{thm minus_minus}];
+ @{thms add_numeral_left
+ add_neg_numeral_left
+ numeral_plus_numeral
+ add_neg_numeral_simps} simps;
(*To let us treat subtraction as addition*)
-val diff_simps = [@{thm diff_conv_add_uminus}, @{thm minus_add_distrib}, @{thm minus_minus}];
+val diff_simps = @{thms diff_conv_add_uminus minus_add_distrib minus_minus};
(*To let us treat division as multiplication*)
-val divide_simps = [@{thm divide_inverse}, @{thm inverse_mult_distrib}, @{thm inverse_inverse_eq}];
+val divide_simps = @{thms divide_inverse inverse_mult_distrib inverse_inverse_eq};
(*to extract again any uncancelled minuses*)
val minus_from_mult_simps =
- [@{thm minus_minus}, @{thm mult_minus_left}, @{thm mult_minus_right}];
+ @{thms minus_minus mult_minus_left mult_minus_right};
(*combine unary minus with numeric literals, however nested within a product*)
val mult_minus_simps =
- [@{thm mult.assoc}, @{thm minus_mult_right}, @{thm minus_mult_commute}, @{thm numeral_times_minus_swap}];
+ @{thms mult.assoc minus_mult_right minus_mult_commute numeral_times_minus_swap};
val norm_ss1 =
simpset_of (put_simpset num_ss \<^context>
addsimps numeral_syms @ add_0s @ mult_1s @
- diff_simps @ minus_simps @ @{thms ac_simps})
+ diff_simps @ @{thms minus_zero ac_simps})
val norm_ss2 =
simpset_of (put_simpset num_ss \<^context>
@@ -232,7 +229,7 @@
val norm_ss3 =
simpset_of (put_simpset num_ss \<^context>
- addsimps minus_from_mult_simps @ @{thms ac_simps} @ @{thms ac_simps minus_mult_commute})
+ addsimps minus_from_mult_simps @ @{thms ac_simps minus_mult_commute})
structure CancelNumeralsCommon =
struct
@@ -249,7 +246,7 @@
THEN ALLGOALS (simp_tac (put_simpset norm_ss3 ctxt))
val numeral_simp_ss =
- simpset_of (put_simpset HOL_basic_ss \<^context> addsimps add_0s @ simps)
+ simpset_of (put_simpset HOL_basic_ss \<^context> addsimps simps)
fun numeral_simp_tac ctxt =
ALLGOALS (simp_tac (put_simpset numeral_simp_ss ctxt))
val simplify_meta_eq = Arith_Data.simplify_meta_eq post_simps
@@ -303,7 +300,7 @@
THEN ALLGOALS (simp_tac (put_simpset norm_ss3 ctxt))
val numeral_simp_ss =
- simpset_of (put_simpset HOL_basic_ss \<^context> addsimps add_0s @ simps)
+ simpset_of (put_simpset HOL_basic_ss \<^context> addsimps simps)
fun numeral_simp_tac ctxt =
ALLGOALS (simp_tac (put_simpset numeral_simp_ss ctxt))
val simplify_meta_eq = Arith_Data.simplify_meta_eq post_simps
@@ -326,7 +323,7 @@
val trans_tac = trans_tac
val norm_ss1a =
- simpset_of (put_simpset norm_ss1 \<^context> addsimps inverse_1s @ divide_simps)
+ simpset_of (put_simpset norm_ss1 \<^context> addsimps (inverse_1s @ divide_simps))
fun norm_tac ctxt =
ALLGOALS (simp_tac (put_simpset norm_ss1a ctxt))
THEN ALLGOALS (simp_tac (put_simpset norm_ss2 ctxt))
@@ -334,7 +331,7 @@
val numeral_simp_ss =
simpset_of (put_simpset HOL_basic_ss \<^context>
- addsimps add_0s @ simps @ [@{thm add_frac_eq}, @{thm not_False_eq_True}])
+ addsimps (simps @ @{thms add_frac_eq not_False_eq_True}))
fun numeral_simp_tac ctxt =
ALLGOALS (simp_tac (put_simpset numeral_simp_ss ctxt))
val simplify_meta_eq = Arith_Data.simplify_meta_eq field_post_simps
@@ -386,7 +383,7 @@
fun numeral_simp_tac ctxt =
ALLGOALS (simp_tac (put_simpset numeral_simp_ss ctxt))
val simplify_meta_eq = Arith_Data.simplify_meta_eq
- ([@{thm Nat.add_0}, @{thm Nat.add_0_right}] @ post_simps)
+ (@{thms Nat.add_0 Nat.add_0_right} @ post_simps)
val prove_conv = Arith_Data.prove_conv
end
@@ -588,9 +585,9 @@
val type_tvar = tvar \<^sort>\<open>type\<close>;
val geq = cterm_of (Const (\<^const_name>\<open>HOL.eq\<close>, TVar type_tvar --> TVar type_tvar --> \<^typ>\<open>bool\<close>));
-val add_frac_eq = mk_meta_eq @{thm "add_frac_eq"}
-val add_frac_num = mk_meta_eq @{thm "add_frac_num"}
-val add_num_frac = mk_meta_eq @{thm "add_num_frac"}
+val add_frac_eq = mk_meta_eq @{thm add_frac_eq}
+val add_frac_num = mk_meta_eq @{thm add_frac_num}
+val add_num_frac = mk_meta_eq @{thm add_num_frac}
fun prove_nz ctxt T t =
let
@@ -706,35 +703,37 @@
\<^term>\<open>(a::'a::{field, ord}) / b = c\<close>],
proc = K proc3}
-val ths =
- [@{thm "mult_numeral_1"}, @{thm "mult_numeral_1_right"},
- @{thm "divide_numeral_1"},
- @{thm "div_by_0"}, @{thm div_0},
- @{thm "divide_divide_eq_left"},
- @{thm "times_divide_eq_left"}, @{thm "times_divide_eq_right"},
- @{thm "times_divide_times_eq"},
- @{thm "divide_divide_eq_right"},
- @{thm diff_conv_add_uminus}, @{thm "minus_divide_left"},
- @{thm "add_divide_distrib"} RS sym,
- @{thm Fields.field_divide_inverse} RS sym, @{thm inverse_divide},
- Conv.fconv_rule (Conv.arg_conv (Conv.arg1_conv (Conv.rewr_conv (mk_meta_eq @{thm mult.commute}))))
- (@{thm Fields.field_divide_inverse} RS sym)]
-
val field_comp_ss =
simpset_of
(put_simpset HOL_basic_ss \<^context>
- addsimps @{thms "semiring_norm"}
- addsimps ths addsimps @{thms simp_thms}
+ addsimps @{thms semiring_norm
+ mult_numeral_1
+ mult_numeral_1_right
+ divide_numeral_1
+ div_by_0
+ div_0
+ divide_divide_eq_left
+ times_divide_eq_left
+ times_divide_eq_right
+ times_divide_times_eq
+ divide_divide_eq_right
+ diff_conv_add_uminus
+ minus_divide_left
+ add_divide_distrib [symmetric]
+ Fields.field_divide_inverse [symmetric]
+ inverse_divide
+ divide_inverse_commute [symmetric]
+ simp_thms}
addsimprocs field_cancel_numeral_factors
addsimprocs [add_frac_frac_simproc, add_frac_num_simproc, ord_frac_simproc]
- |> Simplifier.add_cong @{thm "if_weak_cong"})
+ |> Simplifier.add_cong @{thm if_weak_cong})
in
fun field_comp_conv ctxt =
Simplifier.rewrite (put_simpset field_comp_ss ctxt)
then_conv
- Simplifier.rewrite (put_simpset HOL_basic_ss ctxt addsimps [@{thm numeral_One}])
+ Simplifier.rewrite (put_simpset HOL_basic_ss ctxt addsimps @{thms numeral_One})
end
--- a/src/HOL/Transfer.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Transfer.thy Fri Sep 02 13:41:55 2022 +0200
@@ -532,7 +532,12 @@
lemma rec_nat_transfer [transfer_rule]:
"(A ===> ((=) ===> A ===> A) ===> (=) ===> A) rec_nat rec_nat"
- unfolding rel_fun_def by (clarsimp, rename_tac n, induct_tac n, simp_all)
+ unfolding rel_fun_def
+ apply safe
+ subgoal for _ _ _ _ _ n
+ by (induction n) simp_all
+ done
+
lemma funpow_transfer [transfer_rule]:
"((=) ===> (A ===> A) ===> (A ===> A)) compow compow"
--- a/src/HOL/Transitive_Closure.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Transitive_Closure.thy Fri Sep 02 13:41:55 2022 +0200
@@ -251,7 +251,7 @@
shows P
proof -
have "x = z \<or> (\<exists>y. r x y \<and> r\<^sup>*\<^sup>* y z)"
- by (rule_tac major [THEN converse_rtranclp_induct]) iprover+
+ by (rule major [THEN converse_rtranclp_induct]) iprover+
then show ?thesis
by (auto intro: cases)
qed
@@ -312,6 +312,12 @@
subsection \<open>Transitive closure\<close>
+lemma totalp_on_tranclp: "totalp_on A R \<Longrightarrow> totalp_on A (tranclp R)"
+ by (auto intro: totalp_onI dest: totalp_onD)
+
+lemma total_on_trancl: "total_on A r \<Longrightarrow> total_on A (trancl r)"
+ by (rule totalp_on_tranclp[to_set])
+
lemma trancl_mono:
assumes "p \<in> r\<^sup>+" "r \<subseteq> s"
shows "p \<in> s\<^sup>+"
@@ -1001,10 +1007,10 @@
next
case (Suc n)
show ?case
- proof (simp add: relcomp_unfold Suc)
- show "(\<exists>y. (\<exists>f. f 0 = a \<and> f n = y \<and> (\<forall>i<n. (f i,f(Suc i)) \<in> R)) \<and> (y,b) \<in> R) \<longleftrightarrow>
+ proof -
+ have "(\<exists>y. (\<exists>f. f 0 = a \<and> f n = y \<and> (\<forall>i<n. (f i,f(Suc i)) \<in> R)) \<and> (y,b) \<in> R) \<longleftrightarrow>
(\<exists>f. f 0 = a \<and> f(Suc n) = b \<and> (\<forall>i<Suc n. (f i, f (Suc i)) \<in> R))"
- (is "?l = ?r")
+ (is "?l \<longleftrightarrow> ?r")
proof
assume ?l
then obtain c f
@@ -1016,8 +1022,9 @@
assume ?r
then obtain f where 1: "f 0 = a" "b = f (Suc n)" "\<And>i. i < Suc n \<Longrightarrow> (f i, f (Suc i)) \<in> R"
by auto
- show ?l by (rule exI[of _ "f n"], rule conjI, rule exI[of _ f], insert 1, auto)
+ show ?l by (rule exI[of _ "f n"], rule conjI, rule exI[of _ f], auto simp add: 1)
qed
+ then show ?thesis by (simp add: relcomp_unfold Suc)
qed
qed
--- a/src/HOL/UNITY/Comp/README.html Sat Jun 25 13:34:41 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
-<HTML>
-
-<HEAD>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <TITLE>HOL/UNITY/README</TITLE>
-</HEAD>
-
-<BODY>
-
-<H2>UNITY: Examples Involving Program Composition</H2>
-
-<P>
-The directory presents verification examples involving program composition.
-They are mostly taken from the works of Chandy, Charpentier and Chandy.
-
-<UL>
-<LI>examples of <em>universal properties</em>:
-the counter (<A HREF="Counter.thy"><CODE>Counter.thy</CODE></A>)
-and priority system (<A HREF="Priority.thy"><CODE>Priority.thy</CODE></A>)
-
-<LI>the allocation system (<A HREF="Alloc.thy"><CODE>Alloc.thy</CODE></A>)
-
-<LI>client implementation (<A HREF="Client.thy"><CODE>Client.thy</CODE></A>)
-
-<LI>allocator implementation (<A HREF="AllocImpl.thy"><CODE>AllocImpl.thy</CODE></A>)
-
-<LI>the handshake protocol
-(<A HREF="Handshake.thy"><CODE>Handshake.thy</CODE></A>)
-
-<LI>the timer array (demonstrates arrays of processes)
-(<A HREF="TimerArray.thy"><CODE>TimerArray.thy</CODE></A>)
-</UL>
-
-<P> Safety proofs (invariants) are often proved automatically. Progress
-proofs involving ENSURES can sometimes be proved automatically. The
-level of automation appears to be about the same as in HOL-UNITY by Flemming
-Andersen et al.
-
-<ADDRESS>
-<A NAME="lcp@cl.cam.ac.uk" HREF="mailto:lcp@cl.cam.ac.uk">lcp@cl.cam.ac.uk</A>
-</ADDRESS>
-</BODY>
-</HTML>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/UNITY/Comp/README_Comp.thy Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,24 @@
+theory README_Comp imports Main
+begin
+
+section \<open>UNITY: Examples Involving Program Composition\<close>
+
+text \<open>
+ The directory presents verification examples involving program composition.
+ They are mostly taken from the works of Chandy, Charpentier and Chandy.
+
+ \<^item> examples of \<^emph>\<open>universal properties\<close>: the counter (\<^file>\<open>Counter.thy\<close>) and
+ priority system (\<^file>\<open>Priority.thy\<close>)
+ \<^item> the allocation system (\<^file>\<open>Alloc.thy\<close>)
+ \<^item> client implementation (\<^file>\<open>Client.thy\<close>)
+ \<^item> allocator implementation (\<^file>\<open>AllocImpl.thy\<close>)
+ \<^item> the handshake protocol (\<^file>\<open>Handshake.thy\<close>)
+ \<^item> the timer array (demonstrates arrays of processes) (\<^file>\<open>TimerArray.thy\<close>)
+
+ Safety proofs (invariants) are often proved automatically. Progress proofs
+ involving ENSURES can sometimes be proved automatically. The level of
+ automation appears to be about the same as in HOL-UNITY by Flemming Andersen
+ et al.
+\<close>
+
+end
--- a/src/HOL/UNITY/README.html Sat Jun 25 13:34:41 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
-<HTML>
-
-<HEAD>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <TITLE>HOL/UNITY/README</TITLE>
-</HEAD>
-
-<BODY>
-
-<H2>UNITY--Chandy and Misra's UNITY formalism</H2>
-
-<P>The book <EM>Parallel Program Design: A Foundation</EM> by Chandy and Misra
-(Addison-Wesley, 1988) presents the UNITY formalism. UNITY consists of an
-abstract programming language of guarded assignments and a calculus for
-reasoning about such programs. Misra's 1994 paper "A Logic for Concurrent
-Programming" presents New UNITY, giving more elegant foundations for a more
-general class of languages. In recent work, Chandy and Sanders have proposed
-new methods for reasoning about systems composed of many components.
-
-<P>This directory formalizes these new ideas for UNITY. The Isabelle examples
-may seem strange to UNITY traditionalists. Hand UNITY proofs tend to be
-written in the forwards direction, as in informal mathematics, while Isabelle
-works best in a backwards (goal-directed) style. Programs are expressed as
-sets of commands, where each command is a relation on states. Quantification
-over commands using [] is easily expressed. At present, there are no examples
-of quantification using ||.
-
-<P>A UNITY assertion denotes the set of programs satisfying it, as
-in the propositions-as-types paradigm. The resulting style is readable if
-unconventional.
-
-<P> Safety proofs (invariants) are often proved automatically. Progress
-proofs involving ENSURES can sometimes be proved automatically. The
-level of automation appears to be about the same as in HOL-UNITY by Flemming
-Andersen et al.
-
-<P>
-The directory <A HREF="Simple/"><CODE>Simple</CODE></A>
-presents a few examples, mostly taken from Misra's 1994
-paper, involving single programs.
-The directory <A HREF="Comp/"><CODE>Comp</CODE></A>
-presents examples of proofs involving program composition.
-
-<ADDRESS>
-<A NAME="lcp@cl.cam.ac.uk" HREF="mailto:lcp@cl.cam.ac.uk">lcp@cl.cam.ac.uk</A>
-</ADDRESS>
-</BODY></HTML>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/UNITY/README.thy Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,37 @@
+theory README imports Main
+begin
+
+section \<open>UNITY--Chandy and Misra's UNITY formalism\<close>
+
+text \<open>
+ The book \<^emph>\<open>Parallel Program Design: A Foundation\<close> by Chandy and Misra
+ (Addison-Wesley, 1988) presents the UNITY formalism. UNITY consists of an
+ abstract programming language of guarded assignments and a calculus for
+ reasoning about such programs. Misra's 1994 paper "A Logic for Concurrent
+ Programming" presents New UNITY, giving more elegant foundations for a more
+ general class of languages. In recent work, Chandy and Sanders have proposed
+ new methods for reasoning about systems composed of many components.
+
+ This directory formalizes these new ideas for UNITY. The Isabelle examples
+ may seem strange to UNITY traditionalists. Hand UNITY proofs tend to be
+ written in the forwards direction, as in informal mathematics, while
+ Isabelle works best in a backwards (goal-directed) style. Programs are
+ expressed as sets of commands, where each command is a relation on states.
+ Quantification over commands using \<^verbatim>\<open>[]\<close> is easily expressed. At present,
+ there are no examples of quantification using \<^verbatim>\<open>||\<close>.
+
+ A UNITY assertion denotes the set of programs satisfying it, as in the
+ propositions-as-types paradigm. The resulting style is readable if
+ unconventional.
+
+ Safety proofs (invariants) are often proved automatically. Progress proofs
+ involving ENSURES can sometimes be proved automatically. The level of
+ automation appears to be about the same as in HOL-UNITY by Flemming Andersen
+ et al.
+
+ The directory \<^dir>\<open>Simple\<close> presents a few examples, mostly taken from Misra's
+ 1994 paper, involving single programs. The directory \<^dir>\<open>Comp\<close> presents
+ examples of proofs involving program composition.
+\<close>
+
+end
--- a/src/HOL/UNITY/Simple/README.html Sat Jun 25 13:34:41 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
-<HTML>
-
-<HEAD>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <TITLE>HOL/UNITY/README</TITLE>
-</HEAD>
-
-<BODY>
-
-<H2>UNITY: Examples Involving Single Programs</H2>
-
-<P> The directory presents verification examples that do not involve program
-composition. They are mostly taken from Misra's 1994 papers on ``New UNITY'':
-<UL>
-<LI>common meeting time (<A HREF="Common.thy"><CODE>Common.thy</CODE></A>)
-
-<LI>the token ring (<A HREF="Token.thy"><CODE>Token.thy</CODE></A>)
-
-<LI>the communication network
-(<A HREF="Network.thy"><CODE>Network.thy</CODE></A>)
-
-<LI>the lift controller (a standard benchmark) (<A HREF="Lift.thy"><CODE>Lift.thy</CODE></A>)
-
-<LI>a mutual exclusion algorithm (<A HREF="Mutex.thy"><CODE>Mutex.thy</CODE></A>)
-
-<LI><EM>n</EM>-process deadlock
-(<A HREF="Deadlock.thy"><CODE>Deadlock.thy</CODE></A>)
-
-<LI>unordered channel (<A HREF="Channel.thy"><CODE>Channel.thy</CODE></A>)
-
-<LI>reachability in directed graphs (section 6.4 of the book) (<A
-HREF="Reach.thy"><CODE>Reach.thy</CODE></A> and
-<A HREF="Reachability.thy"><CODE>Reachability.thy</CODE></A>)
-</UL>
-
-<ADDRESS>
-<A NAME="lcp@cl.cam.ac.uk" HREF="mailto:lcp@cl.cam.ac.uk">lcp@cl.cam.ac.uk</A>
-</ADDRESS>
-</BODY>
-</HTML>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/UNITY/Simple/README_Simple.thy Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,22 @@
+theory README_Simple imports Main
+begin
+
+section \<open>UNITY: Examples Involving Single Programs\<close>
+
+text \<open>
+ The directory presents verification examples that do not involve program
+ composition. They are mostly taken from Misra's 1994 papers on ``New
+ UNITY'':
+
+ \<^item> common meeting time (\<^file>\<open>Common.thy\<close>)
+ \<^item> the token ring (\<^file>\<open>Token.thy\<close>)
+ \<^item> the communication network (\<^file>\<open>Network.thy\<close>)
+ \<^item> the lift controller (a standard benchmark) (\<^file>\<open>Lift.thy\<close>)
+ \<^item> a mutual exclusion algorithm (\<^file>\<open>Mutex.thy\<close>)
+ \<^item> \<open>n\<close>-process deadlock (\<^file>\<open>Deadlock.thy\<close>)
+ \<^item> unordered channel (\<^file>\<open>Channel.thy\<close>)
+ \<^item> reachability in directed graphs (section 6.4 of the book)
+ (\<^file>\<open>Reach.thy\<close> and \<^file>\<open>Reachability.thy\<close>>
+\<close>
+
+end
--- a/src/HOL/Wellfounded.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Wellfounded.thy Fri Sep 02 13:41:55 2022 +0200
@@ -257,8 +257,10 @@
then obtain z where "z \<in> Q" "(z, y) \<in> r\<^sup>*"
"\<And>z'. (z', z) \<in> r \<longrightarrow> z' \<in> Q \<longrightarrow> (z', y) \<notin> r\<^sup>*"
using R' [of "{z \<in> Q. (z,y) \<in> r\<^sup>*}"] by auto
- with R show ?thesis
- by (rule_tac x="z" in bexI) (blast intro: rtrancl_trans)
+ then have "\<forall>y'. (y', z) \<in> insert (y, x) r \<longrightarrow> y' \<notin> Q"
+ using R by(blast intro: rtrancl_trans)+
+ then show ?thesis
+ by (rule bexI) fact
next
case False
then show ?thesis
@@ -293,7 +295,7 @@
thus ?thesis
using inj unfolding A_def
by (intro bexI[of _ "f a0"]) auto
- qed (insert \<open>b \<in> B\<close>, unfold A_def, auto)
+ qed (use \<open>b \<in> B\<close> in \<open>unfold A_def, auto\<close>)
qed
lemma wf_map_prod_image: "wf r \<Longrightarrow> inj f \<Longrightarrow> wf (map_prod f f ` r)"
@@ -581,11 +583,13 @@
unfolding less_eq rtrancl_eq_or_trancl by auto
lemma wf_pred_nat: "wf pred_nat"
- apply (unfold wf_def pred_nat_def)
- apply clarify
- apply (induct_tac x)
- apply blast+
- done
+ unfolding wf_def
+proof clarify
+ fix P x
+ assume "\<forall>x'. (\<forall>y. (y, x') \<in> pred_nat \<longrightarrow> P y) \<longrightarrow> P x'"
+ then show "P x"
+ unfolding pred_nat_def by (induction x) blast+
+qed
lemma wf_less_than [iff]: "wf less_than"
by (simp add: less_than_def wf_pred_nat [THEN wf_trancl])
@@ -673,10 +677,12 @@
by (blast dest: accp_downwards_aux)
theorem accp_wfPI: "\<forall>x. accp r x \<Longrightarrow> wfP r"
- apply (rule wfPUNIVI)
- apply (rule_tac P = P in accp_induct)
- apply blast+
- done
+proof (rule wfPUNIVI)
+ fix P x
+ assume "\<forall>x. accp r x" "\<forall>x. (\<forall>y. r y x \<longrightarrow> P y) \<longrightarrow> P x"
+ then show "P x"
+ using accp_induct[where P = P] by blast
+qed
theorem accp_wfPD: "wfP r \<Longrightarrow> accp r x"
apply (erule wfP_induct_rule)
@@ -750,15 +756,20 @@
fixes f :: "'a \<Rightarrow> 'b"
assumes "wf r"
shows "wf (inv_image r f)"
-proof (clarsimp simp: inv_image_def wf_eq_minimal)
- fix P and x::'a
- assume "x \<in> P"
- then obtain w where w: "w \<in> {w. \<exists>x::'a. x \<in> P \<and> f x = w}"
- by auto
- have *: "\<And>Q u. u \<in> Q \<Longrightarrow> \<exists>z\<in>Q. \<forall>y. (y, z) \<in> r \<longrightarrow> y \<notin> Q"
- using assms by (auto simp add: wf_eq_minimal)
- show "\<exists>z\<in>P. \<forall>y. (f y, f z) \<in> r \<longrightarrow> y \<notin> P"
- using * [OF w] by auto
+proof -
+ have "\<And>x P. x \<in> P \<Longrightarrow> \<exists>z\<in>P. \<forall>y. (f y, f z) \<in> r \<longrightarrow> y \<notin> P"
+ proof -
+ fix P and x::'a
+ assume "x \<in> P"
+ then obtain w where w: "w \<in> {w. \<exists>x::'a. x \<in> P \<and> f x = w}"
+ by auto
+ have *: "\<And>Q u. u \<in> Q \<Longrightarrow> \<exists>z\<in>Q. \<forall>y. (y, z) \<in> r \<longrightarrow> y \<notin> Q"
+ using assms by (auto simp add: wf_eq_minimal)
+ show "\<exists>z\<in>P. \<forall>y. (f y, f z) \<in> r \<longrightarrow> y \<notin> P"
+ using * [OF w] by auto
+ qed
+ then show ?thesis
+ by (clarsimp simp: inv_image_def wf_eq_minimal)
qed
text \<open>Measure functions into \<^typ>\<open>nat\<close>\<close>
@@ -901,7 +912,7 @@
next
case False
from * finites have N2: "(?N2, M) \<in> max_ext r"
- by (rule_tac max_extI[OF _ _ \<open>M \<noteq> {}\<close>]) auto
+ using max_extI[OF _ _ \<open>M \<noteq> {}\<close>, where ?X = ?N2] by auto
with \<open>M \<in> ?W\<close> show "?N2 \<in> ?W" by (rule acc_downward)
qed
with finites have "?N1 \<union> ?N2 \<in> ?W"
--- a/src/HOL/Wfrec.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/Wfrec.thy Fri Sep 02 13:41:55 2022 +0200
@@ -101,15 +101,20 @@
lemma wf_same_fst:
assumes "\<And>x. P x \<Longrightarrow> wf (R x)"
shows "wf (same_fst P R)"
-proof (clarsimp simp add: wf_def same_fst_def)
- fix Q a b
- assume *: "\<forall>a b. (\<forall>x. P a \<and> (x,b) \<in> R a \<longrightarrow> Q (a,x)) \<longrightarrow> Q (a,b)"
- show "Q(a,b)"
- proof (cases "wf (R a)")
- case True
- then show ?thesis
- by (induction b rule: wf_induct_rule) (use * in blast)
- qed (use * assms in blast)
+proof -
+ have "\<And>a b Q. \<forall>a b. (\<forall>x. P a \<and> (x, b) \<in> R a \<longrightarrow> Q (a, x)) \<longrightarrow> Q (a, b) \<Longrightarrow> Q (a, b)"
+ proof -
+ fix Q a b
+ assume *: "\<forall>a b. (\<forall>x. P a \<and> (x,b) \<in> R a \<longrightarrow> Q (a,x)) \<longrightarrow> Q (a,b)"
+ show "Q(a,b)"
+ proof (cases "wf (R a)")
+ case True
+ then show ?thesis
+ by (induction b rule: wf_induct_rule) (use * in blast)
+ qed (use * assms in blast)
+ qed
+ then show ?thesis
+ by (clarsimp simp add: wf_def same_fst_def)
qed
end
--- a/src/HOL/ex/Arith_Examples.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/ex/Arith_Examples.thy Fri Sep 02 13:41:55 2022 +0200
@@ -98,13 +98,13 @@
by linarith
lemma "(i::nat) mod 0 = i"
- using split_mod [of _ _ 0, arith_split]
+ using split_mod [of _ _ 0, linarith_split]
\<comment> \<open>rule \<^text>\<open>split_mod\<close> is only declared by default for numerals\<close>
by linarith
lemma "(i::nat) mod 1 = 0"
(* rule split_mod is only declared by default for numerals *)
- using split_mod [of _ _ 1, arith_split]
+ using split_mod [of _ _ 1, linarith_split]
\<comment> \<open>rule \<^text>\<open>split_mod\<close> is only declared by default for numerals\<close>
by linarith
@@ -112,12 +112,12 @@
by linarith
lemma "(i::int) mod 0 = i"
- using split_zmod [of _ _ 0, arith_split]
+ using split_zmod [of _ _ 0, linarith_split]
\<comment> \<open>rule \<^text>\<open>split_zmod\<close> is only declared by default for numerals\<close>
by linarith
lemma "(i::int) mod 1 = 0"
- using split_zmod [of _ _ "1", arith_split]
+ using split_zmod [of _ _ "1", linarith_split]
\<comment> \<open>rule \<^text>\<open>split_zmod\<close> is only declared by default for numerals\<close>
by linarith
--- a/src/HOL/ex/Parallel_Example.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/HOL/ex/Parallel_Example.thy Fri Sep 02 13:41:55 2022 +0200
@@ -41,11 +41,11 @@
proof -
fix ps qs q
assume "dropWhile Not ps = q # qs"
- then have "length (q # qs) = length (dropWhile Not ps)" by simp
- then have "length qs < length (dropWhile Not ps)" by simp
- moreover have "length (dropWhile Not ps) \<le> length ps"
+ then have "length qs < length (dropWhile Not ps)"
+ by simp
+ also have "length (dropWhile Not ps) \<le> length ps"
by (simp add: length_dropWhile_le)
- ultimately show "length qs < length ps" by auto
+ finally show "length qs < length ps" .
qed
primrec natify :: "nat \<Rightarrow> bool list \<Rightarrow> nat list" where
@@ -61,7 +61,7 @@
function factorise_from :: "nat \<Rightarrow> nat \<Rightarrow> nat list" where
"factorise_from k n = (if 1 < k \<and> k \<le> n
then
- let (q, r) = Divides.divmod_nat n k
+ let (q, r) = Euclidean_Division.divmod_nat n k
in if r = 0 then k # factorise_from k q
else factorise_from (Suc k) n
else [])"
@@ -69,9 +69,11 @@
termination factorise_from \<comment> \<open>tuning of this proof is left as an exercise to the reader\<close>
apply (relation "measure (\<lambda>(k, n). 2 * n - k)")
- apply (auto simp add: prod_eq_iff algebra_simps elim!: dvdE)
- apply (case_tac "k \<le> ka * 2")
- apply (auto intro: diff_less_mono)
+ apply (auto simp add: Euclidean_Division.divmod_nat_def algebra_simps elim!: dvdE)
+ subgoal for m n
+ apply (cases "m \<le> n * 2")
+ apply (auto intro: diff_less_mono)
+ done
done
definition factorise :: "nat \<Rightarrow> nat list" where
--- a/src/HOL/ex/Sum_of_Powers.thy Sat Jun 25 13:34:41 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,204 +0,0 @@
-(* Author: Lukas Bulwahn <lukas.bulwahn-at-gmail.com> *)
-section \<open>Sum of Powers\<close>
-
-theory Sum_of_Powers
-imports Complex_Main
-begin
-
-subsection \<open>Additions to \<^theory>\<open>HOL.Binomial\<close> Theory\<close>
-
-lemma (in field_char_0) one_plus_of_nat_neq_zero [simp]:
- "1 + of_nat n \<noteq> 0"
-proof -
- have "of_nat (Suc n) \<noteq> of_nat 0"
- unfolding of_nat_eq_iff by simp
- then show ?thesis by simp
-qed
-
-lemma of_nat_binomial_eq_mult_binomial_Suc:
- assumes "k \<le> n"
- shows "(of_nat :: (nat \<Rightarrow> ('a :: field_char_0))) (n choose k) = of_nat (n + 1 - k) / of_nat (n + 1) * of_nat (Suc n choose k)"
-proof (cases k)
- case 0 then show ?thesis by simp
-next
- case (Suc l)
- have "of_nat (n + 1) * (\<Prod>i=0..<k. of_nat (n - i)) = (of_nat :: (nat \<Rightarrow> 'a)) (n + 1 - k) * (\<Prod>i=0..<k. of_nat (Suc n - i))"
- using prod.atLeast0_lessThan_Suc [where ?'a = 'a, symmetric, of "\<lambda>i. of_nat (Suc n - i)" k]
- by (simp add: ac_simps prod.atLeast0_lessThan_Suc_shift del: prod.op_ivl_Suc)
- also have "... = (of_nat :: (nat \<Rightarrow> 'a)) (Suc n - k) * (\<Prod>i=0..<k. of_nat (Suc n - i))"
- by (simp add: Suc atLeast0_atMost_Suc atLeastLessThanSuc_atLeastAtMost)
- also have "... = (of_nat :: (nat \<Rightarrow> 'a)) (n + 1 - k) * (\<Prod>i=0..<k. of_nat (Suc n - i))"
- by (simp only: Suc_eq_plus1)
- finally have "(\<Prod>i=0..<k. of_nat (n - i)) = (of_nat :: (nat \<Rightarrow> 'a)) (n + 1 - k) / of_nat (n + 1) * (\<Prod>i=0..<k. of_nat (Suc n - i))"
- by (simp add: field_simps)
- with assms show ?thesis
- by (simp add: binomial_altdef_of_nat prod_dividef)
-qed
-
-lemma real_binomial_eq_mult_binomial_Suc:
- assumes "k \<le> n"
- shows "(n choose k) = (n + 1 - k) / (n + 1) * (Suc n choose k)"
-by (metis Suc_eq_plus1 add.commute assms le_SucI of_nat_Suc of_nat_binomial_eq_mult_binomial_Suc of_nat_diff)
-
-subsection \<open>Preliminaries\<close>
-
-lemma integrals_eq:
- assumes "f 0 = g 0"
- assumes "\<And> x. ((\<lambda>x. f x - g x) has_real_derivative 0) (at x)"
- shows "f x = g x"
-proof -
- show "f x = g x"
- proof (cases "x \<noteq> 0")
- case True
- from assms DERIV_const_ratio_const[OF this, of "\<lambda>x. f x - g x" 0]
- show ?thesis by auto
- qed (simp add: assms)
-qed
-
-lemma sum_diff: "((\<Sum>i\<le>n::nat. f (i + 1) - f i)::'a::field) = f (n + 1) - f 0"
-by (induct n) (auto simp add: field_simps)
-
-declare One_nat_def [simp del]
-
-subsection \<open>Bernoulli Numbers and Bernoulli Polynomials\<close>
-
-declare sum.cong [fundef_cong]
-
-fun bernoulli :: "nat \<Rightarrow> real"
-where
- "bernoulli 0 = (1::real)"
-| "bernoulli (Suc n) = (-1 / (n + 2)) * (\<Sum>k \<le> n. ((n + 2 choose k) * bernoulli k))"
-
-declare bernoulli.simps[simp del]
-
-definition
- "bernpoly n = (\<lambda>x. \<Sum>k \<le> n. (n choose k) * bernoulli k * x ^ (n - k))"
-
-subsection \<open>Basic Observations on Bernoulli Polynomials\<close>
-
-lemma bernpoly_0: "bernpoly n 0 = bernoulli n"
-proof (cases n)
- case 0
- then show "bernpoly n 0 = bernoulli n"
- unfolding bernpoly_def bernoulli.simps by auto
-next
- case (Suc n')
- have "(\<Sum>k\<le>n'. real (Suc n' choose k) * bernoulli k * 0 ^ (Suc n' - k)) = 0"
- by (rule sum.neutral) auto
- with Suc show ?thesis
- unfolding bernpoly_def by simp
-qed
-
-lemma sum_binomial_times_bernoulli:
- "(\<Sum>k\<le>n. ((Suc n) choose k) * bernoulli k) = (if n = 0 then 1 else 0)"
-proof (cases n)
- case 0
- then show ?thesis by (simp add: bernoulli.simps)
-next
- case Suc
- then show ?thesis
- by (simp add: bernoulli.simps)
- (simp add: field_simps add_2_eq_Suc'[symmetric] del: add_2_eq_Suc add_2_eq_Suc')
-qed
-
-subsection \<open>Sum of Powers with Bernoulli Polynomials\<close>
-
-lemma bernpoly_derivative [derivative_intros]:
- "(bernpoly (Suc n) has_real_derivative ((n + 1) * bernpoly n x)) (at x)"
-proof -
- have "(bernpoly (Suc n) has_real_derivative (\<Sum>k\<le>n. real (Suc n - k) * x ^ (n - k) * (real (Suc n choose k) * bernoulli k))) (at x)"
- unfolding bernpoly_def by (rule DERIV_cong) (fast intro!: derivative_intros, simp)
- moreover have "(\<Sum>k\<le>n. real (Suc n - k) * x ^ (n - k) * (real (Suc n choose k) * bernoulli k)) = (n + 1) * bernpoly n x"
- unfolding bernpoly_def
- by (auto intro: sum.cong simp add: sum_distrib_left real_binomial_eq_mult_binomial_Suc[of _ n] Suc_eq_plus1 of_nat_diff)
- ultimately show ?thesis by auto
-qed
-
-lemma diff_bernpoly:
- "bernpoly n (x + 1) - bernpoly n x = n * x ^ (n - 1)"
-proof (induct n arbitrary: x)
- case 0
- show ?case unfolding bernpoly_def by auto
-next
- case (Suc n)
- have "bernpoly (Suc n) (0 + 1) - bernpoly (Suc n) 0 = (Suc n) * 0 ^ n"
- unfolding bernpoly_0 unfolding bernpoly_def by (simp add: sum_binomial_times_bernoulli zero_power)
- then have const: "bernpoly (Suc n) (0 + 1) - bernpoly (Suc n) 0 = real (Suc n) * 0 ^ n" by (simp add: power_0_left)
- have hyps': "\<And>x. (real n + 1) * bernpoly n (x + 1) - (real n + 1) * bernpoly n x = real n * x ^ (n - Suc 0) * real (Suc n)"
- unfolding right_diff_distrib[symmetric] by (simp add: Suc.hyps One_nat_def)
- note [derivative_intros] = DERIV_chain'[where f = "\<lambda>x::real. x + 1" and g = "bernpoly (Suc n)" and s="UNIV"]
- have derivative: "\<And>x. ((%x. bernpoly (Suc n) (x + 1) - bernpoly (Suc n) x - real (Suc n) * x ^ n) has_real_derivative 0) (at x)"
- by (rule DERIV_cong) (fast intro!: derivative_intros, simp add: hyps')
- from integrals_eq[OF const derivative] show ?case by simp
-qed
-
-lemma sum_of_powers: "(\<Sum>k\<le>n::nat. (real k) ^ m) = (bernpoly (Suc m) (n + 1) - bernpoly (Suc m) 0) / (m + 1)"
-proof -
- from diff_bernpoly[of "Suc m", simplified] have "(m + (1::real)) * (\<Sum>k\<le>n. (real k) ^ m) = (\<Sum>k\<le>n. bernpoly (Suc m) (real k + 1) - bernpoly (Suc m) (real k))"
- by (auto simp add: sum_distrib_left intro!: sum.cong)
- also have "... = (\<Sum>k\<le>n. bernpoly (Suc m) (real (k + 1)) - bernpoly (Suc m) (real k))"
- by simp
- also have "... = bernpoly (Suc m) (n + 1) - bernpoly (Suc m) 0"
- by (simp only: sum_diff[where f="\<lambda>k. bernpoly (Suc m) (real k)"]) simp
- finally show ?thesis by (auto simp add: field_simps intro!: eq_divide_imp)
-qed
-
-subsection \<open>Instances for Square And Cubic Numbers\<close>
-
-lemma binomial_unroll:
- "n > 0 \<Longrightarrow> (n choose k) = (if k = 0 then 1 else (n - 1) choose (k - 1) + ((n - 1) choose k))"
- by (auto simp add: gr0_conv_Suc)
-
-lemma sum_unroll:
- "(\<Sum>k\<le>n::nat. f k) = (if n = 0 then f 0 else f n + (\<Sum>k\<le>n - 1. f k))"
-by auto (metis One_nat_def Suc_pred add.commute sum.atMost_Suc)
-
-lemma bernoulli_unroll:
- "n > 0 \<Longrightarrow> bernoulli n = - 1 / (real n + 1) * (\<Sum>k\<le>n - 1. real (n + 1 choose k) * bernoulli k)"
-by (cases n) (simp add: bernoulli.simps One_nat_def)+
-
-lemmas unroll = binomial_unroll
- bernoulli.simps(1) bernoulli_unroll sum_unroll bernpoly_def
-
-lemma sum_of_squares: "(\<Sum>k\<le>n::nat. k ^ 2) = (2 * n ^ 3 + 3 * n ^ 2 + n) / 6"
-proof -
- have "real (\<Sum>k\<le>n::nat. k ^ 2) = (\<Sum>k\<le>n::nat. (real k) ^ 2)" by simp
- also have "... = (bernpoly 3 (real (n + 1)) - bernpoly 3 0) / real (3 :: nat)"
- by (auto simp add: sum_of_powers)
- also have "... = (2 * n ^ 3 + 3 * n ^ 2 + n) / 6"
- by (simp add: unroll algebra_simps power2_eq_square power3_eq_cube One_nat_def[symmetric])
- finally show ?thesis by simp
-qed
-
-lemma sum_of_squares_nat: "(\<Sum>k\<le>n::nat. k ^ 2) = (2 * n ^ 3 + 3 * n ^ 2 + n) div 6"
-proof -
- from sum_of_squares have "real (6 * (\<Sum>k\<le>n. k ^ 2)) = real (2 * n ^ 3 + 3 * n ^ 2 + n)"
- by (auto simp add: field_simps)
- then have "6 * (\<Sum>k\<le>n. k ^ 2) = 2 * n ^ 3 + 3 * n ^ 2 + n"
- using of_nat_eq_iff by blast
- then show ?thesis by auto
-qed
-
-lemma sum_of_cubes: "(\<Sum>k\<le>n::nat. k ^ 3) = (n ^ 2 + n) ^ 2 / 4"
-proof -
- have two_plus_two: "2 + 2 = 4" by simp
- have power4_eq: "\<And>x::real. x ^ 4 = x * x * x * x"
- by (simp only: two_plus_two[symmetric] power_add power2_eq_square)
- have "real (\<Sum>k\<le>n::nat. k ^ 3) = (\<Sum>k\<le>n::nat. (real k) ^ 3)" by simp
- also have "... = ((bernpoly 4 (n + 1) - bernpoly 4 0)) / (real (4 :: nat))"
- by (auto simp add: sum_of_powers)
- also have "... = ((n ^ 2 + n) / 2) ^ 2"
- by (simp add: unroll algebra_simps power2_eq_square power4_eq power3_eq_cube)
- finally show ?thesis by (simp add: power_divide)
-qed
-
-lemma sum_of_cubes_nat: "(\<Sum>k\<le>n::nat. k ^ 3) = (n ^ 2 + n) ^ 2 div 4"
-proof -
- from sum_of_cubes have "real (4 * (\<Sum>k\<le>n. k ^ 3)) = real ((n ^ 2 + n) ^ 2)"
- by (auto simp add: field_simps)
- then have "4 * (\<Sum>k\<le>n. k ^ 3) = (n ^ 2 + n) ^ 2"
- using of_nat_eq_iff by blast
- then show ?thesis by auto
-qed
-
-end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/ex/Word_Lsb_Msb.thy Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,146 @@
+theory Word_Lsb_Msb
+ imports "HOL-Library.Word"
+begin
+
+class word = ring_bit_operations +
+ fixes word_length :: \<open>'a itself \<Rightarrow> nat\<close>
+ assumes word_length_positive [simp]: \<open>0 < word_length TYPE('a)\<close>
+ and possible_bit_msb: \<open>possible_bit TYPE('a) (word_length TYPE('a) - Suc 0)\<close>
+ and not_possible_bit_length: \<open>\<not> possible_bit TYPE('a) (word_length TYPE('a))\<close>
+begin
+
+lemma word_length_not_0 [simp]:
+ \<open>word_length TYPE('a) \<noteq> 0\<close>
+ using word_length_positive
+ by simp
+
+lemma possible_bit_iff_less_word_length:
+ \<open>possible_bit TYPE('a) n \<longleftrightarrow> n < word_length TYPE('a)\<close> (is \<open>?P \<longleftrightarrow> ?Q\<close>)
+proof
+ assume \<open>?P\<close>
+ show ?Q
+ proof (rule ccontr)
+ assume \<open>\<not> n < word_length TYPE('a)\<close>
+ then have \<open>word_length TYPE('a) \<le> n\<close>
+ by simp
+ with \<open>?P\<close> have \<open>possible_bit TYPE('a) (word_length TYPE('a))\<close>
+ by (rule possible_bit_less_imp)
+ with not_possible_bit_length show False ..
+ qed
+next
+ assume \<open>?Q\<close>
+ then have \<open>n \<le> word_length TYPE('a) - Suc 0\<close>
+ by simp
+ with possible_bit_msb show ?P
+ by (rule possible_bit_less_imp)
+qed
+
+end
+
+instantiation word :: (len) word
+begin
+
+definition word_length_word :: \<open>'a word itself \<Rightarrow> nat\<close>
+ where [simp, code_unfold]: \<open>word_length_word _ = LENGTH('a)\<close>
+
+instance
+ by standard simp_all
+
+end
+
+context word
+begin
+
+context
+ includes bit_operations_syntax
+begin
+
+abbreviation lsb :: \<open>'a \<Rightarrow> bool\<close>
+ where \<open>lsb \<equiv> odd\<close>
+
+definition msb :: \<open>'a \<Rightarrow> bool\<close>
+ where \<open>msb w = bit w (word_length TYPE('a) - Suc 0)\<close>
+
+lemma not_msb_0 [simp]:
+ \<open>\<not> msb 0\<close>
+ by (simp add: msb_def)
+
+lemma msb_minus_1 [simp]:
+ \<open>msb (- 1)\<close>
+ by (simp add: msb_def possible_bit_iff_less_word_length)
+
+lemma msb_1_iff [simp]:
+ \<open>msb 1 \<longleftrightarrow> word_length TYPE('a) = 1\<close>
+ by (auto simp add: msb_def bit_simps le_less)
+
+lemma msb_minus_iff [simp]:
+ \<open>msb (- w) \<longleftrightarrow> \<not> msb (w - 1)\<close>
+ by (simp add: msb_def bit_simps possible_bit_iff_less_word_length)
+
+lemma msb_not_iff [simp]:
+ \<open>msb (NOT w) \<longleftrightarrow> \<not> msb w\<close>
+ by (simp add: msb_def bit_simps possible_bit_iff_less_word_length)
+
+lemma msb_and_iff [simp]:
+ \<open>msb (v AND w) \<longleftrightarrow> msb v \<and> msb w\<close>
+ by (simp add: msb_def bit_simps)
+
+lemma msb_or_iff [simp]:
+ \<open>msb (v OR w) \<longleftrightarrow> msb v \<or> msb w\<close>
+ by (simp add: msb_def bit_simps)
+
+lemma msb_xor_iff [simp]:
+ \<open>msb (v XOR w) \<longleftrightarrow> \<not> (msb v \<longleftrightarrow> msb w)\<close>
+ by (simp add: msb_def bit_simps)
+
+lemma msb_exp_iff [simp]:
+ \<open>msb (2 ^ n) \<longleftrightarrow> n = word_length TYPE('a) - Suc 0\<close>
+ by (simp add: msb_def bit_simps possible_bit_iff_less_word_length)
+
+lemma msb_mask_iff [simp]:
+ \<open>msb (mask n) \<longleftrightarrow> word_length TYPE('a) \<le> n\<close>
+ by (simp add: msb_def bit_simps less_diff_conv2 Suc_le_eq less_Suc_eq_le possible_bit_iff_less_word_length)
+
+lemma msb_set_bit_iff [simp]:
+ \<open>msb (set_bit n w) \<longleftrightarrow> n = word_length TYPE('a) - Suc 0 \<or> msb w\<close>
+ by (simp add: set_bit_eq_or ac_simps)
+
+lemma msb_unset_bit_iff [simp]:
+ \<open>msb (unset_bit n w) \<longleftrightarrow> n \<noteq> word_length TYPE('a) - Suc 0 \<and> msb w\<close>
+ by (simp add: unset_bit_eq_and_not ac_simps)
+
+lemma msb_flip_bit_iff [simp]:
+ \<open>msb (flip_bit n w) \<longleftrightarrow> (n \<noteq> word_length TYPE('a) - Suc 0 \<longleftrightarrow> msb w)\<close>
+ by (auto simp add: flip_bit_eq_xor)
+
+lemma msb_push_bit_iff:
+ \<open>msb (push_bit n w) \<longleftrightarrow> n < word_length TYPE('a) \<and> bit w (word_length TYPE('a) - Suc n)\<close>
+ by (simp add: msb_def bit_simps le_diff_conv2 Suc_le_eq possible_bit_iff_less_word_length)
+
+lemma msb_drop_bit_iff [simp]:
+ \<open>msb (drop_bit n w) \<longleftrightarrow> n = 0 \<and> msb w\<close>
+ by (cases n)
+ (auto simp add: msb_def bit_simps possible_bit_iff_less_word_length intro!: impossible_bit)
+
+lemma msb_take_bit_iff [simp]:
+ \<open>msb (take_bit n w) \<longleftrightarrow> word_length TYPE('a) \<le> n \<and> msb w\<close>
+ by (simp add: take_bit_eq_mask ac_simps)
+
+lemma msb_signed_take_bit_iff:
+ \<open>msb (signed_take_bit n w) \<longleftrightarrow> bit w (min n (word_length TYPE('a) - Suc 0))\<close>
+ by (simp add: msb_def bit_simps possible_bit_iff_less_word_length)
+
+definition signed_drop_bit :: \<open>nat \<Rightarrow> 'a \<Rightarrow> 'a\<close>
+ where \<open>signed_drop_bit n w = drop_bit n w
+ OR (of_bool (bit w (word_length TYPE('a) - Suc 0)) * NOT (mask (word_length TYPE('a) - Suc n)))\<close>
+
+lemma msb_signed_drop_bit_iff [simp]:
+ \<open>msb (signed_drop_bit n w) \<longleftrightarrow> msb w\<close>
+ by (simp add: signed_drop_bit_def bit_simps not_le not_less)
+ (simp add: msb_def)
+
+end
+
+end
+
+end
--- a/src/LCF/ROOT Sat Jun 25 13:34:41 2022 +0200
+++ b/src/LCF/ROOT Fri Sep 02 13:41:55 2022 +0200
@@ -1,4 +1,4 @@
-chapter LCF
+chapter FOL
session LCF = Pure +
description "
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Pure/Admin/build_cvc5.scala Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,138 @@
+/* Title: Pure/Admin/build_cvc5scala
+ Author: Makarius
+
+Build Isabelle component for cvc5. See also:
+
+ - https://cvc5.github.io/
+ - https://github.com/cvc5/cvc5
+*/
+
+package isabelle
+
+
+object Build_CVC5 {
+ /* platform information */
+
+ sealed case class CVC5_Platform(platform_name: String, download_name: String) {
+ def is_windows: Boolean = platform_name.endsWith("-windows")
+ }
+
+ val platforms: List[CVC5_Platform] =
+ List(
+ CVC5_Platform("arm64-darwin", "cvc5-macOS-arm64"),
+ CVC5_Platform("x86_64-darwin", "cvc5-macOS"),
+ CVC5_Platform("x86_64-linux", "cvc5-Linux"),
+ CVC5_Platform("x86_64-windows", "cvc5-Win64.exe"))
+
+
+ /* build cvc5 */
+
+ val default_url = "https://github.com/cvc5/cvc5/releases/download"
+ val default_version = "1.0.2"
+
+ def build_cvc5(
+ base_url: String = default_url,
+ version: String = default_version,
+ target_dir: Path = Path.current,
+ progress: Progress = new Progress
+ ): Unit = {
+ /* component name */
+
+ val component = "cvc5-" + version
+ val component_dir = Isabelle_System.new_directory(target_dir + Path.basic(component))
+ progress.echo("Component " + component_dir)
+
+
+ /* download executables */
+
+ for (platform <- platforms) {
+ val url = base_url + "/cvc5-" + version + "/" + platform.download_name
+
+ val platform_dir = component_dir + Path.explode(platform.platform_name)
+ val platform_exe = platform_dir + Path.explode("cvc5").exe_if(platform.is_windows)
+
+ Isabelle_System.make_directory(platform_dir)
+ Isabelle_System.download_file(url, platform_exe, progress = progress)
+ File.set_executable(platform_exe, true)
+ }
+
+
+ /* settings */
+
+ val etc_dir = Isabelle_System.make_directory(component_dir + Path.basic("etc"))
+ File.write(etc_dir + Path.basic("settings"),
+ """# -*- shell-script -*- :mode=shellscript:
+
+CVC5_HOME="$COMPONENT/${ISABELLE_WINDOWS_PLATFORM64:-${ISABELLE_APPLE_PLATFORM64:-$ISABELLE_PLATFORM64}}"
+CVC5_VERSION=""" + Bash.string(version) + """
+
+CVC5_SOLVER="$CVC5_HOME/cvc5"
+
+if [ -e "$CVC5_HOME" ]
+then
+ CVC5_INSTALLED="yes"
+fi
+""")
+
+
+ /* README */
+
+ File.write(component_dir + Path.basic("README"),
+ """This distribution of cvc5 was assembled from the official downloads
+from """ + base_url + """ for 64bit macOS,
+Linux, and Windows. There is native support for macOS ARM64, but
+Linux ARM64 is missing.
+
+The oldest supported version of macOS is 10.14 Mojave.
+
+The downloaded files were renamed and made executable.
+
+
+ Makarius
+ """ + Date.Format.date(Date.now()) + "\n")
+
+
+ /* AUTHORS and COPYING */
+
+ // download "latest" versions as reasonable approximation
+ def raw_download(name: String): Unit =
+ Isabelle_System.download_file("https://raw.githubusercontent.com/cvc5/cvc5/main/" + name,
+ component_dir + Path.explode(name))
+
+ raw_download("AUTHORS")
+ raw_download("COPYING")
+ }
+
+
+ /* Isabelle tool wrapper */
+
+ val isabelle_tool =
+ Isabelle_Tool("build_cvc5", "build component for cvc5", Scala_Project.here,
+ { args =>
+ var target_dir = Path.current
+ var base_url = default_url
+ var version = default_version
+
+ val getopts = Getopts("""
+Usage: isabelle build_cvc5 [OPTIONS]
+
+ Options are:
+ -D DIR target directory (default ".")
+ -U URL download URL (default: """" + default_url + """")
+ -V VERSION version (default: """" + default_version + """")
+
+ Build component for Java Chromium Embedded Framework.
+""",
+ "D:" -> (arg => target_dir = Path.explode(arg)),
+ "U:" -> (arg => base_url = arg),
+ "V:" -> (arg => version = arg))
+
+ val more_args = getopts(args)
+ if (more_args.nonEmpty) getopts.usage()
+
+ val progress = new Console_Progress()
+
+ build_cvc5(base_url = base_url, version = version, target_dir = target_dir,
+ progress = progress)
+ })
+}
--- a/src/Pure/Admin/build_cygwin.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Admin/build_cygwin.scala Fri Sep 02 13:41:55 2022 +0200
@@ -8,7 +8,7 @@
object Build_Cygwin {
- val default_mirror: String = "https://isabelle.sketis.net/cygwin_2021-1"
+ val default_mirror: String = "https://isabelle.sketis.net/cygwin_2022"
val packages: List[String] =
List("curl", "libgmp-devel", "nano", "rsync", "unzip")
--- a/src/Pure/Admin/build_doc.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Admin/build_doc.scala Fri Sep 02 13:41:55 2022 +0200
@@ -54,9 +54,12 @@
progress.expose_interrupt()
progress.echo("Documentation " + quote(doc) + " ...")
- using(store.open_database_context())(db_context =>
- Document_Build.build_documents(Document_Build.context(session, deps, db_context),
- output_pdf = Some(Path.explode("~~/doc"))))
+ using(Export.open_session_context(store, deps.base_info(session))) {
+ session_context =>
+ Document_Build.build_documents(
+ Document_Build.context(session_context),
+ output_pdf = Some(Path.explode("~~/doc")))
+ }
None
}
catch {
--- a/src/Pure/Admin/build_jcef.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Admin/build_jcef.scala Fri Sep 02 13:41:55 2022 +0200
@@ -71,11 +71,11 @@
for {
file <- File.find_files(platform_dir.file).iterator
name = file.getName
- if name.endsWith(".dll") || name.endsWith(".exe")
+ if File.is_dll(name) || File.is_exe(name)
} File.set_executable(File.path(file), true)
val classpath =
- File.find_files(platform_dir.file, pred = (file => file.getName.endsWith(".jar")))
+ File.find_files(platform_dir.file, pred = file => File.is_jar(file.getName))
.flatMap(file => File.relative_path(platform_dir, File.path(file)))
.map(jar => " " + quote("$ISABELLE_JCEF_HOME/" + jar.implode))
.mkString(" \\\n")
--- a/src/Pure/Admin/build_jdk.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Admin/build_jdk.scala Fri Sep 02 13:41:55 2022 +0200
@@ -69,7 +69,7 @@
/* README */
def readme(jdk_version: String): String =
-"""This is OpenJDK """ + jdk_version + """ based on downloads by Azul, see also
+ """This is OpenJDK """ + jdk_version + """ based on downloads by Azul, see also
https://www.azul.com/downloads/zulu-community/?package=jdk
The main license is GPL2, but some modules are covered by other (more liberal)
@@ -83,7 +83,7 @@
/* settings */
val settings: String =
-"""# -*- shell-script -*- :mode=shellscript:
+ """# -*- shell-script -*- :mode=shellscript:
case "$ISABELLE_PLATFORM_FAMILY" in
linux)
--- a/src/Pure/Admin/build_jedit.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Admin/build_jedit.scala Fri Sep 02 13:41:55 2022 +0200
@@ -161,7 +161,7 @@
for {
file <- File.find_files(Path.explode("~~/src/Tools/jEdit/patches").file).iterator
name = file.getName
- if !name.endsWith("~") && !name.endsWith(".orig")
+ if !File.is_backup(name)
} {
progress.bash("patch -p2 < " + File.bash_path(File.path(file)),
cwd = source_dir.file, echo = true).check
@@ -181,7 +181,7 @@
val java_sources =
for {
- file <- File.find_files(org_source_dir.file, file => file.getName.endsWith(".java"))
+ file <- File.find_files(org_source_dir.file, file => File.is_java(file.getName))
package_name <- Scala_Project.package_name(File.path(file))
if !exclude_package(package_name)
} yield File.path(component_dir.java_path.relativize(file.toPath).toFile).implode
--- a/src/Pure/Admin/build_log.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Admin/build_log.scala Fri Sep 02 13:41:55 2022 +0200
@@ -108,8 +108,8 @@
def apply(file: JFile): Log_File = {
val name = file.getName
val text =
- if (name.endsWith(".gz")) File.read_gzip(file)
- else if (name.endsWith(".xz")) File.read_xz(file)
+ if (File.is_gz(name)) File.read_gzip(file)
+ else if (File.is_xz(name)) File.read_xz(file)
else File.read(file)
apply(name, text)
}
@@ -718,7 +718,7 @@
/* recent entries */
- def recent_time(days: Int): SQL.Source =
+ def recent_time(days: Int): PostgreSQL.Source =
"now() - INTERVAL '" + days.max(0) + " days'"
def recent_pull_date_table(
@@ -744,7 +744,7 @@
else "")))
}
- def select_recent_log_names(days: Int): SQL.Source = {
+ def select_recent_log_names(days: Int): PostgreSQL.Source = {
val table1 = meta_info_table
val table2 = recent_pull_date_table(days)
table1.select(List(log_name), distinct = true) + SQL.join_inner + table2.query_named +
@@ -755,8 +755,8 @@
days: Int,
rev: String = "",
afp_rev: Option[String] = None,
- sql: SQL.Source = ""
- ): SQL.Source = {
+ sql: PostgreSQL.Source = ""
+ ): PostgreSQL.Source = {
val afp = afp_rev.isDefined
val version = Prop.isabelle_version
val table1 = recent_pull_date_table(days, rev = rev, afp_rev = afp_rev)
@@ -910,7 +910,7 @@
db2.create_view(Data.universal_table)
}
}
- db2.rebuild
+ db2.rebuild()
}
}
--- a/src/Pure/Admin/build_pdfjs.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Admin/build_pdfjs.scala Fri Sep 02 13:41:55 2022 +0200
@@ -17,7 +17,7 @@
/* build pdfjs component */
val default_url = "https://github.com/mozilla/pdf.js/releases/download"
- val default_version = "2.12.313"
+ val default_version = "2.14.305"
def build_pdfjs(
base_url: String = default_url,
@@ -39,7 +39,7 @@
val download_url = base_url + "/v" + version
Isabelle_System.with_tmp_file("archive", ext = "zip") { archive_file =>
- Isabelle_System.download_file(download_url + "/pdfjs-" + version + "-dist.zip",
+ Isabelle_System.download_file(download_url + "/pdfjs-" + version + "-legacy-dist.zip",
archive_file, progress = progress)
Isabelle_System.bash("unzip -x " + File.bash_path(archive_file),
cwd = component_dir.file).check
--- a/src/Pure/Admin/build_release.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Admin/build_release.scala Fri Sep 02 13:41:55 2022 +0200
@@ -222,17 +222,22 @@
options: Options,
platform: Platform.Family.Value,
build_sessions: List[String],
- local_dir: Path
+ local_dir: Path,
+ progress: Progress = new Progress,
): Unit = {
val server_option = "build_host_" + platform.toString
+ val server = options.string(server_option)
+ progress.echo("Building heaps " + commas_quote(build_sessions) +
+ " (" + server_option + " = " + quote(server) + ") ...")
+
val ssh =
- options.string(server_option) match {
+ server match {
case "" =>
if (Platform.family == platform) SSH.Local
else error("Undefined option " + server_option + ": cannot build heaps")
case SSH.Target(user, host) =>
SSH.open_session(options, host = host, user = user)
- case s => error("Malformed option " + server_option + ": " + quote(s))
+ case _ => error("Malformed option " + server_option + ": " + quote(server))
}
try {
Isabelle_System.with_tmp_file("tmp", ext = "tar") { local_tmp_tar =>
@@ -583,8 +588,7 @@
// build heaps
if (build_sessions.nonEmpty) {
- progress.echo("Building heaps " + commas_quote(build_sessions) + " ...")
- build_heaps(options, platform, build_sessions, isabelle_target)
+ build_heaps(options, platform, build_sessions, isabelle_target, progress = progress)
}
--- a/src/Pure/Admin/build_status.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Admin/build_status.scala Fri Sep 02 13:41:55 2022 +0200
@@ -36,7 +36,7 @@
options: Options,
columns: List[SQL.Column],
only_sessions: Set[String]
- ): SQL.Source = {
+ ): PostgreSQL.Source = {
Build_Log.Data.universal_table.select(columns, distinct = true,
sql = "WHERE " +
Build_Log.Data.pull_date(afp) + " > " + Build_Log.Data.recent_time(days(options)) +
--- a/src/Pure/Admin/check_sources.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Admin/check_sources.scala Fri Sep 02 13:41:55 2022 +0200
@@ -50,7 +50,7 @@
val hg = Mercurial.repository(root)
for {
file <- hg.known_files()
- if file.endsWith(".thy") || file.endsWith(".ML") || file.endsWith("/ROOT")
+ if File.is_thy(file) || File.is_ML(file) || file.endsWith("/ROOT")
} check_file(root + Path.explode(file))
}
--- a/src/Pure/Admin/isabelle_cronjob.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Admin/isabelle_cronjob.scala Fri Sep 02 13:41:55 2022 +0200
@@ -110,7 +110,7 @@
days: Int,
rev: String,
afp_rev: Option[String],
- sql: SQL.Source
+ sql: PostgreSQL.Source
): List[Item] = {
val afp = afp_rev.isDefined
val select =
@@ -150,7 +150,7 @@
afp: Boolean = false,
bulky: Boolean = false,
more_hosts: List[String] = Nil,
- detect: SQL.Source = "",
+ detect: PostgreSQL.Source = "",
active: Boolean = true
) {
def ssh_session(context: SSH.Context): SSH.Session =
@@ -158,7 +158,7 @@
proxy_host = proxy_host, proxy_user = proxy_user, proxy_port = proxy_port,
permissive = proxy_host.nonEmpty)
- def sql: SQL.Source =
+ def sql: PostgreSQL.Source =
Build_Log.Prop.build_engine.toString + " = " + SQL.string(Build_History.engine) + " AND " +
SQL.member(Build_Log.Prop.build_host.ident, host :: more_hosts) +
(if (detect == "") "" else " AND " + SQL.enclose(detect))
@@ -208,6 +208,10 @@
val remote_builds_old: List[Remote_Build] =
List(
+ Remote_Build("macOS 10.15 Catalina", "laramac01", user = "makarius",
+ proxy_host = "laraserver", proxy_user = "makarius",
+ options = "-m32 -M4 -e ISABELLE_GHC_SETUP=true -p pide_session=false",
+ args = "-a -d '~~/src/Benchmarks'"),
Remote_Build("Linux A", "i21of4", user = "i21isatest",
proxy_host = "lxbroy10", proxy_user = "i21isatest",
options = "-m32 -M1x4,2,4" +
@@ -348,10 +352,11 @@
Remote_Build("macOS, skip_proofs", "mini2",
options = "-m32 -M4 -t skip_proofs -p pide_session=false", args = "-a -o skip_proofs",
detect = Build_Log.Prop.build_tags.toString + " = " + SQL.string("skip_proofs"))),
- List(Remote_Build("macOS 10.15 Catalina", "laramac01", user = "makarius",
- proxy_host = "laraserver", proxy_user = "makarius",
- options = "-m32 -M4 -e ISABELLE_GHC_SETUP=true -p pide_session=false",
- args = "-a -d '~~/src/Benchmarks'")),
+ List(
+ Remote_Build("macOS 10.15 Catalina", "monterey", actual_host = "laramac01",
+ user = "makarius", proxy_host = "laraserver", proxy_user = "makarius",
+ options = "-m32 -M4 -e ISABELLE_GHC_SETUP=true -p pide_session=false",
+ args = "-a -d '~~/src/Benchmarks'")),
List(
Remote_Build("Windows", "vmnipkow9", historic = true, history = 90,
options = "-m32 -M4" +
--- a/src/Pure/GUI/gui.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/GUI/gui.scala Fri Sep 02 13:41:55 2022 +0200
@@ -13,8 +13,8 @@
import java.awt.geom.AffineTransform
import javax.swing.{ImageIcon, JButton, JDialog, JFrame, JLabel, JLayeredPane, JOptionPane,
JTextField, JWindow, LookAndFeel, UIManager, SwingUtilities}
-import scala.swing.{ComboBox, ScrollPane, TextArea}
-import scala.swing.event.SelectionChanged
+import scala.swing.{CheckBox, ComboBox, ScrollPane, TextArea}
+import scala.swing.event.{ButtonClicked, SelectionChanged}
object GUI {
@@ -111,14 +111,37 @@
}
- /* zoom box */
+ /* basic GUI components */
+
+ class Button(label: String) extends scala.swing.Button(label) {
+ def clicked(): Unit = {}
+
+ reactions += { case ButtonClicked(_) => clicked() }
+ }
+
+ class Check(label: String, init: Boolean = false) extends CheckBox(label) {
+ def clicked(state: Boolean): Unit = {}
+ def clicked(): Unit = {}
+
+ selected = init
+ reactions += { case ButtonClicked(_) => clicked(selected); clicked() }
+ }
+
+ class Selector[A](val entries: List[A]) extends ComboBox[A](entries) {
+ def changed(): Unit = {}
+
+ listenTo(selection)
+ reactions += { case SelectionChanged(_) => changed() }
+ }
+
+
+ /* zoom factor */
private val Zoom_Factor = "([0-9]+)%?".r
- abstract class Zoom_Box extends ComboBox[String](
+ class Zoom extends Selector[String](
List("50%", "70%", "85%", "100%", "125%", "150%", "175%", "200%", "300%", "400%")
) {
- def changed: Unit
def factor: Int = parse(selection.item)
private def parse(text: String): Int =
@@ -145,9 +168,6 @@
}
selection.index = 3
-
- listenTo(selection)
- reactions += { case SelectionChanged(_) => changed }
}
--- a/src/Pure/General/bytes.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/General/bytes.scala Fri Sep 02 13:41:55 2022 +0200
@@ -57,12 +57,11 @@
val buf = new Array[Byte](8192)
var m = 0
- var cont = true
- while (cont) {
+ while ({
m = stream.read(buf, 0, buf.length min (limit - out.size))
if (m != -1) out.write(buf, 0, m)
- cont = (m != -1 && limit > out.size)
- }
+ m != -1 && limit > out.size
+ }) ()
new Bytes(out.toByteArray, 0, out.size)
}
--- a/src/Pure/General/file.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/General/file.scala Fri Sep 02 13:41:55 2022 +0200
@@ -13,7 +13,7 @@
import java.nio.file.{StandardOpenOption, Path => JPath, Files, SimpleFileVisitor,
FileVisitOption, FileVisitResult}
import java.nio.file.attribute.BasicFileAttributes
-import java.net.{URL, MalformedURLException}
+import java.net.{URI, URL, MalformedURLException}
import java.util.zip.{GZIPInputStream, GZIPOutputStream}
import java.util.EnumSet
@@ -62,6 +62,32 @@
def path(file: JFile): Path = Path.explode(standard_path(file))
def pwd(): Path = path(Path.current.absolute_file)
+ def uri(file: JFile): URI = file.toURI
+ def uri(path: Path): URI = path.file.toURI
+
+ def url(file: JFile): URL = uri(file).toURL
+ def url(path: Path): URL = url(path.file)
+
+
+ /* adhoc file types */
+
+ def is_ML(s: String): Boolean = s.endsWith(".ML")
+ def is_bib(s: String): Boolean = s.endsWith(".bib")
+ def is_dll(s: String): Boolean = s.endsWith(".dll")
+ def is_exe(s: String): Boolean = s.endsWith(".exe")
+ def is_gz(s: String): Boolean = s.endsWith(".gz")
+ def is_html(s: String): Boolean = s.endsWith(".html")
+ def is_jar(s: String): Boolean = s.endsWith(".jar")
+ def is_java(s: String): Boolean = s.endsWith(".java")
+ def is_node(s: String): Boolean = s.endsWith(".node")
+ def is_pdf(s: String): Boolean = s.endsWith(".pdf")
+ def is_png(s: String): Boolean = s.endsWith(".png")
+ def is_thy(s: String): Boolean = s.endsWith(".thy")
+ def is_xz(s: String): Boolean = s.endsWith(".xz")
+ def is_zip(s: String): Boolean = s.endsWith(".zip")
+
+ def is_backup(s: String): Boolean = s.endsWith("~") || s.endsWith(".orig")
+
/* relative paths */
@@ -295,18 +321,13 @@
/* content */
- object Content {
- def apply(path: Path, content: Bytes): Content = new Content_Bytes(path, content)
- def apply(path: Path, content: String): Content = new Content_String(path, content)
- def apply(path: Path, content: XML.Body): Content_XML = new Content_XML(path, content)
- }
+ def content(path: Path, content: Bytes): Content = new Content(path, content)
+ def content(path: Path, content: String): Content = new Content(path, Bytes(content))
+ def content(path: Path, content: XML.Body): Content_XML = new Content_XML(path, content)
- trait Content {
- def path: Path
- def write(dir: Path): Unit
- }
+ final class Content private[File](val path: Path, val content: Bytes) {
+ override def toString: String = path.toString
- final class Content_Bytes private[File](val path: Path, content: Bytes) extends Content {
def write(dir: Path): Unit = {
val full_path = dir + path
Isabelle_System.make_directory(full_path.expand.dir)
@@ -314,16 +335,9 @@
}
}
- final class Content_String private[File](val path: Path, content: String) extends Content {
- def write(dir: Path): Unit = {
- val full_path = dir + path
- Isabelle_System.make_directory(full_path.expand.dir)
- File.write(full_path, content)
- }
- }
+ final class Content_XML private[File](val path: Path, val content: XML.Body) {
+ override def toString: String = path.toString
- final class Content_XML private[File](val path: Path, content: XML.Body) {
- def output(out: XML.Body => String): Content_String =
- new Content_String(path, out(content))
+ def output(out: XML.Body => String): Content = new Content(path, Bytes(out(content)))
}
}
--- a/src/Pure/General/json.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/General/json.scala Fri Sep 02 13:41:55 2022 +0200
@@ -165,67 +165,96 @@
try { Some(parse(s, strict = false)) }
catch { case ERROR(_) => None }
- def apply_lines(json: List[T]): S = json.map(apply).mkString("[", ",\n", "]")
+ private def output_string(s: String, result: StringBuilder): Unit = {
+ result += '"'
+ result ++=
+ s.iterator.map {
+ case '"' => "\\\""
+ case '\\' => "\\\\"
+ case '\b' => "\\b"
+ case '\f' => "\\f"
+ case '\n' => "\\n"
+ case '\r' => "\\r"
+ case '\t' => "\\t"
+ case c =>
+ if (c <= '\u001f' || c >= '\u007f' && c <= '\u009f') "\\u%04x".format(c.toInt)
+ else c
+ }.mkString
+ result += '"'
+ }
+
+ private def output_atom(x: T, result: StringBuilder): Boolean =
+ x match {
+ case null => result ++= "null"; true
+ case _: Int | _ : Long | _: Boolean => result ++= x.toString; true
+ case n: Double =>
+ val i = n.toLong
+ result ++= (if (i.toDouble == n) i.toString else n.toString)
+ true
+ case s: String => output_string(s, result); true
+ case _ => false
+ }
def apply(json: T): S = {
val result = new StringBuilder
- def string(s: String): Unit = {
- result += '"'
- result ++=
- s.iterator.map {
- case '"' => "\\\""
- case '\\' => "\\\\"
- case '\b' => "\\b"
- case '\f' => "\\f"
- case '\n' => "\\n"
- case '\r' => "\\r"
- case '\t' => "\\t"
- case c =>
- if (c <= '\u001f' || c >= '\u007f' && c <= '\u009f') "\\u%04x".format(c.toInt)
- else c
- }.mkString
- result += '"'
- }
-
- def array(list: List[T]): Unit = {
- result += '['
- Library.separate(None, list.map(Some(_))).foreach({
- case None => result += ','
- case Some(x) => json_format(x)
- })
- result += ']'
- }
-
- def object_(obj: Object.T): Unit = {
- result += '{'
- Library.separate(None, obj.toList.map(Some(_))).foreach({
- case None => result += ','
- case Some((x, y)) =>
- string(x)
- result += ':'
- json_format(y)
- })
- result += '}'
- }
-
- def json_format(x: T): Unit = {
- x match {
- case null => result ++= "null"
- case _: Int | _: Long | _: Boolean => result ++= x.toString
- case n: Double =>
- val i = n.toLong
- result ++= (if (i.toDouble == n) i.toString else n.toString)
- case s: String => string(s)
- case Object(m) => object_(m)
- case list: List[T] => array(list)
- case _ => error("Bad JSON value: " + x.toString)
+ def output(x: T): Unit = {
+ if (!output_atom(x, result)) {
+ x match {
+ case Object(obj) =>
+ result += '{'
+ Library.separate(None, obj.toList.map(Some(_))).foreach({
+ case None => result += ','
+ case Some((x, y)) =>
+ output_string(x, result)
+ result += ':'
+ output(y)
+ })
+ result += '}'
+ case list: List[T] =>
+ result += '['
+ Library.separate(None, list.map(Some(_))).foreach({
+ case None => result += ','
+ case Some(x) => output(x)
+ })
+ result += ']'
+ case _ => error("Bad JSON value: " + x.toString)
+ }
}
}
- json_format(json)
+ output(json)
result.toString
}
+
+ private def pretty_atom(x: T): Option[XML.Tree] = {
+ val result = new StringBuilder
+ val ok = output_atom(x, result)
+ if (ok) Some(XML.Text(result.toString)) else None
+ }
+
+ private def pretty_string(s: String): XML.Tree = {
+ val result = new StringBuilder
+ output_string(s, result)
+ XML.Text(result.toString)
+ }
+
+ private def pretty_tree(x: T): XML.Tree =
+ x match {
+ case Object(obj) =>
+ Pretty.`enum`(
+ for ((x, y) <- obj.toList)
+ yield Pretty.block(List(pretty_string(x), XML.Text(":"), Pretty.brk(1), pretty(y))),
+ bg = "{", en = "}", indent = 1)
+ case list: List[T] =>
+ Pretty.`enum`(list.map(pretty), bg = "[", en = "]", indent = 1)
+ case _ => error("Bad JSON value: " + x.toString)
+ }
+
+ def pretty(x: T): XML.Tree = pretty_atom(x) getOrElse pretty_tree(x)
+
+ def pretty_print(x: T, margin: Int = Pretty.default_margin.toInt): JSON.S =
+ Pretty.string_of(List(pretty(x)), margin = margin.toDouble)
}
--- a/src/Pure/General/mailman.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/General/mailman.scala Fri Sep 02 13:41:55 2022 +0200
@@ -420,7 +420,7 @@
def find_messages(dir: Path): List[Message] = {
for {
- file <- File.find_files(dir.file, file => file.getName.endsWith(".html"))
+ file <- File.find_files(dir.file, file => File.is_html(file.getName))
rel_path <- File.relative_path(dir, File.path(file))
}
yield {
--- a/src/Pure/General/mercurial.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/General/mercurial.scala Fri Sep 02 13:41:55 2022 +0200
@@ -323,10 +323,10 @@
Rsync.init(context0, target,
contents =
- File.Content(Hg_Sync.PATH_ID, id_content) ::
- File.Content(Hg_Sync.PATH_LOG, log_content) ::
- File.Content(Hg_Sync.PATH_DIFF, diff_content) ::
- File.Content(Hg_Sync.PATH_STAT, stat_content) :: contents)
+ File.content(Hg_Sync.PATH_ID, id_content) ::
+ File.content(Hg_Sync.PATH_LOG, log_content) ::
+ File.content(Hg_Sync.PATH_DIFF, diff_content) ::
+ File.content(Hg_Sync.PATH_STAT, stat_content) :: contents)
val (exclude, source) =
if (rev.isEmpty) {
--- a/src/Pure/General/name_space.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/General/name_space.ML Fri Sep 02 13:41:55 2022 +0200
@@ -114,8 +114,7 @@
serial: serial};
fun entry_markup def kind (name, {pos, theory_long_name, serial, ...}: entry) =
- Position.make_entity_markup def serial kind (name, pos)
- ||> not (#def def orelse theory_long_name = "") ? cons (Markup.def_theoryN, theory_long_name);
+ Position.make_entity_markup def serial kind (name, pos);
fun print_entry_ref kind (name, entry) =
quote (Markup.markup (entry_markup {def = false} kind (name, entry)) name);
--- a/src/Pure/General/path.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/General/path.scala Fri Sep 02 13:41:55 2022 +0200
@@ -91,6 +91,8 @@
val USER_HOME: Path = variable("USER_HOME")
val ISABELLE_HOME: Path = variable("ISABELLE_HOME")
+ val index_html: Path = basic("index.html")
+
/* explode */
@@ -158,6 +160,10 @@
error(("Collision of file names due case-insensitivity:" :: collisions).mkString("\n "))
}
}
+
+ def eq_case_insensitive(path1: Path, path2: Path): Boolean =
+ path1 == path2 ||
+ Word.lowercase(path1.expand.implode) == Word.lowercase(path2.expand.implode)
}
@@ -246,7 +252,8 @@
}
def exe: Path = ext("exe")
- def platform_exe: Path = if (Platform.is_windows) exe else this
+ def exe_if(b: Boolean): Path = if (b) exe else this
+ def platform_exe: Path = exe_if(Platform.is_windows)
private val Ext = new Regex("(.*)\\.([^.]*)")
--- a/src/Pure/General/position.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/General/position.scala Fri Sep 02 13:41:55 2022 +0200
@@ -25,8 +25,6 @@
val Def_File = new Properties.String(Markup.DEF_FILE)
val Def_Id = new Properties.Long(Markup.DEF_ID)
- val Def_Theory = new Properties.String(Markup.DEF_THEORY)
-
object Line_File {
def apply(line: Int, file: String): T =
(if (line > 0) Line(line) else Nil) :::
--- a/src/Pure/General/pretty.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/General/pretty.scala Fri Sep 02 13:41:55 2022 +0200
@@ -18,10 +18,8 @@
else if (n == 1) space
else List(XML.Text(Symbol.spaces(n)))
- def block(consistent: Boolean, indent: Int, body: XML.Body): XML.Tree =
+ def block(body: XML.Body, consistent: Boolean = false, indent: Int = 2): XML.Tree =
XML.Elem(Markup.Block(consistent, indent), body)
- def block(indent: Int, body: XML.Body): XML.Tree = block(false, indent, body)
- def block(body: XML.Body): XML.Tree = block(2, body)
def brk(width: Int, indent: Int = 0): XML.Tree =
XML.Elem(Markup.Break(width, indent), spaces(width))
@@ -30,7 +28,18 @@
def fbreaks(ts: List[XML.Tree]): XML.Body = Library.separate(fbrk, ts)
val Separator: XML.Body = List(XML.elem(Markup.SEPARATOR, space), fbrk)
- def separate(ts: List[XML.Tree]): XML.Body = Library.separate(Separator, ts.map(List(_))).flatten
+ def separate(ts: List[XML.Tree], sep: XML.Body = Separator): XML.Body =
+ Library.separate(sep, ts.map(List(_))).flatten
+
+ val comma: XML.Body = List(XML.Text(","), brk(1))
+ def commas(ts: List[XML.Tree]): XML.Body = separate(ts, sep = comma)
+
+ def `enum`(ts: List[XML.Tree],
+ bg: String = "(",
+ en: String = ")",
+ sep: XML.Body = comma,
+ indent: Int = 2
+ ): XML.Tree = Pretty.block(XML.enclose(bg, en, separate(ts, sep = sep)), indent = indent)
/* text metric -- standardized to width of space */
--- a/src/Pure/General/properties.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/General/properties.scala Fri Sep 02 13:41:55 2022 +0200
@@ -43,10 +43,15 @@
/* external storage */
- def encode(ps: T): Bytes = Bytes(YXML.string_of_body(XML.Encode.properties(ps)))
+ def encode(ps: T): Bytes = {
+ if (ps.isEmpty) Bytes.empty
+ else Bytes(YXML.string_of_body(XML.Encode.properties(ps)))
+ }
- def decode(bs: Bytes, cache: XML.Cache = XML.Cache.none): T =
- cache.props(XML.Decode.properties(YXML.parse_body(bs.text)))
+ def decode(bs: Bytes, cache: XML.Cache = XML.Cache.none): T = {
+ if (bs.is_empty) Nil
+ else cache.props(XML.Decode.properties(YXML.parse_body(bs.text)))
+ }
def compress(ps: List[T],
options: XZ.Options = XZ.options(),
--- a/src/Pure/General/sha1.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/General/sha1.scala Fri Sep 02 13:41:55 2022 +0200
@@ -36,12 +36,11 @@
make_digest(sha => using(new FileInputStream(file)) { stream =>
val buf = new Array[Byte](65536)
var m = 0
- var cont = true
- while (cont) {
+ while ({
m = stream.read(buf, 0, buf.length)
if (m != -1) sha.update(buf, 0, m)
- cont = (m != -1)
- }
+ m != -1
+ }) ()
})
def digest(path: Path): Digest = digest(path.file)
--- a/src/Pure/General/sql.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/General/sql.scala Fri Sep 02 13:41:55 2022 +0200
@@ -131,9 +131,6 @@
/* tables */
sealed case class Table(name: String, columns: List[Column], body: Source = "") {
- private val columns_index: Map[String, Int] =
- columns.iterator.map(_.name).zipWithIndex.toMap
-
Library.duplicates(columns.map(_.name)) match {
case Nil =>
case bad => error("Duplicate column names " + commas_quote(bad) + " for table " + quote(name))
@@ -147,7 +144,7 @@
def query_named: Source = query + " AS " + SQL.ident(name)
- def create(strict: Boolean = false, sql_type: Type.Value => Source): Source = {
+ def create(strict: Boolean, sql_type: Type.Value => Source): Source = {
val primary_key =
columns.filter(_.primary_key).map(_.name) match {
case Nil => Nil
@@ -303,13 +300,13 @@
def close(): Unit = connection.close()
def transaction[A](body: => A): A = {
- val auto_commit = connection.getAutoCommit
+ val auto_commit = connection.getAutoCommit()
try {
connection.setAutoCommit(false)
- val savepoint = connection.setSavepoint
+ val savepoint = connection.setSavepoint()
try {
val result = body
- connection.commit
+ connection.commit()
result
}
catch { case exn: Throwable => connection.rollback(savepoint); throw exn }
@@ -403,7 +400,7 @@
def insert_permissive(table: SQL.Table, sql: SQL.Source = ""): SQL.Source =
table.insert_cmd("INSERT OR IGNORE", sql = sql)
- def rebuild: Unit = using_statement("VACUUM")(_.execute())
+ def rebuild(): Unit = using_statement("VACUUM")(_.execute())
}
}
@@ -412,6 +409,8 @@
/** PostgreSQL **/
object PostgreSQL {
+ type Source = SQL.Source
+
val default_port = 5432
lazy val init_jdbc: Unit = Class.forName("org.postgresql.Driver")
--- a/src/Pure/General/symbol.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/General/symbol.scala Fri Sep 02 13:41:55 2022 +0200
@@ -229,12 +229,13 @@
def decode(symbol_offset: Offset): Text.Offset = index.decode(symbol_offset)
def decode(symbol_range: Range): Text.Range = index.decode(symbol_range)
def incorporate(symbol_range: Range): Option[Text.Range] = {
- def in(r: Range): Option[Text.Range] =
+ def in(r: Range): Option[Text.Range] = {
range.try_restrict(decode(r)) match {
case Some(r1) if !r1.is_singularity => Some(r1)
case _ => None
}
- in(symbol_range) orElse in(symbol_range - 1)
+ }
+ in(symbol_range) orElse in(symbol_range - 1)
}
}
--- a/src/Pure/Isar/parse.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Isar/parse.ML Fri Sep 02 13:41:55 2022 +0200
@@ -72,6 +72,7 @@
val path_input: Input.source parser
val path: string parser
val path_binding: (string * Position.T) parser
+ val chapter_name: (string * Position.T) parser
val session_name: (string * Position.T) parser
val theory_name: (string * Position.T) parser
val liberal_name: string parser
@@ -289,6 +290,7 @@
val path = path_input >> Input.string_of;
val path_binding = group (fn () => "path binding (strict file name)") (position embedded);
+val chapter_name = group (fn () => "chapter name") name_position;
val session_name = group (fn () => "session name") name_position;
val theory_name = group (fn () => "theory name") name_position;
--- a/src/Pure/Isar/parse.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Isar/parse.scala Fri Sep 02 13:41:55 2022 +0200
@@ -71,6 +71,7 @@
def path: Parser[String] =
atom("file name/path specification", tok => tok.is_embedded && Path.is_wellformed(tok.content))
+ def chapter_name: Parser[String] = atom("chapter name", _.is_system_name)
def session_name: Parser[String] = atom("session name", _.is_system_name)
def theory_name: Parser[String] = atom("theory name", _.is_system_name)
--- a/src/Pure/ML/ml_console.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/ML/ml_console.scala Fri Sep 02 13:41:55 2022 +0200
@@ -70,7 +70,7 @@
session_base =
if (raw_ml_system) None
else Some(Sessions.base_info(
- options, logic, dirs = dirs, include_sessions = include_sessions).check.base))
+ options, logic, dirs = dirs, include_sessions = include_sessions).check_errors.base))
POSIX_Interrupt.handler { process.interrupt() } {
new TTY_Loop(process.stdin, process.stdout).join()
--- a/src/Pure/ML/ml_process.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/ML/ml_process.scala Fri Sep 02 13:41:55 2022 +0200
@@ -80,7 +80,7 @@
// session base
val (init_session_base, eval_init_session) =
session_base match {
- case None => (sessions_structure.bootstrap, Nil)
+ case None => (Sessions.bootstrap_base, Nil)
case Some(base) => (base, List("Resources.init_session_env ()"))
}
val init_session = Isabelle_System.tmp_file("init_session")
@@ -173,7 +173,7 @@
val more_args = getopts(args)
if (args.isEmpty || more_args.nonEmpty) getopts.usage()
- val base_info = Sessions.base_info(options, logic, dirs = dirs).check
+ val base_info = Sessions.base_info(options, logic, dirs = dirs).check_errors
val store = Sessions.store(options)
val result =
ML_Process(options, base_info.sessions_structure, store, logic = logic, args = eval_args,
--- a/src/Pure/PIDE/command.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/PIDE/command.ML Fri Sep 02 13:41:55 2022 +0200
@@ -63,14 +63,14 @@
if Context_Position.pide_reports ()
then Position.report pos (Markup.language_path delimited) else ();
- fun read_file () =
+ fun read_local () =
let
val path = File.check_file (File.full_path master_dir src_path);
val text = File.read path;
val file_pos = Path.position path;
in (text, file_pos) end;
- fun read_url () =
+ fun read_remote () =
let
val text = Bytes.content (Isabelle_System.download file_node);
val file_pos = Position.file file_node;
@@ -78,9 +78,9 @@
val (text, file_pos) =
(case try Url.explode file_node of
- NONE => read_file ()
- | SOME (Url.File _) => read_file ()
- | _ => read_url ());
+ NONE => read_local ()
+ | SOME (Url.File _) => read_local ()
+ | _ => read_remote ());
val lines = split_lines text;
val digest = SHA1.digest text;
--- a/src/Pure/PIDE/command.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/PIDE/command.scala Fri Sep 02 13:41:55 2022 +0200
@@ -340,7 +340,7 @@
props match {
case Markup.Serial(i) =>
val markup_message =
- cache.elem(XML.Elem(Markup(Markup.message(name), props), body))
+ cache.elem(Protocol.make_message(body, kind = name, props = props))
val message_markup =
cache.elem(XML.elem(Markup(name, props.filter(p => p._1 == Markup.SERIAL))))
--- a/src/Pure/PIDE/document.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/PIDE/document.ML Fri Sep 02 13:41:55 2022 +0200
@@ -402,9 +402,6 @@
blob_digest |> Exn.map_res (fn {file_node, src_path, digest} =>
{file_node = file_node, src_path = src_path, content = Option.map (the_blob state) digest});
-fun blob_reports pos (blob_digest: blob_digest) =
- (case blob_digest of Exn.Res {file_node, ...} => [(pos, Markup.path file_node)] | _ => []);
-
(* commands *)
@@ -439,9 +436,8 @@
SOME thy => Theory.get_markup thy
| NONE =>
(case try Url.explode parent of
- NONE => Markup.path parent
- | SOME (Url.File path) => Markup.path (Path.implode path)
- | SOME _ => Markup.path parent))
+ SOME (Url.File path) => Markup.path (Path.implode path)
+ | _ => Markup.path parent))
in Position.report pos markup end)
else ();
val _ =
@@ -450,8 +446,11 @@
map_filter Exn.get_exn blobs_digests
|> List.app (Output.error_message o Runtime.exn_message)
else (*auxiliary files*)
- let val pos = Token.pos_of (nth tokens blobs_index)
- in Position.reports (maps (blob_reports pos) blobs_digests) end;
+ let
+ val pos = Token.pos_of (nth tokens blobs_index);
+ fun reports (Exn.Res {file_node, ...}) = [(pos, Markup.path file_node)]
+ | reports _ = [];
+ in Position.reports (maps reports blobs_digests) end;
in tokens end) ());
val commands' =
Inttab.update_new (command_id, (name, blobs_digests, blobs_index, span)) commands
--- a/src/Pure/PIDE/document.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/PIDE/document.scala Fri Sep 02 13:41:55 2022 +0200
@@ -78,9 +78,6 @@
abbrevs: Thy_Header.Abbrevs = Nil,
errors: List[String] = Nil
) {
- def imports_offset: Map[Int, Name] =
- (for { (name, Position.Offset(i)) <- imports_pos } yield i -> name).toMap
-
def imports: List[Name] = imports_pos.map(_._1)
def append_errors(msgs: List[String]): Header =
@@ -119,8 +116,6 @@
def expand: Name =
Name(path.expand.implode, master_dir_path.expand.implode, theory)
- def symbolic: Name =
- Name(path.implode_symbolic, master_dir_path.implode_symbolic, theory)
def is_theory: Boolean = theory.nonEmpty
@@ -341,7 +336,7 @@
def source: String =
get_blob match {
case Some(blob) => blob.source
- case None => command_iterator(0).map({ case (cmd, _) => cmd.source }).mkString
+ case None => command_iterator().map({ case (cmd, _) => cmd.source }).mkString
}
}
@@ -596,7 +591,7 @@
def xml_markup_blobs(
elements: Markup.Elements = Markup.Elements.full
- ) : List[(Path, XML.Body)] = {
+ ) : List[(Command.Blob, XML.Body)] = {
snippet_command match {
case None => Nil
case Some(command) =>
@@ -610,7 +605,7 @@
markup.to_XML(Text.Range(0, text.length), text, elements)
}
else Nil
- blob.src_path -> xml
+ blob -> xml
}
}
}
@@ -633,8 +628,12 @@
lazy val exports: List[Export.Entry] =
state.node_exports(version, node_name).iterator.map(_._2).toList
- lazy val exports_map: Map[String, Export.Entry] =
- (for (entry <- exports.iterator) yield (entry.name, entry)).toMap
+ lazy val all_exports: Map[Export.Entry_Name, Export.Entry] =
+ (for {
+ (name, _) <- version.nodes.iterator
+ (_, entry) <- state.node_exports(version, name).iterator
+ if entry.entry_name.session == Sessions.DRAFT
+ } yield entry.entry_name -> entry).toMap
/* find command */
@@ -685,12 +684,6 @@
state.command_results(version, command)
- /* command ids: static and dynamic */
-
- def command_id_map: Map[Document_ID.Generic, Command] =
- state.command_id_map(version, get_node(node_name).commands)
-
-
/* cumulate markup */
def cumulate[A](
@@ -1089,18 +1082,6 @@
removing_versions = false)
}
- def command_id_map(
- version: Version,
- commands: Iterable[Command]
- ) : Map[Document_ID.Generic, Command] = {
- require(is_assigned(version), "version not assigned (command_id_map)")
- val assignment = the_assignment(version).check_finished
- (for {
- command <- commands.iterator
- id <- (command.id :: assignment.command_execs.getOrElse(command.id, Nil)).iterator
- } yield (id -> command)).toMap
- }
-
def command_maybe_consolidated(version: Version, command: Command): Boolean = {
require(is_assigned(version), "version not assigned (command_maybe_consolidated)")
try {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Pure/PIDE/document_info.scala Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,184 @@
+/* Title: Pure/PIDE/document_info.scala
+ Author: Makarius
+
+Persistent document information --- for presentation purposes.
+*/
+
+package isabelle
+
+
+object Document_Info {
+ sealed case class Session(
+ name: String,
+ used_theories: List[String],
+ loaded_theories: Map[String, Theory],
+ build_uuid: String
+ ) {
+ if (build_uuid.isEmpty) error("Missing build_uuid for session " + quote(name))
+ }
+
+ object Theory {
+ def apply(
+ name: String,
+ files: List[String],
+ static_session: String,
+ dynamic_session: String,
+ entities: List[Export_Theory.Entity0],
+ others: List[String]
+ ): Theory = {
+ val entities1 =
+ entities.filter(e => e.file.nonEmpty && Position.Range.unapply(e.pos).isDefined)
+ new Theory(name, files, static_session, dynamic_session, entities1, others)
+ }
+ }
+
+ class Theory private(
+ val name: String,
+ val files: List[String],
+ val static_session: String,
+ val dynamic_session: String,
+ entities: List[Export_Theory.Entity0],
+ others: List[String]
+ ) {
+ override def toString: String = name
+
+ val (thy_file, blobs_files) =
+ files match {
+ case Nil => error("Unknown theory file for " + quote(name))
+ case a :: bs =>
+ def for_theory: String = " for theory " + quote(name)
+ if (!File.is_thy(a)) error("Bad .thy file " + quote(a) + for_theory)
+ for (b <- bs if File.is_thy(b)) error("Bad auxiliary file " + quote(b) + for_theory)
+ (a, bs)
+ }
+
+ def home_session: Boolean = static_session == dynamic_session
+
+ def print_short: String =
+ if (home_session) Long_Name.base_name(name) else name
+
+ def print_long: String =
+ "theory " + quote(name) +
+ (if (home_session) "" else " (session " + quote(dynamic_session) + ")")
+
+ private lazy val by_file_range: Map[(String, Symbol.Range), List[Export_Theory.Entity0]] =
+ entities.groupBy(entity => (entity.file, entity.range))
+
+ private lazy val by_file_kname: Map[(String, String), Export_Theory.Entity0] =
+ (for {
+ entity <- entities
+ file <- Position.File.unapply(entity.pos)
+ } yield (file, entity.kname) -> entity).toMap
+
+ def get_defs(file: String, range: Symbol.Range): List[Export_Theory.Entity0] =
+ by_file_range.getOrElse((file, range), Nil)
+
+ def get_def(file: String, kind: String, name: String): Option[Export_Theory.Entity0] =
+ by_file_kname.get((file, Export_Theory.export_kind_name(kind, name)))
+
+ def elements(elements: Browser_Info.Elements): Browser_Info.Elements =
+ elements.copy(entity = others.foldLeft(elements.entity)(_ + _))
+ }
+
+ val empty: Document_Info = new Document_Info(Map.empty)
+
+ def read(
+ database_context: Export.Database_Context,
+ deps: Sessions.Deps,
+ sessions: List[String]
+ ): Document_Info = {
+ val sessions_structure = deps.sessions_structure
+ val sessions_requirements = sessions_structure.build_requirements(sessions)
+
+ def read_theory(theory_context: Export.Theory_Context): Option[Document_Info.Theory] =
+ {
+ val session_name = theory_context.session_context.session_name
+ val theory_name = theory_context.theory
+
+ theory_context.files0(permissive = true) match {
+ case Nil => None
+ case files =>
+ val theory_export = Export_Theory.read_theory(theory_context, permissive = true)
+ val theory =
+ Theory(theory_name,
+ static_session = sessions_structure.theory_qualifier(theory_name),
+ dynamic_session = session_name,
+ files = files,
+ entities = theory_export.entity_iterator.toList,
+ others = theory_export.others.keySet.toList)
+ Some(theory)
+ }
+ }
+
+ def read_session(session_name: String): Document_Info.Session = {
+ val static_theories = deps(session_name).used_theories.map(_._1.theory)
+ val (thys, build_uuid) = {
+ using(database_context.open_session(deps.base_info(session_name))) { session_context =>
+ val thys =
+ for {
+ theory_name <- static_theories
+ theory <- read_theory(session_context.theory(theory_name))
+ } yield theory_name -> theory
+ val build_uuid =
+ (for {
+ db <- session_context.session_db(session_name)
+ build <- database_context.store.read_build(db, session_name)
+ } yield build.uuid).getOrElse("")
+ (thys, build_uuid)
+ }
+ }
+ val loaded_theories0 = thys.toMap
+ val used_theories = static_theories.filter(loaded_theories0.keySet)
+ Session(session_name, used_theories, loaded_theories0, build_uuid)
+ }
+
+ val result0 =
+ (for (session <- Par_List.map(read_session, sessions_requirements).iterator)
+ yield session.name -> session).toMap
+
+ val result1 =
+ sessions_requirements.foldLeft(Map.empty[String, Session]) {
+ case (seen, session_name) =>
+ val session0 = result0(session_name)
+ val loaded_theories1 =
+ sessions_structure(session_name).parent.map(seen) match {
+ case None => session0.loaded_theories
+ case Some(parent_session) =>
+ parent_session.loaded_theories ++ session0.loaded_theories
+ }
+ val session1 = session0.copy(loaded_theories = loaded_theories1)
+ seen + (session_name -> session1)
+ }
+
+ new Document_Info(result1)
+ }
+}
+
+class Document_Info private(sessions: Map[String, Document_Info.Session]) {
+ override def toString: String =
+ sessions.keysIterator.toList.sorted.mkString("Document_Info(", ", ", ")")
+
+ def the_session(session: String): Document_Info.Session =
+ sessions.getOrElse(session,
+ error("Unknown document information for session: " + quote(session)))
+
+ def theory_by_name(session: String, theory: String): Option[Document_Info.Theory] =
+ by_session_and_theory_name.get((session, theory))
+
+ def theory_by_file(session: String, file: String): Option[Document_Info.Theory] =
+ by_session_and_theory_file.get((session, file))
+
+ private lazy val by_session_and_theory_name: Map[(String, String), Document_Info.Theory] =
+ (for {
+ session <- sessions.valuesIterator
+ theory <- session.loaded_theories.valuesIterator
+ } yield (session.name, theory.name) -> theory).toMap
+
+ private lazy val by_session_and_theory_file: Map[(String, String), Document_Info.Theory] = {
+ (for {
+ session <- sessions.valuesIterator
+ theory <- session.loaded_theories.valuesIterator
+ file <- theory.files.iterator
+ } yield (session.name, file) -> theory).toMap
+ }
+}
--- a/src/Pure/PIDE/headless.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/PIDE/headless.scala Fri Sep 02 13:41:55 2022 +0200
@@ -216,12 +216,12 @@
(for {
name <- dep_graph.keys_iterator
if !loaded_theory(name)
- } yield { (name -> Document_Status.Node_Status.make(state, version, name)) }).toList
+ } yield name -> Document_Status.Node_Status.make(state, version, name)).toList
val nodes_committed =
(for {
name <- dep_graph.keys_iterator
status <- already_committed1.get(name)
- } yield (name -> status)).toList
+ } yield name -> status).toList
Some(Exn.Res(new Use_Theories_Result(state, version, nodes, nodes_committed)))
}
else result
@@ -314,7 +314,7 @@
}
isabelle.Session.Consumer[isabelle.Session.Commands_Changed](getClass.getName) {
- case changed =>
+ changed =>
if (changed.nodes.exists(dep_theories_set)) {
val snapshot = session.snapshot()
val state = snapshot.state
@@ -339,7 +339,7 @@
(name, node_status) <- nodes_status1.present.iterator
if changed.nodes.contains(name) && !st.already_committed.isDefinedAt(name)
p1 = node_status.percentage
- if p1 > 0 && Some(p1) != st.nodes_status.get(name).map(_.percentage)
+ if p1 > 0 && !st.nodes_status.get(name).map(_.percentage).contains(p1)
} yield Progress.Theory(name.theory, percentage = Some(p1))).toList
(theory_progress, st.update(nodes_status1))
@@ -381,7 +381,7 @@
val nodes =
if (all) None
else Some(theories.map(resources.import_name(qualifier, master_directory(master_dir), _)))
- resources.purge_theories(session, nodes)
+ resources.purge_theories(nodes)
}
}
@@ -513,7 +513,6 @@
}
def unload_theories(
- session: Session,
id: UUID.T,
theories: List[Document.Node.Name]
) : (List[Document.Edit_Text], State) = {
@@ -532,7 +531,6 @@
}
def purge_theories(
- session: Session,
nodes: Option[List[Document.Node.Name]]
) : ((List[Document.Node.Name], List[Document.Node.Name], List[Document.Edit_Text]), State) = {
val all_nodes = theory_graph.topological_order
@@ -551,7 +549,11 @@
val options: Options,
val session_base_info: Sessions.Base_Info,
log: Logger = No_Logger)
- extends isabelle.Resources(session_base_info.sessions_structure, session_base_info.check.base, log = log) {
+ extends isabelle.Resources(
+ session_base_info.sessions_structure,
+ session_base_info.check_errors.base,
+ log = log
+ ) {
resources =>
val store: Sessions.Store = Sessions.store(options)
@@ -563,11 +565,12 @@
print_mode: List[String] = Nil,
progress: Progress = new Progress
): Session = {
- val session = new Session(session_base_info.session, options, resources)
+ val session_name = session_base_info.session_name
+ val session = new Session(session_name, options, resources)
- progress.echo("Starting session " + session_base_info.session + " ...")
+ progress.echo("Starting session " + session_name + " ...")
Isabelle_Process.start(session, options, session_base_info.sessions_structure, store,
- logic = session_base_info.session, modes = print_mode).await_startup()
+ logic = session_name, modes = print_mode).await_startup()
session
}
@@ -622,7 +625,7 @@
def unload_theories(session: Session, id: UUID.T, theories: List[Document.Node.Name]): Unit = {
state.change { st =>
- val (edits, st1) = st.unload_theories(session, id, theories)
+ val (edits, st1) = st.unload_theories(id, theories)
session.update(st.doc_blobs, edits)
st1
}
@@ -630,19 +633,18 @@
def clean_theories(session: Session, id: UUID.T, theories: List[Document.Node.Name]): Unit = {
state.change { st =>
- val (edits1, st1) = st.unload_theories(session, id, theories)
- val ((_, _, edits2), st2) = st1.purge_theories(session, None)
+ val (edits1, st1) = st.unload_theories(id, theories)
+ val ((_, _, edits2), st2) = st1.purge_theories(None)
session.update(st.doc_blobs, edits1 ::: edits2)
st2
}
}
def purge_theories(
- session: Session,
nodes: Option[List[Document.Node.Name]]
) : (List[Document.Node.Name], List[Document.Node.Name]) = {
state.change_result { st =>
- val ((purged, retained, _), st1) = st.purge_theories(session, nodes)
+ val ((purged, retained, _), st1) = st.purge_theories(nodes)
((purged, retained), st1)
}
}
--- a/src/Pure/PIDE/markup.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/PIDE/markup.ML Fri Sep 02 13:41:55 2022 +0200
@@ -64,7 +64,6 @@
val position_properties: string list
val position_property: Properties.entry -> bool
val def_name: string -> string
- val def_theoryN: string
val expressionN: string val expression: string -> T
val citationN: string val citation: string -> T
val pathN: string val path: string -> T
@@ -427,8 +426,6 @@
SOME b => b
| NONE => make_def a);
-val def_theoryN = "def_theory";
-
(* expression *)
--- a/src/Pure/PIDE/markup.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/PIDE/markup.scala Fri Sep 02 13:41:55 2022 +0200
@@ -146,8 +146,6 @@
val DEF_FILE = "def_file"
val DEF_ID = "def_id"
- val DEF_THEORY = "def_theory"
-
val POSITION = "position"
val POSITION_PROPERTIES = Set(LINE, OFFSET, END_OFFSET, FILE, ID)
--- a/src/Pure/PIDE/markup_tree.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/PIDE/markup_tree.scala Fri Sep 02 13:41:55 2022 +0200
@@ -258,7 +258,7 @@
body ++= make_text(last, elem_range.stop)
make_elems(elem_markup, body.toList)
}
- make_body(root_range, Nil, overlapping(root_range))
+ make_body(root_range, Nil, overlapping(root_range))
}
override def toString: String =
--- a/src/Pure/PIDE/protocol.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/PIDE/protocol.scala Fri Sep 02 13:41:55 2022 +0200
@@ -202,6 +202,14 @@
text1 + text2
}
+ def make_message(body: XML.Body,
+ kind: String = Markup.WRITELN,
+ props: Properties.T = Nil
+ ): XML.Elem = XML.Elem(Markup(Markup.message(kind), props), body)
+
+ def warning_message(body: XML.Body): XML.Elem = make_message(body, kind = Markup.WARNING)
+ def error_message(body: XML.Body): XML.Elem = make_message(body, kind = Markup.ERROR)
+
/* ML profiling */
--- a/src/Pure/PIDE/query_operation.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/PIDE/query_operation.scala Fri Sep 02 13:41:55 2022 +0200
@@ -119,7 +119,7 @@
XML.Elem(_, List(XML.Elem(markup, body))) <- results
if Markup.messages.contains(markup.name)
body1 = resolve_sendback(body)
- } yield XML.Elem(Markup(Markup.message(markup.name), markup.properties), body1)
+ } yield Protocol.make_message(body1, kind = markup.name, props = markup.properties)
/* status */
--- a/src/Pure/PIDE/rendering.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/PIDE/rendering.scala Fri Sep 02 13:41:55 2022 +0200
@@ -95,11 +95,11 @@
legacy_pri -> Color.legacy_message,
error_pri -> Color.error_message)
- def output_messages(results: Command.Results): List[XML.Elem] = {
+ def output_messages(results: Command.Results, output_state: Boolean): List[XML.Elem] = {
val (states, other) =
results.iterator.map(_._2).filterNot(Protocol.is_result).toList
.partition(Protocol.is_state)
- states ::: other
+ (if (output_state) states else Nil) ::: other
}
@@ -659,7 +659,7 @@
Some(info + (r0, true, Pretty.block(XML.Text("::") :: Pretty.brk(1) :: body)))
case (info, Text.Info(r0, XML.Elem(Markup(Markup.CLASS_PARAMETER, _), body))) =>
- Some(info + (r0, true, Pretty.block(0, body)))
+ Some(info + (r0, true, Pretty.block(body, indent = 0)))
case (info, Text.Info(r0, XML.Elem(Markup(Markup.ML_TYPING, _), body))) =>
Some(info + (r0, false, Pretty.block(XML.Text("ML:") :: Pretty.brk(1) :: body)))
--- a/src/Pure/PIDE/resources.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/PIDE/resources.ML Fri Sep 02 13:41:55 2022 +0200
@@ -330,6 +330,10 @@
val pos = Input.pos_of source;
val delimited = Input.is_delimited source;
val src_paths = make_paths (Path.explode name);
+ val reports =
+ src_paths |> map (fn src_path =>
+ (pos, Markup.path (Path.implode_symbolic (master_dir + src_path))));
+ val _ = Position.reports reports;
in map (Command.read_file master_dir pos delimited) src_paths end
| files => map Exn.release files));
--- a/src/Pure/PIDE/resources.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/PIDE/resources.scala Fri Sep 02 13:41:55 2022 +0200
@@ -16,13 +16,10 @@
def empty: Resources =
new Resources(Sessions.Structure.empty, Sessions.Structure.empty.bootstrap)
- def file_node(file: Path, dir: String = "", theory: String = ""): Document.Node.Name =
- empty.file_node(file, dir = dir, theory = theory)
-
def hidden_node(name: Document.Node.Name): Boolean =
!name.is_theory || name.theory == Sessions.root_name || File_Format.registry.is_theory(name)
- def html_document(snapshot: Document.Snapshot): Option[Presentation.HTML_Document] =
+ def html_document(snapshot: Document.Snapshot): Option[Browser_Info.HTML_Document] =
File_Format.registry.get(snapshot.node_name).flatMap(_.html_document(snapshot))
}
@@ -35,6 +32,9 @@
resources =>
+ override def toString: String = "Resources(" + session_base.toString + ")"
+
+
/* init session */
def init_session_yxml: String = {
@@ -54,7 +54,7 @@
(command_timings,
(Command_Span.load_commands.map(cmd => (cmd.name, cmd.position)),
(Scala.functions,
- (session_base.global_theories.toList,
+ (sessions_structure.global_theories.toList,
session_base.loaded_theories.keys)))))))))
}
@@ -147,14 +147,16 @@
} yield file
}
+ def global_theory(theory: String): Boolean =
+ sessions_structure.global_theories.isDefinedAt(theory)
+
def theory_name(qualifier: String, theory: String): String =
- if (Long_Name.is_qualified(theory) || session_base.global_theories.isDefinedAt(theory))
- theory
+ if (Long_Name.is_qualified(theory) || global_theory(theory)) theory
else Long_Name.qualify(qualifier, theory)
def find_theory_node(theory: String): Option[Document.Node.Name] = {
val thy_file = Path.basic(Long_Name.base_name(theory)).thy
- val session = session_base.theory_qualifier(theory)
+ val session = sessions_structure.theory_qualifier(theory)
val dirs =
sessions_structure.get(session) match {
case Some(info) => info.dirs
@@ -179,14 +181,14 @@
}
def import_name(name: Document.Node.Name, s: String): Document.Node.Name =
- import_name(session_base.theory_qualifier(name), name.master_dir, s)
+ import_name(sessions_structure.theory_qualifier(name), name.master_dir, s)
def import_name(info: Sessions.Info, s: String): Document.Node.Name =
import_name(info.name, info.dir.implode, s)
def find_theory(file: JFile): Option[Document.Node.Name] = {
for {
- qualifier <- session_base.session_directories.get(File.canonical(file).getParentFile)
+ qualifier <- sessions_structure.session_directories.get(File.canonical(file).getParentFile)
theory_base <- proper_string(Thy_Header.theory_name(file.getName))
theory = theory_name(qualifier, theory_base)
theory_node <- find_theory_node(theory)
@@ -195,7 +197,7 @@
}
def complete_import_name(context_name: Document.Node.Name, s: String): List[String] = {
- val context_session = session_base.theory_qualifier(context_name)
+ val context_session = sessions_structure.theory_qualifier(context_name)
val context_dir =
try { Some(context_name.master_dir_path) }
catch { case ERROR(_) => None }
@@ -205,7 +207,7 @@
theory <- Thy_Header.try_read_dir(dir).iterator
if Completion.completed(s)(theory)
} yield {
- if (session == context_session || session_base.global_theories.isDefinedAt(theory)) theory
+ if (session == context_session || global_theory(theory)) theory
else Long_Name.qualify(session, theory)
}).toList.sorted
}
@@ -230,9 +232,10 @@
val imports =
header.imports.map({ case (s, pos) =>
val name = import_name(node_name, s)
- if (Sessions.exclude_theory(name.theory_base_name))
- error("Bad theory name " + quote(name.theory_base_name) + Position.here(pos))
- (name, pos)
+ if (Sessions.illegal_theory(name.theory_base_name)) {
+ error("Illegal theory name " + quote(name.theory_base_name) + Position.here(pos))
+ }
+ else (name, pos)
})
Document.Node.Header(imports, header.keywords, header.abbrevs)
}
@@ -407,7 +410,7 @@
def get_syntax(name: Document.Node.Name): Outer_Syntax =
loaded_theories.get_node(name.theory)
- def load_commands: List[(Document.Node.Name, List[Command_Span.Span])] =
+ lazy val load_commands: List[(Document.Node.Name, List[Command_Span.Span])] =
theories.zip(
Par_List.map((e: () => List[Command_Span.Span]) => e(),
theories.map(name => resources.load_commands(get_syntax(name), name))))
--- a/src/Pure/PIDE/session.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/PIDE/session.scala Fri Sep 02 13:41:55 2022 +0200
@@ -480,7 +480,7 @@
case Protocol.Export(args)
if args.id.isDefined && Value.Long.unapply(args.id.get).isDefined =>
val id = Value.Long.unapply(args.id.get).get
- val entry = Export.make_entry("", args, msg.chunk, cache)
+ val entry = Export.make_entry(Sessions.DRAFT, args, msg.chunk, cache)
change_command(_.add_export(id, (args.serial, entry)))
case Protocol.Loading_Theory(node_name, id) =>
--- a/src/Pure/Pure.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Pure.thy Fri Sep 02 13:41:55 2022 +0200
@@ -23,7 +23,9 @@
and "external_file" "bibtex_file" "ROOTS_file" :: thy_load
and "generate_file" :: thy_decl
and "export_generated_files" :: diag
+ and "scala_build_generated_files" :: diag
and "compile_generated_files" :: diag and "external_files" "export_files" "export_prefix"
+ and "export_classpath"
and "ML_file" "ML_file_debug" "ML_file_no_debug" :: thy_load % "ML"
and "SML_file" "SML_file_debug" "SML_file_no_debug" :: thy_load % "ML"
and "SML_import" "SML_export" "ML_export" :: thy_decl % "ML"
@@ -189,6 +191,15 @@
Generated_Files.compile_generated_files_cmd
(Toplevel.context_of st) args external export export_prefix source)));
+ val _ =
+ Outer_Syntax.command \<^command_keyword>\<open>scala_build_generated_files\<close>
+ "build and export Isabelle/Scala/Java module"
+ (Parse.and_list files_in_theory --
+ Scan.optional (\<^keyword>\<open>external_files\<close> |-- Parse.!!! (Parse.and_list1 external_files)) []
+ >> (fn (args, external) =>
+ Toplevel.keep (fn st =>
+ Generated_Files.scala_build_generated_files_cmd
+ (Toplevel.context_of st) args external)));
in end\<close>
external_file "ROOT0.ML"
--- a/src/Pure/ROOT.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/ROOT.ML Fri Sep 02 13:41:55 2022 +0200
@@ -297,6 +297,7 @@
(*Isabelle system*)
ML_file "PIDE/protocol_command.ML";
+ML_file "System/java.ML";
ML_file "System/scala.ML";
ML_file "System/process_result.ML";
ML_file "System/isabelle_system.ML";
@@ -362,4 +363,4 @@
ML_file "Tools/doc.ML";
ML_file "Tools/jedit.ML";
ML_file "Tools/ghc.ML";
-ML_file "Tools/generated_files.ML"
+ML_file "Tools/generated_files.ML";
--- a/src/Pure/Sessions.thy Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Sessions.thy Fri Sep 02 13:41:55 2022 +0200
@@ -6,15 +6,18 @@
theory Sessions
imports Pure
- keywords "session" :: thy_decl
+ keywords "chapter_definition" "session" :: thy_decl
and "description" "directories" "options" "sessions" "theories"
"document_theories" "document_files" "export_files" :: quasi_command
and "global"
begin
ML \<open>
+ Outer_Syntax.command \<^command_keyword>\<open>chapter_definition\<close> "PIDE markup for session ROOT"
+ Sessions.chapter_definition_parser;
+
Outer_Syntax.command \<^command_keyword>\<open>session\<close> "PIDE markup for session ROOT"
- Sessions.command_parser;
+ Sessions.session_parser;
\<close>
end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Pure/System/classpath.scala Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,95 @@
+/* Title: Pure/System/classpath.scala
+ Author: Makarius
+
+Java classpath and Scala services.
+*/
+
+package isabelle
+
+
+import java.io.{File => JFile}
+import java.nio.file.Files
+import java.net.URLClassLoader
+
+import scala.jdk.CollectionConverters._
+
+
+object Classpath {
+ abstract class Service
+ type Service_Class = Class[Service]
+
+ def apply(
+ jar_files: List[JFile] = Nil,
+ jar_contents: List[File.Content] = Nil): Classpath =
+ {
+ val jar_files0 =
+ for {
+ s <- space_explode(JFile.pathSeparatorChar, System.getProperty("java.class.path", ""))
+ if s.nonEmpty
+ } yield File.absolute(new JFile(s))
+
+ val jar_files1 =
+ jar_files.flatMap(start => File.find_files(start, file => File.is_jar(file.getName)))
+ .map(File.absolute)
+
+ val tmp_jars =
+ for (jar <- jar_contents) yield {
+ val tmp_jar = Files.createTempFile("jar", "jar").toFile
+ tmp_jar.deleteOnExit()
+ Bytes.write(tmp_jar, jar.content)
+ tmp_jar
+ }
+ new Classpath(jar_files0 ::: jar_files1, tmp_jars)
+ }
+}
+
+class Classpath private(static_jars: List[JFile], dynamic_jars: List[JFile]) {
+ def jars: List[JFile] = static_jars ::: dynamic_jars
+ override def toString: String = jars.mkString("Classpath(", ", ", ")")
+
+ def platform_path: String = jars.map(_.getPath).mkString(JFile.pathSeparator)
+
+ val class_loader: ClassLoader =
+ {
+ val this_class_loader = this.getClass.getClassLoader
+ if (dynamic_jars.isEmpty) this_class_loader
+ else {
+ new URLClassLoader(dynamic_jars.map(File.url).toArray, this_class_loader) {
+ override def finalize(): Unit = {
+ for (jar <- dynamic_jars) {
+ try { jar.delete() }
+ catch { case _: Throwable => }
+ }
+ }
+ }
+ }
+ }
+
+ private def init_services(where: String, names: List[String]): List[Classpath.Service_Class] = {
+ for (name <- names) yield {
+ def err(msg: String): Nothing =
+ error("Bad Isabelle/Scala service " + quote(name) + " in " + where + "\n" + msg)
+ try { Class.forName(name, true, class_loader).asInstanceOf[Classpath.Service_Class] }
+ catch {
+ case _: ClassNotFoundException => err("Class not found")
+ case exn: Throwable => err(Exn.message(exn))
+ }
+ }
+ }
+
+ val services: List[Classpath.Service_Class] =
+ {
+ val variable = "ISABELLE_SCALA_SERVICES"
+ val services_env =
+ init_services(quote(variable), space_explode(':', Isabelle_System.getenv_strict(variable)))
+ val services_jars =
+ jars.flatMap(jar =>
+ init_services(File.standard_path(jar),
+ isabelle.setup.Build.get_services(jar.toPath).asScala.toList))
+ services_env ::: services_jars
+ }
+
+ def make_services[C](c: Class[C]): List[C] =
+ for { c1 <- services if Library.is_subclass(c1, c) }
+ yield c1.getDeclaredConstructor().newInstance().asInstanceOf[C]
+}
--- a/src/Pure/System/components.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/System/components.scala Fri Sep 02 13:41:55 2022 +0200
@@ -318,7 +318,7 @@
var options = Options.init()
def show_options: String =
- cat_lines(relevant_options.map(name => options.options(name).print))
+ cat_lines(relevant_options.flatMap(options.get).map(_.print))
val getopts = Getopts("""
Usage: isabelle build_components [OPTIONS] ARCHIVES... DIRS...
--- a/src/Pure/System/isabelle_system.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/System/isabelle_system.scala Fri Sep 02 13:41:55 2022 +0200
@@ -13,8 +13,6 @@
StandardCopyOption, FileSystemException}
import java.nio.file.attribute.BasicFileAttributes
-import scala.jdk.CollectionConverters._
-
object Isabelle_System {
/* settings environment */
@@ -39,48 +37,25 @@
/* services */
- abstract class Service
+ type Service = Classpath.Service
- @volatile private var _services: Option[List[Class[Service]]] = None
+ @volatile private var _classpath: Option[Classpath] = None
- def services(): List[Class[Service]] = {
- if (_services.isEmpty) init() // unsynchronized check
- _services.get
+ def classpath(): Classpath = {
+ if (_classpath.isEmpty) init() // unsynchronized check
+ _classpath.get
}
- def make_services[C](c: Class[C]): List[C] =
- for { c1 <- services() if Library.is_subclass(c1, c) }
- yield c1.getDeclaredConstructor().newInstance().asInstanceOf[C]
+ def make_services[C](c: Class[C]): List[C] = classpath().make_services(c)
- /* init settings + services */
-
- def make_services(): List[Class[Service]] = {
- def make(where: String, names: List[String]): List[Class[Service]] = {
- for (name <- names) yield {
- def err(msg: String): Nothing =
- error("Bad Isabelle/Scala service " + quote(name) + " in " + where + "\n" + msg)
- try { Class.forName(name).asInstanceOf[Class[Service]] }
- catch {
- case _: ClassNotFoundException => err("Class not found")
- case exn: Throwable => err(Exn.message(exn))
- }
- }
- }
-
- def from_env(variable: String): List[Class[Service]] =
- make(quote(variable), space_explode(':', getenv_strict(variable)))
-
- def from_jar(platform_jar: String): List[Class[Service]] =
- make(quote(platform_jar),
- isabelle.setup.Build.get_services(JPath.of(platform_jar)).asScala.toList)
-
- from_env("ISABELLE_SCALA_SERVICES") ::: Scala.class_path().flatMap(from_jar)
- }
+ /* init settings + classpath */
def init(isabelle_root: String = "", cygwin_root: String = ""): Unit = {
isabelle.setup.Environment.init(isabelle_root, cygwin_root)
- synchronized { if (_services.isEmpty) { _services = Some(make_services()) } }
+ synchronized {
+ if (_classpath.isEmpty) _classpath = Some(Classpath())
+ }
}
--- a/src/Pure/System/isabelle_tool.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/System/isabelle_tool.scala Fri Sep 02 13:41:55 2022 +0200
@@ -14,10 +14,7 @@
private def is_external(dir: Path, name: String): Boolean = {
val file = (dir + Path.explode(name)).file
- try {
- file.isFile && file.canRead && file.canExecute &&
- !name.endsWith("~") && !name.endsWith(".orig")
- }
+ try { file.isFile && file.canRead && file.canExecute && !File.is_backup(name) }
catch { case _: SecurityException => false }
}
@@ -158,6 +155,7 @@
class Admin_Tools extends Isabelle_Scala_Tools(
Build_CSDP.isabelle_tool,
+ Build_CVC5.isabelle_tool,
Build_Cygwin.isabelle_tool,
Build_Doc.isabelle_tool,
Build_E.isabelle_tool,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Pure/System/java.ML Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,43 @@
+(* Title: Pure/System/java.ML
+ Author: Makarius
+
+Support for Java language.
+*)
+
+signature JAVA =
+sig
+ val print_string: string -> string
+end;
+
+structure Java: JAVA =
+struct
+
+(* string literals *)
+
+local
+
+val print_str =
+ fn "\b" => "\\b"
+ | "\t" => "\\t"
+ | "\n" => "\\n"
+ | "\f" => "\\f"
+ | "\r" => "\\r"
+ | "\"" => "\\\""
+ | "\\" => "\\\\"
+ | s =>
+ let val c = ord s in
+ if 32 < c andalso c < 127 andalso c <> 34 andalso c <> 92 then s
+ else if c < 16 then "\\u000" ^ Int.fmt StringCvt.HEX c
+ else if c < 128 then "\\u00" ^ Int.fmt StringCvt.HEX c
+ else error ("Cannot print non-ASCII Java/Scala string literal: " ^ quote s)
+ end;
+
+in
+
+fun print_string str =
+ quote (translate_string print_str str)
+ handle Fail _ => error ("Cannot print non-ASCII Java/Scala string literal: " ^ quote str);
+
+end;
+
+end;
--- a/src/Pure/System/options.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/System/options.scala Fri Sep 02 13:41:55 2022 +0200
@@ -13,6 +13,25 @@
val empty: Options = new Options()
+ /* typed access */
+
+ abstract class Access[A](val options: Options) {
+ def apply(name: String): A
+ def update(name: String, x: A): Options
+ def change(name: String, f: A => A): Options = update(name, f(apply(name)))
+ }
+
+ class Access_Variable[A](
+ val options: Options_Variable,
+ val pure_access: Options => Access[A]
+ ) {
+ def apply(name: String): A = pure_access(options.value)(name)
+ def update(name: String, x: A): Unit =
+ options.change(options => pure_access(options).update(name, x))
+ def change(name: String, f: A => A): Unit = update(name, f(apply(name)))
+ }
+
+
/* representation */
sealed abstract class Type {
@@ -200,23 +219,27 @@
final class Options private(
- val options: Map[String, Options.Opt] = Map.empty,
+ options: Map[String, Options.Opt] = Map.empty,
val section: String = ""
) {
- override def toString: String = options.iterator.mkString("Options(", ",", ")")
+ def opt_iterator: Iterator[(String, Options.Opt)] = options.iterator
+
+ override def toString: String = opt_iterator.mkString("Options(", ",", ")")
private def print_opt(opt: Options.Opt): String =
if (opt.public) "public " + opt.print else opt.print
- def print: String = cat_lines(options.toList.sortBy(_._1).map(p => print_opt(p._2)))
+ def print: String = cat_lines(opt_iterator.toList.sortBy(_._1).map(p => print_opt(p._2)))
def description(name: String): String = check_name(name).description
/* check */
+ def get(name: String): Option[Options.Opt] = options.get(name)
+
def check_name(name: String): Options.Opt =
- options.get(name) match {
+ get(name) match {
case Some(opt) if !opt.unknown => opt
case _ => error("Unknown option " + quote(name))
}
@@ -230,7 +253,7 @@
/* basic operations */
- private def put[A](name: String, typ: Options.Type, value: String): Options = {
+ private def put(name: String, typ: Options.Type, value: String): Options = {
val opt = check_type(name, typ)
new Options(options + (name -> opt.copy(value = value)), section)
}
@@ -248,32 +271,29 @@
/* internal lookup and update */
- class Bool_Access {
- def apply(name: String): Boolean = get(name, Options.Bool, Value.Boolean.unapply)
- def update(name: String, x: Boolean): Options =
- put(name, Options.Bool, Value.Boolean(x))
- }
- val bool = new Bool_Access
+ val bool: Options.Access[Boolean] =
+ new Options.Access[Boolean](this) {
+ def apply(name: String): Boolean = get(name, Options.Bool, Value.Boolean.unapply)
+ def update(name: String, x: Boolean): Options = put(name, Options.Bool, Value.Boolean(x))
+ }
+
+ val int: Options.Access[Int] =
+ new Options.Access[Int](this) {
+ def apply(name: String): Int = get(name, Options.Int, Value.Int.unapply)
+ def update(name: String, x: Int): Options = put(name, Options.Int, Value.Int(x))
+ }
- class Int_Access {
- def apply(name: String): Int = get(name, Options.Int, Value.Int.unapply)
- def update(name: String, x: Int): Options =
- put(name, Options.Int, Value.Int(x))
- }
- val int = new Int_Access
+ val real: Options.Access[Double] =
+ new Options.Access[Double](this) {
+ def apply(name: String): Double = get(name, Options.Real, Value.Double.unapply)
+ def update(name: String, x: Double): Options = put(name, Options.Real, Value.Double(x))
+ }
- class Real_Access {
- def apply(name: String): Double = get(name, Options.Real, Value.Double.unapply)
- def update(name: String, x: Double): Options =
- put(name, Options.Real, Value.Double(x))
- }
- val real = new Real_Access
-
- class String_Access {
- def apply(name: String): String = get(name, Options.String, s => Some(s))
- def update(name: String, x: String): Options = put(name, Options.String, x)
- }
- val string = new String_Access
+ val string: Options.Access[String] =
+ new Options.Access[String](this) {
+ def apply(name: String): String = get(name, Options.String, Some(_))
+ def update(name: String, x: String): Options = put(name, Options.String, x)
+ }
def proper_string(name: String): Option[String] =
Library.proper_string(string(name))
@@ -303,7 +323,7 @@
standard: Option[Option[String]],
description: String
): Options = {
- options.get(name) match {
+ get(name) match {
case Some(other) =>
error("Duplicate declaration of option " + quote(name) + Position.here(pos) +
Position.here(other.pos))
@@ -392,7 +412,7 @@
val changed =
(for {
(name, opt2) <- options.iterator
- opt1 = defaults.options.get(name)
+ opt1 = defaults.get(name)
if opt1.isEmpty || opt1.get.value != opt2.value
} yield (name, opt2.value, if (opt1.isEmpty) " (* unknown *)" else "")).toList
@@ -407,36 +427,23 @@
class Options_Variable(init_options: Options) {
- private var options = init_options
-
- def value: Options = synchronized { options }
+ private var _options = init_options
- private def upd(f: Options => Options): Unit = synchronized { options = f(options) }
- def += (name: String, x: String): Unit = upd(opts => opts + (name, x))
+ def value: Options = synchronized { _options }
+ def change(f: Options => Options): Unit = synchronized { _options = f(_options) }
+ def += (name: String, x: String): Unit = change(options => options + (name, x))
- class Bool_Access {
- def apply(name: String): Boolean = value.bool(name)
- def update(name: String, x: Boolean): Unit = upd(opts => opts.bool.update(name, x))
- }
- val bool = new Bool_Access
+ val bool: Options.Access_Variable[Boolean] =
+ new Options.Access_Variable[Boolean](this, _.bool)
- class Int_Access {
- def apply(name: String): Int = value.int(name)
- def update(name: String, x: Int): Unit = upd(opts => opts.int.update(name, x))
- }
- val int = new Int_Access
+ val int: Options.Access_Variable[Int] =
+ new Options.Access_Variable[Int](this, _.int)
- class Real_Access {
- def apply(name: String): Double = value.real(name)
- def update(name: String, x: Double): Unit = upd(opts => opts.real.update(name, x))
- }
- val real = new Real_Access
+ val real: Options.Access_Variable[Double] =
+ new Options.Access_Variable[Double](this, _.real)
- class String_Access {
- def apply(name: String): String = value.string(name)
- def update(name: String, x: String): Unit = upd(opts => opts.string.update(name, x))
- }
- val string = new String_Access
+ val string: Options.Access_Variable[String] =
+ new Options.Access_Variable[String](this, _.string)
def proper_string(name: String): Option[String] =
Library.proper_string(string(name))
--- a/src/Pure/System/scala.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/System/scala.scala Fri Sep 02 13:41:55 2022 +0200
@@ -7,11 +7,23 @@
package isabelle
-import java.io.{File => JFile, StringWriter, PrintWriter}
+import java.io.{File => JFile, PrintStream, ByteArrayOutputStream, OutputStream}
+
+import scala.collection.mutable
+import scala.annotation.tailrec
-import scala.tools.nsc.{GenericRunnerSettings, ConsoleWriter, NewLinePrintWriter}
-import scala.tools.nsc.interpreter.{IMain, Results}
-import scala.tools.nsc.interpreter.shell.ReplReporterImpl
+import dotty.tools.dotc.CompilationUnit
+import dotty.tools.dotc.ast.Trees.PackageDef
+import dotty.tools.dotc.ast.untpd
+import dotty.tools.dotc.core.Contexts.{Context => CompilerContext}
+import dotty.tools.dotc.core.NameOps.moduleClassName
+import dotty.tools.dotc.core.{Phases, StdNames}
+import dotty.tools.dotc.interfaces
+import dotty.tools.dotc.reporting.{Diagnostic, ConsoleReporter}
+import dotty.tools.dotc.util.{SourceFile, SourcePosition, NoSourcePosition}
+import dotty.tools.repl
+import dotty.tools.repl.{ReplCompiler, ReplDriver}
+
object Scala {
/** registered functions **/
@@ -88,79 +100,104 @@
/** compiler **/
- def class_path(): List[String] =
- for {
- prop <- List("isabelle.scala.classpath", "java.class.path")
- elems = System.getProperty(prop, "") if elems.nonEmpty
- elem <- space_explode(JFile.pathSeparatorChar, elems) if elem.nonEmpty
- } yield elem
+ object Compiler {
+ object Message {
+ object Kind extends Enumeration {
+ val error, warning, info, other = Value
+ }
+ private val Header = """^--.* (Error|Warning|Info): .*$""".r
+ val header_kind: String => Kind.Value =
+ {
+ case "Error" => Kind.error
+ case "Warning" => Kind.warning
+ case "Info" => Kind.info
+ case _ => Kind.other
+ }
+
+ // see compiler/src/dotty/tools/dotc/reporting/MessageRendering.scala
+ def split(str: String): List[Message] = {
+ var kind = Kind.other
+ val text = new mutable.StringBuilder
+ val result = new mutable.ListBuffer[Message]
+
+ def flush(): Unit = {
+ if (text.nonEmpty) { result += Message(kind, text.toString) }
+ kind = Kind.other
+ text.clear()
+ }
- object Compiler {
- def default_print_writer: PrintWriter =
- new NewLinePrintWriter(new ConsoleWriter, true)
+ for (line <- Library.trim_split_lines(str)) {
+ line match {
+ case Header(k) => flush(); kind = header_kind(k)
+ case _ => if (line.startsWith("-- ")) flush()
+ }
+ if (text.nonEmpty) { text += '\n' }
+ text ++= line
+ }
+ flush()
+ result.toList
+ }
+ }
+
+ sealed case class Message(kind: Message.Kind.Value, text: String)
+ {
+ def is_error: Boolean = kind == Message.Kind.error
+ override def toString: String = text
+ }
+
+ sealed case class Result(
+ state: repl.State,
+ messages: List[Message],
+ unit: Option[CompilationUnit] = None
+ ) {
+ val errors: List[String] = messages.flatMap(msg => if (msg.is_error) Some(msg.text) else None)
+ def ok: Boolean = errors.isEmpty
+ def check_state: repl.State = if (ok) state else error(cat_lines(errors))
+ override def toString: String = if (ok) "Result(ok)" else "Result(error)"
+ }
def context(
- print_writer: PrintWriter = default_print_writer,
- error: String => Unit = Exn.error,
- jar_dirs: List[JFile] = Nil,
+ settings: List[String] = Nil,
+ jar_files: List[JFile] = Nil,
class_loader: Option[ClassLoader] = None
): Context = {
- def find_jars(dir: JFile): List[String] =
- File.find_files(dir, file => file.getName.endsWith(".jar")).
- map(File.absolute_name)
-
- val settings = new GenericRunnerSettings(error)
- settings.classpath.value =
- (class_path() ::: jar_dirs.flatMap(find_jars)).mkString(JFile.pathSeparator)
-
- new Context(settings, print_writer, class_loader)
+ val isabelle_settings =
+ Word.explode(Isabelle_System.getenv_strict("ISABELLE_SCALAC_OPTIONS"))
+ val classpath = Classpath(jar_files = jar_files)
+ new Context(isabelle_settings ::: settings, classpath, class_loader)
}
class Context private [Compiler](
- val settings: GenericRunnerSettings,
- val print_writer: PrintWriter,
- val class_loader: Option[ClassLoader]
+ _settings: List[String],
+ val classpath: Classpath,
+ val class_loader: Option[ClassLoader] = None
) {
- override def toString: String = settings.toString
+ def settings: List[String] =
+ _settings ::: List("-classpath", classpath.platform_path)
- val interp: IMain =
- new IMain(settings, new ReplReporterImpl(settings, print_writer)) {
- override def parentClassLoader: ClassLoader =
- class_loader getOrElse super.parentClassLoader
- }
- }
+ private val out_stream = new ByteArrayOutputStream(1024)
+ private val out = new PrintStream(out_stream)
+ private val driver: ReplDriver = new ReplDriver(settings.toArray, out, class_loader)
- def toplevel(interpret: Boolean, source: String): List[String] = {
- val out = new StringWriter
- val interp = Compiler.context(print_writer = new PrintWriter(out)).interp
- val marker = '\u000b'
- val ok =
- interp.withLabel(marker.toString) {
- if (interpret) interp.interpret(source) == Results.Success
- else (new interp.ReadEvalPrint).compile(source)
- }
- out.close()
+ def init_state: repl.State = driver.initialState
- val Error = """(?s)^\S* error: (.*)$""".r
- val errors =
- space_explode(marker, Library.strip_ansi_color(out.toString)).
- collect({ case Error(msg) => "Scala error: " + Library.trim_line(msg) })
-
- if (!ok && errors.isEmpty) List("Error") else errors
+ def compile(source: String, state: repl.State = init_state): Result = {
+ out.flush()
+ out_stream.reset()
+ val state1 = driver.run(source)(state)
+ out.flush()
+ val messages = Message.split(out_stream.toString(UTF8.charset))
+ out_stream.reset()
+ Result(state1, messages)
+ }
}
}
object Toplevel extends Fun_String("scala_toplevel") {
val here = Scala_Project.here
- def apply(arg: String): String = {
- val (interpret, source) =
- YXML.parse_body(arg) match {
- case Nil => (false, "")
- case List(XML.Text(source)) => (false, source)
- case body => import XML.Decode._; pair(bool, string)(body)
- }
+ def apply(source: String): String = {
val errors =
- try { Compiler.toplevel(interpret, source) }
+ try { Compiler.context().compile(source).errors.map("Scala error: " + _) }
catch { case ERROR(msg) => List(msg) }
locally { import XML.Encode._; YXML.string_of_body(list(string)(errors)) }
}
@@ -174,7 +211,7 @@
/* requests */
sealed abstract class Request
- case class Execute(command: Compiler.Context => Unit) extends Request
+ case class Execute(command: (Compiler.Context, repl.State) => repl.State) extends Request
case object Shutdown extends Request
@@ -189,19 +226,21 @@
known.value.collectFirst(which)
}
- class Interpreter(context: Compiler.Context) {
+ class Interpreter(context: Compiler.Context, out: OutputStream = Console.out) {
interpreter =>
private val running = Synchronized[Option[Thread]](None)
def running_thread(thread: Thread): Boolean = running.value.contains(thread)
def interrupt_thread(): Unit = running.change({ opt => opt.foreach(_.interrupt()); opt })
+ private var state = context.init_state
+
private lazy val thread: Consumer_Thread[Interpreter.Request] =
Consumer_Thread.fork("Scala.Interpreter") {
case Interpreter.Execute(command) =>
try {
running.change(_ => Some(Thread.currentThread()))
- command(context)
+ state = command(context, state)
}
finally {
running.change(_ => None)
@@ -219,9 +258,12 @@
thread.shutdown()
}
- def execute(command: Compiler.Context => Unit): Unit =
+ def execute(command: (Compiler.Context, repl.State) => repl.State): Unit =
thread.send(Interpreter.Execute(command))
+ def reset(): Unit =
+ thread.send(Interpreter.Execute((context, _) => context.init_state))
+
Interpreter.add(interpreter)
thread
}
@@ -323,6 +365,7 @@
Scala.Echo,
Scala.Sleep,
Scala.Toplevel,
+ Scala_Build.Scala_Fun,
Base64.Decode,
Base64.Encode,
XZ.Compress,
--- a/src/Pure/System/scala_compiler.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/System/scala_compiler.ML Fri Sep 02 13:41:55 2022 +0200
@@ -6,7 +6,7 @@
signature SCALA_COMPILER =
sig
- val toplevel: bool -> string -> unit
+ val toplevel: string -> unit
val static_check: string * Position.T -> unit
end;
@@ -15,18 +15,15 @@
(* check declaration *)
-fun toplevel interpret source =
+fun toplevel source =
let val errors =
- (interpret, source)
- |> let open XML.Encode in pair bool string end
- |> YXML.string_of_body
- |> \<^scala>\<open>scala_toplevel\<close>
+ \<^scala>\<open>scala_toplevel\<close> source
|> YXML.parse_body
|> let open XML.Decode in list string end
in if null errors then () else error (cat_lines errors) end;
fun static_check (source, pos) =
- toplevel false ("package test\nclass __Dummy__ { __dummy__ => " ^ source ^ " }")
+ toplevel ("class __Dummy__ { __dummy__ => " ^ source ^ " }")
handle ERROR msg => error (msg ^ Position.here pos);
--- a/src/Pure/Thy/bibtex.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Thy/bibtex.scala Fri Sep 02 13:41:55 2022 +0200
@@ -17,8 +17,6 @@
object Bibtex {
/** file format **/
- def is_bibtex(name: String): Boolean = name.endsWith(".bib")
-
class File_Format extends isabelle.File_Format {
val format_name: String = "bibtex"
val file_ext: String = "bib"
@@ -28,7 +26,7 @@
"""theory "bib" imports Pure begin bibtex_file """ +
Outer_Syntax.quote_string(name) + """ end"""
- override def html_document(snapshot: Document.Snapshot): Option[Presentation.HTML_Document] = {
+ override def html_document(snapshot: Document.Snapshot): Option[Browser_Info.HTML_Document] = {
val name = snapshot.node_name
if (detect(name.node)) {
val title = "Bibliography " + quote(snapshot.node_name.path.file_name)
@@ -37,7 +35,7 @@
File.write(bib, snapshot.node.source)
Bibtex.html_output(List(bib), style = "unsort", title = title)
}
- Some(Presentation.HTML_Document(title, content))
+ Some(Browser_Info.HTML_Document(title, content))
}
else None
}
@@ -206,7 +204,7 @@
val full_name = Long_Name.qualify(Markup.CITATION, entry)
val description = List(entry, "(BibTeX entry)")
val replacement = quote(entry)
- Completion.Item(r, original, full_name, description, replacement, 0, false)
+ Completion.Item(r, original, full_name, description, replacement, 0, false)
}).sorted(history.ordering).take(rendering.options.int("completion_limit"))
} yield Completion.Result(r, original, false, items)
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Pure/Thy/browser_info.scala Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,704 @@
+/* Title: Pure/Thy/browser_info.scala
+ Author: Makarius
+
+HTML/PDF presentation of PIDE document information.
+*/
+
+package isabelle
+
+
+import scala.annotation.tailrec
+import scala.collection.immutable.SortedMap
+import scala.collection.mutable
+
+
+object Browser_Info {
+ /* browser_info store configuration */
+
+ object Config {
+ val none: Config = new Config { def enabled: Boolean = false }
+ val standard: Config = new Config { def enabled: Boolean = true }
+
+ def dir(path: Path): Config =
+ new Config {
+ def enabled: Boolean = true
+ override def presentation_dir(store: Sessions.Store): Path = path
+ }
+
+ def make(s: String): Config =
+ if (s == ":") standard else dir(Path.explode(s))
+ }
+
+ abstract class Config private {
+ def enabled: Boolean
+ def enabled(info: Sessions.Info): Boolean = enabled || info.browser_info
+ def presentation_dir(store: Sessions.Store): Path = store.presentation_dir
+ }
+
+
+ /* meta data within the file-system */
+
+ object Meta_Data {
+ /* directory */
+
+ val PATH: Path = Path.explode(".browser_info")
+
+ def check_directory(dir: Path): Unit = {
+ if (dir.is_dir && !(dir + PATH).is_dir && File.read_dir(dir).nonEmpty) {
+ error("Existing content in " + dir.expand + " lacks " + PATH + " meta data.\n" +
+ "To avoid potential disaster, it has not been changed automatically.\n" +
+ "If this is the intended directory, please move/remove/empty it manually.")
+ }
+ }
+
+ def init_directory(dir: Path): Path = {
+ check_directory(dir)
+ Isabelle_System.make_directory(dir + PATH)
+ dir
+ }
+
+ def clean_directory(dir: Path): Path = {
+ check_directory(dir)
+ Isabelle_System.rm_tree(dir) // guarded by check_directory!
+ Isabelle_System.new_directory(dir + PATH)
+ }
+
+
+ /* content */
+
+ def make_path(dir: Path, name: String): Path =
+ dir + PATH + Path.basic(name)
+
+ def value(dir: Path, name: String): String = {
+ val path = make_path(dir, name)
+ if (path.is_file) File.read(path) else ""
+ }
+
+ def change(dir: Path, name: String)(f: String => String): Unit = {
+ val path = make_path(dir, name)
+ val x = value(dir, name)
+ val y =
+ try { f(x) }
+ catch { case ERROR(msg) => error("Failed to change " + path.expand + ":\n" + msg)}
+ if (x != y) File.write(path, y)
+ }
+
+
+ /* build_uuid */
+
+ val BUILD_UUID = "build_uuid"
+
+ def check_build_uuid(dir: Path, uuid: String): Boolean = {
+ val uuid0 = value(dir, BUILD_UUID)
+ uuid0.nonEmpty && uuid.nonEmpty && uuid0 == uuid
+ }
+
+ def set_build_uuid(dir: Path, uuid: String): Unit =
+ change(dir, BUILD_UUID)(_ => uuid)
+
+
+ /* index */
+
+ val INDEX = "index.json"
+
+ object Item {
+ def parse(json: JSON.T): Item = {
+ def err(): Nothing =
+ error("Bad JSON object for item:\n" + JSON.Format.pretty_print(json))
+ val obj = JSON.Object.unapply(json) getOrElse err()
+
+ val name = JSON.string(obj, "name") getOrElse err()
+ val description = JSON.string(obj, "description") getOrElse ""
+ Item(name, description = Symbol.trim_blank_lines(description))
+ }
+ }
+
+ sealed case class Item(name: String, description: String = "") {
+ override def toString: String = name
+
+ def json: JSON.T = JSON.Object("name" -> name, "description" -> description)
+ }
+
+ object Index {
+ def parse(s: JSON.S, kind: String): Index = {
+ if (s.isEmpty) Index(kind, Nil)
+ else {
+ def err(): Nothing = error("Bad JSON object " + kind + " index:\n" + s)
+
+ val json = JSON.parse(s)
+ val obj = JSON.Object.unapply(json) getOrElse err()
+
+ val kind1 = JSON.string(obj, "kind") getOrElse err()
+ val items = JSON.list(obj, "items", x => Some(Item.parse(x))) getOrElse err()
+ if (kind == kind1) Index(kind, items)
+ else error("Expected index kind " + quote(kind) + " but found " + quote(kind1))
+ }
+ }
+ }
+
+ sealed case class Index(kind: String, items: List[Item]) {
+ def is_empty: Boolean = items.isEmpty
+
+ def + (item: Item): Index =
+ Index(kind, (item :: items.filterNot(_.name == item.name)).sortBy(_.name))
+
+ def json: JSON.T = JSON.Object("kind" -> kind, "items" -> items.map(_.json))
+ def print_json: JSON.S = JSON.Format.pretty_print(json)
+ }
+ }
+
+
+ /* presentation elements */
+
+ sealed case class Elements(
+ html: Markup.Elements = Markup.Elements.empty,
+ entity: Markup.Elements = Markup.Elements.empty,
+ language: Markup.Elements = Markup.Elements.empty)
+
+ val default_elements: Elements =
+ Elements(
+ html = Rendering.foreground_elements ++ Rendering.text_color_elements +
+ Markup.NUMERAL + Markup.COMMENT + Markup.ENTITY + Markup.LANGUAGE +
+ Markup.PATH + Markup.URL,
+ entity = Markup.Elements(Markup.THEORY, Markup.TYPE_NAME, Markup.CONSTANT, Markup.FACT,
+ Markup.CLASS, Markup.LOCALE, Markup.FREE))
+
+ val extra_elements: Elements =
+ Elements(
+ html = default_elements.html ++ Rendering.markdown_elements,
+ language = Markup.Elements(Markup.Language.DOCUMENT))
+
+
+
+ /** HTML/PDF presentation context **/
+
+ def context(
+ sessions_structure: Sessions.Structure,
+ elements: Elements = default_elements,
+ root_dir: Path = Path.current,
+ document_info: Document_Info = Document_Info.empty
+ ): Context = new Context(sessions_structure, elements, root_dir, document_info)
+
+ class Context private[Browser_Info](
+ sessions_structure: Sessions.Structure,
+ val elements: Elements,
+ val root_dir: Path,
+ val document_info: Document_Info
+ ) {
+ /* directory structure and resources */
+
+ def theory_by_name(session: String, theory: String): Option[Document_Info.Theory] =
+ document_info.theory_by_name(session, theory)
+
+ def theory_by_file(session: String, file: String): Option[Document_Info.Theory] =
+ document_info.theory_by_file(session, file)
+
+ def session_chapter(session: String): String =
+ sessions_structure(session).chapter
+
+ def chapter_dir(session: String): Path =
+ root_dir + Path.basic(session_chapter(session))
+
+ def session_dir(session: String): Path =
+ chapter_dir(session) + Path.basic(session)
+
+ def theory_dir(theory: Document_Info.Theory): Path =
+ session_dir(theory.dynamic_session)
+
+ def theory_html(theory: Document_Info.Theory): Path =
+ {
+ def check(name: String): Option[Path] = {
+ val path = Path.basic(name).html
+ if (Path.eq_case_insensitive(path, Path.index_html)) None
+ else Some(path)
+ }
+ check(theory.print_short) orElse check(theory.name) getOrElse
+ error("Illegal global theory name " + quote(theory.name) +
+ " (conflict with " + Path.index_html + ")")
+ }
+
+ def file_html(file: String): Path =
+ Path.explode(file).squash.html
+
+ def smart_html(theory: Document_Info.Theory, file: String): Path =
+ if (File.is_thy(file)) theory_html(theory) else file_html(file)
+
+
+ /* HTML content */
+
+ def head(title: String, rest: XML.Body = Nil): XML.Tree =
+ HTML.div("head", HTML.chapter(title) :: rest)
+
+ def source(body: XML.Body): XML.Tree = HTML.pre("source", body)
+
+ def contents(
+ heading: String,
+ items: List[XML.Body],
+ css_class: String = "contents"
+ ) : List[XML.Elem] = {
+ if (items.isEmpty) Nil
+ else List(HTML.div(css_class, List(HTML.section(heading), HTML.itemize(items))))
+ }
+
+
+ /* preview PIDE document */
+
+ lazy val isabelle_css: String = File.read(HTML.isabelle_css)
+
+ def html_document(title: String, body: XML.Body, fonts_css: String): HTML_Document = {
+ val content =
+ HTML.output_document(
+ List(
+ HTML.style(fonts_css + "\n\n" + isabelle_css),
+ HTML.title(title)),
+ List(HTML.source(body)), css = "", structural = false)
+ HTML_Document(title, content)
+ }
+
+ def preview_document(
+ snapshot: Document.Snapshot,
+ plain_text: Boolean = false,
+ fonts_css: String = HTML.fonts_css()
+ ): HTML_Document = {
+ require(!snapshot.is_outdated, "document snapshot outdated")
+
+ val name = snapshot.node_name
+ if (plain_text) {
+ val title = "File " + Symbol.cartouche_decoded(name.path.file_name)
+ val body = HTML.text(snapshot.node.source)
+ html_document(title, body, fonts_css)
+ }
+ else {
+ Resources.html_document(snapshot) getOrElse {
+ val title =
+ if (name.is_theory) "Theory " + quote(name.theory_base_name)
+ else "File " + Symbol.cartouche_decoded(name.path.file_name)
+ val xml = snapshot.xml_markup(elements = elements.html)
+ val body = Node_Context.empty.make_html(elements, xml)
+ html_document(title, body, fonts_css)
+ }
+ }
+ }
+
+
+ /* maintain presentation structure */
+
+ def update_chapter(session_name: String, session_description: String): Unit = synchronized {
+ val dir = Meta_Data.init_directory(chapter_dir(session_name))
+ Meta_Data.change(dir, Meta_Data.INDEX) { text =>
+ val index0 = Meta_Data.Index.parse(text, "chapter")
+ val item = Meta_Data.Item(session_name, description = session_description)
+ val index = index0 + item
+
+ if (index != index0) {
+ val title = "Isabelle/" + session_chapter(session_name) + " sessions"
+ HTML.write_document(dir, "index.html",
+ List(HTML.title(title + Isabelle_System.isabelle_heading())),
+ HTML.chapter(title) ::
+ (if (index.is_empty) Nil
+ else
+ List(HTML.div("sessions",
+ List(HTML.description(
+ index.items.map(item =>
+ (List(HTML.link(item.name + "/index.html", HTML.text(item.name))),
+ if (item.description.isEmpty) Nil
+ else HTML.break ::: List(HTML.pre(HTML.text(item.description)))))))))),
+ root = Some(root_dir))
+ }
+
+ index.print_json
+ }
+ }
+
+ def update_root(): Unit = synchronized {
+ Meta_Data.init_directory(root_dir)
+ HTML.init_fonts(root_dir)
+ Isabelle_System.copy_file(Path.explode("~~/lib/logo/isabelle.gif"),
+ root_dir + Path.explode("isabelle.gif"))
+
+ Meta_Data.change(root_dir, Meta_Data.INDEX) { text =>
+ val index0 = Meta_Data.Index.parse(text, "root")
+ val index = {
+ val items1 =
+ sessions_structure.known_chapters
+ .map(ch => Meta_Data.Item(ch.name, description = ch.description))
+ val items2 = index0.items.filterNot(item => items1.exists(_.name == item.name))
+ index0.copy(items = items1 ::: items2)
+ }
+
+ if (index != index0) {
+ val title = "The " + XML.text(Isabelle_System.isabelle_name()) + " Library"
+ HTML.write_document(root_dir, "index.html",
+ List(HTML.title(title + Isabelle_System.isabelle_heading())),
+ HTML.chapter(title) ::
+ (if (index.is_empty) Nil
+ else
+ List(HTML.div("sessions",
+ List(HTML.description(
+ index.items.map(item =>
+ (List(HTML.link(item.name + "/index.html", HTML.text(item.name))),
+ if (item.description.isEmpty) Nil
+ else HTML.break ::: List(HTML.pre(HTML.text(item.description)))))))))),
+ root = Some(root_dir))
+ }
+
+ index.print_json
+ }
+ }
+ }
+
+ sealed case class HTML_Document(title: String, content: String)
+
+
+ /* formal entities */
+
+ object Theory_Ref {
+ def unapply(props: Properties.T): Option[String] =
+ (props, props) match {
+ case (Markup.Kind(Markup.THEORY), Markup.Name(theory)) => Some(theory)
+ case _ => None
+ }
+ }
+
+ object Entity_Ref {
+ def unapply(props: Properties.T): Option[(String, String, String)] =
+ (props, props, props, props) match {
+ case (Markup.Entity.Ref.Prop(_), Position.Def_File(file), Markup.Kind(kind), Markup.Name(name))
+ if Path.is_wellformed(file) => Some((file, kind, name))
+ case _ => None
+ }
+ }
+
+ object Node_Context {
+ val empty: Node_Context = new Node_Context
+
+ def make(
+ context: Context,
+ session_name: String,
+ theory_name: String,
+ file_name: String,
+ node_dir: Path,
+ ): Node_Context =
+ new Node_Context {
+ private val seen_ranges: mutable.Set[Symbol.Range] = mutable.Set.empty
+
+ override def make_def(range: Symbol.Range, body: XML.Body): Option[XML.Elem] =
+ body match {
+ case List(XML.Elem(Markup("span", List("id" -> _)), _)) => None
+ case _ =>
+ for (theory <- context.theory_by_name(session_name, theory_name))
+ yield {
+ val body1 =
+ if (seen_ranges.contains(range)) {
+ HTML.entity_def(HTML.span(HTML.id(offset_id(range)), body))
+ }
+ else HTML.span(body)
+ theory.get_defs(file_name, range).foldLeft(body1) {
+ case (elem, entity) =>
+ HTML.entity_def(HTML.span(HTML.id(entity.kname), List(elem)))
+ }
+ }
+ }
+
+ private def offset_id(range: Text.Range): String =
+ "offset_" + range.start + ".." + range.stop
+
+ override def make_file_ref(file: String, body: XML.Body): Option[XML.Elem] = {
+ for (theory <- context.theory_by_file(session_name, file))
+ yield {
+ val html_path = context.theory_dir(theory) + context.smart_html(theory, file)
+ val html_link = HTML.relative_href(html_path, base = Some(node_dir))
+ HTML.link(html_link, body)
+ }
+ }
+
+ override def make_ref(props: Properties.T, body: XML.Body): Option[XML.Elem] = {
+ props match {
+ case Theory_Ref(thy_name) =>
+ for (theory <- context.theory_by_name(session_name, thy_name))
+ yield {
+ val html_path = context.theory_dir(theory) + context.theory_html(theory)
+ val html_link = HTML.relative_href(html_path, base = Some(node_dir))
+ HTML.link(html_link, body)
+ }
+ case Entity_Ref(def_file, kind, name) =>
+ def logical_ref(theory: Document_Info.Theory): Option[String] =
+ theory.get_def(def_file, kind, name).map(_.kname)
+
+ def physical_ref(theory: Document_Info.Theory): Option[String] =
+ props match {
+ case Position.Def_Range(range) if theory.name == theory_name =>
+ seen_ranges += range
+ Some(offset_id(range))
+ case _ => None
+ }
+
+ for {
+ theory <- context.theory_by_file(session_name, def_file)
+ html_ref <- logical_ref(theory) orElse physical_ref(theory)
+ }
+ yield {
+ val html_path = context.theory_dir(theory) + context.smart_html(theory, def_file)
+ val html_link = HTML.relative_href(html_path, base = Some(node_dir))
+ HTML.entity_ref(HTML.link(html_link + "#" + html_ref, body))
+ }
+ case _ => None
+ }
+ }
+ }
+ }
+
+ class Node_Context {
+ def make_def(range: Symbol.Range, body: XML.Body): Option[XML.Elem] = None
+ def make_ref(props: Properties.T, body: XML.Body): Option[XML.Elem] = None
+ def make_file_ref(file: String, body: XML.Body): Option[XML.Elem] = None
+
+ val div_elements: Set[String] =
+ Set(HTML.div.name, HTML.pre.name, HTML.par.name, HTML.list.name, HTML.`enum`.name,
+ HTML.descr.name)
+
+ def make_html(elements: Elements, xml: XML.Body): XML.Body = {
+ def html_div(html: XML.Body): Boolean =
+ html exists {
+ case XML.Elem(markup, body) => div_elements.contains(markup.name) || html_div(body)
+ case XML.Text(_) => false
+ }
+
+ def html_class(c: String, html: XML.Body): XML.Body =
+ if (c == "") html
+ else if (html_div(html)) List(HTML.div(c, html))
+ else List(HTML.span(c, html))
+
+ def html_body(xml_body: XML.Body, end_offset: Symbol.Offset): (XML.Body, Symbol.Offset) =
+ xml_body.foldRight((List.empty[XML.Tree], end_offset)) { case (tree, (res, end_offset1)) =>
+ val (res1, offset) = html_body_single(tree, end_offset1)
+ (res1 ++ res, offset)
+ }
+
+ @tailrec
+ def html_body_single(xml_tree: XML.Tree, end_offset: Symbol.Offset): (XML.Body, Symbol.Offset) =
+ xml_tree match {
+ case XML.Wrapped_Elem(markup, _, body) => html_body_single(XML.Elem(markup, body), end_offset)
+ case XML.Elem(Markup(Markup.ENTITY, props @ Markup.Kind(kind)), body) =>
+ val (body1, offset) = html_body(body, end_offset)
+ if (elements.entity(kind)) {
+ make_ref(props, body1) match {
+ case Some(link) => (List(link), offset)
+ case None => (body1, offset)
+ }
+ }
+ else (body1, offset)
+ case XML.Elem(Markup.Path(file), body) =>
+ val (body1, offset) = html_body(body, end_offset)
+ make_file_ref(file, body1) match {
+ case Some(link) => (List(link), offset)
+ case None => (body1, offset)
+ }
+ case XML.Elem(Markup.Url(href), body) =>
+ val (body1, offset) = html_body(body, end_offset)
+ (List(HTML.link(href, body1)), offset)
+ case XML.Elem(Markup(Markup.LANGUAGE, Markup.Name(name)), body) =>
+ val (body1, offset) = html_body(body, end_offset)
+ (html_class(if (elements.language(name)) name else "", body1), offset)
+ case XML.Elem(Markup(Markup.MARKDOWN_PARAGRAPH, _), body) =>
+ val (body1, offset) = html_body(body, end_offset)
+ (List(HTML.par(body1)), offset)
+ case XML.Elem(Markup(Markup.MARKDOWN_ITEM, _), body) =>
+ val (body1, offset) = html_body(body, end_offset)
+ (List(HTML.item(body1)), offset)
+ case XML.Elem(Markup(Markup.Markdown_Bullet.name, _), text) =>
+ (Nil, end_offset - XML.symbol_length(text))
+ case XML.Elem(Markup.Markdown_List(kind), body) =>
+ val (body1, offset) = html_body(body, end_offset)
+ if (kind == Markup.ENUMERATE) (List(HTML.`enum`(body1)), offset)
+ else (List(HTML.list(body1)), offset)
+ case XML.Elem(markup, body) =>
+ val name = markup.name
+ val (body1, offset) = html_body(body, end_offset)
+ val html =
+ markup.properties match {
+ case Markup.Kind(kind) if kind == Markup.COMMAND || kind == Markup.KEYWORD =>
+ html_class(kind, body1)
+ case _ =>
+ body1
+ }
+ Rendering.foreground.get(name) orElse Rendering.text_color.get(name) match {
+ case Some(c) => (html_class(c.toString, html), offset)
+ case None => (html_class(name, html), offset)
+ }
+ case XML.Text(text) =>
+ val offset = end_offset - Symbol.length(text)
+ val body = HTML.text(Symbol.decode(text))
+ make_def(Text.Range(offset, end_offset), body) match {
+ case Some(body1) => (List(body1), offset)
+ case None => (body, offset)
+ }
+ }
+
+ html_body(xml, XML.symbol_length(xml) + 1)._1
+ }
+ }
+
+
+
+ /** build presentation **/
+
+ val session_graph_path: Path = Path.explode("session_graph.pdf")
+
+ def build_session(
+ context: Context,
+ session_context: Export.Session_Context,
+ progress: Progress = new Progress,
+ verbose: Boolean = false,
+ ): Unit = {
+ progress.expose_interrupt()
+
+ val session_name = session_context.session_name
+ val session_info = session_context.sessions_structure(session_name)
+
+ val session_dir = context.session_dir(session_name).expand
+ progress.echo("Presenting " + session_name + " in " + session_dir + " ...")
+
+ Meta_Data.init_directory(context.chapter_dir(session_name))
+ Meta_Data.clean_directory(session_dir)
+
+ val session = context.document_info.the_session(session_name)
+
+ Bytes.write(session_dir + session_graph_path,
+ graphview.Graph_File.make_pdf(session_info.options,
+ session_context.session_base.session_graph_display))
+
+ val document_variants =
+ for {
+ doc <- session_info.document_variants
+ db <- session_context.session_db()
+ document <- Document_Build.read_document(db, session_name, doc.name)
+ }
+ yield {
+ val doc_path = session_dir + doc.path.pdf
+ if (Path.eq_case_insensitive(doc.path.pdf, session_graph_path)) {
+ error("Illegal document variant " + quote(doc.name) +
+ " (conflict with " + session_graph_path + ")")
+ }
+ if (verbose) progress.echo("Presenting document " + session_name + "/" + doc.name)
+ if (session_info.document_echo) progress.echo("Document at " + doc_path)
+ Bytes.write(doc_path, document.pdf)
+ doc
+ }
+
+ val document_links = {
+ val link1 = HTML.link(session_graph_path, HTML.text("theory dependencies"))
+ val links2 = document_variants.map(doc => HTML.link(doc.path.pdf, HTML.text(doc.name)))
+ Library.separate(HTML.break ::: HTML.nl,
+ (link1 :: links2).map(link => HTML.text("View ") ::: List(link))).flatten
+ }
+
+ def present_theory(theory_name: String): XML.Body = {
+ progress.expose_interrupt()
+
+ def err(): Nothing =
+ error("Missing document information for theory: " + quote(theory_name))
+
+ val command = Build_Job.read_theory(session_context.theory(theory_name)) getOrElse err()
+ val theory = context.theory_by_name(session_name, theory_name) getOrElse err()
+
+ if (verbose) progress.echo("Presenting theory " + quote(theory_name))
+ val snapshot = Document.State.init.snippet(command)
+
+ val thy_elements = theory.elements(context.elements)
+
+ def node_context(file_name: String, node_dir: Path): Node_Context =
+ Node_Context.make(context, session_name, theory_name, file_name, node_dir)
+
+ val thy_html =
+ context.source(
+ node_context(theory.thy_file, session_dir).
+ make_html(thy_elements, snapshot.xml_markup(elements = thy_elements.html)))
+
+ val files =
+ for {
+ (blob, xml) <- snapshot.xml_markup_blobs(elements = thy_elements.html)
+ if xml.nonEmpty
+ }
+ yield {
+ progress.expose_interrupt()
+
+ val file_name = blob.name.node
+ if (verbose) progress.echo("Presenting file " + quote(file_name))
+
+ val file_html = session_dir + context.file_html(file_name)
+ val file_dir = file_html.dir
+ val html_link = HTML.relative_href(file_html, base = Some(session_dir))
+ val html = context.source(node_context(file_name, file_dir).make_html(thy_elements, xml))
+
+ val file_title = "File " + Symbol.cartouche_decoded(blob.src_path.implode_short)
+ HTML.write_document(file_dir, file_html.file_name,
+ List(HTML.title(file_title)), List(context.head(file_title), html),
+ root = Some(context.root_dir))
+ List(HTML.link(html_link, HTML.text(file_title)))
+ }
+
+ val thy_title = "Theory " + theory.print_short
+ HTML.write_document(session_dir, context.theory_html(theory).implode,
+ List(HTML.title(thy_title)), List(context.head(thy_title), thy_html),
+ root = Some(context.root_dir))
+
+ List(HTML.link(context.theory_html(theory),
+ HTML.text(theory.print_short) :::
+ (if (files.isEmpty) Nil else List(HTML.itemize(files)))))
+ }
+
+ val theories = session.used_theories.map(present_theory)
+
+ val title = "Session " + session_name
+ HTML.write_document(session_dir, "index.html",
+ List(HTML.title(title + Isabelle_System.isabelle_heading())),
+ context.head(title, List(HTML.par(document_links))) ::
+ context.contents("Theories", theories),
+ root = Some(context.root_dir))
+
+ Meta_Data.set_build_uuid(session_dir, session.build_uuid)
+
+ context.update_chapter(session_name, session_info.description)
+ }
+
+ def build(
+ browser_info: Config,
+ store: Sessions.Store,
+ deps: Sessions.Deps,
+ sessions: List[String],
+ progress: Progress = new Progress,
+ verbose: Boolean = false
+ ): Unit = {
+ val root_dir = browser_info.presentation_dir(store).absolute
+ progress.echo("Presentation in " + root_dir)
+
+ using(Export.open_database_context(store)) { database_context =>
+ val context0 = context(deps.sessions_structure, root_dir = root_dir)
+
+ val sessions1 =
+ deps.sessions_structure.build_requirements(sessions).filter { session_name =>
+ using(database_context.open_database(session_name)) { session_database =>
+ database_context.store.read_build(session_database.db, session_name) match {
+ case None => false
+ case Some(build) =>
+ val session_dir = context0.session_dir(session_name)
+ !Meta_Data.check_build_uuid(session_dir, build.uuid)
+ }
+ }
+ }
+
+ val context1 =
+ context(deps.sessions_structure, root_dir = root_dir,
+ document_info = Document_Info.read(database_context, deps, sessions1))
+
+ context1.update_root()
+
+ Par_List.map({ (session: String) =>
+ using(database_context.open_session(deps.base_info(session))) { session_context =>
+ build_session(context1, session_context, progress = progress, verbose = verbose)
+ }
+ }, sessions1)
+ }
+ }
+}
--- a/src/Pure/Thy/document_build.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Thy/document_build.scala Fri Sep 02 13:41:55 2022 +0200
@@ -31,10 +31,12 @@
}
sealed case class Document_Input(name: String, sources: SHA1.Digest)
- extends Document_Name
+ extends Document_Name { override def toString: String = name }
sealed case class Document_Output(name: String, sources: SHA1.Digest, log_xz: Bytes, pdf: Bytes)
extends Document_Name {
+ override def toString: String = name
+
def log: String = log_xz.uncompress().text
def log_lines: List[String] = split_lines(log)
@@ -116,29 +118,31 @@
map(name => texinputs + Path.basic(name))
def context(
- session: String,
- deps: Sessions.Deps,
- db_context: Sessions.Database_Context,
+ session_context: Export.Session_Context,
+ document_session: Option[Sessions.Base] = None,
progress: Progress = new Progress
- ): Context = {
- val info = deps.sessions_structure(session)
- val base = deps(session)
- val hierarchy = deps.sessions_structure.build_hierarchy(session)
- new Context(info, base, hierarchy, db_context, progress)
- }
+ ): Context = new Context(session_context, document_session, progress)
final class Context private[Document_Build](
- info: Sessions.Info,
- base: Sessions.Base,
- hierarchy: List[String],
- db_context: Sessions.Database_Context,
+ session_context: Export.Session_Context,
+ document_session: Option[Sessions.Base],
val progress: Progress = new Progress
) {
+ context =>
+
+
/* session info */
+ private val base = document_session getOrElse session_context.session_base
+ private val info = session_context.sessions_structure(base.session_name)
+
def session: String = info.name
def options: Options = info.options
+ override def toString: String = session
+
+ val classpath: List[File.Content] = session_context.classpath()
+
def document_bibliography: Boolean = options.bool("document_bibliography")
def document_logo: Option[String] =
@@ -152,40 +156,41 @@
def get_engine(): Engine = {
val name = document_build
- engines.find(_.name == name).getOrElse(error("Bad document_build engine " + quote(name)))
+ Classpath(jar_contents = classpath).make_services(classOf[Engine])
+ .find(_.name == name).getOrElse(error("Bad document_build engine " + quote(name)))
}
- def get_export(theory: String, name: String): Export.Entry =
- db_context.get_export(hierarchy, theory, name)
-
/* document content */
def documents: List[Document_Variant] = info.documents
- def session_theories: List[Document.Node.Name] = base.session_theories
- def document_theories: List[Document.Node.Name] = session_theories ::: base.document_theories
+ def proper_session_theories: List[Document.Node.Name] = base.proper_session_theories
+
+ def document_theories: List[Document.Node.Name] =
+ proper_session_theories ::: base.document_theories
lazy val document_latex: List[File.Content_XML] =
for (name <- document_theories)
yield {
val path = Path.basic(tex_name(name))
- val content = YXML.parse_body(get_export(name.theory, Export.DOCUMENT_LATEX).text)
- File.Content(path, content)
+ val entry = session_context(name.theory, Export.DOCUMENT_LATEX, permissive = true)
+ val content = YXML.parse_body(entry.text)
+ File.content(path, content)
}
lazy val session_graph: File.Content = {
- val path = Presentation.session_graph_path
+ val path = Browser_Info.session_graph_path
val content = graphview.Graph_File.make_pdf(options, base.session_graph_display)
- File.Content(path, content)
+ File.content(path, content)
}
lazy val session_tex: File.Content = {
val path = Path.basic("session.tex")
val content =
Library.terminate_lines(
- base.session_theories.map(name => "\\input{" + tex_name(name) + "}"))
- File.Content(path, content)
+ base.proper_session_theories.map(name => "\\input{" + tex_name(name) + "}"))
+ File.content(path, content)
}
lazy val isabelle_logo: Option[File.Content] = {
@@ -194,11 +199,22 @@
Logo.create_logo(logo_name, output_file = tmp_path, quiet = true)
val path = Path.basic("isabelle_logo.pdf")
val content = Bytes.read(tmp_path)
- File.Content(path, content)
+ File.content(path, content)
})
}
+ /* build document */
+
+ def build_document(doc: Document_Variant, verbose: Boolean = false): Document_Output = {
+ Isabelle_System.with_tmp_dir("document") { tmp_dir =>
+ val engine = get_engine()
+ val directory = engine.prepare_directory(context, tmp_dir, doc)
+ engine.build_document(context, directory, verbose)
+ }
+ }
+
+
/* document directory */
def prepare_directory(
@@ -249,7 +265,8 @@
def old_document(directory: Directory): Option[Document_Output] =
for {
- old_doc <- db_context.input_database(session)(read_document(_, _, directory.doc.name))
+ db <- session_context.session_db()
+ old_doc <- read_document(db, session, directory.doc.name)
if old_doc.sources == directory.sources
}
yield old_doc
@@ -298,8 +315,6 @@
/* build engines */
- lazy val engines: List[Engine] = Isabelle_System.make_services(classOf[Engine])
-
abstract class Engine(val name: String) extends Isabelle_System.Service {
override def toString: String = name
@@ -477,12 +492,15 @@
Sessions.load_structure(options + "document=pdf", dirs = dirs).
selection_deps(Sessions.Selection.session(session))
+ val session_base_info = deps.base_info(session)
+
if (output_sources.isEmpty && output_pdf.isEmpty) {
progress.echo_warning("No output directory")
}
- using(store.open_database_context()) { db_context =>
- build_documents(context(session, deps, db_context, progress = progress),
+ using(Export.open_session_context(store, session_base_info)) { session_context =>
+ build_documents(
+ context(session_context, progress = progress),
output_sources = output_sources, output_pdf = output_pdf,
verbose = verbose_latex)
}
--- a/src/Pure/Thy/export.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Thy/export.scala Fri Sep 02 13:41:55 2022 +0200
@@ -48,57 +48,81 @@
(if (name == "") "" else " AND " + Data.name.equal(name))
}
- def read_name(
- db: SQL.Database,
- session_name: String,
- theory_name: String,
- name: String
- ): Boolean = {
- val select =
- Data.table.select(List(Data.name), Data.where_equal(session_name, theory_name, name))
- db.using_statement(select)(stmt => stmt.execute_query().next())
- }
+ def compound_name(a: String, b: String): String =
+ if (a.isEmpty) b else a + ":" + b
+
+ sealed case class Entry_Name(session: String = "", theory: String = "", name: String = "") {
+ val compound_name: String = Export.compound_name(theory, name)
+
+ def make_path(prune: Int = 0): Path = {
+ val elems = theory :: space_explode('/', name)
+ if (elems.length < prune + 1) {
+ error("Cannot prune path by " + prune + " element(s): " + Path.make(elems))
+ }
+ else Path.make(elems.drop(prune))
+ }
- def read_names(db: SQL.Database, session_name: String, theory_name: String): List[String] = {
- val select = Data.table.select(List(Data.name), Data.where_equal(session_name, theory_name))
- db.using_statement(select)(stmt =>
- stmt.execute_query().iterator(res => res.string(Data.name)).toList)
+ def readable(db: SQL.Database): Boolean = {
+ val select = Data.table.select(List(Data.name), Data.where_equal(session, theory, name))
+ db.using_statement(select)(stmt => stmt.execute_query().next())
+ }
+
+ def read(db: SQL.Database, cache: XML.Cache): Option[Entry] = {
+ val select =
+ Data.table.select(List(Data.executable, Data.compressed, Data.body),
+ Data.where_equal(session, theory, name))
+ db.using_statement(select) { stmt =>
+ val res = stmt.execute_query()
+ if (res.next()) {
+ val executable = res.bool(Data.executable)
+ val compressed = res.bool(Data.compressed)
+ val bytes = res.bytes(Data.body)
+ val body = Future.value(compressed, bytes)
+ Some(Entry(this, executable, body, cache))
+ }
+ else None
+ }
+ }
}
def read_theory_names(db: SQL.Database, session_name: String): List[String] = {
val select =
- Data.table.select(List(Data.theory_name), Data.where_equal(session_name), distinct = true)
+ Data.table.select(List(Data.theory_name), Data.where_equal(session_name), distinct = true) +
+ " ORDER BY " + Data.theory_name
db.using_statement(select)(stmt =>
stmt.execute_query().iterator(_.string(Data.theory_name)).toList)
}
- def read_theory_exports(db: SQL.Database, session_name: String): List[(String, String)] = {
- val select = Data.table.select(List(Data.theory_name, Data.name), Data.where_equal(session_name))
+ def read_entry_names(db: SQL.Database, session_name: String): List[Entry_Name] = {
+ val select =
+ Data.table.select(List(Data.theory_name, Data.name), Data.where_equal(session_name)) +
+ " ORDER BY " + Data.theory_name + ", " + Data.name
db.using_statement(select)(stmt =>
stmt.execute_query().iterator(res =>
- (res.string(Data.theory_name), res.string(Data.name))).toList)
+ Entry_Name(session = session_name,
+ theory = res.string(Data.theory_name),
+ name = res.string(Data.name))).toList)
}
def message(msg: String, theory_name: String, name: String): String =
msg + " " + quote(name) + " for theory " + quote(theory_name)
- def compound_name(a: String, b: String): String =
- if (a.isEmpty) b else a + ":" + b
-
def empty_entry(theory_name: String, name: String): Entry =
- Entry("", theory_name, name, false, Future.value(false, Bytes.empty), XML.Cache.none)
+ Entry(Entry_Name(theory = theory_name, name = name),
+ false, Future.value(false, Bytes.empty), XML.Cache.none)
sealed case class Entry(
- session_name: String,
- theory_name: String,
- name: String,
+ entry_name: Entry_Name,
executable: Boolean,
body: Future[(Boolean, Bytes)],
cache: XML.Cache
) {
+ def session_name: String = entry_name.session
+ def theory_name: String = entry_name.theory
+ def name: String = entry_name.name
override def toString: String = name
- def compound_name: String = Export.compound_name(theory_name, name)
+ def compound_name: String = entry_name.compound_name
def name_has_prefix(s: String): Boolean = name.startsWith(s)
val name_elems: List[String] = explode_name(name)
@@ -147,10 +171,10 @@
make(Nil, 0, pattern.toList)
}
- def make_matcher(pattern: String): (String, String) => Boolean = {
- val regex = make_regex(pattern)
- (theory_name: String, name: String) =>
- regex.pattern.matcher(compound_name(theory_name, name)).matches
+ def make_matcher(pats: List[String]): Entry_Name => Boolean = {
+ val regs = pats.map(make_regex)
+ (entry_name: Entry_Name) =>
+ regs.exists(_.pattern.matcher(entry_name.compound_name).matches)
}
def make_entry(
@@ -162,47 +186,8 @@
val body =
if (args.compress) Future.fork(bytes.maybe_compress(cache = cache.xz))
else Future.value((false, bytes))
- Entry(session_name, args.theory_name, args.name, args.executable, body, cache)
- }
-
- def read_entry(
- db: SQL.Database,
- cache: XML.Cache,
- session_name: String,
- theory_name: String,
- name: String
- ): Option[Entry] = {
- val select =
- Data.table.select(List(Data.executable, Data.compressed, Data.body),
- Data.where_equal(session_name, theory_name, name))
- db.using_statement(select) { stmt =>
- val res = stmt.execute_query()
- if (res.next()) {
- val executable = res.bool(Data.executable)
- val compressed = res.bool(Data.compressed)
- val bytes = res.bytes(Data.body)
- val body = Future.value(compressed, bytes)
- Some(Entry(session_name, theory_name, name, executable, body, cache))
- }
- else None
- }
- }
-
- def read_entry(
- dir: Path,
- cache: XML.Cache,
- session_name: String,
- theory_name: String,
- name: String
- ): Option[Entry] = {
- val path = dir + Path.basic(theory_name) + Path.explode(name)
- if (path.is_file) {
- val executable = File.is_executable(path)
- val uncompressed = Bytes.read(path)
- val body = Future.value((false, uncompressed))
- Some(Entry(session_name, theory_name, name, executable, body, cache))
- }
- else None
+ val entry_name = Entry_Name(session = session_name, theory = args.theory_name, name = args.name)
+ Entry(entry_name, args.executable, body, cache)
}
@@ -227,7 +212,7 @@
entry.body.cancel()
Exn.Res(())
}
- else if (read_name(db, entry.session_name, entry.theory_name, entry.name)) {
+ else if (entry.entry_name.readable(db)) {
if (strict) {
val msg = message("Duplicate export", entry.theory_name, entry.name)
errors.change(msg :: _)
@@ -240,9 +225,9 @@
(results, true)
})
- def apply(session_name: String, args: Protocol.Export.Args, body: Bytes): Unit = {
- if (!progress.stopped) {
- consumer.send(make_entry(session_name, args, body, cache) -> args.strict)
+ def make_entry(session_name: String, args: Protocol.Export.Args, body: Bytes): Unit = {
+ if (!progress.stopped && !body.is_empty) {
+ consumer.send(Export.make_entry(session_name, args, body, cache) -> args.strict)
}
}
@@ -254,94 +239,226 @@
}
- /* abstract provider */
+ /* context for database access */
+
+ def open_database_context(store: Sessions.Store): Database_Context = {
+ val database_server = if (store.database_server) Some(store.open_database_server()) else None
+ new Database_Context(store, database_server)
+ }
- object Provider {
- def none: Provider =
- new Provider {
- def apply(export_name: String): Option[Entry] = None
- def focus(other_theory: String): Provider = this
+ def open_session_context0(store: Sessions.Store, session: String): Session_Context =
+ open_database_context(store).open_session0(session, close_database_context = true)
- override def toString: String = "none"
- }
+ def open_session_context(
+ store: Sessions.Store,
+ session_base_info: Sessions.Base_Info,
+ document_snapshot: Option[Document.Snapshot] = None
+ ): Session_Context = {
+ open_database_context(store).open_session(
+ session_base_info, document_snapshot = document_snapshot, close_database_context = true)
+ }
- def database_context(
- context: Sessions.Database_Context,
- session_hierarchy: List[String],
- theory_name: String): Provider =
- new Provider {
- def apply(export_name: String): Option[Entry] =
- context.read_export(session_hierarchy, theory_name, export_name)
+ class Database_Context private[Export](
+ val store: Sessions.Store,
+ val database_server: Option[SQL.Database]
+ ) extends AutoCloseable {
+ database_context =>
- def focus(other_theory: String): Provider = this
+ override def toString: String = {
+ val s =
+ database_server match {
+ case Some(db) => db.toString
+ case None => "input_dirs = " + store.input_dirs.map(_.absolute).mkString(", ")
+ }
+ "Database_Context(" + s + ")"
+ }
- override def toString: String = context.toString
+ def cache: Term.Cache = store.cache
+
+ def close(): Unit = database_server.foreach(_.close())
+
+ def open_database(session: String, output: Boolean = false): Session_Database =
+ database_server match {
+ case Some(db) => new Session_Database(session, db)
+ case None =>
+ new Session_Database(session, store.open_database(session, output = output)) {
+ override def close(): Unit = db.close()
+ }
}
- def database(
- db: SQL.Database,
- cache: XML.Cache,
- session_name: String,
- theory_name: String
- ) : Provider = {
- new Provider {
- def apply(export_name: String): Option[Entry] =
- read_entry(db, cache, session_name, theory_name, export_name)
-
- def focus(other_theory: String): Provider =
- if (other_theory == theory_name) this
- else Provider.database(db, cache, session_name, other_theory)
-
- override def toString: String = db.toString
- }
- }
-
- def snapshot(snapshot: Document.Snapshot): Provider =
- new Provider {
- def apply(export_name: String): Option[Entry] =
- snapshot.exports_map.get(export_name)
+ def open_session0(session: String, close_database_context: Boolean = false): Session_Context =
+ open_session(Sessions.base_info0(session), close_database_context = close_database_context)
- def focus(other_theory: String): Provider =
- if (other_theory == snapshot.node_name.theory) this
- else {
- val node_name =
- snapshot.version.nodes.theory_name(other_theory) getOrElse
- error("Bad theory " + quote(other_theory))
- Provider.snapshot(snapshot.state.snapshot(node_name))
- }
-
- override def toString: String = snapshot.toString
- }
-
- def directory(
- dir: Path,
- cache: XML.Cache,
- session_name: String,
- theory_name: String
- ) : Provider = {
- new Provider {
- def apply(export_name: String): Option[Entry] =
- read_entry(dir, cache, session_name, theory_name, export_name)
-
- def focus(other_theory: String): Provider =
- if (other_theory == theory_name) this
- else Provider.directory(dir, cache, session_name, other_theory)
-
- override def toString: String = dir.toString
+ def open_session(
+ session_base_info: Sessions.Base_Info,
+ document_snapshot: Option[Document.Snapshot] = None,
+ close_database_context: Boolean = false
+ ): Session_Context = {
+ val session_name = session_base_info.check_errors.session_name
+ val session_hierarchy = session_base_info.sessions_structure.build_hierarchy(session_name)
+ val session_databases =
+ database_server match {
+ case Some(db) => session_hierarchy.map(name => new Session_Database(name, db))
+ case None =>
+ val attempts =
+ session_hierarchy.map(name => name -> store.try_open_database(name, server = false))
+ attempts.collectFirst({ case (name, None) => name }) match {
+ case Some(bad) =>
+ for ((_, Some(db)) <- attempts) db.close()
+ store.error_database(bad)
+ case None =>
+ for ((name, Some(db)) <- attempts) yield {
+ new Session_Database(name, db) { override def close(): Unit = this.db.close() }
+ }
+ }
+ }
+ new Session_Context(database_context, session_base_info, session_databases, document_snapshot) {
+ override def close(): Unit = {
+ session_databases.foreach(_.close())
+ if (close_database_context) database_context.close()
+ }
}
}
}
- trait Provider {
- def apply(export_name: String): Option[Entry]
+ class Session_Database private[Export](val session: String, val db: SQL.Database)
+ extends AutoCloseable {
+ def close(): Unit = ()
+
+ lazy private [Export] val theory_names: List[String] = read_theory_names(db, session)
+ lazy private [Export] val entry_names: List[Entry_Name] = read_entry_names(db, session)
+ }
+
+ class Session_Context private[Export](
+ val database_context: Database_Context,
+ session_base_info: Sessions.Base_Info,
+ db_hierarchy: List[Session_Database],
+ document_snapshot: Option[Document.Snapshot]
+ ) extends AutoCloseable {
+ session_context =>
+
+ def close(): Unit = ()
+
+ def cache: Term.Cache = database_context.cache
+
+ def sessions_structure: Sessions.Structure = session_base_info.sessions_structure
+
+ def session_base: Sessions.Base = session_base_info.base
+
+ def session_name: String =
+ if (document_snapshot.isDefined) Sessions.DRAFT
+ else session_base.session_name
+
+ def session_database(session: String = session_name): Option[Session_Database] =
+ db_hierarchy.find(_.session == session)
+
+ def session_db(session: String = session_name): Option[SQL.Database] =
+ session_database(session = session).map(_.db)
+
+ def session_stack: List[String] =
+ ((if (document_snapshot.isDefined) List(session_name) else Nil) :::
+ db_hierarchy.map(_.session)).reverse
+
+ private def select[A](
+ session: String,
+ select: Session_Database => List[A],
+ project: Entry_Name => A,
+ sort_key: A => String
+ ): List[A] = {
+ def result(name: String): List[A] =
+ if (name == Sessions.DRAFT) {
+ (for {
+ snapshot <- document_snapshot.iterator
+ entry_name <- snapshot.all_exports.keysIterator
+ } yield project(entry_name)).toSet.toList.sortBy(sort_key)
+ }
+ else session_database(name).map(select).getOrElse(Nil)
+
+ if (session.nonEmpty) result(session) else session_stack.flatMap(result)
+ }
+
+ def entry_names(session: String = session_name): List[Entry_Name] =
+ select(session, _.entry_names, identity, _.compound_name)
- def uncompressed_yxml(export_name: String): XML.Body =
- apply(export_name) match {
+ def theory_names(session: String = session_name): List[String] =
+ select(session, _.theory_names, _.theory, identity)
+
+ def get(theory: String, name: String): Option[Entry] =
+ {
+ def snapshot_entry: Option[Entry] =
+ for {
+ snapshot <- document_snapshot
+ entry_name = Entry_Name(session = Sessions.DRAFT, theory = theory, name = name)
+ entry <- snapshot.all_exports.get(entry_name)
+ } yield entry
+ def db_entry: Option[Entry] =
+ db_hierarchy.view.map(database =>
+ Export.Entry_Name(session = database.session, theory = theory, name = name)
+ .read(database.db, cache))
+ .collectFirst({ case Some(entry) => entry })
+
+ snapshot_entry orElse db_entry
+ }
+
+ def apply(theory: String, name: String, permissive: Boolean = false): Entry =
+ get(theory, name) match {
+ case None if permissive => empty_entry(theory, name)
+ case None => error("Missing export entry " + quote(compound_name(theory, name)))
+ case Some(entry) => entry
+ }
+
+ def theory(theory: String, other_cache: Option[Term.Cache] = None): Theory_Context =
+ new Theory_Context(session_context, theory, other_cache)
+
+ def classpath(): List[File.Content] = {
+ (for {
+ session <- session_stack.iterator
+ info <- sessions_structure.get(session).iterator
+ if info.export_classpath.nonEmpty
+ matcher = make_matcher(info.export_classpath)
+ entry_name <- entry_names(session = session).iterator
+ if matcher(entry_name)
+ entry <- get(entry_name.theory, entry_name.name).iterator
+ } yield File.content(entry.entry_name.make_path(), entry.uncompressed)).toList
+ }
+
+ override def toString: String =
+ "Export.Session_Context(" + commas_quote(session_stack) + ")"
+ }
+
+ class Theory_Context private[Export](
+ val session_context: Session_Context,
+ val theory: String,
+ other_cache: Option[Term.Cache]
+ ) {
+ def cache: Term.Cache = other_cache getOrElse session_context.cache
+
+ def get(name: String): Option[Entry] = session_context.get(theory, name)
+ def apply(name: String, permissive: Boolean = false): Entry =
+ session_context.apply(theory, name, permissive = permissive)
+
+ def uncompressed_yxml(name: String): XML.Body =
+ get(name) match {
case Some(entry) => entry.uncompressed_yxml
case None => Nil
}
- def focus(other_theory: String): Provider
+ def document_id(): Option[Long] =
+ apply(DOCUMENT_ID, permissive = true).text match {
+ case Value.Long(id) => Some(id)
+ case _ => None
+ }
+
+ def files0(permissive: Boolean = false): List[String] =
+ split_lines(apply(FILES, permissive = permissive).text)
+
+ def files(permissive: Boolean = false): Option[(String, List[String])] =
+ files0(permissive = permissive) match {
+ case Nil => None
+ case a :: bs => Some((a, bs))
+ }
+
+ override def toString: String = "Export.Theory_Context(" + quote(theory) + ")"
}
@@ -357,41 +474,26 @@
export_patterns: List[String] = Nil
): Unit = {
using(store.open_database(session_name)) { db =>
- db.transaction {
- val export_names = read_theory_exports(db, session_name)
+ val entry_names = read_entry_names(db, session_name)
- // list
- if (export_list) {
- (for ((theory_name, name) <- export_names) yield compound_name(theory_name, name)).
- sorted.foreach(progress.echo)
- }
+ // list
+ if (export_list) {
+ for (entry_name <- entry_names) progress.echo(entry_name.compound_name)
+ }
- // export
- if (export_patterns.nonEmpty) {
- val exports =
- (for {
- export_pattern <- export_patterns.iterator
- matcher = make_matcher(export_pattern)
- (theory_name, name) <- export_names if matcher(theory_name, name)
- } yield (theory_name, name)).toSet
- for {
- (theory_name, group) <- exports.toList.groupBy(_._1).toList.sortBy(_._1)
- name <- group.map(_._2).sorted
- entry <- read_entry(db, store.cache, session_name, theory_name, name)
- } {
- val elems = theory_name :: space_explode('/', name)
- val path =
- if (elems.length < export_prune + 1) {
- error("Cannot prune path by " + export_prune + " element(s): " + Path.make(elems))
- }
- else export_dir + Path.make(elems.drop(export_prune))
-
- progress.echo("export " + path + (if (entry.executable) " (executable)" else ""))
- Isabelle_System.make_directory(path.dir)
- val bytes = entry.uncompressed
- if (!path.is_file || Bytes.read(path) != bytes) Bytes.write(path, bytes)
- File.set_executable(path, entry.executable)
- }
+ // export
+ if (export_patterns.nonEmpty) {
+ val matcher = make_matcher(export_patterns)
+ for {
+ entry_name <- entry_names if matcher(entry_name)
+ entry <- entry_name.read(db, store.cache)
+ } {
+ val path = export_dir + entry_name.make_path(prune = export_prune)
+ progress.echo("export " + path + (if (entry.executable) " (executable)" else ""))
+ Isabelle_System.make_directory(path.dir)
+ val bytes = entry.uncompressed
+ if (!path.is_file || Bytes.read(path) != bytes) Bytes.write(path, bytes)
+ File.set_executable(path, entry.executable)
}
}
}
--- a/src/Pure/Thy/export_theory.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Thy/export_theory.ML Fri Sep 02 13:41:55 2022 +0200
@@ -156,7 +156,7 @@
val parents = Theory.parents_of thy;
val _ =
Export.export thy \<^path_binding>\<open>theory/parents\<close>
- (XML.Encode.string (cat_lines (map Context.theory_long_name parents)));
+ (XML.Encode.string (cat_lines (map Context.theory_long_name parents) ^ "\n"));
(* spec rules *)
--- a/src/Pure/Thy/export_theory.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Thy/export_theory.scala Fri Sep 02 13:41:55 2022 +0200
@@ -25,23 +25,15 @@
}
def read_session(
- store: Sessions.Store,
- sessions_structure: Sessions.Structure,
- session_name: String,
- progress: Progress = new Progress,
- cache: Term.Cache = Term.Cache.make()): Session = {
+ session_context: Export.Session_Context,
+ session_stack: Boolean = false,
+ progress: Progress = new Progress
+ ): Session = {
val thys =
- sessions_structure.build_requirements(List(session_name)).flatMap(session =>
- using(store.open_database(session)) { db =>
- db.transaction {
- for (theory <- Export.read_theory_names(db, session))
- yield {
- progress.echo("Reading theory " + theory)
- val provider = Export.Provider.database(db, store.cache, session, theory)
- read_theory(provider, session, theory, cache = cache)
- }
- }
- })
+ for (theory <- theory_names(session_context, session_stack = session_stack)) yield {
+ progress.echo("Reading theory " + theory)
+ read_theory(session_context.theory(theory))
+ }
val graph0 =
thys.foldLeft(Graph.string[Option[Theory]]) {
@@ -55,7 +47,7 @@
}
}
- Session(session_name, graph1)
+ Session(session_context.session_name, graph1)
}
@@ -80,7 +72,7 @@
) {
override def toString: String = name
- def entity_iterator: Iterator[Entity[No_Content]] =
+ def entity_iterator: Iterator[Entity0] =
types.iterator.map(_.no_content) ++
consts.iterator.map(_.no_content) ++
axioms.iterator.map(_.no_content) ++
@@ -109,64 +101,56 @@
(for ((k, xs) <- others.iterator) yield cache.string(k) -> xs.map(_.cache(cache))).toMap)
}
- def read_theory_parents(provider: Export.Provider, theory_name: String): Option[List[String]] = {
- if (theory_name == Thy_Header.PURE) Some(Nil)
- else {
- provider(Export.THEORY_PREFIX + "parents")
- .map(entry => split_lines(entry.uncompressed.text))
- }
+ def read_theory_parents(theory_context: Export.Theory_Context): Option[List[String]] =
+ theory_context.get(Export.THEORY_PREFIX + "parents")
+ .map(entry => Library.trim_split_lines(entry.uncompressed.text))
+
+ def theory_names(
+ session_context: Export.Session_Context,
+ session_stack: Boolean = false
+ ): List[String] = {
+ val session = if (session_stack) "" else session_context.session_name
+ for {
+ theory <- session_context.theory_names(session = session)
+ if read_theory_parents(session_context.theory(theory)).isDefined
+ } yield theory
}
def no_theory: Theory =
Theory("", Nil, Nil, Nil, Nil, Nil, Nil, Nil, Nil, Nil, Nil, Nil, Nil, Nil, Nil, Map.empty)
def read_theory(
- provider: Export.Provider,
- session_name: String,
- theory_name: String,
- cache: Term.Cache = Term.Cache.none
+ theory_context: Export.Theory_Context,
+ permissive: Boolean = false
): Theory = {
- val parents =
- read_theory_parents(provider, theory_name) getOrElse
+ val cache = theory_context.cache
+ val session_name = theory_context.session_context.session_name
+ val theory_name = theory_context.theory
+ read_theory_parents(theory_context) match {
+ case None if permissive => no_theory
+ case None =>
error("Missing theory export in session " + quote(session_name) + ": " + quote(theory_name))
- val theory =
- Theory(theory_name, parents,
- read_types(provider),
- read_consts(provider),
- read_axioms(provider),
- read_thms(provider),
- read_classes(provider),
- read_locales(provider),
- read_locale_dependencies(provider),
- read_classrel(provider),
- read_arities(provider),
- read_constdefs(provider),
- read_typedefs(provider),
- read_datatypes(provider),
- read_spec_rules(provider),
- read_others(provider))
- if (cache.no_cache) theory else theory.cache(cache)
- }
-
- def read_pure[A](store: Sessions.Store, read: (Export.Provider, String, String) => A): A = {
- val session_name = Thy_Header.PURE
- val theory_name = Thy_Header.PURE
-
- using(store.open_database(session_name)) { db =>
- db.transaction {
- val provider = Export.Provider.database(db, store.cache, session_name, theory_name)
- read(provider, session_name, theory_name)
- }
+ case Some(parents) =>
+ val theory =
+ Theory(theory_name, parents,
+ read_types(theory_context),
+ read_consts(theory_context),
+ read_axioms(theory_context),
+ read_thms(theory_context),
+ read_classes(theory_context),
+ read_locales(theory_context),
+ read_locale_dependencies(theory_context),
+ read_classrel(theory_context),
+ read_arities(theory_context),
+ read_constdefs(theory_context),
+ read_typedefs(theory_context),
+ read_datatypes(theory_context),
+ read_spec_rules(theory_context),
+ read_others(theory_context))
+ if (cache.no_cache) theory else theory.cache(cache)
}
}
- def read_pure_theory(store: Sessions.Store, cache: Term.Cache = Term.Cache.none): Theory =
- read_pure(store, read_theory(_, _, _, cache = cache))
-
- def read_pure_proof(
- store: Sessions.Store, id: Thm_Id, cache: Term.Cache = Term.Cache.none): Option[Proof] =
- read_pure(store, (provider, _, _) => read_proof(provider, id, cache = cache))
-
/* entities */
@@ -206,6 +190,7 @@
) {
val kname: String = export_kind_name(kind, name)
val range: Symbol.Range = Position.Range.unapply(pos).getOrElse(Text.Range.offside)
+ val file: String = Position.File.unapply(pos).getOrElse("")
def export_kind: String = Export_Theory.export_kind(kind)
override def toString: String = export_kind + " " + quote(name)
@@ -213,7 +198,7 @@
def the_content: A =
if (content.isDefined) content.get else error("No content for " + toString)
- def no_content: Entity[No_Content] = copy(content = None)
+ def no_content: Entity0 = copy(content = None)
def cache(cache: Term.Cache): Entity[A] =
Entity(
@@ -225,9 +210,10 @@
serial,
content.map(_.cache(cache)))
}
+ type Entity0 = Entity[No_Content]
def read_entities[A <: Content[A]](
- provider: Export.Provider,
+ theory_context: Export.Theory_Context,
export_name: String,
kind: String,
decode: XML.Decode.T[A]
@@ -247,7 +233,7 @@
case _ => err()
}
}
- provider.uncompressed_yxml(export_name).map(decode_entity)
+ theory_context.uncompressed_yxml(export_name).map(decode_entity)
}
@@ -283,8 +269,8 @@
abbrev.map(cache.typ))
}
- def read_types(provider: Export.Provider): List[Entity[Type]] =
- read_entities(provider, Export.THEORY_PREFIX + "types", Markup.TYPE_NAME,
+ def read_types(theory_context: Export.Theory_Context): List[Entity[Type]] =
+ read_entities(theory_context, Export.THEORY_PREFIX + "types", Markup.TYPE_NAME,
{ body =>
import XML.Decode._
val (syntax, args, abbrev) =
@@ -311,8 +297,8 @@
propositional)
}
- def read_consts(provider: Export.Provider): List[Entity[Const]] =
- read_entities(provider, Export.THEORY_PREFIX + "consts", Markup.CONSTANT,
+ def read_consts(theory_context: Export.Theory_Context): List[Entity[Const]] =
+ read_entities(theory_context, Export.THEORY_PREFIX + "consts", Markup.CONSTANT,
{ body =>
import XML.Decode._
val (syntax, (typargs, (typ, (abbrev, propositional)))) =
@@ -351,16 +337,14 @@
override def cache(cache: Term.Cache): Axiom = Axiom(prop.cache(cache))
}
- def read_axioms(provider: Export.Provider): List[Entity[Axiom]] =
- read_entities(provider, Export.THEORY_PREFIX + "axioms", Markup.AXIOM,
+ def read_axioms(theory_context: Export.Theory_Context): List[Entity[Axiom]] =
+ read_entities(theory_context, Export.THEORY_PREFIX + "axioms", Markup.AXIOM,
body => Axiom(decode_prop(body)))
/* theorems */
- sealed case class Thm_Id(serial: Long, theory_name: String) {
- def pure: Boolean = theory_name == Thy_Header.PURE
- }
+ sealed case class Thm_Id(serial: Long, theory_name: String)
sealed case class Thm(
prop: Prop,
@@ -374,8 +358,8 @@
cache.proof(proof))
}
- def read_thms(provider: Export.Provider): List[Entity[Thm]] =
- read_entities(provider, Export.THEORY_PREFIX + "thms", Kind.THM,
+ def read_thms(theory_context: Export.Theory_Context): List[Entity[Thm]] =
+ read_entities(theory_context, Export.THEORY_PREFIX + "thms", Kind.THM,
{ body =>
import XML.Decode._
import Term_XML.Decode._
@@ -400,11 +384,14 @@
}
def read_proof(
- provider: Export.Provider,
+ session_context: Export.Session_Context,
id: Thm_Id,
- cache: Term.Cache = Term.Cache.none
+ other_cache: Option[Term.Cache] = None
): Option[Proof] = {
- for { entry <- provider.focus(id.theory_name)(Export.PROOFS_PREFIX + id.serial) }
+ val theory_context = session_context.theory(id.theory_name, other_cache = other_cache)
+ val cache = theory_context.cache
+
+ for { entry <- theory_context.get(Export.PROOFS_PREFIX + id.serial) }
yield {
val body = entry.uncompressed_yxml
val (typargs, (args, (prop_body, proof_body))) = {
@@ -422,11 +409,10 @@
}
def read_proof_boxes(
- store: Sessions.Store,
- provider: Export.Provider,
+ session_context: Export.Session_Context,
proof: Term.Proof,
suppress: Thm_Id => Boolean = _ => false,
- cache: Term.Cache = Term.Cache.none
+ other_cache: Option[Term.Cache] = None
): List[(Thm_Id, Proof)] = {
var seen = Set.empty[Long]
var result = SortedMap.empty[Long, (Thm_Id, Proof)]
@@ -441,10 +427,7 @@
seen += thm.serial
val id = Thm_Id(thm.serial, thm.theory_name)
if (!suppress(id)) {
- val read =
- if (id.pure) Export_Theory.read_pure_proof(store, id, cache = cache)
- else Export_Theory.read_proof(provider, id, cache = cache)
- read match {
+ Export_Theory.read_proof(session_context, id, other_cache = other_cache) match {
case Some(p) =>
result += (thm.serial -> (id -> p))
boxes(Some((thm.serial, p.proof)), p.proof)
@@ -475,8 +458,8 @@
axioms.map(_.cache(cache)))
}
- def read_classes(provider: Export.Provider): List[Entity[Class]] =
- read_entities(provider, Export.THEORY_PREFIX + "classes", Markup.CLASS,
+ def read_classes(theory_context: Export.Theory_Context): List[Entity[Class]] =
+ read_entities(theory_context, Export.THEORY_PREFIX + "classes", Markup.CLASS,
{ body =>
import XML.Decode._
import Term_XML.Decode._
@@ -499,8 +482,8 @@
axioms.map(_.cache(cache)))
}
- def read_locales(provider: Export.Provider): List[Entity[Locale]] =
- read_entities(provider, Export.THEORY_PREFIX + "locales", Markup.LOCALE,
+ def read_locales(theory_context: Export.Theory_Context): List[Entity[Locale]] =
+ read_entities(theory_context, Export.THEORY_PREFIX + "locales", Markup.LOCALE,
{ body =>
import XML.Decode._
import Term_XML.Decode._
@@ -532,8 +515,11 @@
subst_types.isEmpty && subst_terms.isEmpty
}
- def read_locale_dependencies(provider: Export.Provider): List[Entity[Locale_Dependency]] =
- read_entities(provider, Export.THEORY_PREFIX + "locale_dependencies", Kind.LOCALE_DEPENDENCY,
+ def read_locale_dependencies(
+ theory_context: Export.Theory_Context
+ ): List[Entity[Locale_Dependency]] = {
+ read_entities(theory_context, Export.THEORY_PREFIX + "locale_dependencies",
+ Kind.LOCALE_DEPENDENCY,
{ body =>
import XML.Decode._
import Term_XML.Decode._
@@ -542,6 +528,7 @@
pair(list(pair(pair(string, sort), typ)), list(pair(pair(string, typ), term))))))(body)
Locale_Dependency(source, target, prefix, subst_types, subst_terms)
})
+ }
/* sort algebra */
@@ -551,8 +538,8 @@
Classrel(cache.string(class1), cache.string(class2), prop.cache(cache))
}
- def read_classrel(provider: Export.Provider): List[Classrel] = {
- val body = provider.uncompressed_yxml(Export.THEORY_PREFIX + "classrel")
+ def read_classrel(theory_context: Export.Theory_Context): List[Classrel] = {
+ val body = theory_context.uncompressed_yxml(Export.THEORY_PREFIX + "classrel")
val classrel = {
import XML.Decode._
list(pair(decode_prop, pair(string, string)))(body)
@@ -571,8 +558,8 @@
prop.cache(cache))
}
- def read_arities(provider: Export.Provider): List[Arity] = {
- val body = provider.uncompressed_yxml(Export.THEORY_PREFIX + "arities")
+ def read_arities(theory_context: Export.Theory_Context): List[Arity] = {
+ val body = theory_context.uncompressed_yxml(Export.THEORY_PREFIX + "arities")
val arities = {
import XML.Decode._
import Term_XML.Decode._
@@ -589,8 +576,8 @@
Constdef(cache.string(name), cache.string(axiom_name))
}
- def read_constdefs(provider: Export.Provider): List[Constdef] = {
- val body = provider.uncompressed_yxml(Export.THEORY_PREFIX + "constdefs")
+ def read_constdefs(theory_context: Export.Theory_Context): List[Constdef] = {
+ val body = theory_context.uncompressed_yxml(Export.THEORY_PREFIX + "constdefs")
val constdefs = {
import XML.Decode._
list(pair(string, string))(body)
@@ -618,8 +605,8 @@
cache.string(axiom_name))
}
- def read_typedefs(provider: Export.Provider): List[Typedef] = {
- val body = provider.uncompressed_yxml(Export.THEORY_PREFIX + "typedefs")
+ def read_typedefs(theory_context: Export.Theory_Context): List[Typedef] = {
+ val body = theory_context.uncompressed_yxml(Export.THEORY_PREFIX + "typedefs")
val typedefs = {
import XML.Decode._
import Term_XML.Decode._
@@ -652,8 +639,8 @@
constructors.map({ case (term, typ) => (cache.term(term), cache.typ(typ)) }))
}
- def read_datatypes(provider: Export.Provider): List[Datatype] = {
- val body = provider.uncompressed_yxml(Export.THEORY_PREFIX + "datatypes")
+ def read_datatypes(theory_context: Export.Theory_Context): List[Datatype] = {
+ val body = theory_context.uncompressed_yxml(Export.THEORY_PREFIX + "datatypes")
val datatypes = {
import XML.Decode._
import Term_XML.Decode._
@@ -742,8 +729,8 @@
rules.map(cache.term))
}
- def read_spec_rules(provider: Export.Provider): List[Spec_Rule] = {
- val body = provider.uncompressed_yxml(Export.THEORY_PREFIX + "spec_rules")
+ def read_spec_rules(theory_context: Export.Theory_Context): List[Spec_Rule] = {
+ val body = theory_context.uncompressed_yxml(Export.THEORY_PREFIX + "spec_rules")
val spec_rules = {
import XML.Decode._
import Term_XML.Decode._
@@ -763,15 +750,15 @@
override def cache(cache: Term.Cache): Other = this
}
- def read_others(provider: Export.Provider): Map[String, List[Entity[Other]]] = {
+ def read_others(theory_context: Export.Theory_Context): Map[String, List[Entity[Other]]] = {
val kinds =
- provider(Export.THEORY_PREFIX + "other_kinds") match {
+ theory_context.get(Export.THEORY_PREFIX + "other_kinds") match {
case Some(entry) => split_lines(entry.uncompressed.text)
case None => Nil
}
val other = Other()
def read_other(kind: String): List[Entity[Other]] =
- read_entities(provider, Export.THEORY_PREFIX + "other/" + kind, kind, _ => other)
+ read_entities(theory_context, Export.THEORY_PREFIX + "other/" + kind, kind, _ => other)
kinds.map(kind => kind -> read_other(kind)).toMap
}
--- a/src/Pure/Thy/file_format.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Thy/file_format.scala Fri Sep 02 13:41:55 2022 +0200
@@ -85,7 +85,7 @@
} yield s
}
- def html_document(snapshot: Document.Snapshot): Option[Presentation.HTML_Document] = None
+ def html_document(snapshot: Document.Snapshot): Option[Browser_Info.HTML_Document] = None
/* PIDE session agent */
--- a/src/Pure/Thy/html.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Thy/html.scala Fri Sep 02 13:41:55 2022 +0200
@@ -94,6 +94,27 @@
def script_file(path: Path): XML.Elem = script_file(Url.print_file(path.file))
+ /* href */
+
+ def relative_href(location: Path, base: Option[Path] = None): String = {
+ val path =
+ base match {
+ case None =>
+ val path = location.expand
+ if (path.is_absolute) Exn.error("Relative href location expected: " + path) else path
+ case Some(base_dir) =>
+ val path1 = base_dir.absolute_file.toPath
+ val path2 = location.absolute_file.toPath
+ try { File.path(path1.relativize(path2).toFile) }
+ catch {
+ case _: IllegalArgumentException =>
+ Exn.error("Failed to relativize href location " + path2 + " with wrt. base " + path1)
+ }
+ }
+ if (path.is_current) "" else path.implode
+ }
+
+
/* output text with control symbols */
private val control: Map[Symbol.Symbol, Operator] =
@@ -416,26 +437,19 @@
/* document directory context (fonts + css) */
- def relative_prefix(dir: Path, base: Option[Path]): String =
- base match {
- case None => ""
- case Some(base_dir) =>
- val path = File.path(dir.absolute.java_path.relativize(base_dir.absolute.java_path).toFile)
- if (path.is_current) "" else path.implode + "/"
- }
-
def isabelle_css: Path = Path.explode("~~/etc/isabelle.css")
- def write_document(dir: Path, name: String, head: XML.Body, body: XML.Body,
- base: Option[Path] = None,
+ def write_document(base_dir: Path, name: String, head: XML.Body, body: XML.Body,
+ root: Option[Path] = None,
css: String = isabelle_css.file_name,
hidden: Boolean = true,
structural: Boolean = true
): Unit = {
- Isabelle_System.make_directory(dir)
- val prefix = relative_prefix(dir, base)
- File.write(dir + isabelle_css.base, fonts_css_dir(prefix) + "\n\n" + File.read(isabelle_css))
- File.write(dir + Path.basic(name),
+ Isabelle_System.make_directory(base_dir)
+ val fonts_prefix = relative_href(root getOrElse base_dir, base = Some(base_dir))
+ val fonts = fonts_css_dir(fonts_prefix)
+ File.write(base_dir + isabelle_css.base, fonts + "\n\n" + File.read(isabelle_css))
+ File.write(base_dir + Path.basic(name),
output_document(head, body, css = css, hidden = hidden, structural = structural))
}
}
--- a/src/Pure/Thy/latex.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Thy/latex.scala Fri Sep 02 13:41:55 2022 +0200
@@ -133,7 +133,7 @@
val tags =
(for ((name, op) <- map.iterator)
yield "\\isa" + op + "tag{" + name + "}").toList
- File.Content(path, comment + """
+ File.content(path, comment + """
\newcommand{\isakeeptag}[1]%
{\includecomment{isadelim#1}\includecomment{isatag#1}\csarg\def{isafold#1}{}}
--- a/src/Pure/Thy/presentation.scala Sat Jun 25 13:34:41 2022 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,656 +0,0 @@
-/* Title: Pure/Thy/presentation.scala
- Author: Makarius
-
-HTML presentation of PIDE document content.
-*/
-
-package isabelle
-
-
-import scala.annotation.tailrec
-import scala.collection.immutable.SortedMap
-import scala.collection.mutable
-
-
-object Presentation {
- /** HTML documents **/
-
- /* HTML context */
-
- sealed case class HTML_Document(title: String, content: String)
-
- abstract class HTML_Context {
- /* directory structure and resources */
-
- def root_dir: Path
- def theory_session(name: Document.Node.Name): Sessions.Info
-
- def session_dir(info: Sessions.Info): Path =
- root_dir + Path.explode(info.chapter_session)
- def theory_path(name: Document.Node.Name): Path =
- session_dir(theory_session(name)) + Path.explode(name.theory_base_name).html
- def files_path(name: Document.Node.Name, path: Path): Path =
- theory_path(name).dir + Path.explode("files") + path.squash.html
-
- type Theory_Exports = Map[String, Entity_Context.Theory_Export]
- def theory_exports: Theory_Exports = Map.empty
- def theory_export(name: String): Entity_Context.Theory_Export =
- theory_exports.getOrElse(name, Entity_Context.no_theory_export)
-
-
- /* HTML content */
-
- def head(title: String, rest: XML.Body = Nil): XML.Tree =
- HTML.div("head", HTML.chapter(title) :: rest)
-
- def source(body: XML.Body): XML.Tree = HTML.pre("source", body)
-
- def contents(
- heading: String,
- items: List[XML.Body],
- css_class: String = "contents"
- ) : List[XML.Elem] = {
- if (items.isEmpty) Nil
- else List(HTML.div(css_class, List(HTML.section(heading), HTML.itemize(items))))
- }
-
- val isabelle_css: String = File.read(HTML.isabelle_css)
-
- def html_document(title: String, body: XML.Body, fonts_css: String): HTML_Document = {
- val content =
- HTML.output_document(
- List(
- HTML.style(fonts_css + "\n\n" + isabelle_css),
- HTML.title(title)),
- List(HTML.source(body)), css = "", structural = false)
- HTML_Document(title, content)
- }
- }
-
-
- /* presentation elements */
-
- sealed case class Elements(
- html: Markup.Elements = Markup.Elements.empty,
- entity: Markup.Elements = Markup.Elements.empty,
- language: Markup.Elements = Markup.Elements.empty)
-
- val elements1: Elements =
- Elements(
- html = Rendering.foreground_elements ++ Rendering.text_color_elements +
- Markup.NUMERAL + Markup.COMMENT + Markup.ENTITY + Markup.LANGUAGE,
- entity = Markup.Elements(Markup.THEORY, Markup.TYPE_NAME, Markup.CONSTANT, Markup.FACT,
- Markup.CLASS, Markup.LOCALE, Markup.FREE))
-
- val elements2: Elements =
- Elements(
- html = elements1.html ++ Rendering.markdown_elements,
- language = Markup.Elements(Markup.Language.DOCUMENT))
-
-
- /* formal entities */
-
- type Entity = Export_Theory.Entity[Export_Theory.No_Content]
-
- object Entity_Context {
- sealed case class Theory_Export(
- entity_by_range: Map[Symbol.Range, List[Export_Theory.Entity[Export_Theory.No_Content]]],
- entity_by_kind_name: Map[(String, String), Export_Theory.Entity[Export_Theory.No_Content]],
- others: List[String])
-
- val no_theory_export: Theory_Export = Theory_Export(Map.empty, Map.empty, Nil)
-
- object Theory_Ref {
- def unapply(props: Properties.T): Option[Document.Node.Name] =
- (props, props, props) match {
- case (Markup.Kind(Markup.THEORY), Markup.Name(theory), Position.Def_File(thy_file)) =>
- Some(Resources.file_node(Path.explode(thy_file), theory = theory))
- case _ => None
- }
- }
-
- object Entity_Ref {
- def unapply(props: Properties.T): Option[(Path, Option[String], String, String)] =
- (props, props, props, props) match {
- case (Markup.Entity.Ref.Prop(_), Position.Def_File(def_file),
- Markup.Kind(kind), Markup.Name(name)) =>
- val def_theory = Position.Def_Theory.unapply(props)
- Some((Path.explode(def_file), def_theory, kind, name))
- case _ => None
- }
- }
-
- val empty: Entity_Context = new Entity_Context
-
- def make(
- session: String,
- deps: Sessions.Deps,
- node: Document.Node.Name,
- html_context: HTML_Context): Entity_Context =
- new Entity_Context {
- private val seen_ranges: mutable.Set[Symbol.Range] = mutable.Set.empty
-
- override def make_def(range: Symbol.Range, body: XML.Body): Option[XML.Elem] = {
- body match {
- case List(XML.Elem(Markup("span", List("id" -> _)), _)) => None
- case _ =>
- Some {
- val entities =
- html_context.theory_exports.get(node.theory)
- .flatMap(_.entity_by_range.get(range))
- .getOrElse(Nil)
- val body1 =
- if (seen_ranges.contains(range)) {
- HTML.entity_def(HTML.span(HTML.id(offset_id(range)), body))
- }
- else HTML.span(body)
- entities.map(_.kname).foldLeft(body1) {
- case (elem, id) => HTML.entity_def(HTML.span(HTML.id(id), List(elem)))
- }
- }
- }
- }
-
- private def offset_id(range: Text.Range): String =
- "offset_" + range.start + ".." + range.stop
-
- private def physical_ref(thy_name: String, props: Properties.T): Option[String] = {
- for {
- range <- Position.Def_Range.unapply(props)
- if thy_name == node.theory
- } yield {
- seen_ranges += range
- offset_id(range)
- }
- }
-
- private def logical_ref(thy_name: String, kind: String, name: String): Option[String] =
- for {
- thy <- html_context.theory_exports.get(thy_name)
- entity <- thy.entity_by_kind_name.get((kind, name))
- } yield entity.kname
-
- override def make_ref(props: Properties.T, body: XML.Body): Option[XML.Elem] = {
- props match {
- case Theory_Ref(node_name) =>
- node_relative(deps, session, node_name).map(html_dir =>
- HTML.link(html_dir + html_name(node_name), body))
- case Entity_Ref(file_path, def_theory, kind, name) if file_path.get_ext == "thy" =>
- for {
- thy_name <-
- def_theory orElse (if (File.eq(node.path, file_path)) Some(node.theory) else None)
- node_name = Resources.file_node(file_path, theory = thy_name)
- html_dir <- node_relative(deps, session, node_name)
- html_file = node_file(node_name)
- html_ref <-
- logical_ref(thy_name, kind, name) orElse physical_ref(thy_name, props)
- } yield {
- HTML.entity_ref(HTML.link(html_dir + html_file + "#" + html_ref, body))
- }
- case _ => None
- }
- }
- }
- }
-
- class Entity_Context {
- def make_def(range: Symbol.Range, body: XML.Body): Option[XML.Elem] = None
- def make_ref(props: Properties.T, body: XML.Body): Option[XML.Elem] = None
- }
-
-
- /* HTML output */
-
- private val div_elements =
- Set(HTML.div.name, HTML.pre.name, HTML.par.name, HTML.list.name, HTML.`enum`.name,
- HTML.descr.name)
-
- def make_html(
- entity_context: Entity_Context,
- elements: Elements,
- xml: XML.Body
- ): XML.Body = {
- def html_div(html: XML.Body): Boolean =
- html exists {
- case XML.Elem(markup, body) => div_elements.contains(markup.name) || html_div(body)
- case XML.Text(_) => false
- }
-
- def html_class(c: String, html: XML.Body): XML.Body =
- if (c == "") html
- else if (html_div(html)) List(HTML.div(c, html))
- else List(HTML.span(c, html))
-
- def html_body(xml_body: XML.Body, end_offset: Symbol.Offset): (XML.Body, Symbol.Offset) =
- xml_body.foldRight((List.empty[XML.Tree], end_offset)) { case (tree, (res, end_offset1)) =>
- val (res1, offset) = html_body_single(tree, end_offset1)
- (res1 ++ res, offset)
- }
-
- @tailrec
- def html_body_single(xml_tree: XML.Tree, end_offset: Symbol.Offset): (XML.Body, Symbol.Offset) =
- xml_tree match {
- case XML.Wrapped_Elem(markup, _, body) => html_body_single(XML.Elem(markup, body), end_offset)
- case XML.Elem(Markup(Markup.ENTITY, props @ Markup.Kind(kind)), body) =>
- val (body1, offset) = html_body(body, end_offset)
- if (elements.entity(kind)) {
- entity_context.make_ref(props, body1) match {
- case Some(link) => (List(link), offset)
- case None => (body1, offset)
- }
- }
- else (body1, offset)
- case XML.Elem(Markup(Markup.LANGUAGE, Markup.Name(name)), body) =>
- val (body1, offset) = html_body(body, end_offset)
- (html_class(if (elements.language(name)) name else "", body1), offset)
- case XML.Elem(Markup(Markup.MARKDOWN_PARAGRAPH, _), body) =>
- val (body1, offset) = html_body(body, end_offset)
- (List(HTML.par(body1)), offset)
- case XML.Elem(Markup(Markup.MARKDOWN_ITEM, _), body) =>
- val (body1, offset) = html_body(body, end_offset)
- (List(HTML.item(body1)), offset)
- case XML.Elem(Markup(Markup.Markdown_Bullet.name, _), text) =>
- (Nil, end_offset - XML.symbol_length(text))
- case XML.Elem(Markup.Markdown_List(kind), body) =>
- val (body1, offset) = html_body(body, end_offset)
- if (kind == Markup.ENUMERATE) (List(HTML.`enum`(body1)), offset)
- else (List(HTML.list(body1)), offset)
- case XML.Elem(markup, body) =>
- val name = markup.name
- val (body1, offset) = html_body(body, end_offset)
- val html =
- markup.properties match {
- case Markup.Kind(kind) if kind == Markup.COMMAND || kind == Markup.KEYWORD =>
- html_class(kind, body1)
- case _ =>
- body1
- }
- Rendering.foreground.get(name) orElse Rendering.text_color.get(name) match {
- case Some(c) => (html_class(c.toString, html), offset)
- case None => (html_class(name, html), offset)
- }
- case XML.Text(text) =>
- val offset = end_offset - Symbol.length(text)
- val body = HTML.text(Symbol.decode(text))
- entity_context.make_def(Text.Range(offset, end_offset), body) match {
- case Some(body1) => (List(body1), offset)
- case None => (body, offset)
- }
- }
-
- html_body(xml, XML.symbol_length(xml) + 1)._1
- }
-
-
- /* PIDE HTML document */
-
- def html_document(
- snapshot: Document.Snapshot,
- html_context: HTML_Context,
- elements: Elements,
- plain_text: Boolean = false,
- fonts_css: String = HTML.fonts_css()
- ): HTML_Document = {
- require(!snapshot.is_outdated, "document snapshot outdated")
-
- val name = snapshot.node_name
- if (plain_text) {
- val title = "File " + Symbol.cartouche_decoded(name.path.file_name)
- val body = HTML.text(snapshot.node.source)
- html_context.html_document(title, body, fonts_css)
- }
- else {
- Resources.html_document(snapshot) getOrElse {
- val title =
- if (name.is_theory) "Theory " + quote(name.theory_base_name)
- else "File " + Symbol.cartouche_decoded(name.path.file_name)
- val xml = snapshot.xml_markup(elements = elements.html)
- val body = make_html(Entity_Context.empty, elements, xml)
- html_context.html_document(title, body, fonts_css)
- }
- }
- }
-
-
-
- /** HTML presentation **/
-
- /* presentation context */
-
- object Context {
- val none: Context = new Context { def enabled: Boolean = false }
- val standard: Context = new Context { def enabled: Boolean = true }
-
- def dir(path: Path): Context =
- new Context {
- def enabled: Boolean = true
- override def dir(store: Sessions.Store): Path = path
- }
-
- def make(s: String): Context =
- if (s == ":") standard else dir(Path.explode(s))
- }
-
- abstract class Context private {
- def enabled: Boolean
- def enabled(info: Sessions.Info): Boolean = enabled || info.browser_info
- def dir(store: Sessions.Store): Path = store.presentation_dir
- def dir(store: Sessions.Store, info: Sessions.Info): Path =
- dir(store) + Path.explode(info.chapter_session)
- }
-
-
- /* maintain chapter index */
-
- private val sessions_path = Path.basic(".sessions")
-
- private def read_sessions(dir: Path): List[(String, String)] = {
- val path = dir + sessions_path
- if (path.is_file) {
- import XML.Decode._
- list(pair(string, string))(Symbol.decode_yxml(File.read(path)))
- }
- else Nil
- }
-
- def update_chapter(
- presentation_dir: Path,
- chapter: String,
- new_sessions: List[(String, String)]
- ): Unit = {
- val dir = Isabelle_System.make_directory(presentation_dir + Path.basic(chapter))
-
- val sessions0 =
- try { read_sessions(dir) }
- catch { case _: XML.Error => Nil }
-
- val sessions = (SortedMap.empty[String, String] ++ sessions0 ++ new_sessions).toList
- File.write(dir + sessions_path,
- {
- import XML.Encode._
- YXML.string_of_body(list(pair(string, string))(sessions))
- })
-
- val title = "Isabelle/" + chapter + " sessions"
- HTML.write_document(dir, "index.html",
- List(HTML.title(title + Isabelle_System.isabelle_heading())),
- HTML.chapter(title) ::
- (if (sessions.isEmpty) Nil
- else
- List(HTML.div("sessions",
- List(HTML.description(
- sessions.map({ case (name, description) =>
- val descr = Symbol.trim_blank_lines(description)
- (List(HTML.link(name + "/index.html", HTML.text(name))),
- if (descr == "") Nil
- else HTML.break ::: List(HTML.pre(HTML.text(descr)))) })))))),
- base = Some(presentation_dir))
- }
-
- def update_root(presentation_dir: Path): Unit = {
- Isabelle_System.make_directory(presentation_dir)
- HTML.init_fonts(presentation_dir)
- Isabelle_System.copy_file(Path.explode("~~/lib/logo/isabelle.gif"),
- presentation_dir + Path.explode("isabelle.gif"))
- val title = "The " + XML.text(Isabelle_System.isabelle_name()) + " Library"
- File.write(presentation_dir + Path.explode("index.html"),
- HTML.header +
-"""
-<head>
- """ + HTML.head_meta + """
- <title>""" + title + """</title>
-</head>
-
-<body text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#000099" alink="#404040">
- <center>
- <table width="100%" border="0" cellspacing="10" cellpadding="0">
- <tr>
- <td width="20%" valign="middle" align="center"><a href="https://isabelle.in.tum.de/"><img align="bottom" src="isabelle.gif" width="100" height="86" alt="[Isabelle]" border="0" /></a></td>
-
- <td width="80%" valign="middle" align="center">
- <table width="90%" border="0" cellspacing="0" cellpadding="20">
- <tr>
- <td valign="middle" align="center" bgcolor="#AACCCC"><font face="Helvetica,Arial" size="+2">""" + title + """</font></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </center>
- <hr />
-""" + File.read(Path.explode("~~/lib/html/library_index_content.template")) +
-"""
-</body>
-""" + HTML.footer)
- }
-
-
- /* present session */
-
- val session_graph_path = Path.explode("session_graph.pdf")
- val readme_path = Path.explode("README.html")
-
- def html_name(name: Document.Node.Name): String = Path.explode(name.theory_base_name).html.implode
- def files_path(src_path: Path): String = (Path.explode("files") + src_path.squash.html).implode
-
- private def node_file(name: Document.Node.Name): String =
- if (name.node.endsWith(".thy")) html_name(name) else files_path(name.path)
-
- private def session_relative(
- deps: Sessions.Deps,
- session0: String,
- session1: String
- ): Option[String] = {
- for {
- info0 <- deps.sessions_structure.get(session0)
- info1 <- deps.sessions_structure.get(session1)
- } yield info0.relative_path(info1)
- }
-
- def node_relative(
- deps: Sessions.Deps,
- session0: String,
- node_name: Document.Node.Name
- ): Option[String] = {
- val session1 = deps(session0).theory_qualifier(node_name)
- session_relative(deps, session0, session1)
- }
-
- def theory_link(
- deps: Sessions.Deps,
- session0: String,
- name: Document.Node.Name,
- body: XML.Body,
- anchor: Option[String] = None
- ): Option[XML.Tree] = {
- val session1 = deps(session0).theory_qualifier(name)
- val info0 = deps.sessions_structure.get(session0)
- val info1 = deps.sessions_structure.get(session1)
- val fragment = if (anchor.isDefined) "#" + anchor.get else ""
- if (info0.isDefined && info1.isDefined) {
- Some(HTML.link(info0.get.relative_path(info1.get) + html_name(name) + fragment, body))
- }
- else None
- }
-
- def read_exports(
- sessions: List[String],
- deps: Sessions.Deps,
- db_context: Sessions.Database_Context
- ): Map[String, Entity_Context.Theory_Export] = {
- type Batch = (String, List[String])
- val batches =
- sessions.foldLeft((Set.empty[String], List.empty[Batch]))(
- { case ((seen, batches), session) =>
- val thys = deps(session).loaded_theories.keys.filterNot(seen)
- (seen ++ thys, (session, thys) :: batches)
- })._2
- Par_List.map[Batch, List[(String, Entity_Context.Theory_Export)]](
- { case (session, thys) =>
- for (thy_name <- thys) yield {
- val theory =
- if (thy_name == Thy_Header.PURE) Export_Theory.no_theory
- else {
- val provider = Export.Provider.database_context(db_context, List(session), thy_name)
- if (Export_Theory.read_theory_parents(provider, thy_name).isDefined) {
- Export_Theory.read_theory(provider, session, thy_name, cache = db_context.cache)
- }
- else Export_Theory.no_theory
- }
- val entity_by_range =
- theory.entity_iterator.toList.groupBy(_.range)
- val entity_by_kind_name =
- theory.entity_iterator.map(entity => ((entity.kind, entity.name), entity)).toMap
- val others = theory.others.keySet.toList
- thy_name -> Entity_Context.Theory_Export(entity_by_range, entity_by_kind_name, others)
- }
- }, batches).flatten.toMap
- }
-
- def session_html(
- session: String,
- deps: Sessions.Deps,
- db_context: Sessions.Database_Context,
- progress: Progress = new Progress,
- verbose: Boolean = false,
- html_context: HTML_Context,
- session_elements: Elements
- ): Unit = {
- val info = deps.sessions_structure(session)
- val options = info.options
- val base = deps(session)
-
- val hierarchy = deps.sessions_structure.build_hierarchy(session)
- val hierarchy_theories = hierarchy.reverse.flatMap(a => deps(a).used_theories.map(_._1))
-
- val session_dir = Isabelle_System.make_directory(html_context.session_dir(info))
-
- Bytes.write(session_dir + session_graph_path,
- graphview.Graph_File.make_pdf(options, base.session_graph_display))
-
- val documents =
- for {
- doc <- info.document_variants
- document <- db_context.input_database(session)(Document_Build.read_document(_, _, doc.name))
- } yield {
- val doc_path = (session_dir + doc.path.pdf).expand
- if (verbose) progress.echo("Presenting document " + session + "/" + doc.name)
- if (options.bool("document_echo")) progress.echo("Document at " + doc_path)
- Bytes.write(doc_path, document.pdf)
- doc
- }
-
- val view_links = {
- val deps_link =
- HTML.link(session_graph_path, HTML.text("theory dependencies"))
-
- val readme_links =
- if ((info.dir + readme_path).is_file) {
- Isabelle_System.copy_file(info.dir + readme_path, session_dir + readme_path)
- List(HTML.link(readme_path, HTML.text("README")))
- }
- else Nil
-
- val document_links =
- documents.map(doc => HTML.link(doc.path.pdf, HTML.text(doc.name)))
-
- Library.separate(HTML.break ::: HTML.nl,
- (deps_link :: readme_links ::: document_links).
- map(link => HTML.text("View ") ::: List(link))).flatten
- }
-
- def entity_context(name: Document.Node.Name): Entity_Context =
- Entity_Context.make(session, deps, name, html_context)
-
-
- sealed case class Seen_File(
- src_path: Path,
- thy_name: Document.Node.Name,
- thy_session: String
- ) {
- val files_path: Path = html_context.files_path(thy_name, src_path)
-
- def check(src_path1: Path, thy_name1: Document.Node.Name, thy_session1: String): Boolean = {
- val files_path1 = html_context.files_path(thy_name1, src_path1)
- (src_path == src_path1 || files_path == files_path1) && thy_session == thy_session1
- }
- }
- var seen_files = List.empty[Seen_File]
-
- def present_theory(name: Document.Node.Name): Option[XML.Body] = {
- progress.expose_interrupt()
-
- Build_Job.read_theory(db_context, hierarchy, name.theory).flatMap { command =>
- if (verbose) progress.echo("Presenting theory " + name)
- val snapshot = Document.State.init.snippet(command)
-
- val thy_elements =
- session_elements.copy(entity =
- html_context.theory_export(name.theory).others
- .foldLeft(session_elements.entity)(_ + _))
-
- val files_html =
- for {
- (src_path, xml) <- snapshot.xml_markup_blobs(elements = thy_elements.html)
- if xml.nonEmpty
- }
- yield {
- progress.expose_interrupt()
- if (verbose) progress.echo("Presenting file " + src_path)
-
- (src_path, html_context.source(
- make_html(Entity_Context.empty, thy_elements, xml)))
- }
-
- val thy_html =
- html_context.source(
- make_html(entity_context(name), thy_elements,
- snapshot.xml_markup(elements = thy_elements.html)))
-
- val thy_session = html_context.theory_session(name)
- val thy_dir = Isabelle_System.make_directory(html_context.session_dir(thy_session))
- val files =
- for { (src_path, file_html) <- files_html }
- yield {
- seen_files.find(_.check(src_path, name, thy_session.name)) match {
- case None => seen_files ::= Seen_File(src_path, name, thy_session.name)
- case Some(seen_file) =>
- error("Incoherent use of file name " + src_path + " as " + files_path(src_path) +
- " in theory " + seen_file.thy_name + " vs. " + name)
- }
-
- val file_path = html_context.files_path(name, src_path)
- val file_title = "File " + Symbol.cartouche_decoded(src_path.implode_short)
- HTML.write_document(file_path.dir, file_path.file_name,
- List(HTML.title(file_title)), List(html_context.head(file_title), file_html),
- base = Some(html_context.root_dir))
-
- List(HTML.link(files_path(src_path), HTML.text(file_title)))
- }
-
- val thy_title = "Theory " + name.theory_base_name
-
- HTML.write_document(thy_dir, html_name(name),
- List(HTML.title(thy_title)), List(html_context.head(thy_title), thy_html),
- base = Some(html_context.root_dir))
-
- if (thy_session.name == session) {
- Some(
- List(HTML.link(html_name(name),
- HTML.text(name.theory_base_name) :::
- (if (files.isEmpty) Nil else List(HTML.itemize(files))))))
- }
- else None
- }
- }
-
- val theories = base.session_theories.flatMap(present_theory)
-
- val title = "Session " + session
- HTML.write_document(session_dir, "index.html",
- List(HTML.title(title + Isabelle_System.isabelle_heading())),
- html_context.head(title, List(HTML.par(view_links))) ::
- html_context.contents("Theories", theories),
- base = Some(html_context.root_dir))
- }
-}
--- a/src/Pure/Thy/sessions.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Thy/sessions.ML Fri Sep 02 13:41:55 2022 +0200
@@ -8,7 +8,8 @@
sig
val root_name: string
val theory_name: string
- val command_parser: (Toplevel.transition -> Toplevel.transition) parser
+ val chapter_definition_parser: (Toplevel.transition -> Toplevel.transition) parser
+ val session_parser: (Toplevel.transition -> Toplevel.transition) parser
end;
structure Sessions: SESSIONS =
@@ -19,6 +20,12 @@
local
+val groups =
+ Scan.optional (Parse.$$$ "(" |-- Parse.!!! (Scan.repeat1 Parse.name --| Parse.$$$ ")")) [];
+
+val description =
+ Scan.optional (Parse.$$$ "description" |-- Parse.!!! (Parse.input Parse.embedded)) Input.empty;
+
val theory_entry = Parse.input Parse.theory_name --| Parse.opt_keyword "global";
val theories =
@@ -41,18 +48,30 @@
Parse.$$$ "export_files" |--
Parse.!!! (Scan.optional in_path (Input.string "export") -- prune -- Scan.repeat1 Parse.embedded);
+val export_classpath =
+ Parse.$$$ "export_classpath" |-- Scan.repeat Parse.embedded;
+
fun path_source source path =
Input.source (Input.is_delimited source) (Path.implode path) (Input.range_of source);
in
-val command_parser =
- Parse.session_name --
- Scan.optional (Parse.$$$ "(" |-- Parse.!!! (Scan.repeat1 Parse.name --| Parse.$$$ ")")) [] --
+val chapter_definition_parser =
+ Parse.chapter_name -- groups -- description >> (fn (_, descr) =>
+ Toplevel.keep (fn state =>
+ let
+ val ctxt = Toplevel.context_of state;
+ val _ =
+ Context_Position.report ctxt
+ (Position.range_position (Symbol_Pos.range (Input.source_explode descr)))
+ Markup.comment;
+ in () end));
+
+val session_parser =
+ Parse.session_name -- groups --
Scan.optional (Parse.$$$ "in" |-- Parse.!!! Parse.path_input) (Input.string ".") --
(Parse.$$$ "=" |--
- Parse.!!! (Scan.option (Parse.session_name --| Parse.!!! (Parse.$$$ "+")) --
- Scan.optional (Parse.$$$ "description" |-- Parse.!!! (Parse.input Parse.embedded)) Input.empty --
+ Parse.!!! (Scan.option (Parse.session_name --| Parse.!!! (Parse.$$$ "+")) -- description --
Scan.optional (Parse.$$$ "options" |-- Parse.!!! Parse.options) [] --
Scan.optional (Parse.$$$ "sessions" |--
Parse.!!! (Scan.repeat1 Parse.session_name)) [] --
@@ -60,10 +79,11 @@
Scan.repeat theories --
Scan.optional document_theories [] --
Scan.repeat document_files --
- Scan.repeat export_files))
+ Scan.repeat export_files --
+ Scan.optional export_classpath []))
>> (fn (((((session, _), _), dir),
- (((((((((parent, descr), options), sessions), directories), theories),
- document_theories), document_files), export_files)))) =>
+ ((((((((((parent, descr), options), sessions), directories), theories),
+ document_theories), document_files), export_files), _)))) =>
Toplevel.keep (fn state =>
let
val ctxt = Toplevel.context_of state;
--- a/src/Pure/Thy/sessions.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Thy/sessions.scala Fri Sep 02 13:41:55 2022 +0200
@@ -10,6 +10,7 @@
import java.nio.ByteBuffer
import java.nio.channels.FileChannel
import java.nio.file.StandardOpenOption
+import java.sql.SQLException
import scala.collection.immutable.{SortedSet, SortedMap}
import scala.collection.mutable
@@ -30,11 +31,8 @@
def is_pure(name: String): Boolean = name == Thy_Header.PURE
-
- def exclude_session(name: String): Boolean = name == "" || name == DRAFT
-
- def exclude_theory(name: String): Boolean =
- name == root_name || name == "README" || name == "index" || name == "bib"
+ def illegal_session(name: String): Boolean = name == "" || name == DRAFT
+ def illegal_theory(name: String): Boolean = name == root_name || name == "bib"
/* ROOTS file format */
@@ -59,29 +57,27 @@
/* base info and source dependencies */
sealed case class Base(
- pos: Position.T = Position.none,
- session_directories: Map[JFile, String] = Map.empty,
- global_theories: Map[String, String] = Map.empty,
- session_theories: List[Document.Node.Name] = Nil,
+ session_name: String = "",
+ session_pos: Position.T = Position.none,
+ proper_session_theories: List[Document.Node.Name] = Nil,
document_theories: List[Document.Node.Name] = Nil,
- loaded_theories: Graph[String, Outer_Syntax] = Graph.string,
- used_theories: List[(Document.Node.Name, Options)] = Nil,
+ loaded_theories: Graph[String, Outer_Syntax] = Graph.string, // cumulative imports
+ used_theories: List[(Document.Node.Name, Options)] = Nil, // new imports
load_commands: Map[Document.Node.Name, List[Command_Span.Span]] = Map.empty,
known_theories: Map[String, Document.Node.Entry] = Map.empty,
known_loaded_files: Map[String, List[Path]] = Map.empty,
overall_syntax: Outer_Syntax = Outer_Syntax.empty,
imported_sources: List[(Path, SHA1.Digest)] = Nil,
- sources: List[(Path, SHA1.Digest)] = Nil,
+ session_sources: List[(Path, SHA1.Digest)] = Nil,
session_graph_display: Graph_Display.Graph = Graph_Display.empty_graph,
errors: List[String] = Nil
) {
- override def toString: String =
- "Sessions.Base(loaded_theories = " + loaded_theories.size +
- ", used_theories = " + used_theories.length + ")"
+ def session_entry: (String, Base) = session_name -> this
- def theory_qualifier(name: String): String =
- global_theories.getOrElse(name, Long_Name.qualifier(name))
- def theory_qualifier(name: Document.Node.Name): String = theory_qualifier(name.theory)
+ override def toString: String =
+ "Sessions.Base(session_name = " + quote(session_name) +
+ ", loaded_theories = " + loaded_theories.size +
+ ", used_theories = " + used_theories.length + ")"
def loaded_theory(name: String): Boolean = loaded_theories.defined(name)
def loaded_theory(name: Document.Node.Name): Boolean = loaded_theory(name.theory)
@@ -98,6 +94,8 @@
nodes(name).syntax orElse loaded_theory_syntax(name) getOrElse overall_syntax
}
+ val bootstrap_base: Base = Base(overall_syntax = Thy_Header.bootstrap_syntax)
+
sealed case class Deps(sessions_structure: Structure, session_bases: Map[String, Base]) {
override def toString: String = "Sessions.Deps(" + sessions_structure + ")"
@@ -108,15 +106,15 @@
def imported_sources(name: String): List[SHA1.Digest] =
session_bases(name).imported_sources.map(_._2)
- def sources(name: String): List[SHA1.Digest] =
- session_bases(name).sources.map(_._2)
+ def session_sources(name: String): List[SHA1.Digest] =
+ session_bases(name).session_sources.map(_._2)
def errors: List[String] =
(for {
(name, base) <- session_bases.iterator
if base.errors.nonEmpty
} yield cat_lines(base.errors) +
- "\nThe error(s) above occurred in session " + quote(name) + Position.here(base.pos)
+ "\nThe error(s) above occurred in session " + quote(name) + Position.here(base.session_pos)
).toList
def check_errors: Deps =
@@ -124,6 +122,9 @@
case Nil => this
case errs => error(cat_lines(errs))
}
+
+ def base_info(session: String): Base_Info =
+ Base_Info(base = apply(session), sessions_structure = sessions_structure, errors = errors)
}
def deps(sessions_structure: Structure,
@@ -152,7 +153,8 @@
}
val session_bases =
- sessions_structure.imports_topological_order.foldLeft(Map("" -> sessions_structure.bootstrap)) {
+ sessions_structure.imports_topological_order.foldLeft(
+ Map(Sessions.bootstrap_base.session_entry)) {
case (session_bases, session_name) =>
progress.expose_interrupt()
@@ -165,20 +167,19 @@
val groups =
if (info.groups.isEmpty) ""
else info.groups.mkString(" (", " ", ")")
- progress.echo("Session " + info.chapter_session + groups)
+ progress.echo("Session " + info.chapter + "/" + session_name + groups)
}
val dependencies = resources.session_dependencies(info)
val overall_syntax = dependencies.overall_syntax
- val session_theories =
- dependencies.theories.filter(name => deps_base.theory_qualifier(name) == session_name)
+ val proper_session_theories =
+ dependencies.theories.filter(name =>
+ sessions_structure.theory_qualifier(name) == session_name)
val theory_files = dependencies.theories.map(_.path)
- dependencies.load_commands
-
val (load_commands, load_commands_errors) =
try { if (inlined_files) (dependencies.load_commands, Nil) else (Nil, Nil) }
catch { case ERROR(msg) => (Nil, List(msg)) }
@@ -205,7 +206,7 @@
Graph_Display.Node("[" + name + "]", "session." + name)
def node(name: Document.Node.Name): Graph_Display.Node = {
- val qualifier = deps_base.theory_qualifier(name)
+ val qualifier = sessions_structure.theory_qualifier(name)
if (qualifier == info.name)
Graph_Display.Node(name.theory_base_name, "theory." + name.theory)
else session_node(qualifier)
@@ -213,7 +214,7 @@
val required_sessions =
dependencies.loaded_theories.all_preds(dependencies.theories.map(_.theory))
- .map(theory => deps_base.theory_qualifier(theory))
+ .map(theory => sessions_structure.theory_qualifier(theory))
.filter(name => name != info.name && sessions_structure.defined(name))
val required_subgraph =
@@ -250,7 +251,7 @@
sessions_structure.imports_requirements(List(session_name)).toSet
for {
name <- dependencies.theories
- qualifier = deps_base.theory_qualifier(name)
+ qualifier = sessions_structure.theory_qualifier(name)
if !known_sessions(qualifier)
} yield "Bad import of theory " + quote(name.toString) +
": need to include sessions " + quote(qualifier) + " in ROOT"
@@ -272,8 +273,8 @@
known_theories.get(thy).map(_.name) match {
case None => err("Unknown document theory")
case Some(name) =>
- val qualifier = deps_base.theory_qualifier(name)
- if (session_theories.contains(name)) {
+ val qualifier = sessions_structure.theory_qualifier(name)
+ if (proper_session_theories.contains(name)) {
err("Redundant document theory from this session:")
}
else if (build_hierarchy.contains(qualifier)) None
@@ -288,7 +289,7 @@
val ok = info.dirs.map(_.canonical_file).toSet
val bad =
(for {
- name <- session_theories.iterator
+ name <- proper_session_theories.iterator
path = name.master_dir_path
if !ok(path.canonical_file)
path1 = File.relative_path(info.dir.canonical, path).getOrElse(path)
@@ -304,7 +305,7 @@
val errs3 = for (p <- info.dirs if !p.is_dir) yield "No such directory: " + p
val errs4 =
(for {
- name <- session_theories.iterator
+ name <- proper_session_theories.iterator
name1 <- resources.find_theory_node(name.theory)
if name.node != name1.node
} yield "Incoherent theory file import:\n " + name.path + " vs. \n " + name1.path)
@@ -326,10 +327,9 @@
val base =
Base(
- pos = info.pos,
- session_directories = sessions_structure.session_directories,
- global_theories = sessions_structure.global_theories,
- session_theories = session_theories,
+ session_name = info.name,
+ session_pos = info.pos,
+ proper_session_theories = proper_session_theories,
document_theories = document_theories,
loaded_theories = dependencies.loaded_theories,
used_theories = dependencies.theories_adjunct,
@@ -338,13 +338,13 @@
known_loaded_files = known_loaded_files,
overall_syntax = overall_syntax,
imported_sources = check_sources(imported_files),
- sources = check_sources(session_files),
+ session_sources = check_sources(session_files),
session_graph_display = session_graph_display,
errors = dependencies.errors ::: load_commands_errors ::: import_errors :::
document_errors ::: dir_errors ::: sources_errors ::: path_errors :::
bibtex_errors)
- session_bases + (info.name -> base)
+ session_bases + base.session_entry
}
catch {
case ERROR(msg) =>
@@ -360,15 +360,21 @@
/* base info */
sealed case class Base_Info(
- session: String,
- sessions_structure: Structure,
- errors: List[String],
base: Base,
- infos: List[Info]
+ sessions_structure: Structure = Structure.empty,
+ errors: List[String] = Nil,
+ infos: List[Info] = Nil
) {
- def check: Base_Info = if (errors.isEmpty) this else error(cat_lines(errors))
+ def session_name: String = base.session_name
+
+ def check_errors: Base_Info =
+ if (errors.isEmpty) this
+ else error(cat_lines(errors))
}
+ def base_info0(session: String): Base_Info =
+ Base_Info(Base(session_name = session))
+
def base_info(options: Options,
session: String,
progress: Progress = new Progress,
@@ -401,7 +407,7 @@
val required_theories =
for {
thy <- base.loaded_theories.keys
- if !ancestor_loaded(thy) && base.theory_qualifier(thy) != session
+ if !ancestor_loaded(thy) && selected_sessions.theory_qualifier(thy) != session
}
yield thy
@@ -412,7 +418,9 @@
(other_name,
List(
- make_info(info.options,
+ make_info(
+ Chapter_Defs.empty,
+ info.options,
dir_selected = false,
dir = Path.explode("$ISABELLE_TMP_PREFIX"),
chapter = info.chapter,
@@ -429,7 +437,8 @@
theories = List((Nil, required_theories.map(thy => ((thy, Position.none), false)))),
document_theories = Nil,
document_files = Nil,
- export_files = Nil))))
+ export_files = Nil,
+ export_classpath = Nil))))
}
}
else (session, Nil)
@@ -443,12 +452,21 @@
val deps1 = Sessions.deps(selected_sessions1, progress = progress)
- Base_Info(session1, full_sessions1, deps1.errors, deps1(session1), infos1)
+ Base_Info(deps1(session1), sessions_structure = full_sessions1,
+ errors = deps1.errors, infos = infos1)
}
/* cumulative session info */
+ sealed case class Chapter_Info(
+ name: String,
+ pos: Position.T,
+ groups: List[String],
+ description: String,
+ sessions: List[String]
+ )
+
sealed case class Info(
name: String,
chapter: String,
@@ -466,15 +484,9 @@
document_theories: List[(String, Position.T)],
document_files: List[(Path, Path)],
export_files: List[(Path, Int, List[String])],
+ export_classpath: List[String],
meta_digest: SHA1.Digest
) {
- def chapter_session: String = chapter + "/" + name
-
- def relative_path(info1: Info): String =
- if (name == info1.name) ""
- else if (chapter == info1.chapter) "../" + info1.name + "/"
- else "../../" + info1.chapter_session + "/"
-
def deps: List[String] = parent.toList ::: imports
def deps_base(session_bases: String => Base): Base = {
@@ -516,6 +528,8 @@
variants
}
+ def document_echo: Boolean = options.bool("document_echo")
+
def documents: List[Document_Build.Document_Variant] = {
val variants = document_variants
if (!document_enabled || document_files.isEmpty) Nil else variants
@@ -532,7 +546,7 @@
lazy val bibtex_entries: List[Text.Info[String]] =
(for {
(document_dir, file) <- document_files.iterator
- if Bibtex.is_bibtex(file.file_name)
+ if File.is_bib(file.file_name)
info <- Bibtex.entries(File.read(dir + document_dir + file)).iterator
} yield info).toList
@@ -543,6 +557,7 @@
}
def make_info(
+ chapter_defs: Chapter_Defs,
options: Options,
dir_selected: Boolean,
dir: Path,
@@ -552,7 +567,7 @@
try {
val name = entry.name
- if (exclude_session(name)) error("Bad session name")
+ if (illegal_session(name)) error("Illegal session name " + quote(name))
if (is_pure(name) && entry.parent.isDefined) error("Illegal parent session")
if (!is_pure(name) && !entry.parent.isDefined) error("Missing parent session")
@@ -565,8 +580,10 @@
entry.theories.map({ case (opts, thys) =>
(session_options ++ opts,
thys.map({ case ((thy, pos), _) =>
- if (exclude_theory(thy))
- error("Bad theory name " + quote(thy) + Position.here(pos))
+ val thy_name = Thy_Header.import_name(thy)
+ if (illegal_theory(thy_name)) {
+ error("Illegal theory name " + quote(thy_name) + Position.here(pos))
+ }
else (thy, pos) })) })
val global_theories =
@@ -596,10 +613,13 @@
entry.document_files)
.toString)
- Info(name, chapter, dir_selected, entry.pos, entry.groups, session_path,
+ val chapter_groups = chapter_defs(chapter).groups
+ val groups = chapter_groups ::: entry.groups.filterNot(chapter_groups.contains)
+
+ Info(name, chapter, dir_selected, entry.pos, groups, session_path,
entry.parent, entry.description, directories, session_options,
entry.imports, theories, global_theories, entry.document_theories, document_files,
- export_files, meta_digest)
+ export_files, entry.export_classpath, meta_digest)
}
catch {
case ERROR(msg) =>
@@ -635,9 +655,9 @@
}
object Structure {
- val empty: Structure = make(Nil)
+ val empty: Structure = make(Chapter_Defs.empty, Nil)
- def make(infos: List[Info]): Structure = {
+ def make(chapter_defs: Chapter_Defs, infos: List[Info]): Structure = {
def add_edges(
graph: Graph[String, Info],
kind: String,
@@ -710,12 +730,13 @@
}
}
- new Structure(
- session_positions, session_directories, global_theories, build_graph, imports_graph)
+ new Structure(chapter_defs, session_positions, session_directories,
+ global_theories, build_graph, imports_graph)
}
}
final class Structure private[Sessions](
+ chapter_defs: Chapter_Defs,
val session_positions: List[(String, Position.T)],
val session_directories: Map[JFile, String],
val global_theories: Map[String, String],
@@ -724,21 +745,31 @@
) {
sessions_structure =>
- def bootstrap: Base =
- Base(
- session_directories = session_directories,
- global_theories = global_theories,
- overall_syntax = Thy_Header.bootstrap_syntax)
+ def bootstrap: Base = Base(overall_syntax = Thy_Header.bootstrap_syntax)
def dest_session_directories: List[(String, String)] =
for ((file, session) <- session_directories.toList)
yield (File.standard_path(file), session)
- lazy val chapters: SortedMap[String, List[Info]] =
- build_graph.iterator.foldLeft(SortedMap.empty[String, List[Info]]) {
- case (chs, (_, (info, _))) =>
- chs + (info.chapter -> (info :: chs.getOrElse(info.chapter, Nil)))
- }
+ lazy val known_chapters: List[Chapter_Info] = {
+ val chapter_sessions =
+ Multi_Map.from(
+ for ((_, (info, _)) <- build_graph.iterator)
+ yield info.chapter -> info.name)
+ val chapters1 =
+ (for (entry <- chapter_defs.list.iterator) yield {
+ val sessions = chapter_sessions.get_list(entry.name)
+ Chapter_Info(entry.name, entry.pos, entry.groups, entry.description, sessions.sorted)
+ }).toList
+ val chapters2 =
+ (for {
+ (name, sessions) <- chapter_sessions.iterator_list
+ if !chapters1.exists(_.name == name)
+ } yield Chapter_Info(name, Position.none, Nil, "", sessions.sorted)).toList.sortBy(_.name)
+ chapters1 ::: chapters2
+ }
+
+ def relevant_chapters: List[Chapter_Info] = known_chapters.filter(_.sessions.nonEmpty)
def build_graph_display: Graph_Display.Graph = Graph_Display.make_graph(build_graph)
def imports_graph_display: Graph_Display.Graph = Graph_Display.make_graph(imports_graph)
@@ -749,6 +780,7 @@
def theory_qualifier(name: String): String =
global_theories.getOrElse(name, Long_Name.qualifier(name))
+ def theory_qualifier(name: Document.Node.Name): String = theory_qualifier(name.theory)
def check_sessions(names: List[String]): Unit = {
val bad_sessions = SortedSet(names.filterNot(defined): _*).toList
@@ -796,8 +828,7 @@
graph.restrict(graph.all_preds(sessions).toSet)
}
- new Structure(
- session_positions, session_directories, global_theories,
+ new Structure(chapter_defs, session_positions, session_directories, global_theories,
restrict(build_graph), restrict(imports_graph))
}
@@ -822,17 +853,19 @@
deps
}
+ def build_hierarchy(session: String): List[String] =
+ if (build_graph.defined(session)) build_graph.all_preds(List(session))
+ else List(session)
+
def build_selection(sel: Selection): List[String] = selected(build_graph, sel)
def build_descendants(ss: List[String]): List[String] = build_graph.all_succs(ss)
def build_requirements(ss: List[String]): List[String] = build_graph.all_preds_rev(ss)
def build_topological_order: List[String] = build_graph.topological_order
- def build_hierarchy(session: String): List[String] = build_graph.all_preds(List(session))
def imports_selection(sel: Selection): List[String] = selected(imports_graph, sel)
def imports_descendants(ss: List[String]): List[String] = imports_graph.all_succs(ss)
def imports_requirements(ss: List[String]): List[String] = imports_graph.all_preds_rev(ss)
def imports_topological_order: List[String] = imports_graph.topological_order
- def imports_hierarchy(session: String): List[String] = imports_graph.all_preds(List(session))
def bibtex_entries: List[(String, List[String])] =
build_topological_order.flatMap(name =>
@@ -848,6 +881,7 @@
/* parser */
+ private val CHAPTER_DEFINITION = "chapter_definition"
private val CHAPTER = "chapter"
private val SESSION = "session"
private val IN = "in"
@@ -860,10 +894,12 @@
private val DOCUMENT_THEORIES = "document_theories"
private val DOCUMENT_FILES = "document_files"
private val EXPORT_FILES = "export_files"
+ private val EXPORT_CLASSPATH = "export_classpath"
val root_syntax: Outer_Syntax =
Outer_Syntax.empty + "(" + ")" + "+" + "," + "=" + "[" + "]" +
GLOBAL + IN +
+ (CHAPTER_DEFINITION, Keyword.THY_DECL) +
(CHAPTER, Keyword.THY_DECL) +
(SESSION, Keyword.THY_DECL) +
(DESCRIPTION, Keyword.QUASI_COMMAND) +
@@ -873,10 +909,20 @@
(THEORIES, Keyword.QUASI_COMMAND) +
(DOCUMENT_THEORIES, Keyword.QUASI_COMMAND) +
(DOCUMENT_FILES, Keyword.QUASI_COMMAND) +
- (EXPORT_FILES, Keyword.QUASI_COMMAND)
+ (EXPORT_FILES, Keyword.QUASI_COMMAND) +
+ (EXPORT_CLASSPATH, Keyword.QUASI_COMMAND)
abstract class Entry
- sealed case class Chapter(name: String) extends Entry
+ object Chapter_Def {
+ def empty(chapter: String): Chapter_Def = Chapter_Def(Position.none, chapter, Nil, "")
+ }
+ sealed case class Chapter_Def(
+ pos: Position.T,
+ name: String,
+ groups: List[String],
+ description: String
+ ) extends Entry
+ sealed case class Chapter_Entry(name: String) extends Entry
sealed case class Session_Entry(
pos: Position.T,
name: String,
@@ -890,7 +936,8 @@
theories: List[(List[Options.Spec], List[((String, Position.T), Boolean)])],
document_theories: List[(String, Position.T)],
document_files: List[(String, String)],
- export_files: List[(String, Int, List[String])]
+ export_files: List[(String, Int, List[String])],
+ export_classpath: List[String]
) extends Entry {
def theories_no_position: List[(List[Options.Spec], List[(String, Boolean)])] =
theories.map({ case (a, b) => (a, b.map({ case ((c, _), d) => (c, d) })) })
@@ -898,12 +945,44 @@
document_theories.map(_._1)
}
+ object Chapter_Defs {
+ val empty: Chapter_Defs = new Chapter_Defs(Nil)
+ }
+
+ class Chapter_Defs private(rev_list: List[Chapter_Def]) {
+ def list: List[Chapter_Def] = rev_list.reverse
+
+ override def toString: String =
+ list.map(_.name).mkString("Chapter_Defs(", ", ", ")")
+
+ def get(chapter: String): Option[Chapter_Def] =
+ rev_list.find(_.name == chapter)
+
+ def apply(chapter: String): Chapter_Def =
+ get(chapter) getOrElse Chapter_Def.empty(chapter)
+
+ def + (entry: Chapter_Def): Chapter_Defs =
+ get(entry.name) match {
+ case None => new Chapter_Defs(entry :: rev_list)
+ case Some(old_entry) =>
+ error("Duplicate chapter definition " + quote(entry.name) +
+ Position.here(old_entry.pos) + Position.here(entry.pos))
+ }
+ }
+
private object Parsers extends Options.Parsers {
- private val chapter: Parser[Chapter] = {
- val chapter_name = atom("chapter name", _.is_name)
+ private val groups: Parser[List[String]] =
+ ($$$("(") ~! (rep1(name) <~ $$$(")")) ^^ { case _ ~ x => x }) | success(Nil)
+
+ private val description: Parser[String] =
+ ($$$(DESCRIPTION) ~! text ^^ { case _ ~ x => x }) | success("")
- command(CHAPTER) ~! chapter_name ^^ { case _ ~ a => Chapter(a) }
- }
+ private val chapter_def: Parser[Chapter_Def] =
+ command(CHAPTER_DEFINITION) ~! (position(chapter_name) ~ groups ~ description) ^^
+ { case _ ~ ((a, pos) ~ b ~ c) => Chapter_Def(pos, a, b, c) }
+
+ private val chapter_entry: Parser[Chapter_Entry] =
+ command(CHAPTER) ~! chapter_name ^^ { case _ ~ a => Chapter_Entry(a) }
private val session_entry: Parser[Session_Entry] = {
val option =
@@ -934,29 +1013,32 @@
$$$(EXPORT_FILES) ~! ((in_path | success("export")) ~ prune ~ rep1(embedded)) ^^
{ case _ ~ (x ~ y ~ z) => (x, y, z) }
+ val export_classpath =
+ $$$(EXPORT_CLASSPATH) ~! (rep1(embedded) | success(List("*:classpath/*.jar"))) ^^
+ { case _ ~ x => x }
+
command(SESSION) ~!
- (position(session_name) ~
- (($$$("(") ~! (rep1(name) <~ $$$(")")) ^^ { case _ ~ x => x }) | success(Nil)) ~
+ (position(session_name) ~ groups ~
(($$$(IN) ~! path ^^ { case _ ~ x => x }) | success(".")) ~
($$$("=") ~!
- (opt(session_name ~! $$$("+") ^^ { case x ~ _ => x }) ~
- (($$$(DESCRIPTION) ~! text ^^ { case _ ~ x => x }) | success("")) ~
+ (opt(session_name ~! $$$("+") ^^ { case x ~ _ => x }) ~ description ~
(($$$(OPTIONS) ~! options ^^ { case _ ~ x => x }) | success(Nil)) ~
(($$$(SESSIONS) ~! rep1(session_name) ^^ { case _ ~ x => x }) | success(Nil)) ~
(($$$(DIRECTORIES) ~! rep1(path) ^^ { case _ ~ x => x }) | success(Nil)) ~
rep(theories) ~
(opt(document_theories) ^^ (x => x.getOrElse(Nil))) ~
(rep(document_files) ^^ (x => x.flatten)) ~
- rep(export_files)))) ^^
- { case _ ~ ((a, pos) ~ b ~ c ~ (_ ~ (d ~ e ~ f ~ g ~ h ~ i ~ j ~ k ~ l))) =>
- Session_Entry(pos, a, b, c, d, e, f, g, h, i, j, k, l) }
+ rep(export_files) ~
+ opt(export_classpath)))) ^^
+ { case _ ~ ((a, pos) ~ b ~ c ~ (_ ~ (d ~ e ~ f ~ g ~ h ~ i ~ j ~ k ~ l ~ m))) =>
+ Session_Entry(pos, a, b, c, d, e, f, g, h, i, j, k, l, m.getOrElse(Nil)) }
}
def parse_root(path: Path): List[Entry] = {
val toks = Token.explode(root_syntax.keywords, File.read(path))
val start = Token.Pos.file(path.implode)
-
- parse_all(rep(chapter | session_entry), Token.reader(toks, start)) match {
+ val parser: Parser[Entry] = chapter_def | chapter_entry | session_entry
+ parse_all(rep(parser), Token.reader(toks, start)) match {
case Success(result, _) => result
case bad => error(bad.toString)
}
@@ -969,17 +1051,6 @@
for (entry <- Parsers.parse_root(path) if entry.isInstanceOf[Session_Entry])
yield entry.asInstanceOf[Session_Entry]
- def read_root(options: Options, select: Boolean, path: Path): List[Info] = {
- var entry_chapter = UNSORTED
- val infos = new mutable.ListBuffer[Info]
- parse_root(path).foreach {
- case Chapter(name) => entry_chapter = name
- case entry: Session_Entry =>
- infos += make_info(options, select, path.dir, entry_chapter, entry)
- }
- infos.toList
- }
-
def parse_roots(roots: Path): List[String] = {
for {
line <- split_lines(File.read(roots))
@@ -1034,23 +1105,49 @@
else Nil
}
- val roots =
+ val raw_roots: List[(Boolean, Path)] =
for {
(select, dir) <- directories(dirs, select_dirs)
res <- load_dir(select, check_session_dir(dir))
} yield res
- val unique_roots =
- roots.foldLeft(Map.empty[JFile, (Boolean, Path)]) {
+ val unique_roots: List[(Boolean, Path, List[Entry])] =
+ raw_roots.foldLeft(Map.empty[JFile, (Boolean, Path, List[Entry])]) {
case (m, (select, path)) =>
val file = path.canonical_file
m.get(file) match {
- case None => m + (file -> (select, path))
- case Some((select1, path1)) => m + (file -> (select1 || select, path1))
+ case None =>
+ val entries = parse_root(path)
+ m + (file -> (select, path.dir, entries))
+ case Some((select1, dir1, entries1)) =>
+ m + (file -> (select1 || select, dir1, entries1))
+ }
+ }.valuesIterator.toList
+
+ val chapter_defs: Chapter_Defs =
+ unique_roots.foldLeft(Chapter_Defs.empty) {
+ case (defs1, (_, _, entries)) =>
+ entries.foldLeft(defs1) {
+ case ((defs2, entry: Chapter_Def)) => defs2 + entry
+ case ((defs2, _)) => defs2
}
- }.toList.map(_._2)
+ }
- Structure.make(unique_roots.flatMap(p => read_root(options, p._1, p._2)) ::: infos)
+ val info_roots = {
+ var chapter = UNSORTED
+ val info_roots = new mutable.ListBuffer[Info]
+ for ((select, dir, entries) <- unique_roots) {
+ entries.foreach {
+ case entry: Chapter_Entry => chapter = entry.name
+ case entry: Session_Entry =>
+ info_roots += make_info(chapter_defs, options, select, dir, chapter, entry)
+ case _ =>
+ }
+ }
+ info_roots.toList
+ }
+
+ Structure.make(chapter_defs, info_roots ::: infos)
}
@@ -1126,12 +1223,11 @@
val buf = ByteBuffer.allocate(n)
var i = 0
var m = 0
- var cont = true
- while (cont) {
+ while ({
m = file.read(buf)
if (m != -1) i += m
- cont = (m != -1 && n > i)
- }
+ m != -1 && n > i
+ }) ()
if (i == n) {
val prefix = new String(buf.array(), 0, sha1_prefix.length, UTF8.charset)
@@ -1178,69 +1274,14 @@
val input_heaps = SQL.Column.string("input_heaps")
val output_heap = SQL.Column.string("output_heap")
val return_code = SQL.Column.int("return_code")
- val build_columns = List(sources, input_heaps, output_heap, return_code)
+ val uuid = SQL.Column.string("uuid")
+ val build_columns = List(sources, input_heaps, output_heap, return_code, uuid)
val table = SQL.Table("isabelle_session_info", build_log_columns ::: build_columns)
- }
- class Database_Context private[Sessions](
- val store: Sessions.Store,
- database_server: Option[SQL.Database]
- ) extends AutoCloseable {
- def cache: Term.Cache = store.cache
-
- def close(): Unit = database_server.foreach(_.close())
-
- def output_database[A](session: String)(f: SQL.Database => A): A =
- database_server match {
- case Some(db) => f(db)
- case None => using(store.open_database(session, output = true))(f)
- }
-
- def input_database[A](session: String)(f: (SQL.Database, String) => Option[A]): Option[A] =
- database_server match {
- case Some(db) => f(db, session)
- case None =>
- store.try_open_database(session) match {
- case Some(db) => using(db)(f(_, session))
- case None => None
- }
- }
-
- def read_export(
- sessions: List[String],
- theory_name: String,
- name: String
- ): Option[Export.Entry] = {
- val attempts =
- database_server match {
- case Some(db) =>
- sessions.view.map(session_name =>
- Export.read_entry(db, store.cache, session_name, theory_name, name))
- case None =>
- sessions.view.map(session_name =>
- store.try_open_database(session_name) match {
- case Some(db) =>
- using(db)(Export.read_entry(_, store.cache, session_name, theory_name, name))
- case None => None
- })
- }
- attempts.collectFirst({ case Some(entry) => entry })
- }
-
- def get_export(
- session_hierarchy: List[String], theory_name: String, name: String): Export.Entry =
- read_export(session_hierarchy, theory_name, name) getOrElse
- Export.empty_entry(theory_name, name)
-
- override def toString: String = {
- val s =
- database_server match {
- case Some(db) => db.toString
- case None => "input_dirs = " + store.input_dirs.map(_.absolute).mkString(", ")
- }
- "Database_Context(" + s + ")"
- }
+ val augment_table: PostgreSQL.Source =
+ "ALTER TABLE IF EXISTS " + table.ident +
+ " ADD COLUMN IF NOT EXISTS " + uuid.decl(SQL.sql_type_postgresql)
}
def store(options: Options, cache: Term.Cache = Term.Cache.make()): Store =
@@ -1322,14 +1363,15 @@
port = options.int("build_database_ssh_port"))),
ssh_close = true)
- def open_database_context(): Database_Context =
- new Database_Context(store, if (database_server) Some(open_database_server()) else None)
-
- def try_open_database(name: String, output: Boolean = false): Option[SQL.Database] = {
+ def try_open_database(
+ name: String,
+ output: Boolean = false,
+ server: Boolean = database_server
+ ): Option[SQL.Database] = {
def check(db: SQL.Database): Option[SQL.Database] =
if (output || session_info_exists(db)) Some(db) else { db.close(); None }
- if (database_server) check(open_database_server())
+ if (server) check(open_database_server())
else if (output) Some(SQLite.open_database(output_database(name)))
else {
(for {
@@ -1340,9 +1382,11 @@
}
}
+ def error_database(name: String): Nothing =
+ error("Missing build database for session " + quote(name))
+
def open_database(name: String, output: Boolean = false): SQL.Database =
- try_open_database(name, output = output) getOrElse
- error("Missing build database for session " + quote(name))
+ try_open_database(name, output = output) getOrElse error_database(name)
def clean_output(name: String): (Boolean, Boolean) = {
val relevant_db =
@@ -1394,6 +1438,9 @@
db.create_table(Session_Info.table)
db.using_statement(
Session_Info.table.delete(Session_Info.session_name.where_equal(name)))(_.execute())
+ if (db.isInstanceOf[PostgreSQL.Database]) {
+ db.using_statement(Session_Info.augment_table)(_.execute())
+ }
db.create_table(Export.Data.table)
db.using_statement(
@@ -1413,12 +1460,10 @@
}
def session_info_defined(db: SQL.Database, name: String): Boolean =
- db.transaction {
- session_info_exists(db) && {
- db.using_statement(
- Session_Info.table.select(List(Session_Info.session_name),
- Session_Info.session_name.where_equal(name)))(stmt => stmt.execute_query().next())
- }
+ session_info_exists(db) && {
+ db.using_statement(
+ Session_Info.table.select(List(Session_Info.session_name),
+ Session_Info.session_name.where_equal(name)))(stmt => stmt.execute_query().next())
}
def write_session_info(
@@ -1428,7 +1473,8 @@
build: Build.Session_Info
): Unit = {
db.transaction {
- db.using_statement(Session_Info.table.insert()) { stmt =>
+ val table = Session_Info.table
+ db.using_statement(table.insert()) { stmt =>
stmt.string(1) = name
stmt.bytes(2) = Properties.encode(build_log.session_timing)
stmt.bytes(3) = Properties.compress(build_log.command_timings, cache = cache.xz)
@@ -1440,6 +1486,7 @@
stmt.string(9) = cat_lines(build.input_heaps)
stmt.string(10) = build.output_heap getOrElse ""
stmt.int(11) = build.return_code
+ stmt.string(12) = build.uuid
stmt.execute()
}
}
@@ -1468,17 +1515,21 @@
def read_build(db: SQL.Database, name: String): Option[Build.Session_Info] = {
if (db.tables.contains(Session_Info.table.name)) {
- db.using_statement(Session_Info.table.select(Session_Info.build_columns,
+ db.using_statement(Session_Info.table.select(Nil,
Session_Info.session_name.where_equal(name))) { stmt =>
val res = stmt.execute_query()
if (!res.next()) None
else {
+ val uuid =
+ try { Option(res.string(Session_Info.uuid)).getOrElse("") }
+ catch { case _: SQLException => "" }
Some(
Build.Session_Info(
res.string(Session_Info.sources),
split_lines(res.string(Session_Info.input_heaps)),
res.string(Session_Info.output_heap) match { case "" => None case s => Some(s) },
- res.int(Session_Info.return_code)))
+ res.int(Session_Info.return_code),
+ uuid))
}
}
}
--- a/src/Pure/Thy/thy_header.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Thy/thy_header.scala Fri Sep 02 13:41:55 2022 +0200
@@ -91,7 +91,7 @@
def import_name(s: String): String =
s match {
- case File_Name(name) if !name.endsWith(".thy") => name
+ case File_Name(name) if !File.is_thy(name) => name
case _ => error("Malformed theory import: " + quote(s))
}
--- a/src/Pure/Thy/thy_info.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Thy/thy_info.ML Fri Sep 02 13:41:55 2022 +0200
@@ -38,7 +38,8 @@
segments: Document_Output.segment list};
fun adjust_pos_properties (context: presentation_context) pos =
- Position.offset_properties_of (#adjust_pos context pos) @ Position.id_properties_of pos;
+ Position.offset_properties_of (#adjust_pos context pos) @
+ filter (fn (a, _) => a = Markup.idN orelse a = Markup.fileN) (Position.get_props pos);
structure Presentation = Theory_Data
(
--- a/src/Pure/Tools/build.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Tools/build.scala Fri Sep 02 13:41:55 2022 +0200
@@ -21,7 +21,8 @@
sources: String,
input_heaps: List[String],
output_heap: Option[String],
- return_code: Int
+ return_code: Int,
+ uuid: String
) {
def ok: Boolean = return_code == 0
}
@@ -39,7 +40,8 @@
case None => no_timings
case Some(db) =>
def ignore_error(msg: String) = {
- progress.echo_warning("Ignoring bad database " + db + (if (msg == "") "" else "\n" + msg))
+ progress.echo_warning("Ignoring bad database " + db +
+ " for session " + quote(session_name) + (if (msg == "") "" else ":\n" + msg))
no_timings
}
try {
@@ -54,7 +56,7 @@
catch {
case ERROR(msg) => ignore_error(msg)
case exn: java.lang.Error => ignore_error(Exn.message(exn))
- case _: XML.Error => ignore_error("")
+ case _: XML.Error => ignore_error("XML.Error")
}
finally { db.close() }
}
@@ -162,7 +164,7 @@
def build(
options: Options,
selection: Sessions.Selection = Sessions.Selection.empty,
- presentation: Presentation.Context = Presentation.Context.none,
+ browser_info: Browser_Info.Config = Browser_Info.Config.none,
progress: Progress = new Progress,
check_unknown_files: Boolean = false,
build_heap: Boolean = false,
@@ -203,12 +205,12 @@
def sources_stamp(deps: Sessions.Deps, session_name: String): String = {
val digests =
full_sessions(session_name).meta_digest ::
- deps.sources(session_name) :::
+ deps.session_sources(session_name) :::
deps.imported_sources(session_name)
SHA1.digest_set(digests).toString
}
- val deps = {
+ val build_deps = {
val deps0 =
Sessions.deps(full_sessions.selection(selection),
progress = progress, inlined_files = true, verbose = verbose,
@@ -233,12 +235,14 @@
else deps0
}
+ val build_sessions = build_deps.sessions_structure
+
val presentation_sessions =
(for {
- session_name <- deps.sessions_structure.build_topological_order.iterator
- info <- deps.sessions_structure.get(session_name)
- if full_sessions_selected(session_name) && presentation.enabled(info) }
- yield info).toList
+ session_name <- build_sessions.build_topological_order.iterator
+ info <- build_sessions.get(session_name)
+ if full_sessions_selected(session_name) && browser_info.enabled(info) }
+ yield session_name).toList
/* check unknown files */
@@ -246,8 +250,8 @@
if (check_unknown_files) {
val source_files =
(for {
- (_, base) <- deps.session_bases.iterator
- (path, _) <- base.sources.iterator
+ (_, base) <- build_deps.session_bases.iterator
+ (path, _) <- base.session_sources.iterator
} yield path).toList
val exclude_files = List(Path.explode("$POLYML_EXE")).map(_.canonical_file)
val unknown_files =
@@ -262,7 +266,7 @@
/* main build process */
- val queue = Queue(progress, deps.sessions_structure, store)
+ val queue = Queue(progress, build_sessions, store)
store.prepare_output_dir()
@@ -352,8 +356,8 @@
build_log =
if (process_result.timeout) build_log.error("Timeout") else build_log,
build =
- Session_Info(sources_stamp(deps, session_name), input_heaps, heap_digest,
- process_result.rc)))
+ Session_Info(sources_stamp(build_deps, session_name), input_heaps, heap_digest,
+ process_result.rc, UUID.random().toString)))
// messages
process_result.err_lines.foreach(progress.echo)
@@ -376,7 +380,7 @@
pending.dequeue(running.isDefinedAt) match {
case Some((session_name, info)) =>
val ancestor_results =
- deps.sessions_structure.build_requirements(List(session_name)).
+ build_sessions.build_requirements(List(session_name)).
filterNot(_ == session_name).map(results(_))
val ancestor_heaps = ancestor_results.flatMap(_.heap_digest)
@@ -392,7 +396,7 @@
val current =
!fresh_build &&
build.ok &&
- build.sources == sources_stamp(deps, session_name) &&
+ build.sources == sources_stamp(build_deps, session_name) &&
build.input_heaps == ancestor_heaps &&
build.output_heap == heap_digest &&
!(do_store && heap_digest.isEmpty)
@@ -423,7 +427,7 @@
val numa_node = numa_nodes.next(used_node)
val job =
- new Build_Job(progress, session_name, info, deps, store, do_store,
+ new Build_Job(progress, session_name, info, build_deps, store, do_store,
log, session_setup, numa_node, queue.command_timings(session_name))
loop(pending, running + (session_name -> (ancestor_heaps, job)), results)
}
@@ -445,7 +449,7 @@
val results = {
val results0 =
- if (deps.is_empty) {
+ if (build_deps.is_empty) {
progress.echo_warning("Nothing to build")
Map.empty[String, Result]
}
@@ -480,42 +484,9 @@
progress.echo("Unfinished session(s): " + commas(unfinished))
}
-
- /* PDF/HTML presentation */
-
- if (!no_build && !progress.stopped && results.ok) {
- if (presentation_sessions.nonEmpty) {
- val presentation_dir = presentation.dir(store)
- progress.echo("Presentation in " + presentation_dir.absolute)
- Presentation.update_root(presentation_dir)
-
- for ((chapter, infos) <- presentation_sessions.groupBy(_.chapter).iterator) {
- val entries = infos.map(info => (info.name, info.description))
- Presentation.update_chapter(presentation_dir, chapter, entries)
- }
-
- using(store.open_database_context()) { db_context =>
- val exports =
- Presentation.read_exports(presentation_sessions.map(_.name), deps, db_context)
-
- Par_List.map({ (session: String) =>
- progress.expose_interrupt()
- progress.echo("Presenting " + session + " ...")
-
- val html_context =
- new Presentation.HTML_Context {
- override def root_dir: Path = presentation_dir
- override def theory_session(name: Document.Node.Name): Sessions.Info =
- deps.sessions_structure(deps(session).theory_qualifier(name))
- override def theory_exports: Theory_Exports = exports
- }
- Presentation.session_html(
- session, deps, db_context, progress = progress,
- verbose = verbose, html_context = html_context,
- Presentation.elements1)
- }, presentation_sessions.map(_.name))
- }
- }
+ if (!no_build && !progress.stopped && results.ok && presentation_sessions.nonEmpty) {
+ Browser_Info.build(browser_info, store, build_deps, presentation_sessions,
+ progress = progress, verbose = verbose)
}
results
@@ -532,7 +503,7 @@
var base_sessions: List[String] = Nil
var select_dirs: List[Path] = Nil
var numa_shuffling = false
- var presentation = Presentation.Context.none
+ var browser_info = Browser_Info.Config.none
var requirements = false
var soft_build = false
var exclude_session_groups: List[String] = Nil
@@ -583,7 +554,7 @@
"B:" -> (arg => base_sessions = base_sessions ::: List(arg)),
"D:" -> (arg => select_dirs = select_dirs ::: List(Path.explode(arg))),
"N" -> (_ => numa_shuffling = true),
- "P:" -> (arg => presentation = Presentation.Context.make(arg)),
+ "P:" -> (arg => browser_info = Browser_Info.Config.make(arg)),
"R" -> (_ => requirements = true),
"S" -> (_ => soft_build = true),
"X:" -> (arg => exclude_session_groups = exclude_session_groups ::: List(arg)),
@@ -626,7 +597,7 @@
exclude_sessions = exclude_sessions,
session_groups = session_groups,
sessions = sessions),
- presentation = presentation,
+ browser_info = browser_info,
progress = progress,
check_unknown_files = Mercurial.is_repository(Path.ISABELLE_HOME),
build_heap = build_heap,
--- a/src/Pure/Tools/build_docker.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Tools/build_docker.scala Fri Sep 02 13:41:55 2022 +0200
@@ -57,22 +57,18 @@
# Isabelle
WORKDIR /home/isabelle
-""" +
- (if (is_remote)
- "RUN curl --fail --silent " + Bash.string(app_archive) + " > Isabelle.tar.gz"
- else "COPY Isabelle.tar.gz .") +
-"""
+""" + (if (is_remote)
+ "RUN curl --fail --silent " + Bash.string(app_archive) + " > Isabelle.tar.gz"
+ else "COPY Isabelle.tar.gz .") + """
RUN tar xzf Isabelle.tar.gz && \
mv """ + isabelle_name + """ Isabelle && \
sed -i -e 's,ISABELLE_HOME_USER=.*,ISABELLE_HOME_USER="\$USER_HOME/.isabelle",g;' Isabelle/etc/settings && \
sed -i -e 's,ISABELLE_LOGIC=.*,ISABELLE_LOGIC=""" + logic + """,g;' Isabelle/etc/settings && \
Isabelle/bin/isabelle build -o system_heaps -b """ + logic + """ && \
- rm Isabelle.tar.gz""" +
- (if (entrypoint) """
+ rm Isabelle.tar.gz""" + (if (entrypoint) """
ENTRYPOINT ["Isabelle/bin/isabelle"]
-"""
- else "")
+""" else "")
output.foreach(File.write(_, dockerfile))
--- a/src/Pure/Tools/build_job.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Tools/build_job.scala Fri Sep 02 13:41:55 2022 +0200
@@ -11,67 +11,70 @@
object Build_Job {
- /* theory markup/messages from database */
+ /* theory markup/messages from session database */
def read_theory(
- db_context: Sessions.Database_Context,
- session_hierarchy: List[String],
- theory: String,
+ theory_context: Export.Theory_Context,
unicode_symbols: Boolean = false
): Option[Command] = {
- def read(name: String): Export.Entry =
- db_context.get_export(session_hierarchy, theory, name)
+ def read(name: String): Export.Entry = theory_context(name, permissive = true)
def read_xml(name: String): XML.Body =
YXML.parse_body(
Symbol.output(unicode_symbols, UTF8.decode_permissive(read(name).uncompressed)),
- cache = db_context.cache)
-
- (read(Export.DOCUMENT_ID).text, split_lines(read(Export.FILES).text)) match {
- case (Value.Long(id), thy_file :: blobs_files) =>
- val node_name = Resources.file_node(Path.explode(thy_file), theory = theory)
-
- val results =
- Command.Results.make(
- for (elem @ XML.Elem(Markup(_, Markup.Serial(i)), _) <- read_xml(Export.MESSAGES))
- yield i -> elem)
+ cache = theory_context.cache)
- val blobs =
- blobs_files.map { file =>
- val path = Path.explode(file)
- val name = Resources.file_node(path)
- val src_path = File.relative_path(node_name.master_dir_path, path).getOrElse(path)
- Command.Blob(name, src_path, None)
- }
- val blobs_xml =
- for (i <- (1 to blobs.length).toList)
- yield read_xml(Export.MARKUP + i)
+ for {
+ id <- theory_context.document_id()
+ (thy_file, blobs_files) <- theory_context.files(permissive = true)
+ }
+ yield {
+ val master_dir =
+ Thy_Header.split_file_name(thy_file) match {
+ case Some((dir, _)) => dir
+ case None => error("Cannot determine theory master directory: " + quote(thy_file))
+ }
+ val node_name =
+ Document.Node.Name(thy_file, master_dir = master_dir, theory = theory_context.theory)
+
+ val results =
+ Command.Results.make(
+ for (elem @ XML.Elem(Markup(_, Markup.Serial(i)), _) <- read_xml(Export.MESSAGES))
+ yield i -> elem)
- val blobs_info =
- Command.Blobs_Info(
- for { (Command.Blob(name, src_path, _), xml) <- blobs zip blobs_xml }
- yield {
- val text = XML.content(xml)
- val chunk = Symbol.Text_Chunk(text)
- val digest = SHA1.digest(Symbol.encode(text))
- Exn.Res(Command.Blob(name, src_path, Some((digest, chunk))))
- })
-
- val thy_xml = read_xml(Export.MARKUP)
- val thy_source = XML.content(thy_xml)
+ val blobs =
+ blobs_files.map { file =>
+ val name = Document.Node.Name(file)
+ val path = Path.explode(file)
+ val src_path = File.relative_path(node_name.master_dir_path, path).getOrElse(path)
+ Command.Blob(name, src_path, None)
+ }
+ val blobs_xml =
+ for (i <- (1 to blobs.length).toList)
+ yield read_xml(Export.MARKUP + i)
- val markups_index =
- Command.Markup_Index.markup :: blobs.map(Command.Markup_Index.blob)
- val markups =
- Command.Markups.make(
- for ((index, xml) <- markups_index.zip(thy_xml :: blobs_xml))
- yield index -> Markup_Tree.from_XML(xml))
+ val blobs_info =
+ Command.Blobs_Info(
+ for { (Command.Blob(name, src_path, _), xml) <- blobs zip blobs_xml }
+ yield {
+ val text = XML.content(xml)
+ val chunk = Symbol.Text_Chunk(text)
+ val digest = SHA1.digest(Symbol.encode(text))
+ Exn.Res(Command.Blob(name, src_path, Some((digest, chunk))))
+ })
- val command =
- Command.unparsed(thy_source, theory = true, id = id, node_name = node_name,
- blobs_info = blobs_info, results = results, markups = markups)
- Some(command)
- case _ => None
+ val thy_xml = read_xml(Export.MARKUP)
+ val thy_source = XML.content(thy_xml)
+
+ val markups_index =
+ Command.Markup_Index.markup :: blobs.map(Command.Markup_Index.blob)
+ val markups =
+ Command.Markups.make(
+ for ((index, xml) <- markups_index.zip(thy_xml :: blobs_xml))
+ yield index -> Markup_Tree.from_XML(xml))
+
+ Command.unparsed(thy_source, theory = true, id = id, node_name = node_name,
+ blobs_info = blobs_info, results = results, markups = markups)
}
}
@@ -92,15 +95,16 @@
val store = Sessions.store(options)
val session = new Session(options, Resources.empty)
- using(store.open_database_context()) { db_context =>
+ using(Export.open_session_context0(store, session_name)) { session_context =>
val result =
- db_context.input_database(session_name) { (db, _) =>
- val theories = store.read_theories(db, session_name)
- val errors = store.read_errors(db, session_name)
- store.read_build(db, session_name).map(info => (theories, errors, info.return_code))
- }
+ for {
+ db <- session_context.session_db()
+ theories = store.read_theories(db, session_name)
+ errors = store.read_errors(db, session_name)
+ info <- store.read_build(db, session_name)
+ } yield (theories, errors, info.return_code)
result match {
- case None => error("Missing build database for session " + quote(session_name))
+ case None => store.error_database(session_name)
case Some((used_theories, errors, rc)) =>
theories.filterNot(used_theories.toSet) match {
case Nil =>
@@ -108,10 +112,11 @@
}
val print_theories =
if (theories.isEmpty) used_theories else used_theories.filter(theories.toSet)
+
for (thy <- print_theories) {
val thy_heading = "\nTheory " + quote(thy) + ":"
- read_theory(db_context, List(session_name), thy, unicode_symbols = unicode_symbols)
- match {
+
+ read_theory(session_context.theory(thy), unicode_symbols = unicode_symbols) match {
case None => progress.echo(thy_heading + " MISSING")
case Some(command) =>
val snapshot = Document.State.init.snippet(command)
@@ -315,7 +320,7 @@
private def export_(msg: Prover.Protocol_Output): Boolean =
msg.properties match {
case Protocol.Export(args) =>
- export_consumer(session_name, args, msg.chunk)
+ export_consumer.make_entry(session_name, args, msg.chunk)
true
case _ => false
}
@@ -353,8 +358,8 @@
val theory_name = snapshot.node_name.theory
val args =
Protocol.Export.Args(theory_name = theory_name, name = name, compress = compress)
- val bytes = Bytes(Symbol.encode(YXML.string_of_body(xml)))
- if (!bytes.is_empty) export_consumer(session_name, args, bytes)
+ val body = Bytes(Symbol.encode(YXML.string_of_body(xml)))
+ export_consumer.make_entry(session_name, args, body)
}
}
def export_text(name: String, text: String, compress: Boolean = true): Unit =
@@ -365,7 +370,7 @@
}
export_text(Export.FILES,
- cat_lines(snapshot.node_files.map(_.symbolic.node)), compress = false)
+ cat_lines(snapshot.node_files.map(_.path.implode_symbolic)), compress = false)
for (((_, xml), i) <- snapshot.xml_markup_blobs().zipWithIndex) {
export_(Export.MARKUP + (i + 1), xml)
@@ -442,14 +447,17 @@
val (document_output, document_errors) =
try {
if (build_errors.isInstanceOf[Exn.Res[_]] && process_result.ok && info.documents.nonEmpty) {
- using(store.open_database_context()) { db_context =>
+ using(Export.open_database_context(store)) { database_context =>
val documents =
- Document_Build.build_documents(
- Document_Build.context(session_name, deps, db_context, progress = progress),
- output_sources = info.document_output,
- output_pdf = info.document_output)
- db_context.output_database(session_name)(db =>
- documents.foreach(_.write(db, session_name)))
+ using(database_context.open_session(deps.base_info(session_name))) {
+ session_context =>
+ Document_Build.build_documents(
+ Document_Build.context(session_context, progress = progress),
+ output_sources = info.document_output,
+ output_pdf = info.document_output)
+ }
+ using(database_context.open_database(session_name, output = true))(session_database =>
+ documents.foreach(_.write(session_database.db, session_name)))
(documents.flatMap(_.log_lines), Nil)
}
}
--- a/src/Pure/Tools/debugger.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Tools/debugger.scala Fri Sep 02 13:41:55 2022 +0200
@@ -124,7 +124,7 @@
case Markup.Debugger_Output(thread_name) =>
Symbol.decode_yxml_failsafe(msg.text) match {
case List(XML.Elem(Markup(name, props @ Markup.Serial(i)), body)) =>
- val message = XML.Elem(Markup(Markup.message(name), props), body)
+ val message = Protocol.make_message(body, kind = name, props = props)
debugger.add_output(thread_name, i -> session.cache.elem(message))
true
case _ => false
--- a/src/Pure/Tools/generated_files.ML Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Tools/generated_files.ML Fri Sep 02 13:41:55 2022 +0200
@@ -33,6 +33,14 @@
val export_generated_files: Proof.context -> (Path.binding list * theory) list -> unit
val export_generated_files_cmd: Proof.context ->
((string * Position.T) list * (string * Position.T) option) list -> unit
+ val check_external_files: Proof.context ->
+ Input.source list * Input.source -> Path.T list * Path.T
+ val get_external_files: Path.T -> Path.T list * Path.T -> unit
+ val scala_build_generated_files: Proof.context -> (Path.binding list * theory) list ->
+ (Path.T list * Path.T) list -> unit
+ val scala_build_generated_files_cmd: Proof.context ->
+ ((string * Position.T) list * (string * Position.T) option) list ->
+ (Input.source list * Input.source) list -> unit
val with_compile_dir: (Path.T -> unit) -> unit
val compile_generated_files: Proof.context ->
(Path.binding list * theory) list ->
@@ -272,6 +280,45 @@
export_generated_files ctxt (map (check_files_in ctxt) args);
+(* external files *)
+
+fun check_external_files ctxt (raw_files, raw_base_dir) =
+ let
+ val base_dir = Resources.check_dir ctxt NONE raw_base_dir;
+ fun check source =
+ (Resources.check_file ctxt (SOME base_dir) source;
+ Path.explode (Input.string_of source));
+ val files = map check raw_files;
+ in (files, base_dir) end;
+
+fun get_external_files dir (files, base_dir) =
+ files |> List.app (fn file => Isabelle_System.copy_file_base (base_dir, file) dir);
+
+
+(* scala_build_generated_files *)
+
+fun scala_build_generated_files ctxt args external =
+ Isabelle_System.with_tmp_dir "scala_build" (fn dir =>
+ let
+ val files = maps get_files_in args;
+ val _ = List.app (fn (file, pos) => report_file ctxt pos file) files;
+ val _ = List.app (write_file dir o #1) files;
+ val _ = List.app (get_external_files dir) external;
+ val [jar_name, jar_bytes, output] =
+ \<^scala>\<open>scala_build\<close> [Bytes.string (Isabelle_System.absolute_path dir)];
+ val _ = writeln (Bytes.content output);
+ in
+ Export.export (Proof_Context.theory_of ctxt)
+ (Path.explode_binding0 (Bytes.content jar_name))
+ (Bytes.contents_blob jar_bytes)
+ end);
+
+fun scala_build_generated_files_cmd ctxt args external =
+ scala_build_generated_files ctxt
+ (map (check_files_in ctxt) args)
+ (map (check_external_files ctxt) external)
+
+
(* compile_generated_files *)
val compile_dir = Config.declare_string ("compile_dir", \<^here>) (K "");
@@ -287,9 +334,7 @@
val files = maps get_files_in args;
val _ = List.app (fn (file, pos) => report_file ctxt pos file) files;
val _ = List.app (write_file dir o #1) files;
- val _ =
- external |> List.app (fn (files, base_dir) =>
- files |> List.app (fn file => Isabelle_System.copy_file_base (base_dir, file) dir));
+ val _ = List.app (get_external_files dir) external;
val _ =
ML_Context.eval_in (SOME (Config.put compile_dir (Path.implode dir) ctxt))
ML_Compiler.flags (Input.pos_of source)
@@ -320,14 +365,7 @@
fun compile_generated_files_cmd ctxt args external export export_prefix source =
compile_generated_files ctxt
(map (check_files_in ctxt) args)
- (external |> map (fn (raw_files, raw_base_dir) =>
- let
- val base_dir = Resources.check_dir ctxt NONE raw_base_dir;
- fun check source =
- (Resources.check_file ctxt (SOME base_dir) source;
- Path.explode (Input.string_of source));
- val files = map check raw_files;
- in (files, base_dir) end))
+ (map (check_external_files ctxt) external)
((map o apfst o map) Path.explode_binding export)
(Path.explode_binding export_prefix)
source;
@@ -352,7 +390,19 @@
(file_type \<^binding>\<open>Haskell\<close>
{ext = "hs",
make_comment = enclose "{-" "-}",
- make_string = GHC.print_string});
+ make_string = GHC.print_string} #>
+ file_type \<^binding>\<open>Java\<close>
+ {ext = "java",
+ make_comment = enclose "/*" "*/",
+ make_string = Java.print_string} #>
+ file_type \<^binding>\<open>Scala\<close>
+ {ext = "scala",
+ make_comment = enclose "/*" "*/",
+ make_string = Java.print_string} #>
+ file_type \<^binding>\<open>Properties\<close>
+ {ext = "props",
+ make_comment = enclose "#" "",
+ make_string = I});
--- a/src/Pure/Tools/phabricator.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Tools/phabricator.scala Fri Sep 02 13:41:55 2022 +0200
@@ -564,7 +564,7 @@
/** setup mail **/
val mailers_template: String =
-"""[
+ """[
{
"key": "example.org",
"type": "smtp",
--- a/src/Pure/Tools/profiling_report.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Tools/profiling_report.scala Fri Sep 02 13:41:55 2022 +0200
@@ -17,11 +17,9 @@
): Unit = {
val store = Sessions.store(options)
- using(store.open_database_context()) { db_context =>
- val result =
- db_context.input_database(session)((db, name) => Some(store.read_theories(db, name)))
- result match {
- case None => error("Missing build database for session " + quote(session))
+ using(Export.open_session_context0(store, session)) { session_context =>
+ session_context.session_db().map(db => store.read_theories(db, session)) match {
+ case None => store.error_database(session)
case Some(used_theories) =>
theories.filterNot(used_theories.toSet) match {
case Nil =>
@@ -31,7 +29,7 @@
(for {
thy <- used_theories.iterator
if theories.isEmpty || theories.contains(thy)
- command <- Build_Job.read_theory(db_context, List(session), thy).iterator
+ command <- Build_Job.read_theory(session_context.theory(thy)).iterator
snapshot = Document.State.init.snippet(command)
(Protocol.ML_Profiling(report), _) <- snapshot.messages.iterator
} yield if (clean_name) report.clean_name else report).toList
--- a/src/Pure/Tools/scala_build.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Tools/scala_build.scala Fri Sep 02 13:41:55 2022 +0200
@@ -1,7 +1,7 @@
/* Title: Pure/Tools/scala_build.scala
Author: Makarius
-Manage and build Isabelle/Scala/Java components.
+Manage and build Isabelle/Scala/Java modules.
*/
package isabelle
@@ -10,6 +10,7 @@
import java.util.{Properties => JProperties}
import java.io.{ByteArrayOutputStream, PrintStream}
import java.nio.file.Files
+import java.nio.file.{Path => JPath}
import scala.jdk.CollectionConverters._
@@ -39,19 +40,22 @@
p <- java_context.requirement_paths(s).asScala.iterator
} yield (File.path(p.toFile))).toList
- def build(fresh: Boolean = false): String = {
+ def build(
+ classpath: List[Path] = Path.split(Isabelle_System.getenv("ISABELLE_CLASSPATH")),
+ fresh: Boolean = false
+ ): String = {
+ val java_classpath = new java.util.LinkedList[JPath]
+ classpath.foreach(path => java_classpath.add(path.java_path))
+
val output0 = new ByteArrayOutputStream
val output = new PrintStream(output0)
def get_output(): String = {
output.flush()
Library.trim_line(output0.toString(UTF8.charset))
}
+
try {
- Console.withOut(output) {
- Console.withErr(output) {
- isabelle.setup.Build.build(output, java_context, fresh)
- }
- }
+ isabelle.setup.Build.build(java_classpath, output, java_context, fresh)
get_output()
}
catch { case ERROR(msg) => cat_error(get_output(), msg) }
@@ -78,17 +82,6 @@
new Context(new isabelle.setup.Build.Context(dir.java_path, props, props_path.implode))
}
- def build(dir: Path,
- fresh: Boolean = false,
- component: Boolean = false,
- no_title: Boolean = false,
- do_build: Boolean = false,
- module: Option[Path] = None
- ): String = {
- context(dir, component = component, no_title = no_title, do_build = do_build, module = module)
- .build(fresh = fresh)
- }
-
sealed case class Result(output: String, jar_bytes: Bytes, jar_path: Option[Path]) {
def write(): Unit = {
if (jar_path.isDefined) {
@@ -101,13 +94,30 @@
def build_result(dir: Path, component: Boolean = false): Result = {
Isabelle_System.with_tmp_file("result", "jar") { tmp_file =>
val output =
- build(dir, component = component, no_title = true, do_build = true, module = Some(tmp_file))
+ context(dir, component = component, no_title = true, do_build = true,
+ module = Some(tmp_file)).build(classpath = Classpath().jars.map(File.path))
val jar_bytes = Bytes.read(tmp_file)
val jar_path = context(dir, component = component).module_result
Result(output, jar_bytes, jar_path)
}
}
+ object Scala_Fun extends Scala.Fun("scala_build") with Scala.Bytes_Fun {
+ val here = Scala_Project.here
+ def invoke(args: List[Bytes]): List[Bytes] =
+ args match {
+ case List(dir) =>
+ val result = build_result(Path.explode(dir.text))
+ val jar_name =
+ result.jar_path match {
+ case Some(path) => path.file_name
+ case None => "scala_build.jar"
+ }
+ List(Bytes("classpath/" + jar_name), result.jar_bytes, Bytes(result.output))
+ case _ => error("Bad arguments")
+ }
+ }
+
def component_contexts(): List[Context] =
isabelle.setup.Build.component_contexts().asScala.toList.map(new Context(_))
}
--- a/src/Pure/Tools/scala_project.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Tools/scala_project.scala Fri Sep 02 13:41:55 2022 +0200
@@ -12,7 +12,7 @@
/** build tools **/
val java_version: String = "17"
- val scala_version: String = "2.13.5"
+ val scala_version: String = "3.1.3"
abstract class Build_Tool {
def project_root: Path
@@ -66,7 +66,7 @@
}
dependencies {
- implementation 'org.scala-lang:scala-library:""" + scala_version + """'
+ implementation 'org.scala-lang:scala3-library_3:scala-library:""" + scala_version + """'
compileOnly files(
""" + jars.map(jar => groovy_string(File.platform_path(jar))).mkString("", ",\n ", ")") +
"""
@@ -87,7 +87,7 @@
def dependency(jar: Path): String = {
val name = jar.expand.drop_ext.base.implode
val system_path = File.platform_path(jar.absolute)
- """ <dependency>
+ """ <dependency>
<groupId>classpath</groupId>
<artifactId>""" + XML.text(name) + """</artifactId>
<version>0</version>
@@ -162,20 +162,19 @@
(jars, sources)
}
- lazy val isabelle_scala_files: Map[String, Path] = {
- val context = Scala_Build.context(Path.ISABELLE_HOME, component = true)
- context.sources.iterator.foldLeft(Map.empty[String, Path]) {
- case (map, path) =>
- if (path.is_scala) {
- val base = path.base.implode
- map.get(base) match {
- case None => map + (base -> path)
- case Some(path2) => error("Conflicting base names: " + path + " vs. " + path2)
+ lazy val isabelle_scala_files: Map[String, Path] =
+ Scala_Build.context(Path.ISABELLE_HOME, component = true)
+ .sources.iterator.foldLeft(Map.empty[String, Path]) {
+ case (map, path) =>
+ if (path.is_scala) {
+ val base = path.base.implode
+ map.get(base) match {
+ case None => map + (base -> path)
+ case Some(path2) => error("Conflicting base names: " + path + " vs. " + path2)
+ }
}
- }
- else map
- }
- }
+ else map
+ }
/* compile-time position */
--- a/src/Pure/Tools/server_commands.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Tools/server_commands.scala Fri Sep 02 13:41:55 2022 +0200
@@ -68,7 +68,7 @@
val base_info =
Sessions.base_info(options, args.session, progress = progress, dirs = dirs,
- include_sessions = args.include_sessions).check
+ include_sessions = args.include_sessions).check_errors
val results =
Build.build(options,
@@ -263,8 +263,8 @@
} yield output_message(tree, pos))) +
("exports" ->
(if (args.export_pattern == "") Nil else {
- val matcher = Export.make_matcher(args.export_pattern)
- for { entry <- snapshot.exports if matcher(entry.theory_name, entry.name) }
+ val matcher = Export.make_matcher(List(args.export_pattern))
+ for { entry <- snapshot.exports if matcher(entry.entry_name) }
yield {
val (base64, body) = entry.uncompressed.maybe_encode_base64
JSON.Object("name" -> entry.name, "base64" -> base64, "body" -> body)
--- a/src/Pure/Tools/sync.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Tools/sync.scala Fri Sep 02 13:41:55 2022 +0200
@@ -59,7 +59,7 @@
context.progress.echo_if(verbose, "\n* Isabelle repository:")
val filter_heaps = if (purge_heaps) Nil else List("protect /heaps", "protect /heaps/**")
sync(hg, target, rev,
- contents = List(File.Content(Path.explode("etc/ISABELLE_ID"), hg.id(rev = rev))),
+ contents = List(File.content(Path.explode("etc/ISABELLE_ID"), hg.id(rev = rev))),
filter = filter_heaps ::: List("protect /AFP"))
for (hg <- afp_hg) {
--- a/src/Pure/Tools/update_cartouches.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Tools/update_cartouches.scala Fri Sep 02 13:41:55 2022 +0200
@@ -97,7 +97,7 @@
for {
spec <- specs
file <- File.find_files(Path.explode(spec).file,
- file => file.getName.endsWith(".thy") || file.getName == "ROOT")
+ file => File.is_thy(file.getName) || file.getName == "ROOT")
} update_cartouches(replace_text, File.path(file))
})
}
--- a/src/Pure/Tools/update_comments.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Tools/update_comments.scala Fri Sep 02 13:41:55 2022 +0200
@@ -60,7 +60,7 @@
for {
spec <- specs
- file <- File.find_files(Path.explode(spec).file, file => file.getName.endsWith(".thy"))
+ file <- File.find_files(Path.explode(spec).file, file => File.is_thy(file.getName))
} update_comments(File.path(file))
})
}
--- a/src/Pure/Tools/update_header.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Tools/update_header.scala Fri Sep 02 13:41:55 2022 +0200
@@ -54,7 +54,7 @@
for {
spec <- specs
- file <- File.find_files(Path.explode(spec).file, file => file.getName.endsWith(".thy"))
+ file <- File.find_files(Path.explode(spec).file, file => File.is_thy(file.getName))
} update_header(section, File.path(file))
})
}
--- a/src/Pure/Tools/update_then.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Tools/update_then.scala Fri Sep 02 13:41:55 2022 +0200
@@ -48,7 +48,7 @@
for {
spec <- specs
- file <- File.find_files(Path.explode(spec).file, file => file.getName.endsWith(".thy"))
+ file <- File.find_files(Path.explode(spec).file, file => File.is_thy(file.getName))
} update_then(File.path(file))
})
}
--- a/src/Pure/Tools/update_theorems.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/Tools/update_theorems.scala Fri Sep 02 13:41:55 2022 +0200
@@ -50,7 +50,7 @@
for {
spec <- specs
- file <- File.find_files(Path.explode(spec).file, file => file.getName.endsWith(".thy"))
+ file <- File.find_files(Path.explode(spec).file, file => File.is_thy(file.getName))
} update_theorems(File.path(file))
})
}
--- a/src/Pure/library.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Pure/library.scala Fri Sep 02 13:41:55 2022 +0200
@@ -70,11 +70,10 @@
private def next_chunk(i: Int): Option[(CharSequence, Int)] = {
if (i < end) {
var j = i
- var cont = true
- while (cont) {
+ while ({
j += 1
- cont = (j < end && !sep(source.charAt(j)))
- }
+ j < end && !sep(source.charAt(j))
+ }) ()
Some((source.subSequence(i + 1, j), j))
}
else None
@@ -95,8 +94,10 @@
/* lines */
- def terminate_lines(lines: IterableOnce[String]): String =
- lines.iterator.mkString("", "\n", "\n")
+ def terminate_lines(lines: IterableOnce[String]): String = {
+ val it = lines.iterator
+ if (it.isEmpty) "" else it.mkString("", "\n", "\n")
+ }
def cat_lines(lines: IterableOnce[String]): String =
lines.iterator.mkString("\n")
--- a/src/Sequents/ROOT Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Sequents/ROOT Fri Sep 02 13:41:55 2022 +0200
@@ -1,4 +1,4 @@
-chapter Sequents
+chapter Misc
session Sequents = Pure +
description "
--- a/src/Tools/Graphview/graph_file.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/Graphview/graph_file.scala Fri Sep 02 13:41:55 2022 +0200
@@ -27,8 +27,8 @@
}
val name = file.getName
- if (name.endsWith(".png")) Graphics_File.write_png(file, paint, w, h)
- else if (name.endsWith(".pdf")) Graphics_File.write_pdf(file, paint, w, h)
+ if (File.is_png(name)) Graphics_File.write_png(file, paint, w, h)
+ else if (File.is_pdf(name)) Graphics_File.write_pdf(file, paint, w, h)
else error("Bad type of file: " + quote(name) + " (.png or .pdf expected)")
}
--- a/src/Tools/Graphview/graph_panel.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/Graphview/graph_panel.scala Fri Sep 02 13:41:55 2022 +0200
@@ -298,7 +298,7 @@
tooltip = "Save current graph layout as PNG or PDF"
}
- private val zoom = new GUI.Zoom_Box { def changed = rescale(0.01 * factor) }
+ private val zoom = new GUI.Zoom { override def changed(): Unit = rescale(0.01 * factor) }
private val fit_window = new Button {
action = Action("Fit to window") { fit_to_window() }
--- a/src/Tools/Graphview/tree_panel.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/Graphview/tree_panel.scala Fri Sep 02 13:41:55 2022 +0200
@@ -16,7 +16,7 @@
import javax.swing.event.{TreeSelectionEvent, TreeSelectionListener, DocumentListener, DocumentEvent}
import scala.util.matching.Regex
-import scala.swing.{Component, ScrollPane, BorderPanel, Label, TextField, Button, CheckBox, Action}
+import scala.swing.{Component, ScrollPane, BorderPanel, Label, TextField, Button, Action}
class Tree_Panel(val graphview: Graphview, graph_panel: Graph_Panel)
@@ -73,7 +73,7 @@
tree.addKeyListener(new KeyAdapter {
override def keyPressed(e: KeyEvent): Unit =
if (e.getKeyCode == KeyEvent.VK_ENTER) {
- e.consume
+ e.consume()
selection_action()
}
})
--- a/src/Tools/ROOT Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/ROOT Fri Sep 02 13:41:55 2022 +0200
@@ -1,4 +1,4 @@
-chapter Tools
+chapter Misc
session Tools = Pure +
theories
--- a/src/Tools/Setup/src/Build.java Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/Setup/src/Build.java Fri Sep 02 13:41:55 2022 +0200
@@ -38,7 +38,10 @@
import javax.tools.StandardJavaFileManager;
import javax.tools.ToolProvider;
-import scala.tools.nsc.MainClass;
+import dotty.tools.dotc.Driver;
+import dotty.tools.dotc.interfaces.Diagnostic;
+import dotty.tools.dotc.interfaces.ReporterResult;
+import dotty.tools.dotc.interfaces.SimpleReporter;
public class Build
@@ -245,7 +248,7 @@
}
public static void compile_scala_sources(
- PrintStream output, // ignored, but see scala.Console.withOut/withErr
+ PrintStream output,
Path target_dir,
String more_options,
List<Path> deps,
@@ -266,8 +269,16 @@
if (p.toString().endsWith(".scala")) { scala_sources = true; }
}
if (scala_sources) {
- boolean ok = new MainClass().process(args.toArray(String[]::new));
- if (!ok) { throw new RuntimeException("Failed to compile Scala sources"); }
+ String[] args_array = args.toArray(String[]::new);
+ SimpleReporter reporter = new SimpleReporter() {
+ @Override
+ public void report(Diagnostic diagnostic) {
+ output.println(diagnostic.message());
+ }
+ };
+ new Driver().process(args_array, reporter, null);
+ ReporterResult result = new Driver().process(args_array);
+ if (result.hasErrors()) { throw new RuntimeException("Failed to compile Scala sources"); }
}
}
@@ -439,7 +450,7 @@
/** build **/
- public static void build(PrintStream output, Context context, boolean fresh)
+ public static void build(List<Path> classpath, PrintStream output, Context context, boolean fresh)
throws NoSuchAlgorithmException, IOException, InterruptedException
{
String module = context.module_result();
@@ -481,17 +492,11 @@
output.print("### Building " + title + " (" + jar_path + ") ...\n");
}
- String isabelle_classpath = Environment.getenv("ISABELLE_CLASSPATH");
-
Path build_dir = Files.createTempDirectory("isabelle");
try {
/* compile sources */
- for (String s : isabelle_classpath.split(":", -1)) {
- if (!s.isEmpty()) {
- compiler_deps.add(Path.of(Environment.platform_path(s)));
- }
- }
+ compiler_deps.addAll(classpath);
List<Path> compiler_sources = new LinkedList<Path>();
for (String s : sources) { compiler_sources.add(context.path(s)); }
@@ -551,8 +556,15 @@
public static void build_components(PrintStream output, boolean fresh)
throws NoSuchAlgorithmException, IOException, InterruptedException
{
+ List<Path> classpath = new LinkedList<Path>();
+ for (String s : Environment.getenv("ISABELLE_CLASSPATH").split(":", -1)) {
+ if (!s.isEmpty()) {
+ classpath.add(Path.of(Environment.platform_path(s)));
+ }
+ }
+
for (Context context : component_contexts()) {
- build(output, context, fresh);
+ build(classpath, output, context, fresh);
}
}
}
--- a/src/Tools/VSCode/etc/settings Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/VSCode/etc/settings Fri Sep 02 13:41:55 2022 +0200
@@ -1,5 +1,5 @@
# -*- shell-script -*- :mode=shellscript:
-ISABELLE_VSCODE_VERSION="1.65.2"
+ISABELLE_VSCODE_VERSION="1.70.1"
ISABELLE_VSCODE_HOME="$ISABELLE_HOME/src/Tools/VSCode"
ISABELLE_VSCODE_SETTINGS="$ISABELLE_HOME_USER/vscode"
--- a/src/Tools/VSCode/extension/package.json Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/VSCode/extension/package.json Fri Sep 02 13:41:55 2022 +0200
@@ -17,7 +17,7 @@
"url": "https://isabelle-dev.sketis.net"
},
"engines": {
- "vscode": "1.65.2"
+ "vscode": "1.70.1"
},
"categories": [
"Programming Languages"
--- a/src/Tools/VSCode/src/build_vscode_extension.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/VSCode/src/build_vscode_extension.scala Fri Sep 02 13:41:55 2022 +0200
@@ -21,7 +21,7 @@
progress: Progress = new Progress
): Unit = {
val keywords =
- Sessions.base_info(options, logic, dirs = dirs).check.base.overall_syntax.keywords
+ Sessions.base_info(options, logic, dirs = dirs).check_errors.base.overall_syntax.keywords
val output_path = build_dir + Path.explode("isabelle-grammar.json")
progress.echo(output_path.expand.implode)
--- a/src/Tools/VSCode/src/build_vscodium.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/VSCode/src/build_vscodium.scala Fri Sep 02 13:41:55 2022 +0200
@@ -29,7 +29,7 @@
def make_symbols(): File.Content = {
val symbols = Symbol.Symbols.load(static = true)
val symbols_js =
- JSON.Format.apply_lines(
+ JSON.Format.pretty_print(
for (entry <- symbols.entries) yield
JSON.Object(
"symbol" -> entry.symbol,
@@ -37,13 +37,13 @@
"abbrevs" -> entry.abbrevs) ++
JSON.optional("code", entry.code))
- File.Content(Path.explode("symbols.json"), symbols_js)
+ File.content(Path.explode("symbols.json"), symbols_js)
}
def make_isabelle_encoding(header: String): File.Content = {
val symbols = Symbol.Symbols.load(static = true)
val symbols_js =
- JSON.Format.apply_lines(
+ JSON.Format.pretty_print(
for (entry <- symbols.entries; code <- entry.code)
yield JSON.Object("symbol" -> entry.symbol, "code" -> code))
@@ -51,7 +51,7 @@
val body =
File.read(Path.explode("$ISABELLE_VSCODE_HOME/patches") + path)
.replace("[/*symbols*/]", symbols_js)
- File.Content(path, header + "\n" + body)
+ File.content(path, header + "\n" + body)
}
@@ -66,7 +66,7 @@
def is_linux: Boolean = platform == Platform.Family.linux
def download_name: String = "VSCodium-" + download_template.replace("{VERSION}", version)
- def download_zip: Boolean = download_name.endsWith(".zip")
+ def download_zip: Boolean = File.is_zip(download_name)
def download(dir: Path, progress: Progress = new Progress): Unit = {
if (download_zip) Isabelle_System.require_command("unzip", test = "-h")
@@ -222,7 +222,7 @@
val files =
File.find_files(dir.file, pred = { file =>
val name = file.getName
- name.endsWith(".dll") || name.endsWith(".exe") || name.endsWith(".node")
+ File.is_dll(name) || File.is_exe(name) || File.is_node(name)
})
files.foreach(file => File.set_executable(File.path(file), true))
Isabelle_System.bash("chmod -R o-w " + File.bash_path(dir)).check
--- a/src/Tools/VSCode/src/dynamic_output.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/VSCode/src/dynamic_output.scala Fri Sep 02 13:41:55 2022 +0200
@@ -27,26 +27,27 @@
case None => copy(output = Nil)
case Some(command) =>
copy(output =
- if (restriction.isEmpty || restriction.get.contains(command))
- Rendering.output_messages(snapshot.command_results(command))
- else output)
+ if (restriction.isEmpty || restriction.get.contains(command)) {
+ val output_state = resources.options.bool("editor_output_state")
+ Rendering.output_messages(snapshot.command_results(command), output_state)
+ } else output)
}
}
else this
}
if (st1.output != output) {
- val context =
- new Presentation.Entity_Context {
+ val node_context =
+ new Browser_Info.Node_Context {
override def make_ref(props: Properties.T, body: XML.Body): Option[XML.Elem] =
for {
thy_file <- Position.Def_File.unapply(props)
def_line <- Position.Def_Line.unapply(props)
source <- resources.source_file(thy_file)
- uri = Path.explode(source).absolute_file.toURI
+ uri = File.uri(Path.explode(source).absolute_file)
} yield HTML.link(uri.toString + "#" + def_line, body)
}
- val elements = Presentation.elements2.copy(entity = Markup.Elements.full)
- val html = Presentation.make_html(context, elements, Pretty.separate(st1.output))
+ val elements = Browser_Info.extra_elements.copy(entity = Markup.Elements.full)
+ val html = node_context.make_html(elements, Pretty.separate(st1.output))
channel.write(LSP.Dynamic_Output(HTML.source(html).toString))
}
st1
--- a/src/Tools/VSCode/src/language_server.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/VSCode/src/language_server.scala Fri Sep 02 13:41:55 2022 +0200
@@ -84,7 +84,7 @@
// prevent spurious garbage on the main protocol channel
val orig_out = System.out
try {
- System.setOut(new PrintStream(new OutputStream { def write(n: Int): Unit = {} }))
+ System.setOut(new PrintStream(OutputStream.nullOutputStream()))
server.start()
}
finally { System.setOut(orig_out) }
@@ -263,15 +263,15 @@
Sessions.base_info(
options, session_name, dirs = session_dirs,
include_sessions = include_sessions, session_ancestor = session_ancestor,
- session_requirements = session_requirements).check
+ session_requirements = session_requirements).check_errors
def build(no_build: Boolean = false): Build.Results =
Build.build(options,
- selection = Sessions.Selection.session(base_info.session), build_heap = true,
- no_build = no_build, dirs = session_dirs, infos = base_info.infos)
+ selection = Sessions.Selection.session(base_info.session_name),
+ build_heap = true, no_build = no_build, dirs = session_dirs, infos = base_info.infos)
if (!session_no_build && !build(no_build = true).ok) {
- val start_msg = "Build started for Isabelle/" + base_info.session + " ..."
+ val start_msg = "Build started for Isabelle/" + base_info.session_name + " ..."
val fail_msg = "Session build failed -- prover process remains inactive!"
val progress = channel.progress(verbose = true)
@@ -304,8 +304,8 @@
try {
Isabelle_Process.start(session, options, base_info.sessions_structure,
- Sessions.store(options), modes = modes, logic = base_info.session).await_startup()
- reply_ok("Welcome to Isabelle/" + base_info.session + Isabelle_System.isabelle_heading())
+ Sessions.store(options), modes = modes, logic = base_info.session_name).await_startup()
+ reply_ok("Welcome to Isabelle/" + base_info.session_name + Isabelle_System.isabelle_heading())
}
catch { case ERROR(msg) => reply_error(msg) }
}
--- a/src/Tools/VSCode/src/preview_panel.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/VSCode/src/preview_panel.scala Fri Sep 02 13:41:55 2022 +0200
@@ -28,14 +28,10 @@
val snapshot = model.snapshot()
if (snapshot.is_outdated) m
else {
- val html_context =
- new Presentation.HTML_Context {
- override def root_dir: Path = Path.current
- override def theory_session(name: Document.Node.Name): Sessions.Info =
- resources.sessions_structure(resources.session_base.theory_qualifier(name))
- }
- val document =
- Presentation.html_document(snapshot, html_context, Presentation.elements2)
+ val context =
+ Browser_Info.context(resources.sessions_structure,
+ elements = Browser_Info.extra_elements)
+ val document = context.preview_document(snapshot)
channel.write(LSP.Preview_Response(file, column, document.title, document.content))
m - file
}
--- a/src/Tools/VSCode/src/state_panel.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/VSCode/src/state_panel.scala Fri Sep 02 13:41:55 2022 +0200
@@ -59,18 +59,18 @@
new Query_Operation(server.editor, (), "print_state", _ => (),
(_, _, body) =>
if (output_active.value && body.nonEmpty){
- val context =
- new Presentation.Entity_Context {
+ val node_context =
+ new Browser_Info.Node_Context {
override def make_ref(props: Properties.T, body: XML.Body): Option[XML.Elem] =
for {
thy_file <- Position.Def_File.unapply(props)
def_line <- Position.Def_Line.unapply(props)
source <- server.resources.source_file(thy_file)
- uri = Path.explode(source).absolute_file.toURI
+ uri = File.uri(Path.explode(source).absolute_file)
} yield HTML.link(uri.toString + "#" + def_line, body)
}
- val elements = Presentation.elements2.copy(entity = Markup.Elements.full)
- val html = Presentation.make_html(context, elements, Pretty.separate(body))
+ val elements = Browser_Info.extra_elements.copy(entity = Markup.Elements.full)
+ val html = node_context.make_html(elements, Pretty.separate(body))
output(HTML.source(html).toString)
})
--- a/src/Tools/VSCode/src/vscode_rendering.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/VSCode/src/vscode_rendering.scala Fri Sep 02 13:41:55 2022 +0200
@@ -89,7 +89,7 @@
def completion(node_pos: Line.Node_Position, caret: Text.Offset): List[LSP.CompletionItem] = {
val doc = model.content.doc
val line = node_pos.pos.line
- val unicode = node_pos.name.endsWith(".thy")
+ val unicode = File.is_thy(node_pos.name)
doc.offset(Line.Position(line)) match {
case None => Nil
case Some(line_start) =>
--- a/src/Tools/VSCode/src/vscode_resources.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/VSCode/src/vscode_resources.scala Fri Sep 02 13:41:55 2022 +0200
@@ -71,7 +71,11 @@
val options: Options,
session_base_info: Sessions.Base_Info,
log: Logger = No_Logger)
-extends Resources(session_base_info.sessions_structure, session_base_info.check.base, log = log) {
+extends Resources(
+ session_base_info.sessions_structure,
+ session_base_info.check_errors.base,
+ log = log
+) {
resources =>
private val state = Synchronized(VSCode_Resources.State())
--- a/src/Tools/jEdit/jedit_main/dockables.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/jedit_main/dockables.scala Fri Sep 02 13:41:55 2022 +0200
@@ -13,6 +13,9 @@
class Debugger_Dockable(view: View, position: String)
extends isabelle.jedit.Debugger_Dockable(view, position)
+class Document_Dockable(view: View, position: String)
+ extends isabelle.jedit.Document_Dockable(view, position)
+
class Documentation_Dockable(view: View, position: String)
extends isabelle.jedit.Documentation_Dockable(view, position)
--- a/src/Tools/jEdit/jedit_main/dockables.xml Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/jedit_main/dockables.xml Fri Sep 02 13:41:55 2022 +0200
@@ -5,6 +5,9 @@
<DOCKABLE NAME="isabelle-debugger" MOVABLE="TRUE">
new isabelle.jedit_main.Debugger_Dockable(view, position);
</DOCKABLE>
+ <DOCKABLE NAME="isabelle-document" MOVABLE="TRUE">
+ new isabelle.jedit_main.Document_Dockable(view, position);
+ </DOCKABLE>
<DOCKABLE NAME="isabelle-documentation" MOVABLE="TRUE">
new isabelle.jedit_main.Documentation_Dockable(view, position);
</DOCKABLE>
--- a/src/Tools/jEdit/jedit_main/plugin.props Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/jedit_main/plugin.props Fri Sep 02 13:41:55 2022 +0200
@@ -37,6 +37,7 @@
isabelle.java-monitor \
- \
isabelle-debugger \
+ isabelle-document \
isabelle-documentation \
isabelle-monitor \
isabelle-output \
@@ -52,6 +53,8 @@
isabelle-timing
isabelle-debugger.label=Debugger panel
isabelle-debugger.title=Debugger
+isabelle-document.label=Document panel
+isabelle-document.title=Document
isabelle-documentation.label=Documentation panel
isabelle-documentation.title=Documentation
isabelle-graphview.label=Graphview panel
--- a/src/Tools/jEdit/jedit_main/scala_console.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/jedit_main/scala_console.scala Fri Sep 02 13:41:55 2022 +0200
@@ -12,7 +12,7 @@
import console.{Console, ConsolePane, Shell, Output}
import org.gjt.sp.jedit.JARClassLoader
-import java.io.{OutputStream, Writer, PrintWriter}
+import java.io.OutputStream
object Scala_Console {
@@ -67,17 +67,6 @@
}
}
- private val console_writer = new Writer {
- def flush(): Unit = console_stream.flush()
- def close(): Unit = console_stream.flush()
-
- def write(cbuf: Array[Char], off: Int, len: Int): Unit = {
- if (len > 0) {
- UTF8.bytes(new String(cbuf.slice(off, off + len))).foreach(console_stream.write(_))
- }
- }
- }
-
private def with_console[A](console: Console, out: Output, err: Output)(e: => A): A = {
global_console = console
global_out = out
@@ -95,24 +84,18 @@
}
}
- private def report_error(str: String): Unit = {
- if (global_console == null || global_err == null) isabelle.Output.writeln(str)
- else GUI_Thread.later { global_err.print(global_console.getErrorColor, str) }
- }
-
/* jEdit console methods */
override def openConsole(console: Console): Unit = {
val context =
Scala.Compiler.context(
- print_writer = new PrintWriter(console_writer, true),
- error = report_error,
- jar_dirs = JEdit_Lib.directories,
+ jar_files = JEdit_Lib.directories,
class_loader = Some(new JARClassLoader))
val interpreter = new Scala_Console.Interpreter(context, console)
- interpreter.execute(_.interp.interpret(Scala_Console.init))
+ interpreter.execute((context, state) =>
+ context.compile(Scala_Console.init, state = state).state)
}
override def closeConsole(console: Console): Unit =
@@ -141,12 +124,18 @@
command: String
): Unit = {
Scala_Console.console_interpreter(console).foreach(interpreter =>
- interpreter.execute { context =>
- with_console(console, out, err) { context.interp.interpret(command) }
+ interpreter.execute { (context, state) =>
+ val result = with_console(console, out, err) { context.compile(command, state) }
GUI_Thread.later {
+ val diag = if (err == null) out else err
+ for (message <- result.messages) {
+ val color = if (message.is_error) console.getErrorColor else null
+ diag.print(color, message.text + "\n")
+ }
Option(err).foreach(_.commandDone())
out.commandDone()
}
+ result.state
})
}
--- a/src/Tools/jEdit/src/completion_popup.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/completion_popup.scala Fri Sep 02 13:41:55 2022 +0200
@@ -517,12 +517,12 @@
case KeyEvent.KEY_PRESSED =>
val key_code = evt.getKeyCode
if (key_code == KeyEvent.VK_ESCAPE) {
- if (dismissed()) evt.consume
+ if (dismissed()) evt.consume()
}
case KeyEvent.KEY_TYPED =>
super.processKeyEvent(evt)
process(evt)
- evt.consume
+ evt.consume()
case _ =>
}
if (!evt.isConsumed) super.processKeyEvent(evt)
@@ -598,26 +598,26 @@
if (!e.isConsumed) {
e.getKeyCode match {
case KeyEvent.VK_ENTER if PIDE.options.bool("jedit_completion_select_enter") =>
- if (complete_selected()) e.consume
+ if (complete_selected()) e.consume()
hide_popup()
case KeyEvent.VK_TAB if PIDE.options.bool("jedit_completion_select_tab") =>
- if (complete_selected()) e.consume
+ if (complete_selected()) e.consume()
hide_popup()
case KeyEvent.VK_ESCAPE =>
hide_popup()
- e.consume
+ e.consume()
case KeyEvent.VK_UP | KeyEvent.VK_KP_UP if multi =>
move_items(-1)
- e.consume
+ e.consume()
case KeyEvent.VK_DOWN | KeyEvent.VK_KP_DOWN if multi =>
move_items(1)
- e.consume
+ e.consume()
case KeyEvent.VK_PAGE_UP if multi =>
move_pages(-1)
- e.consume
+ e.consume()
case KeyEvent.VK_PAGE_DOWN if multi =>
move_pages(1)
- e.consume
+ e.consume()
case _ =>
if (e.isActionKey || e.isAltDown || e.isMetaDown || e.isControlDown)
hide_popup()
@@ -632,7 +632,7 @@
list_view.peer.addMouseListener(new MouseAdapter {
override def mouseClicked(e: MouseEvent): Unit = {
- if (complete_selected()) e.consume
+ if (complete_selected()) e.consume()
hide_popup()
}
})
--- a/src/Tools/jEdit/src/debugger_dockable.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/debugger_dockable.scala Fri Sep 02 13:41:55 2022 +0200
@@ -17,8 +17,7 @@
import javax.swing.event.{TreeSelectionEvent, TreeSelectionListener}
import scala.collection.immutable.SortedMap
-import scala.swing.{Button, Label, Component, ScrollPane, SplitPane, Orientation,
- CheckBox, BorderPanel}
+import scala.swing.{Button, Label, Component, ScrollPane, SplitPane, Orientation, BorderPanel}
import scala.swing.event.ButtonClicked
import org.gjt.sp.jedit.{jEdit, View}
@@ -72,12 +71,8 @@
override def detach_operation: Option[() => Unit] = pretty_text_area.detach_operation
- private def handle_resize(): Unit = {
- GUI_Thread.require {}
-
- pretty_text_area.resize(
- Font_Info.main(PIDE.options.real("jedit_font_scale") * zoom.factor / 100))
- }
+ private def handle_resize(): Unit =
+ GUI_Thread.require { pretty_text_area.zoom(zoom) }
private def handle_update(): Unit = {
GUI_Thread.require {}
@@ -85,11 +80,11 @@
val new_snapshot = PIDE.editor.current_node_snapshot(view).getOrElse(current_snapshot)
val (new_threads, new_output) = debugger.status(tree_selection())
- if (new_threads != current_threads)
- update_tree(new_threads)
+ if (new_threads != current_threads) update_tree(new_threads)
- if (new_output != current_output)
+ if (new_output != current_output) {
pretty_text_area.update(new_snapshot, Command.Results.empty, Pretty.separate(new_output))
+ }
current_snapshot = new_snapshot
current_threads = new_threads
@@ -130,12 +125,12 @@
case _ => thread_contexts.headOption
}
- tree.clearSelection
- root.removeAllChildren
+ tree.clearSelection()
+ root.removeAllChildren()
for (thread <- thread_contexts) {
val thread_node = new DefaultMutableTreeNode(thread)
- for ((debug_state, i) <- thread.debug_states.zipWithIndex)
+ for ((_, i) <- thread.debug_states.zipWithIndex)
thread_node.add(new DefaultMutableTreeNode(thread.select(i)))
root.add(thread_node)
}
@@ -167,19 +162,15 @@
}
}
- tree.addTreeSelectionListener(
- new TreeSelectionListener {
- override def valueChanged(e: TreeSelectionEvent): Unit = {
- update_focus()
- update_vals()
- }
- })
+ tree.addTreeSelectionListener({ (_: TreeSelectionEvent) =>
+ update_focus()
+ update_vals()
+ })
tree.addMouseListener(
new MouseAdapter {
override def mouseClicked(e: MouseEvent): Unit = {
val click = tree.getPathForLocation(e.getX, e.getY)
- if (click != null && e.getClickCount == 1)
- update_focus()
+ if (click != null && e.getClickCount == 1) update_focus()
}
})
@@ -191,30 +182,29 @@
/* controls */
- private val break_button = new CheckBox("Break") {
+ private val break_button = new GUI.Check("Break", init = debugger.is_break()) {
tooltip = "Break running threads at next possible breakpoint"
- selected = debugger.is_break()
- reactions += { case ButtonClicked(_) => debugger.set_break(selected) }
+ override def clicked(state: Boolean): Unit = debugger.set_break(state)
}
- private val continue_button = new Button("Continue") {
+ private val continue_button = new GUI.Button("Continue") {
tooltip = "Continue program on current thread, until next breakpoint"
- reactions += { case ButtonClicked(_) => thread_selection().map(debugger.continue) }
+ override def clicked(): Unit = thread_selection().map(debugger.continue)
}
- private val step_button = new Button("Step") {
+ private val step_button = new GUI.Button("Step") {
tooltip = "Single-step in depth-first order"
- reactions += { case ButtonClicked(_) => thread_selection().map(debugger.step) }
+ override def clicked(): Unit = thread_selection().map(debugger.step)
}
- private val step_over_button = new Button("Step over") {
+ private val step_over_button = new GUI.Button("Step over") {
tooltip = "Single-step within this function"
- reactions += { case ButtonClicked(_) => thread_selection().map(debugger.step_over) }
+ override def clicked(): Unit = thread_selection().map(debugger.step_over)
}
- private val step_out_button = new Button("Step out") {
+ private val step_out_button = new GUI.Button("Step out") {
tooltip = "Single-step outside this function"
- reactions += { case ButtonClicked(_) => thread_selection().map(debugger.step_out) }
+ override def clicked(): Unit = thread_selection().map(debugger.step_out)
}
private val context_label = new Label("Context:") {
@@ -223,8 +213,9 @@
private val context_field =
new Completion_Popup.History_Text_Field("isabelle-debugger-context") {
override def processKeyEvent(evt: KeyEvent): Unit = {
- if (evt.getID == KeyEvent.KEY_PRESSED && evt.getKeyCode == KeyEvent.VK_ENTER)
+ if (evt.getID == KeyEvent.KEY_PRESSED && evt.getKeyCode == KeyEvent.VK_ENTER) {
eval_expression()
+ }
super.processKeyEvent(evt)
}
setColumns(20)
@@ -238,8 +229,9 @@
private val expression_field =
new Completion_Popup.History_Text_Field("isabelle-debugger-expression") {
override def processKeyEvent(evt: KeyEvent): Unit = {
- if (evt.getID == KeyEvent.KEY_PRESSED && evt.getKeyCode == KeyEvent.VK_ENTER)
+ if (evt.getID == KeyEvent.KEY_PRESSED && evt.getKeyCode == KeyEvent.VK_ENTER) {
eval_expression()
+ }
super.processKeyEvent(evt)
}
{ val max = getPreferredSize; max.width = Integer.MAX_VALUE; setMaximumSize(max) }
@@ -248,9 +240,10 @@
setFont(GUI.imitate_font(getFont, scale = 1.2))
}
- private val eval_button = new Button("<html><b>Eval</b></html>") {
+ private val eval_button =
+ new GUI.Button("<html><b>Eval</b></html>") {
tooltip = "Evaluate ML expression within optional context"
- reactions += { case ButtonClicked(_) => eval_expression() }
+ override def clicked(): Unit = eval_expression()
}
private def eval_expression(): Unit = {
@@ -263,12 +256,11 @@
}
}
- private val sml_button = new CheckBox("SML") {
+ private val sml_button = new GUI.Check("SML") {
tooltip = "Official Standard ML instead of Isabelle/ML"
- selected = false
}
- private val zoom = new Font_Info.Zoom_Box { def changed = handle_resize() }
+ private val zoom = new Font_Info.Zoom { override def changed(): Unit = handle_resize() }
private val controls =
Wrap_Panel(
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Tools/jEdit/src/document_dockable.scala Fri Sep 02 13:41:55 2022 +0200
@@ -0,0 +1,234 @@
+/* Title: Tools/jEdit/src/document_dockable.scala
+ Author: Makarius
+
+Dockable window for document build support.
+*/
+
+package isabelle.jedit
+
+
+import isabelle._
+
+import java.awt.BorderLayout
+import java.awt.event.{ComponentEvent, ComponentAdapter}
+
+import scala.swing.{ScrollPane, TextArea, Label, TabbedPane, BorderPanel, Component}
+
+import org.gjt.sp.jedit.{jEdit, View}
+
+
+object Document_Dockable {
+ def document_output(): Path =
+ Path.explode("$ISABELLE_HOME_USER/document/root.pdf")
+
+ object Status extends Enumeration {
+ val WAITING = Value("waiting")
+ val RUNNING = Value("running")
+ val FINISHED = Value("finished")
+ }
+
+ sealed case class Result(output: List[XML.Tree] = Nil) {
+ def failed: Boolean = output.exists(Protocol.is_error)
+ }
+
+ object State {
+ val empty: State = State()
+ def finish(result: Result): State = State(output = result.output)
+ }
+
+ sealed case class State(
+ progress: Progress = new Progress,
+ process: Future[Unit] = Future.value(()),
+ output: List[XML.Tree] = Nil,
+ status: Status.Value = Status.FINISHED
+ )
+}
+
+class Document_Dockable(view: View, position: String) extends Dockable(view, position) {
+ GUI_Thread.require {}
+
+
+ /* component state -- owned by GUI thread */
+
+ private val current_state = Synchronized(Document_Dockable.State.empty)
+
+ private val process_indicator = new Process_Indicator
+ private val pretty_text_area = new Pretty_Text_Area(view)
+ private val message_pane = new TabbedPane
+
+ private def show_state(): Unit = GUI_Thread.later {
+ val st = current_state.value
+
+ pretty_text_area.update(Document.Snapshot.init, Command.Results.empty, st.output)
+
+ st.status match {
+ case Document_Dockable.Status.WAITING =>
+ process_indicator.update("Waiting for PIDE document content ...", 5)
+ case Document_Dockable.Status.RUNNING =>
+ process_indicator.update("Running document build process ...", 15)
+ case Document_Dockable.Status.FINISHED =>
+ process_indicator.update(null, 0)
+ }
+ }
+
+ private def show_page(page: TabbedPane.Page): Unit = GUI_Thread.later {
+ message_pane.selection.page = page
+ }
+
+
+ /* text area with zoom/resize */
+
+ override def detach_operation: Option[() => Unit] = pretty_text_area.detach_operation
+
+ private val zoom = new Font_Info.Zoom { override def changed(): Unit = handle_resize() }
+ private def handle_resize(): Unit = GUI_Thread.require { pretty_text_area.zoom(zoom) }
+
+ private val delay_resize: Delay =
+ Delay.first(PIDE.options.seconds("editor_update_delay"), gui = true) { handle_resize() }
+
+ addComponentListener(new ComponentAdapter {
+ override def componentResized(e: ComponentEvent): Unit = delay_resize.invoke()
+ override def componentShown(e: ComponentEvent): Unit = delay_resize.invoke()
+ })
+
+
+ /* progress log */
+
+ private val log_area = new TextArea {
+ editable = false
+ columns = 60
+ rows = 24
+ }
+ log_area.font = GUI.copy_font((new Label).font)
+
+ private val scroll_log_area = new ScrollPane(log_area)
+
+ private def init_progress() = {
+ GUI_Thread.later { log_area.text = "" }
+ new Progress {
+ override def echo(txt: String): Unit =
+ GUI_Thread.later {
+ log_area.append(txt + "\n")
+ val vertical = scroll_log_area.peer.getVerticalScrollBar
+ vertical.setValue(vertical.getMaximum)
+ }
+
+ override def theory(theory: Progress.Theory): Unit = echo(theory.message)
+ }
+ }
+
+
+ /* document build process */
+
+ private def cancel(): Unit =
+ current_state.change { st => st.process.cancel(); st }
+
+ private def build_document(): Unit = {
+ current_state.change { st =>
+ if (st.process.is_finished) {
+ val progress = init_progress()
+ val process =
+ Future.thread[Unit](name = "document_build") {
+ show_page(log_page)
+ val res =
+ Exn.capture {
+ progress.echo("Start " + Date.now())
+ Time.seconds(2.0).sleep()
+ progress.echo("Stop " + Date.now())
+ }
+ val msg =
+ res match {
+ case Exn.Res(_) => Protocol.make_message(XML.string("OK"))
+ case Exn.Exn(exn) => Protocol.error_message(XML.string(Exn.message(exn)))
+ }
+ val result = Document_Dockable.Result(output = List(msg))
+ current_state.change(_ => Document_Dockable.State.finish(result))
+ show_state()
+ show_page(output_page)
+ }
+ st.copy(progress = progress, process = process, status = Document_Dockable.Status.RUNNING)
+ }
+ else st
+ }
+ show_state()
+ }
+
+ private def view_document(): Unit = {
+ val path = Document_Dockable.document_output()
+ if (path.is_file) Isabelle_System.pdf_viewer(path)
+ }
+
+
+ /* controls */
+
+ private val document_session: GUI.Selector[String] =
+ new GUI.Selector(JEdit_Sessions.sessions_structure().build_topological_order.sorted) {
+ val title = "Session"
+ }
+
+ private val build_button =
+ new GUI.Button("<html><b>Build</b></html>") {
+ tooltip = "Build document"
+ override def clicked(): Unit = build_document()
+ }
+
+ private val cancel_button =
+ new GUI.Button("Cancel") {
+ tooltip = "Cancel build process"
+ override def clicked(): Unit = cancel()
+ }
+
+ private val view_button =
+ new GUI.Button("View") {
+ tooltip = "View document"
+ override def clicked(): Unit = view_document()
+ }
+
+ private val controls =
+ Wrap_Panel(List(document_session, process_indicator.component, build_button,
+ view_button, cancel_button))
+
+ add(controls.peer, BorderLayout.NORTH)
+
+ override def focusOnDefaultComponent(): Unit = build_button.requestFocus()
+
+
+ /* message pane with pages */
+
+ private val output_controls =
+ Wrap_Panel(List(pretty_text_area.search_label, pretty_text_area.search_field, zoom))
+
+ private val output_page =
+ new TabbedPane.Page("Output", new BorderPanel {
+ layout(output_controls) = BorderPanel.Position.North
+ layout(Component.wrap(pretty_text_area)) = BorderPanel.Position.Center
+ }, "Output from build process")
+
+ private val log_page =
+ new TabbedPane.Page("Log", new BorderPanel {
+ layout(log_area) = BorderPanel.Position.Center
+ }, "Raw log of build process")
+
+ message_pane.pages ++= List(log_page, output_page)
+
+ set_content(message_pane)
+
+
+ /* main */
+
+ private val main =
+ Session.Consumer[Session.Global_Options](getClass.getName) {
+ case _: Session.Global_Options =>
+ GUI_Thread.later { handle_resize() }
+ }
+
+ override def init(): Unit = {
+ PIDE.session.global_options += main
+ handle_resize()
+ }
+
+ override def exit(): Unit = {
+ PIDE.session.global_options -= main
+ delay_resize.revoke()
+ }
+}
--- a/src/Tools/jEdit/src/document_model.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/document_model.scala Fri Sep 02 13:41:55 2022 +0200
@@ -313,17 +313,11 @@
}
yield {
val snapshot = model.await_stable_snapshot()
- val html_context =
- new Presentation.HTML_Context {
- override def root_dir: Path = Path.current
-
- override def theory_session(name: Document.Node.Name): Sessions.Info =
- PIDE.resources.sessions_structure(
- PIDE.resources.session_base.theory_qualifier(name))
- }
+ val context =
+ Browser_Info.context(PIDE.resources.sessions_structure,
+ elements = Browser_Info.extra_elements)
val document =
- Presentation.html_document(
- snapshot, html_context, Presentation.elements2,
+ context.preview_document(snapshot,
plain_text = query.startsWith(plain_text_prefix),
fonts_css = HTML.fonts_css_dir(HTTP.url_path(request.server_name)))
HTTP.Response.html(document.content)
@@ -342,7 +336,7 @@
): (Boolean, Document.Node.Perspective_Text) = {
GUI_Thread.require {}
- if (Isabelle.continuous_checking && is_theory) {
+ if (JEdit_Options.continuous_checking() && is_theory) {
val snapshot = this.snapshot()
val reparse = snapshot.node.load_commands_changed(doc_blobs)
@@ -427,7 +421,7 @@
else Some(Document.Blob(content.bytes, content.text, content.chunk, pending_edits.nonEmpty))
def bibtex_entries: List[Text.Info[String]] =
- if (Bibtex.is_bibtex(node_name.node)) content.bibtex_entries else Nil
+ if (File.is_bib(node_name.node)) content.bibtex_entries else Nil
/* edits */
@@ -549,7 +543,7 @@
def bibtex_entries: List[Text.Info[String]] =
GUI_Thread.require {
- if (Bibtex.is_bibtex(node_name.node)) {
+ if (File.is_bib(node_name.node)) {
_bibtex_entries match {
case Some(entries) => entries
case None =>
--- a/src/Tools/jEdit/src/document_view.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/document_view.scala Fri Sep 02 13:41:55 2022 +0200
@@ -177,7 +177,7 @@
JEdit_Lib.key_listener(
key_pressed = { (evt: KeyEvent) =>
if (evt.getKeyCode == KeyEvent.VK_ESCAPE && Isabelle.dismissed_popups(text_area.getView)) {
- evt.consume
+ evt.consume()
}
}
)
--- a/src/Tools/jEdit/src/documentation_dockable.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/documentation_dockable.scala Fri Sep 02 13:41:55 2022 +0200
@@ -58,7 +58,7 @@
tree.addKeyListener(new KeyAdapter {
override def keyPressed(e: KeyEvent): Unit = {
if (e.getKeyCode == KeyEvent.VK_ENTER) {
- e.consume
+ e.consume()
val path = tree.getSelectionPath
if (path != null) {
path.getLastPathComponent match {
--- a/src/Tools/jEdit/src/font_info.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/font_info.scala Fri Sep 02 13:41:55 2022 +0200
@@ -78,9 +78,9 @@
}
- /* zoom box */
+ /* zoom */
- abstract class Zoom_Box extends GUI.Zoom_Box { tooltip = "Zoom factor for output font size" }
+ class Zoom extends GUI.Zoom { tooltip = "Zoom factor for output font size" }
}
sealed case class Font_Info(family: String, size: Float) {
--- a/src/Tools/jEdit/src/info_dockable.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/info_dockable.scala Fri Sep 02 13:41:55 2022 +0200
@@ -72,14 +72,10 @@
pretty_text_area.update(snapshot, results, info)
- private val zoom = new Font_Info.Zoom_Box { def changed = handle_resize() }
+ private val zoom = new Font_Info.Zoom { override def changed(): Unit = handle_resize() }
- private def handle_resize(): Unit = {
- GUI_Thread.require {}
-
- pretty_text_area.resize(
- Font_Info.main(PIDE.options.real("jedit_font_scale") * zoom.factor / 100))
- }
+ private def handle_resize(): Unit =
+ GUI_Thread.require { pretty_text_area.zoom(zoom) }
/* resize */
@@ -106,13 +102,13 @@
}
override def init(): Unit = {
- GUI.parent_window(this).map(_.addWindowFocusListener(window_focus_listener))
+ GUI.parent_window(this).foreach(_.addWindowFocusListener(window_focus_listener))
PIDE.session.global_options += main
handle_resize()
}
override def exit(): Unit = {
- GUI.parent_window(this).map(_.removeWindowFocusListener(window_focus_listener))
+ GUI.parent_window(this).foreach(_.removeWindowFocusListener(window_focus_listener))
PIDE.session.global_options -= main
delay_resize.revoke()
}
--- a/src/Tools/jEdit/src/isabelle.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/isabelle.scala Fri Sep 02 13:41:55 2022 +0200
@@ -11,9 +11,6 @@
import java.awt.{Point, Frame, Rectangle}
-import scala.swing.CheckBox
-import scala.swing.event.ButtonClicked
-
import org.gjt.sp.jedit.{jEdit, View, Buffer, EditBus}
import org.gjt.sp.jedit.msg.ViewUpdate
import org.gjt.sp.jedit.buffer.JEditBuffer
@@ -27,7 +24,7 @@
object Isabelle {
/* editor modes */
- val modes =
+ val modes: List[String] =
List(
"isabelle", // theory source
"isabelle-ml", // ML source
@@ -108,6 +105,12 @@
case _ => None
}
+ def document_dockable(view: View): Option[Document_Dockable] =
+ wm(view).getDockableWindow("isabelle-document") match {
+ case dockable: Document_Dockable => Some(dockable)
+ case _ => None
+ }
+
def documentation_dockable(view: View): Option[Documentation_Dockable] =
wm(view).getDockableWindow("isabelle-documentation") match {
case dockable: Documentation_Dockable => Some(dockable)
@@ -189,28 +192,9 @@
/* continuous checking */
- private val CONTINUOUS_CHECKING = "editor_continuous_checking"
-
- def continuous_checking: Boolean = PIDE.options.bool(CONTINUOUS_CHECKING)
- def continuous_checking_=(b: Boolean): Unit =
- GUI_Thread.require {
- if (continuous_checking != b) {
- PIDE.options.bool(CONTINUOUS_CHECKING) = b
- PIDE.session.update_options(PIDE.options.value)
- PIDE.plugin.deps_changed()
- }
- }
-
- def set_continuous_checking(): Unit = { continuous_checking = true }
- def reset_continuous_checking(): Unit = { continuous_checking = false }
- def toggle_continuous_checking(): Unit = { continuous_checking = !continuous_checking }
-
- class Continuous_Checking extends CheckBox("Continuous checking") {
- tooltip = "Continuous checking of proof document (visible and required parts)"
- reactions += { case ButtonClicked(_) => continuous_checking = selected }
- def load(): Unit = { selected = continuous_checking }
- load()
- }
+ def set_continuous_checking(): Unit = JEdit_Options.continuous_checking.set()
+ def reset_continuous_checking(): Unit = JEdit_Options.continuous_checking.reset()
+ def toggle_continuous_checking(): Unit = JEdit_Options.continuous_checking.toggle()
/* update state */
@@ -294,7 +278,7 @@
val line = text_area.getCaretLine
val caret = text_area.getCaretPosition
- def nl: Unit = text_area.userInput('\n')
+ def nl(): Unit = text_area.userInput('\n')
if (indent_enabled(buffer, "jedit_indent_newline")) {
buffer_syntax(buffer) match {
@@ -310,11 +294,11 @@
text_area.setSelectedText("\n")
if (!buffer.indentLine(line + 1, true)) text_area.goToStartOfWhiteSpace(false)
}
- else nl
- case None => nl
+ else nl()
+ case None => nl()
}
}
- else nl
+ else nl()
}
}
@@ -324,7 +308,7 @@
val text1 =
if (text_area.getSelectionCount == 0) {
def pad(range: Text.Range): String =
- if (JEdit_Lib.get_text(buffer, range) == Some("\n")) "" else "\n"
+ if (JEdit_Lib.get_text(buffer, range).contains("\n")) "" else "\n"
val caret = JEdit_Lib.caret_range(text_area)
val before_caret = JEdit_Lib.point_range(buffer, caret.start - 1)
--- a/src/Tools/jEdit/src/isabelle_options.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/isabelle_options.scala Fri Sep 02 13:41:55 2022 +0200
@@ -38,24 +38,23 @@
val options: JEdit_Options = PIDE.options
private val predefined =
- List(JEdit_Sessions.logic_selector(options, false),
+ List(JEdit_Sessions.logic_selector(options),
JEdit_Spell_Checker.dictionaries_selector())
protected val components =
options.make_components(predefined,
- (for ((name, opt) <- options.value.options.iterator if opt.public) yield name).toSet)
+ (for ((name, opt) <- options.value.opt_iterator if opt.public) yield name).toSet)
}
class Isabelle_Options2 extends Isabelle_Options("isabelle-rendering") {
private val predefined =
(for {
- (name, opt) <- PIDE.options.value.options.toList
+ (name, opt) <- PIDE.options.value.opt_iterator
if (name.endsWith("_color") && opt.section == JEdit_Options.RENDERING_SECTION)
- } yield PIDE.options.make_color_component(opt))
+ } yield PIDE.options.make_color_component(opt)).toList
assert(predefined.nonEmpty)
protected val components = PIDE.options.make_components(predefined, _ => false)
}
-
--- a/src/Tools/jEdit/src/isabelle_session.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/isabelle_session.scala Fri Sep 02 13:41:55 2022 +0200
@@ -18,12 +18,6 @@
object Isabelle_Session {
- /* sessions structure */
-
- def sessions_structure(): Sessions.Structure =
- JEdit_Sessions.sessions_structure(PIDE.options.value)
-
-
/* virtual file-system */
val vfs_prefix = "isabelle-session:"
@@ -53,28 +47,29 @@
explode_url(url, component = component) match {
case None => null
case Some(elems) =>
- val sessions = sessions_structure()
+ val sessions = JEdit_Sessions.sessions_structure()
elems match {
case Nil =>
- sessions.chapters.iterator.map(p => make_entry(p._1, is_dir = true)).toArray
+ sessions.relevant_chapters.sortBy(_.name).map(ch => make_entry(ch.name, is_dir = true)).toArray
case List(chapter) =>
- sessions.chapters.get(chapter) match {
+ sessions.relevant_chapters.find(_.name == chapter) match {
case None => null
- case Some(infos) =>
- infos.map(info => {
- val name = chapter + "/" + info.name
+ case Some(ch) =>
+ ch.sessions.map { session =>
+ val pos = sessions(session).pos
+ val name = ch.name + "/" + session
val path =
- Position.File.unapply(info.pos) match {
+ Position.File.unapply(pos) match {
case Some(path) => File.platform_path(path)
case None => null
}
val marker =
- Position.Line.unapply(info.pos) match {
+ Position.Line.unapply(pos) match {
case Some(line) => "+line:" + line
case None => null
}
new Session_Entry(name, path, marker)
- }).toArray
+ }.toArray
}
case _ => null
}
@@ -90,10 +85,10 @@
PIDE.maybe_snapshot(view) match {
case None => ""
case Some(snapshot) =>
- val sessions = sessions_structure()
- val session = PIDE.resources.session_base.theory_qualifier(snapshot.node_name)
+ val sessions_structure = JEdit_Sessions.sessions_structure()
+ val session = sessions_structure.theory_qualifier(snapshot.node_name)
val chapter =
- sessions.get(session) match {
+ sessions_structure.get(session) match {
case Some(info) => info.chapter
case None => Sessions.UNSORTED
}
--- a/src/Tools/jEdit/src/jedit_bibtex.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/jedit_bibtex.scala Fri Sep 02 13:41:55 2022 +0200
@@ -29,7 +29,7 @@
def context_menu(text_area: JEditTextArea): List[JMenuItem] = {
text_area.getBuffer match {
case buffer: Buffer
- if Bibtex.is_bibtex(JEdit_Lib.buffer_name(buffer)) && buffer.isEditable =>
+ if File.is_bib(JEdit_Lib.buffer_name(buffer)) && buffer.isEditable =>
val menu = new JMenu("BibTeX entries")
for (entry <- Bibtex.known_entries) {
val item = new JMenuItem(entry.kind)
--- a/src/Tools/jEdit/src/jedit_lib.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/jedit_lib.scala Fri Sep 02 13:41:55 2022 +0200
@@ -287,7 +287,7 @@
def load_icon(name: String): Icon = {
val name1 =
if (name.startsWith("idea-icons/")) {
- val file = Path.explode("$ISABELLE_IDEA_ICONS").file.toURI.toASCIIString
+ val file = File.uri(Path.explode("$ISABELLE_IDEA_ICONS")).toASCIIString
"jar:" + file + "!/" + name
}
else name
--- a/src/Tools/jEdit/src/jedit_options.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/jedit_options.scala Fri Sep 02 13:41:55 2022 +0200
@@ -14,7 +14,6 @@
import javax.swing.text.JTextComponent
import scala.swing.{Component, CheckBox, TextArea}
-import scala.swing.event.ButtonClicked
import org.gjt.sp.jedit.gui.ColorWellButton
@@ -26,23 +25,61 @@
}
object JEdit_Options {
+ /* sections */
+
val RENDERING_SECTION = "Rendering of Document Content"
- class Check_Box(name: String, label: String, description: String) extends CheckBox(label) {
- tooltip = description
- reactions += { case ButtonClicked(_) => update(selected) }
+
+ /* typed access and GUI components */
+
+ class Access[A](access: Options.Access_Variable[A], val name: String) {
+ def apply(): A = access.apply(name)
+ def update(x: A): Unit = change(_ => x)
+ def change(f: A => A): Unit = {
+ val x0 = apply()
+ access.change(name, f)
+ val x1 = apply()
+ if (x0 != x1) changed()
+ }
+ def changed(): Unit = GUI_Thread.require { PIDE.session.update_options(access.options.value) }
+ }
+
+ class Bool_Access(name: String) extends Access(PIDE.options.bool, name) {
+ def set(): Unit = update(true)
+ def reset(): Unit = update(false)
+ def toggle(): Unit = change(b => !b)
+ }
- def stored: Boolean = PIDE.options.bool(name)
- def update(b: Boolean): Unit =
- GUI_Thread.require {
- if (selected != b) selected = b
- if (stored != b) {
- PIDE.options.bool(name) = b
- PIDE.session.update_options(PIDE.options.value)
- }
- }
- def load(): Unit = { selected = stored }
- load()
+ class Bool_GUI(access: Bool_Access, label: String)
+ extends GUI.Check(label, init = access()) {
+ def load(): Unit = { selected = access() }
+ override def clicked(state: Boolean): Unit = access.update(state)
+ }
+
+
+ /* specific options */
+
+ object continuous_checking extends Bool_Access("editor_continuous_checking") {
+ override def changed(): Unit = {
+ super.changed()
+ PIDE.plugin.deps_changed()
+ }
+
+ class GUI extends Bool_GUI(this, "Continuous checking") {
+ tooltip = "Continuous checking of proof document (visible and required parts)"
+ }
+ }
+
+ object output_state extends Bool_Access("editor_output_state") {
+ override def changed(): Unit = GUI_Thread.require {
+ super.changed()
+ PIDE.editor.flush_edits(hidden = true)
+ PIDE.editor.flush()
+ }
+
+ class GUI extends Bool_GUI(this, "Proof state") {
+ tooltip = "Output of proof state (normally shown on State panel)"
+ }
}
}
@@ -57,9 +94,9 @@
val button = new ColorWellButton(Color_Value(opt.value))
val component = new Component with Option_Component {
- override lazy val peer = button
+ override lazy val peer: JComponent = button
name = opt_name
- val title = opt_title
+ val title: String = opt_title
def load(): Unit = button.setSelectedColor(Color_Value(string(opt_name)))
def save(): Unit = string(opt_name) = Color_Value.print(button.getSelectedColor)
}
@@ -77,7 +114,7 @@
if (opt.typ == Options.Bool)
new CheckBox with Option_Component {
name = opt_name
- val title = opt_title
+ val title: String = opt_title
def load(): Unit = selected = bool(opt_name)
def save(): Unit = bool(opt_name) = selected
}
@@ -87,7 +124,7 @@
new TextArea with Option_Component {
if (default_font != null) font = default_font
name = opt_name
- val title = opt_title
+ val title: String = opt_title
def load(): Unit = text = value.check_name(opt_name).value
def save(): Unit =
try { JEdit_Options.this += (opt_name, text) }
@@ -97,14 +134,11 @@
GUI.scrollable_text(msg))
}
}
- text_area.peer.setInputVerifier(new InputVerifier {
- def verify(jcomponent: JComponent): Boolean =
- jcomponent match {
- case text: JTextComponent =>
- try { value + (opt_name, text.getText); true }
- catch { case ERROR(_) => false }
- case _ => true
- }
+ text_area.peer.setInputVerifier({
+ case text: JTextComponent =>
+ try { value + (opt_name, text.getText); true }
+ catch { case ERROR(_) => false }
+ case _ => true
})
GUI.plain_focus_traversal(text_area.peer)
text_area
--- a/src/Tools/jEdit/src/jedit_resources.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/jedit_resources.scala Fri Sep 02 13:41:55 2022 +0200
@@ -28,7 +28,6 @@
class JEdit_Resources private(val session_base_info: Sessions.Base_Info)
extends Resources(session_base_info.sessions_structure, session_base_info.base) {
- def session_name: String = session_base_info.session
def session_errors: List[String] = session_base_info.errors
--- a/src/Tools/jEdit/src/jedit_sessions.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/jedit_sessions.scala Fri Sep 02 13:41:55 2022 +0200
@@ -10,9 +10,6 @@
import isabelle._
-import scala.swing.ComboBox
-import scala.swing.event.SelectionChanged
-
object JEdit_Sessions {
/* session options */
@@ -39,8 +36,12 @@
options2
}
- def sessions_structure(options: Options, dirs: List[Path] = session_dirs): Sessions.Structure =
+ def sessions_structure(
+ options: Options = PIDE.options.value,
+ dirs: List[Path] = session_dirs
+ ): Sessions.Structure = {
Sessions.load_structure(session_options(options), dirs = dirs)
+ }
/* raw logic info */
@@ -58,7 +59,7 @@
space_explode(':', Isabelle_System.getenv("JEDIT_INCLUDE_SESSIONS"))
def logic_info(options: Options): Option[Sessions.Info] =
- try { sessions_structure(options).get(logic_name(options)) }
+ try { sessions_structure(options = options).get(logic_name(options)) }
catch { case ERROR(_) => None }
def logic_root(options: Options): Position.T =
@@ -68,26 +69,25 @@
/* logic selector */
- private class Logic_Entry(val name: String, val description: String) {
- override def toString: String = description
+ private sealed case class Logic_Entry(name: String = "", description: String = "") {
+ override def toString: String = proper_string(description) getOrElse name
}
- def logic_selector(options: Options_Variable, autosave: Boolean): Option_Component = {
+ def logic_selector(options: Options_Variable, autosave: Boolean = false): Option_Component = {
GUI_Thread.require {}
- val session_list = {
- val sessions = sessions_structure(options.value)
+ val default_entry = Logic_Entry(description = "default (" + logic_name(options.value) + ")")
+
+ val session_entries = {
+ val sessions = sessions_structure(options = options.value)
val (main_sessions, other_sessions) =
sessions.imports_topological_order.partition(name => sessions(name).groups.contains("main"))
- main_sessions.sorted ::: other_sessions.sorted
+ (main_sessions.sorted ::: other_sessions.sorted).map(name => Logic_Entry(name = name))
}
- val entries =
- new Logic_Entry("", "default (" + logic_name(options.value) + ")") ::
- session_list.map(name => new Logic_Entry(name, name))
-
- val component = new ComboBox(entries) with Option_Component {
+ new GUI.Selector[Logic_Entry](default_entry :: session_entries) with Option_Component {
name = jedit_logic_option
+ tooltip = "Logic session name (change requires restart)"
val title = "Logic"
def load(): Unit = {
val logic = options.string(jedit_logic_option)
@@ -97,15 +97,10 @@
}
}
def save(): Unit = options.string(jedit_logic_option) = selection.item.name
- }
+ override def changed(): Unit = if (autosave) save()
- component.load()
- if (autosave) {
- component.listenTo(component.selection)
- component.reactions += { case SelectionChanged(_) => component.save() }
+ load()
}
- component.tooltip = "Logic session name (change requires restart)"
- component
}
@@ -125,7 +120,7 @@
no_build: Boolean = false
): Int = {
Build.build(session_options(options),
- selection = Sessions.Selection.session(PIDE.resources.session_name),
+ selection = Sessions.Selection.session(PIDE.resources.session_base.session_name),
progress = progress, build_heap = true, no_build = no_build, dirs = session_dirs,
infos = PIDE.resources.session_base_info.infos).rc
}
@@ -139,7 +134,7 @@
session.phase_changed += PIDE.plugin.session_phase_changed
Isabelle_Process.start(session, options, sessions_structure, store,
- logic = PIDE.resources.session_name,
+ logic = PIDE.resources.session_base.session_name,
modes =
(space_explode(',', options.string("jedit_print_mode")) :::
space_explode(',', Isabelle_System.getenv("JEDIT_PRINT_MODE"))).reverse)
--- a/src/Tools/jEdit/src/jedit_spell_checker.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/jedit_spell_checker.scala Fri Sep 02 13:41:55 2022 +0200
@@ -10,7 +10,6 @@
import isabelle._
import javax.swing.JMenuItem
-import scala.swing.ComboBox
import org.gjt.sp.jedit.menu.EnhancedMenuItem
import org.gjt.sp.jedit.jEdit
@@ -86,9 +85,9 @@
val option_name = "spell_checker_dictionary"
val opt = PIDE.options.value.check_name(option_name)
- val entries = Spell_Checker.dictionaries
- val component = new ComboBox(entries) with Option_Component {
+ new GUI.Selector[Spell_Checker.Dictionary](Spell_Checker.dictionaries) with Option_Component {
name = option_name
+ tooltip = GUI.tooltip_lines(opt.print_default)
val title = opt.title()
def load(): Unit = {
val lang = PIDE.options.string(option_name)
@@ -98,10 +97,8 @@
}
}
def save(): Unit = PIDE.options.string(option_name) = selection.item.lang
+
+ load()
}
-
- component.load()
- component.tooltip = GUI.tooltip_lines(opt.print_default)
- component
}
}
--- a/src/Tools/jEdit/src/main_plugin.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/main_plugin.scala Fri Sep 02 13:41:55 2022 +0200
@@ -109,7 +109,7 @@
private def delay_load_activated(): Boolean =
delay_load_active.guarded_access(a => Some((!a, true)))
private def delay_load_action(): Unit = {
- if (Isabelle.continuous_checking && delay_load_activated() &&
+ if (JEdit_Options.continuous_checking() && delay_load_activated() &&
PerspectiveManager.isPerspectiveEnabled) {
if (JEdit_Lib.jedit_buffers().exists(_.isLoading)) delay_load.invoke()
else {
@@ -189,7 +189,7 @@
case Session.Ready if !shutting_down.value =>
init_models()
- if (!Isabelle.continuous_checking) {
+ if (!JEdit_Options.continuous_checking()) {
GUI_Thread.later {
val answer =
GUI.confirm_dialog(jEdit.getActiveView,
@@ -198,7 +198,7 @@
"Continuous checking is presently disabled:",
"editor buffers will remain inactive!",
"Enable continuous checking now?")
- if (answer == 0) Isabelle.continuous_checking = true
+ if (answer == 0) JEdit_Options.continuous_checking.set()
}
}
@@ -242,7 +242,7 @@
val model = Document_Model.init(session, node_name, buffer)
for {
text_area <- JEdit_Lib.jedit_text_areas(buffer)
- if Document_View.get(text_area).map(_.model) != Some(model)
+ if !Document_View.get(text_area).map(_.model).contains(model)
} Document_View.init(model, text_area)
}
}
@@ -284,7 +284,7 @@
private def init_title(view: View): Unit = {
val title =
proper_string(Isabelle_System.getenv("ISABELLE_IDENTIFIER")).getOrElse("Isabelle") +
- "/" + PIDE.resources.session_name
+ "/" + PIDE.resources.session_base.session_name
val marker = "\u200B"
val old_title = view.getViewConfig.title
@@ -298,7 +298,7 @@
if (startup_failure.isDefined && !startup_notified) {
message match {
- case msg: EditorStarted =>
+ case _: EditorStarted =>
GUI.error_dialog(null, "Isabelle plugin startup failure",
GUI.scrollable_text(Exn.message(startup_failure.get)),
"Prover IDE inactive!")
@@ -309,7 +309,7 @@
if (startup_failure.isEmpty) {
message match {
- case msg: EditorStarted =>
+ case _: EditorStarted =>
if (resources.session_errors.nonEmpty) {
GUI.warning_dialog(jEdit.getActiveView,
"Bad session structure: may cause problems with theory imports",
@@ -369,7 +369,7 @@
Completion_Popup.Text_Area.exit(text_area)
}
- case msg: PropertiesChanged =>
+ case _: PropertiesChanged =>
for {
view <- JEdit_Lib.jedit_views()
edit_pane <- JEdit_Lib.jedit_edit_panes(view)
--- a/src/Tools/jEdit/src/monitor_dockable.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/monitor_dockable.scala Fri Sep 02 13:41:55 2022 +0200
@@ -12,8 +12,8 @@
import java.awt.BorderLayout
import scala.collection.immutable.Queue
-import scala.swing.{TextField, ComboBox, Button}
-import scala.swing.event.{SelectionChanged, ButtonClicked, ValueChanged}
+import scala.swing.TextField
+import scala.swing.event.ValueChanged
import org.jfree.chart.ChartPanel
import org.jfree.data.xy.XYSeriesCollection
@@ -64,14 +64,9 @@
/* controls */
- private val select_data = new ComboBox[String](ML_Statistics.all_fields.map(_._1)) {
+ private val select_data = new GUI.Selector[String](ML_Statistics.all_fields.map(_._1)) {
tooltip = "Select visualized data collection"
- listenTo(selection)
- reactions += {
- case SelectionChanged(_) =>
- data_name = selection.item
- update_chart()
- }
+ override def changed(): Unit = { data_name = selection.item; update_chart() }
}
private val limit_data = new TextField("200", 5) {
@@ -83,29 +78,19 @@
reactions += { case ValueChanged(_) => input_delay.invoke() }
}
- private val reset_data = new Button("Reset") {
+ private val reset_data = new GUI.Button("Reset") {
tooltip = "Reset accumulated data"
- reactions += {
- case ButtonClicked(_) =>
- clear_statistics()
- update_chart()
- }
+ override def clicked(): Unit = { clear_statistics(); update_chart() }
}
- private val full_gc = new Button("GC") {
+ private val full_gc = new GUI.Button("GC") {
tooltip = "Full garbage collection of ML heap"
- reactions += {
- case ButtonClicked(_) =>
- PIDE.session.protocol_command("ML_Heap.full_gc")
- }
+ override def clicked(): Unit = PIDE.session.protocol_command("ML_Heap.full_gc")
}
- private val share_common_data = new Button("Sharing") {
+ private val share_common_data = new GUI.Button("Sharing") {
tooltip = "Share common data of ML heap"
- reactions += {
- case ButtonClicked(_) =>
- PIDE.session.protocol_command("ML_Heap.share_common_data")
- }
+ override def clicked(): Unit = PIDE.session.protocol_command("ML_Heap.share_common_data")
}
private val controls =
--- a/src/Tools/jEdit/src/output_dockable.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/output_dockable.scala Fri Sep 02 13:41:55 2022 +0200
@@ -9,9 +9,6 @@
import isabelle._
-import scala.swing.{Button, CheckBox}
-import scala.swing.event.ButtonClicked
-
import java.awt.BorderLayout
import java.awt.event.{ComponentEvent, ComponentAdapter}
@@ -33,12 +30,8 @@
override def detach_operation: Option[() => Unit] = pretty_text_area.detach_operation
- private def handle_resize(): Unit = {
- GUI_Thread.require {}
-
- pretty_text_area.resize(
- Font_Info.main(PIDE.options.real("jedit_font_scale") * zoom.factor / 100))
- }
+ private def handle_resize(): Unit =
+ GUI_Thread.require { pretty_text_area.zoom(zoom) }
private def handle_update(follow: Boolean, restriction: Option[Set[Command]]): Unit = {
GUI_Thread.require {}
@@ -55,7 +48,7 @@
val new_output =
if (restriction.isEmpty || restriction.get.contains(command))
- Rendering.output_messages(results)
+ Rendering.output_messages(results, JEdit_Options.output_state())
else current_output
if (current_output != new_output) {
@@ -68,35 +61,22 @@
/* controls */
- private def output_state: Boolean = PIDE.options.bool("editor_output_state")
- private def output_state_=(b: Boolean): Unit = {
- if (output_state != b) {
- PIDE.options.bool("editor_output_state") = b
- PIDE.session.update_options(PIDE.options.value)
- PIDE.editor.flush_edits(hidden = true)
- PIDE.editor.flush()
+ private val output_state_button = new JEdit_Options.output_state.GUI
+
+ private val auto_update_button = new GUI.Check("Auto update", init = do_update) {
+ tooltip = "Indicate automatic update following cursor movement"
+ override def clicked(state: Boolean): Unit = {
+ do_update = state
+ handle_update(do_update, None)
}
}
- private val output_state_button = new CheckBox("Proof state") {
- tooltip = "Output of proof state (normally shown on State panel)"
- reactions += { case ButtonClicked(_) => output_state = selected }
- selected = output_state
+ private val update_button = new GUI.Button("Update") {
+ tooltip = "Update display according to the command at cursor position"
+ override def clicked(): Unit = handle_update(true, None)
}
- private val auto_update_button = new CheckBox("Auto update") {
- tooltip = "Indicate automatic update following cursor movement"
- reactions += {
- case ButtonClicked(_) => do_update = this.selected; handle_update(do_update, None) }
- selected = do_update
- }
-
- private val update_button = new Button("Update") {
- tooltip = "Update display according to the command at cursor position"
- reactions += { case ButtonClicked(_) => handle_update(true, None) }
- }
-
- private val zoom = new Font_Info.Zoom_Box { def changed = handle_resize() }
+ private val zoom = new Font_Info.Zoom { override def changed(): Unit = handle_resize() }
private val controls =
Wrap_Panel(
@@ -113,7 +93,7 @@
case _: Session.Global_Options =>
GUI_Thread.later {
handle_resize()
- output_state_button.selected = output_state
+ output_state_button.load()
handle_update(do_update, None)
}
--- a/src/Tools/jEdit/src/pretty_text_area.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/pretty_text_area.scala Fri Sep 02 13:41:55 2022 +0200
@@ -122,6 +122,11 @@
refresh()
}
+ def zoom(zoom: GUI.Zoom): Unit = {
+ val factor = if (zoom == null) 100 else zoom.factor
+ resize(Font_Info.main(PIDE.options.real("jedit_font_scale") * factor / 100))
+ }
+
def update(
base_snapshot: Document.Snapshot,
base_results: Command.Results,
@@ -136,13 +141,13 @@
refresh()
}
- def detach: Unit = {
+ def detach(): Unit = {
GUI_Thread.require {}
Info_Dockable(view, current_base_snapshot, current_base_results, current_body)
}
def detach_operation: Option[() => Unit] =
- if (current_body.isEmpty) None else Some(() => detach)
+ if (current_body.isEmpty) None else Some(() => detach())
/* common GUI components */
@@ -208,15 +213,15 @@
case KeyEvent.VK_C | KeyEvent.VK_INSERT
if strict_control && text_area.getSelectionCount != 0 =>
Registers.copy(text_area, '$')
- evt.consume
+ evt.consume()
case KeyEvent.VK_A
if strict_control =>
text_area.selectAll
- evt.consume
+ evt.consume()
case KeyEvent.VK_ESCAPE =>
- if (Isabelle.dismissed_popups(view)) evt.consume
+ if (Isabelle.dismissed_popups(view)) evt.consume()
case _ =>
}
--- a/src/Tools/jEdit/src/process_indicator.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/process_indicator.scala Fri Sep 02 13:41:55 2022 +0200
@@ -27,26 +27,24 @@
private class Animation extends ImageIcon(passive_icon) {
private var current_frame = 0
private val timer =
- new Timer(0, new ActionListener {
- override def actionPerformed(e: ActionEvent): Unit = {
- current_frame = (current_frame + 1) % active_icons.length
- setImage(active_icons(current_frame))
- label.repaint()
- }
+ new Timer(0, { (_: ActionEvent) =>
+ current_frame = (current_frame + 1) % active_icons.length
+ setImage(active_icons(current_frame))
+ label.repaint()
})
timer.setRepeats(true)
def update(rate: Int): Unit = {
if (rate == 0) {
setImage(passive_icon)
- timer.stop
+ timer.stop()
label.repaint()
}
else {
val delay = 1000 / rate
timer.setInitialDelay(delay)
timer.setDelay(delay)
- timer.restart
+ timer.restart()
}
}
}
--- a/src/Tools/jEdit/src/query_dockable.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/query_dockable.scala Fri Sep 02 13:41:55 2022 +0200
@@ -12,9 +12,8 @@
import java.awt.event.{ComponentEvent, ComponentAdapter, KeyEvent}
import javax.swing.{JComponent, JTextField}
-import scala.swing.{Button, Component, TextField, CheckBox, Label, ListView,
- ComboBox, TabbedPane, BorderPanel}
-import scala.swing.event.{SelectionChanged, ButtonClicked, Key, KeyPressed}
+import scala.swing.{Component, TextField, Label, ListView, TabbedPane, BorderPanel}
+import scala.swing.event.{SelectionChanged, Key, KeyPressed}
import org.gjt.sp.jedit.View
@@ -24,7 +23,7 @@
val pretty_text_area = new Pretty_Text_Area(view)
def query_operation: Query_Operation[View]
def query: JComponent
- def select: Unit
+ def select(): Unit
def page: TabbedPane.Page
}
}
@@ -32,7 +31,7 @@
class Query_Dockable(view: View, position: String) extends Dockable(view, position) {
/* common GUI components */
- private val zoom = new Font_Info.Zoom_Box { def changed = handle_resize() }
+ private val zoom = new Font_Info.Zoom { override def changed(): Unit = handle_resize() }
private def make_query(
property: String,
@@ -71,7 +70,7 @@
/* find theorems */
- private val find_theorems = new Query_Dockable.Operation(view) {
+ private val find_theorems: Query_Dockable.Operation = new Query_Dockable.Operation(view) {
/* query */
private val process_indicator = new Process_Indicator
@@ -101,21 +100,19 @@
private val limit = new TextField(PIDE.options.int("find_theorems_limit").toString, 5) {
tooltip = "Limit of displayed results"
- verifier = (s: String) =>
- s match { case Value.Int(x) => x >= 0 case _ => false }
+ verifier = { case Value.Int(x) => x >= 0 case _ => false }
listenTo(keys)
reactions += { case KeyPressed(_, Key.Enter, 0, _) => apply_query() }
}
- private val allow_dups = new CheckBox("Duplicates") {
+ private val allow_dups = new GUI.Check("Duplicates") {
tooltip = "Show all versions of matching theorems"
- selected = false
- reactions += { case ButtonClicked(_) => apply_query() }
+ override def clicked(): Unit = apply_query()
}
- private val apply_button = new Button("<html><b>Apply</b></html>") {
+ private val apply_button = new GUI.Button("<html><b>Apply</b></html>") {
tooltip = "Find theorems meeting specified criteria"
- reactions += { case ButtonClicked(_) => apply_query() }
+ override def clicked(): Unit = apply_query()
}
private val control_panel =
@@ -124,7 +121,7 @@
process_indicator.component, apply_button,
pretty_text_area.search_label, pretty_text_area.search_field))
- def select: Unit = { control_panel.contents += zoom }
+ def select(): Unit = { control_panel.contents += zoom }
val page =
new TabbedPane.Page("Find Theorems", new BorderPanel {
@@ -136,7 +133,7 @@
/* find consts */
- private val find_consts = new Query_Dockable.Operation(view) {
+ private val find_consts: Query_Dockable.Operation = new Query_Dockable.Operation(view) {
/* query */
private val process_indicator = new Process_Indicator
@@ -162,9 +159,9 @@
/* GUI page */
- private val apply_button = new Button("<html><b>Apply</b></html>") {
+ private val apply_button = new GUI.Button("<html><b>Apply</b></html>") {
tooltip = "Find constants by name / type patterns"
- reactions += { case ButtonClicked(_) => apply_query() }
+ override def clicked(): Unit = apply_query()
}
private val control_panel =
@@ -173,7 +170,7 @@
query_label, Component.wrap(query), process_indicator.component, apply_button,
pretty_text_area.search_label, pretty_text_area.search_field))
- def select: Unit = { control_panel.contents += zoom }
+ def select(): Unit = { control_panel.contents += zoom }
val page =
new TabbedPane.Page("Find Constants", new BorderPanel {
@@ -188,25 +185,24 @@
private val print_operation = new Query_Dockable.Operation(view) {
/* items */
- private class Item(val name: String, description: String, sel: Boolean) {
- val checkbox = new CheckBox(name) {
+ private class Item(val name: String, description: String, selected: Boolean) {
+ val gui: GUI.Check = new GUI.Check(name, init = selected) {
tooltip = "Print " + description
- selected = sel
- reactions += { case ButtonClicked(_) => apply_query() }
+ override def clicked(): Unit = apply_query()
}
}
private var _items: List[Item] = Nil
private def selected_items(): List[String] =
- for (item <- _items if item.checkbox.selected) yield item.name
+ for (item <- _items if item.gui.selected) yield item.name
private def update_items(): List[Item] = {
val old_items = _items
def was_selected(name: String): Boolean =
old_items.find(item => item.name == name) match {
case None => false
- case Some(item) => item.checkbox.selected
+ case Some(item) => item.gui.selected
}
_items =
@@ -237,23 +233,24 @@
/* GUI page */
- private val apply_button = new Button("<html><b>Apply</b></html>") {
+ private val apply_button = new GUI.Button("<html><b>Apply</b></html>") {
tooltip = "Apply to current context"
+ override def clicked(): Unit = apply_query()
+
listenTo(keys)
reactions += {
- case ButtonClicked(_) => apply_query()
case evt @ KeyPressed(_, Key.Enter, 0, _) =>
- evt.peer.consume
+ evt.peer.consume()
apply_query()
}
}
private val control_panel = Wrap_Panel()
- def select: Unit = {
+ def select(): Unit = {
control_panel.contents.clear()
control_panel.contents += query_label
- update_items().foreach(item => control_panel.contents += item.checkbox)
+ update_items().foreach(item => control_panel.contents += item.gui)
control_panel.contents ++=
List(process_indicator.component, apply_button,
pretty_text_area.search_label, pretty_text_area.search_field, zoom)
@@ -282,7 +279,7 @@
catch { case _: IndexOutOfBoundsException => None }
private def select_operation(): Unit = {
- for (op <- get_operation()) { op.select; op.query.requestFocus() }
+ for (op <- get_operation()) { op.select(); op.query.requestFocus() }
operations_pane.revalidate()
}
@@ -304,10 +301,7 @@
private def handle_resize(): Unit =
GUI_Thread.require {
- for (op <- operations) {
- op.pretty_text_area.resize(
- Font_Info.main(PIDE.options.real("jedit_font_scale") * zoom.factor / 100))
- }
+ if (operations != null) operations.foreach(_.pretty_text_area.zoom(zoom))
}
private val delay_resize =
--- a/src/Tools/jEdit/src/session_build.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/session_build.scala Fri Sep 02 13:41:55 2022 +0200
@@ -12,9 +12,7 @@
import java.awt.event.{WindowEvent, WindowAdapter}
import javax.swing.{WindowConstants, JDialog}
-import scala.swing.{ScrollPane, Button, CheckBox, FlowPanel,
- BorderPanel, TextArea, Component, Label}
-import scala.swing.event.ButtonClicked
+import scala.swing.{ScrollPane, FlowPanel, BorderPanel, TextArea, Component, Label}
import org.gjt.sp.jedit.View
@@ -97,7 +95,7 @@
Delay.first(Time.seconds(1.0), gui = true) {
if (can_auto_close) conclude()
else {
- val button = new Button("Close") { reactions += { case ButtonClicked(_) => conclude() } }
+ val button = new GUI.Button("Close") { override def clicked(): Unit = conclude() }
set_actions(button)
button.peer.getRootPane.setDefaultButton(button.peer)
}
@@ -125,21 +123,20 @@
set_actions(new Label("Stopping ..."))
}
- private val stop_button = new Button("Stop") {
- reactions += { case ButtonClicked(_) => stopping() }
+ private val stop_button = new GUI.Button("Stop") {
+ override def clicked(): Unit = stopping()
}
private var do_auto_close = true
private def can_auto_close: Boolean = do_auto_close && _return_code == Some(0)
- private val auto_close = new CheckBox("Auto close") {
- reactions += {
- case ButtonClicked(_) => do_auto_close = this.selected
+ private val auto_close = new GUI.Check("Auto close", init = do_auto_close) {
+ tooltip = "Automatically close dialog when finished"
+ override def clicked(state: Boolean): Unit = {
+ do_auto_close = state
if (can_auto_close) conclude()
}
}
- auto_close.selected = do_auto_close
- auto_close.tooltip = "Automatically close dialog when finished"
set_actions(stop_button, auto_close)
@@ -155,7 +152,8 @@
setVisible(true)
Isabelle_Thread.fork(name = "session_build") {
- progress.echo("Build started for Isabelle/" + PIDE.resources.session_name + " ...")
+ progress.echo("Build started for Isabelle/" +
+ PIDE.resources.session_base.session_name + " ...")
val (out, rc) =
try { ("", JEdit_Sessions.session_build(options, progress = progress)) }
--- a/src/Tools/jEdit/src/simplifier_trace_dockable.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/simplifier_trace_dockable.scala Fri Sep 02 13:41:55 2022 +0200
@@ -9,8 +9,7 @@
import isabelle._
-import scala.swing.{Button, CheckBox, Orientation, Separator}
-import scala.swing.event.ButtonClicked
+import scala.swing.{Orientation, Separator}
import java.awt.BorderLayout
import java.awt.event.{ComponentEvent, ComponentAdapter}
@@ -45,11 +44,9 @@
val content = Pretty.separate(XML.Text(data.text) :: data.content)
text_area.update(snapshot, Command.Results.empty, content)
q.answers.foreach { answer =>
- answers.contents += new Button(answer.string) {
- reactions += {
- case ButtonClicked(_) =>
- Simplifier_Trace.send_reply(PIDE.session, data.serial, answer)
- }
+ answers.contents += new GUI.Button(answer.string) {
+ override def clicked(): Unit =
+ Simplifier_Trace.send_reply(PIDE.session, data.serial, answer)
}
}
case Nil =>
@@ -146,32 +143,17 @@
private val controls =
Wrap_Panel(
List(
- new CheckBox("Auto update") {
- selected = do_update
- reactions += {
- case ButtonClicked(_) =>
- do_update = this.selected
- handle_update(do_update)
+ new GUI.Check("Auto update", init = do_update) {
+ override def clicked(state: Boolean): Unit = {
+ do_update = state
+ handle_update(do_update)
}
},
- new Button("Update") {
- reactions += {
- case ButtonClicked(_) =>
- handle_update(true)
- }
- },
+ new GUI.Button("Update") { override def clicked(): Unit = handle_update(true) },
new Separator(Orientation.Vertical),
- new Button("Show trace") {
- reactions += {
- case ButtonClicked(_) =>
- show_trace()
- }
- },
- new Button("Clear memory") {
- reactions += {
- case ButtonClicked(_) =>
- Simplifier_Trace.clear_memory(PIDE.session)
- }
+ new GUI.Button("Show trace") { override def clicked(): Unit = show_trace() },
+ new GUI.Button("Clear memory") {
+ override def clicked(): Unit = Simplifier_Trace.clear_memory(PIDE.session)
}))
private val answers = Wrap_Panel(Nil, Wrap_Panel.Alignment.Left)
--- a/src/Tools/jEdit/src/simplifier_trace_window.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/simplifier_trace_window.scala Fri Sep 02 13:41:55 2022 +0200
@@ -11,7 +11,7 @@
import scala.annotation.tailrec
import scala.collection.immutable.SortedMap
-import scala.swing.{BorderPanel, CheckBox, Component, Dimension, Frame, Label, TextField}
+import scala.swing.{BorderPanel, Component, Dimension, Frame, Label, TextField}
import scala.swing.event.{Key, KeyPressed}
import scala.util.matching.Regex
@@ -133,7 +133,7 @@
GUI_Thread.require {}
private val pretty_text_area = new Pretty_Text_Area(view)
- private val zoom = new Font_Info.Zoom_Box { def changed = do_paint() }
+ private val zoom = new Font_Info.Zoom { override def changed(): Unit = do_paint() }
size = new Dimension(500, 500)
contents = new BorderPanel {
@@ -158,12 +158,8 @@
pretty_text_area.update(snapshot, Command.Results.empty, xml)
}
- def do_paint(): Unit = {
- GUI_Thread.later {
- pretty_text_area.resize(
- Font_Info.main(PIDE.options.real("jedit_font_scale") * zoom.factor / 100))
- }
- }
+ def do_paint(): Unit =
+ GUI_Thread.later { pretty_text_area.zoom(zoom) }
def handle_resize(): Unit = do_paint()
--- a/src/Tools/jEdit/src/sledgehammer_dockable.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/sledgehammer_dockable.scala Fri Sep 02 13:41:55 2022 +0200
@@ -9,8 +9,7 @@
import isabelle._
-import scala.swing.{Button, Component, Label, CheckBox}
-import scala.swing.event.ButtonClicked
+import scala.swing.{Component, Label}
import java.awt.BorderLayout
import java.awt.event.{ComponentEvent, ComponentAdapter, KeyEvent}
@@ -62,17 +61,13 @@
override def componentShown(e: ComponentEvent): Unit = delay_resize.invoke()
})
- private def handle_resize(): Unit = {
- GUI_Thread.require {}
-
- pretty_text_area.resize(
- Font_Info.main(PIDE.options.real("jedit_font_scale") * zoom.factor / 100))
- }
+ private def handle_resize(): Unit =
+ GUI_Thread.require { pretty_text_area.zoom(zoom) }
/* controls */
- private def clicked: Unit = {
+ private def hammer(): Unit = {
provers.addCurrentToHistory()
PIDE.options.string("sledgehammer_provers") = provers.getText
sledgehammer.apply_query(
@@ -88,7 +83,7 @@
private val provers = new HistoryTextField("isabelle-sledgehammer-provers") {
override def processKeyEvent(evt: KeyEvent): Unit = {
- if (evt.getID == KeyEvent.KEY_PRESSED && evt.getKeyCode == KeyEvent.VK_ENTER) clicked
+ if (evt.getID == KeyEvent.KEY_PRESSED && evt.getKeyCode == KeyEvent.VK_ENTER) hammer()
super.processKeyEvent(evt)
}
setToolTipText(provers_label.tooltip)
@@ -104,32 +99,30 @@
}
}
- private val isar_proofs = new CheckBox("Isar proofs") {
+ private val isar_proofs = new GUI.Check("Isar proofs") {
tooltip = "Specify whether Isar proofs should be output in addition to \"by\" one-liner"
- selected = false
}
- private val try0 = new CheckBox("Try methods") {
+ private val try0 = new GUI.Check("Try methods", init = true) {
tooltip = "Try standard proof methods like \"auto\" and \"blast\" as alternatives to \"metis\""
- selected = true
}
- private val apply_query = new Button("<html><b>Apply</b></html>") {
+ private val apply_query = new GUI.Button("<html><b>Apply</b></html>") {
tooltip = "Search for first-order proof using automatic theorem provers"
- reactions += { case ButtonClicked(_) => clicked }
+ override def clicked(): Unit = hammer()
}
- private val cancel_query = new Button("Cancel") {
+ private val cancel_query = new GUI.Button("Cancel") {
tooltip = "Interrupt unfinished sledgehammering"
- reactions += { case ButtonClicked(_) => sledgehammer.cancel_query() }
+ override def clicked(): Unit = sledgehammer.cancel_query()
}
- private val locate_query = new Button("Locate") {
+ private val locate_query = new GUI.Button("Locate") {
tooltip = "Locate context of current query within source text"
- reactions += { case ButtonClicked(_) => sledgehammer.locate_query() }
+ override def clicked(): Unit = sledgehammer.locate_query()
}
- private val zoom = new Font_Info.Zoom_Box { def changed = handle_resize() }
+ private val zoom = new Font_Info.Zoom { override def changed(): Unit = handle_resize() }
private val controls =
Wrap_Panel(
--- a/src/Tools/jEdit/src/state_dockable.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/state_dockable.scala Fri Sep 02 13:41:55 2022 +0200
@@ -9,9 +9,6 @@
import isabelle._
-import scala.swing.{Button, CheckBox}
-import scala.swing.event.ButtonClicked
-
import java.awt.BorderLayout
import java.awt.event.{ComponentEvent, ComponentAdapter}
@@ -45,12 +42,8 @@
override def componentShown(e: ComponentEvent): Unit = delay_resize.invoke()
})
- private def handle_resize(): Unit = {
- GUI_Thread.require {}
-
- pretty_text_area.resize(
- Font_Info.main(PIDE.options.real("jedit_font_scale") * zoom.factor / 100))
- }
+ private def handle_resize(): Unit =
+ GUI_Thread.require { pretty_text_area.zoom(zoom) }
/* update */
@@ -82,23 +75,25 @@
/* controls */
- private val auto_update_button = new CheckBox("Auto update") {
+ private val auto_update_button = new GUI.Check("Auto update", init = auto_update_enabled) {
tooltip = "Indicate automatic update following cursor movement"
- reactions += { case ButtonClicked(_) => auto_update_enabled = this.selected; auto_update() }
- selected = auto_update_enabled
+ override def clicked(state: Boolean): Unit = {
+ auto_update_enabled = state
+ auto_update()
+ }
}
- private val update_button = new Button("<html><b>Update</b></html>") {
+ private val update_button = new GUI.Button("<html><b>Update</b></html>") {
tooltip = "Update display according to the command at cursor position"
- reactions += { case ButtonClicked(_) => update_request() }
+ override def clicked(): Unit = update_request()
}
- private val locate_button = new Button("Locate") {
+ private val locate_button = new GUI.Button("Locate") {
tooltip = "Locate printed command within source text"
- reactions += { case ButtonClicked(_) => print_state.locate_query() }
+ override def clicked(): Unit = print_state.locate_query()
}
- private val zoom = new Font_Info.Zoom_Box { def changed = handle_resize() }
+ private val zoom = new Font_Info.Zoom { override def changed(): Unit = handle_resize() }
private val controls =
Wrap_Panel(
--- a/src/Tools/jEdit/src/syntax_style.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/syntax_style.scala Fri Sep 02 13:41:55 2022 +0200
@@ -103,10 +103,12 @@
AffineTransform.getScaleInstance(2.0, font0.getSize.toDouble)))
new_styles(control) =
new SyntaxStyle(style0.getForegroundColor, style0.getBackgroundColor,
- { val font_style =
+ {
+ val font_style =
(if (font0.isItalic) 0 else Font.ITALIC) |
(if (font0.isBold) 0 else Font.BOLD)
- new Font(font0.getFamily, font_style, font0.getSize) })
+ new Font(font0.getFamily, font_style, font0.getSize)
+ })
new_styles
}
}
--- a/src/Tools/jEdit/src/theories_dockable.scala Sat Jun 25 13:34:41 2022 +0200
+++ b/src/Tools/jEdit/src/theories_dockable.scala Fri Sep 02 13:41:55 2022 +0200
@@ -11,7 +11,7 @@
import scala.swing.{Button, TextArea, Label, ListView, Alignment,
ScrollPane, Component, CheckBox, BorderPanel}
-import scala.swing.event.{ButtonClicked, MouseClicked, MouseMoved}
+import scala.swing.event.{MouseClicked, MouseMoved}
import java.awt.{BorderLayout, Graphics2D, Color, Point, Dimension}
import javax.swing.{JList, BorderFactory, UIManager}
@@ -43,9 +43,9 @@
case MouseMoved(_, point, _) =>
val index = peer.locationToIndex(point)
val index_location = peer.indexToLocation(index)
- if (index >= 0 && in_checkbox(index_location, point))
+ if (index >= 0 && in_checkbox(index_location, point)) {
tooltip = "Mark as required for continuous checking"
- else if (index >= 0 && in_label(index_location, point)) {
+ } else if (index >= 0 && in_label(index_location, point)) {
val name = listData(index)
val st = nodes_status.overall_node_status(name)
tooltip =
@@ -75,15 +75,15 @@
session_phase.text = " " + phase_text(phase) + " "
}
- private val purge = new Button("Purge") {
+ private val purge = new GUI.Button("Purge") {
tooltip = "Restrict document model to theories required for open editor buffers"
- reactions += { case ButtonClicked(_) => PIDE.editor.purge() }
+ override def clicked(): Unit = PIDE.editor.purge()
}
- private val continuous_checking = new Isabelle.Continuous_Checking
+ private val continuous_checking = new JEdit_Options.continuous_checking.GUI
continuous_checking.focusable = false
- private val logic = JEdit_Sessions.logic_selector(PIDE.options, true)
+ private val logic = JEdit_Sessions.logic_selector(PIDE.options, autosave = true)
private val controls =
Wrap_Panel(List(purge, continuous_checking, session_phase, logic))
@@ -96,39 +96,48 @@
private var nodes_status = Document_Status.Nodes_Status.empty
private var nodes_required: Set[Document.Node.Name] = Document_Model.required_nodes()
- private def in(geometry: Option[(Point, Dimension)], loc0: Point, p: Point): Boolean =
- geometry match {
- case Some((loc, size)) =>
- loc0.x + loc.x <= p.x && p.x < loc0.x + size.width &&
- loc0.y + loc.y <= p.y && p.y < loc0.y + size.height
- case None => false
+ private class Geometry {
+ private var location: Point = null
+ private var size: Dimension = null
+
+ def in(location0: Point, p: Point): Boolean = {
+ location != null && size != null &&
+ location0.x + location.x <= p.x && p.x < location0.x + size.width &&
+ location0.y + location.y <= p.y && p.y < location0.y + size.height
}
- private def in_checkbox(loc0: Point, p: Point): Boolean =
- Node_Renderer_Component != null && in(Node_Renderer_Component.checkbox_geometry, loc0, p)
+ def update(new_location: Point, new_size: Dimension): Unit = {
+ if (new_location != null && new_size != null) {
+ location = new_location
+ size = new_size
+ }
+ }
+ }
- private def in_label(loc0: Point, p: Point): Boolean =
- Node_Renderer_Component != null && in(Node_Renderer_Component.label_geometry, loc0, p)
+ private def in_checkbox(location0: Point, p: Point): Boolean =
+ Node_Renderer_Component != null && Node_Renderer_Component.checkbox_geometry.in(location0, p)
+
+ private def in_label(location0: Point, p: Point): Boolean =
+ Node_Renderer_Component != null && Node_Renderer_Component.label_geometry.in(location0, p)
private object Node_Renderer_Component extends BorderPanel {
opaque = true
border = BorderFactory.createEmptyBorder(2, 2, 2, 2)
- var node_name = Document.Node.Name.empty
+ var node_name: Document.Node.Name = Document.Node.Name.empty
- var checkbox_geometry: Option[(Point, Dimension)] = None
- val checkbox = new CheckBox {
+ val checkbox_geometry = new Geometry
+ val checkbox: CheckBox = new CheckBox {
opaque = false
override def paintComponent(gfx: Graphics2D): Unit = {
super.paintComponent(gfx)
- if (location != null && size != null)
- checkbox_geometry = Some((location, size))
+ checkbox_geometry.update(location, size)
}
}
- var label_geometry: Option[(Point, Dimension)] = None
- val label = new Label {
+ val label_geometry = new Geometry
+ val label: Label = new Label {
background = view.getTextArea.getPainter.getBackground
foreground = view.getTextArea.getPainter.getForeground
opaque = false
@@ -163,8 +172,7 @@
}
super.paintComponent(gfx)
- if (location != null && size != null)
- label_geometry = Some((location, size))
+ label_geometry.update(location, size)
}
}
--- a/src/ZF/ROOT Sat Jun 25 13:34:41 2022 +0200
+++ b/src/ZF/ROOT Fri Sep 02 13:41:55 2022 +0200
@@ -1,4 +1,4 @@
-chapter ZF
+chapter FOL
session ZF (main timing) = Pure +
description "