• Gem #149 : Asserting the truth, but (possibly) not the whole truth

    In Ada 2012, assertions that state desired properties of programs are not limited to pragma Assert. This Gem presents how pragma Assertion_Policy can be used to control which of these assertions should be executed at run time.

    Continue Reading »

    Yannick Moy
    AdaCore
  • Gem #148 : Su(per)btypes in Ada 2012 - Part 3

    In the previous two Gems of this series, we saw how the aspects Static_Predicate and Dynamic_Predicate can be used to state properties of objects that should be respected at all times. This Gem is concerned with the Type_Invariant aspect.

    Continue Reading »

    Yannick Moy
    AdaCore
  • Gem #147 : Su(per)btypes in Ada 2012 - Part 2

    In the previous Gem in this series, we saw how the aspect Static_Predicate can be used to state properties of scalar objects that should be respected at all times. This Gem is concerned with the Dynamic_Predicate aspect.

    Continue Reading »

    Yannick Moy
    AdaCore
  • Gem #146 : Su(per)btypes in Ada 2012 - Part 1

    The new revision of Ada is full of features for specifying properties of types. In this series of three Gems, we describe three aspects that can be used to state invariant properties of types. This first Gem is concerned with the Static_Predicate aspect.

    Continue Reading »

    Yannick Moy
    AdaCore
  • Gem #123: Implicit Dereferencing in Ada 2012

    This Gem discusses the use of features added in Ada 2012 that simplify accessing and updating the elements of containers.

    Continue Reading »

    Christoph Grein
  • Gem #117: Design Pattern: Overridable Class Attributes in Ada 2012

    In this Gem we consider how to realize the capability of “class attributes” (such as supported in Python) using Ada. Continue Reading »

  • Gem #83: Type-Based Security 2: Validating the Input

    Ada Gem #83 — Ada's strong type system makes it quite convenient to check at compilation time that certain security properties are verified, for example that a tainted value is not used where a trusted one is expected, or that data is properly validated before being used in a sensitive context (think of SQL injection attacks).
    In the first Gem of this series of two, we discussed how to handle tainted data. In this Gem, we explain how to validate the input given to an SQL command. (For an amusing comic-strip description of what SQL injection is, see: http://xkcd.com/327/.) Continue Reading »

    Yannick Moy
    AdaCore
  • Gem #82: Type-Based Security 1: Handling Tainted Data

    Ada Gem #82 — The strong type system in Ada makes it quite convenient to check at compile time that certain security properties are verified, for example that a tainted value is not used where a trusted one is expected, or that data is properly validated before being used in a sensitive context (think of SQL injection attacks).
    In this series of two Gems, we present short examples of how this might be done. The first Gem discusses how to handle tainted data. Continue Reading »

    Yannick Moy
    AdaCore