LKB loading wrong grammar files? Lexicon caching?

I am facing a rather mysterious issue. I used to be able to use the logon version of the SRG perfectly fine with the logon version of the LKB. That all lives in a completely separate folder and I never modify any files there.

Yesterday I got a new binary of LKB-FOS from @johnca which includes an updated interface for Freeling. I tried the binary with the new SRG, it worked, all great. Obviously, using that binary did not involve touching any of the old SRG files. The new SRG lives in a separate folder.

Now when I try to use the old grammar with the old LKB, it loads and does not report any errors, just the usual warnings about some lexical rules which have always been there. And then when I try to parse… It behaves as if it were trying to use lexical types from the new grammar. Those types which have “native” in their names are from the new grammar. Am I going crazy? I am 100% sure that I load the correct (old) files which were never touched. What could be happening?

@johnca sent me a quick message suggesting this may have to do with lexicon caching. I have found this in the script:

;;; Next, the lexicon itself, instantiating (lexical) types of the grammar
;;; (some grammars with larger lexica organize them into multiple files).

    (lkb-pathname (parent-directory) "lexicon.tdl")
    (lkb-pathname (parent-directory) "generics.tdl")))

;;; For grammars with small lexicons, no need to use a cache file:
;(if *lexdb-params*
;    (load-lexdb-from-script)
;    (read-cached-lex-if-available 
;      (list
;         (lkb-pathname (parent-directory) "lexicon.tdl"))))

But both these portions of code involve cached lexicon so I am not sure how to disable that. Does anyone (1) have ideas about what is going on; (2) knows how to disable lexicon caching?

I don’t see how caching something with the old LKB could be related to using the new LKB but I simply don’t know what else to try.

@johnca says:

Cached lexicon files live in your tmp/ directory. If you are running logon LKB and LKB-FOS from the same user account then they will be sharing this directory, and thus the same cache files. I suggest you clear out the directory and then reload the grammar. If you have distinct versions of the same grammar then make sure their names differ in lkb/Version.lsp otherwise the cache files can get mixed up.

That indeed helps! Phew.

However, I don’t have a Version.lsp file anywhere (looked in the ERG, too). What is the right format for it?

Version.lsp is in the main directory. Thanks, @johnca !