Skip to content

Instantly share code, notes, and snippets.

@thosakwe
Created October 24, 2018 19:15
Show Gist options
  • Save thosakwe/e8f89c1ca6ef3b998a89908a627aa238 to your computer and use it in GitHub Desktop.
Save thosakwe/e8f89c1ca6ef3b998a89908a627aa238 to your computer and use it in GitHub Desktop.
Proof-based language
property transitive {
let r(a) : Relation on a.
let x, y, z : in r.
assume (x, y) in r.
assume (y, z) in r.
declare (x, z) in r.
}
law DeMorgan {
let a : Bool.
let b : Bool.
declare ~(a | b) == (~a & ~b).
}
proof main proves ~(x | y) {
val x = True.
val y = True.
val z = print(~(x | y)).
}
property symmetric {
let r(a) : Relation on a.
declare every a, b[
if (a, b) in r
then (b, a) in r
].
}
// Proofs can be anonymous.
proof proves if (a, b) in r then (a, b) in r^-1 {
let r(a): Relation on a.
let a, b : in r.
assume (a, b) in r.
(b, a) in r.
(a, b) in r^-1.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment