package lambdapi
Proof assistant for the λΠ-calculus modulo rewriting
Install
Dune Dependency
Authors
Maintainers
Sources
lambdapi-2.4.1.tbz
sha256=221dff97ab245c49b7e6480fa2a3a331ab70eb86dd5d521e2c73151029bbb787
sha512=a39961bb7f04f739660a98a52981d4793709619cd21310ca6982ba78af81ef09e01c7517ee3b8b2687b09f7d2614d878c1d69494ca6ab8ef8205d240c216ce8a
doc/src/lambdapi.lplib/range.ml.html
Source file range.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
(************************************************************************) (* The λΠ-modulo Interactive Proof Assistant *) (************************************************************************) (************************************************************************) (* λΠ-modulo serialization Toplevel *) (* Copyright Inria -- Dual License LGPL 2.1 / GPL3+ *) (* Written by: F. Blanqui, E. J. Gallego Arias, F. Lefoulon *) (************************************************************************) (* Status: Experimental *) (************************************************************************) (* We follow LSP denominations except for end_ being reserved in OCaml. *) type point = { line : int; character : int } type t = { start : point; end_ : point } let make_point line character = { line; character } let make_interval start end_ = (* Fixme: don't rely on the lexicographic order *) assert (start <= end_); { start; end_ } let line pt = pt.line let column pt = pt.character let interval_start i = i.start let interval_end i = i.end_ type cmp = Before | In | After let in_range pos { start; end_ } = (* Comparison operators work as lexicographic comparison on points (meaning l is compared, then c is compared). *) if pos < start then Before else if pos > end_ then After else In let compare { start = s1; end_ = f1 } { start = s2; end_ = f2 } = if (s1 >= s2 && f1 <= f2) || (s1 <= s2 && f1 >= f2) then 0 else if f1 <= s2 then -1 else if s1 >= f2 then 1 else failwith "Intervals overlap, no inclusion between the two" let point_to_string pt = "Line : " ^ string_of_int pt.line ^ "; Column : " ^ string_of_int pt.character ^ "\n" let interval_to_string { start; end_ } = "From :\n" ^ point_to_string start ^ "To :\n" ^ point_to_string end_ let translate { start; end_ } ds df = let s2 = make_point (line start) (column start - ds) in let f2 = make_point (line end_) (column end_ + df) in assert (s2 <= f2); make_interval s2 f2
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>