Skip to content

Commit

Permalink
Merge pull request #391 from proux01/primitive_class_default
Browse files Browse the repository at this point in the history
Make primitive_class the default
  • Loading branch information
CohenCyril authored Sep 29, 2023
2 parents 2f03016 + 401df0b commit 7d4f095
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- **Removed** the `#[primitive_class]` attribute, making it the default.

## [1.6.0] - 2023-09-20

Compatible with
Expand Down
1 change: 0 additions & 1 deletion HB/common/utils.elpi
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ with-attributes P :-
att "local" bool,
att "fail" bool,
att "doc" string,
att "primitive_class" bool,
att "primitive" bool,
att "non_forgetful_inheritance" bool,
att "hnf" bool,
Expand Down
4 changes: 1 addition & 3 deletions HB/structure.elpi
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,7 @@ declare-class+structure MLwP Sort
synthesize-fields.body ClassDeclaration,

std.assert-ok! (coq.typecheck-indt-decl ClassDeclaration) "declare-class: illtyped",
if (get-option "primitive_class" tt)
(@primitive! => log.coq.env.add-indt ClassDeclaration ClassInd)
(log.coq.env.add-indt ClassDeclaration ClassInd),
(@primitive! => log.coq.env.add-indt ClassDeclaration ClassInd),

coq.env.projections ClassInd Projs,
% TODO: put this code in a named clause
Expand Down
1 change: 0 additions & 1 deletion structures.v
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,6 @@ HB.structure Definition StructureName params :=
- [#[short(type="shortName")]] produces the abbreviation [shortName] for [Structure.type]
- [#[short(pack="shortName")]] produces the abbreviation [shortName] for [HB.pack_for Structure.type]
- [#[primitive]] experimental attribute to make the structure a primitive record,
- [#[primitive_class]] experimental attribute to make the class a primitive record,
- [#[verbose]] for a verbose output.
*)

Expand Down
2 changes: 1 addition & 1 deletion tests/fix_loop.v
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From HB Require Import structures.

HB.mixin Record M A := { x: nat }.
#[primitive_class] HB.structure Definition S := { A of M A }.
HB.structure Definition S := { A of M A }.
6 changes: 3 additions & 3 deletions tests/primitive_records.v
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Elpi Query lp:{{
std.assert! (coq.env.record? Ind tt) "not primitive"
}}.

#[primitive, primitive_class]
#[primitive]
HB.structure Definition A := {T of hasA T}.

Elpi Query lp:{{
Expand All @@ -33,14 +33,14 @@ HB.mixin Record HasMul T := {
mulA: associative mul;
}.

#[primitive, primitive_class]
#[primitive]
HB.structure Definition Mul := { T of HasMul T }.

#[primitive]
HB.mixin Record HasSq T of Mul T := {
sq : T -> T;
pmul : forall x y, sq (mul x y) = mul (sq x) (sq y);
}.
#[primitive, primitive_class]
#[primitive]
HB.structure Definition Sq := { T of HasSq T & Mul T }.
Check erefl : Sq.sort _ = Mul.sort _.

0 comments on commit 7d4f095

Please sign in to comment.