traffic_light:{Red, Amber, Green}.
would not automatically define the terms Red, Amber, etc. However
traffic_lights::={Red, Amber, Green}.
is short hand for
traffic_lights::Sets,
Red::traffic_lights,
Amber::traffic_lights,
Green::traffic_lights,
|- traffic_lights={Red, Amber, Green}.
Notice that no order is implied between the elements listed above. In programming, an enumeration is an linearly ordered set and in MATHS the notation is
enum(intuitive, sensing)[ math_77_Enumerations.html ]
Subsets
The simplest classification system for a set of objects is created by
using the Subsets. In the MATHS notation the set of all subsets is
indicated by the curly "@" sign. This is reminiscient of the curly P
used by mathematicians:
The above imply the following:
They do not assume that every A is either a B or C however. Some A's may be neither.
<-------------------------A----------------->
<----------B--->
<----C------------->
You need to be careful of the meaning of words indicating subsets in English
and other natural languages. For example in the set of People we often
distinguish Tall and Short people:
Net
Niether can we assume
What we do have is
<--Short--><------------People~Short------------------->
<-------People~Tall-----------------><------Tall------->
This is a common pattern when we have and underlying ordering governed by an attribute -- in the above case height.
There is another trap when you are trying to compare items in different sets... for large chihuahua vs small saint bernard.
BNF -- unions that cover a set
Bachus Naur Form allows one to define one set as the
union of other sets:
This implies the following deductions:
However, it is possible for an item in A to be in both B and C.
<-------------------------A----------------->
<----------B--------->
<-------------C------------->
In jargon: A is covered by B and C. See set_families.
Partitions -- nonoverlapping classification
The statement
says the same thing as
A partition implies
In other words that every A is a either a B or a C, and no A is both a B and C.
<-------------------------A----------------->
<----------B---->
<------------C------------->
In the UML this is a disjoint and complete specialization.
For more on the theory of partitions and their relationship to mappings and equivalence relations see set_families.
. . . . . . . . . ( end of section Sets) <<Contents | End>>
Person::=Net{..... Either male or female. .... }.
. . . . . . . . . ( end of section Nets) <<Contents | End>>
Polymorphism
A consequence of allowing multiple polymorphic symbols in documentation is that all functions in MATHS should be seen as "multimethods" [PuppydogRacoon99]. In the classic problem of "Feeding the Animals" for example, we have two types: Animal and Food. Animals are classified as Wolves and Cows. Foods are classified as Meat and Grass. All Animals eat Food and get energy from it, but Wolves only eat Meat and Cows only eat Grass. A language with multimethods or another form of automaic down casting will invalidate the idea of Cows eating Meat and Wolves eating Grass.
It is now valid to have Cows eat Grass and Wolves eat meat and reason with the consequences but nothing can be deduced about eat(wolf,grass) and eat(cow,meat).
Further because Animal and Food are declared separately as Sets they are implictly not in the same type. This means that eat(grass, wolf) is illegitimate in this Net.
However, if this net was instanciated with two sets (Animal, Food) in the same hierarchy then an expression like eats(grass, cow) is definable and may even provoke thought about the meaning intended for eat. Indeed, eats(wolf, cow) starts to look meaningful and ominous.
Duck Typing
MATHS does allow something like
the kind of polymorphism found in Python where a collection of
Nets of declare the same attributes, then they define same types of
object. This is because in MATHS types are universal sets. Thus
[ notn_14_Docn_Semantics.html ]
the type of a Net is the type of the Net with no axioms, constraints, etc. So,
many objects, though they are in different sets, will be of the same type.
However if two nets have different variables then they will belong in different types.
In particular, if one net ABC say defines a:A, b:B, c:C then its objects are of a different type to the net AB that only defines a:A and b:B. We would say that ABC extends AB. We could even define ABC as AB with {c:C} as an explicit extension.
. . . . . . . . . ( end of section Polymorphism) <<Contents | End>>
See Also
. . . . . . . . . ( end of section Classifications and Ontologies) <<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_25_Proofs ] for more on the structure and rules.
The notation also allows you to create a new network of variables and constraints. A "Net" has a number of variables (including none) and a number of properties (including none) that connect variables. You can give them a name and then reuse them. 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. A quick example: a circle = Net{radius:Positive Real, center:Point}.
For a complete listing of pages in this part of my site by topic see [ home.html ]
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 more rigorous description of the standard notations see