KDF9 simple software tools

Examples of use

Comparison between pages 1 to 12 typed by Brian and Graham:

First convert each to cannonical form using the cannonical definition in cannon.txt.
F:\dh\KDF9>htmform cannon.txt whetstone01-12.txt GT.txt
Sorted 40 keys

F:\dh\KDF9>htmform cannon.txt p1top12.txt BAW.txt
Sorted 40 keys

Next run diff between the two cannonical versions:
F:\dh\KDF9>diff -Bb BAW.txt GT.txt > diff.txt
F:\dh\KDF9>kal3 whetstone01-12.txt > GTlst.txt
Error syntax error

F:\dh\KDF9>kal3 p1top15.txt > BAW+RMcL.txt

An emulator for KDF9 is under construction by Bill Findlay. It will appear here in due course

Source text

The “connonicaliser” is a C program htmform.c that reads a datafile cannon.txt. It was originally written to generate the HTML form of the director with the JavaScript cross-reference facility, so it contains some features that are not relevant to cannonicalisation.

The assembler consists of a yacc grammar kal3.y and a section of C source kal3.c. If you don’t have yacc or bison the generated files y.tab.c and y.tab.h can be downloaded. It stops on the first syntax error, listing the current and previous lines with three exclamation marks inserted at the point where the error was detected. The real error will be just before the !!!.

The name KAL3 stands for KDF9 assemble language 3. Version 1 was just binary, then there was paper tape generator. So Usercode was version 3. The best KDF9 assembly language was KAL4, implemented for an M.Sc. dissertation at Leeds University by John Thomason.

Why write it all in C? For the assembler I wanted to use yacc, and I believe that the efficacy of the result justifies the choice. The cannonicaliser is such a simple program using a crude technique, that it is small enough to be easy in C, and runs at a good speed, even on my 266MHz Pentium II under Win98. Actually, the majority of it is copied from a Java servlet that I wrote for displaying mathematical web pages. (Here is an example of its use.)

I’ve also run the software under FreeBSD UNIX on my 600MHz Pentium III. So I think that it will be OK on most platforms.

David Holdsworth