Skip to content

Commit f7a795a

Browse files
committed
unroll constants test
1 parent d0d891a commit f7a795a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

logic/unroll.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func (u *Unroll) At(m z.Lit, d int) z.Lit {
6464
} else {
6565
res = u.C.F
6666
}
67+
u.dmap[v] = append(u.dmap[v], res)
6768
goto Done
6869
}
6970
n = u.S.nodes[v]

logic/unroll_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ func TestUnrollLatch(t *testing.T) {
3636
u.At(m, 3)
3737
}
3838

39+
func TestUnrollConst(t *testing.T) {
40+
s := logic.NewS()
41+
m := s.Latch(s.F)
42+
s.SetNext(m, m.Not())
43+
u := logic.NewUnroll(s)
44+
if u.At(s.T, 24) != u.C.T {
45+
t.Errorf("unroll T")
46+
}
47+
if u.At(s.F, 13) != u.C.F {
48+
t.Errorf("unroll F: %s", u.At(s.F, 13))
49+
}
50+
}
51+
3952
func TestUnrollCnfSince(t *testing.T) {
4053
s := logic.NewS()
4154
m := s.Latch(s.F)

0 commit comments

Comments
 (0)