This file contains hidden or 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 Coq.Lists.List. | |
| Declare Scope regex_scope. | |
| Open Scope regex_scope. | |
| Section Regex. | |
| Variable (A : Type). | |
| Inductive Regex : Type := |
This file contains hidden or 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
| (* | |
| Some lemmas that can be used in conjunction with those in Coq.Lists.List | |
| See https://coq.inria.fr/library/Coq.Lists.List.html | |
| *) | |
| Require Import Lia. | |
| Require Import Coq.Lists.List. |
This file contains hidden or 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
| #include <iostream> | |
| #include <string> | |
| #include <pcre.h> | |
| #include <chrono> | |
| using namespace std; | |
| int main() { | |
| string pattern; | |
| string input; |
This file contains hidden or 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
| use std::collections::VecDeque; | |
| use std::cell::RefCell; | |
| use std::rc::Rc; | |
| use std::cell::Ref; | |
| pub mod vllsimple; | |
| use vllsimple::*; | |
| struct part_man{ | |
| // pools |
This file contains hidden or 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
| use std::collections::VecDeque; | |
| // compute the inverse relation given a function | |
| fn inverse_fn(n: usize, f: &Vec<usize>) -> Vec<Vec<usize>> { | |
| let mut inverse_f = vec![vec![]; n]; | |
| for i in 0..n { | |
| inverse_f[f[i]].push(i); | |
| } | |
| inverse_f | |
| } |
This file contains hidden or 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
| #include <stdio.h> | |
| #include "heater.c" | |
| uint8_t temperature; | |
| int main(){ | |
| for (int i = 0; i < 200; i++){ | |
| temperature = i; | |
| step(); |
This file contains hidden or 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
| module Board where | |
| import Data.Map (Map, (!)) | |
| import qualified Data.Map as Map | |
| import Data.List (intercalate) | |
| data Player = X | O | |
| deriving (Eq, Ord, Show) | |
| newtype Board = Board (Map (Int, Int) (Maybe Player)) |
This file contains hidden or 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
| /** The functional list type defined by IntList := EmptyIntList + ConsIntList(int, IntList) */ | |
| abstract class IntList { | |
| /** Visitor hook */ | |
| abstract public Object visit(IntListVisitor iv); | |
| /** Adds i to the front of this. */ | |
| public ConsIntList cons(int i) { return new ConsIntList(i, this); } | |
| /** Returns the unique empty list. */ | |
| public static EmptyIntList empty() { return EmptyIntList.ONLY; } |
This file contains hidden or 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
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# OPTIONS_GHC -Wall #-} | |
| module Regex.Glushkov where | |
| import Control.Monad.State | |
| import Data.Aeson.Encode.Pretty (encodePretty) | |
| import qualified Data.Text as T | |
| import qualified Data.ByteString.Lazy as BSL |
This file contains hidden or 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
| use std::marker::PhantomData; | |
| pub trait Sink<A> { | |
| fn init(&mut self); | |
| fn next(&mut self, item: A); | |
| fn end(&mut self); | |
| } | |
| pub trait Query<A,B>: { | |
| fn init(&mut self, sink: &mut dyn Sink<B>); |