Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :-module_transparent(nth_pi/2).
- :-module_transparent(nth_goal/2).
- :-module_transparent(nth_frame/3).
- :-module_transparent(nth_frame_attribute/5).
- nth_pi(Nth, Value):- prolog_current_frame(Frame), nth_frame_attribute(Nth,-1, Frame, predicate_indicator, Value).
- nth_goal(Nth, Value):- prolog_current_frame(Frame), nth_frame_attribute(Nth,-1, Frame, goal, Value).
- nth_frame(Nth, Key, Value):- prolog_current_frame(Frame), nth_frame_attribute(Nth,-1, Frame, Key, Value).
- nth_frame_attribute(Nth,NthIn, Frame, Key, Value):-
- (NthIn>=0,Nth=NthIn,prolog_frame_attribute(Frame, Key, Value));
- ((prolog_frame_attribute(Frame, parent, ParentFrame),
- NthNext is NthIn + 1, nth_frame_attribute(Nth,NthNext, ParentFrame, Key, Value))).
- in_file_expansion :- nth_pi(LF,_:'$load_file'/_),nth_pi(TL,'$toplevel':_/0),!,LF<TL,
- (nth_pi(ED,_:'$execute_directive_3'/_)-> (LF<ED) ; true).
- in_file_directive :- nth_pi(LF,_:'$load_file'/_),nth_pi(TL,'$toplevel':_/0),!,LF<TL,
- (nth_pi(ED,_:'$execute_directive_3'/_)-> (LF>ED) ; false).
- in_toplevel :- nth_pi(LF,_:'$load_file'/_),nth_pi(TL,'$toplevel':_/0),!,LF>TL,
- (nth_pi(ED,_:'$execute_directive_3'/_)-> (ED>TL) ; true).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement