This file summarises some of the more complex logical systems that are used and needed in software engineering. This basially lists the ideas that are taken for granted by the engineer. The principle of not re-inventing the wheel suggests that a practical formal system shouldn't force its users to provide unnecesary formal definitions.
Practice
MATHS includes standard number theory and algebra as givens:
The following are all defined or derived elsewhere (see references above).
MATHS uses the C notation for incrementation and decrementation - but without changing the value of the argument.
Theory
One-to-one maps are intimately related to the concept of number. For example one definition of number starts from
defining two sets as having the same number if they can be put into one-one correspondence:
There are several ways of modelling the numbers in simpler terms. Here are some popular ones for refference purposes.
Principia Mathematica [ Whitehead & Russell]
A second idea is to contruct a model of the natural numbers, possibly like this:
A third alternative is to make an axiomatic model of the natural numbers - for example Peano's system, expressed as follows in MATHS:
The Peano model of numbers is clearly an abstract data type.
Notice that the (Induction) axiom has the effect of restricting the system to those objects generated by the ++ operation starting from 0. This does allow transfinite induction etc.
. . . . . . . . . ( end of section Models of numbers) <<Contents | End>>
Finite Sets
A finite set can not be put into a one-one correspondence with a part of itself. An infinite set can be mapped into a subset of itself.
In a finite set we have the Pigeon_hole Principle - that if you put more letters into a set of boxes (pigeonholes) than there are boxes then there will be boxes with more than one letter in them:
Arrays
In the Vienna Definition Method [VDM] there is a distinction between finite maps and non-finite functions because a computer can store a finite map as an 'array'. In MATHS the word 'array' serves to document finite mappings:
.
Pairs
Normally we take the idea of a pair of objects as given. In MATHS a pair has two components that can be accessed by using subscripts or by to functions (1st and 2nd). Alternately a pair can be defined as the type of objects that are decomposed into two
"orthogonal" parts by "Projection" mappings. In MATHS these maps are symbolised "1st" and "2nd".
The MATHS structured sets in $ Net{1st:A, 2nd:B}have the above properties: So
Sequences
T^Nat is the type of all sequences of Ts. It includes T^n for all n, and so #T.
Typical values can not be written down, however when all but a finite number of elements are undefined then the sequence is a member of #T and can be written down. Working out ways to discuss the infinite in terms of the finite is a matter for topology
(QV).
Lists and n-tuples
A particular type of object are the lists of objects of similar type. The MATHS definition includes most common models:
%{a,b,c} includes (a,b), (b,a), (a,,b,c),(a,a,a,a,b),...
MATHS could define A^n by the existence of n projection maps (1st,2nd,3rd,4.th,5.th...,n.th) with the property that they uniquely identify the object in A^n:
Hence
Note. [i] should be typeset/printed as a subscript rather than in brackets if possible [Naur et al 64].
Strings
The symbol # is reserved for finite lists, n-tpls, and strings generated by
an associative concatenation operation. For S:@T, #S has many of the
properties of S^Nat, but is best treated as a special algebra a free
Monoid.
If T is finite then #T is a made of strings defined in Math.Strings.Theory. The notation for sets of strings (@#T) is defined in Notation'GRAMMAR. The semantics of strings is defined as a free monoid in Mathematics. Here are a few facts.
Sets of Lists
It is convenient to note this result from the theory of languages here.
(str_reg): RegularAlgebra(@#A, |, {},(), {()}, #).
Intervals as Sets and Lists
In the context of numbers (or other linearly ordered set)
Also from the open and closed intervals used with real numbers.
Name Property (of S)
Finite for some n, S(1)-(1)1..n
Regular/FiniteState (FiniteAutomata)S->@, (RLin)Nat->S,
Deterministic (DeterministicPushDownAutomata)S->@
ContextFree (PushDownAutomata)S->@, (CFG)Nat->S
ParaContextFree (n PushDownAutomata)S->@
ContextSensitive/LinearBound (LinearBoundTM)S->@
... Time/Space limited computations
Hard (NPComplete)
Decidable (Turing Machine) S->@
Enumerable/RE (Turing Machine) Nat---S
Countable Nat---S
Sets @SFor more information see any good book on Computabillity, Complexity of Computation, formal language theory etc.
. . . . . . . . . ( end of section Complexity of Sets) <<Contents | End>>
Computer Subsets of Abstract Types
Few computers provide their users with the abstract data types as defined
above. Instead the typical 'Integer' is implemented as a finite
"approximation" to the abstract. This sometimes becomes a dangerous
conceit. In MATHS names are provide for the common subsets of the integers
and real numbers: fixed, float, decimal, money, ... . The transition from a
correct algorithm in the abstract to a program that uses finite data
requires skill and knowledge - Colman, Aberth, Wilkinson, ...
. . . . . . . . . ( end of section Subsets of Abstract Types) <<Contents | End>>
. . . . . . . . . ( end of section Summary of More advanced Systems) <<Contents | End>>
Notes on MATHS Notation
Special characters are defined in
[ intro_characters.html ]
that also outlines the syntax of expressions and a document.
Proofs follow a natural deduction style that start with assumptions ("Let") and continue to a consequence ("Close Let") and then discard the assumptions and deduce a conclusion. Look here [ Block Structure in logic_2_Proofs ] for more on the structure and rules.
The notation also allows you to create a new network of variables
and constraints, and give them a name. The schema, formal system,
or an elementary piece of documentation starts with "Net" and finishes "End of Net".
For more, see
[ notn_13_Docn_Syntax.html ]
for these ways of defining and reusing pieces of logic and algebra
in your documents.
Notes on the Underlying Logic of MATHS
The notation used here is a formal language with syntax
and a semantics described using traditional formal logic
[ logic_0_Intro.html ]
plus sets, functions, relations, and other mathematical extensions.
For a complete listing of pages by topic see [ home.html ]