Package: rewalt
rewalt(archaic)to overturn, throw downa library forrewriting,algebra, andtopology, developed in Tallinn (akaReval)Aboutrewaltis a toolkit forhigher-dimensional diagram rewriting, with applications inhigherandmonoidal category theory,homotopical algebra,combinatorial topology,and more. Thanks to its visualisation features, it can also be used as a structure-awarestring diagrameditor, supportingTikZoutput so the string diagrams can be directly embedded in your LaTeX files.It implementsdiagrammatic sets, which, by the "higher-dimensional rewriting" paradigm, double as a model ofhigher-dimensional rewrite systems, and ofdirected cell complexes.This model is "topologically sound": a diagrammatic set built inrewaltpresents a finite CW complex, and a diagram constructed in the diagrammatic set presents a valid homotopy in this CW complex.A diagrammatic set can be seen as a generalisation of asimplicial setor of acubical setwith many more "cell shapes". As a result,rewaltalso contains afull implementationof finitely presentedsimplicial setsandcubical sets with connections.Getting startedrewaltis available for Python 3.7 and higher. You can install it with the commandpipinstallrewaltThen you should take a look at thedocumentation, which includes several worked examples from category theory, algebra, and homotopy theory.UsageThedocs/notebooks/folder contains several worked examples in the form of Jupyter notebooks.For example, this is how you create a single-sorted algebraic signature with one binary operation $m$ and one constant $u$, then represent the term $m(u, -)$ as a string diagram oriented bottom-to-top.fromrewaltimportDiagSetX=DiagSet()pt=X.add('pt',draw_label=False)a=X.add('a',pt,pt,draw_label=False)# the sortm=X.add('m',a.paste(a),a)# binary operationu=X.add('u',pt.unit(),a)# constantm.to_inputs(0,u).draw()This is how you construct a 3-dimensional diagram shape as an "oriented cylinder" whose bases are 2-simplices, then output itsoriented face posetin the form of a Hasse diagram withmagentaedges forinputfaces, andblueedges foroutputfaces.fromrewaltimportShapetwosimplex=Shape.simplex(2)arrow=Shape.arrow()cylinder=arrow*twosimplex# Gray product of arrow and 2-simplexcylinder.hasse(labels=False)TestingYou can run all tests with the commandpytestDocumentationThe latest documentation is hosted onRead the Docs.If you want to build a local copy of the documentation, first install the required dependencies:pipinstall-rdocs/requirements.txtThen runcddocs/
makeclean
makehtmlYou will then find the documentation underdocs/_build/.Further readingFor a first introduction to the ideas of higher-dimensional rewriting, diagrammatic sets, and "topological soundness", you may want to watch these presentations at theCIRM meeting onHigher Structuresand at theGETCO 2022 conference.A nice overview of the general landscape of higher-dimensional rewriting is Yves Guiraud'smémoire d'habilitation.So far there are two papers on the theory of diagrammatic sets:the first onecontaining the foundations,the second onecontaining some developments applied to categorical universal algebra.A description and complexity analysis of some of the data structures and algorithms behindrewaltwill be published in theproceedings of ACT 2022.Licenserewaltis distributed under the BSD 3-clause license; seeLICENSE.ContributingCurrently, the only active developer ofrewaltisAmar Hadzihasanovic.Contributions are welcome. Please reach out either by sending me an email, or byopening an issue.