Commit 7b0929a7 authored by Andrei Paskevich's avatar Andrei Paskevich
Browse files

WhyML: "use/clone T" imports by default (in absence of "as")

For the previous behaviour (no import), write "use/clone T as T".

This shortens the most used "use/clone import" to simply "use/clone".
parent 585b99a6
......@@ -5,5 +5,5 @@ end
module M
type t = { a: bool } (* bad type for a *)
clone S with type t = t
clone import S with type t = t
end
......@@ -5,5 +5,5 @@ end
module M
type t = { b: int } (* no field a *)
clone S with type t = t
clone import S with type t = t
end
theory A use B end
theory A use export B end
theory A end
theory B use A use A end
theory B use import A use import A end
theory A end
theory B end
theory C use A use B as A end
theory C use A as A use B as A end
......@@ -7,7 +7,7 @@ theory A
end
theory B
use A
use A
use A as A
use A as A
end
......@@ -3,5 +3,5 @@ theory A
end
theory B
use A
use A as A
end
......@@ -202,7 +202,7 @@ end
theory TestSemantics
use import SemOp
use map.Const
use import map.Const
function my_sigma : env = Const.const (Vint 0)
constant x : ident
......
......@@ -44,7 +44,7 @@ function eval (f:prop_fmla) (v:idmap bool) : bool =
end
use map.Const
use import map.Const
goal Test1 :
let x = mk_ident 0 in
......
......@@ -56,7 +56,7 @@ function eval_expr (s:state) (e:expr) : int =
eval_bin (eval_expr s e1) op (eval_expr s e2)
end
use map.Const
use import map.Const
goal Test13 :
let s = Const.const 0 in
......
......@@ -262,7 +262,7 @@ end
theory TestSemantics
use import Imp
use map.Const
use import map.Const
function my_sigma : env = Const.const (Vint 0)
function my_pi : env = Const.const (Vint 42)
......@@ -425,7 +425,7 @@ predicate stmt_writes (i:stmt) (w:Set.set ident) =
eval_fmla sigma' pi' result
}
use HoareLogic
use import HoareLogic
let rec wp (i:stmt) (q:fmla)
ensures { valid_triple result i q }
......
......@@ -49,7 +49,7 @@ module ResizableArraySpec
use import int.Int
use import map.Map
use map.Const
use import map.Const
type rarray 'a = private {
ghost mutable len: int;
......@@ -93,9 +93,9 @@ module BagImpl
use import int.Int
use import Bag
use import ResizableArraySpec as R
use map.Map
use int.NumOf
use null.Null
use map.Map as Map
use int.NumOf as NumOf
use null.Null as Null
function numof (r: rarray (Null.t 'a)) (x: 'a) (l u: int) : int =
NumOf.numof (fun i -> (Map.get r.R.data i).Null.v = Null.Value x) l u
......@@ -164,7 +164,7 @@ module BagImpl
resize t.data n;
t.size <- n
clone BagSpec with
clone import BagSpec with
type t = t,
val create = create,
val clear = clear,
......
......@@ -9,7 +9,6 @@ theory Graph
use export list.List
use export list.Append
use export list.Length
use list.Mem
use export int.Int
use export set.Fset
......@@ -61,7 +60,7 @@ theory Graph
Two cases depending on l3=[] (and thus u=v) conclude the proof. Qed.
*)
clone pigeon.ListAndSet with type t = vertex
clone import pigeon.ListAndSet with type t = vertex
predicate cyc_decomp (v: vertex) (l: list vertex)
(vi: vertex) (l1 l2 l3: list vertex) =
......
......@@ -8,10 +8,10 @@
module BinarySqrt
use import real.Real
use int.Int
use real.MinMax
use real.FromInt
use real.Truncate
use int.Int as Int
use real.MinMax as MinMax
use real.FromInt as FromInt
use real.Truncate as Truncate
let rec sqrt (r: real) (eps: real) (ghost n:int) (ghost eps0:real) : real
requires { 0.0 <= r }
......
......@@ -20,7 +20,7 @@ module BinomialHeap
type elt
val predicate le elt elt
clone relations.TotalPreOrder with type t = elt, predicate rel = le, axiom .
clone import relations.TotalPreOrder with type t = elt, predicate rel = le, axiom .
(** Trees.
......
......@@ -18,7 +18,7 @@ module BitCount8bit_fact
lemma nth_as_bv_is_int : forall a i.
t'int (nth_as_bv a i) = nth_as_int a (t'int i)
use import int.EuclideanDivision
use import int.EuclideanDivision
let ghost step1 (n x1 : t) (i : int) : unit
requires { 0 <= i < 4 }
......@@ -390,7 +390,7 @@ module AsciiCode
odd number of changes on a valid ascii character, the result
will be invalid, hence the validity of the encoding. *)
use Hamming
use import Hamming
let rec lemma tmp (a b : t) (i j : int)
requires { i < j }
......
......@@ -22,8 +22,8 @@ module Test_proofinuse
(* Mask example --------------------- *)
use bv.BV8
use bv.BV64
use bv.BV8 as BV8
use bv.BV64 as BV64
use bv.BVConverter_32_64 as C32_46
use bv.BVConverter_8_32 as C8_32
......
......@@ -375,8 +375,8 @@ theory BV32_64
use import int.Int
use BV32
use BV64
use BV32 as BV32
use BV64 as BV64
function concat BV32.bv BV32.bv : BV64.bv
......
......@@ -7,11 +7,11 @@ theory DoubleOfInt
use import real.RealInfix
use import real.FromInt
use power2.Pow2int
use power2.Pow2real
use bitvector.BV32
use bitvector.BV64
use bitvector.BV32_64
use power2.Pow2int as Pow2int
use power2.Pow2real as Pow2real
use bitvector.BV32 as BV32
use bitvector.BV64 as BV64
use bitvector.BV32_64 as BV32_64
use import double.BV_double
(*********************************************************************)
......
......@@ -143,16 +143,10 @@ theory Pow2real
lemma Power_sum : forall n m: int. pow2 (n+m) = pow2 n *. pow2 m
use Pow2int
use Pow2int as P2I
use import real.FromInt
lemma Pow2_int_real:
forall x:int. x >= 0 -> pow2 x = from_int (Pow2int.pow2 x)
forall x:int. x >= 0 -> pow2 x = from_int (P2I.pow2 x)
end
(*
Local Variables:
compile-command: "why3 ide power2.why"
End:
*)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment