FLORA-2: User's Manual

code Coder (flrcoder.P) Macro program GPP preprocessor XSB Program XSB Byte code Generator Intermediate Code (flrcompiler.P) Figure 2: The ar hite ture of the FLORA-2 system. flrutils.P: Mis ellaneous utility predi ates for loading programs, he king if les exist, whether they need to be re ompiled, et . Additional system libraries are lo ated in the syslib/ subdire tory. These in lude the various printing utilities, implementation for aggregates, update primitives, and some others. The ompiler determines whi h of these libraries are needed while parsing the program. When a library is needed, the ompiler generates an #in lude statement to in lude an appropriate le in the syslibin dire tory. For instan e, to in lude support for the avg aggregate fun tion, the ompiler opies the le syslibin /flraggavg in .flh to the output .P le. Sin e syslibin /flraggavg in .flh ontains the ode to load the library syslib/flraggavg.P, this library will be loaded together with that output le. The asso iation between the libraries and the les that need to be in luded to provide the appropriate fun tionality is implemented in the le flrlibman.P, whi h also implements the utility used to load the libraries. While syslib/ dire tory ontains the libraries implemented in Prolog, the lib/ dire tory ontains libraries implemented in FLORA-2 itself. Apart from that, the two types of libraries di er in fun tionality. The libraries in syslib/ implement the primitives that are part of the syntax of the FLORA-2 language itself. In ontrast, the libraries in lib/ are utilities that are part of the system, but not part of the syntax. An example is the pretty-printing library. Methods and predi ates de ned in the libraries in lib/ are a essible through the flora(lib-name) system module and REFERENCES 66 (unlike user modules) they are loaded automati ally at startup. There are several subdire tories that hold the various les that ontain de nitions in luded at ompile time. These will be des ribed in a te hni al do ument. A number of other important dire tories ontain the various in luded les (many of whi h in lude other les). The dire tory flrin ludes/ ontains the all-important flora terms.flh le, whi h de nes all the names used in the system. These names are de ned as prepro essor ma ros, so that it would be easy to hange them, if ne essary. The dire tory genin ludes/ urrently ontains the already mentioned pat h rules. The le flrpat h.fli is a template, and flrpat h.flh, whi h ontains the a tual pat h rules, is generated from flrpat h.fli during the installation. The dire tory in ludes/ ontains the header le, whi h de nes the ma ros (e.g., FLORA WORKSPACE) that wrap all the names with pre xes to separate the di erent modules of the user program. The dire tory headerin / is another pla e where the template les are lo ated. Ea h of these les ontains just a few #in lude statements, mostly for the les in the losure/ dire tory (whi h, if you re all, ontains pie es of the trailer). When the system is installed ertain ombinations of these les are on atenated and dumped into the trailer/ dire tory. Re all that the les in the trailer/ dire tory are trailers that implement the losure axioms (there are three trailers: without equality, with standard equality, and with F-logi equality). This double-indire tion is needed to simplify the installation pro edure and to eliminate ode dupli ation among the various trailers. The dire tory p2h ontains (the only!) C program in the system. It implements onversion of Prolog terms to HiLog and ba k. Finally, the pkgs/ dire tory is empty. Some day it will ontain add-on programs, su h as Internet a ess, et . Referen es [1℄ A.J. Bonner and M. Kifer. Transa tion logi programming. In International Conferen e on Logi Programming, pages 257{282, Budapest, Hungary, June 1993. MIT Press. [2℄ A.J. Bonner and M. Kifer. An overview of transa tion logi . Theoreti al Computer S ien e, 133:205{265, O tober 1994. [3℄ A.J. Bonner, M. Kifer, and M. Consens. Database programming in transa tion logi . In A. Ohori C. Beeri and D.E. Shasha, editors, Pro eedings of the International Workshop on Database Programming Languages, Workshops in Computing, pages 309{337. Springer-Verlag, February 1994. Workshop held on Aug 30{Sept 1, 1993, New York City, NY. [4℄ W. Chen and M. Kifer. Sorted HiLog: Sorts in higher-order logi programming. Number 893 in Le ture Notes in Computer S ien e, January 1995. [5℄ W. Chen, M. Kifer, and D.S. Warren. HiLog: A foundation for higher-order logi programming. Journal of Logi Programming, 15(3):187{230, February 1993. [6℄ K. Clark. Negation as failure. Logi and Databases, pages 293{322, 1978. [7℄ J. Frohn, G. Lausen, and H. Upho . A ess to obje ts by path expressions and rules. In VLDB, pages 273{284, 1994. REFERENCES 67 [8℄ M. Kifer, W. Kim, and Y. Sagiv. Querying obje t-oriented databases. In Pro eedings of the ACM SIGMOD International Conferen e on the Management of Data, pages 393{402, New York, June 1992. ACM. [9℄ M. Kifer, G. Lausen, and J. Wu. Logi al foundations of obje t-oriented and frame-based languages. Journal of the ACM, 42:741{843, July 1995. [10℄ A. Van Gelder. The alternating xpoint of logi programs with negation. In ACM Prin iples of Database Systems, pages 1{10, New York, 1989. ACM. [11℄ A. Van Gelder, K.A. Ross, and J.S. S hlipf. The well-founded semanti s for general logi programs. Journal of the ACM, 38(3):620{650, 1991. [12℄ G. Yang and M. Kifer. Implementing an eÆ ient DOOD system using a tabling logi engine. In First International Conferen e on Computational Logi , DOOD-2000 Stream, July 2000. Index , 29 *+>>, 37 *->->, 36 +>>, 37 ->->, 36 expunge, 30 flLoadedModule/1, 19 flThisModule/1, 18 abolish all tables, 39, 46 aggregates avg, 36 olle tbag, 36 olle tset, 36 ount, 36 max, 36 min, 36 multi-valued methods, 36 sum, 36 aggregation aggregate operator, 35 grouping, 35 anonymous oid, 38 anonymous variable, 4 arithmeti expression, 13 atomdata, 7 isa, 8 signature, 7 atomi formula in F-logi , 6 attribute inheritable, 32 non-inheritable, 32 ba ktra kable update, 44 btdelete, 44 btdeleteall, 44 bterase, 44 bteraseall, 44 btinsert, 44 btinsertall, 44 base part of predi ate, 40 bform, 26, 49 boolean method inheritable, 37 bulk delete, 43 bulk insert, 42 anoni term, 64 hara ter list, 10 lass, 8 instan e, 8 sub lass, 8 losure axioms, 60 omment, 11 ompiler dire tive, 48 arguments, 26, 48 equality, 48 expunge, 48 firstorderall, 30, 48 firstorder, 30, 48 hilogtable, 39 index, 48 op, 12, 48 table, 38 equality, 31 uts in FLORA-2, 40 utting a ross tables, 40 data atom, 7 debugging, 56 delete bulk, 43 derived part of predi ate, 40 don't are variable, 4 dynami module, 32 equality, 31 es aped hara ter, 9 F-mole ule, 8 flDump/1, 53 FLIP, 1 flNoTra e, 56 floating number, 10 68 INDEX 69 FLORID, 1 flP2H/2, 29 flTra e, 56 flTra eLow, 56 HiLog, 26 translation, 27 unifi ation, 27 HiLog to Prolog onversion, 29 hilogtable, 39 I/O port-based, 51 stream-based, 51 Id-term, 6 inheritan e behavioral, 32 non-monotoni , 32 stru tural, 32 insert bulk, 42 integer, 10 loading files, 18 logi al expressions, 12 meta signature of a predi ate, 26 meta-programming, 28 meta-unifi ation, 29 method, 7 boolean, 37 inheritable, 37 multi-valued, 7 pro edural, 39 s alar, 7 self, 23 set-valued, 7 single-valued, 7 module, 15 expunge, 30 flLoadedModule/1, 19 flThisModule/1, 18 flora(modulename), 21 prolog(modulename), 19 ontents, 15 name, 15 Prolog, 16, 19 rules for, 17 system, 16, 21, 50 user, 16 ompilation of, 18 referen e to, 16 mole ule logi expressions, 13 obje t value, 24 truth value, 24 multi-valued methods aggregation, 36 non-ba ktra kable update, 41 delete, 42 deleteall, 42 erase, 42 eraseall, 42 insert, 41 insertall, 41 number, 10 obje t base part of, 40 derived part of, 40 obje t onstru tor, 6 obje t identifier, 6 oid, 6 anonymous, 38 operators, 11 pre eden e level, 11 type, 11 pat h rules, 63 path expression, 22 in rule body, 22 in rule head, 24 predi ate base part of, 40 derived part of, 40 first-order, 30 HiLog, 30 predi ate meta signature, 26 Prolog module, 16, 19 Prolog to HiLog onversion, 29 INDEX 70 signature in F-logi , 7 spying, 56 string, 10 sub lass, 8 symbol, 9 synta ti obje t, 26, 49 system module, 16, 21, 50 table, 38 tabling, 38 tra ing, 56 triehandle, 62 type he king, 48 update, 40 ba ktra kable, 44 non-ba ktra kable, 41 user module, 16 variable anonymous, 4 don't are, 4 well-founded semanti s, 35

[1]  Keith L. Clark,et al.  Negation as Failure , 1987, Logic and Data Bases.