Try to solve the halting problem.

This commit is contained in:
cfreksen 2017-10-29 22:31:07 +01:00
parent ce61eb151e
commit 6398047e64
No known key found for this signature in database
GPG Key ID: EAC13EE101008978

View File

@ -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()