Skip to content

Fully qualify names in CoreToLogic#2327

Merged
facundominguez merged 1 commit into
ucsd-progsys:developfrom
jarctan:FixCoreToLogicPR
Sep 9, 2024
Merged

Fully qualify names in CoreToLogic#2327
facundominguez merged 1 commit into
ucsd-progsys:developfrom
jarctan:FixCoreToLogicPR

Conversation

@jarctan

@jarctan jarctan commented Sep 6, 2024

Copy link
Copy Markdown
Contributor

Related to issue #2319, in this PR we fully qualify symbols when transforming CoreExpr into Expr of the logic so we don't mistake builtin symbols with functions defined by the user (see example in the issue).

Worth mentioning, it means that this does not pass verification:

{-@ LIQUID "--ple"    	@-}
{-@ LIQUID "--reflection"    	@-}

module Inc00 where

import Prelude hiding (not)

{-@ reflect not @-}
not :: Bool -> Bool
not a = a

{-@ lemma :: {not True} @-}
lemma = ()

If you want to refer to your reflected functions that clash with builtin symbols of the logic, you have to fully qualify them:

{-@ LIQUID "--ple"    	@-}
{-@ LIQUID "--reflection"    	@-}

module Inc00 where

import Prelude hiding (not)

{-@ reflect not @-}
not :: Bool -> Bool
not a = a

{-@ lemma :: {Inc00.not True} @-}
lemma = ()

So that there's no ambiguity. Without qualification, we assume not (or the like) to refer to the builtin symbols from the logic.

Any comments welcome!

@facundominguez facundominguez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@facundominguez facundominguez merged commit 15b3ed4 into ucsd-progsys:develop Sep 9, 2024
@jarctan jarctan deleted the FixCoreToLogicPR branch September 16, 2024 14:42
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

Successfully merging this pull request may close these issues.

2 participants