Require Export ListFunctions.
Set Implicit Arguments.
Unset Strict Implicit.
(*Definition of security class, and its standard partial order.      *)
(* SECLEV: security levels CATEGORY: categories, departments or need-to-know *)
Definition SECLEV := nat.
Parameter CATEGORY : Set.
(*SecClass: security class or access class*)
Record SecClass : Set := sclass {level : SECLEV; categs : set CATEGORY}.
Definition eq_sc (a b : SecClass) : Prop :=
level a = level b /\ categs a = categs b.
Definition le_sc (a b : SecClass) : Prop :=
level a <= level b /\ Included (categs a) (categs b).
Hint Unfold eq_sc le_sc.
(*********************************************************************)
(*                  Security Policy Subjects                         *)
(*********************************************************************)
(*This are global parameters introducing the basic sets of the model.*)
(* SUBJECT: all the subjects of the system GRPNAME: all the group names of the system root: UNIX superuser secofr: security officer, in charge of MAC attributes *)
Parameter SUBJECT GRPNAME : Set.
Parameter root secofr : SUBJECT.
(*These axioms are needed by functions of ListSet.                   *)
Hint Resolve SUBeq_dec GRPeq_dec.
(*********************************************************************)
(*                         The Filesystem                            *)
(*********************************************************************)
(* OBJNAME: all the possible absolute path names for files and directories BYTE: elements that can be stored in a file *)
Parameter OBJNAME BYTE : Set.
Hint Resolve OBJNAMEeq_dec BYTEeq_dec.
(*OBJTYPE: used to distinguish between files and directories*)
Inductive OBJTYPE : Set :=
| File : OBJTYPE
| Directory : OBJTYPE.
intros.
elim x; elim y.
left; auto.
right; intro; discriminate H.
right; intro; discriminate H.
left; auto.
Qed.
Hint Resolve OBJTYPEeq_dec.
(*FILECONT: all the possible contents of files*)
Definition FILECONT := list BYTE.
unfold FILECONT in |- *; intros; apply Listeq_dec.
auto.
Qed.
Hint Resolve FILECONTeq_dec.
(*DIRCONT: all the possible contents of directories*)
Definition DIRCONT := list OBJNAME.
unfold DIRCONT in |- *; intros; apply Listeq_dec.
auto.
Qed.
Hint Resolve DIRCONTeq_dec.
Definition OBJECT := (OBJNAME * OBJTYPE)%type.

Lemma OBJeq_dec : forall x y : OBJECT, {x = y} + {x <> y}.