NewsCrawler.org

Lynx lets developers formally verify Erlang and Elixir programs with Lean proofs

Lynx is a project that lets developers formally verify Erlang and Elixir programs using Lean[1]. You write laws in Erlang or Elixir, which are automatically translated to Lean, and you write proofs in Lean, and Lean's kernel checks the laws and proofs together. The proofs are about the actual Erlang or Elixir code, not a separate model or a compilation artifact. The article says Lynx has been used to check that Erlang's json implementation roundtrips, to guarantee that functions in Elixir's Task module leave no trailing messages in the inbox, and to find bugs and gaps in Elixir's type system.

The author explains that property-based testing[2] checks many generated inputs but cannot rule out every error, while formal verification[3] can guarantee a property for all specified inputs. Lynx is meant to augment such techniques, not replace them.

Lynx is installed as a Hex package and works with ExUnit, and the article gives a sum example that proves the empty list sums to zero and that summing concatenated lists matches adding their sums. Lynx models the Erlang runtime in Lean. The author says the project is early, so bugs and limitations are expected, and asks readers to file bug reports.

Read the original dashbit.coDiscussion

Sources

Published: First seen: Читать по-русски

Open as a page