formal-verification

Tools to experiment with weakly ordered concurrency

ぃ、小莉子 提交于 2019-12-06 13:06:13
What tools exist to help one to experiment with weakly ordered concurrency? That is, in what sandbox can one play while teaching oneself about partial fences, weak atomics, acquire/consume/release semantics, lock-free algorithms and the like? The tool or sandbox one wants would exercise and stress one's weakly ordered, threaded algorithm, exposing the various ways in which the algorithm might theoretically fail. Physically running on an x86, for example, the tool would nevertheless be able to expose ARM-type failures. An open-source tool would be preferable. Please advise. References: the C+

Meaning of \\old in ACSL post-conditions

匆匆过客 提交于 2019-12-06 02:41:54
I am a newbie user of Frama-C and have a few questions regarding assertions over pointers. Consider the C fragment below involving: two related data structures Data and Handle, s.t. Handle has a pointer to Data; a 'state' field in Data indicating whether some hypothetical operation has completed three functions: init(), start_operation() and wait(); a main() function using the above, and containing 6 assertions (A1-A6) Now, why is it that A5 and A6 cannot be asserted with the WP verifier ("frama-c -wp file.c") Shouldn't they hold due to the last "ensures" clause on start_operation()? What am I

SMT solver with custom theories?

心不动则不痛 提交于 2019-12-05 17:48:57
I'm looking at doing some verification work where I've got regular tree grammars as an underlying theory. Z3 lets you define your own stuff with uninterpreted functions, but that doesn't tend to work well any time your decision procedures are recursive. They used to allow for plugins but that has been depricated, I think. I'm wondering, does anybody have a recommendation of a decent SMT solver that allows you to write decision procedures for custom theories? There are several options given that most reasonable SMT solvers are open source you can integrate theory solvers in any detail depending

How to prove a = b → a + 1 = b + 1 in lean?

馋奶兔 提交于 2019-12-05 15:54:45
I'm working my way through the chapter 4 of the lean tutorial . I'd like to be able to prove simple equalities, such as a = b → a + 1 = b + 1 without having to use the calc environment. In other words I'd like to explicitly construct the proof term of: example (a b : nat) (H1 : a = b) : a + 1 = b + 1 := sorry My best guess is that I need to use eq.subst and some relevant lemma about equality on natural numbers from the standard library, but I'm at loss. The closest lean example I can find is this: example (A : Type) (a b : A) (P : A → Prop) (H1 : a = b) (H2 : P a) : P b := eq.subst H1 H2 While

Is there a way to prove a program has no bug?

巧了我就是萌 提交于 2019-12-05 08:51:39
I was thinking about the fact that we can prove a program has bugs. We can test it to assess that it is more or less bug resistant. But is there a way (even theoretically) to prove that a program has no bug ? For simple programs, such as a "Hello World", I guess we should be able to do it. But what about larger programs ? There are nowadays many different formalisms that can be used to prove programs correct (e.g., formalizations in proof assistants, dependently typed programming languages, separation logic, ...). As noted by others, there is no automatic way to prove any given program correct

In concolic testing, what does “concrete execution” mean?

旧时模样 提交于 2019-12-05 03:34:24
I came across the terms "concrete & symbolic execution" when I was going through the concept of concolic testing . (The article mentioned there, "CUTE: A concolic unit testing engine for C" , uses that term in its abstract section.) "The approach used builds on previous work combining symbolic and concrete execution, and more specifically, using such a combination to generate test inputs to explore all feasible execution paths." Can anyone please confirm what "concrete execution" means? In spite of my search, I could not find any direct citations / explicit statements. From what I have

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

柔情痞子 提交于 2019-12-04 04:07:45
问题 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 () (_

Why can't programs be proven?

我的梦境 提交于 2019-12-03 18:19:52
问题 Why can't a computer program be proven just as a mathematical statement can? A mathematical proof is built up on other proofs, which are built up from yet more proofs and on down to axioms - those truths truths we hold as self evident. Computer programs don't seem to have such a structure. If you write a computer program, how is it that you can take previous proven works and use them to show the truth of your program? You can't since none exist. Further, what are the axioms of programming?

Are there any provable real-world languages? (scala?)

谁说我不能喝 提交于 2019-12-03 00:19:17
问题 I was taught about formal systems at university, but I was disappointed how they didn't seem to be used in the real word. I like the idea of being able to know that some code (object, function, whatever) works, not by testing, but by proof . I'm sure we're all familiar with the parallels that don't exist between physical engineering and software engineering (steel behaves predictably, software can do anything - who knows!), and I would love to know if there are any languages that can be use

Can Haskell functions be proved/model-checked/verified with correctness properties?

混江龙づ霸主 提交于 2019-12-03 00:11:10
问题 Continuing on from ideas in: Are there any provable real-world languages? I don't know about you, but I'm sick of writing code that I can't guarantee. After asking the above question and getting a phenomenal response (Thanks all!) I have decided to narrow my search for a provable, pragmatic, approach to Haskell. I chose Haskell because it is actually useful (there are many web frameworks written for it, this seems a good benchmark) AND I think it is strict enough, functionally, that it might