Skip to content

Instantly share code, notes, and snippets.

View hyperswine's full-sized avatar

Jasen Qin hyperswine

  • Quantii
  • 05:56 (UTC +10:00)
View GitHub Profile
@VictorTaelin
VictorTaelin / sat.md
Last active December 7, 2024 20:59
Simple SAT Solver via superpositions

Solving SAT via interaction net superpositions

I've recently been amazed, if not mind-blown, by how a very simple, "one-line" SAT solver on Interaction Nets can outperform brute-force by orders of magnitude by exploiting "superposed booleans" and optimal evaluation of λ-expressions. In this brief note, I'll provide some background for you to understand how this works, and then I'll present a simple code you can run in your own computer to observe and replicate this effect. Note this is a new observation, so I know little about how this algorithm behaves asymptotically, but I find it quite

@nataliefreed
nataliefreed / butterfly.jscad
Last active October 19, 2024 16:50
Butterfly example with beziers and 2D/3D Export, OpenJSCAD
// title : OpenJSCAD Bezier, 2D/3D Export Example
// author : Natalie Freed
// sources : 2D/3D export technique from Lamp Shade Example
function getParameterDefinitions() {
return [{ name: 'height', type: 'float', initial: 6, caption: "height:" },
{
name: 'type',
type: 'choice',
values: ["2D", "3D"],
@zhpengg
zhpengg / skip_list.c
Created June 5, 2012 07:52
skiplist implementation in c
/* Skip Lists: A Probabilistic Alternative to Balanced Trees */
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#define SKIPLIST_MAX_LEVEL 6
typedef struct snode {
int key;