Skip to content

Don't error on missing Z3 methods #1

@shashi

Description

@shashi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions