Giter Club home page Giter Club logo

anqur's Introduction

Anqur

maven test

image

This project is evolved from Guest0x0 with cubical features removed. It serves as a demo for elaboration of inductive types, pattern matching, and indexed types.

I will also be testing ideas on induction-recursion and induction-induction of simpler indexed types in this project.

v0.5

image

Ported latest code from Aya with a new coverage checking algorithm which deals with nested pattern matching better. Error report is implemented! Thanks to the new coverage checking algorithm, it becomes much easier.

The previous example will cause:

Missing: ImmutableVector[(zero, zero), (zero, succ zero), (zero, succ (succ ...))]

v0.4

image

Implemented a coverage checker. The following code:

def plus-bad (a : Nat) (b : Nat) : Nat
| (succ a) b => succ (plus a b)

Will cause:

Missing pattern >:)

It is too difficult to implement proper error reporting, so I'll leave it to readers :) in case you are really curious, you may check out the coverage checker in Aya.

v0.3

image

Implements unfold properly. The following code (with the old code):

print : Nat => plus two two

Prints

succ (succ (succ (succ (zero))))

Awesome. Total lines of Java code (excluding blank/comments): 864

v0.2

image

Implement pattern matching functions and recursive functions. No termination and coverage check yet. Reduction of pattern matching is still a work-in-progress. The syntax is kinda Lean-flavored:

def plus (a : Nat) (b : Nat) : Nat
| zero b => b
| (succ a) b => succ (plus a b)

v0.1

image

Initial version with simplest parameterized inductive types:

data Unit | unit
def myYolife : Unit => unit

data Nat
| zero
| succ (n : Nat)

def two : Nat => succ (succ zero)
print : Nat => two

data List (A : U)
| nil
| cons (x : A) (xs : List A)

def lengthTwo (A : U) (a : A) : List A => cons A a (cons A a (nil A))
print : List Nat => lengthTwo Nat two

Total lines of Java code: 745. Please wait, patterns are on the way.

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.