-
Notifications
You must be signed in to change notification settings - Fork 2
/
snark-system.lisp
160 lines (151 loc) · 5.08 KB
/
snark-system.lisp
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
;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: common-lisp-user -*-
;;; File: snark-system.lisp
;;; The contents of this file are subject to the Mozilla Public License
;;; Version 1.1 (the "License"); you may not use this file except in
;;; compliance with the License. You may obtain a copy of the License at
;;; http://www.mozilla.org/MPL/
;;;
;;; Software distributed under the License is distributed on an "AS IS"
;;; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
;;; License for the specific language governing rights and limitations
;;; under the License.
;;;
;;; The Original Code is SNARK.
;;; The Initial Developer of the Original Code is SRI International.
;;; Portions created by the Initial Developer are Copyright (C) 1981-2012.
;;; All Rights Reserved.
;;;
;;; Contributor(s): Mark E. Stickel <stickel@ai.sri.com>.
(in-package :common-lisp-user)
;;; load files from the same directory that this file was loaded from
(defparameter *snark-system-pathname* *load-truename*)
(defparameter *snark-files2*
'("loads"
"lisp-system"
"deque-system"
"sparse-array-system"
"numbering-system"
"agenda-system"
"infix-reader-system"
"feature-system"
"dpll-system"
"snark-pkg"))
(defparameter *snark-files*
'("useful"
"posets"
"solve-sum"
"globals"
"options"
"terms2"
"rows"
"row-contexts"
"constants"
"functions"
"variables"
"subst"
"substitute"
"symbol-table2"
"symbol-definitions"
"assertion-analysis"
"jepd-relations-tables" "jepd-relations" "date-reasoning2"
"constraints"
;; "constraint-purify"
"connectives"
"wffs"
;; "equality-elimination2"
"nonhorn-magic-set"
"dp-refute"
"sorts-functions"
"sorts-interface"
"sorts"
"argument-bag-ac"
"argument-list-a1"
"unify"
"unify-bag" "subsume-bag"
"unify-vector"
"equal"
"variant"
"alists"
"term-hash"
"trie-index"
"path-index"
"trie" "feature-vector" "feature-vector-trie" "feature-vector-index"
"term-memory"
;; "instance-graph" "instance-graph2"
"weight"
"eval"
"input"
"output"
"simplification-ordering"
"symbol-ordering"
"multiset-ordering"
"recursive-path-ordering" "ac-rpo"
"knuth-bendix-ordering2"
"rewrite"
"rewrite-code"
"code-for-strings2"
"code-for-numbers3"
"code-for-lists2"
"code-for-bags4"
"resolve-code"
"resolve-code-tables"
"main"
"subsume" "subsume-clause"
"assertion-file"
"tptp"
"tptp-symbols"
"coder"
("examples" "overbeek-test")
("examples" "front-last-example")
("examples" "steamroller-example")
("examples" "reverse-example")
("examples" "hot-drink-example")
("examples" "coder-examples")
("examples" "latin-squares")
"patches"
))
(defvar *compile-me* nil)
(defun make-snark-system (&optional (*compile-me* *compile-me*))
(pushnew :snark *features*)
#+cmu (setf extensions::*gc-verbose* nil)
(when (eq *compile-me* :optimize)
(proclaim (print '(optimize (safety 1) (space 1) (speed 3) (debug 1)))))
(with-compilation-unit ()
(dolist (name *snark-files2*)
(let* ((dir (if (consp name)
(append (pathname-directory *snark-system-pathname*) (butlast name))
(append (pathname-directory *snark-system-pathname*) (list "src"))))
(name (if (consp name) (first (last name)) name))
(file (make-pathname :directory dir :name name :defaults *snark-system-pathname*)))
(load file)))
(setf *package* (find-package :snark))
#+gcl (shadow '(#:assert #:substitute #:variable))
(dolist (name *snark-files*)
(let* ((dir (if (consp name)
(append (pathname-directory *snark-system-pathname*) (butlast name))
(append (pathname-directory *snark-system-pathname*) (list "src"))))
(name (if (consp name) (first (last name)) name))
(file (make-pathname :directory dir :name name :defaults *snark-system-pathname*)))
(load (if *compile-me*
(compile-file file)
(or (probe-file (compile-file-pathname file)) file))))))
;;#-(or symbolics mcl) (load "/home/pacific1/stickel/spice/build.lisp")
(setf *package* (find-package :snark-user))
(setf *print-pretty* nil)
#+openmcl (egc nil)
(funcall (intern (symbol-name :initialize) :snark)))
#+ignore
(defun fix-snark-files ()
(let ((dir (pathname-directory cl-user::*snark-system-pathname*)))
(dolist (x (append
(directory
(make-pathname :directory (append dir (list "src")) :name :wild :type "lisp"))
(directory
(make-pathname :directory (append dir (list "Private")) :name :wild :type "lisp"))
(directory
(make-pathname :directory (append dir (list "examples")) :name :wild :type "lisp"))
(directory
(make-pathname :directory (append dir (list "examples")) :name :wild :type "kif"))))
(ccl:set-mac-file-type x :text)
(ccl:set-mac-file-creator x :ccl2))))
;;; snark-system.lisp EOF