ucsd-progsys / liquid-fixpoint

Horn Clause Constraint Solving for Liquid Types
BSD 3-Clause "New" or "Revised" License
139 stars 61 forks source link

[cutsolver] "named expression already defined with this name" #75

Closed BenjaminCosman closed 9 years ago

BenjaminCosman commented 9 years ago

See:

https://github.com/ucsd-progsys/liquid-fixpoint/blob/cutsolver/tests/todo/overwrite-names.fq

(excerpt from LH https://github.com/ucsd-progsys/liquidhaskell/blob/master/tests/pos/Overwrite.hs)

If you change the name of the constant, the test will pass. How do we avoid this kind of name conflict?

ranjitjhala commented 9 years ago

@bmcfluff I can fix this (the fix is to just memoize names of function symbols so we don't define the same symbol twice in SMT land...

ranjitjhala commented 9 years ago

Fixed by https://github.com/ucsd-progsys/liquid-fixpoint/pull/78

BenjaminCosman commented 9 years ago

See:

https://github.com/ucsd-progsys/liquid-fixpoint/blob/cutsolver/tests/todo/overwrite-names2.fq

Renaming Set_emp makes it pass.

ranjitjhala commented 9 years ago

note to self @ranjitjhala:

This test ALSO passes if we replace FAppTy Set_set X with Set_set X. Wonder why.

ranjitjhala commented 9 years ago

@bmcfluff -- what is the original haskell source that generates this .fq file? Can you re-run it? The .fq file should not have FAppTy Set X it should just have have Set X.

ranjitjhala commented 9 years ago
  1. NEVER EVER print out FAppTy (however it is used internally to denote type application),
  2. Port the ocaml app_of_t so that it eliminates the FAppTy BEFORE converting to Z3,
  3. Hide all "set" related stuff inside Theories.hs (it should not appear in Serialize.hs)
  4. LATER Fix OCAML parser to account for (@(0) @(1)) (type variable application, because now, these are NOT explicit)
ranjitjhala commented 9 years ago

This should be addressed by PR #103

Strangely, all LH tests are passing (hopefully no strange caching taking place!) so I didn't (yet) have to do step 4 above.

ranjitjhala commented 9 years ago

@bmcfluff can you check the above (and the original overwrite.hs and confirm before we close this?) Thanks!

BenjaminCosman commented 9 years ago

Looks like it works; closing and merging PR #103