1. 09 Jun, 2017 2 commits
  2. 08 Jun, 2017 6 commits
    • Andrei Paskevich's avatar
      WhyML: "{qualid}" for logical symbols and snapshotted variables · a44cccbb
      Andrei Paskevich authored
      x.{f} is allowed and can be used for unary applications
      M.{f} is not allowed, use {M.f} instead
    • Andrei Paskevich's avatar
      Mlw: partially revert cda6d915: labels do not define exceptions · 2a794b99
      Andrei Paskevich authored
      It is confusing to use the keyword "label" to define an exception.
      Also, the "label L in ..." binds too far and the break point is
      not clearly defined.
      We do need some syntactic sugar for
        exception X t in try <expr> with X r -> r
      (at the very least "break" and "continue"), but labels are not it.
    • Andrei Paskevich's avatar
    • Andrei Paskevich's avatar
      Mlw: for-loops over range types · 2f7b69b5
      Andrei Paskevich authored
      In the surface language, the loop index is always int in
      the loop invariant and all annotations and pure terms inside
      the loop. If you want to access the original range-typed index,
      use "let copy_i = i in" in the program code before your assertion.
      Of course, you cannot do that for the loop invariant, which is
      what we want.
    • Martin Clochard's avatar
      by/so: moved precedence to the same level as arrow · c8cb2b78
      Martin Clochard authored
        Reason for that change: interpret correctly both
        (1) A by B -> C and (2) A -> B by C
        Case (2) is common, and we expect by to take precendence,
        so that A is the context for the proof of B.
        Case (1) is rarer, and is troublesome if by take precendence
        cause (A by B) -> C is almost certainly not what the user
        intended to write. Putting precendence of by/so at the same level as
        the arrow fix this
    • Andrei Paskevich's avatar
      Parser: recognize negative numerals · fe59898d
      Andrei Paskevich authored
      At this moment, there is no semantics change. This commit only
      provides dedicated grammar rules for negated numerals, so that
      we do not have to recognize them later.
  3. 06 Jun, 2017 4 commits
  4. 05 Jun, 2017 2 commits
    • Andrei Paskevich's avatar
      Mlw: labels can act as local exceptions · cda6d915
      Andrei Paskevich authored
      Useful to break out of the loops:
        label Break in
        while ... do
          label Continue in
          ... raise Break ...
          ... raise Continue ...
      When a label is put over a non-unit expression,
      raise acts as return:
        label Return in
        if ... then raise Return 42; 0
      Also, "return <expr>" returns from the innermost function.
      This includes abstract blocks, too, so if you want to return
      across an abstract block, you should rather use a label at
      the top of the main function. TODO/FIXME: maybe we should
      let "return" pass across abstract blocks by default, to
      avoid surprises?
      One shortcoming of the labels-as-exceptions is that they cannot
      be used to transmit tuples with ghost elements, nor return ghost
      values from non-ghost expressions. A local exception with an
      explicit mask should be used instead. Similarly, to return
      a partially ghost value from a function, it must have have
      its mask explicitly written (which is a good practice anyway).
      We cannot know the mask of an expr before we construct it,
      but in order to construct it, we need to create the local
      exceptions first.
      Another caveat is that while it is possible to catch an exception
      generated by a label, you should avoid to do so. We only declare
      the local exception if the expression under the label _raises_
      the exception, and thus the following code will not typecheck:
        label X in (try raise X with X -> () end)
      Indeed, the expression in the parentheses does not raise X,
      and so we do not declare a local exception X for this label,
      and so the program contains an undeclared exception symbol.
    • Andrei Paskevich's avatar
      Mlw: local exceptions in the surface language · b3a73a61
      Andrei Paskevich authored
      current syntax is
          exception Return (int, ghost bool) in
            raise Return (5, false)
            Return (i, b) -> ...
      These exceptions can carry mutable and non-monomorphic values.
      They can be raised from local functions defined in the scope
      of the exception declaration.
  5. 04 Jun, 2017 1 commit
  6. 03 Jun, 2017 1 commit
  7. 27 May, 2017 1 commit
    • Andrei Paskevich's avatar
      Mlw: support Epure in the surface language (with type inference) · 72714897
      Andrei Paskevich authored
      The current syntax is "{| <term> |}", which is shorter than
      "pure { <term> }", and does not require a keyword. Better
      alternatives are welcome.
      As for type inference, we infer the type pf the term under Epure
      without binding destructible type variables in the program.
      In particular,
        let ghost fn x = {| x + 1 |}
      will not typecheck. Indeed, even if we detect that the result
      is [int], the type of the formal parameter [x[ is not inferred
      in the process, and thus stays at ['xi].
      Another problem is related to the fact that variable and function
      namespaces are not yet separated when we perform type inference.
      Thus both fuctions
        let ghost fn (x: int) = let x a = a in {| x + 5 |}
        let ghost fn (x: int) = let x a = a in {| x 5 |}
      will not typecheck, since the type of [x] is ['a -> 'a] when
      we infer the type for the Epure term, but it becomes [int],
      when we construct the final program expression. Probably,
      the only reasonable solution is to keep variables and
      functions in the same namespace, so that [x] simply can
      not be used in annotations after being redefined as a
      program function.
  8. 11 May, 2017 2 commits
    • Andrei Paskevich's avatar
      Pdecl: split type declarations in chunks · b6e2a7b6
      Andrei Paskevich authored
      Refinement code requires private types to reside in
      separate program declarations. So we split type decls
      into chunks where all non-free types are declared
      separately and only constructible (Ddata) types are
      kept together. The code preserves the original order
      wherever possible.
      Also, export ls_of_rs and fd_of_rs from Expr: these are
      used everywhere in src/mlw anyway.
      Also, remove some range/float-related "assert false".
    • Andrei Paskevich's avatar
      Typing: indentation style · 43694d1b
      Andrei Paskevich authored
  9. 03 May, 2017 1 commit
  10. 01 May, 2017 1 commit
  11. 28 Apr, 2017 3 commits
  12. 23 Apr, 2017 1 commit
  13. 21 Apr, 2017 1 commit
  14. 12 Apr, 2017 1 commit
  15. 07 Mar, 2017 1 commit
    • Clément Fumex's avatar
      + use literals in ieee_float theory · f88de190
      Clément Fumex authored
      + add 'minInt and 'maxInt attributes for range types
      + add 'eb and 'sb attributes for float types
      + make ieee_float realization compatible with Coq 8.4
  16. 28 Feb, 2017 1 commit
    • Clément Fumex's avatar
      Add the ability to · f0547868
      Clément Fumex authored
      * declare range types and float types,
      * use integer (resp. real) literals for those types through casting,
      * specify how to print them in drivers.
      Change in syntax
      * use
        type t = < range 1 2 >   (* integers from 1 to 2 *)
        type t' = < float 4 12 > (* float with 4 bits in exponent and 12 in mantissa *)
        the two projections :
        and the predicate :
      * Restrict the use of "'" in whyml:
        Users are not allowed to introduce names where a quote symbol
        is followed by a letter. Thus, the following identifiers are
        whereas toto'phi is not.
      Note: we do not yet support negative numbers in range declaration
      and casting of a literal.
  17. 15 Feb, 2017 2 commits
  18. 14 Feb, 2017 1 commit
  19. 06 Feb, 2017 1 commit
  20. 17 Jan, 2017 1 commit
  21. 02 Jul, 2016 1 commit
  22. 14 Apr, 2016 1 commit
  23. 01 Apr, 2016 1 commit
  24. 24 Mar, 2016 1 commit
  25. 19 Mar, 2016 1 commit
  26. 17 Mar, 2016 1 commit