predicate 2.3.0 → 2.3.1

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
  SHA256:
3
- metadata.gz: 901370b7a22028c4557c52fb7f5cd8d3ac92c97a440cf4d0f772bd592198c3a5
4
- data.tar.gz: 7dc1e4912f365fc08657fc1b7289f1796989511c8b5e7c5e219bf8fe9eb16ccd
3
+ metadata.gz: 4dfe13a9bf0be96cb22edabb43b170e58b312787bfb5f7af5e1f23cbf4d99f20
4
+ data.tar.gz: f27cd571b7d17b57d4e35cf2001062498e8a8b3b75a76cc9db3bbf235c3786e7
5
5
  SHA512:
6
- metadata.gz: 9515618b5f501b1774cae70cd88784d8bc965f2c331132c5c1f11363e3f690df9233f423195e3d0938fdf42cde4f90a68a69f1273e544014a0f43b386b322b8b
7
- data.tar.gz: 4c4870c03e0aa43e7082136e68d6c17873febcb5608090713fc5ee0873f8f5e5c061a74eb5d57159bac3962f3ca9ce906e629e329bd654c4fd4be61cedad4ea8
6
+ metadata.gz: 2aecdcbadfa7eee6a469ce56f2432cfd9f25cc3f5e4aaae882841d01178d4727ff1289d9bc47fb1ec14d2bb20f6ec4d53b1af4283037b72a3be4842111e56699
7
+ data.tar.gz: 96bc8391a261ba1587a146248e5f37947c136f98cdd3352ed50554ea10b8056338355c5a722b87e3df553300a3b6761a19be576d741f6c2d7519f76e3fa25550
@@ -22,8 +22,8 @@ class Predicate
22
22
  @free_variables ||= left.free_variables | right.free_variables
23
23
  end
24
24
 
25
- def var_against_literal?
26
- left.identifier? && right.literal?
25
+ def var_against_literal_value?
26
+ left.identifier? && right.literal? && !right.has_placeholder?
27
27
  end
28
28
 
29
29
  end
@@ -13,9 +13,8 @@ class Predicate
13
13
  return self if constants == other.constants
14
14
  return contradiction
15
15
  when In
16
- return super unless var_against_literal? && other.var_against_literal?
17
- mine = self.right.value
18
- hers = other.right.value
16
+ return super unless var_against_literal_value? && other.var_against_literal_value?
17
+ mine, hers = self.right.value, other.right.value
19
18
  return self if hers.include?(mine)
20
19
  contradiction
21
20
  else
@@ -71,8 +71,8 @@ class Predicate
71
71
  values.include?(identifier.evaluate(tuple))
72
72
  end
73
73
 
74
- def var_against_literal?
75
- left.identifier? && right.literal?
74
+ def var_against_literal_value?
75
+ left.identifier? && right.literal? && !right.has_placeholder?
76
76
  end
77
77
 
78
78
  end
@@ -2,7 +2,7 @@ class Predicate
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 3
5
- TINY = 0
5
+ TINY = 1
6
6
  end
7
7
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
8
8
  end
@@ -26,5 +26,11 @@ class Predicate
26
26
  it{ should be_a(And) }
27
27
  end
28
28
 
29
+ context 'with an IN having a placeholder' do
30
+ let(:right){ Factory.in(:x, Factory.placeholder) }
31
+
32
+ it{ should be_a(And) }
33
+ end
34
+
29
35
  end
30
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: predicate
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-21 00:00:00.000000000 Z
11
+ date: 2020-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sexpr
@@ -206,8 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  - !ruby/object:Gem::Version
207
207
  version: '0'
208
208
  requirements: []
209
- rubyforge_project:
210
- rubygems_version: 2.7.6
209
+ rubygems_version: 3.1.2
211
210
  signing_key:
212
211
  specification_version: 4
213
212
  summary: Predicate provides a simple class and processors to encode and manipulate