* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 
 *                                                                                                               * 
 
 *                 D E S :   D a t a l o g   E d u c a t i o n a l   S y s t e m   v . 3 . 0                     * 
 
 *                                                                                                               * 
 
 *                                                                                                               * 
 
 *   T y p e   " / h e l p "   f o r   h e l p   a b o u t   c o m m a n d s                                     * 
 
 *   T y p e   " d e s . "   t o   c o n t i n u e   i f   y o u   g e t   o u t   o f   D E S                   * 
 
 *       f r o m   a   P r o l o g   i n t e r p r e t e r                                                       * 
 
 *                                                                                                               * 
 
 *                                         F e r n a n d o   S a e n z - P e r e z   ( c )   2 0 0 4 - 2 0 1 1   * 
 
 *                                                                                   G P D   D I S I A   U C M   * 
 
 *                           P l e a s e   s e n d   c o m m e n t s ,   q u e s t i o n s ,   e t c .   t o :   * 
 
 *                                                                           f e r n a n @ s i p . u c m . e s   * 
 
 *                                                                                           W e b   s i t e :   * 
 
 *                                                       h t t p : / / d e s . s o u r c e f o r g e . n e t /   * 
 
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 
 
 
 D E S >   / p r o c e s s   e x a m p l e s / S Q L D e b u g g e r / a w a r d s 2 
 
 
 
 I n f o :   P r o c e s s i n g   f i l e   ' e x a m p l e s / S Q L D e b u g g e r / a w a r d s 2 . s q l '   . . . 
 
 
 
 D E S >   - -   S Q L   D e b u g g e r 
 
 
 
 
 
 D E S >   - -   N o v e m b e r   2 0 1 1 
 
 
 
 
 
 D E S >   - -   E x a m p l e   2   A w a r d s 
 
 
 
 
 
 D E S >   - -   W r o n g   t u p l e   ' A n n a ' 
 
 
 
 
 
 D E S >   - -   R e f e r   t o   e x a m p l e 2 U s e r T r a c e . t x t   f o r   a   u s e r   t r a c e   a n d   e x a m p l e 2 D e v e l o p m e n t T r a c e . t x t   f o r   a   d e v e l o p m e n t   t r a c e 
 
 
 
 
 
 D E S >   - - 
 
 
 
 
 
 D E S >   - -   D e c l a r a t i v e   D e b u g g i n g   o f   W r o n g   a n d   M i s s i n g   A n s w e r s   f o r   S Q L   V i e w s 
 
 
 
 
 
 D E S >   - -   F L O P S   2 0 1 2 
 
 
 
 
 
 D E S >   
 
 
 
 
 
 D E S >   / a b o l i s h 
 
 
 
 
 
 D E S >   / m u l t i l i n e   o n 
 
 
 
 
 
 D E S >   / d e v e l o p m e n t   o f f 
 
 
 
 I n f o :   D e v e l o p m e n t   l i s t i n g s   a r e   a l r e a d y   d i s a b l e d . 
 
 
 
 D E S >   - -   T u r n   d e v e l o p m e n t   o n   t o   i n s p e c t   m o r e   i n f o 
 
 
 
 
 
 D E S >   - -   / d e v e l o p m e n t   o n 
 
 
 
 
 
 D E S >   / *   T a b l e s   * / 
 
 
 
 
 
 D E S >   D R O P   T A B L E   I F   E X I S T S   g r a n t s ,   p a y m e n t ,   r e g i s t r a t i o n ,   c o u r s e s ; 
 
 
 
 
 
 D E S >   C R E A T E   T A B L E   g r a n t s   ( 
 
       s t u d e n t   v a r c h a r ( 4 5 )   D E F A U L T   N U L L , 
 
       a m o u n t   i n t e g e r   d e f a u l t   0 
 
 ) ; 
 
 
 
 
 
 D E S >   C R E A T E   T A B L E   c o u r s e s   ( 
 
     i d c o u r s e s   v a r c h a r ( 1 1 )   N O T   N U L L , 
 
     s t y l e   v a r c h a r ( 4 5 )   D E F A U L T   N U L L , 
 
     l e v e l   i n t ( 1 1 )   D E F A U L T   N U L L , 
 
     t e a c h e r   v a r c h a r ( 1 0 )   D E F A U L T   N U L L , 
 
     P R I M A R Y   K E Y   ( ` i d c o u r s e s ` ) 
 
 ) ; 
 
 
 
 
 
 D E S >   I N S E R T   I N T O   ` c o u r s e s `   ( ` i d c o u r s e s ` ,   ` s t y l e ` ,   ` l e v e l ` ,   ` t e a c h e r ` )   V A L U E S   ( ' c 1 ' ,   ' s a l s a ' ,         1 ,   ' t e a c h 1 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` c o u r s e s `   ( ` i d c o u r s e s ` ,   ` s t y l e ` ,   ` l e v e l ` ,   ` t e a c h e r ` )   V A L U E S   ( ' c 2 ' ,   ' s a l s a ' ,         2 ,   ' t e a c h 2 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` c o u r s e s `   ( ` i d c o u r s e s ` ,   ` s t y l e ` ,   ` l e v e l ` ,   ` t e a c h e r ` )   V A L U E S   ( ' c 3 ' ,   ' M e r e n g u e ' ,   3 ,   ' t e a c h 3 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` c o u r s e s `   ( ` i d c o u r s e s ` ,   ` s t y l e ` ,   ` l e v e l ` ,   ` t e a c h e r ` )   V A L U E S   ( ' c 4 ' ,   ' s a l s a ' ,         3 ,   ' t e a c h 1 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` c o u r s e s `   ( ` i d c o u r s e s ` ,   ` s t y l e ` ,   ` l e v e l ` ,   ` t e a c h e r ` )   V A L U E S   ( ' c 5 ' ,   ' s a l s a ' ,         3 ,   ' t e a c h 1 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` c o u r s e s `   ( ` i d c o u r s e s ` ,   ` s t y l e ` ,   ` l e v e l ` ,   ` t e a c h e r ` )   V A L U E S   ( ' c 6 ' ,   ' s a l s a ' ,         3 ,   ' t e a c h 3 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` c o u r s e s `   ( ` i d c o u r s e s ` ,   ` s t y l e ` ,   ` l e v e l ` ,   ` t e a c h e r ` )   V A L U E S   ( ' c 7 ' ,   ' s a l s a ' ,         0 ,   ' t e a c h 1 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   C R E A T E   T A B L E   r e g i s t r a t i o n   ( 
 
     i d r e g i s t r a t i o n   i n t ( 1 1 )   N O T   N U L L , 
 
     s t u d e n t   v a r c h a r ( 4 5 )   D E F A U L T   N U L L , 
 
     c o u r s e   v a r c h a r ( 1 1 )   D E F A U L T   N U L L , 
 
     P R I M A R Y   K E Y   ( ` i d r e g i s t r a t i o n ` ) 
 
 ) ; 
 
 
 
 
 
 D E S >   I N S E R T   I N T O   ` r e g i s t r a t i o n `   ( ` i d r e g i s t r a t i o n ` ,   ` s t u d e n t ` ,   ` c o u r s e ` )   V A L U E S   ( 1 ,   ' J u a n ' ,   ' c 1 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` r e g i s t r a t i o n `   ( ` i d r e g i s t r a t i o n ` ,   ` s t u d e n t ` ,   ` c o u r s e ` )   V A L U E S   ( 2 ,   ' J u a n ' ,   ' c 2 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` r e g i s t r a t i o n `   ( ` i d r e g i s t r a t i o n ` ,   ` s t u d e n t ` ,   ` c o u r s e ` )   V A L U E S   ( 3 ,   ' J u a n ' ,   ' c 6 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` r e g i s t r a t i o n `   ( ` i d r e g i s t r a t i o n ` ,   ` s t u d e n t ` ,   ` c o u r s e ` )   V A L U E S   ( 4 ,   ' J u a n ' ,   ' c 5 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` r e g i s t r a t i o n `   ( ` i d r e g i s t r a t i o n ` ,   ` s t u d e n t ` ,   ` c o u r s e ` )   V A L U E S   ( 5 ,   ' P e d r o ' ,   ' c 2 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` r e g i s t r a t i o n `   ( ` i d r e g i s t r a t i o n ` ,   ` s t u d e n t ` ,   ` c o u r s e ` )   V A L U E S   ( 6 ,   ' A n a ' ,   ' c 1 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` r e g i s t r a t i o n `   ( ` i d r e g i s t r a t i o n ` ,   ` s t u d e n t ` ,   ` c o u r s e ` )   V A L U E S   ( 7 ,   ' A n a ' ,   ' c 2 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` r e g i s t r a t i o n `   ( ` i d r e g i s t r a t i o n ` ,   ` s t u d e n t ` ,   ` c o u r s e ` )   V A L U E S   ( 8 ,   ' A n a ' ,   ' c 5 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` r e g i s t r a t i o n `   ( ` i d r e g i s t r a t i o n ` ,   ` s t u d e n t ` ,   ` c o u r s e ` )   V A L U E S   ( 9 ,   ' M i c a ' ,   ' c 6 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` r e g i s t r a t i o n `   ( ` i d r e g i s t r a t i o n ` ,   ` s t u d e n t ` ,   ` c o u r s e ` )   V A L U E S   ( 1 0 ,   ' J u a n ' ,   ' c 7 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` r e g i s t r a t i o n `   ( ` i d r e g i s t r a t i o n ` ,   ` s t u d e n t ` ,   ` c o u r s e ` )   V A L U E S   ( 1 1 ,   ' M i c a ' ,   ' c 2 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   I N S E R T   I N T O   ` r e g i s t r a t i o n `   ( ` i d r e g i s t r a t i o n ` ,   ` s t u d e n t ` ,   ` c o u r s e ` )   V A L U E S   ( 1 2 ,   ' M i c a ' ,   ' c 1 ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   C R E A T E   T A B L E   p a y m e n t   ( 
 
     ` i d `   i n t ( 1 1 )   N O T   N U L L , 
 
     ` s t u d e n t `   v a r c h a r ( 4 5 )   D E F A U L T   N U L L , 
 
     ` s t a t e `   v a r c h a r ( 1 1 )   D E F A U L T   N U L L , 
 
     P R I M A R Y   K E Y   ( ` i d ` ) 
 
 ) ; 
 
 
 
 
 
 D E S >   I N S E R T   I N T O   ` p a y m e n t `   ( ` i d ` ,   ` s t u d e n t ` ,   ` s t a t e ` )   V A L U E S   ( 1 ,   ' M i g u e l ' ,   ' u n p a i d ' ) ; 
 
 
 
 I n f o :   1   t u p l e   i n s e r t e d .                                           
 
 
 
 D E S >   / *   V i e w s   * / 
 
 
 
 
 
 D E S >   / *   S a l s a   c o u r s e s   * / 
 
 
 
 
 
 D E S >   c r e a t e   o r   r e p l a c e   v i e w   s a l s a C o u r s e s ( i d ,   l e v e l ,   t e a c h e r )   a s 
 
     s e l e c t   c . i d c o u r s e s ,   c . l e v e l ,   c . t e a c h e r 
 
     f r o m   c o u r s e s   c 
 
     w h e r e   c . s t y l e   =   ' s a l s a ' ;     
 
 
 
 
 
 D E S >   / *   S t u d e n t s   o f   s a l s a   c o u r s e s   * / 
 
 
 
 
 
 D E S >   c r e a t e   o r   r e p l a c e   v i e w   s a l s a S t u d e n t s ( s t u d e n t ,   l e v e l ,   t e a c h e r )   a s 
 
       s e l e c t   R . s t u d e n t ,   C . l e v e l ,   C . t e a c h e r 
 
       f r o m   s a l s a C o u r s e s   C ,   r e g i s t r a t i o n   R 
 
       w h e r e   C . i d   =   R . c o u r s e ; 
 
 
 
 
 
 D E S >   / *   S t u d e n t s   o f   i n t e n s i v e   c o u r s e   ( l e v e l   =   0 )   * / 
 
 
 
 
 
 D E S >   c r e a t e   o r   r e p l a c e   v i e w   i n t e n s i v e S t u d e n t s ( s t u d e n t )   a s 
 
       s e l e c t   S . s t u d e n t 
 
       f r o m   s a l s a S t u d e n t s   S 
 
       w h e r e   S . l e v e l   =   0 ; 
 
 
 
 
 
 D E S >   / *   S t u d e n t s   o f   f i r s t   t h r e e   c o u r s e s   w i t h   d i f f e r e n t   t e a c h e r s   * / 
 
 
 
 
 
 D E S >   / *   T h i s   i s   t h e   i l l - d e f i n e d   v i e w   * / 
 
 
 
 
 
 D E S >   c r e a t e   o r   r e p l a c e   v i e w   b a s i c L e v e l S t u d e n t s ( s t u d e n t )   a s 
 
 s e l e c t   a 1 . s t u d e n t 
 
 f r o m   s a l s a S t u d e n t s   a 1 ,   s a l s a S t u d e n t s   a 2 ,   s a l s a S t u d e n t s   a 3   
 
 w h e r e   a 1 . s t u d e n t   =   a 2 . s t u d e n t   a n d   a 2 . s t u d e n t   =   a 3 . s t u d e n t   a n d   
 
 ( a 1 . l e v e l   =   1 )   a n d   ( a 2 . l e v e l   =   2 )   a n d   ( a 3 . l e v e l   =   3 )   a n d 
 
 ( a 1 . t e a c h e r   < >   a 2 . t e a c h e r )   a n d   ( a 2 . t e a c h e r   < >   a 3 . t e a c h e r ) ; 
 
 
 
 
 
 D E S >   / *   S t u d e n t s   o f   b a s i c   l e v e l   w i t h   d i f f e r e n t   t e a c h e r s   a n d   n o   i n t e n s i v e   l e v e l   * / 
 
 
 
 
 
 D E S >   / *   T w o   e q u i v a l e n t   f o r m u l a t i o n s   b e l o w   ( t h e   f i r s t   o n e   i s   n o t   a c c e p t e d   b y   M y S Q L )   * / 
 
 
 
 
 
 D E S >   / * c r e a t e   o r   r e p l a c e   v i e w   c a n d i d a t e s ( s t u d e n t )   a s 
 
     s e l e c t   s t u d e n t 
 
     f r o m     b a s i c L e v e l S t u d e n t s 
 
 e x c e p t 
 
     s e l e c t   s t u d e n t 
 
     f r o m     i n t e n s i v e S t u d e n t s ; 
 
 * / 
 
 
 
 
 
 D E S >   c r e a t e   o r   r e p l a c e   v i e w   c a n d i d a t e s ( s t u d e n t )   a s 
 
     s e l e c t   s t u d e n t 
 
     f r o m     b a s i c L e v e l S t u d e n t s 
 
 w h e r e   s t u d e n t   n o t   i n   ( 
 
     s e l e c t   s t u d e n t 
 
     f r o m     i n t e n s i v e S t u d e n t s ) ; 
 
 
 
 
 
 D E S >   / *   C a n d i d a t e s   w i t h   n o   p a s t   d u e   p a y m e n t s   * / 
 
 
 
 
 
 D E S >   c r e a t e   o r   r e p l a c e   v i e w   a w a r d s ( s t u d e n t )   a s 
 
     s e l e c t   s t u d e n t 
 
     f r o m   c a n d i d a t e s   c 
 
     w h e r e     
 
             c . s t u d e n t   n o t   i n   ( s e l e c t   s t u d e n t 
 
                                         f r o m   p a y m e n t 
 
                                         w h e r e   s t a t e   =   ' u n p a i d ' ) 
 
             O R     / *   U N I O N   * / 
 
             c . s t u d e n t   i n   ( s e l e c t   s t u d e n t   f r o m   g r a n t s ) ; 
 
 
 
 
 
 D E S >   
 
 
 
 
 
 I n f o :   B a t c h   f i l e   p r o c e s s e d . 
 
 
 
 D E S >   / v e r b o s e   o n 
 
 
 
 I n f o :   V e r b o s e   o u t p u t   i s   o n . 
 
 
 
 D E S >   / d e v e l o p m e n t   o n 
 
 
 
 I n f o :   D e v e l o p m e n t   l i s t i n g s   a r e   o n . 
 
 
 
 D E S >   / d e b u g _ s q l   a w a r d s 
 
 
 
 I n f o :   Q u e s t i o n :   a l l ( a w a r d s ) 
 
 I n f o :   D e b u g g i n g   v i e w   ' a w a r d s ' . 
 
     S E L E C T   A L L   c . s t u d e n t   A S   $ a 9 
 
     F R O M   
 
         c a n d i d a t e s   A S   c 
 
     W H E R E   ( ( c . s t u d e n t )   N O T   I N   ( 
 
             S E L E C T   A L L   $ t 0 . s t u d e n t   A S   $ a 4 
 
             F R O M   
 
                 p a y m e n t   A S   $ t 0 
 
             W H E R E   $ t 0 . s t a t e   =   ' u n p a i d '   )   O R   ( c . s t u d e n t )   I N   ( 
 
             S E L E C T   A L L   $ t 2 . s t u d e n t   A S   $ a 7 
 
             F R O M   
 
                 g r a n t s   A S   $ t 2   ) ) ; 
 
 I n f o :   S o l v i n g   q u e r y   a w a r d s ( A ) . . . 
 
 I n f o :   C o m p u t i n g   b y   s t r a t u m   o f   [ a w a r d s _ 1 _ 2 ( A ) , c a n d i d a t e s _ 1 _ 2 ( A ) ] . 
 
 {                                                                                       
 
     1   -   a w a r d s ( ' A n a ' ) , 
 
     2   -   a w a r d s ( ' M i c a ' ) 
 
 } 
 
 I n p u t :   I s   t h i s   t h e   e x p e c t e d   a n s w e r   f o r   v i e w   ' a w a r d s ' ?   ( y / n / m / m T / w / w N / a / h )   [ n ] :   w 1 
 
 I n f o :   p r o c e s s A n s w e r ( a l l ( a w a r d s ) , w r o n g ( a w a r d s ( A n a ) ) ) 
 
 I n f o :   C o m p i l i n g   S Q L   s t a t e m e n t   t o   D a t a l o g   r u l e s . . . 
 
 I n f o :   S Q L   s t a t e m e n t   s u c c e s s f u l l y   c o m p i l e d . 
 
 I n f o :   C o m p u t i n g   p r e d i c a t e   d e p e n d e n c y   g r a p h . . . 
 
 I n f o :   C o m p u t i n g   s t r a t a . . . 
 
 I n f o :   C o m p u t i n g   b y   s t r a t u m   o f   [ a n s w e r _ 1 _ 2 ( A ) , c a n d i d a t e s _ 1 _ 2 ( A ) ] . 
 
 I n f o :   P r o c e s s i n g :                                                       
 
     C R E A T E   V I E W   c a n d i d a t e s _ s l i c e 1 ( s t u d e n t )   A S 
 
         S E L E C T   A L L   * 
 
         F R O M   
 
             c a n d i d a t e s   A S   R 
 
         W H E R E   E X I S T S   ( 
 
                 S E L E C T   A L L   c a n d i d a t e s . s t u d e n t 
 
                 F R O M   
 
                     c a n d i d a t e s   A S   c 
 
                 W H E R E   ( ( ( c . s t u d e n t )   N O T   I N   ( 
 
                         S E L E C T   A L L   $ t 0 . s t u d e n t   A S   $ a 4 
 
                         F R O M   
 
                             p a y m e n t   A S   $ t 0 
 
                         W H E R E   $ t 0 . s t a t e   =   ' u n p a i d '   )   A N D   c . s t u d e n t   =   R . s t u d e n t )   A N D   c a n d i d a t e s . s t u d e n t   =   ' A n a ' )   ) ; 
 
 I n f o :   P a r s i n g   q u e r y . . . 
 
 I n f o :   Q u e r y   s u c c e s s f u l l y   p a r s e d . 
 
 I n f o :   C o m p i l i n g   S Q L   s t a t e m e n t   t o   D a t a l o g   r u l e s . . . 
 
 I n f o :   S Q L   s t a t e m e n t   s u c c e s s f u l l y   c o m p i l e d . 
 
 I n f o :   V i e w   c r e a t e d . 
 
 I n f o :   C o m p u t i n g   p r e d i c a t e   d e p e n d e n c y   g r a p h . . . 
 
 I n f o :   C o m p u t i n g   s t r a t a . . . 
 
 I n f o :   C o m p i l i n g   S Q L   s t a t e m e n t   t o   D a t a l o g   r u l e s . . . 
 
 I n f o :   S Q L   s t a t e m e n t   s u c c e s s f u l l y   c o m p i l e d . 
 
 I n f o :   C o m p u t i n g   p r e d i c a t e   d e p e n d e n c y   g r a p h . . . 
 
 I n f o :   C o m p u t i n g   s t r a t a . . . 
 
 I n f o :   C o m p u t i n g   b y   s t r a t u m   o f   [ c a n d i d a t e s _ 1 _ 2 ( A ) ] . 
 
 I n f o :   I n i t i a l   l o g i c   p r o g r a m :                                 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( g r a n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( b a s i c L e v e l S t u d e n t s )   : - 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c a n d i d a t e s )   : - 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c o u r s e s )   : - 
 
         s t a t e ( a l l ( c o u r s e s ) , n o n v a l i d ) . 
 
     b u g g y ( g r a n t s )   : - 
 
         s t a t e ( a l l ( g r a n t s ) , n o n v a l i d ) . 
 
     b u g g y ( i n t e n s i v e S t u d e n t s )   : - 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( p a y m e n t )   : - 
 
         s t a t e ( a l l ( p a y m e n t ) , n o n v a l i d ) . 
 
     b u g g y ( r e g i s t r a t i o n )   : - 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , n o n v a l i d ) . 
 
     b u g g y ( s a l s a C o u r s e s )   : - 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c o u r s e s ) , v a l i d ) . 
 
     b u g g y ( s a l s a S t u d e n t s )   : - 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , v a l i d ) . 
 
     s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) . 
 
 I n f o :   S o l v i n g   q u e r y   b a s i c L e v e l S t u d e n t s ( A ) . . . 
 
 I n f o :   S o l v i n g   q u e r y   c a n d i d a t e s ( A ) . . .                 
 
 I n f o :   C o m p u t i n g   b y   s t r a t u m   o f   [ c a n d i d a t e s _ 1 _ 2 ( A ) ] . 
 
 I n f o :   S o l v i n g   q u e r y   c o u r s e s ( A , B , C , D ) . . .           
 
 I n f o :   S o l v i n g   q u e r y   g r a n t s ( A , B ) . . .                     
 
 I n f o :   S o l v i n g   q u e r y   i n t e n s i v e S t u d e n t s ( A ) . . .   
 
 I n f o :   S o l v i n g   q u e r y   p a y m e n t ( A , B , C ) . . .               
 
 I n f o :   S o l v i n g   q u e r y   r e g i s t r a t i o n ( A , B , C ) . . .     
 
 I n f o :   S o l v i n g   q u e r y   s a l s a C o u r s e s ( A , B , C ) . . .     
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s ( A , B , C ) . . .   
 
 I n f o :   S o l v i n g   q u e r y   c a n d i d a t e s _ s l i c e 1 ( A ) . . .   
 
 I n f o :   C o m p u t i n g   b y   s t r a t u m   o f   [ c a n d i d a t e s _ 1 _ 2 ( A ) , c a n d i d a t e s _ s l i c e 1 _ 1 _ 4 ( A ) ] . 
 
 I n f o :   Q u e s t i o n :   a l l ( g r a n t s )                                   
 
 I n f o :   p r o c e s s A n s w e r ( a l l ( g r a n t s ) , v a l i d ) 
 
 I n f o :   C u r r e n t   l o g i c   p r o g r a m : 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( g r a n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( b a s i c L e v e l S t u d e n t s )   : - 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c a n d i d a t e s )   : - 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c o u r s e s )   : - 
 
         s t a t e ( a l l ( c o u r s e s ) , n o n v a l i d ) . 
 
     b u g g y ( g r a n t s )   : - 
 
         s t a t e ( a l l ( g r a n t s ) , n o n v a l i d ) . 
 
     b u g g y ( i n t e n s i v e S t u d e n t s )   : - 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( p a y m e n t )   : - 
 
         s t a t e ( a l l ( p a y m e n t ) , n o n v a l i d ) . 
 
     b u g g y ( r e g i s t r a t i o n )   : - 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , n o n v a l i d ) . 
 
     b u g g y ( s a l s a C o u r s e s )   : - 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c o u r s e s ) , v a l i d ) . 
 
     b u g g y ( s a l s a S t u d e n t s )   : - 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , v a l i d ) . 
 
     s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( g r a n t s ) , v a l i d ) . 
 
 
 
 I n f o :   S o l v i n g   q u e r y   b a s i c L e v e l S t u d e n t s ( A ) . . . 
 
 I n f o :   S o l v i n g   q u e r y   c a n d i d a t e s ( A ) . . .                 
 
 I n f o :   C o m p u t i n g   b y   s t r a t u m   o f   [ c a n d i d a t e s _ 1 _ 2 ( A ) ] . 
 
 I n f o :   S o l v i n g   q u e r y   c o u r s e s ( A , B , C , D ) . . .           
 
 I n f o :   S o l v i n g   q u e r y   i n t e n s i v e S t u d e n t s ( A ) . . .   
 
 I n f o :   S o l v i n g   q u e r y   p a y m e n t ( A , B , C ) . . .               
 
 I n f o :   S o l v i n g   q u e r y   r e g i s t r a t i o n ( A , B , C ) . . .     
 
 I n f o :   S o l v i n g   q u e r y   s a l s a C o u r s e s ( A , B , C ) . . .     
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s ( A , B , C ) . . .   
 
 I n f o :   S o l v i n g   q u e r y   c a n d i d a t e s _ s l i c e 1 ( A ) . . .   
 
 I n f o :   C o m p u t i n g   b y   s t r a t u m   o f   [ c a n d i d a t e s _ 1 _ 2 ( A ) , c a n d i d a t e s _ s l i c e 1 _ 1 _ 4 ( A ) ] . 
 
 I n f o :   Q u e s t i o n :   a l l ( i n t e n s i v e S t u d e n t s )             
 
 I n f o :   D e b u g g i n g   v i e w   ' i n t e n s i v e S t u d e n t s ' . 
 
     S E L E C T   A L L   S . s t u d e n t   A S   $ a 4 
 
     F R O M   
 
         s a l s a S t u d e n t s   A S   S 
 
     W H E R E   S . l e v e l   =   0 ; 
 
 I n f o :   S o l v i n g   q u e r y   i n t e n s i v e S t u d e n t s ( A ) . . . 
 
 {                                                                                       
 
     1   -   i n t e n s i v e S t u d e n t s ( ' J u a n ' ) 
 
 } 
 
 I n p u t :   I s   t h i s   t h e   e x p e c t e d   a n s w e r   f o r   v i e w   ' i n t e n s i v e S t u d e n t s ' ?   ( y / n / m / m T / w / w N / a / h )   [ y ] :   
 
 I n f o :   p r o c e s s A n s w e r ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) 
 
 I n f o :   C u r r e n t   l o g i c   p r o g r a m : 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( g r a n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( b a s i c L e v e l S t u d e n t s )   : - 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c a n d i d a t e s )   : - 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c o u r s e s )   : - 
 
         s t a t e ( a l l ( c o u r s e s ) , n o n v a l i d ) . 
 
     b u g g y ( g r a n t s )   : - 
 
         s t a t e ( a l l ( g r a n t s ) , n o n v a l i d ) . 
 
     b u g g y ( i n t e n s i v e S t u d e n t s )   : - 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( p a y m e n t )   : - 
 
         s t a t e ( a l l ( p a y m e n t ) , n o n v a l i d ) . 
 
     b u g g y ( r e g i s t r a t i o n )   : - 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , n o n v a l i d ) . 
 
     b u g g y ( s a l s a C o u r s e s )   : - 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c o u r s e s ) , v a l i d ) . 
 
     b u g g y ( s a l s a S t u d e n t s )   : - 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , v a l i d ) . 
 
     s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( g r a n t s ) , v a l i d ) . 
 
     s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
 
 
 I n f o :   S o l v i n g   q u e r y   b a s i c L e v e l S t u d e n t s ( A ) . . . 
 
 I n f o :   S o l v i n g   q u e r y   c a n d i d a t e s ( A ) . . .                 
 
 I n f o :   C o m p u t i n g   b y   s t r a t u m   o f   [ c a n d i d a t e s _ 1 _ 2 ( A ) ] . 
 
 I n f o :   S o l v i n g   q u e r y   c o u r s e s ( A , B , C , D ) . . .           
 
 I n f o :   S o l v i n g   q u e r y   p a y m e n t ( A , B , C ) . . .               
 
 I n f o :   S o l v i n g   q u e r y   r e g i s t r a t i o n ( A , B , C ) . . .     
 
 I n f o :   S o l v i n g   q u e r y   s a l s a C o u r s e s ( A , B , C ) . . .     
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s ( A , B , C ) . . .   
 
 I n f o :   S o l v i n g   q u e r y   c a n d i d a t e s _ s l i c e 1 ( A ) . . .   
 
 I n f o :   C o m p u t i n g   b y   s t r a t u m   o f   [ c a n d i d a t e s _ 1 _ 2 ( A ) , c a n d i d a t e s _ s l i c e 1 _ 1 _ 4 ( A ) ] . 
 
 I n f o :   Q u e s t i o n :   a l l ( p a y m e n t )                                 
 
 I n f o :   p r o c e s s A n s w e r ( a l l ( p a y m e n t ) , v a l i d ) 
 
 I n f o :   C u r r e n t   l o g i c   p r o g r a m : 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( g r a n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( b a s i c L e v e l S t u d e n t s )   : - 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c a n d i d a t e s )   : - 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c o u r s e s )   : - 
 
         s t a t e ( a l l ( c o u r s e s ) , n o n v a l i d ) . 
 
     b u g g y ( g r a n t s )   : - 
 
         s t a t e ( a l l ( g r a n t s ) , n o n v a l i d ) . 
 
     b u g g y ( i n t e n s i v e S t u d e n t s )   : - 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( p a y m e n t )   : - 
 
         s t a t e ( a l l ( p a y m e n t ) , n o n v a l i d ) . 
 
     b u g g y ( r e g i s t r a t i o n )   : - 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , n o n v a l i d ) . 
 
     b u g g y ( s a l s a C o u r s e s )   : - 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c o u r s e s ) , v a l i d ) . 
 
     b u g g y ( s a l s a S t u d e n t s )   : - 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , v a l i d ) . 
 
     s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( g r a n t s ) , v a l i d ) . 
 
     s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
 
 
 I n f o :   S o l v i n g   q u e r y   b a s i c L e v e l S t u d e n t s ( A ) . . . 
 
 I n f o :   S o l v i n g   q u e r y   c a n d i d a t e s ( A ) . . .                 
 
 I n f o :   C o m p u t i n g   b y   s t r a t u m   o f   [ c a n d i d a t e s _ 1 _ 2 ( A ) ] . 
 
 I n f o :   S o l v i n g   q u e r y   c o u r s e s ( A , B , C , D ) . . .           
 
 I n f o :   S o l v i n g   q u e r y   r e g i s t r a t i o n ( A , B , C ) . . .     
 
 I n f o :   S o l v i n g   q u e r y   s a l s a C o u r s e s ( A , B , C ) . . .     
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s ( A , B , C ) . . .   
 
 I n f o :   S o l v i n g   q u e r y   c a n d i d a t e s _ s l i c e 1 ( A ) . . .   
 
 I n f o :   C o m p u t i n g   b y   s t r a t u m   o f   [ c a n d i d a t e s _ 1 _ 2 ( A ) , c a n d i d a t e s _ s l i c e 1 _ 1 _ 4 ( A ) ] . 
 
 I n f o :   Q u e s t i o n :   s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) 
 
 I n f o :   S o l v i n g   q u e r y   c a n d i d a t e s _ s l i c e 1 ( A ) . . . 
 
 I n f o :   C o m p u t i n g   b y   s t r a t u m   o f   [ c a n d i d a t e s _ 1 _ 2 ( A ) , c a n d i d a t e s _ s l i c e 1 _ 1 _ 4 ( A ) ] . 
 
 I n f o :   D e b u g g i n g   v i e w   ' c a n d i d a t e s ' .                     
 
     S E L E C T   A L L   $ t 2 . s t u d e n t   A S   $ a 3 
 
     F R O M   
 
         b a s i c L e v e l S t u d e n t s   A S   $ t 2 
 
     W H E R E   ( $ t 2 . s t u d e n t )   N O T   I N   ( 
 
             S E L E C T   A L L   $ t 0 . s t u d e n t   A S   $ a 1 
 
             F R O M   
 
                 i n t e n s i v e S t u d e n t s   A S   $ t 0   ) ; 
 
 I n p u t :   S h o u l d   ' c a n d i d a t e s '   i n c l u d e   a   t u p l e   o f   t h e   f o r m   ' A n a ' ?   ( y / n / a )   [ y ] :   n 
 
 I n f o :   p r o c e s s A n s w e r ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , w r o n g ( c a n d i d a t e s ( A n a ) ) ) 
 
 I n f o :   p r o c e s s A n s w e r ( a l l ( c a n d i d a t e s ) , w r o n g ( c a n d i d a t e s ( A n a ) ) ) 
 
 I n f o :   P r o c e s s i n g : 
 
     C R E A T E   V I E W   b a s i c L e v e l S t u d e n t s _ s l i c e 1 ( s t u d e n t )   A S 
 
         S E L E C T   A L L   * 
 
         F R O M   
 
             b a s i c L e v e l S t u d e n t s   A S   R 
 
         W H E R E   E X I S T S   ( 
 
                 S E L E C T   A L L   b a s i c L e v e l S t u d e n t s . s t u d e n t 
 
                 F R O M   
 
                     b a s i c L e v e l S t u d e n t s   A S   $ t 2 
 
                 W H E R E   ( ( ( $ t 2 . s t u d e n t )   N O T   I N   ( 
 
                         S E L E C T   A L L   $ t 0 . s t u d e n t   A S   $ a 1 
 
                         F R O M   
 
                             i n t e n s i v e S t u d e n t s   A S   $ t 0   )   A N D   $ t 2 . s t u d e n t   =   R . s t u d e n t )   A N D   b a s i c L e v e l S t u d e n t s . s t u d e n t   =   ' A n a ' )   ) ; 
 
 I n f o :   P a r s i n g   q u e r y . . . 
 
 I n f o :   Q u e r y   s u c c e s s f u l l y   p a r s e d . 
 
 I n f o :   C o m p i l i n g   S Q L   s t a t e m e n t   t o   D a t a l o g   r u l e s . . . 
 
 I n f o :   S Q L   s t a t e m e n t   s u c c e s s f u l l y   c o m p i l e d . 
 
 I n f o :   V i e w   c r e a t e d . 
 
 I n f o :   C o m p u t i n g   p r e d i c a t e   d e p e n d e n c y   g r a p h . . . 
 
 I n f o :   C o m p u t i n g   s t r a t a . . . 
 
 I n f o :   C u r r e n t   l o g i c   p r o g r a m : 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( g r a n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( b a s i c L e v e l S t u d e n t s )   : - 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c a n d i d a t e s )   : - 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c a n d i d a t e s )   : - 
 
         s t a t e ( s u b s e t ( b a s i c L e v e l S t u d e n t s _ s l i c e 1 , b a s i c L e v e l S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c o u r s e s )   : - 
 
         s t a t e ( a l l ( c o u r s e s ) , n o n v a l i d ) . 
 
     b u g g y ( g r a n t s )   : - 
 
         s t a t e ( a l l ( g r a n t s ) , n o n v a l i d ) . 
 
     b u g g y ( i n t e n s i v e S t u d e n t s )   : - 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( p a y m e n t )   : - 
 
         s t a t e ( a l l ( p a y m e n t ) , n o n v a l i d ) . 
 
     b u g g y ( r e g i s t r a t i o n )   : - 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , n o n v a l i d ) . 
 
     b u g g y ( s a l s a C o u r s e s )   : - 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c o u r s e s ) , v a l i d ) . 
 
     b u g g y ( s a l s a S t u d e n t s )   : - 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , v a l i d ) . 
 
     s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( c a n d i d a t e s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( g r a n t s ) , v a l i d ) . 
 
     s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     s t a t e ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , n o n v a l i d ) . 
 
 
 
 I n f o :   S o l v i n g   q u e r y   b a s i c L e v e l S t u d e n t s ( A ) . . . 
 
 I n f o :   S o l v i n g   q u e r y   c o u r s e s ( A , B , C , D ) . . .           
 
 I n f o :   S o l v i n g   q u e r y   r e g i s t r a t i o n ( A , B , C ) . . .     
 
 I n f o :   S o l v i n g   q u e r y   s a l s a C o u r s e s ( A , B , C ) . . .     
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s ( A , B , C ) . . .   
 
 I n f o :   S o l v i n g   q u e r y   b a s i c L e v e l S t u d e n t s _ s l i c e 1 ( A ) . . . 
 
 I n f o :   C o m p u t i n g   b y   s t r a t u m   o f   [ b a s i c L e v e l S t u d e n t s _ s l i c e 1 _ 1 _ 4 ( A ) ] . 
 
 I n f o :   Q u e s t i o n :   s u b s e t ( b a s i c L e v e l S t u d e n t s _ s l i c e 1 , b a s i c L e v e l S t u d e n t s ) 
 
 I n f o :   S o l v i n g   q u e r y   b a s i c L e v e l S t u d e n t s _ s l i c e 1 ( A ) . . . 
 
 I n f o :   C o m p u t i n g   b y   s t r a t u m   o f   [ b a s i c L e v e l S t u d e n t s _ s l i c e 1 _ 1 _ 4 ( A ) ] . 
 
 I n f o :   D e b u g g i n g   v i e w   ' b a s i c L e v e l S t u d e n t s ' .     
 
     S E L E C T   A L L   a 1 . s t u d e n t   A S   $ a 2 0 
 
     F R O M   
 
         s a l s a S t u d e n t s   A S   a 1 ,   
 
         s a l s a S t u d e n t s   A S   a 2 ,   
 
         s a l s a S t u d e n t s   A S   a 3 
 
     W H E R E   ( ( ( ( ( ( a 1 . s t u d e n t   =   a 2 . s t u d e n t   A N D   a 2 . s t u d e n t   =   a 3 . s t u d e n t )   A N D   a 1 . l e v e l   =   1 )   A N D   a 2 . l e v e l   =   2 )   A N D   a 3 . l e v e l   =   3 )   A N D   a 1 . t e a c h e r   < >   a 2 . t e a c h e r )   A N D   a 2 . t e a c h e r   < >   a 3 . t e a c h e r ) ; 
 
 I n p u t :   S h o u l d   ' b a s i c L e v e l S t u d e n t s '   i n c l u d e   a   t u p l e   o f   t h e   f o r m   ' A n a ' ?   ( y / n / a )   [ y ] :   n 
 
 I n f o :   p r o c e s s A n s w e r ( s u b s e t ( b a s i c L e v e l S t u d e n t s _ s l i c e 1 , b a s i c L e v e l S t u d e n t s ) , w r o n g ( b a s i c L e v e l S t u d e n t s ( A n a ) ) ) 
 
 I n f o :   p r o c e s s A n s w e r ( a l l ( b a s i c L e v e l S t u d e n t s ) , w r o n g ( b a s i c L e v e l S t u d e n t s ( A n a ) ) ) 
 
 I n f o :   P r o c e s s i n g : 
 
     C R E A T E   V I E W   s a l s a S t u d e n t s _ s l i c e 1 ( s t u d e n t , l e v e l , t e a c h e r )   A S 
 
         S E L E C T   A L L   * 
 
         F R O M   
 
             s a l s a S t u d e n t s   A S   R 
 
         W H E R E   E X I S T S   ( 
 
                 S E L E C T   A L L   s a l s a S t u d e n t s . s t u d e n t 
 
                 F R O M   
 
                     s a l s a S t u d e n t s   A S   a 1 ,   
 
                     s a l s a S t u d e n t s   A S   a 2 ,   
 
                     s a l s a S t u d e n t s   A S   a 3 
 
                 W H E R E   ( ( ( ( ( ( ( ( a 1 . s t u d e n t   =   a 2 . s t u d e n t   A N D   a 2 . s t u d e n t   =   a 3 . s t u d e n t )   A N D   a 1 . l e v e l   =   1 )   A N D   a 2 . l e v e l   =   2 )   A N D   a 3 . l e v e l   =   3 )   A N D   a 1 . t e a c h e r   < >   a 2 . t e a c h e r )   A N D   a 2 . t e a c h e r   < >   a 3 . t e a c h e r )   A N D   ( a 1 . s t u d e n t   =   R . s t u d e n t   A N D   ( a 1 . l e v e l   =   R . l e v e l   A N D   a 1 . t e a c h e r   =   R . t e a c h e r ) ) )   A N D   s a l s a S t u d e n t s . s t u d e n t   =   ' A n a ' )   ) ; 
 
 I n f o :   P a r s i n g   q u e r y . . . 
 
 I n f o :   Q u e r y   s u c c e s s f u l l y   p a r s e d . 
 
 I n f o :   C o m p i l i n g   S Q L   s t a t e m e n t   t o   D a t a l o g   r u l e s . . . 
 
 I n f o :   S Q L   s t a t e m e n t   s u c c e s s f u l l y   c o m p i l e d . 
 
 I n f o :   V i e w   c r e a t e d . 
 
 I n f o :   C o m p u t i n g   p r e d i c a t e   d e p e n d e n c y   g r a p h . . . 
 
 I n f o :   C o m p u t i n g   s t r a t a . . . 
 
 I n f o :   P r o c e s s i n g : 
 
     C R E A T E   V I E W   s a l s a S t u d e n t s _ s l i c e 2 ( s t u d e n t , l e v e l , t e a c h e r )   A S 
 
         S E L E C T   A L L   * 
 
         F R O M   
 
             s a l s a S t u d e n t s   A S   R 
 
         W H E R E   E X I S T S   ( 
 
                 S E L E C T   A L L   s a l s a S t u d e n t s . s t u d e n t 
 
                 F R O M   
 
                     s a l s a S t u d e n t s   A S   a 1 ,   
 
                     s a l s a S t u d e n t s   A S   a 2 ,   
 
                     s a l s a S t u d e n t s   A S   a 3 
 
                 W H E R E   ( ( ( ( ( ( ( ( a 1 . s t u d e n t   =   a 2 . s t u d e n t   A N D   a 2 . s t u d e n t   =   a 3 . s t u d e n t )   A N D   a 1 . l e v e l   =   1 )   A N D   a 2 . l e v e l   =   2 )   A N D   a 3 . l e v e l   =   3 )   A N D   a 1 . t e a c h e r   < >   a 2 . t e a c h e r )   A N D   a 2 . t e a c h e r   < >   a 3 . t e a c h e r )   A N D   ( a 2 . s t u d e n t   =   R . s t u d e n t   A N D   ( a 2 . l e v e l   =   R . l e v e l   A N D   a 2 . t e a c h e r   =   R . t e a c h e r ) ) )   A N D   s a l s a S t u d e n t s . s t u d e n t   =   ' A n a ' )   ) ; 
 
 I n f o :   P a r s i n g   q u e r y . . . 
 
 I n f o :   Q u e r y   s u c c e s s f u l l y   p a r s e d . 
 
 I n f o :   C o m p i l i n g   S Q L   s t a t e m e n t   t o   D a t a l o g   r u l e s . . . 
 
 I n f o :   S Q L   s t a t e m e n t   s u c c e s s f u l l y   c o m p i l e d . 
 
 I n f o :   V i e w   c r e a t e d . 
 
 I n f o :   C o m p u t i n g   p r e d i c a t e   d e p e n d e n c y   g r a p h . . . 
 
 I n f o :   C o m p u t i n g   s t r a t a . . . 
 
 I n f o :   P r o c e s s i n g : 
 
     C R E A T E   V I E W   s a l s a S t u d e n t s _ s l i c e 3 ( s t u d e n t , l e v e l , t e a c h e r )   A S 
 
         S E L E C T   A L L   * 
 
         F R O M   
 
             s a l s a S t u d e n t s   A S   R 
 
         W H E R E   E X I S T S   ( 
 
                 S E L E C T   A L L   s a l s a S t u d e n t s . s t u d e n t 
 
                 F R O M   
 
                     s a l s a S t u d e n t s   A S   a 1 ,   
 
                     s a l s a S t u d e n t s   A S   a 2 ,   
 
                     s a l s a S t u d e n t s   A S   a 3 
 
                 W H E R E   ( ( ( ( ( ( ( ( a 1 . s t u d e n t   =   a 2 . s t u d e n t   A N D   a 2 . s t u d e n t   =   a 3 . s t u d e n t )   A N D   a 1 . l e v e l   =   1 )   A N D   a 2 . l e v e l   =   2 )   A N D   a 3 . l e v e l   =   3 )   A N D   a 1 . t e a c h e r   < >   a 2 . t e a c h e r )   A N D   a 2 . t e a c h e r   < >   a 3 . t e a c h e r )   A N D   ( a 3 . s t u d e n t   =   R . s t u d e n t   A N D   ( a 3 . l e v e l   =   R . l e v e l   A N D   a 3 . t e a c h e r   =   R . t e a c h e r ) ) )   A N D   s a l s a S t u d e n t s . s t u d e n t   =   ' A n a ' )   ) ; 
 
 I n f o :   P a r s i n g   q u e r y . . . 
 
 I n f o :   Q u e r y   s u c c e s s f u l l y   p a r s e d . 
 
 I n f o :   C o m p i l i n g   S Q L   s t a t e m e n t   t o   D a t a l o g   r u l e s . . . 
 
 I n f o :   S Q L   s t a t e m e n t   s u c c e s s f u l l y   c o m p i l e d . 
 
 I n f o :   V i e w   c r e a t e d . 
 
 I n f o :   C o m p u t i n g   p r e d i c a t e   d e p e n d e n c y   g r a p h . . . 
 
 I n f o :   C o m p u t i n g   s t r a t a . . . 
 
 I n f o :   C u r r e n t   l o g i c   p r o g r a m : 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( g r a n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( b a s i c L e v e l S t u d e n t s )   : - 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( b a s i c L e v e l S t u d e n t s )   : - 
 
         s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 1 , s a l s a S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 2 , s a l s a S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 3 , s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c a n d i d a t e s )   : - 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c a n d i d a t e s )   : - 
 
         s t a t e ( s u b s e t ( b a s i c L e v e l S t u d e n t s _ s l i c e 1 , b a s i c L e v e l S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c o u r s e s )   : - 
 
         s t a t e ( a l l ( c o u r s e s ) , n o n v a l i d ) . 
 
     b u g g y ( g r a n t s )   : - 
 
         s t a t e ( a l l ( g r a n t s ) , n o n v a l i d ) . 
 
     b u g g y ( i n t e n s i v e S t u d e n t s )   : - 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( p a y m e n t )   : - 
 
         s t a t e ( a l l ( p a y m e n t ) , n o n v a l i d ) . 
 
     b u g g y ( r e g i s t r a t i o n )   : - 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , n o n v a l i d ) . 
 
     b u g g y ( s a l s a C o u r s e s )   : - 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c o u r s e s ) , v a l i d ) . 
 
     b u g g y ( s a l s a S t u d e n t s )   : - 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , v a l i d ) . 
 
     s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( c a n d i d a t e s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( g r a n t s ) , v a l i d ) . 
 
     s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     s t a t e ( s u b s e t ( b a s i c L e v e l S t u d e n t s _ s l i c e 1 , b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) . 
 
     s t a t e ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , n o n v a l i d ) . 
 
 
 
 I n f o :   S o l v i n g   q u e r y   c o u r s e s ( A , B , C , D ) . . . 
 
 I n f o :   S o l v i n g   q u e r y   r e g i s t r a t i o n ( A , B , C ) . . .     
 
 I n f o :   S o l v i n g   q u e r y   s a l s a C o u r s e s ( A , B , C ) . . .     
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s ( A , B , C ) . . .   
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s _ s l i c e 1 ( A , B , C ) . . . 
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s _ s l i c e 2 ( A , B , C ) . . . 
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s _ s l i c e 3 ( A , B , C ) . . . 
 
 I n f o :   Q u e s t i o n :   s u b s e t ( s a l s a S t u d e n t s _ s l i c e 1 , s a l s a S t u d e n t s ) 
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s _ s l i c e 1 ( A , B , C ) . . . 
 
 I n f o :   D e b u g g i n g   v i e w   ' s a l s a S t u d e n t s ' .               
 
     S E L E C T   A L L   R . s t u d e n t   A S   $ a 8 ,   C . l e v e l   A S   $ a 9 ,   C . t e a c h e r   A S   $ a 1 0 
 
     F R O M   
 
         s a l s a C o u r s e s   A S   C ,   
 
         r e g i s t r a t i o n   A S   R 
 
     W H E R E   C . i d   =   R . c o u r s e ; 
 
 I n p u t :   S h o u l d   ' s a l s a S t u d e n t s '   i n c l u d e   a   t u p l e   o f   t h e   f o r m   ' A n a , 1 , t e a c h 1 ' ?   ( y / n / a )   [ y ] :   
 
 I n f o :   p r o c e s s A n s w e r ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 1 , s a l s a S t u d e n t s ) , v a l i d ) 
 
 I n f o :   C u r r e n t   l o g i c   p r o g r a m : 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( g r a n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( b a s i c L e v e l S t u d e n t s )   : - 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( b a s i c L e v e l S t u d e n t s )   : - 
 
         s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 1 , s a l s a S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 2 , s a l s a S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 3 , s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c a n d i d a t e s )   : - 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c a n d i d a t e s )   : - 
 
         s t a t e ( s u b s e t ( b a s i c L e v e l S t u d e n t s _ s l i c e 1 , b a s i c L e v e l S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c o u r s e s )   : - 
 
         s t a t e ( a l l ( c o u r s e s ) , n o n v a l i d ) . 
 
     b u g g y ( g r a n t s )   : - 
 
         s t a t e ( a l l ( g r a n t s ) , n o n v a l i d ) . 
 
     b u g g y ( i n t e n s i v e S t u d e n t s )   : - 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( p a y m e n t )   : - 
 
         s t a t e ( a l l ( p a y m e n t ) , n o n v a l i d ) . 
 
     b u g g y ( r e g i s t r a t i o n )   : - 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , n o n v a l i d ) . 
 
     b u g g y ( s a l s a C o u r s e s )   : - 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c o u r s e s ) , v a l i d ) . 
 
     b u g g y ( s a l s a S t u d e n t s )   : - 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , v a l i d ) . 
 
     s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( c a n d i d a t e s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( g r a n t s ) , v a l i d ) . 
 
     s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     s t a t e ( s u b s e t ( b a s i c L e v e l S t u d e n t s _ s l i c e 1 , b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) . 
 
     s t a t e ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , n o n v a l i d ) . 
 
     s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 1 , s a l s a S t u d e n t s ) , v a l i d ) . 
 
 
 
 I n f o :   S o l v i n g   q u e r y   c o u r s e s ( A , B , C , D ) . . . 
 
 I n f o :   S o l v i n g   q u e r y   r e g i s t r a t i o n ( A , B , C ) . . .     
 
 I n f o :   S o l v i n g   q u e r y   s a l s a C o u r s e s ( A , B , C ) . . .     
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s ( A , B , C ) . . .   
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s _ s l i c e 2 ( A , B , C ) . . . 
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s _ s l i c e 3 ( A , B , C ) . . . 
 
 I n f o :   Q u e s t i o n :   s u b s e t ( s a l s a S t u d e n t s _ s l i c e 2 , s a l s a S t u d e n t s ) 
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s _ s l i c e 2 ( A , B , C ) . . . 
 
 I n f o :   D e b u g g i n g   v i e w   ' s a l s a S t u d e n t s ' .               
 
     S E L E C T   A L L   R . s t u d e n t   A S   $ a 8 ,   C . l e v e l   A S   $ a 9 ,   C . t e a c h e r   A S   $ a 1 0 
 
     F R O M   
 
         s a l s a C o u r s e s   A S   C ,   
 
         r e g i s t r a t i o n   A S   R 
 
     W H E R E   C . i d   =   R . c o u r s e ; 
 
 I n p u t :   S h o u l d   ' s a l s a S t u d e n t s '   i n c l u d e   a   t u p l e   o f   t h e   f o r m   ' A n a , 2 , t e a c h 2 ' ?   ( y / n / a )   [ y ] :   
 
 I n f o :   p r o c e s s A n s w e r ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 2 , s a l s a S t u d e n t s ) , v a l i d ) 
 
 I n f o :   C u r r e n t   l o g i c   p r o g r a m : 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( g r a n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( b a s i c L e v e l S t u d e n t s )   : - 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( b a s i c L e v e l S t u d e n t s )   : - 
 
         s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 1 , s a l s a S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 2 , s a l s a S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 3 , s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c a n d i d a t e s )   : - 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c a n d i d a t e s )   : - 
 
         s t a t e ( s u b s e t ( b a s i c L e v e l S t u d e n t s _ s l i c e 1 , b a s i c L e v e l S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c o u r s e s )   : - 
 
         s t a t e ( a l l ( c o u r s e s ) , n o n v a l i d ) . 
 
     b u g g y ( g r a n t s )   : - 
 
         s t a t e ( a l l ( g r a n t s ) , n o n v a l i d ) . 
 
     b u g g y ( i n t e n s i v e S t u d e n t s )   : - 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( p a y m e n t )   : - 
 
         s t a t e ( a l l ( p a y m e n t ) , n o n v a l i d ) . 
 
     b u g g y ( r e g i s t r a t i o n )   : - 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , n o n v a l i d ) . 
 
     b u g g y ( s a l s a C o u r s e s )   : - 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c o u r s e s ) , v a l i d ) . 
 
     b u g g y ( s a l s a S t u d e n t s )   : - 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , v a l i d ) . 
 
     s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( c a n d i d a t e s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( g r a n t s ) , v a l i d ) . 
 
     s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     s t a t e ( s u b s e t ( b a s i c L e v e l S t u d e n t s _ s l i c e 1 , b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) . 
 
     s t a t e ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , n o n v a l i d ) . 
 
     s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 1 , s a l s a S t u d e n t s ) , v a l i d ) . 
 
     s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 2 , s a l s a S t u d e n t s ) , v a l i d ) . 
 
 
 
 I n f o :   S o l v i n g   q u e r y   c o u r s e s ( A , B , C , D ) . . . 
 
 I n f o :   S o l v i n g   q u e r y   r e g i s t r a t i o n ( A , B , C ) . . .     
 
 I n f o :   S o l v i n g   q u e r y   s a l s a C o u r s e s ( A , B , C ) . . .     
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s ( A , B , C ) . . .   
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s _ s l i c e 3 ( A , B , C ) . . . 
 
 I n f o :   Q u e s t i o n :   s u b s e t ( s a l s a S t u d e n t s _ s l i c e 3 , s a l s a S t u d e n t s ) 
 
 I n f o :   S o l v i n g   q u e r y   s a l s a S t u d e n t s _ s l i c e 3 ( A , B , C ) . . . 
 
 I n f o :   D e b u g g i n g   v i e w   ' s a l s a S t u d e n t s ' .               
 
     S E L E C T   A L L   R . s t u d e n t   A S   $ a 8 ,   C . l e v e l   A S   $ a 9 ,   C . t e a c h e r   A S   $ a 1 0 
 
     F R O M   
 
         s a l s a C o u r s e s   A S   C ,   
 
         r e g i s t r a t i o n   A S   R 
 
     W H E R E   C . i d   =   R . c o u r s e ; 
 
 I n p u t :   S h o u l d   ' s a l s a S t u d e n t s '   i n c l u d e   a   t u p l e   o f   t h e   f o r m   ' A n a , 3 , t e a c h 1 ' ?   ( y / n / a )   [ y ] :   
 
 I n f o :   p r o c e s s A n s w e r ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 3 , s a l s a S t u d e n t s ) , v a l i d ) 
 
 I n f o :   C u r r e n t   l o g i c   p r o g r a m : 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( g r a n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( b a s i c L e v e l S t u d e n t s )   : - 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( b a s i c L e v e l S t u d e n t s )   : - 
 
         s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 1 , s a l s a S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 2 , s a l s a S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 3 , s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c a n d i d a t e s )   : - 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c a n d i d a t e s )   : - 
 
         s t a t e ( s u b s e t ( b a s i c L e v e l S t u d e n t s _ s l i c e 1 , b a s i c L e v e l S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c o u r s e s )   : - 
 
         s t a t e ( a l l ( c o u r s e s ) , n o n v a l i d ) . 
 
     b u g g y ( g r a n t s )   : - 
 
         s t a t e ( a l l ( g r a n t s ) , n o n v a l i d ) . 
 
     b u g g y ( i n t e n s i v e S t u d e n t s )   : - 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( p a y m e n t )   : - 
 
         s t a t e ( a l l ( p a y m e n t ) , n o n v a l i d ) . 
 
     b u g g y ( r e g i s t r a t i o n )   : - 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , n o n v a l i d ) . 
 
     b u g g y ( s a l s a C o u r s e s )   : - 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c o u r s e s ) , v a l i d ) . 
 
     b u g g y ( s a l s a S t u d e n t s )   : - 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , v a l i d ) . 
 
     s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( c a n d i d a t e s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( g r a n t s ) , v a l i d ) . 
 
     s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     s t a t e ( s u b s e t ( b a s i c L e v e l S t u d e n t s _ s l i c e 1 , b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) . 
 
     s t a t e ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , n o n v a l i d ) . 
 
     s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 1 , s a l s a S t u d e n t s ) , v a l i d ) . 
 
     s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 2 , s a l s a S t u d e n t s ) , v a l i d ) . 
 
     s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 3 , s a l s a S t u d e n t s ) , v a l i d ) . 
 
 
 
 I n f o :   F i n a l   l o g i c   p r o g r a m : 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( g r a n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( a w a r d s )   : - 
 
         s t a t e ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , v a l i d ) , 
 
         s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     b u g g y ( b a s i c L e v e l S t u d e n t s )   : - 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( b a s i c L e v e l S t u d e n t s )   : - 
 
         s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 1 , s a l s a S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 2 , s a l s a S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 3 , s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c a n d i d a t e s )   : - 
 
         s t a t e ( a l l ( c a n d i d a t e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c a n d i d a t e s )   : - 
 
         s t a t e ( s u b s e t ( b a s i c L e v e l S t u d e n t s _ s l i c e 1 , b a s i c L e v e l S t u d e n t s ) , v a l i d ) , 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( c o u r s e s )   : - 
 
         s t a t e ( a l l ( c o u r s e s ) , n o n v a l i d ) . 
 
     b u g g y ( g r a n t s )   : - 
 
         s t a t e ( a l l ( g r a n t s ) , n o n v a l i d ) . 
 
     b u g g y ( i n t e n s i v e S t u d e n t s )   : - 
 
         s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , v a l i d ) . 
 
     b u g g y ( p a y m e n t )   : - 
 
         s t a t e ( a l l ( p a y m e n t ) , n o n v a l i d ) . 
 
     b u g g y ( r e g i s t r a t i o n )   : - 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , n o n v a l i d ) . 
 
     b u g g y ( s a l s a C o u r s e s )   : - 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( c o u r s e s ) , v a l i d ) . 
 
     b u g g y ( s a l s a S t u d e n t s )   : - 
 
         s t a t e ( a l l ( s a l s a S t u d e n t s ) , n o n v a l i d ) , 
 
         s t a t e ( a l l ( r e g i s t r a t i o n ) , v a l i d ) , 
 
         s t a t e ( a l l ( s a l s a C o u r s e s ) , v a l i d ) . 
 
     s t a t e ( a l l ( a w a r d s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( c a n d i d a t e s ) , n o n v a l i d ) . 
 
     s t a t e ( a l l ( g r a n t s ) , v a l i d ) . 
 
     s t a t e ( a l l ( i n t e n s i v e S t u d e n t s ) , v a l i d ) . 
 
     s t a t e ( a l l ( p a y m e n t ) , v a l i d ) . 
 
     s t a t e ( s u b s e t ( b a s i c L e v e l S t u d e n t s _ s l i c e 1 , b a s i c L e v e l S t u d e n t s ) , n o n v a l i d ) . 
 
     s t a t e ( s u b s e t ( c a n d i d a t e s _ s l i c e 1 , c a n d i d a t e s ) , n o n v a l i d ) . 
 
     s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 1 , s a l s a S t u d e n t s ) , v a l i d ) . 
 
     s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 2 , s a l s a S t u d e n t s ) , v a l i d ) . 
 
     s t a t e ( s u b s e t ( s a l s a S t u d e n t s _ s l i c e 3 , s a l s a S t u d e n t s ) , v a l i d ) . 
 
 
 
 I n f o :   B u g g y   v i e w   f o u n d :   b a s i c L e v e l S t u d e n t s 
 
 I n f o :   V i e w   ' c a n d i d a t e s _ s l i c e 1 '   d r o p p e d . 
 
 I n f o :   V i e w   ' b a s i c L e v e l S t u d e n t s _ s l i c e 1 '   d r o p p e d . 
 
 I n f o :   V i e w   ' s a l s a S t u d e n t s _ s l i c e 1 '   d r o p p e d . 
 
 I n f o :   V i e w   ' s a l s a S t u d e n t s _ s l i c e 2 '   d r o p p e d . 
 
 I n f o :   V i e w   ' s a l s a S t u d e n t s _ s l i c e 3 '   d r o p p e d . 
 
 
 
 D E S >   