diff options
| author | krasimir <krasimir@chalmers.se> | 2009-05-20 21:03:56 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2009-05-20 21:03:56 +0000 |
| commit | 7db4b641ce6abe90dd404459cd5eccb6e67f618c (patch) | |
| tree | f708d2e7ed970d71655b66cac78c8b525b010cd9 /src/PGF/Macros.hs | |
| parent | 401dfc28d62584178c1187c92dece8dd0832dcb4 (diff) | |
refactor the PGF.Expr type and the evaluation of abstract expressions
Diffstat (limited to 'src/PGF/Macros.hs')
| -rw-r--r-- | src/PGF/Macros.hs | 12 |
1 files changed, 5 insertions, 7 deletions
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 |
