Prosp er: A F ramew o rk fo r Extending Prolog Appl i a - - PowerPoint PPT Presentation

prosp er a f ramew o rk fo r extending prolog appl i a ti
SMART_READER_LITE
LIVE PREVIEW

Prosp er: A F ramew o rk fo r Extending Prolog Appl i a - - PowerPoint PPT Presentation

Prosp er: A F ramew o rk fo r Extending Prolog Appl i a ti on s with a W eb Interfae Leven te Hun y a d i Buda p e st Universi t y of T ehnology and Eonomis Depa rtment of Automati on and Applied


slide-1
SLIDE 1 Leven t e Huny adi Prosp e r : Exten d in g Prolog Appli at io n s with a W eb Interfa e
  • 1
/ 14 Prosp er: A F ramew
  • rk
fo r Extending Prolog Appl i a ti
  • n
s with a W eb Interfa e Leven te Hun y a d i Buda p e st Universi t y
  • f
T e hnology and E onomi s Depa rtment
  • f
Automati
  • n
and Applied Info rmati s Internationa l Conferen e
  • n
Log i Programming P
  • rto,
Septemb er 12 , 20 7
slide-2
SLIDE 2 Goal s Goal s Cha ra teri s t i s Motivati n g example T emplate te hnol
  • g
y
  • Appl
i a t i
  • n
lo g i
  • T
emplates
  • Extensi
b i l i t y Summa ry Leven t e Huny adi Prosp e r : Exten d in g Prolog Appli at io n s with a W eb Interfa e
  • 2
/ 14

Prol
  • g:
a general-pu rp
  • se
p rogrammi ng languag e

but di ult y w.r.t. user intera ti
  • n
Problem : no general metho d
  • f
w eb
  • ntent
generation with su ient abstra ti on
slide-3
SLIDE 3 Goal s Goal s Cha ra teri s t i s Motivati n g example T emplate te hnol
  • g
y
  • Appl
i a t i
  • n
lo g i
  • T
emplates
  • Extensi
b i l i t y Summa ry Leven t e Huny adi Prosp e r : Exten d in g Prolog Appli at io n s with a W eb Interfa e
  • 3
/ 14 Prol
  • g

+

easy w eb integrati
  • n

=

mo re intel l i gent w eb app li ati
  • ns
W e need :

den ition
  • f
user interf a e in a natural w a y p
  • ssibl
y with a graphi al edito r

p
  • ssibi
l i t y
  • f
reusing Prol
  • g
  • de
with li t t l e
  • r
no mo di ation

integrati
  • n
with existi ng system s
slide-4
SLIDE 4 Cha ra teristi s
  • f
the p rop
  • sed
framew
  • rk
Goal s Cha ra teri s t i s Motivati n g example T emplate te hnol
  • g
y
  • Appl
i a t i
  • n
lo g i
  • T
emplates
  • Extensi
b i l i t y Summa ry Leven t e Huny adi Prosp e r : Exten d in g Prolog Appli at io n s with a W eb Interfa e
  • 4
/ 14

sho rt deve lopment ti m e : hides the
  • mplexit
y
  • f
w eb p roto
  • ls

ease
  • f
use : do es not require
  • de
to b e writt en in an im p erati ve language

maintai nabil i t y : sepa rates p resentation and app li ati
  • n
logi

GUI edito r supp
  • rt
: des rib es p resentation de la ratively in XML les

  • p
en a r hite ture : is extensible in almos t all asp e ts

integrati
  • n
: exible,
  • p
e rates with w eb servers
slide-5
SLIDE 5 Motivating exampl e Goal s Cha ra teri s t i s Motivati n g example T emplate te hnol
  • g
y
  • Appl
i a t i
  • n
lo g i
  • T
emplates
  • Extensi
b i l i t y Summa ry Leven t e Huny adi Prosp e r : Exten d in g Prolog Appli at io n s with a W eb Interfa e
  • 5
/ 14

N

  • que
e n s p roblem: ho w to pla e N quee n s
  • n
an N × N b
  • a
rd so that they do not threaten
  • ne
another

Prol
  • g
im pl em entati
  • n
  • nsist
s
  • f
8 p redi ates

task: reate a w eb interf a e that p resents the soluti
  • ns

with Prosp er this an b e a omplis hed with a server page
  • f
21 li nes (using a b
  • a
rd dra wing extension)
slide-6
SLIDE 6 Output fo r motivating exampl e Goal s Cha ra teri s t i s Motivati n g example T emplate te hnol
  • g
y
  • Appl
i a t i
  • n
lo g i
  • T
emplates
  • Extensi
b i l i t y Summa ry Leven t e Huny adi Prosp e r : Exten d in g Prolog Appli at io n s with a W eb Interfa e
  • 6
/ 14
slide-7
SLIDE 7 T emp l a te fo r motivating exampl e Goal s Cha ra teri s t i s Motivati n g example T emplate te hnol
  • g
y
  • Appl
i a t i
  • n
lo g i
  • T
emplates
  • Extensi
b i l i t y Summa ry Leven t e Huny adi Prosp e r : Exten d in g Prolog Appli at io n s with a W eb Interfa e
  • 7
/ 14 <psp:assign var="N" expr="{atom_number(http_get(n))}"> <psp:for-ea h-else> <psp:for-ea h fun tion="queens(N)" iterator="L"> <board: hessboard size="{N}" figures="L" /> </psp:for-ea h> <psp:else> <p>Sorry but there are no solutions.</p> </psp:else> </psp:for-ea h-else> </psp:assign>
slide-8
SLIDE 8 T emp l a te te hnol
  • gy
Goal s Cha ra teri s t i s Motivati n g example T emplate te hnol
  • g
y
  • Appl
i a t i
  • n
lo g i
  • T
emplates
  • Extensi
b i l i t y Summa ry Leven t e Huny adi Prosp e r : Exten d in g Prolog Appli at io n s with a W eb Interfa e
  • 8
/ 14

de la rative and ts the Prol
  • g
language

all
  • ws
deve loping
  • mplex
w eb app li ati
  • ns

extensible

easy to lea rn, resembl es
  • ther
server-si de te hnologies
slide-9
SLIDE 9 T emp l a te te hnol
  • gy
Goal s Cha ra teri s t i s Motivati n g example T emplate te hnol
  • g
y
  • Appl
i a t i
  • n
lo g i
  • T
emplates
  • Extensi
b i l i t y Summa ry Leven t e Huny adi Prosp e r : Exten d in g Prolog Appli at io n s with a W eb Interfa e
  • 9
/ 14 T w
  • majo
r
  • nstit
uents:

app li ati on logi

p resentation la y er
slide-10
SLIDE 10 Appl i a ti
  • n
logi Goal s Cha ra teri s t i s Motivati n g example T emplate te hnol
  • g
y
  • Appl
i a t i
  • n
lo g i
  • T
emplates
  • Extensi
b i l i t y Summa ry Leven t e Huny adi Prosp e r : Exten d in g Prolog Appli at io n s with a W eb Interfa e
  • 10
/ 14 Implem ented in regula r Prol
  • g
mo dules, no mo di ation need e d .

N

  • que
e n s: queens.pl mo dule
  • nstit
utes the app li ati
  • n
logi .
slide-11
SLIDE 11 T emp l a tes (server pages) Goal s Cha ra teri s t i s Motivati n g example T emplate te hnol
  • g
y
  • Appl
i a t i
  • n
lo g i
  • T
emplates
  • Extensi
b i l i t y Summa ry Leven t e Huny adi Prosp e r : Exten d in g Prolog Appli at io n s with a W eb Interfa e
  • 11
/ 14

den e p resentation in XML fo rm at :

sp e ial XML elements with semanti s den e d as Prol
  • g
transfo rm at i
  • n
rules

hav e a standa rd set
  • f
elements si m i l a r to
  • ther
te hnologies:

  • nd
itionals ( psp:if , psp:if-else )

b ran h ing ( psp: hoose )

it er at i
  • n
( psp:for-ea h )

mo re soluti
  • ns
( psp:for-all )

va riables ( psp:assign , psp:insert )
slide-12
SLIDE 12 T emp l a tes (server pages) Goal s Cha ra teri s t i s Motivati n g example T emplate te hnol
  • g
y
  • Appl
i a t i
  • n
lo g i
  • T
emplates
  • Extensi
b i l i t y Summa ry Leven t e Huny adi Prosp e r : Exten d in g Prolog Appli at io n s with a W eb Interfa e
  • 12
/ 14

hav e si ngl e-ass i gned va riables to sto re interm edi at e values

feature a t yp ed exp ression language (an extension to is /2) with sp e ial fun tions to a ess HTTP
  • ntext

a ess app li ati on logi p redi ates dire tl y
slide-13
SLIDE 13 Extensibi l i t y Goal s Cha ra teri s t i s Motivati n g example T emplate te hnol
  • g
y
  • Appl
i a t i
  • n
lo g i
  • T
emplates
  • Extensi
b i l i t y Summa ry Leven t e Huny adi Prosp e r : Exten d in g Prolog Appli at io n s with a W eb Interfa e
  • 13
/ 14 Prosp er = Prol
  • g
Server P ages Extensible Ar hite t ure Standa rd set
  • f
elements is extensible with user-den e d elements :

elements referen ed in XML in the fo rm < namespa e > : < n a me >

namespa es b
  • un
d to Prol
  • g
element im pl em ento r mo dule in
  • ng
u ration le

semanti s :

<name> (V a riableT yp es, A ttr i butes, Content, T erms ) ho
  • k
p redi ate fo r synta ti validati
  • n

<name> (. . . , V a riables , T erms , Elem ents ) ho
  • k
p redi ate fo r evaluation and
  • ntent
generation
slide-14
SLIDE 14 Summa ry Goal s Cha ra teri s t i s Motivati n g example T emplate te hnol
  • g
y
  • Appl
i a t i
  • n
lo g i
  • T
emplates
  • Extensi
b i l i t y Summa ry Leven t e Huny adi Prosp e r : Exten d in g Prolog Appli at io n s with a W eb Interfa e
  • 14
/ 14 Prosp er is a framew
  • rk
that

fa il i t at es deve loping w eb app li ati
  • ns
in Prol
  • g
re-using existi ng Prol
  • g
  • de

sepa rates app li ati on logi and p resentation

is e ient and exible

has an
  • p
en a r hite ture

is easy to lea rn Referen e im pl em entati
  • n:
http://p rosp ea r.sour efo rge.n e t/