%------------------------------------------------------------------------------
% File : DAT465_1 : TPTP v10.0.0. Released v10.0.0.
% Domain : Data Structures
% Problem : Flattening a tree invariant under reassociating its nested nodes.
% Version : Especial.
% English :
% Refs : [HH+21] Hajdu et al. (2021), Inductive Benchmarks for Automate
% : [Raw26] Rawson (2026), Email to Geoff Sutcliffe
% Source : [Raw26]
% Names : tree-crafted_flatten0_rotate_3var-0.p [Raw26]
% Status : Theorem
% Rating : ? v10.0.0
% Syntax : Number of formulae : 16 ( 5 unt; 11 typ; 0 def)
% Number of atoms : 5 ( 5 equ)
% Maximal formula atoms : 1 ( 1 avg)
% Number of connectives : 0 ( 0 ~; 0 |; 0 &)
% ( 0 <=>; 0 =>; 0 <=; 0 <~>)
% Maximal formula depth : 4 ( 3 avg)
% Maximal term depth : 4 ( 2 avg)
% Number of types : 3 ( 3 usr; 0 ari; 3 dat; 0 cdt)
% Number of type conns : 9 ( 5 >; 4 *; 0 +; 0 <<)
% Number of predicates : 1 ( 0 usr; 0 prp; 2-2 aty)
% Number of functors : 8 ( 8 usr; 3 con; 0-3 aty)
% Number of variables : 10 ( 10 !; 0 ?; 10 :)
% SPC : TF0_THM_EQU_NAR_DAT
% Comments :
%------------------------------------------------------------------------------
tff(nat_type,type-datatype,
nat: $tType ).
tff(list_type,type-datatype,
list: $tType ).
tff(tree_type,type-datatype,
tree: $tType ).
tff(zero_type,type-datatype_constructor,
zero: nat ).
tff(s_type,type-datatype_constructor,
s: nat > nat ).
tff(nil_type,type-datatype_constructor,
nil: list ).
tff(cons_type,type-datatype_constructor,
cons: ( nat * list ) > list ).
tff(leaf_type,type-datatype_constructor,
leaf: tree ).
tff(node_type,type-datatype_constructor,
node: ( tree * nat * tree ) > tree ).
tff(app_type,type,
app: ( list * list ) > list ).
tff(1,axiom,
! [R: list] : ( app(nil,R) = R ) ).
tff(2,axiom,
! [A: nat,L: list,R: list] : ( app(cons(A,L),R) = cons(A,app(L,R)) ) ).
tff(flatten0_type,type,
flatten0: tree > list ).
tff(3,axiom,
flatten0(leaf) = nil ).
tff(4,axiom,
! [P: tree,X: nat,Q: tree] : ( flatten0(node(P,X,Q)) = app(flatten0(P),cons(X,flatten0(Q))) ) ).
tff(goal,conjecture,
! [P: tree,X: nat,Y: nat] : ( flatten0(node(node(P,X,P),Y,P)) = flatten0(node(P,X,node(P,Y,P))) ) ).
%------------------------------------------------------------------------------