logic_tools 0.3.6 → 0.3.7
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/lib/logic_tools/logicconvert.rb +4 -1
- data/lib/logic_tools/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ac5ee19f5e2583fb76459f21c1081a79251d190
|
4
|
+
data.tar.gz: 4d5ca6164a8a43d70b3cb3eaf2e2bdf476047b5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a814d9ef74ffd4e25cc667af4afa2debac676a4f35d32b50338e574cd7fe1d8de863281ad0cfad7a03ec33e56a7c4e035ac36a15d8067267ac2b11cb34f708b0
|
7
|
+
data.tar.gz: 6017ef5ac0677d76574861ecfc32ec5727f553f5f47c0b7459f18410dd4e66319ac931b21e734f6703697d9cdc62798cbbbc7bc1a006abae6ab21c57fa84937b
|
@@ -36,7 +36,7 @@ module LogicTools
|
|
36
36
|
# print "vars=#{vars}\n"
|
37
37
|
# Converts the tree rooted by self to a sum of products
|
38
38
|
# (reduced to limit the number of cubes and their sizes).
|
39
|
-
tree = self.to_sum_product.reduce
|
39
|
+
tree = self.to_sum_product.flatten.reduce
|
40
40
|
# print "tree=#{tree}\n"
|
41
41
|
|
42
42
|
# Create an empty cover.
|
@@ -72,6 +72,8 @@ module LogicTools
|
|
72
72
|
# Ensure we have a sum of product structure.
|
73
73
|
tree = [ tree ] unless tree.op == :or
|
74
74
|
|
75
|
+
# print "tree=#{tree}\n"
|
76
|
+
|
75
77
|
# Fill it with the cubes corresponding to each product
|
76
78
|
tree.each do |product|
|
77
79
|
product = [ product ] unless product.is_a?(NodeNary)
|
@@ -92,6 +94,7 @@ module LogicTools
|
|
92
94
|
str[index] = "0"
|
93
95
|
end
|
94
96
|
else
|
97
|
+
# print "lit=#{lit}\n"
|
95
98
|
index = vars.index(lit.variable.to_s)
|
96
99
|
# The litteral is a variable
|
97
100
|
if str[index] == "0" then
|
data/lib/logic_tools/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logic_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lovic Gauthier
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|