package p4spectec
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
P4-SpecTec: A mechanization toolchain for the P4 Programming Language
Install
dune-project
Dependency
Authors
Maintainers
Sources
v0.1.2.tar.gz
md5=1a3bc0a385fe1ecf403c019f49aa6de6
sha512=5d20b5821f33e2a3a5419b208606f27c01511994c2b3b1e1cdf4c077056dfd0aa81682af0720e1060ee2bfb0341918fcc4c53159820205a2bc32b725e5c1a714
doc/src/builtin/ints.ml.html
Source file ints.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 55 56open Lang open Xl open Il module Value = Runtime.Value open Util.Source (* Conversion between meta-numerics and OCaml numerics *) let bigint_of_value (value : value) : Bigint.t = value |> Value.Get.num |> Num.to_int let value_of_bigint (add : value -> unit) (i : Bigint.t) : value = let value = Value.Make.int i in add value; value (* dec $sum_int(nat* ) : nat *) let sum_int (add : value -> unit) (at : region) (targs : targ list) (values_input : value list) : value = Extract.zero at targs; let values = Extract.one at values_input |> Value.Get.list |> List.map bigint_of_value in let sum = List.fold_left Bigint.( + ) Bigint.zero values in value_of_bigint add sum (* dec $max_int(int* ) : int *) let max_int (add : value -> unit) (at : region) (targs : targ list) (values_input : value list) : value = Extract.zero at targs; let values = Extract.one at values_input |> Value.Get.list |> List.map bigint_of_value in let max = match values with | [] -> Bigint.zero | value_h :: values_t -> List.fold_left Bigint.max value_h values_t in value_of_bigint add max (* dec $min_int(int* ) : int *) let min_int (add : value -> unit) (at : region) (targs : targ list) (values_input : value list) : value = Extract.zero at targs; let values = Extract.one at values_input |> Value.Get.list |> List.map bigint_of_value in let min = match values with | [] -> Bigint.zero | value_h :: values_t -> List.fold_left Bigint.min value_h values_t in value_of_bigint add min
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>