Skip to content

support ghost definitions #4

Closed
Closed
@pickx

Description

@pickx

ghost definitions have a different syntax that would not be recognized by the current parser:

ghost $NAME($TYPE_LIST) $RETURNS_TYPE_OR_AXIOM_LIST
where

  • $TYPE_LIST is a (possibly empty) series of types separated by a comma.
  • $RETURNS_TYPE_AXIOM_LIST is either returns $TYPE; or some text delimited by curly brackets.

to make things worse, ghost also supports GhostMapDecl of the form ghost mapping($TYPE => $TYPE) $NAME $RETURNS_TYPE_OR_AXIOM_LIST.

examples from RealLifeCVTApplications:

  • ghost toAddress(address) returns ADDRESS;
  • ghost shadowSnapshots(ADDRESS,COUNTER) returns uint256;
  • ghost assetListLen() returns uint { //... }
  • ghost mapping(address => mapping(uint => uint)) multiDim2;
  • ghost mapping(uint256 => mathint) sumWithdrawalsPerStream { //... }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions