Questions tagged [formal-verification]

Formal verification is the act of proving or disproving the correctness of intended algorithms underlying a system with respect to a certain formal specification or property, using formal methods of mathematics.

Formal verification is the act of proving or disproving the correctness of intended algorithms underlying a system with respect to a certain formal specification or property, using formal methods of mathematics.

The verification of these systems is done by providing a formal proof on an abstract mathematical model of the system, the correspondence between the mathematical model and the nature of the system being otherwise known by construction.

One approach and formation is model checking, which consists of a systematically exhaustive exploration of the mathematical model (this is possible for finite models, but also for some infinite models where infinite sets of states can be effectively represented finitely using abstraction).

358 questions
85
votes
1 answer

How to read this GHC Core "proof"?

I wrote this small bit of Haskell to figure out how GHC proves that for natural numbers, you can only halve the even ones: {-# LANGUAGE DataKinds, GADTs, KindSignatures, TypeFamilies #-} module Nat where data Nat = Z | S Nat data Parity = Even |…
Mathijs Kwik
  • 1,227
  • 9
  • 12
77
votes
11 answers

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

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…
61
votes
31 answers

Why can't programs be proven?

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…
4thSpace
  • 43,672
  • 97
  • 296
  • 475
58
votes
11 answers

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

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…
0atman
  • 3,298
  • 4
  • 30
  • 46
17
votes
1 answer

Proving the 100 Prisoners and a lightbulb with Dafny

Consider the standard strategy to solve the 100 prisoners and a lightbulb problem. Here's my attempt to model it in Dafny: method strategy(P: set, Special: T) returns (count: int) requires |P| > 1 && Special in P ensures count == (|P| -…
Hugo Sereno Ferreira
  • 8,600
  • 7
  • 46
  • 92
16
votes
7 answers

How to design and verify distributed systems?

I've been working on a project, which is a combination of an application server and an object database, and is currently running on a single machine only. Some time ago I read a paper which describes a distributed relational database, and got some…
Esko Luontola
  • 73,184
  • 17
  • 117
  • 128
15
votes
2 answers

How to check if a function is pure in Python?

A pure function is a function similar to a Mathematical function, where there is no interaction with the "Real world" nor side-effects. From a more practical point of view, it means that a pure function can not: Print or otherwise show a message Be…
14
votes
10 answers

Do formal methods of program verfication have a place in industry?

I took a glimpse on Hoare Logic in college. What we did was really simple. Most of what I did was proving the correctness of simple programs consisting of while loops, if statements, and sequence of instructions, but nothing more. These methods seem…
Khaled Alshaya
  • 94,250
  • 39
  • 176
  • 234
12
votes
3 answers

Proving Floor_Log2 in Spark

New to Spark, and new to Ada, so this question may be overly broad. However, it's asked in good faith, as part of an attempt to understand Spark. Besides direct answers to the questions below, I welcome critique of style, workflow, etc. As my first…
11
votes
3 answers

Non-empty list append theorem in Coq

I am trying to prove the following lemma in Coq: Require Import Lists.List. Import ListNotations. Lemma not_empty : forall (A : Type) (a b : list A), (a <> [] \/ b <> []) -> a ++ b <> []. Right now my current strategy was to destruct on a, and…
11
votes
2 answers

Use named instances for other instances

I'm trying to make a Semigroup and VerifiedSemigroup instance on my custom Bool datatype both on operator && and operator ||: %case data Lógico = Cierto | Falso (&&) : Lógico -> Lógico -> Lógico (&&) Cierto Cierto = Cierto (&&) _ _ = Falso (||) :…
chamini2
  • 2,820
  • 2
  • 24
  • 37
10
votes
11 answers

Formally verifying the correctness of an algorithm

First of all, is this only possible on algorithms which have no side effects? Secondly, where could I learn about this process, any good books, articles, etc?
joemoe
  • 5,734
  • 10
  • 43
  • 60
9
votes
0 answers

Which First Order theorem provers are guaranteed to halt on monadic inputs?

Monadic First Order Logic, where all predicates take exactly one argument, is a known decidable fragment of first order logic. Testing whether a formula is satisfiable in this logic is decidable, and there exist resolution-based methods for deciding…
jmite
  • 8,171
  • 6
  • 40
  • 81
9
votes
2 answers

In concolic testing, what does "concrete execution" mean?

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…
8
votes
1 answer

Proving substitution property of successor over equality

I'm trying to understand inductive types from chapter 7 of "theorem proving in lean". I set myself a task of proving that successor of natural numbers has a substitution property over equality: inductive natural : Type | zero : natural | succ :…
1
2 3
23 24