示例#1
0
        private static string ExtractVariableValueFromModel(string VariableName, Model model)
        {
            var func = model.TryGetFunc(VariableName);

            if (func != null)
            {
                return(ExtractValueFromModelElement(func.GetConstant()));
            }
            return("<unknown>");
        }
示例#2
0
        private string ArrayOffsetString(Model Model, string StateName, Variable AccessHasOccurredVar, Variable AccessOffsetVar, string RaceyArraySourceName)
        {
            Model.Number OffsetElement = (RaceInstrumentationUtil.RaceCheckingMethod == RaceCheckingMethod.ORIGINAL
        ? GetStateFromModel(StateName, Model).TryGet(AccessOffsetVar.Name)
        : Model.TryGetFunc(AccessOffsetVar.Name).GetConstant()) as Model.Number;

            return(GetArrayAccess(ParseOffset(OffsetElement), RaceyArraySourceName,
                                  Convert.ToUInt32(QKeyValue.FindIntAttribute(AccessHasOccurredVar.Attributes, "elem_width", -1)),
                                  Convert.ToUInt32(QKeyValue.FindIntAttribute(AccessHasOccurredVar.Attributes, "source_elem_width", -1)),
                                  QKeyValue.FindStringAttribute(AccessHasOccurredVar.Attributes, "source_dimensions").Split(',')));
        }
示例#3
0
        private static int GetGroupIdOneDimension(Model model, string dimension, int thread)
        {
            string name = "group_id_" + dimension;

            if (!((GVCommandLineOptions)CommandLineOptions.Clo).OnlyIntraGroupRaceChecking)
            {
                name += "$" + thread;
            }

            return(model.TryGetFunc(name).GetConstant().AsInt());
        }
示例#4
0
 public bool IsMyModel(Model m)
 {
     return(m.TryGetFunc("$Alloc") != null);
 }
示例#5
0
 public bool IsMyModel(Model m)
 {
     return(m.TryGetFunc("$$Language$Dafny") != null);
 }
示例#6
0
 public bool IsMyModel(Model m)
 {
   return m.TryGetFunc("$$Language$Dafny") != null;
 }
示例#7
0
 private static int GetGroupSizeOneDimension(Model model, string dimension)
 {
     return(model.TryGetFunc("group_size_" + dimension).GetConstant().AsInt());
 }
示例#8
0
 private static int GetLocalIdOneDimension(Model model, string dimension, int thread)
 {
     return(model.TryGetFunc("local_id_" + dimension + "$" + thread).GetConstant().AsInt());
 }
示例#9
0
 public bool IsMyModel(Model m) {
   return m.TryGetFunc("$Alloc") != null;
 }