1/*   
    2  LogicMOO Base FOL/PFC Setup
    3% Dec 13, 2035
    4% Douglas Miles
    5
    6*/
    7:- if(( current_prolog_flag(xref,true) ;
    8   ('$current_source_module'(SM),'context_module'(M),'$current_typein_module'(CM),asserta(baseKB:'wusing_pfc'(M,CM,SM,pfc_mod))))).    9:- endif.   10
   11:- if((prolog_load_context(source,File),prolog_load_context(file,File))).   12:- module(pfc_mod,[use_pfc_mod/0]).   13:- abolish(use_pfc_mod/0).   14:- prolog_load_context(file,File),unload_file(File).   15:- asserta(use_pfc_mod).   16:- endif.   17
   18% :- current_predicate(system:F/A),functor(PI,F,A),
   19% \+ predicate_property(system:PI,imported_from(_)).
   20
   21:- if( \+ current_prolog_flag(xref,true)).   22
   23
   24:- if(\+ current_prolog_flag(lm_no_autoload,_)).   25:- set_prolog_flag(lm_no_autoload,true).   26:- wdmsg("WARNING: PFC_NOAUTOLOAD").   27:- endif.   28
   29:- if(\+ current_prolog_flag(lm_pfc_lean,_)).   30:- set_prolog_flag(lm_pfc_lean,true).   31:- wdmsg("WARNING: PFC_LEAN").   32:- endif.   33
   34%:- set_prolog_flag(debug_on_error,true).
   35%:- set_prolog_flag(report_error,true).
   36:- baseKB:'wusing_pfc'(_M,_CM,SM,pfc_mod),SM:reexport(pfc_lib).   37:- set_prolog_flag(mpred_te,true).   38
   39:- must(retract(baseKB:'wusing_pfc'(M,CM,SM,pfc_mod))),
   40   show_wdmsg(baseKB:'chusing_pfc'(M,CM,SM,pfc_mod)),
   41   (M==SM -> 
   42     (maybe_ensure_abox(SM),nop((M:ain(genlMt(SM,baseKB)))));
   43     show_wdmsg(baseKB:'lusing_pfc'(M,CM,SM,pfc_mod))),   
   44   assert(baseKB:'using_pfc'(M,CM,SM,pfc_mod)).   45   
   46:- baseKB:ensure_loaded('pfclib/system_autoexec.pfc').   47:- set_prolog_flag(pfc_booted,true).   48
   49:- set_prolog_flag(retry_undefined, kb_shared).   50:- set_prolog_flag(pfc_ready, true).   51
   52:- endif.   53%:- statistics.