From 7db4b641ce6abe90dd404459cd5eccb6e67f618c Mon Sep 17 00:00:00 2001 From: krasimir Date: Wed, 20 May 2009 21:03:56 +0000 Subject: refactor the PGF.Expr type and the evaluation of abstract expressions --- src/PGF/Macros.hs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/PGF/Macros.hs') diff --git a/src/PGF/Macros.hs b/src/PGF/Macros.hs index 22b96df92..462fa9cba 100644 --- a/src/PGF/Macros.hs +++ b/src/PGF/Macros.hs @@ -37,14 +37,15 @@ lookType :: PGF -> CId -> Type lookType pgf f = fst $ lookMap (error $ "lookType " ++ show f) f (funs (abstract pgf)) -lookDef :: PGF -> CId -> Expr +lookDef :: PGF -> CId -> [Equation] lookDef pgf f = snd $ lookMap (error $ "lookDef " ++ show f) f (funs (abstract pgf)) isData :: PGF -> CId -> Bool -isData pgf f = case Map.lookup f (funs (abstract pgf)) of - Just (_,EMeta 0) -> True ---- the encoding of data constrs - _ -> False +isData pgf f = + case Map.lookup f (funs (abstract pgf)) of + Just (_,[]) -> True -- the encoding of data constrs + _ -> False lookValCat :: PGF -> CId -> CId lookValCat pgf = valCat . lookType pgf @@ -120,9 +121,6 @@ contextLength :: Type -> Int contextLength ty = case ty of DTyp hyps _ _ -> length hyps -primNotion :: Expr -primNotion = EEq [] - term0 :: CId -> Term term0 = TM . prCId -- cgit v1.2.3