use of de.bmoth.parser.ast.nodes.FormulaNode in project bmoth by hhu-stups.
the class FunctionsTest method bijectionTest.
@Test
@Ignore
public void bijectionTest() throws ParserException {
String formula = "x = {2,3} >->> {1,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 FunctionsTest method totalFunctionTest.
@Test
@Ignore
public void totalFunctionTest() throws ParserException {
String formula = "x = {2,3} --> {1,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 FunctionsTest method functionApplicationTest.
@Test
public void functionApplicationTest() throws ParserException {
String formula = "x = {1|->2, 2|->3,3|->4}(1)";
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 LogicOperationsTest method existentialQuantificationTest.
@Test
public void existentialQuantificationTest() throws ParserException {
String formula = "#x . (x : 1 .. 10 => x > 0)";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
}
use of de.bmoth.parser.ast.nodes.FormulaNode in project bmoth by hhu-stups.
the class LogicOperationsTest method universalQuantificationTest.
@Test
public void universalQuantificationTest() throws ParserException {
String formula = "!x . (x : 1 .. 10 => x > 0)";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
}
Aggregations