lab4a
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
lab4a [2018/01/23 16:10] – created franck | lab4a [2019/01/29 01:12] (current) – franck | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Lab 5 ====== | ||
+ | Implement a listener, named LocalVariableIds, | ||
- | Implement a listener, named ArrayListener, | + | * Consider the interfaces VMListener and SearchListener, |
- | rites of array cells within the main method of an app. A sample run can be foun | + | |
- | d below. | + | |
- | ome hints that may be useful for implementing your listener. | + | |
- | < | + | |
- | < | + | |
- | Consider the interfaces VMListener and SearchListener, | + | |
- | kages gov.nasa.jpf.vm and gov.nasa.jpf.search, | + | |
- | < | + | |
- | Consider subclasses of the class Instruction, | + | |
- | asa.jpf.vm. | + | |
- | < | + | |
- | If you cannot | + | |
- | n method | + | |
- | the entire app. | + | |
- | < | + | |
- | If you cannot | + | |
- | d or write of an array cell occurs. | + | |
- | </ | + | |
- | + | ||
- | <p> | + | |
To compile your listener, use | To compile your listener, use | ||
- | <pre> | + | <code> |
- | javac -cp / | + | javac -cp / |
- | </pre> | + | </code> |
- | or add / | + | or add / |
- | ipse. | + | |
- | + | ||
- | <p> | + | |
To test your listener, you may want to use the following app. | To test your listener, you may want to use the following app. | ||
- | <pre> | + | <code java> |
- | public class ArraySample | + | public class LocalVariableIdsSample |
- | { | + | public static void main(String[] args) { |
- | public static void main(String[] args) | + | int i = 5; |
- | | + | boolean b = true; |
- | int[] array = new int[2]; | + | double d = 3.0; |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
} | } | ||
} | } | ||
- | </pre> | + | </code> |
- | + | ||
- | <p> | + | |
To run JPF on the above app, use the following configuration file. | To run JPF on the above app, use the following configuration file. | ||
- | <pre> | + | <code> |
- | target=ArraySample | + | target=LocalVariableIdsSample |
classpath=. | classpath=. | ||
- | listener=ArrayListener | + | listener=LocalVariableIds |
native_classpath=/ | native_classpath=/ | ||
- | </pre> | + | </code> |
- | where / | + | where / |
- | ss can be found. | + | |
- | <p> | + | If the above configuration file is used with the above app, JPF should produce output similar to the following. |
+ | <code> | ||
+ | JavaPathfinder core system v8.0 (rev 32+) - (C) 2005-2014 United States Government. All rights reserved. | ||
- | If the above configuration file is used with the above app, JPF should produce o | ||
- | utput similar to the following. | ||
- | <pre> | ||
- | JavaPathfinder core system v8.0 (rev 29) - (C) 2005-2014 United States Governmen | ||
- | t. All rights reserved. | ||
+ | ====================================================== system under test | ||
+ | LocalVariableIdsSample.main() | ||
- | ====================================================== | + | ====================================================== |
- | ArraySample.main() | + | |
- | ====================================================== | + | ====================================================== |
- | 20 PM | + | Local variable ids |
- | ***** | + | LocalVariableIdsSample.main([Ljava/lang/String;)V.3 |
- | Total number of reads and writes of array cells: 6 | + | LocalVariableIdsSample.main([Ljava/ |
- | ***** | + | LocalVariableIdsSample.main([Ljava/ |
====================================================== results | ====================================================== results | ||
Line 84: | Line 59: | ||
states: | states: | ||
search: | search: | ||
- | choice generators: | + | choice generators: |
- | =0), data=0 | + | heap: new=346,released=11, |
- | heap: new=347,released=12, | + | instructions: |
- | instructions: | + | max memory: |
- | max memory: | + | loaded code: classes=60, |
- | loaded code: classes=60, | + | |
- | ====================================================== search finished: 2/5/17 1 | + | ====================================================== search finished: 2/8/18 12:04 PM |
- | :20 PM | + | </code> |
- | </pre> | + | |
- | <P> | + | To receive feedback, submit your listener using the submit command before Tuesday February 12: |
+ | submit 4315 lab5 LocalVariableIds.java | ||
- | submit 4315 lab4 ArrayListener.java | ||
lab4a.1516723856.txt.gz · Last modified: by franck