Glue Program Code-Deductive Database-Lecture Notes, Study notes of Deductive Database Systems

Dr. Deependu Saripella provided this handout at Aligarh Muslim University for Deductive Database course. its main points are: Seminaive, Evaluation, While, Export, Module, Glue, Program, Code, Deductive, Database

Typology: Study notes

2011/2012

Uploaded on 07/15/2012

saidullah
saidullah ๐Ÿ‡ฎ๐Ÿ‡ณ

4.7

(7)

32 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
(1)
module semi๎˜‚
(2)
export main(:)๎˜‚
(3)
edb arc(X,Y), path(X,Y)๎˜‚
(4)
prog main(:)
(5)
rels newPath(X,Y)๎˜‚
(6)
arc(X,Y) := {}.
(7)
arc(1,2).
(8)
arc(2,3).
(9)
arc(3,4).
(10)
arc(4,5).
(11)
arc(2,4).
(12)
newPath(X,Y) := arc(X,Y).
(13)
path(X,Y) := {}.
(14)
while newPath(X,Y) do
(15)
path(X,Y) += newPath(X,Y).
(16)
newPath(X,Y) := newPath(X,Z) & arc(Z,Y).
(17)
newPath(X,Y) -= path(X,Y).
(18)
end๎˜‚
(19)
end
(20)
end
Fig. 1.
GLUE program to compute paths by seminaiveevaluation.
(1)
module nim๎˜‚
(2)
export main(:)๎˜‚
(3)
edb lt(X,Y), win(A,B,C)๎˜‚
(4)
prog main(:)
(5)
win(A,B,C) := interesting(A,B,C) & w(A,B,C).
(6)
end
(7)
interesting(A,B,C) :- lt(8,A) & lt(6,B) & lt(4,C).
(8)
move(A,B,C,X,B,C) :- interesting(A,B,C) & lt(A,X).
(9)
move(A,B,C,A,Y,C) :- interesting(A,B,C) & lt(B,Y).
(10)
move(A,B,C,A,B,Z) :- interesting(A,B,C) & lt(C,Z).
(11)
w(A,B,C) :- move(A,B,C,X,Y,Z) & !w(X,Y,Z).
(12)
end
Fig. 2.
GLUE/NAIL program for win applied to game of nim.
1
docsity.com

Partial preview of the text

Download Glue Program Code-Deductive Database-Lecture Notes and more Study notes Deductive Database Systems in PDF only on Docsity!

 module semi

 export main

 edb arcXY pathXY

 prog main

 rels newPathXY

 arcXY  

 arc  

 arc  

 arc 

  arc

 arc 

 newPathXY  arcXY

 pathXY  

 while newPathXY do

 pathXY  newPathXY

 newPathXY  newPathXZ  arcZY

  newPathXY  pathXY

  end

  end

  end

Fig  GLUE program to compute paths by seminaive evaluation

 module nim

 export main

 edb ltXY winABC

 prog main

 winABC  interestingABC  wABC

 end

 interestingABC  ltA  ltB  ltC

 moveABCXBC  interestingABC  ltAX

 moveABCAYC  interestingABC  ltBY

  moveABCABZ  interestingABC  ltCZ

 wABC  moveABCXYZ  wXYZ

 end

Fig  GLUENAIL program for win applied to game of nim

docsity.com