src/HOL/Unix/Unix.thy
changeset 25974 0cb35fa9c6fa
parent 25706 45d090186bbe
child 36504 7cc639e20cb2
equal deleted inserted replaced
25973:4a584b094aba 25974:0cb35fa9c6fa
   301   model never mentions processes explicitly.  The other parameters are
   301   model never mentions processes explicitly.  The other parameters are
   302   provided as arguments by the caller; the @{term path} one is common
   302   provided as arguments by the caller; the @{term path} one is common
   303   to all kinds of system-calls.
   303   to all kinds of system-calls.
   304 *}
   304 *}
   305 
   305 
   306 consts
   306 primrec
   307   uid_of :: "operation \<Rightarrow> uid"
   307   uid_of :: "operation \<Rightarrow> uid"
       
   308 where
       
   309     "uid_of (Read uid text path) = uid"
       
   310   | "uid_of (Write uid text path) = uid"
       
   311   | "uid_of (Chmod uid perms path) = uid"
       
   312   | "uid_of (Creat uid perms path) = uid"
       
   313   | "uid_of (Unlink uid path) = uid"
       
   314   | "uid_of (Mkdir uid path perms) = uid"
       
   315   | "uid_of (Rmdir uid path) = uid"
       
   316   | "uid_of (Readdir uid names path) = uid"
       
   317 
   308 primrec
   318 primrec
   309   "uid_of (Read uid text path) = uid"
       
   310   "uid_of (Write uid text path) = uid"
       
   311   "uid_of (Chmod uid perms path) = uid"
       
   312   "uid_of (Creat uid perms path) = uid"
       
   313   "uid_of (Unlink uid path) = uid"
       
   314   "uid_of (Mkdir uid path perms) = uid"
       
   315   "uid_of (Rmdir uid path) = uid"
       
   316   "uid_of (Readdir uid names path) = uid"
       
   317 
       
   318 consts
       
   319   path_of :: "operation \<Rightarrow> path"
   319   path_of :: "operation \<Rightarrow> path"
   320 primrec
   320 where
   321   "path_of (Read uid text path) = path"
   321     "path_of (Read uid text path) = path"
   322   "path_of (Write uid text path) = path"
   322   | "path_of (Write uid text path) = path"
   323   "path_of (Chmod uid perms path) = path"
   323   | "path_of (Chmod uid perms path) = path"
   324   "path_of (Creat uid perms path) = path"
   324   | "path_of (Creat uid perms path) = path"
   325   "path_of (Unlink uid path) = path"
   325   | "path_of (Unlink uid path) = path"
   326   "path_of (Mkdir uid perms path) = path"
   326   | "path_of (Mkdir uid perms path) = path"
   327   "path_of (Rmdir uid path) = path"
   327   | "path_of (Rmdir uid path) = path"
   328   "path_of (Readdir uid names path) = path"
   328   | "path_of (Readdir uid names path) = path"
   329 
   329 
   330 text {*
   330 text {*
   331   \medskip Note that we have omitted explicit @{text Open} and @{text
   331   \medskip Note that we have omitted explicit @{text Open} and @{text
   332   Close} operations, pretending that @{term Read} and @{term Write}
   332   Close} operations, pretending that @{term Read} and @{term Write}
   333   would already take care of this behind the scenes.  Thus we have
   333   would already take care of this behind the scenes.  Thus we have