diff options
| author | aarne <aarne@cs.chalmers.se> | 2008-06-15 21:36:41 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2008-06-15 21:36:41 +0000 |
| commit | 543ef3531ad4591dd6e6e3c88c8f734f983c875a (patch) | |
| tree | 0d0336824d97f0a601c0fdabe57eda9613992d1e /src-3.0/PGF | |
| parent | ee4db2ee7dc06b31584a8b3eec73e6ff98e516fb (diff) | |
documentation of commands; restriction options to generation
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 |
