<!--
{
  "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/assertFact(_:grade:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKRuleSystem(im)assertFact:grade:"
  },
  "title" : "assertFact(_:grade:)"
}
-->

# assertFact(_:grade:)

Increases the membership grade of the specified fact by the specified amount, adding it to the fact set if necessary, and reevaluates the rules in the system’s agenda.

```
func assertFact(_ fact: any NSObjectProtocol, grade: Float)
```

## Parameters

`fact`

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

`grade`

The amount by which to increase 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. Calling this method increases the fact’s grade by the amount specified in the `grade` parameter (up to a maximum of 1.0), adding the fact to the [`facts`](/documentation/GameplayKit/GKRuleSystem/facts) array if it is not already present.

Upon asserting or retracting any facts, the system reevaluates the rules in its [`agenda`](/documentation/GameplayKit/GKRuleSystem/agenda) list so any rules that depend on changes to the set of facts can perform their actions.

---

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)