$TRINDIKIT
, the following
steps are needed to start a system:trindikit.pl
located in $TRINDIKIT/core/prolog
control
(for starting the Trindikit
controller) or oaa_slave
(for connecting to OAA and wait
for requests)CTRL-C
in the controllers terminal.
tkit-
prefix
has been added. DSB does not need to define the search paths and
library directories for Trindikit files. However DSB-defined files and
modules must be in a SICStus library directory. The directory in which
the Trindikit core modules reside, e.g. for starting the system and
accessing TIS, is not a library directory anymore, but resides in a
special "trindikit" namespace. Thus, when e.g. writing a module that
needs TIS access, write the following to load the tkit_tis_access
module:
:- use_module(trindikit(tkit_tis_access)).The directories containing predefined Trindikit modules and datatypes are library directories.
:- use_module( trindikit(tkit_properties), [prop/2,setprop/2,
addprop/3, deleteprop/3] ).
setprop(+P, +V)
sets property P
to
value V
if V
is a valid
value for property P
. Otherwise it fails. prop(?P,?V)
reads the value V
of
property P
. Can be used to enumerate properties.addprop(+P, +PermittedValues, +Default )
adds
user-defined property P
. PermittedValues
is
a list of values that P
can take, Default
is the
default value. It can also be used to redefine a property (and should
possibly be called defineprop
or defprop
instead).deleteprop(+P)
deletes property P
so
that it is no longer can be read or
set. is_valid_prop_name(Atomic):-
atomic(Atomic).
is_valid_prop_name(A-B):-
is_valid_prop_name(A),
is_valid_prop_name(B).
Property |
Default value |
Permitted value |
Description |
tis |
no |
no or yes |
The value of property tis
determines whether the agent is a TIS agent
or not, i.e. whether it contains an information state. |
tis-datatype_files |
[] |
a list of files containing
datatype definitions |
A list of files containing
datatype definitions, including resource interfaces. All files should
be in a library directory. Replaces selected_datatypes/1
and parts of file resource_interfaces.pl . |
tis-infostate |
none |
none or Var:Type ,
where Var is a variable name (typically is ),
and Type is a type definition |
The definition of the
information state proper. Replaces file infostate.pl . |
tis-mivs |
[] |
a list containing elements of
the form Var:Type , where Var is a variable
name, and Type is a type definition |
The definition of the module
interface variables. Replaces file module_interfaces.pl . |
tis-rivs |
[] |
a list containing elements of
the form Var:Type , where Var is a variable
name, and Type is a type definition |
The definition of the resource
interface variables. Replaces parts of file resource_interfaces.pl .
|
tis-typecheck |
no |
no or yes |
Whether TIS checks and updates
should be type checked. Replaces flag typecheck . |
tis-reset_ops |
[] |
a list of TIS updates |
Updates to be performed at TIS
reset. Replaces reset_operations/1 . |
tis-macros |
[] |
a list containing elements of
the form macro_cond(M,C) or macro_op(M,O)
where C is a TIS condition or a list of TIS conditions
and O is a TIS operation or a list of TIS operations |
Macro definitions. Macros are
shorthand forms for TIS updates or checks. Replaces optional file macros.pl . |
tis-aliases |
[] |
a list containing elements of
the form alias(Alias,Path) |
Alias definitions. Aliases are
shorthand forms for paths. Replaces optional file alias.pl . |
tis-output_format |
text |
text or xml
or latex |
Defines how update rules are
printed. Replaces flag output_format . |
tis-print_state |
all |
all or is or
no |
Defines what parts of the TIS
should be printed when print_state is called. Replaces
flag print_state . |
tis-print_rules |
yes |
yes or no |
Defines whether update rules
should be printed when executed. Replaces flag print_rules . |
modules |
[] |
a list containing elements of
the form Module:File , where Module is the
name of the module and File is the file in which it is
declared |
Defines the Trindikit agent's
modules. A module M declared in a file F must
be declared as a prolog module named M . All exported
predicates are considered module algorithms by trindikit. Replaces predicate selected_modules/1 . |
resources |
[] |
a list containing (file) names
of Trindikit resources |
Defines the Trindikit agent's
resources. A resource R must be declared as a prolog
module named R . All resources must define resource_of_type/1
which states the type of the resource, i.e. the corresponding resource
interface. Replaces predicate selected_resources/1 . |
oaa |
no |
yes or no |
Defines whether the Trindikit
agent should connect to OAA and publish solvables. Needs oaa-libdir
to be set to a proper value before it is set to yes . |
oaa-name |
trindikit |
any atom |
Defines the oaa name of the
Trindikit agent. |
oaa-libdir |
'' |
a search path |
Defines the directory in which
the OAA prolog library resides. If e.g. OAA 2.3.0 is installed at /home/david/oaa2.3.0
the value of oaa-libdir should be '/home/david/oaa2.3.0/src/oaalib/prolog' .
|
control |
no |
yes or no |
Defines whether the agent should
act as a controller (i.e. execute control algorithms) or not. |
control-algorithm |
[] |
a list containing elements of
the form Trigger => SerialAlgo, where Trigger is a trigger and
SerialAlgo is a serial control algorithm |
The control algorithm used by
the controller. See Control algorithms
section. Replaces file control.pl |
read_access/1
and write_access/1
for each module. This information is not used anymore, but may be used
in future releases. :- multifile
is_resource_type/1,resource_relation/2,
resource_relation_type/2.
:- discontiguous resource_relation/2,
resource_relation_type/2.
is_resource_type(lexicon).
resource_relation( input_form, [Lexicon, Phrase,
Move] ) :-
Lexicon : input_form( Phrase,
Move ).
resource_relation_type( input_form, [ lexicon,
string, dmove ] ).
resource_relation( output_form, [Lexicon, Move,
Phrase] ) :-
Lexicon : output_form( Move,
Phrase ).
resource_relation_type( output_form, [ lexicon,
dmove, string ] ).
resource_relation( yn_answer, [Lexicon, A] ) :-
Lexicon : yn_answer( A ).
resource_relation_type( yn_answer, [ lexicon, answer
] ).
:- module( lexicon_vcr_english,
[output_form/2, input_form/2,
yn_answer/1, resource_of_type/1]).
resource_of_type( lexicon ).
output_form( Move, Phrase ) :- ...
input_form( Phrase, Move ) :- ...
yn_answer( A ) :- ...
setprop( resources, [ lexicon_vcr_english, lexicon_vcr_svenska,
device_vcr, domain_vcr ] )
setprop( tis-rivs, [ lexicon:lexicon, devices:record([]),
domain:domain ] )
setprop( tis-mivs, [ input:string, output:string,
latest_speaker:participant, latest_moves:oqueue(dmove),
next_moves:oqueue(dmove), program_state:program_state, score:real,
timeout:real, language:language ] )
ISDef = record( [ private : Private,
shared : Shared ] ),
Shared = record( [ com : set( proposition ),
actions : stackset( action ),
issues: stackset( question ),
qud : stackset( question ),
pm : set( move ),
lu : LU ] ),
Private = record( [ agenda: oqueue( action),
plan : stackset( action ),
bel : set( proposition ),
tmp : record( [ usr : TMP, sys: TMP ] ),
nim : oqueue( pair( participant, move ) ) ] ),
LU = record( [ speaker : participant,
moves : set( move ) ] ),
TMP = record( [ com : set( proposition ),
issues : stackset( question ),
qud : stackset( question ),
actions : stackset( action ),
agenda : oqueue( action ),
plan : stackset( action ) ] ),
setprop( tis-infostate, is : ISDef).
tkit_control_access
,
tkit_module_access
, and tkit_tis_access
. When a
predicate defined in one of the interfaces is called, the value of
property control
, modules
, or tis
is
checked to decide whether the call should be executed locally or if it
should be routed via OAA to another trindikit agent. Since each
Trindikit agent (connected to OAA) publishes its components
capabilities as solvables, all Trindikit agents connected to the same
facilitator can work as one system transparently. The different
components do not need to know what other components are part of the
system. Also non-Trindikit OAA agents can make use of the Trindikit
components' functionality by using the Trindikit OAA API. The real
components (called via the interfaces and the OAA API) are tkit_control
,
tkit_tis
and the modules defined by the modules
property. The interfaces tkit_control_access
,
tkit_module_access
, and tkit_tis_access
are
imported as follows:
:-use_module(trindikit(tkit_control_access)).
for tkit_control_access,
:-use_module(trindikit(tkit_module_access)).
for tkit_module_access,
:-use_module(trindikit(tkit_tis_access)).
tkit_tis_access
Predicate |
Description |
control |
Starts the control algorithm as
defined by property control-algorithm if property control
is set to yes . |
trigger(TriggerCond) |
When called:
|
Predicate |
Description |
call_module(M,A) |
When called:
|
Predicate |
Description |
check_condition(Cond) |
If property tis is
set to yes , check if condition Cond holds
of TIS, else route the call via OAA by calling oaa_Solve(tkit_check(Cond))
to give another Trindikit agent (which may be a TIS agent) the
opportunity of checking condition Cond . |
check_conditions(Conds) |
If property tis is
set to yes , check if list of conditions Conds hold,
else route call via OAA by calling oaa_Solve(tkit_check(Cond)) . |
apply_update(Op) |
If property tis is
set to yes , apply update Op to TIS, else
route call via OAA by calling oaa_Solve(tkit_apply(Op)) . |
apply_updates(Ops) |
If property tis is
set to yes , apply updates Ops to TIS, else
route call via OAA by calling oaa_Solve(tkit_apply(Ops)) . |
apply_rule(Name,Pre,Eff) |
If property tis is
set to yes , apply rule Name with
preconditions Pre and effects Eff to TIS,
else route call via OAA by calling
oaa_Solve(tkit_apply_rule(Name,Pre,Eff)) . Fails if Pre do
not hold. |
add_trigger(TriggerCond) |
If property tis is
set to yes , add trigger with trigger condition TriggerCond
to TIS, else route call via OAA by calling oaa_Solve(tkit_add_trigger(TriggerCond)) . |
clear_triggers |
If property tis is
set to yes , clear (remove) all triggers, else route call
via OAA by calling oaa_Solve(tkit_clear_triggers) . |
reset |
If property tis is
set to yes , reset TIS (set all variables to their default
value and execute reset operations defined by property tis-reset_operations ),
else route call via OAA by calling oaa_Solve(tkit_reset) . |
reset(Var) |
If property tis is
set to yes , set TIS variable Var to its
default value, else fail. |
print_state |
If property tis is
set to yes , print state as specified by property tis-print_state ,
else route call via OAA by calling oaa_Solve(tkit_print_state) . |
oaa
is
set to yes
). The Trindikit solvables are as follows:control
set
to yes
) declare:tkit_trigger(TC)
, which corresponds to tkit_control_access
predicate trigger/1
tkit_control
, which corresponds to tkit_control_access
predicate control/0
(not yet implemented)
tkit_call_module(M,A)
M
is the name of the module and A
is
the algorithm, is declared. tis
set to yes
)
declare:tkit_check(C)
, which corresponds to tkit_tis_access
predicates check_condition/1
and check_conditions/1
tkit_apply(O)
, which corresponds to tkit_tis_access
predicates apply_update/1
and apply_updates/1
tkit_apply_rule(Name,Pre,Eff)
, which corresponds to tkit_tis_access
predicate apply_rule/3
tkit_reset
, which corresponds to tkit_tis_access
predicate reset/0
tkit_add_trigger(TC)
, which corresponds to tkit_tis_access
predicate add_trigger/1
tkit_clear_triggers
, which corresponds to tkit_tis_access
predicate clear_triggers/0
tkit_print_state
, which corresponds to tkit_tis_access
predicate print_state/0