Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
84f8ec82
Commit
84f8ec82
authored
Apr 09, 2021
by
Kim Nguyễn
Browse files
Document types/normal.mli
parent
a328d18b
Pipeline
#138
passed with stages
in 6 minutes and 46 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
6 deletions
+47
-6
types/normal.mli
types/normal.mli
+47
-6
No files found.
types/normal.mli
View file @
84f8ec82
(** This module implements the normalisation of Cartesian products of sets.
Given an DNF (union of intersection of positive and negative products),
this module contains functions that return:
- a union of products (that is, the intersections are pushed below the
products)
- a union of product in normal form, that is a list of {i(t{_ i}}, s{_ i})}
products where the {i t{_ i}} are pair-wise disjoint and neither the
{i t{_ i}} nor the {i s{_ i}} are empty.
*)
(** This signature represent abstract sets *)
module
type
S
=
sig
(** The type of a set *)
type
t
(** The universal set *)
val
any
:
t
(** The empty set *)
val
empty
:
t
(** Boolean connectives *)
val
cup
:
t
->
t
->
t
val
cap
:
t
->
t
->
t
val
diff
:
t
->
t
->
t
(** Test for emptiness*)
val
is_empty
:
t
->
bool
end
(** An DNF given as a List of pairs of list:
[ [ (p1, n1); (p2, n2); ... ] ] where the [pi] are lists of positive
atoms and the [ni] are lists of negative atoms.
*)
type
'
a
bool
=
(
'
a
list
*
'
a
list
)
list
module
Make
(
X1
:
S
)(
X2
:
S
)
:
(** The functor implementing the normalisation of products *)
module
Make
(
X1
:
S
)
(
X2
:
S
)
:
sig
(** The type of a simplified DNF : a list of products *)
type
t
=
(
X1
.
t
*
X2
.
t
)
list
(** Returns the normal form a of simplified form:
[normal l] returns a list [ (t1, s1); (t2, s2); ... ] ] where :
- the [ti] are pair-wise disjoint
- the [(ti,si)] are non empty products.
The empty product is returned as [ [] ].
*)
val
normal
:
t
->
t
(* normalized form:
(t1,t2),...,(s1,s2) ==> t1 & s1 = 0
(t1,t2) => t1 <> 0, t2 <> 0
*)
(** [boolean_normal l] returns the normal form from a DNF representation *)
val
boolean_normal
:
(
X1
.
t
*
X2
.
t
)
bool
->
t
(* return a normalized form *)
(** [boolean l] returns a simplified form from the DNF representation *)
val
boolean
:
(
X1
.
t
*
X2
.
t
)
bool
->
t
(** [pi1 l] returns the union of all first components of [l] *)
val
pi1
:
t
->
X1
.
t
(** [pi2 l] returns the union of all second components of [l] *)
val
pi2
:
t
->
X2
.
t
(** [pi2 restr l] returns the union of all second components for
which the first component intersects [restr] *)
val
pi2_restricted
:
X1
.
t
->
t
->
X2
.
t
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment