Skip to content

Commit

Permalink
Merge pull request #45 from potassco/BUG_All-Ast-#40
Browse files Browse the repository at this point in the history
BUG_All-Ast-#40
  • Loading branch information
stephanzwicknagl committed Dec 21, 2023
2 parents 859be37 + ff5af65 commit 7873516
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions backend/src/viasp/asp/reify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 7873516

Please sign in to comment.