By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,548 Members | 1,487 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,548 IT Pros & Developers. It's quick & easy.

PyPy and constraints

P: n/a
I followed the recent anouncement of version 0.9 of PyPi and found out
that there was work included on adding constraint satisfaction solvers
to PyPy:
http://codespeak.net/pypy/dist/pypy/...space-0.9.html

I was wondering if this was a possibiity for "mainstream" python, and
wether the the algorithms used could handle the kind of use mentioned
here:

http://groups.google.com/group/comp....773320e3417d9c

Thanks, Paddy.

Jul 2 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Paddy wrote:
I followed the recent anouncement of version 0.9 of PyPi and found out
that there was work included on adding constraint satisfaction solvers
to PyPy:
http://codespeak.net/pypy/dist/pypy/...space-0.9.html

I was wondering if this was a possibiity for "mainstream" python, and
wether the the algorithms used could handle the kind of use mentioned
here:

http://groups.google.com/group/comp....773320e3417d9c

Thanks, Paddy.
See: http://www.logilab.org/projects/constraint

Hope this helps,
Ziga

Jul 2 '06 #2

P: n/a

Ziga Seilnacht wrote:
Paddy wrote:
I followed the recent anouncement of version 0.9 of PyPi and found out
that there was work included on adding constraint satisfaction solvers
to PyPy:
http://codespeak.net/pypy/dist/pypy/...space-0.9.html

I was wondering if this was a possibiity for "mainstream" python, and
wether the the algorithms used could handle the kind of use mentioned
here:

http://groups.google.com/group/comp....773320e3417d9c

Thanks, Paddy.

See: http://www.logilab.org/projects/constraint

Hope this helps,
Ziga
Thanks Ziga,
i had already had a look at that package and its very good.
But, I guess what is different about what is used in the Verification
of electronic designs is the notion of randomized variables.
if you declared a randomized variable R1 and said it was constrained
such that
0<=R1 <256
Then you could generate values of R1 which would have successive
PSEUDO-RANDOM values between 0 and 255 inclusive.
If you introduced randomized variable R2, with the constraints:
R2 >=0
R1*R2 <512

Then you could generate R1,R2 pairs that satisfy the relations and
appear pseudo-random.

Some Electronic Design Automation constraint solvers might generate all
solutions before epeating. but this is not necessary.

The idea is that you electronic designs have a huge state space to test
and so cannot be exaustively tested. If you write a deterministic test
then you are directly loading your test with bias about how you think
the design works or should be tested. With constrained random
generation you work the other way by trying to constrain test segments
to create valid tests but due to the randomness involved, the tests
generated may exercise the design in valid ways that a deterministic
test writer would not have thought of.
The method does work in practice. I'd just like to know if my favourite
language might be changing to have this capability.

- Pad.

Jul 2 '06 #3

P: n/a

Paddy wrote:
Ziga Seilnacht wrote:
Paddy wrote:
I followed the recent anouncement of version 0.9 of PyPi and found out
that there was work included on adding constraint satisfaction solvers
to PyPy:
http://codespeak.net/pypy/dist/pypy/...space-0.9.html
>
I was wondering if this was a possibiity for "mainstream" python, and
wether the the algorithms used could handle the kind of use mentioned
here:
>
http://groups.google.com/group/comp....773320e3417d9c
>
Thanks, Paddy.
- P.S. Constrained random techniques are also used for testing
software, e.g: http://www.yendor.com/testing/

Jul 3 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.