Is it possible to program and check invariants in Haskell?

The following is a stunt, but it’s quite a safe stunt so do try it at home. It uses some of the entertaining new toys to bake order invariants into mergeSort. {-# LANGUAGE GADTs, PolyKinds, KindSignatures, MultiParamTypeClasses, FlexibleInstances, RankNTypes, FlexibleContexts #-} I’ll have natural numbers, just to keep things simple. data Nat = Z | … Read more

How to learn agda

When I started learning Agda about a year ago I think I tried all available tutorials and each taught me something new. You should probably give Coq a try, because it has a larger user base and there are two nice books available for it: Coq’Art – slightly dated, but beginner friendly Certified Programming with … Read more

Z3: finding all satisfying models

One way to accomplish this is using one of the APIs, along with the model generation capability. You can then use the generated model from one satisfiability check to add constraints to prevent previous model values from being used in subsequent satisfiability checks, until there are no more satisfying assignments. Of course, you have to … Read more

Difference between Z3 and coq

Coq is an interactive theorem prover (aka proof assistant). It provides a language to write mathematical definitions, algorithms and theorems. It also provides an environment for producing machine checked proofs. Coq has been used to formalize mathematical theorems, and provide the semantics of programming languages. Today, we can find many papers at POPL that used … Read more

tech