Commit 3e6e8fbf authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2004-07-03 16:36:40 by vbenzake] Empty log message

Original author: vbenzake
Date: 2004-07-03 16:36:40+00:00
parent b1718f90
......@@ -10,9 +10,10 @@ test it on the <a href="cgi-bin/cduce">online interpreter</a>.
</p>
</left>
<box title="XPath-like expressions" link="xpath">
<p> XPath-like expressions are of two kind :
<code> %%e%%/%%t%% </code> and <code> %%e%%/@%%a%% </code> where <code>%%e%%</code> is an expression, <code> %%t%% </code> a type, and <code> %%a%% </code> an attribute.
<b style="color:#FF0080">TO BE DONE</b>
</p>
</box>
......@@ -39,6 +40,188 @@ where <code>%%e%%</code> is an expression <code>%%b%%</code> a boolean expressio
</box>
<box title="Example" link="exsel">
<p>
<b> A first classical example </b>
</p>
<sample><![CDATA[
type Biblio = <bibliography>[Heading Paper*]
type Heading = <heading>[ PCDATA ]
type Paper = <paper>[ Author+ Title Conference File ]
type Author = <author>[ PCDATA ]
type Title = <title>[ PCDATA ]
type Conference = <conference>[ PCDATA ]
type File = <file>[ PCDATA ]
let bib : Biblio =
<bibliography>[
<heading>"Alain Frisch's bibliography"
<paper>[
<author>"Alain Frisch"
<author>"Giuseppe Castagna"
<author>"Veronique Benzaken"
<title>"Semantic subtyping"
<conference>"LICS 02"
<file>"semsub.ps.gz"
]
<paper>[
<author>"Mariangiola Dezani-Ciancaglini"
<author>"Alain Frisch"
<author>"Elio Giovannetti"
<author>"Yoko Motohama"
<title>"The Relevance of Semantic Subtyping"
<conference>"ITRS'02"
<file>"itrs02.ps.gz"
]
<paper>[
<author>"Veronique Benzaken"
<author>"Giuseppe Castagna"
<author>"Alain Frisch"
<title>"CDuce: a white-paper"
<conference>"PLANX-02"
<file>"planx.ps.gz"
]
]
let titles = [bib]/<paper>_/<title>_
let authors = [bib]/<paper>_/<author>_
let titles_concat = [bib]/<paper>_/<title>_/Char
let papers = [bib]/<paper>_
let tquery = select y from x in [bib]/<paper>_ ,
y in [x]/<title>_
let tryit = flatten(select [x] from x in [bib]/<paper>_/<title>_)
select y from x in [bib]/<paper>_ ,
y in [x]/<title>_,
z in [x]/<author>_
where z = <author>"Yoko Motohama"
select y from x in [bib]/<paper>_ ,
y in [x]/<title>_,
<author>"Yoko Motohama"in [x]/<author>_
]]>
</sample>
<p> Which gives the following result </p>
<sample><![CDATA[
val bib : Biblio = <bibliography>[
<heading>[ 'Alain Frisch\'s bibliography' ]
<paper>[
<author>[ 'Alain Frisch' ]
<author>[ 'Giuseppe Castagna' ]
<author>[ 'Veronique Benzaken' ]
<title>[ 'Semantic subtyping' ]
<conference>[ 'LICS 02' ]
<file>[ 'semsub.ps.gz' ]
]
<paper>[
<author>[ 'Mariangiola Dezani-Ciancaglini' ]
<author>[ 'Alain Frisch' ]
<author>[ 'Elio Giovannetti' ]
<author>[ 'Yoko Motohama' ]
<title>[ 'The Relevance of Semantic Subtyping' ]
<conference>[ 'ITRS\'02' ]
<file>[ 'itrs02.ps.gz' ]
]
<paper>[
<author>[ 'Veronique Benzaken' ]
<author>[ 'Giuseppe Castagna' ]
<author>[ 'Alain Frisch' ]
<title>[ 'CDuce: a white-paper' ]
<conference>[ 'PLANX-02' ]
<file>[ 'planx.ps.gz' ]
]
]
val titles : [ <title>[ Char* ]* ] = [ <title>[ 'Semantic subtyping' ]
<title>[ 'The Relevance of Semantic Subtyping' ]
<title>[ 'CDuce: a white-paper' ]
]
val authors : [ <author>[ Char* ]* ] = [ <author>[ 'Alain Frisch' ]
<author>[ 'Giuseppe Castagna' ]
<author>[ 'Veronique Benzaken' ]
<author>[ 'Mariangiola Dezani-Ciancaglini' ]
<author>[ 'Alain Frisch' ]
<author>[ 'Elio Giovannetti' ]
<author>[ 'Yoko Motohama' ]
<author>[ 'Veronique Benzaken' ]
<author>[ 'Giuseppe Castagna' ]
<author>[ 'Alain Frisch' ]
]
val titles_concat : [ Char* ] = "Semantic subtypingThe Relevance of Semantic Sub\
:typingCDuce: a white-paper"
val papers : [ <paper>[ Author+ Title Conference File ]* ] = [ <paper>[
<author>[ 'Alain Frisch' ]
<author>[ 'Giuseppe Castagna' ]
<author>[ 'Veronique Benzaken' ]
<title>[ 'Semantic subtyping' ]
<conference>[ 'LICS 02' ]
<file>[ 'semsub.ps.gz' ]
]
<paper>[
<author>[ 'Mariangiola Dezani-Ciancaglini' ]
<author>[ 'Alain Frisch' ]
<author>[ 'Elio Giovannetti' ]
<author>[ 'Yoko Motohama' ]
<title>[ 'The Relevance of Semantic Subtyping' ]
<conference>[ 'ITRS\'02' ]
<file>[ 'itrs02.ps.gz' ]
]
<paper>[
<author>[ 'Veronique Benzaken' ]
<author>[ 'Giuseppe Castagna' ]
<author>[ 'Alain Frisch' ]
<title>[ 'CDuce: a white-paper' ]
<conference>[ 'PLANX-02' ]
<file>[ 'planx.ps.gz' ]
]
]
val tquery : [ <title>[ Char* ]* ] = [ <title>[ 'Semantic subtyping' ]
<title>[ 'The Relevance of Semantic Subtyping' ]
<title>[ 'CDuce: a white-paper' ]
]
val tryit : [ <title>[ Char* ]* ] = [ <title>[ 'Semantic subtyping' ]
<title>[ 'The Relevance of Semantic Subtyping' ]
<title>[ 'CDuce: a white-paper' ]
]
- : [ <title>[ Char* ]* ] = [ <title>[ 'The Relevance of Semantic Subtyping' ] ]
- : [ <title>[ Char* ]* ] = [ <title>[ 'The Relevance of Semantic Subtyping' ] ]
Ok.
]]>
</sample>
<p>
<b> A pure pattern example </b>
</p>
<sample><![CDATA[
<books-with-prices>
select <book-with-price>[t1
<price-amazon>p2
<price-bn>p1 ]
from <bib>[b::Book*] in [biblio],
<book year=y\&(1991--*)>[t1&Title _* <price>p1] in b,
<reviews>[e::Entry*] in [amazon],
<entry>[t2&Title <price>p2 ;_] in e
where t1=t2]]>
</sample>
<p>
<b>Formatted table generation</b>
</p>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment