.Open Tabular Notations . Motivation Consider the following list of applications: data bases, accounting spread-sheets, determinants, matrices, tableax in symbolic logic, Decisions tables, Truth tables, n-squared charts, Parnas's Function Tables, Trace Tables, And/Or Tables,.... Practical people have often found it easier to express complex mathematical expressions by using a two dimensional grid of values or expressions. They can be manipulated as precisely as other formulae but are often quicker to write and easier to read. . Abstract Syntax ABSTRACT_TABLE::=following .Box We assume that a table is made of textual items: Text::@Sets=`Contents of an item` table_identifier::@finite_sets=`some way of distinguishing tables`. Item::=Structure with Text:Text & table:table_identifier & row:row_number & col:col_number. Entry::=Structure with table:table_identifier & row:row_number & col:col_number. Rows::Nat, Cols::Nat. row_number::=1..Rows. col_number::=1..Cols. Where the `table`, `row` and `col` uniquely determine the text of the `Item` Table::@Item(table,row,col)<>->Text. .See http://www/dick/maths/math_13_Data_Bases.html#Functional Dependancies To be precise the above are partial tables - it is possible for there to be no Text associated with a particular entry in the table. A table is complete if every Entry has a Text (even if empty): Complete::@Item(table,row,col)->Text. .Close.Box . Example Boolean Table ABSTRACT_TABLE with Text={"T","F","-"} & Complete=true. .Open Concrete Syntax In Poor Richard's Text Format(PRTF) (also known as MATHS) a table is recorded like this .As_is .Table heading .As_is .Row item item item .As_is .Item item item .As_is ... .As_is .Close.Table The items in each column areseparated by either a tab in a line or the keyword `.Item` at the start of a line. Rows start with the keyword `.Row`. table::syntax= EOLN ".Table" head_row #row ".Close.Table", row::= EOLN ".Row" untagged_row, head_row::= O(untagged_row). untagged_row::=untagged_item #item. item::=EOLN ".Item" untagged_item. untagged_item::=element #(tab element). . Example PRTF .As_is .Table xy .As_is .Row max'=y max'=x max'=x .As_is .Row min'=x .As_is .Item min'=y .As_is .Item min'=y .As_is .Close.Table .See Extended Dynamic And/Or tables below .Close Concrete Syntax .Open Applications The following are in a rough order of occurence. . Spread Sheets As invented by accountants, long before the appearance of computers. . Matrices . Truth Tables Truth tables are very well known to logicians, electronic engineers and computer scientists. They systematically list all possible values of variables, subexpressions, and expressions. The smallest form is to write the values of subexpression in a column underneath the operator of that subexpression. They are a way to verify tautologies with small numbers of propositional variables. Here is a compressed form where vaule are put under both variables and operators: .Table ( P and Q ) <= P .Row ( 1 1 1 ) 1 1 .Row ( 0 0 1 ) 1 0 .Row ( 1 0 0 ) 1 1 .Row ( 0 0 0 ) 1 0 .Close.Table . Karnaugh Maps A Karnaugh map is a two dimensional truth table. Here is the above formula in a Karnugh map: .Table - P not P .Row Q 1 1 .Row not Q 1 1 .Close.Table Karnaugh maps for more than 2 variables are possible but hard to do in simple HTML. Any pointers to pages? In theory, the values in a Karnaugh map can be symbols or expressions. The result are the same as .See Function Tables below. .Hole . Decision Tables A decision table is actually made up of two different tables that share common collumns. In the top table the conditions are tabulated. In the lower table are the actions. There are two forms. The simplest one lists conditions and actions in the first column and truth values (T,F,-) in the top columns, and letters in the lower half: .Table Conditions 1 2 .Row x"Jane Roe", Number=>"123-456-7890") A table with headers and many rows is an instance of a data base: .Table Name Number .Row Jane Roe 123-456-7890 .Row John Doe 123-456-7809 .Close.Table In MATHS this is a standard way to express a set of tuples. { (Name=>"Jane Roe", Number=>"123-456-7890"), (Name=>"John Doe", Number=>"123-456-7809")} Queries can be expressed by tables with blank entries. . And/Or Tables These come from the application of logic and state machine theory to the specification of part of a traffic control system: TCAS II .See [LevesonEtal95] The notation was welcomed by the clients and will become part of the specifications. ex1::=following, .Table Condition 1 2 .Row height<200 F T .Row height<100 - T .Row dropping T - .Close.Table The above table states the following condition: (ex): (height<200 and dropping) or (height<200 and height<100) The first column contain predicates and the remaining columns contain "T", "F", "-"(don't care). "T" means the predicate is true and "F" means it is false. Each column means the conjunction(and) of the rows. The table is the disjunction(or) of the meanings of the columns. And/Or are used to define, describe, and analyse complex conditions. They are said to be palatable to normal people: .See [HeimdahlLeveson96] and .See [LevesonEtal99] for evidence. All the standard propositions can be expressed using And/Or tables. Further there are simple (if O(2^n)) algorithms that combine them to derive conclusions, prove results, or find counter examples. .Box P or Q .Table Condition 1 2 .Row P T - .Row Q - T .Close.Table P and Q .Table Condition 1 .Row P T .Row Q T .Close.Table if P then Q .Table Condition 1 2 .Row P F - .Row Q - T .Close.Table not P .Table Condition 1 .Row P F .Close.Table not(P and Q) .Table Condition 1 2 .Row P F - .Row Q - F .Close.Table not(P or Q) .Table Condition 1 .Row P F .Row Q F .Close.Table not(if P then Q) .Table Condition 1 .Row P T .Row Q F .Close.Table .Close.Box . Extended And/Or Tables It seems possible to extend And/Or tables so that the entries stand for values other than "True", "False" and "don't care". An interesting avenue of research is to interpret these entries as sets of possible values of expressions. The following re-expresses \$ex1 using symbolic sets as well as conditions. Here the don't care condition "-" indicates the set {T,F}. ex2::=following, .Table Condition 1 2 .Row height 0..100 100.. .Row dropping T - .Close.Table Using .See X/Y Tables below we can express Fuzzy Logic .See FUZZY as well as standard propositional logic. . Function Tables .Set David Lorge Parnas Tabular Representation of Relations \$CRL Report 260 Telecommunications Research Institute of Ontario(TRIO) McMaster University Hamilton Ontario Canada 1992 .Close.Set An example would be good, but my notation and HTML do not easily express all the nuances of these tables: .Hole . Dynamic And/Or tables An And/Or table with dynamic predicates for entries but similar semantics. For example: (x=y and max'=x and min'=y)or(x>y and max'=x and min'=y) would be tabulated as follows: .Table .Row xy F F T .Row max'=y T T F .Row max'=x F T T .Row min'=x T T F .Row min'=y F T T .Close.Table The prime (') above indicates the next value of the variable. . Extended Dynamic And/Or tables An Extended And/Or table with dynamic predicates for entries with similar semantics. For example: (x=y and max'=x and min'=y)or(x>y and max'=x and min'=y) could be tabulated as follows: .Table (x,y) in < = > .Row max'= y x x .Row min'= x y y .Close.Table If we permit expressions as entries we end up with trace tables: .Table xy .Row max'=y max'=x max'=x .Row min'=x min'=y min'=y .Close.Table . Trace Tables .Source Zelkowitz .Find Trace.*table . TEMPO Tables A TEMPO table shows different alternate behaviors of a complex process. Each colmun forms a separate path through the process as a sequence of steps from top to bottom. A TEMPO table uses two of the rules that determine the layout of a temporal map or TEMPO chart. For example the relation expression: (x<=y and min:=x and max:=y) or (x=y and min:=y and max:=min) or ( x>y and max:=x and min=y) is tabulated like this: .Table xy .Row min:=x min:=y max:=x .Row max:=y max:=min min:=y .Close.Table . X/Y Tables An X/Y table is the general form of an And/Or table or TEMPO Table( Union/Product table). Given any algebra with two infix operators `X` and `Y` (some example algebras can be found at .See http://www/dick/samples/math_41_Two_Operators.html and .See http://www/dick/samples/math_45_Three_Operators.html ) then an X/Y table is a way to write expressions where X is applied first to create terms and then the terms are combined with the Y operator. For example |- a*x^2 + b*x + c*1 = following, .Table (*)/(+) .Row a b c .Row x^2 x 1 .Close.Table XYTABLE::=following, .Net Given a set of values V::Set, equiped with two \$serial operators X::\$serial(V), Y::\$serial(V), the meaning of an X/Y table with r:rows, and c:cols, and items item(r,c) is meaning(X/Y, item) ::= Y[c:col_number]X[r:col_number](item(r,c)). Note. A serial operator (like and, or, +, *, &, |, etc) can be used as a function of a vector as well as an infix operator: +(1,2,3,4) = 1+2+3+4 for example. For more see serial::=http://www.csci.csusb.edu/dick/maths/notn_12_Expressions.html#Serial Operators. .Close.Net XYTable For example here is a Composition/Union table showing the WWW standard for encoding data: URL_encoding::=following, .Table (;)/(|) .Row letter .Item digit .Item space .Item char~(letter|digit|space) .Row Id .Item Id .Item plus .Item "%" hex .Close.Table However a popular browser implements the following IE4_encoding::=following, .Table (;)/(|) .Row letter .Item digit .Item space .Item plus .Item char~(letter|digit|space|plus) .Row Id .Item Id .Item plus .Item Id .Item "%" hex .Close.Table For more on URL_encoding see .See http://www.csci.csusb.edu/dick/samples/comp.html.syntax.html#URL Encoding \$X and \$Y (above) could be the intersection and union operators of standard set theory .See Extended And/Or Tables or of Fuzzy Set Theory: FUZZY::=http://www.csci.csusb.edu/dick/maths/math_83_Fuzzy_Sets.html. .Close Applications .Close Tabular Notations