Site Menu Project Specification Implementation Recommendations Reference Needs Updating Work in Progress Wastebasket Wiki Manual |
BS 64Spec.BS64 HistoryHide minor edits - Show changes to markup 2010-05-24 14:56
by -
Changed lines 1-4 from:
to:
Changed lines 8-9 from:
(* BS 16 type *) to:
(* BS 64 type *) Changed lines 11-15 from:
to:
Changed line 18 from:
PROCEDURE [:=] assign ( VAR assignTo : BS 16; to:
PROCEDURE [:=] assign ( VAR assignTo : BS 64; Changed line 20 from:
(* Assigns a variadic list of values of type CARDINAL to BS 16 assignTo. to:
(* Assigns a variadic list of values of type CARDINAL to BS 64 assignTo. Changed lines 26-27 from:
PROCEDURE [.] isElement ( CONST set : BS 16; element : CARDINAL ) : BOOLEAN; (* Returns TRUE if element is an element of BS 16 set, otherwise FALSE. to:
PROCEDURE [.] isElement ( CONST set : BS 64; element : CARDINAL ) : BOOLEAN; (* Returns TRUE if element is an element of BS 64 set, otherwise FALSE. Changed lines 29-31 from:
for rvalues of type BS 16. *)
to:
for rvalues of type BS 64. *)
Changed line 34 from:
PROCEDURE [!] storeValue ( CONST set : BS 16; to:
PROCEDURE [!] storeValue ( CONST set : BS 64; Changed line 37 from:
(* Includes character element in BS 16 set if value is TRUE, otherwise to:
(* Includes character element in BS 64 set if value is TRUE, otherwise Changed lines 39-41 from:
for lvalues of type BS 16. *)
to:
for lvalues of type BS 64. *)
Changed lines 44-48 from:
PROCEDURE [COUNT] elementCount ( CONST set : BS 16 ) : CARDINAL; (* Returns the number of elements in BS 16 set. This function is bound to pervasive function COUNT for type BS 16. *)
to:
PROCEDURE [COUNT] elementCount ( CONST set : BS 64 ) : CARDINAL; (* Returns the number of elements in BS 64 set. This function is bound to pervasive function COUNT for type BS 64. *)
Changed lines 51-67 from:
PROCEDURE [+] union ( CONST set1, set2 : BS 16 ) : BS 16; (* Returns the union of BS 16 values set1 and set2. This function is bound to the + operator for type BS 16. *)
PROCEDURE [-] diff ( CONST set1, set2 : BS 16 ) : BS 16; (* Returns the set difference of BS 16 values set1 and set2. This function is bound to the - operator for type BS 16. *)
PROCEDURE [*] intersection ( set1, set2 : BS 16 ) : BS 16; (* Returns the intersection of BS 16 values set1 and set2. This function it bound to the * operator for type BS 16. *)
PROCEDURE [/] symdiff ( set1, set2 : BS 16 ) : BS 16; (* Returns the symmetric set difference of BS 16 values set1 and set2. This function is bound to the / operator for type BS 16. *)
to:
PROCEDURE [+] union ( CONST set1, set2 : BS 64 ) : BS 64; (* Returns the union of BS 64 values set1 and set2. This function is bound to the + operator for type BS 64. *)
PROCEDURE [-] diff ( CONST set1, set2 : BS 64 ) : BS 64; (* Returns the set difference of BS 64 values set1 and set2. This function is bound to the - operator for type BS 64. *)
PROCEDURE [*] intersection ( set1, set2 : BS 64 ) : BS 64; (* Returns the intersection of BS 64 values set1 and set2. This function it bound to the * operator for type BS 64. *)
PROCEDURE [/] symdiff ( set1, set2 : BS 64 ) : BS 64; (* Returns the symmetric set difference of BS 64 values set1 and set2. This function is bound to the / operator for type BS 64. *)
Changed lines 70-82 from:
PROCEDURE [=] isEqual ( set1, set2 : BS 16 ) : BOOLEAN; (* Returns TRUE if BS 16 values set1 and set2 are equal, otherwise FALSE. This function is bound to operators = and # for type BS 16. *)
PROCEDURE [<] isSubset ( set1, set2 : BS 16 ) : BOOLEAN; (* Returns TRUE if BS 16 set1 is a true subset of set2, otherwise FALSE. This function is bound to operators < and >= for type BS 16. *)
PROCEDURE [>] isSuperset ( set1, set2 : BS 16 ) : BOOLEAN; (* Returns TRUE if BS 16 set1 is a true superset of set2, otherwise FALSE. This function is bound to operators > and <= for type BS 16. *)
to:
PROCEDURE [=] isEqual ( set1, set2 : BS 64 ) : BOOLEAN; (* Returns TRUE if BS 64 values set1 and set2 are equal, otherwise FALSE. This function is bound to operators = and # for type BS 64. *)
PROCEDURE [<] isSubset ( set1, set2 : BS 64 ) : BOOLEAN; (* Returns TRUE if BS 64 set1 is a true subset of set2, otherwise FALSE. This function is bound to operators < and >= for type BS 64. *)
PROCEDURE [>] isSuperset ( set1, set2 : BS 64 ) : BOOLEAN; (* Returns TRUE if BS 64 set1 is a true superset of set2, otherwise FALSE. This function is bound to operators > and <= for type BS 64. *)
Changed line 85 from:
(* The EBNF for the textual representation of BS 16 values is: to:
(* The EBNF for the textual representation of BS 64 values is: Changed lines 93-96 from:
The number of bits shown is equal to the bitwidth of the BS 16 type. *)
PROCEDURE Read ( infile : File; VAR set : BS 16 ); (* Reads the textual representation of a BS 16 value from stream infile to:
The number of bits shown is equal to the bitwidth of the BS 64 type. *)
PROCEDURE Read ( infile : File; VAR set : BS 64 ); (* Reads the textual representation of a BS 64 value from stream infile Changed lines 103-105 from:
procedure is substituted for invocations of READ with a BS 16 argument. *)
PROCEDURE Write ( outfile : File; CONST set : BS 16 ); to:
procedure is substituted for invocations of READ with a BS 64 argument. *)
PROCEDURE Write ( outfile : File; CONST set : BS 64 ); Changed lines 107-108 from:
procedure is substituted for invocations of WRITE with a BS 16 argument.*)
to:
procedure is substituted for invocations of WRITE with a BS 64 argument.*)
Changed lines 111-112 from:
items : VARIADIC OF CONST BS 16 );
(* Writes a formatted textual representation of one or more BS 16 values to to:
items : VARIADIC OF CONST BS 64 );
(* Writes a formatted textual representation of one or more BS 64 values to Changed lines 115-117 from:
to:
2010-05-24 13:00
by -
Added lines 1-117:
DEFINITION MODULE BS16 [SetType]; (* 16-bit Bitset *) FROM FileIO IMPORT File; (* required for IO *) (* BS16 type *) TYPE BS16 = OPAQUE RECORD ARRAY 2 OF OCTET; (* 16 bits *) END; (* BS16 *) (* Literal assignment *) PROCEDURE [:=] assign ( VAR assignTo : BS16; elements : VARIADIC OF CARDINAL ); (* Assigns a variadic list of values of type CARDINAL to BS16 assignTo. This procedure is bound to the := operator for literal assignment. *) (* accessor *) PROCEDURE [.] isElement ( CONST set : BS16; element : CARDINAL ) : BOOLEAN; (* Returns TRUE if element is an element of BS16 set, otherwise FALSE. This function is bound to the array operator [ ] and the IN operator for rvalues of type BS16. *) (* mutator *) PROCEDURE [!] storeValue ( CONST set : BS16; element : CARDINAL; value : BOOLEAN ); (* Includes character element in BS16 set if value is TRUE, otherwise removes it from set. This procedure is bound to the array operator [ ] for lvalues of type BS16. *) (* counter *) PROCEDURE [COUNT] elementCount ( CONST set : BS16 ) : CARDINAL; (* Returns the number of elements in BS16 set. This function is bound to pervasive function COUNT for type BS16. *) (* Dyadic set operations *) PROCEDURE [+] union ( CONST set1, set2 : BS16 ) : BS16; (* Returns the union of BS16 values set1 and set2. This function is bound to the + operator for type BS16. *) PROCEDURE [-] diff ( CONST set1, set2 : BS16 ) : BS16; (* Returns the set difference of BS16 values set1 and set2. This function is bound to the - operator for type BS16. *) PROCEDURE [*] intersection ( set1, set2 : BS16 ) : BS16; (* Returns the intersection of BS16 values set1 and set2. This function it bound to the * operator for type BS16. *) PROCEDURE [/] symdiff ( set1, set2 : BS16 ) : BS16; (* Returns the symmetric set difference of BS16 values set1 and set2. This function is bound to the / operator for type BS16. *) (* Relational operations *) PROCEDURE [=] isEqual ( set1, set2 : BS16 ) : BOOLEAN; (* Returns TRUE if BS16 values set1 and set2 are equal, otherwise FALSE. This function is bound to operators = and # for type BS16. *) PROCEDURE [<] isSubset ( set1, set2 : BS16 ) : BOOLEAN; (* Returns TRUE if BS16 set1 is a true subset of set2, otherwise FALSE. This function is bound to operators < and >= for type BS16. *) PROCEDURE [>] isSuperset ( set1, set2 : BS16 ) : BOOLEAN; (* Returns TRUE if BS16 set1 is a true superset of set2, otherwise FALSE. This function is bound to operators > and <= for type BS16. *) (* IO operations *) (* The EBNF for the textual representation of BS16 values is: bitsetValue : simpleFormat | compactFormat | bitGroupFormat ; simpleFormat : bit+ ; compactFormat : base16Digit+ ; bitGroupFormat : "{" bit+ ( groupSeparator? bit+ )* "}" ; groupSeparator : " " | "." ; bit : "0" | "1" ; base16Digit : "0" .. "9" | "A" .. "F" ; The number of bits shown is equal to the bitwidth of the BS16 type. *) PROCEDURE Read ( infile : File; VAR set : BS16 ); (* Reads the textual representation of a BS16 value from stream infile - any leading whitespace is skipped - any remaining characters that are part of the value being read are removed from infile - the textual representation of the value read is assigned to set - the file status is set to any of: success, outOfRange, wrongFormat, endOfLine, or endOfInput. This procedure is substituted for invocations of READ with a BS16 argument. *) PROCEDURE Write ( outfile : File; CONST set : BS16 ); (* Writes the value of CHARSET set in simple format to stream outfile. This procedure is substituted for invocations of WRITE with a BS16 argument.*) PROCEDURE WriteF ( outfile : File; CONST fmtStr : ARRAY OF CHAR; items : VARIADIC OF CONST BS16 ); (* Writes a formatted textual representation of one or more BS16 values to output stream outfile. The output format is determined by fmtStr. This procedure is substituted for invocations of WRITEF with one or more BS16 arguments. *) END BS16. |