flang the compiler proves your program cannot hang 0.9.0 GitHub Try in the browserTry it Русский

What to read next

In what order should you read the documentation? Below is a route of five steps, from installation to your own program with proofs. Each step says what you can do after it. Steps 1–3 take about half an hour.

The main route

StepWhat to readAfter the step you can
1Installationcall flang --version and get a version
2Your first programwrite a function with a test, check it (flang check) and run it (flang run)
3Your first proofwrite a precondition and a postcondition, read a counterexample, write a proof by induction
4Language tour, six pages with exerciseswrite functions with a fold, your own types and match; fix a FLANG_NOT_TOTAL error
5Which construct to use when, Operationsmove a task you solved in another language to flang

Instead of step 4 you can take flangtutor: twelve lessons in the terminal, the compiler checks each answer (flangtutor --lang en). The program ships with the prebuilt builds.

Further, by task

After step 5 the order is free. Choose by what your program needs.

TaskWhat to readAfter the step you can
familiar loops and classesWhat loops and classes are rewritten intowrite a loop and a class and know what they are rewritten into
more proofsHow to read the proof report, Theorems step by step, The compiler rejected a proofread the whole output of flang check --proof and fix a theorem from a FLANG_PROOF_… message
files, network, processesThe boundary between flang and the host, Processes and supervision, Databasesread a file from a program with flang io
code in another languageGenerating C and JavaScript, Embedding in another program, Modules and packagesgenerate a project with flang emit and build it

Reference pages

You return to these as needed: Language constructs, Commands, Error codes, Known limitations.

If you are stuck

What you needCommand
see the errors of a fileflang check file.flang
see what is provedflang check file.flang --proof
see all commandsflang --help

An error message starts with a code: FLANG_TYPE, FLANG_NOT_TOTAL, FLANG_PROOF_INDUCTION_STEP. Codes starting with FLANG_PROOF_ are explained in The compiler rejected a proof, the rest in the error code reference. Install and start-up errors are on the page If it does not work.