Giter Site home page Giter Site logo

hol4-vscode's Introduction

HOL4 mode for Visual Studio Code

Support for working with the HOL4 interactive theorem prover in Visual Studio Code. This plugin provides the required functionality to maintain a HOL session in an editor window, basic syntax highlighting, and basic unicode input completion. The plugin can index source files in the users current directory and provides basic go-to-definition functionality for theorems, function definitions, and inductive relations.

Requirements

Expects a HOL4 installation to exist, and the environment variable $HOLDIR to point to this installation. The HOL4 homepage can be found here and its GitHub repository here.

Extension Settings

It is possible to toggle the indexing of theorems and definitions in the workspace from the settings by the key: hol4-mode.indexing to false.

Suggested additions to settings.json for use with VSCodeVim, somewhat corresponding to the HOL4 Vim mode defaults:

{
    "vim.visualModeKeyBindings": [
        {
            "before": [ "<leader>", "e" ],
            "commands": [ "hol4-mode.sendTactic" ]
        },
        {
            "before": [ "<leader>", "s" ],
            "commands": [ "hol4-mode.sendSelection" ]
        },
    ],
    "vim.normalModeKeyBindings": [
        {
            "before": [ "<leader>", "h" ],
            "commands": [ "hol4-mode.startSession" ]
        },
        {
            "before": [ "<leader>", "<leader>", "x" ],
            "commands": [ "hol4-mode.stopSession" ]
        },
        {
            "before": [ "<leader>", "s" ],
            "commands": [ "hol4-mode.sendSelection" ]
        },
        {
            "before": [ "<leader>", "<leader>", "s" ],
            "commands": [ "hol4-mode.sendUntilCursor" ]
        },
        {
            "before": [ "<leader>", "g" ],
            "commands": [ "hol4-mode.sendGoal" ]
        },
        {
            "before": [ "<leader>", "S" ],
            "commands": [ "hol4-mode.sendSubgoal" ]
        },
        {
            "before": [ "<leader>", "e" ],
            "commands": [ "hol4-mode.sendTactic" ]
        },
        {
            "before": [ "<leader>", "p" ],
            "commands": [ "hol4-mode.proofmanShow" ]
        },
        {
            "before": [ "<leader>", "b" ],
            "commands": [ "hol4-mode.proofmanBack" ]
        },
        {
            "before": [ "<leader>", "R" ],
            "commands": [ "hol4-mode.proofmanRestart" ]
        },
        {
            "before": [ "<leader>", "r" ],
            "commands": [ "hol4-mode.proofmanRotate" ]
        },
        {
            "before": [ "<leader>", "d" ],
            "commands": [ "hol4-mode.proofmanDrop" ]
        },
        {
            "before": [ "<leader>", "y" ],
            "commands": [ "hol4-mode.toggleShowTypes" ]
        },
        {
            "before": [ "<leader>", "a" ],
            "commands": [ "hol4-mode.toggleShowAssums" ]
        },
        {
            "before": [ "<leader>", "c" ],
            "commands": [ "hol4-mode.interrupt" ]
        }
    ]
}

Known Issues

  • Syntax highlighting is lacking. Logical terms are especially bad. The situation could be improved by implementing a HOL language server.
  • There is some hacky code that attempts to strip ML comments from input that is being sent to HOL. Currently, this does not properly deal with nested comments, or comment tokens that exist within string literals.
  • Comments are not stripped from tactic text.
  • load calls are not inserted when calls to qualified ML code is made.
  • Location pragmas are not inserted at calls to {Co}Inductive, Datatype, Theorem, nor in term quotations.
  • Definitions created with Define are not properly indexed.
  • Automatically generated theorems (for example, inductions) are not properly indexed.
  • The hover/symbol-providers won't work on fully qualified identifiers (such as myTheory.my_theorem).

hol4-vscode's People

Contributors

kacperfkorban avatar oskarabrahamsson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.