| 1 |
(* -*- mode: coq; coq-prog-args: ("-nois") -*- *) |
| 2 |
(* File reduced by coq-bug-finder from original input, then from 286 lines to |
| 3 |
27 lines, then from 224 lines to 53 lines, then from 218 lines to 56 lines, |
| 4 |
then from 269 lines to 180 lines, then from 132 lines to 48 lines, then from |
| 5 |
253 lines to 65 lines, then from 79 lines to 65 lines *) |
| 6 |
(* coqc version 8.6.0 (November 2016) compiled on Nov 12 2016 14:43:52 with |
| 7 |
OCaml 4.02.3 |
| 8 |
coqtop version jgross-Leopard-WS:/home/jgross/Downloads/coq/coq-v8.6,v8.6 |
| 9 |
(7e992fa784ee6fa48af8a2e461385c094985587d) *) |
| 10 |
Axiom admit : forall {T}, T. |
| 11 |
Set Printing Implicit. |
| 12 |
Inductive nat := O | S (_ : nat). |
| 13 |
Axiom f : forall (_ _ : nat), nat. |
| 14 |
Class ZLikeOps (e : nat) |
| 15 |
:= { LargeT : Type ; SmallT : Type ; CarryAdd : forall (_ _ : LargeT), LargeT |
| 16 |
}. |
| 17 |
Class BarrettParameters := |
| 18 |
{ b : nat ; k : nat ; ops : ZLikeOps (f b k) }. |
| 19 |
Axiom barrett_reduce_function_bundled : forall {params : BarrettParameters} |
| 20 |
(_ : @LargeT _ (@ops params)), |
| 21 |
@SmallT _ (@ops params). |
| 22 |
|
| 23 |
Create HintDb typeclass_instances discriminated. |
| 24 |
|
| 25 |
Global Instance ZZLikeOps e : ZLikeOps (f (S O) e) |
| 26 |
:= { LargeT := nat ; SmallT := nat ; CarryAdd x y := y }. |
| 27 |
Definition SRep := nat. |
| 28 |
Local Instance x86_25519_Barrett : BarrettParameters |
| 29 |
:= { b := S O ; k := O ; ops := ZZLikeOps O }. |
| 30 |
Definition SRepAdd : forall (_ _ : SRep), SRep |
| 31 |
:= let v := (fun x y => barrett_reduce_function_bundled (CarryAdd x y)) in |
| 32 |
v. |
| 33 |
Definition SRepAdd' : forall (_ _ : SRep), SRep |
| 34 |
:= (fun x y => barrett_reduce_function_bundled (CarryAdd x y)). |
| 35 |
(* Error: |
| 36 |
In environment |
| 37 |
x : SRep |
| 38 |
y : SRep |
| 39 |
The term "x" has type "SRep" while it is expected to have type |
| 40 |
"@LargeT ?e ?ZLikeOps". |
| 41 |
*) |