From 06ea1bd8ecdc583165ed8514bbe86ecb1b35e2e7 Mon Sep 17 00:00:00 2001 From: pmoura Date: Wed, 3 Apr 2002 13:26:59 +0000 Subject: [PATCH] Logtalk 2.10.0 file. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@424 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- Logtalk/QUICK_START | 2 +- Logtalk/README | 2 +- Logtalk/RELEASE_NOTES | 27 +- Logtalk/UPGRADING | 5 +- Logtalk/examples/NOTES | 2 +- Logtalk/examples/birds/NOTES | 2 +- Logtalk/examples/birds/SCRIPT | 2 +- Logtalk/examples/bricks/NOTES | 2 +- Logtalk/examples/bricks/SCRIPT | 2 +- Logtalk/examples/classvars/NOTES | 2 +- Logtalk/examples/classvars/SCRIPT | 2 +- Logtalk/examples/errors/NOTES | 2 +- Logtalk/examples/errors/catdynpred.lgt | 14 + Logtalk/examples/errors/errors.loader | 6 + Logtalk/examples/errors/portability.lgt | 16 +- Logtalk/examples/inheritance/NOTES | 2 +- Logtalk/examples/inheritance/SCRIPT | 2 +- 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/travellers/NOTES | 2 +- Logtalk/examples/lo/travellers/SCRIPT | 2 +- Logtalk/examples/lpa/NOTES | 8 +- Logtalk/examples/lpa/SCRIPT | 2 +- Logtalk/examples/metapredicates/NOTES | 2 +- Logtalk/examples/metapredicates/SCRIPT | 2 +- Logtalk/examples/mi/NOTES | 2 +- Logtalk/examples/mi/SCRIPT | 2 +- Logtalk/examples/miscellaneous/NOTES | 2 +- Logtalk/examples/miscellaneous/SCRIPT | 2 +- Logtalk/examples/parametric/NOTES | 2 +- Logtalk/examples/parametric/SCRIPT | 2 +- Logtalk/examples/points/NOTES | 2 +- Logtalk/examples/points/SCRIPT | 13 +- Logtalk/examples/polygons/NOTES | 2 +- Logtalk/examples/polygons/SCRIPT | 2 +- Logtalk/examples/profiling/NOTES | 2 +- Logtalk/examples/profiling/SCRIPT | 4 +- Logtalk/examples/reflection/NOTES | 2 +- Logtalk/examples/reflection/SCRIPT | 2 +- Logtalk/examples/relations/NOTES | 2 +- Logtalk/examples/relations/SCRIPT | 2 +- Logtalk/examples/roots/NOTES | 2 +- Logtalk/examples/roots/SCRIPT | 2 +- Logtalk/examples/searching/NOTES | 2 +- Logtalk/examples/searching/SCRIPT | 2 +- Logtalk/examples/sicstus/NOTES | 2 +- Logtalk/examples/sicstus/SCRIPT | 2 +- Logtalk/examples/sicstus/sicstus.loader | 2 +- Logtalk/examples/symdiff/NOTES | 2 +- Logtalk/examples/symdiff/SCRIPT | 2 +- Logtalk/examples/viewpoints/NOTES | 2 +- Logtalk/examples/viewpoints/SCRIPT | 2 +- Logtalk/library/NOTES | 2 +- Logtalk/library/SCRIPT | 2 +- Logtalk/library/all.notes | 2 +- Logtalk/library/dates.notes | 2 +- Logtalk/library/debugging.notes | 2 +- Logtalk/library/events.notes | 2 +- Logtalk/library/hierarchies.notes | 2 +- Logtalk/library/metapredicates.notes | 2 +- Logtalk/library/random.notes | 2 +- Logtalk/library/types.notes | 2 +- Logtalk/manuals/NOTES | 2 +- Logtalk/manuals/index.html | 6 +- Logtalk/manuals/refman/index.html | 4 +- Logtalk/manuals/refman/methods/abolish1.html | 6 +- Logtalk/manuals/refman/methods/clause2.html | 6 +- Logtalk/manuals/refman/methods/retract1.html | 4 +- .../manuals/refman/methods/retractall1.html | 4 +- Logtalk/manuals/tutorial/index.html | 4 +- Logtalk/manuals/userman/categories.html | 7 +- Logtalk/manuals/userman/index.html | 4 +- Logtalk/xml/NOTES | 6 +- Logtalk/xml/ie50.xsl | 2 +- Logtalk/xml/lgthtml.xsl | 2 +- Logtalk/xml/lgtpdfa4.xsl | 2 +- Logtalk/xml/lgtpdfus.xsl | 2 +- Logtalk/xml/lgtxml.xsl | 2 +- Logtalk/xml/logtalk.dtd | 2 +- Logtalk/xml/logtalk.xsd | 2 +- Logtalk/xml/texml.xsl | 2 +- library/logtalk/logtalk.pl | 401 +++++++++++------- library/logtalk/yap430.config | 2 +- 86 files changed, 410 insertions(+), 269 deletions(-) create mode 100644 Logtalk/examples/errors/catdynpred.lgt diff --git a/Logtalk/QUICK_START b/Logtalk/QUICK_START index e952ed7a9..1a848ffa9 100644 --- a/Logtalk/QUICK_START +++ b/Logtalk/QUICK_START @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/README b/Logtalk/README index fedcf9214..ede1d8f23 100644 --- a/Logtalk/README +++ b/Logtalk/README @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/RELEASE_NOTES b/Logtalk/RELEASE_NOTES index acaba38e7..7c2bf6ba4 100644 --- a/Logtalk/RELEASE_NOTES +++ b/Logtalk/RELEASE_NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= @@ -10,6 +10,31 @@ RELEASE NOTES ============= +2.10.0 - April 5, 2002 + + Scope of object asserted predicates for which there is no declaration is + now a function of the context instead of always being declared public. + Asserting in this, the predicate is declared private, asserting in self, + the predicate is declared protected, otherwise the predicate is declared + public. + + Throw an error if a category contains clauses for dynamic predicates. + + Updated documentation on categories and built-in methods for database + handling. + + Retracting all clauses for a dynamic predicate from an object now allows + an inherited definition to be called when sending the corresponding + message. In previous versions the message just failed. + + Added missing entries for the built-in predicates current_logtalk_flag/2 + and set_logtalk_flag/2 to the Logtalk compiler built-in predicates table. + + Updated config file for Amzi! Prolog 6.1.74. + + Updated notes on patching XSB to work with Logtalk. + + 2.9.3 - February 9, 2002 New current_logtalk_flag/2 and set_logtalk_flag/2 built-in predicates. diff --git a/Logtalk/UPGRADING b/Logtalk/UPGRADING index 9bd5dfd33..467836fbd 100644 --- a/Logtalk/UPGRADING +++ b/Logtalk/UPGRADING @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= @@ -38,3 +38,6 @@ to compile or load a single entity. Logtalk version 2.9.0 changes compiled code functors postfixes from "_sdcl" and "_sdef" to "_idcl" and "_idef", impliying recompilation of all objects, protocols, and categories. + +Logtalk version 2.10.0 changes some of the semantics of object dynamic +predicates. See the release notes for a description of the changes. diff --git a/Logtalk/examples/NOTES b/Logtalk/examples/NOTES index 6fadba2b1..17c506150 100644 --- a/Logtalk/examples/NOTES +++ b/Logtalk/examples/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/birds/NOTES b/Logtalk/examples/birds/NOTES index 3349a25c7..506c238ec 100644 --- a/Logtalk/examples/birds/NOTES +++ b/Logtalk/examples/birds/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/birds/SCRIPT b/Logtalk/examples/birds/SCRIPT index 4d9151791..087b0673c 100644 --- a/Logtalk/examples/birds/SCRIPT +++ b/Logtalk/examples/birds/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/bricks/NOTES b/Logtalk/examples/bricks/NOTES index 1225ec890..3695f2452 100644 --- a/Logtalk/examples/bricks/NOTES +++ b/Logtalk/examples/bricks/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/bricks/SCRIPT b/Logtalk/examples/bricks/SCRIPT index fffb08de7..a5511ef3e 100644 --- a/Logtalk/examples/bricks/SCRIPT +++ b/Logtalk/examples/bricks/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/classvars/NOTES b/Logtalk/examples/classvars/NOTES index 2d7e3f8ba..7ad791dda 100644 --- a/Logtalk/examples/classvars/NOTES +++ b/Logtalk/examples/classvars/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/classvars/SCRIPT b/Logtalk/examples/classvars/SCRIPT index c8625604d..d617dc156 100644 --- a/Logtalk/examples/classvars/SCRIPT +++ b/Logtalk/examples/classvars/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/errors/NOTES b/Logtalk/examples/errors/NOTES index 172b4a62e..96c285cc7 100644 --- a/Logtalk/examples/errors/NOTES +++ b/Logtalk/examples/errors/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/errors/catdynpred.lgt b/Logtalk/examples/errors/catdynpred.lgt new file mode 100644 index 000000000..89614ab34 --- /dev/null +++ b/Logtalk/examples/errors/catdynpred.lgt @@ -0,0 +1,14 @@ + +:- category(catdynpred). + + + :- public(dynpred/1). + :- dynamic(dynpred/1). + + + dynpred(1). + dynpred(2). + dynpred(3). + + +:- end_object. diff --git a/Logtalk/examples/errors/errors.loader b/Logtalk/examples/errors/errors.loader index 4a4a76e95..570627bd6 100644 --- a/Logtalk/examples/errors/errors.loader +++ b/Logtalk/examples/errors/errors.loader @@ -35,4 +35,10 @@ [unmatchdir], [unknown(warning), misspelt(warning), singletons(warning), plredef(warning), lgtredef(warning), report(on)]), _, + true), + catch( + logtalk_load( + [catdynpred], + [unknown(warning), misspelt(warning), singletons(warning), plredef(warning), lgtredef(warning), report(on)]), + _, true))). diff --git a/Logtalk/examples/errors/portability.lgt b/Logtalk/examples/errors/portability.lgt index 97ee5f7ea..af4ba52c3 100644 --- a/Logtalk/examples/errors/portability.lgt +++ b/Logtalk/examples/errors/portability.lgt @@ -1,15 +1 @@ - -:- object(portability). - - - :- public(predicate/0). - - - predicate :- - compare(Result, first, second), - retractall(result(Result, _)), - sort([], []), - consult(file). - - -:- end_object. + :- object(portability). :- public(predicate/0). predicate :- compare(Result, first, second), retractall(result(Result, _)), sort([], []), consult(file). :- end_object. \ No newline at end of file diff --git a/Logtalk/examples/inheritance/NOTES b/Logtalk/examples/inheritance/NOTES index 315044fd7..25948769e 100644 --- a/Logtalk/examples/inheritance/NOTES +++ b/Logtalk/examples/inheritance/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/inheritance/SCRIPT b/Logtalk/examples/inheritance/SCRIPT index 17a2584f2..652f9fcb8 100644 --- a/Logtalk/examples/inheritance/SCRIPT +++ b/Logtalk/examples/inheritance/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/instmethods/NOTES b/Logtalk/examples/instmethods/NOTES index 539bb7b95..dcd19b530 100644 --- a/Logtalk/examples/instmethods/NOTES +++ b/Logtalk/examples/instmethods/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/instmethods/SCRIPT b/Logtalk/examples/instmethods/SCRIPT index a4d97936c..d3f76eb2f 100644 --- a/Logtalk/examples/instmethods/SCRIPT +++ b/Logtalk/examples/instmethods/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/lo/NOTES b/Logtalk/examples/lo/NOTES index a89e10571..f9a045043 100644 --- a/Logtalk/examples/lo/NOTES +++ b/Logtalk/examples/lo/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/lo/planner/NOTES b/Logtalk/examples/lo/planner/NOTES index 0930c4b82..4acd7619a 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.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/lo/planner/SCRIPT b/Logtalk/examples/lo/planner/SCRIPT index c39840c7b..aa3a17adc 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.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/lo/travellers/NOTES b/Logtalk/examples/lo/travellers/NOTES index 217f2450e..d8e84e9a9 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.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/lo/travellers/SCRIPT b/Logtalk/examples/lo/travellers/SCRIPT index b364da9fb..a2571ff8a 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.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/lpa/NOTES b/Logtalk/examples/lpa/NOTES index ed59fe30b..86041786c 100644 --- a/Logtalk/examples/lpa/NOTES +++ b/Logtalk/examples/lpa/NOTES @@ -1,11 +1,15 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= -This example is an adaptation of a LPA Prolog++ example. +This example is an adaptation of a LPA Prolog++ example that is +described in the LPA Prolog++ Reference Manual. This manual can +be downloaded from the LPA web site . Please +consult this reference manual for further informations about this +example. To load all objects in this example consult the lpa.loader utility file. diff --git a/Logtalk/examples/lpa/SCRIPT b/Logtalk/examples/lpa/SCRIPT index c26dfb442..38b8f4f20 100644 --- a/Logtalk/examples/lpa/SCRIPT +++ b/Logtalk/examples/lpa/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/metapredicates/NOTES b/Logtalk/examples/metapredicates/NOTES index d2c713b29..db3f3470c 100644 --- a/Logtalk/examples/metapredicates/NOTES +++ b/Logtalk/examples/metapredicates/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/metapredicates/SCRIPT b/Logtalk/examples/metapredicates/SCRIPT index aff9bc9a6..2f05e387e 100644 --- a/Logtalk/examples/metapredicates/SCRIPT +++ b/Logtalk/examples/metapredicates/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/mi/NOTES b/Logtalk/examples/mi/NOTES index 598a8d65f..63efd85ea 100644 --- a/Logtalk/examples/mi/NOTES +++ b/Logtalk/examples/mi/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/mi/SCRIPT b/Logtalk/examples/mi/SCRIPT index 1f0cb8baf..ecb73226b 100644 --- a/Logtalk/examples/mi/SCRIPT +++ b/Logtalk/examples/mi/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/miscellaneous/NOTES b/Logtalk/examples/miscellaneous/NOTES index 10c6cd703..26b15bfe9 100644 --- a/Logtalk/examples/miscellaneous/NOTES +++ b/Logtalk/examples/miscellaneous/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/miscellaneous/SCRIPT b/Logtalk/examples/miscellaneous/SCRIPT index 60ffd7d87..9b4dde151 100644 --- a/Logtalk/examples/miscellaneous/SCRIPT +++ b/Logtalk/examples/miscellaneous/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/parametric/NOTES b/Logtalk/examples/parametric/NOTES index c2da98e90..35d659223 100644 --- a/Logtalk/examples/parametric/NOTES +++ b/Logtalk/examples/parametric/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/parametric/SCRIPT b/Logtalk/examples/parametric/SCRIPT index 6adf9ed8a..eef097954 100644 --- a/Logtalk/examples/parametric/SCRIPT +++ b/Logtalk/examples/parametric/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/points/NOTES b/Logtalk/examples/points/NOTES index 8860a67a5..cc0e52609 100644 --- a/Logtalk/examples/points/NOTES +++ b/Logtalk/examples/points/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/points/SCRIPT b/Logtalk/examples/points/SCRIPT index 77d0b92d1..5db341c4e 100644 --- a/Logtalk/examples/points/SCRIPT +++ b/Logtalk/examples/points/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= @@ -68,14 +68,5 @@ yes % clean up instances: -| ?- point::delete_all. -yes - -| ?- bounded_point::delete_all. -yes - -| ?- history_point::delete_all. -yes - -| ?- bounded_history_point::delete_all. +| ?- (point, bounded_point, history_point, bounded_history_point)::delete_all. yes diff --git a/Logtalk/examples/polygons/NOTES b/Logtalk/examples/polygons/NOTES index 44d2f795b..d89e9f027 100644 --- a/Logtalk/examples/polygons/NOTES +++ b/Logtalk/examples/polygons/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/polygons/SCRIPT b/Logtalk/examples/polygons/SCRIPT index b9067beb8..65136bf40 100644 --- a/Logtalk/examples/polygons/SCRIPT +++ b/Logtalk/examples/polygons/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/profiling/NOTES b/Logtalk/examples/profiling/NOTES index 4200fd95e..5d7cb30c8 100644 --- a/Logtalk/examples/profiling/NOTES +++ b/Logtalk/examples/profiling/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/profiling/SCRIPT b/Logtalk/examples/profiling/SCRIPT index 20be33b50..b273d4ff7 100644 --- a/Logtalk/examples/profiling/SCRIPT +++ b/Logtalk/examples/profiling/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= @@ -99,6 +99,6 @@ yes % try a message 1000 times and return the average time: | ?- timer::timer(list::length([1, 2, 3], _), 1000, Time). -Time = 0.00070799999999996994 +Time = 0.00008 yes diff --git a/Logtalk/examples/reflection/NOTES b/Logtalk/examples/reflection/NOTES index 5cc75d4f1..26a64d95e 100644 --- a/Logtalk/examples/reflection/NOTES +++ b/Logtalk/examples/reflection/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/reflection/SCRIPT b/Logtalk/examples/reflection/SCRIPT index a1a71843d..872cc38db 100644 --- a/Logtalk/examples/reflection/SCRIPT +++ b/Logtalk/examples/reflection/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/relations/NOTES b/Logtalk/examples/relations/NOTES index b487f05bd..37db6faf8 100644 --- a/Logtalk/examples/relations/NOTES +++ b/Logtalk/examples/relations/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/relations/SCRIPT b/Logtalk/examples/relations/SCRIPT index 500cdf083..9c877fe2e 100644 --- a/Logtalk/examples/relations/SCRIPT +++ b/Logtalk/examples/relations/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/roots/NOTES b/Logtalk/examples/roots/NOTES index f05d7ff32..17e4d9033 100644 --- a/Logtalk/examples/roots/NOTES +++ b/Logtalk/examples/roots/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/roots/SCRIPT b/Logtalk/examples/roots/SCRIPT index 7991c91a1..0811d200e 100644 --- a/Logtalk/examples/roots/SCRIPT +++ b/Logtalk/examples/roots/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/searching/NOTES b/Logtalk/examples/searching/NOTES index 3106a6f19..a928e3094 100644 --- a/Logtalk/examples/searching/NOTES +++ b/Logtalk/examples/searching/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/searching/SCRIPT b/Logtalk/examples/searching/SCRIPT index 8a3127238..4a42b64f5 100644 --- a/Logtalk/examples/searching/SCRIPT +++ b/Logtalk/examples/searching/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/sicstus/NOTES b/Logtalk/examples/sicstus/NOTES index 63f3acf82..4b0532cac 100644 --- a/Logtalk/examples/sicstus/NOTES +++ b/Logtalk/examples/sicstus/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/sicstus/SCRIPT b/Logtalk/examples/sicstus/SCRIPT index daca50e87..272695943 100644 --- a/Logtalk/examples/sicstus/SCRIPT +++ b/Logtalk/examples/sicstus/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/sicstus/sicstus.loader b/Logtalk/examples/sicstus/sicstus.loader index 37cbf80da..c161e30f7 100644 --- a/Logtalk/examples/sicstus/sicstus.loader +++ b/Logtalk/examples/sicstus/sicstus.loader @@ -1,12 +1,12 @@ :- initialization( logtalk_load([ + math_constants, ellipse3, circle2, circle11, red_circle1, colours, - math_constants, rational, rectangle2, sort1, diff --git a/Logtalk/examples/symdiff/NOTES b/Logtalk/examples/symdiff/NOTES index 8331579bb..4d14a64e9 100644 --- a/Logtalk/examples/symdiff/NOTES +++ b/Logtalk/examples/symdiff/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/symdiff/SCRIPT b/Logtalk/examples/symdiff/SCRIPT index c28b06fb1..903d0e36d 100644 --- a/Logtalk/examples/symdiff/SCRIPT +++ b/Logtalk/examples/symdiff/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/viewpoints/NOTES b/Logtalk/examples/viewpoints/NOTES index 61125beca..31abcbcaa 100644 --- a/Logtalk/examples/viewpoints/NOTES +++ b/Logtalk/examples/viewpoints/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/examples/viewpoints/SCRIPT b/Logtalk/examples/viewpoints/SCRIPT index 73722cc20..bedf75566 100644 --- a/Logtalk/examples/viewpoints/SCRIPT +++ b/Logtalk/examples/viewpoints/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/NOTES b/Logtalk/library/NOTES index 1767037e2..3820a65cf 100644 --- a/Logtalk/library/NOTES +++ b/Logtalk/library/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/SCRIPT b/Logtalk/library/SCRIPT index f811c0a53..a64aa1469 100644 --- a/Logtalk/library/SCRIPT +++ b/Logtalk/library/SCRIPT @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/all.notes b/Logtalk/library/all.notes index d2c0a0865..195301871 100644 --- a/Logtalk/library/all.notes +++ b/Logtalk/library/all.notes @@ -1,7 +1,7 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/dates.notes b/Logtalk/library/dates.notes index 804c0c8f3..81c8c3291 100644 --- a/Logtalk/library/dates.notes +++ b/Logtalk/library/dates.notes @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/debugging.notes b/Logtalk/library/debugging.notes index 0e5bcd008..f7c984b42 100644 --- a/Logtalk/library/debugging.notes +++ b/Logtalk/library/debugging.notes @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/events.notes b/Logtalk/library/events.notes index 696b4c901..748a2482d 100644 --- a/Logtalk/library/events.notes +++ b/Logtalk/library/events.notes @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/hierarchies.notes b/Logtalk/library/hierarchies.notes index 23a548831..d54e2a793 100644 --- a/Logtalk/library/hierarchies.notes +++ b/Logtalk/library/hierarchies.notes @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/metapredicates.notes b/Logtalk/library/metapredicates.notes index 547db28db..127d41c1f 100644 --- a/Logtalk/library/metapredicates.notes +++ b/Logtalk/library/metapredicates.notes @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/random.notes b/Logtalk/library/random.notes index d37176906..187ff079b 100644 --- a/Logtalk/library/random.notes +++ b/Logtalk/library/random.notes @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/library/types.notes b/Logtalk/library/types.notes index d02a99851..634f5e42a 100644 --- a/Logtalk/library/types.notes +++ b/Logtalk/library/types.notes @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/manuals/NOTES b/Logtalk/manuals/NOTES index 3efe3c085..72f2670a8 100644 --- a/Logtalk/manuals/NOTES +++ b/Logtalk/manuals/NOTES @@ -1,6 +1,6 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= diff --git a/Logtalk/manuals/index.html b/Logtalk/manuals/index.html index 59bbb2f27..397d1decd 100644 --- a/Logtalk/manuals/index.html +++ b/Logtalk/manuals/index.html @@ -4,14 +4,14 @@ - Logtalk 2.9.3 Documentation + Logtalk 2.10.0 Documentation
-

Logtalk 2.9.3

+

Logtalk 2.10.0

Documentation

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


-Last updated on: February 9, 2002 +Last updated on: April 2, 2002

Valid HTML 4.01! diff --git a/Logtalk/manuals/refman/index.html b/Logtalk/manuals/refman/index.html index 514e7edda..3bc7ce73c 100644 --- a/Logtalk/manuals/refman/index.html +++ b/Logtalk/manuals/refman/index.html @@ -4,7 +4,7 @@ - Logtalk 2.9.3 Reference Manual + Logtalk 2.10.0 Reference Manual @@ -188,7 +188,7 @@ User manual | Tutorial | Bibliography | Glossary

-Last updated on: February 9, 2002 +Last updated on: April 2, 2002


diff --git a/Logtalk/manuals/refman/methods/abolish1.html b/Logtalk/manuals/refman/methods/abolish1.html index b8d7287df..31b951cfa 100644 --- a/Logtalk/manuals/refman/methods/abolish1.html +++ b/Logtalk/manuals/refman/methods/abolish1.html @@ -22,7 +22,7 @@ abolish(Predicate) abolish(Functor/Arity)

- Removes a dynamic predicate from an object database. Note however that if the dynamic predicate is declared in a category the predicate will fail. +Removes a runtime declared dynamic predicate from an object database.

@@ -54,7 +54,7 @@ abolish(+predicate_indicator)
permission_error(modify, protected_predicate, Functor/Arity)
Predicate is a static predicate:
permission_error(modify, static_predicate, Functor/Arity)
-
Predicate is not declared:
+
Predicate is not declared or is declared but not in the object receiving the message:
existence_error(predicate_declaration, Functor/Arity)
@@ -77,7 +77,7 @@ abolish(+predicate_indicator) Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: October 21, 2001 +Last updated on: March 31, 2002


diff --git a/Logtalk/manuals/refman/methods/clause2.html b/Logtalk/manuals/refman/methods/clause2.html index bac5c85fa..a42ef4515 100644 --- a/Logtalk/manuals/refman/methods/clause2.html +++ b/Logtalk/manuals/refman/methods/clause2.html @@ -21,7 +21,7 @@ clause(Head, Body)

- Enumerates, by backtracking, the clauses of an object's dynamic predicates. Note however that if the clauses for the dynamic predicate are contained in a category the predicate will fail. +Enumerates, by backtracking, the clauses of an object's dynamic predicates.

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

-Last updated on: October 21, 2001 +Last updated on: April 2, 2002


diff --git a/Logtalk/manuals/refman/methods/retract1.html b/Logtalk/manuals/refman/methods/retract1.html index 25a7fd19b..dc6186259 100644 --- a/Logtalk/manuals/refman/methods/retract1.html +++ b/Logtalk/manuals/refman/methods/retract1.html @@ -22,7 +22,7 @@ retract(Clause) retract((Head:-Body))

- Retracts a dynamic clause from an object. Note however that if the clauses for the dynamic predicate are contained in a category the predicate will fail. + Retracts a dynamic clause from an object.

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

-Last updated on: October 21, 2001 +Last updated on: April 2, 2002


diff --git a/Logtalk/manuals/refman/methods/retractall1.html b/Logtalk/manuals/refman/methods/retractall1.html index 65eb3976b..c17fcd209 100644 --- a/Logtalk/manuals/refman/methods/retractall1.html +++ b/Logtalk/manuals/refman/methods/retractall1.html @@ -21,7 +21,7 @@ retractall(Head)

- Retracts all matching predicates from an object. Note however that if the clauses for the dynamic predicate are contained in a category the predicate will fail. + Retracts all matching predicates from an object.

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

-Last updated on: October 21, 2001 +Last updated on: April 2, 2002


diff --git a/Logtalk/manuals/tutorial/index.html b/Logtalk/manuals/tutorial/index.html index d42fb6d18..6b57d623b 100644 --- a/Logtalk/manuals/tutorial/index.html +++ b/Logtalk/manuals/tutorial/index.html @@ -4,7 +4,7 @@ - Logtalk 2.9.3 Tutorial + Logtalk 2.10.0 Tutorial @@ -48,7 +48,7 @@ User manual | Reference manual | Bibliography | Glossary

-Last updated on: February 9, 2002 +Last updated on: April 2, 2002


diff --git a/Logtalk/manuals/userman/categories.html b/Logtalk/manuals/userman/categories.html index 0a74fbd80..57d7222a4 100644 --- a/Logtalk/manuals/userman/categories.html +++ b/Logtalk/manuals/userman/categories.html @@ -24,7 +24,7 @@ Categories provide a way to encapsulate a set of related predicate definitions t We can define a new category in the same way we write Prolog code: by using a text editor. Each category (object or protocol) we define should be contained in its own text file. It is recommended that this text file be named after the category. By default, all Logtalk source files use the extension .lgt but this is optional and can be set in the configuration files. Compiled source files (by the Logtalk pre-processor) have, by default, a .pl extension. Again, this can be set to match the needs of a particular Prolog compiler in the corresponding configuration file. For instance, we may define a category named documenting and save it in a documenting.lgt source file that will be compiled to a documenting.pl Prolog file.

-Category names must be atoms. Objects, categories and protocols share the same name space: we can not have a category with the same name as an object or a protocol. +Category names must be atoms. Objects, categories, and protocols share the same name space: we can not have a category with the same name as an object or a protocol.

Category code (directives and predicates) is textually encapsulated by using two Logtalk directives: category/1-2 and end_category/0. The most simple category will be one that is self-contained, not depending on any other Logtalk entity: @@ -46,6 +46,9 @@ If a category implements one or more protocols then the opening directive will b

Note that a category can't import other categories or inherit code from an object.

+

+Categories cannot contain clauses for dynamic predicates (however, they can declare dynamic predicates). This restriction applies because a category can be imported by several objects and because we cannot use the database handling built-in methods with categories (messages can only be sent to objects). +


Finding defined categories

@@ -274,7 +277,7 @@ Omitting the scope keyword is equivalent to writing: Previous | Next | Table of Contents | Bibliography | Glossary

-Last updated on: July 4, 2000 +Last updated on: April 2, 2002


diff --git a/Logtalk/manuals/userman/index.html b/Logtalk/manuals/userman/index.html index 00c616da8..fba18804e 100644 --- a/Logtalk/manuals/userman/index.html +++ b/Logtalk/manuals/userman/index.html @@ -4,7 +4,7 @@ - Logtalk 2.9.3 User Manual + Logtalk 2.10.0 User Manual @@ -216,7 +216,7 @@ Reference manual | Tutorial | Bibliography | Glossary

-Last updated on: February 9, 2002 +Last updated on: April 2, 2002


diff --git a/Logtalk/xml/NOTES b/Logtalk/xml/NOTES index 1d7634b2e..a6201e8d0 100644 --- a/Logtalk/xml/NOTES +++ b/Logtalk/xml/NOTES @@ -1,10 +1,11 @@ ================================================================= Logtalk - Object oriented extension to Prolog -Release 2.9.3 +Release 2.10.0 Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. ================================================================= + This folder contains several files that enables .xml documentation files created when compiling objects, categories, or protocols, to be converted to PDF files, to be viewed in a web browser that supports the W3C standards @@ -22,6 +23,7 @@ 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. The default file is lgtxml.xsl (described below). + Brief description of each file in this folder: @@ -45,7 +47,7 @@ lgtpdfa4.xsl lgtpdfus.xsl XSLT files to generate PDF files from the .xml files (formatted either for A4 paper or US Letter paper) using XSL Formatting Objects. Tested - with Apache Fop processor (http://xml.apache.org/fop). + with Apache FOP processor (http://xml.apache.org/fop). texml.xsl diff --git a/Logtalk/xml/ie50.xsl b/Logtalk/xml/ie50.xsl index a9c569aa1..014bef8a9 100644 --- a/Logtalk/xml/ie50.xsl +++ b/Logtalk/xml/ie50.xsl @@ -8,7 +8,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Logtalk - Object oriented extension to Prolog -% Release 2.9.3 +% Release 2.10.0 % % Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. % diff --git a/Logtalk/xml/lgthtml.xsl b/Logtalk/xml/lgthtml.xsl index 834b021b2..86f7acd3f 100644 --- a/Logtalk/xml/lgthtml.xsl +++ b/Logtalk/xml/lgthtml.xsl @@ -14,7 +14,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Logtalk - Object oriented extension to Prolog -% Release 2.9.3 +% Release 2.10.0 % % Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. % diff --git a/Logtalk/xml/lgtpdfa4.xsl b/Logtalk/xml/lgtpdfa4.xsl index 03f4cf1bd..80635320f 100644 --- a/Logtalk/xml/lgtpdfa4.xsl +++ b/Logtalk/xml/lgtpdfa4.xsl @@ -9,7 +9,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Logtalk - Object oriented extension to Prolog -% Release 2.9.3 +% Release 2.10.0 % % Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. % diff --git a/Logtalk/xml/lgtpdfus.xsl b/Logtalk/xml/lgtpdfus.xsl index c396858d3..9ced8e763 100644 --- a/Logtalk/xml/lgtpdfus.xsl +++ b/Logtalk/xml/lgtpdfus.xsl @@ -9,7 +9,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Logtalk - Object oriented extension to Prolog -% Release 2.9.3 +% Release 2.10.0 % % Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. % diff --git a/Logtalk/xml/lgtxml.xsl b/Logtalk/xml/lgtxml.xsl index 0c1179704..34101f3f4 100644 --- a/Logtalk/xml/lgtxml.xsl +++ b/Logtalk/xml/lgtxml.xsl @@ -14,7 +14,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Logtalk - Object oriented extension to Prolog -% Release 2.9.3 +% Release 2.10.0 % % Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. % diff --git a/Logtalk/xml/logtalk.dtd b/Logtalk/xml/logtalk.dtd index ca48a795e..cce6d8e3e 100644 --- a/Logtalk/xml/logtalk.dtd +++ b/Logtalk/xml/logtalk.dtd @@ -3,7 +3,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Logtalk - Object oriented extension to Prolog -% Release 2.9.3 +% Release 2.10.0 % % Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. % diff --git a/Logtalk/xml/logtalk.xsd b/Logtalk/xml/logtalk.xsd index 21a44c077..38916fcfe 100644 --- a/Logtalk/xml/logtalk.xsd +++ b/Logtalk/xml/logtalk.xsd @@ -15,7 +15,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Logtalk - Object oriented extension to Prolog -% Release 2.9.3 +% Release 2.10.0 % % Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. % diff --git a/Logtalk/xml/texml.xsl b/Logtalk/xml/texml.xsl index 3c775d65f..b1a3a4b6a 100644 --- a/Logtalk/xml/texml.xsl +++ b/Logtalk/xml/texml.xsl @@ -12,7 +12,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Logtalk - Object oriented extension to Prolog -% Release 2.9.3 +% Release 2.10.0 % % Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. % diff --git a/library/logtalk/logtalk.pl b/library/logtalk/logtalk.pl index 8d770aa42..c735c17fa 100644 --- a/library/logtalk/logtalk.pl +++ b/library/logtalk/logtalk.pl @@ -2,7 +2,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Logtalk - Object oriented extension to Prolog -% Release 2.9.3 +% Release 2.10.0 % % Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved. % @@ -77,7 +77,9 @@ :- dynamic(lgt_dcl_/1). % lgt_dcl_(Clause) +:- dynamic(lgt_ddcl_/1). % lgt_ddcl_(Clause) :- dynamic(lgt_def_/1). % lgt_def_(Clause) +:- dynamic(lgt_ddef_/1). % lgt_ddef_(Clause) :- dynamic(lgt_super_/1). % lgt_super_(Clause) :- dynamic(lgt_dynamic_/1). % lgt_dynamic_(Functor/Arity) @@ -305,7 +307,7 @@ create_object(Obj, Rels, Dirs, Clauses) :- create_object(Obj, Rels, Dirs, Clauses) :- lgt_clean_up, lgt_tr_directive(object, [Obj| Rels]), - lgt_tr_directives(Dirs), + lgt_tr_directives([(dynamic)| Dirs]), lgt_tr_clauses(Clauses), lgt_fix_redef_built_ins, lgt_gen_object_clauses, @@ -352,7 +354,7 @@ create_category(Ctg, Rels, Dirs, Clauses) :- create_category(Ctg, Rels, Dirs, Clauses) :- lgt_clean_up, lgt_tr_directive(category, [Ctg| Rels]), - lgt_tr_directives(Dirs), + lgt_tr_directives([(dynamic)| Dirs]), lgt_tr_clauses(Clauses), lgt_fix_redef_built_ins, lgt_gen_category_clauses, @@ -395,7 +397,7 @@ create_protocol(Ptc, Rels, Dirs) :- create_protocol(Ptc, Rels, Dirs) :- lgt_clean_up, lgt_tr_directive(protocol, [Ptc| Rels]), - lgt_tr_directives(Dirs), + lgt_tr_directives([(dynamic)| Dirs]), lgt_gen_protocol_clauses, lgt_gen_protocol_directives, lgt_assert_tr_entity, @@ -1017,7 +1019,7 @@ logtalk_version(Major, Minor, Patch) :- \+ integer(Patch), throw(error(type_error(integer, Patch), logtalk_version(Major, Minor, Patch))). -logtalk_version(2, 9, 3). +logtalk_version(2, 10, 0). @@ -1228,10 +1230,6 @@ lgt_abolish(Obj, Functor/Arity, Sender, _) :- (var(Functor); var(Arity)), throw(error(instantiation_error, Obj::abolish(Functor/Arity), Sender)). -lgt_abolish(Obj, Functor/Arity, Sender, _) :- - (var(Functor); var(Arity)), - throw(error(instantiation_error, Obj::abolish(Functor/Arity), Sender)). - lgt_abolish(Obj, Functor/Arity, Sender, _) :- \+ atom(Functor), throw(error(type_error(atom, Functor), Obj::abolish(Functor/Arity), Sender)). @@ -1240,38 +1238,39 @@ lgt_abolish(Obj, Functor/Arity, Sender, _) :- \+ integer(Arity), throw(error(type_error(integer, Arity), Obj::abolish(Functor/Arity), Sender)). -lgt_abolish(Obj, Functor/Arity, Sender, _) :- - \+ lgt_current_object_(Obj, _, _, _, _), - throw(error(existence_error(object, Obj), Obj::abolish(Functor/Arity), Sender)). - lgt_abolish(Obj, Functor/Arity, Sender, Scope) :- - functor(Pred, Functor, Arity), - lgt_current_object_(Obj, Prefix, _, _, _), - lgt_once(Prefix, Dcl, _, _, _, _, DDcl, DDef), - (lgt_once(Dcl, Pred, PScope, Type, _, SContainer, _) -> - (Type = (dynamic) -> + lgt_current_object_(Obj, Prefix, Dcl, _, _) -> + ((functor(Pred, Functor, Arity), + lgt_once(Dcl, Pred, PScope, Compilation, _, SContainer, _)) -> ((\+ \+ PScope = Scope; Sender = SContainer) -> - (lgt_once(DDcl, Pred, _, _, _) -> - (lgt_once(DDef, Pred, _, _, _, Call) -> - functor(Call, CFunctor, CArity), - abolish(CFunctor/CArity), - Clause =.. [DDef, Pred, _, _, _, Call], - retractall(Clause) + (Compilation = (dynamic) -> + lgt_once(Prefix, _, _, _, _, _, DDcl, DDef), + (lgt_once(DDcl, Pred, _, _, _) -> + Clause =.. [DDcl, Pred, _, _, _], + retractall(Clause), + (lgt_once(DDef, Pred, _, _, _, Call) -> + functor(Call, CFunctor, CArity), + abolish(CFunctor/CArity), + Clause2 =.. [DDef, Pred, _, _, _, Call], + retractall(Clause2) + ; + true) ; - true), - Clause2 =.. [DDcl, Pred, _, _, _], - retractall(Clause2) + (lgt_once(Dcl, Pred, _, _, _) -> + throw(error(permission_error(modify, predicate_declaration, Pred), Obj::abolish(Functor/Arity), Sender)) + ; + throw(error(existence_error(predicate_declaration, Pred), Obj::abolish(Functor/Arity), Sender)))) ; - throw(error(permission_error(modify, predicate_declaration, Pred), Obj::abolish(Functor/Arity), Sender))) + throw(error(permission_error(modify, static_predicate, Pred), Obj::abolish(Functor/Arity), Sender))) ; (PScope = p -> throw(error(permission_error(modify, private_predicate, Pred), Obj::abolish(Functor/Arity), Sender)) ; throw(error(permission_error(modify, protected_predicate, Pred), Obj::abolish(Functor/Arity), Sender)))) ; - throw(error(permission_error(modify, static_predicate, Pred), Obj::abolish(Functor/Arity), Sender))) + throw(error(existence_error(predicate_declaration, Pred), Obj::abolish(Functor/Arity), Sender))) ; - throw(error(existence_error(predicate_declaration, Pred), Obj::abolish(Functor/Arity), Sender))). + throw(error(existence_error(object, Obj), Obj::abolish(Functor/Arity), Sender)). @@ -1304,22 +1303,26 @@ lgt_asserta(Obj, (Head:-Body), Sender, Scope) :- (lgt_once(Dcl, Head, PScope, Type, Meta, SContainer, _) -> true ; - lgt_assert_dynamic_dcl_clause(Head, DDcl)), + lgt_convert_test_scope(Scope, Scope2), + lgt_assert_ddcl_clause(DDcl, Head, Scope2)), (Type = (dynamic) -> ((\+ \+ PScope = Scope; Sender = SContainer) -> ((lgt_once(Def, Head, Sender2, This, Self, Call); lgt_once(DDef, Head, Sender2, This, Self, Call)) -> true ; functor(Head, Functor, Arity), - lgt_assert_dynamic_def_clause(Functor, Arity, Prefix, DDef, _), + lgt_assert_ddef_clause(Functor, Arity, Prefix, DDef, _), lgt_once(DDef, Head, Sender2, This, Self, Call)), lgt_self(Context, Self), lgt_this(Context, This), lgt_sender(Context, Sender2), lgt_prefix(Context, Prefix), - Head =.. [_| Args], - Meta =.. [_| MArgs], - lgt_extract_metavars(Args, MArgs, Metavars), + (nonvar(Meta) -> + Head =.. [_| Args], + Meta =.. [_| MArgs], + lgt_extract_metavars(Args, MArgs, Metavars) + ; + Metavars = []), lgt_metavars(Context, Metavars), asserta((Call:-lgt_tr_body(Body, TBody, Context), call(TBody))) ; @@ -1336,14 +1339,15 @@ lgt_asserta(Obj, Head, Sender, Scope) :- (lgt_once(Dcl, Head, PScope, Type, _, SContainer, _) -> true ; - lgt_assert_dynamic_dcl_clause(Head, DDcl)), + lgt_convert_test_scope(Scope, Scope2), + lgt_assert_ddcl_clause(DDcl, Head, Scope2)), (Type = (dynamic) -> ((\+ \+ PScope = Scope; Sender = SContainer) -> ((lgt_once(Def, Head, _, _, _, Call); lgt_once(DDef, Head, _, _, _, Call)) -> true ; functor(Head, Functor, Arity), - lgt_assert_dynamic_def_clause(Functor, Arity, Prefix, DDef, _), + lgt_assert_ddef_clause(Functor, Arity, Prefix, DDef, _), lgt_once(DDef, Head, _, _, _, Call)), asserta(Call) ; @@ -1385,22 +1389,26 @@ lgt_assertz(Obj, (Head:-Body), Sender, Scope) :- (lgt_once(Dcl, Head, PScope, Type, Meta, SContainer, _) -> true ; - lgt_assert_dynamic_dcl_clause(Head, DDcl)), + lgt_convert_test_scope(Scope, Scope2), + lgt_assert_ddcl_clause(DDcl, Head, Scope2)), (Type = (dynamic) -> ((\+ \+ PScope = Scope; Sender = SContainer) -> ((lgt_once(Def, Head, Sender2, This, Self, Call); lgt_once(DDef, Head, Sender2, This, Self, Call)) -> true ; functor(Head, Functor, Arity), - lgt_assert_dynamic_def_clause(Functor, Arity, Prefix, DDef, _), + lgt_assert_ddef_clause(Functor, Arity, Prefix, DDef, _), lgt_once(DDef, Head, Sender2, This, Self, Call)), lgt_self(Context, Self), lgt_this(Context, This), lgt_sender(Context, Sender2), lgt_prefix(Context, Prefix), - Head =.. [_| Args], - Meta =.. [_| MArgs], - lgt_extract_metavars(Args, MArgs, Metavars), + (nonvar(Meta) -> + Head =.. [_| Args], + Meta =.. [_| MArgs], + lgt_extract_metavars(Args, MArgs, Metavars) + ; + Metavars = []), lgt_metavars(Context, Metavars), assertz((Call:-lgt_tr_body(Body, TBody, Context), call(TBody))) ; @@ -1417,14 +1425,15 @@ lgt_assertz(Obj, Head, Sender, Scope) :- (lgt_once(Dcl, Head, PScope, Type, _, SContainer, _) -> true ; - lgt_assert_dynamic_dcl_clause(Head, DDcl)), + lgt_convert_test_scope(Scope, Scope2), + lgt_assert_ddcl_clause(DDcl, Head, Scope2)), (Type = (dynamic) -> ((\+ \+ PScope = Scope; Sender = SContainer) -> ((lgt_once(Def, Head, _, _, _, Call); lgt_once(DDef, Head, _, _, _, Call)) -> true ; functor(Head, Functor, Arity), - lgt_assert_dynamic_def_clause(Functor, Arity, Prefix, DDef, _), + lgt_assert_ddef_clause(Functor, Arity, Prefix, DDef, _), lgt_once(DDef, Head, _, _, _, Call)), assertz(Call) ; @@ -1505,11 +1514,14 @@ lgt_retract(Obj, (Head:-Body), Sender, Scope) :- (lgt_once(Dcl, Head, PScope, Type, _, SContainer, _) -> (Type = (dynamic) -> ((\+ \+ PScope = Scope; Sender = SContainer) -> - ((lgt_once(Def, Head, _, _, _, Call); lgt_once(DDef, Head, _, _, _, Call)) -> - TBody = (lgt_tr_body(Body, _, _), _), - retract((Call:-TBody)) + (lgt_once(Def, Head, _, _, _, Call) -> + retract((Call:-(lgt_tr_body(Body, _, _), _))) ; - fail) + (lgt_once(DDef, Head, _, _, _, Call) -> + retract((Call:-(lgt_tr_body(Body, _, _), _))), + lgt_update_ddef_table(DDef, Call) + ; + fail)) ; (PScope = p -> throw(error(permission_error(modify, private_predicate, Head), Obj::retract((Head:-Body)), Sender)) @@ -1526,10 +1538,14 @@ lgt_retract(Obj, Head, Sender, Scope) :- (lgt_once(Dcl, Head, PScope, Type, _, SContainer, _) -> (Type = (dynamic) -> ((\+ \+ PScope = Scope; Sender = SContainer) -> - ((lgt_once(Def, Head, _, _, _, Call); lgt_once(DDef, Head, _, _, _, Call)) -> + (lgt_once(Def, Head, _, _, _, Call) -> retract(Call) ; - fail) + (lgt_once(DDef, Head, _, _, _, Call) -> + retract(Call), + lgt_update_ddef_table(DDef, Call) + ; + fail)) ; (PScope = p -> throw(error(permission_error(modify, private_predicate, Head), Obj::retract(Head), Sender)) @@ -1562,10 +1578,14 @@ lgt_retractall(Obj, Head, Sender, Scope) :- (lgt_once(Dcl, Head, PScope, Type, _, SContainer, _) -> (Type = (dynamic) -> ((\+ \+ PScope = Scope; Sender = SContainer) -> - ((lgt_once(Def, Head, _, _, _, Call); lgt_once(DDef, Head, _, _, _, Call)) -> + (lgt_once(Def, Head, _, _, _, Call) -> retractall(Call) ; - true) + (lgt_once(DDef, Head, _, _, _, Call) -> + retractall(Call), + lgt_update_ddef_table(DDef, Call) + ; + true)) ; (PScope = p -> throw(error(permission_error(modify, private_predicate, Head), Obj::retractall(Head), Sender)) @@ -2078,7 +2098,9 @@ lgt_clean_up :- retractall(lgt_fentity_init_(_)), retractall(lgt_entity_comp_mode_(_)), retractall(lgt_dcl_(_)), + retractall(lgt_ddcl_(_)), retractall(lgt_def_(_)), + retractall(lgt_ddef_(_)), retractall(lgt_super_(_)), retractall(lgt_rclause_(_)), retractall(lgt_eclause_(_)), @@ -2094,6 +2116,8 @@ lgt_clean_up :- % dump all dynamic predicates used during entity compilation % in the current ouput stream (just a debugging utility) +% +% only works on Prolog compilers implementing listing/1 lgt_dump_all :- listing(lgt_object_/9), @@ -2123,7 +2147,9 @@ lgt_dump_all :- listing(lgt_fentity_init_/1), listing(lgt_entity_comp_mode_/1), listing(lgt_dcl_/1), + listing(lgt_ddcl_/1), listing(lgt_def_/1), + listing(lgt_ddef_/1), listing(lgt_super_/1), listing(lgt_rclause_/1), listing(lgt_eclause_/1), @@ -2556,11 +2582,21 @@ lgt_tr_clause(Fact, TFact, Context) :- % translates an entity clause head +% definition of dynamic predicates inside categories + +lgt_tr_head(Head, _, _) :- + lgt_entity_(category, _, _, _), + functor(Head, Functor, Arity), + lgt_dynamic_(Functor/Arity), + throw(permission_error(define, dynamic_predicate, Functor/Arity)). + + % redefinition of built-in methods lgt_tr_head(Head, _, _) :- lgt_built_in_method(Head, _), - throw(permission_error(modify, built_in_method, Head)). + functor(Head, Functor, Arity), + throw(permission_error(modify, built_in_method, Functor/Arity)). % redefinition of Logtalk built-in predicates @@ -2594,7 +2630,13 @@ lgt_tr_head(Head, THead, Context) :- Head =.. [_| Args], lgt_prefix(Context, EPrefix), lgt_construct_predicate_functor(EPrefix, Functor, Arity, PPrefix), - lgt_add_def_clause(Functor, Arity, PPrefix, Context), + ((lgt_dynamic_(Functor/Arity), + \+ lgt_public_(Functor/Arity), + \+ lgt_protected_(Functor/Arity), + \+ lgt_private_(Functor/Arity)) -> + lgt_add_ddef_clause(Functor, Arity, PPrefix, Context) + ; + lgt_add_def_clause(Functor, Arity, PPrefix, Context)), lgt_sender(Context, Sender), lgt_this(Context, This), lgt_self(Context, Self), @@ -2930,38 +2972,38 @@ lgt_tr_msg(Obj, setof(Term, Pred, List), setof(Term, TPred, List), Context) :- % "reflection" built-in predicates -lgt_tr_msg(Obj, current_predicate(Pred), lgt_current_predicate(Obj, Pred, This, p(p(_))), Context) :- +lgt_tr_msg(Obj, current_predicate(Pred), lgt_current_predicate(Obj, Pred, This, p(p(p))), Context) :- !, lgt_this(Context, This). -lgt_tr_msg(Obj, predicate_property(Pred, Property), lgt_predicate_property(Obj, Pred, Property, This, p(p(_))), Context) :- +lgt_tr_msg(Obj, predicate_property(Pred, Property), lgt_predicate_property(Obj, Pred, Property, This, p(p(p))), Context) :- !, lgt_this(Context, This). % database handling built-in predicates -lgt_tr_msg(Obj, abolish(Pred), lgt_abolish(Obj, Pred, This, p(p(_))), Context) :- +lgt_tr_msg(Obj, abolish(Pred), lgt_abolish(Obj, Pred, This, p(p(p))), Context) :- !, lgt_this(Context, This). -lgt_tr_msg(Obj, asserta(Pred), lgt_asserta(Obj, Pred, This, p(p(_))), Context) :- +lgt_tr_msg(Obj, asserta(Pred), lgt_asserta(Obj, Pred, This, p(p(p))), Context) :- !, lgt_this(Context, This). -lgt_tr_msg(Obj, assertz(Pred), lgt_assertz(Obj, Pred, This, p(p(_))), Context) :- +lgt_tr_msg(Obj, assertz(Pred), lgt_assertz(Obj, Pred, This, p(p(p))), Context) :- !, lgt_this(Context, This). -lgt_tr_msg(Obj, clause(Head, Body), lgt_clause(Obj, Head, Body, This, p(p(_))), Context) :- +lgt_tr_msg(Obj, clause(Head, Body), lgt_clause(Obj, Head, Body, This, p(p(p))), Context) :- !, lgt_this(Context, This). -lgt_tr_msg(Obj, retract(Pred), lgt_retract(Obj, Pred, This, p(p(_))), Context) :- +lgt_tr_msg(Obj, retract(Pred), lgt_retract(Obj, Pred, This, p(p(p))), Context) :- !, lgt_this(Context, This). -lgt_tr_msg(Obj, retractall(Pred), lgt_retractall(Obj, Pred, This, p(p(_))), Context) :- +lgt_tr_msg(Obj, retractall(Pred), lgt_retractall(Obj, Pred, This, p(p(p))), Context) :- !, lgt_this(Context, This). @@ -3556,11 +3598,40 @@ lgt_add_def_clause(Functor, Arity, Prefix, Context) :- -% lgt_assert_dynamic_def_clause(+atom, +integer, +atom, +atom, -callable) +% lgt_add_ddef_clause(+atom, +integer, +atom, +term) % -% asserts a dynamic "def clause" (used to translate a predicate call) +% adds a "ddef clause" (used to translate a predicate call) -lgt_assert_dynamic_def_clause(Functor, Arity, OPrefix, DDef, Call) :- +lgt_add_ddef_clause(Functor, Arity, Prefix, Context) :- + functor(Head, Functor, Arity), + Head =.. [_| Args], + lgt_sender(Context, Sender), + lgt_this(Context, This), + lgt_self(Context, Self), + lgt_append(Args, [Sender, This, Self], TArgs), + THead =.. [Prefix|TArgs], + lgt_object_(_, _, _, _, _, _, _, _, DDef), + Clause =.. [DDef, Head, Sender, This, Self, THead], + (lgt_ddef_(Clause) -> + true + ; + assertz(lgt_ddef_(Clause))), + (lgt_built_in(Head) -> + assertz(lgt_redefined_built_in_(Head, Context, THead)) + ; + true), + (lgt_defs_pred_(Functor/Arity) -> + true + ; + assertz(lgt_defs_pred_(Functor/Arity))). + + + +% lgt_assert_ddef_clause(+atom, +integer, +atom, +atom, -callable) +% +% asserts a dynamic "ddef clause" (used to translate a predicate call) + +lgt_assert_ddef_clause(Functor, Arity, OPrefix, DDef, Call) :- lgt_construct_predicate_functor(OPrefix, Functor, Arity, PPrefix), functor(Pred, Functor, Arity), Pred =.. [_| Args], @@ -3571,14 +3642,45 @@ lgt_assert_dynamic_def_clause(Functor, Arity, OPrefix, DDef, Call) :- -% lgt_assert_dynamic_dcl_clause(+term, +atom) +% lgt_update_ddef_table(+atom, +callable) +% +% retracts a dynamic "ddef clause" (used to translate a predicate call) +% if there are no more clauses for the predicate otherwise does nothing + +lgt_update_ddef_table(DDef, Call) :- + functor(Call, Functor, Arity), + functor(Call2, Functor, Arity), + (clause(Call2, _) -> + true + ; + Clause =.. [DDef, _, _, _, _, Call2], + retractall(Clause)). + + + +% lgt_convert_test_scope(@term, +term), +% +% convert asserta/z test scope to predicate declaration scope + +lgt_convert_test_scope(Scope, Scope2) :- + var(Scope) -> + Scope2 = p + ; + ((Scope = p(V), var(V)) -> + Scope2 = p(p) + ; + Scope2 = p(p(p))). + + + +% lgt_assert_ddcl_clause(+atom, +term, +term) % % asserts a dynamic predicate declaration -lgt_assert_dynamic_dcl_clause(Pred, DDcl) :- +lgt_assert_ddcl_clause(DDcl, Pred, Scope) :- functor(Pred, Functor, Arity), functor(DPred, Functor, Arity), - Clause =.. [DDcl, DPred, p(p(p)), (dynamic), no], + Clause =.. [DDcl, DPred, Scope, (dynamic), no], assertz(Clause). @@ -3730,6 +3832,8 @@ lgt_gen_object_clauses :- +% lgt_gen_local_dcl_clauses +% % a (local) predicate declaration is only generated % if there is a scope declaration for the predicate @@ -3738,12 +3842,16 @@ 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), functor(Meta, Functor, Arity), - (lgt_metapredicate_(Meta) -> Meta2 = Meta; Meta2 = no), + (lgt_metapredicate_(Meta) -> + Meta2 = Meta + ; + Meta2 = no), functor(Pred, Functor, Arity), + (lgt_dynamic_(Functor/Arity)-> + Compilation = (dynamic) + ; + Compilation = static), Fact =.. [Dcl, Pred, Scope, Compilation, Meta2], assertz(lgt_dcl_(Fact)), fail. @@ -3752,16 +3860,46 @@ lgt_gen_local_dcl_clauses. -lgt_gen_dynamic_def_clauses :- +lgt_gen_catchall_dcl_clause :- + \+ lgt_dcl_(_) -> + lgt_entity_(_, _, _, Dcl), + Head =.. [Dcl, _, _, _, _], + assertz(lgt_dcl_((Head:-fail))) + ; + true. + + + +% lgt_gen_local_def_clauses +% +% generates local def clauses for undefined but declared (via scope or +% dynamic directives) predicates + +lgt_gen_local_def_clauses :- lgt_entity_(_, _, EPrefix, _), lgt_dynamic_(Functor/Arity), \+ lgt_defs_pred_(Functor/Arity), lgt_construct_predicate_functor(EPrefix, Functor, Arity, PPrefix), lgt_context(Context), - lgt_add_def_clause(Functor, Arity, PPrefix, Context), + ((\+ lgt_public_(Functor/Arity), + \+ lgt_protected_(Functor/Arity), + \+ lgt_private_(Functor/Arity)) -> + lgt_add_ddef_clause(Functor, Arity, PPrefix, Context) + ; + lgt_add_def_clause(Functor, Arity, PPrefix, Context)), fail. -lgt_gen_dynamic_def_clauses. +lgt_gen_local_def_clauses. + + + +lgt_gen_obj_catchall_def_clause :- + \+ lgt_def_(_) -> + lgt_object_(_, _, _, Def, _, _, _, _, _), + Head =.. [Def, _, _, _, _, _], + assertz(lgt_def_((Head:-fail))) + ; + true. @@ -3774,12 +3912,7 @@ lgt_gen_protocol_clauses :- lgt_gen_protocol_local_clauses :- lgt_gen_local_dcl_clauses, - (\+ lgt_dcl_(_) -> - lgt_protocol_(_, _, PDcl), - Head =.. [PDcl, _, _, _, _], - assertz(lgt_dcl_((Head:-fail))) - ; - true). + lgt_gen_catchall_dcl_clause. @@ -3818,23 +3951,13 @@ lgt_gen_category_clauses :- lgt_gen_category_dcl_clauses :- - lgt_gen_category_local_dcl_clauses, + lgt_gen_local_dcl_clauses, + lgt_gen_catchall_dcl_clause, lgt_gen_category_linking_dcl_clauses, lgt_gen_category_implements_dcl_clauses. -lgt_gen_category_local_dcl_clauses :- - lgt_gen_local_dcl_clauses, - (\+ lgt_dcl_(_) -> - lgt_category_(_, _, CDcl, _), - Head =.. [CDcl, _, _, _, _], - assertz(lgt_dcl_((Head:-fail))) - ; - true). - - - lgt_gen_category_linking_dcl_clauses :- lgt_category_(Ctg, _, CDcl, _), Head =.. [CDcl, Pred, Scope, Compilation, Meta, Ctg], @@ -3864,14 +3987,14 @@ lgt_gen_category_implements_dcl_clauses. lgt_gen_category_def_clauses :- - lgt_gen_category_local_def_clauses. + lgt_gen_category_catchall_def_clause. - -lgt_gen_category_local_def_clauses :- + +lgt_gen_category_catchall_def_clause :- \+ lgt_def_(_) -> - lgt_category_(_, _, _, CDef), - Head =.. [CDef, _, _, _, _, _], + lgt_category_(_, _, _, Def), + Head =.. [Def, _, _, _, _, _], assertz(lgt_def_((Head:-fail))) ; true. @@ -3886,7 +4009,8 @@ lgt_gen_prototype_clauses :- lgt_gen_prototype_dcl_clauses :- - lgt_gen_prototype_local_dcl_clauses, + lgt_gen_local_dcl_clauses, + lgt_gen_catchall_dcl_clause, lgt_gen_prototype_linking_dcl_clauses, lgt_gen_prototype_implements_dcl_clauses, lgt_gen_prototype_imports_dcl_clauses, @@ -3894,17 +4018,6 @@ lgt_gen_prototype_dcl_clauses :- -lgt_gen_prototype_local_dcl_clauses :- - lgt_gen_local_dcl_clauses, - (\+ lgt_dcl_(_) -> - lgt_object_(_, _, ODcl, _, _, _, _, _, _), - Head =.. [ODcl, _, _, _, _], - assertz(lgt_dcl_((Head:-fail))) - ; - true). - - - lgt_gen_prototype_linking_dcl_clauses :- lgt_object_(Obj, _, Dcl, _, _, _, _, DDcl, _), Head =.. [Dcl, Pred, Scope, Compilation, Meta, Obj, Obj], @@ -3977,24 +4090,14 @@ lgt_gen_prototype_extends_dcl_clauses. lgt_gen_prototype_def_clauses :- - lgt_gen_dynamic_def_clauses, - lgt_gen_prototype_local_def_clauses, + lgt_gen_local_def_clauses, + lgt_gen_obj_catchall_def_clause, lgt_gen_prototype_linking_def_clauses, lgt_gen_prototype_imports_def_clauses, lgt_gen_prototype_extends_def_clauses. -lgt_gen_prototype_local_def_clauses :- - \+ lgt_def_(_) -> - lgt_object_(_, _, _, Def, _, _, _, _, _), - Head =.. [Def, _, _, _, _, _], - assertz(lgt_def_((Head:-fail))) - ; - true. - - - lgt_gen_prototype_linking_def_clauses :- lgt_object_(Obj, _, _, Def, _, _, _, _, DDef), Head =.. [Def, Pred, Sender, This, Self, Call, Obj], @@ -4065,19 +4168,9 @@ lgt_gen_ic_clauses :- lgt_gen_ic_dcl_clauses :- - lgt_gen_ic_local_dcl_clauses, - lgt_gen_ic_hierarchy_dcl_clauses. - - - -lgt_gen_ic_local_dcl_clauses :- lgt_gen_local_dcl_clauses, - (\+ lgt_dcl_(_) -> - lgt_object_(_, _, ODcl, _, _, _, _, _, _), - Head =.. [ODcl, _, _, _, _], - assertz(lgt_dcl_((Head:-fail))) - ; - true). + lgt_gen_catchall_dcl_clause, + lgt_gen_ic_hierarchy_dcl_clauses. @@ -4192,24 +4285,14 @@ lgt_gen_ic_hierarchy_idcl_clauses. lgt_gen_ic_def_clauses :- - lgt_gen_dynamic_def_clauses, - lgt_gen_ic_local_def_clauses, + lgt_gen_local_def_clauses, + lgt_gen_obj_catchall_def_clause, lgt_gen_ic_linking_def_clauses, lgt_gen_ic_imports_def_clauses, lgt_gen_ic_hierarchy_def_clauses. -lgt_gen_ic_local_def_clauses :- - \+ lgt_def_(_) -> - lgt_object_(_, _, _, Def, _, _, _, _, _), - Head =.. [Def, _, _, _, _, _], - assertz(lgt_def_((Head:-fail))) - ; - true. - - - lgt_gen_ic_linking_def_clauses :- lgt_object_(Obj, _, _, Def, _, _, _, _, DDef), Head =.. [Def, Pred, Sender, This, Self, Call, Obj], @@ -4487,6 +4570,7 @@ lgt_write_clauses(Stream) :- lgt_write_functors_clause(Stream), lgt_write_dcl_clauses(Stream), lgt_write_def_clauses(Stream), + lgt_write_ddef_clauses(Stream), lgt_write_super_clauses(Stream), lgt_write_entity_clauses(Stream). @@ -4510,6 +4594,16 @@ lgt_write_def_clauses(_). +lgt_write_ddef_clauses(Stream) :- + lgt_ddef_(Clause), + write_term(Stream, Clause, [quoted(true)]), + write_term(Stream, '.', []), nl(Stream), + fail. + +lgt_write_ddef_clauses(_). + + + lgt_write_dcl_clauses(Stream) :- lgt_dcl_(Clause), write_term(Stream, Clause, [quoted(true)]), @@ -4587,6 +4681,7 @@ lgt_assert_tr_entity :- lgt_assert_functors_clause, lgt_assert_dcl_clauses, lgt_assert_def_clauses, + lgt_assert_ddef_clauses, lgt_assert_super_clauses, lgt_assert_entity_clauses, lgt_assert_relation_clauses, @@ -4634,6 +4729,15 @@ lgt_assert_def_clauses. +lgt_assert_ddef_clauses :- + lgt_ddef_(Clause), + assertz(Clause), + fail. + +lgt_assert_ddef_clauses. + + + lgt_assert_super_clauses :- lgt_super_(Clause), assertz(Clause), @@ -4685,7 +4789,7 @@ lgt_assert_relation_clauses([Clause| Clauses]) :- arg(1, Clause, Entity), lgt_retract_old_relation_clauses(Entity), lgt_assert_new_relation_clauses([Clause| Clauses]). - + lgt_retract_old_relation_clauses(Entity) :- retractall(lgt_current_object_(Entity, _, _, _, _)), @@ -5203,6 +5307,9 @@ lgt_lgt_built_in(abolish_events(_, _, _, _, _)). lgt_lgt_built_in(define_events(_, _, _, _, _)). lgt_lgt_built_in(current_event(_, _, _, _, _)). +lgt_lgt_built_in(current_logtalk_flag(_, _)). +lgt_lgt_built_in(set_logtalk_flag(_, _)). + diff --git a/library/logtalk/yap430.config b/library/logtalk/yap430.config index a4f70adda..509a946f2 100644 --- a/library/logtalk/yap430.config +++ b/library/logtalk/yap430.config @@ -1,7 +1,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Logtalk - Object oriented extension to Prolog -% Release 2.9.3 +% Release 2.10.0 % % configuration file for YAP Prolog 4.3.x %