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.

TYPE: str | Path | dict[str, Any] | 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 | dict[str, Any] | 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.

    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))