Tiny module with miscellaneous functions
Author(s): Arsen Kostenko.
This module holds just two predicates at the moment: write_pr/2 and read_pr. In both of them the '_pr' suffix is standing for 'predicate', which in turn means that both of them are intended for transportation of predicates from one environment to another.
Usage and interface
- Library usage:
:- use_module(library(dht_misc)). - Exports:
- Predicates:
write_pr/2, read_pr/2.
- Predicates:
- Imports:
Documentation on exports
Usage:write_pr(Stream,Term)
Write the value of the Term into stream provided by Stream.
- The following properties should hold at call time:
(basic_props:gnd/1)Stream is ground.
(basic_props:term/1)Term is any term.
Usage 1:read_pr(Stream,Term)
Read stream represented by Stream looking for presence of pattern given by Term. If none found, the predicate does not block. Result found may be non-fully ground.
- The following properties should hold at call time:
(basic_props:gnd/1)Stream is ground.
(basic_props:term/1)Term is any term.
Usage 2:read_pr(Stream,Term)
Same as previous, with only modification - result found may be ground as well.
- The following properties should hold at call time:
(basic_props:gnd/1)Stream is ground.
(basic_props:term/1)Term is any term. - The following properties should hold upon exit:
(basic_props:gnd/1)Stream is ground.
(basic_props:gnd/1)Term is ground.
Usage 3:read_pr(Stream,Term)
Scan stream Stream for presence of concrete (exact) predicate given by value of Term. Term is fully bound.
- The following properties should hold at call time:
(basic_props:gnd/1)Stream is ground.
(basic_props:gnd/1)Term is ground. - The following properties should hold upon exit:
(basic_props:gnd/1)Stream is ground.
(basic_props:gnd/1)Term is ground.