Skip to content
Snippets Groups Projects
Commit 5a6ac7f4 authored by Etienne Kneuss's avatar Etienne Kneuss
Browse files

Annotate proof DSL as @library

parent 7521bb50
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,10 @@
package leon.proof
import leon.lang._
import leon.annotation._
/** Internal helper classes and methods for the 'proof' package. */
@library
object Internal {
/*** Helper classes for relational reasoning ***/
......
......@@ -9,6 +9,7 @@ import leon.proof.Internal._
package object proof {
@library
case class ProofOps(prop: Boolean) {
def because(proof: Boolean): Boolean = proof && prop
def neverHolds: Boolean = {
......@@ -17,13 +18,17 @@ package object proof {
}
}
@library
implicit def boolean2ProofOps(prop: Boolean): ProofOps = ProofOps(prop)
@library
def trivial: Boolean = true
@library
def by(proof: Boolean)(prop: Boolean): Boolean =
proof && prop
@library
def check(prop: Boolean): Boolean = {
require(prop)
prop
......@@ -39,6 +44,7 @@ package object proof {
* x
* }.qed
*/
@library
case class RelReasoning[A](x: A, prop: Boolean) {
def ^^[B](r: (A, B) => Boolean): WithRel[A, B] = WithRel(x, r, prop)
......@@ -52,6 +58,7 @@ package object proof {
def qed: Boolean = prop
}
@library
implicit def any2RelReasoning[A](x: A): RelReasoning[A] =
RelReasoning(x, true)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment