src/HOL/Auth/Event.thy
author paulson
Mon Jul 14 12:47:21 1997 +0200 (1997-07-14)
changeset 3519 ab0a9fbed4c0
parent 3512 9dcb4daa15e8
child 3678 414e04d7c2d6
permissions -rw-r--r--
Changing "lost" from a parameter of protocol definitions to a constant.

Advantages: no "lost" argument everywhere; fewer Vars in subgoals;
less need for specially instantiated rules
Disadvantage: can no longer prove "Agent_not_see_encrypted_key", but this
theorem was never used, and its original proof was also broken
the introduction of the "Notes" constructor.
paulson@3512
     1
(*  Title:      HOL/Auth/Event
paulson@3512
     2
    ID:         $Id$
paulson@3512
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@3512
     4
    Copyright   1996  University of Cambridge
paulson@3512
     5
paulson@3512
     6
Theory of events for security protocols
paulson@3512
     7
paulson@3512
     8
Datatype of events; function "sees"; freshness
paulson@3512
     9
*)
paulson@3512
    10
paulson@3512
    11
Event = Message + List + 
paulson@3512
    12
paulson@3512
    13
consts  (*Initial states of agents -- parameter of the construction*)
paulson@3519
    14
  initState :: agent => msg set
paulson@3512
    15
paulson@3512
    16
datatype  (*Messages--could add another constructor for agent knowledge*)
paulson@3512
    17
  event = Says  agent agent msg
paulson@3512
    18
        | Notes agent       msg
paulson@3512
    19
paulson@3512
    20
consts  
paulson@3512
    21
  sees1 :: [agent, event] => msg set
paulson@3512
    22
paulson@3512
    23
primrec sees1 event
paulson@3512
    24
           (*Spy reads all traffic whether addressed to him or not*)
paulson@3512
    25
  sees1_Says  "sees1 A (Says A' B X)  = (if A:{B,Spy} then {X} else {})"
paulson@3512
    26
  sees1_Notes "sees1 A (Notes A' X)   = (if A = A'    then {X} else {})"
paulson@3512
    27
paulson@3512
    28
consts  
paulson@3519
    29
  lost :: agent set        (*agents whose private keys have been compromised*)
paulson@3519
    30
  sees :: [agent, event list] => msg set
paulson@3519
    31
paulson@3519
    32
rules
paulson@3519
    33
  (*Spy has access to his own key for spoof messages, but Server is secure*)
paulson@3519
    34
  Spy_in_lost     "Spy: lost"
paulson@3519
    35
  Server_not_lost "Server ~: lost"
paulson@3512
    36
paulson@3512
    37
primrec sees list
paulson@3519
    38
  sees_Nil  "sees A []       = initState A"
paulson@3519
    39
  sees_Cons "sees A (ev#evs) = sees1 A ev Un sees A evs"
paulson@3512
    40
paulson@3512
    41
constdefs
paulson@3512
    42
  (*Set of items that might be visible to somebody: complement of the set
paulson@3512
    43
        of fresh items*)
paulson@3512
    44
  used :: event list => msg set
paulson@3519
    45
    "used evs == parts (UN B. sees B evs)"
paulson@3512
    46
paulson@3512
    47
end