メタ計算を用いた Continuation based C の検証手法 |
Yasutaka Higa
|
__code verifySpecificationFinish(struct Context* context) {
if (context->data[AkashaInfo]->akashaInfo.maxHeight >
2*context->data[AkashaInfo]->akashaInfo.minHeight)
{
context->next = Exit;
goto meta(context, ShowTrace);
}
goto meta(context, DuplicateIterator);
}
__code cs0(int a, int b){
goto cs1(a+b);
}
record ds0 : Set where
field
a : Int
b : Int
__code cs0(int a, int b){
goto cs1(a+b);
}
data CodeSegment (A B : Set) : Set where
cs : (A -> B) -> CodeSegment A B
cs0 : CodeSegment ds0 ds1
cs0 = cs (\d -> goto cs1 (record {c = (ds0.a d) + (ds0.b d)}))
main : ds1
main = goto cs0 (record {a = 100 ; b = 50})
main : Meta
main = gotoMeta push cs0 (record {context = (record {a = 100 ; b = 50 ; c = 70}) ; c' = 0 ; next = (N.cs id)})