| 1 | ================================================================= |
|---|
| 2 | Logtalk - Object oriented extension to Prolog |
|---|
| 3 | Release 2.21.0 |
|---|
| 4 | |
|---|
| 5 | Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved. |
|---|
| 6 | ================================================================= |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | This folder contains several examples of Logtalk programs. A brief |
|---|
| 10 | description of each example is included below. |
|---|
| 11 | |
|---|
| 12 | Each example folder contains a NOTES file and a loader helper file which |
|---|
| 13 | may be used to load all the example entities. In addition, most examples |
|---|
| 14 | contain a SCRIPT file with sample queries for your to try. |
|---|
| 15 | |
|---|
| 16 | Most of these examples need objects, protocols, and categories which are |
|---|
| 17 | defined in the Logtalk standard library or in other examples, so you |
|---|
| 18 | should load them first (see the NOTES files inside the library folder and |
|---|
| 19 | the NOTES file inside each example folder). |
|---|
| 20 | |
|---|
| 21 | Some examples may redefine objects already loaded from other examples. |
|---|
| 22 | You may want to restart Logtalk after trying each example. |
|---|
| 23 | |
|---|
| 24 | Some of the examples code have been adopted from public available Prolog |
|---|
| 25 | code and from known Prolog text books and are copyrighted by the respective |
|---|
| 26 | authors. |
|---|
| 27 | |
|---|
| 28 | These are programming examples, meaning that you should study the source |
|---|
| 29 | files to fully understand them. |
|---|
| 30 | |
|---|
| 31 | All examples are formatted using four spaces tabs. |
|---|
| 32 | |
|---|
| 33 | By default, compiling an example generates a .xml documenting file for each |
|---|
| 34 | compiled entity (object, category, or protocol). See the xml folder for |
|---|
| 35 | instructions on how to browse the .xml files for on-line reading or how to |
|---|
| 36 | convert the files to a print-ready format such as PDF. |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | Here is a short description of each included example: |
|---|
| 40 | |
|---|
| 41 | aliases |
|---|
| 42 | example of using the alias/3 predicate directive to provide alternative |
|---|
| 43 | names to inherited predicates in order to improve readability |
|---|
| 44 | |
|---|
| 45 | birds |
|---|
| 46 | bird identification expert system |
|---|
| 47 | example adopted from the Adventure in Prolog Amzi! book |
|---|
| 48 | |
|---|
| 49 | bricks |
|---|
| 50 | example of representation and handling of relations using events |
|---|
| 51 | |
|---|
| 52 | classvars |
|---|
| 53 | example of implementation of class variables (as found in Smalltalk) |
|---|
| 54 | |
|---|
| 55 | dcgs |
|---|
| 56 | examples of using DCG rules inside objects and categories |
|---|
| 57 | |
|---|
| 58 | diamonds |
|---|
| 59 | examples of problems and solutions for the "diamond problem" |
|---|
| 60 | (multi-inheritance conflicts and ambiguities) |
|---|
| 61 | |
|---|
| 62 | dynpred |
|---|
| 63 | example of using some of the built-in database handling methods |
|---|
| 64 | |
|---|
| 65 | engines |
|---|
| 66 | example of category composition (importation of categories by other |
|---|
| 67 | categories) using car engines |
|---|
| 68 | |
|---|
| 69 | errors |
|---|
| 70 | example showing the Logtalk compiler warning and error reporting |
|---|
| 71 | |
|---|
| 72 | inheritance |
|---|
| 73 | examples of public, protected and private inheritance with both |
|---|
| 74 | prototypes and classes/instances |
|---|
| 75 | |
|---|
| 76 | instmethods |
|---|
| 77 | example of instance defined methods |
|---|
| 78 | |
|---|
| 79 | lo |
|---|
| 80 | examples adopted from the Francis G. McCabe L&O system |
|---|
| 81 | |
|---|
| 82 | logic |
|---|
| 83 | example of a translator of logic propositions to clauses in conjunctive |
|---|
| 84 | normal form |
|---|
| 85 | |
|---|
| 86 | lpa |
|---|
| 87 | examples adopted from the LPA Prolog++ system |
|---|
| 88 | |
|---|
| 89 | metapredicates |
|---|
| 90 | example of using metapredicates in Logtalk objects |
|---|
| 91 | |
|---|
| 92 | metainterpreters |
|---|
| 93 | some examples of simple metainterpreters |
|---|
| 94 | |
|---|
| 95 | mi |
|---|
| 96 | multi-inheritance examples |
|---|
| 97 | |
|---|
| 98 | miscellaneous |
|---|
| 99 | unsorted examples |
|---|
| 100 | |
|---|
| 101 | msglog |
|---|
| 102 | example of using events and monitors for recording, replaying, and |
|---|
| 103 | printing user messages |
|---|
| 104 | |
|---|
| 105 | operators |
|---|
| 106 | example of using operators local to objects and categories |
|---|
| 107 | |
|---|
| 108 | parametric |
|---|
| 109 | simple example of parametric objects |
|---|
| 110 | |
|---|
| 111 | poem |
|---|
| 112 | examples adopted from the Ben Staveley-Taylor POEM system |
|---|
| 113 | |
|---|
| 114 | points |
|---|
| 115 | example adopted from SICStus Objects documentation |
|---|
| 116 | |
|---|
| 117 | polygons |
|---|
| 118 | example of representation and handling of relations using events |
|---|
| 119 | |
|---|
| 120 | profiling |
|---|
| 121 | examples of using of events and monitors to implement profilers |
|---|
| 122 | |
|---|
| 123 | puzzles |
|---|
| 124 | several examples of logical puzzles |
|---|
| 125 | |
|---|
| 126 | reflection |
|---|
| 127 | example of a simple class-based reflective system |
|---|
| 128 | |
|---|
| 129 | relations |
|---|
| 130 | objects implementing predicates for dealing with relations and |
|---|
| 131 | constrained relations between objects |
|---|
| 132 | |
|---|
| 133 | roots |
|---|
| 134 | objects, protocols and categories needed by most of the other examples |
|---|
| 135 | |
|---|
| 136 | searching |
|---|
| 137 | state-space searching framework |
|---|
| 138 | example adopted from Ivan Bratko's "Prolog Programming for Artificial |
|---|
| 139 | Intelligence" book |
|---|
| 140 | |
|---|
| 141 | shapes |
|---|
| 142 | geometric shapes implemented as both a prototype hierarchy and a class |
|---|
| 143 | hierarchy |
|---|
| 144 | |
|---|
| 145 | sicstus |
|---|
| 146 | examples adopted from SICStus Objects documentation |
|---|
| 147 | |
|---|
| 148 | symdiff |
|---|
| 149 | example of using parametric objects to implement symbolic expression |
|---|
| 150 | differentiation and simplification |
|---|
| 151 | |
|---|
| 152 | viewpoints |
|---|
| 153 | example on how to implement property and value sharing with prototypes |
|---|