This module defines several predicates from the Quintus Prolog
libraries. Note that our library structure is totally different. If this
library were complete, Prolog code could be ported by removing the
use_module/1 declarations, relying on the SWI-Prolog autoloader.
Bluffers guide to porting:
- Remove
use_module(library(...))
- Run
?- list_undefined.
- Fix problems
Of course, this library is incomplete ...
- unix(+Action)
- This predicate provides a partial emulation of the corresponding
Quintus predicate. It provides access to some operating system
features and unlike the name suggests, is not operating system
specific. Defined actions are below.
- system(+Command)
- Equivalent to
shell(Command)
- shell(+Command)
- Equivalent to
shell(Command)
- access(File,0)
- Equivalent to
access_file(File, read)
- cd(Dir)
- Equivalent to
working_directory(_, Dir)
- args(List)
- Equivalent to
current_prolog_flag(os_argv, List)
.
- argv(List)
- Equivalent to
args(List)
, but arguments that are syntactically
valid numbers are passed as a number.
- otherwise
- For (A -> B ; otherwise -> C)
- abs(+Number, -Absolute)
- Unify `Absolute' with the absolute value of `Number'.
- sin(+Angle, -Sine) is det
- cos(+Angle, -Cosine) is det
- tan(+Angle, -Tangent) is det
- log(+X, -NatLog) is det
- log10(+X, -Log) is det
- pow(+X, +Y, -Pow) is det
- ceiling(+X, -Value) is det
- floor(+X, -Value) is det
- round(+X, -Value) is det
- sqrt(+X, -Value) is det
- acos(+X, -Value) is det
- asin(+X, -Value) is det
- atan(+X, -Value) is det
- atan2(+Y, +X, -Value) is det
- sign(+X, -Value) is det
- Math library predicates. SWI-Prolog (and ISO) support these as
functions under is/2, etc.
- deprecated
- - Do not use these predicates except for compatibility
reasons.
- Compatibility
- - Quintus Prolog.
- genarg(?Index, +Term, ?Arg) is nondet
- Generalised version of ISO arg/3. SWI-Prolog's arg/3 is already
genarg/3.
- prolog_flag(?Flag, ?Value) is nondet
- Same as ISO current_prolog_flag/2. Maps
version
.
- bug
- - Should map relevant Quintus flag identifiers.
- date(-Date) is det
- Get current date as
date(Y,M,D)
- no_style_check(Style) is det
- Same as SWI-Prolog
style_check(-Style)
. The Quintus option
single_var
is mapped to singleton
.
- See also
- - style_check/1.
- mode +ModeDecl is det
- Ignore a DEC10/Quintus
:- mode(Head)
declaration. Typically
these declarations are written in operator form. The operator
declaration is not part of the Quintus emulation library. The
following declaration is compatible with Quintus:
:- op(1150, fx, [(mode)]).
- simple(@Term) is semidet
- Term is atomic or a variable.
- current_stream(?Object, ?Mode, ?Stream)
- SICStus/Quintus and backward compatible predicate. New code should
be using the ISO compatible stream_property/2.
- stream_position(+Stream, -Old, +New)
- True when Old is the current position in Stream and the stream
has been repositioned to New.
- deprecated
- - New code should use the ISO predicates
stream_property/2 and set_stream_position/2.
- skip_line is det
- skip_line(Stream) is det
- Skip the rest of the current line (on Stream). Same as
skip(0'\n)
.
- compile(+Files) is det
- Compile files. SWI-Prolog doesn't distinguish between
compilation and consult.
- See also
- - load_files/2.
- atom_char(+Char, -Code) is det
- atom_char(-Char, +Code) is det
- Same as ISO char_code/2.
- midstring(?ABC, ?B, ?AC) is nondet
- midstring(?ABC, ?B, ?AC, LenA) is nondet
- midstring(?ABC, ?B, ?AC, LenA, LenB) is nondet
- midstring(?ABC, ?B, ?AC, LenA, LenB, LenC) is nondet
- Too difficult to explain. See the Quintus docs. As far as I
understand them the code below emulates this function just fine.
- raise_exception(+Term)
- Quintus compatible exception handling
- on_exception(+Template, :Goal, :Recover)
Re-exported predicates
The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
- sin(+Angle, -Sine) is det
- cos(+Angle, -Cosine) is det
- tan(+Angle, -Tangent) is det
- log(+X, -NatLog) is det
- log10(+X, -Log) is det
- pow(+X, +Y, -Pow) is det
- ceiling(+X, -Value) is det
- floor(+X, -Value) is det
- round(+X, -Value) is det
- sqrt(+X, -Value) is det
- acos(+X, -Value) is det
- asin(+X, -Value) is det
- atan(+X, -Value) is det
- atan2(+Y, +X, -Value) is det
- sign(+X, -Value) is det
- Math library predicates. SWI-Prolog (and ISO) support these as
functions under is/2, etc.
- deprecated
- - Do not use these predicates except for compatibility
reasons.
- Compatibility
- - Quintus Prolog.
- sin(+Angle, -Sine) is det
- cos(+Angle, -Cosine) is det
- tan(+Angle, -Tangent) is det
- log(+X, -NatLog) is det
- log10(+X, -Log) is det
- pow(+X, +Y, -Pow) is det
- ceiling(+X, -Value) is det
- floor(+X, -Value) is det
- round(+X, -Value) is det
- sqrt(+X, -Value) is det
- acos(+X, -Value) is det
- asin(+X, -Value) is det
- atan(+X, -Value) is det
- atan2(+Y, +X, -Value) is det
- sign(+X, -Value) is det
- Math library predicates. SWI-Prolog (and ISO) support these as
functions under is/2, etc.
- deprecated
- - Do not use these predicates except for compatibility
reasons.
- Compatibility
- - Quintus Prolog.
- sin(+Angle, -Sine) is det
- cos(+Angle, -Cosine) is det
- tan(+Angle, -Tangent) is det
- log(+X, -NatLog) is det
- log10(+X, -Log) is det
- pow(+X, +Y, -Pow) is det
- ceiling(+X, -Value) is det
- floor(+X, -Value) is det
- round(+X, -Value) is det
- sqrt(+X, -Value) is det
- acos(+X, -Value) is det
- asin(+X, -Value) is det
- atan(+X, -Value) is det
- atan2(+Y, +X, -Value) is det
- sign(+X, -Value) is det
- Math library predicates. SWI-Prolog (and ISO) support these as
functions under is/2, etc.
- deprecated
- - Do not use these predicates except for compatibility
reasons.
- Compatibility
- - Quintus Prolog.
- sin(+Angle, -Sine) is det
- cos(+Angle, -Cosine) is det
- tan(+Angle, -Tangent) is det
- log(+X, -NatLog) is det
- log10(+X, -Log) is det
- pow(+X, +Y, -Pow) is det
- ceiling(+X, -Value) is det
- floor(+X, -Value) is det
- round(+X, -Value) is det
- sqrt(+X, -Value) is det
- acos(+X, -Value) is det
- asin(+X, -Value) is det
- atan(+X, -Value) is det
- atan2(+Y, +X, -Value) is det
- sign(+X, -Value) is det
- Math library predicates. SWI-Prolog (and ISO) support these as
functions under is/2, etc.
- deprecated
- - Do not use these predicates except for compatibility
reasons.
- Compatibility
- - Quintus Prolog.
- sin(+Angle, -Sine) is det
- cos(+Angle, -Cosine) is det
- tan(+Angle, -Tangent) is det
- log(+X, -NatLog) is det
- log10(+X, -Log) is det
- pow(+X, +Y, -Pow) is det
- ceiling(+X, -Value) is det
- floor(+X, -Value) is det
- round(+X, -Value) is det
- sqrt(+X, -Value) is det
- acos(+X, -Value) is det
- asin(+X, -Value) is det
- atan(+X, -Value) is det
- atan2(+Y, +X, -Value) is det
- sign(+X, -Value) is det
- Math library predicates. SWI-Prolog (and ISO) support these as
functions under is/2, etc.
- deprecated
- - Do not use these predicates except for compatibility
reasons.
- Compatibility
- - Quintus Prolog.
- sin(+Angle, -Sine) is det
- cos(+Angle, -Cosine) is det
- tan(+Angle, -Tangent) is det
- log(+X, -NatLog) is det
- log10(+X, -Log) is det
- pow(+X, +Y, -Pow) is det
- ceiling(+X, -Value) is det
- floor(+X, -Value) is det
- round(+X, -Value) is det
- sqrt(+X, -Value) is det
- acos(+X, -Value) is det
- asin(+X, -Value) is det
- atan(+X, -Value) is det
- atan2(+Y, +X, -Value) is det
- sign(+X, -Value) is det
- Math library predicates. SWI-Prolog (and ISO) support these as
functions under is/2, etc.
- deprecated
- - Do not use these predicates except for compatibility
reasons.
- Compatibility
- - Quintus Prolog.
- sin(+Angle, -Sine) is det
- cos(+Angle, -Cosine) is det
- tan(+Angle, -Tangent) is det
- log(+X, -NatLog) is det
- log10(+X, -Log) is det
- pow(+X, +Y, -Pow) is det
- ceiling(+X, -Value) is det
- floor(+X, -Value) is det
- round(+X, -Value) is det
- sqrt(+X, -Value) is det
- acos(+X, -Value) is det
- asin(+X, -Value) is det
- atan(+X, -Value) is det
- atan2(+Y, +X, -Value) is det
- sign(+X, -Value) is det
- Math library predicates. SWI-Prolog (and ISO) support these as
functions under is/2, etc.
- deprecated
- - Do not use these predicates except for compatibility
reasons.
- Compatibility
- - Quintus Prolog.
- sin(+Angle, -Sine) is det
- cos(+Angle, -Cosine) is det
- tan(+Angle, -Tangent) is det
- log(+X, -NatLog) is det
- log10(+X, -Log) is det
- pow(+X, +Y, -Pow) is det
- ceiling(+X, -Value) is det
- floor(+X, -Value) is det
- round(+X, -Value) is det
- sqrt(+X, -Value) is det
- acos(+X, -Value) is det
- asin(+X, -Value) is det
- atan(+X, -Value) is det
- atan2(+Y, +X, -Value) is det
- sign(+X, -Value) is det
- Math library predicates. SWI-Prolog (and ISO) support these as
functions under is/2, etc.
- deprecated
- - Do not use these predicates except for compatibility
reasons.
- Compatibility
- - Quintus Prolog.
- sin(+Angle, -Sine) is det
- cos(+Angle, -Cosine) is det
- tan(+Angle, -Tangent) is det
- log(+X, -NatLog) is det
- log10(+X, -Log) is det
- pow(+X, +Y, -Pow) is det
- ceiling(+X, -Value) is det
- floor(+X, -Value) is det
- round(+X, -Value) is det
- sqrt(+X, -Value) is det
- acos(+X, -Value) is det
- asin(+X, -Value) is det
- atan(+X, -Value) is det
- atan2(+Y, +X, -Value) is det
- sign(+X, -Value) is det
- Math library predicates. SWI-Prolog (and ISO) support these as
functions under is/2, etc.
- deprecated
- - Do not use these predicates except for compatibility
reasons.
- Compatibility
- - Quintus Prolog.
- sin(+Angle, -Sine) is det
- cos(+Angle, -Cosine) is det
- tan(+Angle, -Tangent) is det
- log(+X, -NatLog) is det
- log10(+X, -Log) is det
- pow(+X, +Y, -Pow) is det
- ceiling(+X, -Value) is det
- floor(+X, -Value) is det
- round(+X, -Value) is det
- sqrt(+X, -Value) is det
- acos(+X, -Value) is det
- asin(+X, -Value) is det
- atan(+X, -Value) is det
- atan2(+Y, +X, -Value) is det
- sign(+X, -Value) is det
- Math library predicates. SWI-Prolog (and ISO) support these as
functions under is/2, etc.
- deprecated
- - Do not use these predicates except for compatibility
reasons.
- Compatibility
- - Quintus Prolog.
- sin(+Angle, -Sine) is det
- cos(+Angle, -Cosine) is det
- tan(+Angle, -Tangent) is det
- log(+X, -NatLog) is det
- log10(+X, -Log) is det
- pow(+X, +Y, -Pow) is det
- ceiling(+X, -Value) is det
- floor(+X, -Value) is det
- round(+X, -Value) is det
- sqrt(+X, -Value) is det
- acos(+X, -Value) is det
- asin(+X, -Value) is det
- atan(+X, -Value) is det
- atan2(+Y, +X, -Value) is det
- sign(+X, -Value) is det
- Math library predicates. SWI-Prolog (and ISO) support these as
functions under is/2, etc.
- deprecated
- - Do not use these predicates except for compatibility
reasons.
- Compatibility
- - Quintus Prolog.
- sin(+Angle, -Sine) is det
- cos(+Angle, -Cosine) is det
- tan(+Angle, -Tangent) is det
- log(+X, -NatLog) is det
- log10(+X, -Log) is det
- pow(+X, +Y, -Pow) is det
- ceiling(+X, -Value) is det
- floor(+X, -Value) is det
- round(+X, -Value) is det
- sqrt(+X, -Value) is det
- acos(+X, -Value) is det
- asin(+X, -Value) is det
- atan(+X, -Value) is det
- atan2(+Y, +X, -Value) is det
- sign(+X, -Value) is det
- Math library predicates. SWI-Prolog (and ISO) support these as
functions under is/2, etc.
- deprecated
- - Do not use these predicates except for compatibility
reasons.
- Compatibility
- - Quintus Prolog.
- sin(+Angle, -Sine) is det
- cos(+Angle, -Cosine) is det
- tan(+Angle, -Tangent) is det
- log(+X, -NatLog) is det
- log10(+X, -Log) is det
- pow(+X, +Y, -Pow) is det
- ceiling(+X, -Value) is det
- floor(+X, -Value) is det
- round(+X, -Value) is det
- sqrt(+X, -Value) is det
- acos(+X, -Value) is det
- asin(+X, -Value) is det
- atan(+X, -Value) is det
- atan2(+Y, +X, -Value) is det
- sign(+X, -Value) is det
- Math library predicates. SWI-Prolog (and ISO) support these as
functions under is/2, etc.
- deprecated
- - Do not use these predicates except for compatibility
reasons.
- Compatibility
- - Quintus Prolog.
- sin(+Angle, -Sine) is det
- cos(+Angle, -Cosine) is det
- tan(+Angle, -Tangent) is det
- log(+X, -NatLog) is det
- log10(+X, -Log) is det
- pow(+X, +Y, -Pow) is det
- ceiling(+X, -Value) is det
- floor(+X, -Value) is det
- round(+X, -Value) is det
- sqrt(+X, -Value) is det
- acos(+X, -Value) is det
- asin(+X, -Value) is det
- atan(+X, -Value) is det
- atan2(+Y, +X, -Value) is det
- sign(+X, -Value) is det
- Math library predicates. SWI-Prolog (and ISO) support these as
functions under is/2, etc.
- deprecated
- - Do not use these predicates except for compatibility
reasons.
- Compatibility
- - Quintus Prolog.
- skip_line is det
- skip_line(Stream) is det
- Skip the rest of the current line (on Stream). Same as
skip(0'\n)
.
- midstring(?ABC, ?B, ?AC) is nondet
- midstring(?ABC, ?B, ?AC, LenA) is nondet
- midstring(?ABC, ?B, ?AC, LenA, LenB) is nondet
- midstring(?ABC, ?B, ?AC, LenA, LenB, LenC) is nondet
- Too difficult to explain. See the Quintus docs. As far as I
understand them the code below emulates this function just fine.
- midstring(?ABC, ?B, ?AC) is nondet
- midstring(?ABC, ?B, ?AC, LenA) is nondet
- midstring(?ABC, ?B, ?AC, LenA, LenB) is nondet
- midstring(?ABC, ?B, ?AC, LenA, LenB, LenC) is nondet
- Too difficult to explain. See the Quintus docs. As far as I
understand them the code below emulates this function just fine.
- midstring(?ABC, ?B, ?AC) is nondet
- midstring(?ABC, ?B, ?AC, LenA) is nondet
- midstring(?ABC, ?B, ?AC, LenA, LenB) is nondet
- midstring(?ABC, ?B, ?AC, LenA, LenB, LenC) is nondet
- Too difficult to explain. See the Quintus docs. As far as I
understand them the code below emulates this function just fine.