Home

Awesome

<!--- This file was generated from `meta.yml`, please do not edit manually. Follow the instructions on https://github.com/coq-community/templates to regenerate. --->

ATBR

Docker CI Contributing Code of Conduct Zulip coqdoc DOI

This library provides algebraic tools for working with binary relations. The main tactic provided is a reflexive tactic for solving (in)equations in an arbitrary Kleene algebra. The decision procedure goes through standard finite automata constructions.

Note that the initial authors consider this library to be superseded by the Relation Algebra library, which is based on derivatives rather than automata: https://github.com/damien-pous/relation-algebra

Meta

Building and installation instructions

The easiest way to install the latest released version of ATBR is via OPAM:

opam repo add coq-released https://coq.inria.fr/opam/released
opam install coq-atbr

To instead build and install manually, do:

git clone https://github.com/coq-community/atbr.git
cd atbr
make   # or make -j <number-of-cores-on-your-machine> 
make install

Documentation

The development and underlying theory of the library is described in the paper Deciding Kleene Algebras in Coq, Logical Methods in Computer Science, Volume 8, Issue 1, 2012.

Below are succinct descriptions of each file and tactic. See also the coqdoc presentation of the Coq source files from the latest release.

Library files

FilenameDescription
ATBRExport all relevant modules, except those related to matrices
ATBR_MatricesExport all relevant modules, including those related to matrices

Algebraic hierarchy

FilenameDescription
ClassesDefinitions of algebraic classes of the development
GraphLemmas and hints about the base class (carrier with equality)
MonoidMonoids, free monoids, finite iterations over a monoid, various tactics
SemiLatticeSemilattices, tactics: normalise, reflexivity, rewrite
SemiRingIdempotent semirings, tactics: normalise, reflexivity, rewrite
KleeneAlgebraKleene algebras, basic properties
ConverseStructures with converse (semirings and Kleene Algebras)
FunctorsFunctors between the various algebraic structures
StrictKleeneAlgebraClass of Strict Kleene algebras (without 0), and extension of the decision procedure

Models

FilenameDescription
Model_RelationsKleene Algebra of (heterogeneous) binary relations
Model_StdRelationsKleene Algebra of standard (homogeneous) binary relations
Model_LanguagesKleene Algebra of languages
Model_RegExpKleene Algebra of regular expressions (syntactic free model), typed reification
Model_MinMax(min,+) Kleene Algebra (matrices on this algebra give weighted graphs)

Matrices

FilenameDescription
MxGraphMatrices without operations; blocks definitions
MxSemiLatticeSemilattices of matrices
MxSemiRingSemiring of matrices
MxKleeneAlgebraKleene algebra of matrices (definition of the star operation)
MxFunctorsExtension of functors to matrices

Decision procedure for KA

FilenameDescription
DKA_DefinitionsBase definitions for the decision procedure for KA (automata types, notations, ...)
DKA_StateSetSetsProperties about sets of sets
DKA_CheckLabelsAlgorithm to check whether two regex have the same set of labels
DKA_ConstructionConstruction algorithm, and proof of correctness
DKA_EpsilonRemoval of epsilon transitions, proof of correctness
DKA_DeterminisationDeterminisation algorithm, proof of correctness
DKA_MergeUnion of DFAs, proof of correctness
DKA_DFA_LanguageLanguage recognised by a DFA, equivalence with the evaluation of the DFA
DKA_DFA_EquivEquivalence check for DFAs, proof of correctness
DecideKleeneAlgebraKozen's initiality proof, kleene_reflexivity tactic

Other tools

FilenameDescription
StrictStarFormConversion of regular expressions into strict star form, kleene_ssf tactic
EquivalenceTactic for solving equivalences by transitivity

Examples

FilenameDescription
ExamplesSmall tutorial file, that goes through our set of tactics
ChurchRosserSimple usages of kleene_reflexivity to prove commutation properties
ChurchRosser_PointsComparison between a standard CR proof and algebraic ones

Misc.

FilenameDescription
CommonShared simple tactics and definitions
BoolViewView mechanism for Boolean computations
NumbersNUM interface, to abstract over the representation of numbers, sets, and maps
Utils_WFUtilities about well-founded relations; partial fixpoint operators (powerfix)
DisjointSetsEfficient implementation of a disjoint sets data structure
ForceFunctional memoisation (in case one needs efficient matrix computations)
ReificationReified syntax for the various algebraic structures

Finite sets and maps

FilenameDescription
MyFSetsEfficient ordered datatypes constructions (for FSets functors)
MyFSetPropertiesHandler for FSet properties
MyFMapPropertiesHandler for FMap properties

OCaml modules

FilenameDescription
reification.mlreification for the reflexive tactics

Tactics

Reflexive tactics

TacticDescription
semiring_reflexivitysolve an (in)equation on the idempotent semiring (*,+,1,0)
semiring_normalizesimplify an (in)equation on the idempotent semiring (*,+,1,0)
semiring_cleansimplify 0 and 1
semiring_cleanassocsimplify 0 and 1, normalize the parentheses
kleene_reflexivitysolve an (in)equation in Kleene Algebras
ckleene_reflexivitysolve an (in)equation in Kleene Algebras with converse
skleene_reflexivitysolve an (in)equation in Strict Kleene Algebras (without 0)
kleene_clean_zeroremove zeros in a KA expression
kleene_ssfput KA expressions into strict star form

Rewriting tactics

TacticDescription
ac_rewrite Hrewrite a closed equality modulo (AC) of (+)
monoid_rewrite Hrewrite a closed equality modulo (A) of (*)

Other tactics

TacticDescription
converse_downpush converses down to terms leaves
switchadd converses to the goal and push them down to terms leaves

Acknowledgements

The initial authors would like to thank Guilhem Moulin and Sebastien Briais, who participated to a preliminary version of this project. They are also grateful to Assia Mahboubi, Matthieu Sozeau, Bruno Barras, and Hugo Herbelin for highly stimulating discussions, as well as numerous hints for solving various problems.