| Split Ident Loc Ter [Branch]
-- labelled sum c1 A1s,..., cn Ans (assumes terms are constructors)
| Sum Loc Ident [Label]
- -- undefined
+
+ -- undefined and holes
| Undef Loc Ter -- Location and type
+ | Hole
-- Id type
| IdP Ter Ter Ter
Split f _ _ _ -> text f
Sum _ n _ -> text n
Undef _ _ -> text "undefined"
+ Hole -> text "?"
IdP e0 e1 e2 -> text "IdP" <+> showTers [e0,e1,e2]
Path i e -> char '<' <> text (show i) <> char '>' <+> showTer e
AppFormula e phi -> showTer1 e <+> char '@' <+> showFormula phi
showTer1 t = case t of
U -> char 'U'
Con c [] -> text c
- Var x -> text x
+ Var{} -> showTer t
+ Undef{} -> showTer t
+ Hole -> showTer t
Split{} -> showTer t
Sum{} -> showTer t
_ -> parens (showTer t)
VU -> char 'U'
VCon c [] -> text c
VVar{} -> showVal v
+ VUndef{} -> showVal v
Ter t@Sum{} rho -> showTer t <+> showEnv rho
_ -> parens (showVal v)
Var. Exp5 ::= AIdent ;
PCon. Exp5 ::= AIdent "{" Exp "}" ; -- c{T A B} x1 x2 @ phi
U. Exp5 ::= "U" ;
+Hole. Exp5 ::= "?" ;
coercions Exp 5 ;
separator nonempty Exp "," ;
resolveExp :: Exp -> Resolver Ter
resolveExp e = case e of
U -> return CTT.U
+ Hole -> return CTT.Hole
Var x -> resolveVar x
App t s -> resolveApps x xs
where (x,xs) = unApps t [s]
(u0,u1) <- checkPath p t\r
k <- asks index\r
unless (conv k a0 u0 && conv k a1 u1) $\r
- throwError $ "path endpoints don't match " ++ show e\r
+ throwError $ "path endpoints don't match for " ++ show e ++ ", got " ++\r
+ show (u0,u1) ++ ", but expected " ++ show (a0,a1)\r
(VU,Glue a ts) -> do\r
check VU a\r
rho <- asks env\r
check va u\r
vu <- evalTyping u\r
checkGlueElem vu ts us\r
+ (_,Hole) -> do\r
+ trace $ "Hole expects: " ++ show a\r
+ return ()\r
_ -> do\r
v <- infer t\r
unlessM (v === a) $\r