def model2term(model): termlist = [] for i in range(9): for j in range(9): if self.game.puzzle.get_cell(i, j) is None: val = model.get_value(self.variables[i][j]) var = self.variables[i][j] value = self.numerals[val] termlist.append(Terms.arith_eq_atom(var, value)) return Terms.yand(termlist)
def model2term(model): termlist = [] #do the times for tvar in YicesSignature.get_vars(SymbolTable.TIME): ytvar = tvar.yices_term ytval = model.get_value_as_term(ytvar) termlist.append(Terms.arith_eq_atom(ytvar, ytval)) #do the points for ptvar in YicesSignature.get_vars(SymbolTable.PT2): ytvar = ptvar.yices_term ytval = model.get_value(ytvar) termlist.append(Terms.eq(ytvar, ytval)) #do the stages # FIXME: more stuff needed here return Terms.yand(termlist)