orbitmines-physics 0.0.1.test.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,18 @@
1
+ # orbitmines/physics/theorems - what the rules come to, as something to look up: every theorem, keyed by
2
+ # theory and then by question. GENERATED by `npx ray gen` from implementation/physics.ray. Do not edit.
3
+ require "json"
4
+
5
+ module OrbitMines
6
+ module Physics
7
+ module Theorems
8
+ PROVED = JSON.parse(File.read(File.join(__dir__, "theorems.json")))
9
+
10
+ # one theorem, or nothing - and never a raise
11
+ def self.proved(of, theory, theorem) = (of[theory] || {})[theorem]
12
+ # which theories have an answer to a question
13
+ def self.theories(of, theorem) = of.keys.select { |t| of[t].key?(theorem) }
14
+ # every question a theory answers
15
+ def self.asked(of, theory) = (of[theory] || {}).keys
16
+ end
17
+ end
18
+ end