-- GeNeRaTeD fOr: ../../CBS-beta/Funcons-beta/Computations/Normal/Generating/Generating.cbs
{-# LANGUAGE OverloadedStrings #-}

module Funcons.Core.Computations.Normal.Generating.Generating where

import Funcons.EDSL

import Funcons.Operations hiding (Values,libFromList)
entities :: [a]
entities = []

types :: TypeRelation
types = [(Name, DataTypeMembers)] -> TypeRelation
typeEnvFromList
    []

funcons :: FunconLibrary
funcons = [(Name, EvalFunction)] -> FunconLibrary
libFromList
    [(Name
"fresh-atom",NullaryFuncon -> EvalFunction
NullaryFuncon NullaryFuncon
stepFresh_atom),(Name
"use-atom-not-in",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepUse_atom_not_in)]

fresh_atom_ :: Funcons
fresh_atom_ = Name -> Funcons
FName Name
"fresh-atom"
stepFresh_atom :: NullaryFuncon
stepFresh_atom = [NullaryFuncon] -> [MSOS StepRes] -> NullaryFuncon
evalRules [] [MSOS StepRes
step1]
    where step1 :: MSOS StepRes
step1 = do
            let env :: Map k a
env = Map k a
forall k a. Map k a
emptyEnv
            Env
env <- Name -> VPattern -> Env -> MSOS Env
getMutPatt Name
"used-atom-set" (MetaVar -> VPattern
VPMetaVar MetaVar
"SA") Env
forall k a. Map k a
env
            Env
env <- SideCondition -> Env -> MSOS Env
lifted_sideCondition (FTerm -> [VPattern] -> SideCondition
SCPatternMatch (Name -> [FTerm] -> FTerm
TApp Name
"element-not-in" [Name -> FTerm
TName Name
"atoms",MetaVar -> FTerm
TVar MetaVar
"SA"]) [MetaVar -> VPattern
VPMetaVar MetaVar
"A"]) Env
env
            Name -> FTerm -> Env -> MSOS ()
putMutTerm Name
"used-atom-set" (Name -> [FTerm] -> FTerm
TApp Name
"set-insert" [MetaVar -> FTerm
TVar MetaVar
"A",MetaVar -> FTerm
TVar MetaVar
"SA"]) Env
env
            FTerm -> Env -> MSOS StepRes
stepTermTo (MetaVar -> FTerm
TVar MetaVar
"A") Env
env

use_atom_not_in_ :: [Funcons] -> Funcons
use_atom_not_in_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"use-atom-not-in" ([Funcons]
fargs)
stepUse_atom_not_in :: StrictFuncon
stepUse_atom_not_in [Values]
fargs =
    [NullaryFuncon] -> [MSOS StepRes] -> NullaryFuncon
evalRules [] [MSOS StepRes
step1]
    where step1 :: MSOS StepRes
step1 = do
            let env :: Map k a
env = Map k a
forall k a. Map k a
emptyEnv
            Env
env <- [Values] -> [VPattern] -> Env -> MSOS Env
lifted_vsMatch [Values]
fargs [VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> VPattern
VPMetaVar MetaVar
"SA") (Name -> [FTerm] -> FTerm
TApp Name
"sets" [Name -> FTerm
TName Name
"atoms"])] Env
forall k a. Map k a
env
            Env
env <- Name -> VPattern -> Env -> MSOS Env
getMutPatt Name
"used-atom-set" (MetaVar -> VPattern
VPMetaVar MetaVar
"SA'") Env
env
            Env
env <- SideCondition -> Env -> MSOS Env
lifted_sideCondition (FTerm -> [VPattern] -> SideCondition
SCPatternMatch (Name -> [FTerm] -> FTerm
TApp Name
"element-not-in" [Name -> FTerm
TName Name
"atoms",MetaVar -> FTerm
TVar MetaVar
"SA"]) [MetaVar -> VPattern
VPMetaVar MetaVar
"A"]) Env
env
            Name -> FTerm -> Env -> MSOS ()
putMutTerm Name
"used-atom-set" (Name -> [FTerm] -> FTerm
TApp Name
"set-insert" [MetaVar -> FTerm
TVar MetaVar
"A",MetaVar -> FTerm
TVar MetaVar
"SA'"]) Env
env
            FTerm -> Env -> MSOS StepRes
stepTermTo (MetaVar -> FTerm
TVar MetaVar
"A") Env
env