• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
      • Ipasir
      • Aignet
        • Base-api
          • Aignet-case
          • Aignet-init
          • Aignet-add-xor
          • Aignet-add-and
          • Gate-id->fanin1
          • Gate-id->fanin0
          • Ci-id->ionum
          • Literal
          • Aignet-set-nxst
            • Aignet-clear
            • Aignet-add-out
            • Regnum->nxst
            • Id->slot1
            • Id->phase
            • Num-regs
            • Num-ins
            • Num-fanins
            • Id->slot0
            • Regnum->id
            • Id->type
            • Id->regp
            • Outnum->fanin
            • Innum->id
            • Id-existsp
            • Aignet-add-reg
            • Aignet-add-in
            • Num-gates
            • Aignet-rollback
            • Num-outs
            • Num-nxsts
            • Fanin-litp
          • Aignet-construction
          • Representation
          • Aignet-copy-init
          • Aignet-simplify-marked-with-tracking
          • Aignet-cnf
          • Aignet-simplify-with-tracking
          • Aignet-complete-copy
          • Aignet-eval
          • Semantics
          • Aignet-transforms
          • Aignet-simplify-marked
          • Aignet-read-aiger
          • Aignet-write-aiger
          • Aignet-abc-interface
          • Utilities
        • Aig
        • Satlink
        • Truth
        • Ubdds
        • Bdd
        • Faig
        • Bed
        • 4v
      • Projects
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Base-api

    Aignet-set-nxst

    (aignet-set-nxst f reg aignet) adds a next-state node to the aignet.

    Logically this is just:

    (cons (nxst-node (aignet-lit-fix f aignet)
                     (aignet-id-fix regid aignet))
          aignet)

    The fixing here ensures that well-formedness of the network is preserved unconditionally.

    In the execution we update the necessary arrays, counts, etc.

    Function: aignet-set-nxst^

    (defun
       aignet$a::aignet-set-nxst^
       (f reg aignet)
       (declare
            (xargs :guard (and (litp f)
                               (natp reg)
                               (aignet$a::aignet-well-formedp aignet))))
       (declare (xargs :guard (and (aignet$a::id-existsp (lit->var f)
                                                         aignet)
                                   (< reg (aignet$a::num-regs aignet))
                                   (< (aignet$a::num-nxsts aignet)
                                      536870911))))
       (let ((__function__ 'aignet$a::aignet-set-nxst^))
            (declare (ignorable __function__))
            (cons (nxst-node (aignet-lit-fix f aignet)
                             reg)
                  (node-list-fix aignet))))