pub enum FnUpdate {
    Const(bool),
    Var(VariableId),
    Param(ParameterIdVec<VariableId>),
    Not(Box<FnUpdate>),
    Binary(BinaryOpBox<FnUpdate>, Box<FnUpdate>),
}
Expand description

A Boolean update function formula which references Variables and Parameters of a BooleanNetwork.

An update function specifies the evolution rules for one specific Variable of a BooleanNetwork. The arguments used in the function must be the same as specified by the RegulatoryGraph of the network.

Variants

Const(bool)

A true/false constant.

Var(VariableId)

References a network variable.

Param(ParameterIdVec<VariableId>)

References a network parameter (uninterpreted function).

The variable list are the arguments of the function invocation.

Not(Box<FnUpdate>)

Negation.

Binary(BinaryOpBox<FnUpdate>, Box<FnUpdate>)

Binary boolean operation.

Implementations

Convert a BooleanExpression to a FnUpdate, using RegulatoryGraph to resolve variable names.

Constructor and destructor utility methods. These mainly avoid unnecessary boxing and exhaustive pattern matching when not necessary.

Create a true formula.

Create a false formula.

Create an x formula where x is a Boolean variable.

Create a p(x_1, ..., x_k) formula where p is a parameter function and x_1 through x_k are its arguments.

Create a !phi formula, where phi is an inner FnUpdate.

Create a phi 'op' psi where phi and psi are arguments of op operator.

Negate this function.

Create a conjunction.

Create a disjunction.

Create an exclusive or.

Create an implication.

Create an equivalence.

If Const, return the value, otherwise return None.

If Var, return the id, otherwise return None.

If Param, return the id and args, otherwise return None.

If Not, return the inner function, otherwise return None.

If Binary, return the operator and left/right formulas, otherwise return None.

Other utility methods.

Return a sorted vector of all variables that are actually used as inputs in this function.

Return a sorted vector of all parameters (i.e. uninterpreted functions) that are used in this update function.

Convert this update function to a string, taking names from the provided BooleanNetwork.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.