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

Orders on Ordinals #210

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change List

## 2024-02-20
Added extension for notations `._1` and `._2` for `firstInPair(_)` and `secondInPair(_)`.

Added `assumeAll` keyword to deconstruct the LHS of the goal and assume all discovered formulas.

## 2024-02-05
The "draft()" option can now be used at the start of a file to skip checking proofs of theorem outside this file during development.

Expand Down
14 changes: 14 additions & 0 deletions lisa-sets/src/main/scala/lisa/automation/CommonTactics.scala
Original file line number Diff line number Diff line change
Expand Up @@ -261,4 +261,18 @@ object CommonTactics {
}
}

/**
* Assume every formula on the LHS of the goal sequent, deconstructing
* conjunctions.
*/
def assumeAll(using lib: Library, proof: lib.Proof) =
def deconstruct(f: F.Formula): Seq[F.Formula] =
f match
case F.AppliedConnector(F.And, fs) => fs.flatMap(deconstruct)
case _ => Seq(f)

val lhs = proof.possibleGoal.get.left.toSeq
val assumptions = lhs.flatMap(deconstruct).toSeq diff proof.getAssumptions

lib.assume(using proof)(assumptions: _*)
}
Loading
Loading