plutus-core-0.1.0.0: Language library for Plutus Core
Safe HaskellNone
LanguageHaskell2010

UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Description

The CEK machine. The CEK machine relies on variables having non-equal Uniques whenever they have non-equal string names. I.e. Uniques are used instead of string names. This is for efficiency reasons. The CEK machines handles name capture by design.

Synopsis

Documentation

data EvaluationResult a Source #

The parameterized type of results various evaluation engines return. On the PLC side this becomes (via makeKnown) either a call to Error or a value of the PLC counterpart of type a.

Instances

Instances details
Monad EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Functor EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

MonadFail EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Applicative EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Foldable EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Methods

fold :: Monoid m => EvaluationResult m -> m Source #

foldMap :: Monoid m => (a -> m) -> EvaluationResult a -> m Source #

foldMap' :: Monoid m => (a -> m) -> EvaluationResult a -> m Source #

foldr :: (a -> b -> b) -> b -> EvaluationResult a -> b Source #

foldr' :: (a -> b -> b) -> b -> EvaluationResult a -> b Source #

foldl :: (b -> a -> b) -> b -> EvaluationResult a -> b Source #

foldl' :: (b -> a -> b) -> b -> EvaluationResult a -> b Source #

foldr1 :: (a -> a -> a) -> EvaluationResult a -> a Source #

foldl1 :: (a -> a -> a) -> EvaluationResult a -> a Source #

toList :: EvaluationResult a -> [a] Source #

null :: EvaluationResult a -> Bool Source #

length :: EvaluationResult a -> Int Source #

elem :: Eq a => a -> EvaluationResult a -> Bool Source #

maximum :: Ord a => EvaluationResult a -> a Source #

minimum :: Ord a => EvaluationResult a -> a Source #

sum :: Num a => EvaluationResult a -> a Source #

product :: Num a => EvaluationResult a -> a Source #

Traversable EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Alternative EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

MonadError () EvaluationResult Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

KnownTypeIn uni val a => KnownTypeIn uni val (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownType

Methods

makeKnown :: (MonadError (ErrorWithCause err cause) m, AsEvaluationFailure err) => (Text -> m ()) -> Maybe cause -> EvaluationResult a -> m val Source #

readKnown :: (AsUnliftingError err, AsEvaluationFailure err) => Maybe cause -> val -> Either (ErrorWithCause err cause) (EvaluationResult a) Source #

PrettyBy config a => PrettyBy config (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Methods

prettyBy :: config -> EvaluationResult a -> Doc ann Source #

prettyListBy :: config -> [EvaluationResult a] -> Doc ann Source #

Eq a => Eq (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Show a => Show (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Generic (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Associated Types

type Rep (EvaluationResult a) :: Type -> Type Source #

NFData a => NFData (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

Methods

rnf :: EvaluationResult a -> () Source #

PrettyClassic a => Pretty (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

KnownTypeAst uni a => KnownTypeAst uni (EvaluationResult a :: Type) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownTypeAst

Associated Types

type ToHoles (EvaluationResult a) :: [Hole] Source #

type ToBinds (EvaluationResult a) :: [Some TyNameRep] Source #

Methods

toTypeAst :: proxy (EvaluationResult a) -> Type0 TyName uni () Source #

type Rep (EvaluationResult a) Source # 
Instance details

Defined in PlutusCore.Evaluation.Result

type Rep (EvaluationResult a) = D1 ('MetaData "EvaluationResult" "PlutusCore.Evaluation.Result" "plutus-core-0.1.0.0-75cTOscXcmAHq1cwUst1Y0" 'False) (C1 ('MetaCons "EvaluationSuccess" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "EvaluationFailure" 'PrefixI 'False) (U1 :: Type -> Type))
type ToHoles (EvaluationResult a :: Type) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownTypeAst

type ToHoles (EvaluationResult a :: Type) = '[TypeHole a :: Hole]
type ToBinds (EvaluationResult a :: Type) Source # 
Instance details

Defined in PlutusCore.Builtin.KnownTypeAst

data CekValue uni fun Source #

Constructors

VCon !(Some (ValueOf uni)) 
VDelay (Term NamedDeBruijn uni fun ()) !(CekValEnv uni fun) 
VLamAbs NamedDeBruijn (Term NamedDeBruijn uni fun ()) !(CekValEnv uni fun) 
VBuiltin !fun (Term NamedDeBruijn uni fun ()) (CekValEnv uni fun) !(BuiltinRuntime (CekValue uni fun)) 

Instances

Instances details
(Closed uni, GShow uni, Everywhere uni PrettyConst, Pretty fun) => PrettyBy PrettyConfigPlc (CekValue uni fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

prettyBy :: PrettyConfigPlc -> CekValue uni fun -> Doc ann Source #

prettyListBy :: PrettyConfigPlc -> [CekValue uni fun] -> Doc ann Source #

Show (BuiltinRuntime (CekValue uni fun)) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

(Everywhere uni Show, GShow uni, Closed uni, Show fun) => Show (CekValue uni fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

showsPrec :: Int -> CekValue uni fun -> ShowS Source #

show :: CekValue uni fun -> String Source #

showList :: [CekValue uni fun] -> ShowS Source #

FromConstant (CekValue uni fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

fromConstant :: Some (ValueOf (UniOf (CekValue uni fun))) -> CekValue uni fun Source #

AsConstant (CekValue uni fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

asConstant :: (MonadError (ErrorWithCause err cause) m, AsUnliftingError err) => Maybe cause -> CekValue uni fun -> m (Some (ValueOf (UniOf (CekValue uni fun)))) Source #

type UniOf (CekValue uni fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

type UniOf (CekValue uni fun) = uni

data CekUserError Source #

Constructors

CekOutOfExError ExRestrictingBudget

The final overspent (i.e. negative) budget.

CekEvaluationFailure

Error has been called or a builtin application has failed

Instances

Instances details
Eq CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Show CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Generic CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Associated Types

type Rep CekUserError :: Type -> Type Source #

NFData CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

rnf :: CekUserError -> () Source #

Pretty CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

HasErrorCode CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

AsEvaluationFailure CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

PrettyUni uni fun => MonadError (CekEvaluationException NamedDeBruijn uni fun) (CekM uni fun s) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

throwError :: CekEvaluationException NamedDeBruijn uni fun -> CekM uni fun s a Source #

catchError :: CekM uni fun s a -> (CekEvaluationException NamedDeBruijn uni fun -> CekM uni fun s a) -> CekM uni fun s a Source #

type Rep CekUserError Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

type Rep CekUserError = D1 ('MetaData "CekUserError" "UntypedPlutusCore.Evaluation.Machine.Cek.Internal" "plutus-core-0.1.0.0-75cTOscXcmAHq1cwUst1Y0" 'False) (C1 ('MetaCons "CekOutOfExError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ExRestrictingBudget)) :+: C1 ('MetaCons "CekEvaluationFailure" 'PrefixI 'False) (U1 :: Type -> Type))

type CekEvaluationException name uni fun = EvaluationException CekUserError (MachineError fun) (Term name uni fun ()) Source #

The CEK machine-specific EvaluationException.

newtype CekBudgetSpender uni fun s Source #

The CEK machine is parameterized over a spendBudget function. This makes the budgeting machinery extensible and allows us to separate budgeting logic from evaluation logic and avoid branching on the union of all possible budgeting state types during evaluation.

Constructors

CekBudgetSpender 

Fields

data ExBudgetInfo cost uni fun s Source #

Runtime budgeting info.

Constructors

ExBudgetInfo 

Fields

newtype ExBudgetMode cost uni fun Source #

A budgeting mode to execute the CEK machine in.

Constructors

ExBudgetMode 

Fields

type CekEmitter uni fun s = Text -> CekM uni fun s () Source #

The CEK machine is parameterized over an emitter function, similar to CekBudgetSpender.

data CekEmitterInfo uni fun s Source #

Runtime emitter info, similar to ExBudgetInfo.

newtype EmitterMode uni fun Source #

An emitting mode to execute the CEK machine in, similar to ExBudgetMode.

Constructors

EmitterMode 

Fields

newtype CekM uni fun s a Source #

The monad the CEK machine runs in.

Constructors

CekM 

Fields

Instances

Instances details
Monad (CekM uni fun s) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

(>>=) :: CekM uni fun s a -> (a -> CekM uni fun s b) -> CekM uni fun s b Source #

(>>) :: CekM uni fun s a -> CekM uni fun s b -> CekM uni fun s b Source #

return :: a -> CekM uni fun s a Source #

Functor (CekM uni fun s) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

fmap :: (a -> b) -> CekM uni fun s a -> CekM uni fun s b Source #

(<$) :: a -> CekM uni fun s b -> CekM uni fun s a Source #

Applicative (CekM uni fun s) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

pure :: a -> CekM uni fun s a Source #

(<*>) :: CekM uni fun s (a -> b) -> CekM uni fun s a -> CekM uni fun s b Source #

liftA2 :: (a -> b -> c) -> CekM uni fun s a -> CekM uni fun s b -> CekM uni fun s c Source #

(*>) :: CekM uni fun s a -> CekM uni fun s b -> CekM uni fun s b Source #

(<*) :: CekM uni fun s a -> CekM uni fun s b -> CekM uni fun s a Source #

PrettyUni uni fun => MonadError (CekEvaluationException NamedDeBruijn uni fun) (CekM uni fun s) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

throwError :: CekEvaluationException NamedDeBruijn uni fun -> CekM uni fun s a Source #

catchError :: CekM uni fun s a -> (CekEvaluationException NamedDeBruijn uni fun -> CekM uni fun s a) -> CekM uni fun s a Source #

data ErrorWithCause err cause Source #

An error and (optionally) what caused it.

Constructors

ErrorWithCause 

Fields

Instances

Instances details
Bifunctor ErrorWithCause Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

bimap :: (a -> b) -> (c -> d) -> ErrorWithCause a c -> ErrorWithCause b d Source #

first :: (a -> b) -> ErrorWithCause a c -> ErrorWithCause b c Source #

second :: (b -> c) -> ErrorWithCause a b -> ErrorWithCause a c Source #

(PrettyBy config cause, PrettyBy config err) => PrettyBy config (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

prettyBy :: config -> ErrorWithCause err cause -> Doc ann Source #

prettyListBy :: config -> [ErrorWithCause err cause] -> Doc ann Source #

Functor (ErrorWithCause err) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

fmap :: (a -> b) -> ErrorWithCause err a -> ErrorWithCause err b Source #

(<$) :: a -> ErrorWithCause err b -> ErrorWithCause err a Source #

Foldable (ErrorWithCause err) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

fold :: Monoid m => ErrorWithCause err m -> m Source #

foldMap :: Monoid m => (a -> m) -> ErrorWithCause err a -> m Source #

foldMap' :: Monoid m => (a -> m) -> ErrorWithCause err a -> m Source #

foldr :: (a -> b -> b) -> b -> ErrorWithCause err a -> b Source #

foldr' :: (a -> b -> b) -> b -> ErrorWithCause err a -> b Source #

foldl :: (b -> a -> b) -> b -> ErrorWithCause err a -> b Source #

foldl' :: (b -> a -> b) -> b -> ErrorWithCause err a -> b Source #

foldr1 :: (a -> a -> a) -> ErrorWithCause err a -> a Source #

foldl1 :: (a -> a -> a) -> ErrorWithCause err a -> a Source #

toList :: ErrorWithCause err a -> [a] Source #

null :: ErrorWithCause err a -> Bool Source #

length :: ErrorWithCause err a -> Int Source #

elem :: Eq a => a -> ErrorWithCause err a -> Bool Source #

maximum :: Ord a => ErrorWithCause err a -> a Source #

minimum :: Ord a => ErrorWithCause err a -> a Source #

sum :: Num a => ErrorWithCause err a -> a Source #

product :: Num a => ErrorWithCause err a -> a Source #

Traversable (ErrorWithCause err) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

traverse :: Applicative f => (a -> f b) -> ErrorWithCause err a -> f (ErrorWithCause err b) Source #

sequenceA :: Applicative f => ErrorWithCause err (f a) -> f (ErrorWithCause err a) Source #

mapM :: Monad m => (a -> m b) -> ErrorWithCause err a -> m (ErrorWithCause err b) Source #

sequence :: Monad m => ErrorWithCause err (m a) -> m (ErrorWithCause err a) Source #

(Eq err, Eq cause) => Eq (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

(==) :: ErrorWithCause err cause -> ErrorWithCause err cause -> Bool Source #

(/=) :: ErrorWithCause err cause -> ErrorWithCause err cause -> Bool Source #

(PrettyPlc cause, PrettyPlc err) => Show (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

showsPrec :: Int -> ErrorWithCause err cause -> ShowS Source #

show :: ErrorWithCause err cause -> String Source #

showList :: [ErrorWithCause err cause] -> ShowS Source #

Generic (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Associated Types

type Rep (ErrorWithCause err cause) :: Type -> Type Source #

Methods

from :: ErrorWithCause err cause -> Rep (ErrorWithCause err cause) x Source #

to :: Rep (ErrorWithCause err cause) x -> ErrorWithCause err cause Source #

(PrettyPlc cause, PrettyPlc err, Typeable cause, Typeable err) => Exception (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

(NFData err, NFData cause) => NFData (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

rnf :: ErrorWithCause err cause -> () Source #

(Pretty err, Pretty cause) => Pretty (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

pretty :: ErrorWithCause err cause -> Doc ann Source #

prettyList :: [ErrorWithCause err cause] -> Doc ann Source #

HasErrorCode err => HasErrorCode (ErrorWithCause err t) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

AsEvaluationFailure err => AsEvaluationFailure (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

PrettyUni uni fun => MonadError (CekEvaluationException NamedDeBruijn uni fun) (CekM uni fun s) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

throwError :: CekEvaluationException NamedDeBruijn uni fun -> CekM uni fun s a Source #

catchError :: CekM uni fun s a -> (CekEvaluationException NamedDeBruijn uni fun -> CekM uni fun s a) -> CekM uni fun s a Source #

type Rep (ErrorWithCause err cause) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

type Rep (ErrorWithCause err cause) = D1 ('MetaData "ErrorWithCause" "PlutusCore.Evaluation.Machine.Exception" "plutus-core-0.1.0.0-75cTOscXcmAHq1cwUst1Y0" 'False) (C1 ('MetaCons "ErrorWithCause" 'PrefixI 'True) (S1 ('MetaSel ('Just "_ewcError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 err) :*: S1 ('MetaSel ('Just "_ewcCause") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe cause))))

data EvaluationError user internal Source #

The type of errors (all of them) which can occur during evaluation (some are used-caused, some are internal).

Constructors

InternalEvaluationError internal

Indicates bugs.

UserEvaluationError user

Indicates user errors.

Instances

Instances details
(HasPrettyDefaults config ~ 'True, PrettyBy config internal, Pretty user) => PrettyBy config (EvaluationError user internal) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

prettyBy :: config -> EvaluationError user internal -> Doc ann Source #

prettyListBy :: config -> [EvaluationError user internal] -> Doc ann Source #

Functor (EvaluationError user) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

fmap :: (a -> b) -> EvaluationError user a -> EvaluationError user b Source #

(<$) :: a -> EvaluationError user b -> EvaluationError user a Source #

(Eq internal, Eq user) => Eq (EvaluationError user internal) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

(==) :: EvaluationError user internal -> EvaluationError user internal -> Bool Source #

(/=) :: EvaluationError user internal -> EvaluationError user internal -> Bool Source #

(Show internal, Show user) => Show (EvaluationError user internal) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

showsPrec :: Int -> EvaluationError user internal -> ShowS Source #

show :: EvaluationError user internal -> String Source #

showList :: [EvaluationError user internal] -> ShowS Source #

Generic (EvaluationError user internal) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Associated Types

type Rep (EvaluationError user internal) :: Type -> Type Source #

Methods

from :: EvaluationError user internal -> Rep (EvaluationError user internal) x Source #

to :: Rep (EvaluationError user internal) x -> EvaluationError user internal Source #

(NFData internal, NFData user) => NFData (EvaluationError user internal) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

rnf :: EvaluationError user internal -> () Source #

(HasErrorCode user, HasErrorCode internal) => HasErrorCode (EvaluationError user internal) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

errorCode :: EvaluationError user internal -> ErrorCode Source #

AsEvaluationFailure user => AsEvaluationFailure (EvaluationError user internal) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

_EvaluationFailure :: Prism' (EvaluationError user internal) () Source #

AsUnliftingError internal => AsUnliftingError (EvaluationError user internal) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

internal ~ MachineError fun => AsMachineError (EvaluationError user internal) fun Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

AsEvaluationError (EvaluationError user internal) user internal Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

Methods

_EvaluationError :: Prism' (EvaluationError user internal) (EvaluationError user internal) Source #

_InternalEvaluationError :: Prism' (EvaluationError user internal) internal Source #

_UserEvaluationError :: Prism' (EvaluationError user internal) user Source #

PrettyUni uni fun => MonadError (CekEvaluationException NamedDeBruijn uni fun) (CekM uni fun s) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

throwError :: CekEvaluationException NamedDeBruijn uni fun -> CekM uni fun s a Source #

catchError :: CekM uni fun s a -> (CekEvaluationException NamedDeBruijn uni fun -> CekM uni fun s a) -> CekM uni fun s a Source #

type Rep (EvaluationError user internal) Source # 
Instance details

Defined in PlutusCore.Evaluation.Machine.Exception

type Rep (EvaluationError user internal) = D1 ('MetaData "EvaluationError" "PlutusCore.Evaluation.Machine.Exception" "plutus-core-0.1.0.0-75cTOscXcmAHq1cwUst1Y0" 'False) (C1 ('MetaCons "InternalEvaluationError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 internal)) :+: C1 ('MetaCons "UserEvaluationError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 user)))

data ExBudgetCategory fun Source #

Constructors

BStep StepKind 
BBuiltinApp fun 
BStartup 

Instances

Instances details
ExBudgetBuiltin fun (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Eq fun => Eq (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Ord fun => Ord (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Show fun => Show (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Generic (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Associated Types

type Rep (ExBudgetCategory fun) :: Type -> Type Source #

Hashable fun => Hashable (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

NFData fun => NFData (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

rnf :: ExBudgetCategory fun -> () Source #

Show fun => Pretty (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

type Rep (ExBudgetCategory fun) Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

type Rep (ExBudgetCategory fun) = D1 ('MetaData "ExBudgetCategory" "UntypedPlutusCore.Evaluation.Machine.Cek.Internal" "plutus-core-0.1.0.0-75cTOscXcmAHq1cwUst1Y0" 'False) (C1 ('MetaCons "BStep" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StepKind)) :+: (C1 ('MetaCons "BBuiltinApp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 fun)) :+: C1 ('MetaCons "BStartup" 'PrefixI 'False) (U1 :: Type -> Type)))

data StepKind Source #

Instances

Instances details
Bounded StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Enum StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Eq StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Ord StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Show StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Generic StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Associated Types

type Rep StepKind :: Type -> Type Source #

Hashable StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

NFData StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

Methods

rnf :: StepKind -> () Source #

type Rep StepKind Source # 
Instance details

Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal

type Rep StepKind = D1 ('MetaData "StepKind" "UntypedPlutusCore.Evaluation.Machine.Cek.Internal" "plutus-core-0.1.0.0-75cTOscXcmAHq1cwUst1Y0" 'False) ((C1 ('MetaCons "BConst" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "BVar" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BLamAbs" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "BApply" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BDelay" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "BForce" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BBuiltin" 'PrefixI 'False) (U1 :: Type -> Type))))

type PrettyUni uni fun = (GShow uni, Closed uni, Pretty fun, Typeable uni, Typeable fun, Everywhere uni PrettyConst) Source #

The set of constraints we need to be able to print things in universes, which we need in order to throw exceptions.

runCekDeBruijn :: (uni `Everywhere` ExMemoryUsage, Ix fun, PrettyUni uni fun) => MachineParameters CekMachineCosts CekValue uni fun -> ExBudgetMode cost uni fun -> EmitterMode uni fun -> Term NamedDeBruijn uni fun () -> (Either (CekEvaluationException NamedDeBruijn uni fun) (Term NamedDeBruijn uni fun ()), cost, [Text]) Source #

Evaluate a term using the CEK machine and keep track of costing, logging is optional.

dischargeCekValue :: CekValue uni fun -> Term NamedDeBruijn uni fun () Source #

Convert a CekValue into a Term by replacing all bound variables with the terms they're bound to (which themselves have to be obtain by recursively discharging values).