[Flora-commits] flora2 flrwrapper.H,1.9,1.10 flrwrapper.P,1.14,1.15
Brought to you by:
kifer
|
From: <ch...@us...> - 2003-03-27 11:47:51
|
Update of /cvsroot/flora/flora2
In directory sc8-pr-cvs1:/tmp/cvs-serv16638
Modified Files:
flrwrapper.H flrwrapper.P
Log Message:
more efficient flora_user_module_predicate/4 and flora_system_module_predicate/4
Index: flrwrapper.H
===================================================================
RCS file: /cvsroot/flora/flora2/flrwrapper.H,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- flrwrapper.H 26 Mar 2003 17:32:25 -0000 1.9
+++ flrwrapper.H 27 Mar 2003 11:47:47 -0000 1.10
@@ -33,7 +33,7 @@
:- dynamic flora_flogic_fact_wrapper(_,_).
:- dynamic flora_current_flogic_module(_).
-:- dynamic flora_decode_pred(_,_,_,_).
+:- dynamic flora_decode_pred(_,_,_,_,_).
:- index(flora_flogic_fact_wrapper/2,trie).
:- index(flora_current_flogic_module/1,trie).
Index: flrwrapper.P
===================================================================
RCS file: /cvsroot/flora/flora2/flrwrapper.P,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- flrwrapper.P 26 Mar 2003 17:32:25 -0000 1.14
+++ flrwrapper.P 27 Mar 2003 11:47:47 -0000 1.15
@@ -28,6 +28,7 @@
#include "flora_terms.flh"
+:- import length/2 from basics.
/*****************************************************************************
flora_user_module_predicate(+Functor,+Args,+Workspace,-Predicate)
@@ -37,17 +38,16 @@
Flora user module.
*****************************************************************************/
flora_user_module_predicate(Functor,Args,WS,Predicate) :-
- flora_user_module_functor(Functor,WS,PF),
- Predicate =.. [PF|Args].
-
-flora_user_module_functor(Functor,WS,PF) :-
- flora_decode_pred(Functor,WS,user,PF),
+ flora_decode_pred(Functor,Args,WS,user,Predicate),
!.
-flora_user_module_functor(Functor,WS,PF) :-
+flora_user_module_predicate(Functor,Args,WS,Predicate) :-
flora_concat_atoms([FLORA_USER_MODULE_PREFIX,'''',WS,'''',Functor],PF),
- assert(flora_decode_pred(Functor,WS,user,PF)).
-
+ Predicate =.. [PF|Args],
+ length(Args,Arity),
+ length(NewArgs,Arity),
+ PredTemplate =.. [PF|NewArgs],
+ assert(flora_decode_pred(Functor,NewArgs,WS,user,PredTemplate)).
/*****************************************************************************
flora_system_module_predicate(+Functor,+Args,+SysModID,-Predicate)
@@ -57,16 +57,16 @@
to a Flora system module.
*****************************************************************************/
flora_system_module_predicate(Functor,Args,SysModID,Predicate) :-
- flora_system_module_functor(Functor,SysModID,PF),
- Predicate =.. [PF|Args].
-
-flora_system_module_functor(Functor,SysModID,PF) :-
- flora_decode_pred(Functor,SysModID,system,PF),
+ flora_decode_pred(Functor,Args,SysModID,system,Predicate),
!.
-flora_system_module_functor(Functor,SysModID,PF) :-
+flora_system_module_predicate(Functor,Args,SysModID,Predicate) :-
flora_concat_atoms([FLORA_SYSTEM_MODULE_PREFIX,'''',SysModID,'''',Functor],PF),
- assert(flora_decode_pred(Functor,SysModID,system,PF)).
+ Predicate =.. [PF|Args],
+ length(Args,Arity),
+ length(NewArgs,Arity),
+ PredTemplate =.. [PF|NewArgs],
+ assert(flora_decode_pred(Functor,NewArgs,SysModID,system,PredTemplate)).
/*****************************************************************************
flora_module_predicate(+Functor,+Args,+ModuleName,-Predicate)
|