Skip to content

Commit 6475931

Browse files
committed
cterm/cterm: simplify expression of sort for predicate equalities
1 parent 06df00e commit 6475931

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pyk/src/pyk/cterm/cterm.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from ..prelude.k import GENERATED_TOP_CELL, K
2525
from ..prelude.kbool import andBool, orBool
2626
from ..prelude.ml import is_bottom, is_top, mlAnd, mlBottom, mlEquals, mlEqualsTrue, mlImplies, mlTop
27-
from ..utils import unique
27+
from ..utils import not_none, unique
2828

2929
if TYPE_CHECKING:
3030
from collections.abc import Iterable, Iterator
@@ -324,10 +324,7 @@ def pred(self, sort_with: KDefinition | None = None, subst: bool = True, constra
324324
_preds: list[KInner] = []
325325
if subst:
326326
for k, v in self.subst.items():
327-
sort = K
328-
if sort_with is not None:
329-
_sort = sort_with.sort(v)
330-
sort = _sort if _sort is not None else sort
327+
sort = K if sort_with is None or sort_with.sort(v) is None else not_none(sort_with.sort(v))
331328
_preds.append(mlEquals(KVariable(k, sort=sort), v, arg_sort=sort))
332329
if constraints:
333330
_preds.extend(self.constraints)

0 commit comments

Comments
 (0)