Commits

David Schneider committed 6f8fd62

Translation related changes

Comments (0)

Files changed (4)

prolog/builtin/atomconstruction.py

         self.var1 = var1
         self.var2 = var2
         self.r = helper.convert_to_str(result)
-        self.i = -1
+        self.i = 0
         
     def activate(self, fcont, heap):
         # nondeterministic splitting of result        
-        self.i += 1
-        if self.i < len(self.r) + 1:
+        if self.i < len(self.r):
             fcont, heap = self.prepare_more_solutions(fcont, heap)
             oldstate = heap.branch()
             self.var1.unify(term.Callable.build(self.r[:self.i]), heap)
             self.var2.unify(term.Callable.build(self.r[self.i:]), heap)
+            self.i += 1
             return self.nextcont, fcont, heap
         raise error.UnificationFailed()
 

prolog/builtin/formatting.py

         ignore_ops = False
         number_vars = False
         for option in options:
-            if (not isinstance(option, Term) or len(option.argument_count()) != 1):
+            if (not isinstance(option, Term) or option.argument_count() != 1):
                 error.throw_domain_error('write_option', option)
             arg = option.argument_at(0)
             if option.name()== "max_depth":

prolog/interpreter/continuation.py

 
 def get_printable_location(rule):
     if rule:
-        s = rule.signature()    
+        s = rule.signature
     else:
         s = "No rule"
     return s

prolog/interpreter/term.py

 
         return self.eval_arithmetic(engine)
 
+    @jit.dont_look_inside
     def cmp_standard_order(self, other, heap):
         assert isinstance(other, Var)
         return rcmp(compute_unique_id(self), compute_unique_id(other))