From fd048651b6a35c1df4be4527541d1ea4fbf3ebc4 Mon Sep 17 00:00:00 2001 From: vsc Date: Wed, 6 Jun 2001 20:07:01 +0000 Subject: [PATCH] Logtalk files git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@55 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- Logtalk/examples/lo/planner/NOTES | 10 + Logtalk/examples/lo/planner/SCRIPT | 15 + Logtalk/examples/lo/planner/aberdeen_air.lgt | 9 + Logtalk/examples/lo/planner/aiai.lgt | 6 + Logtalk/examples/lo/planner/airport.lgt | 16 ++ Logtalk/examples/lo/planner/albert_hall.lgt | 6 + Logtalk/examples/lo/planner/castle.lgt | 6 + Logtalk/examples/lo/planner/city.lgt | 30 ++ Logtalk/examples/lo/planner/edin.lgt | 6 + Logtalk/examples/lo/planner/edinburgh.lgt | 9 + Logtalk/examples/lo/planner/fly.lgt | 13 + Logtalk/examples/lo/planner/glasgow.lgt | 9 + Logtalk/examples/lo/planner/imperial.lgt | 6 + Logtalk/examples/lo/planner/lhr.lgt | 10 + Logtalk/examples/lo/planner/london.lgt | 9 + Logtalk/examples/lo/planner/manchester.lgt | 9 + Logtalk/examples/lo/planner/plan1.lgt | 46 +++ Logtalk/examples/lo/planner/planner.loader | 21 ++ Logtalk/examples/lo/planner/renfrew.lgt | 10 + Logtalk/examples/lo/planner/ringway.lgt | 10 + Logtalk/examples/lo/planner/victoria.lgt | 6 + Logtalk/examples/lo/travellers/NOTES | 9 + Logtalk/examples/lo/travellers/SCRIPT | 38 +++ Logtalk/examples/lo/travellers/aberdeen.lgt | 11 + .../examples/lo/travellers/aberystwyth.lgt | 12 + Logtalk/examples/lo/travellers/birmingham.lgt | 16 ++ Logtalk/examples/lo/travellers/brighton.lgt | 12 + Logtalk/examples/lo/travellers/bristol.lgt | 13 + Logtalk/examples/lo/travellers/cambridge.lgt | 13 + Logtalk/examples/lo/travellers/cardiff.lgt | 11 + Logtalk/examples/lo/travellers/carlisle.lgt | 12 + Logtalk/examples/lo/travellers/circular.lgt | 72 +++++ Logtalk/examples/lo/travellers/descend.lgt | 20 ++ Logtalk/examples/lo/travellers/dover.lgt | 11 + Logtalk/examples/lo/travellers/driving.lgt | 52 ++++ Logtalk/examples/lo/travellers/edinburgh.lgt | 12 + Logtalk/examples/lo/travellers/exeter.lgt | 12 + .../examples/lo/travellers/geographic2.lgt | 68 +++++ Logtalk/examples/lo/travellers/glasgow.lgt | 12 + Logtalk/examples/lo/travellers/hull.lgt | 12 + .../examples/lo/travellers/incremental.lgt | 91 ++++++ Logtalk/examples/lo/travellers/leeds.lgt | 14 + Logtalk/examples/lo/travellers/liverpool.lgt | 13 + Logtalk/examples/lo/travellers/location2.lgt | 83 ++++++ Logtalk/examples/lo/travellers/london.lgt | 14 + Logtalk/examples/lo/travellers/manchester.lgt | 12 + Logtalk/examples/lo/travellers/metric1.lgt | 24 ++ Logtalk/examples/lo/travellers/natural.lgt | 20 ++ Logtalk/examples/lo/travellers/newcastle.lgt | 12 + Logtalk/examples/lo/travellers/nottingham.lgt | 12 + Logtalk/examples/lo/travellers/oxford.lgt | 13 + Logtalk/examples/lo/travellers/penzance.lgt | 10 + Logtalk/examples/lo/travellers/permute.lgt | 65 +++++ Logtalk/examples/lo/travellers/portsmouth.lgt | 12 + Logtalk/examples/lo/travellers/presort.lgt | 43 +++ Logtalk/examples/lo/travellers/quick1.lgt | 45 +++ Logtalk/examples/lo/travellers/salesman.lgt | 20 ++ Logtalk/examples/lo/travellers/sheffield.lgt | 15 + Logtalk/examples/lo/travellers/swansea.lgt | 11 + .../examples/lo/travellers/travellers.loader | 44 +++ Logtalk/examples/lo/travellers/york.lgt | 12 + .../refman/builtins/abolish_category1.html | 70 +++++ .../refman/builtins/abolish_events5.html | 72 +++++ .../refman/builtins/abolish_object1.html | 71 +++++ .../refman/builtins/abolish_protocol1.html | 70 +++++ .../refman/builtins/category_property2.html | 66 +++++ .../refman/builtins/create_category4.html | 76 +++++ .../refman/builtins/create_object4.html | 76 +++++ .../refman/builtins/create_protocol3.html | 74 +++++ .../refman/builtins/current_category1.html | 64 +++++ .../refman/builtins/current_event5.html | 72 +++++ .../refman/builtins/current_object1.html | 64 +++++ .../refman/builtins/current_protocol1.html | 64 +++++ .../refman/builtins/define_events5.html | 74 +++++ .../refman/builtins/extends_object2_3.html | 74 +++++ .../refman/builtins/extends_protocol2_3.html | 74 +++++ Logtalk/manuals/refman/builtins/forall2.html | 66 +++++ .../builtins/implements_protocol2_3.html | 80 ++++++ .../refman/builtins/imports_category2_3.html | 74 +++++ .../builtins/instantiates_class2_3.html | 74 +++++ .../refman/builtins/logtalk_compile1.html | 73 +++++ .../refman/builtins/logtalk_compile2.html | 79 +++++ .../refman/builtins/logtalk_load1.html | 73 +++++ .../refman/builtins/logtalk_load2.html | 78 +++++ .../refman/builtins/logtalk_version3.html | 68 +++++ .../refman/builtins/object_property2.html | 66 +++++ .../refman/builtins/protocol_property2.html | 66 +++++ .../manuals/refman/builtins/retractall1.html | 64 +++++ .../refman/builtins/specializes_class2_3.html | 74 +++++ Logtalk/manuals/refman/control/external1.html | 64 +++++ .../manuals/refman/control/to_object2.html | 81 ++++++ Logtalk/manuals/refman/control/to_self1.html | 75 +++++ Logtalk/manuals/refman/control/to_super1.html | 72 +++++ Logtalk/manuals/refman/directives/calls1.html | 58 ++++ .../refman/directives/category1_2.html | 68 +++++ .../refman/directives/discontiguous1.html | 62 ++++ .../manuals/refman/directives/dynamic0.html | 56 ++++ .../manuals/refman/directives/dynamic1.html | 62 ++++ .../refman/directives/end_category0.html | 56 ++++ .../refman/directives/end_object0.html | 56 ++++ .../refman/directives/end_protocol0.html | 56 ++++ Logtalk/manuals/refman/directives/info1.html | 60 ++++ Logtalk/manuals/refman/directives/info2.html | 59 ++++ .../refman/directives/initialization1.html | 56 ++++ .../refman/directives/metapredicate1.html | 58 ++++ Logtalk/manuals/refman/directives/mode2.html | 63 ++++ .../manuals/refman/directives/object1_4.html | 272 ++++++++++++++++++ Logtalk/manuals/refman/directives/op3.html | 58 ++++ .../manuals/refman/directives/private1.html | 61 ++++ .../manuals/refman/directives/protected1.html | 62 ++++ .../refman/directives/protocol1_2.html | 68 +++++ .../manuals/refman/directives/public1.html | 62 ++++ Logtalk/manuals/refman/directives/uses1.html | 58 ++++ Logtalk/manuals/refman/methods/abolish1.html | 86 ++++++ Logtalk/manuals/refman/methods/after3.html | 65 +++++ Logtalk/manuals/refman/methods/asserta1.html | 82 ++++++ Logtalk/manuals/refman/methods/assertz1.html | 82 ++++++ Logtalk/manuals/refman/methods/bagof3.html | 68 +++++ Logtalk/manuals/refman/methods/before3.html | 65 +++++ Logtalk/manuals/refman/methods/clause2.html | 81 ++++++ .../refman/methods/current_predicate1.html | 69 +++++ Logtalk/manuals/refman/methods/findall3.html | 68 +++++ Logtalk/manuals/refman/methods/forall2.html | 74 +++++ .../manuals/refman/methods/parameter2.html | 77 +++++ .../refman/methods/predicate_property2.html | 73 +++++ Logtalk/manuals/refman/methods/retract1.html | 80 ++++++ .../manuals/refman/methods/retractall1.html | 79 +++++ Logtalk/manuals/refman/methods/self1.html | 66 +++++ Logtalk/manuals/refman/methods/sender1.html | 66 +++++ Logtalk/manuals/refman/methods/setof3.html | 68 +++++ Logtalk/manuals/refman/methods/this1.html | 66 +++++ 131 files changed, 6279 insertions(+) create mode 100644 Logtalk/examples/lo/planner/NOTES create mode 100644 Logtalk/examples/lo/planner/SCRIPT create mode 100644 Logtalk/examples/lo/planner/aberdeen_air.lgt create mode 100644 Logtalk/examples/lo/planner/aiai.lgt create mode 100644 Logtalk/examples/lo/planner/airport.lgt create mode 100644 Logtalk/examples/lo/planner/albert_hall.lgt create mode 100644 Logtalk/examples/lo/planner/castle.lgt create mode 100644 Logtalk/examples/lo/planner/city.lgt create mode 100644 Logtalk/examples/lo/planner/edin.lgt create mode 100644 Logtalk/examples/lo/planner/edinburgh.lgt create mode 100644 Logtalk/examples/lo/planner/fly.lgt create mode 100644 Logtalk/examples/lo/planner/glasgow.lgt create mode 100644 Logtalk/examples/lo/planner/imperial.lgt create mode 100644 Logtalk/examples/lo/planner/lhr.lgt create mode 100644 Logtalk/examples/lo/planner/london.lgt create mode 100644 Logtalk/examples/lo/planner/manchester.lgt create mode 100644 Logtalk/examples/lo/planner/plan1.lgt create mode 100644 Logtalk/examples/lo/planner/planner.loader create mode 100644 Logtalk/examples/lo/planner/renfrew.lgt create mode 100644 Logtalk/examples/lo/planner/ringway.lgt create mode 100644 Logtalk/examples/lo/planner/victoria.lgt create mode 100644 Logtalk/examples/lo/travellers/NOTES create mode 100644 Logtalk/examples/lo/travellers/SCRIPT create mode 100644 Logtalk/examples/lo/travellers/aberdeen.lgt create mode 100644 Logtalk/examples/lo/travellers/aberystwyth.lgt create mode 100644 Logtalk/examples/lo/travellers/birmingham.lgt create mode 100644 Logtalk/examples/lo/travellers/brighton.lgt create mode 100644 Logtalk/examples/lo/travellers/bristol.lgt create mode 100644 Logtalk/examples/lo/travellers/cambridge.lgt create mode 100644 Logtalk/examples/lo/travellers/cardiff.lgt create mode 100644 Logtalk/examples/lo/travellers/carlisle.lgt create mode 100644 Logtalk/examples/lo/travellers/circular.lgt create mode 100644 Logtalk/examples/lo/travellers/descend.lgt create mode 100644 Logtalk/examples/lo/travellers/dover.lgt create mode 100644 Logtalk/examples/lo/travellers/driving.lgt create mode 100644 Logtalk/examples/lo/travellers/edinburgh.lgt create mode 100644 Logtalk/examples/lo/travellers/exeter.lgt create mode 100644 Logtalk/examples/lo/travellers/geographic2.lgt create mode 100644 Logtalk/examples/lo/travellers/glasgow.lgt create mode 100644 Logtalk/examples/lo/travellers/hull.lgt create mode 100644 Logtalk/examples/lo/travellers/incremental.lgt create mode 100644 Logtalk/examples/lo/travellers/leeds.lgt create mode 100644 Logtalk/examples/lo/travellers/liverpool.lgt create mode 100644 Logtalk/examples/lo/travellers/location2.lgt create mode 100644 Logtalk/examples/lo/travellers/london.lgt create mode 100644 Logtalk/examples/lo/travellers/manchester.lgt create mode 100644 Logtalk/examples/lo/travellers/metric1.lgt create mode 100644 Logtalk/examples/lo/travellers/natural.lgt create mode 100644 Logtalk/examples/lo/travellers/newcastle.lgt create mode 100644 Logtalk/examples/lo/travellers/nottingham.lgt create mode 100644 Logtalk/examples/lo/travellers/oxford.lgt create mode 100644 Logtalk/examples/lo/travellers/penzance.lgt create mode 100644 Logtalk/examples/lo/travellers/permute.lgt create mode 100644 Logtalk/examples/lo/travellers/portsmouth.lgt create mode 100644 Logtalk/examples/lo/travellers/presort.lgt create mode 100644 Logtalk/examples/lo/travellers/quick1.lgt create mode 100644 Logtalk/examples/lo/travellers/salesman.lgt create mode 100644 Logtalk/examples/lo/travellers/sheffield.lgt create mode 100644 Logtalk/examples/lo/travellers/swansea.lgt create mode 100644 Logtalk/examples/lo/travellers/travellers.loader create mode 100644 Logtalk/examples/lo/travellers/york.lgt create mode 100644 Logtalk/manuals/refman/builtins/abolish_category1.html create mode 100644 Logtalk/manuals/refman/builtins/abolish_events5.html create mode 100644 Logtalk/manuals/refman/builtins/abolish_object1.html create mode 100644 Logtalk/manuals/refman/builtins/abolish_protocol1.html create mode 100644 Logtalk/manuals/refman/builtins/category_property2.html create mode 100644 Logtalk/manuals/refman/builtins/create_category4.html create mode 100644 Logtalk/manuals/refman/builtins/create_object4.html create mode 100644 Logtalk/manuals/refman/builtins/create_protocol3.html create mode 100644 Logtalk/manuals/refman/builtins/current_category1.html create mode 100644 Logtalk/manuals/refman/builtins/current_event5.html create mode 100644 Logtalk/manuals/refman/builtins/current_object1.html create mode 100644 Logtalk/manuals/refman/builtins/current_protocol1.html create mode 100644 Logtalk/manuals/refman/builtins/define_events5.html create mode 100644 Logtalk/manuals/refman/builtins/extends_object2_3.html create mode 100644 Logtalk/manuals/refman/builtins/extends_protocol2_3.html create mode 100644 Logtalk/manuals/refman/builtins/forall2.html create mode 100644 Logtalk/manuals/refman/builtins/implements_protocol2_3.html create mode 100644 Logtalk/manuals/refman/builtins/imports_category2_3.html create mode 100644 Logtalk/manuals/refman/builtins/instantiates_class2_3.html create mode 100644 Logtalk/manuals/refman/builtins/logtalk_compile1.html create mode 100644 Logtalk/manuals/refman/builtins/logtalk_compile2.html create mode 100644 Logtalk/manuals/refman/builtins/logtalk_load1.html create mode 100644 Logtalk/manuals/refman/builtins/logtalk_load2.html create mode 100644 Logtalk/manuals/refman/builtins/logtalk_version3.html create mode 100644 Logtalk/manuals/refman/builtins/object_property2.html create mode 100644 Logtalk/manuals/refman/builtins/protocol_property2.html create mode 100644 Logtalk/manuals/refman/builtins/retractall1.html create mode 100644 Logtalk/manuals/refman/builtins/specializes_class2_3.html create mode 100644 Logtalk/manuals/refman/control/external1.html create mode 100644 Logtalk/manuals/refman/control/to_object2.html create mode 100644 Logtalk/manuals/refman/control/to_self1.html create mode 100644 Logtalk/manuals/refman/control/to_super1.html create mode 100644 Logtalk/manuals/refman/directives/calls1.html create mode 100644 Logtalk/manuals/refman/directives/category1_2.html create mode 100644 Logtalk/manuals/refman/directives/discontiguous1.html create mode 100644 Logtalk/manuals/refman/directives/dynamic0.html create mode 100644 Logtalk/manuals/refman/directives/dynamic1.html create mode 100644 Logtalk/manuals/refman/directives/end_category0.html create mode 100644 Logtalk/manuals/refman/directives/end_object0.html create mode 100644 Logtalk/manuals/refman/directives/end_protocol0.html create mode 100644 Logtalk/manuals/refman/directives/info1.html create mode 100644 Logtalk/manuals/refman/directives/info2.html create mode 100644 Logtalk/manuals/refman/directives/initialization1.html create mode 100644 Logtalk/manuals/refman/directives/metapredicate1.html create mode 100644 Logtalk/manuals/refman/directives/mode2.html create mode 100644 Logtalk/manuals/refman/directives/object1_4.html create mode 100644 Logtalk/manuals/refman/directives/op3.html create mode 100644 Logtalk/manuals/refman/directives/private1.html create mode 100644 Logtalk/manuals/refman/directives/protected1.html create mode 100644 Logtalk/manuals/refman/directives/protocol1_2.html create mode 100644 Logtalk/manuals/refman/directives/public1.html create mode 100644 Logtalk/manuals/refman/directives/uses1.html create mode 100644 Logtalk/manuals/refman/methods/abolish1.html create mode 100644 Logtalk/manuals/refman/methods/after3.html create mode 100644 Logtalk/manuals/refman/methods/asserta1.html create mode 100644 Logtalk/manuals/refman/methods/assertz1.html create mode 100644 Logtalk/manuals/refman/methods/bagof3.html create mode 100644 Logtalk/manuals/refman/methods/before3.html create mode 100644 Logtalk/manuals/refman/methods/clause2.html create mode 100644 Logtalk/manuals/refman/methods/current_predicate1.html create mode 100644 Logtalk/manuals/refman/methods/findall3.html create mode 100644 Logtalk/manuals/refman/methods/forall2.html create mode 100644 Logtalk/manuals/refman/methods/parameter2.html create mode 100644 Logtalk/manuals/refman/methods/predicate_property2.html create mode 100644 Logtalk/manuals/refman/methods/retract1.html create mode 100644 Logtalk/manuals/refman/methods/retractall1.html create mode 100644 Logtalk/manuals/refman/methods/self1.html create mode 100644 Logtalk/manuals/refman/methods/sender1.html create mode 100644 Logtalk/manuals/refman/methods/setof3.html create mode 100644 Logtalk/manuals/refman/methods/this1.html diff --git a/Logtalk/examples/lo/planner/NOTES b/Logtalk/examples/lo/planner/NOTES new file mode 100644 index 000000000..5de51e284 --- /dev/null +++ b/Logtalk/examples/lo/planner/NOTES @@ -0,0 +1,10 @@ +================================================================= +Logtalk - Object oriented extension to Prolog +Release 2.8.4 + +Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. +================================================================= + +To load all objects in this library consult the planner.loader utility +file (note that the *.loader files are Prolog files). + diff --git a/Logtalk/examples/lo/planner/SCRIPT b/Logtalk/examples/lo/planner/SCRIPT new file mode 100644 index 000000000..67685c8cc --- /dev/null +++ b/Logtalk/examples/lo/planner/SCRIPT @@ -0,0 +1,15 @@ +================================================================= +Logtalk - Object oriented extension to Prolog +Release 2.8.4 + +Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. +================================================================= + + +% plan a trip from london to the aiai conference in edinburgh: + +| ?- plan(london)::from(imperial, aiai, L). + +L = [[taxi(imperial,lhr)]-[fly(lhr,edin)]-[taxi(edin,aiai)]] ? + +yes diff --git a/Logtalk/examples/lo/planner/aberdeen_air.lgt b/Logtalk/examples/lo/planner/aberdeen_air.lgt new file mode 100644 index 000000000..c304bf5d7 --- /dev/null +++ b/Logtalk/examples/lo/planner/aberdeen_air.lgt @@ -0,0 +1,9 @@ + +:- object(aberdeen_air, + extends(airport)). + + + fly(renfrew). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/aiai.lgt b/Logtalk/examples/lo/planner/aiai.lgt new file mode 100644 index 000000000..63faf1325 --- /dev/null +++ b/Logtalk/examples/lo/planner/aiai.lgt @@ -0,0 +1,6 @@ + +:- object(aiai, + extends(edinburgh)). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/airport.lgt b/Logtalk/examples/lo/planner/airport.lgt new file mode 100644 index 000000000..4b2f11752 --- /dev/null +++ b/Logtalk/examples/lo/planner/airport.lgt @@ -0,0 +1,16 @@ + +:- object(airport). + + + :- public(fly/1). + :- mode(fly(?), zero_or_more). + + :- public(airport/1). + :- mode(airport(?), zero_or_more). + + + airport(Airport) :- + self(Airport). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/albert_hall.lgt b/Logtalk/examples/lo/planner/albert_hall.lgt new file mode 100644 index 000000000..2b888fc0a --- /dev/null +++ b/Logtalk/examples/lo/planner/albert_hall.lgt @@ -0,0 +1,6 @@ + +:- object(albert_hall, + extends(london)). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/castle.lgt b/Logtalk/examples/lo/planner/castle.lgt new file mode 100644 index 000000000..6227838e1 --- /dev/null +++ b/Logtalk/examples/lo/planner/castle.lgt @@ -0,0 +1,6 @@ + +:- object(castle, + extends(edinburgh)). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/city.lgt b/Logtalk/examples/lo/planner/city.lgt new file mode 100644 index 000000000..9c3c7b30f --- /dev/null +++ b/Logtalk/examples/lo/planner/city.lgt @@ -0,0 +1,30 @@ + +:- object(city). + + + :- public(step/3). + :- mode(step(+, +, -), zero_or_more). + + :- public(airport/1). + :- mode(airport(?atom), zero_or_more). + + + step(X, Y, P1-P-P2) :- + \+ same_city(X, Y), !, + X::airport(XA), + Y::airport(YA), + plan(fly)::from(XA, YA, P), + plan(city)::from(X, XA, P1), + plan(city)::from(YA, Y, P2). + + step(X, Y, taxi(X, Y)) :- + same_city(X, Y), + X \= Y. + + + same_city(X, Y) :- + X::airport(A), + Y::airport(A). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/edin.lgt b/Logtalk/examples/lo/planner/edin.lgt new file mode 100644 index 000000000..37ad7aa7b --- /dev/null +++ b/Logtalk/examples/lo/planner/edin.lgt @@ -0,0 +1,6 @@ + +:- object(edin, + extends(edinburgh)). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/edinburgh.lgt b/Logtalk/examples/lo/planner/edinburgh.lgt new file mode 100644 index 000000000..56b8fc8c9 --- /dev/null +++ b/Logtalk/examples/lo/planner/edinburgh.lgt @@ -0,0 +1,9 @@ + +:- object(edinburgh, + extends(city)). + + + airport(edin). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/fly.lgt b/Logtalk/examples/lo/planner/fly.lgt new file mode 100644 index 000000000..e672a89b6 --- /dev/null +++ b/Logtalk/examples/lo/planner/fly.lgt @@ -0,0 +1,13 @@ + +:- object(fly). + + + :- public(step/3). + :- mode(step(+, +, -), zero_or_more). + + + step(From, To, fly(From, To)) :- + From::fly(To). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/glasgow.lgt b/Logtalk/examples/lo/planner/glasgow.lgt new file mode 100644 index 000000000..b931e75d2 --- /dev/null +++ b/Logtalk/examples/lo/planner/glasgow.lgt @@ -0,0 +1,9 @@ + +:- object(glasgow, + extends(city)). + + + airport(renfrew). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/imperial.lgt b/Logtalk/examples/lo/planner/imperial.lgt new file mode 100644 index 000000000..09b762aa6 --- /dev/null +++ b/Logtalk/examples/lo/planner/imperial.lgt @@ -0,0 +1,6 @@ + +:- object(imperial, + extends(london)). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/lhr.lgt b/Logtalk/examples/lo/planner/lhr.lgt new file mode 100644 index 000000000..37b81c7bc --- /dev/null +++ b/Logtalk/examples/lo/planner/lhr.lgt @@ -0,0 +1,10 @@ + +:- object(lhr, + extends(airport)). + + + fly(edin). + fly(ringway). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/london.lgt b/Logtalk/examples/lo/planner/london.lgt new file mode 100644 index 000000000..60d7d7fb1 --- /dev/null +++ b/Logtalk/examples/lo/planner/london.lgt @@ -0,0 +1,9 @@ + +:- object(london, + extends(city)). + + + airport(lhr). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/manchester.lgt b/Logtalk/examples/lo/planner/manchester.lgt new file mode 100644 index 000000000..9ea8d620c --- /dev/null +++ b/Logtalk/examples/lo/planner/manchester.lgt @@ -0,0 +1,9 @@ + +:- object(manchester, + extends(city)). + + + airport(ringway). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/plan1.lgt b/Logtalk/examples/lo/planner/plan1.lgt new file mode 100644 index 000000000..b5069c46c --- /dev/null +++ b/Logtalk/examples/lo/planner/plan1.lgt @@ -0,0 +1,46 @@ + +:- object(plan(_)). + + + :- info([ + authors is 'Paulo Moura', + version is 1.0, + date is 2000/4/22, + comment is 'Air-line trip planner.', + parnames is ['Mode'], + source is 'Example adopted from the Francis G. McCabe L&O documentation.']). + + + :- public(from/3). + + :- mode(from(+atom, +atom, -list), zero_or_more). + + :- info(from/3, + [comment is 'Plan a trip from Start to Destination.', + argnames is ['Start', 'Destination', 'Plan']]). + + + from(Start, Destination, Plan) :- + from(Start, Destination, [], Plan). + + + from(Start, Destination, _, [Step]) :- + parameter(1, Mode), + Mode::step(Start, Destination, Step), + !. + + from(Start, Destination, Locations, [Step| Steps]) :- + parameter(1, Mode), + Mode::step(Start, City2, Step), + not_member(City2, Locations), + from(City2, Destination, [Start| Locations], Steps). + + + not_member(_, []). + + not_member(City, [Location| Locations]) :- + City \= Location, + not_member(City, Locations). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/planner.loader b/Logtalk/examples/lo/planner/planner.loader new file mode 100644 index 000000000..0ad0a62f4 --- /dev/null +++ b/Logtalk/examples/lo/planner/planner.loader @@ -0,0 +1,21 @@ + +:- initialization( + logtalk_load([ + aberdeen_air, + aiai, + airport, + albert_hall, + castle, + city, + edin, + edinburgh, + fly, + glasgow, + imperial, + lhr, + london, + manchester, + plan1, + renfrew, + ringway, + victoria])). diff --git a/Logtalk/examples/lo/planner/renfrew.lgt b/Logtalk/examples/lo/planner/renfrew.lgt new file mode 100644 index 000000000..3cfd078da --- /dev/null +++ b/Logtalk/examples/lo/planner/renfrew.lgt @@ -0,0 +1,10 @@ + +:- object(renfrew, + extends(airport)). + + + fly(aberdeen_air). + fly(ringway). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/ringway.lgt b/Logtalk/examples/lo/planner/ringway.lgt new file mode 100644 index 000000000..da182cac0 --- /dev/null +++ b/Logtalk/examples/lo/planner/ringway.lgt @@ -0,0 +1,10 @@ + +:- object(ringway, + extends(manchester, airport)). + + + fly(lhr). + fly(renfrew). + + +:- end_object. diff --git a/Logtalk/examples/lo/planner/victoria.lgt b/Logtalk/examples/lo/planner/victoria.lgt new file mode 100644 index 000000000..fd80e32e4 --- /dev/null +++ b/Logtalk/examples/lo/planner/victoria.lgt @@ -0,0 +1,6 @@ + +:- object(victoria, + extends(manchester)). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/NOTES b/Logtalk/examples/lo/travellers/NOTES new file mode 100644 index 000000000..087493275 --- /dev/null +++ b/Logtalk/examples/lo/travellers/NOTES @@ -0,0 +1,9 @@ +================================================================= +Logtalk - Object oriented extension to Prolog +Release 2.8.4 + +Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. +================================================================= + +To load all objects in this library consult the travellers.loader utility +file (note that the *.loader files are Prolog files). diff --git a/Logtalk/examples/lo/travellers/SCRIPT b/Logtalk/examples/lo/travellers/SCRIPT new file mode 100644 index 000000000..dda19030b --- /dev/null +++ b/Logtalk/examples/lo/travellers/SCRIPT @@ -0,0 +1,38 @@ +================================================================= +Logtalk - Object oriented extension to Prolog +Release 2.8.4 + +Copyright (c) 1998-2001 Paulo Moura. All Rights Reserved. +================================================================= + + +% build a route by adding one town at a time: + +| ?- incremental::route([london, brighton, portsmouth, exeter, oxford, aberystwyth], Route). + +Route = oxford~london~portsmouth~brighton~exeter~aberystwyth ? +yes + + +% presort towns by geographical distance before using the incremental algorithm: + +| ?- presort::route([london, brighton, portsmouth, exeter, oxford, aberystwyth], Route). + +Route = brighton~london~oxford~portsmouth~exeter~aberystwyth ? +yes + + +% come home after the journey: + +| ?- circular::route([london, brighton, portsmouth, exeter, oxford, aberystwyth], Route). + +Route = london~brighton~portsmouth~exeter~aberystwyth~oxford~london ? +yes + + +% blind search by generating permutations of the list of towns: + +| ?- permute::route([london, brighton, portsmouth, exeter, oxford, aberystwyth], Route). + +Route = (aberystwyth~exeter~portsmouth~brighton~london~oxford,273.6237583942784) ? +yes diff --git a/Logtalk/examples/lo/travellers/aberdeen.lgt b/Logtalk/examples/lo/travellers/aberdeen.lgt new file mode 100644 index 000000000..d9d12780f --- /dev/null +++ b/Logtalk/examples/lo/travellers/aberdeen.lgt @@ -0,0 +1,11 @@ + +:- object(aberdeen, + extends(location(194, 340))). + + + links([ + (edinburgh, 115), + (glasgow, 142)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/aberystwyth.lgt b/Logtalk/examples/lo/travellers/aberystwyth.lgt new file mode 100644 index 000000000..b3fe52f10 --- /dev/null +++ b/Logtalk/examples/lo/travellers/aberystwyth.lgt @@ -0,0 +1,12 @@ + +:- object(aberystwyth, + extends(location(126, 102))). + + + links([ + (birmingham, 114), + (liverpool, 100), + (swansea, 75)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/birmingham.lgt b/Logtalk/examples/lo/travellers/birmingham.lgt new file mode 100644 index 000000000..7e47c5c39 --- /dev/null +++ b/Logtalk/examples/lo/travellers/birmingham.lgt @@ -0,0 +1,16 @@ + +:- object(birmingham, + extends(location(192, 106))). + + + links([ + (aberystwyth, 114), + (bristol, 86), + (cambridge, 97), + (liverpool, 99), + (nottingham, 48), + (oxford, 63), + (sheffield, 75)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/brighton.lgt b/Logtalk/examples/lo/travellers/brighton.lgt new file mode 100644 index 000000000..98ec240cc --- /dev/null +++ b/Logtalk/examples/lo/travellers/brighton.lgt @@ -0,0 +1,12 @@ + +:- object(brighton, + extends(location(248, 10))). + + + links([ + (dover, 81), + (portsmouth, 49), + (london, 52)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/bristol.lgt b/Logtalk/examples/lo/travellers/bristol.lgt new file mode 100644 index 000000000..9d4ca042b --- /dev/null +++ b/Logtalk/examples/lo/travellers/bristol.lgt @@ -0,0 +1,13 @@ + +:- object(bristol, + extends(location(168, 47))). + + + links([ + (cardiff, 44), + (exeter, 76), + (oxford, 71), + (birmingham, 86)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/cambridge.lgt b/Logtalk/examples/lo/travellers/cambridge.lgt new file mode 100644 index 000000000..6378c9012 --- /dev/null +++ b/Logtalk/examples/lo/travellers/cambridge.lgt @@ -0,0 +1,13 @@ + +:- object(cambridge, + extends(location(254, 92))). + + + links([ + (nottingham, 82), + (oxford, 80), + (london, 54), + (birmingham, 97)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/cardiff.lgt b/Logtalk/examples/lo/travellers/cardiff.lgt new file mode 100644 index 000000000..c5b195b8a --- /dev/null +++ b/Logtalk/examples/lo/travellers/cardiff.lgt @@ -0,0 +1,11 @@ + +:- object(cardiff, + extends(location(148, 56))). + + + links([ + (bristol, 44), + (swansea, 45)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/carlisle.lgt b/Logtalk/examples/lo/travellers/carlisle.lgt new file mode 100644 index 000000000..7536a2136 --- /dev/null +++ b/Logtalk/examples/lo/travellers/carlisle.lgt @@ -0,0 +1,12 @@ + +:- object(carlisle, + extends(location(166, 226))). + + + links([ + (glasgow, 94), + (leeds, 117), + (newcastle, 58)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/circular.lgt b/Logtalk/examples/lo/travellers/circular.lgt new file mode 100644 index 000000000..bbef09a3d --- /dev/null +++ b/Logtalk/examples/lo/travellers/circular.lgt @@ -0,0 +1,72 @@ + +:- object(circular, + extends(salesman)). + + + :- info([ + authors is 'Paulo Moura', + version is 1.0, + date is 2000/4/22, + comment is '.', + source is 'Example adopted from the Francis G. McCabe L&O documentation.']). + + + :- op(400, yfx, ~). + + + route([Town| Towns], Route) :- + route(Towns, Town~Town, Route). + + + route([], Route, Route). + + route([Town| Towns], Route, Route2) :- + best_place(Route, Town, Best), + split(Best, Route, Town, Split), + route(Towns, Split, Route2). + + + best_place(Route, Town, Best) :- + best_place(Route, Town, 10000000, 0, 0, Best). + + best_place(R~T1~T2, Town, XD, _, I, Best) :- + atom(T1), + atom(T2), + extra(T1, Town, T2, XT), + XT < XD, + I2 is I + 1, + best_place(R~T1, Town, XT, I2, I2, Best). + + best_place(R~T1~T2, Town, XD, XI, I, Best) :- + atom(T1), + atom(T2), + I2 is I + 1, + best_place(R~T1, Town, XD, XI, I2, Best). + + best_place(T1~T2, Town, XD, _, I, Best) :- + atom(T1), + atom(T2), + extra(T1, Town, T2, XT), + XT < XD, + Best is I + 1. + + best_place(_~_, _, _, XI, _, XI). + + + split(0, Route, Town, Route~Town). + + split(IX, Route~Town1, Town, Split~Town1) :- + IX2 is IX - 1, + split(IX2, Route, Town, Split). + + split(1, Route, Town, Town~Route). + + + extra(T1, T, T2, E) :- + T1::crow_flies(T, E1), + T::crow_flies(T2, E2), + T1::crow_flies(T2, E3), + E is E1 + E2 - E3. + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/descend.lgt b/Logtalk/examples/lo/travellers/descend.lgt new file mode 100644 index 000000000..3d8b30578 --- /dev/null +++ b/Logtalk/examples/lo/travellers/descend.lgt @@ -0,0 +1,20 @@ + +:- object(descend). + + + :- info([ + authors is 'Paulo Moura', + version is 1.0, + date is 2000/4/22, + comment is '.', + source is 'Example adopted from the Francis G. McCabe L&O documentation.']). + + + :- public(less/2). + + + less(X, Y):- + X >= Y. + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/dover.lgt b/Logtalk/examples/lo/travellers/dover.lgt new file mode 100644 index 000000000..dcc92f76b --- /dev/null +++ b/Logtalk/examples/lo/travellers/dover.lgt @@ -0,0 +1,11 @@ + +:- object(dover, + extends(location(292, 38))). + + + links([ + (brighton, 81), + (london, 71)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/driving.lgt b/Logtalk/examples/lo/travellers/driving.lgt new file mode 100644 index 000000000..659edb023 --- /dev/null +++ b/Logtalk/examples/lo/travellers/driving.lgt @@ -0,0 +1,52 @@ + +:- object(driving, + extends(salesman)). + + + :- info([ + authors is 'Paulo Moura', + version is 1.0, + date is 2000/4/22, + comment is '.', + source is 'Example adopted from the Francis G. McCabe L&O documentation.']). + + + :- op(400, yfx, ~). + + + route(Towns, Route) :- + presort::route(Towns, Presort), + drive_around(Presort, Route). + + + drive_around(Route~Town1~Town2, Route1~Route2) :- + !, + drive_around(Route~Town1, Route1), + Town1::drive(Town2, Route2). + + drive_around(Town1~Town2, Route) :- + !, + Town1::drive(Town2, Route). + + drive_around(Town, Town). + + + drive_length(Route, Length) :- + drive_length(Route, 0, Length). + + + drive_length(Route~Town1~Town2, Acc, Length) :- + !, + Town1::road_distance(Town2, Length2), + Acc2 is Acc + Length2, + drive_length(Route~Town1, Acc2, Length). + + drive_length(Town1~Town2, Acc, Length) :- + !, + Town1::road_distance(Town2, Length2), + Length is Acc + Length2. + + drive_length(_, Length, Length). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/edinburgh.lgt b/Logtalk/examples/lo/travellers/edinburgh.lgt new file mode 100644 index 000000000..7de15fd5f --- /dev/null +++ b/Logtalk/examples/lo/travellers/edinburgh.lgt @@ -0,0 +1,12 @@ + +:- object(edinburgh, + extends(location(162, 282))). + + + links([ + (aberdeen, 115), + (glasgow, 44), + (newcastle, 104)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/exeter.lgt b/Logtalk/examples/lo/travellers/exeter.lgt new file mode 100644 index 000000000..657fded12 --- /dev/null +++ b/Logtalk/examples/lo/travellers/exeter.lgt @@ -0,0 +1,12 @@ + +:- object(exeter, + extends(location(138, 18))). + + + links([ + (bristol, 76), + (penzance, 112), + (portsmouth, 126)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/geographic2.lgt b/Logtalk/examples/lo/travellers/geographic2.lgt new file mode 100644 index 000000000..677584a61 --- /dev/null +++ b/Logtalk/examples/lo/travellers/geographic2.lgt @@ -0,0 +1,68 @@ + +:- object(geographic(_OX, _OY)). + + + :- info([ + authors is 'Paulo Moura', + version is 1.0, + date is 2000/4/22, + parnames is ['OX', 'OY'], + comment is '.', + source is 'Example adopted from the Francis G. McCabe L&O documentation.']). + + + :- public(less/2). + + + less(Town1, Town2):- + angle(Town1, Angle1), + angle(Town2, Angle2), + Angle1 < Angle2. + + + angle(Town, Angle) :- + Town::at(X, Y), + parameter(1, OX), + parameter(2, OY), + angle(X, Y, OX, OY, Angle). + + + angle(X, Y, OX, OY, Angle) :- + X > OX, + Y >= OY, + Angle is atan((Y-OY)/(X-OX)). + + angle(X, Y, OX, OY, Angle) :- + X > OX, + Y < OY, + pi(Pi), + Angle is Pi + Pi - atan((OY-Y)/(X-OX)). + + angle(X, Y, OX, OY, Angle) :- + X < OX, + Y >= OY, + pi(Pi), + Angle is Pi - atan((Y-OY)/(OX-X)). + + angle(X, Y, OX, OY, Angle) :- + X < OX, + Y < OY, + pi(Pi), + Angle is Pi + atan((OY-Y)/(OX-X)). + + angle(OX, Y, OX, OY, Angle) :- + Y > OY, + pi(Pi), + Angle is Pi / 2. + + angle(OX, Y, OX, OY, Angle) :- + Y =< OY, + pi(Pi), + Angle is 1.5 * Pi. + + + pi(Pi) :- + Pi is 4.0*atan(1.0). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/glasgow.lgt b/Logtalk/examples/lo/travellers/glasgow.lgt new file mode 100644 index 000000000..aebe3af69 --- /dev/null +++ b/Logtalk/examples/lo/travellers/glasgow.lgt @@ -0,0 +1,12 @@ + +:- object(glasgow, + extends(location(132, 273))). + + + links([ + (aberdeen, 142), + (carlisle, 94), + (edinburgh, 44)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/hull.lgt b/Logtalk/examples/lo/travellers/hull.lgt new file mode 100644 index 000000000..2828527d1 --- /dev/null +++ b/Logtalk/examples/lo/travellers/hull.lgt @@ -0,0 +1,12 @@ + +:- object(hull, + extends(location(240, 168))). + + + links([ + (leeds, 58), + (sheffield, 65), + (york, 37)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/incremental.lgt b/Logtalk/examples/lo/travellers/incremental.lgt new file mode 100644 index 000000000..f7853605b --- /dev/null +++ b/Logtalk/examples/lo/travellers/incremental.lgt @@ -0,0 +1,91 @@ + +:- object(incremental, + extends(salesman)). + + + :- info([ + authors is 'Paulo Moura', + version is 1.0, + date is 2000/4/22, + comment is '.', + source is 'Example adopted from the Francis G. McCabe L&O documentation.']). + + + :- op(400, yfx, ~). + + + route([Town| Towns], Route) :- + route(Towns, Town, Route). + + + route([], Route, Route). + + route([Town| Towns], Route, Route2) :- + best_place(Route, Town, Best), + split(Best, Route, Town, NewR), + route(Towns, NewR, Route2). + + + best_place(Route~Town1, Town, Best) :- % try the back first ... + atom(Town1), + Town::crow_flies(Town1, Distance), + best_place(Route~Town1, Town, Distance, 0, 0, Best). + + best_place(Town, _, 0) :- + atom(Town). + + + best_place(R~T1~T2, T, XD, _, I, Best) :- + atom(T1), + atom(T2), + extra(T1, T, T2, XT), + XT < XD, + I2 is I + 1, + best_place(R~T1, T, XT, I2, I2, Best). + + best_place(R~T1~T2, T, XD, XI, I, Best) :- + atom(T1), + atom(T2), + I2 is I + 1, + best_place(R~T1, T, XD, XI, I2, Best). + + best_place(T1~T2, T, XD, _, I, Best) :- + atom(T1), + atom(T2), + extra(T1, T, T2, XT), + XT < XD, + I2 is I + 1, + best_place(T1, T, XT, I2, I2, Best). + + best_place(T1~T2, T, XD, XI, I, Best) :- + atom(T1), + atom(T2), + I2 is I + 1, + best_place(T1, T, XD, XI, I2, Best). + + best_place(T1, T, XD, _, I, Best) :- + atom(T1), + T1::crow_flies(T, Distance), + Distance < XD, + Best is I + 1. + + best_place(_, _, _, XI, _, XI). + + + split(0, Route, Town, Route~Town). + + split(IX, Route~Town1, Town, S~Town1) :- + IX2 is IX -1, + split(IX2, Route, Town, S). + + split(1, Route, Town, Town~Route). + + + extra(T1, T, T2, XT) :- + T1::crow_flies(T, Distance1), + T::crow_flies(T2, Distance2), + T1::crow_flies(T2, Distance3), + XT is Distance1 + Distance2 - Distance3. + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/leeds.lgt b/Logtalk/examples/lo/travellers/leeds.lgt new file mode 100644 index 000000000..0bb18d3d2 --- /dev/null +++ b/Logtalk/examples/lo/travellers/leeds.lgt @@ -0,0 +1,14 @@ + +:- object(leeds, + extends(location(208, 170))). + + + links([ + (carlisle, 117), + (hull, 58), + (sheffield, 34), + (manchester, 41), + (york, 23)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/liverpool.lgt b/Logtalk/examples/lo/travellers/liverpool.lgt new file mode 100644 index 000000000..998653951 --- /dev/null +++ b/Logtalk/examples/lo/travellers/liverpool.lgt @@ -0,0 +1,13 @@ + +:- object(liverpool, + extends(location(164, 150))). + + + links([ + (aberystwyth, 100), + (birmingham, 99), + (manchester, 35), + (sheffield, 70)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/location2.lgt b/Logtalk/examples/lo/travellers/location2.lgt new file mode 100644 index 000000000..1ced0b016 --- /dev/null +++ b/Logtalk/examples/lo/travellers/location2.lgt @@ -0,0 +1,83 @@ + +:- object(location(_X, _Y)). + + + :- info([ + authors is 'Paulo Moura', + version is 1.0, + date is 2000/4/22, + parnames is ['X', 'Y'], + comment is '.', + source is 'Example adopted from the Francis G. McCabe L&O documentation.']). + + + :- op(400, yfx, ~). + + + :- public(at/2). + :- mode(at(-integer, -integer), one). + + :- public(crow_flies/2). + :- mode(crow_flies(+atom, -integer), one). + + :- public(drive/2). + :- mode(drive(+atom, -nonvar), zero_or_more). + + :- public(links/1). + :- mode(links(-list), one). + + :- public(road_distance/2). + :- mode(road_distance(?atom, ?integer), zero_or_more). + + + at(X, Y) :- + parameter(1, X), + parameter(2, Y). + + + crow_flies(Town, Distance) :- + ::at(X, Y), + Town::at(U, V), + U0 is U-X, + V0 is V-Y, + Distance is sqrt(U0*U0+V0*V0). + + + road_distance(Town, Distance) :- + ::links(Links), + member((Town, Distance), Links). + + + drive(To, Route) :- % plan a road journey + self(Self), + plan_drive(Self, To, [], _, Route). + + + % go directly + + plan_drive(From, To, _, Distance, From~To):- + To::links(Links), + member((From, Distance), Links). + + + % go indirectly + + plan_drive(From, To, R, D+DI, Route~To):- + To::links(Links), + nearest(Links, From, Int, DI), + \+ member(Int, R), + plan_drive(From, Int, [To| R], D, Route). + + + nearest(Links, To, Int, Distance):- + quick(metric(To))::sort(Links, Sorted), + member((Int, Distance), Sorted). + + + member(Head, [Head| _]). + + member(Head, [_| Tail]) :- + member(Head, Tail). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/london.lgt b/Logtalk/examples/lo/travellers/london.lgt new file mode 100644 index 000000000..b42f8dc1f --- /dev/null +++ b/Logtalk/examples/lo/travellers/london.lgt @@ -0,0 +1,14 @@ + +:- object(london, + extends(location(244,54))). + + + links([ + (brighton, 52), + (dover, 71), + (cambridge, 54), + (oxford, 57), + (portsmouth, 72)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/manchester.lgt b/Logtalk/examples/lo/travellers/manchester.lgt new file mode 100644 index 000000000..55905c875 --- /dev/null +++ b/Logtalk/examples/lo/travellers/manchester.lgt @@ -0,0 +1,12 @@ + +:- object(manchester, + extends(location(180, 156))). + + + links([ + (leeds, 41), + (liverpool, 35), + (sheffield, 38)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/metric1.lgt b/Logtalk/examples/lo/travellers/metric1.lgt new file mode 100644 index 000000000..3a9479e55 --- /dev/null +++ b/Logtalk/examples/lo/travellers/metric1.lgt @@ -0,0 +1,24 @@ + +:- object(metric(_Town)). + + + :- info([ + authors is 'Paulo Moura', + version is 1.0, + date is 2000/4/22, + comment is '.', + parnames is ['Town'], + source is 'Example adopted from the Francis G. McCabe L&O documentation.']). + + + :- public(less/2). + + + less((Town1, _), (Town2, _)):- + parameter(1, Town), + Town::crow_flies(Town1, Distance1), + Town::crow_flies(Town2, Distance2), + Distance1 < Distance2. + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/natural.lgt b/Logtalk/examples/lo/travellers/natural.lgt new file mode 100644 index 000000000..368c9a290 --- /dev/null +++ b/Logtalk/examples/lo/travellers/natural.lgt @@ -0,0 +1,20 @@ + +:- object(natural). + + + :- info([ + authors is 'Paulo Moura', + version is 1.0, + date is 2000/4/22, + comment is '.', + source is 'Example adopted from the Francis G. McCabe L&O documentation.']). + + + :- public(less/2). + + + less(X, Y):- + X < Y. + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/newcastle.lgt b/Logtalk/examples/lo/travellers/newcastle.lgt new file mode 100644 index 000000000..48eef99f8 --- /dev/null +++ b/Logtalk/examples/lo/travellers/newcastle.lgt @@ -0,0 +1,12 @@ + +:- object(newcastle, + extends(location(210, 230))). + + + links([ + (edinburgh, 104), + (carlisle, 58), + (york, 80)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/nottingham.lgt b/Logtalk/examples/lo/travellers/nottingham.lgt new file mode 100644 index 000000000..47172cedc --- /dev/null +++ b/Logtalk/examples/lo/travellers/nottingham.lgt @@ -0,0 +1,12 @@ + +:- object(nottingham, + extends(location(216, 128))). + + + links([ + (birmingham, 48), + (cambridge, 82), + (sheffield, 38)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/oxford.lgt b/Logtalk/examples/lo/travellers/oxford.lgt new file mode 100644 index 000000000..4dcd362e3 --- /dev/null +++ b/Logtalk/examples/lo/travellers/oxford.lgt @@ -0,0 +1,13 @@ + +:- object(oxford, + extends(location(214, 66))). + + + links([ + (bristol, 71), + (birmingham, 63), + (cambridge, 80), + (london, 57)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/penzance.lgt b/Logtalk/examples/lo/travellers/penzance.lgt new file mode 100644 index 000000000..8c6432657 --- /dev/null +++ b/Logtalk/examples/lo/travellers/penzance.lgt @@ -0,0 +1,10 @@ + +:- object(penzance, + extends(location(10, 0))). + + + links([( + exeter, 112)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/permute.lgt b/Logtalk/examples/lo/travellers/permute.lgt new file mode 100644 index 000000000..efe698feb --- /dev/null +++ b/Logtalk/examples/lo/travellers/permute.lgt @@ -0,0 +1,65 @@ + +:- object(permute, + extends(salesman)). + + + :- info([ + authors is 'Paulo Moura', + version is 1.0, + date is 2000/4/22, + comment is '.', + source is 'Example adopted from the Francis G. McCabe L&O documentation.']). + + + :- op(400, yfx, ~). + + + route(Towns, Route) :- + findall( + (Towns2, Length), + (permute(Towns, Towns2), route_length(Towns2, Length)), + List), + shortest(List, Route). + + + permute([Town], Town). + + permute(Towns, Towns2~Town) :- + delete(Towns, Town, Towns3), + permute(Towns3, Towns2). + + + delete([Head| Tail], Head, Tail). + + delete([Head| Tail], Element, [Head| Tail2]):- + delete(Tail, Element, Tail2). + + + route_length(Town, 0) :- + atom(Town), !. + + route_length(Towns~Town1~Town2, Length) :- + !, + route_length(Towns~Town1, Length1), + Town1::crow_flies(Town2, Length2), + Length is Length1 + Length2. + + route_length(Town1~Town2, Length) :- + Town1::crow_flies(Town2, Length). + + + shortest(List, Shortest) :- + shortest(List, null, 1000000, Shortest). + + + shortest([], Route, Length, (Route, Length)). + + shortest([(Route, Length)| Routes], _, LX, Shortest) :- + Length < LX, !, + shortest(Routes, Route, Length, Shortest). + + shortest([_| Routes], RX, LX, Shortest) :- + shortest(Routes, RX, LX, Shortest). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/portsmouth.lgt b/Logtalk/examples/lo/travellers/portsmouth.lgt new file mode 100644 index 000000000..221148012 --- /dev/null +++ b/Logtalk/examples/lo/travellers/portsmouth.lgt @@ -0,0 +1,12 @@ + +:- object(portsmouth, + extends(location(216, 22))). + + + links([ + (brighton, 49), + (exeter, 126), + (london, 72)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/presort.lgt b/Logtalk/examples/lo/travellers/presort.lgt new file mode 100644 index 000000000..5b48515c3 --- /dev/null +++ b/Logtalk/examples/lo/travellers/presort.lgt @@ -0,0 +1,43 @@ + +:- object(presort, + extends(incremental)). + + + :- info([ + authors is 'Paulo Moura', + version is 1.0, + date is 2000/4/22, + comment is '.', + source is 'Example adopted from the Francis G. McCabe L&O documentation.']). + + + :- uses(quick(_)). + + + route(Towns, Route) :- + arrange(Towns, Towns2), + ^^route(Towns2, Route). + + + arrange(Towns, Sorted) :- + centre(Towns, X, Y), + quick(geographic(X, Y))::sort(Towns, Sorted). + + + centre(Towns, X, Y) :- + average(Towns, 0, 0, U, V, 0, L), + X is U/L, + Y is V/L. + + + average([], U, V, U, V, L, L). + + average([Town| Towns], UX, VX, U, V, I, L):- + Town::at(UT, VT), + UX2 is UX+UT, + VX2 is VX+VT, + I2 is I + 1, + average(Towns, UX2, VX2, U, V, I2, L). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/quick1.lgt b/Logtalk/examples/lo/travellers/quick1.lgt new file mode 100644 index 000000000..0b61c93d5 --- /dev/null +++ b/Logtalk/examples/lo/travellers/quick1.lgt @@ -0,0 +1,45 @@ + +:- object(quick(_Order)). + + + :- info([ + authors is 'Paulo Moura', + version is 1.0, + date is 2000/4/22, + parnames is ['Order'], + comment is '.', + source is 'Example adopted from the Francis G. McCabe L&O documentation.']). + + + :- public(sort/2). + :- mode(sort(+list, -list), one). + + + sort([], []). + + sort([X| L], S):- + split(L, X, L1, L2), + sort(L1, S1), + sort(L2, S2), + app(S1, [X| S2], S). + + + split([], _, [], []). + + split([D| L], X, [D| L1], L2):- + parameter(1, Order), + Order::less(D, X), + !, + split(L, X, L1, L2). + + split([D| L], X, L1, [D| L2]):- + split(L, X, L1, L2). + + + app([], L, L). + + app([H| T], L, [H| T2]) :- + app(T, L, T2). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/salesman.lgt b/Logtalk/examples/lo/travellers/salesman.lgt new file mode 100644 index 000000000..31ded0ec1 --- /dev/null +++ b/Logtalk/examples/lo/travellers/salesman.lgt @@ -0,0 +1,20 @@ + +:- object(salesman). + + + :- info([ + authors is 'Paulo Moura', + version is 1.0, + date is 2000/4/22, + comment is '.', + source is 'Example adopted from the Francis G. McCabe L&O documentation.']). + + + :- op(400, yfx, ~). + + + :- public(route/2). + :- mode(route(+list, -nonvar), zero_or_more). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/sheffield.lgt b/Logtalk/examples/lo/travellers/sheffield.lgt new file mode 100644 index 000000000..717a2aa21 --- /dev/null +++ b/Logtalk/examples/lo/travellers/sheffield.lgt @@ -0,0 +1,15 @@ + +:- object(sheffield, + extends(location(208, 142))). + + + links([ + (birmingham, 75), + (hull, 65), + (leeds, 34), + (liverpool, 70), + (manchester, 38), + (nottingham, 38)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/swansea.lgt b/Logtalk/examples/lo/travellers/swansea.lgt new file mode 100644 index 000000000..0d6aed4d4 --- /dev/null +++ b/Logtalk/examples/lo/travellers/swansea.lgt @@ -0,0 +1,11 @@ + +:- object(swansea, + extends(location(126, 66))). + + + links([ + (cardiff, 45), + (aberystwyth, 75)]). + + +:- end_object. diff --git a/Logtalk/examples/lo/travellers/travellers.loader b/Logtalk/examples/lo/travellers/travellers.loader new file mode 100644 index 000000000..cc55121b3 --- /dev/null +++ b/Logtalk/examples/lo/travellers/travellers.loader @@ -0,0 +1,44 @@ + +:- initialization( + logtalk_load([ + aberdeen, + aberystwyth, + birmingham, + brighton, + bristol, + cambridge, + cardiff, + carlisle, + dover, + edinburgh, + exeter, + glasgow, + hull, + leeds, + liverpool, + london, + manchester, + newcastle, + nottingham, + oxford, + penzance, + portsmouth, + sheffield, + swansea, + york, + + salesman, + + circular, + driving, + geographic2, + incremental, + metric1, + permute, + presort, + + location2, + + descend, + quick1, + natural])). diff --git a/Logtalk/examples/lo/travellers/york.lgt b/Logtalk/examples/lo/travellers/york.lgt new file mode 100644 index 000000000..c1a4676bf --- /dev/null +++ b/Logtalk/examples/lo/travellers/york.lgt @@ -0,0 +1,12 @@ + +:- object(york, + extends(location(218, 184))). + + + links([ + (leeds, 23), + (hull, 37), + (newcastle, 80)]). + + +:- end_object. diff --git a/Logtalk/manuals/refman/builtins/abolish_category1.html b/Logtalk/manuals/refman/builtins/abolish_category1.html new file mode 100644 index 000000000..0ae16da2c --- /dev/null +++ b/Logtalk/manuals/refman/builtins/abolish_category1.html @@ -0,0 +1,70 @@ + + + + + + abolish_category/1 + + + + + +
+

abolish_category/1

+
+ +

Description

+ +
+
+abolish_category(Category)
+
+

+ Removes from the database a dynamic category. +

+
+ +

Template and modes

+ +
+
+abolish_category(@category_identifier)
+
+
+ +

Errors

+ +
+
+
Category is a variable:
+
instantiation_error
+
Category is not a valid category identifier:
+
type_error(category_identifier, Category)
+
Category is an identifier of a static category:
+
permission_error(modify, static_category, Category)
+
Category does not exist:
+
existence_error(category, Category)
+
+
+ +

Examples

+ +
+
+| ?- abolish_category(monitoring).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/abolish_events5.html b/Logtalk/manuals/refman/builtins/abolish_events5.html new file mode 100644 index 000000000..380ede7a2 --- /dev/null +++ b/Logtalk/manuals/refman/builtins/abolish_events5.html @@ -0,0 +1,72 @@ + + + + + + abolish_events/5 + + + + + +
+

abolish_events/5

+
+ +

Description

+ +
+
+abolish_events(Event, Object, Message, Sender, Monitor)
+
+

+ Abolishes all matching events. +

+
+ +

Template and modes

+ +
+
+abolish_events(@event, @object_identifier, @callable, @object_identifier, @object_identifier)
+
+
+ +

Errors

+ +
+
+
Event is neither a variable nor a valid event identifier:
+
type_error(event, Event)
+
Object is neither a variable nor a valid object identifier:
+
type_error(object_identifier, Object)
+
Message is neither a variable nor a callable term:
+
type_error(callable, Message)
+
Sender is neither a variable nor a valid object identifier:
+
type_error(object_identifier, Sender)
+
Monitor is neither a variable nor a valid object identifier:
+
type_error(object_identifier, Monitor)
+
+
+ +

Examples

+ +
+
+| ?- abolish_events(_, list, _, _, debugger).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/abolish_object1.html b/Logtalk/manuals/refman/builtins/abolish_object1.html new file mode 100644 index 000000000..8c009a3ba --- /dev/null +++ b/Logtalk/manuals/refman/builtins/abolish_object1.html @@ -0,0 +1,71 @@ + + + + + + abolish_object/1 + + + + + +
+

abolish_object/1

+
+ +

Description

+ +
+
+abolish_object(Object)
+
+

+

+ Removes from the database a dynamic object. +

+
+ +

Template and modes

+ +
+
+abolish_object(@object_identifier)
+
+
+ +

Errors

+ +
+
+
Object is a variable:
+
instantiation_error
+
Object is not a valid object identifier:
+
type_error(object_identifier, Object)
+
Object is an identifier of a static object:
+
permission_error(modify, static_object, Object)
+
Object does not exist:
+
existence_error(object, Object)
+
+
+ +

Examples

+ +
+
+| ?- abolish_object(list).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/abolish_protocol1.html b/Logtalk/manuals/refman/builtins/abolish_protocol1.html new file mode 100644 index 000000000..72b8d84fb --- /dev/null +++ b/Logtalk/manuals/refman/builtins/abolish_protocol1.html @@ -0,0 +1,70 @@ + + + + + + abolish_protocol/1 + + + + + +
+

abolish_protocol/1

+
+ +

Description

+ +
+
+abolish_protocol(Protocol)
+
+

+ Removes from the database a dynamic protocol. +

+
+ +

Template and modes

+ +
+
+abolish_protocol(@protocol_identifier)
+
+
+ +

Errors

+ +
+
+
Protocol is a variable:
+
instantiation_error
+
Protocol is not a valid protocol identifier:
+
type_error(protocol_identifier, Protocol)
+
Protocol is an identifier of a static protocol:
+
permission_error(modify, static_protocol, Protocol)
+
Protocol does not exist:
+
existence_error(protocol, Protocol)
+
+
+ +

Examples

+ +
+
+| ?- abolish_protocol(listp).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/category_property2.html b/Logtalk/manuals/refman/builtins/category_property2.html new file mode 100644 index 000000000..acbbb5c94 --- /dev/null +++ b/Logtalk/manuals/refman/builtins/category_property2.html @@ -0,0 +1,66 @@ + + + + + + category_property/2 + + + + + +
+

category_property/2

+
+ +

Description

+ +
+
+category_property(Category, Property)
+
+

+ Enumerates, by backtracking, the properties associated with the defined categories. +

+
+ +

Template and modes

+ +
+
+category_property(?category_identifier, ?category_property)
+
+
+ +

Errors

+ +
+
+
Category is neither a variable nor a valid category identifier:
+
type_error(category_identifier, Category)
+
Property is neither a variable nor a valid category property:
+
domain_error(category_property, Property)
+
+
+ +

Examples

+ +
+
+| ?- category_property(Category, dynamic).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/create_category4.html b/Logtalk/manuals/refman/builtins/create_category4.html new file mode 100644 index 000000000..43ec50d71 --- /dev/null +++ b/Logtalk/manuals/refman/builtins/create_category4.html @@ -0,0 +1,76 @@ + + + + + + create_category/4 + + + + + +
+

create_category/4

+
+ +

Description

+ +
+
+create_category(Identifier, Relations, Directives, Clauses)
+
+

+ Creates a new, dynamic, category. +

+
+ +

Template and modes

+ +
+
+create_category(+category_identifier, +list, +list, +list)
+
+
+ +

Errors

+ +
+
+
Identifier is a variable:
+
instantiation_error
+
Identifier is not a valid category identifier:
+
type_error(category_identifier, Identifier)
+
Identifier is already in use:
+
permission_error(replace, category, Identifier)
+
permission_error(replace, object, Identifier)
+
permission_error(replace, protocol, Identifier)
+
Relations is not a list:
+
type_error(list, Relations)
+
Directives is not a list:
+
type_error(list, Directives)
+
Clauses is not a list:
+
type_error(list, Clauses)
+
+
+ +

Examples

+ +
+
+| ?- create_category(foo, [implements(bar)], [], [bar(1), bar(2)]).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/create_object4.html b/Logtalk/manuals/refman/builtins/create_object4.html new file mode 100644 index 000000000..7ffdca4a3 --- /dev/null +++ b/Logtalk/manuals/refman/builtins/create_object4.html @@ -0,0 +1,76 @@ + + + + + + create_object/4 + + + + + +
+

create_object/4

+
+ +

Description

+ +
+
+create_object(Identifier, Relations, Directives, Clauses)
+
+

+ Creates a new, dynamic, object. +

+
+ +

Template and modes

+ +
+
+create_object(+object_identifier, +list, +list, +list)
+
+
+ +

Errors

+ +
+
+
Identifier is a variable:
+
instantiation_error
+
Identifier is not a valid object identifier:
+
type_error(object_identifier, Identifier)
+
Identifier is already in use:
+
permission_error(replace, category, Identifier)
+
permission_error(replace, object, Identifier)
+
permission_error(replace, protocol, Identifier)
+
Relations is not a list:
+
type_error(list, Relations)
+
Directives is not a list:
+
type_error(list, Directives)
+
Clauses is not a list:
+
type_error(list, Clauses)
+
+
+ +

Examples

+ +
+
+| ?- create_object(foo, [extends(bar)], [public(foo/1)], [foo(1), foo(2)]).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/create_protocol3.html b/Logtalk/manuals/refman/builtins/create_protocol3.html new file mode 100644 index 000000000..1968ac9db --- /dev/null +++ b/Logtalk/manuals/refman/builtins/create_protocol3.html @@ -0,0 +1,74 @@ + + + + + + create_protocol/3 + + + + + +
+

create_protocol/3

+
+ +

Description

+ +
+
+create_protocol(Identifier, Relations, Directives)
+
+

+ Creates a new, dynamic, protocol. +

+
+ +

Template and modes

+ +
+
+create_protocol(+protocol_identifier, +list, +list)
+
+
+ +

Errors

+ +
+
+
Identifier is a variable:
+
instantiation_error
+
Identifier is not a valid protocol identifier:
+
type_error(protocol_identifier, Identifier)
+
Identifier is already in use:
+
permission_error(replace, category, Identifier)
+
permission_error(replace, object, Identifier)
+
permission_error(replace, protocol, Identifier)
+
Relations is not a list:
+
type_error(list, Relations)
+
Directives is not a list:
+
type_error(list, Directives)
+
+
+ +

Examples

+ +
+
+| ?- create_protocol(foo, [extends(bar)], [public(foo/1)]).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/current_category1.html b/Logtalk/manuals/refman/builtins/current_category1.html new file mode 100644 index 000000000..0519cd75c --- /dev/null +++ b/Logtalk/manuals/refman/builtins/current_category1.html @@ -0,0 +1,64 @@ + + + + + + current_category/1 + + + + + +
+

current_category/1

+
+ +

Description

+ +
+
+current_category(Category)
+
+

+ Enumerates, by backtracking, all currently defined categories. All categories are found, either static, dynamic, or built-in. +

+
+ +

Template and modes

+ +
+
+current_category(?category_identifier)
+
+
+ +

Errors

+ +
+
+
Category is neither a variable nor a valid category identifier:
+
type_error(category_identifier, Category)
+
+
+ +

Examples

+ +
+
+| ?- current_category(monitoring).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/current_event5.html b/Logtalk/manuals/refman/builtins/current_event5.html new file mode 100644 index 000000000..705dfc89e --- /dev/null +++ b/Logtalk/manuals/refman/builtins/current_event5.html @@ -0,0 +1,72 @@ + + + + + + current_event/5 + + + + + +
+

current_event/5

+
+ +

Description

+ +
+
+current_event(Event, Object, Message, Sender, Monitor)
+
+

+ Enumerates, by backtracking, all defined events. +

+
+ +

Template and modes

+ +
+
+current_event(?event, ?object_identifier, ?callable, ?object_identifier, ?object_identifier)
+
+
+ +

Errors

+ +
+
+
Event is neither a variable nor a valid event identifier:
+
type_error(event, Event)
+
Object is neither a variable nor a valid object identifier:
+
type_error(object_identifier, Object)
+
Message is neither a variable nor a callable term:
+
type_error(callable, Message)
+
Sender is neither a variable nor a valid object identifier:
+
type_error(object_identifier, Sender)
+
Monitor is neither a variable nor a valid object identifier:
+
type_error(object_identifier, Monitor)
+
+
+ +

Examples

+ +
+
+| ?- current_event(Event, Object, Message, Sender, debugger).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/current_object1.html b/Logtalk/manuals/refman/builtins/current_object1.html new file mode 100644 index 000000000..46908632d --- /dev/null +++ b/Logtalk/manuals/refman/builtins/current_object1.html @@ -0,0 +1,64 @@ + + + + + + current_object/1 + + + + + +
+

current_object/1

+
+ +

Description

+ +
+
+current_object(Object)
+
+

+ Enumerates, by backtracking, all currently defined objects. All objects are found, either static, dynamic or built-in. +

+
+ +

Template and modes

+ +
+
+current_object(?object_identifier)
+
+
+ +

Errors

+ +
+
+
Object is neither a variable nor a valid object identifier:
+
type_error(object_identifier, Object)
+
+
+ +

Examples

+ +
+
+| ?- current_object(list).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/current_protocol1.html b/Logtalk/manuals/refman/builtins/current_protocol1.html new file mode 100644 index 000000000..c0549da85 --- /dev/null +++ b/Logtalk/manuals/refman/builtins/current_protocol1.html @@ -0,0 +1,64 @@ + + + + + + current_protocol/1 + + + + + +
+

current_protocol/1

+
+ +

Description

+ +
+
+current_protocol(Protocol)
+
+

+ Enumerates, by backtracking, all currently defined protocols. All protocols are found, either static, dynamic, or built-in. +

+
+ +

Template and modes

+ +
+
+current_protocol(?protocol_identifier)
+
+
+ +

Errors

+ +
+
+
Protocol is neither a variable nor a valid protocol identifier:
+
type_error(protocol_identifier, Protocol)
+
+
+ +

Examples

+ +
+
+| ?- current_protocol(listp).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/define_events5.html b/Logtalk/manuals/refman/builtins/define_events5.html new file mode 100644 index 000000000..92a600af6 --- /dev/null +++ b/Logtalk/manuals/refman/builtins/define_events5.html @@ -0,0 +1,74 @@ + + + + + + define_events/2 + + + + + +
+

define_events/5

+
+ +

Description

+ +
+
+define_events(Event, Object, Message, Sender, Monitor)
+
+

+ Defines a new set of events. +

+
+ +

Template and modes

+ +
+
+define_events(@event, @object_identifier, @callable, @object_identifier, +object_identifier)
+
+
+ +

Errors

+ +
+
+
Event is neither a variable nor a valid event identifier:
+
type_error(event, Event)
+
Object is neither a variable nor a valid object identifier:
+
type_error(object_identifier, Object)
+
Message is neither a variable nor a callable term:
+
type_error(callable, Message)
+
Sender is neither a variable nor a valid object identifier:
+
type_error(object_identifier, Sender)
+
Monitor is a variable:
+
instantiation_error
+
Monitor is neither a variable nor a valid object identifier:
+
type_error(object_identifier, Monitor)
+
+
+ +

Examples

+ +
+
+| ?- define_events(_, list, member(_, _), _ , debugger).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/extends_object2_3.html b/Logtalk/manuals/refman/builtins/extends_object2_3.html new file mode 100644 index 000000000..5d3f2f79e --- /dev/null +++ b/Logtalk/manuals/refman/builtins/extends_object2_3.html @@ -0,0 +1,74 @@ + + + + + + extends_object/2-3 + + + + + +
+

extends_object/2-3

+
+ +

Description

+ +
+
+extends_object(Prototype, Parent)
+
+extends_object(Prototype, Parent, Scope)
+
+

+ Enumerates, by backtracking, all pairs of objects such that the first one extends the second. +

+
+ +

Template and modes

+ +
+
+extends_object(?object_identifier, ?object_identifier)
+
+extends_object(?object_identifier, ?object_identifier, ?entity_scope)
+
+
+ +

Errors

+ +
+
+
Prototype is neither a variable nor a valid object identifier:
+
type_error(object_identifier, Prototype)
+
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)
+
+
+ +

Examples

+ +
+
+| ?- extends_object(Object, state_space).
+
+| ?- extends_object(Object, list, public).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/extends_protocol2_3.html b/Logtalk/manuals/refman/builtins/extends_protocol2_3.html new file mode 100644 index 000000000..3079be828 --- /dev/null +++ b/Logtalk/manuals/refman/builtins/extends_protocol2_3.html @@ -0,0 +1,74 @@ + + + + + + extends_protocol/2-3 + + + + + +
+

extends_protocol/2-3

+
+ +

Description

+ +
+
+extends_protocol(Protocol1, Protocol2)
+
+extends_protocol(Protocol1, Protocol2, Scope)
+
+

+ Enumerates, by backtracking, all pairs of protocols such that the first one extends the second. +

+
+ +

Template and modes

+ +
+
+extends_protocol(?protocol_identifier, ?protocol_identifier)
+
+extends_protocol(?protocol_identifier, ?protocol_identifier, ?entity_scope)
+
+
+ +

Errors

+ +
+
+
Protocol1 is neither a variable nor a valid protocol identifier:
+
type_error(protocol_identifier, Protocol1)
+
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)
+
+
+ +

Examples

+ +
+
+| ?- extends_protocol(listp, Protocol).
+
+| ?- extends_protocol(Protocol, termp, private).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/forall2.html b/Logtalk/manuals/refman/builtins/forall2.html new file mode 100644 index 000000000..98244d528 --- /dev/null +++ b/Logtalk/manuals/refman/builtins/forall2.html @@ -0,0 +1,66 @@ + + + + + + forall/2 + + + + + +
+

forall/2

+
+ +

Description

+ +
+
+forall(Generator, Test)
+
+

+ This predicate is true if, for all solutions of Generator, Test is true (some Prolog compilers already define this or a similar predicate). +

+
+ +

Template and modes

+ +
+
+forall(+callable, +callable)
+
+
+ +

Errors

+ +
+
+
Generator is not a callable term:
+
type_error(callable, Generator)
+
Test is not a callable term:
+
type_error(callable, Test)
+
+
+ +

Examples

+ +
+
+| ?- forall(member(X, [1, 2, 3]), write(X)).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/implements_protocol2_3.html b/Logtalk/manuals/refman/builtins/implements_protocol2_3.html new file mode 100644 index 000000000..bedad917c --- /dev/null +++ b/Logtalk/manuals/refman/builtins/implements_protocol2_3.html @@ -0,0 +1,80 @@ + + + + + + implements_protocol/2-3 + + + + + +
+

implements_protocol/2-3

+
+ +

Description

+ +
+
+implements_protocol(Object, Protocol)
+implements_protocol(Category, Protocol)
+
+implements_protocol(Object, Protocol, Scope)
+implements_protocol(Category, Protocol, Scope)
+
+

+ Enumerates, by backtracking, all pairs of entities such that an object or a category implements a protocol. +

+
+ +

Template and modes

+ +
+
+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)
+
+
+ +

Errors

+ +
+
+
Object is neither a variable nor a valid object identifier:
+
type_error(object_identifier, Object)
+
Category is neither a variable nor a valid category identifier:
+
type_error(category_identifier, Category)
+
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)
+
+
+ +

Examples

+ +
+
+| ?- implements_protocol(List, listp).
+
+| ?- implements_protocol(List, listp, public).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/imports_category2_3.html b/Logtalk/manuals/refman/builtins/imports_category2_3.html new file mode 100644 index 000000000..1996d4f71 --- /dev/null +++ b/Logtalk/manuals/refman/builtins/imports_category2_3.html @@ -0,0 +1,74 @@ + + + + + + imports_category/2-3 + + + + + +
+

imports_category/2-3

+
+ +

Description

+ +
+
+imports_category(Object, Category)
+
+imports_category(Object, Category, Scope)
+
+

+ Enumerates, by backtracking, all pairs of objects and categories such that the first one imports the other. +

+
+ +

Template and modes

+ +
+
+imports_category(?object_identifier, ?category_identifier)
+
+imports_category(?object_identifier, ?category_identifier, ?entity_scope)
+
+
+ +

Errors

+ +
+
+
Object is neither a variable nor a valid object identifier:
+
type_error(object_identifier, Object)
+
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)
+
+
+ +

Examples

+ +
+
+| ?- imports_category(debugger, monitoring).
+
+| ?- imports_category(Object, monitoring, protected).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/instantiates_class2_3.html b/Logtalk/manuals/refman/builtins/instantiates_class2_3.html new file mode 100644 index 000000000..156842ada --- /dev/null +++ b/Logtalk/manuals/refman/builtins/instantiates_class2_3.html @@ -0,0 +1,74 @@ + + + + + + instantiates_class/2-3 + + + + + +
+

instantiates_class/2-3

+
+ +

Description

+ +
+
+instantiates_class(Instance, Class)
+
+instantiates_class(Instance, Class, Scope)
+
+

+ Enumerates, by backtracking, all pairs of objects such that the first one instantiates the second. +

+
+ +

Template and modes

+ +
+
+instantiates_class(?object_identifier, ?object_identifier)
+
+instantiates_class(?object_identifier, ?object_identifier, ?entity_scope)
+
+
+ +

Errors

+ +
+
+
Instance is neither a variable nor a valid object identifier:
+
type_error(object_identifier, Instance)
+
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)
+
+
+ +

Examples

+ +
+
+| ?- instantiates_class(water_jug, state_space).
+
+| ?- instantiates_class(Space, state_space, public).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/logtalk_compile1.html b/Logtalk/manuals/refman/builtins/logtalk_compile1.html new file mode 100644 index 000000000..ee15c05aa --- /dev/null +++ b/Logtalk/manuals/refman/builtins/logtalk_compile1.html @@ -0,0 +1,73 @@ + + + + + + logtalk_compile/1 + + + + + +
+

logtalk_compile/1

+
+ +

Description

+ +
+
+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. + +

+
+ +

Template and modes

+ +
+
+logtalk_compile(+atom_list)
+
+
+ +

Errors

+ +
+
+
Entities is a variable:
+
instantiation_error
+
Entities is neither a variable nor a proper list:
+
type_error(list, Entities)
+
One of the entities is not an atom:
+
type_error(atom, Entity)
+
One of the entities does not exist in the current working directory:
+
existence_error(entity, Entity)
+
+
+ +

Examples

+ +
+
+| ?- logtalk_compile([tree]).
+
+| ?- logtalk_compile([listp, list]).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: October 1, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/logtalk_compile2.html b/Logtalk/manuals/refman/builtins/logtalk_compile2.html new file mode 100644 index 000000000..af56c4a51 --- /dev/null +++ b/Logtalk/manuals/refman/builtins/logtalk_compile2.html @@ -0,0 +1,79 @@ + + + + + + logtalk_compile/2 + + + + + +
+

logtalk_compile/2

+
+ +

Description

+ +
+
+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. + +

+
+ +

Template and modes

+ +
+
+logtalk_compile(+atom_list, +list)
+
+
+ +

Errors

+ +
+
+
Entities is a variable:
+
instantiation_error
+
Entities is neither a variable nor a proper list:
+
type_error(list, Entities)
+
One of the entities is not an atom:
+
type_error(atom, Entity)
+
One of the entities does not exist in the current working directory:
+
existence_error(entity, Entity)
+
Options is a variable:
+
instantiation_error
+
Options is neither a variable nor a list:
+
type_error(list, Options)
+
One of the options is not valid:
+
type_error(compiler_option, Option)
+
+
+ +

Examples

+ +
+
+| ?- logtalk_compile([list], []).
+
+| ?- logtalk_compile([listp, list], [xml(off), plredf(warning)]).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: October 1, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/logtalk_load1.html b/Logtalk/manuals/refman/builtins/logtalk_load1.html new file mode 100644 index 000000000..35467f086 --- /dev/null +++ b/Logtalk/manuals/refman/builtins/logtalk_load1.html @@ -0,0 +1,73 @@ + + + + + + logtalk_load/1 + + + + + +
+

logtalk_load/1

+
+ +

Description

+ +
+
+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. + +

+
+ +

Template and modes

+ +
+
+logtalk_load(+atom_list)
+
+
+ +

Errors

+ +
+
+
Entities is a variable:
+
instantiation_error
+
Entities is neither a variable nor a proper list:
+
type_error(list, Entities)
+
One of the entities is not an atom:
+
type_error(atom, Entity)
+
One of the entities does not exist in the current working directory:
+
existence_error(entity, Entity)
+
+
+ +

Examples

+ +
+
+| ?- logtalk_load([tree]).
+
+| ?- logtalk_load([listp, list]).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: October 1, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/logtalk_load2.html b/Logtalk/manuals/refman/builtins/logtalk_load2.html new file mode 100644 index 000000000..4f32f15ad --- /dev/null +++ b/Logtalk/manuals/refman/builtins/logtalk_load2.html @@ -0,0 +1,78 @@ + + + + + + logtalk_load/2 + + + + + +
+

logtalk_load/2

+
+ +

Description

+ +
+
+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. +

+
+ +

Template and modes

+ +
+
+logtalk_load(+atom_list, +list)
+
+
+ +

Errors

+ +
+
+
Entities is a variable:
+
instantiation_error
+
Entities is neither a variable nor a proper list:
+
type_error(list, Entities)
+
One of the entities is not an atom:
+
type_error(atom, Entity)
+
One of the entities does not exist in the current working directory:
+
existence_error(entity, Entity)
+
Options is a variable:
+
instantiation_error
+
Options is neither a variable nor a list:
+
type_error(list, Options)
+
One of the options is not valid:
+
type_error(compiler_option, Option)
+
+
+ +

Examples

+ +
+
+| ?- logtalk_load([list], []).
+
+| ?- logtalk_load([listp, list], [xml(off), plredf(warning)]).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: October 1, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/logtalk_version3.html b/Logtalk/manuals/refman/builtins/logtalk_version3.html new file mode 100644 index 000000000..8743ceb9c --- /dev/null +++ b/Logtalk/manuals/refman/builtins/logtalk_version3.html @@ -0,0 +1,68 @@ + + + + + + logtalk_version/3 + + + + + +
+

logtalk_version/3

+
+ +

Description

+ +
+
+logtalk_version(Major, Minor, Patch)
+
+

+ Returns the Logtalk pre-processor and runtime version. +

+
+ +

Template and modes

+ +
+
+logtalk_version(?integer, ?integer, ?integer)
+
+
+ +

Errors

+ +
+
+
Major is neither a variable nor an integer:
+
type_error(integer, Major)
+
Minor is neither a variable nor an integer:
+
type_error(integer, Minor)
+
Patch is neither a variable nor an integer:
+
type_error(integer, Patch)
+
+
+ +

Examples

+ +
+
+| ?- logtalk_version(Major, Minor, Patch).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/object_property2.html b/Logtalk/manuals/refman/builtins/object_property2.html new file mode 100644 index 000000000..36075294a --- /dev/null +++ b/Logtalk/manuals/refman/builtins/object_property2.html @@ -0,0 +1,66 @@ + + + + + + object_property/2 + + + + + +
+

object_property/2

+
+ +

Description

+ +
+
+object_property(Object, Property)
+
+

+ Enumerates, by backtracking, the properties associated with the defined objects. +

+
+ +

Template and modes

+ +
+
+object_property(?object_identifier, ?object_property)
+
+
+ +

Errors

+ +
+
+
Object is neither a variable nor a valid object identifier:
+
type_error(object_identifier, Object)
+
Property is neither a variable nor a valid object property:
+
domain_error(object_property, Property)
+
+
+ +

Examples

+ +
+
+| ?- object_property(list, Property).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/protocol_property2.html b/Logtalk/manuals/refman/builtins/protocol_property2.html new file mode 100644 index 000000000..4b39d14c9 --- /dev/null +++ b/Logtalk/manuals/refman/builtins/protocol_property2.html @@ -0,0 +1,66 @@ + + + + + + protocol_property/2 + + + + + +
+

protocol_property/2

+
+ +

Description

+ +
+
+protocol_property(Protocol, Property)
+
+

+ Enumerates, by backtracking, the properties associated with the currently defined protocols. +

+
+ +

Template and modes

+ +
+
+protocol_property(?protocol_identifier, ?protocol_property)
+
+
+ +

Errors

+ +
+
+
Protocol is neither a variable nor a valid protocol identifier:
+
type_error(protocol_identifier, Protocol)
+
Property is neither a variable nor a valid protocol property:
+
domain_error(protocol_property, Property)
+
+
+ +

Examples

+ +
+
+| ?- protocol_property(listp, Property).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/retractall1.html b/Logtalk/manuals/refman/builtins/retractall1.html new file mode 100644 index 000000000..c6e31ae71 --- /dev/null +++ b/Logtalk/manuals/refman/builtins/retractall1.html @@ -0,0 +1,64 @@ + + + + + + retractall/1 + + + + + +
+

retractall/1

+
+ +

Description

+ +
+
+retractall(Head)
+
+

+ Logtalk adds this built-in predicate, with the usual definition, to a Prolog compiler if it is not already defined. +

+
+ +

Template and modes

+ +
+
+retractall(+callable)
+
+
+ +

Errors

+ +
+
+
Head is not a callable term:
+
type_error(callable, Head)
+
+
+ +

Examples

+ +
+
+| ?- retractall(foo(_)).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/builtins/specializes_class2_3.html b/Logtalk/manuals/refman/builtins/specializes_class2_3.html new file mode 100644 index 000000000..b030c81f3 --- /dev/null +++ b/Logtalk/manuals/refman/builtins/specializes_class2_3.html @@ -0,0 +1,74 @@ + + + + + + specializes_class/2-3 + + + + + +
+

specializes_class/2-3

+
+ +

Description

+ +
+
+specializes_class(Class, Superclass)
+
+specializes_class(Class, Superclass, Scope)
+
+

+ Enumerates, by backtracking, all pairs of objects such that the first one specializes the second. +

+
+ +

Template and modes

+ +
+
+specializes_class(?object_identifier, ?object_identifier)
+
+specializes_class(?object_identifier, ?object_identifier, ?entity_scope)
+
+
+ +

Errors

+ +
+
+
Class is neither a variable nor a valid object identifier:
+
type_error(object_identifier, Class)
+
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)
+
+
+ +

Examples

+ +
+
+| ?- specializes_class(Subclass, state_space).
+
+| ?- specializes_class(Subclass, state_space, public).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/control/external1.html b/Logtalk/manuals/refman/control/external1.html new file mode 100644 index 000000000..f1e161955 --- /dev/null +++ b/Logtalk/manuals/refman/control/external1.html @@ -0,0 +1,64 @@ + + + + + + {}/1 + + + + + +
+

{}/1

+
+ +

Description

+ +
+
+{Goal}
+
+

+ Calls external Prolog code. Can be used to bypass the Logtalk pre-processor/compiler. +

+
+ +

Template and modes

+ +
+
+{+callable}
+
+
+ +

Errors

+ +
+

+ (none) +

+
+ +

Examples

+ +
+
+N1/D1 < N2/D2 :-
+    {N1*D2 < N2*D1}.
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: October 8, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/control/to_object2.html b/Logtalk/manuals/refman/control/to_object2.html new file mode 100644 index 000000000..818361633 --- /dev/null +++ b/Logtalk/manuals/refman/control/to_object2.html @@ -0,0 +1,81 @@ + + + + + + ::/2 + + + + + +
+ +

::/2

+
+ +

Description

+ +
+
+Object::Predicate
+
+(Object1, Object2, ...)::Predicate
+
+(Object1; Object2, ...)::Predicate
+
+Object::(Predicate1, Predicate2, ...)
+
+Object::(Predicate1; Predicate2; ...)
+
+

+Sends a message to an object. The message argument must match a public predicate of the receiver object. We can also send the same message to a set of objects or a set of messages to the same object. The "," and ";" in the list have the usual Prolog meaning. +

+
+ +

Template and modes

+ +
+
++receivers::+messages
+
+
+ +

Errors

+ +
+
+
Either Object or Predicate is a variable:
+
instantiation_error
+
Predicate is declared private:
+
permission_error(access, private_predicate, Predicate)
+
Predicate is declared protected:
+
permission_error(access, protected_predicate, Predicate)
+
Predicate is not declared:
+
existence_error(predicate_declaration, Predicate)
+
Object does not exist:
+
existence_error(object, Object)
+
+
+ +

Examples

+ +
+
+| ?- list::member(X, [1, 2, 3]).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: October 7, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/control/to_self1.html b/Logtalk/manuals/refman/control/to_self1.html new file mode 100644 index 000000000..3226e630c --- /dev/null +++ b/Logtalk/manuals/refman/control/to_self1.html @@ -0,0 +1,75 @@ + + + + + + ::/1 + + + + + +
+

::/1

+
+ +

Description

+ +
+
+::Predicate
+
+::(Predicate1, Predicate2, ...)
+
+::(Predicate1; Predicate2; ...)
+
+

+ Send a message to self. Only used in the body of a predicate definition. The argument should match a public or protected predicate of self. It may also match a private predicate if the predicate is imported from a category, if used from inside a category, or when using private inheritance. We can also send a set of messages to self. The "," and ";" in the list have the usual Prolog meaning. +

+
+ +

Template and modes

+ +
+
+::+messages
+
+
+ +

Errors

+ +
+
+
Predicate is a variable:
+
instantiation_error
+
Predicate is declared private:
+
permission_error(access, private_predicate, Predicate)
+
Predicate is not declared:
+
existence_error(predicate_declaration, Predicate)
+
+
+ +

Examples

+ +
+
+area(Area) :-
+    ::width(Width),
+    ::height(Height),
+    Area is Width*Height.
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: October 8, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/control/to_super1.html b/Logtalk/manuals/refman/control/to_super1.html new file mode 100644 index 000000000..5a1350395 --- /dev/null +++ b/Logtalk/manuals/refman/control/to_super1.html @@ -0,0 +1,72 @@ + + + + + + ^^/1 + + + + + +
+

^^/1

+
+ +

Description

+ +
+
+^^Predicate
+
+

+ Calls a redefined/inherited definition for a message. Normally only used in the body of a predicate definition for the message. Predicate should match a public or protected predicate of self or be within the scope of this. +

+
+ +

Template and modes

+ +
+
+^^+message
+
+
+ +

Errors

+ +
+
+
Predicate is a variable:
+
instantiation_error
+
Predicate is declared private:
+
permission_error(access, private_predicate, Predicate)
+
Predicate is not declared:
+
existence_error(predicate_declaration, Predicate)
+
Container of the inherited predicate definition is the same object that contains the ^^/1 call:
+
endless_loop(Predicate)
+
+
+ +

Examples

+ +
+
+init :-
+        assertz(counter(0)),
+        ^^init.
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/calls1.html b/Logtalk/manuals/refman/directives/calls1.html new file mode 100644 index 000000000..ab45ece40 --- /dev/null +++ b/Logtalk/manuals/refman/directives/calls1.html @@ -0,0 +1,58 @@ + + + + + + calls/1 + + + + + +
+

calls/1

+
+ +

Description

+ +
+
+calls(Protocol)
+calls(Protocol1, Protocol2, ...)
+calls([Protocol1, Protocol2, ...])
+
+

+ Declares the protocol(s) that are called by predicates defined in an object or category. +

+
+ +

Template and modes

+ +
+
+calls(+protocol_identifiers)
+
+
+ + +

Examples

+ +
+
+:- calls(comparingp).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/category1_2.html b/Logtalk/manuals/refman/directives/category1_2.html new file mode 100644 index 000000000..d81b4f449 --- /dev/null +++ b/Logtalk/manuals/refman/directives/category1_2.html @@ -0,0 +1,68 @@ + + + + + + category/1-2 + + + + + +
+

category/1-2

+
+ +

Description

+ +
+
+category(Category)
+
+category(Category,
+    implements(Protocols))
+
+

+ Starting category directive. +

+
+ +

Template and modes

+ +
+
+category(+category_identifier)
+
+category(+category_identifier,
+    implements(+implemented_protocols))
+
+
+ + +

Examples

+ +
+
+:- category(monitoring).
+
+:- category(monitoring,
+    implements(monitoringp)).
+
+:- category(attributes,
+    implements(protected::variables)).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/discontiguous1.html b/Logtalk/manuals/refman/directives/discontiguous1.html new file mode 100644 index 000000000..c573ce229 --- /dev/null +++ b/Logtalk/manuals/refman/directives/discontiguous1.html @@ -0,0 +1,62 @@ + + + + + + discontiguous/1 + + + + + +
+

discontiguous/1

+
+ +

Description

+ +
+
+discontiguous(Predicate)
+discontiguous(Predicate1, Predicate2, ...)
+discontiguous([Predicate1, Predicate2, ...])
+
+

+ Declares discontiguous predicates. +

+
+ +

Template and modes

+ +
+
+discontiguous(+predicate_indicator_term)
+
+
+ + +

Examples

+ +
+
+:- discontiguous(counter/1).
+
+:- discontiguous(lives/2, works/2).
+
+:- discontiguous([db/4, key/2, file/3]).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/dynamic0.html b/Logtalk/manuals/refman/directives/dynamic0.html new file mode 100644 index 000000000..90a09d9f9 --- /dev/null +++ b/Logtalk/manuals/refman/directives/dynamic0.html @@ -0,0 +1,56 @@ + + + + + + dynamic/0 + + + + + +
+

dynamic/0

+
+ +

Description

+ +
+
+dynamic
+
+

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

+
+ +

Template and modes

+ +
+
+dynamic
+
+
+ + +

Examples

+ +
+
+:- dynamic.
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/dynamic1.html b/Logtalk/manuals/refman/directives/dynamic1.html new file mode 100644 index 000000000..de60f908a --- /dev/null +++ b/Logtalk/manuals/refman/directives/dynamic1.html @@ -0,0 +1,62 @@ + + + + + + dynamic/1 + + + + + +
+

dynamic/1

+
+ +

Description

+ +
+
+dynamic(Predicate)
+dynamic(Predicate1, Predicate2, ...)
+dynamic([Predicate1, Predicate2, ...])
+
+

+ Declares dynamic predicates. Note that an object can be static and have both static and dynamic predicates. +

+
+ +

Template and modes

+ +
+
+dynamic(+predicate_indicator_term)
+
+
+ + +

Examples

+ +
+
+:- dynamic(counter/1).
+
+:- dynamic(lives/2, works/2).
+
+:- dynamic([db/4, key/2, file/3]).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/end_category0.html b/Logtalk/manuals/refman/directives/end_category0.html new file mode 100644 index 000000000..a0e9b2cb4 --- /dev/null +++ b/Logtalk/manuals/refman/directives/end_category0.html @@ -0,0 +1,56 @@ + + + + + + end_category/0 + + + + + +
+

end_category/0

+
+ +

Description

+ +
+
+end_category
+
+

+ Ending category directive. +

+
+ +

Template and modes

+ +
+
+end_category
+
+
+ + +

Examples

+ +
+
+:- end_category.
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/end_object0.html b/Logtalk/manuals/refman/directives/end_object0.html new file mode 100644 index 000000000..025c14ee6 --- /dev/null +++ b/Logtalk/manuals/refman/directives/end_object0.html @@ -0,0 +1,56 @@ + + + + + + end_object/0 + + + + + +
+

end_object/0

+
+ +

Description

+ +
+
+end_object
+
+

+ Ending object directive. +

+
+ +

Template and modes

+ +
+
+end_object
+
+
+ + +

Examples

+ +
+
+:- end_object.
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/end_protocol0.html b/Logtalk/manuals/refman/directives/end_protocol0.html new file mode 100644 index 000000000..2afeb9ab1 --- /dev/null +++ b/Logtalk/manuals/refman/directives/end_protocol0.html @@ -0,0 +1,56 @@ + + + + + + end_protocol/0 + + + + + +
+

end_protocol/0

+
+ +

Description

+ +
+
+end_protocol
+
+

+ Ending protocol directive. +

+
+ +

Template and modes

+ +
+
+end_protocol
+
+
+ + +

Examples

+ +
+
+:- end_protocol.
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/info1.html b/Logtalk/manuals/refman/directives/info1.html new file mode 100644 index 000000000..d2fddb799 --- /dev/null +++ b/Logtalk/manuals/refman/directives/info1.html @@ -0,0 +1,60 @@ + + + + + + info/1 + + + + + +
+

info/1

+
+ +

Description

+ +
+
+info(List)
+
+

+ Documentation directive for objects, protocols, and categories. +

+
+ +

Template and modes

+ +
+
+info(+info_list)
+
+
+ + +

Examples

+ +
+
+:- info([
+    version is 1.0,
+    authors is 'Paulo Moura',
+    date is 2000/4/20,
+    comment is 'List protocol.']).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/info2.html b/Logtalk/manuals/refman/directives/info2.html new file mode 100644 index 000000000..5e549e2f0 --- /dev/null +++ b/Logtalk/manuals/refman/directives/info2.html @@ -0,0 +1,59 @@ + + + + + + info/2 + + + + + +
+ +

info/2

+
+ +

Description

+ +
+
+info(Functor/Arity, List)
+
+

+ Documentation directive for predicates. +

+
+ +

Template and modes

+ +
+
+info(+predicate_indicator, +info_list)
+
+
+ +

Examples

+ +
+
+:- info(empty/1, [
+    comment is 'True if the argument is an empty list.',
+    argnames is ['List']]).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+ +
+ + + + diff --git a/Logtalk/manuals/refman/directives/initialization1.html b/Logtalk/manuals/refman/directives/initialization1.html new file mode 100644 index 000000000..46af7e542 --- /dev/null +++ b/Logtalk/manuals/refman/directives/initialization1.html @@ -0,0 +1,56 @@ + + + + + + initialization/1 + + + + + +
+

initialization/1

+
+ +

Description

+ +
+
+initialization(Goal)
+
+

+ Sets a goal to be called immediately after the container entity has been loaded to memory. +

+
+ +

Template and modes

+ +
+
+initialization(@goal)
+
+
+ + +

Examples

+ +
+
+:- initialization(init).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/metapredicate1.html b/Logtalk/manuals/refman/directives/metapredicate1.html new file mode 100644 index 000000000..eda5cec11 --- /dev/null +++ b/Logtalk/manuals/refman/directives/metapredicate1.html @@ -0,0 +1,58 @@ + + + + + + metapredicate/1 + + + + + +
+

metapredicate/1

+
+ +

Description

+ +
+
+metapredicate(Metapredicate)
+
+

+ Declares metapredicates, i.e., predicates that have arguments that will be called as goals. +

+
+ +

Template and modes

+ +
+
+metapredicate(+metapredicate_predicate_term)
+
+
+ + +

Examples

+ +
+
+:- metapredicate(findall(*, ::, *)).
+
+:- metapredicate(forall(::, ::)).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/mode2.html b/Logtalk/manuals/refman/directives/mode2.html new file mode 100644 index 000000000..f12f39a45 --- /dev/null +++ b/Logtalk/manuals/refman/directives/mode2.html @@ -0,0 +1,63 @@ + + + + + + mode/2 + + + + + +
+ +

mode/2

+
+ +

Description

+ +
+
+mode(Mode, Number_of_solutions)
+
+

+ Most predicates can be used with several instantiations modes. This directive enables the specification of each instantiation mode and the corresponding number of solutions/proofs. +

+
+ +

Template and modes

+ +
+
+mode(+predicate_mode_term, +number_of_solutions)
+
+
+ +

Examples

+ +
+
+:- mode(append(-, -, +), zero_or_more).
+
+:- mode(append(+list, +list, -list), zero_or_one).
+
+:- mode(var(@term), zero_or_one).
+
+:- mode(arg(-, -, +), error).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+ +
+ + + + diff --git a/Logtalk/manuals/refman/directives/object1_4.html b/Logtalk/manuals/refman/directives/object1_4.html new file mode 100644 index 000000000..f74abaf6d --- /dev/null +++ b/Logtalk/manuals/refman/directives/object1_4.html @@ -0,0 +1,272 @@ + + + + + + object/1-4 + + + + + +
+

object/1-4

+
+ +

Description

+ +
+

+ Stand-alone objects +

+
+object(Object)
+
+object(Object,
+    implements(Protocols))
+
+object(Object,
+    imports(Categories))
+
+object(Object,
+    implements(Protocols),
+    imports(Categories))
+
+

+ Prototypes +

+
+object(Object,
+    extends(Objects))
+
+object(Object,
+    implements(Protocols),
+    extends(Objects))
+
+object(Object,
+    imports(Categories),
+    extends(Objects))
+
+object(Object,
+    implements(Protocols),
+    imports(Categories),
+    extends(Objects))
+
+

+ Instances +

+
+object(Object,
+    instantiates(Classes))
+
+object(Object,
+    implements(Protocols),
+    instantiates(Classes))
+
+object(Object,
+    imports(Categories),
+    instantiates(Classes))
+
+object(Object,
+    implements(Protocols),
+    imports(Categories),
+    instantiates(Classes))
+
+

+ Classes +

+
+object(Object,
+    specializes(Classes))
+
+object(Object,
+    implements(Protocols),
+    specializes(Classes))
+
+object(Object,
+    imports(Categories),
+    specializes(Classes))
+
+object(Object,
+    implements(Protocols),
+    imports(Categories),
+    specializes(Classes))
+
+

+ Metaclasses +

+
+object(Object,
+    instantiates(Classes),
+    specializes(Classes))
+
+object(Object,
+    implements(Protocols),
+    instantiates(Classes),
+    specializes(Classes))
+
+object(Object,
+    imports(Categories),
+    instantiates(Classes),
+    specializes(Classes))
+
+object(Object,
+    implements(Protocols),
+    imports(Categories),
+    instantiates(Classes),
+    specializes(Classes))
+
+

+ Starting object directive. +

+
+ +

Template and modes

+ +
+ +

+ Stand-alone objects +

+
+object(+object_identifier)
+
+object(+object_identifier,
+    implements(+implemented_protocols))
+
+object(+object_identifier,
+    imports(+imported_categories))
+
+object(+object_identifier,
+    implements(+implemented_protocols),
+    imports(+imported_categories))
+
+

+ Prototypes +

+
+object(+object_identifier,
+    extends(+extended_objects))
+
+object(+object_identifier,
+    implements(+implemented_protocols),
+    extends(+extended_objects))
+
+object(+object_identifier,
+    imports(+imported_categories),
+    extends(+extended_objects))
+
+object(+object_identifier,
+    implements(+implemented_protocols),
+    imports(+imported_categories),
+    extends(+extended_objects))
+
+

+ Instances +

+
+object(+object_identifier,
+    instantiates(+instantiated_objects))
+
+object(+object_identifier,
+    implements(+implemented_protocols),
+    instantiates(+instantiated_objects))
+
+object(+object_identifier,
+    imports(+imported_categories),
+    instantiates(+instantiated_objects))
+
+object(+object_identifier,
+    implements(+implemented_protocols),
+    imports(+imported_categories),
+    instantiates(+instantiated_objects))
+
+

+ Classes +

+
+object(+object_identifier,
+    specializes(+specialized_objects))
+
+object(+object_identifier,
+    implements(+implemented_protocols),
+    specializes(+specialized_objects))
+
+object(+object_identifier,
+    imports(+imported_categories),
+    specializes(+specialized_objects))
+
+object(+object_identifier,
+    implements(+implemented_protocols),
+    imports(+imported_categories),
+    specializes(+specialized_objects))
+
+

+ Metaclasses +

+
+object(+object_identifier,
+    instantiates(+instantiated_objects),
+    specializes(+specialized_objects))
+
+object(+object_identifier,
+    implements(+implemented_protocols),
+    instantiates(+instantiated_objects),
+    specializes(+specialized_objects))
+
+object(+object_identifier,
+    imports(+imported_categories),
+    instantiates(+instantiated_objects),
+    specializes(+specialized_objects))
+
+object(+object_identifier,
+    implements(+implemented_protocols),
+    imports(+imported_categories),
+    instantiates(+instantiated_objects),
+    specializes(+specialized_objects))
+
+
+ + +

Examples

+ +
+
+:- object(list).
+
+:- object(list,
+    implements(listp)).
+
+:- object(list,
+    extends(compound)).
+
+:- object(list,
+    implements(listp),
+    extends(compound)).
+
+:- object(object,
+    imports(initialization),
+    instantiates(class)).
+
+:- object(abstract_class,
+    instantiates(class),
+    specializes(object)).
+
+:- object(agent,
+    imports(private::attributes)).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/op3.html b/Logtalk/manuals/refman/directives/op3.html new file mode 100644 index 000000000..ab029f013 --- /dev/null +++ b/Logtalk/manuals/refman/directives/op3.html @@ -0,0 +1,58 @@ + + + + + op/3 + + + + + +
+

op/3

+
+ +

Description

+ +
+
+op(Precedence, Associativity, Operator)
+
+

+ Declares operators. +

+
+ +

Template and modes

+ +
+
+op(+integer, +associativity, +atom)
+
+
+ + +

Examples

+ +
+
+:- op(950, fx, +).
+:- op(950, fx, ?).
+:- op(950, fx, @).
+:- op(950, fx, -).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/private1.html b/Logtalk/manuals/refman/directives/private1.html new file mode 100644 index 000000000..3a94be09f --- /dev/null +++ b/Logtalk/manuals/refman/directives/private1.html @@ -0,0 +1,61 @@ + + + + + + private/1 + + + + + +
+

private/1

+
+ +

Description

+ +
+
+private(Predicate)
+private(Predicate1, Predicate2, ...)
+private([Predicate1, Predicate2, ...])
+
+

+ Declares private predicates. A private predicate can only be called from the object containing the private directive. +

+
+ +

Template and modes

+ +
+
+private(+predicate_indicator_term)
+
+
+ +

Examples

+ +
+
+:- private(counter/1).
+
+:- private(init/1, free/1).
+
+:- private([data/3, key/1, keys/1]).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/protected1.html b/Logtalk/manuals/refman/directives/protected1.html new file mode 100644 index 000000000..d0ccd9c39 --- /dev/null +++ b/Logtalk/manuals/refman/directives/protected1.html @@ -0,0 +1,62 @@ + + + + + + protected/1 + + + + + +
+

protected/1

+
+ +

Description

+ +
+
+protected(Predicate)
+protected(Predicate1, Predicate2, ...)
+protected([Predicate1, Predicate2, ...])
+
+

+ Declares protected predicates. A protected predicate can only be called from the object containing the declaration or from an object that inherits the declaration. +

+
+ +

Template and modes

+ +
+
+protected(+predicate_indicator_term)
+
+
+ + +

Examples

+ +
+
+:- protected(init/1).
+
+:- protected(print/2, convert/4).
+
+:- protected([load/1, save/3]).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/protocol1_2.html b/Logtalk/manuals/refman/directives/protocol1_2.html new file mode 100644 index 000000000..f04e5b003 --- /dev/null +++ b/Logtalk/manuals/refman/directives/protocol1_2.html @@ -0,0 +1,68 @@ + + + + + + protocol/1-2 + + + + + +
+

protocol/1-2

+
+ +

Description

+ +
+
+protocol(Protocol)
+
+protocol(Protocol,
+    extends(Protocols))
+
+

+ Starting protocol directive. +

+
+ +

Template and modes

+ +
+
+protocol(+protocol_identifier)
+
+protocol(+protocol_identifier,
+    extends(+extended_protocols))
+
+
+ + +

Examples

+ +
+
+:- protocol(listp).
+
+:- protocol(listp,
+    extends(compoundp)).
+
+:- protocol(queuep,
+    extends(protected::listp)).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/public1.html b/Logtalk/manuals/refman/directives/public1.html new file mode 100644 index 000000000..ef4d9bceb --- /dev/null +++ b/Logtalk/manuals/refman/directives/public1.html @@ -0,0 +1,62 @@ + + + + + + public/1 + + + + + +
+

public/1

+
+ +

Description

+ +
+
+public(Predicate)
+public(Predicate1, Predicate2, ...)
+public([Predicate1, Predicate2, ...])
+
+

+ Declares public predicates. A public predicate can be called from any object. +

+
+ +

Template and modes

+ +
+
+public(+predicate_indicator_term)
+
+
+ + +

Examples

+ +
+
+:- public(ancestor/1).
+
+:- public(instance/1, instances/1).
+
+:- public([leaf/1, leaves/1]).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/directives/uses1.html b/Logtalk/manuals/refman/directives/uses1.html new file mode 100644 index 000000000..5609b260a --- /dev/null +++ b/Logtalk/manuals/refman/directives/uses1.html @@ -0,0 +1,58 @@ + + + + + + uses/1 + + + + + +
+

uses/1

+
+ +

Description

+ +
+
+uses(Object)
+uses(Object1, Object2, ...)
+uses([Object1, Object2, ...])
+
+

+ Declares the object(s) that are sent messages by predicates defined in the category or object containing the directive. +

+
+ +

Template and modes

+ +
+
+uses(+object_identifiers)
+
+
+ + +

Examples

+ +
+
+:- uses(list).
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/abolish1.html b/Logtalk/manuals/refman/methods/abolish1.html new file mode 100644 index 000000000..fd8cd76f5 --- /dev/null +++ b/Logtalk/manuals/refman/methods/abolish1.html @@ -0,0 +1,86 @@ + + + + + + abolish/1 + + + + + +
+

abolish/1

+
+ +

Description

+ +
+
+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. +

+
+ +

Template and modes

+ +
+
+abolish(+predicate_indicator)
+
+
+ +

Errors

+ +
+
+
Predicate is a variable:
+
instantiation_error
+
Predicate is neither a variable nor a valid predicate indicator:
+
type_error(predicate_indicator, Predicate)
+
Functor is neither a variable nor an atom:
+
type_error(atom, Functor)
+
Arity is neither a variable nor an integer:
+
type_error(integer, Arity)
+
Predicate is statically declared:
+
permission_error(modify, predicate_declaration, Functor/Arity)
+
Predicate is a private predicate:
+
permission_error(modify, private_predicate, Functor/Arity)
+
Predicate is a protected predicate:
+
permission_error(modify, protected_predicate, Functor/Arity)
+
Predicate is a static predicate:
+
permission_error(modify, static_predicate, Functor/Arity)
+
Predicate is not declared:
+
existence_error(predicate_declaration, Functor/Arity)
+
+
+ +

Examples

+ +
+
+
To abolish any dynamic predicate in this:
+
abolish(Predicate)
+
To abolish a public or protected dynamic predicate in self:
+
::abolish(Predicate)
+
To abolish a public dynamic predicate in an object:
+
Object::abolish(Predicate)
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/after3.html b/Logtalk/manuals/refman/methods/after3.html new file mode 100644 index 000000000..c1bbd0e17 --- /dev/null +++ b/Logtalk/manuals/refman/methods/after3.html @@ -0,0 +1,65 @@ + + + + + + after/3 + + + + + +
+

after/3

+
+ +

Description

+ +
+
+after(Object, Message, Sender)
+
+

+ This is a pre-declared but user-defined public method for handling after events. +

+
+ +

Template and modes

+ +
+
+after(?object, ?term, ?object)
+
+
+ +

Errors

+ +
+

+ (none) +

+
+ +

Examples

+ +
+
+after(Object, Message, Sender) :-
+    writeq(Object), write('::'), writeq(Message),
+    write(' from '), writeq(Sender), nl.
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/asserta1.html b/Logtalk/manuals/refman/methods/asserta1.html new file mode 100644 index 000000000..70d3aa48d --- /dev/null +++ b/Logtalk/manuals/refman/methods/asserta1.html @@ -0,0 +1,82 @@ + + + + + + asserta/1 + + + + + +
+

asserta/1

+
+ +

Description

+ +
+
+asserta(Clause)
+asserta((Head:-Body))
+
+

+ Asserts a clause as the first one for an object's dynamic predicate. If the predicate is not already declared, then a dynamic predicate declaration is added to the object. +

+
+ +

Template and modes

+ +
+
+asserta(+clause)
+
+
+ +

Errors

+ +
+
+
Clause is a variable:
+
instantiation_error
+
Head is a variable:
+
instantiation_error
+
Head is a neither a variable nor a callable term:
+
type_error(callable, Head)
+
Body cannot be converted to a goal:
+
type_error(callable, Body)
+
The predicate indicator of Head is that of a private predicate:
+
permission_error(modify, private_predicate, Head)
+
The predicate indicator of Head is that of a protected predicate:
+
permission_error(modify, protected_predicate, Head)
+
The predicate indicator of Head is that of a static predicate:
+
permission_error(modify, static_predicate, Head)
+
+
+ +

Examples

+ +
+
+
To assert a clause as the first one for any dynamic predicate in this:
+
asserta(Clause)
+
To assert a clause as the first one for any public or protected dynamic predicate in self:
+
::asserta(Clause)
+
To assert a clause as the first one for any public dynamic predicate in an object:
+
Object::asserta(Clause)
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/assertz1.html b/Logtalk/manuals/refman/methods/assertz1.html new file mode 100644 index 000000000..1277fde1d --- /dev/null +++ b/Logtalk/manuals/refman/methods/assertz1.html @@ -0,0 +1,82 @@ + + + + + + assertz/1 + + + + + +
+

assertz/1

+
+ +

Description

+ +
+
+assertz(Clause)
+assertz((Head:-Body))
+
+

+ Asserts a clause as the last one for an object's dynamic predicate. If the predicate is not already declared, then a dynamic predicate declaration is added to the object. +

+
+ +

Template and modes

+ +
+
+assertz(+clause)
+
+
+ +

Errors

+ +
+
+
Clause is a variable:
+
instantiation_error
+
Head is a variable:
+
instantiation_error
+
Head is a neither a variable nor a callable term:
+
type_error(callable, Head)
+
Body cannot be converted to a goal:
+
type_error(callable, Body)
+
The predicate indicator of Head is that of a private predicate:
+
permission_error(modify, private_predicate, Head)
+
The predicate indicator of Head is that of a protected predicate:
+
permission_error(modify, protected_predicate, Head)
+
The predicate indicator of Head is that of a static predicate:
+
permission_error(modify, static_predicate, Head)
+
+
+ +

Examples

+ +
+
+
To assert a clause as the last one for any dynamic predicate in this:
+
assertz(Clause)
+
To assert a clause as the last one for any public or protected dynamic predicate in self:
+
::assertz(Clause)
+
To assert a clause as the last one for any public dynamic predicate in an object:
+
Object::assertz(Clause)
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/bagof3.html b/Logtalk/manuals/refman/methods/bagof3.html new file mode 100644 index 000000000..4679da80c --- /dev/null +++ b/Logtalk/manuals/refman/methods/bagof3.html @@ -0,0 +1,68 @@ + + + + + + bagof/3 + + + + + +
+

bagof/3

+
+ +

Description

+ +
+
+bagof(Term, Goal, List)
+
+

+ (see the Prolog ISO standard definition) +

+
+ +

Template and modes

+ +
+
+bagof(@term, +callable, -list)
+
+
+ +

Errors

+ +
+

+ (see the Prolog ISO standard) +

+
+ +

Examples

+ +
+
+
To find all solutions in this:
+
bagof(Term, Goal, List)
+
To find all solutions in self:
+
bagof(Term, ::Goal, List)
+
To find all solutions in an object:
+
bagof(Term, Object::Goal, List)
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/before3.html b/Logtalk/manuals/refman/methods/before3.html new file mode 100644 index 000000000..51ae36e2f --- /dev/null +++ b/Logtalk/manuals/refman/methods/before3.html @@ -0,0 +1,65 @@ + + + + + + before/3 + + + + + +
+

before/3

+
+ +

Description

+ +
+
+before(Object, Message, Sender)
+
+

+ This is a pre-declared but user-defined public method for handling before events. +

+
+ +

Template and modes

+ +
+
+before(?object, ?term, ?object)
+
+
+ +

Errors

+ +
+

+ (none) +

+
+ +

Examples

+ +
+
+before(Object, Message, Sender) :-
+    writeq(Object), write('::'), writeq(Message),
+    write(' from '), writeq(Sender), nl.
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/clause2.html b/Logtalk/manuals/refman/methods/clause2.html new file mode 100644 index 000000000..d02410f99 --- /dev/null +++ b/Logtalk/manuals/refman/methods/clause2.html @@ -0,0 +1,81 @@ + + + + + + clause/2 + + + + + +
+

clause/2

+
+ +

Description

+ +
+
+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. +

+
+ +

Template and modes

+ +
+
+clause(?callable, ?body)
+
+
+ +

Errors

+ +
+
+
Head is a variable:
+
instantiation_error
+
Head is a neither a variable nor a callable term:
+
type_error(callable, Head)
+
Body is a neither a variable nor a callable term:
+
type_error(callable, Body)
+
The predicate indicator of Head is that of a private predicate:
+
permission_error(access, private_predicate, Head)
+
The predicate indicator of Head is that of a protected predicate:
+
permission_error(access, protected_predicate, Head)
+
The predicate indicator of Head is that of a static predicate:
+
permission_error(access, static_predicate, Head)
+
Head is not a declared predicate:
+
existence_error(predicate_declaration, Head)
+
+
+ +

Examples

+ +
+
+
To retrieve a matching clause of any dynamic predicate in this:
+
clause(Head, Body)
+
To retrieve a matching clause of a public or protected dynamic predicate in self:
+
::clause(Head, Body)
+
To retrieve a matching clause of a public dynamic predicate in an object:
+
Object::clause(Head, Body)
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/current_predicate1.html b/Logtalk/manuals/refman/methods/current_predicate1.html new file mode 100644 index 000000000..513aaf7cd --- /dev/null +++ b/Logtalk/manuals/refman/methods/current_predicate1.html @@ -0,0 +1,69 @@ + + + + + + current_predicate/1 + + + + + +
+

current_predicate/1

+
+ +

Description

+ +
+
+current_predicate(Predicate)
+
+

+ Enumerates, by backtracking, the visible user predicates for an object. +

+
+ +

Template and modes

+ +
+
+current_predicate(?predicate_indicator)
+
+
+ +

Errors

+ +
+
+
Predicate is neither a variable nor a valid predicate indicator:
+
type_error(predicate_indicator, Predicate)
+
+
+ +

Examples

+ +
+
+
To enumerate, by backtracking, the user predicates visible in this:
+
current_predicate(Predicate)
+
To enumerate, by backtracking, the public and protected user predicates visible in self:
+
::current_predicate(Predicate)
+
To enumerate, by backtracking, the public user predicates visible for an object:
+
Object::current_predicate(Predicate)
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/findall3.html b/Logtalk/manuals/refman/methods/findall3.html new file mode 100644 index 000000000..20ce9a4c4 --- /dev/null +++ b/Logtalk/manuals/refman/methods/findall3.html @@ -0,0 +1,68 @@ + + + + + + findall/3 + + + + + +
+

findall/3

+
+ +

Description

+ +
+
+findall(Term, Goal, List)
+
+

+ (see the Prolog ISO standard definition) +

+
+ +

Template and modes

+ +
+
+findall(@term, +callable, -list)
+
+
+ +

Errors

+ +
+

+ (see the Prolog ISO standard) +

+
+ +

Examples

+ +
+
+
To find all solutions in this:
+
findall(Term, Goal, List)
+
To find all solutions in self:
+
findall(Term, ::Goal, List)
+
To find all solutions in an object:
+
findall(Term, Object::Goal, List)
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/forall2.html b/Logtalk/manuals/refman/methods/forall2.html new file mode 100644 index 000000000..5bcc12170 --- /dev/null +++ b/Logtalk/manuals/refman/methods/forall2.html @@ -0,0 +1,74 @@ + + + + + + forall/2 + + + + + +
+ +

forall/2

+
+ +

Description

+ +
+
+forall(Generator, Test)
+
+

+ For all solutions of Generator, Test is true. +

+
+ +

Template and modes

+ +
+
+forall(+callable, +callable)
+
+
+ +

Errors

+ +
+
+
Either Generator or Test is a variable:
+
instantiation_error
+
Generator is neither a variable nor a callable term:
+
type_error(callable, Generator)
+
Test is neither a variable nor a callable term:
+
type_error(callable, Test)
+
+
+ +

Examples

+ +
+
+
To call both goals in this:
+
forall(Generator, Test)
+
To call both goals in self:
+
forall(::Generator, ::Test)
+
To call both goals in an object:
+
forall(Object::Generator, Object::Test)
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/parameter2.html b/Logtalk/manuals/refman/methods/parameter2.html new file mode 100644 index 000000000..07e5c4809 --- /dev/null +++ b/Logtalk/manuals/refman/methods/parameter2.html @@ -0,0 +1,77 @@ + + + + + + parameter/2 + + + + + +
+

parameter/2

+
+ +

Description

+ +
+
+parameter(Number, Term)
+
+

+ Used only in parametric objects, this method returns parameter values by using the parameter position in the entity identifier. See also this/1. +

+
+ +

Template and modes

+ +
+
+parameter(+integer, ?term)
+
+
+ +

Errors

+ +
+
+
Number is a variable:
+
instantiation_error
+
Number is neither a variable nor an integer value: +
type_error(integer, Number)
+
Object identifier is not a compound term:
+
type_error(compound, Object)
+
Number is a negative integer value:
+
domain_error(not_less_than_zero, Number)
+
+
+ +

Examples

+ +
+
+:- object(box(_Colour)).
+
+    ...
+    
+    colour(Colour) :-
+        parameter(1, Colour).
+
+    ...
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/predicate_property2.html b/Logtalk/manuals/refman/methods/predicate_property2.html new file mode 100644 index 000000000..782351ab4 --- /dev/null +++ b/Logtalk/manuals/refman/methods/predicate_property2.html @@ -0,0 +1,73 @@ + + + + + + predicate_property/2 + + + + + +
+

predicate_property/2

+
+ +

Description

+ +
+
+predicate_property(Predicate, Property)
+
+

+ Enumerates, by backtracking, the properties of a visible predicate. +

+
+ +

Template and modes

+ +
+
+predicate_property(+callable, ?predicate_property)
+
+
+ +

Errors

+ +
+
+
Predicate is a variable:
+
instantiation_error
+
Predicate is neither a variable nor a callable term:
+
type_error(callable, Predicate)
+
Property is neither a variable nor a valid predicate property:
+
domain_error(predicate_property, Property)
+
+
+ +

Examples

+ +
+
+
To enumerate, by backtracking, the properties of a predicate visible in this:
+
predicate_property(foo(_), Property)
+
To enumerate, by backtracking, the properties of a public or protected predicate visible in self:
+
::predicate_property(foo(_), Property)
+
To enumerate, by backtracking, the properties of a public predicate visible in an object:
+
Object::predicate_property(foo(_), Property)
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/retract1.html b/Logtalk/manuals/refman/methods/retract1.html new file mode 100644 index 000000000..d72c63bd7 --- /dev/null +++ b/Logtalk/manuals/refman/methods/retract1.html @@ -0,0 +1,80 @@ + + + + + + retract/1 + + + + + +
+

retract/1

+
+ +

Description

+ +
+
+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. +

+
+ +

Template and modes

+ +
+
+retract(+clause)
+
+
+ +

Errors

+ +
+
+
Head is a variable:
+
instantiation_error
+
Head is neither a variable nor a callable term:
+
type_error(callable, Head)
+
The predicate indicator of Head is that of a private predicate:
+
permission_error(modify, private_predicate, Head)
+
The predicate indicator of Head is that of a protected predicate:
+
permission_error(modify, protected_predicate, Head)
+
The predicate indicator of Head is that of a static predicate:
+
permission_error(modify, static_predicate, Head)
+
The predicate indicator of Head is not declared:
+
existence_error(predicate_declaration, Head)
+
+
+ +

Examples

+ +
+
+
To retract a matching clause of any dynamic predicate in this:
+
retract(Clause)
+
To retract a matching clause of a public or protected dynamic predicate in self:
+
::retract(Clause)
+
To retract a matching clause of a public dynamic predicate in an object:
+
Object::retract(Clause)
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/retractall1.html b/Logtalk/manuals/refman/methods/retractall1.html new file mode 100644 index 000000000..4bb1416cb --- /dev/null +++ b/Logtalk/manuals/refman/methods/retractall1.html @@ -0,0 +1,79 @@ + + + + + + retractall/1 + + + + + +
+

retractall/1

+
+ +

Description

+ +
+
+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. +

+
+ +

Template and modes

+ +
+
+retractall(+callable)
+
+
+ +

Errors

+ +
+
+
Head is a variable:
+
instantiation_error
+
Head is neither a variable nor a callable term:
+
type_error(callable, Head)
+
The predicate indicator of Head is that of a private predicate:
+
permission_error(modify, private_predicate, Head)
+
The predicate indicator of Head is that of a protected predicate:
+
permission_error(modify, protected_predicate, Head)
+
The predicate indicator of Head is that of a static predicate:
+
permission_error(modify, static_predicate, Head)
+
The predicate indicator of Head is not declared:
+
existence_error(predicate_declaration, Head)
+
+
+ +

Examples

+ +
+
+
To retract all matching predicate definitions in this:
+
retractall(Head)
+
To retract all matching public or protected predicate definitions in self:
+
::retractall(Head)
+
To retract all matching public predicate definitions in an object:
+
Object::retractall(Head)
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/self1.html b/Logtalk/manuals/refman/methods/self1.html new file mode 100644 index 000000000..97def6fa8 --- /dev/null +++ b/Logtalk/manuals/refman/methods/self1.html @@ -0,0 +1,66 @@ + + + + + + self/1 + + + + + +
+

self/1

+
+ +

Description

+ +
+
+self(Self)
+
+

+ Returns the object that has received the message under processing. +

+
+ +

Template and modes

+ +
+
+self(-object)
+
+
+ +

Errors

+ +
+

+ (none) +

+
+ +

Examples

+ +
+
+test :-
+    self(Self),
+    write('executing a method in behalf of '),
+    writeq(Self), nl.
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: February 10, 2001 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/sender1.html b/Logtalk/manuals/refman/methods/sender1.html new file mode 100644 index 000000000..b89f6299a --- /dev/null +++ b/Logtalk/manuals/refman/methods/sender1.html @@ -0,0 +1,66 @@ + + + + + + sender/1 + + + + + +
+

sender/1

+
+ +

Description

+ +
+
+sender(Sender)
+
+

+ Returns the object that has sent the message under processing. +

+
+ +

Template and modes

+ +
+
+sender(-object)
+
+
+ +

Errors

+ +
+

+ (none) +

+
+ +

Examples

+ +
+
+test :-
+    sender(Sender),
+    write('executing a method to answer a message sent by '),
+    writeq(Sender), nl.
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: February 10, 2001 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/setof3.html b/Logtalk/manuals/refman/methods/setof3.html new file mode 100644 index 000000000..0104609a1 --- /dev/null +++ b/Logtalk/manuals/refman/methods/setof3.html @@ -0,0 +1,68 @@ + + + + + + setof/3 + + + + + +
+

setof/3

+
+ +

Description

+ +
+
+setof(Term, Goal, List)
+
+

+ (see the Prolog ISO standard definition) +

+
+ +

Template and modes

+ +
+
+setof(@term, +callable, -list)
+
+
+ +

Errors

+ +
+

+ (see the Prolog ISO standard) +

+
+ +

Examples

+ +
+
+
To find all solutions in this:
+
setof(Term, Goal, List)
+
To find all solutions in self:
+
setof(Term, ::Goal, List)
+
To find all solutions in an object:
+
setof(Term, Object::Goal, List)
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + + diff --git a/Logtalk/manuals/refman/methods/this1.html b/Logtalk/manuals/refman/methods/this1.html new file mode 100644 index 000000000..a2b44315a --- /dev/null +++ b/Logtalk/manuals/refman/methods/this1.html @@ -0,0 +1,66 @@ + + + + + + this/1 + + + + + +
+

this/1

+
+ +

Description

+ +
+

+ this(This) +

+

+ Returns the object that contains the predicate definition that is being executed. This method is useful in avoiding problems when an object is renamed or when using parametric objects. Can also be used to retrieve runtime parametric object parameters though unification (see also parameter/2). +

+
+ +

Template and modes

+ +
+
+this(-object_identifier)
+
+
+ +

Errors

+ +
+

+ (none) +

+
+ +

Examples

+ +
+
+test :-
+    this(This),
+    write('executing a definition contained in '),
+    writeq(This), nl.
+
+
+ +
+

+Previous | Next | Table of Contents | Bibliography | Glossary +

+

+Last updated on: July 4, 2000 +

+
+ + + +