diff --git a/backend/src/viasp/asp/reify.py b/backend/src/viasp/asp/reify.py index f4a6820c..b5613ffc 100644 --- a/backend/src/viasp/asp/reify.py +++ b/backend/src/viasp/asp/reify.py @@ -313,14 +313,22 @@ def get_body_aggregate_elements(self, body: Sequence[AST]) -> List[AST]: def visit_ShowTerm(self, showTerm: AST): if (hasattr(showTerm, "location") and isinstance(showTerm.location, ast.Location) and hasattr(showTerm, "term") and isinstance(showTerm.term, AST) + and hasattr(showTerm.term, "symbol") and isinstance(showTerm.term.symbol, clingo.symbol.Symbol) + and hasattr(showTerm.term.symbol, "name") and isinstance(showTerm.term.symbol.name, str) + and hasattr(showTerm.term.symbol, "arguments") and isinstance(showTerm.term.symbol.arguments, Sequence) and hasattr(showTerm, "body") and isinstance(showTerm.body, Sequence) and all(isinstance(elem, AST) for elem in showTerm.body)): new_head = ast.Literal( showTerm.location, ast.Sign.NoSign, ast.SymbolicAtom( - showTerm.term - ) + ast.Function( + showTerm.location, + showTerm.term.symbol.name, + cast(Sequence, showTerm.term.symbol.arguments), + 0 + ) + ) ) self.visit( ast.Rule(