Skip to content

Instantly share code, notes, and snippets.

View cryptica's full-sized avatar

Klara Meyer cryptica

  • Munich, Germany
View GitHub Profile
@cryptica
cryptica / TreeAutomata.hs
Last active August 29, 2015 14:20
Haskell program defining tree automata, trees and an eval function
import qualified Data.Map as M
type State = String
type Symbol = (String, Int)
data TreeAutomaton = TreeAutomaton
{ symbols :: [Symbol]
, states :: [State]
, finalStates :: [State]
, delta :: M.Map (Symbol, [State]) State
@cryptica
cryptica / main.hs
Created May 14, 2014 19:54
Haskell program repeatedly calling sat from the SBV library with an increasing number of variables
import System.Environment (getArgs)
import Control.Monad (unless)
import Data.SBV
testInt :: Int -> Predicate
testInt n = do
vars <- mkExistVars n
let s = sum vars
return $ s .>= (1::SInteger) &&& s .<= 5 &&& s ./= 3