Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parens causing problems in function/pred application #19

Open
mlavrent opened this issue Feb 16, 2020 · 2 comments
Open

Parens causing problems in function/pred application #19

mlavrent opened this issue Feb 16, 2020 · 2 comments
Labels
syntax Syntax problems in Forge

Comments

@mlavrent
Copy link
Collaborator

Seems that Forge throws errors when we use parens instead of brackets for function application. Need to either enforce that fun/pred definitions only use brackets or that parens/brackets are interchangeable in this sense. See https://piazza.com/class/k47gct456or1u6?cid=275

@mlavrent
Copy link
Collaborator Author

@mlavrent mlavrent added the syntax Syntax problems in Forge label Mar 13, 2020
@tnelson
Copy link
Owner

tnelson commented Oct 23, 2024

Looking at the Piazza thread for this, I believe the issue was that students were trying to use syntax like p(a) instead of p[a]. While the situation has improved, the errors could be better. Here are two examples:

#lang forge
sig A {}
pred p[a: A] {}
test expect { {some x: A | p(x)} is sat }

produces: x: unbound identifier at the use of x.

#lang forge
sig A {}
pred p[a: A] {}
test expect { {some x: A | {p(x)}} is sat }

produces: Element 1 of this block was an ill-formed predicate or helper function call. Check that the number of arguments given matches the declaration.

The latter indicates that, when enclosed in braces, Forge detects that predicate p is being used incorrectly. (Under the hood, >0-ary p is a Racket procedure. )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
syntax Syntax problems in Forge
Projects
None yet
Development

No branches or pull requests

2 participants