1
0
forked from GitHub/gf-core

fixed the over-expansion of record variants in PGF.Linearize

This commit is contained in:
aarne
2008-10-03 07:57:40 +00:00
parent 07b3870699
commit 759ee4f926

View File

@@ -67,9 +67,18 @@ linTree pgf lang = lin
lin (Var x) = TM (prCId x)
lin (Meta i) = TM (show i)
comp = compute pgf lang
comp ls t = variants [compute pgf lang ts t | ts <- combinations (map unvariants ls)]
look = lookLin pgf lang
variants :: [Term] -> Term
variants ts = case ts of
[t] -> t
_ -> FV ts
unvariants :: Term -> [Term]
unvariants t = case t of
FV ts -> ts
_ -> [t]
compute :: PGF -> CId -> [Term] -> Term -> Term
compute pgf lang args = comp where