comparison src/MoreDep.v @ 416:ded318830bb0

Manual font choice for notation scope delimiters
author Adam Chlipala <adam@chlipala.net>
date Wed, 13 Jun 2012 11:14:00 -0400
parents f0f76356de9c
children 539ed97750bb
comparison
equal deleted inserted replaced
415:6df11326be05 416:ded318830bb0
213 | Nat => nat 213 | Nat => nat
214 | Bool => bool 214 | Bool => bool
215 | Prod t1 t2 => typeDenote t1 * typeDenote t2 215 | Prod t1 t2 => typeDenote t1 * typeDenote t2
216 end%type. 216 end%type.
217 217
218 (** The [typeDenote] function compiles types of our object language into %``%#"#native#"#%''% Coq types. It is deceptively easy to implement. The only new thing we see is the [%][type] annotation, which tells Coq to parse the [match] expression using the notations associated with types. Without this annotation, the [*] would be interpreted as multiplication on naturals, rather than as the product type constructor. The token [type] is one example of an identifer bound to a _notation scope_. In this book, we will not go into more detail on notation scopes, but the Coq manual can be consulted for more information. 218 (** The [typeDenote] function compiles types of our object language into %``%#"#native#"#%''% Coq types. It is deceptively easy to implement. The only new thing we see is the [%]%\coqdocvar{%#<tt>#type#</tt>#%}% annotation, which tells Coq to parse the [match] expression using the notations associated with types. Without this annotation, the [*] would be interpreted as multiplication on naturals, rather than as the product type constructor. The token %\coqdocvar{%#<tt>#type#</tt>#%}% is one example of an identifer bound to a%\index{notation scope delimiter}% _notation scope delimiter_. In this book, we will not go into more detail on notation scopes, but the Coq manual can be consulted for more information.
219 219
220 We can define a function [expDenote] that is typed in terms of [typeDenote]. *) 220 We can define a function [expDenote] that is typed in terms of [typeDenote]. *)
221 221
222 Fixpoint expDenote t (e : exp t) : typeDenote t := 222 Fixpoint expDenote t (e : exp t) : typeDenote t :=
223 match e with 223 match e with