Z3

有限环Z[i]/(m+ni)的结构分析(Lua版本)

纵然是瞬间 提交于 2020-03-26 08:18:49
20200325: R8_22的表示找到了,所以还剩下14种8阶环的表示没找到。 root@ubuntu:/home/cpptest/lua# ./luatest GaussianIntegers.lua z1=9+11i z2=56+3i z1+z2=65+14i z1-z2=-47+8i z1*z2=471+643i z1/z2=0+0i false 0+0i 7+5i 0-1i 0-1i -1-9i -1+4i 4+7i 4+7i -1-6i 5-5i 0,1,2,4,5,8,9,10,13,16,17,18,20,25,26,29,32,34,36,37,40,41,45,49,50,52,53,58,61,64,65,68,72,73,74,80,81,82,85,89,90,97,98,100,101,104,106,109,113,116,117,125,128,130,136,145,149,162,164,181,200, 0,1,2,4,5,8,9,10,13,16,17,18,20,25,26,29,32,34,36,37,40,41,45,49,50,52,53,58,61,64,65,68,72,73,74,80,81,82,85,89,90,97,98,100,101,104,106,109,113,116,117,121,122,125,128,130

纹理分割(二):2d-gabor 滤波器

萝らか妹 提交于 2020-03-25 08:58:36
3 月,跳不动了?>>> Gabor 变换由 D.Gabor 于 1946 年提出, 当时是为解决傅氏变换局部频率变化的不足, 而在其基础上增加窗函数, 实现有效获得信号的局部信息, 因此 Gabor 变换是一种基于窗口的短时傅氏变换 。 由于所加窗函数为高斯窗, 在频域上具有不变性, 因此 Gabor 变换能在时域与频域同时获得局部信号的变化。 在进行图像处理时, 纹理特征往往反应在局部局域的变化, 因此将 Gabor 变换改造成二维 Gabor 滤波器, 在提取图像纹理特征时取得良好效果。 经研究发现, Gabor 滤波响应与人眼视觉皮层感受野响应相似。 如下图: 第一行是人眼视觉感受野的响应模型, 第二行为 Gabor 滤波变换波形, 最后一行为二者的响应残差。 从中可以发现, Gabor 相应符合人眼视觉感受机制, 可以用来模拟人眼对图像进行处理分析。在第二章视觉显著性计算中可知, Itti 仿生显著性模型中提取的方向特征正是采用 Gabor 滤波得到的, 这进一步说明了在纹理方向性上 Gabor 对图像的处理符合人类视觉显著性特点。 从理论上分析, 二维 Gabor 滤波器之所以对增强局部纹理方面性能突出, 因为在测不准原理之下, 2D-Gabor 是唯一能够达到其下界值的高性能函数。 Gabor 变换在时频两域可同时得到函数的局部最优解, 即时域下能增强局部信息, 频域

Windows和Linux下z3的安装

青春壹個敷衍的年華 提交于 2020-03-12 14:06:18
Windows下安装z3 使用虚拟环境安装 ( z3 ) E:\venv\ > python -m venv z3 ( z3 ) E:\venv\z3\Scripts > cd z3\Scripts ( z3 ) E:\venv\z3\Scripts > activate.bat ( z3 ) E:\venv\z3\Scripts > pip install -i https://pypi.tuna.tsinghua.edu.cn/simple z3-solver ( z3 ) E:\venv\z3\Scripts > python Python 3.6.6 ( v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03 ) [ MSC v.1900 64 bit ( AMD64 ) ] on win32 Type "help" , "copyright" , "credits" or "license" for more information. >> > import z3 >> > 安装成功 Linux下安装z3 pwn@pc:~$ python3 -m venv z3 pwn@pc:~$ source ./z3/bin/activate ( z3 ) pwn@pc:~$ pip install -i https://pypi.tuna.tsinghua

Z3py, random different solution generation

雨燕双飞 提交于 2020-03-05 06:06:50
问题 from z3 import * import random a = Int('a') b = Int('b') s = Tactic('qflra').solver() s.add(a > 10) set_option('smt.arith.random_initial_value', True) set_option('smt.random_seed', random.randint(0, 2 ** 8)) while s.check() == sat: m = s.model() print m[a] s.add(a != m[a]) set_option('smt.random_seed', random.randint(0, 2 ** 8)) The result seems to be only randomed for a second... Then it just started to give consecutive numbers. 4294966399 4294966398 4294966397 4294966396 4294966395

Z3py, random different solution generation

不想你离开。 提交于 2020-03-05 06:05:26
问题 from z3 import * import random a = Int('a') b = Int('b') s = Tactic('qflra').solver() s.add(a > 10) set_option('smt.arith.random_initial_value', True) set_option('smt.random_seed', random.randint(0, 2 ** 8)) while s.check() == sat: m = s.model() print m[a] s.add(a != m[a]) set_option('smt.random_seed', random.randint(0, 2 ** 8)) The result seems to be only randomed for a second... Then it just started to give consecutive numbers. 4294966399 4294966398 4294966397 4294966396 4294966395

dafny output as SMT file

余生长醉 提交于 2020-03-05 04:13:26
问题 I successfully wrote a verified Dafny program that given an integer array, returns the length of the longest monotone prefix. The permalink is here. I want to be able to examine the SMT file Dafny used, even though there were no errors. I tried various flag options like: $ dafny example_longest_monotone.dfy /useSmtOutputFormat /printModelToFile:smt_file.smt But none seem to work? Am I wrong thinking that there must be some underlying SMT query that returned unsat in the case where Dafny

How to setup a Java development environment for Z3

不羁的心 提交于 2020-03-03 07:05:28
问题 How to setup a Java development environment for the Z3 SMT solver? Note: Written and answered by the author, see Can I answer my own question?. 回答1: Z3 is a C++ application with Java bindings. Start by downloading the native distribution, Ubuntu in our case (similar approach should work for macOS), from https://github.com/Z3Prover/z3/releases , for example: z3-4.8.7-x64-ubuntu-16.04.zip . Unzip the build to a Z3_DIR . To simplify things, have the following exports: export Z3_DIR=<some_path>

How to print z3 solver results print(s.model()) in order?

吃可爱长大的小学妹 提交于 2020-02-25 21:40:53
问题 Suppose I have a list of 10 variables v = [Real('v_%s' % (i+1)) for i in range(10)] and I want to add a simple constraint like this s = Solver() for i in range(10): s.add(v[i] == i) if s.check() == sat: print(s.model()) So a satisfying model is v_1 = 0, v_2 = 1 .... v_10 = 9 . However the output of print(s.model()) is totoally unordered which makes me confused when I have lots of variables in a bigger model. For this example, the output of my computer is v_5, v_7, v_4, v_2, v_1, v_3, v_6, v_8

How to print z3 solver results print(s.model()) in order?

白昼怎懂夜的黑 提交于 2020-02-25 21:37:37
问题 Suppose I have a list of 10 variables v = [Real('v_%s' % (i+1)) for i in range(10)] and I want to add a simple constraint like this s = Solver() for i in range(10): s.add(v[i] == i) if s.check() == sat: print(s.model()) So a satisfying model is v_1 = 0, v_2 = 1 .... v_10 = 9 . However the output of print(s.model()) is totoally unordered which makes me confused when I have lots of variables in a bigger model. For this example, the output of my computer is v_5, v_7, v_4, v_2, v_1, v_3, v_6, v_8

How to print z3 solver results print(s.model()) in order?

久未见 提交于 2020-02-25 21:35:46
问题 Suppose I have a list of 10 variables v = [Real('v_%s' % (i+1)) for i in range(10)] and I want to add a simple constraint like this s = Solver() for i in range(10): s.add(v[i] == i) if s.check() == sat: print(s.model()) So a satisfying model is v_1 = 0, v_2 = 1 .... v_10 = 9 . However the output of print(s.model()) is totoally unordered which makes me confused when I have lots of variables in a bigger model. For this example, the output of my computer is v_5, v_7, v_4, v_2, v_1, v_3, v_6, v_8