Formulation

Implements objects to represent problems, theorems, proofs, traceback.

class JGEXFormulation(**data)

Bases: BaseModel

Describe one problem to solve.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

name: str
setup_clauses: tuple[JGEXClause, ...]
auxiliary_clauses: tuple[JGEXClause, ...]
goals: tuple[PredicateConstruction, ...]
formulation_type: Literal['jgex']
property clauses: tuple[JGEXClause, ...]
classmethod from_text(text)

Load a problem from a string.

Return type:

JGEXFormulation

property points: tuple[PredicateArgument, ...]
renamed(mapping)
Return type:

JGEXFormulation

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

jgex_formulation_from_txt_file(fname)
Return type:

dict[str, JGEXFormulation]

alphabetize(problem)

Alphabetize the problem by renaming the points such that the points are in alphabetical order by construction order.

Returns the renamed problem and the mapping from the alphabetized points to the original points.

Return type:

tuple[JGEXFormulation, dict[NewType(PredicateArgument, str), NewType(PredicateArgument, str)]]