From fe1be9b3f093fbe24e768a44e6d4aff158b8d2b6 Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Wed, 31 Oct 2018 23:41:09 +0100 Subject: [PATCH] Removing term_iterate_deVar, which is now obsolete. --- src/TODO-trampolines.txt | 6 ---- src/term.c | 70 ++-------------------------------------- src/term.h | 3 -- 3 files changed, 2 insertions(+), 77 deletions(-) diff --git a/src/TODO-trampolines.txt b/src/TODO-trampolines.txt index 590b919..24844d9 100644 --- a/src/TODO-trampolines.txt +++ b/src/TODO-trampolines.txt @@ -4,15 +4,10 @@ 3 unify mgu.c +233 ; mgu.c +247 ; mgu.c +281 1 iterateLocalToOther prune_theorems.c +108 1 term_iterate_leaves term.c +1145 -1 term_iterate_deVar term.c +1544 - -term_iterate_deVar - term_iterate_state_deVar term_iterate_leaves term_iterate_state_leaves - dependencies: iterateTermOther is called using makeDepend and addOther @@ -21,5 +16,4 @@ term_iterate_open_leaves is called using addsubterms unify is called using unify_combine_enc and unify_combined_tup, and a callback using the keys list? (which propagates back to subtermunify data) iterateLocalToOther is called using checkTerm term_iterate_leaves is called using testleaf -term_iterate_deVar is not called? diff --git a/src/term.c b/src/term.c index b5594f0..cbbe101 100644 --- a/src/term.c +++ b/src/term.c @@ -1044,72 +1044,6 @@ term_iterate (const Term term, int (*leaf) (Term t), int (*nodel) (Term t), return 1; } -//! Generic term iteration -int -term_iterate_deVar (Term term, int (*leaf) (Term t), int (*nodel) (Term t), - int (*nodem) (Term t), int (*noder) (Term t)) -{ - term = deVar (term); - if (term != NULL) - { - if (realTermLeaf (term)) - { - // Leaf - if (leaf != NULL) - { - return leaf (term); - } - else - { - return true; - } - } - else - { - int flag; - - flag = true; - - if (nodel != NULL) - flag = flag && nodel (term); - - // Left part - if (realTermTuple (term)) - flag = flag - && - (term_iterate_deVar - (TermOp1 (term), leaf, nodel, nodem, noder)); - else - flag = flag - && - (term_iterate_deVar (TermOp (term), leaf, nodel, nodem, noder)); - - // Center - - if (nodem != NULL) - flag = flag && nodem (term); - - // right part - if (realTermTuple (term)) - flag = flag - && - (term_iterate_deVar - (TermOp2 (term), leaf, nodel, nodem, noder)); - else - flag = flag - && - (term_iterate_deVar - (TermKey (term), leaf, nodel, nodem, noder)); - - if (noder != NULL) - flag = flag && noder (term); - - return flag; - } - } - return true; -} - //! Generic term iteration with state int term_iterate_state_deVar (Term term, int (*leaf) (), @@ -1639,7 +1573,7 @@ termSubstPrint (Term t) int iterateTermOther (const int myrun, Term t, int (*callback) (Term t)) { - int testOther (Term t) + int testOther (Term t, int *state) { int run; @@ -1650,5 +1584,5 @@ iterateTermOther (const int myrun, Term t, int (*callback) (Term t)) } return true; } - return term_iterate_deVar (t, testOther, NULL, NULL, NULL); + return term_iterate_state_deVar (t, testOther, NULL, NULL, NULL, NULL); } diff --git a/src/term.h b/src/term.h index 937e056..7a537d2 100644 --- a/src/term.h +++ b/src/term.h @@ -194,9 +194,6 @@ int termOrder (Term t1, Term t2); int term_iterate (const Term term, int (*leaf) (Term t), int (*nodel) (Term t), int (*nodem) (Term t), int (*noder) (Term t)); -int term_iterate_deVar (Term term, int (*leaf) (Term t), - int (*nodel) (Term t), int (*nodem) (Term t), - int (*noder) (Term t)); int term_iterate_state_deVar (Term term, int (*leaf) (), int (*nodel) (), int (*nodem) (),