delete .hash-size. which is useless.
Toshimi Sawada
5 years ago
69 | 69 |
(parse-begin-time 0)
|
70 | 70 |
(time-for-parsing 0.0)
|
71 | 71 |
(rewrite-begin-time 0)
|
72 | |
(time-for-rewriting 0.0)
|
73 | |
(.hash-size. 0))
|
|
72 |
(time-for-rewriting 0.0))
|
74 | 73 |
(declare (special *m-pattern-subst*
|
75 | 74 |
.rwl-context-stack.
|
76 | 75 |
.rwl-states-so-far.
|
|
88 | 87 |
$$cond
|
89 | 88 |
$$target-term
|
90 | 89 |
$$norm
|
91 | |
*do-empty-match*
|
92 | |
.hash-size.))
|
|
90 |
*do-empty-match*))
|
93 | 91 |
(declare (type (or null t) *perform-on-demand-reduction* *do-empty-match*)
|
94 | 92 |
(type fixnum *steps-to-be-done* $$matches *rule-count* .rwl-states-so-far.
|
95 | 93 |
*term-memo-hash-hit*)
|
|
131 | 129 |
*term-memo-hash-hit*)
|
132 | 130 |
|
133 | 131 |
(defun number-hash-size ()
|
134 | |
.hash-size.)
|
|
132 |
;; .hash-size.
|
|
133 |
(hash-table-count *term-memo-table*))
|
135 | 134 |
;;
|
136 | 135 |
(defun clear-rewriting-fc (module mode)
|
137 | 136 |
(setf *m-pattern-subst* nil
|
|
174 | 173 |
(defun reset-rewrite-counters ()
|
175 | 174 |
(setf $$matches 0
|
176 | 175 |
*rule-count* 0
|
177 | |
*term-memo-hash-hit* 0
|
178 | |
.hash-size. 0))
|
|
176 |
*term-memo-hash-hit* 0))
|
179 | 177 |
|
180 | 178 |
;; reset-term-memo-table
|
181 | 179 |
(defun reset-term-memo-table (module)
|
182 | 180 |
(when (or *clean-memo-in-normalize*
|
183 | 181 |
(not (eq module *memoized-module*)))
|
184 | 182 |
(clear-term-memo-table *term-memo-table*)
|
185 | |
(when *clean-memo-in-normalize*
|
186 | |
(setq .hash-size. (hash-table-count *term-memo-table*)))
|
187 | 183 |
(setq *memoized-module* module)))
|
188 | 184 |
|
189 | 185 |
;; prepare-reduction-env
|
152 | 152 |
(declaim (inline set-hashed-term))
|
153 | 153 |
(defun set-hashed-term (term-id term-hash-table value)
|
154 | 154 |
(setf (gethash term-id term-hash-table) value)
|
155 | |
(incf (the fixnum .hash-size.)))
|
|
155 |
;; (incf (the fixnum .hash-size.))
|
|
156 |
)
|
156 | 157 |
|
157 | 158 |
;;; BASIC COMMON ROUTINES FOR REWRITING
|
158 | 159 |
|
|
953 | 954 |
;; compute the normal form of "term"
|
954 | 955 |
(reduce-term term strategy)
|
955 | 956 |
(when (and term-id
|
956 | |
(<= (the fixnum (hash-table-count *term-memo-table*))
|
957 | |
(the fixnum *hash-count-limit*)))
|
|
957 |
(< (the fixnum (hash-table-count *term-memo-table*))
|
|
958 |
(the fixnum *hash-count-limit*)))
|
958 | 959 |
(set-hashed-term term-id *term-memo-table* term))
|
959 | 960 |
term))))
|
960 | 961 |
|