code: func (c *Corpus) PermanodeHasAttrValue(pn blob.Ref, at time.Time, attr, val string) bool {
  	pm, ok := c.permanodes[pn]
  	if !ok {
  		return false
  	}
  	if values, ok := pm.valuesAtSigner(at, ""); ok {
  		for _, v := range values[attr] {
  			if v == val {
  				return true
  			}
  		}
  		return false
  	}
  	if at.IsZero() {
  		at = time.Now()
  	}
  	ret := false
  	for _, cl := range pm.Claims {
  		if cl.Attr != attr {
  			continue
  		}
  		if cl.Date.After(at) {
  			break
  		}
  		switch cl.Type {
  		case string(schema.DelAttributeClaim):
  			if cl.Value == "" || cl.Value == val {
  				ret = false
  			}
  		case string(schema.SetAttributeClaim):
  			ret = (cl.Value == val)
  		case string(schema.AddAttributeClaim):
  			if cl.Value == val {
  				ret = true
  			}
  		}
  	}
  	return ret
  }
docs: // PermanodeHasAttrValue reports whether the permanode pn at
  // time at (zero means now) has the given attribute with the given
  // value. If the attribute is multi-valued, any may match.