Chu Command

being revised May 2006

Google site search

ContentsIntroductionBasicIntermediateAdvancedFuturePolicyInfrastructure

1   Tcl Chu Command - chu

chu ?options ....? ?subcommands...? expr

The chu command evaluates the chu space expression and returns a chu space.

The chu command requires use of the lambda command.

The Tcl chu command evalutes expressions over chu spaces. A chu space is represnted as a matrix over an alphabet of size K. The theory of chu spaces is concerned mainly with finite spaces over finite alphabets. Since all finite alphabets can be equated with any well known alphabet, chu spaces conventionally use the integers as the alphabet. Since the more interesting chu space operators are of order O(kn2) for an alphabet of size K, for practical purposes the alphabet is restricted to single decimal digits. Rows of a Chu space are synonomously called points as they generally represent points in an algebraic space. Columns of a Chu space are synonomously called states because they represent event states in concurrent event theory. The duality between algebraic points and concurrent event states is a key aspect of the study of Chu spaces. Rows which consist entirely of one symbol are called constant as they represent a right zero for the algbraic space.

The class of chu spaces for K=2 is of special interest as these spaces can be used to represent algebraic structures based on the idea of relation. Binary relations, partially ordered sets, lattices, graphs and tolopolgies are all represented in this class. Chu operators can be used to generate a lattice from a poset, or to determine whether one graph is a subgraph of another. It is not the purpose of this page to explain the mathematics of chu spaces, but simply to explain how to use the [chu] command. Because chu spaces are a general method of representing algebraic structures, they are used by different schools of enquiry who use a subset of the operators pertinent to their particular sphere of interest. The three main areas are, concurrent processes, which use the choice and sequence operators(U,:), linear logic and the algebra of morphism which uses implication (-o), and relational theory which uses the unary operator query (?). So the operators in chu expressions should not be expected to form a cohesive algebraic structure as a whole.

Options

-uniqueThe unique options causes the returned space to have all duplicate rows and columns reduced to single instances. Many operations return unique spaces by default but some operatos like => customarily return non-unique (multi) spaces.
-multiThe multi option prevents the result space from being reduced by default unique behaviour. This is defualt behaviour for implication and its derivative operators -o, *, =>.

OPERANDS

A chu space expression consists of a combination of operands, operators and parentheses.

Prefix Unary Operators

~The transpose operator performs the usual transposition of the chu space matrix. The operator ~ is used instead of the conventioanl _|_ for several reasons. _|_ is conventionally used to mean bottom (or undefined) in functional languages and is also used to mean undefined word in many expression parsers. In chu space theory the transpose is normally written A_|_ which does not translate so well into the ASCII of programming. Finally ~ has a slightly more intuitive feel because ~~A <=>A.
?The query (? A)operator returns the smallest space containg rows of A which is continuous under deletion of points or duplication of A. It contains all constants of the alphabet. For K=2 ?A is the closure under union and intersection of the points of (A union {constants 0 and 1} ) which is a lattice (or topology).
!The bang operator is the dual operator of query. !A <=>~?~A

Infix Binary Operators

#Product. A # B has rows which are all the combinations of rows of A followed by rows of B. Product is a general algebraic operator.
+Sum is the dual of #. A + B <=> ~ ( ~A # ~B)
-oImplication enumerates all the morphisms between the two spaces. It returns a space in multi form by default.
*This is the kind of dual of implication. A * B <=> ~( A -o ~B). It returns a multi form space by default.
=>A => B is equivalent to !A -o B.
:Sequence. ":" has been used instead of the conventional ";" as ; is a special Tcl character. This is a concurrent event operator.
UChoice is another concurrent event operator

Constants

The general chu space value is a list of 4 parametric elements {matrix points spaces K}. These 4 elements are expressed in the form of a lambda expression Because chu spaces can easily become quite large, several classes of spaces are known by name. The name generally applies to a class of spaces over K, the size of the alphabet.
0 is the empty set, having no points and 1 state.
1 is the singleton set, having 1 point and k states. 1 represents the single point of discrete states over k. 1+1 is called 2, having 2 points and k2states and is the discrete topology. 2+1 is the same as 1+2 and is called 3 and so on. These spaces, p, are the largest unique spaces of p points over k symbols. They have p points and kp states and represent the discrete topology and have no constraints on their structure. Because they are so large it is convenient to reduce them to symbolic representation whenever possible.

General chu space values

The general chu space value is a list of 4 parametric elements {K points spaces matrix}. These 4 elements are expressed in the form of parametric Tcl commands which evaluate to the desired values. The first three items in the list must evaluate to positive integers, with K <= 10. The matrix command evalutes to a well formed chu-space matrix which matches the dimensions (points, spaces) and alphabet specified by K.

For example the chu space represented by the integer constant n is: { "set k" "set null $n" "expr {pow($k,$n)}" "set m {} for { set r 0} { $r < $n} {incr r} { set point "" for {set c 0} { $c < pow($k,$n) } {incr c} { append point [expr { $c/integer(pow($k,$n-$r-1)) } ] } lappend m $point } set m" }

Builtin Functions

para( expr, p, s) where expr is a Tcl expression using the parametric variables %p (for point) and %s (for state) and %k. p and s are evaluted to integers, and then expr is evaluted using p and s as the bounds of the space. The value of K is assumed from the current context of the chu command. The expr is forced to integer modulo K.

For example para(%p+%s,4,4) is the cyclic group order 4 if K=4.

data( list)where list is a list of items representing explicit row digits. The number of list items is the number of points in the space. All the items in the list must be of equal length.

For example data("0123 1230 2301 3012") is also the cyclic group order 4.

CG is the cyclic group, having k points.
MM is the muliplicative monoid, having k points

©2000 - 2006 WEBSCOOL This page last updated 11 May 2006. All rights reserved - including copying or distribution of any portion of this document in any form or on any medium without authorisation. For more regarding the copyright.