some fixes in terms of map

Mainly, make a intermediate function to get the keys we want. 
Let me conclude and see if you want this:

You say that the hasUnionMaker function cannot show all behavior because
there is another kinds of loc(_,_)

So you want to just say something like hasUnionMarker(Loc) =>
#hasUnionMarker(Loc)

but the problem is that I still need the third function to turn
#hasUnionMarker(Loc) => ##hasUnionMarker(K,Set)

Since this kind of matching:
#hasUnionMarker(loc(_,_,SetItem(K:K) S) => ..
   when K == something

will not work in the java engine. So I need to add two more cases in
hasUnionMarker


On Fri, Jun 6, 2014 at 3:52 PM, Chris Hathhorn <notifications@github.com>
wrote:

> In semantics/language/common/symloc.k:
>
> > @@ -267,19 +267,42 @@ module C-SYMLOC
> >       syntax Bool ::= "#isBases" "(" Provenance ")" [function, klabel('#isBases)]
> >       rule #isBases(basedOn(_)) => true
> >
> > -     rule hasUnionMarker(Loc:SymLoc) => #hasUnionMarker(Loc) ==K true
> > -
> > -     syntax Bool ::= #hasUnionMarker(SymLoc) [function]
> > -     rule #hasUnionMarker(loc(_, _, SetItem(fromUnion(_, _, _)) _)) => true
> > -
> > -     rule isFromArray(Loc:SymLoc) => #isFromArray(Loc) ==K true
> > -
> > -     syntax Bool ::= "#isFromArray" "(" SymLoc ")" [function]
> > -     rule #isFromArray(loc(_, _, SetItem(fromArray(_, _)) _)) => true
> > -
> > -     rule stripFromArray(loc(_, _, (SetItem(fromArray(_, _)) => .Set) _))
> > -     rule stripFromArray(Loc:SymLoc) => Loc
> > -          when notBool isFromArray(Loc)
> > +     rule hasUnionMarker(loc(_,_,.Set)) => false
> > +     rule hasUnionMarker(loc(_,_,SetItem(K:K) S:Set)) => #hasUnionMarker(K,S) ==K true
>
> But it'll be a partial function that only returns true when the thing is
> in the set, it doesn't even need to consider the case when the set argument
> is missing.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/kframework/c-semantics/pull/10/files#r13509721>.
>