makereject
Designates a reject state for non-computational variants.
Syntax
makereject(state);
Parameters
state: The name of the state to mark as a reject state
Rules
- Only valid for non-computational variants (same as
makeaccept) - Not valid for
computationalvariant (usemakehaltinstead) - The state must be declared in
makestatesfirst - A state cannot be both accept and reject
- Multiple reject states are allowed
Behavior
When the machine enters a reject state, it halts and rejects the input.
Examples
setvariant(single-tape);
makestates(q0, q1, qaccept, qreject);
makeinit(q0);
makeaccept(qaccept);
makereject(qreject);
Errors
- Wrong variant:
'makereject' is not valid for the 'computational' variant — use 'makehalt' - Undeclared state:
state 'qreject' is not declared - Role conflict:
state 'q0' is already marked as accept — cannot also be reject
See Also
- makestates - Declare machine states
- makeinit - Designate the initial state
- makeaccept - Designate an accept state
- makehalt - Designate a halt state (computational variant)