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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6312cc7710e89773cfc041b5affe729ba1b3b647
4
- data.tar.gz: 5590b0ba2c25878ba794371fc6c0f0a762924c4e
3
+ metadata.gz: dd4b96763af60240d4dd29bacd34868458dfb9f9
4
+ data.tar.gz: 1d4698917a91f145edf28374f012ed928ea3b5ff
5
5
  SHA512:
6
- metadata.gz: 679b421b4ce3c76b15de5246594833eb9782f27a32605b5ab6f8e0017b88d3409d71ba59ad4e4e6250990926e224c154acc8c10e1b35337eba1c57f20f75fdb9
7
- data.tar.gz: 51ac946455ced01462986b901dcd46287d6a3d26584995b9d7057113e42ca663d251434e334019b667a1a59d8c14cfb295398a52696485bfcbb07be46b980af1
6
+ metadata.gz: 8cc347815311dc996c560c1e0a0844dfaa1cda0e5fdea3610d4a8ef83c81f75c1af69877acafc89ed89b976ca987fb8b37754ea306bcbe6b73ee2b845322fdbe
7
+ data.tar.gz: e46d18267992e4316f68c5e1569adf1e14136bc6af8f19d8eefa07c53944c38bdfb63885e897d8382475bb6b15e7f4e6fed8747a8ea70ddc0ea7c1c0c9d17191
@@ -1 +1 @@
1
- catlogic
1
+ default
@@ -1 +1 @@
1
- ruby-2.2.0
1
+ ruby-2.2.1
@@ -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)
@@ -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'
@@ -1,3 +1,3 @@
1
1
  module Catlogic
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
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.0.0
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: 2015-08-29 00:00:00.000000000 Z
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.5
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