-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[recurse] When recursion is used a number of pre-checks (ints/strings…
…) fail.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...ytools.alloy.application/src/test/java/edu/mit/csail/sdg/alloy4whole/AlloyModelsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package edu.mit.csail.sdg.alloy4whole; | ||
|
||
import org.junit.Test; | ||
|
||
import edu.mit.csail.sdg.alloy4.A4Reporter; | ||
import edu.mit.csail.sdg.ast.Command; | ||
import edu.mit.csail.sdg.ast.Module; | ||
import edu.mit.csail.sdg.parser.CompUtil; | ||
import edu.mit.csail.sdg.translator.A4Options; | ||
import edu.mit.csail.sdg.translator.A4Solution; | ||
import edu.mit.csail.sdg.translator.TranslateAlloyToKodkod; | ||
|
||
public class AlloyModelsTest { | ||
|
||
@Test | ||
public void testRecursion() throws Exception { | ||
String filename = "src/test/resources/test-recursion.als"; | ||
Module world = CompUtil.parseEverything_fromFile(A4Reporter.NOP, null, filename); | ||
|
||
A4Options options = new A4Options(); | ||
for (Command command : world.getAllCommands()) { | ||
A4Solution ans = TranslateAlloyToKodkod.execute_command(A4Reporter.NOP, world.getAllReachableSigs(), | ||
command, options); | ||
while (ans.satisfiable()) { | ||
String hc = "Answer: " + ans.toString().hashCode(); | ||
ans = ans.next(); | ||
} | ||
return; | ||
} | ||
} | ||
} |