[rules = seqlen].
'Rules: seqlen.                  Location: SPADE$CHECKER:SEQ.RUL'.
''.
'A family of rules for the length of a sequence (refer also to section'.
'1.2.6 of the Checker manual).'.

[rules = append].
'Rules: append.                  Location: SPADE$CHECKER:SEQ.RUL'.
''.
'These rules give properties of the FDL "@" (append) operator, thus:'.
''.
'  (1-2):  appending the empty sequence to either side of a list leaves'.
'          the list unchanged.'.
'    (3):  if A and B are actual lists [a1,...,an], [b1,...,bm], then'.
'          A @ B is the list [a1,...,an,b1,...,bm].'.
'  (4-5):  a non-empty list S is equal to [first(S)] @ nonfirst(S), and'.
'          to nonlast(S) @ [last(S)].'.
'    (6):  @ is associative, i.e. (X @ Y) @ Z = X @ (Y @ Z).'.


[rules = first].
'Rules: first.                   Location: SPADE$CHECKER:SEQ.RUL'.
''.
'These rules express properties of the FDL sequence function first(_):'.
''.
'    (1):  first([H,...])      is  H.'.
'    (2):  first([H,...] @ L)  is  H.'.
'    (3):  first(X @ Y)        is  first(X)  provided X <> [].'.
''.
'(N.B. to show first([] @ X) is first(X), use append(1-2) to rewrite'.
'[] @ X to X.)'.


[rules = last].
'Rules: last.                    Location: SPADE$CHECKER:SEQ.RUL'.
''.
'These rules express properties of the FDL sequence function last(_):'.
''.
'    (1):  last([H])          is  H.'.
'    (2):  last(X @ [H,...])  is  last([H,...]).'.
'    (3):  last([H|T])        is  last(T)  provided T <> [].'.
'    (4):  last(X @ Y)        is  last(Y)  provided Y <> [].'.


[rules = nonfirst].
'Rules: nonfirst.                Location: SPADE$CHECKER:SEQ.RUL'.
''.
'These rules express properties of the FDL sequence function nonfirst(_):'.
''.
'    (1):  nonfirst([H|T])      is  T.'.
'    (2):  nonfirst(T)          is  []  provided length(T)=1.'.
'    (3):  nonfirst(X @ Y)      is  nonfirst(X) @ Y  provided X <> [].'.
'    (4):  nonfirst([H|T] @ Y)  is  T @ Y.'.


[rules = nonlast].
'Rules: nonlast.                 Location: SPADE$CHECKER:SEQ.RUL'.
''.
'These rules express properties of the FDL sequence function nonlast(_):'.
''.
'    (1):  nonlast([H])      is  [].'.
'    (2):  nonlast(T)        is  []              provided length(T)=1.'.
'    (3):  nonlast([H|T])    is  [H|T1]          provided nonlast(T)=T1.'.
'    (4):  nonlast(X @ Y)    is  X @ nonlast(Y)  provided Y <> [].'.
'    (5):  nonlast(X @ [H])  is  X.'.


[rules = seq].
'Rules: seq.                     Location: SPADE$CHECKER:SEQ.RUL'.
''.
'These rules express simple sequence equality properties: that two'.
'sequences are equal if and only if they are either both empty or'.
'they are both non-empty and have the same first and nonfirst (or'.
'last and nonlast) components.'.
