Evaluates a Prolog arithmetic expression term to an Elixir number
under bindings -- is/2's own right-hand side, and both sides of
every arithmetic comparison (numeric_equal/2, </2, ...). Raises (via
Episteme.Builtins.Exceptions.prolog_throw/1) a standard type_error
for anything that isn't a number, a bound variable, or a recognized
evaluable functor.
Also dispatch/3, wired into Episteme.Engine's builtin-dispatch
chain the same way Episteme.Builtins.Lists/Episteme.Builtins.Io
are: between/3, the one integer-generating goal in this family
(everything else here is a plain expression evaluator, not a
backtracking goal).
Summary
Functions
@spec compare(term(), term(), Ichor.Backtrack.Bindings.t(), (number(), number() -> boolean())) :: boolean()
is/2, numeric_equal/2, </2 and friends share this: evaluate both sides then apply cmp.
@spec dispatch(atom(), non_neg_integer(), [term()]) :: Ichor.Backtrack.goal() | :not_handled
@spec eval(term(), Ichor.Backtrack.Bindings.t()) :: number()