You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# AC: if the overhead of this call becomes too high, such as when learning programs with lots of clauses, we can improve it by not comparing already compared clauses
394
-
base= []
395
-
step= []
396
-
forruleinprog:
397
-
ifrule_is_recursive(rule):
398
-
step.append(rule)
399
-
else:
400
-
base.append(rule)
401
-
iflen(base) >1andself.has_redundant_rule(base):
402
-
returnself.find_redundant_rule_(base)
403
-
iflen(step) >1andself.has_redundant_rule(step):
404
-
returnself.find_redundant_rule_(step)
405
-
returnNone
385
+
# # WE ASSUME THAT THERE IS A REDUNDANT RULE
386
+
# def find_redundant_rule_(self, prog):
387
+
# prog_ = []
388
+
# for i, (head, body) in enumerate(prog):
389
+
# c = f"{i}-[{','.join(('not_'+ format_literal(head),) + tuple(format_literal(lit) for lit in body))}]"
390
+
# prog_.append(c)
391
+
# prog_ = f"[{','.join(prog_)}]"
392
+
# prog_ = janus_format_rule(prog_)
393
+
# q = f'find_redundant_rule({prog_}, K1, K2)'
394
+
# res = query_once(q)
395
+
# k1 = res['K1']
396
+
# k2 = res['K2']
397
+
# return prog[k1], prog[k2]
398
+
#
399
+
# def find_redundant_rules(self, prog):
400
+
# # assert(False)
401
+
# # AC: if the overhead of this call becomes too high, such as when learning programs with lots of clauses, we can improve it by not comparing already compared clauses
402
+
# base = []
403
+
# step = []
404
+
# for rule in prog:
405
+
# if rule_is_recursive(rule):
406
+
# step.append(rule)
407
+
# else:
408
+
# base.append(rule)
409
+
# if len(base) > 1 and self.has_redundant_rule(base):
410
+
# return self.find_redundant_rule_(base)
411
+
# if len(step) > 1 and self.has_redundant_rule(step):
0 commit comments