]> matita.cs.unibo.it Git - helm.git/blob - helm/software/components/ng_tactics/andOrTree.mli
- dual_rg: renamed to complete_rg [as suggested in the ToCL documentation]
[helm.git] / helm / software / components / ng_tactics / andOrTree.mli
1 (*
2     ||M||  This file is part of HELM, an Hypertextual, Electronic        
3     ||A||  Library of Mathematics, developed at the Computer Science     
4     ||T||  Department, University of Bologna, Italy.                     
5     ||I||                                                                
6     ||T||  HELM is free software; you can redistribute it and/or         
7     ||A||  modify it under the terms of the GNU General Public License   
8     \   /  version 2 or (at your option) any later version.      
9      \ /   This software is distributed as is, NO WARRANTY.     
10       V_______________________________________________________________ *)
11
12 (* $Id: nCic.ml 9058 2008-10-13 17:42:30Z tassi $ *)
13
14 type andT
15 type orT
16
17 type ('s,'g) tree = ([ `And of 's | `Or ], 'g) ZipTree.tree
18 type ('a,'s,'g) position = ('a,[ `And of 's | `Or ], 'g) ZipTree.position
19
20 type ('s,'g) subtreeA = 
21   Solution of 's | Todo of (andT,'s,'g) position
22
23 type ('s,'g) subtreeO = 
24   Unexplored | Alternatives of (orT,'s,'g) position
25
26 (* fails if Nil *)
27 val start : ('s,'g) tree -> (andT,'s,'g) position
28
29 val upA    : (andT,'s,'g) position -> (orT,'s,'g) position option
30 val upO    : (orT,'s,'g) position -> (andT,'s,'g) position 
31 val downA : (andT,'s,'g) position -> ('s,'g) subtreeO
32 val downO : (orT,'s,'g) position -> ('s,'g) subtreeA
33
34 val left  : ('a,'s,'g) position -> ('a,'s,'g) position option
35 val right : ('a,'s,'g) position -> ('a,'s,'g) position option
36
37 val is_top : (orT,'s,'g) position -> bool
38 val is_nil : (andT,'s,'g) position -> bool
39 val is_solved_leaf : (orT,'s,'g) position -> bool
40
41 val get_leaf_solution : (orT,'s,'g) position -> 's
42
43 val root: ('a,'s,'g) position -> ('s,'g) tree
44
45 val getA: (andT,'s,'g) position -> 's * 'g
46 val getO: (orT,'s,'g) position -> 'g
47 val setA: 's -> 'g -> (andT,'s,'g) position -> (andT,'s,'g) position
48 val setO: 'g -> (orT,'s,'g) position -> (orT,'s,'g) position
49
50 val inject: ('s,'g) tree -> ('a,'s,'g) position -> ('a,'s,'g) position
51 val eject: ('a,'s,'g) position -> ('s,'g) tree
52
53 val dump: ('g -> string) -> 
54             ('a,'s,'g) position -> Format.formatter -> unit
55
56