KArrayStoreBase

sealed class KArrayStoreBase<A : KArraySortBase<R>, R : KSort> : KApp<A, KSort>

Base expression for various array store expressions with interpreted indices cache support.

Array store indices caches allows faster array select simplification in a case when many stored indices are interpreted values. By default, caches are ENABLED when simplifications are enabled in KContext.

Array store caches memory impact. In a case when we have long chains of array stores with interpreted values memory usage may become significant. We expect the maximum memory usage overhead to be about 1.4 * #array dimensions per store expression. For example, in a case of two dimensional arrays, if we denote normal array store expression memory usage as M the caches will use at most 1.4 * 2 * M of additional memory.

Manual control of array store caches. Since the memory usage overhead can become huge in some scenarios, it is possible to manually manage caching.

  1. Disable array store cache initialization by default. By default, cache initialization is performed in KContext.mkArrayStoreNoSimplify after expression creation. To disable cache initialization, you can override KContext.mkArrayStoreNoSimplify and invoke KContext.mkArrayStoreNoSimplifyNoAnalyze directly.

  2. Manually enable caching for some array store expressions. To initialize cache you can invoke KArrayStoreBase.analyzeStore anytime.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun accept(transformer: KTransformerBase): KExpr<A>
Link copied to clipboard

Analyze store to provide faster index lookups when store indices are interpreted values.

Link copied to clipboard
fun decl(): KDecl<A>
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
abstract fun findArrayToSelectFrom(indices: List<KExpr<*>>): KExpr<A>

Find an array expression containing the value for the provided indices.

Link copied to clipboard
abstract fun getIndex(idx: Int): KExpr<*>
Link copied to clipboard
abstract fun getNumIndices(): Int
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun internEquals(other: Any): Boolean

Any.equals analogue for interning purposes.

Link copied to clipboard
open override fun internHashCode(): Int

Any.hashCode analogue for interning purposes.

Link copied to clipboard
open override fun print(printer: ExpressionPrinter)
open override fun print(builder: StringBuilder)
Link copied to clipboard
fun searchForIndex(index: KExpr<*>, indexKind: Int): KExpr<A>
Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
open override val args: List<KExpr<KSort>>
Link copied to clipboard
val array: KExpr<A>
Link copied to clipboard
Link copied to clipboard
abstract val decl: KDecl<A>
Link copied to clipboard
abstract val indices: List<KExpr<KSort>>
Link copied to clipboard
open override val sort: A
Link copied to clipboard
val value: KExpr<R>

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
fun <T : KSort> KExpr<*>.asExpr(sort: T): KExpr<T>
Link copied to clipboard
Link copied to clipboard