-
Notifications
You must be signed in to change notification settings - Fork 152
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
Add uninterpreted Map
implementation to Prelude.lean
#4734
base: develop
Are you sure you want to change the base?
Conversation
We can write things like open MapHookDef
noncomputable def map := mapImpl SortInt SortInt
noncomputable def exmpl : map.map := map.cons 3 4 map.unit |
In general, I'm fine with any implementation that models the functions over these data types faithfully. In addition, it should be checked how implementation can be combined with the sort module: I.e. what additional changes need to be made to the program to make it compile if inductive SortMap : Type where
| mk (coll : List (SortKItem × SortKItem)) : SortMap is replaced by inductive SortMap : Type where
| mk (coll : (mapImpl SortKItem SortKItem).map) : SortMap (assuming that's the intended use). |
pyk/src/pyk/k2lean4/Prelude.lean
Outdated
axiom nodupAx : forall m, List.Nodup (keysAx K m) | ||
|
||
-- Uninterpreted Map implementation | ||
noncomputable def mapImpl (K V : Type) : MapHookSig K V := |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this work as well?
noncomputable def mapImpl (K V : Type) : MapHookSig K V := | |
axiom mapImpl : MapHookSig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so since axiom mapImpl : MapHookSig K V
doesn't provide concrete elements for mapImpl
. So we cannot access it's components like mapImpl.map
:
axiom mapImpl : MapHookSig K V
#check mapImpl.map
returns
unknown constant 'MapHookDef.mapImpl.map'
Re: this comment Do we want noncomputable abbrev SortMap := mapImpl KItem KItem defining |
That would be ideal, but I couldn't make the sort module compile that way, so I went with the most straightforward approach for now. |
Ah yes! It seems Lean does not allow (definitions/abbrevs/theorems) and inductives in the same |
Co-authored-by: Tamás Tóth <[email protected]>
Tackling #4725, this PR adds an uninterpreted implementation for the
Map
sort.This PR's goal is to iron out how we want these uninterpreted implementations to be before proceeding with the rest of the hooked functions in
domains.md
.