Execute a structure pointer member operation on an expression value.
(exec-memberp str mem compst) → eval
This is for the
We return an expression value whose object designator is obtained by adding the member to the object designator in the pointer.
Function:
(defun exec-memberp (str mem compst) (declare (xargs :guard (and (expr-valuep str) (identp mem) (compustatep compst)))) (let ((__function__ 'exec-memberp)) (declare (ignorable __function__)) (b* ((str (apconvert-expr-value str)) ((when (errorp str)) str) (str (expr-value->value str)) ((unless (value-case str :pointer)) (error (list :mistype-memberp :required :pointer :supplied (type-of-value str)))) ((unless (value-pointer-validp str)) (error (list :invalid-pointer str))) (objdes (value-pointer->designator str)) (reftype (value-pointer->reftype str)) (struct (read-object objdes compst)) ((when (errorp struct)) (error (list :struct-not-found str (compustate-fix compst)))) ((unless (value-case struct :struct)) (error (list :not-struct str (compustate-fix compst)))) ((unless (equal reftype (type-struct (value-struct->tag struct)))) (error (list :mistype-struct-read :pointer reftype :array (type-struct (value-struct->tag struct))))) (val (value-struct-read mem struct)) ((when (errorp val)) val) (objdes-mem (make-objdesign-member :super objdes :name mem))) (make-expr-value :value val :object objdes-mem))))
Theorem:
(defthm expr-value-resultp-of-exec-memberp (b* ((eval (exec-memberp str mem compst))) (expr-value-resultp eval)) :rule-classes :rewrite)
Theorem:
(defthm exec-memberp-of-expr-value-fix-str (equal (exec-memberp (expr-value-fix str) mem compst) (exec-memberp str mem compst)))
Theorem:
(defthm exec-memberp-expr-value-equiv-congruence-on-str (implies (expr-value-equiv str str-equiv) (equal (exec-memberp str mem compst) (exec-memberp str-equiv mem compst))) :rule-classes :congruence)
Theorem:
(defthm exec-memberp-of-ident-fix-mem (equal (exec-memberp str (ident-fix mem) compst) (exec-memberp str mem compst)))
Theorem:
(defthm exec-memberp-ident-equiv-congruence-on-mem (implies (ident-equiv mem mem-equiv) (equal (exec-memberp str mem compst) (exec-memberp str mem-equiv compst))) :rule-classes :congruence)
Theorem:
(defthm exec-memberp-of-compustate-fix-compst (equal (exec-memberp str mem (compustate-fix compst)) (exec-memberp str mem compst)))
Theorem:
(defthm exec-memberp-compustate-equiv-congruence-on-compst (implies (compustate-equiv compst compst-equiv) (equal (exec-memberp str mem compst) (exec-memberp str mem compst-equiv))) :rule-classes :congruence)