Skip to content

Instantly share code, notes, and snippets.

View gabriel-fallen's full-sized avatar

Alexander Chichigin gabriel-fallen

  • Kontur
  • Tbilisi, Georgia
View GitHub Profile
@gabriel-fallen
gabriel-fallen / Compiler_Demo.thy
Created August 24, 2017 17:58
Isabelle compiler correctness demo.
theory Compiler_Demo
imports Main
begin
type_synonym 'a binop = "'a ⇒ 'a ⇒ 'a"
datatype ('a, 'v) expr
= Const 'v
| Var 'a
| BinOp "'v binop" "('a, 'v) expr" "('a, 'v) expr"
@gabriel-fallen
gabriel-fallen / TreeSort.hs
Created October 9, 2017 07:19
LiquidHaskell TreeSort example
{-@ LIQUID "--exact-data-cons" @-}
{-@ LIQUID "--higherorder" @-}
module TreeSort where
import Prelude hiding ((.), concat, filter, foldr, map)
import Language.Haskell.Liquid.ProofCombinators
data List a = Nil | Cons a (List a)
@gabriel-fallen
gabriel-fallen / Radix.thy
Created November 12, 2017 14:55
Equational proof that "treesort = radixsort" in Isabelle
theory Radix
imports Main
begin
primrec fold_right :: "('a ⇒ 'b ⇒ 'b) ⇒ 'b ⇒ 'a list ⇒ 'b" where
"fold_right f x [] = x" |
"fold_right f x (h#t) = f h (fold_right f x t)"
primrec ordered :: "('a ⇒ 'b::ord) list ⇒ 'a ⇒ 'a ⇒ bool" where
"ordered [] _ _ = True" |
@gabriel-fallen
gabriel-fallen / Parser.hs
Last active March 6, 2018 17:03
Pseudohaskell for continuation-based XML SAX-parser
module Parser where
import Control.Monad.Cont
import Control.Monad.Except
import Data.ByteString
import Streaming
import qualified Streaming.Prelude as S
import Xeno.Streaming
-- | A record we want to parse from beneath unknown layers of XML
@gabriel-fallen
gabriel-fallen / menu.json
Last active August 13, 2018 17:52
Example for an example
[
{
"name": "Home",
"url": "/"
},
{
"name": "About",
"url": "/about",
"submenu": [
{
@gabriel-fallen
gabriel-fallen / kickstarter.ows
Created September 13, 2018 18:32
Orange example workspace with Kickstarter dataset.
<?xml version='1.0' encoding='utf-8'?>
<scheme description="" title="" version="2.0">
<nodes>
<node id="0" name="Datasets" position="(246.0, 333.0)" project_name="Orange3" qualified_name="Orange.widgets.data.owdatasets.OWDataSets" title="Datasets" version="" />
<node id="1" name="Data Table" position="(424.0, 61.0)" project_name="Orange3" qualified_name="Orange.widgets.data.owtable.OWDataTable" title="Data Table" version="" />
<node id="2" name="Data Info" position="(298.0, 69.0)" project_name="Orange3" qualified_name="Orange.widgets.data.owdatainfo.OWDataInfo" title="Data Info" version="" />
<node id="3" name="Naive Bayes" position="(445.0, 446.0)" project_name="Orange3" qualified_name="Orange.widgets.model.ownaivebayes.OWNaiveBayes" title="Naive Bayes" version="" />
<node id="4" name="Test &amp; Score" position="(646.0, 444.0)" project_name="Orange3" qualified_name="Orange.widgets.evaluate.owtestlearners.OWTestLearners" title="Test &amp; Score" version="" />
<node id="5" name="ROC Analysis" pos
@gabriel-fallen
gabriel-fallen / gallery.json
Created September 26, 2018 16:17
Sample image gallery with thumbnails data.
@gabriel-fallen
gabriel-fallen / YCTest.fs
Created February 4, 2019 14:21
YaccConstructor test
namespace Test
open AbstractAnalysis.Common
open Yard.Generators.Common.DataStructures
open Yard.Generators.GLL
open Yard.Generators.GLL.AbstractParser
open GrammarCombinator.Combinators
module Test =
@gabriel-fallen
gabriel-fallen / AliasingTests.fs
Last active March 12, 2019 15:31
Trying to build an aliasing CFPQ.
namespace Tests
open System.Diagnostics
open NUnit.Framework
open AbstractAnalysis.Common
open Yard.Generators.Common.DataStructures
open Yard.Generators.GLL.AbstractParser
open Yard.Generators.GLL.ParserCommon
open GrammarCombinator.Combinators
@gabriel-fallen
gabriel-fallen / Fibonacci_Sums.thy
Created August 18, 2019 12:42
Some theorems about Fibonacci numbers sums in Isabelle/HOL
theory Fibonacci_Sums
imports Main
begin
(* Isabelle/HOL/Isar *)
section \<open>Fibonacci numbers and their sums\<close>
fun fib :: "nat \<Rightarrow> nat" where
"fib 0 = 0" |