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

;;; File: agile-kpml-kr.lisp
;;;
;;; This should contain all that is necessary to load/compile the
;;; AGILE knowledge representation system to be used with KPML.
;;; It also provides another example of how to configure KPML for use
;;; with different KR systems.
;;;
;;; Note:
;;; KPML can be persuaded to take this file rather than any other
;;; by presetting the variable common-lisp-user::*kpml-kr-loader* to 
;;; the pathname locating this file.

;;; ----------------------------------------------------------------------
;;; Make a pathname pointing to the top of the AGILE-DM directories hierarchy:
;;; ----------------------------------------------------------------------
;;;
;;***************************************************************************
;;*                                                                         *
;;*  IMPORTANT NOTE:                                                        *
;;*     EXTERNAL USERS MUST CHANGE THE FOLLOWING DEFVAR OR ALREADY          *
;;*     HAVE DEFINED IT IN A FILE LOADED BEFORE THIS ONE.                   *
;;*                                                                         *
;;***************************************************************************
;;                                                                          *
(defvar *agile-pathname-default* "D:/Agile-code/core/") ;<=======*
                                                                           ;*
;;; *************************************************************************
;;; *                                                                       *
;;; *     NO FURTHER CHANGES REQUIRED IN THIS FILE!!!!!!!!                  *
;;; *                                                                       *
;;; *************************************************************************

;;; ----------------------------------------------------------------------
;;; installation now proceeds on its own...

(format t "~%;;; Configuring KPML for AGILE CLOS-BASED DM")

;;; ----------------------------------------------------------------------
;;; If AGILE-DM does not already exist (i.e., it has not been loaded into
;;; the current image), then do so...
;;; ----------------------------------------------------------------------
(defvar *agile-dm-loader* #-unix "agile" #+unix "agile-unix")

(unless (find-package "DM")
  (load (merge-pathnames  *agile-dm-loader* *agile-pathname-default*)))

;;; ----------------------------------------------------------------------
;;; Identify the KR used to KPML...
;;; ----------------------------------------------------------------------

(defparameter *kpml-kr-system-name* 'kpml-agile)

;;; ----------------------------------------------------------------------
;;; System definitions for interfacing with AGILE DM.
;;;
;;; These files must contain the definitions of the KPML/Penman 
;;; KB-interface functions. They usually live in a subdirectory
;;; under *root-of-kpml*/Processes/kr-interface/.
;;; ----------------------------------------------------------------------

(unless (find-package 'make)
  (load (merge-pathnames "defsystem.lisp" common-lisp-user::*root-of-kpml*)))

(make:defsystem KPML-AGILE
  :source-pathname *root-of-kpml*
  :source-extension "lisp" 
  :binary-pathname *kpml-binaries-root*
  :components 
  ((:module KPML-AGILE-KR
	    :source-pathname "Processes/kr-interfaces/agile"
	    :components 
	    ((:file "kpml-agile-interface")))))

