Skip to content

Commit

Permalink
take only distinct repairs
Browse files Browse the repository at this point in the history
  • Loading branch information
breandan committed Aug 7, 2023
1 parent 9dced7c commit 4ca3052
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
12 changes: 6 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ kotlin {
// TODO: Figure out how to package viz.js directly for Kotlin Jupyter
// https://github.com/mipt-npm/kmath/issues/449#issuecomment-1009660734
implementation("guru.nidi:graphviz-kotlin:0.18.1")
implementation("org.graalvm.js:js:23.0.0")
implementation("org.graalvm.js:js:23.0.1")

// Markovian deps
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")

implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:$kotlinxVersion") // TODO: why is this necessary?
implementation("org.jetbrains.lets-plot:lets-plot-kotlin-jvm:4.4.1")
Expand Down Expand Up @@ -175,7 +175,7 @@ kotlin {
implementation("io.kotest:kotest-runner-junit5:$kotestVersion")
implementation("io.kotest:kotest-assertions-core:$kotestVersion")
implementation("io.kotest:kotest-property:$kotestVersion")
implementation("org.junit.jupiter:junit-jupiter:5.10.0-RC1")
implementation("org.junit.jupiter:junit-jupiter:5.10.0")

implementation("junit:junit:4.13.2")
implementation("org.jetbrains:annotations:24.0.1")
Expand All @@ -198,12 +198,12 @@ kotlin {
implementation("org.jgrapht:jgrapht-opt:$jgraphtVersion")
implementation("org.jgrapht:jgrapht-ext:$jgraphtVersion")

val tinkerpopVersion by extra { "3.6.4" }
val tinkerpopVersion by extra { "3.7.0" }
implementation("org.apache.tinkerpop:gremlin-core:$tinkerpopVersion")
implementation("org.apache.tinkerpop:tinkergraph-gremlin:$tinkerpopVersion")
implementation("info.debatty:java-string-similarity:2.0.0")
implementation("org.eclipse.collections:eclipse-collections-api:12.0.0.M1")
implementation("org.eclipse.collections:eclipse-collections:12.0.0.M1")
implementation("org.eclipse.collections:eclipse-collections-api:12.0.0.M2")
implementation("org.eclipse.collections:eclipse-collections:12.0.0.M2")

implementation(kotlin("scripting-jsr223"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ val CFG.tmap: Map<Set<Σᐩ>, Set<Σᐩ>> by cache {
.mapValues { it.value.map { it.second }.toSet() }
}

// Maps each nonterminal to the set of nonterminals that can generate it
val CFG.vindex: Array<IntArray> by cache {
Array(bindex.indexedNTs.size) { i ->
bimap[bindex[i]].filter { it.size > 1 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ fun CFG.toBitVec(nts: Set<Σᐩ>): BooleanArray =
else BooleanArray(nonterminals.size) { false }
.also { if (1 == nts.size) it[bindex[nts.first()]] = true }

fun fastJoin(vindex: Array<IntArray>, left: BooleanArray, right: BooleanArray): BooleanArray {
fun fastJoin(/**[vindex]*/vidx: Array<IntArray>, left: BooleanArray, right: BooleanArray): BooleanArray {
if (left.isEmpty() || right.isEmpty()) return booleanArrayOf()

val result = BooleanArray(vindex.size)
for ((i, indexArray) in vindex.withIndex()) {
val result = BooleanArray(vidx.size)
for ((i, indexArray) in vidx.withIndex()) {
var j = 0
while (j < indexArray.size) {
if (left[indexArray[j]] && right[indexArray[j + 1]]) {
Expand Down

0 comments on commit 4ca3052

Please sign in to comment.