# Smoke Arithmetic
# Small Notation3 source used to prove that see.js generates a specialized JS
# example which derives its answer from facts, math built-ins, fuses, and string
# formatting instead of reading a prewritten conclusion.

@prefix : <https://example.org/see/smoke#> .
@prefix math: <http://www.w3.org/2000/10/swap/math#> .
@prefix string: <http://www.w3.org/2000/10/swap/string#> .
@prefix log: <http://www.w3.org/2000/10/swap/log#> .

:Input :x 6; :y 7.

{ :Input :x ?X; :y ?Y.
  (?X ?Y) math:product ?Product.
  ?Product math:greaterThan 0.
} => {
  :Case :product ?Product.
  :Check :c1 "OK - product was derived from the input facts.".
} .

{ :Case :product ?Product.
  :Check :c1 ?C1.
  ("=== Answer ===\nproduct = %s\n\n=== Reason Why ===\nThe compiled rule multiplies :x and :y using math:product.\n\n=== Check ===\nC1 %s\n" ?Product ?C1) string:format ?Block.
} => { :out01 log:outputString ?Block. } .
