subtypep giving inconsistent results on certain cons types
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| SBCL |
Undecided
|
Unassigned |
Bug Description
If A is a subtype of B, then (NOT B) should be a subtype of (NOT A). If subtypep can determine the subtype relationship in both cases then they must be consistent. However:
(SUBTYPEP '(CONS INTEGER (CONS (REAL -3.3 4.4) (EQL 1)))
'(NOT (CONS T (CONS (NOT INTEGER) (EQL 0))))) => T, T
(SUBTYPEP '(NOT (NOT (CONS T (CONS (NOT INTEGER) (EQL 0)))))
'(NOT (CONS INTEGER (CONS (REAL -3.3 4.4) (EQL 1))))) => NIL, T
(SUBTYPEP '(CONS T (CONS (NOT INTEGER) (EQL 0)))
'(NOT (CONS INTEGER (CONS (REAL -3.3 4.4) (EQL 1))))) => NIL, T
This is in sbcl 1.3.18.
tags: | added: types |
Changed in sbcl: | |
status: | New → Incomplete |
Michał "phoe" Herda (phoe-krk) wrote : | #2 |
(let* ((t1 '(not (cons float t)))
(t2 `(or (not (cons (eql 0)
(subtypep t1 t2))
;=> NIL, T
This happens even though T2 is equivalent to T.
Paul F. Dietz (paul-f-dietz) wrote : | #3 |
That was from test SUBTYPEP.CONS.43 in ansi-test, which was added back in SBCL 0.9.6.57.
This is still occurring in 1.4.3.