Questions tagged [spark-ada]

SPARK is a programming language developed to allow formal proof of the absence of run-time errors. SPARK overlaps sufficiently with Ada that all SPARK programs can be compiled with an Ada compiler.

SPARK Ada is a subset of the Ada programming language, and a toolkit, that supports formal proof. It is intended for use in systems that require high reliability and integrity.

54 questions
1
vote
1 answer

Ada Tasking and Safety

I don't like coding but I really liked Ada, and I'm very new to it. So could you please clarify these points to me? If you have a computer with a single non-threaded CPU, tasking will still be single-CPU. The same of course applies to forking in C…
Matt
  • 11
  • 1
1
vote
1 answer

SPARK: gnatprove with -gnato13 option unrecognizable?

I am very new to Ada/SPARK. I was trying to follow some tutorials from here -- http://docs.adacore.com/spark2014-docs/html/ug/gnatprove.html Suppose I am running the ISQRT example given here…
ramgorur
  • 2,104
  • 4
  • 26
  • 39
1
vote
3 answers

Spark Proof annotation

hello I am trying to write proof annotations from this function .. this is written using the Spark programming language function Read_Sensor_Majority return Sensor_Type is count1:Integer:=0; count2:Integer:=0; …
mohammad Mustafa
  • 41
  • 1
  • 1
  • 4
0
votes
0 answers

Ada spark - Add --# derives clause

I am trying to add derives clause to this procedure and this is my solution : --# derives Index from Key, Data & Found from Data & I from Data ; I am not sure about it and I need help procedure Find (Key: Integer ; Data : in MyArray ; …
Memo
  • 53
  • 6
0
votes
3 answers

The meaning of postcondition

I can understand the meaning and purpose of preconditions in this code but I have a problem in understanding the meaning and purpose of the postconditions. In Push I know that this part to increase pointer after pushing integer ( Pointer = Pointer~…
Memo
  • 53
  • 6
0
votes
1 answer

Equivalence between C/frama-c and Spark-ada

I'm studying the framework Frama-c, and I'm wondering if there is an equivalence between C/Frama-c and Spark Ada. I know that it can seem quite odd to compare such different languages, but after reading David A. Wheeler's article, Johannes Kanig's…
Eliott.CH
  • 25
  • 3
0
votes
1 answer

"Assertion might Fail" and Precondition doesn't solve it

I have a function that monitors a controlled signal by applying a simple check whether the signal is within a given tolerance band. The function is called is_within_limits. I have a second function called is_within_expanded_limits that does the same…
Simon
  • 594
  • 1
  • 6
  • 13
0
votes
1 answer

Implicit Function Contract not available for Proof

I've got a procedure in a SPARK package that calls some functions from a none SPARK package. procedure do_monitoring is U_C1 : constant Float := Sim.Get_U_C1; I_L1 : constant Float := Sim.Get_I_L1; U_C2 : constant Float := Sim.Get_U_C2; …
Simon
  • 594
  • 1
  • 6
  • 13
0
votes
1 answer

Sum of Squares in SPARK

for a school project I have to write a paper about the SPARK programming language, which I did, however part of it is writing a short program that takes an integer n and outputs the sum of squares from 1 to n. In C++ the program would look something…
peter_s
  • 55
  • 2
  • 10
1 2 3
4