JuliaSymbolics / SymbolicSAT.jl

for you with the good questions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't error on missing Z3 methods

shashi opened this issue · comments

Can imagine that this method doesn't exist for correctness reasons, but better to leave term unsimplified than to do this:

@syms a::Real
julia> simplify(a > 1.0, Constraints([]))
ERROR: Failed to apply rule ~(x::isbool) => if isprovable(~x, #= /home/shashi/.julia/dev/SymbolicSAT/src/SymbolicSAT.jl:84 =# @ctx()) === true
        true
    else
        ~x
    end on expression a > 1.0
Stacktrace:
 [1] (::RuleSet)(::SymbolicUtils.Term{Bool}, ::Constraints; depth::Int64, applyall::Bool, recurse::Bool) at /home/shashi/.julia/dev/SymbolicUtils/src/rule_dsl.jl:269
 [2] fixpoint(::RuleSet, ::SymbolicUtils.Term{Bool}, ::Constraints; kwargs::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol,Symbol},NamedTuple{(:recurse, :applyall),Tuple{Bool,Bool}}}) at /home/shashi/.julia/dev/SymbolicUtils/src/rule_dsl.jl:288
 [3] #simplify#37 at /home/shashi/.julia/dev/SymbolicUtils/src/simplify.jl:38 [inlined]
 [4] simplify(::SymbolicUtils.Term{Bool}, ::Constraints) at /home/shashi/.julia/dev/SymbolicUtils/src/simplify.jl:37
 [5] top-level scope at REPL[4]:1
 [6] run_backend(::REPL.REPLBackend) at /home/shashi/.julia/packages/Revise/MgvIv/src/Revise.jl:1023
 [7] top-level scope at none:0
caused by [exception 1]
MethodError: no method matching isless(::Float64, ::Z3.ExprAllocated)
Closest candidates are:
  isless(::Float64, ::Float64) at float.jl:465
  isless(::Missing, ::Any) at missing.jl:87
  isless(::AbstractFloat, ::AbstractFloat) at operators.jl:156