Skip to content

Commit

Permalink
drop unused argument of recursion program
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanzwicknagl committed Apr 7, 2023
1 parent bc4c9df commit ac77654
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions backend/src/viasp/asp/recursion.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ def main(self):
while self.atoms != []:
control.ground([("iter", [Number(step)])], context=self)
self.atoms = [ x.symbol.arguments[1] for x in
control.symbolic_atoms.by_signature(self.conflict_free_h, 4)
if x.is_fact and x.symbol.arguments[3].number == step
control.symbolic_atoms.by_signature(self.conflict_free_h, 3)
if x.is_fact and x.symbol.arguments[0].number == step
]
step += 1

for x in control.symbolic_atoms.by_signature(self.conflict_free_h, 4):
for x in control.symbolic_atoms.by_signature(self.conflict_free_h, 3):
self.register_h_symbols(x.symbol)


Expand All @@ -61,9 +61,9 @@ def get_recursion_subgraph(facts: frozenset, supernode_symbols: frozenset,
model_str:str = get_conflict_free_model()
n_str:str = get_conflict_free_iterindex()
for i,rule in enumerate(transformation.rules):
tupleified = ",".join(list(map(str,rule.body)))
justification_head = f"{conflict_free_h}({i+1}, {rule.head}, ({tupleified}), {n_str})"
# TODO: get reasons by transformer
tupleified = ",".join(list(map(str,rule.body)))
justification_head = f"{conflict_free_h}({n_str}, {rule.head}, ({tupleified}))"
justification_body = ",".join(f"{model_str}({atom})" for atom in rule.body)
justification_body += f", not {model_str}({rule.head})"

Expand Down Expand Up @@ -108,7 +108,7 @@ def collect_h_symbols_and_create_nodes(h_symbols: Collection[Symbol], supernode_
tmp_reason: Dict[int, Dict[Symbol, List[Symbol]]] = defaultdict(dict)

for sym in h_symbols:
_, symbol, reasons, iter_nr = sym.arguments
iter_nr, symbol, reasons = sym.arguments
tmp_symbol[iter_nr.number].append(symbol)
tmp_reason[iter_nr.number][str(symbol)] = reasons.arguments
for iter_nr in tmp_symbol.keys():
Expand Down

0 comments on commit ac77654

Please sign in to comment.