Skip to content

Commit c09139d

Browse files
committed
CHB: add documentation
1 parent a6cbd15 commit c09139d

File tree

1 file changed

+38
-3
lines changed

1 file changed

+38
-3
lines changed

CodeHawk/CHB/bchlib/bCHLibTypes.mli

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,34 @@ end
16081608

16091609
(** {1 Invariants}*)
16101610

1611-
(** {2 Variable invariants} *)
1611+
(** {2 Variable invariants}
1612+
1613+
Variable invariants are symbolic invariants including:
1614+
- reaching definitions
1615+
- flag reaching definitions (for architectures with processor flags)
1616+
- def-use relationships
1617+
- def-use-high relationships
1618+
1619+
The reaching definitions are the traditional relationships between a
1620+
variable use and all locations where that variable may have been defined.
1621+
1622+
The def-use relationships are the traditional relationships between
1623+
a variable definition and all locations where that variable may be used.
1624+
1625+
The def-use-high relationships are similar to the def-use relationships,
1626+
but are only computed for variables that would appear in a source-code
1627+
lifting.
1628+
1629+
The reaching definitions are computed directly by forward abstract
1630+
interpretation in a symbolic domain with the hooks embedded in the same
1631+
CHIF representation that is used for the regular (value) invariant
1632+
generation.
1633+
1634+
The def-use and def-use-high relationships (normally computed by backward
1635+
analysis) are instead derived directly from the reaching definitions by
1636+
recording the uses (and high-uses) in the functioninfo and using these to
1637+
filter out the reverse relationships of the reaching definitions.
1638+
*)
16121639

16131640
(** Pairing of a variable with a set of locations represented by symbols.*)
16141641
type vardefuse_t = variable_t * symbol_t list
@@ -1624,7 +1651,7 @@ type var_invariant_fact_t =
16241651
(** list of locations where a high-level variable is used *)
16251652

16261653

1627-
(** Single variable invariant at a particular location.*)
1654+
(** Single variable invariant at a particular location (immutable).*)
16281655
class type var_invariant_int =
16291656
object ('a)
16301657
method index: int
@@ -1649,7 +1676,15 @@ class type var_invariant_int =
16491676
end
16501677

16511678

1652-
(** All variable invariants at a particular location.*)
1679+
(** All variable invariants at a particular location.
1680+
1681+
Mutable class that collects variable invariants at a particular location
1682+
(instruction address) in the code. Reaching defs are added as complete
1683+
facts, def-use facts are constructed one use-location at the time, as they
1684+
are retrieved from the reaching def facts. The collect_use_facts method
1685+
is called to package up these def-use facts when all reaching defs have
1686+
been processed.
1687+
*)
16531688
class type location_var_invariant_int =
16541689
object
16551690
method reset: unit

0 commit comments

Comments
 (0)