net.sf.saffron.opt
Class RelSet

java.lang.Object
  |
  +--net.sf.saffron.opt.RelSet

class RelSet
extends Object

A RelSet is an equivalence-set of expressions; that is, a set of expressions which have identical semantics. We are generally interested in using the expression which has the lowest cost.

All of the expressions in an RelSet have the same calling convention.

Since:
16 December, 2001
Version:
$Id: //open/saffron/src/net/sf/saffron/opt/RelSet.java#4 $
Author:
jhyde

Field Summary
(package private)  ArrayList abstractConverters
          List of AbstractConverter objects which have not yet been satisfied.
(package private)  RelSet equivalentSet
          Set to the superseding set when this is found to be equivalent to another set.
(package private)  int id
           
(package private)  SaffronRel rel
           
(package private)  ArrayList rels
           
(package private)  ArrayList subsets
           
(package private)  Set variablesPropagated
          Names of variables which are set by relational expressions in this set and available for use by parent and child expressions.
(package private)  Set variablesUsed
          Names of variables which are used by relational expressions in this set.
 
Constructor Summary
(package private) RelSet()
           
 
Method Summary
 RelSubset add(SaffronRel rel)
          Add a relational expression to a set, with its results available under a particular calling convention.
(package private)  void addInternal(SaffronRel rel)
          Adds an expression rel to this set, without creating a RelSubset.
private  void failType(SaffronRel rel)
           
(package private)  RelSubset getOrCreateSubset(VolcanoCluster cluster, CallingConvention convention)
           
 ArrayList getParentRels()
          Returns all of the SaffronRels which reference SaffronRels in this set.
 RelSubset getSubset(CallingConvention convention)
           
(package private)  void mergeWith(VolcanoPlanner planner, RelSet otherSet)
          Merges otherSet into this one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rels

final ArrayList rels

subsets

final ArrayList subsets

abstractConverters

ArrayList abstractConverters
List of AbstractConverter objects which have not yet been satisfied.


equivalentSet

RelSet equivalentSet
Set to the superseding set when this is found to be equivalent to another set.


rel

SaffronRel rel

variablesPropagated

Set variablesPropagated
Names of variables which are set by relational expressions in this set and available for use by parent and child expressions.


variablesUsed

Set variablesUsed
Names of variables which are used by relational expressions in this set.


id

int id
Constructor Detail

RelSet

RelSet()
Method Detail

getParentRels

public ArrayList getParentRels()
Returns all of the SaffronRels which reference SaffronRels in this set.


getSubset

public RelSubset getSubset(CallingConvention convention)

add

public RelSubset add(SaffronRel rel)
Add a relational expression to a set, with its results available under a particular calling convention. An expression may be in the set several times with different calling conventions (and hence different costs).


getOrCreateSubset

RelSubset getOrCreateSubset(VolcanoCluster cluster,
                            CallingConvention convention)

addInternal

void addInternal(SaffronRel rel)
Adds an expression rel to this set, without creating a RelSubset. (Called only from RelSubset.add(net.sf.saffron.rel.SaffronRel).


mergeWith

void mergeWith(VolcanoPlanner planner,
               RelSet otherSet)
Merges otherSet into this one. You generally call this method after you discover that two relational expressions are equivalent, and hence their sets are equivalent also. After you have called this method, otherSet is obsolete, this otherSet is still alive.


failType

private void failType(SaffronRel rel)

SourceForge.net_Logo