Logiweb(TM)

7.1.8.2 Lazy quarreling

Prev Up Next Page 152 of 800 Search internet


Now consider the three lgs source texts from the previous section with a small change in the body of page.lgs. The first lgs source text is as before:

   ""P ref1
   ""R base
   ""D 0
   a
   b
   ""D 6
   " + "
   " - "
   ""B
   "We just include name definitions "[ ""N ]"
   and charge definitions "[ ""C ]" in the body"

The second lgs source text is as before:

   ""P ref2
   ""R base
   ""D 0
   x
   y
   ""D 4
   " * "
   ""D 6
   " + "
   ""B
   "We just include name definitions "[ ""N ]"
   and charge definitions "[ ""C ]" in the body"

The third lgs source text is page.lgs:

   ""P page
   ""R ref1
   ""R ref2
   ""B
   a * x + b * y

During translation of page.lgs, lgc(1) will issue a Use of ambiguous construct error message because both ref1 and ref2 define a plus construct and lgc cannot guess which one the plus in the body refers to.

Note that lgc has no problems referencing both ref1 and ref2 even though they both define a plus construct. Lgc does 'lazy quarreling' in the sense that it just notes that ref1 and ref2 both define a plus construct but does not complain before the plus construct is actually used.

Also note that page.lgs references ref1 and ref2 and that ref1 and ref2 in turn reference base. The base page defines a, b, x, y, multiplication, addition, and subtraction. But lgc has no problems translating a body like

   a * x - b * y

because lgc parses according to the grammar defined by the direct reflexive bibliography. In other words, the grammar only contains constructs from the page itself and directly referenced pages. Indirectly referenced pages like base in this case do not contribute to the grammar.

Prev Up Next Page 152 of 800 Search logiweb.eu

Copyright © 2010 Klaus Grue, GRD-2010-01-05