src/HOL/BCV/Plus.ML
author paulson
Thu, 28 Oct 1999 14:55:23 +0200
changeset 7961 422ac6888c7f
parent 7626 5997f35954d7
permissions -rw-r--r--
expandshort
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7626
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     1
(*  Title:      HOL/BCV/Plus.ML
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     2
    ID:         $Id$
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     3
    Author:     Tobias Nipkow
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     4
    Copyright   1999 TUM
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     5
*)
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     6
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     7
(** option **)
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     8
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     9
Goalw [plus_option] "x+None = x";
7961
422ac6888c7f expandshort
paulson
parents: 7626
diff changeset
    10
by (simp_tac (simpset() addsplits [option.split]) 1);
7626
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    11
qed "plus_None";
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    12
Addsimps [plus_None];
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    13
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    14
Goalw [plus_option] "None+x = x";
7961
422ac6888c7f expandshort
paulson
parents: 7626
diff changeset
    15
by (simp_tac (simpset() addsplits [option.split]) 1);
7626
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    16
qed "None_plus";
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    17
Addsimps [None_plus];
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    18
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    19
Goalw [plus_option] "Some x + Some y = Some(x+y)";
7961
422ac6888c7f expandshort
paulson
parents: 7626
diff changeset
    20
by (Simp_tac 1);
7626
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    21
qed "Some_plus_Some";
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    22
Addsimps [Some_plus_Some];
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    23
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    24
Goalw [plus_option] "? y. Some x + opt = Some y";
7961
422ac6888c7f expandshort
paulson
parents: 7626
diff changeset
    25
by (simp_tac (simpset() addsplits [option.split]) 1);
7626
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    26
qed "plus_option_Some_Some";
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    27
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    28
(** list **)
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    29
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    30
Goal "list_plus xs [] = xs";
7961
422ac6888c7f expandshort
paulson
parents: 7626
diff changeset
    31
by (induct_tac "xs" 1);
422ac6888c7f expandshort
paulson
parents: 7626
diff changeset
    32
 by (Simp_tac 1);
422ac6888c7f expandshort
paulson
parents: 7626
diff changeset
    33
by (asm_simp_tac (simpset() addsplits [list.split]) 1);
7626
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    34
qed "list_plus_Nil2";
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    35
Addsimps [list_plus_Nil2];
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    36
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    37
Goal "!ys. length(list_plus xs ys) = max(length xs) (length ys)";
7961
422ac6888c7f expandshort
paulson
parents: 7626
diff changeset
    38
by (induct_tac "xs" 1);
422ac6888c7f expandshort
paulson
parents: 7626
diff changeset
    39
 by (Simp_tac 1);
422ac6888c7f expandshort
paulson
parents: 7626
diff changeset
    40
by (asm_simp_tac (simpset() addsplits [list.split]) 1);
7626
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    41
qed_spec_mp "length_list_plus";
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    42
Addsimps [length_list_plus];
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    43
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    44
Goalw [plus_list]
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    45
 "length(ts+us) = max (length ts) (length us)";
7961
422ac6888c7f expandshort
paulson
parents: 7626
diff changeset
    46
by (Simp_tac 1);
7626
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    47
qed "length_plus_list";
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    48
Addsimps [length_plus_list];