-- GeNeRaTeD fOr: ../../CBS/Funcons/Computations/Control flow/Normal/Sequencing/atomic.aterm {-# LANGUAGE OverloadedStrings #-} module Funcons.Core.Computations.ControlFlow.Normal.Sequencing.Atomic where import Funcons.EDSL entities = [] types = typeEnvFromList [] funcons = libFromList [("atomic",NonStrictFuncon stepAtomic)] -- | -- /atomic(X)/ treats the complete evaluation of /X/ as one step, -- regardless of how many steps that evaluation actually takes. atomic_ fargs = FApp "atomic" (FTuple fargs) stepAtomic fargs = evalRules [rewrite1] [step1] where rewrite1 = do let env = emptyEnv env <- fsMatch fargs [PAnnotated (PMetaVar "V") (TName "values")] env rewriteTermTo (TVar "V") env step1 = do let env = emptyEnv env <- lifted_fsMatch fargs [PMetaVar "X"] env env <- premise (TVar "X") (PMetaVar "X'") env env <- premise (TApp "atomic" (TTuple [TVar "X'"])) (PMetaVar "V") env stepTermTo (TVar "V") env