Skip to main content

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. ∀xCEO(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)))

  1. Just I.

  2. Just II.

  3. Just III.

  4. I and III

Answer.
Correct answer is B.
Solution.
Explanation: II is correct. It says that for every x, if x is not the CEO then he/she has a supervisor. And, if x is the CEO, he/she doesn’t. (It is possible that you read the policy to be noncommittal on the question of whether the CEO might have a supervisor. Most people read to say he/she does not.) I says only that if you’re not the CEO then you do have a supervisor. III says only that the CEO doesn’t have a supervisor. It says nothing about everyone else.
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)))

  1. Just I.

  2. Just II.

  3. Just III.

  4. I and III

  5. II and III

Answer.
Correct answer is D
Solution.
Explanation: Both I and II are correct. I says that, for any pair of objects, if one is the supervisor of the other then they are different. II says that, for all x, there doesn’t exist anyone whom x supervises and who is identical to x. III makes little sense. It says that there is no one with the property that everyone is that person’s supervisor and is the same as that person.
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)))

  1. Just I.

  2. Just II.

  3. Just III.

  4. I and III

  5. II and III

Answer.
Correct answer is B
Solution.
Explanation: II is correct. It says that anyone who is a supervisor supervises someone. I says that anyone who is a supervisor supervises everyone. III says that everyone who is a supervisor supervises no one.

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))

  1. Just I.

  2. Just II.

  3. Just III.

  4. I and III

  5. II and III

Answer.
Correct answer is C.
Solution.
Explanation: III is correct. The claim applies to all potential employees (values of x). If, for anyone, there exist two different stealing events, then that person no longer works at the company. II is wrong because it omits the requirement that e and d be different. Without that, there could be a single stealing event that could be bound to both d and e. I is wrong because the quantifiers are in the wrong order. In particular, notice that the last clause (Employee(x)) occurs outside the scope of the quantifier that binds x. So it isn’t even a logical statement.

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)))

  1. I.

  2. II.

  3. III.

  4. IV

  5. V

Answer.
Correct answer is C.
Solution.
Explanation: III is correct. I and V are wrong since they say that there exist supervisors who work in all departments. II has the arguments to WorksInDept backwards and it has an and where there should be an implies. IV has x unbound by any quantifier.