Skip to content

Commit

Permalink
illustration of Prop (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuncak authored Feb 4, 2025
1 parent 3e326b5 commit c318359
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tutorials/inductive-witnesses/TransitiveClosure.scala
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,17 @@ object TransitiveClosure:
}.ensuring(proof => proof.x == x && proof.y == y)


final case class Prop(p: Boolean):
require(p)
val obvious = Prop(true)

def testProp = {
val x = 10
val y = 20
val p1 = Prop(x < y)
}
def testFunProp(x: BigInt): Prop = {
obvious
}.ensuring(_.p == (x < x + 1))

end TransitiveClosure

0 comments on commit c318359

Please sign in to comment.