repeat constructor; repeat intro.
destruct x; simpl in *...
destruct x; destruct y; simpl in *...
do_comp expr_cspec e e1...
destruct z; simpl in *...
do_comp expr_cspec e1 e...
destruct z; simpl in *...
do_comp expr_cspec e1 e4...
rewrite <- (comp_trans _ expr_cspec _ _ _ e3 e6)...
do_comp expr_cspec e1 e4...
rewrite <- (comp_trans _ expr_cspec _ _ _ e3 e6)...
do_comp expr_cspec e e1...
destruct z; simpl in *.
do_comp expr_cspec e1 e...
do_comp expr_cspec e1 e...
destruct z; simpl in *.
do_comp expr_cspec e1 e4...
rewrite <- (comp_trans _ expr_cspec _ _ _ e3 e6)...
do_comp expr_cspec e1 e4...
rewrite <- (comp_trans _ expr_cspec _ _ _ e3 e6)...
destruct z; simpl in *.
do_comp expr_cspec e e1...
do_comp expr_cspec e1 e3...
rewrite <- (comp_trans _ expr_cspec _ _ _ e5 e6)...
do_comp expr_cspec e e1...
do_comp expr_cspec e1 e3...
rewrite <- (comp_trans _ expr_cspec _ _ _ e5 e6)...
do_comp expr_cspec e e1...
destruct z; simpl in *.
do_comp expr_cspec e1 e...
do_comp expr_cspec e1 e...
destruct z; simpl in *.
do_comp expr_cspec e1 e4...
rewrite <- (comp_trans _ expr_cspec _ _ _ e3 e6)...
do_comp expr_cspec e1 e4...
rewrite <- (comp_trans _ expr_cspec _ _ _ e3 e6)...
destruct x; destruct y; simpl...
do_comp expr_cspec e e1; simpl...
do_comp expr_cspec e0 e2...
do_comp expr_cspec e e1...
do_comp expr_cspec e e1...
do_comp expr_cspec e e1...
do_comp expr_cspec e0 e2...
Qed.
Hint Resolve space_atom_cspec.
Definition compare_clause (cl1 cl2 : clause) : comparison :=
match cl1 , cl2 with
| PureClause neg pos _ _ , PureClause neg' pos' _ _ =>
match compare_list pure_atom_cmp neg neg' with
| Eq => compare_list pure_atom_cmp pos pos'
| c => c
end
| PureClause _ _ _ _ , _ => Lt
| _ , PureClause _ _ _ _ => Gt
| PosSpaceClause gamma delta sigma , PosSpaceClause gamma' delta' sigma'
| NegSpaceClause gamma sigma delta , NegSpaceClause gamma' sigma' delta' =>
match compare_list pure_atom_cmp gamma gamma' with
| Eq => match compare_list pure_atom_cmp delta delta' with
| Eq => compare_list compare_space_atom sigma sigma'
| c => c
end
| c => c
end
| PosSpaceClause _ _ _ , NegSpaceClause _ _ _ => Lt
| NegSpaceClause _ _ _ , PosSpaceClause _ _ _ => Gt
end.

Lemma clause_cspec: CompSpec' compare_clause.
Proof with (repeat (comp_tac || solve [econstructor; simpl; repeat comp_tac])).