This question is about Section 3.2 of Logic and the limits of computing.
Consider an online travel agency offering tour packages. Whenever a customer chooses a package to
order, the itinerary, the number of passenger travelling on the package, and the cost for each passenger
in the package is added to the shopping basket. An example of the shopping basket is shown below.
Package
Itinerary
Number of
Passengers
Cost per
passenger
WorldTour
London-Bangkok-Lima-London
2
£600
MedTour
London-Sardinia-Majorca-London
2
£500
At the checkout, this particular order should cost £2200 ((2 x £600) + (2x £500)). However, what if an
attacker sets the passenger number on MedTour to -2 (minus 2) when the data from the shopping basket
is sent to the web server? Then the attacker has to pay only (2 x £600) + (-2 x £500) = £200. That's a
\"discount\" of £1000! This type of security attack is called a parameter tampering attack. To prevent this
attack, the checkout program has to make sure that the passenger number value of every package in the
shopping basket is greater than zero.
Let $package(X)$ stand for X is a package in the shopping basket at the checkout.
Let $package\_passengers(X, Y)$ stand for Y is the number of passenger on the package X.
Let $natural(X)$ stand for X is a natural number greater than zero.
Using the predicate symbols above, which of the following constraints can be used to prevent negative
passenger number values in the shopping basket?
Select one:
$\forall X.\forall Y. (package(X) \rightarrow (package\_passengers(X, Y) \land natural(Y)))$
$\forall X.\exists Y. (package(X) \land package\_passengers(X, Y) \land natural(X))$
$\forall X.\forall Y. ((package(X) \land package\_passengers(X, Y)) \rightarrow natural(Y))$
$\forall X.\forall Y. (package(X) \land package\_passengers(X, Y) \land natural(Y))$
Check