chore: Code cleanup
This commit is contained in:
parent
07597c0ce6
commit
860b3c2134
|
@ -3,7 +3,7 @@ from typing import override, Optional
|
||||||
import collections, unittest
|
import collections, unittest
|
||||||
|
|
||||||
from pantograph.server import Server, TacticFailure
|
from pantograph.server import Server, TacticFailure
|
||||||
from pantograph.expr import Expr, Tactic, Goal, GoalState
|
from pantograph.expr import Expr, Tactic, GoalState
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
@ -27,7 +27,6 @@ class SearchState:
|
||||||
return all(self.solved)
|
return all(self.solved)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Agent:
|
class Agent:
|
||||||
|
|
||||||
def next_tactic(self, state: GoalState, goal_id: int) -> Optional[Tactic]:
|
def next_tactic(self, state: GoalState, goal_id: int) -> Optional[Tactic]:
|
||||||
|
@ -121,6 +120,7 @@ class Agent:
|
||||||
self.reset()
|
self.reset()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
class DumbAgent(Agent):
|
class DumbAgent(Agent):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -159,6 +159,7 @@ class DumbAgent(Agent):
|
||||||
self.goal_tactic_id_map[key] = i + 1
|
self.goal_tactic_id_map[key] = i + 1
|
||||||
return tactics[i]
|
return tactics[i]
|
||||||
|
|
||||||
|
|
||||||
class TestSearch(unittest.TestCase):
|
class TestSearch(unittest.TestCase):
|
||||||
|
|
||||||
def test_solve(self):
|
def test_solve(self):
|
||||||
|
@ -175,5 +176,6 @@ class TestSearch(unittest.TestCase):
|
||||||
flag = agent.search(server=server, target="∀ (p q: Prop), Or p q -> Or q p", verbose=True)
|
flag = agent.search(server=server, target="∀ (p q: Prop), Or p q -> Or q p", verbose=True)
|
||||||
self.assertTrue(flag)
|
self.assertTrue(flag)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue