X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fbin%2Fxhtbl%2Fattr.ml;fp=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fbin%2Fxhtbl%2Fattr.ml;h=36b3d0003e375b2a257c3d935c178162dcd100ce;hb=d2545ffd201b1aa49887313791386add78fa8603;hp=0000000000000000000000000000000000000000;hpb=57ae1762497a5f3ea75740e2908e04adb8642cc2;p=helm.git diff --git a/matita/matita/contribs/lambdadelta/bin/xhtbl/attr.ml b/matita/matita/contribs/lambdadelta/bin/xhtbl/attr.ml new file mode 100644 index 000000000..36b3d0003 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/bin/xhtbl/attr.ml @@ -0,0 +1,20 @@ +module L = List + +module T = Table + +(* true for a row specification *) +type 'a atom = 'a * bool * int option * int option + +type 'a atoms = 'a atom list + +let get_attr concat null a y x = + let map y x (c, b, x1, x2) = match b, x1, x2 with + | _ , None, None -> c + | false, None, Some c2 -> if x <= c2 then c else null + | false, Some c1, None -> if x >= c1 then c else null + | false, Some c1, Some c2 -> if x >= c1 && x <= c2 then c else null + | true , None, Some r2 -> if y <= r2 then c else null + | true , Some r1, None -> if y >= r1 then c else null + | true , Some r1, Some r2 -> if y >= r1 && y <= r2 then c else null + in + concat (L.map (map y x) a)