Pseudocode: Add valued instructions and unbound values to AbstractPseudoValueTest
This commit is contained in:
@@ -7,6 +7,6 @@ tailRecursive fun test() : Int {
|
||||
}
|
||||
}
|
||||
---------------------
|
||||
test() <v0>: * NEW()
|
||||
test() <v0>: * NEW: call(test, test) -> <v0>
|
||||
{ test() } <v0>: * COPY
|
||||
=====================
|
||||
|
||||
@@ -7,5 +7,5 @@ tailRecursive fun test() : Int {
|
||||
}
|
||||
}
|
||||
---------------------
|
||||
test() <v0>: Int NEW()
|
||||
test() <v0>: Int NEW: call(test, test) -> <v0>
|
||||
=====================
|
||||
|
||||
@@ -4,17 +4,19 @@ tailRecursive fun sum(x: Long, sum: Long): Long {
|
||||
return sum(x - 1, sum + x)
|
||||
}
|
||||
---------------------
|
||||
x <v2>: OR{{<: Any}, {<: Any}} NEW()
|
||||
0 <v3>: {<: Number} NEW()
|
||||
toLong() <v4>: {<: Any?} NEW(<v3>)
|
||||
0.toLong() <v4>: {<: Any?} COPY
|
||||
x == 0.toLong() <v5>: Boolean NEW(<v2>, <v4>)
|
||||
sum <v6>: Long NEW()
|
||||
x <v7>: Long NEW()
|
||||
1 <v8>: Int NEW()
|
||||
x - 1 <v9>: Long NEW(<v7>, <v8>)
|
||||
sum <v10>: Long NEW()
|
||||
x <v11>: Long NEW()
|
||||
sum + x <v12>: Long NEW(<v10>, <v11>)
|
||||
sum(x - 1, sum + x) <v13>: Long NEW(<v9>, <v12>)
|
||||
<v0>: Long NEW: magic(x: Long) -> <v0>
|
||||
<v1>: Long NEW: magic(sum: Long) -> <v1>
|
||||
x <v2>: OR{{<: Any}, {<: Any}} NEW: r(x) -> <v2>
|
||||
0 <v3>: {<: Number} NEW: r(0) -> <v3>
|
||||
toLong() <v4>: {<: Any?} NEW: call(toLong, toLong|<v3>) -> <v4>
|
||||
0.toLong() <v4>: {<: Any?} COPY
|
||||
x == 0.toLong() <v5>: Boolean NEW: call(==, equals|<v2>, <v4>) -> <v5>
|
||||
sum <v6>: Long NEW: r(sum) -> <v6>
|
||||
x <v7>: Long NEW: r(x) -> <v7>
|
||||
1 <v8>: Int NEW: r(1) -> <v8>
|
||||
x - 1 <v9>: Long NEW: call(-, minus|<v7>, <v8>) -> <v9>
|
||||
sum <v10>: Long NEW: r(sum) -> <v10>
|
||||
x <v11>: Long NEW: r(x) -> <v11>
|
||||
sum + x <v12>: Long NEW: call(+, plus|<v10>, <v11>) -> <v12>
|
||||
sum(x - 1, sum + x) <v13>: Long NEW: call(sum, sum|<v9>, <v12>) -> <v13>
|
||||
=====================
|
||||
|
||||
@@ -7,5 +7,6 @@ tailRecursive fun foo() {
|
||||
}
|
||||
}
|
||||
---------------------
|
||||
foo() <v0>: Unit NEW()
|
||||
<v1>: {<: Throwable} NEW: magic(e: Throwable) -> <v1>
|
||||
foo() <v0>: Unit NEW: call(foo, foo) -> <v0>
|
||||
=====================
|
||||
|
||||
@@ -9,12 +9,13 @@ fun test() : Unit {
|
||||
}
|
||||
}
|
||||
---------------------
|
||||
test() <v0>: * NEW()
|
||||
{ test() } <v0>: * COPY
|
||||
test() <v2>: * NEW()
|
||||
{ test() } <v2>: * COPY
|
||||
test() <v3>: * NEW()
|
||||
{ test() } <v3>: * COPY
|
||||
try { test() } catch (any : Exception) { test() } finally { test() } <v4>: * NEW(<v0>, <v2>)
|
||||
{ try { test() } catch (any : Exception) { test() } finally { test() } } <v4>: * COPY
|
||||
<v1>: {<: Exception} NEW: magic(any : Exception) -> <v1>
|
||||
test() <v0>: * NEW: call(test, test) -> <v0>
|
||||
{ test() } <v0>: * COPY
|
||||
test() <v2>: * NEW: call(test, test) -> <v2>
|
||||
{ test() } <v2>: * COPY
|
||||
test() <v3>: * NEW: call(test, test) -> <v3>
|
||||
{ test() } <v3>: * COPY
|
||||
try { test() } catch (any : Exception) { test() } finally { test() } <v4>: * NEW: merge(try { test() } catch (any : Exception) { test() } finally { test() }|<v0>, <v2>) -> <v4>
|
||||
{ try { test() } catch (any : Exception) { test() } finally { test() } } <v4>: * COPY
|
||||
=====================
|
||||
|
||||
Reference in New Issue
Block a user