Skip to content
This repository was archived by the owner on Apr 25, 2024. It is now read-only.

Commit e065729

Browse files
committed
proof/reachability: implement simpler APRProof.specialize_target_node with KCFG.pullback_covers
1 parent 2a28e9f commit e065729

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

src/pyk/proof/reachability.py

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -254,26 +254,12 @@ def get_refutation_id(self, node_id: int) -> str:
254254
return f'{self.id}.node-infeasible-{node_id}'
255255

256256
def specialize_target_node(self) -> None:
257-
target_subsumed = self.kcfg.predecessors(self.target)
258-
if len(target_subsumed) < 2:
259-
_LOGGER.info(
260-
f'Found less than 2 nodes subsumed into target, not specializing target node {self.id}: {target_subsumed}'
261-
)
262-
return
263-
target_subsumed_covers: list[KCFG.Cover] = []
264-
for ts in target_subsumed:
265-
if type(ts) is KCFG.Cover:
266-
target_subsumed_covers.append(ts)
267-
else:
268-
_LOGGER.info(
269-
f'Found non-cover predecessor into target node, not specializing target node {self.id}: {ts}'
270-
)
271-
return
272-
for tsc in target_subsumed_covers:
273-
self.kcfg.remove_cover(tsc.source.id, tsc.target.id)
274-
merge_id = self.kcfg.create_merge([cover.source.id for cover in target_subsumed_covers])
275-
self.kcfg.create_cover(merge_id, self.target)
276-
_LOGGER.info(f'Created specialized target subsumed node {self.id}: {merge_id}')
257+
pullback = self.kcfg.pullback_covers(self.target)
258+
if pullback is None:
259+
_LOGGER.warning(f'Could not make a cover pullback for target node: {self.target}')
260+
else:
261+
merge_id, source_ids = pullback
262+
_LOGGER.info(f'Created specialized target subsumed node {self.id}: {pullback}')
277263

278264

279265
class APRBMCProof(APRProof):

0 commit comments

Comments
 (0)