syllogism 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.tool-versions +1 -0
- data/Gemfile.lock +13 -13
- data/README.md +4 -0
- data/lib/syllogism/general_term.rb +1 -1
- data/lib/syllogism/singular_term.rb +1 -1
- data/lib/syllogism/version.rb +1 -1
- data/lib/syllogism.rb +18 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26dd7a01178ea39e1474914a56f16b4f903b302acda0f78d662000c137b85a00
|
4
|
+
data.tar.gz: 6a657acaef3ec4485eedd43ca25f3d649e6657eb0f80233b86c1649f405b36bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1d328e06496620c3a660f69694a46f7071ffc75df431220a5775a77cb96f50d87f2436c7aeea0fd7ffd73a5efac454d93230c933dfe482135aba180ea129f50
|
7
|
+
data.tar.gz: 3f3a1de1da37f1e8f74f0495c865cac13fd858734ec6ec38067fa54c42f0493c1196779f5b37ab9550c25c80251a4c6f1d390903b8cc03d5bbd4d0566f387fce
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.0.2
|
data/Gemfile.lock
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
syllogism (0.2.
|
4
|
+
syllogism (0.2.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
diff-lcs (1.
|
9
|
+
diff-lcs (1.5.0)
|
10
10
|
rake (12.3.3)
|
11
|
-
rspec (3.
|
12
|
-
rspec-core (~> 3.
|
13
|
-
rspec-expectations (~> 3.
|
14
|
-
rspec-mocks (~> 3.
|
15
|
-
rspec-core (3.
|
16
|
-
rspec-support (~> 3.
|
17
|
-
rspec-expectations (3.
|
11
|
+
rspec (3.12.0)
|
12
|
+
rspec-core (~> 3.12.0)
|
13
|
+
rspec-expectations (~> 3.12.0)
|
14
|
+
rspec-mocks (~> 3.12.0)
|
15
|
+
rspec-core (3.12.0)
|
16
|
+
rspec-support (~> 3.12.0)
|
17
|
+
rspec-expectations (3.12.0)
|
18
18
|
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
-
rspec-support (~> 3.
|
20
|
-
rspec-mocks (3.
|
19
|
+
rspec-support (~> 3.12.0)
|
20
|
+
rspec-mocks (3.12.0)
|
21
21
|
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
-
rspec-support (~> 3.
|
23
|
-
rspec-support (3.
|
22
|
+
rspec-support (~> 3.12.0)
|
23
|
+
rspec-support (3.12.0)
|
24
24
|
|
25
25
|
PLATFORMS
|
26
26
|
ruby
|
data/README.md
CHANGED
@@ -42,6 +42,10 @@ argument = Syllogism["all A is B", "some C is A", "some C is B"]
|
|
42
42
|
other_argument = Syllogism["all X is Y", "some Z is X", "some Z is Y"]
|
43
43
|
|
44
44
|
argument == other_argument # => true
|
45
|
+
|
46
|
+
# Generate random argument
|
47
|
+
Syllogism.sample.statements.map(&:to_s)
|
48
|
+
=> ["all M is C", "no L is M", "some L is C"]
|
45
49
|
```
|
46
50
|
|
47
51
|
## Development
|
data/lib/syllogism/version.rb
CHANGED
data/lib/syllogism.rb
CHANGED
@@ -25,6 +25,24 @@ class Syllogism
|
|
25
25
|
new(raw_statements.map { |raw_statement| Statement.parse(raw_statement) })
|
26
26
|
end
|
27
27
|
|
28
|
+
def self.random_statement(letter, other_letter)
|
29
|
+
case (1..4).to_a.sample
|
30
|
+
when 1 then "all #{letter} is #{other_letter}"
|
31
|
+
when 2 then "no #{letter} is #{other_letter}"
|
32
|
+
when 3 then "some #{letter} is #{other_letter}"
|
33
|
+
when 4 then "some #{letter} is #{other_letter}"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.sample
|
38
|
+
first, second, third = ("A".."Z").to_a.sample(3)
|
39
|
+
parse(
|
40
|
+
random_statement(first, second),
|
41
|
+
random_statement(third, first),
|
42
|
+
random_statement(third, second)
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
28
46
|
def initialize(statements)
|
29
47
|
@errors = []
|
30
48
|
@statements = statements
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syllogism
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jayson Virissimo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Proof checker for arguments in Aristotle's term logic
|
14
14
|
email:
|
@@ -20,6 +20,7 @@ files:
|
|
20
20
|
- ".github/workflows/test.yml"
|
21
21
|
- ".gitignore"
|
22
22
|
- ".rspec"
|
23
|
+
- ".tool-versions"
|
23
24
|
- Gemfile
|
24
25
|
- Gemfile.lock
|
25
26
|
- LICENSE.txt
|
@@ -67,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
68
|
- !ruby/object:Gem::Version
|
68
69
|
version: '0'
|
69
70
|
requirements: []
|
70
|
-
rubygems_version: 3.
|
71
|
+
rubygems_version: 3.3.5
|
71
72
|
signing_key:
|
72
73
|
specification_version: 4
|
73
74
|
summary: Proof checker for arguments in Aristotle's term logic
|