Thursday 16 May 2019

Design Non-Deterministic Finite Automata 2

The next...
We can also make a design NFAs with 2 states and the rules are: strings that can be received must start with '0'.
Examples of acceptable strings:
  • '0', 
  • '00', 
  • '01',
  • '0 *', 
  • '01 * ', 
  • '01 * 0 *',
  • '0 * 1 *', ...
The Answer:

 
Design the NFA

                                                     Transition Table

Design Non-Deterministic Finite Automata 1

We can design the NFA with 3 states and the rule is: the string that can be received must end in 'ab'.
Examples of strings that can be accepted: 

  • 'ab', 
  • 'aab', 
  • 'a * ab', 
  • 'bab',
  • 'b * ab', 
  • 'abab', 
  • 'a * b * ab', 
  • 'b * a * ab '
The  Answer: 

 

Design the NFA 

 

Thursday 9 May 2019

Simple Dinamic Programming in Prolog

Hai...how are you?
Remember in Simple Programming In Prolog
We can make a simple programming in prolog  more dymanic. This program used  two Predikat Built-In, write( ) and read ( ). The purpose of making this program is to involve users in the calculation process, attention to the this program:

%fact
 
% rule
start:- write('This is a Simple Program in Prolog'),nl,
          write('Enter length of Rectangular: '),read(L),
          write('Enter width of Rectangular: '),read(W),
          Rectangular_Area is W*L,
          write('Length of rectangular Entered: '),write(L),nl,
          write('Width of Rectangular Entered: '),write(W),nl,
          write('Rectangular Area: '),write(Rectangular_Area).