proof-assistant-bot: Telegram bot for proof assistants

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Warnings:

Bridge between Telegram Bot and several proof assistants.

Currently following proof assistant supported: Agda, Arend, Coq, Idris 2, Lean, Rzk

See README.md for more details.


[Skip to Readme]

Properties

Versions 0.2.0, 0.2.0, 0.2.1, 0.2.2
Change log CHANGELOG.md
Dependencies Agda, async, base (>=4.14.3.0 && <4.15), bytestring, dhall, directory, filepath, mtl, process, proof-assistant-bot, rzk, stm, telegram-bot-simple (>=0.5.2), text, unix, unordered-containers [details]
License MIT
Author Andrey Prokopenko
Maintainer persiantiger@yandex.ru
Category Dependent types
Home page https://github.com/swamp-agr/proof-assistant-bot/
Bug tracker https://github.com/swamp-agr/proof-assistant-bot/issues
Uploaded by swamp_agr at 2022-12-10T20:20:58Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for proof-assistant-bot-0.2.0

[back to package description]

Proof Assistant Bot

  1. Description
  2. Installation
    1. Coq
    2. Agda
    3. Idris 2
    4. Lean
    5. Arend
    6. Rzk
  3. Usage
  4. Available instances
  5. Acknowledgements

Description

This bot provides limited Telegram interfaces to following proof assistant programs (in order of implementation):

Installation

  1. Bot could be built via following commands:
cabal update
cabal build
cabal install --overwrite-policy=always
  1. To launch bot you need to set environmental variables, see ./config/settings.dhall for more details.

One of them is PROOF_ASSISTANT_BOT_TOKEN. Obtain it via @BotFather and set it:

export PROOF_ASSISTANT_BOT_TOKEN="..."

Coq

  1. Install opam >= 2.1.0, e.g. from here.
cd $HOME
opam --version
2.1.3
  1. Install Coq.
cd $HOME
opam init
eval $(opam env)
opam pin add coq 8.16.1
  1. Locate coqtop and set enviromental variable. Should be similar to:
export COQ_BIN_PATH="$HOME/.opam/default/bin/coqtop"

Agda

We do not need to worry about Agda since it is included in package dependencies. It will be installed automatically. Meantime, Agda standard library should be installed manually.

  1. Get agda-stdlib from Github.

  2. Unpack archive.

mkdir -p $PROOF_ASSISTANT_BOT_DIR/agda
cp agda-stdlib-1.7.1.tar.gz $PROOF_ASSISTANT_BOT_DIR/agda
cd $PROOF_ASSISTANT_BOT_DIR/agda
tar -xzvf agda-stdlib-1.7.1.tar.gz
export AGDA_STDLIB_PATH=$PROOF_ASSISTANT_BOT_DIR/agda/agda-stdlib-1.7.1
  1. Create file $HOME/.agda/defaults with following content:
standard-library
  1. Create file $HOME/.agda/libraries with following content:
$AGDA_STDLIB_PATH/standard-library.agda-lib

Idris 2

  1. Get nix from nixos.org.

  2. Install idris2 via nix:

nix-env -i idris2
  1. Set environmental variable:
export IDRIS2_BIN_PATH="$HOME/.nix-profile/bin/idris2"

Lean

  1. Get nix from nixos.org.

  2. Install lean via nix:

nix-env -i lean
  1. Install leanproject via nix:
nix-env -i mathlibtools
  1. Run leanproject new lean.

  2. Set LEAN_BIN_PATH environmental variable:

export LEAN_BIN_PATH="$HOME/.nix-profile/bin/lean"
  1. Set LEAN_PROJECT_PATH to the newly created project directory.

Arend

  1. Get nix from nixos.org.

  2. Get java and openjdk17 via nix:

nix-env -i openjdk-17.0.4+8
  1. Set JAVA_HOME environment variable to your openjdk location. You can use readlink $HOME/.nix-profile/bin/java and strip /bin/java from the end.

  2. Create project directory to store arend projects (for different Telegram chats) and set AREND_ROOT_PROJECT_DIR.

  3. Get Arend standard library from the official site and store in ${AREND_ROOT_PROJECT_DIR}/libs.

  4. Point AREND_STDLIB_PATH environment variable to the same location as AREND_ROOT_PROJECT_DIR.

  5. Download Arend.jar and set AREND_PATH environment variable to its location, e.g.

export AREND_PATH="${AREND_ROOT_PROJECT_DIR}/Arend.jar"

Rzk

No actions required. See cabal.project for more details.

Usage

/coq Inductive day : Type :=
  | monday
  | tuesday
  | wednesday
  | thursday
  | friday
  | saturday
  | sunday.

Definition next_weekday (d:day) : day :=
  match d with
  | monday => tuesday
  | tuesday => wednesday
  | wednesday => thursday
  | thursday => friday
  | friday => monday
  | saturday => monday
  | sunday => monday
  end.

Compute (next_weekday friday).

Compute (next_weekday (next_weekday saturday)).

Example test_next_weekday:
  (next_weekday (next_weekday saturday)) = tuesday.

Proof. simpl. reflexivity. Qed.

Available instances

  1. @ProofBot (online)
  2. @ProofDebugBot (for debug purpose, offline most of the time)

Acknowledgements