Closed amblafont closed 4 years ago
@amblafont what's in the top-level .ac file?
I don't have a .ac file, but I used the option --entry-funcs=entrypoints.cfg with stupid and main inside.
Just OoC, why would you need --entry-funcs
at all, if you don't have a .ac flie? Can you elaborate on your use case?
I am testing examples of dargent programs to see how to adapt the formalized correspondence proof between the generated C program and the cogent program
The bug seems to have nothing to do with the use of --entry-funcs
flag. Even without it, it has that duplicate getter.
I am testing examples of dargent programs to see how to adapt the formalized correspondence proof between the generated C program and the cogent program
The --entry-funcs
flag without an antiquoted C just does literally nothing.
In fact, it's not a bug. One version is generated for the "take" operation, and another one for the "member" operation. They just happen to be the same.
But there might be some optimisations that we may (or may not for verification reasons) want to do to reuse the getters.
Ah ok, so I guess our suggested format for the table file is not completely adequate. btw, do you have an example where member and take operations differ ?
I can't think of any case in which they can be different, but will need to read the code to see if there's any reason the getters are not reused.
Consider the cogent program (this example is probably not minimal)
with
stupid
andmain
in the list of entry points. The generated C code has two different getters and setters for the aa field, which do exactly the same thing.