6
6
(include-book "sets")
10
; ; David Rager, 3/1/2013: Disabling waterfall parallelism because this book
11
; allegedly uses memoization while performing its proofs.
13
(if (and (hons-enabledp state)
14
(f-get-global 'parallel-execution-enabled state))
15
(er-progn (set-waterfall-parallelism nil)
16
(value '(value-triple nil)))
17
(value '(value-triple nil)))
20
8
(defmacro qcons (x y)
21
9
;; should this be called qhons?
22
10
`(cond ((or (and (eq ,x t) (eq ,y t))
176
164
(defun q-no-conflicts (x list)
178
Determines if bipartition x is consistent with each of those in list. ~/
181
(1) x - a bipartition
182
(2) list - a list of bipartitions
184
Details: Set operations are used to determine if the bipartition x does not
185
conflict with each of the bipartitions in list. Bipartitions must
186
be bdd based (as opposed to list based) and the underlying taxa list
187
must be preserved between x and each member of list.
188
The bipartitions are assumed to be ordered such that no bipartition
189
x following y in list exists such that y is a subset of x and x=/y.
190
See also no-conflicts (list based)."
166
;;; Legacy doc string replaced Nov. 2014 by auto-generated defxdoc form;
167
;;; see projects/taspi/taspi-xdoc.lisp.
169
; ":Doc-Section TASPI
170
; Determines if bipartition x is consistent with each of those in list. ~/
173
; (1) x - a bipartition
174
; (2) list - a list of bipartitions
176
; Details: Set operations are used to determine if the bipartition x does not
177
; conflict with each of the bipartitions in list. Bipartitions must
178
; be bdd based (as opposed to list based) and the underlying taxa list
179
; must be preserved between x and each member of list.
180
; The bipartitions are assumed to be ordered such that no bipartition
181
; x following y in list exists such that y is a subset of x and x=/y.
182
; See also no-conflicts (list based)."
191
183
(declare (xargs :guard t))
193
185
(if (q-and x (car list))
211
203
(dis+ind q-no-conflicts)
213
205
(defun q-no-conflicts-gen (x list)
215
Determines if bipartition x is consistent with each of those in list. ~/
218
(1) x - a bipartition
219
(2) list - a list of bipartitions
221
Details: Set operations are used to determine if the bipartition x does not
222
conflict with each of the bipartitions in list. Bipartitions must
223
be bdd based (as opposed to list based) and the underlying taxa list
224
must be preserved between x and each member of list.
225
Assumes no ordering of bipartitions in list.
226
See also q-no-conflicts."
207
;;; Legacy doc string replaced Nov. 2014 by auto-generated defxdoc form;
208
;;; see projects/taspi/taspi-xdoc.lisp.
210
; ":Doc-Section TASPI
211
; Determines if bipartition x is consistent with each of those in list. ~/
214
; (1) x - a bipartition
215
; (2) list - a list of bipartitions
217
; Details: Set operations are used to determine if the bipartition x does not
218
; conflict with each of the bipartitions in list. Bipartitions must
219
; be bdd based (as opposed to list based) and the underlying taxa list
220
; must be preserved between x and each member of list.
221
; Assumes no ordering of bipartitions in list.
222
; See also q-no-conflicts."
227
223
(declare (xargs :guard t))
229
225
(if (q-and x (car list))
236
232
(defun q-no-conflicts-list (list)
238
Determines if the list of bipartitions list is consistent. ~/
241
(1) list - a list of bipartitions
243
Details: Set operations are used to determine if the list of bipartitions
244
do not conflict. Bipartitions must be list based (as opposed to
245
bdd based), and an underlying taxa list must be preserved between
246
every pair of bipartitions in the list. The bipartitions are
247
assumed to be ordered such that no bipartition x following y in
248
list exists such that y is a subset of x and x=/y.
249
See also no-conflicts-list (list based) and q-no-conflicts-list-gen."
234
;;; Legacy doc string replaced Nov. 2014 by auto-generated defxdoc form;
235
;;; see projects/taspi/taspi-xdoc.lisp.
237
; ":Doc-Section TASPI
238
; Determines if the list of bipartitions list is consistent. ~/
241
; (1) list - a list of bipartitions
243
; Details: Set operations are used to determine if the list of bipartitions
244
; do not conflict. Bipartitions must be list based (as opposed to
245
; bdd based), and an underlying taxa list must be preserved between
246
; every pair of bipartitions in the list. The bipartitions are
247
; assumed to be ordered such that no bipartition x following y in
248
; list exists such that y is a subset of x and x=/y.
249
; See also no-conflicts-list (list based) and q-no-conflicts-list-gen."
250
250
(declare (xargs :guard t))
252
252
(and (q-no-conflicts (car list) (cdr list))
266
266
(dis+ind q-no-conflicts-list)
268
268
(defun q-no-conflicts-list-gen (list)
270
Determines if the list of bipartitions list is consistent. ~/
273
(1) list - a list of bipartitions
275
Details: Set operations are used to determine if the list of bipartitions
276
do not conflict. Bipartitions must be list based (as opposed to
277
bdd based), and an underlying taxa list must be preserved between
278
every pair of bipartitions in the list. No ordering on the
279
bipartitions is assumed.
280
See also q-no-conflicts-list."
270
;;; Legacy doc string replaced Nov. 2014 by auto-generated defxdoc form;
271
;;; see projects/taspi/taspi-xdoc.lisp.
273
; ":Doc-Section TASPI
274
; Determines if the list of bipartitions list is consistent. ~/
277
; (1) list - a list of bipartitions
279
; Details: Set operations are used to determine if the list of bipartitions
280
; do not conflict. Bipartitions must be list based (as opposed to
281
; bdd based), and an underlying taxa list must be preserved between
282
; every pair of bipartitions in the list. No ordering on the
283
; bipartitions is assumed.
284
; See also q-no-conflicts-list."
281
285
(declare (xargs :guard t))
283
287
(and (q-no-conflicts-gen (car list) (cdr list))
287
291
; Finds bipartitions in l that refine bipartition tree.
288
292
(defun subtrees-implying (branch l)
290
Returns bipartitions that refine a tree *below* the branch given.~/
293
(1) branch - a bdd based bipartition
294
(2) l - a list of bdd based bipartitions
296
Details: All bipartitions must be based on the same taxa list.
297
*Below* is defined in terms of the rooting given by taxa list."
294
;;; Legacy doc string replaced Nov. 2014 by auto-generated defxdoc form;
295
;;; see projects/taspi/taspi-xdoc.lisp.
297
; ":Doc-Section TASPI
298
; Returns bipartitions that refine a tree *below* the branch given.~/
301
; (1) branch - a bdd based bipartition
302
; (2) l - a list of bdd based bipartitions
304
; Details: All bipartitions must be based on the same taxa list.
305
; *Below* is defined in terms of the rooting given by taxa list."
298
306
(declare (xargs :guard t))
299
307
(cond ((atom l) nil)
300
308
((qs-subset (car l) branch)
317
325
(dis+ind subtrees-implying)
319
327
(defun subtrees-not-implying (branch l)
321
Returns bipartitions that are not *below* the branch given.~/
324
(1) branch - a bdd based bipartition
325
(2) l - a list of bdd based bipartitions
327
Details: All bipartitions must be based on the same taxa list.
328
*Below* is defined in terms of the rooting given by taxa list."
329
;;; Legacy doc string replaced Nov. 2014 by auto-generated defxdoc form;
330
;;; see projects/taspi/taspi-xdoc.lisp.
332
; ":Doc-Section TASPI
333
; Returns bipartitions that are not *below* the branch given.~/
336
; (1) branch - a bdd based bipartition
337
; (2) l - a list of bdd based bipartitions
339
; Details: All bipartitions must be based on the same taxa list.
340
; *Below* is defined in terms of the rooting given by taxa list."
329
341
(declare (xargs :guard t))
330
342
(cond ((atom l) nil)
331
343
((not (qs-subset (car l) branch))