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 passengers traveling on the package, and the cost for each passenger in the package are 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 000
MedTour London-Sardinia-Majorca-London 2 500
At the checkout, this particular order should cost 2200 (2 x 600 + (2 x 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 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:
A) ∀X.∀Y.((package(X) ∧ package_passengers(X,Y)) → natural(Y))
B) ∀X.∃Y.((package(X) ∧ package_passengers(X,Y)) → natural(X))
C) ∃X.∃Y.((package(X) ∧ package_passengers(X,Y)) → natural(Y))
D) ∀X.∀Y.((package(X) → package_passengers(X,Y)) ∧ natural(Y))
Check