Struct miniscript::miniscript::types::correctness::Correctness
source · pub struct Correctness {
pub base: Base,
pub input: Input,
pub dissatisfiable: bool,
pub unit: bool,
}
Expand description
Structure representing the type properties of a fragment which are relevant to completeness (are all expected branches actually accessible, given some valid witness) and soundness (is it possible to satisfy the Script without satisfying one of the Miniscript branches).
Fields§
§base: Base
The base type
input: Input
Properties of the inputs
dissatisfiable: bool
Whether it is definitely possible to dissatisfy the expression.
If this is false, it does not necessarily mean that dissatisfaction
is impossible (see Dissat::None
for this property); it only means
that we cannot depend on having a dissatisfaction when reasoning
about completeness.
unit: bool
Whether the fragment’s “nonzero” output on satisfaction is always the constant 1.
Implementations§
source§impl Correctness
impl Correctness
sourcepub const fn is_subtype(&self, other: Self) -> bool
pub const fn is_subtype(&self, other: Self) -> bool
Check whether the self
is a subtype of other
argument .
This checks whether the argument other
has attributes which are present
in the given Type
. This returns true
on same arguments
a.is_subtype(a)
is true
.
sourcepub fn sanity_checks(&self)
pub fn sanity_checks(&self)
Confirm invariants of the correctness checker.
sourcepub const fn multi_a() -> Self
pub const fn multi_a() -> Self
Constructor for the correctness properties of the multi_a
fragment.
sourcepub const fn hash() -> Self
pub const fn hash() -> Self
Constructor for the correctness properties of any of the hash fragments.
sourcepub const fn time() -> Self
pub const fn time() -> Self
Constructor for the correctness properties of either of the time fragments.
sourcepub const fn cast_alt(self) -> Result<Self, ErrorKind>
pub const fn cast_alt(self) -> Result<Self, ErrorKind>
Constructor for the correctness properties of the a:
fragment.
sourcepub const fn cast_swap(self) -> Result<Self, ErrorKind>
pub const fn cast_swap(self) -> Result<Self, ErrorKind>
Constructor for the correctness properties of the s:
fragment.
sourcepub const fn cast_check(self) -> Result<Self, ErrorKind>
pub const fn cast_check(self) -> Result<Self, ErrorKind>
Constructor for the correctness properties of the c:
fragment.
sourcepub const fn cast_dupif(self) -> Result<Self, ErrorKind>
pub const fn cast_dupif(self) -> Result<Self, ErrorKind>
Constructor for the correctness properties of the d:
fragment.
sourcepub const fn cast_verify(self) -> Result<Self, ErrorKind>
pub const fn cast_verify(self) -> Result<Self, ErrorKind>
Constructor for the correctness properties of the v:
fragment.
sourcepub const fn cast_nonzero(self) -> Result<Self, ErrorKind>
pub const fn cast_nonzero(self) -> Result<Self, ErrorKind>
Constructor for the correctness properties of the j:
fragment.
sourcepub const fn cast_zeronotequal(self) -> Result<Self, ErrorKind>
pub const fn cast_zeronotequal(self) -> Result<Self, ErrorKind>
Constructor for the correctness properties of the n:
fragment.
sourcepub const fn cast_true(self) -> Result<Self, ErrorKind>
pub const fn cast_true(self) -> Result<Self, ErrorKind>
Constructor for the correctness properties of the t:
fragment.
sourcepub const fn cast_or_i_false(self) -> Result<Self, ErrorKind>
pub const fn cast_or_i_false(self) -> Result<Self, ErrorKind>
Constructor for the correctness properties of the l:
and u:
fragments.
sourcepub const fn and_b(left: Self, right: Self) -> Result<Self, ErrorKind>
pub const fn and_b(left: Self, right: Self) -> Result<Self, ErrorKind>
Constructor for the correctness properties of the and_b
fragment
sourcepub const fn and_v(left: Self, right: Self) -> Result<Self, ErrorKind>
pub const fn and_v(left: Self, right: Self) -> Result<Self, ErrorKind>
Constructor for the correctness properties of the and_v
fragment
sourcepub const fn or_b(left: Self, right: Self) -> Result<Self, ErrorKind>
pub const fn or_b(left: Self, right: Self) -> Result<Self, ErrorKind>
Constructor for the correctness properties of the or_b
fragment
sourcepub const fn or_d(left: Self, right: Self) -> Result<Self, ErrorKind>
pub const fn or_d(left: Self, right: Self) -> Result<Self, ErrorKind>
Constructor for the correctness properties of the or_d
fragment
sourcepub const fn or_c(left: Self, right: Self) -> Result<Self, ErrorKind>
pub const fn or_c(left: Self, right: Self) -> Result<Self, ErrorKind>
Constructor for the correctness properties of the or_c
fragment
sourcepub const fn or_i(left: Self, right: Self) -> Result<Self, ErrorKind>
pub const fn or_i(left: Self, right: Self) -> Result<Self, ErrorKind>
Constructor for the correctness properties of the or_i
fragment
Trait Implementations§
source§impl Clone for Correctness
impl Clone for Correctness
source§fn clone(&self) -> Correctness
fn clone(&self) -> Correctness
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Correctness
impl Debug for Correctness
source§impl Hash for Correctness
impl Hash for Correctness
source§impl Ord for Correctness
impl Ord for Correctness
source§fn cmp(&self, other: &Correctness) -> Ordering
fn cmp(&self, other: &Correctness) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for Correctness
impl PartialEq for Correctness
source§fn eq(&self, other: &Correctness) -> bool
fn eq(&self, other: &Correctness) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for Correctness
impl PartialOrd for Correctness
source§fn partial_cmp(&self, other: &Correctness) -> Option<Ordering>
fn partial_cmp(&self, other: &Correctness) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more