Skip to content

Instantly share code, notes, and snippets.

@6f70
Created July 12, 2015 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save 6f70/3b1c8f51d187328849e4 to your computer and use it in GitHub Desktop.
Save 6f70/3b1c8f51d187328849e4 to your computer and use it in GitHub Desktop.
Z3 modulo by zero
import os
from z3 import *
sol = Solver()
mod = Int('mod')
sol.add(mod >= 0)
sol.add(10 % mod == 0)
os.system('z3 -version')
print(sol.check())
print(sol.model())
% python3 mod0.py
Z3 version 4.4.0
sat
[mod = 0]
%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment