Skip to main content

PrologArith

Struct PrologArith 

Source
pub struct PrologArith;
Expand description

Build an arithmetic expression for use in X is Expr.

Implementations§

Source§

impl PrologArith

Source

pub fn add(x: PrologTerm, y: PrologTerm) -> PrologTerm

Add: X + Y.

Source

pub fn sub(x: PrologTerm, y: PrologTerm) -> PrologTerm

Sub: X - Y.

Source

pub fn mul(x: PrologTerm, y: PrologTerm) -> PrologTerm

Mul: X * Y.

Source

pub fn idiv(x: PrologTerm, y: PrologTerm) -> PrologTerm

Div: X // Y — integer division.

Source

pub fn mmod(x: PrologTerm, y: PrologTerm) -> PrologTerm

Mod: X mod Y.

Source

pub fn abs(x: PrologTerm) -> PrologTerm

Absolute value: abs(X).

Source

pub fn max(x: PrologTerm, y: PrologTerm) -> PrologTerm

Max: max(X, Y).

Source

pub fn min(x: PrologTerm, y: PrologTerm) -> PrologTerm

Min: min(X, Y).

Source

pub fn pow(x: PrologTerm, y: PrologTerm) -> PrologTerm

Exponentiation: X ^ Y.

Source

pub fn sqrt(x: PrologTerm) -> PrologTerm

Square root: sqrt(X).

Source

pub fn truncate(x: PrologTerm) -> PrologTerm

Truncate: truncate(X).

Source

pub fn round(x: PrologTerm) -> PrologTerm

Round: round(X).

Source

pub fn sign(x: PrologTerm) -> PrologTerm

Sign: sign(X).

Source

pub fn bitand(x: PrologTerm, y: PrologTerm) -> PrologTerm

Bitwise AND: X /\ Y.

Source

pub fn bitor(x: PrologTerm, y: PrologTerm) -> PrologTerm

Bitwise OR: X \/ Y.

Source

pub fn xor(x: PrologTerm, y: PrologTerm) -> PrologTerm

Bitwise XOR: X xor Y.

Source

pub fn shl(x: PrologTerm, y: PrologTerm) -> PrologTerm

Left shift: X << Y.

Source

pub fn shr(x: PrologTerm, y: PrologTerm) -> PrologTerm

Right shift: X >> Y.

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.