Verifying Correctness of Shared Channels in a Cooperatively Scheduled Process-Oriented Language
Pedersen, Chalmers
Correct concurrent behaviour is important in understanding how components will act within certain conditions. In this work. we analyse the behaviour of shared communicating channels within a coorporatively scheduled runtime. We use the refinement checking and modelling tool FDR to develop both specifications of how such shared channels should behave and models of the implementations of these channels in the cooperatively scheduled language ProcessJ. Our results demonstrate that although we can certainly implement the correct behaviour of such channels, the outcome is dependant on having adequate resources available to execute all processes involved. We conclude that modelling the runtime environment of concurrent components is necessary to ensure components behave as specified in the real world.
academic
Verifying Correctness of Shared Channels in a Cooperatively Scheduled Process-Oriented Language
This paper analyzes the behavior of shared communication channels in a cooperatively scheduled runtime environment. The research develops specifications for shared channel behavior and models of channel implementations in the ProcessJ language using the formal verification tool FDR. The results demonstrate that while correct channel behavior can be implemented, the results depend on having sufficient resources to execute all relevant processes. The study concludes that modeling the runtime environment of concurrent components is necessary to ensure that components behave according to specification in real-world scenarios.
Importance of Concurrent Software Correctness: The correct behavior of concurrent systems is crucial for understanding how components execute under specific conditions. While traditional testing methods are widely used, they may fail to discover all potential concurrency errors.
Necessity of Formal Verification: The authors use Mars rover software as an example, demonstrating that a simple deadlock error might require waiting 80 million seconds (over 90 days) to have a 50% probability of being discovered through testing, whereas formal verification using CSP and FDR can identify such errors immediately.
Challenges in Runtime System Verification: Since many programs are built on top of programming language runtime systems, ensuring that runtime systems are error-free and behave according to specification becomes critically important.
Neglecting Execution Environments: Traditional channel system verification methods do not model runtime systems, execution systems, hardware, and other factors, assuming that ready events remain available until scheduled.
Resource Scarcity Assumptions: Standard modeling methods assume events can occur immediately, meaning resources are available when executing events. However, this extreme assumption does not hold in practice.
Impact of Scheduling Environments: Processes must wait at the end of the ready queue to be scheduled, and their events are not immediately available. However, traditional methods do not account for this situation.
ProcessJ is a process-oriented programming language based on CSP semantics that employs cooperative scheduling and runs on the JVM. This paper aims to verify the correctness of shared channel implementations in the ProcessJ runtime, particularly focusing on how the scheduling environment affects channel behavior.
Verified the Correctness of ProcessJ Shared Channel Implementations: Demonstrated that ProcessJ shared channel implementations using the existing cooperative scheduler are correct, verified through CSP translation and refinement checking against a generic shared channel model.
Developed Extended Algebraic Proofs for Shared Channel Specifications: Provided formal proofs that shared channel specifications indeed behave as CSP shared channels.
Further Demonstrated the Relationship Between Resources and Active Processes: Reiterated the relationship between available resources and the number of active processes for satisfying specifications, proving that the number of available schedulers must be equal to or greater than the number of processes in the system to achieve refinement in both directions between specification and model.
Unlike traditional methods, this paper explicitly models the cooperative scheduler during verification, enabling discovery of issues that only appear under specific scheduling conditions.
By varying the number of schedulers, the study examined how system behavior changes under different resource configurations, revealing the relationship between resource sufficiency and correctness.
Resource Sufficiency Theorem: When the number of schedulers equals or exceeds the total number of processes, refinement can be achieved in both directions of the failures model.
Impact of Resource Insufficiency:
With insufficient schedulers, only traces refinement rather than failures refinement can be achieved
This does not mean the system will deadlock, but rather that certain traces are no longer realizable
Impact of Scheduling Queue: The run queue imposes a natural ordering on processes. When schedulers are insufficient, the acceptance sets of certain processes are not included in the overall acceptance set of the system.
Implementation Correctness: ProcessJ's shared channel implementation is correct when sufficient schedulers are available.
Resource Dependency: Correct behavior depends on having sufficient scheduling resources to execute all relevant processes.
Necessity of Modeling: Modeling the runtime environment is necessary to ensure that components behave according to specification in real-world scenarios.
This paper cites 51 related references, primarily including:
CSP Foundational Theory: Hoare's classical CSP works and related theory
Formal Verification Tools: FDR tools and related verification methods
Concurrent Programming Languages: Related research on JCSP, occam-π, Go, Erlang, and other languages
Scheduling Algorithms: Related work on mutual exclusion and concurrent algorithms
Authors' Previous Work: Series of research on ProcessJ runtime verification
Summary: This paper makes important contributions to the formal verification domain, particularly in verifying concurrent systems considering execution environments. While some limitations exist, its methods and findings have significant value for improving the reliability of concurrent systems.