GF OAA Agent

Björn Bringert, bringert@cs.chalmers.se

Introduction

The Open Agent Architecture (OAA) is "a framework for integrating a community of heterogeneous software agents in a distributed environment".

This document describes the GF OAA Agent included with the GF Java interpreter.

Running

If the grammar properties file is test.properties and the facilitator is running on $FAC_HOST, port $FAC_PORT, the GF agent is started with:

$ java -cp $CLASSPATH:gfc2java.jar:. se.chalmers.cs.gf.oaa.GFAgent test.properties -oaa_connect "tcp('${FAC_HOST}',${FAC_PORT})"

Notes

Solvables

The OAA agent declares these solvables:

parse

parse(Grammar,Lang,Text,Tree)

Parameters

Grammar
The name of the grammar. This is the value of the name parameter in the properties file.
Lang
The name of the concrete syntax that should be used for parsing. If Lang is not instantiated, the parser will try all available languages in the given grammar, and return results for each language that the text can be parsed in.
Text
The text to parse. Must be instantiated.
Tree
The parse tree. Normally not instantiated. The parse tree from the parser is unified with this value. Parse trees are represented as ICL structs.

Examples

linearize

linearize(Grammar,Lang,Tree,Text)

Parameters

Grammar
The name of the grammar. This is the value of the name parameter in the properties file.
Lang
The name of the concrete syntax that should be used for linearization. If Lang is not instantiated, linearizations for all available languages in the given grammar will be returned.
Tree
The abstract syntax tree to linearize. Must be instantiated.
Text
The linearization of the given tree.

Examples

translate

translate(Grammar,FromLang,Input,ToLang,Output)

Parameters

Grammar
The name of the grammar. This is the value of the name parameter in the properties file.
FromLang
The name of the concrete syntax that should be used for parsing the input text. If Lang is not instantiated, all available languages in the given grammar will be tried.
Input
The input text. Must be instantiated.
ToLang
The name of the concrete syntax that should be used for linearizing the output.
Output
The output text. Normally not instantiated.

Examples

list_grammars

list_grammars(Grammars)

Parameters

Grammars
The list of available grammars.

Examples

list_languages

list_languages(Grammar, InputLangs, OutputLangs)

Parameters

Grammar
The grammar to get the languages for. If uninstantiated, there will be one answer for each available grammar.
InputLangs
A list of the available input languages for the grammar.
OutputLangs
A list of the available output languages for the grammar.

Examples

load_grammar

load_grammar(PropFile,Name)

Parameters

PropFile
The path to a grammar properties file (required). This path is relative to the working directory of the GF agent.
Name
This parameter will be set to the name of the grammar. This name is the one that should be passed as the Grammar parameter to the other solvables.

Examples