Appendix 1. How to get, install and run TROEPS



Requirements

TROEPS is being developed on Sun SparcStations under SunOS 5.4 (a.k.a. Solaris). It runs and has been tested under SunOS 4.3 and Windows-NT; it can be ported to other platforms either by INRIA or by yourself by recompiling the sources. It can be used as a library linkable to other programs.
TROEPS has been developed with the standard Unix utility Lex, YACC (now replaced by FLex and Bison) and the Ilog TALK LISP compiler. It is thus made of a set of C programs that should be compilable with any C compiler as soon as Ilog TALK libraries are available. The knowledge servers use a small set of Java applet and should be used on any kind of platform on which it is possible to find a HTTP client.
Ilog TALK compiler and libraries are available from Ilog SA , 9 rue de Verdun, BP 85, 94253 Gentilly, France.

Getting TROEPS and its documentation

TROEPS and its documentation are available for public distribution under the term of the COPYRIGHT file provided with the distribution. They can be retrieved through:
https://www.inrialpes.fr/sherpa/files/rapports/troeps-manual.ps.gz
https://www.inrialpes.fr/sherpa/files/logiciels/troeps/current.tar.gz
Our HTTP server provides various information (among which the latest release and the manual on-line). The URL are:
https://www.inrialpes.fr/sherpa/
http://co4.inrialpes.fr/docs/troeps-manual.html

Do not hesitate to browse anywhere on our site (beginning with http://co4.inrialpes.fr) a lot of information about new developments is available there.

Installing TROEPS

TROEPS can be installed anywhere in your system provided that you follow the instructions below. Assume that TROEPS is installed in the directory TRDIR. The files can be obtained by:
$ gunzip troeps-manual.ps.gz
$ gunzip current.tar.gz | tar xf -
Let assume that TRDIR is stored in a variable $TRDIR and that there is a $PORTNAME variable. The content of the tar-file consists in the following files and directories:
COPYRIGHT
the INRIA Copyright notice;
emacs
a simple but useful TROEPS mode for emacs;
examples
contains some sample knowledge bases (useful for building your own);
examples/cmain
is a sample C program calling TROEPS;
help
the help HTML files for the interface;
include
contains the set of .h files for using TROEPS from C;
java
the JAVA applets for the interface;
sparc_4_3.0
contains C sources and libraries for SunOS 4.3 port;
sparc_5_gnu
contains C sources and libraries for SunOS 5.4 (Solaris) port with the gnu compiler;
sparc_5_4.0
contains C sources and libraries for SunOS 5.4 (Solaris) port;
talk
contains the TALK sources of TROEPS;
csrc
contains the C sources for analyser and hytropes cgi-script;
tests
contains the test files for TROEPS;
trp.ws
is the workspace description file for using TROEPS under TALK;
trt.ws
is the workspace description file for T-TREE;
trr.ws
is the workspace description file for revision
htrp.ws
is the workspace description file for using hypertext extensions.

Running TROEPS under the TALK interpreter

In order to use it, it is only required that the installation directory be in the path. This can be achieved by the following assertion:

(pushf (workspace-path) #f"$TRDIR")
(in-workspaces '(trpws))

which can be typed either in your .talkrc file, in another file that you load or an italk tty input. The following sample session shows a way to use TROEPS at the interactive toplevel of Ilog TALK:

$ italk
;;; ILOG Talk version 3.3 [sparc_5_gnu]
;;; Copyright (c) 1989-1997 by ILOG
;;; Write to talk-support@ilog.com for help
;;; Image saved on Fri Jul  4 19:26:59 1997
;;; Connecting to Emacs server...connected.
;;; Loading workspace 'talk': Ilog Talk kernel workspace
;;; Loading workspace 'trp': Troeps development workspace
;;; Loading workspace 'trt': Troeps taxonomy building tool workspace
;;; Loading workspace 'htrp': Troeps knowledge server development workspace
;;; Loading workspace 'divers': executables and utility files workspace
;;; Welcome to ILOG Talk.
;;; Type (exit) to leave Talk.
? (load-program-unit 'libtrl)
;;; Loading library 'libtrl': Troeps textual interface
;;; Loading run-time environment of 'libtrl': (libtrp)
;;; Loading library 'libtrp': The core Troeps library
;;; Loading object file "/home/lotse/sherpa/TROPES.0/src/sparc_5_gnu/lib/libtrp.so"
;;; Loading object file "/home/lotse/sherpa/TROPES.0/src/sparc_5_gnu/lib/libtrl.so"
= libtrl
? (load-program-unit 'trtdum)
;;; Loading module 'trtdum': Troeps dummy basic type descriptions
;;; Loading object file "/home/lotse/sherpa/TROPES.0/src/sparc_5_gnu/o/trtdum.o"
= trtdum
? (tr-init)
= t
? (setf (languages) '(french english))
= (french english)
? (tr-load-base #f"examples/real-estate.bdf")
= t
? (setf co (tr-find-concept "house"))
= (tr-concept "house")
? (setf ob (tr-find-object co '("rue Monge" 3 2)))
= (tr-object (tr-concept "house") '("rue Monge" 3 2 ))
? (tr-get-value ob "surface")
= 45.
? (exit)
$ 

Running TROEPS as a WWW server

See the "Knowledge server" part.

Editing knowledge bases under emacs

A simple TROEPS mode is available under emacs (emacs 19 or above) when you add the following line in your .emacs:
(load-file "$TRDIR/emacs/troeps-emacs.elc")
 
The mode is triggered by files with .bdf and .idf extensions. It provides a very useful "fontification" of knowledge bases (colouring or changing fonts of keywords, strings... on the fly) and a pop-up menu allowing to insert a new frame (new concept, new bridge...) in a base.

Recompiling the TROEPS libraries

This feature is not available yet (except if you do it under the TALK environment in which case you should refer to the Ilog TALK manual).

Using the TROEPS libraries

TROEPS extension is programmed in Ilog TALK. However, it can be used from an alien language (C, C++, etc.). For that purpose, TROEPS is supplied with several libraries ( libtrp, libtrl, libtrh, libtrr and libtrt) along with the corresponding include file ( trp.h, trl.h) which enables its use from these languages. Some slight changes with regard to the manual must be observed:
An example of C file using TROEPS is the following (which can be found under $TRDIR/examples/cmain):
#include <stdio.h>
#include <ctype.h>
#include <trp.h>
#include <trl.h>

#if defined(__STDC__) || defined(__cplusplus)
extern int IltInit(int argc, char** argv, char** envp);
#else
extern int IltInit();
#endif

#if defined(__STDC__) || defined(__cplusplus)
int main(int argc, char** argv, char** envp)
#else
int main(argc, argv, envp)
int argc; char **argv, envp;
#endif
{ 
  void *ob, *co;
  double *surf;

  void** vector_concept_views;

  IltInit(argc, argv, envp);
  tr_init();
  tr_set_language(TR_STR("french"));
  tr_load_base(TR_FILENAME("../real-estate.bdf"));
  co = tr_find_concept(TR_STR("house"));
  ob = tr_find_object(co, TR_CONS( TR_STR("rue Monge"),
                                   TR_CONS( TR_INT(3),
                                            TR_LIST( TR_INT(2)))));
  vector_concept_views = TR_VECTOR(0);
  surf = tr_get_value(ob, TR_STR("surface"), vector_concept_views);
  
  printf("%.2f is the value of the surface of %s.\n",
         *surf, ilt_string(ob));
  return(0);
}
It can be compiled through the following Makefile:
ILTINC=${ILT_DIR}/talk/common

# edit this variable for computing
TRPDIR=/home/lotse/sherpa/TROEPS.0/src
INC=${TRPDIR}/include
LDDIR=${TRPDIR}/${PORTNAME}/lib
MODULO=${TRPDIR}/${PORTNAME}/o/trtdum.o
TRELAB=${TRPDIR}/${PORTNAME}/o/trelab.o
CLIBS= -lnsl -lm -ldl

all: once Makefile

${PORTNAME}/o/pgm.o: ${INC}/trp.h ${INC}/trl.h pgm.c Makefile
        cc -g -c -PIC  pgm.c -I$(ILTINC) -I$(INC) -o ${PORTNAME}/o/pgm.o

${PORTNAME}/bin/pgm: ${PORTNAME}/o/pgm.o ${TRELAB} $(MODULO)  Makefile
        cc -PIC -o ${PORTNAME}/bin/pgm \
				-L$(LDDIR) -L${ILT_DIR}/lib/${PORTNAME} \
				${PORTNAME}/o/pgm.o ${TRELAB} $(MODULO) \
           	-ltrp -ltrl -ltrt -ltrh -l trr -liltcrt -liltrt -lilteval $(CLIBS)

once: ${PORTNAME}/bin/pgm
	${PORTNAME}/bin/pgm
The elaboration of the program takes a while for saving an image of the resulting state. You can now call your program by ${PORTNAME}/bin/pgm.

Reporting bugs/getting advice

This can be done preferably through mail to troeps@inrialpes.fr.