From 543ef3531ad4591dd6e6e3c88c8f734f983c875a Mon Sep 17 00:00:00 2001 From: aarne Date: Sun, 15 Jun 2008 21:36:41 +0000 Subject: documentation of commands; restriction options to generation --- src-3.0/PGF/Macros.hs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src-3.0/PGF') 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 -- cgit v1.2.3