| 1 | ================================================================ |
|---|
| 2 | Logtalk - Open source object-oriented logic programming language |
|---|
| 3 | Release 2.30.2 |
|---|
| 4 | |
|---|
| 5 | Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved. |
|---|
| 6 | ================================================================ |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | Quick start |
|---|
| 10 | =========== |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | Starting up Logtalk |
|---|
| 14 | ------------------- |
|---|
| 15 | |
|---|
| 16 | 1. Install Logtalk by using either the installer provided for your |
|---|
| 17 | operating-system (when available) or by following the instructions |
|---|
| 18 | on the "INSTALL.txt" file. Depending on your operating-system, working |
|---|
| 19 | environment, and favorite Prolog compiler, you may already have a |
|---|
| 20 | script or a shortcut installed for easily running Logtalk with your |
|---|
| 21 | favorite Prolog compiler. In this case, skip the instructions below |
|---|
| 22 | for starting up Logtalk and go straight to the instructions on running |
|---|
| 23 | the examples. |
|---|
| 24 | |
|---|
| 25 | On POSIX operating-systems, the following shell scripts are installed |
|---|
| 26 | by default for running Logtalk with selected back-end Prolog compilers |
|---|
| 27 | (which must be properly installed for running the scripts!): |
|---|
| 28 | |
|---|
| 29 | B-Prolog: bplgt (first run must use sudo) |
|---|
| 30 | CIAO: ciaolgt (first run must use sudo) |
|---|
| 31 | CxProlog: cxlgt |
|---|
| 32 | ECLiPSe: eclipselgt |
|---|
| 33 | GNU Prolog: gplgt |
|---|
| 34 | K-Prolog: plclgt |
|---|
| 35 | SICStus Prolog: sicstuslgt |
|---|
| 36 | SWI-Prolog: swilgt |
|---|
| 37 | XSB: xsblgt (first run must use sudo) |
|---|
| 38 | YAP: yaplgt |
|---|
| 39 | |
|---|
| 40 | On Windows systems, shortcuts for running Logtalk with selected back-end |
|---|
| 41 | Prolog compilers are created on the "Start Menu/Programs/Logtalk" menu. |
|---|
| 42 | If you get an unexpected failure when using one of the Prolog integration |
|---|
| 43 | scripts, consult the "configs/NOTES.txt" file for compatibility notes. |
|---|
| 44 | |
|---|
| 45 | 2. Open the "manuals/index.html" file with a web browser. |
|---|
| 46 | |
|---|
| 47 | 3. Select the "Tutorial" link. This will provide you with a basic |
|---|
| 48 | understanding of the main Logtalk concepts. |
|---|
| 49 | |
|---|
| 50 | 4. Go back to the "index.html" file, select the "User Manual" link, |
|---|
| 51 | then the "Installing Logtalk" and "Running and debugging Logtalk |
|---|
| 52 | programs" links. This will provide you with a basic understanding of |
|---|
| 53 | how to start Logtalk as well as how to compile and load Logtalk code. |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | In case a manual installation is necessary, and assuming that Logtalk |
|---|
| 57 | supports your Prolog compiler, apply the following steps: |
|---|
| 58 | |
|---|
| 59 | 1. Read the "NOTES.txt" file in the "configs" sub-directory to check if |
|---|
| 60 | any patch or workaround is needed for your compiler. |
|---|
| 61 | |
|---|
| 62 | 2. Start your Prolog compiler. |
|---|
| 63 | |
|---|
| 64 | 3. Change the current working directory of your Prolog session to the |
|---|
| 65 | Logtalk installation directory. If you don't know which predicate to |
|---|
| 66 | use, check the "configs/NOTES.txt" file or your Prolog compiler reference |
|---|
| 67 | manual. |
|---|
| 68 | |
|---|
| 69 | 4. Compile and load the config file for your Prolog compiler. |
|---|
| 70 | |
|---|
| 71 | 5. Compile and load the Logtalk compiler/runtime found on the "compiler" |
|---|
| 72 | sub-directory. |
|---|
| 73 | |
|---|
| 74 | 6. Adapt, if needed, the file "libpaths/libpaths.pl" to match your Logtalk |
|---|
| 75 | installation, Prolog compiler, operating-system, and then compile and |
|---|
| 76 | load it. |
|---|
| 77 | |
|---|
| 78 | Note that both the configuration files, the compiler/runtime files, and the |
|---|
| 79 | library paths file are Prolog files. The predicate used to load these files |
|---|
| 80 | depends on your Prolog compiler (consult your Prolog compiler documentation |
|---|
| 81 | or take a look at the definition of the predicate '$lgt_load_prolog_code'/1 |
|---|
| 82 | in the config file. For most command-line compilers, you could type at the |
|---|
| 83 | Prolog prompt something like: |
|---|
| 84 | |
|---|
| 85 | | ?- ['configs/foo.config', 'compiler/logtalk.pl', 'libpaths/libpaths.pl']. |
|---|
| 86 | |
|---|
| 87 | Replace the file name "foo.config" with the appropriate config file name for |
|---|
| 88 | your compiler. |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | Running the examples |
|---|
| 92 | -------------------- |
|---|
| 93 | |
|---|
| 94 | You may now try some of the provided examples: |
|---|
| 95 | |
|---|
| 96 | 1. Open the "examples" sub-directory. There you find several sub-directories |
|---|
| 97 | with ready to run examples and a "NOTES.txt" file containing general |
|---|
| 98 | instructions and a brief description of each example. Select and open one |
|---|
| 99 | of the examples sub-directory. |
|---|
| 100 | |
|---|
| 101 | 2. Read the example "NOTES.txt" file for a description of the example. |
|---|
| 102 | |
|---|
| 103 | 3. Open the "SCRIPT.txt" file for instructions on how to load the example |
|---|
| 104 | and for sample queries that you may try by copying-and-pasting them to |
|---|
| 105 | your Prolog interpreter top-level. |
|---|
| 106 | |
|---|
| 107 | |
|---|
| 108 | Writing your own programs |
|---|
| 109 | _________________________ |
|---|
| 110 | |
|---|
| 111 | Ready to start writing your own programs? |
|---|
| 112 | |
|---|
| 113 | 1. Read the User Manual sections on "Programming in Logtalk" and "Running |
|---|
| 114 | and debugging Logtalk programs". |
|---|
| 115 | |
|---|
| 116 | 2. Take a look at the "wenv" sub-directory. There you will find syntax |
|---|
| 117 | configuration files for popular text editors which enable syntax coloring |
|---|
| 118 | and other text services when editing Logtalk source files. |
|---|
| 119 | |
|---|
| 120 | 3. Create a sub-directory with a suitable name to hold all the files of |
|---|
| 121 | your application. You may want to add the directory path to the "libpaths.pl" |
|---|
| 122 | file mentioned above in order to easily load your application. |
|---|
| 123 | |
|---|
| 124 | 4. Copy to this sub-directory a loader file from one of the example |
|---|
| 125 | directories and modify it to load your own source files. |
|---|
| 126 | |
|---|
| 127 | 5. Have fun! |
|---|