public final class LogicEnvironment
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
PackageSymbol |
top |
Constructor and Description |
---|
LogicEnvironment(ErrorStream error)
Create a new and empty environment.
|
LogicEnvironment(PackageSymbol top,
ErrorStream error)
Create a new environment at top-level.
|
LogicEnvironment(TheorySymbol tsymbol,
ErrorStream error)
Create a new environment from theory symbol.
|
Modifier and Type | Method and Description |
---|---|
void |
enter()
Enter a new scope.
|
void |
exit()
Exit a scope.
|
Declaration[][] |
getDeclarations()
Get sequence of ordered declarations sequences where declarations in a
later sequence supersede the previous declarations.
|
FormulaSymbol |
getFormulaSymbol(Identifier name)
Returns formula symbol associated to name.
|
java.util.Collection<FormulaSymbol> |
getFormulaSymbols()
Get all formula symbols.
|
java.util.Vector<TheorySymbol> |
getTheories()
Get theories that may be referenced in environment in dependence order.
|
TypeSymbol |
getTypeSymbol(Identifier name)
Returns type symbol associated to name.
|
TypeSymbol |
getTypeSymbol(Reference ref)
Get type denoted by reference in current environment
|
java.util.Collection<TypeSymbol> |
getTypeSymbols()
Get all type symbols.
|
ValueSymbol |
getValueSymbol(Identifier name)
Returns value symbol associated to name.
|
ValueSymbol |
getValueSymbol(Reference ref)
Get value denoted by reference in current environment
|
java.util.Collection<ValueSymbol> |
getValueSymbols()
Get all value symbols.
|
FormulaSymbol |
putFormula(Identifier name,
Formula formula,
FormulaDefinition decl,
TheorySymbol theory)
Attempts to put formula into value table
|
TypeSymbol |
putType(Identifier name,
Type type,
TypeDeclaration decl)
Attempts to put type into type table.
|
ValueSymbol |
putValue(Identifier name,
Type type,
Declaration decl)
Attempts to put value into value table
|
java.util.Vector<TheorySymbol> |
setTheories(PackageSymbol psymbol,
TheorySymbol baseTheory,
TheorySymbol classTheory,
Import[] imports,
Name[] tnames)
Set in this environment the theories that may be referenced
(ensuring that they are indeed read from file).
|
public PackageSymbol top
public LogicEnvironment(PackageSymbol top, ErrorStream error)
top
- the top-level package for looking up global nameserror
- the stream for printing error messages.public LogicEnvironment(TheorySymbol tsymbol, ErrorStream error)
tsymbol
- the symbol from which to create the environmenterror
- the stream for printing error messages.public LogicEnvironment(ErrorStream error)
error
- the error stream to write to.public java.util.Vector<TheorySymbol> setTheories(PackageSymbol psymbol, TheorySymbol baseTheory, TheorySymbol classTheory, Import[] imports, Name[] tnames)
psymbol
- the package in which this environment is processed.baseTheory
- the always referable base theory (may be null)classTheory
- the theory of the current class (may be null)imports
- the import statements to be processed.tnames
- the theory names that may be referenced.public java.util.Vector<TheorySymbol> getTheories()
public void enter()
public void exit()
public TypeSymbol putType(Identifier name, Type type, TypeDeclaration decl)
name
- the name of the typetype
- the type associated to the namedecl
- the declaration of the typepublic TypeSymbol getTypeSymbol(Identifier name)
name
- the name of the type.public java.util.Collection<TypeSymbol> getTypeSymbols()
public ValueSymbol putValue(Identifier name, Type type, Declaration decl)
name
- the name of the valuetype
- the type associated to the valuedecl
- the declaration of the valuepublic ValueSymbol getValueSymbol(Identifier name)
name
- the name of the value.public java.util.Collection<ValueSymbol> getValueSymbols()
public FormulaSymbol putFormula(Identifier name, Formula formula, FormulaDefinition decl, TheorySymbol theory)
name
- the name of the formulaformula
- the formula itselfdecl
- the formula definition.theory
- the theory in which the formula occurs (may be null)public FormulaSymbol getFormulaSymbol(Identifier name)
name
- the name of the formulapublic java.util.Collection<FormulaSymbol> getFormulaSymbols()
public Declaration[][] getDeclarations()
public ValueSymbol getValueSymbol(Reference ref)
ref
- the referencepublic TypeSymbol getTypeSymbol(Reference ref)
ref
- the reference