Skip to content

Instantly share code, notes, and snippets.

View palmskog's full-sized avatar

Karl Palmskog palmskog

View GitHub Profile
@palmskog
palmskog / fitch.cml
Last active May 9, 2021 05:28
Verified Fitch-style proof checker in CakeML - "make fitch.cake" to compile with the bootstrapped compiler
fun valid_derivation_deriv_premise_cake v2 =
(fn v1 => List.member v1 v2);
datatype fitch_prop = Prop_cont
| Prop_imp (fitch_prop) (fitch_prop)
| Prop_or (fitch_prop) (fitch_prop)
| Prop_and (fitch_prop) (fitch_prop)
| Prop_neg (fitch_prop)
| Prop_p (char list);
Require Import List.
Require Import Arith.
Require Import Wellfounded.
Require Import Relation_Definitions.
Require Import Relation_Operators.
Require Import Lia.
From Coq Require Export ssreflect.
Global Set SsrOldRewriteGoalsOrder.
Global Set Asymmetric Patterns.
Global Set Bullet Behavior "None".
@palmskog
palmskog / matcher_workaround.v
Created July 9, 2019 20:00
Coq regexp matcher with Equations workaround
Require Import List.
Require Import Arith.
Require Import Wellfounded.
Require Import Relation_Definitions.
Require Import Relation_Operators.
Require Import Lia.
From Coq Require Export ssreflect.
Global Set SsrOldRewriteGoalsOrder.
Global Set Asymmetric Patterns.
Global Set Bullet Behavior "None".
@palmskog
palmskog / matcher.v
Last active July 9, 2019 16:15
Coq regexp matcher in Equations
Require Import List.
Require Import Arith.
Require Import Wellfounded.
Require Import Relation_Definitions.
Require Import Relation_Operators.
Require Import Lia.
From Coq Require Export ssreflect.
Global Set SsrOldRewriteGoalsOrder.
Global Set Asymmetric Patterns.
Global Set Bullet Behavior "None".
(**
This file is part of the Flocq formalization of floating-point
arithmetic in Coq: http://flocq.gforge.inria.fr/
Copyright (C) 2011-2018 Sylvie Boldo
#<br />#
Copyright (C) 2011-2018 Guillaume Melquiond
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@palmskog
palmskog / _CoqProject
Created November 24, 2018 04:31
_CoqProject file for TLC
-R src TLC
src/LibAxioms.v
src/LibContainerDemos.v
src/LibEnv.v
src/LibExec.v
src/LibFset.v
src/LibHeap.v
src/LibListExec.v
src/LibList.v
@palmskog
palmskog / _CoqProject
Last active November 24, 2018 04:22
_CoqProject file for Flocq
-R src Flocq
src/Version.v
src/Core/Raux.v
src/Core/Zaux.v
src/Core/Defs.v
src/Core/Digits.v
src/Core/Float_prop.v
src/Core/FIX.v
src/Core/Generic_fmt.v
Require Import List.
Import ListNotations.
Set Implicit Arguments.
Fixpoint fin (n : nat) : Type :=
match n with
| 0 => False
| S n' => option (fin n')
end.
Require Import List.
Import ListNotations.
Set Implicit Arguments.
Fixpoint before {A: Type} (x : A) y l : Prop :=
match l with
| [] => False
| a :: l' =>
a = x \/
@palmskog
palmskog / subst.v
Last active October 29, 2018 18:40
Require Import List.
Import ListNotations.
Set Implicit Arguments.
Section assoc.
Variable K V : Type.
Variable K_eq_dec : forall k k' : K, {k = k'} + {k <> k'}.
Fixpoint assoc (l : list (K * V)) (k : K) : option V :=