2345 | Free (Name, Typ) |
2345 | Free (Name, Typ) |
2346 | Var (Indexname, Typ) |
2346 | Var (Indexname, Typ) |
2347 | Bound Int |
2347 | Bound Int |
2348 | Abs (Name, Typ, Term) |
2348 | Abs (Name, Typ, Term) |
2349 | App (Term, Term) |
2349 | App (Term, Term) |
|
2350 | OFCLASS (Typ, Name) |
2350 deriving (Show, Eq, Ord) |
2351 deriving (Show, Eq, Ord) |
2351 |
2352 |
2352 |
2353 |
2353 {- free and bound variables -} |
2354 {- free and bound variables -} |
2354 |
2355 |
2679 [\case { Const (a, b) -> Just ([a], list typ b); _ -> Nothing }, |
2680 [\case { Const (a, b) -> Just ([a], list typ b); _ -> Nothing }, |
2680 \case { Free (a, b) -> Just ([a], typ_body b); _ -> Nothing }, |
2681 \case { Free (a, b) -> Just ([a], typ_body b); _ -> Nothing }, |
2681 \case { Var (a, b) -> Just (indexname a, typ_body b); _ -> Nothing }, |
2682 \case { Var (a, b) -> Just (indexname a, typ_body b); _ -> Nothing }, |
2682 \case { Bound a -> Just ([], int a); _ -> Nothing }, |
2683 \case { Bound a -> Just ([], int a); _ -> Nothing }, |
2683 \case { Abs (a, b, c) -> Just ([a], pair typ term (b, c)); _ -> Nothing }, |
2684 \case { Abs (a, b, c) -> Just ([a], pair typ term (b, c)); _ -> Nothing }, |
2684 \case { App a -> Just ([], pair term term a); _ -> Nothing }] |
2685 \case { App a -> Just ([], pair term term a); _ -> Nothing }, |
|
2686 \case { OFCLASS (a, b) -> Just ([b], typ a); _ -> Nothing }] |
2685 \<close> |
2687 \<close> |
2686 |
2688 |
2687 generate_file "Isabelle/Term_XML/Decode.hs" = \<open> |
2689 generate_file "Isabelle/Term_XML/Decode.hs" = \<open> |
2688 {- Title: Isabelle/Term_XML/Decode.hs |
2690 {- Title: Isabelle/Term_XML/Decode.hs |
2689 Author: Makarius |
2691 Author: Makarius |
2728 [\([a], b) -> Const (a, list typ b), |
2730 [\([a], b) -> Const (a, list typ b), |
2729 \([a], b) -> Free (a, typ_body b), |
2731 \([a], b) -> Free (a, typ_body b), |
2730 \(a, b) -> Var (indexname a, typ_body b), |
2732 \(a, b) -> Var (indexname a, typ_body b), |
2731 \([], a) -> Bound (int a), |
2733 \([], a) -> Bound (int a), |
2732 \([a], b) -> let (c, d) = pair typ term b in Abs (a, c, d), |
2734 \([a], b) -> let (c, d) = pair typ term b in Abs (a, c, d), |
2733 \([], a) -> App (pair term term a)] |
2735 \([], a) -> App (pair term term a), |
|
2736 \([a], b) -> OFCLASS (typ b, a)] |
2734 \<close> |
2737 \<close> |
2735 |
2738 |
2736 generate_file "Isabelle/XML/Classes.hs" = \<open> |
2739 generate_file "Isabelle/XML/Classes.hs" = \<open> |
2737 {- generated by Isabelle -} |
2740 {- generated by Isabelle -} |
2738 |
2741 |