Subsection 6.2.5 Business Policies and Database Constraints
We’ve already seen some examples of the use of logic to describe business policies and procedures (which, if I’m the boss, I get to write). Again, the win of logic is that it is completely unambiguous. No wishful thinking allowed.
For example, let’s describe our policy for issuing loans. Define:
Approved(x): True if x is an approved loan.
Super(x): True if x is a supervising loan officer.
Signed(y, x): True if y has signed off on loan x.
Then we can write:
x ((Loan(x) Approved(x)) (y (z (Super(y) Signed(y, x) Signed(z, x) (y = z)))))
Read this as, “Every approved loan has been signed off on by two (different) people, at least one of whom is a supervising loan officer.”
Exercises Exercises
Exercise Group.
1. Suppose that we are the Human Resources department of a large company. We want to provide an explicit statement of our company’s personnel policies. We want to write down even things that might seem obvious to you. Define:
Supervises(x, y): True if x is the supervisor of y.
CEO(x): True if x is the CEO of the company.
Super(x): True if x holds the title of supervisor.
1.
(Part 1) Which (one or more) of the following logical expressions best correspond(s) to the policy:
Everyone except, of course, the CEO has a supervisor.
I. ∀x (¬CEO(x) → ∃y (Supervises(y, x)))
II. ∀x ((¬CEO(x) → ∃y (Supervises(y, x))) ∧ (CEO(x) → ¬∃y (Supervises(y, x))))
III. ∀x (∀y (CEO(x) → ¬Supervises(y, x)))
Just I.
Just II.
Just III.
I and III
2.
(Part 2) Which (one or more) of the following logical expressions correspond(s) to the policy:
No one may be his/her own supervisor.
I. ∀x (∀y (Supervises(x, y) → ¬(x = y)))
II. ∀x (¬∃y (Supervises(x, y) ∧ (x = y)))
III. ¬∃y (∀x (Supervises(x, y) ∧ (x = y)))
Just I.
Just II.
Just III.
I and III
II and III
3.
(Part 3) Which (one ore more) of the following logical expressions correspond(s) to the policy:
Every supervisor must have at least one employee reporting to him/her.
I. ∀x (∀y (Super(x) → Supervises(x, y)))
II. ∀x (Super(x) → ∃y (Supervises(x, y)))
III. ∀x (∀y (Super(x) → ¬Supervises(x, y)))
Just I.
Just II.
Just III.
I and III
II and III
Exercises Exercises
1.
2. We have a corporate policy that says that anyone who’s been caught stealing twice doesn’t work here anymore. Define:
SEvent(e, x): True if e is the unique identifier of a stealing event and x was a
perpetrator of the event.
Employee(x): True if x works for the company.
Which (one or more) of the following logical expressions correspond(s) to our policy:
I. ∃d (∃e (∀x (SEvent(d, x) ∧ SEvent(e, x) ∧ ¬(e = d))) → ¬Employee(x))
II. ∀x (∃d (∃e (SEvent(d, x) ∧ SEvent(e, x))) → ¬Employee(x))
III. ∀x (∃d (∃e (SEvent(d, x) ∧ SEvent(e, x) ∧ ¬(e = d))) → ¬Employee(x))
Just I.
Just II.
Just III.
I and III
II and III
3.
3. Suppose, in the interest of safety, we wish to enforce the following policy:
Every department has at least two EMT-trained supervisors.
Define:
Dept(x): True if x is a department within the company.
Super(x): True if x holds the title of supervisor.
HasTraining(x, y): True if x has been trained in area y.
WorksInDept(x, y): True if x works in department y.
Using these predicates, write out a logical statement that corresponds to our claim. Which of these statements is correct:
I. ∃y, z (Super(y) ∧ Super(z) ∧ ¬(y = z) ∧ (∀x (Dept(x) ∧ WorksInDept(y, x) ∧
WorksInDept(z, x) ∧ HasTraining(y, EMT) ∧ HasTraining(z, EMT))))
II. ∀x (Dept(x) ∧ (∃y, z (Super(y) ∧ Super(z) ∧ ¬(y = z) ∧ WorksInDept(x, y) ∧
WorksInDept(x, z) ∧ HasTraining(y, EMT) ∧ HasTraining(z, EMT))))
III. ∀x (Dept(x) → (∃y, z (Super(y) ∧ Super(z) ∧ ¬(y = z) ∧ WorksInDept(y, x) ∧
WorksInDept(z, x) ∧ HasTraining(y, EMT) ∧ HasTraining(z, EMT))))
IV. ∃y, z (Dept(x) ∧ Super(y) ∧ Super(z) ∧ ¬(y = z) ∧ WorksInDept(y, x) ∧
WorksInDept(z, x) ∧ HasTraining(y, EMT) ∧ HasTraining(z, EMT))
V. ∃y, z (∀x (Dept(x) ∧ Super(y) ∧ Super(z) ∧ ¬(y = z) ∧ WorksInDept(y, x) ∧
WorksInDept(z, x) ∧ HasTraining(y, EMT) ∧ HasTraining(z, EMT)))
I.
II.
III.
IV
V