我有一个非常简单的Z3程序示例如下:
final Spinner spinnerLessonDuration = (Spinner) findViewById(R.id.spinnerLessonDuration);
final ArrayAdapter<CharSequence> adapterLessonDuration = ArrayAdapter.createFromResource(this, R.array.lessonDuration, android.R.layout.simple_spinner_item);
adapterLessonDuration.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerLessonDuration.setAdapter(
new NothingSelectedSpinnerAdapter(
adapterLessonDuration,
R.layout.contact_spinner_row_nothing_selected_lesson_duration, this));
spinnerLessonDuration.setOnItemSelectedListener(new setOnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
System.out.println("2 " + spinnerLessonDuration.getSelectedItem());
if (spinnerLessonDuration.getSelectedItem() != null && "Other...".equals(spinnerLessonDuration.getSelectedItem().toString()))
{
View view1 = (LayoutInflater.from(MainActivity.this)).inflate(R.layout.user_input, null);
AlertDialog.Builder alertBuilder = new AlertDialog.Builder(MainActivity.this);
alertBuilder.setView(view1);
final EditText userInput = (EditText) view1.findViewById(R.id.userinput);
alertBuilder.setCancelable(true)
.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//EditText valueView = (EditText) view1.findViewById(R.id.license_value); //here
if (userInput == null) Log.d("AA", "NULL");
else {
String value = userInput.getText().toString();
Log.i(value, "1");
}
}
});
Dialog dialog = alertBuilder.create();
dialog.show();
}
}
}
);
此示例程序可以在Z3在线编译器中执行,没有任何问题。但是,当我想使用命令行提示符执行相同的程序时,使用以下命令:
(declare-const a Int)
(declare-fun f (Int Bool) Int)
(assert (> a 10))
(assert (< (f a true) 100))
(check-sat)
我收到错误说:
Z3 <script path>
并且对程序中的每一行重复此错误。 谁能帮我看看我做错了什么?
答案 0 :(得分:4)
您正在使用SMT2格式。呼叫
z3 -smt2 <script path>