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
| -- Hilbert-style logic | |
| axiom Ax1 (A B : Prop) : A > (B > A) | |
| axiom Ax2 (A B C : Prop) : (A > (B > C)) > ((A > B) > (A > C)) | |
| axiom Ax3 (A B : Prop) : (¬A > ¬B) > (B > A) | |
| axiom Mp (x : A) (f : A > B) : B | |
| theorem Intro {A B : Prop} (y : B) : A > B := by | |
| have h1 : B > (A > B) := Ax1 B A | |
| Mp y h1 | |
| theorem Mp1 {A B C : Prop} (x : A > B) (y : A > (B > C)) : A > C := by |
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
| /- | |
| NAND 演算子 `↑` からなる計算系. `A` は「A が真」を, `A ↑ A` は「A が偽」を意味する. | |
| `A ↑ B` は「A と B が同時に真にならない」あるいは「A と B のいずれかが偽」を意味する. | |
| -/ | |
| def nand (a b : Prop): Prop := ¬(a ∧ b) | |
| infix:65 " ↑ " => nand | |
| variable {A B C : Prop} | |
| /-- |
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
| package main | |
| type OptionHandlers[T any, R any] struct { | |
| OnSome func(value T) R | |
| OnNone func() R | |
| } | |
| type Option[T any] func(handlers OptionHandlers[T, any]) any | |
| func Some[T any](value T) Option[T] { | |
| return func(handlers OptionHandlers[T, any]) any { |
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
| 責任を負うものについて、話したことがありましたね。 | |
| 先生は、シッテムの箱のシステム管理者であるA.R.O.N.Aさんから | |
| 次の3点について講習を受けませんでしたか? | |
| #1) 他人のプライバシーを尊重すること。 | |
| #2) タイプする前に考えること。 | |
| #3) 大きな力には大いなる責任が伴うこと。 | |
| ?「にははは……!大きな力だあ……!え?大いなる責任?なんですかそれ?」 |
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
| #[derive(Debug, Clone)] | |
| enum Expr { | |
| Int(u32), | |
| Succ, | |
| Apply(Box<Expr>, Box<Expr>), | |
| Comp(Box<Expr>, Box<Expr>), | |
| Times(Box<Expr>, Box<Expr>), | |
| } | |
| enum ExprRes { |
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
| //! Execution result: | |
| //! ``` | |
| //! running 2 tests | |
| //! test bench1 ... bench: 0.31 ns/iter (+/- 0.00) | |
| //! test bench2 ... bench: 0.34 ns/iter (+/- 0.09) | |
| //! ``` | |
| #![feature(test)] | |
| extern crate test; |
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
| -- Original: https://zenn.dev/kirimin/articles/3abcada2b1646f by kirimin https://github.com/kirimin | |
| -- convention of voice/text file: "num_character_content" + ".wav" or ".txt" | |
| -- Replace configs here | |
| local TEXT_DIR = "/Users/mikuroxina/Documents/Projects/Scripts/pencil-puzzles/05/voices/" -- folder contains txt and wav | |
| local AUDIO_TRACK = 2 -- number of audio track placed character voices | |
| local CHARACTERS = { "中国うさぎ" } -- names of character, used in file name | |
| -- -------------------------------------------------- |
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; | |
| #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] | |
| pub enum Z {} | |
| #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] | |
| pub struct S<Z>(PhantomData<Z>); | |
| /// `Int<M, N>` represents an integer `M - N`. | |
| #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] | |
| pub struct Int<M, N>(i64, PhantomData<(M, N)>); |
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
| /// Finds the ceiling value of square root of `n`. | |
| pub fn ceil_sqrt(n: i64) -> i64 { | |
| let mut base = (n as f64).sqrt() as i64 - 1; | |
| while (base + 1) * (base + 1) <= n { | |
| base += 1; | |
| } | |
| base | |
| } |
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 LambdaCase #-} | |
| {-# OPTIONS_GHC -Wno-name-shadowing #-} | |
| module Lib ( | |
| (+++), | |
| chainL, | |
| chainR, | |
| char, | |
| delimited, | |
| integer, |
NewerOlder