;;; *****************************
;;; *  PORTABLE AI LAB  - IDSIA *
;;; *****************************
;;;  
;;; Filename:    Net-4 
;;; Module:      ATN AUGMENTED TRANSITION NETWORKS
;;; Author(s):   Mike Lenz - Fabio Baj 
;;; Short Desc:  A sample network file
;;;===================================================================

;; This is based on a network given in Woods (1973)
;; that handles simple interrogatives through the
;; use of registers.
;; Sample sentence:
;;   "Is the man eating a pizza with Marco?"
;;



(in-package :atn)
(setq *network*
  '(
    (S
     (regs AUX TYPE SUBJ V VP)
     (init (progn (setr AUX nil)
		  (setr TYPE nil)))
     (0 (push NP 1 t () (progn
			  (setr TYPE 'DCL)
			  (setr SUBJ *)))
	(cat AUX 2 t (progn
		       (setr TYPE 'Q)
		       (setr AUX *))))
     (1 (cat V 4 t (progn
		     (setr AUX nil)
		     (setr V *)))
	(cat AUX 3 t (setr AUX *)))
     (2 (push NP 3 t () (setr SUBJ *)))
     (3 (cat V 4 t (setr V *)))
     (4 (push NP 5 t ()
	      (setr VP (build 'VP (build 'V V) *)))
	(pop t (build 'S TYPE SUBJ AUX V)))
     (5 (push PP 5 t ()
	      (setr VP (append (getr VP) (list *))))
	(pop t
	     (build 'S TYPE SUBJ AUX VP))))
    (NP
     (regs PN DET N)
     (0 (cat NPR 3 t (setr PN *))
	(cat DET 1 t (setr DET *)))
     (1 (cat N 2 t (setr N *)))
     (2 (pop t (build 'NP (build 'DET DET) (build 'N N))))
     (3 (pop t (build 'NP PN))))
    (PP
     (regs NP PREP)
     (0 (cat PREP 1 t (setr PREP *)))
     (1 (push NP 2 t () (setr NP *)))
     (2 (pop t (build 'PP PREP NP)))
     )))
    



