-
Notifications
You must be signed in to change notification settings - Fork 3
/
hooks_kequal.go
34 lines (26 loc) · 956 Bytes
/
hooks_kequal.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// File provided by the K Framework Go backend. Timestamp: 2019-06-25 00:00:28.701
package ieletestinginterpreter
import (
m "github.com/ElrondNetwork/elrond-vm/iele/elrond/standalone/iele-testing-kompiled/ieletestingmodel"
)
type kequalHooksType int
const kequalHooks kequalHooksType = 0
// equals
func (kequalHooksType) eq(c1 m.K, c2 m.K, lbl m.KLabel, sort m.Sort, config m.K, interpreter *Interpreter) (m.K, error) {
return m.ToBool(interpreter.Model.Equals(c1, c2)), nil
}
// not equals
func (kequalHooksType) ne(c1 m.K, c2 m.K, lbl m.KLabel, sort m.Sort, config m.K, interpreter *Interpreter) (m.K, error) {
return m.ToBool(!interpreter.Model.Equals(c1, c2)), nil
}
// kbool ? k1 : k2
func (kequalHooksType) ite(kbool m.K, k1 m.K, k2 m.K, lbl m.KLabel, sort m.Sort, config m.K, interpreter *Interpreter) (m.K, error) {
b, ok := kbool.(*m.Bool)
if !ok {
return invalidArgsResult()
}
if b.Value {
return k1, nil
}
return k2, nil
}