Skip to content

LCF Rewrite - #276

Open
sankalpgambhir wants to merge 38 commits into
mainfrom
lcf-rw
Open

sankalpgambhir wants to merge 38 commits into
mainfrom
lcf-rw

Conversation

@sankalpgambhir

Copy link
Copy Markdown
Member

Significant rewrite:

  • Complete change of the kernel to the LCF style.
  • Corresponding simplification and updates to the frontend
  • incorporates the HOL import
  • several optimizations to tactics and the system at large

sankalpgambhir and others added 30 commits November 6, 2026 16:34
* Prove Leibniz property and non0empty function spaces

* Cleanup, prove, and draft bunch of things

* Possible fix for tautology

* Don't expose local vairables for helpers

* Fix MK_COMB type checks

* hand correctness proof

* Use correct IDs for constant defs

* Many fixes to debugging and alignment

* Allow treating substitution as an iterable

* Separate and specialize treatment of definitions from other steps

* Use correct implicits for HOLTheorem

* Simplify printing for args

* Add scaladoc for functional class

* Stop storing proofs in THMFromProof

* Add free FOL formulas to HOLSequent

* Add support for HOL polymorphic constants and types

* Cache HOLProofTypes

* Fixes to HOLSteps

* Add bool zero xor one proof

* Change One to holT in many places

* Handling of polymorphic constant import

* Correction to one step proof

* Add a theorem variant without concrete goal

* Remove excess print

* Add temporary heap dump and GC tracking

* Improve comment about possible goal

* Simplify Discharge

* Improve error reporting for RightRefl

* Change OutputManager to use Writer over StringWriter

* Make typechecking simpler and mroe relaxed towards extra assumptions

* Inline legal application check

* Correctly return hol definition for constants

* Add more debug info and move definition cleanup generically to `HOLSteps.Clean`

* Repair select axiom

* Add unique iddentifiers based on type

* Add hol proejct to build.sbt

* Add support for constants to clean, move type proofs

* Avoid using tree constructors when not needed

* Update gitignore

* add a tactic _INST_TYPE_RENAME that rename variable symbols to maintain invariants that variables ids are unique per types.

* Use renaming inst in import

* Finish exists and succ proofs

* Move mkTypedVar to transformers

* scalafixAll

* scalafmtAll

* Remove old hol-import dummy project

* scalafmtAll outside lisa-hol

* Add a dummy end to extractor suite for now

* Finish axiom proofs

* Auto refactoring

* Add unclean HOL step versions

* Add printer draft and config

* Correct nameless form def

* Remove `IsSort` and use newer `is` typeclass syntax

* Add simple SCProof benchmark

* Add backup error message to belogsToTheory

* Cleanup imports, add unchecked for warning

* Serialization rewrite

* Add ser tests, formatting

* Fix sorries (#259)

* Prove all sorry holes in the library.

* scalafix, scalafmt

* add tableau tests back, remove some prints, correct a step name in congruence tests.

* Add first lcf checker draft

* Add theory draft

* Remove SequentCalculus wrapper object

* Move unchanged collection and fol utils

* Add first draft of top-level implementations

* Add sourcecode dependency

* Move proof helpers to their own object

* Replicate kernel helpers at the front level

* Draft of Have variants and syntax

* Various small fixes to utils.fol

* Have K correctly export kernel objects

* Add subproof helpers

* Cleanup errors

* Add reporting helpers

* Add hyp and restate steps

* Clean up duplicated by-s

* Add and export an unwrapping sorry

* Add and duplicate some helpers from kernel-level

* Document proof carrier functions

* Rewrite theorem goal handling

* Make implicits clearer in by indirections

* Make Have variants handle proof context, instead of passing to steps

* refactor(utilcfs): complete basic steps

* feat(utilcfs): add tautology tactic

* Add theorem accessors

* Move Have to ProofHelpers

* Update named theorem handling

* Update theorem conversion handling

* Add proof assumptions and subproofs

* Add derived tactic entry points

* Add front theorem wrapper

* Adjust theorem side accessors

* Remove lifted expression wrapper

* Move front theorem under FOL

* Refine proof failure and subproof handling

* Add library definitions and output

* Restore unification helpers

* Port derived tactic modules

* Test simple derived tactics

* Restore tautology proof search

* Restore tableau proof search

* Restore congruence closure

* Test automation tactics

* Add subproof failure helpers

* Switch root build to LCF projects

Add the parallel set theory development and remove the legacy utils module from the active tree.

* Track and report front theorems

Preserve schema provenance so tactics distinguish reusable library facts from confined local proofs.

* Fix derived tactic proof construction

Handle weakened conclusions, conditional rewrite rules, repeated substitutions, and congruence premise discharge without introducing sorry steps.

* Switch constants to keep full names and print short ones

* Optimize OL equivalence checking

Use hashcons identity and allocation-light caches while avoiding repeated sort checks and temporary conjunctions on recursive paths.

* Stream tableau closing candidates

Preserve the established tie order without materializing intermediate candidate and normalized lists.

* Overwrite with lcf modules

* scalafmt

* Revert OLEqChecker to use Optioons over nulls

* Cleanup library API and doc

* Cleanup proof carrier documentation

* Add back registerDefinition

* Inline either maps

* Centralize axiom generation to the library

* Remove weird isSchema flag

* Move tableau tests to prooflib

* isSchema repairs

* Document #@@

* Prevent destroying assumption object data in Proof

* cleanup chained match

* Comment edit

* Cleanup derived tests + substitution

* Cleanup automation tests

* Reorder rewrite preference in UnifUtils

* Fix typecheck post isSchema removal

* Add tests for checking preserved scala classes through front

* Remove HOL from lisa-sets

* Fix HOL Basics wrt tactic changes

* Add updated HOL import

* Fix direct definition source locations

Capture sourcecode line and file values at declaration sites instead of accepting primitive fallbacks, and forward the TYPEDEF call-site context unchanged.

* First draft of a linear checker

* Draft assume/discharge

* Centralize `asFront` to `lift`

* Remove stub map API

* Add checks for thm statement matching proof

* LinearProof complete draft

* Fix contextual theory mismatch, add generated tests

* Remove kernel helper references in front

* Repair propext proof

* Add a test for HOL step preserving type information

* Rewrite typecheck and infer in a monadic style

* Preserve front class data more carefully in basicstep

* Cleanup tableau

* Remove tautology reference to KHelpers

* Track preservation of class data through param inference

* Remove unused OL API and make most things in the checker private

* Add type defs skeleton

* Cleanup printing of front theorems and errors

* Enlarge set of taken names for substitution to include current term

* Make typedvar use full names

* Revert typedvar name change

* Treat polymorphic type non-emptiness correctly

* Clean up hol type def proofs for use in import

* Minimize eta proof

* Add eq and codomain helper theorems

* Change underscore to not be a forbidden char

* Fix universe theorems

* Reduce tautology use in typecheck, memoize

* Clarify theorem construction

* Restore linear proof serialization

* Add Horn proof automation

* Minimize HOL step reconstruction

* Read sparse HOL traces lazily

* Complete HOL import reconstruction

* Bound composite hashcons caches

* perf(types): replace proof search with cuts

* test(hol): add import benchmark runners

* perf(types): reuse matching typing proofs

* perf(hol): buffer trace reads

* perf(hol): share reconstructed import steps

* perf(hol): report reconstruction throughput

* perf(fol): hash expressions by canonical IDs

Default to hybrid caching so IDs survive tree eviction.
Retain structural equality fallback and compatible hashes in
noncanonical modes.

* perf(kernel): cache simple expression hashes

* refactor(proofs): add theorem accessors

* fix(proofs): keep bare restatement primitive

Delegate bare Restate to RestateTrue, not Tautology. Repair proofs that
relied on propositional search or dropped typing assumptions, and
check registered library proofs for errors.

* perf(hol): parse traces with FastParse

* fix(hol): accept equivalent instantiation types

Allow renamed binders in equivalent function types. Keep rejecting
incompatible types, and attach trace IDs to fatal reconstruction errors.
This fixes sum_RECURSION at export offset 530.

* perf(hol): verify step targets only in debug

Remove the verifyEachStep argument and LISA_HOL_VERIFY_STEPS override.
Use --debug for intermediate statement checks. Named theorem targets
remain checked in every mode.

* feat(hol): report reconstruction resource costs

Report per-theorem CPU, allocation, GC, and step-cache reuse. Enable
exclusive per-rule CSV costs only when a fresh output path is supplied.

* feat(hol): sort exported trace files

* Strengthen existing definition check

* Preserve identical trees in substitution

* Add `hasFree` to cheaply check free variables in a seq

* Compute imports only once for checker

* Reuse HOL type substitutions

* Add preservation checks for linear checker and proof carrier

* Line ending regression tests for trace reader

* Simplify and extract app/fun typing tactics

* Rewrite Example to compile

* Add app/lambda reuse

* Updated lazy extractor and smaller optimizations

* Simplify INST TYPE renaming

* Test lazy trace extraction

* Test HOL translation invariants

* Use kernel membership in HOL cleanup

* Reuse HOL subterm typings

* Release HOL typing caches after imports

* Report reader and typing cache statistics

* Profile HOL step allocation and size

* Add bounded cache utilities

* Bound HOL step retention

* Reuse bounded HOL conversions

* Share immutable proof dependencies

* Reuse HOL equality transport

* Reuse carriers without new errors

* Cache HOL type hashes

* Shortcut exact sequent weakening

* Simplify import cleanup

* Test kernel definitions and normalization

* Test frontend expression operations

* Test proof discharge

* Cache underlying kernel sequents

* Reuse typing proofs in HOL instantiation

* Defer default expression printers

* Shortcut exact proof contexts

* Reuse kernel support when freshening binders

* Normalize terms and flags together

Compute normal forms and normality together, retaining application nodes
when their children are unchanged. Reduce eta redexes exposed by
normalizing abstraction bodies.

* Reduce default hashcons capacity

* Preserve typing annotation positions

* Inline OL node reuse helpers

* Update Scala and sbt versions

* Flatten OL connectives during polarization

* Shortcut exact sequent checks

* Delegate sort-name printing to K.Identifier

* Print HOL theorems in first-order notation

* Translate HOL theorems to first-order logic

* Remove redundant library sources

* Move congruence tests to utils

* Centralize HOL import configuration

* Precompute shared HOL lemmas

* Track HOL reconstruction replay

* Remove automatic import heap dumps

* Enable and time HOL lemma preprocessing

* Remove obsolete sources and source filters

* Test LCF reconstruction and serialization

* Ignore local experiment outputs

* Preserve alpha-invariant simple-form equality

* Retain incoming automation dependencies

* Read serialized trees through end of stream

* Flatten external proof certificates

* Reconstruct automation with linear certificates

* Remove SC-only cache tests

The LCF frontend has no disk-cache API. Keep reconstruction coverage
through the external linear checker instead.

* scala{fix,fmt}

* Update examples

* Update plugins

* scala{fix,fmt}

---------

Co-authored-by: Simon Guilloud <simon.guilloud@bluewin.ch>
Co-authored-by: SimonGuilloud <simon.guilloud@epfl.ch>
and carrier handling. Move automation files out of lisa.utils.prooflib
to lisa.utils.automation. Some other fixes to behaviour from the main
branch that had been lost in the lcf rewrite.
* add support for producing sc-tptp proofs. Required simplifying or adding options so that the proof reconstruction avoids orthologic steps.

* add complete sctptp export, with command line option

* update sctptp version

* correct warnings about catching throwable in the superposition benchmarks

@SimonGuilloud SimonGuilloud left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not an in-depth review

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this file removed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this file removed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this file removed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this file removed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this file removed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this file removed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure everything that is here should go here.
We have in many place the import import lisa.automation.{ProofSyntax => K} which doesn't make much sense to me (K is for kernel, not for the front). There also is mostly kernel stuff, not really proof syntax, and it probably should go in the utils

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these examples ADT maybe deserve being removed redone as part of the actual library, but not urgent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants