Summary
amb does not fail when there's no acceptable values
Metadata
- Id: 6f4e1a70793a7696f2822ca429b1ac7e86ced193
- Trac id: 303
- Type: defect
- Reporter: jeronimo
- Owner:
- Cc:
- Status: closed
- Component: extensions
- Estimated difficulty:
- Resolution: fixed
- Priority: minor
- Milestone:
- Version:
- Changetime: 2010-08-25 23:11:38 UTC
- Created: 2010-08-04 15:14:22 UTC
- Keywords: amb egg
Description
Hi,
It seems that amb will not fail at all when there are no acceptable values:
(let ((a (amb 1 2 3))
(b (amb -1 -2 -3)))
(required (> (+ a b) 10))
(print (list a b)))
==> (3 -1)
As I understand, it should have failed just like (amb) without arguments would...
This is version 2.1.2 of amb with Chicken 4.5.7 (experimental).
J.
Changes and comments
[2010-08-06 23:04:39 UTC] kon changed status from new to closed
[2010-08-06 23:04:39 UTC] kon set resolution to worksforme
[2010-08-06 23:04:39 UTC] kon wrote:
csi -n
CHICKEN (c)2008-2010 The Chicken Team (c)2000-2007 Felix L. Winkelmann Version 4.5.6 macosx-unix-gnu-ppc [[|symbolgc manyargs dload ptables gchooks ]] compiled 2010-07-10 on Nikko-2.local (Darwin) #;1> (use amb amb-extras)
#;2> (let ((a (amb 1 2 3))
(b (amb -1 -2 -3))) (required (> (+ a b) 10)) (print (list a b)))
Error: (amb) expression tree exhausted
Call history: <eval> (> (+ a b) 10) <eval> (+ a b) <eval> ((amb#amb-failure-continuation)) <eval> (amb#amb-failure-continuation) <eval> (> (+ a b) 10) <eval> (+ a b) <eval> ((amb#amb-failure-continuation)) <eval> (amb#amb-failure-continuation) <--
[2010-08-25 20:10:11 UTC] jeronimo changed status from closed to reopened
[2010-08-25 20:10:11 UTC] jeronimo removed version 4.6.0
[2010-08-25 20:10:11 UTC] jeronimo removed resolution worksforme
[2010-08-25 20:10:11 UTC] jeronimo wrote:
Hi,
It seems that the bug is now reproducible with the master branch of Chicken also:
$ csi CHICKEN (c)2008-2010 The Chicken Team (c)2000-2007 Felix L. Winkelmann Version 4.6.0rc1 linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables ] compiled 2010-08-09 on newton (Linux) #;1> (use amb amb-extras) ... #;2> (let ((a (amb 1 2 3)) (b (amb -3 -2 -1))) (required (= (+ a b) 0)) (list a b)) (1 -1) #;3> (let ((a (amb 1 2 3)) (b (amb -3 -2 -1))) (required (= (+ a b) 10)) (list a b)) (2 -2) #;4> (let ((a (amb 1 2 3)) (b (amb -3 -2 -1))) (required (= (+ a b) 0)) (list a b)) (1 -1) #;5> (let ((a (amb 1 2 3)) (b (amb -3 -2 -1))) (required (= (+ a b) 0)) (required (even? a)) (list a b)) (2 -2) #;6> (let ((a (amb 1 2 3)) (b (amb -3 -2 -1))) (required (= (+ a b) 50)) (required (even? a)) (list a b)) (2 -2)
This is fc8d57e897df9eefd638b9358250fbd3069c70f9 from git master; I have reinstalled amb before running these tests.
[2010-08-25 23:11:38 UTC] jeronimo changed status from reopened to closed
[2010-08-25 23:11:38 UTC] jeronimo set resolution to fixed
[2010-08-25 23:11:38 UTC] jeronimo wrote:
... and a couple of hours later, with aa5874e1fc35c8d343771ce9dd954b87dc3551a0, the bug is gone. Sorry for the noise!