Skip to content

RAM Intermediate Representation

XiaowenHu96 edited this page Apr 13, 2019 · 4 revisions

Intermediate Representation of the Relational Algebra Machine (RAM)

The relational algebra machine has its own representation.


Ram Node

RamNode is the basic unit that forms a RAM program.
Each RamNode has a Type attribute, indicate the Node types, used by the RamVisitor to defer the correct visitor method. (Visitor Pattern is built by type-testing instead of v-table, see RamVisitor.h).


RamCondition

RamConjunction

This class represents a conjunction of two RamCondition. True if both conditions are true. Support short circuit.

RamConstraint

This class holds two RamExpression operands, has various logic operators ('<', '==', etc). This class represents a constraint condition, should be evaluated to true if the constraint holds between two operands.

RamEmptinessCheck

This class holds a target relation, represents an emptiness check operation on the target relation.

RamNegation

RamNegation holds another RamCondition node, whose evaluation result will be negated by RamNegation.

RamAbstractExistenceCheck

Abstract class for existence check.

RamExistenceCheck

In addition to a target relation, it also has an array of RamExpression called values, which serves as a pattern. This classe represents a check operation on the target relation against the given pattern. Should be evaluated to true if any tuple in the target relation matches the pattern.

RamProvenanceExistenceCheck

Similar to the RamExistenceCheck.


RamExpression

Represents an expression in RAM program.

RamIntrinsicOperator

Representing a unary / binary / ternary operation that applies to the arguments.

RamNumber

Represent a numeric value in RAM.

RamPack

A pack operation. Pack the results arguments into a reference.

RamArgument

Subroutine arguments.

RamAutoIncrement

Evaluating this expression should increase the RAM's counter by one.

RamElementAccess

This class represents a select action. The element to be selected is located in the program's run time environment, identified by identifier and element attributes.

RamArgument

Access arguments of a subroutine.

RamUserDefinedOperator

Check here


RamOperation

RamProject

Project the result of expressions into the target relation.

RamReturn

A statement for returning from the subroutine.


RamNestedOperation

This class represents an operation which has a nested operation.

RamFilter

A nested operation. A list of tuples that satisfied the condition will be filtered out. Then apply nestedOperation on those tuples.

RamSearch

This class represents a search action.

RamAggregate

An aggregate operation, see the example here.

RamLookUp

Lookup a particular element within a record in the environment.


RamRelationSearch

This class represents a search action on a specific relation.

RamScan

Perform nestedOperation on all tuples in the target relation.

RamIndexScan

Perform nestedOperation on all tuples in the target relation that match the pattern queryPattern.


RamStatement

RamLoop

This class represents an infinite loop, the body should be evaluated infinitely. A RamLoop instance should always have at least one RamExit object inside of body. See RamExit.

RamExit

Represent a terminate condition.
This statement should always occur inside a RamLoop and will cause the loop to terminate if the RamCondition is true.

RamMerge

A merge operation, merge the tuples from the source relation into the target relation.

RamSequence

This class holds a list of RamStatement that should be executed in sequence.

RamStratum

This class represents the strata of the program.

RamQuery

This clas represents the start of a RAM query operation. Please check RamOperation.

RamSwap

A swap operation, swap the content of two relations.

RamDebugInfo, RamLogTimer

Profiling and debugging purpose.

RamParallel

This class hold a list of RamStatement that should be executed in parallel.


RamRelationStatement

Statements that take on a specific relation.

RamCreate

A create action. Represent a creation of a new relation.

RamDrop

A remove operation. Remove the target relation.

RamClear

A clear operation. Clean the content in a target relation.

RamFact

Represents a fact in a relation.

RamLoad

This class hold a list of IOs, this class represents a write action. Output the content of a RamRelationReference through the IOs.

RamStore

This class hold a list of IOs, this class represents a read action. Read the content through IOs and store in the target RamRelationReference.

RamLogSize

Debugging and profiling purpose.