syllogism 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +6 -7
- data/.gitignore +3 -0
- data/.tool-versions +1 -0
- data/Gemfile.lock +14 -14
- 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
- data/syllogism.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 699731ccbe8b1c48b8e052f4afa11cdbf2bdddd0a39d5e4f0592816f81435320
|
4
|
+
data.tar.gz: f96c3d39000c0cafc6797ba430fd04de8a591a52244c7c9775a32f27f5a82d3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6d90cf575f4eb719a32052eb148fb09645f15f7837d8b8d3278ab66775abc0ffcaf9b83e55241d9f7f096044824f735e84f3d0d2b0324befdf02c88bccbc52d
|
7
|
+
data.tar.gz: 6a2b04a1126d0db9cc7314f04c5fb144971492ce9b71593e897fb76eac432cefc5191241026d93c3ee99092bd5bcc84234e324fd01a4cd24b4d88847d7f6c26f
|
data/.github/workflows/test.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
name: Tests
|
1
|
+
name: Tests
|
2
2
|
|
3
3
|
on:
|
4
4
|
pull_request:
|
@@ -16,14 +16,13 @@ jobs:
|
|
16
16
|
fail-fast: false
|
17
17
|
matrix:
|
18
18
|
os:
|
19
|
-
- macos
|
19
|
+
- macos
|
20
20
|
- ubuntu
|
21
21
|
ruby:
|
22
|
-
- 2.4
|
23
|
-
- 2.5
|
24
|
-
- 2.6
|
25
|
-
- 2.7
|
26
22
|
- 3.0
|
23
|
+
- 3.1
|
24
|
+
- 3.2
|
25
|
+
- 3.3
|
27
26
|
allow_failures:
|
28
27
|
- false
|
29
28
|
include:
|
@@ -44,4 +43,4 @@ jobs:
|
|
44
43
|
ruby-version: ${{ matrix.ruby }}
|
45
44
|
bundler-cache: true
|
46
45
|
- name: Test
|
47
|
-
run: bundle exec rake spec || $ALLOW_FAILURES
|
46
|
+
run: bundle exec rake spec || $ALLOW_FAILURES
|
data/.gitignore
CHANGED
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.3.0
|
data/Gemfile.lock
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
syllogism (0.
|
4
|
+
syllogism (0.3.0)
|
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
|
@@ -31,4 +31,4 @@ DEPENDENCIES
|
|
31
31
|
syllogism!
|
32
32
|
|
33
33
|
BUNDLED WITH
|
34
|
-
2.1
|
34
|
+
2.4.1
|
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
|
data/syllogism.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.description = "Proof checker for arguments in Aristotle's term logic"
|
11
11
|
spec.homepage = "https://github.com/jaysonvirissimo/syllogism"
|
12
12
|
spec.license = "MIT"
|
13
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
13
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
|
14
14
|
|
15
15
|
spec.metadata["allowed_push_host"] = "https://rubygems.org/"
|
16
16
|
|
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.
|
4
|
+
version: 0.3.0
|
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: 2024-01-20 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
|
@@ -60,14 +61,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
60
61
|
requirements:
|
61
62
|
- - ">="
|
62
63
|
- !ruby/object:Gem::Version
|
63
|
-
version: 2.
|
64
|
+
version: 2.6.0
|
64
65
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
66
|
requirements:
|
66
67
|
- - ">="
|
67
68
|
- !ruby/object:Gem::Version
|
68
69
|
version: '0'
|
69
70
|
requirements: []
|
70
|
-
rubygems_version: 3.
|
71
|
+
rubygems_version: 3.5.3
|
71
72
|
signing_key:
|
72
73
|
specification_version: 4
|
73
74
|
summary: Proof checker for arguments in Aristotle's term logic
|