Skip to content

Commit c92b6bc

Browse files
Rename bvumod to bvurem, matching the smt-lib function (#890) (#897)
Signed-off-by: John Kastner <jkastner@amazon.com> Signed-off-by: Katherine Hough <kmhough@amazon.com> Co-authored-by: John Kastner <130772734+john-h-kastner-aws@users.noreply.github.com>
1 parent dff9414 commit c92b6bc

File tree

16 files changed

+40
-40
lines changed

16 files changed

+40
-40
lines changed

cedar-lean-ffi/protobuf_schema/Messages.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ message Op {
145145
Bvudiv = 10;
146146
Bvsrem = 11;
147147
Bvsmod = 12;
148-
Bvumod = 13;
148+
Bvurem = 13;
149149
Bvshl = 14;
150150
Bvlshr = 15;
151151
Bvslt = 16;

cedar-lean-ffi/src/datatypes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ pub enum Op {
283283
Bvudiv,
284284
Bvsrem,
285285
Bvsmod,
286-
Bvumod,
286+
Bvurem,
287287
Bvshl,
288288
Bvlshr,
289289
Bvslt,
@@ -611,7 +611,7 @@ impl TryFrom<Op> for cedar_policy_symcc::op::Op {
611611
Op::Bvudiv => Self::Bvudiv,
612612
Op::Bvsrem => Self::Bvsrem,
613613
Op::Bvsmod => Self::Bvsmod,
614-
Op::Bvumod => Self::Bvumod,
614+
Op::Bvurem => Self::Bvurem,
615615
Op::Bvshl => Self::Bvshl,
616616
Op::Bvlshr => Self::Bvlshr,
617617
Op::Bvslt => Self::Bvslt,
@@ -941,7 +941,7 @@ impl From<cedar_policy_symcc::op::Op> for Op {
941941
cedar_policy_symcc::op::Op::Bvudiv => Self::Bvudiv,
942942
cedar_policy_symcc::op::Op::Bvule => Self::Bvule,
943943
cedar_policy_symcc::op::Op::Bvult => Self::Bvult,
944-
cedar_policy_symcc::op::Op::Bvumod => Self::Bvumod,
944+
cedar_policy_symcc::op::Op::Bvurem => Self::Bvurem,
945945
cedar_policy_symcc::op::Op::Uuf(uuf) => Self::Uuf(Arc::unwrap_or_clone(uuf).into()),
946946
cedar_policy_symcc::op::Op::OptionGet => Self::OptionGet,
947947
cedar_policy_symcc::op::Op::RecordGet(a) => Self::RecordGet(a),

cedar-lean-ffi/src/messages.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ impl proto::op::BaseOp {
311311
datatypes::Op::Bvudiv => proto::op::BaseOp::Bvudiv,
312312
datatypes::Op::Bvsrem => proto::op::BaseOp::Bvsrem,
313313
datatypes::Op::Bvsmod => proto::op::BaseOp::Bvsmod,
314-
datatypes::Op::Bvumod => proto::op::BaseOp::Bvumod,
314+
datatypes::Op::Bvurem => proto::op::BaseOp::Bvurem,
315315
datatypes::Op::Bvshl => proto::op::BaseOp::Bvshl,
316316
datatypes::Op::Bvlshr => proto::op::BaseOp::Bvlshr,
317317
datatypes::Op::Bvslt => proto::op::BaseOp::Bvslt,

cedar-lean/Cedar/SymCC/Factory.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def bvsdiv := bvapp .bvsdiv BitVec.smtSDiv
167167
def bvudiv := bvapp .bvudiv BitVec.smtUDiv
168168
def bvsrem := bvapp .bvsrem BitVec.srem
169169
def bvsmod := bvapp .bvsmod BitVec.smod
170-
def bvumod := bvapp .bvumod BitVec.umod
170+
def bvurem := bvapp .bvurem BitVec.umod
171171

172172
def bvshl := bvapp .bvshl (λ b₁ b₂ => b₁ <<< b₂)
173173
def bvlshr := bvapp .bvlshr (λ b₁ b₂ => b₁ >>> b₂)

cedar-lean/Cedar/SymCC/Interpretation.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def Op.interpret (I : Interpretation) (op : Op) (ts : List Term) (ty : TermType)
108108
| .bvsdiv, [t₁, t₂] => Factory.bvsdiv t₁ t₂
109109
| .bvsrem, [t₁, t₂] => Factory.bvsrem t₁ t₂
110110
| .bvsmod, [t₁, t₂] => Factory.bvsmod t₁ t₂
111-
| .bvumod, [t₁, t₂] => Factory.bvumod t₁ t₂
111+
| .bvurem, [t₁, t₂] => Factory.bvurem t₁ t₂
112112
| .bvudiv, [t₁, t₂] => Factory.bvudiv t₁ t₂
113113
| .bvshl, [t₁, t₂] => Factory.bvshl t₁ t₂
114114
| .bvlshr, [t₁, t₂] => Factory.bvlshr t₁ t₂

cedar-lean/Cedar/SymCC/Op.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ inductive Op : Type where
7474
| bvudiv -- unsigned bit-vector division
7575
| bvsrem -- signed remainder (remainder of division rounded towards zero) (copies sign from dividend)
7676
| bvsmod -- signed modulus (remainder of division rounded towards negative infinity) (copies sign from divisor)
77-
| bvumod -- unsigned modulus
77+
| bvurem -- unsigned modulus
7878
| bvshl
7979
| bvlshr
8080
| bvslt
@@ -148,7 +148,7 @@ def Op.mkName : Op → String
148148
| .bvudiv => "bvudiv"
149149
| .bvsrem => "bvsrem"
150150
| .bvsmod => "bvsmod"
151-
| .bvumod => "bvurem"
151+
| .bvurem => "bvurem"
152152
| .bvshl => "bvshl"
153153
| .bvlshr => "bvlshr"
154154
| .bvslt => "bvslt"

cedar-lean/Cedar/Thm/SymCC/Data/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,10 @@ inductive Op.WellTyped (εs : SymEntities) : Op → List Term → TermType → P
392392
(h₁ : t₁.typeOf = .bitvec n)
393393
(h₂ : t₂.typeOf = .bitvec n) :
394394
WellTyped εs .bvsmod [t₁, t₂] (.bitvec n)
395-
| bvumod_wt {t₁ t₂ : Term} {n : Nat}
395+
| bvurem_wt {t₁ t₂ : Term} {n : Nat}
396396
(h₁ : t₁.typeOf = .bitvec n)
397397
(h₂ : t₂.typeOf = .bitvec n) :
398-
WellTyped εs .bvumod [t₁, t₂] (.bitvec n)
398+
WellTyped εs .bvurem [t₁, t₂] (.bitvec n)
399399
| bvshl_wt {t₁ t₂ : Term} {n : Nat}
400400
(h₁ : t₁.typeOf = .bitvec n)
401401
(h₂ : t₂.typeOf = .bitvec n) :

cedar-lean/Cedar/Thm/SymCC/Env/WF.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ theorem wt_op_same_domain {εs₁ εs₂ : SymEntities} {op : Op} {ts : List Ter
420420
case bvudiv_wt h h' => exact Op.WellTyped.bvudiv_wt h h'
421421
case bvsrem_wt h h' => exact Op.WellTyped.bvsrem_wt h h'
422422
case bvsmod_wt h h' => exact Op.WellTyped.bvsmod_wt h h'
423-
case bvumod_wt h h' => exact Op.WellTyped.bvumod_wt h h'
423+
case bvurem_wt h h' => exact Op.WellTyped.bvurem_wt h h'
424424
case bvshl_wt h h' => exact Op.WellTyped.bvshl_wt h h'
425425
case bvlshr_wt h h' => exact Op.WellTyped.bvlshr_wt h h'
426426
case bvsaddo_wt h h' => exact Op.WellTyped.bvsaddo_wt h h'

cedar-lean/Cedar/Thm/SymCC/Term/Interpret/Basic.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ theorem interpret_term_app_bvsmod {I : Interpretation} {t₁ t₂ : Term} {ty :
149149
Factory.bvsmod (t₁.interpret I) (t₂.interpret I)
150150
:= by simp_interpret_term_app
151151

152-
theorem interpret_term_app_bvumod {I : Interpretation} {t₁ t₂ : Term} {ty : TermType} :
153-
(Term.app .bvumod [t₁, t₂] ty).interpret I =
154-
Factory.bvumod (t₁.interpret I) (t₂.interpret I)
152+
theorem interpret_term_app_bvurem {I : Interpretation} {t₁ t₂ : Term} {ty : TermType} :
153+
(Term.app .bvurem [t₁, t₂] ty).interpret I =
154+
Factory.bvurem (t₁.interpret I) (t₂.interpret I)
155155
:= by simp_interpret_term_app
156156

157157
theorem interpret_term_app_bvshl {I : Interpretation} {t₁ t₂ : Term} {ty : TermType} :

cedar-lean/Cedar/Thm/SymCC/Term/Interpret/Factory.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -723,9 +723,9 @@ theorem interpret_bvsmod {I : Interpretation} {t₁ t₂ : Term} :
723723
(Factory.bvsmod t₁ t₂).interpret I = Factory.bvsmod (t₁.interpret I) (t₂.interpret I)
724724
:= by show_interpret_bvop bvsmod bvapp interpret_term_app_bvsmod
725725

726-
theorem interpret_bvumod {I : Interpretation} {t₁ t₂ : Term} :
727-
(Factory.bvumod t₁ t₂).interpret I = Factory.bvumod (t₁.interpret I) (t₂.interpret I)
728-
:= by show_interpret_bvop bvumod bvapp interpret_term_app_bvumod
726+
theorem interpret_bvurem {I : Interpretation} {t₁ t₂ : Term} :
727+
(Factory.bvurem t₁ t₂).interpret I = Factory.bvurem (t₁.interpret I) (t₂.interpret I)
728+
:= by show_interpret_bvop bvurem bvapp interpret_term_app_bvurem
729729

730730
theorem interpret_bvshl {I : Interpretation} {t₁ t₂ : Term} :
731731
(Factory.bvshl t₁ t₂).interpret I = Factory.bvshl (t₁.interpret I) (t₂.interpret I)

0 commit comments

Comments
 (0)