proofs
coqsimpleio
proofs  coqsimpleio  

5  2  
286  28  
    
8.8  6.8  
7 days ago  about 1 month ago  
Coq  Coq  
GNU General Public License v3.0 or later  MIT License 
Stars  the number of stars that a project has on GitHub. Growth  month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
proofs

A Taste of Coq and Correct Code by Construction
If you're already familiar with a functional programming language like Haskell or OCaml, you have the prerequisite knowledge to work through my Coq tutorial here: https://github.com/stepchowfun/proofs/tree/main/proofs/Tutor...
My goal with this tutorial was to introduce the core aspects of the language (dependent types, tactics, etc.) in a "straight to the point" kind of way for readers who are already motivated to learn it. If you've heard about proof assistants like Coq or Lean and you're fascinated by what they can do, and you just want the TL;DR of how they work, then this tutorial is written for you.
Any feedback is appreciated!

Thoughts on proof assistants?
Personally I treat Coq like an extension of my brain. Whenever I'm uncertain about something, I formalize it in Coq. I have a repository of proofs with GitHub Actions set up in such a way forbids me from pushing commits containing mathematical mistakes. I've formalized various aspects of category theory, type theory, domain theory, etc., and I've also verified a few programs, such as this sorting algorithm. Lately I've been experimenting with a few novel types of graphs, proving various properties about them with the aim of eventually developing a way to organize all of my data (files, notes, photos, passwords, etc.) in some kind of graph structure like that.

Formally Verifying Rust's Opaque Types
It's always a pleasant surprise to see people using Coq and other formal verification technology. We need more rigor in programming! If this article gave you a thirst for interactive theorem proving and you want to learn it from the ground up, I've recently written a Coq tutorial [1] which covers topics like programming with dependent types, writing proofs as data, and extracting verified code. That repository also contains a handy tactic called `eMagic` [1] (a variant of another useful tactic called `magic` which solve goals with existentials) which can automatically prove the theorem from the article.
[1] https://github.com/stepchowfun/proofs/tree/main/proofs/Tutor...
[2] https://github.com/stepchowfun/proofs/blob/56438c9752c414560...

A complete compiler and VM in 150 lines of code
For anyone who wants to learn Coq, I've just finished writing a tutorial [1] that is aimed at programmers (rather than, say, computer scientists). It covers topics like programming with dependent types, writing proofs as data, universes & other type theory stuff, and extracting verified code—with exercises. I hope people find it useful, and any feedback would be appreciated!
[1] https://github.com/stepchowfun/proofs/tree/main/proofs/Tutor...

New Coq tutorial
Hi all, Coq is a "proof assistant" that allows you to write both code and proofs in the same language (thanks to the Curry–Howard correspondence). Its uses range from pure math (e.g., the Feit–Thompson theorem was proven in Coq!) to reasoning about programming languages (e.g., proving the soundness of a type system) to writing verified code (e.g., this verified C compiler!). You can "extract" your code (without the proofs) to OCaml/Haskell/Scheme for running it in production. Coq is awesome, but it's known for having a steep learning curve (it's based on type theory, which is a foundational system of mathematics). It took me several years to become proficient in it. I wanted to help people pick it up faster than I did, so I wrote this introductory tutorial. Hope you find it useful!
coqsimpleio

Inspiring OOP examples?
My point about a proof assistant language, let's just say Coq, is focused on pure, referentially transparent functions. There are no IORef like escape hatches required to make things work, although you could probably argue that stuff like this is still pure as, there are certainly escape hatches. Generally speaking, in proof assistants, the program can be selfcontained, and is thus "pure".

Advent of Code Day 1
It's possible to do all that work still in Coq, so that the extracted code can directly be compiled into an executable. One way is to use the coqsimpleio library, which basically wraps the OCaml standard library (including functions for reading and writing files/stdin/stdout) as Coq axioms. For example, I did extraction that way in a previous iteration of AoC: https://github.com/Lysxia/adventofcoq2018/blob/master/sol/day01_1.v
What are some alternatives?
CompCert  The CompCert formallyverified C compiler
mathcomp  Mathematical Components
masterthesis
adventofcoq2018  Advent of Code 2018, in Coq! (https://adventofcode.com/2018)
hacspec  Please see https://github.com/hacspec/hax
aneris  Program logic for developing and verifying distributed systems
adventofcoq2021
ccctalk  Correct Code by Construction talk's code
UniMath  This coq library aims to formalize a substantial body of mathematics using the univalent point of view.
parson  Yet another PEG parser combinator library and DSL
magmide  A dependentlytyped proof language intended to make provably correct bare metal code possible for working software engineers.