POSTORDER TRAVERSAL If you run the program, you will see the following: printf("If first time ==> morpheme -1 -1\n"); printf("If morpheme selects compl/ext arg ==> morpheme 99 compl/ext arg\n"); printf("If morpheme is selected by head ==> morpheme head 99\n"); printf("If internal merge ==> x head specifier\n"); printf("To traverse in inorder ==> t start -1\n"); To traverse in postorder t start -1 To end control z INPUT?: Please enter three arguments after the prompt 'INPUT?:'. In the first three cases, three arguments are a new morpheme, the head selecting it (if there is one), and the complement/ext argument it selects (if it does). You can start builing a sentence by entering a morpheme, followed by -1 and -1, where -1 means that it has neither a complement/external argument nor a head. 99 in the second and third statements above refers to a new morpheme itself. The fourth statement is internal merge. X means that no new morpheme is added. After building a lexical graph, you can traverse it in postorder by entering t, the starting node and -1. You can generate the sentece 'Mary-ga John-ni aw ta' (Mary met John) as follows: INPUT?: John-ni -1 -1 (John is the first input) ===Lexical Array Formed So Far=== 0 John-ga (John-ni is associated with the index 0) INPUT?: aw 99 0 (aw (meet) is added as the head selecting John-ni(=0)) ===Lexical Array Formed So Far=== 1 aw 0 John-ni ===Syntactic Relations Established So Far=== 1 --> 0 (node 1 (=aw) is related to node 0 (=John-ni)) ===End of List=== INPUT?: Mary-ga 1 99 (Mary-ga is added as the external argument of node 1 (=aw)) ===Lexical Array Formed So Far=== 2 Mary-ga 1 aw 0 John-ni ===Syntactic Relations Established So Far=== 1 --> 0 1 --> 2 ===End of List=== INPUT?: ta 99 1 (ta(past) is added as the head selecing node 1 (=aw)) ===Lexical Array Formed So Far=== 3 ta 2 Mary-ga 1 aw 0 John-ni ===Syntactic Relations Established So Far=== 1 --> 0 1 --> 2 3 --> 1 ===End of List=== INPUT?: x 3 2 (node 3 (=ta) and node 2 (=Mary-ga) are internally merged) ===Lexical Array Formed So Far=== 4 Mary-ga (Mary-ga is copied as node 4 and node 2 is struck out) 3 ta 2 -ary 1 aw 0 John-ni ===Syntactic Relations Established So Far=== 1 --> 0 1 --> 4 3 --> 1 3 --> 4 ===End of List=== INPUT?: t 3 -1 (Traverse the lexical graph in inorder with node 3 as the starting node) Inorder Traversal => Mary-ga John-ni aw ta