mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-30 14:52:51 -06:00
now for every category we store, in PGF, the list of functions for it in source-code order. The order matters for the termination of the exhaustive generation with dependent types.
This commit is contained in:
@@ -12,7 +12,7 @@ import Debug.Trace
|
||||
grammar2lambdaprolog_mod pgf = render $
|
||||
text "module" <+> ppCId (absname pgf) <> char '.' $$
|
||||
space $$
|
||||
vcat [ppClauses cat fns | (cat,fs) <- Map.toList (catfuns (abstract pgf)),
|
||||
vcat [ppClauses cat fns | (cat,(_,fs)) <- Map.toList (cats (abstract pgf)),
|
||||
let fns = [(f,fromJust (Map.lookup f (funs (abstract pgf)))) | f <- fs]]
|
||||
where
|
||||
ppClauses cat fns =
|
||||
@@ -23,11 +23,11 @@ grammar2lambdaprolog_mod pgf = render $
|
||||
grammar2lambdaprolog_sig pgf = render $
|
||||
text "sig" <+> ppCId (absname pgf) <> char '.' $$
|
||||
space $$
|
||||
vcat [ppCat c hyps <> dot | (c,hyps) <- Map.toList (cats (abstract pgf))] $$
|
||||
vcat [ppCat c hyps <> dot | (c,(hyps,_)) <- Map.toList (cats (abstract pgf))] $$
|
||||
space $$
|
||||
vcat [ppFun f ty <> dot | (f,(ty,_,_)) <- Map.toList (funs (abstract pgf))] $$
|
||||
space $$
|
||||
vcat [ppExport c hyps <> dot | (c,hyps) <- Map.toList (cats (abstract pgf))]
|
||||
vcat [ppExport c hyps <> dot | (c,(hyps,_)) <- Map.toList (cats (abstract pgf))]
|
||||
|
||||
ppCat :: CId -> [Hypo] -> Doc
|
||||
ppCat c hyps = text "kind" <+> ppKind c <+> text "type"
|
||||
|
||||
Reference in New Issue
Block a user