Ejemplo n.º 1
0
 def insert(self, rule):
     changes = self.update([Event(formula=rule, insert=True)])
     return [event.formula for event in changes]
Ejemplo n.º 2
0
 def delete(self, atom, proofs=None):
     """Deletes ATOM from the DB.  Returns changes."""
     return self.modify(Event(formula=atom, insert=False, proofs=proofs))
Ejemplo n.º 3
0
 def define(self, rules):
     """Empties and then inserts RULES."""
     self.empty()
     return self.update(
         [Event(formula=rule, insert=True) for rule in rules])
Ejemplo n.º 4
0
 def insert(self, atom, proofs=None):
     """Inserts ATOM into the DB.  Returns changes."""
     return self.modify(Event(formula=atom, insert=True, proofs=proofs))
Ejemplo n.º 5
0
 def delete_obj(self, formula, theory_string):
     return self.update_obj([Event(formula=formula, insert=False,
                                   target=theory_string)])
Ejemplo n.º 6
0
 def delete_string(self, policy_string, theory_string):
     policy = self.parse(policy_string)
     return self.update_obj(
         [Event(formula=x, insert=False, target=theory_string)
          for x in policy])
Ejemplo n.º 7
0
 def insert_obj(self, formula, theory_string):
     return self.update_obj([Event(formula=formula, insert=True,
                                   target=theory_string)])
Ejemplo n.º 8
0
 def delete(self, rule):
     changes = self.update([Event(formula=rule, insert=False)])
     return [event.formula for event in changes]