Api
External API for Newclid.
This module contains the main entry point for building and using a geometric solver.
- class GeometricSolver(proof, rules, deductive_agent)
Bases:
object
External API for solving a geometric problem.
- run()
- Return type:
bool
- proof(goals_constructions=None)
- Return type:
str
- animate(jgex_problem=None, theme=None)
- Return type:
FuncAnimation
- draw_figure(*, out_file=None, jgex_problem, theme=None)
- Return type:
tuple
[Figure
,Axes
]
- write_all_outputs(out_folder_path, jgex_problem)
- class ProblemBuilder
Bases:
ABC
Interface for building a problem.
- abstractmethod build()
Build a problem to be fed to the solver.
- Return type:
- class PythonDefault(use_sympy_ar=True)
Bases:
APIDefault
- default_rule_matcher()
Return the default rule matcher for the API.
- Return type:
- default_deductive_agent()
Return the default deductive agent for the API.
- Return type:
- callback(proof_state)
Callback function to be called after each step of the proof.
- Return type:
None
- class GeometricSolverBuilder(rng=None, api_default=None)
Bases:
object
Main entry point for building a geometric solver.
Adding or removing methods should be done with care as it represents the external API and should be stable.
- build(problem_setup)
Build a geometric solver with the current configuration on the given problem setup.
- Return type:
- with_deductive_agent(deductive_agent)
- Return type:
Self
- with_rule_matcher(rule_matcher)
- Return type:
Self
- with_deductors(deductors)
- Return type:
Self
- with_rules(rules)
- Return type:
Self
- with_rules_from_file(rules_path)
- Return type:
Self