AngouriMath

Navigation

BudgetRecording


← Back to list of classes

Description

Summary

Collects what each bounded computation spent while it is open, so that an answer can
be asked why it stopped rather than only what it is.

Remarks

A scope rather than a setting, and off unless asked for. With no recording open, a
bounded computation costs one ambient read more than it did — per computation, not
per step — and allocates nothing. A caller who never mentions budgets pays for none
of this, which is the condition
#746 puts on
anything added above the tree.
It exists because the reason has further to travel than the return value does.
Solve hands back a set; a set has no room in it for "the Gröbner path declined
on the quotient dimension and the fall-through answered instead", and widening every
signature between here and there to carry a reason nobody usually wants is a poor
trade. A scope reaches the caller across those signatures without changing any of
them.
Per flow, like Settings and
RewriteRecording: the recording
belongs to the call rather than to the thread running it, so it survives an
await, and a recording opened inside a task is invisible to that
task's siblings. Order across flows is not guaranteed; within one it is the order
the computations finished in.

Example

using AngouriMath;
using AngouriMath.Core.Budgets;
            
using var recording = BudgetRecording.Start();
var solutions = MathS.Equations("x2 + y2 - 4", "x y - 1").Solve("x", "y");
foreach (var outcome in recording.Outcomes)
    Console.WriteLine(outcome);

Members

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online