Appendix



next up previous
Next: About this document Up: BUG: A Directed Bottom Previous: References

Appendix

 
/* BUG final version 
   This version of the implementation serves mainly as
   documentation - probably faster implementations are
   possible 
*/
 
bug(FS,String):-
        sem(FS,Sem),
        copy_term(Sem,Sem2),
        numbervars(Sem,0,_),    %coherent
        generate(FS,Shad,P0-[]),
        phonology(P0,String),
        sem(Shad,ShadSem),
        subsume(Sem2,ShadSem).  %complete
 
generate(FS,Shad,Mother,[FS|T]-T):-
        sem(FS,Sem),
        not not sem(Mother,Sem), !, %syntactic head
        word(Word,FS,Shad).
 
generate(FS,Shad,Mother,P0-PN):-
        link(FS,Down),
        word(Word,Down,Shad2),
        up(Down,FS,Shad2,Shad,[Word|PI]-PJ,P0-PN).
 
up(X,X,Shad,Shad,P0-PN,P0-PN).
up(Down,Top,DownShad,TopShad,PI-PJ,P0-PN):-
        rule(Down,Mother,Lefts,Rights,
             DownShad,MotherShad,LeftsShad,RightsShad),
        link(Top,Mother),
        generate_list(Lefts,LeftsShad,Mother,PH-PI),
        generate_list(Rights,RightsShad,Mother,PJ-PK),
        up(Mother,Top,MotherShad,TopShad,PH-PK,P0-PN).
 
generate_list([],[],_,P0-P0).
generate_list([H|T],[HShad|TShad],Mother,P0-PN):-
        generate(H,HShad,Mother,P0-P1),
        generate_list(T,TShad,Mother,P1-PN).



Gertjan van Noord
Fri Nov 25 13:48:52 MET 1994