[rules = array].
'Rules: array.                   Location: SPADE$CHECKER:ARRAY.RUL'.
''.
'Substitution rules for the FDL array-manipulation functions'.
'element(_,_) and update(_,_,_), thus:'.
''.
'  (1)  element(update(A, I, X), I)     -->  X.'.
'  (2)  update(A, I, element(A, I))     -->  A.'.
'  (3)  element(update(A, I, X), J  )  <-->  element(A, J)  if I<>J.'.
'  (4)  update(update(A, I, X), J, Y)  <-->  update(A, J, Y), I, X)'.
'            provided I<>J.'.
'  (5)  update(update(A, I, X), I, Y)   -->  update(A, I, Y).'.
''.
'The simplification rules in this family can be performed automatically'.
'by the expression simplifier.'.


[rules = mk__array].
'Rules: mk__array.               Location: SPADE$CHECKER:ARRAY.RUL'.
''.
'A single rule for accessing elements from a SPARK array aggregate.'.
'We illustrate its use with the following; let ARR be the expression:'.
''.
'        mk__array(17, [x+1] := 5, [1..x] := 11, [y] := 4).'.
''.
'With the above expression for ARR, we find that we can replace:'.
''.
'    (1) element(ARR, [y])   by 4.'.
'    (2) element(ARR, [x-1]) by 11, provided x-1<>y and 1<=x-1.'.
'    (3) element(ARR, [x+1]  by 5,  provided x+1<>y.'.
'    (4) element(ARR, [x+2]  by 17, provided x+2<>y.'.
'    (5) element(ARR, [0]    by 17, provided y<>0 and x+1<>0.'.
''.
'If any of the side-conditions cannot be met by the Checker\'s'.
'inference engine, the rule-application may return no simpler result.'.
