funcons-tools-0.1.0.0: cbs/Funcons/Core/Computations/DataFlow/Binding/Bound.hs
-- GeNeRaTeD fOr: ../../CBS/Funcons/Computations/Data flow/Binding/bound.aterm
{-# LANGUAGE OverloadedStrings #-}
module Funcons.Core.Computations.DataFlow.Binding.Bound where
import Funcons.EDSL
entities = []
types = typeEnvFromList
[]
funcons = libFromList
[("bound",StrictFuncon stepBound)]
-- |
-- /bound(B)/ returns the value currently bound to the binder /B/ ,
bound_ fargs = FApp "bound" (FTuple fargs)
stepBound fargs =
evalRules [] [step1,step2]
where step1 = do
let env = emptyEnv
env <- lifted_vsMatch fargs [VPMetaVar "B"] env
env <- getInhPatt "environment" (VPMetaVar "Rho") env
env <- lifted_sideCondition (SCEquality (TApp "is-in-set" (TTuple [TVar "B",TApp "domain" (TTuple [TVar "Rho"])])) (TName "true")) env
stepTermTo (TApp "lookup" (TTuple [TVar "B",TVar "Rho"])) env
step2 = do
let env = emptyEnv
env <- lifted_vsMatch fargs [VPMetaVar "B"] env
env <- getInhPatt "environment" (VPMetaVar "Rho") env
env <- lifted_sideCondition (SCEquality (TApp "is-in-set" (TTuple [TVar "B",TApp "domain" (TTuple [TVar "Rho"])])) (TName "false")) env
stepTo (FName "fail")