From a29a8e4f60960122874c737d32e9d41a3575208b Mon Sep 17 00:00:00 2001 From: krasimir Date: Sun, 20 Sep 2009 10:28:27 +0000 Subject: rename MetaSymb in GF.Grammar.Grammar to MetaId to match the convention in PGF --- src/GF/Grammar/Macros.hs | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) (limited to 'src/GF/Grammar/Macros.hs') diff --git a/src/GF/Grammar/Macros.hs b/src/GF/Grammar/Macros.hs index 72f0eb10a..84a217b26 100644 --- a/src/GF/Grammar/Macros.hs +++ b/src/GF/Grammar/Macros.hs @@ -364,49 +364,6 @@ justIdentOf (Vr x) = Just x justIdentOf (Cn x) = Just x justIdentOf _ = Nothing -isMeta :: Term -> Bool -isMeta (Meta _) = True -isMeta _ = False - -mkMeta :: Int -> Term -mkMeta = Meta . MetaSymb - -nextMeta :: MetaSymb -> MetaSymb -nextMeta = int2meta . succ . metaSymbInt - -int2meta :: Int -> MetaSymb -int2meta = MetaSymb - -metaSymbInt :: MetaSymb -> Int -metaSymbInt (MetaSymb k) = k - -freshMeta :: [MetaSymb] -> MetaSymb -freshMeta ms = MetaSymb (minimum [n | n <- [0..length ms], - notElem n (map metaSymbInt ms)]) - -mkFreshMetasInTrm :: [MetaSymb] -> Term -> Term -mkFreshMetasInTrm metas = fst . rms minMeta where - rms meta trm = case trm of - Meta m -> (Meta (MetaSymb meta), meta + 1) - App f a -> let (f',msf) = rms meta f - (a',msa) = rms msf a - in (App f' a', msa) - Prod x a b -> - let (a',msa) = rms meta a - (b',msb) = rms msa b - in (Prod x a' b', msb) - Abs x b -> let (b',msb) = rms meta b in (Abs x b', msb) - _ -> (trm,meta) - minMeta = if null metas then 0 else (maximum (map metaSymbInt metas) + 1) - --- | decides that a term has no metavariables -isCompleteTerm :: Term -> Bool -isCompleteTerm t = case t of - Meta _ -> False - Abs _ b -> isCompleteTerm b - App f a -> isCompleteTerm f && isCompleteTerm a - _ -> True - linTypeStr :: Type linTypeStr = mkRecType linLabel [typeStr] -- default lintype {s :: Str} @@ -696,9 +653,6 @@ noExist = FV [] defaultLinType :: Type defaultLinType = mkRecType linLabel [typeStr] -metaTerms :: [Term] -metaTerms = map (Meta . MetaSymb) [0..] - -- | from GF1, 20\/9\/2003 isInOneType :: Type -> Bool isInOneType t = case t of -- cgit v1.2.3