<commit_before>/*
	This module is responsible for the validation of xml schema types.
	@see https://www.w3.org/TR/xmlschema11-2/ for more information.
*/
:- module(simpletype,
	[
		validate_xsd_simpleType/2,
		facet/3
	]).

:- use_module(library(xsd/xsd_messages)).

% https://github.com/mndrix/regex
:- use_module(library(regex)).


/*
	TYPE VALIDATION
	validate_xsd_simpleType(Type, Value)
	--> validates `Value` against (XML-Schema) type `Type`
*/

% top of hierarchy (semantically equivalent in our case, but required by specification)
validate_xsd_simpleType('anyType', V) :-
	nonvar(V).
validate_xsd_simpleType('anySimpleType', V) :-
	validate_xsd_simpleType('anyType', V).
validate_xsd_simpleType('untyped', V) :-
	validate_xsd_simpleType('anyType', V).

% non atomic types<commit_msg>Add is_xsd_simpleType/1<commit_after>/*
	This module is responsible for the validation of xml schema types.
	@see https://www.w3.org/TR/xmlschema11-2/ for more information.
*/
:- module(simpletype,
	[
		validate_xsd_simpleType/2,
		facet/3,
		is_xsd_simpleType/1
	]).

:- use_module(library(xsd/xsd_messages)).

% https://github.com/mndrix/regex
:- use_module(library(regex)).

is_xsd_simpleType(T) :-
	validate_xsd_simpleType(T, _).

/*
	TYPE VALIDATION
	validate_xsd_simpleType(Type, Value)
	--> validates `Value` against (XML-Schema) type `Type`
*/

% top of hierarchy (semantically equivalent in our case, but required by specification)
validate_xsd_simpleType('anyType', V) :-
	nonvar(V).
validate_xsd_simpleType('anySimpleType', V) :-
	validate_xsd_simpleType('anyType', V).
validate_xsd_simpleType('untyped', V) :-
	validate_xsd_simpleType('anyType', V).

% non atomic types
{'fraction_non_alphanumeric': 0.13807531380753138, 'fraction_numerical': 0.008368200836820083, 'mean_word_length': 5.109489051094891, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, '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': '4789777', 'n_tokens_mistral': 616, 'n_tokens_neox': 574, 'n_words': 121}