From 75f108f3665401a194c8acb0b1c3e7e8548a9e20 Mon Sep 17 00:00:00 2001 From: JianHong Zhao Date: Thu, 21 Nov 2024 19:54:12 +0800 Subject: [PATCH] updating the `minimize_kcfg` method to accept an optional heuristics parameter for merging node. (#4687) This pull request includes changes to the `pyk/src/pyk/kcfg/exploration.py` file to enhance the functionality of the `minimize_kcfg` method by incorporating heuristics. The most important changes include importing the `KCFGSemantics` module and updating the `minimize_kcfg` method to accept an optional heuristics parameter. --- pyk/src/pyk/kcfg/exploration.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyk/src/pyk/kcfg/exploration.py b/pyk/src/pyk/kcfg/exploration.py index ac47640ce5..58ed4af05a 100644 --- a/pyk/src/pyk/kcfg/exploration.py +++ b/pyk/src/pyk/kcfg/exploration.py @@ -10,6 +10,7 @@ from typing import Any from pyk.kcfg.kcfg import NodeIdLike + from pyk.kcfg.semantics import KCFGSemantics class KCFGExplorationNodeAttr(NodeAttr): @@ -109,5 +110,5 @@ def to_dict(self) -> dict[str, Any]: # # Minimizing the KCFG - def minimize_kcfg(self, merge: bool = False) -> None: - KCFGMinimizer(self.kcfg).minimize(merge=merge) + def minimize_kcfg(self, heuristics: KCFGSemantics | None = None, merge: bool = False) -> None: + KCFGMinimizer(kcfg=self.kcfg, heuristics=heuristics).minimize(merge=merge)