File: bug_3998.v

package info (click to toggle)
coq 8.16.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 40,596 kB
  • sloc: ml: 219,376; sh: 3,545; python: 3,231; ansic: 2,529; makefile: 767; lisp: 279; javascript: 63; xml: 24; sed: 2
file content (24 lines) | stat: -rw-r--r-- 796 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Class FieldType (F : Set) := mkFieldType { fldTy: F -> Set }.
Hint Mode FieldType + : typeclass_instances. (* The F parameter is an input *)

Inductive I1 := C.
Inductive I2 := .

Instance I1FieldType : FieldType I1 := { fldTy := I1_rect _ bool }.
Instance I2FieldType : FieldType I2 := { fldTy := I2_rect _ }.

Definition RecordOf F (FT: FieldType F) := forall f:F, fldTy f.

Class MapOps (M K : Set) := {
  tgtTy: K -> Set;
  update: M -> forall k:K, tgtTy k -> M
}.

Instance RecordMapOps F (FT: FieldType F) : MapOps (RecordOf F FT) F :=
{ tgtTy := fldTy; update := fun r (f: F) (x: fldTy f) z => r z }.

Axiom ex : RecordOf _ I1FieldType.

Definition works := (fun ex' => update ex' C true) (update ex C false).
Set Typeclasses Debug.
Definition doesnt := update (update ex C false) C true.