|
1 | 1 | # Commands |
2 | 2 |
|
3 | | -Mathlib version: `955e8f97a6372ceeeb97f4acc87f71ae1fea7d85` |
| 3 | +Mathlib version: `0e836d6e1a3c5ed008688622e261e19fbef05e0e` |
4 | 4 |
|
5 | 5 | ## \#adaptation_note |
6 | 6 | Defined in: `adaptationNoteCmd` |
@@ -771,6 +771,24 @@ Unlike `norm_num`, this command does not fail when no simplifications are made. |
771 | 771 |
|
772 | 772 | `#norm_num` understands local variables, so you can use them to introduce parameters. |
773 | 773 |
|
| 774 | +## \#parse |
| 775 | +Defined in: `Mathlib.GuardExceptions.parseCmd` |
| 776 | + |
| 777 | +`#parse parserFnId => str` allows to capture parsing exceptions. |
| 778 | +`parserFnId` is the identifier of a `ParserFn` and `str` is the string that |
| 779 | +`parserFnId` should parse. |
| 780 | + |
| 781 | +If the parse is successful, then the output is logged; |
| 782 | +if the parse is successful, then the output is captured in an exception. |
| 783 | + |
| 784 | +In either case, `#guard_msgs` can then be used to capture the resulting parsing errors. |
| 785 | + |
| 786 | +For instance, `#parse` can be used as follows |
| 787 | +```lean |
| 788 | +/-- error: <input>:1:3: Stacks tags must be exactly 4 characters -/ |
| 789 | +#guard_msgs in #parse Mathlib.Stacks.stacksTagFn => "A05" |
| 790 | +``` |
| 791 | + |
774 | 792 | ## \#print |
775 | 793 | Defined in: `Batteries.Tactic.printPrefix` |
776 | 794 |
|
@@ -843,6 +861,34 @@ theorem bar' : 1 = 1 ∨ 1 ≠ 1 := foo |
843 | 861 | Defined in: `Lean.Parser.Command.print` |
844 | 862 |
|
845 | 863 |
|
| 864 | +## \#print_fun_prop_theorems |
| 865 | +Defined in: `Mathlib.Meta.FunProp.«command#print_fun_prop_theorems__»` |
| 866 | + |
| 867 | +Command that printins all function properties attached to a function. |
| 868 | + |
| 869 | +For example |
| 870 | +``` |
| 871 | +#print_fun_prop_theorems HAdd.hAdd |
| 872 | +``` |
| 873 | +might print out |
| 874 | +``` |
| 875 | +Continuous |
| 876 | + continuous_add, args: [4,5], priority: 1000 |
| 877 | + continuous_add_left, args: [5], priority: 1000 |
| 878 | + continuous_add_right, args [4], priority: 1000 |
| 879 | + ... |
| 880 | +Diferentiable |
| 881 | + Differentiable.add, args: [4,5], priority: 1000 |
| 882 | + Differentiable.add_const, args: [4], priority: 1000 |
| 883 | + Differentiable.const_add, args: [5], priority: 1000 |
| 884 | + ... |
| 885 | +``` |
| 886 | + |
| 887 | +You can also see only theorems about a concrete function property |
| 888 | +``` |
| 889 | +#print_fun_prop_theorems HAdd.hAdd Continuous |
| 890 | +``` |
| 891 | + |
846 | 892 | ## \#push_neg |
847 | 893 | Defined in: `Mathlib.Tactic.PushNeg.pushNeg` |
848 | 894 |
|
|
0 commit comments