<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NumberGuessConsole
{
    class Program
    {
        static void Main(string[] args)
        {
        }
    }
}<commit_msg>Add classes for Formula<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using Blaze.Propositions;
using static Blaze.Propositions.Formula;

namespace NumberGuessConsole
{
    class Program
    {
        static void Main(string[] args)
        {
        }
    }

    public static class FormulaHelper
    {
        // formula の中から変数を取得します。なければ作成します。
        public static VariableFormula<TStatement> GetVariable<TStatement>(this Formula formula, TStatement statement) =>
            formula.GetDescendants()
                .OfType<VariableFormula<TStatement>>()
                .Distinct()
                .Where(v => Equals(v.Statement, statement))
                .FirstOrDefault() ?? Variable(statement);

        public static VariableFormula<TStatement> GetVariable<TStatement>(this Formula formula, VariableFormula<TStatement> variable) =>
            formula.GetVariable(variable.Statement);

        public static VariableFormula<TStatement> CreateProposition<TStatement>(TStatement statement, bool? truthValue)
        {
            var v = Variable(statement);
            v.Value = truthValue;
            return v;
        }
    }
}
{'fraction_non_alphanumeric': 0.08933518005540166, 'fraction_numerical': 0.0, 'mean_word_length': 2.6956521739130435, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 15, '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': '2752091', 'n_tokens_mistral': 401, 'n_tokens_neox': 380, 'n_words': 85}