Skip to content

Commit

Permalink
Extract method _is_rule
Browse files Browse the repository at this point in the history
  • Loading branch information
tothtamas28 committed Nov 28, 2024
1 parent a89eee7 commit 5d73401
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions pyk/src/pyk/kore/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,22 @@ def from_axiom(axiom: Axiom) -> Rule:

@staticmethod
def extract_all(defn: Definition) -> list[Rule]:
res: list[Rule] = []
for axiom in defn.axioms:
if any(attr in axiom.attrs_by_key for attr in _SKIPPED_ATTRS):
continue
return [Rule.from_axiom(axiom) for axiom in defn.axioms if Rule._is_rule(axiom)]

if axiom == _INJ_AXIOM:
continue
@staticmethod
def _is_rule(axiom: Axiom) -> bool:
if axiom == _INJ_AXIOM:
return False

match axiom.pattern:
case Implies(right=Equals(left=Ceil())):
# Ceil rule
continue
if any(attr in axiom.attrs_by_key for attr in _SKIPPED_ATTRS):
return False

res.append(Rule.from_axiom(axiom))
match axiom.pattern:
case Implies(right=Equals(left=Ceil())):
# Ceil rule
return False

return res
return True


@final
Expand Down

0 comments on commit 5d73401

Please sign in to comment.