Skip to content

Commit

Permalink
feat: update shf test (#491)
Browse files Browse the repository at this point in the history
Update shf test

This updates the shf test itself, rather than changing the go-corset
implementation.  This is because, at this time, it seems like the more
sensible option.  However, we may need to revisit this in the future if
it ends up forcing lots of changes in the full constraint set.
  • Loading branch information
DavePearce authored Dec 21, 2024
1 parent d348753 commit 91f74ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions pkg/test/valid_corset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -805,11 +805,10 @@ func TestSlow_Mxp(t *testing.T) {
Check(t, true, "mxp")
}

/*
func TestSlow_Shf(t *testing.T) {
Check(t, true, "shf")
}
*/
func TestSlow_Shf(t *testing.T) {
Check(t, true, "shf")
}

func TestSlow_Euc(t *testing.T) {
Check(t, true, "euc")
}
Expand Down
4 changes: 2 additions & 2 deletions testdata/shf.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
;; 2.5 shifting constraints ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun (left-shift-by k ct bit_b bit_n B1_init B2_init B1_shft B2_shft)
(defun (left-shift-by k ct bit_b (bit_n :binary) B1_init B2_init B1_shft B2_shft)
(begin (plateau-constraint ct bit_n (- LLARGE k))
(if-zero bit_b
(begin (= B1_shft B1_init)
Expand All @@ -278,7 +278,7 @@
(shift B2_init (- k LLARGE)))
(vanishes! B2_shft))))))

(defun (right-shift-by k ct neg inst bit_b bit_n B1_init B2_init B1_shft B2_shft)
(defun (right-shift-by k ct neg inst bit_b (bit_n :binary) B1_init B2_init B1_shft B2_shft)
(begin (plateau-constraint ct bit_n k)
(if-zero bit_b
(begin (= B1_shft B1_init)
Expand Down

0 comments on commit 91f74ce

Please sign in to comment.