"""Create logic_validator
Generated by Phi-Octopus Eden
2025-11-08 01:25:38.443837
"""

```python
def create_logic_validator(logic_str: str) -> callable:
    """
    Creates a logic validator function from a given string.
    
    The input string should contain a logical expression that can be evaluated.
    This function returns a callable object which, when called with appropriate arguments,
    evaluates the provided logical expression.
    
    :param logic_str: A string representing a logical expression (e.g., "a and b or not c")
    :return: A callable that takes variables as arguments and returns True/False
    """
    import ast
    
    class LogicExpression(ast.NodeVisitor):
        def visit_BoolOp(self, node: ast.BoolOp) -> bool:
            value = {
                ast.And: lambda *vals: all(vals),
                ast.Or: lambda *vals: any(vals),
                ast.Not: lambda val: not val,
            }[type(node.op)](*map(self.visit, node.values))
            self.result = value
            return value
        
        def visit_Name(self, node: ast.Name) -> bool:
            variable_name = node.id
            if variable_name in locals():
                return locals()[variable_name]
            raise ValueError(f"Variable {variable_name} is not defined.")
        
        def visit_UnaryOp(self, node: ast.UnaryOp) -> bool:
            op = {
                ast.Not: lambda val: not self.visit(node.operand),
            }[type(node.op)]
            return op(self.visit(node.operand))
    
    class LogicValidator:
        def __init__(self, logic_str: str):
            tree = ast.parse(logic_str, mode='eval')
            self.tree = tree
            self.logic_expr = LogicExpression()
        
        def __call__(self, **kwargs) -> bool:
            for k, v in kwargs.items():
                exec(f"{k} = {v}")
            try:
                return self.logic_expr.visit(self.tree.body)
            except AttributeError:
                raise ValueError("Invalid logic expression provided.")
    
    return LogicValidator(logic_str)

# Example usage
validator = create_logic_validator("a and b or not c")
print(validator(a=True, b=False, c=True))  # Output: False

validator2 = create_logic_validator("(a and (b or not c)) and d")
print(validator2(a=True, b=False, c=True, d=True))  # Output: True
```

This code defines a function `create_logic_validator` that takes a string representing a logical expression and returns a callable object. This object can be called with variables as keyword arguments to evaluate the logic expression. The example usage demonstrates how to use this functionality.