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:
  1. Handles core DATR theories including atom and node declarations (currently no range addition and subtracting operations in declarations).
  2. Has quoted atoms.
  3. Has both on the fly and declared variables.
  4. Currently no other declarations (directives) are implemented.
  5. Garden variety DATR query input and output, and a simple trace, in standard DATR NODE:<path> format.
  6. Trace: (set! *trace* #t) / (set! *trace* #f).
  7. Output crunch: (set! *crunch* #t) / (set! *crunch* #f).
  8. 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.
  9. 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
  1. Install the pre-compiled pdb and .prc files.
  2. 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.
  3. 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.
  4. DO NOT CHANGE THE FILE NAMES!
or
  1. 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:
    1. PdatrComp1.lm
    2. PdatrComp2.lm
    3. PdatrComp3.lm
    4. PdatrComp4.lm
    5. PdatrInt1.lm
    6. PdatrInt2.lm
  2. 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.
  3. Call compiler and interpreter with (pdci).
  4. Call interpreter alone for a compiled theory: (pdi #t) with a (very basic) trace function, (pdi #f) without trace.
  5. 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.
  6. 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.
  7. 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:
  1. PdatrComp1.lm
  2. PdatrComp2.lm
  3. PdatrComp3.lm
  4. PdatrComp4.lm
  5. PdatrInt1.lm
  6. 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:
  1. evalpath.dtr
  2. fsa.dtr
  3. tone.dtr
  4. wordform.dtr

Dafydd Gibbon, Sun Jun 18 23:03:51 MET DST 2000