public Expression UpdateTotalStateBypassingStoreBuffer(ResolutionContext context, IConstraintCollector constraintCollector, Expression val_new) { var s_current = UpdateTotalStateLocationDirectly(context, constraintCollector, val_new); return(s_current); }
public Expression UpdateTotalStateWithStoreBufferEntry(ResolutionContext context, IConstraintCollector constraintCollector, Expression val_new) { if (NoTSO()) { return(UpdateTotalStateLocationDirectly(context, constraintCollector, val_new)); } if (!AH.IsPrimitiveType(type)) { context.Fail(tok, "Can't do TSO write to non-primitive type; try using ::= instead of :="); return(null); } var entry = GetStoreBufferEntry(val_new); if (entry == null) { context.Fail(tok, "Can't do a TSO write to that location; try using ::= instead of :="); return(null); } return(AH.MakeApply3("Armada_AppendToThreadStoreBuffer", context.GetLValueState(), context.tid, entry, "Armada_TotalState")); }
public override Expression UpdateTotalStateLocationDirectly(ResolutionContext context, IConstraintCollector constraintCollector, Expression val_new) { Expression parent_val_old = parent.GetValueInLValueState(context); Expression parent_val_new = AH.MakeSeqUpdateExpr(tok, parent_val_old, index, val_new); return(parent.UpdateTotalStateLocationDirectly(context, constraintCollector, parent_val_new)); }
public abstract Expression UpdateTotalStateLocationDirectly(ResolutionContext context, IConstraintCollector constraintCollector, Expression val_new);
public override Expression UpdateTotalStateLocationDirectly(ResolutionContext context, IConstraintCollector constraintCollector, Expression val_new) { var s = context.GetLValueState(); var mem = AH.MakeExprDotName(s, "mem", "Armada_SharedMemory"); var mem_new = AH.MakeDatatypeUpdateExpr(mem, "globals", val_new); return(AH.MakeDatatypeUpdateExpr(s, "mem", mem_new)); }
public override Expression UpdateTotalStateLocationDirectly(ResolutionContext context, IConstraintCollector constraintCollector, Expression val_new) { var s = context.GetLValueState(); return(AH.MakeDatatypeUpdateExpr(s, "ghosts", val_new)); }
public override Expression UpdateTotalStateLocationDirectly(ResolutionContext context, IConstraintCollector constraintCollector, Expression val_new) { var s = context.GetLValueState(); var mem = AH.MakeExprDotName(s, "mem", "Armada_SharedMemory"); var h = AH.MakeExprDotName(mem, "heap", "Armada_Heap"); var valid = AH.GetInvocationOfValidPointer(h, address.Val, type); if (valid == null) { constraintCollector.Fail(tok, $"Type {type} is currently not supported in the heap"); } else { constraintCollector.AddUndefinedBehaviorAvoidanceConstraint(valid); } var h_new = AH.GetInvocationOfUpdatePointer(h, address.Val, val_new); if (h_new == null) { constraintCollector.Fail(tok, $"Type {type} is currently not supported in the heap"); } var mem_new = AH.MakeDatatypeUpdateExpr(mem, "heap", h_new); return(AH.MakeDatatypeUpdateExpr(s, "mem", mem_new)); }
public override Expression UpdateTotalStateLocationDirectly(ResolutionContext context, IConstraintCollector constraintCollector, Expression val_new) { return(AH.MakeApply3("Armada_UpdateTSFrame", context.GetLValueState(), context.tid, val_new, "Armada_TotalState")); }
public abstract string UpdateTotalStateLocationDirectly(ResolutionContext context, IConstraintCollector constraintCollector, string val_new);
public string UpdateTotalStateWithStoreBufferEntry(ResolutionContext context, IConstraintCollector constraintCollector, string val_new, ArmadaPC pc) { if (NoTSO()) { return(UpdateTotalStateLocationDirectly(context, constraintCollector, val_new)); } if (!AH.IsPrimitiveType(type)) { context.Fail(tok, "Can't do TSO write to non-primitive type; try using ::= instead of :="); return(null); } var entry = GetStoreBufferEntry(val_new, pc); if (entry == null) { context.Fail(tok, "Can't do a TSO write to that location; try using ::= instead of :="); return(null); } return($"Armada_AppendToThreadStoreBuffer({context.GetLValueState()}, {context.tid}, {entry})"); }
public override string UpdateTotalStateLocationDirectly(ResolutionContext context, IConstraintCollector constraintCollector, string val_new) { string parent_val_old = parent.GetValueInLValueState(context); string parent_val_new = $"({parent_val_old})[{index} := {val_new}]"; return(parent.UpdateTotalStateLocationDirectly(context, constraintCollector, parent_val_new)); }
public override string UpdateTotalStateLocationDirectly(ResolutionContext context, IConstraintCollector constraintCollector, string val_new) { return($"({context.GetLValueState()}).(ghosts := {val_new})"); }
public override string UpdateTotalStateLocationDirectly(ResolutionContext context, IConstraintCollector constraintCollector, string val_new) { var s = context.GetLValueState(); return($"({s}).(mem := ({s}).mem.(globals := {val_new}))"); }
public override string UpdateTotalStateLocationDirectly(ResolutionContext context, IConstraintCollector constraintCollector, string val_new) { return($"Armada_UpdateTSFrame({context.GetLValueState()}, {context.tid}, Armada_StackFrame_{methodName}({val_new}))"); }
public override string UpdateTotalStateLocationDirectly(ResolutionContext context, IConstraintCollector constraintCollector, string val_new) { var s = context.GetLValueState(); var h = $"({s}).mem.heap"; var valid = AH.GetInvocationOfValidPointer(h, address.Val, type); if (valid == null) { constraintCollector.Fail(tok, $"Type {type} is currently not supported in the heap"); } else { constraintCollector.AddUndefinedBehaviorAvoidanceConstraint(valid); } var h_new = AH.GetInvocationOfUpdatePointer(h, address.Val, val_new, type); if (h_new == null) { constraintCollector.Fail(tok, $"Type {type} is currently not supported in the heap"); } return($"{s}.(mem := {s}.mem.(heap := {h_new}))"); }