Skip to content

Commit

Permalink
Fix the order of the arguments in ReduceSet (#76)
Browse files Browse the repository at this point in the history
Fix the order of the arguments in ReduceSet
  • Loading branch information
konnov authored Aug 26, 2022
1 parent beb1b41 commit 9a76515
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/FiniteSetsExt.tla
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ReduceSet(op(_, _), set, acc) ==
(* An alias for FoldSet. ReduceSet was used instead of FoldSet in *)
(* earlier versions of the community modules. *)
(*************************************************************************)
FoldSet(op, set, acc)
FoldSet(op, acc, set)


FlattenSet(S) ==
Expand Down
3 changes: 2 additions & 1 deletion tests/FiniteSetsExtTests.tla
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ ASSUME FoldSet(LAMBDA x,y : x + y, 0, 0 .. 10) = 55

\* Without the corresponding Java module override, this overflows TLC's stack.
ASSUME FoldSet(LAMBDA x,y : x + y, 0, 0 .. 10000) = 50005000

-----------------------------------------------------------------------------

ASSUME ChooseUnique({2, 3, 4, 5}, LAMBDA x : x % 3 = 1) = 4
Expand Down Expand Up @@ -122,6 +121,8 @@ ASSUME SymDiff({2,3}, {2,3,4}) = {4}
ASSUME SumSet(1..3) = 6
ASSUME ProductSet(1..4) = 24

ASSUME ReduceSet(+, 1..5, 42) = 57

-----------------------------------------------------------------------------

(* TLC won't evaluate the assumes above if a there is no behavior *)
Expand Down

0 comments on commit 9a76515

Please sign in to comment.