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/type/sub.ml.html
Source file sub.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 55open Domain.Lib open Lang open Xl open Il open Util.Source let rec sub_typ (find_typdef_opt : TId.t -> Typdef.t option) (typ_a : typ) (typ_b : typ) : bool = Equiv.equiv_typ find_typdef_opt typ_a typ_b || sub_typ' find_typdef_opt typ_a typ_b and sub_typ' (find_typdef_opt : TId.t -> Typdef.t option) (typ_a : typ) (typ_b : typ) : bool = let typ_a = Expand.expand_typ find_typdef_opt typ_a in let typ_b = Expand.expand_typ find_typdef_opt typ_b in match (typ_a.it, typ_b.it) with | NumT numtyp_a, NumT numtyp_b -> Num.sub numtyp_a numtyp_b | VarT (tid_a, targs_a), VarT (tid_b, targs_b) -> ( let td_opt_a = find_typdef_opt tid_a in let td_opt_b = find_typdef_opt tid_b in match (td_opt_a, td_opt_b) with | ( Some (Defined (tparams_a, deftyp_a)), Some (Defined (tparams_b, deftyp_b)) ) -> ( match (deftyp_a.it, deftyp_b.it) with | VariantT typcases_a, VariantT typcases_b -> let theta_a = TIdMap.of_lists tparams_a targs_a in let theta_b = TIdMap.of_lists tparams_b targs_b in let nottyps_a = typcases_a |> List.map (fun (nottyp_a, _, _) -> Subst.subst_nottyp theta_a nottyp_a) in let nottyps_b = typcases_b |> List.map (fun (nottyp_b, _, _) -> Subst.subst_nottyp theta_b nottyp_b) in List.for_all (fun nottyp_a -> List.exists (Equiv.equiv_nottyp find_typdef_opt nottyp_a) nottyps_b) nottyps_a | _, _ -> false) | _ -> false) | TupleT typs_a, TupleT typs_b -> List.length typs_a = List.length typs_b && List.for_all2 (sub_typ find_typdef_opt) typs_a typs_b | IterT (typ_a, iter_a), IterT (typ_b, iter_b) when iter_a = iter_b -> sub_typ find_typdef_opt typ_a typ_b | IterT (typ_a, Opt), IterT (typ_b, List) -> sub_typ find_typdef_opt typ_a typ_b | _, IterT (typ_b, Opt) -> sub_typ find_typdef_opt typ_a typ_b | _, IterT (typ_b, List) -> sub_typ find_typdef_opt typ_a typ_b | _ -> false
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>