english
version "1.0"
identify "%Z%%M% %I% %E%"

#: Copyright (c) 1991-2005 by Wayne C. Gramlich.
#, All rights reserved.

module logical

#: The logical module is a base type that implements the boolean values
#, of logical@true and logical@false and the associated boolean operations.

define logical
    external

object true@logical	#: This constant represents "true".

object false@logical 	#: This constant represents "false".




procedure and@logical
    takes
	logical1 logical
	logical2 logical
    returns logical
    external logical__and

    #: This procedure returns {logical@true} only if both {logical1} and
    #, {logical2} are both {logical@true}; otherwise {logical@false}
    #, is returned.




procedure buffer_append@logical
    takes
	logical logical
	buffer string
    returns_nothing

    #: This procedure will append {logical} to {buffer}.


procedure equal@logical
    takes
	logical1 logical
	logical2 logical
    returns logical
    external logical__equal

    #: This procedure returns {logical@true} if both {logical1} and {logical2}
    #, are {logical@true} or if both are {logical@false}; otherwise,
    #, {logical@false} is returned.




procedure format@logical
    takes
	logical logical
	out_stream out_stream
	format string
	offset unsigned
    returns_nothing

    #: This procedure will output {logical} to {out_stream} using
    #, the formatting characters in {format} starting at {offset}
    #, until a terminating '%' is encountered.  See the {format} module
    #, to find out more about formatted output.


procedure hash@logical
    takes
	logical logical
    returns unsigned
    #: This procedure will return a hash value for {logical}.


procedure not@logical
    takes
	logical logical
    returns logical
    external logical__not

    #: This procedure returns {logical@true} if {logical} is {logical@false}
    #, and {logical@false} otherwise.




procedure or@logical
    takes
	logical1 logical
	logical2 logical
    returns logical
    external logical__or

    #: This procedure returns {logical@false} only if both {logical1} and
    #, {logical2} are both {logical@false}; otherwise {logical@true}
    #, is returned.




procedure print@logical
    takes
	logical logical
	out_stream out_stream
    returns_nothing

    #: This procedure will print {logical} out to {out_stream} in human
    #, readable form.


procedure save@logical
    takes
	logical logical
	save save
	offset unsigned
    returns_nothing

    #: This procedur will save {logical} into {save} at {offset}.


procedure unsigned_convert@logical
    takes
	logical logical
    returns unsigned
    external logical__unsigned_convert

    #: This procedure will return {logical} converted into an {unsigned}.



procedure xor@logical
    takes
	logical1 logical
	logical2 logical
    returns logical
    external logical__xor

    #: This procedure returns {logical@true} if {logical1} is equal to
    #, {logical@true} and {logical2} is equal to {logical@false} or
    #, vice versa.