This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/pl/init.yap

278 lines
5.7 KiB
Plaintext
Raw Normal View History

/*************************************************************************
* *
* 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 *
* *
*************************************************************************/
% 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
fail :- fail.
false :- fail.
otherwise.
!.
(:- G) :- '$execute'(G), !.
(?- G) :- '$execute'(G).
'$$!'(CP) :- '$cut_by'(CP).
[] :- true.
:- set_value('$doindex',true).
2011-08-31 21:59:30 +01: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'(_,_,_,_,_).
:- '$handle_throw'(_,_,_), !.
:- bootstrap('errors.yap').
2011-06-22 12:29:35 +01:00
:- bootstrap('lists.yap').
:- bootstrap('consult.yap').
:- [ 'utils.yap',
2009-08-20 16:38:33 +01:00
'control.yap',
'arith.yap',
2010-02-28 01:11:05 +00:00
'directives.yap',
'flags.yap'].
:- compile_expressions.
:- [
% lists is often used.
2008-12-04 23:37:25 +00:00
'yio.yap',
'debug.yap',
'checker.yap',
'depth_bound.yap',
'grammar.yap',
'ground.yap',
'listing.yap',
'preds.yap',
% modules must be after preds, otherwise we will have trouble
% with meta-predicate expansion being invoked
'modules.yap',
% must follow grammar
'eval.yap',
'signals.yap',
'profile.yap',
'callcount.yap',
'load_foreign.yap',
2012-06-11 09:22:53 +01:00
% 'save.yap',
'setof.yap',
2011-06-22 12:29:35 +01:00
'sort.yap',
'statistics.yap',
'strict_iso.yap',
'tabling.yap',
'threads.yap',
'eam.yap',
'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'].
2009-12-04 00:06:11 +00:00
:- dynamic prolog:'$user_defined_flag'/4.
:- dynamic prolog:'$parent_module'/2.
:- multifile prolog:debug_action_hook/1.
:- source.
:- no_source.
:- ['protect.yap'].
2012-06-12 14:50:36 +01:00
version(yap,[6,3]).
system_mode(verbose,on) :- set_value('$verbose',on).
system_mode(verbose,off) :- set_value('$verbose',off).
:- op(1150,fx,(mode)).
:- dynamic 'extensions_to_present_answer'/1.
:- ['arrays.yap'].
:- use_module('messages.yap').
:- use_module('hacks.yap').
:- use_module('attributes.yap').
:- use_module('corout.yap').
:- use_module('dialect.yap').
2011-02-28 23:45:14 +00: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').
2012-02-13 09:39:57 +00:00
:- use_module('../LGPL/predopts.pl').
2012-06-08 12:55:23 +01:00
:- use_module('../LGPL/menu.pl').
'$system_module'('$attributes').
'$system_module'('$coroutining').
2012-02-13 09:39:57 +00:00
'$system_module'('$hacks').
2011-02-23 17:46:50 +00:00
'$system_module'('$history').
2012-02-13 09:39:57 +00:00
'$system_module'('$messages').
'$system_module'('$predopts').
2011-06-14 09:02:44 +01:00
'$system_module'('$swi').
2012-06-08 12:55:23 +01:00
'$system_module'('$win_menu').
yap_hacks:cut_by(CP) :- '$$cut_by'(CP).
:- '$change_type_of_char'(36,7). % Make $ a symbol character
:- multifile user:library_directory/1.
:- dynamic user:library_directory/1.
:- multifile user:commons_directory/1.
:- dynamic user:commons_directory/1.
2009-03-13 19:40:27 +00:00
:- recorda('$dialect',yap,_).
%
% cleanup ensure loaded and recover some data-base space.
%
:- ( recorded('$loaded','$loaded'(_,_,_),R), erase(R), fail ; true ).
:- dynamic autoloader:autoload/0.
:- set_value('$user_module',user), '$protect'.
:- style_check([]).
%
% moved this to init_gc in gc.c to separate the alpha
%
% :- yap_flag(gc,on).
% :- yap_flag(gc_trace,verbose).
:- system_mode(verbose,on).
:- multifile prolog:message/3.
:- dynamic prolog:message/3.
2011-06-14 09:02:44 +01:00
:- multifile
prolog:comment_hook/3.
:- module(user).
:- multifile goal_expansion/3.
:- dynamic goal_expansion/3.
:- multifile goal_expansion/2.
:- dynamic goal_expansion/2.
:- multifile system:goal_expansion/2.
:- dynamic system:goal_expansion/2.
2011-06-22 12:29:35 +01:00
:- multifile user:prolog_file_type/2.
2011-06-22 12:29:35 +01:00
:- dynamic user:prolog_file_type/2.
2011-06-22 12:29:35 +01:00
user:prolog_file_type(yap, prolog).
2011-06-14 09:02:44 +01:00
user:prolog_file_type(pl, prolog).
2011-06-22 12:29:35 +01:00
user:prolog_file_type(A, prolog) :-
current_prolog_flag(associate, A),
A\==pl,
A \== yap.
%user:prolog_file_type(qlf, prolog).
%user:prolog_file_type(qlf, qlf).
user:prolog_file_type(A, executable) :-
current_prolog_flag(shared_object_extension, A).
2011-06-14 09:02:44 +01:00
:- multifile goal_expansion/2.
:- dynamic goal_expansion/2.
:- multifile term_expansion/2.
:- dynamic term_expansion/2.
2011-06-14 09:02:44 +01:00
:- multifile system:term_expansion/2.
:- dynamic system:term_expansion/2.
:- multifile file_search_path/2.
:- dynamic file_search_path/2.
:- multifile generate_message_hook/3.
:- dynamic generate_message_hook/3.
:- multifile swi:swi_predicate_table/4.
:- multifile user:message_hook/3.
:- dynamic user:message_hook/3.
:- multifile user:portray_message/2.
2011-08-31 21:59:30 +01:00
:- dynamic user:portray_message/2.
2010-03-01 22:32:40 +00:00
:- multifile user:exception/3.
2010-03-01 23:02:37 +00:00
:- dynamic user:exception/3.
file_search_path(library, Dir) :-
library_directory(Dir).
file_search_path(commons, Dir) :-
commons_directory(Dir0).
file_search_path(swi, Home) :-
current_prolog_flag(home, Home).
file_search_path(yap, Home) :-
current_prolog_flag(home, Home).
file_search_path(system, Dir) :-
prolog_flag(host_type, Dir).
file_search_path(foreign, yap('lib/Yap')).
:- yap_flag(unknown,error).
2011-02-28 23:45:14 +00:00
:- stream_property(user_input, tty(true)) -> set_prolog_flag(readline, true) ; true.
2011-02-27 02:34:44 +00:00