<commit_before>;; =============================================================================
;; Fuzzy conjunction introduction rule
;;
;; A1
;; ...
;; An
;; |-
;; AndLink
;;   A1
;;   ...
;;   An
;;
;; Where A1 to An are atoms with a fuzzy TV
;; -----------------------------------------------------------------------------

(use-modules (srfi srfi-1))

;; Generate variable (Variable prefix + "-" + to_string(i))
(define (gen-variable prefix i)
  (Variable (string-append prefix "-" (number->string i))))

;; Generate a list of variables (Variable prefix + "-" + to_string(n))
(define (gen-variables prefix n)
  (if (= n 0)
      ;; Base case
      '()
      ;; Recursive case
      (append (gen-variables prefix (- n 1))
              (list (gen-variable prefix (- n 1))))))

;; Generate a fuzzy conjunction introduction rule for an n-ary
;; conjunction
(define (gen-fuzzy-conjunction-introduction-rule nary)
  (let* ((variables (gen-variables "$X" nary))<commit_msg>Use gen-variables from rule-engine module<commit_after>;; =============================================================================
;; Fuzzy conjunction introduction rule
;;
;; A1
;; ...
;; An
;; |-
;; AndLink
;;   A1
;;   ...
;;   An
;;
;; Where A1 to An are atoms with a fuzzy TV
;; -----------------------------------------------------------------------------

(use-modules (srfi srfi-1))
(use-modules (opencog rule-engine))

;; Generate a fuzzy conjunction introduction rule for an n-ary
;; conjunction
(define (gen-fuzzy-conjunction-introduction-rule nary)
  (let* ((variables (gen-variables "$X" nary))
{'fraction_non_alphanumeric': 0.33080808080808083, 'fraction_numerical': 0.006944444444444444, 'mean_word_length': 2.530066815144766, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5012292', 'n_tokens_mistral': 457, 'n_tokens_neox': 418, 'n_words': 131}