mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-14 05:32:51 -06:00
some work on evaluation with abstract expressions in PGF
This commit is contained in:
@@ -71,16 +71,16 @@ plCat (cat, hypos) = plFact "cat" (plTypeWithHypos typ)
|
||||
args = reverse [EVar x | (_,x) <- subst]
|
||||
typ = wildcardUnusedVars $ DTyp hypos' cat args
|
||||
|
||||
plFun :: (CId, (Type, [Equation])) -> String
|
||||
plFun (fun, (typ, _)) = plFact "fun" (plp fun : plTypeWithHypos typ')
|
||||
plFun :: (CId, (Type, Int, [Equation])) -> String
|
||||
plFun (fun, (typ,_,_)) = plFact "fun" (plp fun : plTypeWithHypos typ')
|
||||
where typ' = wildcardUnusedVars $ snd $ alphaConvert emptyEnv typ
|
||||
|
||||
plTypeWithHypos :: Type -> [String]
|
||||
plTypeWithHypos (DTyp hypos cat args) = [plTerm (plp cat) (map plp args), plp hypos]
|
||||
|
||||
plFundef :: (CId, (Type, [Equation])) -> [String]
|
||||
plFundef (fun, (_, [])) = []
|
||||
plFundef (fun, (_, eqs)) = [plFact "def" [plp fun, plp fundef']]
|
||||
plFundef :: (CId, (Type,Int,[Equation])) -> [String]
|
||||
plFundef (fun, (_,_,[])) = []
|
||||
plFundef (fun, (_,_,eqs)) = [plFact "def" [plp fun, plp fundef']]
|
||||
where fundef' = snd $ alphaConvert emptyEnv eqs
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user