From 91f74ce97d251cddbc63f5db3a712adf680627b1 Mon Sep 17 00:00:00 2001 From: David Pearce Date: Sun, 22 Dec 2024 09:38:39 +1300 Subject: [PATCH] feat: update shf test (#491) 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. --- pkg/test/valid_corset_test.go | 9 ++++----- testdata/shf.lisp | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pkg/test/valid_corset_test.go b/pkg/test/valid_corset_test.go index cf134a4..0970265 100644 --- a/pkg/test/valid_corset_test.go +++ b/pkg/test/valid_corset_test.go @@ -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") } diff --git a/testdata/shf.lisp b/testdata/shf.lisp index f79da9f..c41bf81 100644 --- a/testdata/shf.lisp +++ b/testdata/shf.lisp @@ -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) @@ -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)