PageRenderTime 14ms CodeModel.GetById 7ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/tools/semantics/code/assertions/liberty_composed_assertions.e

http://github.com/tybor/Liberty
Specman e | 69 lines | 47 code | 8 blank | 14 comment | 1 complexity | b7d4441152c3a5027f5e4778532c1e53 MD5 | raw file
 1-- This file is part of Liberty Eiffel.
 2--
 3-- Liberty Eiffel is free software: you can redistribute it and/or modify
 4-- it under the terms of the GNU General Public License as published by
 5-- the Free Software Foundation, version 3 of the License.
 6--
 7-- Liberty Eiffel is distributed in the hope that it will be useful,
 8-- but WITHOUT ANY WARRANTY; without even the implied warranty of
 9-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10-- GNU General Public License for more details.
11--
12-- You should have received a copy of the GNU General Public License
13-- along with Liberty Eiffel.  If not, see <http://www.gnu.org/licenses/>.
14--
15deferred class LIBERTY_COMPOSED_ASSERTIONS
16
17inherit
18   LIBERTY_ASSERTIONS
19
20feature {ANY}
21   left, right: LIBERTY_ASSERTIONS
22
23feature {LIBERTY_REACHABLE, LIBERTY_REACHABLE_COLLECTION_MARKER}
24   mark_reachable_code (mark: INTEGER) is
25      do
26         left.mark_reachable_code(mark)
27         right.mark_reachable_code(mark)
28      end
29
30feature {LIBERTY_FEATURE, LIBERTY_ASSERTIONS}
31   specialized_in (a_type: LIBERTY_ACTUAL_TYPE): like Current is
32      local
33         l, r: LIBERTY_ASSERTIONS
34      do
35         l := left.specialized_in(a_type)
36         r := right.specialized_in(a_type)
37         if l = left and then r = Void then
38            Result := Current
39         else
40            Result := twin
41            Result.set_specialized_in(l, r)
42         end
43      end
44
45feature {LIBERTY_COMPOSED_ASSERTIONS}
46   set_specialized_in (l: like left; r: like right) is
47      do
48         left := l
49         right := r
50      end
51
52feature {}
53   make (a_left: like left; a_right: like right) is
54      require
55         a_left /= Void
56         a_right /= Void
57      do
58         left := a_left
59         right := a_right
60      ensure
61         left = a_left
62         right = a_right
63      end
64
65invariant
66   left /= Void
67   right /= Void
68
69end