forked from GitHub/gf-core
bugfix in the lProlog generator
This commit is contained in:
@@ -61,14 +61,11 @@ ppClause abstr d i scope f ty@(DTyp hyps cat args)
|
|||||||
then hsep (map (\v -> text "pi" <+> ppCId v <+> char '\\') vars)
|
then hsep (map (\v -> text "pi" <+> ppCId v <+> char '\\') vars)
|
||||||
else empty
|
else empty
|
||||||
(goals,i'',head) = ppRes i' scope' cat (res : args)
|
(goals,i'',head) = ppRes i' scope' cat (res : args)
|
||||||
in (i'',(if null goals
|
docs = map (ppExpr 0 i'' scope') goals ++ hdocs
|
||||||
then empty
|
in (i'',ppParens (d > 0) (quants <+> head <+>
|
||||||
else hsep (punctuate comma (map (ppExpr 0 i'' scope') goals)) <> comma)
|
(if null docs
|
||||||
<+>
|
|
||||||
(ppParens (d > 0) (quants <+> head <+>
|
|
||||||
(if null hdocs
|
|
||||||
then empty
|
then empty
|
||||||
else text ":-" <+> hsep (punctuate comma hdocs)))))
|
else text ":-" <+> hsep (punctuate comma docs))))
|
||||||
where
|
where
|
||||||
ppRes i scope cat es =
|
ppRes i scope cat es =
|
||||||
let ((goals,i'),es') = mapAccumL (\(goals,i) e -> let (goals',i',e') = expr2goal abstr scope goals i e []
|
let ((goals,i'),es') = mapAccumL (\(goals,i) e -> let (goals',i',e') = expr2goal abstr scope goals i e []
|
||||||
|
|||||||
Reference in New Issue
Block a user