Skip to content

Commit

Permalink
Fix minor bug caused by lg constant's move from util_prob to transc
Browse files Browse the repository at this point in the history
Document same in release notes.
  • Loading branch information
mn200 committed Jul 19, 2023
1 parent 4ff0a93 commit 2ee6798
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/next-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ Incompatibilities:
`suminf_def` to reflect its overloading to `suminf`. (All these definitions
are generalized versions of those in `seqTheory`.)

* The constant `lg` (logarithm with base 2) has moved from the `util_prob` theory to `transc`.

* * * * *

<div class="footer">
Expand Down
2 changes: 2 additions & 0 deletions examples/computability/kolmog/kraft_ineqScript.sml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ val _ = new_theory "kraft_ineq";

val _ = intLib.deprecate_int()

val _ = hide "lg" (* transc$lg is now log base 2 *)

Theorem bool_list_card[simp]:
CARD {s | LENGTH (s:bool list) = n} = 2**n
Proof
Expand Down

5 comments on commit 2ee6798

@binghe
Copy link
Member

@binghe binghe commented on 2ee6798 Jul 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about renaming lg (in transc) to log2? I think in many text books lg means the 10-based one, but I prefer log10 to avoid any potential ambiguity.

@mn200
Copy link
Member Author

@mn200 mn200 commented on 2ee6798 Jul 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If lg is already in heavy use elsewhere I’m happy to keep the name. It was, as you can see, a very minor adjustment.

@binghe
Copy link
Member

@binghe binghe commented on 2ee6798 Jul 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think lg was defined by Joe Hurd and is used somewhere in his example scripts. I personal think overloading it to logr 2 is the best option but let’s keep the current situation for now. This issue is too minor to be concerned.

@binghe
Copy link
Member

@binghe binghe commented on 2ee6798 Jul 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just occasionally found in a book called «Concrete Mathematics» (by Knuth, et al.), in which lg x denotes binary logarithm and log x denotes common logarithm (i.e. 10-based). Thus the existing choice in transcTheory is actually good. One day we can even add log in transcTheory (either as definition or overload) for common logarithm.

@mn200
Copy link
Member Author

@mn200 mn200 commented on 2ee6798 Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find!

Please sign in to comment.