Hi Aarne, Krasimir e.a.,
on p.3 on my slides to the GF-seminar on Jan.9th (attached as
slides-transfer.pdf), I mentioned that there was a bug in the
'put_tree -compute' of the gf-shell. In the meantime, I checked the
compiler code and found the mistake. The computation doesn't compare
patterns with non-data-declared fun's properly; on mismatch, the
search is stopped instead of using further def-equations. The bug and
its fix is explained in detail in point 4 of the attached
gf-bugs.ps. The fix itself is
diff --git a/src/runtime/haskell/PGF/Expr.hs b/src/runtime/haskell/PGF/Expr.hs
index ff1114235..bdc8e5e90 100644
--- a/src/runtime/haskell/PGF/Expr.hs
+++ b/src/runtime/haskell/PGF/Expr.hs
@@ -408,7 +408,8 @@ match sig f eqs as0 =
tryMatch (p ) (VMeta i envi vs ) env = VSusp i envi vs (\v -> tryMatch p v env)
tryMatch (p ) (VGen i vs ) env = VConst f as0
tryMatch (p ) (VSusp i envi vs k) env = VSusp i envi vs (\v -> tryMatch p (k v) env)
- tryMatch (p ) v@(VConst _ _ ) env = VConst f as0
+-- tryMatch (p ) v@(VConst _ _ ) env = VConst f as0
+ tryMatch (p ) v@(VConst _ _ ) env = match sig f eqs as0 -- HL 10.2.2025
tryMatch (PApp f1 ps1) (VApp f2 vs2 ) env | f1 == f2 = tryMatches eqs (ps1++ps) (vs2++as) res env
tryMatch (PLit l1 ) (VLit l2 ) env | l1 == l2 = tryMatches eqs ps as res env
tryMatch (PImplArg p ) (VImplArg v ) env = tryMatch p v env
I used flags 'pt -normalize=f tree' and 'pt -transfer=f tree' on the
slides, but after fixing the bug in Expr.hs, I had to change the
definition of 'normalize'. Subsequently I also renamed the flags to
'pt -transfer=f tree' and 'pt -apply=f tree'
so that, in case the 'transfer' flag should be made available in
gf-3.12, the example of 'pt -transfer=iS' on p.195 of the GF-book
would work again.
I havn't yet made a git-branch of the material on DLang and the
transfer examples I showed on the slides (because I accidentally
started doing this on another, unsynchronized git-branch), but an
extensive description is attached as
gf-structural-transfer.ps
Hans
Akademischer Direktor am CIS bis März 2017 (seitdem im Ruhestand)
-------------------------------------------------------------------------
Dr.Hans Leiß
le...@cis.uni-muenchen.de
Centrum für Informations-
www.cis.uni-muenchen.de/~leiss/
und Sprachverarbeitung (CIS)
Universität München
Oettingenstr. 67
D-80538 München
-------------------------------------------------------------------------