diff --git a/src/arachne.c b/src/arachne.c index f0ea864..9b7e012 100644 --- a/src/arachne.c +++ b/src/arachne.c @@ -1452,8 +1452,6 @@ bind_goal (const Binding b) if (!b->done) { int flag; - int know_only; - Term function; flag = 1; proof_select_goal (b); @@ -1481,26 +1479,35 @@ bind_goal (const Binding b) } else { - // Prune: if it is an SK type construct, ready - // No regular run will apply SK for you. - //!@todo This still needs a lemma, and a more generic (correct) algorithm!! + int know_only; know_only = 0; - function = getTermFunction (b->term); - if (function != NULL) + + if (1 == 0) // blocked for now { - if (!inKnowledge (sys->know, function)) + // Prune: if it is an SK type construct, ready + // No regular run will apply SK for you. + //!@todo This still needs a lemma, and a more generic (correct) algorithm!! It is currently + // actually false, e.g. for signing protocols, and password-like functions. + // + Term function; + + function = getTermFunction (b->term); + if (function != NULL) { - // Prune because we didn't know it before, and it is never subterm-sent - if (switches.output == PROOF) + if (!inKnowledge (sys->know, function)) { - indentPrint (); - eprintf ("* Because "); - termPrint (b->term); - eprintf - (" is never sent from a regular run, so we only intruder construct it.\n"); + // Prune because we didn't know it before, and it is never subterm-sent + if (switches.output == PROOF) + { + indentPrint (); + eprintf ("* Because "); + termPrint (b->term); + eprintf + (" is never sent from a regular run, so we only intruder construct it.\n"); + } + know_only = 1; } - know_only = 1; } } diff --git a/src/prune_theorems.c b/src/prune_theorems.c index c51a56f..bce56c4 100644 --- a/src/prune_theorems.c +++ b/src/prune_theorems.c @@ -259,18 +259,25 @@ prune_theorems (const System sys) // Check for encryption levels /* * if (switches.match < 2 + *!@todo Doesn't work yet as desired for Tickets. Prove lemma first. */ - if (term_encryption_level (b->term) > max_encryption_level) + if (switches.experimental) { - // Prune: we do not need to construct such terms - if (switches.output == PROOF) + if (!hasTicketSubterm (b->term)) { - indentPrint (); - eprintf ("Pruned because the encryption level of "); - termPrint (b->term); - eprintf (" is too high.\n"); + if (term_encryption_level (b->term) > max_encryption_level) + { + // Prune: we do not need to construct such terms + if (switches.output == PROOF) + { + indentPrint (); + eprintf ("Pruned because the encryption level of "); + termPrint (b->term); + eprintf (" is too high.\n"); + } + return 1; + } } - return 1; } // Check for SK-type function occurrences diff --git a/src/specialterm.c b/src/specialterm.c index 1607701..66d1e1d 100644 --- a/src/specialterm.c +++ b/src/specialterm.c @@ -62,3 +62,35 @@ specialTermInit (const System sys) CLAIMS_dep_prec = termlistAdd (CLAIMS_dep_prec, CLAIM_Nisynch); } + +//! Determine whether this is a leaf construct with a ticket in it +int +isTicketTerm (Term t) +{ + if (t != NULL) + { + if (realTermLeaf (t)) + { + if (inTermlist (t->stype, TERM_Ticket)) + { + return true; + } + else + { + if (realTermVariable (t)) + { + return isTicketTerm (t->subst); + } + } + } + } + return false; +} + +//! Determine whether this is a term with a Ticket in it +int +hasTicketSubterm (Term t) +{ + // Doesn't work yet + return true; +} diff --git a/src/specialterm.h b/src/specialterm.h index 5e877ad..3a210d8 100644 --- a/src/specialterm.h +++ b/src/specialterm.h @@ -25,4 +25,7 @@ extern Term CLAIM_Reachable; extern Termlist CLAIMS_dep_prec; +int isTicketTerm (Term t); +int hasTicketSubterm (Term t); + #endif diff --git a/src/term.c b/src/term.c index 942f892..264440b 100644 --- a/src/term.c +++ b/src/term.c @@ -1094,11 +1094,18 @@ term_rolelocals_are_variables () } //! Count the encryption level of a term +/** + * Note that this stops at any variable that is of ticket type. + */ int term_encryption_level (const Term term) { int iter_maxencrypt (Term t) { + if (isTicketTerm (t)) + { + return 0; + } t = deVar (t); if (t == NULL) {