Debian Codegraph @

src/Util/Tactics/SimplifyRepeatedIfs.v

raw
1 Ltac simplify_repeated_ifs_step :=
2 match goal with
3 | [ |- context G[if ?b then ?x else ?y] ]
4 => let x' := match x with
5 | context x'[b] => let x'' := context x'[true] in x''
6 end in
7 let G' := context G[if b then x' else y] in
8 cut G'; [ destruct b; exact (fun z => z) | cbv iota ]
9 | [ |- context G[if ?b then ?x else ?y] ]
10 => let y' := match y with
11 | context y'[b] => let y'' := context y'[false] in y''
12 end in
13 let G' := context G[if b then x else y'] in
14 cut G'; [ destruct b; exact (fun z => z) | cbv iota ]
15 end.
16 Ltac simplify_repeated_ifs := repeat simplify_repeated_ifs_step.