plutus-core- Language library for Plutus Core
Safe HaskellNone




checkScope :: forall e m name uni fun a. (HasIndex name, MonadError e m, AsFreeVariableError e) => Term name uni fun a -> m () Source #

A pass to check that the input term: 1) does not contain free variables and 2) that all binders are set to debruijn index 0.

Feeding the result of the debruijnification to this function is expected to pass.

On the other hand, because of (2), this pass is stricter than the undebruijnification's (indirect) scope-checking, see NOTE: [DeBruijn indices of Binders].