]> matita.cs.unibo.it Git - helm.git/blob - helm/searchEngine/html/set.html
snapshot:
[helm.git] / helm / searchEngine / html / set.html
1 <HTML>
2 <HEAD>
3 <SCRIPT language="Javascript">
4 var inputok=0;
5 function listrvars()
6         {
7         for (num=0; num<top.norvars; num++)
8                 {
9                 document.write("<OPTION value="+top.rvars[num]+">"+top.rvars[num]);
10                 }
11         }
12 function listsvars()
13         {
14         for (num=0; num<top.nosvars; num++)
15                 {
16                 document.write("<OPTION value="+top.svars[num]+">"+top.svars[num]);
17                 }
18         }
19 function listvvars()
20         {
21         for (num=0; num<top.novvars; num++)
22                 {
23                 document.write("<OPTION value="+top.vvars[num]+">"+top.vvars[num]);
24                 }
25         }
26 function help()
27         {
28 with (document.form1) {
29         if (selopt[0].checked)
30         alert ("Turns a list of strings which cannot have attributes (the [val]) in a list of strings which can have them, but initially has none (a [set]).");
31         if (selopt[1].checked)
32         alert ("Taken a list of posix regular expressions, 'pattern [val]' searches the HELM library for all the URIs which match with at least one of those and returns a [set] representing them.");
33         if (selopt[2].checked)
34         alert ("A [svar] represents a list of URIs with attributes.");
35         if (selopt[3].checked)
36         alert ("A [rvar] is a single URI with attributes.");
37         if (selopt[4].checked)
38         alert ("Parenthesis are employed to force precedence between operators.");
39         if (selopt[5].checked)
40         alert ("The [path] you must enter represents a relation; this production returns a [set] composed by the union of all the URIs which match the chosen relation in the [val] you will enter afterwards, without attributes. If you select 'inverse', you'll obtain a list of all the URIs for which the [val] matches the chosen relation, 'sub' and 'super' modify the result depending on the chosen relation and the last input box allows you to add attributes to the result.");
41         if (selopt[6].checked)
42         alert ("This production returns a [set] composed by all the URIs in the given [set] which match the condition in the given [boole].");
43         if (selopt[7].checked)
44         alert ("'Union' returns a [set] which is the union of the two given [set]; should an URI be present in each [set] with different attributes, it will be included in the result only once with all the attributes.\n'Intersect' returns a [set] which contains the cartesian product of the URIs listed in each given [set].\n'Diff' returns a [set] which contains the URIs found in the first given [set] but not in the second. Attributes are ignored.");
45         if (selopt[8].checked)
46         alert ("Allows you to assign a value to a [svar]");
47         if (selopt[9].checked)
48         alert ("Allows you to assign a value to a [vvar]");
49         }
50         }
51 function choice()
52 {
53 top.stadd="";
54 with (document.form1) {
55         inputok=0;voidfield=0;top.wrong=0;
56         if (selopt[0].checked) {
57                 top.stadd="ref [val]";
58                 inputok=1;
59                                           }
60         if (selopt[1].checked) {
61                 top.stadd="pattern [val]";
62                 inputok=1;
63                                           }
64         if (selopt[2].checked) {
65                 top.stadd=set1.value;
66                 if (set1.value!="") {inputok=1} else voidfield=1;
67                                           }
68         if (selopt[3].checked) {
69                 top.stadd=set2.value;
70                 if (set2.value!="") {inputok=1} else voidfield=1;
71                                           }
72         if (selopt[4].checked) {
73                 top.stadd="([set])";
74                 inputok=1;
75                                           }
76         if (selopt[5].checked) {
77                 if (set5.value.charAt(set5.value.length-1)==","){set5.value=set5.value.substring(0,set5.value.length-1)}
78                 if (set5.value.length<7) {set5.value=""};
79                 set4.value=top.tpa(set4.value);
80                 top.stadd="relation "+set25.value+" "+set3.value+" "+set4.value+" [val] "+set5.value;
81                 top.gramcheck("qp",set4.value);
82                 //alert(set5.value.charAt(set5.value.length-1));
83                 top.stadd=top.tpa(top.stadd);
84                 //while (top.stadd.indexOf("<")>-1)
85                         //{top.stadd=top.stadd.replace("<","&lt;");}
86                 if (set5.value!="")
87                 {top.gramcheck("vlist",set5.value);}
88                 else inputok=1;
89                                           }
90         if (selopt[6].checked) {
91                 top.stadd="select @"+set6.value+" in [set] where [boole]";
92                 top.gramcheck("id",set6.value);
93                 if ((set6.value!="") && (inputok==1))
94                         {
95                         top.rvars[top.norvars]="@"+set6.value;
96                         top.norvars++;  
97                         }
98                                           }
99         if (selopt[7].checked) {
100                 top.stadd="[set] "+set7.value+" [set]";
101                 inputok=1;      
102                                           }
103         if (selopt[8].checked) {
104                 top.stadd="let %"+set8.value+" be [set] in [set]";
105                 top.gramcheck("id",set8.value);
106                 if ((set8.value!="") && (inputok==1))
107                         {
108                         top.svars[top.nosvars]="%"+set8.value;
109                         top.nosvars++;  
110                         }
111                                           }
112         if (selopt[9].checked) {
113                 top.stadd="let $"+set9.value+" be [val] in [set]";
114                 top.gramcheck("id",set9.value);
115                 if ((set9.value!="") && (inputok==1))
116                         {
117                         top.vvars1[top.novvars1]="$"+set9.value;
118                         top.novvars1++; 
119                         }
120                                           }
121         if (selopt[10].checked) {
122                 set10.value=top.tpa(set10.value);
123                 top.stadd=set10.value;
124                 if (set10.value!="") {inputok=1} else voidfield=1;
125                                           }
126                    }
127 if (top.stadd!="" && inputok==1) {top.aggq()}
128         else if (voidfield==1) alert("You left at least one field unfilled");
129 }
130 </SCRIPT>
131 </HEAD>
132 <BODY>
133 <h1> <SCRIPT language="Javascript">document.write(top.ltr) </SCRIPT>
134 <input type="button" value="&lt;-" onmouseOver="top.help(-8)" onclick="top.annulla()">
135 <input type="button" value="-&gt;" onmouseOver="top.help(-81)" onclick="top.ripristina()"></h1>
136 <h2> Select one of the following: </h2>
137 <form name="form1" action="Javascript:choice();" method="get">
138 <input type="radio" name="selopt"> ref [val] <br>
139 <input type="radio" name="selopt"> pattern [val] <br>
140 <input type="radio" name="selopt"> <select name="set1" type=text onFocus="selopt[2].checked=true;top.help(6)"> 
141 <SCRIPT language=Javascript> listsvars(); </SCRIPT>
142 </select>
143 <br>
144 <input type="radio" name="selopt"> <select name="set2" type=text onFocus="selopt[3].checked=true;top.help(4)">
145 <SCRIPT language=Javascript> listrvars(); </SCRIPT>
146 </select>
147 <br>
148 <input type="radio" name="selopt"> ( [set] ) <br>
149 <input type="radio" name="selopt"> relation 
150 <select name="set25" onFocus="selopt[5].checked=true">
151 <OPTION selected value="">  
152 <OPTION value=inverse> inverse
153 </select> 
154 <select name="set3" onFocus="selopt[5].checked=true">
155 <OPTION selected value=""> 
156 <OPTION value=sub> sub
157 <OPTION value=super> super
158 </select> 
159 <input name="set4" type=text size=15 value="&quot;&quot;" onFocus="selopt[5].checked=true;top.help(5)">
160 [val] <input name="set5" type=text size=20 onFocus="selopt[5].checked=true;top.help(2);if (this.value=='') this.value='attr $';">
161 <br>
162 <input type="radio" name="selopt"> select @ <input name="set6" type=text onFocus="selopt[6].checked=true;top.help(3)"> 
163 in [set] where [boole] <br> <input type="radio" name="selopt"> [set] 
164 <select name="set7" onFocus="selopt[7].checked=true">
165 <OPTION value=union> union
166 <OPTION value=intersect> intersect
167 <OPTION value=diff> diff
168 </select> 
169 [set]  <br>
170 <input type="radio" name="selopt"> let %<input name="set8" type=text onFocus="selopt[8].checked=true;top.help(3)"> be [set] in [set] <br>
171 <input type="radio" name="selopt"> let $<input name="set9" type=text onFocus="selopt[9].checked=true;top.help(3)"> be [val] in [set] <br>
172 <input type="radio" name="selopt"> <input name="set10" type=text 
173 onFocus="selopt[10].checked=true;top.help(1)">  <br>
174 <input type="submit" value="compose"><input type="button" value="get help" onclick="help()">
175 <!--input type="button" value="compose" onclick="choice()"><!--input type="button" value="get help" onclick="help()">
176 </form>
177 </BODY>
178 </HTML>