-- GeNeRaTeD fOr: ../../CBS/Funcons/Computations/Data flow/Storing/Simple variables/deallocate-variable.aterm {-# LANGUAGE OverloadedStrings #-} module Funcons.Core.Computations.DataFlow.Storing.SimpleVariables.DeallocateVariable where import Funcons.EDSL entities = [] types = typeEnvFromList [] funcons = libFromList [("deallocate-variable",StrictFuncon stepDeallocate_variable)] -- | -- /deallocate-variable(V)/ deletes the variable /V/ from the current /store/ . deallocate_variable_ fargs = FApp "deallocate-variable" (FTuple fargs) stepDeallocate_variable fargs = evalRules [] [step1,step2] where step1 = do let env = emptyEnv env <- lifted_vsMatch fargs [VPMetaVar "Var"] env env <- getMutPatt "store" (VPMetaVar "Sigma") env env <- lifted_sideCondition (SCEquality (TApp "is-in-set" (TTuple [TVar "Var",TApp "domain" (TTuple [TVar "Sigma"])])) (TName "true")) env putMutTerm "store" (TTuple [TApp "map-delete" (TTuple [TVar "Sigma",TSet [TVar "Var"]])]) env stepTo (FTuple []) step2 = do let env = emptyEnv env <- lifted_vsMatch fargs [VPMetaVar "Var"] env env <- getMutPatt "store" (VPMetaVar "Sigma") env env <- lifted_sideCondition (SCEquality (TApp "is-in-set" (TTuple [TVar "Var",TApp "domain" (TTuple [TVar "Sigma"])])) (TName "false")) env putMutTerm "store" (TTuple [TVar "Sigma"]) env stepTo (FName "fail")