NAIL System: Setting Up and Using Temporary Accounts and Subgoals in GLUE, Study notes of Deductive Database Systems

Instructions on how to obtain a temporary account for the nail system, set up directories, and understand the structure and use of subgoals in glue. It covers topics such as account forms, glue logic, and control flow statements.

Typology: Study notes

2011/2012

Uploaded on 07/15/2012

saidullah
saidullah 🇮🇳

4.7

(7)

32 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS345A Notes for Lecture 5/4/94
The NAIL System
To get a temporary account suitable to run NAIL:
1. Fill out an account form at the desk of MJH.
Ask for an account on theory, for which I will
sign.
2. Once on theory,look at
/u/morisita/nail/README
which will explain how to set up your direc-
tory to run NAIL.
Please do not abuse theory account use it
only to experiment with NAIL.
Manual will be posted to the newsgroup.
Structure of NAIL
1. GLUE: logical rules plus conventional ow-of-
control, procedures, etc.
2. NAIL: conventional logic front end. Trans-
lated via magic-sets and well-founded nega-
tion to GLUE procedures.
3. IGLUE: back end. Adaptive data structures
(e.g., indexes).
Principal credits: Geo Phipps (GLUE),
Marcia Derr (IGLUE), Shinichi Morishita
(current NAIL), Kate Morris (old NAIL).
GLUE Assignments
Assignment statements look like rules, but
they areexecuted whenever, and only when,
they arereached during program execution
.
Four types of assignment: Clear-and-assign,
insert, delete, up date.
Clear-and-assign represented by
:=
1
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download NAIL System: Setting Up and Using Temporary Accounts and Subgoals in GLUE and more Study notes Deductive Database Systems in PDF only on Docsity!

CSA Notes for Lecture 

The NAIL System

To get a temp orary account suitable to run NAIL

 Fill out an account form at the desk of MJH Ask for an account on theory for which I will sign Once on theory lo ok at

umorisitanailREADME which will explain how to set up your direc tory to run NAIL

Please do not abuse theory account use it only to exp eriment with NAIL

Manual will b e p osted to the newsgroup

Structure of NAIL

 GLUE logical rules plus conventional ow of control pro cedures etc

NAIL conventional logic front end Trans lated via magic sets and well founded nega tion to GLUE pro cedures

 IGLUE back end Adaptive data structures e g indexes

Principal credits Geo Phipps GLUE Marcia Derr IGLUE Shinichi Morishita current NAIL Kate Morris old NAIL

GLUE Assignments

Assignment statements lo ok like rules but they are executed whenever and only when they are reached during program execution

Four typ es of assignment Clear and assign insert delete up date

Clear and assign represented by 

Example 

pXY  qXZ  rZY

Note p erio d at end Semicolon is an OK sub stitute

Means p   q  r 

Executed as written whenever control ow reaches this statement

Other Assignment Op erators

Insert represented by 

Example 

pXY  qXZ  rZY

means p  p   q  r 

Delete represented by 

Example 

pXY  qXY

means p  p  q

Mo dify represented by an assignment op era tor  Z for some set of variables Z See manual

Three Typ es of Subgoals

GLUE rules can have three typ es of subgoals

 EDB stored physically in a sub directory called edb

IDB dened by NAIL rules included with the GLUE program

 Pro cedural These subgoals have their value dened by a GLUE pro cedure GLUE pro ce dures have input and output arguments and the input arguments must b e b ound when this subgoal is reached in a left to right evaluation of the GLUE statement

Pro cedure Structure

pro c nameinput args  output args lo cal declarations statements end

prog for pro c in distinguished pro cedure that executes when mo dule is invoked

Example  In Fig 

Lines  and   mo duleend

Line   exp ortimp ort information

Line  EDB information

Lines  program main This pro ce dure has no input or output arguments

Line  declaration of lo cal relation new P ath

Lines  initialize ar c relation

Lines   seminaive evaluation

Rule Pro cessing in GLUE

Left to right evaluation uses supplementary rela tions at each subgoal Three kinds of subgoals

 EDB join with supplementary relation

IDB In the compiling phase NAIL determines the binding pattern for this subgoal and gen erates a GLUE pro cedure that implements magic sets and seminaive evaluation

 GLUE pro cedure

Pro cedure call must t  i e take as input arguments the b ound arguments of the sub goal and return a relation over all the argu ments including input arguments

Sp ecial relations used in pro cedure declara tion

inpro c nameinput args

to receive input and returninput args  output args

to return a relation

Example  See Fig  a nim playing mo dule

Nim rules Start with hash marks in rows of    In turn take any numb er   from one of the three rows You win by taking the last mark i e stalemating your opp onent

Boards are represented by triples i j k  where   i     j   and   k  

EDB relation l t was created by another mo d ule and contains less than facts for integers up to  It is needed for safety of the rules

Lines  the entire win program

Line  IDB predicate inter esting true of those triples that represent nim b oards

Lines  legal moves Any of the three rows can b e decreased by one or more but not b elow 

Line  The usual win rule with w as the predicate

Note  is the negation symb ol

Line  is executed by rst invoking a com piled pro cedure for inter esting f^ f^ f^ The re sult is the entire inter esting relation

Then a compiled pro cedure for w bbb^ is called it computes the well founded mo del of w in tersected with the interesting b oards those that are legal nim p ositions

w in is computed by intersecting the two re turned relations