Skip to content

Commit

Permalink
consolidate criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
breandan committed Apr 14, 2024
1 parent 7e4ff07 commit 127e3c8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private fun CFG.jvmIntersectLevFSAP(fsa: FSA, parikhMap: ParikhMap): CFG {

val ct = (fsa.validPairs * nonterminals.indices.toSet()).toList()
val ct2 = Array(fsa.states.size) { Array(nonterminals.size) { Array(fsa.states.size) { false } } }
ct.filter { fsa.obeys(it.π1, it.π2, it.π3, parikhMap) }
ct.filter { lengthBoundsCache[it.π3].overlaps(fsa.SPLP(it.π1, it.π2)) && fsa.obeys(it.π1, it.π2, it.π3, parikhMap) }
.forEach { ct2[it.π11][it.π3][it.π21] = true }

val elimCounter = AtomicInteger(0)
Expand Down Expand Up @@ -242,7 +242,7 @@ tailrec fun CFG.jvmElimVarUnitProds(
fun CFG.jvmDropVestigialProductions(clock: TimeSource.Monotonic.ValueTimeMark): CFG {
val start = clock.elapsedNow()
val counter = AtomicInteger(0)
val nts: Set<Σᐩ> = ConcurrentSkipListSet<Σᐩ>().also { set -> asSequence().asStream().parallel().forEach { set.add(it.first) } }
val nts: Set<Σᐩ> = asSequence().asStream().parallel().map { it.first }.collect(Collectors.toSet())
val rw = asSequence().asStream().parallel()
.filter { prod ->
if (counter.incrementAndGet() % 10 == 0 && BH_TIMEOUT < clock.elapsedNow()) throw Exception("Timeout!")
Expand Down

0 comments on commit 127e3c8

Please sign in to comment.