Try to solve the halting problem.
This commit is contained in:
parent
ce61eb151e
commit
6398047e64
13
stepper.py
13
stepper.py
|
@ -415,13 +415,14 @@ define i64 @tigermain (i64 %U_mainSL_8, i64 %U_mainDummy_9) {
|
||||||
heap = [None]
|
heap = [None]
|
||||||
call_res = []
|
call_res = []
|
||||||
|
|
||||||
|
step_cnt = 0
|
||||||
while True:
|
while True:
|
||||||
(insns, terminator, blocks,
|
(insns, terminator, blocks,
|
||||||
stack_frames, ssa_env, heap, call_res) = step(insns, terminator, blocks,
|
stack_frames, ssa_env, heap, call_res) = step(insns, terminator, blocks,
|
||||||
stack_frames, ssa_env,
|
stack_frames, ssa_env,
|
||||||
global_env, heap, tdecs,
|
global_env, heap, tdecs,
|
||||||
fdecs, call_res)
|
fdecs, call_res)
|
||||||
|
step_cnt += 1
|
||||||
if terminator is None:
|
if terminator is None:
|
||||||
print('Stepping done! Final ssa_env:\n{}'
|
print('Stepping done! Final ssa_env:\n{}'
|
||||||
.format(ssa_env))
|
.format(ssa_env))
|
||||||
|
@ -429,6 +430,16 @@ define i64 @tigermain (i64 %U_mainSL_8, i64 %U_mainDummy_9) {
|
||||||
format(insns[0][1].val))
|
format(insns[0][1].val))
|
||||||
break
|
break
|
||||||
|
|
||||||
|
if step_cnt % 100 == 0:
|
||||||
|
print(heap)
|
||||||
|
while True:
|
||||||
|
stop_q = input('We have now done {} steps. Continue? [Y/n]: '
|
||||||
|
.format(step_cnt)).lower()
|
||||||
|
if stop_q in ['y', 'yes', 'n', 'no', '']:
|
||||||
|
break
|
||||||
|
if stop_q in ['n', 'no']:
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
gogo()
|
gogo()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user