Skip to content

math_spec.advice

Advice — what is decidable without data and is a note rather than a refusal.

One door, :func:advice, over every pass of that kind.

advice(model) #

Everything the language advises about model — never an error, decidable without data.

PARAMETER DESCRIPTION
model

A YAML path, a mapping, a loaded :class:Spec, or a :class:Program. Both passes read the program, so the four answer alike, and a piecewise: block still in the model is refused as :func:~math_spec.lowering.to_program refuses it.

TYPE: str | Path | Mapping[str, object] | Spec | Program

RETURNS DESCRIPTION
Advice

The never-an-axis advice in declaration order, then the unboundedness

...

advice; str() of each is its sentence.

Source code in src/math_spec/advice.py
def advice(model: str | Path | Mapping[str, object] | Spec | Program) -> tuple[Advice, ...]:
    """Everything the language advises about *model* — never an error, decidable without data.

    Args:
        model: A YAML path, a mapping, a loaded :class:`Spec`, or a
            :class:`Program`. Both passes read the program, so the four
            answer alike, and a ``piecewise:`` block still in the model is
            refused as :func:`~math_spec.lowering.to_program` refuses it.

    Returns:
        The never-an-axis advice in declaration order, then the unboundedness
        advice; ``str()`` of each is its sentence.
    """
    program = to_program(model)
    return tuple(_never_an_axis(program) + unbounded_notes(program))