2024-05-31 17:09:12 -07:00
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
|
|
class TacticInvocation:
|
2024-10-20 09:52:12 -07:00
|
|
|
"""
|
|
|
|
One tactic invocation with the before/after goals extracted from Lean source
|
|
|
|
code.
|
|
|
|
"""
|
2024-05-31 17:09:12 -07:00
|
|
|
before: str
|
|
|
|
after: str
|
|
|
|
tactic: str
|
2024-11-11 21:02:02 -08:00
|
|
|
used_constants: list[str]
|
2024-05-31 17:09:12 -07:00
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def parse(payload: dict):
|
2024-11-11 21:02:02 -08:00
|
|
|
return TacticInvocation(
|
|
|
|
before=payload["goalBefore"],
|
|
|
|
after=payload["goalAfter"],
|
|
|
|
tactic=payload["tactic"],
|
|
|
|
used_constants=payload.get('usedConstants', []),
|
|
|
|
)
|