From: rtrimana Date: Fri, 26 Jul 2019 18:26:05 +0000 (-0700) Subject: Adding tracked variables in main.jpf. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3086d5cc97caa3c09a1a686620b9df8253a2ac08;p=jpf-core.git Adding tracked variables in main.jpf. --- diff --git a/examples/Choice.groovy b/examples/Choice.groovy new file mode 100644 index 0000000..25455a8 --- /dev/null +++ b/examples/Choice.groovy @@ -0,0 +1,19 @@ +import gov.nasa.jpf.vm.Verify; + +//class Choice { + +// static void main(String[] args) { + while(true) { + int number = Verify.getInt(0, 10); + println number + //println "" + + //boolean choice = args[0].toBoolean() + boolean choice = Verify.getBoolean() + if (choice == true) + println "This time it is True" + else + println "This time it is False" + } + //} +//} diff --git a/examples/ClassLoaderTest.java b/examples/ClassLoaderTest.java new file mode 100644 index 0000000..1ac1791 --- /dev/null +++ b/examples/ClassLoaderTest.java @@ -0,0 +1,38 @@ +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.MethodVisitor; + +import java.util.Map; +import java.util.HashMap; +import java.lang.ClassLoader; + +public class ClassLoaderTest { + private void loadMagic() { + ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS); + cw.visit(Opcodes.V1_4, Opcodes.ACC_PUBLIC, "sun/reflect/GroovyMagic", null, "sun/reflect/MagicAccessorImpl", null); + MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "", "()V", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "sun/reflect/MagicAccessorImpl", "", "()V", false); + mv.visitInsn(RETURN); + mv.visitMaxs(0,0); + mv.visitEnd(); + cw.visitEnd(); + + define(cw.toByteArray(), "sun.reflect.GroovyMagic"); + } + + protected void define(byte[] bytes, final String name) { + //knownClasses.put(name, defineClass(name, bytes, 0, bytes.length)); + Class cls = defineClass(name, bytes, 0, bytes.length); + } + + protected final Map knownClasses = new HashMap(); + + public static void main(String[] args) { + + + ClassLoader cl = new ClassLoader(); + Class cls = defineClass(name, bytes, 0, bytes.length); + } +} diff --git a/examples/Permutation.groovy b/examples/Permutation.groovy new file mode 100644 index 0000000..0c5e2ab --- /dev/null +++ b/examples/Permutation.groovy @@ -0,0 +1,63 @@ +//import gov.nasa.jpf.vm.Verify + +//int count1 = Verify.getIntFromList(1,2,3) +//int count2 = Verify.getIntFromList(4,5,6) +//int count3 = Verify.getIntFromList(0) +//println "Count1: " + count1 +//println "Count2: " + count2 +//println "Count3: " + count3 + +/*def list = [[1,2,3], + [1,3,2], + [2,1,3], + [2,3,1], + [3,1,2], + [3,2,1]] +int count = Verify.getInt(0,5) + +list[count].each { + switch(it) { + case 1: + //appObject.setValue([name: "Touched", value: "Touched", deviceId: 0, descriptionText: "", + // displayed: true, linkText: "", isStateChange: false, unit: "", data: []]) + println "1"; + break; + case 2: + //lockObject.setValue([name: "lock0", value: "locked", deviceId: 0, descriptionText: "", + // displayed: true, linkText: "", isStateChange: false, unit: "", data: []]) + println " 2"; + break; + case 3: + //lockObject.setValue([name: "lock0", value: "unlocked", deviceId: 0, descriptionText: "", + // displayed: true, linkText: "", isStateChange: false, unit: "", data: []]) + println " 3"; + break; + default: + break; + } +}*/ + +def permuteHelper(nums, curr, list) { + if (curr == nums.size() - 1) { + list.add(nums) + } else { + for(int i=curr; i - - - - - - - - - - - - - - - diff --git a/examples/groovy-2.4.8/groovy/inspect/package.html b/examples/groovy-2.4.8/groovy/inspect/package.html deleted file mode 100644 index 6d80c2b..0000000 --- a/examples/groovy-2.4.8/groovy/inspect/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package groovy.inspect.* - - -

Classes for inspecting object properties through introspection.

- - diff --git a/examples/groovy-2.4.8/groovy/io/package.html b/examples/groovy-2.4.8/groovy/io/package.html deleted file mode 100644 index fef0d09..0000000 --- a/examples/groovy-2.4.8/groovy/io/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package groovy.io.* - - -

Classes for Groovier Input/Output.

- - diff --git a/examples/groovy-2.4.8/groovy/lang/package.html b/examples/groovy-2.4.8/groovy/lang/package.html deleted file mode 100644 index 1ea84fc..0000000 --- a/examples/groovy-2.4.8/groovy/lang/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package groovy.lang.* - - -

Core Groovy language classes for implementing data structures, closures, metadata and so forth.

- - diff --git a/examples/groovy-2.4.8/groovy/security/package.html b/examples/groovy-2.4.8/groovy/security/package.html deleted file mode 100644 index cb094ff..0000000 --- a/examples/groovy-2.4.8/groovy/security/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - package groovy.security.* - - -

- Security-related classes -

- - diff --git a/examples/groovy-2.4.8/groovy/time/package.html b/examples/groovy-2.4.8/groovy/time/package.html deleted file mode 100644 index 94fb458..0000000 --- a/examples/groovy-2.4.8/groovy/time/package.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - package groovy.time.* - - -

- Classes for easily manipulating Dates and times. While - java.util.Date has GDK methods for adding or subtracting days, - this is not so useful for different durations of time. - {@link groovy.time.TimeCategory TimeCategory} creates a simple internal DSL - for manipulating dates and times in a clean and precise fashion. -

-

Examples

-
-  use ( TimeCategory ) {
-  	// application on numbers:
-  	println 1.minute.from.now
-  	println 10.days.ago
-  
-  	// application on dates
-  	def someDate = new Date()
-  	println someDate - 3.months 
-  }
- - @see groovy.time.TimeCategory - - diff --git a/examples/groovy-2.4.8/groovy/util/package.html b/examples/groovy-2.4.8/groovy/util/package.html deleted file mode 100644 index e7a2c5a..0000000 --- a/examples/groovy-2.4.8/groovy/util/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package groovy.util.* - - -

Various Groovy utilities for working with nodes, builders, logging, JUnit test cases, text expressions, Ant tasks or JMX MBeans.

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/antlr/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/antlr/package.html deleted file mode 100644 index 0ecf3f6..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/antlr/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.antlr.* - - -

Parser related classes.

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/antlr/treewalker/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/antlr/treewalker/package.html deleted file mode 100644 index 9fca823..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/antlr/treewalker/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.antlr.treewalker.* - - -

Classes for walking the AST.

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/ast/expr/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/ast/expr/package.html deleted file mode 100644 index 806854e..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/ast/expr/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.ast.expr.* - - -

AST nodes for Groovy expressions

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/ast/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/ast/package.html deleted file mode 100644 index f8f132a..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/ast/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.ast.* - - -

Groovy AST nodes for the syntax of the language

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/ast/stmt/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/ast/stmt/package.html deleted file mode 100644 index 8226776..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/ast/stmt/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.ast.stmt.* - - -

AST nodes for Groovy statements

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/classgen/asm/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/classgen/asm/package.html deleted file mode 100644 index cd40f7e..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/classgen/asm/package.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - package org.codehaus.groovy.classgen.asm.* - - -

Helper classes for ASMClassGenerator. All classes in this package - are for internal usage only.

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/classgen/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/classgen/package.html deleted file mode 100644 index a72224a..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/classgen/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.classgen.* - - -

Generates Java classes for Groovy classes using ASM.

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/control/io/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/control/io/package.html deleted file mode 100644 index 9f92588..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/control/io/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.control.io.* - - -

Internal classes for Groovier Input/Output.

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/control/messages/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/control/messages/package.html deleted file mode 100644 index 412a4df..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/control/messages/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.control.messages.* - - -

Error message classes.

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/control/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/control/package.html deleted file mode 100644 index 4a9ec85..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/control/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.control.* - - -

Compiler control classes.

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/package.html deleted file mode 100644 index 1ff6757..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.* - - -

Groovy Language for the JVM

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/reflection/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/reflection/package.html deleted file mode 100644 index a01a2dd..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/reflection/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.reflection.* - - -

Internal classes for assisting with reflection.

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/runtime/metaclass/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/runtime/metaclass/package.html deleted file mode 100644 index f3e1fa3..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/runtime/metaclass/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.runtime.metaclass.* - - -

Internal classes related to Groovy's metaclass implementation.

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/runtime/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/runtime/package.html deleted file mode 100644 index c78595e..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/runtime/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.runtime.* - - -

Runtime classes for Groovy - whether the dynamic interpreter is being used, the compiler or the bytecode generator.

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/runtime/typehandling/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/runtime/typehandling/package.html deleted file mode 100644 index fab5318..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/runtime/typehandling/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - package org.codehaus.groovy.runtime.typehandling* - - -

Classes used to execute special actions based on the type. - This includes mathematical operations and wrapper classes. -

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/runtime/wrappers/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/runtime/wrappers/package.html deleted file mode 100644 index 652b123..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/runtime/wrappers/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.runtime.wrappers.* - - -

Groovy wrapper classes for primitive types.

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/syntax/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/syntax/package.html deleted file mode 100644 index 299d984..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/syntax/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.syntax.* - - -

Lexer, parser and trees.

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/tools/javac/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/tools/javac/package.html deleted file mode 100644 index 95b05a4..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/tools/javac/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.tools.javac.* - - -

Classes related to the joint compiler.

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/tools/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/tools/package.html deleted file mode 100644 index a45486b..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/tools/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - package org.codehaus.groovy.tools.* - - -

- Compiler entry points and miscellaneous development tools. -

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/tools/xml/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/tools/xml/package.html deleted file mode 100644 index a6fb0f8..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/tools/xml/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - package org.codehaus.groovy.tools.xml.* - - -

XML utilities such as for converting XML into Groovy scripts.

- - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/vmplugin/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/vmplugin/package.html deleted file mode 100644 index d7584ff..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/vmplugin/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - -

- JVM version specific classes. -

- - - diff --git a/examples/groovy-2.4.8/org/codehaus/groovy/vmplugin/v5/package.html b/examples/groovy-2.4.8/org/codehaus/groovy/vmplugin/v5/package.html deleted file mode 100644 index ae4d56a..0000000 --- a/examples/groovy-2.4.8/org/codehaus/groovy/vmplugin/v5/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - -

- Java 5 specific classes. -

- - - diff --git a/examples/groovy-2.4.8/overview.html b/examples/groovy-2.4.8/overview.html deleted file mode 100644 index 9738194..0000000 --- a/examples/groovy-2.4.8/overview.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - Groovy - An agile dynamic language for the Java Platform - - -

Groovy - An agile dynamic language for the Java Platform
(GroovyDoc for Groovy and Java classes)

- - Groovy... -
    -
  • is an agile and dynamic language for the Java Virtual Machine
  • -
  • builds upon the strengths of Java but has additional power features inspired by languages like Python, Ruby and Smalltalk
  • -
  • makes modern programming features available to Java developers with almost-zero learning curve
  • -
  • supports Domain-Specific Languages and other compact syntax so your code becomes easy to read and maintain
  • -
  • makes writing shell and build scripts easy with its powerful processing primitives, OO abilities and an Ant DSL
  • -
  • increases developer productivity by reducing scaffolding code when developing web, GUI, database or console applications
  • -
  • simplifies testing by supporting unit testing and mocking out-of-the-box
  • -
  • seamlessly integrates with all existing Java objects and libraries
  • -
  • compiles straight to Java bytecode so you can use it anywhere you can use Java
  • -
- - diff --git a/examples/groovy-2.4.8/overviewj.html b/examples/groovy-2.4.8/overviewj.html deleted file mode 100644 index d526e8b..0000000 --- a/examples/groovy-2.4.8/overviewj.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - Groovy - An agile dynamic language for the Java Platform - - -

Groovy - An agile dynamic language for the Java Platform
(JavaDoc for Java classes)

- - Groovy... -
    -
  • is an agile and dynamic language for the Java Virtual Machine
  • -
  • builds upon the strengths of Java but has additional power features inspired by languages like Python, Ruby and Smalltalk
  • -
  • makes modern programming features available to Java developers with almost-zero learning curve
  • -
  • supports Domain-Specific Languages and other compact syntax so your code becomes easy to read and maintain
  • -
  • makes writing shell and build scripts easy with its powerful processing primitives, OO abilities and an Ant DSL
  • -
  • increases developer productivity by reducing scaffolding code when developing web, GUI, database or console applications
  • -
  • simplifies testing by supporting unit testing and mocking out-of-the-box
  • -
  • seamlessly integrates with all existing Java objects and libraries
  • -
  • compiles straight to Java bytecode so you can use it anywhere you can use Java
  • -
- - diff --git a/main.jpf b/main.jpf new file mode 100644 index 0000000..85af65a --- /dev/null +++ b/main.jpf @@ -0,0 +1,19 @@ +target = main + +# This is the listener that can detect variable write-after-write conflicts +listener=gov.nasa.jpf.listener.VariableConflictTracker + +# Potentially conflicting variables +variables=currentAlarm,currentContact,doorState,currentLock,currentMotion,status,currentPresence,\ + currentSmokeValue,currentHeatingSetpoint,thermostatSetpoint,currentCoolingSetpoint,\ + thermostatOperatingState,thermostatFanMode,currentThermostatMode,currentSwitch,\ + currentAcceleration, currentBattery, currentPresence, currentCarbonMonoxideValue,\ + color, hue, saturation + +# Potentially conflicting apps (we default to App1 and App2 for now) +apps=App1,App2 + +# Tracking the location.mode variable conflict +#track_location_var_conflict=true + +#search.class = gov.nasa.jpf.search.heuristic.UserHeuristic