A better formulation (mathematically speaking) is that fun[e](value(e,f) always defines a homomorphism between expressions and values that preserves all the operations used in the expressions.
if you can fill this hole]
if you can fill this hole]
if you can fill this hole]
[ //csci.csusb.edu/dick/maths/math_76_Concurency.html ]
[ //csci.csusb.edu/dick/maths/math_73_Process_algebra.html ]
Correctness
[click here
if you can fill this hole]
Completeness.
By Murphy's Law, The only proof of completeness of a specification of a
program is to show that the data specified as input is equal to the set of
all possible inputs with no constraints. Therefore the specification
needs to describe all the possible input sequences and the expected responses.
This means that Data Directed Designs can be shown to be complete.
Liveness and Performance
[click here
if you can fill this hole]
An alternative set of laws is developed by [ Maddux96 ] , see RELATION_ALGEBRAS.
Basis
The paper works with the following terms:
S3 below requires ABORT;P=ABORT for all P. If we choose P to be the relation that maps any state in state s then img(ABORT;P)={s} but img(ABORT)=States. So if States has more than two elements ABORT;P can not always be the same as ABORT. Indeed the image of ABORT;P` is nearly always less than P.
Mathematically in any semigroup only one element can be an anihilator or zero. So the S3 implies that ABORT is unique. Now if one includes the null program - which fails or fails to terminate in all states then this is an anihilator, and so the unique zero. If one omits this for the set of programs then no other program can take its place. Thus S3 is not consistent with the statement in LAW1 that programs are total relations with finite or universal images.
Worse D4:(ABORT|P)=ABORT follows from the definition of ABORT=States><States.
The stated requirement for totallity does not fit with the observed behavior of a program like true*skip that can have no successor state.
Further the axioms in LAW1 do not define a complete Boolean Algebra. They do not define (or need) the complement operation. This makes sense because complements of intuitive program statements are highly unintuitive. For example the complete of an assignment 'x:=1' is an "operation" that can change the state of the system in any way, as long as x is not equal to 1 afterwards. In the absence of a Boolean Algebra we do not have any kind of Relation Algebra.
Model as total relations
Given these worries this model will be abandonned. A technical report
from Oxford University develops an alternative theory for the
given LAWS.
(while): (b*P)=P;(b*P)<|b|>Id.
Parnas's solution is define for a program text a set of states in which it is known that the program text terminates. This does not have to be the largest set of states... just those which termination can be shown to occur. A requirement is then a combination of a set of states in which termination occurs and a program.
This is particularly confusing with program texts that apparently mean things like this: (true*P)|Q.
Is this angelic where the set of safe states is those of Q, or demonic where the set of safe states is empty?
Maddux [Maddux96] has demonstrated how programs can be modelled as a pair of relations. The first indicates states in which the program fails to terminate. The second indicates what happens in thoise states that do terminate.
. . . . . . . . . ( end of section A Problem) <<Contents | End>>
(recwile): b*P= μ(X. (P; X)<|b|>Id.
|-For List_of_Variables V, List_of_Expressions E, if |V| = |E| then (V:=E) :: Programs.
|-(as1): For V:List_of_Variables, i:1..|V|, E::(Expresssions^|V|), v:=V(i), e:=E(i), s,s':States, if s(V:=E)s' then v(s)=e(s). |- (as2): For V:List_of_Variables, E::(Expresssions^|V|), v:=Variable~img(V), s,s':States, if s(V:=E)s' then v(s)=v(s).
Two Program are said to be equal if they have the same meaning. Two program texts may differ but still have the same meaning. Two program texts that have the same effect but take different times are taken to be equal programs.
Note. Parnas argues that this approach has both theoretical and practical problems. His interest is in ways to annotate existing and developing code to verify its correctness versus a specification. The specifications are based on predicates. He advocates a way to make sure that annotations and specs are well defined even when subexpressions are not defined [Parnas 93] He proposes that certain predicates are chosen to be primitive - returning false if any of their arguments are false. Other predicates are defined in terms of the primitive ones. Thus all predicates are well defined.
Dijkstra's Linear search theorem is easily expressed using the partial and
unimplementable min function:
Normal Form
The original paper proceeds to show that sequence can always be replaced in
a program. Each non-iterative or recursive piece becomes a conditional
that aborts or permits the selection of an assignment. In other words any
program text without iteration or recursion can be reduced to a simple
form:
Programs are a poset with a bottom element.
P|Q is the best program worse then both P or Q.
??cf Bourbaki filter??
[click here
if you can fill this hole]
Since, for infix op, (_op a) = fun[x]( x op a).
In LAW1 a sequence Q[i:0..] is generated with Q[0]=ABORT and Q[i+1]=(P;Q[i]<|b|>Id). In my model the Kleene sequence is used in its place:
Such sequences defined a directed set {Q[i]. i:0..}. and so
Again if F is an finite construction that makes F(X):Programs out of X there is a Kleene sequence ABORT, F(ABORT), F(F(ABORT)), ... that defines a directed set so that
Hence the fixed point law:
. . . . . . . . . ( end of section Programs as a Domain) <<Contents | End>>
Specifications
Mili Mile and Abowd argue that a relation is a specification ratherthan a
program. In LAW1 a specification is a Program that may not have an
implementation. The worse relationship holds between a specification and
a satisfactory program. They postulate the existence of a →p
Specification that has no satisfactory program. The lub and union
operators on sets of specifications are interpretted as specifications
requiring, respectively all or some of the subspecifications are satisfied.
Weakest Prespecification
As an aid to top-down design for two specifiations S and A, S\\A is defined as the weakest specification B such that if R satisfies B then R;S satisfies W.
PostSpecification and General Inverse
R//S::=weakest specification of program X such that R worse (S;X).
??Kelly-Bootle Kludge Theory?
[click here
if you can fill this hole]
min{i:Nat0. p(i)}::=the(i:Nat0. p(i) and for no j<i(p(j))). The first natural number to satisfy p(i). This is not defined when no p.
pre(R)=set{x. for some y(x R y)}. The pre-condition for R to have a terminal state. See REL. post(R)=set{y. for some x(x R y)}. The postcondition of R. See REL. img(R)=post(R). See REL.
. . . . . . . . . ( end of section Proofs) <<Contents | End>>
. . . . . . . . . ( end of section Laws of Programming) <<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