Skip to content

Instantly share code, notes, and snippets.

View tchajed's full-sized avatar

Tej Chajed tchajed

View GitHub Profile
@tchajed
tchajed / lambda-calculus.hs
Last active February 23, 2022 20:42
Parsec parser for the untyped lambda calculus
import Text.ParserCombinators.Parsec
import System.Environment (getArgs)
import Safe
data Expr =
Var Name -- variable
| App Expr Expr -- application
| Lambda Name Expr -- lambda abstraction
deriving
(Eq,Show)
@tchajed
tchajed / args.sh
Last active June 1, 2022 18:47
Starting a bash script
#!/bin/bash
# basic manual argument parsing
usage() {
echo "Usage: $0 [--foo FOO] [-v]" 1>&2
}
foo=""
verbose=false
@tchajed
tchajed / _dafny_to_smt2.sh
Last active October 18, 2023 16:13
Getting SMT2 verification condition from Dafny
#!/bin/sh
dafny verify --solver-log example.smt2 --boogie /normalizeNames:0 example.dfy
@tchajed
tchajed / _verus_to_smt2.sh
Created October 18, 2023 16:16
Generate SMT2 from Verus
#!/bin/sh
verus --log-smt example.rs
# output is in .verus-log/root.smt2
@tchajed
tchajed / iris-release.sh
Last active April 12, 2024 10:19
Script to release Iris and std++
#!/usr/bin/env bash
# iris-release.sh prepares a commit for https://github.com/coq/opam to
# add a new version of std++ and Iris to the Coq opam repository.
#
# Requires a clone of opam-coq-archive. The opam files from std++ and Iris are
# retrieved by downloading their releases by tag.
set -eu