Skip to content

Instantly share code, notes, and snippets.

@Eloitor
Last active January 4, 2020 22:43
Show Gist options
  • Select an option

  • Save Eloitor/1bcee595437791eab189f1461da4631b to your computer and use it in GitHub Desktop.

Select an option

Save Eloitor/1bcee595437791eab189f1461da4631b to your computer and use it in GitHub Desktop.
import Base#
T Integer
| integer(pos: Nat, neg: Nat)
IntEquality(x: Integer, y: Integer): Type
case x
+ y: Integer
|integer => case y
|integer => Equal(Nat, add(x.pos, y.neg), add(y.pos, x.neg))
IntRefelexive(x: Integer): IntEquality(x,x)
case x
+ y: Integer
| integer => equal(_ add(x.pos, x.neg);) // Here hole does not work ?
: IntEquality(x,x)
IntSymmetric(x: Integer, y: Integer, e: IntEquality(x,y)): IntEquality(y,x)
case x
+ y: Integer
+ e: IntEquality(x,y)
| integer => case y
| integer => mirror(Nat;add(x.pos, y.neg);add(y.pos, x.neg); e)
: IntEquality(y,integer(x.pos, x.neg))
main IntSymmetric
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment