This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Require Import Nat Bool. | |
Inductive aexp : Set := | |
APlus : aexp -> aexp -> aexp | |
| AConst : nat -> aexp | |
| ACase : bexp -> aexp -> aexp -> aexp | |
with bexp : Set := | |
BAnd : bexp -> bexp -> bexp | |
| BConst : bool -> bexp | |
| BLt : aexp -> aexp -> bexp. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Winter 2012, Problem 1 | |
Dictionary *) | |
(* a. *) | |
let rec find d k = | |
match d with | |
| [] -> raise Not_found | |
| (k',v') :: t -> (* TODO *) | |
let rec add d k v = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Section - Jan 25, 2016 *) | |
type 'a map = (int * 'a) list;; | |
(* associative maps *) | |
let get k m = | |
List.fold_left | |
(fun acc (k',v') -> | |
if k = k' then acc@[v'] else acc) | |
[] | |
m;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Problem 1 - Collatz Conjecture | |
It is conjectured (but not proven) that if you take any number, and | |
iterate the following process, eventually the result converges to 1. | |
The process: | |
- if the number is odd, multiply by 3 and add 1 | |
- if the number is even, divide it by 2 | |
Let's make functions to find collatz sequences for numbers | |
*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Specialization of the Embedding framework to our floating-point language *) | |
Require Import Source. | |
Require Import Embed. | |
Require Import TLA.Syntax. | |
Require Import TLA.Semantics. | |
Require Import Coq.Reals.Rbase. | |
Require Import Coq.Strings.String. | |
Require Import micromega.Psatz. | |
Require Import ExtLib.Tactics. | |
Require Import ExtLib.Data.Option. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Require Import TLA.Syntax. | |
Require Import TLA.Semantics. | |
Require Import TLA.ProofRules. | |
Require Import String. | |
Local Open Scope HP_scope. | |
Local Open Scope string_scope. | |
Require Import List. | |
Require Import Strings.String. | |
Import ListNotations. | |
Require Import Rdefinitions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Require Import Charge.Logics.ILInsts. | |
(* need "arithable" typeclass with addition, subtraction, multipliction, division | |
make Terms arithable, as well as real numbers and stuff | |
*) | |
Class Arithable (T : Type) : Type := | |
{ a_plus : T -> T -> T; | |
a_minus : T -> T -> T; | |
a_mult : T -> T -> T | |
}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# script to transform all theorems in all Coq files | |
# in the given directory's tree | |
# such that Qed's become Defined's. | |
loc = ARGV.first | |
ldir = Dir.open loc | |
$vfiles = [] | |
# where is the directory to look |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 8fa45911905da8fd1732f79ec95b0c9733c07d6c Mon Sep 17 00:00:00 2001 | |
From: =?UTF-8?q?Cl=C3=A9ment=20Pit--Claudel?= <clement.pitclaudel@live.com> | |
Date: Mon, 16 Feb 2015 08:34:20 -0500 | |
Subject: [PATCH 1/3] vernac: Add a SearchAny command to print all identifiers | |
"SearchAny" does the same as "SearchPattern _", but it doesn't print | |
definition bodies, yielding an about 10x reduction in the size of the | |
answer. This is useful for tools that need to list all identifiers in | |
context at a given point in a proof (for en example of such a tool see | |
https://github.com/cpitclaudel/company-coq/) |