curry.backends.cxx.cyrtbindings package

Python bindings for libcyrt.so.

class curry.backends.cxx.cyrtbindings.RuntimeState(interp, goal=None)[source]

Bases: RuntimeStateBase

generate_values()[source]

Generates the values of the goal.

The Curry program writes to the C standard output, and Python writes to sys.stdout. Both buffers share one file descriptor. Python’s buffer is flushed before the scheduler runs, and the C buffer when the scheduler returns (see the next binding), so the output keeps its order.

The step limit of the stepper (stepcounter) ends the evaluation with E_TERMINATE, the flow-control exception of the generic evaluator, as on the Python backend.

single_step(node)[source]

One rewrite step at the root of node (see evaluator.single_step). A step that reports an error raises it as the evaluation would.

property stepcounter

a view of this state.

Type:

The step counter of the generic evaluator

class curry.backends.cxx.cyrtbindings.StepCounter(rts)[source]

Bases: object

The step counter of the generic evaluator over a C++ runtime state.

Evaluator.set_global_step_limit and the telemetry read the counter of the Python backend (generic.eval.stepcounter.StepCounter) as rts.stepcounter; this object answers for the C++ state through its fields steps_total and step_limit. The count and the limit are relative to the last reset (_step_base of the state), and the totals of the state keep every step. A limit at or below the count raises E_TERMINATE at once, as the counter of the Python backend does; else the scheduler returns E_TERMINATE after the step that reaches the limit (cyrt/state/rts.hpp), and generate_values raises it.

A view: rts.stepcounter makes one per access, and the state holds no counter. A counter kept by the state made a reference cycle, which delayed the destruction of the state of evaluator.single_step until the cyclic collector ran; a live state is a root of the collector, so the history of a search stayed reachable (test_repl_eval_under_stress of unit_goals.py grew with the square of its length).

property global_count

The steps taken since the last reset.

property global_limit
reset_global()[source]
curry.backends.cxx.cyrtbindings.make_node(info, *args, **kwds)[source]

Submodules