diff options
Diffstat (limited to 'src-3.0/PGF')
| -rw-r--r-- | src-3.0/PGF/Macros.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src-3.0/PGF/Macros.hs b/src-3.0/PGF/Macros.hs index 86b644813..baa0fc355 100644 --- a/src-3.0/PGF/Macros.hs +++ b/src-3.0/PGF/Macros.hs @@ -68,6 +68,25 @@ functionsToCat pgf cat = where fs = lookMap [] cat $ catfuns $ abstract pgf +missingLins :: PGF -> CId -> [CId] +missingLins pgf lang = [c | c <- fs, not (hasl c)] where + fs = Map.keys $ funs $ abstract pgf + hasl = hasLin pgf lang + +hasLin :: PGF -> CId -> CId -> Bool +hasLin pgf lang f = Map.member f $ lins $ lookConcr pgf lang + +restrictPGF :: (CId -> Bool) -> PGF -> PGF +restrictPGF cond pgf = pgf { + abstract = abstr { + funs = restrict $ funs $ abstr, + cats = restrict $ cats $ abstr + } + } ---- restrict concrs also, might be needed + where + restrict = Map.filterWithKey (\c _ -> cond c) + abstr = abstract pgf + depth :: Exp -> Int depth (EAbs _ t) = depth t depth (EApp _ ts) = maximum (0:map depth ts) + 1 |
