Skip to content

Instantly share code, notes, and snippets.

@yoshihiro503
Last active April 30, 2024 11:47
Show Gist options
  • Save yoshihiro503/4a6e41f4da3763d4af6a573e39e2cf3a to your computer and use it in GitHub Desktop.
Save yoshihiro503/4a6e41f4da3763d4af6a573e39e2cf3a to your computer and use it in GitHub Desktop.
From mathcomp Require Import all_ssreflect.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
(* :> を複数持つと予期せぬことがおきることがあるぞ *)
Structure S : Type := MakeS {
sort2 :> Type;
sort :> Type;
op : sort -> sort -> bool;
}.
Inductive mybool := Yes | No.
Definition natS : S := @MakeS nat nat eqn.
Definition boolS : S := @MakeS mybool bool eqb.
Let f := fun (s : S) (x : s) => x.
Compute @f natS 3.
Compute @f boolS true. (* ←ここでエラー(8,9行目の順番を入れ替えるとエラーにならない) *)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment