summaryrefslogtreecommitdiff
path: root/src/Data/Term.idr
diff options
context:
space:
mode:
authorGreg Brown <greg.brown01@ed.ac.uk>2023-07-12 14:02:42 +0100
committerGreg Brown <greg.brown01@ed.ac.uk>2023-07-12 14:02:42 +0100
commitfd658831ab53f07969524fee0257d086d6f79f5a (patch)
treeb1861aa0f726f35a40ec0f5c0809a845b39c4361 /src/Data/Term.idr
parent66658a7102c5761fe6e4cfc5058f2fdafaa71b36 (diff)
Prove unification correct.
Diffstat (limited to 'src/Data/Term.idr')
-rw-r--r--src/Data/Term.idr13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Data/Term.idr b/src/Data/Term.idr
index ebb7b00..b65859e 100644
--- a/src/Data/Term.idr
+++ b/src/Data/Term.idr
@@ -1,7 +1,8 @@
module Data.Term
-import public Data.Vect
+import public Data.DPair
import public Data.Fin.Strong
+import public Data.Vect
import Data.Vect.Properties.Map
import Syntax.PreorderReasoning
@@ -16,6 +17,10 @@ record Signature where
%name Signature sig
public export
+(.Op) : Signature -> Type
+sig .Op = Exists sig.Operator
+
+public export
data Term : Signature -> Nat -> Type where
Var : SFin (S n) -> Term sig (S n)
Op : sig.Operator k -> Vect k (Term sig n) -> Term sig n
@@ -99,6 +104,12 @@ opInjectiveLen : (prf : Op {k} op ts = Op {k = n} op' us) -> k = n
opInjectiveLen Refl = Refl
export
+opInjectiveOp :
+ (prf : Op {sig, k} op ts = Op {sig, k = n} op' us) ->
+ the sig.Op (Evidence k op) = Evidence n op'
+opInjectiveOp Refl = Refl
+
+export
opInjectiveTs' : {0 ts, us : Vect k (Term sig n)} -> (prf : Op op ts = Op op us) -> ts = us
opInjectiveTs' Refl = Refl