theorem-proving

Z3 Theorem Prover: Pythagorean Theorem (Non-Linear Artithmetic)

て烟熏妆下的殇ゞ 提交于 2019-12-18 07:00:34
问题 Wherefore? The usecase context in which my problem occures I define 3 random item of a triangle. Microsoft Z3 should output: Are the constraints satisfiabe or are there invalid input values? A model for all the other triangle items where all the variables are assigned to concrete values. In order to constrain the items i need to assert triangle equalities - i wanted to start out with the Pythagorean Theorem ( (h_c² + p² = b²) ^ (h_c² + q² = a²) ). The Problem I know that Microsoft Z3 has only

printing internal solver formulas in z3

一笑奈何 提交于 2019-12-18 05:55:49
问题 The theorem proving tool z3 is taking a lot of time to solve a formula, which I believe it should be able to handle easily. To understand this better and possibly optimize my input to z3, I wanted to see the internal constraints that z3 generates as part of its solving process. How do I print the formula that z3 produces for its back-end solvers, when using z3 from the command line? 回答1: Z3 command line tool does not have such option. Moreover, Z3 contains several solvers and pre-processing

Z3 Java API - get unsat core

不羁岁月 提交于 2019-12-13 03:59:21
问题 I am trying to figure out how to get the unsat core using the Java API for Z3. Our scenario is as follows (code is underneath, which works in rise4fun): We create the SMT2 input programtically The input contains function definitions, datatype declarations, and assertions We parse this using the parseSMTLIB2String API We ensure that the context and the solver have unsat_core -> true Z3 returns UNSAT for the provided input, which is correct The UNSAT core is always empty though. The same input

How to finish the TLAPS proof for a refinement mapping involving records?

别等时光非礼了梦想. 提交于 2019-12-12 23:12:43
问题 I have some difficulty in proving a refinement mapping involving records. Below are the simplified illustrating TLA specs@github (Note that this post is also in tlaplus-googlegroup, without replies yet.): SimpleVoting.tla: It maintains for each participant a maxBal which is a natural number. In IncreaseMaxBal(p, b) , maxBal[p] is increased to a larger value b . ---------------------------- MODULE SimpleVoting ---------------------------- EXTENDS Naturals --------------------------------------

How to prove Big O notation

喜你入骨 提交于 2019-12-12 03:16:31
问题 In my algorithm class we are discussing big O notation and I am stuck proving this example problem: Prove f(n) = 3n lg n + 10n + lg n + 20 = O(n lg n) Details will be appreciated. 回答1: Big O notation is an asymptotic notation and it's all about approximation of cases (worst, best and mid one). In your example, nlgn grows faster than both n and lgn , moreover constant values are not relevant and can be ignored in such an approximation. Because of that, it follows that the complexity is O(nlgn)

Z3Py: Generating Abstract Formulas From A System Of Equations

喜欢而已 提交于 2019-12-11 07:32:40
问题 My Example: system of equations Pseudo-Code Constraint Base a = b+c ∧ e = a*c ∧ a = +2 ; some replaceable concrete values ∧ c = +18 Solution b = -16 ∧ e = -32 The Information I Want In a system of equations, I want to get the following knowledge: Abstract formulas which I can use to compute the variable values (the solution) from the given values (in the constraint base). (Like in high school where the teacher don't just wanted the see the result, but also such an transformated abstract

Coq: Non-list Data structures living in Set?

对着背影说爱祢 提交于 2019-12-11 06:07:56
问题 If I have the following line: Definition Foo : Set := list nat. then I compile with no problems. However, suppose I want to do the same with Coq.Lists.ListSet , a library representing finite sets as lists: (*Section first_definitions. Variable A : Type. Definition listset := list A.*) Definition Bar : Set := listset nat. I get the following error: The term "listset nat" has type "Type" while it is expected to have type "Set" (universe inconsistency). Is there a way to "cast" listset so that

Is division by zero included in QF_NRA?

二次信任 提交于 2019-12-11 04:21:40
问题 Is division by zero included in QF_NRA? The SMT-LIB standard is confusing in this matter. The paper where the standard is defined simply does not discuss this point, in fact NRA and QF_NRA do not appear anywhere in that document. Some information is provided on the standard website. Reals are defined as including: - all terms of the form (/ m n) or (/ (- m) n) where - m is a numeral other than 0, - n is a numeral other than 0 and 1, - as integers, m and n have no common factors besides 1.

Isabelle: Unsupported recursive occurrence of a datatype via type constructor “Set.set”

两盒软妹~` 提交于 2019-12-10 16:23:36
问题 The problem I am wondering if is there a natural way of encoding in Isabelle a grammar like this: type_synonym Var = string datatype Value = VInt int | ... datatype Cmd = Skip | NonDeterministicChoice "Cmd set" | ... The motivation would be to give definition a few specification commands in terms of Non deterministic choice, e.g.: Magic == NonDeterministicChoice {} Rely c r z = Defined using set compreehension and NonDeterministicChoice Isabelle complains about the recursive occurrence of

Is there a way to use Djinn to auto-generate Haskell code in Emacs?

。_饼干妹妹 提交于 2019-12-10 16:09:44
问题 Title pretty much says it all. I'm looking for something like this: f :: Int -> Bool -> Int f = _body Djinn can use theorem proving to generate code for such a function by proving that the type is inhabited. I'm wondering, is there an existing way to get this functionality from within Emacs? So instead of writing TemplateHaskell in my code, I just run a command on my code and it inserts the generated code? I have ghc-mod installed, but I'm not very familiar with it. 回答1: Quoting the relevant