Giter Club home page Giter Club logo

unification's Introduction

Unification

An implementation of unification for type-checking polymorphic functions. Implemented with reference to Chapter 6 of the dragon book, edition 1.

Internal state of the unification algorithm
==inferring |deref(deref(ptr()))|==
	-{0} deref
	-{1} deref[» [π [Pointer [αti]]] [αti]]
	-{0} deref
	-{1} deref[» [π [Pointer [αzi]]] [αzi]]
	-{0} ptr
	-{1} ptr[» [π] [Pointer [Pointer [Int]]]]
	-{0} ptr[» [π] [Pointer [Pointer [Int]]]]():[αko]
	-{u} [» [π] [αko]]~[» [π] [Pointer [Pointer [Int]]]]
		-{u} [π]~[π]
		-{v} [π]~[π] | cons
		-{u} [αko]~[Pointer [Pointer [Int]]]
		-{v} [Pointer [Pointer [Int]]]~[Pointer [Pointer [Int]]] | lvar
	-{v} [» [π] [Pointer [Pointer [Int]]]]~[» [π] [Pointer [Pointer [Int]]]] | cons
	-{1} ptr[» [π] [Pointer [Pointer [Int]]]]():[Pointer [Pointer [Int]]]
	-{0} deref[» [π [Pointer [αzi]]] [αzi]](ptr[» [π] [Pointer [Pointer [Int]]]]():[Pointer [Pointer [Int]]]):[αno]
	-{u} [» [π [Pointer [Pointer [Int]]]] [αno]]~[» [π [Pointer [αzi]]] [αzi]]
		-{u} [π [Pointer [Pointer [Int]]]]~[π [Pointer [αzi]]]
			-{u} [Pointer [Pointer [Int]]]~[Pointer [αzi]]
				-{u} [Pointer [Int]]~[αzi]
				-{v} [Pointer [Int]]~[Pointer [Int]] | rvar
			-{v} [Pointer [Pointer [Int]]]~[Pointer [Pointer [Int]]] | cons
		-{v} [π [Pointer [Pointer [Int]]]]~[π [Pointer [Pointer [Int]]]] | cons
		-{u} [αno]~[Pointer [Int]]
		-{v} [Pointer [Int]]~[Pointer [Int]] | lvar
	-{v} [» [π [Pointer [Pointer [Int]]]] [Pointer [Int]]]~[» [π [Pointer [Pointer [Int]]]] [Pointer [Int]]] | cons
	-{1} deref[» [π [Pointer [Pointer [Int]]]] [Pointer [Int]]](ptr[» [π] [Pointer [Pointer [Int]]]]():[Pointer [Pointer [Int]]]):[Pointer [Int]]
	-{0} deref[» [π [Pointer [αti]]] [αti]](deref[» [π [Pointer [Pointer [Int]]]] [Pointer [Int]]](ptr[» [π] [Pointer [Pointer [Int]]]]():[Pointer [Pointer [Int]]]):[Pointer [Int]]):[αro]
	-{u} [» [π [Pointer [Int]]] [αro]]~[» [π [Pointer [αti]]] [αti]]
		-{u} [π [Pointer [Int]]]~[π [Pointer [αti]]]
			-{u} [Pointer [Int]]~[Pointer [αti]]
				-{u} [Int]~[αti]
				-{v} [Int]~[Int] | rvar
			-{v} [Pointer [Int]]~[Pointer [Int]] | cons
		-{v} [π [Pointer [Int]]]~[π [Pointer [Int]]] | cons
		-{u} [αro]~[Int]
		-{v} [Int]~[Int] | lvar
	-{v} [» [π [Pointer [Int]]] [Int]]~[» [π [Pointer [Int]]] [Int]] | cons
	-{1} deref[» [π [Pointer [Int]]] [Int]](deref[» [π [Pointer [Pointer [Int]]]] [Pointer [Int]]](ptr[» [π] [Pointer [Pointer [Int]]]]():[Pointer [Pointer [Int]]]):[Pointer [Int]]):[Int]

unification's People

Contributors

bollu avatar

Stargazers

 avatar

Watchers

 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.