Case

scalus.uplc.Term.Case
final case class Case(arg: Term, cases: List[Term], annotation: UplcAnnotation = ...)

Members list

Value members

Inherited methods

infix def $(rhs: Term): Term

Applies the argument to the term.

Applies the argument to the term.

Attributes

Inherited from:
Term
infix def `α_==`(that: Term): Boolean

Alpha-equivalence check between two terms.

Alpha-equivalence check between two terms.

Attributes

Note

This method assumes that the terms are debruijn-indexed properly. Call DeBruijn.deBruijnTerm before using this method to ensure correct indexing.

Inherited from:
Term
def applyToList: (Term, List[Term])

Attributes

Inherited from:
Term

Attributes

Inherited from:
Term
def evaluate(using vm: PlutusVM): Term

Evaluate the term using the given VM.

Evaluate the term using the given VM.

Attributes

Throws
RuntimeException

on evaluation error

Note

This method just runs the CEK machine on the term. It does not follow Plutus specification like CIP-117

Inherited from:
Term
def evaluateDebug(using vm: PlutusVM): Result

Evaluate the term using the given VM.

Evaluate the term using the given VM.

Attributes

Returns

scalus.uplc.eval.Result with the evaluation result and the spent budget

Note

This method just runs the CEK machine on the term. It does not follow Plutus specification like CIP-117

Inherited from:
Term
def evaluateProfile(using vm: PlutusVM): Result

Evaluate the term with profiling enabled.

Evaluate the term with profiling enabled.

Like evaluateDebug but also collects profiling data by source location and function. Access profiling data via result.profile.

Attributes

Returns

scalus.uplc.eval.Result with profile set to Some(profilingData)

Note

This method just runs the CEK machine on the term. It does not follow Plutus specification like CIP-117

Inherited from:
Term

Bottom-up position fill: see fillEmptyAnnotationsBottomUp, of which this is the position-only view. Returns the representative position of this subtree.

Bottom-up position fill: see fillEmptyAnnotationsBottomUp, of which this is the position-only view. Returns the representative position of this subtree.

Attributes

Inherited from:
Term

Top-down position fill: see fillEmptyAnnotationsTopDown, of which this is the position-only view. The root inherits inherited and no function name.

Top-down position fill: see fillEmptyAnnotationsTopDown, of which this is the position-only view. The root inherits inherited and no function name.

Attributes

Inherited from:
Term

Wrap the term in a Plutus V1 program at the lowest UPLC version that can carry it (1.1.0 if it uses constr/case, else 1.0.0). See Program.minVersionFor.

Wrap the term in a Plutus V1 program at the lowest UPLC version that can carry it (1.1.0 if it uses constr/case, else 1.0.0). See Program.minVersionFor.

Attributes

Inherited from:
Term

Wrap the term in a Plutus V2 program at the lowest UPLC version that can carry it (1.1.0 if it uses constr/case, else 1.0.0). See Program.minVersionFor.

Wrap the term in a Plutus V2 program at the lowest UPLC version that can carry it (1.1.0 if it uses constr/case, else 1.0.0). See Program.minVersionFor.

Attributes

Inherited from:
Term

Wrap the term in a Plutus V3 program.

Wrap the term in a Plutus V3 program.

Attributes

Inherited from:
Term
def pretty: Doc

Pretty-print the term.

Pretty-print the term.

Attributes

Inherited from:
Term
def prettyXTerm: Doc

Pretty-print the term with XTerm syntax highlighting.

Pretty-print the term with XTerm syntax highlighting.

Attributes

Inherited from:
Term
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def show: String

Show the term as a string.

Show the term as a string.

Attributes

Inherited from:
Term
def showHighlighted: String

Show the term as a string with XTerm syntax highlighting.

Show the term as a string with XTerm syntax highlighting.

Attributes

Inherited from:
Term
def showShort: String

Show the term as a short string (truncated to 60 chars, first line only).

Show the term as a short string (truncated to 60 chars, first line only).

Attributes

Inherited from:
Term

Backwards-compatible accessor for the source position.

Backwards-compatible accessor for the source position.

Attributes

Inherited from:
Term
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Term -> Any
Inherited from:
Term
def unary_!: Term

Forces the term.

Forces the term.

Attributes

Inherited from:
Term
def unary_~: Term

Delays the term.

Delays the term.

Attributes

Inherited from:
Term
def usesConstrOrCase: Boolean

True if this term contains a constr or case node anywhere, i.e. it needs UPLC 1.1.0.

True if this term contains a constr or case node anywhere, i.e. it needs UPLC 1.1.0.

Attributes

Inherited from:
Term

Returns a copy of this term with the given annotation.

Returns a copy of this term with the given annotation.

Attributes

Inherited from:
Term

Sets the annotation on this term and recursively on subterms, but only where the position is currently empty. Recursion stops at terms that already have a position.

Sets the annotation on this term and recursively on subterms, but only where the position is currently empty. Recursion stops at terms that already have a position.

Keys on the position alone, and keeps a functionName the term already carries: lowering stamps the enclosing function on terms that have no position of their own, and those still need a position. Keying on whole-annotation emptiness would treat them as already annotated and stop the recursion into their whole subtree.

Attributes

Inherited from:
Term

Returns a copy of this term with the given source position.

Returns a copy of this term with the given source position.

Attributes

Inherited from:
Term

Sets the source position on this term and recursively on subterms, but only where the position is currently empty. Recursion stops at terms that already have a position.

Sets the source position on this term and recursively on subterms, but only where the position is currently empty. Recursion stops at terms that already have a position.

Attributes

Inherited from:
Term
infix def ~!=~(that: Term): Boolean

Position-ignoring structural inequality. Negation of ~=~.

Position-ignoring structural inequality. Negation of ~=~.

Attributes

Inherited from:
Term
infix def ~=~(that: Term): Boolean

Position-ignoring structural equality. Like α_== but works on named terms too and ignores annotation fields.

Position-ignoring structural equality. Like α_== but works on named terms too and ignores annotation fields.

Attributes

Inherited from:
Term