logic_tools 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3fac599575ddf5395c3a3e1517361807b16f0de4
4
- data.tar.gz: 29be7313218a9c3207222d23c99e7496e4c03a1c
3
+ metadata.gz: 8ac5ee19f5e2583fb76459f21c1081a79251d190
4
+ data.tar.gz: 4d5ca6164a8a43d70b3cb3eaf2e2bdf476047b5d
5
5
  SHA512:
6
- metadata.gz: 7c36a7c2a6af3d8634dc7d9bbc51ac9dc65370b059888833df4950b1eee5104f0c7e2891a8bbe4eb117d9f2dc563c4a2d2687f4ba60d0feeff5d2171b53551c0
7
- data.tar.gz: 5d7d3e6d2a5fb7c7b5ac1d1162906fdb7ca09f4c067b563ac1d11646b8df9928e86d7cbf416a491378e406e35646b0e66c2d34cbd8143d025bf3cb8ba2fff91c
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
@@ -1,3 +1,3 @@
1
1
  module LogicTools
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.7"
3
3
  end
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.6
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-24 00:00:00.000000000 Z
11
+ date: 2017-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler