(in-package "COMMON-LISP-USER")

;;; File: kpml-kb-package-def.lisp
;;; Package declaration for independent inquiry implementations.
;;; John:IPSI:Feb 19th., 1995 (Happy Birthday James!).
;;; 2.0.1: mention to package "LISP" replaced by "COMMON-LISP".
;;;
;;; The package "KPML-KB" provides as external symbols all the
;;; Penman internal (?) symbols that are used for accessing SPL,
;;; the lexicon, text plan, etc. as described in detail below.
;;; 
;;; Thus, an inquiry package for subsequent inquiry implementation 
;;; files should then be placed in a package with a declaration such
;;; as:
;;;       (in-package "INQS" :use '("COMMON-LISP" "KPML-KB"))
;;;
;;; in order to use both Lisp and the Penman functions without
;;; further specification, i.e., as if they were internal symbols.
;;; 
;;; Note that in the list of symbols below, only *plan*, *plan-graph*,
;;; and warning are declared external symbols of the Penman package.
;;;
;;; 0.8.1: Markus notes that at least in Allegro WARNING ends up being
;;;        available to KPML-KB from both Lisp and Penman. So penman::warning
;;;        is moved to a shadowing-import here.


(unless (find-package "KPML-KB")
	(let ((penman-symbols-to-import
	       '(
;;;
;;; The following functions are used by inquiry implementations
;;; to access components of SPL expressions and to interrogate
;;; the subsumption relations of the knowledge base. 
;;;
                       penman::FETCH-FEATURE
                       penman::FETCH-FEATURE-SYMBOL
                       penman::FETCH-MINIMAL-RELATION
                       penman::FETCH-NON-MINIMAL-REIFIED-RELATION
                       penman::FETCH-REIFIED-RELATION
                       penman::FETCH-RELATION
                       penman::FETCH-RELATION-RANGE
                       penman::FETCH-RELATION-SPEC
                       penman::FETCH-SUBC-FEATURE
                       penman::FETCH-SUBC-FEATURE-NAME
                       penman::GET-GLOBAL-TERMS
                       penman::GET-SYMBOL-TERM
                       penman::GET-TOP-LEVEL-TERMS
                       penman::GLOBAL-FETCH-FEATURE
                       penman::INVERT-REIFIED-RELATION-SPEC
                       penman::KB-ENTITY?
                       penman::KB-SUPERP
                       penman::MAKE-TERM-GRAPH-ID
                       penman::TERM-EQ-P
                       penman::TERM-GRAPH-FEATURES
                       penman::TERM-GRAPH-ID
                       penman::TERM-GRAPH-PARENT
                       penman::TERM-GRAPH-SYMBOL
                       penman::TERM-GRAPH-TYPE
                       penman::TERM-ROLE-P
                       penman::TERM-TO-GRAPH
                       penman::TERM-TYPE-P
		       penman::TERM-TYPE

;;; The following functions are provided by KPML for accessing
;;; lexical information during generation. This can be done
;;; from inquiry implementations, although this should be understood
;;; as standing in for a more appropriate way of transporting
;;; features internally to the lexicogrammar. It should also
;;; be borne in mind that the lexical features will normally be
;;; in the Penman package, and so this will need to be explicitly
;;; specified for lexical/morphological inquiries residing in a
;;; different package.

                       penman::FIND-ASSOCIATION
                       penman::FUNCTIONAL-ROLE-P
                       penman::ACCESS-LEXICAL-INFORMATION
		       penman::LEXICAL-FEATURE-PRESENT-P
		       penman::LEXICAL-CLASS-ASCERTAINER
		       penman::LEXICAL-FEATURE-PRESENT-IN-ASSOCIATION-P
		       penman::LEXICAL-CLASS-OF-ASSOCIATION-ASCERTAINER
                       penman::LEXICAL-ITEM-FEATURES
                       penman::LEXICAL-ITEM-SPELLING
                       penman::LEXICAL-TERM-RESOLUTION

;;; The following functions are former Penman functions that are
;;; also used occasionally in inquiry implementations. 

                       penman::NP-SPECIFY
                       penman::OPERATOR-RUN
		       penman::PLEDGED-P
		       penman::EXPRESSED-P
;; (also want the following but this is in Lisp also: so shadow import below
;;                       penman::WARNING
;; .)
		       
;;; Following former Penman variables hold necessary information
;;; for making internal information accessible concerning
;;; the history of the generation process for supporting
;;; textual inquiries.

                       penman::*CONSUMED-TERMS*
                       penman::*PLAN*
                       penman::*PLAN-GRAPHS*

;;; Following KPML variable conditionalizes some of the morphology
;;; inquiry implementations...

		       penman::*ACTIVATE-WORD-RANK-AND-BELOW*

;;; Needed for lexicalized information

		       penman::LEXICON

;;; Following book-keeping inquiries should always be accessible...

		       penman::WHEREAMIIDCODE
		       penman::TRIVIALDEFAULTCODE

;;; Finally, some of the spl functions are actually macros and
;;; expand to involve other symbols, which, of course, must also
;;; be accessible...
		       penman::TERM-GRAPH
		       penman::ONUS

		       )))
	  (make-package "KPML-KB" :use "COMMON-LISP")
	  (import penman-symbols-to-import (find-package "KPML-KB"))
	  (shadowing-import 'penman::warning (find-package "KPML-KB"))
	  (export penman-symbols-to-import (find-package "KPML-KB"))))






