Several other idioms in English which we shall regard as having the same meaning as "If P, then Q" (where P and Q are sentences):
P implies Q,
P only if Q,
P is a sufficient condition for Q,
Q, provided that P,
Q if P,
Q is a necessary condition for P.
“P only if Q”如何与“If P, then Q”相同?这就像说“暗示”(=>)与“iff”(<=>)的含义相同。
我的意思是看方向:如果 P 为真,那么 Q 也为真。另一方面:只有当 Q 为真时,P 才为真——你正在测试 Q!有吗??从编译器的角度来看:“P only if Q”会导致对 Q 的测试?