<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKRuleSystem/grade(forFact:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKRuleSystem(im)gradeForFact:"
  },
  "title" : "grade(forFact:)"
}
-->

# grade(forFact:)

Returns the membership grade of the specified fact.

```
func grade(forFact fact: any NSObjectProtocol) -> Float
```

## Parameters

`fact`

An object representing a truth claimed or rejected by the rule system. For details, see the [`facts`](/documentation/GameplayKit/GKRuleSystem/facts) property.

## Return Value

A value in the range [0.0, 1.0] representing the fact’s membership grade.

## Discussion

Each fact has a membership grade ranging from zero to 1.0, representing variable levels of truth, strength, or confidence for use in fuzzy logic. Use the [`GKRuleSystem`](/documentation/GameplayKit/GKRuleSystem) methods listed in Asserting and Retracting Facts to add or remove facts and set their membership grade—asserting a fact increases its grade, adding it to the array if not present; retracting a set reduces its grade, removing it from the array if its grade drops to zero.

If the specified fact is not in the [`facts`](/documentation/GameplayKit/GKRuleSystem/facts) array, this method returns `0.0`.

## See Also

[`facts`](/documentation/GameplayKit/GKRuleSystem/facts)

The list of facts claimed by the rule system.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)