accept // more often as predicate indicator.

This commit is contained in:
Vitor Santos Costa 2010-02-27 23:07:03 +00:00
parent 0bdea36358
commit a00c3e13c1
2 changed files with 25 additions and 1 deletions

View File

@ -217,6 +217,10 @@ no_style_check([H|T]) :- no_style_check(H), no_style_check(T).
'$multifile'((X,Y), M) :- !, '$multifile'(X, M), '$multifile'(Y, M). '$multifile'((X,Y), M) :- !, '$multifile'(X, M), '$multifile'(Y, M).
'$multifile'(Mod:PredSpec, _) :- !, '$multifile'(Mod:PredSpec, _) :- !,
'$multifile'(PredSpec, Mod). '$multifile'(PredSpec, Mod).
'$multifile'(N//A, M) :- !,
integer(A),
A1 is A+2,
'$multifile'(N/A1, M).
'$multifile'(N/A, M) :- '$multifile'(N/A, M) :-
'$add_multifile'(N,A,M), '$add_multifile'(N,A,M),
fail. fail.
@ -247,6 +251,10 @@ discontiguous(F) :-
'$discontiguous'(Y,M). '$discontiguous'(Y,M).
'$discontiguous'(M:A,_) :- !, '$discontiguous'(M:A,_) :- !,
'$discontiguous'(A,M). '$discontiguous'(A,M).
'$discontiguous'(N//A1, M) :- !,
integer(A1), !,
A is A1+2,
'$discontiguous'(N/A, M).
'$discontiguous'(N/A, M) :- !, '$discontiguous'(N/A, M) :- !,
( recordzifnot('$discontiguous_defs','$df'(N,A,M),_) -> ( recordzifnot('$discontiguous_defs','$df'(N,A,M),_) ->
true true

View File

@ -525,6 +525,11 @@ abolish(X) :-
'$abolish_all_atoms'(A,M). '$abolish_all_atoms'(A,M).
'$new_abolish'(M:PS,_) :- !, '$new_abolish'(M:PS,_) :- !,
'$new_abolish'(PS,M). '$new_abolish'(PS,M).
'$new_abolish'(Na//Ar1, M) :-
integer(Ar1),
!,
Ar is Ar1+2,
'$new_abolish'(Na//Ar, M).
'$new_abolish'(Na/Ar, M) :- '$new_abolish'(Na/Ar, M) :-
functor(H, Na, Ar), functor(H, Na, Ar),
'$is_dynamic'(H, M), !, '$is_dynamic'(H, M), !,
@ -556,7 +561,8 @@ abolish(X) :-
'$check_error_in_module'(M, Msg), '$check_error_in_module'(M, Msg),
'$check_error_in_predicate_indicator'(S, Msg). '$check_error_in_predicate_indicator'(S, Msg).
'$check_error_in_predicate_indicator'(S, Msg) :- '$check_error_in_predicate_indicator'(S, Msg) :-
S \= _/_, !, S \= _/_,
S \= _//_, !,
'$do_error'(type_error(predicate_indicator,S), Msg). '$do_error'(type_error(predicate_indicator,S), Msg).
'$check_error_in_predicate_indicator'(Na/_, Msg) :- '$check_error_in_predicate_indicator'(Na/_, Msg) :-
var(Na), !, var(Na), !,
@ -685,6 +691,10 @@ dynamic(X) :-
'$dynamic2'(X, Mod) :- '$log_upd'(Stat), Stat\=0, !, '$dynamic2'(X, Mod) :- '$log_upd'(Stat), Stat\=0, !,
'$logical_updatable'(X, Mod). '$logical_updatable'(X, Mod).
'$dynamic2'(A//N1, Mod) :-
integer(N1),
N is N1+2,
'$dynamic2'(A/N, Mod).
'$dynamic2'(A/N, Mod) :- '$dynamic2'(A/N, Mod) :-
integer(N), atom(A), !, integer(N), atom(A), !,
functor(T,A,N), '$flags'(T,Mod,F,F), functor(T,A,N), '$flags'(T,Mod,F,F),
@ -699,6 +709,9 @@ dynamic(X) :-
'$do_error'(type_error(callable,X),dynamic(Mod:X)). '$do_error'(type_error(callable,X),dynamic(Mod:X)).
'$logical_updatable'(A//N,Mod) :- integer(N), !,
N1 is N+2,
'$logical_updatable'(A/N1,Mod).
'$logical_updatable'(A/N,Mod) :- integer(N), atom(A), !, '$logical_updatable'(A/N,Mod) :- integer(N), atom(A), !,
functor(T,A,N), '$flags'(T,Mod,F,F), functor(T,A,N), '$flags'(T,Mod,F,F),
( (
@ -747,6 +760,9 @@ dynamic_predicate(P,Sem) :-
'$public'((A,B), M) :- !, '$public'(A,M), '$public'(B,M). '$public'((A,B), M) :- !, '$public'(A,M), '$public'(B,M).
'$public'([],_) :- !. '$public'([],_) :- !.
'$public'([H|L], M) :- !, '$public'(H, M), '$public'(L, M). '$public'([H|L], M) :- !, '$public'(H, M), '$public'(L, M).
'$public'(A//N1, Mod) :- integer(N1), !,
N is N1+2,
'$public'(A//N, Mod).
'$public'(A/N, Mod) :- integer(N), atom(A), !, '$public'(A/N, Mod) :- integer(N), atom(A), !,
functor(T,A,N), functor(T,A,N),
'$do_make_public'(T, Mod). '$do_make_public'(T, Mod).