Questions tagged [spark-2014]

SPARK 2014 is a programming language derived from Ada. SPARK 2014 has been developed with compile-time proof of absence of run-time errors in mind. It is possible to write programs as a mix of SPARK 2014 and Ada 2012.

20 questions
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

How to prove a SPARK.Text_IO procedure precondition will hold

I'm using SPARK.Text_IO from the spark_io example in SPARK Discovery 2017. My problem is that many of the SPARK.Text_IO procedures have a precondition that I do not know how to begin to try to prove namely that the standard input is readable and…
0
votes
1 answer

Expression for finding an index in an array

How can I find the first character in a string that is the space character and return its index, with a single expression that can be used as part of Contract_Cases? For example, if the string is: Input : constant String := "abc def"; then the…
rid
  • 61,078
  • 31
  • 152
  • 193
0
votes
1 answer

Describing a String type in Ada

I have a type similar to: type ID is new String (1 .. 7); -- Example: 123-456 How can I specify that format in code, either with Ada or SPARK? I was thinking about Static_Predicate, but the condition that the string must start with 3 positive…
rid
  • 61,078
  • 31
  • 152
  • 193
1
2