@@ -1,16 +1,17 @@
|
||||
:- op(400, yfx, /).
|
||||
|
||||
:- module(builtins, [(=)/2, (\=)/2, (\+)/1, (+)/1, (+)/2, (**)/2,
|
||||
(*)/2, (-)/1, (-)/2, (/)/2, (/\)/2, (\/)/2, (is)/2, (xor)/2,
|
||||
(div)/2, (//)/2, (rdiv)/2, (<<)/2, (>>)/2, (mod)/2, (rem)/2,
|
||||
(>)/2, (<)/2, (=\=)/2, (=:=)/2, (>=)/2, (=<)/2, (,)/2, (->)/2,
|
||||
(;)/2, (=..)/2, (==)/2, (\==)/2, (@=<)/2, (@>=)/2, (@<)/2,
|
||||
(@>)/2, (=@=)/2, (\=@=)/2, (:)/2, abolish/1, asserta/1,
|
||||
assertz/1, bagof/3, bb_b_put/2, bb_get/2, bb_put/2,
|
||||
call_cleanup/2, call_with_inference_limit/3, catch/3,
|
||||
clause/2, current_predicate/1, current_prolog_flag/2,
|
||||
expand_goal/2, expand_term/2, findall/3, findall/4, halt/0,
|
||||
once/1, op/3, repeat/0, retract/1, set_prolog_flag/2, setof/3,
|
||||
:- module(builtins, [(=)/2, (\=)/2, (\+)/1, (^)/2, (\)/1, (+)/1,
|
||||
(+)/2, (**)/2, (*)/2, (-)/1, (-)/2, (/)/2, (/\)/2, (\/)/2,
|
||||
(is)/2, (xor)/2, (div)/2, (//)/2, (rdiv)/2, (<<)/2, (>>)/2,
|
||||
(mod)/2, (rem)/2, (>)/2, (<)/2, (=\=)/2, (=:=)/2, (>=)/2,
|
||||
(=<)/2, (,)/2, (->)/2, (;)/2, (=..)/2, (==)/2, (\==)/2,
|
||||
(@=<)/2, (@>=)/2, (@<)/2, (@>)/2, (=@=)/2, (\=@=)/2, (:)/2,
|
||||
abolish/1, asserta/1, assertz/1, bagof/3, bb_b_put/2,
|
||||
bb_get/2, bb_put/2, call_cleanup/2,
|
||||
call_with_inference_limit/3, catch/3, clause/2,
|
||||
current_predicate/1, current_prolog_flag/2, expand_goal/2,
|
||||
expand_term/2, findall/3, findall/4, halt/0, once/1, op/3,
|
||||
repeat/0, retract/1, set_prolog_flag/2, setof/3,
|
||||
setup_call_cleanup/3, term_variables/2, throw/1, true/0,
|
||||
false/0, write/1, write_canonical/1, writeq/1, write_term/2]).
|
||||
|
||||
@@ -33,11 +34,11 @@ expand_op_list([Op | OtherOps], Pred, Spec, [(:- op(Pred, Spec, Op)) | OtherResu
|
||||
:- op(700, xfx, is).
|
||||
:- op(500, yfx, [+, -]).
|
||||
:- op(400, yfx, *).
|
||||
:- op(200, xfy, **).
|
||||
:- op(200, xfy, [**, ^]).
|
||||
:- op(500, yfx, [/\, \/, xor]).
|
||||
:- op(400, yfx, [div, //, rdiv]).
|
||||
:- op(400, yfx, [<<, >>, mod, rem]).
|
||||
:- op(200, fy, [+, -]).
|
||||
:- op(200, fy, [+, -, \]).
|
||||
|
||||
% arithmetic comparison operators.
|
||||
:- op(700, xfx, [>, <, =\=, =:=, >=, =<]).
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
:- module(dcgs, [(-->)/2, phrase/2, phrase/3]).
|
||||
:- op(1200, xfx, -->).
|
||||
|
||||
:- module(dcgs, [phrase/2, phrase/3]).
|
||||
|
||||
:- use_module(library(lists), [append/3]).
|
||||
:- use_module(library(terms)).
|
||||
|
||||
:- op(1200, xfx, -->).
|
||||
|
||||
phrase(G, G) :-
|
||||
nonvar(G), G = [_|_], !.
|
||||
phrase(G, Ls0) :-
|
||||
|
||||
Reference in New Issue
Block a user