Exemplo n.º 1
0
 def to_clause(self):
     subs = set()
     [subs.update(s) for (s, p) in self.data.values()]
     clause_list = [clause(neg(self.ab_topic) + " " + all_pos(self.data.keys()) + " " + all_pos(list(subs)))]
     for key, value in self.data.iteritems():
         for ab_topic in value[1]:
             clause_list.append(clause(neg(key) + " " + ab_topic))
     return clause_list
Exemplo n.º 2
0
    def to_clause(self):

        the_list = []

        for node in self.nodes:
            the_list.append(clause(neg(self.nodes_all) + " " + node))

        the_list.append(clause(self.nodes_all + " " + all_neg(self.nodes)))

        return the_list
 def to_clause(self):
     return [
         clause(
             all_pos(self.ab_nodes_a + self.ab_nodes_b +
                     self.ab_subscribed_topics) + " " + self.ab_function +
             " " + self.observation)
     ]
 def to_clause(self):
     return [clause(all_pos([self.ab_node] + self.ab_subscribed_topics) + " " + self.observation)]
Exemplo n.º 5
0
 def to_clause(self):
     return [
         clause(
             all_pos(self.ab_nodes + self.ab_subscribed_topics) + " " +
             self.topic)
     ]
 def to_clause(self):
     return [clause(self.ab_node + " " + self.observation)]
def cnf_clause(c):
    return " ".join(map(lambda l: cnf_literal(l), clause(c).literals))
def clauses_gate(gate):
    c = CNF[gate.type](gate)
    return map(lambda i: clause(i), c)
def clauses_gate_with_ab_predicate(ab, gate):
    c = CNF[gate.type](gate)
    return map(lambda i: clause(i + pos(ab)), c)