Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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