Skip to content

Commit

Permalink
Make Var a coercion
Browse files Browse the repository at this point in the history
It was originally not due to failing the "uniform inheritance criteria",
but this criteria is no longer required.

This should ensure that variables are actually printed as strings,
hiding the Var coercion, which will make code much more readable without
the ugly hack of the `Var'` coercions.

The massive fallout is due to removing many coercions Var' that were
defined for specific type parameters, all of which can now use the
single coercion on Var.
  • Loading branch information
tchajed committed Sep 6, 2024
1 parent 56984cd commit abaaea3
Show file tree
Hide file tree
Showing 80 changed files with 1,612 additions and 114 deletions.
1 change: 1 addition & 0 deletions _CoqProject
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
-arg -w -arg -deprecated-typeclasses-transparency-without-locality
# Iris-disabled warnings
-arg -w -arg -notation-overridden,-redundant-canonical-projection,-unknown-warning,-argument-scope-delimiter
-arg -w -arg +ambiguous-paths
-Q external/stdpp/stdpp stdpp
-Q external/stdpp/stdpp_unstable stdpp.unstable
-Q external/stdpp/stdpp_bitvector stdpp.bitvector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

(* 0consts.go *)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition PROGRAM : expr := #(U32 100003).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ From Goose Require github_com.tchajed.marshal.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

(* Package simpledb implements a one-table version of LevelDB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ From Perennial.goose_lang.trusted Require Import github_com.goose_lang.goose.int

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition Bar: val :=
rec: "Bar" <> :=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition Foo: val :=
rec: "Foo" <> :=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition SliceMap (T:ty) (U:ty): val :=
rec: "SliceMap" "f" "s" :=
Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/goose_lang/std.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

(* BytesEqual returns if the two byte slices are equal. *)
Definition BytesEqual: val :=
Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/go_journal/alloc.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

(* Allocator uses a bit map to allocate and free numbers. Bit 0
corresponds to number 0, bit 1 to 1, and so on. *)
Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/go_journal/lockmap.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

(* lockmap is a sharded lock map.
Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/go_journal/util.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition Debug : expr := #0.

Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/go_nfsd/nfstypes.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition PROGRAM : expr := #(U32 100003).

Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/gokv/bank.v
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ From Goose Require github_com.tchajed.marshal.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition BAL_TOTAL : expr := #1000.

Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/gokv/dmvcc/example.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ From Goose Require github_com.mit_pdos.gokv.dmvcc.txnmgr.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition main: val :=
rec: "main" <> :=
Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/gokv/dmvcc/index.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ From Goose Require github_com.mit_pdos.vmvcc.index.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

(* 0_server.go *)

Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/gokv/dmvcc/prophname.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition Get: val :=
rec: "Get" <> :=
Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/gokv/dmvcc/txn.v
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ From Perennial.goose_lang.trusted Require Import github_com.mit_pdos.vmvcc.trust

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition Clerk := struct.decl [
"p" :: ProphIdT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ From Goose Require github_com.mit_pdos.gokv.dmvcc.index.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

(* 0_server.go *)

Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/gokv/dmvcc/txnmgr.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

(* clerk.go *)

Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/gokv/erpc.v
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ From Goose Require github_com.tchajed.marshal.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

(* Implements "exactly-once RPCs" with a reply table. *)

Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/gokv/kv.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition Kv := struct.decl [
"Put" :: (stringT -> stringT -> unitT)%ht;
Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/gokv/lockservice.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ From Goose Require github_com.mit_pdos.gokv.kv.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition LockClerk := struct.decl [
"kv" :: ptrT
Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/gokv/map_marshal.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ From Goose Require github_com.tchajed.marshal.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition EncodeMapU64ToU64: val :=
rec: "EncodeMapU64ToU64" "kvs" :=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ From Goose Require github_com.tchajed.marshal.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition EncodeStringMap: val :=
rec: "EncodeStringMap" "kvs" :=
Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/gokv/tutorial/basics.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition Tracker := struct.decl [
"mu" :: ptrT;
Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/gokv/tutorial/queue.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition Queue := struct.decl [
"queue" :: slice.T uint64T;
Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/gokv/vrsm/e.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ From Goose Require github_com.tchajed.marshal.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Notation Error := uint64T (only parsing).

Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/pav/cryptoffi.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition HashLen : expr := #32.

Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/pav/cryptoutil.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ From Goose Require github_com.mit_pdos.pav.cryptoffi.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Notation Hasher := (slice.T byteT) (only parsing).

Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/pav/marshalutil.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ From Goose Require github_com.tchajed.marshal.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Notation errorTy := boolT (only parsing).

Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/pav/merkle.v
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ From Goose Require github_com.mit_pdos.pav.cryptoutil.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Notation errorTy := boolT (only parsing).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition unit := struct.decl [
].
Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/rsm/distx.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ From Goose Require github_com.goose_lang.std.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition Value := struct.decl [
"b" :: boolT;
Expand Down
1 change: 0 additions & 1 deletion external/Goose/github_com/mit_pdos/rsm/mpaxos.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ From Perennial.goose_lang Require Import prelude.

Section code.
Context `{ext_ty: ext_types}.
Local Coercion Var' s: expr := Var s.

Definition Paxos := struct.decl [
].
Expand Down
Loading

0 comments on commit abaaea3

Please sign in to comment.