SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Downloaden Sie, um offline zu lesen
Venice, 7-11 Oct 2002 Monterey Workshop 2002 1
Higher Order Applicative
XML
Carlos Delgado Kloos
with P.T. Breuer, V. Luque, L. Sánchez
Universidad Carlos III de
Madrid
www.it.uc3m.es
Venice, 7-11 Oct 2002Monterey Workshop 2002 2
What is the most successful
format to represent data?
XML
Venice, 7-11 Oct 2002Monterey Workshop 2002 3
XML represents structure
XML allows to represent
hierarchical information
The elements of the hierarchy are
not predefined
XML allows to invent languages of
multiple brackets
{ []() }
Venice, 7-11 Oct 2002Monterey Workshop 2002 4
Structure: Hierarchy
"The structure of concepts is formally called
a hierarchy and since ancient times has
been a basic structure for all western
knowledge. Kingdoms, empires, churches,
armies have all been structured into
hierarchies. Tables of contents of reference
material are so structured, mechanical
assemblies, computer software, all
scientific and technical knowledge is so
structured..."
-- Robert M. Pirsig:
Zen and the Art of Motorcycle Maintenance
Venice, 7-11 Oct 2002Monterey Workshop 2002 5
Areas of application
Accounting
MarketingBusiness
EducationCommunication
Banking
Automotive
Insurances
Human
resourcesHealth
ERP
Chemistry
Mathematics
News
Law
Workflow
Software
Tourism
Venice, 7-11 Oct 2002Monterey Workshop 2002 6
Success of XML
XML has had a lot of success, much
more than their authors could expect
Not just for the reason they expected
Separation of form and content
But for a reason, they had not thought of
Data has to travel trough the net
The tree structure is a format useful
for any kind of data
XML is used as a data transfer mechanism
Venice, 7-11 Oct 2002Monterey Workshop 2002 7
What is XML?
"XML is ASCII for the 21st
century."
-- Henry S. Thompson,
U Edinburgh & W3C
Venice, 7-11 Oct 2002Monterey Workshop 2002 8
HTML and JavaScript
<HTML>
<HEAD><TITLE>JavaScript</TITLE></HEAD
>
<BODY>
Text<P>
i=1<BR>
i=2<BR>
i=3<BR>
</BODY>
</HTML>
Venice, 7-11 Oct 2002Monterey Workshop 2002 9
HTML and JavaScript
<HTML>
<HEAD><TITLE>JavaScript</TITLE></HEAD
>
<BODY>
Text<P>
<SCRIPT LANGUAGE="JavaScript"> <!--
for (i=0; i<3; ++i)
document.write("i=" + i + "<BR>");
// -->
</SCRIPT>
</BODY>
</HTML>
Venice, 7-11 Oct 2002Monterey Workshop 2002 10
Objective
Extend XML to "higher order texts"
do not add to it
do not change it
do not write a separate language
do reinterpret XML semantics in a larger
universe
do conserve the initial semantics
do anything that is natural in a categoric
sense
Venice, 7-11 Oct 2002Monterey Workshop 2002 11
The problem with XML
XML can express data
basic types and free data types
XML cannot express function
a separate language is used to
traverse XML data
Advantage or disadvantage?
Venice, 7-11 Oct 2002Monterey Workshop 2002 12
An idea: Syntax
Let
<f> a </f>
mean "apply function f to argument
a"
Venice, 7-11 Oct 2002Monterey Workshop 2002 13
An idea: Semantics
Let XML documents take arguments
An abstract document f is
function :: [Doc] -> [Doc]
A simple document s is a string or other
basic type
string, integer:: Doc
Virtual document is calculated, sometimes
trivially so
apply function f to argument a
XML documents use f which are free datatype
constructors
Venice, 7-11 Oct 2002Monterey Workshop 2002 14
Example
<element name="double"
type="string" maxOccurs="unbounded">
<resultType maxOccurs="unbounded">
string
</resultType>
<def var="x">x x</def>
</element>
Venice, 7-11 Oct 2002Monterey Workshop 2002 15
<element name="Point">
<complexType>
<element name="x" type="integer"/>
<element name="y" type="integer"/>
</complexType>
<resultType>float</resultType>
<def>sqrt(sqr(x)+sqr(y))
</def>
</element>
Example
Venice, 7-11 Oct 2002Monterey Workshop 2002 16
Language Syntax: Basics
Juxtaposition is concatenation of
lists
<a>hello</a>
is both in type a and in type a*
<a>hello</a> <a>there</a>
is of type a*
Venice, 7-11 Oct 2002Monterey Workshop 2002 17
Language Syntax: Basics
Function application is via tags,
but functions are by default the
free datatype constructor
<a>hello</a> is of type a
Function definition needs a special
metatag
<def name=a var=x>
<def.val> x x </def.val> ... </def>
Venice, 7-11 Oct 2002Monterey Workshop 2002 18
Document Layout
Header section (DTD)
types of functions and other tags
Definition section
semantics of functions
Text section (document)
XML or HOAX document interpreted
according to definitions given
Venice, 7-11 Oct 2002Monterey Workshop 2002 19
Example
<!DOCTYPE example [
<!ELEMENT example (ANY*)>
<!ELEMENT ANY* dbl (ANY*)>
]>
<example>
<def name="dbl" var="x">
<def.val> x x </def.val>
<dbl><dbl>bye</dbl></dbl>
</def>
</example>
<example>
byebyebyebye
</example>
Venice, 7-11 Oct 2002Monterey Workshop 2002 20
Definition of XML
application
DTD or XML Schema can be used
DTD is used in paper for brevity
DTD normally specifies syntax
in HOAX
syntax = type
type = parser
there are more types than in XML
HOAX function types are not free type
declarations
a "result type" precedes the function name
DTD declarations are local in HOAX
Venice, 7-11 Oct 2002Monterey Workshop 2002 21
Meta Tags
HOAX introduces 4 (really 2)
special tags
<def> for binding a name to a value
<var> for expressing abstraction
<eval> for application of a function to
its arguments
<ref> for dereferencing a variable
Venice, 7-11 Oct 2002Monterey Workshop 2002 22
Example: notes
Scope of a definition is strictly defined
<def ...> ... </def>
A definition has three parts
<def name=... var=... val=...> ...
Attributes can be made into tags
<def name= ... var=...>
<def.val> ... </def.val>
Type definitions use elements and C
types
<!DOCTYPE [<!ELEMENT res fun (arg)>]>
Venice, 7-11 Oct 2002Monterey Workshop 2002 23
Meta Tags
only <def> is common
<var> normally appears within a
<def>
<eval> and <ref> are unusual.
<def name=“a” var=“b” val=“c”>…</def>
means
<def name=“a”>
<def.val><var name=“b”>c</var>
</def.val>…
</def>
Venice, 7-11 Oct 2002Monterey Workshop 2002 24
BNF of HOAX
HOAX ::= <def name=t>
<def.val>xs</def.val> xs' </def>
| <var name=t> xs </var>
| <eval name=t> xs </eval>
| <t> xs </t>
| <ref name=t> | t
where xs is a sequence of HOAX
documents
Function names may be applied as tags.
Simple variable names don't need ref tags.
Venice, 7-11 Oct 2002Monterey Workshop 2002 25
Types
The type system has to be
adjusted to XML
certain things are indistinguishable,
and hence have the same type
a string is indistinguishable from a
singleton list of strings
a sequence of strings is indistinguishable
from a string
a list of a's followed by a list of a's is
indistinguishable from a list of a's, in
general
Venice, 7-11 Oct 2002Monterey Workshop 2002 26
Types
Solved by using the parsers of XML
as types
have inclusions
a | a* means "the parser of a*'s will
parse a"
type equality is not identity, but it does
not matter
Venice, 7-11 Oct 2002Monterey Workshop 2002 27
HOAX types are
parsers of HOAX texts
ambiguous parsers
alternative parsers p | q produce all
possible outcomes
sequence of parsers p q partition the
input in all possible ways and produce
all possible results for each part, then
resequence results
p* = p p* | ε
Venice, 7-11 Oct 2002Monterey Workshop 2002 28
Algebra of types
The model gives rise to inclusions and
equalities
p ⊆ p*, p p*⊆ p*, ...
Type equality is difficult to decide, but
type satisfaction is easy
each type is precisely a mechanism for
checking type satisfaction
each type is a mechanism for evaluating a
text
each document text has a "canonical type"
calculated from its presentation.
Venice, 7-11 Oct 2002Monterey Workshop 2002 29
Canonical types of
document texts
"s" :: #PCDATA
<t> xs </t> :: t
if the construction meets the declared type
constraints for the tag t.
<f> xs </f> :: r
where r is the result type declared for f, provided
xs :: a and a is the declared argument type for f.
<def name=“a” val=“b”> c </def> :: t
where t is the type calculated for c given the
hypothesis that the type of a, wherever it appears
in c, is the same as the type calculated for b.
Venice, 7-11 Oct 2002Monterey Workshop 2002 30
HOAX semantics
Two HOAX documents can look distinct but
mean the same thing
The semantics is defined by "how to parse"
instructions
The instructions are predicated on a type
"how to parse x using type t"
if t is the result type for function tags f which takes
argument type a, then <f> x </f> is parsed by t by
first parsing x with a, then applying the definition of
function f to the results of the parse, then parsing
with t.
Venice, 7-11 Oct 2002Monterey Workshop 2002 31
Can prove ...
That each document has a unique
parse semantics
means that the semantics is well-
defined
That the semantics of functional
application is substitution
means that the parse of a document
with references is the parse of the
document with the references
replaced by the text to which they
Venice, 7-11 Oct 2002Monterey Workshop 2002 32
Advantages
HOAX puts the semantics back into
XML
not only functions were missing, but
reductions of any form to any other form
Do not need a second "transformation
language"
HOAX documents are self-transforming in
situ
Clearly arbitrarily higher order
functionality
"abstract documents are first-class
Venice, 7-11 Oct 2002Monterey Workshop 2002 33
Disadvantages
Might prefer to separate form and
function
There is no mechanism for saying
where to perform a reduction -
here or there
What happens in the case of
unavailable data?
Ditto function?
Venice, 7-11 Oct 2002Monterey Workshop 2002 34
Open issues
Reflexivity
Can HOAX be expressed entirely within
HOAX
Probably, but meaningfully? Usefully?
Circular reference trails
HOAX is careful to apply definitions only in a
well-defined scope.
External references drag in their definitions,
but with scope localized to the reference.
Do mutually dependent external definitions
resolve?
Venice, 7-11 Oct 2002Monterey Workshop 2002 35
Conclusion
Experiment in extending XML to
support functional semantics
Prototyped
Proposed approach to semantics of
XML
use types=parsers, since XML is pure
syntax
use interpreter=parser, since XML is pure
syntax
ergo type=interpreter=parser
Venice, 7-11 Oct 2002Monterey Workshop 2002 36
Conclusion
By giving an interpretation to
tags, one can easily reduce
documents to others (without
XSLT!)
Exploratory work
Venice, 7-11 Oct 2002Monterey Workshop 2002 37
Enjoy Venice!
Venice, 7-11 Oct 2002Monterey Workshop 2002 38
Enjoy Venice!
Venice, 7-11 Oct 2002Monterey Workshop 2002 39

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (18)

Xxe
XxeXxe
Xxe
 
Xml dtd
Xml dtdXml dtd
Xml dtd
 
Sgml and xml
Sgml and xmlSgml and xml
Sgml and xml
 
Xml
XmlXml
Xml
 
Pursuing Domain-Driven Design practices in PHP
Pursuing Domain-Driven Design practices in PHPPursuing Domain-Driven Design practices in PHP
Pursuing Domain-Driven Design practices in PHP
 
Adri Jovin - Semantic Web
Adri Jovin - Semantic WebAdri Jovin - Semantic Web
Adri Jovin - Semantic Web
 
Document Type Definitions
Document Type DefinitionsDocument Type Definitions
Document Type Definitions
 
Document type definition
Document type definitionDocument type definition
Document type definition
 
Xml Presentation-1
Xml Presentation-1Xml Presentation-1
Xml Presentation-1
 
Testing in isolation
Testing in isolationTesting in isolation
Testing in isolation
 
Document Type Definition
Document Type DefinitionDocument Type Definition
Document Type Definition
 
XML Presentation-2
XML Presentation-2XML Presentation-2
XML Presentation-2
 
json
jsonjson
json
 
Xml security overview and canonicalization
Xml security overview and canonicalizationXml security overview and canonicalization
Xml security overview and canonicalization
 
Xml Presentation-3
Xml Presentation-3Xml Presentation-3
Xml Presentation-3
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Difference between dtd and xsd
Difference between dtd and xsdDifference between dtd and xsd
Difference between dtd and xsd
 

Ähnlich wie Higher Order Applicative XML (Monterey 2002)

XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)
XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)
XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)Beat Signer
 
XML and Related Technologies - Web Technologies (1019888BNR)
XML and Related Technologies - Web Technologies (1019888BNR)XML and Related Technologies - Web Technologies (1019888BNR)
XML and Related Technologies - Web Technologies (1019888BNR)Beat Signer
 
Web data management (chapter-1)
Web data management (chapter-1)Web data management (chapter-1)
Web data management (chapter-1)Dhaval Asodariya
 
Xml processing-by-asfak
Xml processing-by-asfakXml processing-by-asfak
Xml processing-by-asfakAsfak Mahamud
 
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
DATA INTEGRATION (Gaining Access to Diverse Data).pptDATA INTEGRATION (Gaining Access to Diverse Data).ppt
DATA INTEGRATION (Gaining Access to Diverse Data).pptcareerPointBasti
 
ravenbenweb xml and its application .PPT
ravenbenweb xml and its application .PPTravenbenweb xml and its application .PPT
ravenbenweb xml and its application .PPTubaidullah75790
 
Working with xml data
Working with xml dataWorking with xml data
Working with xml dataaspnet123
 
LaTeX Part 1
LaTeX Part 1LaTeX Part 1
LaTeX Part 1awv7t
 
Applied xml programming for microsoft
Applied xml programming for microsoftApplied xml programming for microsoft
Applied xml programming for microsoftRaghu nath
 
Using Language Oriented Programming to Execute Computations on the GPU
Using Language Oriented Programming to Execute Computations on the GPUUsing Language Oriented Programming to Execute Computations on the GPU
Using Language Oriented Programming to Execute Computations on the GPUSkills Matter
 
advDBMS_XML.pptx
advDBMS_XML.pptxadvDBMS_XML.pptx
advDBMS_XML.pptxIreneGetzi
 
epicenter2010 Open Xml
epicenter2010   Open Xmlepicenter2010   Open Xml
epicenter2010 Open XmlCraig Murphy
 

Ähnlich wie Higher Order Applicative XML (Monterey 2002) (20)

XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)
XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)
XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)
 
Unit 10: XML and Beyond (Sematic Web, Web Services, ...)
Unit 10: XML and Beyond (Sematic Web, Web Services, ...)Unit 10: XML and Beyond (Sematic Web, Web Services, ...)
Unit 10: XML and Beyond (Sematic Web, Web Services, ...)
 
E05412327
E05412327E05412327
E05412327
 
XML and Related Technologies - Web Technologies (1019888BNR)
XML and Related Technologies - Web Technologies (1019888BNR)XML and Related Technologies - Web Technologies (1019888BNR)
XML and Related Technologies - Web Technologies (1019888BNR)
 
Xml
XmlXml
Xml
 
Web data management (chapter-1)
Web data management (chapter-1)Web data management (chapter-1)
Web data management (chapter-1)
 
ITU - MDD - XText
ITU - MDD - XTextITU - MDD - XText
ITU - MDD - XText
 
Xml processing-by-asfak
Xml processing-by-asfakXml processing-by-asfak
Xml processing-by-asfak
 
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
DATA INTEGRATION (Gaining Access to Diverse Data).pptDATA INTEGRATION (Gaining Access to Diverse Data).ppt
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
 
ravenbenweb xml and its application .PPT
ravenbenweb xml and its application .PPTravenbenweb xml and its application .PPT
ravenbenweb xml and its application .PPT
 
Working with xml data
Working with xml dataWorking with xml data
Working with xml data
 
LaTeX Part 1
LaTeX Part 1LaTeX Part 1
LaTeX Part 1
 
Applied xml programming for microsoft
Applied xml programming for microsoftApplied xml programming for microsoft
Applied xml programming for microsoft
 
Document typesetting using LateX
Document typesetting using LateXDocument typesetting using LateX
Document typesetting using LateX
 
Using Language Oriented Programming to Execute Computations on the GPU
Using Language Oriented Programming to Execute Computations on the GPUUsing Language Oriented Programming to Execute Computations on the GPU
Using Language Oriented Programming to Execute Computations on the GPU
 
Session 5
Session 5Session 5
Session 5
 
advDBMS_XML.pptx
advDBMS_XML.pptxadvDBMS_XML.pptx
advDBMS_XML.pptx
 
Dom
Dom Dom
Dom
 
epicenter2010 Open Xml
epicenter2010   Open Xmlepicenter2010   Open Xml
epicenter2010 Open Xml
 
Intro to xml
Intro to xmlIntro to xml
Intro to xml
 

Mehr von Peter Breuer

Avoiding Hardware Aliasing
Avoiding Hardware AliasingAvoiding Hardware Aliasing
Avoiding Hardware AliasingPeter Breuer
 
Empirical Patterns in Google Scholar Citation Counts (CyberPatterns 2014)
Empirical Patterns in Google Scholar Citation Counts (CyberPatterns 2014)Empirical Patterns in Google Scholar Citation Counts (CyberPatterns 2014)
Empirical Patterns in Google Scholar Citation Counts (CyberPatterns 2014)Peter Breuer
 
Certifying (RISC) Machine Code Safe from Aliasing (OpenCert 2013)
Certifying (RISC) Machine Code Safe from Aliasing  (OpenCert 2013)Certifying (RISC) Machine Code Safe from Aliasing  (OpenCert 2013)
Certifying (RISC) Machine Code Safe from Aliasing (OpenCert 2013)Peter Breuer
 
Tutorial: Formal Methods for Hardware Verification - Overview and Application...
Tutorial: Formal Methods for Hardware Verification - Overview and Application...Tutorial: Formal Methods for Hardware Verification - Overview and Application...
Tutorial: Formal Methods for Hardware Verification - Overview and Application...Peter Breuer
 
A Semantic Model for VHDL-AMS (CHARME '97)
A Semantic Model for VHDL-AMS (CHARME '97)A Semantic Model for VHDL-AMS (CHARME '97)
A Semantic Model for VHDL-AMS (CHARME '97)Peter Breuer
 
The mixed-signal modelling language VHDL-AMS and its semantics (ICNACSA 1999)
The mixed-signal modelling language VHDL-AMS and its semantics (ICNACSA 1999)The mixed-signal modelling language VHDL-AMS and its semantics (ICNACSA 1999)
The mixed-signal modelling language VHDL-AMS and its semantics (ICNACSA 1999)Peter Breuer
 
Raiding the Noosphere
Raiding the NoosphereRaiding the Noosphere
Raiding the NoospherePeter Breuer
 
Abstract Interpretation meets model checking near the 1000000 LOC mark: Findi...
Abstract Interpretation meets model checking near the 1000000 LOC mark: Findi...Abstract Interpretation meets model checking near the 1000000 LOC mark: Findi...
Abstract Interpretation meets model checking near the 1000000 LOC mark: Findi...Peter Breuer
 
Detecting Deadlock, Double-Free and Other Abuses in a Million Lines of Linux ...
Detecting Deadlock, Double-Free and Other Abuses in a Million Lines of Linux ...Detecting Deadlock, Double-Free and Other Abuses in a Million Lines of Linux ...
Detecting Deadlock, Double-Free and Other Abuses in a Million Lines of Linux ...Peter Breuer
 
Open Source Verification under a Cloud (OpenCert 2010)
Open Source Verification under a Cloud (OpenCert 2010)Open Source Verification under a Cloud (OpenCert 2010)
Open Source Verification under a Cloud (OpenCert 2010)Peter Breuer
 

Mehr von Peter Breuer (10)

Avoiding Hardware Aliasing
Avoiding Hardware AliasingAvoiding Hardware Aliasing
Avoiding Hardware Aliasing
 
Empirical Patterns in Google Scholar Citation Counts (CyberPatterns 2014)
Empirical Patterns in Google Scholar Citation Counts (CyberPatterns 2014)Empirical Patterns in Google Scholar Citation Counts (CyberPatterns 2014)
Empirical Patterns in Google Scholar Citation Counts (CyberPatterns 2014)
 
Certifying (RISC) Machine Code Safe from Aliasing (OpenCert 2013)
Certifying (RISC) Machine Code Safe from Aliasing  (OpenCert 2013)Certifying (RISC) Machine Code Safe from Aliasing  (OpenCert 2013)
Certifying (RISC) Machine Code Safe from Aliasing (OpenCert 2013)
 
Tutorial: Formal Methods for Hardware Verification - Overview and Application...
Tutorial: Formal Methods for Hardware Verification - Overview and Application...Tutorial: Formal Methods for Hardware Verification - Overview and Application...
Tutorial: Formal Methods for Hardware Verification - Overview and Application...
 
A Semantic Model for VHDL-AMS (CHARME '97)
A Semantic Model for VHDL-AMS (CHARME '97)A Semantic Model for VHDL-AMS (CHARME '97)
A Semantic Model for VHDL-AMS (CHARME '97)
 
The mixed-signal modelling language VHDL-AMS and its semantics (ICNACSA 1999)
The mixed-signal modelling language VHDL-AMS and its semantics (ICNACSA 1999)The mixed-signal modelling language VHDL-AMS and its semantics (ICNACSA 1999)
The mixed-signal modelling language VHDL-AMS and its semantics (ICNACSA 1999)
 
Raiding the Noosphere
Raiding the NoosphereRaiding the Noosphere
Raiding the Noosphere
 
Abstract Interpretation meets model checking near the 1000000 LOC mark: Findi...
Abstract Interpretation meets model checking near the 1000000 LOC mark: Findi...Abstract Interpretation meets model checking near the 1000000 LOC mark: Findi...
Abstract Interpretation meets model checking near the 1000000 LOC mark: Findi...
 
Detecting Deadlock, Double-Free and Other Abuses in a Million Lines of Linux ...
Detecting Deadlock, Double-Free and Other Abuses in a Million Lines of Linux ...Detecting Deadlock, Double-Free and Other Abuses in a Million Lines of Linux ...
Detecting Deadlock, Double-Free and Other Abuses in a Million Lines of Linux ...
 
Open Source Verification under a Cloud (OpenCert 2010)
Open Source Verification under a Cloud (OpenCert 2010)Open Source Verification under a Cloud (OpenCert 2010)
Open Source Verification under a Cloud (OpenCert 2010)
 

Kürzlich hochgeladen

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Kürzlich hochgeladen (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Higher Order Applicative XML (Monterey 2002)

  • 1. Venice, 7-11 Oct 2002 Monterey Workshop 2002 1 Higher Order Applicative XML Carlos Delgado Kloos with P.T. Breuer, V. Luque, L. Sánchez Universidad Carlos III de Madrid www.it.uc3m.es
  • 2. Venice, 7-11 Oct 2002Monterey Workshop 2002 2 What is the most successful format to represent data? XML
  • 3. Venice, 7-11 Oct 2002Monterey Workshop 2002 3 XML represents structure XML allows to represent hierarchical information The elements of the hierarchy are not predefined XML allows to invent languages of multiple brackets { []() }
  • 4. Venice, 7-11 Oct 2002Monterey Workshop 2002 4 Structure: Hierarchy "The structure of concepts is formally called a hierarchy and since ancient times has been a basic structure for all western knowledge. Kingdoms, empires, churches, armies have all been structured into hierarchies. Tables of contents of reference material are so structured, mechanical assemblies, computer software, all scientific and technical knowledge is so structured..." -- Robert M. Pirsig: Zen and the Art of Motorcycle Maintenance
  • 5. Venice, 7-11 Oct 2002Monterey Workshop 2002 5 Areas of application Accounting MarketingBusiness EducationCommunication Banking Automotive Insurances Human resourcesHealth ERP Chemistry Mathematics News Law Workflow Software Tourism
  • 6. Venice, 7-11 Oct 2002Monterey Workshop 2002 6 Success of XML XML has had a lot of success, much more than their authors could expect Not just for the reason they expected Separation of form and content But for a reason, they had not thought of Data has to travel trough the net The tree structure is a format useful for any kind of data XML is used as a data transfer mechanism
  • 7. Venice, 7-11 Oct 2002Monterey Workshop 2002 7 What is XML? "XML is ASCII for the 21st century." -- Henry S. Thompson, U Edinburgh & W3C
  • 8. Venice, 7-11 Oct 2002Monterey Workshop 2002 8 HTML and JavaScript <HTML> <HEAD><TITLE>JavaScript</TITLE></HEAD > <BODY> Text<P> i=1<BR> i=2<BR> i=3<BR> </BODY> </HTML>
  • 9. Venice, 7-11 Oct 2002Monterey Workshop 2002 9 HTML and JavaScript <HTML> <HEAD><TITLE>JavaScript</TITLE></HEAD > <BODY> Text<P> <SCRIPT LANGUAGE="JavaScript"> <!-- for (i=0; i<3; ++i) document.write("i=" + i + "<BR>"); // --> </SCRIPT> </BODY> </HTML>
  • 10. Venice, 7-11 Oct 2002Monterey Workshop 2002 10 Objective Extend XML to "higher order texts" do not add to it do not change it do not write a separate language do reinterpret XML semantics in a larger universe do conserve the initial semantics do anything that is natural in a categoric sense
  • 11. Venice, 7-11 Oct 2002Monterey Workshop 2002 11 The problem with XML XML can express data basic types and free data types XML cannot express function a separate language is used to traverse XML data Advantage or disadvantage?
  • 12. Venice, 7-11 Oct 2002Monterey Workshop 2002 12 An idea: Syntax Let <f> a </f> mean "apply function f to argument a"
  • 13. Venice, 7-11 Oct 2002Monterey Workshop 2002 13 An idea: Semantics Let XML documents take arguments An abstract document f is function :: [Doc] -> [Doc] A simple document s is a string or other basic type string, integer:: Doc Virtual document is calculated, sometimes trivially so apply function f to argument a XML documents use f which are free datatype constructors
  • 14. Venice, 7-11 Oct 2002Monterey Workshop 2002 14 Example <element name="double" type="string" maxOccurs="unbounded"> <resultType maxOccurs="unbounded"> string </resultType> <def var="x">x x</def> </element>
  • 15. Venice, 7-11 Oct 2002Monterey Workshop 2002 15 <element name="Point"> <complexType> <element name="x" type="integer"/> <element name="y" type="integer"/> </complexType> <resultType>float</resultType> <def>sqrt(sqr(x)+sqr(y)) </def> </element> Example
  • 16. Venice, 7-11 Oct 2002Monterey Workshop 2002 16 Language Syntax: Basics Juxtaposition is concatenation of lists <a>hello</a> is both in type a and in type a* <a>hello</a> <a>there</a> is of type a*
  • 17. Venice, 7-11 Oct 2002Monterey Workshop 2002 17 Language Syntax: Basics Function application is via tags, but functions are by default the free datatype constructor <a>hello</a> is of type a Function definition needs a special metatag <def name=a var=x> <def.val> x x </def.val> ... </def>
  • 18. Venice, 7-11 Oct 2002Monterey Workshop 2002 18 Document Layout Header section (DTD) types of functions and other tags Definition section semantics of functions Text section (document) XML or HOAX document interpreted according to definitions given
  • 19. Venice, 7-11 Oct 2002Monterey Workshop 2002 19 Example <!DOCTYPE example [ <!ELEMENT example (ANY*)> <!ELEMENT ANY* dbl (ANY*)> ]> <example> <def name="dbl" var="x"> <def.val> x x </def.val> <dbl><dbl>bye</dbl></dbl> </def> </example> <example> byebyebyebye </example>
  • 20. Venice, 7-11 Oct 2002Monterey Workshop 2002 20 Definition of XML application DTD or XML Schema can be used DTD is used in paper for brevity DTD normally specifies syntax in HOAX syntax = type type = parser there are more types than in XML HOAX function types are not free type declarations a "result type" precedes the function name DTD declarations are local in HOAX
  • 21. Venice, 7-11 Oct 2002Monterey Workshop 2002 21 Meta Tags HOAX introduces 4 (really 2) special tags <def> for binding a name to a value <var> for expressing abstraction <eval> for application of a function to its arguments <ref> for dereferencing a variable
  • 22. Venice, 7-11 Oct 2002Monterey Workshop 2002 22 Example: notes Scope of a definition is strictly defined <def ...> ... </def> A definition has three parts <def name=... var=... val=...> ... Attributes can be made into tags <def name= ... var=...> <def.val> ... </def.val> Type definitions use elements and C types <!DOCTYPE [<!ELEMENT res fun (arg)>]>
  • 23. Venice, 7-11 Oct 2002Monterey Workshop 2002 23 Meta Tags only <def> is common <var> normally appears within a <def> <eval> and <ref> are unusual. <def name=“a” var=“b” val=“c”>…</def> means <def name=“a”> <def.val><var name=“b”>c</var> </def.val>… </def>
  • 24. Venice, 7-11 Oct 2002Monterey Workshop 2002 24 BNF of HOAX HOAX ::= <def name=t> <def.val>xs</def.val> xs' </def> | <var name=t> xs </var> | <eval name=t> xs </eval> | <t> xs </t> | <ref name=t> | t where xs is a sequence of HOAX documents Function names may be applied as tags. Simple variable names don't need ref tags.
  • 25. Venice, 7-11 Oct 2002Monterey Workshop 2002 25 Types The type system has to be adjusted to XML certain things are indistinguishable, and hence have the same type a string is indistinguishable from a singleton list of strings a sequence of strings is indistinguishable from a string a list of a's followed by a list of a's is indistinguishable from a list of a's, in general
  • 26. Venice, 7-11 Oct 2002Monterey Workshop 2002 26 Types Solved by using the parsers of XML as types have inclusions a | a* means "the parser of a*'s will parse a" type equality is not identity, but it does not matter
  • 27. Venice, 7-11 Oct 2002Monterey Workshop 2002 27 HOAX types are parsers of HOAX texts ambiguous parsers alternative parsers p | q produce all possible outcomes sequence of parsers p q partition the input in all possible ways and produce all possible results for each part, then resequence results p* = p p* | ε
  • 28. Venice, 7-11 Oct 2002Monterey Workshop 2002 28 Algebra of types The model gives rise to inclusions and equalities p ⊆ p*, p p*⊆ p*, ... Type equality is difficult to decide, but type satisfaction is easy each type is precisely a mechanism for checking type satisfaction each type is a mechanism for evaluating a text each document text has a "canonical type" calculated from its presentation.
  • 29. Venice, 7-11 Oct 2002Monterey Workshop 2002 29 Canonical types of document texts "s" :: #PCDATA <t> xs </t> :: t if the construction meets the declared type constraints for the tag t. <f> xs </f> :: r where r is the result type declared for f, provided xs :: a and a is the declared argument type for f. <def name=“a” val=“b”> c </def> :: t where t is the type calculated for c given the hypothesis that the type of a, wherever it appears in c, is the same as the type calculated for b.
  • 30. Venice, 7-11 Oct 2002Monterey Workshop 2002 30 HOAX semantics Two HOAX documents can look distinct but mean the same thing The semantics is defined by "how to parse" instructions The instructions are predicated on a type "how to parse x using type t" if t is the result type for function tags f which takes argument type a, then <f> x </f> is parsed by t by first parsing x with a, then applying the definition of function f to the results of the parse, then parsing with t.
  • 31. Venice, 7-11 Oct 2002Monterey Workshop 2002 31 Can prove ... That each document has a unique parse semantics means that the semantics is well- defined That the semantics of functional application is substitution means that the parse of a document with references is the parse of the document with the references replaced by the text to which they
  • 32. Venice, 7-11 Oct 2002Monterey Workshop 2002 32 Advantages HOAX puts the semantics back into XML not only functions were missing, but reductions of any form to any other form Do not need a second "transformation language" HOAX documents are self-transforming in situ Clearly arbitrarily higher order functionality "abstract documents are first-class
  • 33. Venice, 7-11 Oct 2002Monterey Workshop 2002 33 Disadvantages Might prefer to separate form and function There is no mechanism for saying where to perform a reduction - here or there What happens in the case of unavailable data? Ditto function?
  • 34. Venice, 7-11 Oct 2002Monterey Workshop 2002 34 Open issues Reflexivity Can HOAX be expressed entirely within HOAX Probably, but meaningfully? Usefully? Circular reference trails HOAX is careful to apply definitions only in a well-defined scope. External references drag in their definitions, but with scope localized to the reference. Do mutually dependent external definitions resolve?
  • 35. Venice, 7-11 Oct 2002Monterey Workshop 2002 35 Conclusion Experiment in extending XML to support functional semantics Prototyped Proposed approach to semantics of XML use types=parsers, since XML is pure syntax use interpreter=parser, since XML is pure syntax ergo type=interpreter=parser
  • 36. Venice, 7-11 Oct 2002Monterey Workshop 2002 36 Conclusion By giving an interpretation to tags, one can easily reduce documents to others (without XSLT!) Exploratory work
  • 37. Venice, 7-11 Oct 2002Monterey Workshop 2002 37 Enjoy Venice!
  • 38. Venice, 7-11 Oct 2002Monterey Workshop 2002 38 Enjoy Venice!
  • 39. Venice, 7-11 Oct 2002Monterey Workshop 2002 39