use of de.bmoth.parser.ast.nodes.FormulaNode in project bmoth by hhu-stups.
the class SequenceTest method reverseTest.
@Test
@Ignore
public void reverseTest() throws ParserException {
String formula = "x = rev([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());
}
use of de.bmoth.parser.ast.nodes.FormulaNode in project bmoth by hhu-stups.
the class SequenceTest method tailTest.
@Test
public void tailTest() throws ParserException {
String formula = "x = tail([2,3,4,5])";
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 SetOperationsTest method nonEmptyPowerSetTest.
@Test
@Ignore
public void nonEmptyPowerSetTest() throws ParserException {
String formula = "x = POW1({4,5})";
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 SetOperationsTest method finiteSubsetsTest.
@Test
@Ignore
public void finiteSubsetsTest() throws ParserException {
String formula = "x = FIN({4,5})";
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 SetOperationsTest method membershipTest.
// TODO: number 17 and 18 of the summary
@Test
public void membershipTest() throws ParserException {
String formula = "x : 4 .. 10";
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());
}
Aggregations