eam.yap includes first version of eamconsult

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1587 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
rslopes 2006-04-06 11:18:37 +00:00
parent 2da7e891dc
commit 5179cb7d2b
2 changed files with 34 additions and 0 deletions

33
pl/eam.yap Normal file
View File

@ -0,0 +1,33 @@
/*************************************************************************
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* BEAM extends the YAP Prolog system to support the EAM *
* *
* Copyright Ricardo Lopes and Universidade do Porto 2000-2006 *
* *
**************************************************************************
* *
* File: eam.yap *
* Last rev: 6/4/2006 *
* mods: *
* comments: Some utility predicates needed by BEAM *
* *
*************************************************************************/
'$_eamtrans'((A,B),(C,D)):- !, '$_eamtrans'(A,C),'$_eamtrans'(B,D).
'$_eamtrans'((X is Y) ,(skip_while_var(Vars), X is Y )):- !, '$variables_in_term'(Y,[],Vars).
'$_eamtrans'((X =\= Y),(skip_while_var(Vars), X =\= Y )):- !, '$variables_in_term'(X + Y,[],Vars).
'$_eamtrans'((X =\= Y),(skip_while_var(Vars), X =:= Y )):- !, '$variables_in_term'(X + Y,[],Vars).
'$_eamtrans'((X >= Y) ,(skip_while_var(Vars), X >= Y )):- !, '$variables_in_term'(X + Y,[],Vars).
'$_eamtrans'((X > Y) ,(skip_while_var(Vars), X > Y )):- !, '$variables_in_term'(X + Y,[],Vars).
'$_eamtrans'((X < Y) ,(skip_while_var(Vars), X < Y )):- !, '$variables_in_term'(X + Y,[],Vars).
'$_eamtrans'((X =< Y) ,(skip_while_var(Vars), X =< Y )):- !, '$variables_in_term'(X + Y,[],Vars).
'$_eamtrans'(B,B).
eamconsult(File):- eam, eam, %fails if eam is disable
assert((term_expansion((A :- B),(A :- C)):- '$_eamtrans'(B,C))),
eam, ( consult(File) ; true), eam,
retract((term_expansion((A :- B),(A :- C)):- '$_eamtrans'(B,C))).

View File

@ -71,6 +71,7 @@ otherwise.
'strict_iso.yap', 'strict_iso.yap',
'tabling.yap', 'tabling.yap',
'threads.yap', 'threads.yap',
'eam.yap',
'yapor.yap']. 'yapor.yap'].
:- thread_local([idb:'$debug'/0,idb:'$trace'/0,idb:'$spy_skip'/0,idb:'$spy_stop'/0]). :- thread_local([idb:'$debug'/0,idb:'$trace'/0,idb:'$spy_skip'/0,idb:'$spy_stop'/0]).