Skip to main content

Expression

Enum Expression 

Source
pub enum Expression {
Show 114 variants AbstractLiteral(Metadata, AbstractLiteral<Expression>), Root(Metadata, Vec<Expression>), Bubble(Metadata, Moo<Expression>, Moo<Expression>), Comprehension(Metadata, Moo<Comprehension>), DominanceRelation(Metadata, Moo<Expression>), FromSolution(Metadata, Moo<Atom>), Metavar(Metadata, Ustr), Atomic(Metadata, Atom), TypeAnnotation(Metadata, Moo<Expression>, DomainPtr), DomainAnnotation(Metadata, Moo<Expression>, DomainPtr), Active(Metadata, Moo<Expression>, Name), RecordField(Metadata, Moo<Expression>, Name), UnsafeIndex(Metadata, Moo<Expression>, Vec<Expression>), SafeIndex(Metadata, Moo<Expression>, Vec<Expression>), UnsafeSlice(Metadata, Moo<Expression>, Vec<Option<Expression>>), SafeSlice(Metadata, Moo<Expression>, Vec<Option<Expression>>), InDomain(Metadata, Moo<Expression>, DomainPtr), ToInt(Metadata, Moo<Expression>), Abs(Metadata, Moo<Expression>), Sum(Metadata, Moo<Expression>), Product(Metadata, Moo<Expression>), Min(Metadata, Moo<Expression>), Max(Metadata, Moo<Expression>), Not(Metadata, Moo<Expression>), Or(Metadata, Moo<Expression>), And(Metadata, Moo<Expression>), Imply(Metadata, Moo<Expression>, Moo<Expression>), Iff(Metadata, Moo<Expression>, Moo<Expression>), Union(Metadata, Moo<Expression>, Moo<Expression>), In(Metadata, Moo<Expression>, Moo<Expression>), Intersect(Metadata, Moo<Expression>, Moo<Expression>), Difference(Metadata, Moo<Expression>, Moo<Expression>), Supset(Metadata, Moo<Expression>, Moo<Expression>), SupsetEq(Metadata, Moo<Expression>, Moo<Expression>), Subset(Metadata, Moo<Expression>, Moo<Expression>), SubsetEq(Metadata, Moo<Expression>, Moo<Expression>), Eq(Metadata, Moo<Expression>, Moo<Expression>), Neq(Metadata, Moo<Expression>, Moo<Expression>), Geq(Metadata, Moo<Expression>, Moo<Expression>), Leq(Metadata, Moo<Expression>, Moo<Expression>), Gt(Metadata, Moo<Expression>, Moo<Expression>), Lt(Metadata, Moo<Expression>, Moo<Expression>), Subsequence(Metadata, Moo<Expression>, Moo<Expression>), Substring(Metadata, Moo<Expression>, Moo<Expression>), CatchUndef(Metadata, Moo<Expression>, Moo<Expression>), SafeDiv(Metadata, Moo<Expression>, Moo<Expression>), UnsafeDiv(Metadata, Moo<Expression>, Moo<Expression>), SafeMod(Metadata, Moo<Expression>, Moo<Expression>), UnsafeMod(Metadata, Moo<Expression>, Moo<Expression>), Neg(Metadata, Moo<Expression>), Factorial(Metadata, Moo<Expression>), Defined(Metadata, Moo<Expression>), Range(Metadata, Moo<Expression>), ToSet(Metadata, Moo<Expression>), ToMSet(Metadata, Moo<Expression>), ToRelation(Metadata, Moo<Expression>), UnsafePow(Metadata, Moo<Expression>, Moo<Expression>), SafePow(Metadata, Moo<Expression>, Moo<Expression>), Flatten(Metadata, Option<Moo<Expression>>, Moo<Expression>), AttributeAsConstraint(Metadata, Moo<Expression>, Ustr, Option<Moo<Expression>>), AllDiff(Metadata, Moo<Expression>), SmtDistinct(Metadata, Moo<Expression>), AllDifferentExcept(Metadata, Moo<Expression>, Moo<Expression>), ElementId(Metadata, Moo<Expression>, Moo<Expression>), Table(Metadata, Moo<Expression>, Moo<Expression>), NegativeTable(Metadata, Moo<Expression>, Moo<Expression>), AtLeast(Metadata, Moo<Expression>, Moo<Expression>, Moo<Expression>), AtMost(Metadata, Moo<Expression>, Moo<Expression>, Moo<Expression>), Gcc(Metadata, Moo<Expression>, Moo<Expression>, Moo<Expression>), GccWeak(Metadata, Moo<Expression>, Moo<Expression>, Moo<Expression>), Minus(Metadata, Moo<Expression>, Moo<Expression>), Apart(Metadata, Moo<Expression>, Moo<Expression>), Participants(Metadata, Moo<Expression>), Party(Metadata, Moo<Expression>, Moo<Expression>), Parts(Metadata, Moo<Expression>), Together(Metadata, Moo<Expression>, Moo<Expression>), FlatAbsEq(Metadata, Moo<Atom>, Moo<Atom>), FlatAllDiff(Metadata, Vec<Atom>), FlatMinEq(Metadata, Vec<Atom>, Atom), FlatSumGeq(Metadata, Vec<Atom>, Atom), FlatSumLeq(Metadata, Vec<Atom>, Atom), FlatIneq(Metadata, Moo<Atom>, Moo<Atom>, Box<Literal>), FlatWatchedLiteral(Metadata, Reference, Literal), FlatWeightedSumLeq(Metadata, Vec<Literal>, Vec<Atom>, Moo<Atom>), FlatWeightedSumGeq(Metadata, Vec<Literal>, Vec<Atom>, Moo<Atom>), FlatMinusEq(Metadata, Moo<Atom>, Moo<Atom>), FlatProductEq(Metadata, Moo<Atom>, Moo<Atom>, Moo<Atom>), MinionDivEqUndefZero(Metadata, Moo<Atom>, Moo<Atom>, Moo<Atom>), MinionModuloEqUndefZero(Metadata, Moo<Atom>, Moo<Atom>, Moo<Atom>), MinionPow(Metadata, Moo<Atom>, Moo<Atom>, Moo<Atom>), MinionReify(Metadata, Moo<Expression>, Atom), MinionReifyImply(Metadata, Moo<Expression>, Atom), MinionWInIntervalSet(Metadata, Atom, Vec<i32>), MinionWInSet(Metadata, Atom, Vec<i32>), MinionElementOne(Metadata, Vec<Atom>, Moo<Atom>, Moo<Atom>), AuxDeclaration(Metadata, Reference, Moo<Expression>), SATInt(Metadata, SATIntEncoding, Moo<Expression>, (i32, i32)), PairwiseSum(Metadata, Moo<Expression>, Moo<Expression>), PairwiseProduct(Metadata, Moo<Expression>, Moo<Expression>), Image(Metadata, Moo<Expression>, Moo<Expression>), ImageSet(Metadata, Moo<Expression>, Moo<Expression>), PreImage(Metadata, Moo<Expression>, Moo<Expression>), Inverse(Metadata, Moo<Expression>, Moo<Expression>), PermInverse(Metadata, Moo<Expression>), Compose(Metadata, Moo<Expression>, Moo<Expression>), Restrict(Metadata, Moo<Expression>, Moo<Expression>), LexLt(Metadata, Moo<Expression>, Moo<Expression>), LexLeq(Metadata, Moo<Expression>, Moo<Expression>), LexGt(Metadata, Moo<Expression>, Moo<Expression>), LexGeq(Metadata, Moo<Expression>, Moo<Expression>), FlatLexLt(Metadata, Vec<Atom>, Vec<Atom>), FlatLexLeq(Metadata, Vec<Atom>, Vec<Atom>), RelationProj(Metadata, Moo<Expression>, Vec<Option<Expression>>), Card(Metadata, Moo<Expression>),
}
Expand description

Variants§

§

AbstractLiteral(Metadata, AbstractLiteral<Expression>)

§

Root(Metadata, Vec<Expression>)

The top of the model

§

Bubble(Metadata, Moo<Expression>, Moo<Expression>)

An expression representing “A is valid as long as B is true” Turns into a conjunction when it reaches a boolean context

§

Comprehension(Metadata, Moo<Comprehension>)

A comprehension.

The inside of the comprehension opens a new scope.

§

DominanceRelation(Metadata, Moo<Expression>)

Defines dominance (“Solution A is preferred over Solution B”)

§

FromSolution(Metadata, Moo<Atom>)

fromSolution(name) - Used in dominance relation definitions

§

Metavar(Metadata, Ustr)

§

Atomic(Metadata, Atom)

§

TypeAnnotation(Metadata, Moo<Expression>, DomainPtr)

Type annotation expression: expr :: type.

§

DomainAnnotation(Metadata, Moo<Expression>, DomainPtr)

Domain annotation expression: expr : domain.

§

Active(Metadata, Moo<Expression>, Name)

Asserts that the given variant of a variant expression is in use. See also: GroundDomain::Variant Supported by: JsonInput.

§

RecordField(Metadata, Moo<Expression>, Name)

Indexing into a record expression, e.g {foo = 1, bar = true}[foo] See also: GroundDomain::Record Supported by: JsonInput.

§

UnsafeIndex(Metadata, Moo<Expression>, Vec<Expression>)

A matrix index.

Defined iff the indices are within their respective index domains. Supported by: JsonInput.

§

SafeIndex(Metadata, Moo<Expression>, Vec<Expression>)

A safe matrix index.

See Expression::UnsafeIndex Supported by: SMT.

§

UnsafeSlice(Metadata, Moo<Expression>, Vec<Option<Expression>>)

A matrix slice: a[indices].

One of the indicies may be None, representing the dimension of the matrix we want to take a slice of. For example, for some 3d matrix a, a[1,..,2] has the indices Some(1),None,Some(2).

It is assumed that the slice only has one “wild-card” dimension and thus is 1 dimensional.

Defined iff the defined indices are within their respective index domains. Supported by: JsonInput.

§

SafeSlice(Metadata, Moo<Expression>, Vec<Option<Expression>>)

A safe matrix slice: a[indices].

See Expression::UnsafeSlice.

§

InDomain(Metadata, Moo<Expression>, DomainPtr)

inDomain(x,domain) iff x is in the domain domain.

This cannot be constructed from Essence input, nor passed to a solver: this expression is mainly used during the conversion of UnsafeIndex and UnsafeSlice to SafeIndex and SafeSlice respectively.

§

ToInt(Metadata, Moo<Expression>)

toInt(b) casts boolean expression b to an integer.

  • If b is false, then toInt(b) == 0

  • If b is true, then toInt(b) == 1 Supported by: SMT.

§

Abs(Metadata, Moo<Expression>)

|x| - absolute value of x Supported by: JsonInput, SMT.

§

Sum(Metadata, Moo<Expression>)

sum(<vec_expr>) Supported by: JsonInput, SMT.

§

Product(Metadata, Moo<Expression>)

a * b * c * ... Supported by: JsonInput, SMT.

§

Min(Metadata, Moo<Expression>)

min(<vec_expr>) Supported by: JsonInput, SMT.

§

Max(Metadata, Moo<Expression>)

max(<vec_expr>) Supported by: JsonInput, SMT.

§

Not(Metadata, Moo<Expression>)

not(a) Supported by: JsonInput, SAT, SMT.

§

Or(Metadata, Moo<Expression>)

or(<vec_expr>) Supported by: JsonInput, SAT, SMT.

§

And(Metadata, Moo<Expression>)

and(<vec_expr>) Supported by: JsonInput, SAT, SMT.

§

Imply(Metadata, Moo<Expression>, Moo<Expression>)

Ensures that a->b (material implication). Supported by: JsonInput, SMT.

§

Iff(Metadata, Moo<Expression>, Moo<Expression>)

iff(a, b) a <-> b Supported by: JsonInput, SMT.

§

Union(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput.

§

In(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput.

§

Intersect(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput.

§

Difference(Metadata, Moo<Expression>, Moo<Expression>)

Set difference, a - b.

Spelled with minus in Essence, but kept apart from Expression::Minus: the two share a symbol and nothing else, and overloading one node for both made every arithmetic rule have to ask whether its operands were really sets. Supported by: JsonInput.

§

Supset(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput.

§

SupsetEq(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput.

§

Subset(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput.

§

SubsetEq(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput.

§

Eq(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput, SMT.

§

Neq(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput, SMT.

§

Geq(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput, SMT.

§

Leq(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput, SMT.

§

Gt(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput, SMT.

§

Lt(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput, SMT.

§

Subsequence(Metadata, Moo<Expression>, Moo<Expression>)

s subsequence t tests whether the list of values taken by s occurs in the same order in the list of values taken by t Supported by: JsonInput.

§

Substring(Metadata, Moo<Expression>, Moo<Expression>)

s substring t tests whether the list of values taken by s occurs in the same order and contiguously in the list of values taken by t Supported by: JsonInput.

§

CatchUndef(Metadata, Moo<Expression>, Moo<Expression>)

catchUndef(e, d): e where e is defined, d where it is not.

Definedness is only known once the bubble rules have run, so this survives until then and is lowered against the bubble condition the inner expression produces. Supported by: JsonInput.

§

SafeDiv(Metadata, Moo<Expression>, Moo<Expression>)

Division after preventing division by zero, usually with a bubble Supported by: SMT.

§

UnsafeDiv(Metadata, Moo<Expression>, Moo<Expression>)

Division with a possibly undefined value (division by 0) Supported by: JsonInput.

§

SafeMod(Metadata, Moo<Expression>, Moo<Expression>)

Modulo after preventing mod 0, usually with a bubble Supported by: SMT.

§

UnsafeMod(Metadata, Moo<Expression>, Moo<Expression>)

Modulo with a possibly undefined value (mod 0) Supported by: JsonInput.

§

Neg(Metadata, Moo<Expression>)

Negation: -x Supported by: JsonInput, SMT.

§

Factorial(Metadata, Moo<Expression>)

Factorial: x! or ’factorial(x)` Supported by: JsonInput.

§

Defined(Metadata, Moo<Expression>)

Set of domain values function is defined for Supported by: JsonInput.

§

Range(Metadata, Moo<Expression>)

Set of codomain values function is defined for Supported by: JsonInput.

§

ToSet(Metadata, Moo<Expression>)

Supported by: JsonInput.

§

ToMSet(Metadata, Moo<Expression>)

Supported by: JsonInput.

§

ToRelation(Metadata, Moo<Expression>)

Supported by: JsonInput.

§

UnsafePow(Metadata, Moo<Expression>, Moo<Expression>)

Unsafe powerx**y (possibly undefined)

Defined when (X!=0 \/ Y!=0) /\ Y>=0 Supported by: JsonInput.

§

SafePow(Metadata, Moo<Expression>, Moo<Expression>)

UnsafePow after preventing undefinedness

§

Flatten(Metadata, Option<Moo<Expression>>, Moo<Expression>)

Flatten matrix operator flatten(M) or flatten(n, M) where M is a matrix and n is an optional integer argument indicating depth of flattening

§

AttributeAsConstraint(Metadata, Moo<Expression>, Ustr, Option<Moo<Expression>>)

An attribute predicate used as a constraint, e.g. reflexive(r) or size(s, 3). Lifted into the target’s declaration domain attributes when possible (see passes::attribute_as_constraint); expanded in place to the equivalent formula otherwise.

§

AllDiff(Metadata, Moo<Expression>)

allDifferent(<vec_expr>) Supported by: JsonInput.

§

SmtDistinct(Metadata, Moo<Expression>)

Z3’s native distinct over the elements of <vec_expr>.

This is emitted for the SMT backend only, and never appears in a model bound for any other solver. It exists so that “hand allDifferent to Z3 as distinct” and “encode allDifferent explicitly” are two rules competing at the same choice site, which is what lets the heuristics pick between them – and what records the choice in the model, so it is not asked again every time the expression is visited. Supported by: SMT.

§

AllDifferentExcept(Metadata, Moo<Expression>, Moo<Expression>)

allDifferentExcept(<matrix>, <except>) Supported by: JsonInput.

§

ElementId(Metadata, Moo<Expression>, Moo<Expression>)

elementId(<matrix>, <value>) — 1-based index of value in matrix

§

Table(Metadata, Moo<Expression>, Moo<Expression>)

table([x1, x2, ...], [[r11, r12, ...], [r21, r22, ...], ...])

Represents a positive table constraint: the tuple [x1, x2, ...] must match one of the allowed rows. Supported by: JsonInput.

§

NegativeTable(Metadata, Moo<Expression>, Moo<Expression>)

negativeTable([x1, x2, ...], [[r11, r12, ...], [r21, r22, ...], ...])

Represents a negative table constraint: the tuple [x1, x2, ...] must NOT match any of the forbidden rows. Supported by: JsonInput.

§

AtLeast(Metadata, Moo<Expression>, Moo<Expression>, Moo<Expression>)

atleast(vars, counts, values)

For each values[i], requires at least counts[i] occurrences in vars. Supported by: JsonInput.

§

AtMost(Metadata, Moo<Expression>, Moo<Expression>, Moo<Expression>)

atmost(vars, counts, values)

For each values[i], requires at most counts[i] occurrences in vars. Supported by: JsonInput.

§

Gcc(Metadata, Moo<Expression>, Moo<Expression>, Moo<Expression>)

gcc(vars, values, counts)

Global cardinality constraint. For each values[i], requires exactly counts[i] occurrences in vars. Supported by: JsonInput.

§

GccWeak(Metadata, Moo<Expression>, Moo<Expression>, Moo<Expression>)

Minion gccweak(vars, values, counts) — weaker propagation variant of gcc. Supported by: Minion.

§

Minus(Metadata, Moo<Expression>, Moo<Expression>)

Binary subtraction operator

This is a parser-level construct, and is immediately normalised to Sum([a,-b]). TODO: make this compatible with Set Difference calculations - need to change return type and domain for this expression and write a set comprehension rule. have already edited minus_to_sum to prevent this from applying to sets Supported by: JsonInput.

§

Apart(Metadata, Moo<Expression>, Moo<Expression>)

Partition Operator: test if a list of elements are not all contained in one part of the partition First Expr Arg is a list of elements Second Expr Arg is the partition Supported by: JsonInput.

§

Participants(Metadata, Moo<Expression>)

Partition Operator: union of all parts of a partition Expr Arg is a partition Supported by: JsonInput.

§

Party(Metadata, Moo<Expression>, Moo<Expression>)

Partition Operator: part of partition that contains specified element First Expr Arg is an element that should be contained Second Expr Arg is the partition that should contain that element Supported by: JsonInput.

§

Parts(Metadata, Moo<Expression>)

Partition Operator: partition to its set of parts Expr Arg is the partition from which the parts come from Supported by: JsonInput.

§

Together(Metadata, Moo<Expression>, Moo<Expression>)

Partition Operator: test if a list of elements are all in the same part of the partition First Expr Arg is the list of elements to test with Second Expr Arg is the partition to test on Supported by: JsonInput.

§

FlatAbsEq(Metadata, Moo<Atom>, Moo<Atom>)

Ensures that x=|y| i.e. x is the absolute value of y.

Low-level Minion constraint.

§See also

§

FlatAllDiff(Metadata, Vec<Atom>)

Ensures that alldiff([a,b,...]).

Low-level Minion constraint.

§See also

§

FlatMinEq(Metadata, Vec<Atom>, Atom)

Ensures that result = min(vars).

Low-level Minion constraint. Prefer this over expanding Expression::Min into leq/or/eq constraints when targeting Minion.

§See also

§

FlatSumGeq(Metadata, Vec<Atom>, Atom)

Ensures that sum(vec) >= x.

Low-level Minion constraint.

§See also

§

FlatSumLeq(Metadata, Vec<Atom>, Atom)

Ensures that sum(vec) <= x.

Low-level Minion constraint.

§See also

§

FlatIneq(Metadata, Moo<Atom>, Moo<Atom>, Box<Literal>)

ineq(x,y,k) ensures that x <= y + k.

Low-level Minion constraint.

§See also

§

FlatWatchedLiteral(Metadata, Reference, Literal)

w-literal(x,k) ensures that x == k, where x is a variable and k a constant.

Low-level Minion constraint.

This is a low-level Minion constraint and you should probably use Eq instead. The main use of w-literal is to convert boolean variables to constraints so that they can be used inside watched-and and watched-or.

§See also

§

FlatWeightedSumLeq(Metadata, Vec<Literal>, Vec<Atom>, Moo<Atom>)

weightedsumleq(cs,xs,total) ensures that cs.xs <= total, where cs.xs is the scalar dot product of cs and xs.

Low-level Minion constraint.

Represents a weighted sum of the form ax + by + cz + ...

§See also

§

FlatWeightedSumGeq(Metadata, Vec<Literal>, Vec<Atom>, Moo<Atom>)

weightedsumgeq(cs,xs,total) ensures that cs.xs >= total, where cs.xs is the scalar dot product of cs and xs.

Low-level Minion constraint.

Represents a weighted sum of the form ax + by + cz + ...

§See also

§

FlatMinusEq(Metadata, Moo<Atom>, Moo<Atom>)

Ensures that x =-y, where x and y are atoms.

Low-level Minion constraint.

§See also

§

FlatProductEq(Metadata, Moo<Atom>, Moo<Atom>, Moo<Atom>)

Ensures that x*y=z.

Low-level Minion constraint.

§See also

§

MinionDivEqUndefZero(Metadata, Moo<Atom>, Moo<Atom>, Moo<Atom>)

Ensures that floor(x/y)=z. Always true when y=0.

Low-level Minion constraint.

§See also

§

MinionModuloEqUndefZero(Metadata, Moo<Atom>, Moo<Atom>, Moo<Atom>)

Ensures that x%y=z. Always true when y=0.

Low-level Minion constraint.

§See also

§

MinionPow(Metadata, Moo<Atom>, Moo<Atom>, Moo<Atom>)

Ensures that x**y = z.

Low-level Minion constraint.

This constraint is false when y<0 except for 1**y=1 and (-1)**y=z (where z is 1 if y is odd and z is -1 if y is even).

§See also

§

MinionReify(Metadata, Moo<Expression>, Atom)

reify(constraint,r) ensures that r=1 iff constraint is satisfied, where r is a 0/1 variable.

Low-level Minion constraint.

§See also

§

MinionReifyImply(Metadata, Moo<Expression>, Atom)

reifyimply(constraint,r) ensures that r->constraint, where r is a 0/1 variable. variable.

Low-level Minion constraint.

§See also

§

MinionWInIntervalSet(Metadata, Atom, Vec<i32>)

w-inintervalset(x, [a1,a2, b1,b2, … ]) ensures that the value of x belongs to one of the intervals {a1,…,a2}, {b1,…,b2} etc.

The list of intervals must be given in numerical order.

Low-level Minion constraint.

§See also

§

MinionWInSet(Metadata, Atom, Vec<i32>)

w-inset(x, [v1, v2, … ]) ensures that the value of x is one of the explicitly given values v1, v2, etc.

This constraint enforces membership in a specific set of discrete values rather than intervals.

The list of values must be given in numerical order.

Low-level Minion constraint.

§See also

§

MinionElementOne(Metadata, Vec<Atom>, Moo<Atom>, Moo<Atom>)

element_one(vec, i, e) specifies that vec[i] = e. This implies that i is in the range [1..len(vec)].

Low-level Minion constraint.

§See also

§

AuxDeclaration(Metadata, Reference, Moo<Expression>)

Declaration of an auxiliary variable.

As with Savile Row, we semantically distinguish this from Eq. Supported by: Minion.

§

SATInt(Metadata, SATIntEncoding, Moo<Expression>, (i32, i32))

This expression is for encoding ints for the SAT solver, it stores the encoding type, the vector of booleans and the min/max for the int. Supported by: SAT.

§

PairwiseSum(Metadata, Moo<Expression>, Moo<Expression>)

Addition over a pair of expressions (i.e. a + b) rather than a vec-expr like Expression::Sum. This is for compatibility with backends that do not support addition over vectors. Supported by: SMT.

§

PairwiseProduct(Metadata, Moo<Expression>, Moo<Expression>)

Multiplication over a pair of expressions (i.e. a * b) rather than a vec-expr like Expression::Product. This is for compatibility with backends that do not support multiplication over vectors. Supported by: SMT.

§

Image(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput.

§

ImageSet(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput.

§

PreImage(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput.

§

Inverse(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput.

§

PermInverse(Metadata, Moo<Expression>)

permInverse(p): the inverse of permutation p, as a new permutation value. Not to be confused with Expression::Inverse, which is a boolean predicate over a pair of permutations, not a value-returning operator. Supported by: JsonInput.

§

Compose(Metadata, Moo<Expression>, Moo<Expression>)

compose(g, h): the permutation obtained by applying h then g, as a new permutation value (image(compose(g, h), i) = image(g, image(h, i))). Supported by: JsonInput.

§

Restrict(Metadata, Moo<Expression>, Moo<Expression>)

Supported by: JsonInput.

§

LexLt(Metadata, Moo<Expression>, Moo<Expression>)

Lexicographical < between two matrices.

A <lex B iff: A[i] < B[i] for some i /\ (A[j] > B[j] for some j -> i < j) I.e. A must be less than B at some index i, and if it is greater than B at another index j, then j comes after i. I.e. A must be greater than B at the first index where they differ.

E.g. [1, 1] <lex [2, 1] and [1, 1] <lex [1, 2]

§

LexLeq(Metadata, Moo<Expression>, Moo<Expression>)

Lexicographical <= between two matrices

§

LexGt(Metadata, Moo<Expression>, Moo<Expression>)

Lexicographical > between two matrices This is a parser-level construct, and is immediately normalised to LexLt(b, a)

§

LexGeq(Metadata, Moo<Expression>, Moo<Expression>)

Lexicographical >= between two matrices This is a parser-level construct, and is immediately normalised to LexLeq(b, a)

§

FlatLexLt(Metadata, Vec<Atom>, Vec<Atom>)

Low-level minion constraint. See Expression::LexLt

§

FlatLexLeq(Metadata, Vec<Atom>, Vec<Atom>)

Low-level minion constraint. See Expression::LexLeq

§

RelationProj(Metadata, Moo<Expression>, Vec<Option<Expression>>)

Alters the shape of relations by projection Supported by: JsonInput.

§

Card(Metadata, Moo<Expression>)

Cardinality of a collection type Supported by: JsonInput.

Implementations§

Source§

impl Expression

Source

pub fn domain_of(&self) -> Option<DomainPtr>

Returns the possible values of the expression, recursing to leaf expressions.

Cached in this node’s own Metadata: domain_of_uncached recomputes recursively from scratch with no memoisation of its own, so repeatedly calling domain_of on the same subtree (as rules that check “is this operand scalar/abstract” tend to, once per rule attempt) is quadratic in the worst case without a cache. The cache is invalidated when this expression or a descendant changes.

Source

pub fn meta_ref(&self) -> &Metadata

Returns a reference to this expression’s metadata without cloning.

Source

pub fn get_meta(&self) -> Metadata

Source

pub fn set_meta(&self, meta: Metadata)

Source

pub fn is_safe(&self) -> bool

Checks whether this expression is safe.

An expression is unsafe if can be undefined, or if any of its children can be undefined.

Unsafe expressions are (typically) prefixed with Unsafe in our AST, and can be made safe through the use of bubble rules.

Source

pub fn is_associative_commutative_operator(&self) -> bool

True if the expression is an associative and commutative operator

Source

pub fn is_matrix_literal(&self) -> bool

True if the expression is a matrix literal.

This is true for both forms of matrix literals: those with elements of type Literal and Expression.

Source

pub fn identical_atom_to(&self, other: &Expression) -> bool

True iff self and other are both atomic and identical.

This method is useful to cheaply check equivalence. Assuming CSE is enabled, any unifiable expressions will be rewritten to a common variable. This is much cheaper than checking the entire subtrees of self and other.

Source

pub fn unwrap_list_ref(&self) -> Option<&[Expression]>

If the expression is a list, borrows the inner expressions.

Prefer this over Expression::unwrap_list when the elements are only inspected: copying them costs the whole list, which matters on wide matrices that rules test on every visit.

Unlike Expression::unwrap_list, a matrix held as an Atom::Literal is not unwrapped, since its elements are literals with no Expression to borrow.

Source

pub fn unwrap_list_cow(&self) -> Option<Cow<'_, [Expression]>>

If the expression is a list, borrows the inner expressions where it can.

This accepts exactly the same expressions as Expression::unwrap_list, but avoids the copy in the common case. Only a matrix held as an Atom::Literal allocates, because its elements are literals that have to be materialised as Expressions; every other list borrows.

Prefer this over Expression::unwrap_list when the elements are usually only inspected, and over Expression::unwrap_list_ref when the narrower set of accepted expressions would change behaviour.

Source

pub fn list_len(&self) -> Option<usize>

Returns the number of elements when this expression is a list, without cloning them.

Unlike Expression::unwrap_list, this never converts literal elements into expressions. Use it for length, emptiness, and list-shape checks.

Source

pub fn is_list(&self) -> bool

Whether this expression is a list, without cloning or materialising its elements.

Source

pub fn unwrap_list(&self) -> Option<Vec<Expression>>

If the expression is a list, returns a copied vector of the inner expressions.

A list is any a matrix with the domain int(1..). This includes matrix literals without any explicitly specified domain.

The vector is owned: a matrix stored inside Atom::Literal holds Literals that have to be materialised as Expressions, and callers that rewrite the elements need them by value. For inspection use Expression::unwrap_list_cow; for shape checks use Expression::list_len or Expression::is_list.

Source

pub fn into_list(self) -> Option<Vec<Expression>>

If the expression is a list, consumes it and returns its elements.

Prefer this over Expression::unwrap_list when the expression is already owned: it moves expression elements out of the matrix rather than cloning the complete list.

Source

pub fn unwrap_matrix_unchecked_ref(&self) -> Option<(&[Expression], &DomainPtr)>

If the expression is an expression-valued matrix, borrows its elements and index domain.

As with Expression::unwrap_matrix_unchecked, callers must preserve the relationship between the domain and element count. Literal-valued matrices are excluded because their elements cannot be borrowed as Expressions.

Source

pub fn unwrap_matrix_unchecked(self) -> Option<(Vec<Expression>, DomainPtr)>

If the expression is a matrix, gets it elements and index domain.

Consider using the safer Expression::unwrap_list instead.

It is generally undefined to edit the length of a matrix unless it is a list (as defined by Expression::unwrap_list). Users of this function should ensure that, if the matrix is reconstructed, the index domain and the number of elements in the matrix remain the same.

Source

pub fn extend_root(self, exprs: Vec<Expression>) -> Expression

For a Root expression, extends the inner vec with the given vec.

§Panics

Panics if the expression is not Root.

Source

pub fn into_literal(self) -> Option<Literal>

Converts the expression to a literal, if possible.

Source

pub fn to_ac_operator_kind(&self) -> Option<ACOperatorKind>

If this expression is an associative-commutative operator, return its ACOperatorKind.

Source

pub fn try_return_type(&self) -> Option<ReturnType>

Typeable::return_type, where the type can be worked out.

return_type panics for a reference whose declaration has no domain yet – a value letting whose body is not yet a constant, say. Parsers cannot rule those out while building the model, so they ask this instead and read None as “unknown”.

Source

pub fn universe_categories(&self) -> HashSet<Category>

Returns the categories of all sub-expressions of self.

Source§

impl Expression

Source

pub fn for_each_expr_child<'a>(&'a self, f: &mut impl FnMut(&'a Expression))

Visit each direct Expression child by reference, without cloning.

Source

pub fn for_each_expression<'a>(&'a self, f: &mut impl FnMut(&'a Expression))

Visits this expression and all of its expression descendants by reference.

Source

pub fn any_expression(&self, predicate: impl FnMut(&Expression) -> bool) -> bool

Returns whether this expression or any expression below it satisfies predicate.

Unlike [Uniplate::universe], this does not construct an owned copy of the traversed tree.

Source

pub fn any_expression_descendant( &self, predicate: impl FnMut(&Expression) -> bool, ) -> bool

Returns whether any expression strictly below this one satisfies predicate.

Trait Implementations§

Source§

impl Biplate<AbstractLiteral<Expression>> for Expression

Source§

fn biplate( &self, ) -> (Tree<AbstractLiteral<Expression>>, Box<dyn Fn(Tree<AbstractLiteral<Expression>>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<AbstractLiteral<Literal>> for Expression

Source§

fn biplate( &self, ) -> (Tree<AbstractLiteral<Literal>>, Box<dyn Fn(Tree<AbstractLiteral<Literal>>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Atom> for Expression

Source§

fn biplate(&self) -> (Tree<Atom>, Box<dyn Fn(Tree<Atom>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Comprehension> for Expression

Source§

fn biplate( &self, ) -> (Tree<Comprehension>, Box<dyn Fn(Tree<Comprehension>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<DeclarationPtr> for Expression

Source§

fn biplate( &self, ) -> (Tree<DeclarationPtr>, Box<dyn Fn(Tree<DeclarationPtr>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Expression> for Atom

Source§

fn biplate(&self) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> Atom>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Expression> for ComprehensionQualifier

Source§

fn biplate( &self, ) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> ComprehensionQualifier>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Expression> for Comprehension

Source§

fn biplate( &self, ) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> Comprehension>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Expression> for Declaration

Source§

fn biplate( &self, ) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> Declaration>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Expression> for DeclarationKind

Source§

fn biplate( &self, ) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> DeclarationKind>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Expression> for Domain

Source§

fn biplate(&self) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> Domain>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Expression> for IntVal

Source§

fn biplate(&self) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> IntVal>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Expression> for UnresolvedDomain

Source§

fn biplate( &self, ) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> UnresolvedDomain>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Expression> for Expression

Source§

fn biplate( &self, ) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> Expression>)

Definition of a Biplate. Read more
Source§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
Source§

fn try_replace_child_at_bi(&mut self, index: usize, child: Expression) -> bool

Replaces the indexth child of type To within self. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Expression> for Literal

Source§

fn biplate( &self, ) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> Literal>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Expression> for Model

Source§

fn biplate(&self) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> Self>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Expression> for SymbolTable

Source§

fn biplate(&self) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> Self>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Field<Expression>> for Expression

Source§

fn biplate( &self, ) -> (Tree<Field<Expression>>, Box<dyn Fn(Tree<Field<Expression>>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Field<Literal>> for Expression

Source§

fn biplate( &self, ) -> (Tree<Field<Literal>>, Box<dyn Fn(Tree<Field<Literal>>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Literal> for Expression

Source§

fn biplate(&self) -> (Tree<Literal>, Box<dyn Fn(Tree<Literal>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Metadata> for Expression

Source§

fn biplate(&self) -> (Tree<Metadata>, Box<dyn Fn(Tree<Metadata>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Model> for Expression

Source§

fn biplate(&self) -> (Tree<Model>, Box<dyn Fn(Tree<Model>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Moo<Domain>> for Expression

Source§

fn biplate( &self, ) -> (Tree<DomainPtr>, Box<dyn Fn(Tree<DomainPtr>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Name> for Expression

Source§

fn biplate(&self) -> (Tree<Name>, Box<dyn Fn(Tree<Name>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Option<Expression>> for Expression

Source§

fn biplate( &self, ) -> (Tree<Option<Expression>>, Box<dyn Fn(Tree<Option<Expression>>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Reference> for Expression

Source§

fn biplate( &self, ) -> (Tree<Reference>, Box<dyn Fn(Tree<Reference>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<SymbolTable> for Expression

Source§

fn biplate( &self, ) -> (Tree<SymbolTable>, Box<dyn Fn(Tree<SymbolTable>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<SymbolTablePtr> for Expression

Source§

fn biplate( &self, ) -> (Tree<SymbolTablePtr>, Box<dyn Fn(Tree<SymbolTablePtr>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl Biplate<Vec<Expression>> for Expression

Source§

fn biplate( &self, ) -> (Tree<Vec<Expression>>, Box<dyn Fn(Tree<Vec<Expression>>) -> Expression>)

Definition of a Biplate. Read more
§

fn with_children_bi(&self, children: VecDeque<To>) -> Self

Reconstructs the node with the given children. Read more
§

fn descend_bi(&self, op: &impl Fn(To) -> To) -> Self

Biplate variant of [Uniplate::descend] Read more
§

fn universe_bi(&self) -> VecDeque<To>

Gets all children of a node, including itself and all children. Read more
§

fn children_bi(&self) -> VecDeque<To>

Returns the children of a type. If to == from then it returns the original element (in contrast to children). Read more
§

fn children_bi_count(&self) -> usize

Number of children that would be returned by children_bi. Read more
§

fn try_replace_child_at_bi(&mut self, index: usize, child: To) -> bool

Replaces the indexth child of type To within self. Read more
§

fn transform_bi(&self, op: &impl Fn(To) -> To) -> Self

Applies the given function to all nodes bottom up. Read more
§

fn holes_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
§

fn contexts_bi(&self) -> impl Iterator<Item = (To, impl Fn(To))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. Read more
Source§

impl CategoryOf for Expression

Source§

fn category_of(&self) -> Category

Gets the Category of a term.
Source§

impl Clone for Expression

Source§

fn clone(&self) -> Expression

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Expression

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Expression

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Expression

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Expression

Source§

impl From<AbstractLiteral<Expression>> for Expression

Source§

fn from(value: AbstractLiteral<Expression>) -> Self

Converts to this type from the input type.
Source§

impl From<Atom> for Expression

Source§

fn from(value: Atom) -> Self

Converts to this type from the input type.
Source§

impl From<Literal> for Expression

Source§

fn from(value: Literal) -> Self

Converts to this type from the input type.
Source§

impl From<Moo<Expression>> for Expression

Source§

fn from(val: Moo<Expression>) -> Self

Converts to this type from the input type.
Source§

impl From<Reference> for Expression

Source§

fn from(value: Reference) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for Expression

Source§

fn from(b: bool) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for Expression

Source§

fn from(i: i32) -> Self

Converts to this type from the input type.
Source§

impl Hash for Expression

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

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

impl MatrixValue for Expression

Source§

fn as_nested_matrix(&self) -> Option<&AbstractLiteral<Expr>>

If this element is a nested matrix, return a reference to it
Source§

fn into_nested_matrix(self) -> Result<AbstractLiteral<Expr>, Self>

If this element is a nested matrix, consume it and return the matrix
Source§

impl PartialEq for Expression

Source§

fn eq(&self, other: &Expression) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Quine for Expression

Source§

impl Serialize for Expression

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Expression

Source§

impl<'a> TryFrom<&'a Box<Expression>> for &'a Atom

Source§

type Error = &'static str

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

fn try_from(value: &'a Box<Expression>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Expression> for &'a Atom

Source§

type Error = &'static str

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

fn try_from(value: &'a Expression) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Expression> for ACOperatorKind

Source§

type Error = ()

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

fn try_from(expr: &Expression) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Expression> for i32

Source§

type Error = ()

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

fn try_from(value: &Expression) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Box<Expression>> for ACOperatorKind

Source§

type Error = ()

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

fn try_from(value: Box<Expression>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Box<Expression>> for Atom

Source§

type Error = &'static str

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

fn try_from(value: Box<Expression>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Expression> for ACOperatorKind

Source§

type Error = ()

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

fn try_from(value: Expression) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Expression> for Atom

Source§

type Error = &'static str

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

fn try_from(value: Expression) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Expression> for i32

Source§

type Error = ()

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

fn try_from(value: Expression) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<IntVal> for Expression

Source§

type Error = DomainOpError

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

fn try_from(value: IntVal) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Typeable for Expression

Source§

impl Uniplate for Expression

Source§

fn uniplate( &self, ) -> (Tree<Expression>, Box<dyn Fn(Tree<Expression>) -> Expression>)

Definition of a Uniplate. Read more
Source§

fn try_replace_child_at(&mut self, index: usize, child: Expression) -> bool

Replaces the indexth direct child of self. Read more
§

fn descend(&self, op: &impl Fn(Self) -> Self) -> Self

Applies a function to all direct children of this Read more
§

fn universe(&self) -> VecDeque<Self>

Gets all children of a node, including itself and all children. Read more
§

fn children(&self) -> VecDeque<Self>

Gets the direct children (maximal substructures) of a node.
§

fn with_children(&self, children: VecDeque<Self>) -> Self

Reconstructs the node with the given children. Read more
§

fn transform(&self, f: &impl Fn(Self) -> Self) -> Self

Applies the given function to all nodes bottom up.
§

fn rewrite(&self, f: &impl Fn(Self) -> Option<Self>) -> Self

Rewrites by applying a rule everywhere it can.
§

fn cata<T>(&self, op: &impl Fn(Self, VecDeque<T>) -> T) -> T

Performs a fold-like computation on each value. Read more
§

fn holes(&self) -> impl Iterator<Item = (Self, impl Fn(Self))>

Returns an iterator over all direct children of the input, paired with a function that “fills the hole” where the child was with a new value.
§

fn contexts(&self) -> impl Iterator<Item = (Self, impl Fn(Self))>

Returns an iterator over the universe of the input, paired with a function that “fills the hole” where the child was with a new value. 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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T, A> IntoAst<A> for T
where T: Into<A>, A: Ast,

§

fn into_ast(self, _a: &A) -> A

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 144 bytes

Size for each variant:

  • AbstractLiteral: 119 bytes
  • Root: 111 bytes
  • Bubble: 103 bytes
  • Comprehension: 95 bytes
  • DominanceRelation: 95 bytes
  • FromSolution: 95 bytes
  • Metavar: 95 bytes
  • Atomic: 119 bytes
  • TypeAnnotation: 103 bytes
  • DomainAnnotation: 103 bytes
  • Active: 127 bytes
  • RecordField: 127 bytes
  • UnsafeIndex: 119 bytes
  • SafeIndex: 119 bytes
  • UnsafeSlice: 119 bytes
  • SafeSlice: 119 bytes
  • InDomain: 103 bytes
  • ToInt: 95 bytes
  • Abs: 95 bytes
  • Sum: 95 bytes
  • Product: 95 bytes
  • Min: 95 bytes
  • Max: 95 bytes
  • Not: 95 bytes
  • Or: 95 bytes
  • And: 95 bytes
  • Imply: 103 bytes
  • Iff: 103 bytes
  • Union: 103 bytes
  • In: 103 bytes
  • Intersect: 103 bytes
  • Difference: 103 bytes
  • Supset: 103 bytes
  • SupsetEq: 103 bytes
  • Subset: 103 bytes
  • SubsetEq: 103 bytes
  • Eq: 103 bytes
  • Neq: 103 bytes
  • Geq: 103 bytes
  • Leq: 103 bytes
  • Gt: 103 bytes
  • Lt: 103 bytes
  • Subsequence: 103 bytes
  • Substring: 103 bytes
  • CatchUndef: 103 bytes
  • SafeDiv: 103 bytes
  • UnsafeDiv: 103 bytes
  • SafeMod: 103 bytes
  • UnsafeMod: 103 bytes
  • Neg: 95 bytes
  • Factorial: 95 bytes
  • Defined: 95 bytes
  • Range: 95 bytes
  • ToSet: 95 bytes
  • ToMSet: 95 bytes
  • ToRelation: 95 bytes
  • UnsafePow: 103 bytes
  • SafePow: 103 bytes
  • Flatten: 103 bytes
  • AttributeAsConstraint: 111 bytes
  • AllDiff: 95 bytes
  • SmtDistinct: 95 bytes
  • AllDifferentExcept: 103 bytes
  • ElementId: 103 bytes
  • Table: 103 bytes
  • NegativeTable: 103 bytes
  • AtLeast: 111 bytes
  • AtMost: 111 bytes
  • Gcc: 111 bytes
  • GccWeak: 111 bytes
  • Minus: 103 bytes
  • Apart: 103 bytes
  • Participants: 95 bytes
  • Party: 103 bytes
  • Parts: 95 bytes
  • Together: 103 bytes
  • FlatAbsEq: 103 bytes
  • FlatAllDiff: 111 bytes
  • FlatMinEq: 143 bytes
  • FlatSumGeq: 143 bytes
  • FlatSumLeq: 143 bytes
  • FlatIneq: 111 bytes
  • FlatWatchedLiteral: 143 bytes
  • FlatWeightedSumLeq: 143 bytes
  • FlatWeightedSumGeq: 143 bytes
  • FlatMinusEq: 103 bytes
  • FlatProductEq: 111 bytes
  • MinionDivEqUndefZero: 111 bytes
  • MinionModuloEqUndefZero: 111 bytes
  • MinionPow: 111 bytes
  • MinionReify: 127 bytes
  • MinionReifyImply: 127 bytes
  • MinionWInIntervalSet: 143 bytes
  • MinionWInSet: 143 bytes
  • MinionElementOne: 127 bytes
  • AuxDeclaration: 119 bytes
  • SATInt: 103 bytes
  • PairwiseSum: 103 bytes
  • PairwiseProduct: 103 bytes
  • Image: 103 bytes
  • ImageSet: 103 bytes
  • PreImage: 103 bytes
  • Inverse: 103 bytes
  • PermInverse: 95 bytes
  • Compose: 103 bytes
  • Restrict: 103 bytes
  • LexLt: 103 bytes
  • LexLeq: 103 bytes
  • LexGt: 103 bytes
  • LexGeq: 103 bytes
  • FlatLexLt: 135 bytes
  • FlatLexLeq: 135 bytes
  • RelationProj: 119 bytes
  • Card: 95 bytes