Debugging
Warning
The following page contains information that is mostly of interest to developers of Agda, or those who would like to get a deeper understanding of the implementation of Agda.
Verbose mode
If Agda was installed with the debug Cabal flag (e.g. using cabal install
Agda -fdebug), it can print internal information by setting the
--verbose={N} flag (or -v {N}) with a verbosity tag and a
verbosity level in form tag:level. For example, running Agda with
--verbose=tc.term:30 turns on debug printing for the verbosity key
tc.term at verbosity level 30. Verbosity levels range between 0 and 100.
Activating a verbosity key will also enable all the verbosity keys that are nested under it, for example
-v tc:30will also print debugging information with keytc.term.The higher the verbosity level, the more detailed debugging information will be printed, for example
-v tc.term:50will include debugging information at verbosity level 30.
By convention, very gory details will be printed only with verbosity of at least 50, so it is advisable in most cases to keep the level below 50.
Verbosity tags and levels can be found by inspecting the source code of Agda by
searching for calls to reportSLn and reportSDoc. Below are a few common
debug flags that might be useful for developers:
import: import statementsinteraction: interactive commandsinteraction.case: case splittinginteraction.evalinteraction.giveinteraction.helperinteraction.introinteraction.refine
mimer: automatic proof searchrewriting: rewrite rulesscope: scope checkingtc: type checkingtc.abstract: abstract definitionstc.cc: compiling clauses to a case treetc.conv: conversion checkingtc.constr: constraint solvingtc.cover: coverage checkingtc.data: data typestc.def: function definitionstc.generalize: variable generalizationtc.instance: instance argumentstc.irr: irrelevancetc.lhs: left-hand sides of function clausestc.meta: metavariablestc.mod: modules and module parameterstc.term: type checking of termstc.opaque: opaque definitionstc.pos: positivity analysistc.reduce: evaluation of terms and typestc.size: sized typestc.sort: checking sortstc.with: with abstraction
term: termination checkingwarning: warnings