flora-commits Mailing List for Flora-2
Brought to you by:
kifer
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(59) |
Jun
(43) |
Jul
(4) |
Aug
(4) |
Sep
(102) |
Oct
(20) |
Nov
(47) |
Dec
(32) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(24) |
Feb
(34) |
Mar
(72) |
Apr
(36) |
May
(10) |
Jun
(46) |
Jul
(36) |
Aug
(24) |
Sep
(37) |
Oct
(27) |
Nov
(43) |
Dec
(40) |
| 2004 |
Jan
(35) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(30) |
Aug
(83) |
Sep
(68) |
Oct
(38) |
Nov
(3) |
Dec
(7) |
| 2005 |
Jan
(9) |
Feb
(31) |
Mar
(46) |
Apr
(73) |
May
(21) |
Jun
(1) |
Jul
(32) |
Aug
(33) |
Sep
(3) |
Oct
(28) |
Nov
(4) |
Dec
(23) |
| 2006 |
Jan
(22) |
Feb
(2) |
Mar
(12) |
Apr
(23) |
May
(73) |
Jun
(14) |
Jul
|
Aug
(20) |
Sep
(14) |
Oct
(5) |
Nov
|
Dec
(14) |
| 2007 |
Jan
(54) |
Feb
(81) |
Mar
(286) |
Apr
(313) |
May
(154) |
Jun
(85) |
Jul
(8) |
Aug
(11) |
Sep
(12) |
Oct
(14) |
Nov
(6) |
Dec
(6) |
| 2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(12) |
May
(4) |
Jun
|
Jul
(13) |
Aug
(22) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(46) |
Jun
(43) |
Jul
(46) |
Aug
(9) |
Sep
(13) |
Oct
(31) |
Nov
(42) |
Dec
(18) |
| 2014 |
Jan
(7) |
Feb
(7) |
Mar
(11) |
Apr
(13) |
May
(16) |
Jun
(6) |
Jul
(17) |
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
|
| 2015 |
Jan
|
Feb
(17) |
Mar
(4) |
Apr
(3) |
May
(2) |
Jun
(3) |
Jul
(2) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
1
|
|
2
|
3
|
4
|
5
|
6
(5) |
7
(1) |
8
|
|
9
(1) |
10
(10) |
11
|
12
|
13
|
14
|
15
|
|
16
|
17
(2) |
18
|
19
|
20
|
21
|
22
(1) |
|
23
|
24
|
25
|
26
|
27
(2) |
28
|
29
|
|
30
(1) |
|
|
|
|
|
|
|
From: Hui W. <hw...@us...> - 2006-04-30 18:37:00
|
Update of /cvsroot/flora/flora2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1794 Modified Files: flrcoder.P Log Message: fix the bug in building negative number. Index: flrcoder.P =================================================================== RCS file: /cvsroot/flora/flora2/flrcoder.P,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- flrcoder.P 9 Mar 2006 08:58:17 -0000 1.46 +++ flrcoder.P 30 Apr 2006 18:36:50 -0000 1.47 @@ -1855,6 +1855,18 @@ CodeInd=F, Status = [] ; + ( N == 1, (F == (FL_MINUS); F == (FL_PLUS))) -> + Args=[NTerm], + ( is_prnumber(NTerm,Number,_Index) -> + ((F== (FL_PLUS),Code = Number);(F== (FL_MINUS),Code is 0-Number)), + CodeInd = Code, + Status = [] + ; + flora_build_structlist(Args,DWS,Prefix,VarList,ACode,ACodeInd,Status), + Code =.. [F|ACode], + CodeInd =.. [F|ACodeInd] + ) + ; flora_build_structlist(Args,DWS,Prefix,VarList,ACode,ACodeInd,Status), Code =.. [F|ACode], CodeInd =.. [F|ACodeInd] |
|
From: Michael K. <ki...@us...> - 2006-04-27 05:59:14
|
Update of /cvsroot/flora/flora2/flrincludes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15471/flrincludes Modified Files: flora_terms.flh Log Message: typo, added a definition Index: flora_terms.flh =================================================================== RCS file: /cvsroot/flora/flora2/flrincludes/flora_terms.flh,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- flora_terms.flh 10 Apr 2006 21:45:20 -0000 1.63 +++ flora_terms.flh 27 Apr 2006 05:59:03 -0000 1.64 @@ -108,6 +108,7 @@ #define FL_BRACKET '[' #define FL_BRACE '{' +#define FL_QUOTE '''' #define FL_DOUBLEQUOTE '"' #define FL_VARSYM '?' |
|
From: Michael K. <ki...@us...> - 2006-04-27 05:59:14
|
Update of /cvsroot/flora/flora2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15471 Modified Files: flrlexer.P Log Message: typo, added a definition Index: flrlexer.P =================================================================== RCS file: /cvsroot/flora/flora2/flrlexer.P,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- flrlexer.P 22 Dec 2005 22:37:18 -0000 1.18 +++ flrlexer.P 27 Apr 2006 05:59:03 -0000 1.19 @@ -995,7 +995,7 @@ Formats supported: (1) \ followed by x (X) and 1-2 hex symbols; (2) \ followed by escape character (\\ denotes \); - (3) anything else recognized as it is; + (3) anything else recognized as is; (4) double quotes equal to single quote. ****************************************************************************/ read_string(CH_BACKSLASH,LN,CN,LN1,CN1,_,_,Q,Chars,TextChars,LLN,LCN,Tks,Status) :- |
|
From: Michael K. <ki...@us...> - 2006-04-22 04:36:27
|
Update of /cvsroot/flora/flora2/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26498 Modified Files: convert.pl README Log Message: changed messages, explanations Index: README =================================================================== RCS file: /cvsroot/flora/flora2/Misc/README,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- README 7 Apr 2006 06:07:18 -0000 1.3 +++ README 22 Apr 2006 04:36:23 -0000 1.4 @@ -5,35 +5,34 @@ ****** Usage: ****** - cp -r Directory Directory_backup -- back up the directory, which you - want to convert. Otherwise the old - version will be lost. - perl convert.pl Signal Directory -- Signal indicates what convertion - you want. If you want only (1),(2) of - /* what it does */, use "-var_trans"; - if only (3), use "-single_multi"; - if all of (1),(2),(3), use "-all". + cp -r DIRECTORY BACKUP_DIRECTORY + Back up the directory to be converted. + Otherwise the old version will be lost. + perl convert.pl OPTION DIRECTORY + OPTION indicates the convertion to be performed + -var_trans makes the changes (1) and (2) below. + -single_multi does (3). + -all does (1), (2), and (3) -************* -What it does: -************* - Changes all the .flr files in Directory as follows (the program - will recursively descend into directories): +******************* +Types of conversion +******************* + convert.pl modifies all the .flr files in DIRECTORY and its subdirectories + as follows: - (1) Adds a '?' before all the variables + (1) Adds a '?' in front of every FLORA-2 variable (in the old syntax) - (2) Replaces '#' with '%' in procedural predicates and terms. + (2) Replaces '#' with '%' in procedural predicates and methods. (3) Replaces "=>" with "{1:1}=>" and "*=>" with "{1:1}*=>"; Replaces "=>>" with "=>" and "->>" with "->"; Replaces "!!" with "!" and a..b with a.b. -*********** -Exceptions: -*********** +********** +Limitations +********** - (1) This program handles only .flr files. So if FLORA-2 is called - from some other files, the FLORA commands should be changed manually. + (1) This program handles only .flr files. (2) This program may add a '?' before user-defined macros (in #define statements). All the '?'s right before macros should be deleted after @@ -41,9 +40,9 @@ (3) This program doesn't add '?' in comments and quoted text. - (4) There may be some places where # was used other than for specifying - procedural predicates and terms. These #s may have to be restored - from %. + (4) There may be places where # was used other than for specifying + procedural predicates and terms. These #'s may have to be converted + back to %. - (5) There may be other exceptions. If you find any, please contact: + (5) There may be other limitations or bugs. If you find any, please contact: flo...@li... Index: convert.pl =================================================================== RCS file: /cvsroot/flora/flora2/Misc/convert.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- convert.pl 7 Apr 2006 06:07:18 -0000 1.3 +++ convert.pl 22 Apr 2006 04:36:23 -0000 1.4 @@ -5,7 +5,7 @@ # Define Variables if ($ARGV[0] eq "-var_trans" or $ARGV[0] eq "-single_multi" or $ARGV[0] eq "-all") { $signal = $ARGV[0]; } - else { die "Wrong Usage!\n perl convert.pl Signal Directory -- Signal must be -var_trans or -single_multi or -all\n"; } + else { die "Usage:\n perl convert.pl -var_trans|-single_multi|-all DIRECTORY\n"; } if ($ARGV[1] ne "") { $dir = $ARGV[1]; } else { die "Please specify the Directory in which you want to convert .flr files.\n"; } ############################################################################## |
|
From: Michael K. <ki...@us...> - 2006-04-17 20:54:05
|
Update of /cvsroot/flora/flora2/demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29822/demos Modified Files: db_test.flh Log Message: include demos/db_test.flh in the distribution Index: db_test.flh =================================================================== RCS file: /cvsroot/flora/flora2/demos/db_test.flh,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- db_test.flh 26 Sep 2004 10:34:19 -0000 1.1 +++ db_test.flh 17 Apr 2006 20:53:55 -0000 1.2 @@ -1,5 +1,7 @@ #mode standard Prolog +// change these constants as appropriate for your DB installation + #define DSN mydb #define USER_NAME xsb #define PWD root |
|
From: Michael K. <ki...@us...> - 2006-04-17 20:54:05
|
Update of /cvsroot/flora/flora2/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29822/admin Modified Files: ReleaseTarBall.sh Log Message: include demos/db_test.flh in the distribution Index: ReleaseTarBall.sh =================================================================== RCS file: /cvsroot/flora/flora2/admin/ReleaseTarBall.sh,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ReleaseTarBall.sh 2 May 2005 01:11:53 -0000 1.10 +++ ReleaseTarBall.sh 17 Apr 2006 20:53:55 -0000 1.11 @@ -13,6 +13,7 @@ ./flora2/debugger/Makefile ./flora2/debugger/NMakefile.mak \ ./flora2/debugger/*.in ./flora2/debugger/*.P \ ./flora2/demos/*.flr ./flora2/demos/*.sh \ + ./flora2/demos/*.flh \ ./flora2/demos/sgml/*.flr ./flora2/demos/sgml/expectedoutput \ ./flora2/demos/xpath/*.flr ./flora2/demos/xpath/expectedoutput \ ./flora2/demos/Makefile ./flora2/demos/NMakefile.mak \ |
|
From: Michael K. <ki...@us...> - 2006-04-10 21:46:48
|
Update of /cvsroot/flora/flora2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12492 Modified Files: flrparser.P Log Message: took out setsemantics{equality(flogic)} option, which is no longer used Index: flrparser.P =================================================================== RCS file: /cvsroot/flora/flora2/flrparser.P,v retrieving revision 1.97 retrieving revision 1.98 diff -u -d -r1.97 -r1.98 --- flrparser.P 10 Apr 2006 21:38:09 -0000 1.97 +++ flrparser.P 10 Apr 2006 21:46:42 -0000 1.98 @@ -5528,7 +5528,7 @@ valid_semantics_direct_opt_name(FL_CUSTOM). valid_semantics_direct_option(FL_EQUALITY,NONE). valid_semantics_direct_option(FL_EQUALITY,BASIC). -valid_semantics_direct_option(FL_EQUALITY,FLOGIC). +%%valid_semantics_direct_option(FL_EQUALITY,FLOGIC). valid_semantics_direct_option(FL_INHERITANCE,NONE). valid_semantics_direct_option(FL_INHERITANCE,FLOGIC). valid_semantics_direct_option(FL_CUSTOM,NONE). |
|
From: Michael K. <ki...@us...> - 2006-04-10 21:45:32
|
Update of /cvsroot/flora/flora2/syslib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11670/syslib Modified Files: flrdbmodule.P Log Message: fixed bugs in the db interface Index: flrdbmodule.P =================================================================== RCS file: /cvsroot/flora/flora2/syslib/flrdbmodule.P,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- flrdbmodule.P 10 Mar 2006 23:08:21 -0000 1.6 +++ flrdbmodule.P 10 Apr 2006 21:45:20 -0000 1.7 @@ -28,27 +28,28 @@ #include "flora_porting.flh" #define ODBC odbc -#define COLUMN_PREFIX 'c' +#define COLUMN_PREFIX 'col' #define DBHANDLE dbhandle -%%added prefix tbl_ since one of the wrapper names is 'exists', which is a keyword. -#define CREATE_TABLE_PREFIX 'CREATE TABLE tbl_' +#define TABLE_NAME_PREFIX 'tbl_' +#define CREATE_TABLE_PREFIX 'CREATE TABLE ' #define COLUMN_TYPE ' VARCHAR(255) DEFAULT NULL' -#define MAX_TABLE_COUNT 23 -#define SELECT_TABLE_PREFIX ' SELECT ' -#define SELECT_TABLE_SUFFIX ' FROM tbl_' -#define INSERT_TABLE_PREFIX 'INSERT INTO tbl_' -#define DELETE_TABLE_PREFIX 'DELETE FROM tbl_' -#define IS_TUPLE_PRESENT 'SELECT 1 FROM tbl_' +#define SELECT_STATEMENT_PREFIX ' SELECT * FROM ' +#define INSERT_TABLE_PREFIX 'INSERT INTO ' +#define DELETE_TABLE_PREFIX 'DELETE FROM ' +#define IS_TUPLE_PRESENT 'SELECT 1 FROM ' #define FL_TRUE true -%%query types for error messages. +%% query types for error messages. #define DB_CONNECT 'connect to database' #define DB_CREATE 'create database' #define DB_INSERT 'insert into database' #define DB_DELETE 'delete from database' #define DB_SELECT 'query database' +%% char prepended to numbers when they are saved as strings +%% db driver converts such strings back to numbers +#define TERM_CHAR '\255' :- import flora_dbmodule_registry/5, @@ -60,7 +61,7 @@ :- import db_connect/5, db_disconnect/1, - db_sql/4, + db_query/4, db_statement_close/1 from db_interface. :- import @@ -99,23 +100,24 @@ entry corresponding to this module exists in the flora_dbmodule_inmemory, then it implies we have retireved all database information for this module. ****************************************************************************/ -%%module loaded in memory. +%% module loaded in memory. flora_check_db(ModuleName,_Term):- flora_dbmodule_inmemory(ModuleName), - !,fail. + !, + fail. flora_check_db(ModuleName,Term):- flora_dbmodule_registry(ModuleName,_,_,_,_), - fllibdbmodule_get_tbl_name_suffix(ModuleName,Suffix), fllibdbmodule_consruct_query_string(Term,FL_TRUE,N,_ModuleName,Wrapper,_,ColValList), - fllibdbmodule_insert_create_cols(N,ColList), - append([SELECT_TABLE_PREFIX,ColList,SELECT_TABLE_SUFFIX,Wrapper,Suffix,'_',N,' '],ColValList,SQLSelQuery), + make_db_table_name(ModuleName,Wrapper,N,TableName), + SQLSelQuery = [SELECT_STATEMENT_PREFIX, TableName,' '|ColValList], fllibdbmodule_retrieve_db_info(ModuleName,Wrapper,N,SQLSelQuery), flora_db_statement_close(q_db_use), - !,fail. + !, + fail. -%%default, if no db is associated with the module. -flora_check_db(_,_):- !,fail. +%% default, if no db is associated with the module. +flora_check_db(_,_):- !, fail. /**************************************************************************** @@ -134,7 +136,7 @@ flora_storage_check_existence(ModuleName), [dbdrivers], load_driver(ODBC), - %%does a db handle exist for this triplet? + %% does a db handle exist for this triplet? ( flora_dbmodule_handle(DSN,UserName,Password,DBHandle) ; @@ -143,9 +145,9 @@ assert(flora_dbmodule_handle(DSN,UserName,Password,DBHandle)) ), fllibdbmodule_prepare_db(Database,ModuleName,DBHandle), - %%writeln('flora: database setup successful. now adding to the registry'), + %% writeln('flora: database setup successful. now adding to the registry'), assert(flora_dbmodule_registry(ModuleName,Database,DSN,UserName,Password)), - %%add module terms present in the memory into the database. + %% add module's facts found in the memory into the database. fllibdbmodule_memory_to_db(ModuleName). @@ -157,7 +159,7 @@ fllibdbmodule_create_db(DSN,Database,UserName,Password) :- [dbdrivers], load_driver(ODBC), - %%does a db handle exist for this triplet? + %% does a db handle exist for this triplet? ( flora_dbmodule_handle(DSN,UserName,Password,DBHandle) ; @@ -173,63 +175,75 @@ /**************************************************************************** fllibdbmodule_prepare_db(+Database,+ModuleName,+DBHandle) - The workhorse that creates all the required tables. Note that for each - type of table 23 (MAX_TABLE_COUNT) separate tables are created. + Creates all the required tables. Note that for each + type of wrapper separate tables are created. For HiLog wrappers, + a bunch of tables is created for each arity. ****************************************************************************/ fllibdbmodule_prepare_db(Database,ModuleName,DBHandle) :- - %% USE is strictly MySQL -- will need to be fixed + %% USE is not portable -- will need to be fixed UseDbSQL = ['USE ',Database], flora_db_ddl_sql(DBHandle,q_db_use,UseDbSQL,[],DB_CONNECT,Database), - fllibdbmodule_get_tbl_name_suffix(ModuleName,Suffix), - fllibdbmodule_create_tables(WRAP_LIST,Suffix,DBHandle), + fllibdbmodule_create_tables(WRAP_LIST,ModuleName,DBHandle), flora_db_statement_close(q_db_use). -/**************************************************************************** - fllibdbmodule_get_tbl_name_suffix(+TableName,-Suffix) - - returns Suffux = '_<TableName>'. -****************************************************************************/ -fllibdbmodule_get_tbl_name_suffix(TableName,Suffix) :- - atom_concat('_',TableName,Suffix). - /**************************************************************************** - fllibdbmodule_create_tables(+TableList,+Suffix,+DBHandle) + fllibdbmodule_create_tables(+WrapperSpecList,+ModuleName,+DBHandle) - Creates all different types of tables for a particular module. + Creates all tables for storing data in a particular module. ****************************************************************************/ -fllibdbmodule_create_tables([H|T],Suffix,DBHandle) :- - flora_concat_items([CREATE_TABLE_PREFIX,H,Suffix,'_'],TablePrefix), - create_all_tables(DBHandle,TablePrefix,'',1), - fllibdbmodule_create_tables(T,Suffix,DBHandle). +fllibdbmodule_create_tables([H|T],ModuleName,DBHandle) :- + create_tables_for_wrapper(DBHandle,ModuleName,H), + fllibdbmodule_create_tables(T,ModuleName,DBHandle). -fllibdbmodule_create_tables([],_Suffix,_DBHandle) :- true. +fllibdbmodule_create_tables([],_ModuleName,_DBHandle). -/**************************************************************************** - fllibdbmodule_create_tables(+DBHandle,+TablePrefix,+ColumnList,+N) - - Creates 1 ... MAX_TABLE_COUNT tables for a particular type of wrapper. -****************************************************************************/ -create_all_tables(DBHandle,TablePrefix,ColumnList,N) :- - flora_concat_items([TablePrefix,N],TableName), - (N == 1 -> - flora_concat_items([COLUMN_PREFIX,N,COLUMN_TYPE],NewColumnList) - ; - flora_concat_items([ColumnList,',',COLUMN_PREFIX,N,COLUMN_TYPE],NewColumnList) - ), +/* + Creates tables suitable for each wrapper spec. + If wrapper spec is Wrapper=Arity, then create only 1 table of that arity. + If the spec is Wrapper<Arity then create Arity-1 tables of arity + 1,2,..., Arity-1. +*/ +create_tables_for_wrapper(DBHandle, ModuleName, Wrapper<Arity) :- + Arity1 is Arity - 1, + (Arity1 == 0 -> true + ; + create_tables_for_wrapper(DBHandle, ModuleName, Wrapper=Arity1), + create_tables_for_wrapper(DBHandle, ModuleName, Wrapper<Arity1) + ). +create_tables_for_wrapper(DBHandle, ModuleName, Wrapper=Arity) :- + make_db_table_name(ModuleName,Wrapper,Arity,TableName), + flora_concat_items([CREATE_TABLE_PREFIX,TableName], CreateStatPrefix), + make_column_list(Arity,ColList), %% table may already be present. no error in that case. %% however any other db-error is ignored. need to replace this strategy. - catch(db_sql(DBHandle,q_tb,[TableName,'(',NewColumnList,')'],[]), xsb_error(database(Number), Mesg), error_handler(Number, Mesg)), - flora_db_statement_close(q_tb), - ( N == MAX_TABLE_COUNT -> - true - ; - M is N+1, - create_all_tables(DBHandle,TablePrefix,NewColumnList,M) + catch(db_query(DBHandle,q_tb,[CreateStatPrefix,'(',ColList,')'],[]), + xsb_error(database(Number), Mesg), + error_handler(Number, Mesg)), + flora_db_statement_close(q_tb). + +/* + creates string of column specifications: + col1 VARCHAR(255) DEFAULT NULL, col2 VARCHAR(255) DEFAULT NULL, ... + of length Arity +*/ +make_column_list(Arity,ColList) :- + (Arity==1 + -> flora_concat_items([COLUMN_PREFIX,Arity,COLUMN_TYPE],ColList) + ; + Arity1 is Arity - 1, + make_column_list(Arity1,ColList1), + flora_concat_items([ColList1,',',COLUMN_PREFIX,Arity,COLUMN_TYPE], + ColList) ). +make_db_table_name(ModuleName,Wrapper,Arity,TableName) :- + flora_concat_items([TABLE_NAME_PREFIX,Wrapper,'_',ModuleName,'_',Arity], + TableName). + + /**************************************************************************** fllibdbmodule_memory_to_db(+ModuleName) @@ -238,22 +252,22 @@ it's term present in the memory to the database. ****************************************************************************/ fllibdbmodule_memory_to_db(ModuleName) :- - flora_user_fdb_storage_name(ModuleName,ModPred), - %%get the predicates for this module in the memory. - findall(Call,flora_db_find_base(ModPred,Call),CallList), - fllibdbmodule_insert_mem_terms(CallList). + flora_user_fdb_storage_name(ModuleName,StorageName), + %% get the facts for this module, which are found in memory. + findall(Call,flora_db_find_base(StorageName,Call),CallList), + fllibdbmodule_insert_facts_from_memory(CallList). /**************************************************************************** - fllibdbmodule_insert_mem_terms(+TermList) + fllibdbmodule_insert_facts_from_memory(+TermList) Inserts the termlist, from the memory, to the corresponding database table. ****************************************************************************/ -fllibdbmodule_insert_mem_terms([H|T]) :- +fllibdbmodule_insert_facts_from_memory([H|T]) :- fllibdbmodule_insert_internal(H,_), - fllibdbmodule_insert_mem_terms(T). + fllibdbmodule_insert_facts_from_memory(T). -fllibdbmodule_insert_mem_terms([]) :- true. +fllibdbmodule_insert_facts_from_memory([]) :- true. /**************************************************************************** @@ -268,39 +282,40 @@ fllibdbmodule_db_to_memory(ModuleName) :- !, ( - %%check for db association - flora_dbmodule_registry(ModuleName,_,_,_,_) - ; - flora_db_no_associate_error(ModuleName) + %% check for db association + flora_dbmodule_registry(ModuleName,_,_,_,_) + ; + flora_db_no_associate_error(ModuleName) ), - fllibdbmodule_get_tbl_name_suffix(ModuleName,Suffix), - fllibdbmodule_add_tables_to_memory(WRAP_LIST,ModuleName,Suffix), + fllibdbmodule_add_tables_to_memory(WRAP_LIST,ModuleName), flora_db_statement_close(q_db_use), - %%tag that all the db info for this module has been retrieved. + %% indicate that all the db info for this module has been retrieved. assert(flora_dbmodule_inmemory(ModuleName)). /**************************************************************************** - fllibdbmodule_add_tables_to_memory(+TableList,+ModuleName,+Suffix) + fllibdbmodule_add_tables_to_memory(+TableList,+ModuleName) Retrieves the tuples/terms present in the database and asserts them to the memory. ****************************************************************************/ -fllibdbmodule_add_tables_to_memory([H|T],ModuleName,Suffix) :- - get_all_tables(ModuleName,H,Suffix,1), - fllibdbmodule_add_tables_to_memory(T,ModuleName,Suffix). +fllibdbmodule_add_tables_to_memory([H|T],ModuleName) :- + get_tables_for_wrapper(ModuleName,H), + fllibdbmodule_add_tables_to_memory(T,ModuleName). -fllibdbmodule_add_tables_to_memory([],_,_) :- true. +fllibdbmodule_add_tables_to_memory([],_) :- true. -get_all_tables(ModuleName,Wrapper,Suffix,N) :- - fllibdbmodule_insert_create_cols(N,ColList), - fllibdbmodule_retrieve_db_info(ModuleName,Wrapper,N,[SELECT_TABLE_PREFIX,ColList,SELECT_TABLE_SUFFIX,Wrapper,Suffix,'_',N]), - ( N == MAX_TABLE_COUNT -> - true - ; - M is N+1, - get_all_tables(ModuleName,Wrapper,Suffix,M) +get_tables_for_wrapper(ModuleName,Wrapper<Arity) :- + Arity1 is Arity-1, + (Arity1 == 0 -> true + ; + get_tables_for_wrapper(ModuleName,Wrapper=Arity1), + get_tables_for_wrapper(ModuleName,Wrapper<Arity1) ). +get_tables_for_wrapper(ModuleName,Wrapper=Arity) :- + make_db_table_name(ModuleName,Wrapper,Arity,TableName), + fllibdbmodule_retrieve_db_info(ModuleName,Wrapper,Arity, + [SELECT_STATEMENT_PREFIX,TableName]). /**************************************************************************** @@ -312,7 +327,7 @@ fllibdbmodule_retrieve_db_info(ModuleName,Wrapper,N,SelectQ) :- fllibdbmodule_get_db_handle(ModuleName,DBHandle), length(List,N), - findall(List,db_sql(DBHandle,q_select,SelectQ,List),ReturnList), + findall(List,db_query(DBHandle,q_select,SelectQ,List),ReturnList), flora_db_statement_close(q_select), add_to_memory(ModuleName,Wrapper,ReturnList). @@ -323,10 +338,9 @@ Constructs an appropriate predicate and asserts it to the memory. ****************************************************************************/ add_to_memory(ModuleName,Wrapper,[H|T]) :- - flora_user_fdb_storage_name(ModuleName,ModPred), - %%fllibdbmodule_remove_nulls(H,[],List), + flora_user_fdb_storage_name(ModuleName,StorageName), flora_user_module_predicate(Wrapper,H,ModuleName,Predicate), - fllibdbmodule_assert_to_memory(ModPred,Predicate), + fllibdbmodule_assert_to_memory(StorageName,Predicate), add_to_memory(ModuleName,Wrapper,T). add_to_memory(_,_,[]) :- true. @@ -337,8 +351,8 @@ Does the actual insertion to the internal memory. ****************************************************************************/ -fllibdbmodule_assert_to_memory(ModPred,Predicate):- - storage_insert_fact(ModPred,Predicate,_ResultFlag), +fllibdbmodule_assert_to_memory(StorageName,Predicate):- + storage_insert_fact(StorageName,Predicate,_ResultFlag), flora_refresh_tables(Predicate). @@ -352,7 +366,7 @@ fllibdbmodule_insert(Term) :- fllibdbmodule_insert_internal(Term,FL_TRUE). -%%no db association present +%% no db associated with the Term's module fllibdbmodule_insert(_Term) :- true. @@ -363,47 +377,52 @@ using a query say insert{q(a)}. However, the predicate is stored in the memory without the calling module, and hence the memory_to_db predicate calls the insert_internal with CallModPresent uninstantiated (=false). In the normal - scenarion, the value of CallModPresent is set to TRUE and the + scenario, the value of CallModPresent is set to TRUE and the fllibdbmodule_consruct_query_string predicate trims the modulename. ****************************************************************************/ fllibdbmodule_insert_internal(Term,CallModPresent) :- !, fllibdbmodule_consruct_query_string(Term,CallModPresent,N,ModuleName,Wrapper,ValueList,ColValList), fllibdbmodule_get_db_handle(ModuleName,DBHandle), - fllibdbmodule_insert_create_cols(N,String1), - fllibdbmodule_insert_quotes(ValueList,ValQuoteList), - flora_concat_items(['(',String1,')'],ColString), - fllibdbmodule_get_tbl_name_suffix(ModuleName,Suffix), + make_column_string(N,ColString), + fllibdbmodule_insert_quotes(ValueList,ValueListQuoted), + fllibdbmodule_insert_commas(ValueListQuoted,ValListReady), %% Subqueries inside insert are disallowed in some DBMS (eg MySQL). %% So, we do it in two steps. - append([IS_TUPLE_PRESENT,Wrapper,Suffix,'_',N,' '],ColValList,SQLCheckQuery), + make_db_table_name(ModuleName,Wrapper,N,TableName), + SQLCheckQuery = [IS_TUPLE_PRESENT,TableName,' '| ColValList], ( - %%for empty resultset checks, db_sql fails and R is un-initialized - catch(db_sql(DBHandle,qa_chk_ins,SQLCheckQuery,[R]), + %% if empty resultset, db_query fails and R is un-instantiated + catch(db_query(DBHandle,flrdb_qa_chk_ins,SQLCheckQuery,[R]), xsb_error(database(Number), Mesg), error_handler(Number, Mesg)) ; true ), - append([INSERT_TABLE_PREFIX,Wrapper,Suffix,'_',N,' ',ColString,' VALUES('],ValQuoteList,SQLInsertQuery1), + SQLInsertQuery1 = [INSERT_TABLE_PREFIX, + TableName, + '(', + ColString, + ') VALUES(' | ValListReady], append(SQLInsertQuery1,[')'],SQLInsertQuery), (var(R) -> - flora_db_dml_sql(DBHandle,qa_ins,SQLInsertQuery,[],DB_INSERT,Term), - flora_db_statement_close(qa_ins) + flora_db_dml_sql(DBHandle,flrdb_qa_ins, + SQLInsertQuery,[],DB_INSERT,Term), + flora_db_statement_close(flrdb_qa_ins) ; - %%writeln('flora: Object already exits in the database'), + %% writeln('flora: Object already exits in the database'), true ), - flora_db_statement_close(qa_chk_ins). + flora_db_statement_close(flrdb_qa_chk_ins). /**************************************************************************** - fllibdbmodule_insert_create_cols(+N,-ColumnList) + make_column_string(+N,-ColumnList) - Creates a string c1,c2,c3...cn to be used with the insert command. + Creates a string col1,col2,col3...coln to be used with the insert command. ****************************************************************************/ -fllibdbmodule_insert_create_cols(N,ColumnList) :- +make_column_string(N,ColumnList) :- N > 0, N1 is N -1, - fllibdbmodule_insert_create_cols(N1,TailColList), + make_column_string(N1,TailColList), ( N > 1, flora_concat_items([TailColList,',',COLUMN_PREFIX,N],ColumnList) @@ -411,39 +430,54 @@ flora_concat_items([TailColList,COLUMN_PREFIX,N],ColumnList) ). -fllibdbmodule_insert_create_cols(0,'') :- !. +make_column_string(0,'') :- !. /**************************************************************************** - fllibdbmodule_insert_quotes(+Args,-QuoteList) - - Insert quotes(+comma) between two successive elements. + fllibdbmodule_insert_quotes(+ValueList,-ProtectedValList) + Convert each number to a string prepended with TERM_CHAR. + On reading, DB driver would then convert such strings back to numbers + and thus will preserve their type. Atoms are just quoted. + Compound terms are not quotes, since they are handled by the DB driver.. ****************************************************************************/ -fllibdbmodule_insert_quotes([H|T],QuoteList) :- - fllibdbmodule_convert_tail_list_to_str(T,QuoteList1), - append(['''',H,''''],QuoteList1,QuoteList). +fllibdbmodule_insert_quotes([], []). +fllibdbmodule_insert_quotes([H|T], [ProtectedH|T1]) :- + fllibdbmodule_protect_term(H, ProtectedH), + fllibdbmodule_insert_quotes(T,T1). -fllibdbmodule_insert_quotes([],[]) :- !. +fllibdbmodule_protect_term(T, ProtectedT) :- + (number(T) -> + flora_concat_items(['''', TERM_CHAR, T, ''''], ProtectedT) + ; atom(T), T \= [] -> + flora_concat_items(['''', T, ''''], ProtectedT) + ; + ProtectedT = T + ). -fllibdbmodule_convert_tail_list_to_str([H|T],QuoteList) :- - fllibdbmodule_convert_tail_list_to_str(T,QuoteList2), - append([',''',H,''''],QuoteList2,QuoteList). -fllibdbmodule_convert_tail_list_to_str([],[]) :- !. +/************************************************************************* + fllibdbmodule_insert_commas(+List, -CommaSeparatedList) + converts [a,b,c] into [a, ', ', b, ', ', c] +*************************************************************************/ + +fllibdbmodule_insert_commas([], []) :- !. +fllibdbmodule_insert_commas([H], [H]) :- !. +fllibdbmodule_insert_commas([H|T], [H, ', ' |T1]) :- + fllibdbmodule_insert_commas(T,T1). /**************************************************************************** fllibdbmodule_delete(+Term) - Deletes the corresponding term to the database. + Deletes the corresponding term from the database. ****************************************************************************/ fllibdbmodule_delete(Term) :- fllibdbmodule_consruct_query_string(Term,FL_TRUE,N,ModuleName,Wrapper,_,ColValList), fllibdbmodule_get_db_handle(ModuleName,DBHandle), - fllibdbmodule_get_tbl_name_suffix(ModuleName,Suffix), - append([DELETE_TABLE_PREFIX, Wrapper,Suffix,'_',N,' '],ColValList,SQLDelQuery), - flora_db_dml_sql(DBHandle,qa_del,SQLDelQuery,[],DB_DELETE,Term), - flora_db_statement_close(qa_del). + make_db_table_name(ModuleName,Wrapper,N,TableName), + SQLDelQuery = [DELETE_TABLE_PREFIX,TableName,' '|ColValList], + flora_db_dml_sql(DBHandle,flrdb_qa_del,SQLDelQuery,[],DB_DELETE,Term), + flora_db_statement_close(flrdb_qa_del). %% no db associated with the module. deletion fails. fllibdbmodule_delete(_Term) :- fail. @@ -468,36 +502,43 @@ ValueList = [PredicateSymbol|RestList] ), length(ValueList,N), - fllibdbmodule_create_col_val_pairs(ValueList,1,ColValList1), - (ColValList1== [] -> + fllibdbmodule_create_col_val_pairs(ValueList,ColValList1), + (ColValList1 == [] -> ColValList = ColValList1 ; - append([' WHERE '],ColValList1,ColValList) + ColValList = [' WHERE ' | ColValList1] ). /**************************************************************************** - fllibdbmodule_create_col_val_pairs(+Args,+N,-ArgsList) + fllibdbmodule_create_col_val_pairs(+Args,-ArgsList) Converts a list [a1,a2,a3...an] to the form: [c1 = ',a1,' AND c2 = ',a2,' AND c3 = ',a3,....,' AND cn = ',an,'] + If some a_i is a variable - don't include that conjunct. ****************************************************************************/ -fllibdbmodule_create_col_val_pairs([H|T],N,ArgsList) :- - N1 is N + 1, - fllibdbmodule_create_col_val_pairs(T,N1,TailArgsList), +fllibdbmodule_create_col_val_pairs(ValList,ColValList):- + fllibdbmodule_insert_quotes(ValList,ValListQuoted), + fllibdbmodule_create_col_val_pairs(ValListQuoted,1,start,ColValList). + +fllibdbmodule_create_col_val_pairs([H|T],ColNum,IsStart,Pairs) :- + ColNum1 is ColNum + 1, (var(H) -> - ArgsList is TailArgsList %%do not include this attribute - ; - flora_concat_items([COLUMN_PREFIX,N,' = '''],ColName), - ( - N > 1 -> - append(TailArgsList,[ColName,H,''' AND '],ArgsList) + IsStart1 = IsStart, + Pairs = RestPairs % don't include attrs corresponding to vars ; - append(TailArgsList,[ColName,H,''' '],ArgsList) - ) - ). + IsStart1 = continuation, + flora_concat_items([COLUMN_PREFIX,ColNum,' = '],ColName), + ( + IsStart == start -> + Pairs = [ColName,H | RestPairs] + ; + Pairs = [' AND ', ColName,H | RestPairs] + ) + ), + fllibdbmodule_create_col_val_pairs(T,ColNum1,IsStart1,RestPairs). -fllibdbmodule_create_col_val_pairs([],_N,[]) :- !. +fllibdbmodule_create_col_val_pairs([],_,_,[]) :- !. /**************************************************************************** @@ -506,10 +547,10 @@ Obtain the database connect handle for the given FLORA-2 module. ****************************************************************************/ fllibdbmodule_get_db_handle(ModuleName,DBHandle) :- - %%get the db info for the module. - flora_dbmodule_registry(ModuleName,_Database,DSN,UserName,Password), + %% get the db info for the module. + flora_dbmodule_registry(ModuleName,Database,DSN,UserName,Password), flora_dbmodule_handle(DSN,UserName,Password,DBHandle), - %% USE is strictly MySQL -- will need to be fixed + %% USE is not portable -- will need to be fixed UseDbSQL = ['USE ',Database], flora_db_ddl_sql(DBHandle,q_db_use,UseDbSQL,[],DB_CONNECT,Database), flora_db_statement_close(q_db_use). @@ -546,7 +587,7 @@ %% ddl -> 'Data Definition Language'. Queries of the form CREATE TABLE. %% No predicate associated with this type of query. Object = db/ table name flora_db_ddl_sql(Connhandle, QueryHandle, SQLQueryList, ReturnList, QueryType, Object) :- - catch(db_sql(Connhandle, QueryHandle, SQLQueryList, ReturnList), + catch(db_query(Connhandle, QueryHandle, SQLQueryList, ReturnList), xsb_error(database(Number), Mesg), error_handler(Number, Mesg)), (var(Mesg) -> true @@ -555,9 +596,9 @@ ). -%%object = predicate, type = insert/ delete +%% object = predicate, type = insert/ delete flora_db_dml_sql(Connhandle, QueryHandle, SQLQueryList, ReturnList,QueryType,Object) :- - catch(db_sql(Connhandle, QueryHandle, SQLQueryList, ReturnList), + catch(db_query(Connhandle, QueryHandle, SQLQueryList, ReturnList), xsb_error(database(Number), Mesg), error_handler(Number, Mesg)), (var(Mesg) -> true @@ -566,11 +607,15 @@ ). -%%currently not being handled. +%% currently not being handled. flora_db_statement_close(QueryHandle) :- - catch(db_statement_close(QueryHandle), xsb_error(database(Number), Mesg), error_handler(Number, Mesg)). + catch(db_statement_close(QueryHandle), + xsb_error(database(Number), Mesg), + error_handler(Number, Mesg)). flora_db_disconnect(Handle) :- - catch(db_disconnect(Handle), xsb_error(database(Number), Mesg), error_handler(Number, Mesg)). + catch(db_disconnect(Handle), + xsb_error(database(Number), Mesg), + error_handler(Number, Mesg)). -%%dummy method. acts as a placeholder +%% dummy method. acts as a placeholder error_handler(_N,_M):- true. |
|
From: Michael K. <ki...@us...> - 2006-04-10 21:45:27
|
Update of /cvsroot/flora/flora2/flrincludes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11670/flrincludes Modified Files: flora_terms.flh Log Message: fixed bugs in the db interface Index: flora_terms.flh =================================================================== RCS file: /cvsroot/flora/flora2/flrincludes/flora_terms.flh,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- flora_terms.flh 10 Mar 2006 23:08:21 -0000 1.62 +++ flora_terms.flh 10 Apr 2006 21:45:20 -0000 1.63 @@ -649,7 +649,44 @@ #define WRAP_DIFFOBJEQL diffobjeql -#define WRAP_LIST [WRAP_TABLED_HILOG, WRAP_HILOG,WRAP_ISA, WRAP_SUB, WRAP_METH, WRAP_IMETH, WRAP_TRANSIG, WRAP_ITRANSIG, WRAP_BOOLSIG, WRAP_IBOOLSIG, WRAP_TRAN, WRAP_MVD,WRAP_IMVD, WRAP_MVDSIG, WRAP_MVDSIGDEF, WRAP_MVDCON, WRAP_MVDCONDEF, WRAP_IMVDSIG, WRAP_IMVDSIGDEF, WRAP_IMVDCON, WRAP_IMVDCONDEF, WRAP_EXISTS, WRAP_MVDDEF, WRAP_IMVDDEF, WRAP_OBJEQL] +/* + List of data wrappers used in FLORA-2 along with the arity (excluding the + caller arguments and such). + + These are used to tell flrdbmodule.P which tables to create in the database. + + wrap=arity denotes the arity of the wrapper. + wrap < Number means that Number-1 is the max arity of the wrapper + supported in FLORA-2. The latter is used for HiLog only. + + Only base wrappers are included. The derived ones, like WRAP_MVDSIGDEF, + WRAP_IMVDSIGDEF, WRAP_MVDCONDEF, WRAP_IMVDCONDEF are not included, since + they are never stored. +*/ +#define MAX_HILOG_ARITY 24 +#define WRAP_LIST [WRAP_TABLED_HILOG<MAX_HILOG_ARITY, \ + WRAP_HILOG<MAX_HILOG_ARITY, \ + WRAP_ISA=2, \ + WRAP_SUB=2, \ + WRAP_METH=2, \ + WRAP_IMETH=2, \ + WRAP_TRANSIG=2, \ + WRAP_ITRANSIG=2, \ + WRAP_BOOLSIG=2, \ + WRAP_IBOOLSIG=2, \ + WRAP_TRAN=2, \ + WRAP_MVD=3, \ + WRAP_IMVD=3, \ + WRAP_MVDSIG=3, \ + WRAP_MVDSIGDEF=2, \ + WRAP_MVDCON=4, \ + WRAP_IMVDSIG=3, \ + WRAP_IMVDSIGDEF=2, \ + WRAP_IMVDCON=4, \ + WRAP_EXISTS=1, \ + WRAP_MVDDEF=2, \ + WRAP_IMVDDEF=2, \ + WRAP_OBJEQL=2] /* Wrapper names that occur in the body of the compiled rules that come |
|
From: Michael K. <ki...@us...> - 2006-04-10 21:44:22
|
Update of /cvsroot/flora/flora2/demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10851/demos Modified Files: benchmark.flr Log Message: took out setsemantics{equality(flogic)} option, which is no longer used Index: benchmark.flr =================================================================== RCS file: /cvsroot/flora/flora2/demos/benchmark.flr,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- benchmark.flr 22 Dec 2005 22:37:18 -0000 1.10 +++ benchmark.flr 10 Apr 2006 21:44:12 -0000 1.11 @@ -17,7 +17,7 @@ *********************************************************************/ -:- setsemantics{equality(flogic)}. +:- setsemantics{equality(basic)}. a1:=:b1. |
|
From: Michael K. <ki...@us...> - 2006-04-10 21:43:39
|
Update of /cvsroot/flora/flora2/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10317/includes Modified Files: flrtrailer.flh Log Message: took out setsemantics{equality(flogic)} option, which is no longer used Index: flrtrailer.flh =================================================================== RCS file: /cvsroot/flora/flora2/includes/flrtrailer.flh,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- flrtrailer.flh 26 Sep 2004 03:58:45 -0000 1.5 +++ flrtrailer.flh 10 Apr 2006 21:43:34 -0000 1.6 @@ -60,7 +60,7 @@ #endif -%% F-logic equality +%% F-logic equality - DEPRECATED #ifdef EQUALITYflogic #ifdef INHERITANCEflogic #include "flreqltrailer_inh.flh" |
|
From: Michael K. <ki...@us...> - 2006-04-10 21:43:11
|
Update of /cvsroot/flora/flora2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9785 Modified Files: version.flh flrutils.P flrundefined.P flrporting.P flrcomposer.P Log Message: better organized the closure axioms Index: flrundefined.P =================================================================== RCS file: /cvsroot/flora/flora2/flrundefined.P,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- flrundefined.P 9 Mar 2006 08:58:17 -0000 1.30 +++ flrundefined.P 10 Apr 2006 21:43:00 -0000 1.31 @@ -785,12 +785,12 @@ _WPrefix, _PSymbol, _AList), flora_module_type_and_name(MName,ModuleType,ModuleName), flora_decode_goal_as_atom(Predicate,PrintablePred), - flora_concat_items(['Attempt to ', QueryType,' ',PrintablePred],QueryMsg), + flora_concat_items(['Attempt to ', QueryType,' the fact ',PrintablePred],QueryMsg), ( ModuleType==system -> flora_concat_items([QueryMsg, ' in system module ', ModuleName], ErrorMsg) ; - flora_concat_items([QueryMsg, PrintablePred,' in user module ', ModuleName], + flora_concat_items([QueryMsg, ' in user module ', ModuleName], ErrorMsg) ), flora_concat_items([ErrorMsg,' failed because of the following :',SQLError],SQLErrorMsg), Index: flrcomposer.P =================================================================== RCS file: /cvsroot/flora/flora2/flrcomposer.P,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- flrcomposer.P 17 Oct 2005 05:25:33 -0000 1.9 +++ flrcomposer.P 10 Apr 2006 21:43:00 -0000 1.10 @@ -969,7 +969,7 @@ solve_right(TS,[BRACE(B1,N1)|OS],N2,B2,Term,Status) :- !, ( B1 \== B2 -> - report_error(N1,N2,UNMATCHED_RIGHT), + report_error(N1,N2,UNMATCHED_LEFT), fail ; TS=[OPRND(O),BRACE(B1,N1),FUNCT(F)|Opnds] -> Index: flrutils.P =================================================================== RCS file: /cvsroot/flora/flora2/flrutils.P,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- flrutils.P 9 Apr 2006 07:09:19 -0000 1.68 +++ flrutils.P 10 Apr 2006 21:43:00 -0000 1.69 @@ -2999,7 +2999,7 @@ delete_from_list(FLOBJEQLDEF,TrailerOptions,TrailerOptions1), /* %% This makes :=: in the head to override the explicit - %% equality(non) option, but our stated policy is that + %% equality(none) option, but our stated policy is that %% the explicit directive overrides the implicit ones (member(FL_EQUALITY(EqType),TrailerOptions1) -> Index: flrporting.P =================================================================== RCS file: /cvsroot/flora/flora2/flrporting.P,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- flrporting.P 24 Jan 2006 06:08:16 -0000 1.24 +++ flrporting.P 10 Apr 2006 21:43:00 -0000 1.25 @@ -42,7 +42,10 @@ file_writequoted/2, file_puttoken/3 from machine. -:- import substring/4 from string. +:- import + substring/4, + term_to_atom/3 + from string. :- import library_directory/1 from usermod. :- import xsb_configuration/2 from xsb_configuration. :- import @@ -85,7 +88,9 @@ flora_convert_win_path_to_cygwin/2. -flora_term_to_atom(Term,Atom) :- fmt_write_string(Atom,'%S',arg(Term)). +flora_term_to_atom(Term,Atom) :- + term_to_atom(Term,Atom,[ignore_ops(canonical),quoted(false)]). + %%fmt_write_string(Atom,'%S',arg(Term)). %% This concats items or any type - atoms, numbers, etc. %% Make the most common case fast! @@ -93,7 +98,8 @@ !, fmt_write_string(Atom, '%S%S', arg(Item1,Item2)). flora_concat_items([Item|ItemList],Atom) :- - fmt_write_string(Atom1, '%S', arg(Item)), + %%fmt_write_string(Atom1, '%S', arg(Item)), + flora_term_to_atom(Item,Atom1), flora_concat_items(ItemList,Atom2), atom_concat(Atom1,Atom2,Atom). flora_concat_items([],''). Index: version.flh =================================================================== RCS file: /cvsroot/flora/flora2/version.flh,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- version.flh 21 Nov 2005 05:44:30 -0000 1.18 +++ version.flh 10 Apr 2006 21:43:00 -0000 1.19 @@ -1,2 +1,2 @@ -#define FLORA_VERSION '0.95devel (Androcymbium) of November 2005' +#define FLORA_VERSION '0.95devel (Androcymbium) of April 2006' |
|
From: Michael K. <ki...@us...> - 2006-04-10 21:43:08
|
Update of /cvsroot/flora/flora2/closure In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9785/closure Modified Files: flrtypes.fli flrscalareql.fli flrnoeqltrailer_inh.fli flrnoeqltrailer.fli flreqltrailer_inh.fli flreqltrailer.fli Log Message: better organized the closure axioms Index: flrscalareql.fli =================================================================== RCS file: /cvsroot/flora/flora2/closure/flrscalareql.fli,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- flrscalareql.fli 25 Dec 2005 15:14:55 -0000 1.5 +++ flrscalareql.fli 10 Apr 2006 21:43:00 -0000 1.6 @@ -11,8 +11,8 @@ ***************************************************************************/ -/********* -%this trailer is disabled since there are no fds now. +%% this trailer is disabled since we decided not to infer +%% equality for scalar attributes #include "flora_wspredicates.flh" @@ -34,4 +34,3 @@ inferred_ifd(O1,M,X,_Caller), inferred_ifd(O2,M,Y,_Caller), X \= Y. -***********/ Index: flreqltrailer_inh.fli =================================================================== RCS file: /cvsroot/flora/flora2/closure/flreqltrailer_inh.fli,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- flreqltrailer_inh.fli 9 Mar 2006 08:58:17 -0000 1.6 +++ flreqltrailer_inh.fli 10 Apr 2006 21:43:00 -0000 1.7 @@ -99,8 +99,16 @@ inferred_isa_eql(O,C,CallerInfo). isa(O,C,CallerInfo) :- + nonvar(C), var(O), + !, + silent_sub(S,C,CallerInfo), + inferred_isa_eql(O,S,CallerInfo). + +%% The order of inferred_isa/silent_sub is important. Otherwise, it won't +%% return correct answers in cases like a:(b,c). ?- a:?X. +isa(O,C,CallerInfo) :- inferred_isa_eql(O,S,CallerInfo), - sub(S,C,CallerInfo). + silent_sub(S,C,CallerInfo). /***************************************************************************** @@ -157,6 +165,9 @@ inferred_imvddef(C,MX,CallerInfo). +/*************************************************************************** + closure for X[Y->Z], X[Y*->Z], X[] +/***************************************************************************/ %% inferred_mvd_eql/4 inferred_mvd_eql(O,M,V,CallerInfo) :- inferred_mvd(O,M,V,CallerInfo). @@ -225,7 +236,7 @@ inferred_imeth(CX,MX,CallerInfo). -%% inferred_imeth_eql/3 +%% inferred_meth_eql/3 inferred_meth_eql(O,M,CallerInfo) :- inferred_meth(O,M,CallerInfo). @@ -246,7 +257,7 @@ /***************************************************************************** inheritable methods that are locally defined - The argument "MethSign" is in the form of Funct/Arity/Type. + The argument "MethSign" has the form of Funct/Arity/Type. *****************************************************************************/ %% local_imvd/3 local_imvd(S,MethSign,CallerInfo) :- @@ -452,6 +463,7 @@ isa(O,C,CallerInfo), imeth(C,M,CallerInfo). */ + meth(O,M,CallerInfo) :- var(M), !, Index: flrnoeqltrailer.fli =================================================================== RCS file: /cvsroot/flora/flora2/closure/flrnoeqltrailer.fli,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- flrnoeqltrailer.fli 9 Mar 2006 08:58:17 -0000 1.12 +++ flrnoeqltrailer.fli 10 Apr 2006 21:43:00 -0000 1.13 @@ -48,13 +48,26 @@ /*************************************************************************** closure rules for O:C ***************************************************************************/ +%% isa/3 isa(O,C,CallerInfo) :- inferred_isa(O,C,CallerInfo). isa(O,C,CallerInfo) :- + nonvar(C), var(O), + !, silent_sub(S,C,CallerInfo), inferred_isa(O,S,CallerInfo). +%% The order of inferred_isa/silent_sub is important. Otherwise, it won't +%% return correct answers in cases like a:(b,c). ?- a:?X. +isa(O,C,CallerInfo) :- + inferred_isa(O,S,CallerInfo), + silent_sub(S,C,CallerInfo). + + +/***************************************************************************** + closure for X[Y->Z], X[Y*->Z], X[] +*****************************************************************************/ imvd(C,M,V,CallerInfo) :- inferred_imvd(C,M,V,CallerInfo). @@ -65,11 +78,14 @@ inferred_mvddef(O,M,CallerInfo). mvddef(O,M,CallerInfo) :- - nonvar(M), % the cut above might not work under local scheduling + nonvar(M), mvd(O,M,_V,CallerInfo). %% Should have a cut here when XSB will allow +/***************************************************************************** + monotonic inheritance of binary attributes (tabled methods) +*****************************************************************************/ meth(O,M,CallerInfo) :- inferred_meth(O,M,CallerInfo). @@ -87,6 +103,7 @@ /***************************************************************************** monotonic inheritance of signatures *****************************************************************************/ +%% mvdsig/4 mvdsig(O,M,R,CallerInfo) :- inferred_mvdsig(O,M,R,CallerInfo). @@ -94,6 +111,8 @@ isa(O,C,CallerInfo), imvdsig(C,M,R,CallerInfo). + +%% mvdcondef/5 mvdcondef(C,M,L,H,CallerInfo) :- inferred_mvdcondef(C,M,L,H,CallerInfo). @@ -101,6 +120,7 @@ isa(O,C,CallerInfo), imvdcondef(C,M,L,H,CallerInfo). +%% mvdsigdef/3 mvdsigdef(O,M,CallerInfo) :- inferred_mvdsigdef(O,M,CallerInfo). @@ -113,6 +133,7 @@ %% Should have a cut here when XSB will allow +%% imvdsig/4 imvdsig(C,M,R,CallerInfo) :- inferred_imvdsig(C,M,R,CallerInfo). @@ -120,6 +141,8 @@ inheritance_sub(C,S,CallerInfo), imvdsig(S,M,R,CallerInfo). + +%% imvdcondef/5 imvdcondef(C,M,L,H,CallerInfo) :- inferred_imvdcondef(C,M,L,H,CallerInfo). @@ -127,6 +150,7 @@ inheritance_sub(C,S,CallerInfo), imvdcondef(S,M,L,H,CallerInfo). +%% imvdsigdef/3 imvdsigdef(C,M,CallerInfo) :- inferred_imvdsigdef(C,M,CallerInfo). @@ -139,6 +163,7 @@ %% Should have a cut here when XSB will allow +%% boolsig/3 boolsig(O,M,CallerInfo) :- inferred_boolsig(O,M,CallerInfo). @@ -146,6 +171,8 @@ isa(O,C,CallerInfo), iboolsig(C,M,CallerInfo). + +%% iboolsig/3 iboolsig(C,M,CallerInfo) :- inferred_iboolsig(C,M,CallerInfo). @@ -153,6 +180,8 @@ inheritance_sub(C,S,CallerInfo), iboolsig(S,M,CallerInfo). + +%% transig/3 transig(O,M,CallerInfo) :- inferred_transig(O,M,CallerInfo). @@ -160,6 +189,8 @@ isa(O,C,CallerInfo), itransig(C,M,CallerInfo). + +%% itransig/3 itransig(C,M,CallerInfo) :- inferred_itransig(C,M,CallerInfo). @@ -167,6 +198,7 @@ inheritance_sub(C,S,CallerInfo), itransig(S,M,CallerInfo). + /***************************************************************************** object existence *****************************************************************************/ @@ -178,6 +210,7 @@ equality maintenance Here we just treat :=: as an ordinary relation. *****************************************************************************/ +%% Means X,Y are equal, but not identical diffobjeql(X,Y,CallerInfo) :- inferred_objeql(X,Y,CallerInfo), X \= Y. Index: flrnoeqltrailer_inh.fli =================================================================== RCS file: /cvsroot/flora/flora2/closure/flrnoeqltrailer_inh.fli,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- flrnoeqltrailer_inh.fli 9 Mar 2006 08:58:17 -0000 1.7 +++ flrnoeqltrailer_inh.fli 10 Apr 2006 21:43:00 -0000 1.8 @@ -56,13 +56,22 @@ /*************************************************************************** closure rules for O:C ***************************************************************************/ +%% isa/3 isa(O,C,CallerInfo) :- inferred_isa(O,C,CallerInfo). isa(O,C,CallerInfo) :- + nonvar(C), var(O), + !, silent_sub(S,C,CallerInfo), inferred_isa(O,S,CallerInfo). +%% The order of inferred_isa/silent_sub is important. Otherwise, it won't +%% return correct answers in cases like a:(b,c). ?- a:?X. +isa(O,C,CallerInfo) :- + inferred_isa(O,S,CallerInfo), + silent_sub(S,C,CallerInfo). + /***************************************************************************** inheritable methods that are locally defined @@ -150,6 +159,7 @@ /***************************************************************************** + closure for X[Y->Z], X[Y*->Z], X[] nonmonotonic multiple inheritance of multivalued attributes from superclasses to subclasses *****************************************************************************/ @@ -273,6 +283,7 @@ isa(O,C,CallerInfo), imeth(C,M,CallerInfo). */ + meth(O,M,CallerInfo) :- var(M), !, @@ -303,6 +314,7 @@ inheritance_sub(C,S,CallerInfo), imeth(S,M,CallerInfo). */ + imeth(C,M,CallerInfo) :- var(M), !, @@ -335,6 +347,7 @@ /***************************************************************************** monotonic inheritance of signatures *****************************************************************************/ +%% mvdsig/4 mvdsig(O,M,R,CallerInfo) :- inferred_mvdsig(O,M,R,CallerInfo). @@ -342,6 +355,8 @@ isa(O,C,CallerInfo), imvdsig(C,M,R,CallerInfo). + +%% mvdcondef/5 mvdcondef(C,M,L,H,CallerInfo) :- inferred_mvdcondef(C,M,L,H,CallerInfo). @@ -349,6 +364,7 @@ isa(O,C,CallerInfo), imvdcondef(C,M,L,H,CallerInfo). +%% mvdsigdef/3 mvdsigdef(O,M,CallerInfo) :- inferred_mvdsigdef(O,M,CallerInfo). @@ -361,6 +377,7 @@ %% Should have a cut here when XSB will allow +%% imvdsig/4 imvdsig(C,M,R,CallerInfo) :- inferred_imvdsig(C,M,R,CallerInfo). @@ -368,6 +385,8 @@ inheritance_sub(C,S,CallerInfo), imvdsig(S,M,R,CallerInfo). + +%% imvdcondef/5 imvdcondef(C,M,L,H,CallerInfo) :- inferred_imvdcondef(C,M,L,H,CallerInfo). @@ -375,6 +394,7 @@ inheritance_sub(C,S,CallerInfo), imvdcondef(S,M,L,H,CallerInfo). +%% imvdsigdef/3 imvdsigdef(C,M,CallerInfo) :- inferred_imvdsigdef(C,M,CallerInfo). @@ -387,6 +407,7 @@ %% Should have a cut here when XSB will allow +%% boolsig/3 boolsig(O,M,CallerInfo) :- inferred_boolsig(O,M,CallerInfo). @@ -394,6 +415,8 @@ isa(O,C,CallerInfo), iboolsig(C,M,CallerInfo). + +%% iboolsig/3 iboolsig(C,M,CallerInfo) :- inferred_iboolsig(C,M,CallerInfo). @@ -401,6 +424,8 @@ inheritance_sub(C,S,CallerInfo), iboolsig(S,M,CallerInfo). + +%% transig/3 transig(O,M,CallerInfo) :- inferred_transig(O,M,CallerInfo). @@ -408,6 +433,8 @@ isa(O,C,CallerInfo), itransig(C,M,CallerInfo). + +%% itransig/3 itransig(C,M,CallerInfo) :- inferred_itransig(C,M,CallerInfo). @@ -415,6 +442,7 @@ inheritance_sub(C,S,CallerInfo), itransig(S,M,CallerInfo). + /***************************************************************************** object existence *****************************************************************************/ @@ -426,6 +454,7 @@ equality maintenance Here we just treat :=: as an ordinary relation. *****************************************************************************/ +%% Means X,Y are equal, but not identical diffobjeql(X,Y,CallerInfo) :- inferred_objeql(X,Y,CallerInfo), X \= Y. Index: flreqltrailer.fli =================================================================== RCS file: /cvsroot/flora/flora2/closure/flreqltrailer.fli,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- flreqltrailer.fli 9 Mar 2006 08:58:17 -0000 1.23 +++ flreqltrailer.fli 10 Apr 2006 21:43:00 -0000 1.24 @@ -9,7 +9,7 @@ This is a template file to generate the FLORA trailer with equality maintenance and NO behavioral inheritance. - Inheritance of signatures is still preserved + Inheritance of signatures is still supported. ***************************************************************************/ @@ -90,8 +90,16 @@ inferred_isa_eql(O,C,CallerInfo). isa(O,C,CallerInfo) :- + nonvar(C), var(O), + !, + silent_sub(S,C,CallerInfo), + inferred_isa_eql(O,S,CallerInfo). + +%% The order of inferred_isa/silent_sub is important. Otherwise, it won't +%% return correct answers in cases like a:(b,c). ?- a:?X. +isa(O,C,CallerInfo) :- inferred_isa_eql(O,S,CallerInfo), - sub(S,C,CallerInfo). + silent_sub(S,C,CallerInfo). /***************************************************************************** @@ -148,6 +156,9 @@ inferred_imvddef(C,MX,CallerInfo). +/*************************************************************************** + closure for X[Y->Z], X[Y*->Z], X[] +/***************************************************************************/ %% inferred_mvd_eql/4 inferred_mvd_eql(O,M,V,CallerInfo) :- inferred_mvd(O,M,V,CallerInfo). @@ -198,6 +209,41 @@ diffobjeql(M,MX,CallerInfo), inferred_mvddef(O,MX,CallerInfo). +%% inferred_imeth_eql/3 +inferred_imeth_eql(C,M,CallerInfo) :- + inferred_imeth(C,M,CallerInfo). + +inferred_imeth_eql(C,M,CallerInfo) :- + diffobjeql(C,CX,CallerInfo), + inferred_imeth(CX,M,CallerInfo). + +inferred_imeth_eql(C,M,CallerInfo) :- + diffobjeql(M,MX,CallerInfo), + inferred_imeth(C,MX,CallerInfo). + +inferred_imeth_eql(C,M,CallerInfo) :- + diffobjeql(C,CX,CallerInfo), + diffobjeql(M,MX,CallerInfo), + inferred_imeth(CX,MX,CallerInfo). + + +%% inferred_meth_eql/3 +inferred_meth_eql(O,M,CallerInfo) :- + inferred_meth(O,M,CallerInfo). + +inferred_meth_eql(O,M,CallerInfo) :- + diffobjeql(O,OX,CallerInfo), + inferred_meth(OX,M,CallerInfo). + +inferred_meth_eql(O,M,CallerInfo) :- + diffobjeql(M,MX,CallerInfo), + inferred_meth(O,MX,CallerInfo). + +inferred_meth_eql(O,M,CallerInfo) :- + diffobjeql(O,OX,CallerInfo), + diffobjeql(M,MX,CallerInfo), + inferred_meth(OX,MX,CallerInfo). + /***************************************************************************** regular wrappers @@ -209,6 +255,7 @@ inferred_imvddef_eql(C,M,CallerInfo). imvddef(C,M,CallerInfo) :- + nonvar(M), imvd(C,M,_V,CallerInfo). %% Should have a cut here when XSB will allow @@ -219,44 +266,20 @@ inferred_mvddef_eql(O,M,CallerInfo). mvddef(O,M,CallerInfo) :- - nonvar(M), % the cut above might not work under local scheduling + nonvar(M), mvd(O,M,_V,CallerInfo). %% Should have a cut here when XSB will allow +/***************************************************************************** + monotonic inheritance of binary attributes (tabled methods) +*****************************************************************************/ meth(O,M,CallerInfo) :- - inferred_meth(O,M,CallerInfo). - -meth(O,M,CallerInfo) :- - diffobjeql(O,OX,CallerInfo), - inferred_meth(OX,M,CallerInfo). - -meth(O,M,CallerInfo) :- - diffobjeql(M,MX,CallerInfo), - inferred_meth(O,MX,CallerInfo). - -meth(O,M,CallerInfo) :- - diffobjeql(O,OX,CallerInfo), - diffobjeql(M,MX,CallerInfo), - inferred_meth(OX,MX,CallerInfo). + inferred_meth_eql(O,M,CallerInfo). %% imeth/3 imeth(C,M,CallerInfo) :- - inferred_imeth(C,M,CallerInfo). - -imeth(C,M,CallerInfo) :- - diffobjeql(C,CX,CallerInfo), - inferred_imeth(CX,M,CallerInfo). - -imeth(C,M,CallerInfo) :- - diffobjeql(M,MX,CallerInfo), - inferred_imeth(C,MX,CallerInfo). - -imeth(C,M,CallerInfo) :- - diffobjeql(C,CX,CallerInfo), - diffobjeql(M,MX,CallerInfo), - inferred_imeth(CX,MX,CallerInfo). - + inferred_imeth_eql(C,M,CallerInfo). /***************************************************************************** nontabled methods (transactions) @@ -407,6 +430,7 @@ isa(O,C,CallerInfo), imvdcondef(C,M,L,H,CallerInfo). + %% mvdsigdef/3 mvdsigdef(O,M,CallerInfo) :- inferred_mvdsigdef(O,M,CallerInfo). Index: flrtypes.fli =================================================================== RCS file: /cvsroot/flora/flora2/closure/flrtypes.fli,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- flrtypes.fli 9 May 2005 00:31:21 -0000 1.9 +++ flrtypes.fli 10 Apr 2006 21:43:00 -0000 1.10 @@ -29,20 +29,18 @@ %% The glb rule FLTRAILERPREFIX(sub)(X, (C1,C2),_Caller) :- \+flora_optimizer_registry(FLORA_CLASS_EXPRESSIONS,'FLORA_THIS_MODULE_NAME'), - (C1 \= (_,_) -> true ; ground(C1)), - (C2 \= (_,_) -> true ; ground(C2)), + (C1 \= (_,_), C1 \= (_;_), C1 \= (_-_) -> true ; ground(C1)), + (C2 \= (_,_), C2 \= (_;_), C2 \= (_-_) -> true ; ground(C2)), sub(X,C1,_Caller), sub(X,C2,_Caller), X \= (C1,C2), X \= (C2,C1). FLTRAILERPREFIX(sub)((C1,C2),C1,_Caller) :- \+flora_optimizer_registry(FLORA_CLASS_EXPRESSIONS,'FLORA_THIS_MODULE_NAME'), - (C1 \= (_,_) -> true ; ground(C1)), - (C2 \= (_-_) -> true ; ground(C2)). + (C1 \= (_,_), C1 \= (_;_), C1 \= (_-_) -> true ; ground(C1)). FLTRAILERPREFIX(sub)((C1,C2),C2,_Caller) :- \+flora_optimizer_registry(FLORA_CLASS_EXPRESSIONS,'FLORA_THIS_MODULE_NAME'), - (C1 \= (_-_) -> true ; ground(C1)), - (C2 \= (_,_) -> true ; ground(C2)). + (C2 \= (_,_), C2 \= (_;_), C2 \= (_-_) -> true ; ground(C2)). %% Restrictions on C1, C2 are precautions against infinite loops %% due to things like (symbol,(symbol,(symbol,...)...)) @@ -58,17 +56,17 @@ %% The lub rule FLTRAILERPREFIX(sub)((C1;C2),X,_Caller) :- \+flora_optimizer_registry(FLORA_CLASS_EXPRESSIONS,'FLORA_THIS_MODULE_NAME'), - (C1 \= (_;_) -> true ; ground(C1)), - (C2 \= (_;_) -> true ; ground(C2)), + (C1 \= (_;_), C1 \= (_,_), C1 \= (_-_) -> true ; ground(C1)), + (C2 \= (_;_), C2 \= (_,_), C2 \= (_-_) -> true ; ground(C2)), sub(C1,X,_Caller), sub(C2,X,_Caller), X \= (C1;C2), X \= (C2;C1). FLTRAILERPREFIX(sub)(C1,(C1;C2),_Caller) :- \+flora_optimizer_registry(FLORA_CLASS_EXPRESSIONS,'FLORA_THIS_MODULE_NAME'), - (C1 \= (_;_) -> true ; ground(C1)). + (C1 \= (_;_), C1 \= (_,_), C1 \= (_-_) -> true ; ground(C1)). FLTRAILERPREFIX(sub)(C2,(C1;C2),_Caller) :- \+flora_optimizer_registry(FLORA_CLASS_EXPRESSIONS,'FLORA_THIS_MODULE_NAME'), - (C2 \= (_;_) -> true ; ground(C2)). + (C2 \= (_;_), C2 \= (_,_), C2 \= (_-_) -> true ; ground(C2)). %% C2 must be ground, since they are under NOT @@ -79,8 +77,7 @@ FLORA_TNOT(isa(X,C2,_Caller)). FLTRAILERPREFIX(sub)((C1-C2),C1,_Caller) :- \+flora_optimizer_registry(FLORA_CLASS_EXPRESSIONS,'FLORA_THIS_MODULE_NAME'), - (C1 \= (_-_) -> true ; ground(C1)), - (C2 \= (_,_) -> true ; ground(C2)). + (C1 \= (_-_), C1 \= (_;_), C1 \= (_,_) -> true ; ground(C1)). /********************* End of standard type definitions *******************/ |
|
From: Michael K. <ki...@us...> - 2006-04-10 21:40:06
|
Update of /cvsroot/flora/flora-testsuite/general_tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7668/general_tests Modified Files: ruleupdates.flr prolog_tests_old prolog_tests.flr Log Message: some minor fixes Index: ruleupdates.flr =================================================================== RCS file: /cvsroot/flora/flora-testsuite/general_tests/ruleupdates.flr,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ruleupdates.flr 22 Dec 2005 23:31:10 -0000 1.10 +++ ruleupdates.flr 10 Apr 2006 21:39:52 -0000 1.11 @@ -1,8 +1,7 @@ -/* tc/2 is tabled*/ %e(a,b). %e(b,c). %e(c,d). -?- ?M=?_Mod, ?_Mod=mod1, insertrule_a{((tc(?X,?Y) :- %e(?X,?Y)@_@)@?_Mod), +?- ?_Mod=mod1, insertrule_a{((tc(?X,?Y) :- %e(?X,?Y)@_@)@?_Mod), ((tc(?X,?Y) :- tc(?X,?Z),%e(?Z,?Y)@_@)@?_Mod) }. ?- tc(?X,?Y)@mod1, %fmt_write('query1: tc(%S,%S)\n',arg(?X,?Y))@flora(io). @@ -69,5 +68,3 @@ ?- if aa(?X) then writeln('query17: wrong answer')@prolog() else writeln('query17: no answers')@prolog(). - - Index: prolog_tests.flr =================================================================== RCS file: /cvsroot/flora/flora-testsuite/general_tests/prolog_tests.flr,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- prolog_tests.flr 25 Dec 2005 16:08:25 -0000 1.11 +++ prolog_tests.flr 10 Apr 2006 21:39:52 -0000 1.12 @@ -83,10 +83,9 @@ then (sort(?L,?SortedL)@prolog(), writeln(?SortedL)@prologall()) else writeln('something wrong')@prolog(). -//:- setsemantics{equality(basic)}. +:- setsemantics{equality(basic)}. c :=: ?X :- ?X=x.y. -//Disabled. Because path expression is not allowed in rule head now, and there is no skolem now. -x[y->_#]. +x[y->5]. %tst13 :- write('tst13 ')@prolog(), if (a[b->x.y], bar(f(a,?X))@prologall() ) @@ -114,5 +113,3 @@ debug[%check_undefined(off)]@flora(sys), %pretest, told@prolog(). - - Index: prolog_tests_old =================================================================== RCS file: /cvsroot/flora/flora-testsuite/general_tests/prolog_tests_old,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- prolog_tests_old 22 Dec 2005 23:31:10 -0000 1.4 +++ prolog_tests_old 10 Apr 2006 21:39:52 -0000 1.5 @@ -2,8 +2,8 @@ tst10 metapred(?X) succeeded, as expected tst11 [(b ',' c)] tst11 [(b ',' c)] -tst12 [(b ',' c)] -tst12 [(b ',' c)] +tst12 [(b ',' 5),(b ',' c)] +tst12 [(b ',' 5),(b ',' c)] tst13 bar(f(a,?X))@prologall() ?X = b tst13 bar(f(a,?X))@prologall() ?X = b tst14 bar(f(${a[e.e->f.f[q->r.r]]},?X)@prologall() ?X = a |
|
From: Chang Z. <ch...@us...> - 2006-04-10 21:38:22
|
Update of /cvsroot/flora/flora2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6616 Modified Files: flrparser.P Log Message: allow anonymous variable for module name during parsing Index: flrparser.P =================================================================== RCS file: /cvsroot/flora/flora2/flrparser.P,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- flrparser.P 6 Apr 2006 05:31:53 -0000 1.96 +++ flrparser.P 10 Apr 2006 21:38:09 -0000 1.97 @@ -2334,7 +2334,7 @@ ****************************************************************************/ %% Handle Flora user module specification. (@ ?M) flora_workspace(CanoniTerm,FLORAUSERMOD(NVCode),[]) :- - flora_name_or_normvar(CanoniTerm,NVCode), + flora_name_or_var(CanoniTerm,NVCode), !. %% Handle THIS MODULE specification, e.g., a[b->c]@ _@. @@ -3476,6 +3476,13 @@ ), !. +flora_name_or_var(CanoniTerm,Code) :- + ( get_flname_struct(CanoniTerm,Code) + ; + get_flvar_struct(CanoniTerm,Code) + ), + !. + %% support for adding files to modules flora_addfile(CANOTERM(Funct,1,FL_PARENTHESIS,[L],_If,_Ip),Code,Status) :- get_atom(Funct,FL_PLUS), @@ -4052,7 +4059,7 @@ flora_attmethspec(CANOTERM(Funct,2,FL_PARENTHESIS,[L,R],If,_Ip),_DWS,Code,Status) :- get_atom(Funct,FL_AT), !, - ( flora_name_or_normvar(R,RCode) -> + ( flora_name_or_var(R,RCode) -> flora_workspace(R,WSCode,[]), flora_attmethspec(L,WSCode,LCode,S), ( S == [] -> @@ -5072,7 +5079,7 @@ flora_db_pathexp(Mode,CANOTERM(Funct,2,FL_PARENTHESIS,[L,R],If,_Ip),HF,_DWS,Code,Status) :- get_atom(Funct,FL_AT), !, - ( (flora_name_or_normvar(R,RCode) ; thismodule_token(R,RCode)) + ( (flora_name_or_var(R,RCode) ; thismodule_token(R,RCode)) -> flora_db_pathexp(Mode,L,HF,RCode,LCode,S), ( S == [] -> |
|
From: Hui W. <hw...@us...> - 2006-04-10 21:29:56
|
Update of /cvsroot/flora/flora2/syslib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv512/syslib Modified Files: flrdbop.P Log Message: Report the uninstantiated module name in insert{...}. Index: flrdbop.P =================================================================== RCS file: /cvsroot/flora/flora2/syslib/flrdbop.P,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- flrdbop.P 9 Mar 2006 08:58:18 -0000 1.34 +++ flrdbop.P 10 Apr 2006 21:29:45 -0000 1.35 @@ -193,9 +193,13 @@ ; HeadP = P ), - flora_fdb_storage_name(NewMod,StorageName), - flora_internal_db_insert(StorageName,HeadP), - flora_storage_insertfacts(ThisModuleName,T). + ( var(HeadP) -> + flora_abort(['Uninstantiated module name in insert{...}']) + ; + flora_fdb_storage_name(NewMod,StorageName), + flora_internal_db_insert(StorageName,HeadP), + flora_storage_insertfacts(ThisModuleName,T) + ). flora_storage_insertfacts(ThisModuleName,[FLLIBMODOBJ(F,Args,ModuleName1,Caller,O)|T]) :- !, |
|
From: Hui W. <hw...@us...> - 2006-04-09 07:09:31
|
Update of /cvsroot/flora/flora2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30764 Modified Files: flrutils.P Log Message: In error message, print '?' instead of '_' for anonymous variables. Index: flrutils.P =================================================================== RCS file: /cvsroot/flora/flora2/flrutils.P,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- flrutils.P 24 Jan 2006 06:08:16 -0000 1.67 +++ flrutils.P 9 Apr 2006 07:09:19 -0000 1.68 @@ -2292,7 +2292,13 @@ flora_composer_errorwarn([error(Indx,Msg)|L],ErrNum,WarnNum) :- !, flora_nth_token(Indx,Tk), - flora_token_text(Tk,TextStr,BLN,BCN,_ELN,_ECN), + atom_codes(A,[CH_UNDERSCORE]), + ( (Tk = variable(A,_)) -> + TextStr=[CH_QUESTION], % in error reporting, output ? for anonymous variable ?_ and ? (they are stored as variable(_,...)) + flora_token_text(Tk,_TextStr,BLN,BCN,_ELN,_ECN) + ; + flora_token_text(Tk,TextStr,BLN,BCN,_ELN,_ECN) + ), ( flora_current_compile_filename(FileName) -> flora_error_line('[~w] [Composer] near line(~w)/char(~w) `~s''', [FileName,BLN,BCN,TextStr]) @@ -2310,8 +2316,19 @@ !, flora_nth_token(I1,Tk1), flora_nth_token(I2,Tk2), - flora_token_text(Tk1,TextStr1,BLN1,BCN1,_ELN1,_ECN1), - flora_token_text(Tk2,TextStr2,BLN2,BCN2,_ELN2,_ECN2), + atom_codes(A,[CH_UNDERSCORE]), + ( (Tk1 = variable(A,_)) -> + TextStr1=[CH_QUESTION], % in error reporting, output ? for anonymous variable ?_ and ? (they are stored as variable(_,...)) + flora_token_text(Tk1,_TextStr1,BLN1,BCN1,_ELN1,_ECN1) + ; + flora_token_text(Tk1,TextStr1,BLN1,BCN1,_ELN1,_ECN1) + ), + ( (Tk2 = variable(A,_)) -> + TextStr2=[CH_QUESTION], % in error reporting, output ? for anonymous variable ?_ and ? (they are stored as variable(_,...)) + flora_token_text(Tk2,_TextStr2,BLN2,BCN2,_ELN2,_ECN2) + ; + flora_token_text(Tk2,TextStr2,BLN2,BCN2,_ELN2,_ECN2) + ), ( flora_current_compile_filename(FileName) -> flora_error_line('[~w] [Composer] near line(~w)/char(~w) `~s'' and near line(~w)/char(~w) `~s''', [FileName,BLN1,BCN1,TextStr1,BLN2,BCN2,TextStr2]) @@ -2329,8 +2346,19 @@ !, flora_nth_token(I1,Tk1), flora_nth_token(I2,Tk2), - flora_token_text(Tk1,TextStr1,BLN1,BCN1,_ELN1,_ECN1), - flora_token_text(Tk2,TextStr2,BLN2,BCN2,_ELN2,_ECN2), + atom_codes(A,[CH_UNDERSCORE]), + ( (Tk1 = variable(A,_)) -> + TextStr1=[CH_QUESTION], % in error reporting, output ? for anonymous variable ?_ and ? (they are stored as variable(_,...)) + flora_token_text(Tk1,_TextStr1,BLN1,BCN1,_ELN1,_ECN1) + ; + flora_token_text(Tk1,TextStr1,BLN1,BCN1,_ELN1,_ECN1) + ), + ( (Tk2 = variable(A,_)) -> + TextStr2=[CH_QUESTION], % in error reporting, output ? for anonymous variable ?_ and ? (they are stored as variable(_,...)) + flora_token_text(Tk2,_TextStr2,BLN2,BCN2,_ELN2,_ECN2) + ; + flora_token_text(Tk2,TextStr2,BLN2,BCN2,_ELN2,_ECN2) + ), ( flora_current_compile_filename(FileName) -> flora_warning_line('[~w] [Composer] near line(~w)/char(~w) `~s'' and near line(~w)/char(~w) `~s''', [FileName,BLN1,BCN1,TextStr1,BLN2,BCN2,TextStr2]) @@ -2362,7 +2390,13 @@ flora_parser_error([error(Indx,Msg)|L],ErrNum) :- !, flora_nth_token(Indx,Tk), - flora_token_text(Tk,TextStr,BLN,BCN,_ELN,_ECN), + atom_codes(A,[CH_UNDERSCORE]), + ( (Tk = variable(A,_)) -> + TextStr=[CH_QUESTION], % in error reporting, output ? for anonymous variable ?_ and ? (they are stored as variable(_,...)) + flora_token_text(Tk,_TextStr,BLN,BCN,_ELN,_ECN) + ; + flora_token_text(Tk,TextStr,BLN,BCN,_ELN,_ECN) + ), ( flora_current_compile_filename(FileName) -> flora_error_line('[~w] [Parser] near line(~w)/char(~w) `~s''', [FileName,BLN,BCN,TextStr]) @@ -2424,7 +2458,13 @@ flora_compiler_errorwarn([error(Indx,Msg)|L],ErrNum,WarnNum) :- !, flora_nth_token(Indx,Tk), - flora_token_text(Tk,TextStr,BLN,BCN,_ELN,_ECN), + atom_codes(A,[CH_UNDERSCORE]), + ( (Tk = variable(A,_)) -> + TextStr=[CH_QUESTION], % in error reporting, output ? for anonymous variable ?_ and ? (they are stored as variable(_,...)) + flora_token_text(Tk,_TextStr,BLN,BCN,_ELN,_ECN) + ; + flora_token_text(Tk,TextStr,BLN,BCN,_ELN,_ECN) + ), ( flora_current_compile_filename(FileName) -> flora_error_line('[~w] [Compiler] near line(~w)/char(~w) `~s''', [FileName,BLN,BCN,TextStr]) @@ -2440,7 +2480,13 @@ flora_compiler_errorwarn([warning(Indx,Msg)|L],ErrNum,WarnNum) :- !, flora_nth_token(Indx,Tk), - flora_token_text(Tk,TextStr,BLN,BCN,_ELN,_ECN), + atom_codes(A,[CH_UNDERSCORE]), + ( (Tk = variable(A,_)) -> + TextStr=[CH_QUESTION], % in error reporting, output ? for anonymous variable ?_ and ? (they are stored as variable(_,...)) + flora_token_text(Tk,_TextStr,BLN,BCN,_ELN,_ECN) + ; + flora_token_text(Tk,TextStr,BLN,BCN,_ELN,_ECN) + ), ( flora_current_compile_filename(FileName) -> flora_warning_line('[~w] [Compiler] near line(~w)/char(~w) `~s''', [FileName,BLN,BCN,TextStr]) @@ -2481,7 +2527,13 @@ flora_coder_error([error(Indx,Msg)|L]) :- !, flora_nth_token(Indx,Tk), - flora_token_text(Tk,TextStr,BLN,BCN,_ELN,_ECN), + atom_codes(A,[CH_UNDERSCORE]), + ( (Tk = variable(A,_)) -> + TextStr=[CH_QUESTION], % in error reporting, output ? for anonymous variable ?_ and ? (they are stored as variable(_,...)) + flora_token_text(Tk,_TextStr,BLN,BCN,_ELN,_ECN) + ; + flora_token_text(Tk,TextStr,BLN,BCN,_ELN,_ECN) + ), ( flora_current_compile_filename(FileName) -> flora_error_line('[~w] [Coder] near line(~w)/char(~w) `~s''', [FileName,BLN,BCN,TextStr]) |
|
From: Hui W. <hw...@us...> - 2006-04-07 06:07:32
|
Update of /cvsroot/flora/flora2/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6654/Misc Modified Files: README convert.pl Log Message: Changed the PERL program which converts .flr files to new syntax--added in the conversion: ->>, =>>, .., !! are eliminated, single-valued signatures are represented by {1:1}=> and {1:1}*=>. Index: README =================================================================== RCS file: /cvsroot/flora/flora2/Misc/README,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- README 31 Aug 2005 19:22:56 -0000 1.2 +++ README 7 Apr 2006 06:07:18 -0000 1.3 @@ -1,5 +1,5 @@ This Perl program converts from the old syntax of FLORA-2 to the new syntax -where variables are prefixed with a ?, ->>, =>> are eliminated, +where variables are prefixed with a ?, ->>, =>>, .., !! are eliminated, single-valued signatures are represented by {1:1}=> and {1:1}*=>, transactional methods start with a %, etc. ****** @@ -8,7 +8,11 @@ cp -r Directory Directory_backup -- back up the directory, which you want to convert. Otherwise the old version will be lost. - perl convert.pl Directory + perl convert.pl Signal Directory -- Signal indicates what convertion + you want. If you want only (1),(2) of + /* what it does */, use "-var_trans"; + if only (3), use "-single_multi"; + if all of (1),(2),(3), use "-all". ************* What it does: @@ -20,6 +24,10 @@ (2) Replaces '#' with '%' in procedural predicates and terms. + (3) Replaces "=>" with "{1:1}=>" and "*=>" with "{1:1}*=>"; + Replaces "=>>" with "=>" and "->>" with "->"; + Replaces "!!" with "!" and a..b with a.b. + *********** Exceptions: *********** @@ -36,3 +44,6 @@ (4) There may be some places where # was used other than for specifying procedural predicates and terms. These #s may have to be restored from %. + + (5) There may be other exceptions. If you find any, please contact: + flo...@li... Index: convert.pl =================================================================== RCS file: /cvsroot/flora/flora2/Misc/convert.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- convert.pl 31 Aug 2005 19:22:56 -0000 1.2 +++ convert.pl 7 Apr 2006 06:07:18 -0000 1.3 @@ -4,7 +4,9 @@ ############################################################################## # Define Variables -if ($ARGV[0] ne "") { $dir = $ARGV[0]; } +if ($ARGV[0] eq "-var_trans" or $ARGV[0] eq "-single_multi" or $ARGV[0] eq "-all") { $signal = $ARGV[0]; } + else { die "Wrong Usage!\n perl convert.pl Signal Directory -- Signal must be -var_trans or -single_multi or -all\n"; } +if ($ARGV[1] ne "") { $dir = $ARGV[1]; } else { die "Please specify the Directory in which you want to convert .flr files.\n"; } ############################################################################## $str_question_wrong1='\?STD'; @@ -40,14 +42,36 @@ #$str_percent_wrong6='%mode'; #$str_percent_hash6='#mode'; +$str_0_1='=>>'; +$str_0_2='=@huiwan@>'; -&get_dir_list($dir); +$str_1_1='(?<!})\*=>'; +$str_1_2='{1:1}*=@wanhui@>'; +$str_2_1='(?<![}\*])=>'; +$str_2_2='{1:1}=>'; +$str_3_1='{1:1}\*=@wanhui@>'; +$str_3_2='{1:1}*=>'; + +$str_4_1='=@huiwan@>'; +$str_4_2='=>'; + +$str_5_1='->>'; +$str_5_2='->'; + +$str_6_1='!!'; +$str_6_2='!'; + +$str_7_1='(?<![=\.\ ])\.\.(?=[a-zA-Z\_\?\'\"])'; +$str_7_2='.'; + + +&get_dir_list($signal,$dir); exit; # ------------------------------------------------------------------------------ sub get_dir_list { - my ($dir) = @_; + my ($signal,$dir) = @_; my @dirlist = (); opendir(DIR, "$dir") or die "can't open $dir\n"; @@ -58,14 +82,8 @@ $type = ( -d "$dir/$entry" ) ? "dir" : "file"; if ($type eq "file" && $entry ne "forum") { - #print "$type - $entry\n"; - #@files_found = grep{/.html/}readdir(dir); - - #foreach $line(@files_found) { - #$fname = "$dir/$line"; - $fname = "$dir/$entry"; - &parse_file($fname); - #} + $fname = "$dir/$entry"; + &parse_file($signal,$fname); } if ($type eq "dir" && $entry ne "forum") { @@ -79,14 +97,14 @@ foreach $subdir (@dirlist) -{ &get_dir_list($subdir);} +{ &get_dir_list($signal,$subdir);} } # ------------------------------------------------------------------------------ sub parse_file { - my ($fname) = @_; + my ($signal,$fname) = @_; my @cd = split(/\./, $fname); if ($cd[@cd - 1] eq "flr" @@ -96,17 +114,32 @@ my @wholefile=<FILE>; my $lines = join '', @wholefile; - $lines = &question($lines); - $lines =~ s/$str_question_wrong1/$str_question_back1/gm; - $lines =~ s/$str_question_wrong2/$str_question_back2/gm; - $lines =~ s/$str_question_wrong3/$str_question_back3/gm; - $lines =~ s/$str_question_wrong4/$str_question_back4/gm; - $lines =~ s/$str_question_wrong5/$str_question_back5/gm; + if ($signal eq "-var_trans" or $signal eq "-all") + { + $lines = &question($lines); + $lines =~ s/$str_question_wrong1/$str_question_back1/gm; + $lines =~ s/$str_question_wrong2/$str_question_back2/gm; + $lines =~ s/$str_question_wrong3/$str_question_back3/gm; + $lines =~ s/$str_question_wrong4/$str_question_back4/gm; + $lines =~ s/$str_question_wrong5/$str_question_back5/gm; - $lines =~ s/$str_hash/$str_percent/gm; - $lines =~ s/$str_percent_wrong1/$str_percent_hash1/gm; - $lines =~ s/$str_percent_wrong2/$str_percent_hash2/gm; - $lines =~ s/$str_percent_wrong3/$str_percent_hash3/gm; + $lines =~ s/$str_hash/$str_percent/gm; + $lines =~ s/$str_percent_wrong1/$str_percent_hash1/gm; + $lines =~ s/$str_percent_wrong2/$str_percent_hash2/gm; + $lines =~ s/$str_percent_wrong3/$str_percent_hash3/gm; + } + + if ($signal eq "-single_multi" or $signal eq "-all") + { + $lines =~ s/$str_0_1/$str_0_2/gm; + $lines =~ s/$str_1_1/$str_1_2/gm; + $lines =~ s/$str_2_1/$str_2_2/gm; + $lines =~ s/$str_3_1/$str_3_2/gm; + $lines =~ s/$str_4_1/$str_4_2/gm; + $lines =~ s/$str_5_1/$str_5_2/gm; + $lines =~ s/$str_6_1/$str_6_2/gm; + $lines =~ s/$str_7_1/$str_7_2/gm; + } close(FILE); open(FILE,">$fname") || die "Can't open the file $fname\n"; |
|
From: Michael K. <ki...@us...> - 2006-04-06 07:38:29
|
Update of /cvsroot/flora/flora2/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16706 Modified Files: flora2.tex Log Message: typo Index: flora2.tex =================================================================== RCS file: /cvsroot/flora/flora2/docs/flora2.tex,v retrieving revision 1.149 retrieving revision 1.150 diff -u -d -r1.149 -r1.150 --- flora2.tex 16 Feb 2006 07:33:51 -0000 1.149 +++ flora2.tex 6 Apr 2006 07:38:11 -0000 1.150 @@ -2718,6 +2718,7 @@ \index{{\tt bootstrap\_flora} command} %% \begin{quote} + \tt | ?- [flora2], bootstrap\_flora. \end{quote} %% |
|
From: Hui W. <hw...@us...> - 2006-04-06 05:59:19
|
Update of /cvsroot/flora/flora2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19120 Modified Files: flrcompiler.P Log Message: Change the translation of P(a.b):-body. to be P(?_newvar) :- body, a[b->?_newvar]. instead of P(?_newvar):-a[b->?_newvar],body. to make it more efficient. Index: flrcompiler.P =================================================================== RCS file: /cvsroot/flora/flora2/flrcompiler.P,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- flrcompiler.P 6 Apr 2006 05:31:53 -0000 1.88 +++ flrcompiler.P 6 Apr 2006 05:59:12 -0000 1.89 @@ -1869,7 +1869,7 @@ ( HS == [] -> compile_body(Body,BCode1,BS), get_dynrule_varlist(L), - conjunct_code([H2BCode,BCode1],BCode), + conjunct_code([BCode1,H2BCode],BCode), add_attrvar_code(L,BCode,BodyCode), ( BS == [] -> get_directive(DirectCodeList), @@ -5433,7 +5433,7 @@ (Status==[] -> list_struct(HeadCodeList,[],HCL), new_varobj(NO_INDEX,BVL), - conjunct_code([H2BCode,BodyCode1],BodyCode), + conjunct_code([BodyCode1,H2BCode],BodyCode), dynrule_struct(HCL,BodyCode,HVL,BVL,RCode), ( is_fldeleteruleop(Op) -> true |
|
From: Michael K. <ki...@us...> - 2006-04-06 05:41:42
|
Update of /cvsroot/flora/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9862 Modified Files: loginfo Log Message: Index: loginfo =================================================================== RCS file: /cvsroot/flora/CVSROOT/loginfo,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- loginfo 26 Sep 2004 04:17:30 -0000 1.15 +++ loginfo 6 Apr 2006 05:41:27 -0000 1.16 @@ -26,10 +26,10 @@ #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog -flora2.* mail -s "FLORA-2 Sources Commit: %{}" ki...@cs... ya...@ai... ch...@cs... vi...@mi... hw...@cs... +flora2.* mail -s "FLORA-2 Sources Commit: %{}" ki...@cs... ya...@ai... ch...@cs... hw...@cs... flora-website.* mail -s "FLORA-2 Website Commit: %{}" ki...@cs... -flora-testsuite.* mail -s "FLORA-2 Testsuite Commit: %{}" ki...@cs... ya...@ai... ch...@cs... vi...@mi... hw...@cs... +flora-testsuite.* mail -s "FLORA-2 Testsuite Commit: %{}" ki...@cs... ya...@ai... ch...@cs... hw...@cs... ALL /cvsroot/sitedocs/CVSROOT/cvstools/syncmail -u %{sVv} flo...@li... |
|
From: Hui W. <hw...@us...> - 2006-04-06 05:32:06
|
Update of /cvsroot/flora/flora2/flrincludes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv466/flrincludes Modified Files: flora_errors.flh Log Message: Enabling path expressions in rule heads and insertions again, without using skolem. P(a.b):-body. is treated as P(?_newvar):-a[b->?_newvar],body. Index: flora_errors.flh =================================================================== RCS file: /cvsroot/flora/flora2/flrincludes/flora_errors.flh,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- flora_errors.flh 9 Mar 2006 08:58:18 -0000 1.37 +++ flora_errors.flh 6 Apr 2006 05:31:53 -0000 1.38 @@ -159,11 +159,13 @@ #define NO_WSINRULEHEAD '@module is illegal in rule heads' #define NO_WSNESTING 'invalid nesting of module specifications' #define NO_REDEFINITION 'redefinition of built-ins in rule head is illegal' -#define NO_PATHEXP 'path expression is illegal in rule head' +% #define NO_PATHEXP 'path expression is illegal in rule head' +% path expression is allowed now #define NO_AGGINHEAD 'aggregates are illegal in a rule head' #define NO_INSERT 'insertion into a built-in is illegal' #define NO_DELETE 'deletion from a built-in is illegal' -#define NO_INSERTPATHEXP 'path expression is illegal in insert' +% #define NO_INSERTPATHEXP 'path expression is illegal in insert' +% path expression is allowed now #define NO_INSERTDISJUN 'disjunction is illegal in insert{...}' #define NO_DELETEDISJUN 'disjunction is illegal in delete{...}' #define NO_INSERTNEG 'negation is illegal in insert{...}' |
|
From: Hui W. <hw...@us...> - 2006-04-06 05:32:05
|
Update of /cvsroot/flora/flora2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv466 Modified Files: flrcompiler.P flrparser.P Log Message: Enabling path expressions in rule heads and insertions again, without using skolem. P(a.b):-body. is treated as P(?_newvar):-a[b->?_newvar],body. Index: flrparser.P =================================================================== RCS file: /cvsroot/flora/flora2/flrparser.P,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- flrparser.P 24 Mar 2006 23:21:32 -0000 1.95 +++ flrparser.P 6 Apr 2006 05:31:53 -0000 1.96 @@ -4351,8 +4351,13 @@ true ) - ; is_mvdobjrefop(F) -> - parsing_error(If,NO_PATHEXP,Status) + ; is_mvdobjrefop(F) -> + flora_head_pathexplist(Args,DWS,[LCode,RCode],Status), + ( Status == [] -> + flobjref_struct(LCode,F,RCode,Code) + ; + true + ) ; F == FL_AT -> %% Module specs for F-logic molecules in the head are not allowed. @@ -5037,17 +5042,12 @@ flora_db_pathexplist(Mode,Args,DWS,[LCode,RCode],Status), (Status == [] -> flbirelate_struct(LCode,F,RCode,Code); true). -flora_db_pathexp(Mode,CANOTERM(Funct,2,FL_PARENTHESIS,Args,If,_Ip),_HF,DWS,Code,Status) :- - get_atom(Funct,F), - is_mvdobjrefop(F), - !, - ( Mode == FLINS -> - parsing_error(If,NO_INSERTPATHEXP,Status) - ; - (Mode==FLDEL; Mode==FLREF; Mode==FLCLS), - flora_db_pathexplist(Mode,Args,DWS,[LCode,RCode],Status), - (Status == [] -> flobjref_struct(LCode,F,RCode,Code); true) - ). +flora_db_pathexp(Mode,CANOTERM(Funct,2,FL_PARENTHESIS,Args,_If,_Ip),_HF,DWS,Code,Status) :- + get_atom(Funct,F), + is_mvdobjrefop(F), + !, + flora_db_pathexplist(Mode,Args,DWS,[LCode,RCode],Status), + (Status == [] -> flobjref_struct(LCode,F,RCode,Code); true). % To handle URI SQname structure like W3C#"function" flora_db_pathexp(Mode,CANOTERM(Funct,2,FL_PARENTHESIS,Args,_If,_Ip),_HF,DWS,Code,Status) :- Index: flrcompiler.P =================================================================== RCS file: /cvsroot/flora/flora2/flrcompiler.P,v retrieving revision 1.87 retrieving revision 1.88 diff -u -d -r1.87 -r1.88 --- flrcompiler.P 9 Mar 2006 08:58:17 -0000 1.87 +++ flrcompiler.P 6 Apr 2006 05:31:53 -0000 1.88 @@ -928,6 +928,18 @@ is_imvdrefop(RefType), imvdspec_struct(BODYLITERAL,Obj,Att,Val,Code) ). + +% if it is the same with body_objref_struct, combine them later +head_objref_struct(Obj,RefType,Att,Index,Val,Code) :- + new_varobj(Index,Val), + ( is_mvdrefop(RefType) -> + mvdspec_struct(HEADLITERAL,Obj,Att,Val,Code) + ; + is_imvdrefop(RefType), [...1251 lines suppressed...] ). @@ -5292,15 +5424,16 @@ is_fldynrule(R,Head,Body), set_context(compile_with_var_module), set_context(compiling_dynrule), - compile_head(Head,HeadCode,HS), + compile_head(Head,HeadCode,H2BCode,HS), new_varobj(NO_INDEX,HVL), compile_conjunct2list(HeadCode,HeadCodeListPre), remove_empty_list(HeadCodeListPre,HeadCodeList), ( HS == [] -> - compile_body(Body,BodyCode,Status), + compile_body(Body,BodyCode1,Status), (Status==[] -> list_struct(HeadCodeList,[],HCL), new_varobj(NO_INDEX,BVL), + conjunct_code([H2BCode,BodyCode1],BodyCode), dynrule_struct(HCL,BodyCode,HVL,BVL,RCode), ( is_fldeleteruleop(Op) -> true |