Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save proofs #187

Merged
merged 10 commits into from
Nov 20, 2023
Merged

Save proofs #187

merged 10 commits into from
Nov 20, 2023

Conversation

SimonGuilloud
Copy link
Collaborator

Tool to export proofs of theorems to binary files and back.

SimonGuilloud and others added 10 commits November 9, 2023 01:51
 - Multiple theorems in one file.
 - Finish justification mappings.
 - Recreate theorems.
 - Optionally recompute theorems and cache, recompute but not cache, or use cache (sbt tasks?).
 - Evaluate.
… including some from the library with imports.

theorems get fully reconstructed. Now, integrate.
… Can now create a high level THM directly from a kernel theorem.

Left to do: Apply that to proof files. Options to run with cache, without cache without creating it and without cache and create it.
Need to detect changes in statements. POssibly, do hashconsing before storing
…whether serialization is activated to constructors? How to construct theorems in a good order?
…y successful. Running Recursion.scala (i.e. everything) takes around 19s instead of 24s
@SimonGuilloud
Copy link
Collaborator Author

  • Add ids to terms like for formulas
  • Add serialization of proofs. Theorems can be serialized to binary files and loaded back on later run.
  • On my machine, running everything up to Recursion.scala takes 19s instead of 24s.
  • Does no hash consing, but simple optimizations to proof size (remove consecutive rewrites, flatten subproofs)
  • Cleans up the distinction between fullName (with the whole path, should be unique) and name (just the last part, possibly duplicate across different files/domains).
  • Good completion of documentation in WithTheorems
  • checkProofs does not print proofs of more thant 100 steps now.
  • fixed an indexing bug in ShrinkProof.flattenProof
  • Suite of tests for serialization, export then load a collection of theorems.
  • Push suite of tests for Tableaux tactic that were missing.

@SimonGuilloud SimonGuilloud marked this pull request as ready for review November 15, 2023 23:05
@@ -30,6 +30,8 @@ abstract class Library extends lisa.prooflib.WithTheorems with lisa.prooflib.Pro

var last: Option[JUSTIFICATION] = None

var _withCache: Boolean = false
Copy link
Member

Choose a reason for hiding this comment

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

We should probably wrap this up in a settings interface. Eg: Settings.runWithCache(true) in the relevant file

Copy link
Member

Choose a reason for hiding this comment

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

Not in this PR necessarily, but going forward.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good idea, I'll do that somewhat soon, probably in the next PR

@@ -19,7 +19,7 @@ private[settheory] trait SetTheoryZAxioms extends SetTheoryDefinitions {
*
* `() |- (x = y) ⇔ ∀ z. z ∈ x ⇔ z ∈ y`
*/
final val extensionalityAxiom: this.AXIOM = Axiom("extensionalityAxiom", forall(z, in(z, x) <=> in(z, y)) <=> (x === y))
final val extensionalityAxiom: this.AXIOM = Axiom(forall(z, in(z, x) <=> in(z, y)) <=> (x === y))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
final val extensionalityAxiom: this.AXIOM = Axiom(forall(z, in(z, x) <=> in(z, y)) <=> (x === y))
final val extensionalityAxiom: AXIOM = Axiom(forall(z, in(z, x) <=> in(z, y)) <=> (x === y))

The type annotations in this file are slightly inconsistent, with just this one being different afaict

Copy link
Member

@sankalpgambhir sankalpgambhir left a comment

Choose a reason for hiding this comment

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

Looks great overall. Minor optional changes as above ^^

Thanks for adding tests and documentation for adjacent files as well.

inline def rightSubstIff: Byte = 26
inline def instSchema: Byte = 27
inline def scSubproof: Byte = 28
inline def sorry: Byte = 29
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it be better to have a toByte with pattern matching? That way we have pattern match exhaustivity checking?

@SimonGuilloud SimonGuilloud merged commit aef926b into epfl-lara:main Nov 20, 2023
1 check passed
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