2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								/*************************************************************************
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*									 *
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*	 YAP Prolog 							 *
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*									 *
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*	Yap Prolog was developed at NCCUP - Universidade do Porto	 *
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*									 *
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997	 *
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*									 *
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								**************************************************************************
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*									 *
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* File:		init.yap						 *
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* Last rev:								 *
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* mods:									 *
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								* comments:	initializing the full prolog system			 *
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*									 *
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*************************************************************************/
							 
						 
					
						
							
								
									
										
										
										
											2015-01-04 23:58:23 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								%%   @defgroup builtins  YAP  Built-Ins
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-12-24 15:32:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/*
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  @addtogroup YAPControl
							 
						 
					
						
							
								
									
										
										
										
											2014-09-11 14:06:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-12-24 15:32:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    @{    
							 
						 
					
						
							
								
									
										
										
										
											2014-09-11 14:06:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*/
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-04-09 12:39:29 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- system_module( '$_init', [!/0,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        (:-)/1,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        (?-)/1,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        []/0,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        extensions_to_present_answer/1,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        fail/0,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        false/0,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        goal_expansion/2,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        goal_expansion/3,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        otherwise/0,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        prolog_booting/0,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        term_expansion/2,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        version/2,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									'$do_log_upd_clause'/6,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        '$do_log_upd_clause0'/6,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        '$do_log_upd_clause_erase'/6,
							 
						 
					
						
							
								
									
										
										
										
											2014-06-20 11:13:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        '$do_static_clause'/5], [
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        '$system_module'/1]).
							 
						 
					
						
							
								
									
										
										
										
											2014-04-09 12:39:29 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								:- use_system_module( '$_boot', ['$cut_by'/1]).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-04-06 17:05:17 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								'prolog_booting'.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								% This is yap's init file
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								% should be consulted first step after booting
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								% These are pseudo declarations
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								% so that the user will get a redefining system predicate
							 
						 
					
						
							
								
									
										
										
										
											2014-09-11 14:06:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/** @pred  fail is iso 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Always fails.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*/
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								fail :- fail.
							 
						 
					
						
							
								
									
										
										
										
											2005-02-08 04:05:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-09-11 14:06:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/** @pred  false is iso 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The same as fail.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*/
							 
						 
					
						
							
								
									
										
										
										
											2002-05-14 18:24:34 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								false :- fail.
							 
						 
					
						
							
								
									
										
										
										
											2005-02-08 04:05:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								otherwise.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								!.
							 
						 
					
						
							
								
									
										
										
										
											2005-02-08 04:05:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								(:- G) :- '$execute'(G), !.
							 
						 
					
						
							
								
									
										
										
										
											2005-02-08 04:05:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-05-25 16:15:09 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								(?- G) :- '$execute'(G).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								'$$!'(CP) :- '$cut_by'(CP).
							 
						 
					
						
							
								
									
										
										
										
											2005-02-08 04:05:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2001-12-11 04:35:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								[] :- true.
							 
						 
					
						
							
								
									
										
										
										
											2001-12-11 16:40:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-08-27 13:37:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- set_value('$doindex',true).
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-08-31 13:59:30 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								% just create a choice-point
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								% the 6th argument marks the time-stamp.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								'$do_log_upd_clause'(_,_,_,_,_,_).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								'$do_log_upd_clause'(A,B,C,D,E,_) :-
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									'$continue_log_update_clause'(A,B,C,D,E).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								'$do_log_upd_clause'(_,_,_,_,_,_).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								'$do_log_upd_clause_erase'(_,_,_,_,_,_).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								'$do_log_upd_clause_erase'(A,B,C,D,E,_) :-
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									'$continue_log_update_clause_erase'(A,B,C,D,E).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								'$do_log_upd_clause_erase'(_,_,_,_,_,_).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								'$do_log_upd_clause0'(_,_,_,_,_,_).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								'$do_log_upd_clause0'(A,B,C,D,_,_) :-
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									'$continue_log_update_clause'(A,B,C,D).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								'$do_log_upd_clause0'(_,_,_,_,_,_).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								'$do_static_clause'(_,_,_,_,_).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								'$do_static_clause'(A,B,C,D,E) :-
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									'$continue_static_clause'(A,B,C,D,E).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								'$do_static_clause'(_,_,_,_,_).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-11-26 18:36:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- '$handle_throw'(_,_,_), !.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-10-19 01:47:43 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- bootstrap('errors.yap').
							 
						 
					
						
							
								
									
										
										
										
											2011-06-22 12:29:35 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- bootstrap('lists.yap').
							 
						 
					
						
							
								
									
										
										
										
											2005-10-19 01:47:43 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- bootstrap('consult.yap').
							 
						 
					
						
							
								
									
										
										
										
											2014-04-06 17:05:17 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- bootstrap('preddecls.yap').
							 
						 
					
						
							
								
									
										
										
										
											2014-06-22 17:35:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-04-06 17:05:17 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- bootstrap('atoms.yap').
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								:- bootstrap('os.yap').
							 
						 
					
						
							
								
									
										
										
										
											2013-11-13 22:52:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- bootstrap('absf.yap').
							 
						 
					
						
							
								
									
										
										
										
											2005-10-19 01:47:43 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-12-14 11:45:42 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:-'$swi_set_prolog_flag'(verbose,  normal).
							 
						 
					
						
							
								
									
										
										
										
											2014-10-06 00:01:25 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-10-02 14:41:41 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- [	 'directives.yap',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 'utils.yap',
							 
						 
					
						
							
								
									
										
										
										
											2009-08-20 10:38:33 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 'control.yap',
							 
						 
					
						
							
								
									
										
										
										
											2004-06-23 17:24:20 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 'arith.yap',
							 
						 
					
						
							
								
									
										
										
										
											2014-04-06 17:05:17 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 'flags.yap'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								   ].
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-10-06 00:01:25 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- [	 'preds.yap',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 'modules.yap'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								   ].
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-10-11 12:45:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- compile_expressions.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-12-05 16:08:44 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- [
							 
						 
					
						
							
								
									
										
										
										
											2010-06-17 00:23:03 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    % lists is often used.
							 
						 
					
						
							
								
									
										
										
										
											2008-12-04 23:37:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								   	 'yio.yap',
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									 'debug.yap',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 'checker.yap',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 'depth_bound.yap',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 'grammar.yap',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 'ground.yap',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 'listing.yap',
							 
						 
					
						
							
								
									
										
										
										
											2014-04-21 11:20:00 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								         'arithpreds.yap',
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									 % modules must be after preds, otherwise we will have trouble
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 % with meta-predicate expansion being invoked
							 
						 
					
						
							
								
									
										
										
										
											2008-12-05 16:08:44 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 % must follow grammar
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 'eval.yap',
							 
						 
					
						
							
								
									
										
										
										
											2004-01-23 02:23:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 'signals.yap',
							 
						 
					
						
							
								
									
										
										
										
											2002-03-12 15:09:27 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 'profile.yap',
							 
						 
					
						
							
								
									
										
										
										
											2002-09-03 14:28:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 'callcount.yap',
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									 'load_foreign.yap',
							 
						 
					
						
							
								
									
										
										
										
											2012-06-11 09:22:53 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								%	 'save.yap',
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									 'setof.yap',
							 
						 
					
						
							
								
									
										
										
										
											2011-06-22 12:29:35 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 'sort.yap',
							 
						 
					
						
							
								
									
										
										
										
											2004-03-02 16:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 'statistics.yap',
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									 'strict_iso.yap',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 'tabling.yap',
							 
						 
					
						
							
								
									
										
										
										
											2004-01-23 02:23:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 'threads.yap',
							 
						 
					
						
							
								
									
										
										
										
											2006-04-06 11:18:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 'eam.yap',
							 
						 
					
						
							
								
									
										
										
										
											2007-12-29 12:26:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 'chtypes.yap',
							 
						 
					
						
							
								
									
										
										
										
											2009-02-20 11:42:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 'yapor.yap',
							 
						 
					
						
							
								
									
										
										
										
											2011-08-03 16:30:39 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								         'qly.yap',
							 
						 
					
						
							
								
									
										
										
										
											2009-02-20 11:42:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								         'udi.yap'].
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-06-22 17:35:05 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- meta_predicate(log_event(+,:)).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-04 00:06:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- dynamic prolog:'$user_defined_flag'/4.
							 
						 
					
						
							
								
									
										
										
										
											2008-02-12 17:03:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-04 11:00:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- dynamic prolog:'$parent_module'/2.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-03-31 22:56:22 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- multifile prolog:debug_action_hook/1.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								:-	 ['protect.yap'].
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2012-06-12 14:50:36 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								version(yap,[6,3]).
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								:- op(1150,fx,(mode)).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								:- dynamic 'extensions_to_present_answer'/1.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-03-12 14:26:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- 	['arrays.yap'].
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-10-10 10:00:27 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- 	['undefined.yap'].
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-02-22 15:08:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- use_module('messages.yap').
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								:- use_module('hacks.yap').
							 
						 
					
						
							
								
									
										
										
										
											2010-03-12 14:26:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- use_module('attributes.yap').
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								:- use_module('corout.yap').
							 
						 
					
						
							
								
									
										
										
										
											2010-04-22 12:16:37 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- use_module('dialect.yap').
							 
						 
					
						
							
								
									
										
										
										
											2011-02-28 15:45:14 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- use_module('history.pl').
							 
						 
					
						
							
								
									
										
										
										
											2011-04-30 01:16:40 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- use_module('dbload.yap').
							 
						 
					
						
							
								
									
										
										
										
											2011-06-14 09:02:44 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- use_module('swi.yap').
							 
						 
					
						
							
								
									
										
										
										
											2013-03-05 15:47:00 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- use_module('../swi/library/predopts.pl').
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								:- use_module('../swi/library/menu.pl').
							 
						 
					
						
							
								
									
										
										
										
											2014-09-08 17:16:00 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- use_module('../library/ypp.yap').
							 
						 
					
						
							
								
									
										
										
										
											2012-06-08 06:55:23 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-02-22 15:08:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-12-27 01:32:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								yap_hacks:cut_by(CP) :- '$$cut_by'(CP).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								:- '$change_type_of_char'(36,7). % Make $ a symbol character
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-12-13 08:42:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:-	'$swi_set_prolog_flag'(generate_debug_info,true).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-03-13 19:40:27 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- recorda('$dialect',yap,_).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2002-05-24 03:57:20 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								%
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								% cleanup ensure loaded and recover some data-base space.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								%
							 
						 
					
						
							
								
									
										
										
										
											2013-11-04 01:14:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- ( recorded('$lf_loaded',_,R), erase(R), fail ; true ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								:- ( recorded('$module',_,R), erase(R), fail ; true ).
							 
						 
					
						
							
								
									
										
										
										
											2002-05-24 03:57:20 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-08-27 13:37:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- set_value('$user_module',user), '$protect'.
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-02-04 11:22:42 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- style_check([-discontiguous,-multiple,-single_var]).
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								%
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								% moved this to init_gc in gc.c to separate the alpha
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								%
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								% :- yap_flag(gc,on).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								% :- yap_flag(gc_trace,verbose).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-06-14 09:02:44 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- multifile
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									prolog:comment_hook/3.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-09-25 09:44:34 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- source.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								:- module(user).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-09-11 14:06:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/** @pred  _CurrentModule_:goal_expansion(+ _G_,+ _M_,- _NG_), user:goal_expansion(+ _G_,+ _M_,- _NG_) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								YAP now supports goal_expansion/3. This is an user-defined
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								procedure that is called after term expansion when compiling or
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								asserting goals for each sub-goal in a clause. The first argument is
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								bound to the goal and the second to the module under which the goal
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 _G_ will execute. If goal_expansion/3 succeeds the new
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								sub-goal  _NG_ will replace  _G_ and will be processed in the same
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								way. If goal_expansion/3 fails the system will use the default
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								rules.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*/
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								:- multifile goal_expansion/3.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-08-30 01:06:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- dynamic goal_expansion/3.
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2012-11-07 13:49:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- multifile goal_expansion/2.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								:- dynamic goal_expansion/2.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								:- multifile system:goal_expansion/2.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								:- dynamic system:goal_expansion/2.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-05-24 19:18:52 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- multifile goal_expansion/2.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								:- dynamic goal_expansion/2.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-09-11 14:06:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/** @pred  _CurrentModule_:term_expansion( _T_,- _X_),  user:term_expansion( _T_,- _X_) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This user-defined predicate is called by `expand_term/3` to
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								preprocess all terms read when consulting a file. If it succeeds:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								If  _X_ is of the form `:- G` or `?- G`, it is processed as
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								a directive.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								If  _X_ is of the form `$source_location`( _File_, _Line_): _Clause_` it is processed as if from `File` and line `Line`.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								If  _X_ is a list, all terms of the list are asserted or processed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								as directives.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+ The term  _X_ is asserted instead of  _T_.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*/
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2001-11-15 00:01:43 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- multifile term_expansion/2.
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-08-30 01:06:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- dynamic term_expansion/2.
							 
						 
					
						
							
								
									
										
										
										
											2001-04-09 19:54:03 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-06-14 09:02:44 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- multifile system:term_expansion/2.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								:- dynamic system:term_expansion/2.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-03-12 19:18:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- multifile swi:swi_predicate_table/4.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-09-11 14:06:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/** @pred  user:message_hook(+ _Term_, + _Kind_, + _Lines_) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Hook predicate that may be define in the module `user` to intercept
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								messages from print_message/2.  _Term_ and  _Kind_ are the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								same as passed to print_message/2.  _Lines_ is a list of
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								format statements as described with print_message_lines/3.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This predicate should be defined dynamic and multifile to allow other
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								modules defining clauses for it too.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*/
							 
						 
					
						
							
								
									
										
										
										
											2008-09-30 11:44:48 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- multifile user:message_hook/3.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-02 12:53:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- dynamic user:message_hook/3.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-30 11:44:48 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- multifile user:portray_message/2.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-08-31 13:59:30 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- dynamic user:portray_message/2.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-01-18 01:32:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/** @pred  exception(+ _Exception_, + _Context_, - _Action_) 
							 
						 
					
						
							
								
									
										
										
										
											2014-09-11 14:06:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-01-18 01:32:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Dynamic predicate, normally not defined. Called by the Prolog system on run-time exceptions that can be repaired `just-in-time`. The values for  _Exception_ are described below. See also catch/3 and throw/1.
							 
						 
					
						
							
								
									
										
										
										
											2014-09-11 14:06:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								If this hook predicate succeeds it must instantiate the  _Action_ argument to the atom `fail` to make the operation fail silently, `retry` to tell Prolog to retry the operation or `error` to make the system generate an exception. The action `retry` only makes sense if this hook modified the environment such that the operation can now succeed without error.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+ `undefined_predicate`
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 _Context_ is instantiated to a predicate-indicator ( _Module:Name/Arity_). If the predicate fails Prolog will generate an existence_error exception. The hook is intended to implement alternatives to the SWI built-in autoloader, such as autoloading code from a database. Do not use this hook to suppress existence errors on predicates. See also `unknown`.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								+ `undefined_global_variable`
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 _Context_ is instantiated to the name of the missing global variable. The hook must call nb_setval/2 or b_setval/2 before returning with the action retry.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 */
							 
						 
					
						
							
								
									
										
										
										
											2014-09-25 09:44:34 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-03-01 22:32:40 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- multifile user:exception/3.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-03-01 23:02:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- dynamic user:exception/3.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-10-10 10:00:27 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- yap_flag(unknown,error). 
							 
						 
					
						
							
								
									
										
										
										
											2011-02-17 00:57:49 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-28 15:45:14 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								:- stream_property(user_input, tty(true)) -> set_prolog_flag(readline, true) ; true.
							 
						 
					
						
							
								
									
										
										
										
											2011-02-26 18:34:44 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-04-06 17:05:17 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-09-11 14:06:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/**
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								@}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*/