Esempio n. 1
0
 def __init__(self, module):
     Common.reset() #resets variables if in test mode
     self.EMPTYSTRING = SMTLib.SMT_Int("EMPTYSTRING")
     self.module = module
     self.smt_bracketed_constraints = []
     self.cfr_sorts = {}
     self.solver = BaseSolver.getSolver()
     self.setOptions()
     self.clock = Clock.Clock()
     self.objectives = []
     self.delimeter_count = 0
     
     """ Create simple objects used to store Z3 constraints. """
     self.join_constraints = Constraints.GenericConstraints("ClaferModel")
     
     """ 
     Used to map constraints in the UNSAT core to Boolean variables.
     """
     self.unsat_core_trackers = []
     self.low_level_unsat_core_trackers = {}
     self.unsat_map = {}
     self.join_cache = {} # cache to store join expression (asil optimization)
     self.translate()
Esempio n. 2
0
def op_indexof(left, right):
    (_, mask) = left.getInstanceSort(0)
    left_i = mask.get(0)
    (_, mask) = right.getInstanceSort(0)
    right_i = mask.get(0)
    return IntArg([SMTLib.SMT_Int("Indexof$" + left_i + "$" + right_i)])
Esempio n. 3
0
def op_length(arg):
    (_, mask) = arg.getInstanceSort(0)
    arg_i = mask.get(0)
    stringID = Common.STRCONS_SUB + str(Common.getStringUID())
    Common.string_map[stringID] = arg_i
    return IntArg([SMTLib.SMT_Int("Length$" + str(stringID))])