doc-src/TutorialI/Protocol/Public.thy
author huffman
Sat, 16 Sep 2006 19:12:03 +0200
changeset 20554 c433e78d4203
parent 16417 9bc16273c2d4
child 23925 ee98c2528a8f
permissions -rw-r--r--
define new constant of_real for class real_algebra_1; define set Reals as range of_real; add lemmas about of_real and Reals

(*  Title:      HOL/Auth/Public
    ID:         $Id$
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
    Copyright   1996  University of Cambridge

Theory of Public Keys (common to all public-key protocols)

Private and public keys; initial states of agents
*)

theory Public imports Event
uses ("Public_lemmas.ML") begin

consts
  pubK    :: "agent => key"

syntax
  priK    :: "agent => key"

translations  (*BEWARE! expressions like  (inj priK)  will NOT work!*)
  "priK x"  == "invKey(pubK x)"

primrec
        (*Agents know their private key and all public keys*)
  initState_Server:  "initState Server     =    
 		         insert (Key (priK Server)) (Key ` range pubK)"
  initState_Friend:  "initState (Friend i) =    
 		         insert (Key (priK (Friend i))) (Key ` range pubK)"
  initState_Spy:     "initState Spy        =    
 		         (Key`invKey`pubK`bad) Un (Key ` range pubK)"


axioms
  (*Public keys are disjoint, and never clash with private keys*)
  inj_pubK:        "inj pubK"
  priK_neq_pubK:   "priK A ~= pubK B"

use "Public_lemmas.ML"

(*Specialized methods*)

method_setup possibility = {*
    Method.no_args (Method.METHOD (fn facts => possibility_tac)) *}
    "for proving possibility theorems"

end