def check_sat(self, output_filename="", timeout=0, vars_of_interest=[], verbose=True, dnc=True): # todo: redirect output to cwd/maraboulogs/ if (not dnc) or (self.n_worker == 1): options = Marabou.createOptions(timeoutInSeconds=timeout) else: # dnc options = Marabou.createOptions(timeoutInSeconds=timeout, dnc=True, verbosity=0, initialDivides=2, initialTimeout=120, numWorkers=self.n_worker) # options = Marabou.createOptions(timeoutInSeconds=timeout, dnc=True, verbosity=0, # initialDivides=2, initialTimeout=120, numWorkers=self.n_worker, # biasStrategy="estimate", focusLayer=1000, lookAheadPreprocessing=True) MarabouCore.saveQuery(self.ipq, "query_dump") vals, stats = MarabouCore.solve(self.ipq, options, output_filename) self.convert_sat_vals_to_mc_vars(vals) if verbose: self.print_results(vals, stats, vars_of_interest=vars_of_interest) if stats.hasTimedOut(): return Result.TIMEOUT, self.vals_with_mc_vars, stats elif len(vals) == 0: return Result.UNSAT, self.vals_with_mc_vars, stats else: # len(vals) /== 0 return Result.SAT, self.vals_with_mc_vars, stats
def saveQuery(self, filename=""): """Serializes the inputQuery in the given filename Args: filename: (string) file to write serialized inputQuery """ ipq = self.getMarabouQuery() MarabouCore.saveQuery(ipq, str(filename))