Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following code is representing the finite state transducer above. I need help filling the prolog code's transitions where it asks to be filled. %

image text in transcribed

The following code is representing the finite state transducer above. I need help filling the prolog code's transitions where it asks to be filled.

% FILL IN THE FST SPECIFICATION WHERE

% INDICATED THROUGHOUT THE FILE.

?- % Transitions out of state 0

transition(0, '#', 0, '#').
transition(0, '^', 0, eps).
% S below can be anything, except for #, ^, z, s, x, eps
% Pay close attention to how to interpret J&M's use of
% "other" and "#" in transitions.
% "other" means anything not used in any transitions
% going out of this state, excluding "#".
transition(0, S, 0, S) :-
S \= '#',
S \= '^',
S \= z,
S \= s,
S \= x,
S \= eps.
% S below must be one of z, s, x
transition(0, S, 1, S) :-
S = z;
S = s;
S = x.
% Transitions out of state 1
transition(1, S, 0, S) :-
% FILL IN LINES HERE THAT RESTRICT WHAT S CAN BE
S \= eps.
transition(1, S, 1, S) :-
% FILL IN LINES HERE THAT ALLOW S TO BE OTHER SYMBOLS
S = x.
transition(1, ^, 2, eps).
% Transitions out of state 2
% ADD YOUR TRANSITIONS HERE
% transitions out of state 3
transition(3, s, 4, s).
% transitions out of state 4
transition(4, '#', 0, '#').
% transitions out of state 5
transition(5, S, 1, S) :-
S = z;
S = s;
S = x.
transition(5, S, 0, S) :-
S \= z,
S \= s,
S \= x,
S \= '^',
S \= '#',
S \= eps.
transition(5, '^', 2, eps).
initial(0).
final(0).
 
other A.E Z,S? other z.sx E:e A:E do q1 #othe Z, X #, other other A.E Z,S? other z.sx E:e A:E do q1 #othe Z, X #, other

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Murach's SQL Server 2012 For Developers

Authors: Bryan Syverson, Joel Murach, Mike Murach

1st Edition

1890774693, 9781890774691

More Books

Students also viewed these Databases questions

Question

=+Explain the skills needed to create a sustainable personal bran

Answered: 1 week ago

Question

Were the decisions based on appropriate facts?

Answered: 1 week ago

Question

Were the right people involved in the decision-making process?

Answered: 1 week ago