smt

Is it possible to cast a bitvector of one bit into a boolean variable in SMTLib2?

て烟熏妆下的殇ゞ 提交于 2019-12-01 21:22:18
I want to have a boolean variable that test if, e.g., the third bit of a bit vector is 0. The theory of bitvector allows to extract 1 bit as a bitvector, but not a boolean type. I wonder if I can do this cast. Thank you. === Update === I'm sorry if my question is not clear. But the answer of Nikolaj Bjorner is how to test a certain bit of a bit vector. While I want to assign the value of the first bit of a bit vector to a variable. I try to modify the example as follows: (declare-fun x () (_ BitVec 5)) (declare-fun bit0 () Bool) (assert (= (= #b1 ((_ extract 0 0) x)) bit0 )) (check-sat) And z3

With Hyper Threading, threads of one physical core are exchanging via what level of cache L1/L2/L3?

天大地大妈咪最大 提交于 2019-12-01 20:51:04
Does the Hyper Threading allow to use of L1-cache to exchange the data between the two threads, which are executed simultaneously on a single physical core, but in two virtual cores? With the proviso that both belong to the same process, i.e. in the same address space. Page 85 (2-55) - Intel® 64 and IA-32 Architectures Optimization Reference Manual : http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-optimization-manual.pdf 2.5.9 Hyper-Threading Technology Support in Intel® Microarchitecture Code Name Nehalem ... Deeper buffering and enhanced resource

Which statistics indicate an efficient run of Z3?

限于喜欢 提交于 2019-12-01 20:23:27
The SMTLib2 directive (get-info all-statistics) displays several numbers, e.g. num. conflicts: 4 num. propagations: 0 (binary: 0) num. qa. inst: 23 In order to test different axiomatisations and encodings I'd like to know which of those numbers are appropriate to declare that one Z3 run is better/more efficient than another. Guessing from the names I'd say that num. qa. inst - the number of quantifier instantiations - is a good indicator (lower = better), but what about the others? Number of quantifier instantiations is a good measure for checking whether your axiomatisation is producing too

While loop for Z3 or Smt2

夙愿已清 提交于 2019-12-01 19:18:00
How to convert a simple while loop(c- code) to smt2 language or z3? For ex : int x,a; while(x > 10 && x < 100){ a = x + a; x++; } The input language to an SMT solver is first-order logic (with theories) and as such has no notion of computational operations such as loops. You can either use a loop invariant to encode an arbitrary loop iteration (and the pre- and post-state of the loop) and prove your relevant properties with respect to that arbitrary iteration, which is what deductive program verifiers such as Boogie, Dafny or Viper do or, if the number of iterations is statically known, you

Which logics are supported by z3?

删除回忆录丶 提交于 2019-12-01 17:40:22
Is there a complete listing of all theories/logics that z3 supports? I have consulted this SMTLIB Tutorial which provides a number of logics, but I do not believe that the list is exhaustive. The z3 documentation itself doesn't seem to specify which logics are supported. I ask because I have an smt file which cannot be solved under any of the logics in the SMTLIB Tutorial (when specified with 'set-logic'), but can be solved when no logic is specified. For Z3, I have not seen such a list in the documentation, but you can find it in the source code if you really want to know. The list starts

Which logics are supported by z3?

青春壹個敷衍的年華 提交于 2019-12-01 16:28:43
问题 Is there a complete listing of all theories/logics that z3 supports? I have consulted this SMTLIB Tutorial which provides a number of logics, but I do not believe that the list is exhaustive. The z3 documentation itself doesn't seem to specify which logics are supported. I ask because I have an smt file which cannot be solved under any of the logics in the SMTLIB Tutorial (when specified with 'set-logic'), but can be solved when no logic is specified. 回答1: For Z3, I have not seen such a list

Z3 patterns and injectivity

主宰稳场 提交于 2019-12-01 09:18:04
In the Z3 tutorial, section 13.2.3, there is a nice example on how to reduce the number of patterns that have to be instantiated when dealing with the axiomatisation of injectivity. In the example, the function f that has to be stated injective, takes an object of type A as input and return an object of type B. As far as I understand the sorts A and B are disjunct. I have an SMT problem (FOL+EUF) on which Z3 seems not to terminate, and I am trying to isolate the cause. I have a function f:A->A that I assert being injective. Could the problem be that the domain and codomain of f coincide?

Representing temporal constraints in SMT-LIB

杀马特。学长 韩版系。学妹 提交于 2019-12-01 06:26:43
I'm trying to represent temporal constraints in SMT-LIB in order to check their satisfiability. I'm looking for feedback on the direction I'm taking. I'm relatively new to SMT-LIB and I'll highly appreciate inputs. The constraints that I have are about the time and duration of events. For example, consider the following constraints given in natural language: John started writing an essay at 13:03:41, and it took him 20 min to complete it. After writing, he checked his emails, which took him more than 40 min. After checking his emails, he phoned his wife. He phoned his wife after 14:00:00. It

Representing temporal constraints in SMT-LIB

落爺英雄遲暮 提交于 2019-12-01 04:51:40
问题 I'm trying to represent temporal constraints in SMT-LIB in order to check their satisfiability. I'm looking for feedback on the direction I'm taking. I'm relatively new to SMT-LIB and I'll highly appreciate inputs. The constraints that I have are about the time and duration of events. For example, consider the following constraints given in natural language: John started writing an essay at 13:03:41, and it took him 20 min to complete it. After writing, he checked his emails, which took him

Use Z3 and SMT-LIB to get a maximum of two values

泄露秘密 提交于 2019-11-30 23:19:46
How do I get the maximum of a formula using smt-lib2? I want something like this: (declare-fun x () Int) (declare-fun y () Int) (declare-fun z () Int) (assert (= x 2)) (assert (= y 4)) (assert (= z (max x y)) (check-sat) (get-model) (exit) Of course, 'max' is unknown to smtlibv2. So, how can this be done? In Z3, you can easily define a macro max and use it for getting maximum of two values: (define-fun max ((x Int) (y Int)) Int (ite (< x y) y x)) There is another trick to model max using uninterpreted functions, which will be helpful to use with Z3 API: (declare-fun max (Int Int) Int) (assert