Search in sources :

Example 1 with SubstitutionOptions

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

the class MachineTranslatorTest method testOperationsGeneration.

@Test
public void testOperationsGeneration() {
    assertEquals(1, translator.getOperationConstraints().size());
    assertEquals(translator.getOperationConstraints(), translator.getOperationConstraints(new SubstitutionOptions(TranslationOptions.PRIMED_0, TranslationOptions.UNPRIMED)));
    assertEquals("[(and (< x 50) (= |x'0| (+ x 1)))]", translator.getOperationConstraints().toString());
    assertEquals("[(and (< |x'128| 50) (= |x'512| (+ |x'128| 1)))]", translator.getOperationConstraints(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)

Example 2 with SubstitutionOptions

use of de.bmoth.backend.SubstitutionOptions 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

SubstitutionOptions (de.bmoth.backend.SubstitutionOptions)2 TranslationOptions (de.bmoth.backend.TranslationOptions)2 Test (org.junit.Test)2