From 3ba75ef701deb17a3871ca3b04d9596afac1c527 Mon Sep 17 00:00:00 2001 From: Andres Noetzli Date: Wed, 12 Feb 2020 14:48:10 -0800 Subject: [PATCH] Rename Java package to edu.stanford.CVC4 (#3752) --- NEWS | 7 +++++++ examples/SimpleVC.java | 2 +- examples/api/java/BitVectors.java | 2 +- examples/api/java/BitVectorsAndArrays.java | 4 ++-- examples/api/java/CVC4Streams.java | 2 +- examples/api/java/Combination.java | 2 +- examples/api/java/Datatypes.java | 2 +- examples/api/java/FloatingPointArith.java | 2 +- examples/api/java/HelloWorld.java | 2 +- examples/api/java/LinearArith.java | 2 +- examples/api/java/PipedInput.java | 2 +- examples/api/java/Statistics.java | 4 ++-- examples/api/java/Strings.java | 2 +- examples/api/java/UnsatCores.java | 2 +- src/bindings/java/CMakeLists.txt | 2 +- src/cvc4.i | 12 ++++++------ src/expr/expr.i | 6 +++--- src/expr/record.i | 2 +- src/proof/unsat_core.i | 6 +++--- src/smt/command.i | 6 +++--- src/smt/smt_engine.i | 4 ++-- 21 files changed, 41 insertions(+), 34 deletions(-) diff --git a/NEWS b/NEWS index d9e1f9076..b25f4517a 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,12 @@ This file contains a summary of important user-visible changes. +Changes since 1.7 +================= + +Changes: +* Java API change: The name of CVC4's package is now `edu.stanford.CVC4` + instead of `edu.nyu.acsys.CVC4`. + Changes since 1.6 ================= diff --git a/examples/SimpleVC.java b/examples/SimpleVC.java index c84b040a3..e77a5e99f 100644 --- a/examples/SimpleVC.java +++ b/examples/SimpleVC.java @@ -23,7 +23,7 @@ ** **/ -import edu.nyu.acsys.CVC4.*; +import edu.stanford.CVC4.*; public class SimpleVC { public static void main(String[] args) { diff --git a/examples/api/java/BitVectors.java b/examples/api/java/BitVectors.java index fec871357..17111b63a 100644 --- a/examples/api/java/BitVectors.java +++ b/examples/api/java/BitVectors.java @@ -14,7 +14,7 @@ ** **/ -import edu.nyu.acsys.CVC4.*; +import edu.stanford.CVC4.*; public class BitVectors { public static void main(String[] args) { diff --git a/examples/api/java/BitVectorsAndArrays.java b/examples/api/java/BitVectorsAndArrays.java index 11474d1e1..05232b8ab 100644 --- a/examples/api/java/BitVectorsAndArrays.java +++ b/examples/api/java/BitVectorsAndArrays.java @@ -14,7 +14,7 @@ ** **/ -import edu.nyu.acsys.CVC4.*; +import edu.stanford.CVC4.*; import java.util.*; public class BitVectorsAndArrays { @@ -71,7 +71,7 @@ public class BitVectorsAndArrays { vectorExpr assertions = new vectorExpr(); for (int i = 1; i < k; ++i) { - index = em.mkConst(new BitVector(index_size, new edu.nyu.acsys.CVC4.Integer(i))); + index = em.mkConst(new BitVector(index_size, new edu.stanford.CVC4.Integer(i))); Expr new_current = em.mkExpr(Kind.BITVECTOR_MULT, two, old_current); // current[i] = 2 * current[i-1] current_array = em.mkExpr(Kind.STORE, current_array, index, new_current); diff --git a/examples/api/java/CVC4Streams.java b/examples/api/java/CVC4Streams.java index 8e395b512..e09c1b6f7 100644 --- a/examples/api/java/CVC4Streams.java +++ b/examples/api/java/CVC4Streams.java @@ -15,7 +15,7 @@ **/ import java.io.*; -import edu.nyu.acsys.CVC4.*; +import edu.stanford.CVC4.*; public class CVC4Streams { public static void main(String[] args) throws IOException { diff --git a/examples/api/java/Combination.java b/examples/api/java/Combination.java index 6d34e16c4..0c9ca84d6 100644 --- a/examples/api/java/Combination.java +++ b/examples/api/java/Combination.java @@ -16,7 +16,7 @@ ** The model is displayed using getValue(). **/ -import edu.nyu.acsys.CVC4.*; +import edu.stanford.CVC4.*; public class Combination { private static void prefixPrintGetValue(SmtEngine smt, Expr e, int level) { diff --git a/examples/api/java/Datatypes.java b/examples/api/java/Datatypes.java index c5efe3d06..21f4a651e 100644 --- a/examples/api/java/Datatypes.java +++ b/examples/api/java/Datatypes.java @@ -14,7 +14,7 @@ ** An example of using inductive datatypes in CVC4 (Java version). **/ -import edu.nyu.acsys.CVC4.*; +import edu.stanford.CVC4.*; import java.util.Iterator; public class Datatypes { diff --git a/examples/api/java/FloatingPointArith.java b/examples/api/java/FloatingPointArith.java index fe2e3747e..9d2ceb1ae 100644 --- a/examples/api/java/FloatingPointArith.java +++ b/examples/api/java/FloatingPointArith.java @@ -18,7 +18,7 @@ ** IEEE 754-2008 bit-vector to a floating-point number. **/ -import edu.nyu.acsys.CVC4.*; +import edu.stanford.CVC4.*; import java.util.Iterator; public class FloatingPointArith { diff --git a/examples/api/java/HelloWorld.java b/examples/api/java/HelloWorld.java index 56acffa76..393ce40f0 100644 --- a/examples/api/java/HelloWorld.java +++ b/examples/api/java/HelloWorld.java @@ -20,7 +20,7 @@ ** A very simple CVC4 tutorial example. **/ -import edu.nyu.acsys.CVC4.*; +import edu.stanford.CVC4.*; public class HelloWorld { public static void main(String[] args) { diff --git a/examples/api/java/LinearArith.java b/examples/api/java/LinearArith.java index 368178155..2ddf92584 100644 --- a/examples/api/java/LinearArith.java +++ b/examples/api/java/LinearArith.java @@ -15,7 +15,7 @@ ** the push pop of CVC4. This also gives an example option. **/ -import edu.nyu.acsys.CVC4.*; +import edu.stanford.CVC4.*; public class LinearArith { public static void main(String[] args) { diff --git a/examples/api/java/PipedInput.java b/examples/api/java/PipedInput.java index 13883d033..0ab807e5d 100644 --- a/examples/api/java/PipedInput.java +++ b/examples/api/java/PipedInput.java @@ -16,7 +16,7 @@ ** used from Java. **/ -import edu.nyu.acsys.CVC4.*; +import edu.stanford.CVC4.*; import java.io.*; public class PipedInput { diff --git a/examples/api/java/Statistics.java b/examples/api/java/Statistics.java index 0dda91aee..8bf0effef 100644 --- a/examples/api/java/Statistics.java +++ b/examples/api/java/Statistics.java @@ -14,7 +14,7 @@ ** An example of accessing CVC4's statistics using the Java API. **/ -import edu.nyu.acsys.CVC4.*; +import edu.stanford.CVC4.*; import java.util.Iterator; public class Statistics { @@ -37,7 +37,7 @@ public class Statistics { // `Statistics` class implements the `Iterable` interface. A // `Statistic` is a pair that consists of a name and an `SExpr` that stores // the value of the statistic. - edu.nyu.acsys.CVC4.Statistics stats = smt.getStatistics(); + edu.stanford.CVC4.Statistics stats = smt.getStatistics(); for (Statistic stat : stats) { System.out.println(stat.getFirst() + " = " + stat.getSecond()); } diff --git a/examples/api/java/Strings.java b/examples/api/java/Strings.java index fe017980b..4a87c0a14 100644 --- a/examples/api/java/Strings.java +++ b/examples/api/java/Strings.java @@ -14,7 +14,7 @@ ** A simple demonstration of reasoning about strings with CVC4 via Jave API. **/ -import edu.nyu.acsys.CVC4.*; +import edu.stanford.CVC4.*; public class Strings { public static void main(String[] args) { diff --git a/examples/api/java/UnsatCores.java b/examples/api/java/UnsatCores.java index 65c01cf5a..6478aea5c 100644 --- a/examples/api/java/UnsatCores.java +++ b/examples/api/java/UnsatCores.java @@ -14,7 +14,7 @@ ** An example of interacting with unsat cores using CVC4's Java API. **/ -import edu.nyu.acsys.CVC4.*; +import edu.stanford.CVC4.*; import java.util.Iterator; public class UnsatCores { diff --git a/src/bindings/java/CMakeLists.txt b/src/bindings/java/CMakeLists.txt index 3ab2ed446..508a74532 100644 --- a/src/bindings/java/CMakeLists.txt +++ b/src/bindings/java/CMakeLists.txt @@ -6,7 +6,7 @@ include_directories(${JNI_INCLUDE_DIRS}) set(SWIG_MODULE_cvc4jni_EXTRA_DEPS cvc4 cvc4parser) set_property(SOURCE ${CVC4_SWIG_INTERFACE} PROPERTY CPLUSPLUS ON) -set(CMAKE_SWIG_FLAGS -package edu.nyu.acsys.CVC4) +set(CMAKE_SWIG_FLAGS -package edu.stanford.CVC4) if(${CMAKE_VERSION} VERSION_LESS "3.8.0") swig_add_module(cvc4jni Java ${CVC4_SWIG_INTERFACE}) diff --git a/src/cvc4.i b/src/cvc4.i index 69041b277..9e69212ae 100644 --- a/src/cvc4.i +++ b/src/cvc4.i @@ -113,7 +113,7 @@ std::set CVC4::JavaInputStreamAdapter::s_adapters; // Create a mapping from C++ Exceptions to Java Exceptions. // This is in a couple of throws typemaps, simply because it's sensitive to SWIG's concept of which namespace we're in. %typemap(throws) Exception %{ - std::string name = "edu/nyu/acsys/CVC4/$1_type"; + std::string name = "edu/stanford/CVC4/$1_type"; /* size_t i = name.find("::"); if(i != std::string::npos) { @@ -132,7 +132,7 @@ std::set CVC4::JavaInputStreamAdapter::s_adapters; assert(status == 0); %} %typemap(throws) CVC4::Exception %{ - std::string name = "edu/nyu/acsys/$1_type"; + std::string name = "edu/stanford/$1_type"; size_t i = name.find("::"); if(i != std::string::npos) { size_t j = name.rfind("::"); @@ -186,17 +186,17 @@ std::set CVC4::JavaInputStreamAdapter::s_adapters; %typemap(jtype) std::ostream& "long" %typemap(jstype) std::ostream& "java.io.OutputStream" %typemap(javain, - pre=" edu.nyu.acsys.CVC4.JavaOutputStreamAdapter temp$javainput = new edu.nyu.acsys.CVC4.JavaOutputStreamAdapter();", pgcppname="temp$javainput", + pre=" edu.stanford.CVC4.JavaOutputStreamAdapter temp$javainput = new edu.stanford.CVC4.JavaOutputStreamAdapter();", pgcppname="temp$javainput", post=" new java.io.PrintStream($javainput).print(temp$javainput.toString());") - std::ostream& "edu.nyu.acsys.CVC4.JavaOutputStreamAdapter.getCPtr(temp$javainput)" + std::ostream& "edu.stanford.CVC4.JavaOutputStreamAdapter.getCPtr(temp$javainput)" %typemap(jni) std::istream& "jlong" %typemap(jtype) std::istream& "long" %typemap(jstype) std::istream& "java.io.InputStream" %typemap(javain, - pre=" edu.nyu.acsys.CVC4.JavaInputStreamAdapter temp$javainput = edu.nyu.acsys.CVC4.JavaInputStreamAdapter.get($javainput);", pgcppname="temp$javainput", + pre=" edu.stanford.CVC4.JavaInputStreamAdapter temp$javainput = edu.stanford.CVC4.JavaInputStreamAdapter.get($javainput);", pgcppname="temp$javainput", post="") - std::istream& "edu.nyu.acsys.CVC4.JavaInputStreamAdapter.getCPtr(temp$javainput)" + std::istream& "edu.stanford.CVC4.JavaInputStreamAdapter.getCPtr(temp$javainput)" %typemap(in) jobject inputStream %{ $1 = jenv->NewGlobalRef($input); %} diff --git a/src/expr/expr.i b/src/expr/expr.i index fba1e8858..14ccf213c 100644 --- a/src/expr/expr.i +++ b/src/expr/expr.i @@ -99,18 +99,18 @@ namespace CVC4 { } // Expr is "iterable" on the Java side -%typemap(javainterfaces) CVC4::Expr "java.lang.Iterable"; +%typemap(javainterfaces) CVC4::Expr "java.lang.Iterable"; // the JavaIteratorAdapter should not be public, and implements Iterator %typemap(javaclassmodifiers) CVC4::JavaIteratorAdapter "class"; -%typemap(javainterfaces) CVC4::JavaIteratorAdapter "java.util.Iterator"; +%typemap(javainterfaces) CVC4::JavaIteratorAdapter "java.util.Iterator"; // add some functions to the Java side (do it here because there's no way to do these in C++) %typemap(javacode) CVC4::JavaIteratorAdapter " public void remove() { throw new java.lang.UnsupportedOperationException(); } - public edu.nyu.acsys.CVC4.Expr next() { + public edu.stanford.CVC4.Expr next() { if(hasNext()) { return getNext(); } else { diff --git a/src/expr/record.i b/src/expr/record.i index 6133114cd..dce785ea3 100644 --- a/src/expr/record.i +++ b/src/expr/record.i @@ -35,7 +35,7 @@ %typemap(out) std::pair { $result = jenv->NewObjectArray(2, jenv->FindClass("java/lang/Object"), $null); jenv->SetObjectArrayElement($result, 0, jenv->NewStringUTF($1.first.c_str())); - jclass clazz = jenv->FindClass("edu/nyu/acsys/CVC4/Type"); + jclass clazz = jenv->FindClass("edu/stanford/CVC4/Type"); jmethodID methodid = jenv->GetMethodID(clazz, "", "(JZ)V"); jenv->SetObjectArrayElement($result, 1, jenv->NewObject(clazz, methodid, reinterpret_cast(new CVC4::Type($1.second)), true)); }; diff --git a/src/proof/unsat_core.i b/src/proof/unsat_core.i index d3fd615ce..c37c8551d 100644 --- a/src/proof/unsat_core.i +++ b/src/proof/unsat_core.i @@ -35,18 +35,18 @@ } // UnsatCore is "iterable" on the Java side -%typemap(javainterfaces) CVC4::UnsatCore "java.lang.Iterable"; +%typemap(javainterfaces) CVC4::UnsatCore "java.lang.Iterable"; // the JavaIteratorAdapter should not be public, and implements Iterator %typemap(javaclassmodifiers) CVC4::JavaIteratorAdapter "class"; -%typemap(javainterfaces) CVC4::JavaIteratorAdapter "java.util.Iterator"; +%typemap(javainterfaces) CVC4::JavaIteratorAdapter "java.util.Iterator"; // add some functions to the Java side (do it here because there's no way to do these in C++) %typemap(javacode) CVC4::JavaIteratorAdapter " public void remove() { throw new java.lang.UnsupportedOperationException(); } - public edu.nyu.acsys.CVC4.Expr next() { + public edu.stanford.CVC4.Expr next() { if(hasNext()) { return getNext(); } else { diff --git a/src/smt/command.i b/src/smt/command.i index ff8094165..bd28fa8e5 100644 --- a/src/smt/command.i +++ b/src/smt/command.i @@ -36,18 +36,18 @@ } // CommandSequence is "iterable" on the Java side -%typemap(javainterfaces) CVC4::CommandSequence "java.lang.Iterable"; +%typemap(javainterfaces) CVC4::CommandSequence "java.lang.Iterable"; // the JavaIteratorAdapter should not be public, and implements Iterator %typemap(javaclassmodifiers) CVC4::JavaIteratorAdapter "class"; -%typemap(javainterfaces) CVC4::JavaIteratorAdapter "java.util.Iterator"; +%typemap(javainterfaces) CVC4::JavaIteratorAdapter "java.util.Iterator"; // add some functions to the Java side (do it here because there's no way to do these in C++) %typemap(javacode) CVC4::JavaIteratorAdapter " public void remove() { throw new java.lang.UnsupportedOperationException(); } - public edu.nyu.acsys.CVC4.Command next() { + public edu.stanford.CVC4.Command next() { if(hasNext()) { return getNext(); } else { diff --git a/src/smt/smt_engine.i b/src/smt/smt_engine.i index 4018cc3dc..635e593bb 100644 --- a/src/smt/smt_engine.i +++ b/src/smt/smt_engine.i @@ -14,13 +14,13 @@ %native (dlRef) void SmtEngine::dlRef(jobject); %{ extern "C" { -SWIGEXPORT jobject JNICALL Java_edu_nyu_acsys_CVC4_SmtEngine_mkRef(JNIEnv* jenv, jclass jcls, jobject o) { +SWIGEXPORT jobject JNICALL Java_edu_stanford_CVC4_SmtEngine_mkRef(JNIEnv* jenv, jclass jcls, jobject o) { if(o == NULL) { return NULL; } return jenv->NewGlobalRef(o); } -SWIGEXPORT void JNICALL Java_edu_nyu_acsys_CVC4_SmtEngine_dlRef(JNIEnv* jenv, jclass jcls, jobject o) { +SWIGEXPORT void JNICALL Java_edu_stanford_CVC4_SmtEngine_dlRef(JNIEnv* jenv, jclass jcls, jobject o) { if(o != NULL) { jenv->DeleteGlobalRef(o); } -- 2.30.2