summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile10
-rw-r--r--docs/content-addressed-phase0.md220
-rw-r--r--latex/stdlib.tex5
-rw-r--r--library/algebra/magma.tex7
-rw-r--r--library/algebra/monoid.tex5
-rw-r--r--library/algebra/quasigroup.tex30
-rw-r--r--library/algebra/semigroup.tex43
-rw-r--r--library/everything.tex7
-rw-r--r--library/order/order.tex61
-rw-r--r--library/order/quasiorder.tex43
-rw-r--r--library/order/semilattice.tex19
-rw-r--r--library/ordinal.tex262
-rw-r--r--library/relation/closure.tex3
-rw-r--r--library/relation/equivalence.tex94
-rw-r--r--library/set.tex16
-rw-r--r--library/set/cons.tex6
-rw-r--r--library/set/equinumerosity.tex37
-rw-r--r--library/status.md211
-rw-r--r--library/topology/basis.tex105
-rw-r--r--library/topology/disconnection.tex18
-rw-r--r--library/topology/preclosure.tex14
-rw-r--r--library/topology/separation.tex23
-rw-r--r--library/topology/topological-space.tex375
-rw-r--r--readme.md47
-rw-r--r--source/Api.hs2074
-rw-r--r--source/Checking.hs4265
-rw-r--r--source/Checking/Backend/Connection.hs1088
-rw-r--r--source/Checking/Backend/Reconstruction.hs253
-rw-r--r--source/Checking/Core.hs217
-rw-r--r--source/Checking/Datatype.hs48
-rw-r--r--source/Checking/Declaration.hs982
-rw-r--r--source/Checking/Dependencies.hs189
-rw-r--r--source/Checking/Exact.hs1121
-rw-r--r--source/Checking/Exact/Global.hs10
-rw-r--r--source/Checking/Exact/Inductive.hs2
-rw-r--r--source/Checking/Exact/Proof.hs108
-rw-r--r--source/Checking/Facts.hs340
-rw-r--r--source/Checking/FinalPrelude.hs170
-rw-r--r--source/Checking/Legacy.hs1788
-rw-r--r--source/Checking/Legacy/Environment.hs279
-rw-r--r--source/Checking/Module.hs375
-rw-r--r--source/Checking/Obligation.hs428
-rw-r--r--source/Checking/Semantic.hs333
-rw-r--r--source/Checking/Structure.hs150
-rw-r--r--source/Checking/Transition.hs2584
-rw-r--r--source/Checking/Typed/Atomic.hs72
-rw-r--r--source/Checking/Typed/Reflexivity.hs105
-rw-r--r--source/CommandLine.hs248
-rw-r--r--source/Encoding.hs588
-rw-r--r--source/Felix/Cache/Codec.hs2
-rw-r--r--source/Felix/Migration.hs284
-rw-r--r--source/Felix/Parse.hs147
-rw-r--r--source/Felix/Prelude.hs200
-rw-r--r--source/Felix/Source.hs20
-rw-r--r--source/Felix/Store.hs189
-rw-r--r--source/Filter.hs211
-rw-r--r--source/Provers.hs642
-rw-r--r--source/Render/Html.hs169
-rw-r--r--source/Render/Html/Context.hs64
-rw-r--r--source/Render/Html/Export.hs213
-rw-r--r--source/Render/Html/Layout.hs15
-rw-r--r--source/Render/Html/Output.hs315
-rw-r--r--source/StructGraph.hs125
-rw-r--r--source/Syntax/Internal.hs47
-rw-r--r--source/Syntax/Token.hs2
-rw-r--r--source/Test/Golden.hs43
-rw-r--r--source/Test/Unit.hs17
-rw-r--r--source/Test/Unit/Backend.hs245
-rw-r--r--source/Test/Unit/Checking.hs1982
-rw-r--r--source/Test/Unit/CommandLine.hs181
-rw-r--r--source/Test/Unit/Core.hs127
-rw-r--r--source/Test/Unit/Declaration.hs108
-rw-r--r--source/Test/Unit/Encoding.hs363
-rw-r--r--source/Test/Unit/Html.hs47
-rw-r--r--source/Test/Unit/HtmlOutput.hs114
-rw-r--r--source/Test/Unit/Kernel.hs8
-rw-r--r--source/Test/Unit/Migration.hs161
-rw-r--r--source/Test/Unit/Module.hs2665
-rw-r--r--source/Test/Unit/Provers.hs287
-rw-r--r--source/Test/Unit/Semantic.hs56
-rw-r--r--source/Test/Unit/Source.hs1930
-rw-r--r--source/Test/Unit/Store.hs26
-rw-r--r--source/Test/Unit/Symdiff.hs132
-rw-r--r--source/Test/Unit/Token.hs20
-rw-r--r--source/Tptp/UnsortedFirstOrder.hs4
-rw-r--r--test/golden/abbr/encoding tasks.golden26
-rw-r--r--test/golden/abbr/generating tasks.golden1307
-rw-r--r--test/golden/abbr/glossing.golden519
-rw-r--r--test/golden/abbr/verification.golden11
-rw-r--r--test/golden/byRef/encoding tasks.golden22
-rw-r--r--test/golden/byRef/generating tasks.golden519
-rw-r--r--test/golden/byRef/glossing.golden245
-rw-r--r--test/golden/byRef/verification.golden11
-rw-r--r--test/golden/calc/encoding tasks.golden58
-rw-r--r--test/golden/calc/generating tasks.golden1775
-rw-r--r--test/golden/calc/glossing.golden574
-rw-r--r--test/golden/calc/verification.golden11
-rw-r--r--test/golden/coord/encoding tasks.golden53
-rw-r--r--test/golden/coord/generating tasks.golden3498
-rw-r--r--test/golden/coord/glossing.golden818
-rw-r--r--test/golden/coord/verification.golden11
-rw-r--r--test/golden/datatype/encoding tasks.golden69
-rw-r--r--test/golden/datatype/generating tasks.golden8698
-rw-r--r--test/golden/datatype/glossing.golden656
-rw-r--r--test/golden/datatype/verification.golden11
-rw-r--r--test/golden/finite-set-terms/encoding tasks.golden3
-rw-r--r--test/golden/finite-set-terms/generating tasks.golden291
-rw-r--r--test/golden/finite-set-terms/glossing.golden238
-rw-r--r--test/golden/finite-set-terms/verification.golden11
-rw-r--r--test/golden/formula/encoding tasks.golden8
-rw-r--r--test/golden/formula/generating tasks.golden331
-rw-r--r--test/golden/formula/glossing.golden189
-rw-r--r--test/golden/formula/verification.golden11
-rw-r--r--test/golden/geometry/encoding tasks.golden109
-rw-r--r--test/golden/geometry/generating tasks.golden17323
-rw-r--r--test/golden/geometry/glossing.golden2775
-rw-r--r--test/golden/geometry/verification.golden11
-rw-r--r--test/golden/indefinite-terms/encoding tasks.golden4
-rw-r--r--test/golden/indefinite-terms/generating tasks.golden28
-rw-r--r--test/golden/indefinite-terms/glossing.golden31
-rw-r--r--test/golden/indefinite-terms/verification.golden11
-rw-r--r--test/golden/inductive/encoding tasks.golden1
-rw-r--r--test/golden/inductive/generating tasks.golden59
-rw-r--r--test/golden/inductive/glossing.golden86
-rw-r--r--test/golden/inductive/verification.golden11
-rw-r--r--test/golden/no-reflexive-set/encoding tasks.golden2
-rw-r--r--test/golden/no-reflexive-set/generating tasks.golden110
-rw-r--r--test/golden/no-reflexive-set/glossing.golden83
-rw-r--r--test/golden/no-reflexive-set/verification.golden11
-rw-r--r--test/golden/proofassume/encoding tasks.golden17
-rw-r--r--test/golden/proofassume/generating tasks.golden411
-rw-r--r--test/golden/proofassume/glossing.golden323
-rw-r--r--test/golden/proofassume/verification.golden11
-rw-r--r--test/golden/proofdefinefunction/encoding tasks.golden9
-rw-r--r--test/golden/proofdefinefunction/generating tasks.golden473
-rw-r--r--test/golden/proofdefinefunction/glossing.golden231
-rw-r--r--test/golden/proofdefinefunction/verification.golden11
-rw-r--r--test/golden/prooffix/encoding tasks.golden4
-rw-r--r--test/golden/prooffix/generating tasks.golden85
-rw-r--r--test/golden/prooffix/glossing.golden98
-rw-r--r--test/golden/prooffix/verification.golden11
-rw-r--r--test/golden/relation-notation/encoding tasks.golden1
-rw-r--r--test/golden/relation-notation/generating tasks.golden110
-rw-r--r--test/golden/relation-notation/glossing.golden111
-rw-r--r--test/golden/relation-notation/verification.golden11
-rw-r--r--test/golden/relparam/encoding tasks.golden4
-rw-r--r--test/golden/relparam/generating tasks.golden109
-rw-r--r--test/golden/relparam/glossing.golden185
-rw-r--r--test/golden/relparam/verification.golden11
-rw-r--r--test/golden/replace/encoding tasks.golden17
-rw-r--r--test/golden/replace/generating tasks.golden2241
-rw-r--r--test/golden/replace/glossing.golden572
-rw-r--r--test/golden/replace/verification.golden11
-rw-r--r--test/golden/russell/encoding tasks.golden16
-rw-r--r--test/golden/russell/generating tasks.golden864
-rw-r--r--test/golden/russell/glossing.golden271
-rw-r--r--test/golden/russell/verification.golden11
-rw-r--r--test/golden/separation/encoding tasks.golden1
-rw-r--r--test/golden/separation/generating tasks.golden100
-rw-r--r--test/golden/separation/glossing.golden60
-rw-r--r--test/golden/separation/verification.golden11
-rw-r--r--test/golden/union/encoding tasks.golden21
-rw-r--r--test/golden/union/generating tasks.golden2039
-rw-r--r--test/golden/union/glossing.golden734
-rw-r--r--test/golden/union/verification.golden11
-rw-r--r--test/phase3/gloss-imported.tex3
-rw-r--r--test/phase3/gloss-root.tex9
-rw-r--r--test/phase3/legacy-importer.tex3
-rw-r--r--test/phase3/typed-importer.tex3
-rw-r--r--test/phase5/exact-contextual-abbreviation-ambiguous.tex17
-rw-r--r--test/phase5/exact-contextual-abbreviation-consumer.tex11
-rw-r--r--test/phase5/exact-contextual-abbreviation-missing.tex6
-rw-r--r--test/phase5/exact-contextual-abbreviation.tex56
-rw-r--r--test/phase5/exact-local-function-failure.tex8
-rw-r--r--test/phase5/exact-local-function.tex18
-rw-r--r--test/phase5/exact-structure-child.tex8
-rw-r--r--test/phase5/exact-structure.tex27
-rw-r--r--test/phase6/admitted-prefix-failure.tex28
-rw-r--r--test/phase7/concurrent-earlier.tex11
-rw-r--r--test/phase7/concurrent-failure-root.tex10
-rw-r--r--test/phase7/concurrent-later.tex11
-rw-r--r--test/phase7/dependent-proof-chain.tex11
-rw-r--r--test/phase7/diamond-base.tex3
-rw-r--r--test/phase7/diamond-left.tex5
-rw-r--r--test/phase7/diamond-right.tex5
-rw-r--r--test/phase7/diamond-root.tex6
-rw-r--r--test/phase7/structure-obligation-batch.tex16
187 files changed, 9499 insertions, 71250 deletions
diff --git a/Makefile b/Makefile
index f25df9a..8f5fdb1 100644
--- a/Makefile
+++ b/Makefile
@@ -3,10 +3,18 @@ all: test lib
DEPLOY_DEST ?= vps:/var/www/naproche.org/
RSYNC_FLAGS ?= -az --delete-delay --itemize-changes --exclude=".DS_Store"
+TYPED_LIBRARY_ROOT := library/everything.tex
+
+# The active aggregate covers the complete production library graph.
.PHONY: lib
lib:
stack build
- time stack exec zf -- --fresh --log library/everything.tex -t 17
+ @set -e; \
+ store_dir="$$(mktemp -d "$${TMPDIR:-/tmp}/felix-lib.XXXXXX")"; \
+ trap 'rm -rf "$$store_dir"' EXIT; \
+ printf 'Verifying %s\n' "$(TYPED_LIBRARY_ROOT)"; \
+ time stack exec zf -- --store "$$store_dir/store.sqlite" \
+ --log "$(TYPED_LIBRARY_ROOT)" -t 20
.PHONY: dump
dump:
diff --git a/docs/content-addressed-phase0.md b/docs/content-addressed-phase0.md
deleted file mode 100644
index 7271674..0000000
--- a/docs/content-addressed-phase0.md
+++ /dev/null
@@ -1,220 +0,0 @@
-# Content-addressed migration inventory
-
-This file records the implementation inventory frozen at Phase 0. The
-normative contracts remain `design.md`, `syntax.md`, `prelude.md`,
-`execution.md`, and `store.md` in the Felix design workspace.
-
-## Revisions and workload
-
-- Implementation anchor:
- `77d892c3a9213acc1be23ef545f316acb87b8c9a` (`Clean lib`).
-- Historical uncached reference:
- `108b963ebe395ec7c75234e5069c31732531fc97`.
-- Active root: `(MigrationLibrary, everything.tex)`.
-- The historical and anchor source closures contain the same 31 modules in
- imported-before-importer order:
-
-```text
-set.tex
-set/cons.tex
-set/symdiff.tex
-set/product.tex
-set/powerset.tex
-set/bipartition.tex
-set/partition.tex
-relation.tex
-relation/uniqueness.tex
-function.tex
-set/cantor.tex
-set/filter.tex
-set/fixpoint.tex
-relation/properties.tex
-order/quasiorder.tex
-relation/equivalence.tex
-relation/closure.tex
-set/regularity.tex
-set/suc.tex
-ordinal.tex
-nat.tex
-cardinal.tex
-algebra/magma.tex
-algebra/semigroup.tex
-algebra/monoid.tex
-order/order.tex
-topology/topological-space.tex
-topology/basis.tex
-topology/disconnection.tex
-topology/separation.tex
-everything.tex
-```
-
-The active source contains 74 abbreviations, 17 axioms, 14 corollaries,
-92 definitions, 19 lemmas, 552 propositions, four signatures, nine structures,
-and four theorems. It contains no active datatype or inductive declaration.
-There are 366 top-level proof environments. These are migration coverage
-counts, not semantic identity inputs.
-
-## Source and path conventions
-
-`ResolvedSource` carries four separate values: selected canonical file,
-invocation-local mount ID, canonical mount root, and validated mount-relative
-path. Durable ownership will use only the canonical root and relative path.
-The mount ID remains routing and presentation data.
-
-The absolute and relative path codecs, `SourceNamespaceId`, `ModuleName`,
-zero-based `LocalDeclarationOrdinal`, zero-based `GeneratedObjectSlot`, and
-the closed declaration-family tags are frozen in `design.md`. Golden path
-inputs are `/`, `/a`, `/a/b`, `a`, and `a/b`. No identity is computed in
-Phase 0.
-
-The transitional `Felix.Migration` manifest contains only closed mount roles
-and safe relative paths. It must be deleted with the legacy driver.
-
-## Prelude reservation
-
-- Reserved source: Cabal/Hpack data file `data/felix-prelude.tex`.
-- Reserved logical owner: `PreludeModuleName` from `prelude.md`.
-- Diagnostic label: `<felix-prelude>`.
-- Bootstrap bytes: the empty byte string.
-- Loading seam: generated `Paths_felix.getDataFileName`.
-
-The checked-in file is a non-authoritative, comment-only skeleton. It exposes
-the required definition, abbreviation, proposition, and proof families and the
-Empty-to-Omega dependency shape without acting as a builtin, checked module, or
-authority source.
-
-The machine-readable expected public roles are Infinity, the transparent
-Omega object and defining equation, the `naturals` alias, and the inductiveness
-and minimality theorems. Helper declaration names are not frozen.
-
-## Literal base syntax and dynamic insertion
-
-`Syntax.Lexicon.builtinMixfixLevels` is the exact ten-row manifest:
-
-| Level | Associativity | Entries |
-| --- | --- | --- |
-| 0 | — | empty |
-| 1 | left | `+`, `\union`, `-`, `\rminus`, `\monus` |
-| 2 | left | `\relcomp` |
-| 3 | left | `\circ` |
-| 4 | left | `\mul`, `\inter`, `\rmul` |
-| 5 | left | `\setminus` |
-| 6 | right | `\times` |
-| 7 | — | empty |
-| 8 | non-associative | `\rfrac`, `\exp`, `\unions`, `\cumul`, `\fst`, `\snd`, `\pow`, `\neg`, `\inv`, `\abs`, `\cons`, ordered pair |
-| 9 | non-associative | `\emptyset`, `\naturals`, `\naturalsPlus`, `\integers`, `\rationals`, `\reals`, `\unit`, `\zero` |
-
-Current dynamic syntax enters through `Syntax.Adapt.scanSyntaxDelta`,
-closure-wide `buildSyntaxWorld`, and `insertScannedItem`. Every scanned
-function/mixfix pattern is currently appended to row 9 as non-associative.
-`Felix.Parse.parseResolvedSourceGraphMeasuredWith` builds one closure-wide
-world before parsing. Phase 1.1 replaces these insertion and composition
-points with complete per-module entries and independent interfaces.
-
-## Legacy publisher and consumer inventory
-
-`Checking.Legacy.LegacyFactProducer` is the closed current publisher
-inventory:
-
-- declared assumptions, distinguished by `AssumptionKind`;
-- direct proof obligations discharged by Vampire or a gap; and
-- declaration rules for ordinary theorem finalization, definition equations,
- datatype introduction/distinctness/injectivity/cases/induction, structure
- introduction/inheritance/assumptions, and inductive
- introduction/domain-subset/cases/induction.
-
-`Checking.checkBlocks` selects the producer at each declaration boundary.
-`finalizeLegacyDeclaration` reserves and appends the complete fact batch.
-`Checking.Legacy` assigns invocation-local module/fact positions, merges
-imported environments and fact registries, and seals modules. The legacy facts
-feed proof lookup, premise selection, TPTP task construction, trust reporting,
-HTML/checker presentation, and the temporary `Checking.Transition` bridge.
-The transition bridge separately publishes the currently typed signatures,
-inductive objects/facts, exact typed Vampire results, and kernel facts.
-
-No publisher outside those inventories may be silently carried into the typed
-driver.
-
-## Checker and builder mutation coverage
-
-The following state affects later checking and therefore requires an explicit
-closed semantic-environment delta or deterministic reconstruction:
-
-| Current state | Phase-1 classification |
-| --- | --- |
-| fact statements, aliases, origins, public authority | explicit fact occurrences and aliases; registry indexes derived |
-| abbreviations | explicit |
-| predicate definitions | explicit |
-| symbol dependencies | explicit |
-| symbol ownership and object markers | explicit ownership rows; marker set derived where exact |
-| frozen symbols | explicit |
-| structure graph | explicit structure-family delta |
-| defined declaration markers | explicit occurrence/alias collision data |
-| typed global bindings and transparent bodies | explicit canonical object records and bindings |
-| local typed fact entries and direct axiom kind | explicit canonical facts and authority |
-| imported environment/interface lists | explicit ordered direct interface IDs |
-| next declaration/fact counters | derived from ordered committed rows |
-| fact/global lookup maps | derived from canonical ordered rows |
-
-The following state is session-local and must not be serialized as semantic
-state: local assumptions and goals, direct/indirect proof mode, structure
-context, local variables, current block labels and locations, hypothesis and
-obligation counters, task preparation callbacks, resolved obligation batches,
-current producer list, current declaration handle, mutable legacy/transition
-builder handles, source locations, routes, diagnostics, and logging or timing
-observations.
-
-The fixed checked foundation is an explicit module-build input. It is not a
-declaration delta. A new declaration family must close this inventory with an
-explicit case or a deterministic derivation before migration; no catch-all
-checker-state payload is permitted.
-
-## Operational seam inventory
-
-- CLI dispatch and options: `CommandLine.run` and `Api.Options`.
-- Source graph and parser callbacks: `Felix.Source.Graph`,
- `Felix.Parse.parseSourceWorkspaceWith`.
-- Cumulative glossing state: `Api.verifyWorkspace`,
- `Meaning.GlossState`, and `Meaning.glossStep`.
-- Declaration dispatch/finalization: `Checking.checkBlocks`,
- `withBlockContext`, and `finalizeLegacyDeclaration`.
-- Typed authority/builders: `Checking.Transition` and
- `Checking.Typed.*`.
-- Task preparation and filter/reconstruction: `Checking.tellTasks`,
- `Filter`, `Checking.Backend.*`, `Encoding`, and `Provers`.
-- Prover supervision: `Provers.runProver`.
-- Separate request dumping: `CommandLine.run`, `Api.prepareDumpTasks`, and
- `Api.dumpTask`.
-- HTML preparation/routing/publication: `Render.Html.Export`,
- `Render.Html.Layout`, and `Render.Html.Output`.
-
-Dump and HTML paths remain separate today. The target dump boundary is frozen
-in `execution.md`: an absent or empty destination is preflighted, then Felix
-owns the complete run directory.
-
-## Measurement protocol
-
-The frozen historical command is:
-
-```text
-NAPROCHE_LIB=<108b963 worktree>/library \
-stack exec zf -- --log library/everything.tex -t 17 --uncached +RTS -s -RTS
-```
-
-Record the exact revision, worktree, source closure, result, task count,
-accumulated logged Vampire time, wall/user/system time, allocation, peak
-residency/RSS, capabilities, compiler/package plan, Vampire revision, OS,
-processor, memory, limits, and RTS flags in `changes.md`.
-
-Later comparison scenarios are:
-
-1. fresh-store cold verification of the same active root;
-2. warm verification without source changes;
-3. a proof-only leaf edit;
-4. a transparent definition edit;
-5. a leaf-module edit; and
-6. an edit to a central syntax or semantic interface.
-
-Each scenario records semantic outcomes and authority first, then wall/CPU
-time, peak RSS, Vampire time, cache-hit counts, and effective parallelism.
-Phase 0 exposes no store or jobs option.
diff --git a/latex/stdlib.tex b/latex/stdlib.tex
index e545395..22f6261 100644
--- a/latex/stdlib.tex
+++ b/latex/stdlib.tex
@@ -37,9 +37,8 @@
\input{../library/algebra/magma.tex}
\input{../library/algebra/semigroup.tex}
\input{../library/algebra/monoid.tex}
- \input{../library/algebra/group.tex}
- %\input{../library/algebra/quasigroup.tex}
- %\input{../library/algebra/loop.tex}
+ \input{../library/algebra/quasigroup.tex}
+ \input{../library/algebra/loop.tex}
\input{../library/order/order.tex}
\input{../library/order/semilattice.tex}
\input{../library/topology/topological-space.tex}
diff --git a/library/algebra/magma.tex b/library/algebra/magma.tex
index d05ce29..3937b56 100644
--- a/library/algebra/magma.tex
+++ b/library/algebra/magma.tex
@@ -71,10 +71,13 @@
Let $A$ be a unital magma.
Then $\mul(\neutral,\neutral) = \neutral$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{unitalmagma_type,unitalmagma_left}.
+\end{proof}
\begin{proposition}\label{unitalmagma_neutral_unique}
Let $A$ be a unital magma.
- Let $e$ be a set such that $e\in A$ and for all $x\in A$ we have $\mul(x, e) = x = \mul(e, x)$.
+ Let $e$ be a set such that $e\in \carrier[A]$ and for all $x\in \carrier[A]$ we have $\mul(x, e) = x = \mul(e, x)$.
Then $e = \neutral$.
\end{proposition}
\begin{proof}
@@ -97,5 +100,5 @@
\begin{proof}
We have $x\cdot e\in \LeftOrb{e}{A}$ by \cref{left_orbit}.
Thus $x\cdot e\in\LeftOrb{f}{A}$ by assumption.
- Take $y\in\carrier[A]$ such that $x\cdot e = y\cdot f$ by \cref{left_orbit}.
+ Take $y$ such that $y\in\carrier[A]$ and $x\cdot e = y\cdot f$ by \cref{left_orbit}.
\end{proof}
diff --git a/library/algebra/monoid.tex b/library/algebra/monoid.tex
index bef3166..ed9d2ff 100644
--- a/library/algebra/monoid.tex
+++ b/library/algebra/monoid.tex
@@ -4,10 +4,13 @@
\begin{struct}\label{monoid}
A monoid $A$ is a unital magma such that
\begin{enumerate}
- \item\label{monoid_assoc} for all $a, b, c$ we have $\mul[A](a,\mul[A](b,c)) = \mul[A](\mul[A](a,b),c)$.
+ \item\label{monoid_assoc} for all $a,b,c\in\carrier[A]$ we have $\mul[A](a,\mul[A](b,c)) = \mul[A](\mul[A](a,b),c)$.
\end{enumerate}
\end{struct}
\begin{corollary}\label{monoid_implies_semigroup}
Let $A$ be a monoid. Then $A$ is a semigroup.
\end{corollary}
+\begin{proof}
+ Follows by \cref{monoid,unitalmagma,semigroup}.
+\end{proof}
diff --git a/library/algebra/quasigroup.tex b/library/algebra/quasigroup.tex
index 747ab03..50d7b0f 100644
--- a/library/algebra/quasigroup.tex
+++ b/library/algebra/quasigroup.tex
@@ -10,27 +10,37 @@
\end{enumerate}
such that
\begin{enumerate}
- \item for all $a, b\in A$ we have $\ldiv (a,b)\in A$.
- \item for all $a, b\in A$ we have $\rdiv (a,b)\in A$.
- \item for all $a,b \in A$ we have $b = \mul(a,\ldiv (a,b))$.
- \item for all $a,b \in A$ we have $b = \ldiv(a,\mul (a,b))$.
- \item for all $a,b \in A$ we have $b = \mul(\rdiv (b,a),a)$.
- \item for all $a,b \in A$ we have $b = \rdiv(\mul (b,a),a)$.
+ \item\label{quasigroup_ldiv_type} for all $a,b\in\carrier[A]$ we have $\ldiv[A](a,b)\in\carrier[A]$.
+ \item\label{quasigroup_rdiv_type} for all $a,b\in\carrier[A]$ we have $\rdiv[A](a,b)\in\carrier[A]$.
+ \item\label{quasigroup_mul_ldiv} for all $a,b\in\carrier[A]$ we have $b = \mul[A](a,\ldiv[A](a,b))$.
+ \item\label{quasigroup_ldiv_mul} for all $a,b\in\carrier[A]$ we have $b = \ldiv[A](a,\mul[A](a,b))$.
+ \item\label{quasigroup_rdiv_mul} for all $a,b\in\carrier[A]$ we have $b = \mul[A](\rdiv[A](b,a),a)$.
+ \item\label{quasigroup_mul_rdiv} for all $a,b\in\carrier[A]$ we have $b = \rdiv[A](\mul[A](b,a),a)$.
\end{enumerate}
\end{struct}
% Cancelling an element on the left.
\begin{lemma}\label{quasigroup_cancel_left}
Let $A$ be a quasigroup.
- Let $a,b,c \in A$.
- Suppose $\mul(a,b) = \mul(a,c)$.
+ Let $a,b,c\in\carrier[A]$.
+ Suppose $\mul[A](a,b) = \mul[A](a,c)$.
Then $b = c$.
\end{lemma}
+\begin{proof}
+ We have $b=\ldiv[A](a,\mul[A](a,b))$ by \cref{quasigroup_ldiv_mul}.
+ We have $c=\ldiv[A](a,\mul[A](a,c))$ by \cref{quasigroup_ldiv_mul}.
+ Follows by assumption.
+\end{proof}
% Cancelling an element on the right.
\begin{lemma}\label{quasigroup_cancel_right}
Let $A$ be a quasigroup.
- Let $a,b,c \in A$.
- Suppose $\mul(a,c) = \mul(b,c)$.
+ Let $a,b,c\in\carrier[A]$.
+ Suppose $\mul[A](a,c) = \mul[A](b,c)$.
Then $a = b$.
\end{lemma}
+\begin{proof}
+ We have $a=\rdiv[A](\mul[A](a,c),c)$ by \cref{quasigroup_mul_rdiv}.
+ We have $b=\rdiv[A](\mul[A](b,c),c)$ by \cref{quasigroup_mul_rdiv}.
+ Follows by assumption.
+\end{proof}
diff --git a/library/algebra/semigroup.tex b/library/algebra/semigroup.tex
index e090a56..be94945 100644
--- a/library/algebra/semigroup.tex
+++ b/library/algebra/semigroup.tex
@@ -5,8 +5,7 @@
\begin{struct}\label{semigroup}
A semigroup $A$ is a magma such that
\begin{enumerate}
- %\item for all $a, b, c\in \carrier[A]$ we have $\mul[A](a,\mul[A](b,c)) = \mul[A](\mul[A](a,b),c)$.
- \item\label{semigroup_assoc} for all $a, b, c$ we have $\mul[A](a,\mul[A](b,c)) = \mul[A](\mul[A](a,b),c)$.
+ \item\label{semigroup_assoc} for all $a, b, c\in \carrier[A]$ we have $\mul[A](a,\mul[A](b,c)) = \mul[A](\mul[A](a,b),c)$.
\end{enumerate}
\end{struct}
@@ -18,8 +17,7 @@
\begin{struct}\label{regularsemigroup}
A regular semigroup $A$ is a semigroup such that
\begin{enumerate}
- %\item for all $a\in \carrier[A]$ there exists $b\in\carrier[A]$ such that $\mul[A](a, \mul[A](b, a)) = a$.
- \item\label{regularsemigroup_regular} for all $a$ there exists $b\in\carrier[A]$ such that $\mul[A](a, \mul[A](b, a)) = a$.
+ \item\label{regularsemigroup_regular} for all $a\in \carrier[A]$ there exists $b\in\carrier[A]$ such that $\mul[A](a, \mul[A](b, a)) = a$.
\end{enumerate}
\end{struct}
@@ -38,12 +36,18 @@
Suppose $A$ is an inverse semigroup.
Then $A$ is a semigroup.
\end{proposition}
+\begin{proof}
+ Follows by \cref{inversesemigroup,regularsemigroup}.
+\end{proof}
\begin{proposition}\label{inversesemigroup_is_regularsemigroup}
Suppose $A$ is an inverse semigroup.
Then $A$ is a regular semigroup.
\end{proposition}
+\begin{proof}
+ Follows by \cref{inversesemigroup}.
+\end{proof}
\begin{proposition}\label{idempotentelems_eq_iff_orbits_eq}
Let $A$ be an inverse semigroup.
@@ -56,27 +60,12 @@
Then $e = f$.
\end{proposition}
\begin{proof}
- Take $x, y\in\carrier[A]$ such that $e = x\cdot f$ and $f = y\cdot e$ by \cref{idempotents}.
- %
- \begin{align*}
- e
- &= x \cdot f
- \explanation{by assumption}\\
- &= x\cdot (f\cdot f)
- \explanation{by \cref{idempotents}}\\
- &= (x\cdot f)\cdot f
- \explanation{by \cref{semigroup_assoc,inversesemigroup_is_semigroup}}\\
- &= e\cdot f
- \explanation{by assumption}\\
- &= f\cdot e
- \explanation{by \hyperref[inversesemigroup_comm]{commutativity of idempotent elements}}\\
- &= (y\cdot e)\cdot e
- \explanation{by assumption}\\
- &= y\cdot (e\cdot e)
- \explanation{by \cref{semigroup_assoc,inversesemigroup_is_semigroup}}\\
- &= y \cdot e
- \explanation{by \cref{idempotents}}\\
- &= f
- \explanation{by assumption}
- \end{align*}
+ Take $x,y$ such that $x,y\in\carrier[A]$ and
+ $e = x\cdot f$ and $f = y\cdot e$ by \cref{idempotents}.
+ We have $e=e\cdot f$ by
+ \cref{idempotents,semigroup_assoc,inversesemigroup_is_semigroup}.
+ We have $f=f\cdot e$ by
+ \cref{idempotents,semigroup_assoc,inversesemigroup_is_semigroup}.
+ We have $e\cdot f=f\cdot e$ by \cref{inversesemigroup_comm}.
+ Follows by assumption.
\end{proof}
diff --git a/library/everything.tex b/library/everything.tex
index f4eb62a..c7d2e64 100644
--- a/library/everything.tex
+++ b/library/everything.tex
@@ -21,8 +21,10 @@
\import{algebra/magma.tex}
\import{algebra/semigroup.tex}
\import{algebra/monoid.tex}
+\import{algebra/quasigroup.tex}
+\import{algebra/loop.tex}
\import{order/order.tex}
-%\import{order/semilattice.tex}
+\import{order/semilattice.tex}
\import{topology/topological-space.tex}
\import{topology/basis.tex}
\import{topology/disconnection.tex}
@@ -31,3 +33,6 @@
\begin{proposition}\label{trivial}
$\emptyset = \emptyset$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{emptyset}.
+\end{proof}
diff --git a/library/order/order.tex b/library/order/order.tex
index 1b7692f..dc9497c 100644
--- a/library/order/order.tex
+++ b/library/order/order.tex
@@ -45,13 +45,16 @@
\begin{proposition}\label{toorder_reflexive}
$\toorder{A}{R}$ is reflexive on $A$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{toorder,reflexive_on,id_iff,union_iff}.
+\end{proof}
\begin{proposition}\label{toorder_intro}
Suppose $(a,b)\in R$.
Then $(a,b)\in\toorder{A}{R}$.
\end{proposition}
\begin{proof}
- $R\subseteq\toorder{A}{R}$.
+ Follows by \cref{toorder,union_iff}.
\end{proof}
\begin{proposition}\label{toorder_elim}
@@ -65,14 +68,33 @@
\begin{proposition}\label{toorder_iff}
$(a,b)\in\toorder{A}{R}$ iff $(a,b)\in R$ or $a = b\in A$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{toorder,id_iff,union_iff}.
+\end{proof}
\begin{proposition}\label{strictorder_from_order}
Suppose $R$ is an order.
Then $\tostrictorder{R}$ is a strict order.
\end{proposition}
\begin{proof}
- $\tostrictorder{R}$ is asymmetric.
- $\tostrictorder{R}$ is transitive.
+ $\tostrictorder{R}$ is asymmetric
+ by \cref{antisymmetric,asymmetric,tostrictorder_iff}.
+ Show for all $a,b,c$ such that
+ $a\mathrel{\tostrictorder{R}}b$ and
+ $b\mathrel{\tostrictorder{R}}c$
+ we have $a\mathrel{\tostrictorder{R}}c$.
+ \begin{subproof}
+ Fix $a,b,c$.
+ Assume $a\mathrel{\tostrictorder{R}}b$ and
+ $b\mathrel{\tostrictorder{R}}c$.
+ We have $a\mathrel{R}b$ and $b\mathrel{R}c$
+ by \cref{tostrictorder_iff}.
+ Thus $a\mathrel{R}c$ by \cref{transitive}.
+ We have $a\neq c$ by \cref{asymmetric}.
+ Follows by \cref{tostrictorder_iff}.
+ \end{subproof}
+ Thus $\tostrictorder{R}$ is transitive by \cref{transitive}.
+ Follows by assumption.
\end{proof}
\begin{proposition}\label{order_from_strictorder}
@@ -81,16 +103,42 @@
Then $\toorder{A}{R}$ is an order on $A$.
\end{proposition}
\begin{proof}
- $\toorder{A}{R}$ is antisymmetric.
+ $\identity{A}\subseteq A\times A$
+ by \cref{id_elem_rels,rels_elim}.
+ Thus $\toorder{A}{R}\subseteq A\times A$
+ by \cref{toorder,union_subsets_is_subset}.
+ Hence $\toorder{A}{R}$ is a binary relation on $A$
+ by assumption.
+ $\toorder{A}{R}$ is antisymmetric
+ by \cref{antisymmetric,asymmetric,toorder_iff}.
$\toorder{A}{R}$ is transitive by \cref{transitive,toorder_iff}.
- $\toorder{A}{R}$ is reflexive on $A$.
+ $\toorder{A}{R}$ is reflexive on $A$ by \cref{toorder_reflexive}.
+ Follows by assumption.
\end{proof}
\begin{proposition}\label{subseteqrel_antisymmetric}
$\subseteqrel{A}$ is antisymmetric.
\end{proposition}
\begin{proof}
- Follows by \cref{subseteqrel,antisymmetric,pair_eq_iff,subseteq_antisymmetric}.
+ Show for all $a,b$ such that
+ $a\mathrel{\subseteqrel{A}}b$ and
+ $b\mathrel{\subseteqrel{A}}a$
+ we have $a=b$.
+ \begin{subproof}
+ Fix $a,b$.
+ Assume $a\mathrel{\subseteqrel{A}}b$ and
+ $b\mathrel{\subseteqrel{A}}a$.
+ Take $x,y$ such that $(a,b)=(x,y)$ and
+ $x,y\in A$ and $x\subseteq y$ by \cref{subseteqrel}.
+ Then $a=x$ and $b=y$ by \cref{pair_eq_iff}.
+ Thus $a\subseteq b$ by assumption.
+ Take $u,v$ such that $(b,a)=(u,v)$ and
+ $u,v\in A$ and $u\subseteq v$ by \cref{subseteqrel}.
+ Then $b=u$ and $a=v$ by \cref{pair_eq_iff}.
+ Thus $b\subseteq a$ by assumption.
+ Follows by \cref{subseteq_antisymmetric}.
+ \end{subproof}
+ Follows by \cref{antisymmetric}.
\end{proof}
@@ -100,4 +148,5 @@
\begin{proof}
$\subseteqrel{A}$ is a quasiorder on $A$ by \cref{subseteqrel_is_quasiorder}.
$\subseteqrel{A}$ is antisymmetric by \cref{subseteqrel_antisymmetric}.
+ Follows by assumption.
\end{proof}
diff --git a/library/order/quasiorder.tex b/library/order/quasiorder.tex
index ab325e7..3ccb46e 100644
--- a/library/order/quasiorder.tex
+++ b/library/order/quasiorder.tex
@@ -37,15 +37,48 @@
Then $a\mathrel{\lt[X]} d$.
\end{lemma}
\begin{proof}
- $\lt[X]$ is transitive.
- Thus $a\mathrel{\lt[X]} c\mathrel{\lt[X]} d$ by \hyperref[transitive]{transitivity}.
- Hence $a\mathrel{\lt[X]} d$ by \hyperref[transitive]{transitivity}.
+ $\lt[X]$ is transitive by \cref{quasiorder_tran}.
+ Thus $a\mathrel{\lt[X]} c\mathrel{\lt[X]} d$ by \cref{transitive}.
+ Hence $a\mathrel{\lt[X]} d$ by \cref{transitive}.
+ Follows by assumption.
\end{proof}
\begin{proposition}\label{subseteqrel_is_quasiorder}
$\subseteqrel{A}$ is a quasiorder on $A$.
\end{proposition}
\begin{proof}
- $\subseteqrel{A}$ is reflexive on $A$.
- $\subseteqrel{A}$ is transitive.
+ Show for all $w\in\subseteqrel{A}$ we have $w\in A\times A$.
+ \begin{subproof}
+ Fix $w$.
+ Assume $w\in\subseteqrel{A}$.
+ Take $a,b$ such that $w=(a,b)$ and $a,b\in A$
+ by \cref{subseteqrel,pair_eq_iff}.
+ Follows by \cref{times_tuple_intro}.
+ \end{subproof}
+ Thus $\subseteqrel{A}$ is a binary relation on $A$
+ by \cref{subseteq}.
+ $\subseteqrel{A}$ is reflexive on $A$
+ by \cref{reflexive_on,subseteqrel,subseteq}.
+ Show for all $a,b,c$ such that
+ $a\mathrel{\subseteqrel{A}}b$ and
+ $b\mathrel{\subseteqrel{A}}c$
+ we have $a\mathrel{\subseteqrel{A}}c$.
+ \begin{subproof}
+ Fix $a,b,c$.
+ Assume $a\mathrel{\subseteqrel{A}}b$ and
+ $b\mathrel{\subseteqrel{A}}c$.
+ Take $x,y$ such that $(a,b)=(x,y)$ and
+ $x,y\in A$ and $x\subseteq y$ by \cref{subseteqrel}.
+ Then $a=x$ and $b=y$ by \cref{pair_eq_iff}.
+ Thus $a\subseteq b$ and $a\in A$ by assumption.
+ Take $u,v$ such that $(b,c)=(u,v)$ and
+ $u,v\in A$ and $u\subseteq v$ by \cref{subseteqrel}.
+ Then $b=u$ and $c=v$ by \cref{pair_eq_iff}.
+ Thus $b\subseteq c$ and $c\in A$ by assumption.
+ Thus $a\subseteq c$ by \cref{subseteq_transitive}.
+ Follows by \cref{subseteqrel}.
+ \end{subproof}
+ Thus $\subseteqrel{A}$ is transitive
+ by \cref{transitive}.
+ Follows by assumption.
\end{proof}
diff --git a/library/order/semilattice.tex b/library/order/semilattice.tex
index 51af68b..76bbe56 100644
--- a/library/order/semilattice.tex
+++ b/library/order/semilattice.tex
@@ -1,7 +1,8 @@
-\import{order/partial-order.tex}
+\import{order/order.tex}
+\import{function.tex}
\begin{struct}\label{meet_semilattice}
- A meet semilattice $X$ is a partial order
+ A meet semilattice $X$ is an ordered set
equipped with
\begin{enumerate}
\item $\meet$
@@ -9,7 +10,7 @@
such that
\begin{enumerate}
\item\label{meet_type} for all $x,y\in \carrier[X]$ we have
- $\meet[X](x,y)\in X$.
+ $\meet[X](x,y)\in \carrier[X]$.
\item\label{meet_lb} for all $x,y\in \carrier[X]$ we have
$\meet[X](x,y) \mathrel{\lt[X]} x, y$.
\item\label{meet_glb} for all $a,x,y\in \carrier[X]$ such that $a\mathrel{\lt[X]} x, y$ we have
@@ -20,12 +21,16 @@
\begin{proposition}\label{meet_idempotent}
Let $X$ be a meet semilattice.
- Then $\meet(x,x) = x$.
+ Let $x\in\carrier[X]$.
+ Then $\meet[X](x,x) = x$.
\end{proposition}
\begin{proof}
- $\meet(x,x) \mathrel{\lt} x$.
- $x\mathrel{\lt[X]} x, x$.
- Thus $x\mathrel{\lt[X]} \meet(x,x)$.
+ We have $\meet[X](x,x)\in\carrier[X]$ by \cref{meet_type}.
+ We have $\meet[X](x,x)\mathrel{\lt[X]}x$ by \cref{meet_lb}.
+ We have $x\mathrel{\lt[X]}x$
+ by \cref{meet_semilattice,orderedset,quasiorder_refl,reflexive_on}.
+ Thus $x\mathrel{\lt[X]}\meet[X](x,x)$ by \cref{meet_glb}.
+ Follows by \cref{meet_semilattice,orderedset,orderedset_antisym,antisymmetric}.
\end{proof}
%\begin{proposition}\label{meet_comm}
diff --git a/library/ordinal.tex b/library/ordinal.tex
index f978257..f7a66d1 100644
--- a/library/ordinal.tex
+++ b/library/ordinal.tex
@@ -19,7 +19,7 @@ so we will explicitly talk about \emph{\in-transitivity} here.
% \renewcommand{\in}{\ensuremath{\mathonlyin}}
%
\begin{definition}\label{transitiveset}
- A set $A$ is \in-transitive iff for all $x, y$
+ $A$ is \in-transitive iff for all $x, y$
such that $x\in y\in A$ we have $x\in A$.
\end{definition}
@@ -27,12 +27,16 @@ so we will explicitly talk about \emph{\in-transitivity} here.
$A$ is \in-transitive iff
for all $a\in A$ we have $a\subseteq A$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{transitiveset,subseteq}.
+\end{proof}
\begin{proposition}\label{transitiveset_iff_pow}
$A$ is \in-transitive iff $A\subseteq \pow{A}$.
\end{proposition}
\begin{proof}
- For all $a\in A$ we have $a\subseteq A \iff a\in\pow{A}$.
+ For all $a\in A$ we have $a\subseteq A \iff a\in\pow{A}$
+ by \cref{subseteq,pow_iff}.
Follows by \cref{elem_subseteq,subseteq,pow_iff,transitiveset_iff_subseteq}.
\end{proof}
@@ -40,18 +44,28 @@ so we will explicitly talk about \emph{\in-transitivity} here.
$A$ is \in-transitive iff $\unions{\suc{A}} = A$.
\end{proposition}
\begin{proof}
- Follows by \cref{transitiveset,subseteq,subseteq_antisymmetric,suc,transitiveset_iff_pow,unions_subseteq_of_powerset_is_subseteq,unions_iff,suc_subseteq_intro,powerset_top}.
+ We have if $A$ is \in-transitive, then $\unions{\suc{A}}=A$
+ by \cref{setext,transitiveset,unions_iff,suc_iff}.
+ We have if $\unions{\suc{A}}=A$, then $A$ is \in-transitive
+ by \cref{transitiveset,unions_iff,suc_iff}.
+ Follows by assumption.
\end{proof}
\begin{proposition}\label{transitiveset_iff_unions_subseteq}
$A$ is \in-transitive iff $\unions{A}\subseteq A$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{transitiveset,subseteq,unions_iff}.
+\end{proof}
\begin{proposition}\label{transitiveset_upair}
Suppose $A$ is \in-transitive.
Suppose $\{a,b\}\in A$.
Then $a,b\in A$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{transitiveset,transitiveset_iff_subseteq,subseteq}.
+\end{proof}
% For Kuratowski pairs only:
%\begin{proposition}\label{transitiveset_pair}
@@ -81,26 +95,41 @@ so we will explicitly talk about \emph{\in-transitivity} here.
\begin{proposition}\label{emptyset_transitiveset}
$\emptyset$ is \in-transitive.
\end{proposition}
+\begin{proof}
+ Follows by \cref{transitiveset,emptyset}.
+\end{proof}
\begin{proposition}\label{union_of_transitiveset_is_transitiveset}
Suppose $A$ and $B$ are \in-transitive.
Then $A\union B$ is \in-transitive.
\end{proposition}
+\begin{proof}
+ Follows by \cref{transitiveset,union_iff}.
+\end{proof}
\begin{proposition}\label{inter_of_transitiveset_is_transitiveset}
Let $A, B$ be \in-transitive sets.
Then $A\inter B$ is \in-transitive.
\end{proposition}
+\begin{proof}
+ Follows by \cref{transitiveset,inter}.
+\end{proof}
\begin{proposition}\label{suc_of_transitiveset_is_transitiveset}
Let $A$ be an \in-transitive set.
Then $\suc{A}$ is \in-transitive.
\end{proposition}
+\begin{proof}
+ Follows by \cref{transitiveset,suc}.
+\end{proof}
\begin{proposition}\label{unions_of_transitiveset_is_transitiveset}
Let $A$ be an \in-transitive set.
Then $\unions{A}$ is \in-transitive.
\end{proposition}
+\begin{proof}
+ Follows by \cref{transitiveset,unions_iff}.
+\end{proof}
\begin{proposition}\label{unions_family_of_transitiveset_is_transitiveset}
Suppose every element of $A$ is an \in-transitive set.
@@ -132,28 +161,43 @@ so we will explicitly talk about \emph{\in-transitivity} here.
Suppose every element of $\alpha$ is \in-transitive.
Then $\alpha$ is an ordinal.
\end{proposition}
+\begin{proof}
+ Follows by \cref{ordinal}.
+\end{proof}
\begin{proposition}\label{ordinal_is_transitiveset}
Let $\alpha$ be an ordinal.
Then $\alpha$ is \in-transitive.
\end{proposition}
+\begin{proof}
+ Follows by \cref{ordinal}.
+\end{proof}
\begin{proposition}\label{ordinal_elem_is_transitiveset}
Let $\alpha$ be an ordinal.
Suppose $A\in\alpha$.
Then $A$ is \in-transitive.
\end{proposition}
+\begin{proof}
+ Follows by \cref{ordinal}.
+\end{proof}
\begin{proposition}\label{elem_of_ordinal_is_ordinal}
Let $\alpha$ be an ordinal.
Suppose $\beta\in\alpha$.
Then $\beta$ is an ordinal.
\end{proposition}
+\begin{proof}
+ Follows by \cref{ordinal,transitiveset}.
+\end{proof}
\begin{proposition}\label{suc_ordinal_implies_ordinal}
Suppose $\suc{\alpha}$ is an ordinal.
Then $\alpha$ is an ordinal.
\end{proposition}
+\begin{proof}
+ Follows by \cref{ordinal,suc}.
+\end{proof}
\begin{proposition}\label{transitivesubseteq_of_ordinal_is_ordinal}
Let $\alpha$ be an ordinal.
@@ -170,6 +214,9 @@ so we will explicitly talk about \emph{\in-transitivity} here.
Suppose $\alpha\in\beta$.
Then $\alpha\subseteq\beta$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{ordinal,transitiveset_iff_subseteq}.
+\end{proof}
\begin{proposition}\label{ordinal_transitivity}
Let $\alpha$ be an ordinal.
@@ -186,6 +233,9 @@ so we will explicitly talk about \emph{\in-transitivity} here.
Suppose $\alpha\in\beta$.
Then $\suc{\alpha}\subseteq\beta$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{ordinal,transitiveset_iff_subseteq,suc_subseteq_intro}.
+\end{proof}
\begin{abbreviation}\label{ordinal_prec}
@@ -217,26 +267,42 @@ We already have global irreflexivity and asymmetry of \in.
\in\ is transitive on ordinals by definition.
To show that \in\ is a strict total order it only remains to show that \in\ is connex.
+\begin{lemma}\label{ordinal_elem_connex_from_elements}
+ Let $\alpha,\gamma$ be ordinals.
+ Suppose for all sets $\xi,\beta$ such that $\xi\in\alpha$ and $\beta$ is an ordinal
+ we have $\xi\in\beta\lor \beta\in\xi \lor \xi = \beta$.
+ Suppose for every $\eta\in\gamma$
+ we have $\alpha\in\eta\lor \eta\in\alpha \lor \alpha = \eta$.
+ Then $\alpha\in\gamma\lor \gamma\in\alpha \lor \alpha = \gamma$.
+\end{lemma}
+\begin{proof}
+ Assume neither $\alpha\in\gamma$ nor $\gamma\in\alpha$.
+ For every $\xi\in\alpha$ we have $\xi\in\gamma$
+ by \cref{ordinal_transitivity}.
+ Thus $\alpha\subseteq\gamma$ by \cref{subseteq}.
+ For every $\eta\in\gamma$ we have $\eta\in\alpha$
+ by \cref{ordinal_transitivity}.
+ Thus $\gamma\subseteq\alpha$ by \cref{subseteq}.
+ Follows by \cref{subseteq_antisymmetric}.
+\end{proof}
+
+\begin{lemma}\label{ordinal_elem_connex_step}
+ Let $\alpha,\gamma$ be ordinals.
+ Suppose for all sets $\xi,\beta$ such that $\xi\in\alpha$ and $\beta$ is an ordinal
+ we have $\xi\in\beta\lor \beta\in\xi \lor \xi = \beta$.
+ Then $\alpha\in\gamma\lor \gamma\in\alpha \lor \alpha = \gamma$.
+\end{lemma}
+\begin{proof}[Proof by \in-induction on $\gamma$]
+ Follows by \cref{ordinal_elem_connex_from_elements,elem_of_ordinal_is_ordinal}.
+\end{proof}
+
\begin{proposition}\label{ordinal_elem_connex}
- For all ordinals $\alpha,\beta$
+ Let $\alpha$ be an ordinal.
+ Then for every ordinal $\beta$
we have $\alpha\in\beta\lor \beta\in\alpha \lor \alpha = \beta$.
\end{proposition}
\begin{proof}[Proof by \in-induction on $\alpha$]
- % Ind hypothesis:
- % ![Xi,Xbeta]:(elem(Xi,falpha)=>((ordinal(Xi)&ordinal(Xbeta))=>(elem(Xi,Xbeta)|elem(Xbeta,Xi)|Xi=Xbeta))))
- % Goal:
- % ordinal(falpha)&ordinal(fbeta))=>(elem(falpha,fbeta)|elem(fbeta,falpha)|falpha=fbeta)
- %
- Assume $\alpha$ is an ordinal.
- Show for all ordinals $\gamma$ we have $\alpha\in\gamma\lor \gamma\in\alpha \lor \alpha = \gamma$.
- \begin{subproof}[Proof by \in-induction on $\gamma$]
- % Now we have:
- % ![Xi]:(elem(Xi,fgamma)=>(ordinal(Xi)=>(elem(falpha,Xi)|elem(Xi,falpha)|falpha=Xi)))).
- % Goal: ordinal(fgamma)=>(elem(falpha,fgamma)|elem(fgamma,falpha)|falpha=fgamma))
- %
- Assume $\gamma$ is an ordinal.
- Follows by \cref{setext,transitiveset,ordinal}.
- \end{subproof}
+ Follows by \cref{ordinal_elem_connex_step,elem_of_ordinal_is_ordinal}.
\end{proof}
\begin{proposition}\label{ordinal_proper_subset_implies_elem}
@@ -245,20 +311,24 @@ To show that \in\ is a strict total order it only remains to show that \in\ is c
Then $\alpha\in\beta$.
\end{proposition}
\begin{proof}
- $\beta\setminus\alpha$ is inhabited.
- Take $\gamma$ such that $\gamma$ is an \in-minimal element of $\beta\setminus\alpha$.
+ $\beta\setminus\alpha$ is inhabited
+ by \cref{difference_with_proper_subset_is_inhabited}.
+ Take $\gamma$ such that $\gamma$ is an \in-minimal element of $\beta\setminus\alpha$
+ by \cref{regularity}.
Now $\gamma\in\beta$ by \cref{setminus_elim_left}.
- Hence $\gamma\subseteq\beta$
- by \cref{ordinal,transitiveset_iff_subseteq}.
- For all $\delta\in\beta\setminus\alpha$ we have $\delta\notin\gamma$.
- Thus $\gamma\setminus\alpha = \emptyset$.
- Hence $\gamma\subseteq\alpha$.
- It suffices to show that for all $\delta\in\alpha$ we have $\delta\in\gamma$.
- Suppose not.
- Take $\delta\in\alpha$ such that $\delta\notin\gamma$.
- Now if $\delta = \gamma$ or $\gamma\in\delta$, then $\gamma\in\alpha$
- % Original Vampire proof: by \cref{ordinal,elem_subseteq,elem_of_ordinal_is_ordinal,setminus_elim_left,ordinal_elem_connex,inter_eq_left_implies_subseteq,inter_absorb_supseteq_left,transitiveset_iff_subseteq}.
- by \cref{ordinal,elem_subseteq,elem_of_ordinal_is_ordinal,ordinal_elem_connex,transitiveset_iff_subseteq}.
+ Thus $\gamma$ is an ordinal by \cref{elem_of_ordinal_is_ordinal}.
+ Hence $\gamma\subseteq\beta$ by \cref{ordinal_elem_implies_subseteq}.
+ For all $\delta\in\beta\setminus\alpha$ we have $\delta\notin\gamma$
+ by \cref{disjoint}.
+ Thus $\gamma\setminus\alpha = \emptyset$
+ by \cref{setext,setminus_intro,setminus_elim_left,setminus_elim_right,elem_subseteq}.
+ Hence $\gamma\subseteq\alpha$
+ by \cref{setminus_eq_emptyset_iff_subseteq}.
+ For all $\delta\in\alpha$ we have $\delta\in\gamma$
+ by \cref{ordinal_elem_connex,ordinal_is_transitiveset,elem_of_ordinal_is_ordinal,transitiveset_iff_subseteq,elem_subseteq,setminus_elim_right}.
+ Thus $\alpha\subseteq\gamma$ by \cref{subseteq}.
+ Thus $\alpha = \gamma$ by \cref{subseteq_antisymmetric}.
+ Follows by assumption.
\end{proof}
\begin{proposition}\label{ordinal_elem_implies_proper_subset}
@@ -267,7 +337,7 @@ To show that \in\ is a strict total order it only remains to show that \in\ is c
Then $\alpha\subset\beta$.
\end{proposition}
\begin{proof}
- $\alpha\subseteq\beta$.
+ Follows by \cref{subset,ordinal_elem_implies_subseteq,in_irrefl}.
\end{proof}
\begin{proposition}\label{ordinal_preceq_implies_subseteq}
@@ -276,12 +346,7 @@ Suppose $\alpha\precedeseq\beta$.
Then $\alpha\subseteq\beta$.
\end{proposition}
\begin{proof}
- \begin{byCase}
- \caseOf{$\alpha = \beta$.}
- Trivial.
- \caseOf{$\alpha\precedes\beta$.}
- $\alpha\subset\beta$.
- \end{byCase}
+ Follows by assumption.
\end{proof}
%\begin{proposition}%
@@ -304,12 +369,18 @@ Then $\alpha\subseteq\beta$.
Let $\alpha,\beta$ be ordinals.
Then $\alpha\in\beta$ or $\beta\subseteq\alpha$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{ordinal_elem_connex,ordinal_elem_implies_subseteq,subseteq}.
+\end{proof}
\begin{proposition}\label{ordinal_subseteq_or_subseteq}
Let $\alpha,\beta$ be ordinals.
Then $\alpha\subseteq\beta$ or $\beta\subseteq\alpha$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{ordinal_elem_connex,ordinal_elem_implies_subseteq,subseteq}.
+\end{proof}
\begin{proposition}\label{ordinal_subseteq_implies_elem_or_eq}
@@ -317,12 +388,18 @@ Then $\alpha\subseteq\beta$.
Suppose $\alpha\subseteq\beta$.
Then $\alpha\in\beta$ or $\alpha = \beta$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{subset,ordinal_proper_subset_implies_elem}.
+\end{proof}
\begin{corollary}\label{ordinal_subset_trichotomy}
Let $\alpha,\beta$ be ordinals.
Then $(\alpha\subset\beta \lor \beta\subset\alpha) \lor \alpha = \beta$.
\end{corollary}
+\begin{proof}
+ Follows by \cref{subset,ordinal_elem_connex,ordinal_elem_implies_proper_subset}.
+\end{proof}
\begin{proposition}\label{ordinal_nor_elem_implies_eq}
Let $\alpha,\beta$ be ordinals.
@@ -330,16 +407,14 @@ Then $\alpha\subseteq\beta$.
Then $\alpha = \beta$.
\end{proposition}
\begin{proof}
- Neither $\alpha\subset\beta$ nor $\beta\subset\alpha$.
+ Follows by \cref{ordinal_elem_connex}.
\end{proof}
\begin{proposition}\label{ordinal_in_trichotomy}
Let $\alpha,\beta$ be ordinals. Then $(\alpha\in\beta \lor \beta\in\alpha) \lor \alpha = \beta$.
\end{proposition}
\begin{proof}
- Suppose not.
- Then neither $\alpha\in\beta$ nor $\beta\in\alpha$.
- Thus $\alpha = \beta$ by \cref{ordinal_nor_elem_implies_eq}. Contradiction.
+ Follows by \cref{ordinal_elem_connex}.
\end{proof}
\begin{corollary}\label{ordinal_prec_trichotomy}
@@ -354,6 +429,9 @@ Then $\alpha\subseteq\beta$.
\begin{corollary}\label{ordinal_elem_or_superset}
Let $\alpha,\beta$ be ordinals. Then $\alpha\in \beta$ or $\beta\subseteq \alpha$.
\end{corollary}
+\begin{proof}
+ Follows by \cref{ordinal_elem_or_subseteq}.
+\end{proof}
@@ -362,6 +440,9 @@ Then $\alpha\subseteq\beta$.
\begin{proposition}\label{emptyset_is_ordinal}
$\emptyset$ is an ordinal.
\end{proposition}
+\begin{proof}
+ Follows by \cref{ordinal,transitiveset,emptyset}.
+\end{proof}
% The proof of this theorem benefits from the alternate definition of
% transitivity in terms of $\subseteq$.
@@ -371,22 +452,33 @@ Then $\alpha\subseteq\beta$.
\end{proposition}
\begin{proof}
$\suc{\alpha}$ is \in-transitive by \cref{ordinal,suc_of_transitiveset_is_transitiveset}.
- For every $\beta\in\alpha$ we have that $\beta$ is \in-transitive.
+ For every $\beta\in\alpha$ we have that $\beta$ is \in-transitive
+ by \cref{ordinal,transitiveset}.
+ Follows by \cref{ordinal,suc_iff}.
\end{proof}
\begin{proposition}\label{ordinal_iff_suc_ordinal}
$\alpha$ is an ordinal iff $\suc{\alpha}$ is an ordinal.
\end{proposition}
+\begin{proof}
+ Follows by \cref{suc_ordinal,suc_intro_self,elem_of_ordinal_is_ordinal}.
+\end{proof}
\begin{proposition}\label{ordinal_in_suc}
Let $\alpha$ be an ordinal.
Then $\alpha\in\suc{\alpha}$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{suc_intro_self}.
+\end{proof}
\begin{corollary}\label{ordinal_precedes_suc}
Let $\alpha$ be an ordinal.
Then $\alpha\precedes \suc{\alpha}$.
\end{corollary}
+\begin{proof}
+ Follows by \cref{suc_ordinal,ordinal_in_suc}.
+\end{proof}
\begin{proposition}\label{ordinal_elem_implies_subset_of_suc}
Let $\alpha,\beta$ be ordinals.
@@ -394,9 +486,7 @@ Then $\alpha\subseteq\beta$.
Then $\alpha\subseteq\suc{\beta}$.
\end{proposition}
\begin{proof}
- $\alpha\subset \beta$.
- In particular, $\alpha\subseteq \beta$.
- Hence $\alpha\subseteq \cons{\beta}{\beta}$.
+ Follows by \cref{ordinal_elem_implies_subseteq,subseteq_self_suc_intro,subseteq_transitive}.
\end{proof}
\begin{proposition}\label{unions_of_ordinal_is_ordinal}
@@ -406,8 +496,10 @@ Then $\alpha\subseteq\beta$.
\begin{proof}
For all $x, y$ such that $x\in y\in \unions{\alpha}$ we have $x\in \unions{\alpha}$
by \cref{unions_intro,unions_iff,transitiveset,ordinal}.
- Thus $\unions{\alpha}$ is \in-transitive.
- Every element of $\unions{\alpha}$ is \in-transitive.
+ Thus $\unions{\alpha}$ is \in-transitive by \cref{transitiveset}.
+ Every element of $\unions{\alpha}$ is \in-transitive
+ by \cref{unions_iff,ordinal,transitiveset}.
+ Follows by \cref{ordinal}.
\end{proof}
\begin{lemma}\label{ordinal_subseteq_unions}
@@ -430,11 +522,11 @@ Then $\alpha\subseteq\beta$.
\end{proof}
\begin{proposition}\label{ordinal_empty_or_emptyset_elem}
- For all ordinals $\alpha$
- we have $\alpha=\emptyset$ or $\emptyset\in\alpha$.
+ Let $\alpha$ be an ordinal.
+ Then $\alpha=\emptyset$ or $\emptyset\in\alpha$.
\end{proposition}
-\begin{proof}[Proof by \in-induction]
- Straightforward.
+\begin{proof}[Proof by \in-induction on $\alpha$]
+ Follows by \cref{setext,emptyset,elem_of_ordinal_is_ordinal,ordinal_transitivity}.
\end{proof}
\begin{proposition}\label{transitive_set_of_ordinals_is_ordinal}
@@ -443,6 +535,9 @@ Then $\alpha\subseteq\beta$.
Suppose that $A$ is \in-transitive.
Then $A$ is an ordinal.
\end{proposition}
+\begin{proof}
+ Follows by \cref{ordinal}.
+\end{proof}
% Apparently Russel first noticed this antimony while reading a paper by Burali-Forti.
% Typographic NB: Cesare Burali-Forti is a single person, therefore only a single hyphen!
@@ -451,13 +546,17 @@ Then $\alpha\subseteq\beta$.
for all $\alpha$ we have $\alpha\in \Omega$ iff $\alpha$ is an ordinal.
\end{theorem}
\begin{proof}
- Suppose not.
- Take $\Omega$ such that for all $\alpha$ we have $\alpha\in \Omega$ iff $\alpha$ is an ordinal.
- For all $x, y$ such that $x\in y\in \Omega$ we have $x\in \Omega$.
- Thus $\Omega$ is \in-transitive.
- Thus $\Omega$ is an ordinal.
- Therefore $\Omega\in\Omega$.
- Contradiction.
+ Assume there exists a set $\Omega$ such that
+ for all $\alpha$ we have $\alpha\in \Omega$ iff $\alpha$ is an ordinal.
+ Take $\Omega$ such that for all $\alpha$ we have
+ $\alpha\in \Omega$ iff $\alpha$ is an ordinal by assumption.
+ For all $x, y$ such that $x\in y\in \Omega$ we have $x\in \Omega$
+ by \cref{elem_of_ordinal_is_ordinal}.
+ Thus $\Omega$ is \in-transitive by \cref{transitiveset}.
+ For every $\alpha\in\Omega$ we have $\alpha$ is an ordinal by assumption.
+ Thus $\Omega$ is an ordinal by \cref{ordinal}.
+ Therefore $\Omega\in\Omega$ by assumption.
+ Contradiction by \cref{in_irrefl}.
\end{proof}
\begin{proposition}\label{inters_of_ordinals_is_ordinal}
@@ -466,7 +565,13 @@ Then $\alpha\subseteq\beta$.
Then $\inters{A}$ is an ordinal.
\end{proposition}
\begin{proof}
- It suffices to show that $\inters{A}$ is \in-transitive.
+ For all $x,y$ such that $x\in y\in\inters{A}$ we have $x\in\inters{A}$
+ by \cref{inters_iff_forall,ordinal_transitivity}.
+ Thus $\inters{A}$ is \in-transitive by \cref{transitiveset}.
+ Take $\alpha$ such that $\alpha\in A$ by assumption.
+ For every $y\in\inters{A}$ we have $y$ is an ordinal
+ by \cref{inters_iff_forall,elem_of_ordinal_is_ordinal}.
+ Follows by \cref{ordinal}.
\end{proof}
\begin{proposition}\label{inters_of_ordinals_subseteq}
@@ -474,6 +579,9 @@ Then $\alpha\subseteq\beta$.
Suppose for every $\alpha\in A$ we have $\alpha$ is an ordinal.
Then for all $\alpha\in A$ we have $\inters{A}\subseteq \alpha$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{inters_subseteq_elem}.
+\end{proof}
\begin{proposition}\label{inters_of_ordinals_elem}
Let $A$ be an inhabited set.
@@ -491,7 +599,12 @@ Then $\alpha\subseteq\beta$.
Then $\inters{A}$ is an \in-minimal element of $A$.
\end{proposition}
\begin{proof}
- For all $\alpha\in A$ we have $\inters{A}\subseteq \alpha$.
+ $\inters{A}\in A$ by \cref{inters_of_ordinals_elem}.
+ For all $\alpha\in A$ we have $\inters{A}\subseteq \alpha$
+ by \cref{inters_of_ordinals_subseteq}.
+ For all $\delta\in\inters{A}$ we have $\delta\notin A$
+ by \cref{elem_of_ordinal_is_ordinal,ordinal_elem_implies_proper_subset,subset,subseteq_antisymmetric}.
+ Follows by \cref{disjoint}.
\end{proof}
\begin{proposition}\label{inters_of_ordinals_is_minimal_alternate}
@@ -500,7 +613,7 @@ Then $\alpha\subseteq\beta$.
Then for all $\alpha\in A$ we have $\inters{A} = \alpha$ or $\inters{A}\in\alpha$.
\end{proposition}
\begin{proof}
- For all $\alpha\in A$ we have $\inters{A}\subseteq \alpha$.
+ Follows by \cref{inters_of_ordinals_is_ordinal,inters_of_ordinals_subseteq,ordinal_subseteq_implies_elem_or_eq}.
\end{proof}
\begin{proposition}\label{inter_of_two_ordinals_is_ordinal}
@@ -534,27 +647,28 @@ Then $\alpha\subseteq\beta$.
Then $\alpha$ is a limit ordinal or $\alpha$ is a successor ordinal.
\end{lemma}
\begin{proof}
- \begin{byCase}
- \caseOf{$\alpha$ is a limit ordinal.}
- Trivial.
- \caseOf{$\alpha$ is not a limit ordinal.}
- Take $\beta$ such that $\beta\in\alpha$ and $\suc{\beta}\notin\alpha$
- by \cref{limit_ordinal}.
- \end{byCase}
+ Assume $\alpha$ is not a limit ordinal.
+ Take $\beta$ such that $\beta\in\alpha$ and $\suc{\beta}\notin\alpha$
+ by \cref{limit_ordinal}.
+ Thus $\beta$ is an ordinal by \cref{elem_of_ordinal_is_ordinal}.
+ Thus $\suc{\beta}$ is an ordinal by \cref{suc_ordinal}.
+ We have $\alpha=\suc{\beta}$
+ by \cref{ordinal_elem_connex,suc_elim,in_asymmetric,in_irrefl}.
+ Follows by \cref{successor_ordinal}.
\end{proof}
\begin{lemma}\label{zero_not_successorordinal}
$\emptyset$ is not a successor ordinal.
\end{lemma}
+\begin{proof}
+ Follows by \cref{successor_ordinal,suc_neq_emptyset}.
+\end{proof}
\begin{lemma}\label{zero_not_limitordinal}
$\emptyset$ is not a limit ordinal.
\end{lemma}
\begin{proof}
- Suppose not.
- Then $\emptyset\precedes \emptyset$ by \cref{emptyset,limit_ordinal}.
- Thus $\emptyset\in \emptyset$.
- Contradiction.
+ Follows by \cref{limit_ordinal,emptyset,in_irrefl}.
\end{proof}
\begin{lemma}\label{suc_elem_limitordinal}
diff --git a/library/relation/closure.tex b/library/relation/closure.tex
index 8eebf08..0734685 100644
--- a/library/relation/closure.tex
+++ b/library/relation/closure.tex
@@ -11,6 +11,9 @@
\begin{proposition}\label{reflexive_closure_is_reflexive}
$\reflexiveClosure{X}{R}$ is reflexive on $X$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{reflexive_closure,reflexive_on,union_iff,id_iff}.
+\end{proof}
\begin{definition}\label{reflexive_reduction}
$\reflexiveReduction{X}{R} = R\setminus\identity{X}$.
diff --git a/library/relation/equivalence.tex b/library/relation/equivalence.tex
index f8b1ba7..896ca57 100644
--- a/library/relation/equivalence.tex
+++ b/library/relation/equivalence.tex
@@ -16,6 +16,9 @@
Let $E$ be a partial equivalence.
Then $E$ is quasireflexive.
\end{proposition}
+\begin{proof}
+ Follows by \cref{quasireflexive,symmetric,transitive}.
+\end{proof}
\begin{abbreviation}\label{equivalence}
$E$ is an equivalence iff
@@ -88,6 +91,12 @@
Then $\equivalenceClass{E}{a} = \equivalenceClass{E}{b}$.
\end{proposition}
\begin{proof}
+ We have for all $c\in\equivalenceClass{E}{a}$
+ we have $c\in\equivalenceClass{E}{b}$
+ by \cref{downward_closure_iff,transitive}.
+ We have for all $c\in\equivalenceClass{E}{b}$
+ we have $c\in\equivalenceClass{E}{a}$
+ by \cref{downward_closure_iff,symmetric,transitive}.
Follows by set extensionality.
\end{proof}
@@ -97,12 +106,20 @@
Suppose $\equivalenceClass{E}{a} = \equivalenceClass{E}{b}$.
Then $a\mathrel{E} b$.
\end{proposition}
+\begin{proof}
+ $a\in\equivalenceClass{E}{a}$ by \cref{equivclasses_inhabited_equivalenceon}.
+ Thus $a\in\equivalenceClass{E}{b}$.
+ Follows by \cref{downward_closure_iff}.
+\end{proof}
\begin{proposition}\label{equiv_iff_equivclasses_eq}
Let $E$ be an equivalence on $A$.
Let $a, b\in A$.
Then $a\mathrel{E} b$ iff $\equivalenceClass{E}{a} = \equivalenceClass{E}{b}$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{equiv_implies_equivanlence_classes_eq,equivclasses_eq_implies_equiv}.
+\end{proof}
\begin{proposition}\label{equivclasses_diseq_implies_disjoint}
Let $E$ be a partial equivalence.
@@ -110,21 +127,28 @@
Then $\equivalenceClass{E}{a}$ is disjoint from $\equivalenceClass{E}{b}$.
\end{proposition}
\begin{proof}
- Suppose not.
- Take $c$ such that $c\in \equivalenceClass{E}{a},\equivalenceClass{E}{b}$.
- Then $c\mathrel{E} a$ and
- $c\mathrel{E} b$.
- $E$ is symmetric.
- Thus $a\mathrel{E} c$ by \hyperref[symmetric]{symmetry}.
- $E$ is transitive.
- Thus $a\mathrel{E} b$ by \hyperref[transitive]{transitivity}.
- Then $b\mathrel{E} a$ by \hyperref[symmetric]{symmetry}.
- %
- Thus $a\in \equivalenceClass{E}{b}$ and $b\in \equivalenceClass{E}{a}$
- by \cref{downward_closure_iff}.
- Hence $\equivalenceClass{E}{a}\subseteq \equivalenceClass{E}{b}\subseteq \equivalenceClass{E}{a}$
- by \cref{transitive_downward_subseteq}.
- Contradiction by \cref{subseteq_antisymmetric}.
+ Show there exists no $c$ such that
+ $c\in\equivalenceClass{E}{a}$ and
+ $c\in\equivalenceClass{E}{b}$.
+ \begin{subproof}
+ Assume there exists a set $c$ such that
+ $c\in\equivalenceClass{E}{a}$ and
+ $c\in\equivalenceClass{E}{b}$.
+ Take $c$ such that $c\in\equivalenceClass{E}{a}$ and
+ $c\in\equivalenceClass{E}{b}$ by assumption.
+ We have $c\mathrel{E}a$ and $c\mathrel{E}b$
+ by \cref{downward_closure_iff}.
+ Thus $a\mathrel{E}c$ and $b\mathrel{E}c$ by \cref{symmetric}.
+ Thus $a\mathrel{E}b$ and $b\mathrel{E}a$ by \cref{transitive}.
+ Hence $\equivalenceClass{E}{a}\subseteq\equivalenceClass{E}{b}$
+ by \cref{downward_closure_iff,transitive_downward_subseteq}.
+ We have $\equivalenceClass{E}{b}\subseteq\equivalenceClass{E}{a}$
+ by \cref{downward_closure_iff,transitive_downward_subseteq}.
+ Thus $\equivalenceClass{E}{a}=\equivalenceClass{E}{b}$
+ by \cref{subseteq_antisymmetric}.
+ Contradiction by assumption.
+ \end{subproof}
+ Follows by \cref{disjoint}.
\end{proof}
\begin{corollary}\label{equivalence_equivclasses_diseq_implies_disjoint}
@@ -159,6 +183,13 @@
\begin{proposition}\label{quotient_emptyset}
$\quotient{\emptyset}{\emptyset} = \emptyset$.
\end{proposition}
+\begin{proof}
+ We have for all $C\in\quotient{\emptyset}{\emptyset}$
+ we have $C\in\emptyset$ by \cref{quotient,emptyset}.
+ We have for all $C\in\emptyset$
+ we have $C\in\quotient{\emptyset}{\emptyset}$ by \cref{emptyset}.
+ Follows by set extensionality.
+\end{proof}
\begin{proposition}\label{quotient_elems_disjoint}
@@ -167,8 +198,8 @@
Then $B$ is disjoint from $C$.
\end{proposition}
\begin{proof}
- Take $b$ such that $B = \equivalenceClass{E}{b}$.
- Take $c$ such that $C = \equivalenceClass{E}{c}$.
+ Take $b$ such that $b\in A$ and $B = \equivalenceClass{E}{b}$ by \cref{quotient}.
+ Take $c$ such that $c\in A$ and $C = \equivalenceClass{E}{c}$ by \cref{quotient}.
Then $B$ is disjoint from $C$ by \cref{equivalenceon_equivclasses_diseq_implies_disjoint}.
\end{proof}
@@ -178,8 +209,8 @@
Then $C$ is inhabited.
\end{proposition}
\begin{proof}
- Take $a\in A$ such that $C = \equivalenceClass{E}{a}$.
- Then $a\in \equivalenceClass{E}{a}$.
+ Take $a$ such that $a\in A$ and $C = \equivalenceClass{E}{a}$ by \cref{quotient}.
+ Then $a\in \equivalenceClass{E}{a}$ by \cref{equivclasses_inhabited_equivalenceon}.
$C$ is inhabited by \cref{quotient,equivclasses_inhabited}.
\end{proof}
@@ -189,7 +220,7 @@
Then $a\in A$.
\end{proposition}
\begin{proof}
- Take $b\in A$ such that $C = \equivalenceClass{E}{b}$
+ Take $b$ such that $b\in A$ and $C = \equivalenceClass{E}{b}$
by \cref{quotient}.
Then $a\mathrel{E} b$.
Thus $a\in A$ by \cref{times_tuple_elim,subseteq}.
@@ -200,14 +231,19 @@
Let $E$ be an equivalence on $A$.
$\emptyset\notin\quotient{A}{E}$.
\end{corollary}
+\begin{proof}
+ Follows by \cref{quotient_elems_inhabited,emptyset}.
+\end{proof}
\begin{proposition}\label{quotient_partition}
Let $E$ be an equivalence on $A$.
$\quotient{A}{E}$ is a partition.
\end{proposition}
\begin{proof}
- $\emptyset\notin\quotient{A}{E}$.
- For all $B, C\in \quotient{A}{E}$ such that $B\neq C$ we have $B$ is disjoint from $C$.
+ $\emptyset\notin\quotient{A}{E}$ by \cref{quotient_notni_emptyset}.
+ For all $B, C\in \quotient{A}{E}$ such that $B\neq C$
+ we have $B$ is disjoint from $C$ by \cref{quotient_elems_disjoint}.
+ Follows by \cref{partition}.
\end{proof}
\begin{proposition}\label{quotient_partition_of}
@@ -215,7 +251,13 @@
$\quotient{A}{E}$ is a partition of $A$.
\end{proposition}
\begin{proof}
- $\unions{(\quotient{A}{E})} = A$ by set extensionality.
+ We have for all $a\in\unions{(\quotient{A}{E})}$
+ we have $a\in A$ by \cref{unions_iff,quotient_elems_type}.
+ We have for all $a\in A$
+ we have $a\in\unions{(\quotient{A}{E})}$
+ by \cref{unions_iff,quotient,equivclasses_inhabited_equivalenceon}.
+ Thus $\unions{(\quotient{A}{E})} = A$ by set extensionality.
+ Follows by \cref{quotient_partition}.
\end{proof}
@@ -230,11 +272,17 @@
Suppose $a,b\in C\in P$.
Then $a\mathrel{\equivfrompartition{P}{A}} b$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{equivalence_from_partition}.
+\end{proof}
\begin{proposition}\label{equivalence_from_partition_reflexive}
Let $P$ be a partition of $A$.
$\equivfrompartition{P}{A}$ is reflexive on $A$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{reflexive_on,equivalence_from_partition_intro,partition,unions_iff}.
+\end{proof}
\begin{proposition}\label{equivalence_from_partition_symmetric}
Let $P$ be a partition.
diff --git a/library/set.tex b/library/set.tex
index 2df4768..d0cbb97 100644
--- a/library/set.tex
+++ b/library/set.tex
@@ -898,13 +898,25 @@ The $\operatorname{\textsf{cons}}$ operation is set adjunction.
$A\setminus \cons{a}{B} = (A\setminus \{a\})\setminus B$.
\end{proposition}
\begin{proof}
- Follows by \cref{cons_iff,setext,setminus}.
+ We have for all $x\in A\setminus \cons{a}{B}$ we have
+ $x\in (A\setminus \{a\})\setminus B$
+ by \cref{cons_iff,setminus}.
+ We have for all $x\in (A\setminus \{a\})\setminus B$ we have
+ $x\in A\setminus \cons{a}{B}$
+ by \cref{cons_iff,setminus}.
+ Follows by set extensionality.
\end{proof}
\begin{proposition}\label{setminus_cons_flip}
$A\setminus \cons{a}{B} = (A\setminus B)\setminus \{a\}$.
\end{proposition}
\begin{proof}
- Follows by \cref{cons_iff,setext,setminus}.
+ We have for all $x\in A\setminus \cons{a}{B}$ we have
+ $x\in (A\setminus B)\setminus \{a\}$
+ by \cref{cons_iff,setminus}.
+ We have for all $x\in (A\setminus B)\setminus \{a\}$ we have
+ $x\in A\setminus \cons{a}{B}$
+ by \cref{cons_iff,setminus}.
+ Follows by set extensionality.
\end{proof}
\begin{proposition}\label{setminus_disjoint}
diff --git a/library/set/cons.tex b/library/set/cons.tex
index 5972ebe..4ab1041 100644
--- a/library/set/cons.tex
+++ b/library/set/cons.tex
@@ -111,7 +111,11 @@
Then $\cons{a}{A\setminus\{a\}} = A$.
\end{proposition}
\begin{proof}
- Follows by \cref{cons_iff,setext,setminus}.
+ We have for all $x\in\cons{a}{A\setminus\{a\}}$ we have $x\in A$
+ by \cref{cons_iff,setminus}.
+ We have for all $x\in A$ we have $x\in\cons{a}{A\setminus\{a\}}$
+ by \cref{cons_iff,setminus}.
+ Follows by set extensionality.
\end{proof}
\begin{proposition}\label{cons_idempotent}
diff --git a/library/set/equinumerosity.tex b/library/set/equinumerosity.tex
index a922052..7c12d7a 100644
--- a/library/set/equinumerosity.tex
+++ b/library/set/equinumerosity.tex
@@ -15,7 +15,7 @@
$A\approx A$.
\end{proposition}
\begin{proof}
- $\identity{A}$ is a bijection from $A$ to $A$. %by \cref{id_is_bijection}.
+ $\identity{A}$ is a bijection from $A$ to $A$ by \cref{id_elem_bijections}.
Follows by \cref{equinum}.
\end{proof}
@@ -23,7 +23,7 @@
Suppose $A\approx B$. Then $B\approx A$.
\end{proposition}
\begin{proof}
- Take a bijection $f$ from $A$ to $B$ by \cref{equinum}.
+ Take $f$ such that $f$ is a bijection from $A$ to $B$ by \cref{equinum}.
Then $\converse{f}$ is a bijection from $B$ to $A$ by \cref{bijection_converse_is_bijection}.
Follows by \cref{equinum}.
\end{proof}
@@ -32,8 +32,8 @@
Suppose $A\approx B\approx C$. Then $A\approx C$.
\end{proposition}
\begin{proof}
- Take a bijection $f$ from $A$ to $B$ by \cref{equinum}.
- Take a bijection $g$ from $B$ to $C$ by \cref{equinum}.
+ Take $f$ such that $f$ is a bijection from $A$ to $B$ by \cref{equinum}.
+ Take $g$ such that $g$ is a bijection from $B$ to $C$ by \cref{equinum}.
Then $g\circ f$ is a bijection from $A$ to $C$ by \cref{bijection_circ}.
Follows by \cref{equinum}.
\end{proof}
@@ -46,16 +46,33 @@
Then $A\approx B$.
\end{theorem}
\begin{proof}
+ For all $X\in\pow{A}$ we have
+ $A\setminus \img{g}{B\setminus\img{f}{X}}\subseteq A$
+ by \cref{setminus_subseteq}.
+ For all $X\in\pow{A}$ we have
+ $A\setminus \img{g}{B\setminus\img{f}{X}}\in\pow{A}$
+ by \cref{powerset_intro}.
Let $h(X) = A\setminus \img{g}{B\setminus\img{f}{X}}$ for $X\in\pow{A}$.
- %By construction: $h$ is a relation.
- %By construction: $h$ is right-unique.
- %By construction: $\dom{h} = \pow{A}$.
- For all $X\in\pow{A}$ we have $h(X)\in\pow{A}$ by \cref{setminus_subseteq,pow_iff}.
- Thus $h$ is a function from $\pow{A}$ to $\pow{A}$.
+ For all $X\in\pow{A}$ we have
+ $(X,A\setminus \img{g}{B\setminus\img{f}{X}})\in h$ by assumption.
+ $h$ is a relation by \cref{relation}.
+ $h$ is right-unique by \cref{rightunique,pair_eq_iff}.
+ Thus $h$ is a function by assumption.
+ For all $X\in\pow{A}$ we have
+ $h(X) = A\setminus \img{g}{B\setminus\img{f}{X}}$
+ by \cref{function_apply_intro}.
+ For all $X\in\pow{A}$ we have $h(X)\in\pow{A}$ by assumption.
+ For all $X$ we have if $X\in\dom{h}$, then $X\in\pow{A}$
+ by \cref{dom_iff,pair_eq_iff}.
+ For all $X$ we have if $X\in\pow{A}$, then $X\in\dom{h}$
+ by \cref{dom_iff}.
+ Thus $\dom{h} = \pow{A}$ by set extensionality.
+ $h$ is a function to $\pow{A}$ by assumption.
+ Thus $h$ is a function from $\pow{A}$ to $\pow{A}$ by \cref{funs_intro}.
$h$ is \subseteq-preserving by \cref{subseteqpreserving,img_subseteq,subseteq_implies_setminus_supseteq}. % apply each each lemma twice (alternating).
- Take a fixpoint $X$ of $h$ by \cref{knastertarski}.
+ Take $X$ such that $X$ is a fixpoint of $h$ by \cref{knastertarski}.
Now $X = A\setminus \img{g}{B\setminus\img{f}{X}}$ by \cref{fixpoint}.
$\img{g}{B\setminus\img{f}{X}}\subseteq A$.
diff --git a/library/status.md b/library/status.md
index f5da116..bbb67bd 100644
--- a/library/status.md
+++ b/library/status.md
@@ -1,8 +1,10 @@
-# Active library migration status
+# Active typed library status
-This file records the dependency boundary and cutover consequences for the
-content-addressed migration. It is not a theorem-authority manifest and does
-not duplicate computed IDs or premise lineages.
+This file records the active aggregate boundary and the consequences of the
+completed content-addressed cutover. It is not a theorem-authority manifest
+and does not duplicate computed IDs or premise lineages. Every production
+`Verify` invocation uses the exact typed driver; the lists below record the
+accepted library inventory, not a routing selector.
## Typed closures
@@ -17,7 +19,7 @@ set/suc.tex
nat.tex
```
-Phase 5.3 additionally selects these ordinary library roots:
+Phase 5.3 activated these ordinary library roots:
```text
set/symdiff.tex
@@ -32,19 +34,66 @@ relation/uniqueness.tex
function.tex
set/cantor.tex
set/fixpoint.tex
+set/equinumerosity.tex
+order/quasiorder.tex
+order/order.tex
+relation/equivalence.tex
+relation/closure.tex
+algebra/magma.tex
+algebra/semigroup.tex
+algebra/monoid.tex
+algebra/quasigroup.tex
+algebra/loop.tex
+order/semilattice.tex
+topology/preclosure.tex
+topology/topological-space.tex
+topology/basis.tex
+topology/disconnection.tex
+topology/separation.tex
+ordinal.tex
+cardinal.tex
+everything.tex
```
-Each selected root has a wholly typed dependency closure. In particular,
+Each activated root has a wholly typed dependency closure. In particular,
`set/bipartition.tex` imports the typed `set.tex`, `set/cons.tex`, and
`set/powerset.tex` modules; `set/product.tex` imports only typed `set.tex`;
and `set/filter.tex` imports typed `set.tex` and `set/powerset.tex`. No
-selected graph has a legacy edge. The typed `relation.tex` root imports, in
+activated graph has an untyped dependency. The typed `relation.tex` root imports, in
source order, `set.tex`, `set/powerset.tex`, and `set/product.tex`; its
-two selected property modules each import typed `set.tex` and `relation.tex`
+two activated property modules each import typed `set.tex` and `relation.tex`
in source order. The typed `function.tex` root imports, in source order,
-`set.tex`, `relation.tex`, and `relation/uniqueness.tex`. Later relation,
-order, and function dependents remain unselected. The typed Cantor and
+`set.tex`, `relation.tex`, and `relation/uniqueness.tex`. The typed Cantor and
fixpoint roots each import `set/powerset.tex` followed by `function.tex`.
+The typed equinumerosity root imports `set/powerset.tex`, `set/fixpoint.tex`,
+and `function.tex` in source order. The typed quasiorder root imports
+`relation.tex` and `relation/properties.tex`; the typed order root imports
+those modules followed by `order/quasiorder.tex`. Both import lists retain
+source order. The typed equivalence root imports `set.tex`,
+`set/partition.tex`, `relation.tex`, and `order/quasiorder.tex`; the typed
+relation-closure root imports `relation/properties.tex` followed by
+`relation/equivalence.tex`. The typed magma root imports only `function.tex`,
+the semigroup root imports only `algebra/magma.tex`, and the monoid root
+imports only `algebra/semigroup.tex`. Quasigroup forms the second branch over
+`algebra/magma.tex`; loop imports only `algebra/quasigroup.tex`, whose sealed
+interface carries its unital-magma parent as a direct structure parent. These
+lists also retain source order. The typed meet-semilattice root imports
+`order/order.tex` followed by `function.tex`; the latter is the explicit owner
+of source-level graph application used by `meet[X](x,y)`. The standalone typed
+preclosure root imports `set.tex` followed by `function.tex` for the same
+reason. The typed topological-space root imports `set.tex`,
+`set/powerset.tex`, and `set/cons.tex` in source order. The typed basis root
+imports `topology/topological-space.tex`, `set.tex`, and `set/powerset.tex`;
+the disconnection root imports `set.tex`, `set/bipartition.tex`, and
+`topology/topological-space.tex`; and the separation root imports
+`topology/topological-space.tex` followed by `set.tex`. These lists retain
+source order. The typed ordinal root imports `set.tex`, `set/cons.tex`,
+`set/powerset.tex`, `set/regularity.tex`, and `set/suc.tex`; the typed
+cardinal root imports `set.tex`, `ordinal.tex`, `function.tex`, and `nat.tex`.
+The active `everything.tex` aggregate retains its existing 31 direct
+imports in source order. Its complete graph is typed, and it is now the sole
+`make lib` corpus root. Other ordinary roots still use the same typed
+production driver when invoked directly.
## Fixed-foundation and prelude replacement
@@ -87,12 +136,12 @@ the clean checked `PairSetCharacteristic` fact. Tuple notation `(a,b)` resolves
to the opaque source-owned ordered-pair object. Its defining and projection
axioms retain source-axiom safety.
-The production typed-root selection includes the five protected roots and the
-twelve Phase 5.3 ordinary library roots. Each selected invocation installs the
+The active inventory includes the five protected roots and the twenty-eight
+Phase 5.3 ordinary library roots. Every verification invocation acquires the
exact packaged final prelude before parsing and uses its syntax and semantics
-as the first implicit inputs. The final prelude now supplies `pow_iff` through
-the exact clean `PowerSetCharacteristic`; `set/powerset.tex` declares no local
-replacement axiom.
+as the first implicit inputs. The final prelude supplies
+`pow_iff` through the exact clean `PowerSetCharacteristic`;
+`set/powerset.tex` declares no local replacement axiom.
The base relation module deliberately has mixed, premise-derived authority.
Facts whose proofs use only clean set and relation facts, including
@@ -122,12 +171,128 @@ definitions have clean defining-equation authority, while Knaster--Tarski
inherits `SourceAxiom` safety through the existing function and ordered-pair
layer. Neither module introduces a source axiom or an `Omitted` authorization.
-`relation/equivalence.tex`, `relation/closure.tex`, all order modules, and
-remaining importers of `function.tex`, including `set/equinumerosity.tex`,
-remain outside the typed selection. An invocation rooted at one of these
-modules therefore remains wholly legacy until its complete graph is migrated.
+Equinumerosity is typed against the final prelude and its three sealed direct
+imports. Its local function `h` is a scoped replacement graph and its local set
+`h'` is likewise proof-local; neither is published in the module interface or
+prefix. The ordinary definition has clean defining-equation authority, while
+the elementary bijection results inherit the ordered-pair layer's
+`SourceAxiom` safety. Cantor--Schroeder--Bernstein retains its single existing
+proof-level `Omitted`; the module introduces no source axiom or additional
+escape hatch.
-The active `library/everything.tex` root remains unselected on the transitional
-legacy route and currently does not verify. Its first failure is the removed
-`setext` provider referenced by `set.tex`. It must not receive a compatibility
-provider or a mixed typed/legacy graph.
+The final prelude owns the metadata-only `onesorted structure` descriptor and
+its opaque `carrier : Set -> Set` operation. Ordinary structures publish a
+transparent predicate definition and independently checked clean projection
+facts. `order/quasiorder.tex` owns the opaque `lt` operation;
+`order/order.tex` imports that descriptor and reuses the same operation object
+without allocating a replacement. Both modules mint neither `SourceAxiom` nor
+`Omitted`; ordinary results inherit any ordered-pair safety solely from their
+selected premises.
+
+The equivalence module preserves its transparent quotient and bounded
+relation constructions, including source-owned ordered-pair semantics. It
+mints no source axiom and retains exactly the five existing direct
+`OmittedAuthorization` results at the end of the module. All preceding
+declarations check normally. The relation-closure module publishes three
+clean transparent defining equations and no direct escape hatch; its
+reflexivity theorem truthfully inherits `SourceAxiom` safety through the
+selected identity and ordered-pair facts.
+
+The magma module owns the opaque `mul` operation; unital magma adds the opaque
+`neutral` operation. The public `cdot` spelling is a contextual transparent
+abbreviation: it keeps surface arity two while its expansion receives the
+active structure set as a hidden argument and resolves the exact `mul` object.
+The structure definitions and projections are clean, and the module introduces
+neither a source axiom nor an `Omitted` authorization.
+
+The semigroup hierarchy reuses magma's exact `mul` object. Its associativity
+and regularity laws quantify over `carrier[A]`; inverse semigroup adds no
+operation and proves its inheritance and idempotent-orbit result with ordinary
+clean exact authority. It introduces neither a source axiom nor an `Omitted`
+authorization.
+
+Monoid inherits unital magma's exact `mul` and `neutral` objects and restores
+the carrier-scoped associativity law. Its implication to semigroup is an
+ordinary clean exact proof; the module introduces no operation or escape
+hatch.
+
+Quasigroup inherits magma's `mul` and owns the opaque `ldiv` and `rdiv`
+operations in that source order. Its six carrier-scoped laws have stable
+projection labels, and both cancellation results are clean exact proofs from
+the corresponding division laws. It introduces no escape hatch.
+
+Loop has direct structure parents quasigroup and unital magma and owns no
+operation. The shared `carrier` and `mul` ancestors coalesce by exact object
+identity; the descriptor inherits the exact `ldiv`, `rdiv`, and `neutral`
+objects without allocating replacements. Its defining and inheritance facts
+are clean, and it introduces no escape hatch.
+
+Meet semilattice has the exact ordered-set parent. Its descriptor reuses the
+parent's `carrier` and `lt` objects and owns only the opaque `meet` operation.
+Closure, lower-bound, greatest-lower-bound, and idempotence are explicitly
+scoped to `carrier[X]`. The structure definition, projections, and theorem
+have clean exact authority and introduce no escape hatch.
+
+Preclosure space has the metadata-only onesorted parent. Its descriptor reuses
+the final prelude's exact `carrier` object and owns only the opaque `cl`
+operation. Its four labeled laws state carrier-bounded closure, empty-set
+preservation, extensivity, and binary-union preservation through explicit
+`cl[X]` applications. All generated facts are clean and the module introduces
+no theorem, source axiom, or `Omitted` authorization.
+
+Topological space also has the metadata-only onesorted parent, reuses the exact
+`carrier` object, and owns only the opaque `opens` operation. Its four labeled
+laws and structure definition are clean. The unqualified `U is open`
+abbreviation remains a contextual transparent target requiring that exact
+`opens` object; the explicit `U is open in X` form remains available without
+an active structure annotation. All ordinary topology definitions are
+transparent. The module has no local source axiom and retains exactly its two
+pre-existing direct proof omissions, at `interior_elem_elim` and the nested
+case in `intersection_of_closed_is_closed_infinite`. Omitted safety propagates
+only through selected dependencies; no local fact inherits `SourceAxiom`.
+
+The three direct topology consumers were activated as sibling maximal roots.
+`topology/basis.tex` retains its transparent covering and generated-topology
+definitions, and every local fact is clean; explicit local discharges prevent
+the imported topology and powerset inventories from contributing incidental
+escape safety. `topology/disconnection.tex` retains the opaque source-owned
+ordered-pair meaning of `(U,V)`, `fst`, and `snd`. Its reverse theorem and both
+definitions are clean, while `disconnection_from_disconnected` truthfully
+inherits `SourceAxiom` safety from the selected ordered-pair projection laws.
+The module mints no local escape authority.
+
+`topology/separation.tex` retains exactly six direct proof-level omissions and
+mints no source axiom. The two direct omissions in the imported
+topological-space interface remain distinct imported authority; no current
+ordinary separation fact selects them. Compound separation-space phrases keep
+the exact topological-space annotation and therefore reuse the inherited
+`carrier` and `opens` objects. Four regularity statements now require the
+inhabitedness of `carrier[X]`, rather than incorrectly asserting inhabitedness
+of the structure parameter itself; these deliberate statement corrections
+change the affected proposition and downstream artifact identities. The
+direct omission sites remain scoped to their original theorem candidates.
+
+The ordinal development introduces no source axiom or omission. Its existing
+public definitions and theorem statements retain their mathematical content;
+two checked helper lemmas make the nested membership-connex argument explicit
+under the exact one-outermost-induction rule. Narrow premise selection keeps
+the resulting ordinal facts clean. `cardinal.tex` required no source rewrite:
+its transparent finite, infinite, and cardinality declarations compile
+directly against the sealed ordinal, function, set, and naturals interfaces.
+The aggregate's final reflexive claim has an ordinary checked proof.
+
+The active aggregate intentionally does not import the typed peripheral
+modules `set/equinumerosity.tex` and `topology/preclosure.tex`; they remain
+valid typed roots but are not part of the active library inventory. Three
+other developments remain outside the active aggregate: `subfinite.tex`
+awaits the recorded injection-direction decision, `logic/propositional.tex`
+is an experimental standalone
+development, and the unused `topology/order-topology.tex` sketch remains
+incomplete with duplicate markers and empty laws. If invoked directly, they
+still enter the typed driver and receive its ordinary located rejection; no
+compatibility provider or fallback exists.
+
+`make lib` now verifies only `library/everything.tex` against one fresh store.
+The aggregate covers every module in its active inventory transitively;
+production-corpus verification is no longer repeated across overlapping
+frontier roots.
diff --git a/library/topology/basis.tex b/library/topology/basis.tex
index cc9d7e5..4c1ac79 100644
--- a/library/topology/basis.tex
+++ b/library/topology/basis.tex
@@ -13,11 +13,23 @@
Suppose $C$ covers $X$.
Then $X\subseteq\unions{C}$.
\end{proposition}
+\begin{proof}
+ For all $x\in X$ there exists $U\in C$ such that $x\in U$
+ by assumption.
+ For all $x\in X$ we have $x\in\unions{C}$ by \cref{unions_iff}.
+ Follows by \cref{subseteq}.
+\end{proof}
\begin{proposition}\label{covers_unions_elim}
Suppose $X\subseteq\unions{C}$.
Then $C$ covers $X$.
\end{proposition}
+\begin{proof}
+ For all $x\in X$ we have $x\in\unions{C}$ by \cref{subseteq}.
+ For all $x\in X$ there exists $U\in C$ such that $x\in U$
+ by \cref{unions_iff}.
+ Follows by assumption.
+\end{proof}
% Also called "prebase", "subbasis", or "subbase". We prefer "pre-" or "quasi-"
% for consistency when handling generalizations, even if "subbasis" is more common.
@@ -36,6 +48,7 @@
If $\unions{B} = X$,
then $B$ is a family of subsets of $X$ and $B$ covers $X$
by \cref{covers_unions_intro,subseteq_refl,covers_unions_elim}.
+ Follows by assumption.
\end{proof}
% Also called "base of topology".
@@ -55,6 +68,13 @@
Assume $B$ is a topological basis for $X$.
$\emptyset \in \genOpens{B}{X}$.
\end{lemma}
+\begin{proof}
+ $\emptyset\in\pow{X}$ by \cref{emptyset_subseteq,pow_iff}.
+ For all $x\in\emptyset$ there exists $V\in B$
+ such that $x\in V\subseteq\emptyset$
+ by \cref{emptyset_subseteq,subseteq}.
+ Follows by \cref{genopens}.
+\end{proof}
@@ -64,18 +84,25 @@
Then $\unions{F}\in\genOpens{B}{X}$.
\end{lemma}
\begin{proof}
- We have $\unions{F} \in \pow{X}$ by \cref{genopens,subseteq,pow_iff,unions_family,powerset_elim}.
+ For all $x\in\unions{F}$ we have $x\in X$
+ by \cref{unions_iff,genopens,subseteq}.
+ We have $\unions{F}\in\pow{X}$ by \cref{pow_iff,subseteq}.
- Show for all $x\in \unions{F}$ there exists $W \in B$
- such that $x\in W$ and $W \subseteq \unions{F}$.
+ Show for all $x$ we have if $x\in\unions{F}$, then
+ there exists $W\in B$ such that $x\in W$ and
+ $W\subseteq\unions{F}$.
\begin{subproof}
- Fix $x \in \unions{F}$.
- There exists $V \in F$ such that $x \in V$ by \cref{unions_iff}.
- $V \in \genOpens{B}{X}$.
- There exists $W \in B$ such that $x \in W \subseteq V$.
- Then $W \subseteq \unions{F}$.
+ Fix $x$.
+ Assume $x\in\unions{F}$.
+ Take $V$ such that $V\in F$ and $x\in V$ by \cref{unions_iff}.
+ $V\in\genOpens{B}{X}$ by \cref{subseteq}.
+ Take $W$ such that $W\in B$ and $x\in W\subseteq V$
+ by \cref{genopens}.
+ $V\subseteq\unions{F}$ by \cref{unions_iff,subseteq}.
+ $W\subseteq\unions{F}$ by \cref{subseteq_transitive}.
+ Follows by assumption.
\end{subproof}
- Then $\unions{F}\in\genOpens{B}{X}$ by \cref{genopens}.
+ Follows by \cref{genopens}.
\end{proof}
\begin{lemma}\label{basis_is_in_genopens}
@@ -83,14 +110,19 @@
$B \subseteq \genOpens{B}{X}$.
\end{lemma}
\begin{proof}
- We show for all $V \in B$ $V \in \genOpens{B}{X}$.
+ Show for all $V$ we have if $V\in B$, then
+ $V\in\genOpens{B}{X}$.
\begin{subproof}
- Fix $V \in B$.
- For all $x \in V$ $x \in V \subseteq V$.
- $V \subseteq X$ by \cref{topological_prebasis_iff_covering_family,topological_basis}.
- $V \in \pow{X}$.
- $V \in \genOpens{B}{X}$.
+ Fix $V$.
+ Assume $V\in B$.
+ $V\subseteq X$
+ by \cref{topological_prebasis_iff_covering_family,topological_basis}.
+ $V\in\pow{X}$ by \cref{pow_iff,subseteq}.
+ For all $x\in V$ there exists $W\in B$
+ such that $x\in W\subseteq V$ by \cref{subseteq_refl}.
+ Follows by \cref{genopens}.
\end{subproof}
+ Follows by \cref{subseteq}.
\end{proof}
\begin{lemma}\label{all_is_in_genopens}
@@ -98,11 +130,10 @@
$X \in \genOpens{B}{X}$.
\end{lemma}
\begin{proof}
- $B$ covers $X$ by \cref{topological_prebasis_iff_covering_family,topological_basis}.
- $\unions{B} \in \genOpens{B}{X}$.
- $X \subseteq \unions{B}$.
- For all $x\in X$ there exists $V\in B$ such that $x\in V\subseteq X$.
- Follows by \cref{powerset_top,genopens}.
+ $X\in\pow{X}$ by \cref{pow_iff,subseteq_refl}.
+ For all $x\in X$ there exists $V\in B$ such that $x\in V\subseteq X$
+ by \cref{topological_prebasis_iff_covering_family,topological_basis,pow_iff,subseteq}.
+ Follows by \cref{genopens}.
\end{proof}
\begin{lemma}\label{inters_in_genopens}
@@ -111,23 +142,25 @@
Then $(A\inter C) \in \genOpens{B}{X}$.
\end{lemma}
\begin{proof}
+ For all $x\in A\inter C$ we have $x\in X$
+ by \cref{genopens,inter_elim_left,pow_iff,subseteq}.
+ We have $(A\inter C)\in\pow{X}$ by \cref{pow_iff,subseteq}.
- We have $(A \inter C) \in \pow{X}$ by \cref{genopens,inter_powerset}.
-
- Show for all $x\in A\inter C$ there exists $W \in B$
- such that $x\in W$ and $W \subseteq A\inter C$.
+ Show for all $x$ we have if $x\in A\inter C$, then
+ there exists $W\in B$ such that $x\in W$ and $W\subseteq A\inter C$.
\begin{subproof}
- Fix $x \in A\inter C$.
- Then $x\in A,C$.
- There exists $V' \in B$ such that $x \in V' \subseteq A$ by \cref{genopens}.
- There exists $V'' \in B$ such that $x \in V''\subseteq C$ by \cref{genopens}.
- There exists $W \in B$ such that $x \in W \subseteq V', V''$ by \cref{topological_basis}.
-
- Show $W \subseteq A\inter C$.
- \begin{subproof}
- For all $y \in W$ we have $y \in V'$ and $y \in V''$.
- \end{subproof}
+ Fix $x$.
+ Assume $x\in A\inter C$.
+ $x\in A,C$ by \cref{inter_elim_left,inter_elim_right}.
+ Take $V'$ such that $V'\in B$ and $x\in V'\subseteq A$
+ by \cref{genopens}.
+ Take $V''$ such that $V''\in B$ and $x\in V''\subseteq C$
+ by \cref{genopens}.
+ Take $W$ such that $W\in B$ and $x\in W$ and
+ $W\subseteq V',V''$ by \cref{topological_basis}.
+ $W\subseteq A,C$ by \cref{subseteq_transitive}.
+ $W\subseteq A\inter C$ by \cref{inter_intro,subseteq}.
+ Follows by assumption.
\end{subproof}
-
- $(A\inter C) \in \genOpens{B}{X}$ by \cref{genopens}.
+ Follows by \cref{genopens}.
\end{proof}
diff --git a/library/topology/disconnection.tex b/library/topology/disconnection.tex
index e3730f3..90c635d 100644
--- a/library/topology/disconnection.tex
+++ b/library/topology/disconnection.tex
@@ -23,10 +23,14 @@
Then there exists a disconnection of $X$.
\end{proposition}
\begin{proof}
- Take $U, V\in\opens[X]$ such that $\carrier[X]$ is partitioned by $U$ and $V$
+ Take $U,V$ such that $U,V\in\opens[X]$ and
+ $\carrier[X]$ is partitioned by $U$ and $V$
by \cref{disconnected}.
- Then $(U, V)$ is a bipartition of $\carrier[X]$.
- Thus $(U, V)$ is a disconnection of $X$ by \cref{disconnections,times_proj_elim,times_tuple_intro}.
+ $(U,V)$ is a bipartition of $\carrier[X]$ by \cref{bipartition_intro}.
+ $\fst{(U,V)}=U$ by \cref{fst_eq}.
+ $\snd{(U,V)}=V$ by \cref{snd_eq}.
+ $(U,V)\in\disconnections{X}$ by \cref{disconnections}.
+ Follows by assumption.
\end{proof}
\begin{proposition}\label{disconnected_from_disconnection}
@@ -35,8 +39,12 @@
Then $X$ is disconnected.
\end{proposition}
\begin{proof}
- $\fst{D}, \snd{D}\in\opens[X]$.
- $\carrier[X]$ is partitioned by $\fst{D}$ and $\snd{D}$.
+ $D\in\disconnections{X}$ by assumption.
+ $D\in\bipartitions{\carrier[X]}$ by \cref{disconnections}.
+ $\fst{D},\snd{D}\in\opens[X]$ by \cref{disconnections}.
+ $\carrier[X]$ is partitioned by $\fst{D}$ and $\snd{D}$
+ by \cref{bipartitions_of_a_set}.
+ Follows by \cref{disconnected}.
\end{proof}
\begin{abbreviation}\label{connected}
diff --git a/library/topology/preclosure.tex b/library/topology/preclosure.tex
index 6c104be..e9ed27f 100644
--- a/library/topology/preclosure.tex
+++ b/library/topology/preclosure.tex
@@ -1,18 +1,22 @@
\import{set.tex}
+\import{function.tex}
\section{Preclosure spaces}
-\begin{struct}
+\begin{struct}\label{preclosure_space}
A preclosure space $X$ is a onesorted structure equipped with
\begin{enumerate}
\item $\cl$
\end{enumerate}
such that
\begin{enumerate}
- \item For all $Y\subseteq X$ we have $\cl(Y)\subseteq X$.
- \item $\cl(\emptyset) = \emptyset$.
- \item For all $A$ we have $A\subseteq \cl(A)$.
- \item For all $A, B$ we have $\cl(A\union B) = \cl(A) \union \cl(B)$.
+ \item\label{preclosure_type} For all $Y\subseteq\carrier[X]$ we have
+ $\cl[X](Y)\subseteq\carrier[X]$.
+ \item\label{preclosure_empty} $\cl[X](\emptyset)=\emptyset$.
+ \item\label{preclosure_extensive} For all $A\subseteq\carrier[X]$ we have
+ $A\subseteq\cl[X](A)$.
+ \item\label{preclosure_union} For all $A,B\subseteq\carrier[X]$ we have
+ $\cl[X](A\union B)=\cl[X](A)\union\cl[X](B)$.
\end{enumerate}
\end{struct}
diff --git a/library/topology/separation.tex b/library/topology/separation.tex
index ad8cad1..5806216 100644
--- a/library/topology/separation.tex
+++ b/library/topology/separation.tex
@@ -32,11 +32,13 @@
$x\in A\not\ni y$ or $x\notin A\ni y$.
\end{proposition}
\begin{proof}
- Take $U\in\opens[X]$ such that $x\in U\not\ni y$ or $x\notin U\ni y$
+ Take $U$ such that
+ $U\in\opens[X]\land ((x\in U\land y\notin U)\lor(x\notin U\land y\in U))$
by \cref{is_kolmogorov}.
Then $\carrier[X]\setminus U\in\closeds{X}$ by \cref{complement_of_open_elem_closeds}.
Now $x\in (\carrier[X]\setminus U)\not\ni y$ or $x\notin (\carrier[X]\setminus U)\ni y$
by \cref{setminus}.
+ Follows by assumption.
\end{proof}
\begin{proposition}\label{kolmogorov_for_closeds_implies_kolmogorov}
@@ -138,15 +140,7 @@
Then $X$ is a \teeone-space.
\end{proposition}
\begin{proof}
- We show that for all $x,y\in\carrier[X]$ such that $x\neq y$
- there exist $U, V\in\opens[X]$ such that
- $U\ni x\notin V$ and $V\ni y\notin U$.
- \begin{subproof}
- $X$ is hausdorff.
- For all $x,y\in\carrier[X]$ such that $x\neq y$
- there exist $U, V\in\opens[X]$ such that
- $x\in U$ and $y\in V$ and $U$ is disjoint from $V$.
- \end{subproof}
+ Follows by \cref{is_hausdorff,teeone,disjoint}.
\end{proof}
\begin{definition}\label{is_regular}
@@ -168,7 +162,7 @@
\begin{proposition}\label{teethree_implies_closed_neighbourhood_in_open}
Let $X$ be a topological space.
- Suppose $X$ is inhabited.
+ Suppose $\carrier[X]$ is inhabited.
Suppose $X$ is \teethree\ .
For all $U \in \opens[X]$ we have for all $x \in U$ we have there exist $N \in \neighbourhoods{x}{X}$ such that $N \subseteq U$ and $N$ is closed in $X$.
\end{proposition}
@@ -193,7 +187,7 @@
\begin{proposition}\label{teethree_iff_each_closed_is_intersection_of_its_closed_neighborhoods}
Let $X$ be a topological space.
- Suppose $X$ is inhabited.
+ Suppose $\carrier[X]$ is inhabited.
$X$ is \teethree\ iff for all $H \in \closeds{X}$ such that $F = \{ N \in \neighbourhoodsSet{H}{X} \mid N \in \closeds{X}\}$ we have $H = \inters{F}$.
\end{proposition}
\begin{proof}
@@ -207,12 +201,13 @@
\begin{subproof}
Omitted.
\end{subproof}
+ Follows by assumption.
\end{proof}
\begin{proposition}\label{teethree_iff_closed_neighbourhood_in_open}
Let $X$ be a topological space.
- Suppose $X$ is inhabited.
+ Suppose $\carrier[X]$ is inhabited.
$X$ is \teethree\ iff for all $U \in \opens[X]$ we have for all $x \in U$ we have there exist $N \in \neighbourhoods{x}{X}$ such that $N \subseteq U$ and $N$ is closed in $X$.
\end{proposition}
\begin{proof}
@@ -223,7 +218,7 @@
\begin{proposition}\label{teethree_space_is_teetwo_space}
Let $X$ be a \teethree-space.
- Suppose $X$ is inhabited.
+ Suppose $\carrier[X]$ is inhabited.
Then $X$ is a \teetwo-space.
\end{proposition}
\begin{proof}
diff --git a/library/topology/topological-space.tex b/library/topology/topological-space.tex
index 8076c5f..4f3eb38 100644
--- a/library/topology/topological-space.tex
+++ b/library/topology/topological-space.tex
@@ -41,9 +41,10 @@
Then $A\union B$ is open.
\end{proposition}
\begin{proof}
- $\{A, B\}\subseteq \opens$.
- $\unions{\{A, B\}}$ is open.
- $\unions{\{A, B\}} = A\union B$.
+ $\{A, B\}\subseteq\opens$ by \cref{cons_iff,subseteq}.
+ $\unions{\{A, B\}}$ is open by \cref{opens_unions}.
+ $\unions{\{A, B\}}=A\union B$ by \cref{union_as_unions}.
+ Follows by assumption.
\end{proof}
\begin{definition}[Interiors]\label{interiors}
@@ -59,7 +60,8 @@
Then $a\in\interior{A}{X}$.
\end{proposition}
\begin{proof}
- $U\in\interiors{A}{X}$.
+ $U\in\interiors{A}{X}$ by \cref{interiors}.
+ Follows by \cref{interior,unions_intro}.
\end{proof}
\begin{proposition}[Interior]\label{interior_elem_elim}
@@ -87,7 +89,7 @@
Then $\interior{U}{X} = U$.
\end{proposition}
\begin{proof}
- $U\in\interiors{U}{X}$.
+ $U\in\interiors{U}{X}$ by \cref{interiors,subseteq_refl}.
Follows by \cref{subseteq,interior_elem_iff,neq_witness}.
\end{proof}
@@ -96,12 +98,18 @@
Then $\interior{A}{X}$ is open.
\end{proposition}
\begin{proof}
- $\interiors{A}{X}\subseteq\opens[X]$.
+ $\interiors{A}{X}\subseteq\opens[X]$ by \cref{interiors,subseteq}.
+ Follows by \cref{interior,opens_unions}.
\end{proof}
\begin{proposition}\label{interior_subseteq}
Then $\interior{A}{X}\subseteq A$.
\end{proposition}
+\begin{proof}
+ For all $U\in\interiors{A}{X}$ we have $U\subseteq A$
+ by \cref{interiors}.
+ Follows by \cref{interior,unions_iff,subseteq}.
+\end{proof}
\begin{proposition}\label{interior_maximal}
Let $X$ be a topological space.
@@ -109,27 +117,36 @@
Suppose $U$ is open.
Then $U\subseteq \interior{A}{X}$.
\end{proposition}
+\begin{proof}
+ $U\in\interiors{A}{X}$ by \cref{interiors}.
+ $U\subseteq\unions{\interiors{A}{X}}$ by \cref{unions_iff,subseteq}.
+ Follows by \cref{interior}.
+\end{proof}
\begin{proposition}\label{interior_eq_self_implies_open}
Let $X$ be a topological space.
Suppose $\interior{A}{X} = A$.
Then $A$ is open.
\end{proposition}
+\begin{proof}
+ $\interior{A}{X}$ is open by \cref{interior_is_open}.
+ Follows by assumption.
+\end{proof}
\begin{corollary}\label{interior_eq_self_iff_open}
Let $X$ be a topological space.
Then $\interior{A}{X} = A$ iff $A$ is open in $X$.
\end{corollary}
+\begin{proof}
+ Follows by \cref{interior_eq_self_implies_open,interior_of_open}.
+\end{proof}
\begin{proposition}\label{interior_carrier}
Let $X$ be a topological space.
$\interior{\carrier[X]}{X} = \carrier[X]$.
\end{proposition}
\begin{proof}
- $\carrier[X]\in\opens[X]$.
- $\carrier[X]\subseteq\carrier[X]$ by \cref{subseteq_refl}.
- Thus $\carrier[X]\in\interiors{\carrier[X]}{X}$ by \cref{interiors}.
- Follows by set extensionality.
+ Follows by \cref{carrier_open,interior_of_open}.
\end{proof}
\begin{proposition}\label{interior_type}
@@ -137,10 +154,11 @@
Then $\interior{A}{X}\in\pow{\carrier[X]}$.
\end{proposition}
\begin{proof}
- We have $\interiors{A}{X}\subseteq \pow{\carrier[X]}$.
- % As they are open subsets of X containing A
- %
- Thus $\interior{A}{X}\subseteq \carrier[X]$ by \cref{interior,unions_subseteq_of_powerset_is_subseteq}.
+ We have $\interiors{A}{X}\subseteq \pow{\carrier[X]}$
+ by \cref{interiors,opens_type,subseteq}.
+ For all $x\in\interior{A}{X}$ we have $x\in\carrier[X]$
+ by \cref{interior,unions_iff,pow_iff,subseteq}.
+ Follows by \cref{pow_iff}.
\end{proof}
\subsection{Closed sets}
@@ -158,7 +176,8 @@
Then $\emptyset$ is closed in $X$.
\end{proposition}
\begin{proof}
- $\carrier[X]\setminus \emptyset = \carrier[X]$.
+ $\carrier[X]\setminus \emptyset = \carrier[X]$ by \cref{setminus_emptyset}.
+ Follows by \cref{is_closed_in,carrier_open}.
\end{proof}
\begin{proposition}\label{carrier_is_closed}
@@ -166,7 +185,7 @@
Then $\carrier[X]$ is closed in $X$.
\end{proposition}
\begin{proof}
- $\carrier[X]\setminus \carrier[X] = \emptyset$.
+ $\carrier[X]\setminus \carrier[X] = \emptyset$ by \cref{setminus_self}.
Follows by \cref{emptyset_open,is_closed_in}.
\end{proof}
@@ -191,10 +210,14 @@
Then $\carrier[X]\setminus U\in\closeds{X}$.
\end{proposition}
\begin{proof}
- $\carrier[X]\setminus U\in\pow{\carrier[X]}$.
+ $\carrier[X]\setminus U\subseteq\carrier[X]$
+ by \cref{setminus_subseteq}.
+ $\carrier[X]\setminus U\in\pow{\carrier[X]}$
+ by \cref{pow_iff,subseteq}.
$U\subseteq\carrier[X]$ by \cref{opens_type}.
Hence $\carrier[X]\setminus(\carrier[X]\setminus U) = U$ by \cref{double_relative_complement}.
- $\carrier[X]\setminus U$ is closed in $X$.
+ $\carrier[X]\setminus U$ is closed in $X$ by \cref{is_closed_in}.
+ Follows by \cref{closeds}.
\end{proof}
@@ -211,7 +234,14 @@
Then $\closure{\emptyset}{X} = \emptyset$.
\end{proposition}
\begin{proof}
- $\emptyset\in\closures{\emptyset}{X}$.
+ $\emptyset\in\pow{\carrier[X]}$ by \cref{emptyset_subseteq,pow_iff}.
+ $\emptyset$ is closed in $X$ by \cref{emptyset_is_closed}.
+ $\emptyset\in\closures{\emptyset}{X}$ by \cref{closures,subseteq_refl}.
+ For all $x\in\closure{\emptyset}{X}$ we have $x\in\emptyset$
+ by \cref{closure,inters_subseteq_elem,subseteq}.
+ For all $x\in\emptyset$ we have $x\in\closure{\emptyset}{X}$
+ by \cref{emptyset_subseteq,subseteq}.
+ Follows by set extensionality.
\end{proof}
\begin{proposition}\label{closure_carrier}
@@ -219,12 +249,18 @@
Then $\closure{\carrier[X]}{X} = \carrier[X]$.
\end{proposition}
\begin{proof}
- %For all $D\in\closures{\carrier[X]}{X}$ we have $\carrier[X]\subseteq D$ by \cref{closures}.
- %For all $D\in\closures{\carrier[X]}{X}$ we have $\carrier[X]\supseteq D$ by \cref{pow_iff,closures}.
- %For all $D\in\closures{\carrier[X]}{X}$ we have $\carrier[X] = D$ by \cref{subseteq_antisymmetric}.
+ For all $D\in\closures{\carrier[X]}{X}$ we have $\carrier[X]\subseteq D$
+ by \cref{closures}.
+ For all $D\in\closures{\carrier[X]}{X}$ we have
+ $D\in\pow{\carrier[X]}$ by \cref{closures}.
+ For all $D\in\closures{\carrier[X]}{X}$ we have $D\subseteq\carrier[X]$
+ by \cref{pow_iff,subseteq}.
For all $D\in\closures{\carrier[X]}{X}$ we have $\carrier[X] = D$
- by \cref{pow_iff,closures,subseteq_antisymmetric}.
- Now $\carrier[X]\in\closures{\carrier[X]}{X}$.
+ by \cref{subseteq_antisymmetric}.
+ $\carrier[X]\subseteq\carrier[X]$ by \cref{subseteq_refl}.
+ $\carrier[X]\in\pow{\carrier[X]}$ by \cref{pow_iff,subseteq}.
+ Now $\carrier[X]\in\closures{\carrier[X]}{X}$
+ by \cref{closures,carrier_is_closed}.
Thus $\closures{\carrier[X]}{X} = \{\carrier[X]\}$
by \cref{singleton_iff_inhabited_subsingleton}.
Follows by \cref{inters_singleton,closure}.
@@ -235,6 +271,9 @@
Suppose $A \subseteq \inters{F}$.
Then for all $X \in F$ we have $A \subseteq X$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{inters_subseteq_elem,subseteq}.
+\end{proof}
\begin{proposition}\label{subseteq_of_all_then_subset_of_union}
@@ -244,8 +283,10 @@
Then $A \subseteq \unions{F}$.
\end{proposition}
\begin{proof}
- There exist $X \in F$ such that $X \subseteq \unions{F}$.
- $A \subseteq X \subseteq \unions{F}$.
+ Take $X$ such that $X\in F$ by assumption.
+ $X\subseteq\unions{F}$ by \cref{unions_iff,subseteq}.
+ $A\subseteq X$ by assumption.
+ Follows by \cref{subseteq_transitive}.
\end{proof}
@@ -257,22 +298,20 @@
Then $A \subseteq \inters{F}$.
\end{proposition}
\begin{proof}
- \begin{byCase}
- \caseOf{$A = \emptyset$.}Trivial.
- \caseOf{$A \neq \emptyset$.}
- $F$ is inhabited.
- It suffices to show that for all $a \in A$ we have $a \in \inters{F}$.
- Fix $a \in A$.
- For all $X \in F$ we have $a \in X$.
- $A \subseteq \unions{F}$.
- $a \in \unions{F}$.
- \end{byCase}
+ For all $a\in A$ we have for all $X\in F$ we have $a\in X$
+ by \cref{subseteq}.
+ For all $a\in A$ we have $a\in\inters{F}$
+ by \cref{inters_iff_forall}.
+ Follows by \cref{subseteq}.
\end{proof}
\begin{proposition}\label{subseteq_inters_iff_new}
Suppose $F$ is inhabited.
$A \subseteq \inters{F}$ iff for all $X \in F$ we have $A \subseteq X$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{subseteq_inters_iff_to_left,subseteq_inters_iff_to_right}.
+\end{proof}
\begin{proposition}\label{set_is_subseteq_to_closure_of_the_set}
Let $X$ be a topological space.
@@ -280,19 +319,16 @@
$A \subseteq \closure{A}{X}$.
\end{proposition}
\begin{proof}
- \begin{byCase}
- \caseOf{$A = \emptyset$.}
- Trivial.
- \caseOf{$A \neq \emptyset$.}
- We show that $\carrier[X] \in \closures{A}{X}$.
- \begin{subproof}
- $\carrier[X]$ is closed in $X$.
- $\carrier[X] \in \pow{\carrier[X]}$.
- \end{subproof}
- $\closures{A}{X}$ is inhabited.
- For all $A' \in \closures{A}{X}$ we have $A \subseteq A'$.
- Therefore $A \subseteq \inters{\closures{A}{X}}$ by \cref{subseteq_inters_iff}.
- \end{byCase}
+ $\carrier[X]\in\pow{\carrier[X]}$ by \cref{pow_iff,subseteq_refl}.
+ $\carrier[X]$ is closed in $X$ by \cref{carrier_is_closed}.
+ $\carrier[X]\in\closures{A}{X}$
+ by \cref{closures,subseteq_refl}.
+ $\closures{A}{X}$ is inhabited by assumption.
+ For all $A'\in\closures{A}{X}$ we have $A\subseteq A'$
+ by \cref{closures}.
+ $A\subseteq\inters{\closures{A}{X}}$
+ by \cref{subseteq_inters_iff_to_left}.
+ Follows by \cref{closure}.
\end{proof}
\begin{proposition}\label{complement_of_closure_of_complement_of_x_subseteq_x}
@@ -301,10 +337,20 @@
$(\carrier[X] \setminus \closure{(\carrier[X]\setminus A)}{X}) \subseteq A$.
\end{proposition}
\begin{proof}
- It suffices to show that for all $x \in (\carrier[X] \setminus \closure{(\carrier[X]\setminus A)}{X})$ we have $x \in A$.
- Fix $x$.
- If $x \in \carrier[X]\setminus A$ then $x \in \closure{(\carrier[X]\setminus A)}{X}$ by \cref{set_is_subseteq_to_closure_of_the_set,setminus_subseteq,elem_subseteq,setminus}.
- Follows by \cref{subseteq_setminus_cons_elim,cons_absorb,double_complement_union,union_as_unions,set_is_subseteq_to_closure_of_the_set,setminus_subseteq,setminus_intro,closure,setminus_elim_left}.
+ For all $x\in\carrier[X]\setminus\closure{(\carrier[X]\setminus A)}{X}$
+ we have $x\in\carrier[X]$
+ by \cref{setminus_elim_left}.
+ For all $x\in\carrier[X]\setminus\closure{(\carrier[X]\setminus A)}{X}$
+ we have $x\notin\closure{(\carrier[X]\setminus A)}{X}$
+ by \cref{setminus_elim_right}.
+ For all $x$ we have if
+ $x\in\carrier[X]\setminus\closure{(\carrier[X]\setminus A)}{X}$ and
+ $x\in\carrier[X]\setminus A$, then
+ $x\in\closure{(\carrier[X]\setminus A)}{X}$
+ by \cref{set_is_subseteq_to_closure_of_the_set,setminus_subseteq,subseteq}.
+ For all $x\in\carrier[X]\setminus\closure{(\carrier[X]\setminus A)}{X}$
+ we have $x\in A$ by \cref{setminus}.
+ Follows by \cref{subseteq}.
\end{proof}
\begin{proposition}\label{complement_of_closed_is_open}
@@ -313,6 +359,9 @@
Suppose $A$ is closed in $X$.
Then $\carrier[X] \setminus A$ is open in $X$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{is_closed_in}.
+\end{proof}
\begin{proposition}\label{complement_of_open_is_closed}
Let $X$ be a topological space.
@@ -320,31 +369,46 @@
Suppose $A$ is open in $X$.
Then $\carrier[X] \setminus A$ is closed in $X$.
\end{proposition}
+\begin{proof}
+ $\carrier[X]\setminus(\carrier[X]\setminus A)=A$
+ by \cref{double_relative_complement}.
+ Follows by \cref{is_closed_in}.
+\end{proof}
\begin{proposition}\label{intersection_of_closed_is_closed}
Let $X$ be a topological space.
Suppose $A, B \subseteq \carrier[X]$.
- Suppose $A$ are closed in $X$.
- Suppose $B$ are closed in $X$.
+ Suppose $A$ is closed in $X$.
+ Suppose $B$ is closed in $X$.
Then $A \inter B$ is closed in $X$.
\end{proposition}
\begin{proof}
- $\carrier[X] \setminus A, \carrier[X] \setminus B \in \opens[X]$.
- $(\carrier[X] \setminus A) \union (\carrier[X] \setminus B) \in \opens[X]$.
- $A \inter B = \carrier[X] \setminus ((\carrier[X] \setminus A) \union (\carrier[X] \setminus B))$.
+ $\carrier[X] \setminus A, \carrier[X] \setminus B \in \opens[X]$
+ by \cref{is_closed_in}.
+ $(\carrier[X] \setminus A) \union (\carrier[X] \setminus B)
+ \in \opens[X]$ by \cref{union_open}.
+ $\carrier[X]\setminus(A\inter B)
+ =(\carrier[X]\setminus A)\union(\carrier[X]\setminus B)$
+ by \cref{setminus_inter}.
+ Follows by \cref{is_closed_in}.
\end{proof}
\begin{proposition}\label{union_of_closed_is_closed}
Let $X$ be a topological space.
Suppose $A, B \subseteq \carrier[X]$.
- Suppose $A$ are closed in $X$.
- Suppose $B$ are closed in $X$.
+ Suppose $A$ is closed in $X$.
+ Suppose $B$ is closed in $X$.
Then $A \union B$ is closed in $X$.
\end{proposition}
\begin{proof}
- $\carrier[X] \setminus A, \carrier[X] \setminus B \in \opens[X]$.
- $(\carrier[X] \setminus A) \inter (\carrier[X] \setminus B) \in \opens[X]$.
- $A \union B = \carrier[X] \setminus ((\carrier[X] \setminus A) \inter (\carrier[X] \setminus B))$.
+ $\carrier[X] \setminus A, \carrier[X] \setminus B \in \opens[X]$
+ by \cref{is_closed_in}.
+ $(\carrier[X] \setminus A) \inter (\carrier[X] \setminus B)
+ \in \opens[X]$ by \cref{opens_inter}.
+ $\carrier[X]\setminus(A\union B)
+ =(\carrier[X]\setminus A)\inter(\carrier[X]\setminus B)$
+ by \cref{setminus_union}.
+ Follows by \cref{is_closed_in}.
\end{proof}
\begin{proposition}\label{closed_minus_open_is_closed}
@@ -354,6 +418,15 @@
Suppose $B$ is closed in $X$.
Then $B \setminus A$ is closed in $X$.
\end{proposition}
+\begin{proof}
+ $\carrier[X]\setminus A\subseteq\carrier[X]$
+ by \cref{setminus_subseteq}.
+ $\carrier[X]\setminus A$ is closed in $X$
+ by \cref{complement_of_open_is_closed}.
+ $B\inter(\carrier[X]\setminus A)$ is closed in $X$
+ by \cref{intersection_of_closed_is_closed}.
+ Follows by \cref{setminus_eq_inter_complement}.
+\end{proof}
@@ -366,42 +439,45 @@
\end{proposition}
\begin{proof}
Let $F' = \{Y \in \pow{\carrier[X]} \mid \text{there exists $C \in F$ such that $Y = \carrier[X] \setminus C$ }\} $.
- For all $Y \in F'$ we have $Y$ is open in $X$.
- $\unions{F'}$ is open in $X$.
- $\unions{F'}, \inters{F} \subseteq \carrier[X]$.
- We show that $\inters{F} = \carrier[X] \setminus (\unions{F'})$.
+ Show for all $Y$ we have if $Y\in F'$, then $Y$ is open in $X$.
+ \begin{subproof}
+ Fix $Y$.
+ Assume $Y\in F'$.
+ Take $C$ such that $C\in F$ and
+ $Y=\carrier[X]\setminus C$ by assumption.
+ $C$ is closed in $X$ by assumption.
+ $\carrier[X]\setminus C$ is open in $X$
+ by \cref{complement_of_closed_is_open,pow_iff,subseteq}.
+ Follows by assumption.
+ \end{subproof}
+ $F'\subseteq\opens[X]$ by \cref{subseteq}.
+ $\unions{F'}$ is open in $X$ by \cref{opens_unions}.
+ $\unions{F'}\subseteq\carrier[X]$
+ by \cref{opens_type,unions_iff,pow_iff,subseteq}.
+ $\inters{F}\subseteq\carrier[X]$
+ by \cref{inters_iff_forall,pow_iff,subseteq}.
+ Show $\inters{F} = \carrier[X] \setminus (\unions{F'})$.
\begin{subproof}
- We show that for all $a \in \inters{F}$ we have $a \in \carrier[X] \setminus (\unions{F'})$.
+ Show for all $a$ we have if $a\in\inters{F}$, then
+ $a\in\carrier[X]\setminus\unions{F'}$.
\begin{subproof}
- Fix $a \in \inters{F}$.
- $a \in \carrier[X]$.
- For all $A \in F$ we have $a \in A$.
- For all $A \in F$ we have $a \notin (\carrier[X] \setminus A)$.
- Then $a \notin \unions{F'}$.
- Therefore $a \in \carrier[X] \setminus (\unions{F'})$.
+ Fix $a$.
+ Assume $a\in\inters{F}$.
+ $a\in\carrier[X]$
+ by \cref{inters_iff_forall,pow_iff,subseteq}.
+ For all $A\in F$ we have $a\in A$
+ by \cref{inters_iff_forall}.
+ For all $A\in F$ we have
+ $a\notin\carrier[X]\setminus A$ by \cref{setminus}.
+ $a\notin\unions{F'}$ by \cref{unions_iff}.
+ Follows by \cref{setminus_intro}.
\end{subproof}
- We show that for all $a \in \carrier[X] \setminus (\unions{F'})$ we have $a \in \inters{F}$.
+ Show for all $a$ we have if
+ $a\in\carrier[X]\setminus\unions{F'}$, then $a\in\inters{F}$.
\begin{subproof}
- \begin{byCase}
- \caseOf{$\inters{F} = \emptyset$.}
- $F$ is inhabited.
- Take $U$ such that $U \in F$.
- Let $F'' = F \setminus \{U\}$.
- There exist $U' \in F'$ such that $U' = \carrier[X] \setminus U$.
- Omitted.
- \caseOf{$\inters{F} \neq \emptyset$.}
-
- Fix $a \in \carrier[X] \setminus (\unions{F'})$.
- $\inters{F}$ is inhabited.
- $a \in \carrier[X]$.
- $a \notin \unions{F'}$.
- For all $A \in F'$ we have $a \notin A$.
- For all $A \in F'$ we have $a \in (\carrier[X] \setminus A)$.
- For all $A \in F'$ there exists $Y \in F$ such that $Y = (\carrier[X] \setminus A)$ by \cref{setminus_setminus,inter_absorb_supseteq_left,pow_iff,subseteq}.
- For all $Y \in F $ there exists $A \in F'$ such that $a \in Y = (\carrier[X] \setminus A)$.
- For all $Y \in F$ we have $a \in Y$.
- Therefore $a \in \inters{F}$.
- \end{byCase}
+ Fix $a$.
+ Assume $a\in\carrier[X]\setminus\unions{F'}$.
+ Omitted.
\end{subproof}
Follows by set extensionality.
\end{subproof}
@@ -414,15 +490,15 @@
Then $\closure{A}{X}$ is closed in $X$.
\end{proposition}
\begin{proof}
- \begin{byCase}
- \caseOf{$\closure{A}{X} = \emptyset$.}
- Trivial.
- \caseOf{$\closure{A}{X} \neq \emptyset$.}
- $\closures{A}{X}$ is inhabited.
- $\closures{A}{X} \subseteq \pow{\carrier[X]}$.
- For all $B \in \closures{A}{X}$ we have $B$ is closed in $X$.
- $\inters{\closures{A}{X}}$ is closed in $X$.
- \end{byCase}
+ $\carrier[X]\in\closures{A}{X}$
+ by \cref{closures,pow_iff,carrier_is_closed,subseteq_refl}.
+ $\closures{A}{X}$ is inhabited by assumption.
+ $\closures{A}{X}\subseteq\pow{\carrier[X]}$ by \cref{closures,subseteq}.
+ For all $B\in\closures{A}{X}$ we have $B$ is closed in $X$
+ by \cref{closures}.
+ $\inters{\closures{A}{X}}$ is closed in $X$
+ by \cref{intersection_of_closed_is_closed_infinite}.
+ Follows by \cref{closure}.
\end{proof}
@@ -441,6 +517,9 @@
Suppose $A \subseteq \carrier[X]$.
For all $Y \in \opens[X]$ such that $Y \subseteq A$ we have $Y \subseteq \interior{A}{X}$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{interior_maximal}.
+\end{proof}
\begin{proposition}\label{complement_interior_eq_closure_complement}
Let $X$ be a topological space.
@@ -448,22 +527,39 @@
$\carrier[X]\setminus\interior{A}{X} = \closure{(\carrier[X]\setminus A)}{X}$.
\end{proposition}
\begin{proof}
- We show that for all $x \in \carrier[X]\setminus\interior{A}{X}$ we have $x \in \closure{(\carrier[X]\setminus A)}{X}$.
- \begin{subproof}
- Fix $x \in \carrier[X]\setminus\interior{A}{X}$.
- Suppose not.
- $x \notin \closure{(\carrier[X]\setminus A)}{X}$.
- $x \in \carrier[X]$.
- $(\carrier[X] \setminus \closure{(\carrier[X]\setminus A)}{X}) \inter \closure{(\carrier[X]\setminus A)}{X} = \emptyset$.
- $x \in A$.
- $x \in A \inter (\carrier[X] \setminus \closure{(\carrier[X]\setminus A)}{X})$.
- $\carrier[X] \setminus \closure{(\carrier[X]\setminus A)}{X} \in \opens[X]$.
- There exist $U \in \opens[X]$ such that $x \in U$ and $U\subseteq A$.
- $U \subseteq \interior{A}{X}$.
- Contradiction.
- \end{subproof}
- $\carrier[X]\setminus\interior{A}{X} \subseteq \closure{(\carrier[X]\setminus A)}{X}$.
- $\closure{(\carrier[X]\setminus A)}{X} \subseteq \carrier[X]\setminus\interior{A}{X}$. % SLOW by \cref{setminus_subseteq,interior_is_open,complement_of_open_elem_closeds,subseteq_implies_setminus_supseteq,closure_is_minimal_closed_set}.
+ $\carrier[X]\setminus A\subseteq\carrier[X]$ by \cref{setminus_subseteq}.
+ $\carrier[X]\in\closeds{X}$
+ by \cref{closeds,pow_iff,carrier_is_closed,subseteq_refl}.
+ $\closure{(\carrier[X]\setminus A)}{X}\subseteq\carrier[X]$
+ by \cref{closure_is_minimal_closed_set}.
+ $\carrier[X]\setminus\closure{(\carrier[X]\setminus A)}{X}$
+ is open in $X$ by \cref{closure_is_closed,complement_of_closed_is_open}.
+ $\carrier[X]\setminus\closure{(\carrier[X]\setminus A)}{X}\subseteq A$
+ by \cref{complement_of_closure_of_complement_of_x_subseteq_x}.
+ $\carrier[X]\setminus\closure{(\carrier[X]\setminus A)}{X}
+ \subseteq\interior{A}{X}$ by \cref{interior_maximal}.
+ $\carrier[X]\setminus\interior{A}{X}
+ \subseteq\carrier[X]\setminus
+ (\carrier[X]\setminus\closure{(\carrier[X]\setminus A)}{X})$
+ by \cref{subseteq_implies_setminus_supseteq}.
+ $\carrier[X]\setminus
+ (\carrier[X]\setminus\closure{(\carrier[X]\setminus A)}{X})
+ =\closure{(\carrier[X]\setminus A)}{X}$
+ by \cref{double_relative_complement}.
+ $\carrier[X]\setminus\interior{A}{X}
+ \subseteq\closure{(\carrier[X]\setminus A)}{X}$
+ by \cref{subseteq_transitive}.
+
+ $\interior{A}{X}\subseteq A$ by \cref{interior_subseteq}.
+ $\carrier[X]\setminus A
+ \subseteq\carrier[X]\setminus\interior{A}{X}$
+ by \cref{subseteq_implies_setminus_supseteq}.
+ $\carrier[X]\setminus\interior{A}{X}\in\closeds{X}$
+ by \cref{interior_is_open,complement_of_open_elem_closeds}.
+ $\closure{(\carrier[X]\setminus A)}{X}
+ \subseteq\carrier[X]\setminus\interior{A}{X}$
+ by \cref{closure_is_minimal_closed_set}.
+ Follows by \cref{subseteq_antisymmetric}.
\end{proof}
@@ -477,6 +573,17 @@
Suppose $A \subseteq \carrier[X]$.
Then $\closure{A}{X}, \interior{A}{X}, \frontier{A}{X} \subseteq \carrier[X]$.
\end{proposition}
+\begin{proof}
+ $\carrier[X]\in\closeds{X}$
+ by \cref{closeds,pow_iff,carrier_is_closed,subseteq_refl}.
+ $\closure{A}{X}\subseteq\carrier[X]$
+ by \cref{closure_is_minimal_closed_set}.
+ $\interior{A}{X}\subseteq\carrier[X]$
+ by \cref{interior_type,pow_iff,subseteq}.
+ $\frontier{A}{X}\subseteq\carrier[X]$
+ by \cref{frontier,setminus_subseteq,subseteq_transitive}.
+ Follows by assumption.
+\end{proof}
\begin{proposition}\label{frontier_is_closed}
Let $X$ be a topological space.
@@ -484,13 +591,22 @@
Then $\frontier{A}{X}$ is closed in $X$.
\end{proposition}
\begin{proof}
- $\closure{A}{X}\setminus\interior{A}{X}$ is closed in $X$ by \cref{closure_interior_frontier_is_in_carrier,closure_is_closed,interior_is_open,closed_minus_open_is_closed}.
+ $\closure{A}{X},\interior{A}{X}\subseteq\carrier[X]$
+ by \cref{closure_interior_frontier_is_in_carrier}.
+ $\closure{A}{X}$ is closed in $X$ by \cref{closure_is_closed}.
+ $\interior{A}{X}$ is open in $X$ by \cref{interior_is_open}.
+ $\closure{A}{X}\setminus\interior{A}{X}$ is closed in $X$
+ by \cref{closed_minus_open_is_closed}.
+ Follows by \cref{frontier}.
\end{proof}
\begin{proposition}\label{setdifference_eq_intersection_with_complement}
Suppose $A,B \subseteq C$.
Then $A \setminus B = A \inter (C \setminus B)$.
\end{proposition}
+\begin{proof}
+ Follows by \cref{setminus_eq_inter_complement}.
+\end{proof}
@@ -500,12 +616,13 @@
$\frontier{A}{X} = \closure{A}{X} \inter \closure{(\carrier[X]\setminus A)}{X}$.
\end{proposition}
\begin{proof}
- \begin{align*}
- \frontier{A}{X} \\
- &= \closure{A}{X}\setminus\interior{A}{X} \\
- &= \closure{A}{X} \inter (\carrier[X] \setminus \interior{A}{X}) \explanation{by \cref{setdifference_eq_intersection_with_complement,closure_interior_frontier_is_in_carrier}}\\
- &= \closure{A}{X} \inter \closure{(\carrier[X]\setminus A)}{X} \explanation{by \cref{complement_interior_eq_closure_complement}}
- \end{align*}
+ $\closure{A}{X}\setminus\interior{A}{X}
+ =\closure{A}{X}\inter(\carrier[X]\setminus\interior{A}{X})$
+ by \cref{setdifference_eq_intersection_with_complement,closure_interior_frontier_is_in_carrier}.
+ $\closure{A}{X}\inter(\carrier[X]\setminus\interior{A}{X})
+ =\closure{A}{X}\inter\closure{(\carrier[X]\setminus A)}{X}$
+ by \cref{complement_interior_eq_closure_complement}.
+ Follows by \cref{frontier}.
\end{proof}
\begin{proposition}\label{frontier_of_emptyset}
@@ -513,7 +630,9 @@
Then $\frontier{\emptyset}{X} = \emptyset$.
\end{proposition}
\begin{proof}
- Follows by set extensionality.
+ $\interior{\emptyset}{X}=\emptyset$
+ by \cref{emptyset_open,interior_of_open}.
+ Follows by \cref{frontier,closure_emptyset,setminus_self}.
\end{proof}
\begin{proposition}\label{frontier_of_carrier}
diff --git a/readme.md b/readme.md
index ce684cf..7f4bcfa 100644
--- a/readme.md
+++ b/readme.md
@@ -1,6 +1,6 @@
-# Naproche/ZF
+# Felix
-Naproche/ZF is an experimental [proof assistant](https://en.wikipedia.org/wiki/Proof_assistant)
+Felix is an experimental [proof assistant](https://en.wikipedia.org/wiki/Proof_assistant)
based on [set theory](https://en.wikipedia.org/wiki/Set_theory) (and [classical logic](https://en.wikipedia.org/wiki/Classical_logic)).
It uses a [controlled language](https://en.wikipedia.org/wiki/Controlled_natural_language)
embedded into subset of LaTeX as input format, supporting [literate formalization](https://en.wikipedia.org/wiki/Literate_programming).
@@ -78,10 +78,45 @@ their locations as explicit proof gaps and includes them in its authorization
summary.
Verification always opens a disposable SQLite store. By default Felix uses
-the platform's XDG cache directory; `--store PATH` selects an existing parent
-directory explicitly, while `--fresh` uses a temporary store that is removed
-after the command. `--parseonly` performs source discovery and parsing without
-opening a store or invoking Vampire.
+the platform's XDG cache directory; `--store PATH` selects an explicit database
+file whose parent directory already exists, while `--fresh` uses a temporary
+store that is removed after the command. A store is reusable only when its
+two-field cache-epoch/theory identity matches this build. An incompatible or
+damaged store is never migrated or silently rebuilt: use `--fresh`, select a
+new path, or remove the disposable database and verify again.
+
+The command model has three modes. `--version` prints the version,
+`--parseonly` performs authority-free source discovery and parsing without
+opening SQLite or invoking Vampire, and ordinary invocation verifies through
+the typed checker. Both paths load the packaged final prelude's syntax; Verify
+also acquires its sealed semantics. Ordinary modules therefore need no source
+import for the prelude dependency.
+
+Without `--jobs`, verification uses one fewer than the detected logical
+processor count, with a minimum of one. A positive `--jobs N` is an exact bound
+for live module checkers and one-core Vampire processes. `-t` and `-m` bound
+each Vampire request's time and memory.
+
+Source fixity declarations are line-leading pragmas such as `%! infixl 4`.
+User declarations may use literal levels 0 through 7; the two higher internal
+levels are reserved. Verification keeps compact proof-independent theorem
+authority separate from exact proof/declaration validation. Its authorization
+summary lists only direct source axioms and syntactic `Omitted` sites, not
+facts that merely inherit their safety.
+
+`--html DIRECTORY` and `--dump DIRECTORY` observe the same verification.
+Dump files are the exact Vampire requests that actually ran and the directory
+must be absent or empty. HTML is uncached and is published sequentially in
+source order only after complete semantic success; a later output failure
+reports the already committed output prefix together with the successful
+authorization summary.
+
+Declarations append atomically and modules expose only sealed syntax and
+semantic interfaces. After an ordinary later failure, the successfully checked
+declaration prefix remains reusable but the incomplete module has no root.
+Compatible stores can reuse rebound parsed artifacts, exact validation, and
+complete module roots; source remains authoritative, so an edited proof or
+interface is revalidated at the corresponding content boundary.
For a list of all options run `stack exec zf -- --help`.
diff --git a/source/Api.hs b/source/Api.hs
index 430eb41..2220434 100644
--- a/source/Api.hs
+++ b/source/Api.hs
@@ -10,17 +10,21 @@ module Api
, scan
, parse
, parseWorkspace
+ , AuthorityFreeParseError(..)
+ , renderAuthorityFreeParseError
, simpleStream
, builtins
, ParseException(..)
- , gloss, GlossError(..)
- , generateTasks
- , encodeTasks
, verify, verifyMeasured
, verifyWithObserverAndStoreMode
+ , verifyMeasuredWithObserverAndStoreMode
+ , verifyWithObserverAndStoreModeAndJobs
+ , verifyMeasuredWithObserverAndStoreModeAndJobs
, StoreValidationMode(..)
- , VerificationRequestOrdinal
- , verificationRequestOrdinalValue
+ , WorkPosition
+ , workPosition
+ , workPositionModuleOrdinal
+ , workPositionLocalRequestOrdinal
, VerificationRequestObserver
, verificationRequestObserver
, ProverAnswer
@@ -31,69 +35,58 @@ module Api
)
, pattern Yes
, VerificationResult(..)
- , VerificationRoute(..)
+ , VerificationPresentation
+ , ReportedEscapeKind(..)
+ , ReportedEscape(..)
, VerificationReport(..)
, VerificationMeasurements(..)
, VerificationDriverError(..)
, FailedVerification(..)
, VerificationFailureReason(..)
- , exportHtml
- , prepareHtmlExport
- , prepareHtmlExportResult
+ , prepareVerifiedHtmlExportResult
, prepareDefaultSourceGraph
, defaultHtmlMountPrefixes
) where
import Base
-import Checking
import Checking.Declaration qualified as Declaration
import Checking.Foundation qualified as Foundation
import Checking.Identity qualified as Identity
-import Checking.Legacy qualified as Legacy
import Checking.Module qualified as Typed
-import Checking.Obligation
import Checking.Semantic qualified as Semantic
-import Checking.Transition qualified as Transition
-import Encoding
-import Felix.Migration qualified as Migration
+import Felix.Module (localDeclarationOrdinal)
import Felix.Parse (ParseException(..), ParseWorkspaceError(..), ParsedSourceWorkspace)
import Felix.Parse qualified as Felix
+import Felix.Prelude qualified as Prelude
import Felix.Source
import Felix.Store qualified as Store
import Felix.Source.Graph (ResolvedSourceGraph)
import Felix.Source.Graph qualified as SourceGraph
-import Meaning
- ( GlossError(..)
- , meaning
- )
import Provers
import Render.Html.Export qualified as HtmlExport
-import Render.Html.Output (PreparedHtmlBundle)
+import Render.Html.Output (PreparedHtmlArtifact)
import Report.Location
import Syntax.Abstract qualified as Raw
import Syntax.Adapt (scanChunk, ScannedLexicalItem)
-import Syntax.Internal qualified as Internal
import Syntax.Interface qualified as Syntax
import Syntax.Lexicon (builtins)
import Syntax.Token
-import Tptp.UnsortedFirstOrder qualified as Tptp
import Control.Exception qualified as Exception
import Control.Monad.Logger
-import Control.Monad (foldM, unless)
+import Control.Monad (unless)
import Data.Bifunctor (first)
import Data.List.NonEmpty qualified as NonEmpty
import Data.Map.Strict qualified as Map
-import Data.Set qualified as Set
import Data.Text qualified as StrictText
import Data.Text.Encoding.Error (UnicodeException)
import Data.Text.IO qualified as Text
-import Data.Vector qualified as Vector
import Numeric.Natural (Natural)
import System.FilePath.Posix
import Text.Megaparsec hiding (failure, parse, Token, try)
import UnliftIO
+import UnliftIO.Async qualified as Async
import UnliftIO.Directory
import UnliftIO.Environment
@@ -234,31 +227,74 @@ scan input = do
(unTokStream tokenStream)
--- | Parse a file. Throws a 'ParseException' when tokenizing, scanning, or
--- parsing fails.
+-- | Parse a file. Throws an 'AuthorityFreeParseError' when packaged-prelude
+-- loading/parsing or ordinary workspace parsing fails.
parse :: MonadIO io => FilePath -> io [Raw.Block]
parse file = do
result <- parseWorkspace file
- either throwWorkspaceError pure result
+ either throwIO pure result
+
+data AuthorityFreeParseError
+ = AuthorityFreePreludeLoadFailed !Prelude.PreludeLoadError
+ | AuthorityFreePreludeParseFailed !Prelude.PreludeParseError
+ | AuthorityFreeWorkspaceFailed !ParseWorkspaceError
+ deriving (Show)
+
+instance Exception AuthorityFreeParseError
+
+renderAuthorityFreeParseError :: AuthorityFreeParseError -> Text
+renderAuthorityFreeParseError = \case
+ AuthorityFreePreludeLoadFailed failure ->
+ "packaged final prelude loading failed: "
+ <> Prelude.renderPreludeLoadError failure
+ AuthorityFreePreludeParseFailed failure ->
+ "packaged final prelude parsing failed: "
+ <> Prelude.renderPreludeParseError failure
+ AuthorityFreeWorkspaceFailed failure ->
+ Felix.renderParseWorkspaceError failure
parseWorkspace
:: MonadIO io
=> FilePath
- -> io (Either ParseWorkspaceError [Raw.Block])
+ -> io (Either AuthorityFreeParseError [Raw.Block])
parseWorkspace file =
fmap Felix.importedBeforeImporterBlocks
- <$> liftIO (parseDefaultWorkspace file)
+ <$> liftIO (parseDefaultWorkspaceWithPrelude file)
-parseDefaultWorkspace
+parseDefaultWorkspaceWithPrelude
:: FilePath
- -> IO (Either ParseWorkspaceError ParsedSourceWorkspace)
-parseDefaultWorkspace file = do
- prepared <- prepareDefaultSourceRequest file
- case prepared of
- Left err ->
- pure (Left err)
- Right (mounts, request) ->
- Felix.parseSourceWorkspace mounts request
+ -> IO
+ (Either
+ AuthorityFreeParseError
+ ParsedSourceWorkspace)
+parseDefaultWorkspaceWithPrelude file =
+ Prelude.loadReservedPreludeSourceInput >>= \case
+ Left failure ->
+ pure (Left (AuthorityFreePreludeLoadFailed failure))
+ Right source ->
+ Prelude.parseReservedPreludeSource source >>= \case
+ Left failure ->
+ pure (Left (AuthorityFreePreludeParseFailed failure))
+ Right prelude -> do
+ prepared <- prepareDefaultSourceRequest file
+ case prepared of
+ Left failure ->
+ pure
+ (Left
+ (AuthorityFreeWorkspaceFailed failure))
+ Right (mounts, request) -> do
+ let syntax =
+ Felix.identifiedParsedModuleSyntaxInterface
+ (Prelude.reservedParsedPreludeModule
+ prelude)
+ fmap
+ (first AuthorityFreeWorkspaceFailed . fmap fst)
+ (Felix.parseSourceWorkspaceMeasuredWithSyntaxInputsAndGraphValidation
+ mounts
+ request
+ (const [syntax])
+ (Prelude.rejectOrdinaryPreludeSourceGraph
+ source))
prepareDefaultSourceRequest
:: FilePath
@@ -326,81 +362,45 @@ throwWorkspaceError = \case
simpleStream :: TokStream -> [[Token]]
simpleStream TokStream{unTokStream=chunks} = [unLocated <$> ch | ch <- chunks]
--- | Parse the workspace, then gloss each module independently in
--- imported-before-importer order.
-gloss :: MonadIO io => FilePath -> io [Internal.Block]
-gloss file = do
- result <- liftIO (parseDefaultWorkspace file)
- workspace <- either throwWorkspaceError pure result
- liftIO
- (concat
- <$> traverse
- (\parsed ->
- either throwIO pure
- (meaning
- (Felix.parsedModuleBlocks parsed)))
- (toList
- (Felix.parsedWorkspaceImportedBeforeImporter
- workspace)))
-
+data VerificationResult
+ = VerificationCompleted
+ !VerificationReport
+ !VerificationPresentation
+ | CompletedWithExplicitGaps
+ !VerificationReport
+ !VerificationPresentation
+ | VerificationFailure !VerificationReport !FailedVerification
+ | VerificationCheckingFailure
+ !VerificationReport
+ !VerificationDriverError
+ deriving (Show)
-generateTasks :: MonadIO io => FilePath -> io [Internal.Task]
-generateTasks file = do
- obligations <-
- prepareCheckingTasks
- contractionTask
- file
- pure (preparedObligationTask <$> obligations)
+-- | Strict owner-independent source presentation retained only after the
+-- complete typed workspace succeeds.
+data VerificationPresentation = VerificationPresentation
+ !HtmlExport.HtmlPresentation
-prepareCheckingTasks
- :: MonadIO io
- => (Internal.Task -> Internal.Task)
- -> FilePath
- -> io [PreparedObligation]
-prepareCheckingTasks prepareTask file = do
- blocks <- gloss file
- liftIO
- (checkPrepared
- WithoutDumpPremselTraining
- prepareTask
- blocks)
-
-encodeTasks :: MonadIO io => FilePath -> io [Tptp.Task]
-encodeTasks file = do
- obligations <-
- prepareCheckingTasks
- contractionTask
- file
- pure
- [ preparedTptpSyntax
- (preparedProverTptpTask
- (preparedObligationProverTask obligation))
- | obligation <- obligations
- ]
+instance Show VerificationPresentation where
+ show _presentation =
+ "VerificationPresentation <HTML presentation>"
-data VerificationResult
- = VerifiedWithTrustedVampire !VerificationReport
- | CompletedWithExplicitGaps !VerificationReport
- | VerificationFailure !FailedVerification
- deriving (Show)
+data ReportedEscapeKind
+ = ReportedSourceAxiom
+ | ReportedOmitted
+ deriving (Show, Eq)
-data VerificationRoute
- = LegacyVerificationRoute
- | TypedVerificationRoute
+data ReportedEscape = ReportedEscape
+ { reportedEscapeKind :: !ReportedEscapeKind
+ , reportedEscapeLocation :: !Location
+ }
deriving (Show, Eq)
data VerificationReport = VerificationReport
- { verificationRoute :: !VerificationRoute
- , verificationLegacyDeclaredAssumptionCount :: !Int
- , verificationTypedDeclaredAssumptionCount :: !Int
- , verificationTrustedVampireCount :: !Int
- , verificationExplicitGapLocations :: ![Location]
- , verificationTrustedLegacyRuleCount :: !Int
- , verificationKernelProofCount :: !Int
+ { verificationDirectEscapes :: ![ReportedEscape]
}
deriving (Show, Eq)
--- | Invocation-local observation of the sequential verification pipeline.
+-- | Invocation-local observation of the verification pipeline.
--
-- Durations use the monotonic clock and are never part of fact authority or
-- deterministic verification results.
@@ -410,73 +410,76 @@ data VerificationMeasurements = VerificationMeasurements
, verificationInvocationNanoseconds :: !Word64
, verificationCheckingNanoseconds :: !Word64
, verificationModuleCount :: !Int
+ , verificationDetectedProcessorCount :: !(Maybe Int)
+ , verificationEffectiveJobs :: !Int
+ , verificationJobsOverridden :: !Bool
+ , verificationMaximumLiveModuleCheckers :: !Int
+ , verificationMaximumLiveVampireProcesses :: !Int
, verificationMaximumReadyModuleCount :: !Int
- , verificationReadyModuleWaitNanoseconds :: !Word64
, verificationObligationBatchCount :: !Int
, verificationPreparedObligationCount :: !Int
, verificationMaximumObligationBatchSize :: !Int
, verificationPreparedRequestBytes :: !Word64
, verificationVampireRunCount :: !Int
+ , verificationModuleRootHitCount :: !Int
+ , verificationModuleRootMissCount :: !Int
, verificationFirstVampireStartNanoseconds
:: !(Maybe Word64)
, verificationVampireExecutionNanoseconds :: !Word64
- , verificationReplayMeasurements
- :: !Transition.TransitionReplayMeasurements
}
deriving (Show, Eq)
data VerificationObservation = VerificationObservation
{ observedModuleCount :: !Int
- , observedReadyAt
- :: !(Map ResolvedSourceAddress Word64)
+ , observedDetectedProcessorCount :: !(Maybe Int)
+ , observedEffectiveJobs :: !Int
+ , observedJobsOverridden :: !Bool
+ , observedLiveModuleCheckers :: !Int
+ , observedMaximumLiveModuleCheckers :: !Int
+ , observedMaximumLiveVampireProcesses :: !Int
, observedMaximumReadyModuleCount :: !Int
- , observedReadyModuleWaitNanoseconds :: !Word64
, observedObligationBatchCount :: !Int
, observedPreparedObligationCount :: !Int
, observedMaximumObligationBatchSize :: !Int
, observedPreparedRequestBytes :: !Word64
, observedVampireRunCount :: !Int
+ , observedModuleRootHitCount :: !Int
+ , observedModuleRootMissCount :: !Int
, observedFirstVampireStart :: !(Maybe Word64)
, observedVampireExecutionNanoseconds :: !Word64
- , observedNextRequestOrdinal :: !Natural
}
initialVerificationObservation :: VerificationObservation
initialVerificationObservation =
VerificationObservation
{ observedModuleCount = 0
- , observedReadyAt = Map.empty
+ , observedDetectedProcessorCount = Nothing
+ , observedEffectiveJobs = 1
+ , observedJobsOverridden = False
+ , observedLiveModuleCheckers = 0
+ , observedMaximumLiveModuleCheckers = 0
+ , observedMaximumLiveVampireProcesses = 0
, observedMaximumReadyModuleCount = 0
- , observedReadyModuleWaitNanoseconds = 0
, observedObligationBatchCount = 0
, observedPreparedObligationCount = 0
, observedMaximumObligationBatchSize = 0
, observedPreparedRequestBytes = 0
, observedVampireRunCount = 0
+ , observedModuleRootHitCount = 0
+ , observedModuleRootMissCount = 0
, observedFirstVampireStart = Nothing
, observedVampireExecutionNanoseconds = 0
- , observedNextRequestOrdinal = 1
}
-newtype VerificationRequestOrdinal = VerificationRequestOrdinal Natural
- deriving (Show, Eq, Ord)
-
-verificationRequestOrdinalValue
- :: VerificationRequestOrdinal
- -> Natural
-verificationRequestOrdinalValue
- (VerificationRequestOrdinal value) =
- value
-
newtype VerificationRequestObserver = VerificationRequestObserver
{ observeVerificationRequest
- :: VerificationRequestOrdinal
+ :: WorkPosition
-> PreparedVerificationRequest
-> IO ()
}
verificationRequestObserver
- :: (VerificationRequestOrdinal
+ :: (WorkPosition
-> PreparedVerificationRequest
-> IO ())
-> VerificationRequestObserver
@@ -489,7 +492,6 @@ ignoreVerificationRequests =
data FailedVerification = FailedVerification
{ failedVerificationLocation :: !Location
- , failedVerificationFormula :: !Internal.Formula
, failedVerificationReason :: !VerificationFailureReason
}
deriving (Show)
@@ -502,58 +504,32 @@ data VerificationFailureReason
| TransportFailure !ProverProcessError
deriving (Show)
-failedVerification
- :: ( Location
- , Internal.Formula
- , Either ProverProcessError ProverAnswer
- )
- -> Maybe FailedVerification
-failedVerification (location, formula, result) =
- FailedVerification location formula <$> case result of
- Left processError ->
- Just (TransportFailure processError)
- Right Yes ->
- Nothing
- Right (CounterSatisfiable tptp) ->
- Just (CountermodelFailure tptp)
- Right (ContradictoryAxioms tptp) ->
- Just (ContradictoryInputFailure tptp)
- Right (Uncertain tptp) ->
- Just (IndeterminateFailure tptp)
- Right (Error taskLabel message) ->
- Just (ProtocolFailure taskLabel message)
-
-newtype VerificationAborted =
- VerificationAborted FailedVerification
- deriving (Show)
-
-instance Exception VerificationAborted
+verificationFailureReason
+ :: Either ProverProcessError ProverAnswer
+ -> Maybe VerificationFailureReason
+verificationFailureReason = \case
+ Left processError ->
+ Just (TransportFailure processError)
+ Right Yes ->
+ Nothing
+ Right (CounterSatisfiable tptp) ->
+ Just (CountermodelFailure tptp)
+ Right (ContradictoryAxioms tptp) ->
+ Just (ContradictoryInputFailure tptp)
+ Right (Uncertain tptp) ->
+ Just (IndeterminateFailure tptp)
+ Right (Error taskLabel message) ->
+ Just (ProtocolFailure taskLabel message)
data VerificationDriverError
= VerificationWorkspaceError
!ParseWorkspaceError
- | VerificationGlossError
- !ResolvedSource
- !GlossError
- | VerificationCheckingError
- !ResolvedSource
- !CheckingError
- | VerificationObligationResolutionError
- !ObligationResolutionError
- | VerificationLegacyModuleError
- !Legacy.LegacyModuleStageError
- | VerificationTransitionModuleError
- !Transition.TransitionModuleError
| VerificationFoundationManifestError
!(NonEmpty Foundation.FoundationManifestError)
| VerificationMissingImportedModule
!ResolvedSourceAddress
| VerificationMissingRootModule
!ResolvedSourceAddress
- | VerificationMigrationManifestError
- !Migration.MigrationManifestError
- | VerificationMigrationRouteMismatch
- !Migration.MigrationGraphRoute
| VerificationFinalPreludeReadinessError
!Typed.FinalPreludeReadinessError
| VerificationTypedInputError
@@ -572,6 +548,9 @@ data VerificationDriverError
| VerificationValidationIntegrityError
!ResolvedSource
!Declaration.ValidationIntegrityError
+ | VerificationAdmittedViewError
+ !ResolvedSource
+ !AdmittedViewError
| VerificationParsedArtifactIntegrityError
!ResolvedSource
!Felix.ParsedArtifactIntegrityError
@@ -579,13 +558,119 @@ data VerificationDriverError
| VerificationStorePlanningFailure !Store.StorePlanningError
| VerificationStoreLifecycleFailure !Store.StoreLifecycleError
| VerificationModuleArtifactKeyError !Semantic.ModuleArtifactKeyError
+ | VerificationModuleSchedulerInvariant !Text
deriving (Show)
instance Exception VerificationDriverError
-data CheckedWorkspace
- = CheckedLegacyWorkspace !Transition.TransitionAdmittedModule
- | CheckedTypedWorkspace !Typed.SealedTypedModule
+data TypedWorkspaceOutcome
+ = TypedWorkspaceSucceeded
+ !AdmittedTypedWorkspace
+ | TypedWorkspaceRejected
+ !AdmittedTypedWorkspace
+ !TypedWorkspaceFailure
+
+data TypedWorkspaceFailure
+ = TypedWorkspaceCheckingRejected !VerificationDriverError
+ | TypedWorkspaceProverRejected !FailedVerification
+
+data ModuleTask = ModuleTask
+ { moduleTaskOrdinal :: !Natural
+ , moduleTaskParsed :: !Felix.ParsedModule
+ , moduleTaskDirectAddresses :: ![ResolvedSourceAddress]
+ }
+
+data ModuleCheckResult
+ = ModuleCheckSucceeded
+ !ResolvedSourceAddress
+ !Typed.SealedTypedModule
+ !AdmittedTypedModule
+ | ModuleCheckRejected
+ !AdmittedTypedModule
+ !TypedWorkspaceFailure
+
+data ModuleFailureCandidate = ModuleFailureCandidate
+ !Natural
+ !AdmittedTypedModule
+ !TypedWorkspaceFailure
+
+data AdmittedTypedDeclaration = AdmittedTypedDeclaration
+ !Semantic.DeclarationSlot
+ !Typed.TypedSourceDeclaration
+
+newtype AdmittedTypedModule = AdmittedTypedModule
+ [AdmittedTypedDeclaration]
+
+newtype AdmittedTypedWorkspace = AdmittedTypedWorkspace
+ [AdmittedTypedModule]
+
+data AdmittedViewError
+ = AdmittedDeclarationCountMismatch
+ !Int
+ !Int
+ | AdmittedDeclarationSlotMismatch
+ ![Semantic.DeclarationSlot]
+ ![Semantic.DeclarationSlot]
+ deriving (Show, Eq)
+
+completeAdmittedModule
+ :: Typed.IdentifiedModuleInput
+ -> AdmittedTypedModule
+completeAdmittedModule input =
+ AdmittedTypedModule
+ (uncurry AdmittedTypedDeclaration <$> expectedDeclarations input)
+
+checkedAdmittedModule
+ :: Bool
+ -> Typed.IdentifiedModuleInput
+ -> Declaration.PendingModulePrefix
+ -> Either AdmittedViewError AdmittedTypedModule
+checkedAdmittedModule requireComplete input prefix = do
+ let expected = expectedDeclarations input
+ expectedSlots = fst <$> expected
+ actualSlots =
+ Declaration.committedBatchSlot
+ <$> Declaration.pendingModulePrefixBatches prefix
+ admittedCount = length actualSlots
+ if requireComplete
+ then unless
+ (admittedCount == length expected)
+ (Left
+ (AdmittedDeclarationCountMismatch
+ (length expected)
+ admittedCount))
+ else unless
+ (admittedCount <= length expected)
+ (Left
+ (AdmittedDeclarationCountMismatch
+ (length expected)
+ admittedCount))
+ unless
+ (actualSlots == take admittedCount expectedSlots)
+ (Left
+ (AdmittedDeclarationSlotMismatch
+ (take admittedCount expectedSlots)
+ actualSlots))
+ pure
+ (AdmittedTypedModule
+ [ AdmittedTypedDeclaration slot declaration
+ | (slot, declaration) <- take admittedCount expected
+ ])
+
+expectedDeclarations
+ :: Typed.IdentifiedModuleInput
+ -> [(Semantic.DeclarationSlot, Typed.TypedSourceDeclaration)]
+expectedDeclarations input =
+ zipWith
+ (\ordinal declaration ->
+ ( Semantic.declarationSlot
+ (Typed.identifiedModuleOwner input)
+ (localDeclarationOrdinal ordinal)
+ , declaration
+ ))
+ [0..]
+ (Typed.typedSourceDeclarations
+ (Typed.identifiedModuleParsed input))
data StoreValidationMode
= FreshStoreValidation
@@ -601,14 +686,68 @@ verifyWithObserverAndStoreMode
-> FilePath
-> io (Either VerificationDriverError VerificationResult)
verifyWithObserverAndStoreMode store validationMode observer prover file =
- fmap fst
- <$> try
- (verifyMeasuredThrowingWithStore
- store
- validationMode
- observer
- prover
- file)
+ verifyWithObserverAndStoreModeAndJobs
+ store validationMode sequentialJobs observer prover file
+
+verifyWithObserverAndStoreModeAndJobs
+ :: (MonadUnliftIO io, MonadLogger io)
+ => Store.Store
+ -> StoreValidationMode
+ -> JobsSelection
+ -> VerificationRequestObserver
+ -> Vampire
+ -> FilePath
+ -> io (Either VerificationDriverError VerificationResult)
+verifyWithObserverAndStoreModeAndJobs
+ store validationMode jobs observer prover file =
+ fmap (fmap fst)
+ (verifyMeasuredWithObserverAndStoreModeAndJobs
+ store validationMode jobs observer prover file)
+
+verifyMeasuredWithObserverAndStoreMode
+ :: (MonadUnliftIO io, MonadLogger io)
+ => Store.Store
+ -> StoreValidationMode
+ -> VerificationRequestObserver
+ -> Vampire
+ -> FilePath
+ -> io
+ (Either
+ VerificationDriverError
+ (VerificationResult, VerificationMeasurements))
+verifyMeasuredWithObserverAndStoreMode
+ store validationMode observer prover file =
+ verifyMeasuredWithObserverAndStoreModeAndJobs
+ store validationMode sequentialJobs observer prover file
+
+verifyMeasuredWithObserverAndStoreModeAndJobs
+ :: (MonadUnliftIO io, MonadLogger io)
+ => Store.Store
+ -> StoreValidationMode
+ -> JobsSelection
+ -> VerificationRequestObserver
+ -> Vampire
+ -> FilePath
+ -> io
+ (Either
+ VerificationDriverError
+ (VerificationResult, VerificationMeasurements))
+verifyMeasuredWithObserverAndStoreModeAndJobs
+ store validationMode jobs observer prover file =
+ try
+ (verifyMeasuredThrowingWithStore
+ store validationMode jobs observer prover file)
+
+sequentialJobs :: JobsSelection
+sequentialJobs =
+ JobsSelection
+ { jobsSelectionDetectedProcessors = Nothing
+ , jobsSelectionEffectiveJobs =
+ fromMaybe
+ (impossible "one is not a positive worker count")
+ (effectiveJobs 1)
+ , jobsSelectionWasOverridden = True
+ }
verifyMeasured
:: (MonadUnliftIO io, MonadLogger io)
@@ -663,6 +802,7 @@ verifyMeasuredThrowing requestObserver prover file = do
(verifyMeasuredThrowingWithStore
store
FreshStoreValidation
+ sequentialJobs
requestObserver
prover
file))
@@ -675,35 +815,52 @@ verifyMeasuredThrowingWithStore
:: (MonadUnliftIO io, MonadLogger io)
=> Store.Store
-> StoreValidationMode
+ -> JobsSelection
-> VerificationRequestObserver
-> Vampire
-> FilePath
-> io (VerificationResult, VerificationMeasurements)
verifyMeasuredThrowingWithStore
- store validationMode requestObserver prover file = do
+ store validationMode jobsSelection requestObserver prover file = do
invocationStart <- liftIO getMonotonicTimeNSec
+ memo <- liftIO (Store.newStoreMemo store)
+ storeCoordinator <- liftIO Store.newStoreCoordinator
( admittedResult
, parseMeasurements
, sourcePreparation
, checkingStart
, checkingEnd
, observation
+ , parsedPresentation
) <-
- withRunInIO \runInIO -> do
- observationRef <-
- newIORef initialVerificationObservation
+ withRunInIO \runInIO ->
+ withVampireExecutor
+ (jobsSelectionEffectiveJobs jobsSelection)
+ prover
+ (observeVerificationRequest requestObserver)
+ \executor -> do
+ observationRef <- newIORef
+ initialVerificationObservation
+ { observedDetectedProcessorCount =
+ jobsSelectionDetectedProcessors jobsSelection
+ , observedEffectiveJobs =
+ effectiveJobsValue
+ (jobsSelectionEffectiveJobs jobsSelection)
+ , observedJobsOverridden =
+ jobsSelectionWasOverridden jobsSelection
+ }
foundation <-
either
(throwIO
. VerificationFoundationManifestError)
pure
Foundation.checkedFoundation
- let resolver =
- typedVampireResolver
- runInIO
- prover
- requestObserver
- observationRef
+ preludeResolver <-
+ typedVampireResolver
+ runInIO
+ executor
+ 0
+ observationRef
preparationStart <- getMonotonicTimeNSec
prepared <-
prepareDefaultSourceRequest file
@@ -711,102 +868,72 @@ verifyMeasuredThrowingWithStore
(throwIO . VerificationWorkspaceError)
pure
let (mounts, request) = prepared
- selection <-
- either
- (throwIO . VerificationMigrationManifestError)
- pure
- (Migration.resolveMigrationSelection
- mounts
- Migration.typedMigrationModules)
- root <-
- resolveRoot mounts request
+ preparationEnd <- getMonotonicTimeNSec
+ prelude <-
+ Typed.acquireFinalPreludeSession
+ memo store foundation preludeResolver
>>= either
(throwIO
- . VerificationWorkspaceError
- . SourceWorkspaceError)
+ . VerificationFinalPreludeReadinessError)
pure
- preparationEnd <- getMonotonicTimeNSec
- prelude <-
- if Migration.migrationSelectionContains selection root
- then
- Just
- <$> (Typed.buildFinalPreludeSession
- store foundation resolver
- >>= either
- (throwIO
- . VerificationFinalPreludeReadinessError)
- pure)
- else
- pure Nothing
+ observeModuleRootAcquisition observationRef
+ (Typed.finalPreludeAcquisition prelude)
let preludeSyntax =
Typed.sealedTypedModuleSyntax
- . Typed.migrationPreludeModule
- syntaxInputs source
- | Migration.migrationSelectionContains selection source =
- maybeToList (preludeSyntax <$> prelude)
- | otherwise = []
+ (Typed.finalPreludeModule prelude)
+ syntaxInputs _source = [preludeSyntax]
(parsed, measured) <-
- Felix.parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputs
+ Felix.parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputsAndGraphValidation
store
mounts
request
syntaxInputs
+ (Prelude.rejectOrdinaryPreludeSourceGraph
+ (Typed.finalPreludeSource prelude))
>>= either throwParseExecutionError pure
checkingStart <- getMonotonicTimeNSec
- admitted <-
- (Right <$> case
- ( prelude
- , Migration.classifyMigrationGraph selection parsed
- ) of
- (Nothing, Migration.LegacyMigrationGraph) ->
- CheckedLegacyWorkspace
- <$> checkParsedWorkspace
- foundation
- runInIO
- prover
- requestObserver
- observationRef
- parsed
- (Just finalPrelude, Migration.TypedMigrationGraph) ->
- CheckedTypedWorkspace
- <$> checkTypedWorkspace
- foundation
- finalPrelude
- resolver
- validationMode
- observationRef
- parsed
- store
- (_, route) ->
- throwIO
- (VerificationMigrationRouteMismatch route))
- `catch`
- \(VerificationAborted failed) ->
- pure (Left failed)
+ outcome <-
+ checkTypedWorkspace
+ memo
+ storeCoordinator
+ foundation
+ prelude
+ runInIO
+ executor
+ (jobsSelectionEffectiveJobs jobsSelection)
+ validationMode
+ observationRef
+ parsed
+ store
checkingEnd <- getMonotonicTimeNSec
+ executorObserved <- vampireExecutorObservation executor
+ mergeExecutorObservation observationRef executorObserved
observed <- readIORef observationRef
pure
- ( admitted
+ ( outcome
, measured
, preparationEnd - preparationStart
, checkingStart
, checkingEnd
, observed
+ , parsed
)
let result =
case admittedResult of
- Left failed ->
- VerificationFailure failed
- Right admitted ->
- let report =
- checkedWorkspaceReport admitted
- in
- if null
- (verificationExplicitGapLocations report)
- then
- VerifiedWithTrustedVampire report
- else
- CompletedWithExplicitGaps report
+ TypedWorkspaceRejected admitted failure ->
+ let report = admittedWorkspaceReport admitted
+ in case failure of
+ TypedWorkspaceCheckingRejected checkingFailure ->
+ VerificationCheckingFailure
+ report checkingFailure
+ TypedWorkspaceProverRejected proverFailure ->
+ VerificationFailure report proverFailure
+ TypedWorkspaceSucceeded admitted ->
+ completedResult
+ (admittedWorkspaceReport admitted)
+ (VerificationPresentation
+ (HtmlExport.htmlPresentationFromParsedWorkspace
+ parsedPresentation))
measurements =
finalizeVerificationMeasurements
invocationStart
@@ -815,7 +942,6 @@ verifyMeasuredThrowingWithStore
parseMeasurements
sourcePreparation
observation
- (either (const Nothing) Just admittedResult)
logInfoN
(renderVerificationMeasurements measurements)
pure (result, measurements)
@@ -829,187 +955,205 @@ verifyMeasuredThrowingWithStore
throwIO
(VerificationParsedArtifactIntegrityError source failure)
-checkParsedWorkspace
+checkTypedWorkspace
:: forall io
. (MonadIO io, MonadLogger io)
- => Foundation.CheckedFoundation
- -> (forall a. io a -> IO a)
- -> Vampire
- -> VerificationRequestObserver
- -> IORef VerificationObservation
- -> ParsedSourceWorkspace
- -> IO Transition.TransitionAdmittedModule
-checkParsedWorkspace
- checkedFoundationValue
- runInIO
- prover
- requestObserver
- observationRef
- workspace = do
- assignments <-
- driverLegacy
- (Legacy.assignLegacyModuleOrdinals workspace)
- initializeModuleObservation
- observationRef
- assignments
- admittedByAddress <-
- foldM
- (checkModule
- checkedFoundationValue
- assignments)
- Map.empty
- (toList assignments)
- let rootAddress =
- Felix.parsedModuleAddress
- (Felix.parsedWorkspaceRootModule workspace)
- maybe
- (throwIO
- (VerificationMissingRootModule rootAddress))
- pure
- (Map.lookup rootAddress admittedByAddress)
- where
- foundation =
- initialLegacyCheckingEnvironment
-
- checkModule
- :: Foundation.CheckedFoundation
- -> NonEmpty Legacy.LegacyModuleAssignment
- -> Map
- ResolvedSourceAddress
- Transition.TransitionAdmittedModule
- -> Legacy.LegacyModuleAssignment
- -> IO
- (Map
- ResolvedSourceAddress
- Transition.TransitionAdmittedModule)
- checkModule
- moduleFoundation
- assignments
- admittedByAddress
- assignment = do
- let parsedModule =
- Legacy.assignedParsedModule assignment
- source =
- Felix.parsedModuleResolved parsedModule
- address =
- Felix.parsedModuleAddress parsedModule
- moduleStart <- getMonotonicTimeNSec
- observeModuleStart
- observationRef
- assignments
- admittedByAddress
- address
- moduleStart
- directImports <-
- traverse
- (lookupImportedModule admittedByAddress
- . Felix.parsedImportedAddress)
- (Felix.parsedModuleImports parsedModule)
- builder <-
- driverTransition
- (Transition.openTransitionModuleBuilder
- moduleFoundation
- foundation
- assignment
- directImports)
- blocks <-
- glossModule
- source
- (Felix.parsedModuleBlocks parsedModule)
- checked <- do
- checkedResult <- try
- (runCheckingBlocks
- blocks
- (initialTransitionCheckingState
- builder
- (resolvePreparedBatch
- runInIO
- prover
- requestObserver
- observationRef)))
- either
- (throwIO . VerificationCheckingError source)
- pure
- checkedResult
- finalBuilder <-
- maybe
- (impossible
- "checking lost its transition module builder")
- pure
- (checkingTransitionModuleBuilder checked)
- admitted <-
- driverTransition
- (Transition.sealTransitionModule
- (checkingStateEnvironment checked)
- finalBuilder)
- moduleEnd <- getMonotonicTimeNSec
- let admittedByAddress' =
- Map.insert address admitted admittedByAddress
- observeModuleAdmission
- observationRef
- assignments
- admittedByAddress'
- moduleEnd
- pure admittedByAddress'
-
-checkTypedWorkspace
- :: Foundation.CheckedFoundation
- -> Typed.MigrationPreludeSession
- -> Declaration.VampireResolver
+ => Store.StoreMemo
+ -> Store.StoreCoordinator
+ -> Foundation.CheckedFoundation
+ -> Typed.FinalPreludeSession
+ -> (forall value. io value -> IO value)
+ -> VampireExecutor
+ -> EffectiveJobs
-> StoreValidationMode
-> IORef VerificationObservation
-> ParsedSourceWorkspace
-> Store.Store
- -> IO Typed.SealedTypedModule
+ -> IO TypedWorkspaceOutcome
checkTypedWorkspace
- foundation prelude resolver validationMode observationRef workspace
+ memo
+ storeCoordinator
+ foundation
+ prelude
+ runInIO
+ executor
+ selectedJobs
+ validationMode
+ observationRef
+ workspace
store = do
- memo <- Store.newStoreMemo store
let modules =
- toList (Felix.parsedWorkspaceImportedBeforeImporter workspace)
- modifyIORef' observationRef \observation ->
- observation
- { observedModuleCount = length modules
- , observedMaximumReadyModuleCount =
- if null modules then 0 else 1
- }
- admittedByAddress <-
- foldM (checkModule memo) Map.empty modules
- let root = Felix.parsedWorkspaceRootModule workspace
- rootAddress = Felix.parsedModuleAddress root
- maybe
- (throwIO (VerificationMissingRootModule rootAddress))
- pure
- (Map.lookup rootAddress admittedByAddress)
+ zipWith
+ makeTask
+ [1..]
+ (toList
+ (Felix.parsedWorkspaceImportedBeforeImporter workspace))
+ rootAddress =
+ Felix.parsedModuleAddress
+ (Felix.parsedWorkspaceRootModule workspace)
+ atomicModifyIORef' observationRef
+ (\observation ->
+ ( observation
+ { observedModuleCount = length modules
+ }
+ , ()
+ ))
+ scheduleModules
+ rootAddress
+ modules
+ Map.empty
+ Map.empty
+ Map.empty
+ Nothing
where
- storeValidationLookup lookupStore =
- Declaration.validationLookup
- (\key ->
- Store.loadProofValidation lookupStore key
- >>= either
- (throwIO . VerificationStoreFailure)
- pure)
- (\key ->
- Store.loadDeclarationValidation lookupStore key
- >>= either
- (throwIO . VerificationStoreFailure)
- pure)
+ workerBound = effectiveJobsValue selectedJobs
- validationRun =
- case validationMode of
- FreshStoreValidation ->
- Declaration.FreshValidation
- WarmStoreValidation ->
- Declaration.WarmValidation
- (storeValidationLookup store)
-
- checkModule memo admittedByAddress parsed = do
- let source = Felix.parsedModuleResolved parsed
- address = Felix.parsedModuleAddress parsed
- directAddresses =
+ makeTask ordinal parsed =
+ ModuleTask
+ { moduleTaskOrdinal = ordinal
+ , moduleTaskParsed = parsed
+ , moduleTaskDirectAddresses =
nubOrd
(Felix.parsedImportedAddress
<$> Felix.parsedModuleImports parsed)
+ }
+
+ scheduleModules
+ rootAddress
+ pending
+ running
+ sealedByAddress
+ admittedByOrdinal
+ candidate = do
+ let readyCount =
+ length
+ [ ()
+ | task <- pending
+ , taskMayStart candidate sealedByAddress task
+ ]
+ observeReadyModules observationRef readyCount
+ (pending', running') <-
+ startReadyModules
+ pending
+ running
+ sealedByAddress
+ candidate
+ Exception.onException
+ (if Map.null running'
+ then case candidate of
+ Just selected
+ | any
+ (\task ->
+ moduleTaskOrdinal task
+ < candidateOrdinal selected)
+ pending' ->
+ throwIO
+ (VerificationModuleSchedulerInvariant
+ "an earlier module is not terminal")
+ | otherwise ->
+ pure
+ (TypedWorkspaceRejected
+ (admittedWorkspaceThrough
+ admittedByOrdinal
+ selected)
+ (candidateFailure selected))
+ Nothing
+ | null pending' -> do
+ unless
+ (Map.member rootAddress sealedByAddress)
+ (throwIO
+ (VerificationMissingRootModule
+ rootAddress))
+ pure
+ (TypedWorkspaceSucceeded
+ (completeAdmittedWorkspace
+ admittedByOrdinal))
+ | otherwise ->
+ throwIO
+ (VerificationModuleSchedulerInvariant
+ "no ready module and no running module")
+ else do
+ (_completedAsync, (ordinal, completed)) <-
+ Async.waitAny (Map.elems running')
+ let runningWithoutCompleted =
+ Map.delete ordinal running'
+ case completed of
+ Left fatal -> do
+ cancelModuleCheckers runningWithoutCompleted
+ Exception.throwIO fatal
+ Right (ModuleCheckSucceeded
+ address sealed admittedModule) ->
+ scheduleModules
+ rootAddress
+ pending'
+ runningWithoutCompleted
+ (Map.insert address sealed sealedByAddress)
+ (Map.insert
+ ordinal
+ admittedModule
+ admittedByOrdinal)
+ candidate
+ Right (ModuleCheckRejected
+ admittedModule failure) -> do
+ let selected =
+ chooseEarlierFailure
+ candidate
+ (ModuleFailureCandidate
+ ordinal
+ admittedModule
+ failure)
+ cutoff = candidateOrdinal selected
+ (later, retained) =
+ Map.partitionWithKey
+ (\runningOrdinal _async ->
+ runningOrdinal > cutoff)
+ runningWithoutCompleted
+ cancelModuleCheckers later
+ scheduleModules
+ rootAddress
+ pending'
+ retained
+ sealedByAddress
+ admittedByOrdinal
+ (Just selected)
+ )
+ (cancelModuleCheckers running')
+
+ startReadyModules
+ pending
+ running
+ sealedByAddress
+ candidate
+ | Map.size running >= workerBound =
+ pure (pending, running)
+ | otherwise =
+ case extractFirstReady candidate sealedByAddress pending of
+ Nothing ->
+ pure (pending, running)
+ Just (task, remaining) -> do
+ checker <- Async.async do
+ completed <-
+ (Exception.try
+ (observeModuleChecker observationRef
+ (checkModule task sealedByAddress))
+ :: IO
+ (Either
+ SomeException
+ ModuleCheckResult))
+ pure (moduleTaskOrdinal task, completed)
+ startReadyModules
+ remaining
+ (Map.insert
+ (moduleTaskOrdinal task)
+ checker
+ running)
+ sealedByAddress
+ candidate
+
+ checkModule task sealedByAddress = do
+ let parsed = moduleTaskParsed task
+ source = Felix.parsedModuleResolved parsed
+ address = Felix.parsedModuleAddress parsed
direct <-
traverse
(\directAddress ->
@@ -1018,8 +1162,14 @@ checkTypedWorkspace
(VerificationMissingImportedModule
directAddress))
pure
- (Map.lookup directAddress admittedByAddress))
- directAddresses
+ (Map.lookup directAddress sealedByAddress))
+ (moduleTaskDirectAddresses task)
+ resolver <-
+ typedVampireResolver
+ runInIO
+ executor
+ (moduleTaskOrdinal task)
+ observationRef
input <-
either
(throwIO . VerificationTypedInputError source)
@@ -1031,9 +1181,16 @@ checkTypedWorkspace
validationRun
parsed
direct)
- loadCachedModule memo parsed direct >>= \case
- Just sealed ->
- pure (Map.insert address sealed admittedByAddress)
+ loadCachedModule parsed direct >>= \case
+ Just sealed -> do
+ observeModuleRootAcquisition
+ observationRef Typed.ModuleRootHit
+ pure
+ (ModuleCheckSucceeded
+ address
+ sealed
+ (completeAdmittedModule
+ (Typed.identifiedPhysicalModule parsed)))
Nothing -> do
typedResult <-
Exception.catch
@@ -1046,21 +1203,88 @@ checkTypedWorkspace
case typedResult of
Typed.TypedModuleOpenFailed err ->
throwIO (VerificationTypedOpenError source err)
- Typed.TypedModuleFailed err prefix ->
- flushPrefix prefix
- >>= either
- (throwIO . VerificationStoreFailure)
- (const
- (throwIO
- (VerificationTypedModuleError
- source
- err
- prefix)))
+ Typed.TypedModuleFailed err prefix -> do
+ let driverFailure =
+ VerificationTypedModuleError
+ source err prefix
+ case classifyTypedModuleFailure err of
+ TypedIntegrityFailure ->
+ throwIO driverFailure
+ TypedCheckingRejection ->
+ reportFailure
+ parsed
+ prefix
+ (TypedWorkspaceCheckingRejected
+ driverFailure)
+ TypedVerificationRejection failed ->
+ reportFailure
+ parsed
+ prefix
+ (TypedWorkspaceProverRejected failed)
+ TypedProverFailure failed ->
+ reportFailure
+ parsed
+ prefix
+ (TypedWorkspaceProverRejected failed)
Typed.TypedModuleSucceeded sealed -> do
+ admittedModule <-
+ either
+ (throwIO
+ . VerificationAdmittedViewError source)
+ pure
+ (checkedAdmittedModule
+ True
+ (Typed.identifiedPhysicalModule parsed)
+ (Typed.sealedTypedModulePrefix sealed))
persistSealed
(Typed.identifiedPhysicalModule parsed)
sealed
- pure (Map.insert address sealed admittedByAddress)
+ observeModuleRootAcquisition
+ observationRef Typed.ModuleRootMiss
+ pure
+ (ModuleCheckSucceeded
+ address sealed admittedModule)
+
+ reportFailure parsed prefix failure = do
+ let source = Felix.parsedModuleResolved parsed
+ admittedModule <-
+ either
+ (throwIO . VerificationAdmittedViewError source)
+ pure
+ (checkedAdmittedModule
+ False
+ (Typed.identifiedPhysicalModule parsed)
+ prefix)
+ Store.withStoreCoordinator storeCoordinator
+ (Store.writePendingModulePrefix store prefix)
+ >>= either
+ (throwIO . VerificationStoreFailure)
+ pure
+ pure (ModuleCheckRejected admittedModule failure)
+
+ storeValidationLookup lookupStore =
+ Declaration.validationLookup
+ (\key ->
+ Store.withStoreCoordinator storeCoordinator
+ (Store.loadProofValidation lookupStore key)
+ >>= either
+ (throwIO . VerificationStoreFailure)
+ pure)
+ (\key ->
+ Store.withStoreCoordinator storeCoordinator
+ (Store.loadDeclarationValidation lookupStore key)
+ >>= either
+ (throwIO . VerificationStoreFailure)
+ pure)
+
+ validationRun =
+ case validationMode of
+ FreshStoreValidation ->
+ Declaration.FreshValidation
+ WarmStoreValidation ->
+ Declaration.WarmValidation
+ (storeValidationLookup store)
+
persistSealed input sealed = do
artifactKey <-
either
@@ -1080,22 +1304,24 @@ checkTypedWorkspace
(Typed.sealedTypedModuleSyntax sealed))
(Semantic.semanticInterfaceAssertedId
(Typed.sealedTypedModuleSemantic sealed))
- Store.writeSealedModule
- store
- (Typed.sealedTypedModulePrefix sealed)
- [Typed.sealedTypedModuleSyntax sealed]
- [Typed.sealedTypedModuleSemantic sealed]
- artifact
- >>= either
- (throwIO . VerificationStoreFailure)
- (\acknowledged ->
- unless
- (acknowledged == artifact)
- (throwIO
- (VerificationStoreFailure
- Store.StoreModuleArtifactIdMismatch)))
+ acknowledged <-
+ Store.withStoreCoordinator storeCoordinator
+ (Store.writeSealedModule
+ store
+ (Typed.sealedTypedModulePrefix sealed)
+ [Typed.sealedTypedModuleSyntax sealed]
+ [Typed.sealedTypedModuleSemantic sealed]
+ artifact)
+ >>= either
+ (throwIO . VerificationStoreFailure)
+ pure
+ unless
+ (acknowledged == artifact)
+ (throwIO
+ (VerificationStoreFailure
+ Store.StoreModuleArtifactIdMismatch))
- loadCachedModule memo parsed direct =
+ loadCachedModule parsed direct =
case validationMode of
WarmStoreValidation -> do
let owner =
@@ -1104,7 +1330,7 @@ checkTypedWorkspace
directSemantic =
Semantic.semanticInterfaceAssertedId
(Typed.sealedTypedModuleSemantic
- (Typed.migrationPreludeModule prelude))
+ (Typed.finalPreludeModule prelude))
: ( Semantic.semanticInterfaceAssertedId
. Typed.sealedTypedModuleSemantic
<$> direct
@@ -1120,386 +1346,275 @@ checkTypedWorkspace
(Typed.identifiedPhysicalModule parsed)))
directSemantic
(Identity.theoryId foundation))
- Store.loadCachedModuleInstallation
- memo
- store
- artifactKey
- (Syntax.moduleSyntaxAssertedId
- (Felix.parsedModuleSyntaxInterface parsed))
- >>= \case
+ loaded <-
+ Store.withStoreCoordinator storeCoordinator
+ (Store.loadCachedModuleInstallation
+ memo
+ store
+ artifactKey
+ (Syntax.moduleSyntaxAssertedId
+ (Felix.parsedModuleSyntaxInterface parsed)))
+ case loaded of
Left failure ->
throwIO (VerificationStoreFailure failure)
Right Nothing ->
pure Nothing
- Right (Just installation) -> do
- cached <-
- either
- (throwIO
- . VerificationTypedCachedModuleError
- (Felix.parsedModuleResolved parsed))
- pure
- (Typed.cachedSealedTypedModule
- foundation
- (Typed.migrationPreludeModule prelude
- : direct)
- installation)
- pure (Just cached)
+ Right (Just installation) ->
+ either
+ (throwIO
+ . VerificationTypedCachedModuleError
+ (Felix.parsedModuleResolved parsed))
+ (pure . Just)
+ (Typed.cachedSealedTypedModule
+ foundation
+ (Typed.finalPreludeModule prelude : direct)
+ installation)
FreshStoreValidation ->
pure Nothing
- flushPrefix prefix =
- Store.writePendingModulePrefix store prefix
+ taskMayStart candidate sealedByAddress task =
+ maybe True
+ (moduleTaskOrdinal task <)
+ (candidateOrdinal <$> candidate)
+ && all
+ (`Map.member` sealedByAddress)
+ (moduleTaskDirectAddresses task)
+
+ extractFirstReady candidate sealedByAddress = go []
+ where
+ go _before [] = Nothing
+ go before (task : after)
+ | taskMayStart candidate sealedByAddress task =
+ Just (task, reverse before <> after)
+ | otherwise =
+ go (task : before) after
+
+ chooseEarlierFailure Nothing incoming = incoming
+ chooseEarlierFailure (Just current) incoming
+ | candidateOrdinal incoming < candidateOrdinal current = incoming
+ | otherwise = current
+
+ candidateOrdinal (ModuleFailureCandidate ordinal _admitted _failure) =
+ ordinal
+
+ candidateFailure (ModuleFailureCandidate _ordinal _admitted failure) =
+ failure
+
+ candidateAdmitted (ModuleFailureCandidate _ordinal admitted _failure) =
+ admitted
+
+ completeAdmittedWorkspace admittedByOrdinal =
+ AdmittedTypedWorkspace
+ ( completeAdmittedModule (Typed.finalPreludeInput prelude)
+ : fmap snd (Map.toAscList admittedByOrdinal)
+ )
+
+ admittedWorkspaceThrough admittedByOrdinal selected =
+ let cutoff = candidateOrdinal selected
+ earlier = Map.filterWithKey
+ (\ordinal _admitted -> ordinal < cutoff)
+ admittedByOrdinal
+ in AdmittedTypedWorkspace
+ ( completeAdmittedModule (Typed.finalPreludeInput prelude)
+ : ( fmap snd (Map.toAscList earlier)
+ <> [candidateAdmitted selected]
+ )
+ )
+
+ cancelModuleCheckers running = do
+ traverse_ Async.cancel (Map.elems running)
+ traverse_ Async.waitCatch (Map.elems running)
+
+data TypedFailureClassification
+ = TypedCheckingRejection
+ | TypedVerificationRejection !FailedVerification
+ | TypedProverFailure !FailedVerification
+ | TypedIntegrityFailure
+
+-- | Classify failures at the typed checking boundary conservatively.
+--
+-- Only source elaboration and recognized prover outcomes may retain an
+-- admitted source report. Every declaration/sealing invariant, including a
+-- future constructor not explicitly recognized below, remains fatal.
+classifyTypedModuleFailure
+ :: Typed.TypedModuleFailure
+ -> TypedFailureClassification
+classifyTypedModuleFailure = \case
+ Typed.TypedActionFailed{} ->
+ TypedCheckingRejection
+ Typed.TypedDeclarationFailed
+ (Declaration.ProofObligationFailedAt
+ location
+ (Declaration.VampireProcessFailed processError)) ->
+ classifyTypedProverResult location (Left processError)
+ Typed.TypedDeclarationFailed
+ (Declaration.ProofObligationFailedAt
+ location
+ (Declaration.VampireObligationRejected answer)) ->
+ classifyTypedProverResult location (Right answer)
+ _failure ->
+ TypedIntegrityFailure
+
+classifyTypedProverResult
+ :: Location
+ -> Either ProverProcessError ProverAnswer
+ -> TypedFailureClassification
+classifyTypedProverResult location result =
+ case verificationFailureReason result of
+ Nothing ->
+ TypedIntegrityFailure
+ Just reason ->
+ let failed = FailedVerification location reason
+ in case reason of
+ CountermodelFailure{} ->
+ TypedVerificationRejection failed
+ ContradictoryInputFailure{} ->
+ TypedVerificationRejection failed
+ IndeterminateFailure{} ->
+ TypedProverFailure failed
+ ProtocolFailure{} ->
+ TypedProverFailure failed
+ TransportFailure{} ->
+ TypedProverFailure failed
typedVampireResolver
:: forall io
. (MonadIO io, MonadLogger io)
=> (forall value. io value -> IO value)
- -> Vampire
- -> VerificationRequestObserver
+ -> VampireExecutor
+ -> Natural
-> IORef VerificationObservation
- -> Declaration.VampireResolver
-typedVampireResolver runInIO prover requestObserver observationRef =
- Declaration.vampireResolver \prepared -> do
- started <- getMonotonicTimeNSec
- observeVampireStart observationRef started
- let request = preparedTypedProverRequest prepared
- modifyIORef' observationRef \observation ->
- observation
+ -> IO Declaration.VampireResolver
+typedVampireResolver
+ runInIO executor moduleOrdinal observationRef = do
+ localOrdinalRef <- newIORef 1
+ pure (Declaration.vampireBatchResolver \prepared -> do
+ let batchSize = NonEmpty.length prepared
+ ordinalCount = fromIntegral batchSize
+ firstOrdinal <- atomicModifyIORef' localOrdinalRef
+ (\current -> (current + ordinalCount, current))
+ let positions =
+ NonEmpty.fromList
+ [ workPosition moduleOrdinal ordinal
+ | ordinal <-
+ [firstOrdinal .. firstOrdinal + ordinalCount - 1]
+ ]
+ positioned =
+ NonEmpty.zip positions prepared
+ preparedBytes =
+ foldl'
+ (\total task ->
+ total
+ + fromIntegral
+ (preparedVerificationByteCount
+ (preparedTypedProverRequest task)))
+ 0
+ prepared
+ atomicModifyIORef' observationRef \observation ->
+ ( observation
{ observedObligationBatchCount =
observedObligationBatchCount observation + 1
, observedPreparedObligationCount =
- observedPreparedObligationCount observation + 1
+ observedPreparedObligationCount observation + batchSize
, observedMaximumObligationBatchSize =
max
- 1
+ batchSize
(observedMaximumObligationBatchSize observation)
, observedPreparedRequestBytes =
observedPreparedRequestBytes observation
- + fromIntegral
- (preparedVerificationByteCount request)
+ + preparedBytes
}
- result <- runInIO
- (runPreparedTypedProverWithObserver
- (observeRequest observationRef requestObserver)
- prover
- prepared)
- finished <- getMonotonicTimeNSec
- observeVampireFinish observationRef (finished - started)
- pure result
-
-initializeModuleObservation
- :: IORef VerificationObservation
- -> NonEmpty Legacy.LegacyModuleAssignment
- -> IO ()
-initializeModuleObservation observationRef assignments = do
- now <- getMonotonicTimeNSec
- let ready =
- readyModuleAssignments
- assignments
- Map.empty
- modifyIORef'
- observationRef
- (\observation ->
- observation
- { observedModuleCount =
- NonEmpty.length assignments
- , observedReadyAt =
- Map.fromList
- [ (legacyAssignmentAddress assignment, now)
- | assignment <- ready
- ]
- , observedMaximumReadyModuleCount =
- length ready
- })
-
-observeModuleStart
+ , ()
+ )
+ results <-
+ Async.mapConcurrently
+ (\(position, task) ->
+ runInIO
+ (runPreparedTypedProverWithExecutor
+ executor
+ position
+ task))
+ (NonEmpty.toList positioned)
+ pure (NonEmpty.fromList results))
+
+observeModuleRootAcquisition
:: IORef VerificationObservation
- -> NonEmpty Legacy.LegacyModuleAssignment
- -> Map
- ResolvedSourceAddress
- Transition.TransitionAdmittedModule
- -> ResolvedSourceAddress
- -> Word64
+ -> Typed.ModuleRootAcquisition
-> IO ()
-observeModuleStart
- observationRef
- assignments
- admittedByAddress
- address
- now =
- modifyIORef'
- observationRef
- (\observation ->
- let
- ready =
- readyModuleAssignments
- assignments
- admittedByAddress
- readySince =
- Map.findWithDefault
- now
- address
- (observedReadyAt observation)
- in
+observeModuleRootAcquisition observationRef acquisition =
+ atomicModifyIORef' observationRef \observation ->
+ ( case acquisition of
+ Typed.ModuleRootHit ->
observation
- { observedMaximumReadyModuleCount =
- max
- (observedMaximumReadyModuleCount
- observation)
- (length ready)
- , observedReadyModuleWaitNanoseconds =
- observedReadyModuleWaitNanoseconds
- observation
- + (now - readySince)
- })
-
-observeModuleAdmission
- :: IORef VerificationObservation
- -> NonEmpty Legacy.LegacyModuleAssignment
- -> Map
- ResolvedSourceAddress
- Transition.TransitionAdmittedModule
- -> Word64
- -> IO ()
-observeModuleAdmission
- observationRef
- assignments
- admittedByAddress
- now =
- modifyIORef'
- observationRef
- (\observation ->
- let
- ready =
- readyModuleAssignments
- assignments
- admittedByAddress
- readyAt =
- foldl'
- (\known assignment ->
- Map.insertWith
- (\_new old -> old)
- (legacyAssignmentAddress assignment)
- now
- known)
- (observedReadyAt observation)
- ready
- in
+ { observedModuleRootHitCount =
+ observedModuleRootHitCount observation + 1
+ }
+ Typed.ModuleRootMiss ->
observation
- { observedReadyAt = readyAt
- , observedMaximumReadyModuleCount =
- max
- (observedMaximumReadyModuleCount
- observation)
- (length ready)
- })
-
-readyModuleAssignments
- :: NonEmpty Legacy.LegacyModuleAssignment
- -> Map
- ResolvedSourceAddress
- Transition.TransitionAdmittedModule
- -> [Legacy.LegacyModuleAssignment]
-readyModuleAssignments assignments admittedByAddress =
- [ assignment
- | assignment <- NonEmpty.toList assignments
- , legacyAssignmentAddress assignment
- `Map.notMember` admittedByAddress
- , all
- (`Map.member` admittedByAddress)
- (legacyAssignmentImportAddresses assignment)
- ]
-
-legacyAssignmentAddress
- :: Legacy.LegacyModuleAssignment
- -> ResolvedSourceAddress
-legacyAssignmentAddress =
- Felix.parsedModuleAddress
- . Legacy.assignedParsedModule
-
-legacyAssignmentImportAddresses
- :: Legacy.LegacyModuleAssignment
- -> [ResolvedSourceAddress]
-legacyAssignmentImportAddresses =
- fmap Felix.parsedImportedAddress
- . Felix.parsedModuleImports
- . Legacy.assignedParsedModule
-
-lookupImportedModule
- :: Map
- ResolvedSourceAddress
- Transition.TransitionAdmittedModule
- -> ResolvedSourceAddress
- -> IO Transition.TransitionAdmittedModule
-lookupImportedModule admittedByAddress address =
- maybe
- (throwIO
- (VerificationMissingImportedModule address))
- pure
- (Map.lookup address admittedByAddress)
-
-glossModule
- :: ResolvedSource
- -> [Raw.Block]
- -> IO [Internal.Block]
-glossModule source rawBlocks =
- either
- (throwIO . VerificationGlossError source)
- pure
- (meaning rawBlocks)
+ { observedModuleRootMissCount =
+ observedModuleRootMissCount observation + 1
+ }
+ , ()
+ )
-resolvePreparedBatch
- :: forall io
- . (MonadIO io, MonadLogger io)
- => (forall a. io a -> IO a)
- -> Vampire
- -> VerificationRequestObserver
- -> IORef VerificationObservation
- -> PreparedObligationBatch
- -> IO ResolvedObligationBatch
-resolvePreparedBatch
- runInIO prover requestObserver observationRef batch = do
- observePreparedBatch observationRef batch
- resolved <-
- traverse
- resolveObligation
- (preparedBatchObligations batch)
- driverResolution
- (resolveObligationBatch batch resolved)
- where
- resolveObligation obligation =
- case preparedObligationMethod obligation of
- RecordExplicitGap{} ->
- driverResolution
- (resolveObligationAsGap obligation)
- ProveWithVampire -> do
- started <- getMonotonicTimeNSec
- observeVampireStart
- observationRef
- started
- result <-
- runInIO
- (runPreparedProverWithObserver
- (observeRequest
- observationRef
- requestObserver)
- prover
- (preparedObligationProverTask
- obligation))
- finished <- getMonotonicTimeNSec
- observeVampireFinish
- observationRef
- (finished - started)
- case failedVerification result of
- Just failed ->
- throwIO (VerificationAborted failed)
- Nothing ->
- case result of
- ( _location
- , _formula
- , Right answer
- )
- | Just accepted <-
- provedVampireRun answer ->
- driverResolution
- (resolveObligationWithVampire
- obligation
- accepted)
- _ ->
- impossible
- "successful prover result has no accepted Vampire run"
-
-observeRequest
+observeReadyModules
:: IORef VerificationObservation
- -> VerificationRequestObserver
- -> PreparedVerificationRequest
+ -> Int
-> IO ()
-observeRequest observationRef observer request = do
- ordinal <- atomicModifyIORef' observationRef \observation ->
- let current = observedNextRequestOrdinal observation
+observeReadyModules observationRef readyCount =
+ atomicModifyIORef' observationRef \observation ->
+ ( observation
+ { observedMaximumReadyModuleCount =
+ max readyCount
+ (observedMaximumReadyModuleCount observation)
+ }
+ , ()
+ )
+
+observeModuleChecker
+ :: IORef VerificationObservation
+ -> IO value
+ -> IO value
+observeModuleChecker observationRef action = do
+ atomicModifyIORef' observationRef \observation ->
+ let live = observedLiveModuleCheckers observation + 1
in
( observation
- { observedNextRequestOrdinal = current + 1
+ { observedLiveModuleCheckers = live
+ , observedMaximumLiveModuleCheckers =
+ max live
+ (observedMaximumLiveModuleCheckers observation)
}
- , VerificationRequestOrdinal current
+ , ()
)
- observeVerificationRequest observer ordinal request
-
-observePreparedBatch
+ action `Exception.finally`
+ atomicModifyIORef' observationRef
+ (\observation ->
+ ( observation
+ { observedLiveModuleCheckers =
+ observedLiveModuleCheckers observation - 1
+ }
+ , ()
+ ))
+
+mergeExecutorObservation
:: IORef VerificationObservation
- -> PreparedObligationBatch
+ -> VampireExecutorObservation
-> IO ()
-observePreparedBatch observationRef batch =
- modifyIORef'
- observationRef
- (\observation ->
- observation
- { observedObligationBatchCount =
- observedObligationBatchCount observation
- + 1
- , observedPreparedObligationCount =
- observedPreparedObligationCount observation
- + obligationCount
- , observedMaximumObligationBatchSize =
- max
- (observedMaximumObligationBatchSize
- observation)
- obligationCount
- , observedPreparedRequestBytes =
- observedPreparedRequestBytes observation
- + requestBytes
- })
- where
- obligations =
- preparedBatchObligations batch
- obligationCount =
- Vector.length obligations
- requestBytes =
- Vector.foldl'
- (\total obligation ->
- total
- + fromIntegral
- (preparedVerificationByteCount
- (preparedProverRequest
- (preparedObligationProverTask
- obligation))))
- 0
- obligations
-
-observeVampireStart
- :: IORef VerificationObservation
- -> Word64
- -> IO ()
-observeVampireStart observationRef started =
- modifyIORef'
- observationRef
- (\observation ->
- observation
- { observedVampireRunCount =
- observedVampireRunCount observation
- + 1
- , observedFirstVampireStart =
- case observedFirstVampireStart observation of
- Nothing ->
- Just started
- firstStart ->
- firstStart
- })
-
-observeVampireFinish
- :: IORef VerificationObservation
- -> Word64
- -> IO ()
-observeVampireFinish observationRef duration =
- modifyIORef'
- observationRef
- (\observation ->
- observation
- { observedVampireExecutionNanoseconds =
- observedVampireExecutionNanoseconds
- observation
- + duration
- })
+mergeExecutorObservation observationRef executorObserved =
+ atomicModifyIORef' observationRef \observation ->
+ ( observation
+ { observedVampireRunCount =
+ vampireExecutorRunCount executorObserved
+ , observedMaximumLiveVampireProcesses =
+ vampireExecutorMaximumLiveCount executorObserved
+ , observedFirstVampireStart =
+ vampireExecutorFirstStartNanoseconds executorObserved
+ , observedVampireExecutionNanoseconds =
+ vampireExecutorExecutionNanoseconds executorObserved
+ }
+ , ()
+ )
finalizeVerificationMeasurements
:: Word64
@@ -1508,7 +1623,6 @@ finalizeVerificationMeasurements
-> Felix.ParseMeasurements
-> Word64
-> VerificationObservation
- -> Maybe CheckedWorkspace
-> VerificationMeasurements
finalizeVerificationMeasurements
invocationStart
@@ -1516,8 +1630,7 @@ finalizeVerificationMeasurements
checkingEnd
parseMeasurements
sourcePreparation
- observation
- admitted =
+ observation =
VerificationMeasurements
{ verificationParseMeasurements =
parseMeasurements
@@ -1529,10 +1642,18 @@ finalizeVerificationMeasurements
checkingEnd - checkingStart
, verificationModuleCount =
observedModuleCount observation
+ , verificationDetectedProcessorCount =
+ observedDetectedProcessorCount observation
+ , verificationEffectiveJobs =
+ observedEffectiveJobs observation
+ , verificationJobsOverridden =
+ observedJobsOverridden observation
+ , verificationMaximumLiveModuleCheckers =
+ observedMaximumLiveModuleCheckers observation
+ , verificationMaximumLiveVampireProcesses =
+ observedMaximumLiveVampireProcesses observation
, verificationMaximumReadyModuleCount =
observedMaximumReadyModuleCount observation
- , verificationReadyModuleWaitNanoseconds =
- observedReadyModuleWaitNanoseconds observation
, verificationObligationBatchCount =
observedObligationBatchCount observation
, verificationPreparedObligationCount =
@@ -1543,20 +1664,16 @@ finalizeVerificationMeasurements
observedPreparedRequestBytes observation
, verificationVampireRunCount =
observedVampireRunCount observation
+ , verificationModuleRootHitCount =
+ observedModuleRootHitCount observation
+ , verificationModuleRootMissCount =
+ observedModuleRootMissCount observation
, verificationFirstVampireStartNanoseconds =
fmap
(\started -> started - invocationStart)
(observedFirstVampireStart observation)
, verificationVampireExecutionNanoseconds =
observedVampireExecutionNanoseconds observation
- , verificationReplayMeasurements =
- case admitted of
- Just (CheckedLegacyWorkspace legacy) ->
- Transition.transitionAdmittedReplayMeasurements legacy
- Just (CheckedTypedWorkspace _typed) ->
- emptyReplayMeasurements
- Nothing ->
- emptyReplayMeasurements
}
renderVerificationMeasurements
@@ -1607,6 +1724,21 @@ renderVerificationMeasurements measurements =
parseMeasurements)
, "modules=" <> renderIntegral
(verificationModuleCount measurements)
+ , "detected_processors="
+ <> maybe
+ "unavailable"
+ renderIntegral
+ (verificationDetectedProcessorCount measurements)
+ , "effective_jobs=" <> renderIntegral
+ (verificationEffectiveJobs measurements)
+ , "jobs_overridden="
+ <> if verificationJobsOverridden measurements
+ then "yes"
+ else "no"
+ , "max_module_checkers=" <> renderIntegral
+ (verificationMaximumLiveModuleCheckers measurements)
+ , "max_vampire_processes=" <> renderIntegral
+ (verificationMaximumLiveVampireProcesses measurements)
, "files_read=" <> renderIntegral
(Felix.parseMeasurementModuleCount
parseMeasurements)
@@ -1634,6 +1766,10 @@ renderVerificationMeasurements measurements =
(verificationPreparedRequestBytes measurements)
, "vampire_runs=" <> renderIntegral
(verificationVampireRunCount measurements)
+ , "module_root_hits=" <> renderIntegral
+ (verificationModuleRootHitCount measurements)
+ , "module_root_misses=" <> renderIntegral
+ (verificationModuleRootMissCount measurements)
, "first_vampire_ms="
<> maybe
"none"
@@ -1644,43 +1780,9 @@ renderVerificationMeasurements measurements =
<> renderNanoseconds
(verificationVampireExecutionNanoseconds
measurements)
- , "vampire_idle_ms="
- <> renderNanoseconds
- (verificationVampireIdleNanoseconds
- measurements)
- , "vampire_utilization_permille="
- <> renderIntegral
- (verificationVampireUtilizationPermille
- measurements)
, "max_ready_modules=" <> renderIntegral
(verificationMaximumReadyModuleCount
measurements)
- , "ready_wait_sum_ms="
- <> renderNanoseconds
- (verificationReadyModuleWaitNanoseconds
- measurements)
- , "kernel_replays=" <> renderIntegral
- (Transition.transitionKernelReplayCount replay)
- , "kernel_replay_nodes=" <> renderIntegral
- (Transition.transitionKernelReplayNodeCount replay)
- , "kernel_replay_max_depth=" <> renderIntegral
- (Transition.transitionKernelReplayMaximumDepth replay)
- , "reconstructions=" <> renderIntegral
- (Transition.transitionReconstructionCount replay)
- , "connection_search_work=" <> renderIntegral
- (Transition.transitionReconstructionSearchWork
- replay)
- , "connection_derived_atoms=" <> renderIntegral
- (Transition.transitionReconstructionDerivedAtomCount
- replay)
- , "connection_max_candidate_depth=" <> renderIntegral
- (Transition.transitionReconstructionMaximumCandidateDepth
- replay)
- , "connection_replay_nodes=" <> renderIntegral
- (Transition.transitionConnectionReplayNodeCount replay)
- , "connection_replay_max_depth=" <> renderIntegral
- (Transition.transitionConnectionReplayMaximumDepth
- replay)
, "total_ms="
<> renderNanoseconds
(verificationInvocationNanoseconds
@@ -1689,52 +1791,6 @@ renderVerificationMeasurements measurements =
where
parseMeasurements =
verificationParseMeasurements measurements
- replay =
- verificationReplayMeasurements measurements
-
-emptyReplayMeasurements
- :: Transition.TransitionReplayMeasurements
-emptyReplayMeasurements =
- Transition.TransitionReplayMeasurements
- { Transition.transitionKernelReplayCount = 0
- , Transition.transitionKernelReplayNodeCount = 0
- , Transition.transitionKernelReplayMaximumDepth = 0
- , Transition.transitionReconstructionCount = 0
- , Transition.transitionReconstructionSearchWork = 0
- , Transition.transitionReconstructionDerivedAtomCount = 0
- , Transition.transitionReconstructionMaximumCandidateDepth = 0
- , Transition.transitionConnectionReplayNodeCount = 0
- , Transition.transitionConnectionReplayMaximumDepth = 0
- }
-
-verificationVampireIdleNanoseconds
- :: VerificationMeasurements
- -> Word64
-verificationVampireIdleNanoseconds measurements =
- checking - min checking execution
- where
- checking =
- verificationCheckingNanoseconds measurements
- execution =
- verificationVampireExecutionNanoseconds
- measurements
-
-verificationVampireUtilizationPermille
- :: VerificationMeasurements
- -> Word64
-verificationVampireUtilizationPermille measurements
- | checking == 0 =
- 0
- | otherwise =
- min
- 1000
- (execution * 1000 `div` checking)
- where
- checking =
- verificationCheckingNanoseconds measurements
- execution =
- verificationVampireExecutionNanoseconds
- measurements
renderNanoseconds :: Word64 -> Text
renderNanoseconds nanoseconds =
@@ -1744,78 +1800,93 @@ renderIntegral :: Show number => number -> Text
renderIntegral =
StrictText.pack . show
-driverLegacy
- :: Either Legacy.LegacyModuleStageError value
- -> IO value
-driverLegacy =
- either
- (throwIO . VerificationLegacyModuleError)
- pure
-
-driverTransition
- :: Either Transition.TransitionModuleError value
- -> IO value
-driverTransition =
- either
- (throwIO . VerificationTransitionModuleError)
- pure
-
-driverResolution
- :: Either ObligationResolutionError value
- -> IO value
-driverResolution =
- either
- (throwIO . VerificationObligationResolutionError)
- pure
-
-checkedWorkspaceReport :: CheckedWorkspace -> VerificationReport
-checkedWorkspaceReport = \case
- CheckedLegacyWorkspace admitted ->
- legacyVerificationReport admitted
- CheckedTypedWorkspace _admitted ->
- VerificationReport
- { verificationRoute = TypedVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 0
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 0
- , verificationKernelProofCount = 0
- }
-
-legacyVerificationReport
- :: Transition.TransitionAdmittedModule
+admittedWorkspaceReport
+ :: AdmittedTypedWorkspace
-> VerificationReport
-legacyVerificationReport admitted =
+admittedWorkspaceReport (AdmittedTypedWorkspace modules) =
VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount =
- Set.size
- (Legacy.legacyDeclaredAssumptionUses trust)
- , verificationTypedDeclaredAssumptionCount =
- Set.size
- (Transition.typedDeclaredAssumptionUses
- (Transition.transitionAdmittedTypedTrustDependencies
- admitted))
- , verificationTrustedVampireCount =
- Set.size
- (Legacy.legacyTrustedVampireUses trust)
- + Transition.transitionAdmittedTypedTrustedVampireCount
- admitted
- , verificationExplicitGapLocations =
- Legacy.legacyGapLocations trust
- , verificationTrustedLegacyRuleCount =
- Set.size
- (Legacy.trustedLegacyRuleUses trust)
- , verificationKernelProofCount =
- Transition.transitionAdmittedKernelProofCount
- admitted
+ { verificationDirectEscapes =
+ concatMap admittedModuleEscapes modules
}
+
+admittedModuleEscapes
+ :: AdmittedTypedModule
+ -> [ReportedEscape]
+admittedModuleEscapes (AdmittedTypedModule declarations) =
+ concatMap admittedDeclarationEscapes declarations
+
+admittedDeclarationEscapes
+ :: AdmittedTypedDeclaration
+ -> [ReportedEscape]
+admittedDeclarationEscapes
+ (AdmittedTypedDeclaration _slot declaration) =
+ axiomEscape <> proofEscapes
where
- trust =
- Legacy.legacyAdmittedTrustDependencies
- (Transition.transitionAdmittedLegacyModule
- admitted)
+ axiomEscape =
+ case Typed.typedSourceDeclarationHead declaration of
+ Raw.BlockAxiom location _title _marker _axiom ->
+ [ReportedEscape ReportedSourceAxiom location]
+ _ ->
+ []
+ proofEscapes =
+ maybe [] omittedProofEscapes
+ (Typed.typedSourceDeclarationProof declaration)
+
+omittedProofEscapes :: Raw.Proof -> [ReportedEscape]
+omittedProofEscapes = \case
+ Raw.Omitted location ->
+ [ReportedEscape ReportedOmitted location]
+ Raw.Qed{} ->
+ []
+ Raw.Contradiction{} ->
+ []
+ Raw.ByCase _location cases ->
+ concatMap (omittedProofEscapes . Raw.caseProof) cases
+ Raw.ByContradiction _location proof ->
+ omittedProofEscapes proof
+ Raw.BySetInduction _location _term proof ->
+ omittedProofEscapes proof
+ Raw.ByOrdInduction _location proof ->
+ omittedProofEscapes proof
+ Raw.Assume _location _statement proof ->
+ omittedProofEscapes proof
+ Raw.FixSymbolic _location _variables _bound proof ->
+ omittedProofEscapes proof
+ Raw.FixSuchThat _location _variables _statement proof ->
+ omittedProofEscapes proof
+ Raw.Calc _location _quantifier _calculation proof ->
+ omittedProofEscapes proof
+ Raw.TakeVar _location _variables _bound _statement _justification proof ->
+ omittedProofEscapes proof
+ Raw.TakeNoun _location _noun _justification proof ->
+ omittedProofEscapes proof
+ Raw.Have _location _condition _statement _justification proof ->
+ omittedProofEscapes proof
+ Raw.Suffices _location _statement _justification proof ->
+ omittedProofEscapes proof
+ Raw.Subclaim _location _statement subproof continuation ->
+ omittedProofEscapes subproof <> omittedProofEscapes continuation
+ Raw.Define _location _variable _expression proof ->
+ omittedProofEscapes proof
+ Raw.DefineFunction
+ _location _function _argument _value _domainVariable _domain
+ proof ->
+ omittedProofEscapes proof
+ Raw.DefineFunctionLocal
+ _location _function _argument _domain _target _ruleVariable
+ _rules proof ->
+ omittedProofEscapes proof
+
+completedResult
+ :: VerificationReport
+ -> VerificationPresentation
+ -> VerificationResult
+completedResult report presentation
+ | any ((== ReportedOmitted) . reportedEscapeKind)
+ (verificationDirectEscapes report) =
+ CompletedWithExplicitGaps report presentation
+ | otherwise =
+ VerificationCompleted report presentation
verify
:: (MonadUnliftIO io, MonadLogger io)
@@ -1825,58 +1896,19 @@ verify
verify prover file =
fmap fst <$> verifyMeasured prover file
-exportHtml :: MonadUnliftIO io => FilePath -> io Text
-exportHtml file =
- HtmlExport.preparedHtmlRootDocument
- <$> prepareDefaultHtmlExport file
-
-prepareHtmlExport
- :: MonadUnliftIO io
- => FilePath
- -> io PreparedHtmlBundle
-prepareHtmlExport file =
- prepareHtmlExportResult file
- >>= either throwIO pure
-
-prepareHtmlExportResult
- :: MonadUnliftIO io
- => FilePath
- -> io (Either HtmlExport.HtmlExportError PreparedHtmlBundle)
-prepareHtmlExportResult file =
- fmap HtmlExport.preparedHtmlOutputBundle
- <$> prepareDefaultHtmlExportResult file
-
-prepareDefaultHtmlExport
- :: MonadUnliftIO io
- => FilePath
- -> io HtmlExport.PreparedHtmlExport
-prepareDefaultHtmlExport file = do
- result <- prepareDefaultHtmlExportResult file
- either throwIO pure result
-
-prepareDefaultHtmlExportResult
- :: MonadUnliftIO io
- => FilePath
- -> io (Either HtmlExport.HtmlExportError HtmlExport.PreparedHtmlExport)
-prepareDefaultHtmlExportResult file = do
- hintsResult <- liftIO (findAndReadRendererFile "lexicon.tsv")
- case hintsResult of
- Left failure ->
- pure (Left failure)
- Right hints -> do
- prepared <- liftIO (prepareDefaultSourceRequest file)
- case prepared of
- Left parseFailure ->
- pure
- (Left
- (HtmlExport.HtmlExportParseError parseFailure))
- Right (mounts, request) ->
- liftIO
- (HtmlExport.prepareHtmlExport
- defaultHtmlMountPrefixes
- mounts
- request
- hints)
+prepareVerifiedHtmlExportResult
+ :: MonadIO io
+ => VerificationPresentation
+ -> io (Either HtmlExport.HtmlExportError [PreparedHtmlArtifact])
+prepareVerifiedHtmlExportResult
+ (VerificationPresentation workspace) = liftIO do
+ hintsResult <- findAndReadRendererFile "lexicon.tsv"
+ pure do
+ hints <- hintsResult
+ HtmlExport.prepareHtmlExport
+ defaultHtmlMountPrefixes
+ workspace
+ hints
defaultHtmlMountPrefixes :: [(SourceMountId, [Text])]
defaultHtmlMountPrefixes =
diff --git a/source/Checking.hs b/source/Checking.hs
deleted file mode 100644
index ed5731a..0000000
--- a/source/Checking.hs
+++ /dev/null
@@ -1,4265 +0,0 @@
-{-# LANGUAGE MultiWayIf #-}
-{-# LANGUAGE NamedFieldPuns #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE RankNTypes #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# OPTIONS_GHC -Wno-name-shadowing #-}
-
-
-module Checking where
-
-
-import Base hiding (locally)
-import Checking.Core qualified as Core
-import Checking.Dependencies qualified as Dependencies
-import Checking.Datatype qualified as Datatype
-import Checking.Exact.Vocabulary qualified as ExactVocabulary
-import Checking.Facts qualified as Facts
-import Checking.Kernel.Derivation
- ( importIx
- , importedFactDerivation
- )
-import Checking.Legacy
-import Checking.Obligation
-import Checking.Structure qualified as Structure
-import Checking.Transition qualified as Transition
-import Checking.Typed.Atomic qualified as TypedAtomic
-import Checking.Typed.Inductive qualified as TypedInductive
-import Checking.Typed.Reflexivity qualified as TypedReflexivity
-import StructGraph
-import Syntax.Internal
-import Syntax.Lexicon
-import Encoding
-import Report.Location
-
-import Bound.Scope
-import Bound.Var (Var(..), unvar)
-import Control.Exception (Exception)
-import Control.Monad.Reader
-import Control.Monad.State
-import Data.Bifunctor (first)
-import Data.HashMap.Strict qualified as HM
-import Data.HashSet qualified as HS
-import Data.IORef (newIORef, modifyIORef', readIORef)
-import Data.List qualified as List
-import Data.List.NonEmpty qualified as NonEmpty
-import Data.Map.Strict qualified as Map
-import Data.Set qualified as Set
-import Data.Text qualified as Text
-import Data.Text.IO qualified as Text
-import Data.Vector (Vector)
-import Data.Vector qualified as Vector
-import System.FilePath.Posix
-import UnliftIO.Directory
-
-type Checking = CheckingM ()
-type CheckingM = StateT CheckingState IO
-
--- | Like 'Base.locally', but preserves declaration-local counters across
--- nested proof blocks.
-locally :: CheckingM a -> CheckingM a
-locally ma = do
- st <- get
- a <- ma
- st' <- get
- put
- st
- { checkingHypothesisCounter =
- checkingHypothesisCounter st'
- , checkingNextObligationOrdinal =
- checkingNextObligationOrdinal st'
- , checkingResolvedObligationBatches =
- checkingResolvedObligationBatches st'
- }
- pure a
-
-check :: WithDumpPremselTraining -> [Block] -> IO [Task]
-check dumpPremselTraining blocks =
- fmap preparedObligationTask
- <$> checkPrepared
- dumpPremselTraining
- id
- blocks
-
-checkPrepared
- :: WithDumpPremselTraining
- -> (Task -> Task)
- -> [Block]
- -> IO [PreparedObligation]
-checkPrepared dumpPremselTraining prepareTask blocks = do
- obligationsRef <- newIORef []
- void
- (runStateT
- (checkBlocks blocks)
- (initialCheckingStateWithTaskPreparation
- dumpPremselTraining
- prepareTask
- (\batch ->
- for_
- (preparedBatchObligations batch)
- (\obligation ->
- when
- (preparedObligationMethod obligation
- == ProveWithVampire)
- (modifyIORef'
- obligationsRef
- (obligation :))))))
- reverse <$> readIORef obligationsRef
-
-checkWith
- :: WithDumpPremselTraining
- -> [Block]
- -> (PreparedObligationBatch -> IO ())
- -> IO ()
-checkWith dumpPremselTraining blocks emitBatch =
- void
- (runStateT
- (checkBlocks blocks)
- (initialCheckingState
- dumpPremselTraining
- emitBatch))
-
-initialCheckingState
- :: WithDumpPremselTraining
- -> (PreparedObligationBatch -> IO ())
- -> CheckingState
-initialCheckingState dumpPremselTraining =
- initialCheckingStateWithTaskPreparation
- dumpPremselTraining
- id
-
-initialCheckingStateWithTaskPreparation
- :: WithDumpPremselTraining
- -> (Task -> Task)
- -> (PreparedObligationBatch -> IO ())
- -> CheckingState
-initialCheckingStateWithTaskPreparation
- dumpPremselTraining
- prepareTask
- emitBatch =
- initialCheckingStateWithBatchHandler
- dumpPremselTraining
- prepareTask
- (ObserveObligationBatches emitBatch)
- Nothing
- Nothing
-
-initialLegacyCheckingStateWithTaskPreparation
- :: WithDumpPremselTraining
- -> (Task -> Task)
- -> LegacyModuleStage
- -> (PreparedObligationBatch -> IO ResolvedObligationBatch)
- -> CheckingState
-initialLegacyCheckingStateWithTaskPreparation
- dumpPremselTraining
- prepareTask
- stage
- resolveBatch =
- checkingStateWithEnvironment
- (legacyStageImportedCheckingEnvironment stage)
- ( (initialCheckingStateWithBatchHandler
- dumpPremselTraining
- prepareTask
- (ResolveObligationBatches resolveBatch)
- (Just stage)
- Nothing)
- { checkingFacts = legacyStageFactRegistry stage
- }
- )
-
-initialTransitionCheckingStateWithTaskPreparation
- :: WithDumpPremselTraining
- -> (Task -> Task)
- -> Transition.TransitionModuleBuilder
- -> (PreparedObligationBatch -> IO ResolvedObligationBatch)
- -> CheckingState
-initialTransitionCheckingStateWithTaskPreparation
- dumpPremselTraining
- prepareTask
- builder
- resolveBatch =
- checkingStateWithEnvironment
- (Transition.transitionBuilderImportedCheckingEnvironment
- builder)
- ( (initialCheckingStateWithBatchHandler
- dumpPremselTraining
- prepareTask
- (ResolveObligationBatches resolveBatch)
- (Just
- (Transition.transitionBuilderLegacyStage
- builder))
- (Just builder))
- { checkingFacts =
- legacyStageFactRegistry
- (Transition.transitionBuilderLegacyStage
- builder)
- }
- )
-
--- | Production V1 checking uses the complete contracted task and has no
--- premise-selection or training mode.
-initialTransitionCheckingState
- :: Transition.TransitionModuleBuilder
- -> (PreparedObligationBatch -> IO ResolvedObligationBatch)
- -> CheckingState
-initialTransitionCheckingState =
- initialTransitionCheckingStateWithTaskPreparation
- WithoutDumpPremselTraining
- contractionTask
-
-initialCheckingStateWithBatchHandler
- :: WithDumpPremselTraining
- -> (Task -> Task)
- -> ObligationBatchHandler
- -> Maybe LegacyModuleStage
- -> Maybe Transition.TransitionModuleBuilder
- -> CheckingState
-initialCheckingStateWithBatchHandler
- dumpPremselTraining
- prepareTask
- batchHandler
- legacyStage
- transitionBuilder =
- CheckingState
- { checkingAssumptions = []
- , checkingDumpPremselTraining = dumpPremselTraining
- , checkingGoals = []
- , checkingFacts = Facts.emptyFactRegistry
- , checkingDirectness = Direct
- , checkingAbbreviations = initAbbreviations
- , checkingPredicateDefinitions = mempty
- , checkingDependencies =
- Dependencies.fromRootSymbols (Set.fromList builtinSymbols)
- , checkingOwnedSymbols = builtinOwnedSymbols
- , checkingOwnedSymbolMarkers = builtinOwnedSymbolMarkers
- , checkingFrozenSymbols = mempty
- , checkingStructs = initCheckingStructs
- , checkingStructContext = mempty
- , definedMarkers = HS.empty
- , blockLabel = Marker ""
- , stepLocation = Nowhere
- , blockEndLocation = Nowhere
- , localVars = mempty
- , checkingHypothesisCounter = 0
- , checkingNextObligationOrdinal =
- legacyObligationOrdinal 0
- , checkingPrepareTask = prepareTask
- , checkingObligationBatchHandler = batchHandler
- , checkingResolvedObligationBatches = []
- , checkingDeclarationFactProducers = []
- , checkingLegacyModuleStage = legacyStage
- , checkingTransitionModuleBuilder =
- transitionBuilder
- }
-
-runCheckingBlocks :: [Block] -> CheckingState -> IO CheckingState
-runCheckingBlocks blocks checkingState =
- snd <$> runStateT (checkBlocks blocks) checkingState
-
-checkingStateEnvironment
- :: CheckingState
- -> LegacyCheckingEnvironment
-checkingStateEnvironment state =
- legacyCheckingEnvironment
- (checkingAbbreviations state)
- (checkingPredicateDefinitions state)
- (checkingDependencies state)
- (checkingOwnedSymbols state)
- (checkingOwnedSymbolMarkers state)
- (checkingFrozenSymbols state)
- (checkingStructs state)
- (definedMarkers state)
-
-checkingStateWithEnvironment
- :: LegacyCheckingEnvironment
- -> CheckingState
- -> CheckingState
-checkingStateWithEnvironment environment state =
- state
- { checkingAbbreviations =
- legacyEnvironmentAbbreviations environment
- , checkingPredicateDefinitions =
- legacyEnvironmentPredicateDefinitions environment
- , checkingDependencies =
- legacyEnvironmentDependencies environment
- , checkingOwnedSymbols =
- legacyEnvironmentOwnedSymbols environment
- , checkingOwnedSymbolMarkers =
- legacyEnvironmentOwnedSymbolMarkers environment
- , checkingFrozenSymbols =
- legacyEnvironmentFrozenSymbols environment
- , checkingStructs =
- legacyEnvironmentStructs environment
- , definedMarkers =
- legacyEnvironmentDefinedMarkers environment
- }
-
-data WithDumpPremselTraining = WithoutDumpPremselTraining | WithDumpPremselTraining
-
-data ObligationBatchHandler
- = ObserveObligationBatches
- (PreparedObligationBatch -> IO ())
- | ResolveObligationBatches
- (PreparedObligationBatch -> IO ResolvedObligationBatch)
-
--- | The checking state manages contextual information while checking and
--- emits generated proof tasks through a callback.
--- INVARIANT: All formulas in the checking state that eventually
--- get exported should have all their abbreviations resolved.
-data CheckingState = CheckingState
- { checkingDumpPremselTraining :: WithDumpPremselTraining
-
- , checkingAssumptions :: [CurrentHypothesis]
- -- ^ Local assumptions.
- --
- , checkingGoals :: [Formula]
- -- ^ The current goals. INVARIANT: these should always be canonicalized and have all abbreviations resolved.
- --
- , checkingFacts :: Facts.FactRegistry
- -- ^ Canonical axioms and proven results with separate registration metadata.
- --
- --
- , checkingDirectness :: Directness
- -- ^ E can detect contradictory axioms and warns about them.
- -- In an indirect proof (e.g. a proof by contradiction) we want
- -- to ignore that warning.
- --
- , checkingAbbreviations :: HashMap Symbol (Scope Int ExprOf Void)
- -- ^ Abbreviations are definitions that automatically get expanded.
- -- They are given by a closed rhs (hence the 'Void' indicating no free variables).
- -- INVARIANT: The bound 'Int' values must be lower than the arity of the symbol.
- --
- , checkingPredicateDefinitions :: HashMap Predicate [Scope Int ExprOf Void]
- -- ^ Definitions of predicate that we can match against in assumptions.
- -- Axioms and theorems that have the shape of a definition can be added as alternate definitions.
- --
- , checkingDependencies :: Dependencies.DependencyRegistry
- -- ^ Backward-only dependencies of every owned symbol.
- --
- , checkingOwnedSymbols :: HashMap Symbol SymbolOwner
- -- ^ Top-level symbols with an established introducing owner in this document.
- --
- , checkingOwnedSymbolMarkers :: HashSet Marker
- -- ^ Object-language markers claimed by top-level symbols.
- -- INVARIANT: contains the marker of every key in 'checkingOwnedSymbols'.
- --
- , checkingFrozenSymbols :: HashMap Symbol Marker
- -- ^ Symbols mentioned in an inductive specification may not be defined later.
- --
- , checkingStructs :: StructGraph
- -- ^ Graph of structs defined so far.
- --
- , checkingStructContext :: StructContext
- -- ^ Structure labels and operations in scope for carrier and operation annotation.
- --
- , localVars :: Set VarSymbol
- -- ^ Keeps track of the variables that are locally constant.
- --
- , definedMarkers :: HashSet Marker
- -- ^ Markers for toplevel sections need to be unique. This keeps track of the
- -- markers used thus far.
- --
- , blockLabel :: Marker -- ^ Label/marker of the current block
- , stepLocation :: Location -- ^ Location of the current proof step
- , blockEndLocation :: Location -- ^ Ending of the current proof block, useful for error messages for implicit QEDs.
- , checkingHypothesisCounter :: Int -- ^ Counter for labeling local hypotheses within a proof.
- , checkingNextObligationOrdinal :: LegacyObligationOrdinal
- , checkingPrepareTask :: Task -> Task
- , checkingObligationBatchHandler :: ObligationBatchHandler
- , checkingResolvedObligationBatches
- :: [ResolvedObligationBatch]
- , checkingDeclarationFactProducers
- :: [LegacyFactProducer]
- , checkingLegacyModuleStage
- :: Maybe LegacyModuleStage
- , checkingTransitionModuleBuilder
- :: Maybe Transition.TransitionModuleBuilder
- }
-
-data CurrentHypothesis = CurrentHypothesis
- !Hypothesis
- !Location
- !Marker
-
-data StructContext = StructContext
- { structContextLabels :: Set VarSymbol
- , structContextOps :: HashMap StructSymbol VarSymbol
- }
-
-data BlockContext = BlockContext
- { blockContextLocation :: !Location
- , blockContextMarker :: !Marker
- }
- deriving (Show, Eq)
-
-instance Semigroup StructContext where
- StructContext labels ops <> StructContext labels' ops' =
- StructContext (labels <> labels') (ops <> ops')
-
-instance Monoid StructContext where
- mempty = StructContext mempty mempty
-
-initCheckingStructs :: StructGraph
-initCheckingStructs = StructGraph.insert
- _Onesorted
- mempty -- no parents
- (Set.singleton CarrierSymbol) -- used for casting X -> \carrier[X]
- (Set.singleton CarrierSymbol)
- mempty -- empty graph
-
-initAbbreviations :: HashMap Symbol (Scope Int ExprOf Void)
-initAbbreviations = HM.fromList
- [ (SymbolPredicate (PredicateRelation NotElementSymbol), toScope (isNotElementOf Nowhere (TermVar (B 0)) (TermVar (B 1))))
- , (SymbolPredicate (PredicateVerb (mkLexicalItemSgPl (unsafeReadPhraseSgPl "equal[s/] ?") "eq")), toScope (Equals Nowhere (TermVar (B 0))( TermVar (B 1))))
- , (SymbolPredicate (PredicateNoun (mkLexicalItemSgPl (unsafeReadPhraseSgPl "element[/s] of ?") "elem")), toScope (isElementOf (TermVar (B 0)) (TermVar (B 1))))
- ]
-
-builtinOwnerMarker :: Marker
-builtinOwnerMarker = Marker "<builtin>"
-
-builtinOwner :: SymbolOwner
-builtinOwner =
- SymbolOwner
- { symbolOwnerKind = OwnedByBuiltin
- , symbolOwnerMarker = builtinOwnerMarker
- }
-
-builtinOwnedSymbols :: HashMap Symbol SymbolOwner
-builtinOwnedSymbols =
- HM.fromList
- [ (symbol, builtinOwner)
- | symbol <- builtinSymbols
- ]
-
-builtinOwnedSymbolMarkers :: HashSet Marker
-builtinOwnedSymbolMarkers =
- HS.fromList
- [ marker
- | symbol <- builtinSymbols
- , Just marker <- [objectSymbolMarker symbol]
- ]
-
-initialLegacyCheckingEnvironment
- :: LegacyCheckingEnvironment
-initialLegacyCheckingEnvironment =
- legacyCheckingEnvironment
- initAbbreviations
- mempty
- (Dependencies.fromRootSymbols
- (Set.fromList builtinSymbols))
- builtinOwnedSymbols
- builtinOwnedSymbolMarkers
- mempty
- initCheckingStructs
- mempty
-
-builtinReservedMixfixMarkers :: Set Marker
-builtinReservedMixfixMarkers =
- Set.fromList
- [ "cons"
- , "cumul"
- , "emptyset"
- , "naturals"
- , "pair"
- , "pow"
- , "union"
- ]
-
-builtinSymbols :: [Symbol]
-builtinSymbols =
- List.nub
- ( [ SymbolMixfix mixfix
- | level <- toList (lexiconMixfixTable builtins)
- , mixfix <- Map.elems level
- , mixfixMarker mixfix `Set.member` builtinReservedMixfixMarkers
- ]
- <> [ SymbolPredicate (PredicateRelation relation)
- | relation <- lexiconRelationSymbols builtins
- ]
- <> [ SymbolPredicate (PredicateAdj adj)
- | adj <- lexiconAdjLs builtins <> lexiconAdjRs builtins
- ]
- <> [ SymbolPredicate (PredicateVerb verb)
- | verb <- lexiconVerbs builtins
- ]
- <> [ SymbolPredicate (PredicateNoun noun)
- | noun <- lexiconNouns builtins
- ]
- <> [ SymbolPredicate (PredicateNounStruct noun)
- | noun <- lexiconStructNouns builtins
- ]
- <> [ SymbolPredicate (PredicateSymbol name)
- | (PrefixPredicate name _arity, _marker) <- lexiconPrefixPredicates builtins
- ]
- <> [ SymbolFun fun
- | fun <- lexiconFuns builtins
- ]
- )
-
-data CheckingError
- = DuplicateMarker Location Marker
- | UnknownStructureParent StructPhrase Location Marker
- | ByContradictionOnMultipleGoals Location Marker
- | BySetInductionSyntacticMismatch Location Marker
- | ByOrdInductionSyntacticMismatch Location Marker
- | SetExtensionalityWithTake Location Marker
- | ProofWithoutPrecedingTheorem Location Marker
- | CouldNotEliminateHigherOrder FunctionSymbol Term Location Marker
- | UnresolvedStructureOperation StructSymbol Location Marker
- | AmbiguousInductionVar Location Marker
- | MismatchedSetExt [Formula] Location Marker
- | MismatchedAssume Formula Formula Location Marker
- | CheckingError Text Location Marker
- deriving (Show, Eq)
-
-instance Exception CheckingError
-
-checkingErrorContext :: CheckingError -> (Location, Marker)
-checkingErrorContext = \case
- DuplicateMarker location marker -> (location, marker)
- UnknownStructureParent _parent location marker -> (location, marker)
- ByContradictionOnMultipleGoals location marker -> (location, marker)
- BySetInductionSyntacticMismatch location marker -> (location, marker)
- ByOrdInductionSyntacticMismatch location marker -> (location, marker)
- SetExtensionalityWithTake location marker -> (location, marker)
- ProofWithoutPrecedingTheorem location marker -> (location, marker)
- CouldNotEliminateHigherOrder _symbol _term location marker ->
- (location, marker)
- UnresolvedStructureOperation _symbol location marker -> (location, marker)
- AmbiguousInductionVar location marker -> (location, marker)
- MismatchedSetExt _formulas location marker -> (location, marker)
- MismatchedAssume _assumption _goal location marker -> (location, marker)
- CheckingError _message location marker -> (location, marker)
-
-renderCheckingError :: CheckingError -> Text
-renderCheckingError failure =
- locationToText location
- <> " in " <> markerTextOf marker <> ": " <> reason failure
- where
- (location, marker) = checkingErrorContext failure
-
- reason = \case
- DuplicateMarker{} ->
- "marker is already registered"
- UnknownStructureParent parent _location _marker ->
- "unknown parent structure " <> Text.pack (show parent)
- ByContradictionOnMultipleGoals{} ->
- "proof by contradiction requires exactly one open goal"
- BySetInductionSyntacticMismatch{} ->
- "the goal does not have the required set-induction shape"
- ByOrdInductionSyntacticMismatch{} ->
- "the goal does not have the required ordinal-induction shape"
- SetExtensionalityWithTake{} ->
- "set extensionality cannot be used after a Take step"
- ProofWithoutPrecedingTheorem{} ->
- "proof has no preceding theorem"
- CouldNotEliminateHigherOrder symbol _term _location _marker ->
- "could not eliminate higher-order symbol "
- <> Text.pack (show symbol)
- UnresolvedStructureOperation symbol _location _marker ->
- "unresolved structure operation " <> Text.pack (show symbol)
- AmbiguousInductionVar{} ->
- "the induction variable is ambiguous"
- MismatchedSetExt{} ->
- "set extensionality does not match the open goal"
- MismatchedAssume{} ->
- "assumption does not match the open goal"
- CheckingError message _location _marker ->
- message
-
-data LegacyDeclarationAdmissionError
- = LegacyFactRegistryIsNotAnExtension !Text
- | LegacyFactProducerCountMismatch !Int !Int
- | LegacyFactPremiseHasNoAuthorization
- !LegacyObligationOrdinal
- !Marker
- | LegacyPreparedPremiseSelectionMismatch
- !LegacyObligationOrdinal
- | LegacyStageAdmissionFailed !LegacyModuleStageError
- | TransitionStageAdmissionFailed
- !Transition.TransitionModuleError
- deriving (Show, Eq)
-
-instance Exception LegacyDeclarationAdmissionError
-
-throwWithLocationAndMarker :: (Location -> Marker -> CheckingError) -> CheckingM a
-throwWithLocationAndMarker err = do
- m <- gets blockLabel
- loc <- gets stepLocation
- throwIO (err loc m)
-
-throwWithMarker :: (Marker -> CheckingError) -> CheckingM a
-throwWithMarker err = do
- m <- gets blockLabel
- throwIO (err m)
-
-assume :: [Asm] -> Checking
-assume asms = traverse_ go asms
- where
- go :: Asm -> Checking
- go = \case
- Asm phi -> do
- ctx <- structContextFromAssertion phi
- addStructContextAndRefreshGoals ctx
- assumeFormula phi
- AsmStruct x sp ->
- instantiateStruct x sp
-
-assumeFormula :: Formula -> Checking
-assumeFormula phi = do
- phi' <- canonicalize phi
- let phiContracted = contraction phi'
- case phiContracted of
- Top -> skip
- _ -> do
- marker <- nextHypothesisMarker
- let hypo = Hypothesis marker phi'
- location <- gets stepLocation
- declarationMarker <- gets blockLabel
- modify \st ->
- st
- { checkingAssumptions =
- CurrentHypothesis
- hypo
- location
- declarationMarker
- : checkingAssumptions st
- }
-
-instantiateStruct :: VarSymbol -> StructPhrase -> Checking
-instantiateStruct x sp = do
- ctx <- structContextFor x sp
- addStructContextAndRefreshGoals ctx
- assumeFormula (structPredicate x sp)
-
-structPredicate :: VarSymbol -> StructPhrase -> Formula
-structPredicate x sp =
- TermSymbol Nowhere (SymbolPredicate (PredicateNounStruct sp)) [TermVar x]
-
-structContextFromAssertion :: Formula -> CheckingM StructContext
-structContextFromAssertion = \case
- TermSymbol _ (SymbolPredicate (PredicateNounStruct sp)) [TermVar x] ->
- structContextFor x sp
- _ ->
- pure mempty
-
-structContextFor :: VarSymbol -> StructPhrase -> CheckingM StructContext
-structContextFor x sp = do
- structGraph <- gets checkingStructs
- case StructGraph.lookupSymbols sp structGraph of
- Nothing ->
- throwWithLocationAndMarker (UnknownStructureParent sp)
- Just symbols ->
- pure (structContextFromSymbols x symbols)
-
-structContextFromSymbols :: VarSymbol -> Set StructSymbol -> StructContext
-structContextFromSymbols x symbols =
- StructContext (Set.singleton x) (HM.fromList [(op, x) | op <- Set.toList symbols])
-
-addStructContext :: StructContext -> Checking
-addStructContext ctx =
- modify \st -> st
- { checkingStructContext = ctx <> checkingStructContext st
- }
-
-addStructContextAndRefreshGoals :: StructContext -> Checking
-addStructContextAndRefreshGoals ctx
- | structContextIsEmpty ctx = skip
- | otherwise = do
- addStructContext ctx
- goals <- gets checkingGoals
- setGoals goals
-
-structContextIsEmpty :: StructContext -> Bool
-structContextIsEmpty StructContext{..} =
- Set.null structContextLabels && HM.null structContextOps
-
-registerAssumptionStructContexts :: [Asm] -> Checking
-registerAssumptionStructContexts asms = do
- ctx <- assumptionStructContext asms
- addStructContext ctx
-
-assumptionStructContext :: [Asm] -> CheckingM StructContext
-assumptionStructContext asms = do
- contexts <- traverse asmStructContext asms
- pure (foldl' (\older newer -> newer <> older) mempty contexts)
-
-asmStructContext :: Asm -> CheckingM StructContext
-asmStructContext = \case
- Asm phi ->
- structContextFromAssertion phi
- AsmStruct x sp ->
- structContextFor x sp
-
-
-setLocation :: Location -> Checking
-setLocation loc = modify \st -> st{stepLocation = loc}
-
-
--- | Replace all current goals with a new goal. Use with care!
-setGoals :: [Formula] -> Checking
-setGoals goals = do
- goals <- traverse canonicalize goals
- modify $ \st -> st{checkingGoals = goals}
-
-nextHypothesisMarker :: CheckingM Marker
-nextHypothesisMarker = do
- st <- get
- let next = checkingHypothesisCounter st + 1
- let marker = Marker ("_local_" <> Text.pack (show next))
- put st{checkingHypothesisCounter = next}
- pure marker
-
-registerLemmaLocalVars :: [Asm] -> Formula -> Checking
-registerLemmaLocalVars asms goal =
- addLocalVars (Set.unions (freeVars goal : (asmLocalVars <$> asms)))
-
-asmLocalVars :: Asm -> Set VarSymbol
-asmLocalVars = \case
- Asm phi ->
- freeVars phi
- AsmStruct x _ ->
- Set.singleton x
-
-addLocalVars :: Set VarSymbol -> Checking
-addLocalVars vars =
- modify \st -> st{localVars = vars <> localVars st}
-
-checkFreshLocalVars :: Text -> [VarSymbol] -> Checking
-checkFreshLocalVars context vars = do
- let duplicates = duplicateVars vars
- unless (Set.null duplicates) do
- throwCheckingError (context <> " introduces the same variable more than once: " <> formatVars duplicates)
- inScope <- gets localVars
- let shadowed = Set.fromList vars `Set.intersection` inScope
- unless (Set.null shadowed) do
- throwCheckingError (context <> " tries to introduce variable(s) already in scope: " <> formatVars shadowed)
-
-checkBinderVarsFresh :: Text -> [VarSymbol] -> Checking
-checkBinderVarsFresh context vars = do
- let duplicates = duplicateVars vars
- unless (Set.null duplicates) do
- throwCheckingError (context <> " uses the same binder variable more than once: " <> formatVars duplicates)
- inScope <- gets localVars
- let shadowed = Set.fromList vars `Set.intersection` inScope
- unless (Set.null shadowed) do
- throwCheckingError (context <> " binder variable(s) shadow local variable(s): " <> formatVars shadowed)
-
-assertKnownFormulaVars :: Text -> Formula -> Checking
-assertKnownFormulaVars context phi = do
- known <- gets localVars
- assertKnownFormulaVarsWith context known phi
-
-assertKnownFormulaVarsWith :: Text -> Set VarSymbol -> Formula -> Checking
-assertKnownFormulaVarsWith context known phi = do
- let unknown = freeVars phi `Set.difference` known
- unless (Set.null unknown) do
- throwCheckingError (context <> " mentions variable(s) that are not in scope: " <> formatVars unknown)
-
-assertKnownTermVars :: Text -> Term -> Checking
-assertKnownTermVars = assertKnownFormulaVars
-
-assertKnownTermVarsWith :: Text -> Set VarSymbol -> Term -> Checking
-assertKnownTermVarsWith = assertKnownFormulaVarsWith
-
-throwCheckingError :: Text -> CheckingM a
-throwCheckingError msg =
- throwWithLocationAndMarker (CheckingError msg)
-
-duplicateVars :: [VarSymbol] -> Set VarSymbol
-duplicateVars =
- snd . foldl' step (Set.empty, Set.empty)
- where
- step (seen, duplicates) x
- | x `Set.member` seen = (seen, Set.insert x duplicates)
- | otherwise = (Set.insert x seen, duplicates)
-
-formatVars :: Set VarSymbol -> Text
-formatVars vars =
- Text.intercalate ", " (formatVar <$> Set.toList vars)
-
-formatVar :: VarSymbol -> Text
-formatVar = \case
- NamedVar x -> x
- FreshVar n -> "_" <> Text.pack (show n)
-
-formatSymbols :: Set Symbol -> Text
-formatSymbols symbols =
- Text.intercalate ", " (symbolText <$> Set.toList symbols)
-
-ownableSymbol :: Symbol -> Bool
-ownableSymbol =
- isJust . objectSymbolMarker
-
-markerTextOf :: Marker -> Text
-markerTextOf (Marker text) = text
-
-symbolText :: Symbol -> Text
-symbolText = \case
- SymbolMixfix symbol ->
- markerTextOf (mixfixMarker symbol)
- SymbolFun symbol ->
- markerTextOf (lexicalItemSgPlMarker symbol)
- SymbolInteger n ->
- Text.pack (show n)
- SymbolPredicate predicate ->
- predicateText predicate
-
-predicateText :: Predicate -> Text
-predicateText =
- markerTextOf . predicateObjectMarker
-
-symbolOwnerKindText :: SymbolOwnerKind -> Text
-symbolOwnerKindText = \case
- OwnedByBuiltin ->
- "builtin"
- OwnedBySignaturePredicate ->
- "signature predicate"
- OwnedBySignatureFormula ->
- "signature formula"
- OwnedByAbbreviation ->
- "abbreviation"
- OwnedByPredicateDefinition ->
- "predicate definition"
- OwnedByFunctionDefinition ->
- "function definition"
- OwnedByOperatorDefinition ->
- "operator definition"
- OwnedByDatatypeHead ->
- "datatype"
- OwnedByDatatypeConstructor ->
- "datatype constructor"
- OwnedByInductiveDefinition ->
- "inductive definition"
- OwnedByStructureDefinition ->
- "structure definition"
-
-symbolOwnerText :: SymbolOwner -> Text
-symbolOwnerText SymbolOwner{symbolOwnerKind, symbolOwnerMarker} =
- symbolOwnerKindText symbolOwnerKind
- <> " "
- <> markerTextOf symbolOwnerMarker
-
--- Multiple matches can only be builtin aliases, which all have 'builtinOwner'.
-symbolOwnerByMarker :: Marker -> HashMap Symbol SymbolOwner -> Maybe SymbolOwner
-symbolOwnerByMarker marker owners =
- snd <$> List.find ((== Just marker) . objectSymbolMarker . fst) (HM.toList owners)
-
-validatedOwnership
- :: Marker
- -> SymbolOwnerKind
- -> Symbol
- -> CheckingState
- -> Either Text (HashMap Symbol SymbolOwner, HashSet Marker)
-validatedOwnership currentMarker ownerKind symbol st = do
- marker <-
- maybe
- (Left ("symbol has no object marker: " <> symbolText symbol))
- Right
- (objectSymbolMarker symbol)
- let owners = checkingOwnedSymbols st
- for_ (HM.lookup symbol owners) \owner ->
- Left
- ( "symbol "
- <> symbolText symbol
- <> " is already owned by "
- <> symbolOwnerText owner
- )
- let ownedMarkers = checkingOwnedSymbolMarkers st
- when (marker `HS.member` ownedMarkers) do
- Left
- ( "object-symbol marker "
- <> markerTextOf marker
- <> " is already owned"
- <> maybe
- ""
- ((" by " <>) . symbolOwnerText)
- (symbolOwnerByMarker marker owners)
- )
- case HM.lookup symbol (checkingFrozenSymbols st) of
- Just frozenBy | frozenBy /= currentMarker ->
- Left
- ( "symbol "
- <> symbolText symbol
- <> " is frozen by inductive block "
- <> markerTextOf frozenBy
- <> " and cannot be defined here"
- )
- _ ->
- Right
- ( HM.insert
- symbol
- (SymbolOwner ownerKind currentMarker)
- owners
- , HS.insert marker ownedMarkers
- )
-
-dependencyRegistrationErrorText
- :: Symbol
- -> Dependencies.DependencyRegistrationError
- -> Text
-dependencyRegistrationErrorText owner = \case
- Dependencies.DependencyOwnerAlreadyRegistered _ ->
- "dependencies are already registered for symbol " <> symbolText owner
- Dependencies.SelfDependency _ ->
- "definition of symbol " <> symbolText owner <> " is self-referential"
- Dependencies.UnknownDependency unknown ->
- "definition of symbol "
- <> symbolText owner
- <> " depends on unknown symbol "
- <> symbolText unknown
-
-validatedSymbolRegistration
- :: BlockContext
- -> SymbolOwnerKind
- -> Symbol
- -> Set Symbol
- -> CheckingState
- -> Either
- CheckingError
- ( HashMap Symbol SymbolOwner
- , HashSet Marker
- , Dependencies.DependencyRegistry
- )
-validatedSymbolRegistration context ownerKind symbol dependencies st =
- case objectSymbolMarker symbol of
- Nothing ->
- Right
- ( checkingOwnedSymbols st
- , checkingOwnedSymbolMarkers st
- , checkingDependencies st
- )
- Just _marker -> do
- (owners', ownedMarkers') <-
- first
- (checkingErrorAt context)
- (validatedOwnership
- (blockContextMarker context)
- ownerKind
- symbol
- st)
- dependencies' <-
- first
- ( checkingErrorAt context
- . dependencyRegistrationErrorText symbol
- )
- (Dependencies.registerDependencies
- symbol
- (Set.filter ownableSymbol dependencies)
- (checkingDependencies st))
- pure (owners', ownedMarkers', dependencies')
-
-validateOwnedDependenciesAt
- :: BlockContext
- -> HashMap Symbol SymbolOwner
- -> Set Symbol
- -> Either CheckingError ()
-validateOwnedDependenciesAt context owners dependencies =
- unless (Set.null unknown) do
- Left
- (checkingErrorAt
- context
- ( "top-level fact mentions symbol(s) without prior ownership: "
- <> formatSymbols unknown
- ))
- where
- unknown =
- Set.filter
- (\symbol ->
- ownableSymbol symbol
- && not (HM.member symbol owners))
- dependencies
-
-validatePreparedSemanticFact
- :: BlockContext
- -> HashMap Symbol SymbolOwner
- -> Dependencies.DependencyRegistry
- -> Facts.PreparedSemanticFact
- -> Either CheckingError ()
-validatePreparedSemanticFact context owners dependencies prepared = do
- validateOwnedDependenciesAt context owners semanticDependencies
- unless (Set.null unknownDependencies) do
- Left
- (checkingErrorAt
- context
- ( "top-level fact depends on unknown symbol(s): "
- <> formatSymbols unknownDependencies
- ))
- where
- semanticDependencies =
- Facts.preparedSemanticDependencies prepared
- unknownDependencies =
- Set.filter
- (\symbol ->
- ownableSymbol symbol
- && isNothing
- (Dependencies.lookupDependencies
- symbol
- dependencies))
- semanticDependencies
-
-checkedInductiveMentionedSymbols :: CheckedInductive -> Set Symbol
-checkedInductiveMentionedSymbols CheckedInductive{checkedInductiveSymbol, checkedInductiveDomain, checkedInductiveIntros} =
- Set.insert
- (SymbolMixfix checkedInductiveSymbol)
- ( mentionedSymbols checkedInductiveDomain
- <> Set.unions (checkedInductiveIntroMentionedSymbols <$> NonEmpty.toList checkedInductiveIntros)
- )
-
-checkedInductiveIntroMentionedSymbols :: CheckedInductiveIntro -> Set Symbol
-checkedInductiveIntroMentionedSymbols CheckedInductiveIntro{checkedInductiveIntroConditions, checkedInductiveIntroResultTerm} =
- mentionedSymbols checkedInductiveIntroResultTerm
- <> Set.unions (checkedInductiveConditionMentionedSymbols <$> checkedInductiveIntroConditions)
-
-checkedInductiveConditionMentionedSymbols :: CheckedInductiveCondition -> Set Symbol
-checkedInductiveConditionMentionedSymbols = \case
- CheckedInductiveSideCondition phi ->
- mentionedSymbols phi
- CheckedInductiveRecursiveCondition{checkedInductiveRecursiveTerm, checkedInductiveRecursiveCarrierTemplate} ->
- mentionedSymbols checkedInductiveRecursiveTerm
- <> mentionedSymbols (fromScope checkedInductiveRecursiveCarrierTemplate)
-
-formatSymbolPath :: NonEmpty Symbol -> Text
-formatSymbolPath =
- Text.intercalate " -> " . fmap symbolText . toList
-
-definitionParts :: Defn -> (SymbolOwnerKind, Symbol, [Asm], Expr)
-definitionParts = \case
- DefnPredicate asms predicate _vs body ->
- (OwnedByPredicateDefinition, SymbolPredicate predicate, asms, body)
- DefnFun asms fun _vs rhs ->
- (OwnedByFunctionDefinition, SymbolFun fun, asms, rhs)
- DefnOp op _vs rhs ->
- (OwnedByOperatorDefinition, SymbolMixfix op, [], rhs)
-
-checkedDefinitionDependencies :: Symbol -> [Asm] -> Expr -> CheckingM (Set Symbol)
-checkedDefinitionDependencies symbol asms definiens = do
- assumptionFormulas <- traverse asmFormula asms
- expandedAssumptions <- traverse unabbreviate assumptionFormulas
- expandedDefiniens <- unabbreviate definiens
- let dependencies =
- mentionedSymbols expandedDefiniens
- <> Set.unions (mentionedSymbols <$> expandedAssumptions)
- when (symbol `Set.member` dependencies) do
- throwCheckingError
- ("definition of symbol " <> symbolText symbol <> " is self-referential")
- pure dependencies
-
-checkDatatype :: BlockContext -> Syntax.Internal.Datatype -> Checking
-checkDatatype context datatype = do
- structContext <- gets checkingStructContext
- checked <-
- Datatype.prepareCheckedDatatype
- (canonicalizeWithAt context structContext)
- datatype
- >>= either
- ( throwIO
- . checkingErrorAt context
- . Datatype.renderDatatypeValidationError
- )
- pure
- st <- get
- committed <-
- either
- throwIO
- pure
- (commitCheckedDatatype context checked st)
- putDeclarationCandidate committed
- setDeclarationFactProducers
- ( LegacyDeclarationRuleProducer
- . LegacyDatatypeRule
- <$> NonEmpty.toList
- (Datatype.checkedDatatypeFactRoles checked)
- )
-
--- | Validate and commit every state row introduced by one datatype.
-commitCheckedDatatype
- :: BlockContext
- -> Datatype.CheckedDatatype
- -> CheckingState
- -> Either CheckingError CheckingState
-commitCheckedDatatype context checked st = do
- blockMarkers <-
- validatedMarkers
- location
- [blockMarker]
- st
- (owners', ownedMarkers') <-
- foldM validateOwner
- (checkingOwnedSymbols st, checkingOwnedSymbolMarkers st)
- ownedSymbols
- markers' <-
- validatedMarkers
- location
- factMarkers
- st{definedMarkers = blockMarkers}
- dependencies' <-
- foldM registerDependency
- (checkingDependencies st)
- (snd <$> ownedSymbols)
- traverse_
- (validatePreparedDatatypeFact
- context
- owners'
- dependencies')
- (Facts.stagedFactSemantic <$> stagedFacts)
- facts' <-
- first
- (DuplicateMarker location)
- (Facts.registerStagedFacts
- stagedFacts
- (checkingFacts st))
- pure
- st
- { checkingFacts = facts'
- , checkingDependencies = dependencies'
- , checkingOwnedSymbols = owners'
- , checkingOwnedSymbolMarkers = ownedMarkers'
- , definedMarkers = markers'
- , blockLabel = blockMarker
- , stepLocation = location
- , checkingHypothesisCounter = 0
- }
- where
- location = blockContextLocation context
- blockMarker = blockContextMarker context
- stagedFacts =
- Datatype.checkedDatatypeFacts location blockMarker checked
- factMarkers =
- toList (stagedFacts >>= Facts.stagedFactAliases)
- ownedSymbols =
- ( OwnedByDatatypeHead
- , Datatype.checkedDatatypeHeadSymbol checked
- )
- : [ (OwnedByDatatypeConstructor, symbol)
- | symbol <-
- toList
- (Datatype.checkedDatatypeConstructorSymbols checked)
- ]
-
- validateOwner
- (owners, ownedMarkers)
- (ownerKind, symbol) =
- first
- (checkingErrorAt context)
- (validatedOwnership
- blockMarker
- ownerKind
- symbol
- st
- { checkingOwnedSymbols = owners
- , checkingOwnedSymbolMarkers = ownedMarkers
- })
-
- registerDependency dependencies symbol =
- first
- ( checkingErrorAt context
- . dependencyRegistrationErrorText symbol
- )
- (Dependencies.registerDependencies
- symbol
- mempty
- dependencies)
-
-validatePreparedDatatypeFact
- :: BlockContext
- -> HashMap Symbol SymbolOwner
- -> Dependencies.DependencyRegistry
- -> Facts.PreparedSemanticFact
- -> Either CheckingError ()
-validatePreparedDatatypeFact context owners dependencies prepared =
- case Set.lookupMin unknownOwners of
- Just _unknown ->
- Left
- (checkingErrorAt
- context
- ( "top-level fact mentions symbol(s) without prior ownership: "
- <> formatSymbols unknownOwners
- ))
- Nothing ->
- case Set.lookupMin unknownDependencies of
- Nothing ->
- Right ()
- Just unknown ->
- Left
- (checkingErrorAt
- context
- ( "datatype fact depends on unknown symbol "
- <> symbolText unknown
- ))
- where
- semanticDependencies =
- Facts.preparedSemanticDependencies prepared
- unknownOwners =
- Set.filter
- (\symbol ->
- requiresDatatypeOwnership symbol
- && not (HM.member symbol owners))
- semanticDependencies
- unknownDependencies =
- Set.filter
- (\symbol ->
- requiresDatatypeOwnership symbol
- && isNothing
- (Dependencies.lookupDependencies
- symbol
- dependencies))
- semanticDependencies
-
- -- Exact fixed terms do not require a legacy source declaration.
- requiresDatatypeOwnership symbol =
- ownableSymbol symbol
- && case ExactVocabulary.classifyExactSymbol symbol of
- ExactVocabulary.ExactFixedPrimitive{} -> False
- _ -> True
-
-functionSymbolText :: FunctionSymbol -> Text
-functionSymbolText symbol = case mixfixMarker symbol of
- Marker name -> name
-
-freshDatatypeVar :: Set VarSymbol -> Text -> VarSymbol
-freshDatatypeVar used base =
- List.head
- [ NamedVar candidate
- | candidate <- base : [base <> Text.pack (show n) | n <- [(1 :: Int)..]]
- , NamedVar candidate `Set.notMember` used
- ]
-
-freshGeneratedVar :: Set VarSymbol -> Text -> VarSymbol
-freshGeneratedVar = freshDatatypeVar
-
-forallIfNeeded :: [VarSymbol] -> Formula -> Formula
-forallIfNeeded [] phi = phi
-forallIfNeeded xs phi = makeForall xs phi
-
-existsIfNeeded :: [VarSymbol] -> Formula -> Formula
-existsIfNeeded [] phi = phi
-existsIfNeeded xs phi = makeExists xs phi
-
-impliesFrom :: [Formula] -> Formula -> Formula
-impliesFrom [] conclusion = conclusion
-impliesFrom premises conclusion = makeConjunction premises `Implies` conclusion
-
-
--- | Prepare one complete current goal batch.
-tellTasks :: Checking
-tellTasks =
- emitCurrentObligations ProveWithVampire
-
-omitCurrentGoals :: Location -> Checking
-omitCurrentGoals location = do
- emitCurrentObligations (RecordExplicitGap location)
- setGoals []
-
-emitCurrentObligations :: ObligationMethod -> Checking
-emitCurrentObligations method = do
- goals <- gets checkingGoals
- marker <- gets blockLabel
- facts <- gets checkingFacts
- assumptions <- gets checkingAssumptions
- directness <- gets checkingDirectness
- location <- gets stepLocation
- firstOrdinal <- gets checkingNextObligationOrdinal
- prepareTask <- gets checkingPrepareTask
- batchHandler <- gets checkingObligationBatchHandler
- legacyStage <- gets checkingLegacyModuleStage
- let premises =
- factPremises legacyStage facts
- <> (currentHypothesisPremise <$> assumptions)
- (batch, nextOrdinal) =
- case method of
- ProveWithVampire ->
- prepareObligationBatch
- prepareTask
- firstOrdinal
- premises
- directness
- marker
- location
- goals
- RecordExplicitGap gapLocation ->
- prepareOmittedObligationBatch
- prepareTask
- firstOrdinal
- premises
- directness
- marker
- gapLocation
- goals
- modify \st ->
- st
- { checkingNextObligationOrdinal =
- nextOrdinal
- }
- case batchHandler of
- ObserveObligationBatches emitBatch ->
- liftIO (emitBatch batch)
- ResolveObligationBatches resolveBatch -> do
- resolved <- liftIO (resolveBatch batch)
- modify \st ->
- st
- { checkingResolvedObligationBatches =
- checkingResolvedObligationBatches st
- <> [resolved]
- }
-
-factPremises
- :: Maybe LegacyModuleStage
- -> Facts.FactRegistry
- -> [PreparedPremise]
-factPremises legacyStage facts =
- [ preparedPremise
- (Hypothesis marker (Facts.preparedSemanticStatement fact))
- (case legacyStage >>= lookupLegacyStageFact marker of
- Nothing ->
- RegisteredFactPremise origin
- Just entry ->
- RegisteredLegacyFactPremise
- (legacyFactEntryReference entry)
- origin
- (legacyFactEntryTrustDependencies entry))
- | (marker, fact, origin) <-
- Facts.registeredFactsWithOrigins facts
- ]
-
-factHypotheses :: Facts.FactRegistry -> [Hypothesis]
-factHypotheses =
- fmap preparedPremiseHypothesis . factPremises Nothing
-
-currentHypothesisPremise :: CurrentHypothesis -> PreparedPremise
-currentHypothesisPremise
- (CurrentHypothesis hypothesis location marker) =
- preparedPremise
- hypothesis
- (LocalHypothesisPremise location marker)
-
-stagePreparedFact
- :: Location
- -> Marker
- -> Marker
- -> Facts.PreparedSemanticFact
- -> Facts.StagedFact
-stagePreparedFact loc blockMarker factMarker =
- Facts.stageFact
- (factMarker :| [])
- (Facts.factOrigin loc blockMarker)
-
-validatedMarkers
- :: Location
- -> [Marker]
- -> CheckingState
- -> Either CheckingError (HashSet Marker)
-validatedMarkers loc markers st =
- case firstDuplicateMarker (definedMarkers st) HS.empty markers of
- Just marker ->
- Left (DuplicateMarker loc marker)
- Nothing ->
- Right (foldr HS.insert (definedMarkers st) markers)
-
-firstDuplicateMarker
- :: HashSet Marker
- -> HashSet Marker
- -> [Marker]
- -> Maybe Marker
-firstDuplicateMarker _seenGlobals _seenLocals [] =
- Nothing
-firstDuplicateMarker seenGlobals seenLocals (marker:rest)
- | HS.member marker seenGlobals || HS.member marker seenLocals =
- Just marker
- | otherwise =
- firstDuplicateMarker
- seenGlobals
- (HS.insert marker seenLocals)
- rest
-
-
-
-canonicalizedFactWithAsms :: [Asm] -> Formula -> CheckingM Formula
-canonicalizedFactWithAsms asms stmt = do
- (asms', structContext) <- mergeAssumptions asms
- asms'' <- traverse (canonicalizeWith structContext) asms'
- stmt' <- canonicalizeWith structContext stmt
- pure
- (case asms'' of
- [] -> forallClosure mempty stmt'
- _ -> forallClosure mempty (makeConjunction asms'' `Implies` stmt')
- )
-
-unabbreviateWith :: (forall a. HashMap Symbol (Scope Int ExprOf a)) -> (forall b. ExprOf b -> ExprOf b)
-unabbreviateWith abbrs = unabbr
- where
- unabbr :: ExprOf b -> ExprOf b
- unabbr = \case
- TermSymbol loc sym es ->
- let es' = unabbr <$> es
- in case HM.lookup sym abbrs of
- Nothing -> TermSymbol loc sym es'
- Just scope ->
- unabbr
- (instantiate
- (\k ->
- nth k es
- ?? impossible
- "abbreviation index exceeds application arity")
- scope)
- Not loc e ->
- Not loc (unabbr e)
- Apply e es ->
- Apply (unabbr e) (unabbr <$> es)
- TermSep vs e scope ->
- TermSep vs (unabbr e) (hoistScope unabbr scope)
- ReplacePred y x xB scope ->
- ReplacePred y x (unabbr xB) (hoistScope unabbr scope)
- ReplaceFun bounds scope cond ->
- ReplaceFun ((\(x, e) -> (x, unabbr e)) <$> bounds) (hoistScope unabbr scope) (hoistScope unabbr cond)
- Connected con e1 e2 ->
- Connected con (unabbr e1) (unabbr e2)
- Lambda scope ->
- Lambda (hoistScope unabbr scope)
- Quantified quant scope ->
- Quantified quant (hoistScope unabbr scope)
- e@PropositionalConstant{} ->
- e
- e@TermVar{} ->
- e
- TermSymbolStruct symb e ->
- TermSymbolStruct symb (unabbr <$> e)
-
-mentionsSymbol :: Symbol -> ExprOf a -> Bool
-mentionsSymbol target = \case
- TermVar{} ->
- False
- TermSymbol _loc sym es ->
- sym == target || any (mentionsSymbol target) es
- TermSymbolStruct _symb e ->
- maybe False (mentionsSymbol target) e
- Apply e es ->
- mentionsSymbol target e || any (mentionsSymbol target) es
- TermSep _x bound scope ->
- mentionsSymbol target bound || mentionsSymbol target (fromScope scope)
- ReplacePred _y _x bound scope ->
- mentionsSymbol target bound || mentionsSymbol target (fromScope scope)
- ReplaceFun bounds lhs cond ->
- any (mentionsSymbol target . snd) bounds
- || mentionsSymbol target (fromScope lhs)
- || mentionsSymbol target (fromScope cond)
- Connected _conn e1 e2 ->
- mentionsSymbol target e1 || mentionsSymbol target e2
- Lambda scope ->
- mentionsSymbol target (fromScope scope)
- Quantified _quant scope ->
- mentionsSymbol target (fromScope scope)
- PropositionalConstant{} ->
- False
- Not _loc e ->
- mentionsSymbol target e
-
--- | Unroll supported comprehensions in equations and reject leftover ones.
--- E.g. /@B = \\{f(a) | a\\in A \\}@/ turns into
--- /@\\forall b. b\\in B \\iff \\exists a\\in A. b = f(a)@/.
-desugarComprehensionsAt
- :: BlockContext
- -> ExprOf a
- -> CheckingM (ExprOf a)
-desugarComprehensionsAt context = go
- where
- go :: forall b. ExprOf b -> CheckingM (ExprOf b)
- go = \case
- -- We only desugar comprehensions directly under equations.
- -- Any remaining comprehension is currently unsupported.
- e@TermSep{} ->
- reject e
- e@ReplacePred{} ->
- reject e
- e@ReplaceFun{} ->
- reject e
- e@TermVar{} ->
- pure e
- e@PropositionalConstant{} ->
- pure e
- TermSymbolStruct symbol Nothing ->
- throwIO
- (UnresolvedStructureOperation
- symbol
- (blockContextLocation context)
- (blockContextMarker context))
- TermSymbolStruct symbol (Just argument) ->
- TermSymbolStruct symbol . Just <$> go argument
- --
- Equals _pos e (TermSep x bound scope) ->
- go (desugarSeparation e x bound scope)
- Equals _pos (TermSep x bound scope) e ->
- go (desugarSeparation e x bound scope)
- --
- Equals _pos e (ReplaceFun bounds scope cond) ->
- go (makeReplacementIff (F <$> e) bounds scope cond)
- Equals _pos (ReplaceFun bounds scope cond) e ->
- go (makeReplacementIff (F <$> e) bounds scope cond)
- --
- Apply e es ->
- Apply <$> go e <*> traverse go es
- Not loc e ->
- Not loc <$> go e
- TermSymbol loc sym es ->
- TermSymbol loc sym <$> traverse go es
- Connected conn e1 e2 ->
- Connected conn <$> go e1 <*> go e2
- Lambda scope ->
- Lambda <$> transverseScope go scope
- Quantified quant scope ->
- Quantified quant <$> transverseScope go scope
-
- reject :: ExprOf a -> CheckingM b
- reject _ =
- throwIO
- (CheckingError
- "Could not eliminate set comprehensions in this step. Nested comprehensions are not supported yet."
- (blockContextLocation context)
- (blockContextMarker context))
-
- desugarSeparation
- :: ExprOf a
- -> VarSymbol
- -> ExprOf a
- -> Scope () ExprOf a
- -> ExprOf a
- desugarSeparation e x bound scope =
- let phi = isElementOf (TermVar (B x)) (F <$> e)
- psi = isElementOf (TermVar (B x)) (F <$> bound)
- rho = fromScope (mapBound (const x) scope)
- in Quantified Universally (toScope (phi `Iff` (psi `And` rho)))
-
-
-
-
-checkBlocks :: [Block] -> Checking
-checkBlocks = \case
- BlockAxiom loc marker axiom : blocks -> do
- let context = BlockContext loc marker
- withBlockContext context (checkAxiom context axiom)
- checkBlocks blocks
- BlockDefn loc marker defn : blocks -> do
- let context = BlockContext loc marker
- withBlockContext context (checkDefn context defn)
- checkBlocks blocks
- BlockAbbr loc marker abbr : blocks -> do
- let context = BlockContext loc marker
- withBlockContext context (checkAbbr context abbr)
- checkBlocks blocks
- BlockLemma loc marker lemma : BlockProof _startLoc endLoc proof : blocks -> do
- modify \st -> st{blockEndLocation = endLoc}
- let context = BlockContext loc marker
- withBlockContext
- context
- (checkLemmaWithProof context lemma proof)
- checkBlocks blocks
- BlockLemma loc marker lemma : blocks -> do
- let context = BlockContext loc marker
- withBlockContext context (checkLemma context lemma)
- checkBlocks blocks
- BlockProof startLoc _endLoc _proof : _ ->
- throwWithMarker (ProofWithoutPrecedingTheorem startLoc)
- BlockSig loc marker asms sig : blocks -> do
- let context = BlockContext loc marker
- withBlockContext context (checkSig context asms sig)
- checkBlocks blocks
- BlockData loc marker datatype : blocks -> do
- let context = BlockContext loc marker
- withBlockContext context (checkDatatype context datatype)
- checkBlocks blocks
- BlockInductive loc marker inductiveDefn : blocks -> do
- let context = BlockContext loc marker
- withBlockContext
- context
- (checkInductive context inductiveDefn)
- checkBlocks blocks
- BlockStruct loc marker structDefn : blocks -> do
- let context = BlockContext loc marker
- withBlockContext context (checkStructDefn context structDefn)
- checkBlocks blocks
- [] -> skip
-
--- | Make a block's diagnostic context current without publishing its label.
-withBlockContext :: BlockContext -> CheckingM a -> CheckingM a
-withBlockContext BlockContext{blockContextLocation, blockContextMarker} ma = do
- previous <- get
- modify \st ->
- st
- { blockLabel = blockContextMarker
- , stepLocation = blockContextLocation
- , checkingHypothesisCounter = 0
- , checkingNextObligationOrdinal =
- legacyObligationOrdinal 0
- , checkingResolvedObligationBatches = []
- , checkingDeclarationFactProducers = []
- , checkingTransitionModuleBuilder =
- Transition.beginTransitionDeclaration
- <$> checkingTransitionModuleBuilder st
- }
- result <- ma
- finalizeLegacyDeclaration previous
- pure result
-
-setDeclarationFactProducers
- :: [LegacyFactProducer]
- -> Checking
-setDeclarationFactProducers producers =
- modify \st ->
- st{checkingDeclarationFactProducers = producers}
-
-putDeclarationCandidate :: CheckingState -> Checking
-putDeclarationCandidate candidate = do
- current <- get
- put
- candidate
- { checkingHypothesisCounter =
- checkingHypothesisCounter current
- , checkingNextObligationOrdinal =
- checkingNextObligationOrdinal current
- , checkingResolvedObligationBatches =
- checkingResolvedObligationBatches current
- , checkingDeclarationFactProducers =
- checkingDeclarationFactProducers current
- }
-
-finalizeLegacyDeclaration :: CheckingState -> Checking
-finalizeLegacyDeclaration previous = do
- current <- get
- case checkingLegacyModuleStage current of
- Nothing ->
- pure ()
- Just stage -> do
- stagedFacts <-
- either
- (throwIO
- . LegacyFactRegistryIsNotAnExtension)
- pure
- (Facts.factRegistryExtension
- (checkingFacts previous)
- (checkingFacts current))
- let producers =
- checkingDeclarationFactProducers current
- unless
- (length producers == length stagedFacts)
- (throwIO
- (LegacyFactProducerCountMismatch
- (length producers)
- (length stagedFacts)))
- case stagedFacts of
- [] ->
- pure ()
- firstStaged : remainingStaged -> do
- reservation <-
- either
- (throwIO
- . LegacyStageAdmissionFailed)
- pure
- (reserveLegacyDeclaration
- (firstStaged :| remainingStaged)
- stage)
- admitted <-
- authorizeLegacyDeclaration
- stage
- reservation
- producers
- (checkingResolvedObligationBatches
- current)
- stage' <-
- either
- (throwIO
- . LegacyStageAdmissionFailed)
- pure
- (appendEstablishedLegacyDeclaration
- reservation
- admitted
- stage)
- unless
- (legacyStageFactRegistry stage'
- == checkingFacts current)
- (throwIO
- (LegacyFactRegistryIsNotAnExtension
- "checker and legacy-stage fact registries diverged"))
- transitionBuilder' <-
- traverse
- (either
- (throwIO
- . TransitionStageAdmissionFailed)
- pure
- . Transition.transitionBuilderWithLegacyStage
- stage')
- (checkingTransitionModuleBuilder
- current)
- put
- current
- { checkingLegacyModuleStage =
- Just stage'
- , checkingTransitionModuleBuilder =
- transitionBuilder'
- }
-
-authorizeLegacyDeclaration
- :: LegacyModuleStage
- -> LegacyDeclarationReservation
- -> [LegacyFactProducer]
- -> [ResolvedObligationBatch]
- -> CheckingM (NonEmpty H1LegacyAdmittedFact)
-authorizeLegacyDeclaration stage reservation producers batches = do
- established <-
- traverse
- (establishedLegacyObligation
- (legacyStageModuleOrdinal stage))
- [ (batch, obligation)
- | batch <- batches
- , obligation <-
- Vector.toList
- (resolvedBatchObligations batch)
- ]
- let reserved =
- NonEmpty.toList
- (legacyReservedFacts reservation)
- authorizationInputs =
- zip producers reserved
- admitted <-
- traverse
- (authorizeOne established)
- authorizationInputs
- case admitted of
- firstAdmitted : remainingAdmitted ->
- pure (firstAdmitted :| remainingAdmitted)
- [] ->
- impossible
- "nonempty legacy reservation produced no admitted facts"
- where
- authorizeOne established (producer, reserved) =
- case producer of
- LegacyDeclaredAssumptionProducer kind ->
- pure
- (authorizeLegacyDeclaredAssumption
- stage
- kind
- reserved)
- LegacyDirectObligationProducer ->
- case directLegacyAuthorization
- reserved
- batches
- established of
- Just admitted ->
- pure admitted
- Nothing ->
- pure
- (authorizeLegacyRule
- (LegacyTheoremRule
- LegacyOrdinaryTheoremFinalization)
- (legacyEstablishedPredecessors
- established)
- (foldMap
- establishedLegacyTrust
- established)
- reserved)
- LegacyDeclarationRuleProducer tag ->
- pure
- (authorizeLegacyRule
- tag
- (legacyEstablishedPredecessors
- established)
- (foldMap
- establishedLegacyTrust
- established)
- reserved)
-
-data EstablishedLegacyObligation = EstablishedLegacyObligation
- !ResolvedObligation
- !SessionLegacyObligationRef
- !Marker
- !(Vector LegacyFactRef)
- !LegacyTrustDependencies
- !LegacyTrustDependencies
-
-establishedLegacyTrust
- :: EstablishedLegacyObligation
- -> LegacyTrustDependencies
-establishedLegacyTrust
- (EstablishedLegacyObligation
- _resolved
- _reference
- _marker
- _factPredecessors
- _predecessorTrust
- trust) =
- trust
-
-legacyEstablishedPredecessors
- :: [EstablishedLegacyObligation]
- -> Vector (LegacyRulePredecessor LegacyFactRef)
-legacyEstablishedPredecessors established =
- Vector.fromList
- [ predecessor
- | EstablishedLegacyObligation
- _resolved
- obligationReference
- _marker
- factReferences
- _predecessorTrust
- _trust <-
- established
- , predecessor <-
- (legacyRuleFactPredecessor
- <$> Vector.toList factReferences)
- <> [ legacyRuleObligationPredecessor
- obligationReference
- ]
- ]
-
-establishedLegacyObligation
- :: LegacyModuleOrdinal
- -> (ResolvedObligationBatch, ResolvedObligation)
- -> CheckingM EstablishedLegacyObligation
-establishedLegacyObligation moduleOrdinal (batch, resolved) = do
- let prepared =
- resolvedObligationPrepared resolved
- ordinal =
- preparedObligationOrdinal prepared
- selected =
- preparedObligationSelectedPremises prepared
- expectedHypotheses =
- taskHypotheses
- (preparedObligationTask prepared)
- unless
- ( (preparedPremiseHypothesis
- <$> Vector.toList selected)
- == expectedHypotheses
- )
- (throwIO
- (LegacyPreparedPremiseSelectionMismatch
- ordinal))
- (factReferences, predecessorTrust) <-
- foldM
- (collectPremise ordinal)
- ([], mempty)
- selected
- let marker =
- preparedBatchMarker
- (resolvedBatchPrepared batch)
- obligationReference =
- sessionLegacyObligationRef
- moduleOrdinal
- marker
- ordinal
- trust =
- case
- ( resolvedObligationVampireRun resolved
- , resolvedObligationGapLocation resolved
- )
- of
- (Just _accepted, Nothing) ->
- legacyTrustedVampireTrust
- obligationReference
- predecessorTrust
- (Nothing, Just gapLocation) ->
- legacyGapTrust
- obligationReference
- gapLocation
- marker
- predecessorTrust
- _ ->
- impossible
- "resolved legacy obligation has no evidence"
- pure
- (EstablishedLegacyObligation
- resolved
- obligationReference
- marker
- (Vector.fromList (reverse factReferences))
- predecessorTrust
- trust)
- where
- collectPremise ordinal (references, trust) premise =
- case preparedPremiseOrigin premise of
- RegisteredLegacyFactPremise
- reference
- _origin
- premiseTrust ->
- pure
- ( reference : references
- , trust <> premiseTrust
- )
- RegisteredFactPremise _origin ->
- throwIO
- (LegacyFactPremiseHasNoAuthorization
- ordinal
- (hypothesisMarker
- (preparedPremiseHypothesis
- premise)))
- LocalHypothesisPremise{} ->
- pure (references, trust)
-
-directLegacyAuthorization
- :: LegacyReservedFact
- -> [ResolvedObligationBatch]
- -> [EstablishedLegacyObligation]
- -> Maybe H1LegacyAdmittedFact
-directLegacyAuthorization reserved batches established =
- case (batches, established) of
- ([batch], [establishedObligation])
- | Vector.length
- (preparedBatchObligations
- (resolvedBatchPrepared batch))
- == 1
- , directTarget batch establishedObligation
- == reservedTarget ->
- directFromEvidence establishedObligation
- _ ->
- Nothing
- where
- reservedTarget =
- legacyPreparedFormula
- (prepareLegacyProposition
- (Facts.stagedFactSemantic
- (legacyReservedStagedFact reserved)))
-
- directTarget batch
- (EstablishedLegacyObligation
- resolved
- _reference
- _marker
- _facts
- _predecessorTrust
- _trust) =
- forallClosure
- mempty
- (case localPremises of
- [] ->
- taskConjecture task
- _ ->
- makeConjunction localPremises
- `Implies` taskConjecture task)
- where
- task =
- preparedObligationTask
- (resolvedObligationPrepared resolved)
- localPremises =
- reverse
- [ hypothesisFormula
- (preparedPremiseHypothesis premise)
- | premise <-
- Vector.toList
- (preparedBatchPremises
- (resolvedBatchPrepared batch))
- , LocalHypothesisPremise{} <-
- [preparedPremiseOrigin premise]
- ]
-
- directFromEvidence
- (EstablishedLegacyObligation
- resolved
- reference
- marker
- _factReferences
- predecessorTrust
- _trust) =
- case
- ( resolvedObligationVampireRun resolved
- , resolvedObligationGapLocation resolved
- ) of
- (Just accepted, Nothing) ->
- Just
- (authorizeLegacyTrustedVampire
- reference
- accepted
- predecessorTrust
- reserved)
- (Nothing, Just gapLocation) ->
- Just
- (authorizeLegacyGap
- reference
- gapLocation
- marker
- predecessorTrust
- reserved)
- _ ->
- Nothing
-
--- | Verification of a lemma with a proof.
--- We skip omitted proofs and treat them as proper gaps of the formalization.
--- This is useful when developing a formalization, as it makes it easy to
--- leave difficult proofs for later.
-checkLemmaWithProof
- :: BlockContext
- -> Lemma
- -> Proof
- -> Checking
-checkLemmaWithProof context (Lemma asms goal) proof = do
- committed <- prepareOrdinaryFactCommit context asms goal
- locally do
- registerLemmaLocalVars asms goal
- registerAssumptionStructContexts asms
- assume asms
- setGoals [goal]
- checkProof proof
- putDeclarationCandidate committed
- setDeclarationFactProducers
- [LegacyDirectObligationProducer]
-
-
--- | Verification of a lemma without a proof.
-checkLemma :: BlockContext -> Lemma -> Checking
-checkLemma context (Lemma asms goal) = do
- staged <-
- prepareOrdinaryStagedFact context asms goal
- st <- get
- case prepareTypedGroundReflexivity context staged st of
- Nothing -> do
- case prepareTypedAtomicReuse context staged st of
- Nothing -> do
- committed <-
- either
- throwIO
- pure
- (commitOrdinaryFact context staged st)
- locally do
- registerLemmaLocalVars asms goal
- registerAssumptionStructContexts asms
- assume asms
- setGoals [goal]
- tellTasks
- putDeclarationCandidate committed
- setDeclarationFactProducers
- [LegacyDirectObligationProducer]
- Just result -> do
- committed <-
- either throwIO pure result
- putDeclarationCandidate committed
- setDeclarationFactProducers []
- Just result -> do
- committed <-
- either throwIO pure result
- putDeclarationCandidate committed
- setDeclarationFactProducers []
-
-
-checkAxiom :: BlockContext -> Axiom -> Checking
-checkAxiom context (Axiom asms axiom) = do
- staged <-
- prepareOrdinaryStagedFact context asms axiom
- st <- get
- case prepareTypedAtomicAssumption context staged st of
- Nothing -> do
- committed <-
- either
- throwIO
- pure
- (commitOrdinaryFact context staged st)
- putDeclarationCandidate committed
- setDeclarationFactProducers
- [ LegacyDeclaredAssumptionProducer
- DeclaredUserAxiom
- ]
- Just result -> do
- committed <-
- either throwIO pure result
- putDeclarationCandidate committed
- setDeclarationFactProducers []
-
-prepareOrdinaryFactCommit
- :: BlockContext
- -> [Asm]
- -> Formula
- -> CheckingM CheckingState
-prepareOrdinaryFactCommit context asms statement = do
- staged <-
- prepareOrdinaryStagedFact
- context
- asms
- statement
- st <- get
- either
- throwIO
- pure
- (commitOrdinaryFact context staged st)
-
-prepareOrdinaryStagedFact
- :: BlockContext
- -> [Asm]
- -> Formula
- -> CheckingM Facts.StagedFact
-prepareOrdinaryStagedFact context asms statement = do
- prepared <-
- Facts.prepareSemanticFact
- <$> canonicalizedFactWithAsms asms statement
- pure
- (stagePreparedFact
- (blockContextLocation context)
- (blockContextMarker context)
- (blockContextMarker context)
- prepared)
-
-prepareTypedGroundReflexivity
- :: BlockContext
- -> Facts.StagedFact
- -> CheckingState
- -> Maybe (Either CheckingError CheckingState)
-prepareTypedGroundReflexivity context staged st = do
- builder <-
- checkingTransitionModuleBuilder st
- prepared <-
- TypedReflexivity.prepareGroundReflexivity
- (Facts.preparedSemanticStatement
- (Facts.stagedFactSemantic staged))
- pure do
- typed <-
- first
- (checkingErrorAt context
- . ("typed reflexivity preparation failed: "
- <>)
- . Text.pack
- . show)
- prepared
- markers' <-
- validatedMarkers
- (blockContextLocation context)
- [blockContextMarker context]
- st
- validatePreparedSemanticFact
- context
- (checkingOwnedSymbols st)
- (checkingDependencies st)
- (Facts.stagedFactSemantic staged)
- builder' <-
- first
- (checkingErrorAt context
- . ("typed reflexivity admission failed: "
- <>)
- . Text.pack
- . show)
- (Transition.commitTransitionKernelFact
- (blockContextMarker context :| [])
- (Transition.origin
- (blockContextLocation context)
- Nothing
- (Just
- (blockContextMarker context)))
- (TypedReflexivity.groundReflexivityTarget
- typed)
- (TypedReflexivity.groundReflexivityDerivation
- typed)
- builder)
- pure
- st
- { definedMarkers = markers'
- , blockLabel =
- blockContextMarker context
- , stepLocation =
- blockContextLocation context
- , checkingHypothesisCounter = 0
- , checkingTransitionModuleBuilder =
- Just builder'
- }
-
-prepareTypedAtomicAssumption
- :: BlockContext
- -> Facts.StagedFact
- -> CheckingState
- -> Maybe (Either CheckingError CheckingState)
-prepareTypedAtomicAssumption context staged st = do
- builder <-
- checkingTransitionModuleBuilder st
- preparation <-
- TypedAtomic.prepareClosedAtomic
- (`Transition.lookupTransitionGlobal` builder)
- (Facts.preparedSemanticStatement
- (Facts.stagedFactSemantic staged))
- pure do
- prepared <-
- first
- (typedFactError
- context
- "typed atomic preparation failed: ")
- preparation
- markers' <-
- validateTypedFactState
- context
- staged
- st
- builder' <-
- first
- (typedFactError
- context
- "typed declared-assumption registration failed: ")
- (Transition.commitTransitionTypedDeclaredAssumption
- (blockContextMarker context :| [])
- (typedFactOrigin context)
- DeclaredUserAxiom
- (TypedAtomic.closedAtomicStatement
- prepared)
- builder)
- pure
- (publishTypedFactState
- context
- markers'
- builder'
- st)
-
-prepareTypedAtomicReuse
- :: BlockContext
- -> Facts.StagedFact
- -> CheckingState
- -> Maybe (Either CheckingError CheckingState)
-prepareTypedAtomicReuse context staged st = do
- builder <-
- checkingTransitionModuleBuilder st
- preparation <-
- TypedAtomic.prepareClosedAtomic
- (`Transition.lookupTransitionGlobal` builder)
- (Facts.preparedSemanticStatement
- (Facts.stagedFactSemantic staged))
- case preparation of
- Left err ->
- Just
- (Left
- (typedFactError
- context
- "typed atomic preparation failed: "
- err))
- Right prepared -> do
- let target =
- TypedAtomic.closedAtomicStatement
- prepared
- case Transition.lookupTransitionTypedImport
- target
- builder of
- Left err ->
- Just
- (Left
- (typedFactError
- context
- "typed import lookup failed: "
- err))
- Right Nothing ->
- Nothing
- Right (Just imported) ->
- pure do
- markers' <-
- validateTypedFactState
- context
- staged
- st
- builder' <-
- first
- (typedFactError
- context
- "typed imported-fact admission failed: ")
- (Transition.commitTransitionKernelFactWithImports
- (blockContextMarker context :| [])
- (typedFactOrigin context)
- (Vector.singleton imported)
- target
- (importedFactDerivation
- (importIx 0))
- builder)
- pure
- (publishTypedFactState
- context
- markers'
- builder'
- st)
-
-validateTypedFactState
- :: BlockContext
- -> Facts.StagedFact
- -> CheckingState
- -> Either CheckingError (HashSet Marker)
-validateTypedFactState context staged st = do
- markers' <-
- validatedMarkers
- (blockContextLocation context)
- [blockContextMarker context]
- st
- validatePreparedSemanticFact
- context
- (checkingOwnedSymbols st)
- (checkingDependencies st)
- (Facts.stagedFactSemantic staged)
- pure markers'
-
-publishTypedFactState
- :: BlockContext
- -> HashSet Marker
- -> Transition.TransitionModuleBuilder
- -> CheckingState
- -> CheckingState
-publishTypedFactState context markers' builder st =
- st
- { definedMarkers = markers'
- , blockLabel =
- blockContextMarker context
- , stepLocation =
- blockContextLocation context
- , checkingHypothesisCounter = 0
- , checkingTransitionModuleBuilder =
- Just builder
- }
-
-typedFactOrigin
- :: BlockContext
- -> Transition.Origin
-typedFactOrigin context =
- Transition.origin
- (blockContextLocation context)
- Nothing
- (Just
- (blockContextMarker context))
-
-typedFactError
- :: Show error
- => BlockContext
- -> Text
- -> error
- -> CheckingError
-typedFactError context prefix =
- checkingErrorAt context
- . (prefix <>)
- . Text.pack
- . show
-
--- | Validate and commit one ordinary axiom or proven fact.
-commitOrdinaryFact
- :: BlockContext
- -> Facts.StagedFact
- -> CheckingState
- -> Either CheckingError CheckingState
-commitOrdinaryFact context staged st = do
- markers' <-
- validatedMarkers location [marker] st
- validatePreparedSemanticFact
- context
- (checkingOwnedSymbols st)
- (checkingDependencies st)
- (Facts.stagedFactSemantic staged)
- facts' <-
- first
- (DuplicateMarker location)
- (Facts.registerStagedFacts
- (staged :| [])
- (checkingFacts st))
- pure
- st
- { checkingFacts = facts'
- , definedMarkers = markers'
- , blockLabel = marker
- , stepLocation = location
- }
- where
- location =
- blockContextLocation context
- marker =
- blockContextMarker context
-
-checkProof :: Proof -> Checking
-checkProof = \case
- Qed mloc j -> do
- loc <- case mloc of
- Just loc -> pure loc
- Nothing -> do
- gets blockEndLocation
- setLocation loc
- justify j
- Contradiction loc j -> do
- setLocation loc
- setGoals [Bottom]
- justify j
- ByContradiction loc proof -> do
- setLocation loc
- goals <- gets checkingGoals
- case goals of
- [goal] -> do
- assume [Asm (Not loc goal)]
- modify \st ->
- st
- { checkingGoals = [Bottom]
- , checkingDirectness = Indirect goal
- }
- checkProof proof
- _ -> throwWithLocationAndMarker (ByContradictionOnMultipleGoals)
- ByCase loc splits -> do
- setLocation loc
- for_ splits \(Case split _) ->
- assertKnownFormulaVars "case split" split
- for_ splits checkCase
- setGoals [makeDisjunction (caseOf <$> splits)]
- tellTasks
- BySetInduction loc mx continue -> do
- setLocation loc
- goals <- gets checkingGoals
- case goals of
- Forall scope : goals' -> do
- let zs = nubOrd (bindings scope)
- z <- case mx of
- Nothing -> case zs of
- [z'] -> pure z'
- _ -> throwWithMarker (AmbiguousInductionVar loc)
- Just (TermVar z') -> pure z'
- _ -> throwWithMarker (AmbiguousInductionVar loc)
- checkFreshLocalVars "set induction" [z]
- let y = NamedVar "IndAntecedent"
- let ys = List.delete z zs
- let anteInst bv = if bv == z then TermVar y else TermVar bv
- let antecedent = makeForall (y : ys) ((isElementOf (TermVar y) (TermVar z)) `Implies` instantiate anteInst scope)
- addLocalVars (Set.singleton z)
- assume [Asm antecedent]
- let consequent = instantiate TermVar scope
- setGoals (consequent : goals')
- checkProof continue
- _ -> throwWithMarker (BySetInductionSyntacticMismatch loc)
- ByOrdInduction loc continue -> do
- setLocation loc
- goals <- gets checkingGoals
- case goals of
- Forall scope : goals' -> case fromScope scope of
- Implies (IsOrd loc' (TermVar (B _))) rhs -> do
- let zs = nubOrd (bindings scope)
- z <- case zs of
- [z'] -> pure z'
- _ -> throwWithMarker (AmbiguousInductionVar loc')
- checkFreshLocalVars "ordinal induction" [z]
- -- LATER: this is kinda sketchy:
- -- we now use the induction variable in two ways:
- -- we assume the induction hypothesis, where we recycle the induction variable both as a bound variable and a free variable
- -- we then need to show that under that hypothesis the claim holds for the free variable...
- let hypo = Forall (toScope (Implies (isElementOf (TermVar (B z)) (TermVar (F z))) rhs))
- addLocalVars (Set.singleton z)
- assume [Asm (IsOrd loc' (TermVar z)), Asm hypo]
- let goal' = unvar id id <$> rhs -- we "instantiate" the single bound variable on the rhs
- setGoals (goal' : goals')
- checkProof continue
- _ ->
- throwWithMarker
- (ByOrdInductionSyntacticMismatch loc)
- _ ->
- throwWithMarker
- (ByOrdInductionSyntacticMismatch loc)
- Assume loc phi continue -> do
- setLocation loc
- assertKnownFormulaVars "assumption step" phi
- goals' <- matchAssumptionWithGoal loc phi
- assume [Asm phi]
- setGoals goals'
- checkProof continue
- Fix loc xs suchThat continue -> do
- setLocation loc
- checkFreshLocalVars "fix step" (toList xs)
- fixing xs
- addLocalVars (Set.fromList (toList xs))
- unless (suchThat == Top) do
- assertKnownFormulaVars "fix constraint" suchThat
- checkProof case suchThat of
- Top -> continue
- _ -> Assume loc suchThat continue
- Subclaim loc subclaim subproof continue -> do
- setLocation loc
- assertKnownFormulaVars "subclaim" subclaim
- context <-
- BlockContext
- <$> gets stepLocation
- <*> gets blockLabel
- locally
- (checkLemmaWithProof
- context
- (Lemma [] subclaim)
- subproof)
- assume [Asm subclaim]
- checkProof continue
- Omitted loc -> do
- setLocation loc
- omitCurrentGoals loc
- Suffices loc reduction by proof -> do
- setLocation loc
- assertKnownFormulaVars "suffices step" reduction
- goals <- gets checkingGoals
- setGoals [reduction `Implies` makeConjunction goals]
- justify by
- setGoals [reduction]
- checkProof proof
- Take loc _witnesses _suchThat JustificationSetExt _continue -> do
- setLocation loc
- throwWithLocationAndMarker SetExtensionalityWithTake
- Take loc witnesses suchThat by continue -> locally do
- setLocation loc
- checkFreshLocalVars "take step" (toList witnesses)
- known <- gets localVars
- assertKnownFormulaVarsWith "take witness statement" (known <> Set.fromList (toList witnesses)) suchThat
- goals <- gets checkingGoals
- setGoals [makeExists witnesses suchThat]
- justify by
- addLocalVars (Set.fromList (toList witnesses))
- assume [Asm suchThat]
- setGoals goals
- checkProof continue
- Have loc claim (JustificationRef ms) continue -> locally do
- setLocation loc
- assertKnownFormulaVars "claim" claim
- goals <- gets checkingGoals
- setGoals [claim]
- byRef ms -- locally prove things with just refs and local assumptions
- assume [Asm claim]
- setGoals goals
- checkProof continue
- Have loc claim JustificationLocal continue -> locally do
- setLocation loc
- assertKnownFormulaVars "claim" claim
- goals <- gets checkingGoals
- setGoals [claim]
- byAssumption -- locally prove things with just local assumptions
- assume [Asm claim]
- setGoals goals
- checkProof continue
- Have loc claim by continue -> do
- setLocation loc
- assertKnownFormulaVars "claim" claim
- locally do
- goals <- gets checkingGoals
- claims <- case by of
- JustificationEmpty ->
- pure [claim]
- JustificationSetExt ->
- splitGoalWithSetExt claim
- -- NOTE: we already handled @JustificationRef ms@ and GHC recognizes this
- setGoals claims
- tellTasks
- assume [Asm claim]
- setGoals goals
- checkProof continue
- Define loc x t continue -> locally do
- setLocation loc
- checkFreshLocalVars "definition step" [x]
- assertKnownTermVars "definition right-hand side" t
- addLocalVars (Set.singleton x)
- case t of
- TermSep y yBound phi ->
- assume [Asm $
- makeForall [y] $
- Iff (isElementOf (TermVar y) (TermVar x))
- ((isElementOf (TermVar y) yBound) `And` instantiate1 (TermVar y) phi)
- ]
- ReplacePred _y _x xBound scope -> do
- goals <- gets checkingGoals
- let x' = FreshVar 0
- let y = FreshVar 1
- let y' = FreshVar 2
- let fromReplacementVar = \case
- ReplacementDomVar -> TermVar x'
- ReplacementRangeVar -> TermVar y
- let fromReplacementVar' = \case
- ReplacementDomVar -> TermVar x'
- ReplacementRangeVar -> TermVar y'
- let phi = instantiate fromReplacementVar scope
- let psi = instantiate fromReplacementVar' scope
- let singleValued =
- makeForall [x'] $
- (TermVar x' `isElementOf` xBound) `Implies`
- makeForall [y, y'] (((phi `And` psi) `Implies` (TermVar y `equals` TermVar y')))
- setGoals [singleValued]
- tellTasks
-
- -- Now we restore the goals, which should already be canonical, so we don't need to canonicalize them again.
- modify (\st -> st{checkingGoals = goals})
- assume [Asm $
- makeForall [y] $
- (TermVar y `isElementOf` TermVar x)
- `Iff`
- makeExists [x'] ((TermVar x' `isElementOf` xBound) `And` phi)
- ]
- ReplaceFun bounds lhs cond ->
- assume [Asm (makeReplacementIff (TermVar (F x)) bounds lhs cond)]
- _ ->
- assume [Asm (Equals loc (TermVar x) t)]
- checkProof continue
- DefineFunction loc funVar argVar valueExpr domExpr continue -> do
- setLocation loc
- checkFreshLocalVars "function definition" [funVar]
- checkBinderVarsFresh "function definition" [argVar]
- when (funVar == argVar) do
- throwCheckingError "function definition uses the same variable for the function and its argument"
- known <- gets localVars
- assertKnownTermVarsWith "function definition domain" known domExpr
- assertKnownTermVarsWith "function definition value" (Set.insert argVar known) valueExpr
- addLocalVars (Set.singleton funVar)
- -- we're given f, x, e, d
- assume
- [ Asm (Equals loc (TermOp Nowhere DomSymbol [TermVar funVar]) domExpr) -- dom(f) = d
- , Asm (makeForall [argVar] ((isElementOf (TermVar argVar) domExpr) `Implies` (Equals Nowhere (TermOp Nowhere ApplySymbol [TermVar funVar, TermVar argVar]) valueExpr))) -- f(x) = e for all x\in d
- , Asm (rightUniqueAdj loc (TermVar funVar))
- , Asm (relationNoun loc (TermVar funVar))
- ]
- checkProof continue
- Calc loc quant calc continue -> do
- setLocation loc
- for_ (calculation quant calc) \(goal, _) ->
- assertKnownFormulaVars "calculation step" goal
- assertKnownFormulaVars "calculation result" (calcResult quant calc)
- checkCalc quant calc
- assume [Asm (calcResult quant calc)]
- checkProof continue
- DefineFunctionLocal loc funVar argVar domVar ranExpr definitions continue -> do -- TODO refactor
- setLocation loc
- checkFreshLocalVars "local function definition" [funVar]
- checkBinderVarsFresh "local function definition" [argVar]
- when (funVar == argVar) do
- throwCheckingError "local function definition uses the same variable for the function and its argument"
- known <- gets localVars
- assertKnownFormulaVarsWith "local function definition range" known ranExpr
- let knownWithArg = Set.insert argVar known
- for_ definitions \(expr, frm) -> do
- assertKnownTermVarsWith "local function definition case expression" knownWithArg expr
- assertKnownFormulaVarsWith "local function definition case condition" knownWithArg frm
- unless (domVar `Set.member` known) do
- throwCheckingError ("local function definition domain variable is not in scope: " <> formatVars (Set.singleton domVar))
- addLocalVars (Set.singleton funVar)
- -- We have f: X \to Y and x \mapsto ...
- -- definition is a nonempty list of (expresssion e, formula phi)
- -- such that f(x) = e if phi(x)
- -- since we do a case deduction in the definition there has to be a check that,
- -- our domains in the case are a disjunct union of dom(f)
- assume
- [Asm (Equals Nowhere (TermOp Nowhere DomSymbol [TermVar funVar]) (TermVar domVar))
- ,Asm (rightUniqueAdj Nowhere (TermVar funVar))
- ,Asm (relationNoun Nowhere (TermVar funVar))]
-
- goals <- gets checkingGoals
- setGoals [makeForall [argVar] ((isElementOf (TermVar argVar) (TermVar domVar)) `Iff` localFunctionGoal definitions)]
- tellTasks
-
- locals <- gets localVars
- assume [Asm (makeForall [argVar] (isElementOf (TermVar argVar) (TermVar domVar) `Implies` isElementOf (TermOp Nowhere ApplySymbol [TermVar funVar, TermVar argVar]) ranExpr))] -- function f from \dom(f) \to \ran(f)
- assume (functionSubdomianExpression funVar argVar domVar locals (NonEmpty.toList definitions)) --behavior on the subdomians
- setGoals goals
- checkProof continue
-
--- |Creats the Goal \forall x. x \in dom{f} \iff (phi_{1}(x) \xor (\phi_{2}(x) \xor (... \xor (\phi_{n}) ..)))
--- where the phi_{i} are the subdomain statments
-localFunctionGoal :: NonEmpty (Term,Formula) -> Formula
-localFunctionGoal xs = makeXor $ map snd $ NonEmpty.toList xs
-
-
--- We have our list of expr and forumlas, in this case normaly someone would write
--- f(x) = ....cases
--- & (\frac{1}{k} \cdot x) &\text{if} x \in \[k, k+1\)
---
--- since we have to bind all globaly free Varibels we generate following asumptions.
---
--- For x \mapsto expr(x,ys,cs) , if formula(x,ys) ; here cs are just global constants
--- -> \forall x,ys: ( formula(x,ys) => expr(x,ys,cs))
-
-
-functionSubdomianExpression :: VarSymbol -> VarSymbol -> VarSymbol -> Set VarSymbol -> [(Term, Formula)] -> [Asm]
-functionSubdomianExpression f a d s (x:xs) = singleFunctionSubdomianExpression f a d s x : functionSubdomianExpression f a d s xs
-functionSubdomianExpression _ _ _ _ [] = []
-
-singleFunctionSubdomianExpression :: VarSymbol -> VarSymbol -> VarSymbol -> Set VarSymbol -> (Term, Formula) -> Asm
-singleFunctionSubdomianExpression funVar argVar domVar fixedV (expr, frm) = let
- -- boundVar = Set.toList (freeVars expr) in
- -- let def = makeForall (argVar:boundVar) (((TermVar argVar `IsElementOf` TermVar domVar) `And` frm) `Implies` TermOp ApplySymbol [TermVar funVar, TermVar argVar] `Equals` expr)
- boundVar = fixedV in
- let def = forallClosure boundVar (((isElementOf (TermVar argVar) (TermVar domVar)) `And` frm) `Implies` Equals Nowhere (TermOp Nowhere ApplySymbol [TermVar funVar, TermVar argVar]) expr)
- in Asm def
-
-
-
-checkCalc :: CalcQuantifier -> Calc -> Checking
-checkCalc quant calc = locally do
- let tasks = calculation quant calc
- forM_ tasks tell
- where
- tell = \case
- (goal, by) -> setGoals [goal] *> justify by
-
-
-makeReplacementIff
- :: forall a. (ExprOf (Var VarSymbol a) -- ^ Newly defined local constant.
- -> NonEmpty (VarSymbol, ExprOf a) -- ^ Bounds of the replacement.
- -> Scope VarSymbol ExprOf a -- ^ Left hand side (function application).
- -> Scope VarSymbol ExprOf a -- ^ Optional constraints on bounds (can just be 'Top').
- -> ExprOf a)
-makeReplacementIff e bounds lhs cond =
- Forall (toScope (Iff (isElementOf (TermVar (B "frv")) e) existsPreimage))
- where
- existsPreimage :: ExprOf (Var VarSymbol a)
- existsPreimage = Exists (toScope replaceBound)
-
- replaceBound :: ExprOf (Var VarSymbol (Var VarSymbol a))
- replaceBound = makeConjunction [isElementOf (TermVar (B x)) (F . F <$> xB) | (x, xB) <- toList bounds] `And` replaceCond
-
- replaceEq :: ExprOf (Var VarSymbol (Var VarSymbol a))
- replaceEq = Equals Nowhere (nestF <$> fromScope lhs) (TermVar (F (B "frv")))
-
- replaceCond :: ExprOf (Var VarSymbol (Var VarSymbol a))
- replaceCond = case fromScope cond of
- Top -> replaceEq
- cond' -> replaceEq `And` (nestF <$> cond')
-
- nestF :: Var b a1 -> Var b (Var b1 a1)
- nestF (B a) = B a
- nestF (F a) = F (F a)
-
-
-splitGoalWithSetExt :: Formula -> CheckingM [Formula]
-splitGoalWithSetExt = \case
- NotEquals loc x y -> do
- let z = FreshVar 0
- elemNotElem x' y' = makeExists [FreshVar 0] (And (IsElementOf loc (TermVar z) x') (isNotElementOf loc (TermVar z) y'))
- pure [elemNotElem x y `Or` elemNotElem y x]
- Equals loc x y -> do
- let z = FreshVar 0
- subset x' y' = makeForall [FreshVar 0] (Implies (IsElementOf loc (TermVar z) x') (IsElementOf loc (TermVar z) y'))
- pure [subset x y, subset y x]
- goal -> throwWithLocationAndMarker (MismatchedSetExt [goal])
-
-justify :: Justification -> Checking
-justify = \case
- JustificationEmpty -> tellTasks
- JustificationLocal -> byAssumption
- JustificationRef ms -> byRef ms
- JustificationSetExt -> do
- goals <- gets checkingGoals
- case goals of
- [goal] -> do
- goals' <- splitGoalWithSetExt goal
- setGoals goals'
- tellTasks
- _ -> throwWithLocationAndMarker (MismatchedSetExt goals)
-
-byRef :: NonEmpty Marker -> Checking
-byRef ms = locally do
- facts <- gets checkingFacts
- dumpPremselTraining <- gets checkingDumpPremselTraining
- case dumpPremselTraining of
- WithDumpPremselTraining -> dumpTrainingData facts ms
- WithoutDumpPremselTraining -> skip
- case Facts.restrictFactRegistry ms facts of
- Left (Marker str) ->
- throwWithLocationAndMarker
- (CheckingError ("unknown marker: " <> str))
- Right facts' -> modify (\st -> st{checkingFacts = facts'}) *> tellTasks
-
-byAssumption :: Checking
-byAssumption = locally do
- modify (\st -> st{checkingFacts = Facts.emptyFactRegistry}) *> tellTasks
-
-dumpTrainingData :: Facts.FactRegistry -> NonEmpty Marker -> Checking
-dumpTrainingData facts ms = do
- (picked, unpicked) <-
- case Facts.partitionFactRegistry ms facts of
- Left (Marker str) ->
- throwWithLocationAndMarker
- (CheckingError ("unknown marker: " <> str))
- Right partitioned ->
- pure partitioned
- goals <- gets checkingGoals
- Marker m_ <- gets blockLabel
- let dir = "premseldump"
- let makePath k = dir </> (Text.unpack m_ <> show (k :: Int)) <.> "txt"
- dumpTrainingExample goal =
- let prepared =
- prepareTrainingTptpTask
- goal
- (factHypotheses picked)
- (factHypotheses unpicked)
- k = hash goal
- example = preparedTptpTextNewline prepared
- in do
- liftIO (Text.writeFile (makePath k) example)
- liftIO (createDirectoryIfMissing True dir)
- forM_ goals dumpTrainingExample
-
--- | Since the case tactic replaces /all/ current goals with the disjunction
--- of the different case hypotheses, each case proof must cover all goals.
-checkCase :: Case -> Checking
-checkCase (Case split proof) = locally do
- assume [Asm split]
- checkProof proof
-
-
-checkDefn :: BlockContext -> Defn -> Checking
-checkDefn context defn = do
- let (ownerKind, definedSymbol, definitionAsms, definiens) = definitionParts defn
- dependencies <- checkedDefinitionDependencies definedSymbol definitionAsms definiens
- (prepared, soundnessGoals) <- prepareDefinitionFact context defn
- let staged =
- stagePreparedFact
- (blockContextLocation context)
- (blockContextMarker context)
- (blockContextMarker context)
- prepared
- st <- get
- committed <-
- either
- throwIO
- pure
- (commitDefinition
- context
- ownerKind
- definedSymbol
- dependencies
- staged
- st)
- unless (null soundnessGoals) do
- locally do
- modify \current ->
- current{checkingGoals = soundnessGoals}
- tellTasks
- putDeclarationCandidate committed
- setDeclarationFactProducers
- [ LegacyDeclarationRuleProducer
- (LegacyDefinitionRule
- LegacyDefinitionEquation)
- ]
-
-prepareDefinitionFact
- :: BlockContext
- -> Defn
- -> CheckingM (Facts.PreparedSemanticFact, [Formula])
-prepareDefinitionFact context = \case
- DefnPredicate asms symb vs f -> do
- -- We first need to take the universal closure of the defining formula
- -- while ignoring the variables that occur on the lhs, then take the
- -- universal formula of the equivalence, quantifying the remaining
- -- variables (from the lhs).
- let vs' = TermVar <$> toList vs
- let f' = forallClosure (Set.fromList (toList vs)) f
- prepared <-
- prepareWithAsms
- asms
- (Atomic location symb vs' `Iff` f')
- pure (prepared, [])
- DefnFun asms fun vs rhs -> do
- let lhs =
- TermSymbol location (SymbolFun fun) (TermVar <$> vs)
- prepared <-
- prepareWithAsms asms (Equals location lhs rhs)
- pure (prepared, [])
- DefnOp op vs (TermSep x bound phi) -> do
- let generated =
- makeForall (x : vs) $
- Iff (TermVar x `isElementOf` TermOp location op (TermVar <$> vs))
- ((TermVar x `isElementOf` bound) `And` instantiate1 (TermVar x) phi)
- prepared <- prepare generated
- pure (prepared, [])
- DefnOp op vs (TermSymbol _pos rhsSymbol [x, y]) | rhsSymbol == SymbolMixfix ConsSymbol -> do
- -- TODO generalize this to support arbitrarily many applications of _Cons
- -- and also handle the case of emptyset or singleton as final argument separately
- -- so that finite set terms get recognized in full.
- let phi =
- isElementOf
- (TermVar "any")
- (TermOp location op (TermVar <$> vs))
- let psi =
- (isElementOf (TermVar "any") y)
- `Or` (Equals location (TermVar "any") x)
- prepared <-
- prepare (makeForall ("any" : vs) (phi `Iff` psi))
- pure (prepared, [])
- DefnOp op vs (ReplacePred _y _x xBound scope) -> do
- let x = (FreshVar 0)
- let y = (FreshVar 1)
- let y' = (FreshVar 2)
- let fromReplacementVar = \case
- ReplacementDomVar -> TermVar x
- ReplacementRangeVar -> TermVar y
- let fromReplacementVar' = \case
- ReplacementDomVar -> TermVar x
- ReplacementRangeVar -> TermVar y'
- let phi = instantiate fromReplacementVar scope
- let psi = instantiate fromReplacementVar' scope
- let singleValued = makeForall [x] ((TermVar x `isElementOf` xBound) `Implies` makeForall [y, y'] ((phi `And` psi) `Implies` (TermVar y `equals` TermVar y')))
- let generated =
- makeForall (y : vs)
- ((TermVar y `isElementOf` TermOp Nowhere op (TermVar <$> vs))
- `Iff`
- makeExists [x] ((TermVar x `isElementOf` xBound) `And` phi))
- preparedGoal <- canonicalize singleValued
- prepared <- prepare generated
- pure (prepared, [preparedGoal])
- DefnOp op vs (ReplaceFun bounds lhs cond) -> do
- let generated = forallClosure mempty (makeReplacementIff (TermOp Nowhere op (TermVar . F <$> vs)) bounds lhs cond)
- prepared <- prepare generated
- pure (prepared, [])
- DefnOp op vs rhs ->
- if containsHigherOrderConstructs rhs
- then
- throwIO
- (CouldNotEliminateHigherOrder
- op
- rhs
- location
- (blockContextMarker context))
- else do
- let lhs = TermSymbol Nowhere (SymbolMixfix op) (TermVar <$> vs)
- prepared <-
- prepareWithAsms [] (Equals Nowhere lhs rhs)
- pure (prepared, [])
- where
- location =
- blockContextLocation context
-
- prepare formula =
- Facts.prepareSemanticFact <$> canonicalize formula
-
- prepareWithAsms asms formula =
- Facts.prepareSemanticFact
- <$> canonicalizedFactWithAsms asms formula
-
--- | Validate and commit every state row introduced by one definition.
-commitDefinition
- :: BlockContext
- -> SymbolOwnerKind
- -> Symbol
- -> Set Symbol
- -> Facts.StagedFact
- -> CheckingState
- -> Either CheckingError CheckingState
-commitDefinition context ownerKind symbol dependencies staged st = do
- markers' <-
- validatedMarkers location [marker] st
- validateOwnedDependenciesAt
- context
- (checkingOwnedSymbols st)
- dependencies
- (owners', ownedMarkers', dependencies') <-
- validatedSymbolRegistration
- context
- ownerKind
- symbol
- dependencies
- st
- validatePreparedSemanticFact
- context
- owners'
- dependencies'
- (Facts.stagedFactSemantic staged)
- facts' <-
- first
- (DuplicateMarker location)
- (Facts.registerStagedFacts
- (staged :| [])
- (checkingFacts st))
- pure
- st
- { checkingFacts = facts'
- , checkingDependencies = dependencies'
- , checkingOwnedSymbols = owners'
- , checkingOwnedSymbolMarkers = ownedMarkers'
- , definedMarkers = markers'
- , blockLabel = marker
- , stepLocation = location
- , checkingHypothesisCounter = 0
- }
- where
- location =
- blockContextLocation context
- marker =
- blockContextMarker context
-
-
-checkSig :: BlockContext -> [Asm] -> Signature -> Checking
-checkSig context asms signature = do
- (ownerKind, symbol, staged, typedCoreType) <- case signature of
- SignatureFormula formula -> do
- symbol <-
- maybe
- (throwIO
- (checkingErrorAt
- context
- "could not recover the declared symbol from SignatureFormula"))
- pure
- (recoverSignatureFormulaSymbol formula)
- prepared <-
- Facts.prepareSemanticFact
- <$> canonicalizedFactWithAsms asms formula
- pure
- ( OwnedBySignatureFormula
- , symbol
- , Just
- (stagePreparedFact
- (blockContextLocation context)
- (blockContextMarker context)
- (blockContextMarker context)
- prepared)
- , Nothing
- )
- SignaturePredicate predicate variables ->
- pure
- ( OwnedBySignaturePredicate
- , SymbolPredicate predicate
- , Nothing
- , Just
- (foldr
- Core.TyArrow
- Core.TyProp
- (replicate
- (length variables)
- Core.TySet))
- )
- st <- get
- committed <-
- either
- throwIO
- pure
- (commitSignature context ownerKind symbol staged st)
- transitionBuilder' <-
- case typedCoreType of
- Nothing ->
- pure
- (checkingTransitionModuleBuilder
- committed)
- Just coreType ->
- traverse
- (either
- (throwIO
- . checkingErrorAt
- context
- . ("typed signature registration failed: "
- <>)
- . Text.pack
- . show)
- pure
- . Transition.commitTransitionOpaqueGlobal
- symbol
- coreType
- (Transition.origin
- (blockContextLocation context)
- Nothing
- (Just
- (blockContextMarker
- context))))
- (checkingTransitionModuleBuilder
- committed)
- putDeclarationCandidate
- committed
- { checkingTransitionModuleBuilder =
- transitionBuilder'
- }
- setDeclarationFactProducers
- (case staged of
- Nothing ->
- []
- Just _ ->
- [ LegacyDeclaredAssumptionProducer
- OpaqueAssumption
- ])
-
--- | Validate and commit every state row introduced by one signature.
-commitSignature
- :: BlockContext
- -> SymbolOwnerKind
- -> Symbol
- -> Maybe Facts.StagedFact
- -> CheckingState
- -> Either CheckingError CheckingState
-commitSignature context ownerKind symbol staged st = do
- markers' <-
- validatedMarkers location [marker] st
- (owners', ownedMarkers', dependencies') <-
- validatedSymbolRegistration
- context
- ownerKind
- symbol
- mempty
- st
- facts' <-
- case staged of
- Nothing ->
- Right (checkingFacts st)
- Just fact -> do
- validatePreparedSemanticFact
- context
- owners'
- dependencies'
- (Facts.stagedFactSemantic fact)
- first
- (DuplicateMarker location)
- (Facts.registerStagedFacts
- (fact :| [])
- (checkingFacts st))
- pure
- st
- { checkingFacts = facts'
- , checkingDependencies = dependencies'
- , checkingOwnedSymbols = owners'
- , checkingOwnedSymbolMarkers = ownedMarkers'
- , definedMarkers = markers'
- , blockLabel = marker
- , stepLocation = location
- , checkingHypothesisCounter = 0
- }
- where
- location =
- blockContextLocation context
- marker =
- blockContextMarker context
-
-recoverSignatureFormulaSymbol :: Formula -> Maybe Symbol
-recoverSignatureFormulaSymbol = \case
- Forall scope
- | [boundVar] <- nubOrd (bindings scope) ->
- case fromScope scope of
- Equals _ (TermVar (B lhsVar)) (TermSymbol _ symbol@(SymbolMixfix _) _args) `Implies` _
- | lhsVar == boundVar ->
- Just symbol
- _ ->
- Nothing
- | otherwise ->
- Nothing
- _ ->
- Nothing
-
-mergeAssumptions :: [Asm] -> CheckingM ([Formula], StructContext)
-mergeAssumptions asms = do
- ctx <- assumptionStructContext asms
- phis <- traverse asmFormula asms
- pure (phis, ctx)
-
-asmFormula :: Asm -> CheckingM Formula
-asmFormula = \case
- Asm phi ->
- pure phi
- AsmStruct x phrase ->
- pure (structPredicate x phrase)
-
-canonicalize :: Formula -> CheckingM Formula
-canonicalize phi = do
- ctx <- gets checkingStructContext
- canonicalizeWith ctx phi
-
--- | Canonicalize using an explicit structure context instead of the checker state's current one.
-canonicalizeWith :: StructContext -> Formula -> CheckingM Formula
-canonicalizeWith ctx phi = do
- blockContext <-
- BlockContext
- <$> gets stepLocation
- <*> gets blockLabel
- canonicalizeWithAt blockContext ctx phi
-
-canonicalizeWithAt
- :: BlockContext
- -> StructContext
- -> Formula
- -> CheckingM Formula
-canonicalizeWithAt blockContext ctx phi = do
- phi' <- unabbreviate phi
- desugarComprehensionsAt
- blockContext
- (annotateWithStructContext ctx phi')
-
-annotateWithStructContext :: StructContext -> Formula -> Formula
-annotateWithStructContext StructContext{..} =
- annotateWith structContextLabels structContextOps
-
-unabbreviate :: ExprOf a -> CheckingM (ExprOf a)
-unabbreviate phi = do
- abbrs <- gets checkingAbbreviations
- pure (unabbreviateWith ((absurd <$>) <$> abbrs) phi)
-
-
-data CheckedInductive = CheckedInductive
- { checkedInductiveSymbol :: FunctionSymbol
- , checkedInductiveParams :: [VarSymbol]
- , checkedInductiveDomain :: Expr
- , checkedInductiveIntros :: NonEmpty CheckedInductiveIntro
- }
-
-data CheckedInductiveIntro = CheckedInductiveIntro
- { checkedInductiveIntroVars :: [VarSymbol]
- , checkedInductiveIntroConditions :: [CheckedInductiveCondition]
- , checkedInductiveIntroResultTerm :: Term
- }
-
-data CheckedInductiveCondition
- = CheckedInductiveSideCondition Formula
- | CheckedInductiveRecursiveCondition
- { checkedInductiveRecursiveTerm :: Term
- , checkedInductiveRecursiveCarrierTemplate :: Scope VarSymbol ExprOf VarSymbol
- , checkedInductiveRecursiveDirect :: Bool
- }
-
-checkInductive :: BlockContext -> Inductive -> Checking
-checkInductive context inductive = do
- st <- get
- either
- throwIO
- pure
- (validateInductiveHeader
- context
- (SymbolMixfix (inductiveSymbol inductive))
- st)
- checked <- normalizeInductive inductive
- case checkingTransitionModuleBuilder st of
- Nothing ->
- checkLegacyInductive context checked st
- Just builder ->
- checkTypedInductive
- context
- checked
- builder
- st
-
-checkLegacyInductive
- :: BlockContext
- -> CheckedInductive
- -> CheckingState
- -> Checking
-checkLegacyInductive context checked st = do
- soundnessGoals <-
- traverse canonicalize (inductiveSoundnessGoals checked)
- stagedFacts <-
- traverse
- (\(factMarker, formula) -> do
- canonical <- canonicalize formula
- pure
- (stagePreparedFact
- (blockContextLocation context)
- (blockContextMarker context)
- factMarker
- (Facts.prepareSemanticFact canonical)))
- (inductiveFacts
- (blockContextMarker context)
- checked)
- committed <-
- either
- throwIO
- pure
- (commitInductive
- context
- checked
- stagedFacts
- st)
- unless (null soundnessGoals) do
- locally do
- modify \current ->
- current{checkingGoals = soundnessGoals}
- tellTasks
- putDeclarationCandidate committed
- setDeclarationFactProducers
- ( LegacyDeclarationRuleProducer
- . LegacyInductiveRule
- <$> inductiveFactRoles checked
- )
-
-checkTypedInductive
- :: BlockContext
- -> CheckedInductive
- -> Transition.TransitionModuleBuilder
- -> CheckingState
- -> Checking
-checkTypedInductive context checked builder st = do
- direct <-
- either
- throwIO
- pure
- (directInductive context checked)
- prepared <-
- either
- ( throwIO
- . typedInductiveError
- context
- "typed inductive preparation failed: "
- )
- pure
- (TypedInductive.prepareTypedInductive
- Transition.checkedGlobalType
- (Transition.transitionBuilderFoundation
- builder)
- (typedSourceGlobal builder)
- (blockContextMarker context)
- direct)
- imports <-
- Vector.fromList
- <$> traverse
- (uncurry
- (typedInductiveGuardImport
- context
- builder))
- (zip
- [1 :: Int ..]
- (Vector.toList
- (TypedInductive.typedInductiveGuardTargets
- prepared)))
- builderWithCarrier <-
- either
- ( throwIO
- . typedInductiveError
- context
- "typed inductive carrier registration failed: "
- )
- pure
- (Transition.commitTransitionTransparentGlobal
- (SymbolMixfix
- (checkedInductiveSymbol checked))
- (TypedInductive.typedInductiveCarrierType
- prepared)
- (TypedInductive.typedInductiveCarrierBody
- prepared)
- (typedFactOrigin context)
- builder)
- builder' <-
- foldM
- (commitTypedInductiveFact
- context
- imports)
- builderWithCarrier
- (TypedInductive.typedInductiveFacts
- prepared)
- committed <-
- either
- throwIO
- pure
- (commitTypedInductiveState
- context
- checked
- (TypedInductive.typedInductiveFactMarker
- <$> TypedInductive.typedInductiveFacts
- prepared)
- builder'
- st)
- putDeclarationCandidate committed
- setDeclarationFactProducers []
-
-directInductive
- :: BlockContext
- -> CheckedInductive
- -> Either CheckingError TypedInductive.DirectInductive
-directInductive context checked =
- TypedInductive.DirectInductive
- (checkedInductiveParams checked)
- (checkedInductiveDomain checked)
- <$> traverse directClause
- (checkedInductiveIntros checked)
- where
- directClause intro =
- TypedInductive.DirectInductiveClause
- (checkedInductiveIntroVars intro)
- <$> traverse directCondition
- (checkedInductiveIntroConditions intro)
- <*> pure
- (checkedInductiveIntroResultTerm intro)
-
- directCondition = \case
- CheckedInductiveSideCondition formula ->
- Right
- (TypedInductive.DirectSideCondition
- formula)
- CheckedInductiveRecursiveCondition
- { checkedInductiveRecursiveTerm
- , checkedInductiveRecursiveDirect = True
- } ->
- Right
- (TypedInductive.DirectRecursiveCondition
- checkedInductiveRecursiveTerm)
- CheckedInductiveRecursiveCondition{} ->
- Left
- (checkingErrorAt context
- "nested inductive recursion is not supported by the typed set-valued inductive slice")
-
-typedSourceGlobal
- :: Transition.TransitionModuleBuilder
- -> Symbol
- -> Maybe
- (TypedInductive.SourceGlobal
- Transition.CheckedGlobalRef)
-typedSourceGlobal builder symbol = do
- reference <-
- Transition.lookupTransitionGlobal
- symbol
- builder
- pure
- (TypedInductive.SourceGlobal
- reference
- (Transition.lookupTransitionGlobalBody
- symbol
- builder))
-
-typedInductiveGuardImport
- :: BlockContext
- -> Transition.TransitionModuleBuilder
- -> Int
- -> Core.FrozenCheckedCore
- Transition.CheckedGlobalRef
- -> CheckingM Transition.TransitionDerivationImport
-typedInductiveGuardImport
- context
- builder
- ordinal
- target = do
- found <-
- either
- ( throwIO
- . typedInductiveError
- context
- "typed inductive guard lookup failed: "
- )
- pure
- (Transition.lookupTransitionTypedImport
- target
- builder)
- maybe
- (throwIO
- (checkingErrorAt context
- ( "typed inductive domain guard "
- <> Text.pack (show ordinal)
- <> " has no authorized typed fact"
- )))
- pure
- found
-
-commitTypedInductiveFact
- :: BlockContext
- -> Vector Transition.TransitionDerivationImport
- -> Transition.TransitionModuleBuilder
- -> TypedInductive.PreparedTypedInductiveFact
- Transition.CheckedGlobalRef
- -> CheckingM Transition.TransitionModuleBuilder
-commitTypedInductiveFact context imports builder fact = do
- either
- ( throwIO
- . typedInductiveError
- context
- "typed inductive fact admission failed: "
- )
- pure
- (Transition.commitTransitionKernelFactWithImports
- (TypedInductive.typedInductiveFactMarker
- fact
- :| [])
- (typedFactOrigin context)
- imports
- (TypedInductive.typedInductiveFactTarget
- fact)
- (TypedInductive.typedInductiveFactDerivation
- fact)
- builder)
-
-commitTypedInductiveState
- :: BlockContext
- -> CheckedInductive
- -> NonEmpty Marker
- -> Transition.TransitionModuleBuilder
- -> CheckingState
- -> Either CheckingError CheckingState
-commitTypedInductiveState
- context
- checked
- factMarkers
- builder
- st = do
- markers' <-
- validatedMarkers
- location
- (marker : NonEmpty.toList factMarkers)
- st
- (owners', ownedMarkers', dependencies') <-
- validatedSymbolRegistration
- context
- OwnedByInductiveDefinition
- carrier
- mempty
- st
- frozenSymbols <-
- first
- ( checkingErrorAt context
- . ("inductive specification mentions unknown symbol " <>)
- . symbolText
- )
- (checkedInductiveFrozenSymbols
- dependencies'
- checked)
- let frozen =
- HM.fromList
- [ (symbol, marker)
- | symbol <- Set.toList frozenSymbols
- , ownableSymbol symbol
- ]
- pure
- st
- { checkingDependencies = dependencies'
- , checkingOwnedSymbols = owners'
- , checkingOwnedSymbolMarkers = ownedMarkers'
- , checkingFrozenSymbols =
- HM.union
- (checkingFrozenSymbols st)
- frozen
- , definedMarkers = markers'
- , blockLabel = marker
- , stepLocation = location
- , checkingHypothesisCounter = 0
- , checkingTransitionModuleBuilder =
- Just builder
- }
- where
- location =
- blockContextLocation context
- marker =
- blockContextMarker context
- carrier =
- SymbolMixfix
- (checkedInductiveSymbol checked)
-
-typedInductiveError
- :: Show error
- => BlockContext
- -> Text
- -> error
- -> CheckingError
-typedInductiveError context prefix =
- checkingErrorAt context
- . (prefix <>)
- . Text.pack
- . show
-
-validateInductiveHeader
- :: BlockContext
- -> Symbol
- -> CheckingState
- -> Either CheckingError ()
-validateInductiveHeader context carrier st = do
- void
- (validatedMarkers
- (blockContextLocation context)
- [blockContextMarker context]
- st)
- void
- (validatedSymbolRegistration
- context
- OwnedByInductiveDefinition
- carrier
- mempty
- st)
-
--- | Validate and commit every state row introduced by one inductive.
-commitInductive
- :: BlockContext
- -> CheckedInductive
- -> NonEmpty Facts.StagedFact
- -> CheckingState
- -> Either CheckingError CheckingState
-commitInductive context checked stagedFacts st = do
- markers' <-
- validatedMarkers
- location
- (marker : factMarkers)
- st
- (owners', ownedMarkers', dependencies') <-
- validatedSymbolRegistration
- context
- OwnedByInductiveDefinition
- carrier
- mempty
- st
- frozenSymbols <-
- first
- ( checkingErrorAt context
- . ("inductive specification mentions unknown symbol " <>)
- . symbolText
- )
- (checkedInductiveFrozenSymbols
- dependencies'
- checked)
- traverse_
- (validatePreparedSemanticFact
- context
- owners'
- dependencies')
- (Facts.stagedFactSemantic <$> stagedFacts)
- facts' <-
- first
- (DuplicateMarker location)
- (Facts.registerStagedFacts
- stagedFacts
- (checkingFacts st))
- let frozen =
- HM.fromList
- [ (symbol, marker)
- | symbol <- Set.toList frozenSymbols
- , ownableSymbol symbol
- ]
- pure
- st
- { checkingFacts = facts'
- , checkingDependencies = dependencies'
- , checkingOwnedSymbols = owners'
- , checkingOwnedSymbolMarkers = ownedMarkers'
- , checkingFrozenSymbols =
- HM.union
- (checkingFrozenSymbols st)
- frozen
- , definedMarkers = markers'
- , blockLabel = marker
- , stepLocation = location
- , checkingHypothesisCounter = 0
- }
- where
- location =
- blockContextLocation context
- marker =
- blockContextMarker context
- carrier =
- SymbolMixfix (checkedInductiveSymbol checked)
- factMarkers =
- toList (stagedFacts >>= Facts.stagedFactAliases)
-
-normalizeInductive :: Inductive -> CheckingM CheckedInductive
-normalizeInductive Inductive{..} = do
- let duplicateParams = duplicateVars inductiveParams
- unless (Set.null duplicateParams) do
- throwCheckingError ("inductive parameters must be linear: " <> formatVars duplicateParams)
- checkedInductiveDomain <- canonicalize inductiveDomain
- let illegalDomainVars = freeVars checkedInductiveDomain `Set.difference` Set.fromList inductiveParams
- unless (Set.null illegalDomainVars) do
- throwCheckingError ("inductive domain may only mention the inductive parameters: " <> formatVars illegalDomainVars)
- when (mentionsSymbol (SymbolMixfix inductiveSymbol) checkedInductiveDomain) do
- throwCheckingError "inductive domain must be independent of the inductive symbol"
- checkedInductiveIntros <- traverse (normalizeInductiveIntro inductiveSymbol inductiveParams) inductiveIntros
- let checked =
- CheckedInductive
- { checkedInductiveSymbol = inductiveSymbol
- , checkedInductiveParams = inductiveParams
- , checkedInductiveDomain
- , checkedInductiveIntros
- }
- ensureInductiveDefinitionIndependence checked
- pure checked
-
-ensureInductiveDefinitionIndependence :: CheckedInductive -> Checking
-ensureInductiveDefinitionIndependence checked = do
- graph <- gets checkingDependencies
- let carrier = SymbolMixfix (checkedInductiveSymbol checked)
- externalSymbols =
- Set.filter ownableSymbol
- (Set.delete carrier (checkedInductiveMentionedSymbols checked))
- path <-
- either
- (\unknown ->
- throwCheckingError
- ("inductive specification mentions unknown symbol " <> symbolText unknown))
- pure
- (Dependencies.dependencyPath graph externalSymbols carrier)
- case path of
- Nothing ->
- skip
- Just path ->
- throwCheckingError
- ( "inductive specification mentions symbol "
- <> symbolText (NonEmpty.head path)
- <> " whose definition depends on the inductive symbol "
- <> functionSymbolText (checkedInductiveSymbol checked)
- <> " via "
- <> formatSymbolPath path
- )
-
-checkedInductiveFrozenSymbols
- :: Dependencies.DependencyRegistry
- -> CheckedInductive
- -> Either Symbol (Set Symbol)
-checkedInductiveFrozenSymbols graph checked =
- let seeds =
- Set.filter ownableSymbol
- (checkedInductiveMentionedSymbols checked)
- in Dependencies.dependencyClosure graph seeds
-
-normalizeInductiveIntro :: FunctionSymbol -> [VarSymbol] -> IntroRule -> CheckingM CheckedInductiveIntro
-normalizeInductiveIntro symbol params IntroRule{introConditions, introResult} = do
- introConditions' <- traverse canonicalize introConditions
- introResult' <- canonicalize introResult
- checkedInductiveIntroConditions <- traverse (normalizeInductiveCondition symbol params) introConditions'
- checkedInductiveIntroResultTerm <- normalizeInductiveResult symbol params introResult'
- let paramSet = Set.fromList params
- checkedInductiveIntroVars =
- List.filter (`Set.notMember` paramSet) (orderedUniqueVars (concatMap toList introConditions' <> toList checkedInductiveIntroResultTerm))
- pure CheckedInductiveIntro
- { checkedInductiveIntroVars
- , checkedInductiveIntroConditions
- , checkedInductiveIntroResultTerm
- }
-
-normalizeInductiveResult :: FunctionSymbol -> [VarSymbol] -> Formula -> CheckingM Term
-normalizeInductiveResult symbol params = \case
- IsElementOf _ resultTerm carrier
- | not (matchesInductiveCarrier symbol (TermVar <$> params) carrier) ->
- throwCheckingError "inductive rule result must have the form t \\in F(args)"
- | mentionsSymbol (SymbolMixfix symbol) resultTerm ->
- throwCheckingError "inductive rule result term must not mention the inductive symbol"
- | otherwise ->
- pure resultTerm
- _ ->
- throwCheckingError "inductive rule result must have the form t \\in F(args)"
-
-normalizeInductiveCondition :: FunctionSymbol -> [VarSymbol] -> Formula -> CheckingM CheckedInductiveCondition
-normalizeInductiveCondition symbol params phi
- | not (mentionsSymbol (SymbolMixfix symbol) phi) =
- pure (CheckedInductiveSideCondition phi)
- | otherwise = case phi of
- IsElementOf _ recursiveTerm recursiveCarrier -> do
- when (mentionsSymbol (SymbolMixfix symbol) recursiveTerm) do
- throwCheckingError "inductive recursive occurrence must appear in the carrier of a membership premise"
- let placeholder =
- freshGeneratedVar
- (freeVars phi <> Set.fromList params)
- "__inductive"
- -- Ordinary definitions are tracked separately through the top-level
- -- freshness/dependency checks. At this stage we only decompose the
- -- explicit recursive carrier occurrence that remains in the premise.
- recursiveCarrierTemplateExpr <-
- either throwCheckingError pure
- (replaceInductiveApplications symbol (TermVar <$> params) (TermVar placeholder) recursiveCarrier)
- let checkedInductiveRecursiveDirect = recursiveCarrierTemplateExpr == TermVar placeholder
- pure CheckedInductiveRecursiveCondition
- { checkedInductiveRecursiveTerm = recursiveTerm
- , checkedInductiveRecursiveCarrierTemplate = abstractVarSymbol placeholder recursiveCarrierTemplateExpr
- , checkedInductiveRecursiveDirect
- }
- _ ->
- throwCheckingError "inductive recursive premise must be a direct membership condition"
-
-replaceInductiveApplications :: Eq a => FunctionSymbol -> [ExprOf a] -> ExprOf a -> ExprOf a -> Either Text (ExprOf a)
-replaceInductiveApplications symbol targetArgs replacement =
- go targetArgs replacement
- where
- go :: Eq a => [ExprOf a] -> ExprOf a -> ExprOf a -> Either Text (ExprOf a)
- go liftedArgs liftedReplacement = \case
- TermVar x ->
- Right (TermVar x)
- TermSymbol loc sym args
- | sym == SymbolMixfix symbol && sameInductiveArgs liftedArgs args ->
- Right liftedReplacement
- | sym == SymbolMixfix symbol ->
- Left ("inductive symbol " <> functionSymbolText symbol <> " occurred with the wrong arguments")
- | otherwise ->
- TermSymbol loc sym <$> traverse (go liftedArgs liftedReplacement) args
- TermSymbolStruct structSymbol expr ->
- TermSymbolStruct structSymbol <$> traverse (go liftedArgs liftedReplacement) expr
- Apply expr args ->
- Apply <$> go liftedArgs liftedReplacement expr <*> traverse (go liftedArgs liftedReplacement) args
- TermSep x bound scope -> do
- bound' <- go liftedArgs liftedReplacement bound
- scope' <- go (map (F <$>) liftedArgs) (F <$> liftedReplacement) (fromScope scope)
- pure (TermSep x bound' (toScope scope'))
- ReplacePred y x bound scope -> do
- bound' <- go liftedArgs liftedReplacement bound
- scope' <- go (map (F <$>) liftedArgs) (F <$> liftedReplacement) (fromScope scope)
- pure (ReplacePred y x bound' (toScope scope'))
- ReplaceFun bounds lhs cond -> do
- bounds' <- traverse (\(x, bound) -> do
- bound' <- go liftedArgs liftedReplacement bound
- pure (x, bound')) bounds
- lhs' <- go (map (F <$>) liftedArgs) (F <$> liftedReplacement) (fromScope lhs)
- cond' <- go (map (F <$>) liftedArgs) (F <$> liftedReplacement) (fromScope cond)
- pure (ReplaceFun bounds' (toScope lhs') (toScope cond'))
- Connected conn left right ->
- Connected conn <$> go liftedArgs liftedReplacement left <*> go liftedArgs liftedReplacement right
- Lambda scope -> do
- scope' <- go (map (F <$>) liftedArgs) (F <$> liftedReplacement) (fromScope scope)
- pure (Lambda (toScope scope'))
- Quantified quant scope -> do
- scope' <- go (map (F <$>) liftedArgs) (F <$> liftedReplacement) (fromScope scope)
- pure (Quantified quant (toScope scope'))
- PropositionalConstant p ->
- Right (PropositionalConstant p)
- Not loc expr ->
- Not loc <$> go liftedArgs liftedReplacement expr
-
-matchesInductiveCarrier :: Eq a => FunctionSymbol -> [ExprOf a] -> ExprOf a -> Bool
-matchesInductiveCarrier symbol targetArgs = \case
- TermSymbol _loc (SymbolMixfix symbol') args ->
- symbol == symbol' && sameInductiveArgs targetArgs args
- _ ->
- False
-
-sameInductiveArgs :: Eq a => [ExprOf a] -> [ExprOf a] -> Bool
-sameInductiveArgs left right =
- length left == length right && and (zipWith equivalent left right)
-
-orderedUniqueVars :: Ord a => [a] -> [a]
-orderedUniqueVars =
- reverse . snd . foldl' step (Set.empty, [])
- where
- step (seen, acc) x
- | x `Set.member` seen = (seen, acc)
- | otherwise = (Set.insert x seen, x : acc)
-
-inductiveCarrierTerm :: CheckedInductive -> Expr
-inductiveCarrierTerm CheckedInductive{checkedInductiveSymbol, checkedInductiveParams} =
- TermOp Nowhere checkedInductiveSymbol (TermVar <$> checkedInductiveParams)
-
-inductiveConditionFormula :: CheckedInductive -> CheckedInductiveCondition -> Formula
-inductiveConditionFormula checked =
- inductiveConditionFormulaAt checked (inductiveCarrierTerm checked)
-
-inductiveConditionFormulaAt :: CheckedInductive -> Expr -> CheckedInductiveCondition -> Formula
-inductiveConditionFormulaAt _ replacement = \case
- CheckedInductiveSideCondition phi ->
- phi
- CheckedInductiveRecursiveCondition{checkedInductiveRecursiveTerm, checkedInductiveRecursiveCarrierTemplate} ->
- isElementOf checkedInductiveRecursiveTerm (instantiate1 replacement checkedInductiveRecursiveCarrierTemplate)
-
-semanticSubsetFormula :: Set VarSymbol -> Expr -> Expr -> Formula
-semanticSubsetFormula reserved left right =
- makeForall [witnessVar]
- (isElementOf (TermVar witnessVar) left `Implies` isElementOf (TermVar witnessVar) right)
- where
- witnessVar = freshGeneratedVar (reserved <> freeVars left <> freeVars right) "x"
-
-inductiveSoundnessGoals :: CheckedInductive -> [Formula]
-inductiveSoundnessGoals checked =
- inductiveMonotonicityGoals checked <> inductiveDomainGoals checked
-
-inductiveMonotonicityGoals :: CheckedInductive -> [Formula]
-inductiveMonotonicityGoals checked =
- [ forallIfNeeded [leftVar, rightVar]
- ( semanticSubsetFormula usedVars (TermVar leftVar) (TermVar rightVar)
- `Implies`
- semanticSubsetFormula usedVars
- (instantiate1 (TermVar leftVar) checkedInductiveRecursiveCarrierTemplate)
- (instantiate1 (TermVar rightVar) checkedInductiveRecursiveCarrierTemplate)
- )
- | intro <- NonEmpty.toList (checkedInductiveIntros checked)
- , CheckedInductiveRecursiveCondition{checkedInductiveRecursiveCarrierTemplate, checkedInductiveRecursiveDirect} <- checkedInductiveIntroConditions intro
- , not checkedInductiveRecursiveDirect
- ]
- where
- usedVars = inductiveUsedVars checked
- leftVar = freshGeneratedVar usedVars "xa"
- rightVar = freshGeneratedVar (Set.insert leftVar usedVars) "xb"
-
-inductiveDomainGoals :: CheckedInductive -> [Formula]
-inductiveDomainGoals checked =
- [ forallIfNeeded (orderedUniqueVars (checkedInductiveParams checked <> checkedInductiveIntroVars intro))
- (impliesFrom premises conclusion)
- | intro <- NonEmpty.toList (checkedInductiveIntros checked)
- , let premises = inductiveConditionFormulaAt checked (checkedInductiveDomain checked) <$> checkedInductiveIntroConditions intro
- conclusion = isElementOf (checkedInductiveIntroResultTerm intro) (checkedInductiveDomain checked)
- ]
-
-inductiveFacts
- :: Marker
- -> CheckedInductive
- -> NonEmpty (Marker, Formula)
-inductiveFacts marker checked =
- inductiveIntroFacts marker checked
- <> ( ( inductiveDomSubsetMarker marker
- , inductiveDomSubsetFormula checked
- )
- :| [ ( inductiveCasesMarker marker
- , inductiveCasesFormula checked
- )
- , ( inductiveInductMarker marker
- , inductiveInductFormula checked
- )
- ]
- )
-
-inductiveFactRoles
- :: CheckedInductive
- -> [LegacyInductiveFactRole]
-inductiveFactRoles checked =
- replicate
- (length (checkedInductiveIntros checked))
- LegacyInductiveIntroduction
- <> [ LegacyInductiveDomainSubset
- , LegacyInductiveCases
- , LegacyInductiveInduction
- ]
-
-inductiveIntroFacts
- :: Marker
- -> CheckedInductive
- -> NonEmpty (Marker, Formula)
-inductiveIntroFacts marker checked =
- NonEmpty.zipWith
- (\index intro ->
- ( inductiveIntroMarker marker index
- , inductiveIntroFormula checked intro
- ))
- (1 :| [2 ..])
- (checkedInductiveIntros checked)
-
-inductiveIntroMarker :: Marker -> Int -> Marker
-inductiveIntroMarker marker index =
- Marker (inductiveMarkerText marker <> "_intro_" <> Text.pack (show index))
-
-inductiveDomSubsetMarker :: Marker -> Marker
-inductiveDomSubsetMarker marker =
- Marker (inductiveMarkerText marker <> "_dom_subset")
-
-inductiveCasesMarker :: Marker -> Marker
-inductiveCasesMarker marker =
- Marker (inductiveMarkerText marker <> "_cases")
-
-inductiveInductMarker :: Marker -> Marker
-inductiveInductMarker marker =
- Marker (inductiveMarkerText marker <> "_induct")
-
-inductiveMarkerText :: Marker -> Text
-inductiveMarkerText (Marker text) = text
-
-inductiveIntroFormula :: CheckedInductive -> CheckedInductiveIntro -> Formula
-inductiveIntroFormula checked intro =
- forallIfNeeded
- (orderedUniqueVars (checkedInductiveParams checked <> checkedInductiveIntroVars intro))
- (impliesFrom premises conclusion)
- where
- premises = inductiveConditionFormula checked <$> checkedInductiveIntroConditions intro
- conclusion = isElementOf (checkedInductiveIntroResultTerm intro) (inductiveCarrierTerm checked)
-
-inductiveDomSubsetFormula :: CheckedInductive -> Formula
-inductiveDomSubsetFormula checked =
- forallIfNeeded (checkedInductiveParams checked)
- (semanticSubsetFormula (inductiveUsedVars checked) (inductiveCarrierTerm checked) (checkedInductiveDomain checked))
-
-inductiveCasesFormula :: CheckedInductive -> Formula
-inductiveCasesFormula checked =
- forallIfNeeded
- (orderedUniqueVars (checkedInductiveParams checked <> [witnessVar]))
- (impliesFrom [isElementOf (TermVar witnessVar) (inductiveCarrierTerm checked)] (makeDisjunction disjuncts))
- where
- witnessVar = freshGeneratedVar (inductiveUsedVars checked) "x"
- disjuncts = inductiveCaseDisjunct witnessVar <$> NonEmpty.toList (checkedInductiveIntros checked)
- inductiveCaseDisjunct x intro =
- existsIfNeeded
- (checkedInductiveIntroVars intro)
- (makeConjunction (premises <> [Equals Nowhere (TermVar x) (checkedInductiveIntroResultTerm intro)]))
- where
- premises = inductiveConditionFormula checked <$> checkedInductiveIntroConditions intro
-
-inductiveInductFormula :: CheckedInductive -> Formula
-inductiveInductFormula checked =
- forallIfNeeded
- (orderedUniqueVars (checkedInductiveParams checked <> [subsetVar]))
- (impliesFrom closures conclusion)
- where
- subsetVar = freshGeneratedVar (inductiveUsedVars checked) "S"
- closures = inductiveInductionClosure checked subsetVar <$> NonEmpty.toList (checkedInductiveIntros checked)
- conclusion =
- semanticSubsetFormula
- (Set.insert subsetVar (inductiveUsedVars checked))
- (inductiveCarrierTerm checked)
- (TermVar subsetVar)
-
-inductiveInductionClosure :: CheckedInductive -> VarSymbol -> CheckedInductiveIntro -> Formula
-inductiveInductionClosure checked subsetVar intro =
- forallIfNeeded (checkedInductiveIntroVars intro) (impliesFrom premises conclusion)
- where
- premises = inductiveConditionFormulaAt checked (TermVar subsetVar) <$> checkedInductiveIntroConditions intro
- conclusion = isElementOf (checkedInductiveIntroResultTerm intro) (TermVar subsetVar)
-
-inductiveUsedVars :: CheckedInductive -> Set VarSymbol
-inductiveUsedVars CheckedInductive{checkedInductiveParams, checkedInductiveIntros} =
- Set.fromList
- ( checkedInductiveParams
- <> [ var
- | intro <- NonEmpty.toList checkedInductiveIntros
- , var <- checkedInductiveIntroVars intro
- ]
- )
-
-checkStructDefn :: BlockContext -> StructDefn -> Checking
-checkStructDefn context structDefn@StructDefn{..} = do
- structGraph <- gets checkingStructs
- resolvedParents <-
- forM (Set.toList structParents) \parent ->
- case StructGraph.lookup parent structGraph of
- Nothing ->
- throwIO
- (UnknownStructureParent
- parent
- (blockContextLocation context)
- (blockContextMarker context))
- Just struct ->
- pure struct
- let ancestors =
- structParents
- <> Set.unions (StructGraph.structAncestors <$> resolvedParents)
- inheritedSymbols =
- Set.unions (StructGraph.structSymbols <$> resolvedParents)
- structContext =
- structContextFromSymbols
- structDefnLabel
- (structDefnFixes <> inheritedSymbols)
- assumptions <-
- forM structDefnAssumes \(assumptionMarker, assumption) -> do
- canonical <-
- canonicalizeWithAt context structContext assumption
- pure (assumptionMarker, canonical)
- let canonicalStructDefn =
- structDefn{structDefnAssumes = assumptions}
- checked <-
- either
- (throwIO . structurePreparationCheckingError context)
- pure
- (Structure.prepareCheckedStructDefn
- (blockContextLocation context)
- (blockContextMarker context)
- canonicalStructDefn
- ancestors
- inheritedSymbols)
- st <- get
- committed <-
- either
- throwIO
- pure
- (commitCheckedStructDefn context checked st)
- putDeclarationCandidate committed
- setDeclarationFactProducers
- ( LegacyDeclarationRuleProducer
- . LegacyStructureRule
- <$> NonEmpty.toList
- (Structure.checkedStructFactRoles checked)
- )
-
-structurePreparationCheckingError
- :: BlockContext
- -> Structure.StructurePreparationError
- -> CheckingError
-structurePreparationCheckingError context = \case
- Structure.SelfReferentialStructure symbol ->
- CheckingError
- ( "structure definition of symbol "
- <> symbolText symbol
- <> " is self-referential"
- )
- (blockContextLocation context)
- (blockContextMarker context)
-
--- | Validate and commit every state row introduced by one structure.
-commitCheckedStructDefn
- :: BlockContext
- -> Structure.CheckedStructDefn
- -> CheckingState
- -> Either CheckingError CheckingState
-commitCheckedStructDefn context checked st = do
- markers' <-
- validatedMarkers
- location
- (NonEmpty.toList (Structure.checkedStructMarkers checked))
- st
- (owners', ownedMarkers') <-
- first (checkingErrorAt context)
- (validatedOwnership
- marker
- OwnedByStructureDefinition
- structureSymbol
- st)
- dependencies' <-
- first
- (checkingErrorAt context . dependencyRegistrationErrorText structureSymbol)
- (Dependencies.registerDependencies
- structureSymbol
- semanticDependencies
- (checkingDependencies st))
- traverse_
- (validatePreparedDependencies dependencies')
- (Structure.checkedStructSemanticFacts checked)
- facts' <-
- first
- (DuplicateMarker location)
- (Facts.registerStagedFacts
- (Structure.checkedStructFacts checked)
- (checkingFacts st))
- pure
- st
- { checkingFacts = facts'
- , checkingDependencies = dependencies'
- , checkingOwnedSymbols = owners'
- , checkingOwnedSymbolMarkers = ownedMarkers'
- , checkingStructs =
- StructGraph.insert
- (Structure.checkedStructPhrase checked)
- (Structure.checkedStructAncestors checked)
- (Structure.checkedStructInternalSymbols checked)
- (Structure.checkedStructAllSymbols checked)
- (checkingStructs st)
- , definedMarkers = markers'
- , blockLabel = marker
- , stepLocation = location
- , checkingHypothesisCounter = 0
- }
- where
- location = blockContextLocation context
- marker = blockContextMarker context
- structureSymbol = Structure.checkedStructSymbol checked
- semanticDependencies =
- Set.filter ownableSymbol
- (Structure.checkedStructDependencies checked)
-
- validatePreparedDependencies dependencyRegistry prepared =
- case
- Set.lookupMin
- ( Set.filter
- (\dependency ->
- ownableSymbol dependency
- && isNothing
- (Dependencies.lookupDependencies
- dependency
- dependencyRegistry))
- (Facts.preparedSemanticDependencies prepared)
- )
- of
- Nothing ->
- Right ()
- Just unknown ->
- Left
- (checkingErrorAt context
- ( "structure fact depends on unknown symbol "
- <> symbolText unknown
- ))
-
-checkingErrorAt :: BlockContext -> Text -> CheckingError
-checkingErrorAt context message =
- CheckingError
- message
- (blockContextLocation context)
- (blockContextMarker context)
-
-
-fixing :: NonEmpty VarSymbol -> Checking
-fixing xs = do
- goals <- gets checkingGoals
- (goal, goals') <- case goals of
- goal : goals' -> return (goal, goals')
- _ -> throwWithLocationAndMarker (CheckingError "No open goals, cannot use \"fix\" step")
- goal' <- case goal of
- Forall body | [_bv] <- nubOrd (bindings body) ->
- -- If there's only one quantified variable we can freely choose a new name.
- -- This is useful for nameless quantified phrases such as @every _ is an element of _@.
- case xs of
- x :| [] -> return (instantiate (\_bv -> TermVar x) body)
- _ -> throwWithLocationAndMarker (CheckingError "Couldn't use \"fix\" step: only one bound variable but multiple variables to be fixed")
- Forall body | toList xs `List.intersect` nubOrd (bindings body) == toList xs ->
- return (Forall (instantiateSome xs body))
- Forall body ->
- throwWithLocationAndMarker (CheckingError ("You can only use a \"fix\" step if all specified variables occur in the outermost quantifier. Variables to be fixed were: "
- <> Text.pack (show xs) <> " but only the following are bound: " <> Text.pack (show (nubOrd (bindings body)))))
- _ ->
- throwWithLocationAndMarker (CheckingError "You can only use a \"fix\" step if the goal is universal.")
- setGoals (goal' : goals')
-
--- | A trusted rule that reduces a goal after introducing one assumption.
-data GoalReduction
- = ImplicationIntroduction Formula Formula
- | CurryLeftConjunct Formula Formula Formula
- | CurryRightConjunct Formula Formula Formula
- deriving (Show, Eq)
-
-goalReductionAssumption :: GoalReduction -> Formula
-goalReductionAssumption = \case
- ImplicationIntroduction assumption _conclusion ->
- assumption
- CurryLeftConjunct assumption _right _conclusion ->
- assumption
- CurryRightConjunct _left assumption _conclusion ->
- assumption
-
-goalReductionResidual :: GoalReduction -> Formula
-goalReductionResidual = \case
- ImplicationIntroduction _assumption conclusion ->
- conclusion
- CurryLeftConjunct _assumption right conclusion ->
- right `Implies` conclusion
- CurryRightConjunct left _assumption conclusion ->
- left `Implies` conclusion
-
-reduceGoalWithAssumption :: Formula -> Formula -> Maybe GoalReduction
-reduceGoalWithAssumption assumption = \case
- (left `And` right) `Implies` conclusion
- | equivalent left assumption ->
- Just (CurryLeftConjunct assumption right conclusion)
- | equivalent right assumption ->
- Just (CurryRightConjunct left assumption conclusion)
- antecedent `Implies` conclusion
- | equivalent antecedent assumption ->
- Just (ImplicationIntroduction assumption conclusion)
- _ ->
- Nothing
-
--- | An assumption step in a proof is supposed to match the goal.
-matchAssumptionWithGoal :: Location -> Formula -> CheckingM [Formula]
-matchAssumptionWithGoal loc asm = do
- asm' <- canonicalize asm
- goals <- gets checkingGoals
- (goal, goals') <- case goals of
- goal : goals' ->
- pure (goal, goals')
- [] ->
- impossible "assumption proof step without an open goal"
- defns <- gets checkingPredicateDefinitions
- case reduceGoalWithAssumption asm' goal of
- Just reduction ->
- pure (goalReductionResidual reduction : goals')
- --
- -- Unfolding definitions against atomic goals
- Nothing -> case goal of
- phi@(Atomic _pos p args) ->
- let rhos = (HM.lookup p defns ?? [])
- rhos' =
- [ instantiate
- (\k ->
- nth k args
- ?? impossible
- "predicate definition index exceeds application arity")
- (absurd <$> rho)
- | rho <- rhos
- ]
- in case firstJust (reduceGoalWithAssumption asm') rhos' of
- Nothing -> throwWithMarker (MismatchedAssume asm' phi loc)
- Just reduction ->
- pure (goalReductionResidual reduction : goals')
- phi -> throwWithMarker (MismatchedAssume asm' phi loc)
-
-
-checkAbbr :: BlockContext -> Abbreviation -> Checking
-checkAbbr context (Abbreviation symbol scope) = do
- scope' <- transverseScope unabbreviate scope
- when (mentionsSymbol symbol (fromScope scope')) do
- throwIO
- (checkingErrorAt
- context
- "abbreviation is self-referential")
- st <- get
- either
- throwIO
- put
- (commitAbbreviation context symbol scope' st)
-
--- | Validate and commit every state row introduced by one abbreviation.
-commitAbbreviation
- :: BlockContext
- -> Symbol
- -> Scope Int ExprOf Void
- -> CheckingState
- -> Either CheckingError CheckingState
-commitAbbreviation context symbol scope st = do
- markers' <-
- validatedMarkers location [marker] st
- (owners', ownedMarkers', dependencies') <-
- validatedSymbolRegistration
- context
- OwnedByAbbreviation
- symbol
- mempty
- st
- pure
- st
- { checkingAbbreviations =
- HM.insert
- symbol
- scope
- (checkingAbbreviations st)
- , checkingDependencies = dependencies'
- , checkingOwnedSymbols = owners'
- , checkingOwnedSymbolMarkers = ownedMarkers'
- , definedMarkers = markers'
- , blockLabel = marker
- , stepLocation = location
- , checkingHypothesisCounter = 0
- }
- where
- location =
- blockContextLocation context
- marker =
- blockContextMarker context
diff --git a/source/Checking/Backend/Connection.hs b/source/Checking/Backend/Connection.hs
deleted file mode 100644
index 3a0eb19..0000000
--- a/source/Checking/Backend/Connection.hs
+++ /dev/null
@@ -1,1088 +0,0 @@
-{-# LANGUAGE DerivingStrategies #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-
--- | Bounded reconstruction for the first quantifier-free Horn slice.
-module Checking.Backend.Connection
- ( ConnectionLimits
- , connectionLimits
- , defaultConnectionLimits
- , ConnectionLimitError(..)
- , ConnectionProblem
- , prepareConnectionProblem
- , ConnectionUnsupported(..)
- , ConnectionChoice
- , connectionChoice
- , connectionChoicePremiseOrdinal
- , connectionChoiceChildren
- , ConnectionTrace
- , connectionTrace
- , connectionTraceRoot
- , ConnectionSearchResult(..)
- , ConnectionSearchStats
- , connectionSearchWork
- , connectionSearchDerivedAtomCount
- , connectionSearchMaximumCandidateDepth
- , ConnectionExhaustion(..)
- , searchConnectionProblem
- , ReplayedConnection
- , replayConnectionTrace
- , replayedConnectionDerivation
- , replayedConnectionImportUses
- , replayedConnectionNodeCount
- , replayedConnectionMaximumDepth
- , ConnectionReplayFailure(..)
- , ConnectionReplayMismatch(..)
- ) where
-
-import Base
-import Checking.Backend.Problem
-import Checking.Core
-import Checking.Kernel.Derivation
-
-import Control.Monad (foldM, unless, when)
-import Data.Map.Strict qualified as Map
-import Data.Set qualified as Set
-import Data.Vector (Vector)
-import Data.Vector qualified as Vector
-import Numeric.Natural (Natural)
-
-
-data ConnectionLimits = ConnectionLimits
- !Natural
- !Natural
- !Natural
- deriving stock (Show, Eq)
-
-data ConnectionLimitError
- = ConnectionSearchWorkLimitIsZero
- | ConnectionTraceNodeLimitIsZero
- | ConnectionTraceDepthLimitIsZero
- | ConnectionSearchWorkLimitTooLarge !Natural
- | ConnectionTraceNodeLimitTooLarge !Natural
- | ConnectionTraceDepthLimitTooLarge !Natural
- deriving stock (Show, Eq)
-
-maximumConnectionSearchWork :: Natural
-maximumConnectionSearchWork =
- 1000000
-
-maximumConnectionTraceNodes :: Natural
-maximumConnectionTraceNodes =
- 100000
-
-maximumConnectionTraceDepth :: Natural
-maximumConnectionTraceDepth =
- 1000
-
-connectionLimits
- :: Natural
- -> Natural
- -> Natural
- -> Either ConnectionLimitError ConnectionLimits
-connectionLimits searchWorkLimit nodeLimit depthLimit
- | searchWorkLimit == 0 =
- Left ConnectionSearchWorkLimitIsZero
- | nodeLimit == 0 =
- Left ConnectionTraceNodeLimitIsZero
- | depthLimit == 0 =
- Left ConnectionTraceDepthLimitIsZero
- | searchWorkLimit > maximumConnectionSearchWork =
- Left
- (ConnectionSearchWorkLimitTooLarge
- searchWorkLimit)
- | nodeLimit > maximumConnectionTraceNodes =
- Left
- (ConnectionTraceNodeLimitTooLarge
- nodeLimit)
- | depthLimit > maximumConnectionTraceDepth =
- Left
- (ConnectionTraceDepthLimitTooLarge
- depthLimit)
- | otherwise =
- Right
- (ConnectionLimits
- searchWorkLimit
- nodeLimit
- depthLimit)
-
-defaultConnectionLimits :: ConnectionLimits
-defaultConnectionLimits =
- ConnectionLimits 100000 10000 128
-
-
-data ConnectionProblem ref origin global =
- ConnectionProblem
- !(TypedProblem ref Void origin global)
- !(Vector (SearchRule global))
-
-data ConnectionUnsupported ref
- = ConnectionProblemRequiresTh0
- | ConnectionProblemHasLocalPremises
- | ConnectionProblemHasFoundationAuxiliaries
- | ConnectionClaimIsNotAtomic
- | ConnectionPremiseIsNotHorn
- !Natural
- !ref
- deriving stock (Show, Eq)
-
-prepareConnectionProblem
- :: TypedProblem ref Void origin global
- -> Either
- (ConnectionUnsupported ref)
- (ConnectionProblem ref origin global)
-prepareConnectionProblem problem = do
- unless
- (typedProblemRoute problem == RouteFof)
- (Left ConnectionProblemRequiresTh0)
- unless
- (Vector.null
- (typedProblemLocalPremises problem))
- (Left ConnectionProblemHasLocalPremises)
- unless
- (Vector.null
- (typedProblemAuxiliaries problem))
- (Left ConnectionProblemHasFoundationAuxiliaries)
- unless
- (searchAtom
- (supportedPropositionTerm
- (typedProblemClaim problem)))
- (Left ConnectionClaimIsNotAtomic)
- rules <-
- traverse
- preparePremise
- (Vector.indexed
- (typedProblemGlobalPremises
- problem))
- pure (ConnectionProblem problem rules)
- where
- preparePremise (ordinal, premise) =
- maybe
- (Left
- (ConnectionPremiseIsNotHorn
- naturalOrdinal
- (typedBackendFactReference
- premise)))
- Right
- (searchRule
- naturalOrdinal
- (supportedPropositionTerm
- (typedBackendFactProposition
- premise)))
- where
- naturalOrdinal =
- fromIntegral ordinal
-
-
--- A Horn matrix clause, stored as negative antecedents and one positive head.
-data SearchRule global = SearchRule
- !Natural
- !(Vector (CanonicalTerm global))
- !(CanonicalTerm global)
-
-searchRule
- :: Natural
- -> CanonicalTerm global
- -> Maybe (SearchRule global)
-searchRule ordinal statement = do
- (antecedents, consequent) <-
- collect [] statement
- guard (searchAtom consequent)
- pure
- (SearchRule
- ordinal
- (Vector.fromList antecedents)
- consequent)
- where
- collect reversed = \case
- CImp premise conclusion -> do
- guard (searchAtom premise)
- collect
- (premise : reversed)
- conclusion
- consequent ->
- pure
- ( reverse reversed
- , consequent
- )
-
-searchAtom :: CanonicalTerm global -> Bool
-searchAtom = \case
- CBound{} ->
- False
- CGlobal{} ->
- True
- CIntrinsic{} ->
- True
- COpaqueInteger{} ->
- True
- CApp function argument ->
- searchAtom function
- && searchAtom argument
- CLam{} ->
- False
- CFalsum ->
- False
- CImp{} ->
- False
- CEq{} ->
- False
- CForall{} ->
- False
-
-
-data ConnectionChoice = ConnectionChoice
- !Natural
- !(Vector ConnectionChoice)
- deriving stock (Show, Eq)
-
-connectionChoice
- :: Natural
- -> [ConnectionChoice]
- -> ConnectionChoice
-connectionChoice ordinal children =
- ConnectionChoice
- ordinal
- (Vector.fromList children)
-
-connectionChoicePremiseOrdinal
- :: ConnectionChoice
- -> Natural
-connectionChoicePremiseOrdinal
- (ConnectionChoice ordinal _children) =
- ordinal
-
-connectionChoiceChildren
- :: ConnectionChoice
- -> Vector ConnectionChoice
-connectionChoiceChildren
- (ConnectionChoice _ordinal children) =
- children
-
-newtype ConnectionTrace =
- ConnectionTrace ConnectionChoice
- deriving stock (Show, Eq)
-
-connectionTrace
- :: ConnectionChoice
- -> ConnectionTrace
-connectionTrace =
- ConnectionTrace
-
-connectionTraceRoot
- :: ConnectionTrace
- -> ConnectionChoice
-connectionTraceRoot
- (ConnectionTrace root) =
- root
-
-data ConnectionSearchStats = ConnectionSearchStats
- !Natural
- !Natural
- !Natural
- deriving stock (Show, Eq)
-
-connectionSearchWork
- :: ConnectionSearchStats
- -> Natural
-connectionSearchWork
- (ConnectionSearchStats
- work
- _derivedAtoms
- _maximumCandidateDepth) =
- work
-
-connectionSearchDerivedAtomCount
- :: ConnectionSearchStats
- -> Natural
-connectionSearchDerivedAtomCount
- (ConnectionSearchStats
- _work
- derivedAtoms
- _maximumCandidateDepth) =
- derivedAtoms
-
-connectionSearchMaximumCandidateDepth
- :: ConnectionSearchStats
- -> Natural
-connectionSearchMaximumCandidateDepth
- (ConnectionSearchStats
- _work
- _derivedAtoms
- maximumCandidateDepth) =
- maximumCandidateDepth
-
-data ConnectionExhaustion
- = ConnectionSearchWorkExhausted !Natural
- | ConnectionTraceNodesExhausted !Natural
- | ConnectionTraceDepthExhausted !Natural
- deriving stock (Show, Eq)
-
-data ConnectionSearchResult
- = ConnectionSearchFound
- !ConnectionTrace
- !ConnectionSearchStats
- | ConnectionSearchUnavailable
- !ConnectionSearchStats
- | ConnectionSearchExhausted
- !ConnectionExhaustion
- !ConnectionSearchStats
- deriving stock (Show, Eq)
-
-data SearchDerived = SearchDerived
- !ConnectionChoice
- !Natural
- !Natural
-
-data SearchState global = SearchState
- { searchStateWork :: !Natural
- , searchStateDerivedAtomCount :: !Natural
- , searchStateMaximumCandidateDepth :: !Natural
- , searchStateDerived
- :: !(Map (CanonicalTerm global) SearchDerived)
- , searchStateRemainingAntecedents
- :: !(Map Natural Natural)
- , searchStateWaitingRules
- :: !(Map
- (CanonicalTerm global)
- (Map Natural Natural))
- , searchStateReadyRules :: !(Set Natural)
- , searchStateStructuralExhaustion
- :: !(Maybe ConnectionExhaustion)
- }
-
-searchConnectionProblem
- :: Ord global
- => ConnectionLimits
- -> ConnectionProblem ref origin global
- -> ConnectionSearchResult
-searchConnectionProblem
- limits
- (ConnectionProblem problem rules) =
- case buildSearchIndex limits rules of
- Left (exhaustion, state) ->
- ConnectionSearchExhausted
- exhaustion
- (searchStats state)
- Right initial ->
- runSearchAgenda
- limits
- rules
- (problemClaimTerm problem)
- initial
-
-emptySearchState :: SearchState global
-emptySearchState =
- SearchState
- { searchStateWork = 0
- , searchStateDerivedAtomCount = 0
- , searchStateMaximumCandidateDepth = 0
- , searchStateDerived = Map.empty
- , searchStateRemainingAntecedents = Map.empty
- , searchStateWaitingRules = Map.empty
- , searchStateReadyRules = Set.empty
- , searchStateStructuralExhaustion = Nothing
- }
-
-buildSearchIndex
- :: Ord global
- => ConnectionLimits
- -> Vector (SearchRule global)
- -> Either
- (ConnectionExhaustion, SearchState global)
- (SearchState global)
-buildSearchIndex limits =
- foldM registerRule emptySearchState
- . Vector.toList
- where
- registerRule state
- (SearchRule ordinal antecedents _consequent) = do
- charged <-
- chargeSearchWork limits state
- let antecedentCount =
- fromIntegral (Vector.length antecedents)
- withRemaining =
- charged
- { searchStateRemainingAntecedents =
- Map.insert
- ordinal
- antecedentCount
- (searchStateRemainingAntecedents
- charged)
- , searchStateReadyRules =
- if antecedentCount == 0
- then
- Set.insert
- ordinal
- (searchStateReadyRules
- charged)
- else
- searchStateReadyRules charged
- }
- foldM
- (registerAntecedent ordinal)
- withRemaining
- (Vector.toList antecedents)
-
- registerAntecedent ordinal state antecedent = do
- charged <-
- chargeSearchWork limits state
- pure
- charged
- { searchStateWaitingRules =
- Map.insertWith
- (Map.unionWith (+))
- antecedent
- (Map.singleton ordinal 1)
- (searchStateWaitingRules charged)
- }
-
-runSearchAgenda
- :: Ord global
- => ConnectionLimits
- -> Vector (SearchRule global)
- -> CanonicalTerm global
- -> SearchState global
- -> ConnectionSearchResult
-runSearchAgenda limits rules goal state =
- case Set.minView (searchStateReadyRules state) of
- Nothing ->
- case searchStateStructuralExhaustion state of
- Nothing ->
- ConnectionSearchUnavailable
- (searchStats state)
- Just exhaustion ->
- ConnectionSearchExhausted
- exhaustion
- (searchStats state)
- Just (ordinal, remainingReady) ->
- let withoutReady =
- state
- { searchStateReadyRules =
- remainingReady
- }
- in case chargeSearchWork limits withoutReady of
- Left (exhaustion, exhaustedState) ->
- ConnectionSearchExhausted
- exhaustion
- (searchStats exhaustedState)
- Right charged ->
- considerReadyRule
- limits
- rules
- goal
- ordinal
- charged
-
-considerReadyRule
- :: Ord global
- => ConnectionLimits
- -> Vector (SearchRule global)
- -> CanonicalTerm global
- -> Natural
- -> SearchState global
- -> ConnectionSearchResult
-considerReadyRule limits rules goal ordinal state =
- case naturalVectorIndex ordinal rules of
- Nothing ->
- impossible
- "a ready connection rule is outside the prepared rule vector"
- Just (SearchRule _ antecedents consequent)
- | Map.member consequent
- (searchStateDerived state) ->
- runSearchAgenda
- limits
- rules
- goal
- state
- | otherwise ->
- case traverse
- (`Map.lookup` searchStateDerived state)
- antecedents of
- Nothing ->
- impossible
- "a ready connection rule has an unavailable antecedent"
- Just antecedentProofs ->
- considerCandidate
- limits
- rules
- goal
- ordinal
- consequent
- antecedentProofs
- state
-
-considerCandidate
- :: Ord global
- => ConnectionLimits
- -> Vector (SearchRule global)
- -> CanonicalTerm global
- -> Natural
- -> CanonicalTerm global
- -> Vector SearchDerived
- -> SearchState global
- -> ConnectionSearchResult
-considerCandidate
- limits
- rules
- goal
- ordinal
- consequent
- antecedentProofs
- state =
- case candidateExhaustion limits nodeCount depth of
- Just exhaustion ->
- runSearchAgenda
- limits
- rules
- goal
- stateWithDepth
- { searchStateStructuralExhaustion =
- rememberExhaustion
- exhaustion
- (searchStateStructuralExhaustion
- stateWithDepth)
- }
- Nothing ->
- let choice =
- ConnectionChoice
- ordinal
- (fmap searchDerivedChoice
- antecedentProofs)
- derived =
- SearchDerived
- choice
- nodeCount
- depth
- withDerived =
- stateWithDepth
- { searchStateDerivedAtomCount =
- searchStateDerivedAtomCount
- stateWithDepth
- + 1
- , searchStateDerived =
- Map.insert
- consequent
- derived
- (searchStateDerived
- stateWithDepth)
- }
- in
- if consequent == goal
- then
- ConnectionSearchFound
- (connectionTrace choice)
- (searchStats withDerived)
- else
- case activateWaitingRules
- limits
- consequent
- withDerived of
- Left (exhaustion, exhaustedState) ->
- ConnectionSearchExhausted
- exhaustion
- (searchStats exhaustedState)
- Right activated ->
- runSearchAgenda
- limits
- rules
- goal
- activated
- where
- nodeCount =
- Vector.foldl'
- (\nodeTotal derived ->
- saturatingAdd
- (connectionTraceNodeLimit limits)
- nodeTotal
- (searchDerivedNodeCount derived))
- 1
- antecedentProofs
- depth =
- saturatingSuccessor
- (connectionTraceDepthLimit limits)
- (Vector.foldl'
- (\maximumDepth derived ->
- max maximumDepth
- (searchDerivedDepth derived))
- 0
- antecedentProofs)
- stateWithDepth =
- state
- { searchStateMaximumCandidateDepth =
- max depth
- (searchStateMaximumCandidateDepth
- state)
- }
-
-activateWaitingRules
- :: Ord global
- => ConnectionLimits
- -> CanonicalTerm global
- -> SearchState global
- -> Either
- (ConnectionExhaustion, SearchState global)
- (SearchState global)
-activateWaitingRules limits atom state =
- foldM
- activate
- state
- (maybe
- []
- Map.toAscList
- (Map.lookup atom
- (searchStateWaitingRules state)))
- where
- activate current (ordinal, multiplicity) = do
- charged <-
- chargeSearchWork limits current
- let remaining =
- fromMaybe
- (impossible
- "a waiting connection rule has no remaining count")
- (Map.lookup
- ordinal
- (searchStateRemainingAntecedents
- charged))
- nextRemaining
- | multiplicity <= remaining =
- remaining - multiplicity
- | otherwise =
- impossible
- "a waiting connection multiplicity exceeds its rule"
- pure
- charged
- { searchStateRemainingAntecedents =
- Map.insert
- ordinal
- nextRemaining
- (searchStateRemainingAntecedents
- charged)
- , searchStateReadyRules =
- if nextRemaining == 0
- then
- Set.insert
- ordinal
- (searchStateReadyRules
- charged)
- else
- searchStateReadyRules charged
- }
-
-chargeSearchWork
- :: ConnectionLimits
- -> SearchState global
- -> Either
- (ConnectionExhaustion, SearchState global)
- (SearchState global)
--- One step registers a rule or antecedent, activates a waiting rule, or
--- considers a ready rule.
-chargeSearchWork limits state
- | searchStateWork state
- >= connectionSearchWorkLimit limits =
- Left
- ( ConnectionSearchWorkExhausted
- (connectionSearchWorkLimit limits)
- , state
- )
- | otherwise =
- Right
- state
- { searchStateWork =
- searchStateWork state + 1
- }
-
-candidateExhaustion
- :: ConnectionLimits
- -> Natural
- -> Natural
- -> Maybe ConnectionExhaustion
-candidateExhaustion limits nodes depth
- | nodes > connectionTraceNodeLimit limits =
- Just
- (ConnectionTraceNodesExhausted
- (connectionTraceNodeLimit limits))
- | depth > connectionTraceDepthLimit limits =
- Just
- (ConnectionTraceDepthExhausted
- (connectionTraceDepthLimit limits))
- | otherwise =
- Nothing
-
-rememberExhaustion
- :: ConnectionExhaustion
- -> Maybe ConnectionExhaustion
- -> Maybe ConnectionExhaustion
-rememberExhaustion exhaustion = \case
- Nothing ->
- Just exhaustion
- previous ->
- previous
-
-searchStats
- :: SearchState global
- -> ConnectionSearchStats
-searchStats state =
- ConnectionSearchStats
- (searchStateWork state)
- (searchStateDerivedAtomCount state)
- (searchStateMaximumCandidateDepth state)
-
-searchDerivedChoice :: SearchDerived -> ConnectionChoice
-searchDerivedChoice
- (SearchDerived choice _nodeCount _depth) =
- choice
-
-searchDerivedNodeCount :: SearchDerived -> Natural
-searchDerivedNodeCount
- (SearchDerived _choice nodeCount _depth) =
- nodeCount
-
-searchDerivedDepth :: SearchDerived -> Natural
-searchDerivedDepth
- (SearchDerived _choice _nodeCount depth) =
- depth
-
-connectionSearchWorkLimit :: ConnectionLimits -> Natural
-connectionSearchWorkLimit
- (ConnectionLimits workLimit _nodeLimit _depthLimit) =
- workLimit
-
-connectionTraceNodeLimit :: ConnectionLimits -> Natural
-connectionTraceNodeLimit
- (ConnectionLimits _workLimit nodeLimit _depthLimit) =
- nodeLimit
-
-connectionTraceDepthLimit :: ConnectionLimits -> Natural
-connectionTraceDepthLimit
- (ConnectionLimits _workLimit _nodeLimit depthLimit) =
- depthLimit
-
-saturatingAdd
- :: Natural
- -> Natural
- -> Natural
- -> Natural
-saturatingAdd limit left right
- | left >= ceilingValue =
- ceilingValue
- | right >= ceilingValue - left =
- ceilingValue
- | otherwise =
- left + right
- where
- ceilingValue =
- limit + 1
-
-saturatingSuccessor :: Natural -> Natural -> Natural
-saturatingSuccessor limit value
- | value >= limit =
- limit + 1
- | otherwise =
- value + 1
-
-
--- Replay rebuilds clauses independently from the search representation.
-data ReplayClause global = ReplayClause
- !Natural
- !(Vector (CanonicalTerm global))
- !(CanonicalTerm global)
-
-replayClause
- :: Natural
- -> CanonicalTerm global
- -> Maybe (ReplayClause global)
-replayClause ordinal statement =
- finish [] statement
- where
- finish reversed = \case
- CImp premise conclusion
- | replayAtom premise ->
- finish
- (premise : reversed)
- conclusion
- | otherwise ->
- Nothing
- consequent
- | replayAtom consequent ->
- Just
- (ReplayClause
- ordinal
- (Vector.fromList
- (reverse reversed))
- consequent)
- | otherwise ->
- Nothing
-
-replayAtom :: CanonicalTerm global -> Bool
-replayAtom = \case
- CGlobal{} ->
- True
- CIntrinsic{} ->
- True
- COpaqueInteger{} ->
- True
- CApp function argument ->
- replayAtom function
- && replayAtom argument
- CBound{} ->
- False
- CLam{} ->
- False
- CFalsum ->
- False
- CImp{} ->
- False
- CEq{} ->
- False
- CForall{} ->
- False
-
-data ReplayedConnection global =
- ReplayedConnection
- !(KernelDerivation global)
- !(Set ImportIx)
- !Natural
- !Natural
-
-replayedConnectionDerivation
- :: ReplayedConnection global
- -> KernelDerivation global
-replayedConnectionDerivation
- (ReplayedConnection
- derivation
- _imports
- _nodes
- _maximumDepth) =
- derivation
-
-replayedConnectionImportUses
- :: ReplayedConnection global
- -> Set ImportIx
-replayedConnectionImportUses
- (ReplayedConnection
- _derivation
- imports
- _nodes
- _maximumDepth) =
- imports
-
-replayedConnectionNodeCount
- :: ReplayedConnection global
- -> Natural
-replayedConnectionNodeCount
- (ReplayedConnection
- _derivation
- _imports
- nodes
- _maximumDepth) =
- nodes
-
-replayedConnectionMaximumDepth
- :: ReplayedConnection global
- -> Natural
-replayedConnectionMaximumDepth
- (ReplayedConnection
- _derivation
- _imports
- _nodes
- maximumDepth) =
- maximumDepth
-
-data ConnectionReplayFailure
- = ConnectionReplayExhausted !ConnectionExhaustion
- | ConnectionReplayRejected !ConnectionReplayMismatch
- deriving stock (Show, Eq)
-
-data ConnectionReplayMismatch
- = ConnectionReplayProblemInvariantFailed
- | ConnectionReplayChoiceOutOfBounds !Natural
- | ConnectionReplayRepeatedChoice !Natural
- | ConnectionReplayGoalMismatch !Natural
- | ConnectionReplayChildCountMismatch
- !Natural
- !Natural
- !Natural
- deriving stock (Show, Eq)
-
-data ReplayState = ReplayState
- !Natural
- !Natural
-
-replayConnectionTrace
- :: Eq global
- => ConnectionLimits
- -> ConnectionProblem ref origin global
- -> ConnectionTrace
- -> Either
- ConnectionReplayFailure
- (ReplayedConnection global)
-replayConnectionTrace
- limits
- (ConnectionProblem problem _searchRules)
- (ConnectionTrace root) = do
- clauses <-
- traverse
- rebuildClause
- (Vector.toList
- (Vector.indexed
- (typedProblemGlobalPremises
- problem)))
- (derivation, imports, ReplayState nodes maximumDepth) <-
- replayGoal
- limits
- (Vector.fromList clauses)
- Set.empty
- 1
- (problemClaimTerm problem)
- root
- (ReplayState 0 0)
- pure
- (ReplayedConnection
- derivation
- imports
- nodes
- maximumDepth)
- where
- rebuildClause (ordinal, premise) =
- maybe
- (Left
- (ConnectionReplayRejected
- ConnectionReplayProblemInvariantFailed))
- Right
- (replayClause
- (fromIntegral ordinal)
- (supportedPropositionTerm
- (typedBackendFactProposition
- premise)))
-
-problemClaimTerm
- :: TypedProblem ref Void origin global
- -> CanonicalTerm global
-problemClaimTerm =
- supportedPropositionTerm
- . typedProblemClaim
-
-replayGoal
- :: Eq global
- => ConnectionLimits
- -> Vector (ReplayClause global)
- -> Set Natural
- -> Natural
- -> CanonicalTerm global
- -> ConnectionChoice
- -> ReplayState
- -> Either
- ConnectionReplayFailure
- ( KernelDerivation global
- , Set ImportIx
- , ReplayState
- )
-replayGoal
- limits
- clauses
- path
- depth
- goal
- (ConnectionChoice ordinal children)
- (ReplayState nodes maximumDepth) = do
- when
- (depth > connectionTraceDepthLimit limits)
- (Left
- (ConnectionReplayExhausted
- (ConnectionTraceDepthExhausted
- (connectionTraceDepthLimit limits))))
- when
- (nodes >= connectionTraceNodeLimit limits)
- (Left
- (ConnectionReplayExhausted
- (ConnectionTraceNodesExhausted
- (connectionTraceNodeLimit limits))))
- when
- (ordinal `Set.member` path)
- (Left
- (ConnectionReplayRejected
- (ConnectionReplayRepeatedChoice
- ordinal)))
- ReplayClause
- clauseOrdinal
- antecedents
- consequent <-
- maybe
- (Left
- (ConnectionReplayRejected
- (ConnectionReplayChoiceOutOfBounds
- ordinal)))
- Right
- (naturalVectorIndex
- ordinal
- clauses)
- unless
- (clauseOrdinal == ordinal
- && consequent == goal)
- (Left
- (ConnectionReplayRejected
- (ConnectionReplayGoalMismatch
- ordinal)))
- let expectedChildren =
- Vector.length antecedents
- actualChildren =
- Vector.length children
- unless
- (expectedChildren == actualChildren)
- (Left
- (ConnectionReplayRejected
- (ConnectionReplayChildCountMismatch
- ordinal
- (fromIntegral expectedChildren)
- (fromIntegral actualChildren))))
- (childDerivations, imports, finalState) <-
- foldM
- replayChild
- ( []
- , Set.singleton
- (importIx ordinal)
- , ReplayState
- (nodes + 1)
- (max depth maximumDepth)
- )
- (Vector.toList
- (Vector.zip
- antecedents
- children))
- pure
- ( foldl'
- implicationEliminationDerivation
- (importedFactDerivation
- (importIx ordinal))
- (reverse childDerivations)
- , imports
- , finalState
- )
- where
- replayChild
- (reversed, imports, current)
- (antecedent, child) = do
- (derivation, childImports, next) <-
- replayGoal
- limits
- clauses
- (Set.insert ordinal path)
- (depth + 1)
- antecedent
- child
- current
- pure
- ( derivation : reversed
- , imports <> childImports
- , next
- )
-
-naturalVectorIndex
- :: Natural
- -> Vector value
- -> Maybe value
-naturalVectorIndex index values
- | index > fromIntegral (maxBound :: Int) =
- Nothing
- | otherwise =
- values Vector.!? fromIntegral index
diff --git a/source/Checking/Backend/Reconstruction.hs b/source/Checking/Backend/Reconstruction.hs
deleted file mode 100644
index 37ef99f..0000000
--- a/source/Checking/Backend/Reconstruction.hs
+++ /dev/null
@@ -1,253 +0,0 @@
-{-# LANGUAGE DerivingStrategies #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-
--- | Shadow and authoritative entry point for bounded proof reconstruction.
-module Checking.Backend.Reconstruction
- ( ReconstructionPolicy
- , reconstructionPolicy
- , reconstructionPolicyConnectionLimits
- , reconstructionPolicyKernelReplayLimits
- , defaultReconstructionPolicy
- , ReconstructionOutcome(..)
- , ReconstructionMismatch(..)
- , ReconstructedVampireResult
- , reconstructedPreparedTask
- , reconstructedAcceptedRun
- , reconstructedConnectionTrace
- , reconstructedSearchStats
- , reconstructedConnectionReplay
- , attemptVampireReconstruction
- ) where
-
-import Base
-import Checking.Backend.Connection
-import Checking.Kernel.Derivation
- ( KernelReplayLimits
- , defaultKernelReplayLimits
- )
-import Provers
-
-
-data ReconstructionPolicy =
- ReconstructionPolicy
- !ConnectionLimits
- !KernelReplayLimits
- deriving stock (Show, Eq)
-
-reconstructionPolicy
- :: ConnectionLimits
- -> KernelReplayLimits
- -> ReconstructionPolicy
-reconstructionPolicy =
- ReconstructionPolicy
-
-reconstructionPolicyConnectionLimits
- :: ReconstructionPolicy
- -> ConnectionLimits
-reconstructionPolicyConnectionLimits
- (ReconstructionPolicy
- connectionLimitsValue
- _kernelReplayLimitsValue) =
- connectionLimitsValue
-
-reconstructionPolicyKernelReplayLimits
- :: ReconstructionPolicy
- -> KernelReplayLimits
-reconstructionPolicyKernelReplayLimits
- (ReconstructionPolicy
- _connectionLimitsValue
- kernelReplayLimitsValue) =
- kernelReplayLimitsValue
-
-defaultReconstructionPolicy :: ReconstructionPolicy
-defaultReconstructionPolicy =
- ReconstructionPolicy
- defaultConnectionLimits
- defaultKernelReplayLimits
-
-data ReconstructionOutcome ref origin global
- = ReconstructionSucceeded
- !(ReconstructedVampireResult
- ref
- origin
- global)
- | ReconstructionUnsupported
- !(ConnectionUnsupported ref)
- | ReconstructionUnavailable
- !ConnectionSearchStats
- | ReconstructionExhausted
- !ConnectionExhaustion
- !ConnectionSearchStats
- | ReconstructionDefinitiveMismatch
- !ReconstructionMismatch
-
-data ReconstructionMismatch
- = ReconstructionAcceptedRequestMismatch
- | ReconstructionReplayBudgetMismatch
- !ConnectionExhaustion
- | ReconstructionReplayRejected
- !ConnectionReplayMismatch
- deriving stock (Show, Eq)
-
-data ReconstructedVampireResult ref origin global =
- ReconstructedVampireResult
- !(PreparedTypedProverTask
- ref
- Void
- origin
- global)
- !AcceptedVampireRun
- !ConnectionTrace
- !ConnectionSearchStats
- !(ReplayedConnection global)
-
-reconstructedPreparedTask
- :: ReconstructedVampireResult
- ref
- origin
- global
- -> PreparedTypedProverTask
- ref
- Void
- origin
- global
-reconstructedPreparedTask
- (ReconstructedVampireResult
- prepared
- _accepted
- _trace
- _searchStats
- _replayed) =
- prepared
-
-reconstructedAcceptedRun
- :: ReconstructedVampireResult
- ref
- origin
- global
- -> AcceptedVampireRun
-reconstructedAcceptedRun
- (ReconstructedVampireResult
- _prepared
- accepted
- _trace
- _searchStats
- _replayed) =
- accepted
-
-reconstructedConnectionTrace
- :: ReconstructedVampireResult
- ref
- origin
- global
- -> ConnectionTrace
-reconstructedConnectionTrace
- (ReconstructedVampireResult
- _prepared
- _accepted
- connectionTraceValue
- _searchStats
- _replayed) =
- connectionTraceValue
-
-reconstructedSearchStats
- :: ReconstructedVampireResult
- ref
- origin
- global
- -> ConnectionSearchStats
-reconstructedSearchStats
- (ReconstructedVampireResult
- _prepared
- _accepted
- _trace
- searchStats
- _replayed) =
- searchStats
-
-reconstructedConnectionReplay
- :: ReconstructedVampireResult
- ref
- origin
- global
- -> ReplayedConnection global
-reconstructedConnectionReplay
- (ReconstructedVampireResult
- _prepared
- _accepted
- _trace
- _searchStats
- replayed) =
- replayed
-
-attemptVampireReconstruction
- :: Ord global
- => ReconstructionPolicy
- -> PreparedTypedProverTask
- ref
- Void
- origin
- global
- -> AcceptedVampireRun
- -> ReconstructionOutcome ref origin global
-attemptVampireReconstruction
- policy
- prepared
- accepted
- | acceptedVampireRequest accepted
- /= preparedTypedProverRequest prepared =
- ReconstructionDefinitiveMismatch
- ReconstructionAcceptedRequestMismatch
- | otherwise =
- case prepareConnectionProblem
- (preparedTypedProverLogicalProblem
- prepared) of
- Left unsupported ->
- ReconstructionUnsupported
- unsupported
- Right problem ->
- finish problem
- where
- limits =
- reconstructionPolicyConnectionLimits policy
-
- finish problem =
- case searchConnectionProblem
- limits
- problem of
- ConnectionSearchFound
- connectionTraceValue
- searchStats ->
- case replayConnectionTrace
- limits
- problem
- connectionTraceValue of
- Left
- (ConnectionReplayExhausted
- exhaustion) ->
- ReconstructionDefinitiveMismatch
- (ReconstructionReplayBudgetMismatch
- exhaustion)
- Left
- (ConnectionReplayRejected
- mismatch) ->
- ReconstructionDefinitiveMismatch
- (ReconstructionReplayRejected
- mismatch)
- Right replayed ->
- ReconstructionSucceeded
- (ReconstructedVampireResult
- prepared
- accepted
- connectionTraceValue
- searchStats
- replayed)
- ConnectionSearchUnavailable searchStats ->
- ReconstructionUnavailable
- searchStats
- ConnectionSearchExhausted
- exhaustion
- searchStats ->
- ReconstructionExhausted
- exhaustion
- searchStats
diff --git a/source/Checking/Core.hs b/source/Checking/Core.hs
index 6e8d175..4b7478f 100644
--- a/source/Checking/Core.hs
+++ b/source/Checking/Core.hs
@@ -49,6 +49,8 @@ module Checking.Core
, weakenCheckedScopedCore
, weakenScopedCore
, scopedSetDefinition
+ , scopedCharacteristicDefinition
+ , scopedReplacementGraph
, implyScopedCore
, splitScopedSetEquality
, scopedSetInductionHypothesis
@@ -697,53 +699,194 @@ weakenScopedCore globalType binderType scoped =
(shiftCanonical 1 0
(scopedCoreTerm scoped))
--- | Introduce a fresh set-valued local definition. Separation uses the
--- checked characteristic rule so its local premise remains first-order.
+-- | Introduce a fresh set-valued local definition. Separation specializes
+-- the checked foundation characteristic so its local premise remains
+-- first-order.
scopedSetDefinition
- :: ScopedCheckedCore global
+ :: Eq global
+ => FrozenCheckedCore Void
+ -> ScopedCheckedCore global
-> Maybe (ScopedCheckedCore global)
scopedSetDefinition
- (ScopedCheckedCore context TySet expression) =
- Just
- (ScopedCheckedCore
- (TySet : context)
- TyProp
- (case expression of
- CApp
- (CApp (CIntrinsic Sep) bound)
- (CLam TySet predicate) ->
- separationCharacteristic bound predicate
- _ ->
- CEq
+ characteristic
+ expression@(ScopedCheckedCore context TySet term) =
+ case term of
+ CApp
+ (CApp (CIntrinsic Sep) bound)
+ predicate@(CLam TySet _body) ->
+ scopedCharacteristicDefinition
+ characteristic
+ expression
+ ( ScopedCheckedCore context TySet bound
+ :| [ ScopedCheckedCore
+ context
+ (TySet `TyArrow` TyProp)
+ predicate
+ ]
+ )
+ _ ->
+ Just
+ (ScopedCheckedCore
+ (TySet : context)
+ TyProp
+ (CEq
TySet
(CBound 0)
- (shiftCanonical 1 0 expression)))
- where
- separationCharacteristic bound predicate =
- CForall
- TySet
- (CEq
- TyProp
- (member (CBound 0) (CBound 1))
- (andP
- (member
- (CBound 0)
- (shiftCanonical 2 0 bound))
- (shiftCanonical 1 1 predicate)))
+ (shiftCanonical 1 0 term)))
+scopedSetDefinition _characteristic _expression =
+ Nothing
- member element set =
- CApp
- (CApp (CIntrinsic Member) element)
- set
+-- | Specialize a checked characteristic and abstract its set-valued target
+-- into one fresh nearest binder. Checked substitution and beta reduction
+-- preserve the foundation row's proposition type.
+scopedCharacteristicDefinition
+ :: Eq global
+ => FrozenCheckedCore Void
+ -> ScopedCheckedCore global
+ -> NonEmpty (ScopedCheckedCore global)
+ -> Maybe (ScopedCheckedCore global)
+scopedCharacteristicDefinition
+ (FrozenCheckedCore TyProp frozen)
+ (ScopedCheckedCore context TySet target)
+ arguments
+ | all ((== context) . scopedCoreContext) arguments = do
+ specialized <-
+ specialize
+ (mapCanonicalGlobals absurd frozen)
+ (toList arguments)
+ let normalized = betaNormalizeCanonical specialized
+ (found, abstracted) = abstractTarget 0 normalized
+ guard found
+ pure
+ (ScopedCheckedCore
+ (TySet : context)
+ TyProp
+ abstracted)
+ where
+ specialize term [] =
+ Just term
+ specialize (CForall binderType body)
+ (ScopedCheckedCore _ argumentType argument : rest)
+ | binderType == argumentType =
+ specialize
+ (instantiateCanonical argument body)
+ rest
+ specialize _term _arguments =
+ Nothing
- andP left right =
- notP (CImp left (notP right))
+ abstractTarget depth term
+ | term == shiftCanonical depth 0 target =
+ (True, CBound (fromIntegral depth))
+ | otherwise =
+ case term of
+ CBound index
+ | index < fromIntegral depth ->
+ (False, CBound index)
+ | otherwise ->
+ (False, CBound (index + 1))
+ CGlobal global ->
+ (False, CGlobal global)
+ CIntrinsic intrinsic ->
+ (False, CIntrinsic intrinsic)
+ COpaqueInteger integer ->
+ (False, COpaqueInteger integer)
+ CApp function argument ->
+ combine CApp
+ (abstractTarget depth function)
+ (abstractTarget depth argument)
+ CLam binderType body ->
+ let (found, abstracted) =
+ abstractTarget (depth + 1) body
+ in (found, CLam binderType abstracted)
+ CFalsum ->
+ (False, CFalsum)
+ CImp premise conclusion ->
+ combine CImp
+ (abstractTarget depth premise)
+ (abstractTarget depth conclusion)
+ CEq operandType left right ->
+ combine (CEq operandType)
+ (abstractTarget depth left)
+ (abstractTarget depth right)
+ CForall binderType body ->
+ let (found, abstracted) =
+ abstractTarget (depth + 1) body
+ in (found, CForall binderType abstracted)
+
+ combine constructor (leftFound, left) (rightFound, right) =
+ (leftFound || rightFound, constructor left right)
+scopedCharacteristicDefinition _characteristic _target _arguments =
+ Nothing
- notP proposition =
- CImp proposition CFalsum
-scopedSetDefinition _expression =
+-- | Build the replacement graph of one checked set-valued local function.
+-- The ordered-pair constructor is an ordinary checked source object.
+scopedReplacementGraph
+ :: ScopedCheckedCore global
+ -> ScopedCheckedCore global
+ -> ScopedCheckedCore global
+ -> Maybe
+ ( ScopedCheckedCore global
+ , ScopedCheckedCore global
+ , ScopedCheckedCore global
+ )
+scopedReplacementGraph
+ (ScopedCheckedCore context pairType pair)
+ domain@(ScopedCheckedCore domainContext TySet domainTerm)
+ (ScopedCheckedCore valueContext TySet value)
+ | pairType == TySet `TyArrow` (TySet `TyArrow` TySet)
+ , domainContext == context
+ , valueContext == TySet : context =
+ let pairValue =
+ CApp
+ (CApp
+ (shiftCanonical 1 0 pair)
+ (CBound 0))
+ value
+ function = CLam TySet pairValue
+ graph =
+ CApp
+ (CApp (CIntrinsic Repl) domainTerm)
+ function
+ in Just
+ ( ScopedCheckedCore context TySet graph
+ , domain
+ , ScopedCheckedCore
+ context
+ (TySet `TyArrow` TySet)
+ function
+ )
+scopedReplacementGraph _pair _domain _value =
Nothing
+betaNormalizeCanonical
+ :: CanonicalTerm global
+ -> CanonicalTerm global
+betaNormalizeCanonical = \case
+ CApp function argument ->
+ case betaNormalizeCanonical function of
+ CLam _binderType body ->
+ betaNormalizeCanonical
+ (instantiateCanonical
+ (betaNormalizeCanonical argument)
+ body)
+ normalizedFunction ->
+ CApp
+ normalizedFunction
+ (betaNormalizeCanonical argument)
+ CLam binderType body ->
+ CLam binderType (betaNormalizeCanonical body)
+ CImp premise conclusion ->
+ CImp
+ (betaNormalizeCanonical premise)
+ (betaNormalizeCanonical conclusion)
+ CEq operandType left right ->
+ CEq operandType
+ (betaNormalizeCanonical left)
+ (betaNormalizeCanonical right)
+ CForall binderType body ->
+ CForall binderType (betaNormalizeCanonical body)
+ term -> term
+
-- | Combine two checked propositions under the same lexical context.
implyScopedCore
:: ScopedCheckedCore global
diff --git a/source/Checking/Datatype.hs b/source/Checking/Datatype.hs
index d694ec8..a47f93d 100644
--- a/source/Checking/Datatype.hs
+++ b/source/Checking/Datatype.hs
@@ -13,13 +13,9 @@ module Checking.Datatype
, CheckedDatatypePremiseView(..)
, checkedDatatypeClauseViews
, checkedDatatypeGeneratedFacts
- , checkedDatatypeFacts
- , checkedDatatypeFactRoles
) where
import Base
-import Checking.Facts
-import Checking.Legacy
import Report.Location
import Syntax.Internal
import Syntax.Lexicon
@@ -278,50 +274,6 @@ checkedDatatypeGeneratedFacts
checkedDatatypeGeneratedFacts =
datatypeFacts
-checkedDatatypeFacts
- :: Location
- -> Marker
- -> CheckedDatatype
- -> NonEmpty StagedFact
-checkedDatatypeFacts location blockMarker checked =
- fmap stage (datatypeFacts checked)
- where
- stage (factMarker, formula) =
- stageFact
- (factMarker :| [])
- (factOrigin location blockMarker)
- (prepareSemanticFact formula)
-
-checkedDatatypeFactRoles
- :: CheckedDatatype
- -> NonEmpty LegacyDatatypeFactRole
-checkedDatatypeFactRoles datatype =
- appendList
- (LegacyDatatypeIntroduction
- <$ checkedDatatypeClauses datatype)
- ( replicate
- (length
- (unorderedPairs
- (NonEmpty.toList
- (checkedDatatypeClauses datatype))))
- LegacyDatatypeDistinctness
- <> [ LegacyDatatypeInjectivity
- | clause <-
- NonEmpty.toList
- (checkedDatatypeClauses datatype)
- , not
- (null
- (checkedDatatypeClauseConstructorArgs
- clause))
- ]
- <> [ LegacyDatatypeCases
- , LegacyDatatypeInduction
- ]
- )
- where
- appendList (first :| rest) trailing =
- first :| (rest <> trailing)
-
datatypeFacts :: CheckedDatatype -> NonEmpty (Marker, Formula)
datatypeFacts datatype =
appendList
diff --git a/source/Checking/Declaration.hs b/source/Checking/Declaration.hs
index 53e3e02..15c8282 100644
--- a/source/Checking/Declaration.hs
+++ b/source/Checking/Declaration.hs
@@ -17,17 +17,27 @@ module Checking.Declaration
, importSealedModuleDriver
, nextDeclarationSlotDriver
, currentTheoryDriver
+ , currentFoundationAxiomDriver
, resolveVisibleFactAliasDriver
, resolveVisibleFactTargetsDriver
, resolveVisibleGlobalDriver
, resolveVisibleGlobalContentDriver
+ , ResolvedStructure
+ , resolvedStructureDescriptor
+ , resolvedStructurePredicate
+ , resolvedStructureOperation
+ , resolvedStructureOperations
+ , resolveVisibleStructureDriver
+ , resolveVisibleStructureOperationObjectsDriver
, objectAvailableDriver
+ , objectTypeDriver
, runModuleDriver
, ValidationLookup
, validationLookup
, ValidationRun(..)
, failModuleDriver
, VampireResolver
+ , vampireBatchResolver
, vampireResolver
, Declaration
, failDeclaration
@@ -35,6 +45,7 @@ module Checking.Declaration
, addDeclarationProposition
, resolveVisibleGlobal
, stageSemanticGlobalBinding
+ , stageSemanticStructureDescriptor
, CandidateSpec
, candidateSpec
, ReservedCandidate
@@ -43,6 +54,7 @@ module Checking.Declaration
, reservePropositionCandidate
, reserveFrozenPropositionCandidateBatch
, reserveDefinitionEquationCandidate
+ , reservePointwiseDefinitionEquationCandidate
, reserveDefinitionEquationCandidateBatch
, reservedCandidateSlot
, reservedCandidateStage
@@ -66,7 +78,10 @@ module Checking.Declaration
, authorizeDefinitionEquationCandidate
, acceptVampireObligation
, acceptPreparedVampireObligation
+ , acceptCurrentCandidateVampire
+ , prepareCurrentCandidateVampire
, authorizeVampireCandidate
+ , authorizeVampireCandidateBatch
, authorizeSourceAxiomCandidate
, authorizeOmittedCandidate
, authorizeDatatypeCompilationCandidates
@@ -110,6 +125,7 @@ import Felix.Cache.Codec (encodeCache)
import Felix.Module
import Provers qualified
import Report.Location
+import Syntax.Abstract (StructSymbol)
import Control.Exception qualified as Exception
import Control.DeepSeq (deepseq)
@@ -123,7 +139,7 @@ import Data.ByteString qualified as ByteString
import Data.List qualified as List
import Data.List.NonEmpty qualified as NonEmpty
import Data.Map.Strict qualified as Map
-import Data.Maybe (catMaybes)
+import Data.Maybe (catMaybes, mapMaybe)
import Data.Set qualified as Set
import Data.Text qualified as Text
import Data.Unique (Unique, newUnique)
@@ -205,6 +221,8 @@ data LogicalBuilder = LogicalBuilder
:: !(Map SemanticName ImportedAliasBinding)
, logicalBuilderGlobals
:: !(Map SemanticGlobalKey SemanticGlobalTarget)
+ , logicalBuilderStructures
+ :: !(Map SemanticStructurePhrase ResolvedStructure)
, logicalBuilderImportedInterfaces :: !(Set SemanticInterfaceId)
, logicalBuilderDeltas :: ![DeclarationInterfaceDelta]
, logicalBuilderNextDeclaration :: !Natural
@@ -212,6 +230,55 @@ data LogicalBuilder = LogicalBuilder
, logicalBuilderNextInvocation :: !Natural
}
+data ResolvedStructureOperation = ResolvedStructureOperation
+ !ObjectId
+ !SemanticStructurePhrase
+ deriving stock (Show, Eq)
+
+data ResolvedStructure = ResolvedStructure
+ !SemanticStructureDescriptor
+ !(Set SemanticStructurePhrase)
+ !(Map StructSymbol ResolvedStructureOperation)
+ deriving stock (Show, Eq)
+
+resolvedStructureDescriptor
+ :: ResolvedStructure
+ -> SemanticStructureDescriptor
+resolvedStructureDescriptor (ResolvedStructure descriptor _ _) =
+ descriptor
+
+resolvedStructurePredicate :: ResolvedStructure -> Maybe ObjectId
+resolvedStructurePredicate =
+ semanticStructureDescriptorPredicate . resolvedStructureDescriptor
+
+resolvedStructureOperation
+ :: StructSymbol
+ -> ResolvedStructure
+ -> Maybe ObjectId
+resolvedStructureOperation symbol (ResolvedStructure _ _ operations) =
+ operationObject <$> Map.lookup symbol operations
+ where
+ operationObject (ResolvedStructureOperation object _origin) = object
+
+resolvedStructureOperations
+ :: ResolvedStructure
+ -> Map StructSymbol ObjectId
+resolvedStructureOperations (ResolvedStructure _ _ operations) =
+ operationObject <$> operations
+ where
+ operationObject (ResolvedStructureOperation object _origin) = object
+
+structureOperationBindings
+ :: Map SemanticStructurePhrase ResolvedStructure
+ -> Set (StructSymbol, ObjectId)
+structureOperationBindings structures =
+ Set.fromList
+ [ (symbol, object)
+ | structure <- Map.elems structures
+ , (symbol, object) <-
+ Map.toAscList (resolvedStructureOperations structure)
+ ]
+
data CommittedDeclarationBatch = CommittedDeclarationBatch
!ModuleName
@@ -370,18 +437,37 @@ forceCommittedBatch
newtype VampireResolver = VampireResolver
- { resolveVampire
+ { resolveVampireBatch
:: forall local origin.
- Provers.PreparedTypedProverTask
+ NonEmpty
+ (Provers.PreparedTypedProverTask
+ SemanticFactOccurrenceFingerprint
+ local
+ origin
+ ObjectId)
+ -> IO
+ (NonEmpty
+ (Either
+ Provers.ProverProcessError
+ Provers.ProverAnswer))
+ }
+
+vampireBatchResolver
+ :: (forall local origin.
+ NonEmpty
+ (Provers.PreparedTypedProverTask
SemanticFactOccurrenceFingerprint
local
origin
- ObjectId
- -> IO
+ ObjectId)
+ -> IO
+ (NonEmpty
(Either
Provers.ProverProcessError
- Provers.ProverAnswer)
- }
+ Provers.ProverAnswer)))
+ -> VampireResolver
+vampireBatchResolver =
+ VampireResolver
vampireResolver
:: (forall local origin.
@@ -395,8 +481,39 @@ vampireResolver
Provers.ProverProcessError
Provers.ProverAnswer))
-> VampireResolver
-vampireResolver =
- VampireResolver
+vampireResolver resolve =
+ vampireBatchResolver (traverse resolve)
+
+resolveOneVampire
+ :: VampireResolver
+ -> Provers.PreparedTypedProverTask
+ SemanticFactOccurrenceFingerprint
+ local
+ origin
+ ObjectId
+ -> ExceptT DeclarationError IO
+ (Either
+ Provers.ProverProcessError
+ Provers.ProverAnswer)
+resolveOneVampire resolver prepared = do
+ results@(result :| _) <-
+ liftIO (resolveVampireBatch resolver (prepared :| []))
+ void
+ (Except.liftEither
+ (validateVampireResolverResultCount 1 results))
+ pure result
+
+validateVampireResolverResultCount
+ :: Int
+ -> NonEmpty value
+ -> Either DeclarationError [value]
+validateVampireResolverResultCount expected results
+ | expected == actual =
+ Right (NonEmpty.toList results)
+ | otherwise =
+ Left (VampireResolverBatchSizeMismatch expected actual)
+ where
+ actual = NonEmpty.length results
data DriverState = DriverState
!VampireResolver
@@ -595,8 +712,11 @@ validateEvidenceInventory
-> ImportedModuleEvidence
-> Either DeclarationError ()
validateEvidenceInventory theory closure evidence =
- void (foldEvidence Set.empty Map.empty Map.empty evidence)
- *> void (foldGlobals Set.empty Map.empty evidence)
+ do
+ void (foldEvidence Set.empty Map.empty Map.empty evidence)
+ (_seen, structures) <-
+ foldStructures Set.empty Map.empty evidence
+ void (foldGlobals structures Set.empty Map.empty evidence)
where
foldEvidence seen facts aliases current
| identity `Set.member` seen =
@@ -678,19 +798,20 @@ validateEvidenceInventory theory closure evidence =
(ImportedAliasCollision
name existingOrigin origin)
- foldGlobals seen globals current
+ foldGlobals structures seen globals current
| identity `Set.member` seen =
Right (seen, globals)
| otherwise = do
(parentsSeen, parentGlobals) <-
foldM
(\(seen', globals') parent ->
- foldGlobals seen' globals' parent)
+ foldGlobals structures seen' globals' parent)
(seen, globals)
parents
globals' <-
foldM
- (insertGlobal current)
+ (insertGlobal
+ (structureOperationBindings structures))
parentGlobals
[ binding
| delta <- semanticInterfaceDeclarations interface
@@ -702,13 +823,15 @@ validateEvidenceInventory theory closure evidence =
ImportedModuleEvidence interface parents _entries _objects = current
identity = semanticInterfaceAssertedId interface
- insertGlobal _current globals binding = do
+ insertGlobal operationBindings globals binding = do
let key = semanticGlobalBindingKey binding
target = semanticGlobalBindingTarget binding
_ <-
first
(ImportedGlobalTargetInvalid key target)
- (validateSemanticGlobalBindingTarget closure binding)
+ (validateSemanticGlobalBindingTarget
+ operationBindings
+ closure binding)
case Map.lookup key globals of
Nothing -> Right (Map.insert key target globals)
Just existing
@@ -716,6 +839,30 @@ validateEvidenceInventory theory closure evidence =
| otherwise ->
Left (ImportedGlobalCollision key existing target)
+ foldStructures seen structures current
+ | identity `Set.member` seen =
+ Right (seen, structures)
+ | otherwise = do
+ (parentsSeen, parentStructures) <-
+ foldM
+ (\(seen', structures') parent ->
+ foldStructures seen' structures' parent)
+ (seen, structures)
+ parents
+ structures' <-
+ foldM
+ (insertSemanticStructure closure)
+ parentStructures
+ [ descriptor
+ | delta <- semanticInterfaceDeclarations interface
+ , descriptor <- semanticEnvironmentStructures
+ (declarationDeltaEnvironment delta)
+ ]
+ pure (Set.insert identity parentsSeen, structures')
+ where
+ ImportedModuleEvidence interface parents _entries _objects = current
+ identity = semanticInterfaceAssertedId interface
+
evidenceInterface :: ImportedModuleEvidence -> SemanticInterface
evidenceInterface
(ImportedModuleEvidence interface _parents _entries _objects) =
@@ -782,6 +929,7 @@ runModuleDriver
, logicalBuilderFacts = Map.empty
, logicalBuilderAliases = Map.empty
, logicalBuilderGlobals = Map.empty
+ , logicalBuilderStructures = Map.empty
, logicalBuilderImportedInterfaces = Set.empty
, logicalBuilderDeltas = []
, logicalBuilderNextDeclaration = 0
@@ -848,6 +996,17 @@ currentTheoryDriver =
(\(DriverState _resolver builder _prefix _validation) ->
logicalBuilderTheory builder))
+currentFoundationAxiomDriver
+ :: FoundationAxiomTag
+ -> ModuleDriver failure (FrozenCheckedCore Void)
+currentFoundationAxiomDriver tag =
+ ModuleDriver
+ (State.gets
+ (\(DriverState _resolver builder _prefix _validation) ->
+ foundationAxiomFrozen
+ (logicalBuilderFoundation builder)
+ tag))
+
resolveVisibleFactAliasDriver
:: SemanticName
-> ModuleDriver failure
@@ -878,8 +1037,12 @@ resolveVisibleGlobalDriver
resolveVisibleGlobalDriver key = ModuleDriver do
DriverState _resolver builder _prefix _validation <- State.get
pure
- ( (\(target, content, _dependencies) ->
- (target, objectContentType content))
+ ( (\(target, _content, _dependencies) ->
+ ( target
+ , fromMaybe
+ (impossible "visible semantic key has no source type")
+ (semanticGlobalKeyType key)
+ ))
<$> resolveVisibleGlobalContent builder key
)
@@ -895,6 +1058,26 @@ resolveVisibleGlobalContentDriver key = ModuleDriver do
DriverState _resolver builder _prefix _validation <- State.get
pure (resolveVisibleGlobalContent builder key)
+resolveVisibleStructureDriver
+ :: SemanticStructurePhrase
+ -> ModuleDriver failure (Maybe ResolvedStructure)
+resolveVisibleStructureDriver structurePhrase = ModuleDriver do
+ DriverState _resolver builder _prefix _validation <- State.get
+ pure (Map.lookup structurePhrase (logicalBuilderStructures builder))
+
+resolveVisibleStructureOperationObjectsDriver
+ :: StructSymbol
+ -> ModuleDriver failure [ObjectId]
+resolveVisibleStructureOperationObjectsDriver symbol = ModuleDriver do
+ DriverState _resolver builder _prefix _validation <- State.get
+ pure
+ ( Set.toAscList
+ (Set.fromList
+ (mapMaybe
+ (resolvedStructureOperation symbol)
+ (Map.elems (logicalBuilderStructures builder))))
+ )
+
resolveVisibleGlobalContent
:: LogicalBuilder
-> SemanticGlobalKey
@@ -943,6 +1126,17 @@ objectAvailableDriver identity =
identity
(logicalBuilderObjectClosure builder))))
+objectTypeDriver
+ :: ObjectId
+ -> ModuleDriver failure (Maybe CoreType)
+objectTypeDriver identity =
+ ModuleDriver
+ (State.gets
+ (\(DriverState _resolver builder _prefix _validation) ->
+ lookupCheckedObjectType
+ identity
+ (logicalBuilderObjectClosure builder)))
+
data CandidateSpec = CandidateSpec
!CheckedPropositionContent
@@ -1023,6 +1217,8 @@ data DeclarationState = DeclarationState
:: ![CheckedPropositionContent]
, declarationGlobalBindingsReversed
:: ![SemanticGlobalBinding]
+ , declarationStructureDescriptorsReversed
+ :: ![SemanticStructureDescriptor]
, declarationReservations
:: !(Map FactSlot ReservedCandidate)
, declarationPending :: !(Map FactSlot PendingCandidate)
@@ -1084,10 +1280,7 @@ resolveVisibleGlobal key = Declaration do
let builder = declarationBuilder state
pure do
target <- Map.lookup key (logicalBuilderGlobals builder)
- coreType <-
- lookupCheckedObjectType
- (semanticGlobalTargetObject target)
- (logicalBuilderObjectClosure builder)
+ coreType <- semanticGlobalKeyType key
pure (target, coreType)
stageSemanticGlobalBinding
@@ -1116,6 +1309,32 @@ stageSemanticGlobalBinding key target = Declaration do
: declarationGlobalBindingsReversed state
}
+stageSemanticStructureDescriptor
+ :: SemanticStructureDescriptor
+ -> Declaration ()
+stageSemanticStructureDescriptor descriptor = Declaration do
+ state <- State.get
+ case declarationValidationSelection state of
+ DeclarationValidationUnselected -> pure ()
+ _ ->
+ State.lift
+ (Except.throwError
+ DeclarationShapeChangedAfterValidationLookup)
+ let structurePhrase = semanticStructureDescriptorPhrase descriptor
+ when
+ (any
+ ((== structurePhrase) . semanticStructureDescriptorPhrase)
+ (declarationStructureDescriptorsReversed state))
+ (State.lift
+ (Except.throwError
+ (DeclarationStructureAlreadyStaged structurePhrase)))
+ State.put
+ state
+ { declarationStructureDescriptorsReversed =
+ descriptor
+ : declarationStructureDescriptorsReversed state
+ }
+
reserveCandidate
:: CandidateSpec
-> Declaration ReservedCandidate
@@ -1307,6 +1526,55 @@ reserveDefinitionEquationCandidate identity alias = Declaration do
SearchEligible
[alias]))
+-- | Construct the pointwise presentation of one unary transparent predicate
+-- definition. The candidate remains tied to the object's checked content.
+reservePointwiseDefinitionEquationCandidate
+ :: ObjectId
+ -> SemanticName
+ -> Declaration ReservedCandidate
+reservePointwiseDefinitionEquationCandidate identity alias = Declaration do
+ unprepared <- State.get
+ prepared <-
+ State.lift
+ (Except.liftEither
+ (prepareDeclarationClosure unprepared))
+ content <-
+ maybe
+ (State.lift
+ (Except.throwError
+ (DefinitionEquationObjectMissing identity)))
+ pure
+ (lookupCheckedObjectContent
+ identity
+ (fromMaybe
+ (impossible "prepared predicate closure is absent")
+ (declarationObjectClosure prepared)))
+ body <-
+ case content of
+ TransparentObjectContent _theory
+ (TyArrow TySet TyProp) (CLam TySet predicate) ->
+ pure predicate
+ _ ->
+ State.lift
+ (Except.throwError
+ (DefinitionEquationObjectNotPointwisePredicate identity))
+ proposition <-
+ State.lift
+ (Except.liftEither
+ (first DeclarationPropositionValidationFailed
+ (validatePropositionContent
+ (fromMaybe
+ (impossible "prepared predicate closure is absent")
+ (declarationObjectClosure prepared))
+ (CForall TySet
+ (CEq TyProp
+ (CApp (CGlobal identity) (CBound 0))
+ body)))))
+ State.put prepared
+ runDeclaration
+ (reserveCandidate
+ (candidateSpec proposition SearchEligible [alias]))
+
-- | Reserve one defining equation and a nonempty generated-fact batch at the
-- same declaration stage. No candidate in the batch can cite a sibling.
reserveDefinitionEquationCandidateBatch
@@ -2016,8 +2284,16 @@ foldImportedEvidence evidence builder
| delta <- semanticInterfaceDeclarations interface
, alias <- declarationDeltaAliases delta
]
+ importedStructures <- foldM
+ (insertSemanticStructure objectClosure)
+ (logicalBuilderStructures withParents)
+ [ descriptor
+ | delta <- semanticInterfaceDeclarations interface
+ , descriptor <- semanticEnvironmentStructures
+ (declarationDeltaEnvironment delta)
+ ]
importedGlobals <- foldM
- (insertImportedGlobal objectClosure)
+ (insertImportedGlobal objectClosure importedStructures)
(logicalBuilderGlobals withParents)
[ binding
| delta <- semanticInterfaceDeclarations interface
@@ -2029,6 +2305,7 @@ foldImportedEvidence evidence builder
{ logicalBuilderFacts = importedFacts
, logicalBuilderAliases = importedAliases
, logicalBuilderGlobals = importedGlobals
+ , logicalBuilderStructures = importedStructures
, logicalBuilderObjectClosure = objectClosure
, logicalBuilderImportedInterfaces =
Set.insert
@@ -2098,13 +2375,15 @@ foldImportedEvidence evidence builder
(ImportedAliasCollision
name existingOrigin origin)
- insertImportedGlobal closure globals binding = do
+ insertImportedGlobal closure structures globals binding = do
let key = semanticGlobalBindingKey binding
target = semanticGlobalBindingTarget binding
_ <-
first
(ImportedGlobalTargetInvalid key target)
- (validateSemanticGlobalBindingTarget closure binding)
+ (validateSemanticGlobalBindingTarget
+ (structureOperationBindings structures)
+ closure binding)
case Map.lookup key globals of
Nothing -> pure (Map.insert key target globals)
Just existing
@@ -2112,6 +2391,109 @@ foldImportedEvidence evidence builder
| otherwise ->
Left (ImportedGlobalCollision key existing target)
+insertSemanticStructure
+ :: CheckedObjectClosure
+ -> Map SemanticStructurePhrase ResolvedStructure
+ -> SemanticStructureDescriptor
+ -> Either
+ DeclarationError
+ (Map SemanticStructurePhrase ResolvedStructure)
+insertSemanticStructure closure structures descriptor = do
+ validateSemanticStructureTargets closure descriptor
+ let structurePhrase = semanticStructureDescriptorPhrase descriptor
+ case Map.lookup structurePhrase structures of
+ Just (ResolvedStructure existing _ _)
+ | existing == descriptor -> Right structures
+ | otherwise ->
+ Left
+ (ImportedStructureCollision
+ structurePhrase existing descriptor)
+ Nothing -> do
+ parents <- traverse resolveParent
+ (semanticStructureDescriptorParents descriptor)
+ inherited <- foldM mergeParentOperations Map.empty parents
+ complete <- foldM insertOwnOperation inherited
+ (semanticStructureDescriptorOperations descriptor)
+ let ancestors =
+ Set.unions
+ [ Set.insert
+ (semanticStructureDescriptorPhrase
+ (resolvedStructureDescriptor parent))
+ parentAncestors
+ | parent@(ResolvedStructure _ parentAncestors _) <- parents
+ ]
+ resolved = ResolvedStructure descriptor ancestors complete
+ Right (Map.insert structurePhrase resolved structures)
+ where
+ resolveParent parentPhrase =
+ maybe
+ (Left
+ (SemanticStructureParentMissing
+ (semanticStructureDescriptorPhrase descriptor)
+ parentPhrase))
+ Right
+ (Map.lookup parentPhrase structures)
+
+ mergeParentOperations operations
+ (ResolvedStructure _descriptor _ancestors parentOperations) =
+ foldM insertInheritedOperation operations
+ (Map.toAscList parentOperations)
+
+ insertInheritedOperation operations (symbol, operation) =
+ insertResolvedOperation symbol operation operations
+
+ insertOwnOperation operations operation =
+ insertResolvedOperation
+ (semanticStructureOperationSymbol operation)
+ (ResolvedStructureOperation
+ (semanticStructureOperationObject operation)
+ (semanticStructureDescriptorPhrase descriptor))
+ operations
+
+ insertResolvedOperation symbol incoming operations =
+ case Map.lookup symbol operations of
+ Nothing -> Right (Map.insert symbol incoming operations)
+ Just (ResolvedStructureOperation existingObject existingOrigin) ->
+ case incoming of
+ ResolvedStructureOperation incomingObject incomingOrigin
+ | existingObject == incomingObject -> Right operations
+ | otherwise ->
+ Left
+ (SemanticStructureOperationConflict
+ symbol existingOrigin incomingOrigin)
+
+validateSemanticStructureTargets
+ :: CheckedObjectClosure
+ -> SemanticStructureDescriptor
+ -> Either DeclarationError ()
+validateSemanticStructureTargets closure descriptor = do
+ traverse_ validatePredicate
+ (semanticStructureDescriptorPredicate descriptor)
+ traverse_ validateOperation
+ (semanticStructureDescriptorOperations descriptor)
+ where
+ validatePredicate object =
+ validateObjectType
+ (SemanticStructurePredicateTargetInvalid
+ (semanticStructureDescriptorPhrase descriptor))
+ object
+ (TyArrow TySet TyProp)
+
+ validateOperation operation =
+ validateObjectType
+ (SemanticStructureOperationTargetInvalid
+ (semanticStructureDescriptorPhrase descriptor)
+ (semanticStructureOperationSymbol operation))
+ (semanticStructureOperationObject operation)
+ (TyArrow TySet TySet)
+
+ validateObjectType failure object expected =
+ case lookupCheckedObjectType object closure of
+ Nothing -> Left (failure object Nothing expected)
+ Just actual
+ | actual == expected -> Right ()
+ | otherwise -> Left (failure object (Just actual) expected)
+
equivalentAuthorizedFact :: AuthorizedFact -> AuthorizedFact -> Bool
equivalentAuthorizedFact
(AuthorizedFact leftProposition leftOccurrence
@@ -2435,6 +2817,75 @@ acceptPreparedVampireObligation
(validatePreparedVampireProblem expected prepared)
prepared
+-- | Prepare and execute the current closed candidate using exactly the
+-- staged premises already consumed by its trusted declaration compiler.
+acceptCurrentCandidateVampire :: CandidateProof ()
+acceptCurrentCandidateVampire =
+ prepareCurrentCandidateVampire
+ >>= acceptPreparedVampireObligation
+
+-- | Prepare the current closed candidate without executing its request. The
+-- declaration-owned batch authorizer uses this seam only after all strictly
+-- earlier staged premises have been consumed.
+prepareCurrentCandidateVampire
+ :: CandidateProof (PreparedVampireObligation Void ())
+prepareCurrentCandidateVampire = CandidateProof do
+ initial <- State.get
+ let builder = candidateProofBuilder initial
+ closure = candidateProofObjectClosure initial
+ globalType = (`lookupCheckedObjectType` closure)
+ target = candidateCheckedProposition
+ (candidateProofCandidate initial)
+ premises = reverse (candidateProofPremisesReversed initial)
+ closed proposition =
+ embedClosedCore []
+ (checkedPropositionTerm proposition)
+ supportedTarget <-
+ State.lift
+ (Except.liftEither
+ (first
+ (CurrentCandidateVampirePreparationFailed
+ . VampireObligationClaimProjectionFailed)
+ (Backend.projectSupportedProposition
+ globalType
+ (Vector.empty :: Vector (Void, CoreType))
+ (closed target))))
+ locals <-
+ State.lift
+ (Except.liftEither
+ (first CurrentCandidateVampirePreparationFailed
+ (traverse
+ (prepareLocal globalType)
+ (zip [0 :: Natural ..] premises))))
+ prepared <-
+ State.lift
+ (Except.liftEither
+ (first CurrentCandidateVampirePreparationFailed
+ (prepareVampireObligationWith
+ Provers.DirectTask
+ builder
+ closure
+ supportedTarget
+ locals
+ []
+ VampireLocalPremises)))
+ pure prepared
+ where
+ prepareLocal globalType (index, CandidatePremise proposition) = do
+ let ordinal = Backend.localPremiseOrdinal index
+ supported <-
+ first
+ (VampireObligationLocalProjectionFailed ordinal)
+ (Backend.projectSupportedProposition
+ globalType
+ (Vector.empty :: Vector (Void, CoreType))
+ (embedClosedCore []
+ (checkedPropositionTerm proposition)))
+ first
+ (VampireObligationLocalClassificationFailed ordinal)
+ (Backend.typedLocalPremise
+ globalType ordinal () supported)
+
acceptValidatedVampireTask
:: (CandidateProofState
-> ExceptT DeclarationError IO CandidateProofState)
@@ -2447,39 +2898,20 @@ acceptValidatedVampireTask
acceptValidatedVampireTask validate prepared = CandidateProof do
initial <- State.get
validated <- State.lift (validate initial)
- let request = Provers.preparedTypedProverRequest prepared
- case candidateProofCachedValidation initial of
- Nothing -> do
- let resolver =
- declarationVampireResolver
- (candidateProofDeclaration initial)
- result <- liftIO (resolveVampire resolver prepared)
- accepted <-
- case result of
- Left err ->
- State.lift
- (Except.throwError
- (VampireProcessFailed err))
- Right answer ->
- maybe
- (State.lift
- (Except.throwError
- (VampireObligationRejected answer)))
- pure
- (Provers.provedVampireRun answer)
- unless
- (Provers.acceptedVampireRequest accepted == request)
- (State.lift
- (Except.throwError VampireRequestMismatch))
- Just _validation ->
- pure ()
- let requestId = Provers.preparedVerificationRequestId request
- State.put
- validated
- { candidateProofAcceptedRequestsReversed =
- requestId
- : candidateProofAcceptedRequestsReversed validated
- }
+ result <-
+ case candidateProofCachedValidation initial of
+ Nothing -> do
+ let resolver =
+ declarationVampireResolver
+ (candidateProofDeclaration initial)
+ Just <$> State.lift (resolveOneVampire resolver prepared)
+ Just _validation ->
+ pure Nothing
+ final <-
+ State.lift
+ (acceptVampireBatchMemberResult
+ prepared result validated)
+ State.put final
-- | Complete one checked source candidate after all of its obligations have
-- been accepted in source order. The enclosing proof declaration owns the
@@ -2509,6 +2941,333 @@ authorizeVampireCandidate candidate proof =
(candidateProofSafety final)
final
+data PreparedVampireCandidateBatchMember =
+ PreparedVampireCandidateBatchMember
+ !Location
+ !ReservedCandidate
+ !(Provers.PreparedTypedProverTask
+ SemanticFactOccurrenceFingerprint
+ Void
+ ()
+ ObjectId)
+ !CandidateProofState
+
+data ResolvedVampireCandidateBatchMember =
+ ResolvedVampireCandidateBatchMember
+ !PreparedVampireCandidateBatchMember
+ !(Maybe
+ (Either
+ Provers.ProverProcessError
+ Provers.ProverAnswer))
+
+-- | Authorize one complete, source-ordered candidate stage whose members are
+-- mutually independent and each require exactly one closed Vampire request.
+-- Every member is prepared and validated against the same declaration
+-- baseline. Results are applied only after the complete live batch returns,
+-- so no same-stage sibling can become authority for another member.
+authorizeVampireCandidateBatch
+ :: NonEmpty
+ ( Location
+ , ReservedCandidate
+ , CandidateProof (PreparedVampireObligation Void ())
+ )
+ -> Declaration ()
+authorizeVampireCandidateBatch inputs = Declaration do
+ unprepared <- State.get
+ baseline <-
+ State.lift
+ (Except.liftEither
+ (prepareDeclarationClosure unprepared))
+ let supplied =
+ [ candidate
+ | (_location, candidate, _prepare) <- NonEmpty.toList inputs
+ ]
+ frontier = declarationAuthorizationFrontier baseline
+ expected =
+ List.filter
+ ((== CandidateStage frontier) . reservedStage)
+ (Map.elems (declarationReservations baseline))
+ traverse_
+ (State.lift
+ . Except.liftEither
+ . validateReservedCandidate baseline)
+ supplied
+ traverse_
+ (\candidate ->
+ when
+ (Map.member
+ (reservedCandidateSlot candidate)
+ (declarationPending baseline))
+ (State.lift
+ (Except.throwError
+ (CandidateAlreadyAuthorized
+ (reservedCandidateSlot candidate)))))
+ supplied
+ unless (supplied == expected)
+ (State.lift
+ (Except.throwError
+ (VampireCandidateBatchMismatch
+ (reservedCandidateSlot <$> expected)
+ (reservedCandidateSlot <$> supplied))))
+ prepared <-
+ State.lift
+ (traverse
+ (prepareVampireCandidateBatchMember baseline)
+ inputs)
+ State.lift
+ (validateCachedVampireCandidateBatch
+ (NonEmpty.toList prepared))
+ let live =
+ [ task
+ | PreparedVampireCandidateBatchMember
+ _location _candidate task final <-
+ NonEmpty.toList prepared
+ , isNothing (candidateProofCachedValidation final)
+ ]
+ liveResults <-
+ case NonEmpty.nonEmpty live of
+ Nothing -> pure []
+ Just nonempty -> do
+ let resolver =
+ declarationVampireResolver baseline
+ results <- liftIO (resolveVampireBatch resolver nonempty)
+ State.lift
+ (Except.liftEither
+ (validateVampireResolverResultCount
+ (length live)
+ results))
+ pending <-
+ State.lift
+ (completeVampireCandidateBatch
+ (NonEmpty.toList prepared)
+ liveResults)
+ let withPending =
+ baseline
+ { declarationPending =
+ foldl'
+ (\entries item@(PendingCandidate candidate _ _) ->
+ Map.insert
+ (reservedCandidateSlot
+ candidate)
+ item
+ entries)
+ (declarationPending baseline)
+ pending
+ }
+ State.put (advanceAuthorizationFrontier withPending)
+
+prepareVampireCandidateBatchMember
+ :: DeclarationState
+ -> ( Location
+ , ReservedCandidate
+ , CandidateProof (PreparedVampireObligation Void ())
+ )
+ -> ExceptT DeclarationError IO PreparedVampireCandidateBatchMember
+prepareVampireCandidateBatchMember
+ baseline (location, candidate, prepare) = do
+ initial <-
+ Except.liftEither
+ (initialCandidateProofState baseline candidate)
+ cached <- selectProofCandidateValidation candidate initial
+ let selected =
+ initial{candidateProofCachedValidation = cached}
+ (obligation, preparedState) <-
+ State.runStateT
+ (runCandidateProof
+ (locateProofObligation location prepare))
+ selected
+ unless (null (acceptedRequestIds preparedState))
+ (Except.throwError
+ (VampireCandidateBatchProofShapeMismatch
+ (reservedCandidateSlot candidate)))
+ let PreparedVampireObligation expected task = obligation
+ validated <-
+ Except.withExceptT
+ (ProofObligationFailedAt location)
+ (validatePreparedVampireProblem
+ expected task preparedState)
+ pure
+ (PreparedVampireCandidateBatchMember
+ location candidate task validated)
+
+completeVampireCandidateBatch
+ :: [PreparedVampireCandidateBatchMember]
+ -> [Either Provers.ProverProcessError Provers.ProverAnswer]
+ -> ExceptT DeclarationError IO [PendingCandidate]
+completeVampireCandidateBatch members liveResults = do
+ resolved <-
+ Except.liftEither
+ (associateVampireCandidateBatchResults
+ members liveResults)
+ -- Integrity dominates ranked proof failure: validate every accepted run
+ -- before inspecting any ordinary process or prover rejection.
+ traverse_ validateAcceptedVampireBatchMember resolved
+ traverse_ rejectOrdinaryVampireBatchMember resolved
+ traverse completeVampireCandidateBatchMember resolved
+
+validateCachedVampireCandidateBatch
+ :: [PreparedVampireCandidateBatchMember]
+ -> ExceptT DeclarationError IO ()
+validateCachedVampireCandidateBatch =
+ traverse_ \member ->
+ when
+ (preparedVampireCandidateBatchMemberIsCached member)
+ (void
+ (completeVampireCandidateBatchMember
+ (ResolvedVampireCandidateBatchMember member Nothing)))
+
+associateVampireCandidateBatchResults
+ :: [PreparedVampireCandidateBatchMember]
+ -> [Either Provers.ProverProcessError Provers.ProverAnswer]
+ -> Either
+ DeclarationError
+ [ResolvedVampireCandidateBatchMember]
+associateVampireCandidateBatchResults members =
+ go members
+ where
+ go [] [] = Right []
+ go [] results =
+ Left
+ (VampireResolverBatchSizeMismatch
+ 0
+ (length results))
+ go (member : remaining) results
+ | preparedVampireCandidateBatchMemberIsCached member =
+ (ResolvedVampireCandidateBatchMember member Nothing :)
+ <$> go remaining results
+ | otherwise =
+ case results of
+ [] ->
+ Left (VampireResolverBatchSizeMismatch 1 0)
+ current : later ->
+ (ResolvedVampireCandidateBatchMember
+ member (Just current) :)
+ <$> go remaining later
+
+preparedVampireCandidateBatchMemberIsCached
+ :: PreparedVampireCandidateBatchMember
+ -> Bool
+preparedVampireCandidateBatchMemberIsCached
+ (PreparedVampireCandidateBatchMember
+ _location _candidate _task state) =
+ isJust (candidateProofCachedValidation state)
+
+validateAcceptedVampireBatchMember
+ :: ResolvedVampireCandidateBatchMember
+ -> ExceptT DeclarationError IO ()
+validateAcceptedVampireBatchMember
+ (ResolvedVampireCandidateBatchMember
+ (PreparedVampireCandidateBatchMember
+ location _candidate task _validated)
+ result) =
+ Except.withExceptT
+ (ProofObligationFailedAt location)
+ (validateAcceptedVampireResult task result)
+
+rejectOrdinaryVampireBatchMember
+ :: ResolvedVampireCandidateBatchMember
+ -> ExceptT DeclarationError IO ()
+rejectOrdinaryVampireBatchMember
+ (ResolvedVampireCandidateBatchMember
+ (PreparedVampireCandidateBatchMember
+ location _candidate _task _validated)
+ result) =
+ traverse_
+ (Except.throwError . ProofObligationFailedAt location)
+ (result >>= vampireResultFailure)
+
+completeVampireCandidateBatchMember
+ :: ResolvedVampireCandidateBatchMember
+ -> ExceptT DeclarationError IO PendingCandidate
+completeVampireCandidateBatchMember
+ (ResolvedVampireCandidateBatchMember
+ (PreparedVampireCandidateBatchMember
+ location candidate task validated)
+ result) = do
+ final <-
+ Except.withExceptT
+ (ProofObligationFailedAt location)
+ (applyAcceptedVampireResult task result validated)
+ completeCandidateWithValidation
+ candidate
+ (CheckedSourceProof (acceptedRequestIds final))
+ (candidateProofSafety final)
+ final
+
+acceptVampireBatchMemberResult
+ :: Provers.PreparedTypedProverTask
+ SemanticFactOccurrenceFingerprint
+ local
+ origin
+ ObjectId
+ -> Maybe (Either Provers.ProverProcessError Provers.ProverAnswer)
+ -> CandidateProofState
+ -> ExceptT DeclarationError IO CandidateProofState
+acceptVampireBatchMemberResult prepared result validated = do
+ validateAcceptedVampireResult prepared result
+ traverse_ Except.throwError (result >>= vampireResultFailure)
+ applyAcceptedVampireResult prepared result validated
+
+validateAcceptedVampireResult
+ :: Provers.PreparedTypedProverTask
+ SemanticFactOccurrenceFingerprint
+ local
+ origin
+ ObjectId
+ -> Maybe (Either Provers.ProverProcessError Provers.ProverAnswer)
+ -> ExceptT DeclarationError IO ()
+validateAcceptedVampireResult prepared result = do
+ let request = Provers.preparedTypedProverRequest prepared
+ traverse_
+ (\resolved ->
+ traverse_
+ (\accepted ->
+ unless
+ (Provers.acceptedVampireRequest accepted == request)
+ (Except.throwError VampireRequestMismatch))
+ (either (const Nothing) Provers.provedVampireRun resolved))
+ result
+
+vampireResultFailure
+ :: Either Provers.ProverProcessError Provers.ProverAnswer
+ -> Maybe DeclarationError
+vampireResultFailure = \case
+ Left failure ->
+ Just (VampireProcessFailed failure)
+ Right answer ->
+ case Provers.provedVampireRun answer of
+ Nothing ->
+ Just (VampireObligationRejected answer)
+ Just _accepted ->
+ Nothing
+
+applyAcceptedVampireResult
+ :: Provers.PreparedTypedProverTask
+ SemanticFactOccurrenceFingerprint
+ local
+ origin
+ ObjectId
+ -> Maybe (Either Provers.ProverProcessError Provers.ProverAnswer)
+ -> CandidateProofState
+ -> ExceptT DeclarationError IO CandidateProofState
+applyAcceptedVampireResult prepared result validated = do
+ traverse_
+ (\resolved ->
+ case vampireResultFailure resolved of
+ Just failure ->
+ Except.throwError failure
+ Nothing ->
+ pure ())
+ result
+ let request = Provers.preparedTypedProverRequest prepared
+ requestId = Provers.preparedVerificationRequestId request
+ pure
+ validated
+ { candidateProofAcceptedRequestsReversed =
+ requestId
+ : candidateProofAcceptedRequestsReversed validated
+ }
+
selectProofCandidateValidation
:: ReservedCandidate
-> CandidateProofState
@@ -2989,15 +3748,27 @@ matchesDefinitionEquation identity proposition proofState =
contentTheory
== logicalBuilderTheory
(candidateProofBuilder proofState)
- && frozenCoreTerm
- (checkedPropositionTerm proposition)
- == CEq
- coreType
- (CGlobal identity)
- body
+ && frozenCoreTerm (checkedPropositionTerm proposition)
+ `elem` definitionEquationTargets identity coreType body
_ ->
False
+definitionEquationTargets
+ :: ObjectId
+ -> CoreType
+ -> CanonicalTerm ObjectId
+ -> [CanonicalTerm ObjectId]
+definitionEquationTargets identity coreType body =
+ CEq coreType (CGlobal identity) body
+ : case (coreType, body) of
+ (TyArrow TySet TyProp, CLam TySet predicate) ->
+ [ CForall TySet
+ (CEq TyProp
+ (CApp (CGlobal identity) (CBound 0))
+ predicate)
+ ]
+ _ -> []
+
validateCandidateVampireProblem
:: Provers.PreparedTypedProverTask
@@ -3230,6 +4001,7 @@ initialDeclarationState resolver validationRun validationMode builder =
, declarationObjectClosure = Nothing
, declarationPropositionsReversed = []
, declarationGlobalBindingsReversed = []
+ , declarationStructureDescriptorsReversed = []
, declarationReservations = Map.empty
, declarationPending = Map.empty
, declarationNextFact = logicalBuilderNextFact builder
@@ -3284,17 +4056,37 @@ appendDeclaration mode declaration = do
semanticGlobalBindingKey
(reverse
(declarationGlobalBindingsReversed declaration))
+ descriptors =
+ List.sortOn
+ semanticStructureDescriptorPhrase
+ (reverse
+ (declarationStructureDescriptorsReversed declaration))
traverse_
(\binding ->
first
(DeclarationGlobalTargetInvalid
(semanticGlobalBindingKey binding)
(semanticGlobalBindingTarget binding))
- (validateSemanticGlobalBindingTarget closure binding))
+ (validateSemanticGlobalBindingTarget
+ (structureOperationBindings
+ (logicalBuilderStructures builder))
+ closure binding))
bindings
+ traverse_
+ (\descriptor ->
+ let structurePhrase = semanticStructureDescriptorPhrase descriptor
+ in when
+ (Map.member structurePhrase
+ (logicalBuilderStructures builder))
+ (Left (BuilderStructureCollision structurePhrase)))
+ descriptors
+ structures <- foldM
+ (insertSemanticStructure closure)
+ (logicalBuilderStructures builder)
+ descriptors
environment <-
first DeclarationEnvironmentFailed
- (semanticEnvironmentDelta bindings)
+ (semanticEnvironmentWithStructures bindings descriptors)
delta <-
first DeclarationInterfaceFailed
(declarationInterfaceDelta
@@ -3313,6 +4105,7 @@ appendDeclaration mode declaration = do
let builder' =
appendBuilderState
closure
+ structures
delta
next
orderedPending
@@ -3522,13 +4315,14 @@ validateBuilderCollisions builder delta = do
appendBuilderState
:: CheckedObjectClosure
+ -> Map SemanticStructurePhrase ResolvedStructure
-> DeclarationInterfaceDelta
-> PrefixContextId
-> [PendingCandidate]
-> LogicalBuilder
-> DeclarationState
-> LogicalBuilder
-appendBuilderState closure delta next pending builder declaration =
+appendBuilderState closure structures delta next pending builder declaration =
builder
{ logicalBuilderPrefix = next
, logicalBuilderObjectClosure = closure
@@ -3560,6 +4354,7 @@ appendBuilderState closure delta next pending builder declaration =
(logicalBuilderGlobals builder)
(semanticEnvironmentBindings
(declarationDeltaEnvironment delta))
+ , logicalBuilderStructures = structures
, logicalBuilderDeltas =
delta : logicalBuilderDeltas builder
, logicalBuilderNextDeclaration =
@@ -3632,12 +4427,16 @@ data DeclarationError
| KernelConstructionDescriptorMismatch
| DefinitionEquationObjectMissing !ObjectId
| DefinitionEquationObjectNotTransparent !ObjectId
+ | DefinitionEquationObjectNotPointwisePredicate !ObjectId
| DefinitionEquationCandidateMismatch
| DatatypeCompilationDescriptorMismatch
| ProofObligationFailedAt !Location !DeclarationError
| VampireProcessFailed !Provers.ProverProcessError
| VampireObligationRejected !Provers.ProverAnswer
| VampireProofHasNoAcceptedObligations
+ | VampireCandidateBatchMismatch ![FactSlot] ![FactSlot]
+ | VampireCandidateBatchProofShapeMismatch !FactSlot
+ | VampireResolverBatchSizeMismatch !Int !Int
| OmittedProofDidNotRecordUse
| VampireRequestMismatch
| VampireTargetMismatch
@@ -3648,6 +4447,8 @@ data DeclarationError
| VampirePremiseCapabilityMismatch
!SemanticFactOccurrenceFingerprint
| VampireFoundationMismatch !FoundationAxiomTag
+ | CurrentCandidateVampirePreparationFailed
+ !(VampireObligationPreparationError Void)
| ProofValidationOutsideProofDeclaration
| DeclarationValidationOutsideCompiledDeclaration
| DeclarationValidationAlreadySelected
@@ -3669,6 +4470,18 @@ data DeclarationError
!SemanticGlobalKey
!SemanticGlobalTarget
!SemanticGlobalTargetError
+ | ImportedStructureCollision
+ !SemanticStructurePhrase
+ !SemanticStructureDescriptor
+ !SemanticStructureDescriptor
+ | SemanticStructureParentMissing
+ !SemanticStructurePhrase !SemanticStructurePhrase
+ | SemanticStructureOperationConflict
+ !StructSymbol !SemanticStructurePhrase !SemanticStructurePhrase
+ | SemanticStructurePredicateTargetInvalid
+ !SemanticStructurePhrase !ObjectId !(Maybe CoreType) !CoreType
+ | SemanticStructureOperationTargetInvalid
+ !SemanticStructurePhrase !StructSymbol !ObjectId !(Maybe CoreType) !CoreType
| ImportedEvidenceDirectMismatch
![SemanticInterfaceId] ![SemanticInterfaceId]
| ImportedEvidenceInterfaceFailed !SemanticInterfaceError
@@ -3682,6 +4495,7 @@ data DeclarationError
| DeclarationInterfaceFailed !DeclarationInterfaceError
| DeclarationEnvironmentFailed !SemanticEnvironmentError
| DeclarationGlobalAlreadyStaged !SemanticGlobalKey
+ | DeclarationStructureAlreadyStaged !SemanticStructurePhrase
| DeclarationGlobalTargetInvalid
!SemanticGlobalKey
!SemanticGlobalTarget
@@ -3692,6 +4506,7 @@ data DeclarationError
| BuilderAliasCollision !SemanticName
| BuilderObjectCollision !ObjectId
| BuilderGlobalCollision !SemanticGlobalKey !SemanticGlobalTarget
+ | BuilderStructureCollision !SemanticStructurePhrase
deriving stock (Show, Eq)
declarationErrorLocation :: DeclarationError -> Maybe Location
@@ -3746,6 +4561,9 @@ renderDeclarationError = \case
"definition equation references missing object " <> shown identity
DefinitionEquationObjectNotTransparent identity ->
"definition equation references non-transparent object " <> shown identity
+ DefinitionEquationObjectNotPointwisePredicate identity ->
+ "definition equation object " <> shown identity
+ <> " is not a unary predicate definition"
DefinitionEquationCandidateMismatch ->
"definition equation does not match its checked object content"
DatatypeCompilationDescriptorMismatch ->
@@ -3758,6 +4576,16 @@ renderDeclarationError = \case
"Vampire did not accept a declaration obligation"
VampireProofHasNoAcceptedObligations ->
"Vampire proof contains no accepted obligations"
+ VampireCandidateBatchMismatch expected actual ->
+ "Vampire candidate batch does not match the complete authorization "
+ <> "stage (expected " <> shown expected
+ <> ", found " <> shown actual <> ")"
+ VampireCandidateBatchProofShapeMismatch slot ->
+ "Vampire candidate " <> shown slot
+ <> " performed execution before its ready batch"
+ VampireResolverBatchSizeMismatch expected actual ->
+ "Vampire resolver returned " <> shown actual
+ <> " results for " <> shown expected <> " requests"
OmittedProofDidNotRecordUse ->
"omitted proof completion did not record an omission"
VampireRequestMismatch ->
@@ -3774,6 +4602,8 @@ renderDeclarationError = \case
"Vampire request lacks authority for premise " <> shown fingerprint
VampireFoundationMismatch tag ->
"Vampire request has inconsistent foundation axiom " <> shown tag
+ CurrentCandidateVampirePreparationFailed failure ->
+ "the staged Vampire obligation could not be prepared: " <> shown failure
ProofValidationOutsideProofDeclaration ->
"proof validation requires a proof declaration"
DeclarationValidationOutsideCompiledDeclaration ->
@@ -3808,6 +4638,20 @@ renderDeclarationError = \case
ImportedEvidenceDirectMismatch expected actual ->
"imported semantic parents differ: expected " <> shown expected
<> ", found " <> shown actual
+ ImportedStructureCollision structurePhrase _existing _incoming ->
+ "structure " <> shown structurePhrase <> " has conflicting descriptors"
+ SemanticStructureParentMissing structurePhrase parent ->
+ "structure " <> shown structurePhrase <> " has unknown parent " <> shown parent
+ SemanticStructureOperationConflict symbol firstOrigin secondOrigin ->
+ "structure operation " <> shown symbol <> " conflicts between "
+ <> shown firstOrigin <> " and " <> shown secondOrigin
+ SemanticStructurePredicateTargetInvalid structurePhrase object _actual expected ->
+ "structure " <> shown structurePhrase <> " has invalid predicate object "
+ <> shown object <> " (expected " <> shown expected <> ")"
+ SemanticStructureOperationTargetInvalid structurePhrase symbol object _actual expected ->
+ "structure " <> shown structurePhrase <> " has invalid operation "
+ <> shown symbol <> " object " <> shown object
+ <> " (expected " <> shown expected <> ")"
ImportedEvidenceInterfaceFailed{} ->
"imported semantic interface failed validation"
ImportedEvidenceObjectMissing identity ->
@@ -3828,6 +4672,8 @@ renderDeclarationError = \case
"declaration environment delta is inconsistent"
DeclarationGlobalAlreadyStaged key ->
"global " <> shown key <> " was staged more than once"
+ DeclarationStructureAlreadyStaged structurePhrase ->
+ "structure " <> shown structurePhrase <> " was staged more than once"
DeclarationGlobalTargetInvalid key target _failure ->
"global " <> shown key <> " has invalid target " <> shown target
ProofDeclarationMustProduceOneFact ->
@@ -3840,6 +4686,8 @@ renderDeclarationError = \case
"object " <> shown object <> " is already registered"
BuilderGlobalCollision key object ->
"global " <> shown key <> " is already bound to " <> shown object
+ BuilderStructureCollision structurePhrase ->
+ "structure " <> shown structurePhrase <> " is already registered"
where
shown :: Show value => value -> Text
shown = Text.pack . show
diff --git a/source/Checking/Dependencies.hs b/source/Checking/Dependencies.hs
deleted file mode 100644
index 392bb04..0000000
--- a/source/Checking/Dependencies.hs
+++ /dev/null
@@ -1,189 +0,0 @@
-{-# LANGUAGE NoImplicitPrelude #-}
-
-module Checking.Dependencies
- ( DependencyRegistry
- , DependencyRegistrationError(..)
- , fromRootSymbols
- , registerDependencies
- , lookupDependencies
- , dependencyClosure
- , dependencyPath
- , DependencyRegistryDelta
- , dependencyRegistryExtension
- , applyDependencyRegistryDelta
- ) where
-
-import Base
-import Syntax.Internal
-
-import Data.List.NonEmpty qualified as NonEmpty
-import Data.Map.Strict qualified as Map
-import Data.Set qualified as Set
-import Data.Text qualified as Text
-
-
-newtype DependencyRegistry = DependencyRegistry
- { dependencyRows :: Map Symbol (Set Symbol)
- }
- deriving (Show, Eq)
-
-data DependencyRegistrationError
- = DependencyOwnerAlreadyRegistered !Symbol
- | SelfDependency !Symbol
- | UnknownDependency !Symbol
- deriving (Show, Eq)
-
-fromRootSymbols :: Set Symbol -> DependencyRegistry
-fromRootSymbols roots =
- DependencyRegistry
- (Map.fromSet (const mempty) roots)
-
-registerDependencies
- :: Symbol
- -> Set Symbol
- -> DependencyRegistry
- -> Either DependencyRegistrationError DependencyRegistry
-registerDependencies owner dependencies registry
- | Map.member owner rows =
- Left (DependencyOwnerAlreadyRegistered owner)
- | owner `Set.member` dependencies =
- Left (SelfDependency owner)
- | Just unknown <- Set.lookupMin (dependencies `Set.difference` Map.keysSet rows) =
- Left (UnknownDependency unknown)
- | otherwise =
- Right
- (DependencyRegistry
- (Map.insert owner dependencies rows))
- where
- rows = dependencyRows registry
-
-lookupDependencies
- :: Symbol
- -> DependencyRegistry
- -> Maybe (Set Symbol)
-lookupDependencies symbol =
- Map.lookup symbol . dependencyRows
-
-dependencyClosure
- :: DependencyRegistry
- -> Set Symbol
- -> Either Symbol (Set Symbol)
-dependencyClosure registry =
- go mempty . Set.toList
- where
- go seen [] =
- Right seen
- go seen (symbol:rest)
- | symbol `Set.member` seen =
- go seen rest
- | otherwise =
- case lookupDependencies symbol registry of
- Nothing ->
- Left symbol
- Just direct ->
- go
- (Set.insert symbol seen)
- (Set.toList direct <> rest)
-
-dependencyPath
- :: DependencyRegistry
- -> Set Symbol
- -> Symbol
- -> Either Symbol (Maybe (NonEmpty Symbol))
-dependencyPath registry seeds target =
- firstPath (Set.toList seeds)
- where
- firstPath [] =
- Right Nothing
- firstPath (seed:rest) = do
- path <- go mempty seed
- case path of
- Just _ ->
- pure path
- Nothing ->
- firstPath rest
-
- go seen symbol
- | symbol == target =
- Right (Just (NonEmpty.singleton symbol))
- | symbol `Set.member` seen =
- Right Nothing
- | otherwise =
- case lookupDependencies symbol registry of
- Nothing ->
- Left symbol
- Just direct ->
- prependFirst
- symbol
- (Set.toList direct)
- (Set.insert symbol seen)
-
- prependFirst _prefix [] _seen =
- Right Nothing
- prependFirst prefix (dependency:rest) seen = do
- path <- go seen dependency
- case path of
- Just found ->
- Right (Just (NonEmpty.cons prefix found))
- Nothing ->
- prependFirst prefix rest seen
-
-
-newtype DependencyRegistryDelta = DependencyRegistryDelta
- (Map Symbol (Set Symbol))
- deriving (Show, Eq)
-
-dependencyRegistryExtension
- :: DependencyRegistry
- -> DependencyRegistry
- -> Either Text DependencyRegistryDelta
-dependencyRegistryExtension previous current
- | not
- (all
- (\(symbol, dependencies) ->
- Map.lookup symbol currentRows
- == Just dependencies)
- (Map.toList previousRows)) =
- Left "dependency registry changed an imported row"
- | otherwise =
- Right
- (DependencyRegistryDelta
- (Map.difference currentRows previousRows))
- where
- previousRows =
- dependencyRows previous
- currentRows =
- dependencyRows current
-
-applyDependencyRegistryDelta
- :: DependencyRegistryDelta
- -> DependencyRegistry
- -> Either Text DependencyRegistry
-applyDependencyRegistryDelta
- (DependencyRegistryDelta additions)
- registry
- | not (Set.null duplicateOwners) =
- Left "dependency registry imports define the same owner"
- | Just owner <-
- find
- (\(candidate, dependencies) ->
- candidate `Set.member` dependencies)
- (Map.toList additions) =
- Left
- ("dependency registry import is self-referential: "
- <> Text.pack (show (fst owner)))
- | not (Set.null unknownDependencies) =
- Left "dependency registry import has an unknown dependency"
- | otherwise =
- Right
- (DependencyRegistry
- (Map.union rows additions))
- where
- rows =
- dependencyRows registry
- duplicateOwners =
- Map.keysSet rows `Set.intersection` Map.keysSet additions
- available =
- Map.keysSet rows <> Map.keysSet additions
- unknownDependencies =
- Set.unions (Map.elems additions) `Set.difference` available
diff --git a/source/Checking/Exact.hs b/source/Checking/Exact.hs
index 6bb8bd6..6ee258e 100644
--- a/source/Checking/Exact.hs
+++ b/source/Checking/Exact.hs
@@ -17,9 +17,15 @@ module Checking.Exact
, PreparedExactSetExpression
, preparedExactSetExpressionCore
, prepareExactSetExpression
+ , PreparedExactLocalFunctionGraph
+ , preparedExactLocalFunctionGraphCore
+ , preparedExactLocalFunctionGraphDomain
+ , preparedExactLocalFunctionGraphMap
+ , prepareExactLocalFunctionGraph
, PreparedExactClaimEnvelope
, preparedExactClaimTarget
, preparedExactClaimVariables
+ , preparedExactClaimContext
, preparedExactClaimAntecedentCount
, prepareExactClaimEnvelope
, PreparedExactDeclaration
@@ -31,6 +37,9 @@ module Checking.Exact
, preparedExactIsDefinition
, prepareExactDeclaration
, commitPreparedExactBinding
+ , PreparedExactStructure
+ , prepareExactStructure
+ , commitPreparedExactStructure
, PreparedExactSourceAxiom
, prepareExactSourceAxiom
, commitPreparedExactSourceAxiom
@@ -49,7 +58,7 @@ import Felix.Cache.Codec
import Felix.Module
import Report.Location
import Syntax.Abstract qualified as Raw
-import Syntax.Interface (CanonicalLexicalEntry)
+import Syntax.Interface (CanonicalLexicalEntry(..))
import Syntax.Lexicon qualified as Lexicon
import Control.Monad.Except (ExceptT)
@@ -59,6 +68,7 @@ import Control.Monad (foldM, unless, when)
import Control.Monad.State.Strict (StateT)
import Control.Monad.State.Strict qualified as State
import Data.ByteString (ByteString)
+import Data.Bifunctor (first)
import Data.List.NonEmpty qualified as NonEmpty
import Data.Map.Strict qualified as Map
import Data.Maybe (catMaybes)
@@ -83,6 +93,12 @@ data ExactBinder = ExactBinder
!ExactLocalId
!Raw.VarSymbol
!CoreType
+ !(Maybe ExactStructureAnnotation)
+
+data ExactStructureAnnotation = ExactStructureAnnotation
+ !SemanticStructurePhrase
+ !(Maybe ObjectId)
+ !(Map.Map Raw.StructSymbol ObjectId)
-- | The active nearest-first binders of one exact proof scope.
newtype ExactBinderContext = ExactBinderContext [ExactBinder]
@@ -103,12 +119,12 @@ extendExactBinderContext additions (ExactBinderContext initial) =
| any (sameIdentity identity) binders =
Left (ExactDuplicateLocalIdentity (locate variable) identity)
| otherwise =
- Right (ExactBinder identity variable TySet : binders)
+ Right (ExactBinder identity variable TySet Nothing : binders)
- sameVariable variable (ExactBinder _identity existing _coreType) =
+ sameVariable variable (ExactBinder _identity existing _coreType _structure) =
existing == variable
- sameIdentity identity (ExactBinder existing _variable _coreType) =
+ sameIdentity identity (ExactBinder existing _variable _coreType _structure) =
existing == identity
exactBinderContextSupport
@@ -117,7 +133,7 @@ exactBinderContextSupport
exactBinderContextSupport (ExactBinderContext binders) =
Vector.fromList
[ (identity, coreType)
- | ExactBinder identity _variable coreType <- binders
+ | ExactBinder identity _variable coreType _structure <- binders
]
exactBinderContextIndex
@@ -129,7 +145,7 @@ exactBinderContextIndex variable (ExactBinderContext binders) =
where
go _index [] =
Nothing
- go index (ExactBinder _identity candidate _coreType : rest)
+ go index (ExactBinder _identity candidate _coreType _structure : rest)
| candidate == variable = Just index
| otherwise = go (index + 1) rest
@@ -151,33 +167,70 @@ preparedExactSetExpressionCore
preparedExactSetExpressionCore (PreparedExactSetExpression expression) =
expression
+-- | A checked replacement graph and the two checked arguments used to
+-- specialize its foundation characteristic. This is transient proof
+-- preparation data, not a declaration or durable object.
+data PreparedExactLocalFunctionGraph = PreparedExactLocalFunctionGraph
+ !(ScopedCheckedCore ObjectId)
+ !(ScopedCheckedCore ObjectId)
+ !(ScopedCheckedCore ObjectId)
+
+preparedExactLocalFunctionGraphCore
+ :: PreparedExactLocalFunctionGraph
+ -> ScopedCheckedCore ObjectId
+preparedExactLocalFunctionGraphCore
+ (PreparedExactLocalFunctionGraph graph _domain _function) =
+ graph
+
+preparedExactLocalFunctionGraphDomain
+ :: PreparedExactLocalFunctionGraph
+ -> ScopedCheckedCore ObjectId
+preparedExactLocalFunctionGraphDomain
+ (PreparedExactLocalFunctionGraph _graph domain _function) =
+ domain
+
+preparedExactLocalFunctionGraphMap
+ :: PreparedExactLocalFunctionGraph
+ -> ScopedCheckedCore ObjectId
+preparedExactLocalFunctionGraphMap
+ (PreparedExactLocalFunctionGraph _graph _domain function) =
+ function
+
-- | One authoritative closed proposition prepared from a top-level claim
-- header and conclusion. The remaining fields are transient opening data for
-- the proof compiler.
data PreparedExactClaimEnvelope = PreparedExactClaimEnvelope
!(ScopedCheckedCore ObjectId)
![Raw.VarSymbol]
+ !ExactBinderContext
!Natural
preparedExactClaimTarget
:: PreparedExactClaimEnvelope
-> ScopedCheckedCore ObjectId
preparedExactClaimTarget
- (PreparedExactClaimEnvelope target _variables _antecedents) =
+ (PreparedExactClaimEnvelope target _variables _context _antecedents) =
target
preparedExactClaimVariables
:: PreparedExactClaimEnvelope
-> [Raw.VarSymbol]
preparedExactClaimVariables
- (PreparedExactClaimEnvelope _target variables _antecedents) =
+ (PreparedExactClaimEnvelope _target variables _context _antecedents) =
variables
+preparedExactClaimContext
+ :: PreparedExactClaimEnvelope
+ -> ExactBinderContext
+preparedExactClaimContext
+ (PreparedExactClaimEnvelope _target _variables context _antecedents) =
+ context
+
preparedExactClaimAntecedentCount
:: PreparedExactClaimEnvelope
-> Natural
preparedExactClaimAntecedentCount
- (PreparedExactClaimEnvelope _target _variables antecedents) =
+ (PreparedExactClaimEnvelope _target _variables _context antecedents) =
antecedents
@@ -191,7 +244,7 @@ data PreparedExactDeclaration = PreparedExactDeclaration
!Location
!ExactDeclarationFamily
!SemanticGlobalKey
- !ObjectId
+ !SemanticGlobalTarget
!(Maybe AssertedObject)
!(Maybe SemanticName)
!DeclarationSyntaxId
@@ -209,7 +262,7 @@ preparedExactGlobalKey
preparedExactObjectId :: PreparedExactDeclaration -> ObjectId
preparedExactObjectId
(PreparedExactDeclaration _location _family _key target _object _alias _syntax) =
- target
+ semanticGlobalTargetObject target
preparedExactObject
:: PreparedExactDeclaration
@@ -235,11 +288,8 @@ preparedExactGlobalTarget
-> SemanticGlobalTarget
preparedExactGlobalTarget
(PreparedExactDeclaration
- _location family _key target _object _alias _syntax) =
- case family of
- ExactSignature -> GlobalReference target
- ExactAbbreviation -> TransparentExpansion target
- ExactDefinition -> GlobalReference target
+ _location _family _key target _object _alias _syntax) =
+ target
preparedDefinitionAlias
:: PreparedExactDeclaration
@@ -255,6 +305,20 @@ data PreparedExactSourceAxiom = PreparedExactSourceAxiom
!(ScopedCheckedCore ObjectId)
!DeclarationSyntaxId
+data PreparedExactStructureFact = PreparedExactStructureFact
+ !Location
+ !(FrozenCheckedCore ObjectId)
+ !SemanticName
+
+data PreparedExactStructure = PreparedExactStructure
+ !Location
+ ![AssertedObject]
+ !ObjectId
+ !SemanticStructureDescriptor
+ !SemanticName
+ ![PreparedExactStructureFact]
+ !DeclarationSyntaxId
+
data ExactCompileError
= ExactUnsupportedDeclaration !Location
| ExactUnsupportedDeclarationBody !Location
@@ -277,6 +341,28 @@ data ExactCompileError
| ExactObjectTypeMismatch !Location !CoreType !CoreType
| ExactUnsupportedHeaderAssumption !Location
| ExactQuantifiedTermRequiresStatementSubject !Location
+ | ExactStructureNotVisible !Location !SemanticStructurePhrase
+ | ExactBaseStructureNotAssertable !Location !SemanticStructurePhrase
+ | ExactDuplicateStructureAnnotation !Location !Raw.VarSymbol
+ | ExactStructureOperationNotAvailable !Location !Raw.StructSymbol
+ | ExactStructureOperationAmbiguous
+ !Location !Raw.StructSymbol ![ObjectId]
+ | ExactContextualExpansionNotAvailable
+ !Location !SemanticGlobalKey
+ | ExactContextualRequirementConflict
+ !Location !Raw.StructSymbol !ObjectId !ObjectId
+ | ExactStructureOccurrenceMismatch !Location
+ | ExactStructureSelfParent !Location !SemanticStructurePhrase
+ | ExactStructureDuplicateParent !Location !SemanticStructurePhrase
+ | ExactStructureAlreadyVisible !Location !SemanticStructurePhrase
+ | ExactStructureDuplicateOperation !Location !Raw.StructSymbol
+ | ExactStructureOperationAlreadyInherited !Location !Raw.StructSymbol
+ | ExactStructureOperationConflict
+ !Location !Raw.StructSymbol
+ !SemanticStructurePhrase !SemanticStructurePhrase
+ | ExactStructureHasNoCarrier !Location !SemanticStructurePhrase
+ | ExactStructureDescriptorInvalid !Location !SemanticEnvironmentError
+ | ExactStructureObjectNotVisible !Location !ObjectId
deriving stock (Show, Eq)
exactCompileErrorLocation :: ExactCompileError -> Location
@@ -301,6 +387,23 @@ exactCompileErrorLocation = \case
ExactObjectTypeMismatch location _expected _actual -> location
ExactUnsupportedHeaderAssumption location -> location
ExactQuantifiedTermRequiresStatementSubject location -> location
+ ExactStructureNotVisible location _phrase -> location
+ ExactBaseStructureNotAssertable location _phrase -> location
+ ExactDuplicateStructureAnnotation location _variable -> location
+ ExactStructureOperationNotAvailable location _symbol -> location
+ ExactStructureOperationAmbiguous location _symbol _objects -> location
+ ExactContextualExpansionNotAvailable location _key -> location
+ ExactContextualRequirementConflict location _symbol _first _second -> location
+ ExactStructureOccurrenceMismatch location -> location
+ ExactStructureSelfParent location _phrase -> location
+ ExactStructureDuplicateParent location _phrase -> location
+ ExactStructureAlreadyVisible location _phrase -> location
+ ExactStructureDuplicateOperation location _symbol -> location
+ ExactStructureOperationAlreadyInherited location _symbol -> location
+ ExactStructureOperationConflict location _symbol _first _second -> location
+ ExactStructureHasNoCarrier location _phrase -> location
+ ExactStructureDescriptorInvalid location _failure -> location
+ ExactStructureObjectNotVisible location _object -> location
renderExactCompileError :: ExactCompileError -> Text
renderExactCompileError = \case
@@ -348,6 +451,56 @@ renderExactCompileError = \case
ExactQuantifiedTermRequiresStatementSubject location ->
at location
<> "a quantified term must be the sole subject of an exact statement"
+ ExactStructureNotVisible location structurePhrase ->
+ at location <> "the structure " <> shown structurePhrase <> " is not visible"
+ ExactBaseStructureNotAssertable location structurePhrase ->
+ at location <> "the metadata-only structure " <> shown structurePhrase
+ <> " cannot be asserted"
+ ExactDuplicateStructureAnnotation location variable ->
+ at location <> "the structure binder " <> shown variable
+ <> " is annotated more than once"
+ ExactStructureOperationNotAvailable location symbol ->
+ at location <> "the structure operation " <> shown symbol
+ <> " is not available in the active structure scope"
+ ExactStructureOperationAmbiguous location symbol objects ->
+ at location <> "the structure operation " <> shown symbol
+ <> " is ambiguous between " <> shown objects
+ ExactContextualExpansionNotAvailable location key ->
+ at location <> "the contextual abbreviation " <> shown key
+ <> " has no compatible active structure"
+ ExactContextualRequirementConflict location symbol firstObject secondObject ->
+ at location <> "the contextual abbreviation requires incompatible "
+ <> shown symbol <> " operations " <> shown firstObject
+ <> " and " <> shown secondObject
+ ExactStructureOccurrenceMismatch location ->
+ at location <> "the structure syntax occurrences do not match the declaration"
+ ExactStructureSelfParent location structurePhrase ->
+ at location <> "the structure " <> shown structurePhrase
+ <> " cannot inherit from itself"
+ ExactStructureDuplicateParent location structurePhrase ->
+ at location <> "the parent structure " <> shown structurePhrase
+ <> " is repeated"
+ ExactStructureAlreadyVisible location structurePhrase ->
+ at location <> "the structure " <> shown structurePhrase
+ <> " is already declared"
+ ExactStructureDuplicateOperation location symbol ->
+ at location <> "the structure operation " <> shown symbol
+ <> " is repeated"
+ ExactStructureOperationAlreadyInherited location symbol ->
+ at location <> "the structure operation " <> shown symbol
+ <> " is already inherited"
+ ExactStructureOperationConflict location symbol firstOrigin secondOrigin ->
+ at location <> "the inherited structure operation " <> shown symbol
+ <> " conflicts between " <> shown firstOrigin
+ <> " and " <> shown secondOrigin
+ ExactStructureHasNoCarrier location structurePhrase ->
+ at location <> "the structure " <> shown structurePhrase
+ <> " does not inherit the base carrier operation"
+ ExactStructureDescriptorInvalid location _failure ->
+ at location <> "the canonical structure descriptor is inconsistent"
+ ExactStructureObjectNotVisible location identity ->
+ at location <> "the structure fact mentions unavailable object "
+ <> shown identity
where
at location = locationToText location <> ": "
shown :: Show value => value -> Text
@@ -355,7 +508,11 @@ renderExactCompileError = \case
data ElaborationState = ElaborationState
{ elaborationBinders :: !(Map.Map Raw.VarSymbol Natural)
+ , elaborationStructures :: !(Map.Map Natural ExactStructureAnnotation)
, elaborationGlobals :: !(Map.Map ObjectId CoreType)
+ , elaborationContextualBinder :: !(Maybe Natural)
+ , elaborationContextualRequirements
+ :: !(Map.Map Raw.StructSymbol ObjectId)
}
type Elaborate failure =
@@ -371,6 +528,9 @@ data PreparedHead = PreparedHead
data PreparedBody
= OpaqueBody
| TransparentBody !(CanonicalTerm ObjectId)
+ | ContextualTransparentBody
+ !(Map.Map Raw.StructSymbol ObjectId)
+ !(CanonicalTerm ObjectId)
prepareExactProposition
:: ExactBinderContext
@@ -379,10 +539,7 @@ prepareExactProposition
(Either ExactCompileError PreparedExactProposition)
prepareExactProposition context statement =
Except.runExceptT do
- let initialElaboration =
- ElaborationState
- (binderIndices context)
- mempty
+ let initialElaboration = initialElaborationState context
(term, finalElaboration) <-
State.runStateT
(compileStatement statement)
@@ -410,10 +567,7 @@ prepareExactSetExpression
(Either ExactCompileError PreparedExactSetExpression)
prepareExactSetExpression context expression =
Except.runExceptT do
- let initialElaboration =
- ElaborationState
- (binderIndices context)
- mempty
+ let initialElaboration = initialElaborationState context
(term, finalElaboration) <-
State.runStateT
(compileExpressionAsSet expression)
@@ -434,6 +588,61 @@ prepareExactSetExpression context expression =
(scopedCoreType checked)))
pure (PreparedExactSetExpression checked)
+prepareExactLocalFunctionGraph
+ :: Location
+ -> ExactBinderContext
+ -> ExactBinderContext
+ -> Raw.Expr
+ -> Raw.Expr
+ -> Declaration.ModuleDriver failure
+ (Either ExactCompileError PreparedExactLocalFunctionGraph)
+prepareExactLocalFunctionGraph
+ location context argumentContext domainExpression valueExpression =
+ Except.runExceptT do
+ domain <-
+ preparedExactSetExpressionCore
+ <$> ( Except.lift
+ (prepareExactSetExpression context domainExpression)
+ >>= Except.liftEither
+ )
+ value <-
+ preparedExactSetExpressionCore
+ <$> ( Except.lift
+ (prepareExactSetExpression
+ argumentContext valueExpression)
+ >>= Except.liftEither
+ )
+ pair <- prepareOrderedPair
+ case scopedReplacementGraph pair domain value of
+ Just (graph, checkedDomain, function) ->
+ pure
+ (PreparedExactLocalFunctionGraph
+ graph checkedDomain function)
+ Nothing ->
+ impossible
+ "checked local-function components did not form a replacement graph"
+ where
+ prepareOrderedPair = do
+ let initialElaboration = initialElaborationState context
+ key =
+ SemanticExpressionFunction
+ (Raw.mixfixPattern Raw.PairSymbol)
+ expected = TySet `TyArrow` (TySet `TyArrow` TySet)
+ ((term, actual), finalElaboration) <-
+ State.runStateT
+ (applyResolvedTyped location key [])
+ initialElaboration
+ unless (actual == expected)
+ (Except.throwError
+ (ExactObjectTypeMismatch location expected actual))
+ either
+ (Except.throwError . ExactCoreCheckFailed location)
+ pure
+ (checkScopedCanonicalCore
+ (`Map.lookup` elaborationGlobals finalElaboration)
+ (binderTypes context)
+ term)
+
prepareExactClaimEnvelope
:: [Raw.Asm]
-> Raw.Stmt
@@ -463,12 +672,13 @@ prepareExactClaimEnvelope assumptions statement =
discover (variables <> [variable]) extended
Left failure ->
pure (Left failure)
- Right (target, antecedentCount) ->
+ Right (target, antecedentCount, structures) ->
pure
(Right
(PreparedExactClaimEnvelope
target
variables
+ (annotateBinderContext structures context)
antecedentCount))
prepareExactClaimAttempt
@@ -478,13 +688,13 @@ prepareExactClaimAttempt
-> Declaration.ModuleDriver failure
(Either
ExactCompileError
- (ScopedCheckedCore ObjectId, Natural))
+ ( ScopedCheckedCore ObjectId
+ , Natural
+ , Map.Map Natural ExactStructureAnnotation
+ ))
prepareExactClaimAttempt context assumptions statement =
Except.runExceptT do
- let initialElaboration =
- ElaborationState
- (binderIndices context)
- mempty
+ let initialElaboration = initialElaborationState context
((antecedents, conclusion), finalElaboration) <-
State.runStateT
( do
@@ -519,7 +729,11 @@ prepareExactClaimAttempt context assumptions statement =
closed = closeClaimBinders implication
unless (null (scopedCoreContext closed))
(impossible "exact claim closure retained a binder")
- pure (closed, fromIntegral (length antecedents))
+ pure
+ ( closed
+ , fromIntegral (length antecedents)
+ , elaborationStructures finalElaboration
+ )
checkEnvelopeProposition
:: ElaborationState
@@ -563,16 +777,47 @@ binderIndices :: ExactBinderContext -> Map.Map Raw.VarSymbol Natural
binderIndices (ExactBinderContext binders) =
Map.fromList
[ (variable, fromIntegral index)
- | (index, ExactBinder _identity variable _coreType) <-
+ | (index, ExactBinder _identity variable _coreType _structure) <-
+ zip [0 :: Int ..] binders
+ ]
+
+binderStructures
+ :: ExactBinderContext
+ -> Map.Map Natural ExactStructureAnnotation
+binderStructures (ExactBinderContext binders) =
+ Map.fromList
+ [ (fromIntegral index, structure)
+ | (index, ExactBinder _identity _variable _coreType (Just structure)) <-
zip [0 :: Int ..] binders
]
binderTypes :: ExactBinderContext -> [CoreType]
binderTypes (ExactBinderContext binders) =
[ coreType
- | ExactBinder _identity _variable coreType <- binders
+ | ExactBinder _identity _variable coreType _structure <- binders
]
+initialElaborationState :: ExactBinderContext -> ElaborationState
+initialElaborationState context =
+ ElaborationState
+ (binderIndices context)
+ (binderStructures context)
+ mempty
+ Nothing
+ mempty
+
+annotateBinderContext
+ :: Map.Map Natural ExactStructureAnnotation
+ -> ExactBinderContext
+ -> ExactBinderContext
+annotateBinderContext structures (ExactBinderContext binders) =
+ ExactBinderContext
+ [ ExactBinder identity variable coreType
+ (Map.lookup (fromIntegral index) structures)
+ | (index, ExactBinder identity variable coreType _old) <-
+ zip [0 :: Int ..] binders
+ ]
+
compileHeaderAssumption
:: Raw.Asm
-> Elaborate failure [(Location, CanonicalTerm ObjectId)]
@@ -595,7 +840,9 @@ compileHeaderAssumption = \case
]
Raw.AsmLetIn variables domain -> do
variableTerms <- traverse compileIntroducedVariable variables
- domainTerm <- compileExpressionAsSet domain
+ domainTerm <-
+ compileExpressionAsSet domain
+ >>= structureCarrierCast (locate domain)
pure
[ ( locate variable
, CApp
@@ -616,9 +863,44 @@ compileHeaderAssumption = \case
Raw.AsmLetThe variable _function ->
Except.throwError
(ExactUnsupportedHeaderAssumption (locate variable))
- Raw.AsmLetStruct variable _structure ->
- Except.throwError
- (ExactUnsupportedHeaderAssumption (locate variable))
+ Raw.AsmLetStruct variable structure -> do
+ subject <- compileIntroducedVariable variable
+ annotation <-
+ resolveStructureAnnotation
+ (locate variable)
+ structure
+ index <-
+ maybe
+ (impossible "an introduced structure variable is unbound")
+ pure
+ =<< Map.lookup variable <$> State.gets elaborationBinders
+ existing <- State.gets (Map.lookup index . elaborationStructures)
+ when
+ (isJust existing)
+ (Except.throwError
+ (ExactDuplicateStructureAnnotation
+ (locate variable) variable))
+ State.modify' \state ->
+ state
+ { elaborationStructures =
+ Map.insert index annotation
+ (elaborationStructures state)
+ }
+ predicate <-
+ maybe
+ (impossible "an assertable structure has no predicate")
+ pure
+ (structureAnnotationPredicate annotation)
+ recordExactGlobal
+ predicate
+ (TyArrow TySet TyProp)
+ pure
+ [ ( locate variable
+ , CApp
+ (CGlobal predicate)
+ subject
+ )
+ ]
compileIntroducedVariable
:: Raw.VarSymbol
@@ -626,6 +908,63 @@ compileIntroducedVariable
compileIntroducedVariable variable =
compileExpressionAsSet (Raw.ExprVar variable)
+resolveStructureAnnotation
+ :: Location
+ -> Raw.StructPhrase
+ -> Elaborate failure ExactStructureAnnotation
+resolveStructureAnnotation location rawPhrase = do
+ let structurePhrase = semanticStructurePhrase rawPhrase
+ resolved <-
+ State.lift
+ (Except.lift
+ (Declaration.resolveVisibleStructureDriver structurePhrase))
+ structure <-
+ maybe
+ (Except.throwError
+ (ExactStructureNotVisible location structurePhrase))
+ pure
+ resolved
+ predicate <-
+ maybe
+ (Except.throwError
+ (ExactBaseStructureNotAssertable location structurePhrase))
+ pure
+ (Declaration.resolvedStructurePredicate structure)
+ pure
+ (ExactStructureAnnotation
+ structurePhrase
+ (Just predicate)
+ (Declaration.resolvedStructureOperations structure))
+
+structureAnnotationPredicate :: ExactStructureAnnotation -> Maybe ObjectId
+structureAnnotationPredicate
+ (ExactStructureAnnotation _ predicate _operations) =
+ predicate
+
+structureAnnotationOperation
+ :: Raw.StructSymbol
+ -> ExactStructureAnnotation
+ -> Maybe ObjectId
+structureAnnotationOperation symbol
+ (ExactStructureAnnotation _phrase _predicate operations) =
+ Map.lookup symbol operations
+
+recordExactGlobal :: ObjectId -> CoreType -> Elaborate failure ()
+recordExactGlobal identity coreType = do
+ existing <- State.gets (Map.lookup identity . elaborationGlobals)
+ case existing of
+ Nothing ->
+ State.modify' \state ->
+ state
+ { elaborationGlobals =
+ Map.insert identity coreType
+ (elaborationGlobals state)
+ }
+ Just actual
+ | actual == coreType -> pure ()
+ | otherwise ->
+ impossible "one exact global acquired two checked types"
+
prepareExactSourceAxiom
:: Raw.Block
-> Declaration.ModuleDriver failure
@@ -704,13 +1043,24 @@ prepareExactDeclaration block entries =
case rawBody of
Nothing -> pure (OpaqueBody, Map.empty)
Just buildBody -> do
- let initialElaboration = ElaborationState mempty mempty
+ let initialElaboration =
+ ElaborationState
+ mempty mempty mempty Nothing mempty
(canonical, finalElaboration) <-
State.runStateT buildBody initialElaboration
- pure
- ( TransparentBody canonical
- , elaborationGlobals finalElaboration
- )
+ let requirements =
+ elaborationContextualRequirements finalElaboration
+ body
+ | Map.null requirements =
+ TransparentBody canonical
+ | family == ExactAbbreviation =
+ ContextualTransparentBody
+ requirements
+ (CLam TySet canonical)
+ | otherwise =
+ impossible
+ "a non-abbreviation acquired contextual requirements"
+ pure (body, elaborationGlobals finalElaboration)
let PreparedHead semanticKey _parameters coreType = head'
unless (semanticKey == key)
(Except.throwError
@@ -726,8 +1076,8 @@ prepareExactDeclaration block entries =
(generatedObjectSlot 0)
content' =
OpaqueObjectContent theory seed coreType
- pure
- (opaqueObjectId theory seed coreType, content')
+ identity = opaqueObjectId theory seed coreType
+ pure (GlobalReference identity, content')
TransparentBody canonical -> do
checked <-
either
@@ -749,15 +1099,54 @@ prepareExactDeclaration block entries =
theory
coreType
canonical
+ let identity =
+ transparentObjectId theory coreType canonical
+ semanticTarget =
+ case family of
+ ExactAbbreviation ->
+ TransparentExpansion identity
+ ExactDefinition -> GlobalReference identity
+ ExactSignature ->
+ impossible
+ "a signature acquired a transparent body"
+ pure (semanticTarget, content')
+ ContextualTransparentBody requirements canonical -> do
+ let contextualType = TyArrow TySet coreType
+ checked <-
+ either
+ (Except.throwError
+ . ExactCoreCheckFailed (locate block))
+ pure
+ (checkCanonicalCore
+ (`Map.lookup` globals)
+ canonical)
+ unless
+ (frozenCoreType checked == contextualType)
+ (Except.throwError
+ (ExactObjectTypeMismatch
+ (locate block)
+ contextualType
+ (frozenCoreType checked)))
+ let content' =
+ TransparentObjectContent
+ theory
+ contextualType
+ canonical
+ identity =
+ transparentObjectId
+ theory contextualType canonical
pure
- ( transparentObjectId theory coreType canonical
+ ( ContextualTransparentExpansion
+ identity requirements
, content'
)
- available <- Except.lift (Declaration.objectAvailableDriver target)
+ let targetObject = semanticGlobalTargetObject target
+ available <-
+ Except.lift (Declaration.objectAvailableDriver targetObject)
let alias = definitionAlias block
asserted
| available = Nothing
- | otherwise = Just (assertedObject target content)
+ | otherwise = Just (assertedObject targetObject content)
syntax =
declarationSyntaxId
(encodePreparedSyntax family head' body alias)
@@ -801,6 +1190,367 @@ commitPreparedExactBinding prepared
(preparedExactObjectId prepared))
candidate)
+prepareExactStructure
+ :: Raw.Block
+ -> [CanonicalLexicalEntry]
+ -> Declaration.ModuleDriver failure
+ (Either ExactCompileError PreparedExactStructure)
+prepareExactStructure block entries =
+ Except.runExceptT do
+ (location, marker, structure) <-
+ case block of
+ Raw.BlockStruct location _title (Raw.Marker marker) structure ->
+ pure (location, marker, structure)
+ _ -> Except.throwError
+ (ExactUnsupportedDeclaration (locate block))
+ validateStructureOccurrences location structure entries
+ let structurePhrase =
+ semanticStructurePhrase (Raw.structPhrase structure)
+ parentPhrases =
+ semanticStructurePhrase <$> Raw.structParents structure
+ when
+ (structurePhrase `elem` parentPhrases)
+ (Except.throwError
+ (ExactStructureSelfParent location structurePhrase))
+ case firstDuplicate parentPhrases of
+ Just duplicate ->
+ Except.throwError
+ (ExactStructureDuplicateParent location duplicate)
+ Nothing -> pure ()
+ visible <- Except.lift
+ (Declaration.resolveVisibleStructureDriver structurePhrase)
+ when
+ (isJust visible)
+ (Except.throwError
+ (ExactStructureAlreadyVisible location structurePhrase))
+ parents <- traverse (resolveParent location) parentPhrases
+ inherited <-
+ foldM mergeParentOperations Map.empty
+ (zip parentPhrases parents)
+ case firstDuplicate (Raw.structFixes structure) of
+ Just duplicate ->
+ Except.throwError
+ (ExactStructureDuplicateOperation location duplicate)
+ Nothing -> pure ()
+ traverse_
+ (\symbol ->
+ when
+ (Map.member symbol inherited)
+ (Except.throwError
+ (ExactStructureOperationAlreadyInherited
+ location symbol)))
+ (Raw.structFixes structure)
+ slot <- Except.lift Declaration.nextDeclarationSlotDriver
+ theory <- Except.lift Declaration.currentTheoryDriver
+ let operationType = TyArrow TySet TySet
+ makeOperation index symbol =
+ let seed =
+ opaqueDeclarationSeed
+ (declarationSlotModule slot)
+ (declarationSlotOrdinal slot)
+ StructureDeclaration
+ (generatedObjectSlot index)
+ content = OpaqueObjectContent theory seed operationType
+ identity = opaqueObjectId theory seed operationType
+ in ( symbol
+ , identity
+ , assertedObject identity content
+ )
+ ownOperations =
+ zipWith makeOperation [0 ..] (Raw.structFixes structure)
+ operationObjects =
+ [ asserted
+ | (_symbol, _identity, asserted) <- ownOperations
+ ]
+ completeOperations =
+ Map.union
+ (Map.fromList
+ [ (symbol, identity)
+ | (symbol, identity, _asserted) <- ownOperations
+ ])
+ (fst <$> inherited)
+ unless
+ (Map.member Raw.CarrierSymbol completeOperations)
+ (Except.throwError
+ (ExactStructureHasNoCarrier location structurePhrase))
+ context <-
+ either Except.throwError pure
+ (extendExactBinderContext
+ ((exactLocalId 0, Raw.structLabel structure) :| [])
+ emptyExactBinderContext)
+ let provisionalAnnotation =
+ ExactStructureAnnotation
+ structurePhrase Nothing completeOperations
+ structureContext =
+ annotateBinderContext
+ (Map.singleton 0 provisionalAnnotation)
+ context
+ checkedAssumptions <-
+ traverse
+ (\(assumptionMarker, assumption) -> do
+ prepared <- Except.lift
+ (prepareExactProposition structureContext assumption)
+ proposition <- Except.liftEither prepared
+ pure
+ ( locate assumption
+ , assumptionMarker
+ , preparedExactPropositionCore proposition
+ ))
+ (Raw.structAssumes structure)
+ parentTerms <-
+ fmap catMaybes
+ (traverse
+ (\parent ->
+ case Declaration.resolvedStructurePredicate parent of
+ Nothing -> pure Nothing
+ Just predicate ->
+ pure
+ (Just
+ (CApp
+ (CGlobal predicate)
+ (CBound 0))))
+ parents)
+ let assumptionTerms =
+ [ scopedCoreTerm proposition
+ | (_assumptionLocation, _assumptionMarker, proposition) <-
+ checkedAssumptions
+ ]
+ predicateBody =
+ CLam TySet
+ (logicalConjunction
+ (parentTerms <> assumptionTerms))
+ predicateType = TyArrow TySet TyProp
+ predicateContent =
+ TransparentObjectContent theory predicateType predicateBody
+ predicate =
+ transparentObjectId theory predicateType predicateBody
+ predicateAvailable <-
+ Except.lift (Declaration.objectAvailableDriver predicate)
+ let predicateObject =
+ [ assertedObject predicate predicateContent
+ | not predicateAvailable
+ ]
+ ownBindings =
+ [ semanticStructureOperation symbol identity
+ | (symbol, identity, _asserted) <- ownOperations
+ ]
+ descriptor <-
+ Except.liftEither
+ (first
+ (ExactStructureDescriptorInvalid location)
+ (semanticStructureDescriptor
+ structurePhrase
+ (Just predicate)
+ parentPhrases
+ ownBindings))
+ let structureApplication =
+ CApp (CGlobal predicate) (CBound 0)
+ inheritance =
+ [ ( location
+ , semanticName (marker <> "inherit")
+ , CForall TySet
+ (CImp structureApplication
+ (logicalConjunction parentTerms))
+ )
+ | not (null parentTerms)
+ ]
+ projections =
+ [ ( assumptionLocation
+ , semanticName assumptionMarker
+ , CForall TySet
+ (CImp structureApplication
+ (scopedCoreTerm proposition))
+ )
+ | ( assumptionLocation
+ , Raw.Marker assumptionMarker
+ , proposition
+ ) <- checkedAssumptions
+ ]
+ generatedTerms = inheritance <> projections
+ localTypes =
+ Map.fromList
+ ((predicate, predicateType)
+ : [ (identity, operationType)
+ | (_symbol, identity, _asserted) <- ownOperations
+ ])
+ resolvedTypes <-
+ resolveStructureGlobalTypes
+ localTypes
+ [ term
+ | (_factLocation, _alias, term) <- generatedTerms
+ ]
+ generated <-
+ traverse
+ (\(factLocation, alias, term) -> do
+ frozen <-
+ either
+ (Except.throwError
+ . ExactCoreCheckFailed factLocation)
+ pure
+ (checkCanonicalCore
+ (`Map.lookup` resolvedTypes)
+ term)
+ pure
+ (PreparedExactStructureFact
+ factLocation frozen alias))
+ generatedTerms
+ environment <-
+ Except.liftEither
+ (first
+ (ExactStructureDescriptorInvalid location)
+ (semanticEnvironmentWithStructures [] [descriptor]))
+ let syntax =
+ declarationSyntaxId
+ (encodePreparedStructure
+ environment
+ predicate
+ generated)
+ pure
+ (PreparedExactStructure
+ location
+ (operationObjects <> predicateObject)
+ predicate
+ descriptor
+ (semanticName marker)
+ generated
+ syntax)
+ where
+ resolveParent location structurePhrase = do
+ resolved <- Except.lift
+ (Declaration.resolveVisibleStructureDriver structurePhrase)
+ maybe
+ (Except.throwError
+ (ExactStructureNotVisible location structurePhrase))
+ pure
+ resolved
+
+ mergeParentOperations inherited (parentPhrase, parent) =
+ foldM
+ (insertParentOperation parentPhrase)
+ inherited
+ (Map.toAscList
+ (Declaration.resolvedStructureOperations parent))
+
+ insertParentOperation parentPhrase inherited (symbol, identity) =
+ case Map.lookup symbol inherited of
+ Nothing ->
+ pure
+ (Map.insert symbol (identity, parentPhrase) inherited)
+ Just (existing, existingOrigin)
+ | existing == identity -> pure inherited
+ | otherwise ->
+ Except.throwError
+ (ExactStructureOperationConflict
+ (locate block)
+ symbol
+ existingOrigin
+ parentPhrase)
+
+ resolveStructureGlobalTypes localTypes terms = do
+ let dependencies = Set.unions (canonicalTermGlobals <$> terms)
+ foldM
+ (\types identity ->
+ case Map.lookup identity types of
+ Just{} -> pure types
+ Nothing -> do
+ coreType <- Except.lift
+ (Declaration.objectTypeDriver identity)
+ case coreType of
+ Nothing ->
+ Except.throwError
+ (ExactStructureObjectNotVisible
+ (locate block) identity)
+ Just actual ->
+ pure (Map.insert identity actual types))
+ localTypes
+ (Set.toAscList dependencies)
+
+commitPreparedExactStructure
+ :: PreparedExactStructure
+ -> Declaration.ModuleDriver failure
+ ((), Declaration.CommittedDeclarationBatch)
+commitPreparedExactStructure
+ (PreparedExactStructure
+ _location objects predicate descriptor alias generated syntax) =
+ Declaration.commitCompiledDeclaration syntax do
+ traverse_ Declaration.addDeclarationObject objects
+ Declaration.stageSemanticStructureDescriptor descriptor
+ definition <-
+ Declaration.reservePointwiseDefinitionEquationCandidate
+ predicate alias
+ generatedCandidates <-
+ case NonEmpty.nonEmpty generated of
+ Nothing -> pure []
+ Just nonempty -> do
+ candidates <-
+ Declaration.reserveFrozenPropositionCandidateBatch
+ ( fmap
+ (\(PreparedExactStructureFact
+ _factLocation target factAlias) ->
+ (target, SearchEligible, [factAlias]))
+ nonempty
+ )
+ pure (toList candidates)
+ Declaration.authorizeCompiledDeclaration do
+ Declaration.authorizeDefinitionEquationCandidate
+ predicate definition
+ case NonEmpty.nonEmpty
+ (zip generatedCandidates generated) of
+ Nothing -> pure ()
+ Just ready ->
+ Declaration.authorizeVampireCandidateBatch
+ ( fmap
+ (\(candidate, PreparedExactStructureFact
+ factLocation _target _factAlias) ->
+ ( factLocation
+ , candidate
+ , do
+ void
+ (Declaration.useStagedCandidate
+ definition)
+ Declaration.prepareCurrentCandidateVampire
+ ))
+ ready
+ )
+
+validateStructureOccurrences
+ :: Location
+ -> Raw.StructDefn
+ -> [CanonicalLexicalEntry]
+ -> ExceptT ExactCompileError (Declaration.ModuleDriver failure) ()
+validateStructureOccurrences location structure entries = do
+ let Raw.LexicalItemSgPl forms structureMarker =
+ Raw.structPhrase structure
+ expected =
+ CanonicalStructureNoun
+ (Raw.sg forms)
+ (Raw.pl forms)
+ structureMarker
+ : [ CanonicalStructureOperation command
+ | Raw.StructSymbol command <- Raw.structFixes structure
+ ]
+ unless
+ (entries == expected)
+ (Except.throwError
+ (ExactStructureOccurrenceMismatch location))
+
+encodePreparedStructure
+ :: SemanticEnvironmentDelta
+ -> ObjectId
+ -> [PreparedExactStructureFact]
+ -> ByteString
+encodePreparedStructure environment predicate generated =
+ encodeCache do
+ putCacheTag 0x04
+ putSemanticEnvironmentDeltaCache environment
+ putObjectIdCache predicate
+ putCacheList
+ (\(PreparedExactStructureFact _location target alias) -> do
+ putCanonicalTermCache putObjectIdCache
+ (frozenCoreTerm target)
+ putCacheText (semanticNameText alias))
+ generated
+
prepareHead
:: Raw.Block
-> SemanticGlobalKey
@@ -870,32 +1620,32 @@ prepareAbbreviation
prepareAbbreviation location key = \case
Raw.AbbreviationEq (Raw.SymbolPattern symbol parameters) expression -> do
ensureExpressionKey location symbol key
- makeTransparentHead
+ makeContextualTransparentHead
location key parameters TySet
(compileExpressionAsSet expression)
Raw.AbbreviationFun (Raw.Fun _ item parameters) term -> do
ensureFunctionPhraseKey location item key
- makeTransparentHead
+ makeContextualTransparentHead
location key parameters TySet
(compileTermAsSet term)
Raw.AbbreviationAdj subject (Raw.Adj _ item arguments) statement -> do
ensureAdjectiveKey location item key
- makeTransparentHead
+ makeContextualTransparentHead
location key (subject : arguments) TyProp
(compileStatement statement)
Raw.AbbreviationVerb subject (Raw.Verb _ item arguments) statement -> do
ensureVerbKey location item key
- makeTransparentHead
+ makeContextualTransparentHead
location key (subject : arguments) TyProp
(compileStatement statement)
Raw.AbbreviationNoun subject (Raw.Noun _ item arguments) statement -> do
ensureNounKey location item key
- makeTransparentHead
+ makeContextualTransparentHead
location key (subject : arguments) TyProp
(compileStatement statement)
Raw.AbbreviationRel left relation parameters right statement -> do
ensureRelationKey location relation key
- makeTransparentHead
+ makeContextualTransparentHead
location key (parameters <> [left, right]) TyProp
(compileStatement statement)
@@ -994,6 +1744,32 @@ makeTransparentHead location key parameters resultType body = do
pure (foldr (const (CLam TySet)) body' parameters)
pure (prepared, close)
+makeContextualTransparentHead
+ :: Location
+ -> SemanticGlobalKey
+ -> [Raw.VarSymbol]
+ -> CoreType
+ -> Elaborate failure (CanonicalTerm ObjectId)
+ -> ExceptT
+ ExactCompileError
+ (Declaration.ModuleDriver failure)
+ ( PreparedHead
+ , Elaborate failure (CanonicalTerm ObjectId)
+ )
+makeContextualTransparentHead location key parameters resultType body = do
+ (prepared, binders) <-
+ prepareParameters location key parameters resultType
+ let close = do
+ State.modify' \state ->
+ state
+ { elaborationBinders = binders
+ , elaborationContextualBinder =
+ Just (fromIntegral (length parameters))
+ }
+ body' <- body
+ pure (foldr (const (CLam TySet)) body' parameters)
+ pure (prepared, close)
+
makePreparedHead
:: Location
-> SemanticGlobalKey
@@ -1105,6 +1881,8 @@ compileExpression = \case
location
key
compiled
+ Raw.ExprStructOp location symbol maybeArgument ->
+ compileStructureOperation location symbol maybeArgument
Raw.ExprFiniteSet _location elements -> do
compiled <- traverse compileExpressionAsSet elements
pure
@@ -1131,9 +1909,129 @@ compileExpression = \case
Raw.ExprReplacePred location _value _variable _bound _predicate ->
Except.throwError
(ExactUnsupportedDeclarationBody location)
- expression ->
- Except.throwError
- (ExactUnsupportedDeclarationBody (locate expression))
+
+compileStructureOperation
+ :: Location
+ -> Raw.StructSymbol
+ -> Maybe Raw.Expr
+ -> Elaborate failure (CanonicalTerm ObjectId, CoreType)
+compileStructureOperation location symbol maybeArgument = do
+ (argument, object) <-
+ case maybeArgument of
+ Just expression -> do
+ term <- compileExpressionAsSet expression
+ structures <- State.gets elaborationStructures
+ case termStructureAnnotation term structures of
+ Just annotation -> do
+ object <-
+ maybe
+ (Except.throwError
+ (ExactStructureOperationNotAvailable
+ location symbol))
+ pure
+ (structureAnnotationOperation
+ symbol annotation)
+ pure (term, object)
+ Nothing -> do
+ object <-
+ resolveUniqueStructureOperation location symbol
+ pure (term, object)
+ Nothing -> do
+ structures <- State.gets elaborationStructures
+ case
+ [ (CBound index, object)
+ | (index, structure) <- Map.toAscList structures
+ , Just object <-
+ [structureAnnotationOperation symbol structure]
+ ] of
+ firstMatch : _ -> pure firstMatch
+ [] -> do
+ contextual <- State.gets elaborationContextualBinder
+ case contextual of
+ Nothing ->
+ Except.throwError
+ (ExactStructureOperationNotAvailable
+ location symbol)
+ Just index -> do
+ object <-
+ resolveUniqueStructureOperation
+ location symbol
+ recordContextualRequirement
+ location symbol object
+ pure (CBound index, object)
+ recordExactGlobal object (TyArrow TySet TySet)
+ pure (CApp (CGlobal object) argument, TySet)
+ where
+ termStructureAnnotation term structures =
+ case term of
+ CBound index -> Map.lookup index structures
+ _ -> Nothing
+
+resolveUniqueStructureOperation
+ :: Location
+ -> Raw.StructSymbol
+ -> Elaborate failure ObjectId
+resolveUniqueStructureOperation location symbol = do
+ objects <-
+ State.lift
+ (Except.lift
+ (Declaration.resolveVisibleStructureOperationObjectsDriver
+ symbol))
+ case objects of
+ [] ->
+ Except.throwError
+ (ExactStructureOperationNotAvailable location symbol)
+ [object] -> pure object
+ _ ->
+ Except.throwError
+ (ExactStructureOperationAmbiguous location symbol objects)
+
+recordContextualRequirement
+ :: Location
+ -> Raw.StructSymbol
+ -> ObjectId
+ -> Elaborate failure ()
+recordContextualRequirement location symbol object = do
+ existing <-
+ State.gets
+ (Map.lookup symbol . elaborationContextualRequirements)
+ case existing of
+ Nothing ->
+ State.modify' \state ->
+ state
+ { elaborationContextualRequirements =
+ Map.insert symbol object
+ (elaborationContextualRequirements state)
+ }
+ Just actual
+ | actual == object -> pure ()
+ | otherwise ->
+ Except.throwError
+ (ExactContextualRequirementConflict
+ location symbol actual object)
+
+structureCarrierCast
+ :: Location
+ -> CanonicalTerm ObjectId
+ -> Elaborate failure (CanonicalTerm ObjectId)
+structureCarrierCast location term =
+ case term of
+ CBound index -> do
+ annotation <- State.gets (Map.lookup index . elaborationStructures)
+ case annotation of
+ Nothing -> pure term
+ Just structure -> do
+ carrier <-
+ maybe
+ (Except.throwError
+ (ExactStructureOperationNotAvailable
+ location Raw.CarrierSymbol))
+ pure
+ (structureAnnotationOperation
+ Raw.CarrierSymbol structure)
+ recordExactGlobal carrier (TyArrow TySet TySet)
+ pure (CApp (CGlobal carrier) term)
+ _ -> pure term
compileReplacement
:: Raw.Expr
@@ -1215,9 +2113,22 @@ compileStatement = \case
_location quantifier variables bound suchThat statement ->
compileSymbolicQuantified
quantifier variables bound suchThat (compileStatement statement)
- statement ->
- Except.throwError
- (ExactUnsupportedDeclarationBody (locate statement))
+ Raw.StmtStruct term rawPhrase -> do
+ subject <- compileTermAsSet term
+ annotation <-
+ resolveStructureAnnotation (locate term) rawPhrase
+ predicate <-
+ maybe
+ (impossible "an assertable structure has no predicate")
+ pure
+ (structureAnnotationPredicate annotation)
+ recordExactGlobal
+ predicate
+ (TyArrow TySet TyProp)
+ pure
+ (CApp
+ (CGlobal predicate)
+ subject)
compileQuantifiedTermSubject
:: Raw.Quantifier
@@ -1291,6 +2202,10 @@ compileAtomicRelationTerms left relation right =
(Raw.relationSymbolToken symbol)
(Raw.relationSymbolParameterArity symbol)
compiledParameters <- traverse compileExpressionAsSet parameters
+ checkedRight <-
+ if symbol == Raw.ElementSymbol && null parameters
+ then structureCarrierCast location right
+ else pure right
case fixedSemanticMeaning key of
Just FixedEquality
| null parameters -> pure (CEq TySet left right)
@@ -1304,7 +2219,7 @@ compileAtomicRelationTerms left relation right =
(CIntrinsic intrinsic)
(coreIntrinsicType intrinsic)
((\term -> (term, TySet))
- <$> (compiledParameters <> [left, right]))
+ <$> (compiledParameters <> [left, checkedRight]))
unless (actual == TyProp)
(Except.throwError
(ExactFormulaExpectedProposition location actual))
@@ -1316,7 +2231,7 @@ compileAtomicRelationTerms left relation right =
(CIntrinsic intrinsic)
(coreIntrinsicType intrinsic)
((\term -> (term, TySet))
- <$> (compiledParameters <> [left, right]))
+ <$> (compiledParameters <> [left, checkedRight]))
unless (actual == TyProp)
(Except.throwError
(ExactFormulaExpectedProposition location actual))
@@ -1326,7 +2241,7 @@ compileAtomicRelationTerms left relation right =
applyResolvedTyped
location key
((\term -> (term, TySet))
- <$> (compiledParameters <> [left, right]))
+ <$> (compiledParameters <> [left, checkedRight]))
unless (actual == TyProp)
(Except.throwError
(ExactFormulaExpectedProposition location actual))
@@ -1562,11 +2477,22 @@ withAnonymousSetBinder
-> Elaborate failure value
withAnonymousSetBinder action = do
outer <- State.gets elaborationBinders
+ outerStructures <- State.gets elaborationStructures
+ outerContextual <- State.gets elaborationContextualBinder
State.modify' \state ->
- state{elaborationBinders = (+ 1) <$> outer}
+ state
+ { elaborationBinders = (+ 1) <$> outer
+ , elaborationStructures =
+ Map.mapKeysMonotonic (+ 1) outerStructures
+ , elaborationContextualBinder = (+ 1) <$> outerContextual
+ }
result <- action (CBound 0)
State.modify' \state ->
- state{elaborationBinders = outer}
+ state
+ { elaborationBinders = outer
+ , elaborationStructures = outerStructures
+ , elaborationContextualBinder = outerContextual
+ }
pure result
withSetBinders
@@ -1575,6 +2501,8 @@ withSetBinders
-> Elaborate failure value
withSetBinders variables action = do
outer <- State.gets elaborationBinders
+ outerStructures <- State.gets elaborationStructures
+ outerContextual <- State.gets elaborationContextualBinder
case firstDuplicate (toList variables) of
Just duplicate ->
Except.throwError
@@ -1599,10 +2527,18 @@ withSetBinders variables action = do
State.modify' \state ->
state
{ elaborationBinders = introduced <> shifted
+ , elaborationStructures =
+ Map.mapKeysMonotonic (+ binderCount) outerStructures
+ , elaborationContextualBinder =
+ (+ binderCount) <$> outerContextual
}
result <- action
State.modify' \state ->
- state{elaborationBinders = outer}
+ state
+ { elaborationBinders = outer
+ , elaborationStructures = outerStructures
+ , elaborationContextualBinder = outerContextual
+ }
pure result
compileFormula
@@ -1930,6 +2866,54 @@ applyResolvedTyped location key arguments = do
_ ->
impossible
"validated transparent expansion has opaque content"
+ ContextualTransparentExpansion _identity requirements ->
+ case content of
+ TransparentObjectContent _theory coreType body -> do
+ State.modify' \state ->
+ state
+ { elaborationGlobals =
+ Map.union
+ dependencies
+ (elaborationGlobals state)
+ }
+ contextArgument <-
+ resolveContextualExpansionArgument
+ location key requirements
+ applyExpandedTyped
+ location body coreType
+ ((contextArgument, TySet) : arguments)
+ _ ->
+ impossible
+ "validated contextual expansion has opaque content"
+
+resolveContextualExpansionArgument
+ :: Location
+ -> SemanticGlobalKey
+ -> Map.Map Raw.StructSymbol ObjectId
+ -> Elaborate failure (CanonicalTerm ObjectId)
+resolveContextualExpansionArgument location key requirements = do
+ contextual <- State.gets elaborationContextualBinder
+ case contextual of
+ Just index -> do
+ traverse_
+ (uncurry (recordContextualRequirement location))
+ (Map.toAscList requirements)
+ pure (CBound index)
+ Nothing -> do
+ structures <- State.gets elaborationStructures
+ case
+ [ CBound index
+ | (index, structure) <- Map.toAscList structures
+ , all
+ (\(symbol, object) ->
+ structureAnnotationOperation symbol structure
+ == Just object)
+ (Map.toAscList requirements)
+ ] of
+ firstMatch : _ -> pure firstMatch
+ [] ->
+ Except.throwError
+ (ExactContextualExpansionNotAvailable location key)
applyExpandedTyped
:: Location
@@ -2093,6 +3077,13 @@ encodePreparedSyntax
TransparentBody canonical -> do
putCacheTag 0x01
putCanonicalTermCache putObjectIdCache canonical
+ ContextualTransparentBody requirements canonical -> do
+ putCacheTag 0x02
+ putCanonicalCacheMap
+ (\(Raw.StructSymbol symbol) -> putCacheText symbol)
+ putObjectIdCache
+ requirements
+ putCanonicalTermCache putObjectIdCache canonical
putCacheMaybe
(putCacheText . semanticNameText)
alias
diff --git a/source/Checking/Exact/Global.hs b/source/Checking/Exact/Global.hs
index 848b600..094255e 100644
--- a/source/Checking/Exact/Global.hs
+++ b/source/Checking/Exact/Global.hs
@@ -33,6 +33,7 @@ data ExactGlobalResolutionError
= ExactGlobalNotVisible !Internal.Symbol
| ExactGlobalAmbiguous !Internal.Symbol
| ExactGlobalUnsupported !Internal.Symbol
+ | ExactGlobalContextualUnsupported !Internal.Symbol
| ExactGlobalContentInvalid !CoreCheckError
deriving stock (Show, Eq)
@@ -71,7 +72,7 @@ resolveExactSourceGlobals symbols =
throwError (ExactGlobalNotVisible symbol)
[match] -> do
(source, sourceTypes) <-
- liftEither (prepareSourceGlobal match)
+ liftEither (prepareSourceGlobal symbol match)
pure
( Map.insert symbol source resolved
, Map.union sourceTypes types
@@ -80,14 +81,15 @@ resolveExactSourceGlobals symbols =
throwError (ExactGlobalAmbiguous symbol)
prepareSourceGlobal
- :: ( SemanticGlobalTarget
+ :: Internal.Symbol
+ -> ( SemanticGlobalTarget
, ObjectContent
, Map.Map ObjectId CoreType
)
-> Either
ExactGlobalResolutionError
(Typed.SourceGlobal ObjectId, Map.Map ObjectId CoreType)
-prepareSourceGlobal (target, content, dependencies) = do
+prepareSourceGlobal symbol (target, content, dependencies) = do
body <-
case target of
GlobalReference _identity ->
@@ -103,6 +105,8 @@ prepareSourceGlobal (target, content, dependencies) = do
_ ->
impossible
"validated transparent expansion has opaque content"
+ ContextualTransparentExpansion _identity _requirements ->
+ Left (ExactGlobalContextualUnsupported symbol)
let identity = semanticGlobalTargetObject target
types =
Map.insert
diff --git a/source/Checking/Exact/Inductive.hs b/source/Checking/Exact/Inductive.hs
index c3f281c..e873f0c 100644
--- a/source/Checking/Exact/Inductive.hs
+++ b/source/Checking/Exact/Inductive.hs
@@ -500,6 +500,8 @@ exactGlobalError location = \case
ExactInductiveGlobalAmbiguous location symbol
ExactGlobal.ExactGlobalUnsupported symbol ->
ExactInductiveUnsupportedSymbol location symbol
+ ExactGlobal.ExactGlobalContextualUnsupported symbol ->
+ ExactInductiveUnsupportedSymbol location symbol
ExactGlobal.ExactGlobalContentInvalid failure ->
ExactInductiveGlobalContentInvalid location failure
diff --git a/source/Checking/Exact/Proof.hs b/source/Checking/Exact/Proof.hs
index b66ebfe..ad95a62 100644
--- a/source/Checking/Exact/Proof.hs
+++ b/source/Checking/Exact/Proof.hs
@@ -63,6 +63,8 @@ data ExactProofError
| ExactProofExpectedImplicationGoal !Location
| ExactProofGoalStatementMismatch !Location
| ExactProofContradictionGoalMismatch !Location
+ | ExactProofLocalFunctionBinderMismatch !Location
+ | ExactProofLocalFunctionNameConflict !Location
| ExactProofUnknownReference !Location !Raw.Marker
| ExactProofElaborationFailed !Exact.ExactCompileError
| ExactProofObligationPreparationFailed
@@ -91,6 +93,8 @@ exactProofErrorLocation = \case
ExactProofExpectedImplicationGoal location -> location
ExactProofGoalStatementMismatch location -> location
ExactProofContradictionGoalMismatch location -> location
+ ExactProofLocalFunctionBinderMismatch location -> location
+ ExactProofLocalFunctionNameConflict location -> location
ExactProofUnknownReference location _marker -> location
ExactProofElaborationFailed failure ->
Exact.exactCompileErrorLocation failure
@@ -131,6 +135,10 @@ renderExactProofError = \case
at location <> "the proof step does not match the current goal"
ExactProofContradictionGoalMismatch location ->
at location <> "contradiction requires falsum as the current goal"
+ ExactProofLocalFunctionBinderMismatch location ->
+ at location <> "the function argument must match its domain binder"
+ ExactProofLocalFunctionNameConflict location ->
+ at location <> "the function and argument names must be distinct"
ExactProofUnknownReference location marker ->
at location <> "the cited fact " <> shown marker <> " is not visible"
ExactProofElaborationFailed failure ->
@@ -210,6 +218,11 @@ data PreparedProof
!(ScopedCheckedCore ObjectId)
!(ScopedCheckedCore ObjectId)
!PreparedProof
+ | PreparedDefineFunction
+ !Exact.ExactLocalId
+ !(ScopedCheckedCore ObjectId)
+ !(ScopedCheckedCore ObjectId)
+ !PreparedProof
| PreparedContradiction !PreparedDischarge
data PreparedExactProof = PreparedExactProof
@@ -277,6 +290,7 @@ prepareExactProof block explicitProof =
openEnvelopeVariables
targetCore
(Exact.preparedExactClaimVariables envelope)
+ (Exact.preparedExactClaimContext envelope)
(locals, bodyGoal, antecedents) <-
openEnvelopeAntecedents
context
@@ -410,20 +424,31 @@ prepareFinalPreludeFoundationClaim foundation block explicitProof =
openEnvelopeVariables
:: ScopedCheckedCore ObjectId
-> [Raw.VarSymbol]
+ -> Exact.ExactBinderContext
-> Prepare failure
( Exact.ExactBinderContext
, ScopedCheckedCore ObjectId
, [Exact.ExactLocalId]
)
-openEnvelopeVariables target variables =
+openEnvelopeVariables target variables preparedContext =
case NonEmpty.nonEmpty variables of
Nothing ->
- pure (Exact.emptyExactBinderContext, target, [])
- Just nonempty ->
- openFixedVariables
+ pure (preparedContext, target, [])
+ Just nonempty -> do
+ (_unannotated, opened, identities) <-
+ openFixedVariables
Exact.emptyExactBinderContext
target
nonempty
+ let expected =
+ reverse
+ (fst <$> toList
+ (Exact.exactBinderContextSupport preparedContext))
+ unless
+ (identities == expected)
+ (impossible
+ "prepared claim annotations do not match opened binders")
+ pure (preparedContext, opened, identities)
openEnvelopeAntecedents
:: Exact.ExactBinderContext
@@ -639,12 +664,16 @@ prepareProof fallback context locals inductionAntecedents goal = \case
(Exact.extendExactBinderContext
((identity, variable) :| [])
context)
+ separationCharacteristic <-
+ liftDriver
+ (Declaration.currentFoundationAxiomDriver
+ SeparationCharacteristic)
definition <-
maybe
(impossible
"an exact set expression did not form a local definition")
pure
- (scopedSetDefinition body)
+ (scopedSetDefinition separationCharacteristic body)
local <-
allocateLocal ExactLocalDefinition context' definition
PreparedDefine identity body definition
@@ -655,6 +684,65 @@ prepareProof fallback context locals inductionAntecedents goal = \case
Nothing
(weakenCheckedScopedCore TySet goal)
continuation
+ Raw.DefineFunction
+ location function argument value bound domain continuation -> do
+ unless (argument == bound)
+ (throwProof
+ (ExactProofLocalFunctionBinderMismatch (locate bound)))
+ when (function == argument)
+ (throwProof
+ (ExactProofLocalFunctionNameConflict (locate function)))
+ argumentIdentity <- allocateLocalIdentity
+ argumentContext <-
+ either
+ (throwProof . ExactProofElaborationFailed)
+ pure
+ (Exact.extendExactBinderContext
+ ((argumentIdentity, argument) :| [])
+ context)
+ graph <-
+ liftDriver
+ (Exact.prepareExactLocalFunctionGraph
+ location context argumentContext domain value)
+ >>= either
+ (throwProof . ExactProofElaborationFailed)
+ pure
+ functionIdentity <- allocateLocalIdentity
+ functionContext <-
+ either
+ (throwProof . ExactProofElaborationFailed)
+ pure
+ (Exact.extendExactBinderContext
+ ((functionIdentity, function) :| [])
+ context)
+ replacementCharacteristic <-
+ liftDriver
+ (Declaration.currentFoundationAxiomDriver
+ ReplacementCharacteristic)
+ definition <-
+ maybe
+ (impossible
+ "a checked replacement graph did not form a local definition")
+ pure
+ (scopedCharacteristicDefinition
+ replacementCharacteristic
+ (Exact.preparedExactLocalFunctionGraphCore graph)
+ ( Exact.preparedExactLocalFunctionGraphDomain graph
+ :| [Exact.preparedExactLocalFunctionGraphMap graph]
+ ))
+ local <-
+ allocateLocal ExactLocalDefinition functionContext definition
+ PreparedDefineFunction
+ functionIdentity
+ (Exact.preparedExactLocalFunctionGraphCore graph)
+ definition
+ <$> prepareProof
+ fallback
+ functionContext
+ (locals <> [local])
+ Nothing
+ (weakenCheckedScopedCore TySet goal)
+ continuation
Raw.Contradiction location justification -> do
unless
( scopedCoreType goal == TyProp
@@ -978,6 +1066,8 @@ preparedProofFirstOmission = \case
<|> preparedProofFirstOmission continuation
PreparedDefine _identity _body _definition continuation ->
preparedProofFirstOmission continuation
+ PreparedDefineFunction _identity _graph _definition continuation ->
+ preparedProofFirstOmission continuation
PreparedContradiction{} -> Nothing
executePreparedProof
@@ -1007,6 +1097,8 @@ executePreparedProof = \case
executePreparedProof continuation
PreparedDefine _identity _body _definition continuation ->
executePreparedProof continuation
+ PreparedDefineFunction _identity _graph _definition continuation ->
+ executePreparedProof continuation
PreparedContradiction discharge ->
executeDischarge discharge
@@ -1077,6 +1169,12 @@ putPreparedProof = \case
PreparedContradiction discharge -> do
putCacheTag 0x0a
putPreparedDischarge discharge
+ PreparedDefineFunction identity graph definition continuation -> do
+ putCacheTag 0x0b
+ putCacheNatural (Exact.exactLocalIdValue identity)
+ putScopedTerm graph
+ putScopedProposition definition
+ putPreparedProof continuation
putPreparedDischarge :: PreparedDischarge -> CachePut
putPreparedDischarge
diff --git a/source/Checking/Facts.hs b/source/Checking/Facts.hs
deleted file mode 100644
index b365e1e..0000000
--- a/source/Checking/Facts.hs
+++ /dev/null
@@ -1,340 +0,0 @@
-{-# LANGUAGE NoImplicitPrelude #-}
-
-module Checking.Facts
- ( PreparedSemanticFact
- , prepareSemanticFact
- , preparedSemanticStatement
- , preparedSemanticDependencies
- , FactOrigin
- , factOrigin
- , factOriginLocation
- , factOriginBlock
- , StagedFact
- , stageFact
- , stagedFactAliases
- , stagedFactOrigin
- , stagedFactSemantic
- , FactRegistry
- , emptyFactRegistry
- , registerStagedFacts
- , lookupPreparedFact
- , lookupFactOrigin
- , registeredFacts
- , registeredFactsWithOrigins
- , factRegistryExtension
- , restrictFactRegistry
- , partitionFactRegistry
- , factRegistryInvariant
- ) where
-
-import Base
-import Report.Location
-import Syntax.Internal
-
-import Data.List qualified as List
-import Data.List.NonEmpty qualified as NonEmpty
-import Data.Map.Strict qualified as Map
-import Data.Set qualified as Set
-
-
--- | A checked fact before aliases and diagnostic provenance are attached.
--- This is the complete long-lived semantic row.
-data PreparedSemanticFact = PreparedSemanticFact
- { preparedSemanticStatement :: !Formula
- , preparedSemanticDependencies :: !(Set Symbol)
- }
- deriving (Show, Eq)
-
-prepareSemanticFact :: Formula -> PreparedSemanticFact
-prepareSemanticFact statement =
- PreparedSemanticFact
- { preparedSemanticStatement = statement
- , preparedSemanticDependencies = mentionedSymbols statement
- }
-
-data FactOrigin = FactOrigin
- { factOriginLocation :: !Location
- , factOriginBlock :: !Marker
- }
- deriving (Show, Eq)
-
-factOrigin :: Location -> Marker -> FactOrigin
-factOrigin = FactOrigin
-
--- | Registration data for one semantic fact.
-data StagedFact = StagedFact
- { stagedFactAliases :: !(NonEmpty Marker)
- , stagedFactOrigin :: !FactOrigin
- , stagedFactSemantic :: !PreparedSemanticFact
- }
- deriving (Show, Eq)
-
-stageFact
- :: NonEmpty Marker
- -> FactOrigin
- -> PreparedSemanticFact
- -> StagedFact
-stageFact = StagedFact
-
-newtype FactHandle = FactHandle
- { unFactHandle :: Int
- }
- deriving (Show, Eq, Ord)
-
-data FactRegistration = FactRegistration
- { factRegistrationAliases :: !(NonEmpty Marker)
- , factRegistrationOrigin :: !FactOrigin
- }
- deriving (Show, Eq)
-
--- | Semantic rows and their registration sidecars share only a private handle.
-data FactRegistry = FactRegistry
- { factOrder :: ![FactHandle]
- , factRows :: !(Map FactHandle PreparedSemanticFact)
- , factRegistrations :: !(Map FactHandle FactRegistration)
- , factAliases :: !(Map Marker FactHandle)
- , nextFactHandle :: !Int
- }
- deriving (Show, Eq)
-
-emptyFactRegistry :: FactRegistry
-emptyFactRegistry =
- FactRegistry
- { factOrder = []
- , factRows = mempty
- , factRegistrations = mempty
- , factAliases = mempty
- , nextFactHandle = 0
- }
-
-registerStagedFacts
- :: NonEmpty StagedFact
- -> FactRegistry
- -> Either Marker FactRegistry
-registerStagedFacts staged registry =
- case firstDuplicateAlias (Map.keysSet (factAliases registry)) aliases of
- Just duplicate ->
- Left duplicate
- Nothing ->
- Right
- registry
- { factOrder = handles <> factOrder registry
- , factRows =
- Map.union
- (Map.fromList
- [ (handle, stagedFactSemantic fact)
- | (handle, fact) <- registrations
- ])
- (factRows registry)
- , factRegistrations =
- Map.union
- (Map.fromList
- [ ( handle
- , FactRegistration
- { factRegistrationAliases =
- stagedFactAliases fact
- , factRegistrationOrigin =
- stagedFactOrigin fact
- }
- )
- | (handle, fact) <- registrations
- ])
- (factRegistrations registry)
- , factAliases =
- Map.union
- (Map.fromList
- [ (alias, handle)
- | (handle, fact) <- registrations
- , alias <-
- NonEmpty.toList (stagedFactAliases fact)
- ])
- (factAliases registry)
- , nextFactHandle =
- nextFactHandle registry + length stagedList
- }
- where
- stagedList = NonEmpty.toList staged
- handles =
- FactHandle <$>
- [ nextFactHandle registry
- .. nextFactHandle registry + length stagedList - 1
- ]
- registrations = zip handles stagedList
- aliases =
- concatMap
- (NonEmpty.toList . stagedFactAliases)
- stagedList
-
-lookupPreparedFact :: Marker -> FactRegistry -> Maybe PreparedSemanticFact
-lookupPreparedFact marker registry = do
- handle <- Map.lookup marker (factAliases registry)
- Map.lookup handle (factRows registry)
-
-lookupFactOrigin :: Marker -> FactRegistry -> Maybe FactOrigin
-lookupFactOrigin marker registry = do
- handle <- Map.lookup marker (factAliases registry)
- factRegistrationOrigin
- <$> Map.lookup handle (factRegistrations registry)
-
--- | Facts in checker premise order, paired with their primary aliases.
-registeredFacts :: FactRegistry -> [(Marker, PreparedSemanticFact)]
-registeredFacts registry =
- [ (marker, semantic)
- | (marker, semantic, _origin) <-
- registeredFactsWithOrigins registry
- ]
-
--- | Facts in checker premise order with their registration provenance.
-registeredFactsWithOrigins
- :: FactRegistry
- -> [(Marker, PreparedSemanticFact, FactOrigin)]
-registeredFactsWithOrigins registry =
- [ (primaryAlias registration, semantic, factRegistrationOrigin registration)
- | handle <- factOrder registry
- , Just registration <- [Map.lookup handle (factRegistrations registry)]
- , Just semantic <- [Map.lookup handle (factRows registry)]
- ]
- where
- primaryAlias =
- NonEmpty.head . factRegistrationAliases
-
--- | Recover the source-ordered facts appended to one registry.
---
--- The first registry must be an unchanged prefix of the second.
-factRegistryExtension
- :: FactRegistry
- -> FactRegistry
- -> Either Text [StagedFact]
-factRegistryExtension previous current
- | nextFactHandle current < nextFactHandle previous =
- Left "fact registry handle counter moved backwards"
- | Map.restrictKeys
- (factRows current)
- previousHandles
- /= factRows previous =
- Left "fact registry changed an existing semantic row"
- | Map.restrictKeys
- (factRegistrations current)
- previousHandles
- /= factRegistrations previous =
- Left "fact registry changed an existing registration"
- | Map.restrictKeys
- (factAliases current)
- previousAliases
- /= factAliases previous =
- Left "fact registry changed an existing alias"
- | factOrder current
- /= extensionHandles <> factOrder previous =
- Left "fact registry extension changed premise order"
- | otherwise =
- traverse staged extensionHandles
- where
- previousHandles =
- Map.keysSet (factRows previous)
- previousAliases =
- Map.keysSet (factAliases previous)
- extensionHandles =
- FactHandle <$>
- [ nextFactHandle previous
- .. nextFactHandle current - 1
- ]
-
- staged handle = do
- semantic <-
- maybe
- (Left "fact registry extension is missing a semantic row")
- Right
- (Map.lookup handle (factRows current))
- registration <-
- maybe
- (Left "fact registry extension is missing a registration")
- Right
- (Map.lookup handle (factRegistrations current))
- pure
- (StagedFact
- (factRegistrationAliases registration)
- (factRegistrationOrigin registration)
- semantic)
-
-restrictFactRegistry
- :: NonEmpty Marker
- -> FactRegistry
- -> Either Marker FactRegistry
-restrictFactRegistry markers registry = do
- handles <- traverse resolveHandle markers
- pure (registryForHandles (orderedUnique (NonEmpty.toList handles)) registry)
- where
- resolveHandle marker =
- maybe (Left marker) Right (Map.lookup marker (factAliases registry))
-
-partitionFactRegistry
- :: NonEmpty Marker
- -> FactRegistry
- -> Either Marker (FactRegistry, FactRegistry)
-partitionFactRegistry markers registry = do
- selected <- restrictFactRegistry markers registry
- let selectedHandles = Set.fromList (factOrder selected)
- selectedInRegistryOrder =
- List.filter (`Set.member` selectedHandles) (factOrder registry)
- unselectedHandles =
- List.filter (`Set.notMember` selectedHandles) (factOrder registry)
- pure
- ( registryForHandles selectedInRegistryOrder registry
- , registryForHandles unselectedHandles registry
- )
-
-factRegistryInvariant :: FactRegistry -> Bool
-factRegistryInvariant registry =
- length order == Set.size orderSet
- && orderSet == Map.keysSet (factRows registry)
- && orderSet == Map.keysSet (factRegistrations registry)
- && aliasCount == Map.size expectedAliases
- && expectedAliases == factAliases registry
- && all ((< nextFactHandle registry) . unFactHandle) order
- where
- order = factOrder registry
- orderSet = Set.fromList order
- aliasPairs =
- [ (alias, handle)
- | (handle, registration) <-
- Map.toList (factRegistrations registry)
- , alias <-
- NonEmpty.toList (factRegistrationAliases registration)
- ]
- aliasCount = length aliasPairs
- expectedAliases = Map.fromList aliasPairs
-
-registryForHandles :: [FactHandle] -> FactRegistry -> FactRegistry
-registryForHandles handles registry =
- registry
- { factOrder = handles
- , factRows = Map.restrictKeys (factRows registry) handleSet
- , factRegistrations =
- Map.restrictKeys (factRegistrations registry) handleSet
- , factAliases =
- Map.filter (`Set.member` handleSet) (factAliases registry)
- }
- where
- handleSet = Set.fromList handles
-
-firstDuplicateAlias :: Set Marker -> [Marker] -> Maybe Marker
-firstDuplicateAlias existing =
- go mempty
- where
- go _seen [] =
- Nothing
- go seen (marker:rest)
- | marker `Set.member` existing || marker `Set.member` seen =
- Just marker
- | otherwise =
- go (Set.insert marker seen) rest
-
-orderedUnique :: Ord a => [a] -> [a]
-orderedUnique =
- reverse . snd . foldl' step (mempty, [])
- where
- step (seen, acc) value
- | value `Set.member` seen =
- (seen, acc)
- | otherwise =
- (Set.insert value seen, value : acc)
diff --git a/source/Checking/FinalPrelude.hs b/source/Checking/FinalPrelude.hs
index 1e05199..ac2a941 100644
--- a/source/Checking/FinalPrelude.hs
+++ b/source/Checking/FinalPrelude.hs
@@ -9,12 +9,15 @@ module Checking.FinalPrelude
, finalPreludeSemantic
, finalPreludePrefix
, finalPreludeObjects
+ , PreludePublicRole(..)
+ , expectedFinalPreludePublicRoles
, FinalPreludeRoleTarget(..)
, finalPreludePublicRole
, FinalPreludeValidationError(..)
, FinalPreludeFailure(..)
, FinalPreludeBuildResult(..)
, buildFinalPreludeCandidate
+ , buildParsedFinalPreludeCandidate
) where
import Base hiding (Empty)
@@ -28,17 +31,19 @@ import Checking.Identity
import Checking.Semantic
import Checking.Semantic qualified as Semantic
import Felix.Module
-import Felix.Migration qualified as Migration
import Felix.Parse
import Felix.Prelude qualified as Prelude
import Felix.Source (ImportRef)
import Report.Location
import Syntax.Abstract qualified as Raw
import Syntax.Interface
+import Syntax.Lexicon qualified as Lexicon
import Control.Monad (unless)
+import Data.Bifunctor (first)
import Data.List qualified as List
import Data.Map.Strict qualified as Map
+import Data.Set qualified as Set
data FinalPreludeCandidate = FinalPreludeCandidate
@@ -47,7 +52,7 @@ data FinalPreludeCandidate = FinalPreludeCandidate
!SemanticInterface
!Declaration.PendingModulePrefix
!CheckedObjectClosure
- !(Map.Map Migration.PreludePublicRole FinalPreludeRoleTarget)
+ !(Map.Map PreludePublicRole FinalPreludeRoleTarget)
finalPreludeParsed
:: FinalPreludeCandidate
@@ -94,9 +99,23 @@ data FinalPreludeRoleTarget
| FinalPreludeTheoremRole !TheoremRef
deriving stock (Show, Eq, Ord)
+-- | Stable public roles exported by the packaged final prelude.
+data PreludePublicRole
+ = PreludeInfinityTheorem
+ | PreludeOmegaObject
+ | PreludeOmegaDefiningEquation
+ | PreludeNaturalsAlias
+ | PreludeNaturalsInductiveTheorem
+ | PreludeNaturalsMinimalTheorem
+ deriving stock (Show, Eq, Ord, Enum, Bounded)
+
+expectedFinalPreludePublicRoles :: Set PreludePublicRole
+expectedFinalPreludePublicRoles =
+ Set.fromList [minBound .. maxBound]
+
finalPreludePublicRole
:: FinalPreludeCandidate
- -> Migration.PreludePublicRole
+ -> PreludePublicRole
-> Maybe FinalPreludeRoleTarget
finalPreludePublicRole
(FinalPreludeCandidate _parsed _syntax _semantic _prefix _objects
@@ -115,7 +134,8 @@ data FinalPreludeValidationError
| FinalPreludeFactContentMismatch !Text
| FinalPreludeValidationInventoryMismatch !DeclarationSlot
| FinalPreludeAuthorityMismatch !DeclarationSlot
- | FinalPreludePublicRoleMismatch !Migration.PreludePublicRole
+ | FinalPreludeBaseStructureMismatch
+ | FinalPreludePublicRoleMismatch !PreludePublicRole
deriving stock (Show, Eq)
data FinalPreludeFailure
@@ -157,7 +177,9 @@ buildFinalPreludeCandidate foundation resolver =
buildParsedFinalPreludeCandidate
foundation parsed resolver
--- The packaged loader above is the only entry to final-candidate construction.
+-- The production acquisition path establishes packaged provenance before
+-- passing its already parsed source here. The explicit parsed seam avoids a
+-- second load and parse on a cache miss.
buildParsedFinalPreludeCandidate
:: CheckedFoundation
-> Prelude.ReservedParsedPrelude
@@ -225,7 +247,7 @@ buildParsedFinalPreludeCandidate foundation parsed resolver =
[]
compileBlocks _blockIndex [] =
- pure ()
+ commitBaseStructure
compileBlocks blockIndex (block : remaining) =
case block of
Raw.BlockClaim{} ->
@@ -249,6 +271,39 @@ buildParsedFinalPreludeCandidate foundation parsed resolver =
Declaration.failModuleDriver
(FinalPreludeUnsupportedBlock (locate block))
+ commitBaseStructure = do
+ slot <- Declaration.nextDeclarationSlotDriver
+ theory <- Declaration.currentTheoryDriver
+ let seed =
+ opaqueDeclarationSeed
+ (declarationSlotModule slot)
+ (declarationSlotOrdinal slot)
+ StructureDeclaration
+ (generatedObjectSlot 0)
+ coreType = TyArrow TySet TySet
+ content = OpaqueObjectContent theory seed coreType
+ identity = opaqueObjectId theory seed coreType
+ asserted = assertedObject identity content
+ structurePhrase =
+ semanticStructurePhrase Lexicon._Onesorted
+ operation =
+ semanticStructureOperation Raw.CarrierSymbol identity
+ descriptor <-
+ either
+ (Declaration.failModuleDriver
+ . FinalPreludeDeclarationFailed
+ . Declaration.DeclarationEnvironmentFailed)
+ pure
+ (semanticStructureDescriptor
+ structurePhrase Nothing [] [operation])
+ void
+ (Declaration.commitCompiledDeclaration
+ (declarationSyntaxId
+ "felix-final-prelude-base-structure-v1") do
+ Declaration.addDeclarationObject asserted
+ Declaration.stageSemanticStructureDescriptor descriptor
+ Declaration.authorizeCompiledDeclaration (pure ()))
+
compileBinding blockIndex block = do
prepared <-
Exact.prepareExactDeclaration
@@ -312,10 +367,12 @@ validateFinalPrelude
-> CheckedObjectClosure
-> Either
FinalPreludeValidationError
- (Map.Map Migration.PreludePublicRole FinalPreludeRoleTarget)
+ (Map.Map PreludePublicRole FinalPreludeRoleTarget)
validateFinalPrelude foundation parsed semantic prefix objects = do
- declarations <- associatePreludeDeclarations parsed prefix
- validateConfinedAuthority foundation semantic objects declarations
+ (declarations, baseStructure) <-
+ associatePreludeDeclarations parsed prefix
+ validateConfinedAuthority
+ foundation semantic objects declarations baseStructure
resolveAndValidatePublicRoles foundation objects declarations
resolveAndValidatePublicRoles
@@ -324,7 +381,7 @@ resolveAndValidatePublicRoles
-> [PreludeDeclaration]
-> Either
FinalPreludeValidationError
- (Map.Map Migration.PreludePublicRole FinalPreludeRoleTarget)
+ (Map.Map PreludePublicRole FinalPreludeRoleTarget)
resolveAndValidatePublicRoles foundation objects declarations = do
successor <-
expectDefinition
@@ -403,30 +460,30 @@ resolveAndValidatePublicRoles foundation objects declarations = do
minimalOmega
let roles = Map.fromList
- [ ( Migration.PreludeInfinityTheorem
+ [ ( PreludeInfinityTheorem
, FinalPreludeTheoremRole infinity
)
- , ( Migration.PreludeOmegaObject
+ , ( PreludeOmegaObject
, FinalPreludeObjectRole omegaId
)
- , ( Migration.PreludeOmegaDefiningEquation
+ , ( PreludeOmegaDefiningEquation
, FinalPreludeTheoremRole omegaEquation
)
- , ( Migration.PreludeNaturalsAlias
+ , ( PreludeNaturalsAlias
, FinalPreludeObjectRole omegaId
)
- , ( Migration.PreludeNaturalsInductiveTheorem
+ , ( PreludeNaturalsInductiveTheorem
, FinalPreludeTheoremRole naturalsInductive
)
- , ( Migration.PreludeNaturalsMinimalTheorem
+ , ( PreludeNaturalsMinimalTheorem
, FinalPreludeTheoremRole naturalsMinimal
)
]
unless
- (Map.keysSet roles == Migration.expectedFinalPreludePublicRoles)
+ (Map.keysSet roles == expectedFinalPreludePublicRoles)
(Left
(FinalPreludePublicRoleMismatch
- Migration.PreludeInfinityTheorem))
+ PreludeInfinityTheorem))
pure roles
validatePackagedPreludeInput
@@ -460,12 +517,19 @@ validatePackagedPreludeInput parsed syntax
associatePreludeDeclarations
:: Prelude.ReservedParsedPrelude
-> Declaration.PendingModulePrefix
- -> Either FinalPreludeValidationError [PreludeDeclaration]
+ -> Either
+ FinalPreludeValidationError
+ ([PreludeDeclaration], Declaration.CommittedDeclarationBatch)
associatePreludeDeclarations parsed prefix = do
- unless
- (length sourceDeclarations == length batches)
- (Left FinalPreludeDeclarationAssociationMismatch)
- pure (zipWith PreludeDeclaration sourceDeclarations batches)
+ case List.splitAt (length sourceDeclarations) batches of
+ (sourceBatches, [baseStructure])
+ | length sourceBatches == length sourceDeclarations ->
+ pure
+ ( zipWith PreludeDeclaration
+ sourceDeclarations sourceBatches
+ , baseStructure
+ )
+ _ -> Left FinalPreludeDeclarationAssociationMismatch
where
sourceDeclarations =
[ block
@@ -483,8 +547,10 @@ validateConfinedAuthority
-> SemanticInterface
-> CheckedObjectClosure
-> [PreludeDeclaration]
+ -> Declaration.CommittedDeclarationBatch
-> Either FinalPreludeValidationError ()
-validateConfinedAuthority foundation semantic objects declarations = do
+validateConfinedAuthority
+ foundation semantic objects declarations baseStructure = do
unless
( semanticInterfaceOwner semantic == preludeModuleName
&& null (semanticInterfaceDirectInputs semantic)
@@ -499,12 +565,68 @@ validateConfinedAuthority foundation semantic objects declarations = do
(declarationBatch declaration))
]
traverse_ (validateDeclarationAuthority foundation objects) declarations
+ validateBaseStructure foundation objects baseStructure
where
requireTransparent identity =
case lookupCheckedObjectContent identity objects of
Just TransparentObjectContent{} -> pure ()
_ -> Left (FinalPreludeUnexpectedObject identity)
+validateBaseStructure
+ :: CheckedFoundation
+ -> CheckedObjectClosure
+ -> Declaration.CommittedDeclarationBatch
+ -> Either FinalPreludeValidationError ()
+validateBaseStructure foundation objects batch = do
+ let slot = Declaration.committedBatchSlot batch
+ delta = Declaration.committedBatchDelta batch
+ environment = declarationDeltaEnvironment delta
+ structurePhrase = semanticStructurePhrase Lexicon._Onesorted
+ expectedSeed =
+ opaqueDeclarationSeed
+ (declarationSlotModule slot)
+ (declarationSlotOrdinal slot)
+ StructureDeclaration
+ (generatedObjectSlot 0)
+ expectedType = TyArrow TySet TySet
+ expectedObject = opaqueObjectId (theoryId foundation) expectedSeed expectedType
+ expectedContent =
+ OpaqueObjectContent
+ (theoryId foundation)
+ expectedSeed
+ expectedType
+ descriptor <-
+ case semanticEnvironmentStructures environment of
+ [single] -> Right single
+ _ -> Left FinalPreludeBaseStructureMismatch
+ expectedDescriptor <-
+ first (const FinalPreludeBaseStructureMismatch)
+ (semanticStructureDescriptor
+ structurePhrase
+ Nothing
+ []
+ [semanticStructureOperation Raw.CarrierSymbol expectedObject])
+ unless
+ ( declarationSlotModule slot == preludeModuleName
+ && descriptor == expectedDescriptor
+ && null (semanticEnvironmentBindings environment)
+ && declarationDeltaObjects delta == [expectedObject]
+ && null (declarationDeltaFacts delta)
+ && null (declarationDeltaAliases delta)
+ && null (declarationDeltaPropositions delta)
+ && Declaration.committedBatchObjects batch
+ == [assertedObject expectedObject expectedContent]
+ && null (Declaration.committedBatchPropositions batch)
+ && null (Declaration.committedBatchProofValidations batch)
+ && maybe
+ False
+ (null . declarationValidationRecordCertificates)
+ (Declaration.committedBatchDeclarationValidation batch)
+ && lookupCheckedObjectContent expectedObject objects
+ == Just expectedContent
+ )
+ (Left FinalPreludeBaseStructureMismatch)
+
validateDeclarationAuthority
:: CheckedFoundation
-> CheckedObjectClosure
diff --git a/source/Checking/Legacy.hs b/source/Checking/Legacy.hs
deleted file mode 100644
index 7c7bbb4..0000000
--- a/source/Checking/Legacy.hs
+++ /dev/null
@@ -1,1788 +0,0 @@
-{-# LANGUAGE DerivingStrategies #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-
--- | Disposable H1 vocabulary for the legacy checker.
---
--- These values exist only for one checking invocation. They are neither final
--- typed identities nor persistent authorization.
-module Checking.Legacy
- ( LegacyModuleOrdinal
- , legacyModuleOrdinal
- , legacyModuleOrdinalValue
- , LegacyLocalFactOrdinal
- , legacyLocalFactOrdinal
- , legacyLocalFactOrdinalValue
- , LegacyFactRef
- , legacyFactRef
- , legacyFactModule
- , legacyFactLocalOrdinal
- , LegacyModuleAssignment
- , assignLegacyModuleOrdinals
- , assignedLegacyModuleOrdinal
- , assignedParsedModule
- , LegacyLocalAssumptionOrdinal
- , legacyLocalAssumptionOrdinal
- , legacyLocalAssumptionOrdinalValue
- , LegacyObligationOrdinal
- , legacyObligationOrdinal
- , legacyObligationOrdinalValue
- , SessionLegacyObligationRef
- , sessionLegacyObligationRef
- , AssumptionKind(..)
- , LegacyPreparedProposition
- , prepareLegacyProposition
- , legacyPreparedFormula
- , LegacyDirectAxiomManifestEntry
- , SessionLegacyDeclaredAssumptionRef
- , LegacySemanticFact
- , legacySemanticFact
- , legacySemanticProposition
- , LegacyTheoremFinalizationRole(..)
- , LegacyDefinitionFactRole(..)
- , LegacyDatatypeFactRole(..)
- , LegacyStructureFactRole(..)
- , LegacyInductiveFactRole(..)
- , LegacyRuleTag(..)
- , LegacyFactProducer(..)
- , LegacyRulePredecessor
- , legacyRuleFactPredecessor
- , legacyRuleObligationPredecessor
- , CheckedLegacyRuleApplication
- , VampireLoweringAssumption(..)
- , mandatoryVampireLoweringAssumptions
- , SessionLegacyTrustedVampireUse
- , SessionLegacyGapUse
- , SessionLegacyRuleUse
- , LegacyTrustDependencies
- , emptyLegacyTrustDependencies
- , legacyTrustedVampireTrust
- , legacyGapTrust
- , legacyDeclaredAssumptionUses
- , legacyTrustedVampireUses
- , legacyExplicitGaps
- , legacyGapLocations
- , trustedLegacyRuleUses
- , legacyVampireLoweringUses
- , SessionLegacyTrustedVampireEvidence
- , SessionLegacyGapEvidence
- , LegacyFactAuthorization
- , legacyAuthorizationTrustDependencies
- , H1LegacyFactAuthorization
- , LegacyAdmittedFact
- , H1LegacyAdmittedFact
- , SymbolOwnerKind(..)
- , SymbolOwner(..)
- , LegacyCheckingEnvironment
- , legacyCheckingEnvironment
- , legacyEnvironmentAbbreviations
- , legacyEnvironmentPredicateDefinitions
- , legacyEnvironmentDependencies
- , legacyEnvironmentOwnedSymbols
- , legacyEnvironmentOwnedSymbolMarkers
- , legacyEnvironmentFrozenSymbols
- , legacyEnvironmentStructs
- , legacyEnvironmentDefinedMarkers
- , LegacyImportedView
- , emptyLegacyImportedView
- , legacyImportedView
- , legacyImportedModuleOrdinals
- , legacyImportedCheckingEnvironment
- , LegacyModuleStage
- , openLegacyModuleStage
- , legacyStageModuleOrdinal
- , legacyStageSourceAddress
- , legacyStageVisibleFacts
- , legacyStageLocalFacts
- , legacyStageFactRegistry
- , legacyStageDirectAxiomManifest
- , legacyStageImportedCheckingEnvironment
- , lookupLegacyStageFact
- , LegacyFactEntry
- , legacyFactEntryReference
- , legacyFactEntryStagedFact
- , legacyFactEntryAdmittedFact
- , legacyFactEntryTrustDependencies
- , LegacyReservedFact
- , legacyReservedFactReference
- , legacyReservedStagedFact
- , LegacyDeclarationReservation
- , reserveLegacyDeclaration
- , legacyReservedFacts
- , appendEstablishedLegacyDeclaration
- , authorizeLegacyDeclaredAssumption
- , authorizeLegacyTrustedVampire
- , authorizeLegacyGap
- , authorizeLegacyRule
- , LegacyAdmittedModule
- , sealLegacyModuleStage
- , legacyAdmittedModuleOrdinal
- , legacyAdmittedSourceAddress
- , legacyAdmittedDirectImports
- , legacyAdmittedVisibleFacts
- , legacyAdmittedLocalFacts
- , legacyAdmittedFactRegistry
- , legacyAdmittedDirectAxiomManifest
- , legacyAdmittedTrustDependencies
- , legacyAdmittedCheckingEnvironment
- , LegacyModuleStageError(..)
- ) where
-
-import Base
-import Checking.Facts qualified as Facts
-import Checking.Legacy.Environment
-import Felix.Parse
- ( ParsedModule
- , ParsedSourceWorkspace
- , parsedModuleAddress
- , parsedWorkspaceImportedBeforeImporter
- )
-import Felix.Source (ResolvedSourceAddress)
-import Provers (AcceptedVampireRun)
-import Report.Location
-import Syntax.Internal
-
-import Control.Monad (foldM, unless)
-import Data.Bifunctor (first)
-import Data.List.NonEmpty qualified as NonEmpty
-import Data.Map.Strict qualified as Map
-import Data.Set qualified as Set
-import Data.Vector (Vector)
-import Data.Vector qualified as Vector
-import Data.Word (Word32)
-import Numeric.Natural (Natural)
-
-
--- | Dense invocation-local module position.
-newtype LegacyModuleOrdinal = LegacyModuleOrdinal Word32
- deriving stock (Show, Eq, Ord)
-
-legacyModuleOrdinal :: Word32 -> LegacyModuleOrdinal
-legacyModuleOrdinal = LegacyModuleOrdinal
-
-legacyModuleOrdinalValue :: LegacyModuleOrdinal -> Word32
-legacyModuleOrdinalValue (LegacyModuleOrdinal ordinal) =
- ordinal
-
-
--- | Dense invocation-local fact position within one module.
-newtype LegacyLocalFactOrdinal = LegacyLocalFactOrdinal Word32
- deriving stock (Show, Eq, Ord)
-
-legacyLocalFactOrdinal :: Word32 -> LegacyLocalFactOrdinal
-legacyLocalFactOrdinal = LegacyLocalFactOrdinal
-
-legacyLocalFactOrdinalValue :: LegacyLocalFactOrdinal -> Word32
-legacyLocalFactOrdinalValue (LegacyLocalFactOrdinal ordinal) =
- ordinal
-
-
-data LegacyFactRef = LegacyFactRef
- !LegacyModuleOrdinal
- !LegacyLocalFactOrdinal
- deriving stock (Show, Eq, Ord)
-
-legacyFactRef
- :: LegacyModuleOrdinal
- -> LegacyLocalFactOrdinal
- -> LegacyFactRef
-legacyFactRef = LegacyFactRef
-
-legacyFactModule :: LegacyFactRef -> LegacyModuleOrdinal
-legacyFactModule (LegacyFactRef moduleOrdinal _factOrdinal) =
- moduleOrdinal
-
-legacyFactLocalOrdinal :: LegacyFactRef -> LegacyLocalFactOrdinal
-legacyFactLocalOrdinal (LegacyFactRef _moduleOrdinal factOrdinal) =
- factOrdinal
-
-
--- | One parsed module paired with its dense invocation-local position.
-data LegacyModuleAssignment = LegacyModuleAssignment
- !LegacyModuleOrdinal
- !ParsedModule
-
-assignedLegacyModuleOrdinal
- :: LegacyModuleAssignment
- -> LegacyModuleOrdinal
-assignedLegacyModuleOrdinal
- (LegacyModuleAssignment ordinal _parsedModule) =
- ordinal
-
-assignedParsedModule :: LegacyModuleAssignment -> ParsedModule
-assignedParsedModule
- (LegacyModuleAssignment _ordinal parsedModule) =
- parsedModule
-
--- | Assign module ordinals in imported-before-importer source order.
-assignLegacyModuleOrdinals
- :: ParsedSourceWorkspace
- -> Either LegacyModuleStageError (NonEmpty LegacyModuleAssignment)
-assignLegacyModuleOrdinals workspace
- | moduleCountInteger > legacyModuleCapacity =
- Left
- (LegacyModuleOrdinalSpaceExhausted
- (fromIntegral moduleCount))
- | otherwise =
- Right
- (NonEmpty.zipWith
- (\ordinal parsedModule ->
- LegacyModuleAssignment
- (legacyModuleOrdinal
- (fromIntegral ordinal))
- parsedModule)
- ((0 :| [1 ..]) :: NonEmpty Integer)
- modules)
- where
- modules =
- parsedWorkspaceImportedBeforeImporter workspace
- parsedModules =
- NonEmpty.toList modules
- moduleCount =
- length parsedModules
- moduleCountInteger =
- toInteger moduleCount
- legacyModuleCapacity =
- toInteger (maxBound :: Word32) + 1
-
-
-newtype LegacyLocalAssumptionOrdinal =
- LegacyLocalAssumptionOrdinal Natural
- deriving stock (Show, Eq, Ord)
-
-legacyLocalAssumptionOrdinal
- :: Natural
- -> LegacyLocalAssumptionOrdinal
-legacyLocalAssumptionOrdinal = LegacyLocalAssumptionOrdinal
-
-legacyLocalAssumptionOrdinalValue
- :: LegacyLocalAssumptionOrdinal
- -> Natural
-legacyLocalAssumptionOrdinalValue
- (LegacyLocalAssumptionOrdinal ordinal) =
- ordinal
-
-
--- | Position of one goal among all batches emitted by one declaration.
-newtype LegacyObligationOrdinal = LegacyObligationOrdinal Natural
- deriving stock (Show, Eq, Ord)
-
-legacyObligationOrdinal :: Natural -> LegacyObligationOrdinal
-legacyObligationOrdinal = LegacyObligationOrdinal
-
-legacyObligationOrdinalValue :: LegacyObligationOrdinal -> Natural
-legacyObligationOrdinalValue (LegacyObligationOrdinal ordinal) =
- ordinal
-
-
--- | Session identity assigned after M3a supplies the owning module.
-data SessionLegacyObligationRef = SessionLegacyObligationRef
- !LegacyModuleOrdinal
- !Marker
- !LegacyObligationOrdinal
- deriving stock (Show, Eq, Ord)
-
-sessionLegacyObligationRef
- :: LegacyModuleOrdinal
- -> Marker
- -> LegacyObligationOrdinal
- -> SessionLegacyObligationRef
-sessionLegacyObligationRef =
- SessionLegacyObligationRef
-
-
-data AssumptionKind
- = DeclaredUserAxiom
- | OpaqueAssumption
- deriving stock (Show, Eq, Ord)
-
-
--- | Canonical H0 proposition. This makes no typed-core claim.
-newtype LegacyPreparedProposition =
- LegacyPreparedProposition Formula
- deriving stock (Show, Eq, Ord)
-
-prepareLegacyProposition
- :: Facts.PreparedSemanticFact
- -> LegacyPreparedProposition
-prepareLegacyProposition =
- LegacyPreparedProposition . Facts.preparedSemanticStatement
-
-legacyPreparedFormula :: LegacyPreparedProposition -> Formula
-legacyPreparedFormula (LegacyPreparedProposition formula) =
- formula
-
-
-data LegacyDirectAxiomManifestEntry = LegacyDirectAxiomManifestEntry
- { legacyDirectAssumptionFact :: !LegacyFactRef
- , legacyDirectAssumptionKind :: !AssumptionKind
- , legacyDirectAssumptionStatement :: !LegacyPreparedProposition
- }
- deriving stock (Show, Eq, Ord)
-
-
-data SessionLegacyDeclaredAssumptionRef =
- SessionLegacyDeclaredAssumptionRef
- !LegacyFactRef
- !LegacyLocalAssumptionOrdinal
- !AssumptionKind
- !LegacyPreparedProposition
- deriving stock (Show, Eq, Ord)
-
-
-newtype LegacySemanticFact =
- LegacySemanticFact LegacyPreparedProposition
- deriving stock (Show, Eq, Ord)
-
-legacySemanticFact :: LegacyPreparedProposition -> LegacySemanticFact
-legacySemanticFact = LegacySemanticFact
-
-legacySemanticProposition
- :: LegacySemanticFact
- -> LegacyPreparedProposition
-legacySemanticProposition (LegacySemanticFact proposition) =
- proposition
-
-
-data LegacyTheoremFinalizationRole
- = LegacyOrdinaryTheoremFinalization
- deriving stock (Show, Eq, Ord)
-
-data LegacyDefinitionFactRole
- = LegacyDefinitionEquation
- deriving stock (Show, Eq, Ord)
-
-data LegacyDatatypeFactRole
- = LegacyDatatypeIntroduction
- | LegacyDatatypeDistinctness
- | LegacyDatatypeInjectivity
- | LegacyDatatypeCases
- | LegacyDatatypeInduction
- deriving stock (Show, Eq, Ord)
-
-data LegacyStructureFactRole
- = LegacyStructureIntroduction
- | LegacyStructureInheritance
- | LegacyStructureAssumption
- deriving stock (Show, Eq, Ord)
-
-data LegacyInductiveFactRole
- = LegacyInductiveIntroduction
- | LegacyInductiveDomainSubset
- | LegacyInductiveCases
- | LegacyInductiveInduction
- deriving stock (Show, Eq, Ord)
-
-data LegacyRuleTag
- = LegacyTheoremRule !LegacyTheoremFinalizationRole
- | LegacyDefinitionRule !LegacyDefinitionFactRole
- | LegacyDatatypeRule !LegacyDatatypeFactRole
- | LegacyStructureRule !LegacyStructureFactRole
- | LegacyInductiveRule !LegacyInductiveFactRole
- deriving stock (Show, Eq, Ord)
-
--- | Complete authorization choice for every current legacy fact publisher.
-data LegacyFactProducer
- = LegacyDeclaredAssumptionProducer !AssumptionKind
- | LegacyDirectObligationProducer
- | LegacyDeclarationRuleProducer !LegacyRuleTag
- deriving stock (Show, Eq, Ord)
-
-
-data LegacyRulePredecessor ref
- = LegacyRuleFactPredecessor !ref
- | LegacyRuleObligationPredecessor !SessionLegacyObligationRef
- deriving stock (Show, Eq, Ord)
-
-legacyRuleFactPredecessor
- :: ref
- -> LegacyRulePredecessor ref
-legacyRuleFactPredecessor =
- LegacyRuleFactPredecessor
-
-legacyRuleObligationPredecessor
- :: SessionLegacyObligationRef
- -> LegacyRulePredecessor ref
-legacyRuleObligationPredecessor =
- LegacyRuleObligationPredecessor
-
-data CheckedLegacyRuleApplication ref trust =
- CheckedLegacyRuleApplication
- { checkedLegacyRuleTag :: !LegacyRuleTag
- , checkedLegacyRuleTarget :: !LegacyPreparedProposition
- , checkedLegacyPredecessors
- :: !(Vector (LegacyRulePredecessor ref))
- , checkedLegacyTrustSummary :: !trust
- }
- deriving stock (Show, Eq)
-
-
-data VampireLoweringAssumption
- = VampireUsesDoubleNegationElim
- | VampireUsesPropositionalExtensionality
- deriving stock (Show, Eq, Ord)
-
-mandatoryVampireLoweringAssumptions
- :: Set VampireLoweringAssumption
-mandatoryVampireLoweringAssumptions =
- Set.fromList
- [ VampireUsesDoubleNegationElim
- , VampireUsesPropositionalExtensionality
- ]
-
-
-newtype SessionLegacyTrustedVampireUse =
- SessionLegacyTrustedVampireUse SessionLegacyObligationRef
- deriving stock (Show, Eq, Ord)
-
-data SessionLegacyGapUse = SessionLegacyGapUse
- !SessionLegacyObligationRef
- !Location
- !Marker
- deriving stock (Show, Eq, Ord)
-
-data SessionLegacyRuleUse = SessionLegacyRuleUse
- !LegacyFactRef
- !LegacyRuleTag
- deriving stock (Show, Eq, Ord)
-
-
-data LegacyTrustDependencies = LegacyTrustDependencies
- { legacyDeclaredAssumptionUses
- :: !(Set SessionLegacyDeclaredAssumptionRef)
- , legacyTrustedVampireUses
- :: !(Set SessionLegacyTrustedVampireUse)
- , legacyExplicitGaps
- :: !(Set SessionLegacyGapUse)
- , trustedLegacyRuleUses
- :: !(Set SessionLegacyRuleUse)
- , legacyVampireLoweringUses
- :: !(Set VampireLoweringAssumption)
- }
- deriving stock (Show, Eq)
-
-emptyLegacyTrustDependencies :: LegacyTrustDependencies
-emptyLegacyTrustDependencies =
- LegacyTrustDependencies
- { legacyDeclaredAssumptionUses = mempty
- , legacyTrustedVampireUses = mempty
- , legacyExplicitGaps = mempty
- , trustedLegacyRuleUses = mempty
- , legacyVampireLoweringUses = mempty
- }
-
-legacyTrustedVampireTrust
- :: SessionLegacyObligationRef
- -> LegacyTrustDependencies
- -> LegacyTrustDependencies
-legacyTrustedVampireTrust obligation predecessorTrust =
- predecessorTrust
- <> mempty
- { legacyTrustedVampireUses =
- Set.singleton
- (SessionLegacyTrustedVampireUse obligation)
- , legacyVampireLoweringUses =
- mandatoryVampireLoweringAssumptions
- }
-
-legacyGapTrust
- :: SessionLegacyObligationRef
- -> Location
- -> Marker
- -> LegacyTrustDependencies
- -> LegacyTrustDependencies
-legacyGapTrust obligation location marker predecessorTrust =
- predecessorTrust
- <> mempty
- { legacyExplicitGaps =
- Set.singleton
- (SessionLegacyGapUse
- obligation
- location
- marker)
- }
-
-legacyGapLocations
- :: LegacyTrustDependencies
- -> [Location]
-legacyGapLocations trust =
- [ location
- | SessionLegacyGapUse
- _obligation
- location
- _marker <-
- Set.toList (legacyExplicitGaps trust)
- ]
-
-instance Semigroup LegacyTrustDependencies where
- left <> right =
- LegacyTrustDependencies
- { legacyDeclaredAssumptionUses =
- legacyDeclaredAssumptionUses left
- <> legacyDeclaredAssumptionUses right
- , legacyTrustedVampireUses =
- legacyTrustedVampireUses left
- <> legacyTrustedVampireUses right
- , legacyExplicitGaps =
- legacyExplicitGaps left
- <> legacyExplicitGaps right
- , trustedLegacyRuleUses =
- trustedLegacyRuleUses left
- <> trustedLegacyRuleUses right
- , legacyVampireLoweringUses =
- legacyVampireLoweringUses left
- <> legacyVampireLoweringUses right
- }
-
-instance Monoid LegacyTrustDependencies where
- mempty = emptyLegacyTrustDependencies
-
-
-data SessionLegacyTrustedVampireEvidence trust =
- SessionLegacyTrustedVampireEvidence
- !SessionLegacyObligationRef
- !LegacyPreparedProposition
- !AcceptedVampireRun
- !trust
- deriving stock (Eq)
-
-data SessionLegacyGapEvidence trust = SessionLegacyGapEvidence
- !SessionLegacyObligationRef
- !LegacyPreparedProposition
- !Location
- !Marker
- !trust
- deriving stock (Show, Eq)
-
-
-data LegacyFactAuthorization ref trust
- = LegacyDeclaredAssumption !SessionLegacyDeclaredAssumptionRef
- | LegacyTrustedVampire
- !(SessionLegacyTrustedVampireEvidence trust)
- | LegacyGap !(SessionLegacyGapEvidence trust)
- | TrustedLegacyDeclarationRule
- !(CheckedLegacyRuleApplication ref trust)
- deriving stock (Eq)
-
-type H1LegacyFactAuthorization =
- LegacyFactAuthorization LegacyFactRef LegacyTrustDependencies
-
-legacyAuthorizationTrustDependencies
- :: H1LegacyFactAuthorization
- -> LegacyTrustDependencies
-legacyAuthorizationTrustDependencies = \case
- LegacyDeclaredAssumption reference ->
- mempty
- { legacyDeclaredAssumptionUses =
- Set.singleton reference
- }
- LegacyTrustedVampire
- (SessionLegacyTrustedVampireEvidence
- _obligation
- _proposition
- _run
- trust) ->
- trust
- LegacyGap
- (SessionLegacyGapEvidence
- _obligation
- _proposition
- _location
- _marker
- trust) ->
- trust
- TrustedLegacyDeclarationRule application ->
- checkedLegacyTrustSummary application
-
-
-data LegacyAdmittedFact ref trust = LegacyAdmittedFact
- !LegacySemanticFact
- !(LegacyFactAuthorization ref trust)
- deriving stock (Eq)
-
-type H1LegacyAdmittedFact =
- LegacyAdmittedFact LegacyFactRef LegacyTrustDependencies
-
-
--- | One established fact and its invocation-local registration sidecar.
-data LegacyFactEntry = LegacyFactEntry
- !LegacyFactRef
- !Facts.StagedFact
- !H1LegacyAdmittedFact
- deriving stock (Eq)
-
-legacyFactEntryReference :: LegacyFactEntry -> LegacyFactRef
-legacyFactEntryReference
- (LegacyFactEntry reference _staged _admitted) =
- reference
-
-legacyFactEntryStagedFact :: LegacyFactEntry -> Facts.StagedFact
-legacyFactEntryStagedFact
- (LegacyFactEntry _reference staged _admitted) =
- staged
-
-legacyFactEntryAdmittedFact
- :: LegacyFactEntry
- -> H1LegacyAdmittedFact
-legacyFactEntryAdmittedFact
- (LegacyFactEntry _reference _staged admitted) =
- admitted
-
-legacyFactEntryTrustDependencies
- :: LegacyFactEntry
- -> LegacyTrustDependencies
-legacyFactEntryTrustDependencies =
- legacyAuthorizationTrustDependencies
- . admittedAuthorization
- . legacyFactEntryAdmittedFact
- where
- admittedAuthorization
- (LegacyAdmittedFact _semantic authorization) =
- authorization
-
-
--- M3b is the only producer of a nonempty imported view.
-data LegacyImportedView = LegacyImportedView
- !(Vector LegacyModuleOrdinal)
- !(Vector LegacyFactEntry)
- !(Map Marker LegacyFactRef)
- !Facts.FactRegistry
- !(Vector LegacyModuleEnvironmentDelta)
- !LegacyCheckingEnvironment
-
-emptyLegacyImportedView
- :: LegacyCheckingEnvironment
- -> LegacyImportedView
-emptyLegacyImportedView foundation =
- LegacyImportedView
- Vector.empty
- Vector.empty
- Map.empty
- Facts.emptyFactRegistry
- Vector.empty
- foundation
-
-legacyImportedModuleOrdinals
- :: LegacyImportedView
- -> Vector LegacyModuleOrdinal
-legacyImportedModuleOrdinals
- (LegacyImportedView
- moduleOrdinals
- _facts
- _aliases
- _registry
- _environmentDeltas
- _environment) =
- moduleOrdinals
-
-legacyImportedCheckingEnvironment
- :: LegacyImportedView
- -> LegacyCheckingEnvironment
-legacyImportedCheckingEnvironment
- (LegacyImportedView
- _moduleOrdinals
- _facts
- _aliases
- _registry
- _environmentDeltas
- environment) =
- environment
-
-
--- | Private builder for one legacy module in the current invocation.
-data LegacyModuleStage = LegacyModuleStage
- !LegacyModuleOrdinal
- !ResolvedSourceAddress
- !LegacyImportedView
- !(Vector LegacyFactEntry)
- !(Map Marker LegacyFactRef)
- !Facts.FactRegistry
- !(Vector LegacyDirectAxiomManifestEntry)
-
-openLegacyModuleStage
- :: LegacyModuleAssignment
- -> LegacyImportedView
- -> LegacyModuleStage
-openLegacyModuleStage assignment imported =
- LegacyModuleStage
- (assignedLegacyModuleOrdinal assignment)
- (parsedModuleAddress
- (assignedParsedModule assignment))
- imported
- Vector.empty
- Map.empty
- importedRegistry
- Vector.empty
- where
- LegacyImportedView
- _moduleOrdinals
- _importedFacts
- _importedAliases
- importedRegistry
- _environmentDeltas
- _environment =
- imported
-
-legacyStageModuleOrdinal
- :: LegacyModuleStage
- -> LegacyModuleOrdinal
-legacyStageModuleOrdinal
- (LegacyModuleStage
- ordinal
- _address
- _imported
- _localFacts
- _localAliases
- _registry
- _manifest) =
- ordinal
-
-legacyStageSourceAddress
- :: LegacyModuleStage
- -> ResolvedSourceAddress
-legacyStageSourceAddress
- (LegacyModuleStage
- _ordinal
- address
- _imported
- _localFacts
- _localAliases
- _registry
- _manifest) =
- address
-
-legacyStageVisibleFacts
- :: LegacyModuleStage
- -> Vector LegacyFactEntry
-legacyStageVisibleFacts stage =
- importedFacts <> legacyStageLocalFacts stage
- where
- LegacyModuleStage
- _ordinal
- _address
- (LegacyImportedView
- _moduleOrdinals
- importedFacts
- _importedAliases
- _importedRegistry
- _environmentDeltas
- _environment)
- _localFacts
- _localAliases
- _stageRegistry
- _manifest =
- stage
-
-legacyStageLocalFacts
- :: LegacyModuleStage
- -> Vector LegacyFactEntry
-legacyStageLocalFacts
- (LegacyModuleStage
- _ordinal
- _address
- _imported
- localFacts
- _localAliases
- _registry
- _manifest) =
- localFacts
-
-legacyStageFactRegistry :: LegacyModuleStage -> Facts.FactRegistry
-legacyStageFactRegistry
- (LegacyModuleStage
- _ordinal
- _address
- _imported
- _localFacts
- _localAliases
- registry
- _manifest) =
- registry
-
-legacyStageDirectAxiomManifest
- :: LegacyModuleStage
- -> Vector LegacyDirectAxiomManifestEntry
-legacyStageDirectAxiomManifest
- (LegacyModuleStage
- _ordinal
- _address
- _imported
- _localFacts
- _localAliases
- _registry
- manifest) =
- manifest
-
-legacyStageImportedCheckingEnvironment
- :: LegacyModuleStage
- -> LegacyCheckingEnvironment
-legacyStageImportedCheckingEnvironment
- (LegacyModuleStage
- _ordinal
- _address
- imported
- _localFacts
- _localAliases
- _registry
- _manifest) =
- legacyImportedCheckingEnvironment imported
-
-lookupLegacyStageFact
- :: Marker
- -> LegacyModuleStage
- -> Maybe LegacyFactEntry
-lookupLegacyStageFact alias stage = do
- reference <- Map.lookup alias (visibleAliasBindings stage)
- find
- ((== reference) . legacyFactEntryReference)
- (Vector.toList (legacyStageVisibleFacts stage))
-
-
-data LegacyReservedFact = LegacyReservedFact
- !LegacyFactRef
- !Facts.StagedFact
- deriving stock (Show, Eq)
-
-legacyReservedFactReference
- :: LegacyReservedFact
- -> LegacyFactRef
-legacyReservedFactReference
- (LegacyReservedFact reference _staged) =
- reference
-
-legacyReservedStagedFact
- :: LegacyReservedFact
- -> Facts.StagedFact
-legacyReservedStagedFact
- (LegacyReservedFact _reference staged) =
- staged
-
-data LegacyDeclarationReservation = LegacyDeclarationReservation
- !LegacyModuleOrdinal
- !(NonEmpty LegacyReservedFact)
- deriving stock (Show, Eq)
-
-legacyReservedFacts
- :: LegacyDeclarationReservation
- -> NonEmpty LegacyReservedFact
-legacyReservedFacts
- (LegacyDeclarationReservation _moduleOrdinal facts) =
- facts
-
-reserveLegacyDeclaration
- :: NonEmpty Facts.StagedFact
- -> LegacyModuleStage
- -> Either LegacyModuleStageError LegacyDeclarationReservation
-reserveLegacyDeclaration stagedFacts stage
- | finalOrdinal > toInteger (maxBound :: Word32) =
- Left
- (LegacyLocalFactOrdinalSpaceExhausted
- (legacyStageModuleOrdinal stage))
- | otherwise = do
- void
- (foldM
- reserveAlias
- (visibleAliasBindings stage)
- [ ( alias
- , legacyReservedFactReference reserved
- )
- | reserved <- reservedFactsList
- , alias <-
- NonEmpty.toList
- (Facts.stagedFactAliases
- (legacyReservedStagedFact reserved))
- ])
- pure
- (LegacyDeclarationReservation
- moduleOrdinal
- reservedFacts)
- where
- moduleOrdinal =
- legacyStageModuleOrdinal stage
- firstOrdinal =
- Vector.length (legacyStageLocalFacts stage)
- stagedFactsList =
- NonEmpty.toList stagedFacts
- finalOrdinal =
- toInteger firstOrdinal
- + toInteger (length stagedFactsList)
- - 1
- reservedFacts =
- NonEmpty.zipWith
- (\ordinal staged ->
- LegacyReservedFact
- (legacyFactRef
- moduleOrdinal
- (legacyLocalFactOrdinal
- (fromIntegral ordinal)))
- staged)
- (firstOrdinal :| [firstOrdinal + 1 ..])
- stagedFacts
- reservedFactsList =
- NonEmpty.toList reservedFacts
-
- reserveAlias aliases (alias, reference) =
- case Map.lookup alias aliases of
- Nothing ->
- Right (Map.insert alias reference aliases)
- Just previous ->
- Left
- (LegacyAliasAlreadyBound
- alias
- previous
- reference)
-
-visibleAliasBindings
- :: LegacyModuleStage
- -> Map Marker LegacyFactRef
-visibleAliasBindings
- (LegacyModuleStage
- _ordinal
- _address
- (LegacyImportedView
- _moduleOrdinals
- _facts
- importedAliases
- _importedRegistry
- _environmentDeltas
- _environment)
- _localFacts
- localAliases
- _stageRegistry
- _manifest) =
- Map.union localAliases importedAliases
-
-appendEstablishedLegacyDeclaration
- :: LegacyDeclarationReservation
- -> NonEmpty H1LegacyAdmittedFact
- -> LegacyModuleStage
- -> Either LegacyModuleStageError LegacyModuleStage
-appendEstablishedLegacyDeclaration reservation admittedFacts stage = do
- expectedReservation <-
- reserveLegacyDeclaration
- (fmap legacyReservedStagedFact
- (legacyReservedFacts reservation))
- stage
- unless
- (reservation == expectedReservation)
- (Left LegacyReservationDoesNotMatchStage)
- let reserved =
- NonEmpty.toList (legacyReservedFacts reservation)
- admitted =
- NonEmpty.toList admittedFacts
- unless
- (length reserved == length admitted)
- (Left
- (LegacyEstablishedFactCountMismatch
- (length reserved)
- (length admitted)))
- entries <-
- traverse
- prepareEntry
- (zip reserved admitted)
- (manifestEntries, _nextAssumptionOrdinal) <-
- foldM
- prepareManifestEntry
- ([], fromIntegral (Vector.length manifest))
- entries
- registry' <-
- first
- LegacyFactRegistryRejectedAlias
- (Facts.registerStagedFacts
- (fmap legacyReservedStagedFact
- (legacyReservedFacts reservation))
- registry)
- let localAliases' =
- foldl'
- insertEntryAliases
- localAliases
- entries
- pure
- (LegacyModuleStage
- moduleOrdinal
- address
- imported
- (localFacts <> Vector.fromList entries)
- localAliases'
- registry'
- (manifest
- <> Vector.fromList (reverse manifestEntries)))
- where
- LegacyModuleStage
- moduleOrdinal
- address
- imported
- localFacts
- localAliases
- registry
- manifest =
- stage
-
- prepareEntry (reservedFact, admitted) =
- let reference =
- legacyReservedFactReference reservedFact
- staged =
- legacyReservedStagedFact reservedFact
- expected =
- prepareLegacyProposition
- (Facts.stagedFactSemantic staged)
- LegacyAdmittedFact semantic authorization =
- admitted
- in
- do
- unless
- (legacySemanticProposition semantic == expected)
- (Left
- (LegacyEstablishedFactStatementMismatch
- reference))
- unless
- (legacyAuthorizationTarget authorization
- == expected)
- (Left
- (LegacyEstablishedAuthorizationMismatch
- reference))
- traverse_
- (validateObligationModule moduleOrdinal)
- (legacyAuthorizationObligations authorization)
- let availableReferences =
- Set.fromList
- ( (legacyFactEntryReference
- <$> Vector.toList
- (legacyStageVisibleFacts stage))
- <> (legacyReservedFactReference
- <$> NonEmpty.toList
- (legacyReservedFacts
- reservation))
- )
- traverse_
- (\predecessor ->
- unless
- (predecessor
- `Set.member` availableReferences)
- (Left
- (LegacyAuthorizationReferencesUnknownFact
- reference
- predecessor)))
- (legacyAuthorizationFactPredecessors
- authorization)
- pure
- (LegacyFactEntry
- reference
- staged
- admitted)
-
- prepareManifestEntry
- (entries, nextOrdinal)
- (LegacyFactEntry
- reference
- _staged
- (LegacyAdmittedFact
- semantic
- authorization)) =
- case authorization of
- LegacyDeclaredAssumption
- (SessionLegacyDeclaredAssumptionRef
- authorizedReference
- assumptionOrdinal
- kind
- proposition)
- | authorizedReference == reference
- && legacyLocalAssumptionOrdinalValue
- assumptionOrdinal
- == nextOrdinal
- && proposition
- == legacySemanticProposition semantic ->
- Right
- ( LegacyDirectAxiomManifestEntry
- reference
- kind
- proposition
- : entries
- , nextOrdinal + 1
- )
- | otherwise ->
- Left
- (LegacyDeclaredAssumptionDoesNotMatch
- reference)
- _ ->
- Right (entries, nextOrdinal)
-
- insertEntryAliases aliases entry =
- foldl'
- (\current alias ->
- Map.insert
- alias
- (legacyFactEntryReference entry)
- current)
- aliases
- (NonEmpty.toList
- (Facts.stagedFactAliases
- (legacyFactEntryStagedFact entry)))
-
-
-authorizeLegacyDeclaredAssumption
- :: LegacyModuleStage
- -> AssumptionKind
- -> LegacyReservedFact
- -> H1LegacyAdmittedFact
-authorizeLegacyDeclaredAssumption stage kind reserved =
- LegacyAdmittedFact
- semantic
- (LegacyDeclaredAssumption
- (SessionLegacyDeclaredAssumptionRef
- reference
- assumptionOrdinal
- kind
- proposition))
- where
- reference =
- legacyReservedFactReference reserved
- proposition =
- reservedProposition reserved
- semantic =
- legacySemanticFact proposition
- assumptionOrdinal =
- legacyLocalAssumptionOrdinal
- (fromIntegral
- (Vector.length
- (legacyStageDirectAxiomManifest stage)))
-
-authorizeLegacyTrustedVampire
- :: SessionLegacyObligationRef
- -> AcceptedVampireRun
- -> LegacyTrustDependencies
- -> LegacyReservedFact
- -> H1LegacyAdmittedFact
-authorizeLegacyTrustedVampire
- obligation
- accepted
- predecessorTrust
- reserved =
- LegacyAdmittedFact
- semantic
- (LegacyTrustedVampire
- (SessionLegacyTrustedVampireEvidence
- obligation
- proposition
- accepted
- trust))
- where
- proposition =
- reservedProposition reserved
- semantic =
- legacySemanticFact proposition
- trust =
- legacyTrustedVampireTrust
- obligation
- predecessorTrust
-
-authorizeLegacyGap
- :: SessionLegacyObligationRef
- -> Location
- -> Marker
- -> LegacyTrustDependencies
- -> LegacyReservedFact
- -> H1LegacyAdmittedFact
-authorizeLegacyGap
- obligation
- location
- marker
- predecessorTrust
- reserved =
- LegacyAdmittedFact
- semantic
- (LegacyGap
- (SessionLegacyGapEvidence
- obligation
- proposition
- location
- marker
- trust))
- where
- proposition =
- reservedProposition reserved
- semantic =
- legacySemanticFact proposition
- trust =
- legacyGapTrust
- obligation
- location
- marker
- predecessorTrust
-
-authorizeLegacyRule
- :: LegacyRuleTag
- -> Vector (LegacyRulePredecessor LegacyFactRef)
- -> LegacyTrustDependencies
- -> LegacyReservedFact
- -> H1LegacyAdmittedFact
-authorizeLegacyRule tag predecessors predecessorTrust reserved =
- LegacyAdmittedFact
- semantic
- (TrustedLegacyDeclarationRule
- CheckedLegacyRuleApplication
- { checkedLegacyRuleTag = tag
- , checkedLegacyRuleTarget = proposition
- , checkedLegacyPredecessors = predecessors
- , checkedLegacyTrustSummary = trust
- })
- where
- reference =
- legacyReservedFactReference reserved
- proposition =
- reservedProposition reserved
- semantic =
- legacySemanticFact proposition
- trust =
- predecessorTrust
- <> mempty
- { trustedLegacyRuleUses =
- Set.singleton
- (SessionLegacyRuleUse reference tag)
- }
-
-reservedProposition
- :: LegacyReservedFact
- -> LegacyPreparedProposition
-reservedProposition =
- prepareLegacyProposition
- . Facts.stagedFactSemantic
- . legacyReservedStagedFact
-
-legacyAuthorizationTarget
- :: H1LegacyFactAuthorization
- -> LegacyPreparedProposition
-legacyAuthorizationTarget = \case
- LegacyDeclaredAssumption
- (SessionLegacyDeclaredAssumptionRef
- _reference
- _ordinal
- _kind
- proposition) ->
- proposition
- LegacyTrustedVampire
- (SessionLegacyTrustedVampireEvidence
- _obligation
- proposition
- _run
- _trust) ->
- proposition
- LegacyGap
- (SessionLegacyGapEvidence
- _obligation
- proposition
- _location
- _marker
- _trust) ->
- proposition
- TrustedLegacyDeclarationRule application ->
- checkedLegacyRuleTarget application
-
-legacyAuthorizationObligations
- :: H1LegacyFactAuthorization
- -> [SessionLegacyObligationRef]
-legacyAuthorizationObligations = \case
- LegacyDeclaredAssumption{} ->
- []
- LegacyTrustedVampire
- (SessionLegacyTrustedVampireEvidence
- obligation
- _proposition
- _run
- _trust) ->
- [obligation]
- LegacyGap
- (SessionLegacyGapEvidence
- obligation
- _proposition
- _location
- _marker
- _trust) ->
- [obligation]
- TrustedLegacyDeclarationRule application ->
- [ obligation
- | LegacyRuleObligationPredecessor obligation <-
- Vector.toList
- (checkedLegacyPredecessors application)
- ]
-
-legacyAuthorizationFactPredecessors
- :: H1LegacyFactAuthorization
- -> [LegacyFactRef]
-legacyAuthorizationFactPredecessors = \case
- TrustedLegacyDeclarationRule application ->
- [ reference
- | LegacyRuleFactPredecessor reference <-
- Vector.toList
- (checkedLegacyPredecessors application)
- ]
- _ ->
- []
-
-validateObligationModule
- :: LegacyModuleOrdinal
- -> SessionLegacyObligationRef
- -> Either LegacyModuleStageError ()
-validateObligationModule
- expected
- (SessionLegacyObligationRef actual _marker _ordinal) =
- unless
- (actual == expected)
- (Left
- (LegacyAuthorizationReferencesAnotherModule
- expected
- actual))
-
-
--- | Completed H1 module. Only 'sealLegacyModuleStage' constructs this value.
-data LegacyAdmittedModule = LegacyAdmittedModule
- { legacyAdmittedModuleOrdinal :: !LegacyModuleOrdinal
- , legacyAdmittedSourceAddress :: !ResolvedSourceAddress
- , legacyAdmittedDirectImports :: !(Vector LegacyModuleOrdinal)
- , legacyAdmittedVisibleFacts :: !(Vector LegacyFactEntry)
- , legacyAdmittedLocalFacts :: !(Vector LegacyFactEntry)
- , legacyAdmittedAliasBindings :: !(Map Marker LegacyFactRef)
- , legacyAdmittedFactRegistry :: !Facts.FactRegistry
- , legacyAdmittedDirectAxiomManifest
- :: !(Vector LegacyDirectAxiomManifestEntry)
- , legacyAdmittedTrustDependencies :: !LegacyTrustDependencies
- , legacyAdmittedEnvironmentDeltas
- :: !(Vector LegacyModuleEnvironmentDelta)
- , legacyAdmittedCheckingEnvironment
- :: !LegacyCheckingEnvironment
- }
-
-sealLegacyModuleStage
- :: LegacyCheckingEnvironment
- -> LegacyModuleStage
- -> Either LegacyModuleStageError LegacyAdmittedModule
-sealLegacyModuleStage finalEnvironment stage = do
- unless
- (actualReferences == expectedReferences)
- (Left LegacyStageLocalFactOrderMismatch)
- expectedVisibleAliases <-
- aliasesForEntries
- importedAliases
- (Vector.toList localFacts)
- unless
- (Map.union localAliases importedAliases
- == expectedVisibleAliases)
- (Left LegacyStageAliasMapMismatch)
- expectedManifest <-
- manifestForEntries localFacts
- unless
- (manifest == expectedManifest)
- (Left LegacyStageDirectAxiomManifestMismatch)
- validateStageRegistry visibleFacts registry
- localEnvironmentDelta <-
- first
- LegacyStageEnvironmentMismatch
- (legacyCheckingEnvironmentExtension
- importedEnvironment
- finalEnvironment)
- let moduleEnvironmentDelta =
- LegacyModuleEnvironmentDelta
- moduleOrdinal
- address
- localEnvironmentDelta
- pure
- LegacyAdmittedModule
- { legacyAdmittedModuleOrdinal = moduleOrdinal
- , legacyAdmittedSourceAddress = address
- , legacyAdmittedDirectImports =
- legacyImportedModuleOrdinals imported
- , legacyAdmittedVisibleFacts = visibleFacts
- , legacyAdmittedLocalFacts = localFacts
- , legacyAdmittedAliasBindings =
- Map.union localAliases importedAliases
- , legacyAdmittedFactRegistry = registry
- , legacyAdmittedDirectAxiomManifest = manifest
- , legacyAdmittedTrustDependencies =
- foldMap
- legacyFactEntryTrustDependencies
- visibleFacts
- , legacyAdmittedEnvironmentDeltas =
- Vector.snoc
- importedEnvironmentDeltas
- moduleEnvironmentDelta
- , legacyAdmittedCheckingEnvironment =
- finalEnvironment
- }
- where
- LegacyModuleStage
- moduleOrdinal
- address
- imported@(LegacyImportedView
- _directImports
- importedFacts
- importedAliases
- _importedRegistry
- importedEnvironmentDeltas
- importedEnvironment)
- localFacts
- localAliases
- registry
- manifest =
- stage
- visibleFacts =
- importedFacts <> localFacts
- actualReferences =
- legacyFactEntryReference <$> Vector.toList localFacts
- expectedReferences =
- [ legacyFactRef
- moduleOrdinal
- (legacyLocalFactOrdinal
- (fromIntegral ordinal))
- | ordinal <- [0 .. Vector.length localFacts - 1]
- ]
-
-legacyImportedView
- :: LegacyCheckingEnvironment
- -> [LegacyAdmittedModule]
- -> Either LegacyModuleStageError LegacyImportedView
-legacyImportedView foundation admittedModules = do
- imported <-
- foldM
- importModule
- emptyImportedViewBuild
- admittedModules
- registry <-
- registryForEntries
- (reverse (importedFactsReversed imported))
- (environmentDeltas, environment) <-
- mergeModuleEnvironments foundation admittedModules
- pure
- (LegacyImportedView
- (Vector.fromList
- (legacyAdmittedModuleOrdinal <$> admittedModules))
- (Vector.fromList
- (reverse (importedFactsReversed imported)))
- (fst <$> importedAliasBindings imported)
- registry
- environmentDeltas
- environment)
- where
- importModule imported admitted =
- foldM
- importEntry
- imported
- (Vector.toList
- (legacyAdmittedVisibleFacts admitted))
-
-data ImportedViewBuild = ImportedViewBuild
- !(Map LegacyFactRef LegacyFactEntry)
- ![LegacyFactEntry]
- !(Map Marker (LegacyFactRef, Facts.FactOrigin))
-
-emptyImportedViewBuild :: ImportedViewBuild
-emptyImportedViewBuild =
- ImportedViewBuild Map.empty [] Map.empty
-
-importedFactsReversed :: ImportedViewBuild -> [LegacyFactEntry]
-importedFactsReversed
- (ImportedViewBuild _entriesByReference entries _aliases) =
- entries
-
-importedAliasBindings
- :: ImportedViewBuild
- -> Map Marker (LegacyFactRef, Facts.FactOrigin)
-importedAliasBindings
- (ImportedViewBuild _entriesByReference _entries aliases) =
- aliases
-
-data LegacyModuleEnvironmentDelta = LegacyModuleEnvironmentDelta
- !LegacyModuleOrdinal
- !ResolvedSourceAddress
- !LegacyCheckingEnvironmentDelta
- deriving stock (Show, Eq)
-
-data ImportedEnvironmentBuild = ImportedEnvironmentBuild
- !(Map LegacyModuleOrdinal LegacyModuleEnvironmentDelta)
- ![LegacyModuleEnvironmentDelta]
-
-mergeModuleEnvironments
- :: LegacyCheckingEnvironment
- -> [LegacyAdmittedModule]
- -> Either
- LegacyModuleStageError
- ( Vector LegacyModuleEnvironmentDelta
- , LegacyCheckingEnvironment
- )
-mergeModuleEnvironments foundation admittedModules = do
- imported <-
- foldM
- importModuleEnvironment
- (ImportedEnvironmentBuild Map.empty [])
- admittedModules
- let ImportedEnvironmentBuild _byOrdinal reversedDeltas =
- imported
- deltas =
- reverse reversedDeltas
- environment <-
- foldM
- applyModuleEnvironmentDelta
- foundation
- deltas
- pure (Vector.fromList deltas, environment)
- where
- importModuleEnvironment imported admitted =
- foldM
- importEnvironmentDelta
- imported
- (Vector.toList
- (legacyAdmittedEnvironmentDeltas admitted))
-
- importEnvironmentDelta
- imported@(ImportedEnvironmentBuild
- byOrdinal
- reversedDeltas)
- delta@(LegacyModuleEnvironmentDelta
- ordinal
- _address
- _environmentDelta) =
- case Map.lookup ordinal byOrdinal of
- Nothing ->
- Right
- (ImportedEnvironmentBuild
- (Map.insert ordinal delta byOrdinal)
- (delta : reversedDeltas))
- Just previous
- | previous == delta ->
- Right imported
- | otherwise ->
- Left
- (LegacyImportedModuleEnvironmentConflict
- ordinal)
-
- applyModuleEnvironmentDelta
- environment
- (LegacyModuleEnvironmentDelta
- _ordinal
- address
- delta) =
- first
- (LegacyImportedEnvironmentConflict address)
- (applyLegacyCheckingEnvironmentDelta
- delta
- environment)
-
-importEntry
- :: ImportedViewBuild
- -> LegacyFactEntry
- -> Either LegacyModuleStageError ImportedViewBuild
-importEntry imported entry =
- case Map.lookup reference entriesByReference of
- Just previous
- | previous == entry ->
- Right imported
- | otherwise ->
- Left
- (LegacyImportedFactReferenceConflict
- reference)
- Nothing -> do
- aliases' <-
- foldM
- insertImportedAlias
- aliases
- (NonEmpty.toList
- (Facts.stagedFactAliases staged))
- pure
- (ImportedViewBuild
- (Map.insert
- reference
- entry
- entriesByReference)
- (entry : entries)
- aliases')
- where
- ImportedViewBuild
- entriesByReference
- entries
- aliases =
- imported
- reference =
- legacyFactEntryReference entry
- staged =
- legacyFactEntryStagedFact entry
- origin =
- Facts.stagedFactOrigin staged
-
- insertImportedAlias current alias =
- case Map.lookup alias current of
- Nothing ->
- Right
- (Map.insert
- alias
- (reference, origin)
- current)
- Just (previousReference, previousOrigin)
- | previousReference == reference ->
- Right current
- | otherwise ->
- Left
- (LegacyImportedAliasConflict
- alias
- previousReference
- previousOrigin
- reference
- origin)
-
-aliasesForEntries
- :: Map Marker LegacyFactRef
- -> [LegacyFactEntry]
- -> Either LegacyModuleStageError (Map Marker LegacyFactRef)
-aliasesForEntries =
- foldM insertEntry
- where
- insertEntry aliases entry =
- foldM
- (insertAlias
- (legacyFactEntryReference entry))
- aliases
- (NonEmpty.toList
- (Facts.stagedFactAliases
- (legacyFactEntryStagedFact entry)))
-
- insertAlias reference aliases alias =
- case Map.lookup alias aliases of
- Nothing ->
- Right (Map.insert alias reference aliases)
- Just previous
- | previous == reference ->
- Right aliases
- | otherwise ->
- Left
- (LegacyAliasAlreadyBound
- alias
- previous
- reference)
-
-manifestForEntries
- :: Vector LegacyFactEntry
- -> Either
- LegacyModuleStageError
- (Vector LegacyDirectAxiomManifestEntry)
-manifestForEntries entries =
- Vector.fromList . reverse . fst
- <$> foldM
- step
- ([], 0)
- (Vector.toList entries)
- where
- step (manifest, nextOrdinal) entry =
- case legacyFactEntryAdmittedFact entry of
- LegacyAdmittedFact
- semantic
- (LegacyDeclaredAssumption
- (SessionLegacyDeclaredAssumptionRef
- authorizedReference
- assumptionOrdinal
- kind
- proposition))
- | authorizedReference == reference
- && legacyLocalAssumptionOrdinalValue
- assumptionOrdinal
- == nextOrdinal
- && proposition
- == legacySemanticProposition semantic ->
- Right
- ( LegacyDirectAxiomManifestEntry
- reference
- kind
- proposition
- : manifest
- , nextOrdinal + 1
- )
- | otherwise ->
- Left
- LegacyStageDirectAxiomManifestMismatch
- _ ->
- Right (manifest, nextOrdinal)
- where
- reference =
- legacyFactEntryReference entry
-
-validateStageRegistry
- :: Vector LegacyFactEntry
- -> Facts.FactRegistry
- -> Either LegacyModuleStageError ()
-validateStageRegistry entries registry = do
- unless
- (Facts.factRegistryInvariant registry)
- (Left LegacyStageFactRegistryMismatch)
- unless
- (length (Facts.registeredFacts registry)
- == Vector.length entries)
- (Left LegacyStageFactRegistryMismatch)
- traverse_ validateEntry entries
- where
- validateEntry entry =
- traverse_
- (validateAlias
- (legacyFactEntryStagedFact entry))
- (Facts.stagedFactAliases
- (legacyFactEntryStagedFact entry))
-
- validateAlias staged alias = do
- unless
- (Facts.lookupPreparedFact alias registry
- == Just (Facts.stagedFactSemantic staged))
- (Left LegacyStageFactRegistryMismatch)
- unless
- (Facts.lookupFactOrigin alias registry
- == Just (Facts.stagedFactOrigin staged))
- (Left LegacyStageFactRegistryMismatch)
-
-registryForEntries
- :: [LegacyFactEntry]
- -> Either LegacyModuleStageError Facts.FactRegistry
-registryForEntries = \case
- [] ->
- Right Facts.emptyFactRegistry
- firstEntry : remainingEntries ->
- first
- LegacyFactRegistryRejectedAlias
- (Facts.registerStagedFacts
- ( legacyFactEntryStagedFact firstEntry
- :| (legacyFactEntryStagedFact
- <$> remainingEntries)
- )
- Facts.emptyFactRegistry)
-
-
-data LegacyModuleStageError
- = LegacyModuleOrdinalSpaceExhausted !Natural
- | LegacyLocalFactOrdinalSpaceExhausted !LegacyModuleOrdinal
- | LegacyAliasAlreadyBound
- !Marker
- !LegacyFactRef
- !LegacyFactRef
- | LegacyReservationDoesNotMatchStage
- | LegacyEstablishedFactCountMismatch !Int !Int
- | LegacyEstablishedFactStatementMismatch !LegacyFactRef
- | LegacyEstablishedAuthorizationMismatch !LegacyFactRef
- | LegacyAuthorizationReferencesUnknownFact
- !LegacyFactRef
- !LegacyFactRef
- | LegacyAuthorizationReferencesAnotherModule
- !LegacyModuleOrdinal
- !LegacyModuleOrdinal
- | LegacyDeclaredAssumptionDoesNotMatch !LegacyFactRef
- | LegacyFactRegistryRejectedAlias !Marker
- | LegacyImportedFactReferenceConflict !LegacyFactRef
- | LegacyImportedAliasConflict
- !Marker
- !LegacyFactRef
- !Facts.FactOrigin
- !LegacyFactRef
- !Facts.FactOrigin
- | LegacyStageLocalFactOrderMismatch
- | LegacyStageAliasMapMismatch
- | LegacyStageFactRegistryMismatch
- | LegacyStageDirectAxiomManifestMismatch
- | LegacyStageEnvironmentMismatch !Text
- | LegacyImportedModuleEnvironmentConflict
- !LegacyModuleOrdinal
- | LegacyImportedEnvironmentConflict
- !ResolvedSourceAddress
- !Text
- deriving stock (Show, Eq)
diff --git a/source/Checking/Legacy/Environment.hs b/source/Checking/Legacy/Environment.hs
deleted file mode 100644
index 7b94d53..0000000
--- a/source/Checking/Legacy/Environment.hs
+++ /dev/null
@@ -1,279 +0,0 @@
-{-# LANGUAGE DerivingStrategies #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-
--- | Immutable legacy declaration environment carried by admitted modules.
-module Checking.Legacy.Environment
- ( SymbolOwnerKind(..)
- , SymbolOwner(..)
- , LegacyCheckingEnvironment
- , legacyCheckingEnvironment
- , legacyEnvironmentAbbreviations
- , legacyEnvironmentPredicateDefinitions
- , legacyEnvironmentDependencies
- , legacyEnvironmentOwnedSymbols
- , legacyEnvironmentOwnedSymbolMarkers
- , legacyEnvironmentFrozenSymbols
- , legacyEnvironmentStructs
- , legacyEnvironmentDefinedMarkers
- , LegacyCheckingEnvironmentDelta
- , legacyCheckingEnvironmentExtension
- , applyLegacyCheckingEnvironmentDelta
- ) where
-
-import Base
-import Checking.Dependencies qualified as Dependencies
-import StructGraph qualified
-import Syntax.Internal
-
-import Bound.Scope (Scope)
-import Data.HashMap.Strict qualified as HashMap
-import Data.HashSet qualified as HashSet
-
-
-data SymbolOwnerKind
- = OwnedByBuiltin
- | OwnedBySignaturePredicate
- | OwnedBySignatureFormula
- | OwnedByAbbreviation
- | OwnedByPredicateDefinition
- | OwnedByFunctionDefinition
- | OwnedByOperatorDefinition
- | OwnedByDatatypeHead
- | OwnedByDatatypeConstructor
- | OwnedByInductiveDefinition
- | OwnedByStructureDefinition
- deriving stock (Show, Eq)
-
-data SymbolOwner = SymbolOwner
- { symbolOwnerKind :: !SymbolOwnerKind
- , symbolOwnerMarker :: !Marker
- }
- deriving stock (Show, Eq)
-
-
-data LegacyCheckingEnvironment = LegacyCheckingEnvironment
- { legacyEnvironmentAbbreviations
- :: !(HashMap Symbol (Scope Int ExprOf Void))
- , legacyEnvironmentPredicateDefinitions
- :: !(HashMap Predicate [Scope Int ExprOf Void])
- , legacyEnvironmentDependencies
- :: !Dependencies.DependencyRegistry
- , legacyEnvironmentOwnedSymbols
- :: !(HashMap Symbol SymbolOwner)
- , legacyEnvironmentOwnedSymbolMarkers
- :: !(HashSet Marker)
- , legacyEnvironmentFrozenSymbols
- :: !(HashMap Symbol Marker)
- , legacyEnvironmentStructs
- :: !StructGraph.StructGraph
- , legacyEnvironmentDefinedMarkers
- :: !(HashSet Marker)
- }
- deriving stock (Show, Eq)
-
-legacyCheckingEnvironment
- :: HashMap Symbol (Scope Int ExprOf Void)
- -> HashMap Predicate [Scope Int ExprOf Void]
- -> Dependencies.DependencyRegistry
- -> HashMap Symbol SymbolOwner
- -> HashSet Marker
- -> HashMap Symbol Marker
- -> StructGraph.StructGraph
- -> HashSet Marker
- -> LegacyCheckingEnvironment
-legacyCheckingEnvironment =
- LegacyCheckingEnvironment
-
-
-data LegacyCheckingEnvironmentDelta =
- LegacyCheckingEnvironmentDelta
- !(HashMap Symbol (Scope Int ExprOf Void))
- !(HashMap Predicate [Scope Int ExprOf Void])
- !Dependencies.DependencyRegistryDelta
- !(HashMap Symbol SymbolOwner)
- !(HashSet Marker)
- !(HashMap Symbol Marker)
- !StructGraph.StructGraphDelta
- !(HashSet Marker)
- deriving stock (Show, Eq)
-
-legacyCheckingEnvironmentExtension
- :: LegacyCheckingEnvironment
- -> LegacyCheckingEnvironment
- -> Either Text LegacyCheckingEnvironmentDelta
-legacyCheckingEnvironmentExtension previous current = do
- abbreviations <-
- hashMapExtension
- "abbreviation"
- (legacyEnvironmentAbbreviations previous)
- (legacyEnvironmentAbbreviations current)
- predicateDefinitions <-
- hashMapExtension
- "predicate definition"
- (legacyEnvironmentPredicateDefinitions previous)
- (legacyEnvironmentPredicateDefinitions current)
- dependencies <-
- Dependencies.dependencyRegistryExtension
- (legacyEnvironmentDependencies previous)
- (legacyEnvironmentDependencies current)
- ownedSymbols <-
- hashMapExtension
- "symbol owner"
- (legacyEnvironmentOwnedSymbols previous)
- (legacyEnvironmentOwnedSymbols current)
- ownedMarkers <-
- hashSetExtension
- "owned symbol marker"
- (legacyEnvironmentOwnedSymbolMarkers previous)
- (legacyEnvironmentOwnedSymbolMarkers current)
- frozenSymbols <-
- hashMapExtension
- "frozen symbol"
- (legacyEnvironmentFrozenSymbols previous)
- (legacyEnvironmentFrozenSymbols current)
- structures <-
- StructGraph.structGraphExtension
- (legacyEnvironmentStructs previous)
- (legacyEnvironmentStructs current)
- definedMarkers <-
- hashSetExtension
- "defined marker"
- (legacyEnvironmentDefinedMarkers previous)
- (legacyEnvironmentDefinedMarkers current)
- pure
- (LegacyCheckingEnvironmentDelta
- abbreviations
- predicateDefinitions
- dependencies
- ownedSymbols
- ownedMarkers
- frozenSymbols
- structures
- definedMarkers)
-
-applyLegacyCheckingEnvironmentDelta
- :: LegacyCheckingEnvironmentDelta
- -> LegacyCheckingEnvironment
- -> Either Text LegacyCheckingEnvironment
-applyLegacyCheckingEnvironmentDelta
- (LegacyCheckingEnvironmentDelta
- abbreviations
- predicateDefinitions
- dependencies
- ownedSymbols
- ownedMarkers
- frozenSymbols
- structures
- definedMarkers)
- environment = do
- abbreviations' <-
- disjointHashMapUnion
- "abbreviation"
- (legacyEnvironmentAbbreviations environment)
- abbreviations
- predicateDefinitions' <-
- disjointHashMapUnion
- "predicate definition"
- (legacyEnvironmentPredicateDefinitions environment)
- predicateDefinitions
- dependencies' <-
- Dependencies.applyDependencyRegistryDelta
- dependencies
- (legacyEnvironmentDependencies environment)
- ownedSymbols' <-
- disjointHashMapUnion
- "symbol owner"
- (legacyEnvironmentOwnedSymbols environment)
- ownedSymbols
- ownedMarkers' <-
- disjointHashSetUnion
- "owned symbol marker"
- (legacyEnvironmentOwnedSymbolMarkers environment)
- ownedMarkers
- structures' <-
- StructGraph.applyStructGraphDelta
- structures
- (legacyEnvironmentStructs environment)
- definedMarkers' <-
- disjointHashSetUnion
- "defined marker"
- (legacyEnvironmentDefinedMarkers environment)
- definedMarkers
- pure
- LegacyCheckingEnvironment
- { legacyEnvironmentAbbreviations = abbreviations'
- , legacyEnvironmentPredicateDefinitions =
- predicateDefinitions'
- , legacyEnvironmentDependencies = dependencies'
- , legacyEnvironmentOwnedSymbols = ownedSymbols'
- , legacyEnvironmentOwnedSymbolMarkers = ownedMarkers'
- , legacyEnvironmentFrozenSymbols =
- HashMap.union
- (legacyEnvironmentFrozenSymbols environment)
- frozenSymbols
- , legacyEnvironmentStructs = structures'
- , legacyEnvironmentDefinedMarkers = definedMarkers'
- }
-
-hashMapExtension
- :: (Hashable key, Eq value)
- => Text
- -> HashMap key value
- -> HashMap key value
- -> Either Text (HashMap key value)
-hashMapExtension label previous current
- | all
- (\(key, value) ->
- HashMap.lookup key current == Just value)
- (HashMap.toList previous) =
- Right (HashMap.difference current previous)
- | otherwise =
- Left
- ("legacy environment changed an imported "
- <> label)
-
-hashSetExtension
- :: Hashable value
- => Text
- -> HashSet value
- -> HashSet value
- -> Either Text (HashSet value)
-hashSetExtension label previous current
- | previous `HashSet.isSubsetOf` current =
- Right (current `HashSet.difference` previous)
- | otherwise =
- Left
- ("legacy environment removed an imported "
- <> label)
-
-disjointHashMapUnion
- :: Hashable key
- => Text
- -> HashMap key value
- -> HashMap key value
- -> Either Text (HashMap key value)
-disjointHashMapUnion label previous additions
- | HashSet.null duplicateKeys =
- Right (HashMap.union previous additions)
- | otherwise =
- Left
- ("imported modules define the same "
- <> label)
- where
- duplicateKeys =
- HashMap.keysSet previous
- `HashSet.intersection` HashMap.keysSet additions
-
-disjointHashSetUnion
- :: Hashable value
- => Text
- -> HashSet value
- -> HashSet value
- -> Either Text (HashSet value)
-disjointHashSetUnion label previous additions
- | HashSet.null (previous `HashSet.intersection` additions) =
- Right (previous <> additions)
- | otherwise =
- Left
- ("imported modules define the same "
- <> label)
diff --git a/source/Checking/Module.hs b/source/Checking/Module.hs
index ad2fb27..bb35277 100644
--- a/source/Checking/Module.hs
+++ b/source/Checking/Module.hs
@@ -10,6 +10,11 @@ module Checking.Module
, identifiedModuleOwner
, identifiedModuleBinding
, identifiedModuleParsed
+ , TypedSourceDeclaration
+ , typedSourceDeclarationBlockIndex
+ , typedSourceDeclarationHead
+ , typedSourceDeclarationProof
+ , typedSourceDeclarations
, SealedTypedModule
, sealedTypedModuleOwner
, sealedTypedModuleSyntax
@@ -19,9 +24,12 @@ module Checking.Module
, renderCachedTypedModuleError
, cachedSealedTypedModule
, sealedTypedModulePrefix
- , MigrationPreludeSession
- , migrationPreludeInput
- , migrationPreludeModule
+ , FinalPreludeSession
+ , ModuleRootAcquisition(..)
+ , finalPreludeSource
+ , finalPreludeInput
+ , finalPreludeModule
+ , finalPreludeAcquisition
, FinalPreludeReadiness
, finalPreludeReadiness
, BootstrapPreludeFixture
@@ -32,7 +40,7 @@ module Checking.Module
, BootstrapError(..)
, buildBootstrapPreludeFixture
, FinalPreludeReadinessError(..)
- , buildFinalPreludeSession
+ , acquireFinalPreludeSession
, TypedModuleInput
, TypedModuleInputError(..)
, renderTypedModuleInputError
@@ -118,6 +126,75 @@ identifiedModuleParsed
parsed
+-- | One source declaration as consumed by the typed module driver.
+--
+-- A claim and its immediately following proof occupy one declaration slot.
+-- The head block index remains the syntax-occurrence association index.
+data TypedSourceDeclaration = TypedSourceDeclaration
+ !Int
+ !Raw.Block
+ !(Maybe Raw.Proof)
+
+typedSourceDeclarationBlockIndex :: TypedSourceDeclaration -> Int
+typedSourceDeclarationBlockIndex
+ (TypedSourceDeclaration blockIndex _head _proof) =
+ blockIndex
+
+typedSourceDeclarationHead :: TypedSourceDeclaration -> Raw.Block
+typedSourceDeclarationHead
+ (TypedSourceDeclaration _blockIndex headBlock _proof) =
+ headBlock
+
+typedSourceDeclarationProof
+ :: TypedSourceDeclaration
+ -> Maybe Raw.Proof
+typedSourceDeclarationProof
+ (TypedSourceDeclaration _blockIndex _head proof) =
+ proof
+
+typedSourceDeclarations
+ :: IdentifiedParsedModule
+ -> [TypedSourceDeclaration]
+typedSourceDeclarations parsed =
+ [ declaration
+ | item <- typedSourceItems (identifiedParsedModuleBlocks parsed)
+ , Just declaration <- [sourceItemDeclaration item]
+ ]
+
+data TypedSourceItem
+ = TypedSourceDeclarationItem !TypedSourceDeclaration
+ | TypedUnmatchedSourceProof !Location
+
+sourceItemDeclaration
+ :: TypedSourceItem
+ -> Maybe TypedSourceDeclaration
+sourceItemDeclaration = \case
+ TypedSourceDeclarationItem declaration -> Just declaration
+ TypedUnmatchedSourceProof{} -> Nothing
+
+typedSourceItems :: [Raw.Block] -> [TypedSourceItem]
+typedSourceItems = go 0
+ where
+ go _blockIndex [] = []
+ go blockIndex (block@Raw.BlockClaim{} : remaining) =
+ case remaining of
+ Raw.BlockProof _location proof _end : rest ->
+ TypedSourceDeclarationItem
+ (TypedSourceDeclaration blockIndex block (Just proof))
+ : go (blockIndex + 2) rest
+ _ ->
+ TypedSourceDeclarationItem
+ (TypedSourceDeclaration blockIndex block Nothing)
+ : go (blockIndex + 1) remaining
+ go blockIndex (Raw.BlockProof location _proof _end : remaining) =
+ TypedUnmatchedSourceProof location
+ : go (blockIndex + 1) remaining
+ go blockIndex (block : remaining) =
+ TypedSourceDeclarationItem
+ (TypedSourceDeclaration blockIndex block Nothing)
+ : go (blockIndex + 1) remaining
+
+
data SealedTypedModule = SealedTypedModule
!ModuleName
!ModuleSyntaxInterface
@@ -197,55 +274,79 @@ cachedSealedTypedModule
propositions = Store.cachedInstallationPropositions installation
-data MigrationPreludeSession = MigrationPreludeSession
+data ModuleRootAcquisition
+ = ModuleRootHit
+ | ModuleRootMiss
+ deriving stock (Show, Eq)
+
+data FinalPreludeSession = FinalPreludeSession
+ !Prelude.ReservedPreludeSourceInput
!IdentifiedModuleInput
!SealedTypedModule
+ !ModuleRootAcquisition
+
+finalPreludeSource
+ :: FinalPreludeSession
+ -> Prelude.ReservedPreludeSourceInput
+finalPreludeSource
+ (FinalPreludeSession source _input _module _acquisition) =
+ source
-migrationPreludeInput
- :: MigrationPreludeSession
+finalPreludeInput
+ :: FinalPreludeSession
-> IdentifiedModuleInput
-migrationPreludeInput (MigrationPreludeSession input _module) =
+finalPreludeInput (FinalPreludeSession _source input _module _acquisition) =
input
-migrationPreludeModule
- :: MigrationPreludeSession
+finalPreludeModule
+ :: FinalPreludeSession
-> SealedTypedModule
-migrationPreludeModule (MigrationPreludeSession _input sealed) =
+finalPreludeModule (FinalPreludeSession _source _input sealed _acquisition) =
sealed
+finalPreludeAcquisition
+ :: FinalPreludeSession
+ -> ModuleRootAcquisition
+finalPreludeAcquisition
+ (FinalPreludeSession _source _input _sealed acquisition) =
+ acquisition
+
newtype FinalPreludeReadiness = FinalPreludeReadiness
SealedTypedModule
finalPreludeReadiness
- :: MigrationPreludeSession
+ :: FinalPreludeSession
-> FinalPreludeReadiness
finalPreludeReadiness =
- FinalPreludeReadiness . migrationPreludeModule
+ FinalPreludeReadiness . finalPreludeModule
+-- | Test-only empty-prelude fixture.
+--
+-- It is exported for focused exact-compiler tests. Production acquisition is
+-- exclusively 'acquireFinalPreludeSession'.
newtype BootstrapPreludeFixture = BootstrapPreludeFixture
- MigrationPreludeSession
+ FinalPreludeSession
bootstrapPreludeInput
:: BootstrapPreludeFixture
-> IdentifiedModuleInput
bootstrapPreludeInput (BootstrapPreludeFixture fixture) =
- migrationPreludeInput fixture
+ finalPreludeInput fixture
bootstrapPreludeModule
:: BootstrapPreludeFixture
-> SealedTypedModule
bootstrapPreludeModule (BootstrapPreludeFixture fixture) =
- migrationPreludeModule fixture
+ finalPreludeModule fixture
--- | Fixture seam for the empty bootstrap compiler input.
+-- | Test-only seam for the empty bootstrap compiler input.
bootstrapPreludeReadiness
:: BootstrapPreludeFixture
-> FinalPreludeReadiness
bootstrapPreludeReadiness =
FinalPreludeReadiness . bootstrapPreludeModule
--- | Fixture seam for exercising a nonempty distinguished prelude before the
--- final source prelude is constructed.
+-- | Test-only seam for exercising a synthetic distinguished prelude.
fixtureFinalPreludeReadinessFromSealed
:: SealedTypedModule
-> FinalPreludeReadiness
@@ -259,7 +360,7 @@ data BootstrapError
| BootstrapSealFailed !SemanticInterfaceError
deriving stock (Show)
--- | Construct the empty distinguished prelude used by compiler fixtures.
+-- | Construct the empty distinguished prelude used only by compiler fixtures.
buildBootstrapPreludeFixture
:: CheckedFoundation
-> Declaration.VampireResolver
@@ -291,7 +392,8 @@ buildBootstrapPreludeFixture foundation resolver = do
() semantic prefix _closure) ->
Right
(BootstrapPreludeFixture
- (MigrationPreludeSession
+ (FinalPreludeSession
+ Prelude.emptyBootstrapSourceInput
input
(SealedTypedModule
preludeModuleName
@@ -301,7 +403,8 @@ buildBootstrapPreludeFixture foundation resolver = do
(Declaration.freshImportedModuleEvidence
[]
semantic
- prefix))))
+ prefix))
+ ModuleRootMiss))
Right
(Declaration.DriverFailed
(Declaration.DriverDeclarationFailed err)
@@ -321,34 +424,35 @@ data FinalPreludeReadinessError
| FinalPreludeReadinessBuildOpenFailed !Declaration.DriverOpenError
| FinalPreludeReadinessArtifactKeyFailed !ModuleArtifactKeyError
| FinalPreludeReadinessStoreFailed !Store.StoreFailure
+ | FinalPreludeReadinessCachedModuleFailed !CachedTypedModuleError
| FinalPreludeReadinessAcknowledgementMismatch
!ModuleArtifactResult
!ModuleArtifactResult
deriving stock (Show)
--- | Build and atomically publish the exact packaged final prelude.
+-- | Acquire the exact packaged final prelude through its ordinary module root.
--
--- A session is returned only after the ordinary module root transaction has
--- acknowledged the exact artifact that was requested.
-buildFinalPreludeSession
- :: Store.Store
+-- Loading and parsing happen once before the root lookup. A hit is validated
+-- and materialized through the generic cached-module boundary; a miss reuses
+-- that parsed input for confined construction and atomic publication.
+acquireFinalPreludeSession
+ :: Store.StoreMemo
+ -> Store.Store
-> CheckedFoundation
-> Declaration.VampireResolver
- -> IO (Either FinalPreludeReadinessError MigrationPreludeSession)
-buildFinalPreludeSession store foundation resolver =
- FinalPrelude.buildFinalPreludeCandidate foundation resolver >>= \case
- FinalPrelude.FinalPreludeSourceLoadFailed failure ->
+ -> IO (Either FinalPreludeReadinessError FinalPreludeSession)
+acquireFinalPreludeSession memo store foundation resolver =
+ Prelude.loadReservedPreludeSourceInput >>= \case
+ Left failure ->
pure (Left (FinalPreludeReadinessSourceLoadFailed failure))
- FinalPrelude.FinalPreludeSourceParseFailed failure ->
- pure (Left (FinalPreludeReadinessSourceParseFailed failure))
- FinalPrelude.FinalPreludeBuildFailed failure _prefix ->
- pure (Left (FinalPreludeReadinessBuildFailed failure))
- FinalPrelude.FinalPreludeBuildOpenFailed failure ->
- pure (Left (FinalPreludeReadinessBuildOpenFailed failure))
- FinalPrelude.FinalPreludeBuilt candidate ->
- install candidate
+ Right source ->
+ Prelude.parseReservedPreludeSource source >>= \case
+ Left failure ->
+ pure (Left (FinalPreludeReadinessSourceParseFailed failure))
+ Right parsed ->
+ acquire source parsed
where
- install candidate =
+ acquire source parsed =
case moduleArtifactKey
preludeModuleName
parsedId
@@ -357,47 +461,83 @@ buildFinalPreludeSession store foundation resolver =
Left failure ->
pure (Left (FinalPreludeReadinessArtifactKeyFailed failure))
Right key -> do
- let artifact =
- moduleArtifactResult
- key
- (moduleSyntaxAssertedId syntax)
- (semanticInterfaceAssertedId semantic)
- Store.writeSealedModule
- store
- prefix
- [syntax]
- [semantic]
- artifact >>= \case
+ Store.loadCachedModuleInstallation
+ memo store key (moduleSyntaxAssertedId syntax) >>= \case
Left failure ->
pure (Left (FinalPreludeReadinessStoreFailed failure))
- Right acknowledged
- | acknowledged /= artifact ->
- pure
- (Left
- (FinalPreludeReadinessAcknowledgementMismatch
- artifact
- acknowledged))
- | otherwise ->
+ Right (Just installation) ->
+ pure do
+ sealed <- first FinalPreludeReadinessCachedModuleFailed
+ (cachedSealedTypedModule
+ foundation [] installation)
pure
- (Right
- (MigrationPreludeSession
- identified
- (SealedTypedModule
- preludeModuleName
- syntax
- semantic
- prefix
- (Declaration.freshImportedModuleEvidence
- []
- semantic
- prefix))))
+ (FinalPreludeSession
+ source
+ identified sealed ModuleRootHit)
+ Right Nothing ->
+ build source parsed key
where
- parsed = FinalPrelude.finalPreludeParsed candidate
identified = identifiedReservedPrelude parsed
parsedId = identifiedParsedModuleId (identifiedModuleParsed identified)
- syntax = FinalPrelude.finalPreludeSyntax candidate
- semantic = FinalPrelude.finalPreludeSemantic candidate
- prefix = FinalPrelude.finalPreludePrefix candidate
+ syntax = identifiedParsedModuleSyntaxInterface
+ (identifiedModuleParsed identified)
+
+ build source parsed key =
+ FinalPrelude.buildParsedFinalPreludeCandidate
+ foundation parsed resolver >>= \case
+ FinalPrelude.FinalPreludeBuildFailed failure _prefix ->
+ pure (Left (FinalPreludeReadinessBuildFailed failure))
+ FinalPrelude.FinalPreludeBuildOpenFailed failure ->
+ pure (Left (FinalPreludeReadinessBuildOpenFailed failure))
+ FinalPrelude.FinalPreludeBuilt candidate ->
+ publish source key candidate
+ FinalPrelude.FinalPreludeSourceLoadFailed failure ->
+ pure (Left (FinalPreludeReadinessSourceLoadFailed failure))
+ FinalPrelude.FinalPreludeSourceParseFailed failure ->
+ pure (Left (FinalPreludeReadinessSourceParseFailed failure))
+
+ publish source key candidate = do
+ let parsed = FinalPrelude.finalPreludeParsed candidate
+ identified = identifiedReservedPrelude parsed
+ syntax = FinalPrelude.finalPreludeSyntax candidate
+ semantic = FinalPrelude.finalPreludeSemantic candidate
+ prefix = FinalPrelude.finalPreludePrefix candidate
+ artifact =
+ moduleArtifactResult
+ key
+ (moduleSyntaxAssertedId syntax)
+ (semanticInterfaceAssertedId semantic)
+ Store.writeSealedModule
+ store
+ prefix
+ [syntax]
+ [semantic]
+ artifact >>= \case
+ Left failure ->
+ pure (Left (FinalPreludeReadinessStoreFailed failure))
+ Right acknowledged
+ | acknowledged /= artifact ->
+ pure
+ (Left
+ (FinalPreludeReadinessAcknowledgementMismatch
+ artifact
+ acknowledged))
+ | otherwise ->
+ pure
+ (Right
+ (FinalPreludeSession
+ source
+ identified
+ (SealedTypedModule
+ preludeModuleName
+ syntax
+ semantic
+ prefix
+ (Declaration.freshImportedModuleEvidence
+ []
+ semantic
+ prefix))
+ ModuleRootMiss))
data TypedModuleInput = TypedModuleInput
@@ -552,10 +692,10 @@ runTypedModule
(Declaration.importSealedModuleDriver
. sealedTypedModuleEvidence)
effectiveDirect
- compileBlocks
- 0
- (identifiedParsedModuleBlocks
- (identifiedModuleParsed identified))
+ compileSourceItems
+ (typedSourceItems
+ (identifiedParsedModuleBlocks
+ (identifiedModuleParsed identified)))
semanticDirect =
semanticInterfaceAssertedId
(sealedTypedModuleSemantic prelude)
@@ -568,43 +708,45 @@ runTypedModule
occurrences =
identifiedParsedModuleSyntaxOccurrences
(identifiedModuleParsed identified)
- compileBlocks _blockIndex [] =
+ compileSourceItems [] =
pure ()
- compileBlocks blockIndex (block : remaining) =
- case block of
- Raw.BlockClaim{} ->
- case remaining of
- Raw.BlockProof _ proof _end : rest -> do
- compileClaim block (Just proof)
- compileBlocks (blockIndex + 2) rest
- _ -> do
- compileClaim block Nothing
- compileBlocks (blockIndex + 1) remaining
- Raw.BlockProof location _proof _end ->
+ compileSourceItems (item : remaining) =
+ case item of
+ TypedUnmatchedSourceProof location ->
Declaration.failModuleDriver
(TypedUnmatchedProof location)
- Raw.BlockSig{} -> do
+ TypedSourceDeclarationItem declaration -> do
+ compileDeclaration declaration
+ compileSourceItems remaining
+
+ compileDeclaration sourceDeclaration =
+ case block of
+ Raw.BlockClaim{} ->
+ compileClaim block explicitProof
+ Raw.BlockProof{} ->
+ impossible
+ "typed declaration association retained a proof head"
+ Raw.BlockSig{} ->
compileSelected block
- compileBlocks (blockIndex + 1) remaining
- Raw.BlockAbbr{} -> do
+ Raw.BlockAbbr{} ->
compileSelected block
- compileBlocks (blockIndex + 1) remaining
- Raw.BlockDefn{} -> do
+ Raw.BlockDefn{} ->
compileSelected block
- compileBlocks (blockIndex + 1) remaining
- Raw.BlockAxiom{} -> do
+ Raw.BlockAxiom{} ->
compileSourceAxiom block
- compileBlocks (blockIndex + 1) remaining
- Raw.BlockInductive{} -> do
+ Raw.BlockInductive{} ->
compileInductive block
- compileBlocks (blockIndex + 1) remaining
- Raw.BlockData{} -> do
+ Raw.BlockData{} ->
compileDatatype block
- compileBlocks (blockIndex + 1) remaining
- _ ->
- Declaration.failModuleDriver
- (TypedUnsupportedBlock (locate block))
+ Raw.BlockStruct{} ->
+ compileStructure block
where
+ blockIndex =
+ typedSourceDeclarationBlockIndex sourceDeclaration
+ block = typedSourceDeclarationHead sourceDeclaration
+ explicitProof =
+ typedSourceDeclarationProof sourceDeclaration
+
compileSelected selected = do
prepared <-
Exact.prepareExactDeclaration
@@ -672,11 +814,28 @@ runTypedModule
(ExactDatatype.commitPreparedExactDatatype
datatype)
- compileClaim selected explicitProof = do
+ compileStructure selected = do
+ prepared <-
+ Exact.prepareExactStructure
+ selected
+ [ parsedSyntaxOccurrenceEntry occurrence
+ | occurrence <- occurrences
+ , parsedSyntaxOccurrenceBlockIndex occurrence
+ == blockIndex
+ ]
+ case prepared of
+ Left failure ->
+ Declaration.failModuleDriver
+ (TypedExactCompileFailed failure)
+ Right structure ->
+ void
+ (Exact.commitPreparedExactStructure structure)
+
+ compileClaim selected selectedProof = do
prepared <-
ExactProof.prepareExactProof
selected
- explicitProof
+ selectedProof
case prepared of
Left failure ->
Declaration.failModuleDriver
diff --git a/source/Checking/Obligation.hs b/source/Checking/Obligation.hs
deleted file mode 100644
index 22309b7..0000000
--- a/source/Checking/Obligation.hs
+++ /dev/null
@@ -1,428 +0,0 @@
-{-# LANGUAGE NoImplicitPrelude #-}
-
--- | Strict, invocation-local proof obligations emitted by the legacy checker.
-module Checking.Obligation
- ( ObligationPremiseOrigin(..)
- , PreparedPremise
- , preparedPremise
- , preparedPremiseHypothesis
- , preparedPremiseOrigin
- , PreparedObligation
- , preparedObligationOrdinal
- , preparedObligationProverTask
- , preparedObligationTask
- , ObligationMethod(..)
- , preparedObligationMethod
- , preparedObligationSelectedPremises
- , PreparedObligationBatch
- , preparedBatchMarker
- , preparedBatchLocation
- , preparedBatchPremises
- , preparedBatchObligations
- , prepareObligationBatch
- , prepareOmittedObligationBatch
- , ResolvedObligation
- , resolvedObligationPrepared
- , resolvedObligationVampireRun
- , resolvedObligationGapLocation
- , ResolvedObligationBatch
- , resolvedBatchPrepared
- , resolvedBatchObligations
- , resolveObligationWithVampire
- , resolveObligationAsGap
- , resolveObligationBatch
- , ObligationResolutionError(..)
- ) where
-
-import Base
-import Checking.Facts qualified as Facts
-import Checking.Legacy
-import Provers
-import Report.Location
-import Syntax.Internal
-
-import Control.Monad (unless)
-import Data.Vector (Vector)
-import Data.Vector qualified as Vector
-
-
-data ObligationPremiseOrigin
- = RegisteredFactPremise !Facts.FactOrigin
- | RegisteredLegacyFactPremise
- !LegacyFactRef
- !Facts.FactOrigin
- !LegacyTrustDependencies
- | LocalHypothesisPremise !Location !Marker
- deriving (Show, Eq)
-
-data PreparedPremise = PreparedPremise
- !Hypothesis
- !ObligationPremiseOrigin
- deriving (Show, Eq)
-
-preparedPremise
- :: Hypothesis
- -> ObligationPremiseOrigin
- -> PreparedPremise
-preparedPremise = PreparedPremise
-
-preparedPremiseHypothesis :: PreparedPremise -> Hypothesis
-preparedPremiseHypothesis
- (PreparedPremise hypothesis _origin) =
- hypothesis
-
-preparedPremiseOrigin
- :: PreparedPremise
- -> ObligationPremiseOrigin
-preparedPremiseOrigin
- (PreparedPremise _hypothesis origin) =
- origin
-
-
-data ObligationMethod
- = ProveWithVampire
- | RecordExplicitGap !Location
- deriving (Show, Eq)
-
-data PreparedObligation = PreparedObligation
- !LegacyObligationOrdinal
- !PreparedProverTask
- !ObligationMethod
- !(Vector PreparedPremise)
-
-preparedObligationOrdinal
- :: PreparedObligation
- -> LegacyObligationOrdinal
-preparedObligationOrdinal
- (PreparedObligation ordinal _proverTask _method _premises) =
- ordinal
-
-preparedObligationProverTask
- :: PreparedObligation
- -> PreparedProverTask
-preparedObligationProverTask
- (PreparedObligation _ordinal proverTask _method _premises) =
- proverTask
-
-preparedObligationMethod :: PreparedObligation -> ObligationMethod
-preparedObligationMethod
- (PreparedObligation _ordinal _proverTask method _premises) =
- method
-
-preparedObligationSelectedPremises
- :: PreparedObligation
- -> Vector PreparedPremise
-preparedObligationSelectedPremises
- (PreparedObligation _ordinal _proverTask _method premises) =
- premises
-
-preparedObligationTask :: PreparedObligation -> Task
-preparedObligationTask =
- preparedProverLogicalTask . preparedObligationProverTask
-
-
-data PreparedObligationBatch = PreparedObligationBatch
- !Marker
- !Location
- !(Vector PreparedPremise)
- !(Vector PreparedObligation)
-
-preparedBatchMarker :: PreparedObligationBatch -> Marker
-preparedBatchMarker
- (PreparedObligationBatch marker _location _premises _obligations) =
- marker
-
-preparedBatchLocation :: PreparedObligationBatch -> Location
-preparedBatchLocation
- (PreparedObligationBatch _marker location _premises _obligations) =
- location
-
-preparedBatchPremises
- :: PreparedObligationBatch
- -> Vector PreparedPremise
-preparedBatchPremises
- (PreparedObligationBatch _marker _location premises _obligations) =
- premises
-
-preparedBatchObligations
- :: PreparedObligationBatch
- -> Vector PreparedObligation
-preparedBatchObligations
- (PreparedObligationBatch _marker _location _premises obligations) =
- obligations
-
-
-prepareObligationBatch
- :: (Task -> Task)
- -> LegacyObligationOrdinal
- -> [PreparedPremise]
- -> Directness
- -> Marker
- -> Location
- -> [Formula]
- -> (PreparedObligationBatch, LegacyObligationOrdinal)
-prepareObligationBatch
- prepareTask
- firstOrdinal
- premises
- directness
- marker
- location
- goals =
- prepareObligationBatchWith
- ProveWithVampire
- prepareTask
- firstOrdinal
- premises
- directness
- marker
- location
- goals
-
-prepareOmittedObligationBatch
- :: (Task -> Task)
- -> LegacyObligationOrdinal
- -> [PreparedPremise]
- -> Directness
- -> Marker
- -> Location
- -> [Formula]
- -> (PreparedObligationBatch, LegacyObligationOrdinal)
-prepareOmittedObligationBatch
- prepareTask
- firstOrdinal
- premises
- directness
- marker
- location
- goals =
- prepareObligationBatchWith
- (RecordExplicitGap location)
- prepareTask
- firstOrdinal
- premises
- directness
- marker
- location
- goals
-
-prepareObligationBatchWith
- :: ObligationMethod
- -> (Task -> Task)
- -> LegacyObligationOrdinal
- -> [PreparedPremise]
- -> Directness
- -> Marker
- -> Location
- -> [Formula]
- -> (PreparedObligationBatch, LegacyObligationOrdinal)
-prepareObligationBatchWith
- method
- prepareTask
- firstOrdinal
- premises
- directness
- marker
- location
- goals =
- let (obligations, nextOrdinal) =
- prepareGoals firstOrdinal goals
- in
- ( PreparedObligationBatch
- marker
- location
- (Vector.fromList premises)
- (Vector.fromList obligations)
- , nextOrdinal
- )
- where
- hypotheses =
- preparedPremiseHypothesis <$> premises
-
- prepareGoals ordinal = \case
- [] ->
- ([], ordinal)
- goal : remainingGoals ->
- let task =
- prepareTask
- (Task
- directness
- hypotheses
- marker
- location
- goal)
- proverTask = prepareProverTask task
- obligation =
- PreparedObligation
- ordinal
- proverTask
- method
- (selectedPremises
- (taskHypotheses task)
- premises)
- nextOrdinal =
- legacyObligationOrdinal
- (legacyObligationOrdinalValue ordinal + 1)
- (remaining, finalOrdinal) =
- prepareGoals nextOrdinal remainingGoals
- in
- proverTask `seq`
- ( obligation : remaining
- , finalOrdinal
- )
-
--- Task preparation may only select existing premises. Resolution checks this
--- inventory before it can authorize a fact.
-selectedPremises
- :: [Hypothesis]
- -> [PreparedPremise]
- -> Vector PreparedPremise
-selectedPremises hypotheses premises =
- Vector.fromList (go hypotheses premises)
- where
- go [] _available =
- []
- go (hypothesis : remaining) available =
- case takeMatching hypothesis available of
- Nothing ->
- []
- Just (premise, available') ->
- premise : go remaining available'
-
- takeMatching _hypothesis [] =
- Nothing
- takeMatching hypothesis (premise : remaining)
- | preparedPremiseHypothesis premise == hypothesis =
- Just (premise, remaining)
- | otherwise = do
- (found, remaining') <-
- takeMatching hypothesis remaining
- pure (found, premise : remaining')
-
-
-data ResolvedObligation = ResolvedObligation
- !PreparedObligation
- !(Either Location AcceptedVampireRun)
-
-resolvedObligationPrepared
- :: ResolvedObligation
- -> PreparedObligation
-resolvedObligationPrepared
- (ResolvedObligation prepared _evidence) =
- prepared
-
-resolvedObligationVampireRun
- :: ResolvedObligation
- -> Maybe AcceptedVampireRun
-resolvedObligationVampireRun
- (ResolvedObligation _prepared evidence) =
- either (const Nothing) Just evidence
-
-resolvedObligationGapLocation
- :: ResolvedObligation
- -> Maybe Location
-resolvedObligationGapLocation
- (ResolvedObligation _prepared evidence) =
- either Just (const Nothing) evidence
-
-data ResolvedObligationBatch = ResolvedObligationBatch
- !PreparedObligationBatch
- !(Vector ResolvedObligation)
-
-resolvedBatchPrepared
- :: ResolvedObligationBatch
- -> PreparedObligationBatch
-resolvedBatchPrepared
- (ResolvedObligationBatch prepared _resolved) =
- prepared
-
-resolvedBatchObligations
- :: ResolvedObligationBatch
- -> Vector ResolvedObligation
-resolvedBatchObligations
- (ResolvedObligationBatch _prepared resolved) =
- resolved
-
-data ObligationResolutionError
- = VampireEvidenceForGap
- | GapEvidenceForVampire
- | VampireRequestMismatch
- | ResolvedBatchLengthMismatch !Int !Int
- | ResolvedBatchObligationMismatch !LegacyObligationOrdinal
- deriving (Show, Eq)
-
-resolveObligationWithVampire
- :: PreparedObligation
- -> AcceptedVampireRun
- -> Either ObligationResolutionError ResolvedObligation
-resolveObligationWithVampire prepared accepted =
- case preparedObligationMethod prepared of
- RecordExplicitGap{} ->
- Left VampireEvidenceForGap
- ProveWithVampire
- | acceptedVampireRequest accepted
- == preparedProverRequest
- (preparedObligationProverTask prepared) ->
- Right
- (ResolvedObligation
- prepared
- (Right accepted))
- | otherwise ->
- Left VampireRequestMismatch
-
-resolveObligationAsGap
- :: PreparedObligation
- -> Either ObligationResolutionError ResolvedObligation
-resolveObligationAsGap prepared =
- case preparedObligationMethod prepared of
- ProveWithVampire ->
- Left GapEvidenceForVampire
- RecordExplicitGap location ->
- Right
- (ResolvedObligation
- prepared
- (Left location))
-
-resolveObligationBatch
- :: PreparedObligationBatch
- -> Vector ResolvedObligation
- -> Either ObligationResolutionError ResolvedObligationBatch
-resolveObligationBatch prepared resolved
- | Vector.length expected /= Vector.length resolved =
- Left
- (ResolvedBatchLengthMismatch
- (Vector.length expected)
- (Vector.length resolved))
- | otherwise = do
- Vector.zipWithM_
- validate
- expected
- resolved
- pure (ResolvedObligationBatch prepared resolved)
- where
- expected =
- preparedBatchObligations prepared
-
- validate expectedObligation actual =
- unless
- (samePreparedObligation
- expectedObligation
- (resolvedObligationPrepared actual))
- (Left
- (ResolvedBatchObligationMismatch
- (preparedObligationOrdinal
- expectedObligation)))
-
- samePreparedObligation left right =
- preparedObligationOrdinal left
- == preparedObligationOrdinal right
- && preparedObligationMethod left
- == preparedObligationMethod right
- && preparedObligationTask left
- == preparedObligationTask right
- && preparedProverRequest
- (preparedObligationProverTask left)
- == preparedProverRequest
- (preparedObligationProverTask right)
- && preparedObligationSelectedPremises left
- == preparedObligationSelectedPremises right
diff --git a/source/Checking/Semantic.hs b/source/Checking/Semantic.hs
index 3deaa65..7a05f39 100644
--- a/source/Checking/Semantic.hs
+++ b/source/Checking/Semantic.hs
@@ -35,6 +35,7 @@ module Checking.Semantic
, semanticGlobalKeyType
, SemanticGlobalTarget(..)
, semanticGlobalTargetObject
+ , semanticGlobalTargetRequirements
, SemanticGlobalBinding
, semanticGlobalBinding
, semanticGlobalBindingKey
@@ -44,7 +45,24 @@ module Checking.Semantic
, SemanticEnvironmentDelta
, emptySemanticEnvironmentDelta
, semanticEnvironmentDelta
+ , semanticEnvironmentWithStructures
, semanticEnvironmentBindings
+ , semanticEnvironmentStructures
+ , SemanticStructurePhrase
+ , semanticStructurePhrase
+ , semanticStructurePhraseSingular
+ , semanticStructurePhrasePlural
+ , semanticStructurePhraseMarker
+ , SemanticStructureOperation
+ , semanticStructureOperation
+ , semanticStructureOperationSymbol
+ , semanticStructureOperationObject
+ , SemanticStructureDescriptor
+ , semanticStructureDescriptor
+ , semanticStructureDescriptorPhrase
+ , semanticStructureDescriptorPredicate
+ , semanticStructureDescriptorParents
+ , semanticStructureDescriptorOperations
, SemanticEnvironmentError(..)
, DeclarationInterfaceDelta
, declarationInterfaceDelta
@@ -147,6 +165,7 @@ import Control.DeepSeq (NFData)
import Control.Monad (unless, when)
import Data.ByteString (ByteString)
import Data.List qualified as List
+import Data.Map.Strict qualified as Map
import Numeric.Natural (Natural)
import Data.Set qualified as Set
import Data.Text qualified as Text
@@ -389,6 +408,9 @@ semanticGlobalKeyFromLexicalEntry = \case
data SemanticGlobalTarget
= GlobalReference !ObjectId
| TransparentExpansion !ObjectId
+ | ContextualTransparentExpansion
+ !ObjectId
+ !(Map.Map StructSymbol ObjectId)
deriving stock (Show, Eq, Ord, Generic)
deriving anyclass (NFData)
@@ -396,6 +418,15 @@ semanticGlobalTargetObject :: SemanticGlobalTarget -> ObjectId
semanticGlobalTargetObject = \case
GlobalReference identity -> identity
TransparentExpansion identity -> identity
+ ContextualTransparentExpansion identity _requirements -> identity
+
+semanticGlobalTargetRequirements
+ :: SemanticGlobalTarget
+ -> Map.Map StructSymbol ObjectId
+semanticGlobalTargetRequirements = \case
+ GlobalReference{} -> Map.empty
+ TransparentExpansion{} -> Map.empty
+ ContextualTransparentExpansion _identity requirements -> requirements
data SemanticGlobalBinding = SemanticGlobalBinding
!SemanticGlobalKey
@@ -428,13 +459,22 @@ data SemanticGlobalTargetError
| SemanticGlobalTargetIsIntrinsic !ObjectId
| SemanticGlobalTargetTypeMismatch !ObjectId !CoreType !CoreType
| SemanticGlobalExpansionNotTransparent !ObjectId
+ | SemanticGlobalContextualRequirementsEmpty !ObjectId
+ | SemanticGlobalContextualRequirementMissing !StructSymbol !ObjectId
+ | SemanticGlobalContextualRequirementIsIntrinsic !StructSymbol !ObjectId
+ | SemanticGlobalContextualRequirementTypeMismatch
+ !StructSymbol !ObjectId !CoreType !CoreType
+ | SemanticGlobalContextualRequirementNotProvided
+ !StructSymbol !ObjectId
+ | SemanticGlobalContextualRequirementNotReferenced !StructSymbol !ObjectId
deriving stock (Show, Eq)
validateSemanticGlobalBindingTarget
- :: CheckedObjectClosure
+ :: Set.Set (StructSymbol, ObjectId)
+ -> CheckedObjectClosure
-> SemanticGlobalBinding
-> Either SemanticGlobalTargetError ()
-validateSemanticGlobalBindingTarget closure binding = do
+validateSemanticGlobalBindingTarget operationBindings closure binding = do
expected <-
maybe
(Left (SemanticGlobalKeyHasInconsistentArity key))
@@ -448,35 +488,193 @@ validateSemanticGlobalBindingTarget closure binding = do
when
(objectIdFamily identity == IntrinsicObject)
(Left (SemanticGlobalTargetIsIntrinsic identity))
- let actual = objectContentType content
+ let targetExpected =
+ case target of
+ ContextualTransparentExpansion{} ->
+ TyArrow TySet expected
+ _ -> expected
+ actual = objectContentType content
unless
- (actual == expected)
+ (actual == targetExpected)
(Left
(SemanticGlobalTargetTypeMismatch
- identity expected actual))
+ identity targetExpected actual))
case target of
GlobalReference{} -> pure ()
TransparentExpansion{} ->
- case content of
- TransparentObjectContent{} -> pure ()
- _ ->
- Left
- (SemanticGlobalExpansionNotTransparent
- identity)
+ validateTransparent content
+ ContextualTransparentExpansion _ requirements -> do
+ validateTransparent content
+ when
+ (Map.null requirements)
+ (Left (SemanticGlobalContextualRequirementsEmpty identity))
+ traverse_ (validateRequirement content) (Map.toAscList requirements)
where
key = semanticGlobalBindingKey binding
target = semanticGlobalBindingTarget binding
identity = semanticGlobalTargetObject target
+ validateTransparent = \case
+ TransparentObjectContent{} -> pure ()
+ _ -> Left (SemanticGlobalExpansionNotTransparent identity)
+
+ validateRequirement content (symbol, object) = do
+ operationContent <-
+ maybe
+ (Left
+ (SemanticGlobalContextualRequirementMissing
+ symbol object))
+ Right
+ (lookupCheckedObjectContent object closure)
+ when
+ (objectIdFamily object == IntrinsicObject)
+ (Left
+ (SemanticGlobalContextualRequirementIsIntrinsic
+ symbol object))
+ let expectedOperation = TyArrow TySet TySet
+ actualOperation = objectContentType operationContent
+ unless
+ (actualOperation == expectedOperation)
+ (Left
+ (SemanticGlobalContextualRequirementTypeMismatch
+ symbol object expectedOperation actualOperation))
+ unless
+ ((symbol, object) `Set.member` operationBindings)
+ (Left
+ (SemanticGlobalContextualRequirementNotProvided
+ symbol object))
+ case content of
+ TransparentObjectContent _theory _coreType body ->
+ unless
+ (object `Set.member` canonicalTermGlobals body)
+ (Left
+ (SemanticGlobalContextualRequirementNotReferenced
+ symbol object))
+ _ -> impossible "a contextual expansion was not transparent"
+
data SemanticEnvironmentDelta
= EmptySemanticEnvironmentDelta
| SemanticGlobalBindings ![SemanticGlobalBinding]
+ | SemanticGlobalBindingsAndStructures
+ ![SemanticGlobalBinding]
+ ![SemanticStructureDescriptor]
+ deriving stock (Show, Eq, Ord, Generic)
+ deriving anyclass (NFData)
+
+data SemanticStructurePhrase = SemanticStructurePhrase
+ !Pattern
+ !Pattern
+ !Marker
deriving stock (Show, Eq, Ord, Generic)
deriving anyclass (NFData)
+semanticStructurePhrase :: LexicalItemSgPl -> SemanticStructurePhrase
+semanticStructurePhrase (LexicalItemSgPl forms marker) =
+ SemanticStructurePhrase (sg forms) (pl forms) marker
+
+semanticStructurePhraseSingular :: SemanticStructurePhrase -> Pattern
+semanticStructurePhraseSingular (SemanticStructurePhrase singular _ _) =
+ singular
+
+semanticStructurePhrasePlural :: SemanticStructurePhrase -> Pattern
+semanticStructurePhrasePlural (SemanticStructurePhrase _ plural _) =
+ plural
+
+semanticStructurePhraseMarker :: SemanticStructurePhrase -> Marker
+semanticStructurePhraseMarker (SemanticStructurePhrase _ _ marker) =
+ marker
+
+data SemanticStructureOperation = SemanticStructureOperation
+ !StructSymbol
+ !ObjectId
+ deriving stock (Show, Eq, Ord, Generic)
+ deriving anyclass (NFData)
+
+semanticStructureOperation
+ :: StructSymbol
+ -> ObjectId
+ -> SemanticStructureOperation
+semanticStructureOperation =
+ SemanticStructureOperation
+
+semanticStructureOperationSymbol
+ :: SemanticStructureOperation
+ -> StructSymbol
+semanticStructureOperationSymbol (SemanticStructureOperation symbol _) =
+ symbol
+
+semanticStructureOperationObject
+ :: SemanticStructureOperation
+ -> ObjectId
+semanticStructureOperationObject (SemanticStructureOperation _ object) =
+ object
+
+data SemanticStructureDescriptor = SemanticStructureDescriptor
+ !SemanticStructurePhrase
+ !(Maybe ObjectId)
+ ![SemanticStructurePhrase]
+ ![SemanticStructureOperation]
+ deriving stock (Show, Eq, Ord, Generic)
+ deriving anyclass (NFData)
+
+semanticStructureDescriptor
+ :: SemanticStructurePhrase
+ -> Maybe ObjectId
+ -> [SemanticStructurePhrase]
+ -> [SemanticStructureOperation]
+ -> Either SemanticEnvironmentError SemanticStructureDescriptor
+semanticStructureDescriptor structurePhrase predicate parents operations = do
+ case firstDuplicate parents of
+ Just duplicate ->
+ Left (DuplicateSemanticStructureParent duplicate)
+ Nothing -> pure ()
+ when
+ (structurePhrase `elem` parents)
+ (Left (SelfSemanticStructureParent structurePhrase))
+ case firstDuplicate (semanticStructureOperationSymbol <$> operations) of
+ Just duplicate ->
+ Left (DuplicateSemanticStructureOperation duplicate)
+ Nothing -> pure ()
+ pure
+ (SemanticStructureDescriptor
+ structurePhrase predicate parents operations)
+
+semanticStructureDescriptorPhrase
+ :: SemanticStructureDescriptor
+ -> SemanticStructurePhrase
+semanticStructureDescriptorPhrase
+ (SemanticStructureDescriptor structurePhrase _ _ _) =
+ structurePhrase
+
+semanticStructureDescriptorPredicate
+ :: SemanticStructureDescriptor
+ -> Maybe ObjectId
+semanticStructureDescriptorPredicate
+ (SemanticStructureDescriptor _ predicate _ _) =
+ predicate
+
+semanticStructureDescriptorParents
+ :: SemanticStructureDescriptor
+ -> [SemanticStructurePhrase]
+semanticStructureDescriptorParents
+ (SemanticStructureDescriptor _ _ parents _) =
+ parents
+
+semanticStructureDescriptorOperations
+ :: SemanticStructureDescriptor
+ -> [SemanticStructureOperation]
+semanticStructureDescriptorOperations
+ (SemanticStructureDescriptor _ _ _ operations) =
+ operations
+
data SemanticEnvironmentError
= DuplicateSemanticGlobalKey !SemanticGlobalKey
| NonCanonicalSemanticGlobalBindingOrder
+ | DuplicateSemanticStructure !SemanticStructurePhrase
+ | NonCanonicalSemanticStructureOrder
+ | DuplicateSemanticStructureParent !SemanticStructurePhrase
+ | SelfSemanticStructureParent !SemanticStructurePhrase
+ | DuplicateSemanticStructureOperation !StructSymbol
deriving stock (Show, Eq)
emptySemanticEnvironmentDelta :: SemanticEnvironmentDelta
@@ -486,9 +684,16 @@ emptySemanticEnvironmentDelta =
semanticEnvironmentDelta
:: [SemanticGlobalBinding]
-> Either SemanticEnvironmentError SemanticEnvironmentDelta
-semanticEnvironmentDelta [] =
+semanticEnvironmentDelta bindings =
+ semanticEnvironmentWithStructures bindings []
+
+semanticEnvironmentWithStructures
+ :: [SemanticGlobalBinding]
+ -> [SemanticStructureDescriptor]
+ -> Either SemanticEnvironmentError SemanticEnvironmentDelta
+semanticEnvironmentWithStructures [] [] =
Right EmptySemanticEnvironmentDelta
-semanticEnvironmentDelta bindings = do
+semanticEnvironmentWithStructures bindings structures = do
case firstDuplicate (semanticGlobalBindingKey <$> bindings) of
Just duplicate ->
Left (DuplicateSemanticGlobalKey duplicate)
@@ -497,7 +702,19 @@ semanticEnvironmentDelta bindings = do
unless
(bindings == List.sortOn semanticGlobalBindingKey bindings)
(Left NonCanonicalSemanticGlobalBindingOrder)
- pure (SemanticGlobalBindings bindings)
+ case firstDuplicate (semanticStructureDescriptorPhrase <$> structures) of
+ Just duplicate ->
+ Left (DuplicateSemanticStructure duplicate)
+ Nothing -> pure ()
+ unless
+ ( structures
+ == List.sortOn semanticStructureDescriptorPhrase structures
+ )
+ (Left NonCanonicalSemanticStructureOrder)
+ pure
+ (case structures of
+ [] -> SemanticGlobalBindings bindings
+ _ -> SemanticGlobalBindingsAndStructures bindings structures)
semanticEnvironmentBindings
:: SemanticEnvironmentDelta
@@ -505,6 +722,15 @@ semanticEnvironmentBindings
semanticEnvironmentBindings = \case
EmptySemanticEnvironmentDelta -> []
SemanticGlobalBindings bindings -> bindings
+ SemanticGlobalBindingsAndStructures bindings _ -> bindings
+
+semanticEnvironmentStructures
+ :: SemanticEnvironmentDelta
+ -> [SemanticStructureDescriptor]
+semanticEnvironmentStructures = \case
+ EmptySemanticEnvironmentDelta -> []
+ SemanticGlobalBindings{} -> []
+ SemanticGlobalBindingsAndStructures _ structures -> structures
data DeclarationInterfaceDelta = DeclarationInterfaceDelta
@@ -1079,6 +1305,11 @@ putSemanticEnvironmentDeltaCache EmptySemanticEnvironmentDelta =
putSemanticEnvironmentDeltaCache (SemanticGlobalBindings bindings) = do
putCacheTag 0x01
putCacheList putSemanticGlobalBindingCache bindings
+putSemanticEnvironmentDeltaCache
+ (SemanticGlobalBindingsAndStructures bindings structures) = do
+ putCacheTag 0x02
+ putCacheList putSemanticGlobalBindingCache bindings
+ putCacheList putSemanticStructureDescriptorCache structures
getSemanticEnvironmentDeltaCache
:: CacheGet SemanticEnvironmentDelta
@@ -1092,6 +1323,13 @@ getSemanticEnvironmentDeltaCache =
(fail . ("invalid semantic environment delta: " <>) . show)
pure
(semanticEnvironmentDelta bindings)
+ 0x02 -> do
+ bindings <- getCacheList getSemanticGlobalBindingCache
+ structures <- getCacheList getSemanticStructureDescriptorCache
+ either
+ (fail . ("invalid semantic environment delta: " <>) . show)
+ pure
+ (semanticEnvironmentWithStructures bindings structures)
tag ->
fail
("unknown semantic environment delta tag "
@@ -1168,6 +1406,13 @@ putSemanticGlobalBindingCache (SemanticGlobalBinding key target) = do
TransparentExpansion identity -> do
putCacheTag 0x01
putObjectIdCache identity
+ ContextualTransparentExpansion identity requirements -> do
+ putCacheTag 0x02
+ putObjectIdCache identity
+ putCanonicalCacheMap
+ (\(StructSymbol symbol) -> putCacheText symbol)
+ putObjectIdCache
+ requirements
getSemanticGlobalBindingCache :: CacheGet SemanticGlobalBinding
getSemanticGlobalBindingCache =
@@ -1176,11 +1421,71 @@ getSemanticGlobalBindingCache =
<*> (getCacheTag >>= \case
0x00 -> GlobalReference <$> getObjectIdCache
0x01 -> TransparentExpansion <$> getObjectIdCache
+ 0x02 ->
+ ContextualTransparentExpansion
+ <$> getObjectIdCache
+ <*> getCanonicalCacheMap
+ (StructSymbol <$> getCacheText)
+ getObjectIdCache
tag ->
fail
("unknown semantic global target tag "
<> show tag))
+putSemanticStructureDescriptorCache
+ :: SemanticStructureDescriptor
+ -> CachePut
+putSemanticStructureDescriptorCache
+ (SemanticStructureDescriptor structurePhrase predicate parents operations) = do
+ putSemanticStructurePhraseCache structurePhrase
+ putCacheMaybe putObjectIdCache predicate
+ putCacheList putSemanticStructurePhraseCache parents
+ putCacheList putSemanticStructureOperationCache operations
+
+getSemanticStructureDescriptorCache
+ :: CacheGet SemanticStructureDescriptor
+getSemanticStructureDescriptorCache = do
+ structurePhrase <- getSemanticStructurePhraseCache
+ predicate <- getCacheMaybe getObjectIdCache
+ parents <- getCacheList getSemanticStructurePhraseCache
+ operations <- getCacheList getSemanticStructureOperationCache
+ either
+ (fail . ("invalid semantic structure descriptor: " <>) . show)
+ pure
+ (semanticStructureDescriptor structurePhrase predicate parents operations)
+
+putSemanticStructurePhraseCache
+ :: SemanticStructurePhrase
+ -> CachePut
+putSemanticStructurePhraseCache
+ (SemanticStructurePhrase singular plural (Marker marker)) = do
+ putPatternCache singular
+ putPatternCache plural
+ putCacheText marker
+
+getSemanticStructurePhraseCache
+ :: CacheGet SemanticStructurePhrase
+getSemanticStructurePhraseCache =
+ SemanticStructurePhrase
+ <$> getPatternCache
+ <*> getPatternCache
+ <*> (Marker <$> getCacheText)
+
+putSemanticStructureOperationCache
+ :: SemanticStructureOperation
+ -> CachePut
+putSemanticStructureOperationCache
+ (SemanticStructureOperation (StructSymbol symbol) object) = do
+ putCacheText symbol
+ putObjectIdCache object
+
+getSemanticStructureOperationCache
+ :: CacheGet SemanticStructureOperation
+getSemanticStructureOperationCache =
+ SemanticStructureOperation
+ <$> (StructSymbol <$> getCacheText)
+ <*> getObjectIdCache
+
putDeclarationInterfaceDeltaCache
:: DeclarationInterfaceDelta
-> CachePut
diff --git a/source/Checking/Structure.hs b/source/Checking/Structure.hs
deleted file mode 100644
index ce4a2ac..0000000
--- a/source/Checking/Structure.hs
+++ /dev/null
@@ -1,150 +0,0 @@
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE RecordWildCards #-}
-
-module Checking.Structure
- ( CheckedStructDefn
- , StructurePreparationError(..)
- , prepareCheckedStructDefn
- , checkedStructPhrase
- , checkedStructAncestors
- , checkedStructInternalSymbols
- , checkedStructAllSymbols
- , checkedStructSymbol
- , checkedStructDependencies
- , checkedStructSemanticFacts
- , checkedStructFacts
- , checkedStructFactRoles
- , checkedStructMarkers
- ) where
-
-import Base
-import Checking.Facts
-import Checking.Legacy
-import Report.Location
-import Syntax.Internal
-import Syntax.Lexicon
-
-import Data.List.NonEmpty qualified as NonEmpty
-import Data.Set qualified as Set
-
-
--- | A structure declaration whose formulas have been fully prepared.
-data CheckedStructDefn = CheckedStructDefn
- { checkedStructPhrase :: !StructPhrase
- , checkedStructAncestors :: !(Set StructPhrase)
- , checkedStructInternalSymbols :: !(Set StructSymbol)
- , checkedStructAllSymbols :: !(Set StructSymbol)
- , checkedStructSymbol :: !Symbol
- , checkedStructDependencies :: !(Set Symbol)
- , checkedStructFacts :: !(NonEmpty StagedFact)
- }
- deriving (Show, Eq)
-
-checkedStructSemanticFacts
- :: CheckedStructDefn
- -> NonEmpty PreparedSemanticFact
-checkedStructSemanticFacts =
- fmap stagedFactSemantic . checkedStructFacts
-
-checkedStructMarkers :: CheckedStructDefn -> NonEmpty Marker
-checkedStructMarkers =
- (>>= stagedFactAliases) . checkedStructFacts
-
-checkedStructFactRoles
- :: CheckedStructDefn
- -> NonEmpty LegacyStructureFactRole
-checkedStructFactRoles checked =
- LegacyStructureIntroduction
- :| ( LegacyStructureInheritance
- : replicate
- (max 0 (factCount - 2))
- LegacyStructureAssumption
- )
- where
- factCount =
- length (checkedStructFacts checked)
-
-data StructurePreparationError
- = SelfReferentialStructure !Symbol
- deriving (Show, Eq)
-
-prepareCheckedStructDefn
- :: Location
- -> Marker
- -> StructDefn
- -> Set StructPhrase
- -> Set StructSymbol
- -> Either StructurePreparationError CheckedStructDefn
-prepareCheckedStructDefn location marker StructDefn{..} ancestors inheritedSymbols
- | prospectiveSymbol `Set.member` assumptionDependencies =
- Left (SelfReferentialStructure prospectiveSymbol)
- | otherwise =
- Right
- CheckedStructDefn
- { checkedStructPhrase = structPhrase
- , checkedStructAncestors = ancestors
- , checkedStructInternalSymbols = structDefnFixes
- , checkedStructAllSymbols = structDefnFixes <> inheritedSymbols
- , checkedStructSymbol = prospectiveSymbol
- , checkedStructDependencies =
- parentSymbols <> assumptionDependencies
- , checkedStructFacts = stagedFacts
- }
- where
- prospectiveSymbol =
- SymbolPredicate (PredicateNounStruct structPhrase)
- parentSymbols =
- Set.map
- (SymbolPredicate . PredicateNounStruct)
- structParents
- assumptionDependencies =
- Set.unions
- [ preparedSemanticDependencies (prepareSemanticFact formula)
- | (_assumptionMarker, formula) <- structDefnAssumes
- ]
- isStruct phrase =
- TermSymbol
- Nowhere
- (SymbolPredicate (PredicateNounStruct phrase))
- [TermVar structDefnLabel]
- parentPremises
- | structParents == Set.singleton _Onesorted =
- []
- | otherwise =
- isStruct <$> Set.toList structParents
- intro =
- makeConjunction
- (parentPremises <> (snd <$> structDefnAssumes))
- `Implies` isStruct structPhrase
- inherit =
- isStruct structPhrase
- `Implies` makeConjunction
- [ isStruct parent
- | parent <- Set.toList structParents
- ]
- generated =
- (marker, intro)
- :| ( (inheritMarker, inherit)
- : [ (assumptionMarker, isStruct structPhrase `Implies` formula)
- | (assumptionMarker, formula) <- structDefnAssumes
- ]
- )
- inheritMarker =
- case marker of
- Marker text ->
- Marker (text <> "inherit")
- origin =
- factOrigin location marker
- semanticFacts =
- fmap
- (prepareSemanticFact . forallClosure mempty . snd)
- generated
- stagedFacts =
- NonEmpty.zipWith
- (\(factMarker, _formula) semantic ->
- stageFact
- (factMarker :| [])
- origin
- semantic)
- generated
- semanticFacts
diff --git a/source/Checking/Transition.hs b/source/Checking/Transition.hs
deleted file mode 100644
index a2e7054..0000000
--- a/source/Checking/Transition.hs
+++ /dev/null
@@ -1,2584 +0,0 @@
-{-# LANGUAGE DerivingStrategies #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-
--- | Closed in-memory carrier used while declaration families migrate from the
--- disposable legacy checker to checked typed semantics.
-module Checking.Transition
- ( ModuleName
- , moduleName
- , moduleNameNamespace
- , moduleNameRelativePath
- , LocalDeclarationOrdinal
- , localDeclarationOrdinalValue
- , LocalFactOrdinal
- , localFactOrdinalValue
- , LocalAssumptionOrdinal
- , localAssumptionOrdinalValue
- , OpaqueDeclarationRef
- , opaqueDeclarationModule
- , opaqueDeclarationOrdinal
- , Origin
- , origin
- , CheckedGlobalRef
- , checkedGlobalReference
- , checkedGlobalType
- , FactRef
- , factReferenceModule
- , factReferenceOrdinal
- , TransitionFactRef
- , transitionTypedFactReference
- , TypedDirectAxiomManifestEntry
- , typedDirectAssumptionFact
- , typedDirectAssumptionKind
- , typedDirectAssumptionStatement
- , SessionTypedDeclaredAssumptionRef
- , sessionTypedAssumptionFact
- , sessionTypedAssumptionOrdinal
- , sessionTypedAssumptionKind
- , sessionTypedAssumptionStatement
- , SessionTypedTrustedVampireUse
- , TypedTrustDependencies
- , typedDeclaredAssumptionUses
- , typedTrustedVampireUses
- , typedVampireLoweringUses
- , typedFoundationUses
- , typedKernelRuleUses
- , TransitionDerivationImport
- , transitionDerivationImport
- , lookupTransitionTypedImport
- , AdmittedFact
- , admittedFactReference
- , admittedFactIsKernelProof
- , admittedFactIsReconstructedKernelProof
- , admittedFactIsTrustedVampire
- , admittedFactTypedTrustDependencies
- , TransitionModuleBuilder
- , openTransitionModuleBuilder
- , transitionBuilderLegacyStage
- , transitionBuilderImportedCheckingEnvironment
- , transitionBuilderFoundation
- , GlobalPremisePolicy(..)
- , TransitionTypedProblemError(..)
- , planTransitionTypedProblem
- , beginTransitionDeclaration
- , transitionCurrentDeclarationReference
- , commitTransitionOpaqueGlobal
- , commitTransitionTransparentGlobal
- , commitTransitionKernelFact
- , commitTransitionKernelFactWithImports
- , commitTransitionTypedVampireFact
- , commitTransitionTypedDeclaredAssumption
- , transitionBuilderWithLegacyStage
- , lookupTransitionGlobal
- , lookupTransitionGlobalBody
- , TransitionAdmittedModule
- , sealTransitionModule
- , transitionAdmittedName
- , transitionAdmittedLegacyModule
- , transitionAdmittedFacts
- , transitionAdmittedKernelProofCount
- , transitionAdmittedTypedTrustedVampireCount
- , TransitionReplayMeasurements(..)
- , transitionAdmittedReplayMeasurements
- , transitionAdmittedTypedDirectAxiomManifest
- , transitionAdmittedTypedTrustDependencies
- , transitionAdmittedGlobals
- , TransitionModuleError(..)
- ) where
-
-import Base
-import Checking.Backend.Connection qualified as BackendConnection
-import Checking.Backend.Problem qualified as Backend
-import Checking.Backend.Reconstruction qualified as BackendReconstruction
-import Checking.Backend.Tptp qualified as BackendTptp
-import Checking.Core
-import Checking.Facts qualified as Facts
-import Checking.Foundation
- ( CheckedFoundation
- , FoundationAxiomTag
- , KernelRuleTag
- , foundationAxiomFrozen
- )
-import Checking.Kernel.Derivation
-import Checking.Legacy
-import Felix.Module
-import Provers qualified
-import Report.Location
-import Syntax.Internal
-
-import Control.Monad (foldM, unless)
-import Data.Bifunctor (first)
-import Data.Map.Strict qualified as Map
-import Data.Sequence qualified as Seq
-import Data.Set qualified as Set
-import Data.Vector (Vector)
-import Data.Vector qualified as Vector
-import Numeric.Natural (Natural)
-
-
-data OpaqueDeclarationRef = OpaqueDeclarationRef
- !ModuleName
- !LocalDeclarationOrdinal
- deriving stock (Show, Eq, Ord)
-
-opaqueDeclarationModule
- :: OpaqueDeclarationRef
- -> ModuleName
-opaqueDeclarationModule
- (OpaqueDeclarationRef name _ordinal) =
- name
-
-opaqueDeclarationOrdinal
- :: OpaqueDeclarationRef
- -> LocalDeclarationOrdinal
-opaqueDeclarationOrdinal
- (OpaqueDeclarationRef _name ordinal) =
- ordinal
-
-data Origin = Origin
- !Location
- !(Maybe Text)
- !(Maybe Marker)
- deriving stock (Show, Eq)
-
-origin
- :: Location
- -> Maybe Text
- -> Maybe Marker
- -> Origin
-origin =
- Origin
-
-
-data CheckedGlobalRef = CheckedOpaqueGlobal
- !OpaqueDeclarationRef
- !CoreType
- deriving stock (Show, Eq, Ord)
-
-checkedGlobalReference
- :: CheckedGlobalRef
- -> OpaqueDeclarationRef
-checkedGlobalReference
- (CheckedOpaqueGlobal reference _coreType) =
- reference
-
-checkedGlobalType :: CheckedGlobalRef -> CoreType
-checkedGlobalType
- (CheckedOpaqueGlobal _reference coreType) =
- coreType
-
-newtype LocalAssumptionOrdinal =
- LocalAssumptionOrdinal Natural
- deriving stock (Show, Eq, Ord)
-
-localAssumptionOrdinalValue
- :: LocalAssumptionOrdinal
- -> Natural
-localAssumptionOrdinalValue
- (LocalAssumptionOrdinal ordinal) =
- ordinal
-
-data FactRef = FactRef
- !ModuleName
- !LocalFactOrdinal
- deriving stock (Show, Eq, Ord)
-
-factReferenceModule :: FactRef -> ModuleName
-factReferenceModule (FactRef name _ordinal) =
- name
-
-factReferenceOrdinal :: FactRef -> LocalFactOrdinal
-factReferenceOrdinal (FactRef _name ordinal) =
- ordinal
-
-data TransitionFactRef
- = TransitionLegacyFactRef !LegacyFactRef
- | TransitionTypedFactRef !FactRef
- deriving stock (Show, Eq, Ord)
-
-transitionTypedFactReference
- :: TransitionFactRef
- -> Maybe FactRef
-transitionTypedFactReference = \case
- TransitionLegacyFactRef{} ->
- Nothing
- TransitionTypedFactRef reference ->
- Just reference
-
-data TypedSemanticFact = TypedSemanticFact
- !(FrozenCheckedCore CheckedGlobalRef)
- !(Backend.SupportedProposition
- Void
- CheckedGlobalRef)
- !(Backend.FofCapability
- (Backend.CheckedFofProjection
- Void
- CheckedGlobalRef))
- deriving stock (Eq)
-
-prepareTypedSemanticFact
- :: TransitionModuleBuilder
- -> FrozenCheckedCore CheckedGlobalRef
- -> Either TransitionModuleError TypedSemanticFact
-prepareTypedSemanticFact builder supplied = do
- statement <-
- recheckBuilderFrozenCore builder supplied
- prepare statement
- where
- prepare statement
- | frozenCoreType statement /= TyProp =
- Left
- (TransitionTypedFactIsNotProposition
- (frozenCoreType statement))
- | otherwise = do
- proposition <-
- first TransitionTypedFactSupportError
- (Backend.supportedProposition
- Vector.empty
- (embedClosedCore [] statement))
- capability <-
- first TransitionTypedFactClassificationError
- (Backend.classifySupportedProposition
- (builderGlobalType builder)
- proposition)
- Right
- (TypedSemanticFact
- statement
- proposition
- capability)
-
-typedSemanticStatement
- :: TypedSemanticFact
- -> FrozenCheckedCore CheckedGlobalRef
-typedSemanticStatement
- (TypedSemanticFact
- statement
- _proposition
- _capability) =
- statement
-
-typedSemanticProposition
- :: TypedSemanticFact
- -> Backend.SupportedProposition
- Void
- CheckedGlobalRef
-typedSemanticProposition
- (TypedSemanticFact
- _statement
- proposition
- _capability) =
- proposition
-
-typedSemanticFofCapability
- :: TypedSemanticFact
- -> Backend.FofCapability
- (Backend.CheckedFofProjection
- Void
- CheckedGlobalRef)
-typedSemanticFofCapability
- (TypedSemanticFact
- _statement
- _proposition
- capability) =
- capability
-
-data TypedDirectAxiomManifestEntry =
- TypedDirectAxiomManifestEntry
- !FactRef
- !AssumptionKind
- !(FrozenCheckedCore CheckedGlobalRef)
- deriving stock (Show, Eq, Ord)
-
-typedDirectAssumptionFact
- :: TypedDirectAxiomManifestEntry
- -> FactRef
-typedDirectAssumptionFact
- (TypedDirectAxiomManifestEntry reference _kind _statement) =
- reference
-
-typedDirectAssumptionKind
- :: TypedDirectAxiomManifestEntry
- -> AssumptionKind
-typedDirectAssumptionKind
- (TypedDirectAxiomManifestEntry _reference kind _statement) =
- kind
-
-typedDirectAssumptionStatement
- :: TypedDirectAxiomManifestEntry
- -> FrozenCheckedCore CheckedGlobalRef
-typedDirectAssumptionStatement
- (TypedDirectAxiomManifestEntry _reference _kind statement) =
- statement
-
-data SessionTypedDeclaredAssumptionRef =
- SessionTypedDeclaredAssumptionRef
- !FactRef
- !LocalAssumptionOrdinal
- !AssumptionKind
- !(FrozenCheckedCore CheckedGlobalRef)
- deriving stock (Show, Eq, Ord)
-
-sessionTypedAssumptionFact
- :: SessionTypedDeclaredAssumptionRef
- -> FactRef
-sessionTypedAssumptionFact
- (SessionTypedDeclaredAssumptionRef
- reference
- _ordinal
- _kind
- _statement) =
- reference
-
-sessionTypedAssumptionOrdinal
- :: SessionTypedDeclaredAssumptionRef
- -> LocalAssumptionOrdinal
-sessionTypedAssumptionOrdinal
- (SessionTypedDeclaredAssumptionRef
- _reference
- ordinal
- _kind
- _statement) =
- ordinal
-
-sessionTypedAssumptionKind
- :: SessionTypedDeclaredAssumptionRef
- -> AssumptionKind
-sessionTypedAssumptionKind
- (SessionTypedDeclaredAssumptionRef
- _reference
- _ordinal
- kind
- _statement) =
- kind
-
-sessionTypedAssumptionStatement
- :: SessionTypedDeclaredAssumptionRef
- -> FrozenCheckedCore CheckedGlobalRef
-sessionTypedAssumptionStatement
- (SessionTypedDeclaredAssumptionRef
- _reference
- _ordinal
- _kind
- statement) =
- statement
-
-newtype SessionTypedTrustedVampireUse =
- SessionTypedTrustedVampireUse FactRef
- deriving stock (Show, Eq, Ord)
-
-data TypedTrustDependencies = TypedTrustDependencies
- { typedDeclaredAssumptionUses
- :: !(Set SessionTypedDeclaredAssumptionRef)
- , typedTrustedVampireUses
- :: !(Set SessionTypedTrustedVampireUse)
- , typedVampireLoweringUses
- :: !(Set VampireLoweringAssumption)
- , typedFoundationUses
- :: !(Set FoundationAxiomTag)
- , typedKernelRuleUses
- :: !(Set KernelRuleTag)
- }
- deriving stock (Show, Eq)
-
-instance Semigroup TypedTrustDependencies where
- left <> right =
- TypedTrustDependencies
- { typedDeclaredAssumptionUses =
- typedDeclaredAssumptionUses left
- <> typedDeclaredAssumptionUses right
- , typedTrustedVampireUses =
- typedTrustedVampireUses left
- <> typedTrustedVampireUses right
- , typedVampireLoweringUses =
- typedVampireLoweringUses left
- <> typedVampireLoweringUses right
- , typedFoundationUses =
- typedFoundationUses left
- <> typedFoundationUses right
- , typedKernelRuleUses =
- typedKernelRuleUses left
- <> typedKernelRuleUses right
- }
-
-instance Monoid TypedTrustDependencies where
- mempty =
- TypedTrustDependencies
- { typedDeclaredAssumptionUses = mempty
- , typedTrustedVampireUses = mempty
- , typedVampireLoweringUses = mempty
- , typedFoundationUses = mempty
- , typedKernelRuleUses = mempty
- }
-
-data AuthorizedKernelReplay =
- AuthorizedKernelReplay
- !(FrozenCheckedCore CheckedGlobalRef)
- !(Set FactRef)
- !(Set FoundationAxiomTag)
- !(Set KernelRuleTag)
- !Natural
- !Natural
- !(Maybe SessionTypedReconstructionProvenance)
- deriving stock (Eq)
-
-data SessionTypedReconstructionProvenance =
- SessionTypedReconstructionProvenance
- !BackendReconstruction.ReconstructionPolicy
- !(BackendTptp.PreparedTypedTptpProblem
- TransitionFactRef
- Void
- CheckedGlobalRef)
- !Provers.AcceptedVampireRun
- !BackendConnection.ConnectionTrace
- !BackendConnection.ConnectionSearchStats
- !Natural
- !Natural
- deriving stock (Eq)
-
-data SessionTypedReconstructionFallback =
- SessionTypedReconstructionFallback
- !BackendReconstruction.ReconstructionPolicy
- !SessionTypedReconstructionFallbackReason
- deriving stock (Eq)
-
-data SessionTypedReconstructionFallbackReason
- = ReconstructionFallbackUnsupported
- !(BackendConnection.ConnectionUnsupported
- TransitionFactRef)
- | ReconstructionFallbackUnavailable
- !BackendConnection.ConnectionSearchStats
- | ReconstructionFallbackSearchExhausted
- !BackendConnection.ConnectionExhaustion
- !BackendConnection.ConnectionSearchStats
- | ReconstructionFallbackKernelReplayExhausted
- !KernelReplayError
- deriving stock (Eq)
-
-data SessionTypedTrustedVampireEvidence =
- SessionTypedTrustedVampireEvidence
- !FactRef
- !(FrozenCheckedCore CheckedGlobalRef)
- !(BackendTptp.PreparedTypedTptpProblem
- TransitionFactRef
- Void
- CheckedGlobalRef)
- !Provers.AcceptedVampireRun
- !TypedTrustDependencies
- !SessionTypedReconstructionFallback
- deriving stock (Eq)
-
-data FactAuthorization
- = KernelProof
- !AuthorizedKernelReplay
- !TypedTrustDependencies
- | DeclaredAssumption
- !SessionTypedDeclaredAssumptionRef
- | TrustedVampire
- !SessionTypedTrustedVampireEvidence
- deriving stock (Eq)
-
-data TypedAdmittedFact = TypedAdmittedFact
- !TypedSemanticFact
- !FactAuthorization
- deriving stock (Eq)
-
-commitTransitionKernelFact
- :: NonEmpty Marker
- -> Origin
- -> FrozenCheckedCore CheckedGlobalRef
- -> KernelDerivation CheckedGlobalRef
- -> TransitionModuleBuilder
- -> Either TransitionModuleError TransitionModuleBuilder
-commitTransitionKernelFact aliases factOrigin target derivation builder =
- commitTransitionKernelFactWithImports
- aliases
- factOrigin
- Vector.empty
- target
- derivation
- builder
-
-commitTransitionKernelFactWithImports
- :: NonEmpty Marker
- -> Origin
- -> Vector TransitionDerivationImport
- -> FrozenCheckedCore CheckedGlobalRef
- -> KernelDerivation CheckedGlobalRef
- -> TransitionModuleBuilder
- -> Either TransitionModuleError TransitionModuleBuilder
-commitTransitionKernelFactWithImports
- aliases
- factOrigin
- imports
- target
- derivation
- builder = do
- admitted <-
- authorizeTransitionKernelFactWithImports
- imports
- target
- derivation
- builder
- insertTransitionTypedFact
- aliases
- factOrigin
- admitted
- builder
-
-data TransitionDerivationImport =
- TransitionDerivationImport
- !TransitionFactRef
- !(DerivationImportJudgment CheckedGlobalRef)
- deriving stock (Eq)
-
-transitionDerivationImport
- :: TransitionFactRef
- -> FrozenCheckedCore CheckedGlobalRef
- -> Either
- TransitionModuleError
- TransitionDerivationImport
-transitionDerivationImport reference statement =
- TransitionDerivationImport reference
- <$> first
- TransitionDerivationImportError
- (derivationImportJudgment statement)
-
-lookupTransitionTypedImport
- :: FrozenCheckedCore CheckedGlobalRef
- -> TransitionModuleBuilder
- -> Either
- TransitionModuleError
- (Maybe TransitionDerivationImport)
-lookupTransitionTypedImport statement builder =
- case Vector.find
- ((== Just statement)
- . admittedFactStatement
- . entryFact)
- (builderVisibleFacts builder) of
- Nothing ->
- Right Nothing
- Just
- (TransitionFactEntry
- fact@(TypedFactRow _reference admitted)
- _registration) -> do
- unless
- (typedAdmittedStatement admitted
- == statement)
- (Left TransitionKernelTargetMismatch)
- Just
- <$> transitionDerivationImport
- (admittedFactReference fact)
- statement
- Just (TransitionFactEntry LegacyFactRow{} _registration) ->
- Right Nothing
- where
- entryFact
- (TransitionFactEntry fact _registration) =
- fact
-
-authorizeTransitionKernelFactWithImports
- :: Vector TransitionDerivationImport
- -> FrozenCheckedCore CheckedGlobalRef
- -> KernelDerivation CheckedGlobalRef
- -> TransitionModuleBuilder
- -> Either TransitionModuleError TypedAdmittedFact
-authorizeTransitionKernelFactWithImports
- imports
- target
- derivation
- builder = do
- authorizeTransitionKernelFactWithImportsAndProvenance
- defaultKernelReplayLimits
- Nothing
- imports
- target
- derivation
- builder
-
-authorizeTransitionKernelFactWithImportsAndProvenance
- :: KernelReplayLimits
- -> Maybe SessionTypedReconstructionProvenance
- -> Vector TransitionDerivationImport
- -> FrozenCheckedCore CheckedGlobalRef
- -> KernelDerivation CheckedGlobalRef
- -> TransitionModuleBuilder
- -> Either TransitionModuleError TypedAdmittedFact
-authorizeTransitionKernelFactWithImportsAndProvenance
- replayLimits
- provenance
- imports
- target
- derivation
- builder = do
- semantic <-
- prepareTypedSemanticFact builder target
- let checkedTarget =
- typedSemanticStatement semantic
- replayed <-
- first TransitionKernelReplayError
- (replayKernelDerivation
- (builderFoundation builder)
- replayLimits
- (builderGlobalType builder)
- (derivationImport
- <$> imports)
- checkedTarget
- derivation)
- inheritedTrust <-
- foldM
- (\trust index ->
- (trust <>)
- <$> authorizeUsedImport
- imports
- builder
- index)
- mempty
- (Set.toAscList
- (replayedKernelImportUses replayed))
- let foundationTrust =
- mempty
- { typedFoundationUses =
- replayedKernelFoundationUses replayed
- , typedKernelRuleUses =
- replayedKernelRuleUses replayed
- }
- authorization =
- AuthorizedKernelReplay
- (replayedKernelTarget replayed)
- (Set.fromList
- [ reference
- | index <-
- Set.toAscList
- (replayedKernelImportUses replayed)
- , Right
- (TransitionDerivationImport
- (TransitionTypedFactRef reference)
- _judgment) <-
- [transitionImportAt imports index]
- ])
- (replayedKernelFoundationUses replayed)
- (replayedKernelRuleUses replayed)
- (replayedKernelNodeCount replayed)
- (replayedKernelMaximumDepth replayed)
- provenance
- unless
- (typedSemanticStatement semantic
- == replayedKernelTarget replayed)
- (Left TransitionKernelTargetMismatch)
- pure
- (TypedAdmittedFact
- semantic
- (KernelProof
- authorization
- (inheritedTrust <> foundationTrust)))
-
-typedAdmittedStatement
- :: TypedAdmittedFact
- -> FrozenCheckedCore CheckedGlobalRef
-typedAdmittedStatement
- (TypedAdmittedFact semantic _authorization) =
- typedSemanticStatement semantic
-
-typedAdmittedTrustDependencies
- :: TypedAdmittedFact
- -> TypedTrustDependencies
-typedAdmittedTrustDependencies
- (TypedAdmittedFact _semantic authorization) =
- factAuthorizationTrust authorization
-
-data AdmittedFact
- = LegacyFactRow
- !TransitionFactRef
- !H1LegacyAdmittedFact
- | TypedFactRow
- !TransitionFactRef
- !TypedAdmittedFact
- deriving stock (Eq)
-
-admittedFactReference
- :: AdmittedFact
- -> TransitionFactRef
-admittedFactReference = \case
- LegacyFactRow reference _admitted ->
- reference
- TypedFactRow reference _admitted ->
- reference
-
-admittedFactIsKernelProof :: AdmittedFact -> Bool
-admittedFactIsKernelProof = \case
- LegacyFactRow{} ->
- False
- TypedFactRow _reference
- (TypedAdmittedFact _semantic authorization) ->
- case authorization of
- KernelProof{} ->
- True
- DeclaredAssumption{} ->
- False
- TrustedVampire{} ->
- False
-
-admittedFactIsReconstructedKernelProof :: AdmittedFact -> Bool
-admittedFactIsReconstructedKernelProof = \case
- LegacyFactRow{} ->
- False
- TypedFactRow _reference
- (TypedAdmittedFact _semantic authorization) ->
- case authorization of
- KernelProof
- (AuthorizedKernelReplay
- _target
- _imports
- _foundation
- _rules
- _nodes
- _depth
- (Just _provenance))
- _trust ->
- True
- KernelProof{} ->
- False
- DeclaredAssumption{} ->
- False
- TrustedVampire{} ->
- False
-
-admittedFactIsTrustedVampire :: AdmittedFact -> Bool
-admittedFactIsTrustedVampire = \case
- LegacyFactRow{} ->
- False
- TypedFactRow _reference
- (TypedAdmittedFact _semantic authorization) ->
- case authorization of
- KernelProof{} ->
- False
- DeclaredAssumption{} ->
- False
- TrustedVampire{} ->
- True
-
-admittedFactTypedTrustDependencies
- :: AdmittedFact
- -> Maybe TypedTrustDependencies
-admittedFactTypedTrustDependencies = \case
- LegacyFactRow{} ->
- Nothing
- TypedFactRow _reference admitted ->
- Just (typedAdmittedTrustDependencies admitted)
-
-admittedFactStatement
- :: AdmittedFact
- -> Maybe (FrozenCheckedCore CheckedGlobalRef)
-admittedFactStatement = \case
- LegacyFactRow{} ->
- Nothing
- TypedFactRow _reference admitted ->
- Just (typedAdmittedStatement admitted)
-
-factAuthorizationTrust
- :: FactAuthorization
- -> TypedTrustDependencies
-factAuthorizationTrust = \case
- KernelProof _replay trust ->
- trust
- DeclaredAssumption reference ->
- mempty
- { typedDeclaredAssumptionUses =
- Set.singleton reference
- }
- TrustedVampire
- (SessionTypedTrustedVampireEvidence
- _reference
- _target
- _prepared
- _accepted
- trust
- _fallback) ->
- trust
-
-derivationImport
- :: TransitionDerivationImport
- -> DerivationImportJudgment CheckedGlobalRef
-derivationImport
- (TransitionDerivationImport _reference judgment) =
- judgment
-
-transitionImportAt
- :: Vector TransitionDerivationImport
- -> ImportIx
- -> Either
- TransitionModuleError
- TransitionDerivationImport
-transitionImportAt imports index
- | naturalIndex >
- fromIntegral (maxBound :: Int) =
- Left
- (TransitionKernelImportIndexOutOfBounds
- index)
- | otherwise =
- maybe
- (Left
- (TransitionKernelImportIndexOutOfBounds
- index))
- Right
- (imports Vector.!? fromIntegral naturalIndex)
- where
- naturalIndex =
- importIxValue index
-
-authorizeUsedImport
- :: Vector TransitionDerivationImport
- -> TransitionModuleBuilder
- -> ImportIx
- -> Either
- TransitionModuleError
- TypedTrustDependencies
-authorizeUsedImport imports builder index = do
- TransitionDerivationImport reference judgment <-
- transitionImportAt imports index
- case reference of
- TransitionLegacyFactRef{} ->
- Left
- (TransitionDependencyNotMigrated
- reference)
- TransitionTypedFactRef _typedReference -> do
- TransitionFactEntry fact _registration <-
- maybe
- (Left
- (TransitionKernelImportNotVisible
- reference))
- Right
- (lookupBuilderFact reference builder)
- case fact of
- LegacyFactRow{} ->
- Left
- (TransitionDependencyNotMigrated
- reference)
- TypedFactRow rowReference admitted -> do
- unless
- (rowReference == reference
- && typedAdmittedStatement admitted
- == derivationImportStatement
- judgment)
- (Left
- (TransitionKernelImportDoesNotMatch
- reference))
- pure
- (typedAdmittedTrustDependencies
- admitted)
-
-builderVisibleFacts
- :: TransitionModuleBuilder
- -> Vector TransitionFactEntry
-builderVisibleFacts =
- Vector.fromList
- . toList
- . inventoryFactOrder
- . builderFactInventory
-
-lookupBuilderFact
- :: TransitionFactRef
- -> TransitionModuleBuilder
- -> Maybe TransitionFactEntry
-lookupBuilderFact reference =
- Map.lookup reference
- . inventoryFactsByReference
- . builderFactInventory
-
-data TransitionFactRegistration = TransitionFactRegistration
- !(NonEmpty Marker)
- !Origin
- deriving stock (Eq)
-
-data TransitionFactEntry = TransitionFactEntry
- !AdmittedFact
- !TransitionFactRegistration
- deriving stock (Eq)
-
-data TransitionFactInventory = TransitionFactInventory
- { inventoryFactsByReference
- :: !(Map TransitionFactRef TransitionFactEntry)
- , inventoryAliases
- :: !(Map Marker (TransitionFactRef, Origin))
- , inventoryFactOrder :: !(Seq TransitionFactEntry)
- , inventoryFofOrder :: !(Seq TransitionFactRef)
- }
-
-emptyTransitionFactInventory :: TransitionFactInventory
-emptyTransitionFactInventory =
- TransitionFactInventory
- { inventoryFactsByReference = Map.empty
- , inventoryAliases = Map.empty
- , inventoryFactOrder = Seq.empty
- , inventoryFofOrder = Seq.empty
- }
-
-insertTransitionFactEntry
- :: TransitionFactEntry
- -> TransitionFactInventory
- -> Either TransitionModuleError TransitionFactInventory
-insertTransitionFactEntry
- entry@(TransitionFactEntry
- fact
- (TransitionFactRegistration
- aliases
- factOrigin))
- inventory =
- case Map.lookup
- reference
- (inventoryFactsByReference inventory) of
- Just previous
- | previous == entry ->
- Right inventory
- | otherwise ->
- Left
- (TransitionFactReferenceConflict
- reference)
- Nothing -> do
- aliases' <-
- insertFactAliases
- reference
- factOrigin
- aliases
- (inventoryAliases inventory)
- pure
- inventory
- { inventoryFactsByReference =
- Map.insert
- reference
- entry
- (inventoryFactsByReference
- inventory)
- , inventoryAliases = aliases'
- , inventoryFactOrder =
- inventoryFactOrder inventory
- Seq.|> entry
- , inventoryFofOrder =
- case typedFofReference fact of
- Nothing ->
- inventoryFofOrder inventory
- Just fofReference ->
- inventoryFofOrder inventory
- Seq.|> fofReference
- }
- where
- reference =
- admittedFactReference fact
-
- typedFofReference = \case
- LegacyFactRow{} ->
- Nothing
- TypedFactRow rowReference
- (TypedAdmittedFact
- semantic
- _authorization) ->
- case typedSemanticFofCapability semantic of
- Backend.FofProjectable{} ->
- Just rowReference
- Backend.RequiresTh0{} ->
- Nothing
-
-data TypedGlobalBinding = TypedGlobalBinding
- !Symbol
- !CheckedGlobalRef
- !Origin
- !(Maybe (FrozenCheckedCore CheckedGlobalRef))
- deriving stock (Eq)
-
-instance Show TypedGlobalBinding where
- show
- (TypedGlobalBinding
- symbol
- reference
- bindingOrigin
- body) =
- "TypedGlobalBinding "
- <> show symbol
- <> " "
- <> show reference
- <> " "
- <> show bindingOrigin
- <> if isJust body
- then " Transparent"
- else " Opaque"
-
-data TypedModuleEnvironmentDelta =
- TypedModuleEnvironmentDelta
- !ModuleName
- !(Vector TypedGlobalBinding)
- deriving stock (Show, Eq)
-
-data TransitionModuleBuilder = TransitionModuleBuilder
- { builderFoundation :: !CheckedFoundation
- , builderName :: !ModuleName
- , builderLegacyStage :: !LegacyModuleStage
- , builderEnvironmentDeltas
- :: !(Vector TypedModuleEnvironmentDelta)
- , builderGlobals :: !(Map Symbol TypedGlobalBinding)
- , builderGlobalDeclarations
- :: !(Map OpaqueDeclarationRef TypedGlobalBinding)
- , builderLocalGlobalsReversed :: ![TypedGlobalBinding]
- , builderFactInventory :: !TransitionFactInventory
- , builderLocalFactsReversed :: ![TransitionFactEntry]
- , builderTypedDirectAxiomManifestReversed
- :: ![TypedDirectAxiomManifestEntry]
- , builderNextTypedFact :: !Natural
- , builderNextTypedAssumption :: !Natural
- , builderNextDeclaration :: !Natural
- , builderCurrentDeclaration
- :: !(Maybe OpaqueDeclarationRef)
- }
-
-openTransitionModuleBuilder
- :: CheckedFoundation
- -> LegacyCheckingEnvironment
- -> LegacyModuleAssignment
- -> [TransitionAdmittedModule]
- -> Either TransitionModuleError TransitionModuleBuilder
-openTransitionModuleBuilder
- checkedFoundationValue
- foundation
- assignment
- directImports =
- checkedFoundationValue `seq` do
- importedView <-
- first TransitionLegacyModuleError
- (legacyImportedView
- foundation
- (transitionAdmittedLegacyModule <$> directImports))
- (environmentDeltas, globals, globalDeclarations) <-
- mergeTypedEnvironments directImports
- factInventory <-
- mergeTransitionFacts directImports
- let address =
- legacyStageSourceAddress legacyStage
- name =
- moduleName address
- legacyStage =
- openLegacyModuleStage assignment importedView
- pure
- TransitionModuleBuilder
- { builderFoundation =
- checkedFoundationValue
- , builderName = name
- , builderLegacyStage = legacyStage
- , builderEnvironmentDeltas =
- environmentDeltas
- , builderGlobals = globals
- , builderGlobalDeclarations =
- globalDeclarations
- , builderLocalGlobalsReversed = []
- , builderFactInventory = factInventory
- , builderLocalFactsReversed = []
- , builderTypedDirectAxiomManifestReversed = []
- , builderNextTypedFact = 0
- , builderNextTypedAssumption = 0
- , builderNextDeclaration = 0
- , builderCurrentDeclaration = Nothing
- }
-
-transitionBuilderLegacyStage
- :: TransitionModuleBuilder
- -> LegacyModuleStage
-transitionBuilderLegacyStage
- builder =
- builderLegacyStage builder
-
-transitionBuilderImportedCheckingEnvironment
- :: TransitionModuleBuilder
- -> LegacyCheckingEnvironment
-transitionBuilderImportedCheckingEnvironment =
- legacyStageImportedCheckingEnvironment
- . transitionBuilderLegacyStage
-
-transitionBuilderFoundation
- :: TransitionModuleBuilder
- -> CheckedFoundation
-transitionBuilderFoundation =
- builderFoundation
-
-builderGlobalType
- :: TransitionModuleBuilder
- -> CheckedGlobalRef
- -> Maybe CoreType
-builderGlobalType builder reference =
- case Map.lookup
- (checkedGlobalReference reference)
- (builderGlobalDeclarations builder) of
- Just
- (TypedGlobalBinding
- _symbol
- authoritative
- _origin
- _body)
- | checkedGlobalType reference
- == checkedGlobalType authoritative ->
- Just (checkedGlobalType authoritative)
- _ ->
- Nothing
-
-validateBuilderGlobalReference
- :: TransitionModuleBuilder
- -> CheckedGlobalRef
- -> Either TransitionModuleError CoreType
-validateBuilderGlobalReference builder reference =
- case Map.lookup
- (checkedGlobalReference reference)
- (builderGlobalDeclarations builder) of
- Nothing ->
- Left
- (TransitionGlobalReferenceNotVisible
- reference)
- Just
- (TypedGlobalBinding
- _symbol
- authoritative
- _origin
- _body)
- | checkedGlobalType reference
- == checkedGlobalType authoritative ->
- Right (checkedGlobalType authoritative)
- | otherwise ->
- Left
- (TransitionGlobalReferenceTypeMismatch
- reference
- (checkedGlobalType authoritative))
-
-validateBuilderCanonicalGlobals
- :: TransitionModuleBuilder
- -> CanonicalTerm CheckedGlobalRef
- -> Either TransitionModuleError ()
-validateBuilderCanonicalGlobals builder =
- traverse_
- (void . validateBuilderGlobalReference builder)
- . Set.toAscList
- . canonicalTermGlobals
-
-recheckBuilderFrozenCore
- :: TransitionModuleBuilder
- -> FrozenCheckedCore CheckedGlobalRef
- -> Either
- TransitionModuleError
- (FrozenCheckedCore CheckedGlobalRef)
-recheckBuilderFrozenCore builder supplied = do
- validateBuilderCanonicalGlobals
- builder
- (frozenCoreTerm supplied)
- first TransitionCoreCheckError
- (checkCanonicalCore
- (builderGlobalType builder)
- (frozenCoreTerm supplied))
-
-data GlobalPremisePolicy
- = ImplicitFofFacts
- | ExplicitFacts !(NonEmpty Marker)
- | NoGlobalFacts
- deriving stock (Show, Eq)
-
-planTransitionTypedProblem
- :: Ord local
- => TransitionModuleBuilder
- -> Backend.SupportedProposition
- local
- CheckedGlobalRef
- -> [ Backend.TypedLocalPremise
- local
- Origin
- CheckedGlobalRef
- ]
- -> [ Backend.TypedFoundationAuxiliaryInput
- CheckedGlobalRef
- ]
- -> GlobalPremisePolicy
- -> Backend.LocalPremisePolicy
- -> Either
- (TransitionTypedProblemError local)
- (Backend.TypedProblem
- TransitionFactRef
- local
- Origin
- CheckedGlobalRef)
-planTransitionTypedProblem
- builder
- claim
- localPremises
- auxiliaries
- globalPolicy
- localPolicy = do
- first TransitionTypedProblemGlobalValidationError
- (do
- validateBuilderCanonicalGlobals
- builder
- (Backend.supportedPropositionTerm claim)
- traverse_
- ( validateBuilderCanonicalGlobals builder
- . Backend.supportedPropositionTerm
- . Backend.typedLocalPremiseProposition
- )
- localPremises)
- (selectedFacts, premiseMode) <-
- selectTransitionBackendFacts
- builder
- globalPolicy
- first TransitionTypedProblemPlanningError
- (Backend.planTypedProblem
- (builderGlobalType builder)
- selectedFacts
- claim
- localPremises
- auxiliaries
- premiseMode
- localPolicy)
-
-selectTransitionBackendFacts
- :: TransitionModuleBuilder
- -> GlobalPremisePolicy
- -> Either
- (TransitionTypedProblemError local)
- ( Vector
- (Backend.TypedBackendFact
- TransitionFactRef
- CheckedGlobalRef)
- , Backend.GlobalPremiseMode
- )
-selectTransitionBackendFacts builder policy = do
- references <-
- case policy of
- ImplicitFofFacts ->
- Right
- (toList
- (inventoryFofOrder inventory))
- ExplicitFacts aliases ->
- stableUnique
- <$> traverse resolveAlias (toList aliases)
- NoGlobalFacts ->
- Right []
- facts <-
- Vector.fromList
- <$> traverse resolveFact references
- pure
- ( facts
- , case policy of
- ImplicitFofFacts ->
- Backend.ImplicitFofPremises
- ExplicitFacts{} ->
- Backend.ExplicitGlobalPremises
- NoGlobalFacts ->
- Backend.NoGlobalPremises
- )
- where
- inventory =
- builderFactInventory builder
-
- resolveAlias alias =
- case Map.lookup alias (inventoryAliases inventory) of
- Nothing ->
- Left
- (TransitionTypedProblemUnknownFactAlias
- alias)
- Just (reference, _origin) ->
- Right reference
-
- resolveFact reference =
- case Map.lookup
- reference
- (inventoryFactsByReference inventory) of
- Nothing ->
- Left
- (TransitionTypedProblemFactReferenceMissing
- reference)
- Just (TransitionFactEntry LegacyFactRow{} _registration) ->
- Left
- (TransitionTypedProblemDependencyNotMigrated
- reference)
- Just
- (TransitionFactEntry
- (TypedFactRow rowReference
- (TypedAdmittedFact
- semantic
- _authorization))
- _registration)
- | rowReference == reference ->
- Right
- (Backend.typedBackendFact
- reference
- (typedSemanticProposition semantic)
- (typedSemanticFofCapability semantic))
- | otherwise ->
- Left
- (TransitionTypedProblemFactReferenceMissing
- reference)
-
- stableUnique =
- reverse . snd
- . foldl'
- (\(seen, reversed) reference ->
- if reference `Set.member` seen
- then (seen, reversed)
- else
- ( Set.insert reference seen
- , reference : reversed
- ))
- (Set.empty, [])
-
-data TransitionTypedProblemError local
- = TransitionTypedProblemGlobalValidationError
- !TransitionModuleError
- | TransitionTypedProblemUnknownFactAlias
- !Marker
- | TransitionTypedProblemDependencyNotMigrated
- !TransitionFactRef
- | TransitionTypedProblemFactReferenceMissing
- !TransitionFactRef
- | TransitionTypedProblemPlanningError
- !(Backend.TypedProblemError
- local
- CheckedGlobalRef)
- deriving stock (Show, Eq)
-
-beginTransitionDeclaration
- :: TransitionModuleBuilder
- -> TransitionModuleBuilder
-beginTransitionDeclaration
- builder =
- builder
- { builderNextDeclaration =
- nextDeclaration + 1
- , builderCurrentDeclaration =
- Just
- (OpaqueDeclarationRef
- (builderName builder)
- (localDeclarationOrdinal
- nextDeclaration))
- }
- where
- nextDeclaration =
- builderNextDeclaration builder
-
-transitionCurrentDeclarationReference
- :: TransitionModuleBuilder
- -> Maybe OpaqueDeclarationRef
-transitionCurrentDeclarationReference
- builder =
- builderCurrentDeclaration builder
-
-commitTransitionOpaqueGlobal
- :: Symbol
- -> CoreType
- -> Origin
- -> TransitionModuleBuilder
- -> Either TransitionModuleError TransitionModuleBuilder
-commitTransitionOpaqueGlobal
- symbol
- coreType
- bindingOrigin
- builder =
- commitTransitionGlobal
- symbol
- coreType
- bindingOrigin
- Nothing
- builder
-
-commitTransitionTransparentGlobal
- :: Symbol
- -> CoreType
- -> FrozenCheckedCore CheckedGlobalRef
- -> Origin
- -> TransitionModuleBuilder
- -> Either TransitionModuleError TransitionModuleBuilder
-commitTransitionTransparentGlobal
- symbol
- coreType
- body
- bindingOrigin
- builder = do
- checkedBody <-
- recheckBuilderFrozenCore builder body
- unless
- (frozenCoreType checkedBody == coreType)
- (Left
- (TransitionTransparentGlobalTypeMismatch
- symbol
- coreType
- (frozenCoreType checkedBody)))
- commitTransitionGlobal
- symbol
- coreType
- bindingOrigin
- (Just checkedBody)
- builder
-
-commitTransitionGlobal
- :: Symbol
- -> CoreType
- -> Origin
- -> Maybe (FrozenCheckedCore CheckedGlobalRef)
- -> TransitionModuleBuilder
- -> Either TransitionModuleError TransitionModuleBuilder
-commitTransitionGlobal
- symbol
- coreType
- bindingOrigin
- body
- builder =
- case transitionCurrentDeclarationReference builder of
- Nothing ->
- Left TransitionDeclarationNotOpen
- Just reference -> do
- let binding =
- TypedGlobalBinding
- symbol
- (CheckedOpaqueGlobal
- reference
- coreType)
- bindingOrigin
- body
- case Map.lookup symbol
- (builderGlobals builder) of
- Just previous ->
- Left
- (globalSymbolConflict
- previous
- binding)
- Nothing ->
- pure ()
- case Map.lookup reference
- (builderGlobalDeclarations builder) of
- Just previous ->
- Left
- (globalReferenceConflict
- previous
- binding)
- Nothing ->
- pure ()
- (globals, declarations) <-
- insertVisibleGlobalBinding
- ( builderGlobals builder
- , builderGlobalDeclarations builder
- )
- binding
- Right
- builder
- { builderGlobals = globals
- , builderGlobalDeclarations =
- declarations
- , builderLocalGlobalsReversed =
- binding
- : builderLocalGlobalsReversed
- builder
- }
-
-insertTransitionTypedFact
- :: NonEmpty Marker
- -> Origin
- -> TypedAdmittedFact
- -> TransitionModuleBuilder
- -> Either TransitionModuleError TransitionModuleBuilder
-insertTransitionTypedFact aliases factOrigin admitted builder = do
- factReference <-
- nextTransitionTypedFactReference builder
- let ordinal =
- builderNextTypedFact builder
- reference =
- TransitionTypedFactRef
- factReference
- registration =
- TransitionFactRegistration
- aliases
- factOrigin
- entry =
- TransitionFactEntry
- (TypedFactRow reference admitted)
- registration
- inventory' <-
- insertTransitionFactEntry
- entry
- (builderFactInventory builder)
- Right
- builder
- { builderLocalFactsReversed =
- entry
- : builderLocalFactsReversed
- builder
- , builderFactInventory = inventory'
- , builderNextTypedFact = ordinal + 1
- }
-
-commitTransitionTypedVampireFact
- :: BackendReconstruction.ReconstructionPolicy
- -> NonEmpty Marker
- -> Origin
- -> FrozenCheckedCore CheckedGlobalRef
- -> Provers.PreparedTypedProverTask
- TransitionFactRef
- Void
- inputOrigin
- CheckedGlobalRef
- -> Provers.AcceptedVampireRun
- -> TransitionModuleBuilder
- -> Either TransitionModuleError TransitionModuleBuilder
-commitTransitionTypedVampireFact
- reconstructionPolicy
- aliases
- factOrigin
- target
- preparedTask
- accepted
- builder = do
- semantic <-
- prepareTypedSemanticFact builder target
- let checkedTarget =
- typedSemanticStatement semantic
- let problem =
- Provers.preparedTypedProverLogicalProblem
- preparedTask
- claim =
- Backend.typedProblemClaim problem
- unless
- ( Vector.null
- (Backend.supportedPropositionSupport
- claim)
- && Backend.supportedPropositionTerm claim
- == frozenCoreTerm checkedTarget
- )
- (Left TransitionTypedVampireTargetMismatch)
- unless
- (Provers.acceptedVampireRequest accepted
- == Provers.preparedTypedProverRequest
- preparedTask)
- (Left TransitionTypedVampireRequestMismatch)
- unless
- (Vector.null
- (Backend.typedProblemLocalPremises
- problem))
- (Left TransitionTypedVampireHasOpenLocalPremises)
- traverse_
- validateGlobalType
- (Map.toList
- (Backend.typedProblemGlobalTypes
- problem))
- validatedPremises <-
- traverse
- validateSelectedFact
- (Backend.typedProblemGlobalPremises
- problem)
- foundationTrust <-
- foldM
- (\tags auxiliary ->
- (tags <>)
- <$> validateFoundationAuxiliary
- auxiliary)
- mempty
- (Backend.typedProblemAuxiliaries
- problem)
- let imports =
- fst <$> validatedPremises
- premiseTrust =
- foldMap snd validatedPremises
- case BackendReconstruction.attemptVampireReconstruction
- reconstructionPolicy
- preparedTask
- accepted of
- BackendReconstruction.ReconstructionSucceeded
- reconstructed ->
- commitReconstructed
- reconstructionPolicy
- semantic
- premiseTrust
- foundationTrust
- imports
- checkedTarget
- reconstructed
- BackendReconstruction.ReconstructionUnsupported
- unsupported ->
- commitTrusted
- semantic
- premiseTrust
- foundationTrust
- (ReconstructionFallbackUnsupported
- unsupported)
- BackendReconstruction.ReconstructionUnavailable
- searchStats ->
- commitTrusted
- semantic
- premiseTrust
- foundationTrust
- (ReconstructionFallbackUnavailable
- searchStats)
- BackendReconstruction.ReconstructionExhausted
- exhaustion
- searchStats ->
- commitTrusted
- semantic
- premiseTrust
- foundationTrust
- (ReconstructionFallbackSearchExhausted
- exhaustion
- searchStats)
- BackendReconstruction.ReconstructionDefinitiveMismatch
- mismatch ->
- Left
- (TransitionTypedReconstructionMismatch
- mismatch)
- where
- commitReconstructed
- policy
- semantic
- premiseTrust
- foundationTrust
- imports
- checkedTarget
- reconstructed = do
- let connectionReplay =
- BackendReconstruction.reconstructedConnectionReplay
- reconstructed
- provenance =
- SessionTypedReconstructionProvenance
- policy
- (Provers.preparedTypedProverTptpProblem
- (BackendReconstruction.reconstructedPreparedTask
- reconstructed))
- (BackendReconstruction.reconstructedAcceptedRun
- reconstructed)
- (BackendReconstruction.reconstructedConnectionTrace
- reconstructed)
- (BackendReconstruction.reconstructedSearchStats
- reconstructed)
- (BackendConnection.replayedConnectionNodeCount
- connectionReplay)
- (BackendConnection.replayedConnectionMaximumDepth
- connectionReplay)
- case authorizeTransitionKernelFactWithImportsAndProvenance
- (BackendReconstruction.reconstructionPolicyKernelReplayLimits
- policy)
- (Just provenance)
- imports
- checkedTarget
- (BackendConnection.replayedConnectionDerivation
- connectionReplay)
- builder of
- Left
- (TransitionKernelReplayError replayError)
- | isKernelReplayExhaustion replayError ->
- commitTrusted
- semantic
- premiseTrust
- foundationTrust
- (ReconstructionFallbackKernelReplayExhausted
- replayError)
- Left transitionError ->
- Left transitionError
- Right admitted ->
- insertTransitionTypedFact
- aliases
- factOrigin
- admitted
- builder
-
- commitTrusted
- semantic
- premiseTrust
- foundationTrust
- fallbackReason = do
- factReference <-
- nextTransitionTypedFactReference builder
- let trust =
- premiseTrust
- <> mempty
- { typedTrustedVampireUses =
- Set.singleton
- (SessionTypedTrustedVampireUse
- factReference)
- , typedVampireLoweringUses =
- mandatoryVampireLoweringAssumptions
- , typedFoundationUses =
- foundationTrust
- }
- admitted =
- TypedAdmittedFact
- semantic
- (TrustedVampire
- (SessionTypedTrustedVampireEvidence
- factReference
- (typedSemanticStatement semantic)
- (Provers.preparedTypedProverTptpProblem
- preparedTask)
- accepted
- trust
- (SessionTypedReconstructionFallback
- reconstructionPolicy
- fallbackReason)))
- insertTransitionTypedFact
- aliases
- factOrigin
- admitted
- builder
-
- isKernelReplayExhaustion = \case
- KernelReplayNodeLimitExceeded{} ->
- True
- KernelReplayDepthLimitExceeded{} ->
- True
- _ ->
- False
-
- validateGlobalType (global, reportedType) = do
- authoritativeType <-
- validateBuilderGlobalReference
- builder
- global
- unless
- (authoritativeType == reportedType)
- (Left
- (TransitionTypedVampireGlobalTypeMismatch
- global
- reportedType))
-
- validateSelectedFact selected =
- case lookupBuilderFact reference builder of
- Nothing ->
- Left
- (TransitionTypedVampireFactNotVisible
- reference)
- Just
- (TransitionFactEntry
- LegacyFactRow{}
- _registration) ->
- Left
- (TransitionDependencyNotMigrated
- reference)
- Just
- (TransitionFactEntry
- (TypedFactRow
- rowReference
- admitted)
- _registration) -> do
- semantic <-
- prepareTypedSemanticFact
- builder
- (typedAdmittedStatement
- admitted)
- let selectedProposition =
- Backend.typedBackendFactProposition
- selected
- selectedCapability =
- Backend.typedBackendFactCapability
- selected
- unless
- ( rowReference == reference
- && frozenCoreTerm
- (typedSemanticStatement
- semantic)
- == Backend.supportedPropositionTerm
- selectedProposition
- && typedSemanticFofCapability
- semantic
- == selectedCapability
- )
- (Left
- (TransitionTypedVampireFactMismatch
- reference))
- typedImport <-
- transitionDerivationImport
- reference
- (typedSemanticStatement
- semantic)
- pure
- ( typedImport
- , typedAdmittedTrustDependencies
- admitted
- )
- where
- reference =
- Backend.typedBackendFactReference
- selected
-
- validateFoundationAuxiliary auxiliary = do
- let tag =
- Backend.typedProblemAuxiliaryTag
- auxiliary
- actual =
- Backend.supportedPropositionTerm
- (Backend.typedProblemAuxiliaryProposition
- auxiliary)
- expected =
- frozenCoreTerm
- (mapFrozenGlobals
- absurd
- (foundationAxiomFrozen
- (builderFoundation builder)
- tag))
- unless
- (actual == expected)
- (Left
- (TransitionTypedVampireFoundationMismatch
- tag))
- pure (Set.singleton tag)
-
-nextTransitionTypedFactReference
- :: TransitionModuleBuilder
- -> Either TransitionModuleError FactRef
-nextTransitionTypedFactReference builder = do
- void
- (maybe
- (Left TransitionDeclarationNotOpen)
- Right
- (transitionCurrentDeclarationReference builder))
- let ordinal =
- builderNextTypedFact builder
- pure
- (FactRef
- (builderName builder)
- (localFactOrdinal ordinal))
-
-commitTransitionTypedDeclaredAssumption
- :: NonEmpty Marker
- -> Origin
- -> AssumptionKind
- -> FrozenCheckedCore CheckedGlobalRef
- -> TransitionModuleBuilder
- -> Either TransitionModuleError TransitionModuleBuilder
-commitTransitionTypedDeclaredAssumption
- aliases
- factOrigin
- kind
- statement
- builder = do
- semantic <-
- prepareTypedSemanticFact builder statement
- factReference <-
- nextTransitionTypedFactReference builder
- let checkedStatement =
- typedSemanticStatement semantic
- assumptionOrdinal =
- LocalAssumptionOrdinal
- (builderNextTypedAssumption builder)
- manifestEntry =
- TypedDirectAxiomManifestEntry
- factReference
- kind
- checkedStatement
- sessionReference =
- SessionTypedDeclaredAssumptionRef
- factReference
- assumptionOrdinal
- kind
- checkedStatement
- admitted =
- TypedAdmittedFact
- semantic
- (DeclaredAssumption
- sessionReference)
- builder' <-
- insertTransitionTypedFact
- aliases
- factOrigin
- admitted
- builder
- pure
- builder'
- { builderTypedDirectAxiomManifestReversed =
- manifestEntry
- : builderTypedDirectAxiomManifestReversed
- builder'
- , builderNextTypedAssumption =
- builderNextTypedAssumption builder + 1
- }
-
-transitionBuilderWithLegacyStage
- :: LegacyModuleStage
- -> TransitionModuleBuilder
- -> Either TransitionModuleError TransitionModuleBuilder
-transitionBuilderWithLegacyStage newStage builder
- | legacyStageSourceAddress newStage
- /= legacyStageSourceAddress
- (builderLegacyStage builder) =
- Left TransitionLegacyStageAddressMismatch
- | Vector.take oldCount newFacts /= oldFacts =
- Left TransitionLegacyStageIsNotAnExtension
- | otherwise = do
- (reversedFacts, inventory) <-
- foldM
- appendLegacyEntry
- ( builderLocalFactsReversed builder
- , builderFactInventory builder
- )
- (Vector.toList
- (Vector.drop oldCount newFacts))
- Right
- builder
- { builderLegacyStage = newStage
- , builderLocalFactsReversed =
- reversedFacts
- , builderFactInventory = inventory
- }
- where
- oldFacts =
- legacyStageLocalFacts
- (builderLegacyStage builder)
- oldCount =
- Vector.length oldFacts
- newFacts =
- legacyStageLocalFacts newStage
-
- appendLegacyEntry (reversedFacts, inventory) legacyEntry = do
- let staged =
- legacyFactEntryStagedFact legacyEntry
- reference =
- TransitionLegacyFactRef
- (legacyFactEntryReference
- legacyEntry)
- factOrigin =
- originFromLegacyStagedFact staged
- entry =
- TransitionFactEntry
- (LegacyFactRow
- reference
- (legacyFactEntryAdmittedFact
- legacyEntry))
- (TransitionFactRegistration
- (Facts.stagedFactAliases staged)
- factOrigin)
- inventory' <-
- insertTransitionFactEntry
- entry
- inventory
- pure (entry : reversedFacts, inventory')
-
-lookupTransitionGlobal
- :: Symbol
- -> TransitionModuleBuilder
- -> Maybe CheckedGlobalRef
-lookupTransitionGlobal symbol builder =
- bindingReference
- <$> Map.lookup symbol (builderGlobals builder)
- where
- bindingReference
- (TypedGlobalBinding
- _symbol
- reference
- _origin
- _body) =
- reference
-
-lookupTransitionGlobalBody
- :: Symbol
- -> TransitionModuleBuilder
- -> Maybe (FrozenCheckedCore CheckedGlobalRef)
-lookupTransitionGlobalBody symbol builder = do
- TypedGlobalBinding
- _bindingSymbol
- _reference
- _origin
- body <-
- Map.lookup symbol (builderGlobals builder)
- body
-
-
-data TransitionAdmittedModule = TransitionAdmittedModule
- { admittedName :: !ModuleName
- , admittedLegacyModule :: !LegacyAdmittedModule
- , admittedEnvironmentDeltas
- :: !(Vector TypedModuleEnvironmentDelta)
- , admittedLocalGlobals :: !(Vector TypedGlobalBinding)
- , admittedVisibleFacts :: !(Vector TransitionFactEntry)
- , admittedTypedDirectAxiomManifest
- :: !(Vector TypedDirectAxiomManifestEntry)
- }
-
-sealTransitionModule
- :: LegacyCheckingEnvironment
- -> TransitionModuleBuilder
- -> Either TransitionModuleError TransitionAdmittedModule
-sealTransitionModule finalEnvironment builder = do
- legacyAdmitted <-
- first TransitionLegacyModuleError
- (sealLegacyModuleStage
- finalEnvironment
- (builderLegacyStage builder))
- let localBindings =
- Vector.fromList
- (reverse
- (builderLocalGlobalsReversed
- builder))
- localDelta =
- TypedModuleEnvironmentDelta
- (builderName builder)
- localBindings
- localFacts =
- Vector.fromList
- (reverse
- (builderLocalFactsReversed
- builder))
- visibleFacts =
- builderVisibleFacts builder
- typedManifest =
- Vector.fromList
- (reverse
- (builderTypedDirectAxiomManifestReversed
- builder))
- actualLegacyReferences =
- [ reference
- | TransitionFactEntry
- (LegacyFactRow
- (TransitionLegacyFactRef reference)
- _admitted)
- _registration <-
- Vector.toList localFacts
- ]
- expectedLegacyReferences =
- legacyFactEntryReference
- <$> Vector.toList
- (legacyAdmittedLocalFacts
- legacyAdmitted)
- unless
- (actualLegacyReferences
- == expectedLegacyReferences)
- (Left TransitionLegacyFactOrderMismatch)
- validateTypedDirectAxiomManifest
- localFacts
- typedManifest
- pure
- TransitionAdmittedModule
- { admittedName = builderName builder
- , admittedLegacyModule = legacyAdmitted
- , admittedEnvironmentDeltas =
- Vector.snoc
- (builderEnvironmentDeltas builder)
- localDelta
- , admittedLocalGlobals = localBindings
- , admittedVisibleFacts = visibleFacts
- , admittedTypedDirectAxiomManifest =
- typedManifest
- }
-
-transitionAdmittedName
- :: TransitionAdmittedModule
- -> ModuleName
-transitionAdmittedName =
- admittedName
-
-transitionAdmittedLegacyModule
- :: TransitionAdmittedModule
- -> LegacyAdmittedModule
-transitionAdmittedLegacyModule =
- admittedLegacyModule
-
-transitionAdmittedFacts
- :: TransitionAdmittedModule
- -> Vector AdmittedFact
-transitionAdmittedFacts =
- fmap entryFact . admittedVisibleFacts
- where
- entryFact
- (TransitionFactEntry fact _registration) =
- fact
-
-transitionAdmittedKernelProofCount
- :: TransitionAdmittedModule
- -> Int
-transitionAdmittedKernelProofCount =
- Vector.length
- . Vector.filter admittedFactIsKernelProof
- . transitionAdmittedFacts
-
-transitionAdmittedTypedTrustedVampireCount
- :: TransitionAdmittedModule
- -> Int
-transitionAdmittedTypedTrustedVampireCount =
- Vector.length
- . Vector.filter admittedFactIsTrustedVampire
- . transitionAdmittedFacts
-
--- | Replay work retained by the admitted root module's visible fact closure.
-data TransitionReplayMeasurements =
- TransitionReplayMeasurements
- { transitionKernelReplayCount :: !Int
- , transitionKernelReplayNodeCount :: !Natural
- , transitionKernelReplayMaximumDepth :: !Natural
- , transitionReconstructionCount :: !Int
- , transitionReconstructionSearchWork :: !Natural
- , transitionReconstructionDerivedAtomCount :: !Natural
- , transitionReconstructionMaximumCandidateDepth :: !Natural
- , transitionConnectionReplayNodeCount :: !Natural
- , transitionConnectionReplayMaximumDepth :: !Natural
- }
- deriving stock (Show, Eq)
-
-transitionAdmittedReplayMeasurements
- :: TransitionAdmittedModule
- -> TransitionReplayMeasurements
-transitionAdmittedReplayMeasurements =
- Vector.foldl'
- combineReplayMeasurements
- emptyReplayMeasurements
- . transitionAdmittedFacts
-
-emptyReplayMeasurements :: TransitionReplayMeasurements
-emptyReplayMeasurements =
- TransitionReplayMeasurements
- { transitionKernelReplayCount = 0
- , transitionKernelReplayNodeCount = 0
- , transitionKernelReplayMaximumDepth = 0
- , transitionReconstructionCount = 0
- , transitionReconstructionSearchWork = 0
- , transitionReconstructionDerivedAtomCount = 0
- , transitionReconstructionMaximumCandidateDepth = 0
- , transitionConnectionReplayNodeCount = 0
- , transitionConnectionReplayMaximumDepth = 0
- }
-
-combineReplayMeasurements
- :: TransitionReplayMeasurements
- -> AdmittedFact
- -> TransitionReplayMeasurements
-combineReplayMeasurements measurements = \case
- LegacyFactRow{} ->
- measurements
- TypedFactRow _reference
- (TypedAdmittedFact _semantic authorization) ->
- case authorization of
- KernelProof
- (AuthorizedKernelReplay
- _target
- _imports
- _foundation
- _rules
- nodes
- depth
- provenance)
- _trust ->
- combineReconstructionMeasurements
- provenance
- measurements
- { transitionKernelReplayCount =
- transitionKernelReplayCount measurements
- + 1
- , transitionKernelReplayNodeCount =
- transitionKernelReplayNodeCount measurements
- + nodes
- , transitionKernelReplayMaximumDepth =
- max
- (transitionKernelReplayMaximumDepth
- measurements)
- depth
- }
- DeclaredAssumption{} ->
- measurements
- TrustedVampire{} ->
- measurements
-
-combineReconstructionMeasurements
- :: Maybe SessionTypedReconstructionProvenance
- -> TransitionReplayMeasurements
- -> TransitionReplayMeasurements
-combineReconstructionMeasurements Nothing measurements =
- measurements
-combineReconstructionMeasurements
- (Just
- (SessionTypedReconstructionProvenance
- _policy
- _prepared
- _accepted
- _trace
- searchStats
- replayNodes
- replayDepth))
- measurements =
- measurements
- { transitionReconstructionCount =
- transitionReconstructionCount measurements
- + 1
- , transitionReconstructionSearchWork =
- transitionReconstructionSearchWork measurements
- + BackendConnection.connectionSearchWork searchStats
- , transitionReconstructionDerivedAtomCount =
- transitionReconstructionDerivedAtomCount measurements
- + BackendConnection.connectionSearchDerivedAtomCount
- searchStats
- , transitionReconstructionMaximumCandidateDepth =
- max
- (transitionReconstructionMaximumCandidateDepth
- measurements)
- (BackendConnection.connectionSearchMaximumCandidateDepth
- searchStats)
- , transitionConnectionReplayNodeCount =
- transitionConnectionReplayNodeCount measurements
- + replayNodes
- , transitionConnectionReplayMaximumDepth =
- max
- (transitionConnectionReplayMaximumDepth
- measurements)
- replayDepth
- }
-
-transitionAdmittedTypedDirectAxiomManifest
- :: TransitionAdmittedModule
- -> Vector TypedDirectAxiomManifestEntry
-transitionAdmittedTypedDirectAxiomManifest =
- admittedTypedDirectAxiomManifest
-
-transitionAdmittedTypedTrustDependencies
- :: TransitionAdmittedModule
- -> TypedTrustDependencies
-transitionAdmittedTypedTrustDependencies =
- foldMap
- (fromMaybe mempty
- . admittedFactTypedTrustDependencies)
- . transitionAdmittedFacts
-
-transitionAdmittedGlobals
- :: TransitionAdmittedModule
- -> Vector (Symbol, CheckedGlobalRef, Origin)
-transitionAdmittedGlobals admitted =
- fmap
- (\(TypedGlobalBinding
- symbol
- reference
- bindingOrigin
- _body) ->
- (symbol, reference, bindingOrigin))
- (admittedLocalGlobals admitted)
-
-validateTypedDirectAxiomManifest
- :: Vector TransitionFactEntry
- -> Vector TypedDirectAxiomManifestEntry
- -> Either TransitionModuleError ()
-validateTypedDirectAxiomManifest localFacts manifest =
- unless
- (actual == expected)
- (Left TransitionTypedDirectAxiomManifestMismatch)
- where
- actual =
- [ ( reference
- , ordinal
- , kind
- , statement
- )
- | TransitionFactEntry
- (TypedFactRow
- (TransitionTypedFactRef reference)
- (TypedAdmittedFact
- semantic
- (DeclaredAssumption
- sessionReference)))
- _registration <-
- Vector.toList localFacts
- , let ordinal =
- sessionTypedAssumptionOrdinal
- sessionReference
- kind =
- sessionTypedAssumptionKind
- sessionReference
- statement =
- typedSemanticStatement semantic
- , sessionTypedAssumptionFact sessionReference
- == reference
- , sessionTypedAssumptionStatement sessionReference
- == statement
- ]
- expected =
- [ ( typedDirectAssumptionFact entry
- , LocalAssumptionOrdinal ordinal
- , typedDirectAssumptionKind entry
- , typedDirectAssumptionStatement entry
- )
- | (ordinal, entry) <-
- zip [0 ..] (Vector.toList manifest)
- ]
-
-insertVisibleGlobalBinding
- :: ( Map Symbol TypedGlobalBinding
- , Map OpaqueDeclarationRef TypedGlobalBinding
- )
- -> TypedGlobalBinding
- -> Either
- TransitionModuleError
- ( Map Symbol TypedGlobalBinding
- , Map OpaqueDeclarationRef TypedGlobalBinding
- )
-insertVisibleGlobalBinding
- (globals, declarations)
- binding@(TypedGlobalBinding
- symbol
- reference
- _bindingOrigin
- _body) = do
- globals' <-
- case Map.lookup symbol globals of
- Nothing ->
- Right (Map.insert symbol binding globals)
- Just previous@(TypedGlobalBinding
- _previousSymbol
- _previousReference
- _previousOrigin
- _previousBody)
- | previous == binding ->
- Right globals
- | otherwise ->
- Left
- (globalSymbolConflict
- previous
- binding)
- declarations' <-
- case Map.lookup declaration declarations of
- Nothing ->
- Right
- (Map.insert
- declaration
- binding
- declarations)
- Just previous
- | previous == binding ->
- Right declarations
- | otherwise ->
- Left
- (globalReferenceConflict
- previous
- binding)
- pure (globals', declarations')
- where
- declaration =
- checkedGlobalReference reference
-
-globalSymbolConflict
- :: TypedGlobalBinding
- -> TypedGlobalBinding
- -> TransitionModuleError
-globalSymbolConflict
- (TypedGlobalBinding
- previousSymbol
- previousReference
- previousOrigin
- _previousBody)
- (TypedGlobalBinding
- _incomingSymbol
- incomingReference
- incomingOrigin
- _incomingBody) =
- TransitionGlobalConflict
- previousSymbol
- previousReference
- previousOrigin
- incomingReference
- incomingOrigin
-
-globalReferenceConflict
- :: TypedGlobalBinding
- -> TypedGlobalBinding
- -> TransitionModuleError
-globalReferenceConflict
- (TypedGlobalBinding
- previousSymbol
- previousReference
- previousOrigin
- _previousBody)
- (TypedGlobalBinding
- incomingSymbol
- incomingReference
- incomingOrigin
- _incomingBody) =
- TransitionGlobalReferenceConflict
- (checkedGlobalReference incomingReference)
- previousSymbol
- (checkedGlobalType previousReference)
- previousOrigin
- incomingSymbol
- (checkedGlobalType incomingReference)
- incomingOrigin
-
-
-mergeTypedEnvironments
- :: [TransitionAdmittedModule]
- -> Either
- TransitionModuleError
- ( Vector TypedModuleEnvironmentDelta
- , Map Symbol TypedGlobalBinding
- , Map OpaqueDeclarationRef TypedGlobalBinding
- )
-mergeTypedEnvironments directImports = do
- (_deltasByModule, reversedDeltas) <-
- foldM
- importModule
- (Map.empty, [])
- directImports
- (globals, globalDeclarations) <-
- foldM
- applyDelta
- (Map.empty, Map.empty)
- (reverse reversedDeltas)
- pure
- ( Vector.fromList (reverse reversedDeltas)
- , globals
- , globalDeclarations
- )
- where
- importModule imported admitted =
- foldM
- importDelta
- imported
- (moduleEnvironmentDeltas admitted)
-
- moduleEnvironmentDeltas
- admitted =
- toList (admittedEnvironmentDeltas admitted)
-
- importDelta
- current@(byModule, reversedDeltas)
- delta@(TypedModuleEnvironmentDelta name _bindings) =
- case Map.lookup name byModule of
- Nothing ->
- Right
- ( Map.insert name delta byModule
- , delta : reversedDeltas
- )
- Just previous
- | previous == delta ->
- Right current
- | otherwise ->
- Left
- (TransitionImportedModuleConflict
- name)
-
- applyDelta environment
- (TypedModuleEnvironmentDelta _name bindings) =
- foldM insertVisibleGlobalBinding environment bindings
-
-mergeTransitionFacts
- :: [TransitionAdmittedModule]
- -> Either
- TransitionModuleError
- TransitionFactInventory
-mergeTransitionFacts =
- foldM importModule emptyTransitionFactInventory
- where
- importModule inventory admitted =
- foldM
- (flip insertTransitionFactEntry)
- inventory
- (Vector.toList
- (admittedVisibleFacts admitted))
-
-insertFactAliases
- :: TransitionFactRef
- -> Origin
- -> NonEmpty Marker
- -> Map Marker (TransitionFactRef, Origin)
- -> Either
- TransitionModuleError
- (Map Marker (TransitionFactRef, Origin))
-insertFactAliases reference factOrigin aliases initial =
- foldM insertAlias initial aliases
- where
- insertAlias current alias =
- case Map.lookup alias current of
- Nothing ->
- Right
- (Map.insert
- alias
- (reference, factOrigin)
- current)
- Just (previousReference, previousOrigin)
- | previousReference == reference ->
- Right current
- | otherwise ->
- Left
- (TransitionFactAliasConflict
- alias
- previousReference
- previousOrigin
- reference
- factOrigin)
-
-originFromLegacyStagedFact
- :: Facts.StagedFact
- -> Origin
-originFromLegacyStagedFact staged =
- Origin
- (Facts.factOriginLocation factOrigin)
- Nothing
- (Just (Facts.factOriginBlock factOrigin))
- where
- factOrigin =
- Facts.stagedFactOrigin staged
-
-
-data TransitionModuleError
- = TransitionLegacyModuleError
- !LegacyModuleStageError
- | TransitionLegacyStageAddressMismatch
- | TransitionLegacyStageIsNotAnExtension
- | TransitionLegacyFactOrderMismatch
- | TransitionDeclarationNotOpen
- | TransitionImportedModuleConflict
- !ModuleName
- | TransitionGlobalConflict
- !Symbol
- !CheckedGlobalRef
- !Origin
- !CheckedGlobalRef
- !Origin
- | TransitionGlobalReferenceConflict
- !OpaqueDeclarationRef
- !Symbol
- !CoreType
- !Origin
- !Symbol
- !CoreType
- !Origin
- | TransitionGlobalReferenceNotVisible
- !CheckedGlobalRef
- | TransitionGlobalReferenceTypeMismatch
- !CheckedGlobalRef
- !CoreType
- | TransitionCoreCheckError
- !CoreCheckError
- | TransitionTransparentGlobalTypeMismatch
- !Symbol
- !CoreType
- !CoreType
- | TransitionTypedFactIsNotProposition
- !CoreType
- | TransitionTypedFactSupportError
- !(Backend.SupportedPropositionError Void)
- | TransitionTypedFactClassificationError
- !(Backend.BackendClassificationError
- CheckedGlobalRef)
- | TransitionTypedVampireTargetMismatch
- | TransitionTypedVampireRequestMismatch
- | TransitionTypedVampireHasOpenLocalPremises
- | TransitionTypedVampireGlobalTypeMismatch
- !CheckedGlobalRef
- !CoreType
- | TransitionTypedVampireFactNotVisible
- !TransitionFactRef
- | TransitionTypedVampireFactMismatch
- !TransitionFactRef
- | TransitionTypedVampireFoundationMismatch
- !FoundationAxiomTag
- | TransitionTypedReconstructionMismatch
- !BackendReconstruction.ReconstructionMismatch
- | TransitionKernelTargetMismatch
- | TransitionKernelReplayError
- !KernelReplayError
- | TransitionDerivationImportError
- !DerivationImportError
- | TransitionKernelImportIndexOutOfBounds
- !ImportIx
- | TransitionKernelImportNotVisible
- !TransitionFactRef
- | TransitionKernelImportDoesNotMatch
- !TransitionFactRef
- | TransitionDependencyNotMigrated
- !TransitionFactRef
- | TransitionTypedDirectAxiomManifestMismatch
- | TransitionFactReferenceConflict
- !TransitionFactRef
- | TransitionFactAliasConflict
- !Marker
- !TransitionFactRef
- !Origin
- !TransitionFactRef
- !Origin
- deriving stock (Show, Eq)
diff --git a/source/Checking/Typed/Atomic.hs b/source/Checking/Typed/Atomic.hs
deleted file mode 100644
index 449928f..0000000
--- a/source/Checking/Typed/Atomic.hs
+++ /dev/null
@@ -1,72 +0,0 @@
-{-# LANGUAGE DerivingStrategies #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-
--- | Closed applications of checked predicate signatures to ground sets.
-module Checking.Typed.Atomic
- ( PreparedClosedAtomic
- , prepareClosedAtomic
- , closedAtomicStatement
- , ClosedAtomicError(..)
- ) where
-
-import Base
-import Checking.Core
-import Checking.Transition
-import Checking.Typed.Ground
-import Syntax.Internal
-
-import Data.Bifunctor (first)
-
-
-newtype PreparedClosedAtomic =
- PreparedClosedAtomic
- (FrozenCheckedCore CheckedGlobalRef)
-
-closedAtomicStatement
- :: PreparedClosedAtomic
- -> FrozenCheckedCore CheckedGlobalRef
-closedAtomicStatement
- (PreparedClosedAtomic statement) =
- statement
-
-data ClosedAtomicError
- = ClosedAtomicIllTyped !CoreCheckError
- | ClosedAtomicFreezeFailed !FreezeError
- deriving stock (Show, Eq)
-
--- | Return 'Nothing' outside this deliberately small typed family. Once a
--- checked predicate global and ground arguments match, formation is total or
--- reports its typed-core failure.
-prepareClosedAtomic
- :: (Symbol -> Maybe CheckedGlobalRef)
- -> Formula
- -> Maybe
- (Either
- ClosedAtomicError
- PreparedClosedAtomic)
-prepareClosedAtomic resolveGlobal = \case
- Atomic _location predicate arguments -> do
- reference <-
- resolveGlobal
- (SymbolPredicate predicate)
- loweredArguments <-
- traverse lowerGroundSetTerm arguments
- Just do
- checked <-
- first ClosedAtomicIllTyped
- (checkClosedProposition
- (Just . checkedGlobalType)
- (foldl'
- coreApply
- (coreGlobal reference)
- loweredArguments))
- statement <-
- first ClosedAtomicFreezeFailed
- (freezeClosed
- (checkedPropositionCore
- checked))
- pure
- (PreparedClosedAtomic
- statement)
- _ ->
- Nothing
diff --git a/source/Checking/Typed/Reflexivity.hs b/source/Checking/Typed/Reflexivity.hs
deleted file mode 100644
index f548727..0000000
--- a/source/Checking/Typed/Reflexivity.hs
+++ /dev/null
@@ -1,105 +0,0 @@
-{-# LANGUAGE DerivingStrategies #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-
--- | Dependency-free typed preparation for closed ground reflexivity.
-module Checking.Typed.Reflexivity
- ( PreparedGroundReflexivity
- , prepareGroundReflexivity
- , groundReflexivityTarget
- , groundReflexivityDerivation
- , GroundReflexivityError(..)
- ) where
-
-import Base hiding (Empty)
-import Checking.Core
-import Checking.Kernel.Derivation
-import Checking.Transition
-import Checking.Typed.Ground
-import Syntax.Internal
-
-import Data.Bifunctor (first)
-
-
-data PreparedGroundReflexivity =
- PreparedGroundReflexivity
- !(FrozenCheckedCore CheckedGlobalRef)
- !(KernelDerivation CheckedGlobalRef)
-
-groundReflexivityTarget
- :: PreparedGroundReflexivity
- -> FrozenCheckedCore CheckedGlobalRef
-groundReflexivityTarget
- (PreparedGroundReflexivity target _derivation) =
- target
-
-groundReflexivityDerivation
- :: PreparedGroundReflexivity
- -> KernelDerivation CheckedGlobalRef
-groundReflexivityDerivation
- (PreparedGroundReflexivity _target derivation) =
- derivation
-
-data GroundReflexivityError
- = GroundReflexivityOperandIllTyped !CoreCheckError
- | GroundReflexivityOperandFreezeFailed !FreezeError
- | GroundReflexivityTargetIllTyped !CoreCheckError
- | GroundReflexivityTargetFreezeFailed !FreezeError
- deriving stock (Show, Eq)
-
--- | Return 'Nothing' when the formula is outside this intentionally small
--- typed family. A recognized formula either prepares completely or reports its
--- checked-core failure.
-prepareGroundReflexivity
- :: Formula
- -> Maybe
- (Either
- GroundReflexivityError
- PreparedGroundReflexivity)
-prepareGroundReflexivity = \case
- Equals _location left right -> do
- guard (equivalent left right)
- leftSyntax <- lowerGroundSetTerm left
- Just do
- leftFrozen <-
- checkAndFreezeOperand leftSyntax
- target <-
- checkAndFreezeTarget
- leftSyntax
- leftSyntax
- pure
- (PreparedGroundReflexivity
- target
- (equalityReflexivityDerivation
- leftFrozen))
- _ ->
- Nothing
-
-checkAndFreezeOperand
- :: CoreSyntax CheckedGlobalRef Void
- -> Either
- GroundReflexivityError
- (FrozenCheckedCore CheckedGlobalRef)
-checkAndFreezeOperand syntax = do
- checked <-
- first GroundReflexivityOperandIllTyped
- (checkClosedCore
- (Just . checkedGlobalType)
- syntax)
- first GroundReflexivityOperandFreezeFailed
- (freezeClosed checked)
-
-checkAndFreezeTarget
- :: CoreSyntax CheckedGlobalRef Void
- -> CoreSyntax CheckedGlobalRef Void
- -> Either
- GroundReflexivityError
- (FrozenCheckedCore CheckedGlobalRef)
-checkAndFreezeTarget left right = do
- checked <-
- first GroundReflexivityTargetIllTyped
- (checkClosedProposition
- (Just . checkedGlobalType)
- (coreEquality TySet left right))
- first GroundReflexivityTargetFreezeFailed
- (freezeClosed
- (checkedPropositionCore checked))
diff --git a/source/CommandLine.hs b/source/CommandLine.hs
index 69b893a..9e3e72c 100644
--- a/source/CommandLine.hs
+++ b/source/CommandLine.hs
@@ -5,7 +5,6 @@ module CommandLine where
import Api
import Base
-import Checking qualified
import Checking.Declaration qualified as Declaration
import Checking.Foundation qualified as Foundation
import Checking.Identity qualified as Identity
@@ -30,12 +29,14 @@ import Data.ByteString qualified as ByteString
import Data.Maybe (catMaybes)
import Data.Text qualified as StrictText
import Data.Text.IO qualified as Text
+import GHC.Conc qualified
import Options.Applicative hiding (renderFailure)
import System.Directory qualified as Directory
import System.Environment (getArgs, lookupEnv)
import System.Exit (ExitCode(..), exitWith)
import System.FilePath.Posix qualified as Posix
import System.IO (stderr)
+import Text.Read (readMaybe)
newtype Input = Input
@@ -52,6 +53,7 @@ data VerificationOptions = VerificationOptions
{ verificationStoreSelection :: !Store.StoreSelection
, verificationTimeLimit :: !Provers.TimeLimit
, verificationMemoryLimit :: !Provers.MemoryLimit
+ , verificationJobsOverride :: !(Maybe Provers.EffectiveJobs)
, verificationDumpDestination :: !(Maybe FilePath)
, verificationHtmlRequested :: !Bool
, verificationDiagnostics :: !VerificationDiagnostics
@@ -68,10 +70,16 @@ data CommandOutcome
= CommandCompleted
| VerificationSucceeded !VerificationReport
| VerificationCompletedWithGaps !VerificationReport
- | VerificationRejected !Location !VerificationRejection
- | ProverFailed !Location !ProverFailure
+ | VerificationRejected
+ !VerificationReport
+ !Location
+ !VerificationRejection
+ | ProverFailed !VerificationReport !Location !ProverFailure
+ | VerificationCheckingRejected
+ !VerificationReport
+ !VerificationDriverError
| SourcePlanningFailed !ParseWorkspaceError
- | ParseOnlyFailed !ParseWorkspaceError
+ | ParseOnlyFailed !AuthorityFreeParseError
| VerificationDriverFailed !VerificationDriverError
| StorePlanningFailed !Store.StorePlanningError
| StoreIncompatible !Store.StorePath !Store.StoreIncompatibility
@@ -79,9 +87,15 @@ data CommandOutcome
| OutputPlanningFailed !Output.OutputPlanError
| HtmlLayoutFailed !HtmlLayout.HtmlLayoutError
| DumpObservationFailed !DumpObservationError
- | HtmlExportFailed !HtmlExport.HtmlExportError
- | HtmlOutputPlanningFailed !HtmlOutput.HtmlOutputError
- | HtmlPublicationFailed !HtmlOutput.HtmlPublicationError
+ | HtmlExportFailed
+ !VerificationReport
+ !HtmlExport.HtmlExportError
+ | HtmlOutputPlanningFailed
+ !VerificationReport
+ !HtmlOutput.HtmlOutputError
+ | HtmlPublicationFailed
+ !VerificationReport
+ !HtmlOutput.HtmlPublicationError
deriving stock (Show)
data VerificationRejection
@@ -98,7 +112,7 @@ data ProverFailure
data DumpObservationError
= DumpDirectoryCreationFailed !FilePath !Text
| DumpRequestWriteFailed
- !VerificationRequestOrdinal
+ !WorkPosition
!FilePath
!Text
deriving stock (Show, Eq)
@@ -118,7 +132,7 @@ rawCommandParserInfo :: ParserInfo RawCommand
rawCommandParserInfo =
info
(helper <*> rawCommandParser)
- (fullDesc <> header "Naproche/ZF")
+ (fullDesc <> header "Felix")
runCommand :: Command -> IO CommandOutcome
runCommand = \case
@@ -271,22 +285,28 @@ runOpenVerification input options outputPlan store = do
WarmStoreValidation
Store.ExplicitStore{} ->
WarmStoreValidation
+ jobs <-
+ Provers.selectEffectiveJobs
+ (verificationJobsOverride options)
+ GHC.Conc.getNumProcessors
observed <-
captureDumpFailure
(case verificationDiagnostics options of
QuietVerification ->
runNoLoggingT
- (verifyWithObserverAndStoreMode
+ (verifyWithObserverAndStoreModeAndJobs
store
validationMode
+ jobs
observer
vampire
(inputFilePath input))
LogVerification ->
runStderrLoggingT
- (verifyWithObserverAndStoreMode
+ (verifyWithObserverAndStoreModeAndJobs
store
validationMode
+ jobs
observer
vampire
(inputFilePath input)))
@@ -297,7 +317,6 @@ runOpenVerification input options outputPlan store = do
pure (VerificationDriverFailed failure)
Right (Right result) ->
finishVerification
- input
outputPlan
result
@@ -331,14 +350,18 @@ prepareRequestObserver = \case
writeDumpRequest
:: FilePath
- -> VerificationRequestOrdinal
+ -> WorkPosition
-> Provers.PreparedVerificationRequest
-> IO ()
-writeDumpRequest root ordinal request = do
+writeDumpRequest root position request = do
let destination =
root
- Posix.</> show
- (verificationRequestOrdinalValue ordinal)
+ Posix.</> ( show
+ (workPositionModuleOrdinal position)
+ <> "-"
+ <> show
+ (workPositionLocalRequestOrdinal position)
+ )
Posix.<.> "p"
result <- tryIOError
(publishDumpFile
@@ -348,7 +371,7 @@ writeDumpRequest root ordinal request = do
Left failure ->
Exception.throwIO
(DumpRequestWriteFailed
- ordinal
+ position
destination
(StrictText.pack
(displayException failure)))
@@ -380,73 +403,86 @@ captureDumpFailure =
Exception.try
finishVerification
- :: Input
- -> Output.VerificationOutputPlan
+ :: Output.VerificationOutputPlan
-> VerificationResult
-> IO CommandOutcome
-finishVerification input outputPlan result =
+finishVerification outputPlan result =
case result of
VerificationFailure{} ->
pure (verificationCommandOutcome result)
- VerifiedWithTrustedVampire{} ->
- publishHtmlIfRequested input outputPlan result
- CompletedWithExplicitGaps{} ->
- publishHtmlIfRequested input outputPlan result
+ VerificationCheckingFailure{} ->
+ pure (verificationCommandOutcome result)
+ VerificationCompleted report presentation ->
+ publishHtmlIfRequested
+ outputPlan
+ report
+ presentation
+ (VerificationSucceeded report)
+ CompletedWithExplicitGaps report presentation ->
+ publishHtmlIfRequested
+ outputPlan
+ report
+ presentation
+ (VerificationCompletedWithGaps report)
publishHtmlIfRequested
- :: Input
- -> Output.VerificationOutputPlan
- -> VerificationResult
+ :: Output.VerificationOutputPlan
+ -> VerificationReport
+ -> VerificationPresentation
+ -> CommandOutcome
-> IO CommandOutcome
-publishHtmlIfRequested input outputPlan result =
+publishHtmlIfRequested outputPlan report presentation successOutcome =
case Output.verificationHtmlRoutes outputPlan of
Nothing ->
- pure (verificationCommandOutcome result)
+ pure successOutcome
Just routes -> do
prepared <-
- prepareHtmlExportResult
- (inputFilePath input)
+ prepareVerifiedHtmlExportResult presentation
case prepared of
Left failure ->
- pure (HtmlExportFailed failure)
- Right bundle ->
- case HtmlOutput.planHtmlOutputAgainst routes bundle of
+ pure (HtmlExportFailed report failure)
+ Right artifacts ->
+ case HtmlOutput.planHtmlOutputAgainst routes artifacts of
Left failure ->
- pure (HtmlOutputPlanningFailed failure)
+ pure (HtmlOutputPlanningFailed report failure)
Right plan ->
HtmlOutput.writeHtmlOutput plan >>= \case
Left failure ->
- pure (HtmlPublicationFailed failure)
+ pure (HtmlPublicationFailed report failure)
Right () ->
- pure
- (verificationCommandOutcome result)
+ pure successOutcome
verificationCommandOutcome :: VerificationResult -> CommandOutcome
verificationCommandOutcome = \case
- VerifiedWithTrustedVampire report ->
+ VerificationCompleted report _presentation ->
VerificationSucceeded report
- CompletedWithExplicitGaps report ->
+ CompletedWithExplicitGaps report _presentation ->
VerificationCompletedWithGaps report
VerificationFailure
+ report
FailedVerification
{ failedVerificationLocation = location
, failedVerificationReason = reason
} ->
case reason of
CountermodelFailure tptp ->
- VerificationRejected location (CountermodelFound tptp)
+ VerificationRejected
+ report location (CountermodelFound tptp)
ContradictoryInputFailure tptp ->
- VerificationRejected location (ContradictoryInputFound tptp)
+ VerificationRejected
+ report location (ContradictoryInputFound tptp)
IndeterminateFailure tptp ->
- ProverFailed location (ProverIndeterminate tptp)
+ ProverFailed report location (ProverIndeterminate tptp)
ProtocolFailure label message ->
ProverFailed
- location
+ report location
(ProverProtocolFailure label message)
TransportFailure processError ->
ProverFailed
- location
+ report location
(ProverTransportFailure processError)
+ VerificationCheckingFailure report failure ->
+ VerificationCheckingRejected report failure
commandOutcomeExitCode :: CommandOutcome -> ExitCode
commandOutcomeExitCode = \case
@@ -460,6 +496,8 @@ commandOutcomeExitCode = \case
ExitFailure 1
ProverFailed{} ->
ExitFailure 2
+ VerificationCheckingRejected{} ->
+ ExitFailure 1
SourcePlanningFailed{} ->
ExitFailure 1
ParseOnlyFailed{} ->
@@ -496,10 +534,15 @@ renderCommandOutcome = \case
Text.hPutStrLn stderr
"Verification completed with explicit proof gaps."
renderVerificationReport report
- VerificationRejected location rejection ->
+ VerificationRejected report location rejection -> do
renderVerificationRejection location rejection
- ProverFailed location failure ->
+ renderVerificationReport report
+ ProverFailed report location failure -> do
renderProverFailure location failure
+ renderVerificationReport report
+ VerificationCheckingRejected report failure -> do
+ renderVerificationDriverFailure failure
+ renderVerificationReport report
SourcePlanningFailed failure ->
renderFailure
("Source planning failed: "
@@ -507,7 +550,7 @@ renderCommandOutcome = \case
ParseOnlyFailed failure ->
renderFailure
("Parsing failed: "
- <> Parse.renderParseWorkspaceError failure)
+ <> renderAuthorityFreeParseError failure)
VerificationDriverFailed failure ->
renderVerificationDriverFailure failure
StorePlanningFailed failure ->
@@ -536,18 +579,23 @@ renderCommandOutcome = \case
<> HtmlLayout.renderHtmlLayoutError failure)
DumpObservationFailed failure ->
renderDumpObservationFailure failure
- HtmlExportFailed failure ->
+ HtmlExportFailed report failure -> do
renderFailure
- ("HTML preparation failed: "
+ ("Verification succeeded, but HTML preparation failed: "
<> HtmlExport.renderHtmlExportError failure)
- HtmlOutputPlanningFailed failure ->
+ renderVerificationReport report
+ HtmlOutputPlanningFailed report failure -> do
renderFailure
- ("Prepared HTML did not match the reserved routes: "
+ ("Verification succeeded, but prepared HTML did not match the reserved routes: "
<> HtmlOutput.renderHtmlOutputError failure)
- HtmlPublicationFailed failure ->
+ renderVerificationReport report
+ HtmlPublicationFailed report failure -> do
+ renderFailure
+ "Verification succeeded, but HTML publication did not complete."
traverse_
renderFailure
(HtmlOutput.renderHtmlPublicationError failure)
+ renderVerificationReport report
renderFailure :: Text -> IO ()
renderFailure =
@@ -566,14 +614,6 @@ verificationDriverFailureMessage = \case
VerificationWorkspaceError failure ->
"Verification input failed: "
<> Parse.renderParseWorkspaceError failure
- VerificationGlossError source failure ->
- "Verification elaboration failed in "
- <> resolvedSourceDisplay source <> ": "
- <> StrictText.pack (show failure)
- VerificationCheckingError source failure ->
- "Verification checking failed in "
- <> resolvedSourceDisplay source
- <> ": " <> Checking.renderCheckingError failure
VerificationTypedInputError source failure ->
"Typed module input failed in "
<> resolvedSourceDisplay source
@@ -594,6 +634,10 @@ verificationDriverFailureMessage = \case
"Typed module validation store is inconsistent in "
<> resolvedSourceDisplay source
<> ": " <> Declaration.renderValidationIntegrityError failure
+ VerificationAdmittedViewError source failure ->
+ "Typed admitted-source association is inconsistent in "
+ <> resolvedSourceDisplay source
+ <> ": " <> StrictText.pack (show failure)
VerificationParsedArtifactIntegrityError source failure ->
"Parsed artifact is inconsistent in "
<> resolvedSourceDisplay source
@@ -609,12 +653,8 @@ verificationDriverFailureMessage = \case
<> Store.renderStoreLifecycleError failure
VerificationModuleArtifactKeyError{} ->
"Typed module artifact inputs are inconsistent."
- VerificationObligationResolutionError{} ->
- "Verification obligation resolution was inconsistent."
- VerificationLegacyModuleError{} ->
- "Legacy module staging failed."
- VerificationTransitionModuleError{} ->
- "Transition module staging failed."
+ VerificationModuleSchedulerInvariant message ->
+ "Typed module scheduler invariant failed: " <> message
VerificationFoundationManifestError{} ->
"The fixed foundation manifest is invalid."
VerificationMissingImportedModule address ->
@@ -623,10 +663,6 @@ verificationDriverFailureMessage = \case
VerificationMissingRootModule address ->
"Verification could not find checked root module "
<> StrictText.pack (show address) <> "."
- VerificationMigrationManifestError{} ->
- "The verification migration manifest is invalid."
- VerificationMigrationRouteMismatch{} ->
- "The verification migration selection is not dependency-closed."
VerificationFinalPreludeReadinessError{} ->
"The packaged final prelude failed."
@@ -699,40 +735,39 @@ renderFailedTask tptp = do
renderVerificationReport :: VerificationReport -> IO ()
renderVerificationReport report = do
Text.hPutStrLn stderr
- ( "Authorization summary: "
- <> renderCount
- (verificationLegacyDeclaredAssumptionCount report)
- "legacy declared assumption"
- <> ", "
- <> renderCount
- (verificationTypedDeclaredAssumptionCount report)
- "typed declared assumption"
- <> ", "
+ ( "Direct source authorization summary: "
<> renderCount
- (verificationTrustedVampireCount report)
- "trusted Vampire obligation"
+ sourceAxiomCount
+ "source axiom"
<> ", "
<> renderCount
- (length
- (verificationExplicitGapLocations report))
+ omittedCount
"explicit proof gap"
- <> ", "
- <> renderCount
- (verificationTrustedLegacyRuleCount report)
- "trusted legacy declaration rule"
- <> ", "
- <> renderCount
- (verificationKernelProofCount report)
- "replayed kernel proof"
<> "."
)
for_
- (verificationExplicitGapLocations report)
- \location ->
- Text.hPutStrLn stderr
- ("Explicit proof gap at "
- <> locationToText location)
+ (verificationDirectEscapes report)
+ \escape ->
+ Text.hPutStrLn stderr case reportedEscapeKind escape of
+ ReportedSourceAxiom ->
+ "Source axiom at "
+ <> locationToText (reportedEscapeLocation escape)
+ ReportedOmitted ->
+ "Explicit proof gap at "
+ <> locationToText (reportedEscapeLocation escape)
where
+ sourceAxiomCount =
+ length
+ [ ()
+ | escape <- verificationDirectEscapes report
+ , reportedEscapeKind escape == ReportedSourceAxiom
+ ]
+ omittedCount =
+ length
+ [ ()
+ | escape <- verificationDirectEscapes report
+ , reportedEscapeKind escape == ReportedOmitted
+ ]
renderCount amount noun =
StrictText.pack (show amount)
<> " "
@@ -755,6 +790,7 @@ data RawFileCommand = RawFileCommand
, rawFresh :: !Bool
, rawTimeLimit :: !(Maybe Provers.TimeLimit)
, rawMemoryLimit :: !(Maybe Provers.MemoryLimit)
+ , rawJobs :: !(Maybe Provers.EffectiveJobs)
, rawDump :: !(Maybe FilePath)
, rawHtml :: !Bool
, rawLogging :: !Bool
@@ -794,6 +830,7 @@ rawFileCommandParser =
<> help "Use a fresh temporary disposable store.")
<*> optional timeLimitParser
<*> optional memoryLimitParser
+ <*> optional jobsParser
<*> optional
(strOption
(long "dump"
@@ -864,6 +901,7 @@ validateRawCommand = \case
fromMaybe
Provers.defaultMemoryLimit
(rawMemoryLimit raw)
+ , verificationJobsOverride = rawJobs raw
, verificationDumpDestination =
rawDump raw
, verificationHtmlRequested =
@@ -880,6 +918,7 @@ validateRawCommand = \case
, if rawFresh raw then Just "--fresh" else Nothing
, "--timelimit" <$ rawTimeLimit raw
, "--memlimit" <$ rawMemoryLimit raw
+ , "--jobs" <$ rawJobs raw
, "--dump" <$ rawDump raw
, if rawHtml raw then Just "--html" else Nothing
, if rawLogging raw then Just "--log" else Nothing
@@ -904,3 +943,18 @@ memoryLimitParser =
<> metavar "MB"
<> help "Memory limit for each Vampire process."
)
+
+jobsParser :: Parser Provers.EffectiveJobs
+jobsParser =
+ option
+ (eitherReader parseJobs)
+ ( long "jobs"
+ <> short 'j'
+ <> metavar "JOBS"
+ <> help "Run at most JOBS module checkers and Vampire processes."
+ )
+ where
+ parseJobs raw =
+ case readMaybe raw >>= Provers.effectiveJobs of
+ Just jobs -> Right jobs
+ Nothing -> Left "JOBS must be a positive integer"
diff --git a/source/Encoding.hs b/source/Encoding.hs
deleted file mode 100644
index fd988de..0000000
--- a/source/Encoding.hs
+++ /dev/null
@@ -1,588 +0,0 @@
-module Encoding
- ( PreparedTptpTask
- , prepareTptpTask
- , prepareTrainingTptpTask
- , preparedTptpSyntax
- , preparedTptpText
- , preparedTptpTextNewline
- , preparedTptpConjectureText
- , preparedTptpNameOrigins
- , encodeTask
- , encodeTaskText
- , writeTask
- , contractionTask
- ) where
-
-
-import Base
-import Syntax.Internal
-import Tptp.UnsortedFirstOrder qualified as Tptp
-
-import Bound
-import Control.Monad.State.Strict qualified as State
-import Data.List qualified as List
-import Data.Map.Strict qualified as Map
-import Data.Set qualified as Set
-import Data.Text qualified as Text
-import Data.Text.IO qualified as TextIO
-import TextBuilder
-
-
--- | The structural semantic keys available before nominal identities land.
-data LegacyTaskKey
- = LegacyObjectSymbolKey !Symbol
- | LegacyFreeConstantKey !VarSymbol
- | LegacyStructureSymbolKey !StructSymbol
- deriving (Show, Eq, Ord)
-
-newtype EncodingEnv = EncodingEnv
- { legacyTargetNames :: Map LegacyTaskKey Tptp.AtomicWord
- }
-
-data FormulaOccurrenceKey
- = ConjectureFormulaOccurrence
- | HypothesisFormulaOccurrence !Tptp.Role !Int
- deriving (Show, Eq, Ord)
-
-data TptpNameOrigin
- = LegacyTaskNameOrigin !LegacyTaskKey
- | BinderPositionOrigin !Int
- | FormulaOccurrenceOrigin !FormulaOccurrenceKey
- deriving (Show, Eq, Ord)
-
-data PreparedTptpTask = PreparedTptpTask
- { preparedTptpSyntax :: !Tptp.Task
- , preparedTptpText :: !Text
- , preparedTptpConjectureText :: !Text
- , _preparedTptpNameTable :: !EncodingEnv
- , preparedTptpReverseNames :: !(Map Text TptpNameOrigin)
- }
-
-preparedTptpTextNewline :: PreparedTptpTask -> Text
-preparedTptpTextNewline =
- (`Text.snoc` '\n') . preparedTptpText
-
--- | Target name to location-free semantic meaning.
-preparedTptpNameOrigins :: PreparedTptpTask -> Map Text Text
-preparedTptpNameOrigins =
- Map.map (Text.pack . show) . preparedTptpReverseNames
-
-data SelectedFormula = SelectedFormula
- { selectedFormulaRole :: !Tptp.Role
- , selectedFormulaBody :: !Formula
- }
-
-prepareTptpTask :: Task -> PreparedTptpTask
-prepareTptpTask task =
- prepareSelectedTptpTask
- (SelectedFormula Tptp.Conjecture (taskConjecture task))
- [ SelectedFormula
- Tptp.Axiom
- (contraction (hypothesisFormula hypothesis))
- | hypothesis <- taskHypotheses task
- ]
-
-prepareTrainingTptpTask
- :: Formula
- -> [Hypothesis]
- -> [Hypothesis]
- -> PreparedTptpTask
-prepareTrainingTptpTask conjecture usefuls redundants =
- prepareSelectedTptpTask
- (SelectedFormula Tptp.Conjecture conjecture)
- ( trainingFormulas Tptp.AxiomUseful usefuls
- <> trainingFormulas Tptp.AxiomRedundant redundants
- )
- where
- trainingFormulas role hypotheses =
- [ SelectedFormula role (contraction (hypothesisFormula hypothesis))
- | hypothesis <- hypotheses
- ]
-
-prepareSelectedTptpTask
- :: SelectedFormula
- -> [SelectedFormula]
- -> PreparedTptpTask
-prepareSelectedTptpTask conjecture hypotheses =
- let allFormulas = conjecture : hypotheses
- (encodingEnv, semanticReverseNames) =
- allocateLegacyNames
- (Set.unions
- (legacyFormulaKeys . selectedFormulaBody <$> allFormulas))
- orderedHypotheses =
- -- Hypothesis list order is not semantic. Equal lowered records stay
- -- duplicated.
- List.sortOn
- (\selected ->
- ( selectedFormulaRole selected
- , canonicalFormulaText encodingEnv selected
- ))
- hypotheses
- initialEncodingState =
- EncodingState
- { nextBinderPosition = 0
- , encodingReverseNames = semanticReverseNames
- }
- ((encodedConjecture, encodedHypotheses), finalEncodingState) =
- State.runState
- (do
- conjectureFormula <-
- encodeSelectedFormula
- encodingEnv
- (generatedAtomicWord "zf_q" 0)
- ConjectureFormulaOccurrence
- conjecture
- hypothesisFormulas <-
- for
- (zip [0..] orderedHypotheses)
- \(ordinal, selected) ->
- encodeSelectedFormula
- encodingEnv
- (generatedAtomicWord "zf_h" ordinal)
- (HypothesisFormulaOccurrence
- (selectedFormulaRole selected)
- ordinal)
- selected
- pure (conjectureFormula, hypothesisFormulas))
- initialEncodingState
- syntax = Tptp.Task (encodedConjecture : encodedHypotheses)
- in
- PreparedTptpTask
- { preparedTptpSyntax = syntax
- , preparedTptpText = Tptp.toText syntax
- , preparedTptpConjectureText =
- Tptp.toText (Tptp.Task [encodedConjecture])
- , _preparedTptpNameTable = encodingEnv
- , preparedTptpReverseNames =
- encodingReverseNames finalEncodingState
- }
-
-encodeTask :: Task -> Tptp.Task
-encodeTask = preparedTptpSyntax . prepareTptpTask
-
-encodeTaskText :: Task -> Text
-encodeTaskText = preparedTptpText . prepareTptpTask
-
-writeTask :: Handle -> Task -> IO ()
-writeTask handle =
- TextIO.hPutStr handle . preparedTptpTextNewline . prepareTptpTask
-
--- | Boolean contraction of a task.
-contractionTask :: Task -> Task
-contractionTask task = task
- { taskConjecture = contraction (taskConjecture task)
- }
-
-allocateLegacyNames
- :: Set LegacyTaskKey
- -> (EncodingEnv, Map Text TptpNameOrigin)
-allocateLegacyNames keys =
- let orderedKeys = Set.toAscList keys
- objectKeys =
- [ key
- | key@LegacyObjectSymbolKey{} <- orderedKeys
- ]
- freeConstantKeys =
- [ key
- | key@LegacyFreeConstantKey{} <- orderedKeys
- ]
- structureKeys =
- [ key
- | key@LegacyStructureSymbolKey{} <- orderedKeys
- ]
- allocations =
- allocateCategory "zf_u" objectKeys
- <> allocateCategory "zf_f" freeConstantKeys
- <> allocateCategory "zf_s" structureKeys
- targetNames =
- Map.fromList
- [ (key, target)
- | (key, target) <- allocations
- ]
- reverseNames =
- foldl'
- (\reverseNames' (key, target) ->
- insertReverseName
- (Tptp.atomicWordText target)
- (LegacyTaskNameOrigin key)
- reverseNames')
- mempty
- allocations
- in
- (EncodingEnv targetNames, reverseNames)
- where
- allocateCategory prefix =
- zipWith
- (\ordinal key ->
- (key, generatedAtomicWord prefix ordinal))
- [0..]
-
-legacyFormulaKeys :: Formula -> Set LegacyTaskKey
-legacyFormulaKeys formula =
- Set.fromList
- (LegacyFreeConstantKey <$> toList formula)
- <> Set.map
- LegacyObjectSymbolKey
- (Set.filter requiresAllocatedName (mentionedSymbols formula))
- <> Set.map
- LegacyStructureSymbolKey
- (mentionedStructureSymbols formula)
-
-requiresAllocatedName :: Symbol -> Bool
-requiresAllocatedName = \case
- SymbolPredicate (PredicateRelation relation) ->
- relation /= EqSymbol && relation /= NeqSymbol
- _ ->
- True
-
-mentionedStructureSymbols :: ExprOf a -> Set StructSymbol
-mentionedStructureSymbols = \case
- TermVar{} ->
- mempty
- TermSymbol _loc _symbol args ->
- Set.unions (mentionedStructureSymbols <$> args)
- TermSymbolStruct symbol maybeArgument ->
- Set.insert symbol (foldMap mentionedStructureSymbols maybeArgument)
- Apply expression arguments ->
- mentionedStructureSymbols expression
- <> Set.unions
- (mentionedStructureSymbols <$> toList arguments)
- TermSep _variable bound scope ->
- mentionedStructureSymbols bound
- <> mentionedStructureSymbols (fromScope scope)
- ReplacePred _rangeVariable _domainVariable bound scope ->
- mentionedStructureSymbols bound
- <> mentionedStructureSymbols (fromScope scope)
- ReplaceFun bounds lhs condition ->
- Set.unions
- (mentionedStructureSymbols . snd <$> toList bounds)
- <> mentionedStructureSymbols (fromScope lhs)
- <> mentionedStructureSymbols (fromScope condition)
- Connected _connective left right ->
- mentionedStructureSymbols left <> mentionedStructureSymbols right
- Lambda scope ->
- mentionedStructureSymbols (fromScope scope)
- Quantified _quantifier scope ->
- mentionedStructureSymbols (fromScope scope)
- PropositionalConstant{} ->
- mempty
- Not _loc expression ->
- mentionedStructureSymbols expression
-
-canonicalFormulaText :: EncodingEnv -> SelectedFormula -> Text
-canonicalFormulaText encodingEnv selected =
- TextBuilder.toText
- (State.evalState
- (encodeExpr encodingEnv (selectedFormulaBody selected))
- EncodingState
- { nextBinderPosition = 0
- , encodingReverseNames = mempty
- })
-
-data EncodingState = EncodingState
- { nextBinderPosition :: !Int
- , encodingReverseNames :: !(Map Text TptpNameOrigin)
- }
-
-type Encode = State.State EncodingState
-
-encodeSelectedFormula
- :: EncodingEnv
- -> Tptp.AtomicWord
- -> FormulaOccurrenceKey
- -> SelectedFormula
- -> Encode Tptp.FofFormula
-encodeSelectedFormula encodingEnv targetName occurrence selected = do
- registerReverseName
- (Tptp.atomicWordText targetName)
- (FormulaOccurrenceOrigin occurrence)
- body <- encodeExpr encodingEnv (selectedFormulaBody selected)
- pure
- (Tptp.FofFormula
- (Tptp.NameAtomicWord targetName)
- (selectedFormulaRole selected)
- body)
-
-encodeExpr :: EncodingEnv -> Expr -> Encode TextBuilder
-encodeExpr encodingEnv =
- buildExpr . fmap (encodeFreeVar encodingEnv)
- where
- -- Source tasks reach encoding only after checker canonicalization.
- buildExpr :: ExprOf EncodedVar -> Encode TextBuilder
- buildExpr = \case
- Equals _pos left right -> do
- left' <- buildExpr left
- right' <- buildExpr right
- pure (left' <> char '=' <> right')
- NotEquals _pos left right -> do
- left' <- buildExpr left
- right' <- buildExpr right
- pure (left' <> text "!=" <> right')
- Atomic _pos predicate arguments -> do
- arguments' <- traverse buildExpr arguments
- pure
- (buildApply
- (encodePredicate encodingEnv predicate)
- arguments')
- PropositionalConstant IsBottom ->
- pure (text "$false")
- PropositionalConstant IsTop ->
- pure (text "$true")
- Not _pos formula -> do
- formula' <- buildUnitary formula
- pure (char '~' <> formula')
- Connected Conjunction left right -> do
- left' <- buildAnd left
- right' <- buildAnd right
- pure (left' <> char '&' <> right')
- Connected Disjunction left right -> do
- left' <- buildOr left
- right' <- buildOr right
- pure (left' <> char '|' <> right')
- Connected Implication left right -> do
- left' <- buildUnitary left
- right' <- buildUnitary right
- pure (left' <> text "=>" <> right')
- Connected Equivalence left right -> do
- left' <- buildUnitary left
- right' <- buildUnitary right
- pure (left' <> text "<=>" <> right')
- Connected NegatedDisjunction left right -> do
- formula' <-
- buildUnitary (Connected Disjunction left right)
- pure (char '~' <> formula')
- Connected ExclusiveOr left right -> do
- formula' <-
- buildUnitary (Connected Equivalence left right)
- pure (char '~' <> formula')
- Quantified quantifier scope ->
- buildQuantified buildExpr buildUnitary quantifier scope
- TermVar variable ->
- pure (buildTermVar variable)
- Apply expression arguments -> case expression of
- TermVar (FreeConst targetName) -> do
- arguments' <- traverse buildExpr (toList arguments)
- pure (buildApply targetName arguments')
- _ ->
- error
- ("encodeExpr: complex term as head of application: "
- <> show expression)
- TermSymbol _pos symbol arguments -> do
- arguments' <- traverse buildExpr arguments
- pure
- (buildApply
- (encodeSymbol encodingEnv symbol)
- arguments')
- expression@ReplaceFun{} ->
- error
- ("Precondition failed in encodeTerm, cannot encode terms with comprehensions directly: "
- <> show expression)
- expression@ReplacePred{} ->
- error
- ("Precondition failed in encodeTerm, cannot encode terms with comprehensions directly: "
- <> show expression)
- expression@TermSep{} ->
- error
- ("Precondition failed in encodeTerm, cannot encode terms with comprehensions directly: "
- <> show expression)
- TermSymbolStruct symbol maybeArgument -> case maybeArgument of
- Just argument -> do
- argument' <- buildExpr argument
- pure
- (buildApply
- (lookupLegacyName
- encodingEnv
- (LegacyStructureSymbolKey symbol))
- [argument'])
- Nothing ->
- error
- ("encodeExpr (precondition failed): unannotated struct symbol "
- <> show symbol)
- _ ->
- error "encodeExpr: missing case"
-
- buildTermVar :: EncodedVar -> TextBuilder
- buildTermVar = \case
- BoundVar variable ->
- Tptp.buildVariable variable
- FreeConst targetName ->
- Tptp.buildAtomicWord targetName
-
- buildApply :: Tptp.AtomicWord -> [TextBuilder] -> TextBuilder
- buildApply function arguments = case arguments of
- [] ->
- Tptp.buildAtomicWord function
- _ ->
- Tptp.buildAtomicWord function <> Tptp.buildTuple arguments
-
- isAtom :: ExprOf EncodedVar -> Bool
- isAtom = \case
- TermVar{} -> True
- TermSymbol{} -> True
- TermSymbolStruct{} -> True
- Apply{} -> True
- PropositionalConstant{} -> True
- Equals{} -> True
- NotEquals{} -> True
- _ -> False
-
- buildQuantified
- :: (ExprOf EncodedVar -> Encode TextBuilder)
- -> (ExprOf EncodedVar -> Encode TextBuilder)
- -> Quantifier
- -> Scope VarSymbol ExprOf EncodedVar
- -> Encode TextBuilder
- buildQuantified renderEmpty renderBody quantifier scope = do
- let boundKeys = currentScopeBindings scope
- targetVariables <- traverse (const allocateBinderVariable) boundKeys
- let binderNames = Map.fromList (zip boundKeys targetVariables)
- instantiateBinder key =
- TermVar
- (BoundVar
- (Map.lookup key binderNames
- ?? impossible
- ("encodeExpr: missing binder position for "
- <> show key)))
- body = instantiate instantiateBinder scope
- case targetVariables of
- [] ->
- renderEmpty body
- _ -> do
- body' <- renderBody body
- pure
- ( buildQuantifier quantifier
- <> Tptp.buildList
- (Tptp.buildVariable <$> targetVariables)
- <> char ':'
- <> body'
- )
-
- buildQuantifier :: Quantifier -> TextBuilder
- buildQuantifier = \case
- Universally ->
- text "!"
- Existentially ->
- text "?"
-
- buildUnitary :: ExprOf EncodedVar -> Encode TextBuilder
- buildUnitary = \case
- atom | isAtom atom ->
- buildExpr atom
- Quantified quantifier scope ->
- buildQuantified buildUnitary buildUnitary quantifier scope
- Not _ formula -> do
- formula' <- buildUnitary formula
- pure (char '~' <> formula')
- formula -> do
- formula' <- buildExpr formula
- pure (char '(' <> formula' <> char ')')
-
- buildAnd :: ExprOf EncodedVar -> Encode TextBuilder
- buildAnd = \case
- Connected Conjunction left right -> do
- left' <- buildAnd left
- right' <- buildAnd right
- pure (left' <> char '&' <> right')
- formula ->
- buildUnitary formula
-
- buildOr :: ExprOf EncodedVar -> Encode TextBuilder
- buildOr = \case
- Connected Disjunction left right -> do
- left' <- buildOr left
- right' <- buildUnitary right
- pure (left' <> char '|' <> right')
- formula ->
- buildUnitary formula
-
-currentScopeBindings
- :: Scope VarSymbol ExprOf a
- -> [VarSymbol]
-currentScopeBindings scope =
- nubOrd
- [ binder
- | B binder <- toList (fromScope scope)
- ]
-
-data EncodedVar
- = BoundVar Tptp.Variable
- | FreeConst Tptp.AtomicWord
- deriving (Show, Eq, Ord)
-
-encodeFreeVar :: EncodingEnv -> VarSymbol -> EncodedVar
-encodeFreeVar encodingEnv variable =
- FreeConst
- (lookupLegacyName
- encodingEnv
- (LegacyFreeConstantKey variable))
-
-encodeSymbol :: EncodingEnv -> Symbol -> Tptp.AtomicWord
-encodeSymbol encodingEnv symbol =
- lookupLegacyName encodingEnv (LegacyObjectSymbolKey symbol)
-
-encodePredicate :: EncodingEnv -> Predicate -> Tptp.AtomicWord
-encodePredicate encodingEnv predicate =
- encodeSymbol encodingEnv (SymbolPredicate predicate)
-
-lookupLegacyName :: EncodingEnv -> LegacyTaskKey -> Tptp.AtomicWord
-lookupLegacyName encodingEnv key =
- Map.lookup key (legacyTargetNames encodingEnv)
- ?? impossible
- ("Encoding lookup missed inventoried key " <> show key)
-
-allocateBinderVariable :: Encode Tptp.Variable
-allocateBinderVariable = do
- position <- State.gets nextBinderPosition
- let targetVariable = generatedVariable "V" position
- State.modify' \state ->
- state{nextBinderPosition = position + 1}
- registerReverseName
- (Tptp.variableText targetVariable)
- (BinderPositionOrigin position)
- pure targetVariable
-
-registerReverseName :: Text -> TptpNameOrigin -> Encode ()
-registerReverseName target origin =
- State.modify' \state ->
- state
- { encodingReverseNames =
- insertReverseName
- target
- origin
- (encodingReverseNames state)
- }
-
-insertReverseName
- :: Text
- -> TptpNameOrigin
- -> Map Text TptpNameOrigin
- -> Map Text TptpNameOrigin
-insertReverseName target origin reverseNames =
- case Map.lookup target reverseNames of
- Nothing ->
- Map.insert target origin reverseNames
- Just existing ->
- impossible
- ( "TPTP target name "
- <> show target
- <> " was allocated for both "
- <> show existing
- <> " and "
- <> show origin
- )
-
-generatedAtomicWord :: Text -> Int -> Tptp.AtomicWord
-generatedAtomicWord prefix ordinal =
- let target = prefix <> Text.pack (show ordinal)
- in
- Tptp.atomicWord target
- ?? impossible
- ("generated invalid TPTP atomic word " <> show target)
-
-generatedVariable :: Text -> Int -> Tptp.Variable
-generatedVariable prefix ordinal =
- let target = prefix <> Text.pack (show ordinal)
- in
- Tptp.variable target
- ?? impossible
- ("generated invalid TPTP variable " <> show target)
diff --git a/source/Felix/Cache/Codec.hs b/source/Felix/Cache/Codec.hs
index 0bfa975..2d81e57 100644
--- a/source/Felix/Cache/Codec.hs
+++ b/source/Felix/Cache/Codec.hs
@@ -75,7 +75,7 @@ newtype CacheEpoch = CacheEpoch Word32
currentCacheEpoch :: CacheEpoch
currentCacheEpoch =
- CacheEpoch 19
+ CacheEpoch 23
cacheEpochValue :: CacheEpoch -> Word32
cacheEpochValue (CacheEpoch value) =
diff --git a/source/Felix/Migration.hs b/source/Felix/Migration.hs
deleted file mode 100644
index 0fcb05d..0000000
--- a/source/Felix/Migration.hs
+++ /dev/null
@@ -1,284 +0,0 @@
-{-# LANGUAGE DerivingStrategies #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-
--- | Temporary routing data for the content-addressed migration.
---
--- These values select current physical sources. They are not durable module
--- names and must be deleted with the legacy driver.
-module Felix.Migration
- ( MigrationMountRole(..)
- , migrationMountId
- , MigrationModuleRef
- , migrationModuleRefRole
- , migrationModuleRefPath
- , MigrationManifestError(..)
- , migrationModuleCandidatePath
- , ResolvedMigrationSelection
- , resolveMigrationSelection
- , migrationSelectionContains
- , MigrationGraphRoute(..)
- , classifyMigrationGraph
- , activeMigrationRoots
- , protectedMigrationModules
- , phase53LibraryMigrationModules
- , typedMigrationModules
- , PreludeSourceFamily(..)
- , finalPreludeSourceFamilies
- , PreludePublicRole(..)
- , expectedFinalPreludePublicRoles
- ) where
-
-import Base
-import Felix.Parse
-import Felix.Source
-
-import Data.List qualified as List
-import Data.Set qualified as Set
-
-
-data MigrationMountRole
- = MigrationProject
- | MigrationLibrary
- | MigrationDebug
- deriving stock (Show, Eq, Ord, Enum, Bounded)
-
-migrationMountId :: MigrationMountRole -> SourceMountId
-migrationMountId = \case
- MigrationProject ->
- sourceMountId "project"
- MigrationLibrary ->
- sourceMountId "library"
- MigrationDebug ->
- sourceMountId "debug"
-
-
-data MigrationModuleRef = MigrationModuleRef
- !MigrationMountRole
- !SafeRelativePath
- deriving stock (Show, Eq, Ord)
-
-migrationModuleRefRole
- :: MigrationModuleRef
- -> MigrationMountRole
-migrationModuleRefRole (MigrationModuleRef role _path) =
- role
-
-migrationModuleRefPath
- :: MigrationModuleRef
- -> SafeRelativePath
-migrationModuleRefPath (MigrationModuleRef _role path) =
- path
-
-data MigrationManifestError
- = MissingMigrationMountRole !MigrationMountRole
- deriving stock (Show, Eq)
-
-newtype ResolvedMigrationSelection = ResolvedMigrationSelection
- (Set (SourceMountId, CanonicalPath, SafeRelativePath))
-
-resolveMigrationSelection
- :: Foldable references
- => SourceMounts
- -> references MigrationModuleRef
- -> Either MigrationManifestError ResolvedMigrationSelection
-resolveMigrationSelection mounts references =
- ResolvedMigrationSelection . Set.fromList
- <$> traverse resolveOne (toList references)
- where
- resolveOne reference =
- case List.find
- ((== migrationMountId role) . sourceMountIdentifier)
- (sourceMountList mounts) of
- Nothing ->
- Left (MissingMigrationMountRole role)
- Just mount ->
- Right
- ( sourceMountIdentifier mount
- , sourceMountRoot mount
- , migrationModuleRefPath reference
- )
- where
- role = migrationModuleRefRole reference
-
-migrationSelectionContains
- :: ResolvedMigrationSelection
- -> ResolvedSource
- -> Bool
-migrationSelectionContains
- (ResolvedMigrationSelection selected) source =
- ( resolvedSourceMount source
- , resolvedSourceMountRoot source
- , resolvedSourceRelativePath source
- ) `Set.member` selected
-
-data MigrationGraphRoute
- = TypedMigrationGraph
- | LegacyMigrationGraph
- deriving stock (Show, Eq)
-
-classifyMigrationGraph
- :: ResolvedMigrationSelection
- -> ParsedSourceWorkspace
- -> MigrationGraphRoute
-classifyMigrationGraph selected workspace
- | all
- (migrationSelectionContains selected . parsedModuleResolved)
- (parsedWorkspaceModules workspace) =
- TypedMigrationGraph
- | otherwise =
- LegacyMigrationGraph
-
--- | Resolve one routing reference against the current prepared mount table.
---
--- This deliberately returns a physical candidate path, not a logical owner.
-migrationModuleCandidatePath
- :: SourceMounts
- -> MigrationModuleRef
- -> Either MigrationManifestError FilePath
-migrationModuleCandidatePath mounts reference =
- case List.find matchesRole candidates of
- Nothing ->
- Left (MissingMigrationMountRole role)
- Just candidate ->
- Right (sourceCandidatePath candidate)
- where
- role = migrationModuleRefRole reference
- expectedMount = migrationMountId role
- candidates =
- sourceCandidates
- mounts
- (migrationModuleRefPath reference)
- matchesRole candidate =
- sourceCandidateMount candidate == expectedMount
-
-
--- | Current supported verification root.
-activeMigrationRoots :: NonEmpty MigrationModuleRef
-activeMigrationRoots =
- migrationLibraryModule "everything.tex" :| []
-
--- | Dependency-closed set/naturals migration boundary.
-protectedMigrationModules :: NonEmpty MigrationModuleRef
-protectedMigrationModules =
- migrationLibraryModule "set.tex" :|
- [ migrationLibraryModule "set/cons.tex"
- , migrationLibraryModule "set/regularity.tex"
- , migrationLibraryModule "set/suc.tex"
- , migrationLibraryModule "nat.tex"
- ]
-
--- | Phase 5.3 ordinary library modules admitted by the typed driver.
-phase53LibraryMigrationModules :: NonEmpty MigrationModuleRef
-phase53LibraryMigrationModules =
- migrationLibraryModule "set/symdiff.tex" :|
- [ migrationLibraryModule "set/powerset.tex"
- , migrationLibraryModule "set/partition.tex"
- , migrationLibraryModule "set/bipartition.tex"
- , migrationLibraryModule "set/product.tex"
- , migrationLibraryModule "set/filter.tex"
- , migrationLibraryModule "relation.tex"
- , migrationLibraryModule "relation/properties.tex"
- , migrationLibraryModule "relation/uniqueness.tex"
- , migrationLibraryModule "function.tex"
- , migrationLibraryModule "set/cantor.tex"
- , migrationLibraryModule "set/fixpoint.tex"
- ]
-
--- | Sources whose complete graphs may enter the typed driver.
-typedMigrationModules :: NonEmpty MigrationModuleRef
-typedMigrationModules =
- protectedMigrationModules
- <> phase53LibraryMigrationModules
- <> (migrationProjectModule "test/phase3/typed-producer.tex" :|
- [ migrationProjectModule "test/phase3/typed-unsupported.tex"
- , migrationProjectModule "test/phase3/typed-shared-a.tex"
- , migrationProjectModule "test/phase3/typed-shared-b.tex"
- , migrationProjectModule "test/phase3/typed-shared-root.tex"
- , migrationProjectModule "test/phase5/exact-producer.tex"
- , migrationProjectModule "test/phase5/exact-importer.tex"
- , migrationProjectModule "test/phase5/exact-failure.tex"
- , migrationProjectModule "test/phase5/exact-proofs.tex"
- , migrationProjectModule "test/phase5/exact-local-definition.tex"
- , migrationProjectModule "test/phase5/exact-local-definition-failure.tex"
- , migrationProjectModule "test/phase5/exact-contradiction.tex"
- , migrationProjectModule "test/phase5/exact-contradiction-goal.tex"
- , migrationProjectModule "test/phase5/exact-relation-expression.tex"
- , migrationProjectModule "test/phase5/exact-relation-expression-missing-pair.tex"
- , migrationProjectModule "test/phase5/exact-application.tex"
- , migrationProjectModule "test/phase5/exact-application-missing.tex"
- , migrationProjectModule "test/phase5/exact-quantified-subject.tex"
- , migrationProjectModule "test/phase5/exact-quantified-subject-nested.tex"
- , migrationProjectModule "test/phase5/exact-proof-failure.tex"
- , migrationProjectModule "test/phase5/exact-induction-nested.tex"
- , migrationProjectModule "test/phase5/exact-runtime-failure.tex"
- , migrationProjectModule "test/phase5/exact-source-axiom.tex"
- , migrationProjectModule "test/phase5/exact-source-axiom-assumptions.tex"
- , migrationProjectModule "test/phase5/exact-omitted.tex"
- , migrationProjectModule "test/phase5/exact-escape-producer.tex"
- , migrationProjectModule "test/phase5/exact-escape-consumer.tex"
- , migrationProjectModule "test/phase5/exact-separation.tex"
- , migrationProjectModule "test/phase5/exact-replacement.tex"
- , migrationProjectModule "test/phase5/exact-finite-set.tex"
- , migrationProjectModule "test/phase5/exact-datatype.tex"
- , migrationProjectModule "test/phase5/exact-datatype-nested.tex"
- , migrationProjectModule "test/phase5/exact-inductive.tex"
- , migrationProjectModule "test/phase5/exact-inductive-recursive.tex"
- , migrationProjectModule "test/phase5/exact-inductive-nested.tex"
- , migrationProjectModule "test/phase5/unmatched-proof.tex"
- ])
-
-
--- | Source constructs required by the non-authoritative prelude skeleton.
-data PreludeSourceFamily
- = PreludeDefinition
- | PreludeAbbreviation
- | PreludeProposition
- | PreludeProof
- deriving stock (Show, Eq, Ord, Enum, Bounded)
-
-finalPreludeSourceFamilies :: Set PreludeSourceFamily
-finalPreludeSourceFamilies =
- Set.fromList
- [ PreludeDefinition
- , PreludeAbbreviation
- , PreludeProposition
- , PreludeProof
- ]
-
--- | Stable public roles required at final-prelude cutover.
---
--- Helper declarations used to derive these roles are intentionally not
--- frozen by Phase 0.
-data PreludePublicRole
- = PreludeInfinityTheorem
- | PreludeOmegaObject
- | PreludeOmegaDefiningEquation
- | PreludeNaturalsAlias
- | PreludeNaturalsInductiveTheorem
- | PreludeNaturalsMinimalTheorem
- deriving stock (Show, Eq, Ord, Enum, Bounded)
-
-expectedFinalPreludePublicRoles :: Set PreludePublicRole
-expectedFinalPreludePublicRoles =
- Set.fromList [minBound .. maxBound]
-
-
-migrationLibraryModule :: FilePath -> MigrationModuleRef
-migrationLibraryModule =
- MigrationModuleRef MigrationLibrary . checkedRelativePath
-
-migrationProjectModule :: FilePath -> MigrationModuleRef
-migrationProjectModule =
- MigrationModuleRef MigrationProject . checkedRelativePath
-
-checkedRelativePath :: FilePath -> SafeRelativePath
-checkedRelativePath path =
- case safeRelativePath path of
- Left err ->
- impossible
- ("invalid migration path literal "
- <> show path
- <> ": "
- <> show err)
- Right relative ->
- relative
diff --git a/source/Felix/Parse.hs b/source/Felix/Parse.hs
index b9d5c57..751f09c 100644
--- a/source/Felix/Parse.hs
+++ b/source/Felix/Parse.hs
@@ -8,6 +8,7 @@ module Felix.Parse
( ParseException(..)
, ParseWorkspaceError(..)
, renderParseWorkspaceError
+ , renderSyntaxMaterializationError
, ParseExecutionError(..)
, ParsedArtifactIntegrityError(..)
, SyntaxDeclarationError(..)
@@ -89,7 +90,9 @@ module Felix.Parse
, parseMeasurementTargetInspectionCount
, parseSourceWorkspaceMeasured
, parseSourceWorkspaceMeasuredWithSyntaxInputs
+ , parseSourceWorkspaceMeasuredWithSyntaxInputsAndGraphValidation
, parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputs
+ , parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputsAndGraphValidation
, parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputsAndCallback
, parseSourceWorkspaceWith
, parseResolvedSourceGraph
@@ -1149,10 +1152,28 @@ parseSourceWorkspaceMeasuredWithSyntaxInputs
(ParsedSourceWorkspace, ParseMeasurements))
-- Implicit syntax inputs must be self-contained module interfaces.
parseSourceWorkspaceMeasuredWithSyntaxInputs mounts request syntaxInputs =
- parseSourceWorkspaceMeasuredWithSyntaxInputsAndCallback
+ parseSourceWorkspaceMeasuredWithSyntaxInputsAndGraphValidation
mounts
request
syntaxInputs
+ (const (Right ()))
+
+parseSourceWorkspaceMeasuredWithSyntaxInputsAndGraphValidation
+ :: SourceMounts
+ -> RootRequest
+ -> (ResolvedSource -> [ModuleSyntaxInterface])
+ -> (ResolvedSourceGraph -> Either SourceError ())
+ -> IO
+ (Either
+ ParseWorkspaceError
+ (ParsedSourceWorkspace, ParseMeasurements))
+parseSourceWorkspaceMeasuredWithSyntaxInputsAndGraphValidation
+ mounts request syntaxInputs validateGraph =
+ parseSourceWorkspaceMeasuredWithSyntaxInputsAndGraphValidationAndCallback
+ mounts
+ request
+ syntaxInputs
+ validateGraph
(\_source _block -> pure ())
parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputs
@@ -1166,8 +1187,24 @@ parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputs
(ParsedSourceWorkspace, ParseMeasurements))
parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputs
store mounts request syntaxInputs =
- parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputsAndCallback
- store mounts request syntaxInputs (\_source _block -> pure ())
+ parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputsAndGraphValidation
+ store mounts request syntaxInputs (const (Right ()))
+
+parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputsAndGraphValidation
+ :: Store.Store
+ -> SourceMounts
+ -> RootRequest
+ -> (ResolvedSource -> [ModuleSyntaxInterface])
+ -> (ResolvedSourceGraph -> Either SourceError ())
+ -> IO
+ (Either
+ ParseExecutionError
+ (ParsedSourceWorkspace, ParseMeasurements))
+parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputsAndGraphValidation
+ store mounts request syntaxInputs validateGraph =
+ parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputsAndGraphValidationAndCallback
+ store mounts request syntaxInputs validateGraph
+ (\_source _block -> pure ())
parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputsAndCallback
:: Store.Store
@@ -1181,6 +1218,22 @@ parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputsAndCallback
(ParsedSourceWorkspace, ParseMeasurements))
parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputsAndCallback
store mounts request syntaxInputs emitBlock = do
+ parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputsAndGraphValidationAndCallback
+ store mounts request syntaxInputs (const (Right ())) emitBlock
+
+parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputsAndGraphValidationAndCallback
+ :: Store.Store
+ -> SourceMounts
+ -> RootRequest
+ -> (ResolvedSource -> [ModuleSyntaxInterface])
+ -> (ResolvedSourceGraph -> Either SourceError ())
+ -> (ResolvedSource -> Raw.Block -> IO ())
+ -> IO
+ (Either
+ ParseExecutionError
+ (ParsedSourceWorkspace, ParseMeasurements))
+parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputsAndGraphValidationAndCallback
+ store mounts request syntaxInputs validateGraph emitBlock = do
resolutionStart <- getMonotonicTimeNSec
graphResult <- buildResolvedSourceGraphMeasured mounts request
resolutionEnd <- getMonotonicTimeNSec
@@ -1191,20 +1244,27 @@ parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputsAndCallback
(ParseExecutionWorkspaceError
(SourceWorkspaceError err)))
Right (graph, selectionMeasurements) ->
- fmap
- (fmap
- (\(workspace, measurements) ->
- ( workspace
- , withResolutionMeasurements
- measurements
- (resolutionEnd - resolutionStart)
- selectionMeasurements
- )))
- (parseResolvedSourceGraphMeasuredWithArtifacts
- (PersistentParsedArtifacts store)
- graph
- syntaxInputs
- emitBlock)
+ case validateGraph graph of
+ Left err ->
+ pure
+ (Left
+ (ParseExecutionWorkspaceError
+ (SourceWorkspaceError err)))
+ Right () ->
+ fmap
+ (fmap
+ (\(workspace, measurements) ->
+ ( workspace
+ , withResolutionMeasurements
+ measurements
+ (resolutionEnd - resolutionStart)
+ selectionMeasurements
+ )))
+ (parseResolvedSourceGraphMeasuredWithArtifacts
+ (PersistentParsedArtifacts store)
+ graph
+ syntaxInputs
+ emitBlock)
-- | Resolve, strictly load, and parse one source closure with a block
-- callback.
@@ -1250,6 +1310,21 @@ parseSourceWorkspaceMeasuredWithSyntaxInputsAndCallback
(ParsedSourceWorkspace, ParseMeasurements))
parseSourceWorkspaceMeasuredWithSyntaxInputsAndCallback
mounts request syntaxInputs emitBlock = do
+ parseSourceWorkspaceMeasuredWithSyntaxInputsAndGraphValidationAndCallback
+ mounts request syntaxInputs (const (Right ())) emitBlock
+
+parseSourceWorkspaceMeasuredWithSyntaxInputsAndGraphValidationAndCallback
+ :: SourceMounts
+ -> RootRequest
+ -> (ResolvedSource -> [ModuleSyntaxInterface])
+ -> (ResolvedSourceGraph -> Either SourceError ())
+ -> (ResolvedSource -> Raw.Block -> IO ())
+ -> IO
+ (Either
+ ParseWorkspaceError
+ (ParsedSourceWorkspace, ParseMeasurements))
+parseSourceWorkspaceMeasuredWithSyntaxInputsAndGraphValidationAndCallback
+ mounts request syntaxInputs validateGraph emitBlock = do
resolutionStart <- getMonotonicTimeNSec
graphResult <- buildResolvedSourceGraphMeasured mounts request
resolutionEnd <- getMonotonicTimeNSec
@@ -1257,23 +1332,27 @@ parseSourceWorkspaceMeasuredWithSyntaxInputsAndCallback
Left err ->
pure (Left (SourceWorkspaceError err))
Right (graph, selectionMeasurements) ->
- fmap
- (fmap
- (\(workspace, measurements) ->
- let
- -- Resolution includes source loading and import
- -- scanning for graph construction.
- measured =
- withResolutionMeasurements
- measurements
- (resolutionEnd - resolutionStart)
- selectionMeasurements
- in
- (workspace, measured)))
- (parseResolvedSourceGraphMeasuredWith
- graph
- syntaxInputs
- emitBlock)
+ case validateGraph graph of
+ Left err ->
+ pure (Left (SourceWorkspaceError err))
+ Right () ->
+ fmap
+ (fmap
+ (\(workspace, measurements) ->
+ let
+ -- Resolution includes source loading and
+ -- import scanning for graph construction.
+ measured =
+ withResolutionMeasurements
+ measurements
+ (resolutionEnd - resolutionStart)
+ selectionMeasurements
+ in
+ (workspace, measured)))
+ (parseResolvedSourceGraphMeasuredWith
+ graph
+ syntaxInputs
+ emitBlock)
parseResolvedSourceGraph
:: ResolvedSourceGraph
diff --git a/source/Felix/Prelude.hs b/source/Felix/Prelude.hs
index d159b21..28ad961 100644
--- a/source/Felix/Prelude.hs
+++ b/source/Felix/Prelude.hs
@@ -1,7 +1,7 @@
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE NoImplicitPrelude #-}
--- | The reserved in-memory prelude source used during migration.
+-- | The reserved packaged final-prelude source and its authority-free parser.
module Felix.Prelude
( ReservedPreludeSourceInput
, reservedPreludeSourceInput
@@ -9,11 +9,15 @@ module Felix.Prelude
, emptyBootstrapSourceInput
, reservedPreludeSourceOwner
, reservedPreludeSourceLabel
+ , reservedPreludeSourceCanonicalPath
, reservedPreludeSourceBytes
, reservedPreludeSourceText
+ , rejectOrdinaryPreludeSourceGraph
, preludeDiagnosticLabel
, PreludeLoadError(..)
+ , renderPreludeLoadError
, PreludeParseError(..)
+ , renderPreludeParseError
, ReservedParsedPrelude
, reservedParsedPreludeInput
, reservedParsedPreludeModule
@@ -24,6 +28,8 @@ import Base
import Felix.Module
import Felix.Parse
import Felix.Parsed.Identity qualified as Parsed
+import Felix.Source
+import Felix.Source.Graph
import Report.Location
import Syntax.Adapt (SyntaxMaterializationError)
import Syntax.Interface
@@ -41,6 +47,7 @@ import Paths_felix qualified as Paths
data ReservedPreludeSourceInput = ReservedPreludeSourceInput
!ModuleName
!FilePath
+ !(Maybe CanonicalPath)
!ByteString
!Text
@@ -51,38 +58,76 @@ reservedPreludeSourceInput bytes =
ReservedPreludeSourceInput
preludeModuleName
preludeDiagnosticLabel
+ Nothing
bytes
<$> Text.decodeUtf8' bytes
data PreludeLoadError
= PreludeSourceReadFailed !FilePath !Text
+ | PreludeSourceCanonicalizationFailed !FilePath !SourceError
| PreludeSourceUtf8Failed !UnicodeException
- deriving stock (Show)
+
+instance Show PreludeLoadError where
+ show = Text.unpack . renderPreludeLoadError
+
+renderPreludeLoadError :: PreludeLoadError -> Text
+renderPreludeLoadError = \case
+ PreludeSourceReadFailed path failure ->
+ Text.pack path
+ <> ": unable to read packaged final prelude: "
+ <> failure
+ PreludeSourceCanonicalizationFailed path failure ->
+ Text.pack path
+ <> ": unable to resolve packaged final prelude: "
+ <> renderSourceError failure
+ PreludeSourceUtf8Failed failure ->
+ preludeErrorPrefix
+ <> "malformed UTF-8: "
+ <> Text.pack (displayException failure)
loadReservedPreludeSourceInput
:: IO (Either PreludeLoadError ReservedPreludeSourceInput)
loadReservedPreludeSourceInput = do
path <- Paths.getDataFileName "data/felix-prelude.tex"
- loaded <- try (ByteString.readFile path)
- :: IO (Either IOException ByteString)
- pure case loaded of
+ canonicalized <- canonicalizeExistingSourcePath path
+ case canonicalized of
Left failure ->
- Left
- (PreludeSourceReadFailed
- path
- (Text.pack (displayException failure)))
- Right bytes ->
- case reservedPreludeSourceInput bytes of
+ pure
+ (Left
+ (PreludeSourceCanonicalizationFailed path failure))
+ Right canonical -> do
+ loaded <- try
+ (ByteString.readFile
+ (canonicalPathFilePath canonical))
+ :: IO (Either IOException ByteString)
+ pure case loaded of
Left failure ->
- Left (PreludeSourceUtf8Failed failure)
- Right input ->
- Right input
+ Left
+ (PreludeSourceReadFailed
+ path
+ (Text.pack (displayException failure)))
+ Right bytes ->
+ case Text.decodeUtf8' bytes of
+ Left failure ->
+ Left (PreludeSourceUtf8Failed failure)
+ Right sourceText ->
+ Right
+ (ReservedPreludeSourceInput
+ preludeModuleName
+ preludeDiagnosticLabel
+ (Just canonical)
+ bytes
+ sourceText)
+-- | Empty final-prelude input used only by focused compiler fixtures.
+--
+-- Production verification always calls 'loadReservedPreludeSourceInput'.
emptyBootstrapSourceInput :: ReservedPreludeSourceInput
emptyBootstrapSourceInput =
ReservedPreludeSourceInput
preludeModuleName
preludeDiagnosticLabel
+ Nothing
ByteString.empty
Text.empty
@@ -90,28 +135,58 @@ reservedPreludeSourceOwner
:: ReservedPreludeSourceInput
-> ModuleName
reservedPreludeSourceOwner
- (ReservedPreludeSourceInput owner _label _bytes _text) =
+ (ReservedPreludeSourceInput owner _label _canonical _bytes _text) =
owner
reservedPreludeSourceLabel
:: ReservedPreludeSourceInput
-> FilePath
reservedPreludeSourceLabel
- (ReservedPreludeSourceInput _owner label _bytes _text) =
+ (ReservedPreludeSourceInput _owner label _canonical _bytes _text) =
label
+reservedPreludeSourceCanonicalPath
+ :: ReservedPreludeSourceInput
+ -> Maybe CanonicalPath
+reservedPreludeSourceCanonicalPath
+ (ReservedPreludeSourceInput _owner _label canonical _bytes _text) =
+ canonical
+
reservedPreludeSourceBytes
:: ReservedPreludeSourceInput
-> ByteString
reservedPreludeSourceBytes
- (ReservedPreludeSourceInput _owner _label bytes _text) =
+ (ReservedPreludeSourceInput _owner _label _canonical bytes _text) =
bytes
reservedPreludeSourceText :: ReservedPreludeSourceInput -> Text
reservedPreludeSourceText
- (ReservedPreludeSourceInput _owner _label _bytes sourceText) =
+ (ReservedPreludeSourceInput
+ _owner _label _canonical _bytes sourceText) =
sourceText
+-- | Reject an ordinary source graph containing the physical packaged
+-- prelude. Synthetic reserved inputs deliberately have no physical path.
+rejectOrdinaryPreludeSourceGraph
+ :: ReservedPreludeSourceInput
+ -> ResolvedSourceGraph
+ -> Either SourceError ()
+rejectOrdinaryPreludeSourceGraph sourceInput graph =
+ case reservedPreludeSourceCanonicalPath sourceInput of
+ Nothing ->
+ Right ()
+ Just reservedPath ->
+ case listToMaybe
+ [ source
+ | node <- sourceGraphNodes graph
+ , let source = sourceNodeResolved node
+ , resolvedSourceCanonicalPath source == reservedPath
+ ] of
+ Nothing ->
+ Right ()
+ Just source ->
+ Left (PackagedPreludeSelectedAsOrdinarySource source)
+
preludeDiagnosticLabel :: FilePath
preludeDiagnosticLabel =
"<felix-prelude>"
@@ -130,7 +205,92 @@ data PreludeParseError
| PreludeFreshInputFailed !FreshModuleInputError
| PreludeParsedModuleKeyFailed !Parsed.ParsedModuleKeyError
| PreludeParseInvariantFailed !Text
- deriving stock (Show)
+
+instance Show PreludeParseError where
+ show = Text.unpack . renderPreludeParseError
+
+renderPreludeParseError :: PreludeParseError -> Text
+renderPreludeParseError = \case
+ PreludeLocationRegistrationFailed FileIdSpaceExhausted ->
+ preludeErrorPrefix
+ <> "could not register source locations: file identifier space exhausted"
+ PreludeSyntaxPragmaFailed failure ->
+ renderSyntaxPragmaError failure
+ PreludeImportNotSupported imports ->
+ preludeErrorPrefix
+ <> "imports are not supported"
+ <> case imports of
+ [] -> ""
+ _ ->
+ ": "
+ <> Text.intercalate
+ ", "
+ (Text.pack . show <$> imports)
+ PreludeLexicalScanFailed failure ->
+ Text.pack (show failure)
+ PreludeSyntaxDeclarationFailed failure ->
+ Text.pack (show failure)
+ PreludeLexiconCollision collision ->
+ Text.pack (show collision)
+ PreludeSyntaxDeltaFailed collision ->
+ preludeErrorPrefix
+ <> "syntax delta has conflicting entries for pattern "
+ <> Text.pack (show (canonicalCollisionPattern collision))
+ <> ": "
+ <> Text.pack
+ (show (toList (canonicalCollisionEntries collision)))
+ PreludeSyntaxInterfaceFailed failure ->
+ preludeErrorPrefix <> renderSyntaxInterfaceError failure
+ PreludeSyntaxMaterializationFailed failure ->
+ preludeErrorPrefix <> renderSyntaxMaterializationError failure
+ PreludeParseFailed failure ->
+ preludeErrorPrefix <> Text.pack (show failure)
+ PreludeFreshInputFailed failure ->
+ preludeErrorPrefix <> renderFreshModuleInputError failure
+ PreludeParsedModuleKeyFailed failure ->
+ preludeErrorPrefix <> renderParsedModuleKeyError failure
+ PreludeParseInvariantFailed failure ->
+ preludeErrorPrefix <> "parse invariant failed: " <> failure
+
+preludeErrorPrefix :: Text
+preludeErrorPrefix =
+ Text.pack preludeDiagnosticLabel <> ": "
+
+renderSyntaxInterfaceError :: SyntaxInterfaceError -> Text
+renderSyntaxInterfaceError = \case
+ DuplicateDirectSyntaxInterface duplicate ->
+ "duplicate direct syntax input " <> Text.pack (show duplicate)
+ UnexpectedBaseSyntaxInterface actual expected ->
+ "base syntax interface mismatch: expected "
+ <> Text.pack (show expected)
+ <> ", got "
+ <> Text.pack (show actual)
+ SyntaxInterfaceIdMismatch asserted computed ->
+ "syntax interface identity mismatch: asserted "
+ <> Text.pack (show asserted)
+ <> ", computed "
+ <> Text.pack (show computed)
+
+renderFreshModuleInputError :: FreshModuleInputError -> Text
+renderFreshModuleInputError = \case
+ FreshModuleTextDoesNotMatchBytes ->
+ "decoded source text does not match its source bytes"
+ FreshPhysicalOwnerMismatch expected actual ->
+ "physical source owner mismatch: expected "
+ <> Text.pack (show expected)
+ <> ", got "
+ <> Text.pack (show actual)
+ FreshPhysicalLocationPathMismatch expected actual ->
+ "physical source location mismatch: expected "
+ <> Text.pack (show expected)
+ <> ", got "
+ <> Text.pack (show actual)
+
+renderParsedModuleKeyError :: Parsed.ParsedModuleKeyError -> Text
+renderParsedModuleKeyError = \case
+ Parsed.DuplicateParsedDirectSyntaxInput duplicate ->
+ "parsed module has duplicate direct syntax input "
+ <> Text.pack (show duplicate)
data ReservedParsedPrelude = ReservedParsedPrelude
!FreshModuleInput
@@ -148,7 +308,7 @@ reservedParsedPreludeModule
reservedParsedPreludeModule (ReservedParsedPrelude _input parsed) =
parsed
--- | Parse a reserved migration input through the ordinary fresh-source path.
+-- | Parse reserved final-prelude input through the ordinary fresh-source path.
parseReservedPreludeSource
:: ReservedPreludeSourceInput
-> IO (Either PreludeParseError ReservedParsedPrelude)
diff --git a/source/Felix/Source.hs b/source/Felix/Source.hs
index a30b5f9..64a88cd 100644
--- a/source/Felix/Source.hs
+++ b/source/Felix/Source.hs
@@ -25,6 +25,7 @@ module Felix.Source
, RootRequest
, searchedRoot
, existingRoot
+ , canonicalizeExistingSourcePath
, rootRequestSpelling
, ResolvedSource
, resolvedSourceCanonicalPath
@@ -230,6 +231,21 @@ existingRoot path
fmap (\canonical -> ExistingRoot canonical path) <$>
canonicalize ExistingRootCanonicalizationFailed path
+-- | Validate and canonicalize an existing source path without assigning it
+-- to a source mount.
+canonicalizeExistingSourcePath
+ :: FilePath
+ -> IO (Either SourceError CanonicalPath)
+canonicalizeExistingSourcePath path =
+ fmap extract <$> existingRoot path
+ where
+ extract = \case
+ ExistingRoot canonical _spelling ->
+ canonical
+ SearchedRoot{} ->
+ impossible
+ "canonicalizeExistingSourcePath produced a searched root"
+
-- | The user-facing spelling retained only for diagnostics.
rootRequestSpelling :: RootRequest -> FilePath
rootRequestSpelling = \case
@@ -450,6 +466,7 @@ data SourceError
!ResolvedSource
!LocationRegistrationError
| SourceImportCycle !(NonEmpty SourceCycleStep)
+ | PackagedPreludeSelectedAsOrdinarySource !ResolvedSource
| SourceGraphInvariantViolation !Text
deriving stock (Show, Eq)
@@ -551,6 +568,9 @@ renderSourceError = \case
<> sourceLabel (cycleImported step)
| step <- toList steps
]
+ PackagedPreludeSelectedAsOrdinarySource source ->
+ "the packaged final prelude cannot be used as ordinary source "
+ <> quotePath (resolvedSourceLocationPath source)
SourceGraphInvariantViolation reason ->
"source graph invariant failed: " <> reason
diff --git a/source/Felix/Store.hs b/source/Felix/Store.hs
index 973a172..bf84f6e 100644
--- a/source/Felix/Store.hs
+++ b/source/Felix/Store.hs
@@ -47,6 +47,9 @@ module Felix.Store
, newStoreMemo
, StoreMemoVisits(..)
, storeMemoVisits
+ , StoreCoordinator
+ , newStoreCoordinator
+ , withStoreCoordinator
) where
import Base
@@ -61,6 +64,11 @@ import Felix.Parsed.Identity qualified as Parsed
import Felix.Parsed.Payload qualified as ParsedPayload
import Syntax.Interface qualified as Syntax
+import Control.Concurrent.MVar
+ ( MVar
+ , newMVar
+ , withMVar
+ )
import Control.Exception qualified as Exception
import Control.Monad (foldM, unless)
import Control.Monad.Except qualified as Except
@@ -84,6 +92,18 @@ data Store = Store
!TheoryId
!SQLite.Connection
+-- | The single invocation-local gateway for a store connection and its
+-- ordinary 'IORef'-backed validation memo. Module checkers may run in
+-- parallel, but every SQLite and memo operation remains coordinator-owned.
+newtype StoreCoordinator = StoreCoordinator (MVar ())
+
+newStoreCoordinator :: IO StoreCoordinator
+newStoreCoordinator = StoreCoordinator <$> newMVar ()
+
+withStoreCoordinator :: StoreCoordinator -> IO value -> IO value
+withStoreCoordinator (StoreCoordinator ownership) action =
+ withMVar ownership (const action)
+
-- | A completely validated, inert cached module. Runtime authority is
-- minted only after this value is adopted by 'Checking.Module'.
data CachedModuleInstallation = CachedModuleInstallation
@@ -157,8 +177,6 @@ data StoreMemo = StoreMemo
, memoCheckedObjects :: !(IORef.IORef CheckedObjectClosure)
, memoValidatedPropositions :: !(IORef.IORef
(Map PropositionId CheckedPropositionContent))
- , memoSemanticInventories :: !(IORef.IORef
- (Map SemanticInterfaceId SemanticInventory))
, memoValidatedArtifacts :: !(IORef.IORef (Set ModuleArtifactId))
, memoSyntaxValidationVisits :: !(IORef.IORef Int)
, memoSemanticValidationVisits :: !(IORef.IORef Int)
@@ -167,8 +185,9 @@ data StoreMemo = StoreMemo
, memoArtifactValidationVisits :: !(IORef.IORef Int)
}
--- Complete aggregate inventories keep validation direct for the current
--- walking subset. Measure long chains before adding Phase 6 sharing.
+-- Root-scoped validation carries one flat inventory through a deterministic
+-- visited fold. Immutable rows and their validation results are memoized
+-- above, but complete transitive inventories are not retained per interface.
data SemanticInventory = SemanticInventory
!(Set SemanticFactOccurrenceFingerprint)
!(Map SemanticName SemanticFactOccurrenceFingerprint)
@@ -203,7 +222,6 @@ newStoreMemo (Store _path theory _connection) = do
validatedSemantic <- IORef.newIORef Set.empty
checkedObjects <- IORef.newIORef emptyClosure
validatedPropositions <- IORef.newIORef Map.empty
- semanticInventories <- IORef.newIORef Map.empty
validatedArtifacts <- IORef.newIORef Set.empty
syntaxVisits <- IORef.newIORef 0
semanticVisits <- IORef.newIORef 0
@@ -221,7 +239,6 @@ newStoreMemo (Store _path theory _connection) = do
, memoValidatedSemantic = validatedSemantic
, memoCheckedObjects = checkedObjects
, memoValidatedPropositions = validatedPropositions
- , memoSemanticInventories = semanticInventories
, memoValidatedArtifacts = validatedArtifacts
, memoSyntaxValidationVisits = syntaxVisits
, memoSemanticValidationVisits = semanticVisits
@@ -1654,7 +1671,6 @@ validateModuleArtifactClosure memo store root = do
(moduleArtifactResultSemantic artifact)
void
(validateSemanticInventory
- Set.empty
(moduleArtifactResultSemantic artifact))
case checked of
Left failure ->
@@ -1734,6 +1750,8 @@ validateModuleArtifactClosure memo store root = do
traverse_
(validateSemantic (Set.insert identity path))
(semanticInterfaceDirectInputs interface)
+ operationBindings <-
+ semanticOperationBindings Set.empty identity
validateObjectRoots objects
closure <- Except.liftIO
(IORef.readIORef (memoCheckedObjects memo))
@@ -1745,7 +1763,7 @@ validateModuleArtifactClosure memo store root = do
(semanticGlobalBindingKey binding)
(semanticGlobalBindingTarget binding))
(validateSemanticGlobalBindingTarget
- closure binding)))
+ operationBindings closure binding)))
bindings
traverse_ validateProposition propositions
traverse_ validateOccurrence
@@ -1758,6 +1776,33 @@ validateModuleArtifactClosure memo store root = do
(memoValidatedSemantic memo)
(Set.insert identity))
+ semanticOperationBindings path identity
+ | identity `Set.member` path = pure Set.empty
+ | otherwise = do
+ interface <- requireMemo
+ SemanticInterfaces
+ (cacheDigestBytes
+ (semanticInterfaceIdDigest identity))
+ (memoSemantic memo store identity)
+ inherited <-
+ traverse
+ (semanticOperationBindings
+ (Set.insert identity path))
+ (semanticInterfaceDirectInputs interface)
+ let local =
+ Set.fromList
+ [ ( semanticStructureOperationSymbol operation
+ , semanticStructureOperationObject operation
+ )
+ | declaration <-
+ semanticInterfaceDeclarations interface
+ , descriptor <- semanticEnvironmentStructures
+ (declarationDeltaEnvironment declaration)
+ , operation <-
+ semanticStructureDescriptorOperations descriptor
+ ]
+ pure (Set.unions (local : inherited))
+
validateObjectRoots identities = do
closure <- Except.liftIO
(IORef.readIORef (memoCheckedObjects memo))
@@ -1843,83 +1888,57 @@ validateModuleArtifactClosure memo store root = do
proposition
(semanticFactAuthority occurrence))))
- validateSemanticInventory path identity = do
- inventories <- Except.liftIO
- (IORef.readIORef (memoSemanticInventories memo))
- case Map.lookup identity inventories of
- Just inventory ->
- pure inventory
- Nothing
- | identity `Set.member` path ->
- pure
- (SemanticInventory
- Set.empty Map.empty Map.empty)
- | otherwise -> do
- interface <- requireMemo
- SemanticInterfaces
- (cacheDigestBytes
- (semanticInterfaceIdDigest identity))
- (memoSemantic memo store identity)
- parents <- traverse
- (validateSemanticInventory
- (Set.insert identity path))
- (semanticInterfaceDirectInputs interface)
- SemanticInventory
- parentFacts parentAliases parentGlobals <-
- foldM mergeInventory
- (SemanticInventory
- Set.empty Map.empty Map.empty)
- parents
- let declarations =
- semanticInterfaceDeclarations interface
- localFacts = Set.fromList
- [ semanticFactFingerprint occurrence
- | declaration <- declarations
- , occurrence <- declarationDeltaFacts declaration
- ]
- visibleFacts = parentFacts <> localFacts
- aliases <- foldM
- (insertAlias visibleFacts)
- parentAliases
- [ alias
- | declaration <- declarations
- , alias <- declarationDeltaAliases declaration
- ]
- globals <- foldM
- insertGlobal
- parentGlobals
- [ binding
- | declaration <- declarations
- , binding <- semanticEnvironmentBindings
- (declarationDeltaEnvironment declaration)
- ]
- let inventory =
- SemanticInventory
- visibleFacts aliases globals
- Except.liftIO
- (IORef.modifyIORef'
- (memoSemanticInventories memo)
- (Map.insert identity inventory))
- pure inventory
-
- mergeInventory
- (SemanticInventory facts aliases globals)
- (SemanticInventory moreFacts moreAliases moreGlobals) = do
- merged <- foldM
- (\current (name, target) ->
- insertNamedAlias name target current)
- aliases
- (Map.toAscList moreAliases)
- mergedGlobals <- foldM
- (\current (key, target) ->
- insertGlobalBinding key target current)
- globals
- (Map.toAscList moreGlobals)
- pure
- (SemanticInventory
- (facts <> moreFacts)
- merged
- mergedGlobals)
+ validateSemanticInventory identity =
+ snd
+ <$> foldSemanticInventory
+ Set.empty
+ (SemanticInventory Set.empty Map.empty Map.empty)
+ identity
+
+ foldSemanticInventory visited inventory identity
+ | identity `Set.member` visited =
+ pure (visited, inventory)
+ | otherwise = do
+ interface <- requireMemo
+ SemanticInterfaces
+ (cacheDigestBytes
+ (semanticInterfaceIdDigest identity))
+ (memoSemantic memo store identity)
+ (parentVisited, parentInventory) <-
+ foldM
+ (\(seen, current) parent ->
+ foldSemanticInventory seen current parent)
+ (Set.insert identity visited, inventory)
+ (semanticInterfaceDirectInputs interface)
+ let declarations = semanticInterfaceDeclarations interface
+ SemanticInventory
+ parentFacts parentAliases parentGlobals =
+ parentInventory
+ localFacts = Set.fromList
+ [ semanticFactFingerprint occurrence
+ | declaration <- declarations
+ , occurrence <- declarationDeltaFacts declaration
+ ]
+ visibleFacts = parentFacts <> localFacts
+ aliases <- foldM
+ (insertAlias visibleFacts)
+ parentAliases
+ [ alias
+ | declaration <- declarations
+ , alias <- declarationDeltaAliases declaration
+ ]
+ globals <- foldM
+ insertGlobal
+ parentGlobals
+ [ binding
+ | declaration <- declarations
+ , binding <- semanticEnvironmentBindings
+ (declarationDeltaEnvironment declaration)
+ ]
+ pure
+ ( parentVisited
+ , SemanticInventory visibleFacts aliases globals
+ )
insertGlobal globals binding =
insertGlobalBinding
diff --git a/source/Filter.hs b/source/Filter.hs
deleted file mode 100644
index 748c2be..0000000
--- a/source/Filter.hs
+++ /dev/null
@@ -1,211 +0,0 @@
-module Filter where
-
-
-import Base
-import Syntax.Internal
-
-import Data.List qualified as List
-import Data.Maybe (mapMaybe)
-import Data.Set qualified as Set
-import Data.Map qualified as Map
-import GHC.Float (int2Float)
-import Bound.Scope
-
-
-convergence :: Float
-convergence = 2.8
-
-
-passmark :: Float
-passmark = 0.4
-
-
-filterTask :: Task -> Task
-filterTask Task{taskDirectness = directness, taskConjectureLabel = label, taskConjecture = conjecture, taskHypotheses = hypotheses, taskLocation = loc} =
- let
- motive = case directness of
- Indirect formerConjecture -> formerConjecture
- Direct -> conjecture
- relevant = relevantFacts passmark motive (Set.fromList hypotheses)
- filteredHypos = if length hypotheses < 20
- then hypotheses
- else List.filter (`Map.member` relevant) hypotheses
- in Task
- { taskDirectness = directness
- , taskConjecture = conjecture
- , taskHypotheses = filteredHypos
- , taskConjectureLabel = label
- , taskLocation = loc
- }
-
-
-data Feature
- = FeatureSymbol Symbol
- | FeatureStruct StructSymbol
- deriving (Show, Eq, Ord)
-
-
-relevantFacts :: Float -> ExprOf a -> Set Hypothesis -> Map Hypothesis Float
-relevantFacts p conjecture cs = relevantClausesNaiveFeatures p (features conjecture) cs Map.empty
-
-
-relevantFactsWeighted :: Float -> ExprOf a -> Set Hypothesis -> Map Hypothesis Float
-relevantFactsWeighted p conjecture cs =
- let
- ftab = Map.unionsWith (+) (featureTable . hypothesisFormula <$> Set.toList cs)
- cfeatures = Map.fromSet (features . hypothesisFormula) cs
- in relevantClauses p ftab (features conjecture) cfeatures Map.empty
-
-
-relevantClauses
- :: Float -- ^ Pass mark
- -> Map Feature Int -- ^ Feature frequencies in the candidate facts
- -> Set Feature -- ^ Relevant features
- -> Map Hypothesis (Set Feature) -- ^ Working irrelevant facts and their features
- -> Map Hypothesis Float -- ^ Accumulator of relevant facts
- -> Map Hypothesis Float -- ^ Final relevant facts
-relevantClauses p ftab rs cs a =
- let ms = Map.map (\fs -> featureClauseMark rs fs ftab) cs
- rels = Map.filter (p <=) ms
- relKeys = Map.keysSet rels
- cs' = Map.difference cs rels
- p' = p + (1 - p) / convergence
- a' = a `Map.union` rels
- rs' = Set.unions (Map.elems (Map.restrictKeys cs relKeys)) `Set.union` rs
- in
- if Map.null rels
- then a
- else relevantClauses p' ftab rs' cs' a'
-
-
-relevantClausesNaive
- :: Float -- ^ Pass mark
- -> Set Symbol -- ^ Relevant symbols
- -> Set Hypothesis -- ^ working irrelevant facts
- -> Map Hypothesis Float -- ^ Accumulator of relevant facts
- -> Map Hypothesis Float -- ^ Final relevant facts
-relevantClausesNaive p rs = relevantClausesNaiveFeatures p (Set.map FeatureSymbol rs)
-
-
-relevantClausesNaiveFeatures
- :: Float -- ^ Pass mark
- -> Set Feature -- ^ Relevant features
- -> Set Hypothesis -- ^ working irrelevant facts
- -> Map Hypothesis Float -- ^ Accumulator of relevant facts
- -> Map Hypothesis Float -- ^ Final relevant facts
-relevantClausesNaiveFeatures p rs cs a =
- let ms = Map.fromSet (clauseMarkNaiveFeatures rs) cs
- rels = Map.filter (p <=) ms
- cs' = Map.keysSet (Map.difference ms rels)
- p' = p + (1 - p) / convergence
- a' = a `Map.union` rels
- rs' = Set.unions (Set.map (features . hypothesisFormula) (Map.keysSet rels)) `Set.union` rs
- in
- if Map.null rels
- then a
- else relevantClausesNaiveFeatures p' rs' cs' a'
-
-
-clauseMarkNaive
- :: Set Symbol
- -> Hypothesis
- -> Float
-clauseMarkNaive rs = clauseMarkNaiveFeatures (Set.map FeatureSymbol rs)
-
-
-clauseMarkNaiveFeatures
- :: Set Feature
- -> Hypothesis
- -> Float
-clauseMarkNaiveFeatures rs c =
- let cs = features (hypothesisFormula c)
- r = cs `Set.intersection` rs
- ir = cs `Set.difference` r
- in ratio (int2Float (Set.size r)) (int2Float (Set.size r + Set.size ir))
-
-
-clauseMark :: Set Symbol -> ExprOf a -> Map Symbol Int -> Float
-clauseMark rs c ftab =
- featureClauseMark
- (Set.map FeatureSymbol rs)
- (features c)
- (Map.mapKeys FeatureSymbol ftab)
-
-
-featureClauseMark :: Set Feature -> Set Feature -> Map Feature Int -> Float
-featureClauseMark rs cs ftab =
- let
- r = cs `Set.intersection` rs
- ir = cs `Set.difference` r
- m = sum (Set.map (ftab `featureWeight`) r)
- in ratio m (m + int2Float (Set.size ir))
-
-
-funWeight :: Map Symbol Int -> Symbol -> Float
-funWeight ftab f = weightFromFrequency (Map.lookup f ftab ?? 0)
-
-
-featureWeight :: Map Feature Int -> Feature -> Float
-featureWeight ftab f = weightFromFrequency (Map.lookup f ftab ?? 0)
-
-
-weightFromFrequency :: Int -> Float
-weightFromFrequency n | n <= 0 = 0
-weightFromFrequency n = 1 + 2 / log (int2Float n + 1)
-
-
-ratio :: Float -> Float -> Float
-ratio _ 0 = 0
-ratio n d = n / d
-
-
-features :: ExprOf a -> Set Feature
-features = \case
- TermVar{} -> Set.empty
- TermSymbol _pos sym es -> Set.insert (FeatureSymbol sym) (Set.unions (fmap features es))
- TermSymbolStruct sym e -> Set.insert (FeatureStruct sym) (foldMap features e)
- Apply e es -> features e `Set.union` Set.unions (fmap features (toList es))
- TermSep _ e scope -> features e `Set.union` features (fromScope scope)
- ReplacePred _ _ e scope -> features e `Set.union` features (fromScope scope)
- ReplaceFun es scope cond -> (Set.unions (fmap (features . snd) es)) `Set.union` features (fromScope scope) `Set.union` features (fromScope cond)
- Connected _ e1 e2 -> features e1 `Set.union` features e2
- Lambda scope -> features (fromScope scope)
- Quantified _ scope -> features (fromScope scope)
- PropositionalConstant{} -> Set.empty
- Not _pos e -> features e
-
-
-symbols :: ExprOf a -> Set Symbol
-symbols = Set.fromList . mapMaybe featureSymbol . Set.toList . features
-
-
-featureSymbol :: Feature -> Maybe Symbol
-featureSymbol = \case
- FeatureSymbol sym -> Just sym
- FeatureStruct{} -> Nothing
-
-
-featureTable :: ExprOf a -> Map Feature Int
-featureTable = \case
- TermVar{} -> Map.empty
- TermSymbol _pos sym es -> insert (FeatureSymbol sym) 1 (unions (fmap featureTable es))
- TermSymbolStruct sym e -> insert (FeatureStruct sym) 1 (foldMap featureTable e)
- Apply e es -> featureTable e `union` unions (fmap featureTable (toList es))
- TermSep _ e scope -> featureTable e `union` featureTable (fromScope scope)
- ReplacePred _ _ e scope -> featureTable e `union` featureTable (fromScope scope)
- ReplaceFun es scope cond -> (unions (fmap (featureTable . snd) (toList es))) `union` featureTable (fromScope scope) `union` featureTable (fromScope cond)
- Connected _ e1 e2 -> featureTable e1 `union` featureTable e2
- Lambda scope -> featureTable (fromScope scope)
- Quantified _ scope -> featureTable (fromScope scope)
- PropositionalConstant{} -> Map.empty
- Not _pos e -> featureTable e
- where
- union = Map.unionWith (+)
- unions = Map.unionsWith (+)
- insert = Map.insertWith (+)
-
-symbolTable :: ExprOf a -> Map Symbol Int
-symbolTable = Map.fromListWith (+) . mapMaybe go . Map.toList . featureTable
- where
- go (FeatureSymbol sym, n) = Just (sym, n)
- go (FeatureStruct{}, _) = Nothing
diff --git a/source/Provers.hs b/source/Provers.hs
index 7f85c29..941360c 100644
--- a/source/Provers.hs
+++ b/source/Provers.hs
@@ -32,11 +32,6 @@ module Provers
, preparedVerificationBytes
, preparedVerificationByteCount
, preparedVerificationRequestId
- , PreparedProverTask
- , prepareProverTask
- , preparedProverLogicalTask
- , preparedProverRequest
- , preparedProverTptpTask
, PreparedTypedProverTask
, prepareTypedProverTask
, preparedTypedProverLogicalProblem
@@ -45,24 +40,57 @@ module Provers
, AcceptedVampireRun
, acceptedVampireRequest
, provedVampireRun
- , runProver
- , runPreparedProver
- , runPreparedProverWithObserver
, runPreparedTypedProver
, runPreparedTypedProverWithObserver
- , runVampireProcess
+ , EffectiveJobs
+ , effectiveJobs
+ , effectiveJobsValue
+ , JobsSelection(..)
+ , selectEffectiveJobs
+ , WorkPosition
+ , workPosition
+ , workPositionModuleOrdinal
+ , workPositionLocalRequestOrdinal
+ , VampireExecutor
+ , VampireExecutorObservation(..)
+ , withVampireExecutor
+ , runPreparedTypedProverWithExecutor
+ , vampireExecutorObservation
) where
import Base
import Checking.Authority qualified as Authority
import Checking.Backend.Problem
import Checking.Backend.Tptp
-import Encoding
-import Report.Location
-import Syntax.Internal (Directness(..), Formula, Task(..), isIndirect)
-import Control.Exception (IOException, displayException)
+import Control.Concurrent.STM
+ ( TBQueue
+ , TMVar
+ , TVar
+ , atomically
+ , check
+ , modifyTVar'
+ , newEmptyTMVarIO
+ , newTBQueueIO
+ , newTVarIO
+ , orElse
+ , putTMVar
+ , readTBQueue
+ , readTVar
+ , readTVarIO
+ , takeTMVar
+ , writeTBQueue
+ , writeTVar
+ )
+import Control.Exception
+ ( AsyncException
+ , IOException
+ , SomeException
+ , displayException
+ , fromException
+ )
import Control.Exception qualified as Exception
+import Control.Monad (forever, replicateM, unless)
import Control.Monad.Logger
import Data.ByteString qualified as ByteString
import Data.IORef
@@ -76,6 +104,7 @@ import Data.Set qualified as Set
import Data.Text qualified as Text
import Data.Text.Encoding qualified as TextEncoding
import Data.Time
+import Numeric.Natural (Natural)
import System.Exit (ExitCode(..))
import System.Posix.Signals (sigKILL, signalProcessGroup)
import System.Posix.Types (ProcessGroupID)
@@ -92,7 +121,13 @@ import System.Timeout qualified as Timeout
import Text.Megaparsec
import Text.Megaparsec.Char qualified as Char
import TextBuilder
-import UnliftIO.Async (concurrently)
+import UnliftIO.Async
+ ( async
+ , cancel
+ , concurrently
+ , waitCatch
+ , waitCatchSTM
+ )
data Vampire = Vampire
{ vampireExecutable :: FilePath
@@ -119,9 +154,92 @@ vampireArguments Vampire{..} =
, "--mode", "casc"
, "--time_limit", toSeconds vampireTimeLimit
, "--memory_limit", toMegabytes vampireMemoryLimit
- , "--cores", "2"
+ , "--cores", "1"
]
+-- | A strictly positive invocation-local worker bound.
+newtype EffectiveJobs = EffectiveJobs Int
+ deriving (Show, Eq, Ord)
+
+effectiveJobs :: Int -> Maybe EffectiveJobs
+effectiveJobs amount
+ | amount > 0 = Just (EffectiveJobs amount)
+ | otherwise = Nothing
+
+effectiveJobsValue :: EffectiveJobs -> Int
+effectiveJobsValue (EffectiveJobs amount) = amount
+
+-- | The effective worker policy selected for one invocation. Processor
+-- discovery is operational evidence only and enters no durable identity.
+data JobsSelection = JobsSelection
+ { jobsSelectionDetectedProcessors :: !(Maybe Int)
+ , jobsSelectionEffectiveJobs :: !EffectiveJobs
+ , jobsSelectionWasOverridden :: !Bool
+ }
+ deriving (Show, Eq)
+
+-- | Select the worker bound, with processor discovery injected for focused
+-- testing. Asynchronous cancellation is never mistaken for failed discovery.
+selectEffectiveJobs
+ :: Maybe EffectiveJobs
+ -> IO Int
+ -> IO JobsSelection
+selectEffectiveJobs override detectProcessors =
+ case override of
+ Just selected ->
+ pure
+ JobsSelection
+ { jobsSelectionDetectedProcessors = Nothing
+ , jobsSelectionEffectiveJobs = selected
+ , jobsSelectionWasOverridden = True
+ }
+ Nothing -> do
+ detectedResult <- Exception.try detectProcessors
+ case detectedResult of
+ Left detectionFailure
+ | Just asynchronous <-
+ (fromException detectionFailure
+ :: Maybe AsyncException) ->
+ Exception.throwIO asynchronous
+ | otherwise ->
+ fallback
+ Right detected
+ | detected > 0 ->
+ pure
+ JobsSelection
+ { jobsSelectionDetectedProcessors =
+ Just detected
+ , jobsSelectionEffectiveJobs =
+ EffectiveJobs (max 1 (detected - 1))
+ , jobsSelectionWasOverridden = False
+ }
+ | otherwise ->
+ fallback
+ where
+ fallback =
+ pure
+ JobsSelection
+ { jobsSelectionDetectedProcessors = Nothing
+ , jobsSelectionEffectiveJobs = EffectiveJobs 1
+ , jobsSelectionWasOverridden = False
+ }
+
+-- | Stable runtime diagnostic position. It is deliberately separate from
+-- request, validation, cache, and mathematical identities.
+data WorkPosition = WorkPosition !Natural !Natural
+ deriving (Show, Eq, Ord)
+
+workPosition :: Natural -> Natural -> WorkPosition
+workPosition = WorkPosition
+
+workPositionModuleOrdinal :: WorkPosition -> Natural
+workPositionModuleOrdinal (WorkPosition moduleOrdinal _localOrdinal) =
+ moduleOrdinal
+
+workPositionLocalRequestOrdinal :: WorkPosition -> Natural
+workPositionLocalRequestOrdinal (WorkPosition _moduleOrdinal localOrdinal) =
+ localOrdinal
+
toSeconds :: TimeLimit -> String
toSeconds (Seconds secs) = show secs
@@ -292,39 +410,6 @@ preparedVerificationRequestId request =
IndirectTask -> Authority.PreparedRequestIndirect)
(preparedVerificationBytes request)
-data PreparedProverTask = PreparedProverTask
- !Task
- !PreparedTptpTask
- !PreparedVerificationRequest
-
-prepareProverTask :: Task -> PreparedProverTask
-prepareProverTask task =
- let preparedTptp = prepareTptpTask task
- preparedRequest =
- prepareVerificationRequest task preparedTptp
- in
- PreparedProverTask
- task
- preparedTptp
- preparedRequest
-
-preparedProverLogicalTask :: PreparedProverTask -> Task
-preparedProverLogicalTask
- (PreparedProverTask task _preparedTptp _preparedRequest) =
- task
-
-preparedProverRequest
- :: PreparedProverTask
- -> PreparedVerificationRequest
-preparedProverRequest
- (PreparedProverTask _task _preparedTptp preparedRequest) =
- preparedRequest
-
-preparedProverTptpTask :: PreparedProverTask -> PreparedTptpTask
-preparedProverTptpTask
- (PreparedProverTask _task preparedTptp _preparedRequest) =
- preparedTptp
-
data PreparedTypedProverTask ref local origin global =
PreparedTypedProverTask
!(TypedProblem ref local origin global)
@@ -506,72 +591,6 @@ captureChunkSize :: Int
captureChunkSize =
32 * 1024
-runProver
- :: (MonadIO io, MonadLogger io)
- => Vampire
- -> Task
- -> io
- ( Location
- , Formula
- , Either ProverProcessError ProverAnswer
- )
-runProver vampireCommand task =
- runPreparedProver vampireCommand (prepareProverTask task)
-
-runPreparedProver
- :: (MonadIO io, MonadLogger io)
- => Vampire
- -> PreparedProverTask
- -> io
- ( Location
- , Formula
- , Either ProverProcessError ProverAnswer
- )
-runPreparedProver
- vampireCommand =
- runPreparedProverWithObserver
- (\_request -> pure ())
- vampireCommand
-
-runPreparedProverWithObserver
- :: (MonadIO io, MonadLogger io)
- => (PreparedVerificationRequest -> IO ())
- -> Vampire
- -> PreparedProverTask
- -> io
- ( Location
- , Formula
- , Either ProverProcessError ProverAnswer
- )
-runPreparedProverWithObserver
- observer
- vampireCommand
- (PreparedProverTask task preparedTask preparedRequest) = do
- startTime <- liftIO getCurrentTime
- transcriptResult <-
- liftIO
- (runPreparedVampireProcessWithObserver
- observer
- vampireCommand
- preparedRequest)
- let answer =
- classifyVampireAnswer
- task
- vampireCommand
- preparedRequest
- <$> transcriptResult
- endTime <- liftIO getCurrentTime
- let duration = timeDifferenceToText startTime endTime
-
- logInfoN
- ( duration
- <> " "
- <> preparedTptpConjectureText preparedTask
- <> taskProvenance task
- )
-
- pure (taskLocation task, taskConjecture task, answer)
-
runPreparedTypedProver
:: (MonadIO io, MonadLogger io)
=> Vampire
@@ -630,52 +649,279 @@ runPreparedTypedProverWithObserver
<> "]")
pure answer
-taskProvenance :: Task -> Text
-taskProvenance task =
- " [" <> directness <> " at "
- <> Text.pack (show (locationToText (taskLocation task)))
- <> "]"
- where
- directness = case taskDirectness task of
- Direct -> "direct"
- Indirect _ -> "indirect"
+-- | Invocation-local bounded owner of Vampire subprocesses. The finite queue
+-- carries only immutable prepared bytes plus runtime diagnostic position;
+-- checker builders and typed tasks never cross this boundary.
+data VampireExecutor = VampireExecutor
+ { executorQueue :: !(TBQueue ExecutorJob)
+ , executorClosed :: !(TVar Bool)
+ , executorCommand :: !Vampire
+ , executorRequestObserver
+ :: !(WorkPosition -> PreparedVerificationRequest -> IO ())
+ , executorRuntime :: !(TVar VampireExecutorRuntime)
+ }
-runVampireProcess
- :: Vampire
- -> Task
- -> IO (Either ProverProcessError CompletedTranscript)
-runVampireProcess
- vampireCommand
- task =
- let preparedTask = prepareTptpTask task
- in runPreparedVampireProcess
- vampireCommand
- (prepareVerificationRequest task preparedTask)
-
-prepareVerificationRequest
- :: Task
- -> PreparedTptpTask
- -> PreparedVerificationRequest
-prepareVerificationRequest task preparedTask =
- PreparedVerificationRequest
- { preparedVerificationDialect = VerificationFof
- , preparedVerificationMode = vampireTaskMode task
- , preparedVerificationInput =
- TextEncoding.encodeUtf8
- (preparedTptpTextNewline preparedTask)
- , preparedVerificationText =
- preparedTptpText preparedTask
+data ExecutorJob = ExecutorJob
+ { executorJobPosition :: !WorkPosition
+ , executorJobRequest :: !PreparedVerificationRequest
+ , executorJobCancelled :: !(TVar Bool)
+ , executorJobCompletion
+ :: !(TMVar
+ (Either
+ SomeException
+ (Either ProverProcessError ProverAnswer)))
+ }
+
+data VampireExecutorRuntime = VampireExecutorRuntime
+ { runtimeSubmittedCount :: !Int
+ , runtimeRunCount :: !Int
+ , runtimeLiveCount :: !Int
+ , runtimeMaximumLiveCount :: !Int
+ , runtimeFirstStartNanoseconds :: !(Maybe Word64)
+ , runtimeExecutionNanoseconds :: !Word64
+ }
+
+data VampireExecutorObservation = VampireExecutorObservation
+ { vampireExecutorSubmittedCount :: !Int
+ , vampireExecutorRunCount :: !Int
+ , vampireExecutorMaximumLiveCount :: !Int
+ , vampireExecutorFirstStartNanoseconds :: !(Maybe Word64)
+ , vampireExecutorExecutionNanoseconds :: !Word64
+ }
+ deriving (Show, Eq)
+
+data VampireExecutorClosed = VampireExecutorClosed
+ deriving (Show)
+
+instance Exception.Exception VampireExecutorClosed
+
+data RequestObserverFailure = RequestObserverFailure SomeException
+
+instance Show RequestObserverFailure where
+ show (RequestObserverFailure observerError) =
+ "request observer failed: " <> displayException observerError
+
+instance Exception.Exception RequestObserverFailure
+
+initialVampireExecutorRuntime :: VampireExecutorRuntime
+initialVampireExecutorRuntime =
+ VampireExecutorRuntime
+ { runtimeSubmittedCount = 0
+ , runtimeRunCount = 0
+ , runtimeLiveCount = 0
+ , runtimeMaximumLiveCount = 0
+ , runtimeFirstStartNanoseconds = Nothing
+ , runtimeExecutionNanoseconds = 0
}
-runPreparedVampireProcess
- :: Vampire
+-- | Bracket exactly the selected number of workers. Cancelling the bracket
+-- cancels each worker; a worker owning a subprocess in turn terminates and
+-- reaps that process group through the ordinary supervisor boundary.
+withVampireExecutor
+ :: EffectiveJobs
+ -> Vampire
+ -> (WorkPosition -> PreparedVerificationRequest -> IO ())
+ -> (VampireExecutor -> IO value)
+ -> IO value
+withVampireExecutor selected command observer action =
+ Exception.bracket acquire release (action . fst)
+ where
+ workerCount = effectiveJobsValue selected
+
+ acquire = do
+ queue <- newTBQueueIO
+ (fromIntegral workerCount * 2)
+ closed <- newTVarIO False
+ runtime <- newTVarIO initialVampireExecutorRuntime
+ let executor =
+ VampireExecutor
+ { executorQueue = queue
+ , executorClosed = closed
+ , executorCommand = command
+ , executorRequestObserver = observer
+ , executorRuntime = runtime
+ }
+ workers <- replicateM workerCount (async (executorWorker executor))
+ pure (executor, workers)
+
+ release (executor, workers) = do
+ atomically (writeTVar (executorClosed executor) True)
+ traverse_ cancel workers
+ traverse_ waitCatch workers
+
+runPreparedTypedProverWithExecutor
+ :: (MonadIO io, MonadLogger io)
+ => VampireExecutor
+ -> WorkPosition
+ -> PreparedTypedProverTask ref local origin global
+ -> io (Either ProverProcessError ProverAnswer)
+runPreparedTypedProverWithExecutor
+ executor
+ position
+ (PreparedTypedProverTask
+ _problem
+ prepared
+ preparedRequest) = do
+ startTime <- liftIO getCurrentTime
+ answer <- liftIO (submitVampireRequest executor position preparedRequest)
+ endTime <- liftIO getCurrentTime
+ let dialect =
+ case preparedTypedTptpRoute prepared of
+ RouteFof -> "FOF"
+ RouteTh0 -> "TH0"
+ logInfoN
+ (timeDifferenceToText startTime endTime
+ <> " "
+ <> preparedTypedTptpConjectureText prepared
+ <> " [typed "
+ <> dialect
+ <> "]")
+ pure answer
+
+vampireExecutorObservation
+ :: VampireExecutor
+ -> IO VampireExecutorObservation
+vampireExecutorObservation executor = do
+ runtime <- readTVarIO (executorRuntime executor)
+ pure
+ VampireExecutorObservation
+ { vampireExecutorSubmittedCount = runtimeSubmittedCount runtime
+ , vampireExecutorRunCount = runtimeRunCount runtime
+ , vampireExecutorMaximumLiveCount =
+ runtimeMaximumLiveCount runtime
+ , vampireExecutorFirstStartNanoseconds =
+ runtimeFirstStartNanoseconds runtime
+ , vampireExecutorExecutionNanoseconds =
+ runtimeExecutionNanoseconds runtime
+ }
+
+submitVampireRequest
+ :: VampireExecutor
+ -> WorkPosition
-> PreparedVerificationRequest
- -> IO (Either ProverProcessError CompletedTranscript)
-runPreparedVampireProcess
- vampireCommand =
- runPreparedVampireProcessWithObserver
- (\_request -> pure ())
- vampireCommand
+ -> IO (Either ProverProcessError ProverAnswer)
+submitVampireRequest executor position request =
+ Exception.mask \restore -> do
+ -- Force the compact queue payload before handing it to a worker.
+ _ <- Exception.evaluate (preparedVerificationByteCount request)
+ _ <- Exception.evaluate
+ (Text.length (preparedVerificationText request))
+ cancelled <- newTVarIO False
+ completion <- newEmptyTMVarIO
+ let job =
+ ExecutorJob
+ { executorJobPosition = position
+ , executorJobRequest = request
+ , executorJobCancelled = cancelled
+ , executorJobCompletion = completion
+ }
+ cancelJob = atomically (writeTVar cancelled True)
+ enqueue = atomically do
+ closed <- readTVar (executorClosed executor)
+ if closed
+ then pure False
+ else do
+ writeTBQueue (executorQueue executor) job
+ modifyTVar'
+ (executorRuntime executor)
+ (\runtime ->
+ runtime
+ { runtimeSubmittedCount =
+ runtimeSubmittedCount runtime + 1
+ })
+ pure True
+ accepted <- restore enqueue `Exception.onException` cancelJob
+ unless accepted (Exception.throwIO VampireExecutorClosed)
+ outcome <-
+ restore (atomically (takeTMVar completion))
+ `Exception.onException` cancelJob
+ either Exception.throwIO pure outcome
+
+executorWorker :: VampireExecutor -> IO ()
+executorWorker executor =
+ forever do
+ job <- atomically (readTBQueue (executorQueue executor))
+ cancelled <- readTVarIO (executorJobCancelled job)
+ unless cancelled (executeJob executor job)
+
+data JobWait value
+ = JobFinished !(Either SomeException value)
+ | JobCancelled
+
+executeJob :: VampireExecutor -> ExecutorJob -> IO ()
+executeJob executor job =
+ Exception.mask \restore -> do
+ running <- async
+ (restore
+ (observeExecutorRun executor
+ (runPreparedVerificationRequest
+ (executorRequestObserver executor
+ (executorJobPosition job))
+ (executorCommand executor)
+ (executorJobRequest job))))
+ waited <- restore
+ (atomically
+ ( (JobFinished <$> waitCatchSTM running)
+ `orElse`
+ (do
+ cancelled <- readTVar
+ (executorJobCancelled job)
+ check cancelled
+ pure JobCancelled)
+ ))
+ `Exception.onException`
+ (cancel running >> void (waitCatch running))
+ case waited of
+ JobFinished result ->
+ atomically
+ (putTMVar (executorJobCompletion job) result)
+ JobCancelled -> do
+ cancel running
+ void (waitCatch running)
+
+observeExecutorRun :: VampireExecutor -> IO value -> IO value
+observeExecutorRun executor action = do
+ started <- getMonotonicTimeNSec
+ atomically
+ (modifyTVar'
+ (executorRuntime executor)
+ (\runtime ->
+ let live = runtimeLiveCount runtime + 1
+ in runtime
+ { runtimeRunCount = runtimeRunCount runtime + 1
+ , runtimeLiveCount = live
+ , runtimeMaximumLiveCount =
+ max live (runtimeMaximumLiveCount runtime)
+ , runtimeFirstStartNanoseconds =
+ runtimeFirstStartNanoseconds runtime <|> Just started
+ }))
+ action `Exception.finally` do
+ finished <- getMonotonicTimeNSec
+ atomically
+ (modifyTVar'
+ (executorRuntime executor)
+ (\runtime ->
+ runtime
+ { runtimeLiveCount = runtimeLiveCount runtime - 1
+ , runtimeExecutionNanoseconds =
+ runtimeExecutionNanoseconds runtime
+ + (finished - started)
+ }))
+
+runPreparedVerificationRequest
+ :: (PreparedVerificationRequest -> IO ())
+ -> Vampire
+ -> PreparedVerificationRequest
+ -> IO (Either ProverProcessError ProverAnswer)
+runPreparedVerificationRequest observer command request = do
+ transcriptResult <-
+ runPreparedVampireProcessWithObserver observer command request
+ pure
+ (classifyPreparedVampireAnswer
+ "typed obligation"
+ command
+ request
+ <$> transcriptResult)
runPreparedVampireProcessWithObserver
:: (PreparedVerificationRequest -> IO ())
@@ -706,10 +952,12 @@ runPreparedVampireProcessWithObserver
pure (fromIntegral pid)
Nothing ->
impossible
- "runVampireProcess: missing process-group id"
+ "Vampire supervisor: missing process-group id"
restore
(do
- observer preparedRequest
+ runRequestObserver
+ observer
+ preparedRequest
superviseVampireProcess
executable
(vampireTimeLimit vampireCommand)
@@ -725,27 +973,50 @@ runPreparedVampireProcessWithObserver
processHandle
_ ->
impossible
- "runVampireProcess: expected CreatePipe handles")
+ "Vampire supervisor: expected CreatePipe handles")
:: IO
(Either
- IOException
+ SomeException
(Either ProverProcessError CompletedTranscript))
case processResult of
Right result ->
pure result
- Left err -> do
- started <- readIORef callbackStarted
- pure
- (Left
- (if started
- then
- ProverLifecycleFailed
- executable
- (exceptionText err)
- else
- ProverLaunchFailed
- executable
- (exceptionText err)))
+ Left err
+ | Just (RequestObserverFailure observerFailure) <-
+ fromException err ->
+ Exception.throwIO observerFailure
+ | Just asynchronous <-
+ (fromException err :: Maybe AsyncException) ->
+ Exception.throwIO asynchronous
+ | Just ioFailure <-
+ (fromException err :: Maybe IOException) -> do
+ started <- readIORef callbackStarted
+ pure
+ (Left
+ (if started
+ then
+ ProverLifecycleFailed
+ executable
+ (exceptionText ioFailure)
+ else
+ ProverLaunchFailed
+ executable
+ (exceptionText ioFailure)))
+ | otherwise ->
+ Exception.throwIO err
+
+runRequestObserver
+ :: (PreparedVerificationRequest -> IO ())
+ -> PreparedVerificationRequest
+ -> IO ()
+runRequestObserver observer request =
+ observer request `Exception.catch` \observerError ->
+ case fromException observerError :: Maybe AsyncException of
+ Just asynchronous ->
+ Exception.throwIO asynchronous
+ Nothing ->
+ Exception.throwIO
+ (RequestObserverFailure observerError)
superviseVampireProcess
:: FilePath
@@ -1033,25 +1304,6 @@ exceptionText :: IOException -> Text
exceptionText =
Text.pack . displayException
-classifyVampireAnswer
- :: Task
- -> Vampire
- -> PreparedVerificationRequest
- -> CompletedTranscript
- -> ProverAnswer
-classifyVampireAnswer
- task
- vampireCommand
- preparedRequest
- transcript =
- classifyPreparedVampireAnswer
- (Text.pack
- (show
- (taskConjectureLabel task)))
- vampireCommand
- preparedRequest
- transcript
-
classifyPreparedVampireAnswer
:: Text
-> Vampire
@@ -1152,12 +1404,6 @@ renderProtocolError protocolError CompleteCapturedStreams{..} =
, completedStderr
]
-vampireTaskMode :: Task -> VampireTaskMode
-vampireTaskMode task =
- if isIndirect task
- then IndirectTask
- else DirectTask
-
vampireStatusFromText :: Text -> VampireStatus
vampireStatusFromText = \case
"Theorem" -> StatusTheorem
diff --git a/source/Render/Html.hs b/source/Render/Html.hs
index 20ac33b..c37a278 100644
--- a/source/Render/Html.hs
+++ b/source/Render/Html.hs
@@ -4,7 +4,11 @@
{-# LANGUAGE RecordWildCards #-}
module Render.Html
- ( renderDocument
+ ( HtmlRenderIndex
+ , HtmlPagePresentation
+ , buildRenderIndex
+ , htmlPagePresentationSource
+ , renderDocument
, supportScriptAssetContents
) where
@@ -61,6 +65,21 @@ type AnchorMap = Map Marker Text
type BlockRenderInfo = (Int, Block, Text)
type PreviewMap = Map Marker PreviewEntry
+data HtmlRenderIndex = HtmlRenderIndex
+ !(Map Marker IndexedReferenceTarget)
+
+data HtmlPagePresentation = HtmlPagePresentation
+ { htmlPagePresentationSource :: !ResolvedSource
+ , pagePresentationBlockInfos :: ![BlockRenderInfo]
+ , pagePresentationAnchors :: !AnchorMap
+ , pagePresentationReferencedMarkers :: !(Set Marker)
+ }
+
+data IndexedReferenceTarget = IndexedReferenceTarget
+ !Int
+ !ResolvedSource
+ !ReferenceTarget
+
data ReferenceContext = ReferenceContext
{ referenceAnchors :: AnchorMap
, referencePreviews :: PreviewMap
@@ -112,36 +131,36 @@ referenceGroupThreshold = 5
renderDocument
:: HtmlRenderContext
-> Text
- -> [Block]
- -> [(ResolvedSource, [Block])]
+ -> HtmlRenderIndex
+ -> HtmlPagePresentation
-> Either HtmlRenderContextError Text
-renderDocument context hintsSource blocks sourceBlocks = do
- let indexedBlocks = zip [1 :: Int ..] blocks
- blockInfos =
- [ (index, block, blockAnchorId index block)
- | (index, block) <- indexedBlocks
- ]
- rootTargets =
- concatMap referenceTargetsOfBlockRenderInfo blockInfos
- anchors = Map.fromList
- [ (targetMarker, targetAnchorId)
- | ReferenceTarget{targetMarker, targetAnchorId} <-
- rootTargets
- ]
- referencedMarkers = collectReferencedMarkers blocks
+renderDocument
+ context
+ hintsSource
+ renderIndex
+ HtmlPagePresentation
+ { pagePresentationBlockInfos = blockInfos
+ , pagePresentationAnchors = anchors
+ , pagePresentationReferencedMarkers = referencedMarkers
+ } = do
previews <-
buildPreviewMap
context
referencedMarkers
anchors
- sourceBlocks
+ renderIndex
let result =
case formatMissingHintWarning missingHints of
Nothing -> rendered
Just warningText ->
trace (Text.unpack warningText) rendered
hints = parseHints hintsSource
- missingHints = collectMissingHints hints blocks
+ missingHints =
+ collectMissingHints
+ hints
+ [ block
+ | (_index, block, _blockId) <- blockInfos
+ ]
rendered = LazyText.toStrict (renderText (renderPage hints))
pageLabel = htmlCurrentPageLabel context
tocBlocks = [(index, blockId, block) | (index, block, blockId) <- blockInfos, includeInToc block]
@@ -182,6 +201,73 @@ renderDocument context hintsSource blocks sourceBlocks = do
("" :: Text)
Right result
+-- | Index every block target and every page's referenced markers once in
+-- deterministic source order. Rendering a page subsequently performs only
+-- marker lookups in the shared index.
+buildRenderIndex
+ :: NonEmpty (ResolvedSource, [Block])
+ -> (HtmlRenderIndex, NonEmpty HtmlPagePresentation)
+buildRenderIndex sourceBlocks =
+ ( HtmlRenderIndex
+ (Map.fromList
+ [ ( targetMarker target
+ , IndexedReferenceTarget ordinal source target
+ )
+ | (ordinal, (source, target)) <-
+ zip [1 :: Int ..] orderedTargets
+ ])
+ , pages
+ )
+ where
+ analysedPages =
+ uncurry analysePage <$> sourceBlocks
+ pages =
+ fst <$> analysedPages
+ orderedTargets =
+ [ (htmlPagePresentationSource page, target)
+ | (page, targets) <- NonEmpty.toList analysedPages
+ , target <- targets
+ ]
+
+ analysePage source blocks =
+ ( HtmlPagePresentation
+ { htmlPagePresentationSource = source
+ , pagePresentationBlockInfos = blockInfos
+ , pagePresentationAnchors =
+ Map.fromList
+ [ (targetMarker, targetAnchorId)
+ | ReferenceTarget
+ { targetMarker
+ , targetAnchorId
+ } <- targets
+ ]
+ , pagePresentationReferencedMarkers =
+ foldMap
+ (\(_blockInfo, _targets, references) -> references)
+ analysedBlocks
+ }
+ , targets
+ )
+ where
+ analysedBlocks =
+ [ ( blockInfo
+ , referenceTargetsOfBlockRenderInfo blockInfo
+ , collectReferencedMarkersOfBlock block
+ )
+ | (index, block) <- zip [1 :: Int ..] blocks
+ , let blockInfo =
+ (index, block, blockAnchorId index block)
+ ]
+ blockInfos =
+ [ blockInfo
+ | (blockInfo, _targets, _references) <- analysedBlocks
+ ]
+ targets =
+ concat
+ [ blockTargets
+ | (_blockInfo, blockTargets, _references) <- analysedBlocks
+ ]
+
pageStyles :: Text
pageStyles = Text.unlines
@@ -955,10 +1041,10 @@ referencePreviewScript = Text.unlines
, "})();"
]
-collectReferencedMarkers :: [Block] -> Set Marker
-collectReferencedMarkers =
- foldMap collectBlock
- where
+collectReferencedMarkersOfBlock :: Block -> Set Marker
+collectReferencedMarkersOfBlock =
+ collectBlock
+ where
collectBlock :: Block -> Set Marker
collectBlock = \case
BlockProof _start proof _end ->
@@ -2376,29 +2462,30 @@ buildPreviewMap
:: HtmlRenderContext
-> Set Marker
-> AnchorMap
- -> [(ResolvedSource, [Block])]
+ -> HtmlRenderIndex
-> Either HtmlRenderContextError PreviewMap
-buildPreviewMap context referencedMarkers anchors sourceBlocks =
+buildPreviewMap
+ context
+ referencedMarkers
+ anchors
+ (HtmlRenderIndex targetIndex) =
Map.fromList <$> traverse makePreviewEntry indexedTargets
where
targets =
- [ (source, target)
- | (source, blocks) <- sourceBlocks
- , let indexedBlocks = zip [1 :: Int ..] blocks
- , let blockInfos =
- [ (index, block, blockAnchorId index block)
- | (index, block) <- indexedBlocks
- ]
- , target <-
- concatMap
- referenceTargetsOfBlockRenderInfo
- blockInfos
- , targetMarker target `Set.member` referencedMarkers
- , targetMarker target `Map.notMember` anchors
- , source /= htmlCurrentSource context
- ]
+ List.sortOn targetOrdinal
+ [ indexed
+ | marker <- Set.toList referencedMarkers
+ , marker `Map.notMember` anchors
+ , Just indexed@(IndexedReferenceTarget _ source _target) <-
+ [Map.lookup marker targetIndex]
+ , source /= htmlCurrentSource context
+ ]
+ targetOrdinal (IndexedReferenceTarget ordinal _source _target) =
+ ordinal
+ sourceTarget (IndexedReferenceTarget _ordinal source target) =
+ (source, target)
indexedTargets =
- zip [1 :: Int ..] targets
+ zip [1 :: Int ..] (sourceTarget <$> targets)
makePreviewEntry (index, (source, target)) = do
previewSourceLabel <-
diff --git a/source/Render/Html/Context.hs b/source/Render/Html/Context.hs
index b8894f5..151edd5 100644
--- a/source/Render/Html/Context.hs
+++ b/source/Render/Html/Context.hs
@@ -4,9 +4,12 @@
-- | Browser-facing routing authority for one rendered HTML page.
module Render.Html.Context
- ( HtmlRenderContext
+ ( HtmlRenderEnvironment
+ , htmlRenderEnvironment
+ , HtmlRenderContext
, HtmlRenderContextError(..)
, htmlRenderContext
+ , htmlRenderContextFromEnvironment
, htmlCurrentSource
, htmlCurrentPageUrl
, htmlCurrentPageLabel
@@ -37,36 +40,56 @@ instance Exception HtmlRenderContextError
data HtmlRenderContext = HtmlRenderContext
{ contextCurrentSource :: !ResolvedSource
, contextCurrentPageUrl :: !UrlPath
- , contextSourceUrls :: !(Map ResolvedSource UrlPath)
- , contextRouteNamespaces :: !(Map SourceMountId UrlPath)
- , contextSupportScriptUrl :: !UrlPath
+ , contextEnvironment :: !HtmlRenderEnvironment
}
deriving stock (Show, Eq)
-htmlRenderContext
- :: HtmlLayout
- -> ResolvedSource
- -> Either HtmlRenderContextError HtmlRenderContext
-htmlRenderContext layout currentSource = do
- let sourceUrls =
+data HtmlRenderEnvironment = HtmlRenderEnvironment
+ { environmentSourceUrls :: !(Map ResolvedSource UrlPath)
+ , environmentRouteNamespaces :: !(Map SourceMountId UrlPath)
+ , environmentSupportScriptUrl :: !UrlPath
+ }
+ deriving stock (Show, Eq)
+
+htmlRenderEnvironment :: HtmlLayout -> HtmlRenderEnvironment
+htmlRenderEnvironment layout =
+ HtmlRenderEnvironment
+ { environmentSourceUrls =
Map.fromList
[ (source, routeUrlPath route)
| (source, route) <- htmlPageRoutes layout
]
+ , environmentRouteNamespaces =
+ htmlMountUrlPrefixes layout
+ , environmentSupportScriptUrl =
+ routeUrlPath (htmlSupportScriptRoute layout)
+ }
+
+htmlRenderContext
+ :: HtmlLayout
+ -> ResolvedSource
+ -> Either HtmlRenderContextError HtmlRenderContext
+htmlRenderContext layout =
+ htmlRenderContextFromEnvironment
+ (htmlRenderEnvironment layout)
+
+htmlRenderContextFromEnvironment
+ :: HtmlRenderEnvironment
+ -> ResolvedSource
+ -> Either HtmlRenderContextError HtmlRenderContext
+htmlRenderContextFromEnvironment environment currentSource = do
currentPageUrl <-
maybe
(Left (HtmlCurrentSourceNotRouted currentSource))
Right
- (Map.lookup currentSource sourceUrls)
+ (Map.lookup
+ currentSource
+ (environmentSourceUrls environment))
Right
HtmlRenderContext
{ contextCurrentSource = currentSource
, contextCurrentPageUrl = currentPageUrl
- , contextSourceUrls = sourceUrls
- , contextRouteNamespaces =
- htmlMountUrlPrefixes layout
- , contextSupportScriptUrl =
- routeUrlPath (htmlSupportScriptRoute layout)
+ , contextEnvironment = environment
}
htmlCurrentSource :: HtmlRenderContext -> ResolvedSource
@@ -85,17 +108,17 @@ htmlRouteNamespaces
:: HtmlRenderContext
-> Map SourceMountId UrlPath
htmlRouteNamespaces =
- contextRouteNamespaces
+ environmentRouteNamespaces . contextEnvironment
htmlSourceUrl
:: HtmlRenderContext
-> ResolvedSource
-> Either HtmlRenderContextError UrlPath
-htmlSourceUrl HtmlRenderContext{contextSourceUrls} source =
+htmlSourceUrl HtmlRenderContext{contextEnvironment} source =
maybe
(Left (HtmlReferencedSourceNotRouted source))
Right
- (Map.lookup source contextSourceUrls)
+ (Map.lookup source (environmentSourceUrls contextEnvironment))
htmlSourceLabel
:: HtmlRenderContext
@@ -136,7 +159,8 @@ htmlSupportScriptHref :: HtmlRenderContext -> Text
htmlSupportScriptHref context =
renderRelativeUrlPath
(contextCurrentPageUrl context)
- (contextSupportScriptUrl context)
+ (environmentSupportScriptUrl
+ (contextEnvironment context))
resolvedSourceLabel :: ResolvedSource -> Text
resolvedSourceLabel source =
diff --git a/source/Render/Html/Export.hs b/source/Render/Html/Export.hs
index 3faf506..8b62f7d 100644
--- a/source/Render/Html/Export.hs
+++ b/source/Render/Html/Export.hs
@@ -1,11 +1,11 @@
+{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE NoImplicitPrelude #-}
--- | Prepare a complete HTML export from one fresh resolved source graph.
+-- | Prepare a complete HTML export from retained parsed presentation.
module Render.Html.Export
- ( PreparedHtmlExport
- , preparedHtmlRootDocument
- , preparedHtmlOutputBundle
+ ( HtmlPresentation
+ , htmlPresentationFromParsedWorkspace
, HtmlExportError(..)
, renderHtmlExportError
, prepareHtmlExport
@@ -14,12 +14,11 @@ module Render.Html.Export
import Base
import Felix.Parse
import Felix.Source
-import Felix.Source.Graph
import Render.Html qualified as Html
import Render.Html.Context
import Render.Html.Layout
import Render.Html.Output
-import Syntax.Abstract qualified as Raw
+import Syntax.Abstract (Block)
import Control.Exception (Exception)
import Data.Bifunctor (first)
@@ -28,31 +27,51 @@ import Data.Text qualified as Text
import Data.Text.Encoding qualified as TextEncoding
-data PreparedHtmlExport = PreparedHtmlExport
- !Text
- !PreparedHtmlBundle
+-- | The strict, invocation-local subset of parsed presentation needed by the
+-- renderer. Construction forces the complete module sequence and every page
+-- shell, severing references to parser payloads, syntax interfaces, and
+-- canonical cache payloads.
+data HtmlPresentation = HtmlPresentation
+ !(NonEmpty HtmlSourcePresentation)
-preparedHtmlRootDocument :: PreparedHtmlExport -> Text
-preparedHtmlRootDocument
- (PreparedHtmlExport rootDocument _bundle) =
- rootDocument
+data HtmlSourcePresentation = HtmlSourcePresentation
+ !ResolvedSource
+ ![Block]
-preparedHtmlOutputBundle
- :: PreparedHtmlExport
- -> PreparedHtmlBundle
-preparedHtmlOutputBundle
- (PreparedHtmlExport _rootDocument bundle) =
- bundle
+htmlPresentationFromParsedWorkspace
+ :: ParsedSourceWorkspace
+ -> HtmlPresentation
+htmlPresentationFromParsedWorkspace workspace =
+ HtmlPresentation
+ (strictMapNonEmpty project parsedModules)
+ where
+ parsedModules =
+ parsedWorkspaceImportedBeforeImporter workspace
+ project parsedModule =
+ HtmlSourcePresentation
+ (parsedModuleResolved parsedModule)
+ (parsedModuleBlocks parsedModule)
+
+strictMapNonEmpty :: (a -> b) -> NonEmpty a -> NonEmpty b
+strictMapNonEmpty f (value :| values) =
+ let !firstPage = f value
+ !rest = strictMapList f values
+ in firstPage :| rest
+
+strictMapList :: (a -> b) -> [a] -> [b]
+strictMapList _ [] =
+ []
+strictMapList f (value : values) =
+ let !next = f value
+ !rest = strictMapList f values
+ in next : rest
data HtmlExportError
= HtmlRendererDataNotFound !FilePath ![FilePath]
| HtmlRendererDataLookupFailed !FilePath !Text
| HtmlRendererDataReadFailed !FilePath !Text
- | HtmlExportSourceError !SourceError
- | HtmlExportParseError !ParseWorkspaceError
| HtmlExportLayoutError !HtmlLayoutError
| HtmlExportContextError !HtmlRenderContextError
- | HtmlExportOutputError !HtmlOutputError
deriving stock (Show)
instance Exception HtmlExportError
@@ -66,10 +85,6 @@ renderHtmlExportError = \case
"could not locate renderer data " <> quotePath path <> ": " <> reason
HtmlRendererDataReadFailed path reason ->
"could not read renderer data " <> quotePath path <> ": " <> reason
- HtmlExportSourceError failure ->
- renderSourceError failure
- HtmlExportParseError failure ->
- renderParseWorkspaceError failure
HtmlExportLayoutError failure ->
renderHtmlLayoutError failure
HtmlExportContextError failure ->
@@ -78,8 +93,6 @@ renderHtmlExportError = \case
"current source has no HTML route: " <> sourceLabel source
HtmlReferencedSourceNotRouted source ->
"referenced source has no HTML route: " <> sourceLabel source
- HtmlExportOutputError failure ->
- renderHtmlOutputError failure
where
sourceLabel source =
sourceMountIdText (resolvedSourceMount source)
@@ -92,89 +105,76 @@ renderHtmlExportError = \case
prepareHtmlExport
:: [(SourceMountId, [Text])]
- -> SourceMounts
- -> RootRequest
+ -> HtmlPresentation
-> Text
- -> IO (Either HtmlExportError PreparedHtmlExport)
-prepareHtmlExport mountPrefixes mounts request hints = do
- graphResult <-
- buildResolvedSourceGraph mounts request
- case graphResult of
- Left err ->
- pure (Left (HtmlExportSourceError err))
- Right graph ->
- case
- first
- HtmlExportLayoutError
- (layoutHtmlSourceGraph mountPrefixes graph) of
- Left err ->
- pure (Left err)
- Right layout -> do
- workspaceResult <-
- parseResolvedSourceGraph graph
- pure do
- workspace <-
- first
- HtmlExportParseError
- workspaceResult
- prepareRenderedExport
- hints
- layout
- workspace
+ -> Either HtmlExportError [PreparedHtmlArtifact]
+prepareHtmlExport
+ mountPrefixes
+ (HtmlPresentation presentation)
+ hints = do
+ let sources =
+ sourceOf <$> NonEmpty.toList presentation
+ layout <-
+ first
+ HtmlExportLayoutError
+ (layoutHtmlSources mountPrefixes sources)
+ prepareRenderedExport hints layout presentation
+ where
+ sourceOf (HtmlSourcePresentation source _blocks) =
+ source
prepareRenderedExport
:: Text
-> HtmlLayout
- -> ParsedSourceWorkspace
- -> Either HtmlExportError PreparedHtmlExport
-prepareRenderedExport hints layout workspace = do
- let orderedNodes =
- parsedWorkspaceImportedBeforeImporter workspace
- sourceBlocks =
- [ (parsedModuleResolved node, parsedModuleBlocks node)
- | node <- NonEmpty.toList orderedNodes
- ]
- renderedPages <-
+ -> NonEmpty HtmlSourcePresentation
+ -> Either HtmlExportError [PreparedHtmlArtifact]
+prepareRenderedExport hints layout presentation = do
+ let sourceBlocks =
+ (\(HtmlSourcePresentation source blocks) ->
+ (source, blocks))
+ <$> presentation
+ (unforcedRenderIndex, pages) =
+ Html.buildRenderIndex sourceBlocks
+ !renderIndex = unforcedRenderIndex
+ renderEnvironment =
+ htmlRenderEnvironment layout
+ pageArtifacts <-
traverse
- (renderSourcePage hints layout sourceBlocks)
- orderedNodes
- let (_rootSource, _rootRoute, rootDocument) =
- NonEmpty.last renderedPages
- pageArtifacts =
- [ ( routeDestination route
- , TextEncoding.encodeUtf8 document
- )
- | (_source, route, document) <-
- NonEmpty.toList renderedPages
- ]
- supportRoute =
+ (prepareSourceArtifact
+ renderEnvironment
+ layout
+ hints
+ renderIndex)
+ pages
+ let supportRoute =
htmlSupportScriptRoute layout
supportArtifact =
- ( routeDestination supportRoute
- , TextEncoding.encodeUtf8
- Html.supportScriptAssetContents
- )
- bundle <-
- first
- HtmlExportOutputError
- (preparedHtmlBundle
- (pageArtifacts <> [supportArtifact]))
- Right (PreparedHtmlExport rootDocument bundle)
+ preparedHtmlArtifact
+ (routeDestination supportRoute)
+ (Right
+ (TextEncoding.encodeUtf8
+ Html.supportScriptAssetContents))
+ -- Page artifacts retain imported-before-importer source order. The
+ -- singleton support asset is published deterministically afterward.
+ Right (NonEmpty.toList pageArtifacts <> [supportArtifact])
-renderSourcePage
- :: Text
+prepareSourceArtifact
+ :: HtmlRenderEnvironment
-> HtmlLayout
- -> [(ResolvedSource, [Raw.Block])]
- -> ParsedModule
+ -> Text
+ -> Html.HtmlRenderIndex
+ -> Html.HtmlPagePresentation
-> Either
HtmlExportError
- (ResolvedSource, HtmlRoute, Text)
-renderSourcePage hints layout sourceBlocks node = do
- let source = parsedModuleResolved node
+ PreparedHtmlArtifact
+prepareSourceArtifact renderEnvironment layout hints renderIndex page = do
+ let source = Html.htmlPagePresentationSource page
context <-
first
HtmlExportContextError
- (htmlRenderContext layout source)
+ (htmlRenderContextFromEnvironment
+ renderEnvironment
+ source)
route <-
maybe
(Left
@@ -182,12 +182,15 @@ renderSourcePage hints layout sourceBlocks node = do
(HtmlCurrentSourceNotRouted source)))
Right
(htmlPageRoute layout source)
- document <-
- first
- HtmlExportContextError
- (Html.renderDocument
- context
- hints
- (parsedModuleBlocks node)
- sourceBlocks)
- Right (source, route, document)
+ Right
+ (preparedHtmlArtifact
+ (routeDestination route)
+ (first renderHtmlExportError
+ (TextEncoding.encodeUtf8
+ <$> first
+ HtmlExportContextError
+ (Html.renderDocument
+ context
+ hints
+ renderIndex
+ page))))
diff --git a/source/Render/Html/Layout.hs b/source/Render/Html/Layout.hs
index 6219107..c26b6b5 100644
--- a/source/Render/Html/Layout.hs
+++ b/source/Render/Html/Layout.hs
@@ -25,6 +25,7 @@ module Render.Html.Layout
, htmlPageRoute
, htmlSupportScriptRoute
, htmlMountUrlPrefixes
+ , layoutHtmlSources
, layoutHtmlSourceGraph
) where
@@ -263,11 +264,20 @@ layoutHtmlSourceGraph
:: [(SourceMountId, [Text])]
-> ResolvedSourceGraph
-> Either HtmlLayoutError HtmlLayout
-layoutHtmlSourceGraph specifications graph = do
+layoutHtmlSourceGraph specifications graph =
+ layoutHtmlSources
+ specifications
+ (sourceNodeResolved <$> sourceGraphNodes graph)
+
+layoutHtmlSources
+ :: [(SourceMountId, [Text])]
+ -> [ResolvedSource]
+ -> Either HtmlLayoutError HtmlLayout
+layoutHtmlSources specifications inputSources = do
prefixes <- validateMountPrefixes specifications
let sources =
List.sort
- (sourceNodeResolved <$> sourceGraphNodes graph)
+ inputSources
usedMounts =
Set.fromList (resolvedSourceMount <$> sources)
missingMounts =
@@ -548,7 +558,6 @@ supportScriptAssetComponents :: [Text]
supportScriptAssetComponents =
["_static", "naproche-html.js"]
--- Used by the current single-page writer until bundle publication lands.
percentEncodeUtf8 :: Text -> Text
percentEncodeUtf8 =
Text.pack
diff --git a/source/Render/Html/Output.hs b/source/Render/Html/Output.hs
index 0354806..a8b4d93 100644
--- a/source/Render/Html/Output.hs
+++ b/source/Render/Html/Output.hs
@@ -9,9 +9,9 @@
-- symlinks are rejected without following them; regular generated files may be
-- replaced. This policy prevents stable-tree escapes, not TOCTOU attacks.
module Render.Html.Output
- ( PreparedHtmlBundle
- , preparedHtmlBundle
- , preparedHtmlBundleDestinations
+ ( PreparedHtmlArtifact
+ , preparedHtmlArtifact
+ , preparedHtmlArtifactDestination
, HtmlRoutePlan
, htmlRoutePlanDestinations
, planHtmlRoutes
@@ -37,57 +37,34 @@ import Control.Monad (unless, when)
import Control.Monad.Trans.Except (ExceptT, runExceptT, throwE)
import Data.ByteString (ByteString)
import Data.ByteString qualified as ByteString
-import Data.IORef
- ( IORef
- , atomicModifyIORef'
- , newIORef
- )
import Data.List qualified as List
import Data.Map.Strict qualified as Map
+import Data.Set qualified as Set
import Data.Text qualified as Text
import System.Directory qualified as Directory
import System.FilePath.Posix qualified as Posix
import System.Posix.Files qualified as PosixFiles
+-- | One lazily rendered artifact. The destination is available for complete
+-- preflight without demanding the strict bytes or a renderer failure.
data PreparedHtmlArtifact = PreparedHtmlArtifact
!SafeRelativePath
- !ByteString
-
--- | A complete, destination-unique bundle of strict bytes.
-newtype PreparedHtmlBundle = PreparedHtmlBundle
- [PreparedHtmlArtifact]
-
-preparedHtmlBundle
- :: [(SafeRelativePath, ByteString)]
- -> Either HtmlOutputError PreparedHtmlBundle
-preparedHtmlBundle artifacts =
- case artifacts of
- [] ->
- Left EmptyPreparedHtmlBundle
- _ ->
- case duplicateDestinations
- (fst <$> artifacts) of
- duplicate : _ ->
- Left
- (DuplicatePreparedHtmlDestination
- duplicate)
- [] ->
- Right
- (PreparedHtmlBundle
- [ PreparedHtmlArtifact destination bytes
- | (destination, bytes) <-
- Map.toAscList
- (Map.fromList artifacts)
- ])
-
-preparedHtmlBundleDestinations
- :: PreparedHtmlBundle
- -> [SafeRelativePath]
-preparedHtmlBundleDestinations (PreparedHtmlBundle artifacts) =
- [ destination
- | PreparedHtmlArtifact destination _bytes <- artifacts
- ]
+ (Either Text ByteString)
+
+preparedHtmlArtifact
+ :: SafeRelativePath
+ -> Either Text ByteString
+ -> PreparedHtmlArtifact
+preparedHtmlArtifact =
+ PreparedHtmlArtifact
+
+preparedHtmlArtifactDestination
+ :: PreparedHtmlArtifact
+ -> SafeRelativePath
+preparedHtmlArtifactDestination
+ (PreparedHtmlArtifact destination _rendered) =
+ destination
-- Constructors and absolute paths stay private to this module.
@@ -106,10 +83,10 @@ newtype HtmlOutputPlan = HtmlOutputPlan
data PlannedHtmlArtifact = PlannedHtmlArtifact
!SafeRelativePath
!FilePath
- !ByteString
+ (Either Text ByteString)
data HtmlOutputError
- = EmptyPreparedHtmlBundle
+ = EmptyPreparedHtmlOutput
| DuplicatePreparedHtmlDestination !SafeRelativePath
| HtmlOutputRouteMismatch
![SafeRelativePath]
@@ -125,7 +102,7 @@ data HtmlOutputError
renderHtmlOutputError :: HtmlOutputError -> Text
renderHtmlOutputError = \case
- EmptyPreparedHtmlBundle ->
+ EmptyPreparedHtmlOutput ->
"HTML output contains no artifacts"
DuplicatePreparedHtmlDestination relative ->
"HTML output contains destination more than once: "
@@ -162,13 +139,13 @@ instance Exception HtmlOutputError
-- | Validate every destination without changing the filesystem.
planHtmlOutput
:: FilePath
- -> PreparedHtmlBundle
+ -> [PreparedHtmlArtifact]
-> IO (Either HtmlOutputError HtmlOutputPlan)
-planHtmlOutput outputRoot bundle = do
+planHtmlOutput outputRoot artifacts = do
routes <- planHtmlRoutes
outputRoot
- (preparedHtmlBundleDestinations bundle)
- pure (routes >>= (`planHtmlOutputAgainst` bundle))
+ (preparedHtmlArtifactDestination <$> artifacts)
+ pure (routes >>= (`planHtmlOutputAgainst` artifacts))
planHtmlRoutes
:: FilePath
@@ -177,7 +154,7 @@ planHtmlRoutes
planHtmlRoutes outputRoot destinations =
runExceptT do
when (null destinations)
- (throwE EmptyPreparedHtmlBundle)
+ (throwE EmptyPreparedHtmlOutput)
case duplicateDestinations destinations of
duplicate : _ ->
throwE
@@ -227,33 +204,41 @@ planHtmlRoutes outputRoot destinations =
planHtmlOutputAgainst
:: HtmlRoutePlan
- -> PreparedHtmlBundle
+ -> [PreparedHtmlArtifact]
-> Either HtmlOutputError HtmlOutputPlan
planHtmlOutputAgainst
(HtmlRoutePlan routes)
- (PreparedHtmlBundle artifacts)
- | plannedDestinations /= bundleDestinations =
+ artifacts
+ | null artifacts =
+ Left EmptyPreparedHtmlOutput
+ | duplicate : _ <- duplicateDestinations preparedDestinations =
+ Left (DuplicatePreparedHtmlDestination duplicate)
+ | Set.fromList plannedDestinations
+ /= Set.fromList preparedDestinations =
Left
(HtmlOutputRouteMismatch
plannedDestinations
- bundleDestinations)
- | otherwise =
- Right
- (HtmlOutputPlan
- [ PlannedHtmlArtifact
- relative
- destination
- bytes
- | ( (relative, destination)
- , PreparedHtmlArtifact _ bytes
- ) <- zip routes artifacts
- ])
+ preparedDestinations)
+ | otherwise = HtmlOutputPlan <$> traverse attach artifacts
where
plannedDestinations = fst <$> routes
- bundleDestinations =
- [ relative
- | PreparedHtmlArtifact relative _bytes <- artifacts
- ]
+ preparedDestinations =
+ preparedHtmlArtifactDestination <$> artifacts
+ routeDestinations = Map.fromList routes
+
+ attach (PreparedHtmlArtifact relative rendered) =
+ case Map.lookup relative routeDestinations of
+ Nothing ->
+ Left
+ (HtmlOutputRouteMismatch
+ plannedDestinations
+ preparedDestinations)
+ Just destination ->
+ Right
+ (PlannedHtmlArtifact
+ relative
+ destination
+ rendered)
duplicateDestinations
:: [SafeRelativePath]
@@ -293,127 +278,68 @@ renderHtmlPublicationError failure =
(quoteRelative <$> committed)
]
-data StagedHtmlArtifact = StagedHtmlArtifact
- !SafeRelativePath
- !FilePath
- !FilePath
-
--- | Publish a completely preflighted bundle.
---
--- All strict bytes are staged in temporary siblings before the first rename.
--- Each rename atomically replaces one directory entry. The bundle as a whole
--- is not atomic: a later failure reports the already committed destinations
--- and removes the remaining temporary files.
+-- | Render, stage, and atomically replace each completely preflighted artifact
+-- in the supplied source order. No later artifact is rendered or staged
+-- before the preceding destination has been replaced.
writeHtmlOutput
:: HtmlOutputPlan
-> IO (Either HtmlPublicationError ())
writeHtmlOutput (HtmlOutputPlan planned) =
- Exception.mask \restore -> do
- stagedRef <- newIORef []
- result <-
- restore
- (stageAndPublish stagedRef planned)
- `Exception.onException`
- cleanupStagedRef stagedRef
- cleanupStagedRef stagedRef
- pure result
-
-stageAndPublish
- :: IORef [StagedHtmlArtifact]
- -> [PlannedHtmlArtifact]
- -> IO (Either HtmlPublicationError ())
-stageAndPublish stagedRef planned = do
- stagedResult <- stageAll stagedRef planned
- case stagedResult of
- Left err ->
- pure (Left err)
- Right staged ->
- publishAll stagedRef [] staged
-
-stageAll
- :: IORef [StagedHtmlArtifact]
- -> [PlannedHtmlArtifact]
- -> IO
- (Either
- HtmlPublicationError
- [StagedHtmlArtifact])
-stageAll stagedRef =
- go []
- where
- go staged [] =
- pure (Right (reverse staged))
- go staged
- (artifact@(PlannedHtmlArtifact relative _destination _bytes)
- : remaining) = do
- result <- tryIOException (stageArtifact artifact)
- case result of
- Left err ->
- pure
- (Left
- (publicationError
- []
- relative
- err))
- Right stagedArtifact -> do
- atomicModifyIORef' stagedRef
- \current ->
- (stagedArtifact : current, ())
- go
- (stagedArtifact : staged)
- remaining
-
-stageArtifact
- :: PlannedHtmlArtifact
- -> IO StagedHtmlArtifact
-stageArtifact
- (PlannedHtmlArtifact relative destination bytes) = do
- let directory = Posix.takeDirectory destination
- Directory.createDirectoryIfMissing True directory
- bracketOnError
- (openBinaryTempFileWithDefaultPermissions
- directory
- (Posix.takeFileName destination <> ".tmp"))
- cleanupTemporary
- \(temporary, handle) -> do
- ByteString.hPut handle bytes
- hFlush handle
- hClose handle
- pure
- (StagedHtmlArtifact
- relative
- destination
- temporary)
+ publishAll [] planned
publishAll
- :: IORef [StagedHtmlArtifact]
- -> [SafeRelativePath]
- -> [StagedHtmlArtifact]
+ :: [SafeRelativePath]
+ -> [PlannedHtmlArtifact]
-> IO (Either HtmlPublicationError ())
-publishAll _stagedRef _committed [] =
+publishAll _committed [] =
pure (Right ())
publishAll
- stagedRef
- committedReversed
- ( staged@(StagedHtmlArtifact relative destination temporary)
- : remaining
- ) = do
- result <-
- tryIOException
- (Directory.renameFile temporary destination)
- case result of
- Left err ->
- pure
- (Left
- (publicationError
- (reverse committedReversed)
- relative
- err))
- Right () -> do
- forgetStaged stagedRef staged
- publishAll
- stagedRef
- (relative : committedReversed)
- remaining
+ committedReversed
+ (PlannedHtmlArtifact relative destination rendered : remaining) =
+ case rendered of
+ Left failure ->
+ pure
+ (Left
+ (IncompleteHtmlPublication
+ { committedHtmlDestinations =
+ reverse committedReversed
+ , failedHtmlDestination = relative
+ , htmlPublicationFailure = failure
+ }))
+ Right bytes -> do
+ result <-
+ tryIOException
+ (stageAndReplace destination bytes)
+ case result of
+ Left err ->
+ pure
+ (Left
+ (publicationError
+ (reverse committedReversed)
+ relative
+ err))
+ Right () ->
+ publishAll
+ (relative : committedReversed)
+ remaining
+
+stageAndReplace
+ :: FilePath
+ -> ByteString
+ -> IO ()
+stageAndReplace destination bytes = do
+ let directory = Posix.takeDirectory destination
+ Directory.createDirectoryIfMissing True directory
+ bracketOnError
+ (openBinaryTempFileWithDefaultPermissions
+ directory
+ (Posix.takeFileName destination <> ".tmp"))
+ cleanupTemporary
+ \(temporary, handle) -> do
+ ByteString.hPut handle bytes
+ hFlush handle
+ hClose handle
+ Directory.renameFile temporary destination
publicationError
:: [SafeRelativePath]
@@ -428,29 +354,6 @@ publicationError committed failed err =
Text.pack (displayException err)
}
-forgetStaged
- :: IORef [StagedHtmlArtifact]
- -> StagedHtmlArtifact
- -> IO ()
-forgetStaged stagedRef (StagedHtmlArtifact _ _ temporary) =
- atomicModifyIORef' stagedRef
- \staged ->
- ( List.filter
- (\(StagedHtmlArtifact _ _ candidate) ->
- candidate /= temporary)
- staged
- , ()
- )
-
-cleanupStagedRef :: IORef [StagedHtmlArtifact] -> IO ()
-cleanupStagedRef stagedRef = do
- staged <- atomicModifyIORef' stagedRef (\current -> ([], current))
- traverse_ cleanupStagedPath staged
-
-cleanupStagedPath :: StagedHtmlArtifact -> IO ()
-cleanupStagedPath (StagedHtmlArtifact _ _ temporary) =
- void (tryIOError (Directory.removeFile temporary))
-
cleanupTemporary :: (FilePath, Handle) -> IO ()
cleanupTemporary (temporary, handle) = do
void (tryIOError (hClose handle))
diff --git a/source/StructGraph.hs b/source/StructGraph.hs
deleted file mode 100644
index eb36714..0000000
--- a/source/StructGraph.hs
+++ /dev/null
@@ -1,125 +0,0 @@
-{-# LANGUAGE ImportQualifiedPost #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE ScopedTypeVariables #-}
-
-
-module StructGraph
- ( Struct
- , structNoun
- , structAncestors
- , structInternalSymbols
- , structSymbols
- , StructGraph
- , lookup
- , lookupAncestors
- , lookupInternalSymbols
- , lookupSymbols
- , isInternalSymbolIn
- , isSymbolIn
- , insert
- , StructGraphDelta
- , structGraphExtension
- , applyStructGraphDelta
- ) where
-
-
-import Base
-import Syntax.Internal
-
-import Data.Map.Strict qualified as Map
-import Data.Set qualified as Set
-
-
-data Struct = Struct
- { structNoun :: StructPhrase
- , structAncestors :: Set StructPhrase -- ^ All ancestors, including transitive ancestors.
- , structInternalSymbols :: Set StructSymbol -- ^ Signature.
- , structSymbols :: Set StructSymbol -- ^ Signature, including inherited symbols.
- } deriving (Show, Eq, Ord)
-
-newtype StructGraph
- = StructGraph {unStructGraph :: Map StructPhrase Struct}
- deriving (Show, Eq, Semigroup, Monoid)
-
-
--- | Lookup a struct by its name.
-lookup :: StructPhrase -> StructGraph -> Maybe Struct
-lookup str graph = Map.lookup str (unStructGraph graph)
-
--- | Returns the ancestors of the given StructPhrase in the graph.
-lookupAncestors :: StructPhrase -> StructGraph -> Maybe (Set StructPhrase)
-lookupAncestors str graph =
- structAncestors <$> lookup str graph
-
-lookupInternalSymbols :: StructPhrase -> StructGraph -> Maybe (Set StructSymbol)
-lookupInternalSymbols phrase graph =
- structInternalSymbols <$> lookup phrase graph
-
--- | Lookup all symbols of a structure, including inherited symbols.
-lookupSymbols :: StructPhrase -> StructGraph -> Maybe (Set StructSymbol)
-lookupSymbols phrase graph =
- structSymbols <$> lookup phrase graph
-
-isInternalSymbolIn :: StructSymbol -> Struct -> Bool
-isInternalSymbolIn tok struct = Set.member tok (structInternalSymbols struct)
-
-isSymbolIn :: StructSymbol -> Struct -> Bool
-isSymbolIn tok struct = Set.member tok (structSymbols struct)
-
--- | Insert a new struct into the graph.
-insert
- :: StructPhrase
- -> Set StructPhrase
- -> Set StructSymbol
- -> Set StructSymbol
- -> StructGraph
- -> StructGraph
-insert structNoun structAncestors structInternalSymbols structSymbols graph =
- StructGraph (Map.insert structNoun Struct{..} (unStructGraph graph))
-
-
-newtype StructGraphDelta = StructGraphDelta
- (Map StructPhrase Struct)
- deriving (Show, Eq)
-
-structGraphExtension
- :: StructGraph
- -> StructGraph
- -> Either Text StructGraphDelta
-structGraphExtension previous current
- | not
- (all
- (\(phrase, structure) ->
- Map.lookup phrase currentRows
- == Just structure)
- (Map.toList previousRows)) =
- Left "structure graph changed an imported structure"
- | otherwise =
- Right
- (StructGraphDelta
- (Map.difference currentRows previousRows))
- where
- previousRows =
- unStructGraph previous
- currentRows =
- unStructGraph current
-
-applyStructGraphDelta
- :: StructGraphDelta
- -> StructGraph
- -> Either Text StructGraph
-applyStructGraphDelta
- (StructGraphDelta additions)
- graph
- | not
- (Set.null
- (Map.keysSet rows
- `Set.intersection` Map.keysSet additions)) =
- Left "imported modules define the same structure"
- | otherwise =
- Right
- (StructGraph (Map.union rows additions))
- where
- rows =
- unStructGraph graph
diff --git a/source/Syntax/Internal.hs b/source/Syntax/Internal.hs
index 84baa12..d769afe 100644
--- a/source/Syntax/Internal.hs
+++ b/source/Syntax/Internal.hs
@@ -777,53 +777,6 @@ data Block
deriving (Show, Eq, Ord)
-data Task = Task
- { taskDirectness :: Directness
- , taskHypotheses :: [Hypothesis] -- ^ No guarantees on order.
- , taskConjectureLabel :: Marker
- , taskLocation :: Location
- , taskConjecture :: Formula
- } deriving (Show, Eq, Generic, Hashable)
-
-data Hypothesis = Hypothesis
- { hypothesisMarker :: Marker
- , hypothesisFormula :: Formula
- }
-
-instance Show Hypothesis where
- show (Hypothesis marker formula) =
- "Hypothesis " <> show marker <> " " <> show formula
-
-instance Eq Hypothesis where
- Hypothesis marker formula == Hypothesis marker' formula' =
- (marker, formula) == (marker', formula')
-
-instance Ord Hypothesis where
- compare (Hypothesis marker formula) (Hypothesis marker' formula') =
- compare (marker, formula) (marker', formula')
-
-instance Hashable Hypothesis where
- hashWithSalt salt (Hypothesis marker formula) =
- hashWithSalt salt (marker, formula)
-
-
--- | Indicates whether a given proof is direct or indirect.
--- An indirect proof (i.e. a proof by contradiction) may
--- cause an ATP to emit a warning about contradictory axioms.
--- When we know that the proof is indirect, we want to ignore
--- this warning. For relevance filtering we also want to know
--- what our actual goal is, so we keep the original conjecture.
-data Directness
- = Indirect Formula -- ^ The former conjecture.
- | Direct
- deriving (Show, Eq, Generic, Hashable)
-
-isIndirect :: Task -> Bool
-isIndirect task = case taskDirectness task of
- Indirect _ -> True
- Direct -> False
-
-
-- | Full boolean contraction.
contraction :: ExprOf a -> ExprOf a
contraction = \case
diff --git a/source/Syntax/Token.hs b/source/Syntax/Token.hs
index 408b374..5dfed65 100644
--- a/source/Syntax/Token.hs
+++ b/source/Syntax/Token.hs
@@ -354,7 +354,7 @@ beginToplevelEnvironment = lexeme do
-- | Parses tokens, switching tokenizing frames when encountering math and text environments.
environment :: Lexer [Located Token]
environment = do
- env <- skipManyTill anySingle beginToplevelEnvironment
+ env <- skipManyTill (comment <|> void anySingle) beginToplevelEnvironment
lts <- go (unLocated env) id
pure ((BeginEnv <$> env) : lts)
where
diff --git a/source/Test/Golden.hs b/source/Test/Golden.hs
index a62df9e..e230c26 100644
--- a/source/Test/Golden.hs
+++ b/source/Test/Golden.hs
@@ -5,14 +5,8 @@ module Test.Golden where
import Api qualified
-import Provers qualified
-import Tptp.UnsortedFirstOrder (toText)
import Base
-import Provers (defaultTimeLimit)
-import Control.Monad.Logger
-import Data.Text qualified as Text
-import Data.Text.IO qualified as TextIO
import Data.Text.Lazy.IO qualified as LazyTextIO
import System.Directory
import System.FilePath
@@ -20,7 +14,6 @@ import Test.Tasty
import Test.Tasty.Golden (goldenVsFile, findByExtension)
import Text.Pretty.Simple (pShowNoColor)
import UnliftIO
-import UnliftIO.Environment
goldenTests :: IO TestTree
goldenTests = goldenTestGroup
@@ -29,10 +22,6 @@ goldenTestGroup = testGroup "golden tests" <$> sequence
[ tokenizing
, scanning
, parsing
- , glossing
- , generatingTasks
- , encodingTasks
- , verification
]
@@ -93,35 +82,3 @@ parsing :: MonadUnliftIO io => io TestTree
parsing = makeGoldenTest "parsing" $ \Triple{..} -> do
parseResult <- Api.parse input
liftIO (LazyTextIO.writeFile output (pShowNoColor parseResult))
-
-
-glossing :: MonadUnliftIO io => io TestTree
-glossing = makeGoldenTest "glossing" $ \Triple{..} -> do
- interpretationResult <- Api.gloss input
- liftIO (LazyTextIO.writeFile output (pShowNoColor interpretationResult))
-
-
-generatingTasks :: MonadUnliftIO io => io TestTree
-generatingTasks = makeGoldenTest "generating tasks" $ \Triple{..} -> do
- tasks <- Api.generateTasks input
- liftIO $ LazyTextIO.writeFile output (pShowNoColor tasks)
-
-
-encodingTasks :: MonadUnliftIO io => io TestTree
-encodingTasks = makeGoldenTest "encoding tasks" $ \Triple{..} -> do
- tasks <- Api.encodeTasks input
- liftIO (TextIO.writeFile output (Text.intercalate "\n------------------\n" (toText <$> tasks)))
-
-
-verification :: MonadUnliftIO io => io TestTree
-verification = makeGoldenTest "verification" $ \Triple{..} -> do
- vampirePathPath <- (?? "vampire") <$> lookupEnv "NAPROCHE_ZF_VAMPIRE"
- let defaultVampire =
- Provers.vampire
- vampirePathPath
- Provers.defaultTimeLimit
- Provers.defaultMemoryLimit
- answers <-
- runNoLoggingT (Api.verify defaultVampire input)
- >>= either throwIO pure
- liftIO (LazyTextIO.writeFile output (pShowNoColor answers))
diff --git a/source/Test/Unit.hs b/source/Test/Unit.hs
index 302a6cf..3e5817c 100644
--- a/source/Test/Unit.hs
+++ b/source/Test/Unit.hs
@@ -2,15 +2,12 @@ module Test.Unit where
import Test.Tasty
-import Test.Tasty.HUnit
import Test.Unit.Abstract qualified as Abstract
import Test.Unit.Backend qualified as Backend
-import Test.Unit.Checking qualified as Checking
import Test.Unit.CommandLine qualified as CommandLine
import Test.Unit.Concrete qualified as Concrete
import Test.Unit.Core qualified as Core
import Test.Unit.Declaration qualified as Declaration
-import Test.Unit.Encoding qualified as Encoding
import Test.Unit.Foundation qualified as Foundation
import Test.Unit.Identity qualified as Identity
import Test.Unit.Html qualified as Html
@@ -21,26 +18,21 @@ import Test.Unit.Lexicon qualified as Lexicon
import Test.Unit.Meaning qualified as Meaning
import Test.Unit.Materialization qualified as Materialization
import Test.Unit.Module qualified as Module
-import Test.Unit.Migration qualified as Migration
import Test.Unit.OutputPlan qualified as OutputPlan
import Test.Unit.Provers qualified as Provers
import Test.Unit.Semantic qualified as Semantic
import Test.Unit.Source qualified as Source
import Test.Unit.Store qualified as Store
-import Test.Unit.Symdiff qualified as Symdiff
import Test.Unit.Token qualified as Token
unitTests :: TestTree
unitTests = testGroup "unit tests"
- [testCase "filter" filtersWell
- , Abstract.unitTests
+ [ Abstract.unitTests
, Backend.unitTests
- , Checking.unitTests
, CommandLine.unitTests
, Concrete.unitTests
, Core.unitTests
, Declaration.unitTests
- , Encoding.unitTests
, Foundation.unitTests
, Identity.unitTests
, Html.unitTests
@@ -51,7 +43,6 @@ unitTests = testGroup "unit tests"
, Meaning.unitTests
, Materialization.unitTests
, Module.unitTests
- , Migration.unitTests
, OutputPlan.unitTests
, Provers.unitTests
, Semantic.unitTests
@@ -59,9 +50,3 @@ unitTests = testGroup "unit tests"
, Store.unitTests
, Token.unitTests
]
-
-
-filtersWell :: Assertion
-filtersWell = do
- assertBool "Filter works on symdiff problem" Symdiff.filtersWell
- assertBool "Filter handles struct/app syntax" Symdiff.handlesStructAndApply
diff --git a/source/Test/Unit/Backend.hs b/source/Test/Unit/Backend.hs
index 0c4ff71..11c36b8 100644
--- a/source/Test/Unit/Backend.hs
+++ b/source/Test/Unit/Backend.hs
@@ -4,18 +4,14 @@
module Test.Unit.Backend (unitTests) where
import Base hiding (Empty)
-import Checking.Backend.Connection qualified as Connection
import Checking.Backend.Problem
import Checking.Backend.Tptp
import Checking.Core
import Checking.Foundation qualified as Foundation
-import Checking.Kernel.Derivation qualified as Derivation
import Provers
import Tptp.UnsortedFirstOrder qualified as Tptp
-import Control.Monad (unless)
import Data.Map.Strict qualified as Map
-import Data.Set qualified as Set
import Data.Text qualified as Text
import Data.Vector (Vector)
import Data.Vector qualified as Vector
@@ -58,9 +54,6 @@ unitTests =
, testCase
"renders checked FOF and TH0 problems"
rendersCheckedProblems
- , testCase
- "replays bounded Horn connection choices"
- replaysHornConnections
]
classifiesPropositionEquality :: Assertion
@@ -450,216 +443,6 @@ rendersCheckedProblems = do
globalPolicy
localPolicy)
-replaysHornConnections :: Assertion
-replaysHornConnections = do
- premiseP <- closedFrozen atomP
- premisePtoQ <-
- closedFrozen
- (CImp atomP
- (CImp atomP atomQ))
- premiseQtoR <-
- closedFrozen (CImp atomQ atomR)
- target <- closedFrozen atomR
- facts <-
- Vector.fromList
- <$> sequence
- [ checkedBackendFact
- (0 :: Int)
- atomP
- , checkedBackendFact
- 1
- (CImp atomP
- (CImp atomP atomQ))
- , checkedBackendFact
- 2
- (CImp atomQ atomR)
- ]
- claim <-
- checkedClosedProposition atomR
- problem <-
- either
- (assertFailure . show)
- pure
- (planTypedProblem
- testGlobalType
- facts
- claim
- []
- []
- ImplicitFofPremises
- FirstOrderLocals)
- connectionProblem <-
- either
- (assertFailure . show)
- pure
- (Connection.prepareConnectionProblem
- problem)
- threeNodeLimits <-
- either
- (assertFailure . show)
- pure
- (Connection.connectionLimits 100 3 8)
- case Connection.searchConnectionProblem
- threeNodeLimits
- connectionProblem of
- Connection.ConnectionSearchExhausted
- (Connection.ConnectionTraceNodesExhausted 3)
- _stats ->
- pure ()
- result ->
- assertFailure
- ("expected expanded-node exhaustion, got "
- <> show result)
- fourNodeLimits <-
- either
- (assertFailure . show)
- pure
- (Connection.connectionLimits 100 4 8)
- (foundTrace, searchStats) <-
- case Connection.searchConnectionProblem
- fourNodeLimits
- connectionProblem of
- Connection.ConnectionSearchFound
- found
- stats ->
- pure (found, stats)
- result ->
- assertFailure
- ("expected a Horn connection, got "
- <> show result)
- >> fail "unreachable"
- assertEqual
- "eleven charged search operations"
- 11
- (Connection.connectionSearchWork
- searchStats)
- assertEqual
- "three derived atoms"
- 3
- (Connection.connectionSearchDerivedAtomCount
- searchStats)
- assertEqual
- "candidate depth"
- 3
- (Connection.connectionSearchMaximumCandidateDepth
- searchStats)
- let root =
- Connection.connectionTraceRoot
- foundTrace
- assertEqual
- "claim uses the final rule"
- 2
- (Connection.connectionChoicePremiseOrdinal
- root)
- replayed <-
- either
- (assertFailure . show)
- pure
- (Connection.replayConnectionTrace
- fourNodeLimits
- connectionProblem
- foundTrace)
- assertEqual
- "replay uses every exact premise"
- (Set.fromList
- [ Derivation.importIx 0
- , Derivation.importIx 1
- , Derivation.importIx 2
- ])
- (Connection.replayedConnectionImportUses
- replayed)
- assertEqual
- "expanded replay nodes"
- 4
- (Connection.replayedConnectionNodeCount
- replayed)
- assertEqual
- "replay depth"
- 3
- (Connection.replayedConnectionMaximumDepth
- replayed)
- checkedFoundationValue <-
- either
- (assertFailure . show)
- pure
- Foundation.checkedFoundation
- imports <-
- traverse
- (either
- (assertFailure . show)
- pure
- . Derivation.derivationImportJudgment)
- [ premiseP
- , premisePtoQ
- , premiseQtoR
- ]
- kernelReplay <-
- either
- (assertFailure . show)
- pure
- (Derivation.replayKernelDerivation
- checkedFoundationValue
- Derivation.defaultKernelReplayLimits
- testGlobalType
- (Vector.fromList imports)
- target
- (Connection.replayedConnectionDerivation
- replayed))
- assertEqual
- "connection lifting proves the exact claim"
- target
- (Derivation.replayedKernelTarget
- kernelReplay)
- let wrongRoot =
- Connection.connectionTrace
- (Connection.connectionChoice
- 1
- [])
- case Connection.replayConnectionTrace
- fourNodeLimits
- connectionProblem
- wrongRoot of
- Left
- (Connection.ConnectionReplayRejected
- (Connection.ConnectionReplayGoalMismatch 1)) ->
- pure ()
- result ->
- assertFailure
- ("expected changed-choice rejection, got "
- <> case result of
- Left err -> show err
- Right _ -> "successful replay")
- case Connection.replayConnectionTrace
- threeNodeLimits
- connectionProblem
- foundTrace of
- Left
- (Connection.ConnectionReplayExhausted
- (Connection.ConnectionTraceNodesExhausted 3)) ->
- pure ()
- result ->
- assertFailure
- ("expected bounded replay exhaustion, got "
- <> case result of
- Left err -> show err
- Right _ -> "successful replay")
- tightWorkLimits <-
- either
- (assertFailure . show)
- pure
- (Connection.connectionLimits 10 4 8)
- case Connection.searchConnectionProblem
- tightWorkLimits
- connectionProblem of
- Connection.ConnectionSearchExhausted
- (Connection.ConnectionSearchWorkExhausted 10)
- _stats ->
- pure ()
- result ->
- assertFailure
- ("expected bounded search exhaustion, got "
- <> show result)
-
firstOrderClaim :: CanonicalTerm TestGlobal
firstOrderClaim =
CApp
@@ -675,18 +458,6 @@ higherOrderClaim =
(CGlobal FirstOrderPredicate)
(CBound 0)))
-atomP, atomQ, atomR :: CanonicalTerm TestGlobal
-atomP =
- firstOrderClaim
-atomQ =
- CApp
- (CGlobal FirstOrderPredicate)
- (COpaqueInteger 1)
-atomR =
- CApp
- (CGlobal FirstOrderPredicate)
- (COpaqueInteger 2)
-
checkedProposition
:: Vector (TestLocal, CoreType)
-> CanonicalTerm TestGlobal
@@ -750,22 +521,6 @@ checkedBackendFact reference term = do
proposition
capability)
-closedFrozen
- :: CanonicalTerm TestGlobal
- -> IO (FrozenCheckedCore TestGlobal)
-closedFrozen term = do
- checked <-
- either
- (assertFailure . show)
- pure
- (checkCanonicalCore
- testGlobalType
- term)
- unless
- (frozenCoreType checked == TyProp)
- (assertFailure "fixture is not a proposition")
- pure checked
-
checkedLocalPremise
:: Natural
-> Text
diff --git a/source/Test/Unit/Checking.hs b/source/Test/Unit/Checking.hs
deleted file mode 100644
index 13499a3..0000000
--- a/source/Test/Unit/Checking.hs
+++ /dev/null
@@ -1,1982 +0,0 @@
-{-# LANGUAGE OverloadedStrings #-}
-
-module Test.Unit.Checking (unitTests) where
-
-import Base
-import Checking
-import Checking.Dependencies qualified as Dependencies
-import Checking.Facts qualified as Facts
-import Checking.Legacy
-import Checking.Obligation
-import Checking.Structure qualified as Structure
-import Encoding (contractionTask, encodeTaskText)
-import Report.Location
-import Syntax.Internal
-import Syntax.Lexicon (_Onesorted, pattern ApplySymbol)
-
-import Bound.Scope (bindings, fromScope, toScope)
-import Bound.Var (Var(..))
-import Control.Exception (try)
-import Control.Monad.State (runStateT)
-import Data.HashSet qualified as HS
-import Data.IORef (modifyIORef', newIORef, readIORef)
-import Data.Set qualified as Set
-import Data.Text qualified as Text
-import Test.Tasty
-import Test.Tasty.HUnit
-
-unitTests :: TestTree
-unitTests = testGroup "Checking"
- [ testCase "renders checking context without constructors" do
- let rendered =
- renderCheckingError
- (DuplicateMarker Nowhere (Marker "labelled"))
- assertEqual
- "checking diagnostic"
- "<nowhere> -1:-1 in labelled: marker is already registered"
- rendered
- assertBool
- "internal Marker constructor is absent"
- (not ("Marker" `Text.isInfixOf` rendered))
- , testCase "TPTP encoding excludes task provenance" do
- registration <-
- registerFilePathWithDisplay
- "/tmp/f24-source.tex"
- "quote\"\nfof(injected,axiom,$false).\nλ.tex"
- fileId <- either
- (assertFailure . ("location registration failed: " <>) . show)
- pure
- registration
- let expected = "fof(zf_q0,conjecture,$true)."
- plainTask = Task
- { taskDirectness = Direct
- , taskHypotheses = []
- , taskConjectureLabel = Marker "provenance_test"
- , taskLocation = Nowhere
- , taskConjecture = PropositionalConstant IsTop
- }
- adversarialTask = plainTask
- { taskDirectness =
- Indirect (PropositionalConstant IsBottom)
- , taskLocation = mkLocation fileId 12 34
- }
- assertEqual "three-argument TPTP" expected (encodeTaskText plainTask)
- assertEqual
- "path, span, and directness do not affect proof bytes"
- (encodeTaskText plainTask)
- (encodeTaskText adversarialTask)
- , testCase "prepares complete ordered obligation batches"
- preparesCompleteObligationBatches
- , testCase "replacement conditions remain existentially scoped" do
- let x = NamedVar "x"
- y = NamedVar "y"
- replacement =
- makeReplacementIff
- (TermVar (F (NamedVar "image")))
- ((x, TermVar (NamedVar "X"))
- :| [(y, TermVar (NamedVar "Y"))])
- (abstractVarSymbols [x, y] (TermVar x))
- (abstractVarSymbols
- [x, y]
- (Equals Nowhere (TermVar x) (TermVar y)))
- case replacement of
- Quantified Universally outerScope -> do
- assertEqual
- "outer binders"
- [NamedVar "frv"]
- (nubOrd (bindings outerScope))
- case fromScope outerScope of
- Connected
- Equivalence
- _
- (Quantified Existentially innerScope) ->
- case fromScope innerScope of
- And _ (And _ (Equals _ left right)) -> do
- assertEqual
- "condition left operand"
- (TermVar (B x))
- left
- assertEqual
- "condition right operand"
- (TermVar (B y))
- right
- body ->
- assertFailure
- ( "expected replacement condition equality, got "
- <> show body
- )
- body ->
- assertFailure
- ("expected replacement equivalence, got "
- <> show body)
- formula ->
- assertFailure
- ("expected replacement universal, got " <> show formula)
- , testCase "fix rejects shadowing theorem-local variables" do
- expectCheckingError "already in scope" (lemmaBlocks "bad_fix" badFixLemma badFixProof)
- , testCase "define rejects shadowing local variables" do
- expectCheckingError "already in scope" (lemmaBlocks "bad_define" badDefineLemma badDefineProof)
- , testCase "take rejects shadowing theorem-local variables" do
- expectCheckingError "already in scope" (lemmaBlocks "bad_take" badTakeLemma badTakeProof)
- , testCase "have rejects new free variables" do
- expectCheckingError "not in scope" (lemmaBlocks "bad_have" badHaveLemma badHaveProof)
- , testCase "define function rejects shadowing function name" do
- expectCheckingError "already in scope" (lemmaBlocks "bad_define_function_name" badDefineFunctionNameLemma badDefineFunctionNameProof)
- , testCase "define function rejects shadowing argument name" do
- expectCheckingError "shadow local variable" (lemmaBlocks "bad_define_function_arg" badDefineFunctionArgLemma badDefineFunctionArgProof)
- , testCase "free theorem goal variables are local in proofs" do
- expectChecks (lemmaBlocks "free_goal_local" freeGoalLocalLemma freeGoalLocalProof)
- , testCase "fix accepts fresh local variables" do
- expectChecks (lemmaBlocks "fresh_fix" freshFixLemma freshFixProof)
- , testCase "take accepts fresh witnesses" do
- expectChecks (lemmaBlocks "fresh_take" freshTakeLemma freshTakeProof)
- , testCase "assume rejects disjunctive goals" do
- expectMismatchedAssume unsoundDisjunctionAssumeBlocks
- , assumptionGoalReductionTests
- , proofShapeErrorTests
- , testCase "struct axioms recursively rewrite carrier labels" do
- text <- encodedTasksText structCarrierRewriteBlocks
- assertContains "rewritten struct-rule carrier" "zf_u0(zf_f1,zf_s0(zf_f0))" text
- assertNotContains "raw struct-rule carrier" "zf_u0(zf_f1,zf_f0)" text
- , testCase "struct axioms annotate operations from the same structure" do
- text <- encodedTasksText structOperationRewriteBlocks
- assertContains "annotated struct operation in rule" "zf_u0(zf_s1(zf_f0),zf_s0(zf_f0))" text
- , testCase "structure terms fail before task encoding" do
- unresolved <-
- try
- (check
- WithoutDumpPremselTraining
- unresolvedStructOperationBlocks)
- :: IO (Either CheckingError [Task])
- case unresolved of
- Left
- (UnresolvedStructureOperation
- actualSymbol
- actualLocation
- actualMarker) -> do
- assertEqual
- "structure operation"
- fooOp
- actualSymbol
- assertEqual
- "block location"
- structureTermErrorLocation
- actualLocation
- assertEqual
- "block marker"
- "unresolved_structure_operation"
- actualMarker
- Left err ->
- assertFailure
- ("expected unresolved structure operation, got "
- <> show err)
- Right _ ->
- assertFailure
- "expected unresolved structure operation to fail"
- expectCheckingError
- "Nested comprehensions are not supported"
- nestedStructComprehensionBlocks
- , testCase "exact structure claims introduce carrier labels for continuations" do
- text <- encodedTasksText structClaimIntroducesContextBlocks
- assertContains "claim continuation carrier" "conjecture,zf_u0(zf_f1,zf_s0(zf_f0))" text
- , testCase "bound variables do not inherit outer carrier labels" do
- text <- encodedTasksText boundStructLabelBlocks
- assertContains "bound carrier label remains raw" "![V0]:zf_u0(zf_f1,V0)" text
- assertNotContains "bound carrier label not rewritten" "![V0]:zf_u0(zf_f1,zf_s0(V0))" text
- , structureTransactionTests
- , testCase "abbreviations reject direct self-reference" do
- expectCheckingError "self-referential" directSelfReferentialAbbrBlocks
- , testCase "abbreviations reject indirect self-reference after expansion" do
- expectCheckingError "self-referential" indirectSelfReferentialAbbrBlocks
- , testCase "predicate definitions reject direct self-reference" do
- expectCheckingError "self-referential" directSelfReferentialPredicateDefinitionBlocks
- , testCase "function definitions reject direct self-reference" do
- expectCheckingError "self-referential" directSelfReferentialFunctionDefinitionBlocks
- , testCase "operator definitions reject direct self-reference" do
- expectCheckingError "self-referential" directSelfReferentialOperatorDefinitionBlocks
- , testCase "definitions reject abbreviation-hidden self-reference" do
- expectCheckingError "self-referential" abbreviationHiddenSelfReferentialDefinitionBlocks
- , testCase "definitions reject abbreviation-hidden self-reference in assumptions" do
- expectCheckingError "self-referential" assumptionHiddenSelfReferentialDefinitionBlocks
- , testCase "ordinary definitions accept non-recursive bodies" do
- expectChecks nonRecursiveDefinitionBlocks
- , testCase "definitions reject builtin mixfix marker collisions" do
- expectCheckingError "object-symbol marker pow is already owned by builtin" [builtinMixfixMarkerCollisionBlock]
- , testCase "definitions reject builtin predicate marker collisions" do
- expectCheckingError "object-symbol marker elem is already owned by builtin" [builtinPredicateMarkerCollisionBlock]
- , testCase "abbreviations reject builtin marker collisions" do
- expectCheckingError "object-symbol marker pow is already owned by builtin" [builtinAbbreviationMarkerCollisionBlock]
- , testCase "builtin object markers do not reserve proof labels" do
- expectChecks [builtinMarkerProofLabelBlock]
- , testCase "subseteq remains user-definable" do
- expectChecks [subseteqDefinitionBlock]
- , testCase "datatype accepts bootstrap propositional fragment" do
- expectChecks [goodDatatypeBlock]
- , testCase "datatype treats a carrier alias as direct recursion" do
- directFacts <-
- datatypePreparedFacts [goodDatatypeBlock]
- aliasedFacts <-
- datatypePreparedFacts directRecursionAliasDatatypeBlocks
- assertEqual
- "generated datatype facts"
- directFacts
- aliasedFacts
- , testCase "datatype rejects powerset recursion through aliases" do
- for_
- [ oneHopPowersetAliasDatatypeBlocks
- , multiHopPowersetAliasDatatypeBlocks
- ]
- (expectCheckingError "recursive premise must be direct")
- , testCase "datatype rejects nested recursive premise" do
- expectCheckingError "recursive premise must be direct" [badNestedRecursiveDatatypeBlock]
- , testCase "datatype rejects missing constructor premise" do
- expectCheckingError "missing premise" [badMissingPremiseDatatypeBlock]
- , testCase "datatype rejects duplicate constructor patterns" do
- expectCheckingError "constructor patterns must be distinct" [badDuplicateConstructorDatatypeBlock]
- , testCase "datatype rejects open premise domains" do
- expectCheckingError "closed terms" [badOpenDomainDatatypeBlock]
- , testCase "datatype rejects application-shaped constructors" do
- expectCheckingError "function application" [badApplyConstructorDatatypeBlock]
- , testCase "datatype generates trusted fact markers" do
- expectFactMarkers datatypeGeneratedMarkers [goodDatatypeBlock]
- , testCase "datatype generated fact markers are reserved globally" do
- expectDefinedMarkers datatypeGeneratedMarkers [goodDatatypeBlock]
- , testCase "datatype generated intro facts are usable by reference" do
- expectChecks datatypeIntroReferenceBlocks
- , testCase "datatype generated distinctness fact is usable by reference" do
- expectChecks datatypeDistinctReferenceBlocks
- , testCase "datatype generated injective fact is usable by reference" do
- expectChecks datatypeInjectiveReferenceBlocks
- , testCase "datatype generated fact markers cannot be reused by later blocks" do
- expectDuplicateMarker "propform_cases" datatypeGeneratedMarkerReuseBlocks
- , testCase "datatype rejects duplicate constructor markers" do
- expectCheckingError "object-symbol marker dup is already owned by datatype constructor" [badDuplicateConstructorMarkerDatatypeBlock]
- , testCase "signature predicate declares symbols for later facts" do
- expectChecks signaturePredicateUsageBlocks
- , testCase "signature formula declares symbolic operators for later facts" do
- expectChecks signatureFormulaUsageBlocks
- , testCase "signature formula rejects unrecoverable declarations" do
- expectCheckingError "could not recover the declared symbol" [badSignatureFormulaBlock]
- , testCase "inductive accepts bounded fin fragment" do
- expectChecks goodInductiveBlocks
- , testCase "inductive generates trusted fact markers" do
- expectFactMarkers inductiveGeneratedMarkers goodInductiveBlocks
- , testCase "inductive generated fact markers are reserved globally" do
- expectDefinedMarkers inductiveGeneratedMarkers goodInductiveBlocks
- , testCase "inductive generated intro and domain facts are usable by reference" do
- expectChecks inductiveIntroAndDomainReferenceBlocks
- , testCase "inductive generated cases fact is usable by reference" do
- expectChecks inductiveCasesReferenceBlocks
- , testCase "inductive generated induction fact is usable by reference" do
- expectChecks inductiveInductReferenceBlocks
- , testCase "inductive generates monotonicity obligations for recursive carriers" do
- text <- encodedTasksText goodMonotoneInductiveBlocks
- assertContains "monotonicity antecedent expands subset" "zf_u1(V2,V0)=>zf_u1(V2,V1)" text
- assertContains "monotonicity conclusion expands subset" "zf_u1(V3,zf_u0(V0))=>zf_u1(V3,zf_u0(V1))" text
- , testCase "inductive rejects recursive premises outside carrier positions" do
- expectCheckingError "carrier of a membership premise" [badRecursiveTermInductiveBlock]
- , testCase "inductive rejects malformed recursive premises" do
- expectCheckingError "direct membership condition" [badRecursiveFormulaInductiveBlock]
- , testCase "inductive rejects malformed results" do
- expectCheckingError "form t \\in F(args)" [badInductiveResultBlock]
- , testCase "inductive rejects recursive occurrences with the wrong arguments" do
- expectCheckingError "wrong arguments" [badInductiveWrongArgsBlock]
- , testCase "inductive validates generated markers before emitting obligations" do
- tasksRef <- newIORef []
- result <-
- try
- (runCheckingBlocks
- [ BlockAxiom
- Nowhere
- "fin_cases"
- (Axiom [] Top)
- , goodInductiveBlock
- ]
- ( initialCheckingState
- WithoutDumpPremselTraining
- (\task -> modifyIORef' tasksRef (task :))
- ))
- :: IO (Either CheckingError CheckingState)
- case result of
- Left (DuplicateMarker _ actualMarker) ->
- assertEqual
- "duplicate marker"
- "fin_cases"
- actualMarker
- Left err ->
- assertFailure
- ("expected DuplicateMarker, got " <> show err)
- Right _ ->
- assertFailure
- "expected generated marker validation to fail"
- tasks <- readIORef tasksRef
- assertBool
- "failed inductive obligations"
- (null tasks)
- , testCase "inductive rejects duplicate carrier ownership" do
- expectCheckingError "already owned" duplicateInductiveCarrierBlocks
- , testCase "inductive rejects operator definitions with the same carrier symbol" do
- expectCheckingError "already owned" operatorThenInductiveBlocks
- , testCase "inductive rejects prior axiom mentions of the carrier" do
- expectCheckingError "without prior ownership" priorInductiveCarrierAxiomBlocks
- , testCase "inductive rejects direct recursive domains" do
- expectCheckingError "independent of the inductive symbol" [badInductiveSelfDomainBlock]
- , testCase "inductive rejects abbreviation-hidden recursive domains" do
- expectCheckingError "independent of the inductive symbol" hiddenSelfDomainBlocks
- , testCase "inductive rejects prior ordinary-definition mentions of the carrier via domains" do
- expectCheckingError "without prior ownership" hiddenDefinitionDomainBlocks
- , testCase "inductive rejects prior ordinary-definition mentions of the carrier via side-condition aliases" do
- expectCheckingError "without prior ownership" hiddenCarrierSideConditionBlocks
- , testCase "datatype rejects prior signature mentions of the datatype head" do
- expectCheckingError "already owned" priorDatatypeHeadSignatureBlocks
- , testCase "datatype rejects prior theorem mentions of constructors" do
- expectCheckingError "without prior ownership" priorDatatypeConstructorLemmaBlocks
- , testCase "datatype constructor ownership blocks later operator definitions" do
- expectCheckingError "already owned" datatypeConstructorThenOperatorBlocks
- , testCase "inductive freezes mentioned symbols against later definitions" do
- expectCheckingError "already owned by signature formula" frozenSymbolDefinitionBlocks
- , testCase "inductive freezes symbols from canonicalized domains" do
- expectCheckingError "already owned by signature formula" canonicalizedDomainFreezeBlocks
- , testCase "inductive freezes transitive definition dependencies" do
- expectCheckingError "already owned by signature formula" transitiveFrozenDefinitionBlocks
- ]
-
-preparesCompleteObligationBatches :: Assertion
-preparesCompleteObligationBatches = do
- registry <-
- case
- Facts.registerStagedFacts
- ( Facts.stageFact
- ("known_fact" :| [])
- (Facts.factOrigin Nowhere "known_block")
- (Facts.prepareSemanticFact Top)
- :| []
- )
- Facts.emptyFactRegistry of
- Left marker ->
- assertFailure
- ("could not register premise " <> show marker)
- Right preparedRegistry ->
- pure preparedRegistry
- batchesRef <- newIORef []
- let initial =
- ( initialCheckingStateWithTaskPreparation
- WithoutDumpPremselTraining
- contractionTask
- (\batch ->
- modifyIORef' batchesRef (batch :))
- )
- { checkingFacts = registry
- , checkingGoals = [Top `Iff` Top, Bottom]
- , blockLabel = "batch_claim"
- , stepLocation = Nowhere
- }
- (_result, afterGoals) <- runStateT tellTasks initial
- (_emptyResult, afterEmpty) <-
- runStateT
- tellTasks
- afterGoals{checkingGoals = []}
- batches <- reverse <$> readIORef batchesRef
- case batches of
- [goalBatch, emptyBatch] -> do
- assertEqual "batch marker"
- "batch_claim"
- (preparedBatchMarker goalBatch)
- assertEqual "batch location"
- Nowhere
- (preparedBatchLocation goalBatch)
- assertEqual "stable declaration-local ordinals"
- [0, 1]
- ( legacyObligationOrdinalValue
- . preparedObligationOrdinal
- <$> toList
- (preparedBatchObligations goalBatch)
- )
- assertEqual "prepared contracted goals"
- [Top, Bottom]
- ( taskConjecture
- . preparedObligationTask
- <$> toList
- (preparedBatchObligations goalBatch)
- )
- case toList (preparedBatchPremises goalBatch) of
- [premise] -> do
- assertEqual "premise marker"
- "known_fact"
- (hypothesisMarker
- (preparedPremiseHypothesis premise))
- assertEqual "premise provenance"
- (RegisteredFactPremise
- (Facts.factOrigin
- Nowhere
- "known_block"))
- (preparedPremiseOrigin premise)
- premises ->
- assertFailure
- ("expected one premise, got "
- <> show (length premises))
- assertBool "empty batch callback"
- (null (preparedBatchObligations emptyBatch))
- assertEqual "empty batch does not consume an ordinal"
- 2
- (legacyObligationOrdinalValue
- (checkingNextObligationOrdinal afterEmpty))
- _ ->
- assertFailure
- ("expected one goal batch and one empty batch, got "
- <> show (length batches))
-
-structureTransactionTests :: TestTree
-structureTransactionTests =
- testGroup "structure transactions"
- [ testCase "reject positive and negative direct self-reference" do
- for_ [fooStructPredicate "A", Not Nowhere (fooStructPredicate "A")]
- \assumption ->
- expectCheckingError
- "self-referential"
- [fooStructBlock "self_struct" [("self_rule", assumption)]]
- , testCase "reject abbreviation-hidden self-reference" do
- expectCheckingError
- "self-referential"
- hiddenSelfReferentialStructBlocks
- , testCase "report unknown and forward parents as located errors" do
- expectUnknownStructureParent
- unknownStruct
- [testStructBlock "unknown_child" childStruct (Set.singleton unknownStruct) []]
- expectUnknownStructureParent
- fooStruct
- [ testStructBlock "forward_child" childStruct (Set.singleton fooStruct) []
- , fooStructBlock "forward_parent" []
- ]
- expectUnknownStructureParent
- fooStruct
- [testStructBlock "self_parent" fooStruct (Set.singleton fooStruct) []]
- , testCase "reject every local structure marker collision" do
- for_
- [ ( "same_marker"
- , fooStructBlock "same_marker" [("same_marker", Top)]
- )
- , ( "duplicate_rule"
- , fooStructBlock
- "duplicate_rules"
- [("duplicate_rule", Top), ("duplicate_rule", Top)]
- )
- , ( "inherit_collisioninherit"
- , fooStructBlock
- "inherit_collision"
- [("inherit_collisioninherit", Top)]
- )
- ]
- \(duplicate, block) ->
- expectDuplicateMarker duplicate [block]
- , testCase "reject collisions before and after a structure" do
- expectDuplicateMarker
- "prior_rule"
- [ BlockAxiom Nowhere "prior_rule" (Axiom [] Top)
- , fooStructBlock "prior_collision" [("prior_rule", Top)]
- ]
- expectDuplicateMarker
- "later_collisioninherit"
- [ fooStructBlock "later_collision" []
- , BlockAxiom
- Nowhere
- "later_collisioninherit"
- (Axiom [] Top)
- ]
- , testCase "commit exact prepared facts and backward dependencies" do
- case preparedFooStructure "prepared_struct" of
- Left err ->
- assertFailure
- ("could not prepare structure: " <> show err)
- Right checked -> do
- let context = BlockContext Nowhere "prepared_struct"
- initial =
- initialCheckingState
- WithoutDumpPremselTraining
- (\_task -> pure ())
- case commitCheckedStructDefn context checked initial of
- Left err ->
- assertFailure
- ("could not commit structure: " <> show err)
- Right committed -> do
- assertBool
- "fact registry invariant"
- (Facts.factRegistryInvariant
- (checkingFacts committed))
- for_
- (zip
- (toList
- (Structure.checkedStructMarkers checked))
- (toList
- (Structure.checkedStructSemanticFacts checked)))
- \(factMarker, prepared) ->
- assertEqual
- ("prepared fact " <> show factMarker)
- (Just prepared)
- (Facts.lookupPreparedFact
- factMarker
- (checkingFacts committed))
- assertEqual
- "structure dependencies"
- (Just
- (Set.singleton
- (SymbolPredicate
- (PredicateNounStruct _Onesorted))))
- (Dependencies.lookupDependencies
- (Structure.checkedStructSymbol checked)
- (checkingDependencies committed))
- ]
-
-preparedFooStructure
- :: Marker
- -> Either
- Structure.StructurePreparationError
- Structure.CheckedStructDefn
-preparedFooStructure marker =
- Structure.prepareCheckedStructDefn
- Nowhere
- marker
- (fooStructDefn [("prepared_rule", Top)])
- (Set.singleton _Onesorted)
- (Set.singleton CarrierSymbol)
-
-expectUnknownStructureParent
- :: StructPhrase
- -> [Block]
- -> Assertion
-expectUnknownStructureParent expected blocks = do
- result <-
- try (check WithoutDumpPremselTraining blocks)
- :: IO (Either CheckingError [Task])
- case result of
- Left (UnknownStructureParent actual Nowhere _) ->
- assertEqual "unknown structure parent" expected actual
- Left err ->
- assertFailure
- ("expected UnknownStructureParent, got " <> show err)
- Right _ ->
- assertFailure "expected an unknown structure parent"
-
-assumptionGoalReductionTests :: TestTree
-assumptionGoalReductionTests =
- testGroup "assumption goal reductions"
- [ testCase "introduces an implication antecedent" do
- assertGoalReduction
- (ImplicationIntroduction propositionA propositionC)
- propositionA
- (propositionA `Implies` propositionC)
- propositionC
- , testCase "curries an assumed left conjunct" do
- assertGoalReduction
- (CurryLeftConjunct propositionA propositionB propositionC)
- propositionA
- ((propositionA `And` propositionB) `Implies` propositionC)
- (propositionB `Implies` propositionC)
- , testCase "curries an assumed right conjunct" do
- assertGoalReduction
- (CurryRightConjunct propositionA propositionB propositionC)
- propositionB
- ((propositionA `And` propositionB) `Implies` propositionC)
- (propositionA `Implies` propositionC)
- , testCase "does not reduce a disjunction" do
- assertEqual "disjunction reduction"
- Nothing
- (reduceGoalWithAssumption
- propositionA
- (propositionA `Or` propositionB))
- ]
-
-proofShapeErrorTests :: TestTree
-proofShapeErrorTests =
- testCase "malformed proof shapes return located errors" do
- for_ cases \(label, expectedError, action) -> do
- result <- try action :: IO (Either CheckingError ())
- assertEqual label (Left expectedError) result
- where
- cases =
- [ ( "ordinal induction goal"
- , ByOrdInductionSyntacticMismatch
- proofShapeLocation
- "bad_ordinal_induction"
- , checkAsUnit
- (proofBlocks
- "bad_ordinal_induction"
- Top
- (ByOrdInduction
- proofShapeLocation
- (Omitted proofShapeLocation)))
- )
- , ( "set extensionality with take"
- , SetExtensionalityWithTake
- proofShapeLocation
- "bad_take_setext"
- , checkAsUnit
- (proofBlocks
- "bad_take_setext"
- Top
- (Take
- proofShapeLocation
- ("witness" :| [])
- Top
- JustificationSetExt
- (Omitted proofShapeLocation)))
- )
- ]
-
- checkAsUnit =
- void . check WithoutDumpPremselTraining
-
- proofBlocks marker goal proof =
- [ BlockLemma
- proofShapeLocation
- marker
- (Lemma [] goal)
- , BlockProof
- proofShapeLocation
- proofShapeLocation
- proof
- ]
-
- proofShapeLocation =
- mkLocation (FileId 47) 6 11
-
-assertGoalReduction
- :: GoalReduction
- -> Formula
- -> Formula
- -> Formula
- -> Assertion
-assertGoalReduction expected assumption original residual =
- case reduceGoalWithAssumption assumption original of
- Nothing ->
- assertFailure "expected a goal reduction"
- Just reduction -> do
- assertEqual "trusted rule" expected reduction
- assertEqual "introduced assumption"
- assumption
- (goalReductionAssumption reduction)
- assertEqual "residual goal"
- residual
- (goalReductionResidual reduction)
- assertReductionSound original reduction
-
-assertReductionSound :: Formula -> GoalReduction -> Assertion
-assertReductionSound original reduction =
- for_ propositionAssignments \assignment -> do
- let discharged =
- goalReductionAssumption reduction
- `Implies` goalReductionResidual reduction
- soundness = discharged `Implies` original
- assertBool
- ( "reduction is not sound under "
- <> show assignment
- <> ": "
- <> show reduction
- )
- (evaluateProposition assignment soundness)
-
-type PropositionAssignment = (Bool, Bool, Bool)
-
-evaluateProposition :: PropositionAssignment -> Formula -> Bool
-evaluateProposition assignment@(a, b, c) = \case
- Atomic _location (PredicateSymbol name) [] ->
- case name of
- "A" -> a
- "B" -> b
- "C" -> c
- _ -> error ("missing proposition value for " <> show name)
- left `And` right ->
- evaluateProposition assignment left
- && evaluateProposition assignment right
- left `Or` right ->
- evaluateProposition assignment left
- || evaluateProposition assignment right
- left `Implies` right ->
- not (evaluateProposition assignment left)
- || evaluateProposition assignment right
- Not _location formula ->
- not (evaluateProposition assignment formula)
- Top ->
- True
- Bottom ->
- False
- formula ->
- error
- ( "not a propositional test formula under "
- <> show assignment
- <> ": "
- <> show formula
- )
-
-propositionAssignments :: [PropositionAssignment]
-propositionAssignments =
- [ (a, b, c)
- | a <- [False, True]
- , b <- [False, True]
- , c <- [False, True]
- ]
-
-propositionA, propositionB, propositionC :: Formula
-propositionA = proposition "A"
-propositionB = proposition "B"
-propositionC = proposition "C"
-
-proposition :: Text -> Formula
-proposition name =
- Atomic Nowhere (PredicateSymbol name) []
-
-expectChecks :: [Block] -> Assertion
-expectChecks blocks = do
- _tasks <- check WithoutDumpPremselTraining blocks
- pure ()
-
-encodedTasksText :: [Block] -> IO Text
-encodedTasksText blocks = do
- tasks <- check WithoutDumpPremselTraining blocks
- if null tasks
- then assertFailure "expected at least one generated task"
- else pure ()
- pure (Text.intercalate "\n------------------\n" (encodeTaskText <$> tasks))
-
-expectCheckingError :: Text -> [Block] -> Assertion
-expectCheckingError fragment blocks = do
- result <- try (check WithoutDumpPremselTraining blocks) :: IO (Either CheckingError [Task])
- case result of
- Right _ ->
- assertFailure "expected a CheckingError, but checking succeeded"
- Left err@(CheckingError msg _ _) ->
- assertBool ("expected error containing " <> show fragment <> ", got " <> show err) (fragment `Text.isInfixOf` msg)
- Left err ->
- assertFailure ("expected generic CheckingError, got " <> show err)
-
-expectMismatchedAssume :: [Block] -> Assertion
-expectMismatchedAssume blocks = do
- result <- try (check WithoutDumpPremselTraining blocks) :: IO (Either CheckingError [Task])
- case result of
- Right _ ->
- assertFailure "expected a MismatchedAssume error, but checking succeeded"
- Left (MismatchedAssume _assumption _goal _location _marker) ->
- pure ()
- Left err ->
- assertFailure ("expected MismatchedAssume, got " <> show err)
-
-expectFactMarkers :: [Marker] -> [Block] -> Assertion
-expectFactMarkers markers blocks = do
- checkingState <- runCheckingBlocks blocks (initialCheckingState WithoutDumpPremselTraining (\_task -> pure ()))
- let facts = checkingFacts checkingState
- for_ markers \marker ->
- assertBool
- ("expected generated fact marker " <> show marker)
- (isJust (Facts.lookupPreparedFact marker facts))
-
-datatypePreparedFacts
- :: [Block]
- -> IO [Facts.PreparedSemanticFact]
-datatypePreparedFacts blocks = do
- checkingState <-
- runCheckingBlocks
- blocks
- ( initialCheckingState
- WithoutDumpPremselTraining
- (\_task -> pure ())
- )
- traverse
- (lookupFact (checkingFacts checkingState))
- datatypeGeneratedMarkers
- where
- lookupFact facts marker =
- case Facts.lookupPreparedFact marker facts of
- Just fact ->
- pure fact
- Nothing -> do
- assertFailure
- ("missing generated datatype fact " <> show marker)
- pure
- (impossible
- "assertFailure returned while looking up a datatype fact")
-
-expectDefinedMarkers :: [Marker] -> [Block] -> Assertion
-expectDefinedMarkers markers blocks = do
- checkingState <- runCheckingBlocks blocks (initialCheckingState WithoutDumpPremselTraining (\_task -> pure ()))
- let reserved = definedMarkers checkingState
- for_ markers \marker ->
- assertBool ("expected reserved marker " <> show marker) (HS.member marker reserved)
-
-expectDuplicateMarker :: Marker -> [Block] -> Assertion
-expectDuplicateMarker expectedMarker blocks = do
- result <- try (check WithoutDumpPremselTraining blocks) :: IO (Either CheckingError [Task])
- case result of
- Right _ ->
- assertFailure "expected a DuplicateMarker error, but checking succeeded"
- Left (DuplicateMarker _ actualMarker) ->
- assertEqual "duplicate marker" expectedMarker actualMarker
- Left err ->
- assertFailure ("expected DuplicateMarker, got " <> show err)
-
-assertContains :: String -> Text -> Text -> Assertion
-assertContains label needle haystack =
- assertBool (label <> ": expected to find " <> show needle <> " in " <> Text.unpack haystack) (needle `Text.isInfixOf` haystack)
-
-assertNotContains :: String -> Text -> Text -> Assertion
-assertNotContains label needle haystack =
- assertBool (label <> ": expected not to find " <> show needle <> " in " <> Text.unpack haystack) (not (needle `Text.isInfixOf` haystack))
-
-lemmaBlocks :: Marker -> Lemma -> Proof -> [Block]
-lemmaBlocks marker lemma proof =
- [BlockLemma Nowhere marker lemma, BlockProof Nowhere Nowhere proof]
-
-badFixLemma :: Lemma
-badFixLemma =
- Lemma [Asm (var "a" `eq` var "b")] (makeForall ["x"] (var "x" `eq` var "b"))
-
-badFixProof :: Proof
-badFixProof =
- Fix Nowhere ("a" :| []) Top (Qed (Just Nowhere) JustificationLocal)
-
-badDefineLemma :: Lemma
-badDefineLemma =
- Lemma [] (makeForall ["x"] (var "x" `eq` emptySet))
-
-badDefineProof :: Proof
-badDefineProof =
- Fix Nowhere ("x" :| []) Top (Define Nowhere "x" emptySet (Qed (Just Nowhere) JustificationLocal))
-
-badTakeLemma :: Lemma
-badTakeLemma =
- Lemma [Asm (makeExists ["x"] (var "x" `neq` var "b"))] (var "a" `neq` var "b")
-
-badTakeProof :: Proof
-badTakeProof =
- Take Nowhere ("a" :| []) (var "a" `neq` var "b") JustificationLocal (Qed (Just Nowhere) JustificationLocal)
-
-badHaveLemma :: Lemma
-badHaveLemma =
- Lemma [] Top
-
-badHaveProof :: Proof
-badHaveProof =
- Have Nowhere (var "c" `eq` var "c") JustificationEmpty (Qed (Just Nowhere) JustificationEmpty)
-
-badDefineFunctionNameLemma :: Lemma
-badDefineFunctionNameLemma =
- Lemma [] (var "f" `eq` var "f")
-
-badDefineFunctionNameProof :: Proof
-badDefineFunctionNameProof =
- DefineFunction Nowhere "f" "x" (var "x") emptySet (Qed (Just Nowhere) JustificationLocal)
-
-badDefineFunctionArgLemma :: Lemma
-badDefineFunctionArgLemma =
- Lemma [] (var "x" `eq` var "x")
-
-badDefineFunctionArgProof :: Proof
-badDefineFunctionArgProof =
- DefineFunction Nowhere "f" "x" (var "x") emptySet (Qed (Just Nowhere) JustificationLocal)
-
-freeGoalLocalLemma :: Lemma
-freeGoalLocalLemma =
- Lemma [] (var "b" `eq` var "b")
-
-freeGoalLocalProof :: Proof
-freeGoalLocalProof =
- Qed (Just Nowhere) JustificationEmpty
-
-freshFixLemma :: Lemma
-freshFixLemma =
- Lemma [] (makeForall ["x"] (var "x" `eq` var "x"))
-
-freshFixProof :: Proof
-freshFixProof =
- Fix Nowhere ("x" :| []) Top (Qed (Just Nowhere) JustificationEmpty)
-
-freshTakeLemma :: Lemma
-freshTakeLemma =
- Lemma [Asm (makeExists ["x"] (var "x" `eq` var "b"))] (var "b" `eq` var "b")
-
-freshTakeProof :: Proof
-freshTakeProof =
- Take Nowhere ("y" :| []) (var "y" `eq` var "b") JustificationLocal (Qed (Just Nowhere) JustificationEmpty)
-
-unsoundDisjunctionAssumeBlocks :: [Block]
-unsoundDisjunctionAssumeBlocks =
- [ BlockAxiom Nowhere "membership_asymmetry"
- (Axiom [] (membershipXY `Implies` Not Nowhere membershipYX))
- , BlockLemma Nowhere "membership_totality"
- (Lemma [] (membershipXY `Or` membershipYX))
- , BlockProof Nowhere Nowhere
- (Assume Nowhere membershipXY
- (Qed (Just Nowhere)
- (JustificationRef ("membership_asymmetry" :| []))))
- ]
- where
- membershipXY = var "x" `isElementOf` var "y"
- membershipYX = var "y" `isElementOf` var "x"
-
-structCarrierRewriteBlocks :: [Block]
-structCarrierRewriteBlocks =
- [ fooStructBlock "foo_struct" [("foo_rule", makeForall ["x"] ((var "x" `isElementOf` var "A") `Implies` (var "x" `isElementOf` var "A")))]
- , BlockLemma Nowhere "foo_test" (Lemma [AsmStruct "A" fooStruct, Asm (var "x" `isElementOf` var "A")] (var "x" `isElementOf` var "A"))
- , BlockProof Nowhere Nowhere (Qed (Just Nowhere) (JustificationRef ("foo_rule" :| [])))
- ]
-
-structOperationRewriteBlocks :: [Block]
-structOperationRewriteBlocks =
- [ fooStructBlock "foo_op_struct" [("foo_op_rule", TermSymbolStruct fooOp Nothing `isElementOf` var "A")]
- , BlockLemma Nowhere "foo_op_test" (Lemma [AsmStruct "A" fooStruct] (TermSymbolStruct fooOp Nothing `isElementOf` var "A"))
- , BlockProof Nowhere Nowhere (Qed (Just Nowhere) (JustificationRef ("foo_op_rule" :| [])))
- ]
-
-unresolvedStructOperationBlocks :: [Block]
-unresolvedStructOperationBlocks =
- [ fooStructBlock "unresolved_structure_definition" []
- , BlockAxiom
- structureTermErrorLocation
- "unresolved_structure_operation"
- (Axiom []
- (TermSymbolStruct fooOp Nothing
- `eq` TermSymbolStruct fooOp Nothing))
- ]
-
-nestedStructComprehensionBlocks :: [Block]
-nestedStructComprehensionBlocks =
- [ fooStructBlock "nested_structure_definition" []
- , BlockAxiom
- structureTermErrorLocation
- "nested_structure_comprehension"
- (Axiom []
- (nestedOperation `eq` nestedOperation))
- ]
- where
- nestedOperation =
- TermSymbolStruct
- fooOp
- (Just
- (TermSep
- "x"
- emptySet
- (toScope Top)))
-
-structureTermErrorLocation :: Location
-structureTermErrorLocation =
- mkLocation (FileId 50) 7 1
-
-structClaimIntroducesContextBlocks :: [Block]
-structClaimIntroducesContextBlocks =
- [ fooStructBlock "foo_claim_struct" []
- , BlockLemma Nowhere "foo_claim_test" (Lemma [] ((var "A" `eq` var "A") `And` (var "x" `eq` var "x")))
- , BlockProof Nowhere Nowhere $
- Have Nowhere (fooStructPredicate "A") JustificationEmpty $
- Have Nowhere (var "x" `isElementOf` var "A") JustificationEmpty (Omitted Nowhere)
- ]
-
-boundStructLabelBlocks :: [Block]
-boundStructLabelBlocks =
- [ fooStructBlock "foo_bound_struct" []
- , BlockLemma Nowhere "foo_bound_test" (Lemma [AsmStruct "A" fooStruct] (makeForall ["A"] (var "x" `isElementOf` var "A")))
- , BlockProof Nowhere Nowhere (Qed (Just Nowhere) JustificationEmpty)
- ]
-
-fooStructBlock :: Marker -> [(Marker, Formula)] -> Block
-fooStructBlock marker assumes =
- BlockStruct Nowhere marker (fooStructDefn assumes)
-
-fooStructDefn :: [(Marker, Formula)] -> StructDefn
-fooStructDefn assumes =
- StructDefn
- { structPhrase = fooStruct
- , structParents = Set.singleton _Onesorted
- , structDefnLabel = "A"
- , structDefnFixes = Set.singleton fooOp
- , structDefnAssumes = assumes
- }
-
-testStructBlock
- :: Marker
- -> StructPhrase
- -> Set StructPhrase
- -> [(Marker, Formula)]
- -> Block
-testStructBlock marker phrase parents assumes =
- BlockStruct Nowhere marker StructDefn
- { structPhrase = phrase
- , structParents = parents
- , structDefnLabel = "A"
- , structDefnFixes = mempty
- , structDefnAssumes = assumes
- }
-
-fooStruct :: StructPhrase
-fooStruct =
- mkLexicalItemSgPl (unsafeReadPhraseSgPl "foo[/s]") "foo"
-
-childStruct :: StructPhrase
-childStruct =
- mkLexicalItemSgPl
- (unsafeReadPhraseSgPl "child[/s]")
- "child"
-
-unknownStruct :: StructPhrase
-unknownStruct =
- mkLexicalItemSgPl
- (unsafeReadPhraseSgPl "unknown[/s]")
- "unknown"
-
-fooOp :: StructSymbol
-fooOp =
- StructSymbol "fooop"
-
-fooStructPredicate :: VarSymbol -> Formula
-fooStructPredicate x =
- TermSymbol Nowhere (SymbolPredicate (PredicateNounStruct fooStruct)) [TermVar x]
-
-hiddenSelfReferentialStructBlocks :: [Block]
-hiddenSelfReferentialStructBlocks =
- [ BlockAbbr Nowhere "struct_alias_a"
- ( Abbreviation
- (SymbolPredicate structAliasA)
- (toScope
- (TermSymbol
- Nowhere
- (SymbolPredicate (PredicateNounStruct fooStruct))
- [TermVar (B 0)]))
- )
- , BlockAbbr Nowhere "struct_alias_b"
- ( Abbreviation
- (SymbolPredicate structAliasB)
- (toScope
- (TermSymbol
- Nowhere
- (SymbolPredicate structAliasA)
- [TermVar (B 0)]))
- )
- , fooStructBlock
- "hidden_self_struct"
- [("hidden_self_rule", structAliasFormula structAliasB (var "A"))]
- ]
-
-structAliasA :: Predicate
-structAliasA =
- PredicateSymbol "struct_alias_a"
-
-structAliasB :: Predicate
-structAliasB =
- PredicateSymbol "struct_alias_b"
-
-structAliasFormula :: Predicate -> Term -> Formula
-structAliasFormula predicate term =
- TermSymbol Nowhere (SymbolPredicate predicate) [term]
-
-var :: VarSymbol -> Term
-var = TermVar
-
-emptySet :: Term
-emptySet = EmptySet Nowhere
-
-eq :: Term -> Term -> Formula
-eq = Equals Nowhere
-
-neq :: Term -> Term -> Formula
-neq = NotEquals Nowhere
-
-directSelfReferentialAbbrBlocks :: [Block]
-directSelfReferentialAbbrBlocks =
- [ BlockAbbr Nowhere "bad_abbr_direct" (Abbreviation abbrSymbolA (toScope (TermSymbol Nowhere abbrSymbolA [])))
- ]
-
-indirectSelfReferentialAbbrBlocks :: [Block]
-indirectSelfReferentialAbbrBlocks =
- [ BlockAbbr Nowhere "bad_abbr_indirect_a" (Abbreviation abbrSymbolA (toScope (TermSymbol Nowhere abbrSymbolB [])))
- , BlockAbbr Nowhere "bad_abbr_indirect_b" (Abbreviation abbrSymbolB (toScope (TermSymbol Nowhere abbrSymbolA [])))
- ]
-
-directSelfReferentialPredicateDefinitionBlocks :: [Block]
-directSelfReferentialPredicateDefinitionBlocks =
- [ BlockDefn Nowhere "bad_predicate_definition_direct"
- ( DefnPredicate
- []
- definitionTestPredicate
- ("x" :| [])
- (Not Nowhere (definitionTestPredicateFormula (var "x")))
- )
- ]
-
-directSelfReferentialFunctionDefinitionBlocks :: [Block]
-directSelfReferentialFunctionDefinitionBlocks =
- [ BlockDefn Nowhere "bad_function_definition_direct"
- ( DefnFun
- []
- definitionTestFunction
- ["x"]
- (definitionTestFunctionTerm (var "x"))
- )
- ]
-
-directSelfReferentialOperatorDefinitionBlocks :: [Block]
-directSelfReferentialOperatorDefinitionBlocks =
- [ BlockDefn Nowhere "bad_operator_definition_direct"
- (DefnOp definitionTestOperator ["x"] (termSymbol definitionTestOperator [var "x"]))
- ]
-
-abbreviationHiddenSelfReferentialDefinitionBlocks :: [Block]
-abbreviationHiddenSelfReferentialDefinitionBlocks =
- [ BlockAbbr Nowhere "bad_definition_body_alias"
- ( Abbreviation
- (SymbolMixfix selfDefinitionBodyAlias)
- (toScope (TermSymbol Nowhere (SymbolMixfix definitionTestOperator) [TermVar (B 0)]))
- )
- , BlockDefn Nowhere "bad_definition_body_target"
- (DefnOp definitionTestOperator ["x"] (termSymbol selfDefinitionBodyAlias [var "x"]))
- ]
-
-assumptionHiddenSelfReferentialDefinitionBlocks :: [Block]
-assumptionHiddenSelfReferentialDefinitionBlocks =
- [ BlockAbbr Nowhere "bad_definition_assumption_alias"
- ( Abbreviation
- (SymbolPredicate selfDefinitionAssumptionAlias)
- (toScope (TermSymbol Nowhere (SymbolPredicate definitionTestPredicate) [TermVar (B 0)]))
- )
- , BlockDefn Nowhere "bad_definition_assumption_target"
- ( DefnPredicate
- [Asm (selfDefinitionAssumptionAliasFormula (var "x"))]
- definitionTestPredicate
- ("x" :| [])
- (var "x" `eq` var "x")
- )
- ]
-
-nonRecursiveDefinitionBlocks :: [Block]
-nonRecursiveDefinitionBlocks =
- [ BlockDefn Nowhere "good_predicate_definition"
- (DefnPredicate [] definitionTestPredicate ("x" :| []) (var "x" `eq` var "x"))
- , BlockDefn Nowhere "good_function_definition"
- (DefnFun [] definitionTestFunction ["x"] emptySet)
- , BlockDefn Nowhere "good_operator_definition"
- (DefnOp definitionTestOperator ["x"] emptySet)
- ]
-
-definitionTestPredicate :: Predicate
-definitionTestPredicate =
- PredicateSymbol "definition_test_predicate"
-
-definitionTestPredicateFormula :: Term -> Formula
-definitionTestPredicateFormula expr =
- TermSymbol Nowhere (SymbolPredicate definitionTestPredicate) [expr]
-
-definitionTestFunction :: LexicalItemSgPl
-definitionTestFunction =
- mkLexicalItemSgPl
- (unsafeReadPhraseSgPl "definition test function[/s] of ?")
- "definition_test_function"
-
-definitionTestFunctionTerm :: Term -> Term
-definitionTestFunctionTerm expr =
- TermSymbol Nowhere (SymbolFun definitionTestFunction) [expr]
-
-definitionTestOperator :: FunctionSymbol
-definitionTestOperator =
- unarySymbol "definition_test_operator"
-
-selfDefinitionBodyAlias :: FunctionSymbol
-selfDefinitionBodyAlias =
- unarySymbol "self_definition_body_alias"
-
-selfDefinitionAssumptionAlias :: Predicate
-selfDefinitionAssumptionAlias =
- PredicateSymbol "self_definition_assumption_alias"
-
-selfDefinitionAssumptionAliasFormula :: Term -> Formula
-selfDefinitionAssumptionAliasFormula expr =
- TermSymbol Nowhere (SymbolPredicate selfDefinitionAssumptionAlias) [expr]
-
-builtinMixfixMarkerCollisionBlock :: Block
-builtinMixfixMarkerCollisionBlock =
- BlockDefn Nowhere "pow" (DefnOp powHijackSym ["A"] emptySet)
-
-powHijackSym :: FunctionSymbol
-powHijackSym =
- mkMixfixItem
- [Just (Command "powhijack"), Just InvisibleBraceL, Nothing, Just InvisibleBraceR]
- "pow"
- NonAssoc
-
-builtinPredicateMarkerCollisionBlock :: Block
-builtinPredicateMarkerCollisionBlock =
- BlockDefn Nowhere "elem"
- ( DefnPredicate
- []
- (PredicateRelation
- (RelationSymbol
- (Command "elemhijack")
- zeroParameterArity
- "elem"))
- ("A" :| ["B"])
- (var "A" `eq` var "B")
- )
-
-builtinAbbreviationMarkerCollisionBlock :: Block
-builtinAbbreviationMarkerCollisionBlock =
- BlockAbbr Nowhere "pow"
- ( Abbreviation
- (SymbolMixfix (constSymbolWithMarker "powabbr" "pow"))
- (toScope (TermSymbol Nowhere (SymbolInteger 0) []))
- )
-
-builtinMarkerProofLabelBlock :: Block
-builtinMarkerProofLabelBlock =
- BlockAxiom Nowhere "pow" (Axiom [] (emptySet `eq` emptySet))
-
-subseteqDefinitionBlock :: Block
-subseteqDefinitionBlock =
- BlockDefn Nowhere "subseteq"
- ( DefnPredicate
- []
- (PredicateRelation SubseteqSymbol)
- ("A" :| ["B"])
- (var "A" `eq` var "B")
- )
-
-goodDatatypeBlock :: Block
-goodDatatypeBlock =
- datatypeBlock "good_datatype" goodDatatypeClauses
-
-directRecursionAliasDatatypeBlocks :: [Block]
-directRecursionAliasDatatypeBlocks =
- [ closedDatatypeAliasBlock
- "direct_recursion_alias"
- directRecursionAliasSym
- (closedTermSymbol propformSym [])
- , datatypeBlock
- "aliased_recursive_datatype"
- ( DatatypeClause
- (SymbolPattern propbotSym [])
- []
- :| [ DatatypeClause
- (SymbolPattern propvarSym ["n"])
- [("n", naturalsTerm)]
- , DatatypeClause
- (SymbolPattern proptoSym ["p", "q"])
- [ ("p", termSymbol directRecursionAliasSym [])
- , ("q", termSymbol directRecursionAliasSym [])
- ]
- ]
- )
- ]
-
-oneHopPowersetAliasDatatypeBlocks :: [Block]
-oneHopPowersetAliasDatatypeBlocks =
- [ closedDatatypeAliasBlock
- "powerset_recursion_alias"
- powersetRecursionAliasSym
- ( closedTermSymbol
- powSym
- [closedTermSymbol propformSym []]
- )
- , datatypeBlock
- "one_hop_powerset_recursive_datatype"
- ( DatatypeClause
- (SymbolPattern propvarSym ["n"])
- [("n", termSymbol powersetRecursionAliasSym [])]
- :| []
- )
- ]
-
-multiHopPowersetAliasDatatypeBlocks :: [Block]
-multiHopPowersetAliasDatatypeBlocks =
- [ closedDatatypeAliasBlock
- "powerset_recursion_alias"
- powersetRecursionAliasSym
- ( closedTermSymbol
- powSym
- [closedTermSymbol propformSym []]
- )
- , closedDatatypeAliasBlock
- "indirect_powerset_recursion_alias"
- indirectPowersetRecursionAliasSym
- (closedTermSymbol powersetRecursionAliasSym [])
- , datatypeBlock
- "multi_hop_powerset_recursive_datatype"
- ( DatatypeClause
- (SymbolPattern propvarSym ["n"])
- [("n", termSymbol indirectPowersetRecursionAliasSym [])]
- :| []
- )
- ]
-
-closedDatatypeAliasBlock
- :: Marker
- -> FunctionSymbol
- -> ExprOf (Var Int Void)
- -> Block
-closedDatatypeAliasBlock marker symbol body =
- BlockAbbr
- Nowhere
- marker
- (Abbreviation (SymbolMixfix symbol) (toScope body))
-
-closedTermSymbol
- :: FunctionSymbol
- -> [ExprOf (Var Int Void)]
- -> ExprOf (Var Int Void)
-closedTermSymbol symbol =
- TermSymbol Nowhere (SymbolMixfix symbol)
-
-datatypeGeneratedMarkers :: [Marker]
-datatypeGeneratedMarkers =
- [ "propform_propbot_intro"
- , "propform_propvar_intro"
- , "propform_propto_intro"
- , "propform_propbot_propvar_distinct"
- , "propform_propbot_propto_distinct"
- , "propform_propvar_propto_distinct"
- , "propform_propvar_injective"
- , "propform_propto_injective"
- , "propform_cases"
- , "propform_induct"
- ]
-
-datatypeIntroReferenceBlocks :: [Block]
-datatypeIntroReferenceBlocks =
- [ goodDatatypeBlock
- , BlockLemma Nowhere "datatype_propbot_intro_ref"
- (Lemma [] (propbotTerm `isElementOf` propformTerm))
- , BlockProof Nowhere Nowhere
- (Qed (Just Nowhere) (JustificationRef ("propform_propbot_intro" :| [])))
- , BlockLemma Nowhere "datatype_propvar_intro_ref"
- (Lemma [Asm (var "n" `isElementOf` naturalsTerm)] (termSymbol propvarSym [var "n"] `isElementOf` propformTerm))
- , BlockProof Nowhere Nowhere
- (Qed (Just Nowhere) (JustificationRef ("propform_propvar_intro" :| [])))
- , BlockLemma Nowhere "datatype_propto_intro_ref"
- (Lemma [Asm (propbotTerm `isElementOf` propformTerm)] (proptoTerm propbotTerm propbotTerm `isElementOf` propformTerm))
- , BlockProof Nowhere Nowhere
- (Qed (Just Nowhere) (JustificationRef ("propform_propto_intro" :| [])))
- ]
-
-datatypeDistinctReferenceBlocks :: [Block]
-datatypeDistinctReferenceBlocks =
- [ goodDatatypeBlock
- , BlockLemma Nowhere "datatype_distinct_ref"
- (Lemma [] (propbotTerm `neq` proptoTerm propbotTerm propbotTerm))
- , BlockProof Nowhere Nowhere
- (Qed (Just Nowhere) (JustificationRef ("propform_propbot_propto_distinct" :| [])))
- ]
-
-datatypeInjectiveReferenceBlocks :: [Block]
-datatypeInjectiveReferenceBlocks =
- [ goodDatatypeBlock
- , BlockLemma Nowhere "datatype_injective_ref"
- (Lemma [] (makeForall ["m", "n"] ((termSymbol propvarSym [var "m"] `eq` termSymbol propvarSym [var "n"]) `Implies` (var "m" `eq` var "n"))))
- , BlockProof Nowhere Nowhere
- (Qed (Just Nowhere) (JustificationRef ("propform_propvar_injective" :| [])))
- ]
-
-datatypeGeneratedMarkerReuseBlocks :: [Block]
-datatypeGeneratedMarkerReuseBlocks =
- [ goodDatatypeBlock
- , BlockLemma Nowhere "propform_cases" (Lemma [] Top)
- ]
-
-badDuplicateConstructorMarkerDatatypeBlock :: Block
-badDuplicateConstructorMarkerDatatypeBlock =
- datatypeBlock "propform"
- ( DatatypeClause (SymbolPattern (unarySymbol "dup") ["n"]) [("n", naturalsTerm)] :|
- [ DatatypeClause (SymbolPattern (infixSymbol "dup") ["p", "q"]) [("p", propformTerm), ("q", propformTerm)]
- ]
- )
-
-badNestedRecursiveDatatypeBlock :: Block
-badNestedRecursiveDatatypeBlock =
- datatypeBlock "bad_nested_recursive_datatype"
- (DatatypeClause (SymbolPattern proptoSym ["p", "q"]) [("p", wrapPropformTerm), ("q", propformTerm)] :| [])
-
-badMissingPremiseDatatypeBlock :: Block
-badMissingPremiseDatatypeBlock =
- datatypeBlock "bad_missing_premise_datatype"
- (DatatypeClause (SymbolPattern propvarSym ["n"]) [] :| [])
-
-badDuplicateConstructorDatatypeBlock :: Block
-badDuplicateConstructorDatatypeBlock =
- datatypeBlock "bad_duplicate_constructor_datatype"
- ( DatatypeClause (SymbolPattern propbotSym []) [] :|
- [ DatatypeClause (SymbolPattern propbotSym []) []
- ]
- )
-
-badOpenDomainDatatypeBlock :: Block
-badOpenDomainDatatypeBlock =
- datatypeBlock "bad_open_domain_datatype"
- (DatatypeClause (SymbolPattern propvarSym ["n"]) [("n", TermVar "A")] :| [])
-
-badApplyConstructorDatatypeBlock :: Block
-badApplyConstructorDatatypeBlock =
- datatypeBlock "bad_apply_constructor_datatype"
- (DatatypeClause (SymbolPattern ApplySymbol ["f", "x"]) [("f", naturalsTerm), ("x", naturalsTerm)] :| [])
-
-goodInductiveBlock :: Block
-goodInductiveBlock =
- BlockInductive Nowhere "fin" Inductive
- { inductiveSymbol = finSym
- , inductiveParams = ["A"]
- , inductiveDomain = powTerm (var "A")
- , inductiveIntros =
- IntroRule [] (emptySet `isElementOf` finTerm (var "A")) :|
- [ IntroRule
- [ var "a" `isElementOf` var "A"
- , var "B" `isElementOf` finTerm (var "A")
- ]
- (consTerm (var "a") (var "B") `isElementOf` finTerm (var "A"))
- ]
- }
-
-goodInductiveBlocks :: [Block]
-goodInductiveBlocks =
- [ goodInductiveBlock
- ]
-
-goodMonotoneInductiveBlock :: Block
-goodMonotoneInductiveBlock =
- BlockInductive Nowhere "acc" Inductive
- { inductiveSymbol = accSym
- , inductiveParams = ["R"]
- , inductiveDomain = wrapTerm (var "R")
- , inductiveIntros =
- IntroRule
- [ var "x" `isElementOf` wrapTerm (accTerm (var "R")) ]
- (var "x" `isElementOf` accTerm (var "R"))
- :| []
- }
-
-goodMonotoneInductiveBlocks :: [Block]
-goodMonotoneInductiveBlocks =
- [ wrapSignatureBlock
- , goodMonotoneInductiveBlock
- ]
-
-inductiveGeneratedMarkers :: [Marker]
-inductiveGeneratedMarkers =
- [ "fin_intro_1"
- , "fin_intro_2"
- , "fin_dom_subset"
- , "fin_cases"
- , "fin_induct"
- ]
-
-inductiveIntroAndDomainReferenceBlocks :: [Block]
-inductiveIntroAndDomainReferenceBlocks =
- goodInductiveBlocks
- <> [ BlockLemma Nowhere "inductive_intro_ref"
- (Lemma [] (makeForall ["A"] (emptySet `isElementOf` finTerm (var "A"))))
- , BlockProof Nowhere Nowhere
- (Qed (Just Nowhere) (JustificationRef ("fin_intro_1" :| [])))
- , BlockLemma Nowhere "inductive_dom_subset_ref"
- (Lemma [] $
- makeForall ["A"] $
- semanticSubsetFormula (Set.fromList ["A"]) (finTerm (var "A")) (powTerm (var "A")))
- , BlockProof Nowhere Nowhere
- (Qed (Just Nowhere) (JustificationRef ("fin_dom_subset" :| [])))
- ]
-
-inductiveCasesReferenceBlocks :: [Block]
-inductiveCasesReferenceBlocks =
- goodInductiveBlocks
- <> [ BlockLemma Nowhere "inductive_cases_ref"
- (Lemma [] finCasesFormula)
- , BlockProof Nowhere Nowhere
- (Qed (Just Nowhere) (JustificationRef ("fin_cases" :| [])))
- ]
-
-inductiveInductReferenceBlocks :: [Block]
-inductiveInductReferenceBlocks =
- goodInductiveBlocks
- <> [ BlockLemma Nowhere "inductive_induct_ref"
- (Lemma [] finInductFormula)
- , BlockProof Nowhere Nowhere
- (Qed (Just Nowhere) (JustificationRef ("fin_induct" :| [])))
- ]
-
-duplicateInductiveCarrierBlocks :: [Block]
-duplicateInductiveCarrierBlocks =
- goodInductiveBlocks
- <> [ BlockInductive Nowhere "fin_again" Inductive
- { inductiveSymbol = finSym
- , inductiveParams = ["A"]
- , inductiveDomain = wrapTerm (var "A")
- , inductiveIntros =
- IntroRule [] (emptySet `isElementOf` finTerm (var "A")) :| []
- }
- ]
-
-operatorThenInductiveBlocks :: [Block]
-operatorThenInductiveBlocks =
- [ BlockDefn Nowhere "fin_operator_definition" (DefnOp finSym ["A"] emptySet)
- , goodInductiveBlock
- ]
-
-signaturePredicateUsageBlocks :: [Block]
-signaturePredicateUsageBlocks =
- [ BlockSig Nowhere "sig_predicate" [] (SignaturePredicate signaturePredicate ("x" :| []))
- , BlockLemma Nowhere "sig_predicate_use"
- (Lemma [] (makeForall ["x"] (signaturePredicateFormula (var "x") `Implies` signaturePredicateFormula (var "x"))))
- ]
-
-signatureFormulaUsageBlocks :: [Block]
-signatureFormulaUsageBlocks =
- [ BlockSig Nowhere "sig_formula" [] (SignatureFormula recoverableSignatureFormula)
- , BlockLemma Nowhere "sig_formula_use"
- (Lemma [] (makeForall ["A"] (signatureDeclaredTerm (var "A") `eq` signatureDeclaredTerm (var "A"))))
- ]
-
-badSignatureFormulaBlock :: Block
-badSignatureFormulaBlock =
- BlockSig Nowhere "bad_signature_formula" [] (SignatureFormula Top)
-
-priorInductiveCarrierAxiomBlocks :: [Block]
-priorInductiveCarrierAxiomBlocks =
- [ BlockAxiom Nowhere "pre_fin_axiom" (Axiom [] (emptySet `isElementOf` finTerm emptySet))
- , goodInductiveBlock
- ]
-
-badInductiveSelfDomainBlock :: Block
-badInductiveSelfDomainBlock =
- BlockInductive Nowhere "bad_inductive_self_domain" Inductive
- { inductiveSymbol = finSym
- , inductiveParams = ["A"]
- , inductiveDomain = finTerm (var "A")
- , inductiveIntros =
- IntroRule [] (emptySet `isElementOf` finTerm (var "A")) :| []
- }
-
-hiddenSelfDomainBlocks :: [Block]
-hiddenSelfDomainBlocks =
- [ BlockAbbr Nowhere "hidden_self_domain_abbr"
- (Abbreviation
- (SymbolMixfix hiddenSelfDomainSym)
- (toScope (TermSymbol Nowhere (SymbolMixfix finSym) [TermVar (B 0)])))
- , BlockInductive Nowhere "hidden_self_domain_inductive" Inductive
- { inductiveSymbol = finSym
- , inductiveParams = ["A"]
- , inductiveDomain = hiddenSelfDomainTerm (var "A")
- , inductiveIntros =
- IntroRule [] (emptySet `isElementOf` finTerm (var "A")) :| []
- }
- ]
-
-hiddenDefinitionDomainBlocks :: [Block]
-hiddenDefinitionDomainBlocks =
- [ BlockDefn Nowhere "ordinary_domain_alias_definition" (DefnOp ordinaryDomainAliasSym ["A"] (finTerm (var "A")))
- , BlockInductive Nowhere "ordinary_definition_hidden_domain_inductive" Inductive
- { inductiveSymbol = finSym
- , inductiveParams = ["A"]
- , inductiveDomain = ordinaryDomainAliasTerm (var "A")
- , inductiveIntros =
- IntroRule [] (emptySet `isElementOf` finTerm (var "A")) :| []
- }
- ]
-
-hiddenCarrierSideConditionBlocks :: [Block]
-hiddenCarrierSideConditionBlocks =
- [ BlockDefn Nowhere "hidden_carrier_definition" (DefnOp hiddenCarrierSym ["A"] (finTerm (var "A")))
- , BlockInductive Nowhere "ordinary_definition_hidden_side_condition_inductive" Inductive
- { inductiveSymbol = finSym
- , inductiveParams = ["A"]
- , inductiveDomain = powTerm (var "A")
- , inductiveIntros =
- IntroRule
- [ var "x" `isElementOf` hiddenCarrierTerm (var "A") ]
- (emptySet `isElementOf` finTerm (var "A"))
- :| []
- }
- ]
-
-priorDatatypeHeadSignatureBlocks :: [Block]
-priorDatatypeHeadSignatureBlocks =
- [ BlockSig Nowhere "pre_propform_signature" [] (SignatureFormula propformSignatureFormula)
- , goodDatatypeBlock
- ]
-
-priorDatatypeConstructorLemmaBlocks :: [Block]
-priorDatatypeConstructorLemmaBlocks =
- [ BlockLemma Nowhere "pre_propbot_lemma" (Lemma [] (propbotTerm `eq` propbotTerm))
- , goodDatatypeBlock
- ]
-
-datatypeConstructorThenOperatorBlocks :: [Block]
-datatypeConstructorThenOperatorBlocks =
- [ goodDatatypeBlock
- , BlockDefn Nowhere "propbot_operator_definition" (DefnOp propbotSym [] emptySet)
- ]
-
-frozenSymbolDefinitionBlocks :: [Block]
-frozenSymbolDefinitionBlocks =
- [ laterSignatureBlock
- , freezingInductiveBlock
- , BlockDefn Nowhere "later_operator_definition" (DefnOp laterSym ["A"] emptySet)
- ]
-
-freezingInductiveBlock :: Block
-freezingInductiveBlock =
- BlockInductive Nowhere "freeze_inductive" Inductive
- { inductiveSymbol = freezeCarrierSym
- , inductiveParams = ["A"]
- , inductiveDomain = powTerm (var "A")
- , inductiveIntros =
- IntroRule
- [ var "x" `eq` laterTerm (var "A") ]
- (emptySet `isElementOf` freezeCarrierTerm (var "A"))
- :| []
- }
-
-canonicalizedDomainFreezeBlocks :: [Block]
-canonicalizedDomainFreezeBlocks =
- [ laterSignatureBlock
- , BlockAbbr Nowhere "domain_alias_abbr"
- (Abbreviation
- (SymbolMixfix domainAliasSym)
- (toScope (TermSymbol Nowhere (SymbolMixfix laterSym) [TermVar (B 0)])))
- , BlockInductive Nowhere "canonicalized_domain_freeze_inductive" Inductive
- { inductiveSymbol = freezeCarrierSym
- , inductiveParams = ["A"]
- , inductiveDomain = domainAliasTerm (var "A")
- , inductiveIntros =
- IntroRule [] (emptySet `isElementOf` freezeCarrierTerm (var "A")) :| []
- }
- , BlockDefn Nowhere "later_operator_definition_after_canonicalized_domain" (DefnOp laterSym ["A"] emptySet)
- ]
-
-transitiveFrozenDefinitionBlocks :: [Block]
-transitiveFrozenDefinitionBlocks =
- [ laterSignatureBlock
- , BlockDefn Nowhere "middle_later_alias_definition" (DefnOp middleLaterAliasSym ["A"] (laterTerm (var "A")))
- , BlockDefn Nowhere "indirect_later_alias_definition" (DefnOp indirectLaterAliasSym ["A"] (middleLaterAliasTerm (var "A")))
- , BlockInductive Nowhere "transitive_freeze_inductive" Inductive
- { inductiveSymbol = freezeCarrierSym
- , inductiveParams = ["A"]
- , inductiveDomain = powTerm (var "A")
- , inductiveIntros =
- IntroRule
- [ var "x" `isElementOf` indirectLaterAliasTerm (var "A") ]
- (emptySet `isElementOf` freezeCarrierTerm (var "A"))
- :| []
- }
- , BlockDefn Nowhere "later_operator_definition_after_transitive_freeze" (DefnOp laterSym ["A"] emptySet)
- ]
-
-badRecursiveTermInductiveBlock :: Block
-badRecursiveTermInductiveBlock =
- BlockInductive Nowhere "bad_recursive_term_inductive" Inductive
- { inductiveSymbol = finSym
- , inductiveParams = ["A"]
- , inductiveDomain = powTerm (var "A")
- , inductiveIntros =
- IntroRule
- [ finTerm (var "A") `isElementOf` powTerm (var "A") ]
- (emptySet `isElementOf` finTerm (var "A"))
- :| []
- }
-
-badRecursiveFormulaInductiveBlock :: Block
-badRecursiveFormulaInductiveBlock =
- BlockInductive Nowhere "bad_recursive_formula_inductive" Inductive
- { inductiveSymbol = finSym
- , inductiveParams = ["A"]
- , inductiveDomain = powTerm (var "A")
- , inductiveIntros =
- IntroRule
- [ Not Nowhere (emptySet `isElementOf` finTerm (var "A")) ]
- (emptySet `isElementOf` finTerm (var "A"))
- :| []
- }
-
-badInductiveResultBlock :: Block
-badInductiveResultBlock =
- BlockInductive Nowhere "bad_inductive_result" Inductive
- { inductiveSymbol = finSym
- , inductiveParams = ["A"]
- , inductiveDomain = powTerm (var "A")
- , inductiveIntros =
- IntroRule [] (emptySet `isElementOf` powTerm (var "A")) :| []
- }
-
-badInductiveWrongArgsBlock :: Block
-badInductiveWrongArgsBlock =
- BlockInductive Nowhere "bad_inductive_wrong_args" Inductive
- { inductiveSymbol = finSym
- , inductiveParams = ["A"]
- , inductiveDomain = powTerm (var "A")
- , inductiveIntros =
- IntroRule
- [ var "B" `isElementOf` finTerm (var "B") ]
- (emptySet `isElementOf` finTerm (var "A"))
- :| []
- }
-
-finCasesFormula :: Formula
-finCasesFormula =
- makeForall ["A", "x"]
- ((var "x" `isElementOf` finTerm (var "A")) `Implies` makeDisjunction
- [ var "x" `eq` emptySet
- , makeExists ["a", "B"]
- (makeConjunction
- [ var "a" `isElementOf` var "A"
- , var "B" `isElementOf` finTerm (var "A")
- , var "x" `eq` consTerm (var "a") (var "B")
- ])
- ])
-
-finInductFormula :: Formula
-finInductFormula =
- makeForall ["A", "S"]
- (makeConjunction
- [ emptySet `isElementOf` var "S"
- , makeForall ["a", "B"]
- ((makeConjunction
- [ var "a" `isElementOf` var "A"
- , var "B" `isElementOf` var "S"
- ])
- `Implies`
- (consTerm (var "a") (var "B") `isElementOf` var "S"))
- ]
- `Implies`
- semanticSubsetFormula
- (Set.fromList ["A", "S"])
- (finTerm (var "A"))
- (var "S"))
-
-goodDatatypeClauses :: NonEmpty DatatypeClause
-goodDatatypeClauses =
- DatatypeClause (SymbolPattern propbotSym []) [] :|
- [ DatatypeClause (SymbolPattern propvarSym ["n"]) [("n", naturalsTerm)]
- , DatatypeClause (SymbolPattern proptoSym ["p", "q"]) [("p", propformTerm), ("q", propformTerm)]
- ]
-
-datatypeBlock :: Marker -> NonEmpty DatatypeClause -> Block
-datatypeBlock marker clauses =
- BlockData Nowhere marker (Datatype (SymbolPattern propformSym []) clauses)
-
-propformTerm :: Term
-propformTerm =
- termSymbol propformSym []
-
-propbotTerm :: Term
-propbotTerm =
- termSymbol propbotSym []
-
-naturalsTerm :: Term
-naturalsTerm =
- termSymbol naturalsSym []
-
-wrapPropformTerm :: Term
-wrapPropformTerm =
- termSymbol wrapSym [propformTerm]
-
-powTerm :: Term -> Term
-powTerm expr =
- termSymbol powSym [expr]
-
-finTerm :: Term -> Term
-finTerm expr =
- termSymbol finSym [expr]
-
-accTerm :: Term -> Term
-accTerm expr =
- termSymbol accSym [expr]
-
-wrapTerm :: Term -> Term
-wrapTerm expr =
- termSymbol wrapSym [expr]
-
-laterTerm :: Term -> Term
-laterTerm expr =
- termSymbol laterSym [expr]
-
-freezeCarrierTerm :: Term -> Term
-freezeCarrierTerm expr =
- termSymbol freezeCarrierSym [expr]
-
-domainAliasTerm :: Term -> Term
-domainAliasTerm expr =
- termSymbol domainAliasSym [expr]
-
-hiddenSelfDomainTerm :: Term -> Term
-hiddenSelfDomainTerm expr =
- termSymbol hiddenSelfDomainSym [expr]
-
-ordinaryDomainAliasTerm :: Term -> Term
-ordinaryDomainAliasTerm expr =
- termSymbol ordinaryDomainAliasSym [expr]
-
-hiddenCarrierTerm :: Term -> Term
-hiddenCarrierTerm expr =
- termSymbol hiddenCarrierSym [expr]
-
-middleLaterAliasTerm :: Term -> Term
-middleLaterAliasTerm expr =
- termSymbol middleLaterAliasSym [expr]
-
-indirectLaterAliasTerm :: Term -> Term
-indirectLaterAliasTerm expr =
- termSymbol indirectLaterAliasSym [expr]
-
-signatureDeclaredTerm :: Term -> Term
-signatureDeclaredTerm expr =
- termSymbol signatureDeclaredSym [expr]
-
-signaturePredicateFormula :: Term -> Formula
-signaturePredicateFormula expr =
- TermSymbol Nowhere (SymbolPredicate signaturePredicate) [expr]
-
-recoverableSignatureFormula :: Formula
-recoverableSignatureFormula =
- makeForall ["z"]
- ((var "z" `eq` signatureDeclaredTerm (var "A")) `Implies` (var "z" `eq` var "z"))
-
-propformSignatureFormula :: Formula
-propformSignatureFormula =
- makeForall ["z"]
- ((var "z" `eq` propformTerm) `Implies` (var "z" `eq` var "z"))
-
-wrapSignatureBlock :: Block
-wrapSignatureBlock =
- mixfixSignatureBlock "wrap_signature" wrapSym ["A"]
-
-laterSignatureBlock :: Block
-laterSignatureBlock =
- mixfixSignatureBlock "later_signature" laterSym ["A"]
-
-mixfixSignatureBlock :: Marker -> FunctionSymbol -> [VarSymbol] -> Block
-mixfixSignatureBlock marker symbol args =
- BlockSig Nowhere marker [] (SignatureFormula (recoverableMixfixSignatureFormula symbol args))
-
-recoverableMixfixSignatureFormula :: FunctionSymbol -> [VarSymbol] -> Formula
-recoverableMixfixSignatureFormula symbol args =
- makeForall ["z"]
- ((var "z" `eq` termSymbol symbol (var <$> args)) `Implies` (var "z" `eq` var "z"))
-
-consTerm :: Term -> Term -> Term
-consTerm left right =
- termSymbol consSym [left, right]
-
-termSymbol :: FunctionSymbol -> [Term] -> Term
-termSymbol sym args =
- TermSymbol Nowhere (SymbolMixfix sym) args
-
-proptoTerm :: Term -> Term -> Term
-proptoTerm left right =
- termSymbol proptoSym [left, right]
-
-propformSym :: FunctionSymbol
-propformSym =
- constSymbol "propform"
-
-propbotSym :: FunctionSymbol
-propbotSym =
- constSymbol "propbot"
-
-propvarSym :: FunctionSymbol
-propvarSym =
- unarySymbol "propvar"
-
-proptoSym :: FunctionSymbol
-proptoSym =
- infixSymbol "propto"
-
-directRecursionAliasSym :: FunctionSymbol
-directRecursionAliasSym =
- constSymbol "directrecursionalias"
-
-powersetRecursionAliasSym :: FunctionSymbol
-powersetRecursionAliasSym =
- constSymbol "powersetrecursionalias"
-
-indirectPowersetRecursionAliasSym :: FunctionSymbol
-indirectPowersetRecursionAliasSym =
- constSymbol "indirectpowersetrecursionalias"
-
-naturalsSym :: FunctionSymbol
-naturalsSym =
- constSymbol "naturals"
-
-powSym :: FunctionSymbol
-powSym =
- unarySymbol "pow"
-
-finSym :: FunctionSymbol
-finSym =
- unarySymbol "fin"
-
-accSym :: FunctionSymbol
-accSym =
- unarySymbol "acc"
-
-consSym :: FunctionSymbol
-consSym =
- ConsSymbol
-
-wrapSym :: FunctionSymbol
-wrapSym =
- unarySymbol "wrap"
-
-laterSym :: FunctionSymbol
-laterSym =
- unarySymbol "later"
-
-freezeCarrierSym :: FunctionSymbol
-freezeCarrierSym =
- unarySymbol "freezecarrier"
-
-domainAliasSym :: FunctionSymbol
-domainAliasSym =
- unarySymbol "domainalias"
-
-hiddenSelfDomainSym :: FunctionSymbol
-hiddenSelfDomainSym =
- unarySymbol "hiddenselfdomain"
-
-ordinaryDomainAliasSym :: FunctionSymbol
-ordinaryDomainAliasSym =
- unarySymbol "ordinarydomainalias"
-
-hiddenCarrierSym :: FunctionSymbol
-hiddenCarrierSym =
- unarySymbol "hiddencarrier"
-
-middleLaterAliasSym :: FunctionSymbol
-middleLaterAliasSym =
- unarySymbol "middlelateralias"
-
-indirectLaterAliasSym :: FunctionSymbol
-indirectLaterAliasSym =
- unarySymbol "indirectlateralias"
-
-signatureDeclaredSym :: FunctionSymbol
-signatureDeclaredSym =
- unarySymbol "signaturedeclared"
-
-signaturePredicate :: Predicate
-signaturePredicate =
- PredicateSymbol "signaturepredicate"
-
-constSymbol :: Text -> FunctionSymbol
-constSymbol name =
- mkMixfixItem [Just (Command name)] (Marker name) NonAssoc
-
-constSymbolWithMarker :: Text -> Marker -> FunctionSymbol
-constSymbolWithMarker name marker =
- mkMixfixItem [Just (Command name)] marker NonAssoc
-
-unarySymbol :: Text -> FunctionSymbol
-unarySymbol name =
- mkMixfixItem [Just (Command name), Just InvisibleBraceL, Nothing, Just InvisibleBraceR] (Marker name) NonAssoc
-
-infixSymbol :: Text -> FunctionSymbol
-infixSymbol name =
- mkMixfixItem [Nothing, Just (Command name), Nothing] (Marker name) NonAssoc
-
-abbrSymbolA :: Symbol
-abbrSymbolA = abbrSymbol "unit_test_abbr_a"
-
-abbrSymbolB :: Symbol
-abbrSymbolB = abbrSymbol "unit_test_abbr_b"
-
-abbrSymbol :: Text -> Symbol
-abbrSymbol name =
- SymbolMixfix (MixfixItem (TokenCons (Command name) End) (Marker name) NonAssoc)
diff --git a/source/Test/Unit/CommandLine.hs b/source/Test/Unit/CommandLine.hs
index ba31934..eeefbc3 100644
--- a/source/Test/Unit/CommandLine.hs
+++ b/source/Test/Unit/CommandLine.hs
@@ -3,10 +3,11 @@
module Test.Unit.CommandLine (unitTests) where
import Base
-import Api (VerificationReport(..), VerificationRoute(..))
+import Api (VerificationReport(..))
import CommandLine
import Felix.Source (safeRelativePath)
import Felix.Store qualified as Store
+import Provers qualified
import Render.Html.Output qualified as HtmlOutput
import Report.Location (pattern Nowhere)
@@ -67,8 +68,7 @@ unitTests =
(exitCode, stdout, stderr) <-
runCliWithSourceAndConfiguredVampire
cliGapSource
- \vampirePath ->
- writeFile vampirePath "not executable"
+ writeNonExecutableFile
exitCode `shouldBe` ExitSuccess
stdout `shouldBe` ""
stderr `shouldContain`
@@ -95,8 +95,7 @@ unitTests =
"UnsuccessfulVampireExit (ExitFailure 7)"
, testCase "prover launch failure exits as infrastructure failure" do
(exitCode, stdout, stderr) <-
- runCliWithConfiguredVampire \vampirePath ->
- writeFile vampirePath "not executable"
+ runCliWithConfiguredVampire writeNonExecutableFile
exitCode `shouldBe` ExitFailure 2
stdout `shouldBe` ""
stderr `shouldContain` "ProverLaunchFailed"
@@ -110,8 +109,13 @@ unitTests =
dumpAndHtmlVerifyOnce
, testCase "semantic failure publishes no HTML"
semanticFailurePublishesNoHtml
+ , testCase "fresh and cached presentation publish equal HTML"
+ freshAndCachedPresentationAgree
, testCase "missing renderer data is a typed failure"
missingRendererDataIsTyped
+ , testCase
+ "post-verification HTML failure retains authorization report"
+ htmlFailureRetainsAuthorizationReport
]
]
@@ -142,6 +146,17 @@ parsesClosedCommands = do
assertFailure
("unexpected default verify parse: "
<> showParserResult other)
+ case parseCommandArguments ["input.tex", "--jobs", "3"] of
+ Success
+ (Verify
+ (Input "input.tex")
+ VerificationOptions
+ { verificationJobsOverride = Just jobs
+ }) ->
+ Provers.effectiveJobsValue jobs `shouldBe` 3
+ other ->
+ assertFailure
+ ("unexpected jobs parse: " <> showParserResult other)
case parseCommandArguments ["input.tex", "--fresh"] of
Success
(Verify
@@ -159,6 +174,7 @@ rejectsConflictingOptions :: Assertion
rejectsConflictingOptions = do
for_
[ ["input.tex", "--parseonly", "--fresh"]
+ , ["input.tex", "--parseonly", "--jobs", "2"]
, ["input.tex", "--parseonly", "--dump", "dump"]
, ["input.tex", "--parseonly", "--html"]
, ["input.tex", "--store", "store.sqlite", "--fresh"]
@@ -173,6 +189,12 @@ rejectsConflictingOptions = do
<> show arguments
<> " as "
<> showParserResult other)
+ case parseCommandArguments ["input.tex", "--jobs", "0"] of
+ Failure _failure -> pure ()
+ other ->
+ assertFailure
+ ("non-positive jobs were accepted as "
+ <> showParserResult other)
showParserResult :: ParserResult Command -> String
showParserResult = \case
@@ -195,10 +217,8 @@ versionNeedsNoInputOrStore =
parseOnlyUsesNoAuthority :: Assertion
parseOnlyUsesNoAuthority =
- withCliFixture cliSource \fixture -> do
- writeFile
- (cliFixtureVampire fixture)
- "not executable"
+ withCliFixture cliPreludeSyntaxSource \fixture -> do
+ writeNonExecutableFile (cliFixtureVampire fixture)
(exitCode, stdout, stderr) <-
runCliFixture
fixture
@@ -307,6 +327,7 @@ removesFailedDumpTemporary =
dumpsExactExecutedRequest :: Assertion
dumpsExactExecutedRequest =
withCliFixture cliSource \fixture -> do
+ seedPackagedPreludeCache fixture
let captured = cliFixtureRoot fixture </> "captured.p"
writeExecutableScript
(cliFixtureVampire fixture)
@@ -316,31 +337,28 @@ dumpsExactExecutedRequest =
(exitCode, _stdout, stderr) <-
runCliFixture fixture
[ "input.tex"
- , "--fresh"
, "--dump"
, "dump"
]
exitCode `shouldBe` ExitSuccess
stderr `shouldContain` "Verification successful."
dumped <- ByteString.readFile
- (cliFixtureRoot fixture </> "dump" </> "1.p")
+ (cliFixtureRoot fixture </> "dump" </> "1-1.p")
sent <- ByteString.readFile captured
assertEqual "dump is the exact process input" sent dumped
assertBool "request is dumped only once"
. not
=<< Directory.doesPathExist
- (cliFixtureRoot fixture </> "dump" </> "2.p")
+ (cliFixtureRoot fixture </> "dump" </> "1-2.p")
launchFailureDumpsNoRequest :: Assertion
launchFailureDumpsNoRequest =
withCliFixture cliSource \fixture -> do
- writeFile
- (cliFixtureVampire fixture)
- "not executable"
+ seedPackagedPreludeCache fixture
+ writeNonExecutableFile (cliFixtureVampire fixture)
(exitCode, _stdout, stderr) <-
runCliFixture fixture
[ "input.tex"
- , "--fresh"
, "--dump"
, "dump"
]
@@ -349,11 +367,12 @@ launchFailureDumpsNoRequest =
assertBool "no request was dumped before process launch"
. not
=<< Directory.doesPathExist
- (cliFixtureRoot fixture </> "dump" </> "1.p")
+ (cliFixtureRoot fixture </> "dump" </> "1-1.p")
dumpsOnlyExecutedPrefix :: Assertion
dumpsOnlyExecutedPrefix =
withCliFixture cliTwoSource \fixture -> do
+ seedPackagedPreludeCache fixture
writeExecutableScript
(cliFixtureVampire fixture)
[ "cat >/dev/null"
@@ -362,7 +381,6 @@ dumpsOnlyExecutedPrefix =
(exitCode, _stdout, stderr) <-
runCliFixture fixture
[ "input.tex"
- , "--fresh"
, "--dump"
, "dump"
]
@@ -370,15 +388,16 @@ dumpsOnlyExecutedPrefix =
stderr `shouldContain` "prover found countermodel"
assertBool "executed request was dumped"
=<< Directory.doesFileExist
- (cliFixtureRoot fixture </> "dump" </> "1.p")
+ (cliFixtureRoot fixture </> "dump" </> "1-1.p")
assertBool "unexecuted request was not dumped"
. not
=<< Directory.doesPathExist
- (cliFixtureRoot fixture </> "dump" </> "2.p")
+ (cliFixtureRoot fixture </> "dump" </> "1-2.p")
dumpAndHtmlVerifyOnce :: Assertion
dumpAndHtmlVerifyOnce =
withCliFixture cliSource \fixture -> do
+ seedPackagedPreludeCache fixture
let countPath = cliFixtureRoot fixture </> "vampire-runs"
writeExecutableScript
(cliFixtureVampire fixture)
@@ -389,7 +408,6 @@ dumpAndHtmlVerifyOnce =
(exitCode, _stdout, stderr) <-
runCliFixture fixture
[ "input.tex"
- , "--fresh"
, "--dump"
, "dump"
, "--html"
@@ -400,7 +418,7 @@ dumpAndHtmlVerifyOnce =
assertEqual "one semantic verification" ["run"] runs
assertBool "request dump was published"
=<< Directory.doesFileExist
- (cliFixtureRoot fixture </> "dump" </> "1.p")
+ (cliFixtureRoot fixture </> "dump" </> "1-1.p")
assertBool "root HTML page was published"
=<< Directory.doesFileExist
(cliFixtureRoot fixture </> "html" </> "input.html")
@@ -414,6 +432,7 @@ dumpAndHtmlVerifyOnce =
semanticFailurePublishesNoHtml :: Assertion
semanticFailurePublishesNoHtml =
withCliFixture cliSource \fixture -> do
+ seedPackagedPreludeCache fixture
writeExecutableScript
(cliFixtureVampire fixture)
[ "cat >/dev/null"
@@ -421,17 +440,56 @@ semanticFailurePublishesNoHtml =
]
(exitCode, _stdout, stderr) <-
runCliFixture fixture
- ["input.tex", "--fresh", "--html"]
+ [ "input.tex"
+ , "--dump"
+ , "dump"
+ , "--html"
+ ]
exitCode `shouldBe` ExitFailure 1
stderr `shouldContain` "prover found countermodel"
+ assertBool "semantic failure retains the executed request dump"
+ =<< Directory.doesFileExist
+ (cliFixtureRoot fixture </> "dump" </> "1-1.p")
assertBool "semantic failure publishes no HTML"
. not
=<< Directory.doesPathExist
(cliFixtureRoot fixture </> "html")
+freshAndCachedPresentationAgree :: Assertion
+freshAndCachedPresentationAgree =
+ withCliFixture cliSource \fixture -> do
+ seedPackagedPreludeCache fixture
+ writeExecutableScript
+ (cliFixtureVampire fixture)
+ [ "cat >/dev/null"
+ , "printf '%s\\n' '% SZS status Theorem for cli'"
+ ]
+ (freshExit, _freshStdout, freshStderr) <-
+ runCliFixture fixture ["input.tex", "--html"]
+ freshExit `shouldBe` ExitSuccess
+ freshStderr `shouldContain` "Verification successful."
+ let htmlRoot = cliFixtureRoot fixture </> "html"
+ page = htmlRoot </> "input.html"
+ support =
+ htmlRoot </> "_static" </> "naproche-html.js"
+ freshPage <- ByteString.readFile page
+ freshSupport <- ByteString.readFile support
+ Directory.removePathForcibly htmlRoot
+ writeNonExecutableFile (cliFixtureVampire fixture)
+ (warmExit, _warmStdout, warmStderr) <-
+ runCliFixture fixture ["input.tex", "--html"]
+ warmExit `shouldBe` ExitSuccess
+ warmStderr `shouldContain` "Verification successful."
+ warmPage <- ByteString.readFile page
+ warmSupport <- ByteString.readFile support
+ assertEqual "fresh/cache-hit page bytes" freshPage warmPage
+ assertEqual "fresh/cache-hit support bytes"
+ freshSupport warmSupport
+
missingRendererDataIsTyped :: Assertion
missingRendererDataIsTyped =
withCliFixture cliSource \fixture -> do
+ seedPackagedPreludeCache fixture
Directory.removeFile
(cliFixtureRoot fixture </> "library" </> "lexicon.tsv")
writeExecutableScript
@@ -440,7 +498,7 @@ missingRendererDataIsTyped =
, "printf '%s\\n' '% SZS status Theorem for cli'"
]
(exitCode, stdout, stderr) <-
- runCliFixture fixture ["input.tex", "--fresh", "--html"]
+ runCliFixture fixture ["input.tex", "--html"]
exitCode `shouldBe` ExitFailure 2
stdout `shouldBe` ""
stderr `shouldContain` "HTML preparation failed:"
@@ -452,27 +510,44 @@ missingRendererDataIsTyped =
=<< Directory.doesPathExist
(cliFixtureRoot fixture </> "html")
+htmlFailureRetainsAuthorizationReport :: Assertion
+htmlFailureRetainsAuthorizationReport =
+ withCliFixture cliGapSource \fixture -> do
+ seedPackagedPreludeCache fixture
+ Directory.removeFile
+ (cliFixtureRoot fixture </> "library" </> "lexicon.tsv")
+ writeNonExecutableFile (cliFixtureVampire fixture)
+ (exitCode, stdout, stderr) <-
+ runCliFixture fixture ["input.tex", "--html"]
+ exitCode `shouldBe` ExitFailure 2
+ stdout `shouldBe` ""
+ stderr `shouldContain`
+ "Verification succeeded, but HTML preparation failed:"
+ stderr `shouldContain`
+ "Direct source authorization summary: 0 source axioms, 1 explicit proof gap."
+ stderr `shouldContain` "Explicit proof gap at input.tex 5:5"
+ assertBool "failed output publishes no HTML"
+ . not
+ =<< Directory.doesPathExist
+ (cliFixtureRoot fixture </> "html")
+
outcomeCases :: [(CommandOutcome, ExitCode)]
outcomeCases =
[ (CommandCompleted, ExitSuccess)
, (VerificationSucceeded emptyReport, ExitSuccess)
, (VerificationCompletedWithGaps emptyReport, ExitSuccess)
- , ( VerificationRejected Nowhere (CountermodelFound "")
+ , ( VerificationRejected emptyReport Nowhere (CountermodelFound "")
, ExitFailure 1
)
- , (ProverFailed Nowhere (ProverIndeterminate ""), ExitFailure 2)
+ , ( ProverFailed emptyReport Nowhere (ProverIndeterminate "")
+ , ExitFailure 2
+ )
]
emptyReport :: VerificationReport
emptyReport =
VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 0
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 0
- , verificationKernelProofCount = 0
+ { verificationDirectEscapes = []
}
runCliWithFakeVampire
@@ -495,8 +570,9 @@ runCliWithSourceAndConfiguredVampire
-> IO (ExitCode, String, String)
runCliWithSourceAndConfiguredVampire source prepareVampire =
withCliFixture source \fixture -> do
+ seedPackagedPreludeCache fixture
prepareVampire (cliFixtureVampire fixture)
- runCliFixture fixture ["input.tex", "--fresh"]
+ runCliFixture fixture ["input.tex"]
data CliFixture = CliFixture
{ cliFixtureRoot :: !FilePath
@@ -562,6 +638,27 @@ runCliFixture fixture arguments =
})
""
+-- | Populate only the packaged final-prelude root. Process-boundary tests
+-- can then exercise the requested ordinary module outcome without making
+-- their fake prover depend on the prelude's private obligation count.
+seedPackagedPreludeCache :: CliFixture -> Assertion
+seedPackagedPreludeCache fixture = do
+ let sourcePath = cliFixtureRoot fixture </> "input.tex"
+ original <- ByteString.readFile sourcePath
+ writeExecutableScript
+ (cliFixtureVampire fixture)
+ [ "cat >/dev/null"
+ , "printf '%s\\n' '% SZS status Theorem for prelude seed'"
+ ]
+ (exitCode, stdout, stderr) <-
+ (do
+ writeFile sourcePath "% cache the packaged final prelude\n"
+ runCliFixture fixture ["input.tex"])
+ `Exception.finally` ByteString.writeFile sourcePath original
+ exitCode `shouldBe` ExitSuccess
+ stdout `shouldBe` ""
+ stderr `shouldContain` "Verification successful."
+
assertNoDefaultStore :: CliFixture -> Assertion
assertNoDefaultStore fixture =
assertBool "default store was not created"
@@ -577,6 +674,14 @@ writeExecutableScript path scriptLines = do
Directory.setPermissions path
(Directory.setOwnerExecutable True permissions)
+writeNonExecutableFile :: FilePath -> IO ()
+writeNonExecutableFile path = do
+ exists <- Directory.doesPathExist path
+ if exists
+ then Directory.removeFile path
+ else pure ()
+ writeFile path "not executable"
+
requireZfExecutable :: IO FilePath
requireZfExecutable = do
executable <- Directory.findExecutable "zf"
@@ -603,6 +708,14 @@ cliSource =
, "\\end{proposition}"
]
+cliPreludeSyntaxSource :: String
+cliPreludeSyntaxSource =
+ unlines
+ [ "\\begin{proposition}\\label{parse_prelude_syntax}"
+ , " For all $x$ we have $\\preludeSuccessor{x} = \\preludeSuccessor{x}$."
+ , "\\end{proposition}"
+ ]
+
cliGapSource :: String
cliGapSource =
unlines
diff --git a/source/Test/Unit/Core.hs b/source/Test/Unit/Core.hs
index fd817c6..e1ba10d 100644
--- a/source/Test/Unit/Core.hs
+++ b/source/Test/Unit/Core.hs
@@ -15,16 +15,20 @@ import Test.Tasty.HUnit hiding (assert)
import Test.Tasty.Hedgehog (testPropertyNamed)
-data TestGlobal = TestGlobal
+data TestGlobal
+ = TestGlobal
+ | TestPairGlobal
deriving (Show, Eq, Ord)
instance NFData TestGlobal where
- rnf TestGlobal =
+ rnf _global =
()
testGlobalType :: TestGlobal -> Maybe CoreType
testGlobalType TestGlobal =
Just TySet
+testGlobalType TestPairGlobal =
+ Just (TySet `TyArrow` (TySet `TyArrow` TySet))
unitTests :: TestTree
unitTests =
@@ -51,6 +55,9 @@ unitTests =
"specializes the checked separation characteristic"
specializesCheckedSeparationCharacteristic
, testCase
+ "specializes the checked replacement characteristic"
+ specializesCheckedReplacementCharacteristic
+ , testCase
"thaws checked closed terms without changing them"
thawsCheckedClosedTerms
, testPropertyNamed
@@ -325,7 +332,11 @@ specializesCheckedSeparationCharacteristic = do
maybe
(assertFailure "separation did not form a set definition")
pure
- (scopedSetDefinition body)
+ (scopedSetDefinition
+ (Foundation.foundationAxiomFrozen
+ foundation
+ Foundation.SeparationCharacteristic)
+ body)
let generated =
instantiateCanonical
separation
@@ -343,36 +354,90 @@ specializesCheckedSeparationCharacteristic = do
"local characteristic is the checked rule specialization"
expected
generated
+
+specializesCheckedReplacementCharacteristic :: Assertion
+specializesCheckedReplacementCharacteristic = do
+ foundation <-
+ either
+ (assertFailure . show)
+ pure
+ Foundation.checkedFoundation
+ pair <- checked [] (CGlobal TestPairGlobal)
+ domain <- checked [] (CIntrinsic Empty)
+ value <- checked [TySet] (CBound 0)
+ (graph, checkedDomain, function) <-
+ maybe
+ (assertFailure "checked values did not form a replacement graph")
+ pure
+ (scopedReplacementGraph pair domain value)
+ definition <-
+ maybe
+ (assertFailure "replacement graph did not form a definition")
+ pure
+ (scopedCharacteristicDefinition
+ (Foundation.foundationAxiomFrozen
+ foundation
+ Foundation.ReplacementCharacteristic)
+ graph
+ (checkedDomain :| [function]))
+ let generated =
+ instantiateCanonical
+ (scopedCoreTerm graph)
+ (scopedCoreTerm definition)
+ expected =
+ betaNormalize
+ (specializeForall (scopedCoreTerm function)
+ (specializeForall (scopedCoreTerm checkedDomain)
+ (mapCanonicalGlobals absurd
+ (frozenCoreTerm
+ (Foundation.foundationAxiomFrozen
+ foundation
+ Foundation.ReplacementCharacteristic)))))
+ assertEqual
+ "local graph characteristic is the checked rule specialization"
+ expected
+ generated
where
- specializeForall argument = \case
- CForall _binderType body ->
- instantiateCanonical argument body
- _ ->
- error "the checked separation characteristic lost a binder"
+ checked context term =
+ either
+ (assertFailure . show)
+ pure
+ (checkScopedCanonicalCore testGlobalType context term)
+
+specializeForall
+ :: CanonicalTerm global
+ -> CanonicalTerm global
+ -> CanonicalTerm global
+specializeForall argument = \case
+ CForall _binderType body ->
+ instantiateCanonical argument body
+ _ ->
+ error "the checked characteristic lost a binder"
- betaNormalize = \case
- CApp function argument ->
- case betaNormalize function of
- CLam _binderType body ->
- betaNormalize
- (instantiateCanonical
- (betaNormalize argument)
- body)
- normalizedFunction ->
- CApp normalizedFunction (betaNormalize argument)
- CLam binderType body ->
- CLam binderType (betaNormalize body)
- CImp premise conclusion ->
- CImp
- (betaNormalize premise)
- (betaNormalize conclusion)
- CEq operandType left right ->
- CEq operandType
- (betaNormalize left)
- (betaNormalize right)
- CForall binderType body ->
- CForall binderType (betaNormalize body)
- term -> term
+betaNormalize :: CanonicalTerm global -> CanonicalTerm global
+betaNormalize = \case
+ CApp function argument ->
+ case betaNormalize function of
+ CLam _binderType body ->
+ betaNormalize
+ (instantiateCanonical
+ (betaNormalize argument)
+ body)
+ normalizedFunction ->
+ CApp normalizedFunction (betaNormalize argument)
+ CLam binderType body ->
+ CLam binderType (betaNormalize body)
+ CImp premise conclusion ->
+ CImp
+ (betaNormalize premise)
+ (betaNormalize conclusion)
+ CEq operandType left right ->
+ CEq operandType
+ (betaNormalize left)
+ (betaNormalize right)
+ CForall binderType body ->
+ CForall binderType (betaNormalize body)
+ term -> term
thawsCheckedClosedTerms :: Assertion
thawsCheckedClosedTerms = do
diff --git a/source/Test/Unit/Declaration.hs b/source/Test/Unit/Declaration.hs
index c03c21c..78ad27e 100644
--- a/source/Test/Unit/Declaration.hs
+++ b/source/Test/Unit/Declaration.hs
@@ -50,6 +50,8 @@ unitTests =
propagatesUnsafeAuthorityThroughLocalClaims
, testCase "aggregates exact Vampire obligations"
aggregatesExactVampireObligations
+ , testCase "validates complete resolver batches before rejection"
+ validatesCompleteResolverBatchesBeforeRejection
, testCase "preserves source-axiom safety through Vampire validation"
preservesSourceAxiomSafetyThroughVampireValidation
, testCase "materializes a sealed import with fresh authority"
@@ -759,6 +761,112 @@ aggregatesExactVampireObligations =
("unexpected omitted validation count: "
<> show (length records))
+validatesCompleteResolverBatchesBeforeRejection :: Assertion
+validatesCompleteResolverBatchesBeforeRejection =
+ withTemporaryDirectory "felix-declaration-batch-integrity" \root -> do
+ fixture <- makeFixture
+ let executable = root Posix.</> "vampire"
+ firstLocation = mkLocation (FileId 76) 1 1
+ secondLocation = mkLocation (FileId 76) 2 1
+ writeAcceptedVampire executable
+ mismatchedTask <-
+ makePreparedObligation
+ fixture
+ Foundation.EmptyCharacteristic
+ let integrityResolver =
+ Declaration.vampireBatchResolver \_tasks -> do
+ mismatched <- resolveAccepted executable mismatchedTask
+ pure
+ ( Right (Provers.CounterSatisfiable "earlier")
+ :| [mismatched]
+ )
+ integrityOutcome <-
+ (runDriverWithResolver fixture integrityResolver do
+ Declaration.commitProofDeclaration
+ (Semantic.proofSyntaxId "batch-integrity-priority") do
+ candidates <- Declaration.reserveCandidateBatch
+ ( factSpec fixture "batch-integrity-first"
+ :| [factSpec fixture "batch-integrity-second"]
+ )
+ Declaration.authorizeVampireCandidateBatch
+ ( ( firstLocation
+ , NonEmpty.head candidates
+ , Declaration.prepareCurrentCandidateVampire
+ )
+ :| [ ( secondLocation
+ , NonEmpty.last candidates
+ , Declaration.prepareCurrentCandidateVampire
+ )
+ ]
+ )
+ :: IO
+ (Declaration.DriverResult Text
+ ((), Declaration.CommittedDeclarationBatch)))
+ case integrityOutcome of
+ Declaration.DriverFailed
+ (Declaration.DriverDeclarationFailed
+ (Declaration.ProofObligationFailedAt
+ location
+ Declaration.VampireRequestMismatch))
+ prefix -> do
+ assertEqual
+ "later request mismatch retains its location"
+ secondLocation
+ location
+ assertEqual
+ "integrity failure rolls back the complete declaration"
+ 0
+ (length
+ (Declaration.pendingModulePrefixBatches prefix))
+ Declaration.DriverFailed failure _prefix ->
+ assertFailure
+ ("unexpected batch-integrity failure: " <> show failure)
+ Declaration.DriverSucceeded{} ->
+ assertFailure
+ "earlier ordinary rejection concealed no integrity failure"
+ Declaration.DriverSealFailed{} ->
+ assertFailure "invalid batch reached module sealing"
+
+ prepared <-
+ makePreparedObligation
+ fixture
+ Foundation.EmptyCharacteristic
+ let excessResolver =
+ Declaration.vampireBatchResolver \_tasks ->
+ pure
+ ( Right (Provers.CounterSatisfiable "first")
+ :| [Right (Provers.CounterSatisfiable "excess")]
+ )
+ excessOutcome <-
+ (runDriverWithResolver fixture excessResolver do
+ Declaration.commitProofDeclaration
+ (Semantic.proofSyntaxId "singleton-excess-result") do
+ candidate <- Declaration.reserveCandidate
+ (factSpec fixture "singleton-excess-result")
+ Declaration.authorizeVampireCandidate candidate
+ (Declaration.acceptVampireObligation prepared)
+ :: IO
+ (Declaration.DriverResult Text
+ ((), Declaration.CommittedDeclarationBatch)))
+ case excessOutcome of
+ Declaration.DriverFailed
+ (Declaration.DriverDeclarationFailed
+ (Declaration.VampireResolverBatchSizeMismatch 1 2))
+ prefix ->
+ assertEqual
+ "malformed singleton response publishes no declaration"
+ 0
+ (length
+ (Declaration.pendingModulePrefixBatches prefix))
+ Declaration.DriverFailed failure _prefix ->
+ assertFailure
+ ("unexpected singleton-cardinality failure: "
+ <> show failure)
+ Declaration.DriverSucceeded{} ->
+ assertFailure "singleton resolver ignored an excess result"
+ Declaration.DriverSealFailed{} ->
+ assertFailure "malformed singleton reached module sealing"
+
preservesSourceAxiomSafetyThroughVampireValidation :: Assertion
preservesSourceAxiomSafetyThroughVampireValidation =
withTemporaryDirectory "felix-declaration-source-axiom" \root -> do
diff --git a/source/Test/Unit/Encoding.hs b/source/Test/Unit/Encoding.hs
deleted file mode 100644
index cba359f..0000000
--- a/source/Test/Unit/Encoding.hs
+++ /dev/null
@@ -1,363 +0,0 @@
-{-# LANGUAGE OverloadedStrings #-}
-
-module Test.Unit.Encoding (unitTests, propertyTests) where
-
-import Base
-import Checking.Backend.Problem qualified as Backend
-import Checking.Core qualified as Core
-import Encoding
-import Provers
-import Report.Location
-import Syntax.Internal
-import Tptp.UnsortedFirstOrder qualified as Tptp
-
-import Control.Monad.Logger (runNoLoggingT)
-import Data.Map.Strict qualified as Map
-import Data.Set qualified as Set
-import Data.Text qualified as Text
-import Data.Vector qualified as Vector
-import Hedgehog hiding (Command)
-import Hedgehog.Gen qualified as Gen
-import Hedgehog.Range qualified as Range
-import Test.Tasty
-import Test.Tasty.HUnit hiding (assert)
-import Test.Tasty.Hedgehog (testPropertyNamed)
-import UnliftIO.Environment (lookupEnv)
-
-unitTests :: TestTree
-unitTests =
- testGroup "Encoding"
- [ propertyTests
- , testCase
- "real Vampire distinguishes Unicode free constants from symbols"
- realVampireDistinguishesNames
- , testCase
- "real Vampire proves a typed higher-order problem"
- realVampireProvesTypedHigherOrderProblem
- ]
-
-propertyTests :: TestTree
-propertyTests =
- testGroup "properties"
- [ testPropertyNamed
- "allocates legal dense names deterministically"
- "prop_taskLocalNames"
- prop_taskLocalNames
- ]
-
-prop_taskLocalNames :: Property
-prop_taskLocalNames = property do
- generatedSpellings <-
- forAll
- (Gen.list
- (Range.linear 0 20)
- sourceSpelling)
- let spellings =
- zipWith
- (\ordinal spelling ->
- spelling <> "#" <> Text.pack (show ordinal))
- [0 :: Int ..]
- (adversarialSpellings <> generatedSpellings)
- originalBinders =
- zipWith
- (\ordinal spelling ->
- NamedVar
- ( spelling
- <> "_bound_"
- <> Text.pack (show ordinal)
- ))
- [0 :: Int ..]
- spellings
- renamedBinders =
- [ NamedVar ("renamed_" <> Text.pack (show ordinal))
- | ordinal <- [0 .. length spellings - 1]
- ]
- baseHypotheses =
- zipWith makeHypothesis spellings originalBinders
- firstHypothesis =
- listToMaybe baseHypotheses
- ?? impossible "allocator property has no seeded hypothesis"
- duplicateHypotheses =
- baseHypotheses <> [firstHypothesis]
- alphaHypotheses =
- let renamed =
- zipWith makeHypothesis spellings renamedBinders
- firstRenamed =
- listToMaybe renamed
- ?? impossible
- "allocator property has no renamed hypothesis"
- in renamed <> [firstRenamed]
- shuffledHypotheses <- forAll (Gen.shuffle duplicateHypotheses)
- let prepared =
- prepareTptpTask (namingTask duplicateHypotheses)
- shuffled =
- prepareTptpTask (namingTask shuffledHypotheses)
- alphaRenamed =
- prepareTptpTask (namingTask alphaHypotheses)
- nameOrigins = preparedTptpNameOrigins prepared
- targetNames = Map.keysSet nameOrigins
- renderedIdentifiers =
- tptpIdentifiers (preparedTptpText prepared)
- semanticCount = length spellings
- hypothesisCount = length duplicateHypotheses
- binderCount = 2 * hypothesisCount
-
- preparedTptpText shuffled === preparedTptpText prepared
- preparedTptpText alphaRenamed === preparedTptpText prepared
- preparedTptpNameOrigins shuffled === nameOrigins
- preparedTptpNameOrigins alphaRenamed === nameOrigins
-
- categoryNames "zf_u" targetNames
- === ordinalNames "zf_u" semanticCount
- categoryNames "zf_f" targetNames
- === ordinalNames "zf_f" semanticCount
- categoryNames "zf_s" targetNames
- === ordinalNames "zf_s" semanticCount
- categoryNames "zf_h" targetNames
- === ordinalNames "zf_h" hypothesisCount
- categoryNames "zf_q" targetNames
- === Set.singleton "zf_q0"
- categoryNames "V" targetNames
- === ordinalNames "V" binderCount
- assert (targetNames `Set.isSubsetOf` renderedIdentifiers)
-
- Set.size targetNames
- === 3 * semanticCount + hypothesisCount + binderCount + 1
- for_ targetNames \target ->
- if "V" `Text.isPrefixOf` target
- then assert (Tptp.isProperVariable target)
- else assert (Tptp.isProperAtomicWord target)
-
-sourceSpelling :: Gen Text
-sourceSpelling =
- Gen.text
- (Range.linear 0 16)
- (Gen.element
- ( ['a'..'z']
- <> ['A'..'Z']
- <> ['0'..'9']
- <> "_'-.:/\\"
- <> ['λ', 'Ω', '\x0301', '💥']
- ))
-
-adversarialSpellings :: [Text]
-adversarialSpellings =
- [ ""
- , "λ"
- , "e\x0301"
- , "name'"
- , "under_score"
- , "zf_u0"
- , "zf_f0"
- , "zf_s0"
- , "V0"
- , "Case"
- , "case"
- , "a-b"
- , "💥"
- ]
-
-makeHypothesis :: Text -> VarSymbol -> Hypothesis
-makeHypothesis spelling binder =
- let freeConstant = TermVar (NamedVar spelling)
- structureTerm =
- TermSymbolStruct
- (StructSymbol spelling)
- (Just freeConstant)
- body =
- Atomic
- Nowhere
- (PredicateSymbol spelling)
- [ freeConstant
- , structureTerm
- , TermVar binder
- ]
- shadowedBody =
- makeExists
- [binder]
- (Atomic
- Nowhere
- (PredicateSymbol spelling)
- [TermVar binder])
- nativeRelations =
- Equals Nowhere freeConstant freeConstant
- `And` NotEquals Nowhere freeConstant structureTerm
- in
- Hypothesis
- (Marker ("label_" <> spelling))
- (makeForall
- [binder]
- (body `And` shadowedBody `And` nativeRelations))
-
-namingTask :: [Hypothesis] -> Task
-namingTask hypotheses =
- Task
- { taskDirectness = Direct
- , taskHypotheses = hypotheses
- , taskConjectureLabel = "ignored_conjecture_label"
- , taskLocation = Nowhere
- , taskConjecture = Top
- }
-
-categoryNames :: Text -> Set Text -> Set Text
-categoryNames prefix =
- Set.filter (prefix `Text.isPrefixOf`)
-
-ordinalNames :: Text -> Int -> Set Text
-ordinalNames prefix size =
- Set.fromList
- [ prefix <> Text.pack (show ordinal)
- | ordinal <- [0 .. size - 1]
- ]
-
-tptpIdentifiers :: Text -> Set Text
-tptpIdentifiers =
- Set.delete ""
- . Set.fromList
- . Text.split (not . Tptp.isAsciiAlphaNumOrUnderscore)
-
-realVampireDistinguishesNames :: Assertion
-realVampireDistinguishesNames = do
- executable <- fromMaybe "vampire" <$> lookupEnv "NAPROCHE_ZF_VAMPIRE"
- let collisionSymbol =
- mkMixfixItem
- [Just (Command "collision")]
- "fx"
- NonAssoc
- freeConstant = TermVar (NamedVar "x")
- userConstant =
- TermSymbol
- Nowhere
- (SymbolMixfix collisionSymbol)
- []
- unicodeVariable = NamedVar "λ"
- unicodeReflexivity =
- makeForall
- [unicodeVariable]
- (Equals
- Nowhere
- (TermVar unicodeVariable)
- (TermVar unicodeVariable))
- task =
- Task
- { taskDirectness = Direct
- , taskHypotheses = []
- , taskConjectureLabel = "unicode_collision"
- , taskLocation = Nowhere
- , taskConjecture =
- Equals Nowhere freeConstant userConstant
- `And` unicodeReflexivity
- }
- (_location, _formula, answer) <-
- runNoLoggingT
- (runProver
- (vampire
- executable
- defaultTimeLimit
- defaultMemoryLimit)
- task)
- case answer of
- Right CounterSatisfiable{} ->
- pure ()
- result ->
- assertFailure
- ("expected a countermodel, got " <> show result)
-
-data Th0Global
- = Th0Predicate
- | Th0PredicateConsumer
- deriving (Show, Eq, Ord)
-
-th0GlobalType :: Th0Global -> Maybe Core.CoreType
-th0GlobalType = \case
- Th0Predicate ->
- Just
- (Core.TySet
- `Core.TyArrow` Core.TyProp)
- Th0PredicateConsumer ->
- Just
- ((Core.TySet
- `Core.TyArrow` Core.TyProp)
- `Core.TyArrow` Core.TyProp)
-
-realVampireProvesTypedHigherOrderProblem :: Assertion
-realVampireProvesTypedHigherOrderProblem = do
- executable <-
- fromMaybe "vampire"
- <$> lookupEnv "NAPROCHE_ZF_VAMPIRE"
- let claimTerm =
- Core.CApp
- (Core.CGlobal Th0PredicateConsumer)
- (Core.CLam Core.TySet
- (Core.CApp
- (Core.CGlobal Th0Predicate)
- (Core.CBound 0)))
- checked <-
- either
- (assertFailure . show)
- pure
- (Core.checkScopedCanonicalCore
- th0GlobalType
- []
- claimTerm)
- claim <-
- either
- (assertFailure . show)
- pure
- (Backend.supportedProposition
- (Vector.empty
- :: Vector.Vector
- (Void, Core.CoreType))
- checked)
- capability <-
- either
- (assertFailure . show)
- pure
- (Backend.classifySupportedProposition
- th0GlobalType
- claim)
- problem <-
- either
- (assertFailure . show)
- pure
- (Backend.planTypedProblem
- th0GlobalType
- (Vector.singleton
- (Backend.typedBackendFact
- (0 :: Int)
- claim
- capability))
- claim
- []
- []
- Backend.ExplicitGlobalPremises
- Backend.FirstOrderLocals)
- prepared <-
- either
- (assertFailure . show)
- pure
- (prepareTypedProverTask
- DirectTask
- problem)
- assertEqual
- "higher-order request dialect"
- VerificationTh0
- (preparedVerificationDialect
- (preparedTypedProverRequest
- prepared))
- answer <-
- runNoLoggingT
- (runPreparedTypedProver
- (vampire
- executable
- defaultTimeLimit
- defaultMemoryLimit)
- prepared)
- case answer of
- Right result
- | isJust (provedVampireRun result) ->
- pure ()
- result ->
- assertFailure
- ("expected a higher-order theorem, got "
- <> show result)
diff --git a/source/Test/Unit/Html.hs b/source/Test/Unit/Html.hs
index 7dd2837..14ecdc3 100644
--- a/source/Test/Unit/Html.hs
+++ b/source/Test/Unit/Html.hs
@@ -4,6 +4,7 @@ module Test.Unit.Html (unitTests) where
import Base
import Api qualified
+import Felix.Parse qualified as Parse
import Felix.Source
import Felix.Source.Graph
import Render.Html qualified as Html
@@ -13,20 +14,55 @@ import Report.Location (Location, pattern Nowhere)
import Syntax.Abstract
import Data.Text qualified as Text
+import Data.Text.IO qualified as TextIO
+import Data.List.NonEmpty qualified as NonEmpty
import System.Directory qualified as Directory
import Test.Tasty
import Test.Tasty.HUnit
unitTests :: TestTree
unitTests = testGroup "HTML renderer"
- [ testCase "reference previews are rendered for local and imported refs" referencePreviews
+ [ testCase "one shared index resolves local and cross-page previews" referencePreviews
, testCase "missing reference preview data falls back to readable text" missingReferenceFallback
, testCase "datatype rendering omits unchecked derived facts" datatypeDerivedFactsAreOmitted
]
referencePreviews :: Assertion
referencePreviews = do
- html <- Api.exportHtml "test/html-fixtures/root-preview.tex"
+ graph <-
+ expectRight =<<
+ Api.prepareDefaultSourceGraph
+ "test/html-fixtures/root-preview.tex"
+ workspace <-
+ expectRight =<< Parse.parseResolvedSourceGraph graph
+ hints <- TextIO.readFile "library/lexicon.tsv"
+ layout <-
+ expectRight
+ (layoutHtmlSourceGraph
+ Api.defaultHtmlMountPrefixes
+ graph)
+ let nodes = Parse.parsedWorkspaceImportedBeforeImporter workspace
+ sourceBlocks =
+ (\node ->
+ ( Parse.parsedModuleResolved node
+ , Parse.parsedModuleBlocks node
+ ))
+ <$> nodes
+ (renderIndex, pages) =
+ Html.buildRenderIndex sourceBlocks
+ rootPage = NonEmpty.last pages
+ context <-
+ expectRight
+ (htmlRenderContext
+ layout
+ (Html.htmlPagePresentationSource rootPage))
+ html <-
+ expectRight
+ (Html.renderDocument
+ context
+ hints
+ renderIndex
+ rootPage)
let supportScript = Html.supportScriptAssetContents
assertContains "local references keep page anchors" "href=\"#local_prop\"" html
assertContains "local references point previews at the visible target block" "data-reference-label=\"local_prop\" data-preview-target-id=\"local_prop\"" html
@@ -111,12 +147,15 @@ renderSynthetic blocks = do
(htmlRenderContext
layout
(sourceGraphRootSource graph))
+ let (renderIndex, page :| _remainingPages) =
+ Html.buildRenderIndex
+ ((sourceGraphRootSource graph, blocks) :| [])
expectRight
(Html.renderDocument
context
""
- blocks
- [(sourceGraphRootSource graph, blocks)])
+ renderIndex
+ page)
expectRight :: (Show e, HasCallStack) => Either e a -> IO a
expectRight = \case
diff --git a/source/Test/Unit/HtmlOutput.hs b/source/Test/Unit/HtmlOutput.hs
index 1993fc9..0087f82 100644
--- a/source/Test/Unit/HtmlOutput.hs
+++ b/source/Test/Unit/HtmlOutput.hs
@@ -4,7 +4,9 @@
module Test.Unit.HtmlOutput (unitTests) where
import Base
+import Felix.Parse qualified as Parse
import Felix.Source
+import Felix.Source.Graph qualified as SourceGraph
import Render.Html qualified as Html
import Render.Html.Export
import Render.Html.Output
@@ -43,7 +45,7 @@ unitTests =
"rejects a FIFO before publication"
rejectsFifo
, testCase
- "reports and cleans an incomplete publication"
+ "reports and cleans the source-order publication prefix"
reportsIncompletePublication
]
@@ -94,36 +96,29 @@ publishesMountedExport =
expectRight =<< existingRoot rootSource
searchedExport <-
expectRight =<<
- prepareHtmlExport
+ prepareTestHtmlExport
configuration
mounts
searched
hints
exactExport <-
expectRight =<<
- prepareHtmlExport
+ prepareTestHtmlExport
configuration
mounts
exact
hints
assertEqual
"root-form-independent destinations"
- (preparedHtmlBundleDestinations
- (preparedHtmlOutputBundle searchedExport))
- (preparedHtmlBundleDestinations
- (preparedHtmlOutputBundle exactExport))
- assertEqual
- "root-form-independent root document"
- (preparedHtmlRootDocument searchedExport)
- (preparedHtmlRootDocument exactExport)
+ (preparedHtmlArtifactDestination <$> searchedExport)
+ (preparedHtmlArtifactDestination <$> exactExport)
- let bundle =
- preparedHtmlOutputBundle searchedExport
- rejectsBundleEscape temp bundle
+ let artifacts = searchedExport
+ rejectsArtifactEscape temp artifacts
plan <-
requirePlan =<<
- planHtmlOutput outputRoot bundle
+ planHtmlOutput outputRoot artifacts
outputExistsBeforePublication <-
Directory.doesPathExist outputRoot
assertBool
@@ -168,11 +163,11 @@ publishesMountedExport =
Html.supportScriptAssetContents
supportText
-rejectsBundleEscape
+rejectsArtifactEscape
:: FilePath
- -> PreparedHtmlBundle
+ -> [PreparedHtmlArtifact]
-> Assertion
-rejectsBundleEscape temp bundle = do
+rejectsArtifactEscape temp artifacts = do
let outputRoot = temp </> "escape-html"
outsideRoot = temp </> "outside"
outsideMarker = outsideRoot </> "unchanged"
@@ -182,7 +177,7 @@ rejectsBundleEscape temp bundle = do
Directory.createDirectoryLink
outsideRoot
(outputRoot </> "docs")
- result <- planHtmlOutput outputRoot bundle
+ result <- planHtmlOutput outputRoot artifacts
case result of
Left
(HtmlOutputParentEscapesRoot
@@ -223,8 +218,8 @@ writesPreparedBytes =
, 0x63, 0x61, 0x66
, 0xc3, 0xa9
]
- bundle <-
- makeBundle
+ artifacts <-
+ makeArtifacts
[ ( "nested/über.html"
, TextEncoding.encodeUtf8 pageText
)
@@ -232,7 +227,7 @@ writesPreparedBytes =
, TextEncoding.encodeUtf8 supportText
)
]
- publishBundle outputRoot bundle
+ publishArtifacts outputRoot artifacts
pageBytes <-
ByteString.readFile
(outputRoot </> "nested" </> "über.html")
@@ -259,7 +254,7 @@ attachesBytesToReservedRoutes =
["page.html", "_static/naproche-html.js"])
routes <- requireRoutePlan =<<
planHtmlRoutes outputRoot reserved
- matching <- makeBundle
+ matching <- makeArtifacts
[ ("page.html", "page")
, ("_static/naproche-html.js", "support")
]
@@ -268,7 +263,7 @@ attachesBytesToReservedRoutes =
pure ()
Left failure ->
assertFailure (show failure)
- mismatched <- makeBundle
+ mismatched <- makeArtifacts
[ ("other.html", "other")
, ("_static/naproche-html.js", "support")
]
@@ -295,12 +290,12 @@ rejectsFinalSymlink =
ByteString.writeFile page "old page"
ByteString.writeFile outsideAsset "outside asset"
Directory.createFileLink outsideAsset support
- bundle <-
- makeBundle
+ artifacts <-
+ makeArtifacts
[ ("page.html", "new page")
, ("_static/naproche-html.js", "new support")
]
- result <- planHtmlOutput outputRoot bundle
+ result <- planHtmlOutput outputRoot artifacts
case result of
Left (HtmlOutputTargetIsSymbolicLink target) ->
assertEqual "rejected target" support target
@@ -331,9 +326,9 @@ replacesHardLinkedTarget =
Directory.createDirectory outputRoot
ByteString.writeFile outsidePage "outside page"
PosixFiles.createLink outsidePage page
- bundle <-
- makeBundle [("page.html", "new page")]
- publishBundle outputRoot bundle
+ artifacts <-
+ makeArtifacts [("page.html", "new page")]
+ publishArtifacts outputRoot artifacts
outsideBytes <- ByteString.readFile outsidePage
pageBytes <- ByteString.readFile page
assertEqual
@@ -349,9 +344,9 @@ rejectsFifo =
page = outputRoot </> "page.html"
Directory.createDirectory outputRoot
PosixFiles.createNamedPipe page PosixFiles.ownerModes
- bundle <-
- makeBundle [("page.html", "page")]
- result <- planHtmlOutput outputRoot bundle
+ artifacts <-
+ makeArtifacts [("page.html", "page")]
+ result <- planHtmlOutput outputRoot artifacts
case result of
Left (HtmlOutputTargetNotRegularFile target) ->
assertEqual "rejected target" page target
@@ -369,18 +364,18 @@ reportsIncompletePublication :: Assertion
reportsIncompletePublication =
withTemporaryDirectory "felix-html-output-incomplete" \temp -> do
let outputRoot = temp </> "html"
- first = outputRoot </> "a.html"
+ first = outputRoot </> "z.html"
blocked = outputRoot </> "b.html"
- unpublished = outputRoot </> "c.html"
- bundle <-
- makeBundle
- [ ("a.html", "first")
+ unpublished = outputRoot </> "a.html"
+ artifacts <-
+ makeArtifacts
+ [ ("z.html", "first")
, ("b.html", "blocked")
- , ("c.html", "unpublished")
+ , ("a.html", "unpublished")
]
plan <-
requirePlan =<<
- planHtmlOutput outputRoot bundle
+ planHtmlOutput outputRoot artifacts
Directory.createDirectory outputRoot
Directory.createDirectory blocked
result <- writeHtmlOutput plan
@@ -392,7 +387,7 @@ reportsIncompletePublication =
} -> do
expectedFirst <-
expectRight
- (safeRelativePath "a.html")
+ (safeRelativePath "z.html")
expectedBlocked <-
expectRight
(safeRelativePath "b.html")
@@ -429,23 +424,22 @@ reportsIncompletePublication =
outputEntries))
-publishBundle
+publishArtifacts
:: FilePath
- -> PreparedHtmlBundle
+ -> [PreparedHtmlArtifact]
-> IO ()
-publishBundle outputRoot bundle = do
+publishArtifacts outputRoot artifacts = do
plan <-
- requirePlan =<< planHtmlOutput outputRoot bundle
+ requirePlan =<< planHtmlOutput outputRoot artifacts
requirePublication =<< writeHtmlOutput plan
-makeBundle
+makeArtifacts
:: [(FilePath, ByteString.ByteString)]
- -> IO PreparedHtmlBundle
-makeBundle artifacts = do
- prepared <- for artifacts \(path, bytes) -> do
+ -> IO [PreparedHtmlArtifact]
+makeArtifacts artifacts =
+ for artifacts \(path, bytes) -> do
relative <- expectRight (safeRelativePath path)
- pure (relative, bytes)
- expectRight (preparedHtmlBundle prepared)
+ pure (preparedHtmlArtifact relative (Right bytes))
requirePlan
:: Either HtmlOutputError HtmlOutputPlan
@@ -484,6 +478,24 @@ readUtf8 path = do
Right text ->
pure text
+prepareTestHtmlExport
+ :: [(SourceMountId, [Text])]
+ -> SourceMounts
+ -> RootRequest
+ -> Text
+ -> IO (Either HtmlExportError [PreparedHtmlArtifact])
+prepareTestHtmlExport configuration mounts request hints = do
+ graph <-
+ expectRight =<<
+ SourceGraph.buildResolvedSourceGraph mounts request
+ workspace <-
+ expectRight =<< Parse.parseResolvedSourceGraph graph
+ pure
+ (prepareHtmlExport
+ configuration
+ (htmlPresentationFromParsedWorkspace workspace)
+ hints)
+
writeImportedTheory :: FilePath -> IO ()
writeImportedTheory path =
writeFile path
diff --git a/source/Test/Unit/Kernel.hs b/source/Test/Unit/Kernel.hs
index 27f92b2..c24debf 100644
--- a/source/Test/Unit/Kernel.hs
+++ b/source/Test/Unit/Kernel.hs
@@ -9,7 +9,6 @@ import Checking.Foundation qualified as Foundation
import Checking.Kernel.Derivation
import Checking.Kernel.Semantics qualified as Semantics
import Checking.Kernel.SetLfp qualified as SetLfp
-import Checking.Transition (checkedGlobalType)
import Checking.Typed.Inductive qualified as Inductive
import Report.Location (pattern Nowhere)
import Syntax.Internal qualified as Internal
@@ -23,6 +22,9 @@ import Test.Tasty.HUnit
data TestGlobal = TestGlobal
deriving (Show, Eq, Ord)
+testGlobalType :: TestGlobal -> CoreType
+testGlobalType _global = TySet
+
unitTests :: TestTree
unitTests =
testGroup "Kernel replay"
@@ -438,7 +440,7 @@ replaysDirectInductiveFacts = do
prepared <-
expectRight
(Inductive.prepareTypedInductive
- checkedGlobalType
+ testGlobalType
foundation
(const Nothing)
(Internal.Marker "direct_inductive")
@@ -455,7 +457,7 @@ replaysDirectInductiveFacts = do
(replayKernelDerivation
foundation
defaultKernelReplayLimits
- (Just . checkedGlobalType)
+ (const Nothing)
imports
(Inductive.typedInductiveFactTarget
fact)
diff --git a/source/Test/Unit/Migration.hs b/source/Test/Unit/Migration.hs
deleted file mode 100644
index d9042cc..0000000
--- a/source/Test/Unit/Migration.hs
+++ /dev/null
@@ -1,161 +0,0 @@
-{-# LANGUAGE NoImplicitPrelude #-}
-
-module Test.Unit.Migration (unitTests) where
-
-import Base
-import Felix.Migration
-import Felix.Parse qualified as Parse
-import Felix.Prelude qualified as Prelude
-import Felix.Source
-import Syntax.Interface qualified as Syntax
-
-import System.Directory (getCurrentDirectory)
-import System.FilePath.Posix qualified as Posix
-import Test.Tasty
-import Test.Tasty.HUnit
-
-
-unitTests :: TestTree
-unitTests =
- testGroup "Migration manifest"
- [ testCase "resolves references from prepared mount roots"
- resolvesManifestReferences
- , testCase "selects one driver for the complete graph"
- selectsCompleteGraphDriver
- ]
-
-resolvesManifestReferences :: Assertion
-resolvesManifestReferences = do
- mounts <-
- expectRight
- =<< prepareSourceMounts
- [ (sourceMountId "project", "/tmp/felix-project")
- , (sourceMountId "library", "/tmp/felix-library")
- , (sourceMountId "debug", "/tmp/felix-debug")
- ]
- forM_
- (toList activeMigrationRoots
- <> toList protectedMigrationModules
- <> toList phase53LibraryMigrationModules)
- \reference -> do
- assertEqual
- "manifest role"
- MigrationLibrary
- (migrationModuleRefRole reference)
- candidate <-
- expectRight
- (migrationModuleCandidatePath mounts reference)
- assertEqual
- "mount-relative candidate"
- ("/tmp/felix-library"
- Posix.</> safeRelativePathFilePath
- (migrationModuleRefPath reference))
- candidate
- forM_ (toList typedMigrationModules) \reference ->
- assertEqual
- "typed module mount role"
- (if reference `elem`
- (toList protectedMigrationModules
- <> toList phase53LibraryMigrationModules)
- then MigrationLibrary
- else MigrationProject)
- (migrationModuleRefRole reference)
-
-selectsCompleteGraphDriver :: Assertion
-selectsCompleteGraphDriver = do
- root <- getCurrentDirectory
- mounts <-
- expectRight
- =<< prepareSourceMounts
- [ (sourceMountId "project", root)
- , (sourceMountId "library", root Posix.</> "library")
- , (sourceMountId "debug", root Posix.</> "debug")
- ]
- selection <-
- expectRight
- (resolveMigrationSelection mounts typedMigrationModules)
- reserved <-
- expectRight
- =<< Prelude.parseReservedPreludeSource
- Prelude.emptyBootstrapSourceInput
- let bootstrapSyntax =
- Parse.identifiedParsedModuleSyntaxInterface
- (Prelude.reservedParsedPreludeModule reserved)
- syntaxInputs source
- | migrationSelectionContains selection source =
- [bootstrapSyntax]
- | otherwise = []
- parseRoot path = do
- request <- expectRight (searchedRoot path)
- Parse.parseSourceWorkspaceMeasuredWithSyntaxInputs
- mounts request syntaxInputs
- (producer, _producerMeasurements) <-
- expectRight
- =<< parseRoot "test/phase3/typed-producer.tex"
- assertEqual "selected root uses typed driver"
- TypedMigrationGraph
- (classifyMigrationGraph selection producer)
- assertEqual "selected parse receives the bootstrap syntax input"
- [Syntax.moduleSyntaxAssertedId bootstrapSyntax]
- (Syntax.moduleSyntaxDirectInputs
- (Parse.parsedModuleSyntaxInterface
- (Parse.parsedWorkspaceRootModule producer)))
- (importer, _importerMeasurements) <-
- expectRight
- =<< parseRoot "test/phase3/legacy-importer.tex"
- assertEqual "unselected importer keeps the complete graph legacy"
- LegacyMigrationGraph
- (classifyMigrationGraph selection importer)
- forM_
- [ ( "set/bipartition.tex"
- , ["set.tex", "set/cons.tex", "set/powerset.tex"]
- )
- , ("set/product.tex", ["set.tex"])
- , ("set/filter.tex", ["set.tex", "set/powerset.tex"])
- , ( "relation.tex"
- , ["set.tex", "set/powerset.tex", "set/product.tex"]
- )
- , ( "relation/properties.tex"
- , ["set.tex", "relation.tex"]
- )
- , ( "relation/uniqueness.tex"
- , ["set.tex", "relation.tex"]
- )
- , ( "function.tex"
- , ["set.tex", "relation.tex", "relation/uniqueness.tex"]
- )
- , ( "set/cantor.tex"
- , ["set/powerset.tex", "function.tex"]
- )
- , ( "set/fixpoint.tex"
- , ["set/powerset.tex", "function.tex"]
- )
- ]
- \(path, expectedImports) -> do
- (phase53, _phase53Measurements) <-
- expectRight =<< parseRoot path
- assertEqual
- (path <> " closure uses the typed driver")
- TypedMigrationGraph
- (classifyMigrationGraph selection phase53)
- assertEqual
- (path <> " direct imports")
- expectedImports
- [ safeRelativePathFilePath
- (sourceAddressRelativePath
- (Parse.parsedImportedAddress imported))
- | imported <- Parse.parsedModuleImports
- (Parse.parsedWorkspaceRootModule phase53)
- ]
- (functionImporter, _functionMeasurements) <-
- expectRight =<< parseRoot "set/equinumerosity.tex"
- assertEqual "unselected function importer remains legacy"
- LegacyMigrationGraph
- (classifyMigrationGraph selection functionImporter)
-
-expectRight :: Show err => Either err value -> IO value
-expectRight = \case
- Left err ->
- assertFailure (show err) >> fail "unreachable"
- Right value ->
- pure value
diff --git a/source/Test/Unit/Module.hs b/source/Test/Unit/Module.hs
index 1cf62e5..fbc6c0d 100644
--- a/source/Test/Unit/Module.hs
+++ b/source/Test/Unit/Module.hs
@@ -21,7 +21,6 @@ import Checking.Typed.Inductive qualified as TypedInductive
import CommandLine qualified
import Felix.Module
import Felix.Math.Codec
-import Felix.Migration qualified as Migration
import Felix.Parse qualified as Parse
import Felix.Prelude qualified as Prelude
import Felix.Source
@@ -33,21 +32,45 @@ import Paths_felix qualified as Paths
import Syntax.Abstract qualified as Raw
import Syntax.Internal qualified as Internal
import Syntax.Interface qualified as Syntax
-
-import Bound.Scope (fromScope)
-import Bound.Var (Var(..))
+import Syntax.Pragma qualified as Pragma
+
+import Control.Concurrent (threadDelay)
+import Control.Concurrent.STM
+ ( atomically
+ , check
+ , newEmptyTMVarIO
+ , newTQueueIO
+ , newTVarIO
+ , putTMVar
+ , readTQueue
+ , readTVar
+ , takeTMVar
+ , tryReadTMVar
+ , tryReadTQueue
+ , writeTQueue
+ , writeTVar
+ )
import Control.Exception (bracket)
-import Control.Monad (foldM)
+import Control.Monad (foldM, when)
import Data.ByteString qualified as ByteString
import Data.Text qualified as StrictText
import Data.Text.Encoding qualified as Text
import Control.Monad.Logger (runNoLoggingT)
-import Data.IORef (IORef, modifyIORef', newIORef, readIORef)
+import Data.IORef
+ ( IORef
+ , atomicModifyIORef'
+ , modifyIORef'
+ , newIORef
+ , readIORef
+ )
+import Data.List (sort)
+import Data.List.NonEmpty qualified as NonEmpty
import Data.Map.Strict qualified as Map
import Data.Set qualified as Set
import Data.Vector qualified as Vector
import System.Directory
( createDirectoryIfMissing
+ , doesFileExist
, getCurrentDirectory
, getPermissions
, setOwnerExecutable
@@ -55,8 +78,10 @@ import System.Directory
)
import System.FilePath.Posix qualified as Posix
import System.IO.Temp qualified as Temp
+import System.Timeout qualified as Timeout
import Test.Tasty
import Test.Tasty.HUnit
+import UnliftIO.Async (withAsync, wait)
unitTests :: TestTree
@@ -68,26 +93,28 @@ unitTests =
identifiesCommentOnlyInput
, testCase "loads and parses the packaged final prelude"
parsesPackagedFinalPrelude
+ , testCase "renders packaged final-prelude failures"
+ rendersPackagedPreludeFailures
, testCase "confines exact foundation-leaf completion"
confinesFoundationLeafCompletion
, testCase "builds the confined final prelude"
buildsConfinedFinalPrelude
, testCase "publishes the final prelude as an ordinary sealed root"
publishesFinalPreludeRoot
- , testCase "checks the protected nat closure with the final prelude"
- checksProtectedNatClosure
- , testCase "checks Phase 5.3 library closures with the final prelude"
- checksPhase53LibraryClosures
, testCase "retains exact omitted-proof locations"
retainsExactOmittedProofLocation
, testCase "coalesces syntax without collapsing semantic imports"
coalescesSharedDirectSyntax
- , testCase "resets gloss state between modules"
- resetsGlossStatePerModule
, testCase "makes selected source errors terminal"
rejectsUnsupportedTypedSource
, testCase "compiles exact declarations across an import"
compilesExactDeclarationGraph
+ , testCase "compiles and imports exact structures"
+ compilesExactStructures
+ , testCase "compiles and caches contextual abbreviations"
+ compilesContextualAbbreviations
+ , testCase "rejects an unknown exact structure parent atomically"
+ rejectsUnknownExactStructureParent
, testCase "compiles exact relation expressions"
compilesExactRelationExpressions
, testCase "resolves source-owned set application"
@@ -98,6 +125,8 @@ unitTests =
compilesExactOrdinaryProofs
, testCase "compiles and reuses proof-local set definitions"
compilesAndReusesProofLocalSetDefinitions
+ , testCase "compiles and reuses proof-local function graphs"
+ compilesAndReusesProofLocalFunctionGraphs
, testCase "confines terminal exact contradiction"
confinesTerminalExactContradiction
, testCase "compiles exact separation comprehensions"
@@ -146,9 +175,21 @@ unitTests =
keepsExactSemanticsIndependentOfFixity
, testCase "loads a cached exact producer for a fresh importer"
loadsCachedExactProducerForFreshImporter
+ , testCase "reports admitted source escapes on fresh, warm, and failure paths"
+ reportsAdmittedSourceEscapes
+ , testCase "selects concurrent module failures by source order"
+ selectsConcurrentModuleFailureDeterministically
+ , testCase "batches independent structure obligations atomically"
+ batchesStructureObligationsAtomically
+ , testCase "keeps dependent proof obligations sequential"
+ keepsDependentProofObligationsSequential
+ , testCase "starts diamond consumers after sealed acknowledgements"
+ schedulesDiamondAfterSealedImports
+ , testCase "classifies typed Vampire failures conservatively"
+ classifiesTypedVampireFailures
, testCase "retains the exact prefix before a later failure"
retainsExactPrefixBeforeFailure
- , testCase "routes production verification by complete graph"
+ , testCase "routes every production root through exact checking"
routesProductionVerification
, testCase "installs nonempty implicit prelude evidence"
installsNonemptyImplicitPreludeEvidence
@@ -285,6 +326,30 @@ parsesPackagedFinalPrelude = do
(Syntax.moduleSyntaxAssertedId
(Parse.identifiedParsedModuleSyntaxInterface secondParsed))
+rendersPackagedPreludeFailures :: Assertion
+rendersPackagedPreludeFailures = do
+ assertEqual "load failure"
+ "/missing/felix-prelude.tex: unable to read packaged final prelude: not found"
+ (Prelude.renderPreludeLoadError
+ (Prelude.PreludeSourceReadFailed
+ "/missing/felix-prelude.tex"
+ "not found"))
+ assertEqual "located syntax failure"
+ "<felix-prelude>: syntax pragma location is out of range at 7:3"
+ (Prelude.renderPreludeParseError parseFailure)
+ assertEqual "authority-free API presentation"
+ ("packaged final prelude parsing failed: "
+ <> "<felix-prelude>: syntax pragma location is out of range at 7:3")
+ (Api.renderAuthorityFreeParseError
+ (Api.AuthorityFreePreludeParseFailed parseFailure))
+ where
+ parseFailure =
+ Prelude.PreludeSyntaxPragmaFailed
+ (Pragma.SyntaxPragmaLocationOutOfRange
+ Prelude.preludeDiagnosticLabel
+ 7
+ 3)
+
confinesFoundationLeafCompletion :: Assertion
confinesFoundationLeafCompletion = do
foundation <- expectRight Foundation.checkedFoundation
@@ -387,6 +452,54 @@ buildsConfinedFinalPrelude = do
[]
(Semantic.semanticInterfaceDirectInputs
(FinalPrelude.finalPreludeSemantic candidate))
+ let baseDeltas =
+ [ delta
+ | delta <- Semantic.semanticInterfaceDeclarations
+ (FinalPrelude.finalPreludeSemantic candidate)
+ , not
+ (null
+ (Semantic.semanticEnvironmentStructures
+ (Semantic.declarationDeltaEnvironment delta)))
+ ]
+ case baseDeltas of
+ [delta] -> do
+ assertEqual "base structure has no facts"
+ []
+ (Semantic.declarationDeltaFacts delta)
+ assertEqual "base structure has no propositions"
+ []
+ (Semantic.declarationDeltaPropositions delta)
+ case Semantic.semanticEnvironmentStructures
+ (Semantic.declarationDeltaEnvironment delta) of
+ [descriptor] -> do
+ assertEqual "base structure is metadata-only"
+ Nothing
+ (Semantic.semanticStructureDescriptorPredicate
+ descriptor)
+ case Semantic.semanticStructureDescriptorOperations
+ descriptor of
+ [operation] ->
+ case Identity.lookupCheckedObjectContent
+ (Semantic.semanticStructureOperationObject
+ operation)
+ (FinalPrelude.finalPreludeObjects candidate) of
+ Just Identity.OpaqueObjectContent{} -> pure ()
+ content ->
+ assertFailure
+ ("expected opaque carrier, got "
+ <> show content)
+ operations ->
+ assertFailure
+ ("expected one base operation, got "
+ <> show operations)
+ descriptors ->
+ assertFailure
+ ("expected one base descriptor, got "
+ <> show descriptors)
+ deltas ->
+ assertFailure
+ ("expected one base structure delta, got "
+ <> show (length deltas))
let role roleName =
maybe
(assertFailure
@@ -395,13 +508,13 @@ buildsConfinedFinalPrelude = do
pure
(FinalPrelude.finalPreludePublicRole
candidate roleName)
- omega <- role Migration.PreludeOmegaObject
- naturals <- role Migration.PreludeNaturalsAlias
+ omega <- role FinalPrelude.PreludeOmegaObject
+ naturals <- role FinalPrelude.PreludeNaturalsAlias
assertEqual "naturals expands to Omega"
omega naturals
traverse_
(void . role)
- (Set.toList Migration.expectedFinalPreludePublicRoles)
+ (Set.toList FinalPrelude.expectedFinalPreludePublicRoles)
let foundationTags = Set.fromList
[ tag
| batch <-
@@ -459,518 +572,61 @@ publishesFinalPreludeRoot = do
Store.openStore path theory >>= expectRight
pure store
bracket open Store.closeStore \store -> do
+ freshMemo <- Store.newStoreMemo store
session <-
expectRight
- =<< Module.buildFinalPreludeSession
- store foundation finalPreludeResolver
- let input = Module.migrationPreludeInput session
- sealed = Module.migrationPreludeModule session
+ =<< Module.acquireFinalPreludeSession
+ freshMemo store foundation finalPreludeResolver
+ let input = Module.finalPreludeInput session
+ sealed = Module.finalPreludeModule session
syntax = Module.sealedTypedModuleSyntax sealed
semantic = Module.sealedTypedModuleSemantic sealed
+ assertEqual "empty store constructs the final-prelude root"
+ Module.ModuleRootMiss
+ (Module.finalPreludeAcquisition session)
assertEqual "final prelude owner"
preludeModuleName
(Module.identifiedModuleOwner input)
assertEqual "final prelude has no semantic parents"
[]
(Semantic.semanticInterfaceDirectInputs semantic)
- key <- expectRight
- (Semantic.moduleArtifactKey
- preludeModuleName
- (Parse.identifiedParsedModuleId
- (Module.identifiedModuleParsed input))
- []
- theory)
- memo <- Store.newStoreMemo store
- loaded <- expectRight
- =<< Store.loadCachedModuleInstallation
- memo
- store
- key
- (Syntax.moduleSyntaxAssertedId syntax)
- installation <- maybe
- (assertFailure "final prelude root was not installed"
- >> fail "unreachable")
- pure
- loaded
- cached <- expectRight
- (Module.cachedSealedTypedModule
- foundation [] installation)
+ warmMemo <- Store.newStoreMemo store
+ warmSession <- expectRight
+ =<< Module.acquireFinalPreludeSession
+ warmMemo store foundation unusedResolver
+ let cached = Module.finalPreludeModule warmSession
+ assertEqual "persisted final-prelude root is a cache hit"
+ Module.ModuleRootHit
+ (Module.finalPreludeAcquisition warmSession)
assertEqual "generic root syntax"
syntax
(Module.sealedTypedModuleSyntax cached)
assertEqual "generic root semantics"
semantic
(Module.sealedTypedModuleSemantic cached)
+ assertEqual "cached base structure descriptor"
+ (semanticStructureDescriptors semantic)
+ (semanticStructureDescriptors
+ (Module.sealedTypedModuleSemantic cached))
assertEqual "generic root final prefix"
(Declaration.pendingModulePrefixCurrent
(Module.sealedTypedModulePrefix sealed))
(Declaration.pendingModulePrefixCurrent
(Module.sealedTypedModulePrefix cached))
-
-checksProtectedNatClosure :: Assertion
-checksProtectedNatClosure = do
- foundation <- expectRight Foundation.checkedFoundation
- repository <- getCurrentDirectory
- Temp.withSystemTempDirectory "felix-protected-nat" \directory -> do
- let storePath = directory Posix.</> "store.sqlite"
- executable = directory Posix.</> "vampire"
- writeFile executable
- (unlines
- [ "#!/bin/sh"
- , "cat >/dev/null"
- , "printf '%s\\n' '% SZS status Theorem for protected-core'"
- ])
- permissions <- getPermissions executable
- setPermissions executable
- (setOwnerExecutable True permissions)
- runs <- newIORef (0 :: Int)
- let resolver = countingAcceptedResolver executable runs
- open = do
- (_startup, store) <-
- Store.openStore
- storePath
- (Identity.theoryId foundation)
- >>= expectRight
- pure store
- bracket open Store.closeStore \store -> do
- prelude <-
- expectRight
- =<< Module.buildFinalPreludeSession
- store foundation resolver
- mounts <- exactFixtureMounts repository
- workspace <- parseFinalExactWorkspace prelude mounts "nat.tex"
- sealed <- compileFinalParsedWorkspaceWithResolver
- foundation prelude resolver workspace
- let parsed = toList
- (Parse.parsedWorkspaceImportedBeforeImporter workspace)
- modules = Map.fromList
- [ ( safeRelativePathFilePath
- (resolvedSourceRelativePath
- (Parse.parsedModuleResolved source))
- , checked
- )
- | (source, checked) <- zip parsed sealed
- ]
- moduleAt path = maybe
- (assertFailure ("missing typed module " <> path)
- >> fail "unreachable")
- pure
- (Map.lookup path modules)
- assertEqual "protected module count"
- 5
- (length sealed)
- let preludeSyntaxId =
- Syntax.moduleSyntaxAssertedId
- (Module.sealedTypedModuleSyntax
- (Module.migrationPreludeModule prelude))
- preludeSemanticId =
- Semantic.semanticInterfaceAssertedId
- (Module.sealedTypedModuleSemantic
- (Module.migrationPreludeModule prelude))
- forM_
- (toList
- (Parse.parsedWorkspaceImportedBeforeImporter workspace))
- \parsedModule ->
- assertEqual "final prelude is the first syntax input"
- (Just preludeSyntaxId)
- (listToMaybe
- (Syntax.moduleSyntaxDirectInputs
- (Parse.parsedModuleSyntaxInterface
- parsedModule)))
- forM_ sealed \sealedModule ->
- assertEqual "final prelude is the first semantic input"
- (Just preludeSemanticId)
- (listToMaybe
- (Semantic.semanticInterfaceDirectInputs
- (Module.sealedTypedModuleSemantic sealedModule)))
- setModule <- moduleAt "set.tex"
- sucModule <- moduleAt "set/suc.tex"
- natModule <- moduleAt "nat.tex"
- assertLocalAliasesAbsent
- setModule
- [ "setext"
- , "emptyset"
- , "unions"
- , "unions_iff"
- ]
- assertLocalAliasesAbsent
- natModule
- [ "num_naturals_inductive_set"
- , "num_naturals_smallest_inductive_set"
- ]
- assertTransparentObjectAlias setModule "cons"
- assertTransparentObjectAlias setModule "union"
- pairIdentity <- localObjectKeyTarget
- setModule
- (Semantic.SemanticExpressionFunction
- (Raw.mixfixPattern Raw.PairSymbol))
- consBody <- localTransparentObjectBody setModule "cons"
- let expectedConsBody =
- Core.CLam Core.TySet
- (Core.CLam Core.TySet
- (Core.canonicalSetInsert
- (Core.CBound 1)
- (Core.CBound 0)))
- assertEqual "cons uses canonical set insertion"
- expectedConsBody consBody
- assertBool "cons does not use ordered pairing"
- ( pairIdentity
- `Set.notMember` Core.canonicalTermGlobals consBody
- )
- let preludeModule = Module.migrationPreludeModule prelude
- preludeSuccessor <-
- localObjectAliasTarget preludeModule "prelude_successor"
- sourceSuccessor <- localObjectAliasTarget sucModule "suc"
- assertEqual "source successor reuses packaged successor content"
- preludeSuccessor sourceSuccessor
- preludeSuccessorBody <-
- localTransparentObjectBody preludeModule "prelude_successor"
- assertEqual "packaged successor uses canonical set insertion"
- (Core.CLam Core.TySet
- (Core.canonicalSetInsert
- (Core.CBound 0)
- (Core.CBound 0)))
- preludeSuccessorBody
- assertBool "successor does not use ordered pairing"
- ( pairIdentity
- `Set.notMember`
- Core.canonicalTermGlobals preludeSuccessorBody
- )
- assertOpaqueObjectKey
- setModule
- "pair"
- (Semantic.SemanticExpressionFunction
- (Raw.mixfixPattern Raw.PairSymbol))
- assertCleanFactAlias setModule "cons_iff"
- assertCleanFactAlias setModule "union_iff"
- traverse_
- (assertSourceAxiomAlias setModule)
- [ "pair_eq_iff"
- , "fst_eq"
- , "snd_eq"
- ]
- assertBool "protected checking exercised Vampire"
- . (> 0)
- =<< readIORef runs
-
-checksPhase53LibraryClosures :: Assertion
-checksPhase53LibraryClosures = do
- foundation <- expectRight Foundation.checkedFoundation
- repository <- getCurrentDirectory
- Temp.withSystemTempDirectory "felix-phase53-library" \directory -> do
- let storePath = directory Posix.</> "store.sqlite"
- executable = directory Posix.</> "vampire"
- writeFile executable
- (unlines
- [ "#!/bin/sh"
- , "cat >/dev/null"
- , "printf '%s\\n' '% SZS status Theorem for phase53-library'"
- ])
- permissions <- getPermissions executable
- setPermissions executable
- (setOwnerExecutable True permissions)
- runs <- newIORef (0 :: Int)
- let resolver = countingAcceptedResolver executable runs
- bracket
- (snd <$> (Store.openStore storePath
- (Identity.theoryId foundation) >>= expectRight))
- Store.closeStore
- \store -> do
- prelude <-
- expectRight
- =<< Module.buildFinalPreludeSession
- store foundation resolver
- mounts <- exactFixtureMounts repository
- selection <- expectRight
- (Migration.resolveMigrationSelection
- mounts Migration.typedMigrationModules)
- let preludeSyntaxId = Syntax.moduleSyntaxAssertedId
- (Module.sealedTypedModuleSyntax
- (Module.migrationPreludeModule prelude))
- preludeSemanticId =
- Semantic.semanticInterfaceAssertedId
- (Module.sealedTypedModuleSemantic
- (Module.migrationPreludeModule prelude))
- checkRoot path inspect = do
- workspace <- parseFinalExactWorkspace
- prelude mounts path
- assertEqual (path <> " graph route")
- Migration.TypedMigrationGraph
- (Migration.classifyMigrationGraph
- selection workspace)
- sealed <- compileFinalParsedWorkspaceWithResolver
- foundation prelude resolver workspace
- let parsed = toList
- (Parse.parsedWorkspaceImportedBeforeImporter
- workspace)
- modules = Map.fromList
- [ ( safeRelativePathFilePath
- (resolvedSourceRelativePath
- (Parse.parsedModuleResolved source))
- , (source, checked)
- )
- | (source, checked) <- zip parsed sealed
- ]
- moduleAt modulePath = maybe
- (assertFailure
- ("missing typed module " <> modulePath)
- >> fail "unreachable")
- pure
- (Map.lookup modulePath modules)
- assertEqual (path <> " module count")
- (length parsed)
- (length sealed)
- forM_ parsed \source ->
- assertEqual
- (path <> " final-prelude syntax input")
- (Just preludeSyntaxId)
- (listToMaybe
- (Syntax.moduleSyntaxDirectInputs
- (Parse.parsedModuleSyntaxInterface
- source)))
- forM_ sealed \checked ->
- assertEqual
- (path <> " final-prelude semantic input")
- (Just preludeSemanticId)
- (listToMaybe
- (Semantic.semanticInterfaceDirectInputs
- (Module.sealedTypedModuleSemantic
- checked)))
- inspect moduleAt
- unselectedImporter <- parseFinalExactWorkspace
- prelude mounts "set/equinumerosity.tex"
- assertEqual "unselected function importer graph route"
- Migration.LegacyMigrationGraph
- (Migration.classifyMigrationGraph
- selection unselectedImporter)
- checkRoot "set/bipartition.tex"
- \moduleAt -> do
- (_setParsed, setModule) <- moduleAt "set.tex"
- (_consParsed, consModule) <-
- moduleAt "set/cons.tex"
- (_powersetParsed, powersetModule) <-
- moduleAt "set/powerset.tex"
- (_bipartitionParsed, bipartitionModule) <-
- moduleAt "set/bipartition.tex"
- assertLocalAliasesAbsent powersetModule ["pow_iff"]
- assertEqual "bipartition semantic imports"
- [ preludeSemanticId
- , semanticId setModule
- , semanticId consModule
- , semanticId powersetModule
- ]
- (Semantic.semanticInterfaceDirectInputs
- (Module.sealedTypedModuleSemantic
- bipartitionModule))
- assertFactAliasEscapeKind
- bipartitionModule
- "bipartition_elim"
- Authority.SourceAxiom
- checkRoot "set/product.tex"
- \moduleAt -> do
- (_setParsed, setModule) <- moduleAt "set.tex"
- (_productParsed, productModule) <-
- moduleAt "set/product.tex"
- assertEqual "product semantic imports"
- [preludeSemanticId, semanticId setModule]
- (Semantic.semanticInterfaceDirectInputs
- (Module.sealedTypedModuleSemantic
- productModule))
- assertFactAliasEscapeKind
- productModule
- "inter_times_intro"
- Authority.SourceAxiom
- checkRoot "set/filter.tex"
- \moduleAt -> do
- (_setParsed, setModule) <- moduleAt "set.tex"
- (_powersetParsed, powersetModule) <-
- moduleAt "set/powerset.tex"
- (_filterParsed, filterModule) <-
- moduleAt "set/filter.tex"
- assertEqual "filter semantic imports"
- [ preludeSemanticId
- , semanticId setModule
- , semanticId powersetModule
- ]
- (Semantic.semanticInterfaceDirectInputs
- (Module.sealedTypedModuleSemantic filterModule))
- assertAllLocalFactsClean filterModule
- checkRoot "relation.tex"
- \moduleAt -> do
- (_setParsed, setModule) <- moduleAt "set.tex"
- (_powersetParsed, powersetModule) <-
- moduleAt "set/powerset.tex"
- (_productParsed, productModule) <-
- moduleAt "set/product.tex"
- (_relationParsed, relationModule) <-
- moduleAt "relation.tex"
- assertEqual "relation semantic imports"
- [ preludeSemanticId
- , semanticId setModule
- , semanticId powersetModule
- , semanticId productModule
- ]
- (Semantic.semanticInterfaceDirectInputs
- (Module.sealedTypedModuleSemantic
- relationModule))
- assertCleanFactAlias
- relationModule
- "union_relations_is_relation"
- assertFactAliasEscapeKind
- relationModule
- "id_iff"
- Authority.SourceAxiom
- assertNoLocalFactEscapeKind
- relationModule
- Authority.Omitted
- checkRoot "relation/properties.tex"
- \moduleAt -> do
- (_setParsed, setModule) <- moduleAt "set.tex"
- (_relationParsed, relationModule) <-
- moduleAt "relation.tex"
- (_propertiesParsed, propertiesModule) <-
- moduleAt "relation/properties.tex"
- assertEqual "relation properties semantic imports"
- [ preludeSemanticId
- , semanticId setModule
- , semanticId relationModule
- ]
- (Semantic.semanticInterfaceDirectInputs
- (Module.sealedTypedModuleSemantic
- propertiesModule))
- assertCleanFactAlias
- propertiesModule
- "asymmetric_implies_irreflexive"
- assertNoLocalFactEscapeKind
- propertiesModule
- Authority.Omitted
- assertNoLocalSourceAxiom propertiesModule
- checkRoot "relation/uniqueness.tex"
- \moduleAt -> do
- (_setParsed, setModule) <- moduleAt "set.tex"
- (_relationParsed, relationModule) <-
- moduleAt "relation.tex"
- (_uniquenessParsed, uniquenessModule) <-
- moduleAt "relation/uniqueness.tex"
- assertEqual "relation uniqueness semantic imports"
- [ preludeSemanticId
- , semanticId setModule
- , semanticId relationModule
- ]
- (Semantic.semanticInterfaceDirectInputs
- (Module.sealedTypedModuleSemantic
- uniquenessModule))
- assertCleanFactAlias
- uniquenessModule
- "subseteq_of_injective_is_injective"
- assertFactAliasEscapeKind
- uniquenessModule
- "identity_injective"
- Authority.SourceAxiom
- assertNoLocalFactEscapeKind
- uniquenessModule
- Authority.Omitted
- assertNoLocalSourceAxiom uniquenessModule
- checkRoot "function.tex"
- \moduleAt -> do
- (_setParsed, setModule) <- moduleAt "set.tex"
- (_relationParsed, relationModule) <-
- moduleAt "relation.tex"
- (_uniquenessParsed, uniquenessModule) <-
- moduleAt "relation/uniqueness.tex"
- (_functionParsed, functionModule) <-
- moduleAt "function.tex"
- assertEqual "function semantic imports"
- [ preludeSemanticId
- , semanticId setModule
- , semanticId relationModule
- , semanticId uniquenessModule
- ]
- (Semantic.semanticInterfaceDirectInputs
- (Module.sealedTypedModuleSemantic
- functionModule))
- assertCleanFactAlias
- functionModule
- "function_on_weaken_codom"
- assertFactAliasEscapeKind
- functionModule
- "function_apply_intro"
- Authority.SourceAxiom
- assertFactAliasEscapeKind
- functionModule
- "funs_circ"
- Authority.Omitted
- assertLocalDirectAuthorizationCount
- functionModule
- Authority.OmittedAuthorization
- 6
- assertNoLocalSourceAxiom functionModule
- checkRoot "set/cantor.tex"
- \moduleAt -> do
- (_powersetParsed, powersetModule) <-
- moduleAt "set/powerset.tex"
- (_functionParsed, functionModule) <-
- moduleAt "function.tex"
- (_cantorParsed, cantorModule) <-
- moduleAt "set/cantor.tex"
- assertEqual "Cantor semantic imports"
- [ preludeSemanticId
- , semanticId powersetModule
- , semanticId functionModule
- ]
- (Semantic.semanticInterfaceDirectInputs
- (Module.sealedTypedModuleSemantic
- cantorModule))
- assertCleanFactAlias cantorModule "cantor"
- assertNoLocalFactEscapeKind
- cantorModule Authority.Omitted
- assertNoLocalSourceAxiom cantorModule
- checkRoot "set/fixpoint.tex"
- \moduleAt -> do
- (_powersetParsed, powersetModule) <-
- moduleAt "set/powerset.tex"
- (_functionParsed, functionModule) <-
- moduleAt "function.tex"
- (_fixpointParsed, fixpointModule) <-
- moduleAt "set/fixpoint.tex"
- assertEqual "fixpoint semantic imports"
- [ preludeSemanticId
- , semanticId powersetModule
- , semanticId functionModule
- ]
- (Semantic.semanticInterfaceDirectInputs
- (Module.sealedTypedModuleSemantic
- fixpointModule))
- assertCleanFactAlias fixpointModule "fixpoint"
- assertCleanFactAlias
- fixpointModule "subseteqpreserving"
- assertFactAliasEscapeKind
- fixpointModule
- "knastertarski"
- Authority.SourceAxiom
- assertNoLocalFactEscapeKind
- fixpointModule Authority.Omitted
- assertNoLocalSourceAxiom fixpointModule
- where
- semanticId =
- Semantic.semanticInterfaceAssertedId
- . Module.sealedTypedModuleSemantic
-
-assertLocalAliasesAbsent
- :: Module.SealedTypedModule
- -> [Text]
- -> Assertion
-assertLocalAliasesAbsent sealed names =
- forM_ names \name ->
- assertBool
- ("protected module still publishes " <> show name)
- (Semantic.semanticName name `notElem` aliases)
- where
- aliases =
- [ Semantic.semanticAliasName alias
- | delta <- localSemanticDeltas sealed
- , alias <- Semantic.declarationDeltaAliases delta
- ]
+ visits <- Store.storeMemoVisits warmMemo
+ assertEqual "cached prelude validates one artifact root"
+ 1
+ (Store.storeArtifactsValidated visits)
+
+semanticStructureDescriptors
+ :: Semantic.SemanticInterface
+ -> [Semantic.SemanticStructureDescriptor]
+semanticStructureDescriptors semantic =
+ [ descriptor
+ | delta <- Semantic.semanticInterfaceDeclarations semantic
+ , descriptor <- Semantic.semanticEnvironmentStructures
+ (Semantic.declarationDeltaEnvironment delta)
+ ]
assertTransparentObjectAlias
:: Module.SealedTypedModule
@@ -983,18 +639,6 @@ assertTransparentObjectAlias sealed name = do
Identity.TransparentObject
(Identity.objectIdFamily target)
-assertOpaqueObjectKey
- :: Module.SealedTypedModule
- -> Text
- -> Semantic.SemanticGlobalKey
- -> Assertion
-assertOpaqueObjectKey sealed name key = do
- target <- localObjectKeyTarget sealed key
- assertEqual
- ("opaque object for " <> StrictText.unpack name)
- Identity.OpaqueObject
- (Identity.objectIdFamily target)
-
localObjectKeyTarget
:: Module.SealedTypedModule
-> Semantic.SemanticGlobalKey
@@ -1026,29 +670,6 @@ localObjectAliasTarget sealed name = do
(Semantic.semanticGlobalTargetObject
(Semantic.semanticGlobalBindingTarget binding))
-localTransparentObjectBody
- :: Module.SealedTypedModule
- -> Text
- -> IO (Core.CanonicalTerm Identity.ObjectId)
-localTransparentObjectBody sealed name = do
- identity <- localObjectAliasTarget sealed name
- object <- sole
- ("asserted object for " <> StrictText.unpack name)
- [ candidate
- | batch <- Declaration.pendingModulePrefixBatches
- (Module.sealedTypedModulePrefix sealed)
- , candidate <- Declaration.committedBatchObjects batch
- , Identity.assertedObjectId candidate == identity
- ]
- case Identity.assertedObjectContent object of
- Identity.TransparentObjectContent _theory _coreType body ->
- pure body
- content ->
- assertFailure
- ("object for " <> StrictText.unpack name
- <> " is not transparent: " <> show content)
- >> fail "unreachable"
-
checkedPropositionTermByAlias
:: Module.SealedTypedModule
-> Text
@@ -1057,30 +678,31 @@ checkedPropositionTermByAlias sealed name = do
batch <- batchByAlias
(Module.sealedTypedModulePrefix sealed)
name
+ alias <- sole
+ ("semantic alias for " <> StrictText.unpack name)
+ [ candidate
+ | candidate <- Semantic.declarationDeltaAliases
+ (Declaration.committedBatchDelta batch)
+ , Semantic.semanticAliasName candidate
+ == Semantic.semanticName name
+ ]
+ occurrence <- sole
+ ("semantic fact for " <> StrictText.unpack name)
+ [ candidate
+ | candidate <- Semantic.declarationDeltaFacts
+ (Declaration.committedBatchDelta batch)
+ , Semantic.semanticFactFingerprint candidate
+ == Semantic.semanticAliasTarget alias
+ ]
proposition <- sole
("checked proposition for " <> StrictText.unpack name)
- (Declaration.committedBatchPropositions batch)
+ [ candidate
+ | candidate <- Declaration.committedBatchPropositions batch
+ , Identity.checkedPropositionId candidate
+ == Semantic.semanticFactProposition occurrence
+ ]
pure (Identity.checkedPropositionTerm proposition)
-assertFactAliasEscapeKind
- :: Module.SealedTypedModule
- -> Text
- -> Authority.EscapeKind
- -> Assertion
-assertFactAliasEscapeKind sealed name expected = do
- delta <- localDeltaByAlias sealed name
- fact <- sole
- ("semantic fact for " <> StrictText.unpack name)
- (Semantic.declarationDeltaFacts delta)
- assertBool
- ("escape authority for " <> StrictText.unpack name)
- ( expected
- `elem` Authority.escapeKindsToList
- (Authority.authoritySafetyEscapeKinds
- (Authority.factAuthoritySafety
- (Semantic.semanticFactAuthority fact)))
- )
-
assertCleanFactAlias
:: Module.SealedTypedModule
-> Text
@@ -1107,114 +729,6 @@ assertCleanFactAlias sealed name = do
(Authority.factAuthoritySafety
(Semantic.semanticFactAuthority fact))
-assertAllLocalFactsClean
- :: Module.SealedTypedModule
- -> Assertion
-assertAllLocalFactsClean sealed =
- assertBool
- "all locally published facts have clean authority"
- (all hasCleanAuthority localFacts)
- where
- localFacts =
- [ fact
- | delta <- localSemanticDeltas sealed
- , fact <- Semantic.declarationDeltaFacts delta
- ]
- hasCleanAuthority fact =
- Authority.factAuthoritySafety
- (Semantic.semanticFactAuthority fact)
- == Authority.cleanAuthoritySafety
-
-assertNoLocalFactEscapeKind
- :: Module.SealedTypedModule
- -> Authority.EscapeKind
- -> Assertion
-assertNoLocalFactEscapeKind sealed unexpected =
- assertBool
- ("no local fact has " <> show unexpected <> " authority")
- (all lacksEscapeKind localFacts)
- where
- localFacts =
- [ fact
- | delta <- localSemanticDeltas sealed
- , fact <- Semantic.declarationDeltaFacts delta
- ]
- lacksEscapeKind fact =
- unexpected
- `notElem` Authority.escapeKindsToList
- (Authority.authoritySafetyEscapeKinds
- (Authority.factAuthoritySafety
- (Semantic.semanticFactAuthority fact)))
-
-assertNoLocalSourceAxiom
- :: Module.SealedTypedModule
- -> Assertion
-assertNoLocalSourceAxiom sealed =
- assertBool
- "module introduces no source axiom"
- (all (/= Authority.SourceAxiomAuthorization) directAuthorizations)
- where
- directAuthorizations =
- [ Authority.validationDirectAuthorization certificate
- | batch <- Declaration.pendingModulePrefixBatches
- (Module.sealedTypedModulePrefix sealed)
- , validation <- maybeToList
- (Declaration.committedBatchDeclarationValidation batch)
- , certificate <-
- Semantic.declarationValidationRecordCertificates validation
- ]
-
-assertLocalDirectAuthorizationCount
- :: Module.SealedTypedModule
- -> Authority.DirectAuthorization
- -> Int
- -> Assertion
-assertLocalDirectAuthorizationCount sealed expected expectedCount =
- assertEqual
- ("local " <> show expected <> " authorization count")
- expectedCount
- (length
- [ ()
- | batch <- Declaration.pendingModulePrefixBatches
- (Module.sealedTypedModulePrefix sealed)
- , validation <- Declaration.committedBatchProofValidations batch
- , Authority.validationDirectAuthorization
- (Semantic.proofValidationRecordCertificate validation)
- == expected
- ])
-
-assertSourceAxiomAlias
- :: Module.SealedTypedModule
- -> Text
- -> Assertion
-assertSourceAxiomAlias sealed name = do
- batch <- batchByAlias
- (Module.sealedTypedModulePrefix sealed)
- name
- fact <- sole
- ("source axiom fact " <> StrictText.unpack name)
- (Semantic.declarationDeltaFacts
- (Declaration.committedBatchDelta batch))
- assertEqual
- ("source axiom safety for " <> StrictText.unpack name)
- (Authority.authoritySafety
- (Authority.singletonEscapeKind Authority.SourceAxiom))
- (Authority.factAuthoritySafety
- (Semantic.semanticFactAuthority fact))
- validation <- maybe
- (assertFailure
- ("source axiom validation for " <> StrictText.unpack name)
- >> fail "unreachable")
- pure
- (Declaration.committedBatchDeclarationValidation batch)
- certificate <- sole
- ("source axiom certificate for " <> StrictText.unpack name)
- (Semantic.declarationValidationRecordCertificates validation)
- assertEqual
- ("source axiom authority for " <> StrictText.unpack name)
- Authority.SourceAxiomAuthorization
- (Authority.validationDirectAuthorization certificate)
-
batchByAlias
:: Declaration.PendingModulePrefix
-> Text
@@ -1350,18 +864,10 @@ coalescesSharedDirectSyntax = do
, (sourceMountId "library", root Posix.</> "library")
, (sourceMountId "debug", root Posix.</> "debug")
]
- selection <-
- expectRight
- (Migration.resolveMigrationSelection
- mounts
- Migration.typedMigrationModules)
let bootstrapSyntax =
Module.sealedTypedModuleSyntax
(Module.bootstrapPreludeModule session)
- syntaxInputs source
- | Migration.migrationSelectionContains selection source =
- [bootstrapSyntax]
- | otherwise = []
+ syntaxInputs _source = [bootstrapSyntax]
request <-
expectRight
(searchedRoot "test/phase3/typed-shared-root.tex")
@@ -1371,9 +877,6 @@ coalescesSharedDirectSyntax = do
mounts
request
syntaxInputs
- assertEqual "selected shared-syntax graph"
- Migration.TypedMigrationGraph
- (Migration.classifyMigrationGraph selection workspace)
case Parse.parsedWorkspaceModules workspace of
[firstParsed, secondParsed, rootParsed] -> do
first <- seal foundation session firstParsed []
@@ -1436,31 +939,6 @@ coalescesSharedDirectSyntax = do
assertFailure "empty typed module did not seal"
>> fail "unreachable"
-resetsGlossStatePerModule :: Assertion
-resetsGlossStatePerModule = do
- blocks <- Api.gloss "test/phase3/gloss-root.tex"
- binders <- traverse signatureBinder blocks
- assertEqual "fresh variables restart at each module boundary"
- [Internal.FreshVar 0, Internal.FreshVar 0, Internal.FreshVar 1]
- binders
- where
- signatureBinder = \case
- Internal.BlockSig
- _location
- _marker
- _assumptions
- (Internal.SignatureFormula
- (Internal.Quantified Internal.Universally scope)) ->
- case nubOrd [binder | B binder <- toList (fromScope scope)] of
- [binder] -> pure binder
- binders ->
- assertFailure
- ("unexpected signature binders: " <> show binders)
- >> fail "unreachable"
- block ->
- assertFailure ("unexpected glossed block: " <> show block)
- >> fail "unreachable"
-
rejectsUnsupportedTypedSource :: Assertion
rejectsUnsupportedTypedSource = do
result <-
@@ -1472,13 +950,16 @@ rejectsUnsupportedTypedSource = do
Provers.defaultMemoryLimit)
"test/phase3/typed-unsupported.tex")
case result of
- Left
- (failure@(Api.VerificationTypedModuleError
+ Right
+ ( Api.VerificationCheckingFailure _report
+ (failure@(Api.VerificationTypedModuleError
source
(Module.TypedActionFailed
(Module.TypedExactCompileFailed
(Exact.ExactUnsupportedDeclarationBody location)))
- prefix)) -> do
+ prefix))
+ , _measurements
+ ) -> do
assertEqual "failed source"
"test/phase3/typed-unsupported.tex"
(safeRelativePathFilePath
@@ -1670,6 +1151,566 @@ compilesExactDeclarationGraph = do
Identity.TransparentObjectContent{} -> "transparent"
Identity.IntrinsicObjectContent{} -> "intrinsic"
+compilesExactStructures :: Assertion
+compilesExactStructures = do
+ foundation <- expectRight Foundation.checkedFoundation
+ repository <- getCurrentDirectory
+ Temp.withSystemTempDirectory "felix-exact-structures" \directory -> do
+ let path = directory Posix.</> "store.sqlite"
+ executable = directory Posix.</> "vampire"
+ writeAcceptedFixtureVampire executable
+ runs <- newIORef (0 :: Int)
+ let resolver = countingAcceptedResolver executable runs
+ (_startup, store) <-
+ Store.openStore path (Identity.theoryId foundation)
+ >>= expectRight
+ bracket (pure store) Store.closeStore \opened -> do
+ prelude <-
+ expectRight
+ =<< acquireFinalPreludeSession
+ opened foundation resolver
+ carrierOperation <- sole "base carrier operation"
+ [ operation
+ | descriptor <- semanticStructureDescriptors
+ (Module.sealedTypedModuleSemantic
+ (Module.finalPreludeModule prelude))
+ , operation <-
+ Semantic.semanticStructureDescriptorOperations descriptor
+ ]
+ mounts <- exactFixtureMounts repository
+ workspace <- parseFinalExactWorkspace
+ prelude mounts "test/phase5/exact-structure-child.tex"
+ sealed <- compileFinalParsedWorkspaceWithResolver
+ foundation prelude resolver workspace
+ freshRuns <- readIORef runs
+ warm <- installAndLoadStructures
+ opened foundation prelude workspace sealed
+ warmRuns <- readIORef runs
+ assertEqual "warm structures preserve descriptors"
+ (structureDescriptors <$> sealed)
+ (structureDescriptors <$> warm)
+ assertEqual "warm structures make no prover calls"
+ freshRuns warmRuns
+ case sealed of
+ [parent, child] -> do
+ let parentBatches =
+ Declaration.pendingModulePrefixBatches
+ (Module.sealedTypedModulePrefix parent)
+ parentDeltas =
+ Semantic.semanticInterfaceDeclarations
+ (Module.sealedTypedModuleSemantic parent)
+ childBatches =
+ Declaration.pendingModulePrefixBatches
+ (Module.sealedTypedModulePrefix child)
+ childDeltas =
+ Semantic.semanticInterfaceDeclarations
+ (Module.sealedTypedModuleSemantic child)
+ parentBatch <- sole "parent structure batch"
+ (take 1 parentBatches)
+ parentDelta <- sole "parent structure delta"
+ (take 1 parentDeltas)
+ parentDescriptor <- sole "parent structure descriptor"
+ (Semantic.semanticEnvironmentStructures
+ (Semantic.declarationDeltaEnvironment parentDelta))
+ parentOperation <- sole "parent structure operation"
+ (Semantic.semanticStructureDescriptorOperations
+ parentDescriptor)
+ parentPredicate <-
+ maybe
+ (assertFailure "parent structure has no predicate"
+ >> fail "unreachable")
+ pure
+ (Semantic.semanticStructureDescriptorPredicate
+ parentDescriptor)
+ assertEqual "structure object family order"
+ ["opaque", "transparent"]
+ [ objectFamilyName
+ (Identity.assertedObjectContent object)
+ | object <- Declaration.committedBatchObjects parentBatch
+ ]
+ assertEqual "structure fact aliases"
+ [ Semantic.semanticName "pointed_set"
+ , Semantic.semanticName "pointed_refl"
+ ]
+ (Semantic.semanticAliasName
+ <$> Semantic.declarationDeltaAliases parentDelta)
+ definitionFact <- sole "structure definition fact"
+ (take 1 (Semantic.declarationDeltaFacts parentDelta))
+ definitionTarget <-
+ targetForOccurrence parentBatch definitionFact
+ assertEqual "pointwise structure definition"
+ (Core.CForall Core.TySet
+ (Core.CEq Core.TyProp
+ (Core.CApp
+ (Core.CGlobal parentPredicate)
+ (Core.CBound 0))
+ (Core.CEq Core.TySet
+ (Core.CBound 0)
+ (Core.CBound 0))))
+ definitionTarget
+ validations <-
+ maybe
+ (assertFailure "structure validation is absent"
+ >> fail "unreachable")
+ (pure
+ . Semantic.declarationValidationRecordCertificates)
+ (Declaration.committedBatchDeclarationValidation
+ parentBatch)
+ case validations of
+ definitionValidation : projectionValidation : [] -> do
+ assertEqual "structure definition authority"
+ (Authority.CheckedKernelConstruction
+ (Authority.CheckedDefinitionEquation
+ parentPredicate))
+ (Authority.validationDirectAuthorization
+ definitionValidation)
+ projectionFact <- sole
+ "structure projection fact"
+ (drop 1
+ (Semantic.declarationDeltaFacts
+ parentDelta))
+ assertEqual
+ "projection has independent authority"
+ (Semantic.semanticFactAuthority projectionFact)
+ (Authority.validationTarget
+ projectionValidation)
+ assertEqual "projection authority is clean"
+ Authority.cleanAuthoritySafety
+ (Authority.factAuthoritySafety
+ (Authority.validationTarget
+ projectionValidation))
+ records ->
+ assertFailure
+ ("expected two structure validations, got "
+ <> show records)
+ assertBool "all parent structure facts are clean"
+ (all
+ ((== Authority.cleanAuthoritySafety)
+ . Authority.factAuthoritySafety
+ . Semantic.semanticFactAuthority)
+ (Semantic.declarationDeltaFacts parentDelta))
+
+ let claimGlobals marker = do
+ batch <- batchWithAlias marker parentBatches
+ occurrence <- sole (marker <> " occurrence")
+ (Semantic.declarationDeltaFacts
+ (Declaration.committedBatchDelta batch))
+ Core.canonicalTermGlobals
+ <$> targetForOccurrence batch occurrence
+ carrierGlobals <- claimGlobals "pointed_carrier"
+ operationGlobals <- claimGlobals "pointed_operation"
+ assertBool "membership uses inherited carrier"
+ (Semantic.semanticStructureOperationObject carrierOperation
+ `Set.member` carrierGlobals)
+ assertBool "implicit and explicit operation share one object"
+ (Semantic.semanticStructureOperationObject parentOperation
+ `Set.member` operationGlobals)
+
+ childBatch <- sole "child structure batch" childBatches
+ childDelta <- sole "child structure delta" childDeltas
+ childDescriptor <- sole "child structure descriptor"
+ (Semantic.semanticEnvironmentStructures
+ (Semantic.declarationDeltaEnvironment childDelta))
+ assertEqual "child allocates no replacement operation"
+ []
+ (Semantic.semanticStructureDescriptorOperations
+ childDescriptor)
+ assertEqual "child owns only its transparent predicate"
+ ["transparent"]
+ [ objectFamilyName
+ (Identity.assertedObjectContent object)
+ | object <- Declaration.committedBatchObjects childBatch
+ ]
+ modules ->
+ assertFailure
+ ("expected parent and child structures, got "
+ <> show (length modules))
+ where
+ installAndLoadStructures store foundation prelude workspace sealed = do
+ memo <- Store.newStoreMemo store
+ case
+ ( toList
+ (Parse.parsedWorkspaceImportedBeforeImporter workspace)
+ , sealed
+ ) of
+ ([parentParsed, childParsed], [parent, child]) -> do
+ cachedParent <- persistAndLoad memo [] parentParsed parent
+ cachedChild <- persistAndLoad
+ memo [cachedParent] childParsed child
+ pure [cachedParent, cachedChild]
+ (parsed, modules) ->
+ assertFailure
+ ("expected two structure installations, got "
+ <> show (length parsed)
+ <> " parsed and "
+ <> show (length modules)
+ <> " checked modules")
+ >> fail "unreachable"
+ where
+ preludeModule = Module.finalPreludeModule prelude
+
+ persistAndLoad memo parents parsed sealedModule = do
+ let input = Module.identifiedPhysicalModule parsed
+ syntax = Module.sealedTypedModuleSyntax sealedModule
+ semantic = Module.sealedTypedModuleSemantic sealedModule
+ key <- expectRight
+ (Semantic.moduleArtifactKey
+ (Module.identifiedModuleOwner input)
+ (Parse.identifiedParsedModuleId
+ (Module.identifiedModuleParsed input))
+ (Semantic.semanticInterfaceDirectInputs semantic)
+ (Identity.theoryId foundation))
+ let artifact = Semantic.moduleArtifactResult
+ key
+ (Syntax.moduleSyntaxAssertedId syntax)
+ (Semantic.semanticInterfaceAssertedId semantic)
+ acknowledged <- expectRight
+ =<< Store.writeSealedModule
+ store
+ (Module.sealedTypedModulePrefix sealedModule)
+ [syntax]
+ [semantic]
+ artifact
+ assertEqual "cached structure artifact acknowledgement"
+ artifact acknowledged
+ loaded <- expectRight
+ =<< Store.loadCachedModuleInstallation
+ memo
+ store
+ key
+ (Syntax.moduleSyntaxAssertedId
+ (Parse.parsedModuleSyntaxInterface parsed))
+ installation <- maybe
+ (assertFailure "cached structure installation is absent"
+ >> fail "unreachable")
+ pure
+ loaded
+ expectRight
+ (Module.cachedSealedTypedModule
+ foundation
+ (preludeModule : parents)
+ installation)
+
+ structureDescriptors =
+ semanticStructureDescriptors
+ . Module.sealedTypedModuleSemantic
+
+ objectFamilyName :: Identity.ObjectContent -> String
+ objectFamilyName = \case
+ Identity.OpaqueObjectContent{} -> "opaque"
+ Identity.TransparentObjectContent{} -> "transparent"
+ Identity.IntrinsicObjectContent{} -> "intrinsic"
+
+ targetForOccurrence batch occurrence =
+ maybe
+ (assertFailure "structure proposition is absent"
+ >> fail "unreachable")
+ (pure . Core.frozenCoreTerm . Identity.checkedPropositionTerm)
+ (find
+ ((== Semantic.semanticFactProposition occurrence)
+ . Identity.checkedPropositionId)
+ (Declaration.committedBatchPropositions batch))
+
+ batchWithAlias marker batches =
+ maybe
+ (assertFailure ("missing batch alias " <> marker)
+ >> fail "unreachable")
+ pure
+ (find
+ (elem (Semantic.semanticName (StrictText.pack marker))
+ . fmap Semantic.semanticAliasName
+ . Semantic.declarationDeltaAliases
+ . Declaration.committedBatchDelta)
+ batches)
+
+compilesContextualAbbreviations :: Assertion
+compilesContextualAbbreviations = do
+ foundation <- expectRight Foundation.checkedFoundation
+ repository <- getCurrentDirectory
+ Temp.withSystemTempDirectory "felix-contextual-abbreviation" \directory -> do
+ let storePath = directory Posix.</> "store.sqlite"
+ executable = directory Posix.</> "vampire"
+ relative = "test/phase5/exact-contextual-abbreviation.tex"
+ writeAcceptedFixtureVampire executable
+ runs <- newIORef (0 :: Int)
+ let resolver = countingAcceptedResolver executable runs
+ (_startup, store) <-
+ Store.openStore storePath (Identity.theoryId foundation)
+ >>= expectRight
+ bracket (pure store) Store.closeStore \opened -> do
+ prelude <-
+ expectRight
+ =<< acquireFinalPreludeSession
+ opened foundation resolver
+ mounts <- exactFixtureMounts repository
+ workspace <- parseFinalExactWorkspace prelude mounts relative
+ sealed <- sole "contextual abbreviation module"
+ =<< compileFinalParsedWorkspaceWithResolver
+ foundation prelude resolver workspace
+ let deltas =
+ Semantic.semanticInterfaceDeclarations
+ (Module.sealedTypedModuleSemantic sealed)
+ contextualTargets =
+ [ (identity, requirements)
+ | delta <- deltas
+ , binding <- Semantic.semanticEnvironmentBindings
+ (Semantic.declarationDeltaEnvironment delta)
+ , Semantic.ContextualTransparentExpansion
+ identity requirements <-
+ [Semantic.semanticGlobalBindingTarget binding]
+ ]
+ assertEqual "contextual target count" 2
+ (length contextualTargets)
+ requirements <-
+ sole "canonical contextual requirement set"
+ (nubOrd (snd <$> contextualTargets))
+ assertEqual "one structure operation requirement" 1
+ (Map.size requirements)
+ let batches =
+ Declaration.pendingModulePrefixBatches
+ (Module.sealedTypedModulePrefix sealed)
+ traverse_
+ (assertReflexiveFact batches)
+ [ "phase5_context_dot_explicit"
+ , "phase5_context_inherited"
+ , "phase5_context_nested"
+ , "phase5_context_explicit_unique"
+ ]
+
+ parsed <- pure (Parse.parsedWorkspaceRootModule workspace)
+ let syntax = Module.sealedTypedModuleSyntax sealed
+ semantic = Module.sealedTypedModuleSemantic sealed
+ key <- expectRight
+ (Semantic.moduleArtifactKey
+ (moduleName (Parse.parsedModuleAddress parsed))
+ (Parse.parsedModuleId parsed)
+ (Semantic.semanticInterfaceDirectInputs semantic)
+ (Identity.theoryId foundation))
+ let artifact =
+ Semantic.moduleArtifactResult
+ key
+ (Syntax.moduleSyntaxAssertedId syntax)
+ (Semantic.semanticInterfaceAssertedId semantic)
+ void
+ (expectRight
+ =<< Store.writeSealedModule
+ opened
+ (Module.sealedTypedModulePrefix sealed)
+ [syntax]
+ [semantic]
+ artifact)
+ memo <- Store.newStoreMemo opened
+ loaded <- expectRight
+ =<< Store.loadCachedModuleInstallation
+ memo opened key
+ (Syntax.moduleSyntaxAssertedId
+ (Parse.parsedModuleSyntaxInterface parsed))
+ installation <- maybe
+ (assertFailure "contextual cached installation is absent"
+ >> fail "unreachable")
+ pure
+ loaded
+ cached <- expectRight
+ (Module.cachedSealedTypedModule
+ foundation
+ [Module.finalPreludeModule prelude]
+ installation)
+ assertEqual "cached contextual semantic target"
+ semantic
+ (Module.sealedTypedModuleSemantic cached)
+
+ runsBeforeConsumer <- readIORef runs
+ consumerWorkspace <-
+ parseFinalExactWorkspace prelude mounts
+ "test/phase5/exact-contextual-abbreviation-consumer.tex"
+ let consumerParsed =
+ Parse.parsedWorkspaceRootModule consumerWorkspace
+ consumerInput <- expectRight
+ (Module.typedModuleInput
+ foundation
+ (Module.finalPreludeReadiness prelude)
+ resolver
+ Declaration.FreshValidation
+ consumerParsed
+ [cached])
+ consumer <- Module.runTypedModule consumerInput >>= \case
+ Module.TypedModuleSucceeded sealedConsumer ->
+ pure sealedConsumer
+ Module.TypedModuleOpenFailed failure ->
+ assertFailure
+ ("contextual consumer did not open: " <> show failure)
+ >> fail "unreachable"
+ Module.TypedModuleFailed failure _prefix ->
+ assertFailure
+ ("contextual consumer did not seal: " <> show failure)
+ >> fail "unreachable"
+ let consumerTargets =
+ [ Semantic.semanticGlobalTargetObject
+ (Semantic.semanticGlobalBindingTarget binding)
+ | delta <- localSemanticDeltas consumer
+ , binding <- Semantic.semanticEnvironmentBindings
+ (Semantic.declarationDeltaEnvironment delta)
+ ]
+ assertEqual "two contextual consumer declarations" 2
+ (length consumerTargets)
+ void
+ (sole
+ "quantified contextual binder matches its explicit parameter"
+ (nubOrd consumerTargets))
+ runsAfterConsumer <- readIORef runs
+ assertEqual "contextual abbreviations require no prover call"
+ runsBeforeConsumer runsAfterConsumer
+
+ verifyFailure foundation resolver prelude mounts sealed
+ "test/phase5/exact-contextual-abbreviation-missing.tex"
+ (\case
+ Exact.ExactContextualExpansionNotAvailable location _key ->
+ assertEqual "missing context line" 5 (locLine location)
+ failure ->
+ assertFailure
+ ("unexpected missing-context failure: "
+ <> show failure))
+ verifyFailure foundation resolver prelude mounts sealed
+ "test/phase5/exact-contextual-abbreviation-ambiguous.tex"
+ (\case
+ Exact.ExactStructureOperationAmbiguous
+ location _symbol objects -> do
+ assertEqual "ambiguous operation line" 16
+ (locLine location)
+ assertEqual "two distinct operation objects" 2
+ (length objects)
+ failure ->
+ assertFailure
+ ("unexpected operation ambiguity failure: "
+ <> show failure))
+ where
+ assertReflexiveFact batches marker = do
+ batch <- maybe
+ (assertFailure ("missing contextual fact " <> marker)
+ >> fail "unreachable")
+ pure
+ (find
+ (elem (Semantic.semanticName (StrictText.pack marker))
+ . fmap Semantic.semanticAliasName
+ . Semantic.declarationDeltaAliases
+ . Declaration.committedBatchDelta)
+ batches)
+ proposition <- sole (marker <> " proposition")
+ (Declaration.committedBatchPropositions batch)
+ let body = stripClaimEnvelope
+ (Core.frozenCoreTerm
+ (Identity.checkedPropositionTerm proposition))
+ case body of
+ Core.CEq _ left right ->
+ assertEqual (marker <> " canonical sides") left right
+ _ ->
+ assertFailure
+ (marker <> " did not elaborate to reflexive equality: "
+ <> show body)
+
+ stripClaimEnvelope = \case
+ Core.CForall _ body -> stripClaimEnvelope body
+ Core.CImp _ body -> stripClaimEnvelope body
+ term -> term
+
+ verifyFailure foundation resolver prelude mounts imported relative checkFailure = do
+ workspace <- parseFinalExactWorkspace prelude mounts relative
+ let parsed = Parse.parsedWorkspaceRootModule workspace
+ input <- expectRight
+ (Module.typedModuleInput
+ foundation
+ (Module.finalPreludeReadiness prelude)
+ resolver
+ Declaration.FreshValidation
+ parsed
+ [imported])
+ Module.runTypedModule input >>= \case
+ Module.TypedModuleFailed
+ (Module.TypedActionFailed
+ (Module.TypedExactCompileFailed failure))
+ _prefix ->
+ checkFailure failure
+ Module.TypedModuleFailed
+ (Module.TypedActionFailed
+ (Module.TypedExactProofFailed
+ (ExactProof.ExactProofElaborationFailed failure)))
+ _prefix ->
+ checkFailure failure
+ Module.TypedModuleSucceeded{} ->
+ assertFailure (relative <> " was unexpectedly accepted")
+ Module.TypedModuleOpenFailed failure ->
+ assertFailure
+ (relative <> " did not open: " <> show failure)
+ Module.TypedModuleFailed failure _prefix ->
+ assertFailure
+ (relative <> " failed unexpectedly: " <> show failure)
+
+rejectsUnknownExactStructureParent :: Assertion
+rejectsUnknownExactStructureParent =
+ Temp.withSystemTempDirectory "felix-exact-structure-parent" \root -> do
+ let relative = "entry.tex"
+ path = root Posix.</> relative
+ source =
+ "\\begin{struct}\\label{known_structure}\n"
+ <> " A known structure $X$ is a onesorted structure.\n"
+ <> "\\end{struct}\n\n"
+ <> "\\begin{struct}\\label{invalid_structure}\n"
+ <> " An invalid structure $X$ is a future structure.\n"
+ <> "\\end{struct}\n\n"
+ <> "\\begin{struct}\\label{future_structure}\n"
+ <> " A future structure $X$ is a onesorted structure.\n"
+ <> "\\end{struct}\n"
+ ByteString.writeFile path
+ (Text.encodeUtf8 (StrictText.pack source))
+ foundation <- expectRight Foundation.checkedFoundation
+ Temp.withSystemTempDirectory "felix-exact-structure-store" \directory -> do
+ let storePath = directory Posix.</> "store.sqlite"
+ executable = directory Posix.</> "vampire"
+ writeAcceptedFixtureVampire executable
+ runs <- newIORef (0 :: Int)
+ let resolver = countingAcceptedResolver executable runs
+ (_startup, store) <-
+ Store.openStore storePath (Identity.theoryId foundation)
+ >>= expectRight
+ bracket (pure store) Store.closeStore \opened -> do
+ prelude <-
+ expectRight
+ =<< acquireFinalPreludeSession
+ opened foundation resolver
+ mounts <- exactFixtureMounts root
+ workspace <- parseFinalExactWorkspace prelude mounts relative
+ let parsed = Parse.parsedWorkspaceRootModule workspace
+ input <- expectRight
+ (Module.typedModuleInput
+ foundation
+ (Module.finalPreludeReadiness prelude)
+ resolver
+ Declaration.FreshValidation
+ parsed
+ [])
+ Module.runTypedModule input >>= \case
+ Module.TypedModuleFailed
+ (Module.TypedActionFailed
+ (Module.TypedExactCompileFailed
+ (Exact.ExactStructureNotVisible
+ location _phrase)))
+ prefix -> do
+ assertEqual "unknown parent line" 5 (locLine location)
+ assertEqual "only the valid structure was published"
+ 1
+ (length
+ (Declaration.pendingModulePrefixBatches prefix))
+ Module.TypedModuleSucceeded{} ->
+ assertFailure "unknown structure parent was accepted"
+ Module.TypedModuleOpenFailed failure ->
+ assertFailure
+ ("invalid structure module did not open: "
+ <> show failure)
+ Module.TypedModuleFailed failure _prefix ->
+ assertFailure
+ ("unexpected invalid structure failure: "
+ <> show failure)
+
compilesExactRelationExpressions :: Assertion
compilesExactRelationExpressions = do
foundation <- expectRight Foundation.checkedFoundation
@@ -1712,14 +1753,17 @@ compilesExactRelationExpressions = do
prover
"test/phase5/exact-relation-expression-missing-pair.tex")
case missingPair of
- Left
- (Api.VerificationTypedModuleError
+ Right
+ ( Api.VerificationCheckingFailure _report
+ (Api.VerificationTypedModuleError
_source
(Module.TypedActionFailed
(Module.TypedExactProofFailed
(ExactProof.ExactProofElaborationFailed
(Exact.ExactGlobalNotVisible location key))))
- prefix) -> do
+ prefix)
+ , _measurements
+ ) -> do
assertEqual "missing ordered-pair provider line"
2
(locLine location)
@@ -1752,7 +1796,7 @@ resolvesSourceOwnedApplication = do
\store -> do
prelude <-
expectRight
- =<< Module.buildFinalPreludeSession
+ =<< acquireFinalPreludeSession
store foundation resolver
mounts <- exactFixtureMounts repository
workspace <- parseFinalExactWorkspace
@@ -1788,14 +1832,17 @@ resolvesSourceOwnedApplication = do
prover
"test/phase5/exact-application-missing.tex")
case missing of
- Left
- (Api.VerificationTypedModuleError
+ Right
+ ( Api.VerificationCheckingFailure _report
+ (Api.VerificationTypedModuleError
_source
(Module.TypedActionFailed
(Module.TypedExactProofFailed
(ExactProof.ExactProofElaborationFailed
(Exact.ExactGlobalNotVisible location key))))
- prefix) -> do
+ prefix)
+ , _measurements
+ ) -> do
assertEqual "unresolved application line" 2 (locLine location)
assertEqual "unresolved application key"
(Semantic.SemanticExpressionFunction
@@ -1826,7 +1873,7 @@ confinesExactQuantifiedTerms = do
\store -> do
prelude <-
expectRight
- =<< Module.buildFinalPreludeSession
+ =<< acquireFinalPreludeSession
store foundation resolver
mounts <- exactFixtureMounts repository
workspace <- parseFinalExactWorkspace
@@ -1856,15 +1903,18 @@ confinesExactQuantifiedTerms = do
prover
"test/phase5/exact-quantified-subject-nested.tex")
case negative of
- Left
- (Api.VerificationTypedModuleError
+ Right
+ ( Api.VerificationCheckingFailure _report
+ (Api.VerificationTypedModuleError
_source
(Module.TypedActionFailed
(Module.TypedExactProofFailed
(ExactProof.ExactProofElaborationFailed
(Exact.ExactQuantifiedTermRequiresStatementSubject
location))))
- prefix) -> do
+ prefix)
+ , _measurements
+ ) -> do
assertEqual "nested quantified term line" 8 (locLine location)
assertEqual "earlier exact definition remains committed"
1
@@ -2307,6 +2357,209 @@ compilesAndReusesProofLocalSetDefinitions =
(Core.CImp left (Core.CImp right Core.CFalsum))
Core.CFalsum
+compilesAndReusesProofLocalFunctionGraphs :: Assertion
+compilesAndReusesProofLocalFunctionGraphs =
+ Temp.withSystemTempDirectory "felix-exact-local-function" \root -> do
+ let relative = "test/phase5/exact-local-function.tex"
+ failedRelative =
+ "test/phase5/exact-local-function-failure.tex"
+ executable = root Posix.</> "vampire"
+ storePath = root Posix.</> "store.sqlite"
+ writeAcceptedFixtureVampire executable
+ foundation <- expectRight Foundation.checkedFoundation
+ bootstrap <-
+ expectRight
+ =<< Module.buildBootstrapPreludeFixture
+ foundation unusedResolver
+ mounts <- exactFixtureMounts =<< getCurrentDirectory
+ workspace <- parseExactWorkspace bootstrap mounts relative
+ observations <- newIORef []
+ let resolver = Declaration.vampireResolver \prepared -> do
+ let problem =
+ Provers.preparedTypedProverLogicalProblem prepared
+ premises =
+ [ ( Backend.typedProblemRoute problem
+ , fmap snd
+ (Vector.toList
+ (Backend.supportedPropositionSupport
+ proposition))
+ , Backend.supportedPropositionTerm proposition
+ )
+ | premise <-
+ Vector.toList
+ (Backend.typedProblemLocalPremises problem)
+ , let proposition =
+ Backend.typedLocalPremiseProposition premise
+ ]
+ modifyIORef' observations (<> premises)
+ runNoLoggingT
+ (Provers.runPreparedTypedProver
+ (Provers.vampire
+ executable
+ Provers.defaultTimeLimit
+ Provers.defaultMemoryLimit)
+ prepared)
+ freshModules <-
+ compileParsedWorkspaceWithValidation
+ foundation bootstrap resolver
+ Declaration.FreshValidation workspace
+ allObserved <- readIORef observations
+ let observed =
+ [ (route, proposition)
+ | (route, support, proposition) <- allObserved
+ , support == [Core.TySet, Core.TySet]
+ , isJust (localFunctionPair proposition)
+ ]
+ assertBool
+ ("the local graph characteristic reaches a discharge: "
+ <> show allObserved)
+ (not (null observed))
+ for_ observed \(route, proposition) -> do
+ assertEqual "local function characteristic stays on FOF"
+ Backend.RouteFof route
+ assertExactLocalFunctionCharacteristic proposition
+ freshRoot <- sole "fresh local-function root"
+ (take 1 (reverse freshModules))
+ rootBatch <- sole "local function publishes only its theorem"
+ (drop 1
+ (Declaration.pendingModulePrefixBatches
+ (Module.sealedTypedModulePrefix freshRoot)))
+ assertEqual "local function publishes no object"
+ [] (Declaration.committedBatchObjects rootBatch)
+ assertEqual "local function publishes only its theorem"
+ 1
+ (length
+ (Declaration.committedBatchPropositions rootBatch))
+ assertEqual "local function publishes no semantic binding"
+ []
+ (Semantic.semanticEnvironmentBindings
+ (Semantic.declarationDeltaEnvironment
+ (Declaration.committedBatchDelta rootBatch)))
+ rootFact <- sole "local-function theorem"
+ (Semantic.declarationDeltaFacts
+ (Declaration.committedBatchDelta rootBatch))
+ assertEqual "local-function theorem remains clean"
+ Authority.cleanAuthoritySafety
+ (Authority.factAuthoritySafety
+ (Semantic.semanticFactAuthority rootFact))
+
+ bracket
+ (snd <$> (Store.openStore storePath
+ (Identity.theoryId foundation) >>= expectRight))
+ Store.closeStore
+ \store -> do
+ traverse_
+ (expectRightIO
+ . Store.writePendingModulePrefix store
+ . Module.sealedTypedModulePrefix)
+ freshModules
+ let validation =
+ Declaration.WarmValidation
+ (Declaration.validationLookup
+ (expectRightIO
+ . Store.loadProofValidation store)
+ (expectRightIO
+ . Store.loadDeclarationValidation store))
+ warmRuns <- newIORef (0 :: Int)
+ warmModules <-
+ compileParsedWorkspaceWithValidation
+ foundation bootstrap
+ (countingAcceptedResolver executable warmRuns)
+ validation workspace
+ assertEqual "warm local-function graph skips Vampire"
+ 0 =<< readIORef warmRuns
+ warmRoot <- sole "warm local-function root"
+ (take 1 (reverse warmModules))
+ assertEqual "warm local-function semantic interface"
+ (Module.sealedTypedModuleSemantic freshRoot)
+ (Module.sealedTypedModuleSemantic warmRoot)
+ assertEqual "warm local-function prefix"
+ (Declaration.pendingModulePrefixCurrent
+ (Module.sealedTypedModulePrefix freshRoot))
+ (Declaration.pendingModulePrefixCurrent
+ (Module.sealedTypedModulePrefix warmRoot))
+
+ failedWorkspace <-
+ parseExactWorkspace bootstrap mounts failedRelative
+ failedInput <- expectRight
+ (Module.typedModuleInput
+ foundation
+ (Module.bootstrapPreludeReadiness bootstrap)
+ unusedResolver
+ Declaration.FreshValidation
+ (Parse.parsedWorkspaceRootModule failedWorkspace)
+ [])
+ Module.runTypedModule failedInput >>= \case
+ Module.TypedModuleFailed
+ (Module.TypedActionFailed
+ (Module.TypedExactProofFailed
+ (ExactProof.ExactProofElaborationFailed
+ (Exact.ExactFreeVariable location
+ (Raw.NamedVar "f")))))
+ prefix -> do
+ assertEqual "self-reference rejection line"
+ 6 (locLine location)
+ assertBool "failed local function publishes no theorem"
+ (null
+ (Declaration.pendingModulePrefixBatches prefix))
+ Module.TypedModuleSucceeded{} ->
+ assertFailure "self-referential local function was accepted"
+ Module.TypedModuleOpenFailed failure ->
+ assertFailure
+ ("local-function failure fixture did not open: "
+ <> show failure)
+ Module.TypedModuleFailed failure _prefix ->
+ assertFailure
+ ("unexpected local-function failure: "
+ <> show failure)
+ where
+ assertExactLocalFunctionCharacteristic proposition = do
+ pair <-
+ maybe
+ (assertFailure "local function characteristic has wrong shape")
+ pure
+ (localFunctionPair proposition)
+ assertEqual "local function uses the exact replacement characteristic"
+ (expectedLocalFunctionCharacteristic pair)
+ proposition
+
+ localFunctionPair proposition =
+ case Set.toList (Core.canonicalTermGlobals proposition) of
+ [pair]
+ | proposition == expectedLocalFunctionCharacteristic pair ->
+ Just pair
+ _ ->
+ Nothing
+
+ expectedLocalFunctionCharacteristic pair =
+ Core.CForall Core.TySet
+ (Core.CEq Core.TyProp
+ (member (Core.CBound 0) (Core.CBound 1))
+ (existsP
+ (andP
+ (member (Core.CBound 0) (Core.CBound 3))
+ (Core.CEq Core.TySet
+ (Core.CBound 1)
+ (Core.CApp
+ (Core.CApp
+ (Core.CGlobal pair)
+ (Core.CBound 0))
+ (Core.CBound 0))))))
+
+ member element set =
+ Core.CApp
+ (Core.CApp (Core.CIntrinsic Core.Member) element)
+ set
+
+ andP left right =
+ notP (Core.CImp left (notP right))
+
+ existsP proposition =
+ notP (Core.CForall Core.TySet (notP proposition))
+
+ notP proposition =
+ Core.CImp proposition Core.CFalsum
+
confinesTerminalExactContradiction :: Assertion
confinesTerminalExactContradiction =
Temp.withSystemTempDirectory "felix-exact-contradiction" \directory -> do
@@ -3210,7 +3463,8 @@ assertExactDatatypeModule label sealed = do
(\binding ->
case Semantic.semanticGlobalBindingTarget binding of
Semantic.GlobalReference{} -> True
- Semantic.TransparentExpansion{} -> False)
+ Semantic.TransparentExpansion{} -> False
+ Semantic.ContextualTransparentExpansion{} -> False)
bindings)
assertEqual (label <> " datatype global targets")
(Set.fromList objectIds)
@@ -4537,9 +4791,6 @@ loadsCachedExactProducerForFreshImporter = do
executable
Provers.defaultTimeLimit
Provers.defaultMemoryLimit
- resolver = Declaration.vampireResolver \prepared ->
- runNoLoggingT
- (Provers.runPreparedTypedProver prover prepared)
verify mode source =
runNoLoggingT
(Api.verifyWithObserverAndStoreMode
@@ -4553,10 +4804,12 @@ loadsCachedExactProducerForFreshImporter = do
"test/phase5/exact-importer.tex"
assertTypedSuccess "fresh producer" producer
assertTypedSuccess "warm producer/fresh importer" importer
+ memo <- Store.newStoreMemo store
prelude <-
expectRight
- =<< Module.buildFinalPreludeSession
- store foundation resolver
+ =<< Module.acquireFinalPreludeSession
+ memo store foundation unusedResolver
+ preludeVisits <- Store.storeMemoVisits memo
repository <- getCurrentDirectory
mounts <- exactFixtureMounts repository
workspace <- parseFinalExactWorkspace
@@ -4566,11 +4819,11 @@ loadsCachedExactProducerForFreshImporter = do
(Parse.parsedWorkspaceImportedBeforeImporter workspace)
preludeSemantic =
Module.sealedTypedModuleSemantic
- (Module.migrationPreludeModule prelude)
+ (Module.finalPreludeModule prelude)
preludeId =
Semantic.semanticInterfaceAssertedId preludeSemantic
theory = Identity.theoryId foundation
- loadInstallation memo parsed direct = do
+ loadInstallation parsed direct = do
key <- expectRight
(Semantic.moduleArtifactKey
(moduleName (Parse.parsedModuleAddress parsed))
@@ -4598,16 +4851,25 @@ loadsCachedExactProducerForFreshImporter = do
]
case parsedModules of
[producerParsed, importerParsed] -> do
- memo <- Store.newStoreMemo store
producerInstallation <-
- loadInstallation memo producerParsed [preludeId]
+ loadInstallation producerParsed [preludeId]
+ producerVisits <- Store.storeMemoVisits memo
+ assertEqual "ordinary root adds one artifact validation"
+ (Store.storeArtifactsValidated preludeVisits + 1)
+ (Store.storeArtifactsValidated producerVisits)
+ assertEqual "ordinary root reuses prelude syntax validation"
+ (Store.storeSyntaxRowsValidated preludeVisits + 1)
+ (Store.storeSyntaxRowsValidated producerVisits)
+ assertEqual "ordinary root reuses prelude semantic validation"
+ (Store.storeSemanticRowsValidated preludeVisits + 1)
+ (Store.storeSemanticRowsValidated producerVisits)
let producerSemanticId =
Semantic.semanticInterfaceAssertedId
(Store.cachedInstallationSemantic
producerInstallation)
importerInstallation <-
loadInstallation
- memo importerParsed [preludeId, producerSemanticId]
+ importerParsed [preludeId, producerSemanticId]
case ( environmentBindings producerInstallation
, environmentBindings importerInstallation
) of
@@ -4666,6 +4928,832 @@ loadsCachedExactProducerForFreshImporter = do
<> show (length modules))
Store.closeStore store
+selectsConcurrentModuleFailureDeterministically :: Assertion
+selectsConcurrentModuleFailureDeterministically = do
+ foundation <- expectRight Foundation.checkedFoundation
+ Temp.withSystemTempDirectory "felix-concurrent-module-failure" \root -> do
+ let executable = root Posix.</> "vampire"
+ source = "test/phase7/concurrent-failure-root.tex"
+ prover =
+ Provers.vampire
+ executable
+ Provers.defaultTimeLimit
+ Provers.defaultMemoryLimit
+ ignored =
+ Api.verificationRequestObserver
+ (\_position _request -> pure ())
+ select amount =
+ Provers.selectEffectiveJobs
+ (Provers.effectiveJobs amount)
+ (fail "explicit jobs unexpectedly detected processors")
+ reportEntry escape =
+ ( Api.reportedEscapeKind escape
+ , locFile (Api.reportedEscapeLocation escape)
+ , locLine (Api.reportedEscapeLocation escape)
+ )
+ inspect label expectedPositions
+ (result, measurements, positions) = do
+ case result of
+ Api.VerificationFailure report failed -> do
+ assertEqual (label <> " selected earlier failure")
+ "test/phase7/concurrent-earlier.tex"
+ (locFile (Api.failedVerificationLocation failed))
+ assertEqual (label <> " admitted source prefix")
+ [ ( Api.ReportedSourceAxiom
+ , "test/phase7/concurrent-earlier.tex"
+ , 1
+ )
+ ]
+ (reportEntry
+ <$> Api.verificationDirectEscapes report)
+ other ->
+ assertFailure
+ (label <> " did not reject deterministically: "
+ <> show other)
+ assertEqual (label <> " executed only sibling obligations")
+ expectedPositions
+ (sort
+ [ ( Provers.workPositionModuleOrdinal position
+ , Provers.workPositionLocalRequestOrdinal position
+ )
+ | position <- positions
+ ])
+ pure measurements
+ runCase label jobsAmount = do
+ let storePath = root Posix.</> (label <> ".sqlite")
+ processLock = root Posix.</> (label <> ".process-lock")
+ processStarted =
+ root Posix.</> (label <> ".process-started")
+ writeAcceptedFixtureVampire executable
+ (_startup, store) <-
+ Store.openStore storePath (Identity.theoryId foundation)
+ >>= expectRight
+ bracket (pure store) Store.closeStore \openStore -> do
+ -- Seed only the final prelude. The unsupported ordinary
+ -- module cannot publish a root.
+ void
+ (runNoLoggingT
+ (Api.verifyMeasuredWithObserverAndStoreMode
+ openStore
+ Api.WarmStoreValidation
+ ignored
+ prover
+ "test/phase3/typed-unsupported.tex")
+ >>= expectRight)
+ writeFile executable
+ (unlines
+ [ "#!/bin/sh"
+ , "while ! mkdir \"" <> processLock
+ <> "\" 2>/dev/null; do sleep 0.01; done"
+ , "trap 'rmdir \"" <> processLock
+ <> "\"' EXIT"
+ , ": > \"" <> processStarted <> "\""
+ , "cat >/dev/null"
+ , "printf '%s\\n' '% SZS status CounterSatisfiable for concurrent-fixture'"
+ ])
+ permissions <- getPermissions executable
+ setPermissions executable
+ (setOwnerExecutable True permissions)
+ positionsRef <- newIORef []
+ let observer =
+ Api.verificationRequestObserver
+ (\position _request -> do
+ atomicModifyIORef' positionsRef
+ (\positions ->
+ (position : positions, ()))
+ when
+ (jobsAmount > 1
+ && Provers.workPositionModuleOrdinal
+ position == 1)
+ (waitForFileSignal
+ "later module process"
+ processStarted))
+ jobs <- select jobsAmount
+ (result, measurements) <-
+ runNoLoggingT
+ (Api.verifyMeasuredWithObserverAndStoreModeAndJobs
+ openStore
+ Api.WarmStoreValidation
+ jobs
+ observer
+ prover
+ source)
+ >>= expectRight
+ positions <- readIORef positionsRef
+ pure (result, measurements, positions)
+ parallel <-
+ runCase "parallel" 2
+ >>= inspect "parallel" [(1, 1), (2, 1)]
+ sequential <-
+ runCase "sequential" 1
+ >>= inspect "sequential" [(1, 1)]
+ assertEqual "parallel module checker bound"
+ 2
+ (Api.verificationMaximumLiveModuleCheckers parallel)
+ assertEqual "parallel Vampire bound"
+ 2
+ (Api.verificationMaximumLiveVampireProcesses parallel)
+ assertEqual "sequential module checker reference"
+ 1
+ (Api.verificationMaximumLiveModuleCheckers sequential)
+ assertEqual "sequential Vampire reference"
+ 1
+ (Api.verificationMaximumLiveVampireProcesses sequential)
+
+waitForFileSignal :: String -> FilePath -> Assertion
+waitForFileSignal label path = do
+ guarded <- Timeout.timeout 10000000 loop
+ case guarded of
+ Just () ->
+ pure ()
+ Nothing ->
+ assertFailure (label <> " was not observed")
+ where
+ loop = do
+ exists <- doesFileExist path
+ if exists
+ then pure ()
+ else do
+ threadDelay 10000
+ loop
+
+batchesStructureObligationsAtomically :: Assertion
+batchesStructureObligationsAtomically = do
+ foundation <- expectRight Foundation.checkedFoundation
+ Temp.withSystemTempDirectory "felix-structure-obligation-batch" \root -> do
+ let storePath = root Posix.</> "store.sqlite"
+ executable = root Posix.</> "vampire"
+ unavailable = root Posix.</> "must-not-run-vampire"
+ source = "test/phase7/structure-obligation-batch.tex"
+ prover path =
+ Provers.vampire
+ path
+ Provers.defaultTimeLimit
+ Provers.defaultMemoryLimit
+ select amount =
+ Provers.selectEffectiveJobs
+ (Provers.effectiveJobs amount)
+ (fail "explicit jobs unexpectedly detected processors")
+ run openStore jobs observer vampireCommand =
+ runNoLoggingT
+ (Api.verifyMeasuredWithObserverAndStoreModeAndJobs
+ openStore
+ Api.WarmStoreValidation
+ jobs
+ observer
+ vampireCommand
+ source)
+ >>= expectRight
+ inspectFailure label positions (result, measurements) = do
+ case result of
+ Api.VerificationFailure report failed -> do
+ assertEqual (label <> " selects first consequence")
+ (source, 12)
+ ( locFile (Api.failedVerificationLocation failed)
+ , locLine (Api.failedVerificationLocation failed)
+ )
+ assertEqual (label <> " retains preceding prefix")
+ [(Api.ReportedSourceAxiom, source, 1)]
+ [ ( Api.reportedEscapeKind escape
+ , locFile (Api.reportedEscapeLocation escape)
+ , locLine (Api.reportedEscapeLocation escape)
+ )
+ | escape <- Api.verificationDirectEscapes report
+ ]
+ other ->
+ assertFailure
+ (label <> " did not reject its structure batch: "
+ <> show other)
+ assertEqual (label <> " assigns consecutive positions")
+ [(1, 1), (1, 2)]
+ (sort positions)
+ assertEqual (label <> " observes one two-member batch")
+ (1, 2, 2)
+ ( Api.verificationObligationBatchCount measurements
+ , Api.verificationPreparedObligationCount measurements
+ , Api.verificationMaximumObligationBatchSize measurements
+ )
+ pure measurements
+ writeAcceptedFixtureVampire executable
+ (_startup, store) <-
+ Store.openStore storePath (Identity.theoryId foundation)
+ >>= expectRight
+ bracket (pure store) Store.closeStore \openStore -> do
+ let ignored =
+ Api.verificationRequestObserver
+ (\_position _request -> pure ())
+ -- Seed only the confined prelude so this fixture observes exactly
+ -- the ordinary structure module's ready batch.
+ void
+ (runNoLoggingT
+ (Api.verifyMeasuredWithObserverAndStoreMode
+ openStore
+ Api.WarmStoreValidation
+ ignored
+ (prover executable)
+ "test/phase3/typed-unsupported.tex")
+ >>= expectRight)
+ parallelJobs <- select 2
+ parallelPositions <- newIORef []
+ firstStarted <- newEmptyTMVarIO
+ secondStarted <- newEmptyTMVarIO
+ releaseFirst <- newEmptyTMVarIO
+ let laterCompleted = root Posix.</> "later-completed"
+ writeRejectingVampire executable laterCompleted
+ let parallelObserver =
+ Api.verificationRequestObserver \position _request -> do
+ let ordinal =
+ Provers.workPositionLocalRequestOrdinal position
+ atomicModifyIORef' parallelPositions
+ (\positions ->
+ ( ( Provers.workPositionModuleOrdinal position
+ , ordinal
+ ) : positions
+ , ()
+ ))
+ case ordinal of
+ 1 -> do
+ atomically (putTMVar firstStarted ())
+ atomically (takeTMVar releaseFirst)
+ 2 ->
+ atomically (putTMVar secondStarted ())
+ _ ->
+ assertFailure
+ ("unexpected structure request ordinal: "
+ <> show ordinal)
+ withAsync
+ (run openStore parallelJobs parallelObserver
+ (prover executable))
+ \verification -> do
+ void
+ (awaitSignal "first structure request"
+ (atomically (takeTMVar firstStarted)))
+ void
+ (awaitSignal "second structure request"
+ (atomically (takeTMVar secondStarted)))
+ -- Only the later member can reach the subprocess while
+ -- the first observer is gated. Its completed signal
+ -- therefore establishes reversed wall-clock completion.
+ waitForFileSignal
+ "later structure consequence"
+ laterCompleted
+ atomically (putTMVar releaseFirst ())
+ parallelResult <- wait verification
+ positions <- readIORef parallelPositions
+ parallelMeasurements <-
+ inspectFailure "parallel"
+ positions parallelResult
+ assertEqual "parallel obligations overlap"
+ 2
+ (Api.verificationMaximumLiveVampireProcesses
+ parallelMeasurements)
+
+ sequentialJobs <- select 1
+ sequentialPositions <- newIORef []
+ let sequentialCompleted = root Posix.</> "sequential-completed"
+ writeRejectingVampire executable sequentialCompleted
+ let sequentialObserver =
+ Api.verificationRequestObserver \position _request ->
+ atomicModifyIORef' sequentialPositions
+ (\positions ->
+ ( ( Provers.workPositionModuleOrdinal position
+ , Provers.workPositionLocalRequestOrdinal
+ position
+ ) : positions
+ , ()
+ ))
+ sequentialResult <-
+ run openStore sequentialJobs sequentialObserver
+ (prover executable)
+ sequentialObserved <- readIORef sequentialPositions
+ sequentialMeasurements <-
+ inspectFailure "sequential"
+ sequentialObserved sequentialResult
+ assertEqual "sequential batch is the semantic reference"
+ 1
+ (Api.verificationMaximumLiveVampireProcesses
+ sequentialMeasurements)
+
+ -- A rejected sibling wrote neither validation nor a module root:
+ -- the complete batch executes again, while the earlier source
+ -- axiom remains the admitted prefix. A subsequent hit executes
+ -- no request at all.
+ writeAcceptedFixtureVampire executable
+ acceptedPositions <- newIORef []
+ let acceptedObserver =
+ Api.verificationRequestObserver \position _request ->
+ modifyIORef' acceptedPositions
+ (position :)
+ (accepted, acceptedMeasurements) <-
+ run openStore parallelJobs acceptedObserver
+ (prover executable)
+ case accepted of
+ Api.VerificationCompleted report _presentation ->
+ assertEqual "successful retry retains only source axiom"
+ [Api.ReportedSourceAxiom]
+ (Api.reportedEscapeKind
+ <$> Api.verificationDirectEscapes report)
+ other ->
+ assertFailure
+ ("successful structure retry failed: " <> show other)
+ acceptedObserved <- readIORef acceptedPositions
+ assertEqual "successful retry executes the complete batch"
+ 2
+ (length acceptedObserved)
+ assertEqual "failed declaration published no root"
+ (1, 1)
+ ( Api.verificationModuleRootHitCount acceptedMeasurements
+ , Api.verificationModuleRootMissCount acceptedMeasurements
+ )
+ let forbiddenObserver =
+ Api.verificationRequestObserver \position _request ->
+ assertFailure
+ ("warm structure batch invoked Vampire at "
+ <> show position)
+ (warm, warmMeasurements) <-
+ run openStore parallelJobs forbiddenObserver
+ (prover unavailable)
+ case warm of
+ Api.VerificationCompleted{} -> pure ()
+ other ->
+ assertFailure
+ ("warm structure batch did not install: " <> show other)
+ assertEqual "warm module hit executes no batch"
+ (2, 0, 0)
+ ( Api.verificationModuleRootHitCount warmMeasurements
+ , Api.verificationModuleRootMissCount warmMeasurements
+ , Api.verificationVampireRunCount warmMeasurements
+ )
+ where
+ awaitSignal label action = do
+ result <- Timeout.timeout 10000000 action
+ maybe
+ (assertFailure (label <> " was not observed")
+ >> fail "unreachable")
+ pure
+ result
+
+ writeRejectingVampire executable completed = do
+ writeFile executable
+ (unlines
+ [ "#!/bin/sh"
+ , "cat >/dev/null"
+ , ": > \"" <> completed <> "\""
+ , "printf '%s\\n' '% SZS status CounterSatisfiable for structure-batch-fixture'"
+ ])
+ permissions <- getPermissions executable
+ setPermissions executable
+ (setOwnerExecutable True permissions)
+
+keepsDependentProofObligationsSequential :: Assertion
+keepsDependentProofObligationsSequential =
+ Temp.withSystemTempDirectory "felix-dependent-proof-chain" \root -> do
+ repository <- getCurrentDirectory
+ foundation <- expectRight Foundation.checkedFoundation
+ bootstrap <-
+ expectRight
+ =<< Module.buildBootstrapPreludeFixture
+ foundation
+ unusedResolver
+ mounts <- exactFixtureMounts repository
+ workspace <- parseExactWorkspace
+ bootstrap mounts "test/phase7/dependent-proof-chain.tex"
+ let executable = root Posix.</> "vampire"
+ writeAcceptedFixtureVampire executable
+ firstSubmitted <- newEmptyTMVarIO
+ secondSubmitted <- newEmptyTMVarIO
+ releaseFirst <- newEmptyTMVarIO
+ calls <- newIORef (0 :: Int)
+ let resolver =
+ Declaration.vampireBatchResolver \tasks -> do
+ assertEqual "dependent proof resolver batch is singleton"
+ 1
+ (NonEmpty.length tasks)
+ ordinal <- atomicModifyIORef' calls
+ (\current -> (current + 1, current + 1))
+ case ordinal of
+ 1 -> do
+ atomically (putTMVar firstSubmitted ())
+ atomically (takeTMVar releaseFirst)
+ 2 ->
+ atomically (putTMVar secondSubmitted ())
+ _ ->
+ assertFailure
+ ("unexpected dependent proof request: "
+ <> show ordinal)
+ traverse
+ (\prepared ->
+ runNoLoggingT
+ (Provers.runPreparedTypedProver
+ (Provers.vampire
+ executable
+ Provers.defaultTimeLimit
+ Provers.defaultMemoryLimit)
+ prepared))
+ tasks
+ withAsync
+ (compileParsedWorkspaceWithResolver
+ foundation bootstrap resolver workspace)
+ \checking -> do
+ void
+ (awaitSignal "local subclaim request"
+ (atomically (takeTMVar firstSubmitted)))
+ atomically (tryReadTMVar secondSubmitted) >>= \case
+ Nothing -> pure ()
+ Just () ->
+ assertFailure
+ "proof continuation was submitted before its local claim"
+ atomically (putTMVar releaseFirst ())
+ void
+ (awaitSignal "dependent continuation request"
+ (atomically (takeTMVar secondSubmitted)))
+ sealed <- wait checking
+ assertEqual "dependent proof module sealed" 1 (length sealed)
+ readIORef calls
+ >>= assertEqual "dependent proof executed two ordered requests" 2
+ where
+ awaitSignal label action = do
+ result <- Timeout.timeout 10000000 action
+ maybe
+ (assertFailure (label <> " was not observed")
+ >> fail "unreachable")
+ pure
+ result
+
+schedulesDiamondAfterSealedImports :: Assertion
+schedulesDiamondAfterSealedImports = do
+ foundation <- expectRight Foundation.checkedFoundation
+ Temp.withSystemTempDirectory "felix-concurrent-diamond" \root -> do
+ let storePath = root Posix.</> "store.sqlite"
+ executable = root Posix.</> "vampire"
+ unavailable = root Posix.</> "must-not-run-vampire"
+ source = "test/phase7/diamond-root.tex"
+ prover path =
+ Provers.vampire
+ path
+ Provers.defaultTimeLimit
+ Provers.defaultMemoryLimit
+ ignored =
+ Api.verificationRequestObserver
+ (\_position _request -> pure ())
+ writeAcceptedFixtureVampire executable
+ (_startup, store) <-
+ Store.openStore storePath (Identity.theoryId foundation)
+ >>= expectRight
+ bracket (pure store) Store.closeStore \openStore -> do
+ -- Acquire the final prelude before introducing scheduler gates.
+ void
+ (runNoLoggingT
+ (Api.verifyMeasuredWithObserverAndStoreMode
+ openStore
+ Api.WarmStoreValidation
+ ignored
+ (prover executable)
+ "test/phase3/typed-unsupported.tex")
+ >>= expectRight)
+ jobs <- Provers.selectEffectiveJobs
+ (Provers.effectiveJobs 2)
+ (fail "explicit jobs unexpectedly detected processors")
+ baseStarted <- newEmptyTMVarIO
+ branchStarted <- newTQueueIO
+ rootStarted <- newEmptyTMVarIO
+ releaseBase <- newTVarIO False
+ releaseBranches <- newTVarIO False
+ let awaitRelease released =
+ atomically (readTVar released >>= check)
+ observer =
+ Api.verificationRequestObserver
+ (\position _request ->
+ case Provers.workPositionModuleOrdinal position of
+ 1 -> do
+ atomically (putTMVar baseStarted ())
+ awaitRelease releaseBase
+ ordinal@2 -> do
+ atomically
+ (writeTQueue branchStarted ordinal)
+ awaitRelease releaseBranches
+ ordinal@3 -> do
+ atomically
+ (writeTQueue branchStarted ordinal)
+ awaitRelease releaseBranches
+ 4 ->
+ atomically (putTMVar rootStarted ())
+ _ ->
+ pure ())
+ verify vampireCommand requestObserver =
+ runNoLoggingT
+ (Api.verifyMeasuredWithObserverAndStoreModeAndJobs
+ openStore
+ Api.WarmStoreValidation
+ jobs
+ requestObserver
+ vampireCommand
+ source)
+ >>= expectRight
+ await label action = do
+ result <- Timeout.timeout 10000000 action
+ maybe
+ (assertFailure (label <> " was not observed")
+ >> fail "unreachable")
+ pure
+ result
+ withAsync (verify (prover executable) observer) \verification -> do
+ void (await "base request" (atomically (takeTMVar baseStarted)))
+ threadDelay 50000
+ atomically (tryReadTQueue branchStarted) >>= \case
+ Nothing -> pure ()
+ Just ordinal ->
+ assertFailure
+ ("dependent module started before base seal: "
+ <> show ordinal)
+ atomically (writeTVar releaseBase True)
+ firstBranch <- await "first branch"
+ (atomically (readTQueue branchStarted))
+ secondBranch <- await "second branch"
+ (atomically (readTQueue branchStarted))
+ assertEqual "both diamond branches became ready together"
+ [2, 3]
+ (sort [firstBranch, secondBranch])
+ atomically (tryReadTMVar rootStarted) >>= \case
+ Nothing -> pure ()
+ Just () ->
+ assertFailure
+ "diamond root started before both branch seals"
+ atomically (writeTVar releaseBranches True)
+ void (await "diamond root" (atomically (takeTMVar rootStarted)))
+ (coldResult, coldMeasurements) <- wait verification
+ case coldResult of
+ Api.VerificationCompleted{} -> pure ()
+ other ->
+ assertFailure
+ ("cold diamond did not complete: " <> show other)
+ assertEqual "cold diamond module misses plus prelude hit"
+ (1, 4)
+ ( Api.verificationModuleRootHitCount coldMeasurements
+ , Api.verificationModuleRootMissCount coldMeasurements
+ )
+ let forbiddenObserver =
+ Api.verificationRequestObserver
+ (\position _request ->
+ assertFailure
+ ("warm diamond invoked Vampire at "
+ <> show position))
+ (warmResult, warmMeasurements) <-
+ verify (prover unavailable) forbiddenObserver
+ case warmResult of
+ Api.VerificationCompleted{} -> pure ()
+ other ->
+ assertFailure
+ ("warm diamond did not install: " <> show other)
+ assertEqual "warm diamond installs each distinct root"
+ (5, 0)
+ ( Api.verificationModuleRootHitCount warmMeasurements
+ , Api.verificationModuleRootMissCount warmMeasurements
+ )
+ assertEqual "warm diamond runs no prover"
+ 0
+ (Api.verificationVampireRunCount warmMeasurements)
+
+reportsAdmittedSourceEscapes :: Assertion
+reportsAdmittedSourceEscapes = do
+ foundation <- expectRight Foundation.checkedFoundation
+ Temp.withSystemTempDirectory "felix-admitted-source-report" \root -> do
+ let storePath = root Posix.</> "store.sqlite"
+ executable = root Posix.</> "vampire"
+ unavailable = root Posix.</> "must-not-run-vampire"
+ observer =
+ Api.verificationRequestObserver \_ordinal _request -> pure ()
+ prover path =
+ Provers.vampire
+ path
+ Provers.defaultTimeLimit
+ Provers.defaultMemoryLimit
+ writeAcceptedFixtureVampire executable
+ (_startup, store) <-
+ Store.openStore storePath (Identity.theoryId foundation)
+ >>= expectRight
+ bracket (pure store) Store.closeStore \openStore -> do
+ let verify mode vampirePath source =
+ runNoLoggingT
+ (Api.verifyMeasuredWithObserverAndStoreMode
+ openStore
+ mode
+ observer
+ (prover vampirePath)
+ source)
+ >>= expectRight
+ reportEntries =
+ fmap
+ (\escape ->
+ ( Api.reportedEscapeKind escape
+ , locFile (Api.reportedEscapeLocation escape)
+ , locLine (Api.reportedEscapeLocation escape)
+ ))
+ . Api.verificationDirectEscapes
+ expectedConsumer =
+ [ ( Api.ReportedSourceAxiom
+ , "test/phase5/exact-escape-producer.tex"
+ , 1
+ )
+ , ( Api.ReportedOmitted
+ , "test/phase5/exact-escape-producer.tex"
+ , 9
+ )
+ , ( Api.ReportedOmitted
+ , "test/phase5/exact-escape-consumer.tex"
+ , 35
+ )
+ ]
+ (freshResult, freshMeasurements) <-
+ verify
+ Api.FreshStoreValidation
+ executable
+ "test/phase5/exact-escape-consumer.tex"
+ freshReport <- case freshResult of
+ Api.CompletedWithExplicitGaps report _presentation -> pure report
+ other ->
+ assertFailure
+ ("fresh escape report did not complete with gaps: "
+ <> show other)
+ >> fail "unreachable"
+ assertEqual "fresh direct escapes"
+ expectedConsumer
+ (reportEntries freshReport)
+ assertEqual "cold acquisition includes prelude and two modules"
+ (0, 3)
+ ( Api.verificationModuleRootHitCount freshMeasurements
+ , Api.verificationModuleRootMissCount freshMeasurements
+ )
+
+ (warmResult, warmMeasurements) <-
+ verify
+ Api.WarmStoreValidation
+ unavailable
+ "test/phase5/exact-escape-consumer.tex"
+ warmReport <- case warmResult of
+ Api.CompletedWithExplicitGaps report _presentation -> pure report
+ other ->
+ assertFailure
+ ("warm escape report did not complete with gaps: "
+ <> show other)
+ >> fail "unreachable"
+ assertEqual "warm report uses rebound current locations"
+ freshReport warmReport
+ assertEqual "warm acquisition includes prelude and two modules"
+ (3, 0)
+ ( Api.verificationModuleRootHitCount warmMeasurements
+ , Api.verificationModuleRootMissCount warmMeasurements
+ )
+ assertEqual "warm root hit invokes no Vampire process"
+ 0
+ (Api.verificationVampireRunCount warmMeasurements)
+
+ void
+ (verify
+ Api.FreshStoreValidation
+ executable
+ "test/phase5/exact-source-axiom.tex")
+ (failedResult, failedMeasurements) <-
+ verify
+ Api.WarmStoreValidation
+ unavailable
+ "test/phase6/admitted-prefix-failure.tex"
+ failedReport <- case failedResult of
+ Api.VerificationCheckingFailure report _failure -> pure report
+ other ->
+ assertFailure
+ ("typed suffix failure was not report-bearing: "
+ <> show other)
+ >> fail "unreachable"
+ assertEqual "failure report retains only admitted source prefix"
+ (take 2 expectedConsumer
+ <> [ ( Api.ReportedOmitted
+ , "test/phase6/admitted-prefix-failure.tex"
+ , 7
+ )
+ ])
+ (reportEntries failedReport)
+ assertEqual "failed root is not counted as acquired"
+ (2, 0)
+ ( Api.verificationModuleRootHitCount failedMeasurements
+ , Api.verificationModuleRootMissCount failedMeasurements
+ )
+ assertEqual "cached prefix failure invokes no Vampire process"
+ 0
+ (Api.verificationVampireRunCount failedMeasurements)
+
+classifiesTypedVampireFailures :: Assertion
+classifiesTypedVampireFailures = do
+ foundation <- expectRight Foundation.checkedFoundation
+ Temp.withSystemTempDirectory "felix-typed-failure-classification" \root -> do
+ let storePath = root Posix.</> "store.sqlite"
+ executable = root Posix.</> "vampire"
+ observer =
+ Api.verificationRequestObserver \_ordinal _request -> pure ()
+ prover =
+ Provers.vampire
+ executable
+ Provers.defaultTimeLimit
+ Provers.defaultMemoryLimit
+ writeAcceptedFixtureVampire executable
+ (_startup, store) <-
+ Store.openStore storePath (Identity.theoryId foundation)
+ >>= expectRight
+ bracket (pure store) Store.closeStore \openStore -> do
+ let verify source =
+ runNoLoggingT
+ (Api.verifyMeasuredWithObserverAndStoreMode
+ openStore
+ Api.WarmStoreValidation
+ observer
+ prover
+ source)
+ >>= expectRight
+ writeProtocol lines = do
+ writeFile executable
+ (unlines (["#!/bin/sh", "cat >/dev/null"] <> lines))
+ permissions <- getPermissions executable
+ setPermissions executable
+ (setOwnerExecutable True permissions)
+ expectTypedFailure classify = do
+ (result, _measurements) <-
+ verify "test/phase5/exact-runtime-failure.tex"
+ case result of
+ Api.VerificationFailure report failed -> do
+ assertEqual "typed failure has no direct escapes"
+ []
+ (Api.verificationDirectEscapes report)
+ assertEqual "typed failure retains source location"
+ "test/phase5/exact-runtime-failure.tex"
+ (locFile
+ (Api.failedVerificationLocation failed))
+ classify
+ (Api.failedVerificationReason failed)
+ (CommandLine.verificationCommandOutcome result)
+ other ->
+ assertFailure
+ ("typed prover outcome was misclassified: "
+ <> show other)
+
+ -- Populate only the confined prelude. The selected ordinary
+ -- module then remains a miss for each classified live failure.
+ (_preludeResult, _preludeMeasurements) <-
+ verify "test/phase3/typed-unsupported.tex"
+
+ writeProtocol
+ [ "printf '%s\\n' '% SZS status CounterSatisfiable for typed-failure'"
+ , "exit 0"
+ ]
+ expectTypedFailure \reason outcome -> do
+ case reason of
+ Api.CountermodelFailure{} -> pure ()
+ other -> assertFailure ("expected countermodel: " <> show other)
+ case outcome of
+ CommandLine.VerificationRejected{} -> pure ()
+ other -> assertFailure ("expected rejection: " <> show other)
+
+ writeProtocol
+ [ "printf '%s\\n' '% SZS status Timeout for typed-failure'"
+ , "exit 0"
+ ]
+ expectTypedFailure \reason outcome -> do
+ case reason of
+ Api.IndeterminateFailure{} -> pure ()
+ other -> assertFailure ("expected indeterminate result: " <> show other)
+ case outcome of
+ CommandLine.ProverFailed
+ _report _location CommandLine.ProverIndeterminate{} ->
+ pure ()
+ other -> assertFailure ("expected prover failure: " <> show other)
+
+ writeProtocol
+ [ "printf '%s\\n' '% SZS status Theorem for typed-failure'"
+ , "exit 7"
+ ]
+ expectTypedFailure \reason outcome -> do
+ case reason of
+ Api.ProtocolFailure{} -> pure ()
+ other -> assertFailure ("expected protocol failure: " <> show other)
+ case outcome of
+ CommandLine.ProverFailed
+ _report _location CommandLine.ProverProtocolFailure{} ->
+ pure ()
+ other -> assertFailure ("expected prover failure: " <> show other)
+
+ writeFile executable "not executable"
+ permissions <- getPermissions executable
+ setPermissions executable
+ (setOwnerExecutable False permissions)
+ expectTypedFailure \reason outcome -> do
+ case reason of
+ Api.TransportFailure{} -> pure ()
+ other -> assertFailure ("expected transport failure: " <> show other)
+ case outcome of
+ CommandLine.ProverFailed
+ _report _location CommandLine.ProverTransportFailure{} ->
+ pure ()
+ other -> assertFailure ("expected prover failure: " <> show other)
+
retainsExactPrefixBeforeFailure :: Assertion
retainsExactPrefixBeforeFailure = do
result <-
@@ -4675,13 +5763,16 @@ retainsExactPrefixBeforeFailure = do
prover
"test/phase5/exact-failure.tex")
case result of
- Left
- (Api.VerificationTypedModuleError
+ Right
+ ( Api.VerificationCheckingFailure _report
+ (Api.VerificationTypedModuleError
source
(Module.TypedActionFailed
(Module.TypedExactCompileFailed
(Exact.ExactUnsupportedDeclarationBody location)))
- prefix) -> do
+ prefix)
+ , _measurements
+ ) -> do
assertEqual "failed exact source"
"test/phase5/exact-failure.tex"
(safeRelativePathFilePath
@@ -4702,14 +5793,17 @@ retainsExactPrefixBeforeFailure = do
prover
"test/phase5/exact-proof-failure.tex")
case proofFailure of
- Left
- (Api.VerificationTypedModuleError
+ Right
+ ( Api.VerificationCheckingFailure _report
+ (Api.VerificationTypedModuleError
_source
(Module.TypedActionFailed
(Module.TypedExactProofFailed
(ExactProof.ExactProofGoalStatementMismatch
location)))
- prefix) -> do
+ prefix)
+ , _measurements
+ ) -> do
assertEqual "mismatched assumption line" 10 (locLine location)
assertEqual "failed proof publishes no theorem"
1
@@ -4727,12 +5821,15 @@ retainsExactPrefixBeforeFailure = do
prover
"test/phase5/unmatched-proof.tex")
case unmatched of
- Left
- (Api.VerificationTypedModuleError
+ Right
+ ( Api.VerificationCheckingFailure _report
+ (Api.VerificationTypedModuleError
_source
(Module.TypedActionFailed
(Module.TypedUnmatchedProof location))
- prefix) -> do
+ prefix)
+ , _measurements
+ ) -> do
assertEqual "unmatched proof line" 1 (locLine location)
assertEqual "unmatched proof publishes no declaration"
0
@@ -4821,14 +5918,17 @@ rejectsNestedExactSetInduction = do
prover
"test/phase5/exact-induction-nested.tex")
case result of
- Left
- (Api.VerificationTypedModuleError
+ Right
+ ( Api.VerificationCheckingFailure _report
+ (Api.VerificationTypedModuleError
_source
(Module.TypedActionFailed
(Module.TypedExactProofFailed
(ExactProof.ExactProofSetInductionNotOutermost
location)))
- prefix) -> do
+ prefix)
+ , _measurements
+ ) -> do
assertEqual "nested induction line" 7 (locLine location)
assertBool "failed proof publishes no theorem"
(null (Declaration.pendingModulePrefixBatches prefix))
@@ -4854,35 +5954,14 @@ routesProductionVerification =
setPermissions executable
(setOwnerExecutable True permissions)
producer <- verifyFixture executable "test/phase3/typed-producer.tex"
- assertRoute "selected producer"
- Api.TypedVerificationRoute
- producer
- setRoot <- verifyFixture executable "set.tex"
- assertRoute "protected set root"
- Api.TypedVerificationRoute
- setRoot
- natRoot <- verifyFixture executable "nat.tex"
- assertRoute "protected naturals root"
- Api.TypedVerificationRoute
- natRoot
- forM_
- [ ("bipartition", "set/bipartition.tex")
- , ("function", "function.tex")
- , ("Cantor", "set/cantor.tex")
- ]
- \(label, path) ->
- assertRoute ("typed " <> label)
- Api.TypedVerificationRoute
- =<< verifyFixture executable path
+ assertTypedSuccess "exact producer" producer
selectedRuns <- runCount counter
- assertBool "selected roots constructed the final prelude"
+ assertBool "ordinary roots construct the final prelude"
(selectedRuns > 0)
- importer <- verifyFixture executable "test/phase3/legacy-importer.tex"
- assertRoute "unselected importer"
- Api.LegacyVerificationRoute
- importer
- assertEqual "legacy root did not construct the final prelude"
- selectedRuns
+ importer <- verifyFixture executable "test/phase3/typed-importer.tex"
+ assertTypedSuccess "ordinary importer" importer
+ assertBool "every root constructs the final prelude"
+ . (> selectedRuns)
=<< runCount counter
where
verifyFixture executable path =
@@ -4899,16 +5978,6 @@ routesProductionVerification =
runCount path =
length . StrictText.lines . StrictText.pack <$> readFile path
- assertRoute label expected = \case
- Api.VerifiedWithTrustedVampire report ->
- assertEqual label expected (Api.verificationRoute report)
- Api.CompletedWithExplicitGaps report ->
- assertFailure
- (label <> " completed with gaps via "
- <> show (Api.verificationRoute report))
- Api.VerificationFailure failure ->
- assertFailure (label <> " failed: " <> show failure)
-
installsNonemptyImplicitPreludeEvidence :: Assertion
installsNonemptyImplicitPreludeEvidence = do
foundation <- expectRight Foundation.checkedFoundation
@@ -5330,13 +6399,13 @@ parseExactWorkspace bootstrap mounts relative =
relative
parseFinalExactWorkspace
- :: Module.MigrationPreludeSession
+ :: Module.FinalPreludeSession
-> SourceMounts
-> FilePath
-> IO Parse.ParsedSourceWorkspace
parseFinalExactWorkspace prelude mounts relative =
parseExactWorkspaceWithPrelude
- (Module.migrationPreludeModule prelude)
+ (Module.finalPreludeModule prelude)
mounts
relative
@@ -5401,7 +6470,7 @@ compileParsedWorkspaceWithValidation
compileFinalParsedWorkspaceWithResolver
:: Foundation.CheckedFoundation
- -> Module.MigrationPreludeSession
+ -> Module.FinalPreludeSession
-> Declaration.VampireResolver
-> Parse.ParsedSourceWorkspace
-> IO [Module.SealedTypedModule]
@@ -5468,14 +6537,13 @@ compileParsedWorkspaceWithReadiness
assertTypedSuccess :: String -> Api.VerificationResult -> Assertion
assertTypedSuccess label = \case
- Api.VerifiedWithTrustedVampire report ->
- assertEqual label Api.TypedVerificationRoute
- (Api.verificationRoute report)
- Api.CompletedWithExplicitGaps report ->
- assertFailure
- (label <> " completed with gaps via "
- <> show (Api.verificationRoute report))
- Api.VerificationFailure failure ->
+ Api.VerificationCompleted _report _presentation ->
+ pure ()
+ Api.CompletedWithExplicitGaps _report _presentation ->
+ assertFailure (label <> " completed with gaps")
+ Api.VerificationFailure _report failure ->
+ assertFailure (label <> " failed: " <> show failure)
+ Api.VerificationCheckingFailure _report failure ->
assertFailure (label <> " failed: " <> show failure)
sole :: String -> [value] -> IO value
@@ -5494,3 +6562,16 @@ expectRight = \case
expectRightIO :: Show error => IO (Either error value) -> IO value
expectRightIO action =
action >>= expectRight
+
+acquireFinalPreludeSession
+ :: Store.Store
+ -> Foundation.CheckedFoundation
+ -> Declaration.VampireResolver
+ -> IO
+ (Either
+ Module.FinalPreludeReadinessError
+ Module.FinalPreludeSession)
+acquireFinalPreludeSession store foundation resolver = do
+ memo <- Store.newStoreMemo store
+ Module.acquireFinalPreludeSession
+ memo store foundation resolver
diff --git a/source/Test/Unit/Provers.hs b/source/Test/Unit/Provers.hs
index d852755..22a6b5b 100644
--- a/source/Test/Unit/Provers.hs
+++ b/source/Test/Unit/Provers.hs
@@ -2,24 +2,24 @@
module Test.Unit.Provers (unitTests) where
-import Base
+import Base hiding (Empty)
+import Checking.Backend.Problem
+import Checking.Core
import Provers
-import Report.Location (pattern Nowhere)
-import Syntax.Internal
- ( Directness(..)
- , Hypothesis(..)
- , Marker(..)
- , Task(..)
- , pattern Top
- )
import Control.Concurrent (threadDelay)
import Control.Exception (bracket)
import Control.Exception qualified as Exception
import Control.Monad.Logger (runNoLoggingT)
+import Data.IORef
+ ( newIORef
+ , readIORef
+ , writeIORef
+ )
import Data.Set qualified as Set
import Data.Text qualified as Text
import Data.Text.IO qualified as Text
+import Data.Vector qualified as Vector
import System.Directory qualified as Directory
import System.Exit (ExitCode(..))
import System.FilePath.Posix ((</>))
@@ -34,16 +34,162 @@ import Test.Tasty
import Test.Tasty.HUnit
import Text.Read (readMaybe)
import Text.Megaparsec (parseMaybe)
-import UnliftIO.Async (cancel, withAsync)
+import UnliftIO.Async (cancel, mapConcurrently, withAsync)
unitTests :: TestTree
unitTests =
testGroup "Provers"
[ vampireStatusParserTests
, vampireClassifierTests
+ , jobsSelectionTests
+ , vampireExecutorTests
, vampireProcessTests
]
+jobsSelectionTests :: TestTree
+jobsSelectionTests =
+ testGroup "effective jobs"
+ [ testCase "uses a positive override exactly" do
+ detectorCalled <- newIORef False
+ selected <- selectEffectiveJobs
+ (effectiveJobs 3)
+ (writeIORef detectorCalled True >> pure 99)
+ jobsSelectionEffectiveJobs selected
+ `shouldBe` positiveJobs 3
+ jobsSelectionDetectedProcessors selected `shouldBe` Nothing
+ jobsSelectionWasOverridden selected `shouldBe` True
+ readIORef detectorCalled >>= (`shouldBe` False)
+ , testCase "leaves one detected logical processor free" do
+ selected <- selectEffectiveJobs Nothing (pure 8)
+ jobsSelectionEffectiveJobs selected
+ `shouldBe` positiveJobs 7
+ jobsSelectionDetectedProcessors selected `shouldBe` Just 8
+ jobsSelectionWasOverridden selected `shouldBe` False
+ , testCase "falls back to one after bad detection" do
+ nonPositive <- selectEffectiveJobs Nothing (pure 0)
+ jobsSelectionEffectiveJobs nonPositive
+ `shouldBe` positiveJobs 1
+ failed <- selectEffectiveJobs Nothing
+ (Exception.throwIO (userError "processor detection failed"))
+ jobsSelectionEffectiveJobs failed
+ `shouldBe` positiveJobs 1
+ jobsSelectionDetectedProcessors failed `shouldBe` Nothing
+ ]
+
+vampireExecutorTests :: TestTree
+vampireExecutorTests =
+ testGroup "bounded Vampire executor"
+ [ testCase "bounds live one-core processes" do
+ prepared <- preparedTypedTask 0
+ withFakeVampire
+ [ "previous=''"
+ , "found=0"
+ , "for argument in \"$@\"; do"
+ , " if [ \"$previous\" = '--cores' ]; then"
+ , " [ \"$argument\" = '1' ] || exit 17"
+ , " found=1"
+ , " fi"
+ , " previous=$argument"
+ , "done"
+ , "[ \"$found\" = '1' ] || exit 18"
+ , "cat >/dev/null"
+ , "sleep 0.2"
+ , "printf '%s\n' '% SZS status Theorem for fake'"
+ ]
+ \vampireCommand ->
+ withVampireExecutor
+ (positiveJobs 2)
+ vampireCommand
+ (\_position _request -> pure ())
+ \executor -> do
+ answers <- mapConcurrently
+ (\ordinal ->
+ runNoLoggingT
+ (runPreparedTypedProverWithExecutor
+ executor
+ (workPosition 1 ordinal)
+ prepared))
+ [1..4]
+ traverse_ assertProved answers
+ observed <- vampireExecutorObservation executor
+ vampireExecutorRunCount observed `shouldBe` 4
+ vampireExecutorMaximumLiveCount observed
+ `shouldBe` 2
+ , testCase "propagates observer failure to the submitter" do
+ prepared <- preparedTypedTask 0
+ withFakeVampire
+ [ "cat >/dev/null"
+ , "printf '%s\n' '% SZS status Theorem for fake'"
+ ]
+ \vampireCommand ->
+ withVampireExecutor
+ (positiveJobs 1)
+ vampireCommand
+ (\_position _request ->
+ Exception.throwIO
+ (userError "observer failed"))
+ \executor -> do
+ result <- Exception.try
+ (runNoLoggingT
+ (runPreparedTypedProverWithExecutor
+ executor
+ (workPosition 1 1)
+ prepared))
+ case result of
+ Left (failure :: Exception.IOException) ->
+ assertBool
+ "observer exception"
+ ("observer failed"
+ `Text.isInfixOf`
+ Text.pack (show failure))
+ Right answer ->
+ assertFailure
+ ("observer failure was lost: "
+ <> show answer)
+ , testCase "cancels queued and running jobs independently" do
+ prepared <- preparedTypedTask 0
+ withProcessGroupFake
+ defaultTimeLimit
+ []
+ \pidFile vampireCommand ->
+ withVampireExecutor
+ (positiveJobs 1)
+ vampireCommand
+ (\_position _request -> pure ())
+ \executor ->
+ withAsync
+ (runNoLoggingT
+ (runPreparedTypedProverWithExecutor
+ executor
+ (workPosition 1 1)
+ prepared))
+ \running -> do
+ processIds <- waitForProcessIds pidFile
+ withAsync
+ (runNoLoggingT
+ (runPreparedTypedProverWithExecutor
+ executor
+ (workPosition 2 1)
+ prepared))
+ \queued -> do
+ waitForSubmittedCount executor 2
+ cancel queued
+ cancel running
+ observed <- vampireExecutorObservation
+ executor
+ vampireExecutorSubmittedCount observed
+ `shouldBe` 2
+ vampireExecutorRunCount observed
+ `shouldBe` 1
+ assertProcessesGone processIds
+ ]
+
+positiveJobs :: Int -> EffectiveJobs
+positiveJobs amount =
+ fromMaybe
+ (error "test requested a non-positive job count")
+ (effectiveJobs amount)
+
vampireStatusParserTests :: TestTree
vampireStatusParserTests =
testGroup "Vampire status parser"
@@ -165,12 +311,14 @@ vampireProcessTests =
assertFailure
("expected malformed stdout, got " <> show result)
, testCase "returns a broken stdin pipe" do
+ prepared <- preparedTypedTask 20000
result <- withFakeVampire
[ "exec 0<&-"
, "sleep 1"
]
\vampireCommand ->
- runVampireProcess vampireCommand largeTask
+ runNoLoggingT
+ (runPreparedTypedProver vampireCommand prepared)
case result of
Left (ProverCommunicationFailed _ ProverStdin _) ->
pure ()
@@ -179,6 +327,7 @@ vampireProcessTests =
("expected a communication failure, got "
<> show processResult)
, testCase "drains output while feeding prover input" do
+ prepared <- preparedTypedTask 20000
guardedAnswer <- Timeout.timeout
30000000
(withFakeVampire
@@ -192,21 +341,23 @@ vampireProcessTests =
, "exit 0"
]
\vampireCommand -> do
- (_location, _formula, answer) <-
- runNoLoggingT
- (runProver vampireCommand largeTask)
- pure answer)
+ runNoLoggingT
+ (runPreparedTypedProver
+ vampireCommand
+ prepared))
case guardedAnswer of
Nothing ->
assertFailure "prover communication did not finish"
Just answer ->
assertProved answer
, testCase "reports signal termination separately" do
+ prepared <- preparedTypedTask 0
result <- withFakeVampire
[ "kill -TERM $$"
]
\vampireCommand ->
- runVampireProcess vampireCommand directTask
+ runNoLoggingT
+ (runPreparedTypedProver vampireCommand prepared)
case result of
Left
(ProverTerminatedBySignal
@@ -222,27 +373,31 @@ vampireProcessTests =
("expected signal termination, got "
<> show processResult)
, testCase "deadline terminates and reaps the process group" do
+ prepared <- preparedTypedTask 0
withProcessGroupFake
(Seconds 0)
[]
\pidFile vampireCommand -> do
result <-
- runVampireProcess
- vampireCommand
- directTask
+ runNoLoggingT
+ (runPreparedTypedProver
+ vampireCommand
+ prepared)
assertTimedOut result
processIds <- readProcessIds pidFile
assertProcessesGone processIds
, testCase "output exhaustion terminates the process group" do
+ prepared <- preparedTypedTask 0
withProcessGroupFake
defaultTimeLimit
[ "head -c 33554432 /dev/zero"
]
\pidFile vampireCommand -> do
result <-
- runVampireProcess
- vampireCommand
- directTask
+ runNoLoggingT
+ (runPreparedTypedProver
+ vampireCommand
+ prepared)
case result of
Left
(ProverOutputLimitExceeded
@@ -257,14 +412,16 @@ vampireProcessTests =
processIds <- readProcessIds pidFile
assertProcessesGone processIds
, testCase "cancellation terminates and reaps the process group" do
+ prepared <- preparedTypedTask 0
withProcessGroupFake
defaultTimeLimit
[]
\pidFile vampireCommand ->
withAsync
- (runVampireProcess
- vampireCommand
- directTask)
+ (runNoLoggingT
+ (runPreparedTypedProver
+ vampireCommand
+ prepared))
\worker -> do
processIds <- waitForProcessIds pidFile
cancel worker
@@ -408,6 +565,24 @@ waitForProcessIds path = do
threadDelay 10000
loop
+waitForSubmittedCount :: VampireExecutor -> Int -> Assertion
+waitForSubmittedCount executor expected = do
+ guarded <- Timeout.timeout 10000000 loop
+ case guarded of
+ Just () ->
+ pure ()
+ Nothing ->
+ assertFailure
+ ("executor did not submit " <> show expected <> " requests")
+ where
+ loop = do
+ observed <- vampireExecutorObservation executor
+ if vampireExecutorSubmittedCount observed >= expected
+ then pure ()
+ else do
+ threadDelay 10000
+ loop
+
assertProcessesGone :: [ProcessID] -> Assertion
assertProcessesGone processIds = do
guarded <- Timeout.timeout 10000000 loop
@@ -442,9 +617,9 @@ runFakeVampire scriptLines =
withFakeVampire
(["cat >/dev/null"] <> scriptLines)
\vampireCommand -> do
- (_location, _formula, answer) <- runNoLoggingT
- (runProver vampireCommand directTask)
- pure answer
+ prepared <- preparedTypedTask 0
+ runNoLoggingT
+ (runPreparedTypedProver vampireCommand prepared)
withFakeVampire
:: [String]
@@ -496,21 +671,43 @@ shouldBe :: (Eq a, Show a, HasCallStack) => a -> a -> Assertion
shouldBe =
flip (assertEqual "")
-directTask :: Task
-directTask =
- Task
- { taskDirectness = Direct
- , taskHypotheses = []
- , taskConjectureLabel = Marker "dummy"
- , taskLocation = Nowhere
- , taskConjecture = Top
- }
+preparedTypedTask
+ :: Int
+ -> IO (PreparedTypedProverTask Int Void Void Void)
+preparedTypedTask factCount = do
+ checked <- expectRight
+ (checkScopedCanonicalCore
+ (const Nothing)
+ []
+ propositionTerm)
+ proposition <- expectRight
+ (supportedProposition Vector.empty checked)
+ capability <- expectRight
+ (classifySupportedProposition (const Nothing) proposition)
+ let facts =
+ Vector.generate
+ factCount
+ (\reference ->
+ typedBackendFact reference proposition capability)
+ problem <- expectRight
+ (planTypedProblem
+ (const Nothing)
+ facts
+ proposition
+ []
+ []
+ ExplicitGlobalPremises
+ FirstOrderLocals)
+ expectRight (prepareTypedProverTask DirectTask problem)
+ where
+ propositionTerm =
+ CEq TySet
+ (CIntrinsic Empty)
+ (CIntrinsic Empty)
-largeTask :: Task
-largeTask =
- directTask
- { taskHypotheses =
- replicate
- 20000
- (Hypothesis (Marker "large") Top)
- }
+expectRight :: Show error => Either error value -> IO value
+expectRight = \case
+ Left failure ->
+ assertFailure (show failure) >> fail "unreachable"
+ Right value ->
+ pure value
diff --git a/source/Test/Unit/Semantic.hs b/source/Test/Unit/Semantic.hs
index 4a22f08..160735c 100644
--- a/source/Test/Unit/Semantic.hs
+++ b/source/Test/Unit/Semantic.hs
@@ -19,6 +19,7 @@ import Syntax.Abstract qualified as Raw
import Data.ByteString (ByteString)
import Data.List qualified as List
+import Data.Map.Strict qualified as Map
import Test.Tasty
import Test.Tasty.HUnit
@@ -32,6 +33,8 @@ unitTests =
roundTripsSemanticState
, testCase "round-trips exact semantic global keys"
roundTripsSemanticGlobalKeys
+ , testCase "round-trips canonical structure descriptors"
+ roundTripsStructureDescriptors
, testCase "keys exact proof and module inputs"
keysExactInputs
]
@@ -102,7 +105,11 @@ roundTripsSemanticGlobalKeys = do
first : rest ->
Semantic.semanticGlobalBinding
first
- (Semantic.TransparentExpansion target)
+ (Semantic.ContextualTransparentExpansion
+ target
+ (Map.singleton
+ (Raw.StructSymbol "operation")
+ target))
: [ Semantic.semanticGlobalBinding
key
(Semantic.GlobalReference target)
@@ -129,6 +136,53 @@ roundTripsSemanticGlobalKeys = do
(Semantic.semanticEnvironmentDelta [first, first])
_ -> assertFailure "semantic key fixture is unexpectedly empty"
+roundTripsStructureDescriptors :: Assertion
+roundTripsStructureDescriptors = do
+ fixture <- makeFixture
+ let structurePhrase marker word =
+ Semantic.semanticStructurePhrase
+ (Raw.LexicalItemSgPl
+ (Raw.SgPl
+ (Raw.TokenCons (Raw.Word word) Raw.End)
+ (Raw.TokenCons (Raw.Word (word <> "s")) Raw.End))
+ marker)
+ base = structurePhrase "onesorted_structure" "base"
+ child = structurePhrase "ordered_structure" "ordered"
+ object =
+ Identity.intrinsicObjectId
+ (fixtureTheory fixture)
+ Core.Empty
+ Core.TySet
+ operation =
+ Semantic.semanticStructureOperation
+ (Raw.StructSymbol "carrier")
+ object
+ descriptor <- expectRight
+ (Semantic.semanticStructureDescriptor
+ child
+ (Just object)
+ [base]
+ [operation])
+ delta <- expectRight
+ (Semantic.semanticEnvironmentWithStructures [] [descriptor])
+ assertEqual
+ "structure environment cache round trip"
+ (Right delta)
+ (decodeCache
+ Semantic.getSemanticEnvironmentDeltaCache
+ (encodeCache
+ (Semantic.putSemanticEnvironmentDeltaCache delta)))
+ assertEqual
+ "duplicate local operation is rejected"
+ (Left
+ (Semantic.DuplicateSemanticStructureOperation
+ (Raw.StructSymbol "carrier")))
+ (Semantic.semanticStructureDescriptor
+ child
+ (Just object)
+ [base]
+ [operation, operation])
+
keysExactInputs :: Assertion
keysExactInputs = do
fixture <- makeFixture
diff --git a/source/Test/Unit/Source.hs b/source/Test/Unit/Source.hs
index 3f6703e..73eaef5 100644
--- a/source/Test/Unit/Source.hs
+++ b/source/Test/Unit/Source.hs
@@ -5,35 +5,24 @@
module Test.Unit.Source (unitTests) where
import Base
-import Checking qualified
-import Checking.Backend.Problem qualified as Backend
-import Checking.Backend.Reconstruction qualified as Reconstruction
-import Checking.Core qualified as Core
-import Checking.Facts qualified as Facts
import Checking.Foundation qualified as Foundation
import Checking.Identity qualified as Identity
-import Checking.Kernel.Derivation qualified as Derivation
-import Checking.Legacy qualified as Legacy
-import Checking.Obligation qualified as Obligation
import Checking.Semantic qualified as Semantic
-import Checking.Transition qualified as Transition
import Felix.Cache.Codec qualified as Cache
import Felix.Module qualified as Module
import Felix.Parse qualified as Parse
import Felix.Parsed.Identity qualified as ParsedIdentity
import Felix.Parsed.Payload qualified as Parsed
+import Felix.Prelude qualified as Prelude
import Felix.Source
import Felix.Source.Content qualified as Content
import Felix.Source.Graph
import Felix.Store qualified as Store
-import Meaning qualified
-import Provers qualified
import Report.Location
( FileId(..)
, FileIdAllocator(..)
, Location(..)
, LocationRegistrationError(..)
- , pattern Nowhere
, allocateFileId
, locColumn
, locFile
@@ -44,21 +33,14 @@ import Report.Location
import Syntax.Abstract qualified as Raw
import Syntax.Adapt qualified as Adapt
import Syntax.Interface qualified as Interface
-import Syntax.Internal
import Syntax.Token (runLexer)
-import Bound.Scope (toScope)
-import Control.Exception (bracket, evaluate, try)
-import Control.Monad (foldM)
-import Control.Monad.Logger (runNoLoggingT)
+import Control.Exception (bracket, evaluate)
import Data.ByteString qualified as ByteString
-import Data.HashMap.Strict qualified as HashMap
import Data.IORef
import Data.List qualified as List
import Data.List.NonEmpty qualified as NonEmpty
-import Data.Set qualified as Set
import Data.Text qualified as Text
-import Data.Vector qualified as Vector
import Data.Word (Word8, Word16)
import Database.SQLite.Simple qualified as SQLite
import System.Directory qualified as Directory
@@ -89,6 +71,8 @@ unitTests = testGroup "Source resolution"
, testCase "reserves the all-ones file identifier"
preservesReservedFileId
, testCase "builds an imported-before-importer source graph" buildsSourceGraph
+ , testCase "rejects the packaged prelude as ordinary source"
+ rejectsPackagedPreludeAsOrdinarySource
, testCase "orders sibling imports by textual occurrence"
ordersSiblingImports
, testCase "orders shared dependencies before their importers"
@@ -114,20 +98,6 @@ unitTests = testGroup "Source resolution"
, testCase "rejects a corrupted cached declaration anchor"
rejectsCorruptedCachedDeclarationAnchor
, testCase "parses source-local blocks in graph order" parsesSourceGraph
- , testCase "assigns and reserves dense legacy module positions"
- reservesLegacyModulePositions
- , testCase "admits complete legacy declaration batches"
- admitsLegacyDeclarations
- , testCase "publishes deterministic legacy import views"
- publishesLegacyImportViews
- , testCase "publishes typed signatures and facts through transition modules"
- publishesTransitionSignatures
- , testCase "rejects cached global types from another builder"
- rejectsForeignCachedGlobalType
- , testCase "authorizes exact typed Vampire requests"
- authorizesTypedVampireRequests
- , testCase "enforces and replays direct inductive guards"
- publishesTypedInductive
, testCase "does not leak syntax between sibling imports"
rejectsSiblingSyntaxLeakage
, testCase "parses source fixity levels and grouping"
@@ -154,10 +124,8 @@ unitTests = testGroup "Source resolution"
reportsMalformedLexicalDeclaration
, testCase "validates inductive function patterns during scanning"
rejectsMalformedInductivePattern
- , testCase "scans, parses, and checks adjective signatures"
+ , testCase "scans and parses adjective signatures"
acceptsAdjectiveSignature
- , testCase "rejects unresolved quantified symbolic-signature terms"
- rejectsQuantifiedSymbolicSignatureTerm
, testCase "rejects malformed math-led signature heads"
rejectsMalformedSignatureHead
, testCase "locates conflicting declarations within one environment"
@@ -166,8 +134,6 @@ unitTests = testGroup "Source resolution"
acceptsBuiltinSourceDeclaration
, testCase "keeps the built-in marker for a prefix predicate declaration"
acceptsBuiltinPrefixPredicateDeclaration
- , testCase "rejects duplicate fixed-base semantics during checking"
- rejectsDuplicateFixedBaseSemantics
, testCase "does not rescan repeated canonical imports"
avoidsAliasImportLexiconCollision
, testCase "parses loaded sources without rereading files" parsesWithoutRereading
@@ -275,6 +241,47 @@ rootFormsShareIdentity =
(resolvedSourceRelativePath (loadedSource searchedLoaded))
(resolvedSourceRelativePath (loadedSource exactLoaded))
+rejectsPackagedPreludeAsOrdinarySource :: Assertion
+rejectsPackagedPreludeAsOrdinarySource = do
+ packaged <- expectRight =<< Prelude.loadReservedPreludeSourceInput
+ canonical <- expectJust "packaged canonical path"
+ (Prelude.reservedPreludeSourceCanonicalPath packaged)
+ let path = canonicalPathFilePath canonical
+ mounts <- oneMount "packaged" (Posix.takeDirectory path)
+ request <- expectRight (searchedRoot (Posix.takeFileName path))
+ let validate = Prelude.rejectOrdinaryPreludeSourceGraph packaged
+ syntaxInputs = const []
+ Parse.parseSourceWorkspaceMeasuredWithSyntaxInputsAndGraphValidation
+ mounts request syntaxInputs validate >>= \case
+ Left
+ (Parse.SourceWorkspaceError
+ (PackagedPreludeSelectedAsOrdinarySource source)) ->
+ assertEqual "authority-free rejected path"
+ canonical
+ (resolvedSourceCanonicalPath source)
+ other ->
+ assertFailure
+ ("unexpected authority-free result: " <> show other)
+
+ withTemporaryDirectory "felix-reserved-parse-store" \temp -> do
+ foundation <- expectRight Foundation.checkedFoundation
+ store <- openTestStore
+ (temp Posix.</> "store.sqlite")
+ (Identity.theoryId foundation)
+ Parse.parseSourceWorkspaceMeasuredWithStoreAndSyntaxInputsAndGraphValidation
+ store mounts request syntaxInputs validate >>= \case
+ Left
+ (Parse.ParseExecutionWorkspaceError
+ (Parse.SourceWorkspaceError
+ (PackagedPreludeSelectedAsOrdinarySource source))) ->
+ assertEqual "typed rejected path"
+ canonical
+ (resolvedSourceCanonicalPath source)
+ other ->
+ assertFailure
+ ("unexpected typed result: " <> show other)
+ Store.closeStore store
+
attributesNestedSources :: Assertion
attributesNestedSources =
withTemporaryDirectory "felix-source-nested-mount" \temp -> do
@@ -682,46 +689,6 @@ buildsEmptyModules =
(Parse.parsedModuleSyntaxInterface
(Parse.parsedWorkspaceRootModule
workspace)))))
- assignments <-
- expectRight
- (Legacy.assignLegacyModuleOrdinals workspace)
- assignment <-
- case toList assignments of
- [only] ->
- pure only
- actual ->
- assertFailure
- ("expected one empty module assignment, got "
- <> show (length actual))
- >> fail "unreachable"
- checkedFoundationValue <-
- expectRight Foundation.checkedFoundation
- builder <-
- expectRight
- (Transition.openTransitionModuleBuilder
- checkedFoundationValue
- Checking.initialLegacyCheckingEnvironment
- assignment
- [])
- checked <-
- Checking.runCheckingBlocks
- []
- (Checking.initialTransitionCheckingStateWithTaskPreparation
- Checking.WithoutDumpPremselTraining
- id
- builder
- (\_batch ->
- assertFailure
- "empty module emitted an obligation"))
- finalBuilder <-
- expectJust
- "empty transition builder"
- (Checking.checkingTransitionModuleBuilder checked)
- void
- (expectRight
- (Transition.sealTransitionModule
- (Checking.checkingStateEnvironment checked)
- finalBuilder))
identifiesOwnerIndependentParsedModules :: Assertion
identifiesOwnerIndependentParsedModules =
@@ -1235,1613 +1202,6 @@ parsesSourceGraph =
["shared.tex", "entry.tex"]
emitted
-reservesLegacyModulePositions :: Assertion
-reservesLegacyModulePositions =
- withTemporaryDirectory "felix-legacy-module-stage" \temp -> do
- writeTheory (temp Posix.</> "shared.tex") [] "shared"
- writeTheory
- (temp Posix.</> "entry.tex")
- ["shared.tex"]
- "entry"
- graph <- buildSearchedGraph temp "entry.tex"
- workspace <-
- expectRight
- =<< Parse.parseResolvedSourceGraph graph
- assignments <-
- expectRight
- (Legacy.assignLegacyModuleOrdinals workspace)
- assertEqual "dense imported-first module ordinals"
- [0, 1]
- ( Legacy.legacyModuleOrdinalValue
- . Legacy.assignedLegacyModuleOrdinal
- <$> toList assignments
- )
- assertEqual "assigned source order"
- ["shared.tex", "entry.tex"]
- ( safeRelativePathFilePath
- . sourceAddressRelativePath
- . Parse.parsedModuleAddress
- . Legacy.assignedParsedModule
- <$> toList assignments
- )
-
- let firstAssignment :| _remainingAssignments =
- assignments
- stage =
- Legacy.openLegacyModuleStage
- firstAssignment
- (Legacy.emptyLegacyImportedView
- Checking.initialLegacyCheckingEnvironment)
- origin = Facts.factOrigin (Location 0) "declaration"
- firstFact =
- Facts.stageFact
- ("first" :| ["first_alias"])
- origin
- (Facts.prepareSemanticFact Top)
- secondFact =
- Facts.stageFact
- ("second" :| [])
- origin
- (Facts.prepareSemanticFact Bottom)
- reservation <-
- expectRight
- (Legacy.reserveLegacyDeclaration
- (firstFact :| [secondFact])
- stage)
- assertEqual "dense local fact ordinals"
- [0, 1]
- ( Legacy.legacyLocalFactOrdinalValue
- . Legacy.legacyFactLocalOrdinal
- . Legacy.legacyReservedFactReference
- <$> toList (Legacy.legacyReservedFacts reservation)
- )
-
- let duplicateAliasFact =
- Facts.stageFact
- ("first_alias" :| [])
- origin
- (Facts.prepareSemanticFact Bottom)
- case Legacy.reserveLegacyDeclaration
- (firstFact :| [duplicateAliasFact])
- stage of
- Left Legacy.LegacyAliasAlreadyBound{} ->
- pure ()
- Left err ->
- assertFailure
- ("expected alias rejection, got " <> show err)
- Right _ ->
- assertFailure "expected duplicate legacy alias rejection"
-
-admitsLegacyDeclarations :: Assertion
-admitsLegacyDeclarations =
- withTemporaryDirectory "felix-legacy-admission" \temp -> do
- writeTheory (temp Posix.</> "entry.tex") [] "entry"
- graph <- buildSearchedGraph temp "entry.tex"
- workspace <-
- expectRight
- =<< Parse.parseResolvedSourceGraph graph
- assignment :| _ <-
- expectRight
- (Legacy.assignLegacyModuleOrdinals workspace)
- let stage =
- Legacy.openLegacyModuleStage
- assignment
- (Legacy.emptyLegacyImportedView
- Checking.initialLegacyCheckingEnvironment)
- blocks =
- [ BlockAxiom
- Nowhere
- "declared"
- (Axiom [] Top)
- , BlockLemma
- Nowhere
- "omitted"
- (Lemma [] Bottom)
- , BlockProof
- Nowhere
- Nowhere
- (Omitted Nowhere)
- ]
- resolveGapBatch batch = do
- resolved <-
- traverse
- (either
- (ioError . userError . show)
- pure
- . Obligation.resolveObligationAsGap)
- (Obligation.preparedBatchObligations batch)
- either
- (ioError . userError . show)
- pure
- (Obligation.resolveObligationBatch
- batch
- resolved)
- initial =
- Checking.initialLegacyCheckingStateWithTaskPreparation
- Checking.WithoutDumpPremselTraining
- id
- stage
- resolveGapBatch
- checked <-
- Checking.runCheckingBlocks blocks initial
- admittedStage <-
- maybe
- (assertFailure
- "authoritative checking lost the legacy stage"
- >> pure stage)
- pure
- (Checking.checkingLegacyModuleStage checked)
- admittedModule <-
- expectRight
- (Legacy.sealLegacyModuleStage
- (Checking.checkingStateEnvironment checked)
- admittedStage)
- assertEqual "two sealed local facts"
- 2
- (Vector.length
- (Legacy.legacyAdmittedLocalFacts admittedModule))
- assertEqual "one sealed declared assumption"
- 1
- (Vector.length
- (Legacy.legacyAdmittedDirectAxiomManifest
- admittedModule))
- let finalTrust =
- Legacy.legacyFactEntryTrustDependencies
- (Vector.last
- (Legacy.legacyAdmittedLocalFacts
- admittedModule))
- assertEqual "one explicit gap"
- 1
- (Set.size
- (Legacy.legacyExplicitGaps finalTrust))
- assertEqual "direct gap needs no legacy finalization rule"
- 0
- (Set.size
- (Legacy.trustedLegacyRuleUses finalTrust))
-
-publishesTransitionSignatures :: Assertion
-publishesTransitionSignatures =
- withTemporaryDirectory "felix-transition-signatures" \temp -> do
- writeTheory (temp Posix.</> "shared.tex") [] "shared"
- writeTheory
- (temp Posix.</> "entry.tex")
- ["shared.tex"]
- "entry"
- graph <- buildSearchedGraph temp "entry.tex"
- workspace <-
- expectRight
- =<< Parse.parseResolvedSourceGraph graph
- assignments <-
- expectRight
- (Legacy.assignLegacyModuleOrdinals workspace)
- checkedFoundationValue <-
- expectRight Foundation.checkedFoundation
- case toList assignments of
- [sharedAssignment, entryAssignment] -> do
- shared <-
- admit
- checkedFoundationValue
- sharedAssignment
- []
- [ BlockSig
- Nowhere
- "shared_signature"
- []
- (SignaturePredicate
- sharedPredicate
- ("x" :| []))
- , BlockAxiom
- Nowhere
- "shared_atomic_axiom"
- (Axiom [] sharedAtomicFormula)
- ]
- let sharedGlobals =
- Transition.transitionAdmittedGlobals
- shared
- assertEqual
- "one shared typed declaration"
- 1
- (Vector.length sharedGlobals)
- case Vector.toList sharedGlobals of
- [(symbol, reference, _origin)] -> do
- assertEqual
- "shared symbol"
- (SymbolPredicate sharedPredicate)
- symbol
- assertEqual
- "shared declaration ordinal"
- 0
- (Transition.localDeclarationOrdinalValue
- (Transition.opaqueDeclarationOrdinal
- (Transition.checkedGlobalReference
- reference)))
- assertEqual
- "shared predicate type"
- (Core.TySet
- `Core.TyArrow`
- Core.TyProp)
- (Transition.checkedGlobalType reference)
- _ ->
- assertFailure
- "expected one shared typed declaration"
- let sharedFacts =
- Vector.toList
- (Transition.transitionAdmittedFacts
- shared)
- sharedManifest =
- Vector.toList
- (Transition.transitionAdmittedTypedDirectAxiomManifest
- shared)
- (sharedReference, sharedStatement) <-
- case (sharedFacts, sharedManifest) of
- ([assumption], [manifestEntry]) -> do
- assertBool
- "typed axiom is not a kernel proof"
- (not
- (Transition.admittedFactIsKernelProof
- assumption))
- assertEqual
- "manifest kind"
- Legacy.DeclaredUserAxiom
- (Transition.typedDirectAssumptionKind
- manifestEntry)
- assertEqual
- "manifest fact reference"
- (Just
- (Transition.typedDirectAssumptionFact
- manifestEntry))
- (Transition.transitionTypedFactReference
- (Transition.admittedFactReference
- assumption))
- pure
- ( Transition.admittedFactReference
- assumption
- , Transition.typedDirectAssumptionStatement
- manifestEntry
- )
- _ ->
- fail
- "expected one manifest-backed typed axiom"
-
- hiddenBuilder <-
- expectRight
- (Transition.openTransitionModuleBuilder
- checkedFoundationValue
- Checking.initialLegacyCheckingEnvironment
- entryAssignment
- [])
- hiddenTarget <-
- expectRight
- (Core.checkCanonicalCore
- (const Nothing)
- (Core.CImp
- Core.CFalsum
- Core.CFalsum))
- hiddenImport <-
- expectRight
- (Transition.transitionDerivationImport
- sharedReference
- hiddenTarget)
- case Transition.commitTransitionKernelFactWithImports
- ("hidden_import" :| [])
- (Transition.origin
- Nowhere
- Nothing
- (Just "hidden_import"))
- (Vector.singleton hiddenImport)
- hiddenTarget
- (Derivation.importedFactDerivation
- (Derivation.importIx 0))
- hiddenBuilder of
- Left
- (Transition.TransitionKernelImportNotVisible
- actualReference) ->
- assertEqual
- "unimported fact reference"
- sharedReference
- actualReference
- Left err ->
- assertFailure
- ("expected hidden typed import failure, got "
- <> show err)
- Right _ ->
- assertFailure
- "an unimported typed row authorized replay"
-
- entryBuilder <-
- expectRight
- (Transition.openTransitionModuleBuilder
- checkedFoundationValue
- Checking.initialLegacyCheckingEnvironment
- entryAssignment
- [shared])
- assertBool
- "direct import exposes the typed global"
- (isJust
- (Transition.lookupTransitionGlobal
- (SymbolPredicate sharedPredicate)
- entryBuilder))
- entry <-
- admitWithBuilder
- entryBuilder
- [ BlockAxiom
- Nowhere
- "legacy_axiom"
- (Axiom [] Top)
- , BlockSig
- Nowhere
- "entry_signature"
- []
- (SignaturePredicate
- entryPredicate
- ("z" :| []))
- , BlockLemma
- Nowhere
- "typed_import_reuse"
- (Lemma [] sharedAtomicFormula)
- , BlockLemma
- Nowhere
- "typed_reflexivity"
- (Lemma
- []
- (Equals
- Nowhere
- (EmptySet Nowhere)
- (EmptySet Nowhere)))
- ]
- case Vector.toList
- (Transition.transitionAdmittedGlobals
- entry) of
- [(_symbol, reference, _origin)] ->
- assertEqual
- "legacy declaration occupies its source ordinal"
- 1
- (Transition.localDeclarationOrdinalValue
- (Transition.opaqueDeclarationOrdinal
- (Transition.checkedGlobalReference
- reference)))
- _ ->
- assertFailure
- "expected one local entry declaration"
- let facts =
- Vector.toList
- (Transition.transitionAdmittedFacts
- entry)
- assertEqual
- "imported and local rows retain declaration order"
- [False, False, True, True]
- (Transition.admittedFactIsKernelProof
- <$> facts)
- case facts of
- [_assumption, _legacy, reused, reflexivity] -> do
- case Transition.transitionTypedFactReference
- (Transition.admittedFactReference
- reused) of
- Nothing ->
- assertFailure
- "expected a typed fact reference"
- Just reference ->
- assertEqual
- "first typed fact ordinal"
- 0
- (Transition.localFactOrdinalValue
- (Transition.factReferenceOrdinal
- reference))
- case Transition.transitionTypedFactReference
- (Transition.admittedFactReference
- reflexivity) of
- Nothing ->
- assertFailure
- "expected a typed reflexivity reference"
- Just reference ->
- assertEqual
- "second typed fact ordinal"
- 1
- (Transition.localFactOrdinalValue
- (Transition.factReferenceOrdinal
- reference))
- _ ->
- assertFailure
- "expected imported assumption and three local facts"
- let inheritedAssumptions =
- Set.toList
- (Transition.typedDeclaredAssumptionUses
- (Transition.transitionAdmittedTypedTrustDependencies
- entry))
- case inheritedAssumptions of
- [assumption] -> do
- assertEqual
- "the importer retains the owner fact"
- (Transition.transitionTypedFactReference
- sharedReference)
- (Just
- (Transition.sessionTypedAssumptionFact
- assumption))
- assertEqual
- "the owner assumption ordinal"
- 0
- (Transition.localAssumptionOrdinalValue
- (Transition.sessionTypedAssumptionOrdinal
- assumption))
- assertEqual
- "the imported assumption statement"
- sharedStatement
- (Transition.sessionTypedAssumptionStatement
- assumption)
- _ ->
- assertFailure
- "expected one inherited typed declared assumption"
- assertEqual
- "two local replayed kernel proofs"
- 2
- (Transition.transitionAdmittedKernelProofCount
- entry)
- actual ->
- assertFailure
- ("expected two module assignments, got "
- <> show (length actual))
- where
- sharedPredicate =
- PredicateSymbol "typed_shared_predicate"
- entryPredicate =
- PredicateSymbol "typed_entry_predicate"
- sharedAtomicFormula =
- Atomic
- Nowhere
- sharedPredicate
- [EmptySet Nowhere]
-
- admit checkedFoundationValue assignment imports blocks = do
- builder <-
- expectRight
- (Transition.openTransitionModuleBuilder
- checkedFoundationValue
- Checking.initialLegacyCheckingEnvironment
- assignment
- imports)
- admitWithBuilder builder blocks
-
- admitWithBuilder builder blocks = do
- checked <-
- Checking.runCheckingBlocks
- blocks
- (Checking.initialTransitionCheckingStateWithTaskPreparation
- Checking.WithoutDumpPremselTraining
- id
- builder
- (\_batch ->
- assertFailure
- "typed transition emitted an obligation"))
- finalBuilder <-
- maybe
- (assertFailure
- "checking lost its transition builder")
- pure
- (Checking.checkingTransitionModuleBuilder
- checked)
- expectRight
- (Transition.sealTransitionModule
- (Checking.checkingStateEnvironment checked)
- finalBuilder)
-
-rejectsForeignCachedGlobalType :: Assertion
-rejectsForeignCachedGlobalType =
- withTemporaryDirectory "felix-transition-global-types" \temp -> do
- writeTheory
- (temp Posix.</> "entry.tex")
- []
- "entry"
- graph <-
- buildSearchedGraph temp "entry.tex"
- workspace <-
- expectRight
- =<< Parse.parseResolvedSourceGraph graph
- assignments <-
- expectRight
- (Legacy.assignLegacyModuleOrdinals workspace)
- assignment <-
- case toList assignments of
- [only] ->
- pure only
- actual ->
- assertFailure
- ("expected one module assignment, got "
- <> show (length actual))
- >> fail "unreachable"
- checkedFoundationValue <-
- expectRight Foundation.checkedFoundation
- builderA0 <-
- expectRight
- (Transition.openTransitionModuleBuilder
- checkedFoundationValue
- Checking.initialLegacyCheckingEnvironment
- assignment
- [])
- builderB0 <-
- expectRight
- (Transition.openTransitionModuleBuilder
- checkedFoundationValue
- Checking.initialLegacyCheckingEnvironment
- assignment
- [])
- let symbol =
- SymbolPredicate
- (PredicateSymbol
- "same_nominal_global")
- declarationOrigin =
- Transition.origin
- Nowhere
- Nothing
- (Just "same_nominal_global")
- builderA <-
- expectRight
- (Transition.commitTransitionOpaqueGlobal
- symbol
- Core.TySet
- declarationOrigin
- (Transition.beginTransitionDeclaration
- builderA0))
- builderB <-
- expectRight
- (Transition.commitTransitionOpaqueGlobal
- symbol
- Core.TyProp
- declarationOrigin
- (Transition.beginTransitionDeclaration
- builderB0))
- globalA <-
- maybe
- (assertFailure "builder A lost its global"
- >> fail "unreachable")
- pure
- (Transition.lookupTransitionGlobal
- symbol
- builderA)
- globalB <-
- maybe
- (assertFailure "builder B lost its global"
- >> fail "unreachable")
- pure
- (Transition.lookupTransitionGlobal
- symbol
- builderB)
- operand <-
- expectRight
- (Core.checkCanonicalCore
- (Just . Transition.checkedGlobalType)
- (Core.CGlobal globalA))
- statement <-
- expectRight
- (Core.checkCanonicalCore
- (Just . Transition.checkedGlobalType)
- (Core.CEq
- Core.TySet
- (Core.CGlobal globalA)
- (Core.CGlobal globalA)))
- case Transition.commitTransitionKernelFact
- ("foreign_global_type" :| [])
- (Transition.origin
- Nowhere
- Nothing
- (Just "foreign_global_type"))
- statement
- (Derivation.equalityReflexivityDerivation
- operand)
- (Transition.beginTransitionDeclaration
- builderB) of
- Left
- (Transition.TransitionGlobalReferenceTypeMismatch
- actual
- authoritativeType) -> do
- assertEqual
- "cached global reference"
- globalA
- actual
- assertEqual
- "builder B authoritative type"
- Core.TyProp
- authoritativeType
- Left err ->
- assertFailure
- ("expected cached global type rejection, got "
- <> show err)
- Right _ ->
- assertFailure
- "builder B admitted builder A's cached type"
- let remappedOperand =
- Core.mapFrozenGlobals
- (const globalB)
- operand
- remappedStatement =
- Core.mapFrozenGlobals
- (const globalB)
- statement
- case Transition.commitTransitionKernelFact
- ("stale_term_annotation" :| [])
- (Transition.origin
- Nowhere
- Nothing
- (Just "stale_term_annotation"))
- remappedStatement
- (Derivation.equalityReflexivityDerivation
- remappedOperand)
- (Transition.beginTransitionDeclaration
- builderB) of
- Left
- (Transition.TransitionCoreCheckError
- (Core.EqualityOperandTypeMismatch
- Core.TySet
- Core.TyProp)) ->
- pure ()
- Left err ->
- assertFailure
- ("expected fresh builder-relative core check, got "
- <> show err)
- Right _ ->
- assertFailure
- "builder B admitted a stale term annotation"
-
-authorizesTypedVampireRequests :: Assertion
-authorizesTypedVampireRequests =
- withTemporaryDirectory "felix-typed-vampire" \temp -> do
- let sourcePath =
- temp Posix.</> "entry.tex"
- executablePath =
- temp Posix.</> "vampire"
- writeTheory sourcePath [] "entry"
- graph <-
- buildSearchedGraph temp "entry.tex"
- workspace <-
- expectRight
- =<< Parse.parseResolvedSourceGraph graph
- assignments <-
- expectRight
- (Legacy.assignLegacyModuleOrdinals
- workspace)
- assignment <-
- case toList assignments of
- [only] ->
- pure only
- actual ->
- assertFailure
- ("expected one module assignment, got "
- <> show (length actual))
- >> fail "unreachable"
- checkedFoundationValue <-
- expectRight Foundation.checkedFoundation
- baseBuilder <-
- expectRight
- (Transition.openTransitionModuleBuilder
- checkedFoundationValue
- Checking.initialLegacyCheckingEnvironment
- assignment
- [])
- let legacyStage =
- Transition.transitionBuilderLegacyStage
- baseBuilder
- legacyStaged =
- Facts.stageFact
- ("legacy_input" :| [])
- (Facts.factOrigin
- (Location 0)
- "legacy_input")
- (Facts.prepareSemanticFact Top)
- legacyReservation <-
- expectRight
- (Legacy.reserveLegacyDeclaration
- (legacyStaged :| [])
- legacyStage)
- let legacyReserved =
- NonEmpty.head
- (Legacy.legacyReservedFacts
- legacyReservation)
- legacyAdmitted =
- Legacy.authorizeLegacyDeclaredAssumption
- legacyStage
- Legacy.DeclaredUserAxiom
- legacyReserved
- legacyStage' <-
- expectRight
- (Legacy.appendEstablishedLegacyDeclaration
- legacyReservation
- (legacyAdmitted :| [])
- legacyStage)
- builderWithLegacy <-
- expectRight
- (Transition.transitionBuilderWithLegacyStage
- legacyStage'
- baseBuilder)
- target <-
- expectRight
- (Core.checkCanonicalCore
- (Just . Transition.checkedGlobalType)
- (Core.CImp
- Core.CFalsum
- Core.CFalsum))
- claim <-
- expectRight
- (Backend.supportedProposition
- (Vector.empty
- :: Vector.Vector
- (Void, Core.CoreType))
- (Core.embedClosedCore [] target))
- builderWithFof <-
- expectRight
- (Transition.commitTransitionTypedDeclaredAssumption
- ("fof_input" :| [])
- (Transition.origin
- Nowhere
- Nothing
- (Just "fof_input"))
- Legacy.DeclaredUserAxiom
- target
- (Transition.beginTransitionDeclaration
- builderWithLegacy))
- let higherOrderTarget =
- Core.mapFrozenGlobals
- absurd
- (Foundation.foundationAxiomFrozen
- checkedFoundationValue
- Foundation.DoubleNegationElim)
- builderWithTh0 <-
- expectRight
- (Transition.commitTransitionTypedDeclaredAssumption
- ("th0_input" :| [])
- (Transition.origin
- Nowhere
- Nothing
- (Just "th0_input"))
- Legacy.DeclaredUserAxiom
- higherOrderTarget
- (Transition.beginTransitionDeclaration
- builderWithFof))
- builder <-
- expectRight
- (Transition.commitTransitionTypedDeclaredAssumption
- ("second_fof_input" :| [])
- (Transition.origin
- Nowhere
- Nothing
- (Just "second_fof_input"))
- Legacy.DeclaredUserAxiom
- target
- (Transition.beginTransitionDeclaration
- builderWithTh0))
- implicitProblem <-
- expectRight
- (Transition.planTransitionTypedProblem
- builder
- claim
- []
- []
- Transition.ImplicitFofFacts
- Backend.FirstOrderLocals)
- let selected =
- Vector.toList
- (Backend.typedProblemGlobalPremises
- implicitProblem)
- references <-
- traverse
- ( maybe
- (assertFailure
- "implicit planning selected a legacy row"
- >> fail "unreachable")
- pure
- . Transition.transitionTypedFactReference
- . Backend.typedBackendFactReference
- )
- selected
- assertEqual
- "implicit planning preserves FOF admission order"
- [0, 2]
- ( Transition.localFactOrdinalValue
- . Transition.factReferenceOrdinal
- <$> references
- )
- assertEqual
- "implicit admitted-fact route"
- Backend.RouteFof
- (Backend.typedProblemRoute
- implicitProblem)
- explicitHigherOrder <-
- expectRight
- (Transition.planTransitionTypedProblem
- builder
- claim
- []
- []
- (Transition.ExplicitFacts
- ("th0_input" :| ["th0_input"]))
- Backend.FirstOrderLocals)
- assertEqual
- "explicit higher-order admitted fact selects TH0"
- Backend.RouteTh0
- (Backend.typedProblemRoute
- explicitHigherOrder)
- assertEqual
- "repeated explicit aliases select one fact"
- 1
- (Vector.length
- (Backend.typedProblemGlobalPremises
- explicitHigherOrder))
- case Transition.planTransitionTypedProblem
- builder
- claim
- []
- []
- (Transition.ExplicitFacts
- ("legacy_input" :| []))
- Backend.FirstOrderLocals of
- Left
- (Transition.TransitionTypedProblemDependencyNotMigrated
- reference) ->
- assertEqual
- "legacy dependency stays legacy"
- Nothing
- (Transition.transitionTypedFactReference
- reference)
- result' ->
- assertFailure
- ("expected legacy dependency rejection, got "
- <> case result' of
- Left err ->
- "Left " <> show err
- Right _problem ->
- "Right problem")
- problem <-
- expectRight
- (Transition.planTransitionTypedProblem
- builder
- claim
- []
- [Backend.typedFoundationAuxiliaryInput
- checkedFoundationValue
- Foundation.DoubleNegationElim]
- Transition.NoGlobalFacts
- Backend.AllLocals)
- prepared <-
- expectRight
- (Provers.prepareTypedProverTask
- Provers.DirectTask
- problem)
- mismatched <-
- expectRight
- (Provers.prepareTypedProverTask
- Provers.IndirectTask
- problem)
- assertEqual
- "higher-order foundation input selects TH0"
- Provers.VerificationTh0
- (Provers.preparedVerificationDialect
- (Provers.preparedTypedProverRequest
- prepared))
- writeFile executablePath
- (unlines
- [ "#!/bin/sh"
- , "cat >/dev/null"
- , "printf '%s\\n' '% SZS status Theorem for typed'"
- ])
- permissions <-
- Directory.getPermissions executablePath
- Directory.setPermissions executablePath
- (Directory.setOwnerExecutable
- True
- permissions)
- result <-
- runNoLoggingT
- (Provers.runPreparedTypedProver
- (Provers.vampire
- executablePath
- Provers.defaultTimeLimit
- Provers.defaultMemoryLimit)
- prepared)
- accepted <-
- case result of
- Right answer
- | Just run <-
- Provers.provedVampireRun answer ->
- pure run
- _ ->
- assertFailure
- ("expected accepted typed Vampire run, got "
- <> show result)
- >> fail "unreachable"
- let factOrigin =
- Transition.origin
- Nowhere
- Nothing
- (Just "typed_vampire")
- commit task =
- Transition.commitTransitionTypedVampireFact
- Reconstruction.defaultReconstructionPolicy
- ("typed_vampire" :| [])
- factOrigin
- target
- task
- accepted
- builder
- case commit mismatched of
- Left Transition.TransitionTypedVampireRequestMismatch ->
- pure ()
- result' ->
- assertFailure
- ("expected exact-request mismatch, got "
- <> showResult result')
- committed <-
- expectRight (commit prepared)
- admitted <-
- expectRight
- (Transition.sealTransitionModule
- Checking.initialLegacyCheckingEnvironment
- committed)
- let trust =
- Transition.transitionAdmittedTypedTrustDependencies
- admitted
- assertEqual
- "one typed trusted Vampire row"
- 1
- (Transition.transitionAdmittedTypedTrustedVampireCount
- admitted)
- assertEqual
- "one typed Vampire trust occurrence"
- 1
- (Set.size
- (Transition.typedTrustedVampireUses
- trust))
- assertEqual
- "mandatory lowering assumptions"
- Legacy.mandatoryVampireLoweringAssumptions
- (Transition.typedVampireLoweringUses
- trust)
- assertEqual
- "exact foundation input"
- (Set.singleton
- Foundation.DoubleNegationElim)
- (Transition.typedFoundationUses
- trust)
- let atom argument =
- Core.CApp
- (Core.CApp
- (Core.CIntrinsic Core.Member)
- (Core.CIntrinsic Core.Empty))
- argument
- atomP =
- atom (Core.CIntrinsic Core.Empty)
- atomQ =
- atom (Core.COpaqueInteger 1)
- atomR =
- atom (Core.COpaqueInteger 2)
- declareTyped alias statement current =
- expectRight
- (Transition.commitTransitionTypedDeclaredAssumption
- (alias :| [])
- (Transition.origin
- Nowhere
- Nothing
- (Just alias))
- Legacy.DeclaredUserAxiom
- statement
- (Transition.beginTransitionDeclaration
- current))
- premiseP <-
- expectRight
- (Core.checkCanonicalCore
- (Just . Transition.checkedGlobalType)
- atomP)
- premisePtoQ <-
- expectRight
- (Core.checkCanonicalCore
- (Just . Transition.checkedGlobalType)
- (Core.CImp atomP atomQ))
- premiseQtoR <-
- expectRight
- (Core.checkCanonicalCore
- (Just . Transition.checkedGlobalType)
- (Core.CImp atomQ atomR))
- reconstructedTarget <-
- expectRight
- (Core.checkCanonicalCore
- (Just . Transition.checkedGlobalType)
- atomR)
- builderWithP <-
- declareTyped
- "horn_p"
- premiseP
- builder
- builderWithPtoQ <-
- declareTyped
- "horn_p_to_q"
- premisePtoQ
- builderWithP
- builderWithHornInputs <-
- declareTyped
- "horn_q_to_r"
- premiseQtoR
- builderWithPtoQ
- reconstructedClaim <-
- expectRight
- (Backend.supportedProposition
- (Vector.empty
- :: Vector.Vector
- (Void, Core.CoreType))
- (Core.embedClosedCore
- []
- reconstructedTarget))
- reconstructedProblem <-
- expectRight
- (Transition.planTransitionTypedProblem
- builderWithHornInputs
- reconstructedClaim
- []
- []
- (Transition.ExplicitFacts
- ("horn_p"
- :| [ "horn_p_to_q"
- , "horn_q_to_r"
- ]))
- Backend.FirstOrderLocals)
- reconstructedPrepared <-
- expectRight
- (Provers.prepareTypedProverTask
- Provers.DirectTask
- reconstructedProblem)
- reconstructedResult <-
- runNoLoggingT
- (Provers.runPreparedTypedProver
- (Provers.vampire
- executablePath
- Provers.defaultTimeLimit
- Provers.defaultMemoryLimit)
- reconstructedPrepared)
- reconstructedAccepted <-
- case reconstructedResult of
- Right answer
- | Just run <-
- Provers.provedVampireRun answer ->
- pure run
- _ ->
- assertFailure
- ("expected accepted Horn Vampire run, got "
- <> show reconstructedResult)
- >> fail "unreachable"
- reconstructedBuilder <-
- expectRight
- (Transition.commitTransitionTypedVampireFact
- Reconstruction.defaultReconstructionPolicy
- ("horn_result" :| [])
- (Transition.origin
- Nowhere
- Nothing
- (Just "horn_result"))
- reconstructedTarget
- reconstructedPrepared
- reconstructedAccepted
- builderWithHornInputs)
- reconstructedModule <-
- expectRight
- (Transition.sealTransitionModule
- Checking.initialLegacyCheckingEnvironment
- reconstructedBuilder)
- reconstructedFact <-
- case Vector.unsnoc
- (Transition.transitionAdmittedFacts
- reconstructedModule) of
- Just (_earlier, finalFact) ->
- pure finalFact
- Nothing ->
- assertFailure
- "expected a reconstructed admitted fact"
- >> fail "unreachable"
- assertBool
- "supported accepted task becomes a reconstructed kernel proof"
- (Transition.admittedFactIsReconstructedKernelProof
- reconstructedFact)
- reconstructedTrust <-
- maybe
- (assertFailure
- "expected typed reconstructed trust")
- pure
- (Transition.admittedFactTypedTrustDependencies
- reconstructedFact)
- assertEqual
- "reconstruction inherits its three exact assumptions"
- 3
- (Set.size
- (Transition.typedDeclaredAssumptionUses
- reconstructedTrust))
- assertEqual
- "reconstructed run adds no trusted Vampire leaf"
- Set.empty
- (Transition.typedTrustedVampireUses
- reconstructedTrust)
- assertEqual
- "reconstructed run adds no Vampire lowering trust"
- Set.empty
- (Transition.typedVampireLoweringUses
- reconstructedTrust)
- tinyKernelLimits <-
- expectRight
- (Derivation.kernelReplayLimits 1 10)
- let tinyKernelPolicy =
- Reconstruction.reconstructionPolicy
- (Reconstruction.reconstructionPolicyConnectionLimits
- Reconstruction.defaultReconstructionPolicy)
- tinyKernelLimits
- fallbackBuilder <-
- expectRight
- (Transition.commitTransitionTypedVampireFact
- tinyKernelPolicy
- ("horn_fallback" :| [])
- (Transition.origin
- Nowhere
- Nothing
- (Just "horn_fallback"))
- reconstructedTarget
- reconstructedPrepared
- reconstructedAccepted
- builderWithHornInputs)
- fallbackModule <-
- expectRight
- (Transition.sealTransitionModule
- Checking.initialLegacyCheckingEnvironment
- fallbackBuilder)
- fallbackFact <-
- case Vector.unsnoc
- (Transition.transitionAdmittedFacts
- fallbackModule) of
- Just (_earlier, finalFact) ->
- pure finalFact
- Nothing ->
- assertFailure
- "expected a kernel-exhaustion fallback fact"
- >> fail "unreachable"
- assertBool
- "kernel exhaustion retains accepted Vampire authority"
- (Transition.admittedFactIsTrustedVampire
- fallbackFact)
- where
- showResult = \case
- Left err ->
- "Left " <> show err
- Right _builder ->
- "Right builder"
-
-publishesTypedInductive :: Assertion
-publishesTypedInductive =
- withTemporaryDirectory "felix-transition-inductive" \temp -> do
- writeTheory
- (temp Posix.</> "entry.tex")
- []
- "entry"
- graph <- buildSearchedGraph temp "entry.tex"
- workspace <-
- expectRight
- =<< Parse.parseResolvedSourceGraph graph
- assignments <-
- expectRight
- (Legacy.assignLegacyModuleOrdinals
- workspace)
- assignment <-
- case toList assignments of
- [only] ->
- pure only
- actual ->
- assertFailure
- ("expected one module assignment, got "
- <> show (length actual))
- >> fail "unreachable"
- checkedFoundationValue <-
- expectRight Foundation.checkedFoundation
- builder <-
- expectRight
- (Transition.openTransitionModuleBuilder
- checkedFoundationValue
- Checking.initialLegacyCheckingEnvironment
- assignment
- [])
- let unprovedCarrier =
- TermOp Nowhere unprovedInductiveSymbol []
- unprovedBlocks =
- [ BlockInductive
- Nowhere
- "unproved_inductive"
- Inductive
- { inductiveSymbol =
- unprovedInductiveSymbol
- , inductiveParams = []
- , inductiveDomain =
- EmptySet Nowhere
- , inductiveIntros =
- IntroRule
- []
- ( EmptySet Nowhere
- `isElementOf`
- unprovedCarrier
- )
- :| []
- }
- ]
- unproved <-
- try
- (Checking.runCheckingBlocks
- unprovedBlocks
- (Checking.initialTransitionCheckingStateWithTaskPreparation
- Checking.WithoutDumpPremselTraining
- id
- builder
- (\_batch ->
- assertFailure
- "unproved inductive emitted a legacy obligation")))
- :: IO
- (Either
- Checking.CheckingError
- Checking.CheckingState)
- case unproved of
- Left checkingError ->
- assertBool
- "missing exact guard is reported"
- ("has no authorized typed fact"
- `Text.isInfixOf`
- Text.pack (show checkingError))
- Right _checked ->
- assertFailure
- "inductive with an unproved domain guard was admitted"
- unchanged <-
- expectRight
- (Transition.sealTransitionModule
- Checking.initialLegacyCheckingEnvironment
- builder)
- assertEqual
- "failed inductive publishes no global"
- 0
- (Vector.length
- (Transition.transitionAdmittedGlobals
- unchanged))
- assertEqual
- "failed inductive publishes no fact"
- 0
- (Vector.length
- (Transition.transitionAdmittedFacts
- unchanged))
- let parameter =
- NamedVar "domain"
- domain =
- TermOp
- Nowhere
- cumulSymbol
- [TermVar parameter]
- carrier =
- TermOp
- Nowhere
- typedInductiveSymbol
- [TermVar parameter]
- blocks =
- [ BlockInductive
- Nowhere
- "typed_inductive"
- Inductive
- { inductiveSymbol =
- typedInductiveSymbol
- , inductiveParams = [parameter]
- , inductiveDomain = domain
- , inductiveIntros =
- IntroRule
- []
- (TermVar parameter
- `isElementOf`
- carrier)
- :| []
- }
- ]
- checked <-
- Checking.runCheckingBlocks
- blocks
- (Checking.initialTransitionCheckingStateWithTaskPreparation
- Checking.WithoutDumpPremselTraining
- id
- builder
- (\_batch ->
- assertFailure
- "typed inductive emitted a legacy obligation"))
- finalBuilder <-
- maybe
- (assertFailure
- "checking lost its transition builder"
- >> fail "unreachable")
- pure
- (Checking.checkingTransitionModuleBuilder
- checked)
- admitted <-
- expectRight
- (Transition.sealTransitionModule
- (Checking.checkingStateEnvironment
- checked)
- finalBuilder)
- assertEqual
- "one transparent carrier"
- 1
- (Vector.length
- (Transition.transitionAdmittedGlobals
- admitted))
- assertEqual
- "four derived facts"
- [True, True, True, True]
- ( Transition.admittedFactIsKernelProof
- <$> Vector.toList
- (Transition.transitionAdmittedFacts
- admitted)
- )
- assertEqual
- "four replayed inductive facts"
- 4
- (Transition.transitionAdmittedKernelProofCount
- admitted)
- assertBool
- "foundation guard dependency is retained"
- (Foundation.UnivOfContains
- `Set.member`
- Transition.typedFoundationUses
- (Transition.transitionAdmittedTypedTrustDependencies
- admitted))
- where
- typedInductiveSymbol =
- mkMixfixItem
- [ Just (Command "typedfin")
- , Just InvisibleBraceL
- , Nothing
- , Just InvisibleBraceR
- ]
- "typed_inductive"
- NonAssoc
-
- cumulSymbol =
- mkMixfixItem
- [ Just (Command "cumul")
- , Just InvisibleBraceL
- , Nothing
- , Just InvisibleBraceR
- ]
- "cumul"
- NonAssoc
-
- unprovedInductiveSymbol =
- mkMixfixItem
- [Just (Command "unprovedfin")]
- "unproved_inductive"
- NonAssoc
-
-publishesLegacyImportViews :: Assertion
-publishesLegacyImportViews =
- withTemporaryDirectory "felix-legacy-import-view" \temp -> do
- writeTheory (temp Posix.</> "shared.tex") [] "shared"
- writeTheory
- (temp Posix.</> "a.tex")
- ["shared.tex"]
- "a"
- writeTheory
- (temp Posix.</> "b.tex")
- ["shared.tex"]
- "b"
- writeTheory
- (temp Posix.</> "entry.tex")
- ["a.tex", "b.tex"]
- "entry"
- graph <- buildSearchedGraph temp "entry.tex"
- workspace <-
- expectRight
- =<< Parse.parseResolvedSourceGraph graph
- assignments <-
- expectRight
- (Legacy.assignLegacyModuleOrdinals workspace)
- case toList assignments of
- [ sharedAssignment
- , aAssignment
- , bAssignment
- , entryAssignment
- ] -> do
- shared <-
- admitOne
- sharedAssignment
- (Legacy.emptyLegacyImportedView
- Checking.initialLegacyCheckingEnvironment)
- "shared_fact"
- Bottom
- (Location 1)
- sharedView <-
- expectRight
- (Legacy.legacyImportedView
- Checking.initialLegacyCheckingEnvironment
- [shared])
- a <-
- admitOne
- aAssignment
- sharedView
- "a_fact"
- Top
- (Location 2)
- b <-
- admitOne
- bAssignment
- sharedView
- "b_fact"
- Top
- (Location 3)
- diamondView <-
- expectRight
- (Legacy.legacyImportedView
- Checking.initialLegacyCheckingEnvironment
- [a, b])
- entry <-
- expectRight
- (Legacy.sealLegacyModuleStage
- (Legacy.legacyImportedCheckingEnvironment
- diamondView)
- (Legacy.openLegacyModuleStage
- entryAssignment
- diamondView))
- assertEqual
- "direct imports retain textual order"
- [1, 2]
- ( Legacy.legacyModuleOrdinalValue
- <$> Vector.toList
- (Legacy.legacyAdmittedDirectImports
- entry)
- )
- assertEqual
- "diamond facts retain imported source order"
- [0, 1, 2]
- ( Legacy.legacyModuleOrdinalValue
- . Legacy.legacyFactModule
- . Legacy.legacyFactEntryReference
- <$> Vector.toList
- (Legacy.legacyAdmittedVisibleFacts
- entry)
- )
- assertEqual
- "equal statements at different references remain"
- 3
- (Vector.length
- (Legacy.legacyAdmittedVisibleFacts entry))
- let environmentSymbol =
- SymbolMixfix
- (mkMixfixItem
- [Just
- (Command
- "module_environment")]
- "module_environment"
- NonAssoc)
- environmentWith body =
- Legacy.legacyCheckingEnvironment
- (HashMap.insert
- environmentSymbol
- (toScope body)
- (Legacy.legacyEnvironmentAbbreviations
- Checking.initialLegacyCheckingEnvironment))
- (Legacy.legacyEnvironmentPredicateDefinitions
- Checking.initialLegacyCheckingEnvironment)
- (Legacy.legacyEnvironmentDependencies
- Checking.initialLegacyCheckingEnvironment)
- (Legacy.legacyEnvironmentOwnedSymbols
- Checking.initialLegacyCheckingEnvironment)
- (Legacy.legacyEnvironmentOwnedSymbolMarkers
- Checking.initialLegacyCheckingEnvironment)
- (Legacy.legacyEnvironmentFrozenSymbols
- Checking.initialLegacyCheckingEnvironment)
- (Legacy.legacyEnvironmentStructs
- Checking.initialLegacyCheckingEnvironment)
- (Legacy.legacyEnvironmentDefinedMarkers
- Checking.initialLegacyCheckingEnvironment)
- environmentA <-
- admitEnvironment
- aAssignment
- (Legacy.emptyLegacyImportedView
- Checking.initialLegacyCheckingEnvironment)
- (environmentWith Top)
- environmentView <-
- expectRight
- (Legacy.legacyImportedView
- Checking.initialLegacyCheckingEnvironment
- [environmentA])
- assertEqual
- "admitted semantic environment is imported"
- (Just (toScope Top))
- (HashMap.lookup
- environmentSymbol
- (Legacy.legacyEnvironmentAbbreviations
- (Legacy.legacyImportedCheckingEnvironment
- environmentView)))
- environmentB <-
- admitEnvironment
- bAssignment
- (Legacy.emptyLegacyImportedView
- Checking.initialLegacyCheckingEnvironment)
- (environmentWith Bottom)
- case Legacy.legacyImportedView
- Checking.initialLegacyCheckingEnvironment
- [environmentA, environmentB] of
- Left Legacy.LegacyImportedEnvironmentConflict{} ->
- pure ()
- Left err ->
- assertFailure
- ("expected imported environment conflict, got "
- <> show err)
- Right _ ->
- assertFailure
- "expected imported environment conflict"
-
- conflictingA <-
- admitOne
- aAssignment
- (Legacy.emptyLegacyImportedView
- Checking.initialLegacyCheckingEnvironment)
- "conflicting"
- Top
- (Location 4)
- conflictingB <-
- admitOne
- bAssignment
- (Legacy.emptyLegacyImportedView
- Checking.initialLegacyCheckingEnvironment)
- "conflicting"
- Bottom
- (Location 5)
- case Legacy.legacyImportedView
- Checking.initialLegacyCheckingEnvironment
- [conflictingA, conflictingB] of
- Left Legacy.LegacyImportedAliasConflict{} ->
- pure ()
- Left err ->
- assertFailure
- ("expected imported alias conflict, got "
- <> show err)
- Right _ ->
- assertFailure
- "expected imported alias conflict"
- actual ->
- assertFailure
- ("expected four module assignments, got "
- <> show (length actual))
- where
- admitOne assignment imported alias statement location = do
- let stage =
- Legacy.openLegacyModuleStage
- assignment
- imported
- staged =
- Facts.stageFact
- (alias :| [])
- (Facts.factOrigin location alias)
- (Facts.prepareSemanticFact statement)
- reservation <-
- expectRight
- (Legacy.reserveLegacyDeclaration
- (staged :| [])
- stage)
- let reserved =
- NonEmpty.head
- (Legacy.legacyReservedFacts reservation)
- admitted =
- Legacy.authorizeLegacyDeclaredAssumption
- stage
- Legacy.DeclaredUserAxiom
- reserved
- stage' <-
- expectRight
- (Legacy.appendEstablishedLegacyDeclaration
- reservation
- (admitted :| [])
- stage)
- expectRight
- (Legacy.sealLegacyModuleStage
- (Legacy.legacyImportedCheckingEnvironment imported)
- stage')
-
- admitEnvironment assignment imported finalEnvironment =
- expectRight
- (Legacy.sealLegacyModuleStage
- finalEnvironment
- (Legacy.openLegacyModuleStage assignment imported))
-
rejectsSiblingSyntaxLeakage :: Assertion
rejectsSiblingSyntaxLeakage =
withTemporaryDirectory "felix-source-syntax-world" \temp -> do
@@ -3667,48 +2027,6 @@ acceptsAdjectiveSignature =
_ ->
assertFailure
("unexpected adjective-signature blocks: " <> show blocks)
- semanticBlocks <- expectRight (Meaning.meaning blocks)
- void
- (Checking.check
- Checking.WithoutDumpPremselTraining
- semanticBlocks)
-
-rejectsQuantifiedSymbolicSignatureTerm :: Assertion
-rejectsQuantifiedSymbolicSignatureTerm =
- withTemporaryDirectory "felix-source-signature-quantified-term" \temp -> do
- writeFile
- (temp Posix.</> "entry.tex")
- (unlines
- [ "\\begin{definition}\\label{bridge}"
- , " $z$ is a bridge from $A$ to $B$ iff $z = z$ and $A = A$ and $B = B$."
- , "\\end{definition}"
- , "\\begin{signature}\\label{bridge_signature}"
- , " $\\foo{A}$ is a bridge from every set $x$ to $x$."
- , "\\end{signature}"
- ])
- graph <- buildSearchedGraph temp "entry.tex"
- workspace <- expectRight
- =<< Parse.parseResolvedSourceGraph graph
- case Meaning.meaning
- (Parse.importedBeforeImporterBlocks workspace) of
- Left (Meaning.QuantifiedTermRequiresResolvedContext location) -> do
- assertEqual "quantified term file"
- "entry.tex"
- (locFile location)
- assertEqual "quantified term line"
- 5
- (locLine location)
- assertEqual "quantified term column"
- 30
- (locColumn location)
- Left err ->
- assertFailure
- ("expected quantified-term context error, got "
- <> show err)
- Right blocks ->
- assertFailure
- ("expected quantified-term context rejection, got "
- <> show blocks)
rejectsMalformedSignatureHead :: Assertion
rejectsMalformedSignatureHead = do
@@ -3902,162 +2220,6 @@ acceptsBuiltinPrefixPredicateDeclaration =
("unexpected built-in prefix declaration parse: "
<> show blocks)
-rejectsDuplicateFixedBaseSemantics :: Assertion
-rejectsDuplicateFixedBaseSemantics =
- withTemporaryDirectory "felix-source-builtin-collision" \temp -> do
- writeBuiltinZeroDefinition
- (temp Posix.</> "a.tex")
- "source_zero_a"
- writeFile
- (temp Posix.</> "entry.tex")
- ("\\import{a.tex}\n"
- <> builtinZeroDefinition "source_zero_b")
- graph <- buildSearchedGraph temp "entry.tex"
- workspace <- expectRight
- =<< Parse.parseResolvedSourceGraph graph
- assignments <-
- expectRight
- (Legacy.assignLegacyModuleOrdinals workspace)
- case toList assignments of
- [acceptedAssignment, collidingAssignment] -> do
- let acceptedParsed =
- Legacy.assignedParsedModule acceptedAssignment
- collidingParsed =
- Legacy.assignedParsedModule collidingAssignment
- acceptedLocation <-
- onlySyntaxOccurrenceLocation acceptedParsed
- collidingLocation <-
- onlySyntaxOccurrenceLocation collidingParsed
- assertLocation
- "accepted declaration"
- "a.tex"
- 1
- acceptedLocation
- assertLocation
- "colliding declaration"
- "entry.tex"
- 2
- collidingLocation
- assertEqual
- "fixed reuses emit no syntax delta"
- [[], []]
- [ Interface.canonicalSyntaxDeltaEntries
- (Interface.moduleSyntaxLocalDelta
- (Parse.parsedModuleSyntaxInterface parsed))
- | parsed <- [acceptedParsed, collidingParsed]
- ]
-
- checkedFoundationValue <-
- expectRight Foundation.checkedFoundation
- (acceptedBlocks, glossState) <-
- glossParsedBlocks
- Meaning.initialGlossState
- acceptedParsed
- acceptedBuilder <-
- expectRight
- (Transition.openTransitionModuleBuilder
- checkedFoundationValue
- Checking.initialLegacyCheckingEnvironment
- acceptedAssignment
- [])
- acceptedState <-
- Checking.runCheckingBlocks
- acceptedBlocks
- (checkingState acceptedBuilder)
- finalAcceptedBuilder <-
- expectJust
- "accepted transition builder"
- (Checking.checkingTransitionModuleBuilder
- acceptedState)
- acceptedModule <-
- expectRight
- (Transition.sealTransitionModule
- (Checking.checkingStateEnvironment
- acceptedState)
- finalAcceptedBuilder)
-
- (collidingBlocks, _finalGlossState) <-
- glossParsedBlocks glossState collidingParsed
- collidingBuilder <-
- expectRight
- (Transition.openTransitionModuleBuilder
- checkedFoundationValue
- Checking.initialLegacyCheckingEnvironment
- collidingAssignment
- [acceptedModule])
- result <-
- try
- (Checking.runCheckingBlocks
- collidingBlocks
- (checkingState collidingBuilder))
- :: IO
- (Either
- Checking.CheckingError
- Checking.CheckingState)
- case result of
- Left
- (Checking.CheckingError
- message
- location
- marker) -> do
- assertEqual
- "semantic collision location"
- collidingLocation
- location
- assertEqual
- "semantic collision marker"
- "source_zero_b"
- marker
- assertBool
- "accepted owner is identified"
- ("already owned by abbreviation source_zero_a"
- `Text.isInfixOf` message)
- Left err ->
- assertFailure
- ("expected located ownership collision, got "
- <> show err)
- Right _checked ->
- assertFailure
- "duplicate fixed-base semantics were accepted"
- actual ->
- assertFailure
- ("expected two module assignments, got "
- <> show (length actual))
- where
- checkingState builder =
- Checking.initialTransitionCheckingStateWithTaskPreparation
- Checking.WithoutDumpPremselTraining
- id
- builder
- (\_batch ->
- assertFailure
- "fixed-base abbreviation emitted an obligation")
-
- glossParsedBlocks initialState parsed =
- fmap
- (\(reversed, finalState) ->
- (reverse reversed, finalState))
- (foldM
- glossOne
- ([], initialState)
- (Parse.parsedModuleBlocks parsed))
-
- glossOne (reversed, state) raw = do
- (block, nextState) <-
- expectRight (Meaning.glossStep state raw)
- pure (block : reversed, nextState)
-
- onlySyntaxOccurrenceLocation parsed =
- case Parse.parsedModuleSyntaxOccurrences parsed of
- [occurrence] ->
- pure
- (Parse.parsedSyntaxOccurrenceLocation
- occurrence)
- occurrences ->
- assertFailure
- ("expected one fixed-base occurrence, got "
- <> show occurrences)
-
avoidsAliasImportLexiconCollision :: Assertion
avoidsAliasImportLexiconCollision =
withTemporaryDirectory "felix-source-alias-lexicon" \temp -> do
diff --git a/source/Test/Unit/Store.hs b/source/Test/Unit/Store.hs
index 9f25a3b..e2896c3 100644
--- a/source/Test/Unit/Store.hs
+++ b/source/Test/Unit/Store.hs
@@ -21,6 +21,7 @@ import Felix.Store qualified as Store
import Provers qualified
import Syntax.Interface qualified as Syntax
+import Control.Concurrent (threadDelay)
import Control.Exception qualified as Exception
import Data.ByteString qualified as ByteString
import Data.ByteString.Char8 qualified as ByteString.Char8
@@ -33,6 +34,7 @@ import System.FilePath.Posix qualified as Posix
import System.IO.Temp qualified as Temp
import Test.Tasty
import Test.Tasty.HUnit
+import UnliftIO.Async (concurrently)
unitTests :: TestTree
@@ -40,6 +42,8 @@ unitTests =
testGroup "SQLite store"
[ testCase "initializes and reopens the current schema"
initializesAndReopensCurrentSchema
+ , testCase "serializes invocation-local coordinator access"
+ serializesCoordinatorAccess
, testCase "rejects incompatibility without configuring the store"
rejectsIncompatibilityWithoutConfiguration
, testCase "rejects malformed compatibility metadata"
@@ -80,6 +84,28 @@ unitTests =
doesNotFallBackAfterFatalStartup
]
+serializesCoordinatorAccess :: Assertion
+serializesCoordinatorAccess = do
+ coordinator <- Store.newStoreCoordinator
+ active <- IORef.newIORef (0 :: Int)
+ maximumActive <- IORef.newIORef (0 :: Int)
+ let operation =
+ Store.withStoreCoordinator coordinator
+ (Exception.bracket_
+ (IORef.atomicModifyIORef' active
+ (\current ->
+ let next = current + 1
+ in (next, ())))
+ (IORef.atomicModifyIORef' active
+ (\current -> (current - 1, ())))
+ (do
+ current <- IORef.readIORef active
+ IORef.atomicModifyIORef' maximumActive
+ (\observed -> (max current observed, ()))
+ threadDelay 50000))
+ void (concurrently operation operation)
+ IORef.readIORef maximumActive >>= assertEqual "maximum owner count" 1
+
roundTripsExactParsedArtifacts :: Assertion
roundTripsExactParsedArtifacts =
withStoreFixture "felix-store-parsed" \path theory _fixture -> do
diff --git a/source/Test/Unit/Symdiff.hs b/source/Test/Unit/Symdiff.hs
deleted file mode 100644
index ec62fda..0000000
--- a/source/Test/Unit/Symdiff.hs
+++ /dev/null
@@ -1,132 +0,0 @@
-module Test.Unit.Symdiff where
-
-import Base
-import Bound.Scope
-import Bound.Var
-import Syntax.Internal
-import Filter
-import Report.Location
-
-import Data.Map qualified as Map
-import Data.Set qualified as Set
-import Data.Text qualified as Text
-
-mixfix :: [Maybe Token] -> FunctionSymbol
-mixfix pat = mkMixfixItem pat (markerFromPattern pat) NonAssoc
- where
- markerFromPattern = \case
- Just tok : _ -> markerFromToken tok
- Nothing : rest -> markerFromPattern rest
- [] -> Marker "mixfix"
-
-subsetSymbol :: RelationSymbol
-subsetSymbol =
- RelationSymbol (Command "subset") zeroParameterArity "subset"
-
-adjInhabited :: LexicalItem
-adjInhabited = mkLexicalItem [Just (Word "inhabited")] "inhabited"
-
-adjDisjointFrom :: LexicalItem
-adjDisjointFrom = mkLexicalItem [Just (Word "disjoint"), Just (Word "from"), Nothing] "disjoint"
-
-filtersWell :: Bool
-filtersWell = badFact `notElem` (hypothesisFormula <$> taskHypotheses (filterTask symdiff))
-
-
-handlesStructAndApply :: Bool
-handlesStructAndApply =
- let
- structOp = StructSymbol "foo_op"
- structTerm = TermSymbolStruct structOp (Just (TermVar (NamedVar "A")))
- formula = Apply (TermVar (NamedVar "f")) (structTerm :| [])
- hypo = Hypothesis
- { hypothesisMarker = Marker "struct_apply"
- , hypothesisFormula = formula
- }
- in Map.member hypo (relevantFacts passmark formula (Set.singleton hypo))
-
-
-badFact :: ExprOf a
-badFact = Quantified Universally (Scope (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "FreshReplacementVar")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]]) (Quantified Existentially (Scope (Connected Conjunction (Connected Conjunction (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (F (TermVar (B (NamedVar "A"))))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "b")), TermVar (F (TermVar (B (NamedVar "B"))))])) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermVar (F (TermVar (B (NamedVar "FreshReplacementVar")))), TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Word "pair")])) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "b"))]]))))))
-
-
-symdiff :: Task
-symdiff =
- Task
- { taskDirectness = Direct
- , taskLocation = Nowhere
- , taskConjectureLabel = Marker "symdiff_test"
- , taskHypotheses = zipWith
- Hypothesis
- (Marker . Text.pack . show <$> ([1..] :: [Int]))
- [ Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "A"))], TermVar (B (NamedVar "A"))]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "B")), TermVar (B (NamedVar "A"))]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "A")), TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "emptyset")])) []], TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "emptyset")])) []]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "x")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "y")), TermVar (B (NamedVar "z"))]], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "y"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "z"))]]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "x")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "y")), TermVar (B (NamedVar "z"))]], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "y"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "z"))]]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))], TermVar (B (NamedVar "C"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "A")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "B")), TermVar (B (NamedVar "C"))]]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "x"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "emptyset")])) []]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "x")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "y")), TermVar (B (NamedVar "z"))]], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "y"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "z"))]]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "x")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "y"))]], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "y"))]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "x")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "y")), TermVar (B (NamedVar "z"))]], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "y"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "z"))]]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "x")), TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "emptyset")])) []], TermVar (B (NamedVar "x"))]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "symdiff"), Nothing])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "y"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "y"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "y")), TermVar (B (NamedVar "x"))]]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermVar (B (NamedVar "X")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "Y")), TermVar (B (NamedVar "Z"))]], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermVar (B (NamedVar "X")), TermVar (B (NamedVar "Y"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermVar (B (NamedVar "X")), TermVar (B (NamedVar "Z"))]]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermVar (B (NamedVar "X")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "Y")), TermVar (B (NamedVar "Z"))]], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermVar (B (NamedVar "X")), TermVar (B (NamedVar "Y"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermVar (B (NamedVar "X")), TermVar (B (NamedVar "Z"))]]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "X")), TermVar (B (NamedVar "Y"))], TermVar (B (NamedVar "Z"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermVar (B (NamedVar "X")), TermVar (B (NamedVar "Z"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermVar (B (NamedVar "Y")), TermVar (B (NamedVar "Z"))]]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "X")), TermVar (B (NamedVar "Y"))], TermVar (B (NamedVar "Z"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermVar (B (NamedVar "X")), TermVar (B (NamedVar "Z"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermVar (B (NamedVar "Y")), TermVar (B (NamedVar "Z"))]]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "A"))], TermVar (B (NamedVar "A"))]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "B")), TermVar (B (NamedVar "A"))]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "A")), TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "emptyset")])) []], TermVar (B (NamedVar "A"))]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "x")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "y")), TermVar (B (NamedVar "z"))]], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "y"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "z"))]]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))], TermVar (B (NamedVar "C"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "A")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "B")), TermVar (B (NamedVar "C"))]]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "inters"), Just InvisibleBraceL, Nothing, Just InvisibleBraceR])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "Pow"), Just InvisibleBraceL, Nothing, Just InvisibleBraceR])) [TermVar (B (NamedVar "A"))]], TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "emptyset")])) []]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "unions"), Just InvisibleBraceL, Nothing, Just InvisibleBraceR])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "Pow"), Just InvisibleBraceL, Nothing, Just InvisibleBraceR])) [TermVar (B (NamedVar "A"))]], TermVar (B (NamedVar "A"))]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "fst"), Just InvisibleBraceL, Nothing, Just InvisibleBraceR])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Word "pair")])) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "b"))]], TermVar (B (NamedVar "a"))]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "snd"), Just InvisibleBraceL, Nothing, Just InvisibleBraceR])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Word "pair")])) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "b"))]], TermVar (B (NamedVar "b"))]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "A")), TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "Pow"), Just InvisibleBraceL, Nothing, Just InvisibleBraceR])) [TermVar (B (NamedVar "A"))]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "x")), TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "Cons"), Just InvisibleBraceL, Nothing, Just InvisibleBraceR, Just InvisibleBraceL, Nothing, Just InvisibleBraceR])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "X"))]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "emptyset")])) [], TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "Pow"), Just InvisibleBraceL, Nothing, Just InvisibleBraceR])) [TermVar (B (NamedVar "A"))]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation NeqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Word "pair")])) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "b"))], TermVar (B (NamedVar "a"))]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation NeqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Word "pair")])) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "b"))], TermVar (B (NamedVar "b"))]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "A"))]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermVar (B (NamedVar "A")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))], TermVar (B (NamedVar "A"))]))
- , Quantified Universally (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "emptyset")])) [], TermVar (B (NamedVar "a"))]))
- , Quantified Universally (Scope (Connected Implication (TermSymbol Nowhere (SymbolPredicate (PredicateAdj adjDisjointFrom)) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]) (TermSymbol Nowhere (SymbolPredicate (PredicateAdj adjDisjointFrom)) [TermVar (B (NamedVar "B")), TermVar (B (NamedVar "A"))])))
- , Quantified Universally (Scope (Connected Implication (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))], TermVar (B (NamedVar "B"))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))])))
- , Quantified Universally (Scope (Connected Implication (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "A"))])))
- , Quantified Universally (Scope (Connected Implication (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]]) (Not Nowhere (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "B"))]))))
- , Quantified Universally (Scope (Connected Implication (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Word "pair")])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "y"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermVar (B (NamedVar "X")), TermVar (B (NamedVar "Y"))]]) (Connected Conjunction (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "X"))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "y")), TermVar (B (NamedVar "Y"))]))))
- , Quantified Universally (Scope (Connected Implication (TermSymbol Nowhere (SymbolPredicate (PredicateRelation NeqSymbol)) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]) (Quantified Existentially (Scope (Connected ExclusiveOr (Connected Conjunction (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "c")), TermVar (F (TermVar (B (NamedVar "A"))))]) (Not Nowhere (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "c")), TermVar (F (TermVar (B (NamedVar "B"))))]))) (Connected Conjunction (Not Nowhere (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "c")), TermVar (F (TermVar (B (NamedVar "A"))))])) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "c")), TermVar (F (TermVar (B (NamedVar "B"))))])))))))
- , Quantified Universally (Scope (Connected Implication (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))], TermVar (B (NamedVar "B"))])))
- , Quantified Universally (Scope (Connected Implication (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermVar (B (NamedVar "X")), TermVar (B (NamedVar "Y"))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermVar (B (NamedVar "X")), TermVar (B (NamedVar "Z"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermVar (B (NamedVar "Y")), TermVar (B (NamedVar "Z"))]])))
- , Quantified Universally (Scope (Connected Implication (Connected Conjunction (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "A"))]) (Not Nowhere (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "B"))]))) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]])))
- , Quantified Universally (Scope (Connected Implication (Connected Conjunction (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "X"))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "y")), TermVar (B (NamedVar "Y"))])) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Word "pair")])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "y"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermVar (B (NamedVar "X")), TermVar (B (NamedVar "Y"))]])))
- , Quantified Universally (Scope (Connected Implication (Connected Conjunction (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermVar (B (NamedVar "B")), TermVar (B (NamedVar "A"))])) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))])))
- , Quantified Universally (Scope (Connected Implication (Connected Conjunction (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermVar (B (NamedVar "B")), TermVar (B (NamedVar "C"))])) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "C"))])))
- , Quantified Universally (Scope (Connected Implication (Connected Conjunction (PropositionalConstant IsTop) (PropositionalConstant IsTop)) (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]]) (Connected Disjunction (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "A"))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "B"))])))))
- , Quantified Universally (Scope (Connected Implication (Connected Conjunction (Not Nowhere (TermSymbol Nowhere (SymbolPredicate (PredicateAdj adjInhabited)) [TermVar (B (NamedVar "x"))])) (Not Nowhere (TermSymbol Nowhere (SymbolPredicate (PredicateAdj adjInhabited)) [TermVar (B (NamedVar "y"))]))) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "y"))])))
- , Quantified Universally (Scope (Connected Implication (Quantified Universally (Scope (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (F (TermVar (B (NamedVar "A"))))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (F (TermVar (B (NamedVar "B"))))])))) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))])))
- , Quantified Universally (Scope (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateAdj adjDisjointFrom)) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]) (Quantified Universally (Scope (Not Nowhere (Quantified Existentially (Scope (Connected Conjunction (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (F (TermVar (F (TermVar (B (NamedVar "A"))))))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (F (TermVar (F (TermVar (B (NamedVar "B"))))))])))))))))
- , Quantified Universally (Scope (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateAdj adjInhabited)) [TermVar (B (NamedVar "A"))]) (Quantified Universally (Scope (Quantified Existentially (Scope (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (F (TermVar (F (TermVar (B (NamedVar "A"))))))])))))))
- , Quantified Universally (Scope (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateAdj adjInhabited)) [TermVar (B (NamedVar "A"))]) (Not Nowhere (Not Nowhere (TermSymbol Nowhere (SymbolPredicate (PredicateAdj adjInhabited)) [TermVar (B (NamedVar "A"))])))))
- , Quantified Universally (Scope (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Word "pair")])) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "b"))], TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Word "pair")])) [TermVar (B (NamedVar "aprime")), TermVar (B (NamedVar "bprime"))]]) (Connected Conjunction (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "aprime"))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermVar (B (NamedVar "b")), TermVar (B (NamedVar "bprime"))]))))
- , Quantified Universally (Scope (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Word "pair")])) [TermVar (B (NamedVar "a")), TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Word "pair")])) [TermVar (B (NamedVar "b")), TermVar (B (NamedVar "c"))]], TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Word "pair")])) [TermVar (B (NamedVar "aprime")), TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Word "pair")])) [TermVar (B (NamedVar "bprime")), TermVar (B (NamedVar "cprime"))]]]) (Connected Conjunction (Connected Conjunction (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "aprime"))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermVar (B (NamedVar "b")), TermVar (B (NamedVar "bprime"))])) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermVar (B (NamedVar "c")), TermVar (B (NamedVar "cprime"))]))))
- , Quantified Universally (Scope (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "B")), TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "Pow"), Just InvisibleBraceL, Nothing, Just InvisibleBraceR])) [TermVar (B (NamedVar "A"))]]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermVar (B (NamedVar "B")), TermVar (B (NamedVar "A"))])))
- , badFact
- , Quantified Universally (Scope (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]]) (Connected Conjunction (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "A"))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "B"))]))))
- , Quantified Universally (Scope (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]]) (Connected Conjunction (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "A"))]) (Not Nowhere (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (B (NamedVar "B"))])))))
- , Quantified Universally (Scope (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "x")), TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "Cons"), Just InvisibleBraceL, Nothing, Just InvisibleBraceR, Just InvisibleBraceL, Nothing, Just InvisibleBraceR])) [TermVar (B (NamedVar "y")), TermVar (B (NamedVar "X"))]]) (Connected Disjunction (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "y"))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "X"))]))))
- , Quantified Universally (Scope (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "z")), TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "inters"), Just InvisibleBraceL, Nothing, Just InvisibleBraceR])) [TermVar (B (NamedVar "X"))]]) (Connected Conjunction (TermSymbol Nowhere (SymbolPredicate (PredicateAdj adjInhabited)) [TermVar (B (NamedVar "X"))]) (Quantified Universally (Scope (Connected Implication (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "Y")), TermVar (F (TermVar (B (NamedVar "X"))))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (F (TermVar (B (NamedVar "z")))), TermVar (B (NamedVar "Y"))])))))))
- , Quantified Universally (Scope (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "z")), TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "unions"), Just InvisibleBraceL, Nothing, Just InvisibleBraceR])) [TermVar (B (NamedVar "X"))]]) (Quantified Existentially (Scope (Connected Conjunction (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "Y")), TermVar (F (TermVar (B (NamedVar "X"))))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (F (TermVar (B (NamedVar "z")))), TermVar (B (NamedVar "Y"))]))))))
- , Quantified Universally (Scope (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateRelation subsetSymbol)) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]) (Quantified Universally (Scope (Connected Conjunction (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermVar (F (TermVar (B (NamedVar "A")))), TermVar (F (TermVar (B (NamedVar "B"))))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation NeqSymbol)) [TermVar (F (TermVar (B (NamedVar "A")))), TermVar (F (TermVar (B (NamedVar "B"))))]))))))
- , Quantified Universally (Scope (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation EqSymbol)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))], TermVar (B (NamedVar "A"))])))
- , Quantified Universally (Scope (Connected Equivalence (TermSymbol Nowhere (SymbolPredicate (PredicateRelation SubseteqSymbol)) [TermVar (B (NamedVar "A")), TermVar (B (NamedVar "B"))]) (Quantified Universally (Scope (Quantified Universally (Scope (Connected Implication (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (F (TermVar (F (TermVar (B (NamedVar "A"))))))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermVar (F (TermVar (F (TermVar (B (NamedVar "B"))))))]))))))))
- , Quantified Universally (Scope (Connected Equivalence (Not Nowhere (TermSymbol Nowhere (SymbolPredicate (PredicateAdj adjInhabited)) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "times"), Nothing])) [TermVar (B (NamedVar "X")), TermVar (B (NamedVar "Y"))]])) (Connected Disjunction (Not Nowhere (TermSymbol Nowhere (SymbolPredicate (PredicateAdj adjInhabited)) [TermVar (B (NamedVar "X"))])) (Not Nowhere (TermSymbol Nowhere (SymbolPredicate (PredicateAdj adjInhabited)) [TermVar (B (NamedVar "Y"))])))))
- , Quantified Universally (Scope (Quantified Universally (Scope (Connected Implication (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (F (TermVar (B (NamedVar "y")))), TermVar (B (NamedVar "X"))]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (F (TermVar (B (NamedVar "y")))), TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "Cons"), Just InvisibleBraceL, Nothing, Just InvisibleBraceR, Just InvisibleBraceL, Nothing, Just InvisibleBraceR])) [TermVar (B (NamedVar "x")), TermVar (B (NamedVar "X"))]])))))
- , Quantified Universally (Scope (Not Nowhere (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (NamedVar "a")), TermSymbol Nowhere (SymbolMixfix (mixfix [Just (Command "emptyset")])) []])))
- ]
- , taskConjecture =
- Quantified Universally (Scope (Connected Implication (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (FreshVar 0)), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "setminus"), Nothing])) [TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "union"), Nothing])) [TermVar (F (TermVar (NamedVar "x"))), TermVar (F (TermVar (NamedVar "y")))], TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "inter"), Nothing])) [TermVar (F (TermVar (NamedVar "y"))), TermVar (F (TermVar (NamedVar "x")))]]]) (TermSymbol Nowhere (SymbolPredicate (PredicateRelation ElementSymbol)) [TermVar (B (FreshVar 0)), TermSymbol Nowhere (SymbolMixfix (mixfix [Nothing, Just (Command "symdiff"), Nothing])) [TermVar (F (TermVar (NamedVar "x"))), TermVar (F (TermVar (NamedVar "y")))]])))
- }
diff --git a/source/Test/Unit/Token.hs b/source/Test/Unit/Token.hs
index b676f55..d399e2a 100644
--- a/source/Test/Unit/Token.hs
+++ b/source/Test/Unit/Token.hs
@@ -22,6 +22,8 @@ unitTests = testGroup "Lexer"
, testCase "braces inside text do not close the text frame" textBraceNesting
, testCase "cases is tokenized as an environment only inside math" casesOnlyInsideMath
, testCase "imports retain source locations and POSIX spellings" locatedImports
+ , testCase "commented environment starts are ignored"
+ ignoresCommentedEnvironmentStart
, testCase "empty inputs construct empty lexical syntax"
constructsEmptyLexicalSyntax
, testCase "extracts exact source fixity pragmas"
@@ -130,6 +132,24 @@ locatedImports = do
Right imports ->
assertFailure ("expected two imports, got " <> show imports)
+ignoresCommentedEnvironmentStart :: Assertion
+ignoresCommentedEnvironmentStart = do
+ let raw = Text.unlines
+ [ "% \\begin{signature}"
+ , "ordinary text"
+ , "\\begin{struct}"
+ , " an ordered set $X$ is a onesorted structure."
+ , "\\end{struct}"
+ ]
+ (_, chunks) <-
+ either
+ (assertFailure . errorBundlePretty)
+ pure
+ (runLexer (FileId maxBound) "commented-environment" raw)
+ case chunks of
+ [Located{unLocated = BeginEnv "struct"} : _] -> pure ()
+ _ -> assertFailure ("expected the real structure environment, got " <> show chunks)
+
constructsEmptyLexicalSyntax :: Assertion
constructsEmptyLexicalSyntax =
forM_
diff --git a/source/Tptp/UnsortedFirstOrder.hs b/source/Tptp/UnsortedFirstOrder.hs
index 7042df3..8291d28 100644
--- a/source/Tptp/UnsortedFirstOrder.hs
+++ b/source/Tptp/UnsortedFirstOrder.hs
@@ -77,8 +77,6 @@ isProperVariable name = case Text.uncons name of
data Role
= Axiom
- | AxiomUseful -- ^ Annotated axiom for trainig premise selection.
- | AxiomRedundant -- ^ Annotated axiom for trainig premise selection.
| Hypothesis
| Conjecture
| NegatedConjecture
@@ -141,8 +139,6 @@ buildName = \case
buildRole :: Role -> TextBuilder
buildRole = \case
Axiom -> "axiom"
- AxiomUseful -> "axiom_useful"
- AxiomRedundant -> "axiom_redundant"
Hypothesis -> "hypothesis"
Conjecture -> "conjecture"
NegatedConjecture -> "negated_conjecture"
diff --git a/test/golden/abbr/encoding tasks.golden b/test/golden/abbr/encoding tasks.golden
deleted file mode 100644
index cc4e8d9..0000000
--- a/test/golden/abbr/encoding tasks.golden
+++ /dev/null
@@ -1,26 +0,0 @@
-fof(zf_q0,conjecture,~?[V0]:zf_u0(V0,zf_f0)=>~?[V1]:zf_u0(V1,zf_f0)).
-------------------
-fof(zf_q0,conjecture,![V0]:V0=V0).
-fof(zf_h0,axiom,![V1]:(~?[V2]:zf_u0(V2,V1)=>~?[V3]:zf_u0(V3,V1))).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f1=>zf_f0=zf_f1).
-fof(zf_h0,axiom,![V0]:(~?[V1]:zf_u0(V1,V0)=>~?[V2]:zf_u0(V2,V0))).
-fof(zf_h1,axiom,![V3]:V3=V3).
-------------------
-fof(zf_q0,conjecture,~zf_u0(zf_f0,zf_f1)=>~zf_u0(zf_f0,zf_f1)).
-fof(zf_h0,axiom,![V0,V1]:(V0=V1=>V0=V1)).
-fof(zf_h1,axiom,![V2]:(~?[V3]:zf_u0(V3,V2)=>~?[V4]:zf_u0(V4,V2))).
-fof(zf_h2,axiom,![V5]:V5=V5).
-------------------
-fof(zf_q0,conjecture,zf_u0(zf_f0,zf_f1)=>zf_u0(zf_f0,zf_f1)).
-fof(zf_h0,axiom,![V0,V1]:(V0=V1=>V0=V1)).
-fof(zf_h1,axiom,![V2,V3]:(~zf_u0(V2,V3)=>~zf_u0(V2,V3))).
-fof(zf_h2,axiom,![V4]:(~?[V5]:zf_u0(V5,V4)=>~?[V6]:zf_u0(V6,V4))).
-fof(zf_h3,axiom,![V7]:V7=V7).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f1=>zf_f0=zf_f1).
-fof(zf_h0,axiom,![V0,V1]:(V0=V1=>V0=V1)).
-fof(zf_h1,axiom,![V2,V3]:(zf_u0(V2,V3)=>zf_u0(V2,V3))).
-fof(zf_h2,axiom,![V4,V5]:(~zf_u0(V4,V5)=>~zf_u0(V4,V5))).
-fof(zf_h3,axiom,![V6]:(~?[V7]:zf_u0(V7,V6)=>~?[V8]:zf_u0(V8,V6))).
-fof(zf_h4,axiom,![V9]:V9=V9). \ No newline at end of file
diff --git a/test/golden/abbr/generating tasks.golden b/test/golden/abbr/generating tasks.golden
deleted file mode 100644
index 7802f08..0000000
--- a/test/golden/abbr/generating tasks.golden
+++ /dev/null
@@ -1,1307 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses = []
- , taskConjectureLabel = Marker "dummy_abbr_test_adj"
- , taskLocation = Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 5
- , locColumn = 1
- }
- , taskConjecture = Connected Implication
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 54
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "x" )
- )
- )
- ]
- )
- )
- )
- )
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 54
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "x" )
- )
- )
- ]
- )
- )
- )
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "dummy_abbr_test_adj" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 54
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 54
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "dummy_abbr_test_noun"
- , taskLocation = Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 15
- , locColumn = 1
- }
- , taskConjecture = Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 12
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "dummy_abbr_test_noun" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 12
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- , Hypothesis Marker "dummy_abbr_test_adj" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 54
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 54
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "dummy_abbr_test_verb"
- , taskLocation = Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 25
- , locColumn = 1
- }
- , taskConjecture = Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 22
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 26
- , locColumn = 38
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "dummy_abbr_test_verb" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 22
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 26
- , locColumn = 38
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "dummy_abbr_test_noun" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 12
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- , Hypothesis Marker "dummy_abbr_test_adj" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 54
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 54
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "abbr_test_notin"
- , taskLocation = Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 31
- , locColumn = 1
- }
- , taskConjecture = Connected Implication
- ( Not
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- )
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 32
- , locColumn = 31
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 32
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "abbr_test_notin" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Not
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 32
- , locColumn = 31
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 32
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "dummy_abbr_test_verb" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 22
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 26
- , locColumn = 38
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "dummy_abbr_test_noun" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 12
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- , Hypothesis Marker "dummy_abbr_test_adj" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 54
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 54
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "abbr_test_elementof_is_in"
- , taskLocation = Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 37
- , locColumn = 1
- }
- , taskConjecture = Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 38
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "abbr_test_elementof_is_in" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 38
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "abbr_test_notin" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Not
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 32
- , locColumn = 31
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 32
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "dummy_abbr_test_verb" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 22
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 26
- , locColumn = 38
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "dummy_abbr_test_noun" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 12
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- , Hypothesis Marker "dummy_abbr_test_adj" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 54
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 54
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "abbr_test_equals_is_eq"
- , taskLocation = Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 43
- , locColumn = 1
- }
- , taskConjecture = Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 44
- , locColumn = 32
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- }
-] \ No newline at end of file
diff --git a/test/golden/abbr/glossing.golden b/test/golden/abbr/glossing.golden
deleted file mode 100644
index 412f914..0000000
--- a/test/golden/abbr/glossing.golden
+++ /dev/null
@@ -1,519 +0,0 @@
-[ BlockAbbr
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "empty" )
- ( Abbreviation
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "empty" ) End
- )
- ( Marker "empty" )
- )
- )
- )
- ( Scope
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 2
- , locColumn = 54
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B 0 )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( Marker "dummy_abbr_test_adj" )
- ( Lemma []
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 6
- , locColumn = 14
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "empty" ) End
- )
- ( Marker "empty" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 6
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "empty" ) End
- )
- ( Marker "empty" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- )
- )
-, BlockAbbr
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 11
- , locColumn = 1
- }
- )
- ( Marker "function" )
- ( Abbreviation
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "function" ) End
- , pl = TokenCons
- ( Word "functions" ) End
- }
- )
- ( Marker "function" )
- )
- )
- )
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 12
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B 0 )
- , TermVar
- ( B 0 )
- ]
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 15
- , locColumn = 1
- }
- )
- ( Marker "dummy_abbr_test_noun" )
- ( Lemma []
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 16
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "function" ) End
- , pl = TokenCons
- ( Word "functions" ) End
- }
- )
- ( Marker "function" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- )
-, BlockAbbr
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 21
- , locColumn = 1
- }
- )
- ( Marker "converges" )
- ( Abbreviation
- ( SymbolPredicate
- ( PredicateVerb
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "converges" )
- ( TokenCons
- ( Word "to" ) ( HoleCons End )
- )
- , pl = TokenCons
- ( Word "converge" )
- ( TokenCons
- ( Word "to" ) ( HoleCons End )
- )
- }
- )
- ( Marker "converges" )
- )
- )
- )
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 22
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B 0 )
- , TermVar
- ( B 1 )
- ]
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 25
- , locColumn = 1
- }
- )
- ( Marker "dummy_abbr_test_verb" )
- ( Lemma []
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 26
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateVerb
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "converges" )
- ( TokenCons
- ( Word "to" ) ( HoleCons End )
- )
- , pl = TokenCons
- ( Word "converge" )
- ( TokenCons
- ( Word "to" ) ( HoleCons End )
- )
- }
- )
- ( Marker "converges" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 26
- , locColumn = 38
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 31
- , locColumn = 1
- }
- )
- ( Marker "abbr_test_notin" )
- ( Lemma []
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 32
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "notin" )
- ( ParameterArity 0 )
- ( Marker "notelem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( Not
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 32
- , locColumn = 31
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 32
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 37
- , locColumn = 1
- }
- )
- ( Marker "abbr_test_elementof_is_in" )
- ( Lemma []
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 38
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "element" )
- ( TokenCons
- ( Word "of" ) ( HoleCons End )
- )
- , pl = TokenCons
- ( Word "elements" )
- ( TokenCons
- ( Word "of" ) ( HoleCons End )
- )
- }
- )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 38
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 43
- , locColumn = 1
- }
- )
- ( Marker "abbr_test_equals_is_eq" )
- ( Lemma []
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 44
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateVerb
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "equals" ) ( HoleCons End )
- , pl = TokenCons
- ( Word "equal" ) ( HoleCons End )
- }
- )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/abbr.tex"
- , locLine = 44
- , locColumn = 32
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/abbr/verification.golden b/test/golden/abbr/verification.golden
deleted file mode 100644
index 698681a..0000000
--- a/test/golden/abbr/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 6
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 0
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/byRef/encoding tasks.golden b/test/golden/byRef/encoding tasks.golden
deleted file mode 100644
index 8a406af..0000000
--- a/test/golden/byRef/encoding tasks.golden
+++ /dev/null
@@ -1,22 +0,0 @@
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-fof(zf_h0,axiom,![V0]:V0=V0).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-fof(zf_h0,axiom,![V0]:V0=V0).
-------------------
-fof(zf_q0,conjecture,![V0]:V0=V0).
-fof(zf_h0,axiom,![V1]:V1=V1).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-fof(zf_h0,axiom,![V0]:V0=V0).
-fof(zf_h1,axiom,![V1]:V1=V1).
-fof(zf_h2,axiom,![V2]:V2=V2).
-fof(zf_h3,axiom,![V3]:V3=V3).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-fof(zf_h0,axiom,![V0]:V0=V0).
-fof(zf_h1,axiom,![V1]:V1=V1).
-fof(zf_h2,axiom,![V2]:V2=V2).
-fof(zf_h3,axiom,![V3]:V3=V3). \ No newline at end of file
diff --git a/test/golden/byRef/generating tasks.golden b/test/golden/byRef/generating tasks.golden
deleted file mode 100644
index 8e80b28..0000000
--- a/test/golden/byRef/generating tasks.golden
+++ /dev/null
@@ -1,519 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses = []
- , taskConjectureLabel = Marker "prop1"
- , taskLocation = Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 1
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "a" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "prop1" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- )
- ]
- , taskConjectureLabel = Marker "prop2"
- , taskLocation = Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 5
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 6
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "b" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "prop1" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- )
- ]
- , taskConjectureLabel = Marker "prop3"
- , taskLocation = Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 13
- , locColumn = 5
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 10
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "c" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "prop1" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- )
- ]
- , taskConjectureLabel = Marker "prop4"
- , taskLocation = Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 20
- , locColumn = 5
- }
- , taskConjecture = Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 20
- , locColumn = 28
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "prop3" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 10
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- , Hypothesis Marker "prop2" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 6
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- , Hypothesis Marker "prop1" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- )
- , Hypothesis Marker "_local_1" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 20
- , locColumn = 28
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ]
- , taskConjectureLabel = Marker "prop4"
- , taskLocation = Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 21
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 17
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "e" )
- , TermVar
- ( NamedVar "e" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "prop4" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 17
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- ]
- )
- )
- , Hypothesis Marker "prop3" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 10
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- , Hypothesis Marker "prop2" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 6
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- , Hypothesis Marker "prop1" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- )
- ]
- , taskConjectureLabel = Marker "prop5"
- , taskLocation = Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 23
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 24
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "f" )
- , TermVar
- ( NamedVar "f" )
- ]
- }
-] \ No newline at end of file
diff --git a/test/golden/byRef/glossing.golden b/test/golden/byRef/glossing.golden
deleted file mode 100644
index 0af8bbb..0000000
--- a/test/golden/byRef/glossing.golden
+++ /dev/null
@@ -1,245 +0,0 @@
-[ BlockLemma
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "prop1" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "a" )
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( Marker "prop2" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 6
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "b" )
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( Marker "prop3" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 10
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "c" )
- ]
- )
- )
-, BlockProof
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 12
- , locColumn = 1
- }
- )
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 14
- , locColumn = 1
- }
- )
- ( Qed
- { mloc = Just
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 13
- , locColumn = 5
- }
- )
- , by = JustificationRef
- ( Marker "prop1" :| [] )
- }
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 16
- , locColumn = 1
- }
- )
- ( Marker "prop4" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 17
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "e" )
- , TermVar
- ( NamedVar "e" )
- ]
- )
- )
-, BlockProof
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 19
- , locColumn = 1
- }
- )
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 21
- , locColumn = 1
- }
- )
- ( Have
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 20
- , locColumn = 5
- }
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 20
- , locColumn = 28
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- )
- ( JustificationRef
- ( Marker "prop1" :| [] )
- )
- ( Qed
- { mloc = Nothing
- , by = JustificationEmpty
- }
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 23
- , locColumn = 1
- }
- )
- ( Marker "prop5" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/byRef.tex"
- , locLine = 24
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "f" )
- , TermVar
- ( NamedVar "f" )
- ]
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/byRef/verification.golden b/test/golden/byRef/verification.golden
deleted file mode 100644
index 9b3d1de..0000000
--- a/test/golden/byRef/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 6
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 1
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/calc/encoding tasks.golden b/test/golden/calc/encoding tasks.golden
deleted file mode 100644
index cf23f08..0000000
--- a/test/golden/calc/encoding tasks.golden
+++ /dev/null
@@ -1,58 +0,0 @@
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-fof(zf_h0,axiom,![V0]:V0=V0).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-fof(zf_h0,axiom,![V0]:V0=V0).
-fof(zf_h1,axiom,![V1]:V1=V1).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-fof(zf_h0,axiom,![V0]:V0=V0).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-fof(zf_h0,axiom,![V0]:V0=V0).
-fof(zf_h1,axiom,![V1]:V1=V1).
-fof(zf_h2,axiom,zf_f0=zf_f0).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-fof(zf_h0,axiom,![V0]:V0=V0).
-fof(zf_h1,axiom,![V1]:V1=V1).
-fof(zf_h2,axiom,![V2]:V2=V2).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-fof(zf_h0,axiom,![V0]:V0=V0).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-fof(zf_h0,axiom,![V0]:V0=V0).
-fof(zf_h1,axiom,![V1]:V1=V1).
-fof(zf_h2,axiom,![V2]:V2=V2).
-fof(zf_h3,axiom,zf_f0=zf_f0<=>zf_f0=zf_f0).
-------------------
-fof(zf_q0,conjecture,![V0]:(zf_u0(V0,zf_f0)=>V0=V0)).
-fof(zf_h0,axiom,![V1]:V1=V1).
-fof(zf_h1,axiom,![V2]:V2=V2).
-fof(zf_h2,axiom,![V3]:V3=V3).
-fof(zf_h3,axiom,![V4]:V4=V4).
-------------------
-fof(zf_q0,conjecture,![V0]:(zf_u0(V0,zf_f0)=>V0=V0)).
-fof(zf_h0,axiom,![V1]:(zf_u0(V1,zf_f0)=>V1=V1)).
-fof(zf_h1,axiom,![V2]:V2=V2).
-fof(zf_h2,axiom,![V3]:V3=V3).
-fof(zf_h3,axiom,![V4]:V4=V4).
-fof(zf_h4,axiom,![V5]:V5=V5).
-------------------
-fof(zf_q0,conjecture,![V0]:((zf_u0(V0,zf_f0)&V0=V0)=>V0=V0)).
-fof(zf_h0,axiom,![V1]:![V2]:(zf_u0(V2,V1)=>V2=V2)).
-fof(zf_h1,axiom,![V3]:V3=V3).
-fof(zf_h2,axiom,![V4]:V4=V4).
-fof(zf_h3,axiom,![V5]:V5=V5).
-fof(zf_h4,axiom,![V6]:V6=V6).
-------------------
-fof(zf_q0,conjecture,![V0]:((zf_u0(V0,zf_f0)&V0=V0)=>V0=V0)).
-fof(zf_h0,axiom,![V1]:![V2]:(zf_u0(V2,V1)=>V2=V2)).
-fof(zf_h1,axiom,![V3]:((zf_u0(V3,zf_f0)&V3=V3)=>V3=V3)).
-fof(zf_h2,axiom,![V4]:V4=V4).
-fof(zf_h3,axiom,![V5]:V5=V5).
-fof(zf_h4,axiom,![V6]:V6=V6).
-fof(zf_h5,axiom,![V7]:V7=V7). \ No newline at end of file
diff --git a/test/golden/calc/generating tasks.golden b/test/golden/calc/generating tasks.golden
deleted file mode 100644
index a6ae184..0000000
--- a/test/golden/calc/generating tasks.golden
+++ /dev/null
@@ -1,1775 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses = []
- , taskConjectureLabel = Marker "trivial"
- , taskLocation = Location
- { locFile = "test/examples/calc.tex"
- , locLine = 1
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "x" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "trivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ]
- , taskConjectureLabel = Marker "irrelevant"
- , taskLocation = Location
- { locFile = "test/examples/calc.tex"
- , locLine = 5
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 6
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "z" )
- , TermVar
- ( NamedVar "z" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "irrelevant" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 6
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- , Hypothesis Marker "trivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ]
- , taskConjectureLabel = Marker "alsotrivial"
- , taskLocation = Location
- { locFile = "test/examples/calc.tex"
- , locLine = 13
- , locColumn = 5
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "y" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "trivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ]
- , taskConjectureLabel = Marker "alsotrivial"
- , taskLocation = Location
- { locFile = "test/examples/calc.tex"
- , locLine = 13
- , locColumn = 5
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "y" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "irrelevant" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 6
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- , Hypothesis Marker "trivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- , Hypothesis Marker "_local_1" TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "y" )
- ]
- ]
- , taskConjectureLabel = Marker "alsotrivial"
- , taskLocation = Location
- { locFile = "test/examples/calc.tex"
- , locLine = 20
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 10
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "y" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "alsotrivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 10
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- , Hypothesis Marker "irrelevant" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 6
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- , Hypothesis Marker "trivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ]
- , taskConjectureLabel = Marker "trivial_biconditionals"
- , taskLocation = Location
- { locFile = "test/examples/calc.tex"
- , locLine = 26
- , locColumn = 5
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 27
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "y" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "trivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ]
- , taskConjectureLabel = Marker "trivial_biconditionals"
- , taskLocation = Location
- { locFile = "test/examples/calc.tex"
- , locLine = 26
- , locColumn = 5
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 30
- , locColumn = 21
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "y" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "alsotrivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 10
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- , Hypothesis Marker "irrelevant" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 6
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- , Hypothesis Marker "trivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- , Hypothesis Marker "_local_1" Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 27
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 30
- , locColumn = 21
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ]
- , taskConjectureLabel = Marker "trivial_biconditionals"
- , taskLocation = Location
- { locFile = "test/examples/calc.tex"
- , locLine = 33
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 23
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "y" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "trivial_biconditionals" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 23
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- , Hypothesis Marker "alsotrivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 10
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- , Hypothesis Marker "irrelevant" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 6
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- , Hypothesis Marker "trivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ]
- , taskConjectureLabel = Marker "bounded_calc"
- , taskLocation = Location
- { locFile = "test/examples/calc.tex"
- , locLine = 39
- , locColumn = 5
- }
- , taskConjecture = Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 39
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "trivial_biconditionals" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 23
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- , Hypothesis Marker "alsotrivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 10
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- , Hypothesis Marker "irrelevant" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 6
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- , Hypothesis Marker "trivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- , Hypothesis Marker "_local_1" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 39
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "bounded_calc"
- , taskLocation = Location
- { locFile = "test/examples/calc.tex"
- , locLine = 44
- , locColumn = 1
- }
- , taskConjecture = Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 36
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 36
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "bounded_calc" Quantified Universally
- ( Scope
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 36
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "A" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 36
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "trivial_biconditionals" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 23
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- , Hypothesis Marker "alsotrivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 10
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- , Hypothesis Marker "irrelevant" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 6
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- , Hypothesis Marker "trivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ]
- , taskConjectureLabel = Marker "bounded_calc_such_that"
- , taskLocation = Location
- { locFile = "test/examples/calc.tex"
- , locLine = 50
- , locColumn = 5
- }
- , taskConjecture = Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 50
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 50
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "bounded_calc" Quantified Universally
- ( Scope
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 36
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "A" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 36
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "trivial_biconditionals" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 23
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- , Hypothesis Marker "alsotrivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 10
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- , Hypothesis Marker "irrelevant" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 6
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- , Hypothesis Marker "trivial" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- , Hypothesis Marker "_local_1" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 50
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 50
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "bounded_calc_such_that"
- , taskLocation = Location
- { locFile = "test/examples/calc.tex"
- , locLine = 55
- , locColumn = 1
- }
- , taskConjecture = Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 47
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 47
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 47
- , locColumn = 52
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- }
-] \ No newline at end of file
diff --git a/test/golden/calc/glossing.golden b/test/golden/calc/glossing.golden
deleted file mode 100644
index ccf40c4..0000000
--- a/test/golden/calc/glossing.golden
+++ /dev/null
@@ -1,574 +0,0 @@
-[ BlockLemma
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "trivial" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "x" )
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( Marker "irrelevant" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 6
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "z" )
- , TermVar
- ( NamedVar "z" )
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( Marker "alsotrivial" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 10
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- )
-, BlockProof
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 12
- , locColumn = 1
- }
- )
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 20
- , locColumn = 1
- }
- )
- ( Calc
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 13
- , locColumn = 5
- }
- ) CalcUnquantified
- ( Equation
- ( TermVar
- ( NamedVar "y" )
- )
- (
- ( TermVar
- ( NamedVar "y" )
- , JustificationEmpty
- ) :|
- [
- ( TermVar
- ( NamedVar "y" )
- , JustificationRef
- ( Marker "trivial" :| [] )
- )
- ]
- )
- )
- ( Qed
- { mloc = Nothing
- , by = JustificationEmpty
- }
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 22
- , locColumn = 1
- }
- )
- ( Marker "trivial_biconditionals" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 23
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- )
-, BlockProof
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 25
- , locColumn = 1
- }
- )
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 33
- , locColumn = 1
- }
- )
- ( Calc
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 26
- , locColumn = 5
- }
- ) CalcUnquantified
- ( Biconditionals
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 27
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- (
- ( PropositionalConstant IsTop
- , JustificationEmpty
- ) :|
- [
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 30
- , locColumn = 21
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "y" )
- ]
- , JustificationRef
- ( Marker "trivial" :| [] )
- )
- ]
- )
- )
- ( Qed
- { mloc = Nothing
- , by = JustificationEmpty
- }
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 35
- , locColumn = 1
- }
- )
- ( Marker "bounded_calc" )
- ( Lemma []
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 36
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 36
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- )
- )
-, BlockProof
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 38
- , locColumn = 1
- }
- )
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 44
- , locColumn = 1
- }
- )
- ( Calc
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 39
- , locColumn = 5
- }
- )
- ( CalcForall
- ( NamedVar "x" :| [] )
- ( Just
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 39
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "A" )
- ]
- )
- )
- )
- ( Equation
- ( TermVar
- ( NamedVar "x" )
- )
- (
- ( TermVar
- ( NamedVar "x" )
- , JustificationEmpty
- ) :| []
- )
- )
- ( Qed
- { mloc = Nothing
- , by = JustificationEmpty
- }
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 46
- , locColumn = 1
- }
- )
- ( Marker "bounded_calc_such_that" )
- ( Lemma []
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 47
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 47
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 47
- , locColumn = 52
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- )
- )
-, BlockProof
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 49
- , locColumn = 1
- }
- )
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 55
- , locColumn = 1
- }
- )
- ( Calc
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 50
- , locColumn = 5
- }
- )
- ( CalcForall
- ( NamedVar "x" :| [] )
- ( Just
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 50
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "A" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/calc.tex"
- , locLine = 50
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "x" )
- ]
- )
- )
- )
- )
- ( Equation
- ( TermVar
- ( NamedVar "x" )
- )
- (
- ( TermVar
- ( NamedVar "x" )
- , JustificationEmpty
- ) :| []
- )
- )
- ( Qed
- { mloc = Nothing
- , by = JustificationEmpty
- }
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/calc/verification.golden b/test/golden/calc/verification.golden
deleted file mode 100644
index 5e297bb..0000000
--- a/test/golden/calc/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 12
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 4
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/coord/encoding tasks.golden b/test/golden/coord/encoding tasks.golden
deleted file mode 100644
index ec5d906..0000000
--- a/test/golden/coord/encoding tasks.golden
+++ /dev/null
@@ -1,53 +0,0 @@
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-fof(zf_h0,axiom,![V0]:(zf_u0(V0)<=>V0=V0)).
-fof(zf_h1,axiom,![V1]:(zf_u1(V1)<=>V1=V1)).
-fof(zf_h2,axiom,![V2]:(zf_u2(V2)<=>V2=V2)).
-fof(zf_h3,axiom,zf_u2(zf_f0)).
-fof(zf_h4,axiom,zf_u2(zf_f1)).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-fof(zf_h0,axiom,![V0,V1]:((zf_u2(V0)&zf_u2(V1))=>V0=V0)).
-fof(zf_h1,axiom,![V2]:(zf_u0(V2)<=>V2=V2)).
-fof(zf_h2,axiom,![V3]:(zf_u1(V3)<=>V3=V3)).
-fof(zf_h3,axiom,![V4]:(zf_u2(V4)<=>V4=V4)).
-fof(zf_h4,axiom,zf_u2(zf_f0)&zf_u1(zf_f0)).
-fof(zf_h5,axiom,zf_u2(zf_f1)&zf_u1(zf_f1)).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-fof(zf_h0,axiom,![V0,V1]:((zf_u2(V0)&zf_u1(V0)&zf_u2(V1)&zf_u1(V1))=>V0=V0)).
-fof(zf_h1,axiom,![V2,V3]:((zf_u2(V2)&zf_u2(V3))=>V2=V2)).
-fof(zf_h2,axiom,![V4]:(zf_u0(V4)<=>V4=V4)).
-fof(zf_h3,axiom,![V5]:(zf_u1(V5)<=>V5=V5)).
-fof(zf_h4,axiom,![V6]:(zf_u2(V6)<=>V6=V6)).
-fof(zf_h5,axiom,zf_u1(zf_f0)&zf_u0(zf_f1)).
-fof(zf_h6,axiom,zf_u2(zf_f0)).
-fof(zf_h7,axiom,zf_u2(zf_f1)).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f1<=>(zf_u2(zf_f0)&zf_f0=zf_f1)).
-fof(zf_h0,axiom,![V0,V1]:((zf_u1(V0)&zf_u0(V1)&zf_u2(V0)&zf_u2(V1))=>V0=V0)).
-fof(zf_h1,axiom,![V2,V3]:((zf_u2(V2)&zf_u1(V2)&zf_u2(V3)&zf_u1(V3))=>V2=V2)).
-fof(zf_h2,axiom,![V4,V5]:((zf_u2(V4)&zf_u2(V5))=>V4=V4)).
-fof(zf_h3,axiom,![V6]:(zf_u0(V6)<=>V6=V6)).
-fof(zf_h4,axiom,![V7]:(zf_u1(V7)<=>V7=V7)).
-fof(zf_h5,axiom,![V8]:(zf_u2(V8)<=>V8=V8)).
-------------------
-fof(zf_q0,conjecture,zf_u1(zf_f0)&zf_u0(zf_f0)).
-fof(zf_h0,axiom,![V0,V1]:((zf_u1(V0)&zf_u0(V1)&zf_u2(V0)&zf_u2(V1))=>V0=V0)).
-fof(zf_h1,axiom,![V2,V3]:((zf_u2(V2)&zf_u1(V2)&zf_u2(V3)&zf_u1(V3))=>V2=V2)).
-fof(zf_h2,axiom,![V4,V5]:((zf_u2(V4)&zf_u2(V5))=>V4=V4)).
-fof(zf_h3,axiom,![V6,V7]:(V6=V7<=>(zf_u2(V6)&V6=V7))).
-fof(zf_h4,axiom,![V8]:(zf_u0(V8)<=>V8=V8)).
-fof(zf_h5,axiom,![V9]:(zf_u1(V9)<=>V9=V9)).
-fof(zf_h6,axiom,![V10]:(zf_u2(V10)<=>V10=V10)).
-------------------
-fof(zf_q0,conjecture,zf_u2(zf_f0)&zf_u1(zf_f0)&zf_u2(zf_f1)&zf_u1(zf_f1)).
-fof(zf_h0,axiom,![V0,V1]:((zf_u1(V0)&zf_u0(V1)&zf_u2(V0)&zf_u2(V1))=>V0=V0)).
-fof(zf_h1,axiom,![V2,V3]:((zf_u2(V2)&zf_u1(V2)&zf_u2(V3)&zf_u1(V3))=>V2=V2)).
-fof(zf_h2,axiom,![V4,V5]:((zf_u2(V4)&zf_u2(V5))=>V4=V4)).
-fof(zf_h3,axiom,![V6,V7]:(V6=V7<=>(zf_u2(V6)&V6=V7))).
-fof(zf_h4,axiom,![V8]:(zf_u0(V8)<=>V8=V8)).
-fof(zf_h5,axiom,![V9]:(zf_u1(V9)&zf_u0(V9))).
-fof(zf_h6,axiom,![V10]:(zf_u1(V10)<=>V10=V10)).
-fof(zf_h7,axiom,![V11]:(zf_u2(V11)<=>V11=V11)).
-fof(zf_h8,axiom,zf_u2(zf_f0)&zf_u1(zf_f0)).
-fof(zf_h9,axiom,zf_u2(zf_f1)&zf_u1(zf_f1)). \ No newline at end of file
diff --git a/test/golden/coord/generating tasks.golden b/test/golden/coord/generating tasks.golden
deleted file mode 100644
index ef6d0a8..0000000
--- a/test/golden/coord/generating tasks.golden
+++ /dev/null
@@ -1,3498 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "baz" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "baz" ) End
- )
- ( Marker "baz" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 10
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "foo" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 6
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "bar" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 2
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "_local_2" TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 14
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- , Hypothesis Marker "_local_1" TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 14
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- ]
- , taskConjectureLabel = Marker "nouns"
- , taskLocation = Location
- { locFile = "test/examples/coord.tex"
- , locLine = 13
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 15
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "x" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "nouns" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 14
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 14
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 15
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "baz" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "baz" ) End
- )
- ( Marker "baz" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 10
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "foo" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 6
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "bar" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 2
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "_local_2" Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- , Hypothesis Marker "_local_1" Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- ]
- , taskConjectureLabel = Marker "adj_nouns"
- , taskLocation = Location
- { locFile = "test/examples/coord.tex"
- , locLine = 18
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 20
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "x" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "adj_nouns" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 20
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "nouns" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 14
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 14
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 15
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "baz" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "baz" ) End
- )
- ( Marker "baz" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 10
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "foo" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 6
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "bar" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 2
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "_local_3" TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- , Hypothesis Marker "_local_2" TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- , Hypothesis Marker "_local_1" Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 56
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "baz" ) End
- )
- ( Marker "baz" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- ]
- , taskConjectureLabel = Marker "nouns_suchthat"
- , taskLocation = Location
- { locFile = "test/examples/coord.tex"
- , locLine = 24
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 26
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "x" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "nouns_suchthat" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 56
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "baz" ) End
- )
- ( Marker "baz" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 26
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "adj_nouns" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 20
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "nouns" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 14
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 14
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 15
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "baz" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "baz" ) End
- )
- ( Marker "baz" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 10
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "foo" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 6
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "bar" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 2
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "noun_verb"
- , taskLocation = Location
- { locFile = "test/examples/coord.tex"
- , locLine = 30
- , locColumn = 1
- }
- , taskConjecture = Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 31
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 31
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "noun_verb" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 31
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 31
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "nouns_suchthat" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 56
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "baz" ) End
- )
- ( Marker "baz" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 26
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "adj_nouns" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 20
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "nouns" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 14
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 14
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 15
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "baz" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "baz" ) End
- )
- ( Marker "baz" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 10
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "foo" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 6
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "bar" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 2
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "adjs"
- , taskLocation = Location
- { locFile = "test/examples/coord.tex"
- , locLine = 35
- , locColumn = 1
- }
- , taskConjecture = Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 36
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 36
- , locColumn = 20
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "baz" ) End
- )
- ( Marker "baz" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "adjs" Quantified Universally
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 36
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 36
- , locColumn = 20
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "baz" ) End
- )
- ( Marker "baz" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "noun_verb" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 31
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 31
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "nouns_suchthat" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 56
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "baz" ) End
- )
- ( Marker "baz" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 26
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "adj_nouns" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 20
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "nouns" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 14
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 14
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 15
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "baz" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "baz" ) End
- )
- ( Marker "baz" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 10
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "foo" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 6
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "bar" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 2
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "_local_2" Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 40
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 40
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- , Hypothesis Marker "_local_1" Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 40
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 40
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- ]
- , taskConjectureLabel = Marker "are_nouns"
- , taskLocation = Location
- { locFile = "test/examples/coord.tex"
- , locLine = 39
- , locColumn = 1
- }
- , taskConjecture = Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 41
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 41
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 41
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 41
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- )
- }
-] \ No newline at end of file
diff --git a/test/golden/coord/glossing.golden b/test/golden/coord/glossing.golden
deleted file mode 100644
index d1dcd41..0000000
--- a/test/golden/coord/glossing.golden
+++ /dev/null
@@ -1,818 +0,0 @@
-[ BlockDefn
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "bar" )
- ( DefnPredicate []
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- ( NamedVar "x" :| [] )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 2
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "x" )
- ]
- )
- )
-, BlockDefn
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( Marker "foo" )
- ( DefnPredicate []
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- ( NamedVar "x" :| [] )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 6
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "x" )
- ]
- )
- )
-, BlockDefn
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( Marker "baz" )
- ( DefnPredicate []
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "baz" ) End
- )
- ( Marker "baz" )
- )
- )
- ( NamedVar "x" :| [] )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 10
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "x" )
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 13
- , locColumn = 1
- }
- )
- ( Marker "nouns" )
- ( Lemma
- [ Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 14
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 14
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- ]
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 15
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "x" )
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 18
- , locColumn = 1
- }
- )
- ( Marker "adj_nouns" )
- ( Lemma
- [ Asm
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- )
- , Asm
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 19
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- )
- ]
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 20
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "x" )
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 24
- , locColumn = 1
- }
- )
- ( Marker "nouns_suchthat" )
- ( Lemma
- [ Asm
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 56
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "baz" ) End
- )
- ( Marker "baz" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 25
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- ]
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 26
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "x" )
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 30
- , locColumn = 1
- }
- )
- ( Marker "noun_verb" )
- ( Lemma []
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 31
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 31
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 35
- , locColumn = 1
- }
- )
- ( Marker "adjs" )
- ( Lemma []
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 36
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 36
- , locColumn = 20
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "baz" ) End
- )
- ( Marker "baz" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 39
- , locColumn = 1
- }
- )
- ( Marker "are_nouns" )
- ( Lemma
- [ Asm
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 40
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 40
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- )
- , Asm
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 40
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 40
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- )
- ]
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 41
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 41
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 41
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "bar" ) End
- , pl = TokenCons
- ( Word "bars" ) End
- }
- )
- ( Marker "bar" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/coord.tex"
- , locLine = 41
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "foo" ) End
- )
- ( Marker "foo" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- )
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/coord/verification.golden b/test/golden/coord/verification.golden
deleted file mode 100644
index 59ecffb..0000000
--- a/test/golden/coord/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 6
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 3
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/datatype/encoding tasks.golden b/test/golden/datatype/encoding tasks.golden
deleted file mode 100644
index 5be38a4..0000000
--- a/test/golden/datatype/encoding tasks.golden
+++ /dev/null
@@ -1,69 +0,0 @@
-fof(zf_q0,conjecture,zf_u6(zf_u3,zf_u4)).
-fof(zf_h0,axiom,![V0,V1,V2,V3]:(zf_u0(V0,V1)=zf_u0(V2,V3)=>(V0=V2&V1=V3))).
-fof(zf_h1,axiom,![V4,V5,V6]:zf_u5(V4)!=zf_u0(V5,V6)).
-fof(zf_h2,axiom,![V7,V8]:((zf_u6(V7,zf_u4)&zf_u6(V8,zf_u4))=>zf_u6(zf_u0(V7,V8),zf_u4))).
-fof(zf_h3,axiom,![V9,V10]:(zf_u5(V9)=zf_u5(V10)=>V9=V10)).
-fof(zf_h4,axiom,![V11,V12]:zf_u3!=zf_u0(V11,V12)).
-fof(zf_h5,axiom,![V13]:((zf_u6(zf_u3,V13)&![V14]:(zf_u6(V14,zf_u1(zf_u2,zf_u2))=>zf_u6(zf_u5(V14),V13))&![V15,V16]:((zf_u6(V15,V13)&zf_u6(V16,V13))=>zf_u6(zf_u0(V15,V16),V13)))=>![V17]:(zf_u6(V17,zf_u4)=>zf_u6(V17,V13)))).
-fof(zf_h6,axiom,![V18]:(zf_u6(V18,zf_u1(zf_u2,zf_u2))=>zf_u6(zf_u5(V18),zf_u4))).
-fof(zf_h7,axiom,![V19]:(zf_u6(V19,zf_u4)=>(V19=zf_u3|?[V20]:(zf_u6(V20,zf_u1(zf_u2,zf_u2))&V19=zf_u5(V20))|?[V21,V22]:(zf_u6(V21,zf_u4)&zf_u6(V22,zf_u4)&V19=zf_u0(V21,V22))))).
-fof(zf_h8,axiom,![V23]:zf_u3!=zf_u5(V23)).
-fof(zf_h9,axiom,zf_u6(zf_u3,zf_u4)).
-------------------
-fof(zf_q0,conjecture,zf_u6(zf_u2,zf_u1(zf_u2,zf_u2))=>zf_u6(zf_u5(zf_u2),zf_u4)).
-fof(zf_h0,axiom,![V0,V1,V2,V3]:(zf_u0(V0,V1)=zf_u0(V2,V3)=>(V0=V2&V1=V3))).
-fof(zf_h1,axiom,![V4,V5,V6]:zf_u5(V4)!=zf_u0(V5,V6)).
-fof(zf_h2,axiom,![V7,V8]:((zf_u6(V7,zf_u4)&zf_u6(V8,zf_u4))=>zf_u6(zf_u0(V7,V8),zf_u4))).
-fof(zf_h3,axiom,![V9,V10]:(zf_u5(V9)=zf_u5(V10)=>V9=V10)).
-fof(zf_h4,axiom,![V11,V12]:zf_u3!=zf_u0(V11,V12)).
-fof(zf_h5,axiom,![V13]:((zf_u6(zf_u3,V13)&![V14]:(zf_u6(V14,zf_u1(zf_u2,zf_u2))=>zf_u6(zf_u5(V14),V13))&![V15,V16]:((zf_u6(V15,V13)&zf_u6(V16,V13))=>zf_u6(zf_u0(V15,V16),V13)))=>![V17]:(zf_u6(V17,zf_u4)=>zf_u6(V17,V13)))).
-fof(zf_h6,axiom,![V18]:(zf_u6(V18,zf_u1(zf_u2,zf_u2))=>zf_u6(zf_u5(V18),zf_u4))).
-fof(zf_h7,axiom,![V19]:(zf_u6(V19,zf_u4)=>(V19=zf_u3|?[V20]:(zf_u6(V20,zf_u1(zf_u2,zf_u2))&V19=zf_u5(V20))|?[V21,V22]:(zf_u6(V21,zf_u4)&zf_u6(V22,zf_u4)&V19=zf_u0(V21,V22))))).
-fof(zf_h8,axiom,![V23]:zf_u3!=zf_u5(V23)).
-fof(zf_h9,axiom,zf_u6(zf_u3,zf_u4)).
-fof(zf_h10,axiom,zf_u6(zf_u3,zf_u4)).
-------------------
-fof(zf_q0,conjecture,zf_u6(zf_u0(zf_u3,zf_u3),zf_u4)).
-fof(zf_h0,axiom,![V0,V1,V2,V3]:(zf_u0(V0,V1)=zf_u0(V2,V3)=>(V0=V2&V1=V3))).
-fof(zf_h1,axiom,![V4,V5,V6]:zf_u5(V4)!=zf_u0(V5,V6)).
-fof(zf_h2,axiom,![V7,V8]:((zf_u6(V7,zf_u4)&zf_u6(V8,zf_u4))=>zf_u6(zf_u0(V7,V8),zf_u4))).
-fof(zf_h3,axiom,![V9,V10]:(zf_u5(V9)=zf_u5(V10)=>V9=V10)).
-fof(zf_h4,axiom,![V11,V12]:zf_u3!=zf_u0(V11,V12)).
-fof(zf_h5,axiom,![V13]:((zf_u6(zf_u3,V13)&![V14]:(zf_u6(V14,zf_u1(zf_u2,zf_u2))=>zf_u6(zf_u5(V14),V13))&![V15,V16]:((zf_u6(V15,V13)&zf_u6(V16,V13))=>zf_u6(zf_u0(V15,V16),V13)))=>![V17]:(zf_u6(V17,zf_u4)=>zf_u6(V17,V13)))).
-fof(zf_h6,axiom,![V18]:(zf_u6(V18,zf_u1(zf_u2,zf_u2))=>zf_u6(zf_u5(V18),zf_u4))).
-fof(zf_h7,axiom,![V19]:(zf_u6(V19,zf_u4)=>(V19=zf_u3|?[V20]:(zf_u6(V20,zf_u1(zf_u2,zf_u2))&V19=zf_u5(V20))|?[V21,V22]:(zf_u6(V21,zf_u4)&zf_u6(V22,zf_u4)&V19=zf_u0(V21,V22))))).
-fof(zf_h8,axiom,![V23]:zf_u3!=zf_u5(V23)).
-fof(zf_h9,axiom,zf_u6(zf_u2,zf_u1(zf_u2,zf_u2))=>zf_u6(zf_u5(zf_u2),zf_u4)).
-fof(zf_h10,axiom,zf_u6(zf_u3,zf_u4)).
-fof(zf_h11,axiom,zf_u6(zf_u3,zf_u4)).
-------------------
-fof(zf_q0,conjecture,zf_u3!=zf_u0(zf_u3,zf_u3)).
-fof(zf_h0,axiom,![V0,V1,V2,V3]:(zf_u0(V0,V1)=zf_u0(V2,V3)=>(V0=V2&V1=V3))).
-fof(zf_h1,axiom,![V4,V5,V6]:zf_u5(V4)!=zf_u0(V5,V6)).
-fof(zf_h2,axiom,![V7,V8]:((zf_u6(V7,zf_u4)&zf_u6(V8,zf_u4))=>zf_u6(zf_u0(V7,V8),zf_u4))).
-fof(zf_h3,axiom,![V9,V10]:(zf_u5(V9)=zf_u5(V10)=>V9=V10)).
-fof(zf_h4,axiom,![V11,V12]:zf_u3!=zf_u0(V11,V12)).
-fof(zf_h5,axiom,![V13]:((zf_u6(zf_u3,V13)&![V14]:(zf_u6(V14,zf_u1(zf_u2,zf_u2))=>zf_u6(zf_u5(V14),V13))&![V15,V16]:((zf_u6(V15,V13)&zf_u6(V16,V13))=>zf_u6(zf_u0(V15,V16),V13)))=>![V17]:(zf_u6(V17,zf_u4)=>zf_u6(V17,V13)))).
-fof(zf_h6,axiom,![V18]:(zf_u6(V18,zf_u1(zf_u2,zf_u2))=>zf_u6(zf_u5(V18),zf_u4))).
-fof(zf_h7,axiom,![V19]:(zf_u6(V19,zf_u4)=>(V19=zf_u3|?[V20]:(zf_u6(V20,zf_u1(zf_u2,zf_u2))&V19=zf_u5(V20))|?[V21,V22]:(zf_u6(V21,zf_u4)&zf_u6(V22,zf_u4)&V19=zf_u0(V21,V22))))).
-fof(zf_h8,axiom,![V23]:zf_u3!=zf_u5(V23)).
-fof(zf_h9,axiom,zf_u6(zf_u0(zf_u3,zf_u3),zf_u4)).
-fof(zf_h10,axiom,zf_u6(zf_u2,zf_u1(zf_u2,zf_u2))=>zf_u6(zf_u5(zf_u2),zf_u4)).
-fof(zf_h11,axiom,zf_u6(zf_u3,zf_u4)).
-fof(zf_h12,axiom,zf_u6(zf_u3,zf_u4)).
-------------------
-fof(zf_q0,conjecture,zf_u5(zf_f0)=zf_u5(zf_f1)=>zf_f0=zf_f1).
-fof(zf_h0,axiom,![V0,V1,V2,V3]:(zf_u0(V0,V1)=zf_u0(V2,V3)=>(V0=V2&V1=V3))).
-fof(zf_h1,axiom,![V4,V5,V6]:zf_u5(V4)!=zf_u0(V5,V6)).
-fof(zf_h2,axiom,![V7,V8]:((zf_u6(V7,zf_u4)&zf_u6(V8,zf_u4))=>zf_u6(zf_u0(V7,V8),zf_u4))).
-fof(zf_h3,axiom,![V9,V10]:(zf_u5(V9)=zf_u5(V10)=>V9=V10)).
-fof(zf_h4,axiom,![V11,V12]:zf_u3!=zf_u0(V11,V12)).
-fof(zf_h5,axiom,![V13]:((zf_u6(zf_u3,V13)&![V14]:(zf_u6(V14,zf_u1(zf_u2,zf_u2))=>zf_u6(zf_u5(V14),V13))&![V15,V16]:((zf_u6(V15,V13)&zf_u6(V16,V13))=>zf_u6(zf_u0(V15,V16),V13)))=>![V17]:(zf_u6(V17,zf_u4)=>zf_u6(V17,V13)))).
-fof(zf_h6,axiom,![V18]:(zf_u6(V18,zf_u1(zf_u2,zf_u2))=>zf_u6(zf_u5(V18),zf_u4))).
-fof(zf_h7,axiom,![V19]:(zf_u6(V19,zf_u4)=>(V19=zf_u3|?[V20]:(zf_u6(V20,zf_u1(zf_u2,zf_u2))&V19=zf_u5(V20))|?[V21,V22]:(zf_u6(V21,zf_u4)&zf_u6(V22,zf_u4)&V19=zf_u0(V21,V22))))).
-fof(zf_h8,axiom,![V23]:zf_u3!=zf_u5(V23)).
-fof(zf_h9,axiom,zf_u3!=zf_u0(zf_u3,zf_u3)).
-fof(zf_h10,axiom,zf_u6(zf_u0(zf_u3,zf_u3),zf_u4)).
-fof(zf_h11,axiom,zf_u6(zf_u2,zf_u1(zf_u2,zf_u2))=>zf_u6(zf_u5(zf_u2),zf_u4)).
-fof(zf_h12,axiom,zf_u6(zf_u3,zf_u4)).
-fof(zf_h13,axiom,zf_u6(zf_u3,zf_u4)). \ No newline at end of file
diff --git a/test/golden/datatype/generating tasks.golden b/test/golden/datatype/generating tasks.golden
deleted file mode 100644
index e052235..0000000
--- a/test/golden/datatype/generating tasks.golden
+++ /dev/null
@@ -1,8698 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "propform_propbot_intro" TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- , Hypothesis Marker "propform_propvar_intro" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- )
- , Hypothesis Marker "propform_propto_intro" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 78
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- )
- , Hypothesis Marker "propform_propbot_propvar_distinct" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n_rhs" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "propform_propbot_propto_distinct" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "propform_propvar_propto_distinct" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "propform_propvar_injective" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n_rhs" )
- )
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermVar
- ( B
- ( NamedVar "n_rhs" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "propform_propto_injective" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "propform_cases" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( Connected Disjunction
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- ]
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- ]
- )
- )
- )
- )
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 78
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- ]
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "propform_induct" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermVar
- ( B
- ( NamedVar "S" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "propform_bot_test"
- , taskLocation = Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 10
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 15
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 19
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "propform_bot_test" TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 15
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 19
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- , Hypothesis Marker "propform_propbot_intro" TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- , Hypothesis Marker "propform_propvar_intro" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- )
- , Hypothesis Marker "propform_propto_intro" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 78
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- )
- , Hypothesis Marker "propform_propbot_propvar_distinct" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n_rhs" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "propform_propbot_propto_distinct" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "propform_propvar_propto_distinct" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "propform_propvar_injective" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n_rhs" )
- )
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermVar
- ( B
- ( NamedVar "n_rhs" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "propform_propto_injective" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "propform_cases" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( Connected Disjunction
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- ]
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- ]
- )
- )
- )
- )
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 78
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- ]
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "propform_induct" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermVar
- ( B
- ( NamedVar "S" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "propform_var_test"
- , taskLocation = Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 14
- , locColumn = 1
- }
- , taskConjecture = Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 9
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 23
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 25
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 23
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 65
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 45
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 69
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "propform_var_test" Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 9
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 23
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 25
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 23
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 65
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 45
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 69
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- , Hypothesis Marker "propform_bot_test" TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 15
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 19
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- , Hypothesis Marker "propform_propbot_intro" TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- , Hypothesis Marker "propform_propvar_intro" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- )
- , Hypothesis Marker "propform_propto_intro" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 78
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- )
- , Hypothesis Marker "propform_propbot_propvar_distinct" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n_rhs" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "propform_propbot_propto_distinct" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "propform_propvar_propto_distinct" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "propform_propvar_injective" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n_rhs" )
- )
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermVar
- ( B
- ( NamedVar "n_rhs" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "propform_propto_injective" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "propform_cases" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( Connected Disjunction
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- ]
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- ]
- )
- )
- )
- )
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 78
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- ]
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "propform_induct" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermVar
- ( B
- ( NamedVar "S" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "propform_imp_test"
- , taskLocation = Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 18
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 7
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 7
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 24
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 38
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "propform_imp_test" TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 7
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 7
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 24
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 38
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- , Hypothesis Marker "propform_var_test" Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 9
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 23
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 25
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 23
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 65
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 45
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 69
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- , Hypothesis Marker "propform_bot_test" TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 15
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 19
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- , Hypothesis Marker "propform_propbot_intro" TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- , Hypothesis Marker "propform_propvar_intro" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- )
- , Hypothesis Marker "propform_propto_intro" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 78
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- )
- , Hypothesis Marker "propform_propbot_propvar_distinct" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n_rhs" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "propform_propbot_propto_distinct" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "propform_propvar_propto_distinct" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "propform_propvar_injective" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n_rhs" )
- )
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermVar
- ( B
- ( NamedVar "n_rhs" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "propform_propto_injective" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "propform_cases" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( Connected Disjunction
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- ]
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- ]
- )
- )
- )
- )
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 78
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- ]
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "propform_induct" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermVar
- ( B
- ( NamedVar "S" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "propform_distinct_test"
- , taskLocation = Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 22
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 23
- , locColumn = 15
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 23
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 23
- , locColumn = 21
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 23
- , locColumn = 21
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 23
- , locColumn = 38
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- ]
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "propform_distinct_test" TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 23
- , locColumn = 15
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 23
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 23
- , locColumn = 21
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 23
- , locColumn = 21
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 23
- , locColumn = 38
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- ]
- ]
- , Hypothesis Marker "propform_imp_test" TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 7
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 7
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 24
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 38
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- , Hypothesis Marker "propform_var_test" Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 9
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 23
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 25
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 23
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 65
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 45
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 69
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- , Hypothesis Marker "propform_bot_test" TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 15
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 19
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- , Hypothesis Marker "propform_propbot_intro" TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- , Hypothesis Marker "propform_propvar_intro" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- )
- , Hypothesis Marker "propform_propto_intro" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 78
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- )
- , Hypothesis Marker "propform_propbot_propvar_distinct" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n_rhs" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "propform_propbot_propto_distinct" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "propform_propvar_propto_distinct" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "propform_propvar_injective" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n_rhs" )
- )
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermVar
- ( B
- ( NamedVar "n_rhs" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "propform_propto_injective" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "p_rhs" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermVar
- ( B
- ( NamedVar "q_rhs" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "propform_cases" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( Connected Disjunction
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- ]
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- ]
- )
- )
- )
- )
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 78
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- ]
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "propform_induct" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermVar
- ( B
- ( NamedVar "S" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "n" )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "q" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- , TermVar
- ( B
- ( NamedVar "q" )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "S" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "propform_injective_test"
- , taskLocation = Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 26
- , locColumn = 1
- }
- , taskConjecture = Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 27
- , locColumn = 21
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 27
- , locColumn = 9
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 27
- , locColumn = 23
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 27
- , locColumn = 45
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- }
-] \ No newline at end of file
diff --git a/test/golden/datatype/glossing.golden b/test/golden/datatype/glossing.golden
deleted file mode 100644
index c9c52b8..0000000
--- a/test/golden/datatype/glossing.golden
+++ /dev/null
@@ -1,656 +0,0 @@
-[ BlockData
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "propform" )
- ( Datatype
- { datatypeHead = SymbolPattern
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- ) []
- , datatypeClauses = DatatypeClause
- { datatypeClauseConstructor = SymbolPattern
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- ) []
- , datatypeClausePremises = []
- } :|
- [ DatatypeClause
- { datatypeClauseConstructor = SymbolPattern
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- [ NamedVar "n" ]
- , datatypeClausePremises =
- [
- ( NamedVar "n"
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 6
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- )
- ]
- }
- , DatatypeClause
- { datatypeClauseConstructor = SymbolPattern
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- [ NamedVar "p"
- , NamedVar "q"
- ]
- , datatypeClausePremises =
- [
- ( NamedVar "p"
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 56
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- )
- ,
- ( NamedVar "q"
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 7
- , locColumn = 78
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- )
- ]
- }
- ]
- }
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 10
- , locColumn = 1
- }
- )
- ( Marker "propform_bot_test" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 15
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 11
- , locColumn = 19
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 14
- , locColumn = 1
- }
- )
- ( Marker "propform_var_test" )
- ( Lemma []
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 9
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 23
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 25
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 23
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 65
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 45
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 54
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 15
- , locColumn = 69
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 18
- , locColumn = 1
- }
- )
- ( Marker "propform_imp_test" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 7
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 7
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 24
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 19
- , locColumn = 38
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propform" ) End
- )
- ( Marker "propform" ) NonAssoc
- )
- ) []
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 22
- , locColumn = 1
- }
- )
- ( Marker "propform_distinct_test" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 23
- , locColumn = 15
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 23
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 23
- , locColumn = 21
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "propto" ) ( HoleCons End )
- )
- )
- ( Marker "propto" ) RightAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 23
- , locColumn = 21
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 23
- , locColumn = 38
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propbot" ) End
- )
- ( Marker "propbot" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 26
- , locColumn = 1
- }
- )
- ( Marker "propform_injective_test" )
- ( Lemma []
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 27
- , locColumn = 21
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 27
- , locColumn = 9
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 27
- , locColumn = 23
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "propvar" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "propvar" ) NonAssoc
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/datatype.tex"
- , locLine = 27
- , locColumn = 45
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/datatype/verification.golden b/test/golden/datatype/verification.golden
deleted file mode 100644
index f5e656e..0000000
--- a/test/golden/datatype/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 5
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 10
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/finite-set-terms/encoding tasks.golden b/test/golden/finite-set-terms/encoding tasks.golden
deleted file mode 100644
index 3a359a5..0000000
--- a/test/golden/finite-set-terms/encoding tasks.golden
+++ /dev/null
@@ -1,3 +0,0 @@
-fof(zf_q0,conjecture,zf_u3(zf_u1,zf_u2)).
-fof(zf_h0,axiom,![V0,V1,V2]:(zf_u3(V0,zf_u0(V1,V2))<=>(V0=V1|zf_u3(V0,V2)))).
-fof(zf_h1,axiom,![V3]:(zf_u3(V3,zf_u2)<=>(zf_u3(V3,zf_u1)|V3=zf_u1))). \ No newline at end of file
diff --git a/test/golden/finite-set-terms/generating tasks.golden b/test/golden/finite-set-terms/generating tasks.golden
deleted file mode 100644
index 1c396ab..0000000
--- a/test/golden/finite-set-terms/generating tasks.golden
+++ /dev/null
@@ -1,291 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "unit" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "any" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "unit" ) End
- )
- ( Marker "unit" ) NonAssoc
- )
- ) []
- ]
- )
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "any" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 6
- , locColumn = 14
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "any" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 6
- , locColumn = 16
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cons" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 2
- , locColumn = 7
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 2
- , locColumn = 11
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "X" )
- )
- ]
- ]
- )
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 2
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 2
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "X" )
- )
- ]
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "emptyset_in_unit"
- , taskLocation = Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 9
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 10
- , locColumn = 15
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 10
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 10
- , locColumn = 18
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "unit" ) End
- )
- ( Marker "unit" ) NonAssoc
- )
- ) []
- ]
- }
-] \ No newline at end of file
diff --git a/test/golden/finite-set-terms/glossing.golden b/test/golden/finite-set-terms/glossing.golden
deleted file mode 100644
index a531e00..0000000
--- a/test/golden/finite-set-terms/glossing.golden
+++ /dev/null
@@ -1,238 +0,0 @@
-[ BlockAxiom
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "cons" )
- ( Axiom []
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 2
- , locColumn = 7
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 2
- , locColumn = 11
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "X" )
- ]
- ]
- )
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 2
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 2
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "X" )
- ]
- )
- )
- )
- )
-, BlockDefn
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( Marker "unit" )
- ( DefnOp
- ( MixfixItem
- ( TokenCons
- ( Command "unit" ) End
- )
- ( Marker "unit" ) NonAssoc
- ) []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 6
- , locColumn = 14
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 6
- , locColumn = 16
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 6
- , locColumn = 14
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( Marker "emptyset_in_unit" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 10
- , locColumn = 15
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 10
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/finite-set-terms.tex"
- , locLine = 10
- , locColumn = 18
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "unit" ) End
- )
- ( Marker "unit" ) NonAssoc
- )
- ) []
- ]
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/finite-set-terms/verification.golden b/test/golden/finite-set-terms/verification.golden
deleted file mode 100644
index 6411375..0000000
--- a/test/golden/finite-set-terms/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 1
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 1
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 1
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/formula/encoding tasks.golden b/test/golden/formula/encoding tasks.golden
deleted file mode 100644
index cb7505e..0000000
--- a/test/golden/formula/encoding tasks.golden
+++ /dev/null
@@ -1,8 +0,0 @@
-fof(zf_q0,conjecture,![V0,V1]:(V0=V0&V1=V1)).
-------------------
-fof(zf_q0,conjecture,?[V0,V1]:V0=V1).
-fof(zf_h0,axiom,![V2,V3]:(V2=V2&V3=V3)).
-------------------
-fof(zf_q0,conjecture,?[V0,V1]:V0=V1<=>~?[V2]:V2!=V2).
-fof(zf_h0,axiom,![V3,V4]:(V3=V3&V4=V4)).
-fof(zf_h1,axiom,?[V5,V6]:V5=V6). \ No newline at end of file
diff --git a/test/golden/formula/generating tasks.golden b/test/golden/formula/generating tasks.golden
deleted file mode 100644
index 54c2012..0000000
--- a/test/golden/formula/generating tasks.golden
+++ /dev/null
@@ -1,331 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses = []
- , taskConjectureLabel = Marker "formula_test_forall"
- , taskLocation = Location
- { locFile = "test/examples/formula.tex"
- , locLine = 1
- , locColumn = 1
- }
- , taskConjecture = Quantified Universally
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 2
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 2
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "formula_test_forall" Quantified Universally
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 2
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 2
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "formula_test_exists"
- , taskLocation = Location
- { locFile = "test/examples/formula.tex"
- , locLine = 5
- , locColumn = 1
- }
- , taskConjecture = Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 6
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "formula_test_exists" Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 6
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- , Hypothesis Marker "formula_test_forall" Quantified Universally
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 2
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 2
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "formula_test_not_exists"
- , taskLocation = Location
- { locFile = "test/examples/formula.tex"
- , locLine = 9
- , locColumn = 1
- }
- , taskConjecture = Connected Equivalence
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 10
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- ( Not
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 10
- , locColumn = 42
- }
- )
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 10
- , locColumn = 60
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- )
- }
-] \ No newline at end of file
diff --git a/test/golden/formula/glossing.golden b/test/golden/formula/glossing.golden
deleted file mode 100644
index b0eb10c..0000000
--- a/test/golden/formula/glossing.golden
+++ /dev/null
@@ -1,189 +0,0 @@
-[ BlockLemma
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "formula_test_forall" )
- ( Lemma []
- ( Quantified Universally
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 2
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 2
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( Marker "formula_test_exists" )
- ( Lemma []
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 6
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( Marker "formula_test_not_exists" )
- ( Lemma []
- ( Connected Equivalence
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 10
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- ( Not
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 10
- , locColumn = 42
- }
- )
- ( Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/formula.tex"
- , locLine = 10
- , locColumn = 60
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- )
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/formula/verification.golden b/test/golden/formula/verification.golden
deleted file mode 100644
index 3295320..0000000
--- a/test/golden/formula/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 3
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 0
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/geometry/encoding tasks.golden b/test/golden/geometry/encoding tasks.golden
deleted file mode 100644
index a9d055b..0000000
--- a/test/golden/geometry/encoding tasks.golden
+++ /dev/null
@@ -1,109 +0,0 @@
-fof(zf_q0,conjecture,zf_u3(zf_f0,zf_f1,zf_f0,zf_f1)).
-fof(zf_h0,axiom,![V0,V1,V2,V3,V4,V5,V6,V7]:((zf_u1(V0)&zf_u1(V1)&zf_u1(V2)&zf_u1(V3)&zf_u1(V4)&zf_u1(V5)&zf_u1(V6)&zf_u1(V7))=>((zf_u4(V0,V1,V2,V3,V4,V5,V6,V7)&V0!=V1)=>zf_u3(V2,V3,V6,V7)))).
-fof(zf_h1,axiom,![V8,V9,V10,V11,V12,V13,V14,V15]:((zf_u1(V8)&zf_u1(V9)&zf_u1(V10)&zf_u1(V11)&zf_u1(V12)&zf_u1(V13)&zf_u1(V14)&zf_u1(V15))=>(zf_u4(V8,V9,V10,V11,V12,V13,V14,V15)<=>(zf_u2(V8,V9,V10)&zf_u2(V12,V13,V14)&zf_u3(V8,V9,V12,V13)&zf_u3(V9,V10,V13,V14)&zf_u3(V8,V11,V12,V15)&zf_u3(V9,V11,V13,V15))))).
-fof(zf_h2,axiom,![V16,V17,V18,V19,V20,V21]:((zf_u1(V16)&zf_u1(V17)&zf_u1(V18)&zf_u1(V19)&zf_u1(V20)&zf_u1(V21))=>((zf_u2(V16,V19,V18)&zf_u2(V17,V20,V18))=>?[V22]:(zf_u1(V22)&zf_u2(V19,V22,V17)&zf_u2(V20,V22,V16))))).
-fof(zf_h3,axiom,![V23,V24,V25,V26,V27,V28]:((zf_u1(V23)&zf_u1(V24)&zf_u1(V25)&zf_u1(V26))=>((zf_u3(V25,V26,V23,V24)&zf_u3(V25,V26,V27,V28))=>zf_u3(V23,V24,V27,V28)))).
-fof(zf_h4,axiom,![V29,V30,V31,V32,V33]:((zf_u1(V29)&zf_u1(V30)&zf_u1(V31)&zf_u1(V32)&zf_u1(V33))=>((zf_u3(V29,V32,V29,V33)&zf_u3(V30,V32,V30,V33)&zf_u3(V31,V32,V31,V33)&V32!=V33)=>zf_u0(V29,V30,V31)))).
-fof(zf_h5,axiom,![V34,V35,V36,V37]:?[V38]:(zf_u1(V38)&zf_u2(V34,V35,V38)&zf_u3(V35,V38,V36,V37))).
-fof(zf_h6,axiom,![V39,V40,V41]:((zf_u1(V39)&zf_u1(V40)&zf_u1(V41))=>(zf_u3(V39,V40,V41,V41)=>V39=V40))).
-fof(zf_h7,axiom,![V42,V43,V44]:(zf_u0(V42,V43,V44)<=>(zf_u2(V42,V43,V44)|zf_u2(V43,V44,V42)|zf_u2(V44,V42,V43)))).
-fof(zf_h8,axiom,![V45,V46]:((zf_u1(V45)&zf_u1(V46))=>(zf_u2(V45,V46,V45)=>V45=V46))).
-fof(zf_h9,axiom,![V47,V48]:((zf_u1(V47)&zf_u1(V48))=>zf_u3(V47,V48,V48,V47))).
-fof(zf_h10,axiom,zf_u1(zf_f0)).
-fof(zf_h11,axiom,zf_u1(zf_f1)).
-------------------
-fof(zf_q0,conjecture,zf_u3(zf_f2,zf_f3,zf_f0,zf_f1)).
-fof(zf_h0,axiom,![V0,V1,V2,V3,V4,V5,V6,V7]:((zf_u1(V0)&zf_u1(V1)&zf_u1(V2)&zf_u1(V3)&zf_u1(V4)&zf_u1(V5)&zf_u1(V6)&zf_u1(V7))=>((zf_u4(V0,V1,V2,V3,V4,V5,V6,V7)&V0!=V1)=>zf_u3(V2,V3,V6,V7)))).
-fof(zf_h1,axiom,![V8,V9,V10,V11,V12,V13,V14,V15]:((zf_u1(V8)&zf_u1(V9)&zf_u1(V10)&zf_u1(V11)&zf_u1(V12)&zf_u1(V13)&zf_u1(V14)&zf_u1(V15))=>(zf_u4(V8,V9,V10,V11,V12,V13,V14,V15)<=>(zf_u2(V8,V9,V10)&zf_u2(V12,V13,V14)&zf_u3(V8,V9,V12,V13)&zf_u3(V9,V10,V13,V14)&zf_u3(V8,V11,V12,V15)&zf_u3(V9,V11,V13,V15))))).
-fof(zf_h2,axiom,![V16,V17,V18,V19,V20,V21]:((zf_u1(V16)&zf_u1(V17)&zf_u1(V18)&zf_u1(V19)&zf_u1(V20)&zf_u1(V21))=>((zf_u2(V16,V19,V18)&zf_u2(V17,V20,V18))=>?[V22]:(zf_u1(V22)&zf_u2(V19,V22,V17)&zf_u2(V20,V22,V16))))).
-fof(zf_h3,axiom,![V23,V24,V25,V26,V27,V28]:((zf_u1(V23)&zf_u1(V24)&zf_u1(V25)&zf_u1(V26))=>((zf_u3(V25,V26,V23,V24)&zf_u3(V25,V26,V27,V28))=>zf_u3(V23,V24,V27,V28)))).
-fof(zf_h4,axiom,![V29,V30,V31,V32,V33]:((zf_u1(V29)&zf_u1(V30)&zf_u1(V31)&zf_u1(V32)&zf_u1(V33))=>((zf_u3(V29,V32,V29,V33)&zf_u3(V30,V32,V30,V33)&zf_u3(V31,V32,V31,V33)&V32!=V33)=>zf_u0(V29,V30,V31)))).
-fof(zf_h5,axiom,![V34,V35,V36,V37]:?[V38]:(zf_u1(V38)&zf_u2(V34,V35,V38)&zf_u3(V35,V38,V36,V37))).
-fof(zf_h6,axiom,![V39,V40,V41]:((zf_u1(V39)&zf_u1(V40)&zf_u1(V41))=>(zf_u3(V39,V40,V41,V41)=>V39=V40))).
-fof(zf_h7,axiom,![V42,V43,V44]:(zf_u0(V42,V43,V44)<=>(zf_u2(V42,V43,V44)|zf_u2(V43,V44,V42)|zf_u2(V44,V42,V43)))).
-fof(zf_h8,axiom,![V45,V46]:((zf_u1(V45)&zf_u1(V46))=>(zf_u2(V45,V46,V45)=>V45=V46))).
-fof(zf_h9,axiom,![V47,V48]:((zf_u1(V47)&zf_u1(V48))=>zf_u3(V47,V48,V47,V48))).
-fof(zf_h10,axiom,![V49,V50]:((zf_u1(V49)&zf_u1(V50))=>zf_u3(V49,V50,V50,V49))).
-fof(zf_h11,axiom,zf_u1(zf_f0)).
-fof(zf_h12,axiom,zf_u1(zf_f1)).
-fof(zf_h13,axiom,zf_u1(zf_f2)).
-fof(zf_h14,axiom,zf_u1(zf_f3)).
-fof(zf_h15,axiom,zf_u3(zf_f0,zf_f1,zf_f2,zf_f3)).
-------------------
-fof(zf_q0,conjecture,(zf_u3(zf_f0,zf_f1,zf_f2,zf_f3)&zf_u3(zf_f2,zf_f3,zf_f4,zf_f5))=>zf_u3(zf_f0,zf_f1,zf_f4,zf_f5)).
-fof(zf_h0,axiom,![V0,V1,V2,V3,V4,V5,V6,V7]:((zf_u1(V0)&zf_u1(V1)&zf_u1(V2)&zf_u1(V3)&zf_u1(V4)&zf_u1(V5)&zf_u1(V6)&zf_u1(V7))=>((zf_u4(V0,V1,V2,V3,V4,V5,V6,V7)&V0!=V1)=>zf_u3(V2,V3,V6,V7)))).
-fof(zf_h1,axiom,![V8,V9,V10,V11,V12,V13,V14,V15]:((zf_u1(V8)&zf_u1(V9)&zf_u1(V10)&zf_u1(V11)&zf_u1(V12)&zf_u1(V13)&zf_u1(V14)&zf_u1(V15))=>(zf_u4(V8,V9,V10,V11,V12,V13,V14,V15)<=>(zf_u2(V8,V9,V10)&zf_u2(V12,V13,V14)&zf_u3(V8,V9,V12,V13)&zf_u3(V9,V10,V13,V14)&zf_u3(V8,V11,V12,V15)&zf_u3(V9,V11,V13,V15))))).
-fof(zf_h2,axiom,![V16,V17,V18,V19,V20,V21]:((zf_u1(V16)&zf_u1(V17)&zf_u1(V18)&zf_u1(V19)&zf_u1(V20)&zf_u1(V21))=>((zf_u2(V16,V19,V18)&zf_u2(V17,V20,V18))=>?[V22]:(zf_u1(V22)&zf_u2(V19,V22,V17)&zf_u2(V20,V22,V16))))).
-fof(zf_h3,axiom,![V23,V24,V25,V26,V27,V28]:((zf_u1(V23)&zf_u1(V24)&zf_u1(V25)&zf_u1(V26))=>((zf_u3(V25,V26,V23,V24)&zf_u3(V25,V26,V27,V28))=>zf_u3(V23,V24,V27,V28)))).
-fof(zf_h4,axiom,![V29,V30,V31,V32,V33]:((zf_u1(V29)&zf_u1(V30)&zf_u1(V31)&zf_u1(V32)&zf_u1(V33))=>((zf_u3(V29,V32,V29,V33)&zf_u3(V30,V32,V30,V33)&zf_u3(V31,V32,V31,V33)&V32!=V33)=>zf_u0(V29,V30,V31)))).
-fof(zf_h5,axiom,![V34,V35,V36,V37]:((zf_u1(V34)&zf_u1(V35)&zf_u1(V36)&zf_u1(V37)&zf_u3(V34,V35,V36,V37))=>zf_u3(V36,V37,V34,V35))).
-fof(zf_h6,axiom,![V38,V39,V40,V41]:?[V42]:(zf_u1(V42)&zf_u2(V38,V39,V42)&zf_u3(V39,V42,V40,V41))).
-fof(zf_h7,axiom,![V43,V44,V45]:((zf_u1(V43)&zf_u1(V44)&zf_u1(V45))=>(zf_u3(V43,V44,V45,V45)=>V43=V44))).
-fof(zf_h8,axiom,![V46,V47,V48]:(zf_u0(V46,V47,V48)<=>(zf_u2(V46,V47,V48)|zf_u2(V47,V48,V46)|zf_u2(V48,V46,V47)))).
-fof(zf_h9,axiom,![V49,V50]:((zf_u1(V49)&zf_u1(V50))=>(zf_u2(V49,V50,V49)=>V49=V50))).
-fof(zf_h10,axiom,![V51,V52]:((zf_u1(V51)&zf_u1(V52))=>zf_u3(V51,V52,V51,V52))).
-fof(zf_h11,axiom,![V53,V54]:((zf_u1(V53)&zf_u1(V54))=>zf_u3(V53,V54,V54,V53))).
-fof(zf_h12,axiom,zf_u1(zf_f0)).
-fof(zf_h13,axiom,zf_u1(zf_f1)).
-fof(zf_h14,axiom,zf_u1(zf_f2)).
-fof(zf_h15,axiom,zf_u1(zf_f3)).
-fof(zf_h16,axiom,zf_u1(zf_f4)).
-fof(zf_h17,axiom,zf_u1(zf_f5)).
-------------------
-fof(zf_q0,conjecture,zf_u3(zf_f0,zf_f1,zf_f2,zf_f3)=>zf_u3(zf_f1,zf_f0,zf_f2,zf_f3)).
-fof(zf_h0,axiom,![V0,V1,V2,V3,V4,V5,V6,V7]:((zf_u1(V0)&zf_u1(V1)&zf_u1(V2)&zf_u1(V3)&zf_u1(V4)&zf_u1(V5)&zf_u1(V6)&zf_u1(V7))=>((zf_u4(V0,V1,V2,V3,V4,V5,V6,V7)&V0!=V1)=>zf_u3(V2,V3,V6,V7)))).
-fof(zf_h1,axiom,![V8,V9,V10,V11,V12,V13,V14,V15]:((zf_u1(V8)&zf_u1(V9)&zf_u1(V10)&zf_u1(V11)&zf_u1(V12)&zf_u1(V13)&zf_u1(V14)&zf_u1(V15))=>(zf_u4(V8,V9,V10,V11,V12,V13,V14,V15)<=>(zf_u2(V8,V9,V10)&zf_u2(V12,V13,V14)&zf_u3(V8,V9,V12,V13)&zf_u3(V9,V10,V13,V14)&zf_u3(V8,V11,V12,V15)&zf_u3(V9,V11,V13,V15))))).
-fof(zf_h2,axiom,![V16,V17,V18,V19,V20,V21]:((zf_u1(V16)&zf_u1(V17)&zf_u1(V18)&zf_u1(V19)&zf_u1(V20)&zf_u1(V21))=>((zf_u2(V16,V19,V18)&zf_u2(V17,V20,V18))=>?[V22]:(zf_u1(V22)&zf_u2(V19,V22,V17)&zf_u2(V20,V22,V16))))).
-fof(zf_h3,axiom,![V23,V24,V25,V26,V27,V28]:((zf_u1(V23)&zf_u1(V24)&zf_u1(V25)&zf_u1(V26)&zf_u1(V27)&zf_u1(V28))=>((zf_u3(V23,V24,V25,V26)&zf_u3(V25,V26,V27,V28))=>zf_u3(V23,V24,V27,V28)))).
-fof(zf_h4,axiom,![V29,V30,V31,V32,V33,V34]:((zf_u1(V29)&zf_u1(V30)&zf_u1(V31)&zf_u1(V32))=>((zf_u3(V31,V32,V29,V30)&zf_u3(V31,V32,V33,V34))=>zf_u3(V29,V30,V33,V34)))).
-fof(zf_h5,axiom,![V35,V36,V37,V38,V39]:((zf_u1(V35)&zf_u1(V36)&zf_u1(V37)&zf_u1(V38)&zf_u1(V39))=>((zf_u3(V35,V38,V35,V39)&zf_u3(V36,V38,V36,V39)&zf_u3(V37,V38,V37,V39)&V38!=V39)=>zf_u0(V35,V36,V37)))).
-fof(zf_h6,axiom,![V40,V41,V42,V43]:((zf_u1(V40)&zf_u1(V41)&zf_u1(V42)&zf_u1(V43)&zf_u3(V40,V41,V42,V43))=>zf_u3(V42,V43,V40,V41))).
-fof(zf_h7,axiom,![V44,V45,V46,V47]:?[V48]:(zf_u1(V48)&zf_u2(V44,V45,V48)&zf_u3(V45,V48,V46,V47))).
-fof(zf_h8,axiom,![V49,V50,V51]:((zf_u1(V49)&zf_u1(V50)&zf_u1(V51))=>(zf_u3(V49,V50,V51,V51)=>V49=V50))).
-fof(zf_h9,axiom,![V52,V53,V54]:(zf_u0(V52,V53,V54)<=>(zf_u2(V52,V53,V54)|zf_u2(V53,V54,V52)|zf_u2(V54,V52,V53)))).
-fof(zf_h10,axiom,![V55,V56]:((zf_u1(V55)&zf_u1(V56))=>(zf_u2(V55,V56,V55)=>V55=V56))).
-fof(zf_h11,axiom,![V57,V58]:((zf_u1(V57)&zf_u1(V58))=>zf_u3(V57,V58,V57,V58))).
-fof(zf_h12,axiom,![V59,V60]:((zf_u1(V59)&zf_u1(V60))=>zf_u3(V59,V60,V60,V59))).
-fof(zf_h13,axiom,zf_u1(zf_f0)).
-fof(zf_h14,axiom,zf_u1(zf_f1)).
-fof(zf_h15,axiom,zf_u1(zf_f2)).
-fof(zf_h16,axiom,zf_u1(zf_f3)).
-------------------
-fof(zf_q0,conjecture,zf_u3(zf_f0,zf_f1,zf_f2,zf_f3)=>zf_u3(zf_f1,zf_f0,zf_f3,zf_f2)).
-fof(zf_h0,axiom,![V0,V1,V2,V3,V4,V5,V6,V7]:((zf_u1(V0)&zf_u1(V1)&zf_u1(V2)&zf_u1(V3)&zf_u1(V4)&zf_u1(V5)&zf_u1(V6)&zf_u1(V7))=>((zf_u4(V0,V1,V2,V3,V4,V5,V6,V7)&V0!=V1)=>zf_u3(V2,V3,V6,V7)))).
-fof(zf_h1,axiom,![V8,V9,V10,V11,V12,V13,V14,V15]:((zf_u1(V8)&zf_u1(V9)&zf_u1(V10)&zf_u1(V11)&zf_u1(V12)&zf_u1(V13)&zf_u1(V14)&zf_u1(V15))=>(zf_u4(V8,V9,V10,V11,V12,V13,V14,V15)<=>(zf_u2(V8,V9,V10)&zf_u2(V12,V13,V14)&zf_u3(V8,V9,V12,V13)&zf_u3(V9,V10,V13,V14)&zf_u3(V8,V11,V12,V15)&zf_u3(V9,V11,V13,V15))))).
-fof(zf_h2,axiom,![V16,V17,V18,V19,V20,V21]:((zf_u1(V16)&zf_u1(V17)&zf_u1(V18)&zf_u1(V19)&zf_u1(V20)&zf_u1(V21))=>((zf_u2(V16,V19,V18)&zf_u2(V17,V20,V18))=>?[V22]:(zf_u1(V22)&zf_u2(V19,V22,V17)&zf_u2(V20,V22,V16))))).
-fof(zf_h3,axiom,![V23,V24,V25,V26,V27,V28]:((zf_u1(V23)&zf_u1(V24)&zf_u1(V25)&zf_u1(V26)&zf_u1(V27)&zf_u1(V28))=>((zf_u3(V23,V24,V25,V26)&zf_u3(V25,V26,V27,V28))=>zf_u3(V23,V24,V27,V28)))).
-fof(zf_h4,axiom,![V29,V30,V31,V32,V33,V34]:((zf_u1(V29)&zf_u1(V30)&zf_u1(V31)&zf_u1(V32))=>((zf_u3(V31,V32,V29,V30)&zf_u3(V31,V32,V33,V34))=>zf_u3(V29,V30,V33,V34)))).
-fof(zf_h5,axiom,![V35,V36,V37,V38,V39]:((zf_u1(V35)&zf_u1(V36)&zf_u1(V37)&zf_u1(V38)&zf_u1(V39))=>((zf_u3(V35,V38,V35,V39)&zf_u3(V36,V38,V36,V39)&zf_u3(V37,V38,V37,V39)&V38!=V39)=>zf_u0(V35,V36,V37)))).
-fof(zf_h6,axiom,![V40,V41,V42,V43]:((zf_u1(V40)&zf_u1(V41)&zf_u1(V42)&zf_u1(V43)&zf_u3(V40,V41,V42,V43))=>zf_u3(V42,V43,V40,V41))).
-fof(zf_h7,axiom,![V44,V45,V46,V47]:((zf_u1(V44)&zf_u1(V45)&zf_u1(V46)&zf_u1(V47))=>(zf_u3(V44,V45,V46,V47)=>zf_u3(V45,V44,V46,V47)))).
-fof(zf_h8,axiom,![V48,V49,V50,V51]:?[V52]:(zf_u1(V52)&zf_u2(V48,V49,V52)&zf_u3(V49,V52,V50,V51))).
-fof(zf_h9,axiom,![V53,V54,V55]:((zf_u1(V53)&zf_u1(V54)&zf_u1(V55))=>(zf_u3(V53,V54,V55,V55)=>V53=V54))).
-fof(zf_h10,axiom,![V56,V57,V58]:(zf_u0(V56,V57,V58)<=>(zf_u2(V56,V57,V58)|zf_u2(V57,V58,V56)|zf_u2(V58,V56,V57)))).
-fof(zf_h11,axiom,![V59,V60]:((zf_u1(V59)&zf_u1(V60))=>(zf_u2(V59,V60,V59)=>V59=V60))).
-fof(zf_h12,axiom,![V61,V62]:((zf_u1(V61)&zf_u1(V62))=>zf_u3(V61,V62,V61,V62))).
-fof(zf_h13,axiom,![V63,V64]:((zf_u1(V63)&zf_u1(V64))=>zf_u3(V63,V64,V64,V63))).
-fof(zf_h14,axiom,zf_u1(zf_f0)).
-fof(zf_h15,axiom,zf_u1(zf_f1)).
-fof(zf_h16,axiom,zf_u1(zf_f2)).
-fof(zf_h17,axiom,zf_u1(zf_f3)).
-------------------
-fof(zf_q0,conjecture,zf_u3(zf_f0,zf_f0,zf_f1,zf_f1)).
-fof(zf_h0,axiom,![V0,V1,V2,V3,V4,V5,V6,V7]:((zf_u1(V0)&zf_u1(V1)&zf_u1(V2)&zf_u1(V3)&zf_u1(V4)&zf_u1(V5)&zf_u1(V6)&zf_u1(V7))=>((zf_u4(V0,V1,V2,V3,V4,V5,V6,V7)&V0!=V1)=>zf_u3(V2,V3,V6,V7)))).
-fof(zf_h1,axiom,![V8,V9,V10,V11,V12,V13,V14,V15]:((zf_u1(V8)&zf_u1(V9)&zf_u1(V10)&zf_u1(V11)&zf_u1(V12)&zf_u1(V13)&zf_u1(V14)&zf_u1(V15))=>(zf_u4(V8,V9,V10,V11,V12,V13,V14,V15)<=>(zf_u2(V8,V9,V10)&zf_u2(V12,V13,V14)&zf_u3(V8,V9,V12,V13)&zf_u3(V9,V10,V13,V14)&zf_u3(V8,V11,V12,V15)&zf_u3(V9,V11,V13,V15))))).
-fof(zf_h2,axiom,![V16,V17,V18,V19,V20,V21]:((zf_u1(V16)&zf_u1(V17)&zf_u1(V18)&zf_u1(V19)&zf_u1(V20)&zf_u1(V21))=>((zf_u2(V16,V19,V18)&zf_u2(V17,V20,V18))=>?[V22]:(zf_u1(V22)&zf_u2(V19,V22,V17)&zf_u2(V20,V22,V16))))).
-fof(zf_h3,axiom,![V23,V24,V25,V26,V27,V28]:((zf_u1(V23)&zf_u1(V24)&zf_u1(V25)&zf_u1(V26)&zf_u1(V27)&zf_u1(V28))=>((zf_u3(V23,V24,V25,V26)&zf_u3(V25,V26,V27,V28))=>zf_u3(V23,V24,V27,V28)))).
-fof(zf_h4,axiom,![V29,V30,V31,V32,V33,V34]:((zf_u1(V29)&zf_u1(V30)&zf_u1(V31)&zf_u1(V32))=>((zf_u3(V31,V32,V29,V30)&zf_u3(V31,V32,V33,V34))=>zf_u3(V29,V30,V33,V34)))).
-fof(zf_h5,axiom,![V35,V36,V37,V38,V39]:((zf_u1(V35)&zf_u1(V36)&zf_u1(V37)&zf_u1(V38)&zf_u1(V39))=>((zf_u3(V35,V38,V35,V39)&zf_u3(V36,V38,V36,V39)&zf_u3(V37,V38,V37,V39)&V38!=V39)=>zf_u0(V35,V36,V37)))).
-fof(zf_h6,axiom,![V40,V41,V42,V43]:((zf_u1(V40)&zf_u1(V41)&zf_u1(V42)&zf_u1(V43)&zf_u3(V40,V41,V42,V43))=>zf_u3(V42,V43,V40,V41))).
-fof(zf_h7,axiom,![V44,V45,V46,V47]:((zf_u1(V44)&zf_u1(V45)&zf_u1(V46)&zf_u1(V47))=>(zf_u3(V44,V45,V46,V47)=>zf_u3(V45,V44,V46,V47)))).
-fof(zf_h8,axiom,![V48,V49,V50,V51]:((zf_u1(V48)&zf_u1(V49)&zf_u1(V50)&zf_u1(V51))=>(zf_u3(V48,V49,V50,V51)=>zf_u3(V49,V48,V51,V50)))).
-fof(zf_h9,axiom,![V52,V53,V54,V55]:?[V56]:(zf_u1(V56)&zf_u2(V52,V53,V56)&zf_u3(V53,V56,V54,V55))).
-fof(zf_h10,axiom,![V57,V58,V59]:((zf_u1(V57)&zf_u1(V58)&zf_u1(V59))=>(zf_u3(V57,V58,V59,V59)=>V57=V58))).
-fof(zf_h11,axiom,![V60,V61,V62]:(zf_u0(V60,V61,V62)<=>(zf_u2(V60,V61,V62)|zf_u2(V61,V62,V60)|zf_u2(V62,V60,V61)))).
-fof(zf_h12,axiom,![V63,V64]:((zf_u1(V63)&zf_u1(V64))=>(zf_u2(V63,V64,V63)=>V63=V64))).
-fof(zf_h13,axiom,![V65,V66]:((zf_u1(V65)&zf_u1(V66))=>zf_u3(V65,V66,V65,V66))).
-fof(zf_h14,axiom,![V67,V68]:((zf_u1(V67)&zf_u1(V68))=>zf_u3(V67,V68,V68,V67))).
-fof(zf_h15,axiom,zf_u1(zf_f0)).
-fof(zf_h16,axiom,zf_u1(zf_f1)). \ No newline at end of file
diff --git a/test/golden/geometry/generating tasks.golden b/test/golden/geometry/generating tasks.golden
deleted file mode 100644
index f2be772..0000000
--- a/test/golden/geometry/generating tasks.golden
+++ /dev/null
@@ -1,17323 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "upperdim" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 68
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 68
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 69
- , locColumn = 10
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 69
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 70
- , locColumn = 17
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "collinear" )
- ( TokenCons
- ( Word "with" )
- ( HoleCons
- ( TokenCons
- ( Word "and" ) ( HoleCons End )
- )
- )
- )
- )
- ( Marker "collinear" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "innerpasch" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 66
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 55
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 55
- , locColumn = 37
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "betw_id" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 47
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 47
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 48
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 48
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "five_segment" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 41
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "OFS" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "a_" )
- )
- , TermVar
- ( B
- ( NamedVar "b_" )
- )
- , TermVar
- ( B
- ( NamedVar "c_" )
- )
- , TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 42
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 42
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "c_" )
- )
- , TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "ofs" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "r" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- ]
- )
- )
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 26
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "OFS" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "r" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( B
- ( NamedVar "p" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 29
- , locColumn = 6
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "z" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 30
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "w" )
- )
- )
- )
- ]
- )
- )
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 32
- , locColumn = 6
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 33
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "z" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "w" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 34
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "r" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "p" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 35
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "r" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "p" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "segment_construction" Quantified Universally
- ( Scope
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 20
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 62
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "d" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "e" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "cong_id" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 17
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 17
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_pseudotransitive" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 58
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_refl_swap" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 6
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 6
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 7
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "collinear" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "collinear" )
- ( TokenCons
- ( Word "with" )
- ( HoleCons
- ( TokenCons
- ( Word "and" ) ( HoleCons End )
- )
- )
- )
- )
- ( Marker "collinear" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Disjunction
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 44
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 64
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 84
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "_local_2" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 83
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- , Hypothesis Marker "_local_1" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 83
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- ]
- , taskConjectureLabel = Marker "cong_refl"
- , taskLocation = Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 82
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 84
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "cong_refl" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 83
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 83
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 84
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "upperdim" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 68
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 68
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 69
- , locColumn = 10
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 69
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 70
- , locColumn = 17
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "collinear" )
- ( TokenCons
- ( Word "with" )
- ( HoleCons
- ( TokenCons
- ( Word "and" ) ( HoleCons End )
- )
- )
- )
- )
- ( Marker "collinear" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "innerpasch" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 66
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 55
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 55
- , locColumn = 37
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "betw_id" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 47
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 47
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 48
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 48
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "five_segment" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 41
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "OFS" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "a_" )
- )
- , TermVar
- ( B
- ( NamedVar "b_" )
- )
- , TermVar
- ( B
- ( NamedVar "c_" )
- )
- , TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 42
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 42
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "c_" )
- )
- , TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "ofs" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "r" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- ]
- )
- )
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 26
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "OFS" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "r" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( B
- ( NamedVar "p" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 29
- , locColumn = 6
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "z" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 30
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "w" )
- )
- )
- )
- ]
- )
- )
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 32
- , locColumn = 6
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 33
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "z" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "w" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 34
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "r" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "p" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 35
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "r" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "p" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "segment_construction" Quantified Universally
- ( Scope
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 20
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 62
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "d" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "e" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "cong_id" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 17
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 17
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_pseudotransitive" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 58
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_refl_swap" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 6
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 6
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 7
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "collinear" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "collinear" )
- ( TokenCons
- ( Word "with" )
- ( HoleCons
- ( TokenCons
- ( Word "and" ) ( HoleCons End )
- )
- )
- )
- )
- ( Marker "collinear" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Disjunction
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 44
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 64
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 84
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "_local_5" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 90
- , locColumn = 14
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- ]
- , Hypothesis Marker "_local_4" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "d" )
- ]
- , Hypothesis Marker "_local_3" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "c" )
- ]
- , Hypothesis Marker "_local_2" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- , Hypothesis Marker "_local_1" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- ]
- , taskConjectureLabel = Marker "cong_sym"
- , taskLocation = Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 88
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 91
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- , TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "cong_sym" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 90
- , locColumn = 14
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 91
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "cong_refl" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 83
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 83
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 84
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "upperdim" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 68
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 68
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 69
- , locColumn = 10
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 69
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 70
- , locColumn = 17
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "collinear" )
- ( TokenCons
- ( Word "with" )
- ( HoleCons
- ( TokenCons
- ( Word "and" ) ( HoleCons End )
- )
- )
- )
- )
- ( Marker "collinear" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "innerpasch" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 66
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 55
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 55
- , locColumn = 37
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "betw_id" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 47
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 47
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 48
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 48
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "five_segment" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 41
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "OFS" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "a_" )
- )
- , TermVar
- ( B
- ( NamedVar "b_" )
- )
- , TermVar
- ( B
- ( NamedVar "c_" )
- )
- , TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 42
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 42
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "c_" )
- )
- , TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "ofs" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "r" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- ]
- )
- )
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 26
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "OFS" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "r" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( B
- ( NamedVar "p" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 29
- , locColumn = 6
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "z" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 30
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "w" )
- )
- )
- )
- ]
- )
- )
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 32
- , locColumn = 6
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 33
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "z" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "w" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 34
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "r" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "p" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 35
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "r" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "p" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "segment_construction" Quantified Universally
- ( Scope
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 20
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 62
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "d" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "e" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "cong_id" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 17
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 17
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_pseudotransitive" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 58
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_refl_swap" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 6
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 6
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 7
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "collinear" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "collinear" )
- ( TokenCons
- ( Word "with" )
- ( HoleCons
- ( TokenCons
- ( Word "and" ) ( HoleCons End )
- )
- )
- )
- )
- ( Marker "collinear" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Disjunction
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 44
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 64
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 84
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "_local_6" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "f" )
- ]
- , Hypothesis Marker "_local_5" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "e" )
- ]
- , Hypothesis Marker "_local_4" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "d" )
- ]
- , Hypothesis Marker "_local_3" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "c" )
- ]
- , Hypothesis Marker "_local_2" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- , Hypothesis Marker "_local_1" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- ]
- , taskConjectureLabel = Marker "cong_transitive"
- , taskLocation = Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 95
- , locColumn = 1
- }
- , taskConjecture = Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 97
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 97
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- , TermVar
- ( NamedVar "e" )
- , TermVar
- ( NamedVar "f" )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 98
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "e" )
- , TermVar
- ( NamedVar "f" )
- ]
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "cong_transitive" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "e" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 97
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 97
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 98
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_sym" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 90
- , locColumn = 14
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 91
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "cong_refl" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 83
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 83
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 84
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "upperdim" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 68
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 68
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 69
- , locColumn = 10
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 69
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 70
- , locColumn = 17
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "collinear" )
- ( TokenCons
- ( Word "with" )
- ( HoleCons
- ( TokenCons
- ( Word "and" ) ( HoleCons End )
- )
- )
- )
- )
- ( Marker "collinear" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "innerpasch" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 66
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 55
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 55
- , locColumn = 37
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "betw_id" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 47
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 47
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 48
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 48
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "five_segment" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 41
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "OFS" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "a_" )
- )
- , TermVar
- ( B
- ( NamedVar "b_" )
- )
- , TermVar
- ( B
- ( NamedVar "c_" )
- )
- , TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 42
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 42
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "c_" )
- )
- , TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "ofs" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "r" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- ]
- )
- )
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 26
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "OFS" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "r" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( B
- ( NamedVar "p" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 29
- , locColumn = 6
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "z" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 30
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "w" )
- )
- )
- )
- ]
- )
- )
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 32
- , locColumn = 6
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 33
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "z" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "w" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 34
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "r" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "p" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 35
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "r" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "p" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "segment_construction" Quantified Universally
- ( Scope
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 20
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 62
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "d" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "e" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "cong_id" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 17
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 17
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_pseudotransitive" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 58
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_refl_swap" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 6
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 6
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 7
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "collinear" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "collinear" )
- ( TokenCons
- ( Word "with" )
- ( HoleCons
- ( TokenCons
- ( Word "and" ) ( HoleCons End )
- )
- )
- )
- )
- ( Marker "collinear" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Disjunction
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 44
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 64
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 84
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "_local_4" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 103
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "d" )
- ]
- , Hypothesis Marker "_local_3" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 103
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "c" )
- ]
- , Hypothesis Marker "_local_2" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 103
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- , Hypothesis Marker "_local_1" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 103
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- ]
- , taskConjectureLabel = Marker "cong_shuffle_left"
- , taskLocation = Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 102
- , locColumn = 1
- }
- , taskConjecture = Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 104
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 105
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- ]
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "cong_shuffle_left" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 103
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 103
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 103
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 103
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 104
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 105
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_transitive" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "e" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 97
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 97
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 98
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_sym" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 90
- , locColumn = 14
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 91
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "cong_refl" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 83
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 83
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 84
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "upperdim" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 68
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 68
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 69
- , locColumn = 10
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 69
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 70
- , locColumn = 17
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "collinear" )
- ( TokenCons
- ( Word "with" )
- ( HoleCons
- ( TokenCons
- ( Word "and" ) ( HoleCons End )
- )
- )
- )
- )
- ( Marker "collinear" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "innerpasch" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 66
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 55
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 55
- , locColumn = 37
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "betw_id" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 47
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 47
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 48
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 48
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "five_segment" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 41
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "OFS" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "a_" )
- )
- , TermVar
- ( B
- ( NamedVar "b_" )
- )
- , TermVar
- ( B
- ( NamedVar "c_" )
- )
- , TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 42
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 42
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "c_" )
- )
- , TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "ofs" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "r" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- ]
- )
- )
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 26
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "OFS" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "r" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( B
- ( NamedVar "p" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 29
- , locColumn = 6
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "z" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 30
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "w" )
- )
- )
- )
- ]
- )
- )
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 32
- , locColumn = 6
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 33
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "z" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "w" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 34
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "r" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "p" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 35
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "r" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "p" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "segment_construction" Quantified Universally
- ( Scope
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 20
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 62
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "d" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "e" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "cong_id" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 17
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 17
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_pseudotransitive" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 58
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_refl_swap" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 6
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 6
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 7
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "collinear" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "collinear" )
- ( TokenCons
- ( Word "with" )
- ( HoleCons
- ( TokenCons
- ( Word "and" ) ( HoleCons End )
- )
- )
- )
- )
- ( Marker "collinear" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Disjunction
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 44
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 64
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 84
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "_local_4" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 110
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "d" )
- ]
- , Hypothesis Marker "_local_3" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 110
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "c" )
- ]
- , Hypothesis Marker "_local_2" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 110
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- , Hypothesis Marker "_local_1" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 110
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- ]
- , taskConjectureLabel = Marker "cong_shuffle_right"
- , taskLocation = Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 109
- , locColumn = 1
- }
- , taskConjecture = Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 111
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 112
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "d" )
- , TermVar
- ( NamedVar "c" )
- ]
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "cong_shuffle_right" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 110
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 110
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 110
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 110
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 111
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 112
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_shuffle_left" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 103
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 103
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 103
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 103
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 104
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 105
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_transitive" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "e" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 97
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 97
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 98
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_sym" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 90
- , locColumn = 14
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 91
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "cong_refl" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 83
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 83
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 84
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "upperdim" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 68
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 68
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 69
- , locColumn = 10
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 69
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 70
- , locColumn = 17
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "collinear" )
- ( TokenCons
- ( Word "with" )
- ( HoleCons
- ( TokenCons
- ( Word "and" ) ( HoleCons End )
- )
- )
- )
- )
- ( Marker "collinear" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "innerpasch" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 66
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 55
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 55
- , locColumn = 37
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "betw_id" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 47
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 47
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 48
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 48
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "five_segment" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c_" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 41
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "OFS" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "a_" )
- )
- , TermVar
- ( B
- ( NamedVar "b_" )
- )
- , TermVar
- ( B
- ( NamedVar "c_" )
- )
- , TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 42
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 42
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "c_" )
- )
- , TermVar
- ( B
- ( NamedVar "d_" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "ofs" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "r" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "u" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "v" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "p" )
- )
- ]
- )
- )
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 26
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "OFS" )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( B
- ( NamedVar "r" )
- )
- , TermVar
- ( B
- ( NamedVar "u" )
- )
- , TermVar
- ( B
- ( NamedVar "v" )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( B
- ( NamedVar "p" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 29
- , locColumn = 6
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "z" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 30
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "w" )
- )
- )
- )
- ]
- )
- )
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 32
- , locColumn = 6
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 33
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "z" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "w" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 34
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "x" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "r" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "u" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "p" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 35
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "y" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "r" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "v" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "p" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "segment_construction" Quantified Universally
- ( Scope
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 20
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 62
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "d" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "e" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "cong_id" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 17
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 17
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_pseudotransitive" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "d" )
- )
- ]
- )
- )
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( B
- ( NamedVar "d" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 58
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "e" )
- )
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- )
- )
- , Hypothesis Marker "cong_refl_swap" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 6
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 6
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 7
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "collinear" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "collinear" )
- ( TokenCons
- ( Word "with" )
- ( HoleCons
- ( TokenCons
- ( Word "and" ) ( HoleCons End )
- )
- )
- )
- )
- ( Marker "collinear" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Disjunction
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 44
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 64
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 84
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "c" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "b" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "_local_2" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 117
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- , Hypothesis Marker "_local_1" TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 117
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- ]
- , taskConjectureLabel = Marker "cong_zero"
- , taskLocation = Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 116
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 118
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "b" )
- ]
- }
-] \ No newline at end of file
diff --git a/test/golden/geometry/glossing.golden b/test/golden/geometry/glossing.golden
deleted file mode 100644
index 3d097de..0000000
--- a/test/golden/geometry/glossing.golden
+++ /dev/null
@@ -1,2775 +0,0 @@
-[ BlockDefn
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "collinear" )
- ( DefnPredicate []
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "collinear" )
- ( TokenCons
- ( Word "with" )
- ( HoleCons
- ( TokenCons
- ( Word "and" ) ( HoleCons End )
- )
- )
- )
- )
- ( Marker "collinear" )
- )
- )
- ( NamedVar "a" :|
- [ NamedVar "b"
- , NamedVar "c"
- ]
- )
- ( Connected Disjunction
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 44
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "c" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 64
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "a" )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 2
- , locColumn = 84
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- ]
- )
- )
- )
-, BlockAxiom
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( Marker "cong_refl_swap" )
- ( Axiom
- [ Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 6
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 6
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- )
- ]
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 7
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "a" )
- ]
- )
- )
-, BlockAxiom
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 10
- , locColumn = 1
- }
- )
- ( Marker "cong_pseudotransitive" )
- ( Axiom
- [ Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "c" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 11
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "d" )
- ]
- )
- ]
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- , TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- , TermVar
- ( NamedVar "e" )
- , TermVar
- ( NamedVar "f" )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 12
- , locColumn = 58
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "e" )
- , TermVar
- ( NamedVar "f" )
- ]
- )
- )
- )
-, BlockAxiom
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 15
- , locColumn = 1
- }
- )
- ( Marker "cong_id" )
- ( Axiom
- [ Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 16
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "c" )
- ]
- )
- ]
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 17
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "c" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 17
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- ]
- )
- )
- )
-, BlockAxiom
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 21
- , locColumn = 1
- }
- )
- ( Marker "segment_construction" )
- ( Axiom []
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 20
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "a" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "b" )
- )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 22
- , locColumn = 62
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "b" )
- )
- )
- , TermVar
- ( B
- ( NamedVar "c" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "d" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "e" )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
-, BlockDefn
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 26
- , locColumn = 1
- }
- )
- ( Marker "ofs" )
- ( DefnPredicate
- [ Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "z" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "r" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "u" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "v" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "w" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 27
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "p" )
- ]
- )
- ]
- ( PredicateSymbol "OFS" )
- ( NamedVar "x" :|
- [ NamedVar "y"
- , NamedVar "z"
- , NamedVar "r"
- , NamedVar "u"
- , NamedVar "v"
- , NamedVar "w"
- , NamedVar "p"
- ]
- )
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 29
- , locColumn = 6
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "z" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 30
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( NamedVar "u" )
- , TermVar
- ( NamedVar "v" )
- , TermVar
- ( NamedVar "w" )
- ]
- )
- )
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 32
- , locColumn = 6
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "u" )
- , TermVar
- ( NamedVar "v" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 33
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "z" )
- , TermVar
- ( NamedVar "v" )
- , TermVar
- ( NamedVar "w" )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 34
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "r" )
- , TermVar
- ( NamedVar "u" )
- , TermVar
- ( NamedVar "p" )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 35
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "r" )
- , TermVar
- ( NamedVar "v" )
- , TermVar
- ( NamedVar "p" )
- ]
- )
- )
- )
- )
-, BlockAxiom
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 39
- , locColumn = 1
- }
- )
- ( Marker "five_segment" )
- ( Axiom
- [ Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "c" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "d" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a_" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b_" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "c_" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 40
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "d_" )
- ]
- )
- ]
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 41
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "OFS" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- , TermVar
- ( NamedVar "a_" )
- , TermVar
- ( NamedVar "b_" )
- , TermVar
- ( NamedVar "c_" )
- , TermVar
- ( NamedVar "d_" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 42
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 42
- , locColumn = 22
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- , TermVar
- ( NamedVar "c_" )
- , TermVar
- ( NamedVar "d_" )
- ]
- )
- )
- )
-, BlockAxiom
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 46
- , locColumn = 1
- }
- )
- ( Marker "betw_id" )
- ( Axiom
- [ Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 47
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 47
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- )
- ]
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 48
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "a" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 48
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- ]
- )
- )
- )
-, BlockAxiom
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 52
- , locColumn = 1
- }
- )
- ( Marker "innerpasch" )
- ( Axiom
- [ Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "z" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "u" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "v" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 53
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "w" )
- ]
- )
- ]
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "u" )
- , TermVar
- ( NamedVar "z" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "v" )
- , TermVar
- ( NamedVar "z" )
- ]
- )
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 54
- , locColumn = 66
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "w" )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 55
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "u" )
- )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "y" )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 55
- , locColumn = 37
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Betw" )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "v" )
- )
- )
- , TermVar
- ( B
- ( NamedVar "w" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "x" )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
-, BlockAxiom
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 66
- , locColumn = 1
- }
- )
- ( Marker "upperdim" )
- ( Axiom
- [ Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "y" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "z" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "u" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 67
- , locColumn = 24
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "v" )
- ]
- )
- ]
- ( Connected Implication
- ( Connected Conjunction
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 68
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "u" )
- , TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "v" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 68
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "u" )
- , TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "v" )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 69
- , locColumn = 10
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "z" )
- , TermVar
- ( NamedVar "u" )
- , TermVar
- ( NamedVar "z" )
- , TermVar
- ( NamedVar "v" )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 69
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "neq" )
- ( ParameterArity 0 )
- ( Marker "neq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "u" )
- , TermVar
- ( NamedVar "v" )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 70
- , locColumn = 17
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "collinear" )
- ( TokenCons
- ( Word "with" )
- ( HoleCons
- ( TokenCons
- ( Word "and" ) ( HoleCons End )
- )
- )
- )
- )
- ( Marker "collinear" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "z" )
- ]
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 82
- , locColumn = 1
- }
- )
- ( Marker "cong_refl" )
- ( Lemma
- [ Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 83
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 83
- , locColumn = 19
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- )
- ]
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 84
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 88
- , locColumn = 1
- }
- )
- ( Marker "cong_sym" )
- ( Lemma
- [ Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "c" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 89
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "d" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 90
- , locColumn = 14
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- ]
- )
- ]
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 91
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- , TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 95
- , locColumn = 1
- }
- )
- ( Marker "cong_transitive" )
- ( Lemma
- [ Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "c" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "d" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "e" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 96
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "f" )
- ]
- )
- ]
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 97
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 97
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- , TermVar
- ( NamedVar "e" )
- , TermVar
- ( NamedVar "f" )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 98
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "e" )
- , TermVar
- ( NamedVar "f" )
- ]
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 102
- , locColumn = 1
- }
- )
- ( Marker "cong_shuffle_left" )
- ( Lemma
- [ Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 103
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 103
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 103
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "c" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 103
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "d" )
- ]
- )
- ]
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 104
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 105
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- ]
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 109
- , locColumn = 1
- }
- )
- ( Marker "cong_shuffle_right" )
- ( Lemma
- [ Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 110
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 110
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 110
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "c" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 110
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "d" )
- ]
- )
- ]
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 111
- , locColumn = 9
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "c" )
- , TermVar
- ( NamedVar "d" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 112
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "d" )
- , TermVar
- ( NamedVar "c" )
- ]
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 116
- , locColumn = 1
- }
- )
- ( Marker "cong_zero" )
- ( Lemma
- [ Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 117
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- ]
- )
- , Asm
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 117
- , locColumn = 18
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "point" ) End
- , pl = TokenCons
- ( Word "points" ) End
- }
- )
- ( Marker "point" )
- )
- )
- )
- [ TermVar
- ( NamedVar "b" )
- ]
- )
- ]
- ( TermSymbol
- ( Location
- { locFile = "test/examples/geometry.tex"
- , locLine = 118
- , locColumn = 11
- }
- )
- ( SymbolPredicate
- ( PredicateSymbol "Cong" )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- , TermVar
- ( NamedVar "b" )
- ]
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/geometry/verification.golden b/test/golden/geometry/verification.golden
deleted file mode 100644
index a64b733..0000000
--- a/test/golden/geometry/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 8
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 6
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 2
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/indefinite-terms/encoding tasks.golden b/test/golden/indefinite-terms/encoding tasks.golden
deleted file mode 100644
index 60bf285..0000000
--- a/test/golden/indefinite-terms/encoding tasks.golden
+++ /dev/null
@@ -1,4 +0,0 @@
-fof(zf_q0,conjecture,$true).
-------------------
-fof(zf_q0,conjecture,$true).
-fof(zf_h0,axiom,$true). \ No newline at end of file
diff --git a/test/golden/indefinite-terms/generating tasks.golden b/test/golden/indefinite-terms/generating tasks.golden
deleted file mode 100644
index 6cebfc4..0000000
--- a/test/golden/indefinite-terms/generating tasks.golden
+++ /dev/null
@@ -1,28 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses = []
- , taskConjectureLabel = Marker "indefinite_test_forall"
- , taskLocation = Location
- { locFile = "test/examples/indefinite-terms.tex"
- , locLine = 1
- , locColumn = 1
- }
- , taskConjecture = PropositionalConstant IsTop
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "indefinite_test_forall" Quantified Universally
- ( Scope
- ( Connected Implication ( PropositionalConstant IsTop ) ( PropositionalConstant IsTop ) )
- )
- ]
- , taskConjectureLabel = Marker "indefinite_test_exists"
- , taskLocation = Location
- { locFile = "test/examples/indefinite-terms.tex"
- , locLine = 5
- , locColumn = 1
- }
- , taskConjecture = PropositionalConstant IsTop
- }
-] \ No newline at end of file
diff --git a/test/golden/indefinite-terms/glossing.golden b/test/golden/indefinite-terms/glossing.golden
deleted file mode 100644
index 3cab448..0000000
--- a/test/golden/indefinite-terms/glossing.golden
+++ /dev/null
@@ -1,31 +0,0 @@
-[ BlockLemma
- ( Location
- { locFile = "test/examples/indefinite-terms.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "indefinite_test_forall" )
- ( Lemma []
- ( Quantified Universally
- ( Scope
- ( Connected Implication ( PropositionalConstant IsTop ) ( PropositionalConstant IsTop ) )
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/indefinite-terms.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( Marker "indefinite_test_exists" )
- ( Lemma []
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction ( PropositionalConstant IsTop ) ( PropositionalConstant IsTop ) )
- )
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/indefinite-terms/verification.golden b/test/golden/indefinite-terms/verification.golden
deleted file mode 100644
index d13aa99..0000000
--- a/test/golden/indefinite-terms/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 2
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 2
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/inductive/encoding tasks.golden b/test/golden/inductive/encoding tasks.golden
deleted file mode 100644
index af2aad1..0000000
--- a/test/golden/inductive/encoding tasks.golden
+++ /dev/null
@@ -1 +0,0 @@
-fof(zf_q0,conjecture,![V0]:zf_u1(V0,zf_u0(V0))). \ No newline at end of file
diff --git a/test/golden/inductive/generating tasks.golden b/test/golden/inductive/generating tasks.golden
deleted file mode 100644
index 18cb929..0000000
--- a/test/golden/inductive/generating tasks.golden
+++ /dev/null
@@ -1,59 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses = []
- , taskConjectureLabel = Marker "fin"
- , taskLocation = Location
- { locFile = "test/examples/inductive.tex"
- , locLine = 3
- , locColumn = 1
- }
- , taskConjecture = Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "A" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/inductive.tex"
- , locLine = 4
- , locColumn = 29
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cumul" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "cumul" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "A" )
- )
- ]
- ]
- )
- )
- }
-] \ No newline at end of file
diff --git a/test/golden/inductive/glossing.golden b/test/golden/inductive/glossing.golden
deleted file mode 100644
index 98f60e8..0000000
--- a/test/golden/inductive/glossing.golden
+++ /dev/null
@@ -1,86 +0,0 @@
-[ BlockInductive
- ( Location
- { locFile = "test/examples/inductive.tex"
- , locLine = 3
- , locColumn = 1
- }
- )
- ( Marker "fin" )
- ( Inductive
- { inductiveSymbol = MixfixItem
- ( TokenCons
- ( Command "fin" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "fin" ) NonAssoc
- , inductiveParams =
- [ NamedVar "A" ]
- , inductiveDomain = TermSymbol
- ( Location
- { locFile = "test/examples/inductive.tex"
- , locLine = 4
- , locColumn = 29
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cumul" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "cumul" ) NonAssoc
- )
- )
- [ TermVar
- ( NamedVar "A" )
- ]
- , inductiveIntros = IntroRule
- { introConditions = []
- , introResult = TermSymbol
- ( Location
- { locFile = "test/examples/inductive.tex"
- , locLine = 6
- , locColumn = 17
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "A" )
- , TermSymbol
- ( Location
- { locFile = "test/examples/inductive.tex"
- , locLine = 6
- , locColumn = 20
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "fin" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "fin" ) NonAssoc
- )
- )
- [ TermVar
- ( NamedVar "A" )
- ]
- ]
- } :| []
- }
- )
-] \ No newline at end of file
diff --git a/test/golden/inductive/verification.golden b/test/golden/inductive/verification.golden
deleted file mode 100644
index f9813a5..0000000
--- a/test/golden/inductive/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 0
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 0
- , verificationKernelProofCount = 4
- }
- ) \ No newline at end of file
diff --git a/test/golden/no-reflexive-set/encoding tasks.golden b/test/golden/no-reflexive-set/encoding tasks.golden
deleted file mode 100644
index 444124c..0000000
--- a/test/golden/no-reflexive-set/encoding tasks.golden
+++ /dev/null
@@ -1,2 +0,0 @@
-fof(zf_q0,conjecture,~zf_u0(zf_f0,zf_f0)).
-fof(zf_h0,axiom,![V0]:(zf_u0(V0,zf_f0)=>~zf_u0(V0,V0))). \ No newline at end of file
diff --git a/test/golden/no-reflexive-set/generating tasks.golden b/test/golden/no-reflexive-set/generating tasks.golden
deleted file mode 100644
index fa8d25d..0000000
--- a/test/golden/no-reflexive-set/generating tasks.golden
+++ /dev/null
@@ -1,110 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "_local_1" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "IndAntecedent" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- ]
- )
- ( Connected Implication ( PropositionalConstant IsTop )
- ( Not
- ( Location
- { locFile = "test/examples/no-reflexive-set.tex"
- , locLine = 2
- , locColumn = 36
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/no-reflexive-set.tex"
- , locLine = 2
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "IndAntecedent" )
- )
- , TermVar
- ( B
- ( NamedVar "IndAntecedent" )
- )
- ]
- )
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "in_irrefl"
- , taskLocation = Location
- { locFile = "test/examples/no-reflexive-set.tex"
- , locLine = 10
- , locColumn = 5
- }
- , taskConjecture = Not
- ( Location
- { locFile = "test/examples/no-reflexive-set.tex"
- , locLine = 2
- , locColumn = 36
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/no-reflexive-set.tex"
- , locLine = 2
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "A" )
- , TermVar
- ( NamedVar "A" )
- ]
- )
- }
-] \ No newline at end of file
diff --git a/test/golden/no-reflexive-set/glossing.golden b/test/golden/no-reflexive-set/glossing.golden
deleted file mode 100644
index 9de8fd4..0000000
--- a/test/golden/no-reflexive-set/glossing.golden
+++ /dev/null
@@ -1,83 +0,0 @@
-[ BlockLemma
- ( Location
- { locFile = "test/examples/no-reflexive-set.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "in_irrefl" )
- ( Lemma []
- ( Quantified Universally
- ( Scope
- ( Connected Implication ( PropositionalConstant IsTop )
- ( Not
- ( Location
- { locFile = "test/examples/no-reflexive-set.tex"
- , locLine = 2
- , locColumn = 36
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/no-reflexive-set.tex"
- , locLine = 2
- , locColumn = 36
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "A" )
- )
- , TermVar
- ( B
- ( NamedVar "A" )
- )
- ]
- )
- )
- )
- )
- )
- )
-, BlockProof
- ( Location
- { locFile = "test/examples/no-reflexive-set.tex"
- , locLine = 4
- , locColumn = 1
- }
- )
- ( Location
- { locFile = "test/examples/no-reflexive-set.tex"
- , locLine = 11
- , locColumn = 1
- }
- )
- ( BySetInduction
- ( Location
- { locFile = "test/examples/no-reflexive-set.tex"
- , locLine = 4
- , locColumn = 21
- }
- ) Nothing
- ( Qed
- { mloc = Just
- ( Location
- { locFile = "test/examples/no-reflexive-set.tex"
- , locLine = 10
- , locColumn = 5
- }
- )
- , by = JustificationEmpty
- }
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/no-reflexive-set/verification.golden b/test/golden/no-reflexive-set/verification.golden
deleted file mode 100644
index c72009c..0000000
--- a/test/golden/no-reflexive-set/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 1
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 1
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/proofassume/encoding tasks.golden b/test/golden/proofassume/encoding tasks.golden
deleted file mode 100644
index 105bc5a..0000000
--- a/test/golden/proofassume/encoding tasks.golden
+++ /dev/null
@@ -1,17 +0,0 @@
-fof(zf_q0,conjecture,zf_u0(zf_f0,zf_f1)).
-fof(zf_h0,axiom,zf_u0(zf_f0,zf_f1)).
-------------------
-fof(zf_q0,conjecture,zf_u0(zf_f0,zf_f1)).
-fof(zf_h0,axiom,zf_u0(zf_f0,zf_f1)).
-fof(zf_h1,axiom,zf_u0(zf_f0,zf_f1)).
-------------------
-fof(zf_q0,conjecture,zf_u0(zf_f2,zf_f3)).
-fof(zf_h0,axiom,![V0,V1]:(zf_u0(V0,V1)=>zf_u0(V0,V1))).
-fof(zf_h1,axiom,zf_u0(zf_f0,zf_f1)).
-fof(zf_h2,axiom,zf_u0(zf_f2,zf_f3)).
-------------------
-fof(zf_q0,conjecture,zf_u0(zf_f2,zf_f3)).
-fof(zf_h0,axiom,![V0,V1]:(zf_u0(V0,V1)=>zf_u0(V0,V1))).
-fof(zf_h1,axiom,zf_u0(zf_f0,zf_f1)).
-fof(zf_h2,axiom,zf_u0(zf_f2,zf_f3)).
-fof(zf_h3,axiom,zf_u0(zf_f2,zf_f3)). \ No newline at end of file
diff --git a/test/golden/proofassume/generating tasks.golden b/test/golden/proofassume/generating tasks.golden
deleted file mode 100644
index 6f12c09..0000000
--- a/test/golden/proofassume/generating tasks.golden
+++ /dev/null
@@ -1,411 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "_local_1" TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 5
- , locColumn = 14
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- ]
- , taskConjectureLabel = Marker "assumetest"
- , taskLocation = Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 6
- , locColumn = 5
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 6
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "_local_2" TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 6
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- , Hypothesis Marker "_local_1" TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 5
- , locColumn = 14
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- ]
- , taskConjectureLabel = Marker "assumetest"
- , taskLocation = Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 7
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 2
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "assumetest" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 2
- , locColumn = 10
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 2
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "_local_2" TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 14
- , locColumn = 14
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- , Hypothesis Marker "_local_1" TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 13
- , locColumn = 14
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- ]
- ]
- , taskConjectureLabel = Marker "assumetesttwo"
- , taskLocation = Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 15
- , locColumn = 5
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 15
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "assumetest" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 2
- , locColumn = 10
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 2
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "_local_3" TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 15
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- , Hypothesis Marker "_local_2" TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 14
- , locColumn = 14
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- , Hypothesis Marker "_local_1" TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 13
- , locColumn = 14
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- ]
- ]
- , taskConjectureLabel = Marker "assumetesttwo"
- , taskLocation = Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 16
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 10
- , locColumn = 38
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- }
-] \ No newline at end of file
diff --git a/test/golden/proofassume/glossing.golden b/test/golden/proofassume/glossing.golden
deleted file mode 100644
index e3eb237..0000000
--- a/test/golden/proofassume/glossing.golden
+++ /dev/null
@@ -1,323 +0,0 @@
-[ BlockLemma
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "assumetest" )
- ( Lemma []
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 2
- , locColumn = 10
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 2
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- )
- )
-, BlockProof
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 4
- , locColumn = 1
- }
- )
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 7
- , locColumn = 1
- }
- )
- ( Assume
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 5
- , locColumn = 5
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 5
- , locColumn = 14
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( Have
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 6
- , locColumn = 5
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 6
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- ) JustificationEmpty
- ( Qed
- { mloc = Nothing
- , by = JustificationEmpty
- }
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( Marker "assumetesttwo" )
- ( Lemma []
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 10
- , locColumn = 10
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 10
- , locColumn = 23
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 10
- , locColumn = 38
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- )
- )
-, BlockProof
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 12
- , locColumn = 1
- }
- )
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 16
- , locColumn = 1
- }
- )
- ( Assume
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 13
- , locColumn = 5
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 13
- , locColumn = 14
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "b" )
- ]
- )
- ( Assume
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 14
- , locColumn = 5
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 14
- , locColumn = 14
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( Have
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 15
- , locColumn = 5
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofassume.tex"
- , locLine = 15
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- ) JustificationEmpty
- ( Qed
- { mloc = Nothing
- , by = JustificationEmpty
- }
- )
- )
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/proofassume/verification.golden b/test/golden/proofassume/verification.golden
deleted file mode 100644
index 8dfcc36..0000000
--- a/test/golden/proofassume/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 4
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 2
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/proofdefinefunction/encoding tasks.golden b/test/golden/proofdefinefunction/encoding tasks.golden
deleted file mode 100644
index 0569ea8..0000000
--- a/test/golden/proofdefinefunction/encoding tasks.golden
+++ /dev/null
@@ -1,9 +0,0 @@
-fof(zf_q0,conjecture,zf_u4(zf_f1,zf_f2)=>zf_u4(zf_f1,zf_f2)).
-fof(zf_h0,axiom,![V0,V1]:zf_u0(V0,V1)=V1).
-fof(zf_h1,axiom,![V2]:(zf_u2(V2)<=>V2=V2)).
-fof(zf_h2,axiom,![V3]:(zf_u3(V3)<=>V3=V3)).
-fof(zf_h3,axiom,![V4]:(zf_u4(V4,zf_f1)=>zf_u0(zf_f0,V4)=V4)).
-fof(zf_h4,axiom,![V5]:zf_u1(V5)=V5).
-fof(zf_h5,axiom,zf_u1(zf_f0)=zf_f1).
-fof(zf_h6,axiom,zf_u2(zf_f0)).
-fof(zf_h7,axiom,zf_u3(zf_f0)). \ No newline at end of file
diff --git a/test/golden/proofdefinefunction/generating tasks.golden b/test/golden/proofdefinefunction/generating tasks.golden
deleted file mode 100644
index 9573633..0000000
--- a/test/golden/proofdefinefunction/generating tasks.golden
+++ /dev/null
@@ -1,473 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "relation" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 18
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "relation" ) End
- , pl = TokenCons
- ( Word "relations" ) End
- }
- )
- ( Marker "relation" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 19
- , locColumn = 29
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "f" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "f" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "rightunique" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 13
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "right-unique" ) End
- )
- ( Marker "rightunique" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 14
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "f" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "f" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "dom" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "dom" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "dom" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- , TermVar
- ( B
- ( NamedVar "f" )
- )
- ]
- )
- )
- , Hypothesis Marker "apply" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "apply" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "apply" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "f" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- , Hypothesis Marker "_local_4" TermSymbol
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 26
- , locColumn = 5
- }
- )
- ( SymbolPredicate
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "relation" ) End
- , pl = TokenCons
- ( Word "relations" ) End
- }
- )
- ( Marker "relation" )
- )
- )
- )
- [ TermVar
- ( NamedVar "f" )
- ]
- , Hypothesis Marker "_local_3" TermSymbol
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 26
- , locColumn = 5
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "right-unique" ) End
- )
- ( Marker "rightunique" )
- )
- )
- )
- [ TermVar
- ( NamedVar "f" )
- ]
- , Hypothesis Marker "_local_2" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "z" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "x" )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "apply" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "apply" ) NonAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "f" )
- )
- )
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- , TermVar
- ( B
- ( NamedVar "z" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "_local_1" TermSymbol
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 26
- , locColumn = 5
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "dom" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "dom" ) NonAssoc
- )
- )
- [ TermVar
- ( NamedVar "f" )
- ]
- , TermVar
- ( NamedVar "x" )
- ]
- ]
- , taskConjectureLabel = Marker "definefunctiontest"
- , taskLocation = Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 27
- , locColumn = 1
- }
- , taskConjecture = Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 23
- , locColumn = 10
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 23
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- }
-] \ No newline at end of file
diff --git a/test/golden/proofdefinefunction/glossing.golden b/test/golden/proofdefinefunction/glossing.golden
deleted file mode 100644
index a638a71..0000000
--- a/test/golden/proofdefinefunction/glossing.golden
+++ /dev/null
@@ -1,231 +0,0 @@
-[ BlockDefn
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 3
- , locColumn = 1
- }
- )
- ( Marker "apply" )
- ( DefnOp
- ( MixfixItem
- ( TokenCons
- ( Command "apply" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "apply" ) NonAssoc
- )
- [ NamedVar "f"
- , NamedVar "x"
- ]
- ( TermVar
- ( NamedVar "x" )
- )
- )
-, BlockDefn
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 8
- , locColumn = 1
- }
- )
- ( Marker "dom" )
- ( DefnOp
- ( MixfixItem
- ( TokenCons
- ( Command "dom" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "dom" ) NonAssoc
- )
- [ NamedVar "f" ]
- ( TermVar
- ( NamedVar "f" )
- )
- )
-, BlockDefn
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 13
- , locColumn = 1
- }
- )
- ( Marker "rightunique" )
- ( DefnPredicate []
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "right-unique" ) End
- )
- ( Marker "rightunique" )
- )
- )
- ( NamedVar "f" :| [] )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 14
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "f" )
- , TermVar
- ( NamedVar "f" )
- ]
- )
- )
-, BlockDefn
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 18
- , locColumn = 1
- }
- )
- ( Marker "relation" )
- ( DefnPredicate []
- ( PredicateNoun
- ( LexicalItemSgPl
- ( SgPl
- { sg = TokenCons
- ( Word "relation" ) End
- , pl = TokenCons
- ( Word "relations" ) End
- }
- )
- ( Marker "relation" )
- )
- )
- ( NamedVar "f" :| [] )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 19
- , locColumn = 29
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "f" )
- , TermVar
- ( NamedVar "f" )
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 22
- , locColumn = 1
- }
- )
- ( Marker "definefunctiontest" )
- ( Lemma []
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 23
- , locColumn = 10
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 23
- , locColumn = 25
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- )
- )
-, BlockProof
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 25
- , locColumn = 1
- }
- )
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 27
- , locColumn = 1
- }
- )
- ( DefineFunction
- ( Location
- { locFile = "test/examples/proofdefinefunction.tex"
- , locLine = 26
- , locColumn = 5
- }
- )
- ( NamedVar "f" )
- ( NamedVar "z" )
- ( TermVar
- ( NamedVar "z" )
- )
- ( TermVar
- ( NamedVar "x" )
- )
- ( Qed
- { mloc = Nothing
- , by = JustificationEmpty
- }
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/proofdefinefunction/verification.golden b/test/golden/proofdefinefunction/verification.golden
deleted file mode 100644
index 92226be..0000000
--- a/test/golden/proofdefinefunction/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 1
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 5
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/prooffix/encoding tasks.golden b/test/golden/prooffix/encoding tasks.golden
deleted file mode 100644
index 07c5c43..0000000
--- a/test/golden/prooffix/encoding tasks.golden
+++ /dev/null
@@ -1,4 +0,0 @@
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-------------------
-fof(zf_q0,conjecture,zf_f0=zf_f0).
-fof(zf_h0,axiom,zf_f0=zf_f0). \ No newline at end of file
diff --git a/test/golden/prooffix/generating tasks.golden b/test/golden/prooffix/generating tasks.golden
deleted file mode 100644
index 150d67f..0000000
--- a/test/golden/prooffix/generating tasks.golden
+++ /dev/null
@@ -1,85 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses = []
- , taskConjectureLabel = Marker "assumetest"
- , taskLocation = Location
- { locFile = "test/examples/prooffix.tex"
- , locLine = 6
- , locColumn = 5
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/prooffix.tex"
- , locLine = 6
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "x" )
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "_local_1" TermSymbol
- ( Location
- { locFile = "test/examples/prooffix.tex"
- , locLine = 6
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "x" )
- ]
- ]
- , taskConjectureLabel = Marker "assumetest"
- , taskLocation = Location
- { locFile = "test/examples/prooffix.tex"
- , locLine = 7
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/prooffix.tex"
- , locLine = 2
- , locColumn = 28
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "x" )
- ]
- }
-] \ No newline at end of file
diff --git a/test/golden/prooffix/glossing.golden b/test/golden/prooffix/glossing.golden
deleted file mode 100644
index 19af9d0..0000000
--- a/test/golden/prooffix/glossing.golden
+++ /dev/null
@@ -1,98 +0,0 @@
-[ BlockLemma
- ( Location
- { locFile = "test/examples/prooffix.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "assumetest" )
- ( Lemma []
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/prooffix.tex"
- , locLine = 2
- , locColumn = 28
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- )
-, BlockProof
- ( Location
- { locFile = "test/examples/prooffix.tex"
- , locLine = 4
- , locColumn = 1
- }
- )
- ( Location
- { locFile = "test/examples/prooffix.tex"
- , locLine = 7
- , locColumn = 1
- }
- )
- ( Fix
- ( Location
- { locFile = "test/examples/prooffix.tex"
- , locLine = 5
- , locColumn = 5
- }
- )
- ( NamedVar "x" :| [] ) ( PropositionalConstant IsTop )
- ( Have
- ( Location
- { locFile = "test/examples/prooffix.tex"
- , locLine = 6
- , locColumn = 5
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/prooffix.tex"
- , locLine = 6
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "x" )
- ]
- ) JustificationEmpty
- ( Qed
- { mloc = Nothing
- , by = JustificationEmpty
- }
- )
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/prooffix/verification.golden b/test/golden/prooffix/verification.golden
deleted file mode 100644
index f8a5c7a..0000000
--- a/test/golden/prooffix/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 2
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 1
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/relation-notation/encoding tasks.golden b/test/golden/relation-notation/encoding tasks.golden
deleted file mode 100644
index 8ae6ed7..0000000
--- a/test/golden/relation-notation/encoding tasks.golden
+++ /dev/null
@@ -1 +0,0 @@
-fof(zf_q0,conjecture,zf_u1(zf_u0(zf_f1,zf_f2),zf_f0)=>zf_u1(zf_u0(zf_f1,zf_f2),zf_f0)). \ No newline at end of file
diff --git a/test/golden/relation-notation/generating tasks.golden b/test/golden/relation-notation/generating tasks.golden
deleted file mode 100644
index c584d73..0000000
--- a/test/golden/relation-notation/generating tasks.golden
+++ /dev/null
@@ -1,110 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses = []
- , taskConjectureLabel = Marker "mathrel_notation_test"
- , taskLocation = Location
- { locFile = "test/examples/relation-notation.tex"
- , locLine = 1
- , locColumn = 1
- }
- , taskConjecture = Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/relation-notation.tex"
- , locLine = 2
- , locColumn = 10
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/relation-notation.tex"
- , locLine = 2
- , locColumn = 10
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "pair" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "pair" ) NonAssoc
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- , TermVar
- ( NamedVar "R" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/relation-notation.tex"
- , locLine = 2
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/relation-notation.tex"
- , locLine = 2
- , locColumn = 33
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "pair" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "pair" ) NonAssoc
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- , TermVar
- ( NamedVar "R" )
- ]
- )
- }
-] \ No newline at end of file
diff --git a/test/golden/relation-notation/glossing.golden b/test/golden/relation-notation/glossing.golden
deleted file mode 100644
index 7ce7ed2..0000000
--- a/test/golden/relation-notation/glossing.golden
+++ /dev/null
@@ -1,111 +0,0 @@
-[ BlockLemma
- ( Location
- { locFile = "test/examples/relation-notation.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "mathrel_notation_test" )
- ( Lemma []
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/relation-notation.tex"
- , locLine = 2
- , locColumn = 10
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/relation-notation.tex"
- , locLine = 2
- , locColumn = 10
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "pair" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "pair" ) NonAssoc
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- , TermVar
- ( NamedVar "R" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/relation-notation.tex"
- , locLine = 2
- , locColumn = 33
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/relation-notation.tex"
- , locLine = 2
- , locColumn = 33
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "pair" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "pair" ) NonAssoc
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- , TermVar
- ( NamedVar "R" )
- ]
- )
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/relation-notation/verification.golden b/test/golden/relation-notation/verification.golden
deleted file mode 100644
index b021015..0000000
--- a/test/golden/relation-notation/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 1
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 0
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/relparam/encoding tasks.golden b/test/golden/relparam/encoding tasks.golden
deleted file mode 100644
index 593b681..0000000
--- a/test/golden/relparam/encoding tasks.golden
+++ /dev/null
@@ -1,4 +0,0 @@
-fof(zf_q0,conjecture,![V0]:V0=V0).
-------------------
-fof(zf_q0,conjecture,![V0]:V0=V0).
-fof(zf_h0,axiom,![V1]:V1=V1). \ No newline at end of file
diff --git a/test/golden/relparam/generating tasks.golden b/test/golden/relparam/generating tasks.golden
deleted file mode 100644
index 46d7cb7..0000000
--- a/test/golden/relparam/generating tasks.golden
+++ /dev/null
@@ -1,109 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses = []
- , taskConjectureLabel = Marker "dummy_abbr_test"
- , taskLocation = Location
- { locFile = "test/examples/relparam.tex"
- , locLine = 6
- , locColumn = 1
- }
- , taskConjecture = Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/relparam.tex"
- , locLine = 3
- , locColumn = 27
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "dummy_abbr_test" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/relparam.tex"
- , locLine = 3
- , locColumn = 27
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- ]
- , taskConjectureLabel = Marker "dummy_defn_test"
- , taskLocation = Location
- { locFile = "test/examples/relparam.tex"
- , locLine = 15
- , locColumn = 1
- }
- , taskConjecture = Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/relparam.tex"
- , locLine = 12
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- }
-] \ No newline at end of file
diff --git a/test/golden/relparam/glossing.golden b/test/golden/relparam/glossing.golden
deleted file mode 100644
index 4f724d1..0000000
--- a/test/golden/relparam/glossing.golden
+++ /dev/null
@@ -1,185 +0,0 @@
-[ BlockAbbr
- ( Location
- { locFile = "test/examples/relparam.tex"
- , locLine = 2
- , locColumn = 1
- }
- )
- ( Marker "abbr_equal" )
- ( Abbreviation
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "EQUAL" )
- ( ParameterArity 1 )
- ( Marker "abbr_equal" )
- )
- )
- )
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/relparam.tex"
- , locLine = 3
- , locColumn = 27
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B 1 )
- , TermVar
- ( B 2 )
- ]
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/relparam.tex"
- , locLine = 6
- , locColumn = 1
- }
- )
- ( Marker "dummy_abbr_test" )
- ( Lemma []
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/relparam.tex"
- , locLine = 7
- , locColumn = 27
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "EQUAL" )
- ( ParameterArity 1 )
- ( Marker "abbr_equal" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "y" )
- )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- )
-, BlockAbbr
- ( Location
- { locFile = "test/examples/relparam.tex"
- , locLine = 11
- , locColumn = 1
- }
- )
- ( Marker "defn_equals" )
- ( Abbreviation
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "EQUALS" )
- ( ParameterArity 2 )
- ( Marker "defn_equals" )
- )
- )
- )
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/relparam.tex"
- , locLine = 12
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B 2 )
- , TermVar
- ( B 3 )
- ]
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/relparam.tex"
- , locLine = 15
- , locColumn = 1
- }
- )
- ( Marker "dummy_defn_test" )
- ( Lemma []
- ( Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/relparam.tex"
- , locLine = 16
- , locColumn = 27
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "EQUALS" )
- ( ParameterArity 2 )
- ( Marker "defn_equals" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "y" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "w" )
- )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/relparam/verification.golden b/test/golden/relparam/verification.golden
deleted file mode 100644
index 24830d8..0000000
--- a/test/golden/relparam/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 2
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 0
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/replace/encoding tasks.golden b/test/golden/replace/encoding tasks.golden
deleted file mode 100644
index a359f42..0000000
--- a/test/golden/replace/encoding tasks.golden
+++ /dev/null
@@ -1,17 +0,0 @@
-fof(zf_q0,conjecture,zf_u5(zf_u3(zf_u2,zf_u2),zf_u0(zf_u4,zf_u4))).
-fof(zf_h0,axiom,![V0,V1,V2]:(zf_u5(V0,zf_u1(V1,V2))<=>(V0=V1|zf_u5(V0,V2)))).
-fof(zf_h1,axiom,![V3,V4]:![V5]:(zf_u5(V5,zf_u0(V3,V4))<=>?[V6,V7]:(zf_u5(V6,V3)&zf_u5(V7,V4)&zf_u3(V6,V7)=V5))).
-fof(zf_h2,axiom,![V8]:(zf_u5(V8,zf_u4)<=>(zf_u5(V8,zf_u2)|V8=zf_u2))).
-------------------
-fof(zf_q0,conjecture,![V0]:(zf_u5(V0,zf_f0)=>![V1,V2]:((V1=zf_u1(V0,zf_u2)&V2=zf_u1(V0,zf_u2))=>V1=V2))).
-fof(zf_h0,axiom,![V3,V4,V5]:(zf_u5(V3,zf_u1(V4,V5))<=>(V3=V4|zf_u5(V3,V5)))).
-fof(zf_h1,axiom,![V6,V7]:![V8]:(zf_u5(V8,zf_u0(V6,V7))<=>?[V9,V10]:(zf_u5(V9,V6)&zf_u5(V10,V7)&zf_u3(V9,V10)=V8))).
-fof(zf_h2,axiom,![V11]:(zf_u5(V11,zf_u4)<=>(zf_u5(V11,zf_u2)|V11=zf_u2))).
-fof(zf_h3,axiom,zf_u5(zf_u3(zf_u2,zf_u2),zf_u0(zf_u4,zf_u4))).
-------------------
-fof(zf_q0,conjecture,![V0]:(zf_u6(V0,zf_u0(zf_f0,zf_f1))<=>?[V1,V2]:(zf_u6(V1,zf_f0)&zf_u6(V2,zf_f1)&zf_u3(V1,V2)=V0))).
-fof(zf_h0,axiom,![V3,V4,V5]:(zf_u6(V3,zf_u1(V4,V5))<=>(V3=V4|zf_u6(V3,V5)))).
-fof(zf_h1,axiom,![V6,V7]:![V8]:(zf_u6(V8,zf_u0(V6,V7))<=>?[V9,V10]:(zf_u6(V9,V6)&zf_u6(V10,V7)&zf_u3(V9,V10)=V8))).
-fof(zf_h2,axiom,![V11,V12]:(zf_u6(V11,zf_u4(V12))<=>?[V13]:(zf_u6(V13,V12)&V11=zf_u1(V13,zf_u2)))).
-fof(zf_h3,axiom,![V14]:(zf_u6(V14,zf_u5)<=>(zf_u6(V14,zf_u2)|V14=zf_u2))).
-fof(zf_h4,axiom,zf_u6(zf_u3(zf_u2,zf_u2),zf_u0(zf_u5,zf_u5))). \ No newline at end of file
diff --git a/test/golden/replace/generating tasks.golden b/test/golden/replace/generating tasks.golden
deleted file mode 100644
index cedbc68..0000000
--- a/test/golden/replace/generating tasks.golden
+++ /dev/null
@@ -1,2241 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "unit" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "any" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "unit" ) End
- )
- ( Marker "unit" ) NonAssoc
- )
- ) []
- ]
- )
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "any" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 10
- , locColumn = 14
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "any" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 10
- , locColumn = 16
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- )
- )
- )
- )
- , Hypothesis Marker "times" Quantified Universally
- ( Scope
- ( Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "frv" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "times" ) ( HoleCons End )
- )
- )
- ( Marker "times" ) RightAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "A" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "B" )
- )
- )
- )
- ]
- ]
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( F
- ( TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "A" )
- )
- )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( F
- ( TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "B" )
- )
- )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 6
- , locColumn = 21
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "pair" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "pair" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "frv" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "cons" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 2
- , locColumn = 7
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 2
- , locColumn = 11
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "X" )
- )
- ]
- ]
- )
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 2
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 2
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "X" )
- )
- ]
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "pair_emptyset_in_times_unit"
- , taskLocation = Location
- { locFile = "test/examples/replace.tex"
- , locLine = 13
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 27
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "pair" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "pair" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 7
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 17
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 31
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "times" ) ( HoleCons End )
- )
- )
- ( Marker "times" ) RightAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 31
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "unit" ) End
- )
- ( Marker "unit" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 42
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "unit" ) End
- )
- ( Marker "unit" ) NonAssoc
- )
- ) []
- ]
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "pair_emptyset_in_times_unit" TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 27
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "pair" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "pair" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 7
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 17
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 31
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "times" ) ( HoleCons End )
- )
- )
- ( Marker "times" ) RightAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 31
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "unit" ) End
- )
- ( Marker "unit" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 42
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "unit" ) End
- )
- ( Marker "unit" ) NonAssoc
- )
- ) []
- ]
- ]
- , Hypothesis Marker "unit" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "any" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "unit" ) End
- )
- ( Marker "unit" ) NonAssoc
- )
- ) []
- ]
- )
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "any" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 10
- , locColumn = 14
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "any" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 10
- , locColumn = 16
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- )
- )
- )
- )
- , Hypothesis Marker "times" Quantified Universally
- ( Scope
- ( Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "frv" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "times" ) ( HoleCons End )
- )
- )
- ( Marker "times" ) RightAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "A" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "B" )
- )
- )
- )
- ]
- ]
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( F
- ( TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "A" )
- )
- )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( F
- ( TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "B" )
- )
- )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 6
- , locColumn = 21
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "pair" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "pair" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "frv" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "cons" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 2
- , locColumn = 7
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 2
- , locColumn = 11
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "X" )
- )
- ]
- ]
- )
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 2
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 2
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "X" )
- )
- ]
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "suc"
- , taskLocation = Location
- { locFile = "test/examples/replace.tex"
- , locLine = 19
- , locColumn = 1
- }
- , taskConjecture = Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( FreshVar 0 )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "a" )
- )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 20
- , locColumn = 44
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( FreshVar 1 )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 20
- , locColumn = 46
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( FreshVar 0 )
- )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 20
- , locColumn = 46
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 20
- , locColumn = 44
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( FreshVar 2 )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 20
- , locColumn = 46
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( FreshVar 0 )
- )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 20
- , locColumn = 46
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( FreshVar 1 )
- )
- , TermVar
- ( B
- ( FreshVar 2 )
- )
- ]
- )
- )
- )
- )
- )
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "suc" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( FreshVar 1 )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "suc" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "suc" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- ]
- ]
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( FreshVar 0 )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "a" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 20
- , locColumn = 44
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( FreshVar 1 )
- )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 20
- , locColumn = 46
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( FreshVar 0 )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 20
- , locColumn = 46
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "pair_emptyset_in_times_unit" TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 27
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "pair" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "pair" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 7
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 17
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 31
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "times" ) ( HoleCons End )
- )
- )
- ( Marker "times" ) RightAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 31
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "unit" ) End
- )
- ( Marker "unit" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 42
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "unit" ) End
- )
- ( Marker "unit" ) NonAssoc
- )
- ) []
- ]
- ]
- , Hypothesis Marker "unit" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "any" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "unit" ) End
- )
- ( Marker "unit" ) NonAssoc
- )
- ) []
- ]
- )
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "any" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 10
- , locColumn = 14
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "any" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 10
- , locColumn = 16
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- )
- )
- )
- )
- , Hypothesis Marker "times" Quantified Universally
- ( Scope
- ( Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "frv" )
- )
- , TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "times" ) ( HoleCons End )
- )
- )
- ( Marker "times" ) RightAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "A" )
- )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "B" )
- )
- )
- )
- ]
- ]
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( F
- ( TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "A" )
- )
- )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( F
- ( TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "B" )
- )
- )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 6
- , locColumn = 21
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "pair" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "pair" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "frv" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "cons" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 2
- , locColumn = 7
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 2
- , locColumn = 11
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "y" )
- )
- , TermVar
- ( B
- ( NamedVar "X" )
- )
- ]
- ]
- )
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 2
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "y" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 2
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "X" )
- )
- ]
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "times_replacement_test"
- , taskLocation = Location
- { locFile = "test/examples/replace.tex"
- , locLine = 25
- , locColumn = 1
- }
- , taskConjecture = Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "frv" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 26
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "times" ) ( HoleCons End )
- )
- )
- ( Marker "times" ) RightAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- ]
- ]
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( F
- ( TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "b" )
- )
- , TermVar
- ( F
- ( TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- )
- )
- ]
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 26
- , locColumn = 21
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "pair" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "pair" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "frv" )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- }
-] \ No newline at end of file
diff --git a/test/golden/replace/glossing.golden b/test/golden/replace/glossing.golden
deleted file mode 100644
index dfded02..0000000
--- a/test/golden/replace/glossing.golden
+++ /dev/null
@@ -1,572 +0,0 @@
-[ BlockAxiom
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "cons" )
- ( Axiom []
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 2
- , locColumn = 7
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 2
- , locColumn = 11
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermVar
- ( NamedVar "y" )
- , TermVar
- ( NamedVar "X" )
- ]
- ]
- )
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 2
- , locColumn = 31
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "y" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 2
- , locColumn = 41
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "x" )
- , TermVar
- ( NamedVar "X" )
- ]
- )
- )
- )
- )
-, BlockDefn
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 5
- , locColumn = 1
- }
- )
- ( Marker "times" )
- ( DefnOp
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "times" ) ( HoleCons End )
- )
- )
- ( Marker "times" ) RightAssoc
- )
- [ NamedVar "A"
- , NamedVar "B"
- ]
- ( ReplaceFun
- (
- ( NamedVar "a"
- , TermVar
- ( NamedVar "A" )
- ) :|
- [
- ( NamedVar "b"
- , TermVar
- ( NamedVar "B" )
- )
- ]
- )
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 6
- , locColumn = 21
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "pair" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "pair" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( Scope ( PropositionalConstant IsTop ) )
- )
- )
-, BlockDefn
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 9
- , locColumn = 1
- }
- )
- ( Marker "unit" )
- ( DefnOp
- ( MixfixItem
- ( TokenCons
- ( Command "unit" ) End
- )
- ( Marker "unit" ) NonAssoc
- ) []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 10
- , locColumn = 14
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 10
- , locColumn = 16
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 10
- , locColumn = 14
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 13
- , locColumn = 1
- }
- )
- ( Marker "pair_emptyset_in_times_unit" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 27
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "pair" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "pair" ) NonAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 7
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 17
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 31
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "times" ) ( HoleCons End )
- )
- )
- ( Marker "times" ) RightAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 31
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "unit" ) End
- )
- ( Marker "unit" ) NonAssoc
- )
- ) []
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 14
- , locColumn = 42
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "unit" ) End
- )
- ( Marker "unit" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- )
-, BlockDefn
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 19
- , locColumn = 1
- }
- )
- ( Marker "suc" )
- ( DefnOp
- ( MixfixItem
- ( TokenCons
- ( Command "suc" )
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- ( Marker "suc" ) NonAssoc
- )
- [ NamedVar "a" ]
- ( ReplacePred
- ( NamedVar "y" )
- ( NamedVar "x" )
- ( TermVar
- ( NamedVar "a" )
- )
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 20
- , locColumn = 44
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar ( B ReplacementRangeVar )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 20
- , locColumn = 46
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "cons" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "cons" ) NonAssoc
- )
- )
- [ TermVar ( B ReplacementDomVar )
- , TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 20
- , locColumn = 46
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "emptyset" ) End
- )
- ( Marker "emptyset" ) NonAssoc
- )
- ) []
- ]
- ]
- )
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 25
- , locColumn = 1
- }
- )
- ( Marker "times_replacement_test" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 26
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 26
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "times" ) ( HoleCons End )
- )
- )
- ( Marker "times" ) RightAssoc
- )
- )
- [ TermVar
- ( NamedVar "A" )
- , TermVar
- ( NamedVar "B" )
- ]
- , ReplaceFun
- (
- ( NamedVar "a"
- , TermVar
- ( NamedVar "A" )
- ) :|
- [
- ( NamedVar "b"
- , TermVar
- ( NamedVar "B" )
- )
- ]
- )
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/replace.tex"
- , locLine = 26
- , locColumn = 21
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( TokenCons
- ( Command "pair" )
- ( TokenCons InvisibleBraceL
- ( HoleCons
- ( TokenCons InvisibleBraceR
- ( TokenCons InvisibleBraceL
- ( HoleCons ( TokenCons InvisibleBraceR End ) )
- )
- )
- )
- )
- )
- ( Marker "pair" ) NonAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "b" )
- )
- ]
- )
- )
- ( Scope ( PropositionalConstant IsTop ) )
- ]
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/replace/verification.golden b/test/golden/replace/verification.golden
deleted file mode 100644
index 68500ff..0000000
--- a/test/golden/replace/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 1
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 3
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 3
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/russell/encoding tasks.golden b/test/golden/russell/encoding tasks.golden
deleted file mode 100644
index d4ea307..0000000
--- a/test/golden/russell/encoding tasks.golden
+++ /dev/null
@@ -1,16 +0,0 @@
-fof(zf_q0,conjecture,?[V0]:zf_u0(V0)).
-fof(zf_h0,axiom,![V1]:(zf_u0(V1)<=>![V2]:zf_u1(V2,V1))).
-fof(zf_h1,axiom,~~?[V3]:zf_u0(V3)).
-------------------
-fof(zf_q0,conjecture,zf_u1(zf_f0,zf_f0)<=>~zf_u1(zf_f0,zf_f0)).
-fof(zf_h0,axiom,![V0]:(zf_u0(V0)<=>![V1]:zf_u1(V1,V0))).
-fof(zf_h1,axiom,![V2]:(zf_u1(V2,zf_f0)<=>(zf_u1(V2,zf_f1)&~zf_u1(V2,V2)))).
-fof(zf_h2,axiom,zf_u0(zf_f1)).
-fof(zf_h3,axiom,~~?[V3]:zf_u0(V3)).
-------------------
-fof(zf_q0,conjecture,$false).
-fof(zf_h0,axiom,![V0]:(zf_u0(V0)<=>![V1]:zf_u1(V1,V0))).
-fof(zf_h1,axiom,![V2]:(zf_u1(V2,zf_f0)<=>(zf_u1(V2,zf_f1)&~zf_u1(V2,V2)))).
-fof(zf_h2,axiom,zf_u0(zf_f1)).
-fof(zf_h3,axiom,zf_u1(zf_f0,zf_f0)<=>~zf_u1(zf_f0,zf_f0)).
-fof(zf_h4,axiom,~~?[V3]:zf_u0(V3)). \ No newline at end of file
diff --git a/test/golden/russell/generating tasks.golden b/test/golden/russell/generating tasks.golden
deleted file mode 100644
index 40c01e6..0000000
--- a/test/golden/russell/generating tasks.golden
+++ /dev/null
@@ -1,864 +0,0 @@
-[ Task
- { taskDirectness = Indirect
- ( Not
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 8
- , locColumn = 18
- }
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction ( PropositionalConstant IsTop )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 8
- , locColumn = 21
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "universal" ) End
- )
- ( Marker "universal_set" )
- )
- )
- )
- [ TermVar
- ( B
- ( FreshVar 0 )
- )
- ]
- )
- )
- )
- )
- )
- , taskHypotheses =
- [ Hypothesis Marker "universal_set" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "universal" ) End
- )
- ( Marker "universal_set" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "V" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Quantified Universally
- ( Scope
- ( Connected Implication ( PropositionalConstant IsTop )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 4
- , locColumn = 32
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "V" )
- )
- )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "_local_1" Not
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 11
- , locColumn = 5
- }
- )
- ( Not
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 8
- , locColumn = 18
- }
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction ( PropositionalConstant IsTop )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 8
- , locColumn = 21
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "universal" ) End
- )
- ( Marker "universal_set" )
- )
- )
- )
- [ TermVar
- ( B
- ( FreshVar 0 )
- )
- ]
- )
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "no_universal_set"
- , taskLocation = Location
- { locFile = "test/examples/russell.tex"
- , locLine = 12
- , locColumn = 5
- }
- , taskConjecture = Quantified Existentially
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 12
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "universal" ) End
- )
- ( Marker "universal_set" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "V" )
- )
- ]
- )
- )
- }
-, Task
- { taskDirectness = Indirect
- ( Not
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 8
- , locColumn = 18
- }
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction ( PropositionalConstant IsTop )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 8
- , locColumn = 21
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "universal" ) End
- )
- ( Marker "universal_set" )
- )
- )
- )
- [ TermVar
- ( B
- ( FreshVar 0 )
- )
- ]
- )
- )
- )
- )
- )
- , taskHypotheses =
- [ Hypothesis Marker "universal_set" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "universal" ) End
- )
- ( Marker "universal_set" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "V" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Quantified Universally
- ( Scope
- ( Connected Implication ( PropositionalConstant IsTop )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 4
- , locColumn = 32
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "V" )
- )
- )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "_local_3" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "R" )
- )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "V" )
- )
- )
- ]
- )
- ( Not
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 13
- , locColumn = 34
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 13
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "_local_2" Connected Conjunction ( PropositionalConstant IsTop )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 12
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "universal" ) End
- )
- ( Marker "universal_set" )
- )
- )
- )
- [ TermVar
- ( NamedVar "V" )
- ]
- )
- , Hypothesis Marker "_local_1" Not
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 11
- , locColumn = 5
- }
- )
- ( Not
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 8
- , locColumn = 18
- }
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction ( PropositionalConstant IsTop )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 8
- , locColumn = 21
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "universal" ) End
- )
- ( Marker "universal_set" )
- )
- )
- )
- [ TermVar
- ( B
- ( FreshVar 0 )
- )
- ]
- )
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "no_universal_set"
- , taskLocation = Location
- { locFile = "test/examples/russell.tex"
- , locLine = 14
- , locColumn = 5
- }
- , taskConjecture = Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 14
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "R" )
- , TermVar
- ( NamedVar "R" )
- ]
- )
- ( Not
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 14
- , locColumn = 29
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 14
- , locColumn = 29
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "R" )
- , TermVar
- ( NamedVar "R" )
- ]
- )
- )
- }
-, Task
- { taskDirectness = Indirect
- ( Not
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 8
- , locColumn = 18
- }
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction ( PropositionalConstant IsTop )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 8
- , locColumn = 21
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "universal" ) End
- )
- ( Marker "universal_set" )
- )
- )
- )
- [ TermVar
- ( B
- ( FreshVar 0 )
- )
- ]
- )
- )
- )
- )
- )
- , taskHypotheses =
- [ Hypothesis Marker "universal_set" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "universal" ) End
- )
- ( Marker "universal_set" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "V" )
- )
- ]
- )
- ( Quantified Universally
- ( Scope
- ( Quantified Universally
- ( Scope
- ( Connected Implication ( PropositionalConstant IsTop )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 4
- , locColumn = 32
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "V" )
- )
- )
- )
- )
- )
- ]
- )
- )
- )
- )
- )
- )
- )
- )
- , Hypothesis Marker "_local_4" Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 14
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "R" )
- , TermVar
- ( NamedVar "R" )
- ]
- )
- ( Not
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 14
- , locColumn = 29
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 14
- , locColumn = 29
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "R" )
- , TermVar
- ( NamedVar "R" )
- ]
- )
- )
- , Hypothesis Marker "_local_3" Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "R" )
- )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "V" )
- )
- )
- ]
- )
- ( Not
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 13
- , locColumn = 34
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 13
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "_local_2" Connected Conjunction ( PropositionalConstant IsTop )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 12
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "universal" ) End
- )
- ( Marker "universal_set" )
- )
- )
- )
- [ TermVar
- ( NamedVar "V" )
- ]
- )
- , Hypothesis Marker "_local_1" Not
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 11
- , locColumn = 5
- }
- )
- ( Not
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 8
- , locColumn = 18
- }
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction ( PropositionalConstant IsTop )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 8
- , locColumn = 21
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "universal" ) End
- )
- ( Marker "universal_set" )
- )
- )
- )
- [ TermVar
- ( B
- ( FreshVar 0 )
- )
- ]
- )
- )
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "no_universal_set"
- , taskLocation = Location
- { locFile = "test/examples/russell.tex"
- , locLine = 15
- , locColumn = 5
- }
- , taskConjecture = PropositionalConstant IsBottom
- }
-] \ No newline at end of file
diff --git a/test/golden/russell/glossing.golden b/test/golden/russell/glossing.golden
deleted file mode 100644
index ab57fdb..0000000
--- a/test/golden/russell/glossing.golden
+++ /dev/null
@@ -1,271 +0,0 @@
-[ BlockDefn
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "universal_set" )
- ( DefnPredicate []
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "universal" ) End
- )
- ( Marker "universal_set" )
- )
- )
- ( NamedVar "V" :| [] )
- ( Quantified Universally
- ( Scope
- ( Connected Implication ( PropositionalConstant IsTop )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 4
- , locColumn = 32
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "V" )
- )
- )
- ]
- )
- )
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 7
- , locColumn = 1
- }
- )
- ( Marker "no_universal_set" )
- ( Lemma []
- ( Not
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 8
- , locColumn = 18
- }
- )
- ( Quantified Existentially
- ( Scope
- ( Connected Conjunction ( PropositionalConstant IsTop )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 8
- , locColumn = 21
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "universal" ) End
- )
- ( Marker "universal_set" )
- )
- )
- )
- [ TermVar
- ( B
- ( FreshVar 0 )
- )
- ]
- )
- )
- )
- )
- )
- )
-, BlockProof
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 10
- , locColumn = 1
- }
- )
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 16
- , locColumn = 1
- }
- )
- ( ByContradiction
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 11
- , locColumn = 5
- }
- )
- ( Take
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 12
- , locColumn = 5
- }
- )
- ( NamedVar "V" :| [] )
- ( Connected Conjunction ( PropositionalConstant IsTop )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 12
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateAdj
- ( LexicalItem
- ( TokenCons
- ( Word "universal" ) End
- )
- ( Marker "universal_set" )
- )
- )
- )
- [ TermVar
- ( NamedVar "V" )
- ]
- )
- ) JustificationEmpty
- ( Define
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 13
- , locColumn = 5
- }
- )
- ( NamedVar "R" )
- ( TermSep
- ( NamedVar "x" )
- ( TermVar
- ( NamedVar "V" )
- )
- ( Scope
- ( Not
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 13
- , locColumn = 34
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 13
- , locColumn = 34
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B () )
- , TermVar
- ( B () )
- ]
- )
- )
- )
- )
- ( Have
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 14
- , locColumn = 5
- }
- )
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 14
- , locColumn = 12
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "R" )
- , TermVar
- ( NamedVar "R" )
- ]
- )
- ( Not
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 14
- , locColumn = 29
- }
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 14
- , locColumn = 29
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "R" )
- , TermVar
- ( NamedVar "R" )
- ]
- )
- )
- ) JustificationEmpty
- ( Contradiction
- ( Location
- { locFile = "test/examples/russell.tex"
- , locLine = 15
- , locColumn = 5
- }
- ) JustificationEmpty
- )
- )
- )
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/russell/verification.golden b/test/golden/russell/verification.golden
deleted file mode 100644
index 7015657..0000000
--- a/test/golden/russell/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 3
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 2
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/separation/encoding tasks.golden b/test/golden/separation/encoding tasks.golden
deleted file mode 100644
index 530e442..0000000
--- a/test/golden/separation/encoding tasks.golden
+++ /dev/null
@@ -1 +0,0 @@
-fof(zf_q0,conjecture,![V0]:(zf_u0(V0,zf_f0)<=>(zf_u0(V0,zf_f0)&V0=V0))). \ No newline at end of file
diff --git a/test/golden/separation/generating tasks.golden b/test/golden/separation/generating tasks.golden
deleted file mode 100644
index e83dcf1..0000000
--- a/test/golden/separation/generating tasks.golden
+++ /dev/null
@@ -1,100 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses = []
- , taskConjectureLabel = Marker "sep_test"
- , taskLocation = Location
- { locFile = "test/examples/separation.tex"
- , locLine = 1
- , locColumn = 1
- }
- , taskConjecture = Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "X" )
- )
- )
- ]
- )
- ( Connected Conjunction
- ( TermSymbol
- ( Location
- { locFile = "<nowhere>"
- , locLine = -1
- , locColumn = -1
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "X" )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/separation.tex"
- , locLine = 2
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "x" )
- )
- , TermVar
- ( B
- ( NamedVar "x" )
- )
- ]
- )
- )
- )
- )
- }
-] \ No newline at end of file
diff --git a/test/golden/separation/glossing.golden b/test/golden/separation/glossing.golden
deleted file mode 100644
index c184012..0000000
--- a/test/golden/separation/glossing.golden
+++ /dev/null
@@ -1,60 +0,0 @@
-[ BlockLemma
- ( Location
- { locFile = "test/examples/separation.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "sep_test" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/separation.tex"
- , locLine = 2
- , locColumn = 8
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "X" )
- , TermSep
- ( NamedVar "x" )
- ( TermVar
- ( NamedVar "X" )
- )
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/separation.tex"
- , locLine = 2
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B () )
- , TermVar
- ( B () )
- ]
- )
- )
- ]
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/separation/verification.golden b/test/golden/separation/verification.golden
deleted file mode 100644
index b021015..0000000
--- a/test/golden/separation/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 0
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 1
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 0
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/golden/union/encoding tasks.golden b/test/golden/union/encoding tasks.golden
deleted file mode 100644
index 444a277..0000000
--- a/test/golden/union/encoding tasks.golden
+++ /dev/null
@@ -1,21 +0,0 @@
-fof(zf_q0,conjecture,zf_u0(zf_f0,zf_f1)=zf_u0(zf_f1,zf_f0)).
-fof(zf_h0,axiom,![V0,V1,V2]:(zf_u1(V0,zf_u0(V1,V2))<=>(zf_u1(V0,V1)|zf_u1(V0,V2)))).
-fof(zf_h1,axiom,![V3,V4]:(![V5]:(zf_u1(V5,V3)<=>zf_u1(V5,V4))=>V3=V4)).
-------------------
-fof(zf_q0,conjecture,![V0]:(zf_u1(V0,zf_u0(zf_u0(zf_f0,zf_f1),zf_f2))=>zf_u1(V0,zf_u0(zf_f0,zf_u0(zf_f1,zf_f2))))).
-fof(zf_h0,axiom,![V1,V2,V3]:(zf_u1(V1,zf_u0(V2,V3))<=>(zf_u1(V1,V2)|zf_u1(V1,V3)))).
-fof(zf_h1,axiom,![V4,V5]:(![V6]:(zf_u1(V6,V4)<=>zf_u1(V6,V5))=>V4=V5)).
-fof(zf_h2,axiom,![V7,V8]:zf_u0(V7,V8)=zf_u0(V8,V7)).
-------------------
-fof(zf_q0,conjecture,![V0]:(zf_u1(V0,zf_u0(zf_f0,zf_u0(zf_f1,zf_f2)))=>zf_u1(V0,zf_u0(zf_u0(zf_f0,zf_f1),zf_f2)))).
-fof(zf_h0,axiom,![V1,V2,V3]:(zf_u1(V1,zf_u0(V2,V3))<=>(zf_u1(V1,V2)|zf_u1(V1,V3)))).
-fof(zf_h1,axiom,![V4,V5]:(![V6]:(zf_u1(V6,V4)<=>zf_u1(V6,V5))=>V4=V5)).
-fof(zf_h2,axiom,![V7,V8]:zf_u0(V7,V8)=zf_u0(V8,V7)).
-fof(zf_h3,axiom,![V9]:(zf_u1(V9,zf_u0(zf_u0(zf_f0,zf_f1),zf_f2))=>zf_u1(V9,zf_u0(zf_f0,zf_u0(zf_f1,zf_f2))))).
-------------------
-fof(zf_q0,conjecture,zf_u0(zf_u0(zf_f0,zf_f1),zf_f2)=zf_u0(zf_f0,zf_u0(zf_f1,zf_f2))).
-fof(zf_h0,axiom,![V0,V1,V2]:(zf_u1(V0,zf_u0(V1,V2))<=>(zf_u1(V0,V1)|zf_u1(V0,V2)))).
-fof(zf_h1,axiom,![V3,V4]:(![V5]:(zf_u1(V5,V3)<=>zf_u1(V5,V4))=>V3=V4)).
-fof(zf_h2,axiom,![V6,V7]:zf_u0(V6,V7)=zf_u0(V7,V6)).
-fof(zf_h3,axiom,![V8]:(zf_u1(V8,zf_u0(zf_f0,zf_u0(zf_f1,zf_f2)))=>zf_u1(V8,zf_u0(zf_u0(zf_f0,zf_f1),zf_f2)))).
-fof(zf_h4,axiom,![V9]:(zf_u1(V9,zf_u0(zf_u0(zf_f0,zf_f1),zf_f2))=>zf_u1(V9,zf_u0(zf_f0,zf_u0(zf_f1,zf_f2))))). \ No newline at end of file
diff --git a/test/golden/union/generating tasks.golden b/test/golden/union/generating tasks.golden
deleted file mode 100644
index 06620f8..0000000
--- a/test/golden/union/generating tasks.golden
+++ /dev/null
@@ -1,2039 +0,0 @@
-[ Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "union_defn" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction ( PropositionalConstant IsTop ) ( PropositionalConstant IsTop ) )
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 7
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 11
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "A" )
- )
- , TermVar
- ( B
- ( NamedVar "B" )
- )
- ]
- ]
- )
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 28
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "A" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 40
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "B" )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "ext" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "A" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 2
- , locColumn = 48
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "B" )
- )
- )
- )
- ]
- )
- )
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 3
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "A" )
- )
- , TermVar
- ( B
- ( NamedVar "B" )
- )
- ]
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "union_comm"
- , taskLocation = Location
- { locFile = "test/examples/union.tex"
- , locLine = 11
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 12
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 12
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( NamedVar "A" )
- , TermVar
- ( NamedVar "B" )
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 12
- , locColumn = 18
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( NamedVar "B" )
- , TermVar
- ( NamedVar "A" )
- ]
- ]
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "union_comm" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 12
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 12
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "A" )
- )
- , TermVar
- ( B
- ( NamedVar "B" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 12
- , locColumn = 18
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "B" )
- )
- , TermVar
- ( B
- ( NamedVar "A" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "union_defn" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction ( PropositionalConstant IsTop ) ( PropositionalConstant IsTop ) )
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 7
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 11
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "A" )
- )
- , TermVar
- ( B
- ( NamedVar "B" )
- )
- ]
- ]
- )
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 28
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "A" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 40
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "B" )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "ext" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "A" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 2
- , locColumn = 48
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "B" )
- )
- )
- )
- ]
- )
- )
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 3
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "A" )
- )
- , TermVar
- ( B
- ( NamedVar "B" )
- )
- ]
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "union_assoc"
- , taskLocation = Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 5
- }
- , taskConjecture = Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 35
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 35
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "C" )
- )
- )
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 63
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 67
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 76
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "C" )
- )
- )
- ]
- ]
- ]
- )
- )
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "union_comm" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 12
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 12
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "A" )
- )
- , TermVar
- ( B
- ( NamedVar "B" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 12
- , locColumn = 18
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "B" )
- )
- , TermVar
- ( B
- ( NamedVar "A" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "union_defn" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction ( PropositionalConstant IsTop ) ( PropositionalConstant IsTop ) )
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 7
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 11
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "A" )
- )
- , TermVar
- ( B
- ( NamedVar "B" )
- )
- ]
- ]
- )
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 28
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "A" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 40
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "B" )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "ext" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "A" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 2
- , locColumn = 48
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "B" )
- )
- )
- )
- ]
- )
- )
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 3
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "A" )
- )
- , TermVar
- ( B
- ( NamedVar "B" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "_local_1" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 35
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 35
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "C" )
- )
- )
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 63
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 67
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 76
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "C" )
- )
- )
- ]
- ]
- ]
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "union_assoc"
- , taskLocation = Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 5
- }
- , taskConjecture = Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 34
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 43
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "C" )
- )
- )
- ]
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 63
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 68
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 68
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "C" )
- )
- )
- ]
- ]
- )
- )
- )
- }
-, Task
- { taskDirectness = Direct
- , taskHypotheses =
- [ Hypothesis Marker "union_comm" Quantified Universally
- ( Scope
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 12
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 12
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "A" )
- )
- , TermVar
- ( B
- ( NamedVar "B" )
- )
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 12
- , locColumn = 18
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "B" )
- )
- , TermVar
- ( B
- ( NamedVar "A" )
- )
- ]
- ]
- )
- )
- , Hypothesis Marker "union_defn" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Connected Conjunction ( PropositionalConstant IsTop ) ( PropositionalConstant IsTop ) )
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 7
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 11
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( B
- ( NamedVar "A" )
- )
- , TermVar
- ( B
- ( NamedVar "B" )
- )
- ]
- ]
- )
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 28
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "A" )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 40
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( B
- ( NamedVar "B" )
- )
- ]
- )
- )
- )
- )
- )
- , Hypothesis Marker "ext" Quantified Universally
- ( Scope
- ( Connected Implication
- ( Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "A" )
- )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 2
- , locColumn = 48
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( F
- ( TermVar
- ( B
- ( NamedVar "B" )
- )
- )
- )
- ]
- )
- )
- )
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 3
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "A" )
- )
- , TermVar
- ( B
- ( NamedVar "B" )
- )
- ]
- )
- )
- )
- , Hypothesis Marker "_local_2" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 34
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 43
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "C" )
- )
- )
- ]
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 63
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 68
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 68
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "C" )
- )
- )
- ]
- ]
- )
- )
- )
- , Hypothesis Marker "_local_1" Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 35
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 35
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "C" )
- )
- )
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 63
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 67
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 76
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "C" )
- )
- )
- ]
- ]
- ]
- )
- )
- )
- ]
- , taskConjectureLabel = Marker "union_assoc"
- , taskLocation = Location
- { locFile = "test/examples/union.tex"
- , locLine = 21
- , locColumn = 1
- }
- , taskConjecture = TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 16
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 16
- , locColumn = 7
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 16
- , locColumn = 7
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( NamedVar "A" )
- , TermVar
- ( NamedVar "B" )
- ]
- , TermVar
- ( NamedVar "C" )
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 16
- , locColumn = 28
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( NamedVar "A" )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 16
- , locColumn = 37
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( NamedVar "B" )
- , TermVar
- ( NamedVar "C" )
- ]
- ]
- ]
- }
-] \ No newline at end of file
diff --git a/test/golden/union/glossing.golden b/test/golden/union/glossing.golden
deleted file mode 100644
index 31d05fe..0000000
--- a/test/golden/union/glossing.golden
+++ /dev/null
@@ -1,734 +0,0 @@
-[ BlockAxiom
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 1
- , locColumn = 1
- }
- )
- ( Marker "ext" )
- ( Axiom
- [ Asm
- ( Quantified Universally
- ( Scope
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 2
- , locColumn = 35
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 2
- , locColumn = 48
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- ]
- )
- )
- )
- )
- ]
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 3
- , locColumn = 13
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermVar
- ( NamedVar "A" )
- , TermVar
- ( NamedVar "B" )
- ]
- )
- )
-, BlockAxiom
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 6
- , locColumn = 1
- }
- )
- ( Marker "union_defn" )
- ( Axiom
- [ Asm ( PropositionalConstant IsTop )
- , Asm ( PropositionalConstant IsTop )
- ]
- ( Connected Equivalence
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 7
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 11
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( NamedVar "A" )
- , TermVar
- ( NamedVar "B" )
- ]
- ]
- )
- ( Connected Disjunction
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 28
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "A" )
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 8
- , locColumn = 40
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( NamedVar "a" )
- , TermVar
- ( NamedVar "B" )
- ]
- )
- )
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 11
- , locColumn = 1
- }
- )
- ( Marker "union_comm" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 12
- , locColumn = 16
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 12
- , locColumn = 6
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( NamedVar "A" )
- , TermVar
- ( NamedVar "B" )
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 12
- , locColumn = 18
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( NamedVar "B" )
- , TermVar
- ( NamedVar "A" )
- ]
- ]
- )
- )
-, BlockLemma
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 15
- , locColumn = 1
- }
- )
- ( Marker "union_assoc" )
- ( Lemma []
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 16
- , locColumn = 26
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Symbol "=" )
- ( ParameterArity 0 )
- ( Marker "eq" )
- )
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 16
- , locColumn = 7
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 16
- , locColumn = 7
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( NamedVar "A" )
- , TermVar
- ( NamedVar "B" )
- ]
- , TermVar
- ( NamedVar "C" )
- ]
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 16
- , locColumn = 28
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( NamedVar "A" )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 16
- , locColumn = 37
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( NamedVar "B" )
- , TermVar
- ( NamedVar "C" )
- ]
- ]
- ]
- )
- )
-, BlockProof
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 18
- , locColumn = 1
- }
- )
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 21
- , locColumn = 1
- }
- )
- ( Have
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 5
- }
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 35
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 35
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "C" )
- )
- )
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 63
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 67
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 19
- , locColumn = 76
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "C" )
- )
- )
- ]
- ]
- ]
- )
- )
- )
- ) JustificationEmpty
- ( Have
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 5
- }
- )
- ( Quantified Universally
- ( Scope
- ( Connected Implication
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 30
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 34
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 43
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "C" )
- )
- )
- ]
- ]
- ]
- )
- ( TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 63
- }
- )
- ( SymbolPredicate
- ( PredicateRelation
- ( RelationSymbol
- ( Command "in" )
- ( ParameterArity 0 )
- ( Marker "elem" )
- )
- )
- )
- [ TermVar
- ( B
- ( NamedVar "a" )
- )
- , TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 68
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermSymbol
- ( Location
- { locFile = "test/examples/union.tex"
- , locLine = 20
- , locColumn = 68
- }
- )
- ( SymbolMixfix
- ( MixfixItem
- ( HoleCons
- ( TokenCons
- ( Command "union" ) ( HoleCons End )
- )
- )
- ( Marker "union" ) LeftAssoc
- )
- )
- [ TermVar
- ( F
- ( TermVar
- ( NamedVar "A" )
- )
- )
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "B" )
- )
- )
- ]
- , TermVar
- ( F
- ( TermVar
- ( NamedVar "C" )
- )
- )
- ]
- ]
- )
- )
- )
- ) JustificationEmpty
- ( Qed
- { mloc = Nothing
- , by = JustificationEmpty
- }
- )
- )
- )
-] \ No newline at end of file
diff --git a/test/golden/union/verification.golden b/test/golden/union/verification.golden
deleted file mode 100644
index e7f6356..0000000
--- a/test/golden/union/verification.golden
+++ /dev/null
@@ -1,11 +0,0 @@
-VerifiedWithTrustedVampire
- ( VerificationReport
- { verificationRoute = LegacyVerificationRoute
- , verificationLegacyDeclaredAssumptionCount = 2
- , verificationTypedDeclaredAssumptionCount = 0
- , verificationTrustedVampireCount = 4
- , verificationExplicitGapLocations = []
- , verificationTrustedLegacyRuleCount = 1
- , verificationKernelProofCount = 0
- }
- ) \ No newline at end of file
diff --git a/test/phase3/gloss-imported.tex b/test/phase3/gloss-imported.tex
deleted file mode 100644
index db0cf4f..0000000
--- a/test/phase3/gloss-imported.tex
+++ /dev/null
@@ -1,3 +0,0 @@
-\begin{signature}\label{phase3_gloss_imported}
- $\unions{X}$ is a set.
-\end{signature}
diff --git a/test/phase3/gloss-root.tex b/test/phase3/gloss-root.tex
deleted file mode 100644
index 9d4ce19..0000000
--- a/test/phase3/gloss-root.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\import{test/phase3/gloss-imported.tex}
-
-\begin{signature}\label{phase3_gloss_root_first}
- $\unions{X}$ is a set.
-\end{signature}
-
-\begin{signature}\label{phase3_gloss_root_second}
- $\fst{X}$ is a set.
-\end{signature}
diff --git a/test/phase3/legacy-importer.tex b/test/phase3/legacy-importer.tex
deleted file mode 100644
index 62d1f2b..0000000
--- a/test/phase3/legacy-importer.tex
+++ /dev/null
@@ -1,3 +0,0 @@
-\import{test/phase3/typed-producer.tex}
-
-% This root remains outside the typed migration selection.
diff --git a/test/phase3/typed-importer.tex b/test/phase3/typed-importer.tex
new file mode 100644
index 0000000..a1ab3ff
--- /dev/null
+++ b/test/phase3/typed-importer.tex
@@ -0,0 +1,3 @@
+\import{test/phase3/typed-producer.tex}
+
+% Every ordinary root follows the exact typed production route.
diff --git a/test/phase5/exact-contextual-abbreviation-ambiguous.tex b/test/phase5/exact-contextual-abbreviation-ambiguous.tex
new file mode 100644
index 0000000..c8fd94c
--- /dev/null
+++ b/test/phase5/exact-contextual-abbreviation-ambiguous.tex
@@ -0,0 +1,17 @@
+\import{test/phase5/exact-contextual-abbreviation.tex}
+
+\begin{struct}\label{phase5_context_other_magma}
+ A phase five context other magma $A$ is a onesorted structure equipped with
+ \begin{enumerate}
+ \item $\phasefivecombine$
+ \end{enumerate}
+ such that
+ \begin{enumerate}
+ \item\label{phase5_context_other_refl} $A = A$.
+ \end{enumerate}
+\end{struct}
+
+\begin{proposition}\label{phase5_context_ambiguous}
+ Let $A,a,b$ be sets.
+ Then $\phasefivecombine[A](a,b) = \phasefivecombine[A](a,b)$.
+\end{proposition}
diff --git a/test/phase5/exact-contextual-abbreviation-consumer.tex b/test/phase5/exact-contextual-abbreviation-consumer.tex
new file mode 100644
index 0000000..f2e1ceb
--- /dev/null
+++ b/test/phase5/exact-contextual-abbreviation-consumer.tex
@@ -0,0 +1,11 @@
+\import{test/phase5/exact-contextual-abbreviation.tex}
+
+\begin{abbreviation}\label{phase5_context_quantified}
+ $a$ is phase five universally absorbing iff
+ for all $b$ we have $a\phasefivedot b = a$.
+\end{abbreviation}
+
+\begin{abbreviation}\label{phase5_context_quantified_explicit}
+ $A$ is a phase five explicit universal absorber of $a$ iff
+ for all $b$ we have $\phasefivecombine[A](a,b) = a$.
+\end{abbreviation}
diff --git a/test/phase5/exact-contextual-abbreviation-missing.tex b/test/phase5/exact-contextual-abbreviation-missing.tex
new file mode 100644
index 0000000..cecbbf2
--- /dev/null
+++ b/test/phase5/exact-contextual-abbreviation-missing.tex
@@ -0,0 +1,6 @@
+\import{test/phase5/exact-contextual-abbreviation.tex}
+
+\begin{proposition}\label{phase5_context_missing}
+ Let $a,b$ be sets.
+ Then $a\phasefivedot b = b\phasefivedot a$.
+\end{proposition}
diff --git a/test/phase5/exact-contextual-abbreviation.tex b/test/phase5/exact-contextual-abbreviation.tex
new file mode 100644
index 0000000..9b4387e
--- /dev/null
+++ b/test/phase5/exact-contextual-abbreviation.tex
@@ -0,0 +1,56 @@
+\begin{signature}\label{phase5_context_apply}
+ $\apply{f}{x}$ is a set.
+\end{signature}
+
+\begin{signature}\label{phase5_context_pair}
+ $(a,b)$ is a set.
+\end{signature}
+
+\begin{struct}\label{phase5_context_magma}
+ A phase five context magma $A$ is a onesorted structure equipped with
+ \begin{enumerate}
+ \item $\phasefivecombine$
+ \end{enumerate}
+ such that
+ \begin{enumerate}
+ \item\label{phase5_context_refl} $A = A$.
+ \end{enumerate}
+\end{struct}
+
+\begin{struct}\label{phase5_context_unital_magma}
+ A phase five context unital magma $A$ is a phase five context magma.
+\end{struct}
+
+\begin{abbreviation}\label{phase5_context_dot}
+ %! infixl 4
+ $a\phasefivedot b = \phasefivecombine(a,b)$.
+\end{abbreviation}
+
+\begin{abbreviation}\label{phase5_context_commutes}
+ $a$ phase five commutes with $b$ iff
+ $a\phasefivedot b = b\phasefivedot a$.
+\end{abbreviation}
+
+\begin{proposition}\label{phase5_context_dot_explicit}
+ Let $A$ be a phase five context magma.
+ Let $a,b$ be sets.
+ Then $a\phasefivedot b = \phasefivecombine[A](a,b)$.
+\end{proposition}
+
+\begin{proposition}\label{phase5_context_inherited}
+ Let $A$ be a phase five context unital magma.
+ Let $a,b$ be sets.
+ Then $a\phasefivedot b = \phasefivecombine[A](a,b)$.
+\end{proposition}
+
+\begin{proposition}\label{phase5_context_nested}
+ Let $A$ be a phase five context magma.
+ Let $a,b$ be sets.
+ Then $a$ phase five commutes with $b$ iff
+ $\phasefivecombine[A](a,b) = \phasefivecombine[A](b,a)$.
+\end{proposition}
+
+\begin{proposition}\label{phase5_context_explicit_unique}
+ Let $A,a,b$ be sets.
+ Then $\phasefivecombine[A](a,b) = \phasefivecombine[A](a,b)$.
+\end{proposition}
diff --git a/test/phase5/exact-local-function-failure.tex b/test/phase5/exact-local-function-failure.tex
new file mode 100644
index 0000000..f1afc9b
--- /dev/null
+++ b/test/phase5/exact-local-function-failure.tex
@@ -0,0 +1,8 @@
+\begin{proposition}\label{phase5_local_function_failure}
+ For all $A$ we have $A = A$.
+\end{proposition}
+\begin{proof}
+ Fix $A$.
+ Let $f(x) = f$ for $x\in A$.
+ Follows by assumption.
+\end{proof}
diff --git a/test/phase5/exact-local-function.tex b/test/phase5/exact-local-function.tex
new file mode 100644
index 0000000..03e6ce4
--- /dev/null
+++ b/test/phase5/exact-local-function.tex
@@ -0,0 +1,18 @@
+\begin{signature}\label{phase5_local_pair}
+ $(x,y)$ is a set.
+\end{signature}
+
+\begin{proposition}\label{phase5_local_function}
+ For all $A$ we have $A = A$.
+\end{proposition}
+\begin{proof}
+ Fix $A$.
+ Let $f(x) = x$ for $x\in A$.
+ Show for all $y$ we have if $y\in A$, then $(y,y)\in f$.
+ \begin{subproof}
+ Fix $y$.
+ Assume $y\in A$.
+ Follows by assumption.
+ \end{subproof}
+ Follows by assumption.
+\end{proof}
diff --git a/test/phase5/exact-structure-child.tex b/test/phase5/exact-structure-child.tex
new file mode 100644
index 0000000..b9f1e36
--- /dev/null
+++ b/test/phase5/exact-structure-child.tex
@@ -0,0 +1,8 @@
+\import{test/phase5/exact-structure.tex}
+
+\begin{struct}\label{marked_pointed_set}
+ A marked pointed set $X$ is a pointed set such that
+ \begin{enumerate}
+ \item\label{marked_pointed_refl} $\pick[X] = \pick$.
+ \end{enumerate}
+\end{struct}
diff --git a/test/phase5/exact-structure.tex b/test/phase5/exact-structure.tex
new file mode 100644
index 0000000..b1a0d86
--- /dev/null
+++ b/test/phase5/exact-structure.tex
@@ -0,0 +1,27 @@
+\begin{struct}\label{pointed_set}
+ A pointed set $X$ is a onesorted structure equipped with
+ \begin{enumerate}
+ \item $\pick$
+ \end{enumerate}
+ such that
+ \begin{enumerate}
+ \item\label{pointed_refl} $X = X$.
+ \end{enumerate}
+\end{struct}
+
+\begin{proposition}\label{pointed_carrier}
+ Let $X$ be a pointed set.
+ Let $x \in X$.
+ Then $x \in \carrier[X]$.
+\end{proposition}
+\begin{proof}
+ Follows by assumption.
+\end{proof}
+
+\begin{proposition}\label{pointed_operation}
+ Let $X$ be a pointed set.
+ Then $\pick = \pick[X]$.
+\end{proposition}
+\begin{proof}
+ Follows by assumption.
+\end{proof}
diff --git a/test/phase6/admitted-prefix-failure.tex b/test/phase6/admitted-prefix-failure.tex
new file mode 100644
index 0000000..b3c6df8
--- /dev/null
+++ b/test/phase6/admitted-prefix-failure.tex
@@ -0,0 +1,28 @@
+\import{test/phase5/exact-escape-producer.tex}
+
+\begin{proposition}\label{phase6_admitted_omission}
+ For all $x$ we have $x = x$.
+\end{proposition}
+\begin{proof}
+ Omitted.
+\end{proof}
+
+\begin{proposition}\label{phase6_rejected_declaration}
+ For all $x$ we have if $x = x$, then $x = x$.
+\end{proposition}
+\begin{proof}
+ Fix $x$.
+ Assume $x = \emptyset$.
+ Follows by assumption.
+\end{proof}
+
+\begin{axiom}\label{phase6_unadmitted_axiom}
+ For all $x$ we have $x = x$.
+\end{axiom}
+
+\begin{proposition}\label{phase6_unadmitted_omission}
+ For all $x$ we have $x = x$.
+\end{proposition}
+\begin{proof}
+ Omitted.
+\end{proof}
diff --git a/test/phase7/concurrent-earlier.tex b/test/phase7/concurrent-earlier.tex
new file mode 100644
index 0000000..a6548f6
--- /dev/null
+++ b/test/phase7/concurrent-earlier.tex
@@ -0,0 +1,11 @@
+\begin{axiom}\label{phase7_concurrent_earlier_axiom}
+ For all $x$ we have $x = x$.
+\end{axiom}
+
+\begin{proposition}\label{phase7_concurrent_earlier_failure}
+ For all $x$ we have $x = x$.
+\end{proposition}
+\begin{proof}
+ Fix $x$.
+ Follows by assumption.
+\end{proof}
diff --git a/test/phase7/concurrent-failure-root.tex b/test/phase7/concurrent-failure-root.tex
new file mode 100644
index 0000000..7c23e6e
--- /dev/null
+++ b/test/phase7/concurrent-failure-root.tex
@@ -0,0 +1,10 @@
+\import{test/phase7/concurrent-earlier.tex}
+\import{test/phase7/concurrent-later.tex}
+
+\begin{proposition}\label{phase7_concurrent_unstarted_root}
+ For all $x$ we have $x = x$.
+\end{proposition}
+\begin{proof}
+ Fix $x$.
+ Follows by assumption.
+\end{proof}
diff --git a/test/phase7/concurrent-later.tex b/test/phase7/concurrent-later.tex
new file mode 100644
index 0000000..2daf8e9
--- /dev/null
+++ b/test/phase7/concurrent-later.tex
@@ -0,0 +1,11 @@
+\begin{axiom}\label{phase7_concurrent_later_axiom}
+ For all $x$ we have $x = x$.
+\end{axiom}
+
+\begin{proposition}\label{phase7_concurrent_later_failure}
+ For all $x$ we have $x = x$.
+\end{proposition}
+\begin{proof}
+ Fix $x$.
+ Follows by assumption.
+\end{proof}
diff --git a/test/phase7/dependent-proof-chain.tex b/test/phase7/dependent-proof-chain.tex
new file mode 100644
index 0000000..3d70f47
--- /dev/null
+++ b/test/phase7/dependent-proof-chain.tex
@@ -0,0 +1,11 @@
+\begin{proposition}\label{phase7_dependent_proof}
+ For all $x$ we have $x = x$.
+\end{proposition}
+\begin{proof}
+ Fix $x$.
+ Show $x = x$.
+ \begin{subproof}
+ Follows by assumption.
+ \end{subproof}
+ Follows by assumption.
+\end{proof}
diff --git a/test/phase7/diamond-base.tex b/test/phase7/diamond-base.tex
new file mode 100644
index 0000000..5814596
--- /dev/null
+++ b/test/phase7/diamond-base.tex
@@ -0,0 +1,3 @@
+\begin{proposition}\label{phase7_diamond_base}
+ For all $x$ we have $x = x$.
+\end{proposition}
diff --git a/test/phase7/diamond-left.tex b/test/phase7/diamond-left.tex
new file mode 100644
index 0000000..863b0fe
--- /dev/null
+++ b/test/phase7/diamond-left.tex
@@ -0,0 +1,5 @@
+\import{test/phase7/diamond-base.tex}
+
+\begin{proposition}\label{phase7_diamond_left}
+ For all $x$ we have $x = x$.
+\end{proposition}
diff --git a/test/phase7/diamond-right.tex b/test/phase7/diamond-right.tex
new file mode 100644
index 0000000..0a6a955
--- /dev/null
+++ b/test/phase7/diamond-right.tex
@@ -0,0 +1,5 @@
+\import{test/phase7/diamond-base.tex}
+
+\begin{proposition}\label{phase7_diamond_right}
+ For all $x$ we have $x = x$.
+\end{proposition}
diff --git a/test/phase7/diamond-root.tex b/test/phase7/diamond-root.tex
new file mode 100644
index 0000000..523102a
--- /dev/null
+++ b/test/phase7/diamond-root.tex
@@ -0,0 +1,6 @@
+\import{test/phase7/diamond-left.tex}
+\import{test/phase7/diamond-right.tex}
+
+\begin{proposition}\label{phase7_diamond_root}
+ For all $x$ we have $x = x$.
+\end{proposition}
diff --git a/test/phase7/structure-obligation-batch.tex b/test/phase7/structure-obligation-batch.tex
new file mode 100644
index 0000000..c71d6cd
--- /dev/null
+++ b/test/phase7/structure-obligation-batch.tex
@@ -0,0 +1,16 @@
+\begin{axiom}\label{phase7_batch_prefix}
+ $\emptyset = \emptyset$.
+\end{axiom}
+
+\begin{struct}\label{phase7_batch_structure}
+ A phase seven batch structure $X$ is a onesorted structure equipped with
+ \begin{enumerate}
+ \item $\phaseSevenPick$
+ \end{enumerate}
+ such that
+ \begin{enumerate}
+ \item\label{phase7_batch_first} $X = X$.
+ \item\label{phase7_batch_second}
+ $\phaseSevenPick[X] = \phaseSevenPick[X]$.
+ \end{enumerate}
+\end{struct}