Questions tagged [jml]

Java Modeling Language (jml) - specification language for Java

The Java Modeling Language (JML) is a behavioral interface specification language that can be used to specify the behavior of Java modules. It combines the design by contract approach of Eiffel and the model-based specification approach of the Larch family of interface specification languages, with some elements of the refinement calculus.

44 questions
1
vote
1 answer

Why OpenJML can not prove an assertion in for cycle?

I have the following piece of code: //@ requires dest != null; //@ requires srcOff >= 0; //@ requires destOff >= 0; //@ requires length >= 0; //@ requires srcOff < src.length; //@ requires destOff < dest.length; //@ requires srcOff + length <=…
Francesco
  • 897
  • 8
  • 22
1
vote
1 answer

Formal verification with 'KeY' in Java fails to prove array reset loop

Currently I'm trying to grasp a little bit of formal verification with the KeY tool for Java programs. Here is my key-annotated Java code: public class Test { public int[] a; /*@ public normal_behavior @ ensures (\forall int x; 0<=x &&…
Agnius Vasiliauskas
  • 10,935
  • 5
  • 50
  • 70
1
vote
1 answer

JML Cannot find type

I'm using JML to test some simple classes. I have class Interval.java , SequenceInterval.java and TestSequence.java, all in the same package(default package). When I try to compile SequenceInterval using jmlc it shows the same error:…
joanna
  • 743
  • 3
  • 13
  • 27
1
vote
1 answer

JML: How to specify a requirement of an array with crescent elements?

I want to do that in JML: //@ requires (\forall int i : array[i] < array[i+1]) void calculatesDistances(int[] array){ .. } I couldn't make it work, saw a lot of examples in JML specs, but couldn't find a way how to do it. So, how can i make it?
Alessandro Stamatto
  • 1,489
  • 2
  • 14
  • 18
1
vote
0 answers

JML can't catch a violated precondition

In my class Test I've an array of five int named a, and the method addOne(int index) that add one to the selected cell. I wrote in JML a simple precondition to control the index passed to the method. Then I try to violate this precondition calling…
MaleMale
  • 11
  • 2
1
vote
1 answer

What does 'assignable a, a[*];' mean?

I've recently read the following JML code in an old exam: Class L { /*@non_null*/ int[] a; /*@ public normal_behaviour @ requires !(\exists int i; 0 <= i && i < a.length; a[i] == d); @ ensures a.length == \old(a.length) + 1; @…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
1
vote
1 answer

How to use jmlc, jmlunit with OpenJML?

I have installed OpenJML tool (http://openjml.org/) for the Eclipse and was using it and it worked quite well. However, now I need to call the jmlc and jmlunit tools from command line. As I see from the search in Internet these tools should be…
Guneli
  • 1,691
  • 1
  • 11
  • 17
1
vote
2 answers

Installing JML in Eclipse

I am using Eclipse to program in Java. I tried installing from this site though Eclipse's Updater but although it didn't fire any error, I don't see the menus they say I should. Maybe I have to install something first? Maybe there other simpler JML…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
1
vote
1 answer

Trying to run Open JML in Eclipse

I am trying to install JML and was successful after trying various eclipse distributions but I am getting this error: (using eclipse-java-indigo-SR2-win32) the error appears when I use menu: JML > Static Check (ESC) The executeable for prover is not…
Usman Waheed
  • 86
  • 1
  • 8
1
vote
3 answers

Is Java Modelling Language executable?

I am studying software engineering course, and there i saw the usage of JML. Here is an example piece of code: //@ requires f >= 0.0 public float sqrt(float f) { return f/2; } It says that formal JML specifications are executable! My question…
yrazlik
  • 10,411
  • 33
  • 99
  • 165
0
votes
0 answers

JML typing error: a memory state is needed here (\at missing?)

I've been trying to fix an error in my JML program, but I haven't been able to do it. It's a typing error that references to a file, "Practi.jc" that I have no clue about where it is neither. //@+CheckArithOverflow=no /*@ axiomatic Addition{ @logic…
Nuria
  • 1
  • 1
0
votes
2 answers

Query to get all subtasks associated to stories with some labels in Jira

I have user stories in Jira with some labels A,B,C for example. But at subtasks level there is no labeling. Now I need to fetch count of all user stories of that label, their tasks and subtasks. How can I get subtasks which have no labels but linked…
shweta_kaushish
  • 141
  • 1
  • 3
  • 17
0
votes
1 answer

Correct way to install JML

I tried to install Java modeling language (JML) and something got wrong. I use Eclipse IDE, windows 10. I opened Eclipse -> Help -> Install New Software and then I installed using this Then, I restarted Eclipse and the new icons appeared in the top…
dacian
  • 95
  • 1
  • 8
0
votes
1 answer

Key Java JML proover passes this algorithm that reads a specific array element which triggers a NullPointerException? it should fail instead

I'm tyring to better understand the limits of the Key proover for Java. I have come up with a scenario where a specific array element will trigger a null pointer exception. When I run this through the proover it passes. Any idea why this is? It…
0
votes
1 answer

JML - OpenJML with Extended Static Checking - Array Example

I just started to use OpenJML, here my code and my JML warning: Code : //@ requires myArray != null ; //@ ensures myArray == \old(myArray) ; //@ signals ( MathLibException ) myArray.size() == 1 ; public ArrayList ExceptionTest1…
Gabriel
  • 1
  • 1