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, read as it arrived. A piecewise: or sos: block is read as the rows it states, so the answer is the one its expansion gets, with nothing expanded.

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`, read as it arrived. A ``piecewise:`` or ``sos:``
            block is read as the rows it states, so the answer is the one its
            expansion gets, with nothing expanded.

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