Skip to content
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

Consider HOL Light style set comprehension #85

Open
mn200 opened this issue Aug 17, 2012 · 5 comments
Open

Consider HOL Light style set comprehension #85

mn200 opened this issue Aug 17, 2012 · 5 comments

Comments

@mn200
Copy link
Member

mn200 commented Aug 17, 2012

As described in http://article.gmane.org/gmane.comp.mathematics.hol/2118 the HOL Light approach to this has the advantage over our current set up of not depending on pairs, and not using paired-abstractions.

It iterates mk_exists instead of mk_pabs, and uses another auxiliary constant, SET_SPEC.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

mn200 added a commit that referenced this issue Nov 1, 2012
An “applied” theorem is of the form

  (set construction) x <=> ...

where the ... will be from the theorem

  x ∈ (set construction) <=> ...

So, for example, INSERT_applied is

  |- (x INSERT s) y <=> (x = y) \/ y ∈ s

These theorems are all exported as rewrites, and provide a way of
getting users out of holes where they have “set world” constructions
but have lost the ∈ connection between the set and the possible
element. Note that these theorems will attempt to put the users back
into the “set world” because the RHSs will retain their uses of ∈.

These theorems will still work fine when rewriting with IN_DEF:
something like

   SIMP_TAC (srw_ss()) [IN_DEF]

will eliminate the “IN”s, even as the “applied” theorems help to make
progress with the other bits of the goal.

There’s no handling of GSPEC yet, but perhaps that can wait for HOL
Light style set-comprehension (see issue #85). The alternative is
probably a special conversion to do the right thing, though perhaps
just rewriting with

  GSPEC f v <=> ∃x. (v,T) = f x

would do the trick in most cases. (The problem in general is that to
get the above rewrite to work you have to throw in
pairTheory.EXISTS_PROD as well.)
@mn200
Copy link
Member Author

mn200 commented Dec 8, 2013

A comment from Rob Arthan on the hol-info mailing list points out that one disadvantage of the HOL Light approach is that you will get

`{ x | x > 6}` <> `{x | x > 6}`;;

because each parse will use a fresh genvar. This makes me rather less keen on the idea of switching to this implementation (though I still hate paired abstractions).

@mn200
Copy link
Member Author

mn200 commented Feb 19, 2014

Of course, one shouldn't be use = on terms anyway. One would still have

aconv ``{x | x > 6}`` ``{x | x > 6}``

in a possible HOL4 implementation of this idea.

@mn200
Copy link
Member Author

mn200 commented Mar 6, 2014

Another argument in favour of this idea is that it seems impossible to make a congruence rule for GSPEC as we have it, but the congruence rule for HOL Light's approach is trivial. A congruence rule is critical to get termination conditions for things like

wave G i = MAX_SET { wave g j + 1 | j ∈ iters G ⋀ j -<G>-> i }

a function I want to define right now.

@mn200
Copy link
Member Author

mn200 commented Aug 7, 2024

As the gmane link has died, here is a brief description of the HOL Light approach. There's a GSPEC constant outermost that is a signal to the printer (like our NUMERAL constant), but is semantically the identity. Then, there’s SETSPEC with definition

SETSPEC v P t <=> P /\ v = t

This is used to translate a simple case like { x | x < 6} into

GSPEC (\gv. ?x. SETSPEC gv (x < 6) x)

The P is the boolean expression to the right of the |; the t is the term to its left; the v is the genvar (gv above) that Rob Arthan complained about. In a more complicated case like { x + y | x * y = 20}, you get

GSPEC (\gv. ?x y. SETSPEC gv (x * y = 20) (x + y))

If you use the double | syntax, that just controls which variables get existentially quantified. So { x + y * z | x,y | x * y - z = 20} turns into

GSPEC (\gv. ?x y. SETSPEC gv (x * y - z = 20) (x + y * z))

with z free, as desired.

@mn200
Copy link
Member Author

mn200 commented Aug 7, 2024

The Sourceforge archive has some/all of this stored. This link seems to work at the moment (2024).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant