class Z3::Simplifier
Incremental preprocessing for a Solver.
Where a Tactic transforms a Goal into subgoals you can look at, a Simplifier has nothing you can apply it to - attaching it to a solver with ‘Solver#with_simplifier` is the only way to use one - and `#and_then` is its only combinator.
Constants
Attributes
Public Class Methods
Source
# File lib/z3/simplifier.rb, line 70 def description(name) raise Z3::Exception, "#{name} not on list of known simplifiers, available: #{names.join(" ")}" unless names.include?(name) LowLevel.simplifier_get_descr(name) end
Source
# File lib/z3/simplifier.rb, line 66 def names (0...LowLevel.get_num_simplifiers).map{|i| LowLevel.get_simplifier_name(i) } end
Source
# File lib/z3/simplifier.rb, line 21 def initialize(_simplifier) case _simplifier when String names = Simplifier.names raise Z3::Exception, "#{_simplifier} not on list of known simplifiers, available: #{names.join(" ")}" unless names.include?(_simplifier) if (reason = UNSOUND[_simplifier]) raise Z3::Exception, "#{_simplifier} is unsound in Z3 #{Z3.version} - #{reason}" end _simplifier = LowLevel.mk_simplifier(_simplifier) when FFI::Pointer # Nothing to do else raise Z3::Exception, "Simplifier name or pointer expected, got #{_simplifier.class}" end @_simplifier = _simplifier inc_ref! :simplifier, _simplifier end
Takes either a simplifier name, or a pointer from the low level API
Public Instance Methods
Source
# File lib/z3/simplifier.rb, line 45 def and_then(other) raise Z3::Exception, "Simplifier required" unless other.is_a?(Simplifier) Simplifier.new LowLevel.simplifier_and_then(self, other) end
Source
# File lib/z3/simplifier.rb, line 52 def param_descrs ParamDescrs.new(LowLevel.simplifier_get_param_descrs(self)) end
‘Z3_simplifier_get_param_descrs` lists every parameter the simplifier takes, `#help` describes them
Source
# File lib/z3/simplifier.rb, line 58 def using_params(params) params = Params.new(params, param_descrs) unless params.is_a?(Params) Simplifier.new LowLevel.simplifier_using_params(self, params) end
Simplifiers are immutable, so this is a new one with the parameters baked into it rather than a change to this one