[developers] Bug in interactive unification

Stephan Oepen oe at ifi.uio.no
Wed Nov 11 22:49:28 CET 2020


hi woodley, and all:

> One could argue that LUI should be a bit more forgiving in enforcing type constraints on its commands.  Both internally and in the protocol, atomic values are treated differently from feature structures.  An atomic value at the top level is unanticipated, but I think it should work just fine if wrapped into a (trivial) feature structure.

yes, i am almost tempted to make that argument :-).  looking over the
code, it appears that for the serialization of AVMs the LUI team (in
2003, i would think) decided to piggy-back on what the LKB calls its
'linear' dag output format.  that looks like a format invented by ann
or john prior to LUI integration, and it does indeed consider any dag
without outgoing arcs an 'atomic' feature structure that is serialized
without any #D[...] decoration.  i am not sure written records of
protocol negotiations internal to the LUI team exist, but if the above
were by and large how the protocol was defined ... it would not be
unreasonable to expect LUI to accept the 'linear' serialization of
such atomic dags.

on the other hand, the current LUI interpretation of the protocol has
a broad and loyal user base, and it is not hard to accommodate its
expectations on the LKB side.  i just checked in the following
work-around (to both the LOGON and FOS branches of the LKB source
code), which appears to have the desired effect and should end up in
the next round of binary builds then.

best wishes, oe


Index: src/glue/lui.lsp
===================================================================
--- src/glue/lui.lsp    (revision 29084)
+++ src/glue/lui.lsp    (working copy)
@@ -307,10 +307,16 @@
          (*package* (find-package :lkb)))

     (lui-parameters :avm)
-    (let ((string (with-output-to-string (stream)
-                    (format stream "avm ~d " id)
-                    (display-dag1 dag 'linear stream))))
-      (format %lui-stream% string))
+    (let* ((string (with-output-to-string (stream)
+                     (display-dag1 dag 'linear stream)))
+           ;;
+           ;; work around a LUI idiosyncrasy: dress up atomic dags with a
+           ;; (kind of) spurious outermost decoration.
+           ;;
+           (string (if (char= (char string 0) #\#)
+                     string
+                     (concatenate 'string "#D[" string "]"))))
+      (format %lui-stream% "avm ~d ~a" id string))
     #+:null
     (format %lui-stream% " ~s~%" path)
     (format %lui-stream% " ~s~%" title)



More information about the developers mailing list