Module Pulselib.PulsePathCondition
module AbstractValue = PulseAbstractValuemodule SatUnsat = PulseSatUnsatmodule ValueHistory = PulseValueHistorytype new_eqs= PulseFormula.new_eqs
Building arithmetic constraints
val and_nonnegative : AbstractValue.t -> t -> t * new_eqsand_nonnegative v phiisphi ∧ v≥0
val and_positive : AbstractValue.t -> t -> t * new_eqsand_positive v phiisphi ∧ v>0
val and_eq_int : AbstractValue.t -> IR.IntLit.t -> t -> t * new_eqsand_eq_int v i phiisphi ∧ v=i
val and_eq_vars : AbstractValue.t -> AbstractValue.t -> t -> t * new_eqsval simplify : IR.Tenv.t -> can_be_pruned:AbstractValue.Set.t -> keep:AbstractValue.Set.t -> get_dynamic_type:(AbstractValue.t -> IR.Typ.t option) -> t -> (t * AbstractValue.Set.t * new_eqs) SatUnsat.tsimplify ~can_be_pruned ~keep phiattempts to get rid of as many variables infv phibut not inkeepas possible, and tries to eliminate variables not incan_be_prunedfrom the "pruned" part of the formula
val and_callee : (AbstractValue.t * ValueHistory.t) AbstractValue.Map.t -> t -> callee:t -> (AbstractValue.t * ValueHistory.t) AbstractValue.Map.t * t * new_eqs
Operations
type operand= PulseFormula.operand=|LiteralOperand of IR.IntLit.t|AbstractValueOperand of AbstractValue.t|FunctionApplicationOperand of{f : PulseFormula.function_symbol;actuals : AbstractValue.t list;}
val and_equal : operand -> operand -> t -> t * new_eqsval eval_binop : AbstractValue.t -> IR.Binop.t -> operand -> operand -> t -> t * new_eqsval eval_unop : AbstractValue.t -> IR.Unop.t -> AbstractValue.t -> t -> t * new_eqsval prune_binop : negated:bool -> IR.Binop.t -> operand -> operand -> t -> t * new_eqsval and_eq_instanceof : AbstractValue.t -> AbstractValue.t -> IR.Typ.t -> t -> t * new_eqs
Queries
val is_known_zero : t -> AbstractValue.t -> boolis_known_zero phi treturnstrueifphi |- t = 0,falseif we don't know for sure
val is_known_not_equal_zero : t -> AbstractValue.t -> boolis_known_not_equal_zero phi treturnstrueifphi |- t != 0,falseif we don't know for sure
val is_unsat_cheap : t -> boolwhether the state contains a contradiction, call this as often as you want
val is_unsat_expensive : IR.Tenv.t -> get_dynamic_type:(AbstractValue.t -> IR.Typ.t option) -> t -> t * bool * new_eqswhether the state contains a contradiction, only call this when you absolutely have to
val has_no_assumptions : t -> boolwhether the current path is independent of any calling context
val get_known_var_repr : t -> AbstractValue.t -> AbstractValue.tget the canonical representative for the variable according to the equality relation in the "known" part of the formula
val get_both_var_repr : t -> AbstractValue.t -> AbstractValue.tget the canonical representative for the variable according to the equality relation in the "both" (known + pruned) part of the formula