[cl-unification-devel] a simpler example

Marco Antoniotti marcoxa at cs.nyu.edu
Wed Jun 11 16:04:02 UTC 2008


There may be a misalignment with my version (which works on LW) and  
the CVS version,  or it may be a problem which SBCL raises due to its  
version (more strict) of MAKE-LOAD-FORM.

I'll look into it.

Thanks for raising the issue.

Meanwhile try the version attached on SBCL.

Cheers
--
Marco


-------------- next part --------------
A non-text attachment was scrubbed...
Name: cl-unification.zip
Type: application/zip
Size: 511454 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-unification-devel/attachments/20080611/07c6007b/attachment.zip>
-------------- next part --------------




On Jun 11, 2008, at 16:04 , Russell McManus wrote:

> I'm pretty sure that I tried repeating the #T before sending my  
> first email, but it failed with an error.
>
> I just tried again on sbcl 1.0.10.16 and got the following:
>
> (unify #T(list ?f #T(list ?s1 ?s2)) '(a (b c)))
>
>
> Cannot unify two different symbols: B MAKE-TEMPLATE.
>    [Condition of type CL.EXT.DACF.UNIFICATION::UNIFICATION-FAILURE]
>
> Restarts:
>  0: [ABORT] Return to SLIME's top level.
>  1: [TERMINATE-THREAD] Terminate this thread (#<THREAD  
> "worker" {1008AB0C91}>)
>
> Any ideas what I should try next?
>
> -russ
>
>
>
> ----- Original Message ----
>> From: Marco Antoniotti <marcoxa at cs.nyu.edu>
>> To: cl-unification-devel at common-lisp.net
>> Sent: Tuesday, June 10, 2008 3:51:44 AM
>> Subject: Re: [cl-unification-devel] a simpler example
>>
>>
>> On Jun 6, 2008, at 24:38 , Russell McManus wrote:
>>
>>>
>>> Here are some examples:
>>>
>>> ;; this works
>>> (find-variable-value
>>>  '?s
>>>  (unify #T(list ?f ?s) '(a (b c))))
>>
>> Yes.
>>
>>>
>>> ;; this works
>>> (find-variable-value
>>>  '?s1
>>>  (unify #T(list ?f (?s1 ?s2)) '(a (b c))))
>>
>> Yes.
>>
>>
>>>
>>> ;; this fails
>>> (find-variable-value
>>>  '?s1
>>>  (unify #T(list ?f (list ?s1 ?s2)) '(a (b c))))
>>
>> As it should.  What you want is
>>
>> (unify #T(list ?f #T(list ?s1 ?s2)) '(a (b c)))
>>
>> In your case you are trying to unify a template of type LIST with a
>> variable in FIRST and a list (LIST ?s1 ?s2) in SECOND.  The second
>> element cannot unify with (B C), hence the failure.
>>
>>>
>>> I was expecting the meaning of LIST to be the same whether
>>> it is encountered at top level in a template, or at a nested level.
>>>
>>> Is this a bug, or are my expectations wrong?
>>
>> Sorry.  It is your expectations.  If you look at the most general
>> syntax for templates, you will see that it is #T(.
>> ).  This is because it would be a nightmare to do otherwise.
>>
>>
>> Suppose you have a
>>
>> (unify #T(list 42 (foo)) (list 42 (list 'foo)))
>>
>> should unify.  But is next you do
>>
>> (defstruct foo a s d)
>>
>> then
>>
>> (unify #T(list 42 (foo)) (list 42 (list 'foo)))
>>
>> may or may not unify pending interpretation.
>>
>> Hope this clarifies things.  Let me know if there are other pitfalls
>> or bugs in the code.
>>
>> Cheers
>>
>> Marco
>>
>>
>>>
>>
>> --
>> Marco Antoniotti
>>
>>
>> _______________________________________________
>> cl-unification-devel site list
>> cl-unification-devel at common-lisp.net
>> http://common-lisp.net/mailman/listinfo/cl-unification-devel
>

--
Marco Antoniotti




More information about the cl-unification-devel mailing list