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