Stream selection and control

These predicates link an external source/sink with a Prolog stream, its stream-term and stream alias. They enable the source/sink to be opened and closed, and its properties found during execution.

The following predicates do not have examples to automate in this test:

1. open/4 , open/3

open(Source_sink, Mode, Stream, Options) is true.

The predicate open/3 provides a similar functionality to open/4 except that a goal open(Source_sink, Mode, Stream) opens the source/sink Source_sink with an empty list of stream-options.

Templates and modes for the predicate are as follows:

open(@source_sink, @io_mode, -stream, @stream_options)
open(@source_sink, @io_mode, -stream)

1.1 Example tests

Let's start with some simple tests verifying success of failure of single goals.

Goal Theory success(String goal,String theory)
open('/user/roger/data', read, D, [type(binary)]). null true
open('/user/scowen', write, D, [alias(editor)]). null true
open('/user/dave/data', read, DD, []). null true

2. stream_property/2

stream_property(Stream, Property) is true iff the stream associated with the stream-term Stream has stream property Property .

stream_property(Stream, Property) is re-executable.

Templates and modes for the predicate are as follows:

stream_property(?stream, ?stream_property)

2.1 Example tests

Let's start with some simple tests verifying success of failure of single goals.

Goal Theory success(String goal,String theory)
stream_property(S, file_name(F)). null true
stream_property(S, output). null true