The Iso Byte Char module
Author(s): The CLIP Group, Daniel Cabeza, Edison Mera (documentation), Manuel Hermenegildo (minor mods).
This module provides some basic predicates according to the ISO specification of byte and char manipulation.
Usage and interface
- Library usage:
:- use_module(library(iso_byte_char)). - Exports:
- Imports:
- Packages:
prelude, nonpure, assertions, isomodes.
- Packages:
Documentation on exports
Succeeds iff the character code of the one char atom Char is Code.
Usage 1:ISO
- Call and exit should be compatible with:
(basic_props:character_code/1)Code is an integer which is a character code. - The following properties should hold at call time:
(basic_props:atm/1)Char is an atom. - The following properties should hold upon exit:
(basic_props:character_code/1)Code is an integer which is a character code.
Usage 2:ISO
- The following properties should hold at call time:
(term_typing:var/1)Char is a free variable.
(basic_props:character_code/1)Code is an integer which is a character code. - The following properties should hold upon exit:
(basic_props:atm/1)Char is an atom.
Succeeds iff Chars is a list whose elements are the one-char atoms whose names are the successive characters of the name of atom Atom
Usage 1:ISO
- Call and exit should be compatible with:
(basic_props:list/2)Chars is a list of atms. - The following properties should hold at call time:
(basic_props:atm/1)Atom is an atom. - The following properties should hold upon exit:
(basic_props:list/2)Chars is a list of atms.
Usage 2:ISO
- The following properties should hold at call time:
(term_typing:var/1)Atom is a free variable.
(basic_props:list/2)Chars is a list of atms. - The following properties should hold upon exit:
(basic_props:atm/1)Atom is an atom.
Success iff Chars is a list whose elements are the one-char atoms corresponding to a character sequence of Number which could be output
Usage 1:ISO
- Call and exit should be compatible with:
(basic_props:list/2)Chars is a list of atms. - The following properties should hold at call time:
(basic_props:num/1)Number is a number. - The following properties should hold upon exit:
(basic_props:list/2)Chars is a list of atms.
Usage 2:ISO
- The following properties should hold at call time:
(term_typing:var/1)Number is a free variable.
(basic_props:list/2)Chars is a list of atms. - The following properties should hold upon exit:
(basic_props:num/1)Number is a number.
Usage 1:
- Call and exit should be compatible with:
(basic_props:list/2)Arg2 is a list of character_codes. - The following properties should hold at call time:
(basic_props:list/2)Arg1 is a list of atms. - The following properties should hold upon exit:
(basic_props:list/2)Arg2 is a list of character_codes.
Usage 2:
- The following properties should hold at call time:
(term_typing:var/1)Arg1 is a free variable.
(basic_props:list/2)Arg2 is a list of character_codes. - The following properties should hold upon exit:
(basic_props:list/2)Arg1 is a list of atms.
Usage:ISO
Same as get_byte/2, but use the current input.
- Call and exit should be compatible with:
(basic_props:int/1)Arg1 is an integer. - The following properties should hold upon exit:
(basic_props:int/1)Arg1 is an integer.
Is true iff Byte unifies with the next byte to be input from the target Stream.
Usage:ISO
- Call and exit should be compatible with:
(basic_props:int/1)Byte is an integer. - The following properties should hold at call time:
(streams_basic:stream/1)Stream is an open stream. - The following properties should hold upon exit:
(streams_basic:stream/1)Stream is an open stream.
(basic_props:int/1)Byte is an integer. - The following properties should hold globally:
(basic_props:not_further_inst/2)Stream is not further instantiated.
Usage:ISO
Same as peek_byte/2, but use the current input.
- Call and exit should be compatible with:
(basic_props:int/1)Arg1 is an integer. - The following properties should hold upon exit:
(basic_props:int/1)Arg1 is an integer.
Usage:ISO
Is true iff Byte unifies with the next byte to be input from the target Stream.
- Call and exit should be compatible with:
(basic_props:int/1)Arg2 is an integer. - The following properties should hold at call time:
(streams_basic:stream/1)Arg1 is an open stream. - The following properties should hold upon exit:
(streams_basic:stream/1)Arg1 is an open stream.
(basic_props:int/1)Arg2 is an integer. - The following properties should hold globally:
(basic_props:not_further_inst/2)Arg1 is not further instantiated.
Usage:ISO
Same as put_byte/2, but use the current input.
- The following properties should hold at call time:
(basic_props:int/1)Arg1 is an integer.
Is true. Procedurally, putbyte/2 is executed as follows:
a) Outputs the byte Byte to the target stream.
b) Changes the stream position of the target stream to take account of the byte which has been output.
c) The goal succeeds.
Usage:ISO
- The following properties should hold at call time:
(streams_basic:stream/1)Stream is an open stream.
(basic_props:int/1)Byte is an integer. - The following properties should hold upon exit:
(streams_basic:stream/1)Stream is an open stream. - The following properties should hold globally:
(basic_props:not_further_inst/2)Stream is not further instantiated.
Usage:ISO
Same as get_char/2, but use the current input.
- Call and exit should be compatible with:
(basic_props:atm/1)Arg1 is an atom. - The following properties should hold upon exit:
(basic_props:atm/1)Arg1 is an atom.
Is true iif Char unifies with the next character to be input from the target Stream.
Usage:ISO
- Call and exit should be compatible with:
(basic_props:atm/1)Char is an atom. - The following properties should hold at call time:
(streams_basic:stream/1)Stream is an open stream. - The following properties should hold upon exit:
(streams_basic:stream/1)Stream is an open stream.
(basic_props:atm/1)Char is an atom. - The following properties should hold globally:
(basic_props:not_further_inst/2)Stream is not further instantiated.
Usage:ISO
Similar to peek_code/1, but using char instead of code.
- Call and exit should be compatible with:
(basic_props:atm/1)Arg1 is an atom. - The following properties should hold upon exit:
(basic_props:atm/1)Arg1 is an atom.
Usage:ISO
Similar to peek_code/2, but using char instead of code.
- Call and exit should be compatible with:
(basic_props:atm/1)Arg2 is an atom. - The following properties should hold at call time:
(streams_basic:stream/1)Arg1 is an open stream. - The following properties should hold upon exit:
(streams_basic:stream/1)Arg1 is an open stream.
(basic_props:atm/1)Arg2 is an atom. - The following properties should hold globally:
(basic_props:not_further_inst/2)Arg1 is not further instantiated.
Usage:ISO
Similar to put_code/1, but using char instead of code.
- The following properties should hold at call time:
(basic_props:atm/1)Arg1 is an atom.
Usage:ISO
Similar to put_code/2, but using char instead of code.
- The following properties should hold at call time:
(streams_basic:stream/1)Arg1 is an open stream.
(basic_props:atm/1)Arg2 is an atom. - The following properties should hold upon exit:
(streams_basic:stream/1)Arg1 is an open stream. - The following properties should hold globally:
(basic_props:not_further_inst/2)Arg1 is not further instantiated.