Shortcut A Set Claim Language

Reviews
Stats
views:
4
rating:
not rated
reviews:
0
posted:
1/25/2009
language:
pages:
0
Shortcut: The Language of Links  PRELIMINARY DRAFT By Damion Dooley Revised, September 2, 2002 This is a PRELIMINARY DRAFT. I want it to attract the interest and participation of people in the project, and/or to attract mentors who can help me along the way. The definitions and examples aren’t necessarily syntactically correct or complete. Naturally much more work is required to flesh out the concept. This paper explores what I think we need in computer science: an elegant, pure, fast, and simple computer language and database system merged into one. It would be built methodically upward from the fundamental building block of math and logic, namely, sets and graphs, and it would use the “constraint satisfaction” approach to software programming. I nickname this software vision “Shortcut". Programming languages like Lisp and Prolog approach the goal of unifying set theory, graph theory and the logic of constraint programming. However, each alone does not fulfill what I think are a sensible package of key goals, outlined below in the Introduction section. I will also make the brash prediction that relational databases like those based on SQL, though commercially very successful, are less elegant, flexible, and economical to implement many kinds of system in, in comparison to Shortcut. In the long run, momentum won’t save them. Finally, I am biased towards the constraint satisfaction approach to programming since it focuses on crafting systems by describing known rules & relationships, and performs problem solving based on these limitations or liberties. To return results, constraint programming does not require a thought-out chain of command between objects or subroutines. Confidential, Copywrite 2002 by Damion Dooley Page 1 of 27, 1/25/2009 Contents Shortcut: The Language of Links ..................................................................................... 1 INTRODUCTION............................................................................................................. 2 SETS & REFERENCES .................................................................................................. 6 Link .............................................................................................................................. 7 CONSTRAINTS ........................................................................................................... 9 MAPPING .................................................................................................................. 11 FUNCTION ................................................................................................................ 12 Matching .................................................................................................................... 12 Claims ....................................................................................................................... 13 Existence Claims: ................................................................................................... 13 Contradictions........................................................... Error! Bookmark not defined.15 Questions .................................................................................................................. 25 DATA STRUCTURES AS SETS ................................................................................ 18 FINITE LIST ........................................................................................................... 21 CIRCULAR STRING .............................................................................................. 22 RELATIONAL TABLE............................................................................................. 24 PREDICTABLE STRUCTURE ............................................................................... 24 LINKED STRUCTURE ........................................................................................... 24 THE LANGUAGE....................................................................................................... 25 INTRODUCTION This list of key points is followed by a rough talk-through of the order & reasoning of the rest of this paper. Key points:  The distinction between programming language and database is suspect. The driving motivation behind having database software as a separate entitiy is that it is software that specializes in managing “persistent data”, especially in relation to a storage medium (hence backup and transaction functionality). For practicality, it can interface to a variety of programming languages through standards such as SQL. The purpose of programming languages has traditionally been segregated into the tool used to draw data from the database, report on it, and perhaps transform it. I feel that programming language and db functionality should instead be redesigned methodically around the nature of data. For example, when we move to say that variables, constants, claims and their responses, records, structures Confidential, Copywrite 2002 by Damion Dooley Page 2 of 27, 1/25/2009 of data, etc. are all held within the database, language and database become unified. “Transaction engine” and “backup engine” become selectively applied components that were previously housed in the database software. This doesn’t preclude Shortcut from interfacing with other database systems or languages.  All data can be represented as a set. General definition of a set: A set is composed of 0 or more elements, each of which can be a set. An element can be a member of more than one set. Hierarchies aren’t the only perspective on information. I venture that work on any point of data or “object” must have tools that can grasp not just the hierarchy that a point is imbedded within, but also that the point may exists within more than one hierarchic or non-hierarchic network of information. This is accomplished by linking points/things using graph theory’s (non-directed) link. A data type is a collection of constraints placed on the general definition of a set. Data matches a data type when none of these constraints are violated. Familiar data types include integers, lists, arrays, structures, tables, RDBMS's, object oriented DB’s, etc.. When a constraint is dropped from or added to a data type, the result may be an “adjacent” data type already in use. For example, the difference between linear and circular lists. This has many implications for ease of programming. Data can be retrieved by specifying the data type AND the context it must exist within. This includes data within table rows, list items, structures, and constants and variables. This approach eliminates RDBMS problem: the inability to return structures of data. Any set of data can be claimed to exist, or claimed not to exist, or both. As well the membership of any set element can be claimed or claimed not to exist. The work studies the possible responses to contradicting claims, and implements these as the basic building blocks of a programming language. In Shortcut error handling is accomplished by programming a resolution response for each claim that can possibly be contradicted. There is no bias towards treating a claim or its contradiction as the cause of an error. In Shortcut, error handling is not a side aspect of the system. This should have a profound effect on QA. There are no direct "loop" commands in the language. This functionality is handled by set membership constraints, and the order in which they are tested, if appropriate. If I’m not mistaken, this enables parallel processing to be applied more easily. The work also assumes that matters of efficiency will be handled by implementing "shortcuts": Where a particular data type is enforced, more efficient, traditional programming calls would automatically be consulted to do particular work more efficiently.        Confidential, Copywrite 2002 by Damion Dooley Page 3 of 27, 1/25/2009 To prove or fulfill the goal points outlined above, I start with some programming language constructs based on set theory. Sets enable us to represent much of the semantics we need to talk about data: categories, types, groupings, states, hierarchies, and inheritance of things. (Note that set theory is closely related to graph theory. Graph theory visually represents these same set concepts as collections of points, linked by lines that have arrows on them to indicate set memberships.) There is one concept we take from graph theory since set theory is awkward at representing it: namely peer-to-peer relationships, or attributes, or associations. A peerto-peer relationship is indicated by linking two points with an arrow-less line. This allows two things to be associated without implying the semantics that one is a subset of the other or that there must be a third thing which is a parent of the two. This enables us to keep a clean distinction between a thing’s membership in a set category, group, hierarchy or state; and any other mutual or peer relationships it has to other things. In graph theory, directed and undirected edges are used. I change this terminology slightly to talk about links. I then focus on defining a “link” as the building block of both describing / creating / extending AND querying data. I explore what is needed to make a querying language focused on the link. A main step here is to apply constraint satisfaction programming, and handle link query results themselves as sets. I explore the concept of a mapping, which is a set of links; and a function, which is usually a mapping from elements of one set to elements of another set. Then, as with links, I apply constraint programming concepts to mappings and functions. I also propose that Shortcut be able to entertain hypothesis. In other words, any of its sets or links can be claimed to exist or claimed not to exist. Contradictions and possible responses to contradictions are discussed. Finally I present a continuum of data types, showing how each is derived from a similar, but “looser” data type, culminating in the definition of sets itself. This is where we see Shortcut doing the same work that SQL relational databases or XML and XQUERY can do, but in a more flexible and elegant manner. At this point we should be able to write Shortcut pseudo-code. Notation Below we will work through a number of pseudo-definitions, which slowly build up the language, based on the concepts above. Pseudo-definitions, much like BNF (BachusNaur Formalism), will use: () parenthesis to mark a part of the definition, italics to mark a reference to another definition. | to denote exclusive alternatives within a part, * to denote 0 or more occurrences of a part, ? to denote 0 or 1 occurrence, + denotes 1 or more occurences Confidential, Copywrite 2002 by Damion Dooley Page 4 of 27, 1/25/2009 I foresee that the Pseudo-definitions given below can be interpreted both as a means of constructing data (claiming that such data exists), and also as a means of selecting/querying/constraining data. I.e. by using prolog-like pattern matching, a definition with a missing part can be turned into a query that returns data. More on this later. Confidential, Copywrite 2002 by Damion Dooley Page 5 of 27, 1/25/2009 SETS & LINKS Sets are the theoretical building blocks of this system. A set consists of 0 or more elements, each of which is a set. A set can be an element of itself, or both an element and a superset of another set. In the discussion below when talking about an element B of a set C, I will usually say “element” B instead of “set” B or “subset” B, even if that element is itself a set of other elements. There are two basic ways to locate a set in this system. First, one can navigate, that is, make relative (from some given point) or absolute moves that depend on the nature of the data structures involved, for example: look in here, next to, above, to the left, right, etcetera. I will return to this later. The second method is by enabling any set in the system to have a unique name (that is, there are no two sets in the system with the same name). Having this, one can lookup or make any relationships between a named set and other sets. Creating a new name for a set is the same as creating a new empty set. Defn. Name Name e.g. Definition name: (alphanumeric|_)+ name: A Comment Creates and names a set if it doesn’t already exist, doesn’t do anything if it exists. Creates a set named “A” if it doesn’t already exist, doesn’t do anything if it exists. A problem arises: when naming we may need to know whether we have chosen a unique name (as intended) or whether the name already exists. If we want a unique name, we may need a separate function for this. Here is a tentative idea for this: Defn. Name Definition Name_unique name_unique: A Comment In a set named A, create one and only one new element. This element is the new set. (If A already contained elements, they are not deleted, but are instead disconnected from A. How do we get elements into a set? First, by having a recursive definition of a set. This definition allows a named set to be created, but it also allows a set to be created without necessarily having a name, in which case access to it is by navigation only. Defn. Name Set (Or Element) e.g Definition (name)? ({} | {element (, element)*})? name: A {b,c} Comment no set | empty set | 1 or more set elements separated by commas is a set named “A” of elements (subsets) b and c. Confidential, Copywrite 2002 by Damion Dooley Page 6 of 27, 1/25/2009 e.g. {b,c} e.g. A {d} Creates a set containing b and c, but no name. Constraints can find it, and so it can become an element of other sets. What does this do? Does it just add {d} to the set or does it redefine A as {d} only? See discussion below. The last example leads to a very brief note on the programming approaches one might make in order to handle a so-called fact, a claim, and a constraint. I will return to this later in more detail in the Claims section.   Fact: eg. set A contains (only) b and c. Any later expression that contradicts this is considered wrong or erroneous. Constraint: A must contain d. If in fact A does not contain d, the constraint ”fails” and usually “backtracking” is triggered. A constraint is checked by an examination of the existing fact(s) or some attempted search through a problem space. Claim: A contains d. If there is a claim that A does not contain d, there is a contradiction, but further logic (which I call a response) set by the programmer determines what action to take, if any (which claim to believe, if any) to rectify the situation. In this approach, all data consist of claims, rather than facts. Each claim behaves as a constraint, but is tested against other claims, since there are no facts.  At this point in the preparation of this document I haven’t resolved the syntactic ambiguity between A {d} taken as a claim - i.e. a particular claim about d’s membership in A - versus A {d} taken to mean that the entire membership of A is d. I am leaning towards always interpreting it as a particular claim. LINKS Graph theory, the sibling of set theory, speaks of “edges” or links that attach between nodes (elements). A directed graph is one whose links all have a single arrow on them; this set of relationships can be directly translated into the set and subset/element terminology of sets. However, a feature of graph notation that isn’t so easily represented in set notation is the ability to say that any 2 or n (or even 1) sets are linked without necessitating a set/subset parent/child relationship. (Lets avoid the semantically awkward approach of making each a subset of the others in order to represent them as siblings). An alternative is to put the elements into a set to indicate they are linked to each other, but we have to avoid confusing the elements’ existing supersets from the set representing the link’s elements. We do this by basically adding the word “Link” to the set definition. This signals that the set of elements being discussed is a member of the special set “Link” of links. Queries about supersets of a link’s elements will not return the link set UNLESS the queries are posed using the Link definition. Confidential, Copywrite 2002 by Damion Dooley Page 7 of 27, 1/25/2009 Defn. Name Link Definition Link (name)? ({} | {set (, set)*})? Comment Represents 0 or more elements linked together. This definition of link is only about peer-to-peer links. It has not been expanded yet to include directed (arrow) links. The link set name is also called its “handle”. I now move to have the Link definition also encompass what the set definition can do – talk about set and subset relationships. In talking about a link between two elements of two sets, or between a set and one of its elements, we want to be able to describe or query the attributes or context of each element of the link. Is the element in a parent/set role, a subset/element role, an element of a given set? Are link elements attached to other links’ elements in a certain way? To do this, we introduce a “context” into the syntax. Defn. Name Link Definition (name)? ({} | {set (context)? (, set (context)?)*})? Comment Now we add a few ways of contextualizing or constraining each element of the link. Excluding | In indicates whether the element should exclude or include the following memberships.  is one element in link.  is another element in link. If  is null, then this link is a loop. parent is set of all link parents/supersets. child is set of all link children/elements. set is a set the element must be found in. Context (Excluding | In) (||)? (parent | child | set)? Sidebar: In the context it is possible for 1 or n elements to be parents as long as at least 1 is also a child. If only parents are mentioned, children can be deduced. We need the ability to say that the alpha of one node is connected to the beta of another. We will have our constraint refer to alpha or beta (or both) if we want these limited. Also, one element of a link may be considered the “parent” of the other, if so it is marked as “parent”, and the other as “child”. Below is a visual treatment of the link possibilities. Needs work. Confidential, Copywrite 2002 by Damion Dooley Page 8 of 27, 1/25/2009 CONSTRAINTS Constraints are actually just a kind of link. Work needs to be done to unify the link and constraint concepts. A constraint is a set of filters that generates a matching set of elements when applied to a world of elements and their links to each other. A constraint on the set of all named things looks like: Defn. Name Constraint Definition (name)? ({} | {set (context)? (, set (context)?)*})? Comment Now we add a few ways of contextualizing or constraining each element of the link.  is one end of link,  is the other end. This allows constraints to be placed on links without having to assume set/subset / parent/child relationships. Last set, if any, indicates the set of links which alpha/beta/parent/child pertains to. Context (Excludes | In) (||)? (parent | child | quantifier set)? (lowbound | lowbound [and] highbound | highbound) [of] Lowbound: {[ > | >= ] integer | variable | any} Highbound: {( <= | < ) integer | variable | all} Quantifier: If both lowbound and highbound mentioned, then highbound’s < or <= Confidential, Copywrite 2002 by Damion Dooley Page 9 of 27, 1/25/2009 sign will distinguish which is which. Lowbound defaults to “=” if no comparator mentioned. Some lowbound and highbound combinations are contradictory and so would never yield a match. To name a constraint is to enable reference to it and to the set of elements that satisfy or violate it. A few other points: Including a name for the constraint enables all matched elements/sets to be placed into the named set. If nothing mentioned for match or exclude, match is assumed. Quantifier, if omitted, is taken to be “all of” So here is a list of constraint examples, which not coincidentally resemble data: Zero: Digit: Digits: Odd: Even: Upper_Case: Lower_Case: Letter_A: … Vowel: Consonant: Colour: Binary_0: Binary_1: 0 1 of 1,2,3,4,5,6,7,8,9,0 any of 1,2,3,4,5,6,7,8,9,0 1 of 1,3,5,7,9 1 of 0,2,4,6,8 1 of A,B,C,D,E,F,G,… 1 of a,b,c,d,e,f,g… 1 of A,a 1 of a,e,i,o,u,y 1 of b,d,f,g,k,l,m,n,p,q,r,s,t,v,w,x,z 1 of red,green,blue,white,black,orange,purple… 1 of 0,no,n 1 of 1,yes,y More constraint examples (one can substitute in ,  for parent, child for a similar link example): Constraint name eg_parent: eg_child: Long form In parent of {eg_links} match 1 of A,B In child of {eg_links} match 1 of C Short form parent 1 A,B child C The first constraint names an eg_links set, which will contains the handles of all the links the constraint applies to. There is also a set of all the parent elements of these links, which is what the “parent” parameter requests a search of. The eg_parent constraint is satisfied by selecting links into eg_links such that the parent of a link is either A or B (but not both). Contrast this with: parent A,B Confidential, Copywrite 2002 by Damion Dooley Page 10 of 27, 1/25/2009 which says that links should be selected such that the parent set contains two elements, A and B. This can be accomplished, but only by placing the handles of 2 different links into the eg_links set. To generalize: >0 … all … 1… exclude … //or constraint //and constraint (default) //xor constraint. //negation Say you simply wanted to get the parent(s) of C. child C; parent eg_parents: eg_parents: is a name for the result, and since it is followed by nothing, no constraint is placed on this set. If we wanted the parent to be constrained to nothing, we would use the {} or null sign. (We could choose to interpret these constraints as functions, and have the last function return the things the constraint matches…in that case, we would have “child C;parent”. Each function could receive its initial state from its predecessor. On exit, garbage collection would destroy all but the returned set. Hmm. This does depend on ordered sets.) The question is, should all the hidden search state information be kept when answering questions (aka regular expressions?), or only enough of it to answer the question? Hmm. Make the former the default? Programming language notes: Constraints can be grouped into sets. How do we indicate that one, some, or all of a set of constraints must apply in order for some state to exist? By placing a constraint on the constraint. MAPPING A set of 1 or more links, each of which has one or two (or n?) elements that are in the context of one or two sets. The mapping is said to apply between the two sets. A mapping’s links can contain parent and child references, but even without these a mapping can determine the traditional one-to-one/one-to-many/many-to-one relationships. Defn. Name Mapping Definition {link (, link)*} set0 set1 Comment Probably need a better way to distinguish that links must draw their elements from each of 2 (or n) sets. Confidential, Copywrite 2002 by Damion Dooley Page 11 of 27, 1/25/2009 FUNCTION A function claims to generalize the claims/constraints of a mapping. In other words, a mapping resembles data which may or may not indicate a pattern, while a function claims that the data holds to a certain pattern. Defn. Name Function Definition mapping (all | an | none | … )? Comment Each function applies from mapping’s set0 to set1 Below are some example functions. Some functions are designed to accommodate the fact that constraints elsewhere may reduce the number of links they match within a particular mapping? Or is it that a constraint is a function which attempts to be “most satisfied”? Defn. Name All An None As many of One of X of At least one of First Last Same as Fewer than More than Definition  An None Comment All e of set 1 are e of set 2 An e of set 1 is an e of set 2 No e of set 1 is an e of set 2 1 and only 1 of set1 is an e of set2 (ordered sets only) Etc. From a constraint process there may well be more than one way to satisfy a function. Mapping and ambiguity. There is [in] somewhere [a function relation] [in/to] [elements] MATCHING Whenever you have the option of picking 1 element from a set, there is a choice about what to pick. Consequently we need to have the option of controlling how this matching is directed. This matching process bears upon the ability to backtrack in order to satisfy an overall constraint. pick one that hasn’t been picked before (by this constraint or by X constraints), pick the least picked one, Confidential, Copywrite 2002 by Damion Dooley Page 12 of 27, 1/25/2009 pick the most picked one, pick the next one after the last picked one (assumes ordered sets). Pick the last-most unpicked one. Pick randomly. Pick using a strategy selected randomly from above. Pick using some other user-defined function. Pick, but ignore duplicates. Pick, but ignore position & duplicates. Each of the above methods is a function from a set to a selected set, consequently the matching function should be defined as functions normally are in the function section above. Claims Now we need to be able to talk about whether or not a set is claimed to exist, or whether or not elements are claimed to exist within it: Note that “Relation” is a simile for “link” in diagram above and the section below. Existence Claims:   A claim that a set exists, A claim that a set does not exist. Relationship Claims:   A claim that a link exists (an element is in a set), and A claim that a link does not exist. If a claim is made about a set, but the set hasn’t yet been named, the naming of that set is implicit. Once named or claimed to exist or not, a set can be referred-to for the sake Confidential, Copywrite 2002 by Damion Dooley Page 13 of 27, 1/25/2009 of argument. I propose that Shortcut has 4 special sets, named “set” and “not_set”, “relation” and “not_relation” to hold claims and counter-claims about sets and relationships.  Expression Description A! A is claimed to exist (and named if necessary.) A  set! A  Claim that relationship A  exists. B {A}! C! Claim that relationship A  exists. Arelation! Crelation! Typical hierarchic data might look like: School! Gym! Library! Office! Bathroom! Gym  School! Library  School! Office  School! Bathroom  School! Classroom  School! 1A Classroom! Etc. Or, in shorter notation: School {Gym,Library,Office,Bathroom,Classroom {1A,1B,1C,1D}}! Various questions: The Link syntax “(name)? ({} | {set (context)? (, set (context)?)*})?” has not yet been applied here… 1A 1A  ? 1A . ? classroom Returns self (a tautology). Unless contradicted?!!!! Returns School Returns all sets that 1A shares elements with (i.e. nothing). Returns classroom set, (a pointer to set containing classroom room names) classroom.set As above. classroom.relation Returns classroom room names (which are claimed). Classroom. Name X Returns a new set, X, for which name. Confidential, Copywrite 2002 by Damion Dooley Page 14 of 27, 1/25/2009 School e X! … X Set up a bunch of constraints See if X yields anything? Every system has what I would call a periphery, the frontier of observation (claim) through which other systems communicate. Behind this frontier lies the pattern layer. CONTRADICTIONS Contradictions arise with claims made for and against the set or relationship. In the table below, I experiment with using the period sign “.” as the disjunction symbol (“AND” function) between two sets. Expression -A A not_set Aset -C C not_relation set.not_set set.not_set  contradiction relation.not_relation  contradiction Description A is claimed not to exist A is a relationship which is claimed not to exist Captures all the contradicted sets existing in shortcut at any point in time: Names a set “contradiction” (if it doesn’t already exist) and claims all elements of set.not_set are members of it. Claims all elements of relation.not_relation are elements of contradiction too. C.set.not_set C.relation.not_relation C.contradicted This expression reports elements of C which are both claimed to exist and claimed not to exist (e.g. A if it is contradicted). This reports all contradicted relations in C. Reports all contradicted sets and relations in C. Confidential, Copywrite 2002 by Damion Dooley Page 15 of 27, 1/25/2009 RESPONSES It is useful not to categorically reject the contradiction of a set or relationship claim. At first glance it may seem pointless to allow a set to have a contradictory state that can linger, that is, to have direct claims that a set exists and that it doesn't exist to coexist simultaniously. But this flexibility may play a role in ferreting out the impact of contradictions on other set relations. It will also The fundamental concept of claims, counterclaims, and be important when adapting this system to fuzzy logic, where claims for and against a set are not absolute. Finally, it may accurately represent the failure of real-world machinery to behave as it was meant to. There are a few obvious ways to respond to contradictions:       Retract existing claim Retract new claim Retract existence claim (one of the above) Retract non-existence claim (as above) Retract both claims Do nothing; let contradiction exist See version .2 for this.retractions outlined above profoundly weds the fundamental building blocks of a programming language and a data representation of facts and falsehoods at the same time. Note that all of these claims are about sets or elements of data. All items of data are claims or counterclaims. All the work done by the system will consist of acting on claims, claims NOT, and retractions arising from contradictions. When I claim "Harvey" exists, and someone else claims "Harvey" does not exist, I now have a choice about who to believe - for example, I can always trust myself, or always someone else because I am insecure about my own memory, or always the latest claim (fad), or I can decide that we both could be right, and lets wait a bit and see, or I can decide it is better to assume Harvey doesn't exist for fear of public embarrassment about talking about him (or visa versa, if he seems popular). Sometimes we want to make a set or some-such data structure "read only". How to do this? First, we would want to reject any claims that remove elements from the set (or its subsets). Then we would want to reject any claims that would add new elements to the set. Both of these can be summarized by the rule: If a claim involving the set is NEW, reject the claim (or accept it). In other words, the NEWNESS of a claim itself is a quality that should be able to trigger a response. Here are the options: If a claim is NEW:   retract it, or accept it (default). Confidential, Copywrite 2002 by Damion Dooley Page 16 of 27, 1/25/2009 If a claim is NOT NEW:   retract it, or accept it (default). Note that the above cases do not require a contradiction to be invoked. Research is required to determine ripple effect of the various retractions, and to determine if infinite retraction loops can be spotted. In other words, can we have infinite "loops" (a more appropriate descriptive term might be "oscillations"), and can we predictably spot them? (classes of them probably can't be predicted according to Gerdel's incompleteness theorem?) Confidential, Copywrite 2002 by Damion Dooley Page 17 of 27, 1/25/2009 DATA STRUCTURES AS SETS Sets can come together to represent larger data structures. Lets look at the spectrum of these structures, ranging from sets to tree structures, traditional lists and tables, and structures with links to other structures. In going though these definitions I assume that pure definitions are required before a programming language can be envisioned to handle these constructs. Issues of efficiency are left to the practical implementation stage of the project. Suffice to say, we expect to arrive at a system which understands the data it is working with, and therefore can make use of a library of shortcuts in storing and manipulating this data where applicable; the programs however would remain written in the purest form. The pure expression of a program should turn out to be the most concise, meanwhile its speedy execution should be aided by the shortcuts that compilers can offer. Some of the data type definitions are not an easy read, but I aim to find that the programming language required to manipulate the data (according to the data type specs) is much simpler. Recall the basic definition of a set: A SET consists of 0 or more elements which themselves are sets. This is the loosest definition of a data structure in which any element (node, record, or field) of data can be associated with any other. I aim to show that all other data structures are restrictions or refinements of this definition. Any of the following data types can be made read-only data simply by indicating that new claims about them will be retracted. Data Type Definition Variable A set containing 0 or 1 element Atomic element A set which has 0 elements Simple set A set containing atomic elements Simple variable A variable which is a simple set! Directed set A set of positions, each of which may have one or more next positions, and/or one or more element "values" at that position. A directed set must have continuity - i.e. any particular position should be reachable from or to another position. At its simplest this is an ordered list of not necessarily unique items; at its most complex this is a (mathematical) directed graph. Example of directed set S: A simple directed set S that translates to the list "(a,p,p,l,e, ,p,i,e)" would look like: Confidential, Copywrite 2002 by Damion Dooley Page 18 of 27, 1/25/2009 Set S primarily contains a unique element for each position in the set (e.g. {1,2,3,4,5,6,7,8,9} ). Each element of the set contains a subset which contains both the value(s) at that position, and the "next" element(s) from that position as a subset of that position, e.g. {1{a,2},2{p,3},3{p,4},...}. (S could be broken up into 2 subsets, one documenting each position and its next elements, and the other each position and its values, but since the values and the postions can be distinguished, I have amalgamated the subsets) . The claims that define/constrain the directed set data type are: Claim for directed set S name a set Position Explanation Position, Value, and Next are related to S, and are used to test the validity of S's membership in the data type "Directed_Set". claim Position  S name a set Value claim every  Value is an  of at least one subset of Position claim each  Value is  Position name a set Next claim each Next matches some  Position claim each  subset of P osition matches some  Position or some  Value name a set Continuity Ensures a next position element is not confused with a value element. Ensure that every value and next element in a subset of position doesn't contain any other elements. Constraints on the continuity set ensure that each position of S can be reached either to or from any other position using the Next Mapping; otherwise we I.e. there is no  Value which is not an  of a subset of Position Ensures value element isn't confused with a position element Confidential, Copywrite 2002 by Damion Dooley Page 19 of 27, 1/25/2009 would be talking about 2 or more seperate structures. This is tricky! Claim X E P, If P contains 1 Prove it either inductively (NEW claim attribute) or some element, then that element E other way? Continuity. otherwise, given X E Next, X E subset Y of P, Y E Continuity, then X E Continuity. As stated above, this is a non-deterministic kind of ordering - since there can be more than 1 "next" position. It also allows for 0 or more than one character (a set of characters) per position. The definition also allows for circularity. Confidential, Copywrite 2002 by Damion Dooley Page 20 of 27, 1/25/2009 FINITE LIST The following example tests a use of "" double quotes to indicate a string whose characters are each represented as an element in a set. A set S, (e.g. {"now I know my abc's"}, or {jack,jane,jerry,joe}) is defined as above, but with the following additional constraints:    One element in Position has no Next element. (This defines the last element). Each remaining element in Position has 1 Next element in its subset which is a unique reference to another position. For any Position element, there is exactly one Value element in its subset. The start of the list can be found (matched) by looking for the S element that does not appear in a Next element subset. Setting up the variable binding "food= 'apple pie' " in set language might read as follows: claim food["apple pie"] Where the interpreter knows that anything inside [] parentheses is a list of ordered elements. The idea here is to provide a readable, text editor-based method of entering the data. This is different from claim food{apple, pie} which would set up 2 elements in food, one called apple, the other called pie. Confidential, Copywrite 2002 by Damion Dooley Page 21 of 27, 1/25/2009 CIRCULAR STRING A CIRCULAR STRING definition contains these additional constraints: Each element in Position has 1 Next element in its subset that is referenced uniquely. For any Position, there is exactly one Value element in its subset. Note that this doesn't leave us with knowledge of where to start in the string. We would have to pick an element at random, or keep a list of first elements in a set named something like "First_Elements". Confidential, Copywrite 2002 by Damion Dooley Page 22 of 27, 1/25/2009 TABLE A traditional TABLE is defined in Shortcut as: A set of fields of the table (each of which is a set) A set of rows of the table (each of which is a set) A set of elements such that for each element X: o X is an element of one and only one row set. o X is an element of one and only one field set. The name of element X could be interpreted as the value of the field (, or more distastefully, we could add an "attribute" to the element which was the value of the element). Confidential, Copywrite 2002 by Damion Dooley Page 23 of 27, 1/25/2009 RELATIONAL TABLE A RELATIONAL TABLE S is defined as: A table which has elements of a particular field also occur as elements of another specific field in a relational table. (note some tables refer to records within themselves, to represent hierarchies or lists). PREDICTABLE STRUCTURE A PREDICTABLE STRUCTURE S is defined as: 1. A set of fields of the structure (each of which is a set) 2. A set of rows of the structure (each of which is a set) 3. A set of elements such that for each element X: 4. X is an element of one and only one row set AND X is an element of one and only one field set 5. OR X does not exist. 6. An element may also contain a structure (as its elements) 7. If an element contains a structure, the element must belong to a field set that makes reference to a table or structure as a component part (mechanics of this to be decided). In other words, a structure resembles a table, but some of its record's fields might not be defined, and as well it can recursively contain structures within its fields. Clause 4 could be modified to enable X to be a member of a field which exists in another table (or even no field membership required!). Clause 7 could be omitted to loosen the structure up even further. It would become a very "unstructured" structure! LINKED STRUCTURE A LINKED STRUCTURE is defined as: A structure which has elements appear in other structures. All of the above definitions can be applied to a collection of sets to see which definitions they fall under. Alternately a method for linking a set to a particular definition can ensure that the set conforms to the definition, or yeilds a contradiction with the definition which require remedy. Confidential, Copywrite 2002 by Damion Dooley Page 24 of 27, 1/25/2009 THE LANGUAGE The challenge now is to define a graphical or text editor syntax that can express the above constraints.  Each line of code is either an ordered set or unordered set. Unordered sets are more directly self-modified, but any ordered set can be converted to or interpreted as one or more unordered equivalents. Another idea I’d like to implement is to easily shift between unordered, ordered, unique and duplicate-enabled sets. One way to do this would be by using Bracket symbols for representing order and duplication in sets. Unordered {a,c,b} (a,a,c,a,b) Ordered [a,a,b,b,c] Unique Duplicates Here we mean by order that progression from one element to the next is possible using a function that is sensitive to an element’s position in the set. With unordered sets, there is no “next/previous” function, although by process of elimination one can still examine each element. In one command we could refer to a set using <>, thus enabling us to refer to functions that are sensitive to order (first, next, last, etc). In the next moment we could refer to the same set using {}, and our set manipulations would no longer have access to ordersensitive commands or functions. More work to do… (Ideally encode a constraint definition so it can fit in an unordered set. This way the set language can be applied to itself without depending on the concept of ordered sets. Theoretical bootstrapping as they say. This usually has to be done by representing the constraint into a set of subsets, whose depth or breadth uniquely identifies them. The above defn. isn’t perfect because in some cases its subsets can be confused.) Questions What do questions look like in this set language? A question asks about the structure and the content of the world. A question is answered by searching through the world for examples that match its set of constraints. Confidential, Copywrite 2002 by Damion Dooley Page 25 of 27, 1/25/2009 Below are some options for posing questions in Shortcut. From these we can see questions have a few aspects: Does the question require work to answer, i.e. is the question only about existing/immediate/direct claims, or does it involve checking for rule relationships that could be explored to infer new claims? This involves a new area of options and research, namely, when to process all the repercussions of a new claim entered into the system, and when not to. Often we don't want the system to start working on making inferences unless expressly asked to. Does X have a single colour? Answer: Yes/no - this question is basically asking what type of data the color information is, an atomic element or a set of 0 or more elements. Is X definitely Blue? What color(s) is X definitely? Answer: The set of all colors claimed directly (without contradiction) or which are inferred to be elements of X. This requires work if rule repercussions left uncalculated. Is X definitely NOT Blue? What color(s) is X definitely NOT? Answer: The set of all colors claimed (d or inferred) NOT to be elements of X. What color(s) MIGHT X be? Answer: The set of all colors not in above two "definitely" sets. (This answers the same question as "What color(s) MIGHT X NOT be?") The search might not have investigated all colors because for some colors, no direct or indirect claim was ever made about their membership in X. What colors are directly claimed to be in X? CLAIM CATEGORIES The above discussion suggests that a claim for or against X e Y may fall into one of four categories: 1) direct 2) inferred 3) a question 4) inferred from a question & direct. This allows us to state claims directly, or as questions, and when we see responses, we can tell whether they were inferred or not, and which question they were inferred for. History The historical constraints on memory and computer speed have strongly influenced the programming language and database choices we have today. Machine language, BASIC, C, Pascal, and Modula basically led the evolution of computers from numeric Confidential, Copywrite 2002 by Damion Dooley Page 26 of 27, 1/25/2009 adding machines to recursive function calculators that could be organized hierarchically. SQL Databases arose from a 1972 paper that defined a language for querying tables and their record's relational field references to other tables, as long as the tables met a fairly specific design criteria that made efficient use of memory. More recently, Object Oriented languages were created to work with a new vision, that hierarchic data structures and programs could be packaged into "objects" that allowed "properties" to trickle down, as well as respond to "methods" that request data transformations or other signals and responses. None of these approaches began with an overarching definition of data as set, I think mainly because of the perceived inefficiency of doing so. Lisp, formulated in the 60's by McArthy, did favour a symbolic processing approach to computing tasks. It viewed data as a collection of lists and functions that work on them, and so was one step away from a set approach. However, it has been overshadowed by the object oriented approach. My main criticism of the object oriented approach is its bias towards top-down hierarchic behavior. Shortcut takes an alternative approach: that a given set may be positioned within one or more hierarchies, but its influence can extend up, down, and outward from its position. There are many clear, excellent uses for strict hierarchies, but we also need the flexibility to enter into the looser realm of networks or "graphs" of data. Expert systems and Prolog (and its variants) focused on casting computing problems as a hierarchy of human-engineered, pattern-matching "if then" statements, with the ability to backtrack when dead-ends occur in a search for a solution. The set language approach needs this constraint satisfaction engine. Confidential, Copywrite 2002 by Damion Dooley Page 27 of 27, 1/25/2009

Related docs
Basic_course_shortcut
Views: 223  |  Downloads: 9
word Shortcut keys
Views: 479  |  Downloads: 6
Apple Shortcut Keys (for most programs)
Views: 133  |  Downloads: 1
Other docs by Christopher Wa...
Sample Business Plan MedBase
Views: 236  |  Downloads: 2
FORM B1 EXHIBIT A
Views: 158  |  Downloads: 0
International Business Transactions
Views: 814  |  Downloads: 36
Gibbons v. Ogden _1824_ - 2
Views: 133  |  Downloads: 1