diff --git a/predicates_versioned_docs/version-v11.0.0/abolish_1.md b/predicates_versioned_docs/version-v11.0.0/abolish_1.md new file mode 100644 index 00000000000..86ecc8a0971 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/abolish_1.md @@ -0,0 +1,20 @@ +--- +sidebar_position: 1 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# abolish/1 + +## Description + +`abolish/1` is a predicate that abolishes a predicate from the database. Removes all clauses of the predicate designated by given predicate indicator Name/Arity. + +## Signature + +```text +abolish(+PredicateIndicator) +``` + +Where: + +- PredicateIndicator is the indicator of the predicate to abolish. diff --git a/predicates_versioned_docs/version-v11.0.0/asserta_1.md b/predicates_versioned_docs/version-v11.0.0/asserta_1.md new file mode 100644 index 00000000000..659faddc1a4 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/asserta_1.md @@ -0,0 +1,178 @@ +--- +sidebar_position: 2 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# asserta/1 + +## Description + +`asserta/1` is a predicate that asserts a clause into the database as the first clause of the predicate. + +## Signature + +```text +asserta(+Clause) +``` + +Where: + +- Clause is the clause to assert into the database. + +## Examples + +### Assert a fact into the database + +This scenario demonstrates the process of asserting a new fact into a Prolog database. In Prolog, asserting a fact means +adding a new piece of information or *knowledge* into the database, allowing it to be referenced in subsequent queries. +This is particularly useful when you want to dynamically extend the knowledge base with facts or rules based on conditions +or interactions during runtime. + +Here are the steps of the scenario: + +- **Given** the program: + +``` prolog +assert_fact :- asserta(father(john, pete)). +``` + +- **Given** the query: + +``` prolog +assert_fact, father(X, Y). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3977 +answer: + has_more: false + variables: ["X", "Y"] + results: + - substitutions: + - variable: X + expression: john + - variable: 'Y' + expression: pete +``` + +### Only dynamic predicates can be asserted + +This scenario demonstrates that only dynamic predicates can be asserted. In Prolog, dynamic predicates are those that can be +modified during runtime. This is in contrast to static predicates, which are fixed and cannot be modified. + +Here are the steps of the scenario: + +- **Given** the program: + +``` prolog +parent(jane, alice). +``` + +- **Given** the query: + +``` prolog +asserta(parent(john, alice)). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3975 +answer: + has_more: false + results: + - error: "error(permission_error(modify,static_procedure,parent/2),asserta/1)" +``` + +### Show that the fact is asserted at the beginning of the database + +This scenario demonstrates that the asserta/1 predicate adds the fact to the beginning of the database. This means that +the fact is the first fact to be matched when a query is run. + +This is in contrast to the assertz/1 predicate, which adds the fact to the end of the database. + +Here are the steps of the scenario: + +- **Given** the program: + +``` prolog +:- dynamic(parent/2). + +parent(jane, alice). + +assert_fact :- asserta(parent(john, alice)). +``` + +- **Given** the query: + +``` prolog +assert_fact, parent(X, alice). +``` + +- **When** the query is run (limited to 2 solutions) +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3977 +answer: + has_more: false + variables: ["X"] + results: + - substitutions: + - variable: X + expression: john + - substitutions: + - variable: X + expression: jane +``` + +### Shows a simple counter example + +This scenario demonstrates a simple counter example using the `asserta/1` and `retract/1` predicates. +In this example, we represent the value of the counter as a dynamic predicate `counter/1` that is asserted and retracted +to each time the value of the counter is incremented or decremented. + +Here are the steps of the scenario: + +- **Given** the program: + +``` prolog +:- dynamic(counter/1). + +counter(0). + +increment_counter :- retract(counter(X)), Y is X + 1, asserta(counter(Y)). +decrement_counter :- retract(counter(X)), Y is X - 1, asserta(counter(Y)). +``` + +- **Given** the query: + +``` prolog +counter(InitialValue), increment_counter, increment_counter, counter(IncrementedValue), decrement_counter, counter(DecrementedValue). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3989 +answer: + has_more: false + variables: ["InitialValue", "IncrementedValue", "DecrementedValue"] + results: + - substitutions: + - variable: InitialValue + expression: 0 + - variable: IncrementedValue + expression: 2 + - variable: DecrementedValue + expression: 1 +``` diff --git a/predicates_versioned_docs/version-v11.0.0/assertz_1.md b/predicates_versioned_docs/version-v11.0.0/assertz_1.md new file mode 100644 index 00000000000..a0e721bbc2a --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/assertz_1.md @@ -0,0 +1,175 @@ +--- +sidebar_position: 3 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# assertz/1 + +## Description + +`assertz/1` is a predicate that asserts a clause into the database as the last clause of the predicate. + +## Signature + +```text +assertz(+Clause) +``` + +Where: + +- Clause is the clause to assert into the database. + +## Examples + +### Assert a fact into the database + +This scenario demonstrates the process of asserting a new fact into a Prolog database. In Prolog, asserting a fact means +adding a new piece of information or *knowledge* into the database, allowing it to be referenced in subsequent queries. +This is particularly useful when you want to dynamically extend the knowledge base with facts or rules based on conditions +or interactions during runtime. + +Here are the steps of the scenario: + +- **Given** the program: + +``` prolog +assert_fact :- assertz(father(john, pete)). +``` + +- **Given** the query: + +``` prolog +assert_fact, father(X, Y). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3977 +answer: + has_more: false + variables: ["X", "Y"] + results: + - substitutions: + - variable: X + expression: john + - variable: 'Y' + expression: pete +``` + +### Only dynamic predicates can be asserted + +This scenario demonstrates that only dynamic predicates can be asserted. In Prolog, dynamic predicates are those that can be +modified during runtime. This is in contrast to static predicates, which are fixed and cannot be modified. + +Here are the steps of the scenario: + +- **Given** the program: + +``` prolog +parent(jane, alice). +``` + +- **Given** the query: + +``` prolog +assertz(parent(john, alice)). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3975 +answer: + has_more: false + results: + - error: "error(permission_error(modify,static_procedure,parent/2),assertz/1)" +``` + +### Show that the fact is asserted at the end of the database + +This scenario demonstrates that the assertz/1 predicate adds the fact to the end of the database. This means that +the fact is the last fact to be matched when a query is run. + +This is in contrast to the asserta/1 predicate, which adds the fact to the beginning of the database. + +Here are the steps of the scenario: + +- **Given** the program: + +``` prolog +:- dynamic(parent/2). + +parent(jane, alice). + +assert_fact :- assertz(parent(john, alice)). +``` + +- **Given** the query: + +``` prolog +assert_fact, parent(X, alice). +``` + +- **When** the query is run (limited to 2 solutions) +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3977 +answer: + has_more: false + variables: ["X"] + results: + - substitutions: + - variable: X + expression: jane + - substitutions: + - variable: X + expression: john +``` + +### Add and remove items in an inventory + +This scenario demonstrates how to maintain a dynamic list of items (like in an inventory system) by representing each item +as a fact in the Prolog knowledge base. By using dynamic predicates, we can add items to the inventory and remove them on demand. + +Here are the steps of the scenario: + +- **Given** the program: + +``` prolog +:- dynamic(inventory/1). + +add_item(Item) :- assertz(inventory(Item)). +remove_item(Item) :- retract(inventory(Item)). +``` + +- **And** the query: + +``` prolog +add_item('apple'), +add_item('banana'), +add_item('orange'), +remove_item('banana'), +findall(I, inventory(I), CurrentInventory). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3984 +answer: + has_more: false + variables: ["I","CurrentInventory"] + results: + - substitutions: + - variable: CurrentInventory + expression: "[apple,orange]" +``` diff --git a/predicates_versioned_docs/version-v11.0.0/atomic_list_concat_2.md b/predicates_versioned_docs/version-v11.0.0/atomic_list_concat_2.md new file mode 100644 index 00000000000..b4735bd0020 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/atomic_list_concat_2.md @@ -0,0 +1,21 @@ +--- +sidebar_position: 4 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# atomic_list_concat/2 + +## Description + +`atomic_list_concat/2` is a predicate that unifies an Atom with the concatenated elements of a List. + +## Signature + +```text +atomic_list_concat(+List, ?Atom) +``` + +where: + +- List is a list of strings, atoms, integers, floating point numbers or non\-integer rationals +- Atom is an Atom representing the concatenation of the elements of List diff --git a/predicates_versioned_docs/version-v11.0.0/atomic_list_concat_3.md b/predicates_versioned_docs/version-v11.0.0/atomic_list_concat_3.md new file mode 100644 index 00000000000..aa0786eab5e --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/atomic_list_concat_3.md @@ -0,0 +1,24 @@ +--- +sidebar_position: 5 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# atomic_list_concat/3 + +## Description + +`atomic_list_concat/3` is a predicate that unifies an Atom with the concatenated elements of a List using a given separator. + +The atomic\_list\_concat/3 predicate creates an atom just like atomic\_list\_concat/2, but inserts Separator between each pair of inputs. + +## Signature + +```text +atomic_list_concat(+List, +Separator, ?Atom) +``` + +where: + +- List is a list of strings, atoms, integers, floating point numbers or non\-integer rationals +- Separator is an atom \(possibly empty\) +- Atom is an Atom representing the concatenation of the elements of List diff --git a/predicates_versioned_docs/version-v11.0.0/bank_balances_2.md b/predicates_versioned_docs/version-v11.0.0/bank_balances_2.md new file mode 100644 index 00000000000..9737f30b019 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/bank_balances_2.md @@ -0,0 +1,34 @@ +--- +sidebar_position: 6 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# bank_balances/2 + +## Description + +`bank_balances/2` is a predicate which unifies the given terms with the list of balances \(coins\) of the given account. + +The signature is as follows: + +```text +bank_balances(?Address, ?Balances) +``` + +where: + +- Address represents the account address \(in Bech32 format\). +- Balances represents the balances of the account as a list of pairs of coin denomination and amount. + +## Examples + +```text +# Query the balances of the account. +- bank_balances('axone1ffd5wx65l407yvm478cxzlgygw07h79sw4jwpa', X). + +# Query the balances of all accounts. The result is a list of pairs of account address and balances. +- bank_balances(X, Y). + +# Query the first balance of the given account by unifying the denomination and amount with the given terms. +- bank_balances('axone1ffd5wx65l407yvm478cxzlgygw07h79sw4jwpa', [-(D, A), _]). +``` diff --git a/predicates_versioned_docs/version-v11.0.0/bank_locked_balances_2.md b/predicates_versioned_docs/version-v11.0.0/bank_locked_balances_2.md new file mode 100644 index 00000000000..3699701974f --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/bank_locked_balances_2.md @@ -0,0 +1,34 @@ +--- +sidebar_position: 7 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# bank_locked_balances/2 + +## Description + +`bank_locked_balances/2` is a predicate which unifies the given terms with the list of locked coins of the given account. + +The signature is as follows: + +```text +bank_locked_balances(?Address, ?Balances) +``` + +where: + +- Address represents the account address \(in Bech32 format\). +- Balances represents the locked balances of the account as a list of pairs of coin denomination and amount. + +## Examples + +```text +# Query the locked coins of the account. +- bank_locked_balances('axone1ffd5wx65l407yvm478cxzlgygw07h79sw4jwpa', X). + +# Query the locked balances of all accounts. The result is a list of pairs of account address and balances. +- bank_locked_balances(X, Y). + +# Query the first locked balances of the given account by unifying the denomination and amount with the given terms. +- bank_locked_balances('axone1ffd5wx65l407yvm478cxzlgygw07h79sw4jwpa', [-(D, A), _]). +``` diff --git a/predicates_versioned_docs/version-v11.0.0/bank_spendable_balances_2.md b/predicates_versioned_docs/version-v11.0.0/bank_spendable_balances_2.md new file mode 100644 index 00000000000..5418fb6311b --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/bank_spendable_balances_2.md @@ -0,0 +1,34 @@ +--- +sidebar_position: 8 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# bank_spendable_balances/2 + +## Description + +`bank_spendable_balances/2` is a predicate which unifies the given terms with the list of spendable coins of the given account. + +The signature is as follows: + +```text +bank_spendable_balances(?Address, ?Balances) +``` + +where: + +- Address represents the account address \(in Bech32 format\). +- Balances represents the spendable balances of the account as a list of pairs of coin denomination and amount. + +## Examples + +```text +# Query the spendable balances of the account. +- bank_spendable_balances('axone1ffd5wx65l407yvm478cxzlgygw07h79sw4jwpa', X). + +# Query the spendable balances of all accounts. The result is a list of pairs of account address and balances. +- bank_spendable_balances(X, Y). + +# Query the first spendable balances of the given account by unifying the denomination and amount with the given terms. +- bank_spendable_balances('axone1ffd5wx65l407yvm478cxzlgygw07h79sw4jwpa', [-(D, A), _]). +``` diff --git a/predicates_versioned_docs/version-v11.0.0/bech32_address_2.md b/predicates_versioned_docs/version-v11.0.0/bech32_address_2.md new file mode 100644 index 00000000000..49dcb0a3bfe --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/bech32_address_2.md @@ -0,0 +1,224 @@ +--- +sidebar_position: 9 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# bech32_address/2 + +## Description + +`bech32_address/2` is a predicate that convert a [bech32]() encoded string into [base64]() bytes and give the address prefix, or convert a prefix \(HRP\) and [base64]() encoded bytes to [bech32]() encoded string. + +## Signature + +```text +bech32_address(-Address, +Bech32) is det +bech32_address(+Address, -Bech32) is det +``` + +where: + +- Address is a pair of the HRP \(Human\-Readable Part\) which holds the address prefix and a list of numbers ranging from 0 to 255 that represent the base64 encoded bech32 address string. +- Bech32 is an Atom or string representing the bech32 encoded string address + +## Examples + +### Decode Bech32 Address into its Address Pair representation + +This scenario demonstrates how to parse a provided bech32 address string into its `Address` pair representation. +An `Address` is a compound term `-` with two arguments, the first being the human-readable part (Hrp) and the second +being the numeric address as a list of integers ranging from 0 to 255 representing the bytes of the address in +base 64. + +Here are the steps of the scenario: + +- **Given** the query: + +``` prolog +bech32_address(Address, 'axone15wn30a9z4uc692s0kkx5fp5d4qfr3ac77gvjg4'). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3975 +answer: + has_more: false + variables: ["Address"] + results: + - substitutions: + - variable: Address + expression: "axone-[163,167,23,244,162,175,49,162,170,15,181,141,68,134,141,168,18,56,247,30]" +``` + +### Decode Hrp and Address from a bech32 address + +This scenario illustrates how to decode a bech32 address into the human-readable part (Hrp) and the numeric address. +The process extracts these components from a given bech32 address string, showcasing the ability to parse and +separate the address into its constituent parts. + +Here are the steps of the scenario: + +- **Given** the query: + +``` prolog +bech32_address(-(Hrp, Address), 'axone15wn30a9z4uc692s0kkx5fp5d4qfr3ac77gvjg4'). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3975 +answer: + has_more: false + variables: ["Hrp", "Address"] + results: + - substitutions: + - variable: Hrp + expression: "axone" + - variable: Address + expression: "[163,167,23,244,162,175,49,162,170,15,181,141,68,134,141,168,18,56,247,30]" +``` + +### Extract Address only for AXONE bech32 address + +This scenario demonstrates how to extract the address from a bech32 address string, specifically for a known +protocol, in this case, the axone protocol. + +Here are the steps of the scenario: + +- **Given** the query: + +``` prolog +bech32_address(-(axone, Address), 'axone15wn30a9z4uc692s0kkx5fp5d4qfr3ac77gvjg4'). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3975 +answer: + has_more: false + variables: ["Address"] + results: + - substitutions: + - variable: Address + expression: "[163,167,23,244,162,175,49,162,170,15,181,141,68,134,141,168,18,56,247,30]" +``` + +### Encode Address Pair into Bech32 Address + +This scenario demonstrates how to encode an `Address` pair representation into a bech32 address string. + +Here are the steps of the scenario: + +- **Given** the query: + +``` prolog +bech32_address(-('axone', [163,167,23,244,162,175,49,162,170,15,181,141,68,134,141,168,18,56,247,30]), Bech32). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3975 +answer: + has_more: false + variables: ["Bech32"] + results: + - substitutions: + - variable: Bech32 + expression: "axone15wn30a9z4uc692s0kkx5fp5d4qfr3ac77gvjg4" +``` + +### Check if a bech32 address is part of the axone protocol + +This scenario shows how to check if a bech32 address is part of the axone protocol. + +Here are the steps of the scenario: + +- **Given** the program: + +``` prolog +axone_addr(Addr) :- bech32_address(-('axone', _), Addr). +``` + +- **Given** the query: + +``` prolog +axone_addr('axone1p8u47en82gmzfm259y6z93r9qe63l25d858vqu'). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3976 +answer: + has_more: false + results: + - substitutions: +``` + +### Error on Incorrect Bech32 Address format + +This scenario demonstrates the system's response to an incorrect bech32 address format. +In this case, the system generates a `domain_error`, indicating that the provided argument does not meet the +expected format for a bech32 address. + +Here are the steps of the scenario: + +- **Given** the query: + +``` prolog +bech32_address(Address, axoneincorrect). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3975 +answer: + has_more: false + variables: ["Address"] + results: + - error: "error(domain_error(encoding(bech32),axoneincorrect),[d,e,c,o,d,i,n,g, ,b,e,c,h,3,2, ,f,a,i,l,e,d,:, ,i,n,v,a,l,i,d, ,s,e,p,a,r,a,t,o,r, ,i,n,d,e,x, ,-,1],bech32_address/2)" +``` + +### Error on Incorrect Bech32 Address type + +This scenario demonstrates the system's response to an incorrect bech32 address type. +In this case, the system generates a `type_error`, indicating that the provided argument does not meet the +expected type. + +Here are the steps of the scenario: + +- **Given** the query: + +``` prolog +bech32_address(-('axone', X), foo(bar)). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3975 +answer: + has_more: false + variables: ["X"] + results: + - error: "error(type_error(atom,foo(bar)),bech32_address/2)" +``` diff --git a/predicates_versioned_docs/version-v11.0.0/block_header_1.md b/predicates_versioned_docs/version-v11.0.0/block_header_1.md new file mode 100644 index 00000000000..d2a32b92e18 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/block_header_1.md @@ -0,0 +1,189 @@ +--- +sidebar_position: 10 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# block_header/1 + +## Description + +`block_header/1` is a predicate which unifies the given term with the current block header. + +## Signature + +```text +block_header(?Header) is det +``` + +where: + +- Header is a Dict representing the current chain header at the time of the query. + +## Examples + +### Retrieve the header of the current block + +This scenario demonstrates how to retrieve the header of the current block and obtain some of its properties. + +The header of a block carries important information about the state of the blockchain, such as basic information (chain id, the height, +time, and height), the information about the last block, hashes, and the consensus info. + +The header is represented as a Prolog Dict, which is a collection of key-value pairs. + +Here are the steps of the scenario: + +- **Given** a block with the following header: + +``` yaml +app_hash: Q0P6b2hoSUbmpCE6o6Dme4H4FBWqdcpqo89DrpBYSHQ= +chain_id: axone-localnet +height: 33 +next_validators_hash: EIQFMnCDepfXD2e3OeL1QoEfmu6BZQbKR500Wkl4gK0= +proposer_address: yz7PSKMWniQlQWMd7LskBABgDKQ= +time: "2024-11-22T21:22:04.676789Z" +``` + +- **Given** the query: + +``` prolog +block_header(Header). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 33 +gas_used: 3975 +answer: + has_more: false + variables: ["Header"] + results: + - substitutions: + - variable: Header + expression: >- + header{app_hash:[67,67,250,111,104,104,73,70,230,164,33,58,163,160,230,123,129,248,20,21,170,117,202,106,163,207,67,174,144,88,72,116],chain_id:'axone-localnet',consensus_hash:[],data_hash:[],evidence_hash:[],height:33,last_block_id:block_id{hash:[],part_set_header:part_set_header{hash:[],total:0}},last_commit_hash:[],last_results_hash:[],next_validators_hash:[16,132,5,50,112,131,122,151,215,15,103,183,57,226,245,66,129,31,154,238,129,101,6,202,71,157,52,90,73,120,128,173],proposer_address:[203,62,207,72,163,22,158,36,37,65,99,29,236,187,36,4,0,96,12,164],time:1732310524,validators_hash:[],version:consensus{app:0,block:0}} +``` + +### Retrieve the block height of the current block + +This scenario demonstrates how to retrieve the block height of the current block. + +Here are the steps of the scenario: + +- **Given** a block with the following header: + +``` yaml +height: 100 +``` + +- **Given** the program: + +``` prolog +height(Height) :- + block_header(Header), + Height = Header.height. +``` + +- **Given** the query: + +``` prolog +height(Height). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 100 +gas_used: 3978 +answer: + has_more: false + variables: ["Height"] + results: + - substitutions: + - variable: Height + expression: "100" +``` + +### Retrieve the block time of the current block + +This scenario demonstrates how to retrieve the block time of the current block. + +Here are the steps of the scenario: + +- **Given** a block with the following header: + +``` yaml +time: 2024-03-04T11:03:36.000Z +``` + +- **Given** the program: + +``` prolog +time(Time) :- + block_header(Header), + Time = Header.time. +``` + +- **Given** the query: + +``` prolog +time(Time). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3978 +answer: + has_more: false + variables: ["Time"] + results: + - substitutions: + - variable: Time + expression: "1709550216" +``` + +### Evaluate a condition based on block time and height + +This scenario demonstrates how to evaluate a condition that depends on both the block time and block height. +Specifically, it checks whether the block time is greater than 1709550216 seconds (Monday 4 March 2024 11:03:36 GMT) +or the block height is greater than 42. + +Here are the steps of the scenario: + +- **Given** a block with the following header: + +``` yaml +time: 2024-03-04T11:03:37.000Z +``` + +- **Given** the program: + +``` prolog +evaluate :- + block_header(Header), + (Header.time > 1709550216; Header.height > 42), + !. +``` + +- **Given** the query: + +``` prolog +evaluate. +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3981 +answer: + has_more: false + results: + - substitutions: +``` diff --git a/predicates_versioned_docs/version-v11.0.0/block_height_1.md b/predicates_versioned_docs/version-v11.0.0/block_height_1.md new file mode 100644 index 00000000000..7a480034921 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/block_height_1.md @@ -0,0 +1,22 @@ +--- +sidebar_position: 11 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# block_height/1 + +## Description + +`block_height/1` is a predicate which unifies the given term with the current block height. + +## Signature + +```text +block_height(?Height) is det +``` + +where: + +- Height represents the current chain height at the time of the query. + +Deprecated: Use the \`block\_header/1\` predicate instead. diff --git a/predicates_versioned_docs/version-v11.0.0/block_time_1.md b/predicates_versioned_docs/version-v11.0.0/block_time_1.md new file mode 100644 index 00000000000..8b81831cb82 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/block_time_1.md @@ -0,0 +1,22 @@ +--- +sidebar_position: 12 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# block_time/1 + +## Description + +`block_time/1` is a predicate which unifies the given term with the current block time. + +## Signature + +```text +block_time(?Time) is det +``` + +where: + +- Time represents the current chain time at the time of the query. + +Deprecated: Use the \`block\_header/1\` predicate instead. diff --git a/predicates_versioned_docs/version-v11.0.0/chain_id_1.md b/predicates_versioned_docs/version-v11.0.0/chain_id_1.md new file mode 100644 index 00000000000..46b66a056f4 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/chain_id_1.md @@ -0,0 +1,22 @@ +--- +sidebar_position: 13 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# chain_id/1 + +## Description + +`chain_id/1` is a predicate which unifies the given term with the current chain ID. The signature is: + +The signature is as follows: + +```text +chain_id(?ID) +``` + +where: + +- ID represents the current chain ID at the time of the query. + +Deprecated: Use the \`block\_header/1\` predicate instead. diff --git a/predicates_versioned_docs/version-v11.0.0/consult_1.md b/predicates_versioned_docs/version-v11.0.0/consult_1.md new file mode 100644 index 00000000000..14f342c6626 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/consult_1.md @@ -0,0 +1,208 @@ +--- +sidebar_position: 14 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# consult/1 + +## Description + +`consult/1` is a predicate which read files as Prolog source code. + +## Signature + +```text +consult(+Files) is det +``` + +where: + +- Files represents the source files to be loaded. It can be an atom or a list of atoms representing the source files. + +The Files argument are typically URIs that point to the sources file to be loaded through the Virtual File System \(VFS\). Please refer to the open/4 predicate for more information about the VFS. + +## Examples + +### Consult a Prolog program + +This scenario demonstrates how to consult (load) a Prolog program from a CosmWasm smart contract. + +Assuming the existence of a CosmWasm smart contract configured to store a Prolog program, we construct a URI to specifically +identify this smart contract and pinpoint the Prolog program we want to consult via a query message. + +Here are the steps of the scenario: + +- **Given** the CosmWasm smart contract "axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk" and the behavior: + +``` yaml +message: | + { + "object_data": { + "id": "4cbe36399aabfcc7158ee7a66cbfffa525bb0ceab33d1ff2cff08759fe0a9b05" + } + } +response: | + hello("World!"). +``` + +- **Given** the program: + +``` prolog +:- + uri_encoded(query_value, '{"object_data":{"id": "4cbe36399aabfcc7158ee7a66cbfffa525bb0ceab33d1ff2cff08759fe0a9b05"}}', Query), + atom_concat('cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk?base64Decode=false&query=', Query, URI), + consult(URI). +``` + +- **Given** the query: + +``` prolog +hello(Who). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3978 +answer: + has_more: false + variables: ["Who"] + results: + - substitutions: + - variable: Who + expression: "['W',o,r,l,d,!]" +``` + +### Consult a Prolog program which also consults another Prolog program + +This scenario demonstrates the capability of a Prolog program to consult another Prolog program. This is useful for +modularizing Prolog programs and reusing code. + +Note that the `:- multifile/1` directive is employed to enable a single predicate's definition to span several files. +In the absence of this directive, encountering a new definition would lead the compiler to overwrite the existing +predicate definition. + +Here are the steps of the scenario: + +- **Given** the CosmWasm smart contract "axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk" and the behavior: + +``` yaml +message: | + { + "object_data": { + "id": "4cbe36399aabfcc7158ee7a66cbfffa525bb0ceab33d1ff2cff08759fe0a9b05" + } + } +response: | + :- multifile(program/1). + :- consult('cosmwasm:storage:axone12ssv28mzr02jffvy4x39akrpky9ykfafzyjzmvgsqqdw78yjevpqvyan0t?query=%7B%22object_data%22%3A%7B%22id%22%3A%20%225d3933430d0a12794fae719e0db87b6ec5f549b2%22%7D%7D&base64Decode=false'). + + program(a). +``` + +- **Given** the CosmWasm smart contract "axone12ssv28mzr02jffvy4x39akrpky9ykfafzyjzmvgsqqdw78yjevpqvyan0t" and the behavior: + +``` yaml +message: | + { + "object_data": { + "id": "5d3933430d0a12794fae719e0db87b6ec5f549b2" + } + } +response: | + :- multifile(program/1). + + program(b). +``` + +- **Given** the query: + +``` prolog + consult('cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk?query=%7B%22object_data%22%3A%7B%22id%22%3A%20%224cbe36399aabfcc7158ee7a66cbfffa525bb0ceab33d1ff2cff08759fe0a9b05%22%7D%7D&base64Decode=false'), + program(X). +``` + +- **When** the query is run (limited to 2 solutions) +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3977 +answer: + has_more: false + variables: ["X"] + results: + - substitutions: + - variable: X + expression: "b" + - substitutions: + - variable: X + expression: "a" +``` + +### Consult several Prolog programs + +This scenario demonstrates the consultation of several Prolog programs from different CosmWasm smart contracts. + +Here are the steps of the scenario: + +- **Given** the CosmWasm smart contract "axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk" and the behavior: + +``` yaml +message: | + { + "object_data": { + "id": "4cbe36399aabfcc7158ee7a66cbfffa525bb0ceab33d1ff2cff08759fe0a9b05" + } + } +response: | + program(a). +``` + +- **Given** the CosmWasm smart contract "axone12ssv28mzr02jffvy4x39akrpky9ykfafzyjzmvgsqqdw78yjevpqvyan0t" and the behavior: + +``` yaml +message: | + { + "object_data": { + "id": "5d3933430d0a12794fae719e0db87b6ec5f549b2" + } + } +response: | + program(b). +``` + +- **Given** the program: + +``` prolog + :- consult([ + 'cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk?query=%7B%22object_data%22%3A%7B%22id%22%3A%20%224cbe36399aabfcc7158ee7a66cbfffa525bb0ceab33d1ff2cff08759fe0a9b05%22%7D%7D&base64Decode=false', + 'cosmwasm:storage:axone12ssv28mzr02jffvy4x39akrpky9ykfafzyjzmvgsqqdw78yjevpqvyan0t?query=%7B%22object_data%22%3A%7B%22id%22%3A%20%225d3933430d0a12794fae719e0db87b6ec5f549b2%22%7D%7D&base64Decode=false' + ]). +``` + +- **Given** the query: + +``` prolog +source_file(File). +``` + +- **When** the query is run (limited to 2 solutions) +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3976 +answer: + has_more: false + variables: ["File"] + results: + - substitutions: + - variable: File + expression: "'cosmwasm:storage:axone12ssv28mzr02jffvy4x39akrpky9ykfafzyjzmvgsqqdw78yjevpqvyan0t?query=%7B%22object_data%22%3A%7B%22id%22%3A%20%225d3933430d0a12794fae719e0db87b6ec5f549b2%22%7D%7D&base64Decode=false'" + - substitutions: + - variable: File + expression: "'cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk?query=%7B%22object_data%22%3A%7B%22id%22%3A%20%224cbe36399aabfcc7158ee7a66cbfffa525bb0ceab33d1ff2cff08759fe0a9b05%22%7D%7D&base64Decode=false'" +``` diff --git a/predicates_versioned_docs/version-v11.0.0/crypto_data_hash_3.md b/predicates_versioned_docs/version-v11.0.0/crypto_data_hash_3.md new file mode 100644 index 00000000000..645a3b814f8 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/crypto_data_hash_3.md @@ -0,0 +1,51 @@ +--- +sidebar_position: 15 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# crypto_data_hash/3 + +## Description + +`crypto_data_hash/3` is a predicate that computes the Hash of the given Data using different algorithms. + +The signature is as follows: + +```text +crypto_data_hash(+Data, -Hash, +Options) is det +crypto_data_hash(+Data, +Hash, +Options) is det +``` + +Where: + +- Data represents the data to be hashed, given as an atom, or code\-list. +- Hash represents the Hashed value of Data, which can be given as an atom or a variable. +- Options are additional configurations for the hashing process. Supported options include: encoding\(\+Format\) which specifies the encoding used for the Data, and algorithm\(\+Alg\) which chooses the hashing algorithm among the supported ones \(see below for details\). + +For Format, the supported encodings are: + +- utf8 \(default\), the UTF\-8 encoding represented as an atom. +- text, the plain text encoding represented as an atom. +- hex, the hexadecimal encoding represented as an atom. +- octet, the raw byte encoding depicted as a list of integers ranging from 0 to 255. + +For Alg, the supported algorithms are: + +- sha256 \(default\): The SHA\-256 algorithm. +- sha512: The SHA\-512 algorithm. +- md5: \(insecure\) The MD5 algorithm. + +Note: Due to the principles of the hash algorithm \(pre\-image resistance\), this predicate can only compute the hash value from input data, and cannot compute the original input data from the hash value. + +## Examples + +```text +# Compute the SHA-256 hash of the given data and unify it with the given Hash. +- crypto_data_hash('Hello AXONE', Hash). + +# Compute the SHA-256 hash of the given hexadecimal data and unify it with the given Hash. +- crypto_data_hash('9b038f8ef6918cbb56040dfda401b56b...', Hash, encoding(hex)). + +# Compute the SHA-256 hash of the given hexadecimal data and unify it with the given Hash. +- crypto_data_hash([127, ...], Hash, encoding(octet)). +``` diff --git a/predicates_versioned_docs/version-v11.0.0/current_output_1.md b/predicates_versioned_docs/version-v11.0.0/current_output_1.md new file mode 100644 index 00000000000..b9d3a38c3c9 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/current_output_1.md @@ -0,0 +1,215 @@ +--- +sidebar_position: 16 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# current_output/1 + +## Description + +`current_output/1` is a predicate that unifies the given term with the current output stream. + +## Signature + +```text +current_output(-Stream) is det +``` + +where: + +- Stream represents the current output stream. + +This predicate connects to the default output stream available for user interactions, allowing the user to perform write operations. + +The outcome of the stream's content throughout the execution of a query is provided as a string within the user\_output field in the query's response. However, it's important to note that the maximum length of the output is constrained by the max\_query\_output\_size setting, meaning only the final max\_query\_output\_size bytes \(not characters\) of the output are included in the response. + +## Examples + +### Write a char to the current output + +This scenario demonstrates how to write a character to the current output, and get the content in the response of the +request. + +Here are the steps of the scenario: + +- **Given** the module configuration: + +``` json +{ + "limits": { + "max_user_output_size": 5 + } +} +``` + +- **Given** the program: + +``` prolog +write_char_to_user_output(C) :- + current_output(UserStream), % get the current output stream + put_char(UserStream, C). % write the char to the user stream +``` + +- **Given** the query: + +``` prolog +write_char_to_user_output(x). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 4043 +answer: + has_more: false + variables: + results: + - substitutions: +user_output: | + x +``` + +### Write characters to the current output (without limit) + +This scenario demonstrates how to write some characters to the current output, and get the content in the response of the +request. This is helpful for debugging purposes. + +Here are the steps of the scenario: + +- **Given** the module configuration: + +``` json +{ + "limits": { + "max_user_output_size": 15 + } +} +``` + +- **Given** the program: + +``` prolog +log_message(Message) :- + current_output(UserStream), % get the current output stream + write(UserStream, Message), % write the message to the user stream + put_char(UserStream, '\n'). +``` + +- **Given** the query: + +``` prolog +log_message('Hello world!'). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 4045 +answer: + has_more: false + variables: + results: + - substitutions: +user_output: | + Hello world! + +``` + +### Write characters to the current output (with limit) + +This scenario demonstrates the process of writing characters to the current user output, with a limit configured +in the logic module. So if the message is longer than this limit, the output will be truncated. + +Here are the steps of the scenario: + +- **Given** the module configuration: + +``` json +{ + "limits": { + "max_user_output_size": 5 + } +} +``` + +- **Given** the program: + +``` prolog +log_message(Message) :- + current_output(UserStream), % get the current output stream + write(UserStream, Message). % write the message to the user stream +``` + +- **Given** the query: + +``` prolog +log_message('Hello world!'). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 4044 +answer: + has_more: false + variables: + results: + - substitutions: +user_output: | + orld! +``` + +### Write UTF-8 character to the current output (with limit) + +This scenario illustrates the impact of UTF-8 characters on output limits measured in bytes, not character count. +Characters such as emojis require more space; for example, the wizard emoji (🧙) occupies 4 bytes, effectively counting +as four units. As a result, the limit is reached more quickly with these characters, which means that the number of +characters in the user output is less than expected. + +Here are the steps of the scenario: + +- **Given** the module configuration: + +``` json +{ + "limits": { + "max_user_output_size": 5 + } +} +``` + +- **Given** the program: + +``` prolog +log_message([]). +log_message([H|T]) :- + current_output(UserStream), + put_char(UserStream, H), + log_message(T). +``` + +- **Given** the query: + +``` prolog +log_message("Hello 🧙!"). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 4065 +answer: + has_more: false + variables: + results: + - substitutions: +user_output: "🧙!" +``` diff --git a/predicates_versioned_docs/version-v11.0.0/did_components_2.md b/predicates_versioned_docs/version-v11.0.0/did_components_2.md new file mode 100644 index 00000000000..8a572afa49a --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/did_components_2.md @@ -0,0 +1,32 @@ +--- +sidebar_position: 17 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# did_components/2 + +## Description + +`did_components/2` is a predicate which breaks down a DID into its components according to the [W3C DID]() specification. + +The signature is as follows: + +```text +did_components(+DID, -Components) is det +did_components(-DID, +Components) is det +``` + +where: + +- DID represent DID URI, given as an Atom, compliant with [W3C DID]() specification. +- Components is a compound Term in the format did\(Method, ID, Path, Query, Fragment\), aligned with the [DID syntax](), where: Method is the method name, ID is the method\-specific identifier, Path is the path component, Query is the query component and Fragment is the fragment component. Values are given as an Atom and are url encoded. For any component not present, its value will be null and thus will be left as an uninstantiated variable. + +## Examples + +```text +# Decompose a DID into its components. +- did_components('did:example:123456?versionId=1', did_components(Method, ID, Path, Query, Fragment)). + +# Reconstruct a DID from its components. +- did_components(DID, did_components('example', '123456', _, 'versionId=1', _42)). +``` diff --git a/predicates_versioned_docs/version-v11.0.0/ecdsa_verify_4.md b/predicates_versioned_docs/version-v11.0.0/ecdsa_verify_4.md new file mode 100644 index 00000000000..39bd6270127 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/ecdsa_verify_4.md @@ -0,0 +1,48 @@ +--- +sidebar_position: 18 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# ecdsa_verify/4 + +## Description + +`ecdsa_verify/4` determines if a given signature is valid as per the ECDSA algorithm for the provided data, using the specified public key. + +The signature is as follows: + +```text +ecdsa_verify(+PubKey, +Data, +Signature, +Options), which is semi-deterministic. +``` + +Where: + +- PubKey is the 33\-byte compressed public key, as specified in section 4.3.6 of ANSI X9.62. + +- Data is the hash of the signed message, which can be either an atom or a list of bytes. + +- Signature represents the ASN.1 encoded signature corresponding to the Data. + +- Options are additional configurations for the verification process. Supported options include: encoding\(\+Format\) which specifies the encoding used for the data, and type\(\+Alg\) which chooses the algorithm within the ECDSA family \(see below for details\). + +For Format, the supported encodings are: + +- hex \(default\), the hexadecimal encoding represented as an atom. +- octet, the plain byte encoding depicted as a list of integers ranging from 0 to 255. +- text, the plain text encoding represented as an atom. +- utf8 \(default\), the UTF\-8 encoding represented as an atom. + +For Alg, the supported algorithms are: + +- secp256r1 \(default\): Also known as P\-256 and prime256v1. +- secp256k1: The Koblitz elliptic curve used in Bitcoin's public\-key cryptography. + +## Examples + +```text +# Verify a signature for hexadecimal data using the ECDSA secp256r1 algorithm. +- ecdsa_verify([127, ...], '9b038f8ef6918cbb56040dfda401b56b...', [23, 56, ...], encoding(hex)) + +# Verify a signature for binary data using the ECDSA secp256k1 algorithm. +- ecdsa_verify([127, ...], [56, 90, ..], [23, 56, ...], [encoding(octet), type(secp256k1)]) +``` diff --git a/predicates_versioned_docs/version-v11.0.0/eddsa_verify_4.md b/predicates_versioned_docs/version-v11.0.0/eddsa_verify_4.md new file mode 100644 index 00000000000..6c668201ef2 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/eddsa_verify_4.md @@ -0,0 +1,44 @@ +--- +sidebar_position: 19 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# eddsa_verify/4 + +## Description + +`eddsa_verify/4` determines if a given signature is valid as per the EdDSA algorithm for the provided data, using the specified public key. + +The signature is as follows: + +```text +eddsa_verify(+PubKey, +Data, +Signature, +Options) is semi-det +``` + +Where: + +- PubKey is the encoded public key as a list of bytes. +- Data is the message to verify, represented as either a hexadecimal atom or a list of bytes. It's important that the message isn't pre\-hashed since the Ed25519 algorithm processes messages in two passes when signing. +- Signature represents the signature corresponding to the data, provided as a list of bytes. +- Options are additional configurations for the verification process. Supported options include: encoding\(\+Format\) which specifies the encoding used for the Data, and type\(\+Alg\) which chooses the algorithm within the EdDSA family \(see below for details\). + +For Format, the supported encodings are: + +- hex \(default\), the hexadecimal encoding represented as an atom. +- octet, the plain byte encoding depicted as a list of integers ranging from 0 to 255. +- text, the plain text encoding represented as an atom. +- utf8 \(default\), the UTF\-8 encoding represented as an atom. + +For Alg, the supported algorithms are: + +- ed25519 \(default\): The EdDSA signature scheme using SHA\-512 \(SHA\-2\) and Curve25519. + +## Examples + +```text +# Verify a signature for a given hexadecimal data. +- eddsa_verify([127, ...], '9b038f8ef6918cbb56040dfda401b56b...', [23, 56, ...], [encoding(hex), type(ed25519)]) + +# Verify a signature for binary data. +- eddsa_verify([127, ...], [56, 90, ..], [23, 56, ...], [encoding(octet), type(ed25519)]) +``` diff --git a/predicates_versioned_docs/version-v11.0.0/hex_bytes_2.md b/predicates_versioned_docs/version-v11.0.0/hex_bytes_2.md new file mode 100644 index 00000000000..7762bf5a02e --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/hex_bytes_2.md @@ -0,0 +1,28 @@ +--- +sidebar_position: 20 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# hex_bytes/2 + +## Description + +`hex_bytes/2` is a predicate that unifies hexadecimal encoded bytes to a list of bytes. + +The signature is as follows: + +```text +hex_bytes(?Hex, ?Bytes) is det +``` + +Where: + +- Hex is an Atom, string or list of characters in hexadecimal encoding. +- Bytes is the list of numbers between 0 and 255 that represent the sequence of bytes. + +## Examples + +```text +# Convert hexadecimal atom to list of bytes. +- hex_bytes('2c26b46b68ffc68ff99b453c1d3041341342d706483bfa0f98a5e886266e7ae', Bytes). +``` diff --git a/predicates_versioned_docs/version-v11.0.0/json_prolog_2.md b/predicates_versioned_docs/version-v11.0.0/json_prolog_2.md new file mode 100644 index 00000000000..27b5d5f4258 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/json_prolog_2.md @@ -0,0 +1,39 @@ +--- +sidebar_position: 21 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# json_prolog/2 + +## Description + +`json_prolog/2` is a predicate that unifies a JSON into a prolog term and vice versa. + +The signature is as follows: + +```text +json_prolog(?Json, ?Term) is det +``` + +Where: + +- Json is the textual representation of the JSON, as either an atom, a list of character codes, or a list of characters. +- Term is the Prolog term that represents the JSON structure. + +## JSON canonical representation + +The canonical representation for Term is: + +- A JSON object is mapped to a Prolog term json\(NameValueList\), where NameValueList is a list of Name=Value key values. Name is an atom created from the JSON string. +- A JSON array is mapped to a Prolog list of JSON values. +- A JSON string is mapped to a Prolog atom. +- A JSON number is mapped to a Prolog number. +- The JSON constants true and false are mapped to @\(true\) and @\(false\). +- The JSON constant null is mapped to the Prolog term @\(null\). + +## Examples + +```text +# JSON conversion to Prolog. +- json_prolog('{"foo": "bar"}', json([foo=bar])). +``` diff --git a/predicates_versioned_docs/version-v11.0.0/json_read_2.md b/predicates_versioned_docs/version-v11.0.0/json_read_2.md new file mode 100644 index 00000000000..3fdf10ee6e7 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/json_read_2.md @@ -0,0 +1,23 @@ +--- +sidebar_position: 22 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# json_read/2 + +## Description + +`json_read/2` is a predicate that reads a JSON from a stream and unifies it with a Prolog term. + +See json\_prolog/2 for the canonical representation of the JSON term. + +The signature is as follows: + +```text +json_read(+Stream, ?Term) is det +``` + +Where: + +- Stream is the input stream from which the JSON is read. +- Term is the Prolog term that represents the JSON structure. diff --git a/predicates_versioned_docs/version-v11.0.0/json_write_2.md b/predicates_versioned_docs/version-v11.0.0/json_write_2.md new file mode 100644 index 00000000000..b893e0fca7e --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/json_write_2.md @@ -0,0 +1,23 @@ +--- +sidebar_position: 23 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# json_write/2 + +## Description + +`json_write/2` is a predicate that writes a Prolog term as a JSON to a stream. + +The JSON object is of the same format as produced by json\_read/2. + +The signature is as follows: + +```text +json_write(+Stream, +Term) is det +``` + +Where: + +- Stream is the output stream to which the JSON is written. +- Term is the Prolog term that represents the JSON structure. diff --git a/predicates_versioned_docs/version-v11.0.0/open_3.md b/predicates_versioned_docs/version-v11.0.0/open_3.md new file mode 100644 index 00000000000..778a39b3177 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/open_3.md @@ -0,0 +1,71 @@ +--- +sidebar_position: 25 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# open/3 + +## Description + +`open/3` is a predicate which opens a stream to a source or sink. This predicate is a shorthand for open/4 with an empty list of options. + +## Signature + +```text +open(+SourceSink, +Mode, -Stream) +``` + +where: + +- SourceSink is an atom representing the source or sink of the stream, which is typically a URI. +- Mode is an atom representing the mode of the stream to be opened. It can be one of "read", "write", or "append". +- Stream is the stream to be opened. + +open/3 gives True when SourceSink can be opened in Mode. + +## Examples + +### Open a resource for reading + +This scenario showcases the procedure for accessing a resource stored within a CosmWasm smart contract for reading +purposes and obtaining the stream's properties. + +See the `open/4` predicate for a more detailed example. + +Here are the steps of the scenario: + +- **Given** the CosmWasm smart contract "axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk" and the behavior: + +``` yaml +message: | + { + "object_data": { + "id": "4cbe36399aabfcc7158ee7a66cbfffa525bb0ceab33d1ff2cff08759fe0a9b05" + } + } +response: | + Hello, World! +``` + +- **Given** the query: + +``` prolog +open( + 'cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk?query=%7B%22object_data%22%3A%7B%22id%22%3A%20%224cbe36399aabfcc7158ee7a66cbfffa525bb0ceab33d1ff2cff08759fe0a9b05%22%7D%7D&base64Decode=false', + read, + _ +). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3976 +answer: + has_more: false + variables: + results: + - substitutions: +``` diff --git a/predicates_versioned_docs/version-v11.0.0/open_4.md b/predicates_versioned_docs/version-v11.0.0/open_4.md new file mode 100644 index 00000000000..dbefa51a2b5 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/open_4.md @@ -0,0 +1,315 @@ +--- +sidebar_position: 24 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# open/4 + +## Description + +`open/4` is a predicate which opens a stream to a source or sink. + +## Signature + +```text +open(+SourceSink, +Mode, -Stream, +Options) +``` + +where: + +- SourceSink is an atom representing the source or sink of the stream, which is typically a URI. +- Mode is an atom representing the mode of the stream to be opened. It can be one of "read", "write", or "append". +- Stream is the stream to be opened. +- Options is a list of options. No options are currently defined, so the list should be empty. + +open/4 gives True when SourceSink can be opened in Mode with the given Options. + +## Virtual File System \\\(VFS\\\) + +The logical module interprets on\-chain Prolog programs, relying on a Virtual Machine that isolates execution from the external environment. Consequently, the open/4 predicate doesn't access the physical file system as one might expect. Instead, it operates with a Virtual File System \(VFS\), a conceptual layer that abstracts the file system. This abstraction offers a unified view across various storage systems, adhering to the constraints imposed by blockchain technology. + +This VFS extends the file concept to resources, which are identified by a Uniform Resource Identifier \(URI\). A URI specifies the access protocol for the resource, its path, and any necessary parameters. + +## CosmWasm URI + +The cosmwasm URI enables interaction with instantiated CosmWasm smart contract on the blockchain. The URI is used to query the smart contract and retrieve the response. The query is executed on the smart contract, and the response is returned as a stream. Query parameters are passed as part of the URI to customize the interaction with the smart contract. + +Its format is as follows: + +```text +cosmwasm:{contract_name}:{contract_address}?query={contract_query}[&base64Decode={true|false}] +``` + +where: + +- \{contract\_name\}: For informational purposes, indicates the name or type of the smart contract \(e.g., "axone\-objectarium"\). +- \{contract\_address\}: Specifies the smart contract instance to query. +- \{contract\_query\}: The query to be executed on the smart contract. It is a JSON object that specifies the query payload. +- base64Decode: \(Optional\) If true, the response is base64\-decoded. Otherwise, the response is returned as is. + +## Examples + +### Open a resource for reading + +This scenario showcases the procedure for accessing a resource stored within a CosmWasm smart contract for reading +purposes and obtaining the stream's properties. + +Assuming the existence of a CosmWasm smart contract configured to store resources, we construct a URI to specifically +identify the smart contract and pinpoint the resource we aim to retrieve via a query message. + +Here are the steps of the scenario: + +- **Given** the CosmWasm smart contract "axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk" and the behavior: + +``` yaml +message: | + { + "object_data": { + "id": "4cbe36399aabfcc7158ee7a66cbfffa525bb0ceab33d1ff2cff08759fe0a9b05" + } + } +response: | + Hello, World! +``` + +- **Given** the program: + +``` prolog +atomic_list_concat([], ''). +atomic_list_concat([H|T], Atom) :- + atomic_list_concat(T, TAtom), + atom_concat(H, TAtom, Atom). + +resource_uri(Contract, Query, URI) :- + uri_encoded(query_value, Query, EncodedQuery), + atomic_list_concat(['cosmwasm:storage:', Contract, '?query=', EncodedQuery, '&base64Decode=false'], URI). +``` + +- **Given** the query: + +``` prolog +resource_uri( + 'axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk', + '{"object_data":{"id": "4cbe36399aabfcc7158ee7a66cbfffa525bb0ceab33d1ff2cff08759fe0a9b05"}}', + URI), +open(URI, read, _, []). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3988 +answer: + has_more: false + variables: ["URI"] + results: + - substitutions: + - variable: URI + expression: "'cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk?query=%7B%22object_data%22%3A%7B%22id%22%3A%20%224cbe36399aabfcc7158ee7a66cbfffa525bb0ceab33d1ff2cff08759fe0a9b05%22%7D%7D&base64Decode=false'" +``` + +### Open an existing resource and read its content + +This scenario shows a more complex example of how to open an existing resource stored in a CosmWasm smart contract +and read its content. + +The resource is opened for reading, and the content is read into a list of characters. Finally, the stream is closed. + +Here are the steps of the scenario: + +- **Given** the CosmWasm smart contract "axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk" and the behavior: + +``` yaml +message: | + { + "object_data": { + "id": "4cbe36399aabfcc7158ee7a66cbfffa525bb0ceab33d1ff2cff08759fe0a9b05" + } + } +response: | + Hello, World! +``` + +- **Given** the program: + +``` prolog +read_resource(Resource, Chars) :- + open(Resource, read, Stream, []), + read_string(Stream, _, Chars), + close(Stream). +``` + +- **Given** the query: + +``` prolog +read_resource('cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk?query=%7B%22object_data%22%3A%7B%22id%22%3A%20%224cbe36399aabfcc7158ee7a66cbfffa525bb0ceab33d1ff2cff08759fe0a9b05%22%7D%7D&base64Decode=false', Chars). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3979 +answer: + has_more: false + variables: ["Chars"] + results: + - substitutions: + - variable: Chars + expression: "'Hello, World!'" +``` + +### Open an existing resource and read its content (base64-encoded) + +This scenario is a variation of the previous one. The difference is that the smart contract returns a base64-encoded +response. For this reason, we set the `base64Decode` parameter to `true` in the query (the default value is `false`). + +Here are the steps of the scenario: + +- **Given** the CosmWasm smart contract "axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk" and the behavior: + +``` yaml +message: | + { + "object_data": { + "id": "4cbe36399aabfcc7158ee7a66cbfffa525bb0ceab33d1ff2cff08759fe0a9b05" + } + } +response: | + "SGVsbG8sIFdvcmxkIQ==" +``` + +- **Given** the program: + +``` prolog +read_resource(Resource, Chars) :- + open(Resource, read, Stream, []), + read_string(Stream, _, Chars), + close(Stream). +``` + +- **Given** the query: + +``` prolog +read_resource('cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk?query=%7B%22object_data%22%3A%7B%22id%22%3A%20%224cbe36399aabfcc7158ee7a66cbfffa525bb0ceab33d1ff2cff08759fe0a9b05%22%7D%7D&base64Decode=true', Chars). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3979 +answer: + has_more: false + variables: ["Chars"] + results: + - substitutions: + - variable: Chars + expression: "'Hello, World!'" +``` + +### Try to open a non-existing resource + +This scenario demonstrates the system's response to trying to open a non-existing resource. + +Here are the steps of the scenario: + +- **Given** the query: + +``` prolog +open('cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk?query=foo', read, Stream, []). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3975 +answer: + has_more: false + variables: ["Stream"] + results: + - error: "error(existence_error(source_sink,cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk?query=foo),open/4)" +``` + +### Try to open a resource for writing + +This scenario demonstrates the system's response to opening a resource for writing, but the resource does not allow +writing. This is the case for resources hosted in smart contracts which are read-only. + +Here are the steps of the scenario: + +- **Given** the query: + +``` prolog +open('cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk?query=foo', write, Stream, []). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3975 +answer: + has_more: false + variables: ["Stream"] + results: + - error: "error(permission_error(input,stream,cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk?query=foo),open/4)" +``` + +### Try to open a resource for appending + +This scenario demonstrates the system's response to opening a resource for appending, but the resource does not allow +appending. This is the case for resources hosted in smart contracts which are read-only. + +Here are the steps of the scenario: + +- **Given** the query: + +``` prolog +open('cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk?query=foo', write, Stream, []). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3975 +answer: + has_more: false + variables: ["Stream"] + results: + - error: "error(permission_error(input,stream,cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk?query=foo),open/4)" +``` + +### Pass incorrect options to open/4 + +This scenario demonstrates the system's response to opening a resource with incorrect options. + +Here are the steps of the scenario: + +- **Given** the query: + +``` prolog +open('cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3tsrhsdrk?query=foo', read, Stream, [non_existing_option]). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3975 +answer: + has_more: false + variables: ["Stream"] + results: + - error: "error(domain_error(empty_list,[non_existing_option]),open/4)" +``` diff --git a/predicates_versioned_docs/version-v11.0.0/read_string_3.md b/predicates_versioned_docs/version-v11.0.0/read_string_3.md new file mode 100644 index 00000000000..4499960fa5c --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/read_string_3.md @@ -0,0 +1,39 @@ +--- +sidebar_position: 26 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# read_string/3 + +## Description + +`read_string/3` is a predicate that reads characters from the provided Stream and unifies them with String. Users can optionally specify a maximum length for reading; if the stream reaches this length, the reading stops. If Length remains unbound, the entire Stream is read, and upon completion, Length is unified with the count of characters read. + +The signature is as follows: + +```text +read_string(+Stream, ?Length, -String) is det +``` + +Where: + +- Stream is the input stream to read from. +- Length is the optional maximum number of characters to read from the Stream. If unbound, denotes the full length of Stream. +- String is the resultant string after reading from the Stream. + +## Examples + +```text +# Given a file `foo.txt` that contains `Hello World`: + + file_to_string(File, String, Length) :- + open(File, read, In), + read_string(In, Length, String), + close(Stream). + +# It gives: +?- file_to_string('path/file/foo.txt', String, Length). + +String = 'Hello World' +Length = 11 +``` diff --git a/predicates_versioned_docs/version-v11.0.0/read_term_3.md b/predicates_versioned_docs/version-v11.0.0/read_term_3.md new file mode 100644 index 00000000000..ca53a8be91d --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/read_term_3.md @@ -0,0 +1,28 @@ +--- +sidebar_position: 27 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# read_term/3 + +## Description + +`read_term/3` is a predicate that reads a term from a stream or alias. + +The signature is as follows: + +```text +read_term(+Stream, -Term, +Options) +``` + +where: + +- Stream represents the stream or alias to read the term from. +- Term represents the term to read. +- Options represents the options to control the reading process. + +Valid options are: + +- singletons\(Vars\): Vars is unified with a list of variables that occur only once in the term. +- variables\(Vars\): Vars is unified with a list of variables that occur in the term. +- variable\_names\(Vars\): Vars is unified with a list of Name = Var terms, where Name is an atom and Var is a variable. diff --git a/predicates_versioned_docs/version-v11.0.0/retract_1.md b/predicates_versioned_docs/version-v11.0.0/retract_1.md new file mode 100644 index 00000000000..e78cf6b8a11 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/retract_1.md @@ -0,0 +1,80 @@ +--- +sidebar_position: 28 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# retract/1 + +## Description + +`retract/1` is a predicate that retracts a clause from the database. + +## Signature + +```text +retract(+Clause) +``` + +Where: + +- Clause is the clause to retract from the database. + +## Examples + +### Retract a fact from the database + +This scenario demonstrates the process of retracting a fact from a Prolog database. In Prolog, retracting a fact means +removing a piece of information or *knowledge* from the database, making it unavailable for subsequent queries. +This is particularly useful when you want to dynamically remove facts or rules based on conditions or interactions +during runtime. + +Here are the steps of the scenario: + +- **Given** the query: + +``` prolog +assertz(parent(john, alice)), retract(parent(john, alice)), parent(X, Y). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3977 +answer: + has_more: false + variables: ["X","Y"] + results: +``` + +### Only dynamic predicates can be retracted + +This scenario demonstrates that only dynamic predicates can be retracted. In Prolog, dynamic predicates are those that can be +modified during runtime. This is in contrast to static predicates, which are fixed and cannot be modified. + +Here are the steps of the scenario: + +- **Given** the program: + +``` prolog +parent(jane, alice). +``` + +- **Given** the query: + +``` prolog +retract(parent(jane, alice)). +``` + +- **When** the query is run +- **Then** the answer we get is: + +``` yaml +height: 42 +gas_used: 3975 +answer: + has_more: false + results: + - error: "error(permission_error(modify,static_procedure,parent/2),retract/1)" +``` diff --git a/predicates_versioned_docs/version-v11.0.0/source_file_1.md b/predicates_versioned_docs/version-v11.0.0/source_file_1.md new file mode 100644 index 00000000000..49460027fd2 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/source_file_1.md @@ -0,0 +1,20 @@ +--- +sidebar_position: 29 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# source_file/1 + +## Description + +`source_file/1` is a predicate which unifies the given term with the source file that is currently loaded. + +## Signature + +```text +source_file(?File) is det +``` + +where: + +- File represents the loaded source file. diff --git a/predicates_versioned_docs/version-v11.0.0/string_bytes_3.md b/predicates_versioned_docs/version-v11.0.0/string_bytes_3.md new file mode 100644 index 00000000000..3370c600159 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/string_bytes_3.md @@ -0,0 +1,36 @@ +--- +sidebar_position: 30 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# string_bytes/3 + +## Description + +`string_bytes/3` is a predicate that unifies a string with a list of bytes, returning true when the \(Unicode\) String is represented by Bytes in Encoding. + +The signature is as follows: + +```text +string_bytes(?String, ?Bytes, +Encoding) +``` + +Where: + +- String is the string to convert to bytes. It can be an Atom, string or list of characters codes. +- Bytes is the list of numbers between 0 and 255 that represent the sequence of bytes. +- Encoding is the encoding to use for the conversion. + +Encoding can be one of the following: \- 'text' considers the string as a sequence of Unicode characters. \- 'octet' considers the string as a sequence of bytes. \- '\' considers the string as a sequence of characters in the given encoding. + +At least one of String or Bytes must be instantiated. + +## Examples + +```text +# Convert a string to a list of bytes. +- string_bytes('Hello World', Bytes, octet). + +# Convert a list of bytes to a string. +- string_bytes(String, [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100], octet). +``` diff --git a/predicates_versioned_docs/version-v11.0.0/term_to_atom_2.md b/predicates_versioned_docs/version-v11.0.0/term_to_atom_2.md new file mode 100644 index 00000000000..ca76db69efa --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/term_to_atom_2.md @@ -0,0 +1,30 @@ +--- +sidebar_position: 31 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# term_to_atom/2 + +## Description + +`term_to_atom/2` is a predicate that describes Atom as a term that unifies with Term. + +## Signature + +```text +term_to_atom(?Term, ?Atom) +``` + +where: + +- Term is a term that unifies with Atom. +- Atom is an atom. + +When Atom is instantiated, Atom is parsed and the result unified with Term. If Atom has no valid syntax, a syntax\_error exception is raised. Otherwise, Term is “written” on Atom using write\_term/2 with the option quoted\(true\). + +## Example + +```text +# Convert the atom to a term. +- term_to_atom(foo, foo). +``` diff --git a/predicates_versioned_docs/version-v11.0.0/uri_encoded_3.md b/predicates_versioned_docs/version-v11.0.0/uri_encoded_3.md new file mode 100644 index 00000000000..4f82d9d6b81 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/uri_encoded_3.md @@ -0,0 +1,35 @@ +--- +sidebar_position: 32 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# uri_encoded/3 + +## Description + +`uri_encoded/3` is a predicate that unifies the given URI component with the given encoded or decoded string. + +The signature is as follows: + +```text +uri_encoded(+Component, +Value, -Encoded) is det +uri_encoded(+Component, -Value, +Encoded) is det +``` + +Where: + +- Component represents the component of the URI to be escaped. It can be the atom 'query\_path', 'fragment', 'path' or 'segment'. +- Decoded represents the decoded string to be escaped. +- Encoded represents the encoded string. + +For more information on URI encoding, refer to [RFC 3986](). + +## Examples + +```text +# Escape the given string to be used in the path component. +- uri_encoded(path, "foo/bar", Encoded). + +# Unescape the given string to be used in the path component. +- uri_encoded(path, Decoded, foo%2Fbar). +``` diff --git a/predicates_versioned_docs/version-v11.0.0/write_term_3.md b/predicates_versioned_docs/version-v11.0.0/write_term_3.md new file mode 100644 index 00000000000..dbfcc3a93a2 --- /dev/null +++ b/predicates_versioned_docs/version-v11.0.0/write_term_3.md @@ -0,0 +1,30 @@ +--- +sidebar_position: 33 +--- +[//]: # (This file is auto-generated. Please do not modify it yourself.) + +# write_term/3 + +## Description + +`write_term/3` is a predicate that writes a term to a stream or alias. + +The signature is as follows: + +```text +write_term(+Stream, +Term, +Options) +``` + +where: + +- Stream represents the stream or alias to write the term to. +- Term represents the term to write. +- Options represents the options to control the writing process. + +Valid options are: + +- quoted\(Bool\): If true, atoms and strings that need quotes will be quoted. The default is false. +- ignore\_ops\(Bool\): If true, the generic term representation \(\\(\ ... \)\) will be used for all terms. Otherwise \(default\), operators will be used where appropriate. +- numbervars\(Bool\): If true, variables will be numbered. The default is false. +- variable\_names\(\+List\): Assign names to variables in Term. List is a list of Name = Var terms, where Name is an atom and Var is a variable. +- max\_depth\(\+Int\): The maximum depth to which the term is written. The default is infinite. diff --git a/predicates_versioned_sidebars/version-v11.0.0-sidebars.json b/predicates_versioned_sidebars/version-v11.0.0-sidebars.json new file mode 100644 index 00000000000..cff0c94e170 --- /dev/null +++ b/predicates_versioned_sidebars/version-v11.0.0-sidebars.json @@ -0,0 +1,8 @@ +{ + "defaultSidebar": [ + { + "type": "autogenerated", + "dirName": "." + } + ] +} diff --git a/predicates_versions.json b/predicates_versions.json index 14a93d331b6..b2e8f87c427 100644 --- a/predicates_versions.json +++ b/predicates_versions.json @@ -1,3 +1,4 @@ [ + "v11.0.0", "v10.0.0" ]