示例#1
0
 def insert(self, rule):
     changes = self.update([Event(formula=rule, insert=True)])
     return [event.formula for event in changes]
示例#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))
示例#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])
示例#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))
示例#5
0
 def delete_obj(self, formula, theory_string):
     return self.update_obj([Event(formula=formula, insert=False,
                                   target=theory_string)])
示例#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])
示例#7
0
 def insert_obj(self, formula, theory_string):
     return self.update_obj([Event(formula=formula, insert=True,
                                   target=theory_string)])
示例#8
0
 def delete(self, rule):
     changes = self.update([Event(formula=rule, insert=False)])
     return [event.formula for event in changes]