├── .gitattributes ├── .github ├── coq.json ├── dependabot.yml └── workflows │ ├── coq-alpine.yml │ ├── coq-docker.yml │ ├── coq-opam-package.yml │ └── dependabot-automerge.yml ├── .gitignore ├── .gitmodules ├── .mailmap ├── AUTHORS ├── CONTRIBUTORS ├── COPYRIGHT ├── LICENSE-APACHE ├── LICENSE-BSD-1 ├── LICENSE-MIT ├── Makefile ├── Makefile.local ├── Makefile.local-late ├── Makefile.local.common ├── README.md ├── _CoqProject.in ├── etc ├── DepsToDot.hs ├── author-blacklist ├── ci │ ├── describe-system-config.sh │ ├── github-actions-display-per-line-timing.sh │ ├── github-actions-make.sh │ └── sudo-apt-get-update.sh ├── governor.sh ├── hyperthreading.sh ├── machine-extended.sh ├── machine.sh └── turboboost.sh ├── rewriting-extended.md └── src └── Rewriter ├── Demo.v ├── Language ├── IdentifiersBasicGenerate.v ├── IdentifiersBasicLibrary.v ├── IdentifiersGenerate.v ├── IdentifiersGenerateProofs.v ├── IdentifiersLibrary.v ├── IdentifiersLibraryProofs.v ├── Inversion.v ├── Language.v ├── Pre.v ├── PreCommon.v ├── PreLemmas.v ├── Reify.v ├── UnderLets.v ├── UnderLetsCacheProofs.v ├── UnderLetsProofs.v └── Wf.v ├── Rewriter ├── AllTactics.v ├── Examples.v ├── Examples │ ├── PerfTesting │ │ ├── Harness.v │ │ ├── LiftLetsMap.v │ │ ├── ListRectInstances.v │ │ ├── Makefile.characters │ │ ├── Makefile.coq-versions │ │ ├── Makefile.coq-versions-files │ │ ├── Makefile.coq-versions-lite │ │ ├── Makefile.coq.conf │ │ ├── Makefile.coq.local │ │ ├── Makefile.generated-files │ │ ├── Makefile.timing │ │ ├── Makefile.variables │ │ ├── Makefile.variables.kinds │ │ ├── Plus0Tree.v │ │ ├── Sample.v │ │ ├── Settings.v │ │ ├── SieveOfEratosthenes.v │ │ ├── Template.v.in │ │ ├── UnderLetsPlus0.v │ │ ├── aggregate.py │ │ ├── csv_to_txt.py │ │ └── txt_to_gnuplot.py │ └── PrefixSums.v ├── InterpProofs.v ├── ProofsCommon.v ├── ProofsCommonTactics.v ├── Reify.v ├── Rewriter.v └── Wf.v └── Util ├── Bool.v ├── Bool ├── Equality.v └── Reflect.v ├── CPSNotations.v ├── Comparison.v ├── Decidable.v ├── Equality.v ├── FMapPositive └── Equality.v ├── FixCoqMistakes.v ├── GlobalSettings.v ├── HProp.v ├── IffT.v ├── InductiveHList.v ├── Isomorphism.v ├── LetIn.v ├── ListUtil.v ├── ListUtil ├── Forall.v └── SetoidList.v ├── Logic ├── ExistsEqAnd.v └── ProdForall.v ├── MSetPositive ├── Equality.v └── Facts.v ├── NatUtil.v ├── Notations.v ├── Option.v ├── OptionList.v ├── Pointed.v ├── PrimitiveHList.v ├── PrimitiveProd.v ├── PrimitiveSigma.v ├── Prod.v ├── Sigma.v ├── Sigma └── Related.v ├── Strings ├── Ascii.v ├── Decimal.v ├── Parse │ └── Common.v ├── ParseArithmetic.v └── String.v ├── Sum.v ├── Tactics ├── AssertSucceedsPreserveError.v ├── BreakMatch.v ├── CPSId.v ├── CacheTerm.v ├── ClearFree.v ├── ConstrFail.v ├── Contains.v ├── DebugPrint.v ├── DestructHead.v ├── DestructHyps.v ├── DoWithHyp.v ├── EvarNormalize.v ├── FindHyp.v ├── GetGoal.v ├── Head.v ├── HeadUnderBinders.v ├── Not.v ├── PrintContext.v ├── PrintGoal.v ├── RewriteHyp.v ├── RunTacticAsConstr.v ├── SetEvars.v ├── SetoidSubst.v ├── SpecializeAllWays.v ├── SpecializeBy.v ├── SplitInContext.v ├── SubstEvars.v ├── Test.v ├── TransparentAssert.v ├── UniquePose.v └── WarnIfGoalsRemain.v ├── Tactics2 ├── Array.v ├── Char.v ├── Constr.v.v815 ├── Constr.v.v816 ├── Constr.v.v817 ├── Constr.v.v818 ├── Constr.v.v819 ├── Constr.v.v820 ├── Constr.v.v821 ├── Constr.v.v90 ├── Constr.v.v91 ├── Constr.v.v92 ├── Constr │ └── Unsafe │ │ └── MakeAbbreviations.v ├── DecomposeLambda.v ├── DestApp.v ├── DestCase.v.v815 ├── DestCase.v.v816 ├── DestCase.v.v817 ├── DestCase.v.v818 ├── DestCase.v.v819 ├── DestCase.v.v820 ├── DestCase.v.v821 ├── DestCase.v.v90 ├── DestCase.v.v91 ├── DestCase.v.v92 ├── DestCast.v ├── DestCoFix.v ├── DestConstant.v ├── DestConstructor.v ├── DestEvar.v ├── DestFix.v ├── DestInd.v ├── DestLambda.v ├── DestLetIn.v ├── DestMeta.v ├── DestProd.v ├── DestProj.v.v815 ├── DestProj.v.v816 ├── DestProj.v.v817 ├── DestProj.v.v818 ├── DestProj.v.v819 ├── DestProj.v.v820 ├── DestProj.v.v821 ├── DestProj.v.v90 ├── DestProj.v.v91 ├── DestProj.v.v92 ├── DestRel.v ├── DestSort.v ├── DestVar.v ├── FixNotationsForPerformance.v ├── Head.v ├── HeadReference.v ├── Ident.v ├── InFreshContext.v ├── InstantiateEvar.v ├── Iterate.v ├── List.v ├── Ltac1.v ├── Message.v ├── Notations.v ├── Option.v ├── Proj.v.v815 ├── Proj.v.v816 ├── Proj.v.v817 ├── Proj.v.v818 ├── Proj.v.v819 ├── Proj.v.v820 ├── Proj.v.v821 ├── Proj.v.v90 ├── Proj.v.v91 ├── Proj.v.v92 ├── ReplaceByPattern.v └── String.v ├── TypeList.v └── plugins ├── Ltac2Extra.v.v815 ├── Ltac2Extra.v.v816 ├── Ltac2Extra.v.v817 ├── Ltac2Extra.v.v818 ├── Ltac2Extra.v.v819 ├── Ltac2Extra.v.v820 ├── Ltac2Extra.v.v821 ├── Ltac2Extra.v.v90 ├── Ltac2Extra.v.v91 ├── Ltac2Extra.v.v92 ├── META.coq-rewriter ├── README.md ├── RewriterBuild.v.v815 ├── RewriterBuild.v.v816 ├── RewriterBuild.v.v817 ├── RewriterBuild.v.v818 ├── RewriterBuild.v.v819 ├── RewriterBuild.v.v820 ├── RewriterBuild.v.v821 ├── RewriterBuild.v.v90 ├── RewriterBuild.v.v91 ├── RewriterBuild.v.v92 ├── RewriterBuildRegistry.v.v815 ├── RewriterBuildRegistry.v.v816 ├── RewriterBuildRegistry.v.v817 ├── RewriterBuildRegistry.v.v818 ├── RewriterBuildRegistry.v.v819 ├── RewriterBuildRegistry.v.v820 ├── RewriterBuildRegistry.v.v821 ├── RewriterBuildRegistry.v.v90 ├── RewriterBuildRegistry.v.v91 ├── RewriterBuildRegistry.v.v92 ├── RewriterBuildRegistryImports.v ├── StrategyTactic.v.v815 ├── StrategyTactic.v.v816 ├── StrategyTactic.v.v817 ├── StrategyTactic.v.v818 ├── StrategyTactic.v.v819 ├── StrategyTactic.v.v820 ├── StrategyTactic.v.v821 ├── StrategyTactic.v.v90 ├── StrategyTactic.v.v91 ├── StrategyTactic.v.v92 ├── definition_by_tactic.ml.v815 ├── definition_by_tactic.ml.v816 ├── definition_by_tactic.ml.v817 ├── definition_by_tactic.ml.v818 ├── definition_by_tactic.ml.v819 ├── definition_by_tactic.ml.v820 ├── definition_by_tactic.ml.v821 ├── definition_by_tactic.ml.v90 ├── definition_by_tactic.ml.v91 ├── definition_by_tactic.ml.v92 ├── definition_by_tactic.mli.v815 ├── definition_by_tactic.mli.v816 ├── definition_by_tactic.mli.v817 ├── definition_by_tactic.mli.v818 ├── definition_by_tactic.mli.v819 ├── definition_by_tactic.mli.v820 ├── definition_by_tactic.mli.v821 ├── definition_by_tactic.mli.v90 ├── definition_by_tactic.mli.v91 ├── definition_by_tactic.mli.v92 ├── definition_by_tactic_plugin.mlg.v815 ├── definition_by_tactic_plugin.mlg.v816 ├── definition_by_tactic_plugin.mlg.v817 ├── definition_by_tactic_plugin.mlg.v818 ├── definition_by_tactic_plugin.mlg.v819 ├── definition_by_tactic_plugin.mlg.v820 ├── definition_by_tactic_plugin.mlg.v821 ├── definition_by_tactic_plugin.mlg.v90 ├── definition_by_tactic_plugin.mlg.v91 ├── definition_by_tactic_plugin.mlg.v92 ├── definition_by_tactic_plugin.mllib.v815 ├── definition_by_tactic_plugin.mllib.v816 ├── definition_by_tactic_plugin.mllib.v817 ├── definition_by_tactic_plugin.mllib.v818 ├── definition_by_tactic_plugin.mllib.v819 ├── definition_by_tactic_plugin.mllib.v820 ├── definition_by_tactic_plugin.mllib.v821 ├── definition_by_tactic_plugin.mllib.v90 ├── definition_by_tactic_plugin.mllib.v91 ├── definition_by_tactic_plugin.mllib.v92 ├── inductive_from_elim.ml.v815 ├── inductive_from_elim.ml.v816 ├── inductive_from_elim.ml.v817 ├── inductive_from_elim.ml.v818 ├── inductive_from_elim.ml.v819 ├── inductive_from_elim.ml.v820 ├── inductive_from_elim.ml.v821 ├── inductive_from_elim.ml.v90 ├── inductive_from_elim.ml.v91 ├── inductive_from_elim.ml.v92 ├── inductive_from_elim.mli.v815 ├── inductive_from_elim.mli.v816 ├── inductive_from_elim.mli.v817 ├── inductive_from_elim.mli.v818 ├── inductive_from_elim.mli.v819 ├── inductive_from_elim.mli.v820 ├── inductive_from_elim.mli.v821 ├── inductive_from_elim.mli.v90 ├── inductive_from_elim.mli.v91 ├── inductive_from_elim.mli.v92 ├── inductive_from_elim_plugin.mlg.v815 ├── inductive_from_elim_plugin.mlg.v816 ├── inductive_from_elim_plugin.mlg.v817 ├── inductive_from_elim_plugin.mlg.v818 ├── inductive_from_elim_plugin.mlg.v819 ├── inductive_from_elim_plugin.mlg.v820 ├── inductive_from_elim_plugin.mlg.v821 ├── inductive_from_elim_plugin.mlg.v90 ├── inductive_from_elim_plugin.mlg.v91 ├── inductive_from_elim_plugin.mlg.v92 ├── inductive_from_elim_plugin.mllib.v815 ├── inductive_from_elim_plugin.mllib.v816 ├── inductive_from_elim_plugin.mllib.v817 ├── inductive_from_elim_plugin.mllib.v818 ├── inductive_from_elim_plugin.mllib.v819 ├── inductive_from_elim_plugin.mllib.v820 ├── inductive_from_elim_plugin.mllib.v821 ├── inductive_from_elim_plugin.mllib.v90 ├── inductive_from_elim_plugin.mllib.v91 ├── inductive_from_elim_plugin.mllib.v92 ├── ltac2_extra.ml.v815 ├── ltac2_extra.ml.v816 ├── ltac2_extra.ml.v817 ├── ltac2_extra.ml.v818 ├── ltac2_extra.ml.v819 ├── ltac2_extra.ml.v820 ├── ltac2_extra.ml.v821 ├── ltac2_extra.ml.v90 ├── ltac2_extra.ml.v91 ├── ltac2_extra.ml.v92 ├── ltac2_extra.mli.v815 ├── ltac2_extra.mli.v816 ├── ltac2_extra.mli.v817 ├── ltac2_extra.mli.v818 ├── ltac2_extra.mli.v819 ├── ltac2_extra.mli.v820 ├── ltac2_extra.mli.v821 ├── ltac2_extra.mli.v90 ├── ltac2_extra.mli.v91 ├── ltac2_extra.mli.v92 ├── ltac2_extra_plugin.mlg.v815 ├── ltac2_extra_plugin.mlg.v816 ├── ltac2_extra_plugin.mlg.v817 ├── ltac2_extra_plugin.mlg.v818 ├── ltac2_extra_plugin.mlg.v819 ├── ltac2_extra_plugin.mlg.v820 ├── ltac2_extra_plugin.mlg.v821 ├── ltac2_extra_plugin.mlg.v90 ├── ltac2_extra_plugin.mlg.v91 ├── ltac2_extra_plugin.mlg.v92 ├── ltac2_extra_plugin.mllib.v815 ├── ltac2_extra_plugin.mllib.v816 ├── ltac2_extra_plugin.mllib.v817 ├── ltac2_extra_plugin.mllib.v818 ├── ltac2_extra_plugin.mllib.v819 ├── ltac2_extra_plugin.mllib.v820 ├── ltac2_extra_plugin.mllib.v821 ├── ltac2_extra_plugin.mllib.v90 ├── ltac2_extra_plugin.mllib.v91 ├── ltac2_extra_plugin.mllib.v92 ├── rewriter_build.ml.v815 ├── rewriter_build.ml.v816 ├── rewriter_build.ml.v817 ├── rewriter_build.ml.v818 ├── rewriter_build.ml.v819 ├── rewriter_build.ml.v820 ├── rewriter_build.ml.v821 ├── rewriter_build.ml.v90 ├── rewriter_build.ml.v91 ├── rewriter_build.ml.v92 ├── rewriter_build.mli.v815 ├── rewriter_build.mli.v816 ├── rewriter_build.mli.v817 ├── rewriter_build.mli.v818 ├── rewriter_build.mli.v819 ├── rewriter_build.mli.v820 ├── rewriter_build.mli.v821 ├── rewriter_build.mli.v90 ├── rewriter_build.mli.v91 ├── rewriter_build.mli.v92 ├── rewriter_build_plugin.mlg.v815 ├── rewriter_build_plugin.mlg.v816 ├── rewriter_build_plugin.mlg.v817 ├── rewriter_build_plugin.mlg.v818 ├── rewriter_build_plugin.mlg.v819 ├── rewriter_build_plugin.mlg.v820 ├── rewriter_build_plugin.mlg.v821 ├── rewriter_build_plugin.mlg.v90 ├── rewriter_build_plugin.mlg.v91 ├── rewriter_build_plugin.mlg.v92 ├── rewriter_build_plugin.mllib.v815 ├── rewriter_build_plugin.mllib.v816 ├── rewriter_build_plugin.mllib.v817 ├── rewriter_build_plugin.mllib.v818 ├── rewriter_build_plugin.mllib.v819 ├── rewriter_build_plugin.mllib.v820 ├── rewriter_build_plugin.mllib.v821 ├── rewriter_build_plugin.mllib.v90 ├── rewriter_build_plugin.mllib.v91 ├── rewriter_build_plugin.mllib.v92 ├── strategy_tactic.ml.v815 ├── strategy_tactic.ml.v816 ├── strategy_tactic.ml.v817 ├── strategy_tactic.ml.v818 ├── strategy_tactic.ml.v819 ├── strategy_tactic.ml.v820 ├── strategy_tactic.ml.v821 ├── strategy_tactic.ml.v90 ├── strategy_tactic.ml.v91 ├── strategy_tactic.ml.v92 ├── strategy_tactic.mli.v815 ├── strategy_tactic.mli.v816 ├── strategy_tactic.mli.v817 ├── strategy_tactic.mli.v818 ├── strategy_tactic.mli.v819 ├── strategy_tactic.mli.v820 ├── strategy_tactic.mli.v821 ├── strategy_tactic.mli.v90 ├── strategy_tactic.mli.v91 ├── strategy_tactic.mli.v92 ├── strategy_tactic_plugin.mlg.v815 ├── strategy_tactic_plugin.mlg.v816 ├── strategy_tactic_plugin.mlg.v817 ├── strategy_tactic_plugin.mlg.v818 ├── strategy_tactic_plugin.mlg.v819 ├── strategy_tactic_plugin.mlg.v820 ├── strategy_tactic_plugin.mlg.v821 ├── strategy_tactic_plugin.mlg.v90 ├── strategy_tactic_plugin.mlg.v91 ├── strategy_tactic_plugin.mlg.v92 ├── strategy_tactic_plugin.mllib.v815 ├── strategy_tactic_plugin.mllib.v816 ├── strategy_tactic_plugin.mllib.v817 ├── strategy_tactic_plugin.mllib.v818 ├── strategy_tactic_plugin.mllib.v819 ├── strategy_tactic_plugin.mllib.v820 ├── strategy_tactic_plugin.mllib.v821 ├── strategy_tactic_plugin.mllib.v90 ├── strategy_tactic_plugin.mllib.v91 └── strategy_tactic_plugin.mllib.v92 /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.sh text eol=lf 4 | -------------------------------------------------------------------------------- /.github/coq.json: -------------------------------------------------------------------------------- 1 | { 2 | "problemMatcher": [ 3 | { 4 | "owner": "coq-problem-matcher", 5 | "pattern": [ 6 | { 7 | "regexp": "^File \"([^ \"]+)\", line (\\d+), characters (\\d+-\\d+):", 8 | "file": 1, 9 | "line": 2, 10 | "column": 3 11 | }, 12 | { 13 | "regexp": "^(Warning|Error):\\s*(.*?)(?:\\s*\\[(.*)\\])?$", 14 | "severity": 1, 15 | "message": 2, 16 | "code": 3 17 | } 18 | ] 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Set update schedule for GitHub Actions 2 | 3 | version: 2 4 | updates: 5 | 6 | - package-ecosystem: "github-actions" 7 | directory: "/" 8 | schedule: 9 | # Check for updates to GitHub Actions every weekday 10 | interval: "daily" 11 | time: "07:00" 12 | 13 | - package-ecosystem: "gitsubmodule" 14 | directory: "/" 15 | schedule: 16 | interval: "daily" 17 | time: "07:00" 18 | labels: 19 | - "submodules" 20 | -------------------------------------------------------------------------------- /.github/workflows/dependabot-automerge.yml: -------------------------------------------------------------------------------- 1 | name: Dependabot Automerge 2 | on: pull_request 3 | 4 | permissions: 5 | contents: write 6 | 7 | jobs: 8 | dependabot-automerge: 9 | runs-on: ubuntu-latest 10 | if: ${{ github.actor == 'dependabot[bot]' }} 11 | env: 12 | PR_URL: ${{github.event.pull_request.html_url}} 13 | GH_TOKEN: ${{ github.token }} 14 | steps: 15 | #- name: approve 16 | # run: gh pr review --approve "$PR_URL" 17 | - name: merge 18 | run: gh pr merge --auto --squash --delete-branch "$PR_URL" 19 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "etc/coq-scripts"] 2 | path = etc/coq-scripts 3 | url = https://github.com/JasonGross/coq-scripts.git 4 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of rewriter authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as one of 6 | # Organization's name 7 | # Individual's name 8 | # Individual's name 9 | # See CONTRIBUTORS for the meaning of multiple email addresses. 10 | 11 | # Please keep the list sorted. 12 | 13 | Google Inc. 14 | Massachusetts Institute of Technology 15 | -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This is the official list of people have contributed code to the 2 | # rewriter repository. 3 | # 4 | # The AUTHORS file lists the copyright holders; this file 5 | # lists people. For example, Google employees are listed here 6 | # but not in AUTHORS, because Google holds the copyright. 7 | # 8 | # When adding J Random Contributor's name to this file, 9 | # either J's name or J's organization's name should be 10 | # added to the AUTHORS file, depending on who holds the copyright. 11 | # 12 | # Names should be added to this file like so: 13 | # Individual's name 14 | # Individual's name 15 | # 16 | # An entry with multiple email addresses specifies that the 17 | # first address should be used in the submit logs and 18 | # that the other addresses should be recognized as the 19 | # same person. 20 | 21 | # Please keep the list sorted. 22 | 23 | Adam Chlipala 24 | Andres Erbsen 25 | Jade Philipoom 26 | Jason Gross 27 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | SPDX-License-Identifier: MIT OR Apache-2.0 OR BSD-1-Clause 2 | 3 | The Rewriter is licensed under the MIT License or 4 | , the Apache License, Version 2.0 5 | or , or 6 | the BSD 1-Clause License or 7 | , at your option. 8 | -------------------------------------------------------------------------------- /LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | The Apache License, Version 2.0 (Apache-2.0) 2 | 3 | Copyright 2015-2020 the Rewriter authors (see the AUTHORS file) 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | -------------------------------------------------------------------------------- /LICENSE-BSD-1: -------------------------------------------------------------------------------- 1 | The BSD 1-Clause License (BSD-1-Clause) 2 | 3 | Copyright (c) 2015-2020 the Rewriter authors (see the AUTHORS file) 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | THIS SOFTWARE IS PROVIDED BY the Rewriter authors "AS IS" 14 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, 17 | Inc. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 21 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 22 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-2020 the Rewriter authors (see the AUTHORS file). 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile.local: -------------------------------------------------------------------------------- 1 | PROFILE?= 2 | OTHERFLAGS += -w -notation-overridden,-unusable-identifier 3 | ifneq ($(PROFILE),) 4 | OTHERFLAGS += -profile-ltac 5 | endif 6 | 7 | include src/Rewriter/Rewriter/Examples/PerfTesting/Makefile.coq.local 8 | -------------------------------------------------------------------------------- /Makefile.local-late: -------------------------------------------------------------------------------- 1 | include Makefile.local.common 2 | 3 | .merlin: $(COQ_VERSION_FILE) 4 | 5 | $(VOFILES) $(CMOFILES) $(CMXFILES) $(OFILES) $(CMAFILES) $(CMIFILES) $(CMXSFILES): $(COQ_VERSION_FILE) 6 | 7 | $(COMPATIBILITY_FILES) : % : %$(EXPECTED_EXT) $(COQ_VERSION_FILE) 8 | $(SHOW)'CP $@{$(EXPECTED_EXT),}' 9 | $(HIDE)cp $< $@ 10 | 11 | # ensure that the ml compat files exist before we call coqdep on the corresponding .v files 12 | $(ALLDFILES): $(COMPATIBILITY_FILES) $(COQ_VERSION_FILE) _CoqProject 13 | 14 | OTHERFLAGS += -w -notation-overridden 15 | ifneq ($(PROFILE),) 16 | OTHERFLAGS += -profile-ltac 17 | endif 18 | 19 | # Kludge around COQBUG(https://github.com/coq/coq/issues/16591) 20 | FINDLIBPKGS += -package coq-core.plugins.ltac2 21 | -------------------------------------------------------------------------------- /etc/author-blacklist: -------------------------------------------------------------------------------- 1 | jasongross9 2 | jadephilipoom 3 | dmz 4 | jgross 5 | rsloan 6 | jadep 7 | andreser 8 | adamc 9 | jagro 10 | varomodt 11 | mit\.edu 12 | Jason 13 | Gross 14 | Jade 15 | Philipoom 16 | Andres 17 | Erbsen 18 | adam.chlipala 19 | Adam Chlipala 20 | Chlipala 21 | csail 22 | mit-plv 23 | fiat-crypto 24 | Rob Sloan 25 | Robert 26 | Sloan 27 | Daniel Ziegler 28 | ashryn 29 | at MIT 30 | Bedrock 31 | bedrock 32 | -------------------------------------------------------------------------------- /etc/ci/describe-system-config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd -- "$( dirname -- "$0" )" 4 | cd ../.. 5 | 6 | if [ ! -z "${SHELL}" ]; then 7 | run() { 8 | "${SHELL}" -c "$*" || true 9 | } 10 | else 11 | run() { 12 | /bin/sh -c "$*" || true 13 | } 14 | fi 15 | 16 | if [ ! -z "$CI" ]; then 17 | group() { 18 | echo "::group::$*" 19 | 2>&1 run "$@" 20 | echo "::endgroup::" 21 | } 22 | else 23 | group() { run "$@"; } 24 | fi 25 | 26 | group lscpu 27 | group uname -a 28 | group lsb_release -a 29 | group ulimit -aH 30 | group ulimit -aS 31 | group cat /etc/os-release 32 | group cat /proc/cpuinfo 33 | group cat /proc/meminfo 34 | group apk info 35 | group dpkg -l 36 | group ghc --version 37 | group ghc -v 38 | group gcc --version 39 | group gcc -v 40 | group opam switch 41 | group opam list 42 | group ocamlc -config 43 | group ocamlc -where 44 | group ocamlfind printconf destdir 45 | group ocamlfind list 46 | group ocamlfind query findlib 47 | group ocamlfind query zarith 48 | group ocamlfind query coq 49 | group ocamlfind query coq-core 50 | group ocamlfind query coq-core.plugins 51 | group ocamlfind query coq-core.plugins.ltac 52 | group "ocamlfind query coq | xargs find" 53 | group coqc --config 54 | group coqc --version 55 | group "true | coqtop" 56 | group etc/machine.sh 57 | group "echo PATH=$PATH" 58 | group "echo SHELL=$SHELL" 59 | -------------------------------------------------------------------------------- /etc/ci/github-actions-display-per-line-timing.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | for i in $(find -name "*.v.timing" | sort); do 4 | echo "::group::$i" 5 | cat "$i" 6 | echo "::endgroup::" 7 | done 8 | -------------------------------------------------------------------------------- /etc/ci/github-actions-make.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -x 4 | 5 | if [ ! -z "${TOUCH}" ]; then 6 | make -j2 -t ${TOUCH} || exit $? 7 | fi 8 | 9 | OUTPUT_SYNC="" 10 | if make -h 2>/dev/null | grep -q output-sync; then 11 | OUTPUT_SYNC="--output-sync" 12 | else 13 | echo "WARNING: make does not support --output-sync" 14 | fi 15 | 16 | reportify=" --errors" 17 | 18 | if [ "$1" == "--warnings" ]; then 19 | reportify+=" $1" 20 | shift 21 | fi 22 | if [ ! -z "${reportify}" ]; then 23 | reportify="COQC='$(pwd)/etc/coq-scripts/github/reportify-coq.sh'${reportify} ${COQBIN}coqc" 24 | fi 25 | 26 | rm -f finished.ok 27 | (make "$@" ${OUTPUT_SYNC} TIMED=1 TIMING=1 "${reportify}" 2>&1 && touch finished.ok) | tee -a time-of-build.log 28 | python "./etc/coq-scripts/timing/make-one-time-file.py" "time-of-build.log" "time-of-build-pretty.log" || exit $? 29 | 30 | git status 31 | git diff 32 | 33 | cat time-of-build-pretty.log 34 | make "$@" TIMED=1 TIMING=1 || exit $? 35 | 36 | if [ ! -z "$(git diff)" ]; then 37 | git submodule foreach --recursive git diff 38 | git submodule foreach --recursive git status 39 | git diff 40 | if [ "${ALLOW_DIFF}" != "1" ]; then 41 | exit 1 42 | fi 43 | fi 44 | -------------------------------------------------------------------------------- /etc/ci/sudo-apt-get-update.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | (sudo apt-get update "$@" 2>&1 || echo 'E: update failed') | tee /tmp/apt.err 4 | ! grep -q '^\(E:\|W: Failed to fetch\)' /tmp/apt.err || exit $? 5 | -------------------------------------------------------------------------------- /etc/governor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | usage() { 5 | generators="$1" 6 | # example: USAGE: ./governor.sh 7 | echo "USAGE: $0 <$(echo "$generators" | tr ' ' '|')>" 8 | exit 111 9 | } 10 | 11 | 12 | for cpu in "/sys/devices/system/cpu/cpu"[0-9]* ; do 13 | if grep -vq '^1$' "$cpu/online" 2>/dev/null; then 14 | continue 15 | fi 16 | if [ ! -e "$cpu/cpufreq/scaling_available_governors" ]; then 17 | continue 18 | fi 19 | generators="$(cat "$cpu/cpufreq/scaling_available_governors")" 20 | if [ "$#" -eq 0 ] || [ -z "$1" ]; then 21 | usage "$generators" 22 | elif (echo -n "$generators" | tr ' ' '\n' | grep -q "^$1\$" 2>/dev/null); then 23 | if grep -vq "^$1\$" "$cpu/cpufreq/scaling_governor" 2>/dev/null; then 24 | echo "$1" > "$cpu/cpufreq/scaling_governor" 25 | fi 26 | else 27 | usage "$generators" 28 | fi 29 | done 30 | -------------------------------------------------------------------------------- /etc/hyperthreading.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | usage() { 5 | echo "USAGE: $0 " ; exit 111 6 | } 7 | 8 | if [ "$#" -eq 0 ]; then 9 | usage 10 | fi 11 | 12 | case $1 in 13 | on) 14 | for f in "/sys/devices/system/cpu/cpu"[0-9]*/online; do 15 | echo 1 > "$f" 16 | done 17 | ;; 18 | off) 19 | cores="" 20 | for cpu in "/sys/devices/system/cpu/cpu"[0-9]* ; do 21 | if grep -vq '^1$' "$cpu/online" 2>/dev/null; then 22 | continue 23 | fi 24 | coreid=$(cat "$cpu/topology/core_id") 25 | if echo "$cores" | grep -- "$coreid" ; then 26 | echo 0 > "$cpu/online" 27 | fi 28 | cores=$(printf "$cores\n$coreid") 29 | done 30 | ;; 31 | *) usage 32 | esac 33 | -------------------------------------------------------------------------------- /etc/machine-extended.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # save a way to get the stderr 4 | exec 3>&2 5 | 6 | # output set -x stuff to stdout 7 | exec 2>&1 8 | 9 | # put all the commands in a subshell so we don't print true at the end 10 | ( 11 | set -x 12 | 13 | # redirect errors to stderr 14 | lscpu 2>&3 15 | uname -a 2>&3 16 | lsb_release -a 2>&3 17 | ) 18 | true # never fail 19 | -------------------------------------------------------------------------------- /etc/machine.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | online_governors() { 5 | FOUND="" 6 | for cpu in "/sys/devices/system/cpu/cpu"[0-9]* ; do 7 | if grep -vq '^1$' "$cpu/online" 2>/dev/null; then 8 | continue 9 | fi 10 | if [ ! -e "$cpu/cpufreq" ]; then 11 | continue 12 | fi 13 | cat "$cpu/cpufreq/scaling_governor" 14 | FOUND=1 15 | done 16 | if [ -z "$FOUND" ]; then 17 | echo "nocpufreq_support" 18 | fi 19 | } 20 | 21 | printf "$(hostname)" 22 | printf - 23 | if ls /sys/devices/system/cpu/cpu[0-9]*/topology/thread_siblings_list >/dev/null 2>/dev/null; then 24 | grep -q '[^0-9]' /sys/devices/system/cpu/cpu[0-9]*/topology/thread_siblings_list && printf ht || printf noht 25 | else 26 | printf unknown_ht 27 | fi 28 | printf - 29 | if [ -f /sys/devices/system/cpu/intel_pstate/no_turbo ]; then 30 | grep -q 1 /sys/devices/system/cpu/intel_pstate/no_turbo && printf notb || printf tb 31 | else 32 | printf notb_support 33 | fi 34 | printf - 35 | if [ -f /sys/class/power_supply/AC/online ]; then 36 | grep -q 1 /sys/class/power_supply/AC/online && printf ac || printf noac 37 | else 38 | printf nops 39 | fi 40 | printf - 41 | printf "$(printf "%s" "$(online_governors | uniq)" | tr '\n' '_')" 42 | printf - 43 | printf "$(gcc -march=native -Q --help=target|grep march | cut -d= -f2 | grep -ow '\S*')" 44 | printf '\n' 45 | -------------------------------------------------------------------------------- /etc/turboboost.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | usage() { 5 | echo "USAGE: $0 " ; exit 111 6 | } 7 | 8 | if [ "$#" -eq 0 ]; then 9 | usage 10 | fi 11 | 12 | case $1 in 13 | on) echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo ;; 14 | off) echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo ;; 15 | *) usage 16 | esac 17 | -------------------------------------------------------------------------------- /src/Rewriter/Language/PreCommon.v: -------------------------------------------------------------------------------- 1 | (** Definitions used in rewrite rules and customizable tactics, which are invoked in the general rewriter framework. *) 2 | Require Import Ltac2.Init. 3 | Require Rewriter.Util.PrimitiveHList. 4 | Require Rewriter.Util.InductiveHList. 5 | Require Import Rewriter.Util.Notations. 6 | 7 | Module Export Pre. 8 | Module ident. 9 | Definition literal {T} (v : T) := v. 10 | Definition eagerly {T} (v : T) := v. 11 | Definition gets_inlined (real_val : bool) {T} (v : T) : bool := real_val. 12 | End ident. 13 | 14 | (** These tactics should operate even on terms with unbound de 15 | Bruijn indices. Although we pass a list containing the types 16 | and natural names of all unbound de Bruijn indices, this list 17 | should ideally be unused, for performance reasons *) 18 | (** Modify this to get more match-to-elim conversion *) 19 | Ltac2 mutable reify_preprocess_extra (ctx_tys : binder list) (term : constr) := term. 20 | Ltac2 mutable reify_ident_preprocess_extra (ctx_tys : binder list) (term : constr) := term. 21 | (** Change this with [Ltac2 Set reify_debug_level ::= 1.] to get 22 | more debugging. *) 23 | Ltac2 mutable reify_debug_level : int := 0. 24 | Ltac2 mutable reify_profile_cbn : bool := false. 25 | 26 | Module ScrapedData. 27 | Local Set Primitive Projections. 28 | Record t := 29 | { 30 | base_type_list_named : InductiveHList.hlist 31 | ; all_ident_named_interped : InductiveHList.hlist 32 | }. 33 | 34 | Definition t_with_args {rewrite_rulesT} (rules_proofs : PrimitiveHList.hlist (@snd bool Prop) rewrite_rulesT) {extraT} (extra : extraT) := t. 35 | Existing Class t_with_args. 36 | End ScrapedData. 37 | End Pre. 38 | -------------------------------------------------------------------------------- /src/Rewriter/Rewriter/Examples/PerfTesting/ListRectInstances.v: -------------------------------------------------------------------------------- 1 | From Coq Require Import List. 2 | From Coq Require Import Morphisms. 3 | From Coq Require Import Setoid. 4 | 5 | Global Instance list_rect_Proper_dep_gen {A P} (RP : forall x : list A, P x -> P x -> Prop) 6 | : Proper (RP nil ==> forall_relation (fun x => forall_relation (fun xs => RP xs ==> RP (cons x xs))) ==> forall_relation RP) (@list_rect A P) | 10. 7 | Proof. 8 | cbv [forall_relation respectful]; intros N N' HN C C' HC ls. 9 | induction ls as [|l ls IHls]; cbn [list_rect]; 10 | repeat first [ apply IHls | apply HC | apply HN | progress intros | reflexivity ]. 11 | Qed. 12 | Global Instance list_rect_Proper_dep {A P} : Proper (eq ==> forall_relation (fun _ => forall_relation (fun _ => forall_relation (fun _ => eq))) ==> forall_relation (fun _ => eq)) (@list_rect A P) | 1. 13 | Proof. 14 | cbv [forall_relation respectful Proper]; intros; eapply (@list_rect_Proper_dep_gen A P (fun _ => eq)); cbv [forall_relation respectful]; intros; subst; eauto. 15 | Qed. 16 | Global Instance list_rect_Proper_gen {A P} R 17 | : Proper (R ==> (eq ==> eq ==> R ==> R) ==> eq ==> R) (@list_rect A (fun _ => P)) | 10. 18 | Proof. repeat intro; subst; apply (@list_rect_Proper_dep_gen A (fun _ => P) (fun _ => R)); cbv [forall_relation respectful] in *; eauto. Qed. 19 | Global Instance list_rect_Proper {A P} : Proper (eq ==> pointwise_relation _ (pointwise_relation _ (pointwise_relation _ eq)) ==> eq ==> eq) (@list_rect A (fun _ => P)). 20 | Proof. repeat intro; subst; apply (@list_rect_Proper_dep A (fun _ => P)); eauto. Qed. 21 | -------------------------------------------------------------------------------- /src/Rewriter/Rewriter/Examples/PerfTesting/Makefile.characters: -------------------------------------------------------------------------------- 1 | OPEN_PAREN:=( 2 | CLOSE_PAREN:=) 3 | EMPTY:= 4 | SPACE:=$(EMPTY) $(EMPTY) 5 | JOINER:=| 6 | -------------------------------------------------------------------------------- /src/Rewriter/Rewriter/Examples/PerfTesting/Makefile.coq-versions: -------------------------------------------------------------------------------- 1 | mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) 2 | PERF_ABS_DIR := $(patsubst %/,%,$(dir $(mkfile_path))) 3 | 4 | include $(PERF_ABS_DIR)/Makefile.coq-versions-lite 5 | include $(PERF_ABS_DIR)/Makefile.coq.conf 6 | 7 | COQ_VERSION_OCAML_VERSION := $(shell "$(COQMF_OCAMLFIND)" opt -version 2>/dev/null) 8 | COQ_VERSION_OCAML_CONFIG_CMD := "$(COQMF_OCAMLFIND)" opt -config # 2>/dev/null 9 | -------------------------------------------------------------------------------- /src/Rewriter/Rewriter/Examples/PerfTesting/Makefile.coq.conf: -------------------------------------------------------------------------------- 1 | ../../../../../Makefile-old.conf -------------------------------------------------------------------------------- /src/Rewriter/Rewriter/Examples/PerfTesting/Makefile.coq.local: -------------------------------------------------------------------------------- 1 | mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) 2 | PERF_ABS_DIR := $(patsubst %/,%,$(dir $(mkfile_path))) 3 | 4 | ifeq ($(EXTERNAL_PERF_DEPENDENCIES),1) 5 | # work around https://github.com/coq/coq/pull/20154#pullrequestreview-2579725354 by removing -I flags 6 | OCAMLLIBS:= 7 | COQLIBS:=$(COQLIBS_NOML) 8 | endif 9 | 10 | include $(PERF_ABS_DIR)/Makefile.timing 11 | include $(PERF_ABS_DIR)/Makefile.generated-files 12 | include $(PERF_ABS_DIR)/Makefile.coq-versions-files 13 | -------------------------------------------------------------------------------- /src/Rewriter/Rewriter/Examples/PerfTesting/Makefile.timing: -------------------------------------------------------------------------------- 1 | # Print shell commands (set to non empty) 2 | VERBOSE ?= 3 | 4 | # Time the Coq process (set to non empty), and how (see default value) 5 | TIMED?= 6 | TIMECMD?= 7 | # Use command time on linux, gtime on Mac OS 8 | TIMEFMT?="$@ (real: %e, user: %U, sys: %S, mem: %M ko)" 9 | ifneq (,$(TIMED)) 10 | ifeq (0,$(shell command time -f $(TIMEFMT) true >/dev/null 2>/dev/null; echo $$?)) 11 | STDTIME?=command time -f $(TIMEFMT) 12 | else 13 | ifeq (0,$(shell gtime -f $(TIMEFMT) true >/dev/null 2>/dev/null; echo $$?)) 14 | STDTIME?=gtime -f $(TIMEFMT) 15 | else 16 | STDTIME?=command time 17 | endif 18 | endif 19 | else 20 | STDTIME?=command time -f $(TIMEFMT) 21 | endif 22 | 23 | SHOW := $(if $(VERBOSE),@true "",@echo "") 24 | HIDE := $(if $(VERBOSE),,@) 25 | -------------------------------------------------------------------------------- /src/Rewriter/Rewriter/Examples/PerfTesting/Makefile.variables.kinds: -------------------------------------------------------------------------------- 1 | mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) 2 | PERF_ABS_DIR := $(patsubst %/,%,$(dir $(mkfile_path))) 3 | 4 | include $(PERF_ABS_DIR)/Makefile.coq-versions-lite 5 | 6 | KINDS := \ 7 | # end of list 8 | 9 | LTAC2_KINDS := \ 10 | # end of list 11 | 12 | VERSION_8_9_OR_NEWER_KINDS := \ 13 | # end of list 14 | 15 | Q_DECIMAL_NOTATION_KINDS := \ 16 | LiftLetsMap \ 17 | Plus0Tree \ 18 | SieveOfEratosthenes \ 19 | UnderLetsPlus0 \ 20 | # end of list 21 | 22 | VERSION_8_10_OR_NEWER_KINDS := \ 23 | $(Q_DECIMAL_NOTATION_KINDS) \ 24 | # end of list 25 | 26 | DISABLED_FILES?= 27 | 28 | ifneq (,$(IS_8_9_OR_NEWER)) 29 | KINDS += $(VERSION_8_9_OR_NEWER_KINDS) 30 | else 31 | DISABLED_FILES += $(addsuffix .v,$(VERSION_8_9_OR_NEWER_KINDS)) 32 | endif 33 | 34 | ifneq (,$(IS_8_10_OR_NEWER)) 35 | KINDS += $(VERSION_8_10_OR_NEWER_KINDS) 36 | else 37 | DISABLED_FILES += $(addsuffix .v,$(VERSION_8_10_OR_NEWER_KINDS)) 38 | endif 39 | 40 | ifneq (,$(HAS_LTAC2)) 41 | KINDS += $(LTAC2_KINDS) 42 | else 43 | DISABLED_FILES += $(addsuffix .v,$(LTAC2_KINDS)) \ 44 | rewrite_repeated_app_common_ltac2.v \ 45 | # end of list 46 | endif 47 | 48 | SH_KINDS := 49 | 50 | SPECIAL_KINDS := 51 | 52 | ALL_VKINDS := $(KINDS) $(SPECIAL_KINDS) 53 | ALL_KINDS := $(ALL_VKINDS) $(SH_KINDS) 54 | -------------------------------------------------------------------------------- /src/Rewriter/Rewriter/Examples/PerfTesting/Settings.v: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Language.Pre. 2 | Require Import Rewriter.Util.LetIn. 3 | Require Import Rewriter.Util.plugins.RewriterBuild. 4 | 5 | Ltac rewrite_perf_level ::= constr:(5%nat). 6 | #[global] Hint Opaque Let_In : rewrite typeclass_instances. 7 | #[global] Hint Constants Opaque : rewrite. 8 | Global Opaque Let_In. 9 | Global Set Printing Width 150. 10 | Global Set NativeCompute Timing. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Rewriter/Examples/PerfTesting/Template.v.in: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Rewriter.Examples.PerfTesting.Harness. 2 | Require Import Rewriter.Rewriter.Examples.PerfTesting.@EXAMPLE@. 3 | Goal True. run@ARGS@. Abort. 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Bool/Equality.v: -------------------------------------------------------------------------------- 1 | From Coq Require Import Bool. 2 | 3 | Scheme Equality for bool. 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Comparison.v: -------------------------------------------------------------------------------- 1 | Scheme Equality for comparison. 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/FMapPositive/Equality.v: -------------------------------------------------------------------------------- 1 | From Coq Require Import FMapPositive. 2 | Require Import Rewriter.Util.Bool.Equality. 3 | Require Import Rewriter.Util.Decidable. 4 | 5 | Module PositiveMap. 6 | Scheme Induction for PositiveMap.tree Sort Type. 7 | Scheme Induction for PositiveMap.tree Sort Set. 8 | Scheme Induction for PositiveMap.tree Sort Prop. 9 | Scheme Equality for PositiveMap.tree. 10 | 11 | Notation t_beq := tree_beq. 12 | Notation t_eq_dec := tree_eq_dec. 13 | Notation internal_t_dec_bl := internal_tree_dec_bl. 14 | Notation internal_t_dec_lb := internal_tree_dec_lb. 15 | 16 | Lemma tree_eq_dec' {A} (A_dec : forall x y : A, {x = y} + {x <> y}) 17 | : forall x y : PositiveMap.tree A, {x = y} + {x <> y}. 18 | Proof. 19 | intros; do 2 decide equality. 20 | Qed. 21 | 22 | Global Instance tree_dec_eq {A} {A_dec : DecidableRel (@eq A)} 23 | : DecidableRel (@eq (PositiveMap.tree A)) 24 | := @tree_eq_dec' A A_dec. 25 | Global Instance t_dec_eq {A} {A_dec : DecidableRel (@eq A)} 26 | : DecidableRel (@eq (PositiveMap.t A)) 27 | := @tree_eq_dec' A A_dec. 28 | End PositiveMap. 29 | -------------------------------------------------------------------------------- /src/Rewriter/Util/GlobalSettings.v: -------------------------------------------------------------------------------- 1 | (** * Global Settings across the project *) 2 | 3 | (** Compatibility with 8.4 so we can write, e.g., [match p with 4 | ex_intro x y => _ end], rather than [match p with ex_intro _ x y 5 | => _ end]. *) 6 | Global Set Asymmetric Patterns. 7 | 8 | (** Enforce uniform parameters *) 9 | Global Set Uniform Inductive Parameters. 10 | 11 | (** Consider also: *) 12 | (** Judgmental η for records, faster projections *) 13 | (** Set Primitive Projections. *) 14 | 15 | (** Don't use non-imported hints *) 16 | (** Set Loose Hint Behavior "Strict". *) 17 | 18 | (** Universes *) 19 | (** Set Universe Polymorphism. *) 20 | (** Set Strict Universe Declaration. *) 21 | (** Unset Universe Minimization ToSet. *) 22 | 23 | (** Better control of unfolding in [rewrite] and [setoid_rewrite] *) 24 | (** Set Keyed Unification. *) 25 | 26 | (** Better-behaved [simpl] *) 27 | (** Set SimplIsCbn. *) 28 | 29 | (** Faster printing *) 30 | (** N.B. This makes [A -> B] always print as a [forall] *) 31 | (** Global Set Fast Name Printing. *) 32 | -------------------------------------------------------------------------------- /src/Rewriter/Util/IffT.v: -------------------------------------------------------------------------------- 1 | From Coq Require Import RelationClasses. 2 | Notation iffT A B := (((A -> B) * (B -> A)))%type. 3 | Notation iffTp := (fun A B => inhabited (iffT A B)). 4 | 5 | Global Instance iffTp_Reflexive : Reflexive iffTp | 1. 6 | Proof. repeat constructor; intro; assumption. Defined. 7 | Global Instance iffTp_Symmetric : Symmetric iffTp | 1. 8 | Proof. repeat (intros [?] || intro); constructor; tauto. Defined. 9 | Global Instance iffTp_Transitive : Transitive iffTp | 1. 10 | Proof. repeat (intros [?] || intro); constructor; tauto. Defined. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/InductiveHList.v: -------------------------------------------------------------------------------- 1 | Inductive hlist := nil | cons {T : Type} (v : T) (vs : hlist). 2 | 3 | Fixpoint nth_type (n : nat) (l : hlist) (default : Type) {struct l} := 4 | match n, l with 5 | | O, @cons T _ _ => T 6 | | S m, @cons _ _ l => nth_type m l default 7 | | _, _ => default 8 | end. 9 | 10 | Fixpoint nth (n : nat) (l : hlist) {T} (default : T) {struct l} : nth_type n l T := 11 | match n, l return nth_type n l T with 12 | | O, @cons _ x _ => x 13 | | S m, @cons _ _ l => nth m l default 14 | | _, _ => default 15 | end. 16 | 17 | Module Export Notations. 18 | Declare Scope hlist_scope. 19 | Delimit Scope hlist_scope with hlist. 20 | Bind Scope hlist_scope with hlist. 21 | Notation "[ ]" := nil (format "[ ]") : hlist_scope. 22 | Notation "[ x ]" := (cons x nil) : hlist_scope. 23 | Notation "[ x ; y ; .. ; z ]" := (cons x (cons y .. (cons z nil) ..)) : hlist_scope. 24 | End Notations. 25 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Isomorphism.v: -------------------------------------------------------------------------------- 1 | (** * Isomorphisms *) 2 | (** Following the category-theoretic definition, [f : A → B] is an 3 | isomorphism when it has an inverse [f⁻¹ : B → A] which is both a 4 | left and a right inverse. In the language of homotopy type 5 | theory, we are formalizing quasi-invertibility; this notion of 6 | isomorphism is not an hProp. The better notations of equivalence 7 | (such that all proofs of [IsEquiv f] are equal when only assuming 8 | function extensionality) are more complicated. Possibilities 9 | include: *) 10 | 11 | (** - Adjoint equivalence, the default of HoTT/HoTT: *) 12 | (** 13 | << 14 | Definition Sect {A B : Type} (s : A -> B) (r : B -> A) := 15 | forall x : A, r (s x) = x. 16 | 17 | Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv { 18 | equiv_inv : B -> A ; 19 | eisretr : Sect equiv_inv f; 20 | eissect : Sect f equiv_inv; 21 | eisadj : forall x : A, eisretr (f x) = ap f (eissect x) 22 | }. 23 | >> *) 24 | (** - Contractible fibers: [∀ y : B, Contr { x : A | f x = y }] where 25 | [Contr T := { center : T | forall y, center = y }] *) 26 | 27 | (** This is useful for classifying equalities in a theoretically nice 28 | way. *) 29 | 30 | Class IsIso {A B} (f : A -> B) := 31 | { iso_inv : B -> A; 32 | is_right_inv : forall x, f (iso_inv x) = x; 33 | is_left_inv : forall x, iso_inv (f x) = x }. 34 | 35 | Arguments iso_inv {_ _} _ {_} _. 36 | Arguments is_right_inv {_ _} _ {_} _. 37 | Arguments is_left_inv {_ _} _ {_} _. 38 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Logic/ExistsEqAnd.v: -------------------------------------------------------------------------------- 1 | From Coq Require Import Setoid. 2 | Require Import Rewriter.Util.FixCoqMistakes. 3 | Require Import Rewriter.Util.Tactics.DestructHead. 4 | 5 | Local Ltac t := 6 | repeat first [ progress destruct_head'_ex 7 | | progress destruct_head'_and 8 | | progress intros 9 | | progress subst 10 | | assumption 11 | | progress repeat esplit ]. 12 | 13 | Lemma ex_and_eq_l_iff {A P x} 14 | : (exists y : A, y = x /\ P y) <-> P x. 15 | Proof. t. Qed. 16 | 17 | Lemma ex_and_eq_r_iff {A P x} 18 | : (exists y : A, x = y /\ P y) <-> P x. 19 | Proof. t. Qed. 20 | 21 | Lemma ex_eq_and_l_iff {A P x} 22 | : (exists y : A, P y /\ y = x) <-> P x. 23 | Proof. t. Qed. 24 | 25 | Lemma ex_eq_and_r_iff {A P x} 26 | : (exists y : A, P y /\ x = y) <-> P x. 27 | Proof. t. Qed. 28 | 29 | Ltac ex_eq_and_step := 30 | let rew lem := (rewrite lem || setoid_rewrite lem) in 31 | let rew_in lem H := (rewrite lem in H || setoid_rewrite lem in H) in 32 | match goal with 33 | | [ |- context[exists y, _ = y /\ _] ] 34 | => rew (@ex_and_eq_r_iff) 35 | | [ |- context[exists y, y = _ /\ _] ] 36 | => rew (@ex_and_eq_l_iff) 37 | | [ |- context[exists y, _ /\ _ = y] ] 38 | => rew (@ex_eq_and_r_iff) 39 | | [ |- context[exists y, _ /\ y = _] ] 40 | => rew (@ex_eq_and_l_iff) 41 | | [ H : context[exists y, _ = y /\ _] |- _ ] 42 | => rew_in (@ex_and_eq_r_iff) H 43 | | [ H : context[exists y, y = _ /\ _] |- _ ] 44 | => rew_in (@ex_and_eq_l_iff) H 45 | | [ H : context[exists y, _ /\ _ = y] |- _ ] 46 | => rew_in (@ex_eq_and_r_iff) H 47 | | [ H : context[exists y, _ /\ y = _] |- _ ] 48 | => rew_in (@ex_eq_and_l_iff) H 49 | end. 50 | 51 | Ltac ex_eq_and := repeat ex_eq_and_step. 52 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Logic/ProdForall.v: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.FixCoqMistakes. 2 | 3 | Lemma pull_prod_forall A A' B B' (Q : A * A' -> B * B' -> Prop) 4 | : (forall x y, Q x y) <-> (forall x0 y0 x1 y1, Q (x0, x1) (y0, y1)). 5 | Proof. intuition. Qed. 6 | -------------------------------------------------------------------------------- /src/Rewriter/Util/MSetPositive/Equality.v: -------------------------------------------------------------------------------- 1 | From Coq Require Import MSetPositive. 2 | Require Import Rewriter.Util.Bool.Equality. 3 | Require Import Rewriter.Util.Decidable. 4 | 5 | Module PositiveSet. 6 | Scheme Equality for PositiveSet.tree. 7 | 8 | Notation t_beq := tree_beq. 9 | Notation t_eq_dec := tree_eq_dec. 10 | Notation internal_t_dec_bl := internal_tree_dec_bl. 11 | Notation internal_t_dec_lb := internal_tree_dec_lb. 12 | 13 | Global Instance tree_dec_eq : DecidableRel (@eq PositiveSet.tree) := tree_eq_dec. 14 | Global Instance t_dec_eq : DecidableRel (@eq PositiveSet.t) := t_eq_dec. 15 | End PositiveSet. 16 | -------------------------------------------------------------------------------- /src/Rewriter/Util/MSetPositive/Facts.v: -------------------------------------------------------------------------------- 1 | From Coq Require Import Setoid. 2 | From Coq Require Import Morphisms. 3 | From Coq Require Import List. 4 | From Coq Require Import SetoidList. 5 | From Coq Require Import MSetPositive. 6 | From Coq Require Import MSetFacts. 7 | Require Import Rewriter.Util.Tactics.BreakMatch. 8 | Require Import Rewriter.Util.Tactics.SplitInContext. 9 | Require Import Rewriter.Util.Tactics.SpecializeBy. 10 | Require Import Rewriter.Util.Tactics.DestructHead. 11 | Require Import Rewriter.Util.ListUtil.SetoidList. 12 | Require Import Rewriter.Util.Logic.ExistsEqAnd. 13 | 14 | Local Set Implicit Arguments. 15 | 16 | Set Implicit Arguments. 17 | Unset Strict Implicit. 18 | 19 | Module PositiveSetFacts. 20 | Module F := Facts PositiveSet. 21 | Include F. 22 | Import PositiveSet. 23 | 24 | Global Instance elements_Proper_Equal 25 | : Proper (Equal ==> Logic.eq) elements | 10. 26 | Proof. 27 | intros p1 p2 Hp. 28 | apply eqlistA_eq_iff. 29 | eapply SortA_equivlistA_eqlistA; try apply elements_spec2; try exact _. 30 | cbv [equivlistA]; intro. 31 | rewrite !elements_spec1. 32 | apply Hp. 33 | Qed. 34 | 35 | Lemma In_elements_mem_iff {x p} 36 | : List.In x (elements p) <-> PositiveSet.mem x p = true. 37 | Proof using Type. 38 | rewrite elements_b, existsb_exists; cbv [eqb]. 39 | repeat first [ apply conj 40 | | progress intros 41 | | progress destruct_head'_ex 42 | | progress destruct_head'_and 43 | | eexists 44 | | eassumption 45 | | break_innermost_match_step 46 | | break_innermost_match_hyps_step 47 | | congruence ]. 48 | Qed. 49 | End PositiveSetFacts. 50 | -------------------------------------------------------------------------------- /src/Rewriter/Util/PrimitiveHList.v: -------------------------------------------------------------------------------- 1 | From Coq Require Import List. 2 | Require Import Rewriter.Util.PrimitiveProd. 3 | 4 | Import Primitive.Notations. 5 | 6 | Fixpoint hlist {A} (P : A -> Type) (ls : list A) : Type 7 | := match ls return Type with 8 | | nil => unit 9 | | cons x xs => P x * @hlist A P xs 10 | end%type. 11 | Fixpoint split_list {A P} (ls : list (@sigT A P)) : { ls : list A & hlist P ls } 12 | := match ls with 13 | | nil => existT _ nil tt 14 | | cons x xs => let 'existT ls' hls' := @split_list A P xs in existT _ (cons (projT1 x) ls') (projT2 x, hls') 15 | end. 16 | Fixpoint combine_hlist {A P} (ls : list A) : hlist P ls -> list (@sigT A P) 17 | := match ls return hlist P ls -> _ with 18 | | nil => fun _ => nil 19 | | cons x xs => fun '(Px, Pxs) => existT P x Px :: @combine_hlist A P xs Pxs 20 | end. 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Strings/Ascii.v: -------------------------------------------------------------------------------- 1 | From Coq Require Import NArith. 2 | From Coq Require Import Ascii. 3 | Require Import Rewriter.Util.Notations. 4 | 5 | Local Open Scope bool_scope. 6 | Local Open Scope N_scope. 7 | Local Open Scope char_scope. 8 | 9 | (** Special characters *) 10 | 11 | Example Null := "000". 12 | Example Backspace := "008". 13 | Example Tab := "009". 14 | Example LF := "010". 15 | Example NewPage := "012". 16 | Example CR := "013". 17 | Example Escape := "027". 18 | Example NewLine := "010". 19 | 20 | Local Coercion N_of_ascii : ascii >-> N. 21 | Definition ltb (x y : ascii) : bool := N.ltb x y. 22 | Definition leb (x y : ascii) : bool := N.leb x y. 23 | Infix " T end in 6 | simple notypeclasses refine (match term return T with H => _ end); 7 | repeat match goal with 8 | | [ H' : _ |- _ ] => tryif constr_eq H H' then fail else clear H' 9 | end; 10 | clear H. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/ConstrFail.v: -------------------------------------------------------------------------------- 1 | (** A tactic that executes immediately (during expression evaluation / constr-construction) and fails. Ideally we can eventually give it a nicer error message. COQBUG(3913) *) 2 | 3 | Ltac constr_fail := 4 | let __ := match goal with _ => fail 1 "Constr construction failed. Please look at the message log (*coq*, or run your tactic again inside Fail or try) to see more details" end in 5 | (). 6 | 7 | Ltac constr_fail_with msg_tac := 8 | let __ := match goal with _ => msg_tac () end in 9 | constr_fail. 10 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/Contains.v: -------------------------------------------------------------------------------- 1 | (** [contains x expr] succeeds iff [x] appears in [expr] *) 2 | Ltac contains search_for in_term := 3 | idtac; 4 | lazymatch in_term with 5 | | context[search_for] => idtac 6 | end. 7 | 8 | Ltac free_in x y := 9 | idtac; 10 | match y with 11 | | context[x] => fail 1 x "appears in" y 12 | | _ => idtac 13 | end. 14 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/DoWithHyp.v: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Util.Tactics.Test. 2 | Require Import Rewriter.Util.Tactics.Not. 3 | Require Export Rewriter.Util.FixCoqMistakes. 4 | 5 | (** Do something with every hypothesis. *) 6 | Ltac do_with_hyp' tac := 7 | match goal with 8 | | [ H : _ |- _ ] => tac H 9 | end. 10 | 11 | (** Do something with any hypothesis, as long as there is only one hypothesis that it works with *) 12 | Ltac do_with_exactly_one_hyp tac := 13 | match goal with 14 | | [ H : _ |- _ ] 15 | => test (tac H); 16 | not (idtac; match goal with 17 | | [ H' : _ |- _ ] => tryif constr_eq H H' then fail else tac H' 18 | end); 19 | tac H 20 | end. 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/EvarNormalize.v: -------------------------------------------------------------------------------- 1 | (** * Evar-normalize terms *) 2 | (** Useful for working around things like COQBUG(https://github.com/coq/coq/issues/10044) *) 3 | Local Definition dummy := Set. 4 | Ltac evar_normalize term := (eval cbv delta [dummy] in term). 5 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/FindHyp.v: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.FixCoqMistakes. 2 | 3 | Ltac find_hyp_eq a b := match goal with _ => constr_eq_nounivs a b end. 4 | (* Work around https://github.com/coq/coq/issues/15554 *) 5 | Ltac find_hyp T := 6 | lazymatch T with 7 | | T 8 | => (* we're not in https://github.com/coq/coq/issues/15554 *) 9 | multimatch goal with 10 | | [ H : T |- _ ] => H 11 | end 12 | | _ 13 | => (* https://github.com/coq/coq/issues/15554 *) 14 | multimatch goal with 15 | | [ H : ?T' |- _ ] => let __ := find_hyp_eq T T' in 16 | H 17 | end 18 | end. 19 | 20 | Ltac find_hyp_with_body body := 21 | lazymatch body with 22 | | body 23 | => (* we're not in https://github.com/coq/coq/issues/15554 *) 24 | multimatch goal with 25 | | [ H := body |- _ ] => H 26 | end 27 | | _ 28 | => (* https://github.com/coq/coq/issues/15554 *) 29 | multimatch goal with 30 | | [ H := ?body' |- _ ] => let __ := find_hyp_eq body body' in 31 | H 32 | end 33 | end. 34 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/GetGoal.v: -------------------------------------------------------------------------------- 1 | Ltac get_goal := 2 | match goal with |- ?G => G end. 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/Head.v: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.FixCoqMistakes. 2 | 3 | (** find the head of the given expression *) 4 | Ltac head expr := 5 | match expr with 6 | | ?f _ => head f 7 | | _ => expr 8 | end. 9 | 10 | Ltac head_hnf expr := let expr' := eval hnf in expr in head expr'. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/HeadUnderBinders.v: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.FixCoqMistakes. 2 | 3 | (** find the head of the given expression, underneath [fun] and [forall] *) 4 | Ltac head_under_binders_gen redtac expr := 5 | let expr := redtac expr in 6 | match expr with 7 | | ?f _ => head_under_binders_gen redtac f 8 | | fun x : ?T => @?f x 9 | => lazymatch constr:(fun x : T 10 | => ltac:(let f' := (eval cbv beta in (f x)) in 11 | let h := head_under_binders_gen redtac f' in 12 | exact h)) with 13 | | fun _ => ?f => f 14 | | ?f => f 15 | end 16 | | forall x, @?f x 17 | => head_under_binders_gen redtac f 18 | | ?expr => expr 19 | end. 20 | 21 | Ltac head_under_binders expr := head_under_binders_gen ltac:(fun e => e) expr. 22 | Ltac head_hnf_under_binders expr := head_under_binders_gen ltac:(fun e => eval hnf in e) expr. 23 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/Not.v: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Util.Tactics.Test. 2 | 3 | (** [not tac] is equivalent to [fail tac "succeeds"] if [tac] succeeds, and is equivalent to [idtac] if [tac] fails *) 4 | Tactic Notation "not" tactic3(tac) := try ((test tac); fail 1 tac "succeeds"). 5 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/PrintContext.v: -------------------------------------------------------------------------------- 1 | Ltac print_context _ := 2 | lazymatch goal with 3 | | [ H : ?T |- False ] 4 | => try ((clear H || fail 10000 "Anomaly in print_context: could not clear" H); print_context (); fail); 5 | match goal with 6 | | _ => let body := (eval cbv delta [H] in H) in 7 | idtac H ":=" body ":" T 8 | | _ => idtac H ":" T 9 | end 10 | | [ |- False ] => idtac 11 | | [ |- _ ] => try (exfalso; print_context (); fail) 12 | end. 13 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/PrintGoal.v: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Util.Tactics.PrintContext. 2 | 3 | Ltac print_goal _ := 4 | lazymatch goal with |- ?G => idtac G end. 5 | 6 | Ltac print_context_and_goal _ := 7 | print_context (); 8 | idtac "============================"; 9 | print_goal (). 10 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/RunTacticAsConstr.v: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.FixCoqMistakes. 2 | 3 | (** Runs a tactic during expression evaluation phase, returns the constr [I] *) 4 | Ltac run_tactic tac := 5 | let dummy := match goal with _ => tac () end in 6 | I. 7 | 8 | (** Runs a tactic during expression evaluation phase, returning [true] on success and [false] on failure. *) 9 | Ltac is_success_run_tactic tac := 10 | match goal with 11 | | _ => let dummy := run_tactic tac in 12 | true 13 | | _ => false 14 | end. 15 | 16 | (** Runs a tactic during expression evaluation phase; on success, 17 | returns [then_tac ()], otherwise returns [else_tac ()] *) 18 | Ltac constr_tryif_then_else tac then_tac else_tac := 19 | let success := is_success_run_tactic tac in 20 | lazymatch success with 21 | | true => then_tac () 22 | | false => else_tac () 23 | end. 24 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/SetEvars.v: -------------------------------------------------------------------------------- 1 | Ltac set_evars := 2 | repeat match goal with 3 | | [ |- context[?E] ] => is_evar E; let e := fresh "e" in set (e := E) 4 | end. 5 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/SetoidSubst.v: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Util.Tactics.Contains. 2 | 3 | Ltac setoid_subst'' R x := 4 | is_var x; 5 | match goal with 6 | | [ H : R x ?y |- _ ] 7 | => free_in x y; rewrite ?H in *; clear x H 8 | | [ H : R ?y x |- _ ] 9 | => free_in x y; rewrite <- ?H in *; clear x H 10 | end. 11 | 12 | Ltac setoid_subst' x := 13 | is_var x; 14 | match goal with 15 | | [ H : ?R x _ |- _ ] => setoid_subst'' R x 16 | | [ H : ?R _ x |- _ ] => setoid_subst'' R x 17 | end. 18 | 19 | Ltac setoid_subst_rel' R := 20 | idtac; 21 | match goal with 22 | | [ H : R ?x _ |- _ ] => setoid_subst'' R x 23 | | [ H : R _ ?x |- _ ] => setoid_subst'' R x 24 | end. 25 | 26 | Ltac setoid_subst_rel R := repeat setoid_subst_rel' R. 27 | 28 | Ltac setoid_subst_all := 29 | repeat match goal with 30 | | [ H : ?R ?x ?y |- _ ] => is_var x; setoid_subst'' R x 31 | | [ H : ?R ?x ?y |- _ ] => is_var y; setoid_subst'' R y 32 | end. 33 | 34 | Tactic Notation "setoid_subst" ident(x) := setoid_subst' x. 35 | Tactic Notation "setoid_subst" := setoid_subst_all. 36 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/SpecializeAllWays.v: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.FixCoqMistakes. 2 | Require Export Rewriter.Util.Tactics.UniquePose. 3 | 4 | Ltac specialize_all_ways := 5 | repeat match goal with 6 | | [ H : ?A, H' : forall a : ?A, _ |- _ ] 7 | => unique pose proof (H' H) 8 | end. 9 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/SpecializeBy.v: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.FixCoqMistakes. 2 | 3 | Ltac transparent_specialize_one H arg := 4 | first [ let test := eval unfold H in H in idtac; 5 | let H' := fresh in rename H into H'; pose (H' arg) as H; subst H' 6 | | specialize (H arg) ]. 7 | 8 | (** try to specialize all non-dependent hypotheses using [tac], maintaining transparency *) 9 | Ltac guarded_specialize_by' tac guard_tac := 10 | idtac; 11 | match goal with 12 | | [ H : ?A -> ?B |- _ ] 13 | => guard_tac H; 14 | let H' := fresh in 15 | assert (H' : A) by tac; 16 | transparent_specialize_one H H'; 17 | try clear H' (* if [H] was transparent, [H'] will remain *) 18 | end. 19 | Ltac specialize_by' tac := guarded_specialize_by' tac ltac:(fun _ => idtac). 20 | 21 | Ltac specialize_by tac := repeat specialize_by' tac. 22 | 23 | (** [specialize_by auto] should not mean [specialize_by ( auto 24 | with * )]!!!!!!! (see 25 | https://coq.inria.fr/bugs/show_bug.cgi?id=4966) We fix this design 26 | flaw. *) 27 | Tactic Notation "specialize_by" tactic3(tac) := specialize_by tac. 28 | 29 | (** A marginally faster version of [specialize_by assumption] *) 30 | Ltac specialize_by_assumption := 31 | repeat match goal with 32 | | [ H : ?T, H' : (?T -> ?U)%type |- _ ] 33 | => lazymatch goal with 34 | | [ _ : context[H'] |- _ ] => fail 35 | | [ |- context[H'] ] => fail 36 | | _ => specialize (H' H) 37 | end 38 | end. 39 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/SplitInContext.v: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.FixCoqMistakes. 2 | 3 | (* Coq's build in tactics don't work so well with things like [iff] 4 | so split them up into multiple hypotheses *) 5 | Ltac split_in_context_by ident funl funr tac := 6 | repeat match goal with 7 | | [ H : context p [ident] |- _ ] => 8 | let H0 := context p[funl] in 9 | let H1 := context p[funr] in 10 | let H0' := (eval cbv beta in H0) in 11 | let H1' := (eval cbv beta in H1) in 12 | assert H0' by (tac H); 13 | assert H1' by (tac H); 14 | clear H 15 | end. 16 | Ltac split_in_context ident funl funr := 17 | split_in_context_by ident funl funr ltac:(fun H => apply H). 18 | 19 | Ltac split_iff := split_in_context iff (fun a b : Prop => a -> b) (fun a b : Prop => b -> a). 20 | 21 | Ltac split_contravariant_or := split_in_context_by or (fun A B : Prop => A) (fun A B : Prop => B) ltac:(fun H => intros; eauto 100 using H, or_introl, or_intror, ex_intro, exist, existT with nocore). 22 | 23 | Ltac split_and' := 24 | repeat match goal with 25 | | [ H : ?a /\ ?b |- _ ] => let H0 := fresh in let H1 := fresh in 26 | assert (H0 := proj1 H); assert (H1 := proj2 H); clear H 27 | end. 28 | Ltac split_prod' := 29 | repeat match goal with 30 | | [ H : prod ?a ?b |- _ ] => let H0 := fresh in let H1 := fresh in 31 | assert (H0 := fst H); assert (H1 := snd H); clear H 32 | end. 33 | Ltac split_and := split_and'; split_in_context and (fun a b : Type => a) (fun a b : Type => b). 34 | Ltac split_prod := split_and'; split_in_context prod (fun a b : Type => a) (fun a b : Type => b). 35 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/SubstEvars.v: -------------------------------------------------------------------------------- 1 | Ltac subst_evars := 2 | repeat match goal with 3 | | [ e := ?E |- _ ] => is_evar E; subst e 4 | end. 5 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/Test.v: -------------------------------------------------------------------------------- 1 | (** Test if a tactic succeeds, but always roll-back the results *) 2 | Tactic Notation "test" tactic3(tac) := 3 | try (first [ tac | fail 2 tac "does not succeed" ]; fail 0 tac "succeeds"; [](* test for [t] solved all goals *)). 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/TransparentAssert.v: -------------------------------------------------------------------------------- 1 | (** [transparent assert (H : T)] is like [assert (H : T)], but leaves the body transparent. *) 2 | Tactic Notation "transparent" "assert" "(" ident(name) ":" constr(type) ")" := 3 | simple notypeclasses refine (let name := (_ : type) in _). 4 | 5 | (** [transparent eassert] is like [transparent assert], but allows holes in the type, which will be turned into evars. *) 6 | Tactic Notation "transparent" "assert" "(" ident(name) ":" constr(type) ")" "by" tactic3(tac) := transparent assert (name : type); [ solve [ tac ] | ]. 7 | Tactic Notation "transparent" "eassert" "(" ident(name) ":" open_constr(type) ")" := transparent assert (name : type). 8 | Tactic Notation "transparent" "eassert" "(" ident(name) ":" open_constr(type) ")" "by" tactic3(tac) := transparent assert (name : type) by tac. 9 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/UniquePose.v: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.FixCoqMistakes. 2 | Require Import Rewriter.Util.Tactics.FindHyp. 3 | 4 | (** [pose proof defn], but only if no hypothesis of the same type exists. 5 | most useful for proofs of a proposition *) 6 | Tactic Notation "unique" "pose" "proof" constr(defn) := 7 | let T := type of defn in 8 | tryif let H := find_hyp T in fail 2 "Already a hypothesis" H "of type" T 9 | then fail 10 | else pose proof defn. 11 | 12 | (** [pose defn], but only if that hypothesis doesn't exist *) 13 | Tactic Notation "unique" "pose" constr(defn) := 14 | tryif let H := find_hyp_with_body defn in fail 2 "Already a hypothesis" H "with body" defn 15 | then fail 16 | else pose defn. 17 | 18 | (** [assert T], but only if no hypothesis of the same type exists. 19 | most useful for proofs of a proposition *) 20 | Tactic Notation "unique" "assert" constr(T) := 21 | tryif let H := find_hyp T in fail 2 "Already a hypothesis" H "of type" T 22 | then fail 23 | else assert T. 24 | 25 | (** [assert T], but only if no hypothesis of the same type exists. 26 | most useful for proofs of a proposition *) 27 | Tactic Notation "unique" "assert" constr(T) "by" tactic3(tac) := 28 | tryif let H := find_hyp T in fail 2 "Already a hypothesis" H "of type" T 29 | then fail 30 | else assert T by tac. 31 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics/WarnIfGoalsRemain.v: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Util.Tactics.PrintGoal. 2 | 3 | Ltac warn_if_goals_remain _ := 4 | [ > idtac "WARNING: Remaining goal:"; print_context_and_goal () .. ]. 5 | 6 | Ltac fail_if_goals_remain _ := 7 | warn_if_goals_remain (); fail 0 "A goal remains". 8 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Array.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Array. 4 | 5 | Ltac2 rec for_all2_aux (p : 'a -> 'b -> bool) (a : 'a array) (b : 'b array) (pos : int) (len : int) := 6 | if Int.equal len 0 7 | then true 8 | else if p (get a pos) (get b pos) 9 | then for_all2_aux p a b (Int.add pos 1) (Int.sub len 1) 10 | else false. 11 | 12 | Ltac2 equal p a b := 13 | let lena := length a in 14 | let lenb := length b in 15 | if Int.equal lena lenb 16 | then for_all2_aux p a b 0 lena 17 | else false. 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Char.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | 4 | (** Special characters *) 5 | Ltac2 null () : char := Char.of_int 0. 6 | Ltac2 backspace () : char := Char.of_int 8. 7 | Ltac2 tab () : char := Char.of_int 9. 8 | Ltac2 lf () : char := Char.of_int 10. 9 | Ltac2 newpage () : char := Char.of_int 12. 10 | Ltac2 cr () : char := Char.of_int 13. 11 | Ltac2 escape () : char := Char.of_int 27. 12 | Ltac2 newline () : char := Char.of_int 10. 13 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Constr.v.v815: -------------------------------------------------------------------------------- 1 | Constr.v.v818 -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Constr.v.v816: -------------------------------------------------------------------------------- 1 | Constr.v.v818 -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Constr.v.v817: -------------------------------------------------------------------------------- 1 | Constr.v.v818 -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Constr.v.v820: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Require Rewriter.Util.Tactics2.Array. 4 | Require Rewriter.Util.Tactics2.Proj. 5 | Require Rewriter.Util.Tactics2.Option. 6 | Require Import Rewriter.Util.Tactics2.Iterate. 7 | Local Set Warnings Append "-masking-absolute-name". 8 | Require Import Rewriter.Util.plugins.Ltac2Extra. 9 | Import Ltac2.Constr. 10 | Import Ltac2.Bool. 11 | 12 | Ltac2 is_sort(c: constr) := 13 | match Unsafe.kind c with 14 | | Unsafe.Sort _ => true 15 | | _ => false 16 | end. 17 | 18 | Module Unsafe. 19 | Export Ltac2.Constr.Unsafe. 20 | 21 | Ltac2 rec kind_nocast_gen kind (x : constr) := 22 | let k := kind x in 23 | match k with 24 | | Cast x _ _ => kind_nocast_gen kind x 25 | | _ => k 26 | end. 27 | 28 | Ltac2 kind_nocast (x : constr) : kind := kind_nocast_gen kind x. 29 | 30 | Module Case. 31 | Ltac2 iter_invert (f : constr -> unit) (ci : case_invert) : unit := 32 | match ci with 33 | | NoInvert => () 34 | | CaseInvert indices => Array.iter f indices 35 | end. 36 | End Case. 37 | 38 | (** [iter_with_binders g f n c] iters [f n] on the immediate 39 | subterms of [c]; it carries an extra data [n] (typically a lift 40 | index) which is processed by [g] (which typically add 1 to [n]) at 41 | each binder traversal; it is not recursive and the order with which 42 | subterms are processed is not specified *) 43 | Ltac2 iter_with_binders (g : 'a -> 'a) (f : 'a -> constr -> unit) (n : 'a) (c : constr) : unit := 44 | iter_with_binders (fun x _ => g x) f n c. 45 | End Unsafe. 46 | Import Unsafe. 47 | 48 | Ltac2 equal_nounivs : constr -> constr -> bool := Ltac2.Constr.equal_nounivs. 49 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Constr.v.v821: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Require Rewriter.Util.Tactics2.Array. 4 | Require Rewriter.Util.Tactics2.Proj. 5 | Require Rewriter.Util.Tactics2.Option. 6 | Require Import Rewriter.Util.Tactics2.Iterate. 7 | Local Set Warnings Append "-masking-absolute-name". 8 | Require Import Rewriter.Util.plugins.Ltac2Extra. 9 | Import Ltac2.Constr. 10 | Import Ltac2.Bool. 11 | 12 | Ltac2 is_sort(c: constr) := 13 | match Unsafe.kind c with 14 | | Unsafe.Sort _ => true 15 | | _ => false 16 | end. 17 | 18 | Module Unsafe. 19 | Export Ltac2.Constr.Unsafe. 20 | 21 | Ltac2 rec kind_nocast_gen kind (x : constr) := 22 | let k := kind x in 23 | match k with 24 | | Cast x _ _ => kind_nocast_gen kind x 25 | | _ => k 26 | end. 27 | 28 | Ltac2 kind_nocast (x : constr) : kind := kind_nocast_gen kind x. 29 | 30 | Module Case. 31 | Ltac2 iter_invert (f : constr -> unit) (ci : case_invert) : unit := 32 | match ci with 33 | | NoInvert => () 34 | | CaseInvert indices => Array.iter f indices 35 | end. 36 | End Case. 37 | 38 | (** [iter_with_binders g f n c] iters [f n] on the immediate 39 | subterms of [c]; it carries an extra data [n] (typically a lift 40 | index) which is processed by [g] (which typically add 1 to [n]) at 41 | each binder traversal; it is not recursive and the order with which 42 | subterms are processed is not specified *) 43 | Ltac2 iter_with_binders (g : 'a -> 'a) (f : 'a -> constr -> unit) (n : 'a) (c : constr) : unit := 44 | iter_with_binders (fun x _ => g x) f n c. 45 | End Unsafe. 46 | Import Unsafe. 47 | 48 | Ltac2 equal_nounivs : constr -> constr -> bool := Ltac2.Constr.equal_nounivs. 49 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Constr.v.v90: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Require Rewriter.Util.Tactics2.Array. 4 | Require Rewriter.Util.Tactics2.Proj. 5 | Require Rewriter.Util.Tactics2.Option. 6 | Require Import Rewriter.Util.Tactics2.Iterate. 7 | Local Set Warnings Append "-masking-absolute-name". 8 | Require Import Rewriter.Util.plugins.Ltac2Extra. 9 | Import Ltac2.Constr. 10 | Import Ltac2.Bool. 11 | 12 | Ltac2 is_sort(c: constr) := 13 | match Unsafe.kind c with 14 | | Unsafe.Sort _ => true 15 | | _ => false 16 | end. 17 | 18 | Module Unsafe. 19 | Export Ltac2.Constr.Unsafe. 20 | 21 | Ltac2 rec kind_nocast_gen kind (x : constr) := 22 | let k := kind x in 23 | match k with 24 | | Cast x _ _ => kind_nocast_gen kind x 25 | | _ => k 26 | end. 27 | 28 | Ltac2 kind_nocast (x : constr) : kind := kind_nocast_gen kind x. 29 | 30 | Module Case. 31 | Ltac2 iter_invert (f : constr -> unit) (ci : case_invert) : unit := 32 | match ci with 33 | | NoInvert => () 34 | | CaseInvert indices => Array.iter f indices 35 | end. 36 | End Case. 37 | 38 | (** [iter_with_binders g f n c] iters [f n] on the immediate 39 | subterms of [c]; it carries an extra data [n] (typically a lift 40 | index) which is processed by [g] (which typically add 1 to [n]) at 41 | each binder traversal; it is not recursive and the order with which 42 | subterms are processed is not specified *) 43 | Ltac2 iter_with_binders (g : 'a -> 'a) (f : 'a -> constr -> unit) (n : 'a) (c : constr) : unit := 44 | iter_with_binders (fun x _ => g x) f n c. 45 | End Unsafe. 46 | Import Unsafe. 47 | 48 | Ltac2 equal_nounivs : constr -> constr -> bool := Ltac2.Constr.equal_nounivs. 49 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Constr.v.v91: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Require Rewriter.Util.Tactics2.Array. 4 | Require Rewriter.Util.Tactics2.Proj. 5 | Require Rewriter.Util.Tactics2.Option. 6 | Require Import Rewriter.Util.Tactics2.Iterate. 7 | Local Set Warnings Append "-masking-absolute-name". 8 | Require Import Rewriter.Util.plugins.Ltac2Extra. 9 | Import Ltac2.Constr. 10 | Import Ltac2.Bool. 11 | 12 | Ltac2 is_sort(c: constr) := 13 | match Unsafe.kind c with 14 | | Unsafe.Sort _ => true 15 | | _ => false 16 | end. 17 | 18 | Module Unsafe. 19 | Export Ltac2.Constr.Unsafe. 20 | 21 | Ltac2 rec kind_nocast_gen kind (x : constr) := 22 | let k := kind x in 23 | match k with 24 | | Cast x _ _ => kind_nocast_gen kind x 25 | | _ => k 26 | end. 27 | 28 | Ltac2 kind_nocast (x : constr) : kind := kind_nocast_gen kind x. 29 | 30 | Module Case. 31 | Ltac2 iter_invert (f : constr -> unit) (ci : case_invert) : unit := 32 | match ci with 33 | | NoInvert => () 34 | | CaseInvert indices => Array.iter f indices 35 | end. 36 | End Case. 37 | 38 | (** [iter_with_binders g f n c] iters [f n] on the immediate 39 | subterms of [c]; it carries an extra data [n] (typically a lift 40 | index) which is processed by [g] (which typically add 1 to [n]) at 41 | each binder traversal; it is not recursive and the order with which 42 | subterms are processed is not specified *) 43 | Ltac2 iter_with_binders (g : 'a -> 'a) (f : 'a -> constr -> unit) (n : 'a) (c : constr) : unit := 44 | iter_with_binders (fun x _ => g x) f n c. 45 | End Unsafe. 46 | Import Unsafe. 47 | 48 | Ltac2 equal_nounivs : constr -> constr -> bool := Ltac2.Constr.equal_nounivs. 49 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Constr.v.v92: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Require Rewriter.Util.Tactics2.Array. 4 | Require Rewriter.Util.Tactics2.Proj. 5 | Require Rewriter.Util.Tactics2.Option. 6 | Require Import Rewriter.Util.Tactics2.Iterate. 7 | Local Set Warnings Append "-masking-absolute-name". 8 | Require Import Rewriter.Util.plugins.Ltac2Extra. 9 | Import Ltac2.Constr. 10 | Import Ltac2.Bool. 11 | 12 | Ltac2 is_sort(c: constr) := 13 | match Unsafe.kind c with 14 | | Unsafe.Sort _ => true 15 | | _ => false 16 | end. 17 | 18 | Module Unsafe. 19 | Export Ltac2.Constr.Unsafe. 20 | 21 | Ltac2 rec kind_nocast_gen kind (x : constr) := 22 | let k := kind x in 23 | match k with 24 | | Cast x _ _ => kind_nocast_gen kind x 25 | | _ => k 26 | end. 27 | 28 | Ltac2 kind_nocast (x : constr) : kind := kind_nocast_gen kind x. 29 | 30 | Module Case. 31 | Ltac2 iter_invert (f : constr -> unit) (ci : case_invert) : unit := 32 | match ci with 33 | | NoInvert => () 34 | | CaseInvert indices => Array.iter f indices 35 | end. 36 | End Case. 37 | 38 | (** [iter_with_binders g f n c] iters [f n] on the immediate 39 | subterms of [c]; it carries an extra data [n] (typically a lift 40 | index) which is processed by [g] (which typically add 1 to [n]) at 41 | each binder traversal; it is not recursive and the order with which 42 | subterms are processed is not specified *) 43 | Ltac2 iter_with_binders (g : 'a -> 'a) (f : 'a -> constr -> unit) (n : 'a) (c : constr) : unit := 44 | iter_with_binders (fun x _ => g x) f n c. 45 | End Unsafe. 46 | Import Unsafe. 47 | 48 | Ltac2 equal_nounivs : constr -> constr -> bool := Ltac2.Constr.equal_nounivs. 49 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Constr/Unsafe/MakeAbbreviations.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 mkApp (f : constr) (args : constr list) := 6 | make (App f (Array.of_list args)). 7 | Ltac2 mkLambda b (body : constr) := 8 | make (Lambda b body). 9 | Ltac2 mkLetIn (b : binder) (val : constr) (body : constr) := 10 | make (LetIn b val body). 11 | Ltac2 mkRel (i : int) := 12 | make (Rel i). 13 | Ltac2 mkVar (i : ident) := 14 | make (Var i). 15 | Ltac2 mkConstant (c : constant) (inst : instance) := 16 | make (Constant c inst). 17 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DecomposeLambda.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Import Ltac2.Printf. 3 | Require Import Rewriter.Util.Tactics2.Constr. 4 | Require Import Rewriter.Util.Tactics2.Constr.Unsafe.MakeAbbreviations. 5 | Require Export Rewriter.Util.FixCoqMistakes. 6 | 7 | Module Constr. 8 | Export Ltac2.Constr. 9 | Export Tactics2.Constr. 10 | Module Unsafe. 11 | Export Tactics2.Constr.Unsafe. 12 | (** Pops [n] lambda abstractions, and pop letins only if needed to 13 | expose enough lambdas, skipping casts. *) 14 | Ltac2 decompose_lam_n_assum (n : int) (c : constr) : (binder * constr option) list * constr := 15 | Control.assert_valid_argument "decompose_lam_n_assum: integer parameter must be positive." (Int.gt n 0); 16 | let rec lamdec_rec l n c := 17 | if Int.equal n 0 then (l, c) 18 | else 19 | match kind_nocast c with 20 | | Lambda b c => lamdec_rec ((b, None) :: l) (Int.sub n 1) c 21 | | LetIn b v c => lamdec_rec ((b, Some v) :: l) n c 22 | | _ => Control.throw (Tactic_failure (Some (fprintf "decompose_lam_n_assum: not enough abstractions (want %i more): %t" n c))) 23 | end 24 | in 25 | lamdec_rec [] n c. 26 | End Unsafe. 27 | End Constr. 28 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestApp.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_an_app (kind) ]. 6 | Ltac2 destApp (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | App f args => (f, args) 10 | | _ => Control.throw (Not_an_app k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestCase.v.v815: -------------------------------------------------------------------------------- 1 | DestCase.v.v818 -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestCase.v.v816: -------------------------------------------------------------------------------- 1 | DestCase.v.v818 -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestCase.v.v817: -------------------------------------------------------------------------------- 1 | DestCase.v.v818 -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestCase.v.v818: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_case (kind) ]. 6 | Ltac2 destCase (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Case a b c d e => (a, b, c, d, e) 10 | | _ => Control.throw (Not_a_case k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestCase.v.v819: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_case (kind) ]. 6 | Ltac2 destCase (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Case a b c d e => let (b,_) := b in (a, b, c, d, e) 10 | | _ => Control.throw (Not_a_case k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestCase.v.v820: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_case (kind) ]. 6 | Ltac2 destCase (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Case a b c d e => let (b,_) := b in (a, b, c, d, e) 10 | | _ => Control.throw (Not_a_case k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestCase.v.v821: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_case (kind) ]. 6 | Ltac2 destCase (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Case a b c d e => let (b,_) := b in (a, b, c, d, e) 10 | | _ => Control.throw (Not_a_case k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestCase.v.v90: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_case (kind) ]. 6 | Ltac2 destCase (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Case a b c d e => let (b,_) := b in (a, b, c, d, e) 10 | | _ => Control.throw (Not_a_case k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestCase.v.v91: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_case (kind) ]. 6 | Ltac2 destCase (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Case a b c d e => let (b,_) := b in (a, b, c, d, e) 10 | | _ => Control.throw (Not_a_case k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestCase.v.v92: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_case (kind) ]. 6 | Ltac2 destCase (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Case a b c d e => let (b,_) := b in (a, b, c, d, e) 10 | | _ => Control.throw (Not_a_case k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestCast.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_cast (kind) ]. 6 | Ltac2 destCast (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Cast x y z => (x, y, z) 10 | | _ => Control.throw (Not_a_cast k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestCoFix.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_cofix (kind) ]. 6 | Ltac2 destCoFix (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | CoFix x y z => (x, y, z) 10 | | _ => Control.throw (Not_a_cofix k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestConstant.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_constant (kind) ]. 6 | Ltac2 destConstant (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Constant e inst => (e, inst) 10 | | _ => Control.throw (Not_a_constant k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestConstructor.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_constructor (kind) ]. 6 | Ltac2 destConstructor (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Constructor e inst => (e, inst) 10 | | _ => Control.throw (Not_a_constructor k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestEvar.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_an_evar (kind) ]. 6 | Ltac2 destEvar (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Evar e inst => (e, inst) 10 | | _ => Control.throw (Not_an_evar k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestFix.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_fix (kind) ]. 6 | Ltac2 destFix (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Fix x y z w => (x, y, z, w) 10 | | _ => Control.throw (Not_a_fix k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestInd.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_an_ind (kind) ]. 6 | Ltac2 destInd (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Ind e inst => (e, inst) 10 | | _ => Control.throw (Not_an_ind k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestLambda.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_lambda (kind) ]. 6 | Ltac2 destLambda (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Lambda x f => (x, f) 10 | | _ => Control.throw (Not_a_lambda k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestLetIn.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_let_in (kind) ]. 6 | Ltac2 destLetIn (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | LetIn x y z => (x, y, z) 10 | | _ => Control.throw (Not_a_let_in k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestMeta.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_meta (kind) ]. 6 | Ltac2 destMeta (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Meta e => e 10 | | _ => Control.throw (Not_a_meta k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestProd.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_prod (kind) ]. 6 | Ltac2 destProd (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Prod x f => (x, f) 10 | | _ => Control.throw (Not_a_prod k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestProj.v.v815: -------------------------------------------------------------------------------- 1 | DestProj.v.v818 -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestProj.v.v816: -------------------------------------------------------------------------------- 1 | DestProj.v.v818 -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestProj.v.v817: -------------------------------------------------------------------------------- 1 | DestProj.v.v818 -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestProj.v.v818: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_proj (kind) ]. 6 | Ltac2 destProj (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Proj p v => (p, v) 10 | | _ => Control.throw (Not_a_proj k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestProj.v.v819: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_proj (kind) ]. 6 | Ltac2 destProj (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Proj p r v => (p, r, v) 10 | | _ => Control.throw (Not_a_proj k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestProj.v.v820: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_proj (kind) ]. 6 | Ltac2 destProj (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Proj p r v => (p, r, v) 10 | | _ => Control.throw (Not_a_proj k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestProj.v.v821: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_proj (kind) ]. 6 | Ltac2 destProj (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Proj p r v => (p, r, v) 10 | | _ => Control.throw (Not_a_proj k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestProj.v.v90: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_proj (kind) ]. 6 | Ltac2 destProj (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Proj p r v => (p, r, v) 10 | | _ => Control.throw (Not_a_proj k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestProj.v.v91: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_proj (kind) ]. 6 | Ltac2 destProj (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Proj p r v => (p, r, v) 10 | | _ => Control.throw (Not_a_proj k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestProj.v.v92: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_proj (kind) ]. 6 | Ltac2 destProj (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Proj p r v => (p, r, v) 10 | | _ => Control.throw (Not_a_proj k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestRel.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_rel (kind) ]. 6 | Ltac2 destRel (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Rel i => i 10 | | _ => Control.throw (Not_a_rel k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestSort.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_sort (kind) ]. 6 | Ltac2 destSort (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Sort s => s 10 | | _ => Control.throw (Not_a_sort k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/DestVar.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr.Unsafe. 4 | 5 | Ltac2 Type exn ::= [ Not_a_var (kind) ]. 6 | Ltac2 destVar (c : constr) := 7 | let k := kind c in 8 | match k with 9 | | Var v => v 10 | | _ => Control.throw (Not_a_var k) 11 | end. 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/FixNotationsForPerformance.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Ltac2.Notations. 3 | Require Export Rewriter.Util.FixCoqMistakes. 4 | 5 | (** We replace notations taking constr with tactic, so that we don't 6 | pay the cost of retyping, see 7 | COQBUG(https://github.com/coq/coq/issues/16586) *) 8 | 9 | (** Base tactics *) 10 | 11 | Ltac2 Notation "eval" "red" "in" c(tactic(6)) := 12 | Std.eval_red c. 13 | 14 | Ltac2 Notation "eval" "hnf" "in" c(tactic(6)) := 15 | Std.eval_hnf c. 16 | 17 | Ltac2 Notation "eval" "simpl" s(strategy) pl(opt(seq(pattern, occurrences))) "in" c(tactic(6)) := 18 | Std.eval_simpl s pl c. 19 | 20 | Ltac2 Notation "eval" "cbv" s(strategy) "in" c(tactic(6)) := 21 | Std.eval_cbv s c. 22 | 23 | Ltac2 Notation "eval" "cbn" s(strategy) "in" c(tactic(6)) := 24 | Std.eval_cbn s c. 25 | 26 | Ltac2 Notation "eval" "lazy" s(strategy) "in" c(tactic(6)) := 27 | Std.eval_lazy s c. 28 | 29 | Ltac2 Notation "eval" "unfold" pl(list1(seq(reference, occurrences), ",")) "in" c(tactic(6)) := 30 | Std.eval_unfold pl c. 31 | (* 32 | Ltac2 Notation "eval" "fold" pl(thunk(list1(open_constr))) "in" c(constr) := 33 | Std.eval_fold (pl ()) c. 34 | *) 35 | Ltac2 Notation "eval" "pattern" pl(list1(seq(tactic(2), occurrences), ",")) "in" c(tactic(6)) := 36 | Std.eval_pattern pl c. 37 | 38 | Ltac2 Notation "eval" "vm_compute" pl(opt(seq(pattern, occurrences))) "in" c(tactic(6)) := 39 | Std.eval_vm pl c. 40 | 41 | Ltac2 Notation "eval" "native_compute" pl(opt(seq(pattern, occurrences))) "in" c(tactic(6)) := 42 | Std.eval_native pl c. 43 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Head.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Import Ltac2.Constr.Unsafe. 3 | Require Export Rewriter.Util.FixCoqMistakes. 4 | 5 | (** find the head of the given expression *) 6 | Ltac2 rec head (expr : constr) : constr := 7 | match kind expr with 8 | | App f _ => f 9 | | Cast c _ _ => head c 10 | | _ => expr 11 | end. 12 | 13 | Ltac2 head_hnf expr := let expr' := eval hnf in $expr in head expr'. 14 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/HeadReference.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Import Ltac2.Constr.Unsafe. 3 | Require Import Rewriter.Util.Tactics2.Head. 4 | Require Export Rewriter.Util.FixCoqMistakes. 5 | 6 | (** find the head reference of the given expression_if it exists *) 7 | Ltac2 rec head_reference_opt (expr : constr) : Std.reference option := 8 | match kind expr with 9 | | App f _ => head_reference_opt f 10 | | Cast c _ _ => head_reference_opt c 11 | | Var v => Some (Std.VarRef v) 12 | | Constant c _ => Some (Std.ConstRef c) 13 | | Ind i _ => Some (Std.IndRef i) 14 | | Constructor c _ => Some (Std.ConstructRef c) 15 | | _ => None 16 | end. 17 | 18 | Ltac2 head_reference_hnf_opt expr := let expr' := eval hnf in $expr in head_reference_opt expr'. 19 | 20 | Ltac2 Type exn ::= [ Not_headed_by_a_reference ((* term *) constr, (* head kind *) kind) ]. 21 | Ltac2 Type exn ::= [ Not_headed_by_a_reference_in_hnf ((* term *) constr, (* hnf *) constr, (* head kind *) kind) ]. 22 | 23 | Ltac2 head_reference (expr : constr) : Std.reference := 24 | match head_reference_opt expr with 25 | | Some r => r 26 | | None => Control.throw (Not_headed_by_a_reference expr (kind (head expr))) 27 | end. 28 | 29 | Ltac2 head_reference_hnf (expr : constr) : Std.reference := 30 | let expr' := eval hnf in $expr in 31 | match head_reference_opt expr' with 32 | | Some r => r 33 | | None => Control.throw (Not_headed_by_a_reference_in_hnf expr expr' (kind (head expr'))) 34 | end. 35 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Ident.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Import Ltac2.Printf. 3 | Require Ltac2.Ltac1. 4 | Require Export Rewriter.Util.FixCoqMistakes. 5 | 6 | Ltac2 of_constr (refine_to_named_lambda : Ltac1.t -> unit) (c : constr) : ident 7 | := let default () := Control.throw (Tactic_failure (Some (fprintf "Ident.of_constr: failure to make a name from %t" c))) in 8 | match Constr.Unsafe.kind '(ltac2:(refine_to_named_lambda (Ltac1.of_constr c))) with 9 | | Constr.Unsafe.Lambda x _ 10 | => match Constr.Binder.name x with 11 | | Some id => id 12 | | None => default () 13 | end 14 | | _ => default () 15 | end. 16 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/InstantiateEvar.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | 4 | Ltac2 in_evar (e : evar) (t : unit -> 'a) : 'a := 5 | let cell : 'a option ref := { contents := None } in 6 | Control.new_goal e > 7 | [ .. 8 | | let v := t () in cell.(contents) := Some v; Control.shelve () ]; 9 | Option.get (cell.(contents)). 10 | 11 | Module Evar. 12 | Ltac2 instantiate (e : evar) (c : unit -> constr) : unit := 13 | in_evar e (fun () => Control.refine c). 14 | End Evar. 15 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Iterate.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | 4 | Ltac2 rec iterate f n x := 5 | if Int.le n 0 then x else iterate f (Int.sub n 1) (f x). 6 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/List.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | 4 | (* Drop once the minimum dependency has been bumpped to 8.17 *) 5 | Ltac2 rec for_all2_aux (on_length_mismatch : 'a list -> 'b list -> bool) f xs ys := 6 | match xs with 7 | | [] => match ys with 8 | | [] => true 9 | | y :: ys' => on_length_mismatch xs ys 10 | end 11 | | x :: xs' 12 | => match ys with 13 | | [] => on_length_mismatch xs ys 14 | | y :: ys' 15 | => match f x y with 16 | | true => for_all2_aux on_length_mismatch f xs' ys' 17 | | false => false 18 | end 19 | end 20 | end. 21 | 22 | (* Drop once the minimum dependency has been bumpped to 8.17 *) 23 | Ltac2 equal f xs ys := for_all2_aux (fun _ _ => false) f xs ys. 24 | 25 | (* Drop once the minimum dependency has been bumpped to 8.19 *) 26 | Ltac2 rec fold_right (f : 'a -> 'b -> 'b) (ls : 'a list) (a : 'b) : 'b := 27 | match ls with 28 | | [] => a 29 | | l :: ls => f l (fold_right f ls a) 30 | end. 31 | 32 | (* Drop once the minimum dependency has been bumpped to 8.19 *) 33 | Ltac2 rec fold_left (f : 'a -> 'b -> 'a) (a : 'a) (xs : 'b list) : 'a := 34 | match xs with 35 | | [] => a 36 | | x :: xs => fold_left f (f a x) xs 37 | end. 38 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Ltac1.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | 4 | Ltac2 Type exn ::= [ Not_a_constr (string, Ltac1.t) ]. 5 | 6 | #[deprecated(since="8.15",note="Use Ltac2 instead.")] 7 | Ltac2 get_to_constr (debug_name : string) v := 8 | match Ltac1.to_constr v with 9 | | Some v => v 10 | | None => Control.throw (Not_a_constr debug_name v) 11 | end. 12 | 13 | #[deprecated(since="8.15",note="Use Ltac2 instead.")] 14 | Ltac2 apply_c (f : Ltac1.t) (args : constr list) : constr := 15 | '(ltac2:(Ltac1.apply f (List.map Ltac1.of_constr args) (fun v => Control.refine (fun () => get_to_constr "apply_c:arg" v)))). 16 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Message.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Import Ltac2.Printf. 3 | Require Export Rewriter.Util.FixCoqMistakes. 4 | Require Rewriter.Util.Tactics2.List. 5 | 6 | Ltac2 of_list (pr : 'a -> message) (ls : 'a list) : message 7 | := fprintf 8 | "[%a]" 9 | (fun () a => a) 10 | (match ls with 11 | | [] => fprintf "" 12 | | x :: xs 13 | => List.fold_left (fun init x => fprintf "%a, %a" (fun () a => a) init (fun () => pr) x) (pr x) xs 14 | end). 15 | 16 | Ltac2 of_binder (b : binder) : message 17 | := fprintf "%a : %t" (fun () a => a) (match Constr.Binder.name b with 18 | | Some n => fprintf "%I" n 19 | | None => fprintf "" 20 | end) 21 | (Constr.Binder.type b). 22 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Notations.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | 4 | Ltac2 Notation "strategy:(" s(strategy) ")" := s. 5 | Ltac2 Notation "occurrences:(" o(occurrences) ")" := o. 6 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Option.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | 4 | Ltac2 equal (eq : 'a -> 'b -> bool) (a : 'a option) (b : 'b option) : bool 5 | := match a with 6 | | None => match b with 7 | | None => true 8 | | _ => false 9 | end 10 | | Some a => match b with 11 | | Some b => eq a b 12 | | _ => false 13 | end 14 | end. 15 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Proj.v.v815: -------------------------------------------------------------------------------- 1 | Proj.v.v816 -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Proj.v.v816: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Import Ltac2.Constr. 4 | Import Constr.Unsafe. 5 | 6 | Ltac2 equal (x : projection) (y : projection) : bool 7 | := let dummy := make (Rel (-1)) in 8 | Constr.equal (make (Proj x dummy)) (make (Proj y dummy)). 9 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Proj.v.v817: -------------------------------------------------------------------------------- 1 | Proj.v.v818 -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Proj.v.v818: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Ltac2.Proj. 3 | Require Export Rewriter.Util.FixCoqMistakes. 4 | Import Ltac2.Constr. 5 | Import Constr.Unsafe. 6 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Proj.v.v819: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Ltac2.Proj. 3 | Require Export Rewriter.Util.FixCoqMistakes. 4 | Import Ltac2.Constr. 5 | Import Constr.Unsafe. 6 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Proj.v.v820: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Ltac2.Proj. 3 | Require Export Rewriter.Util.FixCoqMistakes. 4 | Import Ltac2.Constr. 5 | Import Constr.Unsafe. 6 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Proj.v.v821: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Ltac2.Proj. 3 | Require Export Rewriter.Util.FixCoqMistakes. 4 | Import Ltac2.Constr. 5 | Import Constr.Unsafe. 6 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Proj.v.v90: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Ltac2.Proj. 3 | Require Export Rewriter.Util.FixCoqMistakes. 4 | Import Ltac2.Constr. 5 | Import Constr.Unsafe. 6 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Proj.v.v91: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Ltac2.Proj. 3 | Require Export Rewriter.Util.FixCoqMistakes. 4 | Import Ltac2.Constr. 5 | Import Constr.Unsafe. 6 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/Proj.v.v92: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Ltac2.Proj. 3 | Require Export Rewriter.Util.FixCoqMistakes. 4 | Import Ltac2.Constr. 5 | Import Constr.Unsafe. 6 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/ReplaceByPattern.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Import Ltac2.Printf. 3 | Require Import Rewriter.Util.Tactics2.Constr. 4 | Require Import Rewriter.Util.Tactics2.Constr.Unsafe.MakeAbbreviations. 5 | Require Import Rewriter.Util.Tactics2.DecomposeLambda. 6 | Require Rewriter.Util.Tactics2.Message. 7 | Import Ltac2.Constr.Unsafe Tactics2.Constr.Unsafe DecomposeLambda.Constr.Unsafe. 8 | 9 | Module Constr. 10 | Export Ltac2.Constr Tactics2.Constr DecomposeLambda.Constr. 11 | Module Unsafe. 12 | Export Ltac2.Constr.Unsafe Tactics2.Constr.Unsafe DecomposeLambda.Constr.Unsafe. 13 | 14 | Ltac2 replace_by_pattern (from : constr list) (to : constr list) (term : constr) : constr := 15 | Control.assert_valid_argument "replace_by_pattern" (Int.gt (List.length from) 0); 16 | Control.assert_valid_argument "replace_by_pattern" (Int.equal (List.length from) (List.length to)); 17 | let term := Std.eval_pattern (List.map (fun c => (c, Std.AllOccurrences)) from) term in 18 | match kind_nocast term with 19 | | App term args 20 | => let (_, term) := decompose_lam_n_assum (List.length from) term in 21 | substnl (List.rev to) 0 term 22 | | _ => Control.throw (Tactic_failure (Some (fprintf "pattern returned non-app: %t" term))) 23 | end. 24 | End Unsafe. 25 | 26 | Ltac2 replace_by_pattern (from : constr list) (to : constr list) (term : constr) : constr := 27 | match Constr.Unsafe.check (Unsafe.replace_by_pattern from to term) with 28 | | Val v => v 29 | | Err err 30 | => Control.zero (Tactic_failure (Some (fprintf "Could not replace %a with %a in %t: %a" (fun () => Message.of_list Message.of_constr) from (fun () => Message.of_list Message.of_constr) to term (fun () => Message.of_exn) err))) 31 | end. 32 | End Constr. 33 | -------------------------------------------------------------------------------- /src/Rewriter/Util/Tactics2/String.v: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | Require Export Rewriter.Util.FixCoqMistakes. 3 | Require Rewriter.Util.Tactics2.Char. 4 | 5 | (** Special characters *) 6 | Ltac2 null () : string := String.make 1 (Char.null ()). 7 | Ltac2 backspace () : string := String.make 1 (Char.backspace ()). 8 | Ltac2 tab () : string := String.make 1 (Char.tab ()). 9 | Ltac2 lf () : string := String.make 1 (Char.lf ()). 10 | Ltac2 newpage () : string := String.make 1 (Char.newpage ()). 11 | Ltac2 cr () : string := String.make 1 (Char.cr ()). 12 | Ltac2 escape () : string := String.make 1 (Char.escape ()). 13 | Ltac2 newline () : string := String.make 1 (Char.newline ()). 14 | -------------------------------------------------------------------------------- /src/Rewriter/Util/TypeList.v: -------------------------------------------------------------------------------- 1 | Inductive t := nil | cons (T : Type) (vs : t). 2 | 3 | Fixpoint nth (n : nat) (l : t) (default : Type) {struct l} := 4 | match n, l with 5 | | O, cons x _ => x 6 | | S m, cons _ l => nth m l default 7 | | _, _ => default 8 | end. 9 | 10 | Module Export Notations. 11 | Declare Scope type_list_scope. 12 | Delimit Scope type_list_scope with type_list. 13 | Bind Scope type_list_scope with t. 14 | Notation "[ ]" := nil (format "[ ]") : type_list_scope. 15 | Notation "[ x ]" := (cons x nil) : type_list_scope. 16 | Notation "[ x ; y ; .. ; z ]" := (cons x (cons y .. (cons z nil) ..)) : type_list_scope. 17 | End Notations. 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/Ltac2Extra.v.v815: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | 3 | Declare ML Module "ltac2_extra_plugin". 4 | 5 | Module Ltac2. 6 | Module Constr. 7 | Export Ltac2.Constr. 8 | Ltac2 @ external equal_nounivs : constr -> constr -> bool := "ltac2" "constr_equal_nounivs". 9 | End Constr. 10 | End Ltac2. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/Ltac2Extra.v.v816: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | 3 | Declare ML Module "coq-rewriter.ltac2_extra". 4 | 5 | Module Ltac2. 6 | Module Constr. 7 | Export Ltac2.Constr. 8 | Ltac2 @ external equal_nounivs : constr -> constr -> bool := "ltac2" "constr_equal_nounivs". 9 | End Constr. 10 | End Ltac2. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/Ltac2Extra.v.v817: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | 3 | Declare ML Module "coq-rewriter.ltac2_extra". 4 | 5 | Module Ltac2. 6 | Module Constr. 7 | Export Ltac2.Constr. 8 | Ltac2 @ external equal_nounivs : constr -> constr -> bool := "ltac2" "constr_equal_nounivs". 9 | End Constr. 10 | End Ltac2. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/Ltac2Extra.v.v818: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | 3 | Declare ML Module "coq-rewriter.ltac2_extra". 4 | 5 | Module Ltac2. 6 | Module Constr. 7 | Export Ltac2.Constr. 8 | Ltac2 @ external equal_nounivs : constr -> constr -> bool := "coq-rewriter.ltac2_extra" "constr_equal_nounivs". 9 | End Constr. 10 | End Ltac2. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/Ltac2Extra.v.v819: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | 3 | Declare ML Module "coq-rewriter.ltac2_extra". 4 | 5 | Module Ltac2. 6 | Module Constr. 7 | Export Ltac2.Constr. 8 | Ltac2 @ external equal_nounivs : constr -> constr -> bool := "coq-rewriter.ltac2_extra" "constr_equal_nounivs". 9 | End Constr. 10 | End Ltac2. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/Ltac2Extra.v.v820: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | 3 | Declare ML Module "coq-rewriter.ltac2_extra". 4 | 5 | Module Ltac2. 6 | Module Constr. 7 | Export Ltac2.Constr. 8 | Ltac2 @ external equal_nounivs : constr -> constr -> bool := "coq-rewriter.ltac2_extra" "constr_equal_nounivs". 9 | End Constr. 10 | End Ltac2. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/Ltac2Extra.v.v821: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | 3 | Declare ML Module "coq-rewriter.ltac2_extra". 4 | 5 | Module Ltac2. 6 | Module Constr. 7 | Export Ltac2.Constr. 8 | Ltac2 @ external equal_nounivs : constr -> constr -> bool := "coq-rewriter.ltac2_extra" "constr_equal_nounivs". 9 | End Constr. 10 | End Ltac2. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/Ltac2Extra.v.v90: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | 3 | Declare ML Module "coq-rewriter.ltac2_extra". 4 | 5 | Module Ltac2. 6 | Module Constr. 7 | Export Ltac2.Constr. 8 | Ltac2 @ external equal_nounivs : constr -> constr -> bool := "coq-rewriter.ltac2_extra" "constr_equal_nounivs". 9 | End Constr. 10 | End Ltac2. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/Ltac2Extra.v.v91: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | 3 | Declare ML Module "coq-rewriter.ltac2_extra". 4 | 5 | Module Ltac2. 6 | Module Constr. 7 | Export Ltac2.Constr. 8 | Ltac2 @ external equal_nounivs : constr -> constr -> bool := "coq-rewriter.ltac2_extra" "constr_equal_nounivs". 9 | End Constr. 10 | End Ltac2. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/Ltac2Extra.v.v92: -------------------------------------------------------------------------------- 1 | Require Import Ltac2.Ltac2. 2 | 3 | Declare ML Module "coq-rewriter.ltac2_extra". 4 | 5 | Module Ltac2. 6 | Module Constr. 7 | Export Ltac2.Constr. 8 | Ltac2 @ external equal_nounivs : constr -> constr -> bool := "coq-rewriter.ltac2_extra" "constr_equal_nounivs". 9 | End Constr. 10 | End Ltac2. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuild.v.v815: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Util.plugins.RewriterBuildRegistry. 2 | 3 | Declare ML Module "rewriter_build_plugin". 4 | 5 | Ltac Rewrite_lhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_lhs_for verified_rewriter_package. 6 | Ltac Rewrite_rhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_rhs_for verified_rewriter_package. 7 | Ltac Rewrite_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_for verified_rewriter_package. 8 | 9 | Export Pre.RewriteRuleNotations. 10 | Export IdentifiersGenerateProofs.Compilers.pattern.ProofTactic.Settings. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuild.v.v816: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Util.plugins.RewriterBuildRegistry. 2 | 3 | Declare ML Module "coq-rewriter.rewriter_build". 4 | 5 | Ltac Rewrite_lhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_lhs_for verified_rewriter_package. 6 | Ltac Rewrite_rhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_rhs_for verified_rewriter_package. 7 | Ltac Rewrite_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_for verified_rewriter_package. 8 | 9 | Export Pre.RewriteRuleNotations. 10 | Export IdentifiersGenerateProofs.Compilers.pattern.ProofTactic.Settings. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuild.v.v817: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Util.plugins.RewriterBuildRegistry. 2 | 3 | Declare ML Module "coq-rewriter.rewriter_build". 4 | 5 | Ltac Rewrite_lhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_lhs_for verified_rewriter_package. 6 | Ltac Rewrite_rhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_rhs_for verified_rewriter_package. 7 | Ltac Rewrite_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_for verified_rewriter_package. 8 | 9 | Export Pre.RewriteRuleNotations. 10 | Export IdentifiersGenerateProofs.Compilers.pattern.ProofTactic.Settings. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuild.v.v818: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Util.plugins.RewriterBuildRegistry. 2 | 3 | Declare ML Module "coq-rewriter.rewriter_build". 4 | 5 | Ltac Rewrite_lhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_lhs_for verified_rewriter_package. 6 | Ltac Rewrite_rhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_rhs_for verified_rewriter_package. 7 | Ltac Rewrite_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_for verified_rewriter_package. 8 | 9 | Export Pre.RewriteRuleNotations. 10 | Export IdentifiersGenerateProofs.Compilers.pattern.ProofTactic.Settings. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuild.v.v819: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Util.plugins.RewriterBuildRegistry. 2 | 3 | Declare ML Module "coq-rewriter.rewriter_build". 4 | 5 | Ltac Rewrite_lhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_lhs_for verified_rewriter_package. 6 | Ltac Rewrite_rhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_rhs_for verified_rewriter_package. 7 | Ltac Rewrite_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_for verified_rewriter_package. 8 | 9 | Export Pre.RewriteRuleNotations. 10 | Export IdentifiersGenerateProofs.Compilers.pattern.ProofTactic.Settings. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuild.v.v820: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Util.plugins.RewriterBuildRegistry. 2 | 3 | Declare ML Module "coq-rewriter.rewriter_build". 4 | 5 | Ltac Rewrite_lhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_lhs_for verified_rewriter_package. 6 | Ltac Rewrite_rhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_rhs_for verified_rewriter_package. 7 | Ltac Rewrite_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_for verified_rewriter_package. 8 | 9 | Export Pre.RewriteRuleNotations. 10 | Export IdentifiersGenerateProofs.Compilers.pattern.ProofTactic.Settings. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuild.v.v821: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Util.plugins.RewriterBuildRegistry. 2 | 3 | Declare ML Module "coq-rewriter.rewriter_build". 4 | 5 | Ltac Rewrite_lhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_lhs_for verified_rewriter_package. 6 | Ltac Rewrite_rhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_rhs_for verified_rewriter_package. 7 | Ltac Rewrite_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_for verified_rewriter_package. 8 | 9 | Export Pre.RewriteRuleNotations. 10 | Export IdentifiersGenerateProofs.Compilers.pattern.ProofTactic.Settings. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuild.v.v90: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Util.plugins.RewriterBuildRegistry. 2 | 3 | Declare ML Module "coq-rewriter.rewriter_build". 4 | 5 | Ltac Rewrite_lhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_lhs_for verified_rewriter_package. 6 | Ltac Rewrite_rhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_rhs_for verified_rewriter_package. 7 | Ltac Rewrite_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_for verified_rewriter_package. 8 | 9 | Export Pre.RewriteRuleNotations. 10 | Export IdentifiersGenerateProofs.Compilers.pattern.ProofTactic.Settings. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuild.v.v91: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Util.plugins.RewriterBuildRegistry. 2 | 3 | Declare ML Module "coq-rewriter.rewriter_build". 4 | 5 | Ltac Rewrite_lhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_lhs_for verified_rewriter_package. 6 | Ltac Rewrite_rhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_rhs_for verified_rewriter_package. 7 | Ltac Rewrite_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_for verified_rewriter_package. 8 | 9 | Export Pre.RewriteRuleNotations. 10 | Export IdentifiersGenerateProofs.Compilers.pattern.ProofTactic.Settings. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuild.v.v92: -------------------------------------------------------------------------------- 1 | Require Import Rewriter.Util.plugins.RewriterBuildRegistry. 2 | 3 | Declare ML Module "coq-rewriter.rewriter_build". 4 | 5 | Ltac Rewrite_lhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_lhs_for verified_rewriter_package. 6 | Ltac Rewrite_rhs_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_rhs_for verified_rewriter_package. 7 | Ltac Rewrite_for verified_rewriter_package := RewriteRules.Tactic.Rewrite_for verified_rewriter_package. 8 | 9 | Export Pre.RewriteRuleNotations. 10 | Export IdentifiersGenerateProofs.Compilers.pattern.ProofTactic.Settings. 11 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuildRegistry.v.v815: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.plugins.RewriterBuildRegistryImports. 2 | 3 | Register Basic.GoalType.package_with_args as rewriter.basic_package_with_args.type. 4 | Register Basic.GoalType.base_elim_with_args as rewriter.base_elim_with_args.type. 5 | Register Basic.GoalType.ident_elim_with_args as rewriter.ident_elim_with_args.type. 6 | Register Basic.GoalType.ident_elim_with_args as rewriter.pattern_ident_elim_with_args.type. 7 | Register Basic.GoalType.ident_elim_with_args as rewriter.raw_ident_elim_with_args.type. 8 | Register ScrapedData.t_with_args as rewriter.scraped_data_with_args.type. 9 | Register rules_proofsT_with_args as rewriter.rules_proofs_with_args.type. 10 | Register InductiveHList.nil as rewriter.ident_list.nil. 11 | Register RewriteRules.GoalType.VerifiedRewriter_with_ind_args as rewriter.verified_rewriter_with_args.type. 12 | 13 | Ltac make_base_elim_with_args := Basic.PrintBase.make_base_elim. 14 | Ltac make_ident_elim_with_args := Basic.PrintIdent.make_ident_elim. 15 | Ltac make_pattern_ident_elim_with_args := Basic.PrintIdent.make_pattern_ident_elim. 16 | Ltac make_raw_ident_elim_with_args := Basic.PrintIdent.make_raw_ident_elim. 17 | Ltac make_basic_package_with_args := Basic.Tactic.make_package. 18 | Ltac make_scraped_data_with_args := Basic.ScrapeTactics.make_scrape_data. 19 | Ltac make_verified_rewriter_with_args := RewriteRules.Tactic.make_rewriter_all. 20 | Ltac make_rules_proofs_with_args := Basic.ScrapeTactics.make_rules_proofsT_with_args. 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuildRegistry.v.v816: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.plugins.RewriterBuildRegistryImports. 2 | 3 | Register Basic.GoalType.package_with_args as rewriter.basic_package_with_args.type. 4 | Register Basic.GoalType.base_elim_with_args as rewriter.base_elim_with_args.type. 5 | Register Basic.GoalType.ident_elim_with_args as rewriter.ident_elim_with_args.type. 6 | Register Basic.GoalType.ident_elim_with_args as rewriter.pattern_ident_elim_with_args.type. 7 | Register Basic.GoalType.ident_elim_with_args as rewriter.raw_ident_elim_with_args.type. 8 | Register ScrapedData.t_with_args as rewriter.scraped_data_with_args.type. 9 | Register rules_proofsT_with_args as rewriter.rules_proofs_with_args.type. 10 | Register InductiveHList.nil as rewriter.ident_list.nil. 11 | Register RewriteRules.GoalType.VerifiedRewriter_with_ind_args as rewriter.verified_rewriter_with_args.type. 12 | 13 | Ltac make_base_elim_with_args := Basic.PrintBase.make_base_elim. 14 | Ltac make_ident_elim_with_args := Basic.PrintIdent.make_ident_elim. 15 | Ltac make_pattern_ident_elim_with_args := Basic.PrintIdent.make_pattern_ident_elim. 16 | Ltac make_raw_ident_elim_with_args := Basic.PrintIdent.make_raw_ident_elim. 17 | Ltac make_basic_package_with_args := Basic.Tactic.make_package. 18 | Ltac make_scraped_data_with_args := Basic.ScrapeTactics.make_scrape_data. 19 | Ltac make_verified_rewriter_with_args := RewriteRules.Tactic.make_rewriter_all. 20 | Ltac make_rules_proofs_with_args := Basic.ScrapeTactics.make_rules_proofsT_with_args. 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuildRegistry.v.v817: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.plugins.RewriterBuildRegistryImports. 2 | 3 | Register Basic.GoalType.package_with_args as rewriter.basic_package_with_args.type. 4 | Register Basic.GoalType.base_elim_with_args as rewriter.base_elim_with_args.type. 5 | Register Basic.GoalType.ident_elim_with_args as rewriter.ident_elim_with_args.type. 6 | Register Basic.GoalType.ident_elim_with_args as rewriter.pattern_ident_elim_with_args.type. 7 | Register Basic.GoalType.ident_elim_with_args as rewriter.raw_ident_elim_with_args.type. 8 | Register ScrapedData.t_with_args as rewriter.scraped_data_with_args.type. 9 | Register rules_proofsT_with_args as rewriter.rules_proofs_with_args.type. 10 | Register InductiveHList.nil as rewriter.ident_list.nil. 11 | Register RewriteRules.GoalType.VerifiedRewriter_with_ind_args as rewriter.verified_rewriter_with_args.type. 12 | 13 | Ltac make_base_elim_with_args := Basic.PrintBase.make_base_elim. 14 | Ltac make_ident_elim_with_args := Basic.PrintIdent.make_ident_elim. 15 | Ltac make_pattern_ident_elim_with_args := Basic.PrintIdent.make_pattern_ident_elim. 16 | Ltac make_raw_ident_elim_with_args := Basic.PrintIdent.make_raw_ident_elim. 17 | Ltac make_basic_package_with_args := Basic.Tactic.make_package. 18 | Ltac make_scraped_data_with_args := Basic.ScrapeTactics.make_scrape_data. 19 | Ltac make_verified_rewriter_with_args := RewriteRules.Tactic.make_rewriter_all. 20 | Ltac make_rules_proofs_with_args := Basic.ScrapeTactics.make_rules_proofsT_with_args. 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuildRegistry.v.v818: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.plugins.RewriterBuildRegistryImports. 2 | 3 | Register Basic.GoalType.package_with_args as rewriter.basic_package_with_args.type. 4 | Register Basic.GoalType.base_elim_with_args as rewriter.base_elim_with_args.type. 5 | Register Basic.GoalType.ident_elim_with_args as rewriter.ident_elim_with_args.type. 6 | Register Basic.GoalType.ident_elim_with_args as rewriter.pattern_ident_elim_with_args.type. 7 | Register Basic.GoalType.ident_elim_with_args as rewriter.raw_ident_elim_with_args.type. 8 | Register ScrapedData.t_with_args as rewriter.scraped_data_with_args.type. 9 | Register rules_proofsT_with_args as rewriter.rules_proofs_with_args.type. 10 | Register InductiveHList.nil as rewriter.ident_list.nil. 11 | Register RewriteRules.GoalType.VerifiedRewriter_with_ind_args as rewriter.verified_rewriter_with_args.type. 12 | 13 | Ltac make_base_elim_with_args := Basic.PrintBase.make_base_elim. 14 | Ltac make_ident_elim_with_args := Basic.PrintIdent.make_ident_elim. 15 | Ltac make_pattern_ident_elim_with_args := Basic.PrintIdent.make_pattern_ident_elim. 16 | Ltac make_raw_ident_elim_with_args := Basic.PrintIdent.make_raw_ident_elim. 17 | Ltac make_basic_package_with_args := Basic.Tactic.make_package. 18 | Ltac make_scraped_data_with_args := Basic.ScrapeTactics.make_scrape_data. 19 | Ltac make_verified_rewriter_with_args := RewriteRules.Tactic.make_rewriter_all. 20 | Ltac make_rules_proofs_with_args := Basic.ScrapeTactics.make_rules_proofsT_with_args. 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuildRegistry.v.v819: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.plugins.RewriterBuildRegistryImports. 2 | 3 | Register Basic.GoalType.package_with_args as rewriter.basic_package_with_args.type. 4 | Register Basic.GoalType.base_elim_with_args as rewriter.base_elim_with_args.type. 5 | Register Basic.GoalType.ident_elim_with_args as rewriter.ident_elim_with_args.type. 6 | Register Basic.GoalType.ident_elim_with_args as rewriter.pattern_ident_elim_with_args.type. 7 | Register Basic.GoalType.ident_elim_with_args as rewriter.raw_ident_elim_with_args.type. 8 | Register ScrapedData.t_with_args as rewriter.scraped_data_with_args.type. 9 | Register rules_proofsT_with_args as rewriter.rules_proofs_with_args.type. 10 | Register InductiveHList.nil as rewriter.ident_list.nil. 11 | Register RewriteRules.GoalType.VerifiedRewriter_with_ind_args as rewriter.verified_rewriter_with_args.type. 12 | 13 | Ltac make_base_elim_with_args := Basic.PrintBase.make_base_elim. 14 | Ltac make_ident_elim_with_args := Basic.PrintIdent.make_ident_elim. 15 | Ltac make_pattern_ident_elim_with_args := Basic.PrintIdent.make_pattern_ident_elim. 16 | Ltac make_raw_ident_elim_with_args := Basic.PrintIdent.make_raw_ident_elim. 17 | Ltac make_basic_package_with_args := Basic.Tactic.make_package. 18 | Ltac make_scraped_data_with_args := Basic.ScrapeTactics.make_scrape_data. 19 | Ltac make_verified_rewriter_with_args := RewriteRules.Tactic.make_rewriter_all. 20 | Ltac make_rules_proofs_with_args := Basic.ScrapeTactics.make_rules_proofsT_with_args. 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuildRegistry.v.v820: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.plugins.RewriterBuildRegistryImports. 2 | 3 | Register Basic.GoalType.package_with_args as rewriter.basic_package_with_args.type. 4 | Register Basic.GoalType.base_elim_with_args as rewriter.base_elim_with_args.type. 5 | Register Basic.GoalType.ident_elim_with_args as rewriter.ident_elim_with_args.type. 6 | Register Basic.GoalType.ident_elim_with_args as rewriter.pattern_ident_elim_with_args.type. 7 | Register Basic.GoalType.ident_elim_with_args as rewriter.raw_ident_elim_with_args.type. 8 | Register ScrapedData.t_with_args as rewriter.scraped_data_with_args.type. 9 | Register rules_proofsT_with_args as rewriter.rules_proofs_with_args.type. 10 | Register InductiveHList.nil as rewriter.ident_list.nil. 11 | Register RewriteRules.GoalType.VerifiedRewriter_with_ind_args as rewriter.verified_rewriter_with_args.type. 12 | 13 | Ltac make_base_elim_with_args := Basic.PrintBase.make_base_elim. 14 | Ltac make_ident_elim_with_args := Basic.PrintIdent.make_ident_elim. 15 | Ltac make_pattern_ident_elim_with_args := Basic.PrintIdent.make_pattern_ident_elim. 16 | Ltac make_raw_ident_elim_with_args := Basic.PrintIdent.make_raw_ident_elim. 17 | Ltac make_basic_package_with_args := Basic.Tactic.make_package. 18 | Ltac make_scraped_data_with_args := Basic.ScrapeTactics.make_scrape_data. 19 | Ltac make_verified_rewriter_with_args := RewriteRules.Tactic.make_rewriter_all. 20 | Ltac make_rules_proofs_with_args := Basic.ScrapeTactics.make_rules_proofsT_with_args. 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuildRegistry.v.v821: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.plugins.RewriterBuildRegistryImports. 2 | 3 | Register Basic.GoalType.package_with_args as rewriter.basic_package_with_args.type. 4 | Register Basic.GoalType.base_elim_with_args as rewriter.base_elim_with_args.type. 5 | Register Basic.GoalType.ident_elim_with_args as rewriter.ident_elim_with_args.type. 6 | Register Basic.GoalType.ident_elim_with_args as rewriter.pattern_ident_elim_with_args.type. 7 | Register Basic.GoalType.ident_elim_with_args as rewriter.raw_ident_elim_with_args.type. 8 | Register ScrapedData.t_with_args as rewriter.scraped_data_with_args.type. 9 | Register rules_proofsT_with_args as rewriter.rules_proofs_with_args.type. 10 | Register InductiveHList.nil as rewriter.ident_list.nil. 11 | Register RewriteRules.GoalType.VerifiedRewriter_with_ind_args as rewriter.verified_rewriter_with_args.type. 12 | 13 | Ltac make_base_elim_with_args := Basic.PrintBase.make_base_elim. 14 | Ltac make_ident_elim_with_args := Basic.PrintIdent.make_ident_elim. 15 | Ltac make_pattern_ident_elim_with_args := Basic.PrintIdent.make_pattern_ident_elim. 16 | Ltac make_raw_ident_elim_with_args := Basic.PrintIdent.make_raw_ident_elim. 17 | Ltac make_basic_package_with_args := Basic.Tactic.make_package. 18 | Ltac make_scraped_data_with_args := Basic.ScrapeTactics.make_scrape_data. 19 | Ltac make_verified_rewriter_with_args := RewriteRules.Tactic.make_rewriter_all. 20 | Ltac make_rules_proofs_with_args := Basic.ScrapeTactics.make_rules_proofsT_with_args. 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuildRegistry.v.v90: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.plugins.RewriterBuildRegistryImports. 2 | 3 | Register Basic.GoalType.package_with_args as rewriter.basic_package_with_args.type. 4 | Register Basic.GoalType.base_elim_with_args as rewriter.base_elim_with_args.type. 5 | Register Basic.GoalType.ident_elim_with_args as rewriter.ident_elim_with_args.type. 6 | Register Basic.GoalType.ident_elim_with_args as rewriter.pattern_ident_elim_with_args.type. 7 | Register Basic.GoalType.ident_elim_with_args as rewriter.raw_ident_elim_with_args.type. 8 | Register ScrapedData.t_with_args as rewriter.scraped_data_with_args.type. 9 | Register rules_proofsT_with_args as rewriter.rules_proofs_with_args.type. 10 | Register InductiveHList.nil as rewriter.ident_list.nil. 11 | Register RewriteRules.GoalType.VerifiedRewriter_with_ind_args as rewriter.verified_rewriter_with_args.type. 12 | 13 | Ltac make_base_elim_with_args := Basic.PrintBase.make_base_elim. 14 | Ltac make_ident_elim_with_args := Basic.PrintIdent.make_ident_elim. 15 | Ltac make_pattern_ident_elim_with_args := Basic.PrintIdent.make_pattern_ident_elim. 16 | Ltac make_raw_ident_elim_with_args := Basic.PrintIdent.make_raw_ident_elim. 17 | Ltac make_basic_package_with_args := Basic.Tactic.make_package. 18 | Ltac make_scraped_data_with_args := Basic.ScrapeTactics.make_scrape_data. 19 | Ltac make_verified_rewriter_with_args := RewriteRules.Tactic.make_rewriter_all. 20 | Ltac make_rules_proofs_with_args := Basic.ScrapeTactics.make_rules_proofsT_with_args. 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuildRegistry.v.v91: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.plugins.RewriterBuildRegistryImports. 2 | 3 | Register Basic.GoalType.package_with_args as rewriter.basic_package_with_args.type. 4 | Register Basic.GoalType.base_elim_with_args as rewriter.base_elim_with_args.type. 5 | Register Basic.GoalType.ident_elim_with_args as rewriter.ident_elim_with_args.type. 6 | Register Basic.GoalType.ident_elim_with_args as rewriter.pattern_ident_elim_with_args.type. 7 | Register Basic.GoalType.ident_elim_with_args as rewriter.raw_ident_elim_with_args.type. 8 | Register ScrapedData.t_with_args as rewriter.scraped_data_with_args.type. 9 | Register rules_proofsT_with_args as rewriter.rules_proofs_with_args.type. 10 | Register InductiveHList.nil as rewriter.ident_list.nil. 11 | Register RewriteRules.GoalType.VerifiedRewriter_with_ind_args as rewriter.verified_rewriter_with_args.type. 12 | 13 | Ltac make_base_elim_with_args := Basic.PrintBase.make_base_elim. 14 | Ltac make_ident_elim_with_args := Basic.PrintIdent.make_ident_elim. 15 | Ltac make_pattern_ident_elim_with_args := Basic.PrintIdent.make_pattern_ident_elim. 16 | Ltac make_raw_ident_elim_with_args := Basic.PrintIdent.make_raw_ident_elim. 17 | Ltac make_basic_package_with_args := Basic.Tactic.make_package. 18 | Ltac make_scraped_data_with_args := Basic.ScrapeTactics.make_scrape_data. 19 | Ltac make_verified_rewriter_with_args := RewriteRules.Tactic.make_rewriter_all. 20 | Ltac make_rules_proofs_with_args := Basic.ScrapeTactics.make_rules_proofsT_with_args. 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuildRegistry.v.v92: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Util.plugins.RewriterBuildRegistryImports. 2 | 3 | Register Basic.GoalType.package_with_args as rewriter.basic_package_with_args.type. 4 | Register Basic.GoalType.base_elim_with_args as rewriter.base_elim_with_args.type. 5 | Register Basic.GoalType.ident_elim_with_args as rewriter.ident_elim_with_args.type. 6 | Register Basic.GoalType.ident_elim_with_args as rewriter.pattern_ident_elim_with_args.type. 7 | Register Basic.GoalType.ident_elim_with_args as rewriter.raw_ident_elim_with_args.type. 8 | Register ScrapedData.t_with_args as rewriter.scraped_data_with_args.type. 9 | Register rules_proofsT_with_args as rewriter.rules_proofs_with_args.type. 10 | Register InductiveHList.nil as rewriter.ident_list.nil. 11 | Register RewriteRules.GoalType.VerifiedRewriter_with_ind_args as rewriter.verified_rewriter_with_args.type. 12 | 13 | Ltac make_base_elim_with_args := Basic.PrintBase.make_base_elim. 14 | Ltac make_ident_elim_with_args := Basic.PrintIdent.make_ident_elim. 15 | Ltac make_pattern_ident_elim_with_args := Basic.PrintIdent.make_pattern_ident_elim. 16 | Ltac make_raw_ident_elim_with_args := Basic.PrintIdent.make_raw_ident_elim. 17 | Ltac make_basic_package_with_args := Basic.Tactic.make_package. 18 | Ltac make_scraped_data_with_args := Basic.ScrapeTactics.make_scrape_data. 19 | Ltac make_verified_rewriter_with_args := RewriteRules.Tactic.make_rewriter_all. 20 | Ltac make_rules_proofs_with_args := Basic.ScrapeTactics.make_rules_proofsT_with_args. 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/RewriterBuildRegistryImports.v: -------------------------------------------------------------------------------- 1 | Require Export Rewriter.Language.Pre. 2 | Require Import Rewriter.Language.PreLemmas. 3 | Require Export Rewriter.Language.IdentifiersBasicGenerate. 4 | Require Export Rewriter.Rewriter.ProofsCommon. 5 | Require Export Rewriter.Rewriter.AllTactics. 6 | Require Import Rewriter.Util.plugins.StrategyTactic. 7 | Export IdentifiersBasicGenerate.Compilers. 8 | Export ProofsCommon.Compilers. 9 | Export AllTactics.Compilers. 10 | Export PreLemmas.Instances. 11 | 12 | Ltac Pre.set_strategy_expand name ::= strategy -1000 [name]. 13 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/StrategyTactic.v.v815: -------------------------------------------------------------------------------- 1 | Declare ML Module "strategy_tactic_plugin". 2 | 3 | (* 4 | (* TEST: *) 5 | 6 | Definition id0 {A} (x : A) := x. 7 | Definition id1 {A} (x : A) := x. 8 | Definition id2 {A} (x : A) := id1 x. 9 | Definition id3 {A} (x : A) := id1 x. 10 | Definition id4 := id1 O. 11 | 12 | (* Works locally *) 13 | Goal exists x : nat, id0 x = id4. 14 | Proof. 15 | strategy 1000 [id0]; 16 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 O) end. 17 | Undo. 18 | strategy -1000 [id0]; 19 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 20 | reflexivity. 21 | Abort. 22 | 23 | (* works globally *) 24 | Goal exists x : nat, id0 x = id4. 25 | Proof. 26 | strategy -1000 [id0]; 27 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 28 | reflexivity. 29 | Defined. 30 | 31 | Goal exists x : nat, id0 x = id4. 32 | Proof. 33 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 34 | Abort. 35 | *) 36 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/StrategyTactic.v.v816: -------------------------------------------------------------------------------- 1 | Declare ML Module "coq-rewriter.strategy_tactic". 2 | 3 | (* 4 | (* TEST: *) 5 | 6 | Definition id0 {A} (x : A) := x. 7 | Definition id1 {A} (x : A) := x. 8 | Definition id2 {A} (x : A) := id1 x. 9 | Definition id3 {A} (x : A) := id1 x. 10 | Definition id4 := id1 O. 11 | 12 | (* Works locally *) 13 | Goal exists x : nat, id0 x = id4. 14 | Proof. 15 | strategy 1000 [id0]; 16 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 O) end. 17 | Undo. 18 | strategy -1000 [id0]; 19 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 20 | reflexivity. 21 | Abort. 22 | 23 | (* works globally *) 24 | Goal exists x : nat, id0 x = id4. 25 | Proof. 26 | strategy -1000 [id0]; 27 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 28 | reflexivity. 29 | Defined. 30 | 31 | Goal exists x : nat, id0 x = id4. 32 | Proof. 33 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 34 | Abort. 35 | *) 36 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/StrategyTactic.v.v817: -------------------------------------------------------------------------------- 1 | Declare ML Module "coq-rewriter.strategy_tactic". 2 | 3 | (* 4 | (* TEST: *) 5 | 6 | Definition id0 {A} (x : A) := x. 7 | Definition id1 {A} (x : A) := x. 8 | Definition id2 {A} (x : A) := id1 x. 9 | Definition id3 {A} (x : A) := id1 x. 10 | Definition id4 := id1 O. 11 | 12 | (* Works locally *) 13 | Goal exists x : nat, id0 x = id4. 14 | Proof. 15 | strategy 1000 [id0]; 16 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 O) end. 17 | Undo. 18 | strategy -1000 [id0]; 19 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 20 | reflexivity. 21 | Abort. 22 | 23 | (* works globally *) 24 | Goal exists x : nat, id0 x = id4. 25 | Proof. 26 | strategy -1000 [id0]; 27 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 28 | reflexivity. 29 | Defined. 30 | 31 | Goal exists x : nat, id0 x = id4. 32 | Proof. 33 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 34 | Abort. 35 | *) 36 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/StrategyTactic.v.v818: -------------------------------------------------------------------------------- 1 | Declare ML Module "coq-rewriter.strategy_tactic". 2 | 3 | (* 4 | (* TEST: *) 5 | 6 | Definition id0 {A} (x : A) := x. 7 | Definition id1 {A} (x : A) := x. 8 | Definition id2 {A} (x : A) := id1 x. 9 | Definition id3 {A} (x : A) := id1 x. 10 | Definition id4 := id1 O. 11 | 12 | (* Works locally *) 13 | Goal exists x : nat, id0 x = id4. 14 | Proof. 15 | strategy 1000 [id0]; 16 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 O) end. 17 | Undo. 18 | strategy -1000 [id0]; 19 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 20 | reflexivity. 21 | Abort. 22 | 23 | (* works globally *) 24 | Goal exists x : nat, id0 x = id4. 25 | Proof. 26 | strategy -1000 [id0]; 27 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 28 | reflexivity. 29 | Defined. 30 | 31 | Goal exists x : nat, id0 x = id4. 32 | Proof. 33 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 34 | Abort. 35 | *) 36 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/StrategyTactic.v.v819: -------------------------------------------------------------------------------- 1 | Declare ML Module "coq-rewriter.strategy_tactic". 2 | 3 | (* 4 | (* TEST: *) 5 | 6 | Definition id0 {A} (x : A) := x. 7 | Definition id1 {A} (x : A) := x. 8 | Definition id2 {A} (x : A) := id1 x. 9 | Definition id3 {A} (x : A) := id1 x. 10 | Definition id4 := id1 O. 11 | 12 | (* Works locally *) 13 | Goal exists x : nat, id0 x = id4. 14 | Proof. 15 | strategy 1000 [id0]; 16 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 O) end. 17 | Undo. 18 | strategy -1000 [id0]; 19 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 20 | reflexivity. 21 | Abort. 22 | 23 | (* works globally *) 24 | Goal exists x : nat, id0 x = id4. 25 | Proof. 26 | strategy -1000 [id0]; 27 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 28 | reflexivity. 29 | Defined. 30 | 31 | Goal exists x : nat, id0 x = id4. 32 | Proof. 33 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 34 | Abort. 35 | *) 36 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/StrategyTactic.v.v820: -------------------------------------------------------------------------------- 1 | Declare ML Module "coq-rewriter.strategy_tactic". 2 | 3 | (* 4 | (* TEST: *) 5 | 6 | Definition id0 {A} (x : A) := x. 7 | Definition id1 {A} (x : A) := x. 8 | Definition id2 {A} (x : A) := id1 x. 9 | Definition id3 {A} (x : A) := id1 x. 10 | Definition id4 := id1 O. 11 | 12 | (* Works locally *) 13 | Goal exists x : nat, id0 x = id4. 14 | Proof. 15 | strategy 1000 [id0]; 16 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 O) end. 17 | Undo. 18 | strategy -1000 [id0]; 19 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 20 | reflexivity. 21 | Abort. 22 | 23 | (* works globally *) 24 | Goal exists x : nat, id0 x = id4. 25 | Proof. 26 | strategy -1000 [id0]; 27 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 28 | reflexivity. 29 | Defined. 30 | 31 | Goal exists x : nat, id0 x = id4. 32 | Proof. 33 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 34 | Abort. 35 | *) 36 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/StrategyTactic.v.v821: -------------------------------------------------------------------------------- 1 | Declare ML Module "coq-rewriter.strategy_tactic". 2 | 3 | (* 4 | (* TEST: *) 5 | 6 | Definition id0 {A} (x : A) := x. 7 | Definition id1 {A} (x : A) := x. 8 | Definition id2 {A} (x : A) := id1 x. 9 | Definition id3 {A} (x : A) := id1 x. 10 | Definition id4 := id1 O. 11 | 12 | (* Works locally *) 13 | Goal exists x : nat, id0 x = id4. 14 | Proof. 15 | strategy 1000 [id0]; 16 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 O) end. 17 | Undo. 18 | strategy -1000 [id0]; 19 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 20 | reflexivity. 21 | Abort. 22 | 23 | (* works globally *) 24 | Goal exists x : nat, id0 x = id4. 25 | Proof. 26 | strategy -1000 [id0]; 27 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 28 | reflexivity. 29 | Defined. 30 | 31 | Goal exists x : nat, id0 x = id4. 32 | Proof. 33 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 34 | Abort. 35 | *) 36 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/StrategyTactic.v.v90: -------------------------------------------------------------------------------- 1 | Declare ML Module "coq-rewriter.strategy_tactic". 2 | 3 | (* 4 | (* TEST: *) 5 | 6 | Definition id0 {A} (x : A) := x. 7 | Definition id1 {A} (x : A) := x. 8 | Definition id2 {A} (x : A) := id1 x. 9 | Definition id3 {A} (x : A) := id1 x. 10 | Definition id4 := id1 O. 11 | 12 | (* Works locally *) 13 | Goal exists x : nat, id0 x = id4. 14 | Proof. 15 | strategy 1000 [id0]; 16 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 O) end. 17 | Undo. 18 | strategy -1000 [id0]; 19 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 20 | reflexivity. 21 | Abort. 22 | 23 | (* works globally *) 24 | Goal exists x : nat, id0 x = id4. 25 | Proof. 26 | strategy -1000 [id0]; 27 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 28 | reflexivity. 29 | Defined. 30 | 31 | Goal exists x : nat, id0 x = id4. 32 | Proof. 33 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 34 | Abort. 35 | *) 36 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/StrategyTactic.v.v91: -------------------------------------------------------------------------------- 1 | Declare ML Module "coq-rewriter.strategy_tactic". 2 | 3 | (* 4 | (* TEST: *) 5 | 6 | Definition id0 {A} (x : A) := x. 7 | Definition id1 {A} (x : A) := x. 8 | Definition id2 {A} (x : A) := id1 x. 9 | Definition id3 {A} (x : A) := id1 x. 10 | Definition id4 := id1 O. 11 | 12 | (* Works locally *) 13 | Goal exists x : nat, id0 x = id4. 14 | Proof. 15 | strategy 1000 [id0]; 16 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 O) end. 17 | Undo. 18 | strategy -1000 [id0]; 19 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 20 | reflexivity. 21 | Abort. 22 | 23 | (* works globally *) 24 | Goal exists x : nat, id0 x = id4. 25 | Proof. 26 | strategy -1000 [id0]; 27 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 28 | reflexivity. 29 | Defined. 30 | 31 | Goal exists x : nat, id0 x = id4. 32 | Proof. 33 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 34 | Abort. 35 | *) 36 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/StrategyTactic.v.v92: -------------------------------------------------------------------------------- 1 | Declare ML Module "coq-rewriter.strategy_tactic". 2 | 3 | (* 4 | (* TEST: *) 5 | 6 | Definition id0 {A} (x : A) := x. 7 | Definition id1 {A} (x : A) := x. 8 | Definition id2 {A} (x : A) := id1 x. 9 | Definition id3 {A} (x : A) := id1 x. 10 | Definition id4 := id1 O. 11 | 12 | (* Works locally *) 13 | Goal exists x : nat, id0 x = id4. 14 | Proof. 15 | strategy 1000 [id0]; 16 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 O) end. 17 | Undo. 18 | strategy -1000 [id0]; 19 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 20 | reflexivity. 21 | Abort. 22 | 23 | (* works globally *) 24 | Goal exists x : nat, id0 x = id4. 25 | Proof. 26 | strategy -1000 [id0]; 27 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 28 | reflexivity. 29 | Defined. 30 | 31 | Goal exists x : nat, id0 x = id4. 32 | Proof. 33 | eexists; lazymatch goal with |- ?x = ?y => unify x y; constr_eq x (id0 id4) end. 34 | Abort. 35 | *) 36 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.ml.v815: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | let make_definition_by_tactic sigma ~poly (name : Names.Id.t) (ty : EConstr.t) (tac : unit Proofview.tactic) = 4 | let cinfo = Declare.CInfo.make ~name ~typ:ty () in 5 | let info = Declare.Info.make ~poly () in 6 | let lemma = Declare.Proof.start ~cinfo ~info sigma in 7 | let lemma, _ = Declare.Proof.by tac lemma in 8 | let ids = Declare.Proof.save_regular ~proof:lemma ~opaque:Vernacexpr.Transparent ~idopt:None in 9 | match ids with 10 | | [Names.GlobRef.ConstRef cst] -> cst 11 | | _ -> CErrors.user_err (Pp.str "Internal error in make_definition_by_tactic") 12 | 13 | let vernac_make_definition_by_tactic ~poly (name : Names.Id.t) (ty : Constrexpr.constr_expr) tac = 14 | let env = Global.env () in 15 | let sigma = Evd.from_env env in 16 | let (sigma, ty) = Constrintern.interp_constr_evars env sigma ty in 17 | ignore(make_definition_by_tactic sigma ~poly name ty (Tacinterp.interp tac)) 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.ml.v816: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | let make_definition_by_tactic sigma ~poly (name : Names.Id.t) (ty : EConstr.t) (tac : unit Proofview.tactic) = 4 | let cinfo = Declare.CInfo.make ~name ~typ:ty () in 5 | let info = Declare.Info.make ~poly () in 6 | let lemma = Declare.Proof.start ~cinfo ~info sigma in 7 | let lemma, _ = Declare.Proof.by tac lemma in 8 | let ids = Declare.Proof.save_regular ~proof:lemma ~opaque:Vernacexpr.Transparent ~idopt:None in 9 | match ids with 10 | | [Names.GlobRef.ConstRef cst] -> cst 11 | | _ -> CErrors.user_err (Pp.str "Internal error in make_definition_by_tactic") 12 | 13 | let vernac_make_definition_by_tactic ~poly (name : Names.Id.t) (ty : Constrexpr.constr_expr) tac = 14 | let env = Global.env () in 15 | let sigma = Evd.from_env env in 16 | let (sigma, ty) = Constrintern.interp_constr_evars env sigma ty in 17 | ignore(make_definition_by_tactic sigma ~poly name ty (Tacinterp.interp tac)) 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.ml.v817: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | let make_definition_by_tactic sigma ~poly (name : Names.Id.t) (ty : EConstr.t) (tac : unit Proofview.tactic) = 4 | let cinfo = Declare.CInfo.make ~name ~typ:ty () in 5 | let info = Declare.Info.make ~poly () in 6 | let lemma = Declare.Proof.start ~cinfo ~info sigma in 7 | let lemma, _ = Declare.Proof.by tac lemma in 8 | let ids = Declare.Proof.save_regular ~proof:lemma ~opaque:Vernacexpr.Transparent ~idopt:None in 9 | match ids with 10 | | [Names.GlobRef.ConstRef cst] -> cst 11 | | _ -> CErrors.user_err (Pp.str "Internal error in make_definition_by_tactic") 12 | 13 | let vernac_make_definition_by_tactic ~poly (name : Names.Id.t) (ty : Constrexpr.constr_expr) tac = 14 | let env = Global.env () in 15 | let sigma = Evd.from_env env in 16 | let (sigma, ty) = Constrintern.interp_constr_evars env sigma ty in 17 | ignore(make_definition_by_tactic sigma ~poly name ty (Tacinterp.interp tac)) 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.ml.v818: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | let make_definition_by_tactic sigma ~poly (name : Names.Id.t) (ty : EConstr.t) (tac : unit Proofview.tactic) = 4 | let cinfo = Declare.CInfo.make ~name ~typ:ty () in 5 | let info = Declare.Info.make ~poly () in 6 | let lemma = Declare.Proof.start ~cinfo ~info sigma in 7 | let lemma, _ = Declare.Proof.by tac lemma in 8 | let ids = Declare.Proof.save_regular ~proof:lemma ~opaque:Vernacexpr.Transparent ~idopt:None in 9 | match ids with 10 | | [Names.GlobRef.ConstRef cst] -> cst 11 | | _ -> CErrors.user_err (Pp.str "Internal error in make_definition_by_tactic") 12 | 13 | let vernac_make_definition_by_tactic ~poly (name : Names.Id.t) (ty : Constrexpr.constr_expr) tac = 14 | let env = Global.env () in 15 | let sigma = Evd.from_env env in 16 | let (sigma, ty) = Constrintern.interp_constr_evars env sigma ty in 17 | ignore(make_definition_by_tactic sigma ~poly name ty (Tacinterp.interp tac)) 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.ml.v819: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | let make_definition_by_tactic sigma ~poly (name : Names.Id.t) (ty : EConstr.t) (tac : unit Proofview.tactic) = 4 | let cinfo = Declare.CInfo.make ~name ~typ:ty () in 5 | let info = Declare.Info.make ~poly () in 6 | let lemma = Declare.Proof.start ~cinfo ~info sigma in 7 | let lemma, _ = Declare.Proof.by tac lemma in 8 | let ids = Declare.Proof.save_regular ~proof:lemma ~opaque:Vernacexpr.Transparent ~idopt:None in 9 | match ids with 10 | | [Names.GlobRef.ConstRef cst] -> cst 11 | | _ -> CErrors.user_err (Pp.str "Internal error in make_definition_by_tactic") 12 | 13 | let vernac_make_definition_by_tactic ~poly (name : Names.Id.t) (ty : Constrexpr.constr_expr) tac = 14 | let env = Global.env () in 15 | let sigma = Evd.from_env env in 16 | let (sigma, ty) = Constrintern.interp_constr_evars env sigma ty in 17 | ignore(make_definition_by_tactic sigma ~poly name ty (Tacinterp.interp tac)) 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.ml.v820: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | let make_definition_by_tactic sigma ~poly (name : Names.Id.t) (ty : EConstr.t) (tac : unit Proofview.tactic) = 4 | let cinfo = Declare.CInfo.make ~name ~typ:ty () in 5 | let info = Declare.Info.make ~poly () in 6 | let lemma = Declare.Proof.start ~cinfo ~info sigma in 7 | let lemma, _ = Declare.Proof.by tac lemma in 8 | let ids = Declare.Proof.save_regular ~proof:lemma ~opaque:Vernacexpr.Transparent ~idopt:None in 9 | match ids with 10 | | [Names.GlobRef.ConstRef cst] -> cst 11 | | _ -> CErrors.user_err (Pp.str "Internal error in make_definition_by_tactic") 12 | 13 | let vernac_make_definition_by_tactic ~poly (name : Names.Id.t) (ty : Constrexpr.constr_expr) tac = 14 | let env = Global.env () in 15 | let sigma = Evd.from_env env in 16 | let (sigma, ty) = Constrintern.interp_constr_evars env sigma ty in 17 | ignore(make_definition_by_tactic sigma ~poly name ty (Tacinterp.interp tac)) 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.ml.v821: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | let make_definition_by_tactic sigma ~poly (name : Names.Id.t) (ty : EConstr.t) (tac : unit Proofview.tactic) = 4 | let cinfo = Declare.CInfo.make ~name ~typ:ty () in 5 | let info = Declare.Info.make ~poly () in 6 | let lemma = Declare.Proof.start ~cinfo ~info sigma in 7 | let lemma, _ = Declare.Proof.by tac lemma in 8 | let ids = Declare.Proof.save_regular ~proof:lemma ~opaque:Vernacexpr.Transparent ~idopt:None in 9 | match ids with 10 | | [Names.GlobRef.ConstRef cst] -> cst 11 | | _ -> CErrors.user_err (Pp.str "Internal error in make_definition_by_tactic") 12 | 13 | let vernac_make_definition_by_tactic ~poly (name : Names.Id.t) (ty : Constrexpr.constr_expr) tac = 14 | let env = Global.env () in 15 | let sigma = Evd.from_env env in 16 | let (sigma, ty) = Constrintern.interp_constr_evars env sigma ty in 17 | ignore(make_definition_by_tactic sigma ~poly name ty (Tacinterp.interp tac)) 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.ml.v90: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | let make_definition_by_tactic sigma ~poly (name : Names.Id.t) (ty : EConstr.t) (tac : unit Proofview.tactic) = 4 | let cinfo = Declare.CInfo.make ~name ~typ:ty () in 5 | let info = Declare.Info.make ~poly () in 6 | let lemma = Declare.Proof.start ~cinfo ~info sigma in 7 | let lemma, _ = Declare.Proof.by tac lemma in 8 | let ids = Declare.Proof.save_regular ~proof:lemma ~opaque:Vernacexpr.Transparent ~idopt:None in 9 | match ids with 10 | | [Names.GlobRef.ConstRef cst] -> cst 11 | | _ -> CErrors.user_err (Pp.str "Internal error in make_definition_by_tactic") 12 | 13 | let vernac_make_definition_by_tactic ~poly (name : Names.Id.t) (ty : Constrexpr.constr_expr) tac = 14 | let env = Global.env () in 15 | let sigma = Evd.from_env env in 16 | let (sigma, ty) = Constrintern.interp_constr_evars env sigma ty in 17 | ignore(make_definition_by_tactic sigma ~poly name ty (Tacinterp.interp tac)) 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.ml.v91: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | let make_definition_by_tactic sigma ~poly (name : Names.Id.t) (ty : EConstr.t) (tac : unit Proofview.tactic) = 4 | let cinfo = Declare.CInfo.make ~name ~typ:ty () in 5 | let info = Declare.Info.make ~poly () in 6 | let lemma = Declare.Proof.start ~cinfo ~info sigma in 7 | let lemma, _ = Declare.Proof.by tac lemma in 8 | let ids = Declare.Proof.save_regular ~proof:lemma ~opaque:Vernacexpr.Transparent ~idopt:None in 9 | match ids with 10 | | [Names.GlobRef.ConstRef cst] -> cst 11 | | _ -> CErrors.user_err (Pp.str "Internal error in make_definition_by_tactic") 12 | 13 | let vernac_make_definition_by_tactic ~poly (name : Names.Id.t) (ty : Constrexpr.constr_expr) tac = 14 | let env = Global.env () in 15 | let sigma = Evd.from_env env in 16 | let (sigma, ty) = Constrintern.interp_constr_evars env sigma ty in 17 | ignore(make_definition_by_tactic sigma ~poly name ty (Tacinterp.interp tac)) 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.ml.v92: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | let make_definition_by_tactic sigma ~poly (name : Names.Id.t) (ty : EConstr.t) (tac : unit Proofview.tactic) = 4 | let cinfo = Declare.CInfo.make ~name ~typ:ty () in 5 | let info = Declare.Info.make ~poly () in 6 | let lemma = Declare.Proof.start ~cinfo ~info sigma in 7 | let lemma, _ = Declare.Proof.by (Global.env ()) tac lemma in 8 | let ids = Declare.Proof.save_regular ~proof:lemma ~opaque:Vernacexpr.Transparent ~idopt:None in 9 | match ids with 10 | | [Names.GlobRef.ConstRef cst] -> cst 11 | | _ -> CErrors.user_err (Pp.str "Internal error in make_definition_by_tactic") 12 | 13 | let vernac_make_definition_by_tactic ~poly (name : Names.Id.t) (ty : Constrexpr.constr_expr) tac = 14 | let env = Global.env () in 15 | let sigma = Evd.from_env env in 16 | let (sigma, ty) = Constrintern.interp_constr_evars env sigma ty in 17 | ignore(make_definition_by_tactic sigma ~poly name ty (Tacinterp.interp tac)) 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.mli.v815: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | val make_definition_by_tactic 4 | : Evd.evar_map 5 | -> poly:bool 6 | -> Names.Id.t 7 | -> EConstr.t 8 | -> unit Proofview.tactic 9 | -> Names.Constant.t 10 | 11 | val vernac_make_definition_by_tactic : poly:bool -> Names.Id.t -> Constrexpr.constr_expr -> Tacexpr.raw_tactic_expr -> unit 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.mli.v816: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | val make_definition_by_tactic 4 | : Evd.evar_map 5 | -> poly:bool 6 | -> Names.Id.t 7 | -> EConstr.t 8 | -> unit Proofview.tactic 9 | -> Names.Constant.t 10 | 11 | val vernac_make_definition_by_tactic : poly:bool -> Names.Id.t -> Constrexpr.constr_expr -> Tacexpr.raw_tactic_expr -> unit 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.mli.v817: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | val make_definition_by_tactic 4 | : Evd.evar_map 5 | -> poly:bool 6 | -> Names.Id.t 7 | -> EConstr.t 8 | -> unit Proofview.tactic 9 | -> Names.Constant.t 10 | 11 | val vernac_make_definition_by_tactic : poly:bool -> Names.Id.t -> Constrexpr.constr_expr -> Tacexpr.raw_tactic_expr -> unit 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.mli.v818: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | val make_definition_by_tactic 4 | : Evd.evar_map 5 | -> poly:bool 6 | -> Names.Id.t 7 | -> EConstr.t 8 | -> unit Proofview.tactic 9 | -> Names.Constant.t 10 | 11 | val vernac_make_definition_by_tactic : poly:bool -> Names.Id.t -> Constrexpr.constr_expr -> Tacexpr.raw_tactic_expr -> unit 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.mli.v819: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | val make_definition_by_tactic 4 | : Evd.evar_map 5 | -> poly:bool 6 | -> Names.Id.t 7 | -> EConstr.t 8 | -> unit Proofview.tactic 9 | -> Names.Constant.t 10 | 11 | val vernac_make_definition_by_tactic : poly:bool -> Names.Id.t -> Constrexpr.constr_expr -> Tacexpr.raw_tactic_expr -> unit 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.mli.v820: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | val make_definition_by_tactic 4 | : Evd.evar_map 5 | -> poly:bool 6 | -> Names.Id.t 7 | -> EConstr.t 8 | -> unit Proofview.tactic 9 | -> Names.Constant.t 10 | 11 | val vernac_make_definition_by_tactic : poly:bool -> Names.Id.t -> Constrexpr.constr_expr -> Tacexpr.raw_tactic_expr -> unit 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.mli.v821: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | val make_definition_by_tactic 4 | : Evd.evar_map 5 | -> poly:bool 6 | -> Names.Id.t 7 | -> EConstr.t 8 | -> unit Proofview.tactic 9 | -> Names.Constant.t 10 | 11 | val vernac_make_definition_by_tactic : poly:bool -> Names.Id.t -> Constrexpr.constr_expr -> Tacexpr.raw_tactic_expr -> unit 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.mli.v90: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | val make_definition_by_tactic 4 | : Evd.evar_map 5 | -> poly:bool 6 | -> Names.Id.t 7 | -> EConstr.t 8 | -> unit Proofview.tactic 9 | -> Names.Constant.t 10 | 11 | val vernac_make_definition_by_tactic : poly:bool -> Names.Id.t -> Constrexpr.constr_expr -> Tacexpr.raw_tactic_expr -> unit 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.mli.v91: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | val make_definition_by_tactic 4 | : Evd.evar_map 5 | -> poly:bool 6 | -> Names.Id.t 7 | -> EConstr.t 8 | -> unit Proofview.tactic 9 | -> Names.Constant.t 10 | 11 | val vernac_make_definition_by_tactic : poly:bool -> Names.Id.t -> Constrexpr.constr_expr -> Tacexpr.raw_tactic_expr -> unit 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic.mli.v92: -------------------------------------------------------------------------------- 1 | open Ltac_plugin 2 | 3 | val make_definition_by_tactic 4 | : Evd.evar_map 5 | -> poly:bool 6 | -> Names.Id.t 7 | -> EConstr.t 8 | -> unit Proofview.tactic 9 | -> Names.Constant.t 10 | 11 | val vernac_make_definition_by_tactic : poly:bool -> Names.Id.t -> Constrexpr.constr_expr -> Tacexpr.raw_tactic_expr -> unit 12 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mlg.v815: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Ltac_plugin 5 | open Tacarg 6 | open Definition_by_tactic 7 | 8 | } 9 | 10 | DECLARE PLUGIN "definition_by_tactic_plugin" 11 | 12 | VERNAC COMMAND EXTEND DefinitionViaTactic CLASSIFIED AS SIDEFF 13 | | [ "Make" "Definition" ":" constr(ty) ":=" tactic(tac) ] -> { 14 | let poly = false in 15 | let name = Namegen.next_global_ident_away (Names.Id.of_string "Unnamed_thm") Names.Id.Set.empty in 16 | vernac_make_definition_by_tactic ~poly name ty tac 17 | } 18 | | [ "Make" "Definition" ident(name) ":" constr(ty) ":=" tactic(tac) ] -> { 19 | let poly = false in 20 | vernac_make_definition_by_tactic ~poly name ty tac 21 | } 22 | END 23 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mlg.v816: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Ltac_plugin 5 | open Tacarg 6 | open Definition_by_tactic 7 | 8 | } 9 | 10 | DECLARE PLUGIN "coq-rewriter.definition_by_tactic" 11 | 12 | VERNAC COMMAND EXTEND DefinitionViaTactic CLASSIFIED AS SIDEFF 13 | | [ "Make" "Definition" ":" constr(ty) ":=" tactic(tac) ] -> { 14 | let poly = false in 15 | let name = Namegen.next_global_ident_away (Names.Id.of_string "Unnamed_thm") Names.Id.Set.empty in 16 | vernac_make_definition_by_tactic ~poly name ty tac 17 | } 18 | | [ "Make" "Definition" ident(name) ":" constr(ty) ":=" tactic(tac) ] -> { 19 | let poly = false in 20 | vernac_make_definition_by_tactic ~poly name ty tac 21 | } 22 | END 23 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mlg.v817: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Ltac_plugin 5 | open Tacarg 6 | open Definition_by_tactic 7 | 8 | } 9 | 10 | DECLARE PLUGIN "coq-rewriter.definition_by_tactic" 11 | 12 | VERNAC COMMAND EXTEND DefinitionViaTactic CLASSIFIED AS SIDEFF 13 | | [ "Make" "Definition" ":" constr(ty) ":=" tactic(tac) ] -> { 14 | let poly = false in 15 | let name = Namegen.next_global_ident_away (Names.Id.of_string "Unnamed_thm") Names.Id.Set.empty in 16 | vernac_make_definition_by_tactic ~poly name ty tac 17 | } 18 | | [ "Make" "Definition" ident(name) ":" constr(ty) ":=" tactic(tac) ] -> { 19 | let poly = false in 20 | vernac_make_definition_by_tactic ~poly name ty tac 21 | } 22 | END 23 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mlg.v818: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Ltac_plugin 5 | open Tacarg 6 | open Definition_by_tactic 7 | 8 | } 9 | 10 | DECLARE PLUGIN "coq-rewriter.definition_by_tactic" 11 | 12 | VERNAC COMMAND EXTEND DefinitionViaTactic CLASSIFIED AS SIDEFF 13 | | [ "Make" "Definition" ":" constr(ty) ":=" tactic(tac) ] -> { 14 | let poly = false in 15 | let name = Namegen.next_global_ident_away (Names.Id.of_string "Unnamed_thm") Names.Id.Set.empty in 16 | vernac_make_definition_by_tactic ~poly name ty tac 17 | } 18 | | [ "Make" "Definition" ident(name) ":" constr(ty) ":=" tactic(tac) ] -> { 19 | let poly = false in 20 | vernac_make_definition_by_tactic ~poly name ty tac 21 | } 22 | END 23 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mlg.v819: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Ltac_plugin 5 | open Tacarg 6 | open Definition_by_tactic 7 | 8 | } 9 | 10 | DECLARE PLUGIN "coq-rewriter.definition_by_tactic" 11 | 12 | VERNAC COMMAND EXTEND DefinitionViaTactic CLASSIFIED AS SIDEFF 13 | | [ "Make" "Definition" ":" constr(ty) ":=" tactic(tac) ] -> { 14 | let poly = false in 15 | let name = Namegen.next_global_ident_away (Names.Id.of_string "Unnamed_thm") Names.Id.Set.empty in 16 | vernac_make_definition_by_tactic ~poly name ty tac 17 | } 18 | | [ "Make" "Definition" ident(name) ":" constr(ty) ":=" tactic(tac) ] -> { 19 | let poly = false in 20 | vernac_make_definition_by_tactic ~poly name ty tac 21 | } 22 | END 23 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mlg.v820: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Ltac_plugin 5 | open Tacarg 6 | open Definition_by_tactic 7 | 8 | } 9 | 10 | DECLARE PLUGIN "coq-rewriter.definition_by_tactic" 11 | 12 | VERNAC COMMAND EXTEND DefinitionViaTactic CLASSIFIED AS SIDEFF 13 | | [ "Make" "Definition" ":" constr(ty) ":=" tactic(tac) ] -> { 14 | let poly = false in 15 | let name = Namegen.next_global_ident_away (Names.Id.of_string "Unnamed_thm") Names.Id.Set.empty in 16 | vernac_make_definition_by_tactic ~poly name ty tac 17 | } 18 | | [ "Make" "Definition" ident(name) ":" constr(ty) ":=" tactic(tac) ] -> { 19 | let poly = false in 20 | vernac_make_definition_by_tactic ~poly name ty tac 21 | } 22 | END 23 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mlg.v821: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Ltac_plugin 5 | open Tacarg 6 | open Definition_by_tactic 7 | 8 | } 9 | 10 | DECLARE PLUGIN "coq-rewriter.definition_by_tactic" 11 | 12 | VERNAC COMMAND EXTEND DefinitionViaTactic CLASSIFIED AS SIDEFF 13 | | [ "Make" "Definition" ":" constr(ty) ":=" tactic(tac) ] -> { 14 | let poly = false in 15 | let name = Namegen.next_global_ident_away (Names.Id.of_string "Unnamed_thm") Names.Id.Set.empty in 16 | vernac_make_definition_by_tactic ~poly name ty tac 17 | } 18 | | [ "Make" "Definition" ident(name) ":" constr(ty) ":=" tactic(tac) ] -> { 19 | let poly = false in 20 | vernac_make_definition_by_tactic ~poly name ty tac 21 | } 22 | END 23 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mlg.v90: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Ltac_plugin 5 | open Tacarg 6 | open Definition_by_tactic 7 | 8 | } 9 | 10 | DECLARE PLUGIN "coq-rewriter.definition_by_tactic" 11 | 12 | VERNAC COMMAND EXTEND DefinitionViaTactic CLASSIFIED AS SIDEFF 13 | | [ "Make" "Definition" ":" constr(ty) ":=" tactic(tac) ] -> { 14 | let poly = false in 15 | let name = Namegen.next_global_ident_away (Names.Id.of_string "Unnamed_thm") Names.Id.Set.empty in 16 | vernac_make_definition_by_tactic ~poly name ty tac 17 | } 18 | | [ "Make" "Definition" ident(name) ":" constr(ty) ":=" tactic(tac) ] -> { 19 | let poly = false in 20 | vernac_make_definition_by_tactic ~poly name ty tac 21 | } 22 | END 23 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mlg.v91: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Ltac_plugin 5 | open Tacarg 6 | open Definition_by_tactic 7 | 8 | } 9 | 10 | DECLARE PLUGIN "coq-rewriter.definition_by_tactic" 11 | 12 | VERNAC COMMAND EXTEND DefinitionViaTactic CLASSIFIED AS SIDEFF 13 | | [ "Make" "Definition" ":" constr(ty) ":=" tactic(tac) ] -> { 14 | let poly = false in 15 | let name = Namegen.next_global_ident_away (Global.safe_env ()) (Names.Id.of_string "Unnamed_thm") Names.Id.Set.empty in 16 | vernac_make_definition_by_tactic ~poly name ty tac 17 | } 18 | | [ "Make" "Definition" ident(name) ":" constr(ty) ":=" tactic(tac) ] -> { 19 | let poly = false in 20 | vernac_make_definition_by_tactic ~poly name ty tac 21 | } 22 | END 23 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mlg.v92: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Ltac_plugin 5 | open Tacarg 6 | open Definition_by_tactic 7 | 8 | } 9 | 10 | DECLARE PLUGIN "coq-rewriter.definition_by_tactic" 11 | 12 | VERNAC COMMAND EXTEND DefinitionViaTactic CLASSIFIED AS SIDEFF 13 | | [ "Make" "Definition" ":" constr(ty) ":=" tactic(tac) ] -> { 14 | let poly = false in 15 | let name = Namegen.next_global_ident_away (Global.safe_env ()) (Names.Id.of_string "Unnamed_thm") Names.Id.Set.empty in 16 | vernac_make_definition_by_tactic ~poly name ty tac 17 | } 18 | | [ "Make" "Definition" ident(name) ":" constr(ty) ":=" tactic(tac) ] -> { 19 | let poly = false in 20 | vernac_make_definition_by_tactic ~poly name ty tac 21 | } 22 | END 23 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mllib.v815: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Definition_by_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mllib.v816: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Definition_by_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mllib.v817: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Definition_by_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mllib.v818: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Definition_by_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mllib.v819: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Definition_by_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mllib.v820: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Definition_by_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mllib.v821: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Definition_by_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mllib.v90: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Definition_by_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mllib.v91: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Definition_by_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/definition_by_tactic_plugin.mllib.v92: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Definition_by_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim.mli.v815: -------------------------------------------------------------------------------- 1 | val make_inductive_from_elim : Evd.evar_map -> Names.Id.t option -> EConstr.t -> Evd.evar_map * Names.inductive 2 | 3 | val vernac_make_inductive_from_elim : Names.Id.t option -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim.mli.v816: -------------------------------------------------------------------------------- 1 | val make_inductive_from_elim : Evd.evar_map -> Names.Id.t option -> EConstr.t -> Evd.evar_map * Names.inductive 2 | 3 | val vernac_make_inductive_from_elim : Names.Id.t option -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim.mli.v817: -------------------------------------------------------------------------------- 1 | val make_inductive_from_elim : Evd.evar_map -> Names.Id.t option -> EConstr.t -> Evd.evar_map * Names.inductive 2 | 3 | val vernac_make_inductive_from_elim : Names.Id.t option -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim.mli.v818: -------------------------------------------------------------------------------- 1 | val make_inductive_from_elim : Evd.evar_map -> Names.Id.t option -> EConstr.t -> Evd.evar_map * Names.inductive 2 | 3 | val vernac_make_inductive_from_elim : Names.Id.t option -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim.mli.v819: -------------------------------------------------------------------------------- 1 | val make_inductive_from_elim : Evd.evar_map -> Names.Id.t option -> EConstr.t -> Evd.evar_map * Names.inductive 2 | 3 | val vernac_make_inductive_from_elim : Names.Id.t option -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim.mli.v820: -------------------------------------------------------------------------------- 1 | val make_inductive_from_elim : Evd.evar_map -> Names.Id.t option -> EConstr.t -> Evd.evar_map * Names.inductive 2 | 3 | val vernac_make_inductive_from_elim : Names.Id.t option -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim.mli.v821: -------------------------------------------------------------------------------- 1 | val make_inductive_from_elim : Evd.evar_map -> Names.Id.t option -> EConstr.t -> Evd.evar_map * Names.inductive 2 | 3 | val vernac_make_inductive_from_elim : Names.Id.t option -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim.mli.v90: -------------------------------------------------------------------------------- 1 | val make_inductive_from_elim : Evd.evar_map -> Names.Id.t option -> EConstr.t -> Evd.evar_map * Names.inductive 2 | 3 | val vernac_make_inductive_from_elim : Names.Id.t option -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim.mli.v91: -------------------------------------------------------------------------------- 1 | val make_inductive_from_elim : Evd.evar_map -> Names.Id.t option -> EConstr.t -> Evd.evar_map * Names.inductive 2 | 3 | val vernac_make_inductive_from_elim : Names.Id.t option -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim.mli.v92: -------------------------------------------------------------------------------- 1 | val make_inductive_from_elim : Evd.evar_map -> Names.Id.t option -> EConstr.t -> Evd.evar_map * Names.inductive 2 | 3 | val vernac_make_inductive_from_elim : Names.Id.t option -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mlg.v815: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Inductive_from_elim 5 | 6 | } 7 | 8 | DECLARE PLUGIN "inductive_from_elim_plugin" 9 | 10 | VERNAC COMMAND EXTEND InductiveViaElim CLASSIFIED AS SIDEFF 11 | | [ "Make" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 12 | vernac_make_inductive_from_elim None elim_ty 13 | } 14 | | [ "Make" ident(name) ":=" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 15 | vernac_make_inductive_from_elim (Some name) elim_ty 16 | } 17 | END 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mlg.v816: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Inductive_from_elim 5 | 6 | } 7 | 8 | DECLARE PLUGIN "coq-rewriter.inductive_from_elim" 9 | 10 | VERNAC COMMAND EXTEND InductiveViaElim CLASSIFIED AS SIDEFF 11 | | [ "Make" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 12 | vernac_make_inductive_from_elim None elim_ty 13 | } 14 | | [ "Make" ident(name) ":=" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 15 | vernac_make_inductive_from_elim (Some name) elim_ty 16 | } 17 | END 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mlg.v817: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Inductive_from_elim 5 | 6 | } 7 | 8 | DECLARE PLUGIN "coq-rewriter.inductive_from_elim" 9 | 10 | VERNAC COMMAND EXTEND InductiveViaElim CLASSIFIED AS SIDEFF 11 | | [ "Make" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 12 | vernac_make_inductive_from_elim None elim_ty 13 | } 14 | | [ "Make" ident(name) ":=" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 15 | vernac_make_inductive_from_elim (Some name) elim_ty 16 | } 17 | END 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mlg.v818: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Inductive_from_elim 5 | 6 | } 7 | 8 | DECLARE PLUGIN "coq-rewriter.inductive_from_elim" 9 | 10 | VERNAC COMMAND EXTEND InductiveViaElim CLASSIFIED AS SIDEFF 11 | | [ "Make" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 12 | vernac_make_inductive_from_elim None elim_ty 13 | } 14 | | [ "Make" ident(name) ":=" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 15 | vernac_make_inductive_from_elim (Some name) elim_ty 16 | } 17 | END 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mlg.v819: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Inductive_from_elim 5 | 6 | } 7 | 8 | DECLARE PLUGIN "coq-rewriter.inductive_from_elim" 9 | 10 | VERNAC COMMAND EXTEND InductiveViaElim CLASSIFIED AS SIDEFF 11 | | [ "Make" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 12 | vernac_make_inductive_from_elim None elim_ty 13 | } 14 | | [ "Make" ident(name) ":=" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 15 | vernac_make_inductive_from_elim (Some name) elim_ty 16 | } 17 | END 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mlg.v820: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Inductive_from_elim 5 | 6 | } 7 | 8 | DECLARE PLUGIN "coq-rewriter.inductive_from_elim" 9 | 10 | VERNAC COMMAND EXTEND InductiveViaElim CLASSIFIED AS SIDEFF 11 | | [ "Make" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 12 | vernac_make_inductive_from_elim None elim_ty 13 | } 14 | | [ "Make" ident(name) ":=" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 15 | vernac_make_inductive_from_elim (Some name) elim_ty 16 | } 17 | END 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mlg.v821: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Inductive_from_elim 5 | 6 | } 7 | 8 | DECLARE PLUGIN "coq-rewriter.inductive_from_elim" 9 | 10 | VERNAC COMMAND EXTEND InductiveViaElim CLASSIFIED AS SIDEFF 11 | | [ "Make" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 12 | vernac_make_inductive_from_elim None elim_ty 13 | } 14 | | [ "Make" ident(name) ":=" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 15 | vernac_make_inductive_from_elim (Some name) elim_ty 16 | } 17 | END 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mlg.v90: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Inductive_from_elim 5 | 6 | } 7 | 8 | DECLARE PLUGIN "coq-rewriter.inductive_from_elim" 9 | 10 | VERNAC COMMAND EXTEND InductiveViaElim CLASSIFIED AS SIDEFF 11 | | [ "Make" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 12 | vernac_make_inductive_from_elim None elim_ty 13 | } 14 | | [ "Make" ident(name) ":=" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 15 | vernac_make_inductive_from_elim (Some name) elim_ty 16 | } 17 | END 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mlg.v91: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Inductive_from_elim 5 | 6 | } 7 | 8 | DECLARE PLUGIN "coq-rewriter.inductive_from_elim" 9 | 10 | VERNAC COMMAND EXTEND InductiveViaElim CLASSIFIED AS SIDEFF 11 | | [ "Make" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 12 | vernac_make_inductive_from_elim None elim_ty 13 | } 14 | | [ "Make" ident(name) ":=" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 15 | vernac_make_inductive_from_elim (Some name) elim_ty 16 | } 17 | END 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mlg.v92: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Stdarg 4 | open Inductive_from_elim 5 | 6 | } 7 | 8 | DECLARE PLUGIN "coq-rewriter.inductive_from_elim" 9 | 10 | VERNAC COMMAND EXTEND InductiveViaElim CLASSIFIED AS SIDEFF 11 | | [ "Make" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 12 | vernac_make_inductive_from_elim None elim_ty 13 | } 14 | | [ "Make" ident(name) ":=" "Inductive" "From" "Elim" "Type" constr(elim_ty) ] -> { 15 | vernac_make_inductive_from_elim (Some name) elim_ty 16 | } 17 | END 18 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mllib.v815: -------------------------------------------------------------------------------- 1 | Inductive_from_elim 2 | Inductive_from_elim_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mllib.v816: -------------------------------------------------------------------------------- 1 | Inductive_from_elim 2 | Inductive_from_elim_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mllib.v817: -------------------------------------------------------------------------------- 1 | Inductive_from_elim 2 | Inductive_from_elim_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mllib.v818: -------------------------------------------------------------------------------- 1 | Inductive_from_elim 2 | Inductive_from_elim_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mllib.v819: -------------------------------------------------------------------------------- 1 | Inductive_from_elim 2 | Inductive_from_elim_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mllib.v820: -------------------------------------------------------------------------------- 1 | Inductive_from_elim 2 | Inductive_from_elim_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mllib.v821: -------------------------------------------------------------------------------- 1 | Inductive_from_elim 2 | Inductive_from_elim_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mllib.v90: -------------------------------------------------------------------------------- 1 | Inductive_from_elim 2 | Inductive_from_elim_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mllib.v91: -------------------------------------------------------------------------------- 1 | Inductive_from_elim 2 | Inductive_from_elim_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/inductive_from_elim_plugin.mllib.v92: -------------------------------------------------------------------------------- 1 | Inductive_from_elim 2 | Inductive_from_elim_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.ml.v815: -------------------------------------------------------------------------------- 1 | open Ltac2_plugin 2 | open Tac2ffi 3 | open Tac2expr 4 | open Proofview.Notations 5 | 6 | let pname s = { mltac_plugin = "ltac2"; mltac_tactic = s } 7 | 8 | let define_primitive name arity f = 9 | Tac2env.define_primitive (pname name) (Tac2ffi.mk_closure arity f) 10 | 11 | let define2 name r0 r1 f = define_primitive name (arity_suc arity_one) begin fun x y -> 12 | f (Tac2ffi.repr_to r0 x) (Tac2ffi.repr_to r1 y) 13 | end 14 | 15 | let () = define2 "constr_equal_nounivs" constr constr begin fun c1 c2 -> 16 | Proofview.tclEVARMAP >>= fun sigma -> 17 | let b = EConstr.eq_constr_nounivs sigma c1 c2 in 18 | Proofview.tclUNIT (Tac2ffi.of_bool b) 19 | end 20 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.ml.v816: -------------------------------------------------------------------------------- 1 | open Ltac2_plugin 2 | open Tac2ffi 3 | open Tac2expr 4 | open Proofview.Notations 5 | 6 | let pname s = { mltac_plugin = "coq-core.plugins.ltac2"; mltac_tactic = s } 7 | 8 | let define_primitive name arity f = 9 | Tac2env.define_primitive (pname name) (Tac2ffi.mk_closure arity f) 10 | 11 | let define2 name r0 r1 f = define_primitive name (arity_suc arity_one) begin fun x y -> 12 | f (Tac2ffi.repr_to r0 x) (Tac2ffi.repr_to r1 y) 13 | end 14 | 15 | let () = define2 "constr_equal_nounivs" constr constr begin fun c1 c2 -> 16 | Proofview.tclEVARMAP >>= fun sigma -> 17 | let b = EConstr.eq_constr_nounivs sigma c1 c2 in 18 | Proofview.tclUNIT (Tac2ffi.of_bool b) 19 | end 20 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.ml.v817: -------------------------------------------------------------------------------- 1 | open Ltac2_plugin 2 | open Tac2ffi 3 | open Tac2expr 4 | open Proofview.Notations 5 | 6 | let pname s = { mltac_plugin = "coq-core.plugins.ltac2"; mltac_tactic = s } 7 | 8 | let define_primitive name arity f = 9 | Tac2env.define_primitive (pname name) (Tac2ffi.mk_closure arity f) 10 | 11 | let define2 name r0 r1 f = define_primitive name (arity_suc arity_one) begin fun x y -> 12 | f (Tac2ffi.repr_to r0 x) (Tac2ffi.repr_to r1 y) 13 | end 14 | 15 | let () = define2 "constr_equal_nounivs" constr constr begin fun c1 c2 -> 16 | Proofview.tclEVARMAP >>= fun sigma -> 17 | let b = EConstr.eq_constr_nounivs sigma c1 c2 in 18 | Proofview.tclUNIT (Tac2ffi.of_bool b) 19 | end 20 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.ml.v818: -------------------------------------------------------------------------------- 1 | open Ltac2_plugin 2 | open Tac2ffi 3 | open Tac2expr 4 | open Proofview.Notations 5 | 6 | let pname s = { mltac_plugin = "coq-rewriter.ltac2_extra"; mltac_tactic = s } 7 | 8 | let define_primitive name arity f = 9 | Tac2env.define_primitive (pname name) (Tac2ffi.mk_closure_val arity f) 10 | 11 | let define2 name r0 r1 f = define_primitive name (arity_suc arity_one) begin fun x y -> 12 | f (Tac2ffi.repr_to r0 x) (Tac2ffi.repr_to r1 y) 13 | end 14 | 15 | let () = define2 "constr_equal_nounivs" constr constr begin fun c1 c2 -> 16 | Proofview.tclEVARMAP >>= fun sigma -> 17 | let b = EConstr.eq_constr_nounivs sigma c1 c2 in 18 | Proofview.tclUNIT (Tac2ffi.of_bool b) 19 | end 20 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.ml.v819: -------------------------------------------------------------------------------- 1 | open Ltac2_plugin 2 | open Tac2ffi 3 | open Tac2expr 4 | open Proofview.Notations 5 | 6 | let pname s = { mltac_plugin = "coq-rewriter.ltac2_extra"; mltac_tactic = s } 7 | 8 | let define_primitive name arity f = 9 | Tac2env.define_primitive (pname name) (Tac2ffi.mk_closure_val arity f) 10 | 11 | let define2 name r0 r1 f = define_primitive name (arity_suc arity_one) begin fun x y -> 12 | f (Tac2ffi.repr_to r0 x) (Tac2ffi.repr_to r1 y) 13 | end 14 | 15 | let () = define2 "constr_equal_nounivs" constr constr begin fun c1 c2 -> 16 | Proofview.tclEVARMAP >>= fun sigma -> 17 | let b = EConstr.eq_constr_nounivs sigma c1 c2 in 18 | Proofview.tclUNIT (Tac2ffi.of_bool b) 19 | end 20 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.ml.v820: -------------------------------------------------------------------------------- 1 | open Ltac2_plugin 2 | open Tac2ffi 3 | open Tac2val 4 | open Tac2expr 5 | open Proofview.Notations 6 | 7 | let pname s = { mltac_plugin = "coq-rewriter.ltac2_extra"; mltac_tactic = s } 8 | 9 | let define_primitive name arity f = 10 | Tac2env.define_primitive (pname name) (Tac2val.mk_closure_val arity f) 11 | 12 | let define2 name r0 r1 f = define_primitive name (arity_suc arity_one) begin fun x y -> 13 | f (Tac2ffi.repr_to r0 x) (Tac2ffi.repr_to r1 y) 14 | end 15 | 16 | let () = define2 "constr_equal_nounivs" constr constr begin fun c1 c2 -> 17 | Proofview.tclEVARMAP >>= fun sigma -> 18 | let b = EConstr.eq_constr_nounivs sigma c1 c2 in 19 | Proofview.tclUNIT (Tac2ffi.of_bool b) 20 | end 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.ml.v821: -------------------------------------------------------------------------------- 1 | open Ltac2_plugin 2 | open Tac2ffi 3 | open Tac2val 4 | open Tac2expr 5 | open Proofview.Notations 6 | 7 | let pname s = { mltac_plugin = "coq-rewriter.ltac2_extra"; mltac_tactic = s } 8 | 9 | let define_primitive name arity f = 10 | Tac2env.define_primitive (pname name) (Tac2val.mk_closure_val arity f) 11 | 12 | let define2 name r0 r1 f = define_primitive name (arity_suc arity_one) begin fun x y -> 13 | f (Tac2ffi.repr_to r0 x) (Tac2ffi.repr_to r1 y) 14 | end 15 | 16 | let () = define2 "constr_equal_nounivs" constr constr begin fun c1 c2 -> 17 | Proofview.tclEVARMAP >>= fun sigma -> 18 | let b = EConstr.eq_constr_nounivs sigma c1 c2 in 19 | Proofview.tclUNIT (Tac2ffi.of_bool b) 20 | end 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.ml.v90: -------------------------------------------------------------------------------- 1 | open Ltac2_plugin 2 | open Tac2ffi 3 | open Tac2val 4 | open Tac2expr 5 | open Proofview.Notations 6 | 7 | let pname s = { mltac_plugin = "coq-rewriter.ltac2_extra"; mltac_tactic = s } 8 | 9 | let define_primitive name arity f = 10 | Tac2env.define_primitive (pname name) (Tac2val.mk_closure_val arity f) 11 | 12 | let define2 name r0 r1 f = define_primitive name (arity_suc arity_one) begin fun x y -> 13 | f (Tac2ffi.repr_to r0 x) (Tac2ffi.repr_to r1 y) 14 | end 15 | 16 | let () = define2 "constr_equal_nounivs" constr constr begin fun c1 c2 -> 17 | Proofview.tclEVARMAP >>= fun sigma -> 18 | let b = EConstr.eq_constr_nounivs sigma c1 c2 in 19 | Proofview.tclUNIT (Tac2ffi.of_bool b) 20 | end 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.ml.v91: -------------------------------------------------------------------------------- 1 | open Ltac2_plugin 2 | open Tac2ffi 3 | open Tac2val 4 | open Tac2expr 5 | open Proofview.Notations 6 | 7 | let pname s = { mltac_plugin = "coq-rewriter.ltac2_extra"; mltac_tactic = s } 8 | 9 | let define_primitive name arity f = 10 | Tac2env.define_primitive (pname name) (Tac2val.mk_closure_val arity f) 11 | 12 | let define2 name r0 r1 f = define_primitive name (arity_suc arity_one) begin fun x y -> 13 | f (Tac2ffi.repr_to r0 x) (Tac2ffi.repr_to r1 y) 14 | end 15 | 16 | let () = define2 "constr_equal_nounivs" constr constr begin fun c1 c2 -> 17 | Proofview.tclEVARMAP >>= fun sigma -> 18 | let b = EConstr.eq_constr_nounivs sigma c1 c2 in 19 | Proofview.tclUNIT (Tac2ffi.of_bool b) 20 | end 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.ml.v92: -------------------------------------------------------------------------------- 1 | open Ltac2_plugin 2 | open Tac2ffi 3 | open Tac2val 4 | open Tac2expr 5 | open Proofview.Notations 6 | 7 | let pname s = { mltac_plugin = "coq-rewriter.ltac2_extra"; mltac_tactic = s } 8 | 9 | let define_primitive name arity f = 10 | Tac2env.define_primitive (pname name) (Tac2val.mk_closure_val arity f) 11 | 12 | let define2 name r0 r1 f = define_primitive name (arity_suc arity_one) begin fun x y -> 13 | f (Tac2ffi.repr_to r0 x) (Tac2ffi.repr_to r1 y) 14 | end 15 | 16 | let () = define2 "constr_equal_nounivs" constr constr begin fun c1 c2 -> 17 | Proofview.tclEVARMAP >>= fun sigma -> 18 | let b = EConstr.eq_constr_nounivs sigma c1 c2 in 19 | Proofview.tclUNIT (Tac2ffi.of_bool b) 20 | end 21 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.mli.v815: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-plv/rewriter/5db7ca1925beb385f7d46c847a51359ee9d1a2c3/src/Rewriter/Util/plugins/ltac2_extra.mli.v815 -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.mli.v816: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-plv/rewriter/5db7ca1925beb385f7d46c847a51359ee9d1a2c3/src/Rewriter/Util/plugins/ltac2_extra.mli.v816 -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.mli.v817: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-plv/rewriter/5db7ca1925beb385f7d46c847a51359ee9d1a2c3/src/Rewriter/Util/plugins/ltac2_extra.mli.v817 -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.mli.v818: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-plv/rewriter/5db7ca1925beb385f7d46c847a51359ee9d1a2c3/src/Rewriter/Util/plugins/ltac2_extra.mli.v818 -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.mli.v819: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-plv/rewriter/5db7ca1925beb385f7d46c847a51359ee9d1a2c3/src/Rewriter/Util/plugins/ltac2_extra.mli.v819 -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.mli.v820: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-plv/rewriter/5db7ca1925beb385f7d46c847a51359ee9d1a2c3/src/Rewriter/Util/plugins/ltac2_extra.mli.v820 -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.mli.v821: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-plv/rewriter/5db7ca1925beb385f7d46c847a51359ee9d1a2c3/src/Rewriter/Util/plugins/ltac2_extra.mli.v821 -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.mli.v90: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-plv/rewriter/5db7ca1925beb385f7d46c847a51359ee9d1a2c3/src/Rewriter/Util/plugins/ltac2_extra.mli.v90 -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.mli.v91: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-plv/rewriter/5db7ca1925beb385f7d46c847a51359ee9d1a2c3/src/Rewriter/Util/plugins/ltac2_extra.mli.v91 -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra.mli.v92: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-plv/rewriter/5db7ca1925beb385f7d46c847a51359ee9d1a2c3/src/Rewriter/Util/plugins/ltac2_extra.mli.v92 -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mlg.v815: -------------------------------------------------------------------------------- 1 | DECLARE PLUGIN "coq-rewriter.ltac2_extra" 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mlg.v816: -------------------------------------------------------------------------------- 1 | DECLARE PLUGIN "coq-rewriter.ltac2_extra" 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mlg.v817: -------------------------------------------------------------------------------- 1 | DECLARE PLUGIN "coq-rewriter.ltac2_extra" 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mlg.v818: -------------------------------------------------------------------------------- 1 | DECLARE PLUGIN "coq-rewriter.ltac2_extra" 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mlg.v819: -------------------------------------------------------------------------------- 1 | DECLARE PLUGIN "coq-rewriter.ltac2_extra" 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mlg.v820: -------------------------------------------------------------------------------- 1 | DECLARE PLUGIN "coq-rewriter.ltac2_extra" 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mlg.v821: -------------------------------------------------------------------------------- 1 | DECLARE PLUGIN "coq-rewriter.ltac2_extra" 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mlg.v90: -------------------------------------------------------------------------------- 1 | DECLARE PLUGIN "coq-rewriter.ltac2_extra" 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mlg.v91: -------------------------------------------------------------------------------- 1 | DECLARE PLUGIN "coq-rewriter.ltac2_extra" 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mlg.v92: -------------------------------------------------------------------------------- 1 | DECLARE PLUGIN "coq-rewriter.ltac2_extra" 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mllib.v815: -------------------------------------------------------------------------------- 1 | Ltac2_extra 2 | Ltac2_extra_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mllib.v816: -------------------------------------------------------------------------------- 1 | Ltac2_extra 2 | Ltac2_extra_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mllib.v817: -------------------------------------------------------------------------------- 1 | Ltac2_extra 2 | Ltac2_extra_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mllib.v818: -------------------------------------------------------------------------------- 1 | Ltac2_extra 2 | Ltac2_extra_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mllib.v819: -------------------------------------------------------------------------------- 1 | Ltac2_extra 2 | Ltac2_extra_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mllib.v820: -------------------------------------------------------------------------------- 1 | Ltac2_extra 2 | Ltac2_extra_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mllib.v821: -------------------------------------------------------------------------------- 1 | Ltac2_extra 2 | Ltac2_extra_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mllib.v90: -------------------------------------------------------------------------------- 1 | Ltac2_extra 2 | Ltac2_extra_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mllib.v91: -------------------------------------------------------------------------------- 1 | Ltac2_extra 2 | Ltac2_extra_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/ltac2_extra_plugin.mllib.v92: -------------------------------------------------------------------------------- 1 | Ltac2_extra 2 | Ltac2_extra_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build.mli.v815: -------------------------------------------------------------------------------- 1 | val vernac_rewriter_emit_inductives : poly:bool -> Constrexpr.constr_expr -> Names.Id.t -> Names.Id.t -> Names.Id.t -> Names.Id.t -> unit 2 | 3 | val vernac_make_rewriter : poly:bool -> ?var_like_idents:(Constrexpr.constr_expr option) -> ?include_interp:bool -> ?skip_early_reduction:bool -> ?skip_early_reduction_no_dtree:bool -> ?extra:(Constrexpr.constr_expr option) -> Names.Id.t -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build.mli.v816: -------------------------------------------------------------------------------- 1 | val vernac_rewriter_emit_inductives : poly:bool -> Constrexpr.constr_expr -> Names.Id.t -> Names.Id.t -> Names.Id.t -> Names.Id.t -> unit 2 | 3 | val vernac_make_rewriter : poly:bool -> ?var_like_idents:(Constrexpr.constr_expr option) -> ?include_interp:bool -> ?skip_early_reduction:bool -> ?skip_early_reduction_no_dtree:bool -> ?extra:(Constrexpr.constr_expr option) -> Names.Id.t -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build.mli.v817: -------------------------------------------------------------------------------- 1 | val vernac_rewriter_emit_inductives : poly:bool -> Constrexpr.constr_expr -> Names.Id.t -> Names.Id.t -> Names.Id.t -> Names.Id.t -> unit 2 | 3 | val vernac_make_rewriter : poly:bool -> ?var_like_idents:(Constrexpr.constr_expr option) -> ?include_interp:bool -> ?skip_early_reduction:bool -> ?skip_early_reduction_no_dtree:bool -> ?extra:(Constrexpr.constr_expr option) -> Names.Id.t -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build.mli.v818: -------------------------------------------------------------------------------- 1 | val vernac_rewriter_emit_inductives : poly:bool -> Constrexpr.constr_expr -> Names.Id.t -> Names.Id.t -> Names.Id.t -> Names.Id.t -> unit 2 | 3 | val vernac_make_rewriter : poly:bool -> ?var_like_idents:(Constrexpr.constr_expr option) -> ?include_interp:bool -> ?skip_early_reduction:bool -> ?skip_early_reduction_no_dtree:bool -> ?extra:(Constrexpr.constr_expr option) -> Names.Id.t -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build.mli.v819: -------------------------------------------------------------------------------- 1 | val vernac_rewriter_emit_inductives : poly:bool -> Constrexpr.constr_expr -> Names.Id.t -> Names.Id.t -> Names.Id.t -> Names.Id.t -> unit 2 | 3 | val vernac_make_rewriter : poly:bool -> ?var_like_idents:(Constrexpr.constr_expr option) -> ?include_interp:bool -> ?skip_early_reduction:bool -> ?skip_early_reduction_no_dtree:bool -> ?extra:(Constrexpr.constr_expr option) -> Names.Id.t -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build.mli.v820: -------------------------------------------------------------------------------- 1 | val vernac_rewriter_emit_inductives : poly:bool -> Constrexpr.constr_expr -> Names.Id.t -> Names.Id.t -> Names.Id.t -> Names.Id.t -> unit 2 | 3 | val vernac_make_rewriter : poly:bool -> ?var_like_idents:(Constrexpr.constr_expr option) -> ?include_interp:bool -> ?skip_early_reduction:bool -> ?skip_early_reduction_no_dtree:bool -> ?extra:(Constrexpr.constr_expr option) -> Names.Id.t -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build.mli.v821: -------------------------------------------------------------------------------- 1 | val vernac_rewriter_emit_inductives : poly:bool -> Constrexpr.constr_expr -> Names.Id.t -> Names.Id.t -> Names.Id.t -> Names.Id.t -> unit 2 | 3 | val vernac_make_rewriter : poly:bool -> ?var_like_idents:(Constrexpr.constr_expr option) -> ?include_interp:bool -> ?skip_early_reduction:bool -> ?skip_early_reduction_no_dtree:bool -> ?extra:(Constrexpr.constr_expr option) -> Names.Id.t -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build.mli.v90: -------------------------------------------------------------------------------- 1 | val vernac_rewriter_emit_inductives : poly:bool -> Constrexpr.constr_expr -> Names.Id.t -> Names.Id.t -> Names.Id.t -> Names.Id.t -> unit 2 | 3 | val vernac_make_rewriter : poly:bool -> ?var_like_idents:(Constrexpr.constr_expr option) -> ?include_interp:bool -> ?skip_early_reduction:bool -> ?skip_early_reduction_no_dtree:bool -> ?extra:(Constrexpr.constr_expr option) -> Names.Id.t -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build.mli.v91: -------------------------------------------------------------------------------- 1 | val vernac_rewriter_emit_inductives : poly:bool -> Constrexpr.constr_expr -> Names.Id.t -> Names.Id.t -> Names.Id.t -> Names.Id.t -> unit 2 | 3 | val vernac_make_rewriter : poly:bool -> ?var_like_idents:(Constrexpr.constr_expr option) -> ?include_interp:bool -> ?skip_early_reduction:bool -> ?skip_early_reduction_no_dtree:bool -> ?extra:(Constrexpr.constr_expr option) -> Names.Id.t -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build.mli.v92: -------------------------------------------------------------------------------- 1 | val vernac_rewriter_emit_inductives : poly:bool -> Constrexpr.constr_expr -> Names.Id.t -> Names.Id.t -> Names.Id.t -> Names.Id.t -> unit 2 | 3 | val vernac_make_rewriter : poly:bool -> ?var_like_idents:(Constrexpr.constr_expr option) -> ?include_interp:bool -> ?skip_early_reduction:bool -> ?skip_early_reduction_no_dtree:bool -> ?extra:(Constrexpr.constr_expr option) -> Names.Id.t -> Constrexpr.constr_expr -> unit 4 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build_plugin.mllib.v815: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Inductive_from_elim 3 | Rewriter_build 4 | Rewriter_build_plugin 5 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build_plugin.mllib.v816: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Inductive_from_elim 3 | Rewriter_build 4 | Rewriter_build_plugin 5 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build_plugin.mllib.v817: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Inductive_from_elim 3 | Rewriter_build 4 | Rewriter_build_plugin 5 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build_plugin.mllib.v818: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Inductive_from_elim 3 | Rewriter_build 4 | Rewriter_build_plugin 5 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build_plugin.mllib.v819: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Inductive_from_elim 3 | Rewriter_build 4 | Rewriter_build_plugin 5 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build_plugin.mllib.v820: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Inductive_from_elim 3 | Rewriter_build 4 | Rewriter_build_plugin 5 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build_plugin.mllib.v821: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Inductive_from_elim 3 | Rewriter_build 4 | Rewriter_build_plugin 5 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build_plugin.mllib.v90: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Inductive_from_elim 3 | Rewriter_build 4 | Rewriter_build_plugin 5 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build_plugin.mllib.v91: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Inductive_from_elim 3 | Rewriter_build 4 | Rewriter_build_plugin 5 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/rewriter_build_plugin.mllib.v92: -------------------------------------------------------------------------------- 1 | Definition_by_tactic 2 | Inductive_from_elim 3 | Rewriter_build 4 | Rewriter_build_plugin 5 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.ml.v815: -------------------------------------------------------------------------------- 1 | let tclSTRATEGY ~local v (q : Names.GlobRef.t list) = 2 | Proofview.Goal.enter begin 3 | fun gl -> 4 | let env = Proofview.Goal.env gl in 5 | Redexpr.set_strategy local [(Conv_oracle.Level v, List.map (Tacred.evaluable_of_global_reference env) q)]; 6 | Proofview.tclUNIT () 7 | end 8 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.ml.v816: -------------------------------------------------------------------------------- 1 | let tclSTRATEGY ~local v (q : Names.GlobRef.t list) = 2 | Proofview.Goal.enter begin 3 | fun gl -> 4 | let env = Proofview.Goal.env gl in 5 | Redexpr.set_strategy local [(Conv_oracle.Level v, List.map (Tacred.evaluable_of_global_reference env) q)]; 6 | Proofview.tclUNIT () 7 | end 8 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.ml.v817: -------------------------------------------------------------------------------- 1 | let tclSTRATEGY ~local v (q : Names.GlobRef.t list) = 2 | Proofview.Goal.enter begin 3 | fun gl -> 4 | let env = Proofview.Goal.env gl in 5 | Redexpr.set_strategy local [(Conv_oracle.Level v, List.map (Tacred.evaluable_of_global_reference env) q)]; 6 | Proofview.tclUNIT () 7 | end 8 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.ml.v818: -------------------------------------------------------------------------------- 1 | let tclSTRATEGY ~local v (q : Names.GlobRef.t list) = 2 | Proofview.Goal.enter begin 3 | fun gl -> 4 | let env = Proofview.Goal.env gl in 5 | Redexpr.set_strategy local [(Conv_oracle.Level v, List.map (Tacred.evaluable_of_global_reference env) q)]; 6 | Proofview.tclUNIT () 7 | end 8 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.ml.v819: -------------------------------------------------------------------------------- 1 | let tclSTRATEGY ~local v (q : Names.GlobRef.t list) = 2 | Proofview.Goal.enter begin 3 | fun gl -> 4 | let env = Proofview.Goal.env gl in 5 | Redexpr.set_strategy local [(Conv_oracle.Level v, List.map (Tacred.evaluable_of_global_reference env) q)]; 6 | Proofview.tclUNIT () 7 | end 8 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.ml.v820: -------------------------------------------------------------------------------- 1 | let tclSTRATEGY ~local v (q : Names.GlobRef.t list) = 2 | Proofview.Goal.enter begin 3 | fun gl -> 4 | let env = Proofview.Goal.env gl in 5 | Redexpr.set_strategy local [(Conv_oracle.Level v, List.map (Tacred.evaluable_of_global_reference env) q)]; 6 | Proofview.tclUNIT () 7 | end 8 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.ml.v821: -------------------------------------------------------------------------------- 1 | let tclSTRATEGY ~local v (q : Names.GlobRef.t list) = 2 | Proofview.Goal.enter begin 3 | fun gl -> 4 | let env = Proofview.Goal.env gl in 5 | Redexpr.set_strategy local [(Conv_oracle.Level v, List.map (Tacred.evaluable_of_global_reference env) q)]; 6 | Proofview.tclUNIT () 7 | end 8 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.ml.v90: -------------------------------------------------------------------------------- 1 | let tclSTRATEGY ~local v (q : Names.GlobRef.t list) = 2 | Proofview.Goal.enter begin 3 | fun gl -> 4 | let env = Proofview.Goal.env gl in 5 | Redexpr.set_strategy local [(Conv_oracle.Level v, List.map (Tacred.evaluable_of_global_reference env) q)]; 6 | Proofview.tclUNIT () 7 | end 8 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.ml.v91: -------------------------------------------------------------------------------- 1 | let tclSTRATEGY ~local v (q : Names.GlobRef.t list) = 2 | Proofview.Goal.enter begin 3 | fun gl -> 4 | let env = Proofview.Goal.env gl in 5 | Redexpr.set_strategy local [(Conv_oracle.Level v, List.map (Tacred.evaluable_of_global_reference env) q)]; 6 | Proofview.tclUNIT () 7 | end 8 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.ml.v92: -------------------------------------------------------------------------------- 1 | let tclSTRATEGY ~local v (q : Names.GlobRef.t list) = 2 | Proofview.Goal.enter begin 3 | fun gl -> 4 | let env = Proofview.Goal.env gl in 5 | Redexpr.set_strategy local [(Conv_oracle.Level v, List.map (Tacred.evaluable_of_global_reference env) q)]; 6 | Proofview.tclUNIT () 7 | end 8 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.mli.v815: -------------------------------------------------------------------------------- 1 | val tclSTRATEGY : local:bool -> int -> Names.GlobRef.t list -> unit Proofview.tactic 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.mli.v816: -------------------------------------------------------------------------------- 1 | val tclSTRATEGY : local:bool -> int -> Names.GlobRef.t list -> unit Proofview.tactic 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.mli.v817: -------------------------------------------------------------------------------- 1 | val tclSTRATEGY : local:bool -> int -> Names.GlobRef.t list -> unit Proofview.tactic 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.mli.v818: -------------------------------------------------------------------------------- 1 | val tclSTRATEGY : local:bool -> int -> Names.GlobRef.t list -> unit Proofview.tactic 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.mli.v819: -------------------------------------------------------------------------------- 1 | val tclSTRATEGY : local:bool -> int -> Names.GlobRef.t list -> unit Proofview.tactic 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.mli.v820: -------------------------------------------------------------------------------- 1 | val tclSTRATEGY : local:bool -> int -> Names.GlobRef.t list -> unit Proofview.tactic 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.mli.v821: -------------------------------------------------------------------------------- 1 | val tclSTRATEGY : local:bool -> int -> Names.GlobRef.t list -> unit Proofview.tactic 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.mli.v90: -------------------------------------------------------------------------------- 1 | val tclSTRATEGY : local:bool -> int -> Names.GlobRef.t list -> unit Proofview.tactic 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.mli.v91: -------------------------------------------------------------------------------- 1 | val tclSTRATEGY : local:bool -> int -> Names.GlobRef.t list -> unit Proofview.tactic 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic.mli.v92: -------------------------------------------------------------------------------- 1 | val tclSTRATEGY : local:bool -> int -> Names.GlobRef.t list -> unit Proofview.tactic 2 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mlg.v815: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Ltac_plugin 4 | open Stdarg 5 | open Strategy_tactic 6 | 7 | } 8 | 9 | DECLARE PLUGIN "strategy_tactic_plugin" 10 | 11 | 12 | (* might be better to do strategy_level(v) ne_smart_global_list(q), but I can't get that working *) 13 | TACTIC EXTEND strategy 14 | | [ "strategy" int(v) "[" ne_reference_list(q) "]" ] -> { 15 | let local = true in 16 | tclSTRATEGY ~local v q 17 | } 18 | END 19 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mlg.v816: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Ltac_plugin 4 | open Stdarg 5 | open Strategy_tactic 6 | 7 | } 8 | 9 | DECLARE PLUGIN "coq-rewriter.strategy_tactic" 10 | 11 | 12 | (* might be better to do strategy_level(v) ne_smart_global_list(q), but I can't get that working *) 13 | TACTIC EXTEND strategy 14 | | [ "strategy" int(v) "[" ne_reference_list(q) "]" ] -> { 15 | let local = true in 16 | tclSTRATEGY ~local v q 17 | } 18 | END 19 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mlg.v817: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Ltac_plugin 4 | open Stdarg 5 | open Strategy_tactic 6 | 7 | } 8 | 9 | DECLARE PLUGIN "coq-rewriter.strategy_tactic" 10 | 11 | 12 | (* might be better to do strategy_level(v) ne_smart_global_list(q), but I can't get that working *) 13 | TACTIC EXTEND strategy 14 | | [ "strategy" int(v) "[" ne_reference_list(q) "]" ] -> { 15 | let local = true in 16 | tclSTRATEGY ~local v q 17 | } 18 | END 19 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mlg.v818: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Ltac_plugin 4 | open Stdarg 5 | open Strategy_tactic 6 | 7 | } 8 | 9 | DECLARE PLUGIN "coq-rewriter.strategy_tactic" 10 | 11 | 12 | (* might be better to do strategy_level(v) ne_smart_global_list(q), but I can't get that working *) 13 | TACTIC EXTEND strategy 14 | | [ "strategy" int(v) "[" ne_reference_list(q) "]" ] -> { 15 | let local = true in 16 | tclSTRATEGY ~local v q 17 | } 18 | END 19 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mlg.v819: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Ltac_plugin 4 | open Stdarg 5 | open Strategy_tactic 6 | 7 | } 8 | 9 | DECLARE PLUGIN "coq-rewriter.strategy_tactic" 10 | 11 | 12 | (* might be better to do strategy_level(v) ne_smart_global_list(q), but I can't get that working *) 13 | TACTIC EXTEND strategy 14 | | [ "strategy" int(v) "[" ne_reference_list(q) "]" ] -> { 15 | let local = true in 16 | tclSTRATEGY ~local v q 17 | } 18 | END 19 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mlg.v820: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Ltac_plugin 4 | open Stdarg 5 | open Strategy_tactic 6 | 7 | } 8 | 9 | DECLARE PLUGIN "coq-rewriter.strategy_tactic" 10 | 11 | 12 | (* might be better to do strategy_level(v) ne_smart_global_list(q), but I can't get that working *) 13 | TACTIC EXTEND strategy 14 | | [ "strategy" int(v) "[" ne_reference_list(q) "]" ] -> { 15 | let local = true in 16 | tclSTRATEGY ~local v q 17 | } 18 | END 19 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mlg.v821: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Ltac_plugin 4 | open Stdarg 5 | open Strategy_tactic 6 | 7 | } 8 | 9 | DECLARE PLUGIN "coq-rewriter.strategy_tactic" 10 | 11 | 12 | (* might be better to do strategy_level(v) ne_smart_global_list(q), but I can't get that working *) 13 | TACTIC EXTEND strategy 14 | | [ "strategy" int(v) "[" ne_reference_list(q) "]" ] -> { 15 | let local = true in 16 | tclSTRATEGY ~local v q 17 | } 18 | END 19 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mlg.v90: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Ltac_plugin 4 | open Stdarg 5 | open Strategy_tactic 6 | 7 | } 8 | 9 | DECLARE PLUGIN "coq-rewriter.strategy_tactic" 10 | 11 | 12 | (* might be better to do strategy_level(v) ne_smart_global_list(q), but I can't get that working *) 13 | TACTIC EXTEND strategy 14 | | [ "strategy" int(v) "[" ne_reference_list(q) "]" ] -> { 15 | let local = true in 16 | tclSTRATEGY ~local v q 17 | } 18 | END 19 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mlg.v91: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Ltac_plugin 4 | open Stdarg 5 | open Strategy_tactic 6 | 7 | } 8 | 9 | DECLARE PLUGIN "coq-rewriter.strategy_tactic" 10 | 11 | 12 | (* might be better to do strategy_level(v) ne_smart_global_list(q), but I can't get that working *) 13 | TACTIC EXTEND strategy 14 | | [ "strategy" int(v) "[" ne_reference_list(q) "]" ] -> { 15 | let local = true in 16 | tclSTRATEGY ~local v q 17 | } 18 | END 19 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mlg.v92: -------------------------------------------------------------------------------- 1 | { 2 | 3 | open Ltac_plugin 4 | open Stdarg 5 | open Strategy_tactic 6 | 7 | } 8 | 9 | DECLARE PLUGIN "coq-rewriter.strategy_tactic" 10 | 11 | 12 | (* might be better to do strategy_level(v) ne_smart_global_list(q), but I can't get that working *) 13 | TACTIC EXTEND strategy 14 | | [ "strategy" int(v) "[" ne_reference_list(q) "]" ] -> { 15 | let local = true in 16 | tclSTRATEGY ~local v q 17 | } 18 | END 19 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mllib.v815: -------------------------------------------------------------------------------- 1 | Strategy_tactic 2 | Strategy_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mllib.v816: -------------------------------------------------------------------------------- 1 | Strategy_tactic 2 | Strategy_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mllib.v817: -------------------------------------------------------------------------------- 1 | Strategy_tactic 2 | Strategy_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mllib.v818: -------------------------------------------------------------------------------- 1 | Strategy_tactic 2 | Strategy_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mllib.v819: -------------------------------------------------------------------------------- 1 | Strategy_tactic 2 | Strategy_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mllib.v820: -------------------------------------------------------------------------------- 1 | Strategy_tactic 2 | Strategy_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mllib.v821: -------------------------------------------------------------------------------- 1 | Strategy_tactic 2 | Strategy_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mllib.v90: -------------------------------------------------------------------------------- 1 | Strategy_tactic 2 | Strategy_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mllib.v91: -------------------------------------------------------------------------------- 1 | Strategy_tactic 2 | Strategy_tactic_plugin 3 | -------------------------------------------------------------------------------- /src/Rewriter/Util/plugins/strategy_tactic_plugin.mllib.v92: -------------------------------------------------------------------------------- 1 | Strategy_tactic 2 | Strategy_tactic_plugin 3 | --------------------------------------------------------------------------------