Snapshottable Stores

Author:

Allain Clément1ORCID,Clément Basile2ORCID,Moine Alexandre1ORCID,Scherer Gabriel3ORCID

Affiliation:

1. Inria, Paris, France

2. OCamlPro, Paris, France

3. Université Paris Cité, Inria, CNRS, Paris, France

Abstract

We say that an imperative data structure is snapshottable or supports snapshots if we can efficiently capture its current state, and restore a previously captured state to become the current state again. This is useful, for example, to implement backtracking search processes that update the data structure during search. Inspired by a data structure proposed in 1978 by Baker, we present a snapshottable store , a bag of mutable references that supports snapshots. Instead of capturing and restoring an array, we can capture an arbitrary set of references (of any type) and restore all of them at once. This snapshottable store can be used as a building block to support snapshots for arbitrary data structures, by simply replacing all mutable references in the data structure by our store references. We present use-cases of a snapshottable store when implementing type-checkers and automated theorem provers. Our implementation is designed to provide a very low overhead over normal references, in the common case where the capture/restore operations are infrequent. Read and write in store references are essentially as fast as in plain references in most situations, thanks to a key optimisation we call record elision . In comparison, the common approach of replacing references by integer indices into a persistent map incurs a logarithmic overhead on reads and writes, and sophisticated algorithms typically impose much larger constant factors. The implementation, which is inspired by Baker’s and the OCaml implementation of persistent arrays by Conchon and Filliâtre, is both fairly short and very hard to understand: it relies on shared mutable state in subtle ways. We provide a mechanized proof of correctness of its core using the Iris framework for the Coq proof assistant.

Publisher

Association for Computing Machinery (ACM)

Reference35 articles.

1. The Set Union Problem with Unlimited Backtracking

2. Phil Bagwell. 2001. Ideal Hash Trees. Tech. rep. EPFL. http://infoscience.epfl.ch/record/64398.

3. Shallow binding in Lisp 1.5

4. cvc5: A Versatile and Industrial-Strength SMT Solver

5. Michael A. Bender, Richard Cole, Erik D. Demaine, Martin Farach-Colton, and Jack Zito. Sept. 2002. “ Two Simplified Algorithms for Maintaining Order in a List.” In: Proceedings of the 10th Annual European Symposium on Algorithms (ESA 2002 ) (Lecture Notes in Computer Science). Vol. 2461. (Sept. 2002 ), 152-164.

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3