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

Invalid Cosette program yields invalid Coq code #76

Open
qaisjp opened this issue Dec 17, 2019 · 0 comments
Open

Invalid Cosette program yields invalid Coq code #76

qaisjp opened this issue Dec 17, 2019 · 0 comments

Comments

@qaisjp
Copy link

qaisjp commented Dec 17, 2019

Input example:

/* define schema employee, 
   here employee can contain any number of attributes, 
   but it has to at least contain integer attributes 
   eid and age */
schema customer(id:int, name:text, city:text);
schema account(num:int, branch:text, custid:int, balance:int);        

-- define table uw_emp using schema s1
table accs(account);
-- define table uw_sal using schema s1
table custs(customer);

-- define query q1 over uw_emp and uw_payroll
query q1                
`select c.id, c.name
    from accs a, custs c
    where c.id=a.custid
    and balance = (select max(al.balance) from accs as al)
    group by c.id, c.name`;

-- define query q2 likewise
query q2                
`select distinct c.id, c.name
    from accs a, custs c
    where c.id=a.custid
    and balance = (select max(al.balance) from accs as al)
    `;

verify q1 q2;           -- does q1 equal to q2?

Which causes the following error output:

Invalid generated Coq code. Please file an issue.

{"size":[1],"status":"UNSAT"}
generated/jxOJRPUUIWDyf.rkt:19:47: balance: unbound identifier in module
in: balance
context...:
/root/.racket/6.8/pkgs/rosette/rosette/base/form/module.rkt:16:0
standard-module-name-resolver
/Cosette-Web/backend/Cosette/rosette/server.rkt:38:10

Problematic line: and balance = (select max(al.balance) from accs as al)

It should be: and a.balance = [..]

@qaisjp qaisjp changed the title Invalid Cosette program is accepted and crashes Invalid Cosette program yields invalid Coq code Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant