Browse Source

Modify mapping in HWF_KB

pull/3/head
troyyyyy GitHub 3 years ago
parent
commit
5290ebd804
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 17 deletions
  1. +2
    -17
      abl/abducer/kb.py

+ 2
- 17
abl/abducer/kb.py View File

@@ -339,26 +339,11 @@ class HWF_KB(RegKB):
def logic_forward(self, formula):
if not self._valid_candidate(formula):
return np.inf
mapping = {
'1': '1',
'2': '2',
'3': '3',
'4': '4',
'5': '5',
'6': '6',
'7': '7',
'8': '8',
'9': '9',
'+': '+',
'-': '-',
'times': '*',
'div': '/',
}
mapping = {str(i): str(i) for i in range(1, 10)}
mapping.update({'+': '+', '-': '-', 'times': '*', 'div': '/'})
formula = [mapping[f] for f in formula]
return eval(''.join(formula))


import time

if __name__ == "__main__":
pass

Loading…
Cancel
Save