Skip to content

Instantly share code, notes, and snippets.

View omelkonian's full-sized avatar
🎰

Orestis Melkonian omelkonian

🎰
View GitHub Profile
@cxandru
cxandru / GenerateYourNeighbors.fs
Created November 28, 2024 18:42
Generator for valid Binary Search Trees (BSTs) for property-based testing using FSharp's FsCheck framework
module GenerateYourNeighbors
open FsCheck
type BST<'a> =
| Empty
| Node of BST<'a> * 'a * BST<'a>
[<StructuralEquality;StructuralComparison>]
type Extended<'a when 'a: comparison> =
| NegInfty
@AndrasKovacs
AndrasKovacs / TwoStageRegion.md
Last active December 25, 2025 23:54
Lightweight region memory management in a two-stage language
@andrejbauer
andrejbauer / wlem.agda
Last active June 19, 2023 04:40
A formal proof that weak excluded middle holds from the familiar facts about real numbers.
{-
Weak excluded middle states that for every propostiion P, either ¬¬P or ¬P holds.
We give a proof of weak excluded middle, relying just on basic facts about real numbers,
which we carefully state, in order to make the dependence on them transparent.
Some people might doubt the formalization. To convince yourself that there is no cheating, you should:
* Carefully read the facts listed in the RealFacts below to see that these are all
just familiar facts about the real numbers.
@AndrasKovacs
AndrasKovacs / TTinTTasSetoid.agda
Last active November 3, 2024 21:24
TT in TT using Prop + setoid fibrations
{-# OPTIONS --prop --without-K --show-irrelevant --safe #-}
{-
Challenge:
- Define a deeply embedded faithfully represented syntax of a dependently typed
TT in Agda.
- Use an Agda fragment which has canonicity. This means that the combination of
indexed inductive types & cubical equality is not allowed!
- Prove consistency.
@AndrasKovacs
AndrasKovacs / HIIRT.md
Last active May 9, 2025 12:13
Higher induction-induction-recursion

Inductive-Recursive Types, Generally

I write about inductive-recursive types here. "Generally" means "higher inductive-inductive-recursive" or "quotient inductive-inductive-recursive". This may sound quite gnarly, but fortunately the specification of signatures can be given with just a few type formers in an appropriate framework.

In particular, we'll have a theory of signatures which includes Mike Shulman's higher IR example.

@codyroux
codyroux / HA2.v
Created February 6, 2022 03:54
Soundness of 2nd order arithmetic
(* A relatively straightforward formalization of HA^2 *)
Require Import Coq.Lists.List.
Require Import Coq.Strings.String.
Inductive tm :=
| v(name : string)
| Succ(a : tm)
| Z
| Plus(a b : tm)
@isovector
isovector / Clowns.hs
Created January 23, 2022 21:47
blog post: review of clowns and jokers
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoStarIsType #-}
{-# LANGUAGE PatternSynonyms #-}