[rules = record].
'Rules: record.                  Location: SPADE$CHECKER:RECORD.RUL'.
''.
'A special-invocation family of rules which express knowledge of the'.
'FDL record functions.  (This knowledge is built into the checker\'s'.
'expression simplifier.)  The rules are:'.
''.
'record(1): fld_F(upf_F(_, VALUE) may_be_replaced_by VALUE.'.
'record(2): upf_F(REC, fld_F(REC)) may_be_replaced_by REC.'.
'record(3): upf_F(upf_G(R, VG), VF) may_be_replaced_by'.
'              upf_G(upf_F(R, VF), VG) if [ "F" <> "G" ].'.
'record(4): fld_F(upf_G(R, V)) may_be_replaced_by fld_F(R)'.
'              if [ "F" <> "G" ].'.
'record(5): upf_F(upf_F(R, _), V) may_be_replaced_by upf_F(R, V).'.


[rules = record_equality].
'Rules: record_equality.         Location: SPADE$CHECKER:RECORD.RUL'.
''.
'A special-invocation family of rules which allow one to infer that two'.
'records are equal if all of their fields are equal, i.e. we can infer'.
'that R=S provided we can prove each of fld_field1(R)=fld_field1(S), ...,'.
'fld_fieldN(R)=fld_fieldN(S) in turn.'.
''.
'Rules record_equality(1-10) are for records with 1 to 10 fields'.
'respectively; rule record_equality(11) deals with records of 11 or'.
'more fields in a more general way.'.


[rules = mk__record].
'Rules: mk__record.              Location: SPADE$CHECKER:RECORD.RUL'.
''.
'mk__record(1) is a rule which allows a field in a SPARK record'.
'aggregate expression to be accessed.  Thus, given'.
''.
'        R = mk__record(day := 21, month := jul, year := 1830)'.
''.
'mk__record(1) may be used to replace:'.
''.
'    (1) fld_day(R)   by 21,'.
'    (2) fld_month(R) by jul, and'.
'    (3) fld_year(R)  by 1830.'.
''.
'mk__record(2) allows updating of record aggregate expressions.  Thus,'.
'with this rule we can replace, for instance,'.
''.
'    upf_day(R, 22) by mk__record(day := 22, month := jul, year := 1830)'.
''.
'and so on.'.
''.
'Note that rule mk__record(2) can only update one field at a time; so'.
''.
'    upf_month(upf_year(R, 1688), nov)'.
''.
'would require two applications of mk__record(2) to simplify it down to'.
'a single record aggregate expression (on upf_year, then upf_month).'.
