"
}
ARGUMENT EXTEND constro
TYPED AS constr option
PRINTED BY { pr_constro }
| [ "[" constr(c) "]" ] -> { Some c }
| [ ] -> { None }
END
TACTIC EXTEND _aac_reflexivity_
| [ "aac_reflexivity" ] -> { aac_reflexivity }
END
TACTIC EXTEND _aac_normalise_
| [ "aac_normalise" ] -> { aac_normalise }
END
TACTIC EXTEND _aac_rewrite_
| [ "aac_rewrite" orient(l2r) constr(c) aac_args(args) constro(extra)] ->
{ aac_rewrite ?extra ~args ~l2r ~strict:true c }
END
TACTIC EXTEND _aac_pattern_
| [ "aac_pattern" orient(l2r) constr(c) aac_args(args) constro(extra)] ->
{ aac_rewrite ?extra ~args ~l2r ~strict:true ~abort:true c }
END
TACTIC EXTEND _aac_instances_
| [ "aac_instances" orient(l2r) constr(c) aac_args(args) constro(extra)] ->
{ aac_rewrite ?extra ~args ~l2r ~strict:true ~show:true c }
END
TACTIC EXTEND _aacu_rewrite_
| [ "aacu_rewrite" orient(l2r) constr(c) aac_args(args) constro(extra)] ->
{ aac_rewrite ?extra ~args ~l2r ~strict:false c }
END
TACTIC EXTEND _aacu_pattern_
| [ "aacu_pattern" orient(l2r) constr(c) aac_args(args) constro(extra)] ->
{ aac_rewrite ?extra ~args ~l2r ~strict:false ~abort:true c }
END
TACTIC EXTEND _aacu_instances_
| [ "aacu_instances" orient(l2r) constr(c) aac_args(args) constro(extra)] ->
{ aac_rewrite ?extra ~args ~l2r ~strict:false ~show:true c }
END
aac-tactics-8.18.0/src/print.mli 0000644 0001750 0001750 00000002066 14463022056 016040 0 ustar jpuydt jpuydt (***************************************************************************)
(* This is part of aac_tactics, it is distributed under the terms of the *)
(* GNU Lesser General Public License version 3 *)
(* (see file LICENSE for more details) *)
(* *)
(* Copyright 2009-2010: Thomas Braibant, Damien Pous. *)
(***************************************************************************)
(** Pretty printing functions we use for the aac_instances
tactic. *)
(** The main printing function. {!print} uses the rel-context
to rename the variables, and rebuilds raw Coq terms (for the given
context, and the terms in the environment). In order to do so, it
requires the information gathered by the {!Theory.Trans} module.*)
val print :
Coq.Relation.t ->
Theory.Trans.ir ->
(int * Matcher.Terms.t * Matcher.Subst.t Search_monad.m) Search_monad.m ->
EConstr.rel_context ->
unit Proofview.tactic
aac-tactics-8.18.0/Makefile.coq.local 0000644 0001750 0001750 00000001377 14463022056 016730 0 ustar jpuydt jpuydt GLOBFILES = $(VFILES:.v=.glob)
CSSFILES = resources/coqdoc.css resources/coqdocjs.css
JSFILES = resources/config.js resources/coqdocjs.js
HTMLFILES = resources/header.html resources/footer.html
COQDOCDIR = docs/coqdoc
COQDOCHTMLFLAGS = --toc --toc-depth 3 --index indexpage --html -s \
--interpolate --no-lib-name --parse-comments \
--with-header resources/header.html --with-footer resources/footer.html
coqdoc: $(GLOBFILES) $(VFILES) $(CSSFILES) $(JSFILES) $(HTMLFILES)
$(SHOW)'COQDOC -d $(COQDOCDIR)'
$(HIDE)mkdir -p $(COQDOCDIR)
$(HIDE)$(COQDOC) $(COQDOCHTMLFLAGS) $(COQDOCLIBS) -d $(COQDOCDIR) $(VFILES)
$(SHOW)'COPY resources'
$(HIDE)cp $(CSSFILES) $(JSFILES) $(COQDOCDIR)
.PHONY: coqdoc
resources/index.html: resources/index.md
pandoc -s -o $@ $<
aac-tactics-8.18.0/resources/ 0000755 0001750 0001750 00000000000 14463022056 015420 5 ustar jpuydt jpuydt aac-tactics-8.18.0/resources/coqdocjs.js 0000644 0001750 0001750 00000013640 14463022056 017567 0 ustar jpuydt jpuydt var coqdocjs = coqdocjs || {};
(function(){
function replace(s){
var m;
if (m = s.match(/^(.+)'/)) {
return replace(m[1])+"'";
} else if (m = s.match(/^([A-Za-z]+)_?(\d+)$/)) {
return replace(m[1])+m[2].replace(/\d/g, function(d){
if (coqdocjs.subscr.hasOwnProperty(d)) {
return coqdocjs.subscr[d];
} else {
return d;
}
});
} else if (coqdocjs.repl.hasOwnProperty(s)){
return coqdocjs.repl[s]
} else {
return s;
}
}
function toArray(nl){
return Array.prototype.slice.call(nl);
}
function replInTextNodes() {
// Get all the nodes up front.
var nodes = Array.from(document.querySelectorAll(".code, .inlinecode"))
.flatMap(elem => Array.from(elem.childNodes)
.filter(e => e.nodeType == Node.TEXT_NODE)
);
// Create a replacement template node to clone from.
var replacementTemplate = document.createElement("span");
replacementTemplate.setAttribute("class", "id");
replacementTemplate.setAttribute("type", "keyword");
// Do the replacements.
coqdocjs.replInText.forEach(function(toReplace){
var replacement = replacementTemplate.cloneNode(true);
replacement.appendChild(document.createTextNode(toReplace));
nodes.forEach(node => {
var fragments = node.textContent.split(toReplace);
node.textContent = fragments[fragments.length-1];
for (var k = 0; k < fragments.length - 1; ++k) {
fragments[k] && node.parentNode.insertBefore(document.createTextNode(fragments[k]),node);
node.parentNode.insertBefore(replacement.cloneNode(true), node);
}
});
});
}
function replNodes() {
toArray(document.getElementsByClassName("id")).forEach(function(node){
if (["var", "variable", "keyword", "notation", "definition", "inductive"].indexOf(node.getAttribute("type"))>=0){
var text = node.textContent;
var replText = replace(text);
if(text != replText) {
node.setAttribute("repl", replText);
node.setAttribute("title", text);
var hidden = document.createElement("span");
hidden.setAttribute("class", "hidden");
while (node.firstChild) {
hidden.appendChild(node.firstChild);
}
node.appendChild(hidden);
}
}
});
}
function isVernacStart(l, t){
t = t.trim();
for(var s of l){
if (t == s || t.startsWith(s+" ") || t.startsWith(s+".")){
return true;
}
}
return false;
}
function isProofStart(n){
return isVernacStart(["Proof"], n.textContent) ||
(isVernacStart(["Next"], n.textContent) && isVernacStart(["Obligation"], n.nextSibling.nextSibling.textContent));
}
function isProofEnd(s){
return isVernacStart(["Qed", "Admitted", "Defined", "Abort"], s);
}
function proofStatus(){
var proofs = toArray(document.getElementsByClassName("proof"));
if(proofs.length) {
for(var proof of proofs) {
if (proof.getAttribute("show") === "false") {
return "some-hidden";
}
}
return "all-shown";
}
else {
return "no-proofs";
}
}
function updateView(){
document.getElementById("toggle-proofs").setAttribute("proof-status", proofStatus());
}
function foldProofs() {
var hasCommands = true;
var nodes = document.getElementsByClassName("command");
if(nodes.length == 0) {
hasCommands = false;
console.log("no command tags found")
nodes = document.getElementsByClassName("id");
}
toArray(nodes).forEach(function(node){
if(isProofStart(node)) {
var proof = document.createElement("span");
proof.setAttribute("class", "proof");
node.parentNode.insertBefore(proof, node);
if(proof.previousSibling.nodeType === Node.TEXT_NODE)
proof.appendChild(proof.previousSibling);
while(node && !isProofEnd(node.textContent)) {
proof.appendChild(node);
node = proof.nextSibling;
}
if (proof.nextSibling) proof.appendChild(proof.nextSibling); // the Qed
if (!hasCommands && proof.nextSibling) proof.appendChild(proof.nextSibling); // the dot after the Qed
proof.addEventListener("click", function(proof){return function(e){
if (e.target.parentNode.tagName.toLowerCase() === "a")
return;
proof.setAttribute("show", proof.getAttribute("show") === "true" ? "false" : "true");
proof.setAttribute("animate", "");
updateView();
};}(proof));
proof.setAttribute("show", "false");
}
});
}
function toggleProofs(){
var someProofsHidden = proofStatus() === "some-hidden";
toArray(document.getElementsByClassName("proof")).forEach(function(proof){
proof.setAttribute("show", someProofsHidden);
proof.setAttribute("animate", "");
});
updateView();
}
function repairDom(){
// pull whitespace out of command
toArray(document.getElementsByClassName("command")).forEach(function(node){
while(node.firstChild && node.firstChild.textContent.trim() == ""){
console.log("try move");
node.parentNode.insertBefore(node.firstChild, node);
}
});
toArray(document.getElementsByClassName("id")).forEach(function(node){
node.setAttribute("type", node.getAttribute("title"));
});
toArray(document.getElementsByClassName("idref")).forEach(function(ref){
toArray(ref.childNodes).forEach(function(child){
if (["var", "variable"].indexOf(child.getAttribute("type")) > -1)
ref.removeAttribute("href");
});
});
}
function fixTitle(){
var url = "/" + window.location.pathname;
var basename = url.substring(url.lastIndexOf('/')+1, url.lastIndexOf('.'));
if (basename === "toc") {document.title = "Table of Contents";}
else if (basename === "indexpage") {document.title = "Index";}
else {document.title = basename;}
}
function postprocess(){
repairDom();
replInTextNodes()
replNodes();
foldProofs();
document.getElementById("toggle-proofs").addEventListener("click", toggleProofs);
updateView();
}
fixTitle();
document.addEventListener('DOMContentLoaded', postprocess);
coqdocjs.toggleProofs = toggleProofs;
})();
aac-tactics-8.18.0/resources/index.html 0000644 0001750 0001750 00000006373 14463022056 017426 0 ustar jpuydt jpuydt
AAC Tactics
About
Welcome to the AAC Tactics project website! This project is part of coq-community.
This Coq plugin provides tactics for rewriting and proving universally quantified equations modulo associativity and commutativity of some operator, with idempotent commutative operators enabling additional simplifications. The tactics can be applied for custom operators by registering the operators and their properties as type class instances. Instances for many commonly used operators, such as for binary integer arithmetic and booleans, are provided with the plugin.
This is an open source project, licensed under the GNU Lesser General Public License v3.0 or later.
Get the code
The current stable release of AAC Tactics can be downloaded from GitHub.
Documentation
Authors
- Thomas Braibant
- Damien Pous
- Fabian Kunze
aac-tactics-8.18.0/resources/coqdocjs.css 0000644 0001750 0001750 00000006470 14463022056 017746 0 ustar jpuydt jpuydt /* replace unicode */
.id[repl] .hidden {
font-size: 0;
}
.id[repl]:before{
content: attr(repl);
}
/* folding proofs */
@keyframes show-proof {
0% {
max-height: 1.2em;
opacity: 1;
}
99% {
max-height: 1000em;
}
100%{
}
}
@keyframes hide-proof {
from {
visibility: visible;
max-height: 10em;
opacity: 1;
}
to {
max-height: 1.2em;
}
}
.proof {
cursor: pointer;
}
.proof * {
cursor: pointer;
}
.proof {
overflow: hidden;
position: relative;
transition: opacity 1s;
display: inline-block;
}
.proof[show="false"] {
max-height: 1.2em;
visibility: visible;
opacity: 0.3;
}
.proof[show="false"][animate] {
animation-name: hide-proof;
animation-duration: 0.25s;
}
.proof[show="true"] {
animation-name: show-proof;
animation-duration: 10s;
}
.proof[show="true"]:before {
content: "\25BC"; /* arrow down */
}
.proof[show="false"]:before {
content: "\25B6"; /* arrow right */
}
.proof[show="false"]:hover {
visibility: visible;
opacity: 0.5;
}
#toggle-proofs[proof-status="no-proofs"] {
display: none;
}
#toggle-proofs[proof-status="some-hidden"]:before {
content: "Show Proofs";
}
#toggle-proofs[proof-status="all-shown"]:before {
content: "Hide Proofs";
}
/* page layout */
html, body {
height: 100%;
margin:0;
padding:0;
}
@media only screen { /* no div with internal scrolling to allow printing of whole content */
body {
display: flex;
flex-direction: column
}
#content {
flex: 1;
overflow: auto;
display: flex;
flex-direction: column;
}
}
#content:focus {
outline: none; /* prevent glow in OS X */
}
#main {
display: block;
padding: 16px;
padding-top: 1em;
padding-bottom: 2em;
margin-left: auto;
margin-right: auto;
max-width: 60em;
flex: 1 0 auto;
}
.libtitle {
display: none;
}
/* header */
#header {
width:100%;
padding: 0;
margin: 0;
display: flex;
align-items: center;
background-color: rgb(21,57,105);
color: white;
font-weight: bold;
overflow: hidden;
}
.button {
cursor: pointer;
}
#header * {
text-decoration: none;
vertical-align: middle;
margin-left: 15px;
margin-right: 15px;
}
#header > .right, #header > .left {
display: flex;
flex: 1;
align-items: center;
}
#header > .left {
text-align: left;
}
#header > .right {
flex-direction: row-reverse;
}
#header a, #header .button {
color: white;
box-sizing: border-box;
}
#header a {
border-radius: 0;
padding: 0.2em;
}
#header .button {
background-color: rgb(63, 103, 156);
border-radius: 1em;
padding-left: 0.5em;
padding-right: 0.5em;
margin: 0.2em;
}
#header a:hover, #header .button:hover {
background-color: rgb(181, 213, 255);
color: black;
}
#header h1 { padding: 0;
margin: 0;}
/* footer */
#footer {
text-align: center;
opacity: 0.5;
font-size: 75%;
}
/* hyperlinks */
@keyframes highlight {
50%{
background-color: black;
}
}
:target * {
animation-name: highlight;
animation-duration: 1s;
}
a[name]:empty {
float: right;
}
/* Proviola */
div.code {
width: auto;
float: none;
}
div.goal {
position: fixed;
left: 75%;
width: 25%;
top: 3em;
}
div.doc {
clear: both;
}
span.command:hover {
background-color: inherit;
}
aac-tactics-8.18.0/resources/index.md 0000644 0001750 0001750 00000004470 14463022056 017056 0 ustar jpuydt jpuydt ---
title: AAC Tactics
lang: en
header-includes:
- |
---
## About
Welcome to the AAC Tactics project website! This project is part of [coq-community](https://github.com/coq-community/manifesto).
This Coq plugin provides tactics for rewriting and proving universally
quantified equations modulo associativity and commutativity of some operator,
with idempotent commutative operators enabling additional simplifications.
The tactics can be applied for custom operators by registering the operators and
their properties as type class instances. Instances for many commonly used operators,
such as for binary integer arithmetic and booleans, are provided with the plugin.
This is an open source project, licensed under the GNU Lesser General Public License v3.0 or later.
## Get the code
The current stable release of AAC Tactics can be [downloaded from GitHub](https://github.com/coq-community/aac-tactics/releases).
## Documentation
- [paper on initial AAC Tactics version](https://arxiv.org/abs/1106.4448)
- [latest coqdoc documentation](https://coq-community.org/aac-tactics/docs/coqdoc/toc.html)
- [latest ocamldoc documentation](https://coq-community.org/aac-tactics/docs/ocamldoc/index.html)
## Help and contact
- Report issues on [GitHub](https://github.com/coq-community/aac-tactics/issues)
- Chat with us on [Zulip](https://coq.zulipchat.com/#narrow/stream/237663-coq-community-devs.20.26.20users)
- Discuss with us on Coq's [Discourse](https://coq.discourse.group) forum
## Authors
- Thomas Braibant
- Damien Pous
- Fabian Kunze
aac-tactics-8.18.0/resources/coqdoc.css 0000644 0001750 0001750 00000006134 14463022056 017406 0 ustar jpuydt jpuydt @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700);
body{
font-family: 'Open Sans', sans-serif;
font-size: 14px;
color: #2D2D2D
}
a {
text-decoration: none;
border-radius: 3px;
padding-left: 3px;
padding-right: 3px;
margin-left: -3px;
margin-right: -3px;
color: inherit;
font-weight: bold;
}
#main .code a, #main .inlinecode a, #toc a {
font-weight: inherit;
}
a[href]:hover, [clickable]:hover{
background-color: rgba(0,0,0,0.1);
cursor: pointer;
}
h, h1, h2, h3, h4, h5 {
line-height: 1;
color: black;
text-rendering: optimizeLegibility;
font-weight: normal;
letter-spacing: 0.1em;
text-align: left;
}
div + br {
display: none;
}
div:empty{ display: none;}
#main h1 {
font-size: 2em;
}
#main h2 {
font-size: 1.667rem;
}
#main h3 {
font-size: 1.333em;
}
#main h4, #main h5, #main h6 {
font-size: 1em;
}
#toc h2 {
padding-bottom: 0;
}
#main .doc {
margin: 0;
text-align: justify;
}
.inlinecode, .code, #main pre {
font-family: monospace;
}
.code > br:first-child {
display: none;
}
.doc + .code{
margin-top:0.5em;
}
.block{
display: block;
margin-top: 5px;
margin-bottom: 5px;
padding: 10px;
text-align: center;
}
.block img{
margin: 15px;
}
table.infrule {
border: 0px;
margin-left: 50px;
margin-top: 10px;
margin-bottom: 10px;
}
td.infrule {
font-family: "Droid Sans Mono", "DejaVu Sans Mono", monospace;
text-align: center;
padding: 0;
line-height: 1;
}
tr.infrulemiddle hr {
margin: 1px 0 1px 0;
}
.infrulenamecol {
color: rgb(60%,60%,60%);
padding-left: 1em;
padding-bottom: 0.1em
}
.id[type="constructor"], .id[type="projection"], .id[type="method"],
.id[title="constructor"], .id[title="projection"], .id[title="method"] {
color: #A30E16;
}
.id[type="var"], .id[type="variable"],
.id[title="var"], .id[title="variable"] {
color: inherit;
}
.id[type="definition"], .id[type="record"], .id[type="class"], .id[type="instance"], .id[type="inductive"], .id[type="library"],
.id[title="definition"], .id[title="record"], .id[title="class"], .id[title="instance"], .id[title="inductive"], .id[title="library"] {
color: #A6650F;
}
.id[type="lemma"],
.id[title="lemma"]{
color: #188B0C;
}
.id[type="keyword"], .id[type="notation"], .id[type="abbreviation"],
.id[title="keyword"], .id[title="notation"], .id[title="abbreviation"]{
color : #2874AE;
}
.comment {
color: #808080;
}
/* TOC */
#toc h2{
letter-spacing: 0;
font-size: 1.333em;
}
/* Index */
#index {
margin: 0;
padding: 0;
width: 100%;
}
#index #frontispiece {
margin: 1em auto;
padding: 1em;
width: 60%;
}
.booktitle { font-size : 140% }
.authors { font-size : 90%;
line-height: 115%; }
.moreauthors { font-size : 60% }
#index #entrance {
text-align: center;
}
#index #entrance .spacer {
margin: 0 30px 0 30px;
}
ul.doclist {
margin-top: 0em;
margin-bottom: 0em;
}
#toc > * {
clear: both;
}
#toc > a {
display: block;
float: left;
margin-top: 1em;
}
#toc a h2{
display: inline;
}
aac-tactics-8.18.0/resources/footer.html 0000644 0001750 0001750 00000000412 14463022056 017601 0 ustar jpuydt jpuydt