2007-06-11 13:01:04 +01:00
|
|
|
/*
|
|
|
|
* Scyther : An automatic verifier for security protocols.
|
|
|
|
* Copyright (C) 2007 Cas Cremers
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
2004-08-15 12:55:22 +01:00
|
|
|
#ifndef BINDINGS
|
|
|
|
#define BINDINGS
|
|
|
|
|
2004-08-17 12:03:18 +01:00
|
|
|
#include "term.h"
|
2004-08-27 20:06:15 +01:00
|
|
|
#include "termmap.h"
|
2004-08-17 12:03:18 +01:00
|
|
|
#include "system.h"
|
|
|
|
|
2006-01-02 21:06:08 +00:00
|
|
|
//! Binding structure
|
2004-08-17 16:52:52 +01:00
|
|
|
/*
|
|
|
|
* Idea is the ev_from *has to* precede the ev_to
|
|
|
|
*/
|
|
|
|
struct binding
|
|
|
|
{
|
2004-08-18 15:06:14 +01:00
|
|
|
int done; //!< Iff true, it is bound
|
2005-01-14 18:18:40 +00:00
|
|
|
int blocked; //!< Iff true, ignore it
|
2004-08-17 16:52:52 +01:00
|
|
|
|
2006-01-02 21:06:08 +00:00
|
|
|
int run_from; //!< origination run
|
|
|
|
int ev_from; //!< step in origination run
|
2004-08-17 16:52:52 +01:00
|
|
|
|
2006-01-02 21:06:08 +00:00
|
|
|
int run_to; //!< destination run
|
|
|
|
int ev_to; //!< step in destination run
|
2004-08-17 16:52:52 +01:00
|
|
|
|
2006-01-02 21:06:08 +00:00
|
|
|
Term term; //!< Binding term
|
|
|
|
int level; //!< ???
|
2004-08-17 16:52:52 +01:00
|
|
|
};
|
|
|
|
|
2006-01-02 21:06:08 +00:00
|
|
|
typedef struct binding *Binding; //!< pointer to binding structure
|
2004-08-17 16:52:52 +01:00
|
|
|
|
|
|
|
|
2004-08-15 12:55:22 +01:00
|
|
|
void bindingInit (const System mysys);
|
|
|
|
void bindingDone ();
|
|
|
|
|
2004-08-18 15:06:14 +01:00
|
|
|
int binding_print (Binding b);
|
2005-01-14 18:18:40 +00:00
|
|
|
int valid_binding (Binding b);
|
2008-01-16 10:55:15 +00:00
|
|
|
int same_binding (const Binding b1, const Binding b2);
|
2004-08-15 12:55:22 +01:00
|
|
|
|
2004-10-18 14:04:34 +01:00
|
|
|
int goal_add (Term term, const int run, const int ev, const int level);
|
2005-05-17 19:45:01 +01:00
|
|
|
int goal_add_fixed (Term term, const int run, const int ev, const int fromrun,
|
|
|
|
const int fromev);
|
2004-10-18 14:04:34 +01:00
|
|
|
void goal_remove_last (int n);
|
2004-08-17 16:52:52 +01:00
|
|
|
int goal_bind (const Binding b, const int run, const int ev);
|
|
|
|
void goal_unbind (const Binding b);
|
2005-01-14 18:18:40 +00:00
|
|
|
int binding_block (Binding b);
|
|
|
|
int binding_unblock (Binding b);
|
2004-08-27 20:06:15 +01:00
|
|
|
int labels_ordered (Termmap runs, Termlist labels);
|
2004-08-17 16:52:52 +01:00
|
|
|
|
2006-03-10 14:48:40 +00:00
|
|
|
int iterate_bindings (int (*func) (Binding b));
|
|
|
|
int iterate_preceding_bindings (const int run, const int ev,
|
|
|
|
int (*func) (Binding b));
|
|
|
|
|
2004-08-17 16:52:52 +01:00
|
|
|
int bindings_c_minimal ();
|
2006-04-02 13:29:02 +01:00
|
|
|
int countBindingsDone ();
|
2004-08-17 16:52:52 +01:00
|
|
|
|
2004-08-15 12:55:22 +01:00
|
|
|
#endif
|