Skip to content

Instantly share code, notes, and snippets.

View jp-diegidio's full-sized avatar

Julio Di Egidio jp-diegidio

View GitHub Profile
@sudgy
sudgy / bundled_unbundled.v
Created October 18, 2023 23:26
Using Bundled and Unbundled Typeclasses Simultaneously in Coq
Require Import Utf8.
Require Import Coq.Program.Tactics.
(* When using typeclasses in Coq, people often debate over whether you should
use them bundled or unbundled. Each has their own benefits in particular
situations. However, you can actually use them both at the same time to get the
best of both worlds! *)
(* We start with defining several unbundled typeclasses for the sake of defining
groups. *)
@mndrix
mndrix / binary-simple.prolog
Last active August 29, 2015 14:06
Simplification and binarization of Prolog clauses
% Simplification and binarization of Prolog clauses.
%
% This code was my note paper while reading
% "The BinProlog Experience: Architecture and
% Implementation Choices for Continuation Passing
% Prolog and First-Class Logic Engines" by Paul Tarau.
%
% I find it especially pleasing that binary logic programs
% require only about half as many WAM instructions as
% traditional Prolog. This should make it easy to build
@sahands
sahands / python_sjt_coroutines.py
Last active June 8, 2022 19:47
Steinhaus–Johnson–Trotter (SJT) Permutation Generation Algorithm in Python using Coroutines (Generators)
from time import sleep
__author__ = "Sahand Saba"
def nobody():
while True:
yield False