]> matita.cs.unibo.it Git - helm.git/blob - helm/mathql/doc/mathql_tests.tex
ocaml 3.09 transition
[helm.git] / helm / mathql / doc / mathql_tests.tex
1 \section{A use case: retrieving the transitive principles} 
2
3 In this section we briefly present one on the many queries that we are using
4 to test {\MathQL}.4: the one that retrieves the transitive principles stored
5 in the {\HELM} library. The details on the {\RDF} metadata used to index the
6 contents of the library can be found in \cite{Sch02,Gui03,GSC03}.
7 This query, executed in {\MySQL}-mode on an AMD Athlon 1.5 GHz, retrieved 
8 $55$ {\HELM} objects (out of $41451$) in $4.00s$ (the interpreter worked
9 for $0.31s$) after having issued $2205$ {\SQL} queries to the underlying
10 database. This test was executed on April 2 2004 by the Author.
11
12 \begin{footnotesize} \begin{verbatim}
13 gen /"helm"/"aliases" in let $sets = property inverse /"refSort" istrue 
14 /"h:sort" in $SET, /"h:position" in $MC, /"h:depth" in "0" of "" in let
15 $prop = property inverse /"refSort" istrue /"h:sort" in $PROP, 
16 /"h:position" in $MC, /"h:depth" in "2" of "" in let $rels0 = for @uri
17 in $prop sup add {/"set" = property /"refObj" main /"h:occurrence" istrue
18 /"h:position" in $MH of @uri} in @uri in let $rels = select @uri from
19 $rels0 where ex ((count @uri./"set" eq "1") and (@uri./"set" sub $sets))
20 in let $trans0 = for @uri in $rels sup add {/"rel" = @uri; /"set" = proj
21 /"set" of @uri} in property inverse /"refObj" main /"h:occurrence" istrue
22 /"h:position" in $MC, /"h:depth" in "5" of @uri in let $trans1 = for @uri
23 in $trans0 sup add distr {/"premises" = property /"refObj" main /"h:occur
24 rence" istrue /"h:position" in $MH of @uri; /"extra" = property /"refObj"
25 main /"h:occurrence" istrue /"h:position" in {$IC, $IH} of @uri} in @uri
26 in let $trans = select @uri from $trans1 where ex (not @uri./"extra" and
27 (@uri./"premises" sub {@uri./"rel", @uri./"set"})) in keep $trans
28 \end{verbatim} \end{footnotesize} %$
29
30 \input{mathql_tests_transitive}