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

module Funcons.Core.Values.Composite.Objects.Objects where

import Funcons.EDSL

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

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

funcons :: FunconLibrary
funcons = [(Name, EvalFunction)] -> FunconLibrary
libFromList
    [(Name
"object",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepObject),(Name
"object-identity",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepObject_identity),(Name
"object-class-name",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepObject_class_name),(Name
"object-feature-map",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepObject_feature_map),(Name
"object-subobject-sequence",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepObject_subobject_sequence),(Name
"object-tree",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepObject_tree),(Name
"object-single-inheritance-feature-map",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepObject_single_inheritance_feature_map),(Name
"objects",NullaryFuncon -> EvalFunction
NullaryFuncon NullaryFuncon
stepObjects)]

object_ :: [Funcons] -> Funcons
object_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"object" ([Funcons]
fargs)
stepObject :: StrictFuncon
stepObject [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 -> VPattern
VPMetaVar MetaVar
"_X3",MetaVar -> SeqSortOp -> VPattern
VPSeqVar MetaVar
"_X4*" 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 (Name -> FTerm
TName Name
"values") SeqSortOp
QuestionMarkOp)) Env
env
            Env
env <- SideCondition -> Env -> Rewrite Env
sideCondition (FTerm -> FTerm -> SideCondition
SCIsInSort (MetaVar -> FTerm
TVar MetaVar
"_X4*") (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
111)]),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
98)]),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
106)]),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
101)]),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
116)])])),MetaVar -> FTerm
TVar MetaVar
"_X1",MetaVar -> FTerm
TVar MetaVar
"_X2",MetaVar -> FTerm
TVar MetaVar
"_X3",MetaVar -> FTerm
TVar MetaVar
"_X4*"]) Env
env

object_identity_ :: [Funcons] -> Funcons
object_identity_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"object-identity" ([Funcons]
fargs)
stepObject_identity :: StrictFuncon
stepObject_identity [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
"object" [VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> VPattern
VPMetaVar MetaVar
"A") (Name -> FTerm
TName Name
"atoms"),VPattern -> FTerm -> VPattern
VPAnnotated VPattern
VPWildCard (Name -> FTerm
TName Name
"identifiers"),VPattern -> FTerm -> VPattern
VPAnnotated VPattern
VPWildCard (Name -> FTerm
TName Name
"environments"),VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> SeqSortOp -> VPattern
VPSeqVar MetaVar
"___" SeqSortOp
StarOp) (FTerm -> SeqSortOp -> FTerm
TSortSeq (Name -> FTerm
TName Name
"objects") SeqSortOp
StarOp)]] Env
forall k a. Map k a
env
            FTerm -> Env -> NullaryFuncon
rewriteTermTo (MetaVar -> FTerm
TVar MetaVar
"A") Env
env

object_class_name_ :: [Funcons] -> Funcons
object_class_name_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"object-class-name" ([Funcons]
fargs)
stepObject_class_name :: StrictFuncon
stepObject_class_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 [Name -> [VPattern] -> VPattern
PADT Name
"object" [VPattern -> FTerm -> VPattern
VPAnnotated VPattern
VPWildCard (Name -> FTerm
TName Name
"atoms"),VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> VPattern
VPMetaVar MetaVar
"C") (Name -> FTerm
TName Name
"identifiers"),VPattern -> FTerm -> VPattern
VPAnnotated VPattern
VPWildCard (Name -> FTerm
TName Name
"environments"),VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> SeqSortOp -> VPattern
VPSeqVar MetaVar
"___" SeqSortOp
StarOp) (FTerm -> SeqSortOp -> FTerm
TSortSeq (Name -> FTerm
TName Name
"objects") SeqSortOp
StarOp)]] Env
forall k a. Map k a
env
            FTerm -> Env -> NullaryFuncon
rewriteTermTo (MetaVar -> FTerm
TVar MetaVar
"C") Env
env

object_feature_map_ :: [Funcons] -> Funcons
object_feature_map_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"object-feature-map" ([Funcons]
fargs)
stepObject_feature_map :: StrictFuncon
stepObject_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
"object" [VPattern -> FTerm -> VPattern
VPAnnotated VPattern
VPWildCard (Name -> FTerm
TName Name
"atoms"),VPattern -> FTerm -> VPattern
VPAnnotated VPattern
VPWildCard (Name -> FTerm
TName Name
"identifiers"),VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> VPattern
VPMetaVar MetaVar
"Env") (Name -> FTerm
TName Name
"environments"),VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> SeqSortOp -> VPattern
VPSeqVar MetaVar
"___" SeqSortOp
StarOp) (FTerm -> SeqSortOp -> FTerm
TSortSeq (Name -> FTerm
TName Name
"objects") SeqSortOp
StarOp)]] Env
forall k a. Map k a
env
            FTerm -> Env -> NullaryFuncon
rewriteTermTo (MetaVar -> FTerm
TVar MetaVar
"Env") Env
env

object_subobject_sequence_ :: [Funcons] -> Funcons
object_subobject_sequence_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"object-subobject-sequence" ([Funcons]
fargs)
stepObject_subobject_sequence :: StrictFuncon
stepObject_subobject_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
"object" [VPattern -> FTerm -> VPattern
VPAnnotated VPattern
VPWildCard (Name -> FTerm
TName Name
"atoms"),VPattern -> FTerm -> VPattern
VPAnnotated VPattern
VPWildCard (Name -> FTerm
TName Name
"identifiers"),VPattern -> FTerm -> VPattern
VPAnnotated VPattern
VPWildCard (Name -> FTerm
TName Name
"environments"),VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> SeqSortOp -> VPattern
VPSeqVar MetaVar
"O*" SeqSortOp
StarOp) (FTerm -> SeqSortOp -> FTerm
TSortSeq (Name -> FTerm
TName Name
"objects") SeqSortOp
StarOp)]] Env
forall k a. Map k a
env
            FTerm -> Env -> NullaryFuncon
rewriteTermTo (MetaVar -> FTerm
TVar MetaVar
"O*") Env
env

object_tree_ :: [Funcons] -> Funcons
object_tree_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"object-tree" ([Funcons]
fargs)
stepObject_tree :: StrictFuncon
stepObject_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
"O") (Name -> FTerm
TName Name
"objects")] Env
forall k a. Map k a
env
            FTerm -> Env -> NullaryFuncon
rewriteTermTo (Name -> [FTerm] -> FTerm
TApp Name
"tree" [MetaVar -> FTerm
TVar MetaVar
"O",Name -> [FTerm] -> FTerm
TApp Name
"interleave-map" [Name -> [FTerm] -> FTerm
TApp Name
"object-tree" [Name -> FTerm
TName Name
"given"],Name -> [FTerm] -> FTerm
TApp Name
"object-subobject-sequence" [MetaVar -> FTerm
TVar MetaVar
"O"]]]) Env
env

object_single_inheritance_feature_map_ :: [Funcons] -> Funcons
object_single_inheritance_feature_map_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"object-single-inheritance-feature-map" ([Funcons]
fargs)
stepObject_single_inheritance_feature_map :: StrictFuncon
stepObject_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
"O") (Name -> FTerm
TName Name
"objects")] Env
forall k a. Map k a
env
            FTerm -> Env -> NullaryFuncon
rewriteTermTo (Name -> [FTerm] -> FTerm
TApp Name
"map-override" [Name -> [FTerm] -> FTerm
TApp Name
"left-to-right-map" [Name -> [FTerm] -> FTerm
TApp Name
"object-feature-map" [Name -> FTerm
TName Name
"given"],Name -> [FTerm] -> FTerm
TApp Name
"single-branching-sequence" [Name -> [FTerm] -> FTerm
TApp Name
"object-tree" [MetaVar -> FTerm
TVar MetaVar
"O"]]]]) Env
env

objects_ :: Funcons
objects_ = Name -> Funcons
FName Name
"objects"
stepObjects :: NullaryFuncon
stepObjects = Name -> StrictFuncon
rewriteType Name
"objects" []