Skip to content

Commit

Permalink
Add some TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lipen committed Nov 26, 2020
1 parent 461b95a commit 29031bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions kotlin-satlib-jni/src/main/cpp/JCadical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ JNI_METHOD(void, cadical_1add_1assumption)
jsize array_length = env->GetArrayLength(literals);
CaDiCaL::Solver* solver = decode(p);

// TODO: use GetPrimitiveArrayCritical
jint* array = env->GetIntArrayElements(literals, 0);
for (int i = 0; i < array_length; i++) {
solver->assume(array[i]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package com.github.lipen.satlib.solver.jni
import com.github.lipen.satlib.utils.useWith
import java.io.File

@Suppress("FunctionName", "MemberVisibilityCanBePrivate", "unused")
@Suppress("FunctionName", "MemberVisibilityCanBePrivate")
class JCadical : AutoCloseable {
private var handle: Long = 0

Expand Down Expand Up @@ -153,6 +153,7 @@ class JCadical : AutoCloseable {
cadical_add_assumption(handle, literals)
}

// TODO: Return enum SolveResult
fun solve(): Boolean {
return when (val result = cadical_solve(handle)) {
0 -> false // UNSOLVED
Expand Down

0 comments on commit 29031bd

Please sign in to comment.