provrml_io (library)
Author(s): Göran Smedbäck.This file implements I/O predicates of different types.
Implemented by Göran Smedbäck
Usage and interface
- Library usage:
:- use_module(library(provrml_io)). - Exports:
- Imports:
- System library modules:
aggregates, dynamic, iso_misc, iso_byte_char, iso_incomplete, operators, read, write, terms_check, terms_vars, cyclic_terms, lists. - Packages:
prelude, nonpure, assertions, isomodes, dcg, iso, regtypes.
- System library modules:
Documentation on exports
Usage:out(ListOfOutput)
The predicate used is out/3 (DCG) where we will 'save' the output in the second argument. The tird argument is the rest, nil.
- Call and exit should be compatible with:
(basic_props:list/2)ListOfOutput is a list of atms. - The following properties should hold at call time:
(term_typing:nonvar/1)ListOfOutput is currently a term which is not a free variable.
Usage:convert_atoms_to_string(Atoms,String)
The predicate transforms a list of atoms to a string.
- Call and exit should be compatible with:
(basic_props:list/2)Atoms is a list of atms.
(basic_props:list/2)String is a list of nums. - The following properties should hold at call time:
(term_typing:nonvar/1)Atoms is currently a term which is not a free variable.
(term_typing:var/1)String is a free variable.
Usage:read_terms_file(Filename,Term)
Given a filename to a file with terms, the predicate reads the terms and are returned in the second argument. Filename is an atom and Term is the read prolog terms.
- Call and exit should be compatible with:
(basic_props:atm/1)Filename is an atom.
(basic_props:atm/1)Term is an atom. - The following properties should hold at call time:
(term_typing:nonvar/1)Filename is currently a term which is not a free variable.
(term_typing:var/1)Term is a free variable.
Usage:write_terms_file(FileName,List)
Given a filename and a list of terms the predicate will write them down to the file.
- Call and exit should be compatible with:
(basic_props:atm/1)FileName is an atom.
(basic_props:list/2)List is a list of atms. - The following properties should hold at call time:
(term_typing:nonvar/1)FileName is currently a term which is not a free variable.
(term_typing:nonvar/1)List is currently a term which is not a free variable.
Usage:read_vrml_file(FileName,Data)
Given a filename, the predicate returns the substance.
- Call and exit should be compatible with:
(basic_props:atm/1)FileName is an atom.
(basic_props:string/1)Data is a string (a list of character codes). - The following properties should hold at call time:
(term_typing:nonvar/1)FileName is currently a term which is not a free variable.
(term_typing:var/1)Data is a free variable.
Usage:write_vrml_file(FileName,Data)
Given a filename and data in form of a string, the predicate will write the data to the named file.
- Call and exit should be compatible with:
(basic_props:atm/1)FileName is an atom.
(basic_props:string/1)Data is a string (a list of character codes). - The following properties should hold at call time:
(term_typing:nonvar/1)FileName is currently a term which is not a free variable.
(term_typing:nonvar/1)Data is currently a term which is not a free variable.