Code Monkey home page Code Monkey logo

z3-playground's Introduction

z3-playground

A repository to store Z3-python scripts you can use as examples, reminders, whatever.

If you have such examples, practical or not, feel free to contact me to add them ; would be cool to compile a list of relevant scripts :)!

z3-playground's People

Contributors

0vercl0k avatar chadbrewbaker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

z3-playground's Issues

Hi! may I have a question?

can you give hint me why case2 doesn't work??

root@ubuntu:/root# cat test.py

!/usr/bin/env python

from z3 import *

CASE1

key = BitVec("tag", 32)
solve(RotateRight(key, 7) == 0x9a000000)

CASE2

tag = BitVec("tag", 32)
key = BitVecVal(0, 32)
key = key + tag
RotateRight(key, 7)
solve(key == 0x9a000000, tag == 77)
root@ubuntu:/root# ./test.py
[tag = 77]
no solution

Example of MAXSMT?

Hello!

I saw here that Z3 supports having hard and soft constraints using assert-soft. However, I'm wondering if you know how I can use the python API to do that?

Cheers,
Varun

Hi I have a question

from z3 import *

a, b = BitVecs('a b', 32)
c, d = Ints('c d')
solve(a + b == 1337)
solve(c + d == 1337)

s = Solver()
s.add(a + b == 1337)
print s.check()
print s.model()

s = Solver()
s.add(c + d == 1337)
print s.check()
print s.model()

s = Solver()
s.add(a + b == 1337)
s.push()
s.add(a*a == 32)
print s
print s.check()

s.pop()
print s
print s.check()
print s.model()
print (469762080 + 3825206553) & 0xffffffff

root@ubuntu:~/z3-playground/essentials# python test.py
[b = 0, a = 1337]
[d = 0, c = 1337]
sat
[b = 0, a = 1337]
sat
[d = 0, c = 1337]
[a + b == 1337, a*a == 32]
unsat
[a + b == 1337]
sat
[b = 469762080, a = 3825206553]
1337

my test result show me that push&pop operation affect to result.

but It's not what I want. How can I fix it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.