You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some operators like getOnlyElement and foldr are not supported by Apalache. However, they can be easily defined in Quint itself. The reason they are built-ins is to provide better performance and error messages.
q::debug also is not supported. We could add support it on the Apalache side, but it just seems more scalable in terms of maintainability to add a def like this on Quint:
pure def q::debug(s, a)= a
I hacked a first version with these:
constbuiltInDefs=[`pure def reverse(l: List[a]): List[a] = { pure val len = l.length() l.indices().fold(l, (acc, i) => acc.replaceAt(i, l[len - i - 1])) }`,`pure def foldr(l: List[a], init: b, op: (a, b) => b): b = { l.reverse().foldl(init, (acc, e) => op(e, acc)) }`,`pure def getOnlyElement(s: Set[a]): a = { pure val hack = s.map(e => ("value", e)).setToMap() if (s.size() != 1) { hack.get("error: expected singleton") } else { hack.get("value") } }`,`pure def allListsUpTo(s, l) = { 1.to(l).fold(Set([]), (acc, i) => { pure val kms = 0.to(i - 1).setOfMaps(s) pure val lists = kms.map(km => range(0, i).foldl([], (acc, i) => acc.append(km.get(i)))) acc.union(lists) }) }`,`pure def q::debug(s, a) = a`,]
But we should probably have this in a standard library (see #1314).
We also want unwrap() included like this (but this one was not even added to the spells yet)
The text was updated successfully, but these errors were encountered:
Some operators like
getOnlyElement
andfoldr
are not supported by Apalache. However, they can be easily defined in Quint itself. The reason they are built-ins is to provide better performance and error messages.q::debug
also is not supported. We could add support it on the Apalache side, but it just seems more scalable in terms of maintainability to add a def like this on Quint:I hacked a first version with these:
But we should probably have this in a standard library (see #1314).
We also want
unwrap()
included like this (but this one was not even added to the spells yet)The text was updated successfully, but these errors were encountered: