Sigma. Exp1 ::= [PTele] "*" Exp1 ;
App. Exp2 ::= Exp2 Exp3 ;
Var. Exp3 ::= AIdent ;
-AppFormula. Exp3 ::= Exp3 "@" Name ;
+AppFormula. Exp3 ::= Exp3 "@" Formula ;
U. Exp3 ::= "U" ;
Fst. Exp3 ::= Exp3 ".1" ;
Snd. Exp3 ::= Exp3 ".2" ;
Pair. Exp3 ::= "(" Exp "," Exp ")" ;
coercions Exp 3 ;
+
+Conj. Formula ::= Formula "|" Formula1 ;
+Disj. Formula1 ::= Formula1 "&" Formula2 ;
+Neg. Formula2 ::= "-" Formula2 ;
+Atom. Formula2 ::= Name ;
+coercions Formula 2 ;
+
+
-- Branches
Branch. Branch ::= AIdent [AIdent] "->" ExpWhere ;
separator Branch ";" ;
(rdecls,names) <- resolveDecls decls
CTT.mkWheres rdecls <$> local (insertBinders names) (resolveExp e)
Path i e -> CTT.Path <$> resolveName i <*> resolveExp e
- AppFormula e n -> CTT.AppFormula <$> resolveExp e <*> (C.Atom <$> resolveName n)
+ AppFormula e phi -> CTT.AppFormula <$> resolveExp e <*> resolveFormula phi
resolveWhere :: ExpWhere -> Resolver Ter
resolveWhere = resolveExp . unWhere
+resolveFormula :: Formula -> Resolver C.Formula
+resolveFormula (Atom i) = C.Atom <$> resolveName i
+resolveFormula (Neg phi) = C.negFormula <$> resolveFormula phi
+resolveFormula (Conj phi psi) = C.andFormula <$> resolveFormula phi
+ <*> resolveFormula psi
+resolveFormula (Disj phi psi) = C.orFormula <$> resolveFormula phi
+ <*> resolveFormula psi
+
+
resolveBranch :: Branch -> Resolver (CTT.Label,([CTT.Binder],Ter))
resolveBranch (Branch (AIdent (_,lbl)) args e) = do
binders <- mapM resolveAIdent args
where
rem : (n : nat) -> Id nat (idnat n) n = split
zero -> refl nat zero
- suc n -> mapOnPath nat nat (\(x : nat) -> suc x) (idnat n) n (rem n)
\ No newline at end of file
+ suc n -> mapOnPath nat nat (\(x : nat) -> suc x) (idnat n) n (rem n)
+
+-- subst (A : U) (P : A -> U) (a b : A) (p : Id A a b) (e : P a) : P b =
+-- transport (mapOnPath A U P a b p) e
+
+singl (A : U) (a : A) : U = (x : A) * Id A a x
+
+contrSingl (A : U) (a b : A) (p : Id A a b) :
+ Id (singl A a) (a,refl A a) (b,p) = <?0> (p @ ?0,<?1> p @ ?0 & ?1)
\ No newline at end of file