EraseSpecifications

scalus.compiler.sir.transform.EraseSpecifications

Removes the specification clauses of scalus.cardano.onchain.plutus.prelude.Spec from SIR, before it is lowered.

A clause is a call of a function of the Spec module, which the compiler plugin leaves in the SIR as it leaves any call, so that a verifier can read it there. It is not part of the script:

  • Spec.expects(c) and Spec.ensures(c) are removed, with their conditions, which are not evaluated;
  • body.ensuring(r => c) becomes body;
  • the definitions of the Spec functions, which linking put around the code, are dropped, and so is the definition of a function that only the clauses used: a function written for the specification is no part of the script either.

The definitions that are left are nested again in the order the code alone gives. What comes out is the SIR of the same code written without the clauses, so its script has the same bytes. Code without clauses is returned as it is.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply(sir: SIR): SIR

Concrete fields

val Ensures: String

The name in SIR of the function behind Spec.ensures, applied to _ => condition.

The name in SIR of the function behind Spec.ensures, applied to _ => condition.

Attributes

val Ensuring: String

The name of Spec.ensuring in SIR.

The name of Spec.ensuring in SIR.

Attributes

val Expects: String

The name of Spec.expects in SIR.

The name of Spec.expects in SIR.

Attributes