Jeehoon Kang, C. Hur, William Mansky, D. Garbuzov, S. Zdancewic, Viktor Vafeiadis
{"title":"支持整型指针强制转换的正式C内存模型","authors":"Jeehoon Kang, C. Hur, William Mansky, D. Garbuzov, S. Zdancewic, Viktor Vafeiadis","doi":"10.1145/2737924.2738005","DOIUrl":null,"url":null,"abstract":"The ISO C standard does not specify the semantics of many valid programs that use non-portable idioms such as integer-pointer casts. Recent efforts at formal definitions and verified implementation of the C language inherit this feature. By adopting high-level abstract memory models, they validate common optimizations. On the other hand, this prevents reasoning about much low-level code relying on the behavior of common implementations, where formal verification has many applications. We present the first formal memory model that allows many common optimizations and fully supports operations on the representation of pointers. All arithmetic operations are well-defined for pointers that have been cast to integers. Crucially, our model is also simple to understand and program with. All our results are fully formalized in Coq.","PeriodicalId":104101,"journal":{"name":"Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation","volume":"303 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2015-06-03","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"50","resultStr":"{\"title\":\"A formal C memory model supporting integer-pointer casts\",\"authors\":\"Jeehoon Kang, C. Hur, William Mansky, D. Garbuzov, S. Zdancewic, Viktor Vafeiadis\",\"doi\":\"10.1145/2737924.2738005\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"The ISO C standard does not specify the semantics of many valid programs that use non-portable idioms such as integer-pointer casts. Recent efforts at formal definitions and verified implementation of the C language inherit this feature. By adopting high-level abstract memory models, they validate common optimizations. On the other hand, this prevents reasoning about much low-level code relying on the behavior of common implementations, where formal verification has many applications. We present the first formal memory model that allows many common optimizations and fully supports operations on the representation of pointers. All arithmetic operations are well-defined for pointers that have been cast to integers. Crucially, our model is also simple to understand and program with. All our results are fully formalized in Coq.\",\"PeriodicalId\":104101,\"journal\":{\"name\":\"Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation\",\"volume\":\"303 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2015-06-03\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"50\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/2737924.2738005\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2737924.2738005","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 50
摘要
ISO C标准没有指定许多使用不可移植习惯用法(如整型指针强制转换)的有效程序的语义。最近对C语言的正式定义和验证实现的努力继承了这一特性。通过采用高级抽象内存模型,它们验证了常见的优化。另一方面,这防止了对依赖于公共实现行为的低级代码的推理,而正式验证有许多应用程序。我们提出了第一个正式的内存模型,它允许许多常见的优化,并完全支持指针表示上的操作。对于已转换为整数的指针,所有算术运算都是定义良好的。至关重要的是,我们的模型也很容易理解和编程。我们所有的结果都在Coq中完全形式化了。
A formal C memory model supporting integer-pointer casts
The ISO C standard does not specify the semantics of many valid programs that use non-portable idioms such as integer-pointer casts. Recent efforts at formal definitions and verified implementation of the C language inherit this feature. By adopting high-level abstract memory models, they validate common optimizations. On the other hand, this prevents reasoning about much low-level code relying on the behavior of common implementations, where formal verification has many applications. We present the first formal memory model that allows many common optimizations and fully supports operations on the representation of pointers. All arithmetic operations are well-defined for pointers that have been cast to integers. Crucially, our model is also simple to understand and program with. All our results are fully formalized in Coq.