lab8
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
lab8 [2016/03/02 19:30] – created franck | lab8 [2018/02/25 15:00] (current) – franck | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Implement a listener and publisher that, given the following app, | + | ====== Lab 6 ====== |
- | < | + | |
- | < | + | |
- | import java.util.Random; | + | |
- | public class Example | + | Consider the following app. |
+ | <code java> | ||
+ | public class Main { | ||
public static void main(String[] args) { | public static void main(String[] args) { | ||
- | Random random = new Random(); | + | |
- | if (random.nextBoolean()) { | + | |
- | | + | |
- | } else { | + | |
- | System.out.println(" | + | |
- | } | + | |
} | } | ||
} | } | ||
- | </pre> | + | </code> |
- | </ | + | |
- | and the application configuration file | + | |
- | < | + | |
- | < | + | |
- | target=Example | + | |
- | classpath=. | + | |
- | native_classpath=. | + | |
- | listener=AmountOfNonDeterminism | + | |
- | </pre> | + | If we run JPF with the following configuration file |
- | </html> | + | <code> |
- | produces | + | target=Main |
- | <html> | + | classpath=(directory that contains Main.class) |
- | <pre> | + | </code> |
- | JavaPathfinder core system v8.0 (rev 29) - (C) 2005-2014 United States Government. All rights reserved. | + | then we obtain |
+ | <code> | ||
+ | JavaPathfinder core system v8.0 (rev 29+) - (C) 2005-2014 United States Government. All rights reserved. | ||
====================================================== system under test | ====================================================== system under test | ||
- | Example.main() | + | Main.main() |
- | ====================================================== search started: 3/2/16 2:27 PM | + | ====================================================== search started: 3/12/17 9:55 PM |
- | false | + | |
- | true | + | |
- | ====================================================== | + | ====================================================== |
- | maximum amount of nondeterminism: 2 choice(s) | + | gov.nasa.jpf.vm.NoUncaughtExceptionsProperty |
+ | java.lang.UnsatisfiedLinkError: cannot find native java.lang.StrictMath.cbrt | ||
+ | at java.lang.StrictMath.cbrt(no peer) | ||
+ | at Main.main(Main.java: | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | * Implement a native peer class. | ||
+ | JavaPathfinder core system v8.0 (rev 29+) - (C) 2005-2014 United States Government. All rights reserved. | ||
+ | |||
+ | |||
+ | ====================================================== system under test | ||
+ | Main.main() | ||
+ | |||
+ | ====================================================== search started: 3/12/17 9:59 PM | ||
+ | native peer class | ||
+ | 1.6386425412012917 | ||
====================================================== results | ====================================================== results | ||
no errors detected | no errors detected | ||
+ | ... | ||
+ | </ | ||
+ | * Implement a peer class. | ||
+ | JavaPathfinder core system v8.0 (rev 29+) - (C) 2005-2014 United States Government. All rights reserved. | ||
+ | |||
+ | |||
+ | ====================================================== system under test | ||
+ | Main.main() | ||
+ | |||
+ | ====================================================== search started: 3/12/17 10:06 PM | ||
+ | peer class | ||
+ | 1.6386425412012982 | ||
+ | |||
+ | ====================================================== results | ||
+ | no errors detected | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | To compile your classes, you may want to use | ||
+ | < | ||
+ | javac -cp / | ||
+ | </ | ||
+ | or add / | ||
- | ====================================================== statistics | + | To receive feedback, submit both classes and configuration files using |
- | elapsed time: | + | < |
- | states: | + | submit 4315 lab6 (name of file) |
- | search: | + | </ |
- | choice generators: | + | before Tuesday March 6. |
- | heap: | + | |
- | instructions: | + | |
- | max memory: | + | |
- | loaded code: classes=61, | + | |
- | ====================================================== search finished: 3/2/16 2:27 PM | ||
- | </ | ||
- | </ | ||
- | Apart from the classes that have been discussed in the lectures, also the class ChoiceGenerator, | ||
lab8.1456947048.txt.gz · Last modified: 2016/03/02 19:30 by franck