Skip to content

Update printers to match BinCaml input#627

Open
JTrenerry wants to merge 7 commits into
mainfrom
ir-changes-bincaml
Open

Update printers to match BinCaml input#627
JTrenerry wants to merge 7 commits into
mainfrom
ir-changes-bincaml

Conversation

@JTrenerry
Copy link
Copy Markdown
Member

@JTrenerry JTrenerry commented May 12, 2026

The output of BASIL does not match the input of BinCaml in a couple places, this updates that to output what it expects.

Uninterp function should be a more function programming looking function i.e.

name : (a1 -> a2) -> o1

TODO

Variables can no longer have . in the name, the current idea is just to map them to be _ instead, but I don't like that idea and I would love something better.

@JTrenerry JTrenerry self-assigned this May 12, 2026
@JTrenerry JTrenerry added the help wanted Extra attention is needed label May 12, 2026
@katrinafyi
Copy link
Copy Markdown
Member

is

name : (a1 -> a2) -> o1

meant to be a function taking two arguments and returning o1? is this what basil outputs?

it seems like an incorrect application of currying..

@JTrenerry
Copy link
Copy Markdown
Member Author

JTrenerry commented May 12, 2026

val $FPAdd_64 : (bv64 -> bv64 -> bv32) -> bv64;

val name : type

Honestly, looking over the grammar, I am unsure why this parses, but it does and gives

map (map (bv64, map(bv64, bv64)) , bv64)

that doesnt make sense though, but removing the brackets does I think? (which I think is what you were saying)

name : a1 -> a2 -> o1

which gets parsed like

(a1 -> (a2 -> o1))

Copy link
Copy Markdown
Member

@katrinafyi katrinafyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also add a minimal test case?

Comment thread src/main/scala/translating/PrettyPrinter.scala Outdated
@JTrenerry
Copy link
Copy Markdown
Member Author

can you also add a minimal test case?

edited the failing test case to match the new syntax, it looks like the is just loading it, did you want a test that tests printing it too?

separator admits an optional trailing `->` which was consuming
the `->` and causing the

    "(" [Type] ")" "->" Type ;

rule to fail to match.
Copy link
Copy Markdown
Member

@katrinafyi katrinafyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JTrenerry i've pushed some commits to fix the parser test. let me know if you approve.

the sbasil grammar is quite outdated atm and this is really just a stop-gap until we bring the grammar more up to date with obasil, e.g. with #591.

also, sbasil doesn't even store the uninterpreted functions into the IR....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants