diff -r 1a1df29d3507 -r d9dc04c3ea90 no_shm_selinux/Static.thy --- a/no_shm_selinux/Static.thy Wed Jan 08 18:40:38 2014 +0800 +++ b/no_shm_selinux/Static.thy Thu Jan 09 14:39:00 2014 +0800 @@ -99,38 +99,30 @@ | _ \ None)" *) -fun init_obj2sobj :: "t_object \ t_sobject option" +fun init_obj2sobj :: "t_dobject \ t_sobject option" where - "init_obj2sobj (O_proc p) = + "init_obj2sobj (D_proc p) = (case (init_cp2sproc p) of Some sp \ Some (S_proc sp (O_proc p \ seeds)) | _ \ None)" -| "init_obj2sobj (O_file f) = +| "init_obj2sobj (D_file f) = Some (S_file (init_cf2sfiles f) (\ f'. f' \ (init_same_inode_files f) \ O_file f \ seeds))" -| "init_obj2sobj (O_dir f) = +| "init_obj2sobj (D_dir f) = (case (init_cf2sfile f) of Some sf \ Some (S_dir sf) | _ \ None)" -| "init_obj2sobj (O_msgq q) = None" - -(* - (case (init_cq2smsgq q) of - Some sq \ Some (S_msgq sq) - | _ \ None)" +| "init_obj2sobj (D_msgq q) = None" -| "init_obj2sobj (O_shm h) = - (case (init_ch2sshm h) of - Some sh \ Some (S_shm sh) - | _ \ None)" -| "init_obj2sobj (O_msg q m) = - (case (init_cq2smsgq q, init_cm2smsg q m) of - (Some sq, Some sm) \ Some (S_msg sq sm) - | _ \ None)" *) -| "init_obj2sobj _ = None" +fun init_dalive :: "t_dobject \ bool" +where + "init_dalive (D_proc p) = (p \ init_procs)" +| "init_dalive (D_file f) = (is_init_file f)" +| "init_dalive (D_dir f) = (is_init_dir f)" +| "init_dalive (D_msgq q) = False" definition - "init_static_state \ {sobj. \ obj. init_alive obj \ init_obj2sobj obj = Some sobj}" + "init_static_state \ {sobj. \ obj. init_dalive obj \ init_obj2sobj obj = Some sobj}" (**************** translation from dynamic to static *******************) @@ -227,39 +219,33 @@ (Some sec, Some sms) \ Some (Created, sec, sms) | _ \ None)" -fun co2sobj :: "t_state \ t_object \ t_sobject option" +fun co2sobj :: "t_state \ t_dobject \ t_sobject option" where - "co2sobj s (O_proc p) = + "co2sobj s (D_proc p) = (case (cp2sproc s p) of Some sp \ Some (S_proc sp (O_proc p \ tainted s)) | _ \ None)" -| "co2sobj s (O_file f) = +| "co2sobj s (D_file f) = Some (S_file (cf2sfiles s f) (O_file f \ tainted s))" -| "co2sobj s (O_dir f) = +| "co2sobj s (D_dir f) = (case (cf2sfile s f) of Some sf \ Some (S_dir sf) | _ \ None)" -| "co2sobj s (O_msgq q) = +| "co2sobj s (D_msgq q) = (case (cq2smsgq s q) of Some sq \ Some (S_msgq sq) | _ \ None)" -(* -| "co2sobj s (O_shm h) = - (case (ch2sshm s h) of - Some sh \ Some (S_shm sh) - | _ \ None)" -| "co2sobj s (O_msg q m) = - (case (cq2smsgq s q, cm2smsg s q m) of - (Some sq, Some sm) \ Some (S_msg sq sm) - | _ \ None)" -*) -| "co2sobj s _ = None" - +fun dalive :: "t_state \ t_dobject \ bool" +where + "dalive s (D_proc p) = (p \ current_procs s)" +| "dalive s (D_file f) = (is_file s f)" +| "dalive s (D_dir f) = (is_dir s f)" +| "dalive s (D_msgq q) = (q \ current_msgqs s)" definition s2ss :: "t_state \ t_static_state" where - "s2ss s \ {sobj. \ obj. alive s obj \ co2sobj s obj = Some sobj}" + "s2ss s \ {sobj. \ obj. dalive s obj \ co2sobj s obj = Some sobj}" (* ******************************************************** *)