Auditor tagging

From Erights

(Difference between revisions)
Jump to: navigation, search
(Proposals)
(Proposals)
Line 38: Line 38:
* Distinguishing between null and other Data is a bit unclean, since null is also valid Data. Instead, how about if the annotation is either null or a FinalSlot containing Data.
* Distinguishing between null and other Data is a bit unclean, since null is also valid Data. Instead, how about if the annotation is either null or a FinalSlot containing Data.
-
--[[User:67.127.191.99|67.127.191.99]] 22:38, 13 March 2008 (CDT)
+
--[[User:Markm|markm]] 22:40, 13 March 2008 (CDT)
==Discussion==
==Discussion==

Revision as of 03:40, 14 March 2008

It is possible for an auditor to tag an object with arbitrary data, by encoding it in a pattern of approvals by additional auditors (see code below).

Since this is possible, and could be useful, it should be made possible to do so without inefficient gimmicks.

  def makeStamp() { return def stamp { to audit(_) { return true } } }
  def bits := accum [] for i in 0..!4 { _.with(makeStamp()) }
  def encodingAuditor {
    to audit(a :Audition) :boolean {
      def toEncode := (a.getSource().getOName() \
                        .getOptName().last() - '0') % (2**bits.size())
      for i => bit in bits {
        if ((toEncode & (1 << i)) > 0) {
          a.ask(bit)
        }
      }
      return true
    }
    to retrieve(specimen :any) :int {
      var result := 0
      for i => bit in bits {
        if (__auditedBy(bit, specimen)) {
          result |= (1 << i)
        }
      }
      return result
    }
  }
  ? def x7 implements encodingAuditor {}
  # value: <x7>
  
  ? encodingAuditor.retrieve(x7)
  # value: 7

Proposals

  • Distinguishing between null and other Data is a bit unclean, since null is also valid Data. Instead, how about if the annotation is either null or a FinalSlot containing Data.

--markm 22:40, 13 March 2008 (CDT)

Discussion

Personal tools
more tools