Documentation for PalmDATR 1.0
Dafydd Gibbon
18 June 2000
Overview
PalmDATR (or PDATR) is a resurrected and updated version of PCS-DATR, later
known as DDATR, which I originally implemented in 1989.
PCS-DATR is an implementation of DATR in Scheme, with a GUI in the now
long defunct Texas Instruments PC-Scheme; PC-Scheme was discontinued by
TI because its implementation was hardware dependent (!) and it turned out
not to be compatible with Intel processors after the 386. With PC-Scheme
PCS-DATR/DDATR also died - though they still run on an ancient laptop.
An excellent version of Scheme called LispMe, by Fred Bayer, Munich, is now
available for the PalmPilot family of PDAs, and since a PDA is more convenient
in many travel situations that a multiple pound laptop, I have ported the
compiler and interpreter to this environment.
For further information on DATR,
check my DATR compendium
and references there.
Description
PDATR has the following features which may or may not be extended (though probably not as far as the current Sussex RFC 2 level), depending on how much time I have:
- Handles core DATR theories including atom and node declarations (currently no range addition and subtracting operations in declarations).
- Has quoted atoms.
- Has both on the fly and declared variables.
- Currently no other declarations (directives) are implemented.
- Garden variety DATR query input and output, and a simple trace, in standard DATR NODE:<path> format.
- Trace: (set! *trace* #t) / (set! *trace* #f).
- Output crunch: (set! *crunch* #t) / (set! *crunch* #f).
- Default sorting in the DATR text (longest path first, of course) is the user's responsibility in this version, as I did not want to slow the compiler further by a sort/search routine or by the Zdatr decision tree optimisation for the path connect operation.
- Error handling also relies on heavily on user intelligence, to put it mildly; currently LispMe error messages shine through if there are syntactic or semantic errors in the DATR code.
Installation
Install LispMe 2.7 and either
- Install the pre-compiled pdb and .prc files.
- The PalmDATR.pdb file contains the pre-compiled PalmDATR compiler and interpreter code in a recursive list format. This can be run from the LispMe switcher without the .prc file.
- The ĞalmDATR.prc filename contains a strange character (actually the code for P with the leading binary bit flipped for LispMe internal reasons). This file is a launcher stub which provides a PalmOS Launcher icon to enable a direct PalmDATR call without going via LispMe. It still requires LispMe, however.
- DO NOT CHANGE THE FILE NAMES!
or
- Install the six Palm MemoPad Memos in your preferred way, create a
MemoPad category LispMe (upper case L and M!), categorise the memos
this new category, start LispMe and load the memos into LispMe in the
following order:
- PdatrComp1.lm
- PdatrComp2.lm
- PdatrComp3.lm
- PdatrComp4.lm
- PdatrInt1.lm
- PdatrInt2.lm
- Call (demo) for further instructions.
Note that the first line of the memo has to contain the name of the
theory, which is obligatorily
% mytheory.dtr
However, it is only necessary to enter mytheory in the dialogue
box; the percent comment sign and the .dtr extension are added.
- Call compiler and interpreter with (pdci).
- Call interpreter alone for a compiled theory: (pdi #t) with a (very basic) trace function, (pdi #f) without trace.
- Compiled files are currently not savable separately. This is not necessary, as LispMe automatically generates saved states. However, I may include this as a later date, using the PCS-DATR/DDATR *.dto convention for compiled
code files.
- Except for a couple of PalmOS specific I/O functions, the code uses a
small subset of standard R4RS Scheme and may therefore work unaltered
with other implementations of Scheme on other platforms, and with
minor alterations also with other Lisp versions. The implementation
is not particularly `Lispy', and should therefore be usable as a
basic specification for DATR implementations in other languages. In
fact it was designed this way specifically for this purpose.
- Distribution conditions are GNU General Public Licence.
... or both.
LispMe source files
The following LispMe Scheme source files for PalmDATR are distributed under
the terms of the GNU GPL and are listed here for convenient reference:
- PdatrComp1.lm
- PdatrComp2.lm
- PdatrComp3.lm
- PdatrComp4.lm
- PdatrInt1.lm
- PdatrInt2.lm
Sample DATR files
Some simple examples of DATR theories which are processable by PalmDATR
are included in the distribution.
These DATR files are distributed under the GNU GPL and are listed here
for convenient reference:
- evalpath.dtr
- fsa.dtr
- tone.dtr
- wordform.dtr
Dafydd Gibbon,
Sun Jun 18 23:03:51 MET DST 2000