Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _set_option(self, btor, name, value):
available_options = {pyboolector.BoolectorOpt(btor, io).lng : io
for io in self.internal_options}
try:
btor.Set_opt(available_options[name], value)
except TypeError:
raise PysmtValueError("Error setting the option '%s=%s'" \
% (name,value))
except pyboolector.BoolectorException:
raise PysmtValueError("Error setting the option '%s=%s'" \
% (name,value))
except KeyError:
raise PysmtValueError("Unable to set non-existing option '%s'. "
"The accepted options options are: %s" \
% (name, ", ".join(pyboolector.BoolectorOpt(btor, io).lng
for io in self.internal_options)))
def _set_option(self, btor, name, value):
available_options = {pyboolector.BoolectorOpt(btor, io).lng : io
for io in self.internal_options}
try:
btor.Set_opt(available_options[name], value)
except TypeError:
raise PysmtValueError("Error setting the option '%s=%s'" \
% (name,value))
except pyboolector.BoolectorException:
raise PysmtValueError("Error setting the option '%s=%s'" \
% (name,value))
except KeyError:
raise PysmtValueError("Unable to set non-existing option '%s'. "
"The accepted options options are: %s" \
% (name, ", ".join(pyboolector.BoolectorOpt(btor, io).lng
for io in self.internal_options)))
def __init__(self, environment, logic, **options):
IncrementalTrackingSolver.__init__(self,
environment=environment,
logic=logic,
**options)
self.btor = pyboolector.Boolector()
self.options(self)
self.converter = BTORConverter(environment, self.btor)
self.mgr = environment.formula_manager
self.declarations = {}
return
# EOC BoolectorOptions
pass
pyboolector.BTOR_OPT_INCREMENTAL,
pyboolector.BTOR_OPT_INCREMENTAL_SMT1,
pyboolector.BTOR_OPT_INPUT_FORMAT,
pyboolector.BTOR_OPT_OUTPUT_NUMBER_FORMAT,
pyboolector.BTOR_OPT_OUTPUT_FORMAT,
pyboolector.BTOR_OPT_ENGINE,
pyboolector.BTOR_OPT_SAT_ENGINE,
pyboolector.BTOR_OPT_AUTO_CLEANUP,
pyboolector.BTOR_OPT_PRETTY_PRINT,
pyboolector.BTOR_OPT_EXIT_CODES,
pyboolector.BTOR_OPT_SEED,
pyboolector.BTOR_OPT_VERBOSITY,
pyboolector.BTOR_OPT_LOGLEVEL,
pyboolector.BTOR_OPT_REWRITE_LEVEL,
pyboolector.BTOR_OPT_SKELETON_PREPROC,
pyboolector.BTOR_OPT_ACKERMANN,
pyboolector.BTOR_OPT_BETA_REDUCE_ALL,
pyboolector.BTOR_OPT_ELIMINATE_SLICES,
pyboolector.BTOR_OPT_VAR_SUBST,
pyboolector.BTOR_OPT_UCOPT,
pyboolector.BTOR_OPT_MERGE_LAMBDAS,
pyboolector.BTOR_OPT_EXTRACT_LAMBDAS,
pyboolector.BTOR_OPT_NORMALIZE_ADD,
pyboolector.BTOR_OPT_FUN_PREPROP,
pyboolector.BTOR_OPT_FUN_PRESLS,
pyboolector.BTOR_OPT_FUN_DUAL_PROP,
pyboolector.BTOR_OPT_FUN_DUAL_PROP_QSORT,
pyboolector.BTOR_OPT_FUN_JUST,
pyboolector.BTOR_OPT_FUN_JUST_HEURISTIC,
pyboolector.BTOR_OPT_FUN_LAZY_SYNTHESIZE,
pyboolector.BTOR_OPT_FUN_EAGER_LEMMAS,
pyboolector.BTOR_OPT_SLS_NFLIPS,
pyboolector.BTOR_OPT_PROP_USE_RESTARTS,
pyboolector.BTOR_OPT_PROP_USE_BANDIT,
pyboolector.BTOR_OPT_PROP_PATH_SEL,
pyboolector.BTOR_OPT_PROP_PROB_USE_INV_VALUE,
pyboolector.BTOR_OPT_PROP_PROB_FLIP_COND,
pyboolector.BTOR_OPT_PROP_PROB_FLIP_COND_CONST,
pyboolector.BTOR_OPT_PROP_FLIP_COND_CONST_DELTA,
pyboolector.BTOR_OPT_PROP_FLIP_COND_CONST_NPATHSEL,
pyboolector.BTOR_OPT_PROP_PROB_SLICE_KEEP_DC,
pyboolector.BTOR_OPT_PROP_PROB_CONC_FLIP,
pyboolector.BTOR_OPT_PROP_PROB_SLICE_FLIP,
pyboolector.BTOR_OPT_PROP_PROB_EQ_FLIP,
pyboolector.BTOR_OPT_PROP_PROB_AND_FLIP,
pyboolector.BTOR_OPT_PROP_NO_MOVE_ON_CONFLICT,
pyboolector.BTOR_OPT_AIGPROP_USE_RESTARTS,
pyboolector.BTOR_OPT_AIGPROP_USE_BANDIT,
pyboolector.BTOR_OPT_SORT_EXP,
pyboolector.BTOR_OPT_SORT_AIG,
pyboolector.BTOR_OPT_SORT_AIGVEC,
pyboolector.BTOR_OPT_AUTO_CLEANUP_INTERNAL,
pyboolector.BTOR_OPT_SIMPLIFY_CONSTRAINTS,
pyboolector.BTOR_OPT_CHK_FAILED_ASSUMPTIONS]
pyboolector.BTOR_OPT_SLS_USE_BANDIT,
pyboolector.BTOR_OPT_PROP_USE_RESTARTS,
pyboolector.BTOR_OPT_PROP_USE_BANDIT,
pyboolector.BTOR_OPT_PROP_PATH_SEL,
pyboolector.BTOR_OPT_PROP_PROB_USE_INV_VALUE,
pyboolector.BTOR_OPT_PROP_PROB_FLIP_COND,
pyboolector.BTOR_OPT_PROP_PROB_FLIP_COND_CONST,
pyboolector.BTOR_OPT_PROP_FLIP_COND_CONST_DELTA,
pyboolector.BTOR_OPT_PROP_FLIP_COND_CONST_NPATHSEL,
pyboolector.BTOR_OPT_PROP_PROB_SLICE_KEEP_DC,
pyboolector.BTOR_OPT_PROP_PROB_CONC_FLIP,
pyboolector.BTOR_OPT_PROP_PROB_SLICE_FLIP,
pyboolector.BTOR_OPT_PROP_PROB_EQ_FLIP,
pyboolector.BTOR_OPT_PROP_PROB_AND_FLIP,
pyboolector.BTOR_OPT_PROP_NO_MOVE_ON_CONFLICT,
pyboolector.BTOR_OPT_AIGPROP_USE_RESTARTS,
pyboolector.BTOR_OPT_AIGPROP_USE_BANDIT,
pyboolector.BTOR_OPT_SORT_EXP,
pyboolector.BTOR_OPT_SORT_AIG,
pyboolector.BTOR_OPT_SORT_AIGVEC,
pyboolector.BTOR_OPT_AUTO_CLEANUP_INTERNAL,
pyboolector.BTOR_OPT_SIMPLIFY_CONSTRAINTS,
pyboolector.BTOR_OPT_CHK_FAILED_ASSUMPTIONS]
SolverOptions.__init__(self, **base_options)
if self.random_seed is not None:
raise PysmtValueError("BTOR Does not support Random Seed setting.")
# Disabling Incremental usage is not allowed.
# This needs to be set to 1
self.incrementality = True
self.internal_options = [pyboolector.BTOR_OPT_MODEL_GEN,
pyboolector.BTOR_OPT_INCREMENTAL,
pyboolector.BTOR_OPT_INCREMENTAL_SMT1,
pyboolector.BTOR_OPT_INPUT_FORMAT,
pyboolector.BTOR_OPT_OUTPUT_NUMBER_FORMAT,
pyboolector.BTOR_OPT_OUTPUT_FORMAT,
pyboolector.BTOR_OPT_ENGINE,
pyboolector.BTOR_OPT_SAT_ENGINE,
pyboolector.BTOR_OPT_AUTO_CLEANUP,
pyboolector.BTOR_OPT_PRETTY_PRINT,
pyboolector.BTOR_OPT_EXIT_CODES,
pyboolector.BTOR_OPT_SEED,
pyboolector.BTOR_OPT_VERBOSITY,
pyboolector.BTOR_OPT_LOGLEVEL,
pyboolector.BTOR_OPT_REWRITE_LEVEL,
pyboolector.BTOR_OPT_SKELETON_PREPROC,
pyboolector.BTOR_OPT_ACKERMANN,
pyboolector.BTOR_OPT_BETA_REDUCE_ALL,
pyboolector.BTOR_OPT_ELIMINATE_SLICES,
pyboolector.BTOR_OPT_VAR_SUBST,
pyboolector.BTOR_OPT_UCOPT,
pyboolector.BTOR_OPT_MERGE_LAMBDAS,
pyboolector.BTOR_OPT_EXTRACT_LAMBDAS,
pyboolector.BTOR_OPT_NORMALIZE_ADD,
pyboolector.BTOR_OPT_FUN_PREPROP,
pyboolector.BTOR_OPT_PROP_PROB_FLIP_COND,
pyboolector.BTOR_OPT_PROP_PROB_FLIP_COND_CONST,
pyboolector.BTOR_OPT_PROP_FLIP_COND_CONST_DELTA,
pyboolector.BTOR_OPT_PROP_FLIP_COND_CONST_NPATHSEL,
pyboolector.BTOR_OPT_PROP_PROB_SLICE_KEEP_DC,
pyboolector.BTOR_OPT_PROP_PROB_CONC_FLIP,
pyboolector.BTOR_OPT_PROP_PROB_SLICE_FLIP,
pyboolector.BTOR_OPT_PROP_PROB_EQ_FLIP,
pyboolector.BTOR_OPT_PROP_PROB_AND_FLIP,
pyboolector.BTOR_OPT_PROP_NO_MOVE_ON_CONFLICT,
pyboolector.BTOR_OPT_AIGPROP_USE_RESTARTS,
pyboolector.BTOR_OPT_AIGPROP_USE_BANDIT,
pyboolector.BTOR_OPT_SORT_EXP,
pyboolector.BTOR_OPT_SORT_AIG,
pyboolector.BTOR_OPT_SORT_AIGVEC,
pyboolector.BTOR_OPT_AUTO_CLEANUP_INTERNAL,
pyboolector.BTOR_OPT_SIMPLIFY_CONSTRAINTS,
pyboolector.BTOR_OPT_CHK_FAILED_ASSUMPTIONS]
pyboolector.BTOR_OPT_INCREMENTAL_SMT1,
pyboolector.BTOR_OPT_INPUT_FORMAT,
pyboolector.BTOR_OPT_OUTPUT_NUMBER_FORMAT,
pyboolector.BTOR_OPT_OUTPUT_FORMAT,
pyboolector.BTOR_OPT_ENGINE,
pyboolector.BTOR_OPT_SAT_ENGINE,
pyboolector.BTOR_OPT_AUTO_CLEANUP,
pyboolector.BTOR_OPT_PRETTY_PRINT,
pyboolector.BTOR_OPT_EXIT_CODES,
pyboolector.BTOR_OPT_SEED,
pyboolector.BTOR_OPT_VERBOSITY,
pyboolector.BTOR_OPT_LOGLEVEL,
pyboolector.BTOR_OPT_REWRITE_LEVEL,
pyboolector.BTOR_OPT_SKELETON_PREPROC,
pyboolector.BTOR_OPT_ACKERMANN,
pyboolector.BTOR_OPT_BETA_REDUCE_ALL,
pyboolector.BTOR_OPT_ELIMINATE_SLICES,
pyboolector.BTOR_OPT_VAR_SUBST,
pyboolector.BTOR_OPT_UCOPT,
pyboolector.BTOR_OPT_MERGE_LAMBDAS,
pyboolector.BTOR_OPT_EXTRACT_LAMBDAS,
pyboolector.BTOR_OPT_NORMALIZE_ADD,
pyboolector.BTOR_OPT_FUN_PREPROP,
pyboolector.BTOR_OPT_FUN_PRESLS,
pyboolector.BTOR_OPT_FUN_DUAL_PROP,
pyboolector.BTOR_OPT_FUN_DUAL_PROP_QSORT,
pyboolector.BTOR_OPT_FUN_JUST,
pyboolector.BTOR_OPT_FUN_JUST_HEURISTIC,
pyboolector.BTOR_OPT_FUN_LAZY_SYNTHESIZE,
pyboolector.BTOR_OPT_FUN_EAGER_LEMMAS,
pyboolector.BTOR_OPT_SLS_NFLIPS,
pyboolector.BTOR_OPT_SLS_STRATEGY,
pyboolector.BTOR_OPT_PROP_FLIP_COND_CONST_DELTA,
pyboolector.BTOR_OPT_PROP_FLIP_COND_CONST_NPATHSEL,
pyboolector.BTOR_OPT_PROP_PROB_SLICE_KEEP_DC,
pyboolector.BTOR_OPT_PROP_PROB_CONC_FLIP,
pyboolector.BTOR_OPT_PROP_PROB_SLICE_FLIP,
pyboolector.BTOR_OPT_PROP_PROB_EQ_FLIP,
pyboolector.BTOR_OPT_PROP_PROB_AND_FLIP,
pyboolector.BTOR_OPT_PROP_NO_MOVE_ON_CONFLICT,
pyboolector.BTOR_OPT_AIGPROP_USE_RESTARTS,
pyboolector.BTOR_OPT_AIGPROP_USE_BANDIT,
pyboolector.BTOR_OPT_SORT_EXP,
pyboolector.BTOR_OPT_SORT_AIG,
pyboolector.BTOR_OPT_SORT_AIGVEC,
pyboolector.BTOR_OPT_AUTO_CLEANUP_INTERNAL,
pyboolector.BTOR_OPT_SIMPLIFY_CONSTRAINTS,
pyboolector.BTOR_OPT_CHK_FAILED_ASSUMPTIONS]