[roles] Admin Agent Doctor Employee Manager MedicalManager MedicalTeam Nurse Patient PatientWithTPC PrimaryDoctor Receptionist ReferredDoctor ThirdParty target [admins] Doctor MedicalManager Manager Patient Receptionist ThirdParty Admin [relations] Employee < Nurse Employee < Doctor Employee < Receptionist Employee < MedicalManager Employee < Manager [can_assigns] can_assign(Admin, Patient and PrimaryDoctor, target) can_assign(Doctor, true , ThirdParty ) can_assign(Manager, true , Employee ) can_assign(Manager, true , MedicalManager ) can_assign(Manager, true , Nurse ) can_assign(Patient, true , Agent ) can_assign(Doctor, new , ThirdParty ) can_assign(Manager, new , Employee ) can_assign(Manager, new , MedicalManager ) can_assign(Manager, new , Nurse ) can_assign(Patient, new , Agent ) can_assign(Doctor, Doctor , ReferredDoctor ) can_assign(MedicalManager, Doctor , MedicalTeam ) can_assign(MedicalManager, Nurse , MedicalTeam ) can_assign(Manager, not Doctor , Receptionist ) can_assign(Manager, not Receptionist , Doctor ) can_assign(Patient, Doctor and not Patient , PrimaryDoctor ) can_assign(Receptionist, not PrimaryDoctor , Patient ) can_assign(ThirdParty, Patient , PatientWithTPC ) [can_revokes] can_revoke(Doctor, ThirdParty) can_revoke(Doctor, ReferredDoctor) can_revoke(MedicalManager, MedicalTeam) can_revoke(MedicalManager, MedicalTeam) can_revoke(Manager, Employee) can_revoke(Manager, MedicalManager) can_revoke(Manager, Receptionist) can_revoke(Manager, Nurse) can_revoke(Manager, Doctor) can_revoke(Patient, Agent) can_revoke(Patient, PrimaryDoctor) can_revoke(Doctor, Patient) can_revoke(ThirdParty, PatientWithTPC) [goal] target [present] 1 Doctor 1 MedicalManager 1 Manager 1 Patient 1 Receptionist 1 Admin 1 Nurse 1 PrimaryDoctor [query] n_target>0 test whether a user can be explicitly both in Patient and PrimaryDoctor roles. Role admin is inserted to add the query needed for reachability. It is an administrative role always in the system (present and notRevocable) Rule added for reachability: can_assign(Admin, Patient and PrimaryDoctor, target)