Local Open Scope logic.
Definition nonlocal (Q: environ->mpred) := True.
Ltac check_nonlocal :=
match goal with
|  |- nonlocal (local _) => fail 1
|  |- nonlocal (prop _) => fail 1
|  |- nonlocal (andp _ _) => fail 1
|  |- nonlocal (sepcon _ _) => fail 1
| |- _ => apply I
end.
Hint Rewrite canon1 canon2 canon4 canon8 : canon.
Hint Rewrite canon3 using check_nonlocal : canon.
Hint Rewrite canon3b using check_nonlocal : canon.
Hint Rewrite canon7 using check_nonlocal : canon.
Hint Rewrite <- (@sepcon_assoc (environ->mpred) _) : canon.
Hint Rewrite canon5 using check_nonlocal : canon.
Hint Rewrite canon5b using check_nonlocal : canon.
Hint Rewrite canon5c using check_nonlocal : canon.
Hint Rewrite canon6 using check_nonlocal : canon.
Hint Rewrite canon6b using check_nonlocal : canon.
Hint Rewrite canon6c using check_nonlocal : canon.
Hint Rewrite canon17 : canon.
Ltac canonicalize_pre :=
match goal with |- semax _ ?P _ _ =>
rewrite (start_canon P); autorewrite with canon
end.

Lemma exp_do_canon:
forall T (P: T -> environ->mpred) (Q: environ->mpred), do_canon (exp P) Q = EX x:_, do_canon (P x) Q.