Darren Duncan > Muldis-D-0.42.0 > Muldis::D::Core::Types_Catalog

Download:
Muldis-D-0.42.0.tar.gz

Annotate this POD

CPAN RT

Open  0
Report a bug
Source   Latest Release: Muldis-D-0.99.0

NAME ^

Muldis::D::Core::Types_Catalog - Muldis D catalog-defining data types

VERSION ^

This document is Muldis::D::Core::Types_Catalog version 0.33.0.

PREFACE ^

This document is part of the Muldis D language specification, whose root document is Muldis::D; you should read that root document before you read this one, which provides subservient details. Moreover, you should read the Muldis::D::Core document before this current document, as that forms its own tree beneath a root document branch.

DESCRIPTION ^

This document contains one or more sections that were moved here from Muldis::D::Core so that that other document would not be too large.

These core data types are more special-purpose in nature and are intended for use in defining or working with the system catalog. Those types that are nonscalar are completely defined types.

Note that whenever an attribute of one of the nonscalar types isn't significant, given the context (determined by other attributes of the same type), and should be ignored, its value is the default for its type.

Note that many of the tuple types might conceptually have name attributes, but those would actually be provided by any larger types in which they are embedded, rather than by these types themselves.

To keep things simpler for now, most constraint definitions for these types are missing, or just defined informally.

TYPE SUMMARY ^

These system-defined subtypes are specific to defining the system catalog, more or less:

    sys.std.Core.Type.Universal

        sys.std.Core.Type.Empty

        sys.std.Core.Type.Scalar

            # The following are all regular ordered scalar types.

            sys.std.Core.Type.Cat.Name
            sys.std.Core.Type.Cat.NameChain
                sys.std.Core.Type.Cat.OrdDetFuncNameChain
            sys.std.Core.Type.Cat.DeclNameChain
            sys.std.Core.Type.Cat.Comment
            sys.std.Core.Type.Cat.Order

        sys.std.Core.Type.Tuple

            # The following are all regular tuple types.

            sys.std.Core.Type.Cat.FuncHead
            sys.std.Core.Type.Cat.UpdHead
            sys.std.Core.Type.Cat.ProcHead
            sys.std.Core.Type.Cat.FuncBody
            sys.std.Core.Type.Cat.UpdBody
            sys.std.Core.Type.Cat.ProcBody
            sys.std.Core.Type.Cat.InnerFuncBody
            sys.std.Core.Type.Cat.InnerUpdBody
            sys.std.Core.Type.Cat.InnerProcBody
            sys.std.Core.Type.Cat.Type
            sys.std.Core.Type.Cat.InnerScalarType
            sys.std.Core.Type.Cat.InnerNonscalarType
            sys.std.Core.Type.Cat.InnerUnionType
            sys.std.Core.Type.Cat.InnerRestrType
            sys.std.Core.Type.Cat.DbVar
            sys.std.Core.Type.Cat.IfThenMap

            sys.std.Core.Type.Database

                # The following are all regular database types.

                sys.std.Core.Type.Cat.System
                sys.std.Core.Type.Cat.MountControlCat
                sys.std.Core.Type.Cat.Federation
                sys.std.Core.Type.Cat.Depot
                sys.std.Core.Type.Cat.Package
                sys.std.Core.Type.Cat.ExprNodeSet
                sys.std.Core.Type.Cat.StmtNodeSet
                sys.std.Core.Type.Cat.InnerTypeSet

        sys.std.Core.Type.Relation

            # The following are all regular relation types.

            sys.std.Core.Type.Cat.SysNspSet
            sys.std.Core.Type.Cat.Sys(Func|Upd|Proc)Set
            sys.std.Core.Type.Cat.SysSpecTypeSet
            sys.std.Core.Type.Cat.SysScaNPRTypeSet
            sys.std.Core.Type.Cat.SysTypeSet
            sys.std.Core.Type.Cat.SysCatSet
            sys.std.Core.Type.Cat.MountControlSet
            sys.std.Core.Type.Cat.DepotMountSet
            sys.std.Core.Type.Cat.SubdepotSet
            sys.std.Core.Type.Cat.PackageSet
            sys.std.Core.Type.Cat.Dep(Func|Upd|Proc)Set
            sys.std.Core.Type.Cat.DepTypeSet
            sys.std.Core.Type.Cat.Pkg(Func|Upd|Proc)Set
            sys.std.Core.Type.Cat.PkgTypeSet
            sys.std.Core.Type.Cat.Inner(Func|Upd|Proc)Set
            sys.std.Core.Type.Cat.ScaLitExprNodeSet
            sys.std.Core.Type.Cat.ScaPRLitExprNodeSet
            sys.std.Core.Type.Cat.TupLitExprNodeSet
            sys.std.Core.Type.Cat.RelLitExprNodeSet
            sys.std.Core.Type.Cat.FuncInvoExprNodeSet
            sys.std.Core.Type.Cat.IfElseExprNodeSet
            sys.std.Core.Type.Cat.GivenWhenDefExprNodeSet
            sys.std.Core.Type.Cat.(Func|Proc|Type)RefLitExprNodeSet
            sys.std.Core.Type.Cat.OrdDetFuncRefLitExprNodeSet
            sys.std.Core.Type.Cat.MultiUpdStmt
            sys.std.Core.Type.Cat.LeaveStmtNodeSet
            sys.std.Core.Type.Cat.CompoundStmtNodeSet
            sys.std.Core.Type.Cat.ProcInvoStmtNodeSet
            sys.std.Core.Type.Cat.IfElseStmtNodeSet
            sys.std.Core.Type.Cat.GivenWhenDefStmtNodeSet
            sys.std.Core.Type.Cat.IterateStmtNodeSet
            sys.std.Core.Type.Cat.LoopStmtNodeSet
            sys.std.Core.Type.Cat.Inner(Sca|Nonsca|Uni|Restr)TypeSet
            sys.std.Core.Type.Cat.PossrepSet
            sys.std.Core.Type.Cat.PossrepMapSet
            sys.std.Core.Type.Cat.VirtualAttrMapSet
            sys.std.Core.Type.Cat.ConstraintSet
            sys.std.Core.Type.Cat.KeySet
            sys.std.Core.Type.Cat.DistribKeySet
            sys.std.Core.Type.Cat.DKMemRelAttrMap
            sys.std.Core.Type.Cat.DKRelAttrKeyAttrMap
            sys.std.Core.Type.Cat.ForeignKeySet
            sys.std.Core.Type.Cat.ForeignDistribKeySet
            sys.std.Core.Type.Cat.FKChildAttrParentAttrMap
            sys.std.Core.Type.Cat.NameTypeMap
            sys.std.Core.Type.Cat.NameExprMap
            sys.std.Core.Type.Cat.NameDNCMap
            sys.std.Core.Type.Cat.AttrRenameMap
            sys.std.Core.Type.Cat.WhenThenMap

These system-defined subtypes can never be used as components of a system catalog, or any database, but they may be used temporarily at runtime:

    sys.std.Core.Type.Universal

        sys.std.Core.Type.Empty

        sys.std.Core.Type.QuasiScalar

            # The following are special-purpose quasi-scalar types.

            sys.std.Core.Type.Cat.FuncRef
            sys.std.Core.Type.Cat.ProcRef
            sys.std.Core.Type.Cat.TypeRef
            sys.std.Core.Type.Cat.OrdDetFuncRef

SIMPLE GENERIC SCALAR TYPES ^

sys.std.Core.Type.Cat.Name

A Cat.Name (scalar) is a canonical short name for any kind of DBMS entity (or named component) when declaring it; this short name is sufficient to identify the entity within its immediate namespace. Similarly, a DBMS entity can often be invoked or referred to using just its Cat.Name, depending on the context; other times, a Cat.NameChain must be used instead to also qualify the reference with a namespace. Cat.Name is the same as Text in representation (each value as a string of characters) and cardinality though its values are distinct; it is specifically intended for use in naming DBMS entities rather than being for general-purpose user data. The default value et al is as for Text. The Cat.Name type has a default ordering algorithm; it is the same as for Text.

sys.std.Core.Type.Cat.NameChain

A Cat.NameChain (scalar) is a canonical long name for invoking or referring to a DBMS entity, when its name needs to be qualified with a namespace. A Cat.NameChain is conceptually a sequence of 2..N Cat.Name, the 2..N elements being ordered from parent-most to child-most component name. A Cat.NameChain has 2 system-defined possreps, named array and flat, both of which are defined over Cat.Name.

The array possrep directly matches the conception of the type; it consists of 1 attribute whose name is the empty string; the attribute is an Array whose value attribute has a declared type of Cat.Name and that must have at least 2 elements.

The flat possrep consists of 1 attribute whose name is the empty string; the attribute is a Cat.Name, its value being identical to when the elements of the first possrep are catenated (in order with the first element at the start of the string), with a period (.) between the parts, and each part escaped such that backslashes, single-quotes, and periods are escaped as \b, \q and \p respectively.

The default and minimum value of Cat.NameChain is a 2 element sequence where each element is the default value of Cat.Name (the empty string); its maximum value is an infinite sequence where each element is the maximum value of Cat.Name (an infinite-length string) and practically impossible. The cardinality of this type is infinity; to define a most-generalized finite Cat.NameChain subtype, you must specify a maximum number of sequence elements of its values, and each element must be of a finite Cat.Name subtype.

The Cat.NameChain type has a default ordering algorithm; for 2 distinct Cat.NameChain values, their order is determined as follows: 1. Eliminate any identical parent-most sequence elements as those alone would make the chains compare as same (if the remainder of both strings was the empty chain, then the chains are identical). 2. Iff the remainder of just one chain is the empty chain, then that chain is ordered before the non-empty one. 3. Compare the first element of each of the chain remainders; the chain with the first remaining element that is ordered first as per its own algorithm (that of Cat.Name) is ordered before the other chain.

sys.std.Core.Type.Cat.DeclNameChain

A Cat.DeclNameChain (scalar) is mostly the same as a Cat.NameChain but that it is a sequence of 0..N rather than 2..N, and that its flat possrep has N+1 periods rather than N-1; the possrep starts with a period, and also has a period just following each sequence element, and so an empty sequence means a flat possrep consisting of just a period. A Cat.DeclNameChain is used in declaring system catalogs where DBMS entities live under a potentially N-depth namespace, such as depot entities grouped in a subdepot hierarchy. The default and minimum value of Cat.DeclNameChain is a zero element sequence. The Cat.DeclNameChain type has a default ordering algorithm; it is the same as for Cat.NameChain.

sys.std.Core.Type.Cat.Comment

A Cat.Comment (scalar) is the text of a Muldis D code comment, which programmers can populate as an attribute of several catalog data types, such as whole routines or statements or expression nodes. Cat.Comment is exactly the same as Cat.Name in representation and cardinality though its values are distinct; it is intended just for commenting Muldis D code. One main intended use of this type is to help preserve comments in code translated to or from other languages; though only a subset of those (FoxPro?) keep comments in the AST rather than discarding them. The default value et al is as for Cat.Name. The Cat.Comment type has a default ordering algorithm; it is the same as for Cat.Name.

sys.std.Core.Type.Cat.Order

A Cat.Order (order determination) is a scalar enumeration consisting of the 3 values increase, same, decrease. When some context (such as within a list sort or range check operation) needs to know the relative order of 2 values according to some criteria, it can invoke a function that applies that criteria to those 2 values, which are its main/only arguments, and that function results in a Cat.Order value for the context to make use of. A Cat.Order has 2 system-defined possreps, named name and int. The name possrep directly matches the conception of the type as an enumeration of 3 character string values; it consists of 1 Cat.Name-typed attribute whose name is the empty string. The int possrep consists of 1 Int-typed attribute whose name is the empty string and whose value must be one of [-1, 0, 1]; the 3 values of each possrep correspond in the same order as they are documented here. The default value of Cat.Order is same; its minimum and maximum values are, respectively, increase and decrease. The cardinality of this type is 3. The Cat.Order type has a default ordering algorithm; increase is ordered before same, and same before decrease.

sys.std.Core.Type.Cat.OrdDetFuncNameChain

The Cat.OrdDetFuncNameChain type is defined as a non-proper / identical subtype of the Cat.NameChain type that has a different default value, which is sys.std.Core.Scalar.order rather than .. This type is conceptually intended for use as the declared type of a routine parameter that would take the name of an order_determination function, but that parameter is optional and should default to the system-defined scalar ordering function when no argument is given to it.

TYPES FOR DEFINING SYSTEM-DEFINED ENTITIES ^

sys.std.Core.Type.Cat.System

A Cat.System is a Database. It specifies the public interfaces of system-defined entities, specifically all the system-defined types, routines, and catalogs. Both standard system-defined entities and implementation-specific system-defined entities are specified here, specifically all the relcons and relvars with the names (sys|mnt|fed|dep|sdp|pkg).cat. The system catalog constant named sys.cat is of the Cat.System type.

A Cat.System has these 9 attributes:

comment - single_of.Cat.Comment

This is an optional programmer comment about the collection of system-defined entities as a whole.

namespaces - Cat.SysNspSet

These are all the system-defined namespaces where DBMS entities may live, or that otherwise always exist due to being system-defined. Specifically, it declares these 27 standard language namespaces: .(sys|mnt|fed|dep|sdp|pkg|inn|lex). (which have the nameless global root namespace as their parent, spelled ., that isn't also declared here), .sys.(cat|std|imp)., .mnt.cat., .(fed|dep|sdp|pkg).(cat|lib|data)., .sys.std.Core., .sys.std.Core.Type., .sys.std.Core.Type.Cat.; it also declares other Core namespaces, and where applicable, standard extensions or implementation-specific extensions.

functions|updaters|procedures - Cat.Sys(Func|Upd|Proc)Set

These are the interfaces of all the system-defined functions|updaters|procedures.

special_types - Cat.SysSpecTypeSet

These are the few central system-defined data types that have special hard-coded meanings and are not defined like any other types. Specifically, it declares these 9 standard types (all in the sys.std.Core.Type namespace): Universal, Empty, Scalar, Tuple, Relation, QuasiScalar, QuasiTuple, QuasiRelation, Remnant.

sca_npr_types - Cat.SysScaNPRTypeSet

These are all the system-defined (|quasi-)scalar root (not union etc) types that have no possreps, the likes of which users can not define, and values of which can only be selected using either system-defined literal syntax or mapping functions. Specifically, it declares these 7 standard types: in the sys.std.Core.Type namespace, Bool, Int, Blob, Text, QuasiScalarDVPT; in the sys.std.Core.Type.Cat namespace, Name, Comment.

types - Cat.SysTypeSet

These are all the system-defined (|quasi-)scalar types with possreps, and complete (|quasi-)nonscalar types, and union types, and restriction types.

catalogs - Cat.SysCatSet

These are the interfaces of all the catalog relcons and relvars. Specifically, it declares these 6 standard catalogs: (sys|mnt|fed|dep|sdp|pkg).cat; the first is a relcon, the others not.

The default value of Cat.System defines a system with zero builtins.

sys.std.Core.Type.Cat.SysNspSet

A Cat.SysNspSet is a Relation that specifies the set of system namespaces that exist for organizing DBMS public entities, mostly the system-defined ones; these system namespaces are organized into a tree whose root has no name. A Cat.SysNspSet only specifies that a system namespace exists, not which public entities it contains; see the Cat.System which contains it for that.

A Cat.SysNspSet has these 3 attributes:

parent - Cat.DeclNameChain

This is the fully-qualified name, in the nameless global root namespace, of the system namespace's parent system namespace.

name - Cat.Name

This is the declared name of the system namespace within the namespace defined by parent; other Muldis D code would reference it with the combination of parent and name.

comment - Cat.Comment

This is an optional programmer comment about this specific system namespace.

A Cat.SysNspSet has a binary (unique) key on the parent plus name attributes. Its default value is empty.

sys.std.Core.Type.Cat.Sys(Func|Upd|Proc)Set

A Cat.Sys(Func|Upd|Proc)Set is a Relation that specifies a set of system-defined functions|updaters|procedures.

A Cat.Sys(Func|Upd|Proc)Set has these 4 attributes:

parent - Cat.DeclNameChain

This is the fully-qualified name, in the nameless global root namespace, of the function|updater|procedure's parent system namespace.

name - Cat.Name

This is the declared name of the function|updater|procedure within the namespace defined by parent; other Muldis D code would reference it with the combination of parent and name.

comment - Cat.Comment

This is an optional programmer comment about the function|updater|procedure as a whole.

head - Cat.(Func|Upd|Proc)Head

This defines the entire function|updater|procedure heading, that is its public interface sans the name, which is all the details of how to use it and no more detail than necessary about how it is implemented.

A Cat.Sys(Func|Upd|Proc)Set has a binary (unique) key on the parent plus name attributes. Its default value is empty.

sys.std.Core.Type.Cat.SysSpecTypeSet

A Cat.SysSpecTypeSet is a Relation that specifies a set of system-defined types which are particularly special and unlike other types.

A Cat.SysSpecTypeSet has these 3 attributes:

parent - Cat.DeclNameChain

This is the fully-qualified name, in the nameless global root namespace, of the type's parent system namespace.

name - Cat.Name

This is the declared name of the type within the namespace defined by parent; other Muldis D code would reference it with the combination of parent and name.

comment - Cat.Comment

This is an optional programmer comment about the type as a whole.

A Cat.SysSpecTypeSet has a binary (unique) key on the parent plus name attributes. Its default value is empty.

sys.std.Core.Type.Cat.SysScaNPRTypeSet

A Cat.SysSpecTypeSet is a Relation that specifies a set of system-defined (|quasi-)scalar root (not union etc) types that have no possreps.

A Cat.SysScaNPRTypeSet has these 4 attributes:

parent - Cat.DeclNameChain

This is the fully-qualified name, in the nameless global root namespace, of the type's parent system namespace.

name - Cat.Name

This is the declared name of the type within the namespace defined by parent; other Muldis D code would reference it with the combination of parent and name.

comment - Cat.Comment

This is an optional programmer comment about the type as a whole.

is_quasi - Bool

This is Bool:true if the type is a quasi-scalar type; it is Bool:false if the type is a scalar type.

A Cat.SysScaNPRTypeSet has a binary (unique) key on the parent plus name attributes. Its default value is empty.

sys.std.Core.Type.Cat.SysTypeSet

A Cat.SysTypeSet is a Relation that specifies a set of system-defined types.

A Cat.SysTypeSet has these 4 attributes:

parent - Cat.DeclNameChain

This is the fully-qualified name, in the nameless global root namespace, of the type's parent system namespace.

name - Cat.Name

This is the declared name of the type within the namespace defined by parent; other Muldis D code would reference it with the combination of parent and name.

comment - Cat.Comment

This is an optional programmer comment about the type as a whole.

type - Cat.Type

This defines the entire type sans the name.

A Cat.SysTypeSet has a binary (unique) key on the parent plus name attributes. Its default value is empty.

sys.std.Core.Type.Cat.SysCatSet

A Cat.SysCatSet is a Relation that specifies a set of system-defined catalog dbvars; each tuple specifies one catalog dbvar.

A Cat.SysCatSet has these 4 attributes:

name - Cat.NameChain

This is the fully-qualified name of the catalog dbvar.

comment - Cat.Comment

This is an optional programmer comment about the catalog dbvar as a whole.

is_readonly - Bool

This is Bool:true if a catalog relcon is being described; it is Bool:false if a catalog relvar is being described.

catalog - Cat.DbVar

This is the definition of the catalog dbvar.

A Cat.SysCatSet has a unary (unique) key on the name attribute. Its default value is empty.

TYPES FOR DEFINING MOUNT CONTROLS ^

sys.std.Core.Type.Cat.MountControlCat

A Cat.MountControlCat is a Database. It specifies the control interface for mounting and unmounting (and creating and deleting) depots within the current in-DBMS process. The scope of these controls includes specifying what name the depot is mounted with, whether the mount is readonly vs updateable, or is temporary vs persistant, and implementation specific details like storage file names or network login credentials. Updates to this catalog have side-effects in what other user-updateable catalogs exist, making them appear or disappear. This catalog may only be updated when the current process has no active transaction. The system catalog variable named mnt.cat is of the Cat.MountControlCat type.

A Cat.MountControlCat has these 2 attributes:

comment - single_of.Cat.Comment

This is an optional programmer comment about the depot mount control catalog as a whole.

mounts - Cat.MountControlSet

These are the controls for the current depot mounts.

The default value of Cat.MountControlCat has zero depot mount controls.

sys.std.Core.Type.Cat.MountControlSet

A Cat.MountControlSet is a Relation that specifies a set of controls per depot mounts, such that each tuple is a single control for a depot mount, and each depot mount has 1 mount control. Inserting a tuple will result in either an existing depot being mounted or a new depot being created (if possible) and mounted; updating a tuple will change some details of that depot mount's status, such as making it readonly or updateable; deleting a tuple will result in a mounted depot being either unmounted or unmounted plus deleted (if possible).

A Cat.MountControlSet has these 7 attributes:

name - Cat.Name

This is the declared name of the depot mount; other Muldis D code would reference it with this name.

comment - Cat.Comment

This is an optional programmer comment about this specific mount of the depot.

is_temporary - Bool

This is Bool:true if the depot mount is for a transient depot that would automatically be created when mounted and automatically be deleted when unmounted, because it is only intended for use as the application's current working memory, and its maximum lifetime is the lifetime of the in-DBMS process. This is Bool:false (the default) if the depot mount is for a depot that either should already exist before being mounted, or that should continue to exist after being unmounted, because it is intended for persistent data. Note that the is_temporary status is orthogonal to whether the depot's storage is in volatile memory (eg, RAM) or in stable memory (eg, on disk); a not-temporary depot is simply one that is meant to be reusable by multiple depot mounts or processes. The is_temporary status may not be updated on an existing depot mount control. These details are subject to revision.

create_on_mount - Bool

This is Bool:true if the depot mount must represent a depot that was newly created at the time the depot mount was created, where the depot creation is a direct side-effect of the mount operation. This is Bool:false (the default) if the depot being mounted must already exist without the mounting process having any hand in creating it. Note that there is no option provided to conditionally create a depot depending on whether it already exists, as a perceived safety feature (this detail is subject to change); to get that behaviour, first try creating the depot mount control with this attribute Bool:false, and if that fails due to nonexistence, then try again with it set to Bool:true. This attribute is ignored / not applicable when is_temporary is true.

delete_on_unmount - Bool

This is Bool:true if the depot should be deleted at the same time it is unmounted, that is, when this depot mount control tuple is deleted. This is Bool:false (the default) if the depot should not be deleted as part of the unmount process. This attribute is ignored / not applicable when is_temporary is true.

we_may_update - Bool

This is Bool:true if the depot mount will permit the current in-DBMS process to make any kind of update to the depot, such as data manipulation, data definition, or creating/deleting it. This is Bool:false (the default) if the depot mount is only providing readonly access to the depot. When a depot mount is readonly, any attempt to update the depot through it will throw a runtime exception. The we_may_update attribute may be set to Bool:false at any time (when there is no active transaction), but it may only be set to Bool:true at the time the depot is mounted; this is for safety, such that if a depot mount won't let you update the depot now, there's no way it will let you update it later, save by unmounting and remounting the depot (the result of which is a different depot mount). Note that the we_may_update status is orthogonal to the depot locking mechanism; it won't block any other process from reading or updating that depot, so unless you have locks on the depot using some other means, it may still be updated by others while mounted readonly for you, so consistent reads between distinct statements outside of transactions are not guaranteed. These details are subject to revision, such as in regards to what autonomous child processes of the current process may do.

details - Cat.ScaLitExprNodeSet

These are the 0..N other miscellaneous details that define this depot mount control. Each tuple in details specifies an implementation-specific attribute name and (scalar) value. Example such implementation-specific details include the name of a local file that the depot is stored as, or the name of a DBMS server on the network plus authentication credentials to connect to it with. See each Muldis D implementation for details. Note that details generally corresponds to the Perl DBI's concept of a data source name or connection string. But details can also have other details like customizations on how to map a foreign DBMS' concepts to native Muldis D equivalents, or maybe information on where to find extra meta-data that has such info, or info to instruct a Muldis D interface to fill in functionality missing in the actual depot of a less capable DBMS, like constraints or stored invokable routines.

A Cat.MountControlSet has a unary (unique) key on the name attribute. Its default value is empty. It also has a transition constraint that prevents changing some attributes of a depot mount control once set. Note that the 3 attributes [is_temporary, create_on_mount, delete_on_unmount] may be merged into a single enumerated-typed attribute or otherwise be reorganized.

TYPES FOR DEFINING FEDERATIONS ^

sys.std.Core.Type.Cat.Federation

A Cat.Federation is a Database. It specifies a federation of depot mounts, that is, all the depot mounts that an in-DBMS process can see or update, and that defines the scope of an active transaction. There is exactly one of these per process and it doesn't have a name. The system catalog variable named fed.cat is of the Cat.Federation type.

A Cat.Federation has these 2 attributes:

comment - single_of.Cat.Comment

This is an optional programmer comment about the federation as a whole.

mounts - Cat.DepotMountSet

These are the depot mounts that comprise the federation.

The default value of Cat.Federation has zero depot mounts.

sys.std.Core.Type.Cat.DepotMountSet

A Cat.DepotMountSet is a Relation that specifies a set of depot mounts, such that each tuple is a single depot mount. A depot mount is a named in-DBMS context by which a depot is referenced from either other depots or by the main application, and it also specifies the catalog content of the depot itself.

A Cat.DepotMountSet has these 3 attributes:

name - Cat.Name

This is the declared name of the depot mount; other Muldis D code would reference it with this name.

comment - Cat.Comment

This is an optional programmer comment about this specific mount of the depot.

depot - Cat.Depot

This defines the entire system catalog of the depot that this mount has made visible to the DBMS.

A Cat.DepotMountSet has a unary (unique) key on the name attribute. Its default value is empty.

TYPES FOR DEFINING DEPOTS AND SUBDEPOTS ^

sys.std.Core.Type.Cat.Depot

A Cat.Depot is a Database. It specifies the entire system catalog of a single depot, that is, the widest scope within which all entities must be fully defined in terms of just user-defined entities within the same scope or of system-defined entities. It also doubles to specify the system catalog of a subdepot, which is an arbitrary subset of a depot's entities that internally looks like a depot; a depot can have 0..N subdepots, and any that exist are arranged in a hierarchy with the depot as the root. The system catalog variables named dep.cat and sdp.cat are both of the Cat.Depot type.

A Cat.Depot has these 8 attributes:

comment - single_of.Cat.Comment

This is an optional programmer comment about the (|sub)depot as a whole.

subdepots - Cat.SubdepotSet

These are all the subdepots that this (|sub)depot contains.

packages - Cat.PackageSet

These are all the packages that this (|sub)depot contains.

functions|updaters|procedures - Cat.Dep(Func|Upd|Proc)Set

These are all the function|updater|procedure definitions that this (|sub)depot contains.

types - Cat.DepTypeSet

These are all the definitions that this (|sub)depot contains of (|quasi-)scalar types with possreps, and complete (|quasi-)nonscalar types, and union types, and restriction types.

data - single_of.Cat.DbVar

This is the definition of the dbvar that this (|sub)depot contains.

The default value of Cat.Depot defines an empty (|sub)depot.

sys.std.Core.Type.Cat.SubdepotSet

A Cat.SubdepotSet is a Relation that specifies the set of subdepots that a depot might optionally have for organizing its public entities; these subdepots are organized into a tree whose root is the depot. A Cat.SubdepotSet only specifies that a subdepot exists, not which depot entities it contains; see the Cat.Depot which contains it for that.

A Cat.SubdepotSet has these 3 attributes:

parent - Cat.DeclNameChain

This is the fully-qualified name, in the dep.(cat|lib|data) namespace, of the subdepot's parent subdepot, which is often just the depot itself.

name - Cat.Name

This is the declared name of the subdepot within the namespace defined by parent; other Muldis D code would reference it with the combination of parent and name.

comment - Cat.Comment

This is an optional programmer comment about this specific subdepot.

A Cat.SubdepotSet has a binary (unique) key on the parent plus name attributes. Its default value is empty.

sys.std.Core.Type.Cat.PackageSet

A Cat.PackageSet is a Relation that specifies the set of packages that a depot might optionally have for organizing its possibly private entities.

A Cat.PackageSet has these 4 attributes:

parent - Cat.DeclNameChain

This is the fully-qualified name, in the dep.(cat|lib|data) namespace, of the packages's parent (|sub)depot.

name - Cat.Name

This is the declared name of the package within the namespace defined by parent; other Muldis D code would reference it with the combination of parent and name.

comment - Cat.Comment

This is an optional programmer comment about the package definition as associated with this package name.

package - Cat.Depot

This defines the entire system catalog of the package.

A Cat.PackageSet has a binary (unique) key on the parent plus name attributes. Its default value is empty.

sys.std.Core.Type.Cat.Dep(Func|Upd|Proc)Set

A Cat.Dep(Func|Upd|Proc)Set is a Relation that specifies a set of functions|updaters|procedures that a (|sub)depot might directly contain.

A Cat.Dep(Func|Upd|Proc)Set has these 5 attributes:

parent - Cat.DeclNameChain

This is the fully-qualified name, in the dep.(cat|lib|data) namespace, of the function|updater|procedure's parent (|sub)depot.

name - Cat.Name

This is the declared name of the function|updater|procedure within the namespace defined by parent; other Muldis D code would reference it with the combination of parent and name.

comment - Cat.Comment

This is an optional programmer comment about the function|updater|procedure as a whole.

head - Cat.(Func|Upd|Proc)Head

This defines the entire function|updater|procedure heading, that is its public interface sans the name, which is all the details of how to use it and no more detail than necessary about how it is implemented.

body - Cat.(Func|Upd|Proc)Body

This defines the entire function|updater|procedure body, that is its implementation, besides what interface defines.

A Cat.Dep(Func|Upd|Proc)Set has a binary (unique) key on the parent plus name attributes. Its default value is empty.

sys.std.Core.Type.Cat.DepTypeSet

A Cat.DepTypeSet is a Relation that specifies a set of types that a (|sub)depot might directly contain.

A Cat.DepTypeSet has these 4 attributes:

parent - Cat.DeclNameChain

This is the fully-qualified name, in the dep.(cat|lib|data) namespace, of the type's parent (|sub)depot.

name - Cat.Name

This is the declared name of the type within the namespace defined by parent; other Muldis D code would reference it with the combination of parent and name.

comment - Cat.Comment

This is an optional programmer comment about the type as a whole.

type - Cat.Type

This defines the entire type sans the name.

A Cat.DepTypeSet has a binary (unique) key on the parent plus name attributes. Its default value is empty.

TYPES FOR DEFINING PACKAGES ^

sys.std.Core.Type.Cat.Package

A Cat.Package is a Database. It specifies the entire system catalog of a single package, which provides a privatizing namespace for a subset of a depot's entities; entities outside a package can only invoke that package's entities which have been declared part of its public interface. A package internally looks like a depot but that it doesn't contain subdepots or other packages. The system catalog variable named pkg.cat is of the Cat.Package type.

A Cat.Package has these 6 attributes:

comment - single_of.Cat.Comment

This is an optional programmer comment about the package as a whole.

functions|updaters|procedures - Cat.Pkg(Func|Upd|Proc)Set

These are all the function|updater|procedure definitions that this package contains.

types - Cat.PkgTypeSet

These are all the definitions that this package contains of (|quasi-)scalar types with possreps, and complete (|quasi-)nonscalar types, and union types, and restriction types.

data - single_of.Cat.DbVar

This is the definition of the dbvar that this package contains.

The default value of Cat.Package defines an empty package.

sys.std.Core.Type.Cat.Pkg(Func|Upd|Proc)Set

A Cat.Pkg(Func|Upd|Proc)Set is a Relation that specifies a set of functions|updaters|procedures that a package might contain, where each function|updater|procedure may be either public for the DBMS as a whole or private to the package.

A Cat.Pkg(Func|Upd|Proc)Set has these 5 attributes:

name - Cat.Name

This is the declared name of the function|updater|procedure.

comment - Cat.Comment

This is an optional programmer comment about the function|updater|procedure as a whole.

is_public - Bool

This is Bool:true if the function|updater|procedure is part of the package's own public interface and may be invoked from outside the package; it is Bool:false if it is just part of the package's internals.

head - Cat.(Func|Upd|Proc)Head

This defines the entire function|updater|procedure heading, that is its public interface sans the name, which is all the details of how to use it and no more detail than necessary about how it is implemented.

body - Cat.(Func|Upd|Proc)Body

This defines the entire function|updater|procedure body, that is its implementation, besides what interface defines.

A Cat.Pkg(Func|Upd|Proc)Set has a unary (unique) key on the name attribute. Its default value is empty.

sys.std.Core.Type.Cat.PkgTypeSet

A Cat.PkgTypeSet is a Relation that specifies a set of types that a package might contain, where each type may be either public for the DBMS as a whole or private to the package.

A Cat.PkgTypeSet has these 4 attributes:

name - Cat.Name

This is the declared name of the type.

comment - Cat.Comment

This is an optional programmer comment about the type as a whole.

is_public - Bool

This is Bool:true if the type is part of the package's own public interface and may be directly invoked from outside the package; it is Bool:false if it is just part of the package's internals.

type - Cat.Type

This defines the entire type sans the name.

A Cat.PkgTypeSet has a unary (unique) key on the name attribute. Its default value is empty.

TYPES FOR DEFINING ROUTINE HEADINGS ^

sys.std.Core.Type.Cat.FuncHead

A Cat.FuncHead is a Tuple. It specifies the entire heading or public interface of a function or inner function, except for its name and public/private status; the latter are provided by any type embedding this one when applicable.

A Cat.FuncHead has these 4 attributes:

comment - Cat.Comment

This is an optional programmer comment about the function heading.

result_type - Cat.NameChain

This is the declared result data type of the function as a whole.

params - Cat.NameTypeMap

This is the declared parameter list of the function, which has 0..N named and typed parameters.

opt_params - set_of.Cat.Name

This indicates the subset of the function's parameters that are optional, that is, do not need to be supplied explicit arguments when the function is invoked; any function parameters not named here must be supplied explicit arguments. Any parameter marked as optional which is not given an explicit argument will implicitly default to the default value of its declared type. Each element of opt_params must match a parameter name in params.

The default value of Cat.FuncHead has zero parameters and a result type of Bool; by default, its parameters are all non-optional.

sys.std.Core.Type.Cat.UpdHead

A Cat.UpdHead is a Tuple. It specifies the entire heading or public interface of an updater or inner updater, except for its name and public/private status; the latter are provided by any type embedding this one when applicable.

A Cat.UpdHead has these 4 attributes:

comment - Cat.Comment

This is an optional programmer comment about the updater heading.

upd_params - Cat.NameTypeMap

This is the declared subject-to-update parameter list of the updater, which has 1..N named and typed such parameters. It must have at least 1 element.

ro_params - Cat.NameTypeMap

This is the declared read-only parameter list of the updater, which has 0..N named and typed such parameters.

opt_params - set_of.Cat.Name

This indicates the subset of the updater's subject-to-update or read-only parameters that are optional, that is, do not need to be supplied explicit arguments when the function is invoked; any updater parameters not named here must be supplied explicit arguments. Any parameter marked as optional which is not given an explicit argument will implicitly default to the default value of its declared type; any subject-to-update parameter marked as optional which is not given an explicit argument will implicitly bind to a new anonymous variable (with the aforementioned default value) which is discarded after the updater finishes executing. Each element of opt_params must match a parameter name in either upd_params or ro_params.

There is a distributed (unique) key over the name attributes of upd_params and ro_params.

The default value of Cat.UpdHead has 1 subject-to-update parameter whose name is topic and whose declared type is Bool; it has zero read-only parameters; by default, its parameters are all non-optional.

sys.std.Core.Type.Cat.ProcHead

A Cat.ProcHead is a Tuple. It specifies the entire heading or public interface of a procedure or inner procedure, except for its name and public/private status; the latter are provided by any type embedding this one when applicable.

A Cat.ProcHead has these 4 attributes:

comment - Cat.Comment

This is an optional programmer comment about the procedure heading.

upd_params - Cat.NameTypeMap

This is the declared subject-to-update parameter list of the procedure, which has 0..N named and typed such parameters.

ro_params - Cat.NameTypeMap

This is the declared read-only parameter list of the procedure, which has 0..N named and typed such parameters.

opt_params - set_of.Cat.Name

This is as per the same-named attribute of Cat.UpdHead.

There is a distributed (unique) key over the name attributes of upd_params and ro_params.

The default value of Cat.ProcHead has zero parameters; by default, its parameters are all non-optional.

TYPES FOR DEFINING ROUTINE BODIES ^

sys.std.Core.Type.Cat.FuncBody

A Cat.FuncBody is a Tuple. It specifies the entire body or implementation of a function, besides the details that a Cat.FuncHead has, one of which each Cat.FuncBody typically must be paired with.

A Cat.FuncBody has these 4 attributes:

comment - Cat.Comment

This is an optional programmer comment about the function body.

main_body - Cat.InnerFuncBody

This defines the entire main body of the function, namely what's left of the function body after parts of it are optionally factored out into inner routines or inner types. It must consist of a value expression whose result type is of the result type of the function, and which invokes all of the function's parameters.

inner_funcs - Cat.InnerFuncSet

These are all the inner function definitions that this function contains.

inner_types - Cat.InnerTypeSet

These are all the inner type definitions that this function contains.

There is a distributed (unique) key over both the name attributes of inner_funcs and the name attributes of all the attributes of inner_types.

The default value of Cat.FuncBody directly corresponds to the default value of Cat.FuncHead and unconditionally results in the value Bool:false.

sys.std.Core.Type.Cat.UpdBody

A Cat.UpdBody is a Tuple. It specifies the entire body or implementation of an updater, besides the details that a Cat.UpdHead has, one of which each Cat.UpdBody typically must be paired with.

A Cat.UpdBody has these 5 attributes:

comment - Cat.Comment

This is an optional programmer comment about the updater body.

main_body - Cat.InnerUpdBody

This defines the entire main body of the updater, namely what's left of the updater body after parts of it are optionally factored out into inner routines or inner types. It must consist of a multi-update statement which invokes all of the updater's parameters.

inner_upds - Cat.InnerUpdSet

These are all the inner updater definitions that this updater contains.

inner_funcs - Cat.InnerFuncSet

These are all the inner function definitions that this updater contains.

inner_types - Cat.InnerTypeSet

These are all the inner type definitions that this updater contains.

There is a distributed (unique) key over both the name attributes of inner_(upds|funcs) and the name attributes of all the attributes of inner_types.

The default value of Cat.UpdBody directly corresponds to the default value of Cat.UpdHead and unconditionally updates its topic argument to the value Bool:false.

sys.std.Core.Type.Cat.ProcBody

A Cat.ProcBody is a Tuple. It specifies the entire body or implementation of a procedure, besides the details that a Cat.ProcHead has, one of which each Cat.ProcBody typically must be paired with.

A Cat.ProcBody has these 6 attributes:

comment - Cat.Comment

This is an optional programmer comment about the procedure body.

main_body - Cat.InnerProcBody

This defines the entire main body of the procedure, namely what's left of the procedure body after parts of it are optionally factored out into inner routines or inner types.

inner_procs - Cat.InnerProcSet

These are all the inner procedure definitions that this procedure contains.

inner_upds - Cat.InnerUpdSet

These are all the inner updater definitions that this procedure contains.

inner_funcs - Cat.InnerFuncSet

These are all the inner function definitions that this procedure contains.

inner_types - Cat.InnerTypeSet

These are all the inner type definitions that this procedure contains.

There is a distributed (unique) key over both the name attributes of inner_(procs|upds|funcs) and the name attributes of all the attributes of inner_types.

The default value of Cat.ProcBody directly corresponds to the default value of Cat.ProcHead and is a no-op, having zero statements.

sys.std.Core.Type.Cat.Inner(Func|Upd|Proc)Set

A Cat.Inner(Func|Upd|Proc)Set is a Relation that specifies a set of inner functions|updaters|procedures that a function|updater|procedure might contain.

A Cat.Inner(Func|Upd|Proc)Set has these 4 attributes:

name - Cat.Name

This is the declared name of the inner function|updater|procedure.

comment - Cat.Comment

This is an optional programmer comment about the inner function|updater|procedure as a whole.

head - Cat.(Func|Upd|Proc)Head

This defines the entire inner function|updater|procedure heading, that is its public interface sans the name, which is all the details of how to use it and no more detail than necessary about how it is implemented.

body - Cat.Inner(Func|Upd|Proc)Body

This defines the entire inner function|updater|procedure body, that is its implementation, besides what interface defines.

A Cat.Inner(Func|Upd|Proc)Set has a unary (unique) key on the name attribute. Its default value is empty.

TYPES FOR DEFINING INNER ROUTINE BODIES ^

sys.std.Core.Type.Cat.InnerFuncBody

A Cat.InnerFuncBody is a Tuple. It specifies the entire body or implementation of an inner function (or the main body of a function), besides the details that a Cat.FuncHead has, one of which each Cat.InnerFuncBody typically must be paired with.

A Cat.InnerFuncBody has these 2 attributes:

comment - Cat.Comment

This is an optional programmer comment about the (|inner )function body.

expr - Cat.ExprNodeSet

This defines the value expression tree that comprises the entire (|inner )function body.

There is a distributed (unique) key over the name attributes of all the attributes of expr; and if this Cat.InnerFuncBody is paired with a Cat.FuncHead, then the distributed key also extends over the head's parameter names.

A Cat.InnerFuncBody specifies a simple value expression tree of named expression nodes, each of which is a tuple of one of its expr.\w+_exprs attributes. It must have at least 1 member node, except that it may have zero member nodes iff the (|inner )function it is composed into has exactly 1 parameter, in which case the value expression tree implicitly results in the argument to said parameter. Otherwise: All member nodes must define a simple expression node tree, such that every member except one (which is the root node) has one of its peers as a parent node, and no direct cycles between members are permitted (only indirect cycles based on (|inner )function invocations are allowed); the name of the root node must be the empty string. Note that the composed-into (|inner )function's parameters are also implicitly tree nodes, and are referenced by name into the expression the same way as any other named expression node is. Regardless of whether the node count is zero or 1+, the tree must denote a value expression whose result type is of the result type of the (|inner )function it is composed into, and which invokes all of the (|inner )function's parameters.

The default value of Cat.InnerFuncBody directly corresponds to the default value of Cat.FuncHead and unconditionally results in the value Bool:false.

sys.std.Core.Type.Cat.ExprNodeSet

A Cat.ExprNodeSet is a Database that specifies a set of named value expression nodes. It is typically composed into a (|inner )(function|updater). Each tuple of a Cat.ExprNodeSet attribute is a named expression node, which is the majority component of functional Muldis D code. All arbitrarily complex Muldis D expression trees, including relational queries, are composed of just expression nodes, either directly, or indirectly by way of (|inner )function invocations, as each (|inner )function body is itself composed entirely of a single expression tree (of at least 1 node). Only functions and updaters may contain expression nodes, so for any procedures that would conceptually include them, those portions of the procedures need to be separated out and encapsulated by named (|inner )functions or (|inner )updaters. Note that, while the general case has expression trees simply denoting a value, in some cases they may instead define a pseudo-variable / virtual variable; that only happens in (|inner )updaters where the expression is used as an argument for a subject-to-update parameter of an (|inner )update operator call; in that case the leaf nodes / only node of the expression must map to a subject-to-update parameter of the containing (|inner )update operator.

A Cat.ExprNodeSet has these 11 attributes:

sca_lit_exprs - Cat.ScaLitExprNodeSet

These are expression nodes that define scalar literals of types such that the Muldis D dialect provides special literal syntax specific to the type, and the type may not have any possreps.

sca_pr_lit_exprs - Cat.ScaPRLitExprNodeSet

These are expression nodes that define (|quasi-)scalar literals of types such that each type has at least 1 possrep, and each literal is specified simply in terms of possrep attributes.

tup_lit_exprs - Cat.TupLitExprNodeSet

These are expression nodes that define (|quasi-)tuple literals.

rel_lit_exprs - Cat.RelLitExprNodeSet

These are expression nodes that define (|quasi-)relation literals.

func_invo_exprs - Cat.FuncInvoExprNodeSet

These are expression nodes that invoke (|inner )functions.

if_else_exprs - Cat.IfElseExprNodeSet

These are expression nodes that represent if-else control flow expressions.

given_when_def_exprs - Cat.GivenWhenDefExprNodeSet

These are expression nodes that represent given-when-default control flow expressions.

(func|proc|type|ord_det_func)_ref_lit_exprs - Cat.(Func|Proc|Type|OrdDetFunc)RefLitExprNodeSet

These are expression nodes that define function|imperative-routine|type|order-determination-function reference literals.

There is a distributed (unique) key over the name attributes of all of a Cat.ExprNodeSet's attributes. Its default value is empty.

sys.std.Core.Type.Cat.ScaLitExprNodeSet

A Cat.ScaLitExprNodeSet is a Relation that specifies a set of value expression nodes where each node is a hard-coded scalar literal of one of a certain collection of system-defined core scalar types (or subtype thereof).

A Cat.ScaLitExprNodeSet has these 3 attributes:

name - Cat.Name

This is the declared name of the expression node.

comment - Cat.Comment

This is an optional programmer comment about the expression (leaf) node.

value - Scalar

This is the actual literal value that the expression node represents. That is, any Scalar value could be used here, but in practice that is either dialect-defined (what literals are supported), and possibly implementation defined/limited.

A Cat.ScaLitExprNodeSet has a unary (unique) key on the name attribute. Its default value is empty.

sys.std.Core.Type.Cat.ScaPRLitExprNodeSet

A Cat.ScaPRLitExprNodeSet is a Relation that specifies a set of value expression nodes where each node represents a (|quasi-)scalar literal of a type that has at least 1 possrep, and the literal is specified simply in terms of possrep attributes.

A Cat.ScaPRLitExprNodeSet has these 6 attributes:

name - Cat.Name

This is the declared name of the expression node.

comment - Cat.Comment

This is an optional programmer comment about either the expression node or the expression node (sub-)tree it is the root of.

is_quasi - Bool

This is Bool:true if the node denotes a quasi-scalar literal; it is Bool:false if the node just denotes a scalar literal.

type_name - Cat.NameChain

This is the name of the type that the (|quasi-)scalar value belongs to.

possrep_name - Cat.Name

This is the name of the possrep, of the type named by scalar_type_name, in terms of whose attributes the (|quasi-)scalar value is being selected.

possrep_attrs - Cat.NameExprMap

These are the attributes (names and values) of the possrep_name possrep of the (|quasi-)scalar literal.

A Cat.ScaPRLitExprNodeSet has a unary (unique) key on the name attribute. Its default value is empty.

sys.std.Core.Type.Cat.TupLitExprNodeSet

A Cat.TupLitExprNodeSet is a Relation that specifies a set of value expression nodes where each node represents a (|quasi-)tuple literal.

A Cat.TupLitExprNodeSet has these 4 attributes:

name - Cat.Name

This is the declared name of the expression node.

comment - Cat.Comment

This is an optional programmer comment about either the expression node or the expression node (sub-)tree it is the root of.

is_quasi - Bool

This is Bool:true if the node denotes a quasi-tuple literal; it is Bool:false if the node just denotes a tuple literal.

attrs - Cat.NameExprMap

These are the attributes (names and values) of the (|quasi-)tuple literal.

A Cat.TupLitExprNodeSet has a unary (unique) key on the name attribute. Its default value is empty.

sys.std.Core.Type.Cat.RelLitExprNodeSet

A Cat.RelLitExprNodeSet is a Relation that specifies a set of value expression nodes where each node represents a (|quasi-)relation literal.

A Cat.RelLitExprNodeSet has these 5 attributes:

name - Cat.Name

This is the declared name of the expression node.

comment - Cat.Comment

This is an optional programmer comment about either the expression node or the expression node (sub-)tree it is the root of.

is_quasi - Bool

This is Bool:true if the node denotes a quasi-relation literal; it is Bool:false if the node just denotes a relation literal.

head - set_of.Cat.Name

These are the names of all of this (|quasi-)relation literal's attributes.

body - set_of.Cat.NameExprMap

These are the (|quasi-)tuples of the (|quasi-)relation literal.

A Cat.RelLitExprNodeSet has a unary (unique) key on the name attribute. Its default value is empty.

sys.std.Core.Type.Cat.FuncInvoExprNodeSet

A Cat.FuncInvoExprNodeSet is a Relation that specifies a set of value expression nodes where each node represents the result of invoking a named (|inner )function with specific arguments.

A Cat.FuncInvoExprNodeSet has these 4 attributes:

name - Cat.Name

This is the declared name of the expression node.

comment - Cat.Comment

This is an optional programmer comment about either the expression node or the expression node (sub-)tree it is the root of.

function - Cat.NameChain

This is the name of the (|inner )function being invoked.

args - Cat.NameExprMap

These are the arguments for the (|inner )function invocation. Each element defines one argument value, with the element name matching the invoked (|inner )function's parameter name, and the element expr naming another local expression node which defines the value.

A Cat.FuncInvoExprNodeSet has a unary (unique) key on the name attribute. Its default value is empty.

sys.std.Core.Type.Cat.IfElseExprNodeSet

A Cat.IfElseExprNodeSet is a Relation that specifies a set of value expression nodes where each node represents an N-way if-else control flow expression.

The reason that the Cat.IfElseExprNodeSet expression node type exists, rather than this functionality being provided by an ordinary function invocation, is because the semantics of an if-else expression require its sub-expressions to be evaluated in a specific sequence and that later elements in the sequence are evaluated only conditionally based on the results of earlier elements in the sequence, whereas with ordinary functions the operands are all independent of each other, can be done in any order, and can all be evaluated prior to the function. The main scenario that requires the special semantics is when an earlier conditional part of the sequence is testing whether it is even logically possible to evaluate a later part of the sequence; for example, the first condition may test if a value is a member of a certain data type, and a later part of the sequence may want to use some operator on the value that is only defined for the certain data type (invoking it on something else would result in a failure/exception); so only known-safe/appropriate expressions then get evaluated.

A Cat.IfElseExprNodeSet has these 4 attributes:

name - Cat.Name

This is the declared name of the expression node.

comment - Cat.Comment

This is an optional programmer comment about either the expression node or the expression node (sub-)tree it is the root of.

if_then - array_of.Cat.IfThenMap

This is a sequence of 0..N conditional expressions, each of which has an associated result expression. Each conditional expression will evaluate in order while the previous conditional resulted in Bool:false; once a conditional results in Bool:true, its associated result expression will evaluate and be the result of the larger if-else sequence, and no more conditionals will be evaluated; no result expressions will be evaluated except the one with the true conditional.

else - Cat.NameChain

Iff none of the conditionals in if_then result in Bool:true (or as a trivial case, if if_then is an empty sequence), then the result expression represented by the local expression node (or parameter) named by else will be evaluated, and be the result of the larger if-else.

A Cat.IfElseExprNodeSet has a unary (unique) key on the name attribute. Its default value is empty.

sys.std.Core.Type.Cat.GivenWhenDefExprNodeSet

A Cat.GivenWhenDefExprNodeSet is a Relation that specifies a set of value expression nodes where each node represents an N-way given-when-default switch control flow expression that dispatches based on matching a single value with several options.

A Cat.GivenWhenDefExprNodeSet is essentially a more specialized version of a Cat.IfElseExprNodeSet where every condition expression is a simple value equality test and one of the operands is the same for all the conditions in the set; also, with a given-when-default it doesn't matter what order the conditionals are tested to find a true resulting one.

A Cat.GivenWhenDefExprNodeSet has these 5 attributes:

name - Cat.Name

This is the declared name of the expression node.

comment - Cat.Comment

This is an optional programmer comment about either the expression node or the expression node (sub-)tree it is the root of.

given - Cat.NameChain

This is the single operand value that is common to all the conditions; it is the control value for the expression.

when_then - Cat.WhenThenMap

This is a set of distinct condition operand values, each of which has an associated result expression. If a condition operand matches the value of given, its associated result expression will evaluate and be the result of the larger if-else sequence; no result expressions will be evaluated except the one with the matching conditional operand.

default - Cat.NameChain

Iff none of the condition operand values in when_then matches the value of given (or as a trivial case, if when_then has no tuples), then the result expression represented by the local expression node (or parameter) named by default will be evaluated, and be the result of the larger given-when-default.

A Cat.GivenWhenDefExprNodeSet has a unary (unique) key on the name attribute. Its default value is empty.

sys.std.Core.Type.Cat.(Func|Proc|Type|OrdDetFunc)RefLitExprNodeSet

A Cat.(Func|Proc|Type|OrdDetFunc)RefLitExprNodeSet is a Relation that specifies a set of expression nodes where each node represents a value of the special sys.std.Core.Type.Cat.(Func|Proc|Type|OrdDetFunc)Ref type.

A Cat.(Func|Proc|Type|OrdDetFunc)RefLitExprNodeSet has these 3 attributes:

name - Cat.Name

This is the declared name of the expression node.

comment - Cat.Comment

This is an optional programmer comment about the expression leaf node.

referencing - Cat.NameChain

This is the name, from the point of view of the routine embedding this expression node, of the function|imperative-routine|type|order-determination-function that the new special reference value is supposed to facilitate portable invoking of.

A Cat.(Func|Proc|Type|OrdDetFunc)RefLitExprNodeSet has a unary (unique) key on the name attribute, plus another such key on the referencing attribute. Its default value is empty.

sys.std.Core.Type.Cat.InnerUpdBody

A Cat.InnerUpdBody is a Tuple. It specifies the entire body or implementation of an inner updater (or the main body of a updater), besides the details that a Cat.UpdHead has, one of which each Cat.InnerUpdBody typically must be paired with.

A Cat.InnerUpdBody has these 3 attributes:

comment - Cat.Comment

This is an optional programmer comment about the (|inner )updater body.

exprs - Cat.ExprNodeSet

This defines the expression trees that are arguments to the update operators that stmt invokes. These expression trees must reference all of the read-only parameters that the inner update operator has.

stmt - Cat.MultiUpdStmt

This defines the entire body of the (|inner )updater, which is composed of a single multi-update statement. This multi-update statement must reference all of the parameters that the (|inner )updater has.

There is a distributed (unique) key over the name attributes of all the attributes of exprs; and if this Cat.InnerUpdBody is paired with a Cat.UpdHead, then the distributed key also extends over the head's parameter names.

The default value of Cat.InnerUpdBody directly corresponds to the default value of Cat.UpdHead and unconditionally updates its topic argument to the value Bool:false.

sys.std.Core.Type.Cat.MultiUpdStmt

A Cat.MultiUpdStmt is a Relation that specifies a multi-update statement (of 1..N variables), which is the narrowest scope implicitly atomic component of procedural Muldis D code. It is the most fundamental component of procedural Muldis D code. The variables being updated are accessed via the host (|inner )updater's subject-to-update parameters. All arbitrarily complex Muldis D value assignments, including relational assignments, are composed of just Cat.MultiUpdStmt, either directly, or indirectly by way of (|inner )updater invocations, as each (|inner )updater body is itself composed entirely of 1 multi-update statement (plus supporting value expressions). Only (|inner )updaters may contain Cat.MultiUpdStmt, so for any procedures that would conceptually include them, those portions of the procedures need to be separated out and encapsulated by named (|inner )updaters. Each tuple of a multi-update statement is a single update statement, which represents a single invocation of an (|inner )updater, and at least 1 tuple is required.

A Cat.MultiUpdStmt has these 4 attributes:

comment - Cat.Comment

This is an optional programmer comment about the single update statement as a whole.

updater - Cat.NameChain

This is the name of the (|inner )updater being invoked.

upd_args - Cat.NameExprMap

These are the 1..N subject-to-update arguments to the (|inner )updater invocation, as-per ro_args. But since each expression tree in upd_args is binding to a subject-to-update parameter, the expression tree actually is defining a pseudo-variable / virtual-variable over 1..N containing routine subject-to-update parameters; in the most trivial (and common) case, the parameter is referenced directly.

ro_args - Cat.NameExprMap

These are the 0..N read-only arguments to the (|inner )updater invocation. Each element defines one argument value, with the element name matching the invoked routine's parameter name, and the element expr naming a local expression node (or parameter) which defines the value.

There is a distributed (unique) key over the name attributes of upd_args and ro_args.

The default value of Cat.MultiUpdStmt directly corresponds to the default value of Cat.InnerUpdBody and unconditionally updates its containing (|inner )updater's topic argument to the value Bool:false.

sys.std.Core.Type.Cat.InnerProcBody

A Cat.InnerProcBody is a Tuple. It specifies the entire body or implementation of an inner procedure (or the main body of a procedure), besides the details that a Cat.ProcHead has, one of which each Cat.InnerProcBody typically must be paired with.

A Cat.InnerProcBody has these 3 attributes:

comment - Cat.Comment

This is an optional programmer comment about the (|inner )procedure body.

vars - Cat.NameTypeMap

This defines the 0..N (non-parameter) lexical variables of the (|inner )procedure; they initialize to the default values of their declared types.

stmt - Cat.StmtNodeSet

This defines the statement tree that comprises the entire (|inner )procedure body.

There is a distributed (unique) key over the name attribute of vars and the name attributes of all the attributes of stmt; and if this Cat.InnerProcBody is paired with a Cat.ProcHead, then the distributed key also extends over the head's parameter names.

A Cat.InnerProcBody specifies a simple statement tree of named statement nodes, each of which is a tuple of one of its stmt.\w+_stmts attributes. If it has zero member nodes, then the (|inner )procedure is a no-op. Otherwise: All member nodes must define a simple statement node tree, such that every member except one (which is the root node) has one of its peers as a parent node, and no direct cycles between members are permitted (only indirect cycles based on (|inner )procedure invocations are allowed); the name of the root node must be the empty string. Note that the composed-into (|inner )procedure's parameters are also implicitly tree nodes, and are referenced by name into the statement tree the same way as any other named statement node is. The statement tree should reference all of the parameters and lexical variables that the (|inner )procedure has, but this isn't a strict requirement.

The default value of Cat.InnerProcBody directly corresponds to the default value of Cat.ProcHead and is a no-op, having an empty statement tree.

sys.std.Core.Type.Cat.StmtNodeSet

A Cat.StmtNodeSet is a Database that specifies a set of named statement nodes. It is typically composed into a (|inner )procedure. Each tuple of a Cat.StmtNodeSet attribute is a named statement node, from which non-implicitly-atomic procedural Muldis D code is composed.

Note that, regarding Muldis D's feature of a statement node having an explicit name that can be referenced by "leave" and "iterate" control flow statements to leave or re-iterate the corresponding block, both SQL and Perl have native counterpart features in the form of block labels.

A Cat.StmtNodeSet has these 7 attributes:

leave_stmts - Cat.LeaveStmtNodeSet

These are statement nodes that represent abnormal block exit statements.

compound_stmts - Cat.CompoundStmtNodeSet

These are statement nodes that each represent a compound statement having a sequence of 0..N procedure statements.

proc_invo_stmts - Cat.ProcInvoStmtNodeSet

These are statement nodes that invoke (|inner )procedures.

if_else_stmts - Cat.IfElseStmtNodeSet

These are statement nodes that represent if-else control flow statements.

given_when_def_stmts - Cat.GivenWhenDefStmtNodeSet

These are statement nodes that represent given-when-default control flow statements.

iterate_stmts - Cat.IterateStmtNodeSet

These are statement nodes that represent abnormal block restart statements.

loop_stmts - Cat.LoopStmtNodeSet

These are statement nodes that represent generic looping block statements.

There is a distributed (unique) key over the name attributes of all of a Cat.StmtNodeSet's attributes. Its default value is empty.

sys.std.Core.Type.Cat.LeaveStmtNodeSet

A Cat.LeaveStmtNodeSet is a Relation that specifies a set of statement leaf nodes where each node represents an instruction to abnormally exit the block defined by a parent statement node (a normal exit is to simply execute to the end of the block). If the parent node in question is the root statement node for the containing (|inner )procedure, then the latter will be exited; this is how a "return" statement is represented, but "return" is still easy to recognize because the root node always has the empty string as its name. If the parent node in question is an iterating or looping statement, then any remaining iterations it might have had are skipped, especially useful if it was an infinite loop.

A Cat.LeaveStmtNodeSet has these 3 attributes:

name - Cat.Name

This is the declared name of the statement node.

comment - Cat.Comment

This is an optional programmer comment about the statement leaf node.

leave - Cat.NameChain

This is the name of the parent statement node we wish to abnormally exit; note that this reference does not count as making the other node a child of the current one, so this reference does not contribute to a cycle.

A Cat.LeaveStmtNodeSet has a unary (unique) key on the name attribute, plus another such key on the leave attribute. Its default value is empty.

sys.std.Core.Type.Cat.CompoundStmtNodeSet

A Cat.CompoundStmtNodeSet is a Relation that specifies a set of statement nodes where each node is a compound statement composed of a sequence of 0..N other statements.

A Cat.CompoundStmtNodeSet has these 3 attributes:

name - Cat.Name

This is the declared name of the statement node.

comment - Cat.Comment

This is an optional programmer comment about either the statement node or the statement node (sub-)tree it is the root of.

stmts - array_of.Cat.NameChain

This is a sequence of names of 0..N other local statement nodes; the current compound statement consists of having those other statements execute in this given sequence.

A Cat.CompoundStmtNodeSet has a unary (unique) key on the name attribute. Its default value is empty.

sys.std.Core.Type.Cat.ProcInvoStmtNodeSet

A Cat.ProcInvoStmtNodeSet is a Relation that specifies a set of statement nodes where each node is an invocation of some other procedural routine (eg, procedure, update operator, system service, 'inner' variant) with specific arguments. The invoked routine can be either user-defined or system-defined.

A Cat.ProcInvoStmtNodeSet has these 5 attributes:

name - Cat.Name

This is the declared name of the statement node.

comment - Cat.Comment

This is an optional programmer comment about either the statement node or the statement node (sub-)tree it is the root of.

procedure - Cat.NameChain

This is the name of the procedural routine being invoked.

upd_args - Cat.NameExprMap

These are the 0..N subject-to-update arguments to the routine invocation, as-per ro_args.

ro_args - Cat.NameExprMap

These are the 0..N read-only arguments to the routine invocation. Each element defines one argument value, with the element name matching the invoked routine's parameter name, and the element expr naming a local or global variable or statement-containing routine parameter which defines the value.

A Cat.ProcInvoStmtNodeSet has a unary (unique) key on the name attribute. Its default value is empty. There is a distributed (unique) key over the name attributes of upd_args and ro_args.

sys.std.Core.Type.Cat.IfElseStmtNodeSet

A Cat.IfElseStmtNodeSet is a Relation that specifies a set of statement nodes where each node represents an N-way if-else control flow statement. A Cat.IfElseStmtNodeSet is essentially the imperative version of the functional Cat.IfElseExprNodeSet, except that for design simplicity, all of the conditionals need to be pre-evaluated and their boolean results stored in variables (but this could be a lazy though still necessarily deterministic operation, so work isn't actually done if the results aren't needed); if any conditionals could only be conditionally evaluated, then the necessary logic means this if-else statement must be broken up into multiple nested if-else.

A Cat.IfElseStmtNodeSet has these 4 attributes:

name - Cat.Name

This is the declared name of the statement node.

comment - Cat.Comment

This is an optional programmer comment about either the statement node or the statement node (sub-)tree it is the root of.

if_then - array_of.Cat.IfThenMap

This is a sequence of 0..N conditional result variable names, each of which has an associated statement. Each conditional result will be tested in order while the previous conditional result is Bool:false; once a conditional result is Bool:true, its associated statement will be invoked; no statements will be invoked except the one with the true conditional result.

else - maybe_of.Cat.NameChain

Iff none of the conditional results in if_then is Bool:true (or as a trivial case, if if_then is an empty sequence), then the statement represented by the local statement node named by else will be invoked iff else is a Single; if under the first circumstance else is a Nothing, then the whole if-else will have been a no-op.

A Cat.IfElseStmtNodeSet has a unary (unique) key on the name attribute. Its default value is empty.

sys.std.Core.Type.Cat.GivenWhenDefStmtNodeSet

A Cat.GivenWhenDefStmtNodeSet is a Relation that specifies a set of statement nodes where each node represents an N-way given-when-default switch control flow statement that dispatches based on matching a single value with several options. A Cat.GivenWhenDefStmtNodeSet is essentially the imperative version of the functional Cat.GivenWhenDefExprNodeSet.

A Cat.GivenWhenDefStmtNodeSet has these 5 attributes:

name - Cat.Name

This is the declared name of the statement node.

comment - Cat.Comment

This is an optional programmer comment about either the statement node or the statement node (sub-)tree it is the root of.

given - Cat.NameChain

This is name of the local parameter or variable that supplies the single operand value that is common to all the conditions; it is the control value for the statement.

when_then - Cat.WhenThenMap

This is a set of distinct condition operand values, each of which has an associated statement. If a condition operand matches the value of given, its associated statement will be invoked; no statements will be invoked except the one with the matching conditional operand.

default - maybe_of.Cat.NameChain

Iff none of the condition operand values in when_then matches the value of given (or as a trivial case, if when_then has no tuples), then the statement represented by the local statement node named by default will be invoked iff default is a Single; if under the first circumstance default is a Nothing, then the whole given-when-default will have been a no-op.

A Cat.GivenWhenDefStmtNodeSet has a unary (unique) key on the name attribute. Its default value is empty.

sys.std.Core.Type.Cat.IterateStmtNodeSet

A Cat.IterateStmtNodeSet is a Relation that specifies a set of statement leaf nodes where each node represents an instruction to abnormally end the current iteration of a looping block defined by a parent statement node, and then start at the beginning of the next iteration of that loop if there are any left ("normal" is to simply execute to the end of the block before starting the next iteration). The same semantics apply for the beginning of the next loop as if the current block iteration had executed to the end before repeating.

A Cat.IterateStmtNodeSet has these 3 attributes:

name - Cat.Name

This is the declared name of the statement node.

comment - Cat.Comment

This is an optional programmer comment about the statement leaf node.

iterate - Cat.NameChain

This is the name of the parent statement node we wish to abnormally exit and restart; note that this reference does not count as making the other node a child of the current one, so this reference does not contribute to a cycle.

A Cat.IterateStmtNodeSet has a unary (unique) key on the name attribute, plus another such key on the iterate attribute. Its default value is empty.

sys.std.Core.Type.Cat.LoopStmtNodeSet

A Cat.LoopStmtNodeSet is a Relation that specifies a set of statement nodes where each node represents a generic looping statement block which iterates until a child "leave" statement executes.

A Cat.LoopStmtNodeSet has these 3 attributes:

name - Cat.Name

This is the declared name of the statement node.

comment - Cat.Comment

This is an optional programmer comment about either the statement node or the statement node (sub-)tree it is the root of.

do - Cat.NameChain

This is the name of the local statement node that will get executed for each iteration of the loop; typically it has a sub-tree of statement nodes.

A Cat.LoopStmtNodeSet has a unary (unique) key on the name attribute. Its default value is empty.

TYPES FOR DEFINING DATA TYPES ^

sys.std.Core.Type.Cat.Type

A Cat.Type is a Tuple. Its purpose is as per Cat.Inner(Scalar|Nonscalar|Union|Restr)Type, one of which it is a wrapper for along with other inner types that are composed into it.

A Cat.Type has these 3 attributes:

comment - Cat.Comment

This is an optional programmer comment about the type as a whole.

inner_types - Cat.InnerTypeSet

These are all the inner type definitions that this type contains. There must be at least 1 inner type here, and exactly 1 of the inner types must have the empty string as its name; that inner type defines the actual main type that the Cat.Type is a wrapper for, and the other inner types, if any, support it.

inner_funcs - Cat.InnerFuncSet

These are all the inner function definitions that this type contains, which support the main type or inner types.

There is a distributed (unique) key over both the name attributes of all the attributes of inner_types and the name attributes of inner_funcs.

The default value of Cat.Type is as per Cat.InnerRestrType.

sys.std.Core.Type.Cat.InnerTypeSet

A Cat.InnerTypeSet is a Database that specifies a set of named inner types. It is typically composed into a function|updater|procedure|outer-type.

A Cat.InnerTypeSet has these 4 attributes:

inner_(sca|nonsca|uni|restr)_types - Cat.Inner(Sca|Nonsca|Uni|Restr)TypeSet

These are all the inner scalar|nonscalar|union|restriction type definitions that this type contains.

There is a distributed (unique) key over the name attributes of all of a Cat.InnerTypeSet's attributes. Its default value is empty.

sys.std.Core.Type.Cat.Inner(Sca|Nonsca|Uni|Restr)TypeSet

A Cat.Inner(Sca|Nonsca|Uni|Restr)TypeSet is a Relation that specifies a set of inner scalar|nonscalar|union|restriction types that a function|updater|procedure or scalar|nonscalar|union|restriction type might contain.

A Cat.Inner(Sca|Nonsca|Uni|Restr)TypeSet has these 3 attributes:

name - Cat.Name

This is the declared name of the inner scalar|nonscalar|union|restriction type.

comment - Cat.Comment

This is an optional programmer comment about the inner scalar|nonscalar|union|restriction type as a whole.

type - Cat.Inner(Scalar|Nonscalar|Union|Restr)Type

This defines the entire inner scalar|nonscalar|union|restriction type sans the name.

A Cat.Inner(Sca|Nonsca|Uni|Restr)TypeSet has a unary (unique) key on the name attribute. Its default value is empty.

TYPES FOR DEFINING INNER DATA TYPES ^

sys.std.Core.Type.Cat.InnerScalarType

A Cat.InnerScalarType is a Tuple. It defines either a new (|quasi-)scalar root type with at least 1 possrep, or it defines a subtype of some other (|quasi-)scalar type which also adds at least one possrep to the other type. Either way, every possrep defines a candidate representation that can handle every value of the (|sub)type it is defined with, and the Muldis D implementation may choose for itself which of these, or some other alternative, is the actual/physical representation.

A Cat.InnerScalarType has these 7 attributes:

comment - Cat.Comment

This is an optional programmer comment about the (|quasi-)scalar (|sub-)type as a whole.

base_type - maybe_of.Cat.NameChain

Iff the type being defined is a (|quasi-)scalar root type, then base_type is not applicable and is a Nothing. Iff the type being defined is a subtype of some other (|quasi-)scalar type, then base_type is a Single whose sole element is the name of that other type. Note that any type named by base_type must itself have at least 1 possrep.

is_quasi - maybe_of.Bool

Iff the type being defined is a (|quasi-)scalar root type, then is_quasi is a Single whose sole element is Bool:true if the type is a quasi-scalar type; the element is Bool:false if the type is a scalar type. Iff the type being defined is a subtype of some other type, then is_quasi is not applicable (would be redundant) and is a Nothing.

possreps - Cat.PossrepSet

These are the 1..N possrep definitions that comprise this type such that each one fully defines a set of attributes plus restrictions on their collective values whereby it defines a representation of all values of this type. Note that if multiple (|quasi-)scalar types are related to each other such that more than one declares possreps for at least one common value, then the name attribute of the possreps attributes of all of those types' definitions have a distributed (unique) key over them. Note that, to keep things simple and deterministic under the possibility of diamond subtype/supertype relationships (such that the generic system-defined scalar possrep attribute accessors can work), Muldis D requires all of the possreps of all scalar types having a common scalar root type to have mutually distinct names, regardless of whether any subtypes have values in common; this can be enforced at type-definition-in-catalog time since all types that can interact are in the same depot.

possrep_maps - Cat.PossrepMapSet

When this type has more than one possrep applicable to all of its values, these are the definitions of mapping functions for deriving the representation of a value in one possrep directly from the representation in another possrep, and also directly in the reverse. Every one of this type's possreps must be mapped bidirectionally to every other one of its possreps, either directly or indirectly. So for P total possreps, the total number of bidirectional maps M is in (P-1) <= M <= ((P-1)*P/2). When a subtype is adding possreps to an other base type, all of the mapping functions are defined with the subtype.

default - Cat.InnerFuncBody

This defines the entire (main) body of a type_default function that results in the default (|quasi-)scalar value of the (|sub-)type; it has zero parameters and its result type is the same as the (|quasi-)scalar type whose declaration it is part of.

order - maybe_of.Cat.InnerFuncBody

A (|quasi-)scalar root type definition may optionally have a type-default total ordering function associated with it (a type being defined as a subtype may not); iff the type being defined qualifies and desires such an associated function, then order is a Single whose sole element defines the entire (main) body of a order_determination function. The implicit function heading that this goes with has 3 parameters; the first two parameters, named topic and other, each have declared types that are the same as the (|quasi-)scalar root type whose declaration the function is part of, and this function is said root type's type-default ordering function; the third parameter, named assuming, is Tuple-typed; the function's implicit result type is Cat.Order. Iff the type being defined is a subtype of some other type or does not desire the function, then order is a Nothing.

The default value of Cat.InnerScalarType defines a scalar root type with a single possrep whose name is the empty string and that has no attributes; it is a singleton type, whose default value is its only value.

sys.std.Core.Type.Cat.PossrepSet

A Cat.PossrepSet is a Relation that specifies a set of possreps that a (|quasi-)scalar (|sub-)type might consist primarily of.

A Cat.PossrepSet has these 4 attributes:

name - Cat.Name

This is the declared name of the possrep.

comment - Cat.Comment

This is an optional programmer comment about the possrep as a whole.

attrs - Cat.NameTypeMap

This defines the 0..N attributes of the possrep.

constraint - Cat.InnerFuncBody

This defines the entire (main) body of a type_constraint function that determines what combinations of possrep attribute values denote values of the (|sub-)type, besides the restrictions imposed by the declared types of the attributes individually. The implicit function heading that this goes with has a single topic parameter whose declared type is a tuple whose attributes match those declared by attrs and whose argument denotes the value to test; the function's implicit result type is Bool. If the function unconditionally results in Bool:true, then all possible combinations of attribute-allowable values are collectively allowed. Note that, strictly speaking, any constraint defined as part of a possrep (where there are multiple possreps) may actually be less restrictive than the total constraint of (|sub-)type as a whole, because the total constraint is defined by and-ing the constraints of all the possreps of the (|sub-)type; therefore, mainly any given possrep's constraints need to be just restricting enough so that the inter-possrep mapping functions can handle the arguments that it accepts, so it is possible to apply the other possreps' constraints.

A Cat.PossrepSet has a unary (unique) key on the name attribute. Its default value is empty. The default value of a tuple of Cat.PossrepSet has a name that is the empty string, its attrs is empty, and its constraint unconditionally results in Bool:true.

sys.std.Core.Type.Cat.PossrepMapSet

A Cat.PossrepMapSet is a Relation such that each tuple in it specifies a pair of mapping functions to bidirectionally derive a value of a type between 2 of its possreps.

A Cat.PossrepMapSet has these 5 attributes:

comment - Cat.Comment

This is an optional programmer comment about this bidirectional mapping.

p1 - Cat.Name

This is the declared name of one possrep.

p2 - Cat.Name

This is the declared name of a second possrep. The value of p2 must be distinct from that of p1, and moreover, the 2 values must be mutually ordered so that the value of p1 is before the value of p2; the latter constraint defines a Cat.PossrepMapSet's canonical form.

p2_from_p1 - Cat.InnerFuncBody

This defines the entire (main) body of a possrep_map function that derives the representation of the possrep named by p2 from that of the possrep named by p1. The implicit function heading that this goes with has a single topic parameter whose declared type is a tuple whose attributes match those of p1; the function's implicit result type is a tuple whose attributes match those of p2. Note that every distinct argument (domain) value of this function must have a distinct result (range) value.

p1_from_p2 - Cat.InnerFuncBody

This defines the entire (main) body of the inverse possrep_map function to that of p2_from_p1. Note that it would often be feasible for a Muldis D implementation to automatically infer a reverse function, but for now we still require it to be explicitly stated; the explicitly stated inverse function could be generated though. This design is subject to change.

A Cat.PossrepMapSet has a binary (unique) key on the p1 plus p2 attributes. Its default value is empty.

sys.std.Core.Type.Cat.InnerNonscalarType

A Cat.InnerNonscalarType is a Tuple. It defines either a new (|quasi-)nonscalar heading (set of attributes) with associated constraints for a tuple and relation type having that heading, or it defines a subtype of some other (|quasi-)nonscalar type. That is, it defines 2 new data types, a tuple type and a relation type with matching headings. Note that you also declare a database type using Cat.InnerNonscalarType, by declaring a tuple type whose attributes are all relation or database typed. Note that you can not use a Cat.InnerNonscalarType to declare or subtype an incomplete type, as it (or its supertype) must specify a complete set of attributes.

A Cat.InnerNonscalarType has these 14 attributes:

comment - Cat.Comment

This is an optional programmer comment about the (|quasi-)nonscalar (|sub-)type as a whole.

base_type - maybe_of.Cat.NameChain

Iff the type being defined is a (|quasi-)nonscalar root type, then base_type is not applicable and is a Nothing. Iff the type being defined is a subtype of some other (|quasi-)nonscalar type, then base_type is a Single whose sole element is the name of that other type.

is_quasi - maybe_of.Bool

Iff the type being defined is a (|quasi-)nonscalar root type, then is_quasi is a Single whose sole element is Bool:true if the type is a quasi-nonscalar type; the element is Bool:false if the type is a nonscalar type. Iff the type being defined is a subtype of some other type, then is_quasi is not applicable (would be redundant) and is a Nothing.

is_tuple_first - Bool

Iff this is Bool:true then the type being defined is primarily considered a tuple type; that is, when either the type name is referenced normally (not using the type namespace), or the type definition is embedded (and nameless), then it is simply considered to be a tuple type; iff this is Bool:false then the type being defined is primarily considered to be a relation type. When a type is primarily considered a tuple or relation type, the only way to reference it as the other kind of type is by using the type.(tuple|relation)_from.\w+ referencing syntax.

attrs - Cat.NameTypeMap

Iff the type being defined is a (|quasi-)nonscalar root type, then attrs defines the 0..N attributes of the type. Iff the type being defined is a subtype of some other type, then the parent type's attribute list is used by default, but attrs of the current type may be used to apply additional constraints by overriding the declared types of a subset of the parent's attributes with types that are subtypes of the originals; an override is done using matching name attribute values of attrs. It is indeed valid for a (|quasi-)nonscalar type to have zero attributes; in this case, a tuple type consists of exactly one value, and a relation type consists of exactly two values.

virtual_attr_maps - Cat.VirtualAttrMapSet

This defines the proper subset of this type's attributes that are virtual, and how they are defined in terms of the rest of this type's attributes. Note that the special functional dependencies between attributes defined herein mean that some kinds of tuple constraints would be redundant.

tuple_constraints - Cat.ConstraintSet

This defines the entire (main) bodies of 0..N type_constraint functions that (when and-ed together) determine what combinations of tuple attribute values denote values of the (|sub-)type, besides the restrictions imposed by the declared types of the attributes individually; they are generalized type constraints that together validate a tuple as a whole. The implicit function heading that each of these goes with has a single topic parameter whose declared type is a tuple whose attributes match those declared by attrs and whose argument denotes the value to test; the function's implicit result type is Bool. If the functions unconditionally result in Bool:true, then all possible combinations of attribute-allowable values are collectively allowed. Each function is invoked either once to test a tuple value, or multiple times to individually test every tuple in a relation value.

relation_constraints - Cat.ConstraintSet

This is like tuple_constraint but that each function's parameter is relation-typed rather than tuple-typed; each is a generalized type constraint that validates a relation as a whole.

keys - Cat.KeySet

These are the 0..N explicit (unique) keys that are applicable to relation values of the type being defined; they apply either as candidate keys or as unique key constraints, depending on context. If there are no explicit keys, then there is an implicit (unique) key over all attributes of the relation type being defined, meaning that every possible tuple that may individually be an element of a relation value of the type being defined, may be in it at once. If any explicit keys are defined, then every one must be over a distinct proper subset of the type's attributes, and moreover no key's attributes may be a proper subset of any other key's attributes; if 2 such candidates appear, just use the one that has the subset. It is valid for a key to consist of zero attributes; in this case, that key is the only key of the type, and values of the type may each consist of no more than one tuple. Note that keys is logically an abstraction syntax (the canonical simplest form) for a particular kind of relation_constraint of the type being defined, one that compares the cardinality of a projection of a relation on its key attributes with the cardinality of the original relation; the attribute values comprise a key if the cardinalities are equal.

distrib_keys - Cat.DistribKeySet

These are the 0..N explicit simple distributed (unique) keys that are applicable to tuple/database values of the type being defined, that range over specified relation-typed attributes of it. Note that distrib_keys is logically an abstraction syntax (the canonical simplest form) for a particular kind of tuple_constraint of the type being defined, one that compares the cardinality of the union of the projection of distributed key attributes of all key-participating relation-valued attributes, with the sum of cardinalities of the source relation-valued attributes; the attribute values comprise a distributed key if the cardinalities are equal.

foreign_keys - Cat.ForeignKeySet

These are the 0..N explicit simple foreign (non-distributed) keys that are applicable to tuple/database values of the type being defined, that range over and relate tuples of specified relation-typed attributes of it; they are a kind of referential constraint. Each tuple of a child attribute must have a corresponding tuple in a specific single parent attribute, where they correspond on the attributes of the parent attribute that comprise a (unique) key of the latter. Note that foreign_keys is logically an abstraction syntax (the canonical simplest form) for a particular kind of tuple_constraint of the type being defined, one that tests if the relational difference, where a projection of the parent relation is subtracted from a corresponding projection of the child relation (with attribute renaming if necessary), is an empty relation; if the difference is an empty relation, then the foreign key is satisfied; otherwise, any difference tuples are from child tuples that violate the foreign key.

foreign_distrib_keys - Cat.ForeignDistribKeySet

These are the 0..N explicit simple foreign distributed keys that are applicable to tuple/database values of the type being defined, that range over and relate tuples of specified relation-typed attributes of it; they are a kind of referential constraint. Each tuple of a child attribute must have a corresponding tuple in one member of a specific set of parent-alternative attributes (that have a distributed key ranging over them), where they correspond on the attributes of the parent-alternative attribute that comprise a distributed key on the latter. Note that foreign_distrib_keys is logically an abstraction syntax (the canonical simplest form) for a particular kind of tuple_constraint of the type being defined; it is as per foreign_keys except that the parent relation is the result of unioning appropriately renamed projections of the member relations of the distributed key.

default_tuple - Cat.InnerFuncBody

This defines the entire (main) body of a type_default function that results in the default (|quasi-)tuple value of the (|sub-)type; it has zero parameters and its result type is the same as the (|quasi-)tuple type whose declaration it is part of.

default_relation - Cat.InnerFuncBody

This defines the entire (main) body of a type_default function that results in the default (|quasi-)relation value of the (|sub-)type; it has zero parameters and its result type is the same as the (|quasi-)relation type whose declaration it is part of.

There is a distributed (unique) key over the name attributes of (tuple|relation)_constraint and (|foreign_)(|distrib_)keys.

The default value of Cat.InnerNonscalarType defines a relation type that is the same as RelationD0, having zero attributes, whose default value is the one with zero tuples.

sys.std.Core.Type.Cat.VirtualAttrMapSet

A Cat.VirtualAttrMapSet is a Relation that defines special functional dependencies between attributes of a (|quasi-)nonscalar data type, such that, on a per-tuple basis, some attributes can be generated purely from other attributes, and hence the former attributes may be virtual. Each tuple of a Cat.VirtualAttrMapSet specifies 2 disjoint subsets of the (|quasi-)nonscalar's attributes, which are determinant and dependent attributes respectively, where the values of the second set are generated from the first using a virtual_attr_map function. Whether dependent attributes are computed when needed or pre-computed and stored (a trade-off of storage space for speed) is implementation dependent, though users may give hints to govern that performance decision.

The main reason for virtual attributes to exist is to provide a fundamental feature of a relational database where multiple perceptions of the same data can exist at once; each user can perceive the same data being organized according to their own preferences, and even if the actual means of storing the data changes over time, the users continue to be able to perceive it in the same ways as before the change.

The most important use case of virtual attributes is when the data type having them is a database type, all of whose attributes are relations (or databases); and so these attributes define database relvars, with non-virtual and virtual attributes being base and virtual relvars, respectively (which correspond to the SQL concepts of base tables and views, respectively). The idea in general is that users can work with any relvar without knowing whether it is base or virtual, and so if implementations change later such that real relvars become virtual or vice-versa, users could continue as if nothing changed.

A less common use case of virtual attributes is in (typically non-database) nonscalar types when users want to treat non-identical values as being distinct in some situations and non-distinct in others. For example they want to do case-insensitive matching of character data, or alternately they want a case-insensitive (unique) key constraint on such, but either way they want the case of the data preserved. In this situation, a base attribute can exist with the original case-preserved data, and a dependent virtual attribute can exist with the first's values folded to uppercase (eliminating any case differences); so then the key constraint can be placed on the virtual attribute to get the desired semantics, and the matching can be done against the same.

All permissable operations on virtual (|pseudo-)variables are such that the semantics of updating them is the same as for updating base (|pseudo-)variables, with respect to The Assignment Principle: Following assignment of a value v to a variable V, the comparison v = V evaluates to TRUE. Just as an update to determinant variables will have the cascade effect of updating their dependent variables such that the functional dependency between them continues to hold, the reverse also must happen. Any update to dependent variables must have the side effect of updating their determinant variables. Specifically, the implementing code of an update to dependents must be rewritten behind the scenes to become instead an update to their determinants, as if the latter was what the users had actually written, such that following the then-first update of the determinants, the cascading update to the dependents by the functional dependency must result in the same dependents' values that they would have had if the dependents were just base variables being updated by the original code. If such a code rewrite can not be done, such as due to information lost in the functional dependency, then the operation attempting to update the dependent attributes must fail. Sometimes the code rewrite can be done automatically by the DBMS, and sometimes it can succeed if the map definer gives explicit details on how to accomplish it.

Because Muldis D requires a strong degree of determinism in the whole system, sometimes users have to provide explicit details on how to accomplish a reverse mapping, even if it is possible to automatically generate such, because there may be multiple ways to do a reverse map that satisfy The Assignment Principle, so the explicitness would be to pick exactly one of those, so that how determinants are updated is predictable in an implementation-portable manner. For example, if a virtual relvar V is defined as the simple relational union of 2 other relvars R1 and R2, then a tuple insertion into V could be rewritten at least 3 ways, which are an insertion into just R1, or into just R2, or into both R1 and R2; so for predictability's sake, the map should specify which option to do (which can vary on a case-by-case basis).

This all being said, for the moment the Cat.VirtualAttrMapSet type does not give a way to manually specify a reverse function, so for now all the virtuals are either read-only or updatable due to an automatically generated reverse function, which might vary by implementation. Fixing this matter is TODO. Note that the reverse functions might have to be defined as per-tuple operations, separately for insert/substitute/delete.

A Cat.VirtualAttrMapSet has these 5 attributes:

comment - Cat.Comment

This is an optional programmer comment about this virtual attribute map.

determinant_attrs - Cat.NameDNCMap

These are the names of the determinant attributes. Each name is given in 2 forms, called name and dnc; dnc is the actual name of the attribute as existing in the host type, and it may actually be a component attribute of a host type attribute to any recursive depth (a single dnc element means it is the actual host type element); name is an alias by which the attribute will be known in the virtual_attr_map function; this mapping exists so to make the determinant attributes look like direct sibling attributes whereas in reality they can be further-away relatives, just common components somewhere under the host type.

dependent_attrs - Cat.NameDNCMap

These are the names of the dependent attributes; the structure of dependent_attrs is as per determinant_attrs; none of these may be the same as the names of the determinant attributes, since a virtual attribute can't be defined in terms of itself.

virtual_attr_map - Cat.InnerFuncBody

This defines the entire (main) body of a virtual_attr_map function that derives a tuple of dependent attribute values from a tuple of determinant attribute values. The implicit function heading that this goes with has a single topic parameter whose declared type is a tuple whose attributes match those of determinant_attrs; the function's implicit result type is a tuple whose attributes match those of dependent_attrs. Note that the range of this function is typically smaller than its domain, though it might not be.

is_updateable - Bool

This is Bool:true if all of the dependent attributes should be treated as updateable, because they have enough information to map any kinds of updates (all of tuple insert/substitute/delete) back to their determinant attributes, and the system should try to support updates against them. This is Bool:false if all of the dependent attributes should not be considered updateable, either because it is known they don't have enough information, or because we expect users will never try to update them, so don't go to the trouble of supporting updates.

A Cat.VirtualAttrMapSet has a binary (unique) key on the determinant_attrs plus dependent_attrs attributes; it also has a distributed (unique) key over the dependent_attrs attribute of all tuples. Its default value is empty.

sys.std.Core.Type.Cat.ConstraintSet

A Cat.ConstraintSet is a Relation that specifies a set of named generic constraints for data types or variables; each tuple is one named constraint. Each constraint in the set can be either a type_constraint or state_constraint or transition_constraint, but when a set has multiple constraints, all of them must be the same kind, and they must all correspond to the same implicit function heading. One or more (possibly empty) Cat.ConstraintSet is composed into the definition each nonscalar type and union type and restriction type and dbvar.

A Cat.ConstraintSet has these 3 attributes:

name - Cat.Name

This is the declared name of the constraint function.

comment - Cat.Comment

This is an optional programmer comment about the constraint as a whole.

body - Cat.InnerFuncBody

This defines the entire (main) body of the constraint function.

A Cat.ConstraintSet has a unary (unique) key on the name attribute. Its default value is empty. The default value of a tuple of Cat.ConstraintSet has a name that is the empty string, and its body unconditionally results in Bool:true.

sys.std.Core.Type.Cat.KeySet

A Cat.KeySet is a Relation that specifies a set of candidate keys or unique key constraints for a relation type; each tuple specifies one candidate key.

A Cat.KeySet has these 4 attributes:

name - Cat.Name

This is the declared name of the key.

comment - Cat.Comment

This is an optional programmer comment about the key as a whole.

attrs - set_of.Cat.Name

This defines the 0..N host relation attributes comprising the key. If this set is empty, then we have a nullary key which restricts the host relation to have a maximum of 1 tuple.

is_primary - Bool

This is Bool:true if all of the attributes comprising this key are likely to be treated as immutable in practice for the relation's tuples, and hence are the best candidates for identifying tuples within a relation over an extended term, and are the best mapping values for automatic new foreign keys and join conditions if the host relation type has to be auto-split into several associated ones, for example because the physical representation of this relation doesn't support RVAs. This concept is a generalization of the concept of "the primary key" of a relation. A relation type can have either none of its keys or more than one of its keys with a true is_primary attribute. This is Bool:false if any of the attributes comprising this key are likely to mutate and so shouldn't be used as the target of generated foreign keys.

A Cat.KeySet has a unary (unique) key on the name attribute, and another on its attrs attribute. Its default value is empty.

sys.std.Core.Type.Cat.DistribKeySet

A Cat.DistribKeySet is a Relation that specifies a set of candidate distributed (unique) keys over relation-valued attributes of a tuple/database; each tuple specifies one distributed (unique) key.

A Cat.DistribKeySet has these 5 attributes:

name - Cat.Name

This is the declared name of the distributed (unique) key.

comment - Cat.Comment

This is an optional programmer comment about the distributed (unique) key as a whole.

attrs - set_of.Cat.Name

This declares the 0..N attributes comprising the distributed (unique) key. If this set is empty, then we have a nullary key which restricts all of the relations participating in the distributed key to have a maximum of 1 tuple between them. Note that the distributed key attribute names don't have to match the names of any participating relation attributes.

relations - Cat.DKMemRelAttrMap

This names the 0..N relation-valued attributes of the host tuple/database type that are participating in the distributed key, and says which of each of their attributes maps to the attributes of the distributed key itself. If this set is empty, then the distributed key has no effect. The unary projection of every tuple of the key_attr attribute of relations must be identical to attrs.

is_primary - Bool

This has the same meaning as is_primary of Cat.KeySet but for being distributed as if the relations distributed over were one relation.

A Cat.DistribKeySet has a unary (unique) key on the name attribute, and another on its relations attribute. Its default value is empty.

sys.std.Core.Type.Cat.DKMemRelAttrMap

A Cat.DKMemRelAttrMap is a Relation that names the 0..N relation-valued attributes of a host tuple/database type that are participating in a distributed key, and says which of each of their attributes maps to the attributes of the distributed key itself.

A Cat.DKMemRelAttrMap has these 3 attributes:

rel_name - Cat.DeclNameChain

This is the name of the relation-valued attribute that is participating in the distributed key. But the attribute named by rel_name is only a direct attribute of the host type if rel_name has 1 chain element; if it has more, then the host type attribute is a tuple/database and any further elements serve to make rel_name actually address a component of said.

comment - Cat.Comment

This is an optional programmer comment about the participation.

attr_map - Cat.DKRelAttrKeyAttrMap

This maps 0..N attributes of the relation with the same number of attributes of the distributed key. Every tuple of attr_map must have an identical value for the unary projection on its key_attr attribute; in other words, they must all map with the same distributed key attributes.

A Cat.DKMemRelAttrMap has a unary (unique) key on the rel_name attribute. Its default value is empty.

sys.std.Core.Type.Cat.DKRelAttrKeyAttrMap

A Cat.DKRelAttrKeyAttrMap is a Relation. It maps 0..N attributes of a relation-valued attribute of a host tuple/database type participating in a distributed key, to the same number of attributes of the distributed key itself. A Cat.DKRelAttrKeyAttrMap has 2 attributes, rel_attr and key_attr, each of those being a Cat.Name, and each of those being a unary key. Its default value has zero tuples.

sys.std.Core.Type.Cat.ForeignKeySet

A Cat.ForeignKeySet is a Relation that specifies a set of foreign (non-distributed) keys over relation-valued attributes of a tuple/database; each tuple specifies one foreign key, which is a kind of referential constraint, that relates tuples of such attributes. Each tuple of a child attribute must have a corresponding tuple in a specific single parent attribute, where they correspond on the attributes of the parent attribute that comprise a (unique) key of the latter. Note that it is valid to define a foreign key involving zero attributes, but its effect would be a no-op / a constraint that rejects nothing.

A Cat.ForeignKeySet has these 6 attributes:

name - Cat.Name

This is the declared name of the foreign key.

comment - Cat.Comment

This is an optional programmer comment about the foreign key as a whole.

parent - Cat.DeclNameChain

This is the name of the relation-valued attribute that is the parent in the foreign (non-distributed) key relationship. But the attribute named by parent is only a direct attribute of the host type if parent has 1 chain element; if it has more, then the host type attribute is a tuple/database and any further elements serve to make parent actually address a component of said.

parent_key - Cat.Name

This is the name of the explicitly declared candidate key or unique key constraint of parent which defines the attributes of parent that are being matched on in the foreign key.

child - Cat.DeclNameChain

This is the name of the relation-valued attribute that is the child in the foreign (non-distributed) key relationship; its structure is as per parent. Note that child and parent are allowed to be one and the same.

attr_map - Cat.FKChildAttrParentAttrMap

This maps 0..N attributes of the child relation with the same number of attributes of the parent relation; the mapped attribute names may or may not be the same.

A Cat.ForeignKeySet has a unary (unique) key on the name attribute. Its default value is empty.

sys.std.Core.Type.Cat.ForeignDistribKeySet

A Cat.ForeignDistribKeySet is a Relation that specifies a set of foreign distributed keys over relation-valued attributes of a tuple/database; each tuple specifies one foreign key, which is a kind of referential constraint, that relates tuples of such attributes. Each tuple of a child attribute must have a corresponding tuple in one member of a specific set of parent-alternative attributes (that have a distributed key ranging over them), where they correspond on the attributes of the parent-alternative attribute that comprise a distributed key on the latter. Note that it is valid to define a foreign key involving zero attributes, but its effect would be a no-op / a constraint that rejects nothing.

A Cat.ForeignDistribKeySet has these 5 attributes:

name - Cat.Name

This is the declared name of the foreign key.

comment - Cat.Comment

This is an optional programmer comment about the foreign key as a whole.

parent_distrib_key - Cat.DeclNameChain

This is the name of the explicitly declared distributed (unique) key that is the parent in the foreign distributed key relationship; it defines by proxy the attributes that are being matched on in the foreign key. But the distributed key named by parent_distrib_key may not be directly declared by the host type of this foreign key; it might be declared by the type of an attribute of the host type, if said attribute is a tuple/database; so the only or last parent_distrib_key chain element is a key name, and any preceeding names are attribute names.

child - Cat.DeclNameChain

This is the name of the relation-valued attribute that is the child in the foreign distributed key relationship. But the attribute named by child is only a direct attribute of the host type if child has 1 chain element; if it has more, then the host type attribute is a tuple/database and any further elements serve to make child actually address a component of said.

attr_map - Cat.FKChildAttrParentAttrMap

This maps 0..N attributes of the child relation with the same number of attributes of the parent distributed key; the mapped attribute names may or may not be the same.

A Cat.ForeignDistribKeySet has a unary (unique) key on the name attribute. Its default value is empty.

sys.std.Core.Type.Cat.FKChildAttrParentAttrMap

A Cat.FKChildAttrParentAttrMap is a Relation. It maps 0..N attributes of a child relation-valued attribute of a host tuple/database type participating in a foreign non-distributed or distributed key, to the same number of attributes of a parent such attribute or a distributed key of the host. A Cat.FKChildAttrParentAttrMap has 2 attributes, child_attr and parent_attr, each of those being a Cat.Name, and each of those being a unary key. Its default value has zero tuples.

sys.std.Core.Type.Cat.InnerUnionType

A Cat.InnerUnionType is a Tuple. It defines a new data type whose values are all drawn from one or more specified other types (which can be any not-Empty types at all), and that generally speaking it is an arbitrary subset of Universal (and it has its own default value). The value set of the new data type is determined by taking a set of source types' values and subtracting from it a set of filter types' values (and then optionally applying 0..N type constraint functions to the values remaining). The likely most common such type definition scenario is defining a simple explicit union type of 2+ scalar source types. Less likely for usage, you can also define simple explicit intersection or difference or exclusion types. A union type does not define any changes or supplements to the interfaces available for working with its values, instead simply using those of its declared parent types. A data type defined in this way is typically not considered to exist when the system wants to determine the MST (most specific type) of one of its values.

A Cat.InnerUnionType has these 7 attributes:

comment - Cat.Comment

This is an optional programmer comment about the inner union type as a whole.

sources - set_of.Cat.NameChain

These are the names of the 1..N other not-Empty types that all the values of the new data type are drawn from; the complete set of source values is determined by either unioning (the default) or intersecting the values of these types.

is_source_intersection - Bool

Iff this is Bool:true then the set of source data types will be intersected to determine the complete set of source values; iff this is Bool:false then the set of source data types will be unioned to determine the complete set of source values.

filters - set_of.Cat.NameChain

These are the names of the 0..N other types (which are generally subtypes of those of sources) that determine values which the new data type will not contain; the complete set of filter values is determined by either unioning (the default) or intersecting the values of these types.

is_filter_intersection - Bool

Iff this is Bool:true then the set of filter data types will be intersected to determine the complete set of filter values, and if filters has no elements then the filter set is just Universal; iff this is Bool:false then the set of filter data types will be unioned to determine the complete set of filter values, and if filters has no elements then the filter set is just Empty.

constraints - Cat.ConstraintSet

This defines the entire (main) bodies of 0..N type_constraint functions that (when and-ed together) determine what filter-type-passing source-type values are part of the union type. The implicit function heading that each of these goes with has a single topic parameter whose declared type is Universal, unless there is exactly 1 sources element whereupon the declared type is the same as the source type, and whose argument is the value to test; the function's implicit result type is Bool. If the functions unconditionally result in Bool:true, then all filter-type-passing values are allowed.

default - Cat.InnerFuncBody

This defines the entire (main) body of a type_default function that results in the default value of the union type; it has zero parameters and its result type is the same as the union type whose declaration it is part of.

The default value of Cat.InnerUnionType defines an alias for Universal, with the same default value; it has just the source type Universal and zero filter types, both type lists are unioned, and constraints is empty (unconditionally Bool:true). Note that there is no valid combination of Cat.InnerUnionType attribute values that would result in an alias for the Empty type, due to default being mandatory.

sys.std.Core.Type.Cat.InnerRestrType

A Cat.InnerRestrType is a Tuple. It provides a relatively terse method to define a simple restriction-defined subtype of a single other type (which can be any not-Empty type at all), which is a common kind of type to have. The new type is either a proper or non-proper subset of the other type, whose values are determined from applying 0..N type constraint functions to the parent type; either way, the new type does declare its own default value. An alternate common scenario is to define a non-proper subtype of its parent type that serves just to supply a different default value for the context in which the new type is used. A restriction type does not define any changes or supplements to the interfaces available for working with its values, instead simply using those of its declared parent type. A data type defined in this way is typically not considered to exist when the system wants to determine the MST (most specific type) of one of its values.

A Cat.InnerRestrType has these 4 attributes:

comment - Cat.Comment

This is an optional programmer comment about the inner restriction type as a whole.

base_type - Cat.NameChain

This is the name of the not-Empty other type that all the values of the new data type are drawn from; the new type is being declared as a subtype of that named by base_type.

constraints - Cat.ConstraintSet

This defines the entire (main) bodies of 0..N type_constraint functions that (when and-ed together) determine what base type values are part of the restriction type. The implicit function heading that each of these goes with has a single topic parameter whose declared type is that named by base_type, and whose argument is the value to test; the function's implicit result type is Bool. If the functions unconditionally result in Bool:true, then the new type is a non-proper subtype of the base type.

default - Cat.InnerFuncBody

This defines the entire (main) body of a type_default function that results in the default value of the restriction type; it has zero parameters and its result type is the same as the restriction type whose declaration it is part of.

The default value of Cat.InnerRestrType defines an alias for Universal, with the same default value; it has the base type Universal and constraints is empty (unconditionally Bool:true). Note that there is no valid combination of Cat.InnerRestrType attribute values that would result in an alias for the Empty type, due to default being mandatory.

TYPES FOR DEFINING DBVARS ^

sys.std.Core.Type.Cat.DbVar

A Cat.DbVar is a Tuple. It specifies the data type and transition constraints and so forth of a database-typed variable, such as the (dep|sdp|pkg).data variables.

A Cat.Package has these 2 attributes:

comment - Cat.Comment

This is an optional programmer comment about the dbvar as a whole.

type - Cat.Type

This defines the entire database type.

Transition constraints et al are still TODO.

The default value of Cat.DbVar defines a variable that is "just a database" and has no extra constraints.

SIMPLE GENERIC NONSCALAR TYPES ^

sys.std.Core.Type.Cat.NameTypeMap

A Cat.NameTypeMap is a Relation. It defines a basic component list, meaning a set of names, with a declared data type name for each. It forms the foundation for most componentized type definitions, including all tuple and relation types (for which it is named heading), and it is used also for the components list of a scalar possrep. It is also used to define parameter lists for routines. A Cat.NameTypeMap has 2 attributes, name (a Cat.Name) and type (a Cat.NameChain); the name is the declared name of the attribute or parameter, and comprises a unary key; the type is the declared data type of the attribute or parameter. Its default value has zero tuples.

sys.std.Core.Type.Cat.NameExprMap

A Cat.NameExprMap is a Relation. It defines a basic component-values list, meaning a set of names, with a declared local expression node (or parameter or variable) name for each. It is used to define collection literals; one Cat.NameExprMap defines a whole Tuple value. It is also used to define argument lists for routine invocations. A Cat.NameExprMap has 2 attributes, name (a Cat.Name) and expr (a Cat.NameChain); the name is the name of the tuple/etc attribute or routine argument, and comprises a unary key; the expr is the declared local name of the expression node (or parameter or variable) which defines the value for the attribute or argument. Note that while the expr attribute could conceivably just be a Cat.Name because most of its allowed values would be in the lex namespace, the Cat.NameChain is used instead so that value expressions can take advantage of terse syntax for addressing value attributes. Its default value has zero tuples.

sys.std.Core.Type.Cat.NameDNCMap

A Cat.NameDNCMap is a Relation. It defines an association of a short name with a declaration name chain, to be used for aliasing the latter with the former in a particular context. A Cat.NameDNCMap has 2 attributes, name (a Cat.Name) and dnc (a Cat.DeclNameChain); each of those is a unary key. Its default value has zero tuples.

sys.std.Core.Type.Cat.AttrRenameMap

A Cat.AttrRenameMap is a Relation. It is used as a specification for how to rename attributes of some collection. A Cat.AttrRenameMap has 2 attributes, before and after, each of those being a Cat.Name, and each of those being a unary key. Its default value has zero tuples.

sys.std.Core.Type.Cat.IfThenMap

A Cat.IfThenMap is a Tuple. It defines an element of an if-else sequential expression or statement. A Cat.IfThenMap has 2 attributes, if and then, each of which is a Cat.NameChain; if has the name of a local expression node (or parameter or variable), and then in the case of an if-else expression has likewise, or in the case of an if-else statement has the name of a statement node. For an if-else expression, the if node is the condition to evaluate; if that condition evaluates to Bool:true, then the then node is evaluated and its result is the result of the whole if-else expression; otherwise, then is not evaluated. For an if-else statement, the if node is the conditional result variable name; if that conditional result is Bool:true, then the then statement node is invoked; otherwise, then is not invoked. Its default value has the default value of the Cat.NameChain type in both attributes.

sys.std.Core.Type.Cat.WhenThenMap

A Cat.WhenThenMap is a Relation. It defines a set of dispatch options for a given-when-default expression or statement. A Cat.WhenThenMap has 2 attributes, when and then, each of which is a Cat.NameChain; when has the name of a local expression node (or parameter or variable), and then in the case of a g-w-d expression has likewise, or in the case of a g-w-d statement has the name of a statement node. The when node is the not-common / distinct operand for each condition. For a g-w-d expression, if a when value is matched, then the then node is evaluated and its result is the result of the whole g-w-d expression; otherwise, then is not evaluated. For a g-w-d statement, if a when value is matched, then the then statement node is invoked; otherwise, then is not invoked. Its default value has zero tuples.

TYPES FOR SPECIAL ENTITY REFERENCES ^

Muldis D needs to support the concept of a closure or higher-order function, mainly for functions but also to a smaller extent for imperative routines. For example, the generic relational restriction operator is designed to conceptually take a function as an argument and then invoke that function on each tuple of a relation it is filtering, and the function has the criteria for whether the tuple passes the filter.

Conceptually, all that is needed is to pass the fully-qualified name of the routine as such an argument, which in the system catalog is represented as a Cat.NameChain. But using an actual Cat.NameChain frequently doesn't work to support closures because the typical closure is defined as an inner routine and those are expressly private to the context of the outer entity that the inner is embedded in. There is no valid Cat.NameChain value for referencing it from outside that context (likewise for routines declared private to a package), and outside that context is typically where the routines that take closures as arguments would live. For example, if public function dep.mymain had an inner function inn.mytest and dep.myfoo invoked the public function dep.myfilter with an argument value of inn.mytest, then if dep.myfilter tried to invoke the function it was passed, it would actually be trying to invoke an inner function of dep.myfilter named inn.mytest, which won't work. Conceptually, a solution to this problem is to actually pass a routine name in a more fully-qualified form, conceptually like dep.mymain.mytest, which then dep.myfilter could correctly invoke. However, if that was made to work literally with a Cat.NameChain, then this could cause problems where anything could invoke mytest directly without being given permission from mymain.

As an at-least-initial solution to this problem, here are a few black box data types (specifically, quasi-scalar types with no possreps) which will provide fully-qualified identifiers for routines, useful as alternatives to Cat.NameChain values, so any routine may be correctly invoked from any other routine, without losing privacy. Values of these types work their magic by embedding knowledge about the lexical-et-al context in which they were selected, so that when routines are to be invoked by way of those values, the invocation of the capture effectively takes place within the same context where the special type values were selected, as users would conceptually expect. Selecting one of these special values involves a Cat.NameChain argument, and the identity of the selected special value is based on the combination of the argument and the context of selection, more or less. At the same time, every one of these values may incorporate a meaningless random element to make every selection produce a distinct value, even if more than one would have the same semantics. However, normal value assignment et al will preserve the same value of course, so identity comparison of a V with a v that was previously assigned to it would result in TRUE. Currently, selecting these special values can not be done with an ordinary routine, but only with a special catalog type for an expression or statement node, due to the unusualness of this. It is also not possible to map one of these special values to another type. There are no defined sorting orders for values of these types. There are default values for these types (of course), and those defaults are to system-defined routines, for which incidentally the Cat.NameChain solution would always have worked. These types are all infinite.

There are also similar special types here for referencing data types, but not for as many of the reasons. Maybe another advantage of all of the above is that this can help compile-time type checking.

sys.std.Core.Type.Cat.FuncRef

A Cat.FuncRef (quasi-scalar) is functionally like a smart Cat.NameChain that holds a function name but it remembers the context of its creation. It is used to implement a higher-order function or a functional closure. Its default value is a reference to the sys.std.Core.Universal.is_identical function.

sys.std.Core.Type.Cat.ProcRef

A Cat.ProcRef (quasi-scalar) is functionally like a smart Cat.NameChain that holds an imperative routine name but it remembers the context of its creation. It is used to implement an imperative closure. Its default value is a reference to the sys.std.Core.Universal.assign updater.

sys.std.Core.Type.Cat.TypeRef

A Cat.TypeRef (quasi-scalar) is functionally like a smart Cat.NameChain that holds a data type name but it remembers the context of its creation. It is used in places where the name of a data type to 'use' would be taken as a routine argument. Its default value is a reference to the sys.std.Core.Type.Bool data type.

sys.std.Core.Type.Cat.OrdDetFuncRef

A Cat.OrdDetFuncRef (quasi-scalar) is to a Cat.OrdDetFuncNameChain what a Cat.FuncRef is to a Cat.NameChain; it implements a functional closure but its default value is a reference to to the sys.std.Core.Scalar.order function.

SEE ALSO ^

Go to Muldis::D for the majority of distribution-internal references, and Muldis::D::SeeAlso for the majority of distribution-external references.

AUTHOR ^

Darren Duncan (perl@DarrenDuncan.net)

LICENSE AND COPYRIGHT ^

This file is part of the formal specification of the Muldis D language.

Muldis D is Copyright © 2002-2008, Darren Duncan.

See the LICENSE AND COPYRIGHT of Muldis::D for details.

TRADEMARK POLICY ^

The TRADEMARK POLICY in Muldis::D applies to this file too.

ACKNOWLEDGEMENTS ^

The ACKNOWLEDGEMENTS in Muldis::D apply to this file too.