forbid extending sort K in the Java backend

Fixed https://github.com/kframework/k/issues/708

@dwightguth @radumereuta please review
Agreed.  As I said in my previous note, I think we should just merge this if all the tests pass and then have Radu report errors when he gets the new parser done.  These can actually *help* Radu tune his parser, so it could be beneficial to keep them :)

Grigore


________________________________
From: Yilong Li [notifications@github.com]
Sent: Thursday, July 17, 2014 11:24 AM
To: kframework/k
Cc: Rosu, Grigore
Subject: Re: [k] forbid extending sort K in the Java backend (#714)


In include/builtins/array.k:

> -       [anywhere]
> -
> -  rule store(store(A:Array, I:Int, _:K), I, V:K)
> -       =>
> -       store(A, I, V)
> -       [anywhere]
> -
> -  // array size
> -  rule size-of-array(store(A:Array, _:K, _:K)) => size-of-array(A)
> -  rule size-of-array(const-array(Size:Int, _:K)) => Size
> -
> -endmodule
> +require "int.k"
> +
> +module ARRAY-SYNTAX
> +  syntax Array ::= "store"       "(" Array "," Int "," K ")"  [smtlib(store)]


Yes, of course. But my change is to mechanically replace syntax K ::= with syntax KItem ::= for non-function productions. This improvement should be done in another commit by whoever owns this file.

—
Reply to this email directly or view it on GitHub<https://github.com/kframework/k/pull/714/files#r15067647>.