INTRODUCTION
In this Project we describe how to solve parallel language equations over
regular languages / automata and fi...
BALM-II FEATURES
The Berkeley Automata and Language Manipulation (BALM) software:
•

addresses finite automata in two form...
REQUIREMENTS FOR BALM-II
1. Ubuntu http://www.ubuntu.com/download/desktop
2. Balm-II package from:
http://esd.scienze.univ...
VIRTUAL BOX GUIDE
1. Install Virtual Box Either From (VirtualBox-4.2.6Installation.exe) or (VirtualBox-4.2.6-Portable.exe)...
VIRTUAL BOX GUIDE - CONTINUED
4. Click open Appliance

6
VIRTUAL BOX GUIDE - CONTINUED
5. Choose the Ubuntu.ova file from the root folder of the DVD Distributed
and click open

7
VIRTUAL BOX GUIDE - CONTINUED
5. Choose the Ubuntu.ova file from the root folder of the DVD Distributed
and click open

8
VIRTUAL BOX GUIDE - CONTINUED
6. Click Next:

9
VIRTUAL BOX GUIDE - CONTINUED
7. You can click import directly with the default values or you can change
the ram, cpu coun...
VIRTUAL BOX GUIDE - CONTINUED
8. Wait for import to complete:

11
VIRTUAL BOX GUIDE - CONTINUED
9. Double click on Ubuntu machine to start it or click on it once then click
on start

12
RUNNING BALM-II
1. Click on the terminal icon on the left dock as shown
below, then type:
a. cd balm-II >> Click Enter

b....
RUNNING BALM-II
2. Now you have entered the balm-II tool, you can type help to
display all operators of balm-II

14
CREATING A .AUT FILE (AUTOMATA)
1. Open the balm-II shortcut
2. Make a new folder, eg: “automata1” in the balm-II folder

...
CREATING A .AUT FILE (AUTOMATA)
1. Open the balm-II shortcut
2. Make a new folder, eg: “automata1” in the balm-II folder

...
CREATING A .AUT FILE (AUTOMATA)
3. Make a copy from the “template.aut” file in the balm-II folder by right
clicking on the...
CREATING A .AUT FILE (AUTOMATA)
Open a1.aut file, below is the explanation for the aut format:
 .model automataname
the a...
CREATING A .AUT FILE (AUTOMATA)
 .table CS -> Acc
.default 1
this means the remaining states other than “A” is set to acc...
PLOTTING THE AUT FILE
1. Open Balm-II
2. Write: plot_aut [the path to the .aut file you need to plot]
3. The resultant plo...
STEPS TO GENERATE THE LARGEST SOLUTION
Look at examples 1.1 and 1.2 which are the files “spec.aut” and “comp.aut”
that gen...
STEPS TO GENERATE THE LARGEST SOLUTION
plot_aut automata1/comp.aut

22
STEPS TO GENERATE THE LARGEST SOLUTION
1. Start with the specification file, we need to add the alphabet of input variable...
STEPS TO GENERATE THE LARGEST SOLUTION
2. Write: complement then you have to specify the input file which is a1.aut and
ou...
STEPS TO GENERATE THE LARGEST SOLUTION
3. Write: expansion (the missing input tag in this example is E1 which represents
U...
STEPS TO GENERATE THE LARGEST SOLUTION
 Write: product then you have to specify the input file which is comp.aut and the
...
STEPS TO GENERATE THE LARGEST SOLUTION
5. Write: restriction (the missing input tag in this example is E1 which represents...
STEPS TO GENERATE THE LARGEST SOLUTION
6. Write: complement as described in “b”, eg:
complement automata1/a5.aut automata1...
STEPS TO GENERATE THE LARGEST SOLUTION
7. Write: support (all the original inputs only without the tags) then the input fi...
STEPS TO GENERATE THE LARGEST SOLUTION
8. Write: prefix_close [the input file you need to remove all fail states from] [th...
STEPS TO GENERATE THE LARGEST SOLUTION
9. Write: remove_dc then the input file which is a8.aut and the output file which i...
CONVERTING FSM TO AUTOMATA
Look at the example 2.1 which represents the file “FSM.aut”
1. Optional: Plot the FSM file:
plo...
CONVERTING FSM TO AUTOMATA
2. Open Balm-II as described before
3. Create the file “FSM.aut” from example 2.1 in a folder n...
EXERCISE AUTOMATA LARGEST SOLUTION
Look at examples 3.1 and 3.2:

34
EXERCISE AUTOMATA LARGEST SOLUTION
3.2:

35
EXERCISE AUTOMATA LARGEST SOLUTION
3.2:

36
SOLUTION
plot_aut automata2/spec.aut
plot_aut automata2/comp.aut
support X,U(3),E automata2/spec.aut automata2/a1.aut
plot...
EXERCISE FSM TO AUTOMATA CONVERSION
Look at example 4.1

38
SOLUTION
read_para_fsm i|v|u|o FSM2Aut/FSM.aut FSM2Aut/Aut.aut
plot_aut FSM2Aut/Aut.aut

the input and output files are re...
CONCLUSION
Balm-II is an effective tool to help in solving large automata(s) and FSMs
with many states, many theories can ...
FUTURE WORK
•

Balm-II is having some issues converting automata(s) back to FSMs, the
current command is:
write_para_fsm x...
REFERENCES
•

Balm-II manual: http://esd.scienze.univr.it/docs/TR-UCB-EECS-2011-102-R1.pdf

•

The Unknown Component Probl...
QUESTIONS?

43
44
Balm-II
Upcoming SlideShare
Loading in …5
×

Balm-II

274 views
159 views

Published on

Using Balm-II to solve Automata Problems

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
274
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Balm-II

  1. 1. INTRODUCTION In this Project we describe how to solve parallel language equations over regular languages / automata and finite state machines (FSMs) to compute the largest solution using the software package BALM-II, which is an extended version of BALM. The original BALM was able to solve equations only with respect to synchronous composition; BALM-II used to solve also equations with respect to parallel composition, adding new commands and procedures. “Reference from Balm-II Manual & Berkeley Website” 2
  2. 2. BALM-II FEATURES The Berkeley Automata and Language Manipulation (BALM) software: • addresses finite automata in two forms, regular finite automata and finite state machines. • provides for input and output through BLIF, BLIF-MV or "automata" files. • uses symbolic methods to extend the range and speed of automata manipulation. • has special routines for solving language equations and the unknown component problem. • can solve for the complete sequential flexibility of a component embedded in a system of FSMs. • provides visualization of automata. “Reference from Balm-II Manual & Berkeley Website” 3
  3. 3. REQUIREMENTS FOR BALM-II 1. Ubuntu http://www.ubuntu.com/download/desktop 2. Balm-II package from: http://esd.scienze.univr.it/index.php/it/balm-ii.html 3. xDot package from Ubuntu software center 4
  4. 4. VIRTUAL BOX GUIDE 1. Install Virtual Box Either From (VirtualBox-4.2.6Installation.exe) or (VirtualBox-4.2.6-Portable.exe), the installation version provides network support in the Ubuntu VM 2. Run Virtual box from the shortcut or run VirtualBox.exe in case you choose the portable version 3. Click on File >> Import Appliance: 5
  5. 5. VIRTUAL BOX GUIDE - CONTINUED 4. Click open Appliance 6
  6. 6. VIRTUAL BOX GUIDE - CONTINUED 5. Choose the Ubuntu.ova file from the root folder of the DVD Distributed and click open 7
  7. 7. VIRTUAL BOX GUIDE - CONTINUED 5. Choose the Ubuntu.ova file from the root folder of the DVD Distributed and click open 8
  8. 8. VIRTUAL BOX GUIDE - CONTINUED 6. Click Next: 9
  9. 9. VIRTUAL BOX GUIDE - CONTINUED 7. You can click import directly with the default values or you can change the ram, cpu count & machine name if desired: 10
  10. 10. VIRTUAL BOX GUIDE - CONTINUED 8. Wait for import to complete: 11
  11. 11. VIRTUAL BOX GUIDE - CONTINUED 9. Double click on Ubuntu machine to start it or click on it once then click on start 12
  12. 12. RUNNING BALM-II 1. Click on the terminal icon on the left dock as shown below, then type: a. cd balm-II >> Click Enter b. ./balm32 >> Click Enter 13
  13. 13. RUNNING BALM-II 2. Now you have entered the balm-II tool, you can type help to display all operators of balm-II 14
  14. 14. CREATING A .AUT FILE (AUTOMATA) 1. Open the balm-II shortcut 2. Make a new folder, eg: “automata1” in the balm-II folder 15
  15. 15. CREATING A .AUT FILE (AUTOMATA) 1. Open the balm-II shortcut 2. Make a new folder, eg: “automata1” in the balm-II folder 16
  16. 16. CREATING A .AUT FILE (AUTOMATA) 3. Make a copy from the “template.aut” file in the balm-II folder by right clicking on the file >> copy then right click on anywhere in the “automata1” folder and click paste, you can rename the file to whatever you desire, for example lets name it “spec.aut” 17
  17. 17. CREATING A .AUT FILE (AUTOMATA) Open a1.aut file, below is the explanation for the aut format:  .model automataname the above line creates an instance of an automata, the bolded text can be replaced with any name you desire for the automata  .inputs X E X is the input and E is the tagname for X input  .outputs Acc the above line should be available by default  .mv X 2 X1 X2 X is the input, 2 is the number of X inputs, X1 and X2 are the variable names for the 2 “X inputs”  .mv E 2 E0 E1 E is the same as “d”  .mv CS, NS 2 A B CS, NS is by default and means “Current State” & “Next State”, 2 is the number of states, A B are the variable names for the states  .latch NS CS .reset CS the above 2 lines should be available by default and it is for the automata initialization  A1 the above line means the state “A” is set to accepted state, if it is 0 then it is not accepted state 18
  18. 18. CREATING A .AUT FILE (AUTOMATA)  .table CS -> Acc .default 1 this means the remaining states other than “A” is set to accepted state, and also 0 means not accepted  .table X E CS -> NS the above line is for setting the transitions, you need to enter the same inputs in the bolded text  X1 E0 AB X2 E0 B A - E1 A A - E1 B B the above line and the next 3 lines means the transitions are specified on the right such as “A” to “B” transition, and the inputs that cause that transition are specified on the left and it should be in the same order of the table variables entered “X E”, “-“ means no input will cause the transition, specifying the input will mean that the input such as “X1” will cause the transition “A to B” Please note that you have to add a loop for E tag name for all the states to complement and expand the automata properly  .end by default to specify the end of the file After you save the file desired Please note that if you need to create an aut file representing an FSM you have to replace the “-“ sign with “^” sign and add “^” to the inputs and the .mv lines 19
  19. 19. PLOTTING THE AUT FILE 1. Open Balm-II 2. Write: plot_aut [the path to the .aut file you need to plot] 3. The resultant plotted automata will open in a separate Window 20
  20. 20. STEPS TO GENERATE THE LARGEST SOLUTION Look at examples 1.1 and 1.2 which are the files “spec.aut” and “comp.aut” that generates the specification and component automata we are going to work on example 1.1 – “spec.aut” file: 1. 2. 3. Open Balm-II as described before Create the specification and component files in a folder named “automata1” inside balm-II folder as described before Execute the following steps: Optional: plot both spec.aut and comp.aut to view the automata(s) visually: plot_aut automata1/spec.aut 21
  21. 21. STEPS TO GENERATE THE LARGEST SOLUTION plot_aut automata1/comp.aut 22
  22. 22. STEPS TO GENERATE THE LARGEST SOLUTION 1. Start with the specification file, we need to add the alphabet of input variables in the specification that are not existing in the component and vice versa, this can be executed by the below 2 steps write: support (all the inputs of both spec.aut and comp.aut), if the number of inputs are more than 2 you have to specify it, then you have to specify the input file which is the specification and output file which is the specification including the uploaded inputs ex: support X,U(3),E automata1/spec.aut automata1/a1.aut Optional: Plot the above to see the output plot_aut automata1/a1.aut 23
  23. 23. STEPS TO GENERATE THE LARGEST SOLUTION 2. Write: complement then you have to specify the input file which is a1.aut and output file which is the complemented automata, eg: complement automata1/a1.aut automata1/a2.aut Optional: Plot the above to see the output plot_aut automata1/a2.aut 24
  24. 24. STEPS TO GENERATE THE LARGEST SOLUTION 3. Write: expansion (the missing input tag in this example is E1 which represents U1,U2,U3) then you have to specify the input file which is a2.aut and output file which is the completion of the uploaded automata, eg: expansion E1 automata1/a2.aut automata1/a3.aut Optional: Plot the above to see the output plot_aut automata1/a3.aut 25
  25. 25. STEPS TO GENERATE THE LARGEST SOLUTION  Write: product then you have to specify the input file which is comp.aut and the second input to product which is a3.aut and specify the output file which is the product of the 2 automatas, eg: product automata1/comp.aut automata1/a3.aut automata1/a4.aut Please note that the order is important you have to product the component with the specification and not vice versa Optional: Plot the above to see the output plot_aut automata1/a4.aut 26
  26. 26. STEPS TO GENERATE THE LARGEST SOLUTION 5. Write: restriction (the missing input tag in this example is E1 which represents U1,U2,U3) then the input file a4.aut then the output file which is the restricted automata, eg: restriction E1 automata1/a4.aut automata1/a5.aut Optional: Plot the above to see the output plot_aut automata1/a5.aut 27
  27. 27. STEPS TO GENERATE THE LARGEST SOLUTION 6. Write: complement as described in “b”, eg: complement automata1/a5.aut automata1/a6.aut Optional: Plot the above to see the output plot_aut automata1/a6.aut 28
  28. 28. STEPS TO GENERATE THE LARGEST SOLUTION 7. Write: support (all the original inputs only without the tags) then the input file which is a6.aut and the output file which is the automata with only the original inputs, eg: support X,U(3) automata1/a6.aut automata1/a7.aut Optional: Plot the above to see the output plot_aut automata1/a7.aut 29
  29. 29. STEPS TO GENERATE THE LARGEST SOLUTION 8. Write: prefix_close [the input file you need to remove all fail states from] [the path to the desired output file that doesn’t contain failed states] eg: prefix_close automata1/a7.aut automata1/a8.aut Optional: Plot the above to see the output plot_aut automata1/a8.aut 30
  30. 30. STEPS TO GENERATE THE LARGEST SOLUTION 9. Write: remove_dc then the input file which is a8.aut and the output file which is the automata without the don’t care state, eg: remove_dc automata1/a8.aut automata1/a9.aut Optional: Plot the above to see the output plot_aut automata1/a9.aut This example can be found in: /home/coe531/balm-II/Described_Examples/automata1 in the virtual machine 31
  31. 31. CONVERTING FSM TO AUTOMATA Look at the example 2.1 which represents the file “FSM.aut” 1. Optional: Plot the FSM file: plot_aut FSM2Aut/FSM.aut 32
  32. 32. CONVERTING FSM TO AUTOMATA 2. Open Balm-II as described before 3. Create the file “FSM.aut” from example 2.1 in a folder named “FSM2Aut” inside balm-II folder as described before 4. Write: read_para_fsm [the inputs/outputs of the FSM] [the path to the FSM file] [the path to the resultant automata file] read_para_fsm i|o FSM2Aut/FSM.aut FSM2Aut/Aut.aut 5. Optional: Plot the resultant file: plot_aut FSM2Aut/Aut.aut This example can be found in: /home/coe531/balm-II/Described_Examples/FSM2Aut in the virtual machine 33
  33. 33. EXERCISE AUTOMATA LARGEST SOLUTION Look at examples 3.1 and 3.2: 34
  34. 34. EXERCISE AUTOMATA LARGEST SOLUTION 3.2: 35
  35. 35. EXERCISE AUTOMATA LARGEST SOLUTION 3.2: 36
  36. 36. SOLUTION plot_aut automata2/spec.aut plot_aut automata2/comp.aut support X,U(3),E automata2/spec.aut automata2/a1.aut plot_aut automata2/a1.aut complement automata2/a1.aut automata2/a2.aut plot_aut automata2/a2.aut expansion E1 automata2/a2.aut automata2/a3.aut plot_aut automata2/a3.aut product automata2/comp.aut automata2/a3.aut automata2/a4.aut plot_aut automata2/a4.aut restriction E1 automata2/a4.aut automata2/a5.aut plot_aut automata2/a5.aut complement automata2/a5.aut automata2/a6.aut plot_aut automata2/a6.aut the input and output files are readily available in /home/coe531/balm-II/Exercises/automata2 in the virtual machine support X,U(3) automata2/a6.aut automata2/a7.aut plot_aut automata2/a7.aut prefix_close automata2/a7.aut automata2/a8.aut plot_aut automata2/a8.aut remove_dc automata2/a8.aut automata2/a9.aut plot_aut automata2/a9.aut 37
  37. 37. EXERCISE FSM TO AUTOMATA CONVERSION Look at example 4.1 38
  38. 38. SOLUTION read_para_fsm i|v|u|o FSM2Aut/FSM.aut FSM2Aut/Aut.aut plot_aut FSM2Aut/Aut.aut the input and output files are readily available in /home/coe531/balm-II/Exercises/FSM2Aut in the virtual machine 39
  39. 39. CONCLUSION Balm-II is an effective tool to help in solving large automata(s) and FSMs with many states, many theories can be verified using balm tool and it helps in reducing the manual work and efforts done to solve problems by hand 40
  40. 40. FUTURE WORK • Balm-II is having some issues converting automata(s) back to FSMs, the current command is: write_para_fsm x|u|y|v|E E0|E1,E4|E3 x_supp.aut x_supp_fsm.aut it may need to be verified and updated to make it simpler and effective for the user • Balm-II is a command line tool, it would be more effective for the user to use balm-II visually 41
  41. 41. REFERENCES • Balm-II manual: http://esd.scienze.univr.it/docs/TR-UCB-EECS-2011-102-R1.pdf • The Unknown Component Problem- Theory and Applications ISBN 978-0-38734532-1 • http://embedded.eecs.berkeley.edu/mvsis/balm.html 42
  42. 42. QUESTIONS? 43
  43. 43. 44

×