Hi, I'm working with Maps, and I noticed there is special syntax for updating a map, but I wasn't able to find how to create maps of a single element.
Is there a particular syntax to write this?
definition singleMap :: "'a ⇒ 'b ⇒ 'a ⇀ 'b" where
"singleMap k v = (λx. if x = k then Some v else None)"
Map.empty
and updating that with the one element?
I thought of that, but I was wondering if there was a special syntax to avoid doing Map.empty (k ↦ v)
You mean like this?
term "[1 ↦ 2, 2 ↦ 3]"
Thanks! that is exactly it... I just figured it out by having a nitpicked lemma :sweat_smile: Screen-Shot-2023-02-01-at-19.05.25.png
Last updated: Dec 21 2024 at 16:20 UTC