PublicShow sourcequintus.pl -- Quintus compatibility

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:

Of course, this library is incomplete ...

Sourceunix(+Action)
interface to Unix.
Sourceotherwise
For (A -> B ; otherwise -> C)
Sourceabs(+Number, -Absolute)
Unify `Absolute' with the absolute value of `Number'.
Sourcesin(+Angle, -Sine) is det
Sourcecos(+Angle, -Cosine) is det
Sourcetan(+Angle, -Tangent) is det
Sourcelog(+X, -NatLog) is det
Sourcelog10(+X, -Log) is det
Math library predicates. SWI-Prolog (and ISO) support these as functions under is/2, etc.
Sourcegenarg(?Index, +Term, ?Arg) is nondet
Generalised version of ISO arg/3. SWI-Prolog's arg/3 is already genarg/3.
Sourceprolog_flag(?Flag, ?Value) is nondet
Same as ISO current_prolog_flag/2. Maps version.
bug
- Should map relevant Quintus flag identifiers.
Sourcedate(-Date) is det
Get current date as date(Y,M,D)
Sourceno_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.
Sourcemode(+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)]).
Sourcesimple(@Term) is semidet
Term is atomic or a variable.
Sourcecurrent_stream(?Object, ?Mode, ?Stream)
SICStus/Quintus and backward compatible predicate. New code should be using the ISO compatible stream_property/2.
Sourcestream_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.
Sourceskip_line is det
Sourceskip_line(Stream) is det
Skip the rest of the current line (on Stream). Same as skip(0'\n).
Sourcecompile(+Files) is det
Compile files. SWI-Prolog doesn't distinguish between compilation and consult.
See also
- load_files/2.
Sourceatom_char(+Char, -Code) is det
atom_char(-Char, +Code) is det
Same as ISO char_code/2.
Sourcemidstring(?ABC, ?B, ?AC) is nondet
Sourcemidstring(?ABC, ?B, ?AC, LenA) is nondet
Sourcemidstring(?ABC, ?B, ?AC, LenA, LenB) is nondet
Sourcemidstring(?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.
Sourceraise_exception(+Term)
Quintus compatible exception handling
Sourceon_exception(+Template, :Goal, :Recover)
Sourcesin(+Angle, -Sine) is det
Sourcecos(+Angle, -Cosine) is det
Sourcetan(+Angle, -Tangent) is det
Sourcelog(+X, -NatLog) is det
Sourcelog10(+X, -Log) is det
Math library predicates. SWI-Prolog (and ISO) support these as functions under is/2, etc.
Sourcesin(+Angle, -Sine) is det
Sourcecos(+Angle, -Cosine) is det
Sourcetan(+Angle, -Tangent) is det
Sourcelog(+X, -NatLog) is det
Sourcelog10(+X, -Log) is det
Math library predicates. SWI-Prolog (and ISO) support these as functions under is/2, etc.
Sourcesin(+Angle, -Sine) is det
Sourcecos(+Angle, -Cosine) is det
Sourcetan(+Angle, -Tangent) is det
Sourcelog(+X, -NatLog) is det
Sourcelog10(+X, -Log) is det
Math library predicates. SWI-Prolog (and ISO) support these as functions under is/2, etc.
Sourcesin(+Angle, -Sine) is det
Sourcecos(+Angle, -Cosine) is det
Sourcetan(+Angle, -Tangent) is det
Sourcelog(+X, -NatLog) is det
Sourcelog10(+X, -Log) is det
Math library predicates. SWI-Prolog (and ISO) support these as functions under is/2, etc.
Sourceskip_line is det
Sourceskip_line(Stream) is det
Skip the rest of the current line (on Stream). Same as skip(0'\n).
Sourcemidstring(?ABC, ?B, ?AC) is nondet
Sourcemidstring(?ABC, ?B, ?AC, LenA) is nondet
Sourcemidstring(?ABC, ?B, ?AC, LenA, LenB) is nondet
Sourcemidstring(?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.
Sourcemidstring(?ABC, ?B, ?AC) is nondet
Sourcemidstring(?ABC, ?B, ?AC, LenA) is nondet
Sourcemidstring(?ABC, ?B, ?AC, LenA, LenB) is nondet
Sourcemidstring(?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.
Sourcemidstring(?ABC, ?B, ?AC) is nondet
Sourcemidstring(?ABC, ?B, ?AC, LenA) is nondet
Sourcemidstring(?ABC, ?B, ?AC, LenA, LenB) is nondet
Sourcemidstring(?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.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

Sourceasin(Arg1, Arg2)
Sourceceiling(Arg1, Arg2)
Sourcesqrt(Arg1, Arg2)
Sourceacos(Arg1, Arg2)
Sourcepow(Arg1, Arg2, Arg3)
Sourceatan(Arg1, Arg2)
Sourcesign(Arg1, Arg2)
Sourceround(Arg1, Arg2)
Sourceatan2(Arg1, Arg2, Arg3)
Sourcefloor(Arg1, Arg2)