@Override
    protected Type typeCheckLocal(Scope<Type> scope) {
        Expression arg = expectOneArgument();
        Type type = arg.typeCheck(scope);
        if (!type.isA(Type.optionalType(Type.anyType()))) {
            throw new RuntimeException(String.format("Expected %s but found %s",
                    Type.optionalType(Type.anyType()),
                    type));
        }

        // Insert the non-null fact, but only for references.
        if (arg instanceof Reference) {
            scope.setNonNull((Reference) arg);
        }
        return Type.booleanType();
    }
Creates a {@link IsSet} function from the given expressions.

@param arg1 the expression to negate.
@return The resulting {@link IsSet} function.
smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/syntax/expressions/functions/IsSet.java