?
Solved

Finite state process

Posted on 2006-11-23
3
Medium Priority
?
806 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Accepted Solution

by:
sreenathk earned 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Simple Linear Regression
Introduction to Processes

649 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