[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xsmith-dev] XSmith questions



Thanks for your help!

>Every node in the AST has type information.

Sorry, I should have framed the question better.

Every node has type information, but IIUC it is annotated externally, right? What I’m curious about is why Definition requires an explicit type field in the AST node? Can’t the type information be stored externally as an attribute? And my question was that if there’s a reason this can’t be done, are there any other similar situations too? (That is, it will require an explicit type field in the AST node).

>The key to using Definitions in a statement language is basically a
>`Block`-like statement that can have a series of statements that
>include definitions needs to have a list of definitions and a list of
>statements separately.  This is a bit of a limitation, since many
>languages can interleave definitions and statements, and Xsmith
>basically can't.  At any rate, the `Block` node from canned-components
>does this.

Ah, I see. Perhaps one can hack by adding another subtype of Block node that, when rendering, will splice its body out. That would give an appearance of interleaving statements and declarations, though I think there could be a problem with variable scope -- if there's a variable shadowing in a block, splicing the body out could create a redefinition, which might be invalid in some languages.

>I hope you find Xsmith useful!  What are you intending to fuzz?  I'm
>also happy to look at any code you have on Github or such for some
>debugging help.

We are fuzzing Dafny compilers.