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]
|
||||
call_res = []
|
||||
|
||||
step_cnt = 0
|
||||
while True:
|
||||
(insns, terminator, blocks,
|
||||
stack_frames, ssa_env, heap, call_res) = step(insns, terminator, blocks,
|
||||
stack_frames, ssa_env,
|
||||
global_env, heap, tdecs,
|
||||
fdecs, call_res)
|
||||
|
||||
step_cnt += 1
|
||||
if terminator is None:
|
||||
print('Stepping done! Final ssa_env:\n{}'
|
||||
.format(ssa_env))
|
||||
|
@ -429,6 +430,16 @@ define i64 @tigermain (i64 %U_mainSL_8, i64 %U_mainDummy_9) {
|
|||
format(insns[0][1].val))
|
||||
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__':
|
||||
gogo()
|
||||
|
|
Loading…
Reference in New Issue
Block a user