PageRenderTime 15ms CodeModel.GetById 11ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/lib/backtracking/node/backtracking_node_not.e

http://github.com/tybor/Liberty
Specman e | 62 lines | 23 code | 6 blank | 33 comment | 0 complexity | f574a3d290679cc01cc98a52d88435dc MD5 | raw file
 1-- This file is part of a Liberty Eiffel library.
 2-- See the full copyright at the end.
 3--
 4class BACKTRACKING_NODE_NOT
 5   --
 6   -- node that negate a node what mean that the exploration
 7   -- will be continued if exploration of the subnode is stopped
 8   -- and conversely.
 9   --
10
11inherit
12   BACKTRACKING_NODE_UNARY
13
14insert
15   BACKTRACKING_NODE_GLOBALS
16
17create {ANY}
18   make
19
20feature {ANY}
21   explore (explorer: BACKTRACKING)
22      do
23         -- insert a cut point
24         explorer.push_cut_point
25         -- create a call to continuation
26         explorer.push_or(the_true_node)
27         -- evaluate 'node' now
28         explorer.set_current_node(node)
29         -- and if it's a success the following node
30         -- will remove the or by a cut and will fail
31         explorer.push_and(the_cut_and_false_node)
32      end
33
34feature {}
35   do_fill_tagged_out_memory
36      do
37         tagged_out_memory.append(once "not (")
38         node.fill_tagged_out_memory
39         tagged_out_memory.append(once ")")
40      end
41
42end -- class BACKTRACKING_NODE_NOT
43--
44-- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file.
45--
46-- Permission is hereby granted, free of charge, to any person obtaining a copy
47-- of this software and associated documentation files (the "Software"), to deal
48-- in the Software without restriction, including without limitation the rights
49-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
50-- copies of the Software, and to permit persons to whom the Software is
51-- furnished to do so, subject to the following conditions:
52--
53-- The above copyright notice and this permission notice shall be included in
54-- all copies or substantial portions of the Software.
55--
56-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
57-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
58-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
59-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
60-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
61-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
62-- THE SOFTWARE.