pub trait CoreConstructible: Sized {
Show 22 methods
// Required methods
fn iden(inference_context: &Context) -> Self;
fn unit(inference_context: &Context) -> Self;
fn injl(child: &Self) -> Self;
fn injr(child: &Self) -> Self;
fn take(child: &Self) -> Self;
fn drop_(child: &Self) -> Self;
fn comp(left: &Self, right: &Self) -> Result<Self, Error>;
fn case(left: &Self, right: &Self) -> Result<Self, Error>;
fn assertl(left: &Self, right: Cmr) -> Result<Self, Error>;
fn assertr(left: Cmr, right: &Self) -> Result<Self, Error>;
fn pair(left: &Self, right: &Self) -> Result<Self, Error>;
fn fail(inference_context: &Context, entropy: FailEntropy) -> Self;
fn const_word(inference_context: &Context, word: Word) -> Self;
fn inference_context(&self) -> &Context;
// Provided methods
fn scribe(ctx: &Context, value: &Value) -> Self { ... }
fn bit_false(inference_context: &Context) -> Self { ... }
fn bit_true(inference_context: &Context) -> Self { ... }
fn cond(left: &Self, right: &Self) -> Result<Self, Error> { ... }
fn assert(child: &Self, hash: Cmr) -> Result<Self, Error> { ... }
fn not(child: &Self) -> Result<Self, Error> { ... }
fn and(left: &Self, right: &Self) -> Result<Self, Error> { ... }
fn or(left: &Self, right: &Self) -> Result<Self, Error> { ... }
}
Required Methods§
fn iden(inference_context: &Context) -> Self
fn unit(inference_context: &Context) -> Self
fn injl(child: &Self) -> Self
fn injr(child: &Self) -> Self
fn take(child: &Self) -> Self
fn drop_(child: &Self) -> Self
fn comp(left: &Self, right: &Self) -> Result<Self, Error>
fn case(left: &Self, right: &Self) -> Result<Self, Error>
fn assertl(left: &Self, right: Cmr) -> Result<Self, Error>
fn assertr(left: Cmr, right: &Self) -> Result<Self, Error>
fn pair(left: &Self, right: &Self) -> Result<Self, Error>
fn fail(inference_context: &Context, entropy: FailEntropy) -> Self
fn const_word(inference_context: &Context, word: Word) -> Self
Sourcefn inference_context(&self) -> &Context
fn inference_context(&self) -> &Context
Accessor for the type inference context used to create the object.
Provided Methods§
Sourcefn scribe(ctx: &Context, value: &Value) -> Self
fn scribe(ctx: &Context, value: &Value) -> Self
Create an expression that produces the given value
.
The expression is minimized by using as many word jets as possible.
Sourcefn bit_false(inference_context: &Context) -> Self
fn bit_false(inference_context: &Context) -> Self
Create a DAG that takes any input and returns bit 0
as constant output.
Overall type: A → 2
Sourcefn bit_true(inference_context: &Context) -> Self
fn bit_true(inference_context: &Context) -> Self
Create a DAG that takes any input and returns bit 1
as constant output.
Overall type: A → 2
Sourcefn cond(left: &Self, right: &Self) -> Result<Self, Error>
fn cond(left: &Self, right: &Self) -> Result<Self, Error>
Create a DAG that takes a bit and an input,
such that the left
child is evaluated on the input if the bit is 1
(if branch)
and the right
child is evaluated on the input otherwise (else branch).
Overall type: 2 × A → B where left
: A → B and right
: A → B
Type inference will fail if children are not of the correct type.
Sourcefn assert(child: &Self, hash: Cmr) -> Result<Self, Error>
fn assert(child: &Self, hash: Cmr) -> Result<Self, Error>
Create a DAG that asserts that its child returns true
, and fails otherwise.
The hash
identifies the assertion and is returned upon failure.
Overall type: A → 1 where child
: A → 2
Type inference will fail if children are not of the correct type.
Sourcefn not(child: &Self) -> Result<Self, Error>
fn not(child: &Self) -> Result<Self, Error>
Create a DAG that computes Boolean NOT of the child
.
Overall type: A → 2 where child
: A → 2
Type inference will fail if children are not of the correct type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.