1 (* Title: tests for ListC
2 Author: Walther Neuper 030501
3 (c) copyright due to lincense terms.
8 "--------------------- nth_ ----------------------------------------------";
9 "--------------------- nth_ ----------------------------------------------";
10 "--------------------- nth_ ----------------------------------------------";
11 val t = str2term "nth_ 3 [a,b,c,d,e]";
13 val thm = (#prop o rep_thm o num_str) @{thm NTH_CONS};
15 val SOME (t',_) = rewrite_ thy dummy_ord Poly_erls false (num_str @{thm NTH_CONS}) t;
16 if term2str t' = "nth_ (3 + - 1) [b, c, d, e]" then ()
17 else error "list_rls.sml, nth_ (3 + - 1) [b, c, d, e]";
19 val t = str2term "nth_ 1 [a,b,c,d,e]";
21 val thm = (#prop o rep_thm o num_str) @{thm NTH_NIL};
23 val SOME (t',_) = rewrite_ thy dummy_ord Poly_erls false (num_str @{thm NTH_NIL}) t;
27 val t = str2term "nth_ 3 [a,b,c,d,e]";
30 val SOME (t',_) = rewrite_set_ thy false list_rls t;
35 (*-------------------------------------------------------------------*)
36 val SOME (Thm (_,thm)) = rls_get_thm list_rls "NTH_NIL";
37 val ttt = (#prop o rep_thm) thm;
39 (*Free ( 1, real) ...OK, Var ((x, 0), ?'a) OK*)
43 "--------------------- length_ -------------------------------------------";
44 "--------------------- length_ -------------------------------------------";
45 "--------------------- length_ -------------------------------------------";
47 val ct = "length_ [1,1,1]";
48 val thm = (@{thm LENGTH_CONS},"");
49 val (ct,asm) = the (rewrite thy' "tless_true" ("tval_rls") false thm ct);
50 val (ct,asm) = the (rewrite thy' "tless_true" ("tval_rls") false thm ct);
51 val (ct,asm) = the (rewrite thy' "tless_true" ("tval_rls") false thm ct);
52 val thm = (@{thm LENGTH_NIL},"");
53 val (ct,asm) = the (rewrite thy' "tless_true" ("tval_rls") false thm ct);
54 if ct="1 + (1 + (1 + 0))"then()
55 else error ("list_rls.sml 1: behaviour of test-expl changed: "^ct);
58 val ct = "length_ [1,1,1]";
60 val (ct,asm) = the (rewrite_set thy' false rls ct);
62 else error ("list_rls.sml 2: behaviour of test-expl changed: "^ct);
65 val ct = "length_ [1,1,1]";
66 val t = (term_of o the o (parse ListG.thy)) ct;
67 val t = eval_listexpr_ ListG.thy list_rls t;
68 case t of Free ("3",_) => ()
69 | _ => error ("list-rls.sml 3: behaviour of test-expl changed: "^ct);