Documentation
¶
Overview ¶
Package paper is the key of a task from the learner's paper: the solver, which computes the answer of arithmetic and of an equation in one unknown from the formula AI read of the statement, exactly and without Starlark or the network; the rules an answer of AI holds before it is a key; and the item and the values by which the package observation judges the reading of the work against the key, as on a task of a module (R69).
Solve gives the solver's answer or why it does not take the formula, Breach the rule an answer of AI breaks, Key the key of an attempt with its provenance, Items the task's one item by the answer of its key, and Brought and BroughtValue the values read brought to it. The formula, the solver, the answer, the key and the verdict are those of spec's contracts, whose test vectors the package passes.
Index ¶
- func Brought(answer *paperv1.Answer, o *observationv1.Observation) *observationv1.Observation
- func BroughtValue(answer *paperv1.Answer, value string) string
- func Items(answer *paperv1.Answer) []formatv0.Item
- func Key(solved *paperv1.Number, ofAI *paperv1.Answer) *paperv1.TaskKey
- type Reason
- type Rule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Brought ¶
func Brought(answer *paperv1.Answer, o *observationv1.Observation) *observationv1.Observation
Brought gives a copy of an observation with each value brought to the key, so that the join of two readings compares x = 4 and 4 as the same value.
func BroughtValue ¶
BroughtValue gives a value read brought to the key: x = 4 as 4 when the key's unknown is x, and (C) as C of a choice; any other value as it is.
func Items ¶
Items gives the task's one item by the answer of its key: one answer slot bound anywhere, with the check kind number or choice written by hand, and no trap values. With them, the package observation joins and judges the readings of the work as on a task of a module, once Brought has brought their values to the key.
An answer of no kind, nil too, is a task with no key, and gives no item: no check can be written of it, and the package observation judges none. Its item is unchecked, which the caller gives it without the package observation.
func Key ¶
Key gives the key of one task of an attempt, with no statement, which the caller sets: the solver's answer with the provenance of the solver, when there is one, or else the answer of AI with the provenance of AI when it breaks no rule. With neither the key has no answer and no provenance, which says the task has none.
Types ¶
type Reason ¶
type Reason string
Reason is why the solver does not take a formula, as the contracts text names it.
const ( Syntax Reason = "syntax" // not of the grammar, too long, a number of more than 15 digits or an exponent above 10 TwoUnknowns Reason = "two_unknowns" // two letters or more UnknownInExpression Reason = "unknown_in_expression" // an expression with an unknown NoUnknown Reason = "no_unknown" // an equation with no unknown NotLinear Reason = "not_linear" // the unknown times itself, in a divisor, or to 2 or more DivisionByZero Reason = "division_by_zero" // a division by zero TooLarge Reason = "too_large" // a part of more than 100 digits on the way, or an answer longer than 16 characters NoRoot Reason = "no_root" // an equation no number solves EveryRoot Reason = "every_root" // an equation every number solves )
The reasons, in the order the solver names the first that applies: syntax, then the letters, then those of the operations as they are done, then the root, and last too_large of the answer.
type Rule ¶
type Rule string
Rule is a rule of an answer of AI that the answer breaks, as the vectors name it.
const ( NoKind Rule = "no_kind" // neither a number nor a choice Value Rule = "value" // a number not in the notation of number, or longer than 16 characters UnitsEmpty Rule = "units_empty" // a unit empty once it went through the steps of units UnitsSame Rule = "units_same" // two units the same then Unknown Rule = "unknown" // an unknown that is not one letter from a to z OptionsCount Rule = "options_count" // fewer than 2 options, or more than 10 OptionLength Rule = "option_length" // a label of fewer than 1 character or more than 16 OptionsSame Rule = "options_same" // a label empty, or two the same, once normalized as a choice ChoiceKey Rule = "choice_key" // a key that is none of the options as written )
The rules of an answer, in the order Breach checks them.