Problem
Mr. Greenfan wants to give a dress party where all male guests are obliged wear green clothing. The following rules are imposed for every male guest:

Rule 1: If someone wears a green tie he has to wear a green shirt.

Rule 2: A guest may only combine green socks and a green shirt if he wears a green tie or a green hat.

Rule 3: A guest wearing a green shirt or a green hat or who does not wear green socks has to wear a green tie.

Rule 4: A guest who is not dressed according to rules 13 must pay 11 dollars to get in.
Mr Greenguest wants to participate but owns only a green shirt (otherwise he would have to buy one for 9 dollars). He could buy a green tie for 10, a green hat (used) for 2 and green socks for 12 dollars. What is the cheapest solution for Mr Greenguest to participate? (This problem is from [3].)
Modeling Steps
The problem can be formulated as a mathematical model by imposing Boolean (logical) constraints. Let’s introduce the following Boolean proposition symbols:

t means “Mr Greenguest must buy a green tie”,

h means “Mr Greenguest must buy a green hat”,

r means “Mr Greenguest must buy a green shirt”,

s means “Mr Greenguest must buy green socks”,

n means “Mr Greenguest is not costumed according to the rules 13 and must pay the entrance fee”.
Rule1 can be formulated as: t implies r. This is only true, if the person is dressed according to the rules. Hence t → r is true or n is true. That is, to fulfill this rule, the following statement must hold :
Rule2 means “Green socks and shirt together imply green tie or green hat”. Note that often the meaning of “…only … if…” can be simply interpreted as implication. In natural language it rarely means equivalence in logic. If we want to express equivalence, we normally say “if and only if”. Hence, the logical statement for Rule2 is :
Rule3 is easy: wearing a green shirt or a green hat or no wearing green socks implies wearing a green tie or the guest is not costumed according to the three rules :
Finally, we have the fact that Mr Greenguest already owns and wears a green shirt, which means that r is true.
The objective function minimizes the costs (note that the Boolean propositions can be interpreted as mathematical 01 variables):
model fancy "Fancy Dress Party";
binary variable t; h; r; s; n;
constraint
Rule1: (t>r) or n;
Rule2: ((s and r) > (t or h)) or n;
Rule3: ((r or h or ~s) > t) or n;
Guest: r;
minimize Cost: 10*t + 2*h + 12*s + 11*n;
Write('Mr Greenguest must buy %s.' n',
if(t,'a green tie', h,'a green hat',
s,'green socks', n,'an entrance ticket'));
Write('' n Total costs are: %3d', Cost);
end
Further Comments
In this model, mathematical and logical knowledge are mixed: The objective function is written in a mathematical way, the constraints are written in a logical notation. From a purely technical point of view, we can interpret a Boolean variable with the two possible values of true and false as a mathematical binary variable, that also has two possible values: zero and one. Zero indicates false while one indicates true.
In LPL, false always means zero and true always means notzero. Since the binaries only have two values: true means one.
Solution
In this example, it is easy to calculate the solution manually. To make Rule1 true, t must be true (since r is already true) or n must be true. It is cheaper to make t true. Rule2 and Rule3 are both true if t is true. It follows that Mr Greenguest must buy a tie for 10 dollars (to make t true).
Further Notes
Note how LPL translates this model into a purely linear mathematical model:
min: +11*n + 12*s + 2*h + 10*t Rule1: + r  t + n >= 0; Rule2: + h + t  r  s + n >= 1; Rule3: + t + X47X + n >= 1; X48X:  X47X  r >= 1; X49X:  X47X  h >= 1; X50X:  X47X + s >= 0;
Verify that the formulation is correct!
Questions

So, how is Mr. Greenguest finally dressed?

In the model we supposed that Mr Greenguest wears his green shirt (r = true). However, it might be cheaper to leave his green shirt at home. What do you think?

How is he dressed, if a friend gives him a pair of green socks.

How will he be dressed, if the entrance fee is only 5 dollars.

Formulate the model with linear constraints (without using logical operators).

Suppose now that there are 50 male guests who want to participate at the fancy dress party and every male must be dressed according to the following three rules (the same as above): (1) If someone wears a green tie he has to wear a green shirt. (2) A guest must wear a green tie or a green hat (or both), if he wears a green shirt and green socks. (3) A guest wearing a green shirt or a green hat or who does not wear green socks must wear a green tie.
A guest who is not dressed according to the rules 13 must pay 9 dollars entrance fee or he can rent the missing clothing from Mr Greenfun: a tie for 6, a hat for 9, a shirt for 4, and socks for 3 dollars. The rules are known by the guests only at the entrance, and some guests already wear appropriate clothes: Guest number 1,3,7,9,13,14,15,47,48, and 49 already wear a green tie, guest number 1,3,7,9,13,14,15,47,48, and 49 already wear already a green tie, guest number 2,4,7,8,11,17, and 21 wear a green hat, guest number 15,16,23,24,27,28,33,35,37,39,45, and 46 wear a green shirt, and guest number 4,5,6,7,9,12,25,26,27,28,31,33,34,38, and 45 already have green socks.
What is the revenue for Mr Greenfun – the host – if all guests attain the party?
Answers

He is dressed with a green shirt (r is true) and a green tie (that he bought). (r is true, because he has a shirt, t is true, because he buys a tie.)

We might remove the constraint Guest: r and solve the model again. Since r = 1 in the solution, this means that Mr. Greenguest better wears his green shirt since otherwise he must buy one at the entrance for 9 dollar.

He can or cannot wear the socks, he still has to buy a tie. (We may force s to be true by an additional constraint S: s; and we set the costs of s to zero.)

In this case, he does not care about clothes, he pays the entrance fee. Set the cost of n to 5. Setting n true, makes all rules true.

LPL translates this model into the following linear constraint list. Verify that the constraints model the logical conditions correctly.
min: 11 n + 12 s + 2 h + 10 t; Rule1: n + r  t >= 0; Rule2: n + h + t  r  s >= 1; Rule3: n + t  r >= 0; X47X: n + t + s >= 1; X48X: n + t  h >= 0;

The answer is given in model fancy1.
References
[1] MatMod. Homepage for Learning Mathematical Modeling : https://matmod.ch.
[2] Hürlimann T. Reference Manual for the LPL Modeling Language, most recent version. https://matmod.ch/lpl/doc/manual.pdf.
[3] Suhl U. A fancy dressing problem. private communication.