-- GeNeRaTeD fOr: ../../CBS-beta/Funcons-beta/Values/Composite/Classes/Classes.cbs
{-# LANGUAGE OverloadedStrings #-}

module Funcons.Core.Values.Composite.Classes.Classes where

import Funcons.EDSL

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

types :: TypeRelation
types = [(Name, DataTypeMembers)] -> TypeRelation
typeEnvFromList
    [(Name
"classes",Name -> [TPattern] -> [DataTypeAltt] -> DataTypeMembers
DataTypeMemberss Name
"classes" [] [Name -> [FTerm] -> Maybe [TPattern] -> DataTypeAltt
DataTypeMemberConstructor Name
"class" [Name -> [FTerm] -> FTerm
TApp Name
"thunks" [Name -> [FTerm] -> FTerm
TApp Name
"references" [Name -> FTerm
TName Name
"objects"]],Name -> FTerm
TName Name
"environments",FTerm -> SeqSortOp -> FTerm
TSortSeq (Name -> FTerm
TName Name
"identifiers") SeqSortOp
StarOp] ([TPattern] -> Maybe [TPattern]
forall a. a -> Maybe a
Just [])])]

funcons :: FunconLibrary
funcons = [(Name, EvalFunction)] -> FunconLibrary
libFromList
    [(Name
"class",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepClass),(Name
"class-instantiator",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepClass_instantiator),(Name
"class-feature-map",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepClass_feature_map),(Name
"class-superclass-name-sequence",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepClass_superclass_name_sequence),(Name
"class-name-tree",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepClass_name_tree),(Name
"is-subclass-name",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepIs_subclass_name),(Name
"class-name-single-inheritance-feature-map",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepClass_name_single_inheritance_feature_map),(Name
"classes",NullaryFuncon -> EvalFunction
NullaryFuncon NullaryFuncon
stepClasses)]

class_ :: [Funcons] -> Funcons
class_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"class" ([Funcons]
fargs)
stepClass :: StrictFuncon
stepClass [Values]
fargs =
    [NullaryFuncon] -> [MSOS StepRes] -> NullaryFuncon
evalRules [NullaryFuncon
rewrite1] []
    where rewrite1 :: NullaryFuncon
rewrite1 = do
            let env :: Map k a
env = Map k a
forall k a. Map k a
emptyEnv
            Env
env <- [Values] -> [VPattern] -> Env -> Rewrite Env
vsMatch [Values]
fargs [MetaVar -> VPattern
VPMetaVar MetaVar
"_X1",MetaVar -> VPattern
VPMetaVar MetaVar
"_X2",MetaVar -> SeqSortOp -> VPattern
VPSeqVar MetaVar
"_X3*" SeqSortOp
StarOp] Env
forall k a. Map k a
env
            Env
env <- SideCondition -> Env -> Rewrite Env
sideCondition (FTerm -> FTerm -> SideCondition
SCIsInSort (MetaVar -> FTerm
TVar MetaVar
"_X1") (FTerm -> SeqSortOp -> FTerm
TSortSeq (Name -> FTerm
TName Name
"values") SeqSortOp
QuestionMarkOp)) Env
env
            Env
env <- SideCondition -> Env -> Rewrite Env
sideCondition (FTerm -> FTerm -> SideCondition
SCIsInSort (MetaVar -> FTerm
TVar MetaVar
"_X2") (FTerm -> SeqSortOp -> FTerm
TSortSeq (Name -> FTerm
TName Name
"values") SeqSortOp
QuestionMarkOp)) Env
env
            Env
env <- SideCondition -> Env -> Rewrite Env
sideCondition (FTerm -> FTerm -> SideCondition
SCIsInSort (MetaVar -> FTerm
TVar MetaVar
"_X3*") (FTerm -> SeqSortOp -> FTerm
TSortSeq (FTerm -> SeqSortOp -> FTerm
TSortSeq (Name -> FTerm
TName Name
"values") SeqSortOp
QuestionMarkOp) SeqSortOp
StarOp)) Env
env
            FTerm -> Env -> NullaryFuncon
rewriteTermTo (Name -> [FTerm] -> FTerm
TApp Name
"datatype-value" [Funcons -> FTerm
TFuncon (Values -> Funcons
FValue (Name -> [Funcons] -> Values
forall t. Name -> [t] -> Values t
ADTVal Name
"list" [Values -> Funcons
FValue (Name -> [Funcons] -> Values
forall t. Name -> [t] -> Values t
ADTVal Name
"unicode-character" [Values -> Funcons
FValue (Integer -> Values
forall t. Integer -> Values t
Int Integer
99)]),Values -> Funcons
FValue (Name -> [Funcons] -> Values
forall t. Name -> [t] -> Values t
ADTVal Name
"unicode-character" [Values -> Funcons
FValue (Integer -> Values
forall t. Integer -> Values t
Int Integer
108)]),Values -> Funcons
FValue (Name -> [Funcons] -> Values
forall t. Name -> [t] -> Values t
ADTVal Name
"unicode-character" [Values -> Funcons
FValue (Integer -> Values
forall t. Integer -> Values t
Int Integer
97)]),Values -> Funcons
FValue (Name -> [Funcons] -> Values
forall t. Name -> [t] -> Values t
ADTVal Name
"unicode-character" [Values -> Funcons
FValue (Integer -> Values
forall t. Integer -> Values t
Int Integer
115)]),Values -> Funcons
FValue (Name -> [Funcons] -> Values
forall t. Name -> [t] -> Values t
ADTVal Name
"unicode-character" [Values -> Funcons
FValue (Integer -> Values
forall t. Integer -> Values t
Int Integer
115)])])),MetaVar -> FTerm
TVar MetaVar
"_X1",MetaVar -> FTerm
TVar MetaVar
"_X2",MetaVar -> FTerm
TVar MetaVar
"_X3*"]) Env
env

class_instantiator_ :: [Funcons] -> Funcons
class_instantiator_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"class-instantiator" ([Funcons]
fargs)
stepClass_instantiator :: StrictFuncon
stepClass_instantiator [Values]
fargs =
    [NullaryFuncon] -> [MSOS StepRes] -> NullaryFuncon
evalRules [NullaryFuncon
rewrite1] []
    where rewrite1 :: NullaryFuncon
rewrite1 = do
            let env :: Map k a
env = Map k a
forall k a. Map k a
emptyEnv
            Env
env <- [Values] -> [VPattern] -> Env -> Rewrite Env
vsMatch [Values]
fargs [Name -> [VPattern] -> VPattern
PADT Name
"class" [VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> VPattern
VPMetaVar MetaVar
"Thunk") (Name -> [FTerm] -> FTerm
TApp Name
"thunks" [FTerm -> SeqSortOp -> FTerm
TSortSeq (Name -> FTerm
TName Name
"values") SeqSortOp
QuestionMarkOp]),VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> VPattern
VPMetaVar MetaVar
"Envs") (Name -> FTerm
TName Name
"environments"),VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> SeqSortOp -> VPattern
VPSeqVar MetaVar
"C*" SeqSortOp
StarOp) (FTerm -> SeqSortOp -> FTerm
TSortSeq (Name -> FTerm
TName Name
"identifiers") SeqSortOp
StarOp)]] Env
forall k a. Map k a
env
            FTerm -> Env -> NullaryFuncon
rewriteTermTo (MetaVar -> FTerm
TVar MetaVar
"Thunk") Env
env

class_feature_map_ :: [Funcons] -> Funcons
class_feature_map_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"class-feature-map" ([Funcons]
fargs)
stepClass_feature_map :: StrictFuncon
stepClass_feature_map [Values]
fargs =
    [NullaryFuncon] -> [MSOS StepRes] -> NullaryFuncon
evalRules [NullaryFuncon
rewrite1] []
    where rewrite1 :: NullaryFuncon
rewrite1 = do
            let env :: Map k a
env = Map k a
forall k a. Map k a
emptyEnv
            Env
env <- [Values] -> [VPattern] -> Env -> Rewrite Env
vsMatch [Values]
fargs [Name -> [VPattern] -> VPattern
PADT Name
"class" [VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> VPattern
VPMetaVar MetaVar
"Thunk") (Name -> [FTerm] -> FTerm
TApp Name
"thunks" [FTerm -> SeqSortOp -> FTerm
TSortSeq (Name -> FTerm
TName Name
"values") SeqSortOp
QuestionMarkOp]),VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> VPattern
VPMetaVar MetaVar
"Env") (Name -> FTerm
TName Name
"environments"),VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> SeqSortOp -> VPattern
VPSeqVar MetaVar
"C*" SeqSortOp
StarOp) (FTerm -> SeqSortOp -> FTerm
TSortSeq (Name -> FTerm
TName Name
"identifiers") SeqSortOp
StarOp)]] Env
forall k a. Map k a
env
            FTerm -> Env -> NullaryFuncon
rewriteTermTo (MetaVar -> FTerm
TVar MetaVar
"Env") Env
env

class_superclass_name_sequence_ :: [Funcons] -> Funcons
class_superclass_name_sequence_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"class-superclass-name-sequence" ([Funcons]
fargs)
stepClass_superclass_name_sequence :: StrictFuncon
stepClass_superclass_name_sequence [Values]
fargs =
    [NullaryFuncon] -> [MSOS StepRes] -> NullaryFuncon
evalRules [NullaryFuncon
rewrite1] []
    where rewrite1 :: NullaryFuncon
rewrite1 = do
            let env :: Map k a
env = Map k a
forall k a. Map k a
emptyEnv
            Env
env <- [Values] -> [VPattern] -> Env -> Rewrite Env
vsMatch [Values]
fargs [Name -> [VPattern] -> VPattern
PADT Name
"class" [VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> VPattern
VPMetaVar MetaVar
"Thunk") (Name -> [FTerm] -> FTerm
TApp Name
"thunks" [FTerm -> SeqSortOp -> FTerm
TSortSeq (Name -> FTerm
TName Name
"values") SeqSortOp
QuestionMarkOp]),VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> VPattern
VPMetaVar MetaVar
"Env") (Name -> FTerm
TName Name
"environments"),VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> SeqSortOp -> VPattern
VPSeqVar MetaVar
"C*" SeqSortOp
StarOp) (FTerm -> SeqSortOp -> FTerm
TSortSeq (Name -> FTerm
TName Name
"identifiers") SeqSortOp
StarOp)]] Env
forall k a. Map k a
env
            FTerm -> Env -> NullaryFuncon
rewriteTermTo (MetaVar -> FTerm
TVar MetaVar
"C*") Env
env

class_name_tree_ :: [Funcons] -> Funcons
class_name_tree_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"class-name-tree" ([Funcons]
fargs)
stepClass_name_tree :: StrictFuncon
stepClass_name_tree [Values]
fargs =
    [NullaryFuncon] -> [MSOS StepRes] -> NullaryFuncon
evalRules [NullaryFuncon
rewrite1] []
    where rewrite1 :: NullaryFuncon
rewrite1 = do
            let env :: Map k a
env = Map k a
forall k a. Map k a
emptyEnv
            Env
env <- [Values] -> [VPattern] -> Env -> Rewrite Env
vsMatch [Values]
fargs [VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> VPattern
VPMetaVar MetaVar
"C") (Name -> FTerm
TName Name
"identifiers")] Env
forall k a. Map k a
env
            FTerm -> Env -> NullaryFuncon
rewriteTermTo (Name -> [FTerm] -> FTerm
TApp Name
"tree" [MetaVar -> FTerm
TVar MetaVar
"C",Name -> [FTerm] -> FTerm
TApp Name
"interleave-map" [Name -> [FTerm] -> FTerm
TApp Name
"class-name-tree" [Name -> FTerm
TName Name
"given"],Name -> [FTerm] -> FTerm
TApp Name
"class-superclass-name-sequence" [Name -> [FTerm] -> FTerm
TApp Name
"bound-value" [MetaVar -> FTerm
TVar MetaVar
"C"]]]]) Env
env

is_subclass_name_ :: [Funcons] -> Funcons
is_subclass_name_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"is-subclass-name" ([Funcons]
fargs)
stepIs_subclass_name :: StrictFuncon
stepIs_subclass_name [Values]
fargs =
    [NullaryFuncon] -> [MSOS StepRes] -> NullaryFuncon
evalRules [NullaryFuncon
rewrite1] []
    where rewrite1 :: NullaryFuncon
rewrite1 = do
            let env :: Map k a
env = Map k a
forall k a. Map k a
emptyEnv
            Env
env <- [Values] -> [VPattern] -> Env -> Rewrite Env
vsMatch [Values]
fargs [VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> VPattern
VPMetaVar MetaVar
"C") (Name -> FTerm
TName Name
"identifiers"),VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> VPattern
VPMetaVar MetaVar
"C'") (Name -> FTerm
TName Name
"identifiers")] Env
forall k a. Map k a
env
            FTerm -> Env -> NullaryFuncon
rewriteTermTo (Name -> [FTerm] -> FTerm
TApp Name
"is-in-set" [MetaVar -> FTerm
TVar MetaVar
"C",[FTerm] -> FTerm
TSet [Name -> [FTerm] -> FTerm
TApp Name
"forest-value-sequence" [Name -> [FTerm] -> FTerm
TApp Name
"class-name-tree" [MetaVar -> FTerm
TVar MetaVar
"C'"]]]]) Env
env

class_name_single_inheritance_feature_map_ :: [Funcons] -> Funcons
class_name_single_inheritance_feature_map_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"class-name-single-inheritance-feature-map" ([Funcons]
fargs)
stepClass_name_single_inheritance_feature_map :: StrictFuncon
stepClass_name_single_inheritance_feature_map [Values]
fargs =
    [NullaryFuncon] -> [MSOS StepRes] -> NullaryFuncon
evalRules [NullaryFuncon
rewrite1] []
    where rewrite1 :: NullaryFuncon
rewrite1 = do
            let env :: Map k a
env = Map k a
forall k a. Map k a
emptyEnv
            Env
env <- [Values] -> [VPattern] -> Env -> Rewrite Env
vsMatch [Values]
fargs [VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> VPattern
VPMetaVar MetaVar
"C") (Name -> FTerm
TName Name
"identifiers")] Env
forall k a. Map k a
env
            FTerm -> Env -> NullaryFuncon
rewriteTermTo (Name -> [FTerm] -> FTerm
TApp Name
"map-override" [Name -> [FTerm] -> FTerm
TApp Name
"interleave-map" [Name -> [FTerm] -> FTerm
TApp Name
"class-feature-map" [Name -> [FTerm] -> FTerm
TApp Name
"bound-value" [Name -> FTerm
TName Name
"given"]],Name -> [FTerm] -> FTerm
TApp Name
"single-branching-sequence" [Name -> [FTerm] -> FTerm
TApp Name
"class-name-tree" [MetaVar -> FTerm
TVar MetaVar
"C"]]]]) Env
env

classes_ :: Funcons
classes_ = Name -> Funcons
FName Name
"classes"
stepClasses :: NullaryFuncon
stepClasses = Name -> StrictFuncon
rewriteType Name
"classes" []