forge.program
Class ForgeProgram

java.lang.Object
  extended by forge.program.ForgeProgram

public final class ForgeProgram
extends java.lang.Object

Manages the Forge classes, fields, and procedures.

Author:
Greg Dennis (gdennis@mit.edu)

Constructor Summary
ForgeProgram()
          Constructs an empty Forge program.
 
Method Summary
 BooleanDomain booleanDomain()
          Returns the boolean domain.
 void checkProgram(ProgramElement elem)
           
 ForgeType.Unary empty()
          Returns the empty set constant/type.
 ForgeType empty(int arity)
          Returns the empty constant/type of the specified arity.
 LocalDecls emptyDecls()
          Returns the empty decls.
 BooleanLiteral falseLiteral()
          Returns the false literal.
 java.util.Set<GlobalVariable> globalVariables()
          Returns the set of all global variables in the program.
 java.util.Set<InstanceDomain> instanceDomains()
          Returns the instance domains.
 java.util.Set<InstanceLiteral> instanceLiterals()
          Returns the set of all instance literals.
 IntegerDomain integerDomain()
          Returns the integer domain.
 IntegerLiteral integerLiteral(int value)
          Returns the integer literal with the specified value.
 GlobalVariable newGlobalVariable(java.lang.String name, ForgeType type)
          Constructs and returns a new global variable.
 InstanceDomain newInstanceDomain(java.lang.String name)
          Constructs and returns a new instance domain.
 InstanceLiteral newInstanceLiteral(java.lang.String name, InstanceDomain type)
          Constructs and returns a new instance literal.
 LocalVariable newLocalVariable(java.lang.String name, ForgeType type)
          Constructs and returns a new local variable.
 ForgeProcedure newProcedure(java.lang.String name, LocalDecls ins, LocalDecls outs)
          Constructs and returns a new procedure.
 BooleanLiteral trueLiteral()
          Returns the true literal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForgeProgram

public ForgeProgram()
Constructs an empty Forge program.

Method Detail

checkProgram

public void checkProgram(ProgramElement elem)

empty

public ForgeType.Unary empty()
Returns the empty set constant/type.


empty

public ForgeType empty(int arity)
Returns the empty constant/type of the specified arity.


emptyDecls

public LocalDecls emptyDecls()
Returns the empty decls.


booleanDomain

public BooleanDomain booleanDomain()
Returns the boolean domain.


integerDomain

public IntegerDomain integerDomain()
Returns the integer domain.


newInstanceDomain

public InstanceDomain newInstanceDomain(java.lang.String name)
Constructs and returns a new instance domain.


instanceDomains

public java.util.Set<InstanceDomain> instanceDomains()
Returns the instance domains.


trueLiteral

public BooleanLiteral trueLiteral()
Returns the true literal.


falseLiteral

public BooleanLiteral falseLiteral()
Returns the false literal.


integerLiteral

public IntegerLiteral integerLiteral(int value)
Returns the integer literal with the specified value.


newInstanceLiteral

public InstanceLiteral newInstanceLiteral(java.lang.String name,
                                          InstanceDomain type)
Constructs and returns a new instance literal.


instanceLiterals

public java.util.Set<InstanceLiteral> instanceLiterals()
Returns the set of all instance literals.


newGlobalVariable

public GlobalVariable newGlobalVariable(java.lang.String name,
                                        ForgeType type)
Constructs and returns a new global variable.


globalVariables

public java.util.Set<GlobalVariable> globalVariables()
Returns the set of all global variables in the program.


newLocalVariable

public LocalVariable newLocalVariable(java.lang.String name,
                                      ForgeType type)
Constructs and returns a new local variable.


newProcedure

public ForgeProcedure newProcedure(java.lang.String name,
                                   LocalDecls ins,
                                   LocalDecls outs)
Constructs and returns a new procedure.