Skip to content

Commit

Permalink
Change {...}<:S syntax to {...}::S
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott-Guest committed Dec 6, 2023
1 parent bbb763b commit fdbd37f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion k-distribution/include/kframework/builtin/domains.md
Original file line number Diff line number Diff line change
Expand Up @@ -1932,7 +1932,7 @@ module STRING-BUFFER-IN-K [symbolic]
syntax StringBuffer ::= String
syntax String ::= StringBuffer2String ( StringBuffer ) [function, total]
rule {SB:String +String S:String}<:StringBuffer => (SB +String S)::String
rule {SB:String +String S:String}::StringBuffer => (SB +String S)::String
rule .StringBuffer => ""
rule StringBuffer2String(S:String) => S
endmodule
Expand Down
2 changes: 1 addition & 1 deletion k-distribution/include/kframework/builtin/kast.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ module AUTO-CASTS
// generates, for all sorts, productions of the form:
// Sort ::= Sort ":Sort" // semantic cast - force the inner term to be `Sort` or a subsort
// Sort ::= Sort "::Sort" // strict cast - force the inner term to be exactly `Sort`. Useful for disambiguation
// Sort ::= "{" Sort "}" "<:Sort" // synonym for strict cast
// Sort ::= "{" Sort "}" "::Sort" // synonym for strict cast
// Sort ::= "{" K "}" ":>Sort" // projection cast. Allows any term to be placed in a context that expects `Sort`
// this is part of the mechanism that allows concrete user syntax in K
endmodule
Expand Down
4 changes: 2 additions & 2 deletions k-distribution/k-tutorial/1_basic/11_casts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ it has no effect on the sort of the subterm `I1:Int + I2:Int`.

For cases like this, K provides an alternative syntax for strict casts:
```
syntax S ::= "{" S "}<:S"
syntax S ::= "{" S "}::S"
```
The ambiguity can then be resolved with `{I1:Int + I2:Int}<:Exp` or `{I1:Int + I2:Int}<:Exp2`.
The ambiguity can then be resolved with `{I1:Int + I2:Int}::Exp` or `{I1:Int + I2:Int}::Exp2`.

### Projection casts

Expand Down

0 comments on commit fdbd37f

Please sign in to comment.