Skip to main content

BuiltinResult

Enum BuiltinResult 

Source
pub enum BuiltinResult {
Show 29 variants Success, Failure, Cut, NegationAsFailure(Term), Disjunction(Term, Term), IfThenElse(Term, Term, Term), IfThen(Term, Term), Conjunction(Term, Term), FindAll(Term, Term, Term), Once(Term), Call(Term), AtomLength(Term, Term), AtomConcat(Term, Term, Term), AtomChars(Term, Term), Write(Term), Writeln(Term), Nl, Compare(Term, Term, Term), Functor(Term, Term, Term), Arg(Term, Term, Term), Univ(Term, Term), Between(Term, Term, Term), CopyTerm(Term, Term), Succ(Term, Term), Plus(Term, Term, Term), MSort(Term, Term), Sort(Term, Term), NumberChars(Term, Term), NumberCodes(Term, Term),
}
Expand description

Result of executing a builtin.

Variants§

§

Success

The builtin succeeded (substitution may have been modified).

§

Failure

The builtin failed.

§

Cut

Cut: succeed and signal cut to the solver.

§

NegationAsFailure(Term)

Negation-as-failure: the solver needs to try the inner goal.

§

Disjunction(Term, Term)

Disjunction: try left, then right on backtracking.

§

IfThenElse(Term, Term, Term)

If-then-else: ;(->(Cond, Then), Else)

§

IfThen(Term, Term)

If-then (no else): ->(Cond, Then)

§

Conjunction(Term, Term)

Conjunction: ‘,’(A, B) — flatten into goal list.

§

FindAll(Term, Term, Term)

findall/3: Template, Goal, Result list.

§

Once(Term)

once/1: solve goal, take first solution only.

§

Call(Term)

call/1: execute a term as a goal.

§

AtomLength(Term, Term)

atom_length/2: atom, length

§

AtomConcat(Term, Term, Term)

atom_concat/3: atom1, atom2, result

§

AtomChars(Term, Term)

atom_chars/2: atom, char list

§

Write(Term)

write/1: write term to stdout (no newline).

§

Writeln(Term)

writeln/1: write term to stdout with newline.

§

Nl

nl/0: write newline to stdout.

§

Compare(Term, Term, Term)

compare/3: Order, Term1, Term2 — standard term ordering.

§

Functor(Term, Term, Term)

functor/3: Term, Name, Arity.

§

Arg(Term, Term, Term)

arg/3: N, Term, Arg.

§

Univ(Term, Term)

=../2: Term, List (univ).

§

Between(Term, Term, Term)

between/3: Low, High, X — integer enumeration.

§

CopyTerm(Term, Term)

copy_term/2: Original, Copy.

§

Succ(Term, Term)

succ/2: X, S — successor relation.

§

Plus(Term, Term, Term)

plus/3: X, Y, Z — addition relation.

§

MSort(Term, Term)

msort/2: List, Sorted.

§

Sort(Term, Term)

sort/2: List, Sorted.

§

NumberChars(Term, Term)

number_chars/2: Number, Chars.

§

NumberCodes(Term, Term)

number_codes/2: Number, Codes.

Trait Implementations§

Source§

impl Debug for BuiltinResult

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.