lib/bmg/algebra.rb in bmg-0.5.0 vs lib/bmg/algebra.rb in bmg-0.6.0
- old
+ new
@@ -1,8 +1,21 @@
module Bmg
module Algebra
+ METHODS = [
+ :allbut,
+ :autowrap,
+ :autosummarize,
+ :constants,
+ :extend,
+ :image,
+ :project,
+ :rename,
+ :restrict,
+ :union
+ ]
+
def allbut(butlist = [])
_allbut self.type.allbut(butlist), butlist
end
def _allbut(type, butlist)
@@ -80,11 +93,15 @@
else
type = self.type.restrict(predicate)
if predicate.contradiction?
Relation.empty(type)
else
- _restrict type, predicate
+ begin
+ _restrict type, predicate
+ rescue Predicate::NotSupportedError
+ Operator::Restrict.new(type, self, predicate)
+ end
end
end
end
def _restrict(type, predicate)
@@ -98,8 +115,17 @@
def _union(type, other, options)
Operator::Union.new(type, [self, other], options)
end
protected :_union
+
+ def spied(spy)
+ return self if spy.nil?
+ Relation::Spied.new(self, spy)
+ end
+
+ def unspied
+ self
+ end
end # module Algebra
end # module Bmg