dataesr/scientific-paragraphs-categorization huggingface dataset:
Because of this, the tool cannot statically derive the execution latency of the benchmark. Fourier Coefficients: The Fourier coefficients program, which computes the coefficients of a Fourier series, contains an accumulation which is performed in single precision. This program comes in three different configurations: small, medium and big. Each of them computes the same algorithm but with a different amount of iterations. The big version is supposed to compute the most accurate answer. We obtain similar results for the three versions of this program, as a consequence we only present the big version here. In this version, there are multiple instances of 2K terms accumulations. The accumulator is reset at every call. The parameters determined for this benchmark were the following: MaxAcc=6000.
The input to the tool is application-specific information representing high-level domain knowledge such as the range and desired accuracy of a variable. The resulting code is compatible with Vivado HLS. The proposed transformation already works very well on all the FPMarks that contains a reduction where it improves both latency and accuracy by an order of magnitude for comparable area. In the longer term, we believe there is much more to come. The arithmetic optimizations that a classical compiler can do are very limited by the fixed hardware of classical processors. With compilers of high-level software to hardware, there is much more freedom, hence many more opportunities to build application-specific arithmetic operators. Future work will attempt to explore this new realm, starting with operator specialization; operator fusion such as in  [21]  but at a more coarse grain allowing more aggressive fusion; compile-time generation of application-specific cores; error analysis such as in  [15]  benefiting from compilers static analysis and more generaly building upon compiler progresses in program analysis.
A precise GNSS (Global Navigation Satellite System) localization is vital for autonomous road vehicles, especially in cluttered or urban environments where satellites are occluded, preventing accurate positioning. We propose to fuse GPS (Global Positioning System) data with fisheye stereovision to face this problem independently to additional data, possibly outdated, unavailable, and needing correlation with reality. Our stereoscope is sky-facing with 360°× 180°fisheye cameras to observe surrounding obstacles. We propose a 3D modelling and plane extraction through following steps: stereoscope self-calibration for decalibration robustness, stereo matching considering neighbours epipolar curves to compute 3D, and robust plane fitting based on generated cartography and Hough transform. We use these 3D data with GPS raw data to estimate NLOS (Non Line Of Sight) reflected signals pseudorange delay.
Introduction It is a challenging problem to correct PR (PseudoRange) delays in order to improve GNSS (Global Navigation Satellite System) localization. PR are one of the raw data used to compute a GNSS position on the terrestrial globe. They represent the measured distance between the receiver and satellites, that means they typically include bias. A pseudorange is usually around some tens of thousands of kilometres, but an estimation error as small as some metres brings to an inaccurate positioning that can easily reach tens of metres error. The presented procedure deals with local PR delay in an autonomous way. It does not rely on embedded data, which has big advantages, especially the removal of the positioning problem in a recorded 3D model. The idea is to generate a 3D local model on line, with a sky-facing fisheye binocular stereovision configuration allowing a 360°× 180°field of view in order to see all around the vehicle.
Multipath Effect The Figure  1  illustrates multipath effect. Best data to get are from direct signals, in this case GNSS signal reception is designated LOS (Line Of Sight). When the reception does not occur via a direct path but only via a reflected path (no direct signal of that particular satellite), it is designated NLOS (Non Line Of Sight). It is shown that a signal can be received several times via different ways, this is the multipath effect. The presented research focuses on NLOS reception and not on multipath effect. Only NLOS signals can be delayed by local structures. So, the first step is to identify NLOS satellites. Then, a delay estimation is proposed in order to correct NLOS pseudoranges and improve GPS positioning. In the following, we present research works related to our proposed framework.
State-of-the-Art of NLOS Correction Methods Authors of  [18]  propose a study of GNSS signal propagation and local interferences. In reality signal propagation forms a cone becoming larger with the range. The maximum power is at its centre. Reflecting surfaces reflect and disperse the signal with various parameters. Ercek et al. simulate data in an urban canyon, a straight street with buildings of different heights. In order to simplify the problem, the reception with the strongest power only is usually taken into account and considered as a punctual geometric ray. Ercek et al. formulate probabilities for a received signal to be NLOS and to present a reflection or a diffraction, according to the area geometric configuration and the power of the signal. Considering the punctual geometric ray for the signal propagation, many NLOS analysis methods have been studied to improve GNSS localization accuracy.
Marais et al. get better results with the second and easiest approach. By excluding NLOS signals with the CN0 threshold, they are able to decrease the localization inaccuracy in a sequence from 13 m to 4. 6 m. In  [9] , Obst et al. use 3D data of the environment from cartography and elevation maps in order to identify NLOS signals by ray-tracing. Positioning the receiver in the 3D model is needed. By excluding NLOS signals, for a sequence, they reduce the GNSS position error from 14 m to 5. 2 m. In  [16] , Kumar et al. do not use recorded 3D data. They build a 3D model with a lidar and use the scanned structures as a mask for NLOS satellites. For fixed positions, excluding NLOS signals allows an accuracy less than 1 m.
In addition to the localization improvement, the advantages of proposed solution are: • A correction instead of a rejection of NLOS, does not imply loss of service availability; • No environment data to store; • No updates of embedded data to do, because the structure of the environment is updated on line; • No re-positioning problem in the 3D model, because the reference position is known thanks to the 3D model built around it. However results show an improvement of availability and better and more stable results with NLOS detection by proposed visibility mask than with CN0 thresholds. GPS localization is more accurate thanks to the PR delay estimation based on generated 3D model of the environment. In order to estimate PR delay due to reflections, a 3D model is needed. Our method allows using a 3D model without knowledge of the area, well-centred to robustly detect NLOS receptions and estimate PR delays.
Perspectives We show in  [40]  that the same procedure is as efficient with a single fisheye camera and odometer configuration. With this second configuration, mobile experiments also have been proposed. A GPS RTK (Real Time Kinematic) was added to get a ground truth for the path. Pictures were taken every 2 m thanks to the odometer, and they were timed with an accuracy of one second only (the camera of this platform does not store more precise clocks). Even by applying time offsets, dynamic results never matched static ones. The problem of synchronisation between GPS and image data is the challenge to solve for dynamic conditions. We think that without ultra-precise synchronisation (approx. hundredth or thousandth of second), the problem is too complex and a classic reflection model is inefficient.
We present Low * , a language for low-level programming and verification, and its application to high-assurance optimized cryptographic libraries. Low * is a shallow embedding of a small, sequential, well-behaved subset of C in F * , a dependently-typed variant of ML aimed at program verification. Departing from ML, Low * does not involve any garbage collection or implicit heap allocation; instead, it has a structured memory model à la CompCert, and it provides the control required for writing efficient low-level security-critical code. By virtue of typing, any Low * program is memory safe. In addition, the programmer can make full use of the verification power of F * to write high-level specifications and verify the functional correctness of Low * code using a combination of SMT automation and sophisticated manual proofs.
At extraction time, specifications and proofs are erased, and the remaining code enjoys a predictable translation to C. We prove that this translation preserves semantics and side-channel resistance. We provide a new compiler back-end from Low * to C and, to evaluate our approach, we implement and verify various cryptographic algorithms, constructions, and tools for a total of about 28,000 lines of code, specification and proof. We show that our Low * code delivers performance competitive with existing (unverified) C cryptographic libraries, suggesting our approach may be applicable to larger-scale low-level software.
Focusing on low-level attacks caused by violations of memory safety, several researchers have used high-level, type-safe programming languages to implement standard protocols such as Transport Layer Security (TLS). For example,  Kaloper-Meršinjak et al. [2015]  provide nqsbTLS, an implementation of TLS in OCaml, which by virtue of its type and memory safety is impervious to attacks (like  Heartbleed [2014] ) that exploit buffer overflows. Bhargavan et al. [2014b]  program miTLS in F#, also enjoying type and memory safety, but go further using a refinement type system to prove various higher-level security properties of the protocol. While this approach is attractive for its simplicity, to get acceptable performance, both nqsbTLS and miTLS link with fast, unsafe implementations of complex cryptographic algorithms, such as those provided by nocrypto  [2017] , an implementation that mixes C and OCaml, and libcrypto, a component of the widely used OpenSSL library  [2017].
An Embedded DSL, Compiled Natively Low * programs are a subset of F * programs: the programmer writes Low * code using regular F * syntax, against a library we provide that models a lower-level view of memory, akin to the structured memory layout of a well-defined C program (this is similar to the structured memory model of CompCert  [Leroy 2009; Leroy et al. 2012] , rather than the "big array of bytes" model systems programmers sometimes use). Low * programs interoperate naturally with other F * programs, and precise specifications of Low * and F * code are intermingled when proving properties of their combination. As usual in F * , programs are type-checked and compiled to OCaml for execution, after erasing their computationally irrelevant parts, such as proofs and specifications, using a process similar to Coq's extraction mechanism  [Letouzey 2002 ].
In particular, our memory-model library compiles to a simple, heap-based OCaml implementation. Importantly, Low * programs have a second, equivalent but more efficient semantics via compilation to C, with the predictable performance that comes with a native implementation of their lower-level memory model. This compilation is implemented by KreMLin, a new compiler from the Low * subset of F * to C. Figure  1  illustrates the high-level design of Low * and its compilation to native code. Our main contributions are as follows: Libraries for low-level programming within F * ( §2). At its core, F * is a purely functional language to which effects like state are added programmatically using monads. In this work, we instantiate the state monad of F * to use a CompCert-like structured memory model that separates the stack and the heap, supporting bulk allocation and deallocation on the stack, and allocating and freeing individual blocks on the heap.
Both the heap and the stack are further divided into disjoint logical regions, which enables us to manage the separation properties necessary for modular, stateful verification. On top of this, we program a library of C-style arrays and structs passed by reference, with support for pointer arithmetic and pointers to the interior of an array or a struct. By virtue of F * typing, our libraries and all their well-typed clients are guaranteed to be memory safe, e. g. , they never access out-of-bounds or deallocated memory. Designing Low * , a subset of F * easily compiled to C. We intend to give Low * programmers precise control over the performance profile of the generated C code. As much as possible, we aim for the programmer to control even the syntactic structure of the C code, to facilitate its review by security experts unfamiliar with F *.
As such, to a first approximation, Low * programs are F * programs well-typed in the state monad described above, which, after all their computationally irrelevant (ghost) parts have been erased, must meet several restrictions, as follows: the code (1) must be first order, to prevent the need to allocate closures in C; (2) must make any heap allocation explicit; (3) must not use any recursive datatype, since these would have to be compiled using additional indirections to C structs; and (4) must be monomorphic, since C does not support polymorphism directly. Importantly, Low * heavily leverages F * 's capabilities for partial evaluation, hence allowing the programmer to write high-level, reusable code that is normalized via meta-programming into the Low * subset before the restrictions are enforced.
We emphasize that these restrictions apply only to computationally relevant code-proofs and specifications are free to use arbitrary higher-order, dependently typed F * , and very often they do. A formal translation from Low * to CompCert Clight ( §3). Justifying its dual interpretation as a subset of F * and a subset of C, we provide a formal model of Low * , called λow * , give a translation from λow * to Clight  [Blazy and Leroy 2009 ] and show that it preserves trace equivalence with respect to the original F * semantics. In addition to ensuring that the functional behavior of a program is preserved, our trace equivalence also guarantees that the compiler does not accidentally introduce side-channels due to memory access patterns (as would be the case without the restrictions above) at least until it reaches Clight, a useful sanity check for cryptographic code.
(1) We provide HACL * , a "high-assurance crypto library" implementing and proving (in ∼6,000 lines of Low * ) several cryptographic algorithms, including the Poly1305 MAC  [Bernstein 2005 ], the ChaCha20 cipher  [Nir and Langley 2015] , and multiplication on the Curve25519 elliptic curve  [Bernstein 2006]. We package these algorithms to provide the popular NaCl API  [Bernstein et al. 2012] , yielding the first performant implementation of NaCl verified for memory safety and side-channel resistance, along with functional correctness proofs for its core components, including a verified bignum library customized for safe, fast cryptographic use ( §5. 1). Using this API, we build new standalone applications such as PneuTube, a new secure, asynchronous, file transfer application whose performance compares favorably with widely used, existing utilities like scp.
(2) Emphasizing the applicability of Low * for high-level, cryptographic security proofs on lowlevel code, we briefly describe its use in programming and proving (in ∼14,000 lines of Low * ) the Authenticated Encryption with Associated Data (AEAD) construction at the heart of the record layer of the new TLS 1. 3 Internet Standard. We prove memory safety, functional correctness, and cryptographic security for its main ciphersuites, relying, where available, on verified implementations of these ciphersuites provided by HACL *. The C code extracted from our verified implementation is easily integrated within other applications, including, for example, an implementation in F * of TLS separately verified and compiled to OCaml (through OCaml's FFI). Trusted computing base. To date, we have focused on designing and evaluating our methodology of programming and verifying low-level code shallowly embedded within a high-level programming language and proof assistant.
2017]  that describes the cryptographic model we used for the record layer of TLS 1. 3. Finally, we have an ongoing submission of a paper focused on our HACL * library  [Zinzindohoué et al. 2017] , where we describe in greater detail our proof techniques for reusing the bignum formalization across different algorithms and implementations, and provide a substantial performance evaluation. We also offer numerous software artifacts. Our tool KreMLin  [Protzenko 2017 ] is actively developed on GitHub, and so is HACL *  [Zinzindohoué et al. 2017]. Most of the Low * libraries live in the F * repository, also on GitHub. The integration of HACL * within miTLS is also available on GitHub. For convenience, we offer a regularly-updated Docker image of Project Everest  [Microsoft Research and INRIA 2016] , which bundles together F * , miTLS, HACL * , KreMLin.
A LOW * TUTORIAL At the core of Low * is a library for programming with structures and arrays manually allocated on the stack or the heap ( §2. 2). Memory safety demands reasoning about the extents and liveness of these objects, while functional correctness and security may require reasoning about their contents. Our library provides specifications to allow client code to be proven safe, correct and secure, while KreMLin compiles such verified client code to C. We illustrate the design of Low * using several examples from our codebase. We show the ChaCha20 stream cipher  [Nir and Langley 2015] , focusing on memory safety ( §2. 1), and the Poly1305 MAC  [Bernstein 2005 ], focusing on functional correctness. ( §2. 3). Going beyond functional correctness, we explain how we prove a combination of ChaCha20 and Poly1305 cryptographically secure ( §2.
A First Example: the ChaCha20 Stream Cipher Figure  2  shows code snippets for the core function of ChaCha20  [Nir and Langley 2015] , a modern stream cipher widely used for fast symmetric encryption. This function computes a block of pseudorandom bytes, usable for encryption, for example, by XORing them with a plaintext message. On the left is our Low * code; on the right its compilation to C. The function takes as arguments an output length and buffer, and some input key, nonce, and counter. It allocates 32 words of auxiliary, contiguous state on the stack; then it calls a function to initialize the cipher block from the inputs (passing an interior pointer to the state); and finally it calls another function that computes a cipher block and copies its first len bytes to the output buffer.
The specification of chacha20 claims that it uses only stack allocation and has no memory leaks, using the Stack computation type. This is straightforward to define in terms of ST, as shown below. effect Stack a pre post = ST a (requires pre) (ensures (λ m0 x m1 → post m0 x m1 ∧ tip m0 = tip m1 ∧ (∀ r. r ∈ m1⇐⇒ r ∈ m0))) Stack computations are ST computations that leave the stack tip unchanged (i. e. , they pop all frames they may have pushed) and yield a final memory with the same domain as the initial memory. This ensures that Low * code with Stack effect has explicitly deallocated all heap allocated references before returning, ruling out memory leaks. As such, we expect all externally callable Low * functions to have Stack effect. Other code can safely pass pointers to objects allocated in their heaps into Low * functions with Stack effect since the definition of Stack forbids the Low * code from freeing these references.
val extend: #key: eqtype → #value: (key → Tot Type) → p: ptr (struct key value) → fd: key → ST (ptr (value fd)) (requires (λ h → live h p)) (ensures (λ h0 p ′ h1 → h0 == h1 ∧ p ′ == field p fd)) Finally, the read and write operations allows accessing and mutating the field referred to by a ptr. This section and the next illustrate our "high-level verification for low-level code" methodology. Although programming at a low-level, we rely on features like type abstraction and dependently typed meta-programming, to prove our code functionally correct, cryptographically secure, and free of a class of side-channels. We start with Poly1305 [Bernstein 2005], a Message Authentication Code (MAC) algorithm. 2 Unlike chacha20, for which the main property of interest is implementation safety, Poly1305 has a mathematical definition in terms of a polynomial in the prime field GF (2 130 -5), against which we prove our code functionally correct.
For Poly1305, a bigint b is in compact form in state m (i. e. , compact m b) when all its limbs fit in 26 bits. Compactness does not guarantee uniqueness of representation as 2 130 -5 and 0 are the same number in the field but they have two different compact representations that both fit in 130 bits-this is true for similar reasons for the range (︀0, 5). Abstracting integers as a side-channel mitigation. Modern cryptographic implementations are expected to be protected against side-channel attacks  [Kocher 1996 ]. As such, we aim to show that the branching behavior and memory accesses of our crypto code are independent of secrets. To enforce this, we use an abstract type limb to represent limbs, all of whose operations reveal no information about the contents of the limb, either through its result or through its branching behavior and memory accesses.
Note, the number of limbs in a Poly1305 bigint is a public constant, i. e. , bigint = b:(buffer limb){b. length = 5}. Proving normalize correct and side-channel resistant. The normalize function of Figure  3  modifies a compact bigint in-place to reduce it to its canonical representation. The code is rather opaque, since it operates by strategically masking each limb in a secret independent manner. However, its specification clearly shows its intent: the new contents of the input bigint is the same as the original one, modulo 2 130 -5. At line 14, we see a call to a F * lemma, which relates the masking operations to the modular arithmetic in the specification-the lemma is erased during extraction. A top-level functional correctness spec. Using our bigint library, we implement poly1305_mac and prove it functionally correct.
We show below the abstract type of keys and the encryption function for idealizing AEAD. A module Flag declares a set of abstract booleans (idealization flags) that precisely capture each cryptographic assumption. For every real functionality that we wish to idealize, we branch on the corresponding flag. In the code above, for instance we idealize encryption when Flag. prf is set. This style of programming heavily relies on the normalization capabilities of F *. At verification time, flags are kept abstract, so that we verify both the real and ideal versions of the code. At extraction time, we reveal these booleans to be false, allowing the F * normalizer to drop the then branch, and replace the log field with unit, meaning that both the high-level, list-manipulating code and corresponding type definitions are erased, leaving only low-level code from the else branch to be extracted.