Coder Social home page Coder Social logo

agda-from-nothing's Introduction

Agda from Nothing

A workshop on learning Agda with minimal prerequisites.

Installing Agda

The exercises are written for Agda 2.5.1.

Official Agda installation instructions

On Mac

You may find stack more reliable than cabal to build Agda.

  1. Install stack
  2. In a terminal run: stack install --resolver nightly-2016-05-08 Agda
  3. Install Aquamacs
  4. In a terminal run: agda-mode setup
  5. (Restart Aquamacs)

Docker

Docker with Emacs and exercises

I created a Docker image with Agda, Emacs and the exercises. See scottfleischman/agda-from-nothing

docker run -it scottfleischman/agda-from-nothing

Note The Mac Terminal has issues sending common control sequences such as Control+Comma. It may be better to do a full install as above, or use Docker with Agda as below with a local editor and agda-mode.

Docker with Agda only

See banacorn/docker-agda.

Emacs Keybindings

See the Agda docs for all of the keybindsings. Here are ones I commonly use. Note C- means Control+.

Global (can be used anywhere)

  • C-c C-l — Load file. I use this constantly.
  • C-c C-f — Move to next goal (forward)
  • C-c C-b — Move to previous goal (backwards)
  • C-c C-d — Infer (deduce) type. Type in any expression and it infers the type.
  • C-c C-n — Compute normal form. In other words, reduces the expression as much as possible.
  • C-g — Quit what command sequence you started.

In a hole/goal

  • C-c C-c — Case split. Type in an argument name and it creates lines for each possible case. It works with multiple arguments.
  • C-u C-c C-Comma — Show unnormalized goal type and context.
  • C-u C-u C-c C-Comma — Show fully normalized goal type and context.
  • C-c C-Space — Give (fill goal). Type checks the expression you typed in the hole, and if successful fills the hole.
  • C-c C-r — Refine. Partial give: makes new holes for missing arguments.
    • If you've entered an expression in the hole, it will fill in the hole with that expression and make new holes for any missing arguments.
    • If you haven't entered anything in the hole, and if the hole is constrained to one constructor, it fills in the hole with that constructor and makes new holes for each of the constructor's arguments.
  • C-c C-a — Automatic Proof Search (Auto). Tries to fill the hole with any solution. Note—this may not be a correct solution if the types aren't precise enough to constrain the term to only correct ones. Note also that it often fails to find a solution.

Unicode characters

  • \r- or \to for
  • \== for
  • \==n for
  • \all for
  • \<= for
  • \<=n for
  • \ell for
  • \lambda or \Gl for λ
  • \' for
  • \:: for (it looks like two colons, but it is a single Unicode character)
  • \_0 for (subscript 0)
  • \_1 for (and so on)
  • \^0 for (superscript 0)
  • \^1 for ¹ (and so on)
  • \in for
  • \ni for
  • \lub for (least upper bound; max)
  • \Pi for Π
  • \Sigma or \GS for Σ
  • To see info on a character under the cursor, use C-u C-x Equals

Resources

agda-from-nothing's People

Contributors

scott-fleischman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  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.