Ticket #353: Second_Steps.thy

File Second_Steps.thy, 493 bytes (added by nils, 14 years ago)
Line 
1theory Second_Steps imports Main
2begin
3ML{*
4val pretty_term = Syntax.pretty_term
5val pwriteln = Pretty.writeln
6fun pretty_terms ctxt ts =
7Pretty.block
8(Pretty.commas (map (pretty_term ctxt) ts))
9*}
10(* Chapter 3 *)
11(* Section 1: Terms and Types *)
12ML{*@{term "(a::nat) + b = c"}*}
13ML{*@{term "\<lambda>x y. x y"}*}
14ML{*let
15val v1 = Var (("x", 3), @{typ bool})
16val v2 = Var (("x1", 3), @{typ bool})
17val v3 = Free ("x", @{typ bool})
18in
19pretty_terms @{context} [v1, v2, v3]
20|> pwriteln
21end*}
22end