To Newclid

build_newclid_problem(problem, defs, rng, max_attempts_per_clause, include_auxiliary_clauses)

Build a JGEX problem by finding coordinates for the points given the clauses constraints.

Return type:

tuple[ProblemSetup, dict[JGEXClause, JGEXClauseConsequences]]

add_clause_to_problem(problem, clause, defs, rng, max_attempts)

Add a clause to a problem, returning the new problem and the consequences of the clause.

Raises:

JGEXConstructionError – If the clause cannot be added to the problem after max_attempts.

Return type:

tuple[ProblemSetup, JGEXClauseConsequences]

class JGEXClauseConsequences(**data)

Bases: BaseModel

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.

new_points: dict[PredicateArgument, JGEXPoint]
construction_consequences: list[JGEXConstructionConsequences]
numerical_requirements: list[PredicateConstruction]
to_assumptions()
Return type:

tuple[PredicateConstruction, ...]

model_config: ClassVar[ConfigDict] = {}

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

rename_points_in_clause_consequences(clause_consequences, mapping)
Return type:

JGEXClauseConsequences

class JGEXConstructionConsequences(**data)

Bases: BaseModel

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.

required_predicates: list[PredicateConstruction]
added_predicates: list[PredicateConstruction]
to_assumptions()
Return type:

tuple[PredicateConstruction, ...]

model_config: ClassVar[ConfigDict] = {}

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

rename_points_in_construction_consequences(construction_consequences, mapping)
Return type:

JGEXConstructionConsequences