@@ -1880,30 +1880,37 @@ syntax "‹" withoutPosition(term) "›" : term
18801880macro_rules | `(‹$type›) => `((by assumption : $type))
18811881
18821882/--
1883- `get_elem_tactic_trivial ` is an extensible tactic automatically called
1883+ `get_elem_tactic_extensible ` is an extensible tactic automatically called
18841884by the notation `arr[i]` to prove any side conditions that arise when
18851885constructing the term (e.g. the index is in bounds of the array).
1886- The default behavior is to just try `trivial` (which handles the case
1887- where `i < arr.size` is in the context) and `simp +arith` and `omega`
1886+ The default behavior is to try `simp +arith` and `omega`
18881887(for doing linear arithmetic in the index).
1888+
1889+ (Note that the core tactic `get_elem_tactic` has already tried
1890+ `done` and `assumption` before the extensible tactic is called.)
18891891-/
1892+ syntax "get_elem_tactic_extensible" : tactic
1893+
1894+ /-- `get_elem_tactic_trivial` has been deprecated in favour of `get_elem_tactic_extensible`. -/
18901895syntax "get_elem_tactic_trivial" : tactic
18911896
1897+ macro_rules | `(tactic| get_elem_tactic_extensible) => `(tactic| omega)
1898+ macro_rules | `(tactic| get_elem_tactic_extensible) => `(tactic| simp +arith; done)
1899+
18921900macro_rules | `(tactic| get_elem_tactic_trivial) => `(tactic| omega)
18931901macro_rules | `(tactic| get_elem_tactic_trivial) => `(tactic| simp +arith; done)
1894- macro_rules | `(tactic| get_elem_tactic_trivial) => `(tactic| trivial)
18951902
18961903/--
18971904`get_elem_tactic` is the tactic automatically called by the notation `arr[i]`
18981905to prove any side conditions that arise when constructing the term
18991906(e.g. the index is in bounds of the array). It just delegates to
1900- `get_elem_tactic_trivial ` and gives a diagnostic error message otherwise;
1901- users are encouraged to extend `get_elem_tactic_trivial ` instead of this tactic.
1907+ `get_elem_tactic_extensible ` and gives a diagnostic error message otherwise;
1908+ users are encouraged to extend `get_elem_tactic_extensible ` instead of this tactic.
19021909-/
19031910macro "get_elem_tactic" : tactic =>
19041911 `(tactic| first
19051912 /-
1906- Recall that `macro_rules` (namely, for `get_elem_tactic_trivial `) are tried in reverse order.
1913+ Recall that `macro_rules` (namely, for `get_elem_tactic_extensible `) are tried in reverse order.
19071914 We first, however, try `done`, since the necessary proof may already have been
19081915 found during unification, in which case there is no goal to solve (see #6999).
19091916 If a goal is present, we want `assumption` to be tried first.
@@ -1916,15 +1923,15 @@ macro "get_elem_tactic" : tactic =>
19161923 If `omega` is used to "fill" this proof, we will have a more complex proof term that
19171924 cannot be inferred by unification.
19181925 We hardcoded `assumption` here to ensure users cannot accidentally break this IF
1919- they add new `macro_rules` for `get_elem_tactic_trivial `.
1926+ they add new `macro_rules` for `get_elem_tactic_extensible `.
19201927
19211928 TODO: Implement priorities for `macro_rules`.
1922- TODO: Ensure we have **high-priority** macro_rules for `get_elem_tactic_trivial ` which are
1929+ TODO: Ensure we have **high-priority** macro_rules for `get_elem_tactic_extensible ` which are
19231930 just `done` and `assumption`.
19241931 -/
19251932 | done
19261933 | assumption
1927- | get_elem_tactic_trivial
1934+ | get_elem_tactic_extensible
19281935 | fail "failed to prove index is valid, possible solutions:
19291936 - Use `have`-expressions to prove the index is valid
19301937 - Use `a[i]!` notation instead, runtime check is performed, and 'Panic' error message is produced if index is not valid
0 commit comments