-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uniqueness of list elements (UNIQUE) and 3 alternative definitions #470
Conversation
What about changing the names of theorems in this way?
|
The proposed name changes sound good. |
I think the theorems based on |
#98 is related |
I have renamed those 3 theorems. But I don't know how to move |
OK I guess they can be moved around later, maybe when we make progress on #98. |
You could also try simpLib.track (which uses simpLib.used_rewrites and
simpLib.track_rewrites).
It doesn't track names, but accumulates the actual instantiated rules used.
Example:
Initial goal:
MAP LENGTH [[1; 2; 3]; [4; 5; 6; 7]] = X
: proof
e (simpLib.track (rw_tac list_ss []));
OK..
1 subgoal:
val it =
[3; 4] = X
: proof
simpLib.used_rewrites;
val it =
ref
[|- MAP f (h::t) = f h::MAP f t,
|- LENGTH (h::t) = SUC (LENGTH t),
|- LENGTH (h::t) = SUC (LENGTH t),
|- LENGTH (h::t) = SUC (LENGTH t),
|- LENGTH [] = 0,
|- MAP f (h::t) = f h::MAP f t,
|- LENGTH (h::t) = SUC (LENGTH t),
|- LENGTH (h::t) = SUC (LENGTH t),
|- LENGTH (h::t) = SUC (LENGTH t),
|- LENGTH (h::t) = SUC (LENGTH t),
|- LENGTH [] = 0,
|- MAP f [] = []]:
thm list ref
…
On Fri, Oct 6, 2017 at 8:36 AM, Ramana Kumar ***@***.***> wrote:
Merged #470 <#470>.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#470 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABDgDyHjcrtvLyx12nbIqRyasevwX3j8ks5spiz2gaJpZM4Pv0lC>
.
|
Hi Konrad,
Thank you so much! I wanted to know how to track simpLib tacticals for long time, just haven’t got chance to ask in the mailing list.
With your help now I’m able to remove all those “list_ss” in my previous proofs of the 3 theorems, I’ll create a new PR for moving 2 of them back to listTheory, as suggested by Ramana.
Being able to track simpLib, now I’ve learnt more about listTheory (and other HOL theories).
Regards,
Chun Tian
… Il giorno 06 ott 2017, alle ore 16:10, Konrad Slind ***@***.***> ha scritto:
You could also try simpLib.track (which uses simpLib.used_rewrites and
simpLib.track_rewrites).
It doesn't track names, but accumulates the actual instantiated rules used.
Example:
Initial goal:
MAP LENGTH [[1; 2; 3]; [4; 5; 6; 7]] = X
: proof
> e (simpLib.track (rw_tac list_ss []));
OK..
1 subgoal:
val it =
[3; 4] = X
: proof
> simpLib.used_rewrites;
val it =
ref
[|- MAP f (h::t) = f h::MAP f t,
|- LENGTH (h::t) = SUC (LENGTH t),
|- LENGTH (h::t) = SUC (LENGTH t),
|- LENGTH (h::t) = SUC (LENGTH t),
|- LENGTH [] = 0,
|- MAP f (h::t) = f h::MAP f t,
|- LENGTH (h::t) = SUC (LENGTH t),
|- LENGTH (h::t) = SUC (LENGTH t),
|- LENGTH (h::t) = SUC (LENGTH t),
|- LENGTH (h::t) = SUC (LENGTH t),
|- LENGTH [] = 0,
|- MAP f [] = []]:
thm list ref
>
On Fri, Oct 6, 2017 at 8:36 AM, Ramana Kumar ***@***.***>
wrote:
> Merged #470 <#470>.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#470 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/ABDgDyHjcrtvLyx12nbIqRyasevwX3j8ks5spiz2gaJpZM4Pv0lC>
> .
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I'm glad it helped. I originally created the functionality for students who
were trying to learn the simplifier, but it can be useful even for experts.
Konrad.
…On Fri, Oct 6, 2017 at 11:08 AM, Chun Tian ***@***.***> wrote:
Hi Konrad,
Thank you so much! I wanted to know how to track simpLib tacticals for
long time, just haven’t got chance to ask in the mailing list.
With your help now I’m able to remove all those “list_ss” in my previous
proofs of the 3 theorems, I’ll create a new PR for moving 2 of them back to
listTheory, as suggested by Ramana.
Being able to track simpLib, now I’ve learnt more about listTheory (and
other HOL theories).
Regards,
Chun Tian
> Il giorno 06 ott 2017, alle ore 16:10, Konrad Slind <
***@***.***> ha scritto:
>
> You could also try simpLib.track (which uses simpLib.used_rewrites and
> simpLib.track_rewrites).
> It doesn't track names, but accumulates the actual instantiated rules
used.
>
> Example:
>
> Initial goal:
>
> MAP LENGTH [[1; 2; 3]; [4; 5; 6; 7]] = X
> : proof
>
> > e (simpLib.track (rw_tac list_ss []));
> OK..
> 1 subgoal:
> val it =
>
> [3; 4] = X
>
> : proof
>
> > simpLib.used_rewrites;
> val it =
> ref
> [|- MAP f (h::t) = f h::MAP f t,
> |- LENGTH (h::t) = SUC (LENGTH t),
> |- LENGTH (h::t) = SUC (LENGTH t),
> |- LENGTH (h::t) = SUC (LENGTH t),
> |- LENGTH [] = 0,
> |- MAP f (h::t) = f h::MAP f t,
> |- LENGTH (h::t) = SUC (LENGTH t),
> |- LENGTH (h::t) = SUC (LENGTH t),
> |- LENGTH (h::t) = SUC (LENGTH t),
> |- LENGTH (h::t) = SUC (LENGTH t),
> |- LENGTH [] = 0,
> |- MAP f [] = []]:
> thm list ref
> >
>
>
> On Fri, Oct 6, 2017 at 8:36 AM, Ramana Kumar ***@***.***>
> wrote:
>
> > Merged #470 <#470>.
> >
> > —
> > You are receiving this because you are subscribed to this thread.
> > Reply to this email directly, view it on GitHub
> > <#470 (comment)>,
or mute
> > the thread
> > <https://github.com/notifications/unsubscribe-auth/
ABDgDyHjcrtvLyx12nbIqRyasevwX3j8ks5spiz2gaJpZM4Pv0lC>
> > .
> >
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#470 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABDgDzk33yNY4kgOGMTw8hQM4C8dSlGsks5splB5gaJpZM4Pv0lC>
.
|
Currently HOL's listTheory lack of the definition for testing the uniqueness of an element in a list. I've learnt several equivalent definitions from the mailing list, one (the most useful form for me) is from Robert Beers robert@beers.org:
The most common alternative definitions (suggested by Scott Owens and Anthony Fox) are based on FILTER and LENGTH. Or it can be based on LIST_ELEM_COUNT (in rich_listTheory):
I have put
UNIQUE_DEF
into listTheory, and 3 alternative definitions (as theorems) into rich_listTheory.