aboutsummaryrefslogtreecommitdiffstats
path: root/examples/family.sol
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-07-12 10:20:13 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-07-12 17:56:11 -0300
commitb7ab0a9d1f0275db32a526faf7cffe9d520b15c8 (patch)
tree435cc5e768e86709f518a334ba58bdda337e3b0c /examples/family.sol
parentf52efd20120cf5ceeae28da2c04d57acc6e46f14 (diff)
downloadSOL-b7ab0a9d1f0275db32a526faf7cffe9d520b15c8.tar.gz
SOL-b7ab0a9d1f0275db32a526faf7cffe9d520b15c8.zip
interval characterization proofs and worked examples
Diffstat (limited to 'examples/family.sol')
-rw-r--r--examples/family.sol27
1 files changed, 27 insertions, 0 deletions
diff --git a/examples/family.sol b/examples/family.sol
new file mode 100644
index 0000000..8d1f7f9
--- /dev/null
+++ b/examples/family.sol
@@ -0,0 +1,27 @@
+% Relations, facts, rules, joins and negation.
+
+Relation named: Person schema: #(
+ [name domain: String]
+ [age domain: Integer]
+)
+
+[Person name: "Marcos" age: 30]
+[Person name: "Ana" age: 12]
+[Person name: "Rui" age: 70]
+
+Rule name: "an adult is a person of age at least 18"
+ head: [Adult name: N]
+ body: [Person name: N age: A] :and
+ [GreaterEqual left: A right: 18]
+
+% Everyone stored.
+Query expression: [Person name: N age: A]
+
+% The rule, joined through the shared variable N.
+Query expression: [Adult name: N]
+
+% Decidable denial: people who are not adults.
+Query expression: ([Person name: N age: A]) :not [Adult name: N]
+
+% The specification's negation form, scoped by the universe.
+Query expression: [World] :not [Adult name: "Ana"]