Wednesday, January 1, 2025

troubleshooting docker and podman on MacAirbook M2

I have an old MacBook Air running 

  • macOS Catalina v10.15.7 with a 1.8GHz Intel Core i5 and 4GB of RAM
  • `docker compose version` = 2.2.1
  • `docker --version` = 20.10.11

I have a new MacBook Air running 

  • macOS Sonoma v14.6.1 with an Apple M2 and 8GB of RAM

Podman on the new MacBook M2

Downloaded 
Confusingly, 1.15.0 provides Podman 4.9.0 (?)


As per https://stackoverflow.com/a/76488304 I tried
% podman machine stop; podman machine start

Waiting for VM to exit...
Machine "podman-machine-default" stopped successfully
Starting machine "podman-machine-default"
Waiting for VM ...
Mounting volume... /Users:/Users
chattr: Operation not supported while reading flags on /
mkdir: cannot create directory ‘/Users’: Read-only file system
chattr: Operation not supported while reading flags on /
Error: exit status 1

I then tried
% podman machine stop
Waiting for VM to exit...
Machine "podman-machine-default" stopped successfully

% podman machine rm
The following files will be deleted:
...
Are you sure you want to continue? [y/N] y

% podman machine init                                         
Extracting compressed file: podman-machine-default_fedora-coreos-41.20241215.2.0-qemu.aarch64.qcow2: done  
Image resized.
Machine init complete
To start your machine run:
	podman machine start
    
% podman machine start
Starting machine "podman-machine-default"
Waiting for VM ...
Mounting volume... /Users:/Users
chattr: Operation not supported while reading flags on /
mkdir: cannot create directory ‘/Users’: Read-only file system
chattr: Operation not supported while reading flags on /
Error: exit status 1

Running as root doesn't help
% sudo podman machine start
Error: cannot run command "podman machine start" as root

As per https://stackoverflow.com/a/71576242 I tried
% podman machine init --cpus=4 --disk-size=60 --memory=6096 -v $HOME:$HOME
Extracting compressed file: podman-machine-default_fedora-coreos-41.20241215.2.0-qemu.aarch64.qcow2: done  
Image resized.
Machine init complete
To start your machine run:
	podman machine start

% podman machine start
Starting machine "podman-machine-default"
Waiting for VM ...
Mounting volume... /Users/myinitials:/Users/myinitials
chattr: Operation not supported while reading flags on /
mkdir: cannot create directory ‘/Users’: Read-only file system
chattr: Operation not supported while reading flags on /
Error: exit status 1
As a consequence, while I can run the container,
% podman run -it --rm localhost/ui_v8_website_flask_neo4j_webserver /bin/bash 
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)
root@4d006ef73e19:/code# 

I am unable to mount the local directory
% podman run -it --rm -v `pwd`:/scratch localhost/ui_v8_website_flask_neo4j_webserver /bin/bash
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)
Error: statfs /Users/bhp/version_control/allofphysicsgraph/ui_v8_website_flask_neo4j: no such file or directory

Uninstall Podman

podman machine stop podman-machine-default
podman machine rm podman-machine-default
podman machine rm
sudo /opt/podman/bin/podman-mac-helper uninstall
sudo rm /etc/paths.d/podman-pkg
sudo rm -rfv /opt/podman
sudo rm -rf /Applications/Podman\ Desktop.app/
sudo rm /var/run/docker.sock
rm -fr ~/.local/share/containers/

Docker on the new MacBook M2

Downloaded https://desktop.docker.com/mac/main/arm64/Docker.dmg from https://docs.docker.com/desktop/setup/install/mac-install/

roles, use cases, and requirements

THIS PAGE HAS BEEN COPIED TO https://allofphysics.com/faq

Tests are based on validating requirements. Requirements are derived from use cases that address the needs of people in specific roles.


Roles

  • Viewer: sees content on web UI, reads PDF versions. Uses either the web UI or the API. 
  • Editor: adds equations, inference rules, and derivations. Uses either the web UI or the API
  • Developer: uses the API to build an alternative web UI or runs a service that leverages the PDG
  • Contributor: edits documentation and source code, fixes bugs. Uses github issue tracker. 

Use cases per role

  • Viewer
    • reads documentation about PDG
    • sees the number of derivations
      • on the navigation page
    • sees the number of symbols
      • on the navigation page
    • sees the number of inference rules
      • on the navigation page
    • sees the number of expressions
      • on the navigation page
    • sees a list of derivations
      • accessed from the navigation page
    • sees a list of expressions
      • accessed from the navigation page
    • sees a list of inference rules
      • accessed from the navigation page
    • sees a list of symbols
      • accessed from the navigation page
    • see a list of derivations that use a specific symbol
    • see a list of derivations that use a specific inference rule
    • see a list of derivations that use a specific expression
    • see the steps of a specific derivation
      • accessed from the list of derivations
  • Editor has same as Viewer, plus:
    (the following actions require being logged in)
    • adds a new derivation
      • accessed from the navigation page
      • next page is create new step
    • edits an existing derivation
      • accessed from the list of derivations
      • after edit is submitted, return to viewing that derivation
    • deletes an derivation
      • accessed from the list of derivations
      • after delete is confirmed, return to list of derivations
    • adds a new step
      • return to derivation
    • edits an existing step
    • deletes a step
      • return to derivation
    • adds a new expression
      • return to derivation step
    • edits an existing expression
      • change Latex
      • change relation (e.g., = to >)
      • change label
    • deletes an expression
    • adds a new inference rule
    • edits an existing inference rule
      • change number of arguments
    • deletes an inference rule. (What happens to all the instances of use in various derivations?)
    • adds a new symbol
    • edits an existing symbol
      • change the latex
      • change the sympy
    • deletes a symbol. (What happens to all the instances of use in various expressions?)
    • delete all database content
      • return to navigation page
For each of the use cases per role,
  • test in web UI
  • test in API

what should I work on? many options for tasks TODO

  • separate the property graph backend from an API and have the web interface call the API
  • find a lighter weight alternative to neo4j backend
  • get a minimum viable product working using the existing property graph backend
  • separate static documentation pages from the dynamic paths
  • get docker working on my new Mac

That last one is the blocker for everything else, so get docker working on my new Mac is priority. The good news is that the code does run on my old MacBook Air.

Next I'll work on getting a minimum viable product working using the existing property graph backend

Tuesday, December 24, 2024

levels of software quality

This post defines discrete levels of software quality. There are many dimensions of what "software quality" means, so the discrete levels described here are an oversimplification. The attribute clusters below are typically observed together.


software quality level 1

"Worked for me at one point."
  • Code does not compile
  • No documentation
  • Required dependencies not included
  • Purpose of code is unclear
  • Hard coded numerical values
  • Code is wrong - severe design and implementation flaws
  • No tests

software quality level 2

"Good enough."
  • Code compiles successfully, but with warnings
  • Has bugs
  • Inefficient
  • Purpose of code isn't documented
  • Documentation limited to inline comments

software quality level 3

Best practices are enacted.
  • Code compiles and runs without errors
  • Documentation:
    • Inline documentation follows a style guide, e.g. https://google.github.io/styleguide/
    • README file contains
      • purpose of project
      • how to install
        • requirements
      • quick start guide
      • description of features
      • roadmap
    • Additional documentation like Doxygen, Sphinx
  • Containerized (e.g., Docker, Podman, Apptainer/Singularity)
  • Code is formatted consistently
  • 1 or more tests
  • Type hints for Python

software quality level 4

Other developers point to this project as an example of what to aspire to.

  • code is designed to be intuitive
  • no dead code present
  • complete test coverage
  • documentation is written in an easy-to-read style and has no grammatical errors

Sunday, December 15, 2024

Characterizing complexity of software and social systems

BLUF: Definitions of distance and modularity enable characterization of complexity in technical and social systems. However, I am unable to find a simple quantification of complexity or rank complexity.

This post is a mixture of notes from a YouTube video (linked at the bottom of this post) plus some analysis. 


Characterizing Complexity

The scope of this post covers the both software complexity and social complexity. 

Software complexity is characterized by

  • how many layers of abstraction: namespace/package, classes, functions?
  • the number of modules at each level of abstraction: how many of each for namespaces, classes per namespace, functions per class?
  • number of interfaces per module at each level of abstraction
  • the distance between interdependent modules
  • the amount of information transmitted between modules

Social complexity is characterized by

  • how many layers in the hierarchy? 
  • the number of modules at each level of hierarchy: how many of each for organizations, teams-per-organization, and people-per-team
  • the number of interfaces at each level of hierarchy. A person talks to how many other people? A team coordinates with how many other teams?
  • the distance between interdependent modules. When two teams have to coordinate, are they in the same parent organization? Or separate organizations?
  • the amount of information transmitted between modules. A short email, a long telephone call, or multiple in-person meetings?

[Claim] When refactoring a system (whether software redesign or re-oganization of people roles and titles) that lacks redundancies, the complexity of the software+social is conserved if the functionality remains the same. Here conservation means productivity and efficiency are unchanged.

Even with the characterizations above and the definitions below I don't see how to quantify complexity in software-social systems as a scalar number or as a vector. I don't see how to rank complexity to enable comparison of different systems, or how the complexity of a system changes over time.


Definitions

In the characterizations above I used words that need explanation.

Definition of System

System: "an interconnected set of elements that is clearly organized in a way that achieves something"
source: "Thinking in Systems" by D. Meadows

In other words, a set of components + interactions that accomplish a goal. This applies to software, hardware, and social settings.


Definition of Distance within a System

Distance within a system of software is characterized by
  • services, which are decomposed into
  • namespace or package, which are decomposed into
  • class, which are decomposed into
  • methods or functions, which are decomposed into
  • lines
Distance in hierarchical social systems is characterized by
  • organization
  • team
  • person

Definition of Modularity

Modularity is defined as having these characteristics
  • enacts self-contained capability
  • capability can be called by other modules
  • capability can operate independently
source: "Composite/structured design" by G. Myers

modules + interactions accomplish future goals (aka flexibility)

There's a 2018 review that surveys the various types of coupling in software and the tooling capable of measuring the coupling. 

From "A Survey on Software Coupling Relations and Tools" by Fregnan et al, 2018 https://fpalomba.github.io/pdf/Journals/J16.pdf

From "A Survey on Software Coupling Relations and Tools" by Fregnan et al, 2018 https://fpalomba.github.io/pdf/Journals/J16.pdf


The tables above illustrate that there are nuances to what "modularity" means in software. Modularity can improve flexibility for re-use but incurs cognitive load of the relationships and dependencies.



Definition of Complexity

Once you write a line of software it becomes legacy code and technical debt is incurred. Similarly in social settings, as soon as one person engages with another (cooperatively or competitively) there are decisions to be made about the interaction. The best you can aim for is to be aware of both the available trade-offs and the consequences of your actions when altering the system.


Complexity is characterized by cause and effect in the https://en.wikipedia.org/wiki/Cynefin_framework in contrast with other categories:

  • Obvious = relationship between cause and effect is obvious to system participants
  • Complicated = relationship between cause and effect requires analysis
  • Complex = relationship between cause and effect is clear only in hindsight
  • Chaotic = no relationship between cause and effect

When a software developer is exploring a software that is novel to them, the code can seem complex or complicated. After they have internalized the design and the reasoning for the design the same code base can seem obvious. Complexity is not a static characterization.

Similarly for interactions of people, a person new to an organization may initially feel overwhelmed, but after forming relationships and understanding the history views the organization as obvious.


Symptoms of complexity from Chapter 2 of "A Philosophy of Software Design" by Ousterhout

  • Change amplification: a simple change requires changes in many different places. 
  • Cognitive load: the developer needs to learn a lot to complete a task. 
  • Unknown unknowns: it is not obvious which pieces of code need to change to complete a task.

Ways to measure complexity of software

Cyclomatic Complexity - measure the control flow of software
http://www.literateprogramming.com/mccabe.pdf
https://en.wikipedia.org/wiki/Cyclomatic_complexity

Halstead complexity -- countable aspects of software
https://en.wikipedia.org/wiki/Halstead_complexity_measures


Why measure complexity

  • To find heterogenous distribution of complexity within a system (and then re-distribute)
  • To compare one system to another
  • To compare changes across time
    • historical: has the system become more complex? If yes, how?
    • forecasting: would this design change make a future system more or less complex?



Sources for the ideas in this post

This post is primarily informed by two recent sources. The first is a superb talk by Sonya Natanzon, https://www.youtube.com/watch?v=Ukv0JVDh_BI titled "Complexity & Modularity: the Yin and Yang of Socio-Technical Design". This post is a summary of that talk plus an extension of the ideas.  The second is a blog post that qualitatively ranks social distance, https://tej.as/blog/how-to-grow-professional-relationships-tjs-model

References

A Philosophy of Software Design | John Ousterhout | Talks at Google
https://www.youtube.com/watch?v=bmSAYlu0NcY


"A Survey on Software Coupling Relations and Tools" by Fregnan et al, 2018 
https://fpalomba.github.io/pdf/Journals/J16.pdf

Saturday, September 28, 2024

Notes from Talks at Google episode 485: A Philosophy of Software Design by John Ousterhout

This podcast is based on the book https://www.amazon.com/Philosophy-Software-Design-John-Ousterhout/dp/1732102201/ and is available as a video, https://www.youtube.com/watch?v=bmSAYlu0NcY


claim: Primary design principle is decomposition. 

The point of decomposition is to make future work easier.


principle: "classes should be deep."
Deep classes enable information hiding.
The interface to the class is the cost; the functionality of the class is the benefit.
Here "interface" includes signatures, side effects, and dependencies.
The goal of abstraction is to maximize the ratio of functionality to interface.

Sometimes the cost of an interface can exceed the benefit of the functionality. For example, the number of characters for calling the interface may exceed the character count of enacting the function.

Smaller classes are easier to grok, but proliferation of classes increases the interfaces (and thus cost).
"Classes are good" does not mean "more classes are better."


principle: "the common case should be simple"

principle: exceptions should be defined out of existence.


Tactical approach is to get some code working, accepting shortcuts to get the result. These shortcuts compound. Complexity isn't one mistake; complexity is hundreds or thousands of mistakes over a long duration. Because complexity doesn't happen all at once, the incremental mistakes are hard to notice. 
Observation: Software developers who are "tactical tornados" are rewarded by management because they appear productive in the short term. There's no recognition of the technical debt being created.
Observation: "what's the smallest change I can make?" is a local optimization that often harms the global optimum.

The strategic approach is have the goal be "great design." Not just at the beginning, but with every change to code. This is slower compared to tactical approach but enables future productivity. 

claim: The crossover in ROI might be something like 6 months for a project. Tactical can get results faster initially, but after 6 months making small changes gets more expensive than having used a strategic approach.

mentally untangling the spaghetti code

I recently started exploring how to migrate the Physics Derivation Graph website from the JSON-based backend (v7) to Neo4j (v8). For v7 I have a working JSON-based backend+frontend, and for v8 I have a working Neo4j-backend with minimal frontend (e.g., no nginx, no authentication, no documentation pages).

I'm aware of two ways to carry out the migration:

  • hard cut-over: port all existing front-end capabilities (nginx, authentication, documentation) and backend capabilities {render d3js, render tex, render pdf, render graphviz} to v8, then switch public site from v7 to v8
  • slow transition: add Neo4j to existing v7 JSON-based site and then incrementally transition site features like {render d3js, render tex, render pdf, render graphviz}

The "slow transition" has the advantage of not having to port the front-end capabilities. The downside is that the two codebases (v7, v8) exist concurrently and I have to refactor each backend feature on the live site.

I don't have a good sense for how much work porting front-end capabilities (the hard cut-over option) involves. 


In the process of trying the "slow transition" I am getting lost in the code dependencies and which complexity is essential versus accidental. Refactoring requires the ability to distinguish essential versus accidental complexity. 

The usual way to guide refactoring is to rely on tests of features. If I change some code and a feature breaks, then the essential complexity wasn't met. If I change something and all tests pass, then the assumption is that my change reduced accidental complexity. (This also relies on full test coverage and the assumption that tests are correlated with necessary capabilities.)

A different way to distinguish essential versus accidental complexity is to enumerate roles, use cases per role, and the requirements of each use case. The requirements are the essential complexity. Then the code I write is in response to a specific requirement. 

In practice, as a developer my natural instinct is to enact the minimum amount of change based on my local perspective. To break out of this local minimum I need the context of tracing the roles to use cases to requirements. For each change to the software! That's asking a lot.

Writing out all the roles, uses cases, and requirements turns out to be pretty messy. This corresponds with the amount of code needed to support the Physics Derivation Graph.

DreamPuf

digraph G {

  rankdir="LR";
  
  // see https://graphviz.org/docs/attrs/splines/
  //splines=false;
  //splines=curved;
  //splines=polyline;
  splines=ortho;

  unauthenticated_user [label="unauthenticated user", shape="rectangle"];
  authenticated_user [label="authenticated user", shape="rectangle"];
  
  log_in [label="authenticate" style=filled color=lightgrey];
  unauthenticated_user -> log_in -> authenticated_user;
  auth_google [label="authenticate using Google"];
  log_in -> auth_google;
  
  log_out [label="log out" style=filled color=lightgrey];
  authenticated_user -> log_out -> unauthenticated_user;
  
  export_database [label="export database" style=filled color=lightgrey];
  unauthenticated_user -> export_database;
  authenticated_user -> export_database;
  
  export_database_json_webUI [label="web UI: link to database JSON" style=filled color=lightblue];
  export_database -> export_database_json_webUI;
  export_database_cypher_webUI [label="web UI: link to database Cypher" style=filled color=lightblue];
  export_database -> export_database_cypher_webUI;
  
  export_database_json_rest [label="REST API: export database as JSON" style=filled color=lightpink];
  export_database -> export_database_json_rest;
  export_database_cypher_rest [label="REST API: export database as Cypher" style=filled color=lightpink];
  export_database -> export_database_cypher_rest;
  
  export_database_json_backend [label="backend: export database as JSON"];
  export_database_json_rest -> export_database_json_backend;
  export_database_json_webUI -> export_database_json_backend;
  
  export_database_cypher_backend [label="backend: export database as Cypher"];
  export_database_cypher_webUI -> export_database_cypher_backend;
  export_database_cypher_rest -> export_database_cypher_backend;
  
  import_database_as_cypher [label="import database as Cypher" style=filled color=lightgrey];
  authenticated_user -> import_database_as_cypher;

  upload_database_as_cypher_webUI [label="web UI: upload database as Cypher" style=filled color=lightblue];
  import_database_as_cypher -> upload_database_as_cypher_webUI;
  
  upload_database_as_cypher_backend [label="backend: upload database as Cypher"];
  upload_database_as_cypher_webUI -> upload_database_as_cypher_backend;
  
  read_FAQ [label="read FAQ" style=filled color=lightgrey];
  unauthenticated_user -> read_FAQ;
  authenticated_user -> read_FAQ;
  render_FAQ [label="web UI: render FAQ" style=filled color=lightblue];
  read_FAQ -> render_FAQ;
  
  query_graph [label="query graph" style=filled color=lightgrey];
  unauthenticated_user -> query_graph;
  authenticated_user -> query_graph;
  
  query_graph_webUI [label="web UI: query graph" style=filled color=lightblue];
  query_graph -> query_graph_webUI;

  query_graph_rest [label="REST API: query graph" style=filled color=lightpink];
  query_graph -> query_graph_rest;
  
  query_graph_backend [label="backend: query graph"];
  query_graph_webUI -> query_graph_backend;
  query_graph_rest -> query_graph_backend;
  
  enter_new_operator [label="enter new operator" style=filled color=lightgrey];
  authenticated_user -> enter_new_operator;
  
  create_new_operator_webUI [label="web UI: create new operator" style=filled color=lightblue];
  enter_new_operator -> create_new_operator_webUI;
  
  enter_new_expression [label="enter new expression" style=filled color=lightgrey];
  authenticated_user -> enter_new_expression;

  create_new_expression_webUI [label="web UI: create new expression" style=filled color=lightblue];
  enter_new_expression -> create_new_expression_webUI;

  add_new_expression [label="backend: add new expression"];
  create_new_expression_webUI -> add_new_expression;
  
  verify_expr_dimensional_consistency [label="backend: verify expression dimensional consistency"];
  create_new_expression_webUI -> verify_expr_dimensional_consistency;

  enter_new_derivation [label="enter new derivation" style=filled color=lightgrey];
  authenticated_user -> enter_new_derivation;
  
  create_new_derivation_webUI [label="web UI: create new derivation" style=filled color=lightblue];
  enter_new_derivation -> create_new_derivation_webUI;

  add_new_derivation [label="backend: add new derivation"];
  create_new_derivation_webUI -> add_new_derivation;

  enter_new_symbol [label="enter new symbol" style=filled color=lightgrey];
  authenticated_user -> enter_new_symbol;
  
  create_new_symbol_webUI [label="web UI: create new symbol" style=filled color=lightblue];
  enter_new_symbol -> create_new_symbol_webUI;

  add_new_symbol [label="backend: add new symbol"];
  create_new_symbol_webUI -> add_new_symbol;

  read_list_of_derivations [label="read list of derivations" style=filled color=lightgrey];
  unauthenticated_user -> read_list_of_derivations;
  authenticated_user -> read_list_of_derivations;

  list_of_derivations_html [label="web UI: render list of derivations" style=filled color=lightblue];
  read_list_of_derivations -> list_of_derivations_html;

  list_of_derivations_json [label="REST API: JSON list of derivations" style=filled color=lightpink];
  read_list_of_derivations -> list_of_derivations_json;

  list_of_derivations [label="backend: get list of derivations"];
  list_of_derivations_json -> list_of_derivations;
  list_of_derivations_html -> list_of_derivations;

  read_list_of_symbols [label="read list of symbols" style=filled color=lightgrey];
  unauthenticated_user -> read_list_of_symbols;
  authenticated_user -> read_list_of_symbols;

  list_of_symbols_html [label="web UI: show list of symbols" style=filled color=lightblue];
  read_list_of_symbols -> list_of_symbols_html;

  list_of_symbols_json [label="REST API: JSON list of symbols" style=filled color=lightpink];
  read_list_of_symbols -> list_of_symbols_json;

  list_of_symbols [label="backend: get list of symbols"]
  list_of_symbols_html -> list_of_symbols;
  list_of_symbols_json -> list_of_symbols;

  read_list_of_expressions [label="read list of expressions" style=filled color=lightgrey];
  unauthenticated_user -> read_list_of_expressions;
  authenticated_user -> read_list_of_expressions;

  list_of_expressions_html [label="web UI: show list of expressions" style=filled color=lightblue];
  read_list_of_expressions -> list_of_expressions_html;
  list_of_expressions_html -> verify_expr_dimensional_consistency;

  list_of_expressions_json [label="REST API: JSON list of expressions" style=filled color=lightpink];
  read_list_of_expressions -> list_of_expressions_json;

  list_of_expressions [label="backend: get list of expressions"];
  list_of_expressions_json -> list_of_expressions;
  list_of_expressions_html -> list_of_expressions;

  read_derivation [label="read derivation" style=filled color=lightgrey];
  unauthenticated_user -> read_derivation;
  authenticated_user -> read_derivation;
  
  derivation_steps_json [label="REST API: JSON list of steps" style=filled color=lightpink];
  read_derivation -> derivation_steps_json;
  derivation_table [label="web UI: show table of steps" style=filled color=lightblue];
  read_derivation -> derivation_table;
  derivation_table -> verify_expr_dimensional_consistency;
  
  verify_step_consistency [label="backend: verify step consistency"];
  derivation_table -> verify_step_consistency;
  
  list_of_steps [label="backend: get list of steps"];
  derivation_steps_json -> list_of_steps;
  derivation_table -> list_of_steps;
  
  derivation_tex [label="web UI: link to derivation .tex file" style=filled color=lightblue];
  read_derivation -> derivation_tex;
  derivation_pdf [label="web UI: link to derivation .pdf file" style=filled color=lightblue];
  read_derivation -> derivation_pdf;
  derivation_d3js [label="web UI: show derivation d3js" style=filled color=lightblue];
  read_derivation -> derivation_d3js;
  derivation_graphviz_png [label="web UI: show derivation graphviz PNG" style=filled color=lightblue];
  read_derivation -> derivation_graphviz_png;

  derivation_d3js -> list_of_steps;
  derivation_graphviz_png  -> list_of_steps;
  
  get_expression_for_step [label="backend: get expressions per step"];
  derivation_d3js -> get_expression_for_step;
  derivation_table -> get_expression_for_step;
  get_infrule_for_step [label="backend: get infrule per step"];
  derivation_graphviz_png -> get_infrule_for_step;
  
  generate_png_for_expression [label="backend: generate png for expression"];
  derivation_d3js -> generate_png_for_expression;
  derivation_graphviz_png -> generate_png_for_expression;
  generate_png_for_infrule [label="backend: generate png for infrule"];
  derivation_d3js -> generate_png_for_infrule;
  derivation_graphviz_png -> generate_png_for_infrule;
  
  generate_derivation_tex [label="backend: generate tex for derivation"];
  derivation_tex -> generate_derivation_tex;
  generate_derivation_tex -> list_of_steps;
  generate_derivation_tex -> get_infrule_for_step;
  generate_derivation_tex -> get_expression_for_step;
  
  generate_derivation_pdf_from_tex [label="backend: generate derivation PDF from .tex"];
  derivation_pdf -> generate_derivation_pdf_from_tex -> generate_derivation_tex;
  
  generate_pdf_from_tex [label="backend: generate PDF from .tex"];
  generate_derivation_pdf_from_tex -> generate_pdf_from_tex;
}