This file has been truncated, but you can view the full file.
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
| #!/usr/bin/env bash | |
| # | |
| # doom.bash — DOOM, running in pure GNU Bash. No compiled code, no dependencies. | |
| # | |
| # This one file contains two things: | |
| # 1. The 1993 DOOM engine (via doomgeneric), compiled to a WebAssembly module | |
| # by jacobenget/doom.wasm v0.1.0 with the DOOM shareware WAD embedded, then | |
| # translated from WebAssembly into Bash source by dewasm | |
| # (https://github.com/dewasm/dewasm — the same wasm binary also runs there | |
| # as pure Go, Java, Ruby, and Python; see examples/doom). |
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
| # frozen_string_literal: true | |
| require 'set' | |
| # # KiriMochi: A SAT Solver Written in Ruby | |
| # | |
| # KiriMochi is a SAT solver written in Ruby. It is based on [MiniSAT](http://minisat.se), | |
| # [Glucose](https://www.labri.fr/perso/lsimon/research/glucose/), and [Gophersat](https://github.com/crillab/gophersat), | |
| # but the implementation is simpler than theirs and easy to understand. | |
| # It implements modern techniques in SAT solving, including |
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 "bigdecimal" | |
| require "bigdecimal/math" | |
| def measure(name, &block) | |
| s = Process.clock_gettime(Process::CLOCK_MONOTONIC) | |
| r = block.call | |
| t = Process.clock_gettime(Process::CLOCK_MONOTONIC) | |
| time = t - s | |
| STDERR.puts "#{name}: #{time} s" |
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
| // An implementation of the RPNI (Regular Positive and Negative Inference) algorithm. | |
| import scala.annotation.tailrec | |
| import scala.collection.mutable | |
| import scala.math.Ordering.Implicits.seqOrdering | |
| import scala.util.boundary | |
| final case class Dfa[Q, A]( | |
| initialState: Q, | |
| acceptStateSet: Set[Q], |
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
| // This is an implementation of the MAT* algorithm in Scala 3. | |
| // | |
| // The MAT* algorithm is a learning algorithm for symbolic finite automata, proposed by | |
| // George Argyros and Loris D'Antoni, "The Learnability of Symbolic Automata" | |
| // https://doi.org/10.1007/978-3-319-96145-3_23. | |
| import scala.annotation.tailrec | |
| import scala.util.hashing.MurmurHash3 | |
| /** `BoolAlg` represents an effective Boolean algebra on the domain `D`. |
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
| // This is an implementation of the Λ* algorithm in Scala 3. | |
| // | |
| // The Λ* algorithm is a learning algorithm for symbolic automata, proposed by | |
| // Samuel Drews and Loris D'Antoni (2017), "Learning Symbolic Automata" | |
| // https://doi.org/10.1007/978-3-662-54577-5_10. | |
| import scala.collection.mutable | |
| /** `BoolAlg` represents an effective Boolean algebra on the domain `D`. | |
| * |
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
| $b = [] | |
| def op_proto(version) | |
| $b.concat([0x80, version]) | |
| end | |
| def op_global(mod, name) | |
| $b.concat("c#{mod}\n#{name}\n".unpack("C*")) | |
| end |
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
| import scala.util.boundary | |
| import scala.collection.mutable | |
| import scala.compiletime.ops.double | |
| import scala.annotation.tailrec | |
| final case class Mealy[Q, I, O]( | |
| initial: Q, | |
| transition: Map[(Q, I), (O, Q)] | |
| ): | |
| type State = Q |
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
| // kv.scala - an implementation of the Kearns & Vazirani algorithm | |
| import scala.annotation.tailrec | |
| import scala.collection.mutable | |
| import scala.compiletime.ops.double | |
| /** A type for states. */ | |
| type Q = String | |
| /** A deterministic finite-state automaton (DFA). */ |
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
| import { Octokit } from 'octokit'; | |
| const { rest: github } = new Octokit(); | |
| const OWNER = 'makenowjust-labs'; | |
| const REPO = 'recheck'; | |
| const BRANCH = 'main'; | |
| const STATUS = 'success'; | |
| const WORKFLOW_ID = 'main.yml'; | |
| const PER_PAGE = 100; |
NewerOlder