Skip to content

Support Erlang maps #183

@neoaggelos

Description

@neoaggelos

Summary

Add support for Erlang maps in cuter. Cuter already contains some of the required machinery needed for supporting maps, but it currently crashes when parsing code that uses maps.

TODO

This is a rough TODO of things that are required for maps support:

  • (already implemented) Support MAP type for ErlangTerms, as well as marshaling from/to erlang values
  • Add support for map() type in specs (in progress)
  • Support c_map and c_map_pair AST nodes in concolic execution, as well as pattern matching (ref https://github.com/erlang/otp/blob/master/lib/compiler/src/core_parse.hrl#L75-L84). This mainly revolves around extending eval_expr/ and pattern_match/. (in progress)
  • Support the functions of the standard maps library (e.g. maps:get, maps:put, ...).
  • Investigate how cuter can internally handle map values, describe new log entries that can guide the concolic execution, and implement as many as possible.

Notes

  • My Erlang background is weak, so please excuse (and correct) any misuse/misunderstanding of Erlang/cuter terms.
  • My hope is that this issue can help with documenting the implementation process and any design choices made along the way.
  • I think it is best to split this work in parts, with separate small PRs for each new functionality subset, so as to help with testing and review.

WIP

Some early work is in https://github.com/neoaggelos/cuter/tree/maps-support

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