equal
deleted
inserted
replaced
62 Its second premise expresses that in @{term"map f xs"}, |
62 Its second premise expresses that in @{term"map f xs"}, |
63 function @{term"f"} is only applied to elements of list @{term"xs"}. Congruence |
63 function @{term"f"} is only applied to elements of list @{term"xs"}. Congruence |
64 rules for other higher-order functions on lists are similar. If you get |
64 rules for other higher-order functions on lists are similar. If you get |
65 into a situation where you need to supply \isacommand{recdef} with new |
65 into a situation where you need to supply \isacommand{recdef} with new |
66 congruence rules, you can append a hint after the end of |
66 congruence rules, you can append a hint after the end of |
67 the recursion equations: |
67 the recursion equations:\cmmdx{hints} |
68 *} |
68 *} |
69 (*<*) |
69 (*<*) |
70 consts dummy :: "nat => nat" |
70 consts dummy :: "nat => nat" |
71 recdef dummy "{}" |
71 recdef dummy "{}" |
72 "dummy n = n" |
72 "dummy n = n" |
82 |
82 |
83 text{* |
83 text{* |
84 The @{text cong} and @{text recdef_cong} attributes are |
84 The @{text cong} and @{text recdef_cong} attributes are |
85 intentionally kept apart because they control different activities, namely |
85 intentionally kept apart because they control different activities, namely |
86 simplification and making recursive definitions. |
86 simplification and making recursive definitions. |
87 % The local @{text cong} in |
|
88 % the hints section of \isacommand{recdef} is merely short for @{text recdef_cong}. |
|
89 %The simplifier's congruence rules cannot be used by recdef. |
87 %The simplifier's congruence rules cannot be used by recdef. |
90 %For example the weak congruence rules for if and case would prevent |
88 %For example the weak congruence rules for if and case would prevent |
91 %recdef from generating sensible termination conditions. |
89 %recdef from generating sensible termination conditions. |
92 *} |
90 *} |
93 (*<*)end(*>*) |
91 (*<*)end(*>*) |