GUI アプリケーションのドメインを、小さなステートマシンの協調として表現しようとすると、頻繁にバグる上に単体テストの入力空間が手書きするにはでかくて、適切なサンプルを選ぶのも作るのもだるい。そこで、コードのアノテーションから状態機械のモデルを作って性質を証明するようにできたら、結構楽になる。
このように、別言語のアノテーションで状態機械のモデルをつくるアプローチをほとんど知らないのだが、既存でそういうのあるだろうか。
| CUSTOM_SWIFT_SOURCE = $(SRCROOT)/path/to/swift-source | |
| HEADER_SEARCH_PATHS = $(CUSTOM_SWIFT_SOURCE)/swift/include/swift-c/SyntaxParser | |
| LIBRARY_SEARCH_PATHS = $(CUSTOM_SWIFT_SOURCE)/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/lib | |
| LD_RUNPATH_SEARCH_PATHS = $(LIBRARY_SEARCH_PATHS) |
| ----------------------------- MODULE playground ----------------------------- | |
| VARIABLES varTable | |
| \* Initial Predicate: | |
| Init == varTable = { <<0, "a">>, <<1, "b">> } | |
| \* Next-state relation: | |
| Next == varTable' = { <<2, "c">> } |
| --- appium-base-driver/lib/express/server.js 2019-07-17 12:37:19.000000000 +0900 | |
| +++ appium-base-driver/lib/express/server.js 2019-07-17 12:37:49.000000000 +0900 | |
| @@ -49,7 +49,7 @@ async function server (configureRoutes, | |
| reject(err); | |
| }); | |
| httpServer.on('connection', (socket) => { | |
| - socket.setTimeout(600 * 1000); // 10 minute timeout | |
| + socket.setTimeout(600 * 10000); // 10 minute timeout | |
| socket.on('error', reject); | |
| }); |
| theorem | |
| fixes f :: "'x ⇒ 'y ⇒ 'y" | |
| assumes finite: "finite X" | |
| and eq: "⋀x. x ∈ X ⟹ f x = g x" | |
| shows "Finite_Set.fold f z X = Finite_Set.fold g z X" | |
| using finite using eq by (rule_tac fold_closed_eq[where ?B=UNIV]; simp) |
| theory "Well_Dense_Order" imports Main begin | |
| datatype a = A | |
| text "a は整列順序である。" | |
| instantiation a :: wellorder | |
| begin | |
| definition less_eq_a :: "a ⇒ a ⇒ bool" | |
| where "less_eq_a a b ≡ True" |
| theory "Well_Not_Dense_Order" imports Main begin | |
| context wellorder | |
| begin | |
| definition bot :: 'a | |
| where "bot ≡ LEAST x. True" | |
| sublocale order_bot bot less_eq less | |
| proof standard | |
| fix a |
| theory Scratch | |
| imports Main | |
| begin | |
| no_notation relcomp (infixr "O" 75) | |
| (* oreo 型の内部表現 *) | |
| datatype oreo0 = O0 | Ore0 oreo0 | Reo0 oreo0 |
| namespace Playground.CopilotTDD; | |
| public static class NumberGenerator | |
| { | |
| public static int GetBetween0To100BySeed(int seed) | |
| { | |
| return new Random(seed).Next(0, 100); | |
| } | |
| } |