2
\$\begingroup\$

The state machine has the below specifications

 (defparameter *test-machine*
(make-fsm
:alphabet '(a b)
:table '((2 1) (0 2) (1 0))
:initial 0
:accepting '(2)))

The FSM in the function is:

 [1]> (fsm-alphabet *test-machine*)
(A B)
[2]> (fsm-initial *test-machine*)
0
[3]> (fsm-accepting *test-machine*)
(1)

The transition of the function is - the element of the alphabet of fsm the state index of the function is the index of the current state in the list of states

below is the function output

 [3]> (transition-function *test-machine* 0 'a)
2
[4]> (transition-function *test-machine* 0 'b)
1
[5]> (transition-function *test-machine* 2 'b)
0

the built-in function position will return the index of an element in a list if that element exists. For example, (position '3 '(1 2 0 2 3 5 6)) will return 4.

asked Oct 3, 2020 at 10:03
\$\endgroup\$
1
  • 1
    \$\begingroup\$ do you still need help with this question? \$\endgroup\$ Commented Nov 20, 2020 at 17:11

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.