You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def Const(name, sort):
# _to_expr doesn't have a DatatypeRef case
x = cvc5.pythonic.Const(name, sort)
if isinstance(sort, DatatypeSortRef):
x = DatatypeRef(x.ast, x.ctx, x.reverse_children)
return x
________________________________________________________________ ERROR collecting tests/test_kernel.py ________________________________________________________________
tests/test_kernel.py:9: in <module>
import knuckledragger.theories.Interval
knuckledragger/theories/Interval.py:9: in <module>
setof = kd.define("setof", [i], smt.Lambda([x], smt.And(i.lo <= x, x <= i.hi)))
knuckledragger/kernel.py:132: in define
f(*args) == body
../../../.local/lib/python3.10/site-packages/cvc5/pythonic/cvc5_pythonic.py:375: in __eq__
return BoolRef(c.solver.mkTerm(Kind.EQUAL, a.as_ast(), b.as_ast()), c)
cvc5.pxi:2556: in cvc5.cvc5_python_base.Solver.mkTerm
???
cvc5.pxi:1538: in cvc5.cvc5_python_base.TermManager.mkTerm
???
E RuntimeError: Subexpressions must have the same type:
E Equation: (= (setof i) (lambda ((x Real)) (and (<= (lo i) x) (<= x (hi i)))))
E Type 1: (Array Real Bool)
E Type 2: (-> Real Bool)
@philzook58 Both reported items are now fixed on main through PRs #118 and #120. In cvc5, lambda has a function type, not an array type. These two types are not interchangeable, although PR #118, which extends the solution provided by @msakai in #115, helps narrow the gap.
Activity
msakai commentedon Aug 9, 2026
The sort of lambda expressions is
ArraySortin Z3, but in cvc5 it appears to beFunctionSort.I think the correct fix is #115.
Construct DatatypeRef and DatatypeSortRef for datatypes (#120)
daniel-larraz commentedon Aug 13, 2026
@philzook58 Both reported items are now fixed on main through PRs #118 and #120. In cvc5,
lambdahas a function type, not an array type. These two types are not interchangeable, although PR #118, which extends the solution provided by @msakai in #115, helps narrow the gap.Support higher-order function sorts and partial application
Accept [] as a spelling of application
Accept [] as a spelling of application
Support higher-order function sorts and partial application (#122)
daniel-larraz commentedon Aug 16, 2026
@philzook58 FYI, based on the output excerpt in your report, you may also need the changes from PR #122 for your code to work.