From 4826595085245d9b80e1c6e5517ebbbe10a6148a Mon Sep 17 00:00:00 2001 From: Azzaare Date: Thu, 21 Mar 2024 14:45:34 +0900 Subject: [PATCH 1/3] Test and update doc (@example) --- src/constraints/intension.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/constraints/intension.jl b/src/constraints/intension.jl index aa71b17..a2cd7b5 100644 --- a/src/constraints/intension.jl +++ b/src/constraints/intension.jl @@ -23,11 +23,12 @@ concept(:dist_different)(x) ``` # Examples -```julia + +```@example intention c = concept(:dist_different) -c([1, 2, 3, 3]) # true -c([1, 2, 3, 4]) # false +c([1, 2, 3, 3]) && !c([1, 2, 3, 4]) ``` + """ xcsp_intension(; list, predicate) = predicate(list) From 3250df35bd688ba709eae57485361e0822e474f4 Mon Sep 17 00:00:00 2001 From: Azzaare Date: Thu, 21 Mar 2024 14:49:24 +0900 Subject: [PATCH 2/3] test doc --- src/constraints/intension.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/constraints/intension.jl b/src/constraints/intension.jl index a2cd7b5..4621fed 100644 --- a/src/constraints/intension.jl +++ b/src/constraints/intension.jl @@ -25,8 +25,7 @@ concept(:dist_different)(x) # Examples ```@example intention -c = concept(:dist_different) -c([1, 2, 3, 3]) && !c([1, 2, 3, 4]) +2 + 2 == 4 ``` """ From 74aa771688ad22f41f99d78137bd7115d00816fd Mon Sep 17 00:00:00 2001 From: Azzaare Date: Thu, 21 Mar 2024 15:57:50 +0900 Subject: [PATCH 3/3] Update doc to debug DocumenterVitePress --- src/Constraints.jl | 4 ++-- .../{intension.jl => intention.jl} | 20 +++++++++++++++++-- src/usual_constraints.jl | 1 + 3 files changed, 21 insertions(+), 4 deletions(-) rename src/constraints/{intension.jl => intention.jl} (84%) diff --git a/src/Constraints.jl b/src/Constraints.jl index 5827942..d8d2446 100644 --- a/src/Constraints.jl +++ b/src/Constraints.jl @@ -38,8 +38,8 @@ include("constraint.jl") ## SECTION - Usual constraints (based on and including XCSP3-core categories) include("usual_constraints.jl") -# SECTION - Generic Constraints: intension, extension -include("constraints/intension.jl") +# SECTION - Generic Constraints: intention, extension +include("constraints/intention.jl") include("constraints/extension.jl") # SECTION - Constraints defined from Languages diff --git a/src/constraints/intension.jl b/src/constraints/intention.jl similarity index 84% rename from src/constraints/intension.jl rename to src/constraints/intention.jl index 4621fed..421f9df 100644 --- a/src/constraints/intension.jl +++ b/src/constraints/intention.jl @@ -24,10 +24,26 @@ concept(:dist_different)(x) # Examples -```@example intention -2 + 2 == 4 +````@example debug2 +2 + 2 +```` + +```@example debug1 +2 + 2 +``` + +```@example intention1 +using Constraints # hide +c = concept(:dist_different) +c([1, 2, 3, 3]) && !c([1, 2, 3, 4]) ``` +````@example intention2 +using Constraints # hide +c = concept(:dist_different) +c([1, 2, 3, 3]) && !c([1, 2, 3, 4]) +```` + """ xcsp_intension(; list, predicate) = predicate(list) diff --git a/src/usual_constraints.jl b/src/usual_constraints.jl index c37b500..729a272 100644 --- a/src/usual_constraints.jl +++ b/src/usual_constraints.jl @@ -225,6 +225,7 @@ concept(:all_different, [1, 2, 3]) ``` """ concept(s::Symbol, args...; kargs...) = concept(USUAL_CONSTRAINTS[s])(args...; kargs...) +concept(s::Symbol) = concept(USUAL_CONSTRAINTS[s]) ## SECTION - Test Items @testitem "Usual constraints" tags = [:usual, :constraints] default_imports = false begin