FGL symbolic object type

This is a sum-of-products (i.e., union) type, introduced by defflexsum.

`:g-concrete`→ g-concrete- FGL-object constructor for constant (quoted) objects.
`:g-boolean`→ g-boolean- FGL object constructor for symbolic Boolean objects.
`:g-integer`→ g-integer- FGL object constructor for symbolic integers, with Boolean functions representing the bits.
`:g-ite`→ g-ite- FGL object constructor for if-then-else objects.
`:g-apply`→ g-apply- FGL object constructor for function calls.
`:g-var`→ g-var- FGL object constructor for free variables.
`:g-map`→ g-map- FGL object constructor for fast alists and arrays.
`:g-cons`→ g-cons- FGL object constructor for conses.

An FGL symbolic object is the representation for symbolic data inside the FGL interpreter. There are several kinds of objects, including concrete objects that simply represent a particular explicit value, bit-level objects that represent some function resulting in a Boolean or bitvector (integer), and termlike objects that represent free variables and calls of arbitrary functions on symbolic objects.

Symbolic objects are evaluated using fgl-object-eval. This takes an environment object of type fgl-env consisting of an alist mapping free variables to their values, for evaluating g-var objects, and a Boolean function environment for evaluating g-boolean and g-integer objects.

The FGL object type is an

;; If x is a g-concrete representing an integer, return its integer-length plus ;; one, else if it's a g-integer return the length of its bitlist, else NIL: (fgl-object-case x :g-concrete (and (integerp x.val) (+ 1 (integer-length x.val))) :g-integer (len x.bits) :otherwise nil) ;; Check whether x can be syntactically determined to be always non-NIL. (defun gobj-syntactically-nonnil (x) (fgl-object-case x :g-concrete (and x.val t) :g-integer t :g-boolean (eq x.bool t) :g-ite (if (gobj-syntactically-nonnil x.test) (gobj-syntactically-nonnil x.then) (and (gobj-syntactically-nonnil x.then) (gobj-syntactically-nonnil x.else))) :g-apply nil :g-var nil :g-cons t :g-map (and x.alist t))) ;; Check whether x is a g-concrete object. (fgl-object-case x :g-concrete) ;; Check whether x is either a g-concrete or g-boolean object. (fgl-object-case x '(:g-concrete :g-boolean))

The first two examples above show

- Fgl-object-eval
- Evaluator for FGL symbolic objects.
- Fgl-object-p
- Recognizer for fgl-object structures.
- G-map
- FGL object constructor for fast alists and arrays.
- G-ite
- FGL object constructor for if-then-else objects.
- G-cons
- FGL object constructor for conses.
- G-concrete
- FGL-object constructor for constant (quoted) objects.
- G-apply
- FGL object constructor for function calls.
- G-integer
- FGL object constructor for symbolic integers, with Boolean functions representing the bits.
- Fgl-object-equiv
- Basic equivalence relation for fgl-object structures.
- G-boolean
- FGL object constructor for symbolic Boolean objects.
- G-var
- FGL object constructor for free variables.
- Fgl-bitvector
- Bitvector representation in FGL
- Fgl-object-kind
- Get the
*kind*(tag) of a fgl-object structure. - Summarize-fgl-object
- Remove repeated unary function calls in an FGL object to create an object that might be smaller to print.
- Fgl-object-alist
- An alist mapping anything to fgl-object-p.
- Fgl-objectlist
- A list of fgl-object-p objects.
- Fgl-object-fix
- Fixing function for fgl-object structures.
- Fgl-object-count
- Measure for recurring over fgl-object structures.