Next / Previous / Contents / Shipman's homepage

8. Specification functions

sox.py
# - - - - -   S p e c i f i c a t i o n   f u n c t i o n s

As part of the Cleanroom verification infrastructure, here are some specification functions used by various intended functions in the module. All intended function names contain two or more hyphenated words, to distinguish them from names in the actual program.

8.1. content-processor

This specification function defines a generic interface used by Sox.start() and other methods to process arguments that are to be made into Unicode content within an element.

sox.py
# content-processor(item, contentList, attribs) ==
#   [ (contentList is a list) and (attribs is a dict) ->
#       if item is a dict ->
#         if (all keys of item are xml-names) and
#         (all values of item can be converted to Unicode) ->
#           attribs  :=  attribs with the key-value pairs from
#               item added, with both converted to Unicode
#         else -> raise SoxError
#       else if item is Unicode or can be converted to Unicode ->
#         contentList  +:=  item as unicode
#       else -> raise SoxError ]