Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 30th, 2011, 11:32 AM
HobbySQL HobbySQL is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2011
Posts: 2 HobbySQL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 5 m 50 sec
Reputation Power: 0
Other Language - JML Question [Beginner]

How to define the JML Behaviours for following problem?

In a Sequence (JMLObjectSequence) are objects stored, with different states

example: [0 ... n] //Status "Waiting" , "In Progress", "Complete", "Fail",

jmlsequ[0].status() = "Waiting";

jmlsequ[1].status() = "In Progress";

jmlsequ[2].status() = "Complete";

jmlsequ[n].status() = "Fail";

each element of this sequence has different state

The function delfirstComplete() gives back, a new sequence (= old sequence + first element with status "Complete" is deleted)

example: new_jmlsequ = jmlsequ.DelFirstComplete();

please help, how to define the jml behavirous, especial the ensures?!!

I think to know, how to define the requierements, but i don´t know how to declare that my result is the old without the first Complete job (status = "Complete").

I tried to solve it like this:
_

/* @ public normal_behaviour

@ requires jmlsequ.isEmpty() == false;

@ requires (\exists int i; jmlsequ.itemAt(i).equals(“Complete”));

@ modifies \jmlsequ;

@ ensures \result == \old(jmlsequ).removeItemAt(i) &&

@ (\exists int i; jmlsequ.itemAt(i).equals(“Complete”) &&

@ (\forall int j; 0 >= j && j < i; !(jmlsequ.itemAt(j).equals(“Complete”) );

*/

_

If someone knows the answer, pls. help, i thank for your efforts!

thx
Hobby

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Other Language - JML Question [Beginner]

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap