All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.io.ksmt.solver.cvc5.KCvc5Maps.kt Maven / Gradle / Ivy

The newest version!
package io.ksmt.solver.cvc5

import io.github.cvc5.Sort
import io.github.cvc5.Term
import it.unimi.dsi.fastutil.Hash
import it.unimi.dsi.fastutil.HashCommon
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap
import java.util.TreeMap

class KCvc5TermMap(
    private val data: MutableMap = Object2ObjectOpenCustomHashMap(KCvc5TermHash)
) : MutableMap by data

class KCvc5SortMap(
    private val data: MutableMap = TreeMap()
) : MutableMap by data

private object KCvc5TermHash : Hash.Strategy {
    override fun equals(p0: Term?, p1: Term?): Boolean =
        p0 == p1

    override fun hashCode(p0: Term?): Int {
        if (p0 == null) return 0
        return HashCommon.long2int(p0.id)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy