libutap
Functions
typechecker.cpp File Reference
#include <cmath>
#include <cstdio>
#include <cassert>
#include <list>
#include <stdexcept>
#include <boost/tuple/tuple.hpp>
#include "utap/utap.h"
#include "utap/typechecker.h"
#include "utap/systembuilder.h"

Functions

static bool isCost (expression_t expr)
 
static bool isVoid (expression_t expr)
 
static bool isDouble (expression_t expr)
 
static bool isInteger (expression_t expr)
 
static bool isBound (expression_t expr)
 
static bool isIntegral (expression_t expr)
 
static bool isClock (expression_t expr)
 
static bool isDiff (expression_t expr)
 
static bool isDoubleValue (expression_t expr)
 
static bool isNumber (expression_t expr)
 
static bool isConstantInteger (expression_t expr)
 
static bool isConstantDouble (expression_t expr)
 
static bool isInvariant (expression_t expr)
 
static bool isGuard (expression_t expr)
 
static bool isConstraint (expression_t expr)
 
static bool isFormula (expression_t expr)
 
static bool isListOfFormulas (expression_t expr)
 
static bool hasStrictLowerBound (expression_t expr)
 
static bool hasStrictUpperBound (expression_t expr)
 
static bool isInvariantWR (expression_t expr)
 Returns true iff type is a valid invariant. More...
 
static bool isAssignable (type_t type)
 Returns true if values of this type can be assigned. More...
 
static bool isGameProperty (expression_t expr)
 
static bool hasMITLInQuantifiedSub (expression_t expr)
 
static bool hasSpawnOrExit (expression_t expr)
 
static bool validReturnType (type_t type)
 
static int channelCapability (type_t type)
 Returns a value indicating the capabilities of a channel. More...
 
static bool isSameScalarType (type_t t1, type_t t2)
 Returns true if two scalar types are name-equivalent. More...
 
static bool isProcessID (expression_t expr)
 
static bool checkIDList (expression_t expr, kind_t kind)
 
bool parseXTA (FILE *file, TimedAutomataSystem *system, bool newxta)
 
bool parseXTA (const char *buffer, TimedAutomataSystem *system, bool newxta)
 
int32_t parseXMLBuffer (const char *buffer, TimedAutomataSystem *system, bool newxta)
 
int32_t parseXMLFile (const char *file, TimedAutomataSystem *system, bool newxta)
 
expression_t parseExpression (const char *str, TimedAutomataSystem *system, bool newxtr)
 

Function Documentation

static int channelCapability ( type_t  type)
static

Returns a value indicating the capabilities of a channel.

For urgent channels this is 0, for non-urgent broadcast channels this is 1, and in all other cases 2. An argument to a channel parameter must have at least the same capability as the parameter.

References UTAP::Constants::BROADCAST, UTAP::type_t::is(), UTAP::type_t::isChannel(), and URGENT.

static bool checkIDList ( expression_t  expr,
kind_t  kind 
)
static
static bool hasMITLInQuantifiedSub ( expression_t  expr)
static
static bool hasSpawnOrExit ( expression_t  expr)
static
static bool hasStrictLowerBound ( expression_t  expr)
static
static bool hasStrictUpperBound ( expression_t  expr)
static
static bool isAssignable ( type_t  type)
static

Returns true if values of this type can be assigned.

This is the case for integers, booleans, clocks, cost, scalars and arrays and records of these. E.g. channels and processes are not assignable.

References UTAP::Constants::ARRAY, UTAP::Constants::BOOL, UTAP::Constants::CLOCK, UTAP::Constants::COST, UTAP::Constants::DOUBLE, UTAP::type_t::getKind(), UTAP::Constants::INT, UTAP::Constants::RECORD, UTAP::Constants::SCALAR, and UTAP::type_t::size().

Referenced by UTAP::TypeChecker::checkExpression().

static bool isBound ( expression_t  expr)
static
static bool isClock ( expression_t  expr)
static
static bool isConstantDouble ( expression_t  expr)
static
static bool isConstantInteger ( expression_t  expr)
static
static bool isConstraint ( expression_t  expr)
static
static bool isCost ( expression_t  expr)
static
static bool isDiff ( expression_t  expr)
static
static bool isDouble ( expression_t  expr)
static
static bool isDoubleValue ( expression_t  expr)
static
static bool isFormula ( expression_t  expr)
static
static bool isGameProperty ( expression_t  expr)
static
static bool isGuard ( expression_t  expr)
static
static bool isInteger ( expression_t  expr)
static
static bool isIntegral ( expression_t  expr)
static
static bool isInvariant ( expression_t  expr)
static
static bool isInvariantWR ( expression_t  expr)
static

Returns true iff type is a valid invariant.

A valid invariant is either an invariant expression or an integer expression.

References UTAP::expression_t::getType(), UTAP::Constants::INVARIANT_WR, UTAP::type_t::is(), and isInvariant().

Referenced by UTAP::TypeChecker::checkExpression(), and UTAP::TypeChecker::visitState().

static bool isListOfFormulas ( expression_t  expr)
static
static bool isNumber ( expression_t  expr)
static
static bool isProcessID ( expression_t  expr)
static
static bool isSameScalarType ( type_t  t1,
type_t  t2 
)
static
static bool isVoid ( expression_t  expr)
static
expression_t parseExpression ( const char *  str,
TimedAutomataSystem system,
bool  newxtr 
)
int32_t parseXMLBuffer ( const char *  buffer,
TimedAutomataSystem system,
bool  newxta 
)
int32_t parseXMLFile ( const char *  file,
TimedAutomataSystem system,
bool  newxta 
)
bool parseXTA ( FILE *  file,
TimedAutomataSystem system,
bool  newxta 
)
bool parseXTA ( const char *  buffer,
TimedAutomataSystem system,
bool  newxta 
)
static bool validReturnType ( type_t  type)
static