def persist_arity_or_facts(self, agent): """Return either a list of facts (sequences of argument values) to be persisted or the number of arguments of the predicate (to generate the facts)""" raise Unimplemented( "Persistable predicate implementation for %s must define persist_arity_or_facts" % self.__class__.__name__)
def solution(self, agent, bindings, zitems): if self.solutions == PredImpInt.solutions: raise Unimplemented() for x in self.solutions(agent, bindings, zitems): if x: return SOLVED return NOT_SOLVED
def solutions(self, agent, bindings, zitems): """Generator - of solutions to the predicate, return True for each solution after matching the zitems.""" if self.solution == PredImpInt.solution: raise Unimplemented() if self.solution(agent, bindings, zitems): return ONE_SOLUTION else: return NO_SOLUTIONS
def resume_conclude(self, agent, bindings, zexpr): """conclude as part of a resume operation. If the conclude is successful, return None. If the conclude cannot be successfully completed, return a tuple (Bindings, ValuesZexpr) representing a new set of values to be concluded after the resume operation completes. This new set of values will trigger newfact: events""" raise Unimplemented( "Persistable predicate implementation for %s must define resume_conclude" % self.__class__.__name__)
def find_tframes(self, agent): raise Unimplemented()
def tfcont(self, agent): raise Unimplemented()
def append_tframes(self, agent, event, bindings, zexpr, list): raise Unimplemented()
def bEntity(self, agent, zitem): "Find the fully qualified symbol name for zitem" raise Unimplemented()
def bQuotedEval(self, agent, zitem): "Evaluated zitem as being quoted" raise Unimplemented()
def bTermEvalP(self, agent, zitem): "Is zitem evaluable in its normal execution context" raise Unimplemented()
def retractall(self, agent, bindings, zexpr): """Retract anything matching this predicate and return whether the datadase has been changed.""" raise Unimplemented("Predicate implementation must define retractall")
def conclude(self, agent, bindings, zexpr): """Conclude this predicate and return whether the database has been changed.""" raise Unimplemented( "Predicate implementation for %s must define conclude" % self.__class__.__name__)
def base_event(self): raise Unimplemented()
def call(self, agent, bindings, zexpr): """Calls the function on the given arguments""" raise Unimplemented("Function implementation must define call")
def tframes(self, agent, event, bindings, zexpr): "return a list of tframes to handle the task" raise Unimplemented("Task implementation must define tframes")
def match_inverse(self, agent, bindings, zexpr, obj): """Attempt to match the inverse function applied to obj""" raise Unimplemented("Function implementation must define inverse")
def enter(self, agent, tf, zexpr): raise Unimplemented()
def bTermEval(self, agent, zitem): "Evaluate zitem assuming it is evaluable, either because it is always evaluable, or because it has now been bound." raise Unimplemented()
def subgoal_complete(self, agent, tf, zexpr, subgoal, result): raise Unimplemented()
def bTermMatch(self, agent, zitem, value): "Match zitem to value, save any bindings, return whether the match succeeded" raise Unimplemented()
def resume(self, agent, tf, zexpr): raise Unimplemented()
def bQuotedMatch(self, agent, zitem, value): "Match zitem considering it to be quoted, return whether the match succeeded" raise Unimplemented()
def child_complete(self, agent, tf, zexpr, index, result): raise Unimplemented()
def bImp(self, agent, zitem): "Return the implementation to use for processing zitem" raise Unimplemented()
def generateInfo(self): """Create an info for use with the implementation if none exists""" raise Unimplemented("Implementation must define generateInfo")
def name(self): raise Unimplemented()
def __call__(self, decl): """Construct an instance of ImpInt""" raise Unimplemented("Implementation generator must define __call__")
def _tenter_no_match(self, ignore_agent, ignore_tframe): raise Unimplemented()
def goalsym(self): raise Unimplemented("subclass must define goalsym method")