Skip to content

Instantly share code, notes, and snippets.

@Blaisorblade
Created September 28, 2019 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Blaisorblade/80ac2ca21b3df86cf2eddc19730fcb3c to your computer and use it in GitHub Desktop.
Save Blaisorblade/80ac2ca21b3df86cf2eddc19730fcb3c to your computer and use it in GitHub Desktop.
Notation "⊤" := True : dms_scope.
Notation " {@ T1 } " := ( and T1 True ) (format "{@ T1 }"): dms_scope.
Notation " {@ T1 ; T2 ; .. ; Tn } " :=
(and T1 (and T2 .. (and Tn True)..))
(format "'[v' {@ '[' T1 ']' ; '//' '[' T2 ']' ; '//' .. ; '//' '[' Tn ']' } ']'") : dms_scope.
Open Scope dms_scope.
Close Scope dms_scope.
Delimit Scope dms_scope with dms.
Check {@ True ; True -> False ; False } % dms.
@Blaisorblade
Copy link
Author

3rd line gives error:
The format is not the same on the right- and left-hand sides of the special token "..".

@herbelin
Copy link

herbelin commented Oct 6, 2019

The explicit boxes around T1, T2 and Tn are not needed. There is always a default hov box around any notation as soon as it is liable to be broken over several lines.

Maybe Coq could warn when seeing such '[' T1 ']'?

@Blaisorblade
Copy link
Author

A warning would help. I also didn't find this in the docs about defaulting, but a warning is easier to understand anyway :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment