From ba832159b157991a4fd26ad8039fffe794d07def Mon Sep 17 00:00:00 2001 From: ccremers Date: Thu, 14 Oct 2004 15:09:48 +0000 Subject: [PATCH] - Added a new prioritylevel for seemingly public keys, but the splice-as problem remains. --- src/arachne.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/arachne.c b/src/arachne.c index 3735806..5ead8bf 100644 --- a/src/arachne.c +++ b/src/arachne.c @@ -545,8 +545,22 @@ bind_existing_to_goal (const Binding b, const int run, const int index) while (tl != NULL) { int keyrun; + int prioritylevel; - goal_add (tl->term, b->run_to, b->ev_to, 1); + /* normally, a key gets higher priority */ + prioritylevel = 1; + if (realTermEncrypt (tl->term)) + { + /* the key is a construction itself */ + if (inKnowledge (sys->know, tl->term->right.key)) + { + /* the key is constructed by a public thing */ + /* typically, this is a public key, so we postpone it */ + prioritylevel = -1; + } + } + /* add the key as a goal */ + goal_add (tl->term, b->run_to, b->ev_to, prioritylevel); tl = tl->next; keycount++; } @@ -1028,7 +1042,7 @@ select_goal () indentPrint (); eprintf ("Listing open goals that might be chosen: "); } - max_level = -1; // 0 is the minimum level + max_level = INT_MIN; best = NULL; bl = sys->bindings; while (bl != NULL)