bmg 0.6.0 → 0.6.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
  SHA1:
3
- metadata.gz: 8485745f67f9a5f3b481e8f8121e57c30f404661
4
- data.tar.gz: 010a318d9896ae6514c96798230ab564540c788d
3
+ metadata.gz: e2b2153bc229ff1517982db773316de847812ac3
4
+ data.tar.gz: 9f9b558de99c868d0b8dd5d8e11eb649fca7e1bd
5
5
  SHA512:
6
- metadata.gz: 5aae26e7caca19cf4ae627cde3eb8de7278b48f881d40b6ff72fcb7f67ff9f571246e5bc8220e4576b2e8f25cddfb4ae1cd92f7670fe856d9ef6399b3c0a679b
7
- data.tar.gz: ff68734d5b561543224dc66c5731f0f89cd9456a3ff94891ce207f18799ceef5d27150b6c848301c0987f7a7a02488d0c9e270a47d01f60689744efc03393a47
6
+ metadata.gz: b46d9fe457281dcee1cc202b341fc98a8dbb55a4b5a1c1fc8cf7163bc4c5694149d2697b55736c112d4583596cc8d1b353f8c4f1144475ef2fe7d7d79deb3047
7
+ data.tar.gz: 4ed985da29e10309920a3a8866aff6f2d21014e23ee023a695cc4105f6d740ab62c4b87cc72f9157aa98bfc06b0c5e2c1f8dd98f8554e1e605fe27e8b1f1ba43
@@ -9,6 +9,7 @@ module Bmg
9
9
  end
10
10
 
11
11
  def self.empty(type = Type::ANY)
12
+ raise ArgumentError, "Missing type" if type.nil?
12
13
  Relation::Empty.new(type)
13
14
  end
14
15
 
@@ -95,5 +96,3 @@ module Bmg
95
96
 
96
97
  end # module Relation
97
98
  end # module Bmg
98
- require_relative 'relation/empty'
99
- require_relative 'relation/in_memory'
@@ -1,6 +1,12 @@
1
1
  module Bmg
2
2
  class Type
3
3
 
4
+ def initialize(predicate = Predicate.tautology)
5
+ @predicate = predicate
6
+ raise ArgumentError if @predicate.nil?
7
+ end
8
+ attr_reader :predicate
9
+
4
10
  ANY = Type.new
5
11
 
6
12
  def [](attribute)
@@ -20,7 +26,7 @@ module Bmg
20
26
  end
21
27
 
22
28
  def constants(cs)
23
- ANY
29
+ Type.new(@predicate & Predicate.eq(cs))
24
30
  end
25
31
 
26
32
  def extend(extension)
@@ -36,15 +42,15 @@ module Bmg
36
42
  end
37
43
 
38
44
  def rename(renaming)
39
- ANY
45
+ Type.new(@predicate.rename(renaming))
40
46
  end
41
47
 
42
48
  def restrict(predicate)
43
- ANY
49
+ Type.new(@predicate & predicate)
44
50
  end
45
51
 
46
52
  def union(other)
47
- ANY
53
+ Type.new(@predicate | other.predicate)
48
54
  end
49
55
 
50
56
  end # class Type
@@ -2,7 +2,7 @@ module Bmg
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 6
5
- TINY = 0
5
+ TINY = 1
6
6
  end
7
7
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bmg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau