Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #9323

Re: Dburg and swi-prolog

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: Dburg and swi-prolog
Date 2012-01-31 15:09 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2012Jan31.160919@mips.complang.tuwien.ac.at> (permalink)
References <b18847f5-67c7-4527-b553-e494a999e9d3@o14g2000vbo.googlegroups.com>

Show all headers | View raw


Alex McDonald <blog@rivadpm.com> writes:
>Anton: I stumbled on dburg while researching how to modify lcc's md
>files to generate rules, and discovering that running against a DAG
>rather than a tree isn't quite as straightforward as I'd thought. With
>dburg downloaded, I tried running the Prolog provided on swi-prolog
>since the recommended Sicstus Prolog costs serious money.

Even if you had Sicstus, I would not recommend using dburg.  It's only
a grammar checker, so it does not generate a DAG parser, and it's only
proof-of-concept quality.

If you use some burg/iburg input, extending that to DAGs is relatively
easy:

1) Let the labeler visit every node once, in any topologically sorted
order (e.g., use the ordinary depth-first labeler, but with a
"visited" flag).

2) The reducer visits some node/nt combination, and marks that it was
there; if it visits such a combination and it is already marked, it
does not mark it again.  The actions have to be designed appropriately
for this strategy.

For lcc's lburg and its md files, things are more complicated, because
it is a more complicated tool with extra functionality and that is
used in various funny ways in the .md files.

>Error: no optimal rule for addr. Rulesets: [[addr->reg:0],[addr-
>>tadd[reg,reg]:1]]
>State:
>state(ERROR: c:/w32f/dburg/dburg.pl:548:
>        </2: Arithmetic: `addr/0' is not a function

Looks to me like some extra functionality of SWI is trying to evaluate
"addr->reg:0" as arithmetic expression instead of as uninterpreted
term.

>The same error as reported for addr/0 is reported against mem/0 and so
>on in the other dburg files as part of the rules() set. I have a
>feeling it's a parse problem. Any clues?

Yes, might also be something like that.  No clues, I never worked with
SWI, and my last serious use of Sicstus was in the last millenium:-).

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2011: http://www.euroforth.org/ef11/

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Dburg and swi-prolog Alex McDonald <blog@rivadpm.com> - 2012-01-30 13:52 -0800
  Re: Dburg and swi-prolog anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-01-31 15:09 +0000
    Re: Dburg and swi-prolog Alex McDonald <blog@rivadpm.com> - 2012-01-31 09:43 -0800
      Re: Dburg and swi-prolog anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-02-01 14:32 +0000

csiph-web