File: returns.mlw

package info (click to toggle)
why3 1.8.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 45,028 kB
  • sloc: xml: 185,443; ml: 111,224; ansic: 3,998; sh: 2,578; makefile: 2,568; java: 865; python: 720; javascript: 290; lisp: 205; pascal: 173
file content (118 lines) | stat: -rw-r--r-- 1,712 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
module Return1
  use int.Int
  use mach.java.lang.Integer

  type t = {
    mutable a : integer;
    mutable b : integer;
  }

  let g(_ : integer) : unit =
     ()

  let f(self [@W:unused_variable:N] : t) (_ : integer) : unit =
    ()

end


module Return2
  use int.Int
  use mach.java.lang.Integer

  type t = {
    mutable a : integer;
    mutable b : integer;
  }

  let g(_ : integer) : unit =
     ()

  let f(self [@W:unused_variable:N] : t) (i : integer) : unit =
      g i 


end

module Return3
  use int.Int
  use mach.java.lang.Integer

  type t = {
    mutable a : integer;
    mutable b : integer;
  }

  let g(_ _ : integer) : unit =
     ()
     
  let f(self [@W:unused_variable:N] : t) (i j : integer) : unit =    
    let b = i < j in
    if b then
      g i j    
    

     

end

module Return4
  use int.Int
  use mach.java.lang.Integer

  type t = {
    mutable a : integer;
    mutable b : integer;
  }

  let g(_ _ : integer) : unit =
     ()
     
  let f(self [@W:unused_variable:N] : t) (i j : integer) : unit =  
    let b = i < j in
    if b then begin
      g i j;
      return;      
    end;
    g j i
  

end

module Return5
  use int.Int
  use mach.java.lang.Array
  use mach.java.lang.Integer

  let f (v : array integer) : unit
  = 
    for i = 0 to v.length -1 do
      v[i] <- i
    done

  let h (v : array integer) : unit
  = 
    for i = 0 to v.length -1 do
      v[i] <- i+1
    done

  let g (v : array integer) : unit
  =
    if v.length > 5 then
    begin
      f v;
      return;
    end;
    h v  
end


module Return6
  use int.Int
  use mach.java.lang.Integer

  let f( a b : integer) : bool
  = if a < b then 
      return not (a <b );
    return a < b; 
end