slowly restore nth_clause

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@941 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2003-12-01 19:22:01 +00:00
parent 678ff0df82
commit fd1bc58cde
6 changed files with 259 additions and 22 deletions

View File

@@ -326,7 +326,7 @@ debugging :-
'$loop_spy_event'('$fail_spy'(GoalNumber), _, _, _, _) :- !,
throw('$fail_spy'(GoalNumber)).
'$loop_spy_event'(abort, _, _, _, _) :- !,
'$throw'(abort).
throw(abort).
'$loop_spy_event'(Event, GoalNumber, G, Module, _) :- !,
'$trace'(exception,G,Module,GoalNumber),
fail.

View File

@@ -355,6 +355,8 @@ clause(V,Q,R) :-
nth_clause(P,I,R) :- nonvar(R), !,
'$nth_instancep'(P,I,R).
nth_clause(V,I,R) :- var(V), !,
'$do_error'(instantiation_error,M:nth_clause(V,I,R)).
nth_clause(M:V,I,R) :- !,
'$nth_clause'(V,M,I,R).
nth_clause(V,I,R) :-
@@ -371,11 +373,14 @@ nth_clause(V,I,R) :-
'$nth_clause'(M:P,_,I,R) :- !,
'$nth_clause'(P,M,I,R).
'$nth_clause'(P,M,I,R) :-
'$some_recordedp'(M:P), !,
( '$is_log_updatable'(P,M) ; '$is_source'(P,M) ), !,
'$p_nth_clause'(P,M,I,R).
'$nth_clause'(P,M,I,R) :-
'$is_dynamic'(H,M), !,
'$nth_instancep'(M:P,I,R).
'$nth_clause'(P,M,I,R) :-
( '$system_predicate'(P,M) -> true ;
'$number_of_nth_clauses'(P,M,N), N > 0 ),
'$number_of_clauses'(P,M,N), N > 0 ),
functor(P,Name,Arity),
'$do_error'(permission_error(access,private_procedure,Name/Arity),
nth_clause(M:P,I,R)).