Skip to content

Commit

Permalink
[to delete] move untils into utils.py as #4621
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevengre committed Sep 4, 2024
1 parent 5a5d068 commit 0cfb7e1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
19 changes: 1 addition & 18 deletions pyk/src/tests/unit/test_kcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
from pyk.kcfg import KCFG, KCFGShow
from pyk.kcfg.kcfg import KCFGNodeAttr
from pyk.kcfg.show import NodePrinter
from pyk.prelude.kint import geInt, intToken, ltInt
from pyk.prelude.ml import mlEquals, mlEqualsTrue, mlTop
from pyk.prelude.ml import mlEquals, mlTop
from pyk.prelude.utils import token
from pyk.utils import not_none, single

Expand All @@ -25,22 +24,6 @@
from pyk.kast import KInner


def lt(var: str, n: int) -> KApply:
return mlEqualsTrue(ltInt(KVariable(var), intToken(n)))


def ge(var: str, n: int) -> KApply:
return mlEqualsTrue(geInt(KVariable(var), intToken(n)))


def config(var: str) -> KApply:
return KApply('<top>', KVariable(var))


def config_int(n: int) -> KApply:
return KApply('<top>', intToken(n))


def to_csubst_cterm(term_1: CTerm, term_2: CTerm, constraints: Iterable[KInner]) -> CSubst:
csubst = term_1.match_with_constraint(term_2)
assert csubst is not None
Expand Down
18 changes: 18 additions & 0 deletions pyk/src/tests/unit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from typing import TYPE_CHECKING

from pyk.kast.inner import KApply, KLabel, KVariable
from pyk.prelude.kint import geInt, intToken, ltInt
from pyk.prelude.ml import mlEqualsTrue

if TYPE_CHECKING:
from typing import Final
Expand All @@ -16,3 +18,19 @@
f, g, h = map(KLabel, ('f', 'g', 'h'))

k = KLabel('<k>')


def lt(var: str, n: int) -> KApply:
return mlEqualsTrue(ltInt(KVariable(var), intToken(n)))


def ge(var: str, n: int) -> KApply:
return mlEqualsTrue(geInt(KVariable(var), intToken(n)))


def config(var: str) -> KApply:
return KApply('<top>', KVariable(var))


def config_int(n: int) -> KApply:
return KApply('<top>', intToken(n))

0 comments on commit 0cfb7e1

Please sign in to comment.