use of de.bmoth.parser.ast.nodes.FormulaNode in project bmoth by hhu-stups.
the class NumbersTest method quotientTest.
@Test
public void quotientTest() throws ParserException {
String formula = "x = 6 / 3";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
DeclarationNode declarationNode = formulaNode.getImplicitDeclarations().get(0);
assertEquals("x", declarationNode.getName());
assertEquals(INTEGER, declarationNode.getType().toString());
}
use of de.bmoth.parser.ast.nodes.FormulaNode in project bmoth by hhu-stups.
the class RelationTest method rightOverridingTest.
@Test
public void rightOverridingTest() throws ParserException {
String formula = "x = {1|->2}<+{1|->3}";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
DeclarationNode declarationNode = formulaNode.getImplicitDeclarations().get(0);
assertEquals("x", declarationNode.getName());
assertEquals(POW_INTEGER_INTEGER, declarationNode.getType().toString());
}
use of de.bmoth.parser.ast.nodes.FormulaNode in project bmoth by hhu-stups.
the class RelationTest method directProductTest.
@Test
public void directProductTest() throws ParserException {
String formula = "x = {1|->2}><{1|->3}";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
DeclarationNode declarationNode = formulaNode.getImplicitDeclarations().get(0);
assertEquals("x", declarationNode.getName());
assertEquals("POW(INTEGER*(INTEGER*INTEGER))", declarationNode.getType().toString());
}
use of de.bmoth.parser.ast.nodes.FormulaNode in project bmoth by hhu-stups.
the class RelationTest method identityTest.
@Test
@Ignore
public void identityTest() throws ParserException {
String formula = "x = id({1,2})";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
DeclarationNode declarationNode = formulaNode.getImplicitDeclarations().get(0);
assertEquals("x", declarationNode.getName());
assertEquals(POW_INTEGER_INTEGER, declarationNode.getType().toString());
}
use of de.bmoth.parser.ast.nodes.FormulaNode in project bmoth by hhu-stups.
the class RelationTest method projection1Test.
@Test
@Ignore
public void projection1Test() throws ParserException {
String formula = "x = prj1({1,2},{3,4})";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
DeclarationNode declarationNode = formulaNode.getImplicitDeclarations().get(0);
assertEquals("x", declarationNode.getName());
assertEquals(POW_INTEGER_INTEGER, declarationNode.getType().toString());
}
Aggregations