Change the syntax of predicates to be pred(ins ; outs) - #380
Conversation
Signed-off-by: Sacha Ayoun <sachaayoun@gmail.com>
Signed-off-by: Sacha Ayoun <sachaayoun@gmail.com>
…ts to be at the end Signed-off-by: Sacha Ayoun <sachaayoun@gmail.com>
Signed-off-by: Sacha Ayoun <sachaayoun@gmail.com>
Signed-off-by: Sacha Ayoun <sachaayoun@gmail.com>
Signed-off-by: Sacha Ayoun <sachaayoun@gmail.com>
|
Banger. |
|
I do note that this incurs an additional overhead on the user part when writing predicates (as it requires writing explicitly ins and outs). This is a pre-existing choice for core predicates, but users would usually not write core predicates by hand unless they'd write GIL. Now they have to do it for predicates. Eventually, it could be desirable for the GIL programs to define the number of parameters for each core predicate using e.g. or something... This would be optional but would enable checking programs... |
|
Note that we could also have the compiler mark arguments as in and outs in predicate calls, but that means modifying all compilers to resolve all files with all definitions (including runtime .gil and .jsil files) before compilation happens. |
|
Another note: this is also what CN and VeriFast require. |
|
I'm not a big fan of always, always requiring a semicolon in predicate defs/calls, like |
|
Yes to pred(;) looking odd, but what kind of predicate would have zero parameters to begin with? This is a corner case that shouldn't appear much, surely. |
|
No semicolon should be all ins, agreed. |
|
Yes. And for predicate calls, ideally, they should be inserted by the compilers, inferred from predicate definitions The issue is that the compilers currently don't assume we have the full program I think... |
|
Would it be more sane to change the types of preds / pred calls to have an ins list and an outs list, rather than a full params list and an ints count? |
|
I considered both options, felt like this was the minimal change |
Depends on #379
Change the syntax predicates to avoid having the clunky
+to indicate in-parameters and have ins first, and then outs after a semi-colon.This is better reviewed commit-by-commit.