UplcPipeline

scalus.compiler.sir.lowering.UplcPipeline
object UplcPipeline

The single SIR -> UPLC pipeline, shared by scalus.uplc.CompiledPlutus and the sir.toUplc extensions:

removeTraces? -> BooleanOptimizer? -> MutualRecursionElimination -> StaticArgumentTransformation? -> lower(backend) -> optimize? -> fill positions

BooleanOptimizer and StaticArgumentTransformation both run when options.optimizeUplc is set. MutualRecursionElimination is unconditional (backends reject multi-binding recursive lets); running StaticArgumentTransformation after it lifts the peers-as-params static arguments MRE introduces. The backends keep their own MRE calls as safety nets for direct construction - MRE is idempotent, so the second call is a no-op walk.

ScalusTag is NOT applied here - it is a program-level concern (scalus.uplc.CompiledPlutus.program).

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def defaultOptimizer(language: Language, options: Options): Optimizer

The optimizer run should use when the caller has no version-specific one: V1/V2 -> V1V2Optimizer (V3Optimizer's CaseConstrApply emits Case/Constr terms that are illegal before Plutus V3); otherwise V3Optimizer configured from the options.

The optimizer run should use when the caller has no version-specific one: V1/V2 -> V1V2Optimizer (V3Optimizer's CaseConstrApply emits Case/Constr terms that are illegal before Plutus V3); otherwise V3Optimizer configured from the options.

Attributes

def run(sir: SIR, options: Options, language: Language, optimizer: Optimizer): Term

Runs the full SIR -> UPLC pipeline.

Runs the full SIR -> UPLC pipeline.

Value parameters

language

the backend's target language, also selecting the default optimizer

optimizer

what runs when options.optimizeUplc is set and options.uplcOptimizers is empty (uplcOptimizers, when non-empty, replaces it)

options

drives every step (traces, optimization, backend, protocol version)

sir

the SIR to lower

Attributes