Semlab : Muri : System : How to edit and compile the Gemini grammar


Getting the grammar files

To get the files (on Unix it's this easy; on Windows, see my CVS tutorial at http://www-csli.stanford.edu/semlab/muri/system/howto/cvs.html because it takes additional steps), just make a directory where you want all our source code. For me, that's ~/src. Change to this directory, and give the command This will check out a bunch of files (all our working source code), into a directory called csli. Under csli, you'll find csli/muri/grammar which is the grammar directory, and csli/agents/v1/nl which is where the NLagent lives.

If you don't plan to work on any of our other source code (such as the Java agents), but only the grammar, you might not like the above because it checks out ALL our source code, and uses a lot of disk space. If you ONLY want the grammar, you can use this form:

This will create csli/muri/grammar/ and its contents (relative to where you are when you type this command) but will not get all the other files.

I would like to (soon/eventually) actually delete the old muri directories under /export/home/dialog/gemini to avoid confusion, so anyone who owns useful files of their own there should copy those elsewhere. (Such as "advice", "compartment_list", and anything else that people find useful.)

The files I added to CVS are only the essential ones -- for the grammar, that's muri_grammar.* and muri.dict, plus the scripts necessary to build the output files. The output files themselves aren't saved by CVS because they can be automatically generated as necessary.

Note that after you make changes (in your own private directory which you've checked out from CVS), if you want to make them permanent (so that CVS will record the change, and so that the changes will be visible to other users) remember to commit your changes to CVS.

How to make

On both Windows and Unix, now all you have to do is type "make". This will produce the new master output file which is "gemini.sav". (It's much bigger than, but loads much faster than, the old "gemini.ql"; it's also much more self contained and a better idea the way Sicstus works. Unfortunately, you have to restore/1 rather than load/1 it, and restore throws away any other database/predicate state you have, so it's slightly less convenient to work with. Shouldn't really matter I hope. Also, you can load this thing from the command line with "sicstus -r gemini.sav".)

To make the Nuance grammar and package (which I've renamed from simply "out.grammar" to "nuance_out.grammar", and "out" to "nuance_package" for the package), use "make nuance" at the command line. This is actually 2 steps: generating the Nuance grammar (nuance_out.grammar) from the Gemini grammar, then generating the Nuance package (nuance_package/*) from the Nuance grammar. For various reasons which should eventually be mitigated but right now can't be, the first step only works on Unix and the second step only works on Windows. So you need to run "make nuance" on Unix, ignore the fact that the 2nd step fails, copy the resulting nuance_out.grammar to the corresponding directory on Windows, and run "make nuance" again there (it will notice that nuance_out.grammar already exists and skip the first step, and succeed on the 2nd step).

How to run

To run Gemini, instead of the old load(gemini) or fast.pl's lg macro, use "sicstus -r gemini.sav" at the command line to load Sicstus with Gemini preloaded. Or, from inside Sicstus (careful, this will blow away any definitions already existing, including fast.pl if it's been loaded) you can use restore('gemini.sav')..

If you are accustomed to Anne's macros in fast.pl, you can still load fast with the [fast]. or consult(fast). commands, or you can invoke Sicstus as "sicstus -r gemini.sav -l fast.pl".

To run the nlagent, use the script nlagent.bat (which despite its odd name, is a valid Unix shell script, plus it works on Windows). It loads Gemini, then executes the NLagent which is in csli/agents/v1/nl/nlagent.pl relative to where you did the original CVS checkout command.


mginzton@csli / 6/14/2001