-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathlisa.asd
More file actions
220 lines (193 loc) · 6.97 KB
/
Copy pathlisa.asd
File metadata and controls
220 lines (193 loc) · 6.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
;; This file is part of Lisa, the Lisp-based Intelligent Software Agents platform.
;; MIT License
;; Copyright (c) 2000 David Young
;; Permission is hereby granted, free of charge, to any person obtaining a copy
;; of this software and associated documentation files (the "Software"), to deal
;; in the Software without restriction, including without limitation the rights
;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
;; copies of the Software, and to permit persons to whom the Software is
;; furnished to do so, subject to the following conditions:
;; The above copyright notice and this permission notice shall be included in all
;; copies or substantial portions of the Software.
;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
;; SOFTWARE.
;; Description: Lisa's ASDF system definition file. To use it, you must have asdf loaded.
;; Assuming a loaded asdf, this is the easiest way to install Lisa:
;; (push <lisa root directory> asdf:*central-registry*)
;; (asdf:load-system :lisa)
(in-package :cl-user)
#-asdf
(error "The ASDF package is required. Please load it first")
(defvar *install-root* (make-pathname :directory (pathname-directory *load-truename*)))
(push *install-root* asdf:*central-registry*)
;;; There's a bug in Lisa that is creating a symbol in the COMMON-LISP package. I need
;;; to track that down. Until then, we unlock that package in SBCL.
#+sbcl
(progn
(sb-ext:unlock-package :common-lisp)
(sb-ext:unlock-package :cl-user))
(asdf:defsystem lisa
:name "Lisa"
:version "4.1.0"
:author "David E. Young"
:maintainer "David E. Young"
:licence "MIT"
:description "The Lisa Expert System Shell"
:depends-on ("log4cl")
:in-order-to ((asdf:test-op (asdf:test-op "lisa/test")))
:components
((:module src
:components
((:module packages
:components
((:file "pkgdecl")))
(:module utils
:components
((:file "compose")
(:file "utils"))
:serial t)
(:module belief-systems
:components
((:file "belief")
(:file "protocol")
(:module certainty-factors
:components
((:file "certainty-factors")))
(:module dempster-shafer
:components
((:file "dempster-shafer"))))
:serial t)
(:module reflect
:components
((:file "reflect")))
(:module logger
:components
((:file "logger")))
(:module grouping-stack
:components
((:file "package")
(:file "item")
(:file "stack")
(:file "balancer"))
:serial t)
(:module core
:components
((:file "preamble")
(:file "conditions")
(:file "deffacts")
(:file "fact")
(:file "token")
(:file "watches")
(:file "activation")
(:file "heap")
(:file "conflict-resolution-strategies")
(:file "context")
(:file "pattern")
(:file "rule")
(:file "binding")
(:file "rule-parser")
(:file "fact-parser")
(:file "language")
(:file "tms-support")
(:file "rete")
(:file "belief-interface")
(:file "meta")
(:file "retrieve"))
:serial t)
(:module rete
:pathname "rete/reference/"
:components
((:file "node-tests")
(:file "successor")
(:file "shared-node")
(:file "node-pair")
(:file "terminal-node")
(:file "node1")
(:file "join-node")
(:file "node2")
(:file "node2-not")
(:file "node2-test")
(:file "node2-exists")
(:file "rete-compiler")
(:file "tms")
(:file "network-ops")
(:file "network-crawler"))
:serial t)
(:module config
:components
((:file "config")
(:file "epilogue"))
:serial t))
:serial t)))
;;; Dependency-free test suite. Run with (asdf:test-system :lisa) or
;;; (asdf:load-system "lisa/test") followed by (lisa-test:run-all).
(asdf:defsystem "lisa/test"
:description "Golden-master and belief-algebra test suite for Lisa (no external deps)."
:depends-on ("lisa")
:components
((:module "tests"
:serial t
:components ((:file "harness")
(:file "belief-algebra")
(:file "scenarios")
(:file "rules"))))
:perform (asdf:test-op (o c)
(unless (uiop:symbol-call "LISA-TEST" "RUN-ALL")
(error "Lisa test suite reported failures"))))
(pushnew :lisa.asdf *features*)
(pushnew :log4cl *features*)
(load (merge-pathnames "version.lisp" *install-root*))
(defvar *lisa-root-pathname*
(make-pathname :directory
(pathname-directory *load-truename*)
:host (pathname-host *load-truename*)
:device (pathname-device *load-truename*)))
(defun make-lisa-path (relative-path)
(concatenate 'string (namestring *lisa-root-pathname*)
relative-path))
(setf (logical-pathname-translations "lisa")
`(("src;**;" ,(make-lisa-path "src/**/"))
("lib;**;*.*" ,(make-lisa-path "lib/**/"))
("config;*.*" ,(make-lisa-path "config/"))
("debugger;*.*" ,(make-lisa-path "src/debugger/"))
("examples;*.*", (make-lisa-path "examples/"))
("auto-notify;*.*", (make-lisa-path "src/implementations/"))
("contrib;**;" ,(make-lisa-path "contrib/**/"))))
(defun lisa-debugger ()
#p"lisa:debugger;lisa-debugger.lisp")
;;; Sets up the environment so folks can use the non-portable form of REQUIRE
;;; with some implementations...
#+:allegro
(setf system:*require-search-list*
(append system:*require-search-list*
`(:newest ,(lisa-debugger))))
#+:clisp
(setf custom:*load-paths*
(append custom:*load-paths* `(,(lisa-debugger))))
#+:openmcl
(pushnew (pathname-directory (lisa-debugger)) ccl:*module-search-path* :test #'equal)
#+:lispworks
(let ((loadable-modules `(("lisa-debugger" . ,(lisa-debugger)))))
(lw:defadvice (require lisa-require :around)
(module-name &optional pathname)
(let ((lisa-module
(find module-name loadable-modules
:test #'string=
:key #'car)))
(if (null lisa-module)
(lw:call-next-advice module-name pathname)
(lw:call-next-advice module-name (cdr lisa-module))))))
#+sbcl
(eval-when (:load-toplevel :execute)
(defun module-provide-lisa-auto-notify (module-name)
(unless (find :lisa-auto-notify *features* :test #'eq)
(if (eq module-name 'lisa-auto-notify)
(load #p"lisa:auto-notify;sbcl-auto-notify.lisp")
nil)))
(pushnew 'module-provide-lisa-auto-notify *module-provider-functions*))