unicoq

An enhanced unification algorithm for Coq

  • 所有者: unicoq/unicoq
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

UniCoq

Unicoq logo

An enhanced unification algorithm for Coq

Copyright (c) 2015 Beta Ziliani bziliani@famaf.unc.edu.ar,
Matthieu Sozeau mattam@mattam.org

Distributed under the terms of the MIT License,
see LICENSE for details.

This archive contains a new unification algorithm for Coq, as
a plugin that replaces the existing unification algorithm. This
algorithm is described in detail in
A Unification Algorithm for Coq Featuring Universe Polymorphism
and Overloading
.

The archive has 3 subdirectories:

  • src contains the code of the plugin in munify.ml4.

  • theories contains support Coq files for the plugin.
    Unicoq.v declares the plugin on the Coq side.

  • test-suite just demonstrates a use of the plugin

Installation

The plugin works currently with Coq v8.5. Through OPAM,
this plugin is available in the Coq's repository:

 opam repo add coq-released https://coq.inria.fr/opam/released
opam install coq-unicoq

Otherwise, you should have coqc, ocamlc and make in your path.
Then simply do:

 coq_makefile -f Make -o Makefile

To generate a makefile from the description in Make, then make.
This will consecutively build the plugin, the supporting
theories and the test-suite file.

You can then either make install the plugin or leave it in its
current directory. To be able to import it from anywhere in Coq,
simply add the following to ~/.coqrc:

Add LoadPath "path_to_unicoq/theories" as Unicoq.
Add ML Path "path_to_unicoq/src".

Usage

Once installed, you can Require Import Unicoq.Unicoq to load the
plugin, which will install unicoq's unification algorithm as the
unifier called when typechecking terms (Definitions...) and when
using the refine tactic. Note that Coq's standard apply,
rewrite etc... still use a different unification algorithm.
On the other hand, if you use Ssreflect all tactics will call
unicoq's unifier.

The plugin also defines a tactic munify t u taking two terms and
unifying them.

Options, debugging

To trace what the algorithm is doing, one can use Set Unicoq Debug
which will produce a trace on stdout. Additionally, if a file is set
using Set Unicoq LaTex File "file.tex" the algorithm, upon success,
will write a derivation tree in LaTex. In the directory doc there is
a file named treelog.tex with an example on how to build such document.

The option Set Unicoq Aggressive activates the strong Meta-DelDeps
rule to remove dependencies of meta-variables (see the paper for details).
It is on by default.

The option Set Unicoq Super Aggressive activates specialization of a
meta-variable to its instance arguments (in case it is of function
type). Implies Aggressive. Such arguments can be pruned afterwards to
fall back into HOPU.
It is off by default.

The option Set Unicoq Use Hash enables the use of a hash table to
record unification failures, improving time performance but consuming
more memory.
It is off by default.

The command Print Unicoq Stats will print the number of times the
unifier was called and the number of meta-variable instantiations performed.

主要指標

概覽
名稱與所有者unicoq/unicoq
主編程語言OCaml
編程語言Coq (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2015-02-17 19:05:55
推送於2025-04-11 13:18:17
最后一次提交2025-04-11 15:18:17
發布數26
最新版本名稱v1.6-8.20 (發布於 )
第一版名稱v1.0 (發布於 )
用户参与
星數56
關注者數8
派生數18
提交數269
已啟用問題?
問題數29
打開的問題數10
拉請求數68
打開的拉請求數1
關閉的拉請求數5
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?