pax_global_header 0000666 0000000 0000000 00000000064 14547515630 0014524 g ustar 00root root 0000000 0000000 52 comment=8b1725c9d99e2f0ce6514998b125706aaeb550ac
hierarchy-builder-1.7.0/ 0000775 0000000 0000000 00000000000 14547515630 0015133 5 ustar 00root root 0000000 0000000 hierarchy-builder-1.7.0/.gitattributes 0000664 0000000 0000000 00000000040 14547515630 0020020 0 ustar 00root root 0000000 0000000 *.elpi linguist-language=prolog
hierarchy-builder-1.7.0/.github/ 0000775 0000000 0000000 00000000000 14547515630 0016473 5 ustar 00root root 0000000 0000000 hierarchy-builder-1.7.0/.github/workflows/ 0000775 0000000 0000000 00000000000 14547515630 0020530 5 ustar 00root root 0000000 0000000 hierarchy-builder-1.7.0/.github/workflows/main.yml 0000664 0000000 0000000 00000005266 14547515630 0022210 0 ustar 00root root 0000000 0000000 # This is a basic workflow to help you get started with Actions
name: docker CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
tags: [ "v*.*.*" ]
pull_request:
branches: [ master ]
jobs:
opam:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
coq_version:
- '8.18'
- '8.19'
steps:
- uses: actions/checkout@v2
- uses: coq-community/docker-coq-action@v1
with:
opam_file: './coq-hierarchy-builder.opam'
coq_version: ${{ matrix.coq_version }}
export: 'OPAMWITHTEST' # space-separated list of variables
env:
OPAMWITHTEST: 'true'
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [opam]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: Create archive
run: |
VERSION="${GITHUB_REF_NAME_SLUG#v}"
git archive -o hierarchy-builder-$VERSION.tar.gz --prefix=hierarchy-builder-$VERSION/ $GITHUB_SHA .
- name: Release
uses: softprops/action-gh-release@v1
with:
files: hierarchy-builder-*.tar.gz
fail_on_unmatched_files: true
prerelease: true
generate_release_notes: true
name: Hierarchy Builder ${{ github.ref }}
- name: Use OCaml 4.14.x
uses: avsm/setup-ocaml@v2
with:
ocaml-compiler: 4.14.x
opam-local-packages: |
!coq-hierarchy-builder*.opam
- name: Write PAT
env:
OPAM_PUBLISH_TOKEN: ${{ secrets.OPAM_PUBLISH_TOKEN }}
run: |
mkdir -p ~/.opam/plugins/opam-publish
printf "$OPAM_PUBLISH_TOKEN" > ~/.opam/plugins/opam-publish/coqelpibot.token
- name: Setup SSH
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.BOT_SSH_KEY }}
- name: Install opam-publish # 2.0.3 because more recent versions do not respect OPAMYES
run: opam install -y -j 2 opam-publish=2.0.3
- name: Publish
run: |
eval $(opam env)
git config --global user.name coqelpibot
git config --global user.email coqelpibot@inria.fr
OPAM_SUITE=released
TAG=`git tag --sort=-v:refname|head -1`
opam-publish --tag=$TAG --packages-directory=$OPAM_SUITE/packages --repo=coq/opam --no-browser -v ${TAG##v} https://github.com/math-comp/hierarchy-builder/releases/download/$TAG/hierarchy-builder-${TAG##v}.tar.gz
hierarchy-builder-1.7.0/.github/workflows/nix-action-coq-8.18.yml 0000664 0000000 0000000 00000252007 14547515630 0024506 0 ustar 00root root 0000000 0000000 jobs:
QuickChick:
needs:
- coq
- mathcomp-ssreflect
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target QuickChick
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"QuickChick\" \\\n --dry-run 2>&1 >\
\ /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\"\
\ | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq-ext-lib'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq-ext-lib"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: simple-io'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "simple-io"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "QuickChick"
Verdi:
needs:
- coq
- mathcomp-ssreflect
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target Verdi
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"Verdi\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: Cheerios'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "Cheerios"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: InfSeqExt'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "InfSeqExt"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "Verdi"
addition-chains:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-algebra
- mathcomp-fingroup
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target addition-chains
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"addition-chains\" \\\n --dry-run 2>&1\
\ > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"\
built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: paramcoq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "paramcoq"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "addition-chains"
autosubst:
needs:
- coq
- mathcomp-ssreflect
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target autosubst
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"autosubst\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "autosubst"
coq:
needs: []
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target coq
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"coq\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
coq-bits:
needs:
- coq
- mathcomp-algebra
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target coq-bits
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"coq-bits\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq-bits"
coqeal:
needs:
- coq
- mathcomp-algebra
- multinomials
- mathcomp-real-closed
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target coqeal
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"coqeal\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: bignums'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "bignums"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: paramcoq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "paramcoq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: multinomials'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "multinomials"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-real-closed'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-real-closed"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coqeal"
coquelicot:
needs:
- coq
- mathcomp-ssreflect
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target coquelicot
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"coquelicot\" \\\n --dry-run 2>&1 >\
\ /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\"\
\ | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coquelicot"
deriving:
needs:
- coq
- mathcomp-ssreflect
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target deriving
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"deriving\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "deriving"
fourcolor:
needs:
- coq
- mathcomp-algebra
- mathcomp-ssreflect
- mathcomp-fingroup
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target fourcolor
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"fourcolor\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "fourcolor"
hierarchy-builder:
needs:
- coq
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target hierarchy-builder
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"hierarchy-builder\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq-elpi'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq-elpi"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "hierarchy-builder"
interval:
needs:
- coq
- coquelicot
- mathcomp-ssreflect
- mathcomp-fingroup
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target interval
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"interval\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: bignums'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "bignums"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coquelicot'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coquelicot"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: flocq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "flocq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "interval"
mathcomp:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-fingroup
- mathcomp-algebra
- mathcomp-solvable
- mathcomp-field
- mathcomp-character
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"mathcomp\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-solvable'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-solvable"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-field'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-field"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-character'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-character"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp"
mathcomp-algebra:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-fingroup
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-algebra
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"mathcomp-algebra\" \\\n --dry-run 2>&1\
\ > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"\
built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-algebra"
mathcomp-bigenough:
needs:
- coq
- mathcomp-ssreflect
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-bigenough
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"mathcomp-bigenough\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-bigenough"
mathcomp-character:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-fingroup
- mathcomp-algebra
- mathcomp-solvable
- mathcomp-field
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-character
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"mathcomp-character\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-solvable'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-solvable"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-field'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-field"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-character"
mathcomp-field:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-fingroup
- mathcomp-algebra
- mathcomp-solvable
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-field
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"mathcomp-field\" \\\n --dry-run 2>&1\
\ > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"\
built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-solvable'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-solvable"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-field"
mathcomp-fingroup:
needs:
- coq
- mathcomp-ssreflect
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-fingroup
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"mathcomp-fingroup\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-fingroup"
mathcomp-finmap:
needs:
- coq
- mathcomp-ssreflect
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-finmap
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"mathcomp-finmap\" \\\n --dry-run 2>&1\
\ > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"\
built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-finmap"
mathcomp-real-closed:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-algebra
- mathcomp-field
- mathcomp-fingroup
- mathcomp-solvable
- mathcomp-bigenough
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-real-closed
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"mathcomp-real-closed\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-field'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-field"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-solvable'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-solvable"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-bigenough'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-bigenough"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-real-closed"
mathcomp-single:
needs:
- coq
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-single
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"mathcomp-single\" \\\n --dry-run 2>&1\
\ > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"\
built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-single"
mathcomp-solvable:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-fingroup
- mathcomp-algebra
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-solvable
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"mathcomp-solvable\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-solvable"
mathcomp-ssreflect:
needs:
- coq
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-ssreflect
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"mathcomp-ssreflect\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
multinomials:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-algebra
- mathcomp-finmap
- mathcomp-fingroup
- mathcomp-bigenough
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target multinomials
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"multinomials\" \\\n --dry-run 2>&1\
\ > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"\
built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-finmap'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-finmap"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-bigenough'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-bigenough"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "multinomials"
odd-order:
needs:
- coq
- mathcomp-character
- mathcomp-ssreflect
- mathcomp-fingroup
- mathcomp-algebra
- mathcomp-solvable
- mathcomp-field
- mathcomp
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target odd-order
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"odd-order\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-character'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-character"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-solvable'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-solvable"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-field'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-field"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "odd-order"
reglang:
needs:
- coq
- mathcomp-ssreflect
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target reglang
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.18\" --argstr job \"reglang\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
--argstr job "reglang"
name: Nix CI for bundle coq-8.18
'on':
pull_request:
paths:
- .github/workflows/nix-action-coq-8.18.yml
pull_request_target:
paths-ignore:
- .github/workflows/nix-action-coq-8.18.yml
types:
- opened
- synchronize
- reopened
push:
branches:
- master
hierarchy-builder-1.7.0/.github/workflows/nix-action-coq-8.19.yml 0000664 0000000 0000000 00000203207 14547515630 0024505 0 ustar 00root root 0000000 0000000 jobs:
coq:
needs: []
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target coq
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"coq\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
coq-bits:
needs:
- coq
- mathcomp-algebra
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target coq-bits
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"coq-bits\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq-bits"
coqeal:
needs:
- coq
- mathcomp-algebra
- multinomials
- mathcomp-real-closed
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target coqeal
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"coqeal\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: bignums'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "bignums"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: paramcoq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "paramcoq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: multinomials'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "multinomials"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-real-closed'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-real-closed"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coqeal"
deriving:
needs:
- coq
- mathcomp-ssreflect
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target deriving
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"deriving\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "deriving"
fourcolor:
needs:
- coq
- mathcomp-algebra
- mathcomp-ssreflect
- mathcomp-fingroup
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target fourcolor
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"fourcolor\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "fourcolor"
hierarchy-builder:
needs:
- coq
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target hierarchy-builder
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"hierarchy-builder\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq-elpi'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq-elpi"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "hierarchy-builder"
mathcomp:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-fingroup
- mathcomp-algebra
- mathcomp-solvable
- mathcomp-field
- mathcomp-character
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"mathcomp\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-solvable'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-solvable"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-field'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-field"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-character'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-character"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp"
mathcomp-algebra:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-fingroup
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-algebra
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"mathcomp-algebra\" \\\n --dry-run 2>&1\
\ > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"\
built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-algebra"
mathcomp-bigenough:
needs:
- coq
- mathcomp-ssreflect
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-bigenough
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"mathcomp-bigenough\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-bigenough"
mathcomp-character:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-fingroup
- mathcomp-algebra
- mathcomp-solvable
- mathcomp-field
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-character
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"mathcomp-character\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-solvable'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-solvable"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-field'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-field"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-character"
mathcomp-field:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-fingroup
- mathcomp-algebra
- mathcomp-solvable
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-field
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"mathcomp-field\" \\\n --dry-run 2>&1\
\ > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"\
built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-solvable'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-solvable"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-field"
mathcomp-fingroup:
needs:
- coq
- mathcomp-ssreflect
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-fingroup
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"mathcomp-fingroup\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-fingroup"
mathcomp-finmap:
needs:
- coq
- mathcomp-ssreflect
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-finmap
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"mathcomp-finmap\" \\\n --dry-run 2>&1\
\ > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"\
built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-finmap"
mathcomp-real-closed:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-algebra
- mathcomp-field
- mathcomp-fingroup
- mathcomp-solvable
- mathcomp-bigenough
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-real-closed
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"mathcomp-real-closed\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-field'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-field"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-solvable'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-solvable"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-bigenough'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-bigenough"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-real-closed"
mathcomp-single:
needs: []
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-single
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"mathcomp-single\" \\\n --dry-run 2>&1\
\ > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"\
built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-single"
mathcomp-solvable:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-fingroup
- mathcomp-algebra
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-solvable
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"mathcomp-solvable\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-solvable"
mathcomp-ssreflect:
needs:
- coq
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-ssreflect
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"mathcomp-ssreflect\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-ssreflect"
multinomials:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-algebra
- mathcomp-finmap
- mathcomp-fingroup
- mathcomp-bigenough
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target multinomials
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"multinomials\" \\\n --dry-run 2>&1\
\ > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"\
built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-finmap'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-finmap"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-bigenough'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-bigenough"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "multinomials"
odd-order:
needs:
- coq
- mathcomp-character
- mathcomp-ssreflect
- mathcomp-fingroup
- mathcomp-algebra
- mathcomp-solvable
- mathcomp-field
- mathcomp
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target odd-order
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"odd-order\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-character'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-character"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-solvable'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-solvable"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-field'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-field"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "odd-order"
reglang:
needs:
- coq
- mathcomp-ssreflect
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target reglang
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-8.19\" --argstr job \"reglang\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
--argstr job "reglang"
name: Nix CI for bundle coq-8.19
'on':
pull_request:
paths:
- .github/workflows/nix-action-coq-8.19.yml
pull_request_target:
paths-ignore:
- .github/workflows/nix-action-coq-8.19.yml
types:
- opened
- synchronize
- reopened
push:
branches:
- master
hierarchy-builder-1.7.0/.github/workflows/nix-action-coq-master.yml 0000664 0000000 0000000 00000222613 14547515630 0025403 0 ustar 00root root 0000000 0000000 jobs:
bignums:
needs:
- coq
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target bignums
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"bignums\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "bignums"
coq:
needs: []
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target coq
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"coq\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
coq-bits:
needs:
- coq
- mathcomp-algebra
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target coq-bits
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"coq-bits\" \\\n --dry-run 2>&1 >\
\ /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\"\
\ | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq-bits"
coq-elpi:
needs:
- coq
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target coq-elpi
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"coq-elpi\" \\\n --dry-run 2>&1 >\
\ /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\"\
\ | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq-elpi"
coqeal:
needs:
- coq
- mathcomp-algebra
- bignums
- paramcoq
- multinomials
- mathcomp-real-closed
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target coqeal
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"coqeal\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: bignums'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "bignums"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: paramcoq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "paramcoq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: multinomials'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "multinomials"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-real-closed'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-real-closed"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coqeal"
deriving:
needs:
- coq
- mathcomp-ssreflect
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target deriving
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"deriving\" \\\n --dry-run 2>&1 >\
\ /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\"\
\ | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "deriving"
fourcolor:
needs:
- coq
- mathcomp-algebra
- mathcomp-ssreflect
- mathcomp-fingroup
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target fourcolor
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"fourcolor\" \\\n --dry-run 2>&1 >\
\ /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\"\
\ | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "fourcolor"
hierarchy-builder:
needs:
- coq
- coq-elpi
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target hierarchy-builder
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"hierarchy-builder\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq-elpi'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq-elpi"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "hierarchy-builder"
mathcomp:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-fingroup
- mathcomp-algebra
- mathcomp-solvable
- mathcomp-field
- mathcomp-character
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"mathcomp\" \\\n --dry-run 2>&1 >\
\ /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\"\
\ | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-solvable'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-solvable"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-field'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-field"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-character'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-character"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp"
mathcomp-algebra:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-fingroup
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-algebra
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"mathcomp-algebra\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-algebra"
mathcomp-bigenough:
needs:
- coq
- mathcomp-ssreflect
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-bigenough
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"mathcomp-bigenough\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-bigenough"
mathcomp-character:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-fingroup
- mathcomp-algebra
- mathcomp-solvable
- mathcomp-field
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-character
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"mathcomp-character\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-solvable'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-solvable"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-field'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-field"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-character"
mathcomp-field:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-fingroup
- mathcomp-algebra
- mathcomp-solvable
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-field
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"mathcomp-field\" \\\n --dry-run 2>&1\
\ > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"\
built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-solvable'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-solvable"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-field"
mathcomp-fingroup:
needs:
- coq
- mathcomp-ssreflect
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-fingroup
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"mathcomp-fingroup\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-fingroup"
mathcomp-finmap:
needs:
- coq
- mathcomp-ssreflect
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-finmap
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"mathcomp-finmap\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-finmap"
mathcomp-real-closed:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-algebra
- mathcomp-field
- mathcomp-fingroup
- mathcomp-solvable
- mathcomp-bigenough
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-real-closed
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"mathcomp-real-closed\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-field'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-field"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-solvable'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-solvable"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-bigenough'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-bigenough"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-real-closed"
mathcomp-single:
needs: []
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-single
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"mathcomp-single\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-single"
mathcomp-solvable:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-fingroup
- mathcomp-algebra
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-solvable
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"mathcomp-solvable\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-solvable"
mathcomp-ssreflect:
needs:
- coq
- hierarchy-builder
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target mathcomp-ssreflect
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"mathcomp-ssreflect\" \\\n --dry-run\
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "hierarchy-builder"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-ssreflect"
multinomials:
needs:
- coq
- mathcomp-ssreflect
- mathcomp-algebra
- mathcomp-finmap
- mathcomp-fingroup
- mathcomp-bigenough
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target multinomials
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"multinomials\" \\\n --dry-run 2>&1\
\ > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"\
built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-finmap'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-finmap"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-bigenough'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-bigenough"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "multinomials"
odd-order:
needs:
- coq
- mathcomp-character
- mathcomp-ssreflect
- mathcomp-fingroup
- mathcomp-algebra
- mathcomp-solvable
- mathcomp-field
- mathcomp
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target odd-order
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"odd-order\" \\\n --dry-run 2>&1 >\
\ /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\"\
\ | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-character'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-character"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-fingroup'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-fingroup"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-algebra"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-solvable'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-solvable"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-field'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-field"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "odd-order"
paramcoq:
needs:
- coq
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target paramcoq
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"paramcoq\" \\\n --dry-run 2>&1 >\
\ /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\"\
\ | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "paramcoq"
reglang:
needs:
- coq
- mathcomp-ssreflect
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
\ }}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepCheck
name: Checking presence of CI target reglang
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
\ bundle \"coq-master\" --argstr job \"reglang\" \\\n --dry-run 2>&1 > /dev/null)\n\
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
s/.*/built/\") >> $GITHUB_OUTPUT\n"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "coq"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-ssreflect'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "mathcomp-ssreflect"
- if: steps.stepCheck.outputs.status == 'built'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
--argstr job "reglang"
name: Nix CI for bundle coq-master
'on':
pull_request:
paths:
- .github/workflows/nix-action-coq-master.yml
pull_request_target:
paths-ignore:
- .github/workflows/nix-action-coq-master.yml
types:
- opened
- synchronize
- reopened
push:
branches:
- master
hierarchy-builder-1.7.0/.gitignore 0000664 0000000 0000000 00000001050 14547515630 0017117 0 ustar 00root root 0000000 0000000 .*.aux
*.a
*.cma
*.cmi
*.cmo
*.cmx
*.cmxa
*.cmxs
*.glob
*.ml.d
*.ml4.d
*.mli.d
*.mllib.d
*.mlpack.d
*.native
*.coq.d
*.o
*.v.d
*.vio
*.vos
*.vok
*.vo
.coq-native/
.csdp.cache
.lia.cache
.nia.cache
.nlia.cache
.nra.cache
csdp.cache
lia.cache
nia.cache
nlia.cache
nra.cache
Makefile.coq
Makefile.coq.conf
.coqdeps.d
Makefile.test-suite.coq
Makefile.test-suite.coq.conf
.coqdeps.test-suite
*.v.hb
*.v.hb.old
coq.hb
HB/common/log.compat.elpi
_minted-*
*.aux
*.log
*.out
!*.v.out
*.synctex.gz
*.toc
*.vrb
*.fls
*.nav
*.bbl
*.blg
*.fdb_latexmk
*.vtc
*.dot
hierarchy-builder-1.7.0/.nix/ 0000775 0000000 0000000 00000000000 14547515630 0016007 5 ustar 00root root 0000000 0000000 hierarchy-builder-1.7.0/.nix/config.nix 0000664 0000000 0000000 00000002456 14547515630 0020003 0 ustar 00root root 0000000 0000000 {
format = "1.0.0";
attribute = "hierarchy-builder";
default-bundle = "coq-8.18";
bundles = let
mcHBcommon = {
mathcomp.override.version = "master";
mathcomp.job = true;
mathcomp-single.job = true;
graph-theory.job = false;
fourcolor.override.version = "master";
odd-order.override.version = "master";
mathcomp-finmap.override.version = "master";
mathcomp.analyis.override.version = "hierarchy-builder";
reglang.override.version = "master";
coq-bits.override.version = "master";
deriving.override.version = "master";
mathcomp-bigenough.override.version = "master";
multinomials.override.version = "master";
mathcomp-real-closed.override.version = "master";
coqeal.override.version = "master";
};
in {
"coq-master".coqPackages = mcHBcommon // {
coq.override.version = "master";
coq-elpi.override.version = "coq-master";
bignums.override.version = "master";
paramcoq.override.version = "master";
};
"coq-8.19".coqPackages = mcHBcommon // {
coq.override.version = "8.19";
};
"coq-8.18".coqPackages = mcHBcommon // {
coq.override.version = "8.18";
};
};
cachix.coq = {};
cachix.coq-community = {};
cachix.math-comp.authToken = "CACHIX_AUTH_TOKEN";
}
hierarchy-builder-1.7.0/.nix/coq-nix-toolbox.nix 0000664 0000000 0000000 00000000053 14547515630 0021567 0 ustar 00root root 0000000 0000000 "7e631f043d424ce82f3308824bf64fbfdee04c80"
hierarchy-builder-1.7.0/.nix/coq-overlays/ 0000775 0000000 0000000 00000000000 14547515630 0020433 5 ustar 00root root 0000000 0000000 hierarchy-builder-1.7.0/.nix/coq-overlays/coq-elpi/ 0000775 0000000 0000000 00000000000 14547515630 0022144 5 ustar 00root root 0000000 0000000 hierarchy-builder-1.7.0/.nix/coq-overlays/coq-elpi/default.nix 0000664 0000000 0000000 00000010104 14547515630 0024304 0 ustar 00root root 0000000 0000000 { lib, mkCoqDerivation, which, coq, version ? null }:
with builtins; with lib; let
elpi = coq.ocamlPackages.elpi.override (lib.switch coq.coq-version [
{ case = "8.11"; out = { version = "1.11.4"; };}
{ case = "8.12"; out = { version = "1.12.0"; };}
{ case = "8.13"; out = { version = "1.13.7"; };}
{ case = "8.14"; out = { version = "1.13.7"; };}
{ case = "8.15"; out = { version = "1.15.0"; };}
{ case = "8.16"; out = { version = "1.17.0"; };}
{ case = "8.17"; out = { version = "1.17.0"; };}
{ case = "8.18"; out = { version = "1.18.1"; };}
{ case = "8.19"; out = { version = "1.18.1"; };}
] {} );
in mkCoqDerivation {
pname = "elpi";
repo = "coq-elpi";
owner = "LPCIC";
inherit version;
defaultVersion = lib.switch coq.coq-version [
{ case = "8.19"; out = "2.0.1"; }
{ case = "8.18"; out = "2.0.0"; }
{ case = "8.17"; out = "1.18.0"; }
{ case = "8.16"; out = "1.15.6"; }
{ case = "8.15"; out = "1.14.0"; }
{ case = "8.14"; out = "1.11.2"; }
{ case = "8.13"; out = "1.11.1"; }
{ case = "8.12"; out = "1.8.3_8.12"; }
{ case = "8.11"; out = "1.6.3_8.11"; }
] null;
release."2.0.1".sha256 = "sha256-cuoPsEJ+JRLVc9Golt2rJj4P7lKltTrrmQijjoViooc=";
release."2.0.0".sha256 = "sha256-A/cH324M21k3SZ7+YWXtaYEbu6dZQq3K0cb1RMKjbsM=";
release."1.19.0".sha256 = "sha256-kGoo61nJxeG/BqV+iQaV3iinwPStND+7+fYMxFkiKrQ=";
release."1.18.0".sha256 = "sha256-2fCOlhqi4YkiL5n8SYHuc3pLH+DArf9zuMH7IhpBc2Y=";
release."1.17.0".sha256 = "sha256-J8GatRKFU0ekNCG3V5dBI+FXypeHcLgC5QJYGYzFiEM=";
release."1.15.6".sha256 = "sha256-qc0q01tW8NVm83801HHOBHe/7H1/F2WGDbKO6nCXfno=";
release."1.15.1".sha256 = "sha256-NT2RlcIsFB9AvBhMxil4ZZIgx+KusMqDflj2HgQxsZg=";
release."1.14.0".sha256 = "sha256:1v2p5dlpviwzky2i14cj7gcgf8cr0j54bdm9fl5iz1ckx60j6nvp";
release."1.13.0".sha256 = "1j7s7dlnjbw222gnbrsjgmjck1yrx7h6hwm8zikcyxi0zys17w7n";
release."1.12.1".sha256 = "sha256-4mO6/co7NcIQSGIQJyoO8lNWXr6dqz+bIYPO/G0cPkY=";
release."1.11.2".sha256 = "0qk5cfh15y2zrja7267629dybd3irvxk1raz7z8qfir25a81ckd4";
release."1.11.1".sha256 = "10j076vc2hdcbm15m6s7b6xdzibgfcbzlkgjnlkr2vv9k13qf8kc";
release."1.10.1".sha256 = "1zsyx26dvj7pznfd2msl2w7zbw51q1nsdw0bdvdha6dga7ijf7xk";
release."1.9.7".sha256 = "0rvn12h9dpk9s4pxy32p8j0a1h7ib7kg98iv1cbrdg25y5vs85n1";
release."1.9.5".sha256 = "0gjdwmb6bvb5gh0a6ra48bz5fb3pr5kpxijb7a8mfydvar5i9qr6";
release."1.9.4".sha256 = "0nii7238mya74f9g6147qmpg6gv6ic9b54x5v85nb6q60d9jh0jq";
release."1.9.3".sha256 = "198irm800fx3n8n56vx1c6f626cizp1d7jfkrc6ba4iqhb62ma0z";
release."1.9.2".sha256 = "1rr2fr8vjkc0is7vh1461aidz2iwkigdkp6bqss4hhv0c3ijnn07";
release."1.8.3_8.12".sha256 = "15z2l4zy0qpw0ws7bvsmpmyv543aqghrfnl48nlwzn9q0v89p557";
release."1.8.3_8.12".version = "1.8.3";
release."1.8.2_8.12".sha256 = "1n6jwcdazvjgj8vsv2r9zgwpw5yqr5a1ndc2pwhmhqfl04b5dk4y";
release."1.8.2_8.12".version = "1.8.2";
release."1.8.1".sha256 = "1fbbdccdmr8g4wwpihzp4r2xacynjznf817lhijw6kqfav75zd0r";
release."1.8.0".sha256 = "13ywjg94zkbki22hx7s4gfm9rr87r4ghsgan23xyl3l9z8q0idd1";
release."1.7.0".sha256 = "1ws5cqr0xawv69prgygbl3q6dgglbaw0vc397h9flh90kxaqgyh8";
release."1.6.3_8.11".sha256 = "1j340cr2bv95clzzkkfmsjkklham1mj84cmiyprzwv20q89zr1hp";
release."1.6.3_8.11".version = "1.6.3";
release."1.6.2_8.11".sha256 = "06xrx0ljilwp63ik2sxxr7h617dgbch042xfcnfpy5x96br147rn";
release."1.6.2_8.11".version = "1.6.2";
release."1.6.1_8.11".sha256 = "0yyyh35i1nb3pg4hw7cak15kj4y6y9l84nwar9k1ifdsagh5zq53";
release."1.6.1_8.11".version = "1.6.1";
release."1.6.0_8.11".sha256 = "0ahxjnzmd7kl3gl38kyjqzkfgllncr2ybnw8bvgrc6iddgga7bpq";
release."1.6.0_8.11".version = "1.6.0";
release."1.6.0".sha256 = "0kf99i43mlf750fr7fric764mm495a53mg5kahnbp6zcjcxxrm0b";
releaseRev = v: "v${v}";
buildFlags = [ "OCAMLWARN=" ];
mlPlugin = true;
propagatedBuildInputs = [ coq.ocamlPackages.findlib elpi ];
meta = {
description = "Coq plugin embedding ELPI.";
maintainers = [ maintainers.cohencyril ];
license = licenses.lgpl21Plus;
};
}
hierarchy-builder-1.7.0/.nix/coq-overlays/mathcomp-single/ 0000775 0000000 0000000 00000000000 14547515630 0023522 5 ustar 00root root 0000000 0000000 hierarchy-builder-1.7.0/.nix/coq-overlays/mathcomp-single/default.nix 0000664 0000000 0000000 00000000122 14547515630 0025661 0 ustar 00root root 0000000 0000000 { mathcomp, version ? null }:
mathcomp.override {single = true; inherit version;}
hierarchy-builder-1.7.0/.vscode/ 0000775 0000000 0000000 00000000000 14547515630 0016474 5 ustar 00root root 0000000 0000000 hierarchy-builder-1.7.0/.vscode/settings.json 0000664 0000000 0000000 00000007444 14547515630 0021240 0 ustar 00root root 0000000 0000000 {
"spellright.language": [],
"spellright.documentTypes": [
"markdown",
"plaintext"
],
"search.exclude": {
".*.aux": true,
"*.a": true,
"*.cma": true,
"*.cmi": true,
"*.cmo": true,
"*.cmx": true,
"*.cmxa": true,
"*.cmxs": true,
"*.glob": true,
"*.ml.d": true,
"*.ml4.d": true,
"*.mli.d": true,
"*.mllib.d": true,
"*.mlpack.d": true,
"*.native": true,
"*.o": true,
"*.v.d": true,
"*.vio": true,
"*.vo": true,
".coq-native/": true,
".csdp.cache": true,
".lia.cache": true,
".nia.cache": true,
".nlia.cache": true,
".nra.cache": true,
"csdp.cache": true,
"lia.cache": true,
"nia.cache": true,
"nlia.cache": true,
"nra.cache": true,
"Makefile.coq": true,
"Makefile.coq.conf": true,
".coqdeps.d": true,
"**/_minted-*": true,
"**/*.aux": true,
"**/*.log": true,
// "**/*.out": true, // .v.out is used for expected test output
"**/*.synctex.gz": true,
"**/*.toc": true,
"**/*.vrb": true,
"**/*.fls": true,
"**/*.nav": true,
"**/*.bbl": true,
"**/*.blg": true,
"**/*.fdb_latexmk": true,
"**/*.vtc": true
},
"files.exclude": {
".*.aux": true,
"*.a": true,
"*.cma": true,
"*.cmi": true,
"*.cmo": true,
"*.cmx": true,
"*.cmxa": true,
"*.cmxs": true,
"*.glob": true,
"*.ml.d": true,
"*.ml4.d": true,
"*.mli.d": true,
"*.mllib.d": true,
"*.mlpack.d": true,
"*.native": true,
"*.o": true,
"*.v.d": true,
"*.vio": true,
"*.vo": true,
".coq-native/": true,
".csdp.cache": true,
".lia.cache": true,
".nia.cache": true,
".nlia.cache": true,
".nra.cache": true,
"csdp.cache": true,
"lia.cache": true,
"nia.cache": true,
"nlia.cache": true,
"nra.cache": true,
"Makefile.coq": true,
"Makefile.coq.conf": true,
".coqdeps.d": true,
"**/_minted-*": true,
"**/*.aux": true,
"**/*.log": true,
// "**/*.out": true, // .v.out is used for expected test output
"**/*.synctex.gz": true,
"**/*.toc": true,
"**/*.vrb": true,
"**/*.fls": true,
"**/*.nav": true,
"**/*.bbl": true,
"**/*.blg": true,
"**/*.fdb_latexmk": true,
"**/*.vtc": true,
"**/.*.aux": true,
"**/*.a": true,
"**/*.cma": true,
"**/*.cmi": true,
"**/*.cmo": true,
"**/*.cmx": true,
"**/*.cmxa": true,
"**/*.cmxs": true,
"**/*.glob": true,
"**/*.ml.d": true,
"**/*.ml4.d": true,
"**/*.mli.d": true,
"**/*.mllib.d": true,
"**/*.mlpack.d": true,
"**/*.native": true,
"**/*.coq.d": true,
"**/*.o": true,
"**/*.v.d": true,
"**/*.vio": true,
"**/*.vos": true,
"**/*.vok": true,
"**/*.vo": true,
"**/.coq-native/": true,
"**/.csdp.cache": true,
"**/.lia.cache": true,
"**/.nia.cache": true,
"**/.nlia.cache": true,
"**/.nra.cache": true,
"**/csdp.cache": true,
"**/lia.cache": true,
"**/nia.cache": true,
"**/nlia.cache": true,
"**/nra.cache": true,
"**/Makefile.coq": true,
"**/Makefile.coq.conf": true,
"**/.coqdeps.d": true,
"**/Makefile.test-suite.coq": true,
"**/Makefile.test-suite.coq.conf": true,
"**/.coqdeps.test-suite": true,
"**/*.dot": true
}
} hierarchy-builder-1.7.0/AUTHORS.md 0000664 0000000 0000000 00000000276 14547515630 0016607 0 ustar 00root root 0000000 0000000 Copyright (C) 2020
- Cyril Cohen (Inria)
- Kazuhiko Sakaguchi (University of Tsukuba)
- Enrico Tassi (Inria)
This software is released under the terms of the MIT license, see LICENSE file. hierarchy-builder-1.7.0/Changelog.md 0000664 0000000 0000000 00000020656 14547515630 0017355 0 ustar 00root root 0000000 0000000 # Changelog
## Unreleased
## [1.7.0] - 2024-01-10
Compatible with
- Coq 8.18 with Coq-Elpi 2.0.0
- Coq 8.19 with Coq-Elpi 2.0.1
- **Removed** the `#[primitive_class]` attribute, making it the default.
- **New** `HB.saturate` to saturate instances w.r.t. the current hierarchy
- **Removed** the `#[infer]` attribute made obsolete by reverse coercions
since Coq 8.16
## [1.6.0] - 2023-09-20
Compatible with
- Coq 8.16 with Coq-Elpi 1.15.x and 1.16.x
- Coq 8.17 with Coq-Elpi 1.17.x and 1.18.x
- Coq 8.18 with Coq-Elpi 1.19.x
This version is required if Elpi is >= 1.17.0
### General
- **Speedup** speedup in coercion compression
- **Speedup** accumulate clauses in batches (on Coq-Elpi >= 8.18.0)
- **Change** remove generation of eta expanded instances (was unused)
## [1.5.0] - 2023-08-04
Compatible with
- Coq 8.15 with Coq-Elpi 1.14.x
- Coq 8.16 with Coq-Elpi 1.15.x and 1.16.x
- Coq 8.17 with Coq-Elpi 1.17.x and 1.18.x
- Coq 8.18 with Coq-Elpi 1.19.x
This version is required if Elpi is >= 1.17.0
### General
- **Fix** spilling before predicate declaration
- **Fix** unnecessary use of grafting slowing down compilation on MathComp 2.0
- **New** better "missing join" error message
## [1.4.0] - 2022-09-29
Compatible with
- Coq 8.15 with Coq-Elpi 1.14.x
- Coq 8.16 with Coq-Elpi 1.15.x and 1.16.x
### General
- **Fix** `HB.pack` works with structures about functions, and not just types.
- **Fix** `HB.about` and `HB.graph` now display shortest names.
- **New** Command `HB.howto` to find all possible ways to instanciate structures.
- **New** Structures now support keys which type's head is a global reference.
(Only keys corresponding to the coercion classes `Sortclass` and `Funclass` were accepted).
## [1.3.0] - 2022-07-27
Compatible with
- Coq 8.15 with Coq-Elpi 1.14.x
- Coq 8.16 with Coq-Elpi 1.15.x
### General
- **Fix** Structures can be keyd on sorts (eg `Prop`) and products (eg `T -> U`)
- **New** Mixin parameters can depend on structure instances inferred using previous mixins (see [this test](tests/interleave_context.v))
## [1.2.1] - 2022-01-10
Compatible with
- Coq 8.13 or 8.14 with Coq-Elpi 1.11.x
- Coq 8.15 with Coq-Elpi 1.12.x
### General
- **Fix** Do not unfold let-ins in instances (speedup)
- **Fix** Test suite for Coq 8.15
## [1.2.0] - 2021-09-24
Compatible with
- Coq 8.13 or 8.14 with Coq-Elpi 1.11.x
### General
- **Fix** Do not impose useless universe constraints on `option` and `prod` by using
custom inductive types.
- **New** Check for instances which break Forgetful Inheritance, attribute
`#[non_forgetful_inheritance]` to disable the check.
- **New** Factory instances are canonically (key `Factory.sort`) instances of all
the structures they can fulfill. This can be used inside proofs to provide
canonical instances on a type.
E.g. `(factoryInstance : SomeStructure.sort _)` works if `factoryInstance` can
be used to build `SomeStructure`
- **New** `Strategy Opaque` for named mixins, improving conversion performance
on generated terms
- **New** Attributes `#[primitive]` and `#[primitive_class]` for
`HB.structure/mixin/factory` to generate primitive records.
- **New** Attribute `#[doc="text"]` supported by all commands and used by `HB.about`
- **New** Attribute `#[hnf]` supported by `HB.instance`
### Commands
- **New** `HB.locate` to find where an instance comes from
- **New** `HB.about` to display HB specific info attached to a HB
generated constant
### Tactics
- **New** Tactic in term `HB.pack` and `HB.pack_for` taking a key `K` and a bunch of
factories and building a structure instance on `K`.
E.g. `pose K_fooType : Foo.type := HB.pack K f1 f2 ..` works if factories `f1 f2 ..`
provide all mixins needed by structure `Foo`.
## [1.1.0] - 2021-03-30
Compatible with
- Coq 8.11 with Coq-Elpi 1.6.2,
- Coq 8.12 with Coq-Elpi 1.8.2,
- Coq 8.13 with Coq-Elpi 1.9.5.
### General
- **Experimental** support for structures with a function as the carrier, for e.g.
hierarchies of morphisms.
- **Fix** Type inference of parameters for HB commands improved, it can now rely on
the right hand side of factories and mixins
- **Fix** Removed a hack that included phantom fields in mixins and factories in order
to prevent erasure from section discharge.
- **Cosmetic** Changed naming convention for canonical instances e.g. `T_is_a_Ring` is now
renamed to `T_Ring`. This name should still not be relied upon.
- **Cleanup** The elpi code has been split into several files,
one for each command and a folder for common code.
- **Fix** Speedup `toposort` in elpi code.
- **Doc** The file `structures.v` contains a detailed documentation of each command.
### Commands
- **Deprecated** `HB.instance K F` in favor of `HB.instance Definition`.
- **New** `HB.export` is like `Export` except that the module is stored
in a database for later rexport.
- **New** `HB.reexport` reexports all the modules that have been previously
flagged by `HB.export`, as well as all the `HB.instance` that have been flagged
by the attribute `#[export]`.
- **New** `HB.check` is like `Check` but supports logging and can be
disabled on a selection of Coq versions.
- **New** `HB.graph` generates the graph of structures as a dot file.
(One may use `tred file.dot | xdot -` to visualize the output).
- **Extended** `HB.structure` to generate methods `.on` and `.copy`
(see `structures.v` for their documentation).
### Attributes
- **New** `#[export]` attribute can be given to `HB.instance` in order to have instances
(re)declared by `HB.reexport`.
- **New** `#[compress_coercions]` attribute (off by default) to shorten coercions paths
in the synthesis of instances. When instanciating structures one by one,
(e.g. T is declared as a Semiring, then as a Ring, then as a Field, etc)
the coercions used to pile up, we now compress these chains of application.
- **New** `#[log]` and `#[log(raw)]` to print Coq commands equivalent to what HB
is doing. The raw print is the only one which is reparsable.
- **New** `#[key="T"]` to flag paramter `T` as the key of the mixin/factory.
The definition `indexed` used to serve this purpose is deprecated and will not do anything.
- **New** `#[infer(P)]` can be used to tell `HB.structure` to set things up so that
parameter `P` is automatically inferred. E.g. if `P : Ring.type` then
`Structure.type` will take a `t : Type` and trigger a canonical inference.
to infer the `t_is_a_Ring : Ring.type` associated to `t`.
If `Structure` has a function carrier, one has to write `#[infer(P = "_ -> _")]`.
- **New** `#[arg_sort]` for `HB.structure` generates an intermediate
sort projection called `arg_sort` which is prioritary as a coercion and which
unfolds to `sort`. It is meant to be the sort of arguments of operations
(see `mathcomp/fingroup/fingroup.v` for more information).
- **New** `#[local]` for `HB.instance` so that they do not survive sections.
### Tooling
- **New** environment variable `COQ_ELPI_ATTRIBUTES="hb(log(raw))"` to have HB commands
write patch files containing Coq commands equivalent to what HB did.
These patch files have extension `.v.hb` and are named after the file they apply to.
- **New** `coq.hb` command line utility to patch/reset files.
- **New** The CI is now testing mathcomp and plan B (using nix).
## [1.0.0] - 2020-12-16
Requires Coq-Elpi 1.6 or 1.7 or 1.8 and Coq 8.11 or 8.12 or 8.13.
- Use Coq's elaborator to typecheck factories and structures (coercions are
now inserted properly)
- New attribute `#[mathcomp]` for `HB.structure` to synthesize backward
compatibility code for the Mathematical Components library.
When the mixin contains a single axiom its name can be given as
`#[mathcomp(axiom="eq_axiom")]`.
- `HB.instance Definition name : factory T := term` works even if term is not
a known builder. In this case the type (key) is read from the factory
(the type of the definition).
## [0.10.0] - 2020-08-08
- HB now supports parameters (experimental).
- Port to Coq-Elpi 1.5.
- Better error message in case classes are not defined in the right order.
- Structure operations are not reexported by substructures.
- Spurious trivial `TYPE` structure removed from demo1.
## [0.9.1] - 2020-06-03
- `HB.instance` can be applied directly to a definition as in
`HB.instance Definition foo := Bar.Build T ...`
- Port to Coq-Elpi version 1.4
- Operations `op` from factory `f` are not bound to `f_op` anymore,
they are now bound to `op` and potentially masked operations
are accessible via `Super.op`.
## [0.9.0] - 2020-03-11
First public release for Coq 8.10 and 8.11.
hierarchy-builder-1.7.0/HB/ 0000775 0000000 0000000 00000000000 14547515630 0015424 5 ustar 00root root 0000000 0000000 hierarchy-builder-1.7.0/HB/README.md 0000664 0000000 0000000 00000003000 14547515630 0016674 0 ustar 00root root 0000000 0000000 ## File structure
- `HB/foo.elpi` implements the main entry point for `HB.foo` (or its variants)
- `HB/common/foo.elpi` provides code used by more than one command
- Each file `foo.elpi` should put its public API in the namespace `foo.`
and its private code in `foo.private.`, if you need to access predicates
in the private space then the API needs to be reworked (don't commit code
accessing private stiff, even if Elpi won't prevent you from using it).
## Naming conventions
- `under-foo.do! Arg [ Code ]`
enriches the context with `foo`, the runs `std.do! [ Code ]`
- `under-foo.then Arg F Out`
enriches the context with `foo`, the runs `F Out`, as a consequence
on can use the spilling expression `{under-foo.then Arg F}`
- `foo_bar`
projection from foo to its field bar
- `foo->bar`
conversion from type foo to type bar (it can be arbitrarily complex)
- `get-foo`
reads foo from the Coq world
- `findall-foo`
reads foo from `hb.db`, the output is sorted whenever it makes sense
- `declare-foo`
predicate adding to the Coq environment a `foo`
- `postulate-foo`
predicate assuming a `foo` (e.g. declaring a Coq section variable)
- `TheType`, `TheClass`, `TheFoobar`
the thing the current code is working on, eg the type of the structure
begin defined
- `FooAlias`
see `phant-abbrev`, used to talk about the non canonical name of `Foo`
- when foo is the constructor of a data type with type `A1 -> .. -> AN -> t`
we define `mk-foo` as:
`mk-foo A1 .. AN (foo A1 .. AN)`
hierarchy-builder-1.7.0/HB/about.elpi 0000664 0000000 0000000 00000035315 14547515630 0017420 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
namespace about {
pred main i:string.
main S :-
coq.locate-all S All,
std.filter All (x\sigma gr a\x = loc-gref gr ; x = loc-abbreviation a) L,
if (L = []) (coq.error "HB: unable to locate" S) true,
std.forall L (about.main-located S).
pred main-located i:string, i:located.
main-located S (loc-gref GR) :- class-def (class Class GR MLwP), !,
private.main-structure S Class GR MLwP.
main-located _ (loc-gref Class) :- class-def (class Class GR MLwP), !,
gref->modname_short GR "." M,
coq.gref->id GR St,
S is M ^ "." ^ St,
private.main-structure S Class GR MLwP.
main-located S (loc-gref (indt I)) :- factory-constructor (indt I) _, !,
private.main-factory S I.
main-located S (loc-gref (const C)) :- factory-constructor (const C) _, !,
private.main-factory-alias S C.
main-located S (loc-gref (const C)) :- exported-op M _ C, !,
private.main-operation S M C.
main-located S (loc-gref GR) :- factory-alias->gref GR F, not (F = GR), !,
main-located S (loc-gref F).
main-located S (loc-abbreviation A) :- phant-abbrev GR PhB A, factory-constructor (indt F) GR, !,
private.main-factory-constructor S F PhB GR.
main-located S (loc-abbreviation A) :-
coq.notation.abbreviation-body A NArgs _,
coq.notation.abbreviation A {coq.mk-n-holes NArgs} T,
coq.safe-dest-app T (global GR) _, !,
main-located S (loc-gref GR).
main-located S (loc-gref GR) :- from Factory Mixin GR, !,
private.main-builder S Factory Mixin.
main-located S (loc-gref GR) :-
std.filter {coq.CS.db-for _ (cs-gref GR)} (not1 unif-hint?) LV,
coq.CS.db-for GR _ LP,
std.filter {coq.coercion.db} (c\c = coercion GR _ _ _) LC,
if (LV = [], LP = [], LC = [])
(coq.error "HB: uninteresting constant" {coq.pp->string {private.pp-loc-of GR}})
true,
if (not (LV = [])) (private.main-canonical-value S LV) true,
if (not (LP = [])) (private.main-canonical-projection S GR LP) true,
if (not (LC = [])) (private.main-coercion S LC) true.
main-located S (loc-abbreviation _) :- coq.error "HB: unknown abbreviation" S.
/* things also used in paths.elpi ------------------------------------------ */
shorten coq.pp.{ v , h, hv, hov , spc , str , box , glue , brk , empty }.
pred bulletize1 i:(A -> coq.pp -> prop), i:A, o:coq.pp.
bulletize1 F X (glue [str "- ", M]) :- F X M.
pred bulletize i:list A, i:(A -> coq.pp -> prop), o:coq.pp.
bulletize [] _ empty.
bulletize L F (glue [brk 0 0 | PLB]) :-
std.map L (bulletize1 F) PL,
std.intersperse (brk 0 0) PL PLB.
% Print shortest qualified identifier of the module containing a gref
pred pp-module i:gref, o:coq.pp.
pp-module GR (str ID) :- gref->modname_short GR "." ID.
pred unif-hint? i:cs-instance.
unif-hint? (cs-instance _ (cs-gref GR) _) :- coq.CS.db-for GR _ [_|_].
pred not1 i:(A -> prop), i:A.
not1 P X :- not (P X).
/* ------------------------------------------------------------------------- */
/* ----------------------------- private code ------------------------------ */
/* ------------------------------------------------------------------------- */
namespace private {
shorten coq.pp.{ v , h, hv, hov , spc , str , box , glue , brk , empty }.
pred docstring-for-file i:string, o:prop.
docstring-for-file Rex (docstring Loc Doc) :- docstring Loc Doc,
loc.fields Loc File _ _ _ _,
rex.match {calc(".*" ^ Rex)} File.
pred main-canonical-value i:string, i:list cs-instance.
main-canonical-value S CanonicalValues :-
group-by-loc CanonicalValues CanonicalValuesL,
%format
PpCanonicalValues = box (v 4) [
str "HB: ", str S, str " is canonically equipped with structures:",
{bulletize CanonicalValuesL pp-canonical-solution-list}],
% print
coq.say {coq.pp->string PpCanonicalValues},
coq.say.
pred group-by-loc i:list cs-instance, o:list (pair (option loc) (list cs-instance)).
group-by-loc [] [].
group-by-loc [cs-instance P V GR|L] [pr (some Loc) [cs-instance P V GR|SameLoc]|Rest1] :- decl-location GR Loc, !,
std.partition L (x\ sigma GR1\ x = cs-instance _ _ GR1, decl-location GR1 Loc) SameLoc Rest,
group-by-loc Rest Rest1.
group-by-loc [I|Rest] [pr none [I]|Rest1] :- group-by-loc Rest Rest1.
pred pp-canonical-solution-list i:pair (option loc) (list cs-instance), o:coq.pp.
pp-canonical-solution-list (pr none [CS]) Pp :-
pp-canonical-solution CS Pp.
pp-canonical-solution-list (pr (some Loc) L) Pp :-
Pp = box (v 0)
{ std.append {std.intersperse spc {std.map L pp-canonical-solution}}
[ spc, {pp-loc Loc} ] }.
pred pp-canonical-solution i:cs-instance, o:coq.pp.
pp-canonical-solution (cs-instance _Proj _Pat GR) Pp :-
coq.env.typeof GR T,
coq.prod-tgt->gref T F,
if (class-def (class _ F _)) (gref->modname_short F "." ID) (coq.gref->string F ID),
Pp = box (hov 0) [ str ID ].
pred main-canonical-projection i:string, i:gref, i:list cs-instance.
main-canonical-projection S Proj CanonicalProjectionValues :-
%format
PpCanonicalProjectionOrigin = box (hov 4) [
str "HB:", spc, str S, spc, str "is a canonical projection",
spc, {pp-loc-of Proj}],
PpCanonicalProjectionValues = box (v 4) [
str "HB: ", str S, str " has the following canonical values:",
{bulletize CanonicalProjectionValues pp-canonical-value}],
% print
coq.say {coq.pp->string PpCanonicalProjectionOrigin},
coq.say {coq.pp->string PpCanonicalProjectionValues},
coq.say.
pred pp-canonical-value i:cs-instance, o:coq.pp.
pp-canonical-value (cs-instance _Proj (cs-gref GR) _Sol) Pp :-
coq.term->pp (global GR) V,
Pp = box (hov 2) [ V , spc, {pp-loc-of GR} ].
pred main-coercion i:string, i:list coercion.
main-coercion S [coercion GR _ Src Tgt|_] :-
% format
if (class-def (class _ Src _) ; class-def (class Src _ _))
(Source = str {gref->modname_short Src "."})
(coq.term->pp (global Src) Source),
if2 (Tgt = grefclass TGR)
(if (class-def (class _ TGR _) ; class-def (class TGR _ _))
(Target = str {gref->modname_short TGR "."})
(coq.term->pp (global TGR) Target))
(Tgt = sortclass)
(Target = str "Sortclass")
(Target = str "Funclass"),
PpCoercionOrigin = box (hov 4) [
str "HB:", spc, str S, spc, str "is a coercion from", spc,
Source, str" to ", Target, spc, {pp-loc-of GR}],
% print
coq.say {coq.pp->string PpCoercionOrigin},
coq.say.
pred main-operation i:string, i:mixinname, i:constant.
main-operation S MixinSource _ :-
% fetch
mixin-first-class MixinSource Class,
class-def (class Class Structure _),
% format
PpOriginStructure = box (hov 4) [
str "HB:", spc, str S, spc, str "is an operation of structure", spc,
{pp-module Structure}, spc, {pp-loc-of Structure}],
PpOriginMixin = box (hov 4) [
str "HB:", spc, str S, spc, str "comes from mixin", spc,
{pp-module MixinSource}, spc, {pp-loc-of MixinSource}],
% print
coq.say {coq.pp->string PpOriginStructure},
coq.say {coq.pp->string PpOriginMixin},
coq.say.
pred main-structure i:string, i:classname, i:structure, i:mixins.
main-structure S Class Structure MLwP :-
% fetch
list-w-params_list MLwP ML,
std.map-filter ML (m\r\ sigma P O OPS\
mixin-first-class m Class,
std.findall (exported-op m P O) OPS,
std.map OPS (c\out\ sigma p\ c = exported-op m p out) r) OPLL,
std.flatten OPLL Operations,
std.map {std.findall (sub-class Class CS_ CoeS_ NS_)}
(x\r\ x = sub-class Class r _ _) SubClasses,
std.map {std.findall (sub-class Cs_ Class Coes_ Ns_)}
(x\r\ x = sub-class r Class _ _) SuperClasses,
% format
PpOrigin = box (hov 4) [
str "HB: ", str S, str " is a structure", spc,
{pp-loc-of Structure} ],
PpOperations = box (v 4) [
str "HB: ", str S, str " characterizing operations and axioms are:",
{bulletize Operations pp-const}],
PpClass = box (v 4) [
str "HB: ", {pp-module Class}, str " is a factory for the following mixins:",
{bulletize ML (m\r\ sigma tmp\
if (mixin-first-class m Class)
(pp-module m tmp, r = glue [tmp, str " (* new, not from inheritance *)"])
(pp-module m r))}],
PpSubClasses = box (v 4) [
str "HB: ", {pp-module Class}, str " inherits from:",
{bulletize SubClasses pp-module}],
PpSuperClasses = box (v 4) [
str "HB: ", {pp-module Class}, str " is inherited by:",
{bulletize SuperClasses pp-module}],
% print
coq.say {coq.pp->string PpOrigin},
coq.say {coq.pp->string PpOperations},
coq.say {coq.pp->string PpClass},
coq.say {coq.pp->string PpSubClasses},
coq.say {coq.pp->string PpSuperClasses},
print-docstring Structure,
coq.say.
pred main-factory-constructor i:string, i:inductive, i:gref, i:gref.
main-factory-constructor S F PhBuild Build :-
% fetch
gref-deps Build DMLwP,
list-w-params_list DMLwP DML,
factory-provides (indt F) PMLwP,
list-w-params_list PMLwP PML,
coq.env.projections F FieldsOpts,
std.map-filter FieldsOpts (x\r\ x = some r) Fields,
coq.arguments.implicit PhBuild [Implicits],
compute-arg-type DMLwP Fields [] ParamsNames TName FieldsNames ArgsTypes,
compute-field-info FieldsNames Implicits FieldsNamesInfo,
std.map ParamsNames (n\r\r = str n) ParamsPp,
% format
PpOrigin = box (hov 4) [
str "HB: ", str S, str " is a factory constructor", spc,
{pp-loc-of Build} ],
PpRequires = box (v 4) [
str "HB: ", str S, str " requires its subject to be already equipped with:",
{bulletize DML pp-module}],
PpProvides = box (v 4) [
str "HB: ", str S, str " provides the following mixins:",
{bulletize PML pp-module}],
PpUsage = box (v 4) [box h {std.intersperse spc [
str "HB: arguments:",
glue {std.intersperse spc [str S | ParamsPp]},
str TName,
glue FieldsNamesInfo]},
{bulletize ArgsTypes pp-arg-type}],
% print
coq.say {coq.pp->string PpOrigin},
coq.say {coq.pp->string PpRequires},
coq.say {coq.pp->string PpProvides},
coq.say {coq.pp->string PpUsage},
print-docstring Build,
coq.say.
pred compute-arg-type i:list-w-params mixinname, i:list constant, i:list term, o:list id, o:id, o:list id, o:list (pair id coq.pp).
compute-arg-type (w-params.cons ID Ty Rest) F Acc [ID|PN] TN FN [pr ID PPTy |Xs] :-
coq.term->pp Ty PPTy,
@pi-parameter ID Ty x\ compute-arg-type (Rest x) F [x|Acc] PN TN FN Xs.
compute-arg-type (w-params.nil ID Ty Rest) F Acc [] ID FN [pr ID PPTy|Xs] :-
coq.term->pp Ty PPTy,
@pi-parameter ID Ty x\ compute-arg-type.fields F {std.length (Rest x)} {std.rev [x|Acc]} Xs FN.
pred compute-arg-type.fields i:list constant, i:int, i:list term, o:list (pair id coq.pp), o:list id.
compute-arg-type.fields [] _ _ [] [].
compute-arg-type.fields [C|Cs] NDeps Args [pr ID PPTy|Xs] [ID|FN] :- exported-op _ C OP, !,
coq.env.typeof (const OP) Ty,
coq.gref->id (const OP) ID,
coq.subst-prod Args Ty TyArgs,
@pplevel! 200 => coq.term->pp TyArgs PPTy,
compute-arg-type.fields Cs NDeps Args Xs FN.
compute-arg-type.fields [OP|Cs] NDeps Args [pr ID PPTy|Xs] [ID|FN] :-
% factories don't get exported ops, so we hack their types :-/
coq.env.typeof (const OP) OrigTy,
copy OrigTy Ty,
coq.gref->id (const OP) ID,
coq.subst-prod Args Ty TyArgs,
coq.mk-n-holes NDeps Deps,
coq.subst-prod Deps TyArgs TyArgsDeps,
coq.subst-prod [_] TyArgsDeps TyArgsDepsRecord,
ToDrop is NDeps + 2,
@pplevel! 200 => coq.term->pp TyArgsDepsRecord PPTy,
@pi-parameter ID TyArgsDepsRecord op\
(pi L L1 X\
copy (app[global(const OP)|L]) X :- std.drop ToDrop L L1, coq.mk-app op L1 X) =>
compute-arg-type.fields Cs NDeps Args Xs FN.
pred main-factory i:string, i:inductive.
main-factory S Factory :-
% fetch
coq.env.projections Factory Ps,
std.map-filter Ps (x\r\ x = some r) Fields,
gref-deps (indt Factory) DMLwP,
list-w-params_list DMLwP DML,
factory-provides (indt Factory) PMLwP,
list-w-params_list PMLwP PML,
% format
PpOrigin = box (hov 4) [
str "HB: ", str S, str " is a factory", spc,
{pp-loc-of (indt Factory)} ],
PpOperations = box (v 4) [
str "HB: ", str S, str " operations and axioms are:",
{bulletize Fields pp-const}],
PpRequires = box (v 4) [
str "HB: ", str S, str " requires the following mixins:",
{bulletize DML pp-module}],
PpProvides = box (v 4) [
str "HB: ", str S, str " provides the following mixins:",
{bulletize PML pp-module}],
% print
coq.say {coq.pp->string PpOrigin},
coq.say {coq.pp->string PpOperations},
coq.say {coq.pp->string PpRequires},
coq.say {coq.pp->string PpProvides},
print-docstring (indt Factory),
coq.say.
pred main-factory-alias i:string, i:constant.
main-factory-alias S _Const :-
coq.say "HB: todo HB.about for factory alias" S.
pred main-builder i:string, i:factoryname, i:mixinname.
main-builder _S From To :-
coq.say "HB: todo HB.about for builder from"
{gref->modname_short From "."} "to" {gref->modname_short To "."}.
pred compute-field-info.aux i:list id, i:list implicit_kind, o:list coq.pp.
compute-field-info.aux [] _ [].
compute-field-info.aux [Name|NS] [explicit|IS] [str Name|PS] :-
compute-field-info.aux NS IS PS.
compute-field-info.aux [Name|NS] [implicit|IS] [glue[str"[",str Name,str"]"]|PS] :-
compute-field-info.aux NS IS PS.
compute-field-info.aux [Name|NS] [maximal|IS] [glue[str"{",str Name,str"}"]|PS] :-
compute-field-info.aux NS IS PS.
compute-field-info.aux [Name|NS] [] [str Name|PS] :-
compute-field-info.aux NS [] PS.
pred compute-field-info i:list id, i:list implicit_kind, o:list coq.pp.
compute-field-info Names Impls O :-
compute-field-info.aux {std.rev Names} {std.rev Impls} Pp,
std.intersperse spc {std.rev Pp} O.
pred pp-const i:constant, o:coq.pp.
pp-const F (str ID) :- coq.gref->id (const F) ID.
pred pp-arg-type i:pair id coq.pp, o:coq.pp.
pp-arg-type (pr ID PPTy) (box (hov 2) [str ID, str" :", spc, PPTy]).
pred pp-if-verbose o:coq.pp, i:(coq.pp -> prop).
pp-if-verbose V P :- get-option "verbose" tt, !, P V.
pp-if-verbose empty _.
pred pp-loc-of i:gref, o:coq.pp.
pp-loc-of GR PP :- decl-location GR Loc, !, pp-loc Loc PP.
pp-loc-of _ coq.pp.empty.
pred pp-loc i:loc, o:coq.pp.
pp-loc Loc (coq.pp.glue PP) :-
loc.fields Loc File _ _ Line _,
QFile is "\"" ^ File ^ "\", line " ^ {std.any->string Line},
PP = [str "(from ", str QFile, str")"].
pred docstring->pp i:string, o:coq.pp.
docstring->pp Txt (glue Doc) :-
rex.replace "\n" " " Txt PlainTxt,
rex.split " " PlainTxt Words,
std.filter Words (w\not (w = "")) NEWords,
std.map NEWords (w\r\ r = str w) PpWords,
std.intersperse spc PpWords Doc.
pred docstring-of i:gref, o:option coq.pp.
docstring-of GR (some Doc) :- decl-location GR Loc, docstring Loc Txt, !, docstring->pp Txt Doc.
docstring-of _ none.
pred pp-docstring-of i:gref, o:coq.pp.
pp-docstring-of GR D :- docstring-of GR (some D), !.
pp-docstring-of _ coq.pp.empty.
pred print-docstring i:gref.
print-docstring GR :-
if (docstring-of GR (some Doc))
(coq.say {coq.pp->string (box (hov 5) [str"Doc: ",Doc])})
true.
}}
hierarchy-builder-1.7.0/HB/builders.elpi 0000664 0000000 0000000 00000014076 14547515630 0020120 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
namespace builders {
pred begin i:context-decl.
begin CtxSkel :- std.do! [
std.assert!(coq.next-synterp-action (begin-module Name)) "synterp code did not open module",
if-verbose (coq.say {header} "begin module for builders"),
log.coq.env.begin-module Name none,
builders.private.factory CtxSkel IDF GRF,
% the Super module to access operations/axioms shadowed by the ones in the factory
if-verbose (coq.say {header} "begin module Super"),
log.coq.env.begin-module "Super" none,
if (GRF = indt FRecord) (std.do! [
std.forall {coq.env.projections FRecord}
builders.private.declare-shadowed-constant,
]) true,
if-verbose (coq.say {header} "ended module Super"),
log.coq.env.end-module-name "Super" _,
log.coq.env.begin-section Name,
if-verbose (coq.say {header} "postulating factories"),
builders.private.postulate-factories Name IDF CtxSkel,
].
}
% "end" is a keyword, be put it in the namespace by hand
pred builders.end.
builders.end :- std.do! [
current-mode (builder-from _ _ _ ModName),
log.coq.env.end-section-name ModName,
findall-builders LFIL,
std.fold LFIL [] builders.private.declare-1-builder Clauses,
if (Clauses = [])
(coq.error "No builders to declare, did you forget HB.instance?")
true,
std.findall (abbrev-to-export F_ N_ A_) ExportClauses,
coq.env.current-path CurModPath,
std.filter ExportClauses (export.private.abbrev-in-module CurModPath) ExportClausesFiltered,
% TODO: Do we need this module?
std.assert!(coq.next-synterp-action (begin-module Name)) "synterp code did not open module",
log.coq.env.begin-module Name none,
acc-clauses current Clauses,
acc-clauses current ExportClausesFiltered,
% Clauses => ExportClausesFiltered => current-mode no-builder =>
% instance.declare-factory-sort-factory GR,
log.coq.env.end-module-name Name Exports,
log.coq.env.end-module-name ModName _,
export.module {calc (ModName ^ "." ^ Name)} Exports,
].
/* ------------------------------------------------------------------------- */
/* ----------------------------- private code ------------------------------ */
/* ------------------------------------------------------------------------- */
pred factory.cdecl->w-mixins i:context-decl, o:w-mixins context-decl.
namespace builders.private {
% [declare-1-builder (builder _ F M B) From MoreFrom] Given B of type FB, it
% declares all the new builders F to M via B.
% From holds the (from F Mi Bi) new clauses during folding.
pred declare-1-builder i:builder, i:list prop, o:list prop.
declare-1-builder (builder _ SrcFactory TgtMixin _) FromClauses FromClauses :- FromClauses => from SrcFactory TgtMixin _, !,
if-verbose (coq.say {header} "skipping duplicate builder from"
{nice-gref->string SrcFactory} "to" {nice-gref->string TgtMixin}).
declare-1-builder (builder _ SrcFactory TgtMixin B) FromClauses [from SrcFactory TgtMixin B|FromClauses] :-
if-verbose (coq.say {header} "declare builder from"
{nice-gref->string SrcFactory} "to" {nice-gref->string TgtMixin}).
% We add breviations for all constants what will be shadowed by projections
% if the factory.
pred declare-shadowed-constant i:option constant.
declare-shadowed-constant none.
declare-shadowed-constant (some C) :-
coq.gref->id (const C) Id,
std.forall {coq.locate-all Id} (declare-shadowed-located Id).
pred declare-shadowed-located i:string, i:located.
declare-shadowed-located Id (loc-gref GR) :-
@global! => log.coq.notation.add-abbreviation Id 0 (global GR) ff _.
declare-shadowed-located Id (loc-abbreviation Abbrev) :-
coq.notation.abbreviation-body Abbrev NArgs T,
@global! => log.coq.notation.add-abbreviation Id NArgs T ff _.
pred postulate-factory-abbrev i:term, i:list term, i:id, i:factoryname, o:term.
postulate-factory-abbrev TheType Params Name Falias TheFactory :- std.do! [
factory-alias->gref Falias F,
phant-abbrev F _ Fabv,
coq.notation.abbreviation Fabv {std.append Params [TheType]} Package,
Msg is "Unable to declare factory " ^ Name,
std.assert-ok! (coq.typecheck-ty Package _) Msg,
log.coq.env.add-section-variable-noimplicits Name Package C,
TheFactory = global (const C),
].
% Only record fields can be exported as operations.
pred define-factory-operations i:term, i:list term, i:term, i:gref.
define-factory-operations TheType Params TheFactory (indt I) :- !,
coq.env.indt I _ NIParams _ _ _ _,
NHoles is NIParams - 1 - {std.length Params},
coq.env.projections I PL,
std.forall PL (define-factory-operation TheType Params TheFactory NHoles).
define-factory-operations _ _ _ _.
pred define-factory-operation i:term, i:list term, i:term, i:int, i:option constant.
define-factory-operation _ _ _ _ none.
define-factory-operation TheType Params TheFactory NHoles (some P) :-
coq.mk-n-holes NHoles Holes,
std.append Holes [TheFactory] Holes_Factory,
std.append Params [TheType|Holes_Factory] Args,
T = app[global (const P)|Args],
std.assert-ok! (coq.typecheck T _) "Illtyped applied factory operation",
coq.gref->id (const P) Name,
@local! => log.coq.notation.add-abbreviation Name 0 T ff _.
pred factory i:context-decl, o:string, o:gref.
factory (context-item IDF _ T _ _\ context-end) IDF GR :- !,
coq.safe-dest-app T (global GR) _.
factory (context-item _ _ _ _ R) IDF GR :- !, pi x\ factory (R x) IDF GR.
factory _ _ _ :- !, coq.error "the last context item is not a factory".
pred postulate-factories i:id, i:string, i:context-decl.
postulate-factories ModName IDF CDecl :- std.do! [
factory.cdecl->w-mixins CDecl (pr FLwP _),
context.declare.params-key FLwP ParamsSection FKey FLwA,
std.assert! (FLwA = [triple GRF _ _])
"HB: cannot declare builders for more than one factory at a time",
gref-deps GRF DepswPRaw,
context.declare.mixins FKey ParamsSection DepswPRaw _ _ _,
std.map ParamsSection triple_2 FParams,
postulate-factory-abbrev FKey FParams IDF GRF TheFactory,
define-factory-operations FKey FParams TheFactory GRF,
acc-clause current (current-mode (builder-from FKey TheFactory GRF ModName)),
].
} hierarchy-builder-1.7.0/HB/common/ 0000775 0000000 0000000 00000000000 14547515630 0016714 5 ustar 00root root 0000000 0000000 hierarchy-builder-1.7.0/HB/common/compat_acc_clauses_816.elpi 0000664 0000000 0000000 00000000141 14547515630 0023771 0 ustar 00root root 0000000 0000000 pred acc-clauses i:scope, i:list prop.
acc-clauses Scope CL :- std.forall CL (acc-clause Scope).
hierarchy-builder-1.7.0/HB/common/compat_acc_clauses_all.elpi 0000664 0000000 0000000 00000000217 14547515630 0024227 0 ustar 00root root 0000000 0000000 pred acc-clauses i:scope, i:list prop.
acc-clauses Scope CL :- coq.elpi.accumulate-clauses Scope "hb.db" {std.map CL (c\r\ r = clause _ _ c)}.
hierarchy-builder-1.7.0/HB/common/database.elpi 0000664 0000000 0000000 00000041215 14547515630 0021336 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
shorten coq.{ term->gref, subst-fun, safe-dest-app, mk-app, mk-eta, subst-prod }.
%%%%%%%%% HB database %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
pred from_factory i:prop, o:factoryname.
from_factory (from X _ _) X.
pred from_mixin i:prop, o:mixinname.
from_mixin (from _ X _) X.
pred from_builder i:prop, o:term.
from_builder (from _ _ X) (global X).
pred mixin-src_mixin i:prop, o:mixinname.
mixin-src_mixin (mixin-src _ M _) M.
pred mixin-src_src i:prop, o:term.
mixin-src_src (mixin-src _ _ S) S.
pred local-canonical-gref i:prop, o:constant.
local-canonical-gref (local-canonical C) C.
pred class_name i:class, o:classname.
class_name (class N _ _) N.
pred class_structure i:class, o:structure.
class_structure (class _ S _) S.
pred class-def_name i:prop, o:classname.
class-def_name (class-def (class N _ _)) N.
pred mixin-class_class i:prop, o:classname.
mixin-class_class (mixin-class _ C) C.
pred mixin-class_mixin i:prop, o:mixinname.
mixin-class_mixin (mixin-class M _) M.
pred classname->def i:classname, o:class.
classname->def CN (class CN S ML) :- class-def (class CN S ML).
pred classname->mixins i:classname, o:mixins.
classname->mixins CN MLwP :- class-def (class CN _ MLwP).
pred module-to-export_module i:prop, o:modpath.
module-to-export_module (module-to-export _ _ M) M.
pred module-to-export_module-nice i:prop, o:id.
module-to-export_module-nice (module-to-export _ M _) M.
pred instance-to-export_instance i:prop, o:constant.
instance-to-export_instance (instance-to-export _ _ M) M.
pred instance-to-export_instance-nice i:prop, o:id.
instance-to-export_instance-nice (instance-to-export _ M _) M.
pred abbrev-to-export_name i:prop, o:id.
abbrev-to-export_name (abbrev-to-export _ N _) N.
pred abbrev-to-export_body i:prop, o:term.
abbrev-to-export_body (abbrev-to-export _ _ B) (global B).
pred extract-builder i:prop, o:builder.
extract-builder (builder-decl B) B.
pred leq-builder i:builder, i:builder.
leq-builder (builder N _ _ _) (builder M _ _ _) :- N =< M.
% [factory-alias->gref X GR] when X is already a factory X = GR
% however, when X is a phantom abbreviated gref, we find the underlying
% factory gref GR associated to it.
pred factory-alias->gref i:gref, o:gref.
factory-alias->gref PhGR GR :- phant-abbrev GR PhGR _, !.
factory-alias->gref GR GR :- phant-abbrev GR _ _, !.
pred sub-class? i:class, i:class.
sub-class? (class C1 _ ML1P) (class C2 _ ML2P) :-
not (C1 = C2),
list-w-params_list ML1P ML1,
list-w-params_list ML2P ML2,
std.forall ML2 (m2\ std.exists ML1 (m1\ m1 = m2)).
% [factory-provides F MLwP] computes the mixins MLwP generated by F
pred factory-provides i:factoryname, o:mixins.
factory-provides FactoryAlias MLwP :- std.do! [
factory-alias->gref FactoryAlias Factory,
gref-deps Factory RMLwP,
w-params.map RMLwP (factory-provides.base Factory) MLwP
].
pred mixin->factories i:mixinname, o:list factoryname.
mixin->factories M FL :- std.do! [
std.findall (from F_ M B_) AllF,
std.map AllF from_factory FL
].
pred factory-provides.base i:factoryname, i:list term, i: term,
i:list (w-args mixinname), o:list (w-args mixinname).
factory-provides.base Factory Params T _RMLwP MLwP :- std.do! [
std.findall (from Factory T_ F_) All,
std.map All from_mixin ML,
std.map All from_builder BL,
std.map2 BL ML (factory-provides.one Params T) MLwP,
].
pred factory-provides.one i:list term, i:term, i:term, i:mixinname, o:w-args mixinname.
factory-provides.one Params T B M (triple M PL T) :- std.do! [
std.assert-ok! (coq.typecheck B Ty) "Builder illtyped",
subst-prod [T] {subst-prod Params Ty} TyParams,
std.assert! (extract-conclusion-params T TyParams PL) "The conclusion of a builder is a mixin whose parameters depend on other mixins",
].
pred extract-conclusion-params i:term, i:term, o:list term.
extract-conclusion-params TheType (prod _ S T) R :- !,
@pi-decl _ S x\ extract-conclusion-params TheType (T x) R.
extract-conclusion-params TheType (app [global GR|Args]) R :- !,
factory-alias->gref GR Factory,
factory-nparams Factory NP,
std.map Args (copy-pack-holes TheType TheType) NewArgs,
std.take NP NewArgs R.
extract-conclusion-params TheType T R :- whd1 T T1, !, extract-conclusion-params TheType T1 R.
% [factories-provide FL ML] computes the mixins ML generated by all F in FL
%
% cons tp p\ nil t\ [pr f1 [p,t]]
% f1 p t = m1 t, m2 p t
% cons tp p\ nil t\ [pr m1 [t], pr m2 [p,t]]
pred factories-provide i:list-w-params factoryname, o:mixins.
factories-provide FLwP MLwP :- std.do! [
list-w-params.flatten-map FLwP factory-provides UnsortedMLwP,
w-params.map UnsortedMLwP (p\t\ toposort-mixins) MLwP,
].
pred undup-grefs i:list gref, o:list gref.
undup-grefs L UL :- std.do! [
coq.gref.list->set L S,
coq.gref.set.elements S UL,
].
pred undup-sorts i:list sort, o:list sort.
undup-sorts L R :- std.do! [
if (std.mem L prop) (R1 = [prop]) (R1 = []),
if (std.mem L sprop) (R2 = [sprop]) (R2 = []),
if (std.mem L (typ _)) (R3 = [typ _]) (R3 = []),
std.flatten [R1, R2, R3] R,
].
% also prunes cs-default
pred undup-cs-patterns i:list cs-pattern, o:list cs-pattern.
undup-cs-patterns L R :- std.do! [
std.map-filter L (x\r\ x = cs-gref r) LGR,
undup-grefs LGR ULGR,
std.map ULGR (x\r\ r = cs-gref x) R1,
std.map-filter L (x\r\ x = cs-sort r) LS,
undup-sorts LS ULS,
std.map ULS (x\r\ r = cs-sort x) R2,
if (std.mem L cs-prod) (R3 = [cs-prod]) (R3 = []),
std.flatten [R1, R2, R3] R,
].
% Mixins can be topologically sorted according to their dependencies
pred toposort-mixins i:list (w-args mixinname), o:list (w-args mixinname).
toposort-mixins In Out :- std.do! [
std.map In triple_1 ML,
std.map ML (m\r\sigma D D1\ gref-deps m D1, list-w-params_list D1 D, std.map D (d\r\r = pr d m) r) ES2,
std.flatten ES2 ES,
toposort-proj triple_1 ES In Out,
].
pred toposort-proj i:(A -> B -> prop), i:list (pair B B), i:list A, o:list A.
toposort-proj Proj ES In Out :- !, toposort-proj.acc Proj ES [] In Out.
pred topo-find i:B, o:A.
pred toposort-proj.acc i:(A -> B -> prop), i:list (pair B B), i:list B, i:list A, o:list A.
toposort-proj.acc _ ES Acc [] Out :- !,
std.map {std.toposort ES Acc} topo-find Out.
toposort-proj.acc Proj ES Acc [A|In] Out :- std.do![
Proj A B,
topo-find B A => toposort-proj.acc Proj ES [B|Acc] In Out
].
% Classes can be topologically sorted according to the subclass relation
pred toposort-classes.mk-class-edge i:prop, o:pair classname classname.
toposort-classes.mk-class-edge (sub-class C1 C2 _ _) (pr C2 C1).
pred toposort-classes i:list classname, o:list classname.
toposort-classes In Out :- std.do! [
std.findall (sub-class C1_ C2_ _ _) SubClasses,
std.map SubClasses toposort-classes.mk-class-edge ES,
std.toposort ES In Out,
].
pred findall-classes o:list class.
findall-classes CLSortedDef :- std.do! [
std.findall (class-def C_) All,
std.map All class-def_name CL,
toposort-classes CL CLSorted,
std.map CLSorted classname->def CLSortedDef,
].
pred findall-classes-for.unsorted
i:list mixinname, i:list classname, o:list classname.
findall-classes-for.unsorted [] CL CL :- !.
findall-classes-for.unsorted [M|ML] CLAcc Out :- std.do! [
std.findall (mixin-class M C_) All,
std.map All mixin-class_class CL,
findall-classes-for.unsorted ML {std.append CL CLAcc} Out
].
pred findall-classes-for i:list mixinname, o:list class.
findall-classes-for ML CLSortedDef :- std.do! [
findall-classes-for.unsorted ML [] CL,
toposort-classes CL CLSorted,
std.map CLSorted classname->def CLSortedDef,
].
pred findall-builders o:list builder.
findall-builders LFIL :-
std.map {std.findall (builder-decl B_)} extract-builder LFILunsorted,
std.bubblesort LFILunsorted leq-builder LFIL.
pred findall-has-mixin-instance o:list prop.
findall-has-mixin-instance CL :-
std.findall (has-mixin-instance _ _ _) CL.
pred has-mixin-instance_key i:prop, o:cs-pattern.
has-mixin-instance_key (has-mixin-instance P _ _) P.
pred findall-mixin-src i:term, o:list mixinname.
findall-mixin-src T ML :-
std.map {std.findall (mixin-src T M_ V_)} mixin-src_mixin ML.
pred findall-local-canonical o:list constant.
findall-local-canonical CL :-
std.map {std.findall (local-canonical C_)} local-canonical-gref CL.
% [distinct-pairs-below C AllSuper C1 C2] finds C1 and C2 in
% AllSuper (all super classes of C) such that C1 != C2
% and for which there is no join C3.
% If there exists a join C3 of C1 and C2 then C is a subclass
% of C3 (otherwise C should have been declared before C3)
%
% / --- /-- C1
% C -- no C3 !=
% \ --- \-- C2
%
% [findall-newjoins C AllSuper] finds all C1 and C2 such that C is a (new) join for
% them
pred distinct-pairs-below i:class, i:list class, o:class, o:class.
distinct-pairs-below CurrentClass AllSuper C1 C2 :-
std.mem AllSuper C1, std.mem AllSuper C2,
% no cut until here, since we don't know which C1 and C2 to pick
std.do! [
cmp_term C1 C2 lt,
C1 = class C1n _ _,
C2 = class C2n _ _ ,
not(sub-class? C1 C2),
not(sub-class? C2 C1),
if (join C1n C2n C3n)
(assert-building-bottom-up CurrentClass C3n C1n C2n, fail) % a join, not a valid pair
true, % no join, valid pair
].
pred assert-building-bottom-up i:class, i:classname, i:classname, i:classname.
assert-building-bottom-up CurrentClass C3n C1n C2n :-
class-def (class C3n X Y),
CurrentClass = class CC _ _,
if (not (sub-class? CurrentClass (class C3n X Y)))
(gref->modname CC 1 "." Before, gref->modname_short C3n "." After,
gref->modname_short C1n "." C1nS, gref->modname_short C2n "." C2nS,
Msg1 is "- declare structure " ^ Before ^ " before structure " ^ After ^ " if " ^ After ^ " inherits from it;",
Msg2 is "- declare an additional structure that inherits from both "
^ C1nS ^ " and " ^ C2nS
^ " and from which " ^ Before ^ " and/or " ^ After ^ " inherit.",
coq.error "You must declare the hierarchy bottom-up or addd a missing join."
"There are two ways out:"
Msg1
Msg2)
true.
pred distinct-pairs_pair i:prop, o:pair class class.
distinct-pairs_pair (distinct-pairs-below _ _ X Y) (pr X Y).
pred findall-newjoins i:class, i:list class, o:list (pair class class).
findall-newjoins CurrentClass AllSuper TodoJoins :-
std.findall (distinct-pairs-below CurrentClass AllSuper C1_ C2_) JoinOf,
std.map JoinOf distinct-pairs_pair TodoJoins.
pred class-coverage i:list classname, o:coq.gref.set.
class-coverage CNL CSet :-
std.map CNL classname->mixins CMLLwP,
std.map CMLLwP list-w-params_list CMLL,
coq.gref.list->set {std.flatten CMLL} CSet.
pred assert-good-coverage! i:list mixinname, i:list classname.
assert-good-coverage! MLSortedRev CNL :- std.do! [
coq.gref.list->set MLSortedRev MLSet,
class-coverage CNL CMLSet,
if (not(coq.gref.set.equal MLSet CMLSet))
(coq.gref.set.diff CMLSet MLSet Extra,
coq.error "I could not find classes covering exactly mixins:"
{std.any->string MLSortedRev}
"In particular the covering" CNL "also includes mixins:"
{coq.gref.set.elements Extra}
"This should never happen, please report a bug.")
true
].
%%%%% Coq Database %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% [get-structure-coercion S1 S2 F] finds the coecion F from the structure S1 to S2
pred get-structure-coercion i:structure, i:structure, o:term.
get-structure-coercion S T (global F) :-
coq.coercion.db-for (grefclass S) (grefclass T) L,
if (L = [pr F _]) true (coq.error "No one step coercion from" S "to" T).
pred get-structure-sort-projection i:structure, o:term.
get-structure-sort-projection (indt S) Proj :- !,
coq.env.projections S L,
if (L = [some P, _]) true (coq.error "No canonical sort projection for" S),
Proj = global (const P).
get-structure-sort-projection S _ :- coq.error "get-structure-sort-projection: not a structure" S.
pred get-structure-class-projection i:structure, o:term.
get-structure-class-projection (indt S) T :- !,
coq.env.projections S L,
if (L = [_, some P]) true (coq.error "No canonical class projection for" S),
T = global (const P).
get-structure-class-projection S _ :- coq.error "get-structure-class-projection: not a structure" S.
pred get-constructor i:gref, o:gref.
get-constructor (indt R) (indc K) :- !,
if (coq.env.indt R _ _ _ _ [K] _) true (coq.error "Not a record" R).
get-constructor I _ :- coq.error "get-constructor: not an inductive" I.
% finding for locally defined structures
pred get-cs-structure i:cs-instance, o:structure.
get-cs-structure (cs-instance _ _ (const Inst)) Struct :- std.do! [
coq.env.typeof (const Inst) InstTy,
coq.prod-tgt->gref InstTy Struct,
is-structure Struct,
].
pred get-cs-instance i:cs-instance, o:constant.
get-cs-instance (cs-instance _ _ (const Inst)) Inst.
pred has-cs-instance i:gref, i:cs-instance.
has-cs-instance GTy (cs-instance _ (cs-gref GTy) _).
pred mixin-src->has-mixin-instance i:prop, o:prop.
mixin-src->has-mixin-instance (mixin-src (global GR) M I) (has-mixin-instance (cs-gref GR) M IHd) :-
term->gref I IHd.
mixin-src->has-mixin-instance (mixin-src (app [global GR|_] ) M I) (has-mixin-instance (cs-gref GR) M IHd) :-
term->gref I IHd.
mixin-src->has-mixin-instance (mixin-src (prod _ _ _ ) M I) (has-mixin-instance cs-prod M IHd):-
term->gref I IHd.
mixin-src->has-mixin-instance (mixin-src (sort U) M I) (has-mixin-instance (cs-sort U) M IHd):-
term->gref I IHd.
% this auxiliary function iterates over the list of arguments of an application,
% and create the necessary unify condition for each arguments
% and at the end returns the mixin-src clause with all the conditions
pred mixin-instance-type->mixin-src.aux
i:list term, % list of arguments
i:term, % head of the original application
i:mixinname, % name of mixin
i:term, % instance body
i:list prop, % Cond list
o:prop.
mixin-instance-type->mixin-src.aux [] T M I Cond (mixin-src T M I :- Cond).
mixin-instance-type->mixin-src.aux [A|Args] T M I Cond (pi a \ C a) :-
pi a \
sigma Ta\
coq.mk-app T [a] Ta,
mixin-instance-type->mixin-src.aux Args Ta M I [coq.unify-eq A a ok|Cond] (C a).
% transforms the type of a mixin instance into a
% mixin-src clause with eventual conditions regarding its parameters
pred mixin-instance-type->mixin-src
i:term, % type of the instance Ty
i:mixinname, % name of mixin
i:term, % instance body I of type Ty
i:list prop, % Cond list
o:prop.
mixin-instance-type->mixin-src (app _ as F) M I Cond C :-
factory? F (triple _ _ Subject),
safe-dest-app Subject Hd Args,
mixin-instance-type->mixin-src.aux Args Hd M I Cond C.
mixin-instance-type->mixin-src (prod N_ _ F) M I Cond (pi a \ C a) :-
pi a\
sigma Ia \
coq.mk-app I [a] Ia,
mixin-instance-type->mixin-src (F a) M Ia Cond (C a).
pred has-mixin-instance->mixin-src i:prop, o:prop.
has-mixin-instance->mixin-src (has-mixin-instance _ M IHd) C :- std.do![
T = global IHd,
coq.env.typeof IHd Ty,
mixin-instance-type->mixin-src Ty M T [] C,
].
pred get-canonical-structures i:term, o:list structure.
get-canonical-structures TyTrm StructL :- std.do! [
term->cs-pattern TyTrm Pat, !,
coq.CS.db-for _ Pat DBGTyL,
std.map-filter DBGTyL get-cs-structure StructL,
].
pred get-canonical-instances i:term, o:list constant.
get-canonical-instances TyTrm StructL :- std.do! [
term->cs-pattern TyTrm Pat, !,
coq.CS.db-for _ Pat DBGTyL,
std.map-filter DBGTyL get-cs-instance StructL,
].
pred has-CS-instance? i:term, i:structure.
has-CS-instance? TyTerm (indt Struct) :- std.do! [
term->cs-pattern TyTerm Pat,
coq.env.projections Struct [some Proj, _],
coq.CS.db-for (const Proj) Pat L,
not(L = [])
].
pred structure-nparams i:structure, o:int.
structure-nparams Structure NParams :-
class-def (class Class Structure _),
factory-nparams Class NParams.
pred factory? i:term, o:w-args factoryname.
factory? S (triple F Params T) :-
not (var S), !,
safe-dest-app S (global GR) Args, factory-alias->gref GR F, factory-nparams F NP, !,
std.split-at NP Args Params [T|_].
% [find-max-classes Mixins Classes] states that Classes is a list of classes
% which contain all the mixins in Mixins.
% Although it is not strictly necessary, but desirable for debugging,
% we use a heuristic that tries to minimize the number
% of classes by assuming Mixins are reversed topologically sorted.
% Note: works with flat mixins, no params
pred find-max-classes i:list mixinname, o:list classname.
find-max-classes [] [].
find-max-classes [M|Mixins] [C|Classes] :-
mixin-first-class M C,
std.do! [
class-def (class C _ MLwP),
list-w-params_list MLwP ML,
std.filter Mixins (x\ not (std.mem! ML x)) Mixins',
find-max-classes Mixins' Classes
].
find-max-classes [M|_] _ :- coq.error "HB: cannot find a class containing mixin" M.
hierarchy-builder-1.7.0/HB/common/log.elpi 0000664 0000000 0000000 00000047242 14547515630 0020361 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
% This file contains proxies for the API to write into the Coq state (eg add
% an inductive, set implicit arguments...). This has two purposes:
% - give nicer error messages
% - we want to be able to log to a file all these actions (WIP), this file is
% were logging takes place. Hence we never call, say, coq.evn.add-* directly,
% but always via this proxy
namespace log.coq {
pred arguments.set-implicit i:gref, i:list (list implicit_kind).
arguments.set-implicit GR I :- std.do! [
coq.arguments.set-implicit GR I,
if (@local!) (Local = tt) (Local = ff),
log.private.log-vernac (log.private.coq.vernac.implicit Local {coq.gref->id GR} I),
].
pred env.add-location i:gref.
env.add-location GR :-
if (get-option "elpi.loc" Loc) % remove when coq-elpi > 1.9
(acc-clause library (decl-location GR Loc))
true.
pred strategy.set i:list constant, i:conversion_strategy.
strategy.set CL S :-
coq.strategy.set CL S,
log.private.log-vernac (log.private.coq.vernac.strategy CL S).
pred env.add-const-noimplicits i:id, i:term, i:term, i:opaque?, o:constant.
env.add-const-noimplicits Name Bo Ty Opaque C :- std.do! [
if (not(ground_term Ty ; ground_term Bo))
(coq.error "HB: cannot infer some information in" Name
":" {coq.term->string Ty} ":=" {coq.term->string Bo})
true,
avoid-name-collision Name Name1,
coq.env.add-const Name1 Bo Ty Opaque C,
env.add-location (const C),
if (var Ty) (Ty? = none) (Ty? = some Ty),
log.private.log-vernac (log.private.coq.vernac.definition Name1 Ty? Bo),
@local! => arguments.set-implicit (const C) [[]],
].
pred env.add-const i:id, i:term, i:term, i:opaque?, o:constant.
env.add-const Name Bo Ty Opaque C :- std.do! [
if (not(ground_term Ty ; ground_term Bo))
(coq.error "HB: cannot infer some information in" Name
":" {coq.term->string Ty} ":=" {coq.term->string Bo})
true,
avoid-name-collision Name Name1,
coq.env.add-const Name1 Bo Ty Opaque C,
env.add-location (const C),
if (var Ty) (Ty? = none) (Ty? = some Ty),
log.private.log-vernac (log.private.coq.vernac.definition Name1 Ty? Bo),
].
pred env.add-const-noimplicits-failondup i:id, i:term, i:term, i:opaque?, o:constant.
env.add-const-noimplicits-failondup Name Bo Ty Opaque C :- std.do! [
if (not(ground_term Ty ; ground_term Bo))
(coq.error "HB: cannot infer some information in" Name
":" {coq.term->string Ty} ":=" {coq.term->string Bo})
true,
coq.env.add-const Name Bo Ty Opaque C,
env.add-location (const C),
if (var Ty) (Ty? = none) (Ty? = some Ty),
log.private.log-vernac (log.private.coq.vernac.definition Name Ty? Bo),
@local! => arguments.set-implicit (const C) [[]],
].
pred env.add-section-variable-noimplicits i:id, i:term, o:constant.
env.add-section-variable-noimplicits Name Ty C :- std.do! [
if (Name = "_") (ID is "fresh_name_" ^ {std.any->string {new_int}}) (ID = Name),
@local! => coq.env.add-section-variable ID Ty C,
log.private.log-vernac (log.private.coq.vernac.variable ID Ty),
@local! => arguments.set-implicit (const C) [[]],
].
pred env.add-parameter i:id, i:term, o:constant.
env.add-parameter ID Ty C :- std.do! [
@global! => coq.env.add-axiom ID Ty C,
log.private.log-vernac (log.private.coq.vernac.parameter ID Ty),
].
pred env.add-indt i:indt-decl, o:inductive.
env.add-indt Decl I :- std.do! [
if (not(coq.ground-indt-decl? Decl))
(coq.error "HB: cannot infer some information in" {coq.indt-decl->string Decl})
true,
coq.env.add-indt Decl I,
(coq.env.record? I P ; P = ff),
log.private.log-vernac (log.private.coq.vernac.inductive Decl P),
env.add-location (indt I),
% copy the current value of implicit arguments
coq.env.indt I _ _ _ _ KS _,
log.private.log-implicits-of ff (indt I),
std.forall KS (k\ env.add-location (indc k), log.private.log-implicits-of ff (indc k)),
std.forall {coq.env.projections I}
(p\ sigma c\ if (p = some c) (env.add-location (const c), log.private.log-implicits-of ff (const c)) true),
].
pred env.begin-module i:id, i:option (pair modtypath id).
env.begin-module Name none :- std.do! [
coq.env.begin-module Name none,
log.private.log-vernac (log.private.coq.vernac.begin-module Name none),
].
env.begin-module Name (some (pr Sig SigName)) :- std.do! [
coq.env.begin-module Name (some Sig),
log.private.log-vernac (log.private.coq.vernac.begin-module Name (some SigName)),
].
pred env.begin-module-type i:id.
env.begin-module-type Name :- std.do! [
coq.env.begin-module-type Name,
log.private.log-vernac (log.private.coq.vernac.begin-module-type Name),
].
pred env.end-module-name i:id, o:modpath.
env.end-module-name Name M :- std.do! [
coq.env.end-module M,
log.private.log-vernac (log.private.coq.vernac.end-module Name),
].
pred env.end-module-type-name i:id, o:modtypath.
env.end-module-type-name Name M :- std.do! [
coq.env.end-module-type M,
log.private.log-vernac (log.private.coq.vernac.end-module-type Name),
].
pred env.begin-section i:id.
env.begin-section Name :- std.do! [
coq.env.begin-section Name,
log.private.log-vernac (log.private.coq.vernac.begin-section Name),
].
pred env.end-section-name i:id.
env.end-section-name Name :- std.do! [
coq.env.end-section,
log.private.log-vernac (log.private.coq.vernac.end-section Name),
].
pred notation.add-abbreviation i:id, i:int, i:term, i:bool, o:abbreviation.
notation.add-abbreviation Name NArgs Body OnlyParsing O :- std.do! [
coq.notation.add-abbreviation Name NArgs Body OnlyParsing O,
log.private.log-vernac (log.private.coq.vernac.abbreviation Name NArgs Body),
].
pred env.export-module i:id, i:modpath.
env.export-module MPNice M :- std.do! [
coq.env.export-module M,
log.private.log-vernac (log.private.coq.vernac.export-module MPNice),
].
pred env.import-module i:id, i:modpath.
env.import-module MPNice M :- std.do! [
coq.env.import-module M,
log.private.log-vernac (log.private.coq.vernac.import-module MPNice),
].
pred coercion.declare i:coercion.
coercion.declare C :- std.do! [
@global! => @reversible! => coq.coercion.declare C,
C = coercion GR _ SRCGR TGTCL,
coq.gref->id GR Name,
log.private.log-vernac (log.private.coq.vernac.coercion Name SRCGR TGTCL),
].
}
% Since CS.foo is not a valid predicate name we can't use it
% in the namespace, so we just define it here with the full name
pred log.coq.CS.declare-instance i:constant.
log.coq.CS.declare-instance C :- std.do! [
if (@local!) (Local = tt) (Local = ff),
coq.CS.declare-instance (const C),
coq.gref->id (const C) Id,
std.last {coq.gref->path (const C)} M,
std.last {coq.env.current-path} M1,
if (M = M1) (Name = Id) (Name is M ^ "." ^ Id),
log.private.log-vernac (log.private.coq.vernac.canonical Name Local),
].
pred log.coq.check i:term, o:term, o:term, o:diagnostic.
log.coq.check Skel Ty T D :- std.do! [
coq.elaborate-skeleton Skel Ty T D,
if (get-option "fail" tt) (Fail = tt) (Fail = ff),
log.private.log-vernac (log.private.coq.vernac.check Skel Fail),
].
pred refine i:term, i:goal, o:list sealed-goal. % to silence a warning, since this is only in tactics
pred log.refine i:term, i:goal, o:list sealed-goal.
log.refine T G GL :- std.do! [
refine T G GL,
G = goal _ _ _ Solution _,
log.private.log-tactic Solution,
].
pred refine.no_check i:term, i:goal, o:list sealed-goal. % to silence a warning, since this is only in tactics
pred log.refine.no_check i:term, i:goal, o:list sealed-goal.
log.refine.no_check T G GL :- std.do! [
refine.no_check T G GL,
G = goal _ _ _ Solution _,
log.private.log-tactic Solution,
].
namespace log.private {
%%%%% Logging Utils %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
pred log-implicits-of i:bool, i:gref.
log-implicits-of Local GR :-
coq.arguments.implicit GR I,
if (std.forall I (i\ std.forall i (x\ x = explicit))) (IMP = [[]]) (IMP = I),
log.private.log-vernac (log.private.coq.vernac.implicit Local {coq.gref->id GR} IMP).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Coq document
% This is a very minimalistic AST to represent a Coq document equipped with
% pretty printing facilities.
%
% When "complete enough" this should be moved to coq-elpi proper.
kind coq.vernac type.
type coq.vernac.begin-module string -> option string -> coq.vernac.
type coq.vernac.end-module string -> coq.vernac.
type coq.vernac.begin-module-type string -> coq.vernac.
type coq.vernac.end-module-type string -> coq.vernac.
type coq.vernac.begin-section string -> coq.vernac.
type coq.vernac.end-section string -> coq.vernac.
type coq.vernac.import-module string -> coq.vernac.
type coq.vernac.export-module string -> coq.vernac.
type coq.vernac.definition string -> option term -> term -> coq.vernac.
type coq.vernac.variable string -> term -> coq.vernac.
type coq.vernac.parameter string -> term -> coq.vernac.
type coq.vernac.inductive indt-decl -> bool -> coq.vernac.
type coq.vernac.abbreviation string -> int -> term -> coq.vernac.
type coq.vernac.notation string -> int -> term -> coq.vernac.
type coq.vernac.coercion string -> gref -> class -> coq.vernac.
type coq.vernac.canonical string -> bool -> coq.vernac.
type coq.vernac.implicit bool -> string -> list (list implicit_kind) -> coq.vernac.
type coq.vernac.comment A -> coq.vernac.
type coq.vernac.check term -> bool -> coq.vernac.
type coq.vernac.strategy list constant -> conversion_strategy -> coq.vernac.
}
pred with-logging i:prop.
pred log.private.log-vernac i:log.private.coq.vernac.
pred log.private.log-tactic i:term.
/* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
% implementation of logging and vernac printing
with-logging P :- (get-option "elpi.hb.log" _, NICE = tt ; get-option "elpi.hb.log.raw" _, NICE = ff), !,
get-option "elpi.loc" Loc,
loc.fields Loc FILE Start Stop _ _,
LocStr is "characters " ^ {std.any->string Start} ^ "-" ^ {std.any->string Stop},
FILENAME is FILE ^ ".hb",
open_append FILENAME OC1,
std.string.concat "\n" ["","HIERARCHY BUILDER PATCH v1",LocStr,""] PATCH1,
output OC1 PATCH1,
close_out OC1,
log.private.logger L NICE => P,
log.private.logger-close L,
std.intersperse coq.pp.spc L PP,
coq.pp->string (coq.pp.box (coq.pp.v 0) PP) S,
open_append FILENAME OC2,
output OC2 S,
close_out OC2.
with-logging P :- (get-option "log" tt, NICE = tt ; get-option "log.raw" tt, NICE = ff), !,
log.private.logger L NICE => P,
log.private.logger-close L,
std.intersperse coq.pp.spc L PP,
coq.pp->string (coq.pp.box (coq.pp.v 0) PP) S,
coq.say "(* \n" S "\n*)".
with-logging P :- P.
log.private.log-vernac V :- log.private.logger L Nice, !,
if (Nice = tt) (PPALL = []) (PPALL = [@ppall!]),
log.private.logger-extend L {PPALL => log.private.coq.vernac->pp [V]}.
log.private.log-vernac _.
log.private.log-tactic P :- log.private.logger L Nice, !,
if (Nice = tt) (PPALL = []) (PPALL = [@ppall!]),
log.private.logger-extend L {PPALL => @holes! => coq.term->pp P}.
log.private.log-tactic _.
% The main entry point to print vernacular commands is coq.vernac->pp
shorten log.private.coq.vernac.{ begin-module , end-module , begin-section, end-section }.
shorten log.private.coq.vernac.{ begin-module-type , end-module-type }.
shorten log.private.coq.vernac.{ import-module , export-module }.
shorten log.private.coq.vernac.{ definition , variable , comment , check }.
shorten log.private.coq.{ vernac.inductive , vernac.implicit , vernac.parameter }.
shorten log.private.coq.vernac.{ canonical , abbreviation , notation , coercion , strategy }.
shorten log.private.{ coq.vernac }.
shorten coq.pp.{ box , h , spc , v , str , hv , hov, glue, brk }.
namespace log.private {
pred logger o:list coq.pp, o:bool.
pred logger-extend i:list coq.pp, i:coq.pp.
logger-extend [] _ :- coq.error "HB: logger was closed".
logger-extend (uvar as X) V :- X = [V|FRESH_].
logger-extend [_|XS] V :- logger-extend XS V.
pred logger-close i:list coq.pp.
logger-close (uvar as X) :- X = [].
logger-close [_|XS] :- logger-close XS.
pred coq.vernac->pp i:list coq.vernac, o:coq.pp.
coq.vernac->pp L (box (v 0) L2) :-
std.map L coq.vernac->pp1 L1,
std.intersperse spc L1 L2.
pred coq.vernac->pp1 i:coq.vernac, o:coq.pp.
coq.vernac->pp1 (begin-module Name none) PP :-
PP = box h [str "Module ", str Name, str "."].
coq.vernac->pp1 (begin-module Name (some TyName)) PP :-
PP = box h [str "Module ", str Name, str " : ", str TyName, str "."].
coq.vernac->pp1 (end-module Name) PP :-
PP = box h [str "End ", str Name, str "."].
coq.vernac->pp1 (begin-module-type Name) PP :-
PP = box h [str "Module Type ", str Name, str "."].
coq.vernac->pp1 (end-module-type Name) PP :-
PP = box h [str "End ", str Name, str "."].
coq.vernac->pp1 (begin-section Name) PP :-
PP = box h [str "Section ", str Name, str "."].
coq.vernac->pp1 (end-section Name) PP :-
PP = box h [str "End ", str Name, str "."].
coq.vernac->pp1 (definition Name none Body) PP :-
PP = box (hv 2) [str "Definition ", str Name, str " :=", spc, B, str "."],
coq.term->pp Body B.
coq.vernac->pp1 (definition Name (some Ty) Body) PP :-
PP = box (hv 2) [str "Definition ", str Name, str " : ", T, str " :=", spc, B, str "."],
coq.term->pp Ty T,
coq.term->pp Body B.
coq.vernac->pp1 (variable Name Ty) (box (hv 2) [box h [str "Variable ", str Name, str " :"], spc, TY, str "."]) :-
coq.term->pp Ty TY.
coq.vernac->pp1 (vernac.parameter Name Ty) (box (hv 2) [box h [str "Parameter ", str Name, str " :"], spc, TY, str "."]) :-
coq.term->pp Ty TY.
coq.vernac->pp1 (import-module Name) (box h [str "Import ", str Name, str "."]).
coq.vernac->pp1 (export-module Name) (box h [str "Export ", str Name, str "."]).
coq.vernac->pp1 (notation KM NParams Term) (box (hv 2) [box h [str "Notation \"'",str KM,str"' "|StrParams], str "\" := (", spc, B, str ") (at level 1)."]) :- !,
coq.vernac->ppabbrterm NParams Term StrParams B.
coq.vernac->pp1 (abbreviation Name NParams Term) (box (hv 2) [box h [str "Notation ",str Name|StrParams], str " := (", spc, B, str ")."]) :-
coq.vernac->ppabbrterm NParams Term StrParams B.
coq.vernac->pp1 (canonical Name Local) (box h [Locality, str "Canonical ", str Name, str "."]) :-
local->locality Local Locality.
coq.vernac->pp1 (coercion Name SRC TGT) (box h [str "#[reversible] Coercion ", str Name, str " : ", str S, str " >-> ", str T, str "."]) :-
coq.gref->path SRC SP, std.string.concat "." {std.take-last 2 SP} S', S is S' ^ "." ^ {coq.gref->id SRC},
if2 (TGT = sortclass) (T = "Sortclass")
(TGT = funclass) (T = "Funclass")
(TGT = grefclass GR, coq.gref->path GR GRP, std.string.concat "." {std.take-last 2 GRP} T', T is T' ^ "." ^ {coq.gref->id GR}).
coq.vernac->pp1 (vernac.inductive I Primitive) (glue [str Start, PP, str Stop]) :-
coq.vernac->ppinductive I [] PP,
if (Primitive = tt)
(Start = "Set Primitive Projections. ", Stop = "Unset Primitive Projections. ")
(Start = "", Stop = "").
coq.vernac->pp1 (vernac.implicit Local Name [[]]) (box h [Locality, str "Arguments ", str Name, str " : clear implicits."]) :- local->locality Local Locality.
coq.vernac->pp1 (vernac.implicit Local Name [L]) (box h [Locality, str "Arguments ", str Name, spc, glue PP, str "."]) :-
local->locality Local Locality,
std.map L coq.vernac->ppimparg PP1,
std.intersperse spc PP1 PP.
coq.vernac->pp1 (comment A) (box (hov 2) [str"(*", str S, str"*)"]) :-
std.any->string A S.
coq.vernac->pp1 (check T Fail) (box (hov 2) [Failure, str"Check", spc, PPT, str"."]) :-
@holes! => coq.term->pp T PPT,
fail->failure Fail Failure.
coq.vernac->pp1 (strategy L opaque) (box (hov 2) [str"Strategy opaque [", glue PPL , str"]."]) :-
std.map L (c\r\sigma id\coq.gref->id (const c) id, r = str id) LID, std.intersperse spc LID PPL.
coq.vernac->pp1 (strategy L expand) (box (hov 2) [str"Strategy expand [", glue PPL , str"]."]) :-
std.map L (c\r\sigma id\coq.gref->id (const c) id, r = str id) LID, std.intersperse spc LID PPL.
coq.vernac->pp1 (strategy L (level N)) (box (hov 2) [str"Strategy ",str NPP,str" [", glue PPL , str"]."]) :-
std.any->string N NPP,
std.map L (c\r\sigma id\coq.gref->id (const c) id, r = str id) LID, std.intersperse spc LID PPL.
pred local->locality i:bool, o:coq.pp.
local->locality tt (str "Local ").
local->locality ff (str "Global ").
pred fail->failure i:bool, o:coq.pp.
fail->failure tt (str "Fail ").
fail->failure ff (str "").
pred coq.vernac->ppimparg i:implicit_kind, o:coq.pp.
coq.vernac->ppimparg explicit (str "_").
coq.vernac->ppimparg maximal (str "{_}").
coq.vernac->ppimparg implicit (str "[_]").
pred coq.vernac->ppinductive i:indt-decl, i:list (pair implicit_kind term), o:coq.pp.
coq.vernac->ppinductive (parameter ID IMPL TY I) Acc R :-
@pi-parameter ID TY p\ coq.vernac->ppinductive (I p) [pr IMPL p|Acc] R.
coq.vernac->ppinductive (record ID SORT KID RD) ParamsRev (box (v 0) [Hack1, PP, Hack2]) :-
PP = (box (hov 0) [
box (hov 0) [str "Record", spc, str ID, brk 1 4, glue ParamsPP,
str " : ", SortPP, brk 1 2, str":= ", str KID],
brk 1 2,
box (hv 2) [str"{", spc, glue FieldsPP, str"}"],
str"."]),
Hack1 = glue [str "Section ", str ID, str ".", spc,
str "Local Unset Implicit Arguments.", spc],
Hack2 = glue [spc, str "End ", str ID, str".", spc],
std.rev ParamsRev Params,
coq.vernac->ppinductiveparams Params ParamsPP,
coq.term->pp SORT SortPP,
coq.vernac->pprecordfields RD FieldsPP.
coq.vernac->ppinductive (inductive ID IsInd Arity Ks) ParamsRev PP :-
PP = (box (hov 0) [
str CO,str "Inductive", spc,
box (hov 0) [
str ID, brk 1 4, glue ParamsPP, ArityPP, str " :="],
brk 0 2,
box (hv 2) [str" ", glue KsPp],
str "."]),
std.rev ParamsRev Params,
coq.vernac->ppinductiveparams Params ParamsPP,
std.map Params snd ParamsAsArgs,
if (IsInd = tt) (CO = "") (CO = "Co"),
coq.arity->pp Arity ArityPP,
@pi-inductive ID Arity x\
coq.mk-app x ParamsAsArgs (X x),
coq.vernac->ppinductiveconstructor (Ks (X x)) KsPp.
pred coq.vernac->ppinductiveconstructor i:list indc-decl, o:list coq.pp.
coq.vernac->ppinductiveconstructor [] [].
coq.vernac->ppinductiveconstructor [constructor ID Arity|Ks] PP :-
PP = [str ID,{coq.arity->pp Arity},SEP|Rest],
if (Ks = []) (SEP = str"") (SEP = glue [brk 1 0, str "| "]),
coq.vernac->ppinductiveconstructor Ks Rest.
pred coq.vernac->ppinductiveparams i:list (pair implicit_kind term), o:list coq.pp.
coq.vernac->ppinductiveparams [] [].
coq.vernac->ppinductiveparams [pr Imp T|Rest] PP :-
PP = [box (hov 2) [str A,ID,str " : ", TY,str B]|PPRest],
coq.term->pp T ID, decl T _ Ty, coq.term->pp Ty TY,
if2 (Imp = explicit) (A = "(", B = ")")
(Imp = maximal) (A = "{", B = "}")
(A = "[", B = "]"),
coq.vernac->ppinductiveparams Rest PPRest.
pred coq.vernac->pprecordfields i:record-decl, o:list coq.pp.
coq.vernac->pprecordfields end-record [].
coq.vernac->pprecordfields (field _ ID TY F) [ str ID, str " : ", TYPP, str ";", spc|FPP] :- % TODO attributes
coq.term->pp TY TYPP,
@pi-parameter ID TY p\ coq.vernac->pprecordfields (F p) FPP.
pred coq.vernac->ppabbrterm i:int, i:term, o:list coq.pp, o:coq.pp.
coq.vernac->ppabbrterm 0 T [] B :- !, @holes! => coq.term->pp T B.
coq.vernac->ppabbrterm N (fun _ _ F) [spc,str ID|StrParams] B :-
ID is "X" ^ {std.any->string N},
coq.id->name ID Name,
M is N - 1,
@pi-decl Name (sort prop) x\ coq.vernac->ppabbrterm M (F x) StrParams B.
}
hierarchy-builder-1.7.0/HB/common/phant-abbreviation.elpi 0000664 0000000 0000000 00000032416 14547515630 0023352 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
% Kit to build abbreviations /à la/ *pack*, that is
% [Notation N x_0 .. x_n := C x_0 .. _ _ id .. x_i .. _ id _ _ id]
% with a variable number of [_] between each [id], and where
% - [x_i] is given by the user
% - [_] correspond to arguments that are left implicit,
% - [id] trigger unification as described in
% - [Phant x] to infer the canonical structure on x
%
% See /Canonical Structures for the working Coq user/ by Mahboubi and Tassi
% This type is private, build it via the APIs below
typeabbrev phant-term phant.private.phant-term.
namespace phant {
% [add-abbreviation Name PhT C A] builds a definition "phant_Name" for the
% term T and an abbreviation Name as per Ph.
% Use the API below to build a PhT as you like.
pred add-abbreviation i:string, i:phant-term, o:constant, o:abbreviation.
add-abbreviation N (private.phant-term AL T1) C Abbrev :- std.do! [
NC is "phant_" ^ N,
std.assert-ok! (coq.elaborate-skeleton T1 TTy T) "add-abbreviation: T illtyped",
log.coq.env.add-const-noimplicits NC T TTy @transparent! C,
private.build-abbreviation 0 (global (const C)) AL NParams AbbrevT,
@global! => log.coq.notation.add-abbreviation N NParams AbbrevT tt Abbrev,
].
% [of-gref WithCopy GR RealMixinArgs PT]
% builds a phant-term taking all parameters,
% the type, then inferring automatically all structures covering the mixins
% GR depends on. RealMixinArgs is a list of mixins one wants to explicitly
% pass (instead of being inferred)
% If WithCopy = tt, an extra argument is added after all the parameters
% and before the source keu to replace the target key by a user chosen one.
pred of-gref i:bool, i:gref, i:list mixinname, o:phant-term.
of-gref WithCopy GRF RealMixinArgs PhBody:- !, std.do! [
std.assert! (gref-deps GRF MLwP) "mk-phant-term: unknown gref",
std.assert! (coq.env.typeof GRF FTy) "mk-phant-term: F illtyped",
coq.mk-eta (-1) FTy (global GRF) EtaF,
% toposort-mixins ML MLSorted,
MLwP = MLwPSorted, % Assumes we give them already sorted in dep order.
std.rev {list-w-params_list MLwPSorted} MLSortedRev,
std.map RealMixinArgs (m\ r\ r = private.this-mixin-is-real-arg m) RMClauses,
std.filter MLSortedRev (m\ not(std.mem! RealMixinArgs m)) MLSortedRevFiltered,
find-max-classes MLSortedRevFiltered CNL,
assert-good-coverage! MLSortedRevFiltered CNL,
RMClauses => if (WithCopy = ff)
(w-params.then MLwP fun-real fun-real
(ps\ t\ ml\ o\ private.mk-phant-term.classes EtaF CNL ps t t ml o) PhBody)
(w-params.fold MLwP fun-real
(private.mk-phant-term-with-copy EtaF CNL) PhBody
)
].
% API à la carte: start with a term and wrap it up -------------------------
% A term with no phantom arguments
pred init i:term, o:phant-term.
init T (private.phant-term [] T).
% [fun-real N T Ph Ph1] Adds a real argument named N of type T around Ph
pred fun-real i:name, i:term, i:(term -> phant-term), o:phant-term.
fun-real N T F Res :- !, private.phant-fun (private.real N) T F Res.
% [fun-unify Msg X1 X2 Ph Ph1] Adds an argument that will foce the unification
% of X1 with X2 and print Msg is case of error around Ph
pred fun-unify i:option term, i:term, i:term, i:phant-term, o:phant-term.
fun-unify OMsg X1 X2 (private.phant-term AL F) (private.phant-term [private.unify|AL] UF) :-
std.assert-ok! (coq.typecheck X1 T1) "fun-unify: X1 illtyped",
std.assert-ok! (coq.typecheck X2 T2) "fun-unify: X2 illtyped",
if (OMsg = some M) (Msg = {{lib:hb.not_a_msg lp:M}}) (Msg = {{lib:hb.nomsg}}),
UF = {{fun unif_arbitrary : lib:hb.unify lp:T1 lp:T2 lp:X1 lp:X2 lp:Msg => lp:F}}.
% [fun-implicit N T Ph Ph1] Adds an implicit argument name N of type T areound Ph
pred fun-implicit i:name, i:term, i:(term -> phant-term), o:phant-term.
fun-implicit N Ty (t\ private.phant-term AL (F t))
(private.phant-term [private.implicit|AL] (fun N Ty F)).
% [fun-infer-type N T Ph Ph1] Adds an argument N of type T such that one passes
% a value V of type {{ Type }} the corresponding canonical VC of type T is passed
% for N , eg `fun T (phT : phant T) => Ph`
pred fun-infer-type i:class, i:name, i:term, i:(term -> phant-term), o:phant-term.
fun-infer-type sortclass N Ty (t\private.phant-term AL (Bo t)) Out :-
coq.name-suffix N "ph" PhN,
fun-implicit N Ty (t\private.phant-term [private.infer-type N sortclass|AL]
(fun PhN {{ lib:@hb.phant lp:t }} _\ Bo t)) Out.
fun-infer-type funclass N Ty (t\private.phant-term AL (Bo t)) Out :-
coq.name-suffix N "ph" PhN,
fun-implicit N Ty (t\private.phant-term [private.infer-type N funclass|AL]
(fun PhN {{ lib:@hb.phantom (_ -> _) lp:t }} _\ Bo t)) Out.
fun-infer-type (grefclass Class) N Ty (t\private.phant-term AL (Bo t)) Out :-
coq.name-suffix N "ph" PhN, private.build-type-pattern Class Pat,
fun-implicit N Ty (t\private.phant-term [private.infer-type N (grefclass Class)|AL]
(fun PhN {{ lib:@hb.phantom lp:Pat lp:t }} _\ Bo t)) Out.
% TODO: this looks like a hack to remove
pred append-fun-unify i:phant-term, o:phant-term.
append-fun-unify (private.phant-term LP T) (private.phant-term LPU T) :-
std.append LP [private.unify] LPU.
/* ------------------------------------------------------------------------- */
/* ----------------------------- private code ------------------------------ */
/* ------------------------------------------------------------------------- */
namespace private {
% phant-term is a pair of a list of argument kinds together with a term
kind phant-term type.
type phant-term list phant-arg -> term -> phant-term.
% phant-arg encode these three kind of arguments
% - [x_i] is encoded using [real x_i]
% - [_] using [implicit]
% - [id] using [unify]
% - [Phant x] using [infer-type]
kind phant-arg type.
type real name -> phant-arg.
type infer-type name -> class -> phant-arg.
type implicit phant-arg.
type unify phant-arg.
shorten coq.{ mk-app }.
pred this-mixin-is-real-arg o:mixinname.
pred phant-fun i:phant-arg, i:term, i:(term -> phant-term), o:phant-term.
phant-fun Arg Ty PhF (phant-term [Arg|ArgL] (fun N Ty F)) :-
if (Arg = real N) true (N = `_`),
@pi-decl N Ty x\ PhF x = phant-term ArgL (F x).
% [phant-fun-mixin N Ty PF PUF] states that PUF is a phant-term
% which quantifies [PF x] over [x : Ty] (with name N)
% Ty must be an (applied) mixin M, and the phantom status of this mixin
% is determined by [this-mixin-is-real-arg M].
pred phant-fun-mixin i:name, i:term, i:(term -> phant-term), o:phant-term.
phant-fun-mixin N Ty PF (private.phant-term [Status|AL] (fun N Ty F)) :- !, std.do! [
@pi-decl N Ty t\ PF t = private.phant-term AL (F t),
coq.safe-dest-app Ty (global Mixin) _,
if (this-mixin-is-real-arg Mixin) (Status = private.real N) (Status = private.implicit)
].
pred fun-unify-mixin i:term, i:name, i:term, i:(term -> phant-term), o:phant-term.
fun-unify-mixin T N Ty PF Out :- !, std.do! [
coq.safe-dest-app Ty (global M) _,
Msg is "fun-unify-mixin: No mixin-src on " ^ {coq.term->string T},
std.assert! (mixin-src T M Msrc) Msg,
(@pi-decl `m` Ty m\ fun-unify none m Msrc (PF m) (PFM m)),
fun-implicit N Ty PFM Out
].
% [phant-fun-struct T S Params PF PSF] states that PSF is a phant-term
% which postulate a structure [s : S Params] such that [T = sort s]
% and then outputs [PF s]
pred phant-fun-struct i:term, i:name, i:structure, i:list term, i:(term -> phant-term), o:phant-term.
phant-fun-struct T Name S Params PF Out :- std.do! [
get-structure-sort-projection S SortProj,
mk-app (global S) Params SParams,
mk-app SortProj Params SortProjParams,
% Msg = {{lib:hb.nomsg}},
Msg = some {{lp:SParams}},
(@pi-decl Name SParams s\ fun-unify Msg T {mk-app SortProjParams [s]} (PF s) (UnifSI s)),
fun-implicit Name SParams UnifSI Out
].
% A *pack* notation can be easiliy produced from a phant-term using
% [add-abbreviation N PT C], which states that C is a new constant
% which name is phant_N, and which produces a simple notation
% with name N using the data of the phant-term PT to reconstruct a notation
% [Notation N x0 .. xn := C x0 _ _ id .. xi .. _ id _ _ id]
% as described above.
pred build-abbreviation i:int, i:term, i:list phant-arg, o:int, o:term.
build-abbreviation K F [] K F.
build-abbreviation K F [real N|AL] K'' (fun N _ AbbrevFx) :- !,
pi x\ build-abbreviation K {mk-app F [x]} AL K' (AbbrevFx x),
K'' is K' + 1.
build-abbreviation K F [infer-type N sortclass|AL] K'' (fun N _ AbbrevFx) :- !,
pi x\ build-abbreviation K {mk-app F [{{ lib:hb.Phant lp:x }}]} AL K' (AbbrevFx x),
K'' is K' + 1.
build-abbreviation K F [infer-type N funclass|AL] K'' (fun N _ AbbrevFx) :- !,
pi x\ build-abbreviation K {mk-app F [{{ lib:hb.Phantom (_ -> _) lp:x }}]} AL K' (AbbrevFx x),
K'' is K' + 1.
build-abbreviation K F [infer-type N (grefclass Class)|AL] K'' (fun N _ AbbrevFx) :- !,
build-type-pattern Class Pat,
pi x\ build-abbreviation K {mk-app F [{{ lib:hb.Phantom lp:Pat lp:x }}]} AL K' (AbbrevFx x),
K'' is K' + 1.
build-abbreviation K F [implicit|AL] K' FAbbrev :- !,
build-abbreviation K {mk-app F [_]} AL K' FAbbrev.
build-abbreviation K F [unify|AL] K' FAbbrev :- !,
build-abbreviation K {mk-app F [{{lib:@hb.id _ _}}]} AL K' FAbbrev.
% [build-type-pattern GR Pat] cheks that GR : forall x_1 ... x_n, Type
% and returns Pat = GR _ ... _ (that is GR applied to n holes).
% Note that n can be 0 when GR : Type.
pred build-type-pattern i:gref, o:term.
build-type-pattern GR Pat :- build-type-pattern.aux GR {coq.env.typeof GR} Pat.
build-type-pattern.aux GR T {{ lp:Pat _ }} :- coq.unify-eq T (prod N S T') ok, !,
@pi-decl N S x\ build-type-pattern.aux GR (T' x) Pat.
build-type-pattern.aux GR T (global GR) :- coq.unify-eq T {{ Type }} ok, !.
build-type-pattern.aux _ _ _ :- coq.error "HB: wrong carrier type".
% [mk-phant-term F PF] states that
% if F = fun p1 .. p_k T m_0 .. m_n => _
% then PF = phant-term
% [real p_1, ... real p_k, real T, implicit, .., implicit,
% implicit, .., implicit,
% implicit, unify,
% implicit, unify,
% implicit, .., implicit, unify,
% unify, ..., unify,
% ...,
% implicit, .., implicit,
% implicit, unify,
% implicit, unify,
% implicit, .., implicit, unify,
% unify, ..., unify]
% {{fun p_1 ... p_k T m_0 .. m_n =>
% fun q_1 .. q_l =>
% [find t | T ~ t]
% [find s_0 | t ~ s_0]
% [find c_0 | s_0 ~ SK q_1 .. q_l t c_0]
% [find m'_{i_0_0}, .., m'_{i_0_n0} | c_0 ~ CK m'_{i_0_0} .. m'_{i_0_n0}]
% fun of hb.unify m_{i_0_0} m'_{i_0_0} & ... & hb.unify m_{i_0_n0} m'_{i_0_n0} =>
% ...
% fun q'_1 .. q'_l' =>
% [find t | T ~ t]
% [find s_k | t ~ s_k]
% [find c_k | s_k ~ SK q'_1 .. q'_l' y c_k]
% [find m'_{i_k_0}, .., m'_{i_k_nk} | c_0 ~ CK m'_{i_k_0} .. m'_{i_k_nk}]
% fun of hb.unify m_{i_0_0} m'_{i_0_0} & ... & hb.unify m_{i_k_nk} m'_{i_k_nk} =>
% F p_1 ... p_k T m_i0_j0 .. m_il_jl}}
pred mk-phant-term.mixins i:term, i:term, i:classname, i:phant-term,
i:list term, i:name, i:term, i:(term -> list (w-args mixinname)), o:phant-term.
mk-phant-term.mixins Target Src CN PF Params N Ty MLwA Out :- std.do! [
class-def (class CN SI _),
mk-app (global SI) Params SIParams,
coq.name-suffix N "local" Nlocal,
(@pi-decl Nlocal Ty t\ sigma SK KC ML ParamsT SKPT\ std.do! [
std.map (MLwA t) triple_1 ML,
std.append Params [t] ParamsT,
SKPT = app [global {get-constructor SI} | ParamsT],
ClassTy t = app [global CN | ParamsT],
(@pi-decl `s` SIParams s\ @pi-decl `c` (ClassTy t) c\ sigma PF2\ std.do![
synthesis.under-mixins.then (MLwA t) (fun-unify-mixin Target)
(mk-phant-term.mixins.aux t Params c CN PF) PF2,
fun-unify none s {mk-app SKPT [c]} PF2 (PFU t s c),
]),
Body t = {fun-unify none t Src
{phant-fun-struct t `s` SI Params s\
{fun-implicit `c` (ClassTy t) (PFU t s)}}}
]),
fun-implicit Nlocal Ty Body Out
].
mk-phant-term.mixins.aux T Params C CN PF X :- std.do![
get-constructor CN KC,
synthesis.infer-all-gref-deps Params T KC KCM,
fun-unify none KCM C PF X,
].
pred mk-phant-term.class
i:term, i:term, i:classname, i:phant-term, o:phant-term.
mk-phant-term.class Target Src CN PF CPF :- !, std.do! [
class-def (class CN _ CMLwP),
w-params.fold CMLwP fun-implicit
(mk-phant-term.mixins Target Src CN PF) CPF,
].
pred mk-phant-term.classes
i:term, i:list classname, i:list term, i:term, i:term,
i:list (w-args mixinname), o:phant-term.
mk-phant-term.classes EtaF CNF PL Target Src MLwA PhF :- !, std.do! [
std.map MLwA triple_1 ML,
synthesis.under-mixins.then MLwA phant-fun-mixin (out\ sigma FPLTM\ std.do! [
synthesis.infer-all-these-mixin-args PL Target ML EtaF FPLTM,
std.fold CNF (phant-term [] FPLTM) (mk-phant-term.class Target Src) out]) PhF
].
pred mk-phant-term-with-copy i:term, i:list classname,
i:list term, i:name, i:term,
i:(term -> list (w-args mixinname)), o:phant-term.
mk-phant-term-with-copy EtaF CNF PL N Ty MLwA PhF :- !, std.do! [
(@pi-decl N Ty target\ @pi-decl N Ty src\ sigma Body\
mk-phant-term.classes EtaF CNF PL target src (MLwA target) Body,
fun-unify none target src Body (BodyUnif target src)),
fun-real N Ty (target\ {fun-real N Ty (BodyUnif target)}) PhF
].
}}
hierarchy-builder-1.7.0/HB/common/stdpp.elpi 0000664 0000000 0000000 00000030770 14547515630 0020730 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
% This file contains additions to elpi or coq-elpi standard library
kind triple type -> type -> type -> type.
type triple A -> B -> C -> triple A B C.
pred triple_1 i:triple A B C, o:A.
triple_1 (triple A _ _) A.
pred triple_2 i:triple A B C, o:B.
triple_2 (triple _ B _) B.
pred triple_3 i:triple A B C, o:C.
triple_3 (triple _ _ C) C.
namespace std {
pred nlist i:int, i:A, o: list A.
nlist N X L :- std.map {std.iota N} (_\ y\ y = X) L.
pred list-diff i:list A, i:list A, o:list A.
list-diff X [] X.
list-diff L [D|DS] R :-
std.filter L (x\ not(x = D)) L1,
list-diff L1 DS R.
pred list-uniq i:list A, o:list A.
pred list-uniq.seen i:A.
list-uniq [] [].
list-uniq [X|XS] YS :- list-uniq.seen X, !, list-uniq XS YS.
list-uniq [X|XS] [X|YS] :- list-uniq.seen X => list-uniq XS YS.
pred list-eq-set i:list A, i:list A.
list-eq-set L1 L2 :- list-diff L1 L2 [], list-diff L2 L1 [].
pred partition i:list A, i:(A -> prop), o:list A, o:list A.
partition [] _ [] [].
partition [X|XS] P [X|YS] ZS :- P X, !, partition XS P YS ZS.
partition [X|XS] P YS [X|ZS] :- partition XS P YS ZS.
pred under.do! i:((A -> Prop) -> A -> prop), i:list prop.
under.do! Then LP :- Then (_\ std.do! LP) _.
pred map-triple i:(A -> A1 -> prop), i:(B -> B1 -> prop), i:(C -> C1 -> prop), i:triple A B C, o:triple A1 B1 C1.
map-triple F G H (triple X Y Z) (triple X1 Y1 Z1) :- F X X1, G Y Y1, H Z Z1.
pred sort.split i:list A, o:list A, o:list A.
sort.split [] [] [] :- !.
sort.split [X] [X] [] :- !.
sort.split [X,Y|TL] [X|L1] [Y|L2] :- sort.split TL L1 L2.
pred sort.merge i:(A -> A -> prop), i:list A, i:list A, o:list A.
sort.merge _ [] L L :- !.
sort.merge _ L [] L :- !.
sort.merge Rel [X1|L1] [X2|L2] [X1|M] :- Rel X1 X2, !,
sort.merge Rel L1 [X2|L2] M.
sort.merge Rel [X1|L1] [X2|L2] [X2|M] :-
sort.merge Rel [X1|L1] L2 M.
pred sort i:list A, i:(A -> A -> prop), o:list A.
sort [] _ [] :- !.
sort [X] _ [X] :- !.
sort L Rel M :-
sort.split L L1 L2, sort L1 Rel S1, sort L2 Rel S2, sort.merge Rel S1 S2 M.
pred bubblesort i:list A, i:(A -> A -> prop), o:list A.
bubblesort [] _ [] :- !.
bubblesort [X] _ [X] :- !.
bubblesort [X,Y|TL] Rel [X|Rest1] :- Rel X Y, !, bubblesort [Y|TL] Rel Rest1.
bubblesort [X,Y|TL] Rel [Y|Rest1] :- bubblesort [X|TL] Rel Rest1.
% TODO: pred toposort i:(A -> A -> prop), i:list A, o:list A.
% pred edge? i:int, i:int.
% toposort edge? [1,2,3,4] TopoList
pred topovisit i: list (pair A A), i: A, i: list A, i: list A, o: list A, o: list A.
topovisit _ X VS PS VS PS :- std.mem PS X, !.
topovisit _ X VS _ _ _ :- std.mem VS X, !, halt "cycle detected.".
topovisit ES X VS PS VS' [X|PS'] :-
toporec ES {std.map {std.filter ES (e\ fst e X)} snd} [X|VS] PS VS' PS'.
pred toporec i: list (pair A A), i: list A, i: list A, i: list A, o: list A, o: list A.
toporec _ [] VS PS VS PS.
toporec ES [X|XS] VS PS VS'' PS'' :-
topovisit ES X VS PS VS' PS', toporec ES XS VS' PS' VS'' PS''.
pred toposort i: list (pair A A), i: list A, o: list A.
toposort ES XS XS'' :-
toporec ES XS [] [] _ XS',
std.filter XS' (std.mem XS) XS''.
pred time-do! i:list prop.
time-do! [].
time-do! [P|PS] :-
std.time P Time, !,
if (constant P C _) true (C = P),
coq.say Time ">>" C,
time-do! PS.
}
namespace compat {
% TODO: replace with std.map-filter when coq-elpi > 1.9.2
pred map-filter i:list A, i:(A -> B -> prop), o:list B.
map-filter [] _ [].
map-filter [X|XS] F [Y|YS] :- F X Y, !, map-filter XS F YS.
map-filter [_|XS] F YS :- map-filter XS F YS.
}
pred print-ctx.
print-ctx :- declare_constraint print-ctx [].
constraint print-ctx mixin-src {
rule \ (G ?- print-ctx) | (coq.say "The context is:" G).
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
pred coq.term-is-gref? i:term, o:gref.
coq.term-is-gref? (global GR) GR :- !.
coq.term-is-gref? (pglobal GR _) GR :- !.
coq.term-is-gref? (app [Hd|_]) GR :- !, coq.term-is-gref? Hd GR.
coq.term-is-gref? (let _ _ T x\x) GR :- !, coq.term-is-gref? T GR.
pred coq.prod-tgt->gref i:term, o:gref.
coq.prod-tgt->gref T GR :- whd1 T T1, !, coq.prod-tgt->gref T1 GR.
coq.prod-tgt->gref (prod N Src Tgt) GR :- !, @pi-decl N Src x\ coq.prod-tgt->gref (Tgt x) GR.
coq.prod-tgt->gref End GR :- coq.term->gref End GR.
% TODO: move to coq-elpi proper / move to coq.pp in coq-elpi >= 1.9
pred coq.indt-decl->string i:indt-decl, o:string.
coq.indt-decl->string (parameter ID _ Ty D) S :-
coq.id->name ID Name,
(@pi-decl Name Ty x\ coq.indt-decl->string (D x) S1),
S is "Parameter" ^ ID ^ " : " ^ {coq.term->string Ty} ^ "\n" ^ S1.
coq.indt-decl->string (inductive _ _ _ _) "NYI".
coq.indt-decl->string (record ID Ty KID RD) S :-
coq.record-decl->string RD S1,
S is ID ^ " : " ^ {coq.term->string Ty} ^ " := " ^ KID ^ " {\n" ^ S1 ^ "}".
pred coq.record-decl->string i:record-decl, o:string.
coq.record-decl->string end-record "".
coq.record-decl->string (field _ ID Ty D) S :-
coq.id->name ID Name,
(@pi-decl Name Ty x\ coq.record-decl->string (D x) S1),
S is " " ^ ID ^ " : " ^ {coq.term->string Ty} ^ ";\n" ^ S1.
pred coq.ground-indt-decl? i:indt-decl.
coq.ground-indt-decl? (parameter ID _ Ty D) :-
ground_term Ty,
coq.id->name ID Name, (@pi-decl Name Ty x\ coq.ground-indt-decl? (D x)).
coq.ground-indt-decl? (inductive _ _ _ _).
coq.ground-indt-decl? (record _ Ty _ RD) :-
ground_term Ty,
coq.ground-record-decl? RD.
pred coq.ground-record-decl? i:record-decl.
coq.ground-record-decl? end-record.
coq.ground-record-decl? (field _ ID Ty D) :-
ground_term Ty,
coq.id->name ID Name, (@pi-decl Name Ty x\ coq.ground-record-decl? (D x)).
% TODO: remove when coq-elpi > 1.9.3
pred copy-indt-decl i:indt-decl, o:indt-decl.
copy-indt-decl (parameter ID I Ty D) (parameter ID I Ty1 D1) :-
copy Ty Ty1,
@pi-parameter ID Ty1 x\ copy-indt-decl (D x) (D1 x).
copy-indt-decl (inductive ID CO A D) (inductive ID CO A1 D1) :-
copy-arity A A1,
coq.id->name ID N, coq.arity->term A1 T, @pi-decl N T i\ std.map (D i) copy-constructor (D1 i).
% @pi-inductive ID A1 i\ std.map (D i) copy-constructor (D1 i). % requires Coq-Elpi 1.9.x
copy-indt-decl (record ID T IDK F) (record ID T1 IDK F1) :-
copy T T1,
copy-fields F F1.
pred copy-fields i:record-decl, o:record-decl.
copy-fields end-record end-record.
copy-fields (field Att ID T F) (field Att ID T1 F1) :-
copy T T1,
@pi-parameter ID T1 x\ copy-fields (F x) (F1 x).
pred copy-constructor i:indc-decl, o:indc-decl.
copy-constructor (constructor ID A) (constructor ID A1) :- copy-arity A A1.
% TODO: move to coq-elpi proper
pred coq.gref.list->set i:list gref, o:coq.gref.set.
coq.gref.list->set L S :-
std.fold L {coq.gref.set.empty} coq.gref.set.add S.
% [coq.abstract-indt-decl Section I AbsI] abstracts I over the Section variables
% which becomes parameter nodes of the indt-decl type
pred coq.abstract-indt-decl i:list constant, i:indt-decl, o:indt-decl.
coq.abstract-indt-decl [] X X1 :- copy-indt-decl X X1.
coq.abstract-indt-decl [C|CS] X (parameter ID explicit Ty1 X1) :-
coq.gref->id (const C) ID,
coq.env.typeof (const C) Ty,
copy Ty Ty1,
@pi-parameter ID Ty x\
(copy (global (const C)) x :- !) =>
coq.abstract-indt-decl CS X (X1 x).
% [coq.abstract-const-decl Section I AbsI] abstracts I over the Section variables
% which becomes fun nodes
pred coq.abstract-const-decl i:list constant, i:pair term term, o:pair term term.
coq.abstract-const-decl [] (pr X Y) (pr X1 Y1) :- copy X X1, copy Y Y1.
coq.abstract-const-decl [C|CS] X (pr (fun Name Ty1 X1) (prod Name Ty1 X2)) :-
coq.gref->id (const C) ID,
coq.id->name ID Name,
coq.env.typeof (const C) Ty,
copy Ty Ty1,
@pi-parameter ID Ty x\
(copy (global (const C)) x :- !) =>
coq.abstract-const-decl CS X (pr (X1 x) (X2 x)).
% [coq.copy-clauses-for-unfold CS CL] generates clauses for the copy predicate
% to unfold all constants in CS
pred coq.copy-clauses-for-unfold i:list constant, o:list prop.
coq.copy-clauses-for-unfold [] [].
coq.copy-clauses-for-unfold [C|CS] [ClauseApp,Clause|L] :-
coq.env.const C (some B) _,
ClauseApp = (pi B1 Args Args1 B2 Args2 R\
copy (app[global (const C)|Args]) R :- !,
copy B B1,
std.map Args copy Args1,
hd-beta B1 Args1 B2 Args2,
unwind B2 Args2 R),
Clause = (pi B1\
copy (global (const C)) B1 :- !, copy B B1),
coq.copy-clauses-for-unfold CS L.
% like fold-map, needed for coq-elpi < 1.9
pred coq.fold-map i:term, i:A, o:term, o:A.
coq.fold-map X A Y A :- name X, !, X = Y, !. % avoid loading "coq.fold-map x A x A" at binders
coq.fold-map (global _ as C) A C A :- !.
coq.fold-map (sort _ as C) A C A :- !.
coq.fold-map (fun N T F) A (fun N T1 F1) A2 :- !,
coq.fold-map T A T1 A1, pi x\ coq.fold-map (F x) A1 (F1 x) A2.
coq.fold-map (let N T B F) A (let N T1 B1 F1) A3 :- !,
coq.fold-map T A T1 A1, coq.fold-map B A1 B1 A2, pi x\ coq.fold-map (F x) A2 (F1 x) A3.
coq.fold-map (prod N T F) A (prod N T1 F1) A2 :- !,
coq.fold-map T A T1 A1, (pi x\ coq.fold-map (F x) A1 (F1 x) A2).
coq.fold-map (app L) A (app L1) A1 :- !, std.fold-map L A coq.fold-map L1 A1.
coq.fold-map (fix N Rno Ty F) A (fix N Rno Ty1 F1) A2 :- !,
coq.fold-map Ty A Ty1 A1, pi x\ coq.fold-map (F x) A1 (F1 x) A2.
coq.fold-map (match T Rty B) A (match T1 Rty1 B1) A3 :- !,
coq.fold-map T A T1 A1, coq.fold-map Rty A1 Rty1 A2, std.fold-map B A2 coq.fold-map B1 A3.
coq.fold-map (primitive _ as C) A C A :- !.
coq.fold-map (uvar M L as X) A W A1 :- var X, !, std.fold-map L A coq.fold-map L1 A1, coq.mk-app-uvar M L1 W.
% when used in CHR rules
coq.fold-map (uvar X L) A (uvar X L1) A1 :- std.fold-map L A coq.fold-map L1 A1.
pred cs-pattern->term i:cs-pattern, o:term.
cs-pattern->term (cs-gref GR) T :- coq.env.global GR T.
cs-pattern->term (cs-sort prop) (sort prop).
cs-pattern->term (cs-sort sprop) (sort sprop).
cs-pattern->term (cs-sort _) T :- coq.elaborate-skeleton {{ Type }} _ T ok.
cs-pattern->term cs-prod T :- coq.elaborate-skeleton (prod `x` Ty_ x\ Bo_ x) _ T ok.
pred term->cs-pattern i:term, o:cs-pattern.
term->cs-pattern (prod _ _ _) cs-prod.
term->cs-pattern (sort U) (cs-sort U).
term->cs-pattern T (cs-gref GR) :- coq.term->gref T GR.
term->cs-pattern T _ :- coq.error T "HB database: is not a valid canonical key".
pred cs-pattern->name i:cs-pattern, o:string.
cs-pattern->name cs-prod "prod".
cs-pattern->name (cs-sort _) "sort".
cs-pattern->name cs-default "default".
cs-pattern->name (cs-gref GR) Name :- gref->modname-label GR 1 "_" Name.
% ---------------------------------------------------------------------
% kit for closing a term by abstracting evars with lambdas
% we use constraints to attach to holes a number
% and replace them by a special node, to later be bound
% via a lambda
namespace abstract-holes {
% we add a new constructor to terms to represent terms to be abstracted
type abs int -> term.
% bind back abstracted subterms
pred bind i:int, i:int, i:term, o:term.
bind I M T T1 :- M > I, !,
T1 = {{ fun x => lp:(B x) }},
N is I + 1,
pi x\ % we allocate the fresh symbol for (abs M)
(copy (abs N) x :- !) => % we schedule the replacement (abs M) -> x
bind N M T (B x).
bind M M T T1 :- copy T T1. % we perform all the replacements
% for a term with M holes, returns a term with M variables to fill these holes
% the clause see is only generated for a term if it hasn't been seen before
% the term might need to be typechecked first or main generates extra holes for the
% type of the parameters
pred main i:term, o:term.
main T1 T3 :- std.do! [
% we put (abs N) in place of each occurrence of the same hole
(pi T Ty N N' M \ fold-map T N (abs M) M :- var T, not (seen? T _), !, coq.typecheck T Ty ok, fold-map Ty N _ N', M is N' + 1, seen! T M) =>
(pi T N M \ fold-map T N (abs M) N :- var T, seen? T M, !) =>
fold-map T1 0 T2 M,
% we abstract M holes (M abs nodes)
bind 0 M T2 T3,
% cleanup constraint store
purge-seen!,
].
% all constraints are also on _ so that they share
% a variable with the constraint to purge the store
% we query if the hole was seen before, and if so
% we fetch its number
pred seen? i:term, o:int.
seen? X Y :- declare_constraint (seen? X Y) [X,_].
% we declare it is now seen and label it with a number
pred seen! i:term, i:int.
seen! X Y :- declare_constraint (seen! X Y) [X,_].
% to empty the store
pred purge-seen!.
purge-seen! :- declare_constraint purge-seen! [_].
constraint seen? seen! purge-seen! {
% a succesful query, give the label back via M
rule (seen! X N) \ (seen? X M) <=> (M = N).
% an unsuccesful query
rule \ (seen? X _) <=> false.
rule purge-seen! \ (seen! _ _).
rule \ purge-seen!.
}
} hierarchy-builder-1.7.0/HB/common/synthesis.elpi 0000664 0000000 0000000 00000032635 14547515630 0021631 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
% This file implements a simple form of "type inference" for arguments which
% are mixins and can be inferred looking at the \lambda Prolog context, in
% particular [mixins-src] context entries (the one of Coq looks at CS databases
% and such, which cannot be easily manipulated on the fly).
%
% If provides function to infer this kind of arguments and to declare a context
% made of mixins to be used for such inference. The idea is that one has
% a bunch of mixins at hand and does want to pass them down to other terms,
% without explictly saying exactly where they should be used.
namespace synthesis {
% [infer-all-these-mixin-args Ps T ML F X] fills in all the arguments of F
% which are misxins in ML, abstracts the others
pred infer-all-these-mixin-args i:list term, i:term, i:list mixinname, i:term, o:term.
infer-all-these-mixin-args Ps T ML F SFX :- std.do! [
std.assert-ok! (coq.typecheck F Ty) "try-infer-these-mixin-args: F illtyped",
coq.mk-eta (-1) Ty F EtaF,
coq.subst-fun {std.append Ps [T]} EtaF FT,
private.instantiate-all-these-mixin-args FT T ML SFX,
].
% [infer-all-gref-deps Ps T GR X] fills in all the arguments of GR
% which are misxins in gref-deps GR, other arguments are abstracted
pred infer-all-gref-deps i:list term, i:term, i:gref, o:term.
infer-all-gref-deps Ps T GR X :- std.do! [
std.assert! (gref-deps GR MLwP) "BUG: gref-deps should never fail",
list-w-params_list MLwP ML,
coq.env.typeof GR Ty,
coq.mk-eta (-1) Ty (global GR) EtaF,
coq.subst-fun {std.append Ps [T]} EtaF FT,
private.instantiate-all-these-mixin-args FT T ML Xraw,
infer-holes-depending-on-params T Xraw X,
].
% [infer-holes-depending-on-params TheType T NewT]
pred infer-holes-depending-on-params i:term, i:term, o:term.
infer-holes-depending-on-params T (app [global GR|Args]) (app [global GR|Args1]) :- !,
std.map Args (infer-holes-depending-on-pack T) Args1.
infer-holes-depending-on-params _ X X.
pred class-of-phant i:term, o:gref, o:gref, o:gref.
class-of-phant (prod N T F) X Y Z :- @pi-decl N T x\ class-of-phant (F x) X Y Z.
class-of-phant (global GR) Y Z X :- class-def (class X GR _), get-constructor X Y, get-constructor GR Z.
class-of-phant (app[global GR|_]) Y Z X :- class-def (class X GR _), get-constructor X Y, get-constructor GR Z.
pred infer-holes-depending-on-pack i:term, i:term, o:term.
infer-holes-depending-on-pack T (app [global GR | Args]) S :-
((coq.gref->id GR GRS, rex.match "phant.*" GRS /*TODO: phant-clone? GR N*/);
pack? GR _),
coq.env.typeof GR Ty, class-of-phant Ty KC SC C,
factory-nparams C N,
std.take N Args Params, !,
std.do! [
infer-all-args-let Params T KC ClassInstance ok,
std.rev [ClassInstance,T|{std.rev Params}] NewArgs,
S = app[global SC| NewArgs ]
].
infer-holes-depending-on-pack _ X X.
% [infer-all-args-let Ps T GR X Diagnostic] fills in all the Args in
% app[global GR, Ps, T | Args]
% and generates a term
% let `a1` ty1 t1 a1\ .... app[global GR, p1, .. pn, T, a1, .. , an]
% if Diagnostic is ok, else X is unassigned
pred infer-all-args-let i:list term, i:term, i:gref, o:term, o:diagnostic.
infer-all-args-let Ps T GR X Diag :- std.do! [
coq.env.typeof GR Ty,
coq.mk-eta (-1) Ty (global GR) EtaF,
coq.subst-fun {std.append Ps [T]} EtaF FT,
private.instantiate-all-args-let FT T X Diag,
].
% [assert!-infer-mixin TheType M Out] infers one mixin M on TheType and
% aborts with an error message if the mixin cannot be inferred
pred assert!-infer-mixin i:term, i:mixinname, o:term.
assert!-infer-mixin T M B :-
if (private.mixin-for T M B)
true
(coq.error "HB: cannot inhabit mixin"
{nice-gref->string M} "on"{coq.term->string T}).
% Given TheType it looks all canonical structure instances on it and makes
% all their mixins available for inference
pred under-local-canonical-mixins-of.do! i:term, i:list prop.
under-local-canonical-mixins-of.do! T P :- std.do! [
get-canonical-structures T CS,
std.map CS (private.structure-instance->mixin-srcs T) MSLL,
std.flatten MSLL MSL,
MSL => std.do! P
].
% Given TheType and a factory instance (on it), makes all the mixins provided by
% the factory available for inference.
pred under-mixin-src-from-factory.do! i:term, i:term, i:list prop.
under-mixin-src-from-factory.do! TheType TheFactory LP :- std.do! [
private.factory-instance->new-mixins [] TheFactory ML,
std.map ML (m\c\ c = mixin-src TheType m TheFactory) MLClauses,
MLClauses => std.do! LP
].
% Given TheType and a factory instance (on it), builds all the *new* mixins
% provided by the factory available for and passes them to the given
% continuation
pred under-new-mixin-src-from-factory.do! i:term, i:term, i:(list mixinname -> prop).
under-new-mixin-src-from-factory.do! TheType TheFactory LP :-
findall-mixin-src TheType OldMixins,
private.factory-instance->new-mixins OldMixins TheFactory NewML,
std.map NewML (m\c\ c = mixin-src TheType m TheFactory) NewMLClauses,
NewMLClauses => std.do! [ LP NewML ].
% [under-mixins.then MLwP Pred F] states that F has shape
% fun p_1 .. p_k T,
% (m_0 : M_0 ..p.. T) .. (m_n : M_n ..p.. T m_i0 .. m_ik) =>
% Body m_0 .. m_n
% where MLwP contains M_0, .., M_n (under p_1 .. p_k)
% and Body is such that [..,mixin-src T M_i m_i,..] => Pred Body
% and ..p.. is a list of terms built using p_1 .. p_k and T
pred under-mixins.then i:list (w-args mixinname),
i:(name -> term -> (term -> A) -> A -> prop),
i:(A -> prop), o:A.
under-mixins.then [] _ Pred Body :- !, Pred Body.
under-mixins.then [triple M Args T|ML] MkFun Pred Out :- std.do! [
infer-all-gref-deps Args T M MTy,
(@pi-decl `m` MTy m\ mixin-src T M m =>
under-mixins.then ML MkFun Pred (Body m)),
MkFun `m` MTy Body Out,
].
% [mixins-w-params.fun MLwP Pred F] states that F has shape
% fun p_1 .. p_k T,
% (m_0 : M_0 ..p.. T) .. (m_n : M_n ..p.. T m_i0 .. m_ik) =>
% Body m_0 .. m_n
% where MLwP contains M_0, .., M_n (under p_1 .. p_k)
% and Body is such that [..,mixin-src T M_i m_i,..] => Pred Body
% and ..p.. is a list of terms built using p_1 .. p_k and T
pred mixins-w-params.fun i:mixins, i:(list term -> term -> term -> prop), o:term.
mixins-w-params.fun L P Out :- !,
w-params.then L mk-fun mk-fun (p\ t\ ml\ under-mixins.then ml mk-fun (P p t)) Out.
% [mixins-w-params.length LwP N] states N is Nmixins+Nparams
pred mixins-w-params.length i:mixins, o:int.
mixins-w-params.length MLwP N :-
w-params.nparams MLwP Nparams,
std.length {list-w-params_list MLwP} Nmixins,
N is Nparams + Nmixins.
pred infer-coercion-tgt i:mixins, o:class.
infer-coercion-tgt (w-params.cons ID Ty F) CoeClass :-
@pi-parameter ID Ty x\ infer-coercion-tgt (F x) CoeClass.
infer-coercion-tgt (w-params.nil _ {{ Type }} _) sortclass.
infer-coercion-tgt (w-params.nil _ {{ _ -> _ }} _) funclass.
infer-coercion-tgt (w-params.nil _ T _) (grefclass GR) :- coq.term->gref T GR.
pred w-args.check-key i:list term, i:term, i:list (w-args A), o:prop.
w-args.check-key _PS _T [] true :- !.
w-args.check-key PS T [triple _ _ T|LwA] P :- !, w-args.check-key PS T LwA P.
w-args.check-key _PS _T _LwA false :- !, coq.error "HB: all mixins must have the same key".
pred list-w-params.check-key i:list-w-params A.
list-w-params.check-key MLwP :- !,
w-params.then MLwP ignore ignore w-args.check-key _.
/* ------------------------------------------------------------------------- */
/* ----------------------------- private code ------------------------------ */
/* ------------------------------------------------------------------------- */
namespace private {
% [mixin-for T M MI] synthesizes an instance of mixin M on type T using
% the databases [mixin-src] and [from]
pred mixin-for i:term, i:mixinname, o:term.
mixin-for T M MICompressed :- mixin-src T M Tm, !, std.do! [
%if-verbose (coq.say {header} "Trying to infer mixin for" M),
std.assert-ok! (coq.typecheck Tm Ty) "mixin-for: Tm illtyped",
%%%%% mterm %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
factory? Ty (triple Factory Params _),
if (M = Factory) (MI = Tm) (
private.builder->term Params T Factory M B,
coq.subst-fun [Tm] B MI
),
%if-verbose (coq.say {header} "Trying to compress mixin for" {coq.term->string MI}),
compress-coercion-paths MI MICompressed,
].
pred drop i:int, i:list A, o:list A.
drop 0 L L :- !.
drop N [_|XS] L :- !, N1 is N - 1, drop N1 XS L.
pred compress-copy o:term, o:term.
compress-copy (app [global (const C) | L]) R :-
sub-class C2 C3 C NparamsC,
drop NparamsC L [app [global (const C') | L']],
sub-class C1 C2 C' NparamsC',
drop NparamsC' L' L'',
sub-class C1 C3 C'' NparamsC'',
std.append {coq.mk-n-holes NparamsC''} L'' HL'',
CHL'' = app [global (const C'') | HL''],
coq.typecheck CHL'' _ ok, !,
compress-copy CHL'' R.
compress-copy (app L) (app L1) :- !, std.map L compress-copy L1.
compress-copy X X.
pred compress-coercion-paths i:term, o:term.
compress-coercion-paths MI MICompressed :-
if (get-option "compress_coercions" tt)
(compress-copy MI MICompressed)
(MI = MICompressed).
pred mixin-for_mixin-builder i:prop, o:term.
mixin-for_mixin-builder (mixin-for _ _ B) B.
% [builder->term Params TheType Src Tgt MF] finds a builder from Src to Tgt
% and fills in all the mixins required by the builder using mixin-src, obtaining
% a function (MF = Builder Params TheType InferredStuff : Src -> Tgt)
pred builder->term i:list term, i:term, i:factoryname, i:mixinname, o:term.
builder->term Ps T Src Tgt B :- !, std.do! [
from Src Tgt FGR,
F = global FGR,
gref-deps Src MLwP,
list-w-params_list MLwP ML,
infer-all-these-mixin-args Ps T ML F B,
].
% [instantiate-all-these-mixin-args T F M_i TFX] where mixin-for T M_i X_i states that
% if F ~ fun xs (m_0 : M_0 T) .. (m_n : M_n T ..) ys
% => F xs m_0 .. m_{i-1} m_i m_{i+1} .. m_n ys
% then TFX := fun xs m_0 .. m_{i-1} m_{i+1} .. m_n ys
% => F xs m_0 .. m_{i-1} X_i m_{i+1} .. m_n ys
% thus instanciating an abstraction on mixin M_i with X_i
pred instantiate-all-these-mixin-args i:term, i:term, i:list mixinname, o:term.
instantiate-all-these-mixin-args (fun _ Tm F) T ML R :-
coq.safe-dest-app Tm (global TmGR) _,
factory-alias->gref TmGR M,
std.mem! ML M,
!,
mixin-for T M X, !,
instantiate-all-these-mixin-args (F X) T ML R.
instantiate-all-these-mixin-args (fun N Ty F) T ML (fun N Ty FX) :- !,
@pi-decl N Ty m\ instantiate-all-these-mixin-args (F m) T ML (FX m).
instantiate-all-these-mixin-args F _ _ F.
pred instantiate-all-args-let i:term, i:term, o:term, o:diagnostic.
instantiate-all-args-let (fun N Tm F) T (let N Tm X R) Diag :- !, std.do! [
coq.safe-dest-app Tm (global TmGR) _,
factory-alias->gref TmGR M,
if (mixin-for T M X)
(@pi-def N Tm X m\ instantiate-all-args-let (F m) T (R m) Diag)
(Diag = error Msg,
Msg is "cannot synthesize mixin " ^ {nice-gref->string M} ^
" for " ^ {coq.term->string T}),
].
instantiate-all-args-let F _ F ok.
% [structure-instance->mixin-srcs TheType Structure] finds a CS instance for
% Structure on TheType (if any) and builds mixin-src clauses for all the mixins
% which can be candidates from that class instance. It finds instances which are
% concrete, that is not by projecting a rich type (a variable) to its class.
pred structure-instance->mixin-srcs i:term, i:structure, o:list prop.
structure-instance->mixin-srcs T S MSLC :- std.do! [
structure-key SortProj _ S,
class-def (class (indt Class) S CMLwP),
structure-nparams S NParams,
coq.mk-n-holes NParams Holes,
std.append Holes [ST] HolesST,
coq.mk-app (global (const SortProj)) HolesST SortHolesST,
% find an instance in ST
coq.unify-eq T SortHolesST ok,
% we look for an instance which is concrete, we take the parts
get-constructor S KS,
coq.mk-app (global KS) {std.append Holes [T, CT]} KSHolesC,
coq.unify-eq ST KSHolesC ok,
% if the class instance is concrete, we take the parts
get-constructor (indt Class) KC,
std.length {list-w-params_list CMLwP} CMixinsN,
coq.mk-n-holes CMixinsN MIL,
coq.mk-app (global KC) {std.append Holes [T | MIL]} CBody,
coq.unify-eq CT CBody ok,
% we finally generare micin-src clauses for all mixins
std.map MIL (structure-instance->mixin-srcs.aux T) MSLL,
std.flatten MSLL MSLC,
].
% this catch all sucks a bit, but is very relevant. Some instance, like
% unification hints (canonical coercions) which require a type which is too rich
% fail the second unif problem
structure-instance->mixin-srcs _ _ [].
structure-instance->mixin-srcs.aux2 Params T Class (some P) M :-
coq.mk-app (global (const P)) {std.append Params [T,Class]} M.
structure-instance->mixin-srcs.aux T F CL :-
factory-instance->new-mixins [] F ML,
std.map ML (m\c\ c = mixin-src T m F) CL.
% [factory-instance->new-mixins OldMixins FI MSL] find all the mixins
% which can be generated by the factory instance FI which are not part of
% OldMixins (that is, the contribution of FI to the current context)
pred factory-instance->new-mixins i:list mixinname, i:term, o:list mixinname.
factory-instance->new-mixins OldMixins X NewML :- std.do! [
std.assert-ok! (coq.typecheck X XTy) "mixin-src: X illtyped",
if (not (coq.safe-dest-app XTy (global _) _))
(coq.error "Term:\n" {coq.term->string X}
"\nhas type:\n" {coq.term->string XTy}
"\nwhich is not a record")
true,
coq.term->gref XTy Src,
factory-provides Src MLwP,
list-w-params_list MLwP ML,
std.filter ML (m\ not(std.mem! OldMixins m)) NewML,
].
}}
hierarchy-builder-1.7.0/HB/common/utils-synterp.elpi 0000664 0000000 0000000 00000004550 14547515630 0022435 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
% runs P in a context where Coq #[attributes] are parsed
pred with-attributes i:prop.
with-attributes P :-
attributes A,
coq.parse-attributes A [
att "verbose" bool,
att "mathcomp" bool,
att "mathcomp.axiom" string,
att "short.type" string,
att "short.pack" string,
att "key" string,
att "arg_sort" bool,
att "log" bool,
att "log.raw" bool,
att "compress_coercions" bool,
att "export" bool,
att "skip" string,
att "local" bool,
att "fail" bool,
att "doc" string,
att "primitive" bool,
att "non_forgetful_inheritance" bool,
att "hnf" bool,
] Opts, !,
Opts => (save-docstring, P).
pred if-verbose i:prop.
if-verbose P :- get-option "verbose" tt, !, P.
if-verbose _.
% header of if-verbose messages
pred header o:string.
header Msg :- Msg is "[" ^ {std.any->string {gettimeofday}} ^ "] HB: ".
% approximation, it should be logical path, not the file name
pred coq.env.current-library o:string.
coq.env.current-library L :- loc.fields {get-option "elpi.loc"} L _ _ _ _.
coq.env.current-library "dummy.v".
% this is only declared in hb.db, this declaration is only to avoid a warning
pred docstring o:loc, o:string.
pred save-docstring.
save-docstring :-
if (get-option "elpi.loc" Loc, get-option "elpi.phase" "interp", get-option "doc" Txt)
(coq.elpi.accumulate _ "hb.db" (clause _ _ (docstring Loc Txt)))
true.
pred compute-filter i:option string, o:list string.
compute-filter none [].
compute-filter (some S) MFilter :- % S is a component of the current modpath
coq.env.current-path P,
rex_split "\\." S L,
compute-filter.aux P L MFilter, !.
compute-filter (some S) MFilter :-
coq.locate-module S M,
coq.modpath->path M MFilter.
compute-filter.aux [S|_] [S] [S] :- !.
compute-filter.aux [S|XS] [S|SS] [S|YS] :- compute-filter.aux XS SS YS.
compute-filter.aux [X|XS] L [X|YS] :- compute-filter.aux XS L YS.
pred list-uniq i:list A, o:list A.
pred list-uniq.seen i:A.
list-uniq [] [].
list-uniq [X|XS] YS :- list-uniq.seen X, !, list-uniq XS YS.
list-uniq [X|XS] [X|YS] :- list-uniq.seen X => list-uniq XS YS.
pred record-decl->id i:indt-decl, o:id.
record-decl->id (parameter _ _ _ D) N :- pi p\ record-decl->id (D p) N.
record-decl->id (record N _ _ _) N.
hierarchy-builder-1.7.0/HB/common/utils.elpi 0000664 0000000 0000000 00000033432 14547515630 0020734 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
% This file contains some HB specific utilities
accumulate HB/common/utils-synterp.
shorten coq.{ term->gref, subst-fun, safe-dest-app, mk-app, mk-eta, subst-prod }.
pred if-arg-sort i:prop.
if-arg-sort P :- get-option "arg_sort" tt, !, P.
if-arg-sort _.
pred if-MC-compat i:(option gref -> prop).
if-MC-compat P :- get-option "mathcomp" tt, !, P none.
if-MC-compat P :- get-option "mathcomp.axiom" S, !,
std.assert! (coq.locate S GR) "The name passed to the mathcomp.axiom attribute does not exist",
P (some GR).
if-MC-compat _.
pred with-locality i:prop.
with-locality P :-
if (get-option "local" tt) (A = @local!) (A = @global!),
A => P.
pred acc-clause i:scope, i:prop.
acc-clause Scope C :- coq.elpi.accumulate Scope "hb.db" (clause _ _ C).
/* Uncomment and remove HB/common/compat_acc_clauses_*.elpi once requiring coq-elpi >= 1.18.0,
which implies Coq >= 8.17
pred acc-clauses i:scope, i:list prop.
acc-clauses Scope CL :- coq.elpi.accumulate-clauses Scope "hb.db" {std.map CL (c\r\ r = clause _ _ c)}.
*/
% TODO: Should this only be used for gref that are factories? (and check in the first/second branch so?)
% Should we make this an HO predicate, eg "located->gref S L is-factory? GR"
% TODO: rename since this is HB specific and is expected to return a factory
pred located->gref i:string, i:list located, o:gref.
located->gref _ [loc-gref GR|_] GR.
located->gref _ [loc-abbreviation Abbrev|_] GR :- phant-abbrev GR _ Abbrev, !.
located->gref S [loc-abbreviation _|_] _ :- coq.error S "is an abbreviation out of the control of HB".
located->gref S [loc-modpath _|_] _ :- coq.error S "should be a factory, but is a module".
located->gref S [loc-modtypath _|_] _ :- coq.error S "should be a factory, but is a module type".
located->gref S [] _ :- coq.error "Could not locate name" S.
% TODO: generalize/rename when we support parameters
pred argument->gref i:argument, o:gref.
argument->gref (str S) GR :- located->gref S {coq.locate-all S} GR.
argument->gref X _ :- coq.error "Argument" X "is expected to be a string".
pred argument->term i:argument, o:term.
argument->term (str S) (global GR) :- !, argument->gref (str S) GR.
argument->term (trm T) T1 :- !, std.assert-ok! (coq.elaborate-skeleton T _ T1) "not well typed term".
argument->term X _ :- coq.error "Argument" X " is expected to be a term or a string".
pred argument->ty i:argument, o:term.
argument->ty (str S) T1 :- !, argument->gref (str S) GR, std.assert-ok! (coq.elaborate-ty-skeleton (global GR) _ T1) "global reference is not a type".
argument->ty (trm T) T1 :- !, std.assert-ok! (coq.elaborate-ty-skeleton T _ T1) "not well typed type".
argument->ty X _ :- coq.error "Argument" X " is expected to be a type or a string".
pred builder->string i:builder, o:string.
builder->string (builder _ _ _ B) S :- coq.term->string (global B) S.
pred nice-gref->string i:gref, o:string.
nice-gref->string X Mod :-
coq.gref->path X Path,
std.rev Path [Mod1,Mod2|_], !,
Mod is Mod2 ^ "_" ^ Mod1.
nice-gref->string X S :-
coq.term->string (global X) S.
pred gref->modname i:gref, i:int, i:string, o:string.
gref->modname GR NComp Sep ModName :-
coq.gref->path GR Path,
std.rev Path Mods,
std.length Path Len,
if (Len >= NComp) true (coq.error "Not enough enclosing modules for" {coq.gref->string GR}),
std.take NComp Mods L,
std.string.concat Sep {std.rev L} ModName.
pred gref->modname-label i:gref, i:int, i:string, o:string.
gref->modname-label GR NComp Sep ModName :-
coq.gref->path GR Path,
std.rev Path PathRev,
std.length PathRev Len,
if (Len >= NComp) (N = NComp) (N = Len),
std.take N PathRev L,
std.string.concat Sep {std.rev [{coq.gref->id GR}|L]} ModName.
pred string->modpath i:string, o:modpath.
string->modpath S MP :-
std.filter {coq.locate-all S} (l\l = loc-modpath _) L,
L = [loc-modpath MP].
pred gref->modname_short1 i:modpath, i:string, i:list string, o:string.
gref->modname_short1 _ S [] S.
gref->modname_short1 MP "" [X|L] L' :- gref->modname_short1 MP X L L'.
gref->modname_short1 MP S _ S :- string->modpath S MP.
gref->modname_short1 MP S [X|L] S' :-
gref->modname_short1 MP {std.string.concat "." [X,S]} L S'.
% Print shortest qualified identifier of the module containing a gref
% Sep is used as separator
pred gref->modname_short i:gref, i:string, o:string.
gref->modname_short GR Sep IDS :-
coq.gref->path GR Path,
string->modpath {std.string.concat "." Path} MP,
gref->modname_short1 MP "" {std.rev Path} ID,
rex.replace "[.]" Sep ID IDS.
pred avoid-name-collision i:string, o:string.
avoid-name-collision S S1 :-
coq.locate-all S L,
if (std.mem L (loc-gref GR), coq.gref->path GR P, coq.env.current-path P)
(S1 is S ^ "__" ^ {std.any->string {new_int}})
(S1 is S).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function to predicate generic constructions %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
pred mk-nil o:list A.
mk-nil [].
pred mk0 i:A, o:A.
mk0 F R :- constant R F [].
pred mk1 i:(A -> B), i:A, o:B.
mk1 F X1 R :- constant R F [X1].
pred mk2 i:(A -> B -> C), i:A, i:B, o:C.
mk2 F X1 X2 R :- constant R F [X1, X2].
pred mk3 i:(A -> B -> C -> D), i:A, i:B, i:C, o:D.
mk3 F X1 X2 X3 R :- constant R F [X1, X2, X3].
pred mk4 i:(A -> B -> C -> D -> E), i:A, i:B, i:C, i:D, o:E.
mk4 F X1 X2 X3 X4 R :- constant R F [X1, X2, X3,X4].
pred mk-fun i:name, i:term, i:(term -> term), o:term.
mk-fun N Ty Body (fun N Ty Body).
% generic argument to pass to w-params
pred ignore i:name, i:term, i:(term -> A), o:A.
ignore _ _ F X :- (pi x y\ F x = F y), X = F (sort prop).
% combining body and type
pred mk-fun-prod i:name, i:term, o:(term -> pair term term), o:pair term term.
mk-fun-prod N Ty (x\ pr (Body x) (Type x)) (pr (fun N Ty Body) (prod N Ty Type)).
pred mk-parameter i:implicit_kind, i:name, i:term, i:(term -> indt-decl), o:indt-decl.
pred mk-parameter i:implicit_kind, i:name, i:term, i:(term -> arity), o:arity.
mk-parameter IK Name X F Decl :- !, Decl = parameter {coq.name->id Name} IK X F.
pred params->holes i:list-w-params A, o:list term.
params->holes (w-params.nil _ _ _) [].
params->holes (w-params.cons _ _ F) [_|PS] :- pi x\ params->holes (F x) PS.
pred fresh-type o:term.
fresh-type Ty :-
Ty = {{Type}},
std.assert-ok! (coq.typecheck-ty Ty _) "impossible".
%%%%%%%%%%%%%%%%%%%%%%
% w-params interface %
%%%%%%%%%%%%%%%%%%%%%%
pred apply-w-params i:w-params A, i:list term, i:term, o:A.
apply-w-params (w-params.cons _ _ PL) [P|PS] T R :- !, apply-w-params (PL P) PS T R.
apply-w-params (w-params.nil _ _ L) [] T R :- !, R = L T.
apply-w-params _ _ _ _ :- coq.error "apply-w-params".
pred w-params.nparams i:w-params A, o:int.
w-params.nparams (w-params.cons _ _ F) N :- pi x\ w-params.nparams (F x) M, N is M + 1.
w-params.nparams (w-params.nil _ _ _) 0.
% [w-params.fold AwP Cons Nil Out] states that Out has shape
% Cons `x_1` T_1 p_1 \ .. \ Nil [p_1 .. p_n] `T` Ty F
% where AwP = w-params.cons `x_1` T_1 p_1 \ ... \ w-params.nil `T` Ty F
pred w-params.fold i:w-params A, i:(name -> term -> (term -> B) -> B -> prop),
i:(list term -> name -> term -> (term -> A) -> B -> prop), o:B.
w-params.fold L Cons Nil Out :- w-params.fold.params L Cons Nil [] Out.
pred w-params.fold.params i:w-params A,
i:(name -> term -> (term -> B) -> B -> prop),
i:(list term -> name -> term -> (term -> A) -> B -> prop),
i:list term, % accumulator
o:B.
w-params.fold.params (w-params.cons ID PTy F) Cons Nil RevPs Out :- !, std.do! [
coq.id->name ID N,
(@pi-decl N PTy p\ w-params.fold.params (F p) Cons Nil [p|RevPs] (Body p)),
Cons N PTy Body Out].
w-params.fold.params (w-params.nil ID TTy F) _ Nil RevParams Out :- !, std.do! [
coq.id->name ID N,
std.rev RevParams Params,
Nil Params N TTy F Out,
].
% [w-params.then AwP Cons Nil Out] states that Out has shape
% Cons `x_1` T_1 p_1 \ .. \ Nil [p_1 .. p_n] `T` Ty t \ Body
% where Pred [p_1 .. p_n] T Body
% and AwP = w-params.cons `x_1` T_1 p_1 \ ... \ w-params.nil `T` Ty F
pred w-params.then i:w-params A,
i:(name -> term -> (term -> C) -> C -> prop),
i:(name -> term -> (term -> B) -> C -> prop),
i:(list term -> term -> A -> B -> prop),
o:C.
w-params.then L Cons Nil Pred Out :-
w-params.fold L Cons (ps\ n\ ty\ f\ out\ sigma Body\
(@pi-decl n ty t\ Pred ps t (f t) (Body t)),
Nil n ty Body out) Out.
pred w-params.map i:w-params A, i:(list term -> term -> A -> B -> prop), o:w-params B.
w-params.map AL F BL :-
w-params.then AL mk-w-params.cons-name mk-w-params.nil-name F BL.
% TODO: make combinators pass id
type mk-w-params.cons-name name -> term -> (term -> w-params A) -> w-params A -> prop.
mk-w-params.cons-name N T F (w-params.cons ID T F):- coq.name->id N ID.
type mk-w-params.nil-name name -> term -> (term -> A) -> w-params A -> prop.
mk-w-params.nil-name N T F (w-params.nil ID T F):- coq.name->id N ID.
% on the fly abstraction
pred bind-nil i:id, i:term, i:term, i:A, o:w-params A.
bind-nil N T X V (w-params.nil N T A) :- V = A X.
pred bind-cons i:id, i:term, i:term, i:w-params A, o:w-params A.
bind-cons N T X V (w-params.cons N T A) :- V = A X.
% Specific to list-w-params
pred list-w-params_list i:list-w-params A, o:list A.
list-w-params_list AwP R :- w-params.then AwP ignore ignore
(p\ t\ x\ std.map x triple_1) R.
pred list-w-params.append i:list-w-params A, i:list-w-params A, o:list-w-params A.
list-w-params.append (w-params.nil N T ML1) (w-params.nil N T ML2) (w-params.nil N T ML) :-
pi x\ std.append (ML1 x) (ML2 x) (ML x).
list-w-params.append (w-params.cons N Ty ML1) (w-params.cons N Ty ML2) (w-params.cons N Ty ML) :-
pi x\ list-w-params.append (ML1 x) (ML2 x) (ML x).
pred list-w-params.rcons i:list-w-params A, i:(list term -> term -> w-args A -> prop), o:list-w-params A.
list-w-params.rcons LwP F R :- list-w-params.rcons.aux LwP F [] R.
list-w-params.rcons.aux (w-params.nil N T ML1) F Acc (w-params.nil N T ML2) :-
pi x\ sigma Last\ F {std.rev Acc} x Last, std.append (ML1 x) [Last] (ML2 x).
list-w-params.rcons.aux (w-params.cons N Ty ML1) F Acc (w-params.cons N Ty ML2) :-
pi x\ list-w-params.rcons.aux (ML1 x) F [x|Acc] (ML2 x).
pred list-w-params.flatten-map
i:list-w-params A,
i:(A -> list-w-params B -> prop),
o:list-w-params B.
list-w-params.flatten-map (w-params.cons N T L) F (w-params.cons N T L1) :-
@pi-parameter N T p\
list-w-params.flatten-map (L p) F (L1 p).
list-w-params.flatten-map (w-params.nil N TTy L) F (w-params.nil N TTy L1) :-
@pi-parameter N TTy t\
list-w-params.flatten-map.aux (L t) F (L1 t).
pred list-w-params.flatten-map.aux
i:list (w-args A), i:(A -> list-w-params B -> prop), o:list (w-args B).
list-w-params.flatten-map.aux [] _ [].
list-w-params.flatten-map.aux [triple M Ps T|L] F Res1 :-
F M MwP,
apply-w-params MwP Ps T ML,
list-w-params.flatten-map.aux L F Res,
std.append ML Res Res1.
% [build-list-w-params TheParams TheType Factories ListWParams]
% Params is a list of pairs (section variable, its type).
% ListWParams has as many w-params.cons as TheParams and the terms
% in Factories are abstracted wrt the first component of TheParams.
pred build-list-w-params i:list (triple id term term), i:term, i:list (w-args A), o: list-w-params A.
build-list-w-params [triple ID P Pty|PS] TheType Factories (w-params.cons ID Pty1 R) :- std.do! [
copy Pty Pty1,
(@pi-parameter ID Pty1 p\ (copy P p :- !) => build-list-w-params PS TheType Factories (R p)),
].
build-list-w-params [] TheType Factories (w-params.nil Name TT1 R) :- std.do! [
std.assert-ok! (coq.typecheck TheType TT) "BUG: TheType does not typecheck",
copy TT TT1,
coq.gref->id {coq.term->gref TheType} Name,
(@pi-parameter Name TT1 t\
(copy TheType t :- !) =>
std.map Factories
(std.map-triple (=) (x\ std.map x (copy-pack-holes TheType t))
(copy-pack-holes TheType t)) (R t)),
].
pred copy-pack-holes i:term, i:term, i:term, o:term.
copy-pack-holes TheType NewType Term Out :- std.do! [
(pi Args NewArgs CSInstance ParamsRev ParamsRevCopy Pack \
(copy (app[global Pack | Args]) (app[global Pack | NewArgs]) :- pack? Pack _, !,
std.rev Args [CSInstance,TheType|ParamsRev],
std.map ParamsRev copy ParamsRevCopy,
std.rev [{{ lib:elpi.hole }},NewType|ParamsRevCopy] NewArgs)) =>
copy Term Out,
].
pred pack? i:gref, o:classname.
pack? (indc K) C :-
coq.env.indc K _ _ _ KTy, prod-last-gref KTy (indt I), % TODO: use new API
class-def (class C (indt I) _).
pred distribute-w-params i:list-w-params A, o:list (one-w-params A).
distribute-w-params (w-params.cons N T F) L :-
pi x\ distribute-w-params (F x) (L1 x), std.map (L1 x) (bind-cons N T x) L.
distribute-w-params (w-params.nil N T F) L :-
pi x\ std.map (F x) (bind-nil N T x) L.
% Specific to one-w-params
pred w-params_1 i:one-w-params A, o:A.
w-params_1 X Y :- w-params.then X ignore ignore (p\ t\ triple_1) Y.
pred disable-id-phant i:term, o:term.
disable-id-phant T T1 :-
(pi fresh fresh1 t v\ copy {{lib:@hb.id lp:t lp:v}} {{lib:@hb.id_disabled lp:t lp:fresh lp:v lp:fresh1}} :- !) =>
(pi fresh fresh1 t v\ copy {{lib:@hb.ignore lp:t lp:v}} {{lib:@hb.ignore_disabled lp:t lp:fresh lp:v lp:fresh1}} :- !) =>
copy T T1.
pred re-enable-id-phant i:term, o:term.
re-enable-id-phant T T1 :-
(pi f1 f2 t v\ copy {{lib:@hb.id_disabled lp:t lp:f1 lp:v lp:f2}} {{lib:@hb.id lp:t lp:v}} :- !) =>
(pi f1 f2 t v\ copy {{lib:@hb.ignore_disabled lp:t lp:f1 lp:v lp:f2}} {{lib:@hb.ignore lp:t lp:v}} :- !) =>
copy T T1.
pred prod-last i:term, o:term.
prod-last (prod N S X) Y :- !, @pi-decl N S x\ prod-last (X x) Y.
prod-last X X :- !.
pred prod-last-gref i:term, o:gref.
prod-last-gref (prod N S X) GR :- !, @pi-decl N S x\ prod-last-gref (X x) GR.
prod-last-gref X GR :- coq.term->gref X GR.
% saturate a type constructor with holes
pred saturate-type-constructor i:term, o:term .
saturate-type-constructor T ET :-
coq.typecheck T TH ok,
coq.count-prods TH N,
coq.mk-app T {coq.mk-n-holes N} ET.
hierarchy-builder-1.7.0/HB/context.elpi 0000664 0000000 0000000 00000007245 14547515630 0017773 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
namespace context {
pred declare i:factories, o:mixins, o:list term, o:term, o:list prop, o:list constant.
declare FLwP MLwP Params TheKey MSL CL :- !, std.do! [
factories-provide FLwP MLwPRaw,
declare.params-key MLwPRaw ParamsSection TheKey _MLwA,
std.map ParamsSection triple_2 Params,
declare.mixins TheKey ParamsSection MLwPRaw MLwP MSL CL
].
pred declare.params-key i:w-params A, o:list (triple id term term), o:term, o:A.
declare.params-key MLwP Params TheKey Out :- !, std.do! [
if-verbose (coq.say {header} "declaring parameters and key as section variables"),
declare.params MLwP Params KId KTy F,
log.coq.env.add-section-variable-noimplicits KId KTy C,
TheKey = global (const C),
Out = F TheKey
].
pred declare.params i:w-params A, o:list (triple id term term), o:id, o:term, o:(term -> A).
declare.params (w-params.cons PId PTy F) [triple PId P PTy|Params] KId KTy Out :- !, std.do! [
log.coq.env.add-section-variable-noimplicits PId PTy C,
P = global (const C),
declare.params (F P) Params KId KTy Out
].
declare.params (w-params.nil KId KTy F) [] KId KTy F :- !.
% [declare.mixins TheType Parameters Factories Clauses] postulates a
% (section) context with all the mixins provided by the factories and all
% the structure instances we can derive on TheType from these. Clauses
% contain mixin-src for each postulated mixin
pred declare.mixins i:term, i:list (triple id term term), i:mixins, o:mixins, o:list prop, o:list constant.
declare.mixins TheType TheParamsSection MLwPRaw MLwP MSL CL :- std.do! [
if-verbose (coq.say "Here is the list of mixins to declare (the order matters): "
{list-w-params_list MLwPRaw}),
std.map TheParamsSection triple_2 TheParams,
apply-w-params MLwPRaw TheParams TheType MLwAllArgsRaw,
std.fold MLwAllArgsRaw (triple [] [] []) (private.postulate-mixin TheType) (triple CL MSL MLwPRev),
acc-clauses current {std.map CL (cs\r\ r = local-canonical cs)},
std.rev MLwPRev MLwPSection,
build-list-w-params TheParamsSection TheType MLwPSection MLwP,
acc-clauses current MSL,
].
/* ------------------------------------------------------------------------- */
/* ----------------------------- private code ------------------------------ */
/* ------------------------------------------------------------------------- */
namespace private {
% Given a type T, a fresh number N, and a mixin M it postulates
% a variable "mN" inhabiting M applied to T and
% all its dependencies, previously postulated and associated
% to the corresponding mixin using mixin-for
pred postulate-mixin i:term, i:w-args mixinname, i:triple (list constant) (list prop) (list (w-args mixinname)),
o:triple (list constant) (list prop) (list (w-args mixinname)).
postulate-mixin TheType (triple M Ps T) (triple CL MSL MLwP) (triple OutCL [MC|MSL] [NewMwP|MLwP]) :- MSL => std.do! [
Name is "local_mixin_" ^ {gref->modname M 2 "_"},
if-verbose (coq.say "HB: postulate" Name "on" {coq.term->string T}),
synthesis.infer-all-gref-deps Ps T M TySkel,
% was synthesis.infer-all-mixin-args Ps T M TySkel,
% if-verbose (coq.say "HB: postulate-mixin checking" TySkel),
% std.assert-ok! (coq.typecheck Ty _) "postulate-mixin: Ty illtyped",
std.assert-ok! (coq.elaborate-ty-skeleton TySkel _ Ty)
"postulate-mixin: Ty illtyped",
log.coq.env.add-section-variable-noimplicits Name Ty C,
factory? Ty NewMwP,
MC = mixin-src T M (global (const C)),
MC => get-option "local" tt =>
instance.declare-all TheType {findall-classes-for [M]} NewCSL,
std.map NewCSL snd NewCL,
std.append CL NewCL OutCL
].
}}
hierarchy-builder-1.7.0/HB/export.elpi 0000664 0000000 0000000 00000007106 14547515630 0017624 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
pred export.any i:id.
export.any S :-
coq.locate-all S L,
if (L = []) (coq.error "HB: cannot locate" S) true,
if (L = [X]) (export.any.aux S X) (coq.error "HB:" S "is ambiguous:" L).
export.any.aux S (loc-gref GR) :- export.abbrev S GR.
export.any.aux S (loc-modpath MP) :- export.module S MP.
export.any.aux S X :- coq.error "HB:" S "denotes" X "which is not supported for exporting".
% [export.module Module] exports a Module now adds it to the collection of
% modules to export in the end of the current enclosing module,
% by the command HB.Exports
% CAVEAT: "module" is a keyword, we put it in the namespace by hand
pred export.module i:id, i:modpath.
export.module NiceModule Module :- !,
log.coq.env.export-module NiceModule Module,
coq.env.current-library File,
acc-clause current (module-to-export File NiceModule Module).
pred export.abbrev i:id, i:gref.
export.abbrev NiceName GR :- !,
coq.env.current-library File,
acc-clause current (abbrev-to-export File NiceName GR).
pred export.reexport-all-modules-and-CS i:option string.
export.reexport-all-modules-and-CS Filter :- std.do! [
coq.env.current-library File,
export.private.compute-filter Filter MFilter,
if-verbose (coq.say {header} "exporting under the module path" MFilter),
% NODE: std.list-uniq is for coq < 8.13
std.findall (module-to-export File NiceModule_ Module_) ModsCL,
std.filter {std.list-uniq ModsCL} (export.private.module-in-module MFilter) ModsCLFiltered,
std.map ModsCLFiltered module-to-export_module-nice NiceMods,
std.map ModsCLFiltered module-to-export_module Mods,
if-verbose (coq.say {header} "exporting modules" NiceMods),
std.forall2 NiceMods Mods log.coq.env.export-module,
std.findall (instance-to-export File NiceInstance_ Const_) InstCL,
std.filter {std.list-uniq InstCL} (export.private.instance-in-module MFilter) InstCLFiltered,
std.map InstCLFiltered instance-to-export_instance Insts,
if-verbose (coq.say {header} "exporting CS instances" Insts),
std.forall Insts log.coq.CS.declare-instance,
std.findall (abbrev-to-export File NiceAbbrev_ GR_) InstAbbL,
std.filter {std.list-uniq InstAbbL} (export.private.abbrev-in-module MFilter) InstAbbLFiltered,
std.map InstAbbLFiltered abbrev-to-export_name AbbNames,
std.map InstAbbLFiltered abbrev-to-export_body AbbBodies,
if-verbose (coq.say {header} "exporting Abbreviations" AbbNames),
std.forall2 AbbNames AbbBodies (n\b\@global! => log.coq.notation.add-abbreviation n 0 b ff _),
].
namespace export.private {
pred abbrev-in-module i:list string, i:prop.
abbrev-in-module PM (abbrev-to-export _ _ GR) :-
coq.gref->path GR PC,
std.appendR PM _ PC. % sublist
pred module-in-module i:list string, i:prop.
module-in-module PM (module-to-export _ _ M) :-
coq.modpath->path M PC,
std.appendR PM _ PC. % sublist
pred instance-in-module i:list string, i:prop.
instance-in-module PM (instance-to-export _ _ C) :-
coq.gref->path (const C) PC,
std.appendR PM _ PC. % sublist
pred compute-filter i:option string, o:list string.
compute-filter none [].
compute-filter (some S) MFilter :- % S is a component of the current modpath
coq.env.current-path P,
rex_split "\\." S L,
compute-filter.aux P L MFilter, !.
compute-filter (some S) MFilter :-
coq.locate-module S M,
coq.modpath->path M MFilter.
compute-filter.aux [S|_] [S] [S] :- !.
compute-filter.aux [S|XS] [S|SS] [S|YS] :- compute-filter.aux XS SS YS.
compute-filter.aux [X|XS] L [X|YS] :- compute-filter.aux XS L YS.
}
hierarchy-builder-1.7.0/HB/factory.elpi 0000664 0000000 0000000 00000043237 14547515630 0017757 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
namespace factory {
pred declare i:argument.
declare A :- private.declare-asset A private.asset-factory.
pred declare-mixin i:argument.
declare-mixin A :- private.declare-asset A private.asset-mixin.
kind factory-abbrev type.
type by-classname gref -> factory-abbrev.
type by-phantabbrev abbreviation -> factory-abbrev.
pred declare-abbrev i:id, i:factory-abbrev.
declare-abbrev Name (by-classname GR) :-
% looks fishy (the parameters are not taken into account)
@global! => log.coq.notation.add-abbreviation Name 1 (fun _ _ t\ app[global GR,t]) tt _.
declare-abbrev Name (by-phantabbrev Abbr) :- std.do! [
coq.notation.abbreviation-body Abbr Nargs AbbrTrm,
@global! => log.coq.notation.add-abbreviation Name Nargs AbbrTrm tt _,
].
pred argument->w-mixins i:argument, o:w-mixins argument.
argument->w-mixins (indt-decl Decl) (pr MLwP ArgwP) :- !, std.do! [
pdecl->w-mixins Decl (pr MLwP DeclwP),
w-params.map DeclwP (_\ _\ x\ y\ y = indt-decl x) ArgwP
].
argument->w-mixins (const-decl Id none Decl) (pr MLwP ArgwP) :- !, std.do! [
pdecl->w-mixins Decl (pr MLwP DeclwP),
w-params.map DeclwP (_\ _\ x\ y\ y = const-decl Id none x) ArgwP,
].
argument->w-mixins (const-decl Id (some Body) Decl as CDecl)
(pr MLwP ArgwP) :- !, std.do! [
if-verbose (coq.say {header} "arguments->w-mixins on const-decl Decl=" CDecl),
pdecl->w-mixins Decl (pr MLwP DeclwP),
if-verbose (coq.say {header} "arguments->w-mixins on const-decl Decl=" Decl
"\nwith MLwP =" MLwP),
std.length {list-w-params_list MLwP} NML,
if-verbose (coq.say "ML length =" NML),
w-params.map DeclwP (ps\ t\ x\ y\ sigma Dummies Args AppBody\ std.do! [
std.nlist NML (sort prop) Dummies,
std.append ps [t|Dummies] Args,
coq.subst-fun Args Body AppBody,
y = const-decl Id (some AppBody) x]) ArgwP
].
argument->w-mixins (ctx-decl Decl) (pr MLwP ArgwP) :- !, std.do! [
cdecl->w-mixins Decl (pr MLwP DeclwP),
w-params.map DeclwP (_\ _\ x\ y\ y = ctx-decl x) ArgwP
].
pred argument-name i:argument, o:string.
argument-name (const-decl Id _ _) Id :- !.
argument-name (indt-decl (parameter _ _ _ R)) Id :- !,
argument-name (indt-decl (R (sort prop))) Id.
argument-name (indt-decl (record Id _ _ _)) Id :- !.
argument-name (indt-decl (inductive Id _ _ _)) Id :- !.
argument-name (ctx-decl _) "_" :- !.
pred pdecl->w-mixins i:indt-decl, o:w-mixins indt-decl.
pred pdecl->w-mixins i:arity, o:w-mixins arity.
pdecl->w-mixins (parameter ID _ TySkel Rest as Decl) Out :-
private.is-key Decl, !,
private.key-decl-w-mixins "parameter"
ID TySkel Rest private.pdecl->w-mixins.mixins Out.
pdecl->w-mixins (parameter ID _ TySkel Rest) Out :- !,
private.param-decl-w-mixins "parameter"
ID TySkel Rest pdecl->w-mixins Out.
pdecl->w-mixins _ _ :- !,
coq.error "HB: declaration must have at least one parameter".
pred cdecl->w-mixins i:context-decl, o:w-mixins context-decl.
cdecl->w-mixins (context-item _ _ _ (some _) _) _ :- !,
coq.error "HB: local definition is not supported in this context".
cdecl->w-mixins (context-item ID _ TySkel none Rest as Decl) Out :-
private.is-key Decl, !,
private.key-decl-w-mixins "context-item"
ID TySkel Rest private.cdecl->w-mixins.mixins Out.
cdecl->w-mixins (context-item ID _ TySkel none Rest) Out :- !,
private.param-decl-w-mixins "context-item"
ID TySkel Rest cdecl->w-mixins Out.
cdecl->w-mixins _ _ :- !,
coq.error "HB: declaration must have at least one parameter".
/* ------------------------------------------------------------------------- */
/* ----------------------------- private code ------------------------------ */
/* ------------------------------------------------------------------------- */
namespace private {
shorten coq.{ term->gref, subst-fun, safe-dest-app, mk-app, mk-eta, subst-prod }.
% Type to share code between HB.mixin and HB.factory e(that supports alias factories)
kind asset type.
type asset-mixin asset.
type asset-factory asset.
pred is-key i:indt-decl.
pred is-key i:arity.
pred is-key i:context-decl.
is-key (parameter _ _ _ _\ record _ _ _ _) :- !.
is-key (parameter _ _ _ _\ inductive _ _ _ _) :- !.
is-key (parameter _ _ _ _\ arity _) :- !.
is-key (context-item _ _ _ _ _\ context-end) :- !.
is-key (parameter ID _ _ _) :- get-option "key" ID, !.
is-key (context-item ID _ _ _ _) :- get-option "key" ID, !.
is-key (parameter _ _ _ p\ parameter _ _ (M p) _) :-
pi p\ factory? (M p) _, !.
is-key (context-item _ _ _ _ p\ context-item _ _ (M p) _ _) :-
pi p\ factory? (M p) _, !.
pred mixin-decl-w-mixins i:string, i:string, i:term, i:(term -> A),
i:(A -> pair (list (w-args mixinname)) A -> prop),
o:pair (list (w-args mixinname)) A.
mixin-decl-w-mixins DeclKind ID TySkel Rest Conv Out :- std.do! [
if-verbose (coq.say {header} "processing mixin" DeclKind ID),
std.assert! (not (var TySkel)) "HB: no type provided for mixin",
disable-id-phant TySkel TySkelNoId,
std.assert-ok! (coq.elaborate-ty-skeleton TySkelNoId _ TyNoId)
"HB: mixin illtyped",
re-enable-id-phant TyNoId Ty,
std.assert! (factory? Ty (triple F Ps T))
"HB: Not a factory applied to the key variable",
std.assert! (pi x y\ Rest y = Rest x)
"HB: Factories cannot be explicitly mentioned in the subsequent declaration",
Dummy = sort prop, Conv (Rest Dummy) (pr MLwA R),
Out = pr [triple F Ps T|MLwA] R
].
pred key-decl-w-mixins i:string, i:string, i:term, i:(term -> A),
i:(A -> pair (list (w-args mixinname)) A -> prop),
o:pair mixins (w-params A).
key-decl-w-mixins DeclKind ID TySkel Rest Conv Out :- std.do! [
if-verbose (coq.say {header} "processing key" DeclKind),
std.assert-ok! (coq.elaborate-ty-skeleton TySkel _ Ty) "key illtyped",
coq.string->name ID N, @pi-decl N Ty t\ Conv (Rest t) (pr (MLwA t) (R t)),
if (var Ty) (fresh-type Ty) true,
Out = pr (w-params.nil ID Ty MLwA) (w-params.nil ID Ty R)
].
pred param-decl-w-mixins i:string, i:string, i:term, i:(term -> A),
i:(A -> pair mixins (w-params A) -> prop), o:pair mixins (w-params A).
param-decl-w-mixins DeclKind ID TySkel Rest Conv Out :- std.do! [
if-verbose (coq.say {header} "processing param" DeclKind),
std.assert-ok! (coq.elaborate-ty-skeleton TySkel _ Ty) "param illtyped",
coq.string->name ID N, @pi-decl N Ty p\ Conv (Rest p) (pr (MLwP p) (R p)),
if (var Ty) (fresh-type Ty) true,
Out = pr (w-params.cons ID Ty MLwP) (w-params.cons ID Ty R)
].
pred pdecl->w-mixins.mixins i:indt-decl,
o:pair (list (w-args mixinname)) indt-decl.
pred pdecl->w-mixins.mixins i:arity,
o:pair (list (w-args mixinname)) arity.
pdecl->w-mixins.mixins (parameter ID _ TySkel Rest) Out :- !,
mixin-decl-w-mixins "parameter" ID TySkel Rest pdecl->w-mixins.mixins Out.
pdecl->w-mixins.mixins R (pr [] R) :- !.
pred cdecl->w-mixins.mixins i:context-decl,
o:pair (list (w-args mixinname)) context-decl.
cdecl->w-mixins.mixins context-end (pr [] context-end) :- !.
cdecl->w-mixins.mixins (context-item _ _ _ (some _) _) _ :- !,
coq.error "HB: local definition is not supported in this context".
cdecl->w-mixins.mixins (context-item ID _ TySkel none Rest) Out :- !,
mixin-decl-w-mixins "parameter" ID TySkel Rest cdecl->w-mixins.mixins Out.
% The identity builder
pred declare-id-builder i:factoryname, o:prop.
declare-id-builder GR (from GR GR (const C)) :- std.do! [
gref-deps GR GRD,
synthesis.mixins-w-params.fun GRD (declare-id-builder.aux GR) IDBodySkel,
std.assert-ok! (coq.elaborate-skeleton IDBodySkel IDType IDBody) "identity builder illtyped",
log.coq.env.add-const-noimplicits "identity_builder" IDBody IDType @transparent! C,
].
declare-id-builder.aux GR Params TheType (fun `x` Ty x\x) :-
synthesis.infer-all-gref-deps Params TheType GR Ty.
% [mk-factory-abbrev Str GR CL FactAbbrev]
% creates an abbreviation for GR names Str and creates a phant-abbrev clause in CL.
% FactAbbrev is the short name for the factory (either an alias of the class record)
pred mk-factory-abbrev i:string, i:gref, o:list prop, o:factory-abbrev.
mk-factory-abbrev Str GR Aliases FactAbbrev :- !, std.do! [
if (factory-alias->gref GR _)
(Aliases = [],
FactAbbrev = by-classname GR)
(phant.of-gref ff GR [] PhTerm,
phant.add-abbreviation Str PhTerm PhC Abbrv,
Aliases = [phant-abbrev GR (const PhC) Abbrv],
FactAbbrev = by-phantabbrev Abbrv),
].
% [declare-asset Asset AssetKind] unifies the code paths for
% mixins, factories (and alias factories)
pred declare-asset i:argument, i:asset.
declare-asset Arg AssetKind :- std.do! [
argument-name Arg Module,
if-verbose (coq.say {header} "start module and section" Module),
log.coq.env.begin-module Module none,
log.coq.env.begin-section Module,
if-verbose (coq.say {header} "converting arguments" Arg "to factories"),
argument->w-mixins Arg (pr FLwP ArgwP),
if-verbose (coq.say {header} "converting factories" FLwP "to mixins"),
%%% factories-provide FLwP MLwP,
if-verbose (coq.say {header} "declaring context" FLwP),
context.declare FLwP MLwP Params TheKey MixinSrcClauses SectionCanonicalInstance,
if (Arg = indt-decl _) (
apply-w-params ArgwP Params TheKey (indt-decl (record _ Sort _ Fields)),
if-verbose (coq.say {header} "declare mixin or factory"),
declare-mixin-or-factory MixinSrcClauses SectionCanonicalInstance
Params TheKey Sort Fields MLwP Module AssetKind
) (
apply-w-params ArgwP Params TheKey (const-decl _ (some Sort) _),
if-verbose (coq.say {header} "declare factory alias"),
declare-factory-alias MixinSrcClauses SectionCanonicalInstance
Params TheKey Sort MLwP Module
)
].
pred declare-mixin-or-factory i:list prop, i:list constant, i:list term, i:term,
i:term, i:record-decl, i:list-w-params factoryname, i:id, i:asset.
declare-mixin-or-factory MixinSrcClauses SectionCanonicalInstance
TheParams TheType Sort1 Fields GRFSwP Module D :- std.do! [
if-verbose (coq.say {header} "declare record axioms_"),
Kname = "Axioms_",
RDeclSkel = record "axioms_" Sort1 Kname Fields,
std.assert-ok! (coq.elaborate-indt-decl-skeleton RDeclSkel RDecl) "record declaration illtyped",
abstract-over-section TheParams TheType MixinSrcClauses SectionCanonicalInstance coq.abstract-indt-decl RDecl RDeclClosed _,
if (get-option "primitive" tt)
(@primitive! => log.coq.env.add-indt RDeclClosed R)
(log.coq.env.add-indt RDeclClosed R),
log.coq.env.end-section-name Module, % We need to anyway declare the record inside the section
% since closing the section purges the unused universe level we may have
% allocated by typechecking the skeleton just above
coq.env.indt R tt _ _ _ [K] _,
GRK = indc K,
@global! => log.coq.arguments.set-implicit (indt R) [[]],
@global! => log.coq.arguments.set-implicit GRK [[]],
factories-provide GRFSwP MLwP,
w-params.nparams MLwP NParams,
build-deps-for-projections R MLwP GRDepsClausesProjs,
GRDepsClauses = [gref-deps (indt R) MLwP, gref-deps (indc K) MLwP|GRDepsClausesProjs],
% GRDepsClauses => mk-factory-sort MLwP (indt R) _ FactorySortCoe,
% FactorySortCoe = coercion GRFSort _ _ _,
% TODO: should this be in the Exports module?
if-verbose (coq.say {header} "declare notation Build"),
GRDepsClauses => phant.of-gref ff GRK [] PhGRK,
GRDepsClauses => phant.add-abbreviation "Build" PhGRK BuildConst BuildAbbrev,
if-verbose (coq.say {header} "declare notation axioms"),
if (D = asset-mixin)
(GRDepsClauses => mk-factory-abbrev "axioms" (indt R) FRClauses FactAbbrev,
GRDepsClauses => FRClauses => declare-id-builder (indt R) IdBuilderClause,
Clauses = [IdBuilderClause|FRClauses])
(GRDepsClauses => mk-factory-abbrev "axioms" (indt R) Clauses FactAbbrev),
if-verbose (coq.say {header} "start module Exports"),
log.coq.env.begin-module "Exports" none,
std.flatten [Clauses, GRDepsClauses, [
factory-constructor (indt R) GRK,
factory-nparams (indt R) NParams,
factory-builder-nparams BuildConst NParams,
phant-abbrev GRK (const BuildConst) BuildAbbrev,
% gref-deps GRFSort MLwP,
% factory-sort FactorySortCoe,
]] NewClauses,
acc-clauses current NewClauses,
list-w-params_list MLwP MLwoP,
std.map MLwoP (_\ r\ r = maximal) Implicits,
/* std.map {list-w-params_list MLwP} (_\ r\ r = maximal) Implicits, */
@global! => log.coq.arguments.set-implicit GRK [[maximal|Implicits]],
% @global! => log.coq.coercion.declare FactorySortCoe,
% NewClauses => instance.declare-factory-sort-deps (indt R),
log.coq.env.end-module-name "Exports" Exports,
log.coq.env.end-module-name Module _,
if-verbose (coq.say {header} "end modules and sections; export" Exports),
export.module {calc (Module ^ ".Exports")} Exports,
GRDepsClauses => declare-abbrev Module FactAbbrev,
].
pred declare-factory-alias i:list prop, i:list constant, i:list term, i:term,
i:term, i:list-w-params factoryname, i:id.
declare-factory-alias MixinSrcClauses SectionCanonicalInstance
TheParams TheType Ty1Skel GRFSwP Module :- std.do! [
if-verbose (coq.say {header} "declare constant axioms_"),
std.assert-ok! (coq.elaborate-ty-skeleton Ty1Skel _ Ty1) "Illtyped alias factory",
abstract-over-section TheParams TheType MixinSrcClauses SectionCanonicalInstance coq.abstract-const-decl (pr Ty1 _) (pr Ty1Closed _) Section,
log.coq.env.add-const-noimplicits "axioms_" Ty1Closed _ @transparent! C,
std.assert! (safe-dest-app Ty1 (global PhF) _Args) "Argument must be a factory",
std.assert! (factory-alias->gref PhF F) "BUG: Factory alias declaration missing",
std.assert! (factory-constructor F FK) "BUG: Factory constructor missing",
MixinSrcClauses => synthesis.infer-all-gref-deps TheParams TheType FK MFK,
std.assert-ok! (coq.typecheck MFK MFKTy) "BUG: typecking of former factory constructor failed",
(pi Args\ copy (app[global F|Args]) (app[global (const C)|Section])) => copy MFKTy MFKTyC,
abstract-over-section TheParams TheType MixinSrcClauses SectionCanonicalInstance coq.abstract-const-decl (pr MFK MFKTyC) (pr MFKClosed MFKTyCClosed) _,
log.coq.env.add-const-noimplicits "Axioms_" MFKClosed MFKTyCClosed @transparent! CK,
GRK = const CK,
log.coq.env.end-section-name Module,
@global! => log.coq.arguments.set-implicit GRK [[]],
factories-provide GRFSwP MLwP,
GRDepsClauses = [gref-deps (const C) MLwP, gref-deps (const CK) MLwP],
GRDepsClauses => phant.of-gref ff GRK [] PhGRK0,
% GRDepsClauses => mk-factory-sort MLwP (const C) _ FactorySortCoe,
% FactorySortCoe = coercion GRFSort _ _ _,
if (mixin-first-class F _) (PhGRK = PhGRK0)
(phant.append-fun-unify PhGRK0 PhGRK),
GRDepsClauses => phant.add-abbreviation "Build" PhGRK BuildConst _,
GRDepsClauses => mk-factory-abbrev "axioms" (const C) Clauses FactAbbrev,
if-verbose (coq.say {header} "start module Exports"),
log.coq.env.begin-module "Exports" none,
w-params.nparams MLwP NParams,
std.flatten [ Clauses, GRDepsClauses,
[ factory-nparams (const C) NParams,
factory-constructor (const C) GRK,
factory-builder-nparams BuildConst NParams,
% gref-deps GRFSort MLwP,
% factory-sort FactorySortCoe
]
] NewClauses,
acc-clauses current NewClauses,
%@global! => log.coq.coercion.declare FactorySortCoe,
% NewClauses => instance.declare-factory-sort-deps (const C),
log.coq.env.end-module-name "Exports" Exports,
log.coq.env.end-module-name Module _,
if-verbose (coq.say {header} "end modules and sections; export" Exports),
export.module {calc (Module ^ ".Exports")} Exports,
GRDepsClauses => declare-abbrev Module FactAbbrev,
].
% [build-deps-for-projections I ML CL] builds a [gref-dep] for each projection P
% of I such that P depends on "ML @ [I]" (each operation depends on the the
% deps of the record plus the record itself)
pred build-deps-for-projections i:inductive, i:mixins, o:list prop.
build-deps-for-projections R MLwP CL :- std.do! [
compat.map-filter {coq.env.projections R} (x\y\x = some y) MixinOps,
list-w-params.rcons MLwP (pl\t\r\ r = triple (indt R) pl t) MLRwP,
std.map MixinOps (gr\r\ r = gref-deps (const gr) MLRwP) CL,
].
% Section handling in Coq is smart, in the sense it it only abstracts over
% variables that aoccur. We don't want that for mixin/factories, so we implement
% our own discharging. Note that definitions (like canonical instance) have
% to be abstracted too.
pred abstract-over-section i:list term, i:term, i:list prop, i:list constant, i:(list constant -> A -> A -> prop), i:A, o:A, o:list term.
abstract-over-section TheParams TheType MixinSrcClauses SectionCanonicalInstance F X X1 Section :-
% compute section variables to be used for discharging
std.map MixinSrcClauses mixin-src_src Mixins,
std.append TheParams [TheType|{std.rev Mixins}] Section,
std.map Section (x\r\ x = global (const r)) SectionVars,
% We discharge by hand the record declaration so that we can be sure all
% parameters and mixins are abstracted (even if unused).
coq.copy-clauses-for-unfold SectionCanonicalInstance CopyUnfold,
CopyUnfold => F SectionVars X X1.
pred mk-factory-sort i:mixins, i:gref, o:gref, o:coercion.
mk-factory-sort MLwP GR (const FactorySortCst) Coe :-
if-verbose (coq.say {header} "declaring tagged sort for GR=" GR),
synthesis.mixins-w-params.fun MLwP (mk-factory-sort.term GR) FactorySort,
std.assert-ok! (coq.typecheck FactorySort FactorySortTy) "HB: cannot elaborate sort",
log.coq.env.add-const-noimplicits "sort" FactorySort FactorySortTy ff FactorySortCst,
synthesis.mixins-w-params.length MLwP MLwPLength,
std.nlist {calc (MLwPLength + 1)} implicit MLwPImplicits,
@global! => log.coq.arguments.set-implicit (const FactorySortCst) [MLwPImplicits],
synthesis.infer-coercion-tgt MLwP CoeClass,
Coe = coercion (const FactorySortCst) MLwPLength GR CoeClass.
pred mk-factory-sort.term i:gref, i:list term, i:term, o:term.
mk-factory-sort.term GR P T (fun `_` Ty _\ T) :- synthesis.infer-all-gref-deps P T GR Ty.
}} hierarchy-builder-1.7.0/HB/graph.elpi 0000664 0000000 0000000 00000001672 14547515630 0017406 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
namespace graph {
pred to-file i:string.
to-file File :- !, std.do! [
open_out File OC,
output OC "digraph Hierarchy { ",
std.forall {coq.coercion.db} (private.pp-coercion-dot OC),
output OC "}",
close_out OC,
].
/* ------------------------------------------------------------------------- */
/* ----------------------------- private code ------------------------------ */
/* ------------------------------------------------------------------------- */
namespace private {
pred pp-coercion-dot i:out_stream, i:coercion.
pp-coercion-dot OC (coercion _ _ Src (grefclass Tgt)) :- class-def (class Src _ _), class-def (class Tgt _ _), !, std.do! [
output OC {gref->modname_short Tgt "_"},
output OC " -> ",
output OC {gref->modname_short Src "_"},
output OC ";\n",
].
pp-coercion-dot _ _.
}} hierarchy-builder-1.7.0/HB/howto.elpi 0000664 0000000 0000000 00000014524 14547515630 0017445 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
namespace howto {
pred main-trm i:term, i:string, i:option int.
main-trm T STgt Depth :- coq.term->gref T GR, main-gref GR STgt Depth.
pred main-str i:string, i:string, i:option int.
main-str S STgt Depth :- coq.locate S GR, main-gref GR STgt Depth.
pred main-gref i:gref, i:string, i:option int.
main-gref GR STgt Depth :- class-def (class _ GR _), !,
private.mixins-in-structures [GR] MLSrc,
main-from MLSrc STgt Depth.
main-gref GR STgt Depth :-
private.structures-on-gref GR SL,
private.mixins-in-structures SL MLSrc,
main-from MLSrc STgt Depth.
pred main-from i:list mixinname, i:string, i:option int.
main-from MLSrc STgt Depth :-
private.mixins-in-structures [{coq.locate STgt}] MLTgt,
private.list-diff MLTgt MLSrc ML,
if (ML = []) (coq.say "HB: nothing to do.") (main-from.aux MLSrc ML Depth).
main-from.aux MLSrc ML (some Depth) :- main-increase-depth MLSrc ML Depth false.
main-from.aux MLSrc ML none :- main-increase-depth MLSrc ML 3 true.
pred main-increase-depth i:list mixinname, i:list mixinname, i:int, i:prop.
main-increase-depth MLSrc ML Depth AutoIncrease :-
private.paths-from-for-step MLSrc ML Depth R,
if (not (R = [])) (private.pp-solutions R)
(if AutoIncrease
(Depth' is Depth + 1,
coq.say "HB: no solution found at depth" Depth "looking at depth" Depth',
main-increase-depth MLSrc ML Depth' true)
(coq.error "HB: no solution found, try to increase search depth.")).
/* ------------------------------------------------------------------------- */
/* ----------------------------- private code ------------------------------ */
/* ------------------------------------------------------------------------- */
namespace private {
shorten coq.pp.{ v , hov , spc , str , box , glue }.
% L1 \subseteq L2
pred incl i:list A, i:list A.
incl L1 L2 :- std.forall L1 (std.mem L2).
% R = L1 \ L2
pred list-diff i:list A, i:list A, o:list A.
list-diff L1 L2 R :- std.filter L1 (about.not1 (std.mem L2)) R.
% R = L1 U L2
pred union i:list A, i:list A, o:list A.
union L1 L2 R :-
std.fold L2 L1 (x\l\l'\if (std.mem l x) (l' = l) (l' = [x|l])) R.
pred insert-sorted i:(A -> A -> prop), i:A, i:list A, o:list A.
insert-sorted _ X [] [X] :- !.
insert-sorted Rel X [Y|T] [X,Y|T] :- Rel X Y, !.
insert-sorted Rel X [Y|T] [Y|T'] :- insert-sorted Rel X T T', !.
pred lt-gref i:gref, i:gref.
lt-gref X Y :-
gref->modname_short X "." SX, gref->modname_short Y "." SY, !, SX s< SY.
pred size-order i:(list A -> list A -> prop), i:list A, i:list A.
size-order Rel L1 L2 :-
std.length L1 S1, std.length L2 S2, !, (S1 i< S2; (S1 = S2, !, Rel L1 L2)).
pred lexi-order i:list gref, i:list gref.
lexi-order [] [].
lexi-order [X1|_] [X2|_] :- lt-gref X1 X2.
lexi-order [X|T1] [X|T2] :- lexi-order T1 T2.
% [structures-on-gref GR ML] list structures [GR] is equipped with
pred structures-on-gref i:gref, o:list structure.
structures-on-gref GR SL :-
std.filter {coq.CS.db-for _ (cs-gref GR)} (about.not1 about.unif-hint?) LV,
std.map LV structures-on-gref.aux SL.
structures-on-gref.aux (cs-instance _ _ GR) F :-
coq.prod-tgt->gref {coq.env.typeof GR} F, class-def (class _ F _).
% [mixins-in-structures SL ML] list mixins in structures [SL]
pred mixins-in-structures i:list structure, o:list mixinname.
mixins-in-structures SL ML :- std.fold SL [] mixins-in-structures.aux ML.
mixins-in-structures.aux F L L' :-
class-def (class _ F MLWP), union L {list-w-params_list MLWP} L'.
% a type to store a factory along with the mixins it depends on
% and the mixins it provides
kind factory_deps_prov type.
type fdp factoryname -> list mixinname -> list mixinname -> factory_deps_prov.
% get all available factories in the above type
pred list_factories o:list factory_deps_prov.
list_factories FL :-
std.map-filter {std.findall (factory-constructor _ _)} list_factories.aux FL.
list_factories.aux (factory-constructor F _) (fdp F DML PML) :-
gref-deps F FD,
list-w-params_list FD DML,
list-w-params_list {factory-provides F} PML.
% [paths-from-for-step MLSrc ML K R] returns in [R] a list of sequences
% of at most [K] factories that could, starting from mixins [MLSrc],
% build exactly the mixins [ML]
pred paths-from-for-step i:list mixinname, i:list mixinname, i:int,
o:list (list factoryname).
paths-from-for-step MLSrc ML K R :-
std.filter {list_factories} (fd\sigma pml\fd = fdp _ _ pml, incl pml ML) FL,
paths-from-for-step-using MLSrc ML K [] [] FL _ R.
% [paths-from-for-step-using MLSrc ML K Pre KnownPre FL KnownPre' R]
% same as [paths-from-for-step MLSrc ML K R] using only factories in [FL]
% [Pre] is a (sorted) prefix that is looked into the list of known (sorted)
% prefixes [KnownPre] to avoid generating identical solutions up to permutations
pred paths-from-for-step-using i:list mixinname, i:list mixinname, i:int,
i:list factoryname, i:list (list factoryname), i:list factory_deps_prov,
o:list (list factoryname), o:list (list factoryname).
paths-from-for-step-using _ _ K _ KnownPre _ KnownPre [] :- K i< 0.
paths-from-for-step-using _ _ _ Pre KnownPre _ KnownPre [] :-
std.mem KnownPre Pre, !.
paths-from-for-step-using _ [] _ Pre KnownPre _ [Pre|KnownPre] [[]] :- !.
paths-from-for-step-using MLSrc ML K Pre KnownPre FL [Pre|KnownPre'] R :-
K' is K - 1,
std.filter FL (p\sigma dml\p = fdp _ dml _, incl dml MLSrc) FLdep,
std.fold FLdep (pr KnownPre [])
(paths-from-for-step-using.aux MLSrc ML FL K' Pre)
(pr KnownPre' R).
paths-from-for-step-using.aux MLSrc ML FL' K' Pre (fdp F _ MLF) (pr KnPre L)
(pr KnPre' R) :-
std.append MLSrc MLF MLSrc',
list-diff ML MLF ML',
insert-sorted lt-gref F Pre Pre',
std.filter FL' (p\sigma pml\p = fdp _ _ pml, incl pml ML') FML',
paths-from-for-step-using MLSrc' ML' K' Pre' KnPre FML' KnPre' R',
std.map R' (l\r\r = [F|l]) R'',
std.append L R'' R.
pred pp-solutions i:list (list factoryname).
pp-solutions LLF :-
std.sort LLF (size-order lexi-order) SLLF,
% format
PpSolutions = box (v 4) [
str "HB: solutions (use 'HB.about F.Build' to see the arguments of each factory F):",
{about.bulletize SLLF pp-solution}],
% print
coq.say {coq.pp->string PpSolutions},
coq.say.
pred pp-solution i:list factoryname, o:coq.pp.
pp-solution L (box (hov 0) PLS) :-
std.map L about.pp-module PL,
std.intersperse (glue [str ";", spc]) PL PLS.
}} hierarchy-builder-1.7.0/HB/instance.elpi 0000664 0000000 0000000 00000044203 14547515630 0020106 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
namespace instance {
% [declare-existing T F] equips T with all the canonical structures that can be
% built using factory instance F
pred declare-existing i:argument, i:argument.
declare-existing T0 F0 :- std.do! [
argument->ty T0 T, % TODO: change this when supporting morphism hierarchies
argument->term F0 F,
std.assert-ok! (coq.typecheck F FTy)
"HB: declare-existing illtyped factory instance",
std.assert! (coq.safe-dest-app FTy (global FactoryAlias) _)
"The type of the instance is not a factory",
factory-alias->gref FactoryAlias Factory,
private.declare-instance Factory T F Clauses _,
acc-clauses current Clauses,
].
% [declare-const N B Ty] adds a Definition N : Ty := B where Ty is a factory
% and equips the type the factory is used on with all the canonical structures
% that can be built using factory instance B
pred declare-const i:id, i:term, i:arity, o:list (pair id constant).
declare-const Name BodySkel TyWPSkel CSL :- std.do! [
std.assert-ok! (coq.elaborate-arity-skeleton TyWPSkel _ TyWP) "Definition type illtyped",
coq.arity->term TyWP Ty,
std.assert-ok! (coq.elaborate-skeleton BodySkel Ty Body) "Definition illtyped",
% handle parameters via a section -- begin
if (TyWP = arity SectionTy) (
% Do not open a section when it is not necessary (no parameters)
% A side effect of opening a section is loosing meta data associated
% with instances, in particular builder tags are lost
if-verbose (coq.say "HB: skipping section opening"),
SectionBody = Body
) (
std.assert! (coq.next-synterp-action (begin-section SectionName)) "synterp code did not open section",
log.coq.env.begin-section SectionName,
private.postulate-arity TyWP [] Body SectionBody SectionTy
),
% identify the factory
std.assert! (coq.safe-dest-app SectionTy (global FactoryAlias) Args) "The type of the instance is not a factory",
factory-alias->gref FactoryAlias Factory,
std.assert! (factory-nparams Factory NParams) "Not a factory synthesized by HB",
% declare the constant for the factory instance
private.hack-section-discharging SectionBody SectionBodyHack,
private.optimize-body SectionBodyHack OptimizedBody,
if (Name = "_") (RealName is "HB_unnamed_factory_" ^ {std.any->string {new_int} }) (RealName = Name),
% unfold local instances in the type of C
if (current-mode (builder-from _ _ _ _)) (std.do![
findall-local-canonical LocalCSL,
coq.copy-clauses-for-unfold LocalCSL UnfoldClauses,
UnfoldClauses => copy SectionTy SectionTyUnfolded,
]) (SectionTy = SectionTyUnfolded),
log.coq.env.add-const-noimplicits-failondup RealName OptimizedBody
SectionTyUnfolded @transparent! C,
TheFactory = (global (const C)),
% call HB.instance TheType TheFactory
std.drop NParams Args [TheType|_],
private.check-non-forgetful-inheritance TheType Factory,
private.declare-instance Factory TheType TheFactory Clauses CSL,
% handle parameters via a section -- end
if (TyWP = arity _) true (
if-verbose (coq.say {header} "closing instance section"),
log.coq.env.end-section-name SectionName
),
% we accumulate clauses now that the section is over
acc-clauses current Clauses
].
% [declare-all T CL MCSTL] given a type T and a list of class definition
% CL in topological order (from least dep to most) looks for classes
% for which all the dependencies (mixins) were postulated so far and skips the
% rest. For each fulfilled class it declares a local constant inhabiting the
% corresponding structure and declares it canonical.
% Each mixin used in order to fulfill a class is returned together with its name.
pred declare-all i:term, i:list class, o:list (pair id constant).
declare-all T [class Class Struct MLwP|Rest] [pr Name CS|L] :-
infer-class T Class Struct MLwP S Name STy Clauses,
!,
decl-const-in-struct Name S STy CS,
Clauses => declare-all T Rest L.
declare-all T [_|Rest] L :- declare-all T Rest L.
declare-all _ [] [].
% for generic types, we need first to instantiate them by giving them holes,
% so they can be used to instantiate the classes
pred declare-all-on-type-constructor i:term, i:list class, o:list (pair id constant).
declare-all-on-type-constructor T [class Class Struct MLwP|Rest] [pr Name CS|L] :-
%TODO: compute the arity of the Class subject and saturate up to that point
% there may even be more than one possibility
saturate-type-constructor T Ty,
infer-class Ty Class Struct MLwP S Name _STy Clauses,
!,
abstract-holes.main S SC,
std.assert-ok! (coq.typecheck SC SCTy) "declare-all-on-type-constructor: badly closed",
decl-const-in-struct Name SC SCTy CS,
Clauses => declare-all-on-type-constructor T Rest L.
declare-all-on-type-constructor T [_|Rest] L :- declare-all-on-type-constructor T Rest L.
declare-all-on-type-constructor _ [] [].
pred infer-class i:term, i:classname, i:gref, i:factories, o:term, o:string, o:term, o:list prop.
infer-class T Class Struct MLwP S Name STy Clauses:- std.do![
if (not(has-CS-instance? T Struct))
true % we build it
(if-verbose (coq.say {header} "skipping already existing"
{nice-gref->string Struct} "instance on"
{coq.term->string T}),
fail),
params->holes MLwP Params,
get-constructor Class KC,
if (synthesis.infer-all-args-let Params T KC KCApp ok)
(if-verbose (coq.say {header} "we can build a" {nice-gref->string Struct} "on"
{coq.term->string T}))
fail,
Name is {cs-pattern->name {term->cs-pattern T}}
^ "__canonical__" ^ {gref->modname Struct 2 "_" },
if-verbose (coq.say {header} "declare canonical structure instance" Name),
get-constructor Struct KS,
coq.safe-dest-app T THD _,
private.optimize-class-body THD {std.length Params} KCApp KCAppNames Clauses,
coq.mk-app (global KS) {std.append Params [T, KCAppNames]} S,
if-verbose (coq.say {header} "structure instance for" Name "is" {coq.term->string S}),
std.assert-ok! (coq.typecheck S STy) "infer-class: S illtyped",
].
pred decl-const-in-struct i:string, i:term, i:term, i:constant.
decl-const-in-struct Name S STy CS:- std.do![
log.coq.env.add-const-noimplicits Name S STy @transparent! CS, % Bug coq/coq#11155, could be a Let
with-locality (log.coq.CS.declare-instance CS), % Bug coq/coq#11155, should be local
acc-clause current (local-canonical CS),
if-verbose (coq.say {header} "structure instance" Name "declared"),
].
pred declare-factory-sort-deps i:gref.
declare-factory-sort-deps GR :- std.do! [
if-verbose (coq.say {header} "required instances on factory sort for" GR),
Name is "SortInstances" ^ {std.any->string {new_int}},
log.coq.env.begin-module Name none,
log.coq.env.begin-section Name,
mk-factory-sort-deps GR CSL,
log.coq.env.end-section-name Name,
log.coq.env.end-module-name Name _,
std.forall CSL (x\ sigma CS\ x = pr _ CS, log.coq.CS.declare-instance CS)
].
pred declare-factory-sort-factory i:gref.
declare-factory-sort-factory GR :- std.do! [
if-verbose (coq.say {header} "required instances on factory sort for" GR),
Name is "SortInstances" ^ {std.any->string {new_int}},
log.coq.env.begin-module Name none,
log.coq.env.begin-section Name,
mk-factory-sort-factory GR CSL,
log.coq.env.end-section-name Name,
log.coq.env.end-module-name Name _,
std.forall CSL (x\ sigma CS\ x = pr _ CS, log.coq.CS.declare-instance CS)
].
pred mk-factory-sort-deps i:gref, o:list (pair id constant).
mk-factory-sort-deps AliasGR CSL :- std.do! [
factory-alias->gref AliasGR GR,
gref-deps GR MLwPRaw,
context.declare MLwPRaw MLwP SortParams SortKey SortMSL _,
SortMSL => synthesis.infer-all-gref-deps SortParams SortKey GR FSort,
log.coq.env.add-section-variable-noimplicits "f" FSort CF,
GCF = global (const CF),
factory-sort (coercion GRFSort _ GR _),
SortMSL => synthesis.infer-all-gref-deps SortParams SortKey GRFSort KSort,
coq.mk-app KSort [GCF] KFSortEta,
list-w-params_list MLwP ML,
std.length ML NMLArgs,
coq.mk-n-holes NMLArgs SortMLHoles,
std.append {std.append SortParams [SortKey|SortMLHoles]} [GCF] KFSortArgs,
coq.mk-app (global GRFSort) KFSortArgs KFSort,
std.assert-ok! (coq.unify-eq KFSortEta KFSort) "HB: KRSort not an app",
std.map SortMSL
(c\ o\ sigma m t\ c = mixin-src _ m t, o = mixin-src KFSort m t)
KFSortMSL,
KFSortMSL =>
synthesis.under-mixin-src-from-factory.do! KFSort GCF
[declare-all KFSort {findall-classes-for ML} CSL]
].
pred mk-factory-sort-factory i:gref, o:list (pair id constant).
mk-factory-sort-factory AliasGR CSL :- std.do! [
factory-alias->gref AliasGR GR,
gref-deps GR MLwPRaw,
context.declare MLwPRaw MLwP SortParams SortKey SortMSL _,
SortMSL => synthesis.infer-all-gref-deps SortParams SortKey GR FSort,
log.coq.env.add-section-variable-noimplicits "f" FSort CF,
std.length {list-w-params_list MLwP} NMLArgs,
coq.mk-n-holes NMLArgs SortMLHoles,
GCF = global (const CF),
coq.mk-app (global GR) {std.append SortParams [GCF|SortMLHoles]} FGCF,
declare-const "_" GCF (arity FGCF) CSL
].
% create instances for all possible combinations of types and structure compatible
pred saturate-instances.
saturate-instances :- std.do! [
findall-has-mixin-instance ClausesHas,
std.map ClausesHas has-mixin-instance_key KL,
undup-cs-patterns KL UKL,
std.map UKL cs-pattern->term TL,
findall-classes AllClasses,
std.map ClausesHas has-mixin-instance->mixin-src Clauses,
Clauses => std.forall2 TL UKL (t\k\sigma Classes\
std.filter AllClasses (no-instance-for k) Classes,
declare-all-on-type-constructor t Classes _),
].
pred no-instance-for i:cs-pattern, i:class.
no-instance-for K (class _ S _) :-
get-structure-sort-projection S (global Proj),
coq.CS.db-for Proj K [].
/* ------------------------------------------------------------------------- */
/* ----------------------------- private code ------------------------------ */
/* ------------------------------------------------------------------------- */
namespace private {
shorten coq.{ term->gref, subst-fun, safe-dest-app, mk-app, mk-eta, subst-prod }.
pred declare-instance i:factoryname, i:term, i:term,
o:list prop, o:list (pair id constant).
declare-instance Factory T F Clauses CSL :-
current-mode (builder-from T TheFactory FGR _), !,
if (get-option "local" tt)
(coq.error "HB: declare-instance: cannot make builders local.
If you want temporary instances, make an alias, e.g. with let T' := T") true,
!,
declare-canonical-instances-from-factory-and-local-builders Factory
T F TheFactory FGR Clauses CSL.
declare-instance Factory T F Clauses CSL :-
declare-canonical-instances-from-factory Factory T F Clauses1 CSL,
if (get-option "export" tt)
(coq.env.current-library File,
std.map CSL (x\r\ sigma i c\ x = pr i c, r = instance-to-export File i c) Clauses2)
(Clauses2 = []),
std.append Clauses1 Clauses2 Clauses.
% [add-mixin T F _ M Cl] adds a constant being the mixin instance for M on type
% T built from factory F
pred add-mixin i:term, i:factoryname, i:bool, i:mixinname,
o:list prop, o:list (pair id constant).
add-mixin T FGR MakeCanon MissingMixin [MixinSrcCl, BuilderDeclCl] CSL :- std.do! [
new_int N, % timestamp
synthesis.assert!-infer-mixin T MissingMixin Bo,
MixinSrcCl = mixin-src T MixinName (global (const C)),
BuilderDeclCl = builder-decl (builder N FGR MixinName (const C)),
std.assert-ok! (coq.typecheck Bo Ty) "declare-instances: mixin illtyped",
safe-dest-app Ty (global MixinNameAlias) _,
factory-alias->gref MixinNameAlias MixinName,
std.assert! (MissingMixin = MixinName) "HB: anomaly: we built the wrong mixin",
% If the mixin instance is already a constant there is no need to
% alias it.
if (Bo = global (const C)) true
(Name is {gref->modname FGR 2 "_"} ^"__to__" ^ {gref->modname MixinName 2 "_"},
if-verbose (coq.say {header} "declare mixin instance" Name),
log.coq.env.add-const-noimplicits Name Bo Ty @transparent! C),
if (MakeCanon = tt, whd (global (const C)) [] (global (indc _)) _)
(std.do! [
if-verbose (coq.say {header} "declare canonical mixin instance" C),
with-locality (log.coq.CS.declare-instance C),
CSL = [pr "_" C]
]) (CSL = []),
].
pred add-all-mixins i:term, i:factoryname, i:list mixinname, i:bool,
o:list prop, o:list (pair id constant).
add-all-mixins T FGR ML MakeCanon Clauses CSL :- std.do! [
std.map ML (m\ o\ sigma ClL CSL\
add-mixin T FGR MakeCanon m ClL CSL, o = pr ClL CSL) ClLxCSL_L,
std.unzip ClLxCSL_L ClLL CSLL,
std.flatten ClLL Clauses,
std.flatten CSLL CSL
].
% [postulate-arity A Acc T TS] postulates section variables
% corresponding to parameters in arity A. TS is T applied
% to all section variables (and hd-beta reduced). Acc should
% be [] at call site.
pred postulate-arity i:arity, i:list term, i:term, o:term, o:term.
postulate-arity (parameter ID _ S A) Acc T T1 Ty :-
std.assert-ok! (coq.typecheck-ty S _) "arity parameter illtyped",
if-verbose (coq.say {header} "postulating" ID),
if (var S) (coq.fresh-type S) true,
log.coq.env.add-section-variable-noimplicits ID S C,
Var = global (const C),
postulate-arity (A Var) [Var|Acc] T T1 Ty.
postulate-arity (arity Ty) ArgsRev X T Ty :-
hd-beta X {std.rev ArgsRev} X1 Stack1,
unwind X1 Stack1 T.
% We find the new mixins that F build, we build them and shedule them
% for becoming builders at section closing time. We also declare
% all canonical instances these new mixins allow for, so that the user
% can access their theory and notations
pred declare-canonical-instances-from-factory-and-local-builders
i:factoryname, i:term, i:term, i:term, i:factoryname,
o:list prop, o:list (pair id constant).
declare-canonical-instances-from-factory-and-local-builders
Factory T F _TheFactory FGR Clauses CSL :- std.do! [
synthesis.under-new-mixin-src-from-factory.do! T F (NewMixins\ std.do! [
add-all-mixins T FGR NewMixins ff Clauses MCSL,
]),
list-w-params_list {factory-provides Factory} ML,
Clauses => declare-all T {findall-classes-for ML} CCSL,
std.append MCSL CCSL CSL
].
% [declare-canonical-instances-from-factory T F] given a factory F
% it uses all known builders to declare canonical instances of structures
% on T
pred declare-canonical-instances-from-factory
i:factoryname, i:term, i:term, o: list prop, o:list (pair id constant).
declare-canonical-instances-from-factory Factory T F ClausesHas CSL :- std.do! [
% The order of the following two "under...do!" is crucial,
% priority must be given to canonical mixins
% as they are the ones which guarantee forgetful inheritance
% hence we add these clauses last.
synthesis.under-mixin-src-from-factory.do! T F [
synthesis.under-local-canonical-mixins-of.do! T [
list-w-params_list {factory-provides Factory} ML,
add-all-mixins T Factory ML tt Clauses MCSL,
std.map-filter Clauses (mixin-src->has-mixin-instance ) ClausesHas,
ClausesHas => declare-all T {findall-classes-for ML} CCSL, % declare-all-on-type-constructor doesn't work here
]
],
std.append MCSL CCSL CSL
].
% If you don't mention the factory in a builder, then Coq won't make
% a lambda for it at section closing time.
pred hack-section-discharging i:term, o:term.
hack-section-discharging B B :- current-mode no-builder, !.
hack-section-discharging B B1 :- current-mode (builder-from _ TheFactory _ _), !,
std.assert-ok! (coq.typecheck TheFactory TheFactoryTy) "TheFactory is illtyped (BUG)",
B1 = {{ let _ : lp:TheFactoryTy := lp:TheFactory in lp:B }}.
hack-section-discharging B B.
% unfolds the constant used for the phant abbreviation to avoid storing all
% the phantom abstrctions and idfun that were used to trigger inference
pred optimize-body i:term, o:term.
optimize-body (app[global (const C)| Args]) Red :- (phant-abbrev _ (const C) _ ; (rex_match "phant_" {coq.gref->id (const C)})), !,
coq.env.const C (some B) _,
hd-beta B Args HD Stack,
unwind HD Stack Red.
optimize-body (let _ _ T x\x) Red :- !, optimize-body T Red.
optimize-body X X.
pred hnf i:term, o:term.
hnf X R :- get-option "hnf" tt, !, unwind {whd X []} R.
hnf X X.
pred optimize-class-body i:term, i:int, i:term, o:term, o:list prop.
optimize-class-body T NParams (let _ _ MBo R) R1 Clauses :- std.do! [
declare-mixin-name {hnf MBo} MC CL1,
if (T = global (indt _), MC = global (const C), not(coq.env.opaque? C))
(log.coq.strategy.set [C] (level 1000)) true, % opaque stops simpl
optimize-class-body T NParams (R MC) R1 CL2,
std.append CL1 CL2 Clauses,
].
optimize-class-body _ _ (app L) (app L) [].
pred declare-mixin-name i:term, o:term, o:list prop.
declare-mixin-name (global _ as T) T [].
declare-mixin-name T (global GR) [] :- mixin-mem T GR.
declare-mixin-name T T [] :- coq.safe-dest-app T (global GR) _, not (from _ _ GR), not (get-option "hnf" tt).
declare-mixin-name T (global (const C)) [mixin-mem T (const C)] :- std.do! [
Name is "HB_unnamed_mixin_" ^ {std.any->string {new_int}},
if-verbose (coq.say {header} "Giving name" Name "to mixin instance" {coq.term->string T}),
log.coq.env.add-const-noimplicits Name T _ @transparent! C,
].
pred check-non-forgetful-inheritance i:term, i:gref.
check-non-forgetful-inheritance _ _ :-
get-option "non_forgetful_inheritance" tt, !.
check-non-forgetful-inheritance T Factory :- std.do! [
if (coq.safe-dest-app T (global (const HdSym)) _, structure-key HdSym _ Super) (
coq.warning "HB" "HB.non-forgetful-inheritance"
"non forgetful inheritance detected.\n"
"You have two solutions:"
"1. (Best practice) Reorganize your hierarchy to make"
{nice-gref->string Factory}
"depend on"
{ calc ({nice-gref->string Super} ^ ".") }
"See the paper \"Competing inheritance paths in"
"dependent type theory\" (https://hal.inria.fr/hal-02463336) for more"
"explanations"
"2. Use the attribute #[non_forgetful_inheritance] to disable this check."
"We strongly advise you encapsulate this instance inside a module,"
"in order to isolate it from the rest of the code, and to be able"
"to import it on demand. See the above paper and the file"
"https://github.com/math-comp/hierarchy-builder/blob/master/tests/non_forgetful_inheritance.v"
"to witness devastating effects."
) true
].
}}
hierarchy-builder-1.7.0/HB/pack.elpi 0000664 0000000 0000000 00000006756 14547515630 0017233 0 ustar 00root root 0000000 0000000
/* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
namespace pack {
pred main i:term, i:list argument, o:term.
main Ty Args Instance :- std.do! [
std.assert! (not(var Ty)) "HB.pack: the structure to pack cannot be unknown, use HB.pack_for",
std.assert! (coq.safe-dest-app {unwind {whd Ty []}} (global Structure) Params) "HB.pack: not a structure",
std.assert! (class-def (class Class Structure _)) "HB.pack: not a structure",
std.assert! (Args = [trm TSkel|FactoriesSkel]) "HB.pack: not enough arguments",
get-constructor Class KC,
get-constructor Structure KS,
std.assert-ok! (d\
(coq.elaborate-ty-skeleton TSkel _ T d, d = ok) ;
coq.elaborate-skeleton TSkel _ T d
) "HB.pack: not a well typed key",
private.elab-factories FactoriesSkel T Factories,
if (var T) (coq.error "HB.pack: you must pass a type or at least one factory") true,
if2 (T = app[global (const SortProj)|ProjParams], structure-key SortProj ClassProj _)
(AllFactories = [app[global (const ClassProj)|ProjParams] | Factories], Tkey = T) % already existing class on T
(def T _ _ Tkey) % we unfold letins if we can, they may hide constants with CS instances
(AllFactories = Factories)
(AllFactories = Factories, Tkey = T), % it's a factory, won't add anything
private.synth-instance Params KC KS T Tkey AllFactories Instance,
].
/* ------------------------------------------------------------------------- */
/* ----------------------------- private code ------------------------------ */
/* ------------------------------------------------------------------------- */
namespace private {
pred synth-instance i:list term, i:gref, i:gref, i:term, i:term, i:list term, o:term.
synth-instance Params KC KS T Tkey [Factory|Factories] Instance :-
synthesis.under-new-mixin-src-from-factory.do! Tkey Factory (_\
synth-instance Params KC KS T Tkey Factories Instance).
synth-instance Params KC KS T Tkey [] Instance :- coq.safe-dest-app Tkey (global _) _, !,
synthesis.under-local-canonical-mixins-of.do! Tkey [
std.assert-ok! (synthesis.infer-all-args-let Params Tkey KC ClassInstance) "HB.pack: cannot infer the instance",
std.append Params [T, ClassInstance] InstanceArgs,
Instance = app[global KS | InstanceArgs]
].
synth-instance Params KC KS T Tkey [] Instance :- std.do! [
std.assert-ok! (synthesis.infer-all-args-let Params Tkey KC ClassInstance) "HB.pack: cannot infer the instance",
std.append Params [T, ClassInstance] InstanceArgs,
Instance = app[global KS | InstanceArgs]
].
pred elab-factories i:list argument, i:term, o:list term.
elab-factories [] _ [].
elab-factories [trm FactorySkel|More] T [Factory|Factories] :-
std.assert-ok! (coq.elaborate-skeleton FactorySkel FTy MaybeFactory) "HB.pack: illtyped factory",
if2 (factory? {unwind {whd FTy []}} (triple _ _ T1)) % a factory
(Factory = MaybeFactory)
(coq.safe-dest-app {unwind {whd FTy []}} (global GR) _, structure-key SortP ClassP GR) % a structure instance
(coq.mk-n-holes {structure-nparams GR} Params,
std.append Params [MaybeFactory] ParamsF,
coq.mk-app (global (const SortP)) ParamsF T1,
coq.mk-app (global (const ClassP)) ParamsF Factory)
(coq.error "HB: argument" {coq.term->string MaybeFactory} "is not a factory, it has type:" {coq.term->string FTy}),
std.assert-ok! (coq.unify-eq T T1) "HB.pack: factory for the wrong type",
elab-factories More T Factories.
}}
hierarchy-builder-1.7.0/HB/status.elpi 0000664 0000000 0000000 00000005535 14547515630 0017632 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
namespace status {
pred print-hierarchy.
print-hierarchy :- std.do! [
coq.say "--------------------- Hierarchy -----------------------------------",
std.findall (class-def CL_) CL,
std.forall CL private.pp-class,
coq.say "",
coq.say "--------------------- Builders -----------------------------------",
std.findall (from A_ B_ C_) FL,
std.forall FL private.pp-from,
std.findall (mixin-src T_ M_ V_) ML,
if (ML = []) true (
coq.say "",
coq.say "--------------------- Local mixin instances ----------------------",
std.forall ML private.pp-mixin-src
),
std.findall (builder-decl BD_) BDL,
if (BDL = []) true (
coq.say "",
coq.say "--------------------- Builder declarations ----------------------",
std.forall BDL private.pp-builder-decl
),
std.findall (current-mode BF_) BFL,
if (BFL = []) true (
coq.say "",
coq.say "--------------------- Current mode ----------------------",
std.forall BFL private.pp-current-mode
),
].
/* ------------------------------------------------------------------------- */
/* ----------------------------- private code ------------------------------ */
/* ------------------------------------------------------------------------- */
namespace private {
pred pp-from i:prop.
pp-from (from F M T) :-
coq.say "From" {coq.term->string (global F)} "to" {coq.term->string (global M)},
coq.say " " {coq.term->string (global T)},
coq.say "".
pred pp-list-w-params i:mixins, i:term.
pred pp-list-w-params.list-triple i:list (w-args mixinname), i:term.
pred pp-list-w-params.triple i:w-args mixinname.
pp-list-w-params (w-params.cons N Ty LwP) T :-
@pi-parameter N Ty p\ pp-list-w-params (LwP p) {coq.mk-app T [p]}.
pp-list-w-params (w-params.nil N TTy LwP) T :-
@pi-parameter N TTy t\ pp-list-w-params.list-triple (LwP t) {coq.mk-app T [t]}.
pp-list-w-params.list-triple L S :-
coq.say {coq.term->string S} ":=",
std.forall L pp-list-w-params.triple.
pp-list-w-params.triple (triple M Params T) :-
coq.say " " {coq.term->string (app [global M|{std.append Params [T]}])}.
pred pp-class i:prop.
pp-class (class-def (class _ S MLwP)) :-
pp-list-w-params MLwP (global S).
pred pp-mixin-src i:prop.
pp-mixin-src (mixin-src T M C) :-
coq.say {coq.term->string T} "is a"
{nice-gref->string M} "thanks to"
{coq.term->string C}.
pred pp-builder-decl i:prop.
pp-builder-decl (builder-decl (builder N F M GR)) :-
coq.say "builder" GR "with serial number" N
"will build mixin" M "from factory" F.
pred pp-current-mode i:prop.
pp-current-mode (current-mode (builder-from TheType TheFactory GRF Mod)) :-
coq.say "The current key is" TheType "with factory" TheFactory
"corresponding to Global Ref" GRF "in module" Mod.
}}
hierarchy-builder-1.7.0/HB/structure.elpi 0000664 0000000 0000000 00000066736 14547515630 0020361 0 ustar 00root root 0000000 0000000 /* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
namespace structure {
% HB.structure Definition S P1 P2 := { T of F1 P1 T & F2 P1 (P2*P2) T }
% cons p1\ cons p2\ nil t\ [triple f1 [p1] t,triple f2 [p1, {{p1 * p2}}] t]
pred declare i:string, i:term, i:sort.
pred declare i:string, i:term, i:universe.
declare Module BSkel Sort :- std.do! [
disable-id-phant BSkel BSkelNoId,
std.assert-ok! (coq.elaborate-skeleton BSkelNoId _ BNoId) "illtyped structure definition",
re-enable-id-phant BNoId B,
private.sigT->list-w-params B GRFSwP ClosureCheck,
factories-provide GRFSwP PMLwP,
list-w-params.flatten-map GRFSwP gref-deps RMLwP, % TODO: extract code from factories-provide
list-w-params.append PMLwP RMLwP UnsortedMLwP,
w-params.map UnsortedMLwP (p\t\ toposort-mixins) MLwP,
list-w-params_list PMLwP PML,
list-w-params_list MLwP ML,
synthesis.list-w-params.check-key MLwP,
if (ClosureCheck = tt, not({std.length PML} = {std.length ML}))
(coq.warning "HB" "HB.implicit-structure-dependency" "pulling in dependencies:" {std.map {std.list-diff ML PML} nice-gref->string}
"\nPlease list them or end the declaration with '&'")
true,
private.if-class-already-exists-error Module {findall-classes-for ML} ML,
private.if-coverage-not-good-error ML,
% TODO: check we never define the superclass of an exising class
if-verbose (coq.say {header} "start module" Module),
log.coq.env.begin-module Module none,
private.declare-class+structure MLwP Sort
ClassName Structure SortProjection ClassProjection Factories StructKeyClause,
w-params.map MLwP (_\_\_\ mk-nil) NilwP,
ClassAlias = (factory-alias->gref ClassName ClassName),
CurrentClass = (class ClassName Structure MLwP),
ClassName = indt ClassInd, coq.env.indt ClassInd _ _ _ _ [ClassK] _,
GRDepsClauses =
[gref-deps (indt ClassInd) NilwP, gref-deps (indc ClassK) MLwP],
std.map ML (m\ o\ o = mixin-class m ClassName) MixinMems,
std.filter ML (m\ not (mixin-first-class m _)) NewMixins,
std.map NewMixins (m\ r\ r = mixin-first-class m ClassName) MixinFirstClass,
if-verbose (coq.say {header} "structure: new mixins" NewMixins),
if-verbose (coq.say {header} "structure: mixin first class" MixinFirstClass),
if-verbose (coq.say {header} "declaring clone abbreviation"),
w-params.then MLwP phant.fun-real phant.fun-real
(private.clone-phant-body ClassName SortProjection Structure) PhClone,
phant.add-abbreviation "clone" PhClone _ _,
if-verbose (coq.say {header} "declaring pack_ constant"),
(ClassAlias => class-def CurrentClass => GRDepsClauses => MixinMems =>
w-params.then MLwP mk-fun mk-fun (private.pack-body ClassName) Pack),
if-verbose (coq.say {header} "declaring pack_ constant =" Pack),
log.coq.env.add-const-noimplicits "pack_" Pack _ @transparent! ConstPack,
GRPack = const ConstPack,
if-arg-sort (
if-verbose (coq.say {header} "define arg_sort"),
std.assert-ok! (coq.typecheck SortProjection SortProjTy)
"HB: BUG: cannot retype projection",
log.coq.env.add-const-noimplicits "arg_sort" SortProjection SortProjTy ff ArgSortCst
),
if-verbose (coq.say {header} "start module Exports"),
log.coq.env.begin-module "Exports" none,
%(ClassAlias => class-def CurrentClass =>
% GRDepsClauses => MixinFirstClass => gref-deps GRPack MLwP =>
% phant.of-gref tt GRPack [] PhRepack),
%if-verbose (coq.say {header} "declaring pack abbreviation =" PhRepack),
% phant.add-abbreviation "pack" PhRepack _ PackAbbrev,
if (get-option "short.type" ShortType) (
if-verbose (coq.say {header} "short name for type:" ShortType),
(@global! => log.coq.notation.add-abbreviation
ShortType 0 (global Structure) ff _)) true,
coq.mk-app (global Structure) {coq.mk-n-holes {w-params.nparams MLwP}} HB_Instance,
if (get-option "short.pack" ShortPack) (std.do! [
if-verbose (coq.say {header} "declaring pack abbreviation:" ShortPack),
% coq.notation.abbreviation-body PackAbbrev NPackAbbrev PackAbbrevTrm,
% @global! => log.coq.notation.add-abbreviation
% ShortPack NPackAbbrev PackAbbrevTrm ff _
coq.notation.add-abbreviation-for-tactic ShortPack "HB.pack_for" [trm HB_Instance]
]) true,
% (std.do! [
% PackAbbrevName is Module ^ ".pack",
% if-verbose (coq.say {header} "declaring pack abbreviation:" PackAbbrevName),
% coq.notation.add-abbreviation-for-tactic PackAbbrevName "HB.pack_for" [trm HB_Instance],
%]),
if-verbose (coq.say {header} "making coercion from type to target"),
synthesis.infer-coercion-tgt MLwP CoeClass,
if-arg-sort (private.declare-sort-coercion CoeClass Structure
(global (const ArgSortCst))),
private.declare-sort-coercion CoeClass Structure SortProjection,
if-verbose (coq.say {header} "exporting unification hints"),
ClassAlias => Factories => GRDepsClauses =>
private.declare-unification-hints SortProjection ClassProjection CurrentClass NewJoins,
% Register in Elpi's DB the new structure
% NOT TODO: All these acc are correctly locaed in an Export Module
if (ClassName = indt ClassInd) (std.do![
if-verbose (coq.say {header} "exporting coercions from class to mixins"),
std.forall {coq.env.projections ClassInd}
(private.export-mixin-coercion ClassName)
])
(coq.say "declare:" ClassName "should be an inductive", fail),
if-verbose (coq.say {header} "accumulating various props"),
std.flatten [
Factories, [ClassAlias], [is-structure Structure],
NewJoins, [class-def CurrentClass], GRDepsClauses,
[gref-deps GRPack MLwP], MixinMems, [StructKeyClause]
]
NewClauses,
acc-clauses current NewClauses,
if-verbose (coq.say {header} "stop module Exports"),
log.coq.env.end-module-name "Exports" Exports,
log.coq.env.import-module "Exports" Exports,
if-verbose (coq.say {header} "declaring on_ abbreviation"),
private.mk-infer-key CoeClass ClassProjection NilwP (global Structure) PhClass,
phant.add-abbreviation "on_" PhClass _ ClassOfAbbrev,
(pi c\ coq.notation.abbreviation ClassOfAbbrev [c] (ClassOfAbbrev_ c)),
if-verbose (coq.say {header} "declaring `copy` abbreviation"),
coq.mk-app (global ClassName) {params->holes NilwP} AppClassHoles,
@global! => log.coq.notation.add-abbreviation "copy" 2
{{fun T C => (lp:(ClassOfAbbrev_ C) : (lp:AppClassHoles T)) }} tt _,
if-verbose (coq.say {header} "declaring on abbreviation"),
@global! => log.coq.notation.add-abbreviation "on" 1
{{fun T => (lp:{{ ClassOfAbbrev_ {{_}} }} : (lp:AppClassHoles T)) }} tt
_OnAbbrev,
log.coq.env.end-module-name Module ModulePath,
if-verbose (coq.say {header} "end modules; export" Exports),
export.module {calc (Module ^ ".Exports")} Exports,
if-verbose (coq.say {header} "exporting operations"),
ClassAlias => Factories => GRDepsClauses =>
private.export-operations Structure SortProjection ClassProjection MLwP [] EX MLToExport,
% TODO: issue an Arguments op T : rename, where T is the name written by
% the user in Definition foo := { T of ... }
if-verbose (coq.say {header} "operations meta-data module: ElpiOperations"),
ElpiOperationModName is {calc (Module ^ "ElpiOperations")},
log.coq.env.begin-module ElpiOperationModName none,
acc-clauses current {std.append EX MixinFirstClass},
log.coq.env.end-module-name ElpiOperationModName ElpiOperations,
export.module ElpiOperationModName ElpiOperations,
if-verbose (coq.say {header} "abbreviation factory-by-classname"),
NewClauses => factory.declare-abbrev Module (factory.by-classname ClassName),
NewClauses => if-MC-compat (private.mc-compat-structure Module ModulePath MLToExport
{w-params.nparams MLwP} ClassProjection GRPack),
% Automatic saturation disabled since it is expensive
% NewClauses => instance.saturate-instances,
].
/* ------------------------------------------------------------------------- */
/* ----------------------------- private code ------------------------------ */
/* ------------------------------------------------------------------------- */
namespace private {
shorten coq.{ term->gref, subst-fun, safe-dest-app, mk-app, mk-eta, subst-prod }.
% const Po : forall p1 .. pm T m1 .. mn, Extra (Eg Extra = forall x y, x + y = y + z)
% const C : forall p1 .. pm s, Extra
% Po P1 .. PM T M1 .. MN PoArgs -> C P1 .. PM S PoArgs
pred clean-op-ty i:list prop, i:term, i:term, o:term.
clean-op-ty [] _ T1 T2 :- copy T1 T2.
clean-op-ty [exported-op _ Po C|Ops] S T1 T2 :-
gref-deps (const Po) MLwP,
w-params.nparams MLwP NParams,
std.length {list-w-params_list MLwP} NMixins,
(pi L L1 L2 Params Rest PoArgs\
copy (app [global (const Po)| L]) (app [global (const C) | L2]) :-
std.split-at NParams L Params [_|Rest],
std.drop NMixins Rest PoArgs,
std.append Params [S|PoArgs] L1,
std.map L1 copy L2) =>
clean-op-ty Ops S T1 T2.
pred operation-body-and-ty i:list prop, i:constant, i:structure, i:term, i:term,
i:list term, i:term, i:w-args A, o:pair term term.
operation-body-and-ty EXI Poperation Struct Psort Pclass Params _T (triple _ ParamsOp _) (pr Bo Ty) :- std.do! [
mk-app (global Struct) Params StructType,
mk-app Psort Params PsortP,
mk-app Pclass Params PclassP,
Bo = fun `s` StructType Body,
Ty = prod `s` StructType BodyTy,
(@pi-decl `s` StructType s\ sigma Carrier Class\ std.do! [
mk-app PsortP [s] Carrier,
mk-app PclassP [s] Class,
synthesis.under-mixin-src-from-factory.do! Carrier Class [
% just in case..
synthesis.infer-all-gref-deps ParamsOp Carrier (const Poperation) (Body s),
std.assert-ok! (coq.typecheck (Body s) (DirtyTy s)) "export-1-operation: Body illtyped",
clean-op-ty EXI s (DirtyTy s) (BodyTy s),
],
]),
].
% given an operation (a mixin projection) we generate a constant projection the
% same operation out of the package structure (out of the class field of the
% structure). We also provide all the other mixin dependencies (other misins)
% of the package structure.
pred export-1-operation i:mixinname, i:structure, i:term, i:term, i:one-w-params mixinname, i:option constant, i:list prop, o:list prop.
export-1-operation _ _ _ _ _ none EX EX :- !. % not a projection, no operation
export-1-operation M Struct Psort Pclass MwP (some Poperation) EXI EXO :- !, std.do! [
coq.gref->id (const Poperation) Name,
w-params.then MwP mk-fun-prod ignore (operation-body-and-ty EXI Poperation Struct Psort Pclass) (pr Body BodyTy),
if-verbose (coq.say {header} "export operation" Name),
log.coq.env.add-const-noimplicits Name Body BodyTy @transparent! C,
w-params.nparams MwP NP,
NImplicits is NP + 1,
std.iota NImplicits INI,
std.map INI (_\r\ r = maximal) Implicits,
@global! => log.coq.arguments.set-implicit (const C) [Implicits],
EXO = [exported-op M Poperation C|EXI]
].
% Given a list of mixins, it exports all operations in there
pred export-operations.aux i:structure, i:term, i:term, i:one-w-params mixinname, i:list prop, o:list prop.
export-operations.aux Struct ProjSort ProjClass MwP EX1 EX2 :- !, std.do! [
w-params_1 MwP (indt M),
coq.env.projections M Poperations,
std.fold Poperations EX1 (export-1-operation (indt M) Struct ProjSort ProjClass MwP) EX2,
].
pred mixin-not-already-declared i:one-w-params mixinname.
mixin-not-already-declared MwP :-
w-params_1 MwP M, not(mixin-first-class M _), M = indt _.
pred export-operations i:structure, i:term, i:term, i:mixins, i:list prop, o:list prop, o:list mixinname.
export-operations Structure ProjSort ProjClass MLwP EX1 EX2 MLToExport :- std.do! [
distribute-w-params MLwP LMwP,
std.filter LMwP mixin-not-already-declared LMwPToExport,
std.fold LMwPToExport EX1 (export-operations.aux Structure ProjSort ProjClass) EX2,
std.map LMwPToExport w-params_1 MLToExport,
].
pred mk-coe-class-body
i:factoryname, % From class
i:factoryname, % To class
i:mixins, % To mixins
i:list term, i:term, % Params, T
i:list (w-args mixinname),
o:term.
mk-coe-class-body FC TC TMLwP Params T _ CoeBody :- std.do! [
mk-app (global FC) {std.append Params [T]} Class,
list-w-params_list TMLwP TML,
std.map TML (from FC) Builders,
std.map Builders (x\r\mk-app (global x) Params r) BuildersP,
factory-nparams TC TCNP,
mk-app (global {get-constructor TC})
{coq.mk-n-holes TCNP} KCHoles,
(pi c\ sigma Mixes\
std.map BuildersP (builder\r\ r = app[builder, T, c]) Mixes,
mk-app KCHoles [T | Mixes] (ClassCoercion c)),
CoeBody = {{ fun (c : lp:Class) => lp:(ClassCoercion c) }}
].
pred mk-coe-structure-body
i:structure, % From structure
i:structure, % To structure
i:factoryname, % To factory (for nparams)
i:term, % class coercion
i:term, % sort projection
i:term, % class projection
i:list term, i:term, % Params, T
i:list (w-args mixinname),
o:term.
mk-coe-structure-body StructureF StructureT TC Coercion SortProjection ClassProjection
Params _T _ SCoeBody :- std.do! [
mk-app (global StructureF) Params StructureP,
mk-app SortProjection Params SortP,
mk-app ClassProjection Params ClassP,
mk-app Coercion Params CoercionP,
factory-nparams TC TCNP,
mk-app (global {get-constructor StructureT})
{coq.mk-n-holes TCNP} PackPH,
SCoeBody = {{ fun s : lp:StructureP =>
(* let T := lp:SortP s in*)
lp:PackPH (lp:SortP s) (lp:CoercionP (lp:SortP s) (lp:ClassP s)) }},
].
% [declare-coercion P1 P2 C1 C2] declares a structure and a class coercion
% from C1 to C2 given P1 P2 the two projections from the structure of C1
pred declare-coercion i:term, i:term, i:class, i:class.
declare-coercion SortProjection ClassProjection
(class FC StructureF FMLwP) (class TC StructureT TMLwP) :- std.do! [
gref->modname StructureF 2 "_" ModNameF,
gref->modname StructureT 2 "_" ModNameT,
CName is ModNameF ^ "_class__to__" ^ ModNameT ^ "_class",
SName is ModNameF ^ "__to__" ^ ModNameT,
if-verbose (coq.say {header} "declare coercion" SName),
w-params.then FMLwP mk-fun mk-fun
(mk-coe-class-body FC TC TMLwP) CoeBody,
ErrorMessage is "The structures " ^ ModNameF ^ " and " ^ ModNameT ^ " are incompatible: the coercion between them cannot be synthesized",
std.assert-ok! (coq.elaborate-skeleton CoeBody Ty CoeBody') ErrorMessage,
if-verbose (coq.say {header} "declare coercion hint" CName),
log.coq.env.add-const-noimplicits CName CoeBody' Ty @transparent! C,
log.coq.coercion.declare (coercion (const C) 1 FC (grefclass TC)),
Coercion = global (const C),
w-params.then FMLwP mk-fun ignore
(mk-coe-structure-body StructureF StructureT TC Coercion SortProjection ClassProjection)
SCoeBody,
ErrorMessage is "The structures " ^ ModNameF ^ " and " ^ ModNameT ^ " are incompatible: the coercion between them cannot be synthesized",
std.assert-ok! (coq.elaborate-skeleton SCoeBody STy SCoeBody') ErrorMessage,
if-verbose (coq.say {header} "declare unification hint" SName),
log.coq.env.add-const-noimplicits SName SCoeBody' STy @transparent! SC,
log.coq.coercion.declare (coercion (const SC) 0 StructureF (grefclass StructureT)),
log.coq.CS.declare-instance SC,
w-params.nparams FMLwP NparamsSC,
acc-clause current (sub-class FC TC SC NparamsSC)
].
pred join-body i:int, i:int, i:structure, i:term, i:term, i:term, i:term, i:term,
i:list term, i:name, i:term, i:(term -> A), o:term.
join-body N1 N2 S3 S2_Pack S1_sort S3_to_S1 S2_class S3_to_S2
P N _Ty _F (fun N S3P Pack) :- !,
mk-app (global S3) P S3P, !,
@pi-decl N S3P s\
sigma S3_to_S1_Ps S3_to_S2_Ps S1_sortS3Ps S2_classS3Ps Holes1 Holes2 \ std.do! [
coq.mk-n-holes N2 Holes2,
coq.mk-n-holes N1 Holes1,
mk-app S3_to_S1 {std.append P [s]} S3_to_S1_Ps,
mk-app S1_sort {std.append Holes1 [S3_to_S1_Ps]} S1_sortS3Ps,
mk-app S3_to_S2 {std.append P [s]} S3_to_S2_Ps,
mk-app S2_class {std.append Holes2 [S3_to_S2_Ps]} S2_classS3Ps ,
mk-app S2_Pack {std.append Holes2 [S1_sortS3Ps, S2_classS3Ps]} (Pack s)
].
pred declare-join i:class, i:pair class class, o:prop.
declare-join (class C3 S3 MLwP3) (pr (class C1 S1 _) (class C2 S2 _)) (join C1 C2 C3) :-
Name is "join_" ^ {gref->modname S3 2 "_"} ^
"_between_" ^ {gref->modname S1 2 "_"} ^ "_and_" ^ {gref->modname S2 2 "_"},
get-structure-coercion S3 S2 S3_to_S2,
get-structure-coercion S3 S1 S3_to_S1,
get-structure-sort-projection S1 S1_sort,
get-structure-class-projection S2 S2_class,
get-constructor S2 S2_Pack,
factory-nparams C1 N1,
factory-nparams C2 N2,
if-verbose (coq.say {header} "declare unification hint" Name),
w-params.fold MLwP3 mk-fun (join-body N1 N2 S3
(global S2_Pack) S1_sort S3_to_S1 S2_class S3_to_S2) JoinBody,
std.assert-ok! (coq.typecheck JoinBody Ty) "declare-join: JoinBody illtyped",
log.coq.env.add-const-noimplicits Name JoinBody Ty @transparent! J,
log.coq.CS.declare-instance J.
% TODO: this works under the invariant: we never have two classes that
% contain exactly the same mixins. HB.structure should enforce this
% and eventually just alias the existing one rather than failing.
% TODO: HB.structure should check we are not inserting the class
% in the middle of existing ones. Possible fix: always declare all intermediate
% possibilities but without proper names (requires the previous TODO about
% aliasing already existing stuff).
pred declare-unification-hints i:term, i:term, i:class, o:list prop.
declare-unification-hints SortProj ClassProj CurrentClass NewJoins :- std.do! [
findall-classes All,
std.filter All (sub-class? CurrentClass) AllSuper,
std.forall AllSuper (declare-coercion SortProj ClassProj CurrentClass),
findall-newjoins CurrentClass AllSuper TodoJoins,
std.map TodoJoins (declare-join CurrentClass) NewJoins
].
% For each mixin we declare a field and apply the mixin to its dependencies
% (that are previously declared fields recorded via field-for-mixin)
pred synthesize-fields i:term, i:list (w-args mixinname), o:record-decl.
synthesize-fields _T [] end-record.
synthesize-fields T [triple M Args _|ML] (field _ Name MTy Fields) :- std.do! [
Name is {gref->modname M 2 "_"} ^ "_mixin",
if-verbose (coq.say {header} "typing class field" M),
std.assert! (synthesis.infer-all-gref-deps Args T M MTy) "anomaly: a field type cannot be solved",
@pi-decl `m` MTy m\ mixin-src T M m => synthesize-fields T ML (Fields m)
].
pred synthesize-fields.body i:list term, i:term, i:list (w-args mixinname), o:indt-decl.
synthesize-fields.body _Params T ML (record "axioms_" {{ Type }} "Class" FS) :-
synthesize-fields T ML FS.
pred mk-record+sort-field i:sort, i:name, i:term, i:(term -> record-decl), o:indt-decl.
pred mk-record+sort-field i:universe, i:name, i:term, i:(term -> record-decl), o:indt-decl.
mk-record+sort-field Sort _ T F (record "type" (sort Sort) "Pack" (field _ "sort" T F)).
pred mk-class-field i:classname, i:list term, i:term, i:list (w-args mixinname), o:record-decl.
mk-class-field ClassName Params T _ (field [canonical ff] "class" (app [global ClassName|Args]) _\end-record) :-
std.append Params [T] Args.
% Builds the axioms record and the factories from this class to each mixin
pred declare-class+structure i:mixins, i:sort, o:factoryname, o:structure, o:term, o:term, o:list prop, o:prop.
pred declare-class+structure i:mixins, i:universe, o:factoryname, o:structure, o:term, o:term, o:list prop, o:prop.
declare-class+structure MLwP Sort
(indt ClassInd) (indt StructureInd) SortProjection ClassProjection AllFactories
(structure-key SortP ClassP (indt StructureInd)):- std.do! [
if-verbose (coq.say {header} "declare axioms record"MLwP ),
w-params.then MLwP (mk-parameter explicit) (mk-parameter explicit)
synthesize-fields.body ClassDeclaration,
std.assert-ok! (coq.typecheck-indt-decl ClassDeclaration) "declare-class: illtyped",
(@primitive! => log.coq.env.add-indt ClassDeclaration ClassInd),
coq.env.projections ClassInd Projs,
% TODO: put this code in a named clause
w-params.nparams MLwP NParams,
std.map2 {list-w-params_list MLwP} Projs (m\ p\ r\ sigma P\
std.assert! (p = some P) "BUG: we build a class with an anonymous field",
r = from (indt ClassInd) m (const P)) Factories,
AllFactories = [factory-nparams (indt ClassInd) NParams | Factories],
if-verbose (coq.say {header} "declare type record"),
w-params.then MLwP (mk-parameter explicit) (mk-record+sort-field Sort)
(mk-class-field (indt ClassInd)) StructureDeclaration,
std.assert-ok! (coq.typecheck-indt-decl StructureDeclaration) "declare: illtyped",
if (get-option "primitive" tt)
(@primitive! => log.coq.env.add-indt StructureDeclaration StructureInd)
(log.coq.env.add-indt StructureDeclaration StructureInd),
coq.env.projections StructureInd [some SortP, some ClassP],
global (const SortP) = SortProjection,
global (const ClassP) = ClassProjection,
].
% Declares "sort" as a Coercion Proj : Structurename >-> CoeClass.
pred declare-sort-coercion i:class, i:structure, i:term.
declare-sort-coercion CoeClass StructureName (global Proj) :-
if-verbose (coq.say {header} "declare sort coercion"),
log.coq.coercion.declare (coercion Proj 0 StructureName CoeClass).
pred if-class-already-exists-error i:id, i:list class, i:list mixinname.
if-class-already-exists-error _ [] _.
if-class-already-exists-error N [class _ S ML1wP|CS] ML2 :-
list-w-params_list ML1wP ML1,
if (std.list-eq-set ML1 ML2)
(coq.error "Structure" {nice-gref->string S} "contains the same mixins as" N)
(if-class-already-exists-error N CS ML2).
pred export-mixin-coercion i:classname, i:option constant.
export-mixin-coercion _ none.
export-mixin-coercion ClassName (some C) :-
coq.env.typeof (const C) CTy,
coq.prod-tgt->gref CTy MixinGR,
if-verbose (coq.say {header} "export class to mixin coercion for mixin" {nice-gref->string MixinGR}),
log.coq.coercion.declare (coercion (const C) _ ClassName (grefclass MixinGR)).
pred mc-compat-structure i:string, i:modpath, i:list mixinname, i:int, i:term, i:gref, i:option gref.
mc-compat-structure ModuleName _Module NewMixins CNParams ClassProjection GRPack Axioms :- std.do! [
CompatModuleName is "MathCompCompat" ^ ModuleName,
log.coq.env.begin-module CompatModuleName none, % to avoid collisions
log.coq.env.begin-module ModuleName none,
if (Axioms = some GR)
(@global! => log.coq.notation.add-abbreviation "axiom" 0 (global GR) ff _)
true,
if (NewMixins = [NewMixin]) (std.do! [
if-verbose (coq.say "mc-compat-structure: declaring notations 'axioms', 'mixin_of' and 'Mixin'"),
factory-nparams NewMixin NewMixinNP,
MArgs is NewMixinNP + 1,
mk-eta MArgs {coq.env.typeof NewMixin} (global NewMixin) EtaNewMixin,
@global! => log.coq.notation.add-abbreviation "axioms" MArgs EtaNewMixin ff _,
@deprecated! "mathcomp 2.0.0" "use the factory instead" =>
@global! => log.coq.notation.add-abbreviation "mixin_of" MArgs EtaNewMixin ff _,
std.assert! (factory-constructor NewMixin FK) "BUG: Factory constructor missing",
std.assert! (phant-abbrev FK _ PhAbb) "BUG: missing phant-abbrev",
@deprecated! "mathcomp 2.0.0" "use the F.Build instead" =>
@global! => log.coq.notation.add-abbreviation "Mixin" 0
{coq.notation.abbreviation PhAbb {coq.mk-n-holes MArgs}} ff _,
if-verbose (coq.say "mc-compat-structure: declaring pack abbreviation"),
@deprecated! "mathcomp 2.0.0" "use native HB Structure.pack instead" =>
phant.add-abbreviation "mcpack" {phant.of-gref ff GRPack [NewMixin]} _ _,
])
(if-verbose (coq.say "mc-compat-structure: not exactly one new mixin")),
if-verbose (coq.say "mc-compat-structure: declaring notation 'class_of'"),
std.assert-ok! (coq.typecheck ClassProjection ClassProjectionTy) "wtf",
CArgs is CNParams + 1,
mk-eta CArgs ClassProjectionTy ClassProjection EtaClassProjection,
@global! => log.coq.notation.add-abbreviation "class_of" CArgs EtaClassProjection ff _,
log.coq.env.end-module-name ModuleName _,
log.coq.env.end-module-name CompatModuleName MCCompat,
log.coq.env.export-module CompatModuleName MCCompat,
%coq.env.import-module Module,
].
pred clone-phant-body i:factoryname, i:term, i:structure, i:list term, i:term, i:list (w-args mixinname), o:phant-term.
clone-phant-body ClassName SortProjection ((indt I) as Structure) PL T _ PhF :- std.do! [
std.assert! (coq.env.indt I _ _ _ _ [PackC] _) "wtf",
mk-app (global (indc PackC)) {std.append PL [T]} PackPLT,
mk-app (global Structure) PL SPL,
(@pi-decl `cT` SPL cT\
mk-app (global ClassName) {std.append PL [T]} CPL,
@pi-decl `c` CPL c\
(Ph cT c) =
{phant.fun-unify none T {mk-app {mk-app SortProjection PL} [cT]}
{phant.fun-unify none cT {mk-app PackPLT [c]}
{phant.init {mk-app PackPLT [c]}} }}),
PhF = {phant.fun-real `cT` SPL cT\ {phant.fun-implicit `c` CPL c\ Ph cT c }}
].
% [pack-body ClassName P T MLwA B] asserts
% B = fun m0 ... mn => Pack P T (Class P T m0 ... mn)
% under a context with P and T
pred pack-body i:classname, i:list term, i:term, i:list (w-args mixinname), o:term.
pack-body ClassName PL T MLwA F :- std.do! [
class-def (class ClassName S _),
get-constructor ClassName BuildC,
get-constructor S PackS,
synthesis.under-mixins.then MLwA mk-fun
(pack-body.aux PL T BuildC PackS) F,
].
pack-body.aux PL T BuildC PackS Body :- !, std.do! [
synthesis.infer-all-gref-deps PL T BuildC Class,
mk-app (global PackS) {std.append PL [T, Class]} Body
].
pred mk-infer-key i:class, i:term, i:mixins, i:term, o:phant-term.
mk-infer-key CoeClass K (w-params.nil ID _ _) St PhK :-
@pi-parameter ID St t\ phant.init {mk-app K [t]} (PhKBo t),
phant.fun-infer-type CoeClass {coq.id->name ID} St PhKBo PhK.
mk-infer-key CoeClass K (w-params.cons ID Ty W) St R :-
@pi-parameter ID Ty t\ mk-infer-key CoeClass {mk-app K [t]} (W t) {mk-app St [t]} (PhT t),
phant.fun-implicit {coq.id->name ID} Ty PhT R.
pred if-coverage-not-good-error i:list mixinname.
if-coverage-not-good-error ML :-
coq.gref.list->set ML MS,
std.forall ML (if-coverage-not-good-error.one MS).
pred if-coverage-not-good-error.one i:coq.gref.set, i:mixinname.
if-coverage-not-good-error.one MS M :- mixin-first-class M C, !,
class-coverage [C] CMS,
if (coq.gref.set.subset CMS MS)
true
(coq.gref.set.elements {coq.gref.set.remove M CMS} MissinFromCurrent,
coq.error "HB: the first structure declared in this hierarchy containing" {nice-gref->string M} "is" {nice-gref->string C}
"which also contains" {std.map MissinFromCurrent nice-gref->string} "."
"\nThe are two ways to fix this problem:"
"1) change the current structure to contain" {std.map MissinFromCurrent nice-gref->string} "as well;"
"2) amend the hierarchy by declaring a structure before" {nice-gref->string C}
"which contains at most" {std.map {coq.gref.set.elements {coq.gref.set.inter CMS MS}} nice-gref->string}).
if-coverage-not-good-error.one _ _. % new class is the first covering M
pred product->triples i:term, o:list (w-args factoryname), o:bool.
product->triples {{ lib:hb.prod lp:A lp:B }} L ClosureCheck :- !,
product->triples B GRB ClosureCheck,
product->triples A GRA _,
std.append GRA GRB L.
product->triples {{ True }} [] tt :- !.
product->triples {{ False }} [] ff :- !.
product->triples A [GR] tt :- std.assert! (factory? A GR) "A structure can only mention known factories".
pred sigT->list-w-params i:term, o:list-w-params factoryname, o:bool.
sigT->list-w-params (fun N T B) L C :-
coq.name->id N ID, % TODO: we should read the ID from the definition type which is an arity containing ids
L = w-params.cons ID T Rest,
@pi-decl N T p\
sigT->list-w-params (B p) (Rest p) C.
sigT->list-w-params {{ lib:@hb.sigT _ lp:{{ fun N Ty B }} }} L C :-
coq.name->id N ID, % TODO: we should read the ID from the definition type which is an arity containing ids
L = w-params.nil ID Ty Rest,
@pi-decl N Ty t\
product->triples (B t) (Rest t) C.
}}
hierarchy-builder-1.7.0/LICENSE 0000664 0000000 0000000 00000001777 14547515630 0016154 0 ustar 00root root 0000000 0000000 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
hierarchy-builder-1.7.0/Makefile 0000664 0000000 0000000 00000010666 14547515630 0016604 0 ustar 00root root 0000000 0000000 # -*- Makefile -*-
######################################################################
# USAGE: #
# #
# make all: Build the MathComp library entirely, #
# make test-suite: Run the test suite, #
# make only TGTS="...vo": Build the selected libraries of MathComp. #
# #
# The rules this-config::, this-build::, this-only::, #
# this-test-suite::, this-distclean::, this-clean:: #
# and __always__:: may be extended. #
# #
# Additionally, the following variables may be customized: #
SUBDIRS?=
COQBIN?=$(dir $(shell which coqtop))
COQMAKEFILE?=$(COQBIN)coq_makefile
COQDEP?=$(COQBIN)coqdep
COQPROJECT?=_CoqProject
COQMAKEOPTIONS?=
COQMAKEFILEOPTIONS?=
V?=
VERBOSE?=V
TGTS?=
######################################################################
# local context: -----------------------------------------------------
.PHONY: all config build only test-suite clean distclean __always__
.SUFFIXES:
H:= $(if $(VERBOSE),,@) # not used yet
TOP = $(dir $(lastword $(MAKEFILE_LIST)))
COQMAKE = $(MAKE) -f Makefile.coq $(COQMAKEOPTIONS)
COQMAKE_TESTSUITE = $(MAKE) -f Makefile.test-suite.coq $(COQMAKEOPTIONS)
BRANCH_coq:= $(shell $(COQBIN)coqtop -v | head -1 | grep -E '(trunk|master)' \
| wc -l | sed 's/ *//g')
# coq version:
ifneq "$(BRANCH_coq)" "0"
COQVVV:= dev
else
COQVVV:=$(shell $(COQBIN)coqtop --print-version | cut -d" " -f1)
endif
COQV:= $(shell echo $(COQVVV) | cut -d"." -f1)
COQVV:= $(shell echo $(COQVVV) | cut -d"." -f1-2)
ifneq "$(DESTDIR)" ""
HB_INSTALLDIR := $(DESTDIR)/bin
else
HB_INSTALLDIR := $(dir $(shell which $(COQBIN)coqc))
endif
# export to sub- targets
export COQBIN
export COQMAKEFILE
export COQV
export COQVV
export COQVVV
# all: ---------------------------------------------------------------
all:
$(MAKE) config
$(MAKE) build
$(MAKE) test-suite
# Makefile.coq: ------------------------------------------------------
Makefile.coq: $(COQPROJECT) Makefile
$(COQMAKEFILE) $(COQMAKEFILEOPTIONS) -f $(COQPROJECT) -o Makefile.coq
# Test suite ---------------------------------------------------------
Makefile.test-suite.coq: $(COQPROJECT).test-suite Makefile
$(COQMAKEFILE) $(COQMAKEFILEOPTIONS) -f $(COQPROJECT).test-suite -o Makefile.test-suite.coq
# Global config, build, clean and distclean --------------------------
config: sub-config this-config
build: sub-build this-build
only: sub-only this-only
test-suite: sub-test-suite this-test-suite
clean: sub-clean this-clean
distclean: sub-distclean this-distclean
# Local config, build, clean and distclean ---------------------------
.PHONY: this-config this-build this-only this-test-suite this-distclean this-clean
this-config:: __always__
this-build:: this-config Makefile.coq
+$(COQMAKE)
this-only:: this-config Makefile.coq
+$(COQMAKE) only "TGTS=$(TGTS)"
this-test-suite:: build Makefile.test-suite.coq
+$(COQMAKE_TESTSUITE)
this-distclean:: this-clean
rm -f Makefile.coq Makefile.coq.conf
rm -f Makefile.test-suite.coq Makefile.test-suite.coq.conf
this-clean:: __always__
@if [ -f Makefile.coq ]; then $(COQMAKE) cleanall; fi
@if [ -f Makefile.test-suite.coq ]; then $(COQMAKE_TESTSUITE) cleanall; fi
# Install target -----------------------------------------------------
.PHONY: install
install: __always__ Makefile.coq
$(COQMAKE) install
install -d $(HB_INSTALLDIR)
# counting lines of Coq code -----------------------------------------
.PHONY: count
COQFILES = $(shell grep '.v$$' $(COQPROJECT))
count:
@coqwc $(COQFILES) | tail -1 | \
awk '{printf ("%d (spec=%d+proof=%d)\n", $$1+$$2, $$1, $$2)}'
# Additionally cleaning backup (*~) files ----------------------------
this-distclean::
rm -f $(shell find . -name '*~')
# Make in SUBDIRS ----------------------------------------------------
ifdef SUBDIRS
sub-%: __always__
@set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d $(@:sub-%=%); done
else
sub-%: __always__
@true
endif
# Make of individual .vo ---------------------------------------------
structures.vo : %.vo: __always__ Makefile.coq
+$(COQMAKE) $@
$(addsuffix o,$(wildcard examples/*.v examples/*/*.v tests/*.v tests/unit/*.v)): __always__ config build Makefile.test-suite.coq
+$(COQMAKE_TESTSUITE) $@
hierarchy-builder-1.7.0/Makefile.coq.local 0000664 0000000 0000000 00000000374 14547515630 0020451 0 ustar 00root root 0000000 0000000 # Coq does not know about Elpi Accumulate File, so we declare the dependency here
structures.vo : $(wildcard HB/*.elpi HB/common/*.elpi)
clean::
$(SHOW)'CLEAN *.hb *.hb.old'
$(HIDE) find . -name \*.hb -delete
$(HIDE) find . -name \*.hb.old -delete
hierarchy-builder-1.7.0/Makefile.test-suite.coq.local 0000664 0000000 0000000 00000001355 14547515630 0022556 0 ustar 00root root 0000000 0000000 COQ_MINOR=$(shell echo $(COQ_VERSION) | cut -d . -f 2 | cut -d + -f 1)
output_for=`\
if [ -e $(1).out.$(COQ_MINOR) ]; then\
echo $(1).out.$(COQ_MINOR);\
else\
echo $(1).out;\
fi`
DIFF=\
@if [ -z "$$COQ_ELPI_ATTRIBUTES" ]; then \
echo OUTPUT DIFF $(1);\
$(COQTOP) $(COQFLAGS) $(COQLIBS) -topfile $(1) \
< $(1) 2>/dev/null \
| grep -v -e "Skipping rcfile" -e "is declared" -e "is defined" -e "Loading ML file" -e "Welcome to Coq" \
> $(1).out.aux;\
diff -u --strip-trailing-cr $(call output_for,$(1)) $(1).out.aux;\
fi
post-all::
$(call DIFF, tests/compress_coe.v)
$(call DIFF, tests/about.v)
$(call DIFF, tests/howto.v)
$(call DIFF, tests/missing_join_error.v)
$(call DIFF, tests/not_same_key.v)
$(call DIFF, tests/hnf.v) hierarchy-builder-1.7.0/README.md 0000664 0000000 0000000 00000015313 14547515630 0016415 0 ustar 00root root 0000000 0000000 [](https://github.com/math-comp/hierarchy-builder/actions)
[](https://coq.zulipchat.com/#narrow/stream/237868-Hierarchy-Buidlder)
# Hierarchy Builder
Hierarchy Builder (HB) provides high level commands to declare a hierarchy of algebraic structure
(or interfaces if you prefer the glossary of computer science) for the Coq system.
Given a structure one can develop its theory, and that theory becomes automatically applicable to
all the examples of the structure. One can also declare alternative interfaces, for convenience
or backward compatibility, and provide glue code linking these interfaces to the structures part of
the hierarchy.
HB commands compile down to Coq modules, sections, records, coercions, canonical structure instances
and notations following the *packed classes* discipline which is at the core of the [Mathematical
Components](https://github.com/math-comp/math-comp) library. All that complexity is hidden behind
a few concepts and a few declarative Coq commands.
## Example
```coq
From HB Require Import structures.
From Coq Require Import ssreflect ZArith.
HB.mixin Record IsAddComoid A := {
zero : A;
add : A -> A -> A;
addrA : forall x y z, add x (add y z) = add (add x y) z;
addrC : forall x y, add x y = add y x;
add0r : forall x, add zero x = x;
}.
HB.structure Definition AddComoid := { A of IsAddComoid A }.
Notation "0" := zero.
Infix "+" := add.
Check forall (M : AddComoid.type) (x : M), x + x = 0.
```
This is all we need to do in order to declare the `AddComoid` structure
and write statements in its signature.
We proceed by declaring how to obtain an Abelian group out of the
additive, commutative, monoid.
```coq
HB.mixin Record IsAbelianGrp A of IsAddComoid A := {
opp : A -> A;
addNr : forall x, opp x + x = 0;
}.
HB.structure Definition AbelianGrp := { A of IsAbelianGrp A & IsAddComoid A }.
Notation "- x" := (opp x).
```
Abelian groups feature the operations and properties given by the
`IsAbelianGrp` mixin (and its dependency `IsAddComoid`).
```coq
Lemma example (G : AbelianGrp.type) (x : G) : x + (- x) = - 0.
Proof. by rewrite addrC addNr -[LHS](addNr zero) addrC add0r. Qed.
```
We proceed by showing that `Z` is an example of both structures, and use
the lemma just proved on a statement about `Z`.
```coq
HB.instance Definition Z_CoMoid :=
IsAddComoid.Build Z 0%Z Z.add Z.add_assoc Z.add_comm Z.add_0_l.
HB.instance Definition Z_AbGrp :=
IsAbelianGrp.Build Z Z.opp Z.add_opp_diag_l.
Lemma example2 (x : Z) : x + (- x) = - 0.
Proof. by rewrite example. Qed.
```
## Documentation
This [paper](https://hal.inria.fr/hal-02478907) describes the language
in details, and the corresponding talk [is available on youtube](https://www.youtube.com/watch?v=F6iRaTlQrlo).
The [wiki](https://github.com/math-comp/hierarchy-builder/wiki) gathers some
tricks and FAQs. If you want to work on the implementation of HB, this
[recorded hacking session](https://www.youtube.com/watch?v=gmaJjCbzqO0) may be relevant to you.
### Installation & availability
(click to expand)
- You can install HB via OPAM
```shell
opam repo add coq-released https://coq.inria.fr/opam/released
opam install coq-hierarchy-builder
```
- You can use it in nix with the attribute `coqPackages_8_XX.hierarchy-builder` e.g.
via `nix-shell -p coq_8_13 -p coqPackages_8_13.hierarchy-builder`
### Key concepts
(click to expand)
- a *mixin* is a bare bone building block of the hierarchy, it packs operations
and axioms.
- a *factory* is a package of operations and properties that is elaborated by
HB to one or more mixin. A mixin is hence a trivial factory.
- a *structure* is declared by attaching zero or more factories to a type.
- a *builder* is a user provided piece of code capable of
building one or more mixins from a factory.
- an *instance* is an example of a structure: it provides all operation and
fulfills all axioms.
### The commands of HB
(click to expand)
- HB core commands:
- `HB.mixin` declares a mixin,
- `HB.structure` declares a structure,
- `HB.factory` declares a factory,
- `HB.builders` and `HB.end` declare a set of builders,
- `HB.instance` declares a structure instance,
- `HB.declare` declares a context with parameters, key and mixins.
- `HB.saturate` reconsiders all mixin instances to see if some newly declared
structure can be inhabited
- HB core tactic-in-term:
- `HB.pack` to synthesize a structure instance in the middle of a term.
- HB utility commands:
- `HB.export` exports a module and schedules it for re-export
- `HB.reexport` exports all modules, instances and constants scheduled for
re-export
- `HB.lock` locks a definition behind an opaque symbol and an unfolding
equation using Coq module system
- HB queries:
- `HB.about` is similar to `About` but prints more info on HB structures, like
the known instances and where they are declared
- `HB.locate` is similar to `Locate`, prints file name and line of any global
constant synthesized by HB
- `HB.graph` prints the structure hierarchy to a dot file
- `HB.howto` prints sequences of factories to equip a type with a given structure
- HB debug commands:
- `HB.status` dumps the contents of the hierarchy (debug purposes)
- `HB.check` is similar to `Check` (testing purposes)
The documentation of all commands can be found in the comments of
[structures.v](structures.v), search for `Elpi Command` and you will
find them. All commands can be prefixed with the attribute `#[verbose]`
to get an idea of what they are doing.
For debugging and teaching purposes, passing the attributes
`#[log]` or `#[log(raw)]` to a HB command prints Coq commands which are
*almost* equivalent to its effect. Hence, copy-pasting the displayed commands into
your source file is not expected to work, and we strongly recommend
against it.
### Demos
(click to expand)
- [demo1](examples/demo1/) and [demo3](examples/demo3/) declare and evolve a hierarchy up to
rings with various clients that are tested not to break when the hierarchy
evolves
- [demo2](examples/demo2/) describes the subtle triangular interaction between groups,
topological space and uniform spaces. Indeed, 1. all uniform spaces induce a
topology, which makes them topological spaces, but 2. all topological groups
(groups that are topological spaces such that the addition and opposite are
continuous) induce a uniformity, which makes them uniform spaces. We solve
this seamingly mutual dependency using HB.
hierarchy-builder-1.7.0/_CoqProject 0000664 0000000 0000000 00000000201 14547515630 0017257 0 ustar 00root root 0000000 0000000 structures.v
-arg -w -arg -elpi.accumulate-syntax
-arg -w -arg +elpi.typecheck
-Q . HB
-R tests HB.tests
-R examples HB.examples hierarchy-builder-1.7.0/_CoqProject.test-suite 0000664 0000000 0000000 00000004450 14547515630 0021376 0 ustar 00root root 0000000 0000000 -arg -w -arg -redundant-canonical-projection
-arg -w -arg -projection-no-head-constant
-arg -w -arg -abstract-large-number
-arg -w -arg -disj-pattern-notation
-arg -w -arg -notation-overridden
-arg -w -arg +elpi.typecheck
examples/readme.v
examples/hulk.v
examples/demo1/hierarchy_0.v
examples/demo1/hierarchy_1.v
examples/demo1/hierarchy_2.v
examples/demo1/hierarchy_3.v
examples/demo1/hierarchy_4.v
examples/demo1/hierarchy_5.v
examples/demo1/test_0_0.v
examples/demo1/test_1_0.v
examples/demo1/test_2_0.v
examples/demo1/test_3_0.v
examples/demo1/test_3_3.v
examples/demo1/test_4_0.v
examples/demo1/test_4_3.v
examples/demo1/test_5_0.v
examples/demo1/test_5_3.v
examples/demo2/classical.v
examples/demo2/stage10.v
examples/demo2/stage11.v
examples/demo3/hierarchy_0.v
examples/demo3/hierarchy_1.v
examples/demo3/hierarchy_2.v
examples/demo3/test_0_0.v
examples/demo3/test_1_0.v
examples/demo3/test_2_0.v
examples/demo4/hierarchy_0.v
examples/demo5/hierarchy_0.v
examples/FSCD2020_material/V1.v
examples/FSCD2020_material/V2.v
examples/FSCD2020_material/V3.v
examples/FSCD2020_material/V4.v
examples/FSCD2020_talk/V1.v
examples/FSCD2020_talk/V2.v
examples/FSCD2020_talk/V3.v
examples/Coq2020_material/CoqWS_demo.v
examples/Coq2020_material/CoqWS_abstract.v
examples/Coq2020_material/CoqWS_expansion/withHB.v
examples/Coq2020_material/CoqWS_expansion/withoutHB.v
# examples/cat/cat.v
tests/type_of_exported_ops.v
tests/duplicate_structure.v
tests/instance_params_no_type.v
tests/test_CS_db_filtering.v
tests/subtype.v
tests/exports.v
tests/exports2.v
tests/log_impargs_record.v
tests/compress_coe.v
tests/funclass.v
tests/grefclass.v
tests/local_instance.v
tests/lock.v
tests/interleave_context.v
tests/not_same_key.v
#tests/factory_sort.v
tests/hb_pack.v
tests/declare.v
tests/short.v
tests/instance_before_structure.v
tests/primitive_records.v
tests/non_forgetful_inheritance.v
tests/fix_loop.v
tests/test_synthesis_params.v
tests/hnf.v
tests/fun_instance.v
tests/issue284.v
tests/issue287.v
tests/two_hier.v
tests/instance_merge_with_param.v
tests/instance_merge_with_distinct_param.v
tests/instance_merge.v
tests/unit/enrich_type.v
tests/unit/mixin_src_has_mixin_instance.v
tests/unit/mk_src_map.v
tests/unit/close_hole_term.v
tests/unit/struct.v
tests/factory_when_notation.v
-R tests HB.tests
-R examples HB.examples
-Q . HB hierarchy-builder-1.7.0/build-support/ 0000775 0000000 0000000 00000000000 14547515630 0017744 5 ustar 00root root 0000000 0000000 hierarchy-builder-1.7.0/build-support/coq/ 0000775 0000000 0000000 00000000000 14547515630 0020526 5 ustar 00root root 0000000 0000000 hierarchy-builder-1.7.0/build-support/coq/extra-lib.nix 0000664 0000000 0000000 00000007772 14547515630 0023152 0 ustar 00root root 0000000 0000000 { lib }:
with builtins; with lib; recursiveUpdate lib (rec {
versions =
let
truncate = n: v: concatStringsSep "." (take n (splitVersion v));
opTruncate = op: v0: v: let n = length (splitVersion v0); in
op (truncate n v) (truncate n v0);
in rec {
/* Get string of the first n parts of a version string.
Example:
- truncate 2 "1.2.3-stuff"
=> "1.2"
- truncate 4 "1.2.3-stuff"
=> "1.2.3.stuff"
*/
inherit truncate;
/* Get string of the first three parts (major, minor and patch)
of a version string.
Example:
majorMinorPatch "1.2.3-stuff"
=> "1.2.3"
*/
majorMinorPatch = truncate 3;
/* Version comparison predicates,
- isGe v0 v <-> v is greater or equal than v0 [*]
- isLe v0 v <-> v is lesser or equal than v0 [*]
- isGt v0 v <-> v is strictly greater than v0 [*]
- isLt v0 v <-> v is strictly lesser than v0 [*]
- isEq v0 v <-> v is equal to v0 [*]
- range low high v <-> v is between low and high [**]
[*] truncating v to the same number of digits as v0
[**] truncating v to low for the lower bound and high for the upper bound
Examples:
- isGe "8.10" "8.10.1"
=> true
- isLe "8.10" "8.10.1"
=> true
- isGt "8.10" "8.10.1"
=> false
- isGt "8.10.0" "8.10.1"
=> true
- isEq "8.10" "8.10.1"
=> true
- range "8.10" "8.11" "8.11.1"
=> true
- range "8.10" "8.11+" "8.11.0"
=> false
- range "8.10" "8.11+" "8.11+beta1"
=> false
*/
isGe = opTruncate versionAtLeast;
isGt = opTruncate (flip versionOlder);
isLe = opTruncate (flip versionAtLeast);
isLt = opTruncate versionOlder;
isEq = opTruncate pred.equal;
range = low: high: pred.inter (versions.isGe low) (versions.isLe high);
};
/* Returns a list of list, splitting it using a predicate.
This is analoguous to builtins.split sep list,
with a predicate as a separator and a list instead of a string.
Type: splitList :: (a -> bool) -> [a] -> [[a]]
Example:
splitList (x: x == "x") [ "y" "x" "z" "t" ]
=> [ [ "y" ] "x" [ "z" "t" ] ]
*/
splitList = pred: l: # put in file lists
let loop = (vv: v: l: if l == [] then vv ++ [v]
else let hd = head l; tl = tail l; in
if pred hd then loop (vv ++ [ v hd ]) [] tl else loop vv (v ++ [hd]) tl);
in loop [] [] l;
pred = {
/* Predicate intersection, union, and complement */
inter = p: q: x: p x && q x;
union = p: q: x: p x || q x;
compl = p: x: ! p x;
true = p: true;
false = p: false;
/* predicate "being equal to y" */
equal = y: x: x == y;
};
/* Emulate a "switch - case" construct,
instead of relying on `if then else if ...` */
/* Usage:
```nix
switch-if [
if-clause-1
..
if-clause-k
] default-out
```
where a if-clause has the form `{ cond = b; out = r; }`
the first branch such as `b` is true */
switch-if = c: d: (findFirst (getAttr "cond") {} c).out or d;
/* Usage:
```nix
switch x [
simple-clause-1
..
simple-clause-k
] default-out
```
where a simple-clause has the form `{ case = p; out = r; }`
the first branch such as `p x` is true
or
```nix
switch [ x1 .. xn ] [
complex-clause-1
..
complex-clause-k
] default-out
```
where a complex-clause is either a simple-clause
or has the form { cases = [ p1 .. pn ]; out = r; }
in which case the first branch such as all `pi x` are true
if the variables p are not functions,
they are converted to a equal p
if out is missing the default-out is taken */
switch = var: clauses: default: with pred; let
compare = f: if isFunction f then f else equal f;
combine = cl: var:
if cl?case then compare cl.case var
else all (equal true) (zipListsWith compare cl.cases var); in
switch-if (map (cl: { cond = combine cl var; inherit (cl) out; }) clauses) default;
})
hierarchy-builder-1.7.0/build-support/coq/meta-fetch/ 0000775 0000000 0000000 00000000000 14547515630 0022543 5 ustar 00root root 0000000 0000000 hierarchy-builder-1.7.0/build-support/coq/meta-fetch/default.nix 0000664 0000000 0000000 00000005731 14547515630 0024715 0 ustar 00root root 0000000 0000000 { lib, stdenv, fetchzip }@args:
let lib' = lib; in
let lib = import ../extra-lib.nix {lib = lib';}; in
with builtins; with lib;
let
default-fetcher = {domain ? "github.com", owner ? "", repo, rev, name ? "source", sha256 ? null, ...}@args:
let ext = if args?sha256 then "zip" else "tar.gz";
fmt = if args?sha256 then "zip" else "tarball";
pr = match "^#(.*)$" rev;
url = switch-if [
{ cond = isNull pr && !isNull (match "^github.*" domain);
out = "https://${domain}/${owner}/${repo}/archive/${rev}.${ext}"; }
{ cond = !isNull pr && !isNull (match "^github.*" domain);
out = "https://api.${domain}/repos/${owner}/${repo}/${fmt}/pull/${head pr}/head"; }
{ cond = isNull pr && !isNull (match "^gitlab.*" domain);
out = "https://${domain}/${owner}/${repo}/-/archive/${rev}/${repo}-${rev}.${ext}"; }
{ cond = !isNull (match "(www.)?mpi-sws.org" domain);
out = "https://www.mpi-sws.org/~${owner}/${repo}/download/${repo}-${rev}.${ext}";}
] (throw "meta-fetch: no fetcher found for domain ${domain} on ${rev}");
fetch = x: if args?sha256 then fetchzip (x // { inherit sha256; }) else fetchTarball x;
in fetch { inherit url ; };
in
{
fetcher ? default-fetcher,
location,
release ? {},
releaseRev ? (v: v),
}:
let isVersion = x: isString x && match "^/.*" x == null && release?${x};
shortVersion = x: if (isString x && match "^/.*" x == null)
then findFirst (v: versions.majorMinor v == x) null
(sort versionAtLeast (attrNames release))
else null;
isShortVersion = x: shortVersion x != null;
isPathString = x: isString x && match "^/.*" x != null && pathExists x; in
arg:
switch arg [
{ case = isNull; out = { version = "broken"; src = ""; broken = true; }; }
{ case = isPathString; out = { version = "dev"; src = arg; }; }
{ case = pred.union isVersion isShortVersion;
out = let v = if isVersion arg then arg else shortVersion arg; in
let
given-sha256 = release.${v}.sha256 or "";
sha256 = if given-sha256 == "" then lib.fakeSha256 else given-sha256;
rv = release.${v} // { inherit sha256; }; in
{
version = rv.version or v;
src = rv.src or fetcher (location // { rev = releaseRev v; } // rv);
};
}
{ case = isString;
out = let
splitted = filter isString (split ":" arg);
rev = last splitted;
has-owner = length splitted > 1;
version = "dev"; in {
inherit version;
src = fetcher (location // { inherit rev; } //
(optionalAttrs has-owner { owner = head splitted; }));
}; }
{ case = isAttrs;
out = let
{ version = arg.version or "dev";
src = (arg.fetcher or fetcher) (location // (arg.location or {}));
}; }
{ case = isPath;
out = {
version = "dev" ;
src = builtins.path {path = arg; name = location.name or "source";}; }; }
] (throw "not a valid source description")
hierarchy-builder-1.7.0/coq-hierarchy-builder.opam 0000664 0000000 0000000 00000002130 14547515630 0022167 0 ustar 00root root 0000000 0000000 opam-version: "2.0"
name: "coq-hierarchy-builder"
version: "dev"
maintainer: "Enrico Tassi "
authors: [ "Cyril Cohen" "Kazuhiko Sakaguchi" "Enrico Tassi" ]
license: "MIT"
homepage: "https://github.com/math-comp/hierarchy-builder"
bug-reports: "https://github.com/math-comp/hierarchy-builder/issues"
dev-repo: "git+https://github.com/math-comp/hierarchy-builder"
build: [ [ make "build"]
[ make "test-suite" ] {with-test}
]
install: [ make "install" ]
depends: [ "coq-elpi" { (>= "2.0") | = "dev" } ]
conflicts: [ "coq-hierarchy-builder-shim" ]
synopsis: "High level commands to declare and evolve a hierarchy based on packed classes"
description: """
Hierarchy Builder is a high level language to build hierarchies of algebraic structures and make these
hierarchies evolve without breaking user code. The key concepts are the ones of factory, builder
and abbreviation that let the hierarchy developer describe an actual interface for their library.
Behind that interface the developer can provide appropriate code to ensure retro compatibility.
"""
tags: [ "logpath:HB" ]
hierarchy-builder-1.7.0/default.nix 0000664 0000000 0000000 00000000661 14547515630 0017302 0 ustar 00root root 0000000 0000000 { config ? {}, withEmacs ? false, print-env ? false, do-nothing ? false,
update-nixpkgs ? false, ci-matrix ? false,
override ? {}, ocaml-override ? {}, global-override ? {},
bundle ? null, job ? null, inNixShell ? null, src ? ./.,
}@args:
let auto = fetchGit {
url = "https://github.com/coq-community/coq-nix-toolbox.git";
ref = "master";
rev = import .nix/coq-nix-toolbox.nix;
};
in
import auto ({inherit src;} // args)
hierarchy-builder-1.7.0/examples/ 0000775 0000000 0000000 00000000000 14547515630 0016751 5 ustar 00root root 0000000 0000000 hierarchy-builder-1.7.0/examples/Coq2020_material/ 0000775 0000000 0000000 00000000000 14547515630 0021655 5 ustar 00root root 0000000 0000000 hierarchy-builder-1.7.0/examples/Coq2020_material/CoqWS_abstract.v 0000664 0000000 0000000 00000005415 14547515630 0024730 0 ustar 00root root 0000000 0000000 (* Accompanying material to Coq workshop presentation *)
From Coq Require Import ssreflect ssrfun ZArith.
From HB Require Import structures.
HB.mixin Record CMonoid_of_Type A := { (* The set of axioms making A a commutative monoid. *)
zero : A; add : A -> A -> A;
addrA : associative add; (* `add` is associative *)
addrC : commutative add; (* `add` is commutative *)
add0r : left_id zero add; (* `zero` is a neutral element *)
}.
HB.structure Definition CMonoid := { A of CMonoid_of_Type A }. (* The structure thereof. *)
Notation "0" := zero.
Infix "+" := add.
(* The type of the operations and axioms depend on a CMonoid.type structure. *)
Check addrC. (* ?M : CMonoid.type |- commutative (@add ?M) *)
HB.mixin Record AbelianGrp_of_CMonoid A of CMonoid A := {
opp : A -> A;
(* We can write `add` here since A is a CMonoid *)
addNr : left_inverse zero opp add; (* `opp` is the additive inverse *)
}.
HB.structure Definition AbelianGrp := { A of AbelianGrp_of_CMonoid A }.
Notation "- x" := (opp x).
Notation "x - y" := (add x (opp y)).
HB.mixin Record SemiRing_of_CMonoid A of CMonoid A := {
one : A;
mul : A -> A -> A;
mulrA : associative mul; (* `mul` is associative *)
mul1r : left_id one mul; (* `one` is left neutral *)
mulr1 : right_id one mul; (* `one` is right neutral *)
mulrDl : left_distributive mul add; (* `mul` distributes over *)
mulrDr : right_distributive mul add; (* `add` on both sides *)
mul0r : left_zero zero mul; (* `zero` is absorbing `mul` *)
mulr0 : right_zero zero mul; (* on both sides *)
}.
HB.structure Definition SemiRing := { A of SemiRing_of_CMonoid A }.
Notation "1" := one.
Infix "*" := mul.
(* We need no additional mixin to declare the Ring structure. *)
HB.structure Definition Ring := { A of SemiRing_of_CMonoid A & AbelianGrp_of_CMonoid A }.
(* An example statement in the signature of an Abelian group G, combining 0 and -. *)
Check forall G : AbelianGrp.type, forall x : G, x - x = 0.
(* An example statement in the signature of a Semiring S, combining 0, +, and *. *)
Check forall S : SemiRing.type, forall x : S, x * 1 + 0 = x.
(* An example statement in the signature of a Ring R, combining -, 1 and *. *)
Check forall R : Ring.type, forall x y : R, x * - (1 * y) = - x * y.
HB.instance Definition Z_CMonoid := CMonoid_of_Type.Build Z 0%Z Z.add
Z.add_assoc Z.add_comm Z.add_0_l.
HB.instance Definition Z_AbelianGrp := AbelianGrp_of_CMonoid.Build Z Z.opp Z.add_opp_diag_l.
HB.instance Definition Z_SemiRing := SemiRing_of_CMonoid.Build Z 1%Z Z.mul
Z.mul_assoc Z.mul_1_l Z.mul_1_r Z.mul_add_distr_r Z.mul_add_distr_l Z.mul_0_l Z.mul_0_r.
(* An example statement in the signature of the Z ring, combining Z, 0, +, -, 1 and * *)
Check forall x : Z, x * - (1 + x) = 0 + 1.
hierarchy-builder-1.7.0/examples/Coq2020_material/CoqWS_demo.v 0000664 0000000 0000000 00000014547 14547515630 0024057 0 ustar 00root root 0000000 0000000 (* Accompanying material to Coq workshop presentation *)
From Coq Require Import ssreflect ssrfun ZArith.
From HB Require Import structures.
Set Warnings "-redundant-canonical-projection".
(* ****************************************************** *)
(* ******** 1. Building the hierarchy ********** *)
(* ****************************************************** *)
(* ********************************************************
The set of axioms that turn a naked type A
into a Commutative Monoid.
This would be the puzzle piece.
*)
HB.mixin (* an HB command *)
Record CMonoid_of_Type A := { (* and its argument *)
zero : A;
add : A -> A -> A;
addrA : associative add;
addrC : commutative add;
add0r : left_id zero add;
}.
(* ********************************************************
The structure of Commutative Monoids
This would be the blue dotted box
Note: { A of ... } is just a notation for a sigma type
*)
HB.structure
Definition CMonoid := { A of CMonoid_of_Type A }.
(* ********************************************************
Monoid playground
*)
(* Operations are now available *)
Check add.
(* Axioms are also there *)
Check addrC.
(* We can develop the abstract theory of CMonoid *)
Notation "0" := zero.
Infix "+" := add.
Lemma silly :
forall (M : CMonoid.type) (x : M), x + 0 = 0 + x.
Proof. by move=> M x; rewrite addrC. Qed.
(* ********************************************************
The puzzle piece on the right and the AbelianGrp str.
Note: it requires A to be a monoid, indeed the property
talk about both add and opp
*)
HB.mixin
Record AbelianGrp_of_CMonoid A of CMonoid A := {
opp : A -> A;
addNr : left_inverse zero opp add;
}.
HB.structure
Definition AbelianGrp := { A of AbelianGrp_of_CMonoid A }.
Notation "- x" := (opp x).
Notation "x - y" := (add x (opp y)).
(* Quick check that - and + and 0 are compatible *)
Check forall x y, x - (y + 0) = x.
(* ********************************************************
The puzzle piece on the left and the SemiRing str.
*)
HB.mixin
Record SemiRing_of_CMonoid A of CMonoid A := {
one : A;
mul : A -> A -> A;
mulrA : associative mul;
mul1r : left_id one mul;
mulr1 : right_id one mul;
mulrDl : left_distributive mul add;
mulrDr : right_distributive mul add;
mul0r : left_zero zero mul;
mulr0 : right_zero zero mul;
}.
HB.structure
Definition SemiRing := { A of SemiRing_of_CMonoid A & }.
Notation "1" := one.
Infix "*" := mul.
(* Quick check that + and 1 and * are compatible *)
Check forall x y, 1 + x = y * x.
(* ********************************************************
Can I mix * and - in the same expression?
*)
Fail Check forall x y, 1 * x = y - x.
(* ********************************************************
The missing structure, no puzzle piece is missing
*)
HB.structure
Definition Ring := { A of SemiRing A & AbelianGrp A }.
Check forall (R : Ring.type) (x y : R), 1 * x = y - x.
Check forall x y, 1 * x = y - x.
(* ****************************************************** *)
(* ******** 2. Declaring instances ******** *)
(* ****************************************************** *)
(* ******************************************************
Inhabiting the puzzle pieces with Z
*)
Module Z_instances.
HB.instance
Definition Z_CMonoid := CMonoid_of_Type.Build Z
0%Z Z.add Z.add_assoc Z.add_comm Z.add_0_l.
HB.instance
Definition Z_AbelianGrp := AbelianGrp_of_CMonoid.Build Z
Z.opp Z.add_opp_diag_l.
HB.instance
Definition Z_SemiRing := SemiRing_of_CMonoid.Build Z
1%Z Z.mul Z.mul_assoc Z.mul_1_l Z.mul_1_r
Z.mul_add_distr_r Z.mul_add_distr_l Z.mul_0_l Z.mul_0_r.
(* Now Z is recognized as a Ring *)
Check forall x : Z, x * - (1 + x) = 0 + 1.
End Z_instances.
(* ****************************************************** *)
(* ********** 3. Being nice with users ******** *)
(* ****************************************************** *)
(* ********************************************************
Crafting special builders
We provide an API to build a ring directly.
A factory is a ''virtual'' puzzle piece that can be
''compiled'' to other puzzle pieces.
*)
HB.factory
Record Ring_of_Type A := {
zero : A;
add : A -> A -> A;
opp : A -> A;
one : A;
mul : A -> A -> A;
addrA : associative add;
(*addrC : commutative add; *)
add0r : left_id zero add;
addr0 : right_id zero add; (* new *)
addNr : left_inverse zero opp add;
addrN : right_inverse zero opp add; (* new *)
mulrA : associative mul;
mul1r : left_id one mul;
mulr1 : right_id one mul;
mulrDl : left_distributive mul add;
mulrDr : right_distributive mul add;
mul0r : left_zero zero mul;
mulr0 : right_zero zero mul;
}.
(* The ''compilation'' of a factory *)
HB.builders
Context A of Ring_of_Type A.
(* We are in a Context with a type A that with operations
and properties, but which is not yet known to be a Ring *)
Check add.
Local Infix "+" := add.
(* We prove commutativity as per Hankel 1867 *)
Lemma addrC : commutative add.
Proof.
have innerC (a b : A) : a + b + (a + b) = a + a + (b + b).
by rewrite -[a + b]mul1r -mulrDl mulrDr !mulrDl !mul1r.
have addKl (a b c : A) : a + b = a + c -> b = c.
apply: can_inj (add a) (add (opp a)) _ _ _.
by move=> x; rewrite addrA addNr add0r.
have addKr (a b c : A) : b + a = c + a -> b = c.
apply: can_inj (add ^~ a) (add ^~ (opp a)) _ _ _.
by move=> x; rewrite /= -addrA addrN addr0.
move=> x y; apply: addKl (x) _ _ _; apply: addKr (y) _ _ _.
by rewrite -!addrA [in RHS]addrA innerC !addrA.
Qed.
HB.instance
Definition A_CMonoid := CMonoid_of_Type.Build A
zero add addrA addrC add0r.
HB.instance
Definition A_AbelianGrp := AbelianGrp_of_CMonoid.Build A
opp addNr.
HB.instance
Definition A_SemiRing := SemiRing_of_CMonoid.Build A
one mul mulrA mul1r mulr1 mulrDl mulrDr mul0r mulr0.
HB.end.
(* Let's use the new builder *)
Module Z_instances_again.
HB.instance
Definition Z_Ring := Ring_of_Type.Build Z
0%Z Z.add Z.opp 1%Z Z.mul
Z.add_assoc (* Z.add_comm *) Z.add_0_l Z.add_0_r
Z.add_opp_diag_l Z.add_opp_diag_r
Z.mul_assoc Z.mul_1_l Z.mul_1_r
Z.mul_add_distr_r Z.mul_add_distr_l Z.mul_0_l Z.mul_0_r.
Check forall x : Z, x * - (1 + x) = 0 + 1.
End Z_instances_again.
hierarchy-builder-1.7.0/examples/Coq2020_material/CoqWS_expansion/ 0000775 0000000 0000000 00000000000 14547515630 0024735 5 ustar 00root root 0000000 0000000 hierarchy-builder-1.7.0/examples/Coq2020_material/CoqWS_expansion/withHB.v 0000664 0000000 0000000 00000001170 14547515630 0026310 0 ustar 00root root 0000000 0000000 (* Accompanying material to Coq workshop presentation *)
From Coq Require Import ssreflect ssrfun ZArith.
From HB Require Import structures.
Set Warnings "-redundant-canonical-projection".
HB.mixin
Record CMonoid_of_Type A := {
zero : A;
add : A -> A -> A;
addrA : associative add;
addrC : commutative add;
add0r : left_id zero add;
}.
HB.structure
Definition CMonoid := { A of CMonoid_of_Type A }.
HB.mixin
Record AbelianGrp_of_CMonoid A of CMonoid A := {
opp : A -> A;
addNr : left_inverse zero opp add;
}.
HB.structure
Definition AbelianGrp := { A of AbelianGrp_of_CMonoid A & }.
hierarchy-builder-1.7.0/examples/Coq2020_material/CoqWS_expansion/withoutHB.v 0000664 0000000 0000000 00000007661 14547515630 0027053 0 ustar 00root root 0000000 0000000 (* Accompanying material to Coq workshop presentation *)
From Coq Require Import ssreflect ssrfun ZArith.
From HB Require Import structures.
Set Warnings "-redundant-canonical-projection".
(* Helpers *)
Notation "[unify t1 'with' t2 ]" := (unify _ _ t1 t2 _)
(at level 0, format "[unify t1 'with' t2 ]", only printing).
Notation "[unify t1 'with' t2 ]" := (unify _ _ t1 t2 NoMsg)
(at level 0, format "[unify t1 'with' t2 ]", only parsing).
Module CMonoid_of_Type.
Section CMonoid_of_Type.
Variable (A : Type).
Record axioms_ : Type := Axioms_ {
zero : A;
add : A -> A -> A;
addrA : associative add;
addrC : commutative add;
add0r : left_id zero add
}.
Definition phant_Build (zero : A) (add : A -> A -> A)
(addrA : associative add) (addrC : commutative add) :=
[eta CMonoid_of_Type.Axioms_ zero add addrA addrC].
Definition phant_axioms := CMonoid_of_Type.axioms_.
End CMonoid_of_Type.
Notation Build A := (phant_Build A).
Notation axioms A := (phant_axioms A).
Module Exports.
Notation CMonoid_of_Type A := (axioms A).
End Exports.
End CMonoid_of_Type.
Export CMonoid_of_Type.Exports.
Module CMonoid.
Record axioms (A : Type) : Type := Class
{ CMonoid_of_Type_mixin : CMonoid_of_Type.axioms_ A }.
Record type : Type := Pack { sort : Type; class : axioms sort }.
Module Exports.
Coercion sort : type >-> Sortclass.
Definition zero {s : type} := CMonoid_of_Type.zero _
(CMonoid_of_Type_mixin _ (class s)).
Definition add {s : type} (x y : s) : s := CMonoid_of_Type.add _
(CMonoid_of_Type_mixin _ (class s)) x y.
Definition addrA {s : type} : associative add :=
CMonoid_of_Type.addrA _ (CMonoid_of_Type_mixin _ (class s)).
Definition addrC {s : type} : commutative add :=
CMonoid_of_Type.addrC _ (CMonoid_of_Type_mixin _ (class s)).
Definition add0r {s : type} : left_id zero add :=
CMonoid_of_Type.add0r _ (CMonoid_of_Type_mixin _ (class s)).
End Exports.
End CMonoid.
Export CMonoid.Exports.
Module AbelianGrp_of_CMonoid.
Section AbelianGrp_of_CMonoid.
Variable (A : Type).
Notation M m := (CMonoid.Pack A (CMonoid.Class A m)).
Record axioms_ (m : CMonoid_of_Type.axioms_ A) := Axioms_ {
opp : A -> A;
addNr : left_inverse (@zero (M m)) opp (@add (M m))
}.
Definition phant_Build :=
fun (s : CMonoid.type) of [unify A with CMonoid.sort s] =>
fun (c : CMonoid.axioms A) of [unify s with CMonoid.Pack A c] =>
fun (m : CMonoid_of_Type.axioms_ A) of [unify c with CMonoid.Class A m] =>
fun (opp : A -> A) (addNr : left_inverse (@zero (M m)) opp (@add (M m))) =>
Axioms_ m opp addNr.
Definition phant_axioms :=
fun (s : CMonoid.type) of [unify A with CMonoid.sort s] =>
fun (c : CMonoid.axioms A) of [unify s with CMonoid.Pack A c] =>
fun (m : CMonoid_of_Type.axioms_ A) of [unify c with CMonoid.Class A m] =>
axioms_ m.
End AbelianGrp_of_CMonoid.
Notation Build A := (phant_Build A _ id_phant _ id_phant _ id_phant).
Notation axioms A := (phant_axioms A _ id_phant _ id_phant _ id_phant).
Module Exports.
Notation AbelianGrp_of_CMonoid A := (axioms A).
End Exports.
End AbelianGrp_of_CMonoid.
Export AbelianGrp_of_CMonoid.Exports.
Module AbelianGrp.
Record axioms (A : Type) : Type := Class
{ CMonoid_of_Type_mixin : CMonoid_of_Type.axioms_ A;
AbelianGrp_of_CMonoid_mixin : AbelianGrp_of_CMonoid.axioms_ A
CMonoid_of_Type_mixin }.
Record type : Type := Pack { sort : Type; class : axioms sort }.
Module Exports.
Coercion sort : type >-> Sortclass.
Coercion AbelianGrp_class_to_CMonoid_class (A : Type)
(c : axioms A) := CMonoid.Class A (CMonoid_of_Type_mixin A c).
Coercion AbelianGrp_to_CMonoid (A : AbelianGrp.type) :=
CMonoid.Pack A (class A).
Canonical AbelianGrp_to_CMonoid.
Definition opp {s : type} (x : s) : s := AbelianGrp_of_CMonoid.opp _ _
(AbelianGrp_of_CMonoid_mixin _ (class s)) x.
Definition addNr {s : type} : left_inverse (@zero s) opp (@add s) :=
AbelianGrp_of_CMonoid.addNr _ _ (AbelianGrp_of_CMonoid_mixin _ (class s)).
End Exports.
End AbelianGrp.
Export AbelianGrp.Exports.
hierarchy-builder-1.7.0/examples/Coq2020_material/diagram.pdf 0000664 0000000 0000000 00000120073 14547515630 0023757 0 ustar 00root root 0000000 0000000 %PDF-1.5
%
4 0 obj
<< /Length 5 0 R
/Filter /FlateDecode
>>
stream
xͮ%=%6c8'x`{8vZ{*у[Y