# HG changeset patch # User wenzelm # Date 1430402863 -7200 # Node ID 52aa014308cb1d3176d3b4961677976d65657282 # Parent 879918f4ee0ff4f3c7430baa2d3acff54229484e more formal source, more PIDE markup; diff -r 879918f4ee0f -r 52aa014308cb src/HOL/List.thy --- a/src/HOL/List.thy Thu Apr 30 15:58:15 2015 +0200 +++ b/src/HOL/List.thy Thu Apr 30 16:07:43 2015 +0200 @@ -486,35 +486,38 @@ ML_val {* let - val read = Syntax.read_term @{context}; - fun check s1 s2 = read s1 aconv read s2 orelse error ("Check failed: " ^ quote s1); + val read = Syntax.read_term @{context} o Syntax.implode_input; + fun check s1 s2 = + read s1 aconv read s2 orelse + error ("Check failed: " ^ + quote (Input.source_content s1) ^ Position.here_list [Input.pos_of s1, Input.pos_of s2]); in - check "[(x,y,z). b]" "if b then [(x, y, z)] else []"; - check "[(x,y,z). x\xs]" "map (\x. (x, y, z)) xs"; - check "[e x y. x\xs, y\ys]" "concat (map (\x. map (\y. e x y) ys) xs)"; - check "[(x,y,z). xb]" "if x < a then if b < x then [(x, y, z)] else [] else []"; - check "[(x,y,z). x\xs, x>b]" "concat (map (\x. if b < x then [(x, y, z)] else []) xs)"; - check "[(x,y,z). xxs]" "if x < a then map (\x. (x, y, z)) xs else []"; - check "[(x,y). Cons True x \ xs]" - "concat (map (\xa. case xa of [] \ [] | True # x \ [(x, y)] | False # x \ []) xs)"; - check "[(x,y,z). Cons x [] \ xs]" - "concat (map (\xa. case xa of [] \ [] | [x] \ [(x, y, z)] | x # aa # lista \ []) xs)"; - check "[(x,y,z). xb, x=d]" - "if x < a then if b < x then if x = d then [(x, y, z)] else [] else [] else []"; - check "[(x,y,z). xb, y\ys]" - "if x < a then if b < x then map (\y. (x, y, z)) ys else [] else []"; - check "[(x,y,z). xxs,y>b]" - "if x < a then concat (map (\x. if b < y then [(x, y, z)] else []) xs) else []"; - check "[(x,y,z). xxs, y\ys]" - "if x < a then concat (map (\x. map (\y. (x, y, z)) ys) xs) else []"; - check "[(x,y,z). x\xs, x>b, yx. if b < x then if y < a then [(x, y, z)] else [] else []) xs)"; - check "[(x,y,z). x\xs, x>b, y\ys]" - "concat (map (\x. if b < x then map (\y. (x, y, z)) ys else []) xs)"; - check "[(x,y,z). x\xs, y\ys,y>x]" - "concat (map (\x. concat (map (\y. if x < y then [(x, y, z)] else []) ys)) xs)"; - check "[(x,y,z). x\xs, y\ys,z\zs]" - "concat (map (\x. concat (map (\y. map (\z. (x, y, z)) zs) ys)) xs)" + check \[(x,y,z). b]\ \if b then [(x, y, z)] else []\; + check \[(x,y,z). x\xs]\ \map (\x. (x, y, z)) xs\; + check \[e x y. x\xs, y\ys]\ \concat (map (\x. map (\y. e x y) ys) xs)\; + check \[(x,y,z). xb]\ \if x < a then if b < x then [(x, y, z)] else [] else []\; + check \[(x,y,z). x\xs, x>b]\ \concat (map (\x. if b < x then [(x, y, z)] else []) xs)\; + check \[(x,y,z). xxs]\ \if x < a then map (\x. (x, y, z)) xs else []\; + check \[(x,y). Cons True x \ xs]\ + \concat (map (\xa. case xa of [] \ [] | True # x \ [(x, y)] | False # x \ []) xs)\; + check \[(x,y,z). Cons x [] \ xs]\ + \concat (map (\xa. case xa of [] \ [] | [x] \ [(x, y, z)] | x # aa # lista \ []) xs)\; + check \[(x,y,z). xb, x=d]\ + \if x < a then if b < x then if x = d then [(x, y, z)] else [] else [] else []\; + check \[(x,y,z). xb, y\ys]\ + \if x < a then if b < x then map (\y. (x, y, z)) ys else [] else []\; + check \[(x,y,z). xxs,y>b]\ + \if x < a then concat (map (\x. if b < y then [(x, y, z)] else []) xs) else []\; + check \[(x,y,z). xxs, y\ys]\ + \if x < a then concat (map (\x. map (\y. (x, y, z)) ys) xs) else []\; + check \[(x,y,z). x\xs, x>b, y + \concat (map (\x. if b < x then if y < a then [(x, y, z)] else [] else []) xs)\; + check \[(x,y,z). x\xs, x>b, y\ys]\ + \concat (map (\x. if b < x then map (\y. (x, y, z)) ys else []) xs)\; + check \[(x,y,z). x\xs, y\ys,y>x]\ + \concat (map (\x. concat (map (\y. if x < y then [(x, y, z)] else []) ys)) xs)\; + check \[(x,y,z). x\xs, y\ys,z\zs]\ + \concat (map (\x. concat (map (\y. map (\z. (x, y, z)) zs) ys)) xs)\ end; *}