Solved

Finite state process

Posted on 2006-11-23
3
788 Views
Last Modified: 2008-11-14
hello
i need some help construcing a fsp model in Labelled Transition System Analyzer.  

i want to model a p2p file sharing  system

o      create – adds an entry in the local buffer
o      read – accesses a local/remote file
o      write – an exclusive operation and modifies a local/remote file
o      delete – an exclusive operation and deletes a local/remote file
o      dir – displays all local files
o      rdir – displays all remote files

at the moment i can only hand draw the model  for this but i cant devise code for it.

im not asking anyone to do this.  i only want someone to direct me to  a website where i can improve my skills using LTSA

any help will be great

thankyou
0
Comment
Question by:isarasoo
3 Comments
 
LVL 3

Accepted Solution

by:
sreenathk earned 500 total points
ID: 18005773
0
 
LVL 1

Author Comment

by:isarasoo
ID: 18032456
hello i have derived a some code to perform some the actions however i cant get one peer to view the other peers files.
i.e. when peer "a" hits rdir it should give you options available to peer "b".  
heres my code so far its written in LTSA i need help on the RDIR function
 
const Max =1
range Int =0..Max

SEMAPHORE(N=0) = SEMA[N],
SEMA[v:Int] = (up ->SEMA[v+1] | when(v>0) down-> SEMA[v-1]),
SEMA[Max+1] = ERROR.

BUFFER(N=2)= SLOTS[0],
SLOTS[i:0..N] = (when(i>=0 && i<N)create-> SLOTS[i+1]
                  |when(i>0) d.down ->delete-> d.up->SLOTS[i-1]
                  |when(i>0) read -> SLOTS[i]
                  |when(i>0) w.down ->write -> w.up -> SLOTS[i]
                  |when(i>0) dir -> SLOTS[i]
                  |when(i>0) rdir-> SLOTS[i]).

CREATE = (create -> CREATE).
DELETE=(delete->DELETE).
||D =(DELETE || w:SEMAPHORE(1)).
WRITE = (write->WRITE).
||W = (WRITE || w:SEMAPHORE(1)).
READ = (read -> READ).
DIR =(dir -> DIR).
RDIR = (rdir ->RDIR).

||P2P = (a:BUFFER(2) ||b:BUFFER(2)).
0
 

Expert Comment

by:jjames4
ID: 23103556
please can some explain this code for me please
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question