catlogic 1.0.0 → 1.1.0
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.
- checksums.yaml +4 -4
- data/.ruby-gemset +1 -1
- data/.ruby-version +1 -1
- data/bin/catlogic +93 -0
- data/catlogic.gemspec +2 -0
- data/lib/catlogic/version.rb +1 -1
- metadata +20 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd4b96763af60240d4dd29bacd34868458dfb9f9
|
4
|
+
data.tar.gz: 1d4698917a91f145edf28374f012ed928ea3b5ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cc347815311dc996c560c1e0a0844dfaa1cda0e5fdea3610d4a8ef83c81f75c1af69877acafc89ed89b976ca987fb8b37754ea306bcbe6b73ee2b845322fdbe
|
7
|
+
data.tar.gz: e46d18267992e4316f68c5e1569adf1e14136bc6af8f19d8eefa07c53944c38bdfb63885e897d8382475bb6b15e7f4e6fed8747a8ea70ddc0ea7c1c0c9d17191
|
data/.ruby-gemset
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
default
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.2.
|
1
|
+
ruby-2.2.1
|
data/bin/catlogic
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "thor"
|
4
|
+
require "catlogic"
|
5
|
+
|
6
|
+
class CatlogicCLI < Thor
|
7
|
+
desc "version", "ask for catlogic version"
|
8
|
+
def version
|
9
|
+
puts Catlogic::VERSION
|
10
|
+
end
|
11
|
+
desc "inference", "get immediate inferences from proposition type"
|
12
|
+
def inference(propositiontype)
|
13
|
+
type = Catlogic::PropositionType.new(propositiontype, true)
|
14
|
+
proposition = type.proposition
|
15
|
+
|
16
|
+
puts "======Proposition========="
|
17
|
+
puts proposition.label
|
18
|
+
puts "======Proposition Type========="
|
19
|
+
puts "type: #{proposition.type.label}"
|
20
|
+
puts "======Assumed Truth Value========="
|
21
|
+
puts "assumed: #{proposition.truthvalue}"
|
22
|
+
|
23
|
+
puts "=====Immediate Inferences========="
|
24
|
+
contradictory = proposition.contradictory
|
25
|
+
if proposition.quantity.label == "universal"
|
26
|
+
contrary_subcontrary = proposition.contrary
|
27
|
+
elsif proposition.quantity.label == "particular"
|
28
|
+
contrary_subcontrary = proposition.subcontrary
|
29
|
+
end
|
30
|
+
subaltern = proposition.subaltern
|
31
|
+
converse = proposition.converse
|
32
|
+
obverse = proposition.obverse
|
33
|
+
contrapolated = proposition.contrapolated
|
34
|
+
|
35
|
+
puts "====contradictory: #{contradictory.type.label}: #{contradictory.truthvalue}==="
|
36
|
+
puts contradictory.label
|
37
|
+
puts "====contrary/subcontrary: #{contrary_subcontrary.type.label}: #{contrary_subcontrary.truthvalue}===="
|
38
|
+
puts contrary_subcontrary.label
|
39
|
+
puts "====subaltern: #{subaltern.type.label}: #{subaltern.truthvalue}===="
|
40
|
+
puts subaltern.label
|
41
|
+
puts "====converse: #{converse.type.label}: #{converse.truthvalue}===="
|
42
|
+
puts converse.label
|
43
|
+
puts "====obverse: #{obverse.type.label}: #{obverse.truthvalue}===="
|
44
|
+
puts obverse.label
|
45
|
+
puts "====contrapolated = #{contrapolated.type.label}: #{contrapolated.truthvalue}===="
|
46
|
+
puts contrapolated.label
|
47
|
+
end
|
48
|
+
desc "test", "test validity of syllogism form"
|
49
|
+
def test(mood, figure)
|
50
|
+
form = Catlogic::Form.new(mood, figure.to_i)
|
51
|
+
puts "====================="
|
52
|
+
puts "Testing: #{form.label}"
|
53
|
+
|
54
|
+
syllogism = form.syllogism
|
55
|
+
|
56
|
+
puts "=====Propositional form====="
|
57
|
+
puts form.syllogism.label
|
58
|
+
|
59
|
+
### This is redundant in testSyllogism ##
|
60
|
+
puts "=====Validity===="
|
61
|
+
puts "Validity: #{syllogism.validity}"
|
62
|
+
|
63
|
+
|
64
|
+
if (!syllogism.validity)
|
65
|
+
if (!syllogism.undistributed_middle_test)
|
66
|
+
puts "undistributed_middle_test failed"
|
67
|
+
puts "=========="
|
68
|
+
end
|
69
|
+
if (!syllogism.illicit_major_test)
|
70
|
+
puts "illicit_major_test failed"
|
71
|
+
puts "=========="
|
72
|
+
end
|
73
|
+
if (!syllogism.illicit_minor_test)
|
74
|
+
puts "illicit_minor_test failed"
|
75
|
+
puts "=========="
|
76
|
+
end
|
77
|
+
if (!syllogism.exclusive_premises_test)
|
78
|
+
puts "exclusive_premises_test failed"
|
79
|
+
puts "=========="
|
80
|
+
end
|
81
|
+
if (!syllogism.affirm_from_neg_test)
|
82
|
+
puts "affirm_from_neg_test failed"
|
83
|
+
puts "=========="
|
84
|
+
end
|
85
|
+
if (!syllogism.neg_from_affirms_test)
|
86
|
+
puts "neg_from_affirms_test"
|
87
|
+
puts "=========="
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
CatlogicCLI.start(ARGV)
|
data/catlogic.gemspec
CHANGED
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
spec.add_dependency "thor"
|
22
|
+
|
21
23
|
spec.add_development_dependency "bundler", "~> 1.7"
|
22
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
25
|
spec.add_development_dependency 'rspec'
|
data/lib/catlogic/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: catlogic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeffrey C. Witt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -69,7 +83,8 @@ dependencies:
|
|
69
83
|
description: A gem for building categorial propositions and syllogisms
|
70
84
|
email:
|
71
85
|
- jeffreycwitt@gmail.com
|
72
|
-
executables:
|
86
|
+
executables:
|
87
|
+
- catlogic
|
73
88
|
extensions: []
|
74
89
|
extra_rdoc_files: []
|
75
90
|
files:
|
@@ -81,6 +96,7 @@ files:
|
|
81
96
|
- LICENSE.txt
|
82
97
|
- README.md
|
83
98
|
- Rakefile
|
99
|
+
- bin/catlogic
|
84
100
|
- catlogic.gemspec
|
85
101
|
- lib/catlogic.rb
|
86
102
|
- lib/catlogic/distribution.rb
|
@@ -150,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
166
|
version: '0'
|
151
167
|
requirements: []
|
152
168
|
rubyforge_project:
|
153
|
-
rubygems_version: 2.4.
|
169
|
+
rubygems_version: 2.4.6
|
154
170
|
signing_key:
|
155
171
|
specification_version: 4
|
156
172
|
summary: A gem for building categorial propositions and syllogisms
|