Skip to content

Commit cce4873

Browse files
authored
chore: rename wrongly named backwards. options to backward. (#11303)
This PR renames rename wrongly named `backwards.` options to `backward.`
1 parent dedf7a8 commit cce4873

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/Lean/Meta/Constructions/NoConfusion.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def mkNoConfusionCtorArg (ctorName : Name) (P : Expr) : MetaM Expr := do
4545
t := mkForall name .default eq t
4646
mkLambdaFVars (xs ++ fields1 ++ fields2) t
4747

48-
register_builtin_option backwards.linearNoConfusionType : Bool := {
48+
register_builtin_option backward.linearNoConfusionType : Bool := {
4949
defValue := true
5050
descr := "use the linear-size construction for the `noConfusionType` declaration of an inductive type. Set to false to use the previous, simpler but quadratic-size construction. "
5151
}
@@ -54,7 +54,7 @@ def mkNoConfusionTypeName (indName : Name) : Name :=
5454
Name.str indName "noConfusionType"
5555

5656
def canUseLinear (indName : Name) : MetaM Bool := do
57-
unless backwards.linearNoConfusionType.get (← getOptions) do return false
57+
unless backward.linearNoConfusionType.get (← getOptions) do return false
5858
-- Check if the prelude is loaded
5959
unless (← hasConst ``Eq.propIntro) do return false
6060
-- Check if we have the constructor elim helpers
@@ -74,7 +74,7 @@ def mkNoConfusionType (indName : Name) : MetaM Unit := do
7474
let ConstantInfo.inductInfo info ← getConstInfo indName | unreachable!
7575
let useLinearConstruction :=
7676
(info.numCtors > 2) &&
77-
backwards.linearNoConfusionType.get (← getOptions) &&
77+
backward.linearNoConfusionType.get (← getOptions) &&
7878
(← hasConst (mkCtorElimName indName))
7979
let casesOnName := mkCasesOnName indName
8080
let casesOnInfo ← getConstVal casesOnName

src/Lean/Meta/Match/Match.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public section
1818

1919
namespace Lean.Meta.Match
2020

21-
register_builtin_option backwards.match.sparseCases : Bool := {
21+
register_builtin_option backward.match.sparseCases : Bool := {
2222
defValue := true
2323
descr := "if true (the default), generate and use sparse case constructs when splitting inductive
2424
types. In some cases this will prevent Lean from noticing that a match statement is complete
@@ -27,7 +27,7 @@ register_builtin_option backwards.match.sparseCases : Bool := {
2727
,"
2828
}
2929

30-
register_builtin_option backwards.match.rowMajor : Bool := {
30+
register_builtin_option backward.match.rowMajor : Bool := {
3131
defValue := true
3232
descr := "If true (the default), match compilation will split the discrimnants based \
3333
on position of the first constructor pattern in the first alternative. If false, \
@@ -580,7 +580,7 @@ private def processConstructor (p : Problem) : MetaM (Array Problem) := do
580580
-- We use a sparse case analysis only if there is at least one non-constructor pattern,
581581
-- but not just because there are constructors missing (in that case we benefit from
582582
-- the eager split in ruling out constructors by type or by a more explicit error message)
583-
if backwards.match.sparseCases.get (← getOptions) && hasVarOrInaccessiblePattern p then
583+
if backward.match.sparseCases.get (← getOptions) && hasVarOrInaccessiblePattern p then
584584
let ctors := collectCtors p
585585
trace[Meta.Match.match] "using sparse cases: {ctors}"
586586
pure (some ctors)
@@ -918,7 +918,7 @@ private partial def process (p : Problem) : StateRefT State MetaM Unit := do
918918
process p
919919
return
920920

921-
if backwards.match.rowMajor.get (← getOptions) then
921+
if backward.match.rowMajor.get (← getOptions) then
922922
match firstRefutablePattern p with
923923
| some i =>
924924
if i > 0 then

tests/lean/run/issue10749.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ fun motive x x_1 x_2 x_3 x_4 h_1 h_2 h_3 h_4 h_5 h_6 =>
121121
-- Just testing the backwards compatibility option
122122

123123
set_option match.ignoreUnusedAlts true in
124-
set_option backwards.match.rowMajor false in
124+
set_option backward.match.rowMajor false in
125125
def testOld (a : List Nat) : Nat :=
126126
match a with
127127
| _ => 3

tests/lean/run/match1.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ match n, parity n with
143143
| _, Parity.even j => false :: natToBin j
144144
| _, Parity.odd j => true :: natToBin j
145145

146-
set_option backwards.match.sparseCases false in
146+
set_option backward.match.sparseCases false in
147147
/--
148148
error: Tactic `cases` failed with a nested error:
149149
Dependent elimination failed: Failed to solve equation

0 commit comments

Comments
 (0)