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
1 changed files with 12 additions and 1 deletions

View File

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