From c74e7c4b9f240c761cfc964ecc5579cb0a2da771 Mon Sep 17 00:00:00 2001 From: troyyyyy <49091847+troyyyyy@users.noreply.github.com> Date: Fri, 25 Nov 2022 12:32:05 +0800 Subject: [PATCH] Update kb.py --- abducer/kb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/abducer/kb.py b/abducer/kb.py index 0fdfb04..9ff7652 100644 --- a/abducer/kb.py +++ b/abducer/kb.py @@ -142,7 +142,7 @@ class ClsKB(KBBase): for i, idx in enumerate(address_idx): candidate[idx] = c[i] if self.logic_forward(candidate) == key: - if(sum(pred_res[idx] != candidate[idx] for idx in range(len(pred_res))) == address_num): + if sum(pred_res[idx] != candidate[idx] for idx in range(len(pred_res))) == address_num: new_candidates.append(candidate) return new_candidates @@ -218,7 +218,7 @@ class prolog_KB(KBBase): candidate = pred_res.copy() for i, idx in enumerate(address_idx): candidate[idx] = c[i] - if(sum(pred_res[idx] != candidate[idx] for idx in range(len(pred_res))) == address_num): + if sum(pred_res[idx] != candidate[idx] for idx in range(len(pred_res))) == address_num: new_candidates.append(candidate) return new_candidates