Re: Pilog: Does NIL successfully unify with (@H . @T)?

2009-11-25 Thread cle



Alexander Burger wrote:

Hi Cle,
   


Hi Alex,


although not intended so, it seems I mutate the picoLisp mailing list
into a Pilog mailing list ;-)
 


Which is a good thing. This way we produce at last some Pilog
documentation ;-)
   


nice you see it that way :-)


(be attributes ((@H) @L @V) T (member (@H @V) @L) )
(be attributes ((@H . @) @L @V) (member (@H @V) @L) )
(be attributes ((@ . @T) @L @V) T (attributes @T @L @V) )
...
(? (attributes (b c) ((a 1) (b 2) (c 3)) @V))
...
good! But if I comment out the first rule, the Pilog interpreter gets
into an endless loop, I have to terminate explicitely.
 


Hmm, I cannot reproduce that. It works both with and without the first
rule.
   


Stupid me! Now I also cannot reproduce it! That is more than strange ... 
or perhaps ... perhaps I did execute it with the ./p script and did not 
hit the extra Enter afterwards? I have no another explanation, why it 
does work now ... sorry for the noise I made ... :-(



BTW, let me explain a debugging aid in Pilog: You can trace the matching
process for individual rules (similar to (trace 'fun) in Lisp) if you
write the names of the rules you like to trace between the '?' and the
first expression:

: (? attributes (attributes (b c) ((a 1) (b 2) (c 3)) @V))
1 (attributes (b c) ((a 1) (b 2) (c 3)) @V)
 @V=2
2 (attributes (b c) ((a 1) (b 2) (c 3)) @V)
1 (attributes (c) ((a 1) (b 2) (c 3)) @V)
 @V=3
2 (attributes (c) ((a 1) (b 2) (c 3)) @V)
->  NIL
:

The numbers preceding the trace output indicate which one of the
'attributes' rule matched.
   


That is *really* nice! This will be very helpful in my future 
investigations. Thank you! :-)



Cheers,
- Alex
   


Ciao,
Cle.


--040801020606010302090602
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit




 




Alexander Burger wrote:

 Hi Cle,
 


Hi Alex,


 
   although not intended so, it seems I mutate the picoLisp mailing list  
into a Pilog mailing list ;-)

   
 
 
Which is a good thing. This way we produce at last some Pilog
documentation ;-)
 


nice you see it that way :-)


 
  (be attributes ((@H) @L @V) T (member (@H @V) @L) )
  (be attributes ((@H . @) @L @V) (member (@H @V) @L) )
  (be attributes ((@ . @T) @L @V) T (attributes @T @L @V) )
..
  (? (attributes (b c) ((a 1) (b 2) (c 3)) @V))
..
good! But if I comment out the first rule, the Pilog interpreter gets  
into an endless loop, I have to terminate explicitely.

   
 
 
Hmm, I cannot reproduce that. It works both with and without the first
rule.
 


Stupid me! Now I also cannot reproduce it! That is more than strange
.. or perhaps ... perhaps I did execute it with the ./p script and did
not hit the extra Enter afterwards? I have no another explanation, why
it does work now ... sorry for the noise I made ... :-(


 BTW, let me explain a debugging aid in Pilog: You can trace the 
matching
process for individual rules (similar to (trace 'fun) in Lisp) if you
write the names of the rules you like to trace between the '?' and the
first expression:

  : (? attributes (attributes (b c) ((a 1) (b 2) (c 3)) @V))
  1 (attributes (b c) ((a 1) (b 2) (c 3)) @V)
   @V=2 
  2 (attributes (b c) ((a 1) (b 2) (c 3)) @V)

  1 (attributes (c) ((a 1) (b 2) (c 3)) @V)
   @V=3
  2 (attributes (c) ((a 1) (b 2) (c 3)) @V)
  -> NIL
  : 


The numbers preceding the trace output indicate which one of the
'attributes' rule matched.
 


That is *really* nice! This will be very helpful in my future
investigations. Thank you! :-)


 Cheers,
- Alex
 


Ciao,
Cle.




--040801020606010302090602--
--
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: Pilog: Does NIL successfully unify with (@H . @T)?

2009-11-24 Thread Alexander Burger
Hi Cle,

> although not intended so, it seems I mutate the picoLisp mailing list  
> into a Pilog mailing list ;-)

Which is a good thing. This way we produce at last some Pilog
documentation ;-)


>(be attributes ((@H) @L @V) T (member (@H @V) @L) )
>(be attributes ((@H . @) @L @V) (member (@H @V) @L) )
>(be attributes ((@ . @T) @L @V) T (attributes @T @L @V) )
> ...
>(? (attributes (b c) ((a 1) (b 2) (c 3)) @V))
> ...
> good! But if I comment out the first rule, the Pilog interpreter gets  
> into an endless loop, I have to terminate explicitely.

Hmm, I cannot reproduce that. It works both with and without the first
rule.


BTW, let me explain a debugging aid in Pilog: You can trace the matching
process for individual rules (similar to (trace 'fun) in Lisp) if you
write the names of the rules you like to trace between the '?' and the
first expression:

   : (? attributes (attributes (b c) ((a 1) (b 2) (c 3)) @V))
   1 (attributes (b c) ((a 1) (b 2) (c 3)) @V)
@V=2 
   2 (attributes (b c) ((a 1) (b 2) (c 3)) @V)
   1 (attributes (c) ((a 1) (b 2) (c 3)) @V)
@V=3
   2 (attributes (c) ((a 1) (b 2) (c 3)) @V)
   -> NIL
   : 

The numbers preceding the trace output indicate which one of the
'attributes' rule matched.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Pilog: Does NIL successfully unify with (@H . @T)?

2009-11-24 Thread cle

Hello again,

although not intended so, it seems I mutate the picoLisp mailing list 
into a Pilog mailing list ;-)


Another glitch I do not understand. Suppose following Pilog definition:

   (be attributes ((@H) @L @V) T (member (@H @V) @L) )
   (be attributes ((@H . @) @L @V) (member (@H @V) @L) )
   (be attributes ((@ . @T) @L @V) T (attributes @T @L @V) )

I intend to use it like

   (? (attributes (b c) ((a 1) (b 2) (c 3)) @V))

which binds @V to 2 and 3 sequentially during backtracking. So far so 
good! But if I comment out the first rule, the Pilog interpreter gets 
into an endless loop, I have to terminate explicitely.


What would be the reason for this? I thought, that reducing the 
attribute list in clause 2 and 3 would eventually lead to NIL. Then 
neither clause 2 onr 3 should match and the backtracking should come to 
an end. But somehow it does not.


What did I wrong?


Thanks in advance and ciao,
Cle.


--
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe