flang the compiler proves your program cannot hang 0.7.29 GitHub Русский

Diagnostics reference

When the compiler rejects a program, every error line starts with a code:

$ flang check docs/examples/diagnostics/type.flang
модуль «Probe»: функций 1, из них с доказанным завершением 1; типов 0
FLANG_TYPE в файле docs/examples/diagnostics/type.flang, строка 6, столбец 3: функция «Удвоить» объявлена как число, а тело даёт строка
docs/examples/diagnostics/type.flang: не проверено — замечаний 1
$ echo $?
1

The line gives the code, the file, the line and the column, and says what is wrong. The compiler prints its messages in Russian unless .flangrc says language = en (or FLANG_LANG=en is set): then flang check prints the code unchanged and the text in English for the codes that have an English template (ADR-0102). This page explains each code: what it means and what to do about it. Codes are grouped by the stage that reports them: parsing first, then names, types, termination and proofs.

Exit codes of flang check: 0 — no errors; 1 — errors found; 2 — bad call (unknown flag, no such file); 3 — with --proof, a guarantee is not proved (with --proof --strict, anything short of "everything is proved"); 4 — part of the checks did not run (--fast). The full table for all commands is on the Command reference.

Words in this page: a guarantee is an обеспечивает line (postcondition); the prover is the part of the compiler that proves guarantees for all inputs, called «ядро» in the output; a unit test is a пример.

Three traps that cost a day

Read these before you look up your code. In each one the error shows up somewhere other than where the mistake is.

A guarantee that calls a function of its own module breaks every module that imports it by list

The module checks fine on its own. The module that imports it fails.

модуль «Core»

тотальная функция «Двойка»
  принимает н: число
  возвращает число
  н умножить на 2

тотальная функция «Учтено»
  принимает н: число
  возвращает число
  обеспечивает «не меньше двойки» результат не меньше («Двойка» от н)
  («Двойка» от н) плюс 1
модуль «Import»
использует «Core» только «Учтено»

тотальная функция «Проба»
  принимает н: число
  возвращает число
  «Учтено» от н
$ flang check docs/examples/diagnostics/core.flang
модуль «Core»: функций 2, из них с доказанным завершением 2; типов 0
docs/examples/diagnostics/core.flang: проверено — разбор, типы, завершаемость, ядро и примеры; замечаний нет
$ flang check docs/examples/diagnostics/import.flang
модуль «Import»: функций 2, из них с доказанным завершением 0; типов 0; файлов вместе с импортами 2
без доказанного завершения: «Учтено» «Проба»
место указано строкой и столбцом, но без файла: вместе с импортами проверено файлов 2, а диагностика компилятора имени файла не несёт
FLANG_UNKNOWN_NAME, строка 12, столбец 4: неизвестная функция «Двойка»
FLANG_UNKNOWN_NAME, строка 11, столбец 56: неизвестная функция «Двойка»
FLANG_NOT_TOTAL, строка 12, столбец 4: тотальная функция «Учтено» вызывает неизвестную функцию «Двойка»: завершение доказать нельзя
docs/examples/diagnostics/import.flang: не проверено — замечаний 3
$ echo $?
1

The import только «Учтено» brings in one name. Both the body and the guarantee of «Учтено» call «Двойка», which the importing module does not have. Column 56 points inside the guarantee. The line numbers are those of the imported file, and no file is named because two files were checked together.

Fix it in one of three ways:

FixHow
import the helper tooиспользует «Core» только «Учтено», «Двойка»
import the whole moduleиспользует «Core»
remove the call from the guaranteesay the same with arithmetic: результат не меньше (н умножить на 2)

flang check passing does not mean the guarantees are proved

flang check without flags checks parsing, types, termination and unit tests. A guarantee it can neither prove nor refute does not make it fail. The guarantee «не меньше двойки» above is not proved: without --proof the file passes with exit code 0; with --proof the same file exits with 3.

To see what is proved, ask for the proof report:

flang check docs/examples/diagnostics/core.flang --proof
  постусловие «не меньше двойки» функции «Учтено» — объявлено, не доказано: ни теоремы, ни примеров. Его считает рантайм после каждого возврата — на тех входах, которые придут
…
docs/examples/diagnostics/core.flang: НЕ ПРОВЕРЕНО — утверждений 1: доказано 0, условно 0, сетка 0, объявлено, не доказано 1, отвергнуто 0, нарушено 0; законов на сетке 0, на веру 0 — код возврата 3

How to read the result of each guarantee: «доказано» — proved for all inputs; «сетка N» — checked only on your N examples, which is not a proof; «объявлено, не доказано» — declared, with neither a proof nor examples. In CI use flang check --proof --strict: it exits 0 only when everything is proved.

Second trap in the same output: while a FLANG_UNKNOWN_NAME error stands, the function also loses its proved termination, and nothing proves its guarantees. Fix unknown names first.

FLANG_BOUND_ON_NAN: the type число contains NaN, and NaN is not ordered

The most common surprise. The guarantee looks obviously true, and the prover answers with a counterexample.

модуль «Probe»

тотальная функция «Прибавить один»
  принимает н: число
  возвращает число
  обеспечивает «результат больше довода» результат больше н
  н плюс 1
$ flang check docs/examples/diagnostics/nan.flang
модуль «Probe»: функций 1, из них с доказанным завершением 1; типов 0
FLANG_BOUND_ON_NAN в файле docs/examples/diagnostics/nan.flang, строка 6, столбец 3: постусловие «результат больше довода» функции «Прибавить один» ЛОЖНО, и контрпример назван: «н» объявлен типом «число», а «не число» живёт в этом типе и стоит ВНЕ ПОРЯДКА — оно не больше и не меньше ничего, включая самоё себя. Тело собрано только из арифметики над «н», а всякая арифметическая операция «не число» переносит, значит результат есть «не число», и сравнение с ним ложно. Позовите «Прибавить один» от (0 делить на 0) — рантайм ответит FLANG_PROPERTY. Чинится тремя способами: объявить вход отрезком («неотрицательное», «целое») — тогда «не число» не втащить вовсе; поставить предусловие — за него платит вызывающий; либо оговорить границу, и ядро оговорку читает: обеспечьте «не ((н минус н) равен 0) или (…)»
docs/examples/diagnostics/nan.flang: не проверено — замечаний 1
$ echo $?
1

The reason: the type число is a floating-point number and contains NaN («не число»). Every arithmetic operation on NaN gives NaN, and every comparison with NaN is false. So "the result is greater than the argument" is false for NaN.

FixWhat to writeWho pays
narrow the argument typeпринимает н: неотрицательное or целоеnobody: NaN cannot get in
add a preconditionтребует «вход есть число» (н минус н) равен 0the caller
exclude NaN in the guarantee itselfобеспечивает «…» не ((н минус н) равен 0) или (результат больше н)nobody

(н минус н) равен 0 is false exactly when н is NaN.

Parsing

CodeWhat it meansWhat to do
FLANG_LEXthe lexer could not read a token: an unclosed quote, an unexpected characterclose the quote, remove the character
FLANG_PARSEthe tokens are fine, the construct is notlook at the line and column: usually a missing иначе branch, or a keyword used as a name
модуль «Probe»

тотальная функция «Удвоить»
  принимает н: число
  возвращает число
  если н больше 0 то н умножить на 2
$ flang check docs/examples/diagnostics/parse.flang
FLANG_PARSE в файле docs/examples/diagnostics/parse.flang, строка 7, столбец 1: у 'если' нет ветки 'иначе'
docs/examples/diagnostics/parse.flang: не проверено — замечаний 1
$ echo $?
1
$ flang check docs/examples/diagnostics/lex.flang
FLANG_LEX в файле docs/examples/diagnostics/lex.flang, строка 5, столбец 3: не закрыта кавычка
docs/examples/diagnostics/lex.flang: не проверено — замечаний 1
$ echo $?
1

если … то … is an expression, so it always needs иначе.

Names and imports

CodeWhat it meansWhat to do
FLANG_UNKNOWN_NAMEthe name is not defined: no such function or variabledeclare it, import the module, or fix the spelling
FLANG_AMBIGUOUS_NAMEtwo imports bring the same namedrop one import or narrow it with только
FLANG_BAD_NAMEthe name is not written the way names are writtenrename: function names go in guillemets, parameters are plain words
FLANG_NAME_TAKENthe name is used by another declarationpick another name
FLANG_DUPLICATE_NAMEthe same name is declared twice: in one place or in two modules of one program, including a namesake helper of an imported function hidden by an only listremove the second declaration, list the helper in only or rename
FLANG_IMPORT_NOT_FOUNDthe imported module was not foundcheck the module name and the path in из "…"
FLANG_IMPORT_CYCLEmodules import each other in a circlemove the shared part into a third module
FLANG_IMPORT_AMBIGUOUSone name comes from two modulesnarrow the import with только
FLANG_IMPORT_NAMEthe только list names something the module does not declarecompare the list with the module's declarations
модуль «Probe»

тотальная функция «Удвоить»
  принимает н: число
  возвращает число
  «Утроить» от н
$ flang check docs/examples/diagnostics/unknown.flang
модуль «Probe»: функций 1, из них с доказанным завершением 0; типов 0
без доказанного завершения: «Удвоить»
FLANG_UNKNOWN_NAME в файле docs/examples/diagnostics/unknown.flang, строка 6, столбец 3: неизвестная функция «Утроить»
FLANG_NOT_TOTAL в файле docs/examples/diagnostics/unknown.flang, строка 6, столбец 3: тотальная функция «Удвоить» вызывает неизвестную функцию «Утроить»: завершение доказать нельзя
docs/examples/diagnostics/unknown.flang: не проверено — замечаний 2
$ echo $?
1

An unknown name always brings a second error about termination: the compiler cannot prove that a call to an unknown function terminates. Fix the first and the second goes away.

If an operation is written in the wrong order, the compiler says how to write it:

$ flang check docs/examples/diagnostics/operator-order.flang
FLANG_UNKNOWN_NAME в файле docs/examples/diagnostics/operator-order.flang, строка 10, столбец 3: имя «умножить» не связано: имя вводят 'принимает', 'пусть' или образец 'случай'; а действия языка ('плюс', 'минус', 'умножить на', 'делить на', 'остаток от') пишутся МЕЖДУ значениями — «3.14 умножить на р», а не «умножить 3.14 на р»
docs/examples/diagnostics/operator-order.flang: не проверено — замечаний 1
$ echo $?
1

Types

CodeWhat it meansWhat to do
FLANG_TYPEthe declared type differs from what the body or the argument gives; also a function declared twicemake them agree
FLANG_TYPE_ARGSa built-in type was given type arguments; built-in types such as число take noneremove the arguments
FLANG_TYPE_PARAMa type parameter is declared twice, has no name, or is named like a built-in or declared typerename the parameter
FLANG_APPLYthe call does not fit: wrong number of arguments, or the callee is not a functioncompare the call with the signature
FLANG_BUILTIN_ARGSa built-in operation got the wrong number of argumentscheck the operation's description
FLANG_MATCH_NOT_EXHAUSTIVEthe pattern match does not cover every caseadd the missing случай
FLANG_MATCH_UNREACHABLEa case is covered by an earlier one and never runsremove it or move it up
FLANG_EXAMPLEa unit test failed: the value differs from the expected onefix the body or the expected value
$ flang check docs/examples/diagnostics/type.flang
модуль «Probe»: функций 1, из них с доказанным завершением 1; типов 0
FLANG_TYPE в файле docs/examples/diagnostics/type.flang, строка 6, столбец 3: функция «Удвоить» объявлена как число, а тело даёт строка
docs/examples/diagnostics/type.flang: не проверено — замечаний 1
$ echo $?
1
$ flang check docs/examples/diagnostics/duplicate.flang
модуль «Probe»: функций 2, из них с доказанным завершением 2; типов 0
FLANG_TYPE в файле docs/examples/diagnostics/duplicate.flang, строка 8, столбец 1: функция «Удвоить» объявлена дважды
docs/examples/diagnostics/duplicate.flang: не проверено — замечаний 1
$ echo $?
1
$ flang check docs/examples/diagnostics/match.flang
модуль «Probe»: функций 1, из них с доказанным завершением 1; типов 0
FLANG_MATCH_NOT_EXHAUSTIVE в файле docs/examples/diagnostics/match.flang, строка 6, столбец 3: разбор списка не покрывает «пусто»
docs/examples/diagnostics/match.flang: не проверено — замечаний 1
$ echo $?
1
$ flang check docs/examples/diagnostics/example.flang
модуль «Probe»: функций 1, из них с доказанным завершением 1; типов 0
FLANG_EXAMPLE: пример «Двойка» функции «Удвоить»: значение не совпало с ожидаемым: ожидалось 5, получено 4
docs/examples/diagnostics/example.flang: не проверено — замечаний 1
$ echo $?
1

Termination and limits

CodeWhat it meansWhat to do
FLANG_NOT_TOTALthe function is declared тотальная, and its termination is not provedpass a PART of the argument to the recursive call (the tail of a list, a field of a variant), not a recomputed number
FLANG_MEASUREthe declared measure does not decreasefix убывает or the call
FLANG_RECURSION_LIMITevaluation ran out of steps or call depthraise --max-steps / --max-depth, or fix the recursion
FLANG_STEP_LIMITthe step limit ran out inside a unit testthe same --max-steps flag
FLANG_BUDGET_EXHAUSTEDthe step budget of the run ran outraise the budget or make the task smaller
FLANG_MEMORYout of memorymake the data smaller
FLANG_STOPPEDthe run was stopped from outsiderun it again
модуль «Probe»

тотальная функция «Считать»
  принимает н: число
  возвращает число
  если н равно 0 то 0 иначе («Считать» от (н плюс 1))
$ flang check docs/examples/diagnostics/total.flang
модуль «Probe»: функций 1, из них с доказанным завершением 0; типов 0
без доказанного завершения: «Считать»
FLANG_NOT_TOTAL в файле docs/examples/diagnostics/total.flang, строка 6, столбец 30: тотальная функция «Считать»: рекурсивный вызов «Считать» не убывает — аргумент 1 («н» add 1) увеличивает параметр «н». Передавайте часть аргумента: хвост списка из образца «голова и хвост», поле варианта из образца, поле записи или элемент коллекции
docs/examples/diagnostics/total.flang: не проверено — замечаний 1
$ echo $?
1

н плюс 1 grows, so the compiler cannot show that the recursion ends.

To see the step limit, run with a small --max-steps. flang run computes only proved programs; this rec.flang has unproved parts, so --trust is added:

$ flang run docs/examples/diagnostics/recursion.flang --function "Вниз" --args '{"н":100}' --max-steps 5 --trust
на веру: доказанность не считалась — запуск по ключу --trust
FLANG_RECURSION_LIMIT: функция «Вниз» исчерпала лимит шагов (5) на глубине вызовов 1
$ echo $?
1

Guarantees and proofs

Preconditions (требует), guarantees (обеспечивает) and theorems.

CodeWhat it meansWhat to do
FLANG_PROPERTYa guarantee was violated at run timeeither the guarantee or the body is wrong — look at the input it failed on
FLANG_PRECONDITIONthe precondition is written wrongcheck the form требует «имя» <условие>
FLANG_PRECONDITION_CALLthe caller does not ensure the callee's preconditionprove the condition at the call site, or narrow the argument type
FLANG_BOUND_ON_NANan order guarantee is false because of NaNsee the third trap above
FLANG_PROOF_NO_GOALthe theorem proves nothing: no guarantee has that namename the theorem exactly like the guarantee
FLANG_PROOF_AMBIGUOUSthe theorem would prove two guarantees at oncegive the guarantees different names
FLANG_PROOF_CLAIM_MISMATCHутверждаем differs from the guaranteecopy the guarantee text word for word
FLANG_PROOF_DUPLICATEtwo theorems prove the same guaranteekeep one
FLANG_PROOF_STEPa step has no justification, or there are no steps at alladd по свойству «…», по примеру «…» or по предположению
FLANG_PROOF_UNFINISHEDthe proof does not endadd следовательно доказано
FLANG_PROOF_UNKNOWN_VARthe claim uses an undeclared namedeclare it with дано
FLANG_PROOF_VAR_TYPEa theorem variable has a different type than the parametermake дано match the function signature
FLANG_PROOF_INDUCTION_TYPEinduction over this type is not possibleinduction goes over a type with variants or over неотрицательное
FLANG_PROOF_INDUCTION_CASESnot every case of the induction is coveredadd the missing случай
FLANG_PROOF_INDUCTION_BRANCHa case does not reach the goaljustify that case
FLANG_PROOF_INDUCTION_STEPthe induction step does not reach the hypothesisadd по предположению and make both sides match exactly
FLANG_PROOF_INDUCTION_DESCENTthe induction step is not exactly one downmake the step exactly one down
FLANG_INITIAL_FAILUREno induction rule could be built for the typecheck that the type is declared with variants
FLANG_UNCOVERED_FAILUREan error case is not handled by the pattern matchadd a case for the error
модуль «Probe»

тотальная функция «Удвоить»
  принимает н: число
  возвращает число
  обеспечивает «удвоенное неотрицательно» если н не меньше 0 то (результат не меньше 0) иначе да
  н умножить на 2

теорема «удвоенное неотрицательно»
  дано н: число
  утверждаем если н не меньше 0 то (результат не меньше 0) иначе да
  следовательно доказано
$ flang check docs/examples/diagnostics/no-steps.flang
модуль «Probe»: функций 1, из них с доказанным завершением 1; типов 0
FLANG_PROOF_STEP: теорема «удвоенное неотрицательно»: ни одного шага
docs/examples/diagnostics/no-steps.flang: не проверено — замечаний 1
$ echo $?
1
$ flang check docs/examples/diagnostics/no-goal.flang
модуль «Probe»: функций 1, из них с доказанным завершением 1; типов 0
FLANG_PROOF_NO_GOAL в файле docs/examples/diagnostics/no-goal.flang, строка 8, столбец 1: теорема «удвоенное неотрицательно» ничего не закрывает: постусловия «удвоенное неотрицательно» нет ни у одной функции модуля. Теорема доказывает названное утверждение, а не утверждение вообще — назовите её так же, как постусловие, которое она закрывает
docs/examples/diagnostics/no-goal.flang: не проверено — замечаний 1
$ echo $?
1
$ flang check docs/examples/diagnostics/ambiguous.flang
модуль «Probe»: функций 2, из них с доказанным завершением 2; типов 0
FLANG_PROOF_AMBIGUOUS в файле docs/examples/diagnostics/ambiguous.flang, строка 15, столбец 1: теорема «неотрицательно» закрывала бы сразу 2 постусловия («Удвоить», «Утроить»), и выбрать нельзя. Дайте постусловиям разные имена
docs/examples/diagnostics/ambiguous.flang: не проверено — замечаний 1
$ echo $?
1
$ flang check docs/examples/diagnostics/mismatch.flang
модуль «Probe»: функций 1, из них с доказанным завершением 1; типов 0
FLANG_PROOF_CLAIM_MISMATCH в файле docs/examples/diagnostics/mismatch.flang, строка 11, столбец 3: теорема «неотрицательно» утверждает не то, что обещает функция «Удвоить»: утверждение теоремы и постусловие обязаны совпадать слово в слово. Ядро не решает, что два разных утверждения означают одно и то же
docs/examples/diagnostics/mismatch.flang: не проверено — замечаний 1
$ echo $?
1

A guarantee the prover could not prove is checked at run time. flang run refuses unproved programs, so --trust is needed to see it:

$ flang run docs/examples/diagnostics/property.flang --function "Половина" --args '{"н":0}' --trust
на веру: доказанность не считалась — запуск по ключу --trust
FLANG_PROPERTY: нарушено свойство «результат меньше довода» функции «Половина»
$ echo $?
1

Laws of declared structures

These laws are CHECKED on a finite set of values you provide, not proved. An error means a violation was found, so there is always a counterexample.

CodeWhich law is broken
FLANG_EQUALITY_NOT_REFLEXIVEthe declared equality is not reflexive
FLANG_EQUALITY_NOT_SYMMETRICnot symmetric
FLANG_EQUALITY_NOT_TRANSITIVEnot transitive
FLANG_EQUALITY_NOT_CONGRUENTcomposition does not respect the equality
FLANG_ORDER_NOT_REFLEXIVEthe order is not reflexive
FLANG_ORDER_NOT_ANTISYMMETRICnot antisymmetric
FLANG_ORDER_NOT_TRANSITIVEnot transitive
FLANG_CATEGORY_NOT_CLOSEDthe category is not closed under composition
FLANG_CATEGORY_NO_IDENTITYan object has no identity
FLANG_CATEGORY_NOT_ASSOCcomposition is not associative
FLANG_COMPOSE_MISMATCHthe ends of a composition do not meet
FLANG_MORPHISM_SHAPEthe morphism is declared wrong
FLANG_FUNCTOR_SQUAREthe functor square does not commute
FLANG_TRANSFORM_NOT_NATURALthe naturality square does not commute
FLANG_BIFUNCTOR_OBJECT_TWICEthe bifunctor maps one pair of objects twice
FLANG_BIFUNCTOR_OBJECT_MISSINGa pair of arrows is mapped, but the pair of their ends has no image
FLANG_BIFUNCTOR_ARROW_MISMATCHthe image of a pair of arrows is undeclared or goes between the wrong objects
FLANG_BIFUNCTOR_IDENTITYa pair of identities is mapped to an arrow that is not an identity
FLANG_BIFUNCTOR_COMPOSITIONa pair of composites is mapped to an arrow that is not the composite of the images
FLANG_ISO_NOT_INVERSEthe two arrows are not inverse to each other
FLANG_EMBED_SHAPEthe embedding is declared wrong
FLANG_EMBED_NOT_INJECTIVEthe embedding maps different values to the same one
FLANG_MONOIDthe monoid declaration is incomplete
FLANG_MONOID_ASSOCthe monoid operation is not associative
FLANG_MONOID_IDENTITYthe identity element is not an identity
FLANG_GROUP_INVERSEthe inverse is not an inverse
FLANG_MONADthe monad declaration is incomplete
FLANG_MONAD_ASSOCbind is not associative
FLANG_MONAD_LEFT_UNITthe left unit law fails
FLANG_MONAD_RIGHT_UNITthe right unit law fails
FLANG_NOT_COMMUTATIVEthe declared commutativity does not hold
FLANG_NOT_DISTRIBUTIVEdistributivity does not hold
FLANG_NOT_IDEMPOTENTidempotence does not hold
FLANG_NOT_MONOTONEmonotonicity does not hold
FLANG_MEET_NAME_TAKENthe set name is already taken
FLANG_MEET_NO_UNIVERSEthe declared sets have no common carrier
FLANG_MEET_SAME_SIDEa set is intersected with itself
FLANG_MEET_TWICEthe same pair is declared twice

Plans and input/output

Errors from flang io. A plan returns a command as data, and the runtime executes it; FLANG_IO_* codes are the runtime's refusals, which the plan receives as a response.

CodeWhat it meansWhat to do
FLANG_PLANthe plan is declared wrongcheck the план declaration
FLANG_UNKNOWN_PLANthe file has no plan with that namename an existing one: --plan 'Имя', without guillemets
FLANG_PLAN_UNSUPPORTEDthe target language cannot generate plansgenerate for another target, or run with flang io
FLANG_IO_DENIEDthe permission was taken away by a flag (--no-read, --no-write, --no-net and the others)remove the flag
FLANG_IO_NO_HOSTthere is no runtime to execute the commandrun with flang io, not by computing a function
FLANG_IO_NOT_TEXTa text read found bytes that are not textread bytes instead
FLANG_IO_TIMEOUTa started process was silent longer than --timeoutraise --timeout
FLANG_LOCKthe lock file is damaged or its checksum does not matchrebuild it with flang lock
FLANG_PACKAGEthe package is damaged or has no flang.packagerebuild it with flang package

Permissions are taken away one at a time; by default everything is allowed:

flang io план.flang --plan 'Разбор' --no-net --in-dir

Processes

CodeWhat it meansWhat to do
FLANG_PROCESSthe process is declared wrongcheck the declaration
FLANG_PROCESS_ACCEPTSa process received a message it does not acceptadd the message kind to принимает
FLANG_PROCESS_LIMITthe limit on the number of processes was hitraise the limit or start fewer
FLANG_MAILBOX_FULLthe mailbox is full: the reader is behindread more often or slow the sender down
FLANG_LINK_DOWNthe link to a node or a process is brokenhandle the break in the supervisor
FLANG_HOTSWAP_REFUSEDa hot code reload was refusedmake the new code compatible with the old declarations

Command line and internal errors

CodeWhat it meansWhat to do
FLANG_CLIbad call: unknown flag or missing argumentflang <command> --help
FLANG_INTERNALthe compiler itself failedreport it: this is a bug in the tool, not in your program
FLANG_SELF_REPL_UNSUPPORTEDthe shell does not accept this construct, использует for exampleput the code in a file and run flang check
FLANG_FACTCHECK_НЕТ_ОТВЕТАflang facts got no value for a calladd the value to the facts
$ flang check --неткого
flang check: непонятный ключ «--неткого»
$ echo $?
2

The exit code is 2.

Every code of the compiler

The table is collected from the compiler's sources: a code is listed while at least one line of the compiler's sources in flang/self/ or of its runtime bootstrap/flang_*.c raises it outside examples and postconditions. The message is the English template of the message catalog flang/messages/catalog.tsv; a dash means the catalog has no template for the code and the text is put together where it is raised. A code named on this page and not found in the sources fails docs:check.

CodeWhere in the compilerMessage
FLANG_AMBIGUOUS_NAMEparser.flang—
FLANG_APPLYinterpret.flang, types.flang—
FLANG_BAD_NAMEconc.flang, failures.flang—
FLANG_BIFUNCTOR_ARROW_MISMATCHcompiler.flang—
FLANG_BIFUNCTOR_COMPOSITIONcompiler.flang—
FLANG_BIFUNCTOR_IDENTITYcompiler.flang—
FLANG_BIFUNCTOR_OBJECT_MISSINGcompiler.flang—
FLANG_BIFUNCTOR_OBJECT_TWICEcompiler.flang—
FLANG_BINflang_repl.c—
FLANG_BOUND_ON_NANobligations.flangpostcondition «{claim}» of function «{function}» is FALSE, and a counterexample is named: {reason}
FLANG_BUDGET_EXHAUSTEDconc.flang, failures.flang—
FLANG_BUILTIN_ARGSbuiltins.flang, failures.flang, interpret.flang, types.flang—
FLANG_CATEGORY_ARROW_TWICEcompiler.flang—
FLANG_CATEGORY_EQUALITY_OUTSIDEcompiler.flang—
FLANG_CATEGORY_EQUALITY_SHAPEcompiler.flang—
FLANG_CATEGORY_EQUALITY_TWICEcompiler.flang—
FLANG_CATEGORY_NOT_ASSOCsetoid.flang—
FLANG_CATEGORY_NOT_CLOSEDcompiler.flang—
FLANG_CATEGORY_NO_IDENTITYcompiler.flang—
FLANG_CATEGORY_UNKNOWN_ARROWcompiler.flang—
FLANG_CCflang_repl.c—
FLANG_CHECKERflang_repl.c—
FLANG_CLIflang_repl.c, cli.flang, repl.flang—
FLANG_COMPOSE_MISMATCHcompiler.flang—
FLANG_DUPLICATE_NAMEflang_repl.c, link.flang, sets.flangin file {file}: function «{name}» is declared in two modules: {first} and {second} · function «{name}» is declared in two modules: {first} and {second} · in file {file}: type «{name}» is declared in two modules: {first} and {second} · type «{name}» is declared in two modules: {first} and {second}
FLANG_EMBED_NOT_INJECTIVEsets.flang—
FLANG_EMBED_SHAPEsets.flang—
FLANG_EQUALITY_NOT_CONGRUENTsetoid.flang—
FLANG_EQUALITY_NOT_REFLEXIVEsetoid.flang—
FLANG_EQUALITY_NOT_SYMMETRICsetoid.flang—
FLANG_EQUALITY_NOT_TRANSITIVEsetoid.flang—
FLANG_EXAMPLEcompiler.flangexample «{example}» of function «{function}»: the value does not match the expected one: expected {wanted}, got {got}
FLANG_FACTCHECK_НЕТ_ОТВЕТАfactcheck.flang—
FLANG_FSPEC_TEMPLATE_DIRflang_repl.c—
FLANG_FUNCTOR_SQUAREfunctor.flang—
FLANG_GROUP_INVERSEmonoid.flang—
FLANG_HANDLER_NOT_TOTALprocesses.flang—
FLANG_HISTORYflang_repl.c—
FLANG_HOTSWAP_REFUSEDhotswap.flang—
FLANG_IMPORT_AMBIGUOUSflang_repl.c, link.flang—
FLANG_IMPORT_CYCLEflang_repl.c, link.flang—
FLANG_IMPORT_NAMEflang_repl.c, link.flang—
FLANG_IMPORT_NOT_FOUNDflang_repl.c, link.flang—
FLANG_INCLUDE_DIRflang_repl.c—
FLANG_INITIAL_FAILUREfailures.flang, processes.flang—
FLANG_INTERNALflang_repl.c, conc.flang, lsp.flang—
FLANG_IOflang_cli.c, flang_repl.c, compiler.flang—
FLANG_IO_DENIEDflang_repl.c—
FLANG_IO_ENTROPYflang_repl.c—
FLANG_IO_ENVflang_cli.c, flang_repl.c—
FLANG_IO_FAILEDflang_cli.c, flang_repl.c—
FLANG_IO_LIMITflang_cli.c, flang_repl.c—
FLANG_IO_LISTflang_cli.c, flang_repl.c—
FLANG_IO_NETflang_repl.c—
FLANG_IO_NOT_CHECKEDflang_cli.c, flang_repl.c—
FLANG_IO_NOT_TEXTflang_cli.c, flang_repl.c—
FLANG_IO_NOT_WIREDflang_cli.c—
FLANG_IO_NO_HOSTconc.flang—
FLANG_IO_NO_SCREENflang_cli.c, flang_repl.c—
FLANG_IO_NO_TLSflang_repl.c—
FLANG_IO_OCTETSflang_cli.c, flang_repl.c—
FLANG_IO_ORDERemit-from-source.flang—
FLANG_IO_PATHflang_cli.c, flang_repl.c—
FLANG_IO_PLACEflang_repl.c—
FLANG_IO_READflang_cli.c, flang_repl.c—
FLANG_IO_REMOVEflang_cli.c, flang_repl.c—
FLANG_IO_SPAWNflang_repl.c—
FLANG_IO_TEMPDIRflang_cli.c, flang_repl.c—
FLANG_IO_TIMEOUTflang_repl.c—
FLANG_IO_TLSflang_repl.c—
FLANG_IO_TLS_CERTflang_repl.c—
FLANG_IO_UNKNOWNflang_repl.c—
FLANG_IO_WRITEflang_cli.c, flang_repl.c—
FLANG_ISO_NOT_INVERSEiso.flang—
FLANG_KERNEL_STAGESflang_repl.c—
FLANG_LANGflang_repl.c—
FLANG_LEXlexer.flang—
FLANG_LIB_DIRflang_repl.c—
FLANG_LINK_DOWNfailures.flang—
FLANG_LOCKflang_repl.c—
FLANG_MAILBOX_FULLconc.flang, failures.flang—
FLANG_MATCH_NOT_EXHAUSTIVEinterpret.flang, types.flangthe match on {subject} does not cover {cases} · a match without cases covers nothing
FLANG_MATCH_UNREACHABLEtypes.flang—
FLANG_MEASUREdefunc.flang, failures.flang—
FLANG_MEET_NAME_TAKENsets.flang—
FLANG_MEET_NO_UNIVERSEsets.flang—
FLANG_MEET_SAME_SIDEsets.flang—
FLANG_MEET_TWICEsets.flang—
FLANG_MEMOflang_runtime.c—
FLANG_MEMORYflang_cli.c, flang_repl.c—
FLANG_MEMO_AUDITflang_runtime.c—
FLANG_MEMO_BYTESflang_runtime.c—
FLANG_MEMO_STATSflang_runtime.c—
FLANG_MESSAGE_DIRflang_repl.c—
FLANG_MODULE_DIRflang_repl.c—
FLANG_MODULE_ROOTflang_repl.c—
FLANG_MONADmonad-expand.flang, monad.flang—
FLANG_MONAD_ASSOCmonad.flang—
FLANG_MONAD_LEFT_UNITmonad.flang—
FLANG_MONAD_RIGHT_UNITmonad.flang—
FLANG_MONOIDmonoid.flang—
FLANG_MONOID_ASSOCmonoid.flang—
FLANG_MONOID_IDENTITYmonoid.flang—
FLANG_MORPHISM_SHAPEcompiler.flang—
FLANG_NAME_TAKENconc.flang, failures.flang—
FLANG_NEWflang_repl.c—
FLANG_NOT_COMMUTATIVEcommutative.flang—
FLANG_NOT_DISTRIBUTIVEdistributive.flang—
FLANG_NOT_IDEMPOTENTidempotent.flang—
FLANG_NOT_MONOTONEmonotone.flang—
FLANG_NOT_TOTALtotality.flangtotal function «{function}» calls an unknown function «{callee}»: termination cannot be proved · total function «{function}»: the recursive call «{callee}» does not decrease — argument {position} ({argument}) increases parameter «{parameter}». Pass a part of the argument: the tail of a list from the pattern «голова и хвост», a variant field from a pattern, a record field or an element of a collection
FLANG_ORDER_NOT_ANTISYMMETRICpartialorder.flang—
FLANG_ORDER_NOT_REFLEXIVEpartialorder.flang—
FLANG_ORDER_NOT_TRANSITIVEpartialorder.flang—
FLANG_PACKAGEflang_repl.c—
FLANG_PARSEinterpret.flang, parser.flang'если' has no 'иначе' branch · construct not parsed: unexpected '{word}' — this word is taken by the language and cannot be a name: write the name in guillemets («{word.quoted}») or rename it; and if the word got into the form by mistake, remove it
FLANG_PECHAT_BEDYemit-from-source.flang—
FLANG_PECHAT_OTKAZemit-from-source.flang—
FLANG_PLANio.flang—
FLANG_PLAN_UNSUPPORTEDcompiler.flang—
FLANG_PRECONDITIONemit-c.flang, emit-csharp.flang, emit-elixir.flang, emit-java.flang, emit-js.flang, emit-python.flang, parser.flang—
FLANG_PRECONDITION_CALLproofterm.flangthe call of «{callee}» in function «{function}» does not discharge precondition «{precondition}»: {reason}
FLANG_PROCESSconc.flang, processes.flang—
FLANG_PROCESS_ACCEPTSconc.flang, failures.flang, processes.flang—
FLANG_PROCESS_LIMITconc.flang, failures.flang—
FLANG_PROOF_AMBIGUOUSobligations.flang—
FLANG_PROOF_CACHEflang_repl.c—
FLANG_PROOF_CACHE_AUDITflang_repl.c—
FLANG_PROOF_CACHE_KEYflang_repl.c—
FLANG_PROOF_CACHE_RECHECKflang_repl.c—
FLANG_PROOF_CACHE_STATSflang_repl.c—
FLANG_PROOF_CHECKERflang_repl.c—
FLANG_PROOF_CLAIM_MISMATCHobligations.flang, proofterm.flang—
FLANG_PROOF_DUPLICATEobligations.flang—
FLANG_PROOF_INDUCTION_BRANCHproofterm.flangstep {step}, inductive case «{case}» of theorem «{theorem}»: {reason} · step {step}, base case «{case}» of theorem «{theorem}»: {reason}
FLANG_PROOF_INDUCTION_CASESproofterm.flang—
FLANG_PROOF_INDUCTION_DESCENTproofterm.flang—
FLANG_PROOF_INDUCTION_STEPproofterm.flangstep {step}, inductive case «{case}» of theorem «{theorem}»: {reason} · step {step}, base case «{case}» of theorem «{theorem}»: {reason}
FLANG_PROOF_INDUCTION_TYPEproofterm.flang—
FLANG_PROOF_NO_GOALobligations.flang—
FLANG_PROOF_STEPproofterm.flangstep {step}, theorem «{theorem}»: {reason}
FLANG_PROOF_UNFINISHEDobligations.flang—
FLANG_PROOF_UNKNOWN_VARobligations.flang, parser.flang, types.flang—
FLANG_PROOF_VAR_TYPEobligations.flang—
FLANG_PROPERTYemit-c.flang, emit-csharp.flang, emit-elixir.flang, emit-java.flang, emit-js.flang, emit-python.flang, grid.flang, interpret.flang, parser.flangproperty «{claim}» of function «{function}» is violated
FLANG_PULSEflang_runtime.c—
FLANG_PULSE_TICKflang_runtime.c—
FLANG_RECURSION_LIMITconc.flang, factcheck.flang, failures.flang, interpret.flang—
FLANG_RUNTIME_DIRflang_repl.c—
FLANG_SELF_REPL_UNSUPPORTEDrepl.flang—
FLANG_STEP_LIMITfactcheck.flang—
FLANG_STOPPEDconc.flang, failures.flang—
FLANG_THREADSflang_runtime.c—
FLANG_TICKS_OUTflang_runtime.c—
FLANG_TIME_OUTflang_runtime.c—
FLANG_TLS_CHAINflang_repl.c—
FLANG_TLS_ENGINEflang_repl.c—
FLANG_TLS_EXPIREDflang_repl.c—
FLANG_TLS_NAMEflang_repl.c—
FLANG_TLS_SIGNATUREflang_repl.c—
FLANG_TMPflang_repl.c—
FLANG_TRANSFORM_COMPONENTcompiler.flang—
FLANG_TRANSFORM_NOT_NATURALsetoid.flang—
FLANG_TRANSFORM_NOT_TOTALcompiler.flang—
FLANG_TRANSFORM_SHAPEcompiler.flang—
FLANG_TYPEflang_cli.c, interpret.flang, types.flang{where} is declared to return {type.declared}, but its body gives {type.body} · {where} is declared twice · {where} has no body · argument «{parameter}» of function «{function}»: expected {type.wanted}, got {type.got} · {side} operand of «{operation}»: expected {type.wanted}, got {type.got} · the condition of «если» must be a flag, not {type} · the branches of «если» have different types: {type.then} and {type.else} · record «{record}» has no field «{field}» · record «{record}» requires field «{field}» ({type}) · field «{field}» is declared twice · function «{function}» takes {count} argument(s) ({parameters}), but is called with {given} · call of function «{function}»: argument «{parameter}»: {value} is outside {type} · {label} of function «{function}» does not give argument «{parameter}» · {label}: {value} is outside {type} · {label} does not match type {type}
FLANG_TYPE_ARGStypes.flang—
FLANG_TYPE_PARAMtypes.flang—
FLANG_UNCOVERED_FAILUREfailures.flang, processes.flang—
FLANG_UNKNOWNflang_cli.c—
FLANG_UNKNOWN_NAMEflang_repl.c, builtins.flang, conc.flang, interpret.flang, link.flang, parser.flang, sets.flang, types.flangunknown function «{name}» · unknown type «{name}» · unknown record «{name}» · unknown variant «{name}» · unknown variant constructor «{name}» · function «{name}» is not found · the record has no field «{field}» · name «{name}» is not bound · name «{name}» is not bound: a name is introduced by 'принимает', 'пусть' or a 'случай' pattern; and the operations of the language ('плюс', 'минус', 'умножить на', 'делить на', 'остаток от') go BETWEEN values — «3.14 умножить на р», not «умножить 3.14 на р»
FLANG_UNKNOWN_PLANflang_cli.c, compiler.flang—
FLANG_UNKNOWN_PROCESSprocesses.flang—
FLANG_UNPROVEDcompiler.flang—
FLANG_UNPROVENflang_repl.c—
FLANG_VITKIflang_repl.c—
FLANG_WATCHflang_runtime.c—
FLANG_WATCH_TICKflang_runtime.c—
FLANG_ZAKAZemit-from-source.flang—

Next: The prover refused: whose mistake is it — how to read a refused proof, and when the mistake is not yours.