From b77427df89739be3688eaa91f59ab31c9675dbac Mon Sep 17 00:00:00 2001 From: pmoura Date: Wed, 5 Dec 2001 23:57:48 +0000 Subject: [PATCH] Updated to Logtalk 2.9.1 git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@211 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- Logtalk/README.YAP | 8 +- Logtalk/examples/NOTES | 11 +- Logtalk/examples/birds/NOTES | 2 +- Logtalk/examples/birds/SCRIPT | 2 +- Logtalk/examples/birds/birds.loader | 3 +- Logtalk/examples/bricks/NOTES | 2 +- Logtalk/examples/bricks/SCRIPT | 2 +- Logtalk/examples/classvars/NOTES | 2 +- Logtalk/examples/classvars/SCRIPT | 2 +- Logtalk/examples/inheritance/NOTES | 4 +- Logtalk/examples/inheritance/SCRIPT | 32 +- .../examples/inheritance/inheritance.loader | 3 + Logtalk/examples/instmethods/NOTES | 2 +- Logtalk/examples/instmethods/SCRIPT | 2 +- Logtalk/examples/lo/NOTES | 2 +- Logtalk/examples/lo/planner/NOTES | 2 +- Logtalk/examples/lo/planner/SCRIPT | 2 +- Logtalk/examples/lo/planner/planner.loader | 14 +- Logtalk/examples/lo/travellers/NOTES | 2 +- Logtalk/examples/lo/travellers/SCRIPT | 2 +- .../examples/lo/travellers/travellers.loader | 11 +- Logtalk/examples/lpa/NOTES | 2 +- Logtalk/examples/lpa/SCRIPT | 2 +- Logtalk/examples/lpa/lpa.loader | 18 +- Logtalk/examples/metapredicates/NOTES | 2 +- Logtalk/examples/metapredicates/SCRIPT | 2 +- .../metapredicates/metapredicates.loader | 4 +- Logtalk/examples/mi/NOTES | 2 +- Logtalk/examples/mi/SCRIPT | 2 +- Logtalk/examples/mi/mi.loader | 6 +- Logtalk/examples/miscellaneous/NOTES | 2 +- Logtalk/examples/miscellaneous/SCRIPT | 2 +- Logtalk/examples/parametric/NOTES | 2 +- Logtalk/examples/parametric/SCRIPT | 2 +- Logtalk/examples/poem/poem.loader | 2 +- Logtalk/examples/points/NOTES | 2 +- Logtalk/examples/points/SCRIPT | 2 +- Logtalk/examples/points/points.loader | 10 +- Logtalk/examples/polygons/NOTES | 2 +- Logtalk/examples/polygons/SCRIPT | 2 +- Logtalk/examples/polygons/polygons.loader | 2 +- Logtalk/examples/profiling/NOTES | 2 +- Logtalk/examples/profiling/SCRIPT | 2 +- Logtalk/examples/reflection/NOTES | 2 +- Logtalk/examples/reflection/SCRIPT | 2 +- Logtalk/examples/relations/NOTES | 2 +- Logtalk/examples/relations/SCRIPT | 7 +- Logtalk/examples/roots/NOTES | 2 +- Logtalk/examples/roots/SCRIPT | 2 +- Logtalk/examples/roots/roots.loader | 2 +- Logtalk/examples/searching/NOTES | 7 +- Logtalk/examples/searching/SCRIPT | 67 +- Logtalk/examples/searching/best_first1.lgt | 4 +- Logtalk/examples/searching/breadth_first1.lgt | 3 - Logtalk/examples/searching/hill_climbing1.lgt | 8 +- Logtalk/examples/searching/performance.lgt | 20 +- Logtalk/examples/searching/searching.loader | 19 +- Logtalk/examples/searching/water_jug.lgt | 2 +- Logtalk/examples/sicstus/NOTES | 4 +- Logtalk/examples/sicstus/SCRIPT | 12 +- Logtalk/examples/sicstus/sicstus.loader | 6 +- Logtalk/examples/symdiff/NOTES | 2 +- Logtalk/examples/symdiff/SCRIPT | 6 +- Logtalk/examples/viewpoints/NOTES | 2 +- Logtalk/examples/viewpoints/SCRIPT | 2 +- Logtalk/library/NOTES | 24 +- Logtalk/library/SCRIPT | 2 +- Logtalk/library/all.loader | 38 + Logtalk/library/all.notes | 11 + Logtalk/library/dates.notes | 2 +- Logtalk/library/debugging.notes | 5 +- Logtalk/library/events.notes | 2 +- Logtalk/library/hierarchies.notes | 2 +- Logtalk/library/metapredicates.notes | 2 +- Logtalk/library/random.notes | 2 +- Logtalk/library/setp.lgt | 1 - Logtalk/library/types.notes | 2 +- Logtalk/manuals/NOTES | 14 +- Logtalk/manuals/bibliography.html | 2 +- Logtalk/manuals/index.html | 6 +- .../refman/builtins/abolish_category1.html | 4 +- .../refman/builtins/abolish_events5.html | 4 +- .../refman/builtins/abolish_object1.html | 4 +- .../refman/builtins/abolish_protocol1.html | 4 +- .../refman/builtins/category_property2.html | 4 +- .../refman/builtins/create_category4.html | 4 +- .../refman/builtins/create_object4.html | 4 +- .../refman/builtins/create_protocol3.html | 4 +- .../refman/builtins/current_category1.html | 4 +- .../refman/builtins/current_event5.html | 4 +- .../refman/builtins/current_object1.html | 4 +- .../refman/builtins/current_protocol1.html | 4 +- .../refman/builtins/define_events5.html | 4 +- .../refman/builtins/extends_object2_3.html | 8 +- .../refman/builtins/extends_protocol2_3.html | 8 +- Logtalk/manuals/refman/builtins/forall2.html | 4 +- .../builtins/implements_protocol2_3.html | 10 +- .../refman/builtins/imports_category2_3.html | 8 +- .../builtins/instantiates_class2_3.html | 8 +- .../refman/builtins/logtalk_compile1.html | 10 +- .../refman/builtins/logtalk_compile2.html | 13 +- .../refman/builtins/logtalk_load1.html | 10 +- .../refman/builtins/logtalk_load2.html | 12 +- .../refman/builtins/logtalk_version3.html | 4 +- .../refman/builtins/object_property2.html | 4 +- .../refman/builtins/protocol_property2.html | 4 +- .../manuals/refman/builtins/retractall1.html | 4 +- .../refman/builtins/specializes_class2_3.html | 8 +- Logtalk/manuals/refman/control/external1.html | 4 +- .../manuals/refman/control/to_object2.html | 6 +- Logtalk/manuals/refman/control/to_self1.html | 4 +- Logtalk/manuals/refman/control/to_super1.html | 4 +- Logtalk/manuals/refman/directives/calls1.html | 2 +- .../refman/directives/category1_2.html | 2 +- .../refman/directives/discontiguous1.html | 2 +- .../manuals/refman/directives/dynamic0.html | 4 +- .../manuals/refman/directives/dynamic1.html | 2 +- .../refman/directives/end_category0.html | 2 +- .../refman/directives/end_object0.html | 2 +- .../refman/directives/end_protocol0.html | 2 +- Logtalk/manuals/refman/directives/info1.html | 2 +- Logtalk/manuals/refman/directives/info2.html | 2 +- .../refman/directives/initialization1.html | 2 +- .../refman/directives/metapredicate1.html | 2 +- Logtalk/manuals/refman/directives/mode2.html | 2 +- .../manuals/refman/directives/object1_4.html | 2 +- Logtalk/manuals/refman/directives/op3.html | 2 +- .../manuals/refman/directives/private1.html | 2 +- .../manuals/refman/directives/protected1.html | 2 +- .../refman/directives/protocol1_2.html | 2 +- .../manuals/refman/directives/public1.html | 2 +- Logtalk/manuals/refman/directives/uses1.html | 2 +- Logtalk/manuals/refman/grammar.html | 39 +- Logtalk/manuals/refman/index.html | 8 +- Logtalk/manuals/refman/methods/abolish1.html | 4 +- Logtalk/manuals/refman/methods/after3.html | 4 +- Logtalk/manuals/refman/methods/asserta1.html | 4 +- Logtalk/manuals/refman/methods/assertz1.html | 4 +- Logtalk/manuals/refman/methods/bagof3.html | 4 +- Logtalk/manuals/refman/methods/before3.html | 4 +- Logtalk/manuals/refman/methods/clause2.html | 4 +- .../refman/methods/current_predicate1.html | 4 +- Logtalk/manuals/refman/methods/findall3.html | 4 +- Logtalk/manuals/refman/methods/forall2.html | 4 +- .../manuals/refman/methods/parameter2.html | 4 +- .../refman/methods/predicate_property2.html | 4 +- Logtalk/manuals/refman/methods/retract1.html | 4 +- .../manuals/refman/methods/retractall1.html | 4 +- Logtalk/manuals/refman/methods/self1.html | 4 +- Logtalk/manuals/refman/methods/sender1.html | 4 +- Logtalk/manuals/refman/methods/setof3.html | 4 +- Logtalk/manuals/refman/methods/this1.html | 4 +- Logtalk/manuals/styles.css | 4 +- Logtalk/manuals/tutorial/attributes.html | 8 +- Logtalk/manuals/tutorial/index.html | 4 +- Logtalk/manuals/userman/documenting.html | 4 +- Logtalk/manuals/userman/errors.html | 10 +- Logtalk/manuals/userman/index.html | 7 +- Logtalk/manuals/userman/installing.html | 11 +- Logtalk/manuals/userman/protocols.html | 6 +- Logtalk/xml/NOTES | 43 +- Logtalk/xml/ie50.xsl | 2 +- Logtalk/xml/lgthtml.xsl | 217 ++++ Logtalk/xml/lgtxml.xsl | 217 ++++ Logtalk/xml/logtalk.dtd | 2 +- Logtalk/xml/logtalk.xsd | 4 +- Logtalk/xml/script.bat | 21 + Logtalk/xml/script.sh | 23 + Logtalk/xml/texml.xsl | 2 +- library/logtalk/logtalk.pl | 982 ++++++++++++------ library/logtalk/yap430.config | 6 +- 171 files changed, 1692 insertions(+), 711 deletions(-) create mode 100644 Logtalk/library/all.loader create mode 100644 Logtalk/library/all.notes create mode 100644 Logtalk/xml/lgthtml.xsl create mode 100644 Logtalk/xml/lgtxml.xsl create mode 100644 Logtalk/xml/script.bat create mode 100644 Logtalk/xml/script.sh diff --git a/Logtalk/README.YAP b/Logtalk/README.YAP index 34c8b5dc6..cd682de0e 100644 --- a/Logtalk/README.YAP +++ b/Logtalk/README.YAP @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= @@ -16,6 +16,6 @@ Logtalk documentation or by using the call: | ?- use_module(library(logtalk)). -Note that, although we load Logtalk using the @code{use_module/1} -built-in predicate, the system is not packaged as a module not does -it use modules in its implementation. +Note that, although we load Logtalk using the use_module/1 built-in +predicate, the system is not packaged as a module nor does it use +modules in its implementation. diff --git a/Logtalk/examples/NOTES b/Logtalk/examples/NOTES index f9fe0a891..94e33f024 100644 --- a/Logtalk/examples/NOTES +++ b/Logtalk/examples/NOTES @@ -1,12 +1,12 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= This folder contains several examples of Logtalk programs. Most of -these examples need objects, protocols and categories that are +these examples need objects, protocols, and categories that are defined in the Logtalk standard library or in other examples, so you should load them first (see the NOTES file inside each example folder). @@ -36,6 +36,9 @@ bricks classvars example of implementation of class variables (as found in Smalltalk) +errors + example showing the Logtalk compiler warning and error reporting + inheritance examples of public, protected and private inheritance with both prototypes and classes/instances @@ -84,7 +87,7 @@ roots objects, protocols and categories needed by most of the other examples searching - state-space searching frame work + state-space searching framework example adopted from Ivan Bratko's "Prolog Programming for Artificial Intelligence" book @@ -93,7 +96,7 @@ sicstus symdiff example of using parametric objects to implement symbolic expression - differentiation and simplification. + differentiation and simplification viewpoints example on how to implement property and value sharing with prototypes diff --git a/Logtalk/examples/birds/NOTES b/Logtalk/examples/birds/NOTES index 2941f06f3..ba7567f22 100644 --- a/Logtalk/examples/birds/NOTES +++ b/Logtalk/examples/birds/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/birds/SCRIPT b/Logtalk/examples/birds/SCRIPT index aed595baf..6f61a3a06 100644 --- a/Logtalk/examples/birds/SCRIPT +++ b/Logtalk/examples/birds/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/birds/birds.loader b/Logtalk/examples/birds/birds.loader index 8fdd73628..078190c03 100644 --- a/Logtalk/examples/birds/birds.loader +++ b/Logtalk/examples/birds/birds.loader @@ -2,10 +2,11 @@ :- initialization( logtalk_load([ descriptors, - expert, order, + expert, + falconiforms, % orders passerformes, tubenose, diff --git a/Logtalk/examples/bricks/NOTES b/Logtalk/examples/bricks/NOTES index 0f9074101..46e3b1789 100644 --- a/Logtalk/examples/bricks/NOTES +++ b/Logtalk/examples/bricks/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/bricks/SCRIPT b/Logtalk/examples/bricks/SCRIPT index 8965cede1..2ad4e4c72 100644 --- a/Logtalk/examples/bricks/SCRIPT +++ b/Logtalk/examples/bricks/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/classvars/NOTES b/Logtalk/examples/classvars/NOTES index 5d7ba8f31..0e241e541 100644 --- a/Logtalk/examples/classvars/NOTES +++ b/Logtalk/examples/classvars/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/classvars/SCRIPT b/Logtalk/examples/classvars/SCRIPT index cc9fd10c4..15158330a 100644 --- a/Logtalk/examples/classvars/SCRIPT +++ b/Logtalk/examples/classvars/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/inheritance/NOTES b/Logtalk/examples/inheritance/NOTES index 687cd3f68..dfb138501 100644 --- a/Logtalk/examples/inheritance/NOTES +++ b/Logtalk/examples/inheritance/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= @@ -12,5 +12,5 @@ This folder contains examples of public, protected and private inheritance, for both prototypes and classes/instances. The category "predicates" defines a set of three predicates, one public, one protected and one private. This category is imported by the root objects: "parent" for the prototypes and -"object" for the classes/instances. Each root object have a set of three +"root" for the classes/instances. Each root object have a set of three descendants, each one using one of the inheritance types. diff --git a/Logtalk/examples/inheritance/SCRIPT b/Logtalk/examples/inheritance/SCRIPT index 3ffc64603..7068418be 100644 --- a/Logtalk/examples/inheritance/SCRIPT +++ b/Logtalk/examples/inheritance/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= @@ -52,6 +52,36 @@ protected/0 - private yes +% descendant1 extends public::prototype1 + +| ?- descendant1::interface. + +interface/0 - public +public/0 - public +protected/0 - protected + +yes + + +% descendant2 extends public::prototype2 + +| ?- descendant2::interface. + +interface/0 - public +public/0 - protected +protected/0 - protected + +yes + + +% descendant3 extends public::prototype3 + +| ?- descendant3::interface. + +interface/0 - public + +yes + % object (root of the inheritance graph) interface diff --git a/Logtalk/examples/inheritance/inheritance.loader b/Logtalk/examples/inheritance/inheritance.loader index 05800dfa4..d8915c5fa 100644 --- a/Logtalk/examples/inheritance/inheritance.loader +++ b/Logtalk/examples/inheritance/inheritance.loader @@ -8,6 +8,9 @@ prototype1, prototype2, prototype3, + descendant1, + descendant2, + descendant3, root, subclass1, diff --git a/Logtalk/examples/instmethods/NOTES b/Logtalk/examples/instmethods/NOTES index 2b278822d..8bf6cb5fc 100644 --- a/Logtalk/examples/instmethods/NOTES +++ b/Logtalk/examples/instmethods/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/instmethods/SCRIPT b/Logtalk/examples/instmethods/SCRIPT index cea9edb12..39ca72657 100644 --- a/Logtalk/examples/instmethods/SCRIPT +++ b/Logtalk/examples/instmethods/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/lo/NOTES b/Logtalk/examples/lo/NOTES index 34a077be7..a45624ab2 100644 --- a/Logtalk/examples/lo/NOTES +++ b/Logtalk/examples/lo/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/lo/planner/NOTES b/Logtalk/examples/lo/planner/NOTES index 5de51e284..81a8494d1 100644 --- a/Logtalk/examples/lo/planner/NOTES +++ b/Logtalk/examples/lo/planner/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/lo/planner/SCRIPT b/Logtalk/examples/lo/planner/SCRIPT index 67685c8cc..66f734e13 100644 --- a/Logtalk/examples/lo/planner/SCRIPT +++ b/Logtalk/examples/lo/planner/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/lo/planner/planner.loader b/Logtalk/examples/lo/planner/planner.loader index 0ad0a62f4..d122cecd3 100644 --- a/Logtalk/examples/lo/planner/planner.loader +++ b/Logtalk/examples/lo/planner/planner.loader @@ -1,21 +1,21 @@ :- initialization( logtalk_load([ - aberdeen_air, - aiai, + plan1, airport, - albert_hall, - castle, + aberdeen_air, city, - edin, + london, + albert_hall, edinburgh, + edin, + aiai, + castle, fly, glasgow, imperial, lhr, - london, manchester, - plan1, renfrew, ringway, victoria])). diff --git a/Logtalk/examples/lo/travellers/NOTES b/Logtalk/examples/lo/travellers/NOTES index 087493275..1ed48eb4e 100644 --- a/Logtalk/examples/lo/travellers/NOTES +++ b/Logtalk/examples/lo/travellers/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/lo/travellers/SCRIPT b/Logtalk/examples/lo/travellers/SCRIPT index dda19030b..5b84226d0 100644 --- a/Logtalk/examples/lo/travellers/SCRIPT +++ b/Logtalk/examples/lo/travellers/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/lo/travellers/travellers.loader b/Logtalk/examples/lo/travellers/travellers.loader index cc55121b3..ec51af38c 100644 --- a/Logtalk/examples/lo/travellers/travellers.loader +++ b/Logtalk/examples/lo/travellers/travellers.loader @@ -1,6 +1,10 @@ :- initialization( logtalk_load([ + quick1, + + location2, + aberdeen, aberystwyth, birmingham, @@ -30,15 +34,12 @@ salesman, circular, + incremental, + presort, driving, geographic2, - incremental, metric1, permute, - presort, - - location2, descend, - quick1, natural])). diff --git a/Logtalk/examples/lpa/NOTES b/Logtalk/examples/lpa/NOTES index b11de8f53..cd6e970cb 100644 --- a/Logtalk/examples/lpa/NOTES +++ b/Logtalk/examples/lpa/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/lpa/SCRIPT b/Logtalk/examples/lpa/SCRIPT index b79c504d3..f5850c4e9 100644 --- a/Logtalk/examples/lpa/SCRIPT +++ b/Logtalk/examples/lpa/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/lpa/lpa.loader b/Logtalk/examples/lpa/lpa.loader index c477ae815..265c9b1ed 100644 --- a/Logtalk/examples/lpa/lpa.loader +++ b/Logtalk/examples/lpa/lpa.loader @@ -1,15 +1,15 @@ :- initialization( logtalk_load([ - cylinders, - distributor, - electrical, - engine, fault, + mechanical, + engine, + cylinders, + electrical, + starting, + sparking, + plugs, + distributor, fuel_system, lights, - mechanical, - plugs, - sparking, - starter_motor, - starting])). + starter_motor])). diff --git a/Logtalk/examples/metapredicates/NOTES b/Logtalk/examples/metapredicates/NOTES index d58a8c317..93ac35b57 100644 --- a/Logtalk/examples/metapredicates/NOTES +++ b/Logtalk/examples/metapredicates/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/metapredicates/SCRIPT b/Logtalk/examples/metapredicates/SCRIPT index 5034b36a0..d2312b029 100644 --- a/Logtalk/examples/metapredicates/SCRIPT +++ b/Logtalk/examples/metapredicates/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/metapredicates/metapredicates.loader b/Logtalk/examples/metapredicates/metapredicates.loader index 69611a6ec..3319f04e4 100644 --- a/Logtalk/examples/metapredicates/metapredicates.loader +++ b/Logtalk/examples/metapredicates/metapredicates.loader @@ -1,5 +1,5 @@ :- initialization( logtalk_load([ - sort1, - tracer])). + tracer, + sort1])). diff --git a/Logtalk/examples/mi/NOTES b/Logtalk/examples/mi/NOTES index 41f4644ca..169701b66 100644 --- a/Logtalk/examples/mi/NOTES +++ b/Logtalk/examples/mi/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/mi/SCRIPT b/Logtalk/examples/mi/SCRIPT index 548e34d15..8517a1fab 100644 --- a/Logtalk/examples/mi/SCRIPT +++ b/Logtalk/examples/mi/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/mi/mi.loader b/Logtalk/examples/mi/mi.loader index 9a2bc58cb..13e3be408 100644 --- a/Logtalk/examples/mi/mi.loader +++ b/Logtalk/examples/mi/mi.loader @@ -2,9 +2,9 @@ :- initialization( logtalk_load([ space, - space_time, time, + space_time, space3, - space_time4, - time1])). + time1, + space_time4])). diff --git a/Logtalk/examples/miscellaneous/NOTES b/Logtalk/examples/miscellaneous/NOTES index 6cc6a71ae..dbdb507f4 100644 --- a/Logtalk/examples/miscellaneous/NOTES +++ b/Logtalk/examples/miscellaneous/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/miscellaneous/SCRIPT b/Logtalk/examples/miscellaneous/SCRIPT index f1ca92b92..43f874803 100644 --- a/Logtalk/examples/miscellaneous/SCRIPT +++ b/Logtalk/examples/miscellaneous/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/parametric/NOTES b/Logtalk/examples/parametric/NOTES index 697ad16cd..929dacfc3 100644 --- a/Logtalk/examples/parametric/NOTES +++ b/Logtalk/examples/parametric/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/parametric/SCRIPT b/Logtalk/examples/parametric/SCRIPT index 2529e4f1b..c3bd684db 100644 --- a/Logtalk/examples/parametric/SCRIPT +++ b/Logtalk/examples/parametric/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/poem/poem.loader b/Logtalk/examples/poem/poem.loader index 9a2ae0606..9fe8983c8 100644 --- a/Logtalk/examples/poem/poem.loader +++ b/Logtalk/examples/poem/poem.loader @@ -1,7 +1,7 @@ :- initialization( logtalk_load([ - circle2, ellipse3, + circle2, line2, point2])). diff --git a/Logtalk/examples/points/NOTES b/Logtalk/examples/points/NOTES index 0ea979f8b..1a1002d8e 100644 --- a/Logtalk/examples/points/NOTES +++ b/Logtalk/examples/points/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/points/SCRIPT b/Logtalk/examples/points/SCRIPT index 0e20451d7..570ca16f2 100644 --- a/Logtalk/examples/points/SCRIPT +++ b/Logtalk/examples/points/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/points/points.loader b/Logtalk/examples/points/points.loader index 611c983e2..597ac0155 100644 --- a/Logtalk/examples/points/points.loader +++ b/Logtalk/examples/points/points.loader @@ -1,9 +1,9 @@ :- initialization( logtalk_load([ - bounded_coordinate, - bounded_history_point, - bounded_point, - history_point, point, - point_history])). + point_history, + bounded_coordinate, + bounded_point, + bounded_history_point, + history_point])). diff --git a/Logtalk/examples/polygons/NOTES b/Logtalk/examples/polygons/NOTES index af3f3845d..010a8bc77 100644 --- a/Logtalk/examples/polygons/NOTES +++ b/Logtalk/examples/polygons/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/polygons/SCRIPT b/Logtalk/examples/polygons/SCRIPT index f1d8d502e..565f136d7 100644 --- a/Logtalk/examples/polygons/SCRIPT +++ b/Logtalk/examples/polygons/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/polygons/polygons.loader b/Logtalk/examples/polygons/polygons.loader index dcc7edbed..13fd9f936 100644 --- a/Logtalk/examples/polygons/polygons.loader +++ b/Logtalk/examples/polygons/polygons.loader @@ -2,8 +2,8 @@ :- initialization( logtalk_load([ concentric, + polygon, hexagon, pentagon, - polygon, square, triangle])). diff --git a/Logtalk/examples/profiling/NOTES b/Logtalk/examples/profiling/NOTES index 4849a37cc..84502a5cf 100644 --- a/Logtalk/examples/profiling/NOTES +++ b/Logtalk/examples/profiling/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/profiling/SCRIPT b/Logtalk/examples/profiling/SCRIPT index b203ffaab..9fd150565 100644 --- a/Logtalk/examples/profiling/SCRIPT +++ b/Logtalk/examples/profiling/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/reflection/NOTES b/Logtalk/examples/reflection/NOTES index b56256b93..5b6132397 100644 --- a/Logtalk/examples/reflection/NOTES +++ b/Logtalk/examples/reflection/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/reflection/SCRIPT b/Logtalk/examples/reflection/SCRIPT index 49eeca75e..bbb92922f 100644 --- a/Logtalk/examples/reflection/SCRIPT +++ b/Logtalk/examples/reflection/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/relations/NOTES b/Logtalk/examples/relations/NOTES index 3edf07e30..23dc9a3f3 100644 --- a/Logtalk/examples/relations/NOTES +++ b/Logtalk/examples/relations/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/relations/SCRIPT b/Logtalk/examples/relations/SCRIPT index 0d8118871..0e30cbf75 100644 --- a/Logtalk/examples/relations/SCRIPT +++ b/Logtalk/examples/relations/SCRIPT @@ -1,12 +1,9 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= -% : - - -| ?- +% the objects in this example are used by several of the other examples. diff --git a/Logtalk/examples/roots/NOTES b/Logtalk/examples/roots/NOTES index 6ccc3150d..d18de1a03 100644 --- a/Logtalk/examples/roots/NOTES +++ b/Logtalk/examples/roots/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/roots/SCRIPT b/Logtalk/examples/roots/SCRIPT index 779d6733d..e61c03af3 100644 --- a/Logtalk/examples/roots/SCRIPT +++ b/Logtalk/examples/roots/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/roots/roots.loader b/Logtalk/examples/roots/roots.loader index 3cb4735cb..7ae7369b3 100644 --- a/Logtalk/examples/roots/roots.loader +++ b/Logtalk/examples/roots/roots.loader @@ -2,7 +2,7 @@ :- initialization( logtalk_load([ initialization, + classp, class, objectp, object, abstract_classp, abstract_class, - classp, class, nil])). diff --git a/Logtalk/examples/searching/NOTES b/Logtalk/examples/searching/NOTES index e11f48aee..a912f06a7 100644 --- a/Logtalk/examples/searching/NOTES +++ b/Logtalk/examples/searching/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= @@ -12,9 +12,10 @@ You will need to also load the objects in the roots example. You will also need to load the following files in the library directory: dates.loader, types.loader, events.loader, metapredicates.loader, and -hierarchies.loader. +hierarchies.loader. Alternatively, you can just load the all.loader file. Some of the code in this folder is adopted from the book "Prolog Programming for Artificial Intelligence" by Ivan Bratko. -The object "performance" only provides correct results for the first solution. +For a description of the search problems, please see a classical AI book +(such as the one above) or visit the url . diff --git a/Logtalk/examples/searching/SCRIPT b/Logtalk/examples/searching/SCRIPT index 4278f8f93..7ea36f743 100644 --- a/Logtalk/examples/searching/SCRIPT +++ b/Logtalk/examples/searching/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= @@ -43,8 +43,8 @@ CC.<__>..........MMMC ..........<__>.MMMCCC Cost = 15, -Path = [((3,3),esq,0,0),((2,2),dir,1,1),((3,2),esq,0,1),((3,0),dir,0,3),((3,1),esq,0,2),((1,1),dir,2,2),((2,2),esq,1,1),((0,2),dir,3,1),((0,3),esq,3,0),((0,1),dir,3,2),((0,2),esq,3,1),((0,0),dir,3,3)], -Initial = ((3,3),esq,0,0) +Path = [((3,3),left,0,0),((2,2),right,1,1),((3,2),left,0,1),((3,0),right,0,3),((3,1),left,0,2),((1,1),right,2,2),((2,2),left,1,1),((0,2),right,3,1),((0,3),left,3,0),((0,1),right,3,2),((0,2),left,3,1),((0,0),right,3,3)], +Initial = ((3,3),left,0,0) yes @@ -65,16 +65,43 @@ C..........<__>.MMMCC CC.<__>..........MMMC ..........<__>.MMMCCC solution length: 12 -number of state transitions: 27 -ratio solution length / state transitions: 0.4444444444444444 -minimum branching degree: 2 -average branching degree: 2.5555555555555554 +number of state transitions: 26 +ratio solution length / state transitions: 0.461538 +minimum branching degree: 1 +average branching degree: 2.30769 maximum branching degree: 3 -time: 0.067999999999756255 +time: 0.02 Cost = 15, -Path = [((3,3),esq,0,0),((2,2),dir,1,1),((3,2),esq,0,1),((3,0),dir,0,3),((3,1),esq,0,2),((1,1),dir,2,2),((2,2),esq,1,1),((0,2),dir,3,1),((0,3),esq,3,0),((0,1),dir,3,2),((0,2),esq,3,1),((0,0),dir,3,3)], -Initial = ((3,3),esq,0,0) ? +Path = [((3,3),left,0,0),((2,2),right,1,1),((3,2),left,0,1),((3,0),right,0,3),((3,1),left,0,2),((1,1),right,2,2),((2,2),left,1,1),((0,2),right,3,1),((0,3),left,3,0),((0,1),right,3,2),((0,2),left,3,1),((0,0),right,3,3)], +Initial = ((3,3),left,0,0) ? + +yes + + +% bridge problem, solved using a hill climbing strategy + +| ?- performance::init, bridge::initial_state(Initial), hill_climbing(30)::solve(bridge, Initial, Path, Cost), bridge::print_path(Path), performance::report. + + _|____________|_ lamp 1 3 6 8 12 +1 3 lamp _|____________|_ 6 8 12 +3 _|____________|_ lamp 1 6 8 12 +1 3 6 lamp _|____________|_ 8 12 +3 6 _|____________|_ lamp 1 8 12 +3 6 8 12 lamp _|____________|_ 1 +6 8 12 _|____________|_ lamp 1 3 +1 3 6 8 12 lamp _|____________|_ +solution length: 8 +state transitions: 346 +ratio solution length / state transitions: 0.0231214 +minimum branching degree: 1 +average branching degree: 7.42453 +maximum branching degree: 15 +time: 0.28 + +Initial = [], right, [1, 3, 6, 8, 12] +Path = [ ([], right, [1, 3, 6, 8, 12]), ([1, 3], left, [6, 8, 12]), ([3], right, [1, 6, 8, 12]), ([1, 3, 6], left, [8, 12]), ([3, 6], right, [1, 8|...]), ([3, 6|...], left, [1]), ([6|...], right, [...|...]), ([...|...], ..., ...)] +Cost = 29 yes @@ -104,11 +131,11 @@ yes solution length: 6 number of state transitions: 105 -ratio solution length / state transitions: 0.05714285714285714 +ratio solution length / state transitions: 0.0571429 minimum branching degree: 2 -average branching degree: 3.6315789473684212 +average branching degree: 3.63158 maximum branching degree: 4 -time: 0.20000000000027285 +time: 0.02 Path = [(0,0),(0,3),(3,0),(3,3),(4,2),(0,2)], Initial = (0,0) ? @@ -144,14 +171,14 @@ yes solution length: 8 number of state transitions: 12 -ratio solution length / state transitions: 0.6666666666666666 +ratio solution length / state transitions: 0.666667 minimum branching degree: 1 -average branching degree: 2.0 +average branching degree: 2 maximum branching degree: 3 -time: 0.021999999999934516 +time: 0.00 Path = [(0,0),(4,0),(4,3),(0,3),(3,0),(3,3),(4,2),(0,2)], Initial = (0,0) ? @@ -190,9 +217,9 @@ solution length: 6 number of state transitions: 15 ratio solution length / state transitions: 0.4 minimum branching degree: 2 -average branching degree: 3.1333333333333333 +average branching degree: 3.13333 maximum branching degree: 4 -time: 0.050000000000181899 +time: 0.01 Cost = 5, Path = [[2/1,1/2,1/3,3/3,3/2,3/1,2/2,1/1,2/3],[2/2,1/2,1/3,3/3,3/2,3/1,2/1,1/1,2/3],[2/3,1/2,1/3,3/3,3/2,3/1,2/1,1/1,2/2],[1/3,1/2,2/3,3/3,3/2,3/1,2/1,1/1,2/2],[1/2,1/3,2/3,3/3,3/2,3/1,2/1,1/1,2/2],[2/2,1/3,2/3,3/3,3/2,3/1,2/1,1/1,1/2]], @@ -232,9 +259,9 @@ solution length: 6 number of state transitions: 15 ratio solution length / state transitions: 0.4 minimum branching degree: 2 -average branching degree: 3.1333333333333333 +average branching degree: 3.13333 maximum branching degree: 4 -time: 0.046000000000276486 +time: 0.02 Cost = 5, Path = [[2/1,1/2,1/3,3/3,3/2,3/1,2/2,1/1,2/3],[2/2,1/2,1/3,3/3,3/2,3/1,2/1,1/1,2/3],[2/3,1/2,1/3,3/3,3/2,3/1,2/1,1/1,2/2],[1/3,1/2,2/3,3/3,3/2,3/1,2/1,1/1,2/2],[1/2,1/3,2/3,3/3,3/2,3/1,2/1,1/1,2/2],[2/2,1/3,2/3,3/3,3/2,3/1,2/1,1/1,1/2]], diff --git a/Logtalk/examples/searching/best_first1.lgt b/Logtalk/examples/searching/best_first1.lgt index 48e9d196f..44318e330 100644 --- a/Logtalk/examples/searching/best_first1.lgt +++ b/Logtalk/examples/searching/best_first1.lgt @@ -31,8 +31,8 @@ expand(Path, l(State,F/G), Threshold, Tree, Solved, Solution, Space, Cost) :- F =< Threshold, - (bagof(Next/Cost, - (Space::next_state(State, Next, Cost), \+ list::member(Next, Path)), + (bagof(Next/Cost2, + (Space::next_state(State, Next, Cost2), \+ list::member(Next, Path)), Successors) -> succlist(G, Successors, Trees, Threshold, Space), bestf(Trees, F2, Threshold), diff --git a/Logtalk/examples/searching/breadth_first1.lgt b/Logtalk/examples/searching/breadth_first1.lgt index 95c83ee5b..d6b43a617 100644 --- a/Logtalk/examples/searching/breadth_first1.lgt +++ b/Logtalk/examples/searching/breadth_first1.lgt @@ -11,9 +11,6 @@ parnames is ['Bound']]). - :- calls(state_space). - - :- uses(list). diff --git a/Logtalk/examples/searching/hill_climbing1.lgt b/Logtalk/examples/searching/hill_climbing1.lgt index 779177f6c..6642d325b 100644 --- a/Logtalk/examples/searching/hill_climbing1.lgt +++ b/Logtalk/examples/searching/hill_climbing1.lgt @@ -25,7 +25,6 @@ Space::goal_state(State). hill(Space, State, Threshold, Path, Solution, SoFar, Total) :- - SoFar < Threshold, findall( (Estimate, Cost, Next), (Space::next_state(State, Next, Cost), @@ -34,9 +33,10 @@ Estimate is Guess + Cost), States), list::sort(States, SortedStates), - list::member((_, Cost, Next), SortedStates), - SoFar2 is SoFar + Cost, - hill(Space, Next, Threshold, [State| Path], Solution, SoFar2, Total). + list::member((_, Cost2, Next2), SortedStates), + SoFar2 is SoFar + Cost2, + SoFar2 =< Threshold, + hill(Space, Next2, Threshold, [State| Path], Solution, SoFar2, Total). :- end_object. diff --git a/Logtalk/examples/searching/performance.lgt b/Logtalk/examples/searching/performance.lgt index 6adcea8a1..ed7bcaca0 100644 --- a/Logtalk/examples/searching/performance.lgt +++ b/Logtalk/examples/searching/performance.lgt @@ -66,7 +66,7 @@ write('average branching degree: '), write(Average), nl, write('maximum branching degree: '), write(Maximum), nl, write('time: '), write(Time), nl, - !. + ::retractall(transitions(_, _, _)). % clean up for next solution transitions(Number) :- @@ -87,9 +87,8 @@ findall(State2, ::transitions(State1, State2, _), States2), list::length(States2, Length)), Lengths), - list::sort(Lengths, SortedLengths), - SortedLengths = [Minimum| _], - list::reverse(SortedLengths, [Maximum| _]), + list::min(Lengths, Minimum), + list::max(Lengths, Maximum), numberlist::sum(Lengths, Sum), list::length(Lengths, Length), Average is Sum / Length. @@ -116,12 +115,14 @@ before(_, solve(_, _, _), _) :- !, time::cpu_time(Time), - ::assertz(start_time(Time)). + ::retractall(start_time(_)), + ::asserta(start_time(Time)). before(_, solve(_, _, _, _), _) :- !, time::cpu_time(Time), - ::assertz(start_time(Time)). + ::retractall(start_time(_)), + ::asserta(start_time(Time)). after(_, next_state(S1, S2), _) :- @@ -145,7 +146,8 @@ after(_, solve(_, _, Solution), _) :- !, time::cpu_time(Time), - ::assertz(end_time(Time)), + ::retractall(end_time(_)), + ::asserta(end_time(Time)), list::length(Solution, Length), ::retractall(solution_length(_)), ::asserta(solution_length(Length)). @@ -153,11 +155,11 @@ after(_, solve(_, _, Solution, _), _) :- !, time::cpu_time(Time), - ::assertz(end_time(Time)), + ::retractall(end_time(_)), + ::asserta(end_time(Time)), list::length(Solution, Length), ::retractall(solution_length(_)), ::asserta(solution_length(Length)). :- end_object. - diff --git a/Logtalk/examples/searching/searching.loader b/Logtalk/examples/searching/searching.loader index e715e234a..86378bf20 100644 --- a/Logtalk/examples/searching/searching.loader +++ b/Logtalk/examples/searching/searching.loader @@ -1,17 +1,18 @@ :- initialization( logtalk_load([ - best_first1, + state_space, + water_jug, + farmer, + heuristic_state_space, + bridge, + eight_puzzle, + miss_cann, + search_strategy, blind_search1, breadth_first1, depth_first1, - eight_puzzle, - farmer, heuristic_search1, - heuristic_state_space, + best_first1, hill_climbing1, - miss_cann, - performance, - search_strategy, - state_space, - water_jug])). + performance])). diff --git a/Logtalk/examples/searching/water_jug.lgt b/Logtalk/examples/searching/water_jug.lgt index cc31cef3d..f5a5f7ccd 100644 --- a/Logtalk/examples/searching/water_jug.lgt +++ b/Logtalk/examples/searching/water_jug.lgt @@ -31,7 +31,7 @@ next_state((X, Y), (Z, 3)) :- X > 0, Y < 3, - Aux is X + Y, Aux >= 4, + Aux is X + Y, Aux >= 3, Z is X - (3 - Y). next_state((X, Y),(Z, 0)) :- diff --git a/Logtalk/examples/sicstus/NOTES b/Logtalk/examples/sicstus/NOTES index 156113a1f..3a18730b8 100644 --- a/Logtalk/examples/sicstus/NOTES +++ b/Logtalk/examples/sicstus/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= @@ -10,5 +10,5 @@ The examples in this folder are adopted from the SICStus Prolog manual. To load all objects in this example consult the sicstus.loader utility file (note that the *.loader files are Prolog files). -You will also need to load the follwing files in library directory: +You will also need to load the following files in library directory: hierarchies.loader and types.loader. diff --git a/Logtalk/examples/sicstus/SCRIPT b/Logtalk/examples/sicstus/SCRIPT index 5bea8a22b..2e4a73dc1 100644 --- a/Logtalk/examples/sicstus/SCRIPT +++ b/Logtalk/examples/sicstus/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= @@ -9,7 +9,7 @@ Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. | ?- sort(rational)::sort([1/8, 2/7, 6/5, 2/9, 1/3], Sorted). Sorted = [1/8, 2/9, 2/7, 1/3, 6/5] -yes. +yes | ?- sort(colours)::sort([orange, indigo, red, yellow, violet, blue, green], Sorted). @@ -27,19 +27,19 @@ yes | ?- red_circle(3)::color(Color). Color = red -yes. +yes | ?- red_circle(3)::area(Area). Area = 28.274334 -yes. +yes | ?- red_circle(3)::ancestors(As). As = [circle(3, red), ellipse(3, 3, red)] -yes. +yes @@ -69,7 +69,7 @@ Side = 2 Width = 2 Height = 2 Area = 4 -yes. +yes | ?- square(2)::current_predicate(Pred). diff --git a/Logtalk/examples/sicstus/sicstus.loader b/Logtalk/examples/sicstus/sicstus.loader index 12111246a..37cbf80da 100644 --- a/Logtalk/examples/sicstus/sicstus.loader +++ b/Logtalk/examples/sicstus/sicstus.loader @@ -1,13 +1,13 @@ :- initialization( logtalk_load([ - circle11, + ellipse3, circle2, + circle11, + red_circle1, colours, math_constants, - ellipse3, rational, rectangle2, - red_circle1, sort1, square1])). diff --git a/Logtalk/examples/symdiff/NOTES b/Logtalk/examples/symdiff/NOTES index fdc5a0036..a47908fe6 100644 --- a/Logtalk/examples/symdiff/NOTES +++ b/Logtalk/examples/symdiff/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/symdiff/SCRIPT b/Logtalk/examples/symdiff/SCRIPT index a6b489408..547a6b046 100644 --- a/Logtalk/examples/symdiff/SCRIPT +++ b/Logtalk/examples/symdiff/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= @@ -16,7 +16,7 @@ S = 0 yes -% diffrentiate and then simplify the expression 2x^3 + x^2 - 4x +% differentiate and then simplify the expression 2x^3 + x^2 - 4x | ?- (2*x**3 + x**2 - 4*x)::diff(D), D::simplify(S). @@ -26,7 +26,7 @@ S = 2*(3*x**2)+2*x-4 yes -% diffrentiate and then simplify the expression ln(x^2 + 2x - 7) + 4x +% differentiate and then simplify the expression ln(x^2 + 2x - 7) + 4x | ?- (log(x**2 + 2*x - 7) + 4*x)::diff(D), D::simplify(S). diff --git a/Logtalk/examples/viewpoints/NOTES b/Logtalk/examples/viewpoints/NOTES index 85e587dc6..05129c4be 100644 --- a/Logtalk/examples/viewpoints/NOTES +++ b/Logtalk/examples/viewpoints/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/viewpoints/SCRIPT b/Logtalk/examples/viewpoints/SCRIPT index a4765af10..47464053c 100644 --- a/Logtalk/examples/viewpoints/SCRIPT +++ b/Logtalk/examples/viewpoints/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/NOTES b/Logtalk/library/NOTES index a8c69e3bf..a408d2850 100644 --- a/Logtalk/library/NOTES +++ b/Logtalk/library/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= @@ -8,16 +8,28 @@ Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. This folder contains objects, categories, and protocols that implement predicates for dealing with common Prolog types and structures. -To load all a group of objects, protocols and categories in this -library consult the corresponding *.loader utility file. +To load a group of objects, protocols, and categories in this library +consult the corresponding *.loader utility file. Currently, there are +seven groups of entities defined: -Some files represent work in progress and are not loaded by default by -any loader utility file. + dates + debugging + events + hierarchies + metapredicates + random + types + +There is also a file named all.loader that will load all entities in the +seven groups listed above. Specific notes about each group of objects, categories, and protocols can be found in the corresponding *.notes files. +Some files represent work in progress and are not loaded by default by +any loader utility file. + Some of the code in this library is based on public domain Prolog code, -in particular, adopted from the Edinburgh Prolog library. +in particular, code adopted from the Edinburgh Prolog library. All source files are formatted using four-spaces tabs. diff --git a/Logtalk/library/SCRIPT b/Logtalk/library/SCRIPT index 853dd8119..a045f6b29 100644 --- a/Logtalk/library/SCRIPT +++ b/Logtalk/library/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/all.loader b/Logtalk/library/all.loader new file mode 100644 index 000000000..1bdd4e709 --- /dev/null +++ b/Logtalk/library/all.loader @@ -0,0 +1,38 @@ + +:- initialization( + logtalk_load([ + datep, date, % dates + timep, time, + + event_handlersp, % events + event_registryp, event_registry, + before_event_registry, after_event_registry, + monitorp, monitor, + + debuggerp, % debugging + debugger, + + hierarchyp, % hierarchies + proto_hierarchyp, proto_hierarchy, + class_hierarchyp, class_hierarchy, + + metap, meta, % metapredicates + loopp, loop, + + randomp, % random + random, + + termp, term, % types + atomic, + atom, callable, + characterp, character, + number, float, integer, natural, + compound, + listp, list, difflist, + numberlistp, numberlist, + varlist, + queuep, queue, + dictionaryp, bintree, + setp, set, + comparingp])). + diff --git a/Logtalk/library/all.notes b/Logtalk/library/all.notes new file mode 100644 index 000000000..12ccb26f9 --- /dev/null +++ b/Logtalk/library/all.notes @@ -0,0 +1,11 @@ + +================================================================= +Logtalk - Object oriented extension to Prolog +Release 2.9.1 + +Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. +================================================================= + + +The all.loader file will load all the entities loaded by the other +loader files. diff --git a/Logtalk/library/dates.notes b/Logtalk/library/dates.notes index 35b7e2941..176dfb4f3 100644 --- a/Logtalk/library/dates.notes +++ b/Logtalk/library/dates.notes @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/debugging.notes b/Logtalk/library/debugging.notes index 6a7c01d5c..5dcf50b99 100644 --- a/Logtalk/library/debugging.notes +++ b/Logtalk/library/debugging.notes @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= @@ -9,7 +9,8 @@ Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. To load all objects in this group consult the debugging.loader utility file. -You will also need to load FIRST the events.loader file. +You will need to load FIRST the events.loader file otherwise you will get +a runtime error. The object debugger enables you to: diff --git a/Logtalk/library/events.notes b/Logtalk/library/events.notes index cc96f7656..602aaedca 100644 --- a/Logtalk/library/events.notes +++ b/Logtalk/library/events.notes @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/hierarchies.notes b/Logtalk/library/hierarchies.notes index d2b0c92d3..05321a195 100644 --- a/Logtalk/library/hierarchies.notes +++ b/Logtalk/library/hierarchies.notes @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/metapredicates.notes b/Logtalk/library/metapredicates.notes index be3fc3aad..7b47dbf2f 100644 --- a/Logtalk/library/metapredicates.notes +++ b/Logtalk/library/metapredicates.notes @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/random.notes b/Logtalk/library/random.notes index b182d2826..3978faa03 100644 --- a/Logtalk/library/random.notes +++ b/Logtalk/library/random.notes @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/setp.lgt b/Logtalk/library/setp.lgt index 573974fd4..6d155b42d 100644 --- a/Logtalk/library/setp.lgt +++ b/Logtalk/library/setp.lgt @@ -121,7 +121,6 @@ :- public(subset/2). :- mode(subset(+set, +set), zero_or_one). - :- mode(subset(?set, +set), zero_or_more). :- info(subset/2, [ comment is 'True if Subset is a subset of Set.', diff --git a/Logtalk/library/types.notes b/Logtalk/library/types.notes index 60bf0f073..851592aba 100644 --- a/Logtalk/library/types.notes +++ b/Logtalk/library/types.notes @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/manuals/NOTES b/Logtalk/manuals/NOTES index 96731c19b..0cda527df 100644 --- a/Logtalk/manuals/NOTES +++ b/Logtalk/manuals/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= @@ -8,9 +8,9 @@ Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. To consult the Logtalk documentation open the file index.html with a web browser. -Starting with version 2.6.0, all the pages are being converted to -conform to the HTML 4.01 Strict W3C Standard. In a future version, -they will also be XHTML 1.0 ready. You can change the appearence of -the pages by changing the included styles.css cascade style sheet file. -Needless to say, the manual pages look better in recent web navigator -releases that support both the HTML 4 and CSS1 web standards. +Starting with version 2.6.0, all the pages conform to the HTML 4.01 +Strict W3C Standard. In a future version, they will also be XHTML 1.0 +ready. You can change the appearence of the pages by changing the +included styles.css cascade style sheet file. Needless to say, the +manual pages look better in recent web browser releases that support +both the HTML 4 and CSS1 web standards. diff --git a/Logtalk/manuals/bibliography.html b/Logtalk/manuals/bibliography.html index e10645bd5..f5e519b2c 100644 --- a/Logtalk/manuals/bibliography.html +++ b/Logtalk/manuals/bibliography.html @@ -5,7 +5,7 @@ Logtalk Bibliography - + diff --git a/Logtalk/manuals/index.html b/Logtalk/manuals/index.html index 2bb0e3fcd..21b4e08cc 100644 --- a/Logtalk/manuals/index.html +++ b/Logtalk/manuals/index.html @@ -4,14 +4,14 @@ - Logtalk 2.8.4 Documentation + Logtalk 2.9.1 Documentation
-

Logtalk 2.8.4

+

Logtalk 2.9.1

Documentation

@@ -44,7 +44,7 @@ Portugal


-Last updated on: February 10, 2001 +Last updated on: November 26, 2001

Valid HTML 4.01! diff --git a/Logtalk/manuals/refman/builtins/abolish_category1.html b/Logtalk/manuals/refman/builtins/abolish_category1.html index 0ae16da2c..94f14defb 100644 --- a/Logtalk/manuals/refman/builtins/abolish_category1.html +++ b/Logtalk/manuals/refman/builtins/abolish_category1.html @@ -33,7 +33,7 @@ abolish_category(@category_identifier) -

Errors

+

Errors

@@ -61,7 +61,7 @@ abolish_category(@category_identifier) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/abolish_events5.html b/Logtalk/manuals/refman/builtins/abolish_events5.html index 380ede7a2..6bae51f63 100644 --- a/Logtalk/manuals/refman/builtins/abolish_events5.html +++ b/Logtalk/manuals/refman/builtins/abolish_events5.html @@ -33,7 +33,7 @@ abolish_events(@event, @object_identifier, @callable, @object_identifier, @objec
-

Errors

+

Errors

@@ -63,7 +63,7 @@ abolish_events(@event, @object_identifier, @callable, @object_identifier, @objec Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/abolish_object1.html b/Logtalk/manuals/refman/builtins/abolish_object1.html index 8c009a3ba..a9c28dabd 100644 --- a/Logtalk/manuals/refman/builtins/abolish_object1.html +++ b/Logtalk/manuals/refman/builtins/abolish_object1.html @@ -34,7 +34,7 @@ abolish_object(@object_identifier)
-

Errors

+

Errors

@@ -62,7 +62,7 @@ abolish_object(@object_identifier) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/abolish_protocol1.html b/Logtalk/manuals/refman/builtins/abolish_protocol1.html index 72b8d84fb..54463e211 100644 --- a/Logtalk/manuals/refman/builtins/abolish_protocol1.html +++ b/Logtalk/manuals/refman/builtins/abolish_protocol1.html @@ -33,7 +33,7 @@ abolish_protocol(@protocol_identifier)
-

Errors

+

Errors

@@ -61,7 +61,7 @@ abolish_protocol(@protocol_identifier) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/category_property2.html b/Logtalk/manuals/refman/builtins/category_property2.html index acbbb5c94..8afbbc643 100644 --- a/Logtalk/manuals/refman/builtins/category_property2.html +++ b/Logtalk/manuals/refman/builtins/category_property2.html @@ -33,7 +33,7 @@ category_property(?category_identifier, ?category_property)
-

Errors

+

Errors

@@ -57,7 +57,7 @@ category_property(?category_identifier, ?category_property) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/create_category4.html b/Logtalk/manuals/refman/builtins/create_category4.html index 43ec50d71..45af9fc9e 100644 --- a/Logtalk/manuals/refman/builtins/create_category4.html +++ b/Logtalk/manuals/refman/builtins/create_category4.html @@ -33,7 +33,7 @@ create_category(+category_identifier, +list, +list, +list)
-

Errors

+

Errors

@@ -67,7 +67,7 @@ create_category(+category_identifier, +list, +list, +list) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/create_object4.html b/Logtalk/manuals/refman/builtins/create_object4.html index 7ffdca4a3..120933ced 100644 --- a/Logtalk/manuals/refman/builtins/create_object4.html +++ b/Logtalk/manuals/refman/builtins/create_object4.html @@ -33,7 +33,7 @@ create_object(+object_identifier, +list, +list, +list)
-

Errors

+

Errors

@@ -67,7 +67,7 @@ create_object(+object_identifier, +list, +list, +list) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/create_protocol3.html b/Logtalk/manuals/refman/builtins/create_protocol3.html index 1968ac9db..f6b9f0d03 100644 --- a/Logtalk/manuals/refman/builtins/create_protocol3.html +++ b/Logtalk/manuals/refman/builtins/create_protocol3.html @@ -33,7 +33,7 @@ create_protocol(+protocol_identifier, +list, +list)
-

Errors

+

Errors

@@ -65,7 +65,7 @@ create_protocol(+protocol_identifier, +list, +list) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/current_category1.html b/Logtalk/manuals/refman/builtins/current_category1.html index 0519cd75c..714e24b52 100644 --- a/Logtalk/manuals/refman/builtins/current_category1.html +++ b/Logtalk/manuals/refman/builtins/current_category1.html @@ -33,7 +33,7 @@ current_category(?category_identifier)
-

Errors

+

Errors

@@ -55,7 +55,7 @@ current_category(?category_identifier) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/current_event5.html b/Logtalk/manuals/refman/builtins/current_event5.html index 705dfc89e..5e6c17c45 100644 --- a/Logtalk/manuals/refman/builtins/current_event5.html +++ b/Logtalk/manuals/refman/builtins/current_event5.html @@ -33,7 +33,7 @@ current_event(?event, ?object_identifier, ?callable, ?object_identifier, ?object
-

Errors

+

Errors

@@ -63,7 +63,7 @@ current_event(?event, ?object_identifier, ?callable, ?object_identifier, ?object Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/current_object1.html b/Logtalk/manuals/refman/builtins/current_object1.html index 46908632d..acf7dd158 100644 --- a/Logtalk/manuals/refman/builtins/current_object1.html +++ b/Logtalk/manuals/refman/builtins/current_object1.html @@ -33,7 +33,7 @@ current_object(?object_identifier)
-

Errors

+

Errors

@@ -55,7 +55,7 @@ current_object(?object_identifier) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/current_protocol1.html b/Logtalk/manuals/refman/builtins/current_protocol1.html index c0549da85..eca056374 100644 --- a/Logtalk/manuals/refman/builtins/current_protocol1.html +++ b/Logtalk/manuals/refman/builtins/current_protocol1.html @@ -33,7 +33,7 @@ current_protocol(?protocol_identifier)
-

Errors

+

Errors

@@ -55,7 +55,7 @@ current_protocol(?protocol_identifier) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/define_events5.html b/Logtalk/manuals/refman/builtins/define_events5.html index 92a600af6..24489c0d6 100644 --- a/Logtalk/manuals/refman/builtins/define_events5.html +++ b/Logtalk/manuals/refman/builtins/define_events5.html @@ -33,7 +33,7 @@ define_events(@event, @object_identifier, @callable, @object_identifier, +object
-

Errors

+

Errors

@@ -65,7 +65,7 @@ define_events(@event, @object_identifier, @callable, @object_identifier, +object Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/extends_object2_3.html b/Logtalk/manuals/refman/builtins/extends_object2_3.html index 5d3f2f79e..5c5dcf3aa 100644 --- a/Logtalk/manuals/refman/builtins/extends_object2_3.html +++ b/Logtalk/manuals/refman/builtins/extends_object2_3.html @@ -33,11 +33,11 @@ extends_object(Prototype, Parent, Scope)
 extends_object(?object_identifier, ?object_identifier)
 
-extends_object(?object_identifier, ?object_identifier, ?entity_scope)
+extends_object(?object_identifier, ?object_identifier, ?scope)
 
-

Errors

+

Errors

@@ -46,7 +46,7 @@ extends_object(?object_identifier, ?object_identifier, ?entity_scope)
Parent is neither a variable nor a valid object identifier:
type_error(object_identifier, Parent)
Scope is neither a variable nor a valid entity scope:
-
type_error(entity_scope, Scope)
+
type_error(scope, Scope)
@@ -65,7 +65,7 @@ extends_object(?object_identifier, ?object_identifier, ?entity_scope) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/extends_protocol2_3.html b/Logtalk/manuals/refman/builtins/extends_protocol2_3.html index 3079be828..655de6371 100644 --- a/Logtalk/manuals/refman/builtins/extends_protocol2_3.html +++ b/Logtalk/manuals/refman/builtins/extends_protocol2_3.html @@ -33,11 +33,11 @@ extends_protocol(Protocol1, Protocol2, Scope)
 extends_protocol(?protocol_identifier, ?protocol_identifier)
 
-extends_protocol(?protocol_identifier, ?protocol_identifier, ?entity_scope)
+extends_protocol(?protocol_identifier, ?protocol_identifier, ?scope)
 
-

Errors

+

Errors

@@ -46,7 +46,7 @@ extends_protocol(?protocol_identifier, ?protocol_identifier, ?entity_scope)
Protocol2 is neither a variable nor a valid protocol identifier:
type_error(protocol_identifier, Protocol2)
Scope is neither a variable nor a valid entity scope:
-
type_error(entity_scope, Scope)
+
type_error(scope, Scope)
@@ -65,7 +65,7 @@ extends_protocol(?protocol_identifier, ?protocol_identifier, ?entity_scope) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/forall2.html b/Logtalk/manuals/refman/builtins/forall2.html index 98244d528..e8ed3964c 100644 --- a/Logtalk/manuals/refman/builtins/forall2.html +++ b/Logtalk/manuals/refman/builtins/forall2.html @@ -33,7 +33,7 @@ forall(+callable, +callable) -

Errors

+

Errors

@@ -57,7 +57,7 @@ forall(+callable, +callable) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/implements_protocol2_3.html b/Logtalk/manuals/refman/builtins/implements_protocol2_3.html index bedad917c..e2e2ab07f 100644 --- a/Logtalk/manuals/refman/builtins/implements_protocol2_3.html +++ b/Logtalk/manuals/refman/builtins/implements_protocol2_3.html @@ -36,12 +36,12 @@ implements_protocol(Category, Protocol, Scope) implements_protocol(?object_identifier, ?protocol_identifier) implements_protocol(?category_identifier, ?protocol_identifier) -implements_protocol(?object_identifier, ?protocol_identifier, ?entity_scope) -implements_protocol(?category_identifier, ?protocol_identifier, ?entity_scope) +implements_protocol(?object_identifier, ?protocol_identifier, ?scope) +implements_protocol(?category_identifier, ?protocol_identifier, ?scope)
-

Errors

+

Errors

@@ -52,7 +52,7 @@ implements_protocol(?category_identifier, ?protocol_identifier, ?entity_scope)
Protocol is neither a variable nor a valid protocol identifier:
type_error(protocol_identifier, Protocol)
Scope is neither a variable nor a valid entity scope:
-
type_error(entity_scope, Scope)
+
type_error(scope, Scope)
@@ -71,7 +71,7 @@ implements_protocol(?category_identifier, ?protocol_identifier, ?entity_scope) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/imports_category2_3.html b/Logtalk/manuals/refman/builtins/imports_category2_3.html index 1996d4f71..d68bdb0a3 100644 --- a/Logtalk/manuals/refman/builtins/imports_category2_3.html +++ b/Logtalk/manuals/refman/builtins/imports_category2_3.html @@ -33,11 +33,11 @@ imports_category(Object, Category, Scope)
 imports_category(?object_identifier, ?category_identifier)
 
-imports_category(?object_identifier, ?category_identifier, ?entity_scope)
+imports_category(?object_identifier, ?category_identifier, ?scope)
 
-

Errors

+

Errors

@@ -46,7 +46,7 @@ imports_category(?object_identifier, ?category_identifier, ?entity_scope)
Category is neither a variable nor a valid category identifier:
type_error(category_identifier, Category)
Scope is neither a variable nor a valid entity scope:
-
type_error(entity_scope, Scope)
+
type_error(scope, Scope)
@@ -65,7 +65,7 @@ imports_category(?object_identifier, ?category_identifier, ?entity_scope) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/instantiates_class2_3.html b/Logtalk/manuals/refman/builtins/instantiates_class2_3.html index 156842ada..4a0861196 100644 --- a/Logtalk/manuals/refman/builtins/instantiates_class2_3.html +++ b/Logtalk/manuals/refman/builtins/instantiates_class2_3.html @@ -33,11 +33,11 @@ instantiates_class(Instance, Class, Scope)
 instantiates_class(?object_identifier, ?object_identifier)
 
-instantiates_class(?object_identifier, ?object_identifier, ?entity_scope)
+instantiates_class(?object_identifier, ?object_identifier, ?scope)
 
-

Errors

+

Errors

@@ -46,7 +46,7 @@ instantiates_class(?object_identifier, ?object_identifier, ?entity_scope)
Class is neither a variable nor a valid object identifier:
type_error(object_identifier, Class)
Scope is neither a variable nor a valid entity scope:
-
type_error(entity_scope, Scope)
+
type_error(scope, Scope)
@@ -65,7 +65,7 @@ instantiates_class(?object_identifier, ?object_identifier, ?entity_scope) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/logtalk_compile1.html b/Logtalk/manuals/refman/builtins/logtalk_compile1.html index ee15c05aa..f49c8aa1a 100644 --- a/Logtalk/manuals/refman/builtins/logtalk_compile1.html +++ b/Logtalk/manuals/refman/builtins/logtalk_compile1.html @@ -21,8 +21,10 @@ logtalk_compile(Entities)

-Compiles to disk a list of Logtalk entities (objects, protocols, or categories) using the default compiler options specified in the Logtalk configuration file. The Logtalk file name extension (by default, .lgt) should be omitted. Note that the argument is a list of entity/file names, not file paths. - +Compiles to disk a list of entities (objects, protocols, or categories) using the default compiler options specified in the Logtalk configuration file. The Logtalk file name extension (by default, .lgt) should be omitted. Note that the argument is a list of entity/file names, not file paths. In other words, the files must exist in your current working directory. +

+

+Note that only the errors related to problems in the predicate argument are listed below. Other exceptions may be thrown by the compiler if any of the compiled entities contain errors.

@@ -34,7 +36,7 @@ logtalk_compile(+atom_list) -

Errors

+

Errors

@@ -64,7 +66,7 @@ logtalk_compile(+atom_list) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: October 1, 2000 +Last updated on: October 22, 2001


diff --git a/Logtalk/manuals/refman/builtins/logtalk_compile2.html b/Logtalk/manuals/refman/builtins/logtalk_compile2.html index af56c4a51..5afdffcde 100644 --- a/Logtalk/manuals/refman/builtins/logtalk_compile2.html +++ b/Logtalk/manuals/refman/builtins/logtalk_compile2.html @@ -21,8 +21,13 @@ logtalk_compile(Entities, Options)

-Compiles to disk a list of Logtalk entities (objects, protocols, or categories) using a list of options. The Logtalk file name extension (by default, .lgt) should be omitted. Note that the first argument is a list of entity/file names, not file paths. - +Compiles to disk a list of entities (objects, protocols, or categories) using a list of options. The Logtalk file name extension (by default, .lgt) should be omitted. Note that the first argument is a list of entity/file names, not file paths. In other words, the files must exist in your current working directory. +

+

+For a description of the available compiler options, please consult the User Manual. +

+

+Note that only the errors related to problems in the predicate arguments are listed below. Other exceptions may be thrown by the compiler if any of the compiled entities contain errors.

@@ -34,7 +39,7 @@ logtalk_compile(+atom_list, +list) -

Errors

+

Errors

@@ -70,7 +75,7 @@ logtalk_compile(+atom_list, +list) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: October 1, 2000 +Last updated on: October 22, 2001


diff --git a/Logtalk/manuals/refman/builtins/logtalk_load1.html b/Logtalk/manuals/refman/builtins/logtalk_load1.html index 35467f086..8334c2731 100644 --- a/Logtalk/manuals/refman/builtins/logtalk_load1.html +++ b/Logtalk/manuals/refman/builtins/logtalk_load1.html @@ -21,8 +21,10 @@ logtalk_load(Entities)

-Compiles to disk and then loads to memory a list of Logtalk entities (objects, protocols or categories) using the default compiler options specified in the Logtalk configuration file. The Logtalk file name extension (by default, .lgt) should be omitted. Note that the argument is a list of entity/file names, not file paths. - +Compiles to disk and then loads to memory a list of entities (objects, protocols or categories) using the default compiler options specified in the Logtalk configuration file. The Logtalk file name extension (by default, .lgt) should be omitted. Note that the argument is a list of entity/file names, not file paths. In other words, the files must exist in your current working directory. +

+

+Note that only the errors related to problems in the predicate argument are listed below. Other exceptions may be thrown by the compiler if any of the loaded entities contain errors.

@@ -34,7 +36,7 @@ logtalk_load(+atom_list) -

Errors

+

Errors

@@ -64,7 +66,7 @@ logtalk_load(+atom_list) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: October 1, 2000 +Last updated on: October 22, 2001


diff --git a/Logtalk/manuals/refman/builtins/logtalk_load2.html b/Logtalk/manuals/refman/builtins/logtalk_load2.html index 4f32f15ad..3e00fc3c5 100644 --- a/Logtalk/manuals/refman/builtins/logtalk_load2.html +++ b/Logtalk/manuals/refman/builtins/logtalk_load2.html @@ -21,7 +21,13 @@ logtalk_load(Entities, Options)

-Compiles to disk and then loads to memory a Logtalk entity or a list of entities (objects, protocols or categories) using a list of options. The Logtalk file name extension (by default, .lgt) should be omitted. Note that the first argument is a list of entity/file names, not file paths. +Compiles to disk and then loads to memory a list of entities (objects, protocols or categories) using a list of options. The Logtalk file name extension (by default, .lgt) should be omitted. Note that the first argument is a list of entity/file names, not file paths. In other words, the files must exist in your current working directory. +

+

+For a description of the available compiler options, please consult the User Manual. +

+

+Note that only the errors related to problems in the predicate arguments are listed below. Other exceptions may be thrown by the compiler if any of the loaded entities contain errors.

@@ -33,7 +39,7 @@ logtalk_load(+atom_list, +list) -

Errors

+

Errors

@@ -69,7 +75,7 @@ logtalk_load(+atom_list, +list) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: October 1, 2000 +Last updated on: October 22, 2001


diff --git a/Logtalk/manuals/refman/builtins/logtalk_version3.html b/Logtalk/manuals/refman/builtins/logtalk_version3.html index 8743ceb9c..2b3fefd96 100644 --- a/Logtalk/manuals/refman/builtins/logtalk_version3.html +++ b/Logtalk/manuals/refman/builtins/logtalk_version3.html @@ -33,7 +33,7 @@ logtalk_version(?integer, ?integer, ?integer)
-

Errors

+

Errors

@@ -59,7 +59,7 @@ logtalk_version(?integer, ?integer, ?integer) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/object_property2.html b/Logtalk/manuals/refman/builtins/object_property2.html index 36075294a..9ddccb09b 100644 --- a/Logtalk/manuals/refman/builtins/object_property2.html +++ b/Logtalk/manuals/refman/builtins/object_property2.html @@ -33,7 +33,7 @@ object_property(?object_identifier, ?object_property)
-

Errors

+

Errors

@@ -57,7 +57,7 @@ object_property(?object_identifier, ?object_property) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/protocol_property2.html b/Logtalk/manuals/refman/builtins/protocol_property2.html index 4b39d14c9..cf8623d47 100644 --- a/Logtalk/manuals/refman/builtins/protocol_property2.html +++ b/Logtalk/manuals/refman/builtins/protocol_property2.html @@ -33,7 +33,7 @@ protocol_property(?protocol_identifier, ?protocol_property)
-

Errors

+

Errors

@@ -57,7 +57,7 @@ protocol_property(?protocol_identifier, ?protocol_property) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/retractall1.html b/Logtalk/manuals/refman/builtins/retractall1.html index c6e31ae71..69b4c0407 100644 --- a/Logtalk/manuals/refman/builtins/retractall1.html +++ b/Logtalk/manuals/refman/builtins/retractall1.html @@ -33,7 +33,7 @@ retractall(+callable)
-

Errors

+

Errors

@@ -55,7 +55,7 @@ retractall(+callable) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/builtins/specializes_class2_3.html b/Logtalk/manuals/refman/builtins/specializes_class2_3.html index b030c81f3..7f8de5a75 100644 --- a/Logtalk/manuals/refman/builtins/specializes_class2_3.html +++ b/Logtalk/manuals/refman/builtins/specializes_class2_3.html @@ -33,11 +33,11 @@ specializes_class(Class, Superclass, Scope)
 specializes_class(?object_identifier, ?object_identifier)
 
-specializes_class(?object_identifier, ?object_identifier, ?entity_scope)
+specializes_class(?object_identifier, ?object_identifier, ?scope)
 
-

Errors

+

Errors

@@ -46,7 +46,7 @@ specializes_class(?object_identifier, ?object_identifier, ?entity_scope)
Superclass is neither a variable nor a valid object identifier:
type_error(object_identifier, Superclass)
Scope is neither a variable nor a valid entity scope:
-
type_error(entity_scope, Scope)
+
type_error(scope, Scope)
@@ -65,7 +65,7 @@ specializes_class(?object_identifier, ?object_identifier, ?entity_scope) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/control/external1.html b/Logtalk/manuals/refman/control/external1.html index f1e161955..0927eb55a 100644 --- a/Logtalk/manuals/refman/control/external1.html +++ b/Logtalk/manuals/refman/control/external1.html @@ -33,7 +33,7 @@ -

Errors

+

Errors

@@ -55,7 +55,7 @@ N1/D1 < N2/D2 :- Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: October 8, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/control/to_object2.html b/Logtalk/manuals/refman/control/to_object2.html index 818361633..9ea602b84 100644 --- a/Logtalk/manuals/refman/control/to_object2.html +++ b/Logtalk/manuals/refman/control/to_object2.html @@ -23,7 +23,7 @@ Object::Predicate (Object1, Object2, ...)::Predicate -(Object1; Object2, ...)::Predicate +(Object1; Object2; ...)::Predicate Object::(Predicate1, Predicate2, ...) @@ -42,7 +42,7 @@ Sends a message to an object. The message argument must match a public predicate
-

Errors

+

Errors

@@ -72,7 +72,7 @@ Sends a message to an object. The message argument must match a public predicate Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: October 7, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/control/to_self1.html b/Logtalk/manuals/refman/control/to_self1.html index 3226e630c..512f299c3 100644 --- a/Logtalk/manuals/refman/control/to_self1.html +++ b/Logtalk/manuals/refman/control/to_self1.html @@ -37,7 +37,7 @@
-

Errors

+

Errors

@@ -66,7 +66,7 @@ area(Area) :- Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: October 8, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/control/to_super1.html b/Logtalk/manuals/refman/control/to_super1.html index 5a1350395..93876fe65 100644 --- a/Logtalk/manuals/refman/control/to_super1.html +++ b/Logtalk/manuals/refman/control/to_super1.html @@ -33,7 +33,7 @@
-

Errors

+

Errors

@@ -63,7 +63,7 @@ init :- Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/calls1.html b/Logtalk/manuals/refman/directives/calls1.html index ab45ece40..9c629abe8 100644 --- a/Logtalk/manuals/refman/directives/calls1.html +++ b/Logtalk/manuals/refman/directives/calls1.html @@ -49,7 +49,7 @@ calls(+protocol_identifiers) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/category1_2.html b/Logtalk/manuals/refman/directives/category1_2.html index d81b4f449..5d2b06f14 100644 --- a/Logtalk/manuals/refman/directives/category1_2.html +++ b/Logtalk/manuals/refman/directives/category1_2.html @@ -59,7 +59,7 @@ category(+category_identifier, Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/discontiguous1.html b/Logtalk/manuals/refman/directives/discontiguous1.html index c573ce229..c7cd57440 100644 --- a/Logtalk/manuals/refman/directives/discontiguous1.html +++ b/Logtalk/manuals/refman/directives/discontiguous1.html @@ -53,7 +53,7 @@ discontiguous(+predicate_indicator_term) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/dynamic0.html b/Logtalk/manuals/refman/directives/dynamic0.html index 90a09d9f9..a341cc977 100644 --- a/Logtalk/manuals/refman/directives/dynamic0.html +++ b/Logtalk/manuals/refman/directives/dynamic0.html @@ -21,7 +21,7 @@ dynamic

-Declares an entity and all of its directives and clauses dynamic. +Declares an entity and all of its clauses dynamic.

@@ -47,7 +47,7 @@ dynamic Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/dynamic1.html b/Logtalk/manuals/refman/directives/dynamic1.html index de60f908a..47bcb7d0e 100644 --- a/Logtalk/manuals/refman/directives/dynamic1.html +++ b/Logtalk/manuals/refman/directives/dynamic1.html @@ -53,7 +53,7 @@ dynamic(+predicate_indicator_term) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/end_category0.html b/Logtalk/manuals/refman/directives/end_category0.html index a0e9b2cb4..a58d15033 100644 --- a/Logtalk/manuals/refman/directives/end_category0.html +++ b/Logtalk/manuals/refman/directives/end_category0.html @@ -47,7 +47,7 @@ end_category Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/end_object0.html b/Logtalk/manuals/refman/directives/end_object0.html index 025c14ee6..f938bb256 100644 --- a/Logtalk/manuals/refman/directives/end_object0.html +++ b/Logtalk/manuals/refman/directives/end_object0.html @@ -47,7 +47,7 @@ end_object Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/end_protocol0.html b/Logtalk/manuals/refman/directives/end_protocol0.html index 2afeb9ab1..61bb76eff 100644 --- a/Logtalk/manuals/refman/directives/end_protocol0.html +++ b/Logtalk/manuals/refman/directives/end_protocol0.html @@ -47,7 +47,7 @@ end_protocol Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/info1.html b/Logtalk/manuals/refman/directives/info1.html index d2fddb799..87a198d31 100644 --- a/Logtalk/manuals/refman/directives/info1.html +++ b/Logtalk/manuals/refman/directives/info1.html @@ -51,7 +51,7 @@ info(+info_list) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/info2.html b/Logtalk/manuals/refman/directives/info2.html index 5e549e2f0..dd9a05d66 100644 --- a/Logtalk/manuals/refman/directives/info2.html +++ b/Logtalk/manuals/refman/directives/info2.html @@ -49,7 +49,7 @@ info(+predicate_indicator, +info_list) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/initialization1.html b/Logtalk/manuals/refman/directives/initialization1.html index 46af7e542..9cba7100b 100644 --- a/Logtalk/manuals/refman/directives/initialization1.html +++ b/Logtalk/manuals/refman/directives/initialization1.html @@ -47,7 +47,7 @@ initialization(@goal) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/metapredicate1.html b/Logtalk/manuals/refman/directives/metapredicate1.html index eda5cec11..2b2895d6a 100644 --- a/Logtalk/manuals/refman/directives/metapredicate1.html +++ b/Logtalk/manuals/refman/directives/metapredicate1.html @@ -49,7 +49,7 @@ metapredicate(+metapredicate_predicate_term) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/mode2.html b/Logtalk/manuals/refman/directives/mode2.html index f12f39a45..458989105 100644 --- a/Logtalk/manuals/refman/directives/mode2.html +++ b/Logtalk/manuals/refman/directives/mode2.html @@ -53,7 +53,7 @@ mode(+predicate_mode_term, +number_of_solutions) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/object1_4.html b/Logtalk/manuals/refman/directives/object1_4.html index f74abaf6d..657d4dbaa 100644 --- a/Logtalk/manuals/refman/directives/object1_4.html +++ b/Logtalk/manuals/refman/directives/object1_4.html @@ -263,7 +263,7 @@ object(+object_identifier, Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/op3.html b/Logtalk/manuals/refman/directives/op3.html index ab029f013..3bf5187ae 100644 --- a/Logtalk/manuals/refman/directives/op3.html +++ b/Logtalk/manuals/refman/directives/op3.html @@ -49,7 +49,7 @@ op(+integer, +associativity, +atom) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/private1.html b/Logtalk/manuals/refman/directives/private1.html index 3a94be09f..237043407 100644 --- a/Logtalk/manuals/refman/directives/private1.html +++ b/Logtalk/manuals/refman/directives/private1.html @@ -52,7 +52,7 @@ private(+predicate_indicator_term) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/protected1.html b/Logtalk/manuals/refman/directives/protected1.html index d0ccd9c39..8039ef8b6 100644 --- a/Logtalk/manuals/refman/directives/protected1.html +++ b/Logtalk/manuals/refman/directives/protected1.html @@ -53,7 +53,7 @@ protected(+predicate_indicator_term) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/protocol1_2.html b/Logtalk/manuals/refman/directives/protocol1_2.html index f04e5b003..f4e392440 100644 --- a/Logtalk/manuals/refman/directives/protocol1_2.html +++ b/Logtalk/manuals/refman/directives/protocol1_2.html @@ -59,7 +59,7 @@ protocol(+protocol_identifier, Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/public1.html b/Logtalk/manuals/refman/directives/public1.html index ef4d9bceb..b72a264ce 100644 --- a/Logtalk/manuals/refman/directives/public1.html +++ b/Logtalk/manuals/refman/directives/public1.html @@ -53,7 +53,7 @@ public(+predicate_indicator_term) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/directives/uses1.html b/Logtalk/manuals/refman/directives/uses1.html index 5609b260a..ed5f81acd 100644 --- a/Logtalk/manuals/refman/directives/uses1.html +++ b/Logtalk/manuals/refman/directives/uses1.html @@ -49,7 +49,7 @@ uses(+object_identifiers) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/grammar.html b/Logtalk/manuals/refman/grammar.html index 391acbe87..f4d27bbea 100644 --- a/Logtalk/manuals/refman/grammar.html +++ b/Logtalk/manuals/refman/grammar.html @@ -4,8 +4,8 @@ - Logtalk 2.8.4 Grammar - + Logtalk Grammar + @@ -167,7 +167,7 @@ The Logtalk grammar is here described using Backus-Naur Form syntax. Non-termina
implemented_protocol ::=
protocol_identifier |
-
entity_scope "::" protocol_identifier
+
scope "::" protocol_identifier

@@ -194,7 +194,7 @@ The Logtalk grammar is here described using Backus-Naur Form syntax. Non-termina
extended_protocol ::=
protocol_identifier |
-
entity_scope "::" protocol_identifier
+
scope "::" protocol_identifier

@@ -221,7 +221,7 @@ The Logtalk grammar is here described using Backus-Naur Form syntax. Non-termina
imported_category ::=
category_identifier |
-
entity_scope "::" category_identifier
+
scope "::" category_identifier

@@ -248,7 +248,7 @@ The Logtalk grammar is here described using Backus-Naur Form syntax. Non-termina
extended_object ::=
object_identifier |
-
entity_scope "::" object_identifier
+
scope "::" object_identifier

@@ -275,7 +275,7 @@ The Logtalk grammar is here described using Backus-Naur Form syntax. Non-termina
instantiated_object ::=
object_identifier |
-
entity_scope "::" object_identifier
+
scope "::" object_identifier

@@ -302,7 +302,7 @@ The Logtalk grammar is here described using Backus-Naur Form syntax. Non-termina
specialized_object ::=
object_identifier |
-
entity_scope "::" object_identifier
+
scope "::" object_identifier

@@ -317,10 +317,10 @@ The Logtalk grammar is here described using Backus-Naur Form syntax. Non-termina
-

Entity scope

+

Entity scope

-
entity_scope ::=
+
scope ::=
"public" |
"protected" |
"private"
@@ -633,28 +633,20 @@ The Logtalk grammar is here described using Backus-Naur Form syntax. Non-termina
"argnames" | "definition" | "redefinition" | "allocation" |
atom
- -
-

Clauses

+

Clauses and goals

-
-
clauses ::=
-
clause |
-
clause clauses
-
goal ::=
callable |
message_call |
external_call |
-
built_in_method_call
@@ -710,13 +702,6 @@ The Logtalk grammar is here described using Backus-Naur Form syntax. Non-termina
"{" callable "}"
-
-
built_in_method_call ::=
-
"self(" variable ")" |
-
"this(" variable ")" |
-
"sender(" variable ")" |
-
"parameter(" integer "," variable ")"
-

Entity properties

@@ -768,7 +753,7 @@ The Logtalk grammar is here described using Backus-Naur Form syntax. Non-termina Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: February 10, 2001 +Last updated on: November 26, 2001


diff --git a/Logtalk/manuals/refman/index.html b/Logtalk/manuals/refman/index.html index d2cdf9f42..0400e4aef 100644 --- a/Logtalk/manuals/refman/index.html +++ b/Logtalk/manuals/refman/index.html @@ -4,8 +4,8 @@ - Logtalk 2.8.4 Reference Manual - + Logtalk 2.9.1 Reference Manual + @@ -30,7 +30,7 @@
Extended objects
Instantiated objects
Specialized objects
-
Entity scope
+
Entity scope
Entity identifiers
Object identifiers
Category identifiers
@@ -183,7 +183,7 @@ User manual | Tutorial | Bibliography | Glossary

-Last updated on: February 10, 2001 +Last updated on: November 26, 2001


diff --git a/Logtalk/manuals/refman/methods/abolish1.html b/Logtalk/manuals/refman/methods/abolish1.html index fd8cd76f5..b8d7287df 100644 --- a/Logtalk/manuals/refman/methods/abolish1.html +++ b/Logtalk/manuals/refman/methods/abolish1.html @@ -34,7 +34,7 @@ abolish(+predicate_indicator) -

Errors

+

Errors

@@ -77,7 +77,7 @@ abolish(+predicate_indicator) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/after3.html b/Logtalk/manuals/refman/methods/after3.html index c1bbd0e17..75e50e63e 100644 --- a/Logtalk/manuals/refman/methods/after3.html +++ b/Logtalk/manuals/refman/methods/after3.html @@ -33,7 +33,7 @@ after(?object, ?term, ?object)
-

Errors

+

Errors

@@ -56,7 +56,7 @@ after(Object, Message, Sender) :- Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/asserta1.html b/Logtalk/manuals/refman/methods/asserta1.html index 70d3aa48d..91a6904c2 100644 --- a/Logtalk/manuals/refman/methods/asserta1.html +++ b/Logtalk/manuals/refman/methods/asserta1.html @@ -34,7 +34,7 @@ asserta(+clause)
-

Errors

+

Errors

@@ -73,7 +73,7 @@ asserta(+clause) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/assertz1.html b/Logtalk/manuals/refman/methods/assertz1.html index 1277fde1d..6374e7d99 100644 --- a/Logtalk/manuals/refman/methods/assertz1.html +++ b/Logtalk/manuals/refman/methods/assertz1.html @@ -34,7 +34,7 @@ assertz(+clause)
-

Errors

+

Errors

@@ -73,7 +73,7 @@ assertz(+clause) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/bagof3.html b/Logtalk/manuals/refman/methods/bagof3.html index 4679da80c..939e81bbc 100644 --- a/Logtalk/manuals/refman/methods/bagof3.html +++ b/Logtalk/manuals/refman/methods/bagof3.html @@ -33,7 +33,7 @@ bagof(@term, +callable, -list)
-

Errors

+

Errors

@@ -59,7 +59,7 @@ bagof(@term, +callable, -list) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/before3.html b/Logtalk/manuals/refman/methods/before3.html index 51ae36e2f..7343577f3 100644 --- a/Logtalk/manuals/refman/methods/before3.html +++ b/Logtalk/manuals/refman/methods/before3.html @@ -33,7 +33,7 @@ before(?object, ?term, ?object)
-

Errors

+

Errors

@@ -56,7 +56,7 @@ before(Object, Message, Sender) :- Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/clause2.html b/Logtalk/manuals/refman/methods/clause2.html index d02410f99..bac5c85fa 100644 --- a/Logtalk/manuals/refman/methods/clause2.html +++ b/Logtalk/manuals/refman/methods/clause2.html @@ -33,7 +33,7 @@ clause(?callable, ?body)
-

Errors

+

Errors

@@ -72,7 +72,7 @@ clause(?callable, ?body) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/current_predicate1.html b/Logtalk/manuals/refman/methods/current_predicate1.html index 513aaf7cd..e2c4cb0d6 100644 --- a/Logtalk/manuals/refman/methods/current_predicate1.html +++ b/Logtalk/manuals/refman/methods/current_predicate1.html @@ -33,7 +33,7 @@ current_predicate(?predicate_indicator)
-

Errors

+

Errors

@@ -60,7 +60,7 @@ current_predicate(?predicate_indicator) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/findall3.html b/Logtalk/manuals/refman/methods/findall3.html index 20ce9a4c4..513f3fb83 100644 --- a/Logtalk/manuals/refman/methods/findall3.html +++ b/Logtalk/manuals/refman/methods/findall3.html @@ -33,7 +33,7 @@ findall(@term, +callable, -list)
-

Errors

+

Errors

@@ -59,7 +59,7 @@ findall(@term, +callable, -list) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/forall2.html b/Logtalk/manuals/refman/methods/forall2.html index 5bcc12170..d0b8dc5a2 100644 --- a/Logtalk/manuals/refman/methods/forall2.html +++ b/Logtalk/manuals/refman/methods/forall2.html @@ -34,7 +34,7 @@ forall(+callable, +callable)
-

Errors

+

Errors

@@ -65,7 +65,7 @@ forall(+callable, +callable) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/parameter2.html b/Logtalk/manuals/refman/methods/parameter2.html index 07e5c4809..e03acede0 100644 --- a/Logtalk/manuals/refman/methods/parameter2.html +++ b/Logtalk/manuals/refman/methods/parameter2.html @@ -33,7 +33,7 @@ parameter(+integer, ?term)
-

Errors

+

Errors

@@ -68,7 +68,7 @@ parameter(+integer, ?term) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/predicate_property2.html b/Logtalk/manuals/refman/methods/predicate_property2.html index 782351ab4..9f7540520 100644 --- a/Logtalk/manuals/refman/methods/predicate_property2.html +++ b/Logtalk/manuals/refman/methods/predicate_property2.html @@ -33,7 +33,7 @@ predicate_property(+callable, ?predicate_property)
-

Errors

+

Errors

@@ -64,7 +64,7 @@ predicate_property(+callable, ?predicate_property) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/retract1.html b/Logtalk/manuals/refman/methods/retract1.html index d72c63bd7..25a7fd19b 100644 --- a/Logtalk/manuals/refman/methods/retract1.html +++ b/Logtalk/manuals/refman/methods/retract1.html @@ -34,7 +34,7 @@ retract(+clause)
-

Errors

+

Errors

@@ -71,7 +71,7 @@ retract(+clause) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/retractall1.html b/Logtalk/manuals/refman/methods/retractall1.html index 4bb1416cb..65eb3976b 100644 --- a/Logtalk/manuals/refman/methods/retractall1.html +++ b/Logtalk/manuals/refman/methods/retractall1.html @@ -33,7 +33,7 @@ retractall(+callable)
-

Errors

+

Errors

@@ -70,7 +70,7 @@ retractall(+callable) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/self1.html b/Logtalk/manuals/refman/methods/self1.html index 97def6fa8..1a0f53138 100644 --- a/Logtalk/manuals/refman/methods/self1.html +++ b/Logtalk/manuals/refman/methods/self1.html @@ -33,7 +33,7 @@ self(-object)
-

Errors

+

Errors

@@ -57,7 +57,7 @@ test :- Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: February 10, 2001 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/sender1.html b/Logtalk/manuals/refman/methods/sender1.html index b89f6299a..11f13cd42 100644 --- a/Logtalk/manuals/refman/methods/sender1.html +++ b/Logtalk/manuals/refman/methods/sender1.html @@ -33,7 +33,7 @@ sender(-object)
-

Errors

+

Errors

@@ -57,7 +57,7 @@ test :- Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: February 10, 2001 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/setof3.html b/Logtalk/manuals/refman/methods/setof3.html index 0104609a1..6e3fd6b00 100644 --- a/Logtalk/manuals/refman/methods/setof3.html +++ b/Logtalk/manuals/refman/methods/setof3.html @@ -33,7 +33,7 @@ setof(@term, +callable, -list)
-

Errors

+

Errors

@@ -59,7 +59,7 @@ setof(@term, +callable, -list) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/refman/methods/this1.html b/Logtalk/manuals/refman/methods/this1.html index a2b44315a..db58874cf 100644 --- a/Logtalk/manuals/refman/methods/this1.html +++ b/Logtalk/manuals/refman/methods/this1.html @@ -33,7 +33,7 @@ this(-object_identifier)
-

Errors

+

Errors

@@ -57,7 +57,7 @@ test :- Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: October 21, 2001


diff --git a/Logtalk/manuals/styles.css b/Logtalk/manuals/styles.css index 7480fbdfe..13c402c3b 100644 --- a/Logtalk/manuals/styles.css +++ b/Logtalk/manuals/styles.css @@ -40,7 +40,9 @@ body { } h1, h2, h3, h4, h5, h6 { - color: maroon; font-family: helvetica, arial, sans-serif; } + color: maroon; + font-family: helvetica, arial, sans-serif; +} .center { text-align: center; } diff --git a/Logtalk/manuals/tutorial/attributes.html b/Logtalk/manuals/tutorial/attributes.html index 2c6dd2639..0db0f1366 100644 --- a/Logtalk/manuals/tutorial/attributes.html +++ b/Logtalk/manuals/tutorial/attributes.html @@ -48,16 +48,16 @@ When defining category predicates, we need to remember that a category can be im :- mode(set_attribute(+nonvar, +nonvar), one). :- public(get_attribute/2). - :- mode(get_attribute(?nonvar, ?nonvar), zero_or_many). + :- mode(get_attribute(?nonvar, ?nonvar), zero_or_more). :- public(del_attribute/2). - :- mode(del_attribute(?nonvar, ?nonvar), zero_or_many). + :- mode(del_attribute(?nonvar, ?nonvar), zero_or_more). :- public(del_attributes/2). :- mode(del_attributes(@term, @term), one). :- private(attribute_/2). - :- mode(attribute_(?nonvar, ?nonvar), zero_or_many). + :- mode(attribute_(?nonvar, ?nonvar), zero_or_more). :- dynamic(attribute_/2). @@ -146,7 +146,7 @@ After compiling and loading this object and our category, we can now try queries Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: March 12, 2001


diff --git a/Logtalk/manuals/tutorial/index.html b/Logtalk/manuals/tutorial/index.html index 3353bc2f1..4bfc51af4 100644 --- a/Logtalk/manuals/tutorial/index.html +++ b/Logtalk/manuals/tutorial/index.html @@ -4,7 +4,7 @@ - Logtalk 2.8.4 Tutorial + Logtalk 2.9.1 Tutorial @@ -48,7 +48,7 @@ User manual | Reference manual | Bibliography | Glossary

-Last updated on: October 1, 2000 +Last updated on: November 26, 2001


diff --git a/Logtalk/manuals/userman/documenting.html b/Logtalk/manuals/userman/documenting.html index fca682090..bdfe093a2 100644 --- a/Logtalk/manuals/userman/documenting.html +++ b/Logtalk/manuals/userman/documenting.html @@ -117,7 +117,7 @@ Use only the keywords that make sense for your application and remember that you The XML documenting files are (by default) automatically generated when you compile a Logtalk entity. For example, assuming the default filename extensions, compiling a sort1.lgt file generates a sort1.pl Prolog file and a sort1.xml XML file. The filename extension for each kind of file can be changed in the config files via the lgt_file_extension/2 predicate.

-Each XML file contains references to two other files: logtalk.dtd, a DTD file describing the XML file structure, and a XSL style sheet file responsible for converting the XML files to some desired format like HTML. The name of the XSL file can be changed in the configuration files via the lgt_file_name/2 predicate. The default value is logtalk.xsl, a XSL file that converts Logtalk XML files to HTML files. The HTML output refers a CSS file, logtalk.css, that specifies how the HTML code will be rendered. The three default logtalk.* files are contained in the xml sub-directory in the Logtalk installation directory. This directory may also contain other files for specific XSLT processors or for converting XML to other formats besides HTML. Please read the NOTES file included in the directory for details. +Each XML file contains references to two other files: logtalk.dtd, a DTD file describing the XML file structure, and a XSL style sheet file responsible for converting the XML files to some desired format like HTML. The name of the XSL file can be changed in the configuration files via the lgt_file_name/2 predicate. The default value is lgtxml.xsl, a XSL file that enables Logtalk XML files to be viewed directly in a web browser. The HTML output refers a CSS file, logtalk.css, that specifies how the HTML code will be rendered. The three default files are contained in the xml sub-directory in the Logtalk installation directory. This directory may also contain other files for specific XSLT processors or for converting XML to other formats besides HTML. Please read the NOTES file included in the directory for details.

There is a set of compilers options, used with the Logtalk logtalk_load/2 or the logtalk_compile/2 built-in predicates, that can be used to control the generation of the XML documentation files. Please see the Installing and running Logtalk section of this manual for details. @@ -134,7 +134,7 @@ To view the XML documenting files you can open them in a web browser that suppor Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: February 10, 2001 +Last updated on: October 6, 2001


diff --git a/Logtalk/manuals/userman/errors.html b/Logtalk/manuals/userman/errors.html index c60edc099..4ec99caab 100644 --- a/Logtalk/manuals/userman/errors.html +++ b/Logtalk/manuals/userman/errors.html @@ -51,6 +51,12 @@ The Logtalk pre-processor/compiler uses the read_term/3 ISO Prolog If all the (Prolog) terms in a source file are valid, then there is a set of errors or potential errors, described below, that the pre-processor will try to detect and report, depending on the used compiler options (see the Installing and running Logtalk section of this manual for details).

+

Unknown entities

+ +

+The Logtalk pre-processor/compiler will warn us of any referenced entity that is not currently loaded. The warning may reveal a misspell entity name or just an entity that it will be loaded next. +

+

Singleton variables

@@ -75,7 +81,7 @@ Similar to the redefinition of Prolog built-in predicates, the Logtalk compiler An error will be thrown if we attempt to redefine a Logtalk built-in method inside an entity. The default behaviour is to report the error and abort the compilation of the offending entity.

-

Misspell calls of local predicates

+

Misspell calls of local predicates

A warning will be reported if Logtalk finds (in the body of a predicate definition) a call to a local predicate that is not defined, built-in (either in Prolog or in Logtalk) or declared dynamic. In most cases these calls are simple misspell errors. @@ -117,7 +123,7 @@ The message sending mechanisms always check if the receiver of a message is a de Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: February 10, 2001 +Last updated on: October 16, 2001


diff --git a/Logtalk/manuals/userman/index.html b/Logtalk/manuals/userman/index.html index 4e9e41dc6..21d2cad17 100644 --- a/Logtalk/manuals/userman/index.html +++ b/Logtalk/manuals/userman/index.html @@ -4,7 +4,7 @@ - Logtalk 2.8.4 User Manual + Logtalk 2.9.1 User Manual @@ -152,11 +152,12 @@
Compiler warnings and errors
+
Unknown entities
Singleton variables
Redefinition of Prolog built-in predicates
Redefinition of Logtalk built-in predicates
Redefinition of Logtalk built-in methods
-
misspell calls of local predicates
+
Misspell calls of local predicates
Other warnings and errors
Runtime errors
Logtalk built-in predicates
@@ -213,7 +214,7 @@ Reference manual | Tutorial | Bibliography | Glossary

-Last updated on: February 10, 2001 +Last updated on: November 26, 2001


diff --git a/Logtalk/manuals/userman/installing.html b/Logtalk/manuals/userman/installing.html index 57bdd61b7..eee192c16 100644 --- a/Logtalk/manuals/userman/installing.html +++ b/Logtalk/manuals/userman/installing.html @@ -84,6 +84,7 @@ In the Logtalk installation directory, you will find the following files and dir
... - other examples
library
NOTES - short description of the library contents
+
all.loader - loader utility file for all library entities
... - library source files
manuals
NOTES - notes on the provided documentation
@@ -95,7 +96,7 @@ In the Logtalk installation directory, you will find the following files and dir
NOTES - notes on the automatic generation of XML documentation files
logtalk.css - cascade style sheet file for the HTML output of the XSLT conversion of the XML files
logtalk.dtd - Document Type Description file describing the structure of the XML files
-
logtalk.xsl - transformation style sheet to output HTML code from the XML files
+
lgthtml.xsl - transformation style sheet to output HTML code from the XML files
... - other XML related files
@@ -220,6 +221,10 @@ In fact, the logtalk_load/1 and logtalk_compile/1 pred

You can use the following options:

+
+
unknown(Option)
+
Controls the unknown entity warnings, resulting from loading an entity that references some other entity that is not currently loaded. Possible option values are warning (the usual default) and silent.
+
singletons(Option)
Controls the singleton variable warnings. Possible option values are warning (the usual default) and silent (not recommended unless you have already checked your code and want to avoid false singletons warnings like some Prolog compilers report for variables that start with an underscore).
@@ -242,7 +247,7 @@ You can use the following options:
xsl(File)
-
Sets the XSLT file to be used with the automatically generated XML documenting files. The default value is logtalk.xsl.
+
Sets the XSLT file to be used with the automatically generated XML documenting files. The default value is lgtxml.xsl.
report(Option)
@@ -258,7 +263,7 @@ You can use the following options: Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: February 10, 2001 +Last updated on: October 16, 2001


diff --git a/Logtalk/manuals/userman/protocols.html b/Logtalk/manuals/userman/protocols.html index 15470cad7..d8fc4c317 100644 --- a/Logtalk/manuals/userman/protocols.html +++ b/Logtalk/manuals/userman/protocols.html @@ -158,13 +158,13 @@ Logtalk provides two sets of built-in predicates that enable us to query the sys The built-in predicates extends_protocol/2 and extends_protocol/3 return all pairs of protocols so that the first one extends the second:

-    :- extends_protocol(Protocol1, Protocol2).
+    | ?- extends_protocol(Protocol1, Protocol2).
 

or, if we want to know the extension scope:

-    :- extends_protocol(Protocol1, Protocol2, Scope).
+    | ?- extends_protocol(Protocol1, Protocol2, Scope).
 

To find which objects or categories implement which protocols we can call the implements_protocol/2 or implements_protocol/2 built-in predicates: @@ -252,7 +252,7 @@ The same rules applies to protocols implemented by categories. Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: April 30, 2001


diff --git a/Logtalk/xml/NOTES b/Logtalk/xml/NOTES index f92ea2e5d..58e1bcf16 100644 --- a/Logtalk/xml/NOTES +++ b/Logtalk/xml/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.8.4 +Release 2.9.1 Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. ================================================================= @@ -18,16 +18,25 @@ generated .html files assume that all files reside in the same directory. The choice of the default .xsl file to use is made in the config files by the lgt_default_compiler_option/2 predicate. You can also choose a different .xsl file by using the xsl/1 compiler option in the logtalk_compile/2 or -logtalk_load/2 calls. +logtalk_load/2 calls. The default file is lgtxml.xsl (described below). -logtalk.xsl +lgthtml.xsl XSLT file to output HTML files from the .xml files. The links in the generated HTML files point to related HTML files. It can be used to batch convert XML files to HTML files. +lgtxml.xsl + + XSLT file for viewing .xml files directly in in a browser such as Mozilla + (version 0.9.2 or later) or Microsoft Internet Explorer 5.5 for Windows + (after installing the latest Microsoft XML Parser Release that is needed + for XSL standard compliance). The links in the (internally generated) + HTML files point to related XML files. + + texml.xsl XSLT file to output TeXML files that can be further processed by @@ -35,32 +44,24 @@ texml.xsl at: http://www.alphaworks.ibm.com/tech/texml/. -ie50.xsl +ie5.xsl - XSLT file for viewing .xml files in Microsoft Internet Explorer 5.0 + XSLT file for viewing .xml files in Microsoft Internet Explorer 5.x (works with both Macintosh and Windows versions). The links in the (internally generated) HTML files point to related XML files. It can be used to browse and view the XML files directly. -ie55.xsl - - XSLT file for viewing .xml files in Microsoft Internet Explorer 5.5 for - Windows after installing the latest Microsoft XML Parser Release. - The links in the (internally generated) HTML files point to related XML - files. It can be used to browse and view the XML files directly. - - logtalk.dtd Document type description describing the structure of the .xml files generated by Logtalk. - + logtalk.xsd XML Schema describing the structure of the .xml files generated by - Logtalk (warning: this file is work in progress). + Logtalk. logtalk.css @@ -69,6 +70,18 @@ logtalk.css in a web browser. +script.sh + + Sample unix shell script to batch convert .xml files to .html files. + Edit the file to match your environment. + + +script.bat + + Sample dos batch script to convert .xml files to .html files. + Edit the file to match your environment. + + Note that you can write other XSLT files for converting the XML files to other formats besides HTML or LaTeX. You can also write alternative CSS and XSLT files to change the appearance of the HTML and LaTeX files. diff --git a/Logtalk/xml/ie50.xsl b/Logtalk/xml/ie50.xsl index 0a99c1956..42b4d6b50 100644 --- a/Logtalk/xml/ie50.xsl +++ b/Logtalk/xml/ie50.xsl @@ -8,7 +8,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Logtalk - Object oriented extension to Prolog -% Release 2.8.4 +% Release 2.9.1 % % Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. % diff --git a/Logtalk/xml/lgthtml.xsl b/Logtalk/xml/lgthtml.xsl new file mode 100644 index 000000000..775d15a19 --- /dev/null +++ b/Logtalk/xml/lgthtml.xsl @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + <xsl:value-of select="logtalk/entity/name" /> + + + +
+

+

+ +
+ +
+ +
+ + +
+ + + + +
+
+
+ +
authors:
+
+
+ +
version:
+
+
+ +
date:
+
+
+
+
+
compilation:
+
+
+
+ +
:
+
+
+
+
+ + + + + + +
+
implements:
+ +
+
+ +
+
imports:
+ +
+
+ +
+
extends:
+ +
+
+ +
+
instantiates:
+ +
+
+ +
+
specializes:
+ +
+
+ +
+
uses:
+ +
+
+ +
+
calls:
+ +
+
+
+ +

(no dependencies on other files)

+
+
+
+ + + +
.html
+
+ + + +
.html
+
+ + + +
.html
+
+ + + +

Public interface

+ + + + + +

(see related entities)

+
+ +

(none)

+
+
+

Protected interface

+ + + + + +

(see related entities)

+
+ +

(none)

+
+
+

Private predicates

+ + + + + +

(see related entities)

+
+ +

(none)

+
+
+
+ + + +

+ +
+
+
+
compilation:
+
+ +
template:
+
+
+ +
metapredicate template:
+
+
+ +
mode - number of solutions:
+ +
-
+
+
+
+
+ +
:
+
+
+
+
+ + +
diff --git a/Logtalk/xml/lgtxml.xsl b/Logtalk/xml/lgtxml.xsl new file mode 100644 index 000000000..34fea7e10 --- /dev/null +++ b/Logtalk/xml/lgtxml.xsl @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + <xsl:value-of select="logtalk/entity/name" /> + + + +
+

+

+ +
+ +
+ +
+ + +
+ + + + +
+
+
+ +
authors:
+
+
+ +
version:
+
+
+ +
date:
+
+
+
+
+
compilation:
+
+
+
+ +
:
+
+
+
+
+ + + + + + +
+
implements:
+ +
+
+ +
+
imports:
+ +
+
+ +
+
extends:
+ +
+
+ +
+
instantiates:
+ +
+
+ +
+
specializes:
+ +
+
+ +
+
uses:
+ +
+
+ +
+
calls:
+ +
+
+
+ +

(no dependencies on other files)

+
+
+
+ + + +
.xml
+
+ + + +
.xml
+
+ + + +
.xml
+
+ + + +

Public interface

+ + + + + +

(see related entities)

+
+ +

(none)

+
+
+

Protected interface

+ + + + + +

(see related entities)

+
+ +

(none)

+
+
+

Private predicates

+ + + + + +

(see related entities)

+
+ +

(none)

+
+
+
+ + + +

+ +
+
+
+
compilation:
+
+ +
template:
+
+
+ +
metapredicate template:
+
+
+ +
mode - number of solutions:
+ +
-
+
+
+
+
+ +
:
+
+
+
+
+ + +
diff --git a/Logtalk/xml/logtalk.dtd b/Logtalk/xml/logtalk.dtd index e837f24aa..3257c0375 100644 --- a/Logtalk/xml/logtalk.dtd +++ b/Logtalk/xml/logtalk.dtd @@ -3,7 +3,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Logtalk - Object oriented extension to Prolog -% Release 2.8.4 +% Release 2.9.1 % % Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. % diff --git a/Logtalk/xml/logtalk.xsd b/Logtalk/xml/logtalk.xsd index df134a44d..bb463846a 100644 --- a/Logtalk/xml/logtalk.xsd +++ b/Logtalk/xml/logtalk.xsd @@ -1,7 +1,7 @@ - + @@ -15,7 +15,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Logtalk - Object oriented extension to Prolog -% Release 2.8.4 +% Release 2.9.1 % % Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. % diff --git a/Logtalk/xml/script.bat b/Logtalk/xml/script.bat new file mode 100644 index 000000000..46e636981 --- /dev/null +++ b/Logtalk/xml/script.bat @@ -0,0 +1,21 @@ +@ECHO off + +SET JAVA_HOME=c:\jdk1.3 + +SET XT_PATH=c:\xt +SET SAX_PATH=c:\xt +SET XP_PATH=c:\xt + +SET XSLT="lgthtml.xsl" + +ECHO This script converts all .xml files in the current directory to .html +ECHO files applying the XSLT transformation defined in the $XSLT file +ECHO using the James Clark XT XSLT Java processor + +FOR %%f IN (*.xml) DO %JAVA_HOME%\bin\java -cp "%XT_PATH%\xt.jar;%SAX_PATH%\sax.jar;%XP_PATH%\xp.jar" -Dcom.jclark.xsl.sax.parser=com.jclark.xml.sax.CommentDriver com.jclark.xsl.sax.Driver %%f %XSLT% %%f.html + +REN *.xml.html *.html + +ECHO conversion done + +@ECHO on diff --git a/Logtalk/xml/script.sh b/Logtalk/xml/script.sh new file mode 100644 index 000000000..0983ae935 --- /dev/null +++ b/Logtalk/xml/script.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +XT_PATH="." +SAX_PATH="." +XP_PATH="." + +XSLT="lgthtml.xsl" + +echo +echo This script converts all .xml files in the current directory to .html +echo files applying the XSLT transformation defined in the $XSLT file +echo using the James Clark XT XSLT Java processor +echo + +foreach file (*.xml) + echo converting $file + name="`expr "$file" : '\(.*\)\.[^./]*$' \| "$file"`" + eval java -cp ${XT_PATH}/xt.jar:${SAX_PATH}/sax.jar:${XP_PATH}/xp.jar -Dcom.jclark.xsl.sax.parser=com.jclark.xml.sax.CommentDriver com.jclark.xsl.sax.Driver $file $XSLT $name.html +end + +echo +echo conversion done +echo diff --git a/Logtalk/xml/texml.xsl b/Logtalk/xml/texml.xsl index bcf9cdb6a..250d3eca4 100644 --- a/Logtalk/xml/texml.xsl +++ b/Logtalk/xml/texml.xsl @@ -12,7 +12,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Logtalk - Object oriented extension to Prolog -% Release 2.8.4 +% Release 2.9.1 % % Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. % diff --git a/library/logtalk/logtalk.pl b/library/logtalk/logtalk.pl index b9492f116..a13b9f36e 100644 --- a/library/logtalk/logtalk.pl +++ b/library/logtalk/logtalk.pl @@ -2,7 +2,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Logtalk - Object oriented extension to Prolog -% Release 2.8.4 +% Release 2.9.1 % % Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. % @@ -45,14 +45,14 @@ -% defined events and monitors +% tables of defined events and monitors :- dynamic(lgt_before_/5). % lgt_before_(Obj, Msg, Sender, Monitor, Call) :- dynamic(lgt_after_/5). % lgt_after_(Obj, Msg, Sender, Monitor, Call) -% loaded entities and respective relationships +% tables of loaded entities and respective relationships :- dynamic(lgt_current_protocol_/2). % lgt_current_protocol_(Ptc, Prefix) :- dynamic(lgt_current_category_/2). % lgt_current_category_(Ctg, Prefix) @@ -67,6 +67,7 @@ + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % pre-processor directives @@ -75,8 +76,6 @@ -% dynamic declarations - :- dynamic(lgt_dcl_/1). % lgt_dcl_(Clause) :- dynamic(lgt_def_/1). % lgt_def_(Clause) :- dynamic(lgt_super_/1). % lgt_super_(Clause) @@ -89,7 +88,7 @@ :- dynamic(lgt_private_/1). % lgt_private_(Functor/Arity) :- dynamic(lgt_metapredicate_/1). % lgt_metapredicate_(Pred) -:- dynamic(lgt_object_/9). % lgt_object_(Obj, Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DDef) +:- dynamic(lgt_object_/9). % lgt_object_(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef) :- dynamic(lgt_category_/4). % lgt_category_(Ctg, Prefix, Dcl, Def) :- dynamic(lgt_protocol_/3). % lgt_protocol_(Ptc, Prefix, Dcl) @@ -100,9 +99,9 @@ :- dynamic(lgt_implemented_protocol_/4). % lgt_implemented_protocol_(Ptc, Prefix, Dcl, Scope) :- dynamic(lgt_imported_category_/5). % lgt_imported_category_(Ctg, Prefix, Dcl, Def, Scope) -:- dynamic(lgt_extended_object_/10). % lgt_extended_object_(Parent, Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DDef, Scope) -:- dynamic(lgt_instantiated_class_/10). % lgt_instantiated_class_(Class, Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DDef, Scope) -:- dynamic(lgt_specialized_class_/10). % lgt_specialized_class_(Superclass, Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DDef, Scope) +:- dynamic(lgt_extended_object_/10). % lgt_extended_object_(Parent, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Scope) +:- dynamic(lgt_instantiated_class_/10). % lgt_instantiated_class_(Class, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Scope) +:- dynamic(lgt_specialized_class_/10). % lgt_specialized_class_(Superclass, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Scope) :- dynamic(lgt_extended_protocol_/4). % lgt_extended_protocol_(Ptc2, Prefix, Dcl, Scope) :- dynamic(lgt_entity_/4). % lgt_entity_(Type, Entity, Prefix, Dcl) @@ -123,12 +122,16 @@ :- dynamic(lgt_current_compiler_option_/2). % lgt_current_compiler_option_(Option, Value) +:- dynamic(lgt_referenced_object_/1). % lgt_referenced_object_(Object) +:- dynamic(lgt_referenced_protocol_/1). % lgt_referenced_protocol_(Protocol) +:- dynamic(lgt_referenced_category_/1). % lgt_referenced_object_(Category) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% top level runtime predicate +% top level runtime predicate for message sending: ::/2 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -306,7 +309,8 @@ create_object(Obj, Rels, Dirs, Clauses) :- lgt_fix_redef_built_ins, lgt_gen_object_clauses, lgt_gen_object_directives, - lgt_assert_tr_entity. + lgt_assert_tr_entity, + lgt_report_unknown_entities. @@ -352,7 +356,8 @@ create_category(Ctg, Rels, Dirs, Clauses) :- lgt_fix_redef_built_ins, lgt_gen_category_clauses, lgt_gen_category_directives, - lgt_assert_tr_entity. + lgt_assert_tr_entity, + lgt_report_unknown_entities. @@ -392,7 +397,8 @@ create_protocol(Ptc, Rels, Dirs) :- lgt_tr_directives(Dirs), lgt_gen_protocol_clauses, lgt_gen_protocol_directives, - lgt_assert_tr_entity. + lgt_assert_tr_entity, + lgt_report_unknown_entities. @@ -409,7 +415,7 @@ abolish_object(Obj) :- abolish_object(Obj) :- lgt_current_object_(Obj, Prefix, _, _, _) -> (object_property(Obj, (dynamic)) -> - lgt_once(Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DDef), + lgt_once(Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef), forall( lgt_call(Def, _, _, _, _, Pred), (functor(Pred, Functor, Arity), @@ -423,8 +429,8 @@ abolish_object(Obj) :- abolish(Def/5), abolish(Def/6), abolish(Super/6), - abolish(SDcl/6), - abolish(SDef/6), + abolish(IDcl/6), + abolish(IDef/6), abolish(DDcl/4), abolish(DDef/5), abolish(Prefix/7), @@ -523,7 +529,7 @@ implements_protocol(Entity, Ptc, Scope) :- implements_protocol(Entity, Ptc, Scope) :- nonvar(Scope), \+ lgt_member(Scope, [(public), protected, private]), - throw(error(type_error(entity_scope, Scope), implements_protocol(Entity, Ptc, Scope))). + throw(error(type_error(scope, Scope), implements_protocol(Entity, Ptc, Scope))). implements_protocol(Entity, Ptc, Scope) :- lgt_implements_protocol_(Entity, Ptc, Scope). @@ -555,7 +561,7 @@ imports_category(Obj, Ctg, Scope) :- imports_category(Obj, Ctg, Scope) :- nonvar(Scope), \+ lgt_member(Scope, [(public), protected, private]), - throw(error(type_error(entity_scope, Scope), imports_category(Obj, Ctg, Scope))). + throw(error(type_error(scope, Scope), imports_category(Obj, Ctg, Scope))). imports_category(Obj, Ctg, Scope) :- lgt_imports_category_(Obj, Ctg, Scope). @@ -587,7 +593,7 @@ instantiates_class(Obj, Class, Scope) :- instantiates_class(Obj, Class, Scope) :- nonvar(Scope), \+ lgt_member(Scope, [(public), protected, private]), - throw(error(type_error(entity_scope, Scope), instantiates_class(Obj, Class, Scope))). + throw(error(type_error(scope, Scope), instantiates_class(Obj, Class, Scope))). instantiates_class(Obj, Class, Scope) :- lgt_instantiates_class_(Obj, Class, Scope). @@ -619,7 +625,7 @@ specializes_class(Class, Superclass, Scope) :- specializes_class(Class, Superclass, Scope) :- nonvar(Scope), \+ lgt_member(Scope, [(public), protected, private]), - throw(error(type_error(entity_scope, Scope), specializes_class(Class, Superclass, Scope))). + throw(error(type_error(scope, Scope), specializes_class(Class, Superclass, Scope))). specializes_class(Class, Superclass, Scope) :- lgt_specializes_class_(Class, Superclass, Scope). @@ -651,7 +657,7 @@ extends_protocol(Ptc1, Ptc2, Scope) :- extends_protocol(Ptc1, Ptc2, Scope) :- nonvar(Scope), \+ lgt_member(Scope, [(public), protected, private]), - throw(error(type_error(entity_scope, Scope), extends_protocol(Ptc1, Ptc2, Scope))). + throw(error(type_error(scope, Scope), extends_protocol(Ptc1, Ptc2, Scope))). extends_protocol(Ptc1, Ptc2, Scope) :- lgt_extends_protocol_(Ptc1, Ptc2, Scope). @@ -683,7 +689,7 @@ extends_object(Prototype, Parent, Scope) :- extends_object(Prototype, Parent, Scope) :- nonvar(Scope), \+ lgt_member(Scope, [(public), protected, private]), - throw(error(type_error(entity_scope, Scope), extends_object(Prototype, Parent, Scope))). + throw(error(type_error(scope, Scope), extends_object(Prototype, Parent, Scope))). extends_object(Prototype, Parent, Scope) :- lgt_extends_object_(Prototype, Parent, Scope). @@ -859,11 +865,11 @@ logtalk_compile(Entities) :- logtalk_compile(Entities, Options) :- catch( (lgt_check_compiler_entities(Entities), - lgt_check_compiler_options(Options)), + lgt_check_compiler_options(Options), + lgt_set_compiler_options(Options), + lgt_compile_entities(Entities)), Error, - throw(error(Error, logtalk_compile(Entities, Options)))), - lgt_set_compiler_options(Options), - lgt_compile_entities(Entities). + throw(error(Error, logtalk_compile(Entities, Options)))). @@ -939,12 +945,15 @@ lgt_check_compiler_option(Option) :- +% lgt_set_compiler_options(+list) +% +% sets the compiler options + lgt_set_compiler_options(Options) :- retractall(lgt_current_compiler_option_(_, _)), lgt_assert_compiler_options(Options). - lgt_assert_compiler_options([]). lgt_assert_compiler_options([Option| Options]) :- @@ -956,7 +965,7 @@ lgt_assert_compiler_options([Option| Options]) :- % logtalk_load(+list) % -% compiles to disk and then load to memory a +% compiles to disk and then loads to memory a % list of entities using default options logtalk_load(Entities) :- @@ -969,17 +978,17 @@ logtalk_load(Entities) :- % logtalk_load(+list, +list) % -% compiles to disk and then load to memory a +% compiles to disk and then loads to memory a % list of entities using a list of options logtalk_load(Entities, Options) :- catch( (lgt_check_compiler_entities(Entities), - lgt_check_compiler_options(Options)), + lgt_check_compiler_options(Options), + lgt_set_compiler_options(Options), + lgt_load_entities(Entities)), Error, - throw(error(Error, logtalk_load(Entities, Options)))), - lgt_set_compiler_options(Options), - lgt_load_entities(Entities). + throw(error(Error, logtalk_load(Entities, Options)))). @@ -1000,7 +1009,7 @@ logtalk_version(Major, Minor, Patch) :- \+ integer(Patch), throw(error(type_error(integer, Patch), logtalk_version(Major, Minor, Patch))). -logtalk_version(2, 8, 4). +logtalk_version(2, 9, 1). @@ -1013,6 +1022,8 @@ logtalk_version(2, 8, 4). +% current_predicate/1 built-in method + lgt_current_predicate(Obj, Pred, Sender, _) :- nonvar(Pred), Pred \= _/_, @@ -1055,7 +1066,7 @@ lgt_current_predicate(Obj, Functor/Arity, Sender, Scope) :- % lgt_cp_filter(+list, -list) % -% removes duplicated predicates and predicates that have been redeclared +% removes duplicated and redeclared predicates lgt_cp_filter([], []). @@ -1076,6 +1087,8 @@ lgt_cp_remove_all([Data| Rest], Filter, [Data| Rest2]) :- +% predicate_property/2 built-in method + lgt_predicate_property(Obj, Pred, Prop, Sender, _) :- var(Pred), throw(error(instantiation_error, Obj::predicate_property(Pred, Prop), Sender)). @@ -1125,6 +1138,8 @@ lgt_predicate_property(_, Pred, Prop, _, _) :- % lgt_scope(?atom, ?term). +% +% converts between user and system scope terms lgt_scope(private, p). lgt_scope(protected, p(p)). @@ -1132,6 +1147,8 @@ lgt_scope((public), p(p(p))). +% abolish/1 built-in method + lgt_abolish(Obj, Pred, Sender, _) :- var(Pred), throw(error(instantiation_error, Obj::abolish(Pred), Sender)). @@ -1191,6 +1208,8 @@ lgt_abolish(Obj, Functor/Arity, Sender, Scope) :- +% asserta/1 built-in method + lgt_asserta(Obj, Clause, Sender, _) :- var(Clause), throw(error(instantiation_error, Obj::asserta(Clause), Sender)). @@ -1270,6 +1289,8 @@ lgt_asserta(Obj, Head, Sender, Scope) :- +% assertz/1 built-in method + lgt_assertz(Obj, Clause, Sender, _) :- var(Clause), throw(error(instantiation_error, Obj::assertz(Clause), Sender)). @@ -1349,6 +1370,8 @@ lgt_assertz(Obj, Head, Sender, Scope) :- +% clause/2 built-in method + lgt_clause(Obj, Head, Body, Sender, _) :- var(Head), throw(error(instantiation_error, Obj::clause(Head, Body), Sender)). @@ -1390,6 +1413,8 @@ lgt_clause(Obj, Head, Body, Sender, Scope) :- +% retract/1 built-in method + lgt_retract(Obj, Clause, Sender, _) :- var(Clause), throw(error(instantiation_error, Obj::retract(Clause), Sender)). @@ -1450,6 +1475,8 @@ lgt_retract(Obj, Head, Sender, Scope) :- +% retractall/1 built-in method + lgt_retractall(Obj, Head, Sender, _) :- var(Head), throw(error(instantiation_error, Obj::retractall(Head), Sender)). @@ -1493,25 +1520,18 @@ lgt_retractall(Obj, Head, Sender, Scope) :- +% lgt_send_to_self(+object, ?term, +object) + lgt_send_to_self(Self, Pred, This) :- nonvar(Pred) -> - lgt_current_object_(Self, _, Dcl, Def, _), - (lgt_call(Dcl, Pred, Scope, _, _, SContainer, _) -> - ((Scope = p(_); This = SContainer) -> - lgt_once(Def, Pred, This, Self, Self, Call, _), - call(Call) - ; - throw(error(permission_error(access, private_predicate, Pred), Self::Pred, This))) - ; - (lgt_built_in(Pred) -> - call(Pred) - ; - throw(error(existence_error(predicate_declaration, Pred), Self::Pred, This)))) + lgt_send_to_self_nv(Self, Pred, This) ; throw(error(instantiation_error, Self::Pred, This)). +% lgt_send_to_self_nv(+object, +term, +object) + lgt_send_to_self_nv(Self, Pred, This) :- lgt_current_object_(Self, _, Dcl, Def, _), (lgt_call(Dcl, Pred, Scope, _, _, SContainer, _) -> @@ -1528,6 +1548,8 @@ lgt_send_to_self_nv(Self, Pred, This) :- +% lgt_send_to_object(@object, ?term, +object) + lgt_send_to_object(Obj, Pred, Sender) :- nonvar(Obj) -> (lgt_current_object_(Obj, _, Dcl, Def, _) -> @@ -1557,6 +1579,8 @@ lgt_send_to_object(Obj, Pred, Sender) :- +% lgt_send_to_object_nv(+object, +term, +object) + lgt_send_to_object_nv(Obj, Pred, Sender) :- lgt_current_object_(Obj, _, Dcl, Def, _) -> (lgt_call(Dcl, Pred, Scope, _, _, _, _) -> @@ -1580,29 +1604,18 @@ lgt_send_to_object_nv(Obj, Pred, Sender) :- +% lgt_send_to_super(+object, ?term, +object, +object) + lgt_send_to_super(Self, Pred, This, Sender) :- nonvar(Pred) -> - lgt_current_object_(Self, _, Dcl, _, _), - (lgt_call(Dcl, Pred, Scope, _, _, SContainer, _) -> - ((Scope = p(_); This = SContainer) -> - lgt_current_object_(This, _, _, _, Super), - lgt_once(Super, Pred, Sender, This, Self, Call, Container), - (Container \= This -> - call(Call) - ; - throw(error(endless_loop(Pred), ^^Pred, This))) - ; - throw(error(permission_error(access, private_predicate, Pred), ^^Pred, This))) - ; - (lgt_built_in(Pred) -> - call(Pred) - ; - throw(error(existence_error(predicate_declaration, Pred), ^^Pred, This)))) + lgt_send_to_super_nv(Self, Pred, This, Sender) ; throw(error(instantiation_error, ^^Pred, This)). +% lgt_send_to_super_nv(+object, +term, +object, +object) + lgt_send_to_super_nv(Self, Pred, This, Sender) :- lgt_current_object_(Self, _, Dcl, _, _), (lgt_call(Dcl, Pred, Scope, _, _, SContainer, _) -> @@ -1623,6 +1636,8 @@ lgt_send_to_super_nv(Self, Pred, This, Sender) :- +% lgt_metacall_in_object(+object, ?term, +object) +% % metacalls in predicate definitions lgt_metacall_in_object(Obj, Pred, Sender) :- @@ -1642,6 +1657,8 @@ lgt_metacall_in_object(Obj, Pred, Sender) :- +% lgt_call_built_in(+term, +term) +% % needed for runtime translation of dynamic clauses lgt_call_built_in(Pred, Context) :- @@ -1659,13 +1676,16 @@ lgt_call_built_in(Pred, Context) :- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% built-in entities +% built-in pseudo-object user +% +% represents the Prolog database (excluding built-in predicates) % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% built-in pseudo-object user (representing the Prolog database) +% the following clauses correspond to a virtual +% compilation of the pseudo-object user lgt_current_object_(user, user0_, user0__dcl, user0__def, _). @@ -1702,6 +1722,9 @@ user0__def(Pred, _, _, _, Pred, user). % lgt_hidden_functor(+atom) +% +% hidden functors include Logtalk pre-processor and runtime internal functors +% and those used in the compiled code of objects, protocols, and categories lgt_hidden_functor(Functor) :- atom_concat(lgt_, _, Functor). @@ -1730,6 +1753,8 @@ lgt_hidden_functor(Functor) :- % lgt_load_entities(+list) +% +% compiles to disk and then loads to memory a list of entities lgt_load_entities([]). @@ -1740,21 +1765,44 @@ lgt_load_entities([Entity| Entities]) :- % lgt_load_entity(+atom) +% +% compiles to disk and then loads to memory an entity lgt_load_entity(Entity) :- + (lgt_compiler_option(report, on) -> + nl, write('>>> compiling '), writeq(Entity), nl + ; + true), lgt_compile_entity(Entity), + lgt_entity_(Type, _, _, _), + (lgt_current_entity(Entity) -> + write('WARNING! redefining '), write(Entity), write(' '), + writeq(Type), nl + ; + true), lgt_file_name(prolog, Entity, File), lgt_load_prolog_code(File), (lgt_compiler_option(report, on) -> - writeq(Entity), - lgt_entity_(Type, _, _, _), + write('<<< '), writeq(Entity), write(' '), write(Type), write(' loaded'), nl ; true). +lgt_current_entity(Obj) :- + lgt_current_object_(Obj, _, _, _, _). + +lgt_current_entity(Ptc) :- + lgt_current_protocol_(Ptc, _). + +lgt_current_entity(Ctg) :- + lgt_current_category_(Ctg, _). + + % lgt_compile_entities(+list) +% +% compiles to disk a list of entities lgt_compile_entities([]). @@ -1765,15 +1813,20 @@ lgt_compile_entities([Entity| Entities]) :- % lgt_compile_entity(+atom) +% +% compiles to disk an entity lgt_compile_entity(Entity) :- lgt_tr_entity(Entity), lgt_write_tr_entity(Entity), - lgt_write_entity_doc(Entity). + lgt_write_entity_doc(Entity), + lgt_report_unknown_entities. % lgt_write_tr_entity(+atom) +% +% writes to disk the entity compiled code lgt_write_tr_entity(Entity) :- lgt_file_name(prolog, Entity, File), @@ -1792,6 +1845,8 @@ lgt_write_tr_entity(Entity) :- % lgt_write_entity_doc(+atom) +% +% writes to disk the entity documentation in XML format lgt_write_entity_doc(Entity) :- lgt_compiler_option(xml, on) -> @@ -1811,6 +1866,8 @@ lgt_write_entity_doc(Entity) :- % lgt_file_name(+atom, +atom, -atom) +% +% constructs a filename given the type of file and the entity name lgt_file_name(Type, Entity, File) :- lgt_file_extension(Type, Extension), @@ -1819,6 +1876,8 @@ lgt_file_name(Type, Entity, File) :- % lgt_tr_entity(+atom) +% +% compiles an entity storing the resulting code in memory lgt_tr_entity(Entity) :- lgt_clean_up, @@ -1842,6 +1901,8 @@ lgt_tr_entity(Entity) :- +% lgt_tr_file(+stream, +term) + lgt_tr_file(_, end_of_file) :- !. @@ -1854,20 +1915,21 @@ lgt_tr_file(Stream, Term) :- % lgt_report_singletons(+list, +term) +% +% report the singleton variables found while compiling an entity term lgt_report_singletons([], _). lgt_report_singletons([Singleton| Singletons], Term) :- lgt_compiler_option(singletons, warning) -> - write('Logtalk compiler warning!'), nl, + write('WARNING!'), \+ \+ ( lgt_report_singletons_aux([Singleton| Singletons], Term, Names), - write(' singleton variable(s): '), write(Names), nl, - write(' in term: '), write(Term), nl, - (lgt_entity_(Type, Entity, _, _) -> - write(' inside '), write(Type), write(': '), - writeq(Entity), nl + write(' singleton variables: '), write(Names), nl, + (Term = (:- _) -> + write(' in directive: ') ; - true)) + write(' in clause: ')), + write(Term), nl) ; true. @@ -1880,83 +1942,42 @@ lgt_report_singletons_aux([Name = Var| Singletons], Term, [Name| Names]) :- +% lgt_compiler_error_handler(@term, +term) +% +% close the stream opened for reading the entity +% file and report the compilation error found + lgt_compiler_error_handler(Stream, Error) :- (nonvar(Stream) -> close(Stream) ; true), lgt_report_compiler_error(Error), - fail. + throw(Error). -lgt_report_compiler_error(invalid_directive_arg(Error, Cause, Dir)) :- +% lgt_report_compiler_error(+term) +% +% reports a compilation error + +lgt_report_compiler_error(error(Error, directive(Directive))) :- !, - write('Logtalk compiler error!'), nl, - write(' invalid argument in directive: '), - writeq((:-Dir)), nl, - write(' '), write(Error), write(': '), write(Cause), nl, - (lgt_entity_(Type, Entity, _, _) -> - write(' inside '), write(Type), write(': '), - writeq(Entity), nl - ; - true). + write('ERROR! '), writeq(Error), nl, + write(' in directive: '), write((:- Directive)), nl. -lgt_report_compiler_error(invalid_directive(Error, Dir)) :- +lgt_report_compiler_error(error(Error, clause(Clause))) :- !, - write('Logtalk compiler error!'), nl, - write(' invalid or unsupported directive: '), - writeq((:-Dir)), nl, - write(' '), write(Error), nl, - (lgt_entity_(Type, Entity, _, _) -> - write(' inside '), write(Type), write(': '), - writeq(Entity), nl - ; - true). + write('ERROR! '), writeq(Error), nl, + write(' in clause: '), write(Clause), nl. -lgt_report_compiler_error(invalid_clause(Error, Cause, Clause)) :- +lgt_report_compiler_error(error(Error, Term)) :- !, - write('Logtalk compiler error!'), nl, - write(' invalid clause: '), - writeq(Clause), nl, - write(' '), write(Error), write(': '), write(Cause), nl, - (lgt_entity_(Type, Entity, _, _) -> - write(' inside '), write(Type), write(': '), - writeq(Entity), nl - ; - true). - -lgt_report_compiler_error(invalid_clause(Error, Clause)) :- - !, - write('Logtalk compiler error!'), nl, - write(' invalid clause: '), - writeq(Clause), nl, - write(' '), write(Error), nl, - (lgt_entity_(Type, Entity, _, _) -> - write(' inside '), write(Type), write(': '), - writeq(Entity), nl - ; - true). - -lgt_report_compiler_error(invalid_clause(Clause)) :- - !, - write('Logtalk compiler error!'), nl, - write(' could not translate clause: '), - writeq(Clause), nl, - (lgt_entity_(Type, Entity, _, _) -> - write(' inside '), write(Type), write(': '), - writeq(Entity), nl - ; - true). + write('ERROR! '), writeq(Error), nl, + write(' in: '), write(Term), nl. lgt_report_compiler_error(Error) :- - write('Logtalk compiler error!'), nl, - write(' '), writeq(Error), nl, - (lgt_entity_(Type, Entity, _, _) -> - write(' inside '), write(Type), write(': '), - writeq(Entity), nl - ; - true). + write('ERROR! '), writeq(Error), nl. @@ -1997,7 +2018,10 @@ lgt_clean_up :- retractall(lgt_feclause_(_)), retractall(lgt_redefined_built_in_(_, _, _)), retractall(lgt_defs_pred_(_)), - retractall(lgt_calls_pred_(_)). + retractall(lgt_calls_pred_(_)), + retractall(lgt_referenced_object_(_)), + retractall(lgt_referenced_protocol_(_)), + retractall(lgt_referenced_category_(_)). @@ -2040,11 +2064,16 @@ lgt_dump_all :- listing(lgt_redefined_built_in_/3), listing(lgt_defs_pred_/1), listing(lgt_calls_pred_/1), - listing(lgt_current_compiler_option_/2). + listing(lgt_current_compiler_option_/2), + listing(lgt_referenced_object_/1), + listing(lgt_referenced_protocol_/1), + listing(lgt_referenced_category_/1). % lgt_tr_terms(+list) +% +% translates a list of entity terms (clauses and/or directives) lgt_tr_terms([]). @@ -2055,6 +2084,8 @@ lgt_tr_terms([Term| Terms]) :- % lgt_tr_term(+term) +% +% translates an entity term (either a clause or a directive) lgt_tr_term((Head:-Body)) :- !, @@ -2070,6 +2101,8 @@ lgt_tr_term(Fact) :- % lgt_tr_directives(+list) +% +% translates a list of entity directives lgt_tr_directives([]). @@ -2080,16 +2113,18 @@ lgt_tr_directives([Dir| Dirs]) :- % lgt_tr_directive(+term) +% +% translates an entity directive lgt_tr_directive(Dir) :- var(Dir), - throw(invalid_directive(instantiation_error, Dir)). + throw(error(instantiantion_error, directive(Dir))). lgt_tr_directive(Dir) :- \+ lgt_entity_(_, _, _, _), % directive occurs before opening entity directive functor(Dir, Functor, Arity), lgt_lgt_closing_directive(Functor/Arity), % opening directive missing/missplet - throw(invalid_directive(unmatched_directive_error, Dir)). + throw(error(unmatched_directive, directive(Dir))). lgt_tr_directive(Dir) :- \+ lgt_entity_(_, _, _, _), % directive occurs before opening entity directive @@ -2104,24 +2139,25 @@ lgt_tr_directive(Dir) :- Dir =.. [Functor| Args], catch( lgt_tr_directive(Functor, Args), - directive_error(Error, Cause), - throw(invalid_directive_arg(Error, Cause, Dir))), + Error, + throw(error(Error, directive(Dir)))), !. lgt_tr_directive(Dir) :- - throw(invalid_directive(unknown_directive_error, Dir)). + throw(error(domain_error(directive, Dir), directive(Dir))). % lgt_tr_directive(+atom, +list) - +% +% translates a directive and its (possibly empty) list of arguments lgt_tr_directive(object, [Obj| Rels]) :- lgt_valid_object_id(Obj) -> lgt_tr_object_id(Obj), lgt_tr_object_relations(Rels, Obj) ; - throw(directive_error(object_identifier, Obj)). + throw(type_error(object_identifier, Obj)). lgt_tr_directive(end_object, []) :- lgt_entity_(object, _, _, _). @@ -2132,7 +2168,7 @@ lgt_tr_directive(protocol, [Ptc| Rels]) :- lgt_tr_protocol_id(Ptc), lgt_tr_protocol_relations(Rels, Ptc) ; - throw(directive_error(protocol_identifier, Ptc)). + throw(type_error(protocol_identifier, Ptc)). lgt_tr_directive(end_protocol, []) :- @@ -2144,7 +2180,7 @@ lgt_tr_directive(category, [Ctg| Rels]) :- lgt_tr_category_id(Ctg), lgt_tr_category_relations(Rels, Ctg) ; - throw(directive_error(category_identifier, Ctg)). + throw(type_error(category_identifier, Ctg)). lgt_tr_directive(end_category, []) :- @@ -2168,7 +2204,7 @@ lgt_tr_directive(initialization, [Goal]) :- lgt_tr_body(Goal, TGoal, Context), assertz(lgt_entity_init_(TGoal)) ; - throw(directive_error(callable, Goal)). + throw(type_error(callable, Goal)). lgt_tr_directive(op, [Priority, Specifier, Operators]) :- @@ -2178,11 +2214,11 @@ lgt_tr_directive(op, [Priority, Specifier, Operators]) :- op(Priority, Specifier, Operators), assertz(lgt_directive_(op(Priority, Specifier, Operators))) ; - throw(directive_error(operator_name, Operators))) + throw(type_error(operator_name, Operators))) ; - throw(directive_error(operator_specifier, Specifier))) + throw(type_error(operator_specifier, Specifier))) ; - throw(directive_error(operator_priority, Priority)). + throw(type_error(operator_priority, Priority)). lgt_tr_directive(uses, Objs) :- @@ -2190,9 +2226,10 @@ lgt_tr_directive(uses, Objs) :- forall( lgt_member(Obj, Objs2), (lgt_valid_object_id(Obj) -> + lgt_add_referenced_object(Obj), assertz(lgt_uses_(Obj)) ; - throw(directive_error(object_identifier, Obj)))). + throw(type_error(object_identifier, Obj)))). lgt_tr_directive(calls, Ptcs) :- @@ -2200,9 +2237,10 @@ lgt_tr_directive(calls, Ptcs) :- forall( lgt_member(Ptc, Ptcs2), (lgt_valid_protocol_id(Ptc) -> + lgt_add_referenced_protocol(Ptc), assertz(lgt_calls_(Ptc)) ; - throw(directive_error(protocol_identifier, Ptc)))). + throw(type_error(protocol_identifier, Ptc)))). lgt_tr_directive(info, [List]) :- @@ -2210,17 +2248,17 @@ lgt_tr_directive(info, [List]) :- (lgt_valid_info_list(List) -> assertz(lgt_info_(List)) ; - throw(directive_error(type_error(info_list), List))). + throw(type_error(info_list, List))). lgt_tr_directive(info, [Pred, List]) :- - (lgt_valid_pred_ind(Pred) -> + lgt_valid_pred_ind(Pred) -> (lgt_valid_info_list(List) -> assertz(lgt_info_(Pred, List)) ; - throw(directive_error(type_error(info_list), List))) + throw(type_error(info_list, List))) ; - throw(directive_error(predicate_indicator, Pred))). + throw(type_error(predicate_indicator, Pred)). @@ -2231,7 +2269,7 @@ lgt_tr_directive((public), Preds) :- (lgt_valid_pred_ind(Pred) -> assertz(lgt_public_(Pred)) ; - throw(directive_error(predicate_indicator, Pred)))). + throw(type_error(predicate_indicator, Pred)))). lgt_tr_directive(protected, Preds) :- @@ -2241,7 +2279,7 @@ lgt_tr_directive(protected, Preds) :- (lgt_valid_pred_ind(Pred) -> assertz(lgt_protected_(Pred)) ; - throw(directive_error(predicate_indicator, Pred)))). + throw(type_error(predicate_indicator, Pred)))). lgt_tr_directive(private, Preds) :- @@ -2251,7 +2289,7 @@ lgt_tr_directive(private, Preds) :- (lgt_valid_pred_ind(Pred) -> assertz(lgt_private_(Pred)) ; - throw(directive_error(predicate_indicator, Pred)))). + throw(type_error(predicate_indicator, Pred)))). lgt_tr_directive((dynamic), Preds) :- @@ -2261,7 +2299,7 @@ lgt_tr_directive((dynamic), Preds) :- (lgt_valid_pred_ind(Pred) -> assertz(lgt_dynamic_(Pred)) ; - throw(directive_error(predicate_indicator, Pred)))). + throw(type_error(predicate_indicator, Pred)))). lgt_tr_directive((discontiguous), Preds) :- @@ -2271,7 +2309,7 @@ lgt_tr_directive((discontiguous), Preds) :- (lgt_valid_pred_ind(Pred) -> assertz(lgt_discontiguous_(Pred)) ; - throw(directive_error(predicate_indicator, Pred)))). + throw(type_error(predicate_indicator, Pred)))). lgt_tr_directive(metapredicate, Preds) :- @@ -2281,7 +2319,7 @@ lgt_tr_directive(metapredicate, Preds) :- (lgt_valid_metapred_term(Pred) -> assertz(lgt_metapredicate_(Pred)) ; - throw(directive_error(metapredicate_term, Pred)))). + throw(type_error(metapredicate_term, Pred)))). lgt_tr_directive((mode), [Mode, Solutions]) :- @@ -2289,13 +2327,15 @@ lgt_tr_directive((mode), [Mode, Solutions]) :- (lgt_valid_number_of_solutions(Solutions) -> assertz(lgt_mode_(Mode, Solutions)) ; - throw(directive_error(number_of_solutions, Solutions))) + throw(type_error(number_of_solutions, Solutions))) ; - throw(directive_error(mode_term, Mode)). + throw(type_error(mode_term, Mode)). % lgt_tr_object_relations(+list, +term) +% +% translates the relations of an object with other entities lgt_tr_object_relations([], _). @@ -2304,11 +2344,13 @@ lgt_tr_object_relations([Clause| Clauses], Obj) :- (lgt_tr_object_relation(Functor, Arguments, Obj) -> lgt_tr_object_relations(Clauses, Obj) ; - throw(directive_error(relation_clause, Functor))). + throw(type_error(relation_clause, Functor))). % lgt_tr_object_relation(+atom, +list, +term) +% +% translates a relation between an object (the last argument) with other entities lgt_tr_object_relation(implements, Ptcs, Obj) :- lgt_convert_to_list(Ptcs, List), @@ -2333,6 +2375,8 @@ lgt_tr_object_relation(extends, Parents, Prototype) :- % lgt_tr_protocol_relations(+list, +term) +% +% translates the relations of a protocol with other entities lgt_tr_protocol_relations([], _). @@ -2344,6 +2388,8 @@ lgt_tr_protocol_relations([Clause| Clauses], Obj) :- % lgt_tr_protocol_relation(+atom, +list, +term) +% +% translates a relation between a protocol (the last argument) with other entities lgt_tr_protocol_relation(extends, Ptcs, Ptc) :- !, @@ -2356,6 +2402,8 @@ lgt_tr_protocol_relation(Unknown, _, _) :- % lgt_tr_category_relations(+list, +term) +% +% translates the relations of a category with other entities lgt_tr_category_relations([], _). @@ -2367,6 +2415,8 @@ lgt_tr_category_relations([Clause| Clauses], Obj) :- % lgt_tr_category_relation(+atom, +list, +term) +% +% translates a relation between a category (the last argument) with other entities lgt_tr_category_relation(implements, Ptcs, Ctg) :- !, @@ -2392,26 +2442,30 @@ lgt_tr_clauses([Clause| Clauses]) :- lgt_tr_clause(Clause) :- \+ lgt_entity_(_, _, _, _), % clause occurs before opening entity directive - assertz(lgt_feclause_(Clause)), - !. + !, + assertz(lgt_feclause_(Clause)). lgt_tr_clause(Clause) :- lgt_entity_(_, _, Prefix, _), lgt_prefix(Context, Prefix), catch( lgt_tr_clause(Clause, TClause, Context), - clause_error(Error, Cause), - throw(invalid_clause(Error, Cause, Clause))), + Error, + throw(error(Error, clause(Clause)))), assertz(lgt_eclause_(TClause)), !. lgt_tr_clause(Clause) :- - throw(invalid_clause(Clause)). + throw(error(unknown_error, clause(Clause))). % lgt_tr_clause(+clause, +clause, +term) +lgt_tr_clause((Head:-_), _, _) :- + \+ lgt_callable(Head), + throw(type_error(callable, Head)). + lgt_tr_clause((Head:-Body), (THead:-TBody), Context) :- !, lgt_extract_metavars(Head, Metavars), @@ -2420,44 +2474,53 @@ lgt_tr_clause((Head:-Body), (THead:-TBody), Context) :- lgt_tr_body(Body, Body2, Context), lgt_simplify_body(Body2, TBody). +lgt_tr_clause(Fact, _, _) :- + \+ lgt_callable(Fact), + throw(type_error(callable, Fact)). + lgt_tr_clause(Fact, TFact, Context) :- lgt_tr_head(Fact, TFact, Context). % lgt_tr_head(+callable, -callable, +term) +% +% translates an entity clause head + + +% redefinition of built-in methods lgt_tr_head(Head, _, _) :- lgt_built_in_method(Head, _), - functor(Head, Functor, Arity), - throw(clause_error(built_in_method_redef_error, Functor/Arity)). + throw(permission_error(modify, built_in_method, Head)). + + +% redefinition of Logtalk built-in predicates lgt_tr_head(Head, _, _) :- lgt_lgt_built_in(Head), lgt_compiler_option(lgtredef, warning), \+ lgt_redefined_built_in_(Head, _, _), % not already reported? functor(Head, Functor, Arity), - lgt_entity_(Type, Entity, _, _), - write('Logtalk compiler warning!'), nl, - write(' redefining a Logtalk built-in predicate: '), + write('WARNING! redefining a Logtalk built-in predicate: '), writeq(Functor/Arity), nl, - write(' inside '), write(Type), write(': '), - writeq(Entity), nl, fail. + +% redefinition of Prolog built-in predicates + lgt_tr_head(Head, _, _) :- lgt_pl_built_in(Head), lgt_compiler_option(plredef, warning), \+ lgt_redefined_built_in_(Head, _, _), % not already reported? functor(Head, Functor, Arity), - lgt_entity_(Type, Entity, _, _), - write('Logtalk compiler warning!'), nl, - write(' redefining a Prolog built-in predicate: '), + write('WARNING! redefining a Prolog built-in predicate: '), writeq(Functor/Arity), nl, - write(' inside '), write(Type), write(': '), - writeq(Entity), nl, fail. + +% translate the head of a clause of a user defined predicate + lgt_tr_head(Head, THead, Context) :- functor(Head, Functor, Arity), Head =.. [_| Args], @@ -2473,8 +2536,12 @@ lgt_tr_head(Head, THead, Context) :- % lgt_tr_body(+callable, -callable, +term) +% +% translates an entity clause body +% meta-calls + lgt_tr_body(Pred, TPred, Context) :- var(Pred), !, @@ -2487,10 +2554,14 @@ lgt_tr_body(Pred, TPred, Context) :- TPred = lgt_metacall_in_object(This, Pred, This)). +% pre-processor bypass (call of external code) + lgt_tr_body({Pred}, Pred, _) :- !. +% bagof/3 and setof/3 existential quantifiers + lgt_tr_body(Var^Pred, Var^TPred, Context) :- !, lgt_tr_body(Pred, TPred, Context). @@ -2619,7 +2690,7 @@ lgt_tr_body(retractall(Pred), lgt_retractall(This, Pred, This, _), Context) :- lgt_this(Context, This). -% inline methods +% inline methods (translated to a single unification with the corresponding context argument) lgt_tr_body(sender(Sender), true, Context) :- lgt_sender(Context, Sender), @@ -2648,11 +2719,15 @@ lgt_tr_body(Pred, lgt_call_built_in(Pred, Context), Context) :- !. +% invalid goal + lgt_tr_body(Pred, _, _) :- \+ lgt_callable(Pred), - throw(clause_error(callable, Pred)). + throw(type_error(callable, Pred)). +% goal is a call to a user predicate + lgt_tr_body(Condition, TCondition, Context) :- Condition =.. [Functor|Args], functor(Condition, Functor, Arity), @@ -2667,17 +2742,38 @@ lgt_tr_body(Condition, TCondition, Context) :- +% lgt_tr_msg(@object, @term, -term, +term) +% +% translates the sending of a message to an object + + +% message broadcasting + lgt_tr_msg(Obj, Pred, TPred, Context) :- nonvar(Obj), (Obj = (_, _); Obj = (_; _)), !, lgt_tr_msg_broadcasting(Obj, Pred, TPred, Context). + +% invalid object identifier + lgt_tr_msg(Obj, _, _, _) :- nonvar(Obj), \+ lgt_valid_object_id(Obj), !, - throw(clause_error(object_identifier, Obj)). + throw(type_error(object_identifier, Obj)). + + +% remember the object receiving the message to later check if it's known + +lgt_tr_msg(Obj, _, _, _) :- + nonvar(Obj), + lgt_add_referenced_object(Obj), + fail. + + +% non-instantiated message: traslation performed at runtime lgt_tr_msg(Obj, Pred, lgt_send_to_object(Obj, Pred, This), Context) :- var(Pred), @@ -2793,11 +2889,16 @@ lgt_tr_msg(Obj, retractall(Pred), lgt_retractall(Obj, Pred, This, p(p(_))), Cont lgt_this(Context, This). +% invalid goal + lgt_tr_msg(_, Pred, _, _) :- \+ lgt_callable(Pred), - throw(clause_error(callable, Pred)). + throw(type_error(callable, Pred)). +% message is not a built-in control construct or a call to a built-in +% (meta-)predicate: translation performed at runtime + lgt_tr_msg(Obj, Pred, lgt_send_to_object(Obj, Pred, This), Context) :- var(Obj), !, @@ -2809,6 +2910,13 @@ lgt_tr_msg(Obj, Pred, lgt_send_to_object_nv(Obj, Pred, This), Context) :- +% lgt_tr_self_msg(@term, -term, +term) +% +% translates the sending of a message to self + + +% non-instantiated message: traslation performed at runtime + lgt_tr_self_msg(Pred, lgt_send_to_self(Self, Pred, This), Context) :- var(Pred), !, @@ -2932,11 +3040,16 @@ lgt_tr_self_msg(retractall(Pred), lgt_retractall(Self, Pred, This, p(_)), Contex lgt_this(Context, This). +% invalid goal + lgt_tr_self_msg(Pred, _, _) :- \+ lgt_callable(Pred), - throw(clause_error(callable, Pred)). + throw(type_error(callable, Pred)). +% message is not a built-in control construct or a call to a built-in +% (meta-)predicate: translation performed at runtime + lgt_tr_self_msg(Pred, lgt_send_to_self_nv(Self, Pred, This), Context) :- !, lgt_self(Context, Self), @@ -2958,12 +3071,20 @@ lgt_tr_msg_broadcasting((Obj1; Obj2), Pred, (TP1; TP2), Context) :- -% calling redefined predicates (super) +% lgt_tr_super_sending(@term, -term, +term) +% +% translates calling of redefined predicates (super calls) + + +% invalid goal lgt_tr_super_sending(Pred, _, _) :- nonvar(Pred), \+ lgt_callable(Pred), - throw(clause_error(callable, Pred)). + throw(type_error(callable, Pred)). + + +% translation performed at runtime lgt_tr_super_sending(Pred, lgt_send_to_super(Self, Pred, This, Sender), Context) :- var(Pred), @@ -2980,6 +3101,9 @@ lgt_tr_super_sending(Pred, lgt_send_to_super_nv(Self, Pred, This, Sender), Conte % lgt_extract_metavars(+callable, -list) +% +% constructs a list of all variables that occur +% in a position corresponding to a meta-argument lgt_extract_metavars(Pred, Metavars) :- functor(Pred, Functor, Arity), @@ -2992,11 +3116,7 @@ lgt_extract_metavars(Pred, Metavars) :- Metavars = []). - % lgt_extract_metavars(+list, +list, -list) -% -% constructs a list of all variables that occur -% in a position corresponding to a meta-argument lgt_extract_metavars([], [], []). @@ -3011,9 +3131,9 @@ lgt_extract_metavars([_| Args], [_| MArgs], Metavars) :- -% remove redundant calls to true/0 from a clause body -% % lgt_simplify_body(+callable, -callable) +% +% remove redundant calls to true/0 from a translated clause body lgt_simplify_body((A;B), (SA;SB)) :- !, @@ -3042,21 +3162,29 @@ lgt_simplify_body(B, B). -% lgt_tr_object_id(+callable) +% lgt_tr_object_id(+object_identifier) +% +% from the object identifier construct the set of +% functor prefixes used in the compiled code clauses lgt_tr_object_id(Obj) :- - lgt_construct_object_functors(Obj, Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DDef), - assertz(lgt_object_(Obj, Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DDef)), - Term =.. [Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DDef], + lgt_add_referenced_object(Obj), + lgt_construct_object_functors(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef), + assertz(lgt_object_(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef)), + Term =.. [Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef], assertz(lgt_entity_functors_(Term)), assertz(lgt_rclause_(lgt_current_object_(Obj, Prefix, Dcl, Def, Super))), assertz(lgt_entity_(object, Obj, Prefix, Dcl)). -% lgt_tr_category_id(+callable) +% lgt_tr_category_id(+category_identifier) +% +% from the category identifier construct the set of +% functor prefixes used in the compiled code clauses lgt_tr_category_id(Ctg) :- + lgt_add_referenced_category(Ctg), lgt_construct_category_functors(Ctg, Prefix, Dcl, Def), assertz(lgt_category_(Ctg, Prefix, Dcl, Def)), Term =.. [Prefix, Dcl, Def], @@ -3066,9 +3194,13 @@ lgt_tr_category_id(Ctg) :- -% lgt_tr_protocol_id(+atom) +% lgt_tr_protocol_id(+protocol_identifier) +% +% from the protocol identifier construct the set of +% functor prefixes used in the compiled code clauses lgt_tr_protocol_id(Ptc) :- + lgt_add_referenced_protocol(Ptc), lgt_construct_protocol_functors(Ptc, Prefix, Dcl), assertz(lgt_protocol_(Ptc, Prefix, Dcl)), Term =.. [Prefix, Dcl], @@ -3078,121 +3210,247 @@ lgt_tr_protocol_id(Ptc) :- -% lgt_tr_implements_protocol(+list, +identifier) +% lgt_tr_implements_protocol(+list, +object_identifier) +% lgt_tr_implements_protocol(+list, +category_identifier) +% +% translates an "implementents" relation between +% a category or an object and a list of protocols lgt_tr_implements_protocol([], _). lgt_tr_implements_protocol([Ref| Refs], ObjOrCtg) :- - lgt_valid_entity_scope(Ref) -> + lgt_valid_scope(Ref) -> (lgt_scope_id(Ref, Scope, Ptc), (lgt_valid_protocol_id(Ptc) -> + lgt_add_referenced_protocol(Ptc), assertz(lgt_rclause_(lgt_implements_protocol_(ObjOrCtg, Ptc, Scope))), lgt_construct_protocol_functors(Ptc, Prefix, Dcl), assertz(lgt_implemented_protocol_(Ptc, Prefix, Dcl, Scope)), lgt_tr_implements_protocol(Refs, ObjOrCtg) ; - throw(directive_error(protocol_identifier, Ptc)))) + throw(type_error(protocol_identifier, Ptc)))) ; - throw(directive_error(entity_scope, Ref)). + throw(type_error(scope, Ref)). -% lgt_tr_imports_category(+list, +identifier) +% lgt_tr_imports_category(+list, +object_identifier) +% +% translates an "imports" relation between +% an object and a list of categories lgt_tr_imports_category([], _). lgt_tr_imports_category([Ref| Refs], Obj) :- - lgt_valid_entity_scope(Ref) -> + lgt_valid_scope(Ref) -> (lgt_scope_id(Ref, Scope, Ctg), (lgt_valid_category_id(Ctg) -> + lgt_add_referenced_category(Ctg), assertz(lgt_rclause_(lgt_imports_category_(Obj, Ctg, Scope))), lgt_construct_category_functors(Ctg, Prefix, Dcl, Def), assertz(lgt_imported_category_(Ctg, Prefix, Dcl, Def, Scope)), lgt_tr_imports_category(Refs, Obj) ; - throw(directive_error(category_identifier, Ctg)))) + throw(type_error(category_identifier, Ctg)))) ; - throw(directive_error(entity_scope, Ref)). + throw(type_error(scope, Ref)). -% lgt_tr_instantiates_class(+list, +identifier) +% lgt_tr_instantiates_class(+list, +object_identifier) +% +% translates an "instantiates" relation between +% an instance and a list of classes lgt_tr_instantiates_class([], _). lgt_tr_instantiates_class([Ref| Refs], Obj) :- - lgt_valid_entity_scope(Ref) -> + lgt_valid_scope(Ref) -> (lgt_scope_id(Ref, Scope, Class), (lgt_valid_object_id(Class) -> + lgt_add_referenced_object(Class), assertz(lgt_rclause_(lgt_instantiates_class_(Obj, Class, Scope))), - lgt_construct_object_functors(Class, Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DDef), - assertz(lgt_instantiated_class_(Class, Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DDef, Scope)), + lgt_construct_object_functors(Class, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef), + assertz(lgt_instantiated_class_(Class, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Scope)), lgt_tr_instantiates_class(Refs, Obj) ; - throw(directive_error(object_identifier, Class)))) + throw(type_error(object_identifier, Class)))) ; - throw(directive_error(entity_scope, Ref)). + throw(type_error(scope, Ref)). -% lgt_tr_specializes_class(+list, +identifier) +% lgt_tr_specializes_class(+list, +object_identifier) +% +% translates a "specializes" relation between +% a class and a list of superclasses lgt_tr_specializes_class([], _). lgt_tr_specializes_class([Ref| Refs], Class) :- - lgt_valid_entity_scope(Ref) -> + lgt_valid_scope(Ref) -> (lgt_scope_id(Ref, Scope, Superclass), (lgt_valid_object_id(Superclass) -> + lgt_add_referenced_object(Superclass), assertz(lgt_rclause_(lgt_specializes_class_(Class, Superclass, Scope))), - lgt_construct_object_functors(Superclass, Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DDef), - assertz(lgt_specialized_class_(Superclass, Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DDef, Scope)), + lgt_construct_object_functors(Superclass, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef), + assertz(lgt_specialized_class_(Superclass, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Scope)), lgt_tr_specializes_class(Refs, Class) ; - throw(directive_error(object_identifier, Superclass)))) + throw(type_error(object_identifier, Superclass)))) ; - throw(directive_error(entity_scope, Ref)). + throw(type_error(scope, Ref)). -% lgt_tr_extends_object(+list, +identifier) +% lgt_tr_extends_object(+list, +object_identifier) +% +% translates an "extends" relation between +% a prototype and a list of parents lgt_tr_extends_object([], _). lgt_tr_extends_object([Ref| Refs], Obj) :- - lgt_valid_entity_scope(Ref) -> + lgt_valid_scope(Ref) -> (lgt_scope_id(Ref, Scope, Parent), (lgt_valid_object_id(Parent) -> + lgt_add_referenced_object(Parent), assertz(lgt_rclause_(lgt_extends_object_(Obj, Parent, Scope))), - lgt_construct_object_functors(Parent, Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DDef), - assertz(lgt_extended_object_(Parent, Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DDef, Scope)), + lgt_construct_object_functors(Parent, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef), + assertz(lgt_extended_object_(Parent, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Scope)), lgt_tr_extends_object(Refs, Obj) ; - throw(directive_error(object_identifier, Parent)))) + throw(type_error(object_identifier, Parent)))) ; - throw(directive_error(entity_scope, Ref)). + throw(type_error(scope, Ref)). -% lgt_tr_extends_protocol(+list, +identifier) +% lgt_tr_extends_protocol(+list, +protocol_identifier) +% +% translates an "extends" relation between +% a protocol and a list of protocols lgt_tr_extends_protocol([], _). lgt_tr_extends_protocol([Ref| Refs], Ptc1) :- - lgt_valid_entity_scope(Ref) -> + lgt_valid_scope(Ref) -> (lgt_scope_id(Ref, Scope, Ptc2), (lgt_valid_protocol_id(Ptc2) -> + lgt_add_referenced_protocol(Ptc2), assertz(lgt_rclause_(lgt_extends_protocol_(Ptc1, Ptc2, Scope))), lgt_construct_protocol_functors(Ptc2, Prefix, Dcl), assertz(lgt_extended_protocol_(Ptc2, Prefix, Dcl, Scope)), lgt_tr_extends_protocol(Refs, Ptc1) ; - throw(directive_error(protocol_identifier, Ptc2)))) + throw(type_error(protocol_identifier, Ptc2)))) ; - throw(directive_error(entity_scope, Ref)). + throw(type_error(scope, Ref)). + + + +% lgt_add_referenced_object(+object_identifier) +% +% assert the name of an object referenced by the entity that we are compiling + +lgt_add_referenced_object(Obj) :- + lgt_referenced_object_(Obj) -> + true + ; + assertz(lgt_referenced_object_(Obj)). + + + +% lgt_add_referenced_protocol(+protocol_identifier) +% +% assert the name of a protocol referenced by the entity that we are compiling + +lgt_add_referenced_protocol(Ptc) :- + lgt_referenced_protocol_(Ptc) -> + true + ; + assertz(lgt_referenced_protocol_(Ptc)). + + + +% lgt_add_referenced_category(+category_identifier) +% +% assert the name of a category referenced by the entity that we are compiling + +lgt_add_referenced_category(Ctg) :- + lgt_referenced_category_(Ctg) -> + true + ; + assertz(lgt_referenced_category_(Ctg)). + + + +% lgt_report_unknown_entities +% +% report any unknown referenced entities found while compiling an entity +% (if the corresponding compiler option is not set to "silent") + +lgt_report_unknown_entities :- + lgt_compiler_option(unknown, warning) -> + lgt_report_unknown_objects, + lgt_report_unknown_protocols, + lgt_report_unknown_categories + ; + true. + + + +% lgt_report_unknown_objects +% +% report any unknown referenced objects found while compiling an entity + +lgt_report_unknown_objects :- + findall( + Obj, + (lgt_referenced_object_(Obj), \+ (lgt_current_object_(Obj, _, _, _, _); lgt_entity_(_, Obj, _, _))), + Objs), + (Objs \= [] -> + write('WARNING! references to unknown objects: '), writeq(Objs), nl + ; + true). + + + +% lgt_report_unknown_protocols +% +% report any unknown referenced protocols found while compiling an entity + +lgt_report_unknown_protocols :- + findall( + Ptc, + (lgt_referenced_protocol_(Ptc), \+ (lgt_current_protocol_(Ptc, _); lgt_entity_(_, Ptc, _, _))), + Ptcs), + (Ptcs \= [] -> + write('WARNING! references to unknown protocols: '), writeq(Ptcs), nl + ; + true). + + + +% lgt_report_unknown_categories +% +% report any unknown referenced categories found while compiling an entity + +lgt_report_unknown_categories :- + findall( + Ctg, + (lgt_referenced_category_(Ctg), \+ (lgt_current_category_(Ctg, _); lgt_entity_(_, Ctg, _, _))), + Ctgs), + (Ctgs \= [] -> + write('WARNING! references to unknown categories: '), writeq(Ctgs), nl + ; + true). % lgt_add_def_clause(+atom, +integer, +atom, +term) +% +% adds a "def clause" (used to translate a predicate call) lgt_add_def_clause(Functor, Arity, Prefix, Context) :- functor(Head, Functor, Arity), @@ -3222,19 +3480,23 @@ lgt_add_def_clause(Functor, Arity, Prefix, Context) :- % lgt_assert_dynamic_def_clause(+atom, +integer, +atom, +atom, -callable) +% +% asserts a dynamic "def clause" (used to translate a predicate call) lgt_assert_dynamic_def_clause(Functor, Arity, OPrefix, DDef, Call) :- lgt_construct_predicate_functor(OPrefix, Functor, Arity, PPrefix), functor(Pred, Functor, Arity), Pred =.. [_| Args], lgt_append(Args, [Sender, This, Self], TArgs), - Call =.. [PPrefix|TArgs], + Call =.. [PPrefix| TArgs], Clause =.. [DDef, Pred, Sender, This, Self, Call], assertz(Clause). % lgt_assert_dynamic_dcl_clause(+term, +atom) +% +% asserts a dynamic predicate declaration lgt_assert_dynamic_dcl_clause(Pred, DDcl) :- functor(Pred, Functor, Arity), @@ -3245,6 +3507,8 @@ lgt_assert_dynamic_dcl_clause(Pred, DDcl) :- % lgt_gen_directives(+atom) +% +% generates entity directives lgt_gen_directives(object) :- lgt_gen_object_directives. @@ -3281,26 +3545,36 @@ lgt_gen_protocol_directives :- lgt_gen_object_dynamic_directives :- - lgt_object_(_, Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DDef), - assertz(lgt_directive_(dynamic(DDcl/4))), - assertz(lgt_directive_(dynamic(DDef/5))), - lgt_entity_comp_mode_((dynamic)), - !, + lgt_entity_comp_mode_((dynamic)) -> + lgt_gen_dynamic_object_dynamic_directives + ; + lgt_gen_static_object_dynamic_directives. + + + +lgt_gen_dynamic_object_dynamic_directives :- + lgt_object_(_, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef), assertz(lgt_directive_(dynamic(Prefix/7))), assertz(lgt_directive_(dynamic(Dcl/4))), assertz(lgt_directive_(dynamic(Dcl/6))), assertz(lgt_directive_(dynamic(Def/5))), assertz(lgt_directive_(dynamic(Def/6))), assertz(lgt_directive_(dynamic(Super/6))), - assertz(lgt_directive_(dynamic(SDcl/6))), - assertz(lgt_directive_(dynamic(SDef/6))), + assertz(lgt_directive_(dynamic(IDcl/6))), + assertz(lgt_directive_(dynamic(IDef/6))), + assertz(lgt_directive_(dynamic(DDcl/4))), + assertz(lgt_directive_(dynamic(DDef/5))), forall( (lgt_def_(Clause), Clause \= (_ :- _)), (arg(5, Clause, Call), functor(Call, Functor, Arity), assertz(lgt_directive_(dynamic(Functor/Arity))))). -lgt_gen_object_dynamic_directives :- - lgt_object_(_, _, _, Def, _, _, _, _, _), + + +lgt_gen_static_object_dynamic_directives :- + lgt_object_(_, _, _, Def, _, _, _, DDcl, DDef), + assertz(lgt_directive_(dynamic(DDcl/4))), + assertz(lgt_directive_(dynamic(DDef/5))), lgt_dynamic_(Functor/Arity), functor(Pred, Functor, Arity), Clause =.. [Def, Pred, _, _, _, TPred], @@ -3309,7 +3583,7 @@ lgt_gen_object_dynamic_directives :- assertz(lgt_directive_(dynamic(TFunctor/TArity))), fail. -lgt_gen_object_dynamic_directives. +lgt_gen_static_object_dynamic_directives. @@ -3387,7 +3661,9 @@ lgt_gen_local_dcl_clauses :- ((lgt_public_(Functor/Arity), Scope = p(p(p))); (lgt_protected_(Functor/Arity), Scope = p(p)); (lgt_private_(Functor/Arity), Scope = p)), - ((lgt_entity_comp_mode_((dynamic)); lgt_dynamic_(Functor/Arity)) -> Compilation = (dynamic); Compilation = static), + ((lgt_entity_comp_mode_((dynamic)); lgt_dynamic_(Functor/Arity)) -> + Compilation = (dynamic); + Compilation = static), functor(Meta, Functor, Arity), (lgt_metapredicate_(Meta) -> Meta2 = Meta; Meta2 = no), functor(Pred, Functor, Arity), @@ -3561,6 +3837,7 @@ lgt_gen_prototype_linking_dcl_clauses :- assertz(lgt_dcl_((Head:-Body2))). + lgt_gen_prototype_implements_dcl_clauses :- lgt_object_(Obj, _, ODcl, _, _, _, _, _, _), Head =.. [ODcl, Pred, Scope, Compilation, Meta, Obj, Container], @@ -3703,9 +3980,9 @@ lgt_gen_prototype_super_clauses. lgt_gen_ic_clauses :- lgt_gen_ic_dcl_clauses, - lgt_gen_ic_sdcl_clauses, + lgt_gen_ic_idcl_clauses, lgt_gen_ic_def_clauses, - lgt_gen_ic_sdef_clauses, + lgt_gen_ic_idef_clauses, lgt_gen_ic_super_clauses. @@ -3737,16 +4014,16 @@ lgt_gen_ic_hierarchy_dcl_clauses :- lgt_gen_ic_hierarchy_dcl_clauses :- lgt_object_(Obj, _, ODcl, _, _, _, _, _, _), Head =.. [ODcl, Pred, Scope, Compilation, Meta, SContainer, TContainer], - lgt_instantiated_class_(_, _, _, _, _, CSDcl, _, _, _, EScope), + lgt_instantiated_class_(_, _, _, _, _, CIDcl, _, _, _, EScope), (EScope = (public) -> - Body =.. [CSDcl, Pred, Scope, Compilation, Meta, SContainer, TContainer] + Body =.. [CIDcl, Pred, Scope, Compilation, Meta, SContainer, TContainer] ; (EScope = protected -> - Call =.. [CSDcl, Pred, Scope2, Compilation, Meta, SContainer, TContainer], + Call =.. [CIDcl, Pred, Scope2, Compilation, Meta, SContainer, TContainer], Body = (Call, (Scope2 = p -> Scope = p; Scope = p(p))) ; Scope = p, - Call =.. [CSDcl, Pred, Scope2, Compilation, Meta, SContainer2, TContainer], + Call =.. [CIDcl, Pred, Scope2, Compilation, Meta, SContainer2, TContainer], Body = (Call, (Scope2 = p -> SContainer = SContainer2; SContainer = Obj)))), assertz(lgt_dcl_((Head:-Body))), fail. @@ -3755,17 +4032,19 @@ lgt_gen_ic_hierarchy_dcl_clauses. -lgt_gen_ic_sdcl_clauses :- - lgt_gen_ic_linking_sdcl_clauses, - lgt_gen_ic_protocol_sdcl_clauses, - lgt_gen_ic_category_sdcl_clauses, - lgt_gen_ic_hierarchy_sdcl_clauses. +% generates instance/class inherited declaration clauses + +lgt_gen_ic_idcl_clauses :- + lgt_gen_ic_linking_idcl_clauses, + lgt_gen_ic_protocol_idcl_clauses, + lgt_gen_ic_category_idcl_clauses, + lgt_gen_ic_hierarchy_idcl_clauses. -lgt_gen_ic_linking_sdcl_clauses :- - lgt_object_(Obj, _, Dcl, _, _, SDcl, _, DDcl, _), - Head =.. [SDcl, Pred, Scope, Compilation, Meta, Obj, Obj], +lgt_gen_ic_linking_idcl_clauses :- + lgt_object_(Obj, _, Dcl, _, _, IDcl, _, DDcl, _), + Head =.. [IDcl, Pred, Scope, Compilation, Meta, Obj, Obj], Body =.. [Dcl, Pred, Scope, Compilation, Meta], assertz(lgt_dcl_((Head:-Body))), Body2 =.. [DDcl, Pred, Scope, Compilation, Meta], @@ -3774,9 +4053,9 @@ lgt_gen_ic_linking_sdcl_clauses :- -lgt_gen_ic_protocol_sdcl_clauses :- - lgt_object_(Obj, _, _, _, _, OSDcl, _, _, _), - Head =.. [OSDcl, Pred, Scope, Compilation, Meta, Obj, Container], +lgt_gen_ic_protocol_idcl_clauses :- + lgt_object_(Obj, _, _, _, _, OIDcl, _, _, _), + Head =.. [OIDcl, Pred, Scope, Compilation, Meta, Obj, Container], lgt_implemented_protocol_(_, _, PDcl, EScope), (EScope = (public) -> Body =.. [PDcl, Pred, Scope, Compilation, Meta, Container] @@ -3790,13 +4069,13 @@ lgt_gen_ic_protocol_sdcl_clauses :- assertz(lgt_dcl_((Head:-Body))), fail. -lgt_gen_ic_protocol_sdcl_clauses. +lgt_gen_ic_protocol_idcl_clauses. -lgt_gen_ic_category_sdcl_clauses :- - lgt_object_(Obj, _, _, _, _, OSDcl, _, _, _), - Head =.. [OSDcl, Pred, Scope, Compilation, Meta, Obj, Container], +lgt_gen_ic_category_idcl_clauses :- + lgt_object_(Obj, _, _, _, _, OIDcl, _, _, _), + Head =.. [OIDcl, Pred, Scope, Compilation, Meta, Obj, Container], lgt_imported_category_(_, _, CDcl, _, EScope), (EScope = (public) -> Body =.. [CDcl, Pred, Scope, Compilation, Meta, Container] @@ -3810,28 +4089,28 @@ lgt_gen_ic_category_sdcl_clauses :- assertz(lgt_dcl_((Head:-Body))), fail. -lgt_gen_ic_category_sdcl_clauses. +lgt_gen_ic_category_idcl_clauses. -lgt_gen_ic_hierarchy_sdcl_clauses :- - lgt_object_(Obj, _, _, _, _, CSDcl, _, _, _), - Head =.. [CSDcl, Pred, Scope, Compilation, Meta, SContainer, TContainer], - lgt_specialized_class_(_, _, _, _, _, SSDcl, _, _, _, EScope), +lgt_gen_ic_hierarchy_idcl_clauses :- + lgt_object_(Obj, _, _, _, _, CIDcl, _, _, _), + Head =.. [CIDcl, Pred, Scope, Compilation, Meta, SContainer, TContainer], + lgt_specialized_class_(_, _, _, _, _, SIDcl, _, _, _, EScope), (EScope = (public) -> - Body =.. [SSDcl, Pred, Scope, Compilation, Meta, SContainer, TContainer] + Body =.. [SIDcl, Pred, Scope, Compilation, Meta, SContainer, TContainer] ; (EScope = protected -> - Call =.. [SSDcl, Pred, Scope2, Compilation, Meta, SContainer, TContainer], + Call =.. [SIDcl, Pred, Scope2, Compilation, Meta, SContainer, TContainer], Body = (Call, (Scope2 = p -> Scope = p; Scope = p(p))) ; Scope = p, - Call =.. [SSDcl, Pred, Scope2, Compilation, Meta, SContainer2, TContainer], + Call =.. [SIDcl, Pred, Scope2, Compilation, Meta, SContainer2, TContainer], Body = (Call, (Scope2 = p -> SContainer = SContainer2; SContainer = Obj)))), assertz(lgt_dcl_((Head:-Body))), fail. -lgt_gen_ic_hierarchy_sdcl_clauses. +lgt_gen_ic_hierarchy_idcl_clauses. @@ -3881,8 +4160,8 @@ lgt_gen_ic_hierarchy_def_clauses :- lgt_object_(Obj, _, _, ODef, _, _, _, _, _), lgt_rclause_(lgt_instantiates_class_(Obj, Class, _)), Head =.. [ODef, Pred, Sender, Obj, Self, Call, Container], - lgt_instantiated_class_(Class, _, _, _, _, _, CSDef, _, _, _), - Body =.. [CSDef, Pred, Sender, Class, Self, Call, Container], + lgt_instantiated_class_(Class, _, _, _, _, _, CIDef, _, _, _), + Body =.. [CIDef, Pred, Sender, Class, Self, Call, Container], assertz(lgt_def_((Head:-Body))), fail. @@ -3891,16 +4170,16 @@ lgt_gen_ic_hierarchy_def_clauses. -lgt_gen_ic_sdef_clauses :- - lgt_gen_ic_linking_sdef_clauses, - lgt_gen_ic_category_sdef_clauses, - lgt_gen_ic_hierarchy_sdef_clauses. +lgt_gen_ic_idef_clauses :- + lgt_gen_ic_linking_idef_clauses, + lgt_gen_ic_category_idef_clauses, + lgt_gen_ic_hierarchy_idef_clauses. -lgt_gen_ic_linking_sdef_clauses :- - lgt_object_(Obj, _, _, Def, _, _, SDef, _, DDef), - Head =.. [SDef, Pred, Sender, This, Self, Call, Obj], +lgt_gen_ic_linking_idef_clauses :- + lgt_object_(Obj, _, _, Def, _, _, IDef, _, DDef), + Head =.. [IDef, Pred, Sender, This, Self, Call, Obj], Body =.. [Def, Pred, Sender, This, Self, Call], assertz(lgt_def_((Head:-Body))), Body2 =.. [DDef, Pred, Sender, This, Self, Call], @@ -3908,30 +4187,30 @@ lgt_gen_ic_linking_sdef_clauses :- -lgt_gen_ic_category_sdef_clauses :- - lgt_object_(Obj, _, _, _, _, _, OSDef, _, _), +lgt_gen_ic_category_idef_clauses :- + lgt_object_(Obj, _, _, _, _, _, OIDef, _, _), lgt_rclause_(lgt_imports_category_(Obj, Ctg, _)), - Head =.. [OSDef, Pred, Sender, Obj, Self, Call, Ctg], + Head =.. [OIDef, Pred, Sender, Obj, Self, Call, Ctg], lgt_imported_category_(Ctg, _, _, CDef, _), Body =.. [CDef, Pred, Sender, Obj, Self, Call], assertz(lgt_def_((Head:-Body))), fail. -lgt_gen_ic_category_sdef_clauses. +lgt_gen_ic_category_idef_clauses. -lgt_gen_ic_hierarchy_sdef_clauses :- - lgt_object_(Class, _, _, _, _, _, CSDef, _, _), +lgt_gen_ic_hierarchy_idef_clauses :- + lgt_object_(Class, _, _, _, _, _, CIDef, _, _), lgt_rclause_(lgt_specializes_class_(Class, Super, _)), - Head =.. [CSDef, Pred, Sender, Class, Self, Call, Container], - lgt_specialized_class_(Super, _, _, _, _, _, SSDef, _, _, _), - Body =.. [SSDef, Pred, Sender, Super, Self, Call, Container], + Head =.. [CIDef, Pred, Sender, Class, Self, Call, Container], + lgt_specialized_class_(Super, _, _, _, _, _, SIDef, _, _, _), + Body =.. [SIDef, Pred, Sender, Super, Self, Call, Container], assertz(lgt_def_((Head:-Body))), fail. -lgt_gen_ic_hierarchy_sdef_clauses. +lgt_gen_ic_hierarchy_idef_clauses. @@ -3951,8 +4230,8 @@ lgt_gen_ic_super_clauses :- lgt_object_(Obj, _, _, _, OSuper, _, _, _, _), lgt_rclause_(lgt_instantiates_class_(Obj, Class, _)), Head =.. [OSuper, Pred, Sender, Obj, Obj, Call, Container], - lgt_instantiated_class_(Class, _, _, _, _, _, CSDef, _, _, _), - Body =.. [CSDef, Pred, Sender, Class, Obj, Call, Container], + lgt_instantiated_class_(Class, _, _, _, _, _, CIDef, _, _, _), + Body =.. [CIDef, Pred, Sender, Class, Obj, Call, Container], assertz(lgt_def_((Head:-Body))), fail. @@ -3962,8 +4241,8 @@ lgt_gen_ic_super_clauses :- lgt_object_(Class, _, _, _, CSuper, _, _, _, _), lgt_rclause_(lgt_specializes_class_(Class, Super, _)), Head =.. [CSuper, Pred, Sender, Class, Self, Call, Container], - lgt_specialized_class_(Super, _, _, _, _, _, SSDef, _, _, _), - Body =.. [SSDef, Pred, Sender, Super, Self, Call, Container], + lgt_specialized_class_(Super, _, _, _, _, _, SIDef, _, _, _), + Body =.. [SIDef, Pred, Sender, Super, Self, Call, Container], assertz(lgt_def_((Head:-Body))), fail. @@ -3971,6 +4250,11 @@ lgt_gen_ic_super_clauses. +% lgt_fix_redef_built_ins +% +% fix the calls of any redefined built-in predicate in all entity clauses +% and initialization goals + lgt_fix_redef_built_ins :- retract(lgt_eclause_(Clause)), lgt_fix_redef_built_ins(Clause, Fixed), @@ -4072,18 +4356,28 @@ lgt_report_misspelt_calls([]). lgt_report_misspelt_calls([Pred| Preds]) :- lgt_compiler_option(misspelt, warning) -> - lgt_entity_(Type, Entity, _, _), - write('Logtalk compiler warning!'), nl, - write(' these static predicates are called but never defined: '), nl, - write(' '), writeq([Pred| Preds]), nl, - write(' inside '), write(Type), write(': '), - writeq(Entity), nl + write('WARNING! these static predicates are called but never defined: '), + writeq([Pred| Preds]), nl ; true. +% lgt_write_directives(+stream) +% +% writes the Logtalk and user directives + lgt_write_directives(Stream) :- + lgt_write_lgt_directives(Stream), + lgt_write_user_directives(Stream). + + + +% lgt_write_lgt_directives(+stream) +% +% writes the Logtalk message sending operator directives + +lgt_write_lgt_directives(Stream) :- write_term(Stream, ':- ', []), write_term(Stream, op(600, xfy, ::), [quoted(true)]), write_term(Stream, '.', []), nl(Stream), @@ -4092,15 +4386,23 @@ lgt_write_directives(Stream) :- write_term(Stream, '.', []), nl(Stream), write_term(Stream, ':- ', []), write_term(Stream, op(600, fx, ^^), [quoted(true)]), - write_term(Stream, '.', []), nl(Stream), + write_term(Stream, '.', []), nl(Stream). + + + +% lgt_write_user_directives(+stream) +% +% writes the user directives + +lgt_write_user_directives(Stream) :- lgt_directive_(Dir), - write_term(Stream, ':- ', []), - write_term(Stream, Dir, [quoted(true)]), - write_term(Stream, '.', []), - nl(Stream), + write_term(Stream, ':- ', []), + write_term(Stream, Dir, [quoted(true)]), + write_term(Stream, '.', []), + nl(Stream), fail. -lgt_write_directives(_). +lgt_write_user_directives(_). @@ -4164,6 +4466,12 @@ lgt_write_entity_clauses(_). +% lgt_write_init_call(+stream) +% +% writes the initialization call for the compiled entity that will assert +% the relation clauses and call any declared initialization goal when the +% entity is loaded + lgt_write_init_call(Stream) :- lgt_compiler_option(iso_initialization_dir, true), !, @@ -4193,6 +4501,10 @@ lgt_write_init_call(Stream) :- +% lgt_assert_tr_entity +% +% adds a dynamically created entity to memory + lgt_assert_tr_entity :- lgt_assert_directives, lgt_assert_functors_clause, @@ -4272,6 +4584,10 @@ lgt_assert_relation_clauses. +% lgt_assert_init +% +% call any defined initialization goal for a dynamically created entity + lgt_assert_init :- lgt_fentity_init_(Goal) -> once(Goal) @@ -4304,8 +4620,10 @@ lgt_assert_relation_clause(Clause) :- % lgt_construct_object_functors(+compound, -atom, -atom, -atom, -atom, -atom, -atom, -atom, -atom) +% +% constructs all the functors used in the compiled code of an object -lgt_construct_object_functors(Obj, Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DDef) :- +lgt_construct_object_functors(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef) :- functor(Obj, Functor, Arity), number_codes(Arity, Codes), atom_codes(Atom, Codes), @@ -4314,14 +4632,16 @@ lgt_construct_object_functors(Obj, Prefix, Dcl, Def, Super, SDcl, SDef, DDcl, DD atom_concat(Prefix, '_dcl', Dcl), atom_concat(Prefix, '_def', Def), atom_concat(Prefix, '_super', Super), - atom_concat(Prefix, '_sdcl', SDcl), - atom_concat(Prefix, '_sdef', SDef), + atom_concat(Prefix, '_idcl', IDcl), + atom_concat(Prefix, '_idef', IDef), atom_concat(Prefix, '_ddcl', DDcl), atom_concat(Prefix, '_ddef', DDef). % lgt_construct_protocol_functors(+compound, -atom, -atom) +% +% constructs all the functors used in the compiled code of a protocol lgt_construct_protocol_functors(Ptc, Prefix, Dcl) :- functor(Ptc, Functor, Arity), @@ -4334,6 +4654,8 @@ lgt_construct_protocol_functors(Ptc, Prefix, Dcl) :- % lgt_construct_category_functors(+compound, -atom, -atom, -atom) +% +% constructs all the functors used in the compiled code of a category lgt_construct_category_functors(Ctg, Prefix, Dcl, Def) :- functor(Ctg, Functor, Arity), @@ -4347,6 +4669,8 @@ lgt_construct_category_functors(Ctg, Prefix, Dcl, Def) :- % lgt_construct_predicate_functor(+atom, +atom, +integer, -atom) +% +% constructs the functor used for a compiled predicate lgt_construct_predicate_functor(EPrefix, Functor, Arity, PPrefix) :- atom_concat(EPrefix, Functor, Aux), @@ -4559,9 +4883,9 @@ lgt_valid_protocol_id(Term) :- -% lgt_valid_entity_scope(@term) +% lgt_valid_scope(@term) -lgt_valid_entity_scope(Term) :- +lgt_valid_scope(Term) :- nonvar(Term), (Term = (Scope::_) -> nonvar(Scope), @@ -4644,6 +4968,8 @@ lgt_valid_number_of_solutions(Solutions) :- % lgt_valid_info_list(@list) +% +% true if the argument is a list of key-value pairs lgt_valid_info_list([]). @@ -4680,6 +5006,9 @@ lgt_valid_compiler_option(xml(Option)) :- lgt_valid_compiler_option(xsl(File)) :- atom(File). +lgt_valid_compiler_option(unknown(Option)) :- + once((Option == silent; Option == warning)). + lgt_valid_compiler_option(singletons(Option)) :- once((Option == silent; Option == warning)). @@ -4757,6 +5086,10 @@ lgt_lgt_built_in(current_event(_, _, _, _, _)). +% lgt_write_xml_file(+stream) +% +% writes a XML file containing the documentation of a compiled entity + lgt_write_xml_file(Stream) :- lgt_write_xml_header(Stream), lgt_write_xml_entity(Stream), @@ -4879,6 +5212,10 @@ lgt_relation_to_xml_filename(Relation, File) :- +% lgt_write_xml_predicates(+stream) +% +% writes the predicate documentation + lgt_write_xml_predicates(Stream) :- lgt_write_xml_open_tag(Stream, predicates, []), lgt_write_xml_public_predicates(Stream), @@ -4888,6 +5225,10 @@ lgt_write_xml_predicates(Stream) :- +% lgt_write_xml_public_predicates(+stream) +% +% writes the documentation of public predicates + lgt_write_xml_public_predicates(Stream) :- lgt_write_xml_open_tag(Stream, (public), []), lgt_public_(Functor/Arity), @@ -4899,6 +5240,10 @@ lgt_write_xml_public_predicates(Stream) :- +% lgt_write_xml_protected_predicates(+stream) +% +% writes the documentation protected predicates + lgt_write_xml_protected_predicates(Stream) :- lgt_write_xml_open_tag(Stream, protected, []), lgt_protected_(Functor/Arity), @@ -4910,6 +5255,10 @@ lgt_write_xml_protected_predicates(Stream) :- +% lgt_write_xml_private_predicates(+stream) +% +% writes the documentation of private predicates + lgt_write_xml_private_predicates(Stream) :- lgt_write_xml_open_tag(Stream, private, []), lgt_private_(Functor/Arity), @@ -4921,6 +5270,10 @@ lgt_write_xml_private_predicates(Stream) :- +% lgt_write_xml_predicate(+stream, +atom/+integer, +term) +% +% writes the documentation of a predicate + lgt_write_xml_predicate(Stream, Functor/Arity, Scope) :- ((lgt_entity_comp_mode_((dynamic)); lgt_dynamic_(Functor/Arity)) -> Compilation = (dynamic) @@ -5129,4 +5482,3 @@ lgt_banner :- % end! % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - diff --git a/library/logtalk/yap430.config b/library/logtalk/yap430.config index 55427d2f3..269acf575 100644 --- a/library/logtalk/yap430.config +++ b/library/logtalk/yap430.config @@ -1,7 +1,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Logtalk - Object oriented extension to Prolog -% Release 2.8.4 +% Release 2.9.1 % % configuration file for YAP Prolog 4.3.x % @@ -176,8 +176,9 @@ lgt_file_extension(xml, '.xml'). lgt_default_compiler_option(iso_initialization_dir, true). lgt_default_compiler_option(xml, on). -lgt_default_compiler_option(xsl, 'logtalk.xsl'). +lgt_default_compiler_option(xsl, 'lgtxml.xsl'). +lgt_default_compiler_option(unknown, warning). lgt_default_compiler_option(misspelt, warning). lgt_default_compiler_option(singletons, warning). lgt_default_compiler_option(lgtredef, warning). @@ -316,4 +317,3 @@ lgt_cpu_time(Seconds) :- % end! % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -