arthuraa / deriving Goto Github PK
View Code? Open in Web Editor NEWClass instances for Coq inductive types with little boilerplate
License: MIT License
Class instances for Coq inductive types with little boilerplate
License: MIT License
Hi there,
In Kôika we have been deriving instances of custom EqDec and FiniteType typeclasses using Ltac, and the code is neither fast nor pretty, so I got intrigued by your Discourse announcement. Do you have tips on dealing with the following error? (I used the eqtype example from the readme on one of our types.
In environment
x : phantom Type reg_t
The term "x" has type "phantom Type reg_t" while it is expected to have type "phantom Type ?sT'".
The type that I'm looking at:
Inductive reg_t : Type :=
toIMem : MemReq.reg_t -> reg_t
| fromIMem : MemResp.reg_t -> reg_t
| toDMem : MemReq.reg_t -> reg_t
| fromDMem : MemResp.reg_t -> reg_t
| f2d : fromFetch.reg_t -> reg_t
| f2dprim : waitFromFetch.reg_t -> reg_t
| d2e : fromDecode.reg_t -> reg_t
| e2w : fromExecute.reg_t -> reg_t
| rf : Rf.reg_t -> reg_t
| mulState : Multiplier.reg_t -> reg_t
| scoreboard : Scoreboard.reg_t -> reg_t
| cycle_count : reg_t
| instr_count : reg_t
| pc : reg_t
| epoch : reg_t
The first few constructors have parameters ….reg_t
which are all relatively simple; for example:
Print MemReq.reg_t.
Inductive reg_t : Set := data0 : MemReq.reg_t | valid0 : MemReq.reg_t
Although the Rf.reg_t
one is more complicated:
Print Rf.reg_t.
Inductive reg_t : Type := rData : index Rf.sz -> Rf.reg_t
(index
is our fixpoint-based equivalent of Fin.t
)
Let me know if you would like a pointer to the code.
I roughly understand from the surface (from here) that it throws an error if it does not satisfy the requirements for finType.
So i have a type that I have managed to successfully use deriving to prove it to be a choiceType. Using the record subtype functionality in mathcomp, I want to prove that this subtype is a finType using the following record type,
Record mysubtype (s : seq cT) := {val:> cT ; _ : contains s val == true}.
which says that I have a sequence of the choiceType, and it is subtype to mysubtype
it is in s : seq cT
. I understand that from choiceType onwards, the mixin for solely dependent on fK : cancel f f'
as input to CanChoiceMixin
or PcanChoiceMixin
. I was thinking could my problem be solved by taking the fK
proofs (that deriving has proven) and use it to derive the mixins for mysubtype
to make it a finType.
Many thanks in advance!
The Coq team released Coq 8.19.0
on January 24th, 2024.
The corresponding Coq Platform release 2024.01
should be released before April 30th, 2024.
It can be delayed in case of difficulties until May 15th, 2024, but this should be an exception.
This issue is to inform you that the opam package we are currently testing in Coq Platform CI works fine with Coq 8.19.0
.
Coq Platform CI is currently testing opam package coq-deriving.0.2.0
from official repository https://coq.inria.fr/opam/released/packages/coq-deriving/coq-deriving.0.2.0/opam.
In case this is the version you want to see in Coq Platform, there is nothing to do for you - please just close this issue.
In case you would prefer to see an updated or an older version in the upcoming Coq Platform 2024.01
, please inform us as soon as possible and before March 31st, 2024!
The working branch of Coq Platform, can be found here main.
It contains package pick ~8.19~2024.01+beta1
which already supports Coq version 8.19.0
and contains already working (possibly patched / commit pinned) Coq Platform packages.
In case you want to select a different version, please don't close this issue, even after creating the new tag and/or opam package.
We will close the issue after updating Coq Platform.
This is a measure of 'double book keeping' in order to avoid that we ship the wrong version.
In any case, Coq Platform won't be released before this issue is closed!
Thanks!
P.S.: this issue has been created automatically based on CI status.
CC: coq/platform#405
There's a porting guide.
Coq 8.10.2
mathcomp-ssreflect 1.9.0
coq-void 0.1.0
Trying to get run the README
example running after having the above installed but run into error in
Definition foo_eqMixin := Eval simpl in [derive eqMixin for foo].
with the error message
Error: In environment x : phantom signature (base.PolyType.cons (base.PolyType.cons (NonRec nat) base.PolyType.nil) base.PolyType.nil) The term "x" has type "phantom signature (base.PolyType.cons (base.PolyType.cons (NonRec nat) base.PolyType.nil) base.PolyType.nil)" while it is expected to have type "phantom signature ?sΣ".
Any ideas what I'm missing to get the error? Thanks
The Coq team released Coq 8.16+rc1
on June 01, 2022.
The corresponding Coq Platform release 2022.09
should be released before September 15, 2022.
It can be delayed in case of difficulties until October 15, 2022, but this should be an exception.
This issue is to inform you that the opam package we are currently testing in Coq Platform CI works fine with Coq 8.16+rc1
.
Coq Platform CI is currently testing opam package coq-deriving.0.1.0
from platform patch repository https://github.com/coq/platform/tree/main/opam/opam-coq-archive/released/packages/coq-deriving/coq-deriving.0.1.0/opam. This means we had to weaken some version restrictions in the opam package, but no other changes were required.
In case this is the version you want to see in Coq Platform, there is nothing to do for you - please just close this issue.
In case you would prefer to see an updated or an older version in the upcoming Coq Platform 2022.09
, please inform us as soon as possible and before August 31, 2022!
The working branch of Coq Platform, can be found here main.
It contains package pick ~8.16+rc1~2022.09~preview1
which already supports Coq version 8.16+rc1
and contains already working (possibly patched / commit pinned) Coq Platform packages.
In case you want to select a different version, please don't close this issue, even after creating the new tag and/or opam package.
We will close the issue after updating Coq Platform.
This is a measure of 'double book keeping' in order to avoid that we ship the wrong version.
In any case, Coq Platform won't be released before this issue is closed!
Thanks!
P.S.: this issue has been created automatically based on CI status.
CC: coq/platform#274
Dear Coq-Deriving Team,
@anton-trunov requested here: (coq/platform#114) to include your development into the Coq Platform, which is the standard user facing distribution of Coq.
Coq Platform has a "full" and "extended" level. Since your development currently appears to be in a beta stage (the latest opam package has a 0.X version number), we can only included it in the "extended" level. Besides a non beta release, inclusion in the "full" level requires an explicit statement by the maintainers, that they agree to the charter of the Coq Platform and intend to publish compatible releases for each release of Coq in a reasonable time frame. For the "extended" level the rules are more relaxed, but we would expect that you intend to bring your debelopment to a "release" level, so that in some future it can be included in the "full" level.
Can you please comment in the Coq Platform issue mentioned above if you do want your package included in the Coq Platform "extended" level and what your future intentions are?
Best regards,
Michael
The Coq team released Coq 8.14+rc1 on September 17, 2021 and plans to release Coq 8.14.0 before October 31, 2021.
The corresponding Coq Platform release 2021.11 should be released before November 30, 2021.
It can be delayed in case of difficulties until January 31, 2022, but this should be an exception.
This issue is to inform you that the opam package we are currently testing in Coq Platform CI works fine with Coq 8.14+rc1.
Coq Platform CI is currently testing opam package coq-deriving.0.1.0~flex
from platform patch repository https://github.com/coq/platform/tree/main/opam/opam-coq-archive/extra-dev/packages/coq-deriving/coq-deriving.0.1.0~flex/opam.
Note: The ~flex extension to the opam version means that we had to patch version restrictions in the opam package and possibly the make file to accept the new version of Coq, but no other changes were required.
In case this is the version you want to see in Coq Platform, there is nothing to do for you - please just close this issue.
In case you would prefer to see an updated or an older version in the upcoming Coq Platform 2021.11, please inform us as soon as possible and before November 15, 2021!
The working branch of Coq Platform, which already supports Coq version 8.14+rc1, can be found here https://github.com/coq/platform/tree/main.
In case you want to select a different version, please don't close this issue, even after creating the new tag and/or opam package.
We will close the issue after updating Coq Platform.
This is a measure of 'double book keeping' in order to avoid that we ship the wrong version.
In any case, Coq Platform won't be released before this issue is closed!
Thanks!
P.S.: this issue has been created automatically based on CI status.
CC: coq/platform#139
Hi @arthuraa,
While using docker coq action to test my software development which involves using your deriving
library, I encounter some problems.
With the following specifications in my .opam
:
depends: [
"coq" { >= "8.10" }
"coq-mathcomp-ssreflect" {= "1.10.0" | (= "dev")}
"coq-deriving" {= "dev"}
]
and using the image mathcomp/mathcomp:1.10.0-coq-8.10
from https://hub.docker.com/r/mathcomp/mathcomp, my github action return the error message:
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Error: The compilation of coq-deriving failed at "/usr/bin/make -j 2".
#=== ERROR while compiling coq-deriving.dev ===================================#
# context 2.0.7 | linux/x86_64 | ocaml-base-compiler.4.05.0 | https://coq.inria.fr/opam/extra-dev#2021-01-02 16:50
# path ~/.opam/4.05.0/.opam-switch/build/coq-deriving.dev
# command /usr/bin/make -j 2
# exit-code 2
# env-file ~/.opam/log/coq-deriving-109-2dea01.env
# output-file ~/.opam/log/coq-deriving-109-2dea01.out
### output ###
# [...]
# *** Warning: in file theories/instances/order.v, library mathcomp.order is required and has not been found in the loadpath!
# *** Warning: in file theories/instances/order.v, library mathcomp.order is required and has not been found in the loadpath!
# COQC theories/base.v
# COQC theories/ind.v
# COQC theories/tactics.v
# COQC theories/infer.v
# File "./theories/infer.v", line 2, characters 60-65:
# Error: Unable to locate library order with prefix mathcomp.
#
# make[2]: *** [CoqMakefile:659: theories/infer.vo] Error 1
# make[1]: *** [CoqMakefile:321: all] Error 2
# make: *** [Makefile:13: invoke-coqmakefile] Error 2
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build coq-deriving dev
+-
- No changes have been performed
I cannot fully appreciate the error message for me to resolve the issue, thus would you able to help advice/suggest how I can over come this error message?
Thanks!
The Coq team released Coq 8.17+rc1
on December 29th, 2022 and plans to release Coq 8.17.0 around March 7th, 2023.
The corresponding Coq Platform release 2023.03
should be released before April 14th, 2023.
It can be delayed in case of difficulties until June 30, 2023, but this should be an exception.
This issue is to inform you that to our (possibly a few days old) best knowledge the latest released version of your project (0.1.0) does not work with Coq 8.17+rc1
.
We tried to remove version restrictions in opam files and possibly make or configure files, but this did not suffice.
Please note that in Coq Platform CI (unlike Coq CI) we test only released / tagged versions. Coq CI is currently testing commit c86a0a3 on repository https://github.com/arthuraa/deriving - which likely means that this commit does work in Coq CI.
Could you please create a tag and opam package, or communicate us any existing tag that works with Coq branch v8.17, preferably before March 21st, 2023?
In case we might have to delay the Coq Platform release cause of issues with your project, we would prefer to be informed about the situation as early as possible.
In case the tag and opam package are available before March 21st, 2023, it will be included in an early Coq Platform beta release of the for Coq 8.17+rc1.
The working branch of Coq Platform, can be found here main.
It contains package pick ~8.17~2023.03+preview1
which already supports Coq version 8.17+rc1
and contains already working (possibly patched / commit pinned) Coq Platform packages.
Please don't close this issue, even after creating the new tag and/or opam package.
We will close the issue after updating Coq Platform.
This is a measure of 'double book keeping' in order to avoid that we ship the wrong version.
In any case, Coq Platform won't be released before this issue is closed!
Thanks!
P.S.: this issue has been created automatically based on CI status.
CC: coq/platform#335
The Coq team released Coq 8.15.0 on January 13, 2022.
The corresponding Coq Platform release 2022.02 should be released before February 28, 2022.
It can be delayed in case of difficulties until April 11, 2022, but this should be an exception.
This issue is to inform you that the opam package we are currently testing in Coq Platform CI works fine with Coq 8.15.0.
Coq Platform CI is currently testing opam package coq-deriving.0.1.0
from platform patch repository https://github.com/coq/platform/tree/main/opam/opam-coq-archive/released/packages/coq-deriving/coq-deriving.0.1.0/opam.
In case this is the version you want to see in Coq Platform, there is nothing to do for you - please just close this issue.
In case you would prefer to see an updated or an older version in the upcoming Coq Platform 2022.02, please inform us as soon as possible and before February 14, 2022!
The working branch of Coq Platform, which already supports Coq version 8.15.0, can be found here https://github.com/coq/platform/tree/main.
In case you want to select a different version, please don't close this issue, even after creating the new tag and/or opam package.
We will close the issue after updating Coq Platform.
This is a measure of 'double book keeping' in order to avoid that we ship the wrong version.
In any case, Coq Platform won't be released before this issue is closed!
Thanks!
P.S.: this issue has been created automatically based on CI status.
CC: coq/platform#193
The ReadMe at (https://github.com/arthuraa/deriving) states that the opam file for this development lives in the extra-dev
repo, but actually it is in the released
repo.
The Coq team released Coq 8.18.0
on September 7th, 2023.
The corresponding Coq Platform release 2023.10
should be released before November 30th, 2023.
It can be delayed in case of difficulties until January 15th, 2023, but this should be an exception.
This issue is to inform you that the opam package we are currently testing in Coq Platform CI works fine with Coq 8.18.0
.
Coq Platform CI is currently testing opam package coq-deriving.0.2.0
from official repository https://coq.inria.fr/opam/released/packages/coq-deriving/coq-deriving.0.2.0/opam.
In case this is the version you want to see in Coq Platform, there is nothing to do for you - please just close this issue.
In case you would prefer to see an updated or an older version in the upcoming Coq Platform 2023.10
, please inform us as soon as possible and before October 31st, 2023!
The working branch of Coq Platform, can be found here main.
It contains package pick ~8.18+beta1
which already supports Coq version 8.18.0
and contains already working (possibly patched / commit pinned) Coq Platform packages.
In case you want to select a different version, please don't close this issue, even after creating the new tag and/or opam package.
We will close the issue after updating Coq Platform.
This is a measure of 'double book keeping' in order to avoid that we ship the wrong version.
In any case, Coq Platform won't be released before this issue is closed!
Thanks!
P.S.: this issue has been created automatically based on CI status.
CC: coq/platform#372
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.