Search in sources :

Example 6 with TranslationOptions

use of de.bmoth.backend.TranslationOptions in project bmoth by hhu-stups.

the class MachineTranslatorTest method testCombinedOperationsGeneration.

@Test
public void testCombinedOperationsGeneration() {
    assertEquals(translator.getCombinedOperationConstraint(), translator.getCombinedOperationConstraint(new SubstitutionOptions(TranslationOptions.PRIMED_0, TranslationOptions.UNPRIMED)));
    assertEquals("(and (< x 50) (= |x'0| (+ x 1)))", translator.getCombinedOperationConstraint().toString());
    assertEquals("(and (< |x'128| 50) (= |x'512| (+ |x'128| 1)))", translator.getCombinedOperationConstraint(new SubstitutionOptions(new TranslationOptions(512), new TranslationOptions(128))).toString());
}
Also used : SubstitutionOptions(de.bmoth.backend.SubstitutionOptions) TranslationOptions(de.bmoth.backend.TranslationOptions) Test(org.junit.Test)

Aggregations

TranslationOptions (de.bmoth.backend.TranslationOptions)6 Test (org.junit.Test)5 SubstitutionOptions (de.bmoth.backend.SubstitutionOptions)3 Streams (com.google.common.collect.Streams)1 com.microsoft.z3 (com.microsoft.z3)1 PRIMED_0 (de.bmoth.backend.TranslationOptions.PRIMED_0)1 UNPRIMED (de.bmoth.backend.TranslationOptions.UNPRIMED)1 de.bmoth.parser.ast.nodes (de.bmoth.parser.ast.nodes)1 SubstitutionVisitor (de.bmoth.parser.ast.visitors.SubstitutionVisitor)1 java.util (java.util)1 Collectors (java.util.stream.Collectors)1