1. 19 Jun, 2017 3 commits
  2. 18 Jun, 2017 1 commit
  3. 17 Jun, 2017 1 commit
  4. 16 Jun, 2017 1 commit
    • Andrei Paskevich's avatar
      WhymL: break and continue · df239061
      Andrei Paskevich authored
      Without an argument, break and continue refer to the innermost loop.
      A label put over an expression sequence starting with a loop, can be
      used as an optional argument for break and continue:
      
        label L in
        [ghost] ["tag"] [M.begin]
          while true do
            ...
            break L
            ...
          done;
          [...]
        [end] [: unit]
      
      In the square brackets are listed the constructions allowed between
      the label declaration and the loop expression.
      df239061
  5. 14 Jun, 2017 2 commits
  6. 13 Jun, 2017 6 commits
    • Andrei Paskevich's avatar
      Eval_match: preserve quantifiers after passing to terms · 712dcd37
      Andrei Paskevich authored
      eval_match should not destruct user-written quantifiers.
      For this purpose it preserves all quantifiers inside annotations.
      For the same purpose it now also preserves all quantifiers appearing
      inside terms in let-bindings (in particular, inside lambdas).
      712dcd37
    • Andrei Paskevich's avatar
      Expr: execute abstract blocks and whiteboxes with unfiltered effect · f9ff4e02
      Andrei Paskevich authored
      This commit also contains a fix for a curious exploit of our type
      system which was made possible by a combination of local exceptions
      and a special treatment of abstract blocks and whiteboxes.
      
      Local exceptions allow us to exploit the type inference mechanism
      and to force the same regions onto unrelated expressions. This is due
      to the fact that local exceptions are region-monomorphic (this may be
      relaxed in future). Of course, this was always possible via the API,
      and the false aliases do not threaten the soundness of the system,
      thanks to the following critical invariant:
      
        An allocation of a new mutable value always has an associated reset
        effect which invalidates the existing variables of the same type.
      
      So, if two variables share a region, then exactly one of three
      conditions must hold:
      
      1. They are actually aliased, and modification of one must change
         the other in the VC.
      
      2. They are not aliased, but the newer one invalidates the other:
         this is a case of false alias made benign by the reset effect.
      
      3. The shared region is not actually reachable from the newer one:
              let x = if true then None else Some r
         this is another false alias, without an associated reset effect,
         yet still benign since the shared region is not reachable from x.
      
      However, the type system and the VC generator must have the exact
      same view on who's who's alias. If the VCgen encounters in the
      same control flow two variables with a shared region in the type,
      then the type system must have ensured one of the three conditions
      above. Prior to this commit, there were two cases which violated
      this:
      
      - An exception raised in an abstract block that does not have
        an exceptional postcondition for it, escapes into the main
        control flow.
      
      - A whitebox, by its nature, is fully handled inside the main
        control flow.
      
      The violation came from the fact that abstract blocks and whiteboxes
      are stored as cexps and so their effect is filtered by Ity.create_cty
      in order to hide effects on variables allocated and collected inside
      the block. This is a useful and necessary feature, except when the
      VC of the block escapes into the main control flow and the forced
      false aliases -- unchecked by the type system -- are seen by VCgen.
      The implemented fix resolves the issue by restoring the hidden
      effects for abstract blocks and whiteboxes.
      
      Check bench/programs/bad-typing/false_alias*.mlw for two concrete
      examples.
      f9ff4e02
    • Andrei Paskevich's avatar
      WhyML: white-box blocks · 516cfd3a
      Andrei Paskevich authored
      Just as abstract blocks, "white-box blocks" are program expressions
      with an additional contract attached to their execution place.
      Contrary to abstract blocks, whiteboxes do not hide their contents
      from the outer computation. In most cases, you would not need
      whiteboxes at all, as the same effect can be achieved by adding
      assertions. Their utility comes from their syntax: the added
      contract clauses bind to the expression and do not require
      additional semicolons, begin-end's, let-in's or try-with's.
      
      Compare:
      
          let x = <expr> in assert { P x }; x
      to  <expr> ensures { P result }
      or  <expr> returns { x -> P x }
      
          if ... then begin let x = <expr> in assert { P x }; x end; ...
      to  if ... then <expr> ensures { P result }; ...
      
          try <expr> with E x -> assert { P x }; raise E x; end
      to  <expr> raises { E x -> P x }
      
      Internally, whiteboxes are just abstract blocks (zero-argument
      anonymous functions executed in-place) with the label "vc:white_box"
      on top. The user never needs to write this label explicitly though.
      516cfd3a
    • Andrei Paskevich's avatar
      Dexpr: relax alias restrictions on non-recursive functions · 8b67dbad
      Andrei Paskevich authored
      There is no reason why an abstract block cannot return an alias
      with some external variable or exception.
      8b67dbad
    • Andrei Paskevich's avatar
      Typing: minor · 65844aa6
      Andrei Paskevich authored
      65844aa6
    • Jean-Christophe Filliâtre's avatar
      ported example optimal_replay · 5553027c
      Jean-Christophe Filliâtre authored
      one VC is proved only by CVC3 2.4.1, even after bisection
      and increased timeout to 20s
      5553027c
  7. 11 Jun, 2017 10 commits
  8. 10 Jun, 2017 13 commits
  9. 09 Jun, 2017 3 commits