2026-05-26 09:31 AEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000585mercuryBugpublic2026-05-18 16:07
Reporterwangp 
Assigned Tozs 
PrioritynormalSeveritycrashReproducibilityalways
StatusassignedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0000585: liveness bug involving TypeClassInfo
DescriptionThe compiler aborts when compiling the attached test case in a debug grade:

% mmc -s asm_fast.gc.debug -C tci_liveness_abort.m

The module contains two similar predicates which both cause aborts at different points. (Probably the root cause is the same for both.)

With --debug-liveness 0, the Kind = k3 branch of the test1 predicate shows in the "after deadness" stage:

      % context: file "tci_liveness_abort.m", line 106
      % goal id: 12
      % nonlocals: V_16, HostOb_21, TypeClassInfo_for_host_25
      % pre-births: TypeClassInfo_for_host_14, HostOb_21, TypeClassInfo_for_host_25
      % determinism: semidet
      V_16 = tci_liveness_abort.host(TypeClassInfo_for_host_25, HostOb_21)
      % V_16 ?= tci_liveness_abort.host/1(TypeClassInfo_for_host_25, HostOb_21)
      % arg-mode 1 in = out
      % arg-mode 2 in = out
      % vars with new insts: V_16, HostOb_21, TypeClassInfo_for_host_25
      % post-deaths: V_16

The TypeClassInfo_for_host_14 variable occurring in the pre-birth set looks suspicious.
TagsNo tags attached.
Attached Files
  • ? file icon tci_liveness_abort.m (11,099 bytes) 2026-05-12 17:10
  • txt file icon debug-liveness-pred-id-0.txt (49,982 bytes) 2026-05-12 17:11 -
    before requantify:
    % context: file "tci_liveness_abort.m", line 101
    % goal id: 1
    % nonlocals: Ob_5, Kind_6, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
    % determinism: det
    ( % cannot_fail switch on Kind_6
    % Kind_6 has functor k1/0
      % context: file "tci_liveness_abort.m", line 101
      % goal id: 4
      % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % determinism: det
      STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
      % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
      % vars with new insts: STATE_VARIABLE_List_12
      % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
    ;
    % Kind_6 has functor k2/0
      % context: file "tci_liveness_abort.m", line 106
      % goal id: 9
      % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % determinism: det
      ( if
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 10
        % nonlocals: Ob_5, HostOb_8, TypeClassInfo_for_host_14
        % determinism: semidet
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 11
          % nonlocals: Ob_5, V_13
          % determinism: det
          Ob_5 = tci_liveness_abort.object(V_13)
          % Ob_5 => tci_liveness_abort.object/1(V_13)
          % arg-mode 1 in = out
          % vars with new insts: Ob_5, V_13
          ,
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 12
          % nonlocals: HostOb_8, V_13, TypeClassInfo_for_host_14
          % determinism: semidet
          V_13 = tci_liveness_abort.host(TypeClassInfo_for_host_14, HostOb_8)
          % V_13 ?= tci_liveness_abort.host/1(TypeClassInfo_for_host_14, HostOb_8)
          % arg-mode 1 in = out
          % arg-mode 2 in = out
          % vars with new insts: HostOb_8, V_13, TypeClassInfo_for_host_14
        )
        % vars with new insts: Ob_5, HostOb_8, TypeClassInfo_for_host_14
      then
        % context: file "tci_liveness_abort.m", line 107
        % goal id: 13
        % nonlocals: Ob_5, HostOb_8, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, TypeClassInfo_for_host_14
        % determinism: det
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 107
          % goal id: 14
          % nonlocals: Ob_5, HostOb_8, Item_10, TypeClassInfo_for_host_14
          % determinism: det
          tci_liveness_abort.get_value(TypeClassInfo_for_host_14, Ob_5, HostOb_8, Item_10)
          % pred id: 453, proc id: 0
          % vars with new insts: Ob_5, Item_10
          ,
          % goal id: 22
          % nonlocals: TypeCtorInfo_15_15
          % determinism: det
          TypeCtorInfo_15_15 = type_ctor_info(tci_liveness_abort, value, 0)
          % TypeCtorInfo_15_15 <= <type_ctor_info tci_liveness_abort.value/0>
          % cell_is_unique
          % vars with new insts: TypeCtorInfo_15_15
          ,
          % context: file "tci_liveness_abort.m", line 115
          % goal id: 23
          % nonlocals: Item_10, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, TypeCtorInfo_15_15
          % determinism: det
          list.cons(TypeCtorInfo_15_15, Item_10, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12)
          % pred id: 43, proc id: 0
          % vars with new insts: STATE_VARIABLE_List_12, TypeCtorInfo_15_15
        )
        % vars with new insts: Ob_5, STATE_VARIABLE_List_12
      else
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 24
        % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
        % determinism: det
        STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
        % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
        % vars with new insts: STATE_VARIABLE_List_12
        % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
      )
      % vars with new insts: Ob_5, STATE_VARIABLE_List_12
    ;
    % Kind_6 has functor k3/0
      % context: file "tci_liveness_abort.m", line 106
      % goal id: 9
      % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % determinism: det
      ( if
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 10
        % nonlocals: Ob_5, HostOb_21, TypeClassInfo_for_host_25
        % determinism: semidet
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 11
          % nonlocals: Ob_5, V_16
          % determinism: det
          Ob_5 = tci_liveness_abort.object(V_16)
          % Ob_5 => tci_liveness_abort.object/1(V_16)
          % arg-mode 1 in = out
          % vars with new insts: Ob_5, V_16
          ,
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 12
          % nonlocals: V_16, HostOb_21, TypeClassInfo_for_host_25
          % determinism: semidet
          V_16 = tci_liveness_abort.host(TypeClassInfo_for_host_25, HostOb_21)
          % V_16 ?= tci_liveness_abort.host/1(TypeClassInfo_for_host_25, HostOb_21)
          % arg-mode 1 in = out
          % arg-mode 2 in = out
          % vars with new insts: V_16, HostOb_21, TypeClassInfo_for_host_25
        )
        % vars with new insts: Ob_5, HostOb_21, TypeClassInfo_for_host_25
      then
        % context: file "tci_liveness_abort.m", line 107
        % goal id: 13
        % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, HostOb_21, TypeClassInfo_for_host_25
        % determinism: det
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 107
          % goal id: 14
          % nonlocals: Ob_5, HostOb_21, TypeClassInfo_for_host_25
          % determinism: det
          tci_liveness_abort.get_value(TypeClassInfo_for_host_25, Ob_5, HostOb_21, Value_17)
          % pred id: 453, proc id: 0
          % vars with new insts: Ob_5
          ,
          % context: file "tci_liveness_abort.m", line 111
          % goal id: 15
          % nonlocals: Item_19
          % determinism: det
          Item_19 = tci_liveness_abort.null
          % Item_19 <= tci_liveness_abort.null/0
          % cons_id type_ctor: tci_liveness_abort.value/0
          % cell_is_unique
          % vars with new insts: Item_19
          ,
          % goal id: 22
          % nonlocals: TypeCtorInfo_15_20
          % determinism: det
          TypeCtorInfo_15_20 = type_ctor_info(tci_liveness_abort, value, 0)
          % TypeCtorInfo_15_20 <= <type_ctor_info tci_liveness_abort.value/0>
          % cell_is_unique
          % vars with new insts: TypeCtorInfo_15_20
          ,
          % context: file "tci_liveness_abort.m", line 115
          % goal id: 23
          % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, Item_19, TypeCtorInfo_15_20
          % determinism: det
          list.cons(TypeCtorInfo_15_20, Item_19, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12)
          % pred id: 43, proc id: 0
          % vars with new insts: STATE_VARIABLE_List_12, TypeCtorInfo_15_20
        )
        % vars with new insts: Ob_5, STATE_VARIABLE_List_12
      else
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 24
        % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
        % determinism: det
        STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
        % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
        % vars with new insts: STATE_VARIABLE_List_12
        % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
      )
      % vars with new insts: Ob_5, STATE_VARIABLE_List_12
    )
    % vars with new insts: Ob_5, Kind_6, STATE_VARIABLE_List_12
    
    
    before liveness:
    % context: file "tci_liveness_abort.m", line 101
    % goal id: 1
    % nonlocals: Ob_5, Kind_6, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
    % determinism: det
    ( % cannot_fail switch on Kind_6
    % Kind_6 has functor k1/0
      % context: file "tci_liveness_abort.m", line 101
      % goal id: 4
      % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % determinism: det
      STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
      % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
      % vars with new insts: STATE_VARIABLE_List_12
      % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
    ;
    % Kind_6 has functor k2/0
      % context: file "tci_liveness_abort.m", line 106
      % goal id: 9
      % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % determinism: det
      ( if
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 10
        % nonlocals: Ob_5, HostOb_8, TypeClassInfo_for_host_14
        % determinism: semidet
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 11
          % nonlocals: Ob_5, V_13
          % determinism: det
          Ob_5 = tci_liveness_abort.object(V_13)
          % Ob_5 => tci_liveness_abort.object/1(V_13)
          % arg-mode 1 in = out
          % vars with new insts: Ob_5, V_13
          ,
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 12
          % nonlocals: HostOb_8, V_13, TypeClassInfo_for_host_14
          % determinism: semidet
          V_13 = tci_liveness_abort.host(TypeClassInfo_for_host_14, HostOb_8)
          % V_13 ?= tci_liveness_abort.host/1(TypeClassInfo_for_host_14, HostOb_8)
          % arg-mode 1 in = out
          % arg-mode 2 in = out
          % vars with new insts: HostOb_8, V_13, TypeClassInfo_for_host_14
        )
        % vars with new insts: Ob_5, HostOb_8, TypeClassInfo_for_host_14
      then
        % context: file "tci_liveness_abort.m", line 107
        % goal id: 13
        % nonlocals: Ob_5, HostOb_8, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, TypeClassInfo_for_host_14
        % determinism: det
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 107
          % goal id: 14
          % nonlocals: Ob_5, HostOb_8, Item_10, TypeClassInfo_for_host_14
          % determinism: det
          tci_liveness_abort.get_value(TypeClassInfo_for_host_14, Ob_5, HostOb_8, Item_10)
          % pred id: 453, proc id: 0
          % vars with new insts: Ob_5, Item_10
          ,
          % goal id: 22
          % nonlocals: TypeCtorInfo_15_15
          % determinism: det
          TypeCtorInfo_15_15 = type_ctor_info(tci_liveness_abort, value, 0)
          % TypeCtorInfo_15_15 <= <type_ctor_info tci_liveness_abort.value/0>
          % cell_is_unique
          % vars with new insts: TypeCtorInfo_15_15
          ,
          % context: file "tci_liveness_abort.m", line 115
          % goal id: 23
          % nonlocals: Item_10, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, TypeCtorInfo_15_15
          % determinism: det
          list.cons(TypeCtorInfo_15_15, Item_10, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12)
          % pred id: 43, proc id: 0
          % vars with new insts: STATE_VARIABLE_List_12, TypeCtorInfo_15_15
        )
        % vars with new insts: Ob_5, STATE_VARIABLE_List_12
      else
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 24
        % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
        % determinism: det
        STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
        % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
        % vars with new insts: STATE_VARIABLE_List_12
        % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
      )
      % vars with new insts: Ob_5, STATE_VARIABLE_List_12
    ;
    % Kind_6 has functor k3/0
      % context: file "tci_liveness_abort.m", line 106
      % goal id: 9
      % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % determinism: det
      ( if
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 10
        % nonlocals: Ob_5, HostOb_21, TypeClassInfo_for_host_25
        % determinism: semidet
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 11
          % nonlocals: Ob_5, V_16
          % determinism: det
          Ob_5 = tci_liveness_abort.object(V_16)
          % Ob_5 => tci_liveness_abort.object/1(V_16)
          % arg-mode 1 in = out
          % vars with new insts: Ob_5, V_16
          ,
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 12
          % nonlocals: V_16, HostOb_21, TypeClassInfo_for_host_25
          % determinism: semidet
          V_16 = tci_liveness_abort.host(TypeClassInfo_for_host_25, HostOb_21)
          % V_16 ?= tci_liveness_abort.host/1(TypeClassInfo_for_host_25, HostOb_21)
          % arg-mode 1 in = out
          % arg-mode 2 in = out
          % vars with new insts: V_16, HostOb_21, TypeClassInfo_for_host_25
        )
        % vars with new insts: Ob_5, HostOb_21, TypeClassInfo_for_host_25
      then
        % context: file "tci_liveness_abort.m", line 107
        % goal id: 13
        % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, HostOb_21, TypeClassInfo_for_host_25
        % determinism: det
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 107
          % goal id: 14
          % nonlocals: Ob_5, HostOb_21, TypeClassInfo_for_host_25
          % determinism: det
          tci_liveness_abort.get_value(TypeClassInfo_for_host_25, Ob_5, HostOb_21, Value_17)
          % pred id: 453, proc id: 0
          % vars with new insts: Ob_5
          ,
          % context: file "tci_liveness_abort.m", line 111
          % goal id: 15
          % nonlocals: Item_19
          % determinism: det
          Item_19 = tci_liveness_abort.null
          % Item_19 <= tci_liveness_abort.null/0
          % cons_id type_ctor: tci_liveness_abort.value/0
          % cell_is_unique
          % vars with new insts: Item_19
          ,
          % goal id: 22
          % nonlocals: TypeCtorInfo_15_20
          % determinism: det
          TypeCtorInfo_15_20 = type_ctor_info(tci_liveness_abort, value, 0)
          % TypeCtorInfo_15_20 <= <type_ctor_info tci_liveness_abort.value/0>
          % cell_is_unique
          % vars with new insts: TypeCtorInfo_15_20
          ,
          % context: file "tci_liveness_abort.m", line 115
          % goal id: 23
          % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, Item_19, TypeCtorInfo_15_20
          % determinism: det
          list.cons(TypeCtorInfo_15_20, Item_19, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12)
          % pred id: 43, proc id: 0
          % vars with new insts: STATE_VARIABLE_List_12, TypeCtorInfo_15_20
        )
        % vars with new insts: Ob_5, STATE_VARIABLE_List_12
      else
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 24
        % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
        % determinism: det
        STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
        % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
        % vars with new insts: STATE_VARIABLE_List_12
        % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
      )
      % vars with new insts: Ob_5, STATE_VARIABLE_List_12
    )
    % vars with new insts: Ob_5, Kind_6, STATE_VARIABLE_List_12
    
    
    after liveness:
    % context: file "tci_liveness_abort.m", line 101
    % goal id: 1
    % nonlocals: Ob_5, Kind_6, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
    % determinism: det
    ( % cannot_fail switch on Kind_6
    % Kind_6 has functor k1/0
      % context: file "tci_liveness_abort.m", line 101
      % goal id: 4
      % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % pre-births: STATE_VARIABLE_List_12
      % determinism: det
      STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
      % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
      % vars with new insts: STATE_VARIABLE_List_12
      % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
    ;
    % Kind_6 has functor k2/0
      % context: file "tci_liveness_abort.m", line 106
      % goal id: 9
      % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % determinism: det
      ( if
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 10
        % nonlocals: Ob_5, HostOb_8, TypeClassInfo_for_host_14
        % determinism: semidet
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 11
          % nonlocals: Ob_5, V_13
          % pre-births: V_13
          % determinism: det
          Ob_5 = tci_liveness_abort.object(V_13)
          % Ob_5 => tci_liveness_abort.object/1(V_13)
          % arg-mode 1 in = out
          % vars with new insts: Ob_5, V_13
          ,
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 12
          % nonlocals: HostOb_8, V_13, TypeClassInfo_for_host_14
          % pre-births: HostOb_8, TypeClassInfo_for_host_14
          % determinism: semidet
          V_13 = tci_liveness_abort.host(TypeClassInfo_for_host_14, HostOb_8)
          % V_13 ?= tci_liveness_abort.host/1(TypeClassInfo_for_host_14, HostOb_8)
          % arg-mode 1 in = out
          % arg-mode 2 in = out
          % vars with new insts: HostOb_8, V_13, TypeClassInfo_for_host_14
        )
        % vars with new insts: Ob_5, HostOb_8, TypeClassInfo_for_host_14
      then
        % context: file "tci_liveness_abort.m", line 107
        % goal id: 13
        % nonlocals: Ob_5, HostOb_8, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, TypeClassInfo_for_host_14
        % determinism: det
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 107
          % goal id: 14
          % nonlocals: Ob_5, HostOb_8, Item_10, TypeClassInfo_for_host_14
          % pre-births: Item_10
          % determinism: det
          tci_liveness_abort.get_value(TypeClassInfo_for_host_14, Ob_5, HostOb_8, Item_10)
          % pred id: 453, proc id: 0
          % vars with new insts: Ob_5, Item_10
          ,
          % goal id: 22
          % nonlocals: TypeCtorInfo_15_15
          % pre-births: TypeCtorInfo_15_15
          % determinism: det
          TypeCtorInfo_15_15 = type_ctor_info(tci_liveness_abort, value, 0)
          % TypeCtorInfo_15_15 <= <type_ctor_info tci_liveness_abort.value/0>
          % cell_is_unique
          % vars with new insts: TypeCtorInfo_15_15
          ,
          % context: file "tci_liveness_abort.m", line 115
          % goal id: 23
          % nonlocals: Item_10, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, TypeCtorInfo_15_15
          % pre-births: STATE_VARIABLE_List_12
          % determinism: det
          list.cons(TypeCtorInfo_15_15, Item_10, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12)
          % pred id: 43, proc id: 0
          % vars with new insts: STATE_VARIABLE_List_12, TypeCtorInfo_15_15
        )
        % vars with new insts: Ob_5, STATE_VARIABLE_List_12
      else
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 24
        % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
        % pre-births: STATE_VARIABLE_List_12
        % determinism: det
        STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
        % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
        % vars with new insts: STATE_VARIABLE_List_12
        % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
      )
      % vars with new insts: Ob_5, STATE_VARIABLE_List_12
    ;
    % Kind_6 has functor k3/0
      % context: file "tci_liveness_abort.m", line 106
      % goal id: 9
      % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % determinism: det
      ( if
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 10
        % nonlocals: Ob_5, HostOb_21, TypeClassInfo_for_host_25
        % determinism: semidet
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 11
          % nonlocals: Ob_5, V_16
          % pre-births: V_16
          % determinism: det
          Ob_5 = tci_liveness_abort.object(V_16)
          % Ob_5 => tci_liveness_abort.object/1(V_16)
          % arg-mode 1 in = out
          % vars with new insts: Ob_5, V_16
          ,
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 12
          % nonlocals: V_16, HostOb_21, TypeClassInfo_for_host_25
          % pre-births: TypeClassInfo_for_host_14, HostOb_21, TypeClassInfo_for_host_25
          % determinism: semidet
          V_16 = tci_liveness_abort.host(TypeClassInfo_for_host_25, HostOb_21)
          % V_16 ?= tci_liveness_abort.host/1(TypeClassInfo_for_host_25, HostOb_21)
          % arg-mode 1 in = out
          % arg-mode 2 in = out
          % vars with new insts: V_16, HostOb_21, TypeClassInfo_for_host_25
        )
        % vars with new insts: Ob_5, HostOb_21, TypeClassInfo_for_host_25
      then
        % context: file "tci_liveness_abort.m", line 107
        % goal id: 13
        % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, HostOb_21, TypeClassInfo_for_host_25
        % determinism: det
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 107
          % goal id: 14
          % nonlocals: Ob_5, HostOb_21, TypeClassInfo_for_host_25
          % determinism: det
          tci_liveness_abort.get_value(TypeClassInfo_for_host_25, Ob_5, HostOb_21, Value_17)
          % pred id: 453, proc id: 0
          % vars with new insts: Ob_5
          ,
          % context: file "tci_liveness_abort.m", line 111
          % goal id: 15
          % nonlocals: Item_19
          % pre-births: Item_19
          % determinism: det
          Item_19 = tci_liveness_abort.null
          % Item_19 <= tci_liveness_abort.null/0
          % cons_id type_ctor: tci_liveness_abort.value/0
          % cell_is_unique
          % vars with new insts: Item_19
          ,
          % goal id: 22
          % nonlocals: TypeCtorInfo_15_20
          % pre-births: TypeCtorInfo_15_20
          % determinism: det
          TypeCtorInfo_15_20 = type_ctor_info(tci_liveness_abort, value, 0)
          % TypeCtorInfo_15_20 <= <type_ctor_info tci_liveness_abort.value/0>
          % cell_is_unique
          % vars with new insts: TypeCtorInfo_15_20
          ,
          % context: file "tci_liveness_abort.m", line 115
          % goal id: 23
          % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, Item_19, TypeCtorInfo_15_20
          % pre-births: STATE_VARIABLE_List_12
          % determinism: det
          list.cons(TypeCtorInfo_15_20, Item_19, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12)
          % pred id: 43, proc id: 0
          % vars with new insts: STATE_VARIABLE_List_12, TypeCtorInfo_15_20
        )
        % vars with new insts: Ob_5, STATE_VARIABLE_List_12
      else
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 24
        % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
        % pre-births: STATE_VARIABLE_List_12
        % determinism: det
        STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
        % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
        % vars with new insts: STATE_VARIABLE_List_12
        % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
      )
      % vars with new insts: Ob_5, STATE_VARIABLE_List_12
    )
    % vars with new insts: Ob_5, Kind_6, STATE_VARIABLE_List_12
    
    
    after deadness:
    % context: file "tci_liveness_abort.m", line 101
    % goal id: 1
    % nonlocals: Ob_5, Kind_6, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
    % determinism: det
    ( % cannot_fail switch on Kind_6
    % Kind_6 has functor k1/0
      % context: file "tci_liveness_abort.m", line 101
      % goal id: 4
      % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % pre-deaths: Ob_5, Kind_6
      % pre-births: STATE_VARIABLE_List_12
      % determinism: det
      STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
      % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
      % vars with new insts: STATE_VARIABLE_List_12
      % post-deaths: STATE_VARIABLE_List_0_11
      % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
    ;
    % Kind_6 has functor k2/0
      % context: file "tci_liveness_abort.m", line 106
      % goal id: 9
      % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % pre-deaths: Kind_6
      % determinism: det
      ( if
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 10
        % nonlocals: Ob_5, HostOb_8, TypeClassInfo_for_host_14
        % determinism: semidet
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 11
          % nonlocals: Ob_5, V_13
          % pre-births: V_13
          % determinism: det
          Ob_5 = tci_liveness_abort.object(V_13)
          % Ob_5 => tci_liveness_abort.object/1(V_13)
          % arg-mode 1 in = out
          % vars with new insts: Ob_5, V_13
          ,
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 12
          % nonlocals: HostOb_8, V_13, TypeClassInfo_for_host_14
          % pre-births: HostOb_8, TypeClassInfo_for_host_14
          % determinism: semidet
          V_13 = tci_liveness_abort.host(TypeClassInfo_for_host_14, HostOb_8)
          % V_13 ?= tci_liveness_abort.host/1(TypeClassInfo_for_host_14, HostOb_8)
          % arg-mode 1 in = out
          % arg-mode 2 in = out
          % vars with new insts: HostOb_8, V_13, TypeClassInfo_for_host_14
          % post-deaths: V_13
        )
        % vars with new insts: Ob_5, HostOb_8, TypeClassInfo_for_host_14
      then
        % context: file "tci_liveness_abort.m", line 107
        % goal id: 13
        % nonlocals: Ob_5, HostOb_8, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, TypeClassInfo_for_host_14
        % determinism: det
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 107
          % goal id: 14
          % nonlocals: Ob_5, HostOb_8, Item_10, TypeClassInfo_for_host_14
          % pre-births: Item_10
          % determinism: det
          tci_liveness_abort.get_value(TypeClassInfo_for_host_14, Ob_5, HostOb_8, Item_10)
          % pred id: 453, proc id: 0
          % vars with new insts: Ob_5, Item_10
          % post-deaths: Ob_5, HostOb_8, TypeClassInfo_for_host_14
          ,
          % goal id: 22
          % nonlocals: TypeCtorInfo_15_15
          % pre-births: TypeCtorInfo_15_15
          % determinism: det
          TypeCtorInfo_15_15 = type_ctor_info(tci_liveness_abort, value, 0)
          % TypeCtorInfo_15_15 <= <type_ctor_info tci_liveness_abort.value/0>
          % cell_is_unique
          % vars with new insts: TypeCtorInfo_15_15
          ,
          % context: file "tci_liveness_abort.m", line 115
          % goal id: 23
          % nonlocals: Item_10, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, TypeCtorInfo_15_15
          % pre-births: STATE_VARIABLE_List_12
          % determinism: det
          list.cons(TypeCtorInfo_15_15, Item_10, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12)
          % pred id: 43, proc id: 0
          % vars with new insts: STATE_VARIABLE_List_12, TypeCtorInfo_15_15
          % post-deaths: Item_10, STATE_VARIABLE_List_0_11, TypeCtorInfo_15_15
        )
        % vars with new insts: Ob_5, STATE_VARIABLE_List_12
      else
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 24
        % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
        % pre-deaths: Ob_5
        % pre-births: STATE_VARIABLE_List_12
        % determinism: det
        STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
        % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
        % vars with new insts: STATE_VARIABLE_List_12
        % post-deaths: STATE_VARIABLE_List_0_11
        % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
      )
      % vars with new insts: Ob_5, STATE_VARIABLE_List_12
    ;
    % Kind_6 has functor k3/0
      % context: file "tci_liveness_abort.m", line 106
      % goal id: 9
      % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % pre-deaths: Kind_6
      % determinism: det
      ( if
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 10
        % nonlocals: Ob_5, HostOb_21, TypeClassInfo_for_host_25
        % determinism: semidet
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 11
          % nonlocals: Ob_5, V_16
          % pre-births: V_16
          % determinism: det
          Ob_5 = tci_liveness_abort.object(V_16)
          % Ob_5 => tci_liveness_abort.object/1(V_16)
          % arg-mode 1 in = out
          % vars with new insts: Ob_5, V_16
          ,
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 12
          % nonlocals: V_16, HostOb_21, TypeClassInfo_for_host_25
          % pre-births: TypeClassInfo_for_host_14, HostOb_21, TypeClassInfo_for_host_25
          % determinism: semidet
          V_16 = tci_liveness_abort.host(TypeClassInfo_for_host_25, HostOb_21)
          % V_16 ?= tci_liveness_abort.host/1(TypeClassInfo_for_host_25, HostOb_21)
          % arg-mode 1 in = out
          % arg-mode 2 in = out
          % vars with new insts: V_16, HostOb_21, TypeClassInfo_for_host_25
          % post-deaths: V_16
        )
        % vars with new insts: Ob_5, HostOb_21, TypeClassInfo_for_host_25
      then
        % context: file "tci_liveness_abort.m", line 107
        % goal id: 13
        % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, HostOb_21, TypeClassInfo_for_host_25
        % determinism: det
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 107
          % goal id: 14
          % nonlocals: Ob_5, HostOb_21, TypeClassInfo_for_host_25
          % determinism: det
          tci_liveness_abort.get_value(TypeClassInfo_for_host_25, Ob_5, HostOb_21, Value_17)
          % pred id: 453, proc id: 0
          % vars with new insts: Ob_5
          % post-deaths: Ob_5, TypeClassInfo_for_host_14, HostOb_21, TypeClassInfo_for_host_25
          ,
          % context: file "tci_liveness_abort.m", line 111
          % goal id: 15
          % nonlocals: Item_19
          % pre-births: Item_19
          % determinism: det
          Item_19 = tci_liveness_abort.null
          % Item_19 <= tci_liveness_abort.null/0
          % cons_id type_ctor: tci_liveness_abort.value/0
          % cell_is_unique
          % vars with new insts: Item_19
          ,
          % goal id: 22
          % nonlocals: TypeCtorInfo_15_20
          % pre-births: TypeCtorInfo_15_20
          % determinism: det
          TypeCtorInfo_15_20 = type_ctor_info(tci_liveness_abort, value, 0)
          % TypeCtorInfo_15_20 <= <type_ctor_info tci_liveness_abort.value/0>
          % cell_is_unique
          % vars with new insts: TypeCtorInfo_15_20
          ,
          % context: file "tci_liveness_abort.m", line 115
          % goal id: 23
          % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, Item_19, TypeCtorInfo_15_20
          % pre-births: STATE_VARIABLE_List_12
          % determinism: det
          list.cons(TypeCtorInfo_15_20, Item_19, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12)
          % pred id: 43, proc id: 0
          % vars with new insts: STATE_VARIABLE_List_12, TypeCtorInfo_15_20
          % post-deaths: STATE_VARIABLE_List_0_11, Item_19, TypeCtorInfo_15_20
        )
        % vars with new insts: Ob_5, STATE_VARIABLE_List_12
      else
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 24
        % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
        % pre-deaths: Ob_5
        % pre-births: STATE_VARIABLE_List_12
        % determinism: det
        STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
        % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
        % vars with new insts: STATE_VARIABLE_List_12
        % post-deaths: STATE_VARIABLE_List_0_11
        % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
      )
      % vars with new insts: Ob_5, STATE_VARIABLE_List_12
    )
    % vars with new insts: Ob_5, Kind_6, STATE_VARIABLE_List_12
    
    
    after delay death:
    % context: file "tci_liveness_abort.m", line 101
    % goal id: 1
    % nonlocals: Ob_5, Kind_6, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
    % determinism: det
    ( % cannot_fail switch on Kind_6
    % Kind_6 has functor k1/0
      % context: file "tci_liveness_abort.m", line 101
      % goal id: 4
      % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % pre-births: STATE_VARIABLE_List_12
      % determinism: det
      STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
      % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
      % vars with new insts: STATE_VARIABLE_List_12
      % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
    ;
    % Kind_6 has functor k2/0
      % context: file "tci_liveness_abort.m", line 106
      % goal id: 9
      % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % determinism: det
      ( if
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 10
        % nonlocals: Ob_5, HostOb_8, TypeClassInfo_for_host_14
        % determinism: semidet
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 11
          % nonlocals: Ob_5, V_13
          % pre-births: V_13
          % determinism: det
          Ob_5 = tci_liveness_abort.object(V_13)
          % Ob_5 => tci_liveness_abort.object/1(V_13)
          % arg-mode 1 in = out
          % vars with new insts: Ob_5, V_13
          ,
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 12
          % nonlocals: HostOb_8, V_13, TypeClassInfo_for_host_14
          % pre-births: HostOb_8, TypeClassInfo_for_host_14
          % determinism: semidet
          V_13 = tci_liveness_abort.host(TypeClassInfo_for_host_14, HostOb_8)
          % V_13 ?= tci_liveness_abort.host/1(TypeClassInfo_for_host_14, HostOb_8)
          % arg-mode 1 in = out
          % arg-mode 2 in = out
          % vars with new insts: HostOb_8, V_13, TypeClassInfo_for_host_14
          % post-deaths: V_13
        )
        % vars with new insts: Ob_5, HostOb_8, TypeClassInfo_for_host_14
      then
        % context: file "tci_liveness_abort.m", line 107
        % goal id: 13
        % nonlocals: Ob_5, HostOb_8, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, TypeClassInfo_for_host_14
        % determinism: det
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 107
          % goal id: 14
          % nonlocals: Ob_5, HostOb_8, Item_10, TypeClassInfo_for_host_14
          % pre-births: Item_10
          % determinism: det
          tci_liveness_abort.get_value(TypeClassInfo_for_host_14, Ob_5, HostOb_8, Item_10)
          % pred id: 453, proc id: 0
          % vars with new insts: Ob_5, Item_10
          ,
          % goal id: 22
          % nonlocals: TypeCtorInfo_15_15
          % pre-births: TypeCtorInfo_15_15
          % determinism: det
          TypeCtorInfo_15_15 = type_ctor_info(tci_liveness_abort, value, 0)
          % TypeCtorInfo_15_15 <= <type_ctor_info tci_liveness_abort.value/0>
          % cell_is_unique
          % vars with new insts: TypeCtorInfo_15_15
          ,
          % context: file "tci_liveness_abort.m", line 115
          % goal id: 23
          % nonlocals: Item_10, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, TypeCtorInfo_15_15
          % pre-births: STATE_VARIABLE_List_12
          % determinism: det
          list.cons(TypeCtorInfo_15_15, Item_10, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12)
          % pred id: 43, proc id: 0
          % vars with new insts: STATE_VARIABLE_List_12, TypeCtorInfo_15_15
        )
        % vars with new insts: Ob_5, STATE_VARIABLE_List_12
        % post-deaths: HostOb_8, Item_10, TypeClassInfo_for_host_14, TypeCtorInfo_15_15
      else
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 24
        % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
        % pre-births: STATE_VARIABLE_List_12
        % determinism: det
        STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
        % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
        % vars with new insts: STATE_VARIABLE_List_12
        % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
      )
      % vars with new insts: Ob_5, STATE_VARIABLE_List_12
    ;
    % Kind_6 has functor k3/0
      % context: file "tci_liveness_abort.m", line 106
      % goal id: 9
      % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % determinism: det
      ( if
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 10
        % nonlocals: Ob_5, HostOb_21, TypeClassInfo_for_host_25
        % determinism: semidet
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 11
          % nonlocals: Ob_5, V_16
          % pre-births: V_16
          % determinism: det
          Ob_5 = tci_liveness_abort.object(V_16)
          % Ob_5 => tci_liveness_abort.object/1(V_16)
          % arg-mode 1 in = out
          % vars with new insts: Ob_5, V_16
          ,
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 12
          % nonlocals: V_16, HostOb_21, TypeClassInfo_for_host_25
          % pre-births: TypeClassInfo_for_host_14, HostOb_21, TypeClassInfo_for_host_25
          % determinism: semidet
          V_16 = tci_liveness_abort.host(TypeClassInfo_for_host_25, HostOb_21)
          % V_16 ?= tci_liveness_abort.host/1(TypeClassInfo_for_host_25, HostOb_21)
          % arg-mode 1 in = out
          % arg-mode 2 in = out
          % vars with new insts: V_16, HostOb_21, TypeClassInfo_for_host_25
          % post-deaths: V_16
        )
        % vars with new insts: Ob_5, HostOb_21, TypeClassInfo_for_host_25
      then
        % context: file "tci_liveness_abort.m", line 107
        % goal id: 13
        % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, HostOb_21, TypeClassInfo_for_host_25
        % determinism: det
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 107
          % goal id: 14
          % nonlocals: Ob_5, HostOb_21, TypeClassInfo_for_host_25
          % determinism: det
          tci_liveness_abort.get_value(TypeClassInfo_for_host_25, Ob_5, HostOb_21, Value_17)
          % pred id: 453, proc id: 0
          % vars with new insts: Ob_5
          ,
          % context: file "tci_liveness_abort.m", line 111
          % goal id: 15
          % nonlocals: Item_19
          % pre-births: Item_19
          % determinism: det
          Item_19 = tci_liveness_abort.null
          % Item_19 <= tci_liveness_abort.null/0
          % cons_id type_ctor: tci_liveness_abort.value/0
          % cell_is_unique
          % vars with new insts: Item_19
          ,
          % goal id: 22
          % nonlocals: TypeCtorInfo_15_20
          % pre-births: TypeCtorInfo_15_20
          % determinism: det
          TypeCtorInfo_15_20 = type_ctor_info(tci_liveness_abort, value, 0)
          % TypeCtorInfo_15_20 <= <type_ctor_info tci_liveness_abort.value/0>
          % cell_is_unique
          % vars with new insts: TypeCtorInfo_15_20
          ,
          % context: file "tci_liveness_abort.m", line 115
          % goal id: 23
          % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, Item_19, TypeCtorInfo_15_20
          % pre-births: STATE_VARIABLE_List_12
          % determinism: det
          list.cons(TypeCtorInfo_15_20, Item_19, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12)
          % pred id: 43, proc id: 0
          % vars with new insts: STATE_VARIABLE_List_12, TypeCtorInfo_15_20
        )
        % vars with new insts: Ob_5, STATE_VARIABLE_List_12
        % post-deaths: TypeClassInfo_for_host_14, Item_19, TypeCtorInfo_15_20, HostOb_21, TypeClassInfo_for_host_25
      else
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 24
        % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
        % pre-births: STATE_VARIABLE_List_12
        % determinism: det
        STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
        % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
        % vars with new insts: STATE_VARIABLE_List_12
        % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
      )
      % vars with new insts: Ob_5, STATE_VARIABLE_List_12
    )
    % vars with new insts: Ob_5, Kind_6, STATE_VARIABLE_List_12
    % post-deaths: Ob_5, Kind_6, STATE_VARIABLE_List_0_11
    
    
    after resume point:
    % context: file "tci_liveness_abort.m", line 101
    % goal id: 1
    % nonlocals: Ob_5, Kind_6, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
    % determinism: det
    ( % cannot_fail switch on Kind_6
    % Kind_6 has functor k1/0
      % context: file "tci_liveness_abort.m", line 101
      % goal id: 4
      % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % pre-births: STATE_VARIABLE_List_12
      % determinism: det
      STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
      % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
      % vars with new insts: STATE_VARIABLE_List_12
      % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
    ;
    % Kind_6 has functor k2/0
      % context: file "tci_liveness_abort.m", line 106
      % goal id: 9
      % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % determinism: det
      ( if
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 10
        % nonlocals: Ob_5, HostOb_8, TypeClassInfo_for_host_14
        % determinism: semidet
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 11
          % nonlocals: Ob_5, V_13
          % pre-births: V_13
          % determinism: det
          Ob_5 = tci_liveness_abort.object(V_13)
          % Ob_5 => tci_liveness_abort.object/1(V_13)
          % arg-mode 1 in = out
          % vars with new insts: Ob_5, V_13
          ,
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 12
          % nonlocals: HostOb_8, V_13, TypeClassInfo_for_host_14
          % pre-births: HostOb_8, TypeClassInfo_for_host_14
          % determinism: semidet
          V_13 = tci_liveness_abort.host(TypeClassInfo_for_host_14, HostOb_8)
          % V_13 ?= tci_liveness_abort.host/1(TypeClassInfo_for_host_14, HostOb_8)
          % arg-mode 1 in = out
          % arg-mode 2 in = out
          % vars with new insts: HostOb_8, V_13, TypeClassInfo_for_host_14
          % post-deaths: V_13
        )
        % vars with new insts: Ob_5, HostOb_8, TypeClassInfo_for_host_14
        % resume point orig only Ob_5, Kind_6, STATE_VARIABLE_List_0_11
      then
        % context: file "tci_liveness_abort.m", line 107
        % goal id: 13
        % nonlocals: Ob_5, HostOb_8, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, TypeClassInfo_for_host_14
        % determinism: det
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 107
          % goal id: 14
          % nonlocals: Ob_5, HostOb_8, Item_10, TypeClassInfo_for_host_14
          % pre-births: Item_10
          % determinism: det
          tci_liveness_abort.get_value(TypeClassInfo_for_host_14, Ob_5, HostOb_8, Item_10)
          % pred id: 453, proc id: 0
          % vars with new insts: Ob_5, Item_10
          ,
          % goal id: 22
          % nonlocals: TypeCtorInfo_15_15
          % pre-births: TypeCtorInfo_15_15
          % determinism: det
          TypeCtorInfo_15_15 = type_ctor_info(tci_liveness_abort, value, 0)
          % TypeCtorInfo_15_15 <= <type_ctor_info tci_liveness_abort.value/0>
          % cell_is_unique
          % vars with new insts: TypeCtorInfo_15_15
          ,
          % context: file "tci_liveness_abort.m", line 115
          % goal id: 23
          % nonlocals: Item_10, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, TypeCtorInfo_15_15
          % pre-births: STATE_VARIABLE_List_12
          % determinism: det
          list.cons(TypeCtorInfo_15_15, Item_10, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12)
          % pred id: 43, proc id: 0
          % vars with new insts: STATE_VARIABLE_List_12, TypeCtorInfo_15_15
        )
        % vars with new insts: Ob_5, STATE_VARIABLE_List_12
        % post-deaths: HostOb_8, Item_10, TypeClassInfo_for_host_14, TypeCtorInfo_15_15
      else
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 24
        % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
        % pre-births: STATE_VARIABLE_List_12
        % determinism: det
        STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
        % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
        % vars with new insts: STATE_VARIABLE_List_12
        % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
      )
      % vars with new insts: Ob_5, STATE_VARIABLE_List_12
    ;
    % Kind_6 has functor k3/0
      % context: file "tci_liveness_abort.m", line 106
      % goal id: 9
      % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
      % determinism: det
      ( if
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 10
        % nonlocals: Ob_5, HostOb_21, TypeClassInfo_for_host_25
        % determinism: semidet
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 11
          % nonlocals: Ob_5, V_16
          % pre-births: V_16
          % determinism: det
          Ob_5 = tci_liveness_abort.object(V_16)
          % Ob_5 => tci_liveness_abort.object/1(V_16)
          % arg-mode 1 in = out
          % vars with new insts: Ob_5, V_16
          ,
          % context: file "tci_liveness_abort.m", line 106
          % goal id: 12
          % nonlocals: V_16, HostOb_21, TypeClassInfo_for_host_25
          % pre-births: TypeClassInfo_for_host_14, HostOb_21, TypeClassInfo_for_host_25
          % determinism: semidet
          V_16 = tci_liveness_abort.host(TypeClassInfo_for_host_25, HostOb_21)
          % V_16 ?= tci_liveness_abort.host/1(TypeClassInfo_for_host_25, HostOb_21)
          % arg-mode 1 in = out
          % arg-mode 2 in = out
          % vars with new insts: V_16, HostOb_21, TypeClassInfo_for_host_25
          % post-deaths: V_16
        )
        % vars with new insts: Ob_5, HostOb_21, TypeClassInfo_for_host_25
        % resume point orig only Ob_5, Kind_6, STATE_VARIABLE_List_0_11
      then
        % context: file "tci_liveness_abort.m", line 107
        % goal id: 13
        % nonlocals: Ob_5, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, HostOb_21, TypeClassInfo_for_host_25
        % determinism: det
        ( % conjunction
          % context: file "tci_liveness_abort.m", line 107
          % goal id: 14
          % nonlocals: Ob_5, HostOb_21, TypeClassInfo_for_host_25
          % determinism: det
          tci_liveness_abort.get_value(TypeClassInfo_for_host_25, Ob_5, HostOb_21, Value_17)
          % pred id: 453, proc id: 0
          % vars with new insts: Ob_5
          ,
          % context: file "tci_liveness_abort.m", line 111
          % goal id: 15
          % nonlocals: Item_19
          % pre-births: Item_19
          % determinism: det
          Item_19 = tci_liveness_abort.null
          % Item_19 <= tci_liveness_abort.null/0
          % cons_id type_ctor: tci_liveness_abort.value/0
          % cell_is_unique
          % vars with new insts: Item_19
          ,
          % goal id: 22
          % nonlocals: TypeCtorInfo_15_20
          % pre-births: TypeCtorInfo_15_20
          % determinism: det
          TypeCtorInfo_15_20 = type_ctor_info(tci_liveness_abort, value, 0)
          % TypeCtorInfo_15_20 <= <type_ctor_info tci_liveness_abort.value/0>
          % cell_is_unique
          % vars with new insts: TypeCtorInfo_15_20
          ,
          % context: file "tci_liveness_abort.m", line 115
          % goal id: 23
          % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12, Item_19, TypeCtorInfo_15_20
          % pre-births: STATE_VARIABLE_List_12
          % determinism: det
          list.cons(TypeCtorInfo_15_20, Item_19, STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12)
          % pred id: 43, proc id: 0
          % vars with new insts: STATE_VARIABLE_List_12, TypeCtorInfo_15_20
        )
        % vars with new insts: Ob_5, STATE_VARIABLE_List_12
        % post-deaths: TypeClassInfo_for_host_14, Item_19, TypeCtorInfo_15_20, HostOb_21, TypeClassInfo_for_host_25
      else
        % context: file "tci_liveness_abort.m", line 106
        % goal id: 24
        % nonlocals: STATE_VARIABLE_List_0_11, STATE_VARIABLE_List_12
        % pre-births: STATE_VARIABLE_List_12
        % determinism: det
        STATE_VARIABLE_List_12 = STATE_VARIABLE_List_0_11
        % STATE_VARIABLE_List_12 := STATE_VARIABLE_List_0_11
        % vars with new insts: STATE_VARIABLE_List_12
        % Goal features: [feature_do_not_warn_singleton, feature_state_var_copy]
      )
      % vars with new insts: Ob_5, STATE_VARIABLE_List_12
    )
    % vars with new insts: Ob_5, Kind_6, STATE_VARIABLE_List_12
    % post-deaths: Ob_5, Kind_6, STATE_VARIABLE_List_0_11
    
    Uncaught Mercury exception:
    Software Error: map.lookup: key not found
    	Key Type: term.var(parse_tree.prog_data.prog_var_type)
    	Key Value: var(14)
    	Value Type: ll_backend.var_locn.var_state
    Stack dump follows:
       0       pred exception.throw/1-0 (erroneous) (exception.m:312)
       1       pred require.error/1-0 (erroneous) (require.m:173)
       2       pred require.report_lookup_error/3-0 (erroneous) (require.m:277)
       3       pred map.lookup/3-0 (det) (map.m:1463)
       4       pred ll_backend.var_locn.var_locn_produce_var_in_reg_or_stack/5-0 (det) (var_locn.m:1659)
       5       pred ll_backend.code_loc_dep.produce_variable_in_reg_or_stack/5-0 (det) (code_loc_dep.m:3196)
       6       pred ll_backend.trace_gen.trace_produce_var/9-0 (det) (trace_gen.m:1312)
       7    4* pred ll_backend.trace_gen.trace_produce_vars/11-0 (det) (trace_gen.m:1301 and others)
      11       pred ll_backend.trace_gen.generate_event_code/13-0 (det) (trace_gen.m:1148)
      12       pred ll_backend.trace_gen.maybe_generate_internal_event_code/7-0 (det) (trace_gen.m:912)
      13       pred ll_backend.ite_gen.generate_ite/10-0 (det) (ite_gen.m:216)
      14       pred ll_backend.code_gen.generate_goal_expr/9-0 (det) (code_gen.m:267)
      15       pred ll_backend.code_gen.generate_goal/7-0 (det) (code_gen.m:136)
      16    3* pred ll_backend.switch_gen.generate_if_then_else_chain_cases/15-0 (det) (switch_gen.m:622 and others)
      19       pred ll_backend.switch_gen.order_and_generate_cases/13-0 (det) (switch_gen.m:406)
      20       pred ll_backend.switch_gen.generate_int_switch/16-0 (det) (switch_gen.m:254)
      21       pred ll_backend.switch_gen.generate_switch/10-0 (det) (switch_gen.m:164)
      22       pred ll_backend.code_gen.generate_goal_expr/9-0 (det) (code_gen.m:271)
      23       pred ll_backend.code_gen.generate_goal/7-0 (det) (code_gen.m:136)
      24       pred ll_backend.proc_gen.generate_det_code/10-0 (det) (proc_gen.m:748)
      25       pred ll_backend.proc_gen.generate_category_code/11-0 (det) (proc_gen.m:696)
      26       pred ll_backend.proc_gen.generate_proc_code/10-0 (det) (proc_gen.m:428)
      27       pred top_level.mercury_compile_llds_back_end.llds_backend_pass_for_proc/14-0 (det) (mercury_compile_llds_back_end.m:469)
      28       pred top_level.mercury_compile_llds_back_end.llds_backend_pass_for_pred/13-0 (det) (mercury_compile_llds_back_end.m:373)
      29       pred top_level.mercury_compile_llds_back_end.llds_backend_pass_by_preds_do_one_pred/14-0 (det) (mercury_compile_llds_back_end.m:338)
      30       pred top_level.mercury_compile_llds_back_end.llds_backend_pass_by_preds_loop_over_preds/13-0 (det) (mercury_compile_llds_back_end.m:281)
      31       pred top_level.mercury_compile_llds_back_end.llds_backend_pass_by_preds/8-0 (det) (mercury_compile_llds_back_end.m:260)
      32       pred top_level.mercury_compile_llds_back_end.hlds_to_llds/10-0 (det) (mercury_compile_llds_back_end.m:170)
      33       pred top_level.mercury_compile_augment.choose_and_execute_backend_passes/15-0 (det) (mercury_compile_augment.m:514)
      34       pred top_level.mercury_compile_augment.after_front_end_passes/14-0 (det) (mercury_compile_augment.m:412)
      35       pred top_level.mercury_compile_augment.process_augmented_module/16-0 (det) (mercury_compile_augment.m:283)
      36       pred top_level.mercury_compile_augment.augment_and_process_module/14-0 (det) (mercury_compile_augment.m:209)
      37       pred list.map_foldl3/9-0 (det) (list.m:4575)
      38       pred top_level.mercury_compile_augment.augment_and_process_all_submodules/15-0 (det) (mercury_compile_augment.m:158)
      39       pred top_level.mercury_compile_augment.augment_and_process_source_file/17-0 (det) (mercury_compile_augment.m:136)
      40       pred top_level.mercury_compile_main.read_augment_and_process_module/15-0 (det) (mercury_compile_main.m:1162)
      41       pred top_level.mercury_compile_main.do_process_compiler_arg/13-0 (det) (mercury_compile_main.m:800)
      42       pred top_level.mercury_compile_main.setup_and_process_compiler_arg/13-0 (det) (mercury_compile_main.m:676)
      43       pred top_level.mercury_compile_main.setup_and_process_compiler_cmd_line_args/15-0 (det) (mercury_compile_main.m:588)
      44       pred top_level.mercury_compile_main.do_op_mode_args/13-0 (det) (mercury_compile_main.m:423)
      45       pred top_level.mercury_compile_main.do_op_mode/11-0 (det) (mercury_compile_main.m:248)
      46       pred top_level.mercury_compile_main.main_after_setup/6-0 (det) (mercury_compile_main.m:203)
      47       pred top_level.mercury_compile_main.real_main/2-0 (det) (mercury_compile_main.m:124)
      48       pred mercury_compile.main/2-0 (det) (mercury_compile.m:32)
    
    txt file icon debug-liveness-pred-id-0.txt (49,982 bytes) 2026-05-12 17:11 +

-Relationships
+Relationships

-Notes

~0001254

zs (developer)

Peter, your suspicion is bang-on target.

The bug is caused by a known limitation of the RTTI system
that has been there from the beginning.

I debugged the code of test2 instead of test1 because it is
slightly shorter, but the issue is the same in both predicates.
The problematic entry in the prebirth set of the existentally typed
deconstruction in the second switch arm is added by the call chain

detect_liveness_in_goal
-> get_nonlocals_and_typeinfos
-> maybe_complete_with_typeinfo
-> maybe_complete_with_typeinfo_vars
-> get_typeinfo_vars (invoked only with typeinfo liveness).

which returns the locations of the variables holding typeinfos
(either directly, or, as in this case, via a typeclass info)
for its input vars. It finds that information in the second field
of the supplied RttiVarMaps, which is constructed right alongside
the first field. It is these fields that have the problematic
limitation.

- For a class constraint, the first field can record
  only one typeclass info var.

- For a type, the second field can record only one location
  where its typeinfo can be found.

This limit is not a problem in the absence of existential types
(the context in which it was developed). It is not a problem
in the presence of existential types *if* the code has no branches.
In the presence of existential types *and* branches, such as
the definitions of test1 and test2, it fails, because distinct
branches can pick up distinct typeclass infos for the same
constraint from different existential deconstructions.

When the liveness pass processes the existential deconstruction
in the second switch arm in test2, RttiVarMaps contains this:

    rtti_varmaps(
      map([
          (constraint(qualified(unqualified("bug585"), "host"),
            [type_variable(var(1), kind_star)]) ->
            var(10))]),
      
      map([(var(1) -> typeclass_info(var(10), 1))]),
      
      map([]),
      
      map([
          (var(10) ->
            constraint(qualified(unqualified("bug585"), "host"),
              [type_variable(var(1), kind_star)])),
          (var(15) ->
            constraint(qualified(unqualified("bug585"), "host"),
              [type_variable(var(1), kind_star)]))]))

The fourth field effectively contains two directed edges
from typeclass info variables to the constraints they represent.
The first field is supposed to contain the same edges
in the reverse direction, but since vars 10 and 15 represent
the *same* class constraint, this is not possible.
The exact same issue also occurs with the second field, for
values that say that a typeinfo is stored in a typeclass info
(as this one says that the typeinfo for type var 1 is stored
in slot 1 inside the typeclass info pointed to by variable 10).

Since the source of the bug is a bad rtti_varmap, the bug
is confined to grades that use RTTI. These include .agc grades
(which we do not really support), .profdeep grades (which
don't have the bug because they don't use typeinfo_liveness),
and debug grades.

To the best of my knowledge, the last time anyone seriously
worked on rtti_varmaps was Mark, about 15 to 20 years ago.
I remember that I discussed this issue with him then, and
took away the conclusion that

- fixing this limitation would be a lot of work, mostly because
  of the need to handle situations in which the code *after*
  a branched goal needs access to a "consensus" typeclass_info
  for each constraint after each problematic branched goal, and

- given the rarity of the problem, this work would not be justified.

One possible pragmatic solution would be to add code to the
simplification pass at its end-of-semantic-analysis invocation
that in debug grades, would test whether any procedures had
rtti_varmaps that were "missing" reverse edges, and if so,
generate a "sorry, not implemented" diagnostic and then quit.

Stopping the compiler from duplicating a switch arm (the k2/k3
arm in this case) would also fix this test case, but that is
not a good idea, because manually written code that contains
separate k2 and k3 arms would still cause a compiler crash.

~0001255

wangp (developer)

I'm not sure the situation is so rare that a "sorry" diagnostic is sufficient. If a program uses existential types then existential deconstructions and branching do not seem unlikely and, for any larger program, the programmer is liable to want to build the program for debugging (even if not debugging that particular module).

I wonder if the compiler could, upon detecting that the issue will occur, automatically apply a workaround. For example, the test2 predicate compiles without issue if transformed to the following. (Other workarounds may be possible, this is just one that I thought of.)


test2(Ob, Kind, Item) :-
    require_complete_switch [Kind]
    (
        Kind = k1,
        fail
    ;
        ( Kind = k2
        ; Kind = k3
        ),
        Ob ^ class = host(HostOb),
        Cont = (pred(Item1::out) is semidet :-
            get_value(Ob, HostOb, Value),
            (
                Kind = k2,
                Item1 = Value
            ;
                Kind = k3,
                Item1 = null
            )
        ),
        Cont(Item)
    ).

~0001256

zs (developer)

I think this is only either the second or the third time this issue
has come up in 15 to 20 years. I think that qualifies as "rare".

Second, your workaround suffers from two flaws.

The first I already mentioned in my previous note: it is only a part solution.
It prevents the compiler from automatically duplicating the call to get_value
(by hiding the k2/k3 subswitch that makes it worthwhile for the compiler
to duplicate the code leading to that subswitch), but does nothing to stop
compiler aborts in situations in which the programmer writes duplicates
of such calls himself/herself.

The second is that it would cause the debugger to present to the programmer
events from a construct (the lambda expr) that the programmer did not write
and would not expect.

If the "sorry, NYI" message mentions the workaround of breaking up the procedure body
into smaller parts until there is only one existential deconstruction of any specific
value in each of the resulting smaller predicates, the picture presented by mdb
would match the program's actual code. When writing the text of that message,
we would have to choose between

- explaining the circumstances under which the compiler could automatically create
  problematic copies of existential deconstructions, so that programmers could
  avoid those circumstances, or

- changing the compiler's behavior to prevent it from creating such copies.

The second would not be trivial, but the first may be even harder :-(

~0001257

wangp (developer)

Here's a starting point for an error message, perhaps:

Sorry: due to a compiler limitation, you cannot perform existential
deconstruction of a term such that the existential type info would be bound to
different (hidden) variables across different branches in the predicate or
function. You could work around this limitation by performing the existential
deconstruction in a helper predicate that does not contain branching.

~0001258

zs (developer)

That text does not address the issue that makes the wording hard to do,
which is that your test case predicates each contain only a single existential
deconstruction was written (meaning that they already comply with the "does not
contain branching" condition), but the code seen by the code generator *does*
contain branching, added by the compiler.

I will have a look at doing the second approach.
+Notes

-Issue History
Date Modified Username Field Change
2026-05-12 17:10 wangp New Issue
2026-05-12 17:10 wangp File Added: tci_liveness_abort.m
2026-05-12 17:11 wangp File Added: debug-liveness-pred-id-0.txt
2026-05-14 17:35 zs Assigned To => zs
2026-05-14 17:35 zs Status new => assigned
2026-05-14 21:53 zs Note Added: 0001254
2026-05-15 16:04 wangp Note Added: 0001255
2026-05-15 16:35 zs Note Added: 0001256
2026-05-18 15:56 wangp Note Added: 0001257
2026-05-18 16:07 zs Note Added: 0001258
+Issue History