Definition prio1000 := Z2id 1000.
Definition prio1001 := Z2id 1001.
Definition clause_prio (cl : clause) : var :=
match cl with
| PureClause gamma delta prio _ => prio
| PosSpaceClause _ _ _ => prio1000
| NegSpaceClause gamma sigma delta => prio1001
end%Z.
Definition compare_clause' (cl1 cl2 : clause) : comparison :=
match Ident.compare (clause_prio cl1) (clause_prio cl2) with
| Eq => compare_clause cl1 cl2
| c => c
end.

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