The KAT requires some programming-language specific information to work. Instantiation of the progamming language to KAT should happen with the language semantics on an as-needed basis.
The module FUN-KAT
includes all the supported analysis for the FUN language.
requires "fun.k"
requires "kat.k"
module FUN-ANALYSIS
imports STRATEGY
imports FUN-SBC
endmodule
module FUN-KAT
imports FUN-UNTYPED
imports KAT
configuration <kat-FUN> initSCell(Init) initKatCell <harness> initFUNCell(Init) </harness> </kat-FUN>
Here the definition of a State
for FUN is given, as well as the definitions of how to push
and pop
states.
syntax PreState ::= FUNCell
// ---------------------------
rule <s> push => push FUNCELL ... </s> <harness> FUNCELL </harness>
rule <s> pop FUNCELL => . ... </s> <harness> _ => FUNCELL </harness>
rule #normal => ^ lookup | ^ assignment
rule #branch => ^ iftrue | ^ iffalse
rule #loop => ^ letRecursive
rule <s> bool? [ <FUN> <k> true ... </k> ... </FUN> ] => #true ... </s>
rule <s> bool? [ <FUN> <k> false ... </k> ... </FUN> ] => #false ... </s>
endmodule
module FUN-SBC
imports FUN-KAT
imports KAT-SBC
imports MATCHING
rule <s> abstract [ STATE ] => pop STATE ... </s>
Subsumption will be based on matching one <k>
cell with the other.
This is correct because the memory is fully abstracted at the beginning of each rule.
TODO: We should be able to match on the entire configuration, not just the <k>
cell.
rule <s> <FUN> <k> KCELL </k> ... </FUN> subsumes? <FUN> <k> KCELL' </k> ... </FUN>
=> #if #matches(KCELL', KCELL) #then #true #else #false #fi
...
</s>
endmodule