|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.mit.csail.sdg.alloy4compiler.translator.TranslateKodkodToJava
public final class TranslateKodkodToJava
Translate a Kodkod formula node to an equivalent Java program that solves the formula.
Requirements: atoms must be String objects (since we cannot possibly output a Java source code that can re-generate arbitrary Java objects).
Method Summary | |
---|---|
static java.lang.String |
convert(kodkod.ast.Formula formula,
int bitwidth,
java.lang.Iterable<java.lang.String> atoms,
kodkod.instance.Bounds bounds,
java.util.Map<java.lang.Object,java.lang.String> atomMap)
Given a Kodkod formula node, return a Java program that (when compiled and executed) would solve that formula. |
static int |
countHeight(kodkod.ast.Node node)
Count the height of the given Kodkod AST tree. |
void |
visit(kodkod.ast.BinaryExpression x)
|
void |
visit(kodkod.ast.BinaryFormula x)
|
void |
visit(kodkod.ast.BinaryIntExpression x)
|
void |
visit(kodkod.ast.ComparisonFormula x)
|
void |
visit(kodkod.ast.Comprehension x)
|
void |
visit(kodkod.ast.ConstantExpression x)
|
void |
visit(kodkod.ast.ConstantFormula x)
|
void |
visit(kodkod.ast.Decl x)
|
void |
visit(kodkod.ast.Decls x)
|
void |
visit(kodkod.ast.ExprToIntCast x)
|
void |
visit(kodkod.ast.IfExpression x)
|
void |
visit(kodkod.ast.IfIntExpression x)
|
void |
visit(kodkod.ast.IntComparisonFormula x)
|
void |
visit(kodkod.ast.IntConstant x)
|
void |
visit(kodkod.ast.IntToExprCast x)
|
void |
visit(kodkod.ast.MultiplicityFormula x)
|
void |
visit(kodkod.ast.NaryExpression x)
|
void |
visit(kodkod.ast.NaryFormula x)
|
void |
visit(kodkod.ast.NaryIntExpression x)
|
void |
visit(kodkod.ast.NotFormula x)
|
void |
visit(kodkod.ast.ProjectExpression x)
|
void |
visit(kodkod.ast.QuantifiedFormula x)
|
void |
visit(kodkod.ast.Relation x)
|
void |
visit(kodkod.ast.RelationPredicate x)
|
void |
visit(kodkod.ast.SumExpression x)
|
void |
visit(kodkod.ast.UnaryExpression x)
|
void |
visit(kodkod.ast.UnaryIntExpression x)
|
void |
visit(kodkod.ast.Variable x)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int countHeight(kodkod.ast.Node node)
public static java.lang.String convert(kodkod.ast.Formula formula, int bitwidth, java.lang.Iterable<java.lang.String> atoms, kodkod.instance.Bounds bounds, java.util.Map<java.lang.Object,java.lang.String> atomMap)
Requirement: atoms must be String objects (since we cannot possibly output a Java source code that can re-generate arbitrary Java objects).
formula
- - the formula to convertbitwidth
- - the integer bitwidthatoms
- - an iterator over the set of all atomsbounds
- - the Kodkod bounds object to useatomMap
- - if nonnull, it is used to map the atom name before printingpublic void visit(kodkod.ast.Relation x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.BinaryExpression x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.ComparisonFormula x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.ProjectExpression x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.IntComparisonFormula x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.BinaryFormula x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.BinaryIntExpression x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.UnaryIntExpression x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.UnaryExpression x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.IfExpression x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.IfIntExpression x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.NotFormula x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.IntToExprCast x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.ExprToIntCast x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.IntConstant x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.ConstantFormula x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.ConstantExpression x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.Variable x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.Comprehension x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.QuantifiedFormula x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.SumExpression x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.MultiplicityFormula x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.Decl x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.Decls x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.RelationPredicate x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.NaryExpression x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.NaryIntExpression x)
visit
in interface kodkod.ast.visitor.VoidVisitor
public void visit(kodkod.ast.NaryFormula x)
visit
in interface kodkod.ast.visitor.VoidVisitor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |