Trace a Rule with a Blocking Flag
Translate a stated fictional policy and prioritize its explicit blocking condition.
Supplied materials
- Paper and pencil; an adult may read aloud. No device, account or purchase is needed.
Learn the idea
A rule must represent the policy it is meant to follow. For this fictional simulator, the policy says: a blocked session cannot proceed; otherwise either a token or a pass allows proceeding. This is a supplied exercise policy, not a recommendation for real authentication. We use no accounts or real permissions.
Pseudocode: if blocked, return false; else return token OR pass. An equivalent expression is (NOT blocked) AND (token OR pass). A faulty expression token OR (pass AND NOT blocked) fails to block token holders. A carefully selected test can reveal this error.
- Write the blocked-first pseudocode from the stated policy.
- Trace blocked = true, token = true, pass = false.
- Evaluate the faulty expression on the same inputs.
- Test unblocked cases with and without a credential and record expected outputs.
See the method in action
For (blocked,token,pass) = (true,true,false), correct rule returns false immediately. Faulty rule gives true OR (false AND false) = true. Unblocked with token false/pass true returns true; unblocked with both false returns false.
Check your reasoning
Your answer is temporary and is not saved to an account. Download your current answer before leaving or reloading. Written work on paper or in another app stays in your own file.
See the answer and explanation
Blocked true, token true, pass false
The policy requires false when blocked is true. Only the supplied token-true blocked case makes the faulty token OR expression return true instead.
Take it further
Change the unblocked credential rule from OR to AND. For blocked false, token true, pass false, expected result changes from true to false. Blocked true must still return false.
Nothing here is saved to an account or sent to a teacher. The answer download includes your current choice and any checked feedback.
Check the subject sources
These LifeStarter passages, scenarios and exercises are authored for this Academy with AI assistance and review. External resources keep their publishers’ terms. A grade label suggests a starting level; it does not establish alignment with your school’s complete requirements.