mirror of
https://github.com/achlipala/frap.git
synced 2024-11-10 00:07:51 +00:00
Improve robustness of set simplification
This commit is contained in:
parent
c8cfde5acf
commit
a48d85c84c
2 changed files with 20 additions and 4 deletions
|
@ -159,8 +159,16 @@ Ltac removeDups :=
|
||||||
|
|
||||||
Ltac doSubtract :=
|
Ltac doSubtract :=
|
||||||
match goal with
|
match goal with
|
||||||
| [ |- context[constant ?ls \setminus constant ?ls0] ] =>
|
| [ |- context[@minus ?A (@constant ?A1 ?ls) (@constant ?A2 ?ls0)] ] =>
|
||||||
erewrite (@doSubtract_ok _ ls ls0)
|
match A with
|
||||||
|
| A1 => idtac
|
||||||
|
| _ => change (@constant A1 ls) with (@constant A ls)
|
||||||
|
end;
|
||||||
|
match A with
|
||||||
|
| A2 => idtac
|
||||||
|
| _ => change (@constant A2 ls0) with (@constant A ls0)
|
||||||
|
end;
|
||||||
|
erewrite (@doSubtract_ok A ls ls0)
|
||||||
by repeat (apply DsNil
|
by repeat (apply DsNil
|
||||||
|| (apply DsKeep; [ simpl; intuition (congruence || solve [ fancy_neq ]) | ])
|
|| (apply DsKeep; [ simpl; intuition (congruence || solve [ fancy_neq ]) | ])
|
||||||
|| (apply DsDrop; [ simpl; intuition (congruence || (repeat (maps_equal' || f_equal))) | ]))
|
|| (apply DsDrop; [ simpl; intuition (congruence || (repeat (maps_equal' || f_equal))) | ]))
|
||||||
|
|
12
Sets.v
12
Sets.v
|
@ -258,8 +258,16 @@ Ltac fancy_neq :=
|
||||||
|
|
||||||
Ltac doSubtract :=
|
Ltac doSubtract :=
|
||||||
match goal with
|
match goal with
|
||||||
| [ |- context[constant ?ls \setminus constant ?ls0] ] =>
|
| [ |- context[@minus ?A (@constant ?A1 ?ls) (@constant ?A2 ?ls0)] ] =>
|
||||||
erewrite (@doSubtract_ok _ ls ls0)
|
match A with
|
||||||
|
| A1 => idtac
|
||||||
|
| _ => change (@constant A1 ls) with (@constant A ls)
|
||||||
|
end;
|
||||||
|
match A with
|
||||||
|
| A2 => idtac
|
||||||
|
| _ => change (@constant A2 ls0) with (@constant A ls0)
|
||||||
|
end;
|
||||||
|
erewrite (@doSubtract_ok A ls ls0)
|
||||||
by repeat (apply DsNil
|
by repeat (apply DsNil
|
||||||
|| (apply DsKeep; [ simpl; intuition (congruence || fancy_neq) | ])
|
|| (apply DsKeep; [ simpl; intuition (congruence || fancy_neq) | ])
|
||||||
|| (apply DsDrop; [ simpl; intuition congruence | ]))
|
|| (apply DsDrop; [ simpl; intuition congruence | ]))
|
||||||
|
|
Loading…
Reference in a new issue