Skip to content

Commit

Permalink
Merge pull request #55 from tchajed/alias-only-parse
Browse files Browse the repository at this point in the history
prior alias gen caused all terms to print as alias. change to use Notation (only parsing).
  • Loading branch information
sanjit-bhat authored Jul 16, 2024
2 parents 20cad8d + 974e7f0 commit d0cf574
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion internal/coq/coq.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,10 @@ type AliasDecl struct {

func (t AliasDecl) CoqDecl() string {
var pp buffer
pp.Add("Notation %s := %s.", t.Name, t.Type.Coq(true))
// (only parsing) so that terms don't get printed as their aliases.
// All aliases get printed as their underlying type, but that seems
// similar to their Go interpretation.
pp.Add("Notation %s := %s (only parsing).", t.Name, t.Type.Coq(true))
return pp.Build()
}

Expand Down
4 changes: 2 additions & 2 deletions internal/examples/semantics/semantics.gold.v
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ Definition testAssignBitwise: val :=

(* closures.go *)

Notation AdderType := (uint64T -> uint64T)%ht.
Notation AdderType := (uint64T -> uint64T)%ht (only parsing).

Notation MultipleArgsType := (uint64T -> boolT -> uint64T)%ht.
Notation MultipleArgsType := (uint64T -> boolT -> uint64T)%ht (only parsing).

Definition adder: val :=
rec: "adder" <> :=
Expand Down
4 changes: 2 additions & 2 deletions internal/examples/unittest/unittest.gold.v
Original file line number Diff line number Diff line change
Expand Up @@ -1121,9 +1121,9 @@ Definition TyMethodDriver: val :=

(* type_alias.go *)

Notation my_u64 := uint64T.
Notation my_u64 := uint64T (only parsing).

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

Definition Timestamp: ty := uint64T.

Expand Down

0 comments on commit d0cf574

Please sign in to comment.