Representing RTNs in Prolog

Since an RTN consists of a set of networks, as opposed to the single monolithic FSTN, the data structure we use to represent the RTN needs to have a way of indicating which bits belong to which subnetwork. If we think of each subnetwork having a name, then we can add a further argument to each predicate of our existing FSTN data structure and use this argument to indicate which component of the network the clause belongs to. This leads to a predicate of the form:

arc(Departure_node, Destination_node, Label, Subnetwork).

The way this works can be readily seen from our simple RTN for English sentences, which comprises three subnetworks, one for S, one for NP and one for VP (the code for these networks is repeated as "rtnarcs.pl" in the appendix).




% 0 is initial state of the S network: initial(0,s).

% 2 is final state of the S network: final(2,s).

% the S network contains an arc from 0 to 1 with label NP: arc(0,1,np,s).

% the S network contains an arc from 1 to 2 with label VP: arc(1,2,vp,s).

initial(0,np). final(2,np).

arc(0,1,det,np). arc(1,2,n,np). arc(2,3,wh,np). arc(3,2,vp,np).

initial(0,vp). final(1,vp). final(2,vp). arc(0,1,v,vp). arc(1,2,np,vp). arc(1,3,that,vp). arc(3,2,s,vp).

Notice how each subnetwork has its own initial and final statements in addition to the set of arcs that define it. And observe also how the same integer can represent different nodes, thus each subnetwork has a node "2", but the 2-node in the S network is wholly unrelated to the 2-node in the VP network.

Code:examples.pl

Send us a comment.



[Contents] [Previous] [Next]
This document was translated by troff2html v0.21 on October 22, 1996.