Ejemplo n.º 1
0
 def chainageUtil(self, rule: Rule):
     if (rule.has_premisses()):
         p1 = rule.get_first_premiss()
         # print(p1)
         for fait in self.BfExp:
             x = Unif.unifier(fait, p1)
             # print("\t",fait,"   ",x)
             if (x is not None):
                 Unif.beautifulResult(x)
                 ruleS = rule.spread(x)
                 p = ruleS.get_first_premiss()
                 ruleSP = ruleS.pop_premisse()
                 self.chainageUtil(ruleSP)
     elif (not rule.has_premisses()):
         if (rule.checkExtra()):
             c = rule.conclusion_to_string()
             if (c not in self.BF):
                 self.newFaits.append(c)
                 self.BF.append(c)
                 self.BfExp.append(rule.conclusion)
                 self.Ok = True