확률적 리소스 인식이 가능한 세션 타입
Probabilistic Resource-Aware Session Types
Probabilistic Resource-Aware Session Types
@misc{das2020probabilistic,
title = {Probabilistic Resource-Aware Session Types},
author = {Ankush Das and Di Wang and Jan Hoffmann},
year = {2020},
eprint = {2011.09037},
archivePrefix = {arXiv},
primaryClass = {cs.PL},
url = {https://arxiv.org/abs/2011.09037}
}
Das, A., Wang, D., & Hoffmann, J. (2020). Probabilistic Resource-Aware Session Types [Preprint]. arXiv. https://doi.org/10.48550/arXiv.2011.09037
DAS A, WANG D, HOFFMANN J. Probabilistic Resource-Aware Session Types[EB/OL]. (2020-11-18)[2026-11-29]. https://arxiv.org/abs/2011.09037.
초록
세션 타입은 메시지 전달 프로세스가 사전 정의된 통신 프로토콜을 준수하도록 보장한다. 기존 세션 타입 연구는 결정론적 언어에 집중되어 왔으나, 마르코프 연쇄와 확률적 분산 알고리즘과 같은 많은 메시지 전달 시스템은 확률적이다. 이러한 시스템을 모델링하고 분석하기 위해 본 논문은 확률적 세션 타입을 소개하고 이를 자동 기대 자원 분석에 적용하는 것을 탐구한다. 확률적 세션 타입은 메시지 위의 확률 분포를 기술하며, 직관주의적 (이진) 세션 타입의 보수적 확장이다. 확률적 채널을 통해 메시지를 보낼 때, 프로세스는 확률적 분기 표현의 내부 확률성이나 확률적 채널을 수신하는 외부 확률성을 활용해야 한다. 기대 자원 상한에 대한 분석은 타입 시스템과 통합되어 있으며, 자동 암모티제이션 자원 분석의 변형이다. 타입 추론을 선형 제약 조건 해결로 환원함으로써 다양한 비용 지표에 대해 기호적 상한을 자동으로 유도할 수 있다. 기술적 기여는 새로운 중첩 다우버스 의미론을 기반으로 한 메타 이론과 프로그래머가 타입 주석을 부담하지 않고 다양한 확률성 소스를 유연하게 혼합할 수 있게 하는 타입 재구성 알고리즘을 포함한다. 타입 시스템은 언어 PRast 에서 구현되었으며, 실험 결과는 확률적 분산 알고리즘의 자원 분석, 마르코프 연쇄의 극한 분포 검증, 그리고 확률적 디지털 계약 분석 등 다양한 도메인에서 PRast 가 적용 가능함을 보여준다.
Session types guarantee that message-passing processes adhere to predefined communication protocols. Prior work on session types has focused on deterministic languages but many message-passing systems, such as Markov chains and randomized distributed algorithms, are probabilistic. To model and analyze such systems, this article introduces probabilistic session types and explores their application in automatic expected resource analysis. Probabilistic session types describe probability distributions over messages and are a conservative extension of intuitionistic (binary) session types. To send on a probabilistic channel, processes have to utilize internal randomness from a probabilistic branching expression or external randomness from receiving on a probabilistic channel. The analysis for expected resource bounds is integrated with the type system and is a variant of automatic amortized resource analysis. It can automatically derive symbolic bounds for different cost metrics by reducing type inference to linear constraint solving. The technical contributions include the meta theory that is based on a novel nested multiverse semantics and a type-reconstruction algorithm that allows flexible mixing of different sources of randomness without burdening the programmer with type annotations. The type system has been implemented in the language PRast. Experiments demonstrate that PRast is applicable in different domains such as resource analysis of randomized distributed algorithms, verification of limiting distributions in Markov chains, and analysis of probabilistic digital contracts.