]> gitweb.factorcode.org Git - factor.git/commitdiff
sequences: more use of minimum/maximum
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 23 Oct 2023 17:44:31 +0000 (10:44 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 23 Oct 2023 17:44:31 +0000 (10:44 -0700)
33 files changed:
basis/base64/base64.factor
basis/compiler/codegen/gc-maps/gc-maps.factor
basis/compiler/tree/propagation/transforms/transforms.factor
basis/compression/gzip/gzip.factor
basis/io/backend/unix/multiplexers/select/select.factor
basis/math/matrices/matrices.factor
basis/sequences/windowed/windowed-tests.factor
basis/sequences/windowed/windowed.factor
basis/stack-checker/branches/branches.factor
basis/tools/memory/memory.factor
core/combinators/combinators.factor
core/generic/single/single.factor
core/sequences/sequences-docs.factor
core/sequences/sequences-tests.factor
extra/benchmark/benchmark.factor
extra/compiler/cfg/gvn/avail/avail.factor
extra/crontab/crontab.factor
extra/google/charts/charts.factor
extra/math/distances/distances.factor
extra/math/extras/extras-docs.factor
extra/math/extras/extras.factor
extra/pdf/layout/layout.factor
extra/picomath/picomath-tests.factor
extra/poker/poker.factor
extra/project-euler/003/003.factor
extra/project-euler/011/011.factor
extra/project-euler/026/026.factor
extra/project-euler/027/027.factor
extra/project-euler/038/038.factor
extra/project-euler/042/042.factor
extra/project-euler/265/265.factor
extra/reports/noise/noise.factor
extra/tetris/tetromino/tetromino.factor

index fb0c4609852af66db2a37f55ad2269151a0de6d5..abd7023bb3935842145c1ea1001d12bede25758a 100644 (file)
@@ -17,7 +17,7 @@ CONSTANT: alphabet $[
 ]
 
 : alphabet-inverse ( alphabet -- seq )
-    dup supremum 1 + f <array> [
+    dup maximum 1 + f <array> [
         '[ swap _ set-nth ] each-index
     ] keep ;
 >>
index abfe6fa6edfb26225ea3c59ade1acbcfabff666d..6e278dfe9208667171358bd74aed2ebb89a42538 100644 (file)
@@ -20,7 +20,7 @@ SYMBOLS: return-addresses gc-maps ;
     <bit-array> [ '[ [ t ] dip _ set-nth ] each ] keep ;
 
 : largest-spill-slot ( seqs -- n )
-    concat [ 0 ] [ supremum 1 + ] if-empty ;
+    concat [ 0 ] [ maximum 1 + ] if-empty ;
 
 : emit-gc-roots ( seqs -- n )
     ! seqs is a sequence of sequences of integers 0..n-1
index e2c66d018e09bd72c030396638fc4eeb80c44795..3db6b79eb57069ed853154b1f5ca9ff0f99c3cbd 100644 (file)
@@ -274,7 +274,7 @@ CONSTANT: lookup-table-at-max 256
     } 1&& ;
 
 : lookup-table-seq ( assoc -- table )
-    [ keys supremum 1 + <iota> ] keep '[ _ at ] { } map-as ;
+    [ keys maximum 1 + <iota> ] keep '[ _ at ] { } map-as ;
 
 : lookup-table-quot ( seq -- newquot )
     lookup-table-seq
index 2a432b64a6672ee85687c3a735d4d063b244b072..c2830f3cc814e54f6bd2bb78fc3feac14734c62d 100644 (file)
@@ -208,7 +208,7 @@ TUPLE: deflate-block
         lit-vec get build-dicts
         dist-dict set
         lit-dict set
-        lit-code-lens supremum 16 < clen-seq supremum 8 < and
+        lit-code-lens maximum 16 < clen-seq maximum 8 < and
         [ drop dynamic-headers clen-bits compressed-lens
         lit-vec get vec-to-codes deflate-block boa ]
         [ halves [ (compress-dynamic) ] bi@ 2array ] if
index bed7901ed6b780c629a5acc5a747d90c6bff83b2..a6006585bfc3bc2aa5ea0bb8e2f3bec6207f41b2 100644 (file)
@@ -39,7 +39,7 @@ TUPLE: select-mx < mx read-fdset write-fdset ;
     [ writes>> keys ] [ write-fdset>> ] bi ;
 
 : max-fd ( assoc -- n )
-    dup assoc-empty? [ drop 0 ] [ keys supremum ] if ;
+    dup assoc-empty? [ drop 0 ] [ keys maximum ] if ;
 
 : num-fds ( mx -- n )
     [ reads>> max-fd ] [ writes>> max-fd ] bi max 1 + ;
index 573ba45c09127b0e48816bd3b1fab9fd90fd1339..1760c95684cd3efc3af99126fc0e7a9c3180c162 100644 (file)
@@ -259,7 +259,7 @@ DEFER: matrix-set-nths
 
 : matrix-l-infinity-norm ( m -- n )
     dup zero-matrix? [ drop 0 ] [
-        [ [ abs ] map-sum ] map supremum
+        [ [ abs ] map-sum ] map maximum
     ] if ; inline foldable
 
 : matrix-l1-norm ( m -- n )
index 67cc057dc29c767a131ed7d2b869e9018a2d96ce..0e487e9c12919ad89f194bcb0d77c0bc7ac5fb3a 100644 (file)
@@ -12,4 +12,4 @@ USING: arrays sequences sequences.windowed tools.test ;
 [ { 1 2 3 4 5 6 } 3 <windowed-sequence> length ] unit-test
 
 { { 1 1 1 2 3 4 } }
-[ { 1 2 3 4 5 6 } 3 <windowed-sequence> [ infimum ] map ] unit-test
+[ { 1 2 3 4 5 6 } 3 <windowed-sequence> [ minimum ] map ] unit-test
index 2135ba80bd77f8b7320a7d44829a64a3c244c66b..81c5048d13ecbca86fd8c134a2907ccd6d37ce08 100644 (file)
@@ -38,11 +38,14 @@ M: windowed-sequence length
 : rolling-median ( seq n -- newseq )
     [ median ] rolling-map ;
 
-: rolling-supremum ( seq n -- newseq )
-    [ supremum ] rolling-map ;
+: rolling-maximum ( seq n -- newseq )
+    [ maximum ] rolling-map ;
 
-: rolling-infimum ( seq n -- newseq )
-    [ infimum ] rolling-map ;
+: rolling-minimum ( seq n -- newseq )
+    [ minimum ] rolling-map ;
+
+ALIAS: rolling-supremum rolling-maximum deprecated
+ALIAS: rolling-infimum rolling-minimum deprecated
 
 : rolling-count ( ... u n quot: ( ... elt -- ... ? ) -- ... v )
     '[ _ count ] rolling-map ; inline
index cff080488f3291051bf5d179403b3f928c0f5a12..d76e45cbce990e08296ec35d30e1eaae49735a9a 100644 (file)
@@ -54,7 +54,7 @@ SYMBOLS: combinator quotations ;
 
 : unify-branches ( ins stacks -- in phi-in phi-out )
     zip [ 0 { } { } ] [
-        [ keys supremum ] [ ] [ balanced? ] tri
+        [ keys maximum ] [ ] [ balanced? ] tri
         [ dupd phi-inputs dup phi-outputs ] [
             [ combinator get quotations get ] dip
             simple-unbalanced-branches-error
@@ -70,7 +70,7 @@ SYMBOLS: combinator quotations ;
 
 : datastack-phi ( seq -- phi-in phi-out )
     [ input-count branch-variable ]
-    [ inner-d-index branch-variable infimum inner-d-index set ]
+    [ inner-d-index branch-variable minimum inner-d-index set ]
     [ (meta-d) active-variable ] tri
     unify-branches
     [ input-count set ] [ ] [ dup >vector (meta-d) set ] tri* ;
index 23b919d3068ca60d1f7c77a823ea4a220b3b983e..406291c5c4b425b4deaf62c8d032b2ed31ae8630 100644 (file)
@@ -157,8 +157,8 @@ TUPLE: gc-stats collections times ;
                     [ sum nanos>string ]
                     [ mean >integer nanos>string ]
                     [ median >integer nanos>string ]
-                    [ infimum nanos>string ]
-                    [ supremum nanos>string ]
+                    [ minimum nanos>string ]
+                    [ maximum nanos>string ]
                 } cleave
             ] bi
         ] bi
index 6584655751b233b5ff08c399a4a09b8308a9f43b..b6f33c25c312064b83c51370c09905d1f6cc5c88 100644 (file)
@@ -164,13 +164,13 @@ ERROR: no-case object ;
 : contiguous-range? ( keys -- ? )
     dup [ fixnum? ] all? [
         dup all-unique? [
-            [ length ] [ supremum ] [ infimum ] tri - - 1 =
+            [ length ] [ maximum ] [ minimum ] tri - - 1 =
         ] [ drop f ] if
     ] [ drop f ] if ;
 
 : dispatch-case-quot ( default assoc -- quot )
     swap [
-        [ keys [ infimum ] [ supremum ] bi over ]
+        [ keys [ minimum ] [ maximum ] bi over ]
         [ sort-keys values [ >quotation ] map ] bi
     ] dip dup '[
         dup integer? [
index ec901189d5441210b761d0142aea757d6683ccb3..c331cd3c1f4006cd7f1394b2feb971b755d74603 100644 (file)
@@ -183,7 +183,7 @@ M: echelon-dispatch-engine compile-engine
 M: tuple-dispatch-engine compile-engine
     tuple assumed [
         echelons>> compile-engines
-        dup keys supremum 1 + f <array>
+        dup keys maximum 1 + f <array>
         <enumerated> swap assoc-union! seq>>
     ] with-variable ;
 
index cea151ef759d441d86455fe4782cb59027947b1c..4a210709f21ef8227222bcfaf9d49e744617e611 100644 (file)
@@ -1445,18 +1445,18 @@ HELP: product
 { $values { "seq" { $sequence number } } { "n" number } }
 { $description "Outputs the product of all elements of " { $snippet "seq" } ". Outputs one given an empty sequence." } ;
 
-HELP: infimum
+HELP: minimum
 { $values { "seq" sequence } { "elt" object } }
 { $description "Outputs the least element of " { $snippet "seq" } "." }
 { $examples
     "Example:"
     { $example "USING: sequences prettyprint ;"
-        "{ 1 2 3 4 5 } infimum ."
+        "{ 1 2 3 4 5 } minimum ."
         "1"
     }
     "Example:"
     { $example "USING: sequences prettyprint ;"
-        "{ \"c\" \"b\" \"a\" } infimum ."
+        "{ \"c\" \"b\" \"a\" } minimum ."
         "\"a\""
     }
 }
@@ -1477,18 +1477,18 @@ HELP: infimum-by
 }
 { $errors "Throws an error if the sequence is empty." } ;
 
-HELP: supremum
+HELP: maximum
 { $values { "seq" sequence } { "elt" object } }
 { $description "Outputs the greatest element of " { $snippet "seq" } "." }
 { $examples
     "Example:"
     { $example "USING: sequences prettyprint ;"
-        "{ 1 2 3 4 5 } supremum ."
+        "{ 1 2 3 4 5 } maximum ."
         "5"
     }
     "Example:"
     { $example "USING: sequences prettyprint ;"
-        "{ \"c\" \"b\" \"a\" } supremum ."
+        "{ \"c\" \"b\" \"a\" } maximum ."
         "\"c\""
     }
 }
@@ -1509,7 +1509,7 @@ HELP: supremum-by
 }
 { $errors "Throws an error if the sequence is empty." } ;
 
-{ min max infimum infimum-by supremum supremum-by } related-words
+{ min max minimum infimum-by maximum supremum-by } related-words
 
 HELP: shortest
 { $values { "seqs" sequence } { "elt" object } }
@@ -2167,9 +2167,9 @@ ARTICLE: "sequences-combinators" "Sequence combinators"
 }
 "Superlatives with " { $link min } " and " { $link max } ":"
 { $subsections
-    infimum
+    minimum
     infimum-by
-    supremum
+    maximum
     supremum-by
     shorter
     longer
index 019c303064d270e594f73fbb8b9261a3cf4eebcd..8b224f37cc199f9e2f8dab68eab446232faf6c52 100644 (file)
@@ -390,8 +390,6 @@ M: bogus-hashcode hashcode* 2drop 0 >bignum ;
 { 24 } [ { 1 2 } { 3 4 } [ + ] [ * ] 2map-reduce ] unit-test
 { 2 96 } [ 2 { 3 3 3 3 } { 4 4 4 4 } [ [ dup ] 2dip * * ] [ + ] 2map-reduce ] unit-test
 
-{ 4 } [ 5 <iota> supremum ] unit-test
-{ 0 } [ 5 <iota> infimum ] unit-test
 { 4 } [ 5 <iota> maximum ] unit-test
 { 0 } [ 5 <iota> minimum ] unit-test
 
index 36c10f35ca1e45c447f0ab1cbee02fcf6f6ba44e..9fdce4715f8dde3cfaee54f8187c94719e3fde04 100644 (file)
@@ -9,7 +9,7 @@ IN: benchmark
 SYMBOL: benchmarks-disabled?
 
 : run-timing-benchmark ( vocab -- time )
-    5 swap '[ gc [ _ run ] benchmark ] replicate infimum ;
+    5 swap '[ gc [ _ run ] benchmark ] replicate minimum ;
 
 : run-profile-benchmark ( vocab -- profile )
     compact-gc '[ _ run ] profile most-recent-profile-data ;
index c73eacd8818ca97877643721b87a41a286ef1c0b..c7369afdeb0811e0e8042b492ec6c287c3b82086 100644 (file)
@@ -19,7 +19,7 @@ M: avail transfer-set drop defined assoc-union ;
 : available? ( vn -- ? ) basic-block get avail-in key? ;
 
 : best-vreg ( available-vregs -- vreg )
-    [ f ] [ infimum ] if-empty ;
+    [ f ] [ minimum ] if-empty ;
 
 : >avail-vreg ( vreg -- vreg/f )
     final-iteration? get [
index 16a6ed75a3239a56c8da64e21621078f45d77c24..08164ddef004b3bbcf795420b2e170f22b0ec8db 100644 (file)
@@ -56,7 +56,7 @@ CONSTANT: aliases H{
         [
             [ days>> 1 ] [ months>> ] bi [
                 { 0 31 29 31 30 31 30 31 31 30 31 30 31 } nth
-            ] map supremum [ between? ] 2curry all?
+            ] map maximum [ between? ] 2curry all?
         ]
         [ minutes>> [ 0 59 between? ] all? ]
         [ hours>> [ 0 23 between? ] all? ]
@@ -200,4 +200,4 @@ ALIAS: crons-today crons-this-day
     [ rfc822>timestamp timestamp>unix-time ] map-keys ;
 
 : grouped-crons. ( assoc -- )
-    keys-unix-to-rfc822 [ first2 [ write bl ] [ ... ] bi* ] each ;
\ No newline at end of file
+    keys-unix-to-rfc822 [ first2 [ write bl ] [ ... ] bi* ] each ;
index 72830602fc87379d1996397fd19e4100e660f7f7..90e6870902ad316498d9addb2d30927b9ec6e24e 100644 (file)
@@ -25,7 +25,7 @@ background foreground margin bar-width ;
 
 : chd ( chart seq -- chart )
     [ x,y >>data ] [
-        [ infimum 0 min ] [ supremum 0 max ] bi 2array
+        [ minimum 0 min ] [ maximum 0 max ] bi 2array
         x,y >>data-scale
     ] bi ;
 
index a54035a424f563cbadf7e5c279f8142651fa44e8..42815ed616f8a6b789948b38a5809e194a25d580 100644 (file)
@@ -19,7 +19,7 @@ IN: math.distances
     1 minkowski-distance ;
 
 : chebyshev-distance ( a b -- n ) ! also chessboard-distance
-    v- vabs supremum ;
+    v- vabs maximum ;
 
 : cosine-distance ( a b -- n )
     cosine-similarity 1 swap - ;
index 5a462fbbce59433fac53ec8a461aed2acb2f245f..e12dce7297fa104f37064f96af35dc63e8b1c694 100644 (file)
@@ -48,11 +48,11 @@ HELP: nan-sum
 
 HELP: nan-min
 { $values { "seq" sequence } { "n" number } }
-{ $description "Return the " { $link infimum } " of " { $snippet "seq" } " ignoring any NaNs." } ;
+{ $description "Return the " { $link minimum } " of " { $snippet "seq" } " ignoring any NaNs." } ;
 
 HELP: nan-max
 { $values { "seq" sequence } { "n" number } }
-{ $description "Return the " { $link supremum } " of " { $snippet "seq" } " ignoring any NaNs." } ;
+{ $description "Return the " { $link maximum } " of " { $snippet "seq" } " ignoring any NaNs." } ;
 
 HELP: sinc
 { $values { "x" number } { "y" number } }
index 8d246bbefe0d85609f4e5a4fceafd6bcf2d37e71..eb89c376978f9ea9a97b631119d30d4db1093419 100644 (file)
@@ -106,11 +106,14 @@ PRIVATE>
 : moving-median ( u n -- v )
     <clumps> [ median ] map ;
 
-: moving-supremum ( u n -- v )
-    <clumps> [ supremum ] map ;
+: moving-maximum ( u n -- v )
+    <clumps> [ maximum ] map ;
 
-: moving-infimum ( u n -- v )
-    <clumps> [ infimum ] map ;
+: moving-minimum ( u n -- v )
+    <clumps> [ minimum ] map ;
+
+ALIAS: moving-supremum moving-maximum deprecated
+ALIAS: moving-infimum moving-minimum deprecated
 
 : moving-sum ( u n -- v )
     <clumps> [ sum ] map ;
@@ -152,10 +155,10 @@ PRIVATE>
     0 [ dup fp-nan? [ drop ] [ + ] if ] binary-reduce ;
 
 : nan-min ( seq -- n )
-    [ fp-nan? ] reject infimum ;
+    [ fp-nan? ] reject minimum ;
 
 : nan-max ( seq -- n )
-    [ fp-nan? ] reject supremum ;
+    [ fp-nan? ] reject maximum ;
 
 : fill-nans ( seq -- newseq )
     [ first ] keep [
index b9c8bac3fafff40362c6332830ec71da87e8bfe6..c357f4331105a6a5e299ec8919c126163f6757b5 100644 (file)
@@ -77,7 +77,7 @@ M: div pdf-render
 
 M: div pdf-width
     [ style>> set-style ] keep
-    items>> [ dupd pdf-width ] map nip supremum ;
+    items>> [ dupd pdf-width ] map nip maximum ;
 
 
 <PRIVATE
@@ -108,7 +108,7 @@ M: p pdf-render
 M: p pdf-width
     [ style>> set-style ] keep
     [ font>> ] [ string>> ] bi* split-lines
-    [ dupd text-width ] map nip supremum ;
+    [ dupd text-width ] map nip maximum ;
 
 
 TUPLE: text string style ;
@@ -141,7 +141,7 @@ M: text pdf-render
 M: text pdf-width
     [ style>> set-style ] keep
     [ font>> ] [ string>> ] bi* split-lines
-    [ dupd text-width ] map nip supremum ;
+    [ dupd text-width ] map nip maximum ;
 
 
 TUPLE: hr width ;
@@ -242,7 +242,7 @@ M: table-row pdf-render
     [
         [
             contents>> [ 0 ] [
-                [ [ dupd pdf-width ] [ 0 ] if* ] map supremum
+                [ [ dupd pdf-width ] [ 0 ] if* ] map maximum
             ] if-empty
         ] [ 0 ] if*
     ] map nip ;
index 9bcc9741365dd09fbc37fb3f4a8e4fd3f583e0e5..f05947af04c9714a12e94486ff6b141c8c18edeb 100644 (file)
@@ -14,7 +14,7 @@ IN: picomath
         { 0.5 0.520499877813 }
         { 2.1 0.997020533344 }
     } [ [ first erf ] [ second - ] bi abs ] map
-    supremum 1e-6 <
+    maximum 1e-6 <
 ] unit-test
 
 { t } [
@@ -25,7 +25,7 @@ IN: picomath
         { $[ 1e-5 1e-8 + ] 0.00001001005010021717 }
         { 0.5              0.6487212707001282 }
     } [ [ first expm1 ] [ second - ] bi abs ] map
-    supremum 1e-6 <
+    maximum 1e-6 <
 ] unit-test
 
 { t } [
@@ -36,7 +36,7 @@ IN: picomath
         { 0.5 0.691462461274 }
         { 2.1 0.982135579437 }
     } [ [ first phi ] [ second - ] bi abs ] map
-    supremum 1e-3 <
+    maximum 1e-3 <
 ] unit-test
 
 : factorial ( n -- n! ) [ 1 ] [ [1..b] 1 [ * ] reduce ] if-zero ;
@@ -44,7 +44,7 @@ IN: picomath
 { t } [
     { 0 1 10 100 1000 10000 } [
         [ factorial log ] [ log-factorial ] bi - abs
-    ] map supremum 1e-6 <
+    ] map maximum 1e-6 <
 ] unit-test
 
 : relative-error ( approx value -- relative-error )
@@ -64,7 +64,7 @@ IN: picomath
         { 12.001 40014424.1571 }
         { 15.2 149037380723.0 }
     } [ [ first gamma ] [ second relative-error ] bi ] map
-    supremum 1e-6 <
+    maximum 1e-6 <
 ] unit-test
 
 { t } [
@@ -79,5 +79,5 @@ IN: picomath
         { 12.0001 17.5025521125 }
         { 27.4 62.5755868211 }
     } [ [ first log-gamma ] [ second relative-error ] bi ] map
-    supremum 1e-10 <
+    maximum 1e-10 <
 ] unit-test
index 9eb2c7ca9a39d6e4e2fd6cc83a43cf6dfe0b7e56..2c4939d919fceed421570c94c3dd32a8bfc3d5b2 100644 (file)
@@ -150,7 +150,7 @@ PRIVATE>
 
 : best-holdem-hand ( hand -- n cards )
     5 [ [ hand-value ] [ ] bi ] { } map>assoc-combinations
-    infimum first2 ;
+    minimum first2 ;
 
 : value>string ( n -- string )
     value>rank VALUES nth ;
@@ -185,7 +185,7 @@ ERROR: no-card card deck ;
     n [
         holes deck 5 sample '[
             [ _ append best-holdem-hand drop ] keep
-        ] { } map>assoc infimum second
+        ] { } map>assoc minimum second
     ] replicate histogram ;
 
 : (best-omaha-hand) ( seq -- pair )
@@ -193,13 +193,13 @@ ERROR: no-card card deck ;
     [ 2 all-combinations ] [ 3 all-combinations ] bi*
     2array [ concat [ best-holdem-hand drop ] keep ] { } product-map>assoc ;
 
-: best-omaha-hand ( seq -- n cards ) (best-omaha-hand) infimum first2 ;
+: best-omaha-hand ( seq -- n cards ) (best-omaha-hand) minimum first2 ;
 
 :: compare-omaha-hands ( holes deck n -- seq )
     n [
         holes deck 5 sample '[
             [ _ append best-omaha-hand drop ] keep
-        ] { } map>assoc infimum second
+        ] { } map>assoc minimum second
     ] replicate histogram ;
 
 ERROR: bad-suit-symbol ch ;
index f04c15cefc0f01b1d12b10d2b887b52471f00d76..78498049c4c64e6ac7e6856c4462ef57dd39cfcb 100644 (file)
@@ -17,7 +17,7 @@ IN: project-euler.003
 ! --------
 
 : euler003 ( -- answer )
-    600851475143 factors supremum ;
+    600851475143 factors maximum ;
 
 ! [ euler003 ] 100 ave-time
 ! 1 ms ave run time - 0.49 SD (100 trials)
index b0512ea4e48cbef2ba4ba77a327e8c5878babeec..451b8094683f748435c7b2764ba68590921fc31c 100644 (file)
@@ -97,7 +97,7 @@ PRIVATE>
     [
         { [ horizontal ] [ vertical ] [ diagonal/ ] [ diagonal\ ] }
         [ call( -- matrix ) 4 max-product , ] each
-    ] { } make supremum ;
+    ] { } make maximum ;
 
 ! [ euler011 ] 100 ave-time
 ! 3 ms ave run time - 0.77 SD (100 trials)
index c44a74a6cb76b25f04db3d09531765a5eb905e71..743d31ada1529dc538158cf491e91eac66a6b587 100644 (file)
@@ -57,7 +57,7 @@ PRIVATE>
 <PRIVATE
 
 : max-period ( seq -- elt n )
-    dup [ period-length ] map dup supremum
+    dup [ period-length ] map dup maximum
     over index [ swap nth ] curry bi@ ;
 
 PRIVATE>
index 2e5efbfb8f8398a569f3bde4ca47e8fd0d238b45..5f174e19cac64441320131bd6836d4eef0a39b40 100644 (file)
@@ -60,7 +60,7 @@ IN: project-euler.027
     swap 0 (consecutive-primes) ;
 
 : max-consecutive ( seq -- elt n )
-    dup [ first2 consecutive-primes ] map dup supremum
+    dup [ first2 consecutive-primes ] map dup maximum
     over index [ swap nth ] curry bi@ ;
 
 PRIVATE>
index ceffdec347c544ede9a8c2b91f8d7ed9354d79f0..b1fad75822c485c3e102ede449b0e03f4f54733a 100644 (file)
@@ -50,7 +50,7 @@ IN: project-euler.038
 PRIVATE>
 
 : euler038 ( -- answer )
-    9123 9876 [a..b] [ concat-product ] map [ pandigital? ] filter supremum ;
+    9123 9876 [a..b] [ concat-product ] map [ pandigital? ] filter maximum ;
 
 ! [ euler038 ] 100 ave-time
 ! 11 ms ave run time - 1.5 SD (100 trials)
index fbf1c01e3e43ac09dd9e6e3f4264e4d584392a08..2b03197a0a52fe5944f068538ba6fbb9f06fa5a4 100644 (file)
@@ -47,7 +47,7 @@ IN: project-euler.042
 PRIVATE>
 
 : euler042 ( -- answer )
-    source-042 [ alpha-value ] map dup supremum
+    source-042 [ alpha-value ] map dup maximum
     triangle-upto [ member? ] curry count ;
 
 ! [ euler042 ] 100 ave-time
index 1bda3e4e6bd36daefe6265d8bb155403213aad02..a672a68f090b89e086e6a3e7aae634d94998ce8a 100644 (file)
@@ -45,7 +45,7 @@ CONSTANT: N 5
 
 : ?register ( acc seq -- )
     complete rotate-bits
-    dup [ 2 N ^ mod ] map all-unique? [ infimum swap push ] [ 2drop ] if ;
+    dup [ 2 N ^ mod ] map all-unique? [ minimum swap push ] [ 2drop ] if ;
 
 : add-bit ( seen bit -- seen' t/f )
     over last 2 * + 2 N ^ mod
index 9dccb37a3e0c07674dd68b8217899b415826c181..33f269e254d213ee04f942e5c5eeac663eee0140 100644 (file)
@@ -133,9 +133,7 @@ M: lambda-word word-noise-factor
     vocab-words flatten-generics
     [ word-noise-factor dup 20 < [ drop 0 ] when ] map
     [ 0 ] [
-        [ [ sum ] [ length 5 max ] bi /i ]
-        [ supremum ]
-        bi +
+        [ [ sum ] [ length 5 max ] bi /i ] [ maximum ] bi +
     ] if-empty ;
 
 : noisy-vocabs ( -- alist )
index 3bfc0dc0f3fa87764234baaf3de57052a6b24c68..f207b39279fede6deb2df39f678f9b8c47689ce4 100644 (file)
@@ -105,7 +105,7 @@ SYMBOL: tetrominoes
     tetrominoes get random ;
 
 : blocks-max ( blocks quot -- max )
-    map supremum 1 + ; inline
+    map maximum 1 + ; inline
 
 : blocks-width ( blocks -- width )
     [ first ] blocks-max ;